@synap-core/cli 1.10.0 → 1.12.2
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/README.md +23 -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 +33 -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 +523 -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 +80 -35
- package/dist/commands/automation.js.map +1 -1
- package/dist/commands/bridge-setup.d.ts +14 -1
- package/dist/commands/bridge-setup.js +392 -128
- 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 +2 -0
- package/dist/commands/capability.js +297 -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 +3 -14
- package/dist/commands/centrality.js.map +1 -1
- package/dist/commands/connect.d.ts +38 -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 +9 -2
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/data-extra.d.ts +34 -0
- package/dist/commands/data-extra.js +198 -25
- package/dist/commands/data-extra.js.map +1 -1
- package/dist/commands/data.d.ts +120 -2
- package/dist/commands/data.js +307 -24
- package/dist/commands/data.js.map +1 -1
- package/dist/commands/diagnose.d.ts +66 -4
- package/dist/commands/diagnose.js +329 -29
- package/dist/commands/diagnose.js.map +1 -1
- package/dist/commands/digest.js +2 -1
- package/dist/commands/digest.js.map +1 -1
- package/dist/commands/doc.d.ts +25 -4
- package/dist/commands/doc.js +100 -18
- package/dist/commands/doc.js.map +1 -1
- package/dist/commands/doctor.d.ts +130 -0
- package/dist/commands/doctor.js +814 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/events.js +3 -1
- package/dist/commands/events.js.map +1 -1
- package/dist/commands/explain.js +5 -5
- package/dist/commands/explain.js.map +1 -1
- package/dist/commands/graph.js +5 -3
- package/dist/commands/graph.js.map +1 -1
- package/dist/commands/import.d.ts +368 -13
- package/dist/commands/import.js +1096 -55
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/init.d.ts +20 -9
- package/dist/commands/init.js +433 -973
- 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 +28 -6
- package/dist/commands/knowledge.js +358 -73
- package/dist/commands/knowledge.js.map +1 -1
- package/dist/commands/launch.js +2 -2
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/lens.d.ts +37 -1
- package/dist/commands/lens.js +193 -72
- package/dist/commands/lens.js.map +1 -1
- package/dist/commands/market-authoring.d.ts +72 -0
- package/dist/commands/market-authoring.js +566 -0
- package/dist/commands/market-authoring.js.map +1 -0
- 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 +419 -20
- package/dist/commands/market.js +2124 -193
- package/dist/commands/market.js.map +1 -1
- package/dist/commands/mcp.d.ts +70 -13
- package/dist/commands/mcp.js +308 -40
- package/dist/commands/mcp.js.map +1 -1
- 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 +162 -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 +19 -0
- package/dist/commands/pods.js +220 -85
- package/dist/commands/pods.js.map +1 -1
- package/dist/commands/proposals-actions.d.ts +62 -0
- package/dist/commands/proposals-actions.js +146 -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 +577 -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-wait.d.ts +111 -0
- package/dist/commands/session-wait.js +209 -0
- package/dist/commands/session-wait.js.map +1 -0
- package/dist/commands/sessions.d.ts +52 -0
- package/dist/commands/sessions.js +479 -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.js +19 -1
- package/dist/commands/skills.js.map +1 -1
- package/dist/commands/status.d.ts +1 -4
- package/dist/commands/status.js +5 -34
- 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 +51 -0
- package/dist/commands/tracks.js +291 -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 +68 -0
- package/dist/commands/upload.js +257 -0
- package/dist/commands/upload.js.map +1 -0
- 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 +23 -3
- package/dist/commands/whoami.js +169 -23
- package/dist/commands/whoami.js.map +1 -1
- package/dist/commands/worker.d.ts +122 -0
- package/dist/commands/worker.js +435 -0
- package/dist/commands/worker.js.map +1 -0
- package/dist/commands/worker.test.d.ts +1 -0
- package/dist/commands/worker.test.js +116 -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 +1009 -171
- 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 +138 -0
- package/dist/lib/agent-door.js +426 -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 +14 -9
- package/dist/lib/auth.js +44 -61
- 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/capture-lane.d.ts +6 -5
- package/dist/lib/capture-lane.js +11 -8
- package/dist/lib/capture-lane.js.map +1 -1
- package/dist/lib/capture-structure.d.ts +342 -0
- package/dist/lib/capture-structure.js +295 -0
- package/dist/lib/capture-structure.js.map +1 -0
- 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/conversation-headers.d.ts +18 -0
- package/dist/lib/conversation-headers.js +32 -0
- package/dist/lib/conversation-headers.js.map +1 -0
- package/dist/lib/cp-packages.d.ts +216 -4
- package/dist/lib/cp-packages.js +414 -11
- package/dist/lib/cp-packages.js.map +1 -1
- package/dist/lib/credential-class.d.ts +117 -0
- package/dist/lib/credential-class.js +116 -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/hub-client.d.ts +43 -9
- package/dist/lib/hub-client.js +429 -65
- package/dist/lib/hub-client.js.map +1 -1
- package/dist/lib/id.d.ts +23 -0
- package/dist/lib/id.js +35 -0
- package/dist/lib/id.js.map +1 -0
- 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 +16 -0
- package/dist/lib/init-handoff.js +19 -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 +66 -0
- package/dist/lib/key-source.js +106 -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 +24 -0
- package/dist/lib/knowledge-title.js +46 -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 +42 -0
- package/dist/lib/mcp-bridge.js +147 -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 +90 -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/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-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 +119 -115
- package/dist/lib/pod.js +206 -412
- 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/review-credential.d.ts +119 -0
- package/dist/lib/review-credential.js +147 -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-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 +134 -10
- package/dist/lib/targets.js +962 -258
- package/dist/lib/targets.js.map +1 -1
- package/dist/lib/template-file.d.ts +78 -0
- package/dist/lib/template-file.js +140 -0
- package/dist/lib/template-file.js.map +1 -0
- 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/utils/logger.js +5 -2
- package/dist/utils/logger.js.map +1 -1
- package/package.json +25 -18
- package/skills/README.md +12 -10
- package/skills/agent-os/SKILL.md +220 -99
- package/skills/manifest.json +2 -2
- package/skills/onboard/SKILL.md +61 -25
- package/skills/synap/README.md +5 -8
- package/skills/synap/SKILL.md +1185 -301
- 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 +54 -151
- package/skills/synap/cli-operations.md +24 -18
- package/skills/synap/common-mistakes.md +1 -0
- package/skills/synap/concepts.md +28 -0
- package/skills/synap/content-os.md +92 -0
- package/skills/synap/creative-loop.md +15 -10
- package/skills/synap/crm.md +21 -52
- package/skills/synap/digesting-a-channel.md +25 -0
- package/skills/synap/document-embeds.md +141 -47
- package/skills/synap/escalation-ladder.md +20 -10
- package/skills/synap/focus-sessions.md +47 -21
- package/skills/synap/from-intent.md +142 -0
- package/skills/synap/governance-rules.md +4 -4
- 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 +33 -15
- package/skills/synap/linking.md +41 -40
- package/skills/synap/mcp-remote-servers.md +64 -0
- package/skills/synap/mental-model.md +24 -22
- package/skills/synap/multi-entity-capture.md +6 -4
- package/skills/synap/operating-mode-rules.md +1 -1
- package/skills/synap/processes.md +118 -0
- package/skills/synap/quick-reference.md +5 -1
- 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 +96 -0
- package/skills/synap/worked-examples.md +21 -1
- package/skills/synap/workspace-design.md +14 -10
- package/skills/synap/writes.md +165 -35
- package/skills/synap/writing-titles.md +63 -0
- package/skills/synap-app/SKILL.md +319 -0
- package/skills/synap-app/_order.txt +5 -0
- package/skills/synap-app/_skill.yaml +20 -0
- package/skills/synap-app/creating-the-base-app.md +64 -0
- package/skills/synap-app/governance.md +42 -0
- package/skills/synap-app/install-commands.md +55 -0
- package/skills/synap-app/overview.md +50 -0
- package/skills/synap-app/using-the-sdk.md +73 -0
- 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 +625 -0
- package/skills/synap-market/_order.txt +5 -0
- package/skills/synap-market/_skill.yaml +24 -0
- package/skills/synap-market/author-and-publish.md +212 -0
- package/skills/synap-market/discover-and-fetch.md +59 -0
- package/skills/synap-market/governance-and-catalog.md +63 -0
- package/skills/synap-market/install.md +133 -0
- package/skills/synap-market/overview.md +119 -0
- 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/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/dist/lib/browser-auth.d.ts +0 -35
- package/dist/lib/browser-auth.js +0 -170
- package/dist/lib/browser-auth.js.map +0 -1
- package/dist/lib/openclaw.d.ts +0 -32
- package/dist/lib/openclaw.js +0 -164
- package/dist/lib/openclaw.js.map +0 -1
- package/dist/lib/seed.d.ts +0 -13
- package/dist/lib/seed.js +0 -135
- package/dist/lib/seed.js.map +0 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the pod says about ONE key — asked by its holder.
|
|
3
|
+
*
|
|
4
|
+
* `GET /api/hub/auth/key-state` answers for a key whether or not it
|
|
5
|
+
* authenticates: active, awaiting approval (+ the approval page), revoked (+
|
|
6
|
+
* why, and when/where a replacing connection was made), expired, or unknown.
|
|
7
|
+
* A pod older than that door answers 404; we then fall back to `/auth/status`,
|
|
8
|
+
* which can only say "works" or "does not work" — reported as `inactive`, never
|
|
9
|
+
* guessed into "revoked" (that guess is what sent the 2026-10-12 incident down
|
|
10
|
+
* the wrong path: the key was only awaiting approval).
|
|
11
|
+
*
|
|
12
|
+
* Also the ONE write gate: a key is persisted into a config only when the pod
|
|
13
|
+
* has not positively said it is unusable (`writeGate`).
|
|
14
|
+
*/
|
|
15
|
+
const STATES = new Set(["active", "awaiting_approval", "revoked", "expired", "unknown"]);
|
|
16
|
+
/** Ask the pod about `key`. Never throws. */
|
|
17
|
+
export async function fetchKeyState(podUrl, key, deps = {}) {
|
|
18
|
+
const f = deps.fetch ?? fetch;
|
|
19
|
+
const base = podUrl.replace(/\/+$/, "");
|
|
20
|
+
const init = () => ({
|
|
21
|
+
headers: { Authorization: `Bearer ${key}` },
|
|
22
|
+
signal: AbortSignal.timeout(deps.timeoutMs ?? 15_000),
|
|
23
|
+
});
|
|
24
|
+
const failure = (err) => err?.name === "TimeoutError" ? `no answer in ${Math.round((deps.timeoutMs ?? 15_000) / 1000)}s` : err.message;
|
|
25
|
+
let res;
|
|
26
|
+
try {
|
|
27
|
+
res = await f(`${base}/api/hub/auth/key-state`, init());
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
return { state: "unreachable", error: failure(err) };
|
|
31
|
+
}
|
|
32
|
+
if (res.ok) {
|
|
33
|
+
const body = (await res.json().catch(() => null));
|
|
34
|
+
if (body && typeof body.state === "string" && STATES.has(body.state))
|
|
35
|
+
return body;
|
|
36
|
+
return { state: "unreachable", error: "the pod answered key-state with an unreadable body" };
|
|
37
|
+
}
|
|
38
|
+
if (res.status !== 404)
|
|
39
|
+
return nonOkState(res.status, "/auth/key-state");
|
|
40
|
+
// Older pod: no key-state door. `/auth/status` says works / does not work.
|
|
41
|
+
let legacy;
|
|
42
|
+
try {
|
|
43
|
+
legacy = await f(`${base}/api/hub/auth/status`, init());
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
return { state: "unreachable", error: failure(err), legacy: true };
|
|
47
|
+
}
|
|
48
|
+
if (legacy.ok) {
|
|
49
|
+
const s = (await legacy.json().catch(() => ({})));
|
|
50
|
+
return { state: "active", legacy: true, keyId: s.keyId, keyIdPrefix: s.keyIdPrefix, expiresAt: s.expiresAt ?? null };
|
|
51
|
+
}
|
|
52
|
+
if (legacy.status === 401) {
|
|
53
|
+
const env = (await legacy.json().catch(() => ({})));
|
|
54
|
+
if (env.reason === "expired")
|
|
55
|
+
return { state: "expired", legacy: true, keyIdPrefix: env.keyIdPrefix };
|
|
56
|
+
return { state: "inactive", legacy: true, keyIdPrefix: env.keyIdPrefix };
|
|
57
|
+
}
|
|
58
|
+
return { ...nonOkState(legacy.status, "/auth/status"), legacy: true };
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A non-OK answer that is not the older-pod 404. Only a 5xx (or a rate-limit /
|
|
62
|
+
* request timeout, which says nothing about the key) is `unreachable`. Any
|
|
63
|
+
* other refusal — 401, 403 (a guest's key), 400… — is the pod saying NO to
|
|
64
|
+
* this key: `inactive`, which `writeGate` refuses. Reading a 403 as
|
|
65
|
+
* "unreachable" let the gate write a key the pod refuses.
|
|
66
|
+
*/
|
|
67
|
+
function nonOkState(status, door) {
|
|
68
|
+
if (status >= 500 || status === 408 || status === 429)
|
|
69
|
+
return { state: "unreachable", error: `HTTP ${status} from ${door}` };
|
|
70
|
+
// A pod with neither door cannot be asked at all — no answer, not a "no".
|
|
71
|
+
if (status === 404)
|
|
72
|
+
return { state: "unreachable", error: `this pod has no ${door} door` };
|
|
73
|
+
return { state: "inactive", error: `HTTP ${status} from ${door}` };
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* May this key be written into a config? Only a POSITIVE "unusable" refuses:
|
|
77
|
+
* pending, revoked, expired, unknown to the pod, or (older pod) rejected. An
|
|
78
|
+
* unreachable pod is not evidence — it allows, with a warning.
|
|
79
|
+
*/
|
|
80
|
+
export function writeGate(s) {
|
|
81
|
+
switch (s.state) {
|
|
82
|
+
case "active":
|
|
83
|
+
return { allow: true };
|
|
84
|
+
case "unreachable":
|
|
85
|
+
return { allow: true, warning: `could not confirm the key with the pod (${s.error ?? "unreachable"})` };
|
|
86
|
+
case "awaiting_approval":
|
|
87
|
+
return { allow: false, reason: "the key is still awaiting approval" };
|
|
88
|
+
case "revoked":
|
|
89
|
+
return { allow: false, reason: `the key was revoked${s.revokedReason ? ` (${s.revokedReason})` : ""}` };
|
|
90
|
+
case "expired":
|
|
91
|
+
return { allow: false, reason: "the key has expired" };
|
|
92
|
+
case "unknown":
|
|
93
|
+
return { allow: false, reason: "the pod does not know this key" };
|
|
94
|
+
case "inactive":
|
|
95
|
+
return { allow: false, reason: "the pod refuses this key" };
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** Thrown when a caller tries to persist a key the pod says is unusable. */
|
|
99
|
+
export class KeyNotLiveError extends Error {
|
|
100
|
+
keyState;
|
|
101
|
+
constructor(keyState, reason) {
|
|
102
|
+
super(`Refusing to save this key: ${reason}.`);
|
|
103
|
+
this.keyState = keyState;
|
|
104
|
+
this.name = "KeyNotLiveError";
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/** Ask the pod, then refuse (throw) unless the key may be written. */
|
|
108
|
+
export async function assertKeyWritable(podUrl, key, deps = {}) {
|
|
109
|
+
const s = await fetchKeyState(podUrl, key, deps);
|
|
110
|
+
const gate = writeGate(s);
|
|
111
|
+
if (!gate.allow)
|
|
112
|
+
throw new KeyNotLiveError(s, gate.reason);
|
|
113
|
+
return s;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=key-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-state.js","sourceRoot":"","sources":["../../src/lib/key-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAiCH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAIzF,6CAA6C;AAC7C,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAc,EACd,GAAW,EACX,OAAkD,EAAE;IAEpD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC;IAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,GAAgB,EAAE,CAAC,CAAC;QAC/B,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,GAAG,EAAE,EAAE;QAC3C,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC;KACtD,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,CAAC,GAAY,EAAE,EAAE,CAC9B,GAAa,EAAE,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC,gBAAgB,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAE,GAAa,CAAC,OAAO,CAAC;I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d,GAAW,EACX,OAA8B,EAAE;IAEhC,MAAM,CAAC,GAAG,MAAM,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAC1B,IAAI,CAAC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3D,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standalone (non-workspace) package files — view / cell / skill / workflow.
|
|
3
|
+
* ================================================================
|
|
4
|
+
* `market-authoring.ts`'s scaffold/publish loop is WorkspaceYaml-shaped (a
|
|
5
|
+
* `meta` + `workspace` envelope validated by `validateTemplate`). A lone view,
|
|
6
|
+
* cell, or skill has no such envelope — it IS its content. This file is the
|
|
7
|
+
* PURE half (no network, no `process.exit`) for that shape: parse a standalone
|
|
8
|
+
* package file, run the minimal structural check the CP's own
|
|
9
|
+
* `packageDefinitionSchema` needs (see synap-control-plane-api/src/routes/
|
|
10
|
+
* packages.ts), and hand back a definition `publishPackage` can post.
|
|
11
|
+
*
|
|
12
|
+
* File shape (explicit — no `_meta`/`meta` ambiguity, unlike the workspace
|
|
13
|
+
* envelope):
|
|
14
|
+
* {
|
|
15
|
+
* "category": "cell" | "view",
|
|
16
|
+
* "slug": "my-cell",
|
|
17
|
+
* "displayName": "My Cell",
|
|
18
|
+
* "description": "...", // optional
|
|
19
|
+
* "tags": ["..."], // optional
|
|
20
|
+
* "definition": { "cells": [...] } | { "views": [...] }
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* A `cells[]` entry may carry `codeFile` (a path to the cell's ESM entry
|
|
24
|
+
* source, resolved relative to the package file) INSTEAD of an inline `code`
|
|
25
|
+
* string — the indirection an author needs to publish from a real source file
|
|
26
|
+
* rather than hand-pasting a minified bundle into JSON. `codeFile` is CLI-only:
|
|
27
|
+
* the CP's `packageDefinitionSchema.cells[]` has no such slot (only `code`,
|
|
28
|
+
* required), so `resolveCellCodeFiles` bundles it (via `cell.ts`'s
|
|
29
|
+
* `buildCellFromSource` — the SAME esbuild path `cell build` uses) and inlines
|
|
30
|
+
* the result into `code` before the definition ever reaches `publishPackage`.
|
|
31
|
+
*
|
|
32
|
+
* ✅ RESOLVED 2026-09-04 — this block used to claim that
|
|
33
|
+
* `packageDefinitionSchema` requires `definition.profiles` to be non-empty
|
|
34
|
+
* UNCONDITIONALLY, so a profile-less view/cell/skill package would 400 against
|
|
35
|
+
* `POST /api/packages`. That is NO LONGER TRUE and had become a load-bearing
|
|
36
|
+
* lie: the rule moved to a category-gated `superRefine` on the OUTER schema
|
|
37
|
+
* (`synap-control-plane-api/src/routes/packages.ts:859-872` — only that schema
|
|
38
|
+
* can see the sibling `category`), and it now fires for `category === "workspace"`
|
|
39
|
+
* ONLY. Every other kind may publish with `profiles: []`.
|
|
40
|
+
*
|
|
41
|
+
* Left as a tombstone rather than deleted because the stale claim outlived its
|
|
42
|
+
* fix and was still being cited as fact months later.
|
|
43
|
+
*
|
|
44
|
+
* ✅ RESOLVED 2026-10-06 — "skill" NOW HAS A PAYLOAD SLOT. This block used to
|
|
45
|
+
* warn that `packageDefinitionSchema` carried no top-level slot for a standalone
|
|
46
|
+
* skill, so one had nowhere to land and `validateStandalonePackage` reported it
|
|
47
|
+
* rather than inventing a shape. Both halves are now false: the CP grew a
|
|
48
|
+
* SINGULAR `skill:` slot (`synap-control-plane-api/src/routes/packages.ts`,
|
|
49
|
+
* beside `capability:`) whose field names mirror the pod's own create door, and
|
|
50
|
+
* the pod grew an applier + resolver entry so a `skill` dependency installs
|
|
51
|
+
* itself. Note the shape is `skill`, NOT `skills` — the plural is the workspace
|
|
52
|
+
* template's DECLARED-skills array, an unrelated lane that already existed.
|
|
53
|
+
*
|
|
54
|
+
* Left as a tombstone, like the block above: the stale claim was load-bearing
|
|
55
|
+
* (it is why `skill` was refused at scaffold) and would otherwise be cited again.
|
|
56
|
+
*/
|
|
57
|
+
import type { PackageDefinitionLike } from "./template-file.js";
|
|
58
|
+
/**
|
|
59
|
+
* The non-workspace package types this file knows how to shape. Mirrors the
|
|
60
|
+
* live subset of the CP's `PACKAGE_TYPES` SSOT (db/schema/packages.ts) —
|
|
61
|
+
* "workspace" has its own authoring loop (`template-file.ts`).
|
|
62
|
+
*
|
|
63
|
+
* `workflow` (the CP's rename of the old "automation" + "playbook") IS a lone
|
|
64
|
+
* file: its payload is `definition.automations[]` — a triggered/sequenced run,
|
|
65
|
+
* exactly the shape `POST /api/packages`' `packageDefinitionSchema.automations`
|
|
66
|
+
* validates (`routes/packages.ts`). The `category` posted upstream must be a
|
|
67
|
+
* live `PACKAGE_TYPES` value, so we use "workflow" verbatim (never the retired
|
|
68
|
+
* "automation" alias, which the publish enum rejects).
|
|
69
|
+
*
|
|
70
|
+
* `capability` used to be excluded here with the comment "authored/seeded
|
|
71
|
+
* elsewhere, not as a lone file here". That was a statement about how WE happen
|
|
72
|
+
* to author them, not about what the CP accepts — and it left the most complex
|
|
73
|
+
* kind we have with no CLI door at all. The server half already exists, all of
|
|
74
|
+
* it, and NO CP migration is involved:
|
|
75
|
+
* • `capability` is a live `PACKAGE_TYPES` value (db/schema/packages.ts);
|
|
76
|
+
* • `packageDefinitionSchema` declares `capability: z.record(z.unknown())`
|
|
77
|
+
* (routes/packages.ts:824-832);
|
|
78
|
+
* • `publish-package-core.ts` stores a non-workspace definition AS-IS and
|
|
79
|
+
* hashes it into `definition.capability.contentHash`;
|
|
80
|
+
* • `GET /api/marketplace/capabilities` unwraps `definition.capability` into
|
|
81
|
+
* the card the pod's catalog sync caches (marketplace-apps.ts:398-410);
|
|
82
|
+
* • `market.install` resolves `kind: "capability"` BY KEY, cache row or not
|
|
83
|
+
* (marketplace-install.ts:263).
|
|
84
|
+
* So the whole loop — scaffold → validate → publish → install — closes.
|
|
85
|
+
*
|
|
86
|
+
* `skill` is a full member as of 2026-10-06: it has a CP payload slot, a
|
|
87
|
+
* scaffold arm, a validator arm, and a pod applier, so it scaffolds, validates,
|
|
88
|
+
* publishes and installs like the rest. (The old note here claimed it needed a
|
|
89
|
+
* CHECK-constraint migration "mirrored across ~24 files in 6 repos" — that was
|
|
90
|
+
* never true for `skill`: the category was ALREADY in `PACKAGE_TYPES` and in
|
|
91
|
+
* migration 0049's CHECK. What was missing was only the payload slot.)
|
|
92
|
+
*/
|
|
93
|
+
export declare const STANDALONE_KINDS: readonly ["view", "cell", "skill", "workflow", "capability"];
|
|
94
|
+
export type StandaloneKind = (typeof STANDALONE_KINDS)[number];
|
|
95
|
+
export interface StandalonePackageFile {
|
|
96
|
+
category: StandaloneKind;
|
|
97
|
+
slug: string;
|
|
98
|
+
displayName: string;
|
|
99
|
+
description?: string;
|
|
100
|
+
tags?: string[];
|
|
101
|
+
definition: PackageDefinitionLike;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* True when a parsed JSON/YAML top-level object declares a standalone
|
|
105
|
+
* (non-workspace) `category`. A `WorkspaceYaml` file never carries a
|
|
106
|
+
* top-level `category` key (it uses `meta`/`workspace`), so this is a safe,
|
|
107
|
+
* non-overlapping discriminator `marketPublish` can branch on.
|
|
108
|
+
*/
|
|
109
|
+
export declare function isStandalonePackageFile(parsed: unknown): parsed is {
|
|
110
|
+
category: string;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Read + parse a standalone package file (JSON or YAML — the same
|
|
114
|
+
* JSON-superset parser `parseTemplateFile` uses). Throws a friendly Error,
|
|
115
|
+
* never `process.exit`.
|
|
116
|
+
*/
|
|
117
|
+
export declare function parseStandalonePackageFile(filePath: string): StandalonePackageFile;
|
|
118
|
+
/**
|
|
119
|
+
* Minimal structural check BEFORE any network call — mirrors the fast
|
|
120
|
+
* author-feedback `marketValidate` gives workspace templates, scaled to what
|
|
121
|
+
* a standalone package actually needs: the `definition` must carry the array
|
|
122
|
+
* the CP's `packageDefinitionSchema` reads for that category. Returns an
|
|
123
|
+
* empty array when clean.
|
|
124
|
+
*/
|
|
125
|
+
export declare function validateStandalonePackage(pkg: StandalonePackageFile, opts?: {
|
|
126
|
+
baseDir?: string;
|
|
127
|
+
}): string[];
|
|
128
|
+
export interface ResolveCellCodeFilesResult {
|
|
129
|
+
definition: PackageDefinitionLike;
|
|
130
|
+
errors: string[];
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Inline every cell's `codeFile` into `code` — the field the CP schema
|
|
134
|
+
* actually validates (`cells[].code: z.string().min(1)`, no `codeFile` slot).
|
|
135
|
+
* A no-op for anything but a `cell` package, and for a cell entry that has no
|
|
136
|
+
* `codeFile` (plain inline `code` is untouched).
|
|
137
|
+
*
|
|
138
|
+
* `codeFile` is bundled through the SAME esbuild path `cell build` uses
|
|
139
|
+
* (`buildCellFromSource`), so publishing from source needs no separate manual
|
|
140
|
+
* build step. `bundleDeps` defaults to `true` here — see `market-authoring.ts`
|
|
141
|
+
* `marketPublishStandalone` for why the DEFAULT flips only on this door.
|
|
142
|
+
* Author-declared `deps` on the cell entry win over the derived map, mirroring
|
|
143
|
+
* `cell build --deps`'s own override semantics.
|
|
144
|
+
*
|
|
145
|
+
* A cell declaring `rendererType: "mcp-app"` is built `--self-contained`
|
|
146
|
+
* instead, whatever `bundleDeps` says: its `code` is the complete HTML document
|
|
147
|
+
* a foreign MCP-Apps host loads verbatim (React, CSS and brand fonts inlined),
|
|
148
|
+
* and its `deps` is `{}` — that host's CSP admits no esm.sh, so an author
|
|
149
|
+
* `deps` on such a cell is refused rather than shipped inert.
|
|
150
|
+
*/
|
|
151
|
+
export declare function resolveCellCodeFiles(pkg: StandalonePackageFile, baseDir: string, opts?: {
|
|
152
|
+
bundleDeps?: boolean;
|
|
153
|
+
}): Promise<ResolveCellCodeFilesResult>;
|
|
154
|
+
/**
|
|
155
|
+
* The kinds `market scaffold --kind <k>` can write. This is the SSOT for that
|
|
156
|
+
* flag's accepted values AND for its help string (`src/index.ts`) — the two had
|
|
157
|
+
* drifted: the help advertised `skill` (which scaffold refuses) and hid
|
|
158
|
+
* `workflow` (which `validateStandalonePackage` has always accepted), so the
|
|
159
|
+
* documented loop offered a dead option and concealed a working one.
|
|
160
|
+
*
|
|
161
|
+
* `skill` joined this list when the CP grew its standalone `skill` payload slot
|
|
162
|
+
* and the pod grew an applier for it — before that, scaffold refused it because
|
|
163
|
+
* there was no publishable shape to write. The barrier is gone; the refusal
|
|
164
|
+
* went with it. (`SCAFFOLDABLE_KINDS` is still what the help string is built
|
|
165
|
+
* from, so the two cannot drift again — see `scaffold-kind-help-parity.test.ts`.)
|
|
166
|
+
*/
|
|
167
|
+
export declare const SCAFFOLDABLE_KINDS: readonly ["cell", "view", "workflow", "capability", "skill"];
|
|
168
|
+
export type ScaffoldableKind = (typeof SCAFFOLDABLE_KINDS)[number];
|
|
169
|
+
/**
|
|
170
|
+
* Build the minimal standalone-package JSON `market scaffold --kind
|
|
171
|
+
* cell|view|workflow|capability` writes — the smallest file that passes
|
|
172
|
+
* {@link validateStandalonePackage}, for the author to edit in place.
|
|
173
|
+
*
|
|
174
|
+
* The bar is USABLE, not merely valid. Every arm below has at least one field
|
|
175
|
+
* whose OMISSION is not neutral — the cell's `contentKind`/`viewTypes`, the
|
|
176
|
+
* workflow's `status`/`triggerType`/two-node flow — because the appliers
|
|
177
|
+
* default a missing value to something inert and report success. A scaffold
|
|
178
|
+
* that writes a file which installs and then does nothing is the same defect
|
|
179
|
+
* as a validator that passes a flow which never fires.
|
|
180
|
+
*/
|
|
181
|
+
export declare function scaffoldStandalonePackageJson(kind: ScaffoldableKind, slug: string): string;
|