AgentSkillsCN

Newday Production Ai

Newday 生产 AI

SKILL.md

SKILL.md - NewDayProductionAI API Interface

Overview

Comprehensive interface to New Day Church's production infrastructure database at productionai.newdaychurch.cc (internal: 10.10.40.91:3002).

This API manages 97+ devices, 104+ wire connections, integration notes, software tracking, and signal flow visualization for the church's AV production environment.


Connection Details

PropertyValue
Base URLhttp://10.10.40.91:3002/api
AuthenticationNone (CORS-enabled, trusted network)
WebSocketws://10.10.40.91:8080 (real-time updates)
FormatJSON

Core Resources

ResourceEndpointsPurpose
DevicesGET/POST/PUT/DELETE /devices, /devices/:idEquipment inventory (97 devices)
WiresGET/POST/PUT/DELETE /wires, /wires/:idPhysical connections (104 wires)
Integration NotesGET/POST/PUT/DELETE /integration-notesTroubleshooting, setup, docs
SoftwareGET/POST/PUT/DELETE /softwareApplication tracking
Device-SoftwareGET/POST/DELETE /device_softwareInstall associations
Signal Flow LayoutsGET/POST/PUT/DELETE /signal_flow_layoutsVisual configurations
SettingsGET/POST/PUT/DELETE /settings/:keyApp configuration
ATEM ConfigsGET/POST/PUT/DELETE /atem_simulator_configsSwitcher configurations
DatabaseGET/POST /database/export, /database/importBackup/restore

Common Workflows

🔍 Find Device Information

By name (fuzzy):

bash
curl -s http://10.10.40.91:3002/api/devices | jq '.[] | select(.device_name | contains("ATEM"))'

By unique_id:

bash
curl -s http://10.10.40.91:3002/api/devices/DEV_023

By IP address:

bash
curl -s http://10.10.40.91:3002/api/devices | jq '.[] | select(.ip_address == "10.10.40.28")'

By location:

bash
curl -s http://10.10.40.91:3002/api/devices | jq '.[] | select(.location == "Production")'

🔐 Get Credentials

All devices with passwords:

bash
curl -s http://10.10.40.91:3002/api/devices | jq '.[] | select(.password != "" and .password != null) | {name: .device_name, user: .username, pass: .password, ip: .ip_address}'

Specific device:

bash
curl -s http://10.10.40.91:3002/api/devices/DEV_037 | jq '{name: .device_name, username: .username, password: .password, ip: .ip_address}'

📡 Signal Flow Tracing

Get wire connections:

bash
curl -s http://10.10.40.91:3002/api/wires | jq '.[] | {from: .source_device_id, to: .destination_device_id, type: .signal_type}'

Trace from device:

bash
curl -s http://10.10.40.91:3002/api/wires | jq '.[] | select(.source_device_id == "device-uuid-here")'

Full path (device → wire → device):

bash
# Get all wires with device names
curl -s http://10.10.40.91:3002/api/wires | jq '[.[] | {wire_id: .id, from_port: .source_port_id, to_port: .destination_port_id, signal: .signal_type}]'

📝 Integration Notes

All notes:

bash
curl -s http://10.10.40.91:3002/api/integration-notes

Notes for specific device:

bash
curl -s http://10.10.40.91:3002/api/integration-notes/device/DEV_023

By note type:

bash
curl -s http://10.10.40.91:3002/api/integration-notes | jq '.[] | select(.note_type == "troubleshooting")'

By priority:

bash
curl -s http://10.10.40.91:3002/api/integration-notes | jq '.[] | select(.priority == "critical")'

🔧 Troubleshooting Lookup

Device with troubleshooting notes:

bash
curl -s http://10.10.40.91:3002/api/devices/DEV_041 | jq '{name: .device_name, notes: .troubleshooting_notes}'

All devices with notes:

bash
curl -s http://10.10.40.91:3002/api/devices | jq '.[] | select(.troubleshooting_notes | length > 0) | {id: .unique_id, name: .device_name, notes: .troubleshooting_notes}'

