@fased/fased 0.1.61 → 0.1.64
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 +43 -0
- package/README.md +38 -30
- package/config/dependency-ownership.json +1 -1
- package/config/signer-policies/README.md +49 -0
- package/config/signer-policies/agent.json.template +32 -0
- package/config/signer-policies/mining.json.template +69 -0
- package/config/signer-policies/network.json.template +5 -0
- package/config/signer-policies/vault.json.template +70 -0
- package/config/signer-protocol-v2.json +76 -0
- package/config/typescript-noemit-baseline.json +680 -0
- package/dist/acp/client.js +2 -2
- package/dist/acp/secret-file.js +2 -2
- package/dist/agents/agent-scope.js +2 -2
- package/dist/agents/apply-patch.js +8 -8
- package/dist/agents/auth-profiles/paths.js +2 -2
- package/dist/agents/auth-profiles/store.js +269 -33
- package/dist/agents/bash-tools.exec.js +10 -4
- package/dist/agents/bash-tools.shared.js +2 -2
- package/dist/agents/cli-credentials.js +4 -4
- package/dist/agents/current-model-catalog.js +3 -3
- package/dist/agents/docs-path.js +3 -3
- package/dist/agents/embedded-pi-mcp.js +4 -4
- package/dist/agents/identity-avatar.js +3 -3
- package/dist/agents/identity-file.js +2 -2
- package/dist/agents/memory-search.js +7 -1
- package/dist/agents/model-catalog-access.js +1 -2
- package/dist/agents/model-catalog-snapshot.js +1 -1
- package/dist/agents/model-catalog-source.js +1 -1
- package/dist/agents/model-metadata.js +1 -1
- package/dist/agents/model-selection.js +2 -28
- package/dist/agents/models-config.providers.js +6 -6
- package/dist/agents/openai-codex-app-server.js +5 -5
- package/dist/agents/pi-embedded-runner/compact.js +15 -7
- package/dist/agents/pi-embedded-runner/model.js +1 -1
- package/dist/agents/pi-embedded-runner/run/attempt.js +24 -13
- package/dist/agents/pi-embedded-runner/run.js +2 -0
- package/dist/agents/pi-embedded-runner/tool-split.js +40 -2
- package/dist/agents/pi-embedded-subscribe.raw-stream.js +3 -3
- package/dist/agents/pi-extensions/compaction-safeguard.js +3 -3
- package/dist/agents/pi-model-discovery.js +6 -6
- package/dist/agents/pi-project-settings.js +3 -3
- package/dist/agents/pi-tool-definition-adapter.js +16 -1
- package/dist/agents/pi-tools.js +2 -1
- package/dist/agents/sandbox/config.js +1 -1
- package/dist/agents/sandbox/context.js +27 -2
- package/dist/agents/sandbox/fs-bridge.js +2 -2
- package/dist/agents/session-dirs.js +4 -4
- package/dist/agents/session-write-lock.js +13 -13
- package/dist/agents/shell-utils.js +5 -5
- package/dist/agents/skills/bundled-dir.js +4 -4
- package/dist/agents/skills/env-overrides.js +38 -28
- package/dist/agents/skills/local-loader.js +6 -6
- package/dist/agents/skills/plugin-skills.js +2 -2
- package/dist/agents/skills/trust.js +93 -0
- package/dist/agents/skills/workspace.js +141 -13
- package/dist/agents/skills-clawhub.js +36 -11
- package/dist/agents/skills-install-download.js +7 -7
- package/dist/agents/skills-install-plan.js +2 -2
- package/dist/agents/skills-install.js +2 -2
- package/dist/agents/skills-marketplace-scan.js +49 -0
- package/dist/agents/skills-status.js +2 -2
- package/dist/agents/subagent-depth.js +2 -2
- package/dist/agents/system-prompt-params.js +2 -2
- package/dist/agents/tools/marketplace-offer-draft-tool.js +1 -1
- package/dist/agents/tools/mining-tool.js +1 -1
- package/dist/agents/tools/session-status-tool.js +1 -1
- package/dist/agents/tools/wallet-action-tool.js +172 -36
- package/dist/agents/tools/wallet-skill-policy.js +65 -23
- package/dist/agents/tools/wallet-tool.js +7 -11
- package/dist/agents/workspace.js +22 -22
- package/dist/auto-reply/reply/agent-runner-execution.js +2 -2
- package/dist/auto-reply/reply/agent-runner.js +2 -2
- package/dist/auto-reply/reply/commands-export-session.js +7 -7
- package/dist/auto-reply/reply/directive-handling.fast-lane.js +2 -1
- package/dist/auto-reply/reply/directive-handling.impl.js +2 -1
- package/dist/auto-reply/reply/directive-handling.model.js +2 -1
- package/dist/auto-reply/reply/directive-handling.persist.js +2 -2
- package/dist/auto-reply/reply/get-reply-directives-apply.js +2 -0
- package/dist/auto-reply/reply/get-reply-inline-actions.js +25 -1
- package/dist/auto-reply/reply/model-selection.js +7 -4
- package/dist/auto-reply/reply/post-compaction-audit.js +3 -3
- package/dist/auto-reply/reply/post-compaction-context.js +3 -3
- package/dist/auto-reply/reply/session-reset-model.js +4 -4
- package/dist/auto-reply/reply/session.js +3 -3
- package/dist/auto-reply/skill-commands.js +3 -3
- package/dist/auto-reply/status.js +6 -6
- package/dist/brand.js +1 -1
- package/dist/browser/chrome.executables.js +3 -3
- package/dist/browser/chrome.js +3 -3
- package/dist/browser/chrome.profile-decoration.js +6 -6
- package/dist/browser/profiles-service.js +2 -2
- package/dist/browser/server-context.js +2 -2
- package/dist/browser/trash.js +4 -4
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/canvas-host/server.js +4 -4
- package/dist/capabilities/catalog.js +3 -3
- package/dist/channel-web.js +2 -2
- package/dist/channels/plugins/catalog.js +3 -3
- package/dist/cli/browser-cli-extension.js +6 -6
- package/dist/cli/command-format.js +2 -2
- package/dist/cli/cron-cli/register.cron-simple.js +2 -2
- package/dist/cli/dns-cli.js +9 -9
- package/dist/cli/gateway-cli/dev.js +5 -5
- package/dist/cli/gateway-cli/run.js +10 -2
- package/dist/cli/hooks-cli.js +5 -5
- package/dist/cli/lightweight/gateway-runtime-probe.js +2 -2
- package/dist/cli/memory-cli.js +7 -7
- package/dist/cli/nodes-media-utils.js +2 -2
- package/dist/cli/plugins-cli.js +2 -2
- package/dist/cli/program/command-registry.js +1 -1
- package/dist/cli/program/register.onboard.js +2 -3
- package/dist/cli/program/register.wallet.js +16 -123
- package/dist/cli/providers-cli.js +1 -1
- package/dist/cli/sat-cli.js +129 -2
- package/dist/cli/secrets-cli.js +3 -3
- package/dist/cli/update-cli/update-command.js +260 -11
- package/dist/cli/windows-argv.js +2 -2
- package/dist/commands/auth-choice.apply.api-providers.js +3 -3
- package/dist/commands/dashboard-link.js +3 -3
- package/dist/commands/doctor-config-flow.js +1 -1
- package/dist/commands/doctor-install.js +5 -5
- package/dist/commands/doctor-legacy-config.js +2 -13
- package/dist/commands/doctor-memory-search.js +2 -2
- package/dist/commands/doctor-platform-notes.js +2 -2
- package/dist/commands/doctor-sandbox.js +2 -2
- package/dist/commands/doctor-state-integrity.js +23 -23
- package/dist/commands/doctor-workspace.js +3 -3
- package/dist/commands/doctor.js +3 -3
- package/dist/commands/managed-up.js +2 -2
- package/dist/commands/model-picker.js +6 -6
- package/dist/commands/models/auth.js +1 -1
- package/dist/commands/onboard-auth.config-gateways.js +1 -1
- package/dist/commands/onboard-auth.credentials.js +35 -11
- package/dist/commands/onboard-non-interactive/local/wallet-config.js +28 -27
- package/dist/commands/onboard-non-interactive/local.js +5 -1
- package/dist/commands/onboarding/plugin-install.js +2 -2
- package/dist/commands/sessions-cleanup.js +2 -2
- package/dist/commands/signal-install.js +6 -6
- package/dist/commands/status-all/channels.js +2 -2
- package/dist/commands/wallet.js +570 -1913
- package/dist/config/cache-utils.js +2 -2
- package/dist/config/config.js +2 -2
- package/dist/config/includes.js +5 -5
- package/dist/config/io.js +66 -4
- package/dist/config/paths.js +3 -3
- package/dist/config/sat-runtime-ids.js +3 -3
- package/dist/config/schema.help.js +8 -7
- package/dist/config/schema.labels.js +5 -4
- package/dist/config/sessions/disk-budget.js +6 -6
- package/dist/config/sessions/paths.js +2 -2
- package/dist/config/sessions/store.js +17 -17
- package/dist/config/sessions/transcript.js +4 -4
- package/dist/config/talk.js +2 -2
- package/dist/config/zod-schema.agent-runtime.js +1 -0
- package/dist/config/zod-schema.js +5 -0
- package/dist/control-ui/assets/{app-BXA4gPvN.js → app-bR-fO5ty.js} +1511 -1555
- package/dist/control-ui/assets/{config-CU5Zi8Dh.js → config-LeImukCW.js} +10 -10
- package/dist/control-ui/assets/{federation-D10Q4eP_.js → federation-DgA9e-Pn.js} +364 -422
- package/dist/control-ui/assets/{index-D2QbJhVg.js → index-ckCxHwjy.js} +3 -3
- package/dist/control-ui/assets/{mining-BdhMn18r.js → mining-BgHFh0ei.js} +134 -114
- package/dist/control-ui/assets/mining-commit-DFpB_4JN.js +2 -0
- package/dist/control-ui/assets/{open-external-url-DwSiwMPl.js → open-external-url-ulF1B-sA.js} +3 -3
- package/dist/control-ui/assets/{providers-QMn4w2_f.js → providers-CIx9fxc6.js} +2 -2
- package/dist/control-ui/assets/{wallet-C2g294QT.js → wallet-DvStR_AT.js} +259 -377
- package/dist/control-ui/index.html +1 -1
- package/dist/control-ui/version.json +1 -1
- package/dist/cron/service/store.js +2 -2
- package/dist/cron/store.js +6 -6
- package/dist/daemon/systemd-system.js +60 -54
- package/dist/discord/monitor/thread-bindings.state.js +2 -2
- package/dist/extensions/sat-mining/src/protocol-contract.js +43 -3
- package/dist/extensions/sat-mining/src/rpc-read.js +235 -67
- package/dist/extensions/sat-mining/src/sat-bond-layout.js +14 -11
- package/dist/extensions/sat-mining/src/signer-codec-manifest.js +406 -0
- package/dist/extensions/sat-mining/src/solana-submit.js +1038 -397
- package/dist/extensions/sat-mining/src/submission-ledger.js +349 -0
- package/dist/federation/auto-connect.js +98 -8
- package/dist/federation/marketplace-capability-adapter.js +33 -7
- package/dist/federation/marketplace-delivery-outbox.js +196 -0
- package/dist/federation/marketplace-delivery.js +351 -215
- package/dist/federation/marketplace-direct-payment.js +272 -141
- package/dist/federation/marketplace-escrow.js +607 -249
- package/dist/federation/marketplace-settlement-ledger.js +352 -0
- package/dist/federation/offers.js +9 -7
- package/dist/federation/peer-auth-v2.js +529 -0
- package/dist/gateway/a2a-http.js +425 -96
- package/dist/gateway/a2a-settlement.js +259 -153
- package/dist/gateway/a2a-task-store.js +524 -0
- package/dist/gateway/auth.js +38 -2
- package/dist/gateway/config-reload.js +46 -33
- package/dist/gateway/control-ui-boot-check.js +6 -6
- package/dist/gateway/control-ui-login.js +7 -7
- package/dist/gateway/control-ui.js +9 -9
- package/dist/gateway/durable-capacity.js +31 -0
- package/dist/gateway/federation-http.js +540 -135
- package/dist/gateway/federation-marketplace-run-store.js +397 -0
- package/dist/gateway/federation-marketplace.js +535 -230
- package/dist/gateway/hooks-mapping.js +4 -4
- package/dist/gateway/mutating-admin-rpc-rate-limit.js +5 -0
- package/dist/gateway/security-path.js +1 -1
- package/dist/gateway/server-discovery.js +2 -2
- package/dist/gateway/server-http.js +1088 -1209
- package/dist/gateway/server-methods/chat.js +3 -3
- package/dist/gateway/server-methods/models.js +1 -1
- package/dist/gateway/server-methods/secrets.js +40 -0
- package/dist/gateway/server-methods/sessions.js +6 -6
- package/dist/gateway/server-methods/usage.js +2 -2
- package/dist/gateway/server-methods.js +1 -2
- package/dist/gateway/server-reload-handlers.js +196 -66
- package/dist/gateway/server-runtime-config.js +1 -1
- package/dist/gateway/server-secrets-runtime.js +288 -0
- package/dist/gateway/server.impl.js +73 -42
- package/dist/gateway/session-compaction-checkpoints.js +4 -4
- package/dist/gateway/session-utils.fs.js +24 -24
- package/dist/gateway/session-utils.js +6 -6
- package/dist/gateway/sessions-patch.js +3 -5
- package/dist/hooks/bundled-dir.js +4 -4
- package/dist/hooks/gmail-setup-utils.js +6 -6
- package/dist/hooks/import-url.js +2 -2
- package/dist/hooks/loader.js +4 -4
- package/dist/hooks/workspace.js +7 -7
- package/dist/index.js +4 -2
- package/dist/infra/archive.js +17 -17
- package/dist/infra/boundary-file-read.js +2 -2
- package/dist/infra/boundary-path.js +15 -15
- package/dist/infra/brew.js +2 -2
- package/dist/infra/control-ui-assets.js +14 -14
- package/dist/infra/device-auth-store.js +8 -8
- package/dist/infra/device-identity.js +8 -8
- package/dist/infra/dotenv.js +2 -2
- package/dist/infra/exec-approvals.js +8 -8
- package/dist/infra/exec-command-resolution.js +4 -4
- package/dist/infra/exec-safe-bin-trust.js +2 -2
- package/dist/infra/fased-root.js +5 -5
- package/dist/infra/fasedhub.js +64 -1
- package/dist/infra/fs-safe.js +14 -14
- package/dist/infra/gateway-lock.js +11 -11
- package/dist/infra/git-commit.js +5 -5
- package/dist/infra/git-root.js +4 -4
- package/dist/infra/hosted-runtime-artifact.js +3 -3
- package/dist/infra/is-main.js +2 -2
- package/dist/infra/json-file.js +7 -7
- package/dist/infra/local-source-paired-update.js +538 -0
- package/dist/infra/managed-runtime-bootstrap.js +6 -6
- package/dist/infra/outbound/delivery-queue.js +16 -16
- package/dist/infra/path-env.js +3 -3
- package/dist/infra/ports-lsof.js +4 -4
- package/dist/infra/provider-usage.auth.js +3 -3
- package/dist/infra/restart.js +41 -10
- package/dist/infra/safe-open-sync.js +2 -2
- package/dist/infra/session-cost-usage.js +9 -9
- package/dist/infra/shell-env.js +2 -2
- package/dist/infra/state-migrations.fs.js +6 -6
- package/dist/infra/state-migrations.js +23 -23
- package/dist/infra/tmp-fased-dir.js +6 -6
- package/dist/infra/update-runner.js +96 -0
- package/dist/infra/widearea-dns.js +3 -3
- package/dist/infra/wsl.js +2 -2
- package/dist/light-update-status.js +11 -11
- package/dist/line/accounts.js +2 -2
- package/dist/line/download.js +2 -2
- package/dist/logging/config.js +3 -3
- package/dist/logging/logger.js +7 -7
- package/dist/managed/federation.js +3 -3
- package/dist/managed/tunnel.js +3 -3
- package/dist/media/store.js +13 -13
- package/dist/media-understanding/runner.js +3 -3
- package/dist/memory/backend-config.js +2 -1
- package/dist/memory/embeddings.js +2 -2
- package/dist/memory/internal.js +10 -10
- package/dist/memory/manager-sync-ops.js +7 -7
- package/dist/memory/repair-executor.js +17 -17
- package/dist/memory/session-files.js +16 -2
- package/dist/node-host/invoke-system-run-plan.js +8 -8
- package/dist/node-host/invoke.js +2 -2
- package/dist/node-host/runner.js +3 -3
- package/dist/pairing/pairing-store.js +3 -3
- package/dist/plugin-sdk/{accounts-DxblobYM.js → accounts-Brn3-uWN.js} +1 -1
- package/dist/plugin-sdk/{actions-D4UNimWa.js → actions-DRu135h0.js} +2 -2
- package/dist/plugin-sdk/{active-listener-CFuy106s.js → active-listener-B_NMtgPL.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-Bv0hUOWL.js → audio-preflight-BYxAt775.js} +27 -27
- package/dist/plugin-sdk/{audit-Cs0K7LBp.js → audit-C5d2z5U1.js} +1 -1
- package/dist/plugin-sdk/{channel-access-D5aHoTY8.js → channel-access-CcFRdRPO.js} +1 -1
- package/dist/plugin-sdk/{channel-access-configure-Dvch9mMQ.js → channel-access-configure-DaI5wevh.js} +1 -1
- package/dist/plugin-sdk/channel-plugin-common.d.ts +3 -3
- package/dist/plugin-sdk/channel-plugin-common.js +4 -4
- package/dist/plugin-sdk/{chunk-B0FUGc5A.js → chunk-CyoyqpbG.js} +1 -1
- package/dist/plugin-sdk/{chunk-items-Bk--NU3E.js → chunk-items-DIRHG2gJ.js} +1 -1
- package/dist/plugin-sdk/command-status.d.ts +2 -2
- package/dist/plugin-sdk/command-status.js +27 -27
- package/dist/plugin-sdk/{commands-registry-DmDRhRAU.js → commands-registry-BfqdEWdF.js} +2 -2
- package/dist/plugin-sdk/{common-CfUOowOp.js → common-HCcXU-NR.js} +1 -1
- package/dist/plugin-sdk/{config-mxULv0fQ.js → config-DlWVeLFB.js} +7113 -6877
- package/dist/plugin-sdk/{config-schema-CGW6J3Pv.js → config-schema-BOT7kHb6.js} +6779 -3696
- package/dist/plugin-sdk/device-pair.d.ts +1 -1
- package/dist/plugin-sdk/discord.d.ts +5 -5
- package/dist/plugin-sdk/discord.js +19 -19
- package/dist/plugin-sdk/file-lock.js +35 -4
- package/dist/plugin-sdk/{filesystem-manager-ZoHU8oA7.js → filesystem-manager-DoI8IBNF.js} +1 -1
- package/dist/plugin-sdk/{group-mentions-BHRff6j8.d.ts → group-mentions-q3hUTCt7.d.ts} +1 -1
- package/dist/plugin-sdk/{handle-action-DbVCF9HZ.js → handle-action-hvwapMKg.js} +13 -13
- package/dist/plugin-sdk/{helpers-BXbdgs5H.js → helpers-DMBU4oTo.js} +1 -1
- package/dist/plugin-sdk/{image-ops-D7jPxaph.js → image-ops-DQi0n_Tt.js} +1 -1
- package/dist/plugin-sdk/index.d.ts +9 -27
- package/dist/plugin-sdk/index.js +29 -29
- package/dist/plugin-sdk/json-store.js +6 -6
- package/dist/plugin-sdk/{login-BRxww6nv.js → login-Ca583Okc.js} +3 -3
- package/dist/plugin-sdk/{login-qr-DJXsk9XH.js → login-qr-CGciBSNP.js} +3 -3
- package/dist/plugin-sdk/{manager-Y2S_5IlI.js → manager-BegWxNYX.js} +4 -4
- package/dist/plugin-sdk/{markdown-tables-DHLFQqaF.js → markdown-tables-DCOXEUfZ.js} +1 -1
- package/dist/plugin-sdk/{media-Czo4carg.js → media-CAdQF5TG.js} +47 -47
- package/dist/plugin-sdk/{memory-search-DTjIMw8J.js → memory-search-CrFPOeTH.js} +4 -1
- package/dist/plugin-sdk/{monitor-B9Cmt_Je.js → monitor-BCFDaqJ-.js} +31 -31
- package/dist/plugin-sdk/{monitor-B71iwAgC.js → monitor-BgbjRiPM.js} +32 -32
- package/dist/plugin-sdk/{openresponses-http-Du4GMmwo.js → openresponses-http-DFf87SMM.js} +27 -27
- package/dist/plugin-sdk/{optional-runtime-dependency-DdMbxS24.js → optional-runtime-dependency-0dznm3ZO.js} +1 -1
- package/dist/plugin-sdk/{outbound-Db8mRN6P.js → outbound-BgVDdHxx.js} +6 -6
- package/dist/plugin-sdk/{outbound-attachment-BqFjcypb.js → outbound-attachment-QqTnIhZL.js} +2 -2
- package/dist/plugin-sdk/{pairing-message-BMkkS038.d.ts → pairing-message-CS-9BHug.d.ts} +2 -2
- package/dist/plugin-sdk/{pairing-message-B3GC_7CD.js → pairing-message-D0CoLHRJ.js} +1 -1
- package/dist/plugin-sdk/{pairing-store-CQikgIbw.js → pairing-store-BChahgI2.js} +2 -2
- package/dist/plugin-sdk/{pi-model-discovery-CY3m5zJP.js → pi-model-discovery-BX_JLcEJ.js} +1 -1
- package/dist/plugin-sdk/{pi-model-discovery-runtime-DSh1T2pn.js → pi-model-discovery-runtime-DxTMz_XF.js} +2 -2
- package/dist/plugin-sdk/provider-web-search-config-contract.d.ts +2 -2
- package/dist/plugin-sdk/{pw-ai-AFUqn-tQ.js → pw-ai-natjh3rm.js} +3 -3
- package/dist/plugin-sdk/{qmd-manager-DSyx77KY.js → qmd-manager-CgRaTxUq.js} +1 -1
- package/dist/plugin-sdk/{query-expansion-CAI2kKLQ.js → query-expansion-BG3FgzF7.js} +14 -3
- package/dist/plugin-sdk/{replies-Fzh9PhXl.js → replies-ChYo5ZQM.js} +2 -2
- package/dist/plugin-sdk/{resolve-outbound-target-KpF3co6T.js → resolve-outbound-target-D-KGgHJZ.js} +1 -1
- package/dist/plugin-sdk/{resolve-route-CDl74O19.js → resolve-route-C8tvQm8Z.js} +1 -1
- package/dist/plugin-sdk/{retry-policy-D4uiqUOG.js → retry-policy-C6SjKjQA.js} +1 -1
- package/dist/plugin-sdk/{runtime-Bb6KRnCC.js → runtime-2B9_WKoI.js} +8 -3
- package/dist/plugin-sdk/{runtime-dependency-DLDmB94f.js → runtime-dependency-DczkvPxn.js} +2 -2
- package/dist/plugin-sdk/sat-runtime.d.ts +549 -309
- package/dist/plugin-sdk/sat-runtime.js +29 -29
- package/dist/plugin-sdk/{send-C4k4JuJN.js → send-B6KkGKZD.js} +6 -6
- package/dist/plugin-sdk/{send-D-uDKGIq.js → send-CFzGKJXo.js} +6 -6
- package/dist/plugin-sdk/{send-Du8ykP1k.js → send-DCO441U7.js} +8 -8
- package/dist/plugin-sdk/{send-5nFktR1n.js → send-gDoGA-7e.js} +5 -5
- package/dist/plugin-sdk/{send-Bfzf11VY.js → send-q9HXrSwK.js} +7 -7
- package/dist/plugin-sdk/{session-CS-Td9EM.js → session-DHD4ZKyG.js} +2 -2
- package/dist/plugin-sdk/{skill-commands-CFAlXWHk.js → skill-commands-FKEPLS7T.js} +201 -26
- package/dist/plugin-sdk/{slack-D_bbE6Yd.js → slack-BUTt8cxK.js} +39 -39
- package/dist/plugin-sdk/{slack-actions-BcMkNv1Z.js → slack-actions-DhbMcp8M.js} +11 -11
- package/dist/plugin-sdk/slack.d.ts +5 -5
- package/dist/plugin-sdk/slack.js +9 -9
- package/dist/plugin-sdk/{sticker-cache-Dqo9nRhi.js → sticker-cache-D0wHVqjt.js} +3 -3
- package/dist/plugin-sdk/{tables-bFXyRpkx.js → tables-B3jr0Pvq.js} +1 -1
- package/dist/plugin-sdk/{targets-DH7a9lKB.js → targets-CtSbTxYX.js} +1 -1
- package/dist/plugin-sdk/{telegram-actions-Cnag7JTH.js → telegram-actions-CC_qN4v0.js} +30 -30
- package/dist/plugin-sdk/telegram.d.ts +5 -5
- package/dist/plugin-sdk/telegram.js +8 -8
- package/dist/plugin-sdk/{thread-bindings.lifecycle-CgOvvdw8.js → thread-bindings.lifecycle-QbkNl-m6.js} +3 -3
- package/dist/plugin-sdk/{thread-bindings.state-CQpk44Hq.js → thread-bindings.state-D9hg_M1c.js} +2 -2
- package/dist/plugin-sdk/tmp-fased-dir-xOTGlzBE.d.ts +486 -0
- package/dist/plugin-sdk/{types-CLIvQaVg.d.ts → types-C3avNytw.d.ts} +3 -4
- package/dist/plugin-sdk/{types-DyhXnYUr.d.ts → types-D0kDG8l0.d.ts} +3 -2
- package/dist/plugin-sdk/{types-BYDL6dQj.d.ts → types-DWfbSAaM.d.ts} +2 -2
- package/dist/plugin-sdk/{types.plugin-_fbu40Re.d.ts → types.plugin-BcSBq42x.d.ts} +8 -3
- package/dist/plugin-sdk/{web-BInKQkc4.js → web-BXsJ1vqe.js} +32 -32
- package/dist/plugin-sdk/{whatsapp-actions-BtSc2CBv.js → whatsapp-actions-Bj_rOncr.js} +13 -13
- package/dist/plugin-sdk/{whatsapp-heartbeat-Bg9TuYzl.js → whatsapp-heartbeat-B1WHkJIg.js} +2 -2
- package/dist/plugin-sdk/whatsapp.d.ts +5 -5
- package/dist/plugin-sdk/whatsapp.js +12 -12
- package/dist/plugin-sdk/{wsl-C4DGFkOd.js → wsl-J-HscWxS.js} +3 -3
- package/dist/plugins/bundled-dir.js +3 -3
- package/dist/plugins/discovery.js +11 -11
- package/dist/plugins/loader.js +13 -13
- package/dist/plugins/manifest-registry.js +2 -2
- package/dist/plugins/manifest.js +4 -4
- package/dist/plugins/path-safety.js +3 -3
- package/dist/plugins/status-cache.js +9 -9
- package/dist/plugins/update.js +3 -3
- package/dist/plugins/web-search-install-catalog.js +3 -3
- package/dist/providers/refresh.js +1 -1
- package/dist/providers/registry.js +1 -1
- package/dist/secrets/apply.js +17 -17
- package/dist/secrets/audit.js +11 -11
- package/dist/secrets/runtime.js +1 -1
- package/dist/secrets/shared.js +9 -9
- package/dist/security/scan-paths.js +2 -2
- package/dist/shared/config-eval.js +2 -2
- package/dist/shared/pid-alive.js +2 -2
- package/dist/tasks/standing-orders.js +5 -5
- package/dist/tasks/task-flow-registry.js +5 -5
- package/dist/tasks/task-registry.js +5 -5
- package/dist/tasks/workflow-definitions.js +6 -6
- package/dist/telegram/token.js +5 -5
- package/dist/utils.js +5 -5
- package/dist/wallet/external-submission-ledger.js +376 -0
- package/dist/wallet/legacy-embedded-keystore.js +40 -0
- package/dist/wallet/local-socket-signer-archive.js +30 -0
- package/dist/wallet/local-socket-signer-lifecycle.js +97 -0
- package/dist/wallet/local-socket-signer-policy.js +166 -0
- package/dist/wallet/local-socket-signer-protocol.js +561 -118
- package/dist/wallet/native-signer-wallet-id.js +25 -0
- package/dist/wallet/providers/alchemy-adapter.js +3 -0
- package/dist/wallet/providers/local-socket-signer-adapter.js +382 -107
- package/dist/wallet/providers/turnkey-adapter.js +292 -34
- package/dist/wallet/providers/wallet-standard-adapter.js +100 -0
- package/dist/wallet/signer-network-admin.js +184 -0
- package/dist/wallet/signer-protocol-v2.generated.js +90 -0
- package/dist/wallet/solana-bond-signing.js +157 -69
- package/dist/wallet/solana-reviewed-transaction.js +375 -0
- package/dist/wallet/solana-swap.js +520 -64
- package/dist/wallet/solana-transaction-inspection.js +106 -4
- package/dist/wallet/solana-trigger.js +658 -320
- package/dist/wallet/turnkey-reviewed-state.js +370 -0
- package/dist/wallet/wallet-approval-auth.js +20 -31
- package/dist/wallet/wallet-atomic-state.js +53 -0
- package/dist/wallet/wallet-audit-log.js +5 -5
- package/dist/wallet/wallet-canary.js +0 -1
- package/dist/wallet/wallet-inbound-events.js +19 -14
- package/dist/wallet/wallet-observability.js +5 -5
- package/dist/wallet/wallet-policy-simulation.js +1 -1
- package/dist/wallet/wallet-policy.js +95 -41
- package/dist/wallet/wallet-provider-capabilities.js +28 -4
- package/dist/wallet/wallet-provider-registry.js +64 -51
- package/dist/wallet/wallet-provider-resolver.js +62 -63
- package/dist/wallet/wallet-runtime-config.js +31 -44
- package/dist/wallet/wallet-secrets-store.js +44 -22
- package/dist/wallet/wallet-send-approvals.js +1894 -592
- package/dist/wallet/wallet-send-execution-ledger.js +292 -0
- package/dist/wallet/wallet-settlement-links.js +17 -16
- package/dist/wallet/wallet-standard-review.js +353 -0
- package/dist/wallet/wallet-status.js +0 -9
- package/dist/wallet/wallet-task-ledger.js +16 -2
- package/dist/web/accounts.js +3 -3
- package/dist/web/auth-store.js +18 -18
- package/dist/web/auto-reply/heartbeat-runner.js +1 -1
- package/dist/web/auto-reply/monitor.js +2 -2
- package/dist/web/session.js +4 -4
- package/dist/wizard/host-security-capability.js +15 -24
- package/dist/wizard/onboarding.finalize.js +63 -184
- package/dist/wizard/onboarding.host-security.js +118 -1368
- package/dist/wizard/onboarding.js +180 -242
- package/dist/wizard/onboarding.wallet.js +323 -829
- package/extensions/acpx/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/fased-federation/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +18 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +2 -2
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +18 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +18 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/sat-mining/index.ts +498 -153
- package/extensions/sat-mining/package.json +1 -1
- package/extensions/sat-mining/signer-codec-schema.v1.json +374 -0
- package/extensions/sat-mining/src/audit-store.ts +50 -5
- package/extensions/sat-mining/src/claim-service.ts +85 -14
- package/extensions/sat-mining/src/config.ts +9 -0
- package/extensions/sat-mining/src/cycle-progress.ts +16 -8
- package/extensions/sat-mining/src/epoch-service.ts +9 -5
- package/extensions/sat-mining/src/gateway-runner.ts +21 -1
- package/extensions/sat-mining/src/protocol-contract.ts +45 -1
- package/extensions/sat-mining/src/recovery-service.ts +312 -0
- package/extensions/sat-mining/src/round-watcher.ts +391 -81
- package/extensions/sat-mining/src/rpc-read.ts +330 -89
- package/extensions/sat-mining/src/runtime.ts +14 -0
- package/extensions/sat-mining/src/sat-bond-layout.ts +6 -0
- package/extensions/sat-mining/src/signer-codec-manifest.ts +429 -0
- package/extensions/sat-mining/src/solana-submit.ts +1199 -428
- package/extensions/sat-mining/src/submission-ledger.ts +433 -0
- package/extensions/signal/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +18 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +18 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +18 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +18 -0
- package/extensions/zalouser/package.json +1 -1
- package/install.sh +4955 -0
- package/package.json +24 -5
- package/scripts/fased-host-updater.mjs +1421 -0
- package/scripts/fased-host-updaterctl.mjs +186 -0
- package/scripts/fased-managed-service.sh +36 -0
- package/scripts/fased-managed-updater.mjs +3065 -156
- package/scripts/fased-signer-enroll-hosting.sh +275 -0
- package/scripts/fased-signer-network-hosting.sh +143 -0
- package/scripts/fased-signer-owner-policy.mjs +1430 -0
- package/scripts/fased-signer-policy-hosting.sh +50 -0
- package/scripts/fased-signer-policy-local.sh +26 -0
- package/scripts/hosted-release-manifest.mjs +185 -0
- package/scripts/install-fased-signerd.sh +217 -0
- package/scripts/install-managed-runtime.mjs +212 -10
- package/scripts/managed-runtime-layout.mjs +75 -3
- package/scripts/migrate-hosted-signer-v2.mjs +58 -0
- package/scripts/start-managed.sh +169 -360
- package/dist/control-ui/assets/mining-commit-R-6nu87p.js +0 -2
- package/dist/plugin-sdk/tmp-fased-dir-BdFQvrvw.d.ts +0 -77
- package/dist/wallet/local-socket-signer-broker.js +0 -224
- package/dist/wallet/local-socket-signer-custody.js +0 -42
- package/dist/wallet/providers/embedded-keystore-adapter.js +0 -402
- package/dist/wallet/providers/privy-adapter.js +0 -80
- package/dist/wallet/wallet-custody.js +0 -1836
|
@@ -6,13 +6,14 @@ import { assertValidSolanaAddress } from "../../wallet/solana-address.js";
|
|
|
6
6
|
import { applyWalletPolicyConfig, isWalletToolAllowed, resolveWalletRecurringTransferPolicy, upsertWalletPolicyConfig, validateWalletTxPolicy } from "../../wallet/wallet-policy.js";
|
|
7
7
|
import { resolveAgentWalletSelection } from "../../wallet/wallet-agent-selection.js";
|
|
8
8
|
import { createWalletProviderAdapter, resolveScopedRpcUrlForWallet } from "../../wallet/wallet-provider-resolver.js";
|
|
9
|
-
import { SOLANA_NATIVE_MINT, executeSolanaSwapApprovalPayload, fetchJupiterSwapOrder, inspectAndValidateSolanaSwapOrder, validateSolanaSwapIntentPolicy } from "../../wallet/solana-swap.js";
|
|
9
|
+
import { SOLANA_NATIVE_MINT, executeSolanaSwapApprovalPayload, fetchJupiterSwapOrder, inspectAndValidateSolanaSwapOrder, prepareSolanaSwapSignerReview, validateSolanaSwapIntentPolicy } from "../../wallet/solana-swap.js";
|
|
10
10
|
import { appendWalletAuditEntry } from "../../wallet/wallet-audit-log.js";
|
|
11
11
|
import { simulateWalletPolicy } from "../../wallet/wallet-policy-simulation.js";
|
|
12
|
-
import { createWalletSendApprovalRequest } from "../../wallet/wallet-send-approvals.js";
|
|
12
|
+
import { bindSignerReviewToWalletApprovalPayload, createSignerReviewApprovalRequest, createWalletSendApprovalRequest } from "../../wallet/wallet-send-approvals.js";
|
|
13
13
|
import { enforceWalletSkillAccessEnabled, enforceWalletSkillPolicy, readSkillWalletActionPermissions } from "./wallet-skill-policy.js";
|
|
14
14
|
import { normalizeTokenAmountToBaseUnits, resolveSolanaToken } from "../../wallet/solana-token-resolver.js";
|
|
15
15
|
import { cancelJupiterTriggerOrder, createJupiterTriggerLimitOrder, listJupiterTriggerOrders, readJupiterTriggerPositiveNumber, validateJupiterTriggerLimitOrderIntent } from "../../wallet/solana-trigger.js";
|
|
16
|
+
import { createHash } from "node:crypto";
|
|
16
17
|
import { Type } from "@sinclair/typebox";
|
|
17
18
|
|
|
18
19
|
//#region src/agents/tools/wallet-action-tool.ts
|
|
@@ -59,10 +60,11 @@ const WalletActionToolSchema = Type.Object({
|
|
|
59
60
|
triggerToken: Type.Optional(Type.String()),
|
|
60
61
|
triggerSymbol: Type.Optional(Type.String()),
|
|
61
62
|
triggerCondition: Type.Optional(optionalStringEnum(WALLET_ACTION_TRIGGER_CONDITIONS)),
|
|
62
|
-
triggerPriceUsd: Type.Optional(Type.Number()),
|
|
63
|
-
expiresAt: Type.Optional(Type.Number()),
|
|
63
|
+
triggerPriceUsd: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
|
64
|
+
expiresAt: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
|
64
65
|
expirySeconds: Type.Optional(Type.Number()),
|
|
65
66
|
orderId: Type.Optional(Type.String()),
|
|
67
|
+
intentId: Type.Optional(Type.String()),
|
|
66
68
|
state: Type.Optional(optionalStringEnum(WALLET_ACTION_LIMIT_HISTORY_STATES)),
|
|
67
69
|
mint: Type.Optional(Type.String()),
|
|
68
70
|
limit: Type.Optional(Type.Number()),
|
|
@@ -120,7 +122,7 @@ function scheduleMessageForTransferPlan(plan) {
|
|
|
120
122
|
"Use the wallet tool only. Do not use raw signing tools or substitute display wallet names for handles.",
|
|
121
123
|
"If amountMode is fixed, call wallet.send with amountFormat=base and the exact base-unit amount.",
|
|
122
124
|
"If amountMode is percentage, first call wallet.balance for the source wallet and asset, subtract keepAmount, apply percentage, skip when below minAmount, then call wallet.send with amountFormat=base.",
|
|
123
|
-
"If balance, policy,
|
|
125
|
+
"If balance, policy, signer, or send fails, report the failure and do not retry with different wallets, destinations, mints, or amounts.",
|
|
124
126
|
"",
|
|
125
127
|
"walletTransferSchedule:",
|
|
126
128
|
JSON.stringify(plan, null, 2)
|
|
@@ -130,16 +132,19 @@ function readPositivePercent(value) {
|
|
|
130
132
|
const raw = typeof value === "number" && Number.isFinite(value) ? value : 100;
|
|
131
133
|
return Math.max(1, Math.min(100, Math.floor(raw)));
|
|
132
134
|
}
|
|
135
|
+
function cronRunExecutionIntentId(sessionKey) {
|
|
136
|
+
const normalized = sessionKey?.trim();
|
|
137
|
+
if (!normalized || !normalized.includes(":cron:") || !normalized.includes(":run:")) {
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
140
|
+
return `cron-run:${createHash("sha256").update(normalized).digest("hex")}`;
|
|
141
|
+
}
|
|
133
142
|
function publicJupiterTriggerOrder(order) {
|
|
134
143
|
return {
|
|
135
144
|
id: order.id,
|
|
136
|
-
txSignature: order.txSignature
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
function publicJupiterTriggerVault(vault) {
|
|
140
|
-
return {
|
|
141
|
-
userPubkey: typeof vault.userPubkey === "string" ? vault.userPubkey : undefined,
|
|
142
|
-
vaultPubkey: typeof vault.vaultPubkey === "string" ? vault.vaultPubkey : undefined
|
|
145
|
+
txSignature: order.txSignature,
|
|
146
|
+
state: order.state,
|
|
147
|
+
provider: order.provider
|
|
143
148
|
};
|
|
144
149
|
}
|
|
145
150
|
function normalizeScheduleDestination(toRaw) {
|
|
@@ -197,7 +202,7 @@ function createWalletActionTool(opts) {
|
|
|
197
202
|
name: "wallet_action",
|
|
198
203
|
description: "Plan, quote, execute Solana swaps, schedule sends, and manage Jupiter Trigger limit orders through Fased policy. Use Agent wallets only. For normal SOL/token decimal amounts like 0.01, pass amountFormat=human; decimal amounts are treated as human units when amountFormat is omitted. For scheduled actions, create the schedule with cron using the schedule_plan or schedule_send output.",
|
|
199
204
|
parameters: WalletActionToolSchema,
|
|
200
|
-
execute: async (
|
|
205
|
+
execute: async (toolCallId, args) => {
|
|
201
206
|
if (!access.ok) {
|
|
202
207
|
throw new Error(access.code ?? "wallet action access denied");
|
|
203
208
|
}
|
|
@@ -211,6 +216,14 @@ function createWalletActionTool(opts) {
|
|
|
211
216
|
const slippageBps = typeof params.slippageBps === "number" && Number.isFinite(params.slippageBps) ? Math.floor(params.slippageBps) : 50;
|
|
212
217
|
const mode = readStringParam(params, "mode") === "manual" ? "manual" : "autonomous";
|
|
213
218
|
const autonomous = mode === "autonomous";
|
|
219
|
+
const toolCallExecutionIntentId = (() => {
|
|
220
|
+
const normalized = toolCallId?.trim();
|
|
221
|
+
if (!normalized) {
|
|
222
|
+
return undefined;
|
|
223
|
+
}
|
|
224
|
+
return `tool-call:${createHash("sha256").update(`${opts?.agentSessionKey?.trim() ?? "unknown-session"}\0${normalized}`).digest("hex")}`;
|
|
225
|
+
})();
|
|
226
|
+
const executionIntentId = readStringParam(params, "intentId") ?? cronRunExecutionIntentId(opts?.agentSessionKey) ?? toolCallExecutionIntentId;
|
|
214
227
|
const scheduled = action === "schedule_plan";
|
|
215
228
|
const requesterSkillId = opts?.requesterSkillId?.trim() || null;
|
|
216
229
|
const permissions = readSkillWalletActionPermissions(cfg, requesterSkillId);
|
|
@@ -398,7 +411,7 @@ function createWalletActionTool(opts) {
|
|
|
398
411
|
"fixed amount or percentage rule",
|
|
399
412
|
"minimum and keep balance for percentage schedules",
|
|
400
413
|
"per-wallet SOL caps or per-mint token caps",
|
|
401
|
-
"Agent automation and
|
|
414
|
+
"Agent automation and signer policy state"
|
|
402
415
|
],
|
|
403
416
|
message: "Review this scheduled transfer, then create it with the cron tool. It is disabled by default and runtime caps are enforced on every run."
|
|
404
417
|
});
|
|
@@ -466,6 +479,44 @@ function createWalletActionTool(opts) {
|
|
|
466
479
|
throw new Error("automated execution disabled by wallet policy");
|
|
467
480
|
}
|
|
468
481
|
const orderId = readStringParam(params, "orderId", { required: true });
|
|
482
|
+
if (!autonomous) {
|
|
483
|
+
const prepared = await cancelJupiterTriggerOrder({
|
|
484
|
+
provider,
|
|
485
|
+
walletId: selection.walletId,
|
|
486
|
+
walletAddress: taker,
|
|
487
|
+
orderId,
|
|
488
|
+
autonomous: false,
|
|
489
|
+
intentId: executionIntentId,
|
|
490
|
+
env: process.env
|
|
491
|
+
});
|
|
492
|
+
if (prepared.mode !== "reviewed") {
|
|
493
|
+
throw new Error("Jupiter Trigger cancellation did not return an exact signer review");
|
|
494
|
+
}
|
|
495
|
+
const request = createSignerReviewApprovalRequest({
|
|
496
|
+
review: prepared.review,
|
|
497
|
+
role: "agent",
|
|
498
|
+
walletId: selection.walletId,
|
|
499
|
+
walletName: selection.walletName,
|
|
500
|
+
requestedBy: requesterAgentId ?? ownerAgentId ?? "agent",
|
|
501
|
+
memo: `Cancel Jupiter Trigger order ${orderId}`,
|
|
502
|
+
env: process.env
|
|
503
|
+
});
|
|
504
|
+
return jsonResult({
|
|
505
|
+
ok: false,
|
|
506
|
+
approvalRequired: true,
|
|
507
|
+
code: "wallet_trigger_approval_required",
|
|
508
|
+
requestId: request.id,
|
|
509
|
+
expiresAt: request.expiresAt,
|
|
510
|
+
plan: {
|
|
511
|
+
kind: "solana_limit_cancel",
|
|
512
|
+
walletHandle: selection.walletHandle,
|
|
513
|
+
walletId: selection.walletId,
|
|
514
|
+
orderId,
|
|
515
|
+
mode
|
|
516
|
+
},
|
|
517
|
+
message: "Jupiter Trigger cancellation requires operator approval in Control UI. No cancel side effect has occurred."
|
|
518
|
+
});
|
|
519
|
+
}
|
|
469
520
|
appendWalletAuditEntry({
|
|
470
521
|
action: "send_requested",
|
|
471
522
|
actor: requesterAgentId ?? ownerAgentId ?? "agent",
|
|
@@ -485,9 +536,13 @@ function createWalletActionTool(opts) {
|
|
|
485
536
|
walletId: selection.walletId,
|
|
486
537
|
walletAddress: taker,
|
|
487
538
|
orderId,
|
|
488
|
-
|
|
539
|
+
autonomous: true,
|
|
540
|
+
intentId: executionIntentId,
|
|
489
541
|
env: process.env
|
|
490
542
|
});
|
|
543
|
+
if (cancelled.mode !== "autonomous") {
|
|
544
|
+
throw new Error("Jupiter Trigger autonomous cancellation returned a review");
|
|
545
|
+
}
|
|
491
546
|
appendWalletAuditEntry({
|
|
492
547
|
action: "send_executed",
|
|
493
548
|
actor: requesterAgentId ?? ownerAgentId ?? "agent",
|
|
@@ -497,7 +552,7 @@ function createWalletActionTool(opts) {
|
|
|
497
552
|
walletId: selection.walletId,
|
|
498
553
|
orderId,
|
|
499
554
|
mode,
|
|
500
|
-
txHash: cancelled.
|
|
555
|
+
txHash: cancelled.operation.signature
|
|
501
556
|
},
|
|
502
557
|
env: process.env
|
|
503
558
|
});
|
|
@@ -506,7 +561,13 @@ function createWalletActionTool(opts) {
|
|
|
506
561
|
cancelled: true,
|
|
507
562
|
walletHandle: selection.walletHandle,
|
|
508
563
|
orderId,
|
|
509
|
-
|
|
564
|
+
order: cancelled.order,
|
|
565
|
+
tx: {
|
|
566
|
+
ok: true,
|
|
567
|
+
chain: "solana",
|
|
568
|
+
txHash: cancelled.operation.signature,
|
|
569
|
+
signer: taker
|
|
570
|
+
}
|
|
510
571
|
});
|
|
511
572
|
}
|
|
512
573
|
const inputToken = await resolveSolanaToken({
|
|
@@ -575,7 +636,8 @@ function createWalletActionTool(opts) {
|
|
|
575
636
|
amount,
|
|
576
637
|
amountFormat: "base",
|
|
577
638
|
slippageBps,
|
|
578
|
-
mode
|
|
639
|
+
mode,
|
|
640
|
+
executionIntentId
|
|
579
641
|
};
|
|
580
642
|
if (action === "limit_order") {
|
|
581
643
|
const triggerCondition = readStringParam(params, "triggerCondition");
|
|
@@ -592,7 +654,7 @@ function createWalletActionTool(opts) {
|
|
|
592
654
|
query: triggerTokenQuery,
|
|
593
655
|
rpcUrl
|
|
594
656
|
}) : inputToken;
|
|
595
|
-
const expiresAt = typeof params.expiresAt === "number" && Number.isFinite(params.expiresAt) ? Math.floor(params.expiresAt) :
|
|
657
|
+
const expiresAt = typeof params.expiresAt === "number" && Number.isFinite(params.expiresAt) ? Math.floor(params.expiresAt) : readStringParam(params, "expiresAt");
|
|
596
658
|
const expirySeconds = typeof params.expirySeconds === "number" && Number.isFinite(params.expirySeconds) ? Math.floor(params.expirySeconds) : undefined;
|
|
597
659
|
const limitPolicy = validateJupiterTriggerLimitOrderIntent({
|
|
598
660
|
config: effectiveWallet,
|
|
@@ -624,12 +686,49 @@ function createWalletActionTool(opts) {
|
|
|
624
686
|
triggerPriceUsd,
|
|
625
687
|
expiresAt,
|
|
626
688
|
expirySeconds,
|
|
627
|
-
|
|
689
|
+
executionProvider: "jupiter-trigger-v2"
|
|
628
690
|
};
|
|
629
691
|
if (!autonomous) {
|
|
692
|
+
const prepared = await createJupiterTriggerLimitOrder({
|
|
693
|
+
provider,
|
|
694
|
+
walletId: selection.walletId,
|
|
695
|
+
walletAddress: taker,
|
|
696
|
+
config: effectiveWallet,
|
|
697
|
+
inputMint,
|
|
698
|
+
outputMint,
|
|
699
|
+
amount,
|
|
700
|
+
triggerCondition,
|
|
701
|
+
triggerPriceUsd,
|
|
702
|
+
triggerMint: triggerToken.mint,
|
|
703
|
+
slippageBps,
|
|
704
|
+
expiresAt,
|
|
705
|
+
expirySeconds,
|
|
706
|
+
autonomous: false,
|
|
707
|
+
intentId: executionIntentId,
|
|
708
|
+
rpcUrl,
|
|
709
|
+
env: process.env
|
|
710
|
+
});
|
|
711
|
+
if (prepared.mode !== "reviewed") {
|
|
712
|
+
throw new Error("Jupiter Trigger create did not return an exact signer review");
|
|
713
|
+
}
|
|
714
|
+
const request = createSignerReviewApprovalRequest({
|
|
715
|
+
review: prepared.review,
|
|
716
|
+
role: "agent",
|
|
717
|
+
walletId: selection.walletId,
|
|
718
|
+
walletName: selection.walletName,
|
|
719
|
+
assetSymbol: inputToken.symbol,
|
|
720
|
+
assetName: inputToken.name,
|
|
721
|
+
amountDisplay: amountFormat === "human" ? readStringParam(params, "amount") : undefined,
|
|
722
|
+
requestedBy: requesterAgentId ?? ownerAgentId ?? "agent",
|
|
723
|
+
memo: `Create Jupiter Trigger ${triggerCondition} ${triggerPriceUsd} USD`,
|
|
724
|
+
env: process.env
|
|
725
|
+
});
|
|
630
726
|
return jsonResult({
|
|
631
|
-
ok:
|
|
632
|
-
|
|
727
|
+
ok: false,
|
|
728
|
+
approvalRequired: true,
|
|
729
|
+
code: "wallet_trigger_approval_required",
|
|
730
|
+
requestId: request.id,
|
|
731
|
+
expiresAt: request.expiresAt,
|
|
633
732
|
plan: limitPlan,
|
|
634
733
|
reviewChecklist: [
|
|
635
734
|
"wallet handle",
|
|
@@ -639,7 +738,7 @@ function createWalletActionTool(opts) {
|
|
|
639
738
|
"expiry",
|
|
640
739
|
"Jupiter Trigger vault custody while order is active"
|
|
641
740
|
],
|
|
642
|
-
message: "
|
|
741
|
+
message: "Jupiter Trigger create requires operator approval in Control UI. No vault, deposit, or order side effect has occurred."
|
|
643
742
|
});
|
|
644
743
|
}
|
|
645
744
|
appendWalletAuditEntry({
|
|
@@ -669,11 +768,14 @@ function createWalletActionTool(opts) {
|
|
|
669
768
|
expiresAt,
|
|
670
769
|
expirySeconds,
|
|
671
770
|
autonomous,
|
|
771
|
+
intentId: executionIntentId,
|
|
672
772
|
rpcUrl,
|
|
673
773
|
env: process.env
|
|
674
774
|
});
|
|
775
|
+
if (created.mode !== "autonomous") {
|
|
776
|
+
throw new Error("Jupiter Trigger autonomous create returned a review");
|
|
777
|
+
}
|
|
675
778
|
const order = publicJupiterTriggerOrder(created.order);
|
|
676
|
-
const vault = publicJupiterTriggerVault(created.vault);
|
|
677
779
|
appendWalletAuditEntry({
|
|
678
780
|
action: "send_executed",
|
|
679
781
|
actor: requesterAgentId ?? ownerAgentId ?? "agent",
|
|
@@ -681,8 +783,7 @@ function createWalletActionTool(opts) {
|
|
|
681
783
|
...limitPlan,
|
|
682
784
|
mode,
|
|
683
785
|
orderId: order.id,
|
|
684
|
-
txHash: order.txSignature
|
|
685
|
-
vaultPubkey: vault.vaultPubkey
|
|
786
|
+
txHash: order.txSignature
|
|
686
787
|
},
|
|
687
788
|
env: process.env
|
|
688
789
|
});
|
|
@@ -691,8 +792,7 @@ function createWalletActionTool(opts) {
|
|
|
691
792
|
live: true,
|
|
692
793
|
plan: limitPlan,
|
|
693
794
|
order,
|
|
694
|
-
|
|
695
|
-
message: "Jupiter Trigger limit order created. Deposited funds sit in the Jupiter Trigger vault until fill, expiry, or cancellation."
|
|
795
|
+
message: "Jupiter Trigger limit order created through the signer-owned durable workflow."
|
|
696
796
|
});
|
|
697
797
|
} catch (err) {
|
|
698
798
|
appendWalletAuditEntry({
|
|
@@ -759,7 +859,15 @@ function createWalletActionTool(opts) {
|
|
|
759
859
|
message: "Review this scheduled task, then create it with the task tool. It is disabled by default."
|
|
760
860
|
});
|
|
761
861
|
}
|
|
762
|
-
const
|
|
862
|
+
const deferAutonomousOrder = action === "swap" && autonomous;
|
|
863
|
+
const order = deferAutonomousOrder ? {
|
|
864
|
+
ok: true,
|
|
865
|
+
inputMint,
|
|
866
|
+
outputMint,
|
|
867
|
+
inAmount: amount,
|
|
868
|
+
slippageBps,
|
|
869
|
+
raw: {}
|
|
870
|
+
} : await fetchJupiterSwapOrder({
|
|
763
871
|
inputMint,
|
|
764
872
|
outputMint,
|
|
765
873
|
amount,
|
|
@@ -767,13 +875,13 @@ function createWalletActionTool(opts) {
|
|
|
767
875
|
taker,
|
|
768
876
|
env: process.env
|
|
769
877
|
});
|
|
770
|
-
const inspection = await inspectAndValidateSolanaSwapOrder({
|
|
878
|
+
const inspection = deferAutonomousOrder ? undefined : await inspectAndValidateSolanaSwapOrder({
|
|
771
879
|
order,
|
|
772
880
|
expectedSigner: taker,
|
|
773
881
|
rpcUrl,
|
|
774
882
|
config: effectiveWallet
|
|
775
883
|
});
|
|
776
|
-
if (!inspection.ok) {
|
|
884
|
+
if (inspection && !inspection.ok) {
|
|
777
885
|
throw new Error(inspection.message);
|
|
778
886
|
}
|
|
779
887
|
const payload = {
|
|
@@ -803,12 +911,18 @@ function createWalletActionTool(opts) {
|
|
|
803
911
|
slippageBps: order.slippageBps ?? slippageBps,
|
|
804
912
|
priceImpactPct: order.priceImpactPct,
|
|
805
913
|
routeLabel: order.routeLabel,
|
|
806
|
-
programIds: inspection.programIds,
|
|
807
|
-
routeProgramIds: inspection.routeProgramIds,
|
|
808
|
-
|
|
809
|
-
|
|
914
|
+
programIds: inspection?.ok ? inspection.programIds : undefined,
|
|
915
|
+
routeProgramIds: inspection?.ok ? inspection.routeProgramIds : undefined,
|
|
916
|
+
writableAccounts: inspection?.ok ? inspection.writableAccounts : undefined,
|
|
917
|
+
usesAddressLookupTables: inspection?.ok ? inspection.usesAddressLookupTables : undefined,
|
|
918
|
+
jupiterRequestId: order.requestId,
|
|
919
|
+
executionIntentId,
|
|
920
|
+
serializedTxBase64: order.transaction
|
|
810
921
|
};
|
|
811
922
|
if (action === "quote") {
|
|
923
|
+
if (!inspection?.ok) {
|
|
924
|
+
throw new Error("Jupiter quote inspection is unavailable");
|
|
925
|
+
}
|
|
812
926
|
return jsonResult({
|
|
813
927
|
ok: true,
|
|
814
928
|
plan,
|
|
@@ -851,6 +965,9 @@ function createWalletActionTool(opts) {
|
|
|
851
965
|
env: process.env
|
|
852
966
|
});
|
|
853
967
|
if (!autonomous) {
|
|
968
|
+
if (!inspection?.ok) {
|
|
969
|
+
throw new Error("reviewed Jupiter swap inspection is unavailable");
|
|
970
|
+
}
|
|
854
971
|
const simulation = simulateWalletPolicy({
|
|
855
972
|
cfg,
|
|
856
973
|
config: effectiveWallet,
|
|
@@ -866,8 +983,27 @@ function createWalletActionTool(opts) {
|
|
|
866
983
|
const failed = simulation.checks.find((check) => check.status === "fail");
|
|
867
984
|
throw new Error(failed?.detail ?? "wallet policy rejected");
|
|
868
985
|
}
|
|
869
|
-
|
|
986
|
+
if (!rpcUrl?.trim()) {
|
|
987
|
+
throw new Error("Solana RPC is required to prepare a signer-owned swap review");
|
|
988
|
+
}
|
|
989
|
+
const signerReview = await prepareSolanaSwapSignerReview({
|
|
990
|
+
provider,
|
|
991
|
+
walletId: selection.walletId,
|
|
992
|
+
owner: taker,
|
|
993
|
+
order,
|
|
994
|
+
inspection,
|
|
995
|
+
rpcUrl,
|
|
996
|
+
mode: "reviewed",
|
|
997
|
+
env: process.env
|
|
998
|
+
});
|
|
999
|
+
const reviewedPayload = bindSignerReviewToWalletApprovalPayload({
|
|
870
1000
|
payload,
|
|
1001
|
+
review: signerReview.review,
|
|
1002
|
+
role: "agent"
|
|
1003
|
+
});
|
|
1004
|
+
const request = createWalletSendApprovalRequest({
|
|
1005
|
+
expiresAt: signerReview.review.expiresAt,
|
|
1006
|
+
payload: reviewedPayload,
|
|
871
1007
|
requestedBy: requesterAgentId ?? ownerAgentId ?? "agent",
|
|
872
1008
|
simulation,
|
|
873
1009
|
approvalDiff: simulation.diff,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent-scope.js";
|
|
2
2
|
import { readClawHubSkillOrigin } from "../skills-clawhub.js";
|
|
3
|
+
import { isMarketplaceSkillDir, marketplaceSkillProvenanceMatchesContent } from "../skills/trust.js";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
|
|
5
6
|
//#region src/agents/tools/wallet-skill-policy.ts
|
|
6
|
-
const
|
|
7
|
+
const LOCAL_WALLET_ACTION_SOURCE = "local";
|
|
7
8
|
function normalizeList(value) {
|
|
8
9
|
if (!Array.isArray(value)) {
|
|
9
10
|
return undefined;
|
|
@@ -27,13 +28,10 @@ function normalizeRegistryUrl(value) {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
function normalizeRegistryList(values) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function readSkillsMarketplaceAllowRegistries(cfg) {
|
|
35
|
-
const raw = cfg?.skills?.marketplace?.allowRegistries;
|
|
36
|
-
return normalizeRegistryList(raw);
|
|
31
|
+
if (!Array.isArray(values)) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
return values.map((entry) => normalizeRegistryUrl(String(entry))).filter((entry) => Boolean(entry));
|
|
37
35
|
}
|
|
38
36
|
function normalizeSkillPathId(skillId) {
|
|
39
37
|
const id = skillId.trim();
|
|
@@ -51,7 +49,11 @@ async function readRequesterSkillOrigin(params) {
|
|
|
51
49
|
const agentIds = [params.requesterAgentId?.trim() || resolveDefaultAgentId(cfg), resolveDefaultAgentId(cfg)].filter(Boolean);
|
|
52
50
|
const workspaces = [...new Set(agentIds.map((agentId) => resolveAgentWorkspaceDir(cfg, agentId)))];
|
|
53
51
|
for (const workspaceDir of workspaces) {
|
|
54
|
-
const
|
|
52
|
+
const skillDir = path.join(workspaceDir, "skills", skillPathId);
|
|
53
|
+
if (isMarketplaceSkillDir(skillDir) && !marketplaceSkillProvenanceMatchesContent(skillDir)) {
|
|
54
|
+
throw new Error("wallet_action_skill_marketplace_content_integrity_failed");
|
|
55
|
+
}
|
|
56
|
+
const origin = await readClawHubSkillOrigin(skillDir);
|
|
55
57
|
if (origin) {
|
|
56
58
|
return {
|
|
57
59
|
registry: origin.registry,
|
|
@@ -109,11 +111,19 @@ async function enforceWalletSkillPolicy(params) {
|
|
|
109
111
|
}
|
|
110
112
|
return;
|
|
111
113
|
}
|
|
112
|
-
if (permissions.actions?.length
|
|
114
|
+
if (!permissions.actions?.length) {
|
|
115
|
+
throw new Error("wallet_action_skill_actions_required");
|
|
116
|
+
}
|
|
117
|
+
if (!permissions.actions.includes(params.action)) {
|
|
113
118
|
throw new Error("wallet_action_skill_action_not_allowed");
|
|
114
119
|
}
|
|
115
|
-
if (params.role
|
|
116
|
-
|
|
120
|
+
if (params.role) {
|
|
121
|
+
if (!permissions.roles?.length) {
|
|
122
|
+
throw new Error("wallet_action_skill_roles_required");
|
|
123
|
+
}
|
|
124
|
+
if (!permissions.roles.includes(params.role)) {
|
|
125
|
+
throw new Error("wallet_action_skill_role_not_allowed");
|
|
126
|
+
}
|
|
117
127
|
}
|
|
118
128
|
if (!permissions.walletIds?.length) {
|
|
119
129
|
throw new Error("wallet_action_skill_wallet_required");
|
|
@@ -121,20 +131,45 @@ async function enforceWalletSkillPolicy(params) {
|
|
|
121
131
|
if (!params.walletId || !permissions.walletIds.includes(params.walletId)) {
|
|
122
132
|
throw new Error("wallet_action_skill_wallet_not_allowed");
|
|
123
133
|
}
|
|
124
|
-
if (params.chain
|
|
125
|
-
|
|
134
|
+
if (params.chain) {
|
|
135
|
+
if (!permissions.chains?.length) {
|
|
136
|
+
throw new Error("wallet_action_skill_chains_required");
|
|
137
|
+
}
|
|
138
|
+
if (!permissions.chains.includes(params.chain)) {
|
|
139
|
+
throw new Error("wallet_action_skill_chain_not_allowed");
|
|
140
|
+
}
|
|
126
141
|
}
|
|
127
|
-
if (params.inputMint
|
|
128
|
-
|
|
142
|
+
if (params.inputMint) {
|
|
143
|
+
if (!permissions.inputMints?.length) {
|
|
144
|
+
throw new Error("wallet_action_skill_input_mints_required");
|
|
145
|
+
}
|
|
146
|
+
if (!permissions.inputMints.includes(params.inputMint)) {
|
|
147
|
+
throw new Error("wallet_action_skill_input_mint_not_allowed");
|
|
148
|
+
}
|
|
129
149
|
}
|
|
130
|
-
if (params.outputMint
|
|
131
|
-
|
|
150
|
+
if (params.outputMint) {
|
|
151
|
+
if (!permissions.outputMints?.length) {
|
|
152
|
+
throw new Error("wallet_action_skill_output_mints_required");
|
|
153
|
+
}
|
|
154
|
+
if (!permissions.outputMints.includes(params.outputMint)) {
|
|
155
|
+
throw new Error("wallet_action_skill_output_mint_not_allowed");
|
|
156
|
+
}
|
|
132
157
|
}
|
|
133
|
-
if (
|
|
134
|
-
|
|
158
|
+
if (params.amount) {
|
|
159
|
+
if (!permissions.maxAmount) {
|
|
160
|
+
throw new Error("wallet_action_skill_amount_cap_required");
|
|
161
|
+
}
|
|
162
|
+
if (BigInt(params.amount) > BigInt(permissions.maxAmount)) {
|
|
163
|
+
throw new Error("wallet_action_skill_amount_cap_exceeded");
|
|
164
|
+
}
|
|
135
165
|
}
|
|
136
|
-
if (
|
|
137
|
-
|
|
166
|
+
if (params.slippageBps !== undefined) {
|
|
167
|
+
if (permissions.maxSlippageBps === undefined) {
|
|
168
|
+
throw new Error("wallet_action_skill_slippage_cap_required");
|
|
169
|
+
}
|
|
170
|
+
if (params.slippageBps > permissions.maxSlippageBps) {
|
|
171
|
+
throw new Error("wallet_action_skill_slippage_cap_exceeded");
|
|
172
|
+
}
|
|
138
173
|
}
|
|
139
174
|
if (params.autonomous && permissions.autonomous !== true) {
|
|
140
175
|
throw new Error("wallet_action_skill_autonomous_not_allowed");
|
|
@@ -142,6 +177,9 @@ async function enforceWalletSkillPolicy(params) {
|
|
|
142
177
|
if (params.scheduled && permissions.cron !== true) {
|
|
143
178
|
throw new Error("wallet_action_skill_cron_not_allowed");
|
|
144
179
|
}
|
|
180
|
+
if (!permissions.registries?.length) {
|
|
181
|
+
throw new Error("wallet_action_skill_registries_required");
|
|
182
|
+
}
|
|
145
183
|
const origin = await readRequesterSkillOrigin({
|
|
146
184
|
cfg: params.cfg,
|
|
147
185
|
requesterAgentId: params.requesterAgentId,
|
|
@@ -149,9 +187,13 @@ async function enforceWalletSkillPolicy(params) {
|
|
|
149
187
|
env: params.env
|
|
150
188
|
});
|
|
151
189
|
if (!origin) {
|
|
190
|
+
const allowedSources = normalizeRegistryList(permissions.registries);
|
|
191
|
+
if (!allowedSources.includes(LOCAL_WALLET_ACTION_SOURCE)) {
|
|
192
|
+
throw new Error("wallet_action_skill_local_source_not_allowed");
|
|
193
|
+
}
|
|
152
194
|
return;
|
|
153
195
|
}
|
|
154
|
-
const allowedRegistries = normalizeRegistryList(permissions.registries
|
|
196
|
+
const allowedRegistries = normalizeRegistryList(permissions.registries);
|
|
155
197
|
const registry = normalizeRegistryUrl(origin.registry);
|
|
156
198
|
if (!registry || !allowedRegistries.includes(registry)) {
|
|
157
199
|
throw new Error("wallet_action_skill_registry_not_allowlisted");
|
|
@@ -28,11 +28,10 @@ const WALLET_ACTIONS = [
|
|
|
28
28
|
const WALLET_CHAINS = ["solana"];
|
|
29
29
|
const WALLET_AMOUNT_FORMATS = ["base", "human"];
|
|
30
30
|
const WALLET_PROVIDERS = [
|
|
31
|
-
"embedded-keystore",
|
|
32
31
|
"local-socket-signer",
|
|
33
32
|
"alchemy",
|
|
34
33
|
"turnkey",
|
|
35
|
-
"
|
|
34
|
+
"wallet-standard"
|
|
36
35
|
];
|
|
37
36
|
const WalletToolSchema = Type.Object({
|
|
38
37
|
action: stringEnum(WALLET_ACTIONS),
|
|
@@ -47,9 +46,7 @@ const WalletToolSchema = Type.Object({
|
|
|
47
46
|
address: Type.Optional(Type.String()),
|
|
48
47
|
walletHandle: Type.Optional(Type.String()),
|
|
49
48
|
walletId: Type.Optional(Type.String()),
|
|
50
|
-
walletName: Type.Optional(Type.String())
|
|
51
|
-
approvalToken: Type.Optional(Type.String()),
|
|
52
|
-
approvalHost: Type.Optional(Type.String())
|
|
49
|
+
walletName: Type.Optional(Type.String())
|
|
53
50
|
});
|
|
54
51
|
function resolveCreateOrExecuteWalletSend() {
|
|
55
52
|
const mod = wallet_send_approvals_exports;
|
|
@@ -73,11 +70,10 @@ function resolveRequesterAgentId(params) {
|
|
|
73
70
|
}
|
|
74
71
|
function parseWalletProviderId(value) {
|
|
75
72
|
switch (value) {
|
|
76
|
-
case "embedded-keystore":
|
|
77
73
|
case "local-socket-signer":
|
|
78
74
|
case "alchemy":
|
|
79
75
|
case "turnkey":
|
|
80
|
-
case "
|
|
76
|
+
case "wallet-standard": return value;
|
|
81
77
|
default: return undefined;
|
|
82
78
|
}
|
|
83
79
|
}
|
|
@@ -643,8 +639,6 @@ function createWalletTool(opts) {
|
|
|
643
639
|
if (chain === "solana" && payload.program) {
|
|
644
640
|
assertValidSolanaAddress(payload.program, "SPL mint address");
|
|
645
641
|
}
|
|
646
|
-
const approvalToken = readStringParam(params, "approvalToken");
|
|
647
|
-
const approvalHost = readStringParam(params, "approvalHost");
|
|
648
642
|
const requesterSkillId = opts?.requesterSkillId?.trim() || null;
|
|
649
643
|
const permissions = readSkillWalletActionPermissions(cfg, requesterSkillId);
|
|
650
644
|
await enforceWalletSkillPolicy({
|
|
@@ -683,6 +677,9 @@ function createWalletTool(opts) {
|
|
|
683
677
|
throw new Error(`wallet provider ${provider.id} does not support ${action} on chain: ${chain}`);
|
|
684
678
|
}
|
|
685
679
|
if (action === "prepare") {
|
|
680
|
+
if (!provider.prepareTx) {
|
|
681
|
+
throw new Error(`wallet provider ${provider.id} does not support prepare`);
|
|
682
|
+
}
|
|
686
683
|
const result = await provider.prepareTx(payload);
|
|
687
684
|
return jsonResult({
|
|
688
685
|
ok: true,
|
|
@@ -696,12 +693,11 @@ function createWalletTool(opts) {
|
|
|
696
693
|
const result = await createOrExecute({
|
|
697
694
|
payload,
|
|
698
695
|
requestedBy: requesterAgentId ?? ownerAgentId,
|
|
696
|
+
executionIntentId: `agent-wallet-tool:${_toolCallId}`,
|
|
699
697
|
sendPath: "automation",
|
|
700
698
|
config: effectiveWallet,
|
|
701
699
|
runtimeConfig: cfg,
|
|
702
700
|
providerIdOverride: walletSelection.providerId,
|
|
703
|
-
approvalToken,
|
|
704
|
-
approvalHost,
|
|
705
701
|
env: process.env
|
|
706
702
|
});
|
|
707
703
|
if (!result.ok) {
|