@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,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-DIRECTORY lens — the durable default scope for a working tree.
|
|
3
|
+
*
|
|
4
|
+
* RATIFIED MODEL: a directory's `.synap/lens.json` is where a lens normally
|
|
5
|
+
* lives; the per-Claude-session lens (`session-lens.ts`) is an explicit
|
|
6
|
+
* OVERRIDE on top of it.
|
|
7
|
+
*
|
|
8
|
+
* The session lens alone could not express "this repo is always Builder" — it
|
|
9
|
+
* dies with the tab, so every new session started pod-wide (or, worse, on
|
|
10
|
+
* whatever the global config happened to hold) and the operator re-pinned by
|
|
11
|
+
* hand. A directory lens is discovered the way git discovers `.git`: walk UP
|
|
12
|
+
* from the cwd until a `.synap/lens.json` turns up.
|
|
13
|
+
*
|
|
14
|
+
* Full precedence, highest first (assembled in `hub-client.ts`):
|
|
15
|
+
*
|
|
16
|
+
* explicit flag › session lens › DIRECTORY LENS › env var › global config
|
|
17
|
+
*
|
|
18
|
+
* ── Pod qualification ────────────────────────────────────────────────────────
|
|
19
|
+
* Workspace and project ids are POD-LOCAL: sending workspace W (pod A) to pod B
|
|
20
|
+
* is the "Access denied to workspace" 403. A directory lens is exposed to that
|
|
21
|
+
* hazard MORE than a session lens is, because it outlives many `synap pods use`
|
|
22
|
+
* switches. It therefore carries the same `podUrl` stamp and is compared
|
|
23
|
+
* through the SAME door — {@link lensMatchesPod} from `session-lens.ts`. There
|
|
24
|
+
* is deliberately no second comparison implementation here; a duplicated
|
|
25
|
+
* "is this the right pod" rule that drifts is the bug, not the fix.
|
|
26
|
+
*
|
|
27
|
+
* ── Write safety ─────────────────────────────────────────────────────────────
|
|
28
|
+
* Writes never escape the user's own tree: the target is either an EXISTING
|
|
29
|
+
* lens found on the upward walk (only when it sits at or below the home dir) or
|
|
30
|
+
* the cwd itself. A lens is never created in an ancestor, never above the home
|
|
31
|
+
* dir, and never at the filesystem root.
|
|
32
|
+
*/
|
|
33
|
+
import { type SessionLens } from "./session-lens.js";
|
|
34
|
+
/** A directory lens is the same shape as a session lens — same fields, different lifetime. */
|
|
35
|
+
export type DirectoryLens = SessionLens;
|
|
36
|
+
export interface FoundDirectoryLens {
|
|
37
|
+
lens: DirectoryLens;
|
|
38
|
+
/** Absolute path to the `.synap/lens.json` that supplied it — shown by `synap lens`. */
|
|
39
|
+
file: string;
|
|
40
|
+
/** The directory that owns it (the one containing `.synap/`). */
|
|
41
|
+
dir: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Every directory to consider, nearest first: the cwd, then each ancestor.
|
|
45
|
+
* The walk STOPS after the home dir (a lens above `~` would apply to every
|
|
46
|
+
* unrelated project on the machine) and at the filesystem root.
|
|
47
|
+
*/
|
|
48
|
+
export declare function lensSearchPath(startDir?: string): string[];
|
|
49
|
+
/**
|
|
50
|
+
* The nearest directory lens at or above `startDir`, ignoring pod qualification.
|
|
51
|
+
* Callers that are about to SEND ids must use {@link resolveDirectoryLensForPod}.
|
|
52
|
+
*/
|
|
53
|
+
export declare function findDirectoryLens(startDir?: string): FoundDirectoryLens | null;
|
|
54
|
+
/**
|
|
55
|
+
* The nearest directory lens, but ONLY if it belongs to `podUrl`.
|
|
56
|
+
*
|
|
57
|
+
* A lens stamped with a different pod returns null so the caller falls through
|
|
58
|
+
* to the next rung (env var, then the pod-qualified global config) instead of
|
|
59
|
+
* sending a foreign workspace id. Comparison is delegated to `lensMatchesPod`
|
|
60
|
+
* — including its deliberate leniency for lenses written before the `podUrl`
|
|
61
|
+
* stamp existed.
|
|
62
|
+
*/
|
|
63
|
+
export declare function resolveDirectoryLensForPod(podUrl: string | undefined, startDir?: string): FoundDirectoryLens | null;
|
|
64
|
+
/**
|
|
65
|
+
* The fields of a directory lens that are in force for THIS process.
|
|
66
|
+
*
|
|
67
|
+
* Workspace and project are the tree's durable scope and always apply. The
|
|
68
|
+
* focus SESSION does not, inside a Claude Code conversation: a session is the
|
|
69
|
+
* conversation's own, and `attachActiveSessionId` writes it to the session lens
|
|
70
|
+
* there for exactly that reason. Read through, a directory-lens session —
|
|
71
|
+
* attached from a plain terminal, or migrated from a `.synap-session` — was
|
|
72
|
+
* sent as `X-Session-Id` by every conversation opened in the tree, long after
|
|
73
|
+
* it went quiet, so each one's writes were filed into that old session (and a
|
|
74
|
+
* stale one was revived by them). Outside Claude Code there is no conversation
|
|
75
|
+
* to own a session, so the directory lens still carries it.
|
|
76
|
+
*/
|
|
77
|
+
export declare function effectiveDirectoryLens(lens: DirectoryLens): DirectoryLens;
|
|
78
|
+
/**
|
|
79
|
+
* Where would a write land? An existing lens on the upward walk wins (so
|
|
80
|
+
* `synap use` from a subdirectory re-pins the repo's lens rather than seeding a
|
|
81
|
+
* nested one), but only when that lens sits at or below the home dir. Otherwise
|
|
82
|
+
* the cwd — a lens is never CREATED in an ancestor.
|
|
83
|
+
*/
|
|
84
|
+
export declare function directoryLensWriteTarget(startDir?: string): string;
|
|
85
|
+
/**
|
|
86
|
+
* Merge-write the directory lens. Returns the file it wrote, so the caller can
|
|
87
|
+
* TELL the user which path now owns their scope — a silently-resolved lens is
|
|
88
|
+
* exactly what produced the 403 class this module exists to make legible.
|
|
89
|
+
*/
|
|
90
|
+
export declare function writeDirectoryLens(patch: Partial<DirectoryLens>, startDir?: string): {
|
|
91
|
+
lens: DirectoryLens;
|
|
92
|
+
file: string;
|
|
93
|
+
dir: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Clear one field (or the whole lens) from the nearest directory lens.
|
|
97
|
+
* Returns the file touched, or null when there was nothing to clear.
|
|
98
|
+
*/
|
|
99
|
+
export declare function clearDirectoryLensField(field?: keyof DirectoryLens, startDir?: string): string | null;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-DIRECTORY lens — the durable default scope for a working tree.
|
|
3
|
+
*
|
|
4
|
+
* RATIFIED MODEL: a directory's `.synap/lens.json` is where a lens normally
|
|
5
|
+
* lives; the per-Claude-session lens (`session-lens.ts`) is an explicit
|
|
6
|
+
* OVERRIDE on top of it.
|
|
7
|
+
*
|
|
8
|
+
* The session lens alone could not express "this repo is always Builder" — it
|
|
9
|
+
* dies with the tab, so every new session started pod-wide (or, worse, on
|
|
10
|
+
* whatever the global config happened to hold) and the operator re-pinned by
|
|
11
|
+
* hand. A directory lens is discovered the way git discovers `.git`: walk UP
|
|
12
|
+
* from the cwd until a `.synap/lens.json` turns up.
|
|
13
|
+
*
|
|
14
|
+
* Full precedence, highest first (assembled in `hub-client.ts`):
|
|
15
|
+
*
|
|
16
|
+
* explicit flag › session lens › DIRECTORY LENS › env var › global config
|
|
17
|
+
*
|
|
18
|
+
* ── Pod qualification ────────────────────────────────────────────────────────
|
|
19
|
+
* Workspace and project ids are POD-LOCAL: sending workspace W (pod A) to pod B
|
|
20
|
+
* is the "Access denied to workspace" 403. A directory lens is exposed to that
|
|
21
|
+
* hazard MORE than a session lens is, because it outlives many `synap pods use`
|
|
22
|
+
* switches. It therefore carries the same `podUrl` stamp and is compared
|
|
23
|
+
* through the SAME door — {@link lensMatchesPod} from `session-lens.ts`. There
|
|
24
|
+
* is deliberately no second comparison implementation here; a duplicated
|
|
25
|
+
* "is this the right pod" rule that drifts is the bug, not the fix.
|
|
26
|
+
*
|
|
27
|
+
* ── Write safety ─────────────────────────────────────────────────────────────
|
|
28
|
+
* Writes never escape the user's own tree: the target is either an EXISTING
|
|
29
|
+
* lens found on the upward walk (only when it sits at or below the home dir) or
|
|
30
|
+
* the cwd itself. A lens is never created in an ancestor, never above the home
|
|
31
|
+
* dir, and never at the filesystem root.
|
|
32
|
+
*/
|
|
33
|
+
import fs from "node:fs";
|
|
34
|
+
import os from "node:os";
|
|
35
|
+
import path from "node:path";
|
|
36
|
+
import { getClaudeSessionId, lensMatchesPod } from "./session-lens.js";
|
|
37
|
+
import { writeSecretFile } from "./atomic-file.js";
|
|
38
|
+
/** The directory name a lens lives in, and the file inside it. */
|
|
39
|
+
const LENS_DIR_NAME = ".synap";
|
|
40
|
+
const LENS_FILE_NAME = "lens.json";
|
|
41
|
+
function lensFileIn(dir) {
|
|
42
|
+
return path.join(dir, LENS_DIR_NAME, LENS_FILE_NAME);
|
|
43
|
+
}
|
|
44
|
+
/** Is `dir` the home dir or inside it? Used to bound where a lens may be WRITTEN. */
|
|
45
|
+
function isAtOrBelowHome(dir) {
|
|
46
|
+
const home = path.resolve(os.homedir());
|
|
47
|
+
const target = path.resolve(dir);
|
|
48
|
+
if (target === home)
|
|
49
|
+
return true;
|
|
50
|
+
return target.startsWith(home + path.sep);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Every directory to consider, nearest first: the cwd, then each ancestor.
|
|
54
|
+
* The walk STOPS after the home dir (a lens above `~` would apply to every
|
|
55
|
+
* unrelated project on the machine) and at the filesystem root.
|
|
56
|
+
*/
|
|
57
|
+
export function lensSearchPath(startDir = process.cwd()) {
|
|
58
|
+
const home = path.resolve(os.homedir());
|
|
59
|
+
const dirs = [];
|
|
60
|
+
let dir = path.resolve(startDir);
|
|
61
|
+
for (;;) {
|
|
62
|
+
dirs.push(dir);
|
|
63
|
+
if (dir === home)
|
|
64
|
+
break;
|
|
65
|
+
const parent = path.dirname(dir);
|
|
66
|
+
if (parent === dir)
|
|
67
|
+
break; // filesystem root
|
|
68
|
+
dir = parent;
|
|
69
|
+
}
|
|
70
|
+
return dirs;
|
|
71
|
+
}
|
|
72
|
+
/** Read + parse one candidate, or null when absent/corrupt. A malformed lens must not crash the CLI. */
|
|
73
|
+
function readLensFile(dir) {
|
|
74
|
+
const file = lensFileIn(dir);
|
|
75
|
+
try {
|
|
76
|
+
const parsed = JSON.parse(fs.readFileSync(file, "utf-8"));
|
|
77
|
+
if (!parsed || typeof parsed !== "object")
|
|
78
|
+
return null;
|
|
79
|
+
return { lens: parsed, file, dir };
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The nearest directory lens at or above `startDir`, ignoring pod qualification.
|
|
87
|
+
* Callers that are about to SEND ids must use {@link resolveDirectoryLensForPod}.
|
|
88
|
+
*/
|
|
89
|
+
export function findDirectoryLens(startDir) {
|
|
90
|
+
for (const dir of lensSearchPath(startDir)) {
|
|
91
|
+
const found = readLensFile(dir);
|
|
92
|
+
if (found)
|
|
93
|
+
return found;
|
|
94
|
+
}
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The nearest directory lens, but ONLY if it belongs to `podUrl`.
|
|
99
|
+
*
|
|
100
|
+
* A lens stamped with a different pod returns null so the caller falls through
|
|
101
|
+
* to the next rung (env var, then the pod-qualified global config) instead of
|
|
102
|
+
* sending a foreign workspace id. Comparison is delegated to `lensMatchesPod`
|
|
103
|
+
* — including its deliberate leniency for lenses written before the `podUrl`
|
|
104
|
+
* stamp existed.
|
|
105
|
+
*/
|
|
106
|
+
export function resolveDirectoryLensForPod(podUrl, startDir) {
|
|
107
|
+
const found = findDirectoryLens(startDir);
|
|
108
|
+
if (!found)
|
|
109
|
+
return null;
|
|
110
|
+
return lensMatchesPod(found.lens, podUrl) ? found : null;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The fields of a directory lens that are in force for THIS process.
|
|
114
|
+
*
|
|
115
|
+
* Workspace and project are the tree's durable scope and always apply. The
|
|
116
|
+
* focus SESSION does not, inside a Claude Code conversation: a session is the
|
|
117
|
+
* conversation's own, and `attachActiveSessionId` writes it to the session lens
|
|
118
|
+
* there for exactly that reason. Read through, a directory-lens session —
|
|
119
|
+
* attached from a plain terminal, or migrated from a `.synap-session` — was
|
|
120
|
+
* sent as `X-Session-Id` by every conversation opened in the tree, long after
|
|
121
|
+
* it went quiet, so each one's writes were filed into that old session (and a
|
|
122
|
+
* stale one was revived by them). Outside Claude Code there is no conversation
|
|
123
|
+
* to own a session, so the directory lens still carries it.
|
|
124
|
+
*/
|
|
125
|
+
export function effectiveDirectoryLens(lens) {
|
|
126
|
+
if (!getClaudeSessionId())
|
|
127
|
+
return lens;
|
|
128
|
+
const { focusSessionId: _conversationOwned, ...scope } = lens;
|
|
129
|
+
return scope;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Where would a write land? An existing lens on the upward walk wins (so
|
|
133
|
+
* `synap use` from a subdirectory re-pins the repo's lens rather than seeding a
|
|
134
|
+
* nested one), but only when that lens sits at or below the home dir. Otherwise
|
|
135
|
+
* the cwd — a lens is never CREATED in an ancestor.
|
|
136
|
+
*/
|
|
137
|
+
export function directoryLensWriteTarget(startDir = process.cwd()) {
|
|
138
|
+
const found = findDirectoryLens(startDir);
|
|
139
|
+
if (found && isAtOrBelowHome(found.dir))
|
|
140
|
+
return found.dir;
|
|
141
|
+
return path.resolve(startDir);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Merge-write the directory lens. Returns the file it wrote, so the caller can
|
|
145
|
+
* TELL the user which path now owns their scope — a silently-resolved lens is
|
|
146
|
+
* exactly what produced the 403 class this module exists to make legible.
|
|
147
|
+
*/
|
|
148
|
+
export function writeDirectoryLens(patch, startDir) {
|
|
149
|
+
const dir = directoryLensWriteTarget(startDir);
|
|
150
|
+
const prev = readLensFile(dir)?.lens ?? {};
|
|
151
|
+
const next = { ...prev, ...patch, updatedAt: Date.now() };
|
|
152
|
+
const file = lensFileIn(dir);
|
|
153
|
+
fs.mkdirSync(path.dirname(file), { recursive: true, mode: 0o700 });
|
|
154
|
+
writeSecretFile(file, JSON.stringify(next, null, 2) + "\n", { mode: 0o600 });
|
|
155
|
+
return { lens: next, file, dir };
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Clear one field (or the whole lens) from the nearest directory lens.
|
|
159
|
+
* Returns the file touched, or null when there was nothing to clear.
|
|
160
|
+
*/
|
|
161
|
+
export function clearDirectoryLensField(field, startDir) {
|
|
162
|
+
const found = findDirectoryLens(startDir);
|
|
163
|
+
if (!found)
|
|
164
|
+
return null;
|
|
165
|
+
if (!field) {
|
|
166
|
+
try {
|
|
167
|
+
fs.unlinkSync(found.file);
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
return found.file;
|
|
173
|
+
}
|
|
174
|
+
if (!(field in found.lens))
|
|
175
|
+
return null;
|
|
176
|
+
const next = { ...found.lens };
|
|
177
|
+
delete next[field];
|
|
178
|
+
next.updatedAt = Date.now();
|
|
179
|
+
try {
|
|
180
|
+
writeSecretFile(found.file, JSON.stringify(next, null, 2) + "\n", { mode: 0o600 });
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
return found.file;
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=directory-lens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directory-lens.js","sourceRoot":"","sources":["../../src/lib/directory-lens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAoB,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,kEAAkE;AAClE,MAAM,aAAa,GAAG,QAAQ,CAAC;AAC/B,MAAM,cAAc,GAAG,WAAW,CAAC;AAanC,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,IAAI,CAAC,IAAI,CAAC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AC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,MAAM,IAAI,GAAG,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;IACnB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACrF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `--from-workspace` / `--from-project` do NOT carry out of a live pod.
|
|
3
|
+
* ==========================================================================
|
|
4
|
+
*
|
|
5
|
+
* `synap market publish --from-workspace <id>` serialises a LIVE workspace
|
|
6
|
+
* through the pod's `workspaceToPackageDefinition`
|
|
7
|
+
* (synap-backend/packages/api/src/services/workspace-to-package-definition.ts)
|
|
8
|
+
* and posts the result. `--from-project` walks the same serialiser for every
|
|
9
|
+
* workspace a project `uses`, then composes a suite — so the same drop-list
|
|
10
|
+
* applies to each constituent. That serialiser is a **lossy projection**: it
|
|
11
|
+
* emits 21 of `packageDefinitionSchema`'s keys and has no projection at all
|
|
12
|
+
* for the ones below. A workspace carrying them exports WITHOUT them — no
|
|
13
|
+
* error, no signal.
|
|
14
|
+
*
|
|
15
|
+
* Loops stay here deliberately: there is no durable loop row to reverse-
|
|
16
|
+
* serialise (`createLoopFromDefinition` dissolves into playbooks + triggers).
|
|
17
|
+
*
|
|
18
|
+
* `TEMPLATE-DEV-GUIDE.md` used to assert, unqualified, that a
|
|
19
|
+
* `PackageDefinition` "round-trips". It does not, in this direction, and the
|
|
20
|
+
* consequence is the shape this repo keeps paying for: an author who built one
|
|
21
|
+
* of the things below publishes their workspace, ships a thinner-than-expected
|
|
22
|
+
* package, and gets a success message. Same class as `status ?? "installed"` —
|
|
23
|
+
* a claim of completeness nobody verified. (Cards authored in Card Studio USED
|
|
24
|
+
* to be one of these — `workspaceToPackageDefinition` now emits them into
|
|
25
|
+
* `cells[]`, so that loss is fixed; the list below is what remains.)
|
|
26
|
+
*
|
|
27
|
+
* ── WHY THIS LIST IS UNCONDITIONAL, NOT DETECTED ────────────────────────────
|
|
28
|
+
* The CLI never sees the workspace, only the projection's OUTPUT. "key absent
|
|
29
|
+
* because the workspace had none" and "key absent because the serialiser cannot
|
|
30
|
+
* emit it" are indistinguishable from here, and reporting a count would be
|
|
31
|
+
* inventing a fact. So this warns about the DOOR ("this door does not carry
|
|
32
|
+
* these"), which is true on every call, rather than about the payload.
|
|
33
|
+
*
|
|
34
|
+
* Keeping it honest across the repo boundary is
|
|
35
|
+
* `test/exporter-coverage-parity.test.ts`, which reads the exporter's own
|
|
36
|
+
* source and fails if a key listed here has gained an assignment (the list is
|
|
37
|
+
* stale and over-warns) or if a key it claims to emit has lost one.
|
|
38
|
+
*/
|
|
39
|
+
/** A `packageDefinitionSchema` key the workspace serialiser cannot emit. */
|
|
40
|
+
export interface UnemittedKey {
|
|
41
|
+
/** The `PackageDefinition` key, verbatim. */
|
|
42
|
+
key: string;
|
|
43
|
+
/** What an author actually loses, in product words (Card, not cell). */
|
|
44
|
+
loses: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Keys with real user-authored content behind them that the serialiser drops.
|
|
48
|
+
*
|
|
49
|
+
* DELIBERATELY EXCLUDED, and why — these are absent from the export too, but
|
|
50
|
+
* warning about them would be noise rather than a loss:
|
|
51
|
+
* • `icon` / `color` / `domain` / `workspaceType` — a live workspace has no
|
|
52
|
+
* field to read them from (the exporter says so at L107-109). Honest
|
|
53
|
+
* under-convergence, not a silent drop.
|
|
54
|
+
* • `suggestedEntities` / `suggestedRelations` / `phases` / `composesFrom` —
|
|
55
|
+
* authoring-time seed hints and composition metadata. A live workspace has
|
|
56
|
+
* real entities, not "suggestions"; there is nothing to derive them from.
|
|
57
|
+
* • `capability` / `sourcePackage` / `contentHash` — a non-workspace package
|
|
58
|
+
* body and publish-time provenance. Not this door's business.
|
|
59
|
+
*/
|
|
60
|
+
export declare const EXPORTER_UNEMITTED_KEYS: readonly UnemittedKey[];
|
|
61
|
+
/**
|
|
62
|
+
* The keys the serialiser DOES emit. Not consumed at runtime — it is the other
|
|
63
|
+
* half of the parity tripwire's assertion, so that "emits" and "does not emit"
|
|
64
|
+
* are pinned by the same read of the same source and cannot disagree.
|
|
65
|
+
*/
|
|
66
|
+
export declare const EXPORTER_EMITTED_KEYS: readonly string[];
|
|
67
|
+
/**
|
|
68
|
+
* One human line per dropped key, for `--json`'s `warnings[]` and for the
|
|
69
|
+
* terminal hint list. Deliberately phrased as a property of the DOOR.
|
|
70
|
+
*/
|
|
71
|
+
export declare function exporterDropWarnings(): string[];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `--from-workspace` / `--from-project` do NOT carry out of a live pod.
|
|
3
|
+
* ==========================================================================
|
|
4
|
+
*
|
|
5
|
+
* `synap market publish --from-workspace <id>` serialises a LIVE workspace
|
|
6
|
+
* through the pod's `workspaceToPackageDefinition`
|
|
7
|
+
* (synap-backend/packages/api/src/services/workspace-to-package-definition.ts)
|
|
8
|
+
* and posts the result. `--from-project` walks the same serialiser for every
|
|
9
|
+
* workspace a project `uses`, then composes a suite — so the same drop-list
|
|
10
|
+
* applies to each constituent. That serialiser is a **lossy projection**: it
|
|
11
|
+
* emits 21 of `packageDefinitionSchema`'s keys and has no projection at all
|
|
12
|
+
* for the ones below. A workspace carrying them exports WITHOUT them — no
|
|
13
|
+
* error, no signal.
|
|
14
|
+
*
|
|
15
|
+
* Loops stay here deliberately: there is no durable loop row to reverse-
|
|
16
|
+
* serialise (`createLoopFromDefinition` dissolves into playbooks + triggers).
|
|
17
|
+
*
|
|
18
|
+
* `TEMPLATE-DEV-GUIDE.md` used to assert, unqualified, that a
|
|
19
|
+
* `PackageDefinition` "round-trips". It does not, in this direction, and the
|
|
20
|
+
* consequence is the shape this repo keeps paying for: an author who built one
|
|
21
|
+
* of the things below publishes their workspace, ships a thinner-than-expected
|
|
22
|
+
* package, and gets a success message. Same class as `status ?? "installed"` —
|
|
23
|
+
* a claim of completeness nobody verified. (Cards authored in Card Studio USED
|
|
24
|
+
* to be one of these — `workspaceToPackageDefinition` now emits them into
|
|
25
|
+
* `cells[]`, so that loss is fixed; the list below is what remains.)
|
|
26
|
+
*
|
|
27
|
+
* ── WHY THIS LIST IS UNCONDITIONAL, NOT DETECTED ────────────────────────────
|
|
28
|
+
* The CLI never sees the workspace, only the projection's OUTPUT. "key absent
|
|
29
|
+
* because the workspace had none" and "key absent because the serialiser cannot
|
|
30
|
+
* emit it" are indistinguishable from here, and reporting a count would be
|
|
31
|
+
* inventing a fact. So this warns about the DOOR ("this door does not carry
|
|
32
|
+
* these"), which is true on every call, rather than about the payload.
|
|
33
|
+
*
|
|
34
|
+
* Keeping it honest across the repo boundary is
|
|
35
|
+
* `test/exporter-coverage-parity.test.ts`, which reads the exporter's own
|
|
36
|
+
* source and fails if a key listed here has gained an assignment (the list is
|
|
37
|
+
* stale and over-warns) or if a key it claims to emit has lost one.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Keys with real user-authored content behind them that the serialiser drops.
|
|
41
|
+
*
|
|
42
|
+
* DELIBERATELY EXCLUDED, and why — these are absent from the export too, but
|
|
43
|
+
* warning about them would be noise rather than a loss:
|
|
44
|
+
* • `icon` / `color` / `domain` / `workspaceType` — a live workspace has no
|
|
45
|
+
* field to read them from (the exporter says so at L107-109). Honest
|
|
46
|
+
* under-convergence, not a silent drop.
|
|
47
|
+
* • `suggestedEntities` / `suggestedRelations` / `phases` / `composesFrom` —
|
|
48
|
+
* authoring-time seed hints and composition metadata. A live workspace has
|
|
49
|
+
* real entities, not "suggestions"; there is nothing to derive them from.
|
|
50
|
+
* • `capability` / `sourcePackage` / `contentHash` — a non-workspace package
|
|
51
|
+
* body and publish-time provenance. Not this door's business.
|
|
52
|
+
*/
|
|
53
|
+
export const EXPORTER_UNEMITTED_KEYS = [
|
|
54
|
+
{ key: "commands", loses: "workspace commands" },
|
|
55
|
+
{ key: "relationDefs", loses: "relation definitions" },
|
|
56
|
+
{ key: "loops", loses: "loops" },
|
|
57
|
+
{ key: "widgets", loses: "widget definitions" },
|
|
58
|
+
{ key: "dependencies", loses: "declared package dependencies" },
|
|
59
|
+
{ key: "defaultSources", loses: "declared workspace sources" },
|
|
60
|
+
{ key: "sourceRoles", loses: "source roles" },
|
|
61
|
+
];
|
|
62
|
+
/**
|
|
63
|
+
* The keys the serialiser DOES emit. Not consumed at runtime — it is the other
|
|
64
|
+
* half of the parity tripwire's assertion, so that "emits" and "does not emit"
|
|
65
|
+
* are pinned by the same read of the same source and cannot disagree.
|
|
66
|
+
*/
|
|
67
|
+
export const EXPORTER_EMITTED_KEYS = [
|
|
68
|
+
"_meta",
|
|
69
|
+
"workspaceName",
|
|
70
|
+
"description",
|
|
71
|
+
"workspaceSubtype",
|
|
72
|
+
"workspaceVisibility",
|
|
73
|
+
"workspaceCapabilities",
|
|
74
|
+
"onboarding",
|
|
75
|
+
"profileEntityBentoTemplates",
|
|
76
|
+
"profiles",
|
|
77
|
+
"bentoLayout",
|
|
78
|
+
"bentoViewBlocks",
|
|
79
|
+
"bentoViewName",
|
|
80
|
+
"views",
|
|
81
|
+
"entityLinks",
|
|
82
|
+
"displayTemplates",
|
|
83
|
+
"automations",
|
|
84
|
+
"playbooks",
|
|
85
|
+
"capabilities",
|
|
86
|
+
"layoutConfig",
|
|
87
|
+
"actionPlacements",
|
|
88
|
+
"cells",
|
|
89
|
+
];
|
|
90
|
+
/**
|
|
91
|
+
* One human line per dropped key, for `--json`'s `warnings[]` and for the
|
|
92
|
+
* terminal hint list. Deliberately phrased as a property of the DOOR.
|
|
93
|
+
*/
|
|
94
|
+
export function exporterDropWarnings() {
|
|
95
|
+
return EXPORTER_UNEMITTED_KEYS.map((k) => `${k.key} — ${k.loses} (not exported: no projection)`);
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=exporter-coverage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exporter-coverage.js","sourceRoot":"","sources":["../../src/lib/exporter-coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAUH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA4B;IAC9D,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,oBAAoB,EAAE;IAChD,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,sBAAsB,EAAE;IACtD,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAChC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,oBAAoB,EAAE;IAC/C,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,+BAA+B,EAAE;IAC/D,EAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,4BAA4B,EAAE;IAC9D,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE;CAC9C,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACtD,OAAO;IACP,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,qBAAqB;IACrB,uBAAuB;IACvB,YAAY;IACZ,6BAA6B;IAC7B,UAAU;IACV,aAAa;IACb,iBAAiB;IACjB,eAAe;IACf,OAAO;IACP,aAAa;IACb,kBAAkB;IAClB,aAAa;IACb,WAAW;IACX,cAAc;IACd,cAAc;IACd,kBAAkB;IAClB,OAAO;CACR,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,uBAAuB,CAAC,GAAG,CAChC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,gCAAgC,CAC7D,CAAC;AACJ,CAAC"}
|
package/dist/lib/hub-client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HubRestClient } from "@synap/hub-rest-client";
|
|
1
|
+
import { HubRestClient } from "@synap-core/hub-rest-client";
|
|
2
2
|
/**
|
|
3
3
|
* A failed Hub call, carrying the structured facts callers need to branch on.
|
|
4
4
|
*
|
|
@@ -16,6 +16,10 @@ export declare class HubError extends Error {
|
|
|
16
16
|
readonly rawBody: string;
|
|
17
17
|
readonly path: string;
|
|
18
18
|
readonly method: string;
|
|
19
|
+
/** Origin of the pod this call actually hit — for cross-pod diagnostics. */
|
|
20
|
+
readonly podUrl?: string;
|
|
21
|
+
/** Workspace this call actually sent — for cross-pod 403 diagnostics. */
|
|
22
|
+
readonly workspaceId?: string;
|
|
19
23
|
constructor(init: {
|
|
20
24
|
message: string;
|
|
21
25
|
status: number;
|
|
@@ -25,6 +29,8 @@ export declare class HubError extends Error {
|
|
|
25
29
|
rawBody: string;
|
|
26
30
|
path: string;
|
|
27
31
|
method: string;
|
|
32
|
+
podUrl?: string;
|
|
33
|
+
workspaceId?: string;
|
|
28
34
|
});
|
|
29
35
|
}
|
|
30
36
|
/**
|
|
@@ -53,11 +59,18 @@ export declare class HubNetworkError extends Error {
|
|
|
53
59
|
cause?: unknown;
|
|
54
60
|
});
|
|
55
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Append a one-line "need help?" footer with a clickable Discord invite. Prints
|
|
64
|
+
* to stderr (same stream as the error it follows, so `2>/dev/null` hides both)
|
|
65
|
+
* and only once per process. The invite is an OSC-8 hyperlink on an interactive
|
|
66
|
+
* terminal, a plain URL when the stream is redirected/piped.
|
|
67
|
+
*/
|
|
68
|
+
export declare function discordHelpLine(): void;
|
|
56
69
|
/**
|
|
57
70
|
* Print a failed Hub call: its humanized message plus a hint for the classes
|
|
58
71
|
* where the cause is not obvious from the message alone. Lives here rather than
|
|
59
72
|
* in utils/logger so the logger stays domain-agnostic and the taxonomy and its
|
|
60
|
-
* presentation sit in one file.
|
|
73
|
+
* presentation sit in one file. Always closes with the one-time Discord footer.
|
|
61
74
|
*/
|
|
62
75
|
export declare function renderHubError(err: unknown): void;
|
|
63
76
|
export interface HubConfig {
|
|
@@ -76,12 +89,33 @@ export declare function resolveHubConfig(opts?: {
|
|
|
76
89
|
podUrl?: string;
|
|
77
90
|
apiKey?: string;
|
|
78
91
|
}): Promise<HubConfig>;
|
|
79
|
-
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
92
|
+
/**
|
|
93
|
+
* The focus session every hub call should be tagged with.
|
|
94
|
+
*
|
|
95
|
+
* Both lens rungs are pod-qualified: a focus-session id is POD-LOCAL, so a lens
|
|
96
|
+
* stamped with another pod must not leak into `X-Session-Id`. (Lenses written
|
|
97
|
+
* before the stamp existed have no `podUrl` and match leniently — see
|
|
98
|
+
* `lensMatchesPod`.)
|
|
99
|
+
*/
|
|
100
|
+
export declare function resolveActiveSessionId(podUrl?: string): string | undefined;
|
|
101
|
+
/** Where an attach landed — reported so the user knows what owns their scope. */
|
|
102
|
+
export type SessionAttachTarget = "session-lens" | "directory-lens";
|
|
103
|
+
/**
|
|
104
|
+
* Attach a focus session to this terminal.
|
|
105
|
+
*
|
|
106
|
+
* Inside Claude Code the SESSION lens wins — per-tab isolation is the point
|
|
107
|
+
* (tab A on session X, tab B on session Y, same directory). Outside it there is
|
|
108
|
+
* no `CLAUDE_CODE_SESSION_ID` to key on, so the DIRECTORY lens is the
|
|
109
|
+
* legitimate fallback: the same per-working-tree scope the retired
|
|
110
|
+
* `.synap-session` had. `attach` therefore never silently no-ops.
|
|
111
|
+
*/
|
|
112
|
+
export declare function attachActiveSessionId(sessionId: string): SessionAttachTarget;
|
|
113
|
+
/**
|
|
114
|
+
* Detach — clear the focus session from BOTH lens rungs, and return whatever
|
|
115
|
+
* was active. Clearing only the top rung would "detach" into the lower one,
|
|
116
|
+
* which reads as the command failing.
|
|
117
|
+
*/
|
|
118
|
+
export declare function detachActiveSessionId(podUrl?: string): string | undefined;
|
|
85
119
|
export declare function hubGet(path: string, params: Record<string, string | number | undefined>, cfg: HubConfig): Promise<unknown>;
|
|
86
120
|
export declare function hubPost(path: string, body: unknown, cfg: HubConfig, timeoutMs?: number): Promise<unknown>;
|
|
87
121
|
/**
|
|
@@ -105,4 +139,4 @@ export declare function hubDelete(path: string, cfg: HubConfig): Promise<unknown
|
|
|
105
139
|
* Hub Protocol coverage with a shared client contract — eliminating drift.
|
|
106
140
|
*/
|
|
107
141
|
export declare function makeHubClient(cfg: HubConfig): HubRestClient;
|
|
108
|
-
export { HubRestClient } from "@synap/hub-rest-client";
|
|
142
|
+
export { HubRestClient } from "@synap-core/hub-rest-client";
|