@tangle-network/agent-app 0.43.56 → 0.43.58
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/dist/DesignCanvas-UNL34LS2.js +12 -0
- package/dist/DesignCanvasEditor-FJIVYOA2.js +13 -0
- package/dist/IntakeInterview-3ZIQMZS6.js +8 -0
- package/dist/InvitationsPanel-CJ7DR4F7.js +8 -0
- package/dist/MembersPanel-BB4OD2KB.js +8 -0
- package/dist/{TimelineEditor-I35SJJAJ.js → TimelineEditor-2ECKSU6P.js} +3 -3
- package/dist/{VaultPane-DrQ_tH6c.d.ts → VaultPane-BDP6SB_K.d.ts} +1 -0
- package/dist/{access-BZ81Btt5.d.ts → access-490O6aOU.d.ts} +16 -1
- package/dist/app-auth/index.d.ts +6 -1
- package/dist/app-auth/index.js +3 -3
- package/dist/app-auth/index.js.map +1 -1
- package/dist/{apply-Gk4raT2j.d.ts → apply-6wlMOLf8.d.ts} +30 -1
- package/dist/assets/index.d.ts +41 -0
- package/dist/assets/index.js +1 -1
- package/dist/assistant/index.d.ts +26 -6
- package/dist/assistant/index.js +9 -9
- package/dist/assistant/index.js.map +1 -1
- package/dist/{attachment-validation-D0csjCvz.d.ts → attachment-validation-tPRp-PP1.d.ts} +7 -1
- package/dist/{auth-DuptSkWh.d.ts → auth-_FU8w01b.d.ts} +4 -1
- package/dist/billing/index.d.ts +8 -0
- package/dist/billing/index.js +1 -1
- package/dist/brand/index.d.ts +2 -0
- package/dist/brand/index.js.map +1 -1
- package/dist/brand-extraction/index.d.ts +3 -0
- package/dist/brand-extraction/index.js.map +1 -1
- package/dist/catalog/index.d.ts +2 -0
- package/dist/catalog/index.js +1 -1
- package/dist/chat-routes/index.d.ts +41 -10
- package/dist/chat-routes/index.js +15 -15
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-store/index.d.ts +18 -4
- package/dist/chat-store/index.js +4 -4
- package/dist/chat-store/index.js.map +1 -1
- package/dist/{chunk-H5FM75MR.js → chunk-22GLESKE.js} +3 -3
- package/dist/chunk-22GLESKE.js.map +1 -0
- package/dist/{chunk-WEBBJBDH.js → chunk-2DRYTJHI.js} +1 -1
- package/dist/chunk-2DRYTJHI.js.map +1 -0
- package/dist/{chunk-7EVZUIHW.js → chunk-3EJ6SFJI.js} +1 -1
- package/dist/chunk-3EJ6SFJI.js.map +1 -0
- package/dist/{chunk-HRJJH3RX.js → chunk-3OFQFW5K.js} +4 -4
- package/dist/chunk-3OFQFW5K.js.map +1 -0
- package/dist/{chunk-7SUPA2YT.js → chunk-4KKXZQPT.js} +2 -2
- package/dist/chunk-4KKXZQPT.js.map +1 -0
- package/dist/{chunk-5PTGEJZL.js → chunk-5SD6HT2V.js} +1 -1
- package/dist/chunk-5SD6HT2V.js.map +1 -0
- package/dist/{chunk-7C64WKAH.js → chunk-5SXS3YAB.js} +2 -2
- package/dist/{chunk-L2TG5DBW.js → chunk-5TESA4SN.js} +1 -1
- package/dist/chunk-5TESA4SN.js.map +1 -0
- package/dist/{chunk-63CE7FEZ.js → chunk-6XIAPIW6.js} +1 -1
- package/dist/chunk-6XIAPIW6.js.map +1 -0
- package/dist/{chunk-MFRCM32T.js → chunk-7CTIUCQ4.js} +1 -1
- package/dist/chunk-7CTIUCQ4.js.map +1 -0
- package/dist/{chunk-6KVH5SP5.js → chunk-7YW6EBDX.js} +2 -2
- package/dist/chunk-7YW6EBDX.js.map +1 -0
- package/dist/{chunk-ZXNXAQAH.js → chunk-AP2UXKUK.js} +1 -1
- package/dist/chunk-AP2UXKUK.js.map +1 -0
- package/dist/{chunk-K63OWUDJ.js → chunk-BPSV5AA2.js} +2 -2
- package/dist/chunk-BPSV5AA2.js.map +1 -0
- package/dist/{chunk-MFI4ZM7W.js → chunk-BT4QFCTB.js} +1 -1
- package/dist/chunk-BT4QFCTB.js.map +1 -0
- package/dist/{chunk-ZYBWGSAZ.js → chunk-BVKQKGRK.js} +1 -1
- package/dist/chunk-BVKQKGRK.js.map +1 -0
- package/dist/{chunk-RVUISYUE.js → chunk-C3NSB66C.js} +7 -7
- package/dist/chunk-C3NSB66C.js.map +1 -0
- package/dist/{chunk-BQV42AFK.js → chunk-CCVWR33L.js} +1 -1
- package/dist/chunk-CCVWR33L.js.map +1 -0
- package/dist/{chunk-MCJSS6SM.js → chunk-CQZSAR77.js} +1 -1
- package/dist/chunk-CQZSAR77.js.map +1 -0
- package/dist/{chunk-3SVAA3MA.js → chunk-DJ4VJIH5.js} +1 -1
- package/dist/chunk-DJ4VJIH5.js.map +1 -0
- package/dist/{chunk-XKBIYSSM.js → chunk-DTSPS2HV.js} +3 -3
- package/dist/chunk-DTSPS2HV.js.map +1 -0
- package/dist/{chunk-4QN75UHX.js → chunk-E7N67FYI.js} +8 -8
- package/dist/chunk-E7N67FYI.js.map +1 -0
- package/dist/{chunk-2QI7XV2T.js → chunk-FBVLEGEG.js} +1 -1
- package/dist/{chunk-2QI7XV2T.js.map → chunk-FBVLEGEG.js.map} +1 -1
- package/dist/{chunk-5RMIUJDI.js → chunk-FKCB5FTD.js} +1 -1
- package/dist/chunk-FKCB5FTD.js.map +1 -0
- package/dist/{chunk-EEPJGZJW.js → chunk-GPBRL2XR.js} +1 -1
- package/dist/chunk-GPBRL2XR.js.map +1 -0
- package/dist/{chunk-G3HCU7TA.js → chunk-GXE6KHTS.js} +1 -1
- package/dist/chunk-GXE6KHTS.js.map +1 -0
- package/dist/{chunk-65P3HJY3.js → chunk-HCOROIRT.js} +1 -1
- package/dist/chunk-HCOROIRT.js.map +1 -0
- package/dist/{chunk-54GSK2KK.js → chunk-HYTIHYNV.js} +2 -2
- package/dist/chunk-HYTIHYNV.js.map +1 -0
- package/dist/{chunk-5MG74GVQ.js → chunk-IG46XCZM.js} +3 -3
- package/dist/chunk-IG46XCZM.js.map +1 -0
- package/dist/{chunk-ND3XEGBE.js → chunk-JDEGS53O.js} +1 -1
- package/dist/chunk-JDEGS53O.js.map +1 -0
- package/dist/{chunk-7W5XSTUF.js → chunk-JML7WKWU.js} +1 -1
- package/dist/chunk-JML7WKWU.js.map +1 -0
- package/dist/{chunk-Q4TKVF3L.js → chunk-JTLYXUEV.js} +1 -1
- package/dist/chunk-JTLYXUEV.js.map +1 -0
- package/dist/{chunk-CCRVDLV3.js → chunk-JWBZ74TW.js} +2 -2
- package/dist/chunk-JWBZ74TW.js.map +1 -0
- package/dist/{chunk-ZU5GNSOJ.js → chunk-K3LIPKFV.js} +3 -3
- package/dist/chunk-K3LIPKFV.js.map +1 -0
- package/dist/{chunk-GQRL6VNU.js → chunk-LGBO24FL.js} +1 -1
- package/dist/chunk-LGBO24FL.js.map +1 -0
- package/dist/{chunk-SWUVTGMR.js → chunk-MEUNTJL5.js} +3 -3
- package/dist/{chunk-SWUVTGMR.js.map → chunk-MEUNTJL5.js.map} +1 -1
- package/dist/{chunk-YNALYIQ3.js → chunk-NLSSFLLS.js} +1 -1
- package/dist/chunk-NLSSFLLS.js.map +1 -0
- package/dist/{chunk-HFC4BTWJ.js → chunk-PTUMBMVH.js} +1 -1
- package/dist/chunk-PTUMBMVH.js.map +1 -0
- package/dist/{chunk-R4NOKZMD.js → chunk-ROLFDOMJ.js} +3 -3
- package/dist/{chunk-NYATNLRK.js → chunk-RT5RKAFX.js} +1 -1
- package/dist/chunk-RT5RKAFX.js.map +1 -0
- package/dist/{chunk-GNL3MG5J.js → chunk-S564OFTL.js} +2 -2
- package/dist/{chunk-GUSCYE3S.js → chunk-TQOFR6XY.js} +1 -1
- package/dist/chunk-TQOFR6XY.js.map +1 -0
- package/dist/{chunk-47C6PJCW.js → chunk-TZO3SOUL.js} +1 -1
- package/dist/chunk-TZO3SOUL.js.map +1 -0
- package/dist/{chunk-YGUNTIT5.js → chunk-UKTYKG57.js} +1 -1
- package/dist/chunk-UKTYKG57.js.map +1 -0
- package/dist/{chunk-23LUHHHN.js → chunk-VCOD5AOR.js} +1 -1
- package/dist/chunk-VCOD5AOR.js.map +1 -0
- package/dist/{chunk-5I72FRZY.js → chunk-VOJB7MVG.js} +2 -2
- package/dist/{chunk-XWJXZ6WE.js → chunk-VTWKH4YU.js} +2 -2
- package/dist/chunk-VTWKH4YU.js.map +1 -0
- package/dist/{chunk-4K7BZYO7.js → chunk-VWAEWOWK.js} +3 -3
- package/dist/chunk-VWAEWOWK.js.map +1 -0
- package/dist/{chunk-M2EBUDZ7.js → chunk-VWOPOLVO.js} +2 -2
- package/dist/chunk-VWOPOLVO.js.map +1 -0
- package/dist/{chunk-BN2USWIR.js → chunk-VYECQAGM.js} +2 -2
- package/dist/chunk-VYECQAGM.js.map +1 -0
- package/dist/{chunk-SIXYZ2FB.js → chunk-YJMCRXQQ.js} +1 -1
- package/dist/chunk-YJMCRXQQ.js.map +1 -0
- package/dist/{chunk-PJC4NXPA.js → chunk-YKBDH2UY.js} +3 -3
- package/dist/chunk-YKBDH2UY.js.map +1 -0
- package/dist/{chunk-XAWFPMAR.js → chunk-YKOM4ZLQ.js} +1 -1
- package/dist/chunk-YKOM4ZLQ.js.map +1 -0
- package/dist/{chunk-TKVJE63N.js → chunk-YRMLYFVR.js} +3 -3
- package/dist/chunk-YRMLYFVR.js.map +1 -0
- package/dist/{chunk-USYXHDKE.js → chunk-YZ6KQULN.js} +2 -2
- package/dist/{command-stack-B_-WNfZU.d.ts → command-stack-TNPWJCzW.d.ts} +14 -2
- package/dist/{completion-Kaqp_tWk.d.ts → completion-CvcNUz07.d.ts} +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/{contract-KfqJh_au.d.ts → contract-TjB68uqA.d.ts} +17 -0
- package/dist/design-canvas/drizzle.d.ts +10 -2
- package/dist/design-canvas/drizzle.js.map +1 -1
- package/dist/design-canvas/index.d.ts +29 -11
- package/dist/design-canvas/index.js +1070 -17
- package/dist/design-canvas/index.js.map +1 -1
- package/dist/design-canvas-react/engine.d.ts +42 -6
- package/dist/design-canvas-react/engine.js +4 -4
- package/dist/design-canvas-react/index.d.ts +12 -7
- package/dist/design-canvas-react/index.js +11 -11
- package/dist/design-canvas-react/index.js.map +1 -1
- package/dist/design-canvas-react/lazy.d.ts +4 -4
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/durable-chat/index.d.ts +46 -1
- package/dist/durable-chat/index.js +3 -3
- package/dist/eval/index.d.ts +1 -1
- package/dist/{export-presets-DAsU5Wal.d.ts → export-presets-mgVulRaV.d.ts} +10 -1
- package/dist/{flow-types-Cb_AblZs.d.ts → flow-types-CqomVAUN.d.ts} +1 -0
- package/dist/harness/index.d.ts +5 -0
- package/dist/harness/index.js +1 -1
- package/dist/index.d.ts +10 -18
- package/dist/index.js +30 -231
- package/dist/intakes/api.d.ts +3 -2
- package/dist/intakes/api.js +3 -3
- package/dist/intakes/api.js.map +1 -1
- package/dist/intakes/drizzle.d.ts +10 -2
- package/dist/intakes/drizzle.js +3 -3
- package/dist/intakes/drizzle.js.map +1 -1
- package/dist/intakes/index.d.ts +2 -2
- package/dist/intakes/index.js +2 -2
- package/dist/intakes-react/index.d.ts +2 -1
- package/dist/intakes-react/index.js +2 -2
- package/dist/intakes-react/lazy.d.ts +2 -1
- package/dist/intakes-react/lazy.js +1 -1
- package/dist/intakes-react/lazy.js.map +1 -1
- package/dist/integrations/index.d.ts +4 -0
- package/dist/integrations/index.js +1 -1
- package/dist/interactions/index.d.ts +13 -2
- package/dist/interactions/index.js +2 -2
- package/dist/{invitations-CZ5G2tIn.d.ts → invitations-DoYMvXea.d.ts} +11 -1
- package/dist/{invitations-schema-DaMO4hZE.d.ts → invitations-schema-_fI7HkJP.d.ts} +5 -1
- package/dist/knowledge/index.d.ts +2 -0
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge-loop/index.d.ts +4 -1
- package/dist/knowledge-loop/index.js +1 -1
- package/dist/{lazy-C7LiVeFt.d.ts → lazy-DrkVyDpe.d.ts} +2 -2
- package/dist/{mcp-BHfIoGLW.d.ts → mcp-BjPqQ-3C.d.ts} +4 -2
- package/dist/{mcp-rpc-DLw_r9PQ.d.ts → mcp-rpc-BfUOsalw.d.ts} +3 -0
- package/dist/missions/index.d.ts +25 -0
- package/dist/missions/index.js +1 -1
- package/dist/{model-Bzi5i63l.d.ts → model-C8U0HZxL.d.ts} +1 -0
- package/dist/{model-dF2h4xT9.d.ts → model-DmdkIteM.d.ts} +19 -0
- package/dist/{model-BBwyOuWG.d.ts → model-DnfO_PdJ.d.ts} +25 -1
- package/dist/model-resolution/index.d.ts +10 -0
- package/dist/model-resolution/index.js.map +1 -1
- package/dist/{operations-DLIvvD00.d.ts → operations-ByJ6yXOW.d.ts} +20 -2
- package/dist/{parts-1sRYSPjF.d.ts → parts-n9XUon0a.d.ts} +29 -1
- package/dist/plans/index.d.ts +6 -0
- package/dist/plans/index.js +1 -1
- package/dist/platform/index.d.ts +24 -2
- package/dist/platform/index.js +3 -3
- package/dist/platform/index.js.map +1 -1
- package/dist/preflight/index.d.ts +3 -0
- package/dist/preflight/index.js +1 -1
- package/dist/preset-cloudflare/index.d.ts +4 -1
- package/dist/preset-cloudflare/index.js +2 -2
- package/dist/redact/index.d.ts +5 -0
- package/dist/redact/index.js +1 -1
- package/dist/{roles-BC1n4t37.d.ts → roles-B4nU3jDi.d.ts} +12 -0
- package/dist/run/index.d.ts +3 -0
- package/dist/run/index.js +1 -1
- package/dist/run/index.js.map +1 -1
- package/dist/runtime/index.d.ts +11 -4
- package/dist/runtime/index.js +4 -4
- package/dist/sandbox/index.d.ts +96 -3
- package/dist/sandbox/index.js +6 -6
- package/dist/{sandbox-terminal-BIIC__CP.d.ts → sandbox-terminal-ChNEdHF8.d.ts} +5 -0
- package/dist/sequences/drizzle.d.ts +11 -1
- package/dist/sequences/drizzle.js +1 -1
- package/dist/sequences/drizzle.js.map +1 -1
- package/dist/sequences/index.d.ts +32 -7
- package/dist/sequences/index.js +1562 -47
- package/dist/sequences/index.js.map +1 -1
- package/dist/sequences-react/index.d.ts +32 -2
- package/dist/sequences-react/index.js +3 -3
- package/dist/sequences-react/index.js.map +1 -1
- package/dist/{sso-CNOsARMJ.d.ts → sso-Cm00S61u.d.ts} +13 -0
- package/dist/{stale-turn-lock-C8Na1cFZ.d.ts → stale-turn-lock-DucQzvXu.d.ts} +2 -0
- package/dist/store/index.d.ts +5 -0
- package/dist/store/index.js.map +1 -1
- package/dist/{store-gckrNq-g.d.ts → store-B7LLlk9p.d.ts} +22 -1
- package/dist/{store-CFyxgTlD.d.ts → store-CqfDtnPQ.d.ts} +8 -2
- package/dist/stream/index.d.ts +10 -4
- package/dist/stream/index.js +4 -4
- package/dist/{stream-normalizer-DWvtmY6F.d.ts → stream-normalizer-C3M--r6y.d.ts} +17 -1
- package/dist/studio/index.d.ts +37 -0
- package/dist/studio/index.js +1 -1
- package/dist/studio-react/index.d.ts +3 -0
- package/dist/studio-react/index.js +1 -1
- package/dist/studio-react/index.js.map +1 -1
- package/dist/tangle/index.d.ts +3 -0
- package/dist/tangle/index.js +1 -1
- package/dist/teams/drizzle.d.ts +8 -4
- package/dist/teams/drizzle.js +1 -1
- package/dist/teams/drizzle.js.map +1 -1
- package/dist/teams/index.d.ts +4 -2
- package/dist/teams/index.js +3 -3
- package/dist/teams/invitations-api.d.ts +10 -4
- package/dist/teams/invitations-api.js +4 -4
- package/dist/teams/invitations-api.js.map +1 -1
- package/dist/teams/members-api.d.ts +4 -2
- package/dist/teams/members-api.js +3 -3
- package/dist/teams/resend.d.ts +5 -4
- package/dist/teams/resend.js +1 -1
- package/dist/teams/resend.js.map +1 -1
- package/dist/teams-react/index.d.ts +7 -2
- package/dist/teams-react/index.js +3 -3
- package/dist/teams-react/lazy.d.ts +5 -2
- package/dist/teams-react/lazy.js +2 -2
- package/dist/teams-react/lazy.js.map +1 -1
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.js +1 -1
- package/dist/theme/tailwind-preset.d.ts +1 -0
- package/dist/theme/tailwind-preset.js.map +1 -1
- package/dist/theme-contract/cli.js +1 -1
- package/dist/theme-contract/index.d.ts +3 -0
- package/dist/theme-contract/index.js +1 -1
- package/dist/tools/index.d.ts +13 -6
- package/dist/tools/index.js +3 -3
- package/dist/trace/index.d.ts +6 -1
- package/dist/trace/index.js +2 -2
- package/dist/{turn-buffer-C9mEgoop.d.ts → turn-buffer-DGnAPKwa.d.ts} +6 -0
- package/dist/turn-stream/index.d.ts +28 -2
- package/dist/turn-stream/index.js +1 -1
- package/dist/turn-stream/index.js.map +1 -1
- package/dist/{types-BEOvc_ue.d.ts → types-CBRyqijY.d.ts} +10 -0
- package/dist/vault/index.d.ts +1 -1
- package/dist/vault/lazy.d.ts +3 -2
- package/dist/vault/lazy.js.map +1 -1
- package/dist/web/index.d.ts +4 -0
- package/dist/web/index.js +1 -1
- package/dist/web-react/index.d.ts +51 -8
- package/dist/web-react/index.js +9 -9
- package/dist/web-react/terminal.d.ts +2 -2
- package/dist/web-react/terminal.js +1 -1
- package/package.json +3 -2
- package/dist/DesignCanvas-5DJAFDNC.js +0 -12
- package/dist/DesignCanvasEditor-XUJZARSN.js +0 -13
- package/dist/IntakeInterview-WHVKMNQW.js +0 -8
- package/dist/InvitationsPanel-XUUWZBPV.js +0 -8
- package/dist/MembersPanel-FOVHWUQ3.js +0 -8
- package/dist/chunk-23LUHHHN.js.map +0 -1
- package/dist/chunk-3SVAA3MA.js.map +0 -1
- package/dist/chunk-47C6PJCW.js.map +0 -1
- package/dist/chunk-4K7BZYO7.js.map +0 -1
- package/dist/chunk-4QN75UHX.js.map +0 -1
- package/dist/chunk-54GSK2KK.js.map +0 -1
- package/dist/chunk-5MG74GVQ.js.map +0 -1
- package/dist/chunk-5PTGEJZL.js.map +0 -1
- package/dist/chunk-5RMIUJDI.js.map +0 -1
- package/dist/chunk-63CE7FEZ.js.map +0 -1
- package/dist/chunk-65P3HJY3.js.map +0 -1
- package/dist/chunk-6KVH5SP5.js.map +0 -1
- package/dist/chunk-7EVZUIHW.js.map +0 -1
- package/dist/chunk-7SUPA2YT.js.map +0 -1
- package/dist/chunk-7W5XSTUF.js.map +0 -1
- package/dist/chunk-BN2USWIR.js.map +0 -1
- package/dist/chunk-BQV42AFK.js.map +0 -1
- package/dist/chunk-CCRVDLV3.js.map +0 -1
- package/dist/chunk-EEPJGZJW.js.map +0 -1
- package/dist/chunk-G3HCU7TA.js.map +0 -1
- package/dist/chunk-GQRL6VNU.js.map +0 -1
- package/dist/chunk-GUSCYE3S.js.map +0 -1
- package/dist/chunk-H5FM75MR.js.map +0 -1
- package/dist/chunk-HFC4BTWJ.js.map +0 -1
- package/dist/chunk-HRJJH3RX.js.map +0 -1
- package/dist/chunk-K63OWUDJ.js.map +0 -1
- package/dist/chunk-L2TG5DBW.js.map +0 -1
- package/dist/chunk-M2EBUDZ7.js.map +0 -1
- package/dist/chunk-MCJSS6SM.js.map +0 -1
- package/dist/chunk-MFI4ZM7W.js.map +0 -1
- package/dist/chunk-MFRCM32T.js.map +0 -1
- package/dist/chunk-ND3XEGBE.js.map +0 -1
- package/dist/chunk-NEOV2NQ3.js +0 -1617
- package/dist/chunk-NEOV2NQ3.js.map +0 -1
- package/dist/chunk-NYATNLRK.js.map +0 -1
- package/dist/chunk-PJC4NXPA.js.map +0 -1
- package/dist/chunk-Q4TKVF3L.js.map +0 -1
- package/dist/chunk-RVUISYUE.js.map +0 -1
- package/dist/chunk-SIXYZ2FB.js.map +0 -1
- package/dist/chunk-TKVJE63N.js.map +0 -1
- package/dist/chunk-WEBBJBDH.js.map +0 -1
- package/dist/chunk-WFMUDX5J.js +0 -1092
- package/dist/chunk-WFMUDX5J.js.map +0 -1
- package/dist/chunk-XAWFPMAR.js.map +0 -1
- package/dist/chunk-XKBIYSSM.js.map +0 -1
- package/dist/chunk-XWJXZ6WE.js.map +0 -1
- package/dist/chunk-YGUNTIT5.js.map +0 -1
- package/dist/chunk-YNALYIQ3.js.map +0 -1
- package/dist/chunk-ZU5GNSOJ.js.map +0 -1
- package/dist/chunk-ZXNXAQAH.js.map +0 -1
- package/dist/chunk-ZYBWGSAZ.js.map +0 -1
- /package/dist/{DesignCanvas-5DJAFDNC.js.map → DesignCanvas-UNL34LS2.js.map} +0 -0
- /package/dist/{DesignCanvasEditor-XUJZARSN.js.map → DesignCanvasEditor-FJIVYOA2.js.map} +0 -0
- /package/dist/{IntakeInterview-WHVKMNQW.js.map → IntakeInterview-3ZIQMZS6.js.map} +0 -0
- /package/dist/{InvitationsPanel-XUUWZBPV.js.map → InvitationsPanel-CJ7DR4F7.js.map} +0 -0
- /package/dist/{MembersPanel-FOVHWUQ3.js.map → MembersPanel-BB4OD2KB.js.map} +0 -0
- /package/dist/{TimelineEditor-I35SJJAJ.js.map → TimelineEditor-2ECKSU6P.js.map} +0 -0
- /package/dist/{chunk-7C64WKAH.js.map → chunk-5SXS3YAB.js.map} +0 -0
- /package/dist/{chunk-R4NOKZMD.js.map → chunk-ROLFDOMJ.js.map} +0 -0
- /package/dist/{chunk-GNL3MG5J.js.map → chunk-S564OFTL.js.map} +0 -0
- /package/dist/{chunk-5I72FRZY.js.map → chunk-VOJB7MVG.js.map} +0 -0
- /package/dist/{chunk-USYXHDKE.js.map → chunk-YZ6KQULN.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/sequences-react/media/transcription.ts","../../src/sequences-react/lazy.tsx"],"sourcesContent":["/**\n * Whisper transcription behind the `TranscriptionProvider` seam, powered by\n * the OPTIONAL peer `@huggingface/transformers`. The peer is loaded with a\n * dynamic variable-specifier import inside `transcribe()` so bundlers leave\n * it external and apps that never transcribe never pay for it. `available`\n * is the sync UI affordance signal; `transcribe()` re-verifies with the real\n * import and is the source of truth.\n */\n\nimport type { TranscriptionProvider, TranscriptionSegment } from '../contracts'\nimport type { AudioBufferLike } from './waveform'\n\nexport const DEFAULT_WHISPER_MODEL = 'onnx-community/whisper-large-v3-turbo'\n\n/** Whisper models are trained on 16 kHz mono — decoding through a 16 kHz\n * OfflineAudioContext resamples any source rate in one step. */\nconst WHISPER_SAMPLE_RATE = 16_000\n\nconst TRANSCRIPTION_PEER = '@huggingface/transformers'\nconst PEER_MISSING_MESSAGE = 'transcription requires optional peer @huggingface/transformers'\n\ninterface WhisperChunk {\n text: string\n timestamp: [number, number | null]\n}\n\nexport interface WhisperOutput {\n text: string\n chunks?: WhisperChunk[]\n}\n\ntype WhisperPipeline = (\n audio: Float32Array,\n options: Record<string, unknown>,\n) => Promise<WhisperOutput | WhisperOutput[]>\n\ninterface TransformersProgressEvent {\n status: string\n progress?: number\n}\n\ninterface TransformersModule {\n pipeline(\n task: 'automatic-speech-recognition',\n model: string,\n options?: Record<string, unknown>,\n ): Promise<WhisperPipeline>\n}\n\n/** Mean-mixdown to mono. Single-channel buffers return the live channel data\n * without copying — callers must treat the result as read-only. */\nexport function mixdownToMono(buffer: AudioBufferLike): Float32Array {\n if (buffer.numberOfChannels < 1) throw new Error('audio buffer has no channels — cannot mix down')\n if (buffer.numberOfChannels === 1) return buffer.getChannelData(0)\n const mono = new Float32Array(buffer.length)\n for (let channel = 0; channel < buffer.numberOfChannels; channel++) {\n const data = buffer.getChannelData(channel)\n if (data.length !== buffer.length) {\n throw new Error(`channel ${channel} has ${data.length} samples, expected ${buffer.length}`)\n }\n for (let i = 0; i < data.length; i++) {\n // in range by the length assertion above; casts silence noUncheckedIndexedAccess\n mono[i] = (mono[i] as number) + (data[i] as number)\n }\n }\n const scale = 1 / buffer.numberOfChannels\n for (let i = 0; i < mono.length; i++) {\n mono[i] = (mono[i] as number) * scale\n }\n return mono\n}\n\n/** Map whisper chunk output to contract segments. A `null` end timestamp is\n * whisper's \"ran past the end of the audio\" sentinel on the final chunk and\n * resolves to the audio duration. */\nexport function mapWhisperOutput(\n output: WhisperOutput | WhisperOutput[],\n durationSeconds: number,\n mediaUrl: string,\n): TranscriptionSegment[] {\n const first = Array.isArray(output) ? output[0] : output\n if (first === undefined) throw new Error(`whisper produced no output for ${mediaUrl}`)\n const chunks = first.chunks\n if (chunks === undefined || chunks.length === 0) {\n const text = first.text.trim()\n return text.length === 0 ? [] : [{ text, startSeconds: 0, endSeconds: durationSeconds }]\n }\n const segments: TranscriptionSegment[] = []\n for (const chunk of chunks) {\n const text = chunk.text.trim()\n if (text.length === 0) continue\n const [start, end] = chunk.timestamp\n if (!Number.isFinite(start)) {\n throw new Error(`whisper returned a non-numeric start timestamp for \"${text}\" in ${mediaUrl}`)\n }\n segments.push({ text, startSeconds: start, endSeconds: end === null ? durationSeconds : end })\n }\n return segments\n}\n\nasync function loadTransformers(): Promise<TransformersModule> {\n try {\n // Variable specifier + ignore pragmas keep bundlers from statically\n // resolving an optional peer that may not be installed.\n return (await import(/* @vite-ignore */ /* webpackIgnore: true */ TRANSCRIPTION_PEER)) as TransformersModule\n } catch (error) {\n throw new Error(PEER_MISSING_MESSAGE, { cause: error })\n }\n}\n\nasync function fetchMonoAudio(mediaUrl: string): Promise<{ samples: Float32Array; durationSeconds: number }> {\n const response = await fetch(mediaUrl)\n if (!response.ok) {\n throw new Error(`failed to fetch media for transcription: ${response.status} ${response.statusText} from ${mediaUrl}`)\n }\n const bytes = await response.arrayBuffer()\n if (typeof OfflineAudioContext === 'undefined') {\n throw new Error('transcription requires Web Audio (OfflineAudioContext) — call transcribe() from a browser')\n }\n // decodeAudioData resamples to the context rate per the Web Audio spec, so\n // a 16 kHz context yields whisper-ready samples from any source rate.\n const context = new OfflineAudioContext(1, 1, WHISPER_SAMPLE_RATE)\n const decoded = await context.decodeAudioData(bytes)\n return { samples: mixdownToMono(decoded), durationSeconds: decoded.duration }\n}\n\nexport function createWhisperTranscriptionProvider(opts?: { model?: string }): TranscriptionProvider {\n const model = opts?.model ?? DEFAULT_WHISPER_MODEL\n let availability: boolean | null = null\n let pipelinePromise: Promise<WhisperPipeline> | null = null\n\n const probeAvailability = (): boolean => {\n if (availability !== null) return availability\n const resolve = (import.meta as ImportMeta & { resolve?: (specifier: string) => string }).resolve\n if (typeof resolve !== 'function') {\n // No sync resolver in this runtime — report unavailable rather than\n // guess; transcribe() still attempts the real import either way.\n availability = false\n return availability\n }\n try {\n resolve.call(import.meta, TRANSCRIPTION_PEER)\n availability = true\n } catch {\n availability = false\n }\n return availability\n }\n\n const getPipeline = (\n transformers: TransformersModule,\n onProgress?: (fraction: number) => void,\n ): Promise<WhisperPipeline> => {\n if (pipelinePromise === null) {\n const device = typeof navigator !== 'undefined' && 'gpu' in navigator ? 'webgpu' : 'wasm'\n pipelinePromise = transformers.pipeline('automatic-speech-recognition', model, {\n dtype: 'q4',\n device,\n // Model download progress only — it dwarfs inference time on first\n // use, and only the first transcribe ever sees a download.\n progress_callback: (event: TransformersProgressEvent) => {\n if (event.status === 'progress' && typeof event.progress === 'number' && onProgress !== undefined) {\n onProgress(Math.min(1, Math.max(0, event.progress / 100)))\n }\n },\n })\n // A failed load must not poison the cache — the next transcribe retries.\n pipelinePromise.catch(() => {\n pipelinePromise = null\n })\n }\n return pipelinePromise\n }\n\n return {\n get available() {\n return probeAvailability()\n },\n async transcribe(mediaUrl, transcribeOpts) {\n const transformers = await loadTransformers()\n // A successful import is ground truth and overrides a false probe.\n availability = true\n const audio = await fetchMonoAudio(mediaUrl)\n const transcriber = await getPipeline(transformers, transcribeOpts?.onProgress)\n const options: Record<string, unknown> = {\n return_timestamps: true,\n chunk_length_s: 30,\n stride_length_s: 5,\n }\n if (transcribeOpts?.language !== undefined) options.language = transcribeOpts.language\n const output = await transcriber(audio.samples, options)\n const segments = mapWhisperOutput(output, audio.durationSeconds, mediaUrl)\n transcribeOpts?.onProgress?.(1)\n return segments\n },\n }\n}\n","/**\n * Code-split entry for the timeline editor. The editor pulls in canvas\n * painting, waveform decode, and gesture machinery products only need on the\n * sequence route — `React.lazy` keeps it out of their main bundle. Mount\n * inside a `<Suspense>` boundary.\n */\n\nimport React from 'react'\n\nexport const SequenceTimelineEditorLazy = React.lazy(() => import('./components/TimelineEditor'))\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,IAAM,wBAAwB;AAIrC,IAAM,sBAAsB;AAE5B,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB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sx"],"sourcesContent":["/**\n * Whisper transcription behind the `TranscriptionProvider` seam, powered by\n * the OPTIONAL peer `@huggingface/transformers`. The peer is loaded with a\n * dynamic variable-specifier import inside `transcribe()` so bundlers leave\n * it external and apps that never transcribe never pay for it. `available`\n * is the sync UI affordance signal; `transcribe()` re-verifies with the real\n * import and is the source of truth.\n */\n\nimport type { TranscriptionProvider, TranscriptionSegment } from '../contracts'\nimport type { AudioBufferLike } from './waveform'\n\n/** Provide the default Whisper model identifier for ONNX community large v3 turbo */\nexport const DEFAULT_WHISPER_MODEL = 'onnx-community/whisper-large-v3-turbo'\n\n/** Whisper models are trained on 16 kHz mono — decoding through a 16 kHz\n * OfflineAudioContext resamples any source rate in one step. */\nconst WHISPER_SAMPLE_RATE = 16_000\n\nconst TRANSCRIPTION_PEER = '@huggingface/transformers'\nconst PEER_MISSING_MESSAGE = 'transcription requires optional peer @huggingface/transformers'\n\ninterface WhisperChunk {\n text: string\n timestamp: [number, number | null]\n}\n\n/** Define the structure for transcribed text output with optional segmented chunks */\nexport interface WhisperOutput {\n text: string\n chunks?: WhisperChunk[]\n}\n\ntype WhisperPipeline = (\n audio: Float32Array,\n options: Record<string, unknown>,\n) => Promise<WhisperOutput | WhisperOutput[]>\n\ninterface TransformersProgressEvent {\n status: string\n progress?: number\n}\n\ninterface TransformersModule {\n pipeline(\n task: 'automatic-speech-recognition',\n model: string,\n options?: Record<string, unknown>,\n ): Promise<WhisperPipeline>\n}\n\n/** Mean-mixdown to mono. Single-channel buffers return the live channel data\n * without copying — callers must treat the result as read-only. */\nexport function mixdownToMono(buffer: AudioBufferLike): Float32Array {\n if (buffer.numberOfChannels < 1) throw new Error('audio buffer has no channels — cannot mix down')\n if (buffer.numberOfChannels === 1) return buffer.getChannelData(0)\n const mono = new Float32Array(buffer.length)\n for (let channel = 0; channel < buffer.numberOfChannels; channel++) {\n const data = buffer.getChannelData(channel)\n if (data.length !== buffer.length) {\n throw new Error(`channel ${channel} has ${data.length} samples, expected ${buffer.length}`)\n }\n for (let i = 0; i < data.length; i++) {\n // in range by the length assertion above; casts silence noUncheckedIndexedAccess\n mono[i] = (mono[i] as number) + (data[i] as number)\n }\n }\n const scale = 1 / buffer.numberOfChannels\n for (let i = 0; i < mono.length; i++) {\n mono[i] = (mono[i] as number) * scale\n }\n return mono\n}\n\n/** Map whisper chunk output to contract segments. A `null` end timestamp is\n * whisper's \"ran past the end of the audio\" sentinel on the final chunk and\n * resolves to the audio duration. */\nexport function mapWhisperOutput(\n output: WhisperOutput | WhisperOutput[],\n durationSeconds: number,\n mediaUrl: string,\n): TranscriptionSegment[] {\n const first = Array.isArray(output) ? output[0] : output\n if (first === undefined) throw new Error(`whisper produced no output for ${mediaUrl}`)\n const chunks = first.chunks\n if (chunks === undefined || chunks.length === 0) {\n const text = first.text.trim()\n return text.length === 0 ? [] : [{ text, startSeconds: 0, endSeconds: durationSeconds }]\n }\n const segments: TranscriptionSegment[] = []\n for (const chunk of chunks) {\n const text = chunk.text.trim()\n if (text.length === 0) continue\n const [start, end] = chunk.timestamp\n if (!Number.isFinite(start)) {\n throw new Error(`whisper returned a non-numeric start timestamp for \"${text}\" in ${mediaUrl}`)\n }\n segments.push({ text, startSeconds: start, endSeconds: end === null ? durationSeconds : end })\n }\n return segments\n}\n\nasync function loadTransformers(): Promise<TransformersModule> {\n try {\n // Variable specifier + ignore pragmas keep bundlers from statically\n // resolving an optional peer that may not be installed.\n return (await import(/* @vite-ignore */ /* webpackIgnore: true */ TRANSCRIPTION_PEER)) as TransformersModule\n } catch (error) {\n throw new Error(PEER_MISSING_MESSAGE, { cause: error })\n }\n}\n\nasync function fetchMonoAudio(mediaUrl: string): Promise<{ samples: Float32Array; durationSeconds: number }> {\n const response = await fetch(mediaUrl)\n if (!response.ok) {\n throw new Error(`failed to fetch media for transcription: ${response.status} ${response.statusText} from ${mediaUrl}`)\n }\n const bytes = await response.arrayBuffer()\n if (typeof OfflineAudioContext === 'undefined') {\n throw new Error('transcription requires Web Audio (OfflineAudioContext) — call transcribe() from a browser')\n }\n // decodeAudioData resamples to the context rate per the Web Audio spec, so\n // a 16 kHz context yields whisper-ready samples from any source rate.\n const context = new OfflineAudioContext(1, 1, WHISPER_SAMPLE_RATE)\n const decoded = await context.decodeAudioData(bytes)\n return { samples: mixdownToMono(decoded), durationSeconds: decoded.duration }\n}\n\n/** Create a Whisper-based transcription provider with optional model configuration */\nexport function createWhisperTranscriptionProvider(opts?: { model?: string }): TranscriptionProvider {\n const model = opts?.model ?? DEFAULT_WHISPER_MODEL\n let availability: boolean | null = null\n let pipelinePromise: Promise<WhisperPipeline> | null = null\n\n const probeAvailability = (): boolean => {\n if (availability !== null) return availability\n const resolve = (import.meta as ImportMeta & { resolve?: (specifier: string) => string }).resolve\n if (typeof resolve !== 'function') {\n // No sync resolver in this runtime — report unavailable rather than\n // guess; transcribe() still attempts the real import either way.\n availability = false\n return availability\n }\n try {\n resolve.call(import.meta, TRANSCRIPTION_PEER)\n availability = true\n } catch {\n availability = false\n }\n return availability\n }\n\n const getPipeline = (\n transformers: TransformersModule,\n onProgress?: (fraction: number) => void,\n ): Promise<WhisperPipeline> => {\n if (pipelinePromise === null) {\n const device = typeof navigator !== 'undefined' && 'gpu' in navigator ? 'webgpu' : 'wasm'\n pipelinePromise = transformers.pipeline('automatic-speech-recognition', model, {\n dtype: 'q4',\n device,\n // Model download progress only — it dwarfs inference time on first\n // use, and only the first transcribe ever sees a download.\n progress_callback: (event: TransformersProgressEvent) => {\n if (event.status === 'progress' && typeof event.progress === 'number' && onProgress !== undefined) {\n onProgress(Math.min(1, Math.max(0, event.progress / 100)))\n }\n },\n })\n // A failed load must not poison the cache — the next transcribe retries.\n pipelinePromise.catch(() => {\n pipelinePromise = null\n })\n }\n return pipelinePromise\n }\n\n return {\n get available() {\n return probeAvailability()\n },\n async transcribe(mediaUrl, transcribeOpts) {\n const transformers = await loadTransformers()\n // A successful import is ground truth and overrides a false probe.\n availability = true\n const audio = await fetchMonoAudio(mediaUrl)\n const transcriber = await getPipeline(transformers, transcribeOpts?.onProgress)\n const options: Record<string, unknown> = {\n return_timestamps: true,\n chunk_length_s: 30,\n stride_length_s: 5,\n }\n if (transcribeOpts?.language !== undefined) options.language = transcribeOpts.language\n const output = await transcriber(audio.samples, options)\n const segments = mapWhisperOutput(output, audio.durationSeconds, mediaUrl)\n transcribeOpts?.onProgress?.(1)\n return segments\n },\n }\n}\n","/**\n * Code-split entry for the timeline editor. The editor pulls in canvas\n * painting, waveform decode, and gesture machinery products only need on the\n * sequence route — `React.lazy` keeps it out of their main bundle. Mount\n * inside a `<Suspense>` boundary.\n */\n\nimport React from 'react'\n\nexport const SequenceTimelineEditorLazy = React.lazy(() => import('./components/TimelineEditor'))\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,IAAM,wBAAwB;AAIrC,IAAM,sBAAsB;AAE5B,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;AAiCtB,SAAS,cAAc,QAAuC;AACnE,MAAI,OAAO,mBAAmB,EAAG,OAAM,IAAI,MAAM,qDAAgD;AACjG,MAAI,OAAO,qBAAqB,EAAG,QAAO,OAAO,eAAe,CAAC;AACjE,QAAM,OAAO,IAAI,aAAa,OAAO,MAAM;AAC3C,WAAS,UAAU,GAAG,UAAU,OAAO,kBAAkB,WAAW;AAClE,UAAM,OAAO,OAAO,eAAe,OAAO;AAC1C,QAAI,KAAK,WAAW,OAAO,QAAQ;AACjC,YAAM,IAAI,MAAM,WAAW,OAAO,QAAQ,KAAK,MAAM,sBAAsB,OAAO,MAAM,EAAE;AAAA,IAC5F;AACA,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AAEpC,WAAK,CAAC,IAAK,KAAK,CAAC,IAAgB,KAAK,CAAC;AAAA,IACzC;AAAA,EACF;AACA,QAAM,QAAQ,IAAI,OAAO;AACzB,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,SAAK,C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zC,YAAM,eAAe,MAAM,iBAAiB;AAE5C,qBAAe;AACf,YAAM,QAAQ,MAAM,eAAe,QAAQ;AAC3C,YAAM,cAAc,MAAM,YAAY,cAAc,gBAAgB,UAAU;AAC9E,YAAM,UAAmC;AAAA,QACvC,mBAAmB;AAAA,QACnB,gBAAgB;AAAA,QAChB,iBAAiB;AAAA,MACnB;AACA,UAAI,gBAAgB,aAAa,OAAW,SAAQ,WAAW,eAAe;AAC9E,YAAM,SAAS,MAAM,YAAY,MAAM,SAAS,OAAO;AACvD,YAAM,WAAW,iBAAiB,QAAQ,MAAM,iBAAiB,QAAQ;AACzE,sBAAgB,aAAa,CAAC;AAC9B,aAAO;AAAA,IACT;AAAA,EACF;AACF;;;AChMA,OAAO,WAAW;AAEX,IAAM,6BAA6B,MAAM,KAAK,MAAM,OAAO,+BAA6B,CAAC;","names":[]}
|
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
* Session resolution is a seam; thrown Responses follow the router convention
|
|
6
6
|
* of surfacing a thrown Response as the route result.
|
|
7
7
|
*/
|
|
8
|
+
/** Define options for configuring authentication guard behavior and session retrieval */
|
|
8
9
|
interface AuthGuardOptions<Session> {
|
|
9
10
|
/** e.g. a better-auth `auth.api.getSession` wrapped by the app. */
|
|
10
11
|
getSession(request: Request): Promise<Session | null | undefined>;
|
|
11
12
|
/** Default '/login'. */
|
|
12
13
|
loginPath?: string;
|
|
13
14
|
}
|
|
15
|
+
/** Resolve user authentication and session requirements for page and API requests */
|
|
14
16
|
interface AuthGuard<Session> {
|
|
15
17
|
/** Page guard — throws a 302 redirect Response to `loginPath`. */
|
|
16
18
|
requireUser(request: Request): Promise<Session>;
|
|
@@ -22,7 +24,9 @@ interface AuthGuard<Session> {
|
|
|
22
24
|
}): Promise<Session>;
|
|
23
25
|
getOptionalSession(request: Request): Promise<Session | null>;
|
|
24
26
|
}
|
|
27
|
+
/** Create an authentication guard that enforces session presence and handles unauthorized access responses */
|
|
25
28
|
declare function createAuthGuard<Session>(opts: AuthGuardOptions<Session>): AuthGuard<Session>;
|
|
29
|
+
/** Resolve a value or an HTTP response indicating failure in a guarded operation */
|
|
26
30
|
type GuardResolution<T> = {
|
|
27
31
|
ok: true;
|
|
28
32
|
value: T;
|
|
@@ -40,6 +44,7 @@ type GuardResolution<T> = {
|
|
|
40
44
|
declare function guardResolution<T>(run: () => Promise<T>): Promise<GuardResolution<T>>;
|
|
41
45
|
/** Comma/whitespace separated → trimmed, lowercased, empties dropped. */
|
|
42
46
|
declare function parseAdminEmails(raw: string | null | undefined): string[];
|
|
47
|
+
/** Define options to resolve user session and control access based on allowed admin emails */
|
|
43
48
|
interface AdminGuardOptions<Session> {
|
|
44
49
|
requireUser(request: Request): Promise<Session>;
|
|
45
50
|
emailOf(session: Session): string | null | undefined;
|
|
@@ -49,10 +54,12 @@ interface AdminGuardOptions<Session> {
|
|
|
49
54
|
/** Non-admins (and empty allowlists) get 404, keeping the route invisible —
|
|
50
55
|
* better than a "forbidden" footprint that advertises its existence. */
|
|
51
56
|
declare function createAdminGuard<Session>(opts: AdminGuardOptions<Session>): (request: Request) => Promise<Session>;
|
|
57
|
+
/** Describe the billable balance state including overage permission and remaining USD balance */
|
|
52
58
|
interface BillableBalanceState {
|
|
53
59
|
overageAllowed: boolean;
|
|
54
60
|
remainingBalanceUsd: number;
|
|
55
61
|
}
|
|
62
|
+
/** Define options to assert and customize billable balance enforcement behavior */
|
|
56
63
|
interface AssertBillableBalanceOptions {
|
|
57
64
|
env?: Record<string, string | undefined>;
|
|
58
65
|
/** App-specific enforcement override flag (e.g. 'GTM_BILLING_ENFORCEMENT'),
|
|
@@ -79,6 +86,7 @@ declare function assertBillableBalance(state: BillableBalanceState, opts?: Asser
|
|
|
79
86
|
* never imports agent-runtime, an auth framework, or a database driver.
|
|
80
87
|
* WebCrypto only — runs in workerd without node compatibility flags.
|
|
81
88
|
*/
|
|
89
|
+
/** Define configuration options for managing SSO state including secret, lifetime, and clock injection */
|
|
82
90
|
interface SsoStateConfig {
|
|
83
91
|
/** HMAC-SHA256 secret (e.g. the app's auth secret). */
|
|
84
92
|
secret: string;
|
|
@@ -92,6 +100,7 @@ interface SsoStateConfig {
|
|
|
92
100
|
declare function createSignedSsoState(config: SsoStateConfig): Promise<string>;
|
|
93
101
|
/** Verify the MAC (constant-time) and the signed TTL. */
|
|
94
102
|
declare function verifySignedSsoState(state: string, config: SsoStateConfig): Promise<boolean>;
|
|
103
|
+
/** Describe the result of exchanging SSO credentials including API key, user info, and optional plan details */
|
|
95
104
|
interface TangleSsoExchangeResult {
|
|
96
105
|
apiKey: string;
|
|
97
106
|
user: {
|
|
@@ -201,6 +210,7 @@ interface BetterAuthSessionCookieSource {
|
|
|
201
210
|
};
|
|
202
211
|
}>;
|
|
203
212
|
}
|
|
213
|
+
/** Define options to customize warning behavior for shadowed cookie names in authentication sessions */
|
|
204
214
|
interface BetterAuthSessionCookieMinterOptions {
|
|
205
215
|
/** Receives the shadowed-cookie-name warning (see below). Default
|
|
206
216
|
* console.warn. */
|
|
@@ -227,6 +237,7 @@ interface BetterAuthSessionCookieMinterOptions {
|
|
|
227
237
|
* `Domain=`-wide session cookie is exactly the shadowing footgun.
|
|
228
238
|
*/
|
|
229
239
|
declare function createBetterAuthSessionCookieMinter(auth: BetterAuthSessionCookieSource, options?: BetterAuthSessionCookieMinterOptions): (args: TangleSsoSessionCookieArgs) => Promise<string[]>;
|
|
240
|
+
/** Define configuration options for handling Tangle SSO authentication and session management */
|
|
230
241
|
interface TangleSsoHandlerOptions {
|
|
231
242
|
auth: TangleSsoAuthClient;
|
|
232
243
|
store: TangleSsoAccountStore;
|
|
@@ -269,6 +280,7 @@ interface TangleSsoHandlerOptions {
|
|
|
269
280
|
log?: (message: string, error?: unknown) => void;
|
|
270
281
|
now?: () => number;
|
|
271
282
|
}
|
|
283
|
+
/** Define handlers for SSO start and callback routes managing authentication flow and session cookies */
|
|
272
284
|
interface TangleSsoHandlers {
|
|
273
285
|
/** GET start route: mint + sign state, set the state cookie, 302 to the
|
|
274
286
|
* platform authorize URL. `?redirect=` carries the post-login path. */
|
|
@@ -280,6 +292,7 @@ interface TangleSsoHandlers {
|
|
|
280
292
|
* 302s to `loginPath?error=…` with the state cookie cleared. */
|
|
281
293
|
callback(request: Request): Promise<Response>;
|
|
282
294
|
}
|
|
295
|
+
/** Create Tangle SSO handlers to manage authentication state, callbacks, and session cookies */
|
|
283
296
|
declare function createTangleSsoHandlers(opts: TangleSsoHandlerOptions): TangleSsoHandlers;
|
|
284
297
|
|
|
285
298
|
export { type AuthGuard as A, type BetterAuthSessionCookieMinterOptions as B, type GuardResolution as G, type SsoStateConfig as S, type TangleSsoHandlers as T, type TangleSsoAuthClient as a, type TangleSsoAccountStore as b, type AdminGuardOptions as c, type AssertBillableBalanceOptions as d, type AuthGuardOptions as e, type BetterAuthSessionCookieSource as f, type BillableBalanceState as g, type TangleSsoExchangeResult as h, type TangleSsoHandlerOptions as i, type TangleSsoSessionCookieArgs as j, TangleSsoUserCreateError as k, assertBillableBalance as l, createAdminGuard as m, createAuthGuard as n, createBetterAuthSessionCookieMinter as o, createSignedSsoState as p, createTangleSsoHandlers as q, guardResolution as r, parseAdminEmails as s, signSessionCookieValue as t, verifySignedSsoState as v };
|
|
@@ -95,6 +95,7 @@ declare const DEFAULT_STALE_TURN_LOCK_GRACE_MS: number;
|
|
|
95
95
|
* crashed turn; lowering it narrows the registration window it protects.
|
|
96
96
|
*/
|
|
97
97
|
declare const DEFAULT_TERMINAL_TURN_LOCK_GRACE_MS: number;
|
|
98
|
+
/** Resolve options for probing and releasing stale TURN locks based on lock start time and sandbox state */
|
|
98
99
|
interface ReconcileStaleTurnLockOptions {
|
|
99
100
|
/** When the held lock was acquired (epoch ms). The grace period is measured
|
|
100
101
|
* from here, so it must be the LOCK's start, not the turn's. */
|
|
@@ -132,6 +133,7 @@ interface ReconcileStaleTurnLockOptions {
|
|
|
132
133
|
/** Injectable clock, for tests. */
|
|
133
134
|
now?(): number;
|
|
134
135
|
}
|
|
136
|
+
/** Describe the outcome of reconciling a stale turn lock including release status and diagnostics */
|
|
135
137
|
interface ReconcileStaleTurnLockResult {
|
|
136
138
|
released: boolean;
|
|
137
139
|
/** Why the policy decided what it did — the probe's own diagnostics on the
|
package/dist/store/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ interface DatabaseProvider<DB> {
|
|
|
26
26
|
/** Clear the injected database (next access throws again). Mainly for tests. */
|
|
27
27
|
reset(): void;
|
|
28
28
|
}
|
|
29
|
+
/** Define options for configuring database provider behavior including error messaging */
|
|
29
30
|
interface DatabaseProviderOptions {
|
|
30
31
|
/** Error thrown when `db` is accessed before injection. Keep the product's
|
|
31
32
|
* existing wording so callers see a familiar message. */
|
|
@@ -37,6 +38,7 @@ interface DatabaseProviderOptions {
|
|
|
37
38
|
* typing and their existing query syntax.
|
|
38
39
|
*/
|
|
39
40
|
declare function createDatabaseProvider<DB extends object>(options?: DatabaseProviderOptions): DatabaseProvider<DB>;
|
|
41
|
+
/** Describe the result of listing keys with completion status and optional pagination cursor */
|
|
40
42
|
interface KVListResult {
|
|
41
43
|
keys: {
|
|
42
44
|
name: string;
|
|
@@ -44,15 +46,18 @@ interface KVListResult {
|
|
|
44
46
|
list_complete: boolean;
|
|
45
47
|
cursor?: string;
|
|
46
48
|
}
|
|
49
|
+
/** Define options for storing a key-value pair with expiration and metadata settings */
|
|
47
50
|
interface KVPutOptions {
|
|
48
51
|
expiration?: number;
|
|
49
52
|
expirationTtl?: number;
|
|
50
53
|
metadata?: unknown;
|
|
51
54
|
}
|
|
55
|
+
/** Resolve a key-value pair retrieval including its associated metadata and value */
|
|
52
56
|
interface KVGetWithMetadataResult {
|
|
53
57
|
value: string | null;
|
|
54
58
|
metadata: unknown | null;
|
|
55
59
|
}
|
|
60
|
+
/** Define a key-value store interface for asynchronous data retrieval, storage, deletion, and listing */
|
|
56
61
|
interface KVStore {
|
|
57
62
|
get(key: string): Promise<string | null>;
|
|
58
63
|
/** Read a value with its stored metadata (e.g. the vault's encrypted/hasPII flags). */
|
package/dist/store/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/store/index.ts"],"sourcesContent":["/**\n * Swappable database provider — the seam that decouples the agent's persistence\n * from any one driver.\n *\n * The agent core (and the app's server modules) import a single `db` and use it\n * directly. That `db` is a lazy proxy: it forwards to whatever database instance\n * the runtime injects via {@link DatabaseProvider.setDatabase}. So the SAME core\n * runs on:\n * - Cloudflare D1 (`setDatabase(drizzle(d1, schema))`) — prod\n * - SQLite / miniflare (`setDatabase(drizzle(betterSqlite, schema))`) — eval / the portable inner shell\n * - libsql / Turso, Postgres (`setDatabase(drizzle(client, schema))`) — a future hosted DB\n *\n * Adding a new database is one adapter (a drizzle instance over a new driver) +\n * a `setDatabase` call. None of the modules importing `db` change. Substrate-\n * free and driver-agnostic: this module knows nothing about D1, drizzle, or any\n * schema — it only forwards property access to the injected instance.\n */\n\nexport interface DatabaseProvider<DB> {\n /** The injected database, as a lazy proxy. Throws (with `notReadyMessage`)\n * on any access before {@link setDatabase} is called. */\n readonly db: DB\n /** Inject the active database instance (any driver's client). */\n setDatabase(database: DB): void\n /** True once a database has been injected. */\n isReady(): boolean\n /** Clear the injected database (next access throws again). Mainly for tests. */\n reset(): void\n}\n\nexport interface DatabaseProviderOptions {\n /** Error thrown when `db` is accessed before injection. Keep the product's\n * existing wording so callers see a familiar message. */\n notReadyMessage?: string\n}\n\n/**\n * Create a swappable database provider. `DB` is the injected instance's type\n * (e.g. a drizzle `Database`); the proxy is typed as `DB` so callers keep full\n * typing and their existing query syntax.\n */\nexport function createDatabaseProvider<DB extends object>(\n options: DatabaseProviderOptions = {},\n): DatabaseProvider<DB> {\n const message = options.notReadyMessage ?? 'Database not initialized — call setDatabase() first.'\n let current: DB | null = null\n\n const db = new Proxy({} as DB, {\n get(_target, prop) {\n if (!current) throw new Error(message)\n const value = (current as Record<string | symbol, unknown>)[prop]\n // Bind methods to the real instance so `this` resolves correctly through\n // the proxy (works for drizzle's query builders and class-based stores).\n return typeof value === 'function' ? (value as (...args: unknown[]) => unknown).bind(current) : value\n },\n has(_target, prop) {\n return current !== null && prop in (current as object)\n },\n })\n\n return {\n db,\n setDatabase(database: DB) {\n current = database\n },\n isReady() {\n return current !== null\n },\n reset() {\n current = null\n },\n }\n}\n\n// ── KV store port (the vault backend) ───────────────────────────────────────\n//\n// The vault (workspace files) is a key/value store. In production it's a\n// Cloudflare `KVNamespace`; the portable inner shell injects an in-memory (or\n// other) implementation. This is the subset of the KV API the vault uses —\n// `KVNamespace` satisfies it structurally, so prod passes the binding unchanged,\n// and `createInMemoryKV()` supplies the portable adapter for sandbox/eval.\n\nexport interface KVListResult {\n keys: { name: string }[]\n list_complete: boolean\n cursor?: string\n}\n\nexport interface KVPutOptions {\n expiration?: number\n expirationTtl?: number\n metadata?: unknown\n}\n\nexport interface KVGetWithMetadataResult {\n value: string | null\n metadata: unknown | null\n}\n\nexport interface KVStore {\n get(key: string): Promise<string | null>\n /** Read a value with its stored metadata (e.g. the vault's encrypted/hasPII flags). */\n getWithMetadata(key: string): Promise<KVGetWithMetadataResult>\n put(key: string, value: string, options?: KVPutOptions): Promise<void>\n delete(key: string): Promise<void>\n list(options?: { prefix?: string; cursor?: string; limit?: number }): Promise<KVListResult>\n}\n\n/**\n * In-memory {@link KVStore} — the portable vault backend for sandbox/eval runs.\n * Backed by a Map; `list` returns all prefix-matched keys in one complete page\n * (no real pagination needed in-process). Seed with `initial` entries if useful.\n */\nexport function createInMemoryKV(initial?: Record<string, string>): KVStore {\n const store = new Map<string, { value: string; metadata: unknown }>(\n initial ? Object.entries(initial).map(([k, v]) => [k, { value: v, metadata: null }]) : [],\n )\n return {\n async get(key) {\n return store.get(key)?.value ?? null\n },\n async getWithMetadata(key) {\n const entry = store.get(key)\n return { value: entry?.value ?? null, metadata: entry?.metadata ?? null }\n },\n async put(key, value, options) {\n store.set(key, { value, metadata: options?.metadata ?? null })\n },\n async delete(key) {\n store.delete(key)\n },\n async list(options) {\n const prefix = options?.prefix ?? ''\n const keys = [...store.keys()]\n .filter((k) => k.startsWith(prefix))\n .sort()\n .map((name) => ({ name }))\n return { keys, list_complete: true }\n },\n }\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/store/index.ts"],"sourcesContent":["/**\n * Swappable database provider — the seam that decouples the agent's persistence\n * from any one driver.\n *\n * The agent core (and the app's server modules) import a single `db` and use it\n * directly. That `db` is a lazy proxy: it forwards to whatever database instance\n * the runtime injects via {@link DatabaseProvider.setDatabase}. So the SAME core\n * runs on:\n * - Cloudflare D1 (`setDatabase(drizzle(d1, schema))`) — prod\n * - SQLite / miniflare (`setDatabase(drizzle(betterSqlite, schema))`) — eval / the portable inner shell\n * - libsql / Turso, Postgres (`setDatabase(drizzle(client, schema))`) — a future hosted DB\n *\n * Adding a new database is one adapter (a drizzle instance over a new driver) +\n * a `setDatabase` call. None of the modules importing `db` change. Substrate-\n * free and driver-agnostic: this module knows nothing about D1, drizzle, or any\n * schema — it only forwards property access to the injected instance.\n */\n\nexport interface DatabaseProvider<DB> {\n /** The injected database, as a lazy proxy. Throws (with `notReadyMessage`)\n * on any access before {@link setDatabase} is called. */\n readonly db: DB\n /** Inject the active database instance (any driver's client). */\n setDatabase(database: DB): void\n /** True once a database has been injected. */\n isReady(): boolean\n /** Clear the injected database (next access throws again). Mainly for tests. */\n reset(): void\n}\n\n/** Define options for configuring database provider behavior including error messaging */\nexport interface DatabaseProviderOptions {\n /** Error thrown when `db` is accessed before injection. Keep the product's\n * existing wording so callers see a familiar message. */\n notReadyMessage?: string\n}\n\n/**\n * Create a swappable database provider. `DB` is the injected instance's type\n * (e.g. a drizzle `Database`); the proxy is typed as `DB` so callers keep full\n * typing and their existing query syntax.\n */\nexport function createDatabaseProvider<DB extends object>(\n options: DatabaseProviderOptions = {},\n): DatabaseProvider<DB> {\n const message = options.notReadyMessage ?? 'Database not initialized — call setDatabase() first.'\n let current: DB | null = null\n\n const db = new Proxy({} as DB, {\n get(_target, prop) {\n if (!current) throw new Error(message)\n const value = (current as Record<string | symbol, unknown>)[prop]\n // Bind methods to the real instance so `this` resolves correctly through\n // the proxy (works for drizzle's query builders and class-based stores).\n return typeof value === 'function' ? (value as (...args: unknown[]) => unknown).bind(current) : value\n },\n has(_target, prop) {\n return current !== null && prop in (current as object)\n },\n })\n\n return {\n db,\n setDatabase(database: DB) {\n current = database\n },\n isReady() {\n return current !== null\n },\n reset() {\n current = null\n },\n }\n}\n\n// ── KV store port (the vault backend) ───────────────────────────────────────\n//\n// The vault (workspace files) is a key/value store. In production it's a\n// Cloudflare `KVNamespace`; the portable inner shell injects an in-memory (or\n// other) implementation. This is the subset of the KV API the vault uses —\n// `KVNamespace` satisfies it structurally, so prod passes the binding unchanged,\n// and `createInMemoryKV()` supplies the portable adapter for sandbox/eval.\n\n/** Describe the result of listing keys with completion status and optional pagination cursor */\nexport interface KVListResult {\n keys: { name: string }[]\n list_complete: boolean\n cursor?: string\n}\n\n/** Define options for storing a key-value pair with expiration and metadata settings */\nexport interface KVPutOptions {\n expiration?: number\n expirationTtl?: number\n metadata?: unknown\n}\n\n/** Resolve a key-value pair retrieval including its associated metadata and value */\nexport interface KVGetWithMetadataResult {\n value: string | null\n metadata: unknown | null\n}\n\n/** Define a key-value store interface for asynchronous data retrieval, storage, deletion, and listing */\nexport interface KVStore {\n get(key: string): Promise<string | null>\n /** Read a value with its stored metadata (e.g. the vault's encrypted/hasPII flags). */\n getWithMetadata(key: string): Promise<KVGetWithMetadataResult>\n put(key: string, value: string, options?: KVPutOptions): Promise<void>\n delete(key: string): Promise<void>\n list(options?: { prefix?: string; cursor?: string; limit?: number }): Promise<KVListResult>\n}\n\n/**\n * In-memory {@link KVStore} — the portable vault backend for sandbox/eval runs.\n * Backed by a Map; `list` returns all prefix-matched keys in one complete page\n * (no real pagination needed in-process). Seed with `initial` entries if useful.\n */\nexport function createInMemoryKV(initial?: Record<string, string>): KVStore {\n const store = new Map<string, { value: string; metadata: unknown }>(\n initial ? Object.entries(initial).map(([k, v]) => [k, { value: v, metadata: null }]) : [],\n )\n return {\n async get(key) {\n return store.get(key)?.value ?? null\n },\n async getWithMetadata(key) {\n const entry = store.get(key)\n return { value: entry?.value ?? null, metadata: entry?.metadata ?? null }\n },\n async put(key, value, options) {\n store.set(key, { value, metadata: options?.metadata ?? null })\n },\n async delete(key) {\n store.delete(key)\n },\n async list(options) {\n const prefix = options?.prefix ?? ''\n const keys = [...store.keys()]\n .filter((k) => k.startsWith(prefix))\n .sort()\n .map((name) => ({ name }))\n return { keys, list_complete: true }\n },\n }\n}\n"],"mappings":";AA0CO,SAAS,uBACd,UAAmC,CAAC,GACd;AACtB,QAAM,UAAU,QAAQ,mBAAmB;AAC3C,MAAI,UAAqB;AAEzB,QAAM,KAAK,IAAI,MAAM,CAAC,GAAS;AAAA,IAC7B,IAAI,SAAS,MAAM;AACjB,UAAI,CAAC,QAAS,OAAM,IAAI,MAAM,OAAO;AACrC,YAAM,QAAS,QAA6C,IAAI;AAGhE,aAAO,OAAO,UAAU,aAAc,MAA0C,KAAK,OAAO,IAAI;AAAA,IAClG;AAAA,IACA,IAAI,SAAS,MAAM;AACjB,aAAO,YAAY,QAAQ,QAAS;AAAA,IACtC;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA,YAAY,UAAc;AACxB,gBAAU;AAAA,IACZ;AAAA,IACA,UAAU;AACR,aAAO,YAAY;AAAA,IACrB;AAAA,IACA,QAAQ;AACN,gBAAU;AAAA,IACZ;AAAA,EACF;AACF;AA6CO,SAAS,iBAAiB,SAA2C;AAC1E,QAAM,QAAQ,IAAI;AAAA,IAChB,UAAU,OAAO,QAAQ,OAAO,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,KAAK,CAAC,CAAC,IAAI,CAAC;AAAA,EAC1F;AACA,SAAO;AAAA,IACL,MAAM,IAAI,KAAK;AACb,aAAO,MAAM,IAAI,GAAG,GAAG,SAAS;AAAA,IAClC;AAAA,IACA,MAAM,gBAAgB,KAAK;AACzB,YAAM,QAAQ,MAAM,IAAI,GAAG;AAC3B,aAAO,EAAE,OAAO,OAAO,SAAS,MAAM,UAAU,OAAO,YAAY,KAAK;AAAA,IAC1E;AAAA,IACA,MAAM,IAAI,KAAK,OAAO,SAAS;AAC7B,YAAM,IAAI,KAAK,EAAE,OAAO,UAAU,SAAS,YAAY,KAAK,CAAC;AAAA,IAC/D;AAAA,IACA,MAAM,OAAO,KAAK;AAChB,YAAM,OAAO,GAAG;AAAA,IAClB;AAAA,IACA,MAAM,KAAK,SAAS;AAClB,YAAM,SAAS,SAAS,UAAU;AAClC,YAAM,OAAO,CAAC,GAAG,MAAM,KAAK,CAAC,EAC1B,OAAO,CAAC,MAAM,EAAE,WAAW,MAAM,CAAC,EAClC,KAAK,EACL,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE;AAC3B,aAAO,EAAE,MAAM,eAAe,KAAK;AAAA,IACrC;AAAA,EACF;AACF;","names":[]}
|
|
@@ -15,10 +15,15 @@ declare const MIN_SEQUENCE_CLIP_FRAMES = 1;
|
|
|
15
15
|
/** Track kinds. `reference` holds non-rendered guide media; `agent` holds the
|
|
16
16
|
* agent-decision lane rendered as markers, never as media. */
|
|
17
17
|
type SequenceTrackKind = 'video' | 'audio' | 'caption' | 'reference' | 'agent';
|
|
18
|
+
/** Define sequence status as one of the specific lifecycle stages draft, active, exporting, or archived */
|
|
18
19
|
type SequenceStatus = 'draft' | 'active' | 'exporting' | 'archived';
|
|
20
|
+
/** Define export formats available for sequence data including video, subtitle, and metadata types */
|
|
19
21
|
type SequenceExportFormat = 'mp4' | 'otio' | 'xml' | 'edl' | 'vtt' | 'srt' | 'contact_sheet';
|
|
22
|
+
/** Represent export status of a sequence as queued, processing, completed, failed, or cancelled */
|
|
20
23
|
type SequenceExportStatus = 'queued' | 'processing' | 'completed' | 'failed' | 'cancelled';
|
|
24
|
+
/** Define media types allowed in a sequence including video, image, and audio */
|
|
21
25
|
type SequenceMediaKind = 'video' | 'image' | 'audio';
|
|
26
|
+
/** Describe metadata and properties of a media sequence including dimensions, duration, and status */
|
|
22
27
|
interface SequenceMeta {
|
|
23
28
|
id: string;
|
|
24
29
|
title: string;
|
|
@@ -30,6 +35,7 @@ interface SequenceMeta {
|
|
|
30
35
|
status: SequenceStatus;
|
|
31
36
|
metadata: Record<string, unknown>;
|
|
32
37
|
}
|
|
38
|
+
/** Define properties and state for a sequence track including id, kind, name, order, and flags */
|
|
33
39
|
interface SequenceTrack {
|
|
34
40
|
id: string;
|
|
35
41
|
kind: SequenceTrackKind;
|
|
@@ -50,6 +56,7 @@ interface SequenceClipMedia {
|
|
|
50
56
|
/** Provider job state for media still rendering upstream. */
|
|
51
57
|
providerStatus?: 'queued' | 'processing' | 'completed' | 'failed';
|
|
52
58
|
}
|
|
59
|
+
/** Define properties for a media sequence clip including timing, source, track, and caption details */
|
|
53
60
|
interface SequenceClip {
|
|
54
61
|
id: string;
|
|
55
62
|
trackId: string;
|
|
@@ -85,6 +92,7 @@ interface SequenceDecision {
|
|
|
85
92
|
metadata: Record<string, unknown>;
|
|
86
93
|
createdAt: Date;
|
|
87
94
|
}
|
|
95
|
+
/** Describe a record representing the export details and status of a sequence */
|
|
88
96
|
interface SequenceExportRecord {
|
|
89
97
|
id: string;
|
|
90
98
|
format: SequenceExportFormat;
|
|
@@ -117,29 +125,37 @@ interface SequenceFrameSnapshot {
|
|
|
117
125
|
clipId: string;
|
|
118
126
|
}>;
|
|
119
127
|
}
|
|
128
|
+
/** Convert seconds to the nearest whole number of frames based on frames per second */
|
|
120
129
|
declare function secondsToFrames(seconds: number, fps: number): number;
|
|
130
|
+
/** Convert a frame count to seconds based on the given frames per second rate */
|
|
121
131
|
declare function framesToSeconds(frames: number, fps: number): number;
|
|
132
|
+
/** Format a number of seconds into a string with integer or two-decimal precision suffix s */
|
|
122
133
|
declare function formatSeconds(seconds: number): string;
|
|
123
134
|
/** `m:ss.ff` timecode for UI and agent-readable frame references. */
|
|
124
135
|
declare function formatTimecode(frames: number, fps: number): string;
|
|
136
|
+
/** Define the start frame and duration in frames for a timeline clip's bounds */
|
|
125
137
|
interface TimelineClipBounds {
|
|
126
138
|
startFrame: number;
|
|
127
139
|
durationFrames: number;
|
|
128
140
|
}
|
|
141
|
+
/** Define a time range with inclusive start and end frame numbers */
|
|
129
142
|
interface TimelineInterval {
|
|
130
143
|
startFrame: number;
|
|
131
144
|
endFrame: number;
|
|
132
145
|
}
|
|
146
|
+
/** Clamp the clip start frame within the valid range of the sequence duration and clip length */
|
|
133
147
|
declare function clampClipStart(input: {
|
|
134
148
|
startFrame: number;
|
|
135
149
|
durationFrames: number;
|
|
136
150
|
sequenceDurationFrames: number;
|
|
137
151
|
}): number;
|
|
152
|
+
/** Clamp clip duration to fit within sequence bounds and minimum length constraints */
|
|
138
153
|
declare function clampClipDuration(input: {
|
|
139
154
|
startFrame: number;
|
|
140
155
|
durationFrames: number;
|
|
141
156
|
sequenceDurationFrames: number;
|
|
142
157
|
}): number;
|
|
158
|
+
/** Validate that a clip's start and duration fit within the sequence duration without overflow */
|
|
143
159
|
declare function assertClipFitsSequence(input: {
|
|
144
160
|
startFrame: number;
|
|
145
161
|
durationFrames: number;
|
|
@@ -177,11 +193,13 @@ declare function trackIntervals(timeline: SequenceTimeline, trackId: string): Ti
|
|
|
177
193
|
* driven by the UI can batch their own decision entries.
|
|
178
194
|
*/
|
|
179
195
|
|
|
196
|
+
/** Define properties for a new sequence track including kind, name, and optional sort order */
|
|
180
197
|
interface NewSequenceTrack {
|
|
181
198
|
kind: SequenceTrackKind;
|
|
182
199
|
name: string;
|
|
183
200
|
sortOrder?: number;
|
|
184
201
|
}
|
|
202
|
+
/** Define properties for a new sequence clip including timing, labels, and optional metadata */
|
|
185
203
|
interface NewSequenceClip {
|
|
186
204
|
trackId: string;
|
|
187
205
|
label: string;
|
|
@@ -195,6 +213,7 @@ interface NewSequenceClip {
|
|
|
195
213
|
assetId?: string;
|
|
196
214
|
metadata?: Record<string, unknown>;
|
|
197
215
|
}
|
|
216
|
+
/** Define optional properties to update or patch a sequence clip's attributes in a timeline */
|
|
198
217
|
interface SequenceClipPatch {
|
|
199
218
|
trackId?: string;
|
|
200
219
|
label?: string;
|
|
@@ -207,6 +226,7 @@ interface SequenceClipPatch {
|
|
|
207
226
|
language?: string;
|
|
208
227
|
metadata?: Record<string, unknown>;
|
|
209
228
|
}
|
|
229
|
+
/** Define the structure for a new sequence decision with optional metadata and acceptance status */
|
|
210
230
|
interface NewSequenceDecision {
|
|
211
231
|
clipId?: string | null;
|
|
212
232
|
kind: SequenceDecision['kind'];
|
|
@@ -215,6 +235,7 @@ interface NewSequenceDecision {
|
|
|
215
235
|
accepted?: boolean | null;
|
|
216
236
|
metadata?: Record<string, unknown>;
|
|
217
237
|
}
|
|
238
|
+
/** Manage sequences by providing methods to get timelines, clips, and modify tracks and clips */
|
|
218
239
|
interface SequenceStore {
|
|
219
240
|
/** Full aggregate: sequence meta + tracks + clips with resolved media. */
|
|
220
241
|
getTimeline(): Promise<SequenceTimeline>;
|
|
@@ -239,4 +260,4 @@ interface SequenceStoreScope {
|
|
|
239
260
|
userId: string;
|
|
240
261
|
}
|
|
241
262
|
|
|
242
|
-
export { snapshotFrame as A, trackIntervals as B, MIN_SEQUENCE_CLIP_FRAMES as M, type NewSequenceClip as N, type
|
|
263
|
+
export { snapshotFrame as A, trackIntervals as B, MIN_SEQUENCE_CLIP_FRAMES as M, type NewSequenceClip as N, type SequenceStoreScope as S, type TimelineClipBounds as T, type SequenceClipMedia as a, type SequenceStore as b, type SequenceTrackKind as c, type SequenceExportFormat as d, type SequenceTrack as e, type SequenceTimeline as f, type SequenceClip as g, type SequenceExportRecord as h, type SequenceMeta as i, type SequenceMediaKind as j, type TimelineInterval as k, type NewSequenceDecision as l, type NewSequenceTrack as m, type SequenceClipPatch as n, type SequenceDecision as o, type SequenceExportStatus as p, type SequenceFrameSnapshot as q, type SequenceStatus as r, assertClipFitsSequence as s, chooseCaptionPlacement as t, clampClipDuration as u, clampClipStart as v, formatSeconds as w, formatTimecode as x, framesToSeconds as y, secondsToFrames as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as SceneDocument } from './model-
|
|
1
|
+
import { c as SceneDocument } from './model-DnfO_PdJ.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Storage contract for design-canvas documents. Unlike sequences (row per
|
|
@@ -14,11 +14,13 @@ import { c as SceneDocument } from './model-BBwyOuWG.js';
|
|
|
14
14
|
* structured tool errors.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
/** Represent a scene document with its current revision number for version tracking */
|
|
17
18
|
interface SceneDocumentRecord {
|
|
18
19
|
document: SceneDocument;
|
|
19
20
|
/** Monotonic revision; increments on every successful save. */
|
|
20
21
|
rev: number;
|
|
21
22
|
}
|
|
23
|
+
/** Define the structure for decisions made within a scene including type, instructions, and metadata */
|
|
22
24
|
interface SceneDecision {
|
|
23
25
|
id: string;
|
|
24
26
|
kind: 'human_edit' | 'agent_edit' | 'agent_proposal' | 'export' | 'note';
|
|
@@ -27,13 +29,16 @@ interface SceneDecision {
|
|
|
27
29
|
metadata: Record<string, unknown>;
|
|
28
30
|
createdAt: Date;
|
|
29
31
|
}
|
|
32
|
+
/** Define the structure for decisions related to creating a new scene with instructions and optional details */
|
|
30
33
|
interface NewSceneDecision {
|
|
31
34
|
kind: SceneDecision['kind'];
|
|
32
35
|
instruction: string;
|
|
33
36
|
reasoningSummary?: string | null;
|
|
34
37
|
metadata?: Record<string, unknown>;
|
|
35
38
|
}
|
|
39
|
+
/** Define supported formats for exporting a scene including image and JSON options */
|
|
36
40
|
type SceneExportFormat = 'png' | 'jpeg' | 'json';
|
|
41
|
+
/** Describe a scene export with its status, format, metadata, and result information */
|
|
37
42
|
interface SceneExportRecord {
|
|
38
43
|
id: string;
|
|
39
44
|
format: SceneExportFormat;
|
|
@@ -42,6 +47,7 @@ interface SceneExportRecord {
|
|
|
42
47
|
metadata: Record<string, unknown>;
|
|
43
48
|
createdAt: Date;
|
|
44
49
|
}
|
|
50
|
+
/** Manage scene documents, decisions, and exports with atomic save and revision control */
|
|
45
51
|
interface SceneStore {
|
|
46
52
|
/** Current document + revision. */
|
|
47
53
|
getDocument(): Promise<SceneDocumentRecord>;
|
|
@@ -61,4 +67,4 @@ interface SceneStoreScope {
|
|
|
61
67
|
userId: string;
|
|
62
68
|
}
|
|
63
69
|
|
|
64
|
-
export type { NewSceneDecision as N,
|
|
70
|
+
export type { NewSceneDecision as N, SceneStoreScope as S, SceneStore as a, SceneDocumentRecord as b, SceneDecision as c, SceneExportFormat as d, SceneExportRecord as e };
|
package/dist/stream/index.d.ts
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
import { J as JsonRecord } from '../stream-normalizer-
|
|
2
|
-
export { M as MISSING_TOOL_TERMINAL_ERROR, a as MISSING_TOOL_TERMINAL_REASON, S as StreamEvent, b as asRecord, c as asString, d as attachmentPartKey, e as collapseRedundantTextParts, f as encodeEvent, g as finalizeAssistantParts, h as finalizePendingInteractionParts, i as getPartKey, m as mergePersistedPart, n as normalizePersistedPart, j as normalizeTime, k as normalizeToolEvent, r as resolveToolId, l as resolveToolName, t as terminalizeDanglingAssistantToolUpdates, o as terminalizeDanglingToolPart, p as terminalizeDanglingToolParts } from '../stream-normalizer-
|
|
3
|
-
export { B as BufferedTurnEvent, a as BufferedTurnOptions, b as BufferedTurnTap, D as D1LikeForTurns, P as PumpBufferedTurnOptions, R as ReplayTurnEventsOptions, T as TURN_EVENTS_MIGRATION_SQL, c as TURN_STATUS_SCOPE_MIGRATION_SQL, d as TurnEventStore, e as TurnStatus, f as coalesceChatStreamEvents, g as coalesceDeltas, h as createBufferedTurnTap, i as createD1TurnEventStore, j as createMemoryTurnEventStore, p as pumpBufferedTurn, r as replayTurnEvents } from '../turn-buffer-
|
|
4
|
-
import '../contract-
|
|
1
|
+
import { J as JsonRecord } from '../stream-normalizer-C3M--r6y.js';
|
|
2
|
+
export { M as MISSING_TOOL_TERMINAL_ERROR, a as MISSING_TOOL_TERMINAL_REASON, S as StreamEvent, b as asRecord, c as asString, d as attachmentPartKey, e as collapseRedundantTextParts, f as encodeEvent, g as finalizeAssistantParts, h as finalizePendingInteractionParts, i as getPartKey, m as mergePersistedPart, n as normalizePersistedPart, j as normalizeTime, k as normalizeToolEvent, r as resolveToolId, l as resolveToolName, t as terminalizeDanglingAssistantToolUpdates, o as terminalizeDanglingToolPart, p as terminalizeDanglingToolParts } from '../stream-normalizer-C3M--r6y.js';
|
|
3
|
+
export { B as BufferedTurnEvent, a as BufferedTurnOptions, b as BufferedTurnTap, D as D1LikeForTurns, P as PumpBufferedTurnOptions, R as ReplayTurnEventsOptions, T as TURN_EVENTS_MIGRATION_SQL, c as TURN_STATUS_SCOPE_MIGRATION_SQL, d as TurnEventStore, e as TurnStatus, f as coalesceChatStreamEvents, g as coalesceDeltas, h as createBufferedTurnTap, i as createD1TurnEventStore, j as createMemoryTurnEventStore, p as pumpBufferedTurn, r as replayTurnEvents } from '../turn-buffer-DGnAPKwa.js';
|
|
4
|
+
import '../contract-TjB68uqA.js';
|
|
5
5
|
import '@tangle-network/agent-interface';
|
|
6
6
|
|
|
7
|
+
/** Define the structure of a chat message stored for a specific conversation turn */
|
|
7
8
|
interface PersistedChatMessageForTurn {
|
|
8
9
|
id: string;
|
|
9
10
|
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
10
11
|
content: string;
|
|
11
12
|
parts: Array<Record<string, unknown>> | null;
|
|
12
13
|
}
|
|
14
|
+
/** Represent a chat turn with resolved user message insertion and prior message context */
|
|
13
15
|
interface ResolvedChatTurn {
|
|
14
16
|
turnIndex: number;
|
|
15
17
|
shouldInsertUserMessage: boolean;
|
|
16
18
|
priorMessages: PersistedChatMessageForTurn[];
|
|
17
19
|
userParts: JsonRecord[];
|
|
18
20
|
}
|
|
21
|
+
/** Normalize and validate a client turn ID string ensuring it meets format and length requirements */
|
|
19
22
|
declare function normalizeClientTurnId(value: unknown): string | undefined;
|
|
23
|
+
/** Build an array of text parts with optional turn ID for user input */
|
|
20
24
|
declare function buildUserTextParts(text: string, turnId: string | undefined): JsonRecord[];
|
|
25
|
+
/** Resolve whether a message contains any part with the specified turn ID */
|
|
21
26
|
declare function messageHasTurnId(message: PersistedChatMessageForTurn, turnId: string): boolean;
|
|
27
|
+
/** Resolve a chat turn by determining message reuse and constructing user message parts */
|
|
22
28
|
declare function resolveChatTurn(input: {
|
|
23
29
|
existingMessages: PersistedChatMessageForTurn[];
|
|
24
30
|
userContent: string;
|
package/dist/stream/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
pumpBufferedTurn,
|
|
13
13
|
replayTurnEvents,
|
|
14
14
|
resolveChatTurn
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-VCOD5AOR.js";
|
|
16
16
|
import {
|
|
17
17
|
MISSING_TOOL_TERMINAL_ERROR,
|
|
18
18
|
MISSING_TOOL_TERMINAL_REASON,
|
|
@@ -33,9 +33,9 @@ import {
|
|
|
33
33
|
terminalizeDanglingAssistantToolUpdates,
|
|
34
34
|
terminalizeDanglingToolPart,
|
|
35
35
|
terminalizeDanglingToolParts
|
|
36
|
-
} from "../chunk-
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-
|
|
36
|
+
} from "../chunk-IG46XCZM.js";
|
|
37
|
+
import "../chunk-YKOM4ZLQ.js";
|
|
38
|
+
import "../chunk-YJMCRXQQ.js";
|
|
39
39
|
export {
|
|
40
40
|
MISSING_TOOL_TERMINAL_ERROR,
|
|
41
41
|
MISSING_TOOL_TERMINAL_REASON,
|
|
@@ -1,30 +1,44 @@
|
|
|
1
|
-
import { b as ChatInteractionStatus } from './contract-
|
|
1
|
+
import { b as ChatInteractionStatus } from './contract-TjB68uqA.js';
|
|
2
2
|
|
|
3
|
+
/** Represent a JSON-compatible object with string keys and values of any type */
|
|
3
4
|
type JsonRecord = Record<string, unknown>;
|
|
5
|
+
/** Define an event object carrying a type and optional JSON data payload */
|
|
4
6
|
interface StreamEvent {
|
|
5
7
|
type: string;
|
|
6
8
|
data?: JsonRecord;
|
|
7
9
|
}
|
|
10
|
+
/** Resolve an unknown value to a JsonRecord if it is a non-array object or return undefined */
|
|
8
11
|
declare function asRecord(value: unknown): JsonRecord | undefined;
|
|
12
|
+
/** Resolve a non-empty string from a value or return undefined */
|
|
9
13
|
declare function asString(value: unknown): string | undefined;
|
|
14
|
+
/** Resolve a unique tool identifier from various possible properties or generate a fallback ID */
|
|
10
15
|
declare function resolveToolId(part: JsonRecord): string;
|
|
16
|
+
/** Resolve the tool name from a JSON record using tool, name, or a default value */
|
|
11
17
|
declare function resolveToolName(part: JsonRecord): string;
|
|
18
|
+
/** Resolve time properties from various keys into a normalized record with numeric start and end fields */
|
|
12
19
|
declare function normalizeTime(value: unknown): JsonRecord | undefined;
|
|
20
|
+
/** Normalize tool-related events into a standardized message.part.updated format */
|
|
13
21
|
declare function normalizeToolEvent(event: StreamEvent): StreamEvent;
|
|
22
|
+
/** Normalize a persisted part object by standardizing its structure and fields */
|
|
14
23
|
declare function normalizePersistedPart(rawPart: JsonRecord): JsonRecord | null;
|
|
15
24
|
/** Stream/transcript part key for a promoted (path-bearing) attachment,
|
|
16
25
|
* keyed on its storage path — re-emitting the same path folds into the same
|
|
17
26
|
* segment instead of duplicating it. */
|
|
18
27
|
declare function attachmentPartKey(path: string): string;
|
|
28
|
+
/** Resolve a unique key string for a part based on its type and identifying properties */
|
|
19
29
|
declare function getPartKey(part: JsonRecord): string;
|
|
30
|
+
/** Merge incoming JSON with existing persisted data, applying delta for text types when provided */
|
|
20
31
|
declare function mergePersistedPart(existing: JsonRecord | undefined, incoming: JsonRecord, delta?: string): JsonRecord;
|
|
32
|
+
/** Resolve errors when a tool fails to report a terminal result before the assistant turn ends */
|
|
21
33
|
declare const MISSING_TOOL_TERMINAL_ERROR = "Tool did not report a terminal result before the assistant turn completed.";
|
|
34
|
+
/** Provide the reason identifier for a missing tool in the terminal environment */
|
|
22
35
|
declare const MISSING_TOOL_TERMINAL_REASON = "missing-tool-terminal";
|
|
23
36
|
/** Closes a tool part left `running` when a stream ended abnormally: settles
|
|
24
37
|
* it as a terminal `error` and stamps `state.metadata.terminalized` so the
|
|
25
38
|
* synthetic settlement is distinguishable from a real tool failure. Parts
|
|
26
39
|
* that already settled (and non-tool parts) pass through untouched. */
|
|
27
40
|
declare function terminalizeDanglingToolPart(part: JsonRecord): JsonRecord;
|
|
41
|
+
/** Resolve dangling tool parts into terminal forms within the given JSON records array */
|
|
28
42
|
declare function terminalizeDanglingToolParts(parts: JsonRecord[]): JsonRecord[];
|
|
29
43
|
/** Settles still-pending interaction parts at persist time. The broker
|
|
30
44
|
* guarantees a resolved question either answered (run unblocked, no cancel
|
|
@@ -38,11 +52,13 @@ declare function finalizePendingInteractionParts(parts: JsonRecord[], outcome: E
|
|
|
38
52
|
* segments survive as blank parts. Consecutive identical text parts merge
|
|
39
53
|
* into one; empty text parts drop when any non-empty text part exists. */
|
|
40
54
|
declare function collapseRedundantTextParts(parts: JsonRecord[]): JsonRecord[];
|
|
55
|
+
/** Resolve and clean up assistant parts by terminalizing and collapsing redundant segments */
|
|
41
56
|
declare function finalizeAssistantParts(partOrder: string[], partMap: Map<string, JsonRecord>, finalText: string): JsonRecord[];
|
|
42
57
|
/** Finalizes, then folds each synthetic tool settlement back into `partMap`
|
|
43
58
|
* and returns just those updates — the shape a streaming loop needs to emit
|
|
44
59
|
* closing `message.part.updated` frames for tools the stream never settled. */
|
|
45
60
|
declare function terminalizeDanglingAssistantToolUpdates(partOrder: string[], partMap: Map<string, JsonRecord>, finalText: string): JsonRecord[];
|
|
61
|
+
/** Encode a StreamEvent object into a Uint8Array using the provided TextEncoder */
|
|
46
62
|
declare function encodeEvent(encoder: TextEncoder, event: StreamEvent): Uint8Array;
|
|
47
63
|
|
|
48
64
|
export { type JsonRecord as J, MISSING_TOOL_TERMINAL_ERROR as M, type StreamEvent as S, MISSING_TOOL_TERMINAL_REASON as a, asRecord as b, asString as c, attachmentPartKey as d, collapseRedundantTextParts as e, encodeEvent as f, finalizeAssistantParts as g, finalizePendingInteractionParts as h, getPartKey as i, normalizeTime as j, normalizeToolEvent as k, resolveToolName as l, mergePersistedPart as m, normalizePersistedPart as n, terminalizeDanglingToolPart as o, terminalizeDanglingToolParts as p, resolveToolId as r, terminalizeDanglingAssistantToolUpdates as t };
|