@fangorn-network/westmarch 0.0.20-dev → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -5
- package/docs/app-to-agent.md +113 -620
- package/package.json +18 -18
- package/site/dist/assets/__vite-browser-external-D2U8RZpp.js +1 -0
- package/site/dist/assets/embed.worker-CmS57Zti.js +1 -0
- package/site/dist/assets/index-CkP1WhkV.js +8 -0
- package/site/dist/assets/roles-BDPDWrwo.js +1 -0
- package/site/dist/assets/rolldown-runtime-COiEfhsA.js +1 -0
- package/site/dist/assets/transformers.web-CUZUFjAK.js +49 -0
- package/site/dist/assets/transformers.web-CwR_IYQV.js +40 -0
- package/site/dist/index.html +4 -5
- package/site/feed.js +16 -1
- package/site/no-model.js +4 -0
- package/site/worker.js +382 -59
- package/src/agent/agent-card.js +51 -37
- package/src/agent/mcp.js +173 -500
- package/src/agent/tools.js +3 -2
- package/src/agent/ui.js +1 -1
- package/src/agent/view-tools.js +11 -30
- package/src/agent/x402.js +194 -85
- package/src/core/embed.js +56 -53
- package/src/core/embed.worker.js +1 -1
- package/src/core/rank.js +1 -1
- package/src/core/roles.js +7 -7
- package/src/core/shard.js +12 -8
- package/src/discover/apps.js +103 -67
- package/src/discover/corpora.js +1 -1
- package/src/discover/directory.js +3 -3
- package/src/market/cohort.js +1 -1
- package/src/market/demand.js +1 -1
- package/src/market/reactions.js +24 -18
- package/src/publish/devnet.js +146 -0
- package/src/publish/graph.js +1 -1
- package/src/publish/init.js +74 -0
- package/src/publish/lint.js +3 -2
- package/src/publish/ship.js +433 -288
- package/src/publish/view-cli.js +14 -10
- package/src/publish/view.js +485 -255
- package/src/taste/steam.js +1 -1
- package/src/taste/taste-doc.js +4 -3
- package/src/taste/taste.js +3 -3
- package/src/taste/vault.js +4 -2
- package/template/README.md +48 -0
- package/template/app.json +27 -0
- package/template/eval/goals.md +7 -0
- package/template/eval/golden.jsonl +0 -0
- package/template/gitignore +3 -0
- package/template/package.json +13 -0
- package/template/wrangler.json +12 -0
- package/plugin/scripts/fx.mjs +0 -268
- package/site/dist/assets/AccountNotFoundScreen-C4njXc69-BOfmiSH1.js +0 -1
- package/site/dist/assets/AddFundsSelectionScreen-RAoCn7ej-D_EsIeJu.js +0 -31
- package/site/dist/assets/Address-H8kD1d9O-C85sJ79B.js +0 -17
- package/site/dist/assets/AffirmativeConsentScreen-BG0MJxku-DdEPFOww.js +0 -6
- package/site/dist/assets/AllowlistRejectionScreen-Cae6e1Od-DhVy9iGN.js +0 -1
- package/site/dist/assets/ApiController-CYdiyu9B.js +0 -5
- package/site/dist/assets/ArrowsRightLeftIcon-cp60yobq.js +0 -1
- package/site/dist/assets/AuthenticateWithWalletScreen-CU6hIcFT-8rbYiYYE.js +0 -1
- package/site/dist/assets/AwaitingEvmToSolBridgingScreen-D0e_sZMS-2pkNfCno.js +0 -1
- package/site/dist/assets/AwaitingExternalEthereumTransferScreen-ur5HL4R7-7AQt25_k.js +0 -1
- package/site/dist/assets/AwaitingPasswordlessCodeScreen-DRHz76mM-BZY30TGs.js +0 -103
- package/site/dist/assets/AwaitingSolToEvmBridgingScreen-CdLRrGD2-BILOOLi_.js +0 -1
- package/site/dist/assets/BridgeNetworkSelectionView-CFGjB2nO-CvsbQcFv.js +0 -68
- package/site/dist/assets/CaptchaScreen-DbpvkIGx-D8eDcAkc.js +0 -1
- package/site/dist/assets/CheckCircleIcon-BM409mGI.js +0 -1
- package/site/dist/assets/CheckCircleIcon-NCOQc0Gs.js +0 -1
- package/site/dist/assets/Checkbox-D1EDeo41-rHlvsZzP.js +0 -52
- package/site/dist/assets/ChevronDownIcon-CW-4MSpE.js +0 -1
- package/site/dist/assets/Chip-CZKIKt9K-CutJG010.js +0 -26
- package/site/dist/assets/CoinbaseOnrampStatusScreen-BbyCJDXL-DLs9zX-Q.js +0 -16
- package/site/dist/assets/ConnectEmailForm-B-VRE0MN-N9J6T_YL.js +0 -3
- package/site/dist/assets/ConnectLedgerScreen-DWHABGot-h0uYIUi6.js +0 -10
- package/site/dist/assets/ConnectOnlyLandingScreen-CZYx9Bmp-LeuDMN1E.js +0 -1
- package/site/dist/assets/ConnectOnlyStatusScreen-DCRzjxHx-DaRa59tZ.js +0 -1
- package/site/dist/assets/ConnectOrCreateScreen-CUUYUO07-crHzh-TL.js +0 -1
- package/site/dist/assets/ConnectPhoneForm-Dek5xn4C-BEA4FmhI.js +0 -95
- package/site/dist/assets/ConnectWalletView-DqI-PTvX-CMQIad63.js +0 -74
- package/site/dist/assets/ConnectionStatusScreen-fUfROm9m-BeWLchcf.js +0 -7
- package/site/dist/assets/ConnectionStatusScreen-fUfROm9m-wu3a3kw4.js +0 -1
- package/site/dist/assets/ConnectorUtil-Cq4lWnfe.js +0 -21
- package/site/dist/assets/ConstantsUtil-DmLsRHAl.js +0 -198
- package/site/dist/assets/CopyToClipboard-i_OQSBJr-DujUHNzW.js +0 -39
- package/site/dist/assets/CopyableText-CQapvaMr-DMIdpDaU.js +0 -28
- package/site/dist/assets/CrossAppAuthScreen-CLw7ymZq-Csju14vF.js +0 -1
- package/site/dist/assets/CustomLandingScreenView-Cm_MBSyX-CBOrbNLo.js +0 -22
- package/site/dist/assets/DelegatedActionsConsentScreen-DYF2U4y5-BL5hzNUI.js +0 -1
- package/site/dist/assets/DelegatedActionsRevokeScreen-bPp6Uwyh-fcO51q5H.js +0 -1
- package/site/dist/assets/DepositAddressAddressStepView-4vdkb55L-B3vY888G.js +0 -187
- package/site/dist/assets/DepositAddressScreen-DBLRs7aI-DmdQaFI2.js +0 -8
- package/site/dist/assets/DepositAddressV3Screen-CDqIEMQw-BoupRyfV.js +0 -1
- package/site/dist/assets/EmailInputForm-Cqo1mda8-B2NG3K5V.js +0 -124
- package/site/dist/assets/EmbeddedWalletConnectingScreen-D4T7DUzs-D_AVgO4s.js +0 -1
- package/site/dist/assets/EmbeddedWalletCreatedScreen-D7WhW5ve-CLsJbPYQ.js +0 -1
- package/site/dist/assets/EmbeddedWalletKeyExportScreen-CqV4NYQ3-C9sAExzE.js +0 -23
- package/site/dist/assets/EmbeddedWalletOnAccountCreateScreen-BoKb3Q2S-DxaWAAKa.js +0 -1
- package/site/dist/assets/EmbeddedWalletPasswordUpdateScreen-D3rMlqS7-CxrfLr5q.js +0 -1
- package/site/dist/assets/EmbeddedWalletPasswordUpdateSplashScreen-BPFkWJeE-DHZRGoTN.js +0 -1
- package/site/dist/assets/EnrollTotp-Dibew4dp-SA2pvNEc.js +0 -66
- package/site/dist/assets/EnvelopeIcon-Dh2vSVj4.js +0 -1
- package/site/dist/assets/ErrorBanner-BcpGRt0h-BKOYTyCi.js +0 -21
- package/site/dist/assets/ErrorMessage-D8VaAP5m-CrZOnUyg.js +0 -8
- package/site/dist/assets/ErrorScreen-DipdTWzE-DcxVjMO4.js +0 -1
- package/site/dist/assets/ErrorScreen-DipdTWzE-c8g8En21.js +0 -4
- package/site/dist/assets/ExclamationCircleIcon-DUA2wMfO.js +0 -1
- package/site/dist/assets/ExclamationTriangleIcon-eZfaqcFq.js +0 -1
- package/site/dist/assets/FarcasterConnectStatusScreen-51tjUxqq-s_s5M2CZ.js +0 -75
- package/site/dist/assets/FarcasterSignerStatusScreen-6x-Uh95G-BHBR4k8H.js +0 -28
- package/site/dist/assets/FiatOnrampScreen-BAhYeiTI-BH_sU6EV.js +0 -491
- package/site/dist/assets/FingerPrintIcon-Dm6kxmg7.js +0 -1
- package/site/dist/assets/FundSolWalletWithExternalSolanaWallet-WtLwYaOl-B8TRV36j.js +0 -1
- package/site/dist/assets/FundWalletMethodHeader-BWNkokCT-BQdbJ5Bb.js +0 -1
- package/site/dist/assets/FundWithBankDepositScreen-DajkHxBD-9rPtyA3d.js +0 -58
- package/site/dist/assets/FundingEditAmountScreen-CpvpiO4M-GaXigGI9.js +0 -1
- package/site/dist/assets/FundingMethodSelectionScreen-Db7vhRlE-UsmtTqv4.js +0 -1
- package/site/dist/assets/GlobeAltIcon-vqrVV5ho.js +0 -1
- package/site/dist/assets/GooglePay-B53WnudL-BX5_WtCx.js +0 -1
- package/site/dist/assets/HCaptchaWrapper-CUi9LJsp-D-I8j7NO.js +0 -4
- package/site/dist/assets/InAppBrowserLoginNotPossible-BMR9br1T-BY3j50El.js +0 -1
- package/site/dist/assets/InfoBanner-Cb3p1z12-DLBl_Ywy.js +0 -22
- package/site/dist/assets/InjectedWalletIcon-DLcYOGDj-DLSV_NjP.js +0 -1
- package/site/dist/assets/InstallWalletScreen-DTA8dwLv-CxreyXoD.js +0 -1
- package/site/dist/assets/JsonTree-BHzNC-ic-DcNcbSoM.js +0 -34
- package/site/dist/assets/LabelXs-oqZNqbm_-iafrj25N.js +0 -6
- package/site/dist/assets/LandingScreen-CGWUoSUG-DK1EY-6v.js +0 -1
- package/site/dist/assets/Layouts-BMRfo5hw-CeCOyCLK.js +0 -77
- package/site/dist/assets/Link-BdDilT2T-BEDEdHuS.js +0 -40
- package/site/dist/assets/LinkConflictScreen-C3ZEPsgl-ClWoqvEL.js +0 -77
- package/site/dist/assets/LinkEmailScreen-dKo9frwc-C3v7glH0.js +0 -1
- package/site/dist/assets/LinkPasskeyScreen-zbrl_AI_-D72Gb0LW.js +0 -117
- package/site/dist/assets/LinkPasskeyScreen-zbrl_AI_-DYIl5Kr2.js +0 -1
- package/site/dist/assets/LinkPhoneScreen-oIUpfj0w-C0DuD14j.js +0 -1
- package/site/dist/assets/Loader-UAZqxsnw-Cy7hEE2f.js +0 -62
- package/site/dist/assets/LoadingSkeleton-BMsgO5PV-CiEyS5PZ.js +0 -17
- package/site/dist/assets/LockClosedIcon-BgY_5v_Z.js +0 -1
- package/site/dist/assets/LoginFailedScreen-CN0dJV6U-DhUMiJZJ.js +0 -1
- package/site/dist/assets/ManualTransferScreen-CHqcuqbs-tXiZDHmN.js +0 -1
- package/site/dist/assets/MfaAuthEnrollmentFlowScreen-Dj7gPTRC-CaW7xeCC.js +0 -1
- package/site/dist/assets/MfaAuthVerifyFlowScreen-DbFpyWMy-CeRqvx8k.js +0 -1
- package/site/dist/assets/MfaEnrollmentFlowScreen-DhLnGgnr-BkN1k4lh.js +0 -1
- package/site/dist/assets/MfaVerifyFlowScreen-C_XPjMRP-CXSqLVbE.js +0 -1
- package/site/dist/assets/ModalFooter-BCuEK_nz-c-khvG4Y.js +0 -403
- package/site/dist/assets/MoonpayStatusScreen-CzTUtokc-BRFN2eXr.js +0 -16
- package/site/dist/assets/OAuthStatusScreen-ufbOa-da-CeiGcSia.js +0 -1
- package/site/dist/assets/OpenLink-CUpJ1mOr-DfAvJRyK.js +0 -39
- package/site/dist/assets/PasskeySelectSignupOrLogin-xh2ScC_l-CIf5I7wU.js +0 -1
- package/site/dist/assets/PasskeyStatusScreen-Bla8MaOk-CLoL7QC-.js +0 -6
- package/site/dist/assets/PasswordRecoveryScreen-awGXZkQk-B9F67IYV.js +0 -20
- package/site/dist/assets/PhArrowCircleDown-D97G-BOA.js +0 -14
- package/site/dist/assets/PhArrowClockwise-DVgyFuez.js +0 -14
- package/site/dist/assets/PhArrowDown-87b1BizM.js +0 -14
- package/site/dist/assets/PhArrowLeft-Da0MfnbK.js +0 -14
- package/site/dist/assets/PhArrowRight-AdrIL4DW.js +0 -14
- package/site/dist/assets/PhArrowSquareOut-Bk2CMG3I.js +0 -14
- package/site/dist/assets/PhArrowUp-4sgyKPGx.js +0 -14
- package/site/dist/assets/PhArrowUpRight-BNghD2zq.js +0 -14
- package/site/dist/assets/PhArrowsClockwise-BXRn1GEl.js +0 -14
- package/site/dist/assets/PhArrowsDownUp-DM09Jo_3.js +0 -14
- package/site/dist/assets/PhArrowsLeftRight-MuKBLUoF.js +0 -14
- package/site/dist/assets/PhBank-fHbgCqqZ.js +0 -14
- package/site/dist/assets/PhBrowser-2-9m-AkM.js +0 -14
- package/site/dist/assets/PhCaretDown-BDNabFuL.js +0 -14
- package/site/dist/assets/PhCaretLeft-CI460R-A.js +0 -14
- package/site/dist/assets/PhCaretRight-D7ZS3Ls8.js +0 -14
- package/site/dist/assets/PhCaretUp-C-iIfyvO.js +0 -14
- package/site/dist/assets/PhCheck-DxQXn57r.js +0 -14
- package/site/dist/assets/PhCircleHalf-MJZeRBGF.js +0 -14
- package/site/dist/assets/PhClock-x3MS3Mwi.js +0 -14
- package/site/dist/assets/PhCompass-hYn3HhGN.js +0 -14
- package/site/dist/assets/PhCopy-CWNYcABI.js +0 -14
- package/site/dist/assets/PhCreditCard-Fy4pzwtt.js +0 -14
- package/site/dist/assets/PhCurrencyDollar-BgiaenCi.js +0 -14
- package/site/dist/assets/PhDesktop-CxrzCSv5.js +0 -14
- package/site/dist/assets/PhDeviceMobile-CsyA5Goi.js +0 -14
- package/site/dist/assets/PhDotsThree-D-k1BiYg.js +0 -14
- package/site/dist/assets/PhEnvelope-D8kzeNox.js +0 -14
- package/site/dist/assets/PhFunnelSimple-CfQs5DAW.js +0 -14
- package/site/dist/assets/PhGlobe-DvmSc9_A.js +0 -14
- package/site/dist/assets/PhIdentificationCard-CfkZm-5K.js +0 -14
- package/site/dist/assets/PhImage-Cf0J2ZfJ.js +0 -14
- package/site/dist/assets/PhInfo-Bwi51-2X.js +0 -14
- package/site/dist/assets/PhLightbulb-C4FZV7Es.js +0 -14
- package/site/dist/assets/PhMagnifyingGlass-C9u8jSCJ.js +0 -14
- package/site/dist/assets/PhPaperPlaneRight-zxQVvPLX.js +0 -14
- package/site/dist/assets/PhPlus-C4UoW-2n.js +0 -14
- package/site/dist/assets/PhPower-CFyWDmgD.js +0 -14
- package/site/dist/assets/PhPuzzlePiece-BjoNVfST.js +0 -14
- package/site/dist/assets/PhQrCode-CP3tFauY.js +0 -14
- package/site/dist/assets/PhQuestion-wOWJBd3G.js +0 -14
- package/site/dist/assets/PhQuestionMark-CV0k9C0Y.js +0 -14
- package/site/dist/assets/PhSealCheck-vIKzREuN.js +0 -14
- package/site/dist/assets/PhSignOut-CxELV-i0.js +0 -14
- package/site/dist/assets/PhSpinner-CGDmbzUd.js +0 -14
- package/site/dist/assets/PhTrash-C9PD0SAt.js +0 -14
- package/site/dist/assets/PhUser-0sWNXQeZ.js +0 -14
- package/site/dist/assets/PhVault-6JTskUcC.js +0 -14
- package/site/dist/assets/PhWarning-CoKs3gz6.js +0 -14
- package/site/dist/assets/PhWarningCircle-BXHw1fCt.js +0 -14
- package/site/dist/assets/PhX-DX0SFIqC.js +0 -14
- package/site/dist/assets/PhoneIcon-CvIiPwYQ.js +0 -1
- package/site/dist/assets/PinInput-DbZ0b1i1-CDXZBdQx.js +0 -247
- package/site/dist/assets/PrivyPluginContext-DA-yS5vO-CtQWBiV2.js +0 -1
- package/site/dist/assets/QrCode-DbnZwlkH-h6Bhoe5U.js +0 -22
- package/site/dist/assets/RecoveryOAuthStatusScreen-CsgtTI2x-D-A5P3PX.js +0 -1
- package/site/dist/assets/RecoveryPasswordCreateScreen-Be-qJ-LU-C8lTSeSr.js +0 -1
- package/site/dist/assets/RecoverySelectionScreen-D1iGtpmi-P5P3plkH.js +0 -7
- package/site/dist/assets/SIWXUtil-TUCxa7aA.js +0 -1
- package/site/dist/assets/Screen-D30meWsY-CCeVNuWs.js +0 -175
- package/site/dist/assets/ScreenHeader-CHmc4-Lu-DjyrH7IK.js +0 -31
- package/site/dist/assets/ScreenLayout-OwaQQcxH-CrQM6kvA.js +0 -1
- package/site/dist/assets/SelectSourceAsset-CWFog6gm-D7yTw87h.js +0 -140
- package/site/dist/assets/SetAutomaticRecoveryScreen-BO_OEqAZ-f0iDIGmw.js +0 -14
- package/site/dist/assets/SetWalletPasswordForm-DwCTVtAh-kq1zvA7d.js +0 -11
- package/site/dist/assets/ShieldCheckIcon-o6RHYev1.js +0 -1
- package/site/dist/assets/SignRequestScreen-BHKv32KR-DDpMYyJ1.js +0 -26
- package/site/dist/assets/SolanaWalletConnector-C7Lqk-Wz-DPwhuzcI.js +0 -1
- package/site/dist/assets/StackedContainer-B2vaEl56-eQCM2cmv.js +0 -24
- package/site/dist/assets/StandardSignAndSendTransactionScreen-CfhIXVtd-BJ-onCjv.js +0 -20
- package/site/dist/assets/Subtitle-CV-2yKE4-zxWw2m1Q.js +0 -13
- package/site/dist/assets/TelegramAuthScreen-UL9zLfO8-NWlMgNRX.js +0 -1
- package/site/dist/assets/Title-BnzYV3Is-B_JpTatT.js +0 -7
- package/site/dist/assets/TodoList-DnyULl18-C8Eyy28X.js +0 -36
- package/site/dist/assets/TransactionDetails-e9nesl30-C4MpIHR-.js +0 -109
- package/site/dist/assets/TransactionErrorView-BDBNqA_f-p1T9WVMx.js +0 -178
- package/site/dist/assets/TransferFromWalletScreen-Qvn1Yuno-88IQcRnY.js +0 -31
- package/site/dist/assets/TransferOrBridgeLoadingScreen-Dl1I_iIz-1fDAIxAf.js +0 -6
- package/site/dist/assets/TurnstileWrapper-B7sNddys-Jwy1tJtm.js +0 -1
- package/site/dist/assets/UpdateEmailScreen-DVOhPV0H-Jj2DQW8D.js +0 -1
- package/site/dist/assets/UpdatePhoneScreen-CXRswTNZ-DwYIUBqi.js +0 -1
- package/site/dist/assets/UserLimitReachedScreen-5we2DHn8-D7m70C4b.js +0 -1
- package/site/dist/assets/Value-DTgR824E-BRuIGiec.js +0 -27
- package/site/dist/assets/WalletCards-DH1rqayz-Bgp9Fsgs.js +0 -1
- package/site/dist/assets/WalletIcon-gKf0gTw6.js +0 -1
- package/site/dist/assets/WalletInfoCard-sq_2wgFg-DpNSAGte.js +0 -29
- package/site/dist/assets/WalletInterstitialScreen-Sh7LfsAh-DG-RuO-F.js +0 -1
- package/site/dist/assets/WalletLink-DK5LB5Ha-DHaL350n.js +0 -20
- package/site/dist/assets/WalletOverflowButton-bfCnp-9T-CUyIJFzt.js +0 -1
- package/site/dist/assets/WarningBanner-ZZqCEtZK-2eU4Qo74.js +0 -21
- package/site/dist/assets/__vite-browser-external-CitKSmYk.js +0 -1
- package/site/dist/assets/_esm-B26FZg5Y.js +0 -7
- package/site/dist/assets/_esm-BdeM6pxJ.js +0 -1
- package/site/dist/assets/accounts-D96UKWkC.js +0 -1
- package/site/dist/assets/accounts-DiZ-0VmN.js +0 -1
- package/site/dist/assets/analytics-mkkvFRju-BRBcadka.js +0 -1
- package/site/dist/assets/baseSepolia-DX-qGsik.js +0 -1
- package/site/dist/assets/basic-oIwwSyu4.js +0 -1575
- package/site/dist/assets/capitalizeFirstLetter-DmLYqXsO-DtOXx-2n.js +0 -1
- package/site/dist/assets/ccip-65sIfSPR.js +0 -1
- package/site/dist/assets/ccip-BZvRTL6g.js +0 -7
- package/site/dist/assets/ccip-DA_zG341.js +0 -1
- package/site/dist/assets/chain-DM3oH6Px.js +0 -8
- package/site/dist/assets/check-BPgcwEPP.js +0 -1
- package/site/dist/assets/chevron-down-BSsbXkK-.js +0 -1
- package/site/dist/assets/circle-alert-DWaeLZNj.js +0 -1
- package/site/dist/assets/circle-check-big-Chb1ivw9.js +0 -1
- package/site/dist/assets/circle-x-AV9Cet0R.js +0 -1
- package/site/dist/assets/client-CZG0ndth.js +0 -2
- package/site/dist/assets/client-Dsa7_3V3.js +0 -9
- package/site/dist/assets/coinbase-DCPC2L_R-D3aIgpyd.js +0 -3
- package/site/dist/assets/copy-Ckr0AkL6.js +0 -1
- package/site/dist/assets/core-snws5xwv.js +0 -12
- package/site/dist/assets/createLucideIcon-IPW50ckY.js +0 -1
- package/site/dist/assets/defineChain-CiuCXUZW.js +0 -1
- package/site/dist/assets/dijkstra-Drfl93V4.js +0 -1
- package/site/dist/assets/dist-Cm7pNAtL.js +0 -1
- package/site/dist/assets/dist-CoS6E-3x.js +0 -1
- package/site/dist/assets/dist-Dl07uGq1.js +0 -1
- package/site/dist/assets/dist-DnGANz51.js +0 -16
- package/site/dist/assets/embed.worker-ugGhEqCV.js +0 -1
- package/site/dist/assets/errors-BQ3N-RVt-BLqjTPNR.js +0 -1
- package/site/dist/assets/esm-B5cbIQaz.js +0 -37
- package/site/dist/assets/esm-ByALO6mA.js +0 -1
- package/site/dist/assets/esm-C3DslVJx.js +0 -1
- package/site/dist/assets/esm-Ci1ogKuK.js +0 -1
- package/site/dist/assets/esm-n2lWo7kz.js +0 -1
- package/site/dist/assets/ethers-zTjbodk5-wHhL_BQ1.js +0 -1
- package/site/dist/assets/eventemitter3-CL76jPsW.js +0 -1
- package/site/dist/assets/external-link-D-uehwM2.js +0 -1
- package/site/dist/assets/farcaster-DPlSjvF5-BqTvDXBR.js +0 -1
- package/site/dist/assets/features-DQ0UYy6K.js +0 -2
- package/site/dist/assets/fingerprint-pattern-D8ytA16Q.js +0 -1
- package/site/dist/assets/floating-ui.react-dom-DKWOL9UG.js +0 -1
- package/site/dist/assets/floating-ui.react-xRkl9O3u.js +0 -1
- package/site/dist/assets/formatErc20TokenAmount-BuPk9xcy-BVqOKQif.js +0 -1
- package/site/dist/assets/formatter-CVbp4SlJ.js +0 -1
- package/site/dist/assets/get-entropy-details-for-user-dHRH5Gpi-Dukf7_kJ.js +0 -1
- package/site/dist/assets/getChainName-DjpPdUSc-DUyKDrnp.js +0 -1
- package/site/dist/assets/getErc20Balance-jXNpFf0N-Bb9WM31M.js +0 -1
- package/site/dist/assets/getErc20TokenInfo-BNTrzLMP-KPrdn04K.js +0 -1
- package/site/dist/assets/getFormattedUsdFromLamports-De3U9GlO-Gx4_wxON.js +0 -1
- package/site/dist/assets/getUsdcMintAddress-BVgm9GRo-r2UnDeEy.js +0 -1
- package/site/dist/assets/guards-BIW-GiMJ-CHfXo8XI.js +0 -1
- package/site/dist/assets/hooks.module-BYZGfwDl.js +0 -1
- package/site/dist/assets/hourglass-CPG1HZmf.js +0 -1
- package/site/dist/assets/id-UqEwL2BI-BkKm533U.js +0 -1
- package/site/dist/assets/index-1HYFYA-W.js +0 -8
- package/site/dist/assets/index-BdEw5wyl-ChSJvPZk.js +0 -1
- package/site/dist/assets/index-CWARkn2w-Cezl_uBr.js +0 -61
- package/site/dist/assets/index-DvMddJcd-BatvgC-S.js +0 -12
- package/site/dist/assets/index-YiCw0Y_x-CX5i3Z87.js +0 -437
- package/site/dist/assets/index.browser-B-i-Lj3J.js +0 -1
- package/site/dist/assets/index.browser-BMmUcykv.js +0 -1
- package/site/dist/assets/index.es-BmqyoBEM.js +0 -2
- package/site/dist/assets/index.es-C1v1or--.js +0 -3
- package/site/dist/assets/isPaymentRequestAvailable-Bq1cemEn-By6r0dVB.js +0 -1
- package/site/dist/assets/jsx-runtime-BbDfbRii.js +0 -1
- package/site/dist/assets/landmark-CH6LV6F0.js +0 -1
- package/site/dist/assets/lib-BsS8z8Lj.js +0 -1
- package/site/dist/assets/localBatchGatewayRequest-3kLrX_c7.js +0 -32
- package/site/dist/assets/lock-DcskI4Bb.js +0 -1
- package/site/dist/assets/logger-CsXm3oIv-B0UYpNFI.js +0 -1
- package/site/dist/assets/mail-Bs0r5yOi.js +0 -1
- package/site/dist/assets/modal-context-CwmSeFcv-DruX9J1E.js +0 -1
- package/site/dist/assets/native-BKj27wfc.js +0 -1
- package/site/dist/assets/ofetch.CWycOUEr-CHp-crOQ.js +0 -1
- package/site/dist/assets/parseAbi-Csg-8t59.js +0 -2
- package/site/dist/assets/parseAbiParameters-BWbIMYe4.js +0 -1
- package/site/dist/assets/parseEther-VjhVo3dd.js +0 -1
- package/site/dist/assets/pkce-DXF0yKjP-ChQhE0st.js +0 -1
- package/site/dist/assets/preload-helper-uBIymjUX.js +0 -1
- package/site/dist/assets/privy-context-81KmsBw2-CjWGzyg7.js +0 -2
- package/site/dist/assets/property-DuZ9DLP4.js +0 -3
- package/site/dist/assets/react-DCXkXSrv.js +0 -1
- package/site/dist/assets/react-DQnMl2Xv.js +0 -1
- package/site/dist/assets/react-DrJ0MmMO.js +0 -1
- package/site/dist/assets/react-auth-sHnipzbS.js +0 -1
- package/site/dist/assets/react-dom-5dW7aKoP.js +0 -1
- package/site/dist/assets/reservoir-x-nGuZkT-BMX127i6.js +0 -1
- package/site/dist/assets/roles-32M1l9jI.js +0 -1
- package/site/dist/assets/rolldown-runtime-BcKkbAw3.js +0 -1
- package/site/dist/assets/safe-url-D7SRPu33-CkMedGro.js +0 -1
- package/site/dist/assets/secp256k1-C4nzcPo-.js +0 -1
- package/site/dist/assets/secp256k1-D92aGNnU.js +0 -1
- package/site/dist/assets/secp256k1-DmbwyFau.js +0 -1
- package/site/dist/assets/secp256k1-_MleGpqL.js +0 -1
- package/site/dist/assets/secp256k1-xl2og-wO.js +0 -1
- package/site/dist/assets/serializeAuthorizationList-CX8hGL56.js +0 -1
- package/site/dist/assets/serializeSignature-DfxkPnu-.js +0 -2
- package/site/dist/assets/sha2-BU_QyRTx.js +0 -1
- package/site/dist/assets/shared-DRZUmnL5-xqAUARWo.js +0 -193
- package/site/dist/assets/shared-FM0rljBt--Avg6q2R.js +0 -21
- package/site/dist/assets/shouldProceedtoEmbeddedWalletCreationFlow-B3vyavrh-BK_FBkaE.js +0 -1
- package/site/dist/assets/simulateTransaction-CfuOrae4-64lWYJAL.js +0 -1
- package/site/dist/assets/smartphone-CcEZ-XAy.js +0 -1
- package/site/dist/assets/src-BBjkfi-Q.js +0 -1
- package/site/dist/assets/storage-Ufl800Ne-D0bZBw-H.js +0 -9
- package/site/dist/assets/stringify-BlDm7tuc.js +0 -21
- package/site/dist/assets/stripe.esm-CZRDpc-N.js +0 -2
- package/site/dist/assets/styles-BsotlekN-CXEB4Ud9.js +0 -9
- package/site/dist/assets/styles-Cm9H63WO-Br4QtzUL.js +0 -92
- package/site/dist/assets/styles-DVyDvTdj-BTABn2K8.js +0 -74
- package/site/dist/assets/styles-hslXy6xG-D-49b1rk.js +0 -164
- package/site/dist/assets/telegram-B-JqnkqZ-RBoY3PLx.js +0 -1
- package/site/dist/assets/to-ui-error-DWe-qwS3-Cx2bk1kZ.js +0 -4
- package/site/dist/assets/toViemAccount-B5iDGq1b-Ba8L7zed.js +0 -2
- package/site/dist/assets/transaction-BNTP-bFm-M5tJx8vY.js +0 -1
- package/site/dist/assets/transfer-6YztDh-t-BVQkTvG-.js +0 -1
- package/site/dist/assets/transformers.web-CVP3pJOS.js +0 -40
- package/site/dist/assets/transformers.web-D8W1u_I2.js +0 -49
- package/site/dist/assets/triangle-alert-CWjYH75H.js +0 -1
- package/site/dist/assets/twitch-5IOe4sIQ-lDtgk0os.js +0 -1
- package/site/dist/assets/types-4CuOD23i.js +0 -1
- package/site/dist/assets/use-headless-crypto-deposit-Yn-QRLB3-LUIVFBSd.js +0 -1
- package/site/dist/assets/use-unlink-wallet-BKK4_5Ur-CC2pq27z.js +0 -1
- package/site/dist/assets/useActiveWallet-B-yZYGc6-D7Ik-LxJ.js +0 -123
- package/site/dist/assets/useGetSolPrice-x7gfUIHJ-D1hmQfpA.js +0 -1
- package/site/dist/assets/useGetTokenPrice-CaoUkb79-ZnbuJ-vP.js +0 -1
- package/site/dist/assets/useI18n-C-5n_noF-BcqC76yj.js +0 -1
- package/site/dist/assets/useWalletBalance-CZnP5f_f-Dw2GIJ4g.js +0 -1
- package/site/dist/assets/useWallets-X1ndvJ_U-DRjz7uYD.js +0 -1
- package/site/dist/assets/utils-BkR7EQjg.js +0 -1
- package/site/dist/assets/utils-DJhBNOZA.js +0 -1
- package/site/dist/assets/utils-DdckVfQr.js +0 -1
- package/site/dist/assets/w3m-modal-BeVrBOIf.js +0 -1174
- package/site/dist/assets/wallet-Bn85Sg2W.js +0 -1
- package/site/dist/assets/wallet-Bnzeiqed.js +0 -2
- package/site/dist/assets/wallet-connect-BvJtUsDt-Y03hhqFN.js +0 -1
- package/site/dist/assets/walletconnect-registry-xxG8XLCb-D1SSFvMp.js +0 -1
- package/site/dist/assets/walletconnect-v2-3frQFwbg-CrtLXofr.js +0 -12
- package/site/dist/assets/wui-ux-by-reown-D34ILNLS.js +0 -1147
- package/site/dist/assets/x-rlSp9U7W.js +0 -1
- package/src/discover/explore.js +0 -271
- package/src/market/settle.js +0 -165
- package/src/market/terms.js +0 -200
- package/src/publish/cli.js +0 -336
- package/src/publish/envelope.js +0 -185
- package/src/publish/manifest.js +0 -142
package/src/core/embed.worker.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The embedder, off the main thread.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// EmbeddingGemma-300m q8 is a ~300MB ONNX download, and ONNX Runtime's WASM init
|
|
4
4
|
// and every inference after it are synchronous CPU. On the main thread that is a
|
|
5
5
|
// frozen tab for as long as it takes — which on a first visit is a minute or two
|
|
6
6
|
// of an app that looks broken rather than busy.
|
package/src/core/rank.js
CHANGED
|
@@ -159,7 +159,7 @@ export function rankDomains(domains = [], q) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
// ── self-check: `node src/core/rank.js` ──────────────────────────────────────
|
|
162
|
-
if (
|
|
162
|
+
if (import.meta.url === `file://${globalThis.process?.argv?.[1]}` && process.argv[1].endsWith("/rank.js")) {
|
|
163
163
|
// Word boundaries: the bug this replaced ranked "intoxicated" for "cat".
|
|
164
164
|
if (lexScore({ text: "intoxicated education" }, "cat") !== 0) throw new Error("substring matched — word boundaries lost");
|
|
165
165
|
if (lexScore({ text: "a cat sat" }, "cat") <= 0) throw new Error("whole word must match");
|
package/src/core/roles.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// on the next — which is exactly what happened the first time the probe was
|
|
6
6
|
// pointed at a second bundle.
|
|
7
7
|
//
|
|
8
|
-
// The answer is already baked. A
|
|
8
|
+
// The answer is already baked. A view's domain manifest carries `role_map`
|
|
9
9
|
// (which field is the title, the subtitle, the tags, the prose to search, the
|
|
10
10
|
// measures, the location, the link) and `presentation` (an icon, an accent and a
|
|
11
11
|
// singular/plural name per entity type, plus per-type external URL templates).
|
|
@@ -158,7 +158,7 @@ export function rolesFrom(manifests = [], sample = []) {
|
|
|
158
158
|
/**
|
|
159
159
|
* Which collection a row belongs to.
|
|
160
160
|
*
|
|
161
|
-
* `entityType` is
|
|
161
|
+
* `entityType` is the view's own convention — every row carries it, and
|
|
162
162
|
* the manifest's `entity_types` counts are keyed by it — so this is the one
|
|
163
163
|
* field name the format actually fixes. `kind` is the older spelling and is
|
|
164
164
|
* still on-chain in sond3r's vertices, hence the fallback.
|
|
@@ -249,7 +249,7 @@ export const isLocked = (field, roles) =>
|
|
|
249
249
|
/** Is this row part of the corpus's free sample — the deterministic slice a
|
|
250
250
|
* paywalled bake hands over whole so a buyer can read before paying?
|
|
251
251
|
*
|
|
252
|
-
* The bake picks it by hashing the row's own id (
|
|
252
|
+
* The bake picks it by hashing the row's own id (`inSample`),
|
|
253
253
|
* which is what stops a seller putting its best rows in the shop window. That
|
|
254
254
|
* only holds if someone CHECKS, and the check is this function: anyone can
|
|
255
255
|
* recompute which rows should be free and see whether the shard agrees. */
|
|
@@ -371,7 +371,7 @@ export function actionsOf(row, roles) {
|
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
// ── self-check: `node src/core/roles.js` ─────────────────────────────────────
|
|
374
|
-
if (
|
|
374
|
+
if (import.meta.url === `file://${globalThis.process?.argv?.[1]}` && process.argv[1].endsWith("/roles.js")) {
|
|
375
375
|
// The real places manifest's shape.
|
|
376
376
|
const places = {
|
|
377
377
|
role_map: {
|
|
@@ -460,9 +460,9 @@ if (typeof process !== "undefined" && import.meta.url === `file://${process.argv
|
|
|
460
460
|
if (gatesOf(rolesFrom([places])).length) throw new Error("an ungated view must report no gates");
|
|
461
461
|
if (isLocked("text", rolesFrom([places]))) throw new Error("nothing is locked in an ungated view");
|
|
462
462
|
|
|
463
|
-
// The free sample, recomputed. Must agree with
|
|
464
|
-
//
|
|
465
|
-
//
|
|
463
|
+
// The free sample, recomputed. Must agree with the bake's sample byte for byte or
|
|
464
|
+
// the check that keeps a seller honest checks nothing — these ids and their
|
|
465
|
+
// verdicts are pinned.
|
|
466
466
|
for (const [id, yes] of [["row-47", true], ["row-169", true], ["row-0", false], ["row-3", false], ["row-19", false]]) {
|
|
467
467
|
if (await inSample(id, 0.01) !== yes) throw new Error(`inSample must match the bake: ${id}`);
|
|
468
468
|
}
|
package/src/core/shard.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Reading a
|
|
1
|
+
// Reading a VIEW's Semantic CDN shards (view.js's layout), in the consumer's own process.
|
|
2
2
|
//
|
|
3
3
|
// One view → one manifest per watched (owner, namespace) domain → N gzipped
|
|
4
4
|
// NDJSON shards, downloaded once, kept in memory, ranked locally — no index
|
|
@@ -52,6 +52,7 @@ const _meta = new Map(); // view base → [manifest, …]
|
|
|
52
52
|
let _rowText = (f) => [f.name, f.path, f.desc].filter(Boolean).join(" ");
|
|
53
53
|
/** How to learn the default view. Overridden by the app; unset means an app that
|
|
54
54
|
* always passes an explicit view base, which is a legitimate way to use this. */
|
|
55
|
+
let _fetch = (url) => fetch(url);
|
|
55
56
|
let _resolveView = null;
|
|
56
57
|
/** Called with the domain manifests once they land and BEFORE the first shard is
|
|
57
58
|
* parsed. See configure(). */
|
|
@@ -74,8 +75,11 @@ let _onManifests = null;
|
|
|
74
75
|
* the argument the second corpus loaded would silently be parsed with the
|
|
75
76
|
* first one's text role.
|
|
76
77
|
*/
|
|
77
|
-
export function configure({ resolveView, rowText, onManifests } = {}) {
|
|
78
|
+
export function configure({ resolveView, rowText, onManifests, fetch: f } = {}) {
|
|
78
79
|
if (resolveView) _resolveView = resolveView;
|
|
80
|
+
// `fetch`: how a view's files are read. A Worker serving its own view reads them from
|
|
81
|
+
// its bucket, since a Worker cannot fetch its own URL.
|
|
82
|
+
if (f) _fetch = f;
|
|
79
83
|
if (rowText) _rowText = rowText;
|
|
80
84
|
if (onManifests) _onManifests = onManifests;
|
|
81
85
|
}
|
|
@@ -135,7 +139,7 @@ export function setDomains(only) {
|
|
|
135
139
|
const wanted = (name) => !_only || _only.some((e) =>
|
|
136
140
|
name === e || name.split("/").pop() === e || name.startsWith(e));
|
|
137
141
|
|
|
138
|
-
const NO_VIEW = "no
|
|
142
|
+
const NO_VIEW = "no view configured — pass a view base, or wire one with configure({ resolveView })";
|
|
139
143
|
|
|
140
144
|
/** Fetch + parse a view's shards. Cached PER VIEW; concurrent callers share one
|
|
141
145
|
* fetch. Keyed by the resolved base, so two apps on screen in one session can't
|
|
@@ -171,7 +175,7 @@ export async function loadShard(base, onRows) {
|
|
|
171
175
|
* below. Exported because an app resolving its own view reads config the same
|
|
172
176
|
* way, and a second copy of the sniff would drift. */
|
|
173
177
|
export async function fetchText(url) {
|
|
174
|
-
const res = await
|
|
178
|
+
const res = await _fetch(url);
|
|
175
179
|
if (!res.ok) throw new Error(`shard: HTTP ${res.status} for ${url}`);
|
|
176
180
|
|
|
177
181
|
// Who gunzips depends on the server. `cdn serve` sends a shard as
|
|
@@ -266,7 +270,7 @@ async function verifyShard(url, expect, chunks, gz) {
|
|
|
266
270
|
* read, so this is an optimisation and never a requirement.
|
|
267
271
|
*/
|
|
268
272
|
async function fetchLines(url, onLine, expect) {
|
|
269
|
-
const res = await
|
|
273
|
+
const res = await _fetch(url);
|
|
270
274
|
if (!res.ok) throw new Error(`shard: HTTP ${res.status} for ${url}`);
|
|
271
275
|
if (!res.body) {
|
|
272
276
|
// The buffered path has every byte before it parses one, so it can verify
|
|
@@ -343,7 +347,7 @@ async function load(view, onRows) {
|
|
|
343
347
|
// A view with nothing baked yet is the normal state of a brand-new one, not an
|
|
344
348
|
// error. Say which it is, or "search finds nothing" is indistinguishable from
|
|
345
349
|
// a URL pointing at the wrong view.
|
|
346
|
-
if (!domains.length) console.warn(`shard:
|
|
350
|
+
if (!domains.length) console.warn(`shard: view ${cdn} has no baked domains yet — nothing to read until its indexer bakes one.`);
|
|
347
351
|
|
|
348
352
|
const byId = new Map();
|
|
349
353
|
const dead = new Set();
|
|
@@ -438,7 +442,7 @@ export async function suggestDomains(q, { url } = {}) {
|
|
|
438
442
|
}
|
|
439
443
|
|
|
440
444
|
// ── self-check: `node src/core/shard.js` — no network, no view ────────────────
|
|
441
|
-
if (
|
|
445
|
+
if (import.meta.url === `file://${globalThis.process?.argv?.[1]}` && process.argv[1].endsWith("/shard.js")) {
|
|
442
446
|
const { gzipSync } = await import("node:zlib");
|
|
443
447
|
const warn = console.warn, info = console.info;
|
|
444
448
|
console.warn = console.info = () => {}; // the fallback warnings are behaviour under test, not output
|
|
@@ -662,7 +666,7 @@ if (typeof process !== "undefined" && import.meta.url === `file://${process.argv
|
|
|
662
666
|
}
|
|
663
667
|
|
|
664
668
|
// ── the bake's packed vector (`v`), the form shipped today ──
|
|
665
|
-
// Pinned
|
|
669
|
+
// Pinned: [0,1,-1] -> "AH+B" (packVec in embed.js writes it). A
|
|
666
670
|
// drift here is not a crash, it is cosine ranking on noise.
|
|
667
671
|
{
|
|
668
672
|
await serveView({ d0: [[{ track_id: "p1", owner: "0xa", v: "AH+B", fields: { entityType: "file", name: "packed.md", path: "packed.md" } },
|
package/src/discover/apps.js
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
// The index of apps
|
|
1
|
+
// The index of apps, read off the chain.
|
|
2
2
|
//
|
|
3
|
-
// An app
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// fetches the card and checks it names that app and is still the one bound on
|
|
8
|
-
// chain. The card then says where the data is (`views`) and where it starts
|
|
9
|
-
// (`fromBlock`).
|
|
3
|
+
// An app is a publisher's repo whose `@card` record points at an agent card that points back.
|
|
4
|
+
// So the directory is `repos()` (one scan of the update log), each repo's `@card` (one read
|
|
5
|
+
// per repo, cached by head), and `discoverCard` on each card found, which checks the binding.
|
|
6
|
+
// No registry, no relay, nobody's server in the loop.
|
|
10
7
|
//
|
|
11
|
-
// `fangorn` is an SDK client, passed in rather than imported, so this module
|
|
12
|
-
//
|
|
13
|
-
// Reads only: a reader can create one with a throwaway key.
|
|
8
|
+
// `fangorn` is an SDK client, passed in rather than imported, so this module stays usable
|
|
9
|
+
// where the SDK is not installed, and testable without a chain.
|
|
14
10
|
//
|
|
15
|
-
// ponytail: one flat list, no ranking
|
|
16
|
-
//
|
|
17
|
-
// fetching them all.
|
|
11
|
+
// ponytail: one flat list, no ranking, every card fetched. Past a few hundred apps, rank by
|
|
12
|
+
// the cards' own coverage instead.
|
|
18
13
|
|
|
19
14
|
/**
|
|
20
15
|
* A pointer someone else wrote, and following it is the one place a reader
|
|
@@ -29,85 +24,126 @@ function safeView(url) {
|
|
|
29
24
|
} catch { return null; }
|
|
30
25
|
}
|
|
31
26
|
|
|
32
|
-
/** The SDK's
|
|
27
|
+
/** The SDK's FANGORN_REPO_EXTENSION. Copied so this file needs no SDK;
|
|
33
28
|
* src/agent/agent-card.js's self-check fails if the two drift. */
|
|
34
|
-
export const APP_EXTENSION = "https://fangorn.network/a2a/
|
|
29
|
+
export const APP_EXTENSION = "https://fangorn.network/a2a/repo/v1";
|
|
35
30
|
|
|
36
|
-
/**
|
|
37
|
-
export
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
/** The app's agent skill, `{url, sha256}`, when its card names one well-formed; else null. */
|
|
32
|
+
export const skillOf = (ext) => {
|
|
33
|
+
const k = ext?.params?.skill;
|
|
34
|
+
return k && safeView(k.url) && /^[0-9a-f]{64}$/.test(k.sha256 ?? "") ? { url: k.url, sha256: k.sha256 } : null;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// The app's Claude Code plugin, for what a skill can't do (hooks). Both fields reach a shell command
|
|
38
|
+
// in the reader's agent, so they are held to a GitHub owner/repo (or https URL) and a plain name.
|
|
39
|
+
export const PLUGIN_MARKETPLACE = /^([\w.-]+\/[\w.-]+|https:\/\/[\w.\/-]+)$/, PLUGIN_NAME = /^[a-z0-9][a-z0-9-]*$/;
|
|
40
|
+
export const pluginOf = (ext) => {
|
|
41
|
+
const p = ext?.params?.plugin;
|
|
42
|
+
return p && PLUGIN_MARKETPLACE.test(p.marketplace ?? "") && PLUGIN_NAME.test(p.name ?? "") ? { marketplace: p.marketplace, name: p.name } : null;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** A verified card (`discoverCard`'s result) → an app entry. `views` etc. are westmarch's params; the SDK ignores them. */
|
|
46
|
+
export function toApp({ card, publisher, repo }, cardUrl) {
|
|
47
|
+
const p = card.capabilities.extensions.find((e) => e.uri === APP_EXTENSION)?.params ?? {};
|
|
48
|
+
const views = (Array.isArray(p.views) ? p.views : []).map(safeView).filter(Boolean);
|
|
49
|
+
const paid = p.paid && /^https?:\/\//.test(p.paid.url ?? "") && p.paid.url.includes("{id}") ? { url: p.paid.url } : null;
|
|
42
50
|
return {
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
id: `${publisher}:${repo}`, publisher, repo, card: cardUrl,
|
|
52
|
+
fromBlock: /^\d+$/.test(String(p.fromBlock)) ? BigInt(p.fromBlock) : null,
|
|
53
|
+
repos: Array.isArray(p.repos) ? p.repos.filter((r) => typeof r === "string") : [],
|
|
54
|
+
views, paid, skill: skillOf({ params: p }), plugin: pluginOf({ params: p }),
|
|
55
|
+
mcp: safeView(p.mcp),
|
|
56
|
+
tools: (card.skills ?? []).map((k) => k.id),
|
|
57
|
+
name: card.name ?? repo,
|
|
45
58
|
desc: card.description ?? "",
|
|
46
59
|
url: safeView(card.url),
|
|
47
60
|
};
|
|
48
61
|
}
|
|
49
62
|
|
|
63
|
+
// Blocks this close to the head can still reorg: read again every time, never stored.
|
|
64
|
+
const SETTLED = 64n;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Logs from `start` to `head`, oldest first, reading only the blocks `store`
|
|
68
|
+
* has not seen. A scan from the registry's deployment grows with the chain;
|
|
69
|
+
* this one grows with the time since the last call. `store` is `{ get, set }`
|
|
70
|
+
* of `{ to, logs }` by `key`; `read(from, to)` returns logs with `blockNumber`.
|
|
71
|
+
*/
|
|
72
|
+
export async function cachedLogs(store, key, start, head, read) {
|
|
73
|
+
const hit = store.get(key) ?? { to: start - 1n, logs: [] };
|
|
74
|
+
const fresh = hit.to < head ? await read(hit.to + 1n, head) : [];
|
|
75
|
+
const settled = head - SETTLED;
|
|
76
|
+
if (settled > hit.to) store.set(key, { to: settled, logs: [...hit.logs, ...fresh.filter((l) => l.blockNumber <= settled)] });
|
|
77
|
+
return [...hit.logs, ...fresh];
|
|
78
|
+
}
|
|
79
|
+
|
|
50
80
|
/**
|
|
51
|
-
* Every app with a bound, verifiable card. The ones that fail are reported
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* An app that cleared its uri (bound to "") is skipped. It is not an error.
|
|
81
|
+
* Every app with a bound, verifiable card. The ones that fail are reported with the reason,
|
|
82
|
+
* not dropped: a card that is down and a card that lies look the same from outside, and an
|
|
83
|
+
* agent should see both. `store` ({ get, set }) caches each repo's card URL by head.
|
|
56
84
|
*/
|
|
57
|
-
export async function listApps(fangorn, { fromBlock,
|
|
58
|
-
|
|
59
|
-
const logs = await fangorn.getAppRegistry().getAppAgentLogs({ fromBlock: BigInt(fromBlock), toBlock });
|
|
60
|
-
// Oldest first, so the last write wins. discoverApp re-reads the binding,
|
|
61
|
-
// so a stale uri here is caught there, not trusted.
|
|
62
|
-
const latest = new Map(logs.map((l) => [l.appId, l.agentUri]));
|
|
85
|
+
export async function listApps(fangorn, { fromBlock, store } = {}) {
|
|
86
|
+
const repos = await fangorn.repos(fromBlock == null ? {} : { fromBlock: BigInt(fromBlock) });
|
|
63
87
|
const apps = [], rejected = [];
|
|
64
|
-
await Promise.all(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
88
|
+
await Promise.all(repos.map(async ({ owner, repo, root }) => {
|
|
89
|
+
const key = `card:${owner.toLowerCase()}/${repo}@${root}`;
|
|
90
|
+
let url = store?.get(key);
|
|
91
|
+
if (url === undefined) {
|
|
92
|
+
try { url = (await fangorn.cardOf(owner, repo)) ?? null; } catch { return; } // unreadable now: not cached, tried next time
|
|
93
|
+
store?.set(key, url);
|
|
94
|
+
}
|
|
95
|
+
if (!url) return;
|
|
96
|
+
try { apps.push(toApp(await fangorn.discoverCard(url), url)); }
|
|
97
|
+
catch (e) { rejected.push({ publisher: owner, repo, card: url, why: e?.message ?? String(e) }); }
|
|
68
98
|
}));
|
|
69
99
|
apps.sort((a, b) => a.name.localeCompare(b.name));
|
|
70
100
|
return { apps, rejected };
|
|
71
101
|
}
|
|
72
102
|
|
|
73
103
|
// ── self-check: `node src/discover/apps.js` ──────────────────────────────────────
|
|
74
|
-
if (
|
|
104
|
+
if (import.meta.url === `file://${globalThis.process?.argv?.[1]}` && process.argv[1].endsWith("/apps.js")) {
|
|
75
105
|
const j = (x) => JSON.stringify(x, (_, v) => (typeof v === "bigint" ? `${v}n` : v));
|
|
76
106
|
const eq = (a, b, m) => { if (j(a) !== j(b)) throw new Error(`${m}: ${j(a)} != ${j(b)}`); };
|
|
77
|
-
const
|
|
78
|
-
const card = (
|
|
79
|
-
{ uri: "https://other/ext", params: {
|
|
80
|
-
{ uri:
|
|
107
|
+
const P = "0x" + "11".repeat(20), Q = "0x" + "22".repeat(20);
|
|
108
|
+
const card = (publisher, repo, name, views) => ({ name, description: `${name}!`, url: "https://x.test/", capabilities: { extensions: [
|
|
109
|
+
{ uri: "https://other/ext", params: { views: ["https://evil.test/"] } },
|
|
110
|
+
{ uri: APP_EXTENSION, params: { publisher, repo, fromBlock: "7", repos: ["n"], views } },
|
|
81
111
|
] } });
|
|
82
112
|
const cards = {
|
|
83
|
-
"https://a.test/card": card(
|
|
84
|
-
"https://
|
|
85
|
-
"https://b.test/card": card(B, "Alpha", []),
|
|
113
|
+
"https://a.test/card": card(P, "beta", "Beta", ["https://a.test/q/v1/stream", "javascript:alert(1)"]),
|
|
114
|
+
"https://b.test/card": card(Q, "alpha", "Alpha", []),
|
|
86
115
|
};
|
|
87
|
-
|
|
116
|
+
const bound = { [`${P}/beta`]: "https://a.test/card", [`${Q}/alpha`]: "https://b.test/card", [`${Q}/liar`]: "https://liar.test/card" };
|
|
117
|
+
let cardReads = 0;
|
|
88
118
|
const fangorn = {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{
|
|
96
|
-
])) }),
|
|
97
|
-
discoverApp: async (uri) => {
|
|
98
|
-
if (uri === "https://liar.test/card") throw new Error("not bound to app");
|
|
99
|
-
const c = cards[uri];
|
|
100
|
-
return { card: c, appId: c.capabilities.extensions[1].params.appId, fromBlock: 7n, namespaces: ["n"] };
|
|
119
|
+
repos: async () => [{ owner: P, repo: "beta", root: "0x1" }, { owner: Q, repo: "alpha", root: "0x2" },
|
|
120
|
+
{ owner: Q, repo: "plain", root: "0x3" }, { owner: Q, repo: "liar", root: "0x4" }],
|
|
121
|
+
cardOf: async (o, r) => (cardReads++, bound[`${o}/${r}`]),
|
|
122
|
+
discoverCard: async (url) => {
|
|
123
|
+
if (url === "https://liar.test/card") throw new Error("not bound");
|
|
124
|
+
const c = cards[url], p = c.capabilities.extensions[1].params;
|
|
125
|
+
return { card: c, publisher: p.publisher, repo: p.repo };
|
|
101
126
|
},
|
|
102
127
|
};
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
eq(apps.map((a) => a.name), ["Alpha", "Beta"], "one entry per
|
|
128
|
+
const m = new Map(), store = { get: (k) => m.get(k), set: (k, v) => m.set(k, v) };
|
|
129
|
+
const { apps, rejected } = await listApps(fangorn, { store });
|
|
130
|
+
eq(apps.map((a) => a.name), ["Alpha", "Beta"], "one entry per carded repo, sorted, repos with no card skipped");
|
|
106
131
|
const beta = apps[1];
|
|
107
132
|
eq(beta.views, ["https://a.test/q/v1"], "views from the fangorn extension only, trimmed, non-http dropped");
|
|
108
|
-
eq([beta.
|
|
109
|
-
eq(rejected.map((r) => r.why), ["not bound
|
|
110
|
-
|
|
133
|
+
eq([beta.id, beta.card, beta.url, beta.fromBlock, beta.repos, beta.desc], [`${P}:beta`, "https://a.test/card", "https://x.test", 7n, ["n"], "Beta!"], "entry fields");
|
|
134
|
+
eq(rejected.map((r) => r.why), ["not bound"], "a card that fails verification is reported");
|
|
135
|
+
eq(cardReads, 4, "one @card read per repo");
|
|
136
|
+
await listApps(fangorn, { store });
|
|
137
|
+
eq(cardReads, 4, "an unchanged head is not read again");
|
|
138
|
+
|
|
139
|
+
const asked = [];
|
|
140
|
+
const chain = [{ blockNumber: 10n, n: 1 }, { blockNumber: 150n, n: 2 }, { blockNumber: 190n, n: 3 }];
|
|
141
|
+
const read = async (from, to) => (asked.push([from, to]), chain.filter((l) => l.blockNumber >= from && l.blockNumber <= to));
|
|
142
|
+
const lm = new Map(), ls = { get: (k) => lm.get(k), set: (k, v) => lm.set(k, v) };
|
|
143
|
+
eq((await cachedLogs(ls, "k", 5n, 200n, read)).map((l) => l.n), [1, 2, 3], "first call reads it all");
|
|
144
|
+
eq(lm.get("k").to, 136n, "stores only what is settled");
|
|
145
|
+
eq((await cachedLogs(ls, "k", 5n, 210n, read)).map((l) => l.n), [1, 2, 3], "second call: same logs, no duplicates");
|
|
146
|
+
eq(asked, [[5n, 200n], [137n, 210n]], "second call reads only from the settled point");
|
|
111
147
|
|
|
112
|
-
console.log("apps.js self-check ok —
|
|
148
|
+
console.log("apps.js self-check ok — an app is a repo whose card verifies, cards read once per head, failures reported, views gated to http(s)");
|
|
113
149
|
}
|
package/src/discover/corpora.js
CHANGED
|
@@ -189,7 +189,7 @@ export function follow(picks = [], corpora = [], { at = null } = {}) {
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
// ── self-check: `node src/discover/corpora.js` ───────────────────────────────────
|
|
192
|
-
if (
|
|
192
|
+
if (import.meta.url === `file://${globalThis.process?.argv?.[1]}` && process.argv[1].endsWith("/corpora.js")) {
|
|
193
193
|
const s = session();
|
|
194
194
|
const add = (view, name, n) => {
|
|
195
195
|
const c = s.slot(view);
|
|
@@ -62,7 +62,7 @@ export async function survey(sources = [], { timeoutMs = 8000 } = {}) {
|
|
|
62
62
|
for (const d of cat.domains ?? []) {
|
|
63
63
|
corpora.push({
|
|
64
64
|
view,
|
|
65
|
-
publisher: typeof src === "string" ? null : (src.name ?? src.
|
|
65
|
+
publisher: typeof src === "string" ? null : (src.name ?? src.id ?? null),
|
|
66
66
|
owner: typeof src === "string" ? null : (src.owner ?? null),
|
|
67
67
|
domain: d.name,
|
|
68
68
|
description: d.description || "",
|
|
@@ -164,11 +164,11 @@ export async function findCorpora(query, { sources = [], embed, model, limit = 1
|
|
|
164
164
|
* modules to run a survey. Rejected cards come back beside the sources. */
|
|
165
165
|
export async function sourcesFromChain(fangorn, opts) {
|
|
166
166
|
const { apps, rejected } = await listApps(fangorn, opts);
|
|
167
|
-
return { sources: apps.flatMap((a) => a.views.map((view) => ({ view, name: a.name,
|
|
167
|
+
return { sources: apps.flatMap((a) => a.views.map((view) => ({ view, name: a.name, id: a.id }))), rejected };
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
// ── self-check: `node src/discover/directory.js` ─────────────────────────────────
|
|
171
|
-
if (
|
|
171
|
+
if (import.meta.url === `file://${globalThis.process?.argv?.[1]}` && process.argv[1].endsWith("/directory.js")) {
|
|
172
172
|
const warn = console.warn; console.warn = () => {};
|
|
173
173
|
const cov = (...vectors) => ({ dim: 2, sampled: 100, vectors, counts: vectors.map(() => 50) });
|
|
174
174
|
|
package/src/market/cohort.js
CHANGED
|
@@ -247,7 +247,7 @@ export function readout(total, cohort, { minSupport = MIN_SUPPORT } = {}) {
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
// ── self-check: `node src/market/cohort.js` ──────────────────────────────────
|
|
250
|
-
if (
|
|
250
|
+
if (import.meta.url === `file://${globalThis.process?.argv?.[1]}` && process.argv[1].endsWith("/cohort.js")) {
|
|
251
251
|
const vec = (a, b) => { const v = new Float32Array(STAT_DIM); v[0] = a; v[1] = b; return v; };
|
|
252
252
|
const log = (n, seed) => Array.from({ length: n }, (_, i) => ({
|
|
253
253
|
id: `row-${seed}-${i}`, corpus: "films", reaction: i % 4 === 3 ? "skip" : "like",
|
package/src/market/demand.js
CHANGED
|
@@ -383,7 +383,7 @@ export function brief(rep, { title = "demand" } = {}) {
|
|
|
383
383
|
}
|
|
384
384
|
|
|
385
385
|
// ── self-check: `node src/market/demand.js` ────────────────────────────────────
|
|
386
|
-
if (
|
|
386
|
+
if (import.meta.url === `file://${globalThis.process?.argv?.[1]}` && process.argv[1].endsWith("/demand.js")) {
|
|
387
387
|
const { keypair, statistics, contribute, aggregate, readout } = await import("./cohort.js");
|
|
388
388
|
|
|
389
389
|
// A shelf with two genuine regions and a hole between them. 128 dims so the
|
package/src/market/reactions.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
// ------------------------------------------------------
|
|
17
17
|
// A reaction's vector is the vector of the row reacted to, which the reader
|
|
18
18
|
// already downloaded in order to react to it. So a reaction corpus needs no
|
|
19
|
-
// model, no GPU, no bake
|
|
19
|
+
// model, no GPU, no bake — the vectors are copied, not computed.
|
|
20
20
|
// The only thing that has to be fitted locally is `coverage`, which is eight
|
|
21
21
|
// centroids and is the function below. A consumer becoming a publisher is
|
|
22
22
|
// therefore not a tier you upgrade into; it is this file and a price.
|
|
@@ -50,8 +50,25 @@
|
|
|
50
50
|
// IS that reaction's vector under another name, which is the same leak wearing a
|
|
51
51
|
// hat, and a reader with nine reactions is exactly who most needs this to hold.
|
|
52
52
|
|
|
53
|
-
import { packVec } from "../core/embed.js";
|
|
54
|
-
|
|
53
|
+
import { EMBED_MODEL, packVec } from "../core/embed.js";
|
|
54
|
+
|
|
55
|
+
const ADDR = /^0x[0-9a-fA-F]{40}$/;
|
|
56
|
+
/** What a publisher owes upstream for one resource, in bps of its share. Deduped by payee:
|
|
57
|
+
* the same source cited twice is one debt, not two, which can't be gamed by repeating an entry. */
|
|
58
|
+
function lineage(entries = []) {
|
|
59
|
+
const by = new Map();
|
|
60
|
+
for (const e of entries) {
|
|
61
|
+
const to = String(e.to ?? "").toLowerCase();
|
|
62
|
+
if (!ADDR.test(to)) throw new Error(`not an address: ${e.to}`);
|
|
63
|
+
const b = BigInt(e.bps ?? 0);
|
|
64
|
+
if (b < 0n || b > 10000n) throw new Error(`lineage bps must be 0..10000, got ${e.bps}`);
|
|
65
|
+
by.set(to, { to, bps: (by.get(to)?.bps ?? 0n) + b, note: e.note ?? by.get(to)?.note ?? "" });
|
|
66
|
+
}
|
|
67
|
+
const out = [...by.values()];
|
|
68
|
+
const total = out.reduce((s, e) => s + e.bps, 0n);
|
|
69
|
+
if (total > 10000n) throw new Error(`lineage owes ${total} bps of the publisher's share — more than all of it`);
|
|
70
|
+
return out.map((e) => ({ to: e.to, bps: String(e.bps), ...(e.note ? { note: e.note } : {}) }));
|
|
71
|
+
}
|
|
55
72
|
|
|
56
73
|
// 32, not 8: on Kingsfoil the top 3 of 23 views held 92% of the true top 10 with 32
|
|
57
74
|
// centroids and 86% with 8, and 8 missed whole topics (ALS → neurology).
|
|
@@ -68,7 +85,7 @@ const dot = (a, b) => { let s = 0, n = Math.min(a.length, b.length); for (let i
|
|
|
68
85
|
* Spherical k-means over the corpus's own vectors — the routing summary that
|
|
69
86
|
* lets a buyer rank this corpus WITHOUT downloading it.
|
|
70
87
|
*
|
|
71
|
-
*
|
|
88
|
+
* The view's coverage: fit at full width, truncate to `dim`
|
|
72
89
|
* leading components (Matryoshka), then RENORMALIZE, because a truncated unit
|
|
73
90
|
* vector is not unit and the client compares against a truncated query it
|
|
74
91
|
* renormalizes too. Get that order wrong and routing degrades silently.
|
|
@@ -216,7 +233,7 @@ export function reactionCorpus(events = [], {
|
|
|
216
233
|
description: description ?? `${rows.length} reactions from one reader across ${byCorpus.size} corpora — what held their attention, and what did not.`,
|
|
217
234
|
count: rows.length,
|
|
218
235
|
dim: rows[0].vector.length,
|
|
219
|
-
model:
|
|
236
|
+
model: EMBED_MODEL,
|
|
220
237
|
distance: "Cosine",
|
|
221
238
|
role_map: {
|
|
222
239
|
identity: "event", title: "label", subtitle: "corpus", temporal: "month",
|
|
@@ -237,8 +254,7 @@ export function reactionCorpus(events = [], {
|
|
|
237
254
|
}
|
|
238
255
|
|
|
239
256
|
// ── self-check: `node src/market/reactions.js` ────────────────────────────────
|
|
240
|
-
if (
|
|
241
|
-
const { splitPayment } = await import("./terms.js");
|
|
257
|
+
if (import.meta.url === `file://${globalThis.process?.argv?.[1]}` && process.argv[1].endsWith("/reactions.js")) {
|
|
242
258
|
const A = (n) => `0x${String(n).repeat(40).slice(0, 40)}`;
|
|
243
259
|
const vec = (a, b) => { const v = new Float32Array(256); v[0] = a; v[1] = b; return v; };
|
|
244
260
|
|
|
@@ -321,16 +337,6 @@ if (typeof process !== "undefined" && import.meta.url === `file://${process.argv
|
|
|
321
337
|
if (bps["archive-films"] !== 1500 || bps.games !== 500) throw new Error(`upstream must follow contribution: ${JSON.stringify(bps)}`);
|
|
322
338
|
if (up.reduce((s, e) => s + Number(e.bps), 0) !== 2000) throw new Error("the declared upstream total must be exact, not a basis point short");
|
|
323
339
|
|
|
324
|
-
// …and it reconciles against a real sale. This is the claim: the corpora that
|
|
325
|
-
// produced the attention are paid when the attention sells.
|
|
326
|
-
const TERMS = { appId: "fangorn.tv", owner: A(9), appBps: 1000 };
|
|
327
|
-
const pay = splitPayment(300000n, { terms: TERMS, publisher: A(3), lineage: up });
|
|
328
|
-
const got = Object.fromEntries(pay.map((p) => [p.to, p.amount]));
|
|
329
|
-
if (got[A(9)] !== 30000n) throw new Error("the app's cut comes off the top and never moves");
|
|
330
|
-
if (got[A(1)] !== 40500n || got[A(2)] !== 13500n) throw new Error(`upstream is paid from the publisher's share: ${JSON.stringify(got, (k, v) => typeof v === "bigint" ? String(v) : v)}`);
|
|
331
|
-
if (got[A(3)] !== 216000n) throw new Error("the reader keeps the rest");
|
|
332
|
-
if (pay.reduce((s, p) => s + p.amount, 0n) !== 300000n) throw new Error("money is neither invented nor destroyed");
|
|
333
|
-
|
|
334
340
|
// A reader who cites a corpus nobody registered simply owes it nothing.
|
|
335
341
|
const orphan = reactionCorpus(EV, { publisher: A(3), sources: { games: A(2) } });
|
|
336
342
|
if (orphan.lineage.length !== 1 || Number(orphan.lineage[0].bps) !== 2000) throw new Error("an unregistered corpus cannot be paid, and its share does not vanish");
|
|
@@ -341,5 +347,5 @@ if (typeof process !== "undefined" && import.meta.url === `file://${process.argv
|
|
|
341
347
|
|
|
342
348
|
console.log("reactions.js self-check ok — reactions become a corpus with no model, coverage is deterministic and renormalized after truncation, "
|
|
343
349
|
+ "the free index ranks on centroids alone, publishes no per-row vector to join against and no paid string anywhere including its own keys, "
|
|
344
|
-
+ "time is coarse, upstream follows contribution exactly
|
|
350
|
+
+ "time is coarse, upstream follows contribution exactly");
|
|
345
351
|
}
|