@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,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TrajectoryCollector — in-memory span accumulator.
|
|
3
|
+
*
|
|
4
|
+
* Invariants (enforced on add):
|
|
5
|
+
* - span.traceId is shared across all spans in a run (set at construction)
|
|
6
|
+
* - span.spanId is 16 hex chars unique per span
|
|
7
|
+
* - span.attributes['jinn.prevSpanHash'] is set to genesis (for first span)
|
|
8
|
+
* or the keccak256(JCS(previous finalized span)) on add — callers do NOT
|
|
9
|
+
* set it.
|
|
10
|
+
* - span.attributes['jinn.span.kind'] MUST be supplied by the caller.
|
|
11
|
+
* - secrets are scrubbed from BOTH span.attributes AND span.events[*].attributes
|
|
12
|
+
* before the span is appended; redacted keys are recorded against this
|
|
13
|
+
* span's spanId in the redactionManifest.
|
|
14
|
+
*/
|
|
15
|
+
import type { Span, RedactionManifest } from './schema.js';
|
|
16
|
+
export interface CollectorInit {
|
|
17
|
+
intentCid: string;
|
|
18
|
+
runId: string;
|
|
19
|
+
/** Override for tests. Defaults to randomBytes(16). */
|
|
20
|
+
traceId?: string;
|
|
21
|
+
}
|
|
22
|
+
/** Caller-supplied span input. Omits chain + id fields the collector assigns. */
|
|
23
|
+
export interface SpanInput {
|
|
24
|
+
name: string;
|
|
25
|
+
kind: Span['kind'];
|
|
26
|
+
startTimeUnixNano: string;
|
|
27
|
+
endTimeUnixNano: string;
|
|
28
|
+
attributes: Record<string, unknown>;
|
|
29
|
+
events: Span['events'];
|
|
30
|
+
status: Span['status'];
|
|
31
|
+
parentSpanId?: string | null;
|
|
32
|
+
}
|
|
33
|
+
export declare class TrajectoryCollector {
|
|
34
|
+
readonly runId: string;
|
|
35
|
+
readonly intentCid: string;
|
|
36
|
+
private readonly traceId;
|
|
37
|
+
private readonly spans;
|
|
38
|
+
private readonly redactionEntries;
|
|
39
|
+
private totalRedactions;
|
|
40
|
+
private lastSpanHash;
|
|
41
|
+
constructor(init: CollectorInit);
|
|
42
|
+
/** Append a span; returns the finalized span (with assigned ids + chain hash). */
|
|
43
|
+
addSpan(input: SpanInput): Span;
|
|
44
|
+
/** Immutable snapshot for emit / tests. */
|
|
45
|
+
snapshot(): {
|
|
46
|
+
spans: Span[];
|
|
47
|
+
redactionManifest: RedactionManifest;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TrajectoryCollector — in-memory span accumulator.
|
|
3
|
+
*
|
|
4
|
+
* Invariants (enforced on add):
|
|
5
|
+
* - span.traceId is shared across all spans in a run (set at construction)
|
|
6
|
+
* - span.spanId is 16 hex chars unique per span
|
|
7
|
+
* - span.attributes['jinn.prevSpanHash'] is set to genesis (for first span)
|
|
8
|
+
* or the keccak256(JCS(previous finalized span)) on add — callers do NOT
|
|
9
|
+
* set it.
|
|
10
|
+
* - span.attributes['jinn.span.kind'] MUST be supplied by the caller.
|
|
11
|
+
* - secrets are scrubbed from BOTH span.attributes AND span.events[*].attributes
|
|
12
|
+
* before the span is appended; redacted keys are recorded against this
|
|
13
|
+
* span's spanId in the redactionManifest.
|
|
14
|
+
*/
|
|
15
|
+
import { randomBytes } from 'node:crypto';
|
|
16
|
+
import { computeGenesisHash, computePrevSpanHash } from './hash-chain.js';
|
|
17
|
+
import { scrubAttributes } from './secret-scrub.js';
|
|
18
|
+
function hex(bytes) {
|
|
19
|
+
return randomBytes(bytes).toString('hex');
|
|
20
|
+
}
|
|
21
|
+
export class TrajectoryCollector {
|
|
22
|
+
runId;
|
|
23
|
+
intentCid;
|
|
24
|
+
traceId;
|
|
25
|
+
spans = [];
|
|
26
|
+
redactionEntries = [];
|
|
27
|
+
totalRedactions = 0;
|
|
28
|
+
lastSpanHash;
|
|
29
|
+
constructor(init) {
|
|
30
|
+
this.runId = init.runId;
|
|
31
|
+
this.intentCid = init.intentCid;
|
|
32
|
+
this.traceId = init.traceId ?? hex(16);
|
|
33
|
+
this.lastSpanHash = computeGenesisHash(init.intentCid);
|
|
34
|
+
}
|
|
35
|
+
/** Append a span; returns the finalized span (with assigned ids + chain hash). */
|
|
36
|
+
addSpan(input) {
|
|
37
|
+
if (typeof input.attributes['jinn.span.kind'] !== 'string') {
|
|
38
|
+
throw new Error('TrajectoryCollector.addSpan: jinn.span.kind attribute required');
|
|
39
|
+
}
|
|
40
|
+
const { scrubbed, redactedKeys } = scrubAttributes(input.attributes);
|
|
41
|
+
// Scrub event attributes — raw subprocess output (and any other event data)
|
|
42
|
+
// can contain tokens, passwords, or private keys in their attribute values.
|
|
43
|
+
const scrubbedEvents = input.events.map((event) => {
|
|
44
|
+
if (!event.attributes || Object.keys(event.attributes).length === 0)
|
|
45
|
+
return event;
|
|
46
|
+
const { scrubbed: scrubbedAttrs, redactedKeys: eventRedacted } = scrubAttributes(event.attributes);
|
|
47
|
+
for (const k of eventRedacted) {
|
|
48
|
+
redactedKeys.push(k);
|
|
49
|
+
}
|
|
50
|
+
return { ...event, attributes: scrubbedAttrs };
|
|
51
|
+
});
|
|
52
|
+
const span = {
|
|
53
|
+
traceId: this.traceId,
|
|
54
|
+
spanId: hex(8),
|
|
55
|
+
parentSpanId: input.parentSpanId ?? null,
|
|
56
|
+
name: input.name,
|
|
57
|
+
kind: input.kind,
|
|
58
|
+
startTimeUnixNano: input.startTimeUnixNano,
|
|
59
|
+
endTimeUnixNano: input.endTimeUnixNano,
|
|
60
|
+
attributes: {
|
|
61
|
+
...scrubbed,
|
|
62
|
+
'jinn.prevSpanHash': this.lastSpanHash,
|
|
63
|
+
},
|
|
64
|
+
events: scrubbedEvents,
|
|
65
|
+
status: input.status,
|
|
66
|
+
};
|
|
67
|
+
this.spans.push(span);
|
|
68
|
+
this.lastSpanHash = computePrevSpanHash(span);
|
|
69
|
+
if (redactedKeys.length > 0) {
|
|
70
|
+
this.redactionEntries.push({ spanId: span.spanId, redactedKeys });
|
|
71
|
+
this.totalRedactions += redactedKeys.length;
|
|
72
|
+
}
|
|
73
|
+
return span;
|
|
74
|
+
}
|
|
75
|
+
/** Immutable snapshot for emit / tests. */
|
|
76
|
+
snapshot() {
|
|
77
|
+
return {
|
|
78
|
+
spans: this.spans.slice(),
|
|
79
|
+
redactionManifest: {
|
|
80
|
+
spans: this.redactionEntries.slice(),
|
|
81
|
+
totalRedactions: this.totalRedactions,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=collector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../../src/trajectory/collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,SAAS,GAAG,CAAC,KAAa;IACxB,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC;AAqBD,MAAM,OAAO,mBAAmB;IACrB,KAAK,CAAS;IACd,SAAS,CAAS;IACV,OAAO,CAAS;IAChB,KAAK,GAAW,EAAE,CAAC;IACnB,gBAAgB,GAA+B,EAAE,CAAC;IAC3D,eAAe,GAAG,CAAC,CAAC;IACpB,YAAY,CAAS;IAE7B,YAAY,IAAmB;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,GAAG,CAAC,EAAE,CAAC,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;IAED,kFAAkF;IAClF,OAAO,CAAC,KAAgB;QACtB,IAAI,OAAO,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,QAAQ,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;QACpF,CAAC;QAED,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAErE,4EAA4E;QAC5E,4EAA4E;QAC5E,MAAM,cAAc,GAAmB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YAChE,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC;YAClF,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,eAAe,CAC9E,KAAK,CAAC,UAAqC,CAC5C,CAAC;YACF,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC;gBAC9B,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACvB,CAAC;YACD,OAAO,EAAE,GAAG,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;QACjD,CAAC,CAAC,CAAC;QAEH,MAAM,IAAI,GAAS;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;YACd,YAAY,EAAE,KAAK,CAAC,YAAY,IAAI,IAAI;YACxC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;YAC1C,eAAe,EAAE,KAAK,CAAC,eAAe;YACtC,UAAU,EAAE;gBACV,GAAG,QAAQ;gBACX,mBAAmB,EAAE,IAAI,CAAC,YAAY;aACvC;YACD,MAAM,EAAE,cAAc;YACtB,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC;QAEF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAE9C,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;YAClE,IAAI,CAAC,eAAe,IAAI,YAAY,CAAC,MAAM,CAAC;QAC9C,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,2CAA2C;IAC3C,QAAQ;QACN,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;YACzB,iBAAiB,EAAE;gBACjB,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE;gBACpC,eAAe,EAAE,IAAI,CAAC,eAAe;aACtC;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emit a signed jinn.trajectory.v1 blob and upload it to IPFS.
|
|
3
|
+
*
|
|
4
|
+
* Signing mirrors envelope-assembly.ts (§4.2a mechanics):
|
|
5
|
+
* hash = keccak256(JCS(trajectory minus signature))
|
|
6
|
+
* → signed with agent EOA key
|
|
7
|
+
* → signed blob uploaded to IPFS
|
|
8
|
+
* → { cid, sha256 } returned for the envelope.
|
|
9
|
+
*/
|
|
10
|
+
import { type Hex } from 'viem';
|
|
11
|
+
import type { TrajectoryCollector } from './collector.js';
|
|
12
|
+
import type { JinnTrajectoryV1 } from './schema.js';
|
|
13
|
+
export interface EmitTrajectoryParams {
|
|
14
|
+
collector: TrajectoryCollector;
|
|
15
|
+
runId: string;
|
|
16
|
+
/** Set to the parent restoration envelope CID for a verdict trajectory; null otherwise. */
|
|
17
|
+
parentEnvelopeCid?: string | null;
|
|
18
|
+
signerPrivateKey: Hex;
|
|
19
|
+
signerAddress: `0x${string}`;
|
|
20
|
+
ipfsRegistryUrl: string;
|
|
21
|
+
}
|
|
22
|
+
export interface EmitTrajectoryResult {
|
|
23
|
+
cid: string;
|
|
24
|
+
sha256: string;
|
|
25
|
+
signed: JinnTrajectoryV1;
|
|
26
|
+
}
|
|
27
|
+
export declare function emitTrajectory(p: EmitTrajectoryParams): Promise<EmitTrajectoryResult>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emit a signed jinn.trajectory.v1 blob and upload it to IPFS.
|
|
3
|
+
*
|
|
4
|
+
* Signing mirrors envelope-assembly.ts (§4.2a mechanics):
|
|
5
|
+
* hash = keccak256(JCS(trajectory minus signature))
|
|
6
|
+
* → signed with agent EOA key
|
|
7
|
+
* → signed blob uploaded to IPFS
|
|
8
|
+
* → { cid, sha256 } returned for the envelope.
|
|
9
|
+
*/
|
|
10
|
+
import { createHash } from 'node:crypto';
|
|
11
|
+
import { signCanonical } from '../restorer/engine/signing.js';
|
|
12
|
+
import { uploadToIpfs } from '../adapters/mech/ipfs.js';
|
|
13
|
+
function sha256Hex(bytes) {
|
|
14
|
+
return createHash('sha256').update(bytes, 'utf8').digest('hex');
|
|
15
|
+
}
|
|
16
|
+
export async function emitTrajectory(p) {
|
|
17
|
+
const snap = p.collector.snapshot();
|
|
18
|
+
const unsigned = {
|
|
19
|
+
schemaVersion: 'jinn.trajectory.v1',
|
|
20
|
+
runId: p.runId,
|
|
21
|
+
parentEnvelopeCid: p.parentEnvelopeCid ?? null,
|
|
22
|
+
spans: snap.spans,
|
|
23
|
+
redactionManifest: snap.redactionManifest,
|
|
24
|
+
};
|
|
25
|
+
const sig = await signCanonical(unsigned, p.signerPrivateKey, p.signerAddress);
|
|
26
|
+
const signed = {
|
|
27
|
+
...unsigned,
|
|
28
|
+
signature: {
|
|
29
|
+
algo: 'secp256k1',
|
|
30
|
+
signer: p.signerAddress,
|
|
31
|
+
hash: sig.hash,
|
|
32
|
+
sig: sig.sig,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
const serialized = JSON.stringify(signed);
|
|
36
|
+
const sha256 = sha256Hex(serialized);
|
|
37
|
+
const cid = await uploadToIpfs(p.ipfsRegistryUrl, signed);
|
|
38
|
+
return { cid, sha256, signed };
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=emit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit.js","sourceRoot":"","sources":["../../src/trajectory/emit.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAoBxD,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,CAAuB;IAEvB,MAAM,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IACpC,MAAM,QAAQ,GAAG;QACf,aAAa,EAAE,oBAA6B;QAC5C,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,iBAAiB,EAAE,CAAC,CAAC,iBAAiB,IAAI,IAAI;QAC9C,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;KAC1C,CAAC;IAEF,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,gBAAgB,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC;IAE/E,MAAM,MAAM,GAAqB;QAC/B,GAAG,QAAQ;QACX,SAAS,EAAE;YACT,IAAI,EAAE,WAAW;YACjB,MAAM,EAAE,CAAC,CAAC,aAAa;YACvB,IAAI,EAAE,GAAG,CAAC,IAAW;YACrB,GAAG,EAAE,GAAG,CAAC,GAAU;SACpB;KACF,CAAC;IAEF,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;IACrC,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,CAAC,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAE1D,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-run per-span hash chain.
|
|
3
|
+
*
|
|
4
|
+
* Scope: §3.1 trajectory-signing-granularity row — "each span carries
|
|
5
|
+
* jinn.prevSpanHash linking to the previous span's hash; first span
|
|
6
|
+
* links to a run-start genesis value derived from envelope intent CID."
|
|
7
|
+
*
|
|
8
|
+
* Motivation: a crashed run that failed to upload the signed trajectory
|
|
9
|
+
* blob still produces a verifiable-as-prefix trace if spans are recovered
|
|
10
|
+
* elsewhere (enclave memory dump, challenger capture). Partial authenticity
|
|
11
|
+
* is not zero.
|
|
12
|
+
*/
|
|
13
|
+
import { type Hex } from 'viem';
|
|
14
|
+
import type { Span } from './schema.js';
|
|
15
|
+
/** Genesis value for the chain — keccak256(JCS({runStart: intentCid})). */
|
|
16
|
+
export declare function computeGenesisHash(intentCid: string): Hex;
|
|
17
|
+
/** Hash of a finalized span, to be set as jinn.prevSpanHash on the next one. */
|
|
18
|
+
export declare function computePrevSpanHash(span: Span): Hex;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-run per-span hash chain.
|
|
3
|
+
*
|
|
4
|
+
* Scope: §3.1 trajectory-signing-granularity row — "each span carries
|
|
5
|
+
* jinn.prevSpanHash linking to the previous span's hash; first span
|
|
6
|
+
* links to a run-start genesis value derived from envelope intent CID."
|
|
7
|
+
*
|
|
8
|
+
* Motivation: a crashed run that failed to upload the signed trajectory
|
|
9
|
+
* blob still produces a verifiable-as-prefix trace if spans are recovered
|
|
10
|
+
* elsewhere (enclave memory dump, challenger capture). Partial authenticity
|
|
11
|
+
* is not zero.
|
|
12
|
+
*/
|
|
13
|
+
import { keccak256, toBytes } from 'viem';
|
|
14
|
+
import { canonicalJson } from '../restorer/engine/canonical-json.js';
|
|
15
|
+
/** Genesis value for the chain — keccak256(JCS({runStart: intentCid})). */
|
|
16
|
+
export function computeGenesisHash(intentCid) {
|
|
17
|
+
return keccak256(toBytes(canonicalJson({ runStart: intentCid })));
|
|
18
|
+
}
|
|
19
|
+
/** Hash of a finalized span, to be set as jinn.prevSpanHash on the next one. */
|
|
20
|
+
export function computePrevSpanHash(span) {
|
|
21
|
+
return keccak256(toBytes(canonicalJson(span)));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=hash-chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash-chain.js","sourceRoot":"","sources":["../../src/trajectory/hash-chain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAY,MAAM,MAAM,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAGrE,2EAA2E;AAC3E,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAClD,OAAO,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,mBAAmB,CAAC,IAAU;IAC5C,OAAO,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* trajectory/index.ts — re-exports for consumers.
|
|
3
|
+
*
|
|
4
|
+
* Import path: '../../trajectory/index.js' (or '../trajectory/index.js' etc.)
|
|
5
|
+
* from any file within client/src/.
|
|
6
|
+
*/
|
|
7
|
+
export { TrajectoryCollector } from './collector.js';
|
|
8
|
+
export type { CollectorInit, SpanInput } from './collector.js';
|
|
9
|
+
export { emitTrajectory } from './emit.js';
|
|
10
|
+
export type { EmitTrajectoryParams, EmitTrajectoryResult } from './emit.js';
|
|
11
|
+
export { computeGenesisHash, computePrevSpanHash } from './hash-chain.js';
|
|
12
|
+
export { JinnSpanKindSchema, SpanSchema, RedactionManifestSchema, JinnTrajectoryV1Schema, UnsignedTrajectorySchema, } from './schema.js';
|
|
13
|
+
export type { JinnSpanKind, Span, RedactionManifest, JinnTrajectoryV1, UnsignedTrajectory, } from './schema.js';
|
|
14
|
+
export { SECRET_NAME_PATTERNS, isSecretKey, scrubAttributes, scrubMcpArgs, } from './secret-scrub.js';
|
|
15
|
+
export { SPAN_PROFILE, validateSpanProfile, findFirstProfileViolation, } from './span-profile.js';
|
|
16
|
+
export type { SpanProfileResult } from './span-profile.js';
|
|
17
|
+
export { tracedHttpCall } from './wrappers/http.js';
|
|
18
|
+
export type { HttpRequestLike, HttpResponseLike, GenAiAttrs, TracedHttpCallParams, } from './wrappers/http.js';
|
|
19
|
+
export { tracedMcpCall } from './wrappers/mcp.js';
|
|
20
|
+
export type { TracedMcpCallParams } from './wrappers/mcp.js';
|
|
21
|
+
export { tracedSpawn } from './wrappers/subprocess.js';
|
|
22
|
+
export type { TracedSpawnParams, TracedSpawnResult } from './wrappers/subprocess.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* trajectory/index.ts — re-exports for consumers.
|
|
3
|
+
*
|
|
4
|
+
* Import path: '../../trajectory/index.js' (or '../trajectory/index.js' etc.)
|
|
5
|
+
* from any file within client/src/.
|
|
6
|
+
*/
|
|
7
|
+
// Collector + input type
|
|
8
|
+
export { TrajectoryCollector } from './collector.js';
|
|
9
|
+
// Emitter
|
|
10
|
+
export { emitTrajectory } from './emit.js';
|
|
11
|
+
// Hash chain helpers
|
|
12
|
+
export { computeGenesisHash, computePrevSpanHash } from './hash-chain.js';
|
|
13
|
+
// Schema types + validators
|
|
14
|
+
export { JinnSpanKindSchema, SpanSchema, RedactionManifestSchema, JinnTrajectoryV1Schema, UnsignedTrajectorySchema, } from './schema.js';
|
|
15
|
+
// Secret scrub helpers
|
|
16
|
+
export { SECRET_NAME_PATTERNS, isSecretKey, scrubAttributes, scrubMcpArgs, } from './secret-scrub.js';
|
|
17
|
+
// Span profile checker
|
|
18
|
+
export { SPAN_PROFILE, validateSpanProfile, findFirstProfileViolation, } from './span-profile.js';
|
|
19
|
+
// Traced I/O wrappers
|
|
20
|
+
export { tracedHttpCall } from './wrappers/http.js';
|
|
21
|
+
export { tracedMcpCall } from './wrappers/mcp.js';
|
|
22
|
+
export { tracedSpawn } from './wrappers/subprocess.js';
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/trajectory/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,yBAAyB;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGrD,UAAU;AACV,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG3C,qBAAqB;AACrB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE1E,4BAA4B;AAC5B,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AASrB,uBAAuB;AACvB,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B,uBAAuB;AACvB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAG3B,sBAAsB;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAQpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -55,9 +55,9 @@ export declare const SpanSchema: z.ZodObject<{
|
|
|
55
55
|
timeUnixNano: string;
|
|
56
56
|
attributes?: Record<string, unknown> | undefined;
|
|
57
57
|
}[];
|
|
58
|
+
spanId: string;
|
|
58
59
|
attributes: Record<string, unknown>;
|
|
59
60
|
traceId: string;
|
|
60
|
-
spanId: string;
|
|
61
61
|
parentSpanId: string | null;
|
|
62
62
|
startTimeUnixNano: string;
|
|
63
63
|
endTimeUnixNano: string;
|
|
@@ -73,9 +73,9 @@ export declare const SpanSchema: z.ZodObject<{
|
|
|
73
73
|
timeUnixNano: string;
|
|
74
74
|
attributes?: Record<string, unknown> | undefined;
|
|
75
75
|
}[];
|
|
76
|
+
spanId: string;
|
|
76
77
|
attributes: Record<string, unknown>;
|
|
77
78
|
traceId: string;
|
|
78
|
-
spanId: string;
|
|
79
79
|
parentSpanId: string | null;
|
|
80
80
|
startTimeUnixNano: string;
|
|
81
81
|
endTimeUnixNano: string;
|
|
@@ -167,9 +167,9 @@ export declare const JinnTrajectoryV1Schema: z.ZodObject<{
|
|
|
167
167
|
timeUnixNano: string;
|
|
168
168
|
attributes?: Record<string, unknown> | undefined;
|
|
169
169
|
}[];
|
|
170
|
+
spanId: string;
|
|
170
171
|
attributes: Record<string, unknown>;
|
|
171
172
|
traceId: string;
|
|
172
|
-
spanId: string;
|
|
173
173
|
parentSpanId: string | null;
|
|
174
174
|
startTimeUnixNano: string;
|
|
175
175
|
endTimeUnixNano: string;
|
|
@@ -185,9 +185,9 @@ export declare const JinnTrajectoryV1Schema: z.ZodObject<{
|
|
|
185
185
|
timeUnixNano: string;
|
|
186
186
|
attributes?: Record<string, unknown> | undefined;
|
|
187
187
|
}[];
|
|
188
|
+
spanId: string;
|
|
188
189
|
attributes: Record<string, unknown>;
|
|
189
190
|
traceId: string;
|
|
190
|
-
spanId: string;
|
|
191
191
|
parentSpanId: string | null;
|
|
192
192
|
startTimeUnixNano: string;
|
|
193
193
|
endTimeUnixNano: string;
|
|
@@ -253,7 +253,6 @@ export declare const JinnTrajectoryV1Schema: z.ZodObject<{
|
|
|
253
253
|
sig: string;
|
|
254
254
|
};
|
|
255
255
|
schemaVersion: "jinn.trajectory.v1";
|
|
256
|
-
parentEnvelopeCid: string | null;
|
|
257
256
|
spans: {
|
|
258
257
|
name: string;
|
|
259
258
|
status: {
|
|
@@ -266,14 +265,15 @@ export declare const JinnTrajectoryV1Schema: z.ZodObject<{
|
|
|
266
265
|
timeUnixNano: string;
|
|
267
266
|
attributes?: Record<string, unknown> | undefined;
|
|
268
267
|
}[];
|
|
268
|
+
spanId: string;
|
|
269
269
|
attributes: Record<string, unknown>;
|
|
270
270
|
traceId: string;
|
|
271
|
-
spanId: string;
|
|
272
271
|
parentSpanId: string | null;
|
|
273
272
|
startTimeUnixNano: string;
|
|
274
273
|
endTimeUnixNano: string;
|
|
275
274
|
}[];
|
|
276
275
|
runId: string;
|
|
276
|
+
parentEnvelopeCid: string | null;
|
|
277
277
|
redactionManifest: {
|
|
278
278
|
spans: {
|
|
279
279
|
spanId: string;
|
|
@@ -289,7 +289,6 @@ export declare const JinnTrajectoryV1Schema: z.ZodObject<{
|
|
|
289
289
|
sig: string;
|
|
290
290
|
};
|
|
291
291
|
schemaVersion: "jinn.trajectory.v1";
|
|
292
|
-
parentEnvelopeCid: string | null;
|
|
293
292
|
spans: {
|
|
294
293
|
name: string;
|
|
295
294
|
status: {
|
|
@@ -302,14 +301,15 @@ export declare const JinnTrajectoryV1Schema: z.ZodObject<{
|
|
|
302
301
|
timeUnixNano: string;
|
|
303
302
|
attributes?: Record<string, unknown> | undefined;
|
|
304
303
|
}[];
|
|
304
|
+
spanId: string;
|
|
305
305
|
attributes: Record<string, unknown>;
|
|
306
306
|
traceId: string;
|
|
307
|
-
spanId: string;
|
|
308
307
|
parentSpanId: string | null;
|
|
309
308
|
startTimeUnixNano: string;
|
|
310
309
|
endTimeUnixNano: string;
|
|
311
310
|
}[];
|
|
312
311
|
runId: string;
|
|
312
|
+
parentEnvelopeCid: string | null;
|
|
313
313
|
redactionManifest: {
|
|
314
314
|
spans: {
|
|
315
315
|
spanId: string;
|
|
@@ -368,9 +368,9 @@ export declare const UnsignedTrajectorySchema: z.ZodObject<Omit<{
|
|
|
368
368
|
timeUnixNano: string;
|
|
369
369
|
attributes?: Record<string, unknown> | undefined;
|
|
370
370
|
}[];
|
|
371
|
+
spanId: string;
|
|
371
372
|
attributes: Record<string, unknown>;
|
|
372
373
|
traceId: string;
|
|
373
|
-
spanId: string;
|
|
374
374
|
parentSpanId: string | null;
|
|
375
375
|
startTimeUnixNano: string;
|
|
376
376
|
endTimeUnixNano: string;
|
|
@@ -386,9 +386,9 @@ export declare const UnsignedTrajectorySchema: z.ZodObject<Omit<{
|
|
|
386
386
|
timeUnixNano: string;
|
|
387
387
|
attributes?: Record<string, unknown> | undefined;
|
|
388
388
|
}[];
|
|
389
|
+
spanId: string;
|
|
389
390
|
attributes: Record<string, unknown>;
|
|
390
391
|
traceId: string;
|
|
391
|
-
spanId: string;
|
|
392
392
|
parentSpanId: string | null;
|
|
393
393
|
startTimeUnixNano: string;
|
|
394
394
|
endTimeUnixNano: string;
|
|
@@ -448,7 +448,6 @@ export declare const UnsignedTrajectorySchema: z.ZodObject<Omit<{
|
|
|
448
448
|
}>;
|
|
449
449
|
}, "signature">, "strip", z.ZodTypeAny, {
|
|
450
450
|
schemaVersion: "jinn.trajectory.v1";
|
|
451
|
-
parentEnvelopeCid: string | null;
|
|
452
451
|
spans: {
|
|
453
452
|
name: string;
|
|
454
453
|
status: {
|
|
@@ -461,14 +460,15 @@ export declare const UnsignedTrajectorySchema: z.ZodObject<Omit<{
|
|
|
461
460
|
timeUnixNano: string;
|
|
462
461
|
attributes?: Record<string, unknown> | undefined;
|
|
463
462
|
}[];
|
|
463
|
+
spanId: string;
|
|
464
464
|
attributes: Record<string, unknown>;
|
|
465
465
|
traceId: string;
|
|
466
|
-
spanId: string;
|
|
467
466
|
parentSpanId: string | null;
|
|
468
467
|
startTimeUnixNano: string;
|
|
469
468
|
endTimeUnixNano: string;
|
|
470
469
|
}[];
|
|
471
470
|
runId: string;
|
|
471
|
+
parentEnvelopeCid: string | null;
|
|
472
472
|
redactionManifest: {
|
|
473
473
|
spans: {
|
|
474
474
|
spanId: string;
|
|
@@ -478,7 +478,6 @@ export declare const UnsignedTrajectorySchema: z.ZodObject<Omit<{
|
|
|
478
478
|
};
|
|
479
479
|
}, {
|
|
480
480
|
schemaVersion: "jinn.trajectory.v1";
|
|
481
|
-
parentEnvelopeCid: string | null;
|
|
482
481
|
spans: {
|
|
483
482
|
name: string;
|
|
484
483
|
status: {
|
|
@@ -491,14 +490,15 @@ export declare const UnsignedTrajectorySchema: z.ZodObject<Omit<{
|
|
|
491
490
|
timeUnixNano: string;
|
|
492
491
|
attributes?: Record<string, unknown> | undefined;
|
|
493
492
|
}[];
|
|
493
|
+
spanId: string;
|
|
494
494
|
attributes: Record<string, unknown>;
|
|
495
495
|
traceId: string;
|
|
496
|
-
spanId: string;
|
|
497
496
|
parentSpanId: string | null;
|
|
498
497
|
startTimeUnixNano: string;
|
|
499
498
|
endTimeUnixNano: string;
|
|
500
499
|
}[];
|
|
501
500
|
runId: string;
|
|
501
|
+
parentEnvelopeCid: string | null;
|
|
502
502
|
redactionManifest: {
|
|
503
503
|
spans: {
|
|
504
504
|
spanId: string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V1 minimum secret-scrub conformance.
|
|
3
|
+
*
|
|
4
|
+
* Scope: §4.3 bullet — "attribute-name allowlist drops values for known
|
|
5
|
+
* credential fields (*.authorization, *.apiKey, *.bearer, *.password,
|
|
6
|
+
* *.secret, *.token, *.privateKey, plus MCP tool args matching these
|
|
7
|
+
* patterns). Scrubbed attributes are replaced with <redacted:name>
|
|
8
|
+
* markers; a run-level redaction manifest records *which* fields were
|
|
9
|
+
* scrubbed (not values) and is signed alongside spans."
|
|
10
|
+
*
|
|
11
|
+
* This is safety, not access control. IP-protection redaction lives in
|
|
12
|
+
* the deferred gating epic per scope §5.
|
|
13
|
+
*/
|
|
14
|
+
/** V1 pattern set. Case-insensitive; matches at end-of-key or after a dot. */
|
|
15
|
+
export declare const SECRET_NAME_PATTERNS: readonly RegExp[];
|
|
16
|
+
export declare function isSecretKey(key: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Walk a flat attribute map and replace secret values with a marker.
|
|
19
|
+
* Returns a new object plus the list of keys that were redacted.
|
|
20
|
+
*/
|
|
21
|
+
export declare function scrubAttributes<T extends Record<string, unknown>>(attrs: T): {
|
|
22
|
+
scrubbed: Record<string, unknown>;
|
|
23
|
+
redactedKeys: string[];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Scrub MCP tool call arguments by argument name. V1 is top-level-only;
|
|
27
|
+
* deep recursion is Plan F tightening.
|
|
28
|
+
*/
|
|
29
|
+
export declare function scrubMcpArgs(args: Record<string, unknown>): {
|
|
30
|
+
scrubbed: Record<string, unknown>;
|
|
31
|
+
redactedKeys: string[];
|
|
32
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V1 minimum secret-scrub conformance.
|
|
3
|
+
*
|
|
4
|
+
* Scope: §4.3 bullet — "attribute-name allowlist drops values for known
|
|
5
|
+
* credential fields (*.authorization, *.apiKey, *.bearer, *.password,
|
|
6
|
+
* *.secret, *.token, *.privateKey, plus MCP tool args matching these
|
|
7
|
+
* patterns). Scrubbed attributes are replaced with <redacted:name>
|
|
8
|
+
* markers; a run-level redaction manifest records *which* fields were
|
|
9
|
+
* scrubbed (not values) and is signed alongside spans."
|
|
10
|
+
*
|
|
11
|
+
* This is safety, not access control. IP-protection redaction lives in
|
|
12
|
+
* the deferred gating epic per scope §5.
|
|
13
|
+
*/
|
|
14
|
+
/** V1 pattern set. Case-insensitive; matches at end-of-key or after a dot. */
|
|
15
|
+
export const SECRET_NAME_PATTERNS = [
|
|
16
|
+
/(^|\.)authorization$/i,
|
|
17
|
+
/(^|\.)apikey$/i,
|
|
18
|
+
/(^|\.)api[_-]?key$/i,
|
|
19
|
+
/(^|\.)bearer$/i,
|
|
20
|
+
/(^|\.)password$/i,
|
|
21
|
+
/(^|\.)secret$/i,
|
|
22
|
+
/(^|\.)token$/i,
|
|
23
|
+
/(^|\.)privatekey$/i,
|
|
24
|
+
/(^|\.)private[_-]?key$/i,
|
|
25
|
+
];
|
|
26
|
+
export function isSecretKey(key) {
|
|
27
|
+
return SECRET_NAME_PATTERNS.some((p) => p.test(key));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Walk a flat attribute map and replace secret values with a marker.
|
|
31
|
+
* Returns a new object plus the list of keys that were redacted.
|
|
32
|
+
*/
|
|
33
|
+
export function scrubAttributes(attrs) {
|
|
34
|
+
const scrubbed = { ...attrs };
|
|
35
|
+
const redactedKeys = [];
|
|
36
|
+
for (const [k, _v] of Object.entries(attrs)) {
|
|
37
|
+
if (isSecretKey(k)) {
|
|
38
|
+
scrubbed[k] = `<redacted:${k}>`;
|
|
39
|
+
redactedKeys.push(k);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return { scrubbed, redactedKeys };
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Scrub MCP tool call arguments by argument name. V1 is top-level-only;
|
|
46
|
+
* deep recursion is Plan F tightening.
|
|
47
|
+
*/
|
|
48
|
+
export function scrubMcpArgs(args) {
|
|
49
|
+
return scrubAttributes(args);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=secret-scrub.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-scrub.js","sourceRoot":"","sources":["../../src/trajectory/secret-scrub.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,oBAAoB,GAAsB;IACrD,uBAAuB;IACvB,gBAAgB;IAChB,qBAAqB;IACrB,gBAAgB;IAChB,kBAAkB;IAClB,gBAAgB;IAChB,eAAe;IACf,oBAAoB;IACpB,yBAAyB;CAC1B,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAQ;IAER,MAAM,QAAQ,GAA4B,EAAE,GAAG,KAAK,EAAE,CAAC;IACvD,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,KAAK,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5C,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;YACnB,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC;YAChC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC1B,IAA6B;IAE7B,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normative span profile per scope §3.1 K6 + §4.3.
|
|
3
|
+
*
|
|
4
|
+
* For each jinn.span.kind, declares required attribute keys. Consumers
|
|
5
|
+
* (Plan F conformance suite, manifest-validation layer) call
|
|
6
|
+
* validateSpanProfile to check each span in a trajectory.
|
|
7
|
+
*
|
|
8
|
+
* Required attributes at V1 (all tiers). Attested-tier extensions (TLS
|
|
9
|
+
* transcript CIDs) layer on top in V2.
|
|
10
|
+
*/
|
|
11
|
+
import type { Span, JinnSpanKind } from './schema.js';
|
|
12
|
+
export declare const SPAN_PROFILE: Record<JinnSpanKind, readonly string[]>;
|
|
13
|
+
export type SpanProfileResult = {
|
|
14
|
+
valid: true;
|
|
15
|
+
} | {
|
|
16
|
+
valid: false;
|
|
17
|
+
missing: string[];
|
|
18
|
+
kind: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function validateSpanProfile(span: Span): SpanProfileResult;
|
|
21
|
+
/** Bulk-validate all spans in a trajectory. Returns first failure, or null if all pass. */
|
|
22
|
+
export declare function findFirstProfileViolation(spans: Span[]): {
|
|
23
|
+
span: Span;
|
|
24
|
+
result: Exclude<SpanProfileResult, {
|
|
25
|
+
valid: true;
|
|
26
|
+
}>;
|
|
27
|
+
} | null;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normative span profile per scope §3.1 K6 + §4.3.
|
|
3
|
+
*
|
|
4
|
+
* For each jinn.span.kind, declares required attribute keys. Consumers
|
|
5
|
+
* (Plan F conformance suite, manifest-validation layer) call
|
|
6
|
+
* validateSpanProfile to check each span in a trajectory.
|
|
7
|
+
*
|
|
8
|
+
* Required attributes at V1 (all tiers). Attested-tier extensions (TLS
|
|
9
|
+
* transcript CIDs) layer on top in V2.
|
|
10
|
+
*/
|
|
11
|
+
export const SPAN_PROFILE = {
|
|
12
|
+
'jinn.phase': ['jinn.phase.name'],
|
|
13
|
+
'jinn.llm_call': [
|
|
14
|
+
'gen_ai.system',
|
|
15
|
+
'gen_ai.request.model',
|
|
16
|
+
'gen_ai.usage.input_tokens',
|
|
17
|
+
'gen_ai.usage.output_tokens',
|
|
18
|
+
],
|
|
19
|
+
'jinn.mcp_call': ['mcp.server.name', 'mcp.tool.name'],
|
|
20
|
+
'jinn.artifact.emit': [
|
|
21
|
+
'jinn.artifact.cid',
|
|
22
|
+
'jinn.artifact.artifactType',
|
|
23
|
+
'jinn.artifact.sha256',
|
|
24
|
+
],
|
|
25
|
+
'jinn.venue_io': [
|
|
26
|
+
'net.peer.name',
|
|
27
|
+
'http.request.method',
|
|
28
|
+
'http.response.status_code',
|
|
29
|
+
],
|
|
30
|
+
'jinn.state_transition': ['jinn.state.from', 'jinn.state.to'],
|
|
31
|
+
};
|
|
32
|
+
export function validateSpanProfile(span) {
|
|
33
|
+
const kind = span.attributes['jinn.span.kind'];
|
|
34
|
+
const required = SPAN_PROFILE[kind];
|
|
35
|
+
if (!required)
|
|
36
|
+
return { valid: false, missing: ['<unknown-kind>'], kind };
|
|
37
|
+
const missing = required.filter((k) => span.attributes[k] === undefined);
|
|
38
|
+
if (missing.length > 0)
|
|
39
|
+
return { valid: false, missing, kind };
|
|
40
|
+
return { valid: true };
|
|
41
|
+
}
|
|
42
|
+
/** Bulk-validate all spans in a trajectory. Returns first failure, or null if all pass. */
|
|
43
|
+
export function findFirstProfileViolation(spans) {
|
|
44
|
+
for (const s of spans) {
|
|
45
|
+
const r = validateSpanProfile(s);
|
|
46
|
+
if (!r.valid)
|
|
47
|
+
return { span: s, result: r };
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=span-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"span-profile.js","sourceRoot":"","sources":["../../src/trajectory/span-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,CAAC,MAAM,YAAY,GAA4C;IACnE,YAAY,EAAE,CAAC,iBAAiB,CAAC;IACjC,eAAe,EAAE;QACf,eAAe;QACf,sBAAsB;QACtB,2BAA2B;QAC3B,4BAA4B;KAC7B;IACD,eAAe,EAAE,CAAC,iBAAiB,EAAE,eAAe,CAAC;IACrD,oBAAoB,EAAE;QACpB,mBAAmB;QACnB,4BAA4B;QAC5B,sBAAsB;KACvB;IACD,eAAe,EAAE;QACf,eAAe;QACf,qBAAqB;QACrB,2BAA2B;KAC5B;IACD,uBAAuB,EAAE,CAAC,iBAAiB,EAAE,eAAe,CAAC;CAC9D,CAAC;AAMF,MAAM,UAAU,mBAAmB,CAAC,IAAU;IAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAiB,CAAC;IAC/D,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC;IAC1E,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;IACzE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC/D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,yBAAyB,CAAC,KAAa;IAIrD,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,CAAC,CAAC,CAAC,KAAK;YAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAC9C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|