@synap-core/cli 1.11.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +40 -198
- package/dist/build-info.json +6 -0
- package/dist/commands/agent-run.js +3 -2
- package/dist/commands/agent-run.js.map +1 -1
- package/dist/commands/agents.d.ts +32 -17
- package/dist/commands/agents.js +203 -237
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/app.d.ts +143 -0
- package/dist/commands/app.js +524 -0
- package/dist/commands/app.js.map +1 -0
- package/dist/commands/automate.d.ts +21 -0
- package/dist/commands/automate.js +42 -0
- package/dist/commands/automate.js.map +1 -0
- package/dist/commands/automation-schema.test.d.ts +16 -0
- package/dist/commands/automation-schema.test.js +77 -0
- package/dist/commands/automation-schema.test.js.map +1 -0
- package/dist/commands/automation.d.ts +12 -0
- package/dist/commands/automation.js +116 -66
- package/dist/commands/automation.js.map +1 -1
- package/dist/commands/box.d.ts +42 -0
- package/dist/commands/box.js +89 -0
- package/dist/commands/box.js.map +1 -0
- package/dist/commands/bridge-setup.d.ts +14 -1
- package/dist/commands/bridge-setup.js +395 -129
- package/dist/commands/bridge-setup.js.map +1 -1
- package/dist/commands/cap-connections.d.ts +4 -4
- package/dist/commands/cap-connections.js +14 -14
- package/dist/commands/cap-connections.js.map +1 -1
- package/dist/commands/capability.d.ts +3 -1
- package/dist/commands/capability.js +249 -176
- package/dist/commands/capability.js.map +1 -1
- package/dist/commands/catalog.d.ts +275 -0
- package/dist/commands/catalog.js +481 -0
- package/dist/commands/catalog.js.map +1 -0
- package/dist/commands/cell.d.ts +155 -8
- package/dist/commands/cell.js +416 -40
- package/dist/commands/cell.js.map +1 -1
- package/dist/commands/centrality.js +1 -13
- package/dist/commands/centrality.js.map +1 -1
- package/dist/commands/close-questions.d.ts +27 -0
- package/dist/commands/close-questions.js +49 -0
- package/dist/commands/close-questions.js.map +1 -0
- package/dist/commands/close-questions.test.d.ts +1 -0
- package/dist/commands/close-questions.test.js +52 -0
- package/dist/commands/close-questions.test.js.map +1 -0
- package/dist/commands/connect.d.ts +36 -13
- package/dist/commands/connect.js +68 -167
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/connections.d.ts +3 -2
- package/dist/commands/connections.js +95 -25
- package/dist/commands/connections.js.map +1 -1
- package/dist/commands/context.js +79 -44
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/data-extra.d.ts +34 -0
- package/dist/commands/data-extra.js +203 -25
- package/dist/commands/data-extra.js.map +1 -1
- package/dist/commands/data.d.ts +120 -2
- package/dist/commands/data.js +295 -21
- package/dist/commands/data.js.map +1 -1
- package/dist/commands/diagnose.d.ts +66 -4
- package/dist/commands/diagnose.js +285 -28
- package/dist/commands/diagnose.js.map +1 -1
- package/dist/commands/doc.d.ts +11 -4
- package/dist/commands/doc.js +39 -14
- package/dist/commands/doc.js.map +1 -1
- package/dist/commands/doctor.d.ts +133 -3
- package/dist/commands/doctor.js +761 -41
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/explain.js +5 -5
- package/dist/commands/explain.js.map +1 -1
- package/dist/commands/hooks.d.ts +19 -0
- package/dist/commands/hooks.js +70 -0
- package/dist/commands/hooks.js.map +1 -0
- package/dist/commands/import.d.ts +393 -13
- package/dist/commands/import.js +1150 -54
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/init.d.ts +34 -9
- package/dist/commands/init.js +481 -981
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/keys.d.ts +1 -0
- package/dist/commands/keys.js +15 -2
- package/dist/commands/keys.js.map +1 -1
- package/dist/commands/knowledge.d.ts +22 -6
- package/dist/commands/knowledge.js +121 -57
- package/dist/commands/knowledge.js.map +1 -1
- package/dist/commands/lens.d.ts +37 -1
- package/dist/commands/lens.js +194 -72
- package/dist/commands/lens.js.map +1 -1
- package/dist/commands/market-authoring.d.ts +29 -2
- package/dist/commands/market-authoring.js +348 -7
- package/dist/commands/market-authoring.js.map +1 -1
- package/dist/commands/market-official.d.ts +58 -0
- package/dist/commands/market-official.js +84 -0
- package/dist/commands/market-official.js.map +1 -0
- package/dist/commands/market.d.ts +400 -16
- package/dist/commands/market.js +1802 -146
- package/dist/commands/market.js.map +1 -1
- package/dist/commands/mcp.d.ts +60 -25
- package/dist/commands/mcp.js +251 -64
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/observe.category.test.d.ts +1 -0
- package/dist/commands/observe.category.test.js +59 -0
- package/dist/commands/observe.category.test.js.map +1 -0
- package/dist/commands/observe.d.ts +3 -0
- package/dist/commands/observe.js +7 -5
- package/dist/commands/observe.js.map +1 -1
- package/dist/commands/observe.title.test.d.ts +1 -0
- package/dist/commands/observe.title.test.js +37 -0
- package/dist/commands/observe.title.test.js.map +1 -0
- package/dist/commands/open.d.ts +39 -9
- package/dist/commands/open.js +80 -25
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/playbook.d.ts +42 -0
- package/dist/commands/playbook.js +171 -0
- package/dist/commands/playbook.js.map +1 -0
- package/dist/commands/pod.js +1 -1
- package/dist/commands/pod.js.map +1 -1
- package/dist/commands/pods.d.ts +11 -1
- package/dist/commands/pods.js +129 -131
- package/dist/commands/pods.js.map +1 -1
- package/dist/commands/proposals-actions.d.ts +62 -0
- package/dist/commands/proposals-actions.js +143 -8
- package/dist/commands/proposals-actions.js.map +1 -1
- package/dist/commands/proposals-await.d.ts +68 -0
- package/dist/commands/proposals-await.js +248 -0
- package/dist/commands/proposals-await.js.map +1 -0
- package/dist/commands/proton-setup.d.ts +73 -0
- package/dist/commands/proton-setup.js +579 -0
- package/dist/commands/proton-setup.js.map +1 -0
- package/dist/commands/providers.d.ts +23 -0
- package/dist/commands/providers.js +126 -1
- package/dist/commands/providers.js.map +1 -1
- package/dist/commands/raycast.js +6 -2
- package/dist/commands/raycast.js.map +1 -1
- package/dist/commands/rule.d.ts +150 -0
- package/dist/commands/rule.js +447 -0
- package/dist/commands/rule.js.map +1 -0
- package/dist/commands/session-feed-wait.d.ts +48 -0
- package/dist/commands/session-feed-wait.js +261 -0
- package/dist/commands/session-feed-wait.js.map +1 -0
- package/dist/commands/session-post.d.ts +40 -0
- package/dist/commands/session-post.js +96 -0
- package/dist/commands/session-post.js.map +1 -0
- package/dist/commands/session-wait.d.ts +116 -0
- package/dist/commands/session-wait.js +224 -0
- package/dist/commands/session-wait.js.map +1 -0
- package/dist/commands/sessions.d.ts +54 -0
- package/dist/commands/sessions.js +501 -58
- package/dist/commands/sessions.js.map +1 -1
- package/dist/commands/skill-manage.d.ts +21 -0
- package/dist/commands/skill-manage.js +136 -19
- package/dist/commands/skill-manage.js.map +1 -1
- package/dist/commands/skills-commands.d.ts +2 -0
- package/dist/commands/skills-commands.js +9 -1
- package/dist/commands/skills-commands.js.map +1 -1
- package/dist/commands/skills-commands.test.d.ts +1 -0
- package/dist/commands/skills-commands.test.js +57 -0
- package/dist/commands/skills-commands.test.js.map +1 -0
- package/dist/commands/skills.js +16 -0
- package/dist/commands/skills.js.map +1 -1
- package/dist/commands/status.d.ts +1 -4
- package/dist/commands/status.js +6 -35
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/statusline.backoff.test.d.ts +13 -0
- package/dist/commands/statusline.backoff.test.js +100 -0
- package/dist/commands/statusline.backoff.test.js.map +1 -0
- package/dist/commands/statusline.js +16 -9
- package/dist/commands/statusline.js.map +1 -1
- package/dist/commands/sync-status.d.ts +12 -0
- package/dist/commands/sync-status.js +125 -0
- package/dist/commands/sync-status.js.map +1 -0
- package/dist/commands/templates-retire.d.ts +34 -0
- package/dist/commands/templates-retire.js +192 -0
- package/dist/commands/templates-retire.js.map +1 -0
- package/dist/commands/tools.js +6 -21
- package/dist/commands/tools.js.map +1 -1
- package/dist/commands/tracks.d.ts +112 -0
- package/dist/commands/tracks.js +543 -0
- package/dist/commands/tracks.js.map +1 -0
- package/dist/commands/update.d.ts +3 -11
- package/dist/commands/update.js +5 -134
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/upload.d.ts +41 -3
- package/dist/commands/upload.js +120 -18
- package/dist/commands/upload.js.map +1 -1
- package/dist/commands/vendor.d.ts +28 -0
- package/dist/commands/vendor.js +110 -0
- package/dist/commands/vendor.js.map +1 -0
- package/dist/commands/versions.js +6 -0
- package/dist/commands/versions.js.map +1 -1
- package/dist/commands/view.js +10 -5
- package/dist/commands/view.js.map +1 -1
- package/dist/commands/whoami.d.ts +30 -3
- package/dist/commands/whoami.js +186 -23
- package/dist/commands/whoami.js.map +1 -1
- package/dist/commands/worker-accounts.d.ts +149 -0
- package/dist/commands/worker-accounts.js +339 -0
- package/dist/commands/worker-accounts.js.map +1 -0
- package/dist/commands/worker-accounts.test.d.ts +1 -0
- package/dist/commands/worker-accounts.test.js +224 -0
- package/dist/commands/worker-accounts.test.js.map +1 -0
- package/dist/commands/worker.d.ts +331 -0
- package/dist/commands/worker.js +1067 -0
- package/dist/commands/worker.js.map +1 -0
- package/dist/commands/worker.test.d.ts +1 -0
- package/dist/commands/worker.test.js +427 -0
- package/dist/commands/worker.test.js.map +1 -0
- package/dist/commands/workspace-ops.d.ts +35 -0
- package/dist/commands/workspace-ops.js +153 -0
- package/dist/commands/workspace-ops.js.map +1 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1043 -186
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-connections.d.ts +31 -0
- package/dist/lib/agent-connections.js +33 -0
- package/dist/lib/agent-connections.js.map +1 -0
- package/dist/lib/agent-detect.d.ts +27 -0
- package/dist/lib/agent-detect.js +71 -0
- package/dist/lib/agent-detect.js.map +1 -0
- package/dist/lib/agent-door.d.ts +136 -0
- package/dist/lib/agent-door.js +429 -0
- package/dist/lib/agent-door.js.map +1 -0
- package/dist/lib/agents-config.d.ts +2 -0
- package/dist/lib/agents-config.js +4 -9
- package/dist/lib/agents-config.js.map +1 -1
- package/dist/lib/approval-poll.d.ts +31 -2
- package/dist/lib/approval-poll.js +20 -7
- package/dist/lib/approval-poll.js.map +1 -1
- package/dist/lib/atomic-file.d.ts +48 -0
- package/dist/lib/atomic-file.js +129 -0
- package/dist/lib/atomic-file.js.map +1 -0
- package/dist/lib/auth.d.ts +17 -11
- package/dist/lib/auth.js +47 -64
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/batch-approval.d.ts +85 -0
- package/dist/lib/batch-approval.js +170 -0
- package/dist/lib/batch-approval.js.map +1 -0
- package/dist/lib/box/egress.d.ts +82 -0
- package/dist/lib/box/egress.js +264 -0
- package/dist/lib/box/egress.js.map +1 -0
- package/dist/lib/box/evidence.d.ts +86 -0
- package/dist/lib/box/evidence.js +121 -0
- package/dist/lib/box/evidence.js.map +1 -0
- package/dist/lib/box/job-server.d.ts +72 -0
- package/dist/lib/box/job-server.js +246 -0
- package/dist/lib/box/job-server.js.map +1 -0
- package/dist/lib/box/provisioner.d.ts +83 -0
- package/dist/lib/box/provisioner.js +312 -0
- package/dist/lib/box/provisioner.js.map +1 -0
- package/dist/lib/box/proxmox.d.ts +112 -0
- package/dist/lib/box/proxmox.js +211 -0
- package/dist/lib/box/proxmox.js.map +1 -0
- package/dist/lib/box/wire.d.ts +98 -0
- package/dist/lib/box/wire.js +70 -0
- package/dist/lib/box/wire.js.map +1 -0
- package/dist/lib/capture-lane.d.ts +6 -5
- package/dist/lib/capture-lane.js +6 -5
- package/dist/lib/capture-lane.js.map +1 -1
- package/dist/lib/capture-structure.d.ts +230 -11
- package/dist/lib/capture-structure.js +251 -13
- package/dist/lib/capture-structure.js.map +1 -1
- package/dist/lib/catalog-templates.d.ts +59 -0
- package/dist/lib/catalog-templates.js +126 -0
- package/dist/lib/catalog-templates.js.map +1 -0
- package/dist/lib/cli-build.d.ts +19 -0
- package/dist/lib/cli-build.js +37 -0
- package/dist/lib/cli-build.js.map +1 -0
- package/dist/lib/client-header.test.d.ts +1 -0
- package/dist/lib/client-header.test.js +85 -0
- package/dist/lib/client-header.test.js.map +1 -0
- package/dist/lib/conversation-headers.d.ts +33 -0
- package/dist/lib/conversation-headers.js +69 -0
- package/dist/lib/conversation-headers.js.map +1 -0
- package/dist/lib/cp-packages.d.ts +167 -11
- package/dist/lib/cp-packages.js +253 -21
- package/dist/lib/cp-packages.js.map +1 -1
- package/dist/lib/credential-class.d.ts +144 -0
- package/dist/lib/credential-class.js +138 -0
- package/dist/lib/credential-class.js.map +1 -0
- package/dist/lib/describe-lens.d.ts +35 -0
- package/dist/lib/describe-lens.js +40 -0
- package/dist/lib/describe-lens.js.map +1 -1
- package/dist/lib/device-connect.d.ts +125 -0
- package/dist/lib/device-connect.js +256 -0
- package/dist/lib/device-connect.js.map +1 -0
- package/dist/lib/directory-lens.d.ts +99 -0
- package/dist/lib/directory-lens.js +187 -0
- package/dist/lib/directory-lens.js.map +1 -0
- package/dist/lib/exporter-coverage.d.ts +71 -0
- package/dist/lib/exporter-coverage.js +97 -0
- package/dist/lib/exporter-coverage.js.map +1 -0
- package/dist/lib/goal-words.d.ts +38 -0
- package/dist/lib/goal-words.js +112 -0
- package/dist/lib/goal-words.js.map +1 -0
- package/dist/lib/hub-client.d.ts +57 -15
- package/dist/lib/hub-client.js +396 -82
- package/dist/lib/hub-client.js.map +1 -1
- package/dist/lib/init-connect.d.ts +41 -0
- package/dist/lib/init-connect.js +75 -0
- package/dist/lib/init-connect.js.map +1 -0
- package/dist/lib/init-exit.d.ts +24 -0
- package/dist/lib/init-exit.js +41 -0
- package/dist/lib/init-exit.js.map +1 -0
- package/dist/lib/init-flow.d.ts +25 -0
- package/dist/lib/init-flow.js +40 -0
- package/dist/lib/init-flow.js.map +1 -0
- package/dist/lib/init-handoff.d.ts +24 -0
- package/dist/lib/init-handoff.js +26 -0
- package/dist/lib/init-handoff.js.map +1 -0
- package/dist/lib/init-output.d.ts +18 -0
- package/dist/lib/init-output.js +43 -0
- package/dist/lib/init-output.js.map +1 -0
- package/dist/lib/init-pod.d.ts +45 -0
- package/dist/lib/init-pod.js +36 -0
- package/dist/lib/init-pod.js.map +1 -0
- package/dist/lib/installed.d.ts +210 -11
- package/dist/lib/installed.js +234 -36
- package/dist/lib/installed.js.map +1 -1
- package/dist/lib/key-approval.d.ts +57 -0
- package/dist/lib/key-approval.js +117 -0
- package/dist/lib/key-approval.js.map +1 -0
- package/dist/lib/key-diagnosis.d.ts +56 -0
- package/dist/lib/key-diagnosis.js +227 -0
- package/dist/lib/key-diagnosis.js.map +1 -0
- package/dist/lib/key-doctor.d.ts +136 -0
- package/dist/lib/key-doctor.js +286 -0
- package/dist/lib/key-doctor.js.map +1 -0
- package/dist/lib/key-locations.d.ts +120 -0
- package/dist/lib/key-locations.js +326 -0
- package/dist/lib/key-locations.js.map +1 -0
- package/dist/lib/key-source.d.ts +68 -0
- package/dist/lib/key-source.js +109 -0
- package/dist/lib/key-source.js.map +1 -0
- package/dist/lib/key-state.d.ts +70 -0
- package/dist/lib/key-state.js +115 -0
- package/dist/lib/key-state.js.map +1 -0
- package/dist/lib/kind-package.d.ts +181 -0
- package/dist/lib/kind-package.js +679 -0
- package/dist/lib/kind-package.js.map +1 -0
- package/dist/lib/knowledge-title.d.ts +25 -0
- package/dist/lib/knowledge-title.js +47 -0
- package/dist/lib/knowledge-title.js.map +1 -0
- package/dist/lib/knowledge-title.test.d.ts +1 -0
- package/dist/lib/knowledge-title.test.js +34 -0
- package/dist/lib/knowledge-title.test.js.map +1 -0
- package/dist/lib/machine-instance.d.ts +64 -0
- package/dist/lib/machine-instance.js +142 -0
- package/dist/lib/machine-instance.js.map +1 -0
- package/dist/lib/mcp-bridge.d.ts +49 -0
- package/dist/lib/mcp-bridge.js +180 -0
- package/dist/lib/mcp-bridge.js.map +1 -0
- package/dist/lib/mcp-bridge.test.d.ts +1 -0
- package/dist/lib/mcp-bridge.test.js +118 -0
- package/dist/lib/mcp-bridge.test.js.map +1 -0
- package/dist/lib/mcp-call.d.ts +30 -0
- package/dist/lib/mcp-call.js +107 -0
- package/dist/lib/mcp-call.js.map +1 -0
- package/dist/lib/mcp-snippets.d.ts +53 -0
- package/dist/lib/mcp-snippets.js +82 -0
- package/dist/lib/mcp-snippets.js.map +1 -0
- package/dist/lib/next-steps.d.ts +8 -0
- package/dist/lib/next-steps.js +31 -1
- package/dist/lib/next-steps.js.map +1 -1
- package/dist/lib/openclaw.js +3 -2
- package/dist/lib/openclaw.js.map +1 -1
- package/dist/lib/package-wire.d.ts +179 -0
- package/dist/lib/package-wire.js +68 -0
- package/dist/lib/package-wire.js.map +1 -0
- package/dist/lib/pair-link.d.ts +38 -0
- package/dist/lib/pair-link.js +68 -0
- package/dist/lib/pair-link.js.map +1 -0
- package/dist/lib/pod-moved.d.ts +70 -0
- package/dist/lib/pod-moved.js +146 -0
- package/dist/lib/pod-moved.js.map +1 -0
- package/dist/lib/pod-reach.d.ts +39 -0
- package/dist/lib/pod-reach.js +117 -0
- package/dist/lib/pod-reach.js.map +1 -0
- package/dist/lib/pod-reach.test.d.ts +1 -0
- package/dist/lib/pod-reach.test.js +67 -0
- package/dist/lib/pod-reach.test.js.map +1 -0
- package/dist/lib/pod-wide.d.ts +40 -0
- package/dist/lib/pod-wide.js +46 -0
- package/dist/lib/pod-wide.js.map +1 -0
- package/dist/lib/pod.d.ts +74 -112
- package/dist/lib/pod.js +146 -415
- package/dist/lib/pod.js.map +1 -1
- package/dist/lib/project-ref.d.ts +9 -3
- package/dist/lib/project-ref.js +10 -4
- package/dist/lib/project-ref.js.map +1 -1
- package/dist/lib/register-claude-code-mcp.test.d.ts +1 -0
- package/dist/lib/register-claude-code-mcp.test.js +78 -0
- package/dist/lib/register-claude-code-mcp.test.js.map +1 -0
- package/dist/lib/review-credential.d.ts +119 -0
- package/dist/lib/review-credential.js +149 -0
- package/dist/lib/review-credential.js.map +1 -0
- package/dist/lib/safe-open.d.ts +49 -0
- package/dist/lib/safe-open.js +119 -0
- package/dist/lib/safe-open.js.map +1 -0
- package/dist/lib/session-feed.d.ts +185 -0
- package/dist/lib/session-feed.js +257 -0
- package/dist/lib/session-feed.js.map +1 -0
- package/dist/lib/session-lens.d.ts +40 -1
- package/dist/lib/session-lens.js +54 -4
- package/dist/lib/session-lens.js.map +1 -1
- package/dist/lib/superwhisper-import.d.ts +8 -0
- package/dist/lib/superwhisper-import.js +14 -7
- package/dist/lib/superwhisper-import.js.map +1 -1
- package/dist/lib/superwhisper-title.test.d.ts +1 -0
- package/dist/lib/superwhisper-title.test.js +18 -0
- package/dist/lib/superwhisper-title.test.js.map +1 -0
- package/dist/lib/targets.d.ts +152 -10
- package/dist/lib/targets.js +974 -325
- package/dist/lib/targets.js.map +1 -1
- package/dist/lib/template-file.d.ts +4 -0
- package/dist/lib/template-file.js.map +1 -1
- package/dist/lib/template-lifecycle.d.ts +217 -0
- package/dist/lib/template-lifecycle.js +433 -0
- package/dist/lib/template-lifecycle.js.map +1 -0
- package/dist/lib/template-steps.d.ts +88 -0
- package/dist/lib/template-steps.js +118 -0
- package/dist/lib/template-steps.js.map +1 -0
- package/dist/lib/time-ago.d.ts +2 -0
- package/dist/lib/time-ago.js +15 -0
- package/dist/lib/time-ago.js.map +1 -0
- package/dist/lib/wake-hook-settings.d.ts +57 -0
- package/dist/lib/wake-hook-settings.js +153 -0
- package/dist/lib/wake-hook-settings.js.map +1 -0
- package/dist/lib/wake-state.d.ts +65 -0
- package/dist/lib/wake-state.js +122 -0
- package/dist/lib/wake-state.js.map +1 -0
- package/dist/utils/logger.js +5 -2
- package/dist/utils/logger.js.map +1 -1
- package/package.json +26 -17
- package/skills/README.md +13 -11
- package/skills/agent-os/SKILL.md +214 -99
- package/skills/manifest.json +1 -1
- package/skills/onboard/SKILL.md +55 -26
- package/skills/synap/README.md +5 -8
- package/skills/synap/SKILL.md +1149 -289
- package/skills/synap/_order.txt +7 -0
- package/skills/synap/_skill.yaml +1 -1
- package/skills/synap/automations.md +15 -0
- package/skills/synap/capture.md +5 -0
- package/skills/synap/cli-operations.md +24 -18
- package/skills/synap/code-skills.md +70 -0
- package/skills/synap/concepts.md +36 -0
- package/skills/synap/content-os.md +10 -1
- package/skills/synap/creative-loop.md +15 -10
- package/skills/synap/crm.md +21 -52
- package/skills/synap/document-embeds.md +143 -47
- package/skills/synap/escalation-ladder.md +20 -10
- package/skills/synap/focus-sessions.md +56 -21
- package/skills/synap/from-intent.md +158 -0
- package/skills/synap/governance-rules.md +5 -5
- package/skills/synap/governance.md +10 -7
- package/skills/synap/hand-off.md +33 -0
- package/skills/synap/inline-patterns.md +15 -7
- package/skills/synap/lenses.md +34 -16
- package/skills/synap/linking.md +42 -41
- package/skills/synap/mcp-remote-servers.md +64 -0
- package/skills/synap/mental-model.md +17 -15
- package/skills/synap/operating-mode-rules.md +2 -2
- package/skills/synap/processes.md +118 -0
- package/skills/synap/quick-reference.md +7 -2
- package/skills/synap/reading.md +3 -1
- package/skills/synap/reflexes.md +12 -42
- package/skills/synap/viewframe-cells.md +38 -5
- package/skills/synap/work-flow.md +1 -1
- package/skills/synap/work-model.md +110 -0
- package/skills/synap/worked-examples.md +4 -5
- package/skills/synap/workspace-design.md +15 -11
- package/skills/synap/writes.md +105 -25
- package/skills/synap/writing-titles.md +63 -0
- package/skills/synap-app/SKILL.md +149 -67
- package/skills/synap-app/_skill.yaml +1 -1
- package/skills/synap-app/creating-the-base-app.md +12 -7
- package/skills/synap-app/governance.md +27 -16
- package/skills/synap-app/install-commands.md +18 -9
- package/skills/synap-app/overview.md +16 -9
- package/skills/synap-app/using-the-sdk.md +75 -25
- package/skills/synap-design/SKILL.md +474 -0
- package/skills/synap-design/_order.txt +4 -0
- package/skills/synap-design/_skill.yaml +21 -0
- package/skills/synap-design/loop.md +134 -0
- package/skills/synap-design/overview.md +44 -0
- package/skills/synap-design/principles.md +130 -0
- package/skills/synap-design/system.md +133 -0
- package/skills/synap-market/SKILL.md +306 -16
- package/skills/synap-market/_skill.yaml +1 -1
- package/skills/synap-market/author-and-publish.md +145 -8
- package/skills/synap-market/governance-and-catalog.md +7 -0
- package/skills/synap-market/install.md +79 -1
- package/skills/synap-market/overview.md +74 -6
- package/skills/synap-schema/SKILL.md +172 -10
- package/skills/synap-schema/_order.txt +2 -0
- package/skills/synap-schema/_skill.yaml +4 -2
- package/skills/synap-schema/common-mistakes.md +4 -2
- package/skills/synap-schema/discover-profiles.md +1 -1
- package/skills/synap-schema/entity-scope.md +15 -3
- package/skills/synap-schema/extend-first.md +29 -0
- package/skills/synap-schema/extend-vs-create.md +1 -1
- package/skills/synap-schema/intent-vocabulary-ssot.md +111 -0
- package/skills/synap-schema/property-types.md +1 -1
- package/skills/synap-schema/relations.md +1 -1
- package/skills/synap-ui/SKILL.md +19 -12
- package/skills/synap-ui/_skill.yaml +1 -1
- package/skills/synap-ui/ai-companion.md +1 -1
- package/skills/synap-ui/arranging-bento.md +2 -0
- package/skills/synap-ui/bento-layouts.md +10 -10
- package/skills/synap-ui/bento-recipes.md +313 -543
- package/skills/synap-ui/four-builds.md +5 -0
- package/skills/synap-ui/view-types.md +2 -2
- package/skills/synap-ui/widget-catalog.md +22 -278
- package/templates/automations/bookmark-enrichment.automation.json +290 -13
- package/templates/automations/url-bookmark-capture.automation.json +73 -11
- package/templates/box/runner.py +206 -0
- package/templates/skills/authoring-playbooks/SKILL.md +6 -3
- package/templates/skills/authoring-playbooks/reference/stages-contract.md +15 -0
- package/templates/skills/authoring-playbooks/reference/worked-example.md +3 -0
- package/dist/commands/infra.d.ts +0 -21
- package/dist/commands/infra.js +0 -262
- package/dist/commands/infra.js.map +0 -1
- package/node_modules/@synap/hub-rest-client/dist/index.cjs +0 -1261
- package/node_modules/@synap/hub-rest-client/dist/index.d.cts +0 -1647
- package/node_modules/@synap/hub-rest-client/dist/index.d.ts +0 -1647
- package/node_modules/@synap/hub-rest-client/dist/index.js +0 -1231
- package/node_modules/@synap/hub-rest-client/package.json +0 -45
- package/node_modules/@synap/hub-rest-client/src/client.ts +0 -1631
- package/node_modules/@synap/hub-rest-client/src/errors.ts +0 -30
- package/node_modules/@synap/hub-rest-client/src/index.ts +0 -153
- package/node_modules/@synap/hub-rest-client/src/setup.ts +0 -133
- package/node_modules/@synap/hub-rest-client/src/types.ts +0 -1299
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `synap worker` — run Claude Code unattended on THIS machine for the sessions
|
|
3
|
+
* a person or an AI handed to an agent.
|
|
4
|
+
*
|
|
5
|
+
* The door it reuses: a session's roster. Putting an agent on a focus session
|
|
6
|
+
* (`synap_start_session` agentIds, `synap_update_session` addAgentId, capture
|
|
7
|
+
* "Give to agent") is how work is handed to it, and `synap_orient` lists those
|
|
8
|
+
* sessions as `handedToYou` for that agent. The worker is that agent: it polls
|
|
9
|
+
* orient with the agent's own key, claims each new session once, and launches
|
|
10
|
+
* the unmodified `claude` binary headless in the workspace with a protocol
|
|
11
|
+
* prompt. The launched Claude Code does the work and talks in the session room
|
|
12
|
+
* through the Synap MCP — so the AI that launched the session (the
|
|
13
|
+
* orchestrator) and the person read and answer it there, and relay shows it.
|
|
14
|
+
*
|
|
15
|
+
* Synap never spawns a coding agent: this process runs on the person's own
|
|
16
|
+
* machine, under their own Claude login, as an agent they connected.
|
|
17
|
+
*
|
|
18
|
+
* Which Claude subscription a run uses = which Claude config the process sees:
|
|
19
|
+
* `--claude-config-dir` sets CLAUDE_CONFIG_DIR for the launched runs (log that
|
|
20
|
+
* directory in once with `CLAUDE_CONFIG_DIR=<dir> claude login`). API-key
|
|
21
|
+
* variables are removed from the launched environment so a stray key can never
|
|
22
|
+
* silently switch billing away from the subscription.
|
|
23
|
+
*
|
|
24
|
+
* Several Claude accounts (`--accounts <file>`, default
|
|
25
|
+
* ~/.config/synap-worker/accounts.json when it exists): before each launch the
|
|
26
|
+
* accounts are measured and one is picked (worker-accounts.ts); its token goes
|
|
27
|
+
* into the run's environment only. A run cut off by a usage limit marks that
|
|
28
|
+
* account full and is RESUMED (same Claude conversation) on the next account.
|
|
29
|
+
*
|
|
30
|
+
* A DESIGN run (the session declares an outcome of kind "design") launches as
|
|
31
|
+
* `claude --bg` — the only mode that has the Artifact tool — on the account
|
|
32
|
+
* flagged `design`, and is watched through `claude agents --json` and its
|
|
33
|
+
* transcript.
|
|
34
|
+
*
|
|
35
|
+
* Two PROTOCOLS (`sessionProtocol`): a CODE session is worked in a git
|
|
36
|
+
* worktree on a `devbox/<id>` branch and ends in a draft PR; a WORK-FOLDER
|
|
37
|
+
* session (a playbook run over pod data — a video edit, an interview) is
|
|
38
|
+
* worked in `<work root>/<sessionId>/` with no git, files its outputs back to
|
|
39
|
+
* the pod, and asks the person through the session's human-owned slots.
|
|
40
|
+
*
|
|
41
|
+
* State (which sessions were launched, their Claude session ids and outcome)
|
|
42
|
+
* lives in ~/.synap/worker/<agent>/state.json; each run's stream-json goes to
|
|
43
|
+
* ~/.synap/worker/<agent>/runs/<sessionId>.jsonl. Neither ever holds a token.
|
|
44
|
+
*/
|
|
45
|
+
import { type McpCallClient } from "../lib/mcp-call.js";
|
|
46
|
+
export interface WorkerOptions {
|
|
47
|
+
agent: string;
|
|
48
|
+
interval?: string;
|
|
49
|
+
once?: boolean;
|
|
50
|
+
cwd?: string;
|
|
51
|
+
maxParallel?: string;
|
|
52
|
+
claudeBin?: string;
|
|
53
|
+
claudeConfigDir?: string;
|
|
54
|
+
allowedTools?: string;
|
|
55
|
+
skipPermissions?: boolean;
|
|
56
|
+
dryRun?: boolean;
|
|
57
|
+
/** The Claude accounts file (default ~/.config/synap-worker/accounts.json, used when it exists). */
|
|
58
|
+
accounts?: string;
|
|
59
|
+
/** Where work-folder runs get their folder, one per session (default ~/synap-work). */
|
|
60
|
+
workRoot?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface HandedItem {
|
|
63
|
+
id: string;
|
|
64
|
+
goal: string | null;
|
|
65
|
+
}
|
|
66
|
+
/** `limited`: cut off by a usage limit, waiting to be resumed on another account. */
|
|
67
|
+
export type RunStatus = "running" | "done" | "failed" | "limited";
|
|
68
|
+
export interface RunRecord {
|
|
69
|
+
sessionId: string;
|
|
70
|
+
status: RunStatus;
|
|
71
|
+
startedAt: string;
|
|
72
|
+
finishedAt?: string;
|
|
73
|
+
pid?: number;
|
|
74
|
+
claudeSessionId?: string;
|
|
75
|
+
exitCode?: number | null;
|
|
76
|
+
result?: string;
|
|
77
|
+
/** How many times a room follow-up resumed this Claude conversation. */
|
|
78
|
+
resumes?: number;
|
|
79
|
+
/** How many times a run that failed before Claude started was relaunched. */
|
|
80
|
+
launchRetries?: number;
|
|
81
|
+
/** The accounts-file id the latest launch ran on — an id, never a token. */
|
|
82
|
+
accountId?: string;
|
|
83
|
+
/** `print` = `claude -p` (default); `bg` = `claude --bg`, a design run. */
|
|
84
|
+
mode?: "print" | "bg";
|
|
85
|
+
/** The short id `claude --bg` printed (what `claude agents|stop` take). */
|
|
86
|
+
bgId?: string;
|
|
87
|
+
/** When the latest launch (first or resumed) started. */
|
|
88
|
+
launchedAt?: string;
|
|
89
|
+
/** How many times a run cut off by a usage limit was resumed on another account. */
|
|
90
|
+
limitResumes?: number;
|
|
91
|
+
/** A background run first seen blocked (needs input) at this time. */
|
|
92
|
+
blockedSince?: string;
|
|
93
|
+
/** Which protocol the run was launched with (absent: a run from before protocols = code). */
|
|
94
|
+
protocol?: WorkerProtocol;
|
|
95
|
+
/** A work-folder run's folder: its cwd, which every resume reuses (Claude finds a conversation by its cwd). */
|
|
96
|
+
workDir?: string;
|
|
97
|
+
}
|
|
98
|
+
interface WorkerState {
|
|
99
|
+
runs: Record<string, RunRecord>;
|
|
100
|
+
}
|
|
101
|
+
/** "30s" | "2m" | "1h" | "45" (seconds) → milliseconds. */
|
|
102
|
+
export declare function parseInterval(raw: string | undefined, fallbackMs?: number): number;
|
|
103
|
+
/**
|
|
104
|
+
* The pod hands this agent its work through a provider binding (reach
|
|
105
|
+
* `dispatch`), so it lists nothing to pull: a worker pulling for it would run
|
|
106
|
+
* the same work a second time. The worker stops on it.
|
|
107
|
+
*/
|
|
108
|
+
export declare class AgentBoundForDispatchError extends Error {
|
|
109
|
+
constructor();
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* A person PAUSED this agent: it takes no new work until resumed. Not a failed
|
|
113
|
+
* read — the worker keeps polling and launches nothing.
|
|
114
|
+
*/
|
|
115
|
+
export declare class AgentPausedError extends Error {
|
|
116
|
+
constructor();
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Read `handedToYou` out of `synap_orient`'s text. A missing or `unavailable`
|
|
120
|
+
* block is a FAILED read and throws — never "nothing handed to me". A `bound`
|
|
121
|
+
* block throws `AgentBoundForDispatchError`.
|
|
122
|
+
*/
|
|
123
|
+
export declare function parseHandedToYou(orientText: string): HandedItem[];
|
|
124
|
+
/**
|
|
125
|
+
* A run that failed BEFORE Claude started (no Claude session: an expired login,
|
|
126
|
+
* exhausted credits) is relaunched after 30 min, then 1 h, 2 h and 4 h, enough
|
|
127
|
+
* to outlast a credit reset. A run Claude did start is resumed only by a room
|
|
128
|
+
* follow-up, never relaunched from scratch.
|
|
129
|
+
*/
|
|
130
|
+
export declare const LAUNCH_RETRY_BASE_MS: number;
|
|
131
|
+
export declare const MAX_LAUNCH_RETRIES = 4;
|
|
132
|
+
/** Sessions to launch now: never launched, or due a relaunch (see above). */
|
|
133
|
+
export declare function pickNew(items: HandedItem[], state: WorkerState, slots: number, now?: number): HandedItem[];
|
|
134
|
+
/**
|
|
135
|
+
* The pod MCP server every run gets, under this name, carrying the WORKER
|
|
136
|
+
* AGENT's own key. Runs never inherit the server in ~/.claude.json: whatever
|
|
137
|
+
* key that file holds (a `synap login --reconnect` on the box rewrites it with
|
|
138
|
+
* another agent's) would decide who the run posts as, and the worker would
|
|
139
|
+
* then read its own posts as follow-ups (2026-10-20).
|
|
140
|
+
*/
|
|
141
|
+
export declare const RUN_MCP_SERVER = "synap-worker";
|
|
142
|
+
export declare function runMcpConfig(podUrl: string, apiKey: string,
|
|
143
|
+
/** The run's Claude session id: names the conversation to the pod, one id across resumes. */
|
|
144
|
+
claudeSessionId?: string): {
|
|
145
|
+
mcpServers: Record<string, unknown>;
|
|
146
|
+
};
|
|
147
|
+
/** Writes the run config owner-only (it holds the key) and returns its path. */
|
|
148
|
+
export declare function writeRunMcpConfig(dir: string, config: {
|
|
149
|
+
mcpServers: Record<string, unknown>;
|
|
150
|
+
}, name?: string): string;
|
|
151
|
+
export declare const DEFAULT_ALLOWED_TOOLS: string[];
|
|
152
|
+
/** The tools a design run adds: the claude.ai Artifact tool (and the search that loads deferred tools). */
|
|
153
|
+
export declare const DESIGN_EXTRA_TOOLS: string[];
|
|
154
|
+
/** The tools a work-folder run adds: skills (the HyperFrames workflow is one). */
|
|
155
|
+
export declare const WORK_FOLDER_EXTRA_TOOLS: string[];
|
|
156
|
+
/** The protocol the launched Claude Code follows for one handed session. */
|
|
157
|
+
export declare function buildWorkerPrompt(p: {
|
|
158
|
+
sessionId: string;
|
|
159
|
+
goal: string | null;
|
|
160
|
+
agentName: string;
|
|
161
|
+
cwd: string;
|
|
162
|
+
mcpServer: string;
|
|
163
|
+
/** A design run: the deliverable is a claude.ai Design artifact. */
|
|
164
|
+
design?: boolean;
|
|
165
|
+
}): string;
|
|
166
|
+
/** How long a work-folder run waits for an answer to its ask before it ends `blocked`. */
|
|
167
|
+
export declare const ASK_WAIT_MINUTES = 30;
|
|
168
|
+
/**
|
|
169
|
+
* The protocol for a WORK-FOLDER session (`sessionProtocol`): no git; files in
|
|
170
|
+
* the session's folder; outputs filed to the pod; questions asked through a
|
|
171
|
+
* human-owned slot with an ask (what Content Studio, Relay and the Needs-you
|
|
172
|
+
* list show), never a room `QUESTION:` line.
|
|
173
|
+
*/
|
|
174
|
+
export declare function buildWorkFolderPrompt(p: {
|
|
175
|
+
sessionId: string;
|
|
176
|
+
goal: string | null;
|
|
177
|
+
agentName: string;
|
|
178
|
+
workDir: string;
|
|
179
|
+
mcpServer: string;
|
|
180
|
+
}): string;
|
|
181
|
+
/**
|
|
182
|
+
* The launched environment: the subscription, never a stray API key. With an
|
|
183
|
+
* account picked, its token REPLACES any token the worker inherited.
|
|
184
|
+
*/
|
|
185
|
+
export declare function workerEnv(base: NodeJS.ProcessEnv, claudeConfigDir?: string, oauthToken?: string): NodeJS.ProcessEnv;
|
|
186
|
+
export interface LimitHit {
|
|
187
|
+
error: string;
|
|
188
|
+
/** When the limit lifts (ms), when Claude Code said. */
|
|
189
|
+
resetsAt?: number;
|
|
190
|
+
}
|
|
191
|
+
/** What one run's events say about how it ended. */
|
|
192
|
+
export interface RunEnd {
|
|
193
|
+
claudeSessionId?: string;
|
|
194
|
+
/** The `result` text (stream) or the last main assistant text (transcript). */
|
|
195
|
+
text?: string;
|
|
196
|
+
/** Set when the run's LAST main-thread turn was refused by a usage limit. */
|
|
197
|
+
limit?: LimitHit;
|
|
198
|
+
isError?: boolean;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Fold one event (a stream-json line of `claude -p`, or a transcript line of
|
|
202
|
+
* a background session — the two spell the fields differently) into the run's
|
|
203
|
+
* ending. A later healthy assistant message clears an earlier limit: only a
|
|
204
|
+
* run whose last turn hit the limit "ended on a limit".
|
|
205
|
+
*/
|
|
206
|
+
export declare function foldRunEvent(end: RunEnd, ev: Record<string, unknown>, rejectedResetsAt?: {
|
|
207
|
+
at?: number;
|
|
208
|
+
}): RunEnd;
|
|
209
|
+
/** A run that printed its WORKER-RESULT verdict finished its protocol: never a limit. */
|
|
210
|
+
export declare function endedOnLimit(end: RunEnd): LimitHit | undefined;
|
|
211
|
+
/** How long an account stays out after a limit with no reset time given. */
|
|
212
|
+
export declare function limitUntil(hit: LimitHit, now: number): number;
|
|
213
|
+
/** At most this many usage-limit resumes per session. */
|
|
214
|
+
export declare const MAX_LIMIT_RESUMES = 6;
|
|
215
|
+
/** The prompt that resumes a run a usage limit cut off, on another account. */
|
|
216
|
+
export declare const LIMIT_RESUME_PROMPT = "Continue where you stopped. Your previous turn was cut off by a Claude usage limit and this session moved to another account. Same protocol; end with one line: WORKER-RESULT: done | blocked | failed \u2014 <one sentence>.";
|
|
217
|
+
/**
|
|
218
|
+
* The structured signal for a DESIGN run: the session declares an outcome of
|
|
219
|
+
* kind "design" (`synap_get_session` → `outcomes.outcomes[].kind`, the
|
|
220
|
+
* playbook's `expectedOutputs: [{kind: "design", label: "Design"}]`). The goal
|
|
221
|
+
* text is never read for it. A session whose outcomes could not be read
|
|
222
|
+
* THROWS: an unreadable session is not "not a design run".
|
|
223
|
+
*/
|
|
224
|
+
export declare const DESIGN_OUTCOME_KIND = "design";
|
|
225
|
+
export declare function isDesignSession(getSessionText: string): boolean;
|
|
226
|
+
/**
|
|
227
|
+
* `code`: a git worktree, a `devbox/<id>` branch, a draft PR, room `QUESTION:`s.
|
|
228
|
+
* `work-folder`: a folder per session, no git, outputs filed to the pod, asks
|
|
229
|
+
* through the session's human-owned slots.
|
|
230
|
+
*/
|
|
231
|
+
export type WorkerProtocol = "code" | "work-folder";
|
|
232
|
+
/** The run params that name a repository — the ones the pod's dispatch path mounts (`repoInputs`, external-agent-executor.ts). */
|
|
233
|
+
export declare const REPO_PARAM_KEYS: readonly ["repo", "repos", "branch"];
|
|
234
|
+
/** Deliverable kinds that only code work yields: the dispatch path's code outputs (`ExternalAgentOutputKey`) and `code`. */
|
|
235
|
+
export declare const CODE_OUTPUT_KINDS: readonly ["pull_request", "branch", "code"];
|
|
236
|
+
/**
|
|
237
|
+
* Which protocol a handed session gets, from the `synap_get_session` read.
|
|
238
|
+
*
|
|
239
|
+
* A session that runs NO playbook is an ad-hoc hand-off ("start this on my
|
|
240
|
+
* devbox"): the code protocol, exactly as before protocols existed. A PLAYBOOK
|
|
241
|
+
* RUN (`session.playbookId`) is a process over pod data — Produce Content's
|
|
242
|
+
* video edit, a CRM list, an interview — and gets the work-folder protocol,
|
|
243
|
+
* unless it carries code context: a repo or branch in its run params
|
|
244
|
+
* (`session.metadata.params`, read the same way the dispatch path reads them)
|
|
245
|
+
* or a code deliverable declared on the session or on any of its stages
|
|
246
|
+
* (`expectedOutputs`, `stages[].expectedOutputs`), so a code playbook stays
|
|
247
|
+
* code from its first stage on. The goal text is never read. An unreadable
|
|
248
|
+
* session THROWS: it is not "a code session".
|
|
249
|
+
*/
|
|
250
|
+
export declare function sessionProtocol(getSessionText: string): WorkerProtocol;
|
|
251
|
+
/** A work-folder run's folder: `<root>/<sessionId>`. */
|
|
252
|
+
export declare function workFolderFor(root: string, sessionId: string): string;
|
|
253
|
+
/** The short id `claude --bg` prints ("backgrounded · fd009109"). */
|
|
254
|
+
export declare function parseBgId(output: string): string | undefined;
|
|
255
|
+
export interface BgEntry {
|
|
256
|
+
id: string;
|
|
257
|
+
sessionId?: string;
|
|
258
|
+
/** Background sessions: working | blocked | done | failed (Claude Code 2.1.296+). */
|
|
259
|
+
state?: string;
|
|
260
|
+
status?: string;
|
|
261
|
+
}
|
|
262
|
+
/** `claude agents --json --all` → entries. Anything but a JSON list THROWS (a failed read is not "gone"). */
|
|
263
|
+
export declare function parseAgentsList(text: string): BgEntry[];
|
|
264
|
+
export type BgPhase = "running" | "finished" | "blocked" | "gone";
|
|
265
|
+
export declare function bgPhase(entry: BgEntry | undefined): BgPhase;
|
|
266
|
+
/** The transcript of a Claude session: `<config>/projects/<any>/<sessionId>.jsonl`. */
|
|
267
|
+
export declare function findTranscript(claudeConfigDir: string | undefined, sessionId: string): string | undefined;
|
|
268
|
+
/** How a background run's transcript ends, reading only entries written since `sinceMs`. */
|
|
269
|
+
export declare function readTranscriptEnd(text: string, sinceMs: number): RunEnd & {
|
|
270
|
+
seen: number;
|
|
271
|
+
};
|
|
272
|
+
/** A background run blocked (it needs input nobody will give) this long is ended. */
|
|
273
|
+
export declare const BG_BLOCKED_MAX_MS: number;
|
|
274
|
+
/** A background run not yet listed, or listed with nothing new, is waited for this long after launch. */
|
|
275
|
+
export declare const BG_SETTLE_MS: number;
|
|
276
|
+
/** The final `WORKER-RESULT:` line of a run's result text, if present. */
|
|
277
|
+
export declare function workerVerdict(resultText: string | undefined): string | undefined;
|
|
278
|
+
export interface RoomMessage {
|
|
279
|
+
id?: string;
|
|
280
|
+
content?: string;
|
|
281
|
+
timestamp?: string;
|
|
282
|
+
authorType?: string;
|
|
283
|
+
routedTeammateId?: string | null;
|
|
284
|
+
}
|
|
285
|
+
/** At most this many follow-up resumes per session (a runaway-loop guard). */
|
|
286
|
+
export declare const MAX_RESUMES = 20;
|
|
287
|
+
/**
|
|
288
|
+
* Room messages posted after `since` by anyone but this agent — the follow-ups
|
|
289
|
+
* (an orchestrator's ANSWER, the person's reply) that should resume a finished
|
|
290
|
+
* run. The worker's own posts carry its agent id and never resume it.
|
|
291
|
+
*/
|
|
292
|
+
export declare function followUpsSince(messages: RoomMessage[], since: string, selfAgentId: string): RoomMessage[];
|
|
293
|
+
/** The prompt that resumes a finished run with the room's new messages. */
|
|
294
|
+
export declare function buildFollowUpPrompt(messages: RoomMessage[]): string;
|
|
295
|
+
export interface ExecResult {
|
|
296
|
+
code: number | null;
|
|
297
|
+
stdout: string;
|
|
298
|
+
stderr: string;
|
|
299
|
+
}
|
|
300
|
+
/** Runs a short-lived command (`claude --bg`, `claude agents`, `claude stop`). */
|
|
301
|
+
export type ExecFn = (bin: string, args: string[], o: {
|
|
302
|
+
cwd: string;
|
|
303
|
+
env: NodeJS.ProcessEnv;
|
|
304
|
+
}) => Promise<ExecResult>;
|
|
305
|
+
export interface WorkerDeps {
|
|
306
|
+
mcp: McpCallClient;
|
|
307
|
+
podUrl: string;
|
|
308
|
+
apiKey: string;
|
|
309
|
+
/** The worker agent's own user id: its posts never resume it. */
|
|
310
|
+
selfAgentId: string;
|
|
311
|
+
exec?: ExecFn;
|
|
312
|
+
/** The account probe's fetch (tests stub it). */
|
|
313
|
+
fetchImpl?: typeof fetch;
|
|
314
|
+
now?: () => number;
|
|
315
|
+
say?: (line: string) => void;
|
|
316
|
+
}
|
|
317
|
+
export interface Worker {
|
|
318
|
+
tick(): Promise<{
|
|
319
|
+
handed: number;
|
|
320
|
+
launched: number;
|
|
321
|
+
}>;
|
|
322
|
+
/** Re-read the background runs' state (design runs). */
|
|
323
|
+
watch(): Promise<void>;
|
|
324
|
+
waitForChildren(): Promise<void>;
|
|
325
|
+
backgroundRunning(): number;
|
|
326
|
+
stop(): void;
|
|
327
|
+
readonly state: WorkerState;
|
|
328
|
+
}
|
|
329
|
+
export declare function createWorker(opts: WorkerOptions, deps: WorkerDeps): Worker;
|
|
330
|
+
export declare function workerCommand(opts: WorkerOptions): Promise<void>;
|
|
331
|
+
export {};
|