📅 Replacement Schedule

All devices sorted by replacement year:

bash
curl -s http://10.10.40.91:3002/api/devices | jq -s 'sort_by(.replacement_year) | .[] | select(.replacement_year != null) | "\(.replacement_year): \(.device_name) (\(.unique_id))"'

Overdue devices:

bash
curl -s http://10.10.40.91:3002/api/devices | jq '.[] | select(.replacement_year <= 2026) | {name: .device_name, replace_by: .replacement_year, purchased: .purchased_year}'

By lifespan remaining:

bash
curl -s http://10.10.40.91:3002/api/devices | jq '.[] | select(.years_until_replace != null) | {name: .device_name, years: .years_until_replace, replace_year: .replacement_year}'

🌐 Network Status

Offline devices (ping failure):

bash
curl -s http://10.10.40.91:3002/api/devices | jq '.[] | select(.ping_responding == false) | {name: .device_name, last_seen: .ping_last_change}'

Online devices:

bash
curl -s http://10.10.40.91:3002/api/devices | jq '.[] | select(.ping_responding == true) | .device_name'

Unknown status:

bash
curl -s http://10.10.40.91:3002/api/devices | jq '.[] | select(.ping_responding == null) | .device_name'

💾 Software Tracking

All software:

bash
curl -s http://10.10.40.91:3002/api/software

Software on specific device:

bash
curl -s http://10.10.40.91:3002/api/device_software | jq '.[] | select(.device_id == "device-uuid")'

🎛️ ATEM Configuration

All ATEM configs:

bash
curl -s http://10.10.40.91:3002/api/atem_simulator_configs

By device:

bash
curl -s http://10.10.40.91:3002/api/atem_simulator_configs/device/DEV_023

Updating Data

Update Device Field

bash
curl -s -X PUT http://10.10.40.91:3002/api/devices/DEV_023 \
  -H "Content-Type: application/json" \
  -d '{"troubleshooting_notes": "New troubleshooting info here"}'

Updatable fields:

  • device_name, device_type, model
  • ip_address, username, password
  • campus, location, description
  • software_installed, troubleshooting_notes
  • purchased_year, years_until_replace, replacement_year
  • available_ports, port_mapping

Create Integration Note

bash
curl -s -X POST http://10.10.40.91:3002/api/integration-notes \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Network Issue Resolved",
    "note_type": "troubleshooting",
    "note_text": "Fixed by rebooting switch",
    "priority": "medium",
    "tags": ["network", "switch"],
    "device_ids": ["DEV_023"],
    "software_ids": []
  }'

Update Wire

bash
curl -s -X PUT http://10.10.40.91:3002/api/wires/123 \
  -H "Content-Type: application/json" \
  -d '{"wire_label": "Updated label", "notes": "Cable tested good"}'

Database Schema Reference

Device Fields

FieldTypeDescription
idUUIDPrimary key
unique_idStringUser-defined (DEV_001, etc.)
device_nameStringDisplay name
device_typeStringcamera, monitor, converter, etc.
modelStringManufacturer model
ip_addressStringNetwork address
usernameStringLogin credential
passwordStringLogin credential
campusStringLocation campus
locationStringPhysical location
descriptionStringGeneral description
software_installedStringDeprecated (use device_software)
troubleshooting_notesStringFixes and issues
purchased_yearIntegerYear acquired
years_until_replaceIntegerExpected lifespan
replacement_yearIntegerAuto-calculated
available_portsJSONBPort definitions
port_mappingJSONBRouting rules
ping_respondingBooleanOnline status
ping_last_changeTimestampLast status change
embeddingVectorAI embedding (1536 dim)

Wire Fields

FieldTypeDescription
idIntegerPrimary key
source_device_idUUIDFrom device
destination_device_idUUIDTo device
source_port_idStringPort on source
destination_port_idStringPort on dest
wire_typeStringPhysical type
wire_labelStringUser label
signal_typeStringHDMI, SDI, XLR, etc.
signal_flow_chainJSONBCalculated path
statusStringactive, inactive

