@fased/fased 0.1.62 → 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 +32 -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/agents/auth-profiles/store.js +267 -31
- package/dist/agents/bash-tools.exec.js +10 -4
- package/dist/agents/current-model-catalog.js +3 -3
- 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/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-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/skills/env-overrides.js +38 -28
- package/dist/agents/skills/trust.js +93 -0
- package/dist/agents/skills/workspace.js +128 -0
- package/dist/agents/skills-clawhub.js +36 -11
- package/dist/agents/skills-marketplace-scan.js +49 -0
- 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/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/session-reset-model.js +4 -4
- package/dist/brand.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/channel-web.js +2 -2
- package/dist/cli/gateway-cli/run.js +8 -0
- 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/update-cli/update-command.js +260 -11
- package/dist/commands/auth-choice.apply.api-providers.js +3 -3
- package/dist/commands/doctor-config-flow.js +1 -1
- package/dist/commands/doctor-legacy-config.js +2 -13
- 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 +32 -8
- 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/wallet.js +568 -1911
- package/dist/config/config.js +2 -2
- package/dist/config/io.js +64 -2
- package/dist/config/schema.help.js +8 -7
- package/dist/config/schema.labels.js +5 -4
- package/dist/config/zod-schema.agent-runtime.js +1 -0
- package/dist/config/zod-schema.js +5 -0
- package/dist/control-ui/assets/{app-DLil9VO1.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-DdE_NIXo.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/daemon/systemd-system.js +56 -50
- 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 +5 -2
- 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/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/mutating-admin-rpc-rate-limit.js +5 -0
- package/dist/gateway/security-path.js +1 -1
- package/dist/gateway/server-http.js +1084 -1205
- package/dist/gateway/server-methods/models.js +1 -1
- package/dist/gateway/server-methods/secrets.js +40 -0
- 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/sessions-patch.js +3 -5
- package/dist/index.js +4 -2
- package/dist/infra/fasedhub.js +64 -1
- package/dist/infra/local-source-paired-update.js +538 -0
- package/dist/infra/restart.js +41 -10
- package/dist/infra/update-runner.js +96 -0
- package/dist/light-update-status.js +11 -11
- package/dist/memory/backend-config.js +2 -1
- package/dist/memory/session-files.js +16 -2
- 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-Bwi2Oq03.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-DzT4L4Ty.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-BrkmtFxB.js → config-schema-BOT7kHb6.js} +6779 -3696
- package/dist/plugin-sdk/device-pair.d.ts +1 -1
- package/dist/plugin-sdk/discord.d.ts +6 -6
- 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 +21 -39
- package/dist/plugin-sdk/index.js +29 -29
- 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-M_ta2lMc.js → monitor-BCFDaqJ-.js} +31 -31
- package/dist/plugin-sdk/{monitor-wYVncM9w.js → monitor-BgbjRiPM.js} +32 -32
- package/dist/plugin-sdk/{openresponses-http-B2GmeSt4.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-B3bHYGaw.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-CxE1mfzj.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 +6 -6
- package/dist/plugin-sdk/slack.js +9 -9
- package/dist/plugin-sdk/{sticker-cache-CGzGWu00.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-DaEcYQ8r.js → telegram-actions-CC_qN4v0.js} +30 -30
- package/dist/plugin-sdk/telegram.d.ts +6 -6
- 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-vcJrC_uv.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-DFAW-n1J.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-CInY-lCv.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 +13 -13
- package/dist/plugin-sdk/whatsapp.js +12 -12
- package/dist/plugin-sdk/{wsl-C4DGFkOd.js → wsl-J-HscWxS.js} +3 -3
- package/dist/plugin-sdk/{zod-schema.providers-core-BEbNizPe.d.ts → zod-schema.providers-core-CIzCjXH9.d.ts} +61 -61
- package/dist/providers/refresh.js +1 -1
- package/dist/providers/registry.js +1 -1
- package/dist/secrets/apply.js +1 -1
- package/dist/secrets/runtime.js +1 -1
- 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 +380 -105
- 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 +17 -28
- package/dist/wallet/wallet-atomic-state.js +53 -0
- package/dist/wallet/wallet-canary.js +0 -1
- package/dist/wallet/wallet-inbound-events.js +16 -11
- package/dist/wallet/wallet-policy-simulation.js +1 -1
- package/dist/wallet/wallet-policy.js +90 -36
- package/dist/wallet/wallet-provider-capabilities.js +28 -4
- package/dist/wallet/wallet-provider-registry.js +57 -44
- package/dist/wallet/wallet-provider-resolver.js +62 -63
- package/dist/wallet/wallet-runtime-config.js +28 -41
- package/dist/wallet/wallet-secrets-store.js +22 -0
- package/dist/wallet/wallet-send-approvals.js +1891 -589
- package/dist/wallet/wallet-send-execution-ledger.js +292 -0
- package/dist/wallet/wallet-settlement-links.js +14 -13
- 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/auto-reply/heartbeat-runner.js +1 -1
- package/dist/web/auto-reply/monitor.js +2 -2
- package/dist/wizard/host-security-capability.js +14 -23
- package/dist/wizard/onboarding.finalize.js +63 -184
- package/dist/wizard/onboarding.host-security.js +117 -1367
- package/dist/wizard/onboarding.js +172 -217
- package/dist/wizard/onboarding.wallet.js +232 -785
- 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 +12 -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 +12 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +12 -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 +12 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +12 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +12 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +12 -0
- package/extensions/zalouser/package.json +1 -1
- package/install.sh +4955 -0
- package/package.json +23 -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 +183 -108
- 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-CS6zsYEE.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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/wallet/native-signer-wallet-id.ts
|
|
2
|
+
function normalizeNativeSignerWalletId(value) {
|
|
3
|
+
const normalized = value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
4
|
+
return normalized || "default";
|
|
5
|
+
}
|
|
6
|
+
function resolveNativeSignerWalletId(wallet) {
|
|
7
|
+
if (wallet.providerId !== "local-socket-signer") {
|
|
8
|
+
throw new Error(`wallet ${wallet.id} is not owned by the native signer`);
|
|
9
|
+
}
|
|
10
|
+
const recorded = typeof wallet.metadata?.signerWalletId === "string" ? wallet.metadata.signerWalletId.trim() : "";
|
|
11
|
+
if (recorded) {
|
|
12
|
+
if (recorded.length > 64 || normalizeNativeSignerWalletId(recorded) !== recorded) {
|
|
13
|
+
throw new Error(`wallet ${wallet.id} has a non-canonical native signer wallet ID`);
|
|
14
|
+
}
|
|
15
|
+
return recorded;
|
|
16
|
+
}
|
|
17
|
+
const fallback = normalizeNativeSignerWalletId(wallet.id);
|
|
18
|
+
if (fallback.length > 64) {
|
|
19
|
+
throw new Error(`wallet ${wallet.id} has an overlong native signer wallet ID`);
|
|
20
|
+
}
|
|
21
|
+
return fallback;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { normalizeNativeSignerWalletId, resolveNativeSignerWalletId };
|
|
@@ -18,6 +18,9 @@ var AlchemyAdapter = class {
|
|
|
18
18
|
supportsRotateKeys: false,
|
|
19
19
|
supportsResetKeys: false,
|
|
20
20
|
supportsPasskeyGate: false,
|
|
21
|
+
signingLocation: "unavailable",
|
|
22
|
+
supportsSignTransaction: false,
|
|
23
|
+
supportsSignMessage: false,
|
|
21
24
|
supportedExecutionModes: ["manual"],
|
|
22
25
|
supportedChains: chains
|
|
23
26
|
};
|
|
@@ -1,27 +1,38 @@
|
|
|
1
1
|
import { ensureWalletStateDir } from "../wallet-runtime-config.js";
|
|
2
|
-
import { fetchSolanaMintInfoViaRpc } from "../solana-assets.js";
|
|
3
2
|
import { WalletProviderError } from "../wallet-provider-adapter.js";
|
|
4
|
-
import {
|
|
3
|
+
import { LOCAL_SIGNER_NATIVE_FEE_RESERVATION_LAMPORTS_V2, parseLocalSocketSignerRequest, parseLocalSocketSignerResponseEnvelope, validateLocalSocketSignerResult } from "../local-socket-signer-protocol.js";
|
|
4
|
+
import { SIGNER_PROTOCOL_V2_REQUIRED_CLIENT_FEATURES } from "../signer-protocol-v2.generated.js";
|
|
5
5
|
import { redactWalletDiagnosticText, walletDiagnosticErrorMessage, walletDiagnosticErrorString } from "../wallet-redaction.js";
|
|
6
|
-
import { parseLocalSocketSignerResponseEnvelope, validateLocalSocketSignerResult } from "../local-socket-signer-protocol.js";
|
|
7
6
|
import syncFs from "node:fs";
|
|
8
7
|
import path from "node:path";
|
|
9
8
|
import net from "node:net";
|
|
10
9
|
|
|
11
10
|
//#region src/wallet/providers/local-socket-signer-adapter.ts
|
|
11
|
+
const SOLANA_TOKEN_PROGRAM_ID = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
12
12
|
const MAX_SIGNER_RESPONSE_BYTES = 1 << 20;
|
|
13
|
+
const REQUIRED_PROTOCOL_V2_FEATURES = SIGNER_PROTOCOL_V2_REQUIRED_CLIENT_FEATURES;
|
|
13
14
|
const SIGNER_SOCKET_TIMEOUT_MS = {
|
|
14
15
|
health: 2e3,
|
|
16
|
+
"v2.capabilities": 2e3,
|
|
17
|
+
"v2.jupiter.trigger.history": 3e4,
|
|
18
|
+
"v2.policy.get": 5e3,
|
|
19
|
+
"v2.policy.put": 5e3,
|
|
20
|
+
"v2.policy.tighten": 5e3,
|
|
21
|
+
"v2.wallet.get": 5e3,
|
|
22
|
+
"v2.wallet.create": 1e4,
|
|
23
|
+
"v2.wallet.import": 2e4,
|
|
24
|
+
"v2.wallet.importLegacy": 3e4,
|
|
25
|
+
"v2.wallet.reencrypt": 1e4,
|
|
26
|
+
"v2.execute": 12e4,
|
|
27
|
+
"v2.review.get": 5e3,
|
|
28
|
+
"v2.review.prepare": 15e3,
|
|
29
|
+
"v2.review.execute": 12e4,
|
|
30
|
+
"v2.review.authorization.begin": 15e3,
|
|
31
|
+
"v2.review.authorization.finish": 3e4,
|
|
32
|
+
"v2.operation.get": 5e3,
|
|
33
|
+
"v2.operation.reconcile": 2e4,
|
|
15
34
|
getAddresses: 1e4,
|
|
16
|
-
getBalance: 15e3
|
|
17
|
-
prepareTx: 15e3,
|
|
18
|
-
signTx: 2e4,
|
|
19
|
-
sendTx: 12e4,
|
|
20
|
-
sendSolanaInstruction: 12e4,
|
|
21
|
-
sendSolanaInstructions: 12e4,
|
|
22
|
-
custodyStatus: 5e3,
|
|
23
|
-
unlockCustody: 1e4,
|
|
24
|
-
lockCustody: 1e4
|
|
35
|
+
getBalance: 15e3
|
|
25
36
|
};
|
|
26
37
|
function signerTimeoutFor(payload) {
|
|
27
38
|
return SIGNER_SOCKET_TIMEOUT_MS[payload.op] ?? 3e4;
|
|
@@ -68,12 +79,13 @@ function assertSecureLocalSignerSocket(socketPath) {
|
|
|
68
79
|
}
|
|
69
80
|
}
|
|
70
81
|
async function callSocket(socketPath, payload, options) {
|
|
82
|
+
const checkedPayload = parseLocalSocketSignerRequest(payload);
|
|
71
83
|
return await new Promise((resolve, reject) => {
|
|
72
84
|
const socket = net.createConnection(socketPath);
|
|
73
85
|
let buf = "";
|
|
74
86
|
let settled = false;
|
|
75
87
|
const maxResponseBytes = options?.maxResponseBytes ?? MAX_SIGNER_RESPONSE_BYTES;
|
|
76
|
-
const timeoutMs = options?.timeoutMs ?? signerTimeoutFor(
|
|
88
|
+
const timeoutMs = options?.timeoutMs ?? signerTimeoutFor(checkedPayload);
|
|
77
89
|
const finish = (err, value) => {
|
|
78
90
|
if (settled) {
|
|
79
91
|
return;
|
|
@@ -92,11 +104,11 @@ async function callSocket(socketPath, payload, options) {
|
|
|
92
104
|
};
|
|
93
105
|
const timer = setTimeout(() => {
|
|
94
106
|
socket.destroy();
|
|
95
|
-
finish(new Error(`local socket signer timeout after ${timeoutMs}ms for op=${
|
|
107
|
+
finish(new Error(`local socket signer timeout after ${timeoutMs}ms for op=${checkedPayload.op}`));
|
|
96
108
|
}, timeoutMs);
|
|
97
109
|
socket.setEncoding("utf8");
|
|
98
110
|
socket.on("connect", () => {
|
|
99
|
-
socket.write(`${JSON.stringify(
|
|
111
|
+
socket.write(`${JSON.stringify(checkedPayload)}\n`);
|
|
100
112
|
});
|
|
101
113
|
socket.on("data", (chunk) => {
|
|
102
114
|
buf += chunk;
|
|
@@ -116,8 +128,8 @@ async function callSocket(socketPath, payload, options) {
|
|
|
116
128
|
finish(new Error(parsed.error || "local socket signer error"));
|
|
117
129
|
return;
|
|
118
130
|
}
|
|
119
|
-
if (!validateLocalSocketSignerResult(
|
|
120
|
-
finish(new Error(`invalid local socket signer result for op=${
|
|
131
|
+
if (!validateLocalSocketSignerResult(checkedPayload.op, parsed.result)) {
|
|
132
|
+
finish(new Error(`invalid local socket signer result for op=${checkedPayload.op}`));
|
|
121
133
|
return;
|
|
122
134
|
}
|
|
123
135
|
finish(undefined, parsed.result);
|
|
@@ -139,7 +151,17 @@ async function probeLocalSocketSignerHealth(socketPath) {
|
|
|
139
151
|
details: result?.details ? redactWalletDiagnosticText(result.details) : undefined,
|
|
140
152
|
readOnly: result?.readOnly,
|
|
141
153
|
keystoreType: result?.keystoreType,
|
|
142
|
-
chains: Array.isArray(result?.chains) ? result.chains : undefined
|
|
154
|
+
chains: Array.isArray(result?.chains) ? result.chains : undefined,
|
|
155
|
+
ready: result?.ready,
|
|
156
|
+
release: result?.release,
|
|
157
|
+
schema: result?.schema,
|
|
158
|
+
network: result?.network,
|
|
159
|
+
capabilities: result?.capabilities,
|
|
160
|
+
policies: result?.policies,
|
|
161
|
+
webAuthn: result?.webAuthn,
|
|
162
|
+
jupiter: result?.jupiter,
|
|
163
|
+
audit: result?.audit,
|
|
164
|
+
state: result?.state
|
|
143
165
|
};
|
|
144
166
|
} catch (err) {
|
|
145
167
|
return {
|
|
@@ -148,6 +170,24 @@ async function probeLocalSocketSignerHealth(socketPath) {
|
|
|
148
170
|
};
|
|
149
171
|
}
|
|
150
172
|
}
|
|
173
|
+
async function requireLocalSocketSignerProtocolV2(socketPath, intentType) {
|
|
174
|
+
const result = await callSocket(socketPath, { op: "v2.capabilities" });
|
|
175
|
+
const capabilities = result.capabilities;
|
|
176
|
+
const protocol = capabilities?.protocol;
|
|
177
|
+
const missingFeatures = REQUIRED_PROTOCOL_V2_FEATURES.filter((feature) => !capabilities?.features.includes(feature));
|
|
178
|
+
const intentReviewFeatures = intentType === "solana.vaultBondAction" ? [
|
|
179
|
+
"reviewedVaultBondActions",
|
|
180
|
+
"signerOwnedStateRecheck",
|
|
181
|
+
"durableReviewAuthorization"
|
|
182
|
+
] : intentType === "federation.bondChallenge" ? ["reviewedFederationBondChallenges", "durableReviewAuthorization"] : [];
|
|
183
|
+
const missingIntentFeatures = intentReviewFeatures.filter((feature) => !capabilities?.features.includes(feature));
|
|
184
|
+
if (result.ready !== true || !protocol || protocol.current !== 2 || protocol.min > 2 || protocol.max < 2 || capabilities.nativeFeeReservationLamports !== LOCAL_SIGNER_NATIVE_FEE_RESERVATION_LAMPORTS_V2 || missingFeatures.length > 0 || missingIntentFeatures.length > 0 || intentType && !capabilities?.intentTypes.includes(intentType)) {
|
|
185
|
+
throw new WalletProviderError({
|
|
186
|
+
code: "wallet_provider_unavailable",
|
|
187
|
+
message: `local-socket-signer protocol-v2 capability negotiation failed${missingFeatures.length > 0 ? `; missing ${missingFeatures.join(",")}` : ""}${missingIntentFeatures.length > 0 ? `; missing intent features ${missingIntentFeatures.join(",")}` : ""}${intentType && !capabilities?.intentTypes.includes(intentType) ? `; unsupported intent ${intentType}` : ""}`
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
151
191
|
var LocalSocketSignerAdapter = class {
|
|
152
192
|
constructor(socketPath, options) {
|
|
153
193
|
this.socketPath = socketPath;
|
|
@@ -157,11 +197,14 @@ var LocalSocketSignerAdapter = class {
|
|
|
157
197
|
this.capabilities = {
|
|
158
198
|
custodyModel: "self-hosted",
|
|
159
199
|
supportsCreateWallet: false,
|
|
160
|
-
supportsPrepare:
|
|
200
|
+
supportsPrepare: false,
|
|
161
201
|
supportsSend: true,
|
|
162
202
|
supportsRotateKeys: false,
|
|
163
203
|
supportsResetKeys: false,
|
|
164
204
|
supportsPasskeyGate: false,
|
|
205
|
+
signingLocation: "server",
|
|
206
|
+
supportsSignTransaction: false,
|
|
207
|
+
supportsSignMessage: false,
|
|
165
208
|
supportedExecutionModes: ["manual", "autonomous"],
|
|
166
209
|
supportedChains: ["solana"]
|
|
167
210
|
};
|
|
@@ -169,6 +212,9 @@ var LocalSocketSignerAdapter = class {
|
|
|
169
212
|
supportsChain(chain) {
|
|
170
213
|
return this.capabilities.supportedChains.includes(chain);
|
|
171
214
|
}
|
|
215
|
+
async requireProtocolV2(intentType) {
|
|
216
|
+
await requireLocalSocketSignerProtocolV2(this.socketPath, intentType);
|
|
217
|
+
}
|
|
172
218
|
async health() {
|
|
173
219
|
try {
|
|
174
220
|
const details = await probeLocalSocketSignerHealth(this.socketPath);
|
|
@@ -180,10 +226,15 @@ var LocalSocketSignerAdapter = class {
|
|
|
180
226
|
provider: this.id,
|
|
181
227
|
configured: true,
|
|
182
228
|
checkedAt: new Date().toISOString(),
|
|
183
|
-
details:
|
|
184
|
-
details?.
|
|
185
|
-
details?.
|
|
186
|
-
|
|
229
|
+
details: [
|
|
230
|
+
details?.details ?? "",
|
|
231
|
+
...!details?.details ? [
|
|
232
|
+
details?.readOnly ? "read-only" : "read-write",
|
|
233
|
+
details?.keystoreType ? `keystore=${details.keystoreType}` : "",
|
|
234
|
+
Array.isArray(details?.chains) ? `chains=${details.chains.join(",")}` : ""
|
|
235
|
+
] : [],
|
|
236
|
+
details?.jupiter ? `jupiter-trigger=${details.jupiter.triggerConfigured ? "configured" : "not-configured"} jupiter-live=${details.jupiter.liveEnabled === true ? "enabled" : "preview-only"}` : "",
|
|
237
|
+
...details?.state?.capacityWarnings ?? []
|
|
187
238
|
].filter(Boolean).join(" ")
|
|
188
239
|
};
|
|
189
240
|
} catch (err) {
|
|
@@ -198,127 +249,351 @@ var LocalSocketSignerAdapter = class {
|
|
|
198
249
|
}
|
|
199
250
|
async getAddresses(options) {
|
|
200
251
|
const walletId = options?.walletId?.trim() || this.options?.scopedWalletId?.trim();
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
op: "
|
|
210
|
-
|
|
211
|
-
...walletId ? { walletId } : {}
|
|
252
|
+
if (!walletId) {
|
|
253
|
+
throw new WalletProviderError({
|
|
254
|
+
code: "wallet_provider_invalid_config",
|
|
255
|
+
message: "local-socket-signer requires an explicit walletId"
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
await this.requireProtocolV2();
|
|
259
|
+
const wallet = await callSocket(this.socketPath, {
|
|
260
|
+
op: "v2.wallet.get",
|
|
261
|
+
walletId
|
|
212
262
|
});
|
|
263
|
+
return { solana: wallet.publicKey };
|
|
213
264
|
}
|
|
214
|
-
async
|
|
265
|
+
async getSignerPolicy(walletIdRaw) {
|
|
266
|
+
const walletId = walletIdRaw.trim();
|
|
267
|
+
if (!walletId) {
|
|
268
|
+
throw new WalletProviderError({
|
|
269
|
+
code: "wallet_provider_invalid_config",
|
|
270
|
+
message: "local-socket-signer policy lookup requires an explicit walletId"
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
assertSecureLocalSignerSocket(this.socketPath);
|
|
274
|
+
await this.requireProtocolV2();
|
|
215
275
|
return await callSocket(this.socketPath, {
|
|
216
|
-
op: "
|
|
217
|
-
|
|
276
|
+
op: "v2.policy.get",
|
|
277
|
+
walletId
|
|
218
278
|
});
|
|
219
279
|
}
|
|
220
|
-
async
|
|
280
|
+
async tightenSignerPolicy(params) {
|
|
281
|
+
const walletId = params.walletId.trim();
|
|
282
|
+
if (!walletId || !Number.isSafeInteger(params.expectedVersion) || params.expectedVersion < 1) {
|
|
283
|
+
throw new WalletProviderError({
|
|
284
|
+
code: "wallet_provider_invalid_config",
|
|
285
|
+
message: "local-socket-signer policy tightening requires a walletId and positive expected version"
|
|
286
|
+
});
|
|
287
|
+
}
|
|
221
288
|
assertSecureLocalSignerSocket(this.socketPath);
|
|
222
|
-
|
|
223
|
-
|
|
289
|
+
await this.requireProtocolV2();
|
|
290
|
+
const acknowledged = await callSocket(this.socketPath, {
|
|
291
|
+
op: "v2.policy.tighten",
|
|
292
|
+
walletId,
|
|
293
|
+
request: {
|
|
294
|
+
expectedVersion: params.expectedVersion,
|
|
295
|
+
policy: params.policy
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
if (acknowledged.walletId !== walletId || acknowledged.role !== params.policy.role || acknowledged.version !== params.expectedVersion + 1) {
|
|
299
|
+
throw new WalletProviderError({
|
|
300
|
+
code: "wallet_provider_unavailable",
|
|
301
|
+
message: "local-socket-signer did not acknowledge the exact next policy version and wallet role",
|
|
302
|
+
retryable: false
|
|
303
|
+
});
|
|
224
304
|
}
|
|
225
|
-
|
|
226
|
-
op: "
|
|
227
|
-
|
|
305
|
+
const durable = await callSocket(this.socketPath, {
|
|
306
|
+
op: "v2.policy.get",
|
|
307
|
+
walletId
|
|
228
308
|
});
|
|
309
|
+
if (JSON.stringify(durable) !== JSON.stringify(acknowledged)) {
|
|
310
|
+
throw new WalletProviderError({
|
|
311
|
+
code: "wallet_provider_unavailable",
|
|
312
|
+
message: "local-socket-signer policy acknowledgement does not match durable signer state",
|
|
313
|
+
retryable: false
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
return acknowledged;
|
|
229
317
|
}
|
|
230
|
-
async
|
|
318
|
+
async getBalance(chain, options) {
|
|
319
|
+
if (chain !== "solana") {
|
|
320
|
+
throw new WalletProviderError({
|
|
321
|
+
code: "wallet_provider_unsupported_chain",
|
|
322
|
+
message: "local-socket-signer supports Solana only"
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
const walletId = options?.walletId?.trim() || this.options?.scopedWalletId?.trim();
|
|
326
|
+
if (!walletId) {
|
|
327
|
+
throw new WalletProviderError({
|
|
328
|
+
code: "wallet_provider_invalid_config",
|
|
329
|
+
message: "local-socket-signer balance lookup requires an explicit walletId"
|
|
330
|
+
});
|
|
331
|
+
}
|
|
231
332
|
assertSecureLocalSignerSocket(this.socketPath);
|
|
333
|
+
await this.requireProtocolV2();
|
|
232
334
|
return await callSocket(this.socketPath, {
|
|
233
|
-
op: "
|
|
234
|
-
|
|
335
|
+
op: "getBalance",
|
|
336
|
+
chain,
|
|
337
|
+
walletId
|
|
235
338
|
});
|
|
236
339
|
}
|
|
237
|
-
async
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
const amountRaw = request.amount?.trim();
|
|
241
|
-
if (!mint || !destinationOwner || !amountRaw) {
|
|
340
|
+
async sendTx(request) {
|
|
341
|
+
assertSecureLocalSignerSocket(this.socketPath);
|
|
342
|
+
if (request.chain !== "solana") {
|
|
242
343
|
throw new WalletProviderError({
|
|
243
|
-
code: "
|
|
244
|
-
message: "local-socket-signer
|
|
344
|
+
code: "wallet_provider_unsupported_chain",
|
|
345
|
+
message: "local-socket-signer supports Solana only"
|
|
245
346
|
});
|
|
246
347
|
}
|
|
247
|
-
const
|
|
248
|
-
if (
|
|
348
|
+
const untypedSerializedTransaction = request.serializedTxBase64;
|
|
349
|
+
if (typeof untypedSerializedTransaction === "string" && untypedSerializedTransaction.trim()) {
|
|
249
350
|
throw new WalletProviderError({
|
|
250
351
|
code: "wallet_provider_invalid_config",
|
|
251
|
-
message: "local-socket-signer
|
|
352
|
+
message: "local-socket-signer accepts typed SOL/SPL intents, not serialized transactions"
|
|
252
353
|
});
|
|
253
354
|
}
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
const authority = addresses.solana?.trim();
|
|
257
|
-
if (!authority) {
|
|
355
|
+
const memo = request.memo?.trim();
|
|
356
|
+
if (memo && !/^fased:a2a-(?:payment|refund):v1:[0-9a-f]{64}$/u.test(memo)) {
|
|
258
357
|
throw new WalletProviderError({
|
|
259
|
-
code: "
|
|
260
|
-
message: "local-socket-signer
|
|
358
|
+
code: "wallet_provider_invalid_config",
|
|
359
|
+
message: "local-socket-signer accepts only typed Fased A2A payment or refund memos"
|
|
261
360
|
});
|
|
262
361
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
362
|
+
return await this.executeTypedTransfer(request);
|
|
363
|
+
}
|
|
364
|
+
async prepareJupiterReview(request) {
|
|
365
|
+
return await this.prepareSignerReview(request);
|
|
366
|
+
}
|
|
367
|
+
async getSignerReview(request) {
|
|
368
|
+
assertSecureLocalSignerSocket(this.socketPath);
|
|
369
|
+
await this.requireProtocolV2();
|
|
370
|
+
return await callSocket(this.socketPath, {
|
|
371
|
+
op: "v2.review.get",
|
|
372
|
+
walletId: request.walletId,
|
|
373
|
+
request: { requestId: request.requestId }
|
|
266
374
|
});
|
|
267
|
-
|
|
375
|
+
}
|
|
376
|
+
async prepareSignerReview(request) {
|
|
377
|
+
assertSecureLocalSignerSocket(this.socketPath);
|
|
378
|
+
await this.requireProtocolV2(request.intent.type);
|
|
379
|
+
const policy = await callSocket(this.socketPath, {
|
|
380
|
+
op: "v2.policy.get",
|
|
381
|
+
walletId: request.walletId
|
|
382
|
+
});
|
|
383
|
+
return await callSocket(this.socketPath, {
|
|
384
|
+
op: "v2.review.prepare",
|
|
385
|
+
walletId: request.walletId,
|
|
386
|
+
request: {
|
|
387
|
+
requestId: request.requestId,
|
|
388
|
+
policyHash: policy.hash,
|
|
389
|
+
mode: request.mode,
|
|
390
|
+
intent: request.intent,
|
|
391
|
+
...request.transaction ? { transaction: request.transaction } : {}
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
async executeJupiterReview(request) {
|
|
396
|
+
return await this.executeSignerReview(request);
|
|
397
|
+
}
|
|
398
|
+
async executeSignerIntent(request) {
|
|
399
|
+
assertSecureLocalSignerSocket(this.socketPath);
|
|
400
|
+
await this.requireProtocolV2(request.intent.type);
|
|
401
|
+
const policy = await callSocket(this.socketPath, {
|
|
402
|
+
op: "v2.policy.get",
|
|
403
|
+
walletId: request.walletId
|
|
404
|
+
});
|
|
405
|
+
return await callSocket(this.socketPath, {
|
|
406
|
+
op: "v2.execute",
|
|
407
|
+
walletId: request.walletId,
|
|
408
|
+
request: {
|
|
409
|
+
requestId: request.requestId,
|
|
410
|
+
policyHash: policy.hash,
|
|
411
|
+
intent: request.intent
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
async listJupiterTriggerOrders(request) {
|
|
416
|
+
assertSecureLocalSignerSocket(this.socketPath);
|
|
417
|
+
await this.requireProtocolV2();
|
|
418
|
+
const history = await callSocket(this.socketPath, {
|
|
419
|
+
op: "v2.jupiter.trigger.history",
|
|
420
|
+
walletId: request.walletId
|
|
421
|
+
});
|
|
422
|
+
const orders = request.state ? history.orders.filter((order) => request.state === "active" ? order.orderState === "open" : order.orderState !== "open") : history.orders;
|
|
423
|
+
return { orders };
|
|
424
|
+
}
|
|
425
|
+
async prepareTypedTransferReview(request) {
|
|
426
|
+
assertSecureLocalSignerSocket(this.socketPath);
|
|
427
|
+
const mint = request.mint?.trim();
|
|
428
|
+
const memo = request.memo?.trim();
|
|
429
|
+
if (memo && !/^fased:a2a-(?:payment|refund):v1:[0-9a-f]{64}$/u.test(memo)) {
|
|
268
430
|
throw new WalletProviderError({
|
|
269
|
-
code: "
|
|
270
|
-
message: "
|
|
431
|
+
code: "wallet_provider_invalid_config",
|
|
432
|
+
message: "local-socket-signer accepts only typed Fased A2A payment or refund memos"
|
|
271
433
|
});
|
|
272
434
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
435
|
+
let intent;
|
|
436
|
+
if (mint) {
|
|
437
|
+
intent = {
|
|
438
|
+
type: "solana.splTransferChecked",
|
|
439
|
+
tokenProgram: request.tokenProgram?.trim() || SOLANA_TOKEN_PROGRAM_ID,
|
|
440
|
+
mint,
|
|
441
|
+
destination: request.destination,
|
|
442
|
+
amount: request.amount,
|
|
443
|
+
...memo ? { memo } : {}
|
|
444
|
+
};
|
|
445
|
+
} else {
|
|
446
|
+
intent = {
|
|
447
|
+
type: "solana.nativeTransfer",
|
|
448
|
+
destination: request.destination,
|
|
449
|
+
lamports: request.amount,
|
|
450
|
+
...memo ? { memo } : {}
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
await this.requireProtocolV2(intent.type);
|
|
454
|
+
const policy = await callSocket(this.socketPath, {
|
|
455
|
+
op: "v2.policy.get",
|
|
456
|
+
walletId: request.walletId
|
|
277
457
|
});
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
458
|
+
return await callSocket(this.socketPath, {
|
|
459
|
+
op: "v2.review.prepare",
|
|
460
|
+
walletId: request.walletId,
|
|
461
|
+
request: {
|
|
462
|
+
requestId: request.requestId,
|
|
463
|
+
policyHash: policy.hash,
|
|
464
|
+
mode: "reviewed",
|
|
465
|
+
intent
|
|
466
|
+
}
|
|
282
467
|
});
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
468
|
+
}
|
|
469
|
+
async executeSignerReview(request) {
|
|
470
|
+
assertSecureLocalSignerSocket(this.socketPath);
|
|
471
|
+
await this.requireProtocolV2();
|
|
472
|
+
return await callSocket(this.socketPath, {
|
|
473
|
+
op: "v2.review.execute",
|
|
474
|
+
walletId: request.walletId,
|
|
475
|
+
request: {
|
|
476
|
+
requestId: request.requestId,
|
|
477
|
+
...request.authorization ? { authorization: request.authorization } : {}
|
|
478
|
+
}
|
|
288
479
|
});
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
480
|
+
}
|
|
481
|
+
async beginJupiterReviewAuthorization(request) {
|
|
482
|
+
return await this.beginSignerReviewAuthorization(request);
|
|
483
|
+
}
|
|
484
|
+
async beginSignerReviewAuthorization(request) {
|
|
485
|
+
assertSecureLocalSignerSocket(this.socketPath);
|
|
486
|
+
await this.requireProtocolV2();
|
|
487
|
+
return await callSocket(this.socketPath, {
|
|
488
|
+
op: "v2.review.authorization.begin",
|
|
489
|
+
walletId: request.walletId,
|
|
490
|
+
request: { requestId: request.requestId }
|
|
297
491
|
});
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
492
|
+
}
|
|
493
|
+
async finishJupiterReviewAuthorization(request) {
|
|
494
|
+
return await this.finishSignerReviewAuthorization(request);
|
|
495
|
+
}
|
|
496
|
+
async getSignerOperation(request) {
|
|
497
|
+
assertSecureLocalSignerSocket(this.socketPath);
|
|
498
|
+
await this.requireProtocolV2();
|
|
499
|
+
return await callSocket(this.socketPath, {
|
|
500
|
+
op: "v2.operation.get",
|
|
501
|
+
walletId: request.walletId,
|
|
502
|
+
request: { requestId: request.requestId }
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
async reconcileSignerOperation(request) {
|
|
506
|
+
assertSecureLocalSignerSocket(this.socketPath);
|
|
507
|
+
await this.requireProtocolV2();
|
|
508
|
+
return await callSocket(this.socketPath, {
|
|
509
|
+
op: "v2.operation.reconcile",
|
|
510
|
+
walletId: request.walletId,
|
|
511
|
+
request: { requestId: request.requestId }
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
async finishSignerReviewAuthorization(request) {
|
|
515
|
+
assertSecureLocalSignerSocket(this.socketPath);
|
|
516
|
+
await this.requireProtocolV2();
|
|
517
|
+
return await callSocket(this.socketPath, {
|
|
518
|
+
op: "v2.review.authorization.finish",
|
|
519
|
+
walletId: request.walletId,
|
|
520
|
+
request: {
|
|
521
|
+
challengeId: request.challengeId,
|
|
522
|
+
credential: request.credential
|
|
523
|
+
}
|
|
301
524
|
});
|
|
302
|
-
|
|
525
|
+
}
|
|
526
|
+
async executeTypedTransfer(request) {
|
|
527
|
+
const walletId = request.walletId?.trim() || this.options?.scopedWalletId?.trim();
|
|
528
|
+
const requestId = request.requestId?.trim();
|
|
529
|
+
const destination = request.to?.trim();
|
|
530
|
+
const amount = request.amount?.trim();
|
|
531
|
+
if (!walletId || !requestId || !destination || !amount) {
|
|
532
|
+
throw new WalletProviderError({
|
|
533
|
+
code: "wallet_provider_invalid_config",
|
|
534
|
+
message: "local-socket-signer typed send requires walletId, stable requestId, destination, and raw-unit amount"
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
const intentType = request.program?.trim() ? "solana.splTransferChecked" : "solana.nativeTransfer";
|
|
538
|
+
await this.requireProtocolV2(intentType);
|
|
539
|
+
const wallet = await callSocket(this.socketPath, {
|
|
540
|
+
op: "v2.wallet.get",
|
|
541
|
+
walletId
|
|
542
|
+
});
|
|
543
|
+
const policy = await callSocket(this.socketPath, {
|
|
544
|
+
op: "v2.policy.get",
|
|
545
|
+
walletId
|
|
546
|
+
});
|
|
547
|
+
const mint = request.program?.trim();
|
|
548
|
+
let intent;
|
|
549
|
+
if (mint) {
|
|
550
|
+
intent = {
|
|
551
|
+
type: "solana.splTransferChecked",
|
|
552
|
+
destination,
|
|
553
|
+
mint,
|
|
554
|
+
amount,
|
|
555
|
+
...request.memo?.trim() ? { memo: request.memo.trim() } : {}
|
|
556
|
+
};
|
|
557
|
+
} else {
|
|
558
|
+
intent = {
|
|
559
|
+
type: "solana.nativeTransfer",
|
|
560
|
+
destination,
|
|
561
|
+
lamports: amount,
|
|
562
|
+
...request.memo?.trim() ? { memo: request.memo.trim() } : {}
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
const operation = await callSocket(this.socketPath, {
|
|
566
|
+
op: "v2.execute",
|
|
303
567
|
walletId,
|
|
304
|
-
|
|
568
|
+
request: {
|
|
569
|
+
requestId,
|
|
570
|
+
policyHash: policy.hash,
|
|
571
|
+
intent
|
|
572
|
+
}
|
|
305
573
|
});
|
|
574
|
+
if (operation.state !== "confirmed" || !operation.signature) {
|
|
575
|
+
const ambiguous = operation.state === "broadcast" || operation.state === "unknown";
|
|
576
|
+
throw new WalletProviderError({
|
|
577
|
+
code: ambiguous ? "wallet_provider_ambiguous" : "wallet_provider_unavailable",
|
|
578
|
+
message: ambiguous ? `signer operation ${requestId} has an ambiguous ${operation.state} result; reconcile it before any new attempt` : `signer operation ${requestId} ended in state=${operation.state}${operation.error ? `: ${operation.error}` : ""}`,
|
|
579
|
+
retryable: false
|
|
580
|
+
});
|
|
581
|
+
}
|
|
306
582
|
return {
|
|
307
|
-
|
|
583
|
+
ok: true,
|
|
584
|
+
chain: "solana",
|
|
585
|
+
txHash: operation.signature,
|
|
586
|
+
signer: wallet.publicKey,
|
|
308
587
|
metadata: {
|
|
309
|
-
...sent.metadata,
|
|
310
588
|
provider: this.id,
|
|
311
|
-
|
|
589
|
+
requestId: operation.requestId,
|
|
590
|
+
intentDigest: operation.intentDigest,
|
|
591
|
+
transactionDigest: operation.transactionDigest,
|
|
592
|
+
policyHash: operation.policyHash,
|
|
593
|
+
operationState: operation.state
|
|
312
594
|
}
|
|
313
595
|
};
|
|
314
596
|
}
|
|
315
|
-
async sendSolanaInstruction(request) {
|
|
316
|
-
assertSecureLocalSignerSocket(this.socketPath);
|
|
317
|
-
return await callSocket(this.socketPath, {
|
|
318
|
-
op: "sendSolanaInstruction",
|
|
319
|
-
request
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
597
|
};
|
|
323
598
|
function resolveLocalSocketSignerPath(env) {
|
|
324
599
|
const socketPath = String(env.FASED_WALLET_LOCAL_SIGNER_SOCKET ?? "").trim();
|
|
@@ -332,4 +607,4 @@ function requireLocalSocketSignerPath(env) {
|
|
|
332
607
|
}
|
|
333
608
|
|
|
334
609
|
//#endregion
|
|
335
|
-
export { LocalSocketSignerAdapter, callLocalSocketSigner, probeLocalSocketSignerHealth, requireLocalSocketSignerPath };
|
|
610
|
+
export { LocalSocketSignerAdapter, assertSecureLocalSignerSocket, callLocalSocketSigner, probeLocalSocketSignerHealth, requireLocalSocketSignerPath };
|