@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
package/dist/lib/installed.d.ts
CHANGED
|
@@ -12,9 +12,18 @@
|
|
|
12
12
|
* build, this degrades to an empty set (no markers) rather than failing the
|
|
13
13
|
* discovery command — you can always browse the catalog offline.
|
|
14
14
|
*/
|
|
15
|
+
import { type HubConfig } from "./hub-client.js";
|
|
16
|
+
import { type LifecycleInfo, type OverlayInfo, type PendingDataChanges } from "./template-lifecycle.js";
|
|
15
17
|
/** An installed workspace's package identity — slug plus (when the pod stamped one) its content version. */
|
|
16
18
|
export interface InstalledTemplateInfo {
|
|
17
19
|
slug: string;
|
|
20
|
+
/**
|
|
21
|
+
* Which install ledger this row came from — `"workspace"` for the historical
|
|
22
|
+
* shape, and one of the other five kinds once the pod serves
|
|
23
|
+
* `GET /api/hub/installed`. Optional so every existing constructor (and every
|
|
24
|
+
* test that builds one by hand) stays valid; absent reads as `"workspace"`.
|
|
25
|
+
*/
|
|
26
|
+
kind?: InstalledKind;
|
|
18
27
|
/**
|
|
19
28
|
* `settings.packageVersion`, when the pod stamped one — `GET /api/hub/workspaces`
|
|
20
29
|
* (`hub-protocol/rest/workspaces.ts`) projects it off `workspace.settings`.
|
|
@@ -25,27 +34,217 @@ export interface InstalledTemplateInfo {
|
|
|
25
34
|
* "can't check" rather than "outdated" — see `market.ts`'s `computeUpdates`.
|
|
26
35
|
*/
|
|
27
36
|
version?: string;
|
|
28
|
-
|
|
37
|
+
/**
|
|
38
|
+
* The workspace this row lives in — `null` for a POD-GLOBAL install (a
|
|
39
|
+
* capability, cell or skill installed with `workspace_id IS NULL`). Widened
|
|
40
|
+
* from `string` when `GET /installed` brought the other five kinds in: a
|
|
41
|
+
* pod-wide row has no workspace, and inventing one would be a fabrication.
|
|
42
|
+
*/
|
|
43
|
+
workspaceId: string | null;
|
|
29
44
|
workspaceName: string;
|
|
45
|
+
/**
|
|
46
|
+
* Server-computed latest catalog version for this slug (Hub `/workspaces`
|
|
47
|
+
* TemplateHealth projection). Present when the pod runs the server-side drift
|
|
48
|
+
* code; `undefined` on an older pod, where the CLI falls back to deriving
|
|
49
|
+
* drift itself. Only set for the `packageSlug` entry, never `installedPacks`.
|
|
50
|
+
*/
|
|
51
|
+
latestVersion?: string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Server-computed drift (Hub `/workspaces` TemplateHealth) — the single
|
|
54
|
+
* truthful "an update is available" signal, so the CLI stops re-deriving it.
|
|
55
|
+
* `undefined` on an older pod → client fallback.
|
|
56
|
+
*/
|
|
57
|
+
drifted?: boolean;
|
|
30
58
|
}
|
|
59
|
+
/** Every kind the door can report. Mirrors the pod's `INSTALLED_KINDS`. */
|
|
60
|
+
export declare const INSTALLED_KINDS: readonly ["workspace", "capability", "view", "skill", "automation", "cell"];
|
|
61
|
+
export type InstalledKind = (typeof INSTALLED_KINDS)[number];
|
|
62
|
+
/**
|
|
63
|
+
* One row of `GET /api/hub/installed`, plus the locally-joined `workspaceName`.
|
|
64
|
+
*
|
|
65
|
+
* Read the pod's `hub-protocol/rest/installed.ts` docblock for the field
|
|
66
|
+
* contract. The three that bite:
|
|
67
|
+
*
|
|
68
|
+
* - `drift: null` means **NOT COMPUTED**, never "no drift". Capabilities and
|
|
69
|
+
* cells have no local comparator, so `null` is the honest answer for them.
|
|
70
|
+
* - `packageSlug: null` means **not source-linked to a package** — every
|
|
71
|
+
* capability row (its link is a `templateKey`, not a catalog slug) and any
|
|
72
|
+
* cell minted with the `"unknown"` sentinel. Never print it as a name.
|
|
73
|
+
* - `installedVersion` is a semver for workspace/view/skill/automation and a
|
|
74
|
+
* CONTENT HASH for capability/cell. Never diff the two shapes.
|
|
75
|
+
*/
|
|
76
|
+
export interface InstalledRow {
|
|
77
|
+
kind: InstalledKind;
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
packageSlug: string | null;
|
|
81
|
+
templateKey: string | null;
|
|
82
|
+
installedVersion: string | null;
|
|
83
|
+
latestVersion: string | null;
|
|
84
|
+
drift: boolean | null;
|
|
85
|
+
installedAt: string | null;
|
|
86
|
+
workspaceId: string | null;
|
|
87
|
+
/** Joined LOCALLY from `GET /workspaces`; the door itself carries only the id. */
|
|
88
|
+
workspaceName: string | null;
|
|
89
|
+
provisioningStatus: string | null;
|
|
90
|
+
failedStep: string | null;
|
|
91
|
+
note?: string;
|
|
92
|
+
}
|
|
93
|
+
export interface InstalledInventory {
|
|
94
|
+
rows: InstalledRow[];
|
|
95
|
+
/** Echoes whether the pod ran its expensive drift pass. The CLI never asks for it. */
|
|
96
|
+
driftComputed: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* TRUE when the pod does not serve `GET /installed` (404) and this inventory
|
|
99
|
+
* was rebuilt from `GET /workspaces` alone — i.e. workspace packages only.
|
|
100
|
+
* Callers must SAY so; an older pod is not an empty pod.
|
|
101
|
+
*/
|
|
102
|
+
degraded: boolean;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* STRICT inventory — THROWS on any pod failure except the older-pod 404, which
|
|
106
|
+
* degrades to the historical `/workspaces` behaviour with `degraded: true`.
|
|
107
|
+
* Absence of the route is not absence of installs.
|
|
108
|
+
*/
|
|
109
|
+
export declare function fetchInstalledInventoryStrict(cfg?: HubConfig): Promise<InstalledInventory>;
|
|
110
|
+
/** Non-fatal inventory — empty (and NOT degraded) on any failure, for markers that must never block discovery. */
|
|
111
|
+
export declare function fetchInstalledInventory(cfg?: HubConfig): Promise<InstalledInventory>;
|
|
31
112
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* out of date" (`market update`'s `computeUpdates`). One Hub call, derived
|
|
35
|
-
* views. Unions TWO install shapes, mirroring the browser's
|
|
36
|
-
* `useInstalledPackageSlugs` (see that hook's doc for the full rationale):
|
|
113
|
+
* The UPDATABLE subset of an inventory, in the shape `computeUpdates` /
|
|
114
|
+
* `market update` / the composition renderers already speak.
|
|
37
115
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
116
|
+
* Rows with `packageSlug: null` are dropped ON PURPOSE — they are inventory,
|
|
117
|
+
* not update targets: `market update` takes a catalog SLUG, and a capability's
|
|
118
|
+
* `templateKey` is not one. Feeding them through would hand the user a slug
|
|
119
|
+
* that misses the catalog. `market installed` renders them separately.
|
|
41
120
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
121
|
+
* `drift: null` maps to `drifted: undefined`, which is `computeUpdates`'
|
|
122
|
+
* long-standing "the server didn't answer — derive it client-side, and report
|
|
123
|
+
* an unstampable install as noVersionInfo rather than outdated" path. It is
|
|
124
|
+
* NEVER mapped to `drifted: false`.
|
|
44
125
|
*/
|
|
126
|
+
export declare function installedRowsToTemplates(rows: InstalledRow[]): InstalledTemplateInfo[];
|
|
127
|
+
/**
|
|
128
|
+
* STRICT variant — THROWS on any pod failure instead of degrading to empty.
|
|
129
|
+
* Use when the caller must tell "pod unreachable" apart from "genuinely
|
|
130
|
+
* nothing installed": `market update` otherwise reports a transient Hub error
|
|
131
|
+
* as "No installed packages found," which reads as data loss and is why the
|
|
132
|
+
* command felt random (empty on one call, full on the next).
|
|
133
|
+
*
|
|
134
|
+
* Sources from `fetchInstalledInventoryStrict` — so every consumer of this
|
|
135
|
+
* function (`market update`, `launch --list`, the picker, `fetchInstalledSlugs`)
|
|
136
|
+
* now sees ALL SIX kinds on a current pod, and exactly the old workspace-only
|
|
137
|
+
* set on an older one.
|
|
138
|
+
*/
|
|
139
|
+
export declare function fetchInstalledTemplatesStrict(): Promise<InstalledTemplateInfo[]>;
|
|
45
140
|
export declare function fetchInstalledTemplates(): Promise<InstalledTemplateInfo[]>;
|
|
141
|
+
/**
|
|
142
|
+
* Ground-truth stamp verification — re-reads ONE workspace's stored
|
|
143
|
+
* `packageVersion` after an apply to confirm a version stamp actually landed,
|
|
144
|
+
* instead of INFERRING it from the apply response's `outcome` (a proxy that
|
|
145
|
+
* false-positives whenever content was already identical, so `outcome` comes
|
|
146
|
+
* back `"unchanged"` even though the stamp was written). Returns:
|
|
147
|
+
* - `true` — the workspace now carries the expected version (stamp landed).
|
|
148
|
+
* - `false` — reached the pod, but the stamp is missing/different (old pod
|
|
149
|
+
* that doesn't stamp on reconcile, or a real failure).
|
|
150
|
+
* - `null` — couldn't reach/find the workspace; don't cry wolf on a verify
|
|
151
|
+
* failure — the apply itself already succeeded.
|
|
152
|
+
*/
|
|
153
|
+
export declare function verifyStampLanded(workspaceId: string, expectedVersion: string, cfg?: HubConfig): Promise<boolean | null>;
|
|
154
|
+
/**
|
|
155
|
+
* A workspace's template-attachment status — every workspace on the pod, NOT
|
|
156
|
+
* just the ones with a package identity (which is `fetchInstalledTemplates`'s
|
|
157
|
+
* job). This is the raw material for the workspace-centric discovery surface
|
|
158
|
+
* (`market workspaces`): it deliberately KEEPS workspaces with no `packageSlug`
|
|
159
|
+
* so the user can find the pre-market / hand-built one that still needs
|
|
160
|
+
* attaching.
|
|
161
|
+
*/
|
|
162
|
+
export interface WorkspaceAttachment {
|
|
163
|
+
workspaceId: string;
|
|
164
|
+
workspaceName: string;
|
|
165
|
+
/** Operational-domain label — `settings.workspaceSubtype ?? workspaceType`, mirroring the `discover()` service's `domain` field. */
|
|
166
|
+
domain: string | null;
|
|
167
|
+
/** `settings.packageSlug` — null means this workspace was never provisioned from a template (pre-market or hand-built): a candidate to attach. */
|
|
168
|
+
packageSlug: string | null;
|
|
169
|
+
/** `settings.packageVersion` — set only when the pod version-stamped the install. `packageSlug` set + this null = "attached, no version stamp — reattach to enable updates". */
|
|
170
|
+
packageVersion: string | null;
|
|
171
|
+
/** Server-computed latest catalog version (Hub TemplateHealth); `undefined` on an older pod. */
|
|
172
|
+
latestVersion?: string | null;
|
|
173
|
+
/** Server-computed drift (Hub TemplateHealth) — the truthful "update available"; `undefined` on an older pod → client fallback. */
|
|
174
|
+
drifted?: boolean;
|
|
175
|
+
/** Template lifecycle (Hub TemplateHealth): current / retired / unlisted / unknown. `undefined` on an older pod — show what was shown before. */
|
|
176
|
+
lifecycle?: LifecycleInfo;
|
|
177
|
+
/** Overlays composed onto this space, each with its own standing. `undefined` on an older pod — show what was shown before. */
|
|
178
|
+
overlays?: OverlayInfo[];
|
|
179
|
+
/**
|
|
180
|
+
* The proposals this space's last template update is still waiting on — the
|
|
181
|
+
* pod reads them LIVE (Hub `awaitingApproval`), so a decided proposal is
|
|
182
|
+
* gone from here. `[]`/absent = nothing waiting (or an older pod).
|
|
183
|
+
*/
|
|
184
|
+
awaitingApproval?: string[];
|
|
185
|
+
/**
|
|
186
|
+
* The pod's ONE sentence for why this space's last template update did not
|
|
187
|
+
* finish (Hub `applyWarning`, synap-backend `templateApplyWarning`) — print
|
|
188
|
+
* it verbatim, never re-word it. `null`/absent = nothing to say.
|
|
189
|
+
*/
|
|
190
|
+
applyWarning?: string | null;
|
|
191
|
+
/** The pod's reading of the last apply (`healthApplyState`): building / active / awaiting-approval / partial / layer-2-not-run / failed. `null`/absent on an older pod. */
|
|
192
|
+
state?: string | null;
|
|
193
|
+
/** Data changes the update is held for until a person agrees. `undefined` on an older pod; `null` = nothing held. */
|
|
194
|
+
pendingDataChanges?: PendingDataChanges | null;
|
|
195
|
+
/** An agent's pending "update this space" proposal. `null`/absent = none (or an older pod). */
|
|
196
|
+
updateProposal?: {
|
|
197
|
+
id: string;
|
|
198
|
+
} | null;
|
|
199
|
+
/** Row warnings about the step (a read the pod could not check). Empty on an older pod. */
|
|
200
|
+
stepWarnings?: string[];
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Every workspace on the pod with its template-attachment status, sourced from
|
|
204
|
+
* the SAME Hub `GET /workspaces` call `fetchInstalledTemplates` uses (which
|
|
205
|
+
* already projects `packageSlug`/`packageVersion`/`workspaceType`/
|
|
206
|
+
* `workspaceSubtype`). Unlike `fetchInstalledTemplates`, it does NOT drop rows
|
|
207
|
+
* without a `packageSlug` — those unattached workspaces are exactly what the
|
|
208
|
+
* discovery surface exists to surface. Non-fatal: empty on ANY failure.
|
|
209
|
+
*
|
|
210
|
+
* Only the workspace's OWN `packageSlug` is considered here — additive
|
|
211
|
+
* `installedPacks` (profile/view/bento packs) don't constitute a workspace's
|
|
212
|
+
* template attachment, so they're intentionally ignored for this view.
|
|
213
|
+
*/
|
|
214
|
+
type HubWorkspaceAttachmentRow = {
|
|
215
|
+
id: string;
|
|
216
|
+
name: string;
|
|
217
|
+
workspaceType?: string | null;
|
|
218
|
+
workspaceSubtype?: string | null;
|
|
219
|
+
packageSlug?: string | null;
|
|
220
|
+
packageVersion?: string | null;
|
|
221
|
+
latestVersion?: string | null;
|
|
222
|
+
drifted?: boolean;
|
|
223
|
+
lifecycle?: string | null;
|
|
224
|
+
replacedBy?: string | null;
|
|
225
|
+
retiredReason?: string | null;
|
|
226
|
+
overlays?: unknown;
|
|
227
|
+
awaitingApproval?: unknown;
|
|
228
|
+
applyWarning?: unknown;
|
|
229
|
+
state?: unknown;
|
|
230
|
+
pendingDataChanges?: unknown;
|
|
231
|
+
updateProposal?: unknown;
|
|
232
|
+
stepWarnings?: unknown;
|
|
233
|
+
};
|
|
234
|
+
export declare function mapWorkspaceAttachments(rows: HubWorkspaceAttachmentRow[]): WorkspaceAttachment[];
|
|
235
|
+
/**
|
|
236
|
+
* STRICT variant — THROWS on any pod failure instead of degrading to empty.
|
|
237
|
+
* Use where an empty result would be a LIE about the user's pod (e.g. `synap
|
|
238
|
+
* templates`, the consolidated home): "pod unreachable" must not read as "no
|
|
239
|
+
* workspaces / stand one up" — the same false-empty trap `fetchInstalledTemplatesStrict`
|
|
240
|
+
* exists to prevent.
|
|
241
|
+
*/
|
|
242
|
+
export declare function fetchWorkspaceAttachmentsStrict(cfg?: HubConfig): Promise<WorkspaceAttachment[]>;
|
|
243
|
+
export declare function fetchWorkspaceAttachments(cfg?: HubConfig): Promise<WorkspaceAttachment[]>;
|
|
46
244
|
/**
|
|
47
245
|
* The set of `packageSlug`s installed on the active pod. Empty on ANY failure
|
|
48
246
|
* (no pod configured, unreachable, older build without the field) — the caller
|
|
49
247
|
* simply shows no "installed" markers.
|
|
50
248
|
*/
|
|
51
249
|
export declare function fetchInstalledSlugs(): Promise<Set<string>>;
|
|
250
|
+
export {};
|
package/dist/lib/installed.js
CHANGED
|
@@ -12,51 +12,249 @@
|
|
|
12
12
|
* build, this degrades to an empty set (no markers) rather than failing the
|
|
13
13
|
* discovery command — you can always browse the catalog offline.
|
|
14
14
|
*/
|
|
15
|
-
import { resolveHubConfig, hubGet } from "./hub-client.js";
|
|
15
|
+
import { resolveHubConfig, hubGet, HubError } from "./hub-client.js";
|
|
16
|
+
import { parseLifecycle, parseOverlays, parsePendingDataChanges, parseUpdateProposal, } from "./template-lifecycle.js";
|
|
17
|
+
// ── THE ONE READ DOOR — `GET /api/hub/installed` ────────────────────────────
|
|
18
|
+
//
|
|
19
|
+
// The pod projects all FOUR install ledgers it already maintains (workspaces,
|
|
20
|
+
// capability containers, marketSource-linked view/skill/automation rows, and
|
|
21
|
+
// package cells) through one kind-agnostic route. Before it existed this file
|
|
22
|
+
// asked `GET /workspaces` and nothing else, so `market installed` /
|
|
23
|
+
// `market update` / every drift marker structurally reported ONE of six kinds
|
|
24
|
+
// while their names claimed all of them.
|
|
25
|
+
//
|
|
26
|
+
// Two calls, deliberately, both cheap and local to the pod:
|
|
27
|
+
// • `/installed` — the six kinds. Absent on an older pod (404).
|
|
28
|
+
// • `/workspaces` — for TWO things `/installed` does not carry:
|
|
29
|
+
// 1. the workspace id→name join (`/installed` reports each ROW's own
|
|
30
|
+
// name — a view's title, not its workspace's), and
|
|
31
|
+
// 2. `settings.installedPacks[]`, an additive-pack ledger `/installed`
|
|
32
|
+
// reads only to decide whether a workspace counts as installed, and
|
|
33
|
+
// never emits rows for. Dropping it would un-list (and make
|
|
34
|
+
// un-updatable) every additive pack — a coverage regression in the
|
|
35
|
+
// exact command this consolidation exists to widen.
|
|
36
|
+
/** Every kind the door can report. Mirrors the pod's `INSTALLED_KINDS`. */
|
|
37
|
+
export const INSTALLED_KINDS = [
|
|
38
|
+
"workspace",
|
|
39
|
+
"capability",
|
|
40
|
+
"view",
|
|
41
|
+
"skill",
|
|
42
|
+
"automation",
|
|
43
|
+
"cell",
|
|
44
|
+
];
|
|
45
|
+
/** `GET /installed`, or `null` when this pod is too old to serve it. Any other failure throws. */
|
|
46
|
+
async function getInstalledOrNull(cfg) {
|
|
47
|
+
try {
|
|
48
|
+
return (await hubGet("/installed", {}, cfg));
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
if (e instanceof HubError && e.status === 404)
|
|
52
|
+
return null;
|
|
53
|
+
throw e;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
16
56
|
/**
|
|
17
|
-
*
|
|
18
|
-
* the
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
57
|
+
* STRICT inventory — THROWS on any pod failure except the older-pod 404, which
|
|
58
|
+
* degrades to the historical `/workspaces` behaviour with `degraded: true`.
|
|
59
|
+
* Absence of the route is not absence of installs.
|
|
60
|
+
*/
|
|
61
|
+
export async function fetchInstalledInventoryStrict(cfg) {
|
|
62
|
+
const resolved = cfg ?? (await resolveHubConfig());
|
|
63
|
+
const [wsRes, installedRes] = await Promise.all([
|
|
64
|
+
hubGet("/workspaces", {}, resolved),
|
|
65
|
+
getInstalledOrNull(resolved),
|
|
66
|
+
]);
|
|
67
|
+
const wsRows = wsRes.workspaces ?? [];
|
|
68
|
+
const nameById = new Map(wsRows.map((w) => [w.id, w.name]));
|
|
69
|
+
// Additive packs — the ledger `/installed` never emits rows for (see above).
|
|
70
|
+
const packRows = [];
|
|
71
|
+
for (const ws of wsRows) {
|
|
72
|
+
for (const pack of ws.installedPacks ?? []) {
|
|
73
|
+
if (!pack?.slug)
|
|
74
|
+
continue;
|
|
75
|
+
packRows.push({
|
|
76
|
+
kind: "workspace",
|
|
77
|
+
id: `${ws.id}:${pack.slug}`,
|
|
78
|
+
name: pack.slug,
|
|
79
|
+
packageSlug: pack.slug,
|
|
80
|
+
templateKey: null,
|
|
81
|
+
installedVersion: pack.version ?? null,
|
|
82
|
+
latestVersion: null,
|
|
83
|
+
// The pod never version-stamped or health-checked an additive pack, so
|
|
84
|
+
// it cannot be computed here either. `null`, not a defaulted `false`.
|
|
85
|
+
drift: null,
|
|
86
|
+
installedAt: null,
|
|
87
|
+
workspaceId: ws.id,
|
|
88
|
+
workspaceName: ws.name,
|
|
89
|
+
provisioningStatus: null,
|
|
90
|
+
failedStep: null,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (!installedRes) {
|
|
95
|
+
// Older pod: rebuild the workspace rows exactly as this file always did.
|
|
96
|
+
const wsOnly = wsRows
|
|
97
|
+
.filter((ws) => !!ws.packageSlug)
|
|
98
|
+
.map((ws) => ({
|
|
99
|
+
kind: "workspace",
|
|
100
|
+
id: ws.id,
|
|
101
|
+
name: ws.name,
|
|
102
|
+
packageSlug: ws.packageSlug,
|
|
103
|
+
templateKey: null,
|
|
104
|
+
installedVersion: ws.packageVersion ?? null,
|
|
105
|
+
latestVersion: ws.latestVersion ?? null,
|
|
106
|
+
drift: ws.drifted ?? null,
|
|
107
|
+
installedAt: null,
|
|
108
|
+
workspaceId: ws.id,
|
|
109
|
+
workspaceName: ws.name,
|
|
110
|
+
provisioningStatus: null,
|
|
111
|
+
failedStep: null,
|
|
112
|
+
}));
|
|
113
|
+
return { rows: [...wsOnly, ...packRows], driftComputed: false, degraded: true };
|
|
114
|
+
}
|
|
115
|
+
const rows = (installedRes.installed ?? []).map((r) => ({
|
|
116
|
+
...r,
|
|
117
|
+
workspaceName: r.workspaceId ? (nameById.get(r.workspaceId) ?? null) : null,
|
|
118
|
+
}));
|
|
119
|
+
return {
|
|
120
|
+
rows: [...rows, ...packRows],
|
|
121
|
+
driftComputed: installedRes.driftComputed === true,
|
|
122
|
+
degraded: false,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/** Non-fatal inventory — empty (and NOT degraded) on any failure, for markers that must never block discovery. */
|
|
126
|
+
export async function fetchInstalledInventory(cfg) {
|
|
127
|
+
try {
|
|
128
|
+
return await fetchInstalledInventoryStrict(cfg);
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
return { rows: [], driftComputed: false, degraded: false };
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The UPDATABLE subset of an inventory, in the shape `computeUpdates` /
|
|
136
|
+
* `market update` / the composition renderers already speak.
|
|
22
137
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
138
|
+
* Rows with `packageSlug: null` are dropped ON PURPOSE — they are inventory,
|
|
139
|
+
* not update targets: `market update` takes a catalog SLUG, and a capability's
|
|
140
|
+
* `templateKey` is not one. Feeding them through would hand the user a slug
|
|
141
|
+
* that misses the catalog. `market installed` renders them separately.
|
|
26
142
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
143
|
+
* `drift: null` maps to `drifted: undefined`, which is `computeUpdates`'
|
|
144
|
+
* long-standing "the server didn't answer — derive it client-side, and report
|
|
145
|
+
* an unstampable install as noVersionInfo rather than outdated" path. It is
|
|
146
|
+
* NEVER mapped to `drifted: false`.
|
|
29
147
|
*/
|
|
30
|
-
export
|
|
148
|
+
export function installedRowsToTemplates(rows) {
|
|
31
149
|
const out = [];
|
|
150
|
+
for (const r of rows) {
|
|
151
|
+
if (!r.packageSlug)
|
|
152
|
+
continue;
|
|
153
|
+
out.push({
|
|
154
|
+
kind: r.kind,
|
|
155
|
+
slug: r.packageSlug,
|
|
156
|
+
version: r.installedVersion ?? undefined,
|
|
157
|
+
workspaceId: r.workspaceId,
|
|
158
|
+
workspaceName: r.workspaceName ?? (r.workspaceId ? r.workspaceId : "pod-wide"),
|
|
159
|
+
latestVersion: r.latestVersion ?? undefined,
|
|
160
|
+
drifted: r.drift ?? undefined,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return out;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* STRICT variant — THROWS on any pod failure instead of degrading to empty.
|
|
167
|
+
* Use when the caller must tell "pod unreachable" apart from "genuinely
|
|
168
|
+
* nothing installed": `market update` otherwise reports a transient Hub error
|
|
169
|
+
* as "No installed packages found," which reads as data loss and is why the
|
|
170
|
+
* command felt random (empty on one call, full on the next).
|
|
171
|
+
*
|
|
172
|
+
* Sources from `fetchInstalledInventoryStrict` — so every consumer of this
|
|
173
|
+
* function (`market update`, `launch --list`, the picker, `fetchInstalledSlugs`)
|
|
174
|
+
* now sees ALL SIX kinds on a current pod, and exactly the old workspace-only
|
|
175
|
+
* set on an older one.
|
|
176
|
+
*/
|
|
177
|
+
export async function fetchInstalledTemplatesStrict() {
|
|
178
|
+
const inv = await fetchInstalledInventoryStrict();
|
|
179
|
+
return installedRowsToTemplates(inv.rows);
|
|
180
|
+
}
|
|
181
|
+
export async function fetchInstalledTemplates() {
|
|
32
182
|
try {
|
|
33
|
-
|
|
34
|
-
const res = (await hubGet("/workspaces", {}, cfg));
|
|
35
|
-
for (const ws of res.workspaces ?? []) {
|
|
36
|
-
if (ws.packageSlug) {
|
|
37
|
-
out.push({
|
|
38
|
-
slug: ws.packageSlug,
|
|
39
|
-
version: ws.packageVersion ?? undefined,
|
|
40
|
-
workspaceId: ws.id,
|
|
41
|
-
workspaceName: ws.name,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
for (const pack of ws.installedPacks ?? []) {
|
|
45
|
-
if (pack?.slug) {
|
|
46
|
-
out.push({
|
|
47
|
-
slug: pack.slug,
|
|
48
|
-
version: pack.version,
|
|
49
|
-
workspaceId: ws.id,
|
|
50
|
-
workspaceName: ws.name,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
183
|
+
return await fetchInstalledTemplatesStrict();
|
|
55
184
|
}
|
|
56
185
|
catch {
|
|
57
|
-
// Non-fatal: degrade to empty. Discovery never
|
|
186
|
+
// Non-fatal: degrade to empty. Discovery/markers never depend on the pod.
|
|
187
|
+
return [];
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Ground-truth stamp verification — re-reads ONE workspace's stored
|
|
192
|
+
* `packageVersion` after an apply to confirm a version stamp actually landed,
|
|
193
|
+
* instead of INFERRING it from the apply response's `outcome` (a proxy that
|
|
194
|
+
* false-positives whenever content was already identical, so `outcome` comes
|
|
195
|
+
* back `"unchanged"` even though the stamp was written). Returns:
|
|
196
|
+
* - `true` — the workspace now carries the expected version (stamp landed).
|
|
197
|
+
* - `false` — reached the pod, but the stamp is missing/different (old pod
|
|
198
|
+
* that doesn't stamp on reconcile, or a real failure).
|
|
199
|
+
* - `null` — couldn't reach/find the workspace; don't cry wolf on a verify
|
|
200
|
+
* failure — the apply itself already succeeded.
|
|
201
|
+
*/
|
|
202
|
+
export async function verifyStampLanded(workspaceId, expectedVersion, cfg) {
|
|
203
|
+
try {
|
|
204
|
+
const resolved = cfg ?? (await resolveHubConfig());
|
|
205
|
+
const res = (await hubGet("/workspaces", {}, resolved));
|
|
206
|
+
const ws = (res.workspaces ?? []).find((w) => w.id === workspaceId);
|
|
207
|
+
if (!ws)
|
|
208
|
+
return null;
|
|
209
|
+
return (ws.packageVersion ?? null) === expectedVersion;
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
export function mapWorkspaceAttachments(rows) {
|
|
216
|
+
return rows.map((ws) => ({
|
|
217
|
+
workspaceId: ws.id,
|
|
218
|
+
workspaceName: ws.name,
|
|
219
|
+
domain: ws.workspaceSubtype ?? ws.workspaceType ?? null,
|
|
220
|
+
packageSlug: ws.packageSlug ?? null,
|
|
221
|
+
packageVersion: ws.packageVersion ?? null,
|
|
222
|
+
latestVersion: ws.latestVersion ?? undefined,
|
|
223
|
+
drifted: ws.drifted,
|
|
224
|
+
lifecycle: parseLifecycle(ws),
|
|
225
|
+
overlays: parseOverlays(ws),
|
|
226
|
+
awaitingApproval: Array.isArray(ws.awaitingApproval)
|
|
227
|
+
? ws.awaitingApproval.filter((p) => typeof p === "string")
|
|
228
|
+
: undefined,
|
|
229
|
+
applyWarning: typeof ws.applyWarning === "string" ? ws.applyWarning : null,
|
|
230
|
+
state: typeof ws.state === "string" ? ws.state : null,
|
|
231
|
+
pendingDataChanges: parsePendingDataChanges(ws),
|
|
232
|
+
updateProposal: parseUpdateProposal(ws),
|
|
233
|
+
stepWarnings: Array.isArray(ws.stepWarnings)
|
|
234
|
+
? ws.stepWarnings.filter((w) => typeof w === "string" && w.trim() !== "")
|
|
235
|
+
: [],
|
|
236
|
+
}));
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* STRICT variant — THROWS on any pod failure instead of degrading to empty.
|
|
240
|
+
* Use where an empty result would be a LIE about the user's pod (e.g. `synap
|
|
241
|
+
* templates`, the consolidated home): "pod unreachable" must not read as "no
|
|
242
|
+
* workspaces / stand one up" — the same false-empty trap `fetchInstalledTemplatesStrict`
|
|
243
|
+
* exists to prevent.
|
|
244
|
+
*/
|
|
245
|
+
export async function fetchWorkspaceAttachmentsStrict(cfg) {
|
|
246
|
+
const resolved = cfg ?? (await resolveHubConfig());
|
|
247
|
+
const res = (await hubGet("/workspaces", {}, resolved));
|
|
248
|
+
return mapWorkspaceAttachments(res.workspaces ?? []);
|
|
249
|
+
}
|
|
250
|
+
export async function fetchWorkspaceAttachments(cfg) {
|
|
251
|
+
try {
|
|
252
|
+
return await fetchWorkspaceAttachmentsStrict(cfg);
|
|
253
|
+
}
|
|
254
|
+
catch {
|
|
255
|
+
// Non-fatal: degrade to empty. Discovery/markers never hard-depend on the pod.
|
|
256
|
+
return [];
|
|
58
257
|
}
|
|
59
|
-
return out;
|
|
60
258
|
}
|
|
61
259
|
/**
|
|
62
260
|
* The set of `packageSlug`s installed on the active pod. Empty on ANY failure
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installed.js","sourceRoot":"","sources":["../../src/lib/installed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,g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AM,CAAC,KAAK,UAAU,yBAAyB,CAAC,GAAe;IAC7D,IAAI,CAAC;QACH,OAAO,MAAM,+BAA+B,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACP,+EAA+E;QAC/E,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,MAAM,SAAS,GAAG,MAAM,uBAAuB,EAAE,CAAC;IAClD,OAAO,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Waiting for a pending agent key to be approved — and resuming that wait.
|
|
3
|
+
*
|
|
4
|
+
* Two rules, both learnt from the 2026-10-12 incident:
|
|
5
|
+
*
|
|
6
|
+
* 1. The wait asks about the PENDING key, presenting the pending key itself
|
|
7
|
+
* (`/auth/key-state`). The old poll authenticated with the person's own
|
|
8
|
+
* key — which, mid-incident, was the very key the approval had just
|
|
9
|
+
* revoked, so the poll could never see the approval land.
|
|
10
|
+
* 2. A request is never filed twice. A minted-but-unapproved key is recorded
|
|
11
|
+
* (`pendingAgentKeys`); the next connect / `doctor --fix` resumes it. Three
|
|
12
|
+
* orphaned requests accumulated in one evening before this.
|
|
13
|
+
*/
|
|
14
|
+
import { type FetchLike, type KeyState } from "./key-state.js";
|
|
15
|
+
import type { PendingAgentKey } from "./pod.js";
|
|
16
|
+
/** The approval did not land in time. The request stays filed and resumable. */
|
|
17
|
+
export declare class AgentKeyAwaitingApprovalError extends Error {
|
|
18
|
+
readonly agentType: string;
|
|
19
|
+
readonly approvalUrl: string;
|
|
20
|
+
constructor(agentType: string, approvalUrl: string);
|
|
21
|
+
}
|
|
22
|
+
export type KeyWaitOutcome = "approved" | "rejected" | "timeout";
|
|
23
|
+
export interface WaitForKeyLiveOpts {
|
|
24
|
+
podUrl: string;
|
|
25
|
+
/** The pending key's own plaintext — the bearer for `/auth/key-state`. */
|
|
26
|
+
pendingKey: string;
|
|
27
|
+
/** Older pods: its id, polled on `/setup/agent/pending/:id` with the human key. */
|
|
28
|
+
pendingToken?: string;
|
|
29
|
+
humanApiKey?: string;
|
|
30
|
+
timeoutMs?: number;
|
|
31
|
+
intervalMs?: number;
|
|
32
|
+
fetch?: FetchLike;
|
|
33
|
+
sleep?: (ms: number) => Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Wait until the pod says the key is live (`approved`), refused
|
|
37
|
+
* (`rejected`: revoked / expired / unknown), or the deadline passes.
|
|
38
|
+
* Transient failures never end the wait early.
|
|
39
|
+
*/
|
|
40
|
+
export declare function waitForKeyLive(opts: WaitForKeyLiveOpts): Promise<KeyWaitOutcome>;
|
|
41
|
+
/**
|
|
42
|
+
* What a recorded pending key is now: still waiting (resume it), live
|
|
43
|
+
* (approved while we were away — promote it), or dead (forget it, file anew).
|
|
44
|
+
* An unreachable pod keeps it recorded and says so (`unknown`).
|
|
45
|
+
*/
|
|
46
|
+
export declare function classifyRecordedPending(pending: PendingAgentKey, deps?: {
|
|
47
|
+
fetch?: FetchLike;
|
|
48
|
+
}): Promise<{
|
|
49
|
+
kind: "pending" | "active" | "dead" | "unknown";
|
|
50
|
+
state: KeyState;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Print the approval link, open it, and wait — the one interactive wait.
|
|
54
|
+
* The link came from the pod: it is opened only when it is on that pod's own
|
|
55
|
+
* origin or its pod-admin origin (`openPodPage`), never anywhere else.
|
|
56
|
+
*/
|
|
57
|
+
export declare function openAndWait(agentType: string, approvalUrl: string, podUrl: string, wait: () => Promise<KeyWaitOutcome>, openUrl: (url: string) => void): Promise<KeyWaitOutcome>;
|