Integration Note Fields

FieldTypeDescription
idIntegerPrimary key
titleStringNote title
note_typeStringsetup, repair, update, troubleshooting, modification
note_textStringContent
priorityStringlow, medium, high, critical
tagsArrayCustom tags
device_idsArrayAssociated devices
software_idsArrayAssociated software

Helper Scripts

Located at: ~/.openclaw/workspace/scripts/production-db/

Example: Quick Device Lookup

bash
#!/bin/bash
# device-info.sh - Get device details by name or ID

DEVICE_QUERY="$1"
API="http://10.10.40.91:3002/api"

# Try unique_id first, then name search
RESULT=$(curl -s "$API/devices/$DEVICE_QUERY" | jq -r '.unique_id // empty')

if [ -z "$RESULT" ]; then
  # Search by name
  curl -s "$API/devices" | jq --arg q "$DEVICE_QUERY" '.[] | select(.device_name | contains($q))'
else
  curl -s "$API/devices/$DEVICE_QUERY"
fi

Example: Trace Signal Path

bash
#!/bin/bash
# trace-signal.sh - Follow signal from source to destination

SOURCE_ID="$1"
API="http://10.10.40.91:3002/api"

echo "Tracing signal from device: $SOURCE_ID"
curl -s "$API/wires" | jq --arg src "$SOURCE_ID" '.[] | select(.source_device_id == $src)'

Example: Offline Report

bash
#!/bin/bash
# offline-report.sh - List all offline devices

API="http://10.10.40.91:3002/api"
echo "=== OFFLINE DEVICES ==="
curl -s "$API/devices" | jq -r '.[] | select(.ping_responding == false) | "\(.unique_id): \(.device_name) (Last: \(.ping_last_change // "Never"))"'

Security Notes

⚠️ Current API has no authentication — runs on trusted internal network only.

Sensitive data in API:

  • IP addresses (10.x.x.x private range)
  • Device passwords (stored in plaintext in descriptions)
  • License keys (Dante, etc.)

Access control:

  • Network-level only
  • No user authentication
  • No audit logging

Recommendations:

  • Keep API on internal network only
  • VPN for external access
  • Consider API key auth for future

Common Issues

Device ID Format

  • GET/PUT/DELETE uses unique_id (e.g., DEV_023) ✓
  • NOT the UUID (e.g., e3b8c69c-...) ✗

Port References

  • Always use source_port_id / destination_port_id
  • Must match available_ports.inputs[].id or outputs[].id

Embeddings

  • Must be exactly 1536 dimensions
  • Invalid embeddings silently skipped
  • Use OpenAI text-embedding-ada-002 format

Real-time Updates

  • WebSocket on port 8080
  • Channels: device_ping_update, wire_change, device_change
  • Separate from REST API

Usage Examples

"What's connected to the ATEM?"

bash
curl -s http://10.10.40.91:3002/api/wires | jq '.[] | select(.destination_device_id | contains("DEV_023")) | {from: .source_port_id, to: .destination_port_id, type: .signal_type}'

"Show me all passwords for today's troubleshooting"

bash
curl -s http://10.10.40.91:3002/api/devices | jq '.[] | select(.password != "" and .password != null) | "\(.device_name): \(.username) / \(.password)"'

"What needs replacement this year?"

bash
curl -s http://10.10.40.91:3002/api/devices | jq '.[] | select(.replacement_year == 2026) | "\(.device_name) (\(.unique_id)) - Purchased: \(.purchased_year)"'

"Find troubleshooting notes for audio issues"

bash
curl -s http://10.10.40.91:3002/api/integration-notes | jq '.[] | select(.tags | contains(["audio"])) | {title: .title, devices: [.devices[].device_name]}'

Related Skills

  • asana — Task management for maintenance
  • slack — Alerts for offline devices
  • gog — Email integration for reports

Last updated: 2026-02-03
API Version: 1.0
Devices: 97 | Wires: 104 | Notes: 33