@jinn-network/client 0.1.2 → 0.1.3-canary.262e5cda
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/CHANGELOG.md +20 -0
- package/CONTRIBUTING.md +8 -2
- package/README.md +38 -14
- package/deployments/deployment-jinn-mvi-l1-sepolia-fast.json +36 -0
- package/deployments/deployment-jinn-mvi-l1-sepolia.json +36 -0
- package/deployments/deployment-jinn-mvi-l2-baseSepolia.json +12 -0
- package/deployments/deployment-phase1b-mech-baseSepolia-fast.json +3 -3
- package/deployments/deployment-stolas-l2-baseSepolia-fast.json +1 -1
- package/dist/adapters/adapter.d.ts +2 -2
- package/dist/adapters/claim-registry/client.d.ts +9 -0
- package/dist/adapters/claim-registry/client.js +22 -2
- package/dist/adapters/claim-registry/client.js.map +1 -1
- package/dist/adapters/local/adapter.d.ts +2 -2
- package/dist/adapters/local/adapter.js +8 -8
- package/dist/adapters/local/adapter.js.map +1 -1
- package/dist/adapters/mech/adapter.d.ts +3 -4
- package/dist/adapters/mech/adapter.js +86 -50
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +6 -4
- package/dist/adapters/mech/contracts.js +118 -14
- package/dist/adapters/mech/contracts.js.map +1 -1
- package/dist/adapters/mech/ipfs.d.ts +61 -6
- package/dist/adapters/mech/ipfs.js +159 -26
- package/dist/adapters/mech/ipfs.js.map +1 -1
- package/dist/adapters/mech/safe-revert.d.ts +39 -0
- package/dist/adapters/mech/safe-revert.js +130 -0
- package/dist/adapters/mech/safe-revert.js.map +1 -0
- package/dist/adapters/mech/safe.js +47 -21
- package/dist/adapters/mech/safe.js.map +1 -1
- package/dist/adapters/mech/types.d.ts +8 -0
- package/dist/adapters/mech/types.js.map +1 -1
- package/dist/agent/agent-ws.d.ts +55 -0
- package/dist/agent/agent-ws.js +288 -0
- package/dist/agent/agent-ws.js.map +1 -0
- package/dist/agent/auto-mode-detect.d.ts +6 -0
- package/dist/agent/auto-mode-detect.js +44 -0
- package/dist/agent/auto-mode-detect.js.map +1 -0
- package/dist/agent/operator-claude.d.ts +22 -0
- package/dist/agent/operator-claude.js +130 -0
- package/dist/agent/operator-claude.js.map +1 -0
- package/dist/api/admin-endpoint.d.ts +12 -0
- package/dist/api/admin-endpoint.js +71 -0
- package/dist/api/admin-endpoint.js.map +1 -0
- package/dist/api/bootstrap-endpoint.d.ts +16 -0
- package/dist/api/bootstrap-endpoint.js +78 -0
- package/dist/api/bootstrap-endpoint.js.map +1 -0
- package/dist/api/events-endpoint.d.ts +9 -0
- package/dist/api/events-endpoint.js +46 -0
- package/dist/api/events-endpoint.js.map +1 -0
- package/dist/api/fleet-build.d.ts +1 -1
- package/dist/api/fleet-build.js +17 -8
- package/dist/api/fleet-build.js.map +1 -1
- package/dist/api/gather-status.js +5 -1
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/handshake.d.ts +17 -0
- package/dist/api/handshake.js +28 -0
- package/dist/api/handshake.js.map +1 -0
- package/dist/api/peers.js +20 -5
- package/dist/api/peers.js.map +1 -1
- package/dist/api/portfolio-v0-build.d.ts +6 -0
- package/dist/api/portfolio-v0-build.js +6 -1
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/rewards-build.js +3 -8
- package/dist/api/rewards-build.js.map +1 -1
- package/dist/api/server.d.ts +54 -0
- package/dist/api/server.js +239 -13
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.d.ts +34 -0
- package/dist/api/setup-endpoints.js +188 -0
- package/dist/api/setup-endpoints.js.map +1 -0
- package/dist/api/status-build.d.ts +9 -1
- package/dist/api/status-build.js +44 -9
- package/dist/api/status-build.js.map +1 -1
- package/dist/api/status-rollup-build.d.ts +46 -1
- package/dist/api/status-rollup-build.js +168 -5
- package/dist/api/status-rollup-build.js.map +1 -1
- package/dist/api/ui-token.d.ts +5 -0
- package/dist/api/ui-token.js +36 -0
- package/dist/api/ui-token.js.map +1 -0
- package/dist/build-info.d.ts +32 -0
- package/dist/build-info.js +69 -0
- package/dist/build-info.js.map +1 -0
- package/dist/build-info.json +6 -0
- package/dist/build-meta.json +1 -1
- package/dist/cli/command.d.ts +9 -0
- package/dist/cli/commands/balance.d.ts +7 -0
- package/dist/cli/commands/balance.js +38 -32
- package/dist/cli/commands/balance.js.map +1 -1
- package/dist/cli/commands/bootstrap.d.ts +13 -1
- package/dist/cli/commands/bootstrap.js +150 -132
- package/dist/cli/commands/bootstrap.js.map +1 -1
- package/dist/cli/commands/claim-rewards.js +14 -2
- package/dist/cli/commands/claim-rewards.js.map +1 -1
- package/dist/cli/commands/conformance.d.ts +12 -0
- package/dist/cli/commands/conformance.js +140 -0
- package/dist/cli/commands/conformance.js.map +1 -0
- package/dist/cli/commands/create.d.ts +36 -0
- package/dist/cli/commands/create.js +374 -0
- package/dist/cli/commands/create.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +34 -1
- package/dist/cli/commands/doctor.js +136 -121
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/fleet-scale.d.ts +19 -1
- package/dist/cli/commands/fleet-scale.js +379 -361
- package/dist/cli/commands/fleet-scale.js.map +1 -1
- package/dist/cli/commands/fleet.d.ts +7 -0
- package/dist/cli/commands/fleet.js +39 -33
- package/dist/cli/commands/fleet.js.map +1 -1
- package/dist/cli/commands/fund-requirements.d.ts +14 -1
- package/dist/cli/commands/fund-requirements.js +183 -174
- package/dist/cli/commands/fund-requirements.js.map +1 -1
- package/dist/cli/commands/history.d.ts +10 -1
- package/dist/cli/commands/history.js +66 -57
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/impls.d.ts +18 -0
- package/dist/cli/commands/impls.js +208 -0
- package/dist/cli/commands/impls.js.map +1 -0
- package/dist/cli/commands/init.js +4 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/intents.js +13 -9
- package/dist/cli/commands/intents.js.map +1 -1
- package/dist/cli/commands/logs.d.ts +6 -1
- package/dist/cli/commands/logs.js +77 -70
- package/dist/cli/commands/logs.js.map +1 -1
- package/dist/cli/commands/migrate-agent-id.d.ts +26 -0
- package/dist/cli/commands/migrate-agent-id.js +165 -0
- package/dist/cli/commands/migrate-agent-id.js.map +1 -0
- package/dist/cli/commands/plug-ins.d.ts +34 -0
- package/dist/cli/commands/plug-ins.js +282 -0
- package/dist/cli/commands/plug-ins.js.map +1 -0
- package/dist/cli/commands/plugin-install.d.ts +10 -0
- package/dist/cli/commands/plugin-install.js +226 -14
- package/dist/cli/commands/plugin-install.js.map +1 -1
- package/dist/cli/commands/rewards.d.ts +7 -0
- package/dist/cli/commands/rewards.js +46 -40
- package/dist/cli/commands/rewards.js.map +1 -1
- package/dist/cli/commands/run.d.ts +14 -1
- package/dist/cli/commands/run.js +232 -90
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/status.d.ts +10 -0
- package/dist/cli/commands/status.js +97 -34
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/submit-intent.js +33 -6
- package/dist/cli/commands/submit-intent.js.map +1 -1
- package/dist/cli/commands/ui.js +45 -0
- package/dist/cli/commands/ui.js.map +1 -0
- package/dist/cli/commands/update.d.ts +5 -0
- package/dist/cli/commands/update.js +102 -97
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/version.js +3 -1
- package/dist/cli/commands/version.js.map +1 -1
- package/dist/cli/commands/withdraw.d.ts +21 -1
- package/dist/cli/commands/withdraw.js +175 -159
- package/dist/cli/commands/withdraw.js.map +1 -1
- package/dist/cli/execution-context.d.ts +1 -1
- package/dist/cli/execution-context.js +2 -1
- package/dist/cli/execution-context.js.map +1 -1
- package/dist/cli/help.js +7 -0
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.js +18 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/intent-registry-access.d.ts +33 -1
- package/dist/cli/intent-registry-access.js +40 -2
- package/dist/cli/intent-registry-access.js.map +1 -1
- package/dist/cli/open-browser.d.ts +1 -0
- package/dist/cli/open-browser.js +18 -0
- package/dist/cli/open-browser.js.map +1 -0
- package/dist/cli/password.d.ts +3 -3
- package/dist/cli/password.js +5 -5
- package/dist/cli/password.js.map +1 -1
- package/dist/config.d.ts +883 -11
- package/dist/config.js +435 -4
- package/dist/config.js.map +1 -1
- package/dist/conformance/checks/artifacts.d.ts +37 -0
- package/dist/conformance/checks/artifacts.js +110 -0
- package/dist/conformance/checks/artifacts.js.map +1 -0
- package/dist/conformance/checks/envelope-schema.d.ts +17 -0
- package/dist/conformance/checks/envelope-schema.js +36 -0
- package/dist/conformance/checks/envelope-schema.js.map +1 -0
- package/dist/conformance/checks/hash-signature.d.ts +26 -0
- package/dist/conformance/checks/hash-signature.js +70 -0
- package/dist/conformance/checks/hash-signature.js.map +1 -0
- package/dist/conformance/checks/payload.d.ts +19 -0
- package/dist/conformance/checks/payload.js +52 -0
- package/dist/conformance/checks/payload.js.map +1 -0
- package/dist/conformance/checks/secret-scrub.d.ts +33 -0
- package/dist/conformance/checks/secret-scrub.js +118 -0
- package/dist/conformance/checks/secret-scrub.js.map +1 -0
- package/dist/conformance/checks/source-runtime.d.ts +43 -0
- package/dist/conformance/checks/source-runtime.js +68 -0
- package/dist/conformance/checks/source-runtime.js.map +1 -0
- package/dist/conformance/checks/source-static.d.ts +61 -0
- package/dist/conformance/checks/source-static.js +311 -0
- package/dist/conformance/checks/source-static.js.map +1 -0
- package/dist/conformance/checks/trajectory-chain.d.ts +18 -0
- package/dist/conformance/checks/trajectory-chain.js +51 -0
- package/dist/conformance/checks/trajectory-chain.js.map +1 -0
- package/dist/conformance/checks/trajectory-profile.d.ts +17 -0
- package/dist/conformance/checks/trajectory-profile.js +51 -0
- package/dist/conformance/checks/trajectory-profile.js.map +1 -0
- package/dist/conformance/checks/trajectory-schema.d.ts +20 -0
- package/dist/conformance/checks/trajectory-schema.js +40 -0
- package/dist/conformance/checks/trajectory-schema.js.map +1 -0
- package/dist/conformance/checks/verdict.d.ts +44 -0
- package/dist/conformance/checks/verdict.js +122 -0
- package/dist/conformance/checks/verdict.js.map +1 -0
- package/dist/conformance/harness.d.ts +32 -0
- package/dist/conformance/harness.js +228 -0
- package/dist/conformance/harness.js.map +1 -0
- package/dist/conformance/types.d.ts +88 -0
- package/dist/conformance/types.js +31 -0
- package/dist/conformance/types.js.map +1 -0
- package/dist/corpus/acquire.d.ts +37 -0
- package/dist/corpus/acquire.js +155 -0
- package/dist/corpus/acquire.js.map +1 -0
- package/dist/corpus/cache.d.ts +14 -0
- package/dist/corpus/cache.js +18 -0
- package/dist/corpus/cache.js.map +1 -0
- package/dist/corpus/fetch.d.ts +9 -0
- package/dist/corpus/fetch.js +24 -0
- package/dist/corpus/fetch.js.map +1 -0
- package/dist/corpus/index.d.ts +16 -0
- package/dist/corpus/index.js +78 -0
- package/dist/corpus/index.js.map +1 -0
- package/dist/corpus/query.d.ts +17 -0
- package/dist/corpus/query.js +108 -0
- package/dist/corpus/query.js.map +1 -0
- package/dist/corpus/route-resolver.d.ts +16 -0
- package/dist/corpus/route-resolver.js +20 -0
- package/dist/corpus/route-resolver.js.map +1 -0
- package/dist/corpus/types.d.ts +107 -0
- package/dist/corpus/types.js +50 -0
- package/dist/corpus/types.js.map +1 -0
- package/dist/daemon/balance-topup-loop.js +2 -1
- package/dist/daemon/balance-topup-loop.js.map +1 -1
- package/dist/daemon/creator.d.ts +2 -2
- package/dist/daemon/creator.js +2 -2
- package/dist/daemon/creator.js.map +1 -1
- package/dist/daemon/daemon.d.ts +70 -15
- package/dist/daemon/daemon.js +159 -41
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/delivery-watcher.js +31 -1
- package/dist/daemon/delivery-watcher.js.map +1 -1
- package/dist/daemon/jinn-claim-loop-canonical.d.ts +207 -0
- package/dist/daemon/jinn-claim-loop-canonical.js +296 -0
- package/dist/daemon/jinn-claim-loop-canonical.js.map +1 -0
- package/dist/daemon/jinn-claim-loop-mock.d.ts +61 -0
- package/dist/daemon/jinn-claim-loop-mock.js +122 -0
- package/dist/daemon/jinn-claim-loop-mock.js.map +1 -0
- package/dist/daemon/jinn-claim-loop.d.ts +123 -0
- package/dist/daemon/jinn-claim-loop.js +256 -0
- package/dist/daemon/jinn-claim-loop.js.map +1 -0
- package/dist/daemon/reward-claim-loop.d.ts +2 -0
- package/dist/daemon/reward-claim-loop.js +32 -27
- package/dist/daemon/reward-claim-loop.js.map +1 -1
- package/dist/dashboard/assets/index-Bxlk5qpa.js +68 -0
- package/dist/dashboard/assets/index-DQ3u_vP5.css +32 -0
- package/dist/dashboard/index.html +18 -74
- package/dist/earning/agent-wallet-binding.d.ts +133 -0
- package/dist/earning/agent-wallet-binding.js +202 -0
- package/dist/earning/agent-wallet-binding.js.map +1 -0
- package/dist/earning/bootstrap.d.ts +64 -0
- package/dist/earning/bootstrap.js +325 -32
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/contracts.d.ts +323 -0
- package/dist/earning/contracts.js +276 -0
- package/dist/earning/contracts.js.map +1 -1
- package/dist/earning/funding-plan.d.ts +90 -0
- package/dist/earning/funding-plan.js +203 -0
- package/dist/earning/funding-plan.js.map +1 -0
- package/dist/earning/migrate-agent-id.d.ts +130 -0
- package/dist/earning/migrate-agent-id.js +257 -0
- package/dist/earning/migrate-agent-id.js.map +1 -0
- package/dist/earning/orphan-sweep.d.ts +14 -0
- package/dist/earning/orphan-sweep.js +63 -2
- package/dist/earning/orphan-sweep.js.map +1 -1
- package/dist/earning/reconcile.d.ts +2 -0
- package/dist/earning/reconcile.js +30 -0
- package/dist/earning/reconcile.js.map +1 -1
- package/dist/earning/stolas-claim.d.ts +86 -6
- package/dist/earning/stolas-claim.js +123 -9
- package/dist/earning/stolas-claim.js.map +1 -1
- package/dist/earning/store.d.ts +39 -0
- package/dist/earning/store.js +72 -1
- package/dist/earning/store.js.map +1 -1
- package/dist/earning/testnet-setup-migration.d.ts +32 -0
- package/dist/earning/testnet-setup-migration.js +214 -0
- package/dist/earning/testnet-setup-migration.js.map +1 -0
- package/dist/earning/types.d.ts +53 -9
- package/dist/earning/types.js +51 -2
- package/dist/earning/types.js.map +1 -1
- package/dist/earning/viem-clients.d.ts +20 -0
- package/dist/earning/viem-clients.js +32 -1
- package/dist/earning/viem-clients.js.map +1 -1
- package/dist/erc8004/abis.d.ts +381 -0
- package/dist/erc8004/abis.js +238 -0
- package/dist/erc8004/abis.js.map +1 -0
- package/dist/erc8004/addresses.d.ts +40 -0
- package/dist/erc8004/addresses.js +64 -0
- package/dist/erc8004/addresses.js.map +1 -0
- package/dist/erc8004/identity.d.ts +202 -0
- package/dist/erc8004/identity.js +305 -0
- package/dist/erc8004/identity.js.map +1 -0
- package/dist/erc8004/index.d.ts +13 -0
- package/dist/erc8004/index.js +20 -0
- package/dist/erc8004/index.js.map +1 -0
- package/dist/erc8004/reputation.d.ts +349 -0
- package/dist/erc8004/reputation.js +464 -0
- package/dist/erc8004/reputation.js.map +1 -0
- package/dist/erc8004/subgraph.d.ts +46 -0
- package/dist/erc8004/subgraph.js +37 -0
- package/dist/erc8004/subgraph.js.map +1 -0
- package/dist/erc8004/validation.d.ts +145 -0
- package/dist/erc8004/validation.js +219 -0
- package/dist/erc8004/validation.js.map +1 -0
- package/dist/errors/persisted-bootstrap-error.d.ts +4 -0
- package/dist/errors/persisted-bootstrap-error.js +50 -0
- package/dist/errors/persisted-bootstrap-error.js.map +1 -0
- package/dist/events/emitter.d.ts +12 -0
- package/dist/events/emitter.js +23 -0
- package/dist/events/emitter.js.map +1 -0
- package/dist/events/ring-buffer.d.ts +25 -0
- package/dist/events/ring-buffer.js +46 -0
- package/dist/events/ring-buffer.js.map +1 -0
- package/dist/events/types.d.ts +42 -0
- package/dist/events/types.js +28 -0
- package/dist/events/types.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/intents/kinds/index.d.ts +10 -0
- package/dist/intents/kinds/index.js +7 -0
- package/dist/intents/kinds/index.js.map +1 -1
- package/dist/intents/kinds/learner-loop-test.d.ts +2 -0
- package/dist/intents/kinds/learner-loop-test.js +39 -0
- package/dist/intents/kinds/learner-loop-test.js.map +1 -0
- package/dist/intents/kinds/prediction-apy-v0.js +5 -1
- package/dist/intents/kinds/prediction-apy-v0.js.map +1 -1
- package/dist/intents/kinds/prediction-v0.js +5 -0
- package/dist/intents/kinds/prediction-v0.js.map +1 -1
- package/dist/intents/kinds/spec-kind.d.ts +18 -1
- package/dist/intents/posting-service.d.ts +3 -5
- package/dist/intents/posting-service.js +16 -50
- package/dist/intents/posting-service.js.map +1 -1
- package/dist/intents/prediction-apy-v0-auto.d.ts +12 -2
- package/dist/intents/prediction-apy-v0-auto.js +27 -2
- package/dist/intents/prediction-apy-v0-auto.js.map +1 -1
- package/dist/intents/prediction-v0-auto.d.ts +14 -4
- package/dist/intents/prediction-v0-auto.js +29 -5
- package/dist/intents/prediction-v0-auto.js.map +1 -1
- package/dist/intents/signing.d.ts +13 -0
- package/dist/intents/signing.js +27 -0
- package/dist/intents/signing.js.map +1 -0
- package/dist/intents/sources.d.ts +12 -5
- package/dist/intents/sources.js +11 -11
- package/dist/intents/sources.js.map +1 -1
- package/dist/main.d.ts +5 -2
- package/dist/main.js +792 -66
- package/dist/main.js.map +1 -1
- package/dist/mcp/acquire-artifact.d.ts +39 -0
- package/dist/mcp/acquire-artifact.js +163 -0
- package/dist/mcp/acquire-artifact.js.map +1 -0
- package/dist/mcp/operator-server.d.ts +20 -3
- package/dist/mcp/operator-server.js +500 -25
- package/dist/mcp/operator-server.js.map +1 -1
- package/dist/mcp/search-artifacts.d.ts +31 -0
- package/dist/mcp/search-artifacts.js +40 -0
- package/dist/mcp/search-artifacts.js.map +1 -0
- package/dist/mcp/server.js +103 -58
- package/dist/mcp/server.js.map +1 -1
- package/dist/observability/emit-event.d.ts +1 -1
- package/dist/observability/emit-event.js.map +1 -1
- package/dist/operator-errors.js +4 -5
- package/dist/operator-errors.js.map +1 -1
- package/dist/preflight/claude-auth.d.ts +11 -11
- package/dist/preflight/claude-auth.js +18 -32
- package/dist/preflight/claude-auth.js.map +1 -1
- package/dist/restorer/capability/index.d.ts +82 -0
- package/dist/restorer/capability/index.js +12 -0
- package/dist/restorer/capability/index.js.map +1 -0
- package/dist/restorer/capability/scoped-rpc.d.ts +12 -0
- package/dist/restorer/capability/scoped-rpc.js +34 -0
- package/dist/restorer/capability/scoped-rpc.js.map +1 -0
- package/dist/restorer/capability/scoped-secrets.d.ts +8 -0
- package/dist/restorer/capability/scoped-secrets.js +10 -0
- package/dist/restorer/capability/scoped-secrets.js.map +1 -0
- package/dist/restorer/capability/scoped-signer.d.ts +46 -0
- package/dist/restorer/capability/scoped-signer.js +73 -0
- package/dist/restorer/capability/scoped-signer.js.map +1 -0
- package/dist/restorer/engine/canonical-json.d.ts +0 -17
- package/dist/restorer/engine/canonical-json.js +56 -49
- package/dist/restorer/engine/canonical-json.js.map +1 -1
- package/dist/restorer/engine/claim.js +8 -1
- package/dist/restorer/engine/claim.js.map +1 -1
- package/dist/restorer/engine/delivery.d.ts +2 -0
- package/dist/restorer/engine/delivery.js +2 -2
- package/dist/restorer/engine/delivery.js.map +1 -1
- package/dist/restorer/engine/engine.d.ts +143 -26
- package/dist/restorer/engine/engine.js +485 -104
- package/dist/restorer/engine/engine.js.map +1 -1
- package/dist/restorer/engine/envelope-assembly.d.ts +65 -0
- package/dist/restorer/engine/envelope-assembly.js +60 -0
- package/dist/restorer/engine/envelope-assembly.js.map +1 -0
- package/dist/restorer/engine/packaging.d.ts +30 -30
- package/dist/restorer/engine/packaging.js +73 -47
- package/dist/restorer/engine/packaging.js.map +1 -1
- package/dist/restorer/engine/persistence.d.ts +7 -7
- package/dist/restorer/engine/persistence.js +4 -4
- package/dist/restorer/engine/persistence.js.map +1 -1
- package/dist/restorer/engine/registry.d.ts +24 -13
- package/dist/restorer/engine/registry.js +16 -13
- package/dist/restorer/engine/registry.js.map +1 -1
- package/dist/restorer/engine/validate-manifest.d.ts +23 -0
- package/dist/restorer/engine/validate-manifest.js +49 -0
- package/dist/restorer/engine/validate-manifest.js.map +1 -0
- package/dist/restorer/engine/verification-stub.d.ts +18 -0
- package/dist/restorer/engine/verification-stub.js +18 -0
- package/dist/restorer/engine/verification-stub.js.map +1 -0
- package/dist/restorer/external-impls/index.d.ts +3 -0
- package/dist/restorer/external-impls/index.js +2 -0
- package/dist/restorer/external-impls/index.js.map +1 -0
- package/dist/restorer/external-impls/loader.d.ts +49 -0
- package/dist/restorer/external-impls/loader.js +138 -0
- package/dist/restorer/external-impls/loader.js.map +1 -0
- package/dist/restorer/external-impls/package-hash.d.ts +26 -0
- package/dist/restorer/external-impls/package-hash.js +102 -0
- package/dist/restorer/external-impls/package-hash.js.map +1 -0
- package/dist/restorer/external-impls/types.d.ts +42 -0
- package/dist/restorer/external-impls/types.js +10 -0
- package/dist/restorer/external-impls/types.js.map +1 -0
- package/dist/restorer/impls/claude-code-learner/adapters/claude-code.d.ts +38 -0
- package/dist/restorer/impls/claude-code-learner/adapters/claude-code.js +200 -0
- package/dist/restorer/impls/claude-code-learner/adapters/claude-code.js.map +1 -0
- package/dist/restorer/impls/claude-code-learner/harvest.d.ts +19 -0
- package/dist/restorer/impls/claude-code-learner/harvest.js +146 -0
- package/dist/restorer/impls/claude-code-learner/harvest.js.map +1 -0
- package/dist/restorer/impls/claude-code-learner/index.d.ts +15 -0
- package/dist/restorer/impls/claude-code-learner/index.js +14 -0
- package/dist/restorer/impls/claude-code-learner/index.js.map +1 -0
- package/dist/restorer/impls/claude-code-learner/mcp-config.d.ts +48 -0
- package/dist/restorer/impls/claude-code-learner/mcp-config.js +52 -0
- package/dist/restorer/impls/claude-code-learner/mcp-config.js.map +1 -0
- package/dist/restorer/impls/claude-code-learner/plugin-path.d.ts +14 -0
- package/dist/restorer/impls/claude-code-learner/plugin-path.js +30 -0
- package/dist/restorer/impls/claude-code-learner/plugin-path.js.map +1 -0
- package/dist/restorer/impls/claude-code-learner/restorer.d.ts +38 -0
- package/dist/restorer/impls/claude-code-learner/restorer.js +73 -0
- package/dist/restorer/impls/claude-code-learner/restorer.js.map +1 -0
- package/dist/restorer/impls/claude-code-learner/test-utils/fake-plugin-outputs.d.ts +19 -0
- package/dist/restorer/impls/claude-code-learner/test-utils/fake-plugin-outputs.js +111 -0
- package/dist/restorer/impls/claude-code-learner/test-utils/fake-plugin-outputs.js.map +1 -0
- package/dist/restorer/impls/claude-code-learner/test-utils/noop-adapter.d.ts +22 -0
- package/dist/restorer/impls/claude-code-learner/test-utils/noop-adapter.js +35 -0
- package/dist/restorer/impls/claude-code-learner/test-utils/noop-adapter.js.map +1 -0
- package/dist/restorer/impls/claude-code-learner/test-utils/synthetic-session.d.ts +20 -0
- package/dist/restorer/impls/claude-code-learner/test-utils/synthetic-session.js +34 -0
- package/dist/restorer/impls/claude-code-learner/test-utils/synthetic-session.js.map +1 -0
- package/dist/restorer/impls/claude-code-learner/types.d.ts +99 -0
- package/dist/restorer/impls/claude-code-learner/types.js +2 -0
- package/dist/restorer/impls/claude-code-learner/types.js.map +1 -0
- package/dist/restorer/impls/claude-code-learner/wrapper.d.ts +49 -0
- package/dist/restorer/impls/claude-code-learner/wrapper.js +144 -0
- package/dist/restorer/impls/claude-code-learner/wrapper.js.map +1 -0
- package/dist/restorer/impls/claude-mcp-hyperliquid/index.d.ts +2 -2
- package/dist/restorer/impls/claude-mcp-hyperliquid/index.js +2 -2
- package/dist/restorer/impls/claude-mcp-hyperliquid/index.js.map +1 -1
- package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.d.ts +7 -0
- package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js +38 -0
- package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js.map +1 -1
- package/dist/restorer/impls/claude-mcp-prediction/index.d.ts +2 -2
- package/dist/restorer/impls/claude-mcp-prediction/index.js +12 -2
- package/dist/restorer/impls/claude-mcp-prediction/index.js.map +1 -1
- package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.d.ts +9 -2
- package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js +9 -125
- package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js.map +1 -1
- package/dist/restorer/impls/claude-mcp-prediction-apy/index.d.ts +2 -2
- package/dist/restorer/impls/claude-mcp-prediction-apy/index.js +9 -2
- package/dist/restorer/impls/claude-mcp-prediction-apy/index.js.map +1 -1
- package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.d.ts +10 -0
- package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.js +10 -119
- package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.js.map +1 -1
- package/dist/restorer/impls/claude-mcp-shared/single-session-orchestrator.d.ts +84 -0
- package/dist/restorer/impls/claude-mcp-shared/single-session-orchestrator.js +206 -0
- package/dist/restorer/impls/claude-mcp-shared/single-session-orchestrator.js.map +1 -0
- package/dist/restorer/impls/evaluation-context.d.ts +11 -4
- package/dist/restorer/impls/evaluation-context.js +9 -2
- package/dist/restorer/impls/evaluation-context.js.map +1 -1
- package/dist/restorer/impls/index.d.ts +46 -1
- package/dist/restorer/impls/index.js +38 -0
- package/dist/restorer/impls/index.js.map +1 -1
- package/dist/restorer/impls/legacy-claude/index.d.ts +13 -1
- package/dist/restorer/impls/legacy-claude/index.js +2 -0
- package/dist/restorer/impls/legacy-claude/index.js.map +1 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/index.d.ts +4 -4
- package/dist/restorer/impls/portfolio-v0-evaluator/index.js +184 -55
- package/dist/restorer/impls/portfolio-v0-evaluator/index.js.map +1 -1
- package/dist/restorer/impls/prediction-apy-v0-baseline/index.d.ts +1 -1
- package/dist/restorer/impls/prediction-apy-v0-baseline/index.js +8 -1
- package/dist/restorer/impls/prediction-apy-v0-baseline/index.js.map +1 -1
- package/dist/restorer/impls/prediction-apy-v0-evaluator/index.d.ts +3 -3
- package/dist/restorer/impls/prediction-apy-v0-evaluator/index.js +153 -15
- package/dist/restorer/impls/prediction-apy-v0-evaluator/index.js.map +1 -1
- package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.d.ts +14 -5
- package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.js +16 -23
- package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.js.map +1 -1
- package/dist/restorer/impls/prediction-v0-baseline/index.d.ts +1 -1
- package/dist/restorer/impls/prediction-v0-baseline/index.js +16 -7
- package/dist/restorer/impls/prediction-v0-baseline/index.js.map +1 -1
- package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.d.ts +5 -3
- package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.js.map +1 -1
- package/dist/restorer/impls/prediction-v0-evaluator/index.d.ts +2 -2
- package/dist/restorer/impls/prediction-v0-evaluator/index.js +175 -67
- package/dist/restorer/impls/prediction-v0-evaluator/index.js.map +1 -1
- package/dist/restorer/manifest/index.d.ts +3 -0
- package/dist/restorer/manifest/index.js +3 -0
- package/dist/restorer/manifest/index.js.map +1 -0
- package/dist/restorer/manifest/load.d.ts +7 -0
- package/dist/restorer/manifest/load.js +49 -0
- package/dist/restorer/manifest/load.js.map +1 -0
- package/dist/restorer/manifest/types.d.ts +75 -0
- package/dist/restorer/manifest/types.js +8 -0
- package/dist/restorer/manifest/types.js.map +1 -0
- package/dist/restorer/manifest/verify.d.ts +15 -0
- package/dist/restorer/manifest/verify.js +53 -0
- package/dist/restorer/manifest/verify.js.map +1 -0
- package/dist/restorer/plug-ins/index.d.ts +14 -0
- package/dist/restorer/plug-ins/index.js +11 -0
- package/dist/restorer/plug-ins/index.js.map +1 -0
- package/dist/restorer/plug-ins/loader.d.ts +27 -0
- package/dist/restorer/plug-ins/loader.js +101 -0
- package/dist/restorer/plug-ins/loader.js.map +1 -0
- package/dist/restorer/plug-ins/manifest.d.ts +7 -0
- package/dist/restorer/plug-ins/manifest.js +97 -0
- package/dist/restorer/plug-ins/manifest.js.map +1 -0
- package/dist/restorer/plug-ins/registry.d.ts +24 -0
- package/dist/restorer/plug-ins/registry.js +17 -0
- package/dist/restorer/plug-ins/registry.js.map +1 -0
- package/dist/restorer/plug-ins/serialise.d.ts +29 -0
- package/dist/restorer/plug-ins/serialise.js +29 -0
- package/dist/restorer/plug-ins/serialise.js.map +1 -0
- package/dist/restorer/plug-ins/types.d.ts +77 -0
- package/dist/restorer/plug-ins/types.js +10 -0
- package/dist/restorer/plug-ins/types.js.map +1 -0
- package/dist/restorer/types.d.ts +66 -11
- package/dist/restorer/types.js.map +1 -1
- package/dist/runner/claude.d.ts +3 -3
- package/dist/runner/claude.js +57 -21
- package/dist/runner/claude.js.map +1 -1
- package/dist/runner/runner.d.ts +29 -2
- package/dist/runner/simple.d.ts +2 -2
- package/dist/runner/simple.js +2 -2
- package/dist/runner/simple.js.map +1 -1
- package/dist/scripts/fix-node-pty.mjs +62 -0
- package/dist/setup-mode.d.ts +34 -0
- package/dist/setup-mode.js +49 -0
- package/dist/setup-mode.js.map +1 -0
- package/dist/store/store.d.ts +79 -3
- package/dist/store/store.js +189 -6
- package/dist/store/store.js.map +1 -1
- package/dist/templates/plug-in/hook/README.md.tmpl +24 -0
- package/dist/templates/plug-in/hook/gitignore.tmpl +3 -0
- package/dist/templates/plug-in/hook/hooks/event.sh.tmpl +15 -0
- package/dist/templates/plug-in/hook/jinn-plugin.json.tmpl +16 -0
- package/dist/templates/plug-in/hook/package.json.tmpl +14 -0
- package/dist/templates/plug-in/hook/test/manifest.test.ts.tmpl +21 -0
- package/dist/templates/plug-in/mcp-tool/README.md.tmpl +26 -0
- package/dist/templates/plug-in/mcp-tool/gitignore.tmpl +4 -0
- package/dist/templates/plug-in/mcp-tool/jinn-plugin.json.tmpl +16 -0
- package/dist/templates/plug-in/mcp-tool/package.json.tmpl +19 -0
- package/dist/templates/plug-in/mcp-tool/src/server.ts.tmpl +17 -0
- package/dist/templates/plug-in/mcp-tool/test/server.test.ts.tmpl +18 -0
- package/dist/templates/plug-in/memory-backend/README.md.tmpl +33 -0
- package/dist/templates/plug-in/memory-backend/gitignore.tmpl +4 -0
- package/dist/templates/plug-in/memory-backend/jinn-plugin.json.tmpl +16 -0
- package/dist/templates/plug-in/memory-backend/package.json.tmpl +19 -0
- package/dist/templates/plug-in/memory-backend/src/server.ts.tmpl +23 -0
- package/dist/templates/plug-in/memory-backend/test/server.test.ts.tmpl +17 -0
- package/dist/templates/plug-in/phase-agent-override/README.md.tmpl +30 -0
- package/dist/templates/plug-in/phase-agent-override/agents/agent.md.tmpl +26 -0
- package/dist/templates/plug-in/phase-agent-override/gitignore.tmpl +3 -0
- package/dist/templates/plug-in/phase-agent-override/jinn-plugin.json.tmpl +17 -0
- package/dist/templates/plug-in/phase-agent-override/package.json.tmpl +14 -0
- package/dist/templates/plug-in/phase-agent-override/test/manifest.test.ts.tmpl +24 -0
- package/dist/templates/plug-in/skill-bundle/.claude-plugin/plugin.json.tmpl +5 -0
- package/dist/templates/plug-in/skill-bundle/README.md.tmpl +28 -0
- package/dist/templates/plug-in/skill-bundle/gitignore.tmpl +3 -0
- package/dist/templates/plug-in/skill-bundle/jinn-plugin.json.tmpl +15 -0
- package/dist/templates/plug-in/skill-bundle/package.json.tmpl +14 -0
- package/dist/templates/plug-in/skill-bundle/skills/example/SKILL.md.tmpl +14 -0
- package/dist/templates/plug-in/skill-bundle/test/manifest.test.ts.tmpl +21 -0
- package/dist/templates/plug-in/topic-explorer/README.md.tmpl +24 -0
- package/dist/templates/plug-in/topic-explorer/agents/explorer.md.tmpl +26 -0
- package/dist/templates/plug-in/topic-explorer/gitignore.tmpl +3 -0
- package/dist/templates/plug-in/topic-explorer/jinn-plugin.json.tmpl +17 -0
- package/dist/templates/plug-in/topic-explorer/package.json.tmpl +14 -0
- package/dist/templates/plug-in/topic-explorer/test/manifest.test.ts.tmpl +22 -0
- package/dist/templates/restorer/alternative-harness/README.md.tmpl +44 -0
- package/dist/templates/restorer/alternative-harness/gitignore.tmpl +3 -0
- package/dist/templates/restorer/alternative-harness/jinn.manifest.json.tmpl +22 -0
- package/dist/templates/restorer/alternative-harness/package.json.tmpl +26 -0
- package/dist/templates/restorer/alternative-harness/src/coordinator.ts.tmpl +50 -0
- package/dist/templates/restorer/alternative-harness/src/harness.ts.tmpl +31 -0
- package/dist/templates/restorer/alternative-harness/src/index.ts.tmpl +44 -0
- package/dist/templates/restorer/alternative-harness/src/mock-harness.ts.tmpl +41 -0
- package/dist/templates/restorer/alternative-harness/src/phases/debrief.ts.tmpl +28 -0
- package/dist/templates/restorer/alternative-harness/src/phases/execute.ts.tmpl +33 -0
- package/dist/templates/restorer/alternative-harness/src/phases/improve.ts.tmpl +31 -0
- package/dist/templates/restorer/alternative-harness/src/phases/memory.ts.tmpl +31 -0
- package/dist/templates/restorer/alternative-harness/src/phases/orient.ts.tmpl +21 -0
- package/dist/templates/restorer/alternative-harness/src/phases/plan.ts.tmpl +25 -0
- package/dist/templates/restorer/alternative-harness/src/phases/strategize.ts.tmpl +29 -0
- package/dist/templates/restorer/alternative-harness/test/coordinator.test.ts.tmpl +52 -0
- package/dist/templates/restorer/alternative-harness/test/unit.test.ts.tmpl +54 -0
- package/dist/templates/restorer/alternative-harness/tsconfig.json.tmpl +16 -0
- package/dist/templates/restorer/evaluator/README.md.tmpl +36 -0
- package/dist/templates/restorer/evaluator/gitignore.tmpl +3 -0
- package/dist/templates/restorer/evaluator/jinn.manifest.json.tmpl +22 -0
- package/dist/templates/restorer/evaluator/package.json.tmpl +26 -0
- package/dist/templates/restorer/evaluator/src/index.ts.tmpl +35 -0
- package/dist/templates/restorer/evaluator/test/unit.test.ts.tmpl +48 -0
- package/dist/templates/restorer/evaluator/tsconfig.json.tmpl +16 -0
- package/dist/templates/restorer/forecaster/README.md.tmpl +25 -0
- package/dist/templates/restorer/forecaster/gitignore.tmpl +5 -0
- package/dist/templates/restorer/forecaster/jinn.manifest.json.tmpl +22 -0
- package/dist/templates/restorer/forecaster/package.json.tmpl +26 -0
- package/dist/templates/restorer/forecaster/src/index.ts.tmpl +33 -0
- package/dist/templates/restorer/forecaster/test/unit.test.ts.tmpl +41 -0
- package/dist/templates/restorer/forecaster/tsconfig.json.tmpl +16 -0
- package/dist/trajectory/collector.d.ts +49 -0
- package/dist/trajectory/collector.js +86 -0
- package/dist/trajectory/collector.js.map +1 -0
- package/dist/trajectory/emit.d.ts +27 -0
- package/dist/trajectory/emit.js +40 -0
- package/dist/trajectory/emit.js.map +1 -0
- package/dist/trajectory/hash-chain.d.ts +18 -0
- package/dist/trajectory/hash-chain.js +23 -0
- package/dist/trajectory/hash-chain.js.map +1 -0
- package/dist/trajectory/index.d.ts +22 -0
- package/dist/trajectory/index.js +23 -0
- package/dist/trajectory/index.js.map +1 -0
- package/dist/trajectory/schema.d.ts +14 -14
- package/dist/trajectory/secret-scrub.d.ts +32 -0
- package/dist/trajectory/secret-scrub.js +51 -0
- package/dist/trajectory/secret-scrub.js.map +1 -0
- package/dist/trajectory/span-profile.d.ts +27 -0
- package/dist/trajectory/span-profile.js +51 -0
- package/dist/trajectory/span-profile.js.map +1 -0
- package/dist/trajectory/wrappers/http.d.ts +37 -0
- package/dist/trajectory/wrappers/http.js +85 -0
- package/dist/trajectory/wrappers/http.js.map +1 -0
- package/dist/trajectory/wrappers/mcp.d.ts +17 -0
- package/dist/trajectory/wrappers/mcp.js +58 -0
- package/dist/trajectory/wrappers/mcp.js.map +1 -0
- package/dist/trajectory/wrappers/subprocess.d.ts +32 -0
- package/dist/trajectory/wrappers/subprocess.js +70 -0
- package/dist/trajectory/wrappers/subprocess.js.map +1 -0
- package/dist/tx-retry.js +23 -9
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/desired-state.d.ts +211 -21
- package/dist/types/desired-state.js +26 -15
- package/dist/types/desired-state.js.map +1 -1
- package/dist/types/envelope.d.ts +1473 -0
- package/dist/types/envelope.js +114 -0
- package/dist/types/envelope.js.map +1 -0
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +4 -4
- package/dist/types/index.js.map +1 -1
- package/dist/types/intent.d.ts +276 -0
- package/dist/types/intent.js +74 -0
- package/dist/types/intent.js.map +1 -0
- package/dist/types/payloads/index.d.ts +11 -0
- package/dist/types/payloads/index.js +46 -0
- package/dist/types/payloads/index.js.map +1 -0
- package/dist/types/payloads/portfolio-v0.d.ts +481 -0
- package/dist/types/payloads/portfolio-v0.js +94 -0
- package/dist/types/payloads/portfolio-v0.js.map +1 -0
- package/dist/types/payloads/prediction-apy-v0.d.ts +231 -0
- package/dist/types/payloads/prediction-apy-v0.js +63 -0
- package/dist/types/payloads/prediction-apy-v0.js.map +1 -0
- package/dist/types/payloads/prediction-v0.d.ts +262 -0
- package/dist/types/payloads/prediction-v0.js +73 -0
- package/dist/types/payloads/prediction-v0.js.map +1 -0
- package/dist/types/portfolio.d.ts +23 -685
- package/dist/types/portfolio.js +16 -106
- package/dist/types/portfolio.js.map +1 -1
- package/dist/types/prediction-apy.d.ts +9 -344
- package/dist/types/prediction-apy.js +9 -65
- package/dist/types/prediction-apy.js.map +1 -1
- package/dist/types/prediction.d.ts +25 -396
- package/dist/types/prediction.js +5 -79
- package/dist/types/prediction.js.map +1 -1
- package/dist/types/window.d.ts +12 -0
- package/dist/types/window.js +6 -0
- package/dist/types/window.js.map +1 -0
- package/dist/util/path-safety.d.ts +22 -0
- package/dist/util/path-safety.js +29 -0
- package/dist/util/path-safety.js.map +1 -0
- package/dist/util/redact-rpc-urls.d.ts +5 -0
- package/dist/util/redact-rpc-urls.js +9 -0
- package/dist/util/redact-rpc-urls.js.map +1 -0
- package/dist/x402/acquire.d.ts +14 -3
- package/dist/x402/acquire.js +28 -11
- package/dist/x402/acquire.js.map +1 -1
- package/dist/x402/handler.d.ts +15 -3
- package/dist/x402/handler.js +67 -24
- package/dist/x402/handler.js.map +1 -1
- package/package.json +36 -11
- package/plugins/claude-code-learner/.claude-plugin/plugin.json +9 -0
- package/plugins/claude-code-learner/AGENTS.md +30 -0
- package/plugins/claude-code-learner/CLAUDE.md +31 -0
- package/plugins/claude-code-learner/README.md +58 -0
- package/plugins/claude-code-learner/agents/analyst.md +69 -0
- package/plugins/claude-code-learner/agents/consolidator.md +95 -0
- package/plugins/claude-code-learner/agents/explorer.md +54 -0
- package/plugins/claude-code-learner/agents/planner.md +88 -0
- package/plugins/claude-code-learner/agents/promoter.md +114 -0
- package/plugins/claude-code-learner/agents/step-worker.md +48 -0
- package/plugins/claude-code-learner/agents/strategist.md +86 -0
- package/plugins/claude-code-learner/hooks/hooks.json +16 -0
- package/plugins/claude-code-learner/hooks/session-start +49 -0
- package/plugins/claude-code-learner/skills/coordinator/SKILL.md +131 -0
- package/plugins/claude-code-learner/skills/debrief/SKILL.md +71 -0
- package/plugins/claude-code-learner/skills/execute/SKILL.md +91 -0
- package/plugins/claude-code-learner/skills/improve/SKILL.md +57 -0
- package/plugins/claude-code-learner/skills/memory-consolidation/SKILL.md +57 -0
- package/plugins/claude-code-learner/skills/orient/SKILL.md +82 -0
- package/plugins/claude-code-learner/skills/plan/SKILL.md +54 -0
- package/plugins/claude-code-learner/skills/strategize/SKILL.md +63 -0
- package/skills/jinn-operator/SKILL.md +84 -35
- package/templates/plug-in/hook/README.md.tmpl +24 -0
- package/templates/plug-in/hook/gitignore.tmpl +3 -0
- package/templates/plug-in/hook/hooks/event.sh.tmpl +15 -0
- package/templates/plug-in/hook/jinn-plugin.json.tmpl +16 -0
- package/templates/plug-in/hook/package.json.tmpl +14 -0
- package/templates/plug-in/hook/test/manifest.test.ts.tmpl +21 -0
- package/templates/plug-in/mcp-tool/README.md.tmpl +26 -0
- package/templates/plug-in/mcp-tool/gitignore.tmpl +4 -0
- package/templates/plug-in/mcp-tool/jinn-plugin.json.tmpl +16 -0
- package/templates/plug-in/mcp-tool/package.json.tmpl +19 -0
- package/templates/plug-in/mcp-tool/src/server.ts.tmpl +17 -0
- package/templates/plug-in/mcp-tool/test/server.test.ts.tmpl +18 -0
- package/templates/plug-in/memory-backend/README.md.tmpl +33 -0
- package/templates/plug-in/memory-backend/gitignore.tmpl +4 -0
- package/templates/plug-in/memory-backend/jinn-plugin.json.tmpl +16 -0
- package/templates/plug-in/memory-backend/package.json.tmpl +19 -0
- package/templates/plug-in/memory-backend/src/server.ts.tmpl +23 -0
- package/templates/plug-in/memory-backend/test/server.test.ts.tmpl +17 -0
- package/templates/plug-in/phase-agent-override/README.md.tmpl +30 -0
- package/templates/plug-in/phase-agent-override/agents/agent.md.tmpl +26 -0
- package/templates/plug-in/phase-agent-override/gitignore.tmpl +3 -0
- package/templates/plug-in/phase-agent-override/jinn-plugin.json.tmpl +17 -0
- package/templates/plug-in/phase-agent-override/package.json.tmpl +14 -0
- package/templates/plug-in/phase-agent-override/test/manifest.test.ts.tmpl +24 -0
- package/templates/plug-in/skill-bundle/.claude-plugin/plugin.json.tmpl +5 -0
- package/templates/plug-in/skill-bundle/README.md.tmpl +28 -0
- package/templates/plug-in/skill-bundle/gitignore.tmpl +3 -0
- package/templates/plug-in/skill-bundle/jinn-plugin.json.tmpl +15 -0
- package/templates/plug-in/skill-bundle/package.json.tmpl +14 -0
- package/templates/plug-in/skill-bundle/skills/example/SKILL.md.tmpl +14 -0
- package/templates/plug-in/skill-bundle/test/manifest.test.ts.tmpl +21 -0
- package/templates/plug-in/topic-explorer/README.md.tmpl +24 -0
- package/templates/plug-in/topic-explorer/agents/explorer.md.tmpl +26 -0
- package/templates/plug-in/topic-explorer/gitignore.tmpl +3 -0
- package/templates/plug-in/topic-explorer/jinn-plugin.json.tmpl +17 -0
- package/templates/plug-in/topic-explorer/package.json.tmpl +14 -0
- package/templates/plug-in/topic-explorer/test/manifest.test.ts.tmpl +22 -0
- package/templates/restorer/alternative-harness/README.md.tmpl +44 -0
- package/templates/restorer/alternative-harness/gitignore.tmpl +3 -0
- package/templates/restorer/alternative-harness/jinn.manifest.json.tmpl +22 -0
- package/templates/restorer/alternative-harness/package.json.tmpl +26 -0
- package/templates/restorer/alternative-harness/src/coordinator.ts.tmpl +50 -0
- package/templates/restorer/alternative-harness/src/harness.ts.tmpl +31 -0
- package/templates/restorer/alternative-harness/src/index.ts.tmpl +44 -0
- package/templates/restorer/alternative-harness/src/mock-harness.ts.tmpl +41 -0
- package/templates/restorer/alternative-harness/src/phases/debrief.ts.tmpl +28 -0
- package/templates/restorer/alternative-harness/src/phases/execute.ts.tmpl +33 -0
- package/templates/restorer/alternative-harness/src/phases/improve.ts.tmpl +31 -0
- package/templates/restorer/alternative-harness/src/phases/memory.ts.tmpl +31 -0
- package/templates/restorer/alternative-harness/src/phases/orient.ts.tmpl +21 -0
- package/templates/restorer/alternative-harness/src/phases/plan.ts.tmpl +25 -0
- package/templates/restorer/alternative-harness/src/phases/strategize.ts.tmpl +29 -0
- package/templates/restorer/alternative-harness/test/coordinator.test.ts.tmpl +52 -0
- package/templates/restorer/alternative-harness/test/unit.test.ts.tmpl +54 -0
- package/templates/restorer/alternative-harness/tsconfig.json.tmpl +16 -0
- package/templates/restorer/evaluator/README.md.tmpl +36 -0
- package/templates/restorer/evaluator/gitignore.tmpl +3 -0
- package/templates/restorer/evaluator/jinn.manifest.json.tmpl +22 -0
- package/templates/restorer/evaluator/package.json.tmpl +26 -0
- package/templates/restorer/evaluator/src/index.ts.tmpl +35 -0
- package/templates/restorer/evaluator/test/unit.test.ts.tmpl +48 -0
- package/templates/restorer/evaluator/tsconfig.json.tmpl +16 -0
- package/templates/restorer/forecaster/README.md.tmpl +25 -0
- package/templates/restorer/forecaster/gitignore.tmpl +5 -0
- package/templates/restorer/forecaster/jinn.manifest.json.tmpl +22 -0
- package/templates/restorer/forecaster/package.json.tmpl +26 -0
- package/templates/restorer/forecaster/src/index.ts.tmpl +33 -0
- package/templates/restorer/forecaster/test/unit.test.ts.tmpl +41 -0
- package/templates/restorer/forecaster/tsconfig.json.tmpl +16 -0
- package/dist/bin/jinn-mcp.d.ts +0 -2
- package/dist/bin/jinn-mcp.js +0 -10
- package/dist/bin/jinn-mcp.js.map +0 -1
- package/dist/cli/commands/quickstart.js +0 -330
- package/dist/cli/commands/quickstart.js.map +0 -1
- package/dist/discovery/registry.d.ts +0 -97
- package/dist/discovery/registry.js +0 -177
- package/dist/discovery/registry.js.map +0 -1
- package/dist/discovery/subgraph.d.ts +0 -37
- package/dist/discovery/subgraph.js +0 -87
- package/dist/discovery/subgraph.js.map +0 -1
- package/dist/restorer/engine/manifest-assembly.d.ts +0 -67
- package/dist/restorer/engine/manifest-assembly.js +0 -79
- package/dist/restorer/engine/manifest-assembly.js.map +0 -1
- /package/dist/cli/commands/{quickstart.d.ts → ui.d.ts} +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 2 — static analysis on the source bundle.
|
|
3
|
+
*
|
|
4
|
+
* Scope: docs/superpowers/specs/2026-04-23-jinn-execution-envelope-tee-scope.md
|
|
5
|
+
* §3.2 traced-I/O boundary + §4.10 checks (a)–(f).
|
|
6
|
+
*
|
|
7
|
+
* All checks in this file apply at the `attested` tier only.
|
|
8
|
+
* ConformanceContext.sourceBundle is a { files: Map<path, content> }
|
|
9
|
+
* loaded by the harness from executor.source.bundleCid.
|
|
10
|
+
*
|
|
11
|
+
* When ctx.sourceBundle is absent the check returns skipped: true — the
|
|
12
|
+
* harness omits the source bundle at non-attested tiers, so skipping is
|
|
13
|
+
* the correct behaviour rather than failing.
|
|
14
|
+
*
|
|
15
|
+
* No AST parser — regex grep is adequate and simpler for the enumerated
|
|
16
|
+
* patterns (see Plan F non-goals).
|
|
17
|
+
*/
|
|
18
|
+
import type { CheckResult, ConformanceContext } from '../types.js';
|
|
19
|
+
/**
|
|
20
|
+
* Check id: `source.traced-http`
|
|
21
|
+
* Layer: 2
|
|
22
|
+
*
|
|
23
|
+
* Skipped when ctx.sourceBundle is absent.
|
|
24
|
+
*/
|
|
25
|
+
export declare function checkTracedHttpBoundary(ctx: ConformanceContext): CheckResult;
|
|
26
|
+
/**
|
|
27
|
+
* Check id: `source.mcp-shim`
|
|
28
|
+
* Layer: 2
|
|
29
|
+
*
|
|
30
|
+
* Skipped when ctx.sourceBundle is absent.
|
|
31
|
+
*/
|
|
32
|
+
export declare function checkMcpShimBoundary(ctx: ConformanceContext): CheckResult;
|
|
33
|
+
/**
|
|
34
|
+
* Check id: `source.subprocess`
|
|
35
|
+
* Layer: 2
|
|
36
|
+
*
|
|
37
|
+
* Skipped when ctx.sourceBundle is absent.
|
|
38
|
+
*/
|
|
39
|
+
export declare function checkSubprocessBoundary(ctx: ConformanceContext): CheckResult;
|
|
40
|
+
/**
|
|
41
|
+
* Check id: `source.raw-sockets`
|
|
42
|
+
* Layer: 2
|
|
43
|
+
*
|
|
44
|
+
* Skipped when ctx.sourceBundle is absent.
|
|
45
|
+
*/
|
|
46
|
+
export declare function checkRawSockets(ctx: ConformanceContext): CheckResult;
|
|
47
|
+
/**
|
|
48
|
+
* Check id: `source.dynamic-code`
|
|
49
|
+
* Layer: 2
|
|
50
|
+
*
|
|
51
|
+
* Skipped when ctx.sourceBundle is absent.
|
|
52
|
+
* No allowlist — any match is a violation.
|
|
53
|
+
*/
|
|
54
|
+
export declare function checkDynamicCode(ctx: ConformanceContext): CheckResult;
|
|
55
|
+
/**
|
|
56
|
+
* Check id: `source.artifact-emit`
|
|
57
|
+
* Layer: 2
|
|
58
|
+
*
|
|
59
|
+
* Skipped when ctx.sourceBundle is absent.
|
|
60
|
+
*/
|
|
61
|
+
export declare function checkArtifactEmitPath(ctx: ConformanceContext): CheckResult;
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 2 — static analysis on the source bundle.
|
|
3
|
+
*
|
|
4
|
+
* Scope: docs/superpowers/specs/2026-04-23-jinn-execution-envelope-tee-scope.md
|
|
5
|
+
* §3.2 traced-I/O boundary + §4.10 checks (a)–(f).
|
|
6
|
+
*
|
|
7
|
+
* All checks in this file apply at the `attested` tier only.
|
|
8
|
+
* ConformanceContext.sourceBundle is a { files: Map<path, content> }
|
|
9
|
+
* loaded by the harness from executor.source.bundleCid.
|
|
10
|
+
*
|
|
11
|
+
* When ctx.sourceBundle is absent the check returns skipped: true — the
|
|
12
|
+
* harness omits the source bundle at non-attested tiers, so skipping is
|
|
13
|
+
* the correct behaviour rather than failing.
|
|
14
|
+
*
|
|
15
|
+
* No AST parser — regex grep is adequate and simpler for the enumerated
|
|
16
|
+
* patterns (see Plan F non-goals).
|
|
17
|
+
*/
|
|
18
|
+
function scanFiles(files, patterns, allowlist) {
|
|
19
|
+
const hits = [];
|
|
20
|
+
for (const [path, content] of files) {
|
|
21
|
+
if (allowlist.some((a) => path.endsWith(a)))
|
|
22
|
+
continue;
|
|
23
|
+
const lines = content.split('\n');
|
|
24
|
+
for (let i = 0; i < lines.length; i++) {
|
|
25
|
+
const line = lines[i];
|
|
26
|
+
for (const pat of patterns) {
|
|
27
|
+
if (pat.test(line)) {
|
|
28
|
+
hits.push({ path, line: i + 1, text: line.trim() });
|
|
29
|
+
break; // one hit per line is enough
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return hits;
|
|
35
|
+
}
|
|
36
|
+
function hitsToDetail(hits, limit = 3) {
|
|
37
|
+
return hits
|
|
38
|
+
.slice(0, limit)
|
|
39
|
+
.map((h) => `${h.path}:${h.line}: ${h.text.slice(0, 80)}`)
|
|
40
|
+
.join('; ');
|
|
41
|
+
}
|
|
42
|
+
function skip(id) {
|
|
43
|
+
return { id, layer: 2, passed: true, skipped: true };
|
|
44
|
+
}
|
|
45
|
+
// ─── Task 10: traced HTTP boundary ──────────────────────────────────────────
|
|
46
|
+
//
|
|
47
|
+
// Scope §4.10(a): all LLM calls must route through the measured traced-HTTP
|
|
48
|
+
// client wrapper. Flag any file (outside the whitelist) that contains a
|
|
49
|
+
// string literal whose text includes a known LLM provider hostname.
|
|
50
|
+
//
|
|
51
|
+
// Known LLM provider API hosts:
|
|
52
|
+
const LLM_PROVIDER_HOSTS = [
|
|
53
|
+
'api.anthropic.com',
|
|
54
|
+
'api.openai.com',
|
|
55
|
+
'generativelanguage.googleapis.com',
|
|
56
|
+
'api.cohere.com',
|
|
57
|
+
'api.mistral.ai',
|
|
58
|
+
];
|
|
59
|
+
const HTTP_WRAPPER_ALLOWLIST = [
|
|
60
|
+
'src/trajectory/wrappers/http.ts',
|
|
61
|
+
'src/trajectory/wrappers/llm.ts',
|
|
62
|
+
];
|
|
63
|
+
// Matches any quoted-string literal (', ", `) containing an LLM provider hostname.
|
|
64
|
+
const LLM_HOST_PATTERN = new RegExp(`['"\`][^'"\`]*(?:${LLM_PROVIDER_HOSTS.map((h) => h.replace(/\./g, '\\.')).join('|')})[^'"\`]*['"\`]`);
|
|
65
|
+
/**
|
|
66
|
+
* Check id: `source.traced-http`
|
|
67
|
+
* Layer: 2
|
|
68
|
+
*
|
|
69
|
+
* Skipped when ctx.sourceBundle is absent.
|
|
70
|
+
*/
|
|
71
|
+
export function checkTracedHttpBoundary(ctx) {
|
|
72
|
+
const id = 'source.traced-http';
|
|
73
|
+
if (!ctx.sourceBundle)
|
|
74
|
+
return skip(id);
|
|
75
|
+
const hits = scanFiles(ctx.sourceBundle.files, [LLM_HOST_PATTERN], HTTP_WRAPPER_ALLOWLIST);
|
|
76
|
+
if (hits.length === 0)
|
|
77
|
+
return { id, layer: 2, passed: true };
|
|
78
|
+
return {
|
|
79
|
+
id,
|
|
80
|
+
layer: 2,
|
|
81
|
+
passed: false,
|
|
82
|
+
detail: hitsToDetail(hits),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// ─── Task 11: MCP shim boundary ──────────────────────────────────────────────
|
|
86
|
+
//
|
|
87
|
+
// Scope §4.10(b): all MCP calls must go through the measured MCP shim.
|
|
88
|
+
// Flag any file (outside the whitelist) that directly imports
|
|
89
|
+
// @modelcontextprotocol/sdk or instantiates an MCPClient / Client.
|
|
90
|
+
//
|
|
91
|
+
const MCP_WRAPPER_ALLOWLIST = [
|
|
92
|
+
'src/trajectory/wrappers/mcp.ts',
|
|
93
|
+
];
|
|
94
|
+
const MCP_PATTERNS = [
|
|
95
|
+
/from\s+['"]@modelcontextprotocol\/sdk/,
|
|
96
|
+
/require\s*\(\s*['"]@modelcontextprotocol\/sdk/,
|
|
97
|
+
/new\s+(?:MCPClient|Client)\s*\(/,
|
|
98
|
+
];
|
|
99
|
+
/**
|
|
100
|
+
* Check id: `source.mcp-shim`
|
|
101
|
+
* Layer: 2
|
|
102
|
+
*
|
|
103
|
+
* Skipped when ctx.sourceBundle is absent.
|
|
104
|
+
*/
|
|
105
|
+
export function checkMcpShimBoundary(ctx) {
|
|
106
|
+
const id = 'source.mcp-shim';
|
|
107
|
+
if (!ctx.sourceBundle)
|
|
108
|
+
return skip(id);
|
|
109
|
+
const hits = scanFiles(ctx.sourceBundle.files, MCP_PATTERNS, MCP_WRAPPER_ALLOWLIST);
|
|
110
|
+
if (hits.length === 0)
|
|
111
|
+
return { id, layer: 2, passed: true };
|
|
112
|
+
return {
|
|
113
|
+
id,
|
|
114
|
+
layer: 2,
|
|
115
|
+
passed: false,
|
|
116
|
+
detail: hitsToDetail(hits),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
// ─── Task 11: subprocess boundary ────────────────────────────────────────────
|
|
120
|
+
//
|
|
121
|
+
// Scope §4.10(c): no subprocess spawns except through the traced wrapper.
|
|
122
|
+
// Flag child_process / execa / Bun.spawn / Deno.Command usage outside the
|
|
123
|
+
// subprocess wrapper file.
|
|
124
|
+
//
|
|
125
|
+
const SUBPROCESS_WRAPPER_ALLOWLIST = [
|
|
126
|
+
'src/trajectory/wrappers/subprocess.ts',
|
|
127
|
+
];
|
|
128
|
+
const SUBPROCESS_PATTERNS = [
|
|
129
|
+
/from\s+['"](?:node:)?child_process['"]/,
|
|
130
|
+
/require\s*\(\s*['"](?:node:)?child_process['"]\s*\)/,
|
|
131
|
+
/from\s+['"]execa['"]/,
|
|
132
|
+
/require\s*\(\s*['"]execa['"]\s*\)/,
|
|
133
|
+
/\bBun\.spawn\s*\(/,
|
|
134
|
+
/\bDeno\.Command\s*\(/,
|
|
135
|
+
];
|
|
136
|
+
/**
|
|
137
|
+
* Check id: `source.subprocess`
|
|
138
|
+
* Layer: 2
|
|
139
|
+
*
|
|
140
|
+
* Skipped when ctx.sourceBundle is absent.
|
|
141
|
+
*/
|
|
142
|
+
export function checkSubprocessBoundary(ctx) {
|
|
143
|
+
const id = 'source.subprocess';
|
|
144
|
+
if (!ctx.sourceBundle)
|
|
145
|
+
return skip(id);
|
|
146
|
+
const hits = scanFiles(ctx.sourceBundle.files, SUBPROCESS_PATTERNS, SUBPROCESS_WRAPPER_ALLOWLIST);
|
|
147
|
+
if (hits.length === 0)
|
|
148
|
+
return { id, layer: 2, passed: true };
|
|
149
|
+
return {
|
|
150
|
+
id,
|
|
151
|
+
layer: 2,
|
|
152
|
+
passed: false,
|
|
153
|
+
detail: hitsToDetail(hits),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
// ─── Task 12: raw sockets ─────────────────────────────────────────────────────
|
|
157
|
+
//
|
|
158
|
+
// Scope §4.10(d): no raw TCP/TLS sockets outside measured wrappers.
|
|
159
|
+
// Flag net.createConnection, tls.connect, and their imports outside
|
|
160
|
+
// the socket/HTTP wrapper files.
|
|
161
|
+
//
|
|
162
|
+
const SOCKET_WRAPPER_ALLOWLIST = [
|
|
163
|
+
'src/trajectory/wrappers/socket.ts',
|
|
164
|
+
'src/trajectory/wrappers/http.ts',
|
|
165
|
+
];
|
|
166
|
+
const SOCKET_PATTERNS = [
|
|
167
|
+
/\bnet\.createConnection\s*\(/,
|
|
168
|
+
/\btls\.connect\s*\(/,
|
|
169
|
+
/\bdgram\.createSocket\s*\(/,
|
|
170
|
+
/from\s+['"](?:node:)?net['"]/,
|
|
171
|
+
/from\s+['"](?:node:)?tls['"]/,
|
|
172
|
+
/from\s+['"](?:node:)?dgram['"]/,
|
|
173
|
+
/require\s*\(\s*['"](?:node:)?(?:net|tls|dgram)['"]\s*\)/,
|
|
174
|
+
];
|
|
175
|
+
/**
|
|
176
|
+
* Check id: `source.raw-sockets`
|
|
177
|
+
* Layer: 2
|
|
178
|
+
*
|
|
179
|
+
* Skipped when ctx.sourceBundle is absent.
|
|
180
|
+
*/
|
|
181
|
+
export function checkRawSockets(ctx) {
|
|
182
|
+
const id = 'source.raw-sockets';
|
|
183
|
+
if (!ctx.sourceBundle)
|
|
184
|
+
return skip(id);
|
|
185
|
+
const hits = scanFiles(ctx.sourceBundle.files, SOCKET_PATTERNS, SOCKET_WRAPPER_ALLOWLIST);
|
|
186
|
+
if (hits.length === 0)
|
|
187
|
+
return { id, layer: 2, passed: true };
|
|
188
|
+
return {
|
|
189
|
+
id,
|
|
190
|
+
layer: 2,
|
|
191
|
+
passed: false,
|
|
192
|
+
detail: hitsToDetail(hits),
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function scanDynamicCode(files) {
|
|
196
|
+
const hits = [];
|
|
197
|
+
for (const [path, content] of files) {
|
|
198
|
+
const lines = content.split('\n');
|
|
199
|
+
for (let i = 0; i < lines.length; i++) {
|
|
200
|
+
const line = lines[i];
|
|
201
|
+
if (/\beval\s*\(/.test(line)) {
|
|
202
|
+
hits.push({ path, line: i + 1, text: line.trim(), reason: 'eval' });
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
if (/\bnew\s+Function\s*\(/.test(line)) {
|
|
206
|
+
hits.push({ path, line: i + 1, text: line.trim(), reason: 'new Function' });
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
if (/\bvm\.runIn[A-Za-z]+\s*\(/.test(line)) {
|
|
210
|
+
hits.push({ path, line: i + 1, text: line.trim(), reason: 'vm.runIn*' });
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
// Dynamic import() — check argument.
|
|
214
|
+
const importMatch = line.match(/\bimport\s*\(\s*([^)]+)\)/);
|
|
215
|
+
if (importMatch) {
|
|
216
|
+
const arg = importMatch[1].trim();
|
|
217
|
+
// Allow: string literals that start with ./ or ../ (relative) or node: (built-in).
|
|
218
|
+
const isStaticAllowed = /^['"](?:\.\.?\/[^'"]+|node:[^'"]+)['"]$/.test(arg);
|
|
219
|
+
if (!isStaticAllowed) {
|
|
220
|
+
hits.push({
|
|
221
|
+
path,
|
|
222
|
+
line: i + 1,
|
|
223
|
+
text: line.trim(),
|
|
224
|
+
reason: 'dynamic import with non-literal or non-relative/node: argument',
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return hits;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Check id: `source.dynamic-code`
|
|
234
|
+
* Layer: 2
|
|
235
|
+
*
|
|
236
|
+
* Skipped when ctx.sourceBundle is absent.
|
|
237
|
+
* No allowlist — any match is a violation.
|
|
238
|
+
*/
|
|
239
|
+
export function checkDynamicCode(ctx) {
|
|
240
|
+
const id = 'source.dynamic-code';
|
|
241
|
+
if (!ctx.sourceBundle)
|
|
242
|
+
return skip(id);
|
|
243
|
+
const hits = scanDynamicCode(ctx.sourceBundle.files);
|
|
244
|
+
if (hits.length === 0)
|
|
245
|
+
return { id, layer: 2, passed: true };
|
|
246
|
+
return {
|
|
247
|
+
id,
|
|
248
|
+
layer: 2,
|
|
249
|
+
passed: false,
|
|
250
|
+
detail: hits
|
|
251
|
+
.slice(0, 3)
|
|
252
|
+
.map((h) => `${h.path}:${h.line} [${h.reason}]: ${h.text.slice(0, 80)}`)
|
|
253
|
+
.join('; '),
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
// ─── Task 13: artifact emit helper ───────────────────────────────────────────
|
|
257
|
+
//
|
|
258
|
+
// Scope §4.10(f): artifact emission must go through the canonical helper
|
|
259
|
+
// (emitArtifact or the packaging module). Flag files that import fs AND
|
|
260
|
+
// look artifact-related (ipfs / uploadToIpfs / .cid) AND call fs.writeFile
|
|
261
|
+
// directly, unless the file is in the allowlist.
|
|
262
|
+
//
|
|
263
|
+
const ARTIFACT_HELPER_ALLOWLIST = [
|
|
264
|
+
'src/trajectory/artifacts.ts',
|
|
265
|
+
'src/restorer/engine/packaging.ts',
|
|
266
|
+
];
|
|
267
|
+
/**
|
|
268
|
+
* Check id: `source.artifact-emit`
|
|
269
|
+
* Layer: 2
|
|
270
|
+
*
|
|
271
|
+
* Skipped when ctx.sourceBundle is absent.
|
|
272
|
+
*/
|
|
273
|
+
export function checkArtifactEmitPath(ctx) {
|
|
274
|
+
const id = 'source.artifact-emit';
|
|
275
|
+
if (!ctx.sourceBundle)
|
|
276
|
+
return skip(id);
|
|
277
|
+
const hits = [];
|
|
278
|
+
for (const [path, content] of ctx.sourceBundle.files) {
|
|
279
|
+
if (ARTIFACT_HELPER_ALLOWLIST.some((a) => path.endsWith(a)))
|
|
280
|
+
continue;
|
|
281
|
+
// Gate 1: file must import fs (otherwise it can't do raw writes).
|
|
282
|
+
const importsFs = /from\s+['"](?:node:)?fs(?:\/promises)?['"]/.test(content) ||
|
|
283
|
+
/require\s*\(\s*['"](?:node:)?fs(?:\/promises)?['"]\s*\)/.test(content);
|
|
284
|
+
if (!importsFs)
|
|
285
|
+
continue;
|
|
286
|
+
// Gate 2: file must look like it produces artifacts (IPFS / CID semantics).
|
|
287
|
+
const looksArtifacty = /\bipfs\b/i.test(content) ||
|
|
288
|
+
/uploadToIpfs/.test(content) ||
|
|
289
|
+
/\.cid\b/.test(content) ||
|
|
290
|
+
/emitArtifact/.test(content);
|
|
291
|
+
if (!looksArtifacty)
|
|
292
|
+
continue;
|
|
293
|
+
// Flag: raw fs write calls inside this artifact-related fs-importing file.
|
|
294
|
+
const lines = content.split('\n');
|
|
295
|
+
for (let i = 0; i < lines.length; i++) {
|
|
296
|
+
if (/\bfs\.(?:writeFile|writeFileSync|createWriteStream)\s*\(/.test(lines[i]) ||
|
|
297
|
+
/\bwriteFile\s*\(/.test(lines[i])) {
|
|
298
|
+
hits.push({ path, line: i + 1, text: lines[i].trim() });
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
if (hits.length === 0)
|
|
303
|
+
return { id, layer: 2, passed: true };
|
|
304
|
+
return {
|
|
305
|
+
id,
|
|
306
|
+
layer: 2,
|
|
307
|
+
passed: false,
|
|
308
|
+
detail: hitsToDetail(hits),
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
//# sourceMappingURL=source-static.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-static.js","sourceRoot":"","sources":["../../../src/conformance/checks/source-static.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,SAAS,SAAS,CAChB,KAA0B,EAC1B,QAAkB,EAClB,SAAmB;IAEnB,MAAM,IAAI,GAAU,EAAE,CAAC;IACvB,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,KAAK,EAAE,CAAC;QACpC,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAAE,SAAS;QACtD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACtB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;gBAC3B,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACnB,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;oBACpD,MAAM,CAAC,6BAA6B;gBACtC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,YAAY,CAAC,IAAW,EAAE,KAAK,GAAG,CAAC;IAC1C,O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AC,CAAC;QAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,IACE,0DAA0D,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACzE,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACjC,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7D,OAAO;QACL,EAAE;QACF,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 1 trajectory check: hash-chain integrity.
|
|
3
|
+
*
|
|
4
|
+
* Scope: docs/superpowers/specs/2026-04-23-jinn-execution-envelope-tee-scope.md
|
|
5
|
+
* §3.1 trajectory-signing-granularity row.
|
|
6
|
+
*
|
|
7
|
+
* Walks every span in order:
|
|
8
|
+
* - span[0].jinn.prevSpanHash must equal computeGenesisHash(envelope.intent.cid)
|
|
9
|
+
* - span[n].jinn.prevSpanHash must equal computePrevSpanHash(span[n-1])
|
|
10
|
+
*
|
|
11
|
+
* Skipped when trajectory is absent.
|
|
12
|
+
*/
|
|
13
|
+
import type { CheckResult, ConformanceContext } from '../types.js';
|
|
14
|
+
/**
|
|
15
|
+
* Check id: `trajectory.hash-chain`
|
|
16
|
+
* Layer: 1
|
|
17
|
+
*/
|
|
18
|
+
export declare function checkHashChainIntegrity(ctx: ConformanceContext): CheckResult;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 1 trajectory check: hash-chain integrity.
|
|
3
|
+
*
|
|
4
|
+
* Scope: docs/superpowers/specs/2026-04-23-jinn-execution-envelope-tee-scope.md
|
|
5
|
+
* §3.1 trajectory-signing-granularity row.
|
|
6
|
+
*
|
|
7
|
+
* Walks every span in order:
|
|
8
|
+
* - span[0].jinn.prevSpanHash must equal computeGenesisHash(envelope.intent.cid)
|
|
9
|
+
* - span[n].jinn.prevSpanHash must equal computePrevSpanHash(span[n-1])
|
|
10
|
+
*
|
|
11
|
+
* Skipped when trajectory is absent.
|
|
12
|
+
*/
|
|
13
|
+
import { computeGenesisHash, computePrevSpanHash } from '../../trajectory/hash-chain.js';
|
|
14
|
+
/**
|
|
15
|
+
* Check id: `trajectory.hash-chain`
|
|
16
|
+
* Layer: 1
|
|
17
|
+
*/
|
|
18
|
+
export function checkHashChainIntegrity(ctx) {
|
|
19
|
+
const id = 'trajectory.hash-chain';
|
|
20
|
+
const layer = 1;
|
|
21
|
+
const traj = ctx.trajectory;
|
|
22
|
+
if (!traj)
|
|
23
|
+
return { id, layer, passed: true, skipped: true };
|
|
24
|
+
const intentCid = ctx.envelope?.intent?.cid;
|
|
25
|
+
if (!intentCid) {
|
|
26
|
+
return {
|
|
27
|
+
id,
|
|
28
|
+
layer,
|
|
29
|
+
passed: false,
|
|
30
|
+
detail: 'envelope.intent.cid missing; cannot compute genesis hash',
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const genesis = computeGenesisHash(intentCid);
|
|
34
|
+
let expectedPrev = genesis;
|
|
35
|
+
for (let i = 0; i < traj.spans.length; i++) {
|
|
36
|
+
const span = traj.spans[i];
|
|
37
|
+
const declared = span.attributes['jinn.prevSpanHash'];
|
|
38
|
+
if (typeof declared !== 'string' ||
|
|
39
|
+
declared.toLowerCase() !== expectedPrev.toLowerCase()) {
|
|
40
|
+
return {
|
|
41
|
+
id,
|
|
42
|
+
layer,
|
|
43
|
+
passed: false,
|
|
44
|
+
detail: `span[${i}] (${span.spanId}): prevSpanHash ${declared} !== expected ${expectedPrev}${i === 0 ? ' (genesis)' : ''}`,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
expectedPrev = computePrevSpanHash(span);
|
|
48
|
+
}
|
|
49
|
+
return { id, layer, passed: true };
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=trajectory-chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trajectory-chain.js","sourceRoot":"","sources":["../../../src/conformance/checks/trajectory-chain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAKzF;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAuB;IAC7D,MAAM,EAAE,GAAG,uBAAuB,CAAC;IACnC,MAAM,KAAK,GAAG,CAAU,CAAC;IAEzB,MAAM,IAAI,GAAG,GAAG,CAAC,UAAyC,CAAC;IAC3D,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAE7D,MAAM,SAAS,GAAI,GAAG,CAAC,QAAsD,EAAE,MAAM,EAAE,GAAG,CAAC;IAC3F,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO;YACL,EAAE;YACF,KAAK;YACL,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,0DAA0D;SACnE,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC9C,IAAI,YAAY,GAAW,OAAO,CAAC;IAEnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAuB,CAAC;QAE5E,IACE,OAAO,QAAQ,KAAK,QAAQ;YAC5B,QAAQ,CAAC,WAAW,EAAE,KAAK,YAAY,CAAC,WAAW,EAAE,EACrD,CAAC;YACD,OAAO;gBACL,EAAE;gBACF,KAAK;gBACL,MAAM,EAAE,KAAK;gBACb,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,mBAAmB,QAAQ,iBAAiB,YAAY,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE;aAC3H,CAAC;QACJ,CAAC;QAED,YAAY,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 1 trajectory check: span profile conformance.
|
|
3
|
+
*
|
|
4
|
+
* Scope: docs/superpowers/specs/2026-04-23-jinn-execution-envelope-tee-scope.md §3.1 K6.
|
|
5
|
+
*
|
|
6
|
+
* For every span in the trajectory, verifies that the required attributes
|
|
7
|
+
* declared in SPAN_PROFILE[jinn.span.kind] are present. Unknown span kinds
|
|
8
|
+
* fail immediately. Reports up to 5 failures to bound message length.
|
|
9
|
+
*
|
|
10
|
+
* Skipped when trajectory is absent.
|
|
11
|
+
*/
|
|
12
|
+
import type { CheckResult, ConformanceContext } from '../types.js';
|
|
13
|
+
/**
|
|
14
|
+
* Check id: `trajectory.span-profile`
|
|
15
|
+
* Layer: 1
|
|
16
|
+
*/
|
|
17
|
+
export declare function checkSpanProfile(ctx: ConformanceContext): CheckResult;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 1 trajectory check: span profile conformance.
|
|
3
|
+
*
|
|
4
|
+
* Scope: docs/superpowers/specs/2026-04-23-jinn-execution-envelope-tee-scope.md §3.1 K6.
|
|
5
|
+
*
|
|
6
|
+
* For every span in the trajectory, verifies that the required attributes
|
|
7
|
+
* declared in SPAN_PROFILE[jinn.span.kind] are present. Unknown span kinds
|
|
8
|
+
* fail immediately. Reports up to 5 failures to bound message length.
|
|
9
|
+
*
|
|
10
|
+
* Skipped when trajectory is absent.
|
|
11
|
+
*/
|
|
12
|
+
import { SPAN_PROFILE, validateSpanProfile } from '../../trajectory/span-profile.js';
|
|
13
|
+
/**
|
|
14
|
+
* Check id: `trajectory.span-profile`
|
|
15
|
+
* Layer: 1
|
|
16
|
+
*/
|
|
17
|
+
export function checkSpanProfile(ctx) {
|
|
18
|
+
const id = 'trajectory.span-profile';
|
|
19
|
+
const layer = 1;
|
|
20
|
+
const traj = ctx.trajectory;
|
|
21
|
+
if (!traj)
|
|
22
|
+
return { id, layer, passed: true, skipped: true };
|
|
23
|
+
const failures = [];
|
|
24
|
+
for (let i = 0; i < traj.spans.length; i++) {
|
|
25
|
+
const span = traj.spans[i];
|
|
26
|
+
const kind = span.attributes['jinn.span.kind'];
|
|
27
|
+
if (!kind) {
|
|
28
|
+
failures.push(`span[${i}] (${span.spanId}) missing jinn.span.kind`);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
// Unknown kind check (SPAN_PROFILE only has normative kinds)
|
|
32
|
+
if (!(kind in SPAN_PROFILE)) {
|
|
33
|
+
failures.push(`span[${i}] (${span.spanId}) unknown jinn.span.kind: ${kind}`);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const result = validateSpanProfile(span);
|
|
37
|
+
if (!result.valid) {
|
|
38
|
+
const missingList = result.missing.join(', ');
|
|
39
|
+
failures.push(`span[${i}] (${span.spanId}) kind=${kind} missing required attributes: ${missingList}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (failures.length === 0)
|
|
43
|
+
return { id, layer, passed: true };
|
|
44
|
+
return {
|
|
45
|
+
id,
|
|
46
|
+
layer,
|
|
47
|
+
passed: false,
|
|
48
|
+
detail: failures.slice(0, 5).join('; '),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=trajectory-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trajectory-profile.js","sourceRoot":"","sources":["../../../src/conformance/checks/trajectory-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAKrF;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAuB;IACtD,MAAM,EAAE,GAAG,yBAAyB,CAAC;IACrC,MAAM,KAAK,GAAG,CAAU,CAAC;IAEzB,MAAM,IAAI,GAAG,GAAG,CAAC,UAAyC,CAAC;IAC3D,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAE7D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAuB,CAAC;QAErE,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,0BAA0B,CAAC,CAAC;YACpE,SAAS;QACX,CAAC;QAED,6DAA6D;QAC7D,IAAI,CAAC,CAAC,IAAI,IAAI,YAAY,CAAC,EAAE,CAAC;YAC5B,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,6BAA6B,IAAI,EAAE,CAAC,CAAC;YAC7E,SAAS;QACX,CAAC;QAED,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAClB,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC9C,QAAQ,CAAC,IAAI,CACX,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,UAAU,IAAI,iCAAiC,WAAW,EAAE,CACvF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAE9D,OAAO;QACL,EAAE;QACF,KAAK;QACL,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;KACxC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 1 trajectory check: schema conformance.
|
|
3
|
+
*
|
|
4
|
+
* Scope: docs/superpowers/specs/2026-04-23-jinn-execution-envelope-tee-scope.md
|
|
5
|
+
* §3.1 trajectory row + K6 span profile.
|
|
6
|
+
*
|
|
7
|
+
* Validates the trajectory against JinnTrajectoryV1Schema. Skipped when
|
|
8
|
+
* envelope.trajectory is null (legitimate at self-signed / committed tier
|
|
9
|
+
* during V1 rollout).
|
|
10
|
+
*/
|
|
11
|
+
import type { CheckResult, ConformanceContext } from '../types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Check id: `trajectory.schema`
|
|
14
|
+
* Layer: 1
|
|
15
|
+
*
|
|
16
|
+
* If ctx.envelope.trajectory is null (no trajectory in envelope) AND
|
|
17
|
+
* ctx.trajectory is falsy, return a SKIP. Otherwise validate against
|
|
18
|
+
* JinnTrajectoryV1Schema.
|
|
19
|
+
*/
|
|
20
|
+
export declare function checkTrajectorySchema(ctx: ConformanceContext): CheckResult;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 1 trajectory check: schema conformance.
|
|
3
|
+
*
|
|
4
|
+
* Scope: docs/superpowers/specs/2026-04-23-jinn-execution-envelope-tee-scope.md
|
|
5
|
+
* §3.1 trajectory row + K6 span profile.
|
|
6
|
+
*
|
|
7
|
+
* Validates the trajectory against JinnTrajectoryV1Schema. Skipped when
|
|
8
|
+
* envelope.trajectory is null (legitimate at self-signed / committed tier
|
|
9
|
+
* during V1 rollout).
|
|
10
|
+
*/
|
|
11
|
+
import { JinnTrajectoryV1Schema } from '../../trajectory/schema.js';
|
|
12
|
+
/**
|
|
13
|
+
* Check id: `trajectory.schema`
|
|
14
|
+
* Layer: 1
|
|
15
|
+
*
|
|
16
|
+
* If ctx.envelope.trajectory is null (no trajectory in envelope) AND
|
|
17
|
+
* ctx.trajectory is falsy, return a SKIP. Otherwise validate against
|
|
18
|
+
* JinnTrajectoryV1Schema.
|
|
19
|
+
*/
|
|
20
|
+
export function checkTrajectorySchema(ctx) {
|
|
21
|
+
const id = 'trajectory.schema';
|
|
22
|
+
const layer = 1;
|
|
23
|
+
// Skip when envelope explicitly carries null trajectory (no trajectory in run).
|
|
24
|
+
if (ctx.envelope?.trajectory == null && ctx.trajectory == null) {
|
|
25
|
+
return { id, layer, passed: true, skipped: true, detail: 'envelope.trajectory is null' };
|
|
26
|
+
}
|
|
27
|
+
const result = JinnTrajectoryV1Schema.safeParse(ctx.trajectory);
|
|
28
|
+
if (result.success) {
|
|
29
|
+
return { id, layer, passed: true };
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
id,
|
|
33
|
+
layer,
|
|
34
|
+
passed: false,
|
|
35
|
+
detail: result.error.issues
|
|
36
|
+
.map((i) => `${i.path.join('.')}: ${i.message}`)
|
|
37
|
+
.join('; '),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=trajectory-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trajectory-schema.js","sourceRoot":"","sources":["../../../src/conformance/checks/trajectory-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAuB;IAC3D,MAAM,EAAE,GAAG,mBAAmB,CAAC;IAC/B,MAAM,KAAK,GAAG,CAAU,CAAC;IAEzB,gFAAgF;IAChF,IAAI,GAAG,CAAC,QAAQ,EAAE,UAAU,IAAI,IAAI,IAAI,GAAG,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;QAC/D,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,6BAA6B,EAAE,CAAC;IAC3F,CAAC;IAED,MAAM,MAAM,GAAG,sBAAsB,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAChE,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrC,CAAC;IAED,OAAO;QACL,EAAE;QACF,KAAK;QACL,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;aACxB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;aAC/C,IAAI,CAAC,IAAI,CAAC;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 1 verdict-specific checks.
|
|
3
|
+
*
|
|
4
|
+
* Scope: docs/superpowers/specs/2026-04-23-jinn-execution-envelope-tee-scope.md §3.3.
|
|
5
|
+
*
|
|
6
|
+
* Verdict envelopes must carry:
|
|
7
|
+
* - payload.restorationEnvelope: { cid, sha256 } — back-reference to the
|
|
8
|
+
* restoration envelope being evaluated. V1: CID shape-only check; sha256
|
|
9
|
+
* verified against ctx.restorationEnvelopeBytes when provided.
|
|
10
|
+
* - payload.verificationOfRestoration: { claimedTier, sdkVersion, timestamp,
|
|
11
|
+
* checks[], overall } — structural validity.
|
|
12
|
+
*
|
|
13
|
+
* Both checks skip silently on restoration-role envelopes.
|
|
14
|
+
*/
|
|
15
|
+
import type { CheckResult, ConformanceContext } from '../types.js';
|
|
16
|
+
/**
|
|
17
|
+
* Check id: `verdict.back-ref`
|
|
18
|
+
* Layer: 1
|
|
19
|
+
*
|
|
20
|
+
* For verdict-role envelopes:
|
|
21
|
+
* 1. payload.restorationEnvelope must be present with string `cid` + `sha256`.
|
|
22
|
+
* 2. If ctx.restorationEnvelopeBytes is provided, sha256(bytes) must match
|
|
23
|
+
* payload.restorationEnvelope.sha256.
|
|
24
|
+
* 3. If ctx.restorationEnvelopeBytes is NOT provided, fail — restoration
|
|
25
|
+
* CID did not resolve.
|
|
26
|
+
*
|
|
27
|
+
* Skipped on restoration-role envelopes.
|
|
28
|
+
*/
|
|
29
|
+
export declare function checkVerdictBackReference(ctx: ConformanceContext): CheckResult;
|
|
30
|
+
/**
|
|
31
|
+
* Check id: `verdict.verification-record`
|
|
32
|
+
* Layer: 1
|
|
33
|
+
*
|
|
34
|
+
* For verdict-role envelopes:
|
|
35
|
+
* payload.verificationOfRestoration must be present and structurally valid:
|
|
36
|
+
* - claimedTier: string
|
|
37
|
+
* - sdkVersion: string
|
|
38
|
+
* - timestamp: number
|
|
39
|
+
* - checks: nonempty array
|
|
40
|
+
* - overall: 'valid' | 'invalid'
|
|
41
|
+
*
|
|
42
|
+
* Skipped on restoration-role envelopes.
|
|
43
|
+
*/
|
|
44
|
+
export declare function checkVerificationRecord(ctx: ConformanceContext): CheckResult;
|