very-happy-cli 0.2.182 → 0.2.184
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/{AcpBackend-DLk3gMYH.mjs → AcpBackend-Csg7Sy2P.mjs} +3 -3
- package/dist/{AcpBackend-JA5eu8Y0.cjs → AcpBackend-DOzn74zn.cjs} +3 -3
- package/dist/{AcpSessionManager-OrCww-Qv.mjs → AcpSessionManager-BRK2F2yN.mjs} +10 -3
- package/dist/{AcpSessionManager-DjYidq4C.cjs → AcpSessionManager-CJXDNNtq.cjs} +10 -3
- package/dist/{BasePermissionHandler-u-neo-iN.mjs → BasePermissionHandler-BqYwrCra.mjs} +1 -1
- package/dist/{BasePermissionHandler-D3PMKLBS.cjs → BasePermissionHandler-CfrnkG3v.cjs} +1 -1
- package/dist/{acpSessionResume-Dxo8222T.cjs → acpSessionResume-DZ65DBeE.cjs} +1 -1
- package/dist/{acpSessionResume-u2TwX5Jd.mjs → acpSessionResume-Dz1myMbR.mjs} +1 -1
- package/dist/{agentHome-D3hNrnoA.mjs → agentHome-B_tu3tFJ.mjs} +4 -4
- package/dist/{agentHome-CP1tCBXz.cjs → agentHome-CKAXhc8P.cjs} +4 -4
- package/dist/{api-C_YSQnsi.mjs → api-BpTDU2BO.mjs} +79 -12
- package/dist/{api-CZWcG7uh.cjs → api-rw5xkzxo.cjs} +81 -11
- package/dist/{apiMachine-DPGrED5C.cjs → apiMachine-Bs1XXHKs.cjs} +14 -14
- package/dist/{apiMachine-C_GA5Bm-.mjs → apiMachine-wp0hWG3F.mjs} +14 -14
- package/dist/{attachmentContent-Ckzyb1Uy.mjs → attachmentContent-CWSSGMMo.mjs} +2 -2
- package/dist/{attachmentContent-I_dJIevE.cjs → attachmentContent-K_Up4InS.cjs} +2 -2
- package/dist/{auth-BKnE7uv7.cjs → auth-C4_mXYgj.cjs} +8 -8
- package/dist/{auth-DOXMI-xp.mjs → auth-CBESCCCn.mjs} +8 -8
- package/dist/{auth-CGgpiJ5-.mjs → auth-D6kSt2sR.mjs} +5 -5
- package/dist/{auth-Lw_utSMV.cjs → auth-gGryJImw.cjs} +5 -5
- package/dist/{auto-Z56mMZnH.mjs → auto-CEucVmFR.mjs} +32 -26
- package/dist/{auto-CIgFHIyQ.cjs → auto-Do43AOza.cjs} +32 -25
- package/dist/{bootstrap-DsXp74wv.cjs → bootstrap-BPz1iX77.cjs} +2 -2
- package/dist/{bootstrap-D3vlOROj.mjs → bootstrap-CodyCmGt.mjs} +2 -2
- package/dist/{browser-CUxGoATV.mjs → browser-CqMhj8Gm.mjs} +1 -1
- package/dist/{browser-CZlA9AkO.cjs → browser-D9D-1eqa.cjs} +1 -1
- package/dist/{claudeLocal-FnTUgwCi.mjs → claudeLocal-BgIRtT3Q.mjs} +5 -5
- package/dist/{claudeLocal-oELvwiZL.cjs → claudeLocal-Dywp8NKr.cjs} +5 -5
- package/dist/{claudeLocalLauncher-CO5YHCzi.mjs → claudeLocalLauncher-CaHjZ8HW.mjs} +10 -10
- package/dist/{claudeLocalLauncher-QsVXEVdE.cjs → claudeLocalLauncher-_TOL73g5.cjs} +10 -10
- package/dist/{claudeSessionFork-Cspr6QW0.mjs → claudeSessionFork-C9nB7fs5.mjs} +1 -1
- package/dist/{claudeSessionFork-BA4GE5AL.cjs → claudeSessionFork-jq-_WiAu.cjs} +1 -1
- package/dist/{client-CDuW4MS9.cjs → client-BFDji81N.cjs} +15 -7
- package/dist/{client-Ctbw05Xj.mjs → client-BdbVizjk.mjs} +15 -7
- package/dist/{client-xnWiHqdb.cjs → client-ByZFACEw.cjs} +18 -5
- package/dist/{client-DK8CzUry.cjs → client-C49zFRkX.cjs} +2 -2
- package/dist/{client-o-meK7-a.mjs → client-CX-_2myt.mjs} +2 -2
- package/dist/{client-BGfmSbWc.mjs → client-DwlYk8uJ.mjs} +18 -5
- package/dist/codex/happyMcpStdioBridge.cjs +16 -16
- package/dist/codex/happyMcpStdioBridge.mjs +16 -16
- package/dist/{codexAppServerClient-BlsOZLul.mjs → codexAppServerClient-CmOIqiNQ.mjs} +3 -3
- package/dist/{codexAppServerClient-DhNDTU_i.cjs → codexAppServerClient-DF12ZSw1.cjs} +3 -3
- package/dist/{codexCommand-BGx5NMQR.mjs → codexCommand-BN05uEyv.mjs} +94 -60
- package/dist/{codexCommand-DJDPfpIs.cjs → codexCommand-H-ObWTtx.cjs} +94 -60
- package/dist/{codexTermination-CVhhwHZU.mjs → codexTermination-Byohgj8h.mjs} +1 -1
- package/dist/{codexTermination-CqPMuokw.cjs → codexTermination-RwKa8pKk.cjs} +1 -1
- package/dist/{config-CWAe08-Q.mjs → config-ChHLh-hf.mjs} +3 -3
- package/dist/{config-CHpxzXBL.cjs → config-D_wNqwxX.cjs} +3 -3
- package/dist/{configuration-B-CugKJ3.cjs → configuration-C9Sx-Foo.cjs} +1 -1
- package/dist/{configuration-YXw_Dcsb.mjs → configuration-CVgUe2qN.mjs} +1 -1
- package/dist/{connect-BmHvMXH2.cjs → connect-B61xJDRq.cjs} +13 -13
- package/dist/{connect-CPeJXHha.mjs → connect-DJEQjS7C.mjs} +13 -13
- package/dist/{context-BtIVqHI5.cjs → context-Bf3BG7w8.cjs} +1 -1
- package/dist/{context-Drzs_Z38.mjs → context-CDPfhHTo.mjs} +1 -1
- package/dist/{controlClient-D0kGwKYx.cjs → controlClient-BLO1_pPx.cjs} +14 -3
- package/dist/{controlClient-BL4hb4l3.mjs → controlClient-DMCxtwq2.mjs} +14 -4
- package/dist/{createSessionMetadata-L499emJn.cjs → createSessionMetadata-5Mde6Dfh.cjs} +2 -2
- package/dist/{createSessionMetadata-DvGDsnsn.mjs → createSessionMetadata-BYroCdrU.mjs} +2 -2
- package/dist/daemonSupervisor-57JYYzMf.cjs +268 -0
- package/dist/daemonSupervisor-DfzrtNhM.mjs +245 -0
- package/dist/{defaultPermissionMode-MXpZlXud.cjs → defaultPermissionMode-B7mjHQKp.cjs} +2 -2
- package/dist/{defaultPermissionMode-BLfxu-Yz.mjs → defaultPermissionMode-CTdxUV_3.mjs} +2 -2
- package/dist/{deterministicJson-CfLkBRvU.cjs → deterministicJson-C1Z9MlDX.cjs} +569 -17
- package/dist/{deterministicJson-B_UAbmQ4.mjs → deterministicJson-C3QXOc1N.mjs} +572 -21
- package/dist/{doctor-DMvlzmnE.cjs → doctor-DRdV3thy.cjs} +7 -7
- package/dist/{doctor-bKScPtZu.mjs → doctor-OwNmTpYh.mjs} +7 -7
- package/dist/{downloadTarget-J9j37eFG.mjs → downloadTarget-CNtQ8rhV.mjs} +6 -6
- package/dist/{downloadTarget-D33BFvew.cjs → downloadTarget-Di5bf7r0.cjs} +6 -6
- package/dist/{ensureDaemonRunning-2IqWROJp.cjs → ensureDaemonRunning-CMY--T9Q.cjs} +5 -5
- package/dist/{ensureDaemonRunning-DLvwhpNg.mjs → ensureDaemonRunning-IRV-w0wH.mjs} +5 -5
- package/dist/{handleResumeCommand-CjtjQ_I7.mjs → handleResumeCommand-BO00SYjG.mjs} +5 -5
- package/dist/{handleResumeCommand-Dp2Y-p6V.cjs → handleResumeCommand-z7wY7QVM.cjs} +5 -5
- package/dist/{index-DYVIbhAJ.cjs → index-B4cyX2by.cjs} +40 -40
- package/dist/{index-B_aNaW9w.cjs → index-BsoUsrKS.cjs} +4 -4
- package/dist/{index-Cllzqoes.mjs → index-C7zgeuLP.mjs} +4 -4
- package/dist/{index-D_LvOWUN.mjs → index-CVUiytNq.mjs} +3 -3
- package/dist/{index-BOT0Tg5E.mjs → index-DZvi6_tB.mjs} +4 -4
- package/dist/{index-BI0h2Zks.mjs → index-DisBaRvM.mjs} +277 -77
- package/dist/{index-CZC7egJA.cjs → index-NhmqjrGv.cjs} +3 -3
- package/dist/{index-oh8XEozJ.cjs → index-Ub-5xbcU.cjs} +286 -76
- package/dist/{index-kA46KMxN.mjs → index-_LfuIz-O.mjs} +41 -41
- package/dist/{index-DymOv3kK.cjs → index-wYJu2yGc.cjs} +4 -4
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-D2NCbeJ-.cjs → install-BATFlr_l.cjs} +2 -2
- package/dist/{install-BAa_Xmof.cjs → install-CGYDeYes.cjs} +3 -3
- package/dist/{install-C46mkr9a.mjs → install-DeUM6h8X.mjs} +3 -3
- package/dist/{install-D0inLCv-.mjs → install-F3rP8tBU.mjs} +2 -2
- package/dist/lib.cjs +12 -12
- package/dist/lib.d.cts +1 -1
- package/dist/lib.d.mts +1 -1
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-DcPvwniz.cjs → lidState-C4YgPn6y.cjs} +1 -1
- package/dist/{lidState-D8Iuvjgl.mjs → lidState-CBjQEwTt.mjs} +1 -1
- package/dist/{localHappyAgentAuth-SD6GM97y.cjs → localHappyAgentAuth-BzCuIkzi.cjs} +1 -1
- package/dist/{localHappyAgentAuth-D3rQDRd9.mjs → localHappyAgentAuth-CcWGU_lS.mjs} +1 -1
- package/dist/{logger-DK1ytCz6.cjs → logger-CrtT0opS.cjs} +2 -2
- package/dist/{logger-DpqihN1f.mjs → logger-D2qd0mMg.mjs} +2 -2
- package/dist/{machineMetadata-D4E3qoIG.mjs → machineMetadata-B2czDiTd.mjs} +3 -3
- package/dist/{machineMetadata-IJc6_iyx.cjs → machineMetadata-D1hlm_oF.cjs} +3 -3
- package/dist/{main-CpUmw7hm.mjs → main-BNYWELul.mjs} +69 -56
- package/dist/{main-DUXh2rgW.cjs → main-BWgWN5d1.cjs} +69 -56
- package/dist/{mcp-D5f3Vd-z.cjs → mcp-C18unjs1.cjs} +15 -15
- package/dist/{mcp-66g1TJ8P.mjs → mcp-ColtiH23.mjs} +15 -15
- package/dist/{mirrorProtocol-DkWOcZh9.cjs → mirrorProtocol-D4CR5I5W.cjs} +3 -3
- package/dist/{mirrorProtocol-bsCUcaCY.mjs → mirrorProtocol-DTHWtAE5.mjs} +3 -3
- package/dist/{package-BfeqAzyJ.cjs → package-DczR1k0c.cjs} +7 -7
- package/dist/{package-CKj8zndE.mjs → package-Ek5FOyEo.mjs} +7 -7
- package/dist/{panels-r8LmaBs6.mjs → panels-BIQ7FrCB.mjs} +5 -5
- package/dist/{panels-2PXsw9-d.cjs → panels-DYSMHhdb.cjs} +5 -5
- package/dist/{peerTools-D_id4d41.mjs → peerTools-CABQ6iKd.mjs} +5 -5
- package/dist/{peerTools-BVp1z0T_.cjs → peerTools-Cufh4Qp_.cjs} +5 -5
- package/dist/{persistence-jOEuAFTS.mjs → persistence-DFtgQvr6.mjs} +2 -2
- package/dist/{persistence-BdpwWXKh.cjs → persistence-IYH6bAXY.cjs} +2 -2
- package/dist/{piRunnerArgs-68I5F_M1.mjs → piRunnerArgs-CIWprC1S.mjs} +1 -1
- package/dist/{piRunnerArgs-vxCHKnSA.cjs → piRunnerArgs-Dgjmj8KL.cjs} +1 -1
- package/dist/{piRuntime-C3Dg5uni.cjs → piRuntime-C_nX977w.cjs} +2 -2
- package/dist/{piRuntime-DgLIard1.mjs → piRuntime-K6o4GPZ9.mjs} +2 -2
- package/dist/{piTerminal-DJL0w-uA.mjs → piTerminal-CRl0EZc3.mjs} +18 -18
- package/dist/{piTerminal-C135BcLP.cjs → piTerminal-CYhcmkyi.cjs} +18 -18
- package/dist/providerBinding-B-Qbx9W2.cjs +140 -0
- package/dist/providerBinding-CYubGg-Z.mjs +132 -0
- package/dist/{pushNotifications-CyQVDThC.cjs → pushNotifications-BgQ_QTgS.cjs} +3 -3
- package/dist/{pushNotifications-CMmRsbKv.mjs → pushNotifications-gVJWGFBP.mjs} +3 -3
- package/dist/{query-CPXnDURZ.mjs → query-CGp9vY4e.mjs} +1 -1
- package/dist/{query-CK--1fbL.cjs → query-DFreaScb.cjs} +1 -1
- package/dist/{rateLimitWindows-DJxnNw-X.cjs → rateLimitWindows-CeogT1b6.cjs} +1 -1
- package/dist/{rateLimitWindows-Cqa4AGaB.mjs → rateLimitWindows-DM_gshI4.mjs} +1 -1
- package/dist/{registerCommonHandlers-DbNoM39q.cjs → registerCommonHandlers-CRqKXwQt.cjs} +2 -2
- package/dist/{registerCommonHandlers-K8dICQO2.mjs → registerCommonHandlers-CyAtDNvs.mjs} +2 -2
- package/dist/{registerKillSessionHandler-DiS_go8d.cjs → registerKillSessionHandler-CX49N52L.cjs} +6 -6
- package/dist/{registerKillSessionHandler-O1iriOMO.mjs → registerKillSessionHandler-DGWADNla.mjs} +6 -6
- package/dist/{remoteSessionClient-BlURPulk.mjs → remoteSessionClient-1nycIdrG.mjs} +5 -5
- package/dist/{remoteSessionClient-CtV9mDko.cjs → remoteSessionClient-CuAkp19e.cjs} +5 -5
- package/dist/{reportProgressTool-DlD_xjzU.cjs → reportProgressTool-BS7TkeEk.cjs} +4 -4
- package/dist/{reportProgressTool-nCExrHZH.mjs → reportProgressTool-CdSi-uSC.mjs} +4 -4
- package/dist/{resources-CH1iP6Cv.mjs → resources-CLdQfe3b.mjs} +1 -1
- package/dist/{resources-BPyN59Iv.cjs → resources-CqwHPhdK.cjs} +1 -1
- package/dist/{run-drtwHYkO.mjs → run-DqjEj8M2.mjs} +101 -248
- package/dist/{run-BBNrcCfI.cjs → run-gVwkplx0.cjs} +111 -259
- package/dist/{runClaude-B3KSeby4.cjs → runClaude-CtVoFstP.cjs} +39 -24
- package/dist/{runClaude-CFp27Tyi.mjs → runClaude-CuSjrZSf.mjs} +39 -24
- package/dist/{runClaudeDeps-C_C9TCI0.cjs → runClaudeDeps-DqOgRuKq.cjs} +49 -40
- package/dist/{runClaudeDeps-DMcv93lA.mjs → runClaudeDeps-eazOhb6g.mjs} +54 -45
- package/dist/{runGemini-DzdSBAr9.cjs → runGemini-81wkPvMv.cjs} +37 -35
- package/dist/{runGemini-Bc6SY-hd.mjs → runGemini-B4EqAd1U.mjs} +37 -35
- package/dist/{runOpenClaw-DN6rEVqC.cjs → runOpenClaw-BK7ZQEKj.cjs} +18 -18
- package/dist/{runOpenClaw-DI0qMlgF.mjs → runOpenClaw-Brb1KKAA.mjs} +18 -18
- package/dist/{sandbox-DtttPBMA.cjs → sandbox-DFD6an8o.cjs} +4 -4
- package/dist/{sandbox-v-ffe8LR.mjs → sandbox-t43Exd4t.mjs} +4 -4
- package/dist/{selfCheck-B-yy6bW3.cjs → selfCheck-Bel50SH3.cjs} +37 -36
- package/dist/selfCheck-CwpZepG-.mjs +86 -0
- package/dist/{send-DpBwSZuj.mjs → send-Co9jxmc4.mjs} +8 -8
- package/dist/{send-ShzXYPRu.cjs → send-IR5DnG9V.cjs} +8 -8
- package/dist/{server-CEzKrfKj.cjs → server-CAo6a3Vw.cjs} +6 -6
- package/dist/{server-DScgJXxa.mjs → server-KnIeKeTb.mjs} +4 -4
- package/dist/{sessionLock-Dc0fadGG.cjs → sessionLock-DNGDn9oj.cjs} +3 -3
- package/dist/{sessionLock-B6K4SBZD.mjs → sessionLock-ha9gsQEn.mjs} +3 -3
- package/dist/{sessionOps-D0BPWPoh.mjs → sessionOps-Di9MC0FP.mjs} +4 -4
- package/dist/{sessionOps-Dx7wARjI.cjs → sessionOps-hRqzcMXB.cjs} +4 -4
- package/dist/sessionProvider-4Nn6e9Kd.mjs +109 -0
- package/dist/sessionProvider-LqE7Y_cf.cjs +114 -0
- package/dist/{sessionScanner-BJ35TVG6.cjs → sessionScanner-BzEtrHB8.cjs} +3 -3
- package/dist/{sessionScanner-9Fpgaxtf.mjs → sessionScanner-DKFKDsrW.mjs} +3 -3
- package/dist/{sessions-TZGGAry1.cjs → sessions-CmLiagcb.cjs} +10 -10
- package/dist/{sessions-CFtDlyZd.mjs → sessions-DzgMNXo5.mjs} +10 -10
- package/dist/{setupOfflineReconnection-Biaus-0T.mjs → setupOfflineReconnection-D4NGi3Jf.mjs} +2 -2
- package/dist/{setupOfflineReconnection-B1GsVA8P.cjs → setupOfflineReconnection-Dq4N2Txp.cjs} +2 -2
- package/dist/{spawn-CsoQ-Ecz.mjs → spawn-C6CE5PsI.mjs} +14 -14
- package/dist/{spawn-BRTuypQ2.cjs → spawn-tmoekkOW.cjs} +14 -14
- package/dist/{spawnAgents-CG211IW7.cjs → spawnAgents-D15n6tAj.cjs} +1 -1
- package/dist/{spawnAgents-Co-SLcx-.mjs → spawnAgents-jXo9jIYo.mjs} +1 -1
- package/dist/{spawnHappyCLI-D1doCjkZ.mjs → spawnHappyCLI-66grqHO0.mjs} +1 -1
- package/dist/{spawnHappyCLI-D47kX6jg.cjs → spawnHappyCLI-8NcKgkuy.cjs} +1 -1
- package/dist/{specialCommands-xSmqT_Fu.mjs → specialCommands-BO8ipH0n.mjs} +3 -3
- package/dist/{specialCommands-Ch-Gvy-i.cjs → specialCommands-Dq0TmY1Z.cjs} +3 -3
- package/dist/{startFileWatcher-CCl2fFxT.mjs → startFileWatcher-BLDkieUW.mjs} +1 -1
- package/dist/{startFileWatcher-gKQTstR6.cjs → startFileWatcher-CjgKvec9.cjs} +1 -1
- package/dist/{startupSessionCreate-DlZc8yPl.mjs → startupSessionCreate-B60THeNz.mjs} +1 -1
- package/dist/{startupSessionCreate-BXqoUX30.cjs → startupSessionCreate-CXRVahaU.cjs} +1 -1
- package/dist/{streamRelay-B-J-4St1.cjs → streamRelay-CtTpf-Li.cjs} +1 -1
- package/dist/{streamRelay-DnJXsi36.mjs → streamRelay-GzHxvMem.mjs} +1 -1
- package/dist/{sync-BbjMC3sR.mjs → sync-DJvx7RbO.mjs} +1 -1
- package/dist/{sync-BxMdnZzz.cjs → sync-DKSZOi6w.cjs} +1 -1
- package/dist/{systemPrompt-C2KojRmK.cjs → systemPrompt-Duos1BtM.cjs} +2 -2
- package/dist/{systemPrompt-CmSDAoIx.mjs → systemPrompt-dOOpz8L7.mjs} +2 -2
- package/dist/{teams-DESdalox.cjs → teams-pO5rjvPO.cjs} +9 -9
- package/dist/{teams-lRy1MS0Z.mjs → teams-uWiMJEe1.mjs} +9 -9
- package/dist/{template-BaHAmH2K.cjs → template-BLJxflCH.cjs} +32 -2
- package/dist/{template-CiOPa2rd.mjs → template-YlpbYGeQ.mjs} +31 -3
- package/dist/{time-DNLeIRgR.cjs → time-D-8GFCE7.cjs} +1 -1
- package/dist/{time-Cfknl7xG.mjs → time-Du0scQeJ.mjs} +1 -1
- package/dist/{titleGenerator-ClnMSzwC.mjs → titleGenerator-DKYj8rLY.mjs} +1 -1
- package/dist/{titleGenerator-YNutaU88.cjs → titleGenerator-DnKygjBP.cjs} +2 -2
- package/dist/{todo-DS75Mboz.cjs → todo-BFDb7O8q.cjs} +6 -6
- package/dist/{todo-DZbK5POc.mjs → todo-Du5dAwnt.mjs} +6 -6
- package/dist/{tools-BgdU0dWp.mjs → tools-DHvMVL0a.mjs} +1 -1
- package/dist/{tools-ClYcb1YQ.cjs → tools-DK_x86Kl.cjs} +1 -1
- package/dist/{uninstall-bXenFevR.mjs → uninstall-CLDEXir0.mjs} +3 -3
- package/dist/{uninstall-Di1vPBLV.cjs → uninstall-c3zjum2o.cjs} +3 -3
- package/package.json +7 -7
- package/dist/daemonSupervisor-B-SPSqhs.cjs +0 -13
- package/dist/daemonSupervisor-C6urv3_8.mjs +0 -10
- package/dist/selfCheck-BDfTwxqB.mjs +0 -85
|
@@ -447,7 +447,7 @@ z.z.object({
|
|
|
447
447
|
events: z.z.array(ConnectionDiagnosticEventSchema).min(1).max(32)
|
|
448
448
|
}).strict();
|
|
449
449
|
const TeamPermissionModeSchema = z.z.enum(["default", "bypassPermissions"]);
|
|
450
|
-
const id$
|
|
450
|
+
const id$3 = z.z.string().min(1).max(128);
|
|
451
451
|
const text$1 = z.z.string().min(1).max(32e3);
|
|
452
452
|
const TeamAssistantSchema = z.z.enum(["claude", "codex", "pi-acp"]);
|
|
453
453
|
const TeamModelSchema = z.z.string().trim().min(1).max(256);
|
|
@@ -458,40 +458,49 @@ const TeamActionSchema = z.z.discriminatedUnion("type", [
|
|
|
458
458
|
z.z.object({ type: z.z.literal("start"), launch: TeamLaunchSchema }),
|
|
459
459
|
z.z.object({ type: z.z.literal("set-defaults"), defaults: TeamDefaultsSchema }),
|
|
460
460
|
z.z.object({ type: z.z.literal("set-permission-mode"), permissionMode: TeamPermissionModeSchema }),
|
|
461
|
-
z.z.object({ type: z.z.literal("schedule-create"), name: id$
|
|
462
|
-
z.z.object({ type: z.z.literal("schedule-pause"), scheduleId: id$
|
|
463
|
-
z.z.object({ type: z.z.literal("schedule-resume"), scheduleId: id$
|
|
464
|
-
z.z.object({ type: z.z.literal("schedule-cancel"), scheduleId: id$
|
|
465
|
-
z.z.object({ type: z.z.literal("reconcile-operation"), operationId: id$
|
|
461
|
+
z.z.object({ type: z.z.literal("schedule-create"), name: id$3, botId: id$3, body: text$1, runAt: z.z.number().int().positive().max(864e13), intervalMs: z.z.number().int().min(6e4).max(366 * 864e5).optional() }),
|
|
462
|
+
z.z.object({ type: z.z.literal("schedule-pause"), scheduleId: id$3, version: z.z.number().int().positive() }),
|
|
463
|
+
z.z.object({ type: z.z.literal("schedule-resume"), scheduleId: id$3, version: z.z.number().int().positive() }),
|
|
464
|
+
z.z.object({ type: z.z.literal("schedule-cancel"), scheduleId: id$3, version: z.z.number().int().positive() }),
|
|
465
|
+
z.z.object({ type: z.z.literal("reconcile-operation"), operationId: id$3, claimId: id$3, note: z.z.string().trim().min(1).max(4e3) }),
|
|
466
466
|
// B-689: owner asks the execution computer to run a failed/uncertain operation again.
|
|
467
|
-
z.z.object({ type: z.z.literal("retry-operation"), operationId: id$
|
|
467
|
+
z.z.object({ type: z.z.literal("retry-operation"), operationId: id$3, claimId: id$3 }),
|
|
468
468
|
/** B-730: `transfer` = the owner confirmed moving a session that is bound in another live team (Web adopt); without it the server answers `session_in_other_team`. An old server strips it. */
|
|
469
|
-
z.z.object({ type: z.z.literal("join"), name: id$
|
|
470
|
-
z.z.object({ type: z.z.literal("delegate"), goal: text$1, acceptance: z.z.array(text$1).min(1).max(32), parentTaskId: id$
|
|
471
|
-
z.z.object({ type: z.z.literal("message"), taskId: id$
|
|
472
|
-
z.z.object({ type: z.z.literal("submit"), taskId: id$
|
|
473
|
-
z.z.object({ type: z.z.literal("accept"), taskId: id$
|
|
474
|
-
z.z.object({ type: z.z.literal("return"), taskId: id$
|
|
475
|
-
z.z.object({ type: z.z.literal("cancel"), taskId: id$
|
|
476
|
-
z.z.object({ type: z.z.literal("handoff"), taskId: id$
|
|
477
|
-
z.z.object({ type: z.z.literal("claim-operation"), operationId: id$
|
|
478
|
-
z.z.object({ type: z.z.literal("complete-operation"), operationId: id$
|
|
479
|
-
z.z.object({
|
|
480
|
-
|
|
481
|
-
|
|
469
|
+
z.z.object({ type: z.z.literal("join"), name: id$3, sessionId: id$3, botId: id$3.optional(), transfer: z.z.literal(true).optional() }),
|
|
470
|
+
z.z.object({ type: z.z.literal("delegate"), goal: text$1, acceptance: z.z.array(text$1).min(1).max(32), parentTaskId: id$3.optional(), assigneeBotId: id$3.optional(), botName: id$3.optional(), directory: z.z.string().min(1).max(4096).optional(), assistant: TeamAssistantSchema.optional(), model: TeamModelSchema.optional() }),
|
|
471
|
+
z.z.object({ type: z.z.literal("message"), taskId: id$3, body: text$1, recipientBotId: id$3.optional() }),
|
|
472
|
+
z.z.object({ type: z.z.literal("submit"), taskId: id$3, attemptId: id$3, goalVersion: z.z.number().int().positive(), result: text$1 }),
|
|
473
|
+
z.z.object({ type: z.z.literal("accept"), taskId: id$3, attemptId: id$3, goalVersion: z.z.number().int().positive() }),
|
|
474
|
+
z.z.object({ type: z.z.literal("return"), taskId: id$3, attemptId: id$3, goalVersion: z.z.number().int().positive(), reason: text$1 }),
|
|
475
|
+
z.z.object({ type: z.z.literal("cancel"), taskId: id$3, attemptId: id$3, goalVersion: z.z.number().int().positive(), reason: text$1 }),
|
|
476
|
+
z.z.object({ type: z.z.literal("handoff"), taskId: id$3, attemptId: id$3, goalVersion: z.z.number().int().positive(), assigneeBotId: id$3 }),
|
|
477
|
+
z.z.object({ type: z.z.literal("claim-operation"), operationId: id$3, machineId: id$3, teamLaunchVersion: z.z.literal(1).optional() }),
|
|
478
|
+
z.z.object({ type: z.z.literal("complete-operation"), operationId: id$3, machineId: id$3, claimId: id$3, sessionId: id$3.optional(), workingDirectory: z.z.string().min(1).max(4096).optional() }),
|
|
479
|
+
z.z.object({
|
|
480
|
+
type: z.z.literal("fail-operation"),
|
|
481
|
+
operationId: id$3,
|
|
482
|
+
machineId: id$3,
|
|
483
|
+
claimId: id$3,
|
|
484
|
+
error: text$1,
|
|
485
|
+
unknown: z.z.boolean().optional(),
|
|
486
|
+
/** B-775: a failed cleanup whose wrapper was already stopped (only resources retained). */
|
|
487
|
+
sessionStopped: z.z.boolean().optional()
|
|
488
|
+
}),
|
|
489
|
+
z.z.object({ type: z.z.literal("session-event"), sessionId: id$3, event: z.z.enum(["idle", "blocked", "exited"]) }),
|
|
490
|
+
z.z.object({ type: z.z.literal("message-delivered"), messageId: id$3, recipientBotId: id$3, generation: z.z.number().int().positive(), sessionId: id$3 })
|
|
482
491
|
]);
|
|
483
|
-
z.z.object({ requestId: id$
|
|
492
|
+
z.z.object({ requestId: id$3, action: TeamActionSchema });
|
|
484
493
|
const TeamProjectChoiceSchema = z.z.object({
|
|
485
|
-
projectId: id$
|
|
486
|
-
inheritFromSessionId: id$
|
|
494
|
+
projectId: id$3.optional(),
|
|
495
|
+
inheritFromSessionId: id$3.optional(),
|
|
487
496
|
create: z.z.boolean().optional(),
|
|
488
497
|
directory: z.z.string().min(1).max(4096).optional()
|
|
489
498
|
});
|
|
490
|
-
z.z.object({ name: id$
|
|
499
|
+
z.z.object({ name: id$3, machineId: id$3, requestId: id$3.optional(), launch: TeamLaunchSchema.optional(), project: TeamProjectChoiceSchema.optional(), sessionId: id$3.optional(), transfer: z.z.literal(true).optional() });
|
|
491
500
|
z.z.object({
|
|
492
|
-
projectId: id$
|
|
501
|
+
projectId: id$3.nullable().optional(),
|
|
493
502
|
create: z.z.boolean().optional(),
|
|
494
|
-
requestId: id$
|
|
503
|
+
requestId: id$3.optional()
|
|
495
504
|
}).refine((v) => v.projectId !== void 0 !== (v.create === true), "exactly one of projectId / create");
|
|
496
505
|
const TEAM_WORKTREE = /\/teams\/worktrees\/([^/]+)(?:\/|$)/;
|
|
497
506
|
function teamWorktreeId(path) {
|
|
@@ -508,7 +517,7 @@ function rebaseTeamWorktreePath(path, repository) {
|
|
|
508
517
|
const rest = normalized.slice(match.index + match[0].length).replace(/\/+$/, "");
|
|
509
518
|
return rest ? `${repository.replace(/\/+$/, "")}/${rest}` : repository;
|
|
510
519
|
}
|
|
511
|
-
const id$
|
|
520
|
+
const id$2 = z.z.string().min(1).max(128);
|
|
512
521
|
const text = z.z.string().min(1).max(32e3);
|
|
513
522
|
const AUTOMATION_NAME_PATTERN = /^[a-z0-9][a-z0-9-_.]{0,63}$/;
|
|
514
523
|
const AutomationNameSchema = z.z.string().regex(AUTOMATION_NAME_PATTERN, "automation name must match [a-z0-9][a-z0-9-_.]{0,63}");
|
|
@@ -517,6 +526,7 @@ const AUTOMATION_MAX_INTERVAL_MS = 366 * 864e5;
|
|
|
517
526
|
const AUTOMATION_MAX_TIMESTAMP = 864e13;
|
|
518
527
|
const AUTOMATION_PAYLOAD_MAX_BYTES = 65536;
|
|
519
528
|
const AUTOMATION_SUMMARY_MAX_CHARS = 4096;
|
|
529
|
+
const AUTOMATION_ATTENTION_REASON_MAX_CHARS = 512;
|
|
520
530
|
const AUTOMATION_DEFAULT_LEASE_MS = 6e4;
|
|
521
531
|
const AUTOMATION_CLAIM_MAX_RUNS = 8;
|
|
522
532
|
const AUTOMATION_PRECHECK_DEFAULT_TIMEOUT_MS = 6e4;
|
|
@@ -547,7 +557,7 @@ const AutomationActionSchema = z.z.discriminatedUnion("kind", [
|
|
|
547
557
|
worktree: z.z.boolean().optional(),
|
|
548
558
|
sticky: AutomationStickySchema.optional()
|
|
549
559
|
}),
|
|
550
|
-
z.z.object({ kind: z.z.literal("send"), sessionId: id$
|
|
560
|
+
z.z.object({ kind: z.z.literal("send"), sessionId: id$2, prompt: text }),
|
|
551
561
|
z.z.object({
|
|
552
562
|
kind: z.z.literal("script"),
|
|
553
563
|
command: z.z.array(z.z.string().min(1).max(4096)).min(1).max(256),
|
|
@@ -573,7 +583,7 @@ const maxRuntimeMs = z.z.number().int().min(6e4).max(7 * 864e5);
|
|
|
573
583
|
z.z.object({
|
|
574
584
|
name: AutomationNameSchema,
|
|
575
585
|
description: z.z.string().max(4e3).nullable().optional(),
|
|
576
|
-
machineId: id$
|
|
586
|
+
machineId: id$2,
|
|
577
587
|
trigger: AutomationTriggerSchema,
|
|
578
588
|
action: AutomationActionSchema,
|
|
579
589
|
concurrency: AutomationConcurrencySchema.optional(),
|
|
@@ -582,13 +592,13 @@ z.z.object({
|
|
|
582
592
|
/** B-548. Older servers strip it silently — clients must check the response echoes `precheck`. */
|
|
583
593
|
precheck: AutomationPrecheckSchema.nullable().optional(),
|
|
584
594
|
/** B-644: sessions this automation spawns join this project (quiet variant). Older servers strip it — check the echo. */
|
|
585
|
-
projectId: id$
|
|
595
|
+
projectId: id$2.nullable().optional()
|
|
586
596
|
});
|
|
587
597
|
z.z.object({
|
|
588
598
|
version: z.z.number().int().positive(),
|
|
589
599
|
name: AutomationNameSchema.optional(),
|
|
590
600
|
description: z.z.string().max(4e3).nullable().optional(),
|
|
591
|
-
machineId: id$
|
|
601
|
+
machineId: id$2.optional(),
|
|
592
602
|
trigger: AutomationTriggerSchema.optional(),
|
|
593
603
|
action: AutomationActionSchema.optional(),
|
|
594
604
|
concurrency: AutomationConcurrencySchema.optional(),
|
|
@@ -596,41 +606,41 @@ z.z.object({
|
|
|
596
606
|
/** B-548: omitted keeps the current precheck, `null` removes it. Changing `action` alone keeps it too. */
|
|
597
607
|
precheck: AutomationPrecheckSchema.nullable().optional(),
|
|
598
608
|
/** B-644: omitted keeps the current project, `null` detaches. */
|
|
599
|
-
projectId: id$
|
|
609
|
+
projectId: id$2.nullable().optional()
|
|
600
610
|
});
|
|
601
611
|
const payload = z.z.string().max(AUTOMATION_PAYLOAD_MAX_BYTES).refine((v) => new TextEncoder().encode(v).length <= AUTOMATION_PAYLOAD_MAX_BYTES, "payload exceeds 64KB");
|
|
602
612
|
z.z.object({ payload: payload.optional(), dedupeKey: z.z.string().min(1).max(256).optional() });
|
|
603
613
|
z.z.object({ payload: payload.optional() });
|
|
604
614
|
z.z.object({
|
|
605
|
-
machineId: id$
|
|
615
|
+
machineId: id$2,
|
|
606
616
|
limit: z.z.number().int().min(1).max(AUTOMATION_CLAIM_MAX_RUNS).optional(),
|
|
607
617
|
leaseMs: z.z.number().int().min(5e3).max(36e5).optional(),
|
|
608
618
|
/** B-548: what this daemon can execute (e.g. `precheck`). Older daemons send nothing; older servers strip it. */
|
|
609
619
|
capabilities: z.z.array(z.z.string().min(1).max(64)).max(32).optional()
|
|
610
620
|
});
|
|
611
621
|
z.z.object({
|
|
612
|
-
claimId: id$
|
|
622
|
+
claimId: id$2.optional(),
|
|
613
623
|
status: z.z.enum(["running", "done", "failed", "skipped"]).optional(),
|
|
614
|
-
sessionId: id$
|
|
624
|
+
sessionId: id$2.nullable().optional(),
|
|
615
625
|
stickyKey: z.z.string().min(1).max(512).optional(),
|
|
616
626
|
summary: z.z.string().max(AUTOMATION_SUMMARY_MAX_CHARS).nullable().optional(),
|
|
617
627
|
error: z.z.string().max(AUTOMATION_SUMMARY_MAX_CHARS).nullable().optional(),
|
|
618
628
|
exitCode: z.z.number().int().nullable().optional(),
|
|
619
629
|
needsAttention: z.z.boolean().optional(),
|
|
620
|
-
attentionReason: z.z.string().max(
|
|
630
|
+
attentionReason: z.z.string().max(AUTOMATION_ATTENTION_REASON_MAX_CHARS).nullable().optional(),
|
|
621
631
|
leaseMs: z.z.number().int().min(5e3).max(36e5).optional()
|
|
622
632
|
});
|
|
623
633
|
z.z.object({ by: z.z.string().min(1).max(64).optional() });
|
|
624
|
-
z.z.object({ key: z.z.string().min(1).max(512), sessionId: id$
|
|
634
|
+
z.z.object({ key: z.z.string().min(1).max(512), sessionId: id$2 });
|
|
625
635
|
z.z.object({ key: z.z.string().min(1).max(512) });
|
|
626
636
|
z.z.object({
|
|
627
|
-
automationId: id$
|
|
637
|
+
automationId: id$2.optional(),
|
|
628
638
|
name: AutomationNameSchema.optional(),
|
|
629
639
|
status: z.z.string().min(1).max(64).optional(),
|
|
630
640
|
attention: z.z.enum(["1", "true", "0", "false"]).optional(),
|
|
631
641
|
limit: z.z.coerce.number().int().min(1).max(200).optional()
|
|
632
642
|
});
|
|
633
|
-
z.z.object({ machineId: id$
|
|
643
|
+
z.z.object({ machineId: id$2.optional() });
|
|
634
644
|
const PROJECT_SESSION_CAPABILITY = "project-v1";
|
|
635
645
|
const PROJECT_LIMITS = {
|
|
636
646
|
nameChars: 120,
|
|
@@ -642,11 +652,11 @@ const PROJECT_LIMITS = {
|
|
|
642
652
|
messageBytes: 64 * 1024,
|
|
643
653
|
presenceBatch: 200,
|
|
644
654
|
memberBatch: 200};
|
|
645
|
-
const id = z.z.string().min(1).max(128);
|
|
655
|
+
const id$1 = z.z.string().min(1).max(128);
|
|
646
656
|
const utf8Bytes = (value) => new TextEncoder().encode(value).length;
|
|
647
657
|
const boundedText = (maxBytes) => z.z.string().max(maxBytes).refine((v) => utf8Bytes(v) <= maxBytes, `exceeds ${maxBytes} bytes`);
|
|
648
658
|
const ProjectFolderSchema = z.z.object({
|
|
649
|
-
machineId: id,
|
|
659
|
+
machineId: id$1,
|
|
650
660
|
path: z.z.string().min(1).max(4096),
|
|
651
661
|
primary: z.z.boolean().optional()
|
|
652
662
|
});
|
|
@@ -666,9 +676,9 @@ z.z.object({
|
|
|
666
676
|
folders: z.z.array(ProjectFolderSchema).max(PROJECT_LIMITS.folders).optional(),
|
|
667
677
|
defaults: ProjectDefaultsSchema.optional(),
|
|
668
678
|
/** Idempotency: the same requestId returns the project it created. */
|
|
669
|
-
requestId: id.optional(),
|
|
679
|
+
requestId: id$1.optional(),
|
|
670
680
|
/** Optional initial members (e.g. "设为项目" moves a folder's sessions in one step). */
|
|
671
|
-
sessionIds: z.z.array(id).max(PROJECT_LIMITS.memberBatch).optional()
|
|
681
|
+
sessionIds: z.z.array(id$1).max(PROJECT_LIMITS.memberBatch).optional()
|
|
672
682
|
});
|
|
673
683
|
z.z.object({
|
|
674
684
|
name: z.z.string().trim().min(1).max(PROJECT_LIMITS.nameChars).optional(),
|
|
@@ -684,7 +694,7 @@ z.z.object({
|
|
|
684
694
|
summary: z.z.string().max(200).optional()
|
|
685
695
|
});
|
|
686
696
|
z.z.object({
|
|
687
|
-
sessionIds: z.z.array(id).min(1).max(PROJECT_LIMITS.memberBatch),
|
|
697
|
+
sessionIds: z.z.array(id$1).min(1).max(PROJECT_LIMITS.memberBatch),
|
|
688
698
|
via: ProjectMemberViaInputSchema.optional()
|
|
689
699
|
});
|
|
690
700
|
z.z.object({
|
|
@@ -694,15 +704,15 @@ z.z.object({
|
|
|
694
704
|
/** Entry id (or `#seq`) this entry replaces. */
|
|
695
705
|
supersedes: z.z.string().min(1).max(128).optional(),
|
|
696
706
|
/** Stamped by the wrapper (the agent cannot fill it). Absent = written by the user. */
|
|
697
|
-
authorSessionId: id.optional()
|
|
707
|
+
authorSessionId: id$1.optional()
|
|
698
708
|
});
|
|
699
709
|
z.z.object({
|
|
700
710
|
/** When set, only entries this session authored may be revoked. Absent = the owner. */
|
|
701
|
-
bySessionId: id.optional()
|
|
711
|
+
bySessionId: id$1.optional()
|
|
702
712
|
});
|
|
703
|
-
z.z.object({ teamId: id });
|
|
713
|
+
z.z.object({ teamId: id$1 });
|
|
704
714
|
const ProjectPresenceEntrySchema = z.z.object({
|
|
705
|
-
sessionId: id,
|
|
715
|
+
sessionId: id$1,
|
|
706
716
|
title: z.z.string().max(200).nullable().optional(),
|
|
707
717
|
agent: z.z.string().max(64).nullable().optional(),
|
|
708
718
|
machine: z.z.string().max(200).nullable().optional(),
|
|
@@ -714,19 +724,19 @@ const ProjectPresenceEntrySchema = z.z.object({
|
|
|
714
724
|
capabilities: z.z.array(z.z.string().max(64)).max(32).optional()
|
|
715
725
|
});
|
|
716
726
|
z.z.object({
|
|
717
|
-
machineId: id,
|
|
727
|
+
machineId: id$1,
|
|
718
728
|
sessions: z.z.array(ProjectPresenceEntrySchema).max(PROJECT_LIMITS.presenceBatch),
|
|
719
729
|
/** Sessions of this machine that stopped; their presence rows are marked `offline`. */
|
|
720
|
-
gone: z.z.array(id).max(PROJECT_LIMITS.presenceBatch).optional()
|
|
730
|
+
gone: z.z.array(id$1).max(PROJECT_LIMITS.presenceBatch).optional()
|
|
721
731
|
});
|
|
722
732
|
z.z.object({
|
|
723
|
-
fromSessionId: id,
|
|
724
|
-
toSessionId: id,
|
|
733
|
+
fromSessionId: id$1,
|
|
734
|
+
toSessionId: id$1,
|
|
725
735
|
body: boundedText(PROJECT_LIMITS.messageBytes).pipe(z.z.string().min(1))
|
|
726
736
|
});
|
|
727
737
|
z.z.object({
|
|
728
|
-
sessionId: id,
|
|
729
|
-
messageIds: z.z.array(id).min(1).max(100)
|
|
738
|
+
sessionId: id$1,
|
|
739
|
+
messageIds: z.z.array(id$1).min(1).max(100)
|
|
730
740
|
});
|
|
731
741
|
z.z.object({
|
|
732
742
|
full: z.z.enum(["0", "1", "true", "false"]).optional(),
|
|
@@ -765,9 +775,9 @@ function object(value) {
|
|
|
765
775
|
function stamp(value) {
|
|
766
776
|
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
767
777
|
}
|
|
768
|
-
function parseBuiltinTodo(raw,
|
|
778
|
+
function parseBuiltinTodo(raw, key2) {
|
|
769
779
|
if (!object(raw) || raw.schemaVersion !== 1 || typeof raw.id !== "string" || !UUID.test(raw.id)) return null;
|
|
770
|
-
if (
|
|
780
|
+
if (key2 !== void 0 && key2 !== BUILTIN_TODO_PREFIX + raw.id) return null;
|
|
771
781
|
if (typeof raw.title !== "string" || !raw.title.trim() || raw.title.length > TITLE_MAX_LENGTH) return null;
|
|
772
782
|
if (typeof raw.note !== "string" || raw.note.length > NOTE_MAX_LENGTH) return null;
|
|
773
783
|
if (raw.status !== "open" && raw.status !== "done") return null;
|
|
@@ -792,11 +802,11 @@ function encodeBuiltinTodo(todo) {
|
|
|
792
802
|
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
793
803
|
return btoa(binary);
|
|
794
804
|
}
|
|
795
|
-
function decodeBuiltinTodo(value,
|
|
805
|
+
function decodeBuiltinTodo(value, key2) {
|
|
796
806
|
try {
|
|
797
807
|
const binary = atob(value);
|
|
798
808
|
const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
799
|
-
return parseBuiltinTodo(JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)),
|
|
809
|
+
return parseBuiltinTodo(JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)), key2);
|
|
800
810
|
} catch {
|
|
801
811
|
return null;
|
|
802
812
|
}
|
|
@@ -804,12 +814,12 @@ function decodeBuiltinTodo(value, key) {
|
|
|
804
814
|
function sortBuiltinTodos(records) {
|
|
805
815
|
return [...records].sort((a, b) => a.order - b.order || a.id.localeCompare(b.id));
|
|
806
816
|
}
|
|
807
|
-
function createBuiltinTodoClient(credentials,
|
|
808
|
-
const serverUrl =
|
|
817
|
+
function createBuiltinTodoClient(credentials, options2) {
|
|
818
|
+
const serverUrl = options2.serverUrl.replace(/\/$/, "");
|
|
809
819
|
const token = credentials.token;
|
|
810
|
-
const clientId =
|
|
811
|
-
const fetcher =
|
|
812
|
-
const timeoutMs =
|
|
820
|
+
const clientId = options2.clientId;
|
|
821
|
+
const fetcher = options2.fetch ?? globalThis.fetch.bind(globalThis);
|
|
822
|
+
const timeoutMs = options2.timeoutMs ?? 15e3;
|
|
813
823
|
async function request(path, mutations, allowNotFound = false) {
|
|
814
824
|
const controller = new AbortController();
|
|
815
825
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
@@ -888,19 +898,19 @@ function createBuiltinTodoClient(credentials, options) {
|
|
|
888
898
|
const pendingCreates = /* @__PURE__ */ new Map();
|
|
889
899
|
async function get(id2) {
|
|
890
900
|
if (!UUID.test(id2)) throw new BuiltinTodoError("validation", "Invalid Todo ID");
|
|
891
|
-
const
|
|
892
|
-
const raw = await request(`/v1/kv/${encodeURIComponent(
|
|
901
|
+
const key2 = BUILTIN_TODO_PREFIX + id2;
|
|
902
|
+
const raw = await request(`/v1/kv/${encodeURIComponent(key2)}`, void 0, true);
|
|
893
903
|
if (raw === void 0) return null;
|
|
894
|
-
const todo = object(raw) && typeof raw.value === "string" ? decodeBuiltinTodo(raw.value,
|
|
895
|
-
if (!todo || !object(raw) || raw.key !==
|
|
904
|
+
const todo = object(raw) && typeof raw.value === "string" ? decodeBuiltinTodo(raw.value, key2) : null;
|
|
905
|
+
if (!todo || !object(raw) || raw.key !== key2 || !Number.isSafeInteger(raw.version) || raw.version < 0) {
|
|
896
906
|
throw new BuiltinTodoError("invalid-response", "Invalid Todo read response");
|
|
897
907
|
}
|
|
898
908
|
return { ...todo, version: raw.version };
|
|
899
909
|
}
|
|
900
|
-
async function create(
|
|
901
|
-
const cleanTitle =
|
|
910
|
+
async function create(title2, note2 = "", id2) {
|
|
911
|
+
const cleanTitle = title2.trim();
|
|
902
912
|
if (id2 !== void 0 && !UUID.test(id2)) throw new BuiltinTodoError("validation", "Invalid Todo ID");
|
|
903
|
-
const payloadKey = JSON.stringify([cleanTitle,
|
|
913
|
+
const payloadKey = JSON.stringify([cleanTitle, note2, id2]);
|
|
904
914
|
let pending = pendingCreates.get(payloadKey);
|
|
905
915
|
if (pending?.operation) return pending.operation;
|
|
906
916
|
if (!pending) {
|
|
@@ -909,7 +919,7 @@ function createBuiltinTodoClient(credentials, options) {
|
|
|
909
919
|
schemaVersion: 1,
|
|
910
920
|
id: id2 ?? crypto.randomUUID(),
|
|
911
921
|
title: cleanTitle,
|
|
912
|
-
note,
|
|
922
|
+
note: note2,
|
|
913
923
|
status: "open",
|
|
914
924
|
order: 0,
|
|
915
925
|
createdAt: now,
|
|
@@ -922,14 +932,14 @@ function createBuiltinTodoClient(credentials, options) {
|
|
|
922
932
|
const entry = pending;
|
|
923
933
|
const operation = (async () => {
|
|
924
934
|
if (entry.attempted) {
|
|
925
|
-
const
|
|
926
|
-
const existing = await request(`/v1/kv/${encodeURIComponent(
|
|
935
|
+
const key2 = BUILTIN_TODO_PREFIX + entry.draft.id;
|
|
936
|
+
const existing = await request(`/v1/kv/${encodeURIComponent(key2)}`, void 0, true);
|
|
927
937
|
if (existing !== void 0) {
|
|
928
|
-
const todo = object(existing) && typeof existing.value === "string" ? decodeBuiltinTodo(existing.value,
|
|
929
|
-
if (!todo || !object(existing) || existing.key !==
|
|
938
|
+
const todo = object(existing) && typeof existing.value === "string" ? decodeBuiltinTodo(existing.value, key2) : null;
|
|
939
|
+
if (!todo || !object(existing) || existing.key !== key2 || !Number.isSafeInteger(existing.version) || existing.version < 0) {
|
|
930
940
|
throw new BuiltinTodoError("invalid-response", "Cannot confirm the previous Todo creation");
|
|
931
941
|
}
|
|
932
|
-
if (id2 && (todo.title !== cleanTitle || todo.note !==
|
|
942
|
+
if (id2 && (todo.title !== cleanTitle || todo.note !== note2)) throw new BuiltinTodoError("conflict", "This Todo ID already has different content; read it before deciding");
|
|
933
943
|
return { ...todo, version: existing.version };
|
|
934
944
|
}
|
|
935
945
|
}
|
|
@@ -1172,8 +1182,202 @@ const ServerMigrateNoticeSchema = z.z.object({
|
|
|
1172
1182
|
handoff: z.z.string().regex(/^vh1\.[A-Za-z0-9_-]{16,2048}\.[A-Za-z0-9_-]{43}$/),
|
|
1173
1183
|
issuedAt: z.z.number().int().positive()
|
|
1174
1184
|
});
|
|
1185
|
+
const ATTENTION_SESSION_CAPABILITY = "owner-board-v1";
|
|
1186
|
+
const ATTENTION_DISABLED_ERROR = "owner_board_disabled";
|
|
1187
|
+
const ATTENTION_LIMITS = {
|
|
1188
|
+
titleChars: 120,
|
|
1189
|
+
bodyBytes: 8 * 1024,
|
|
1190
|
+
keyChars: 256,
|
|
1191
|
+
options: { min: 2, max: 4 },
|
|
1192
|
+
optionIdChars: 16,
|
|
1193
|
+
optionLabelChars: 120,
|
|
1194
|
+
optionDetailChars: 1e3,
|
|
1195
|
+
links: 16,
|
|
1196
|
+
linkRefChars: 2048,
|
|
1197
|
+
linkLabelChars: 120,
|
|
1198
|
+
snippetChars: 200,
|
|
1199
|
+
noteChars: 2e3,
|
|
1200
|
+
listMax: 200,
|
|
1201
|
+
/** Open `needsOwner` items per session before the playbook asks the lead to merge or drop stale ones (§5.1 rule 6). */
|
|
1202
|
+
openPerSessionSoftCap: 5
|
|
1203
|
+
};
|
|
1204
|
+
const ATTENTION_SOURCES = ["lead", "agent", "owner", "automation", "team"];
|
|
1205
|
+
const ATTENTION_KINDS = ["decision", "todo", "blocked", "report", "answer", "question", "request", "pin"];
|
|
1206
|
+
const OWNER_BOARD_POST_KINDS = ["decision", "todo", "report", "answer"];
|
|
1207
|
+
const OWNER_BOARD_RESOLVE_OUTCOMES = ["done", "answered", "dropped", "superseded"];
|
|
1208
|
+
const ATTENTION_BOARD_LOCAL_ID_PREFIX = "board-";
|
|
1209
|
+
function isAttentionBoardLocalId(localId) {
|
|
1210
|
+
return typeof localId === "string" && localId.startsWith(ATTENTION_BOARD_LOCAL_ID_PREFIX);
|
|
1211
|
+
}
|
|
1212
|
+
const id = z.z.string().min(1).max(128);
|
|
1213
|
+
const title = z.z.string().trim().min(1).max(ATTENTION_LIMITS.titleChars);
|
|
1214
|
+
const bodyMd = z.z.string().max(ATTENTION_LIMITS.bodyBytes * 4).refine((v) => new TextEncoder().encode(v).length <= ATTENTION_LIMITS.bodyBytes, "body exceeds 8KB");
|
|
1215
|
+
const note = z.z.string().max(ATTENTION_LIMITS.noteChars);
|
|
1216
|
+
const requestId = z.z.string().min(1).max(128);
|
|
1217
|
+
const key = z.z.string().min(1).max(ATTENTION_LIMITS.keyChars);
|
|
1218
|
+
const AttentionOptionSchema = z.z.object({
|
|
1219
|
+
id: z.z.string().trim().min(1).max(ATTENTION_LIMITS.optionIdChars),
|
|
1220
|
+
label: z.z.string().trim().min(1).max(ATTENTION_LIMITS.optionLabelChars),
|
|
1221
|
+
detail: z.z.string().max(ATTENTION_LIMITS.optionDetailChars).optional(),
|
|
1222
|
+
recommended: z.z.boolean().optional()
|
|
1223
|
+
});
|
|
1224
|
+
const options = z.z.array(AttentionOptionSchema).min(ATTENTION_LIMITS.options.min).max(ATTENTION_LIMITS.options.max).refine((o) => new Set(o.map((x) => x.id)).size === o.length, "option ids must be unique");
|
|
1225
|
+
const ATTENTION_LINK_TYPES = ["task", "pr", "commit", "url", "panel"];
|
|
1226
|
+
const AttentionLinkSchema = z.z.object({
|
|
1227
|
+
type: z.z.enum(ATTENTION_LINK_TYPES),
|
|
1228
|
+
ref: z.z.string().trim().min(1).max(ATTENTION_LIMITS.linkRefChars),
|
|
1229
|
+
label: z.z.string().max(ATTENTION_LIMITS.linkLabelChars).optional()
|
|
1230
|
+
});
|
|
1231
|
+
const links = z.z.array(AttentionLinkSchema).max(ATTENTION_LIMITS.links);
|
|
1232
|
+
const AttentionAnchorSchema = z.z.object({
|
|
1233
|
+
localId: z.z.string().min(1).max(256).optional(),
|
|
1234
|
+
messageId: z.z.string().min(1).max(128).optional(),
|
|
1235
|
+
snippet: z.z.string().max(ATTENTION_LIMITS.snippetChars).optional()
|
|
1236
|
+
}).refine((a) => a.localId !== void 0 || a.messageId !== void 0, "anchor needs localId or messageId");
|
|
1237
|
+
const AttentionItemSchema = z.z.object({
|
|
1238
|
+
id: z.z.string(),
|
|
1239
|
+
sessionId: z.z.string(),
|
|
1240
|
+
teamId: z.z.string().nullable(),
|
|
1241
|
+
projectId: z.z.string().nullable(),
|
|
1242
|
+
source: z.z.string(),
|
|
1243
|
+
kind: z.z.string(),
|
|
1244
|
+
key: z.z.string().nullable(),
|
|
1245
|
+
title: z.z.string(),
|
|
1246
|
+
bodyMd: z.z.string().nullable(),
|
|
1247
|
+
options: z.z.array(AttentionOptionSchema.passthrough()).nullable(),
|
|
1248
|
+
links: z.z.array(z.z.object({ type: z.z.string(), ref: z.z.string(), label: z.z.string().optional() }).passthrough()).nullable(),
|
|
1249
|
+
anchor: z.z.object({ localId: z.z.string().optional(), messageId: z.z.string().optional(), snippet: z.z.string().optional() }).nullable(),
|
|
1250
|
+
/** The lead's first in-stream reply to an owner question (auto-attached by the CLI, §4.4). */
|
|
1251
|
+
firstReply: z.z.object({ localId: z.z.string().optional(), messageId: z.z.string().optional(), snippet: z.z.string().optional() }).nullable(),
|
|
1252
|
+
replyToId: z.z.string().nullable(),
|
|
1253
|
+
/** D5: drafted by the CLI from the lead's text (「自动识别」), not posted by the lead. No push until the lead confirms it. */
|
|
1254
|
+
inferred: z.z.boolean().default(false),
|
|
1255
|
+
needsOwner: z.z.boolean(),
|
|
1256
|
+
state: z.z.string(),
|
|
1257
|
+
ownerChoice: z.z.string().nullable(),
|
|
1258
|
+
ownerNote: z.z.string().nullable(),
|
|
1259
|
+
resolvedBy: z.z.string().nullable(),
|
|
1260
|
+
/** The lead's `owner_board_resolve` note. */
|
|
1261
|
+
resolveNote: z.z.string().nullable(),
|
|
1262
|
+
/** Times the same `(sessionId, key)` was posted again and folded into this item. */
|
|
1263
|
+
repostCount: z.z.number(),
|
|
1264
|
+
createdAt: z.z.number(),
|
|
1265
|
+
updatedAt: z.z.number(),
|
|
1266
|
+
resolvedAt: z.z.number().nullable(),
|
|
1267
|
+
pushedAt: z.z.number().nullable(),
|
|
1268
|
+
/** Bumped on every mutation; clients keep the highest version per id. */
|
|
1269
|
+
version: z.z.number()
|
|
1270
|
+
});
|
|
1271
|
+
z.z.object({
|
|
1272
|
+
t: z.z.literal("attention-item"),
|
|
1273
|
+
item: AttentionItemSchema
|
|
1274
|
+
});
|
|
1275
|
+
z.z.object({
|
|
1276
|
+
sessionId: id,
|
|
1277
|
+
source: z.z.enum(ATTENTION_SOURCES),
|
|
1278
|
+
kind: z.z.enum(ATTENTION_KINDS),
|
|
1279
|
+
title,
|
|
1280
|
+
bodyMd: bodyMd.optional(),
|
|
1281
|
+
options: options.optional(),
|
|
1282
|
+
links: links.optional(),
|
|
1283
|
+
anchor: AttentionAnchorSchema.optional(),
|
|
1284
|
+
replyToId: id.optional(),
|
|
1285
|
+
key: key.optional(),
|
|
1286
|
+
requestId: requestId.optional(),
|
|
1287
|
+
/**
|
|
1288
|
+
* D5 draft: only the CLI's auto-detect path sets it (`owner_board_post` does
|
|
1289
|
+
* not expose it). A repost of the key with `false` confirms the draft (and
|
|
1290
|
+
* pushes once); a draft never downgrades a confirmed item.
|
|
1291
|
+
*/
|
|
1292
|
+
inferred: z.z.boolean().default(false)
|
|
1293
|
+
}).refine((p) => p.kind !== "decision" || p.options !== void 0, { message: "decision needs 2-4 options", path: ["options"] });
|
|
1294
|
+
z.z.object({
|
|
1295
|
+
title: title.optional(),
|
|
1296
|
+
bodyMd: bodyMd.nullable().optional(),
|
|
1297
|
+
appendMd: bodyMd.optional(),
|
|
1298
|
+
options: options.nullable().optional(),
|
|
1299
|
+
links: links.nullable().optional(),
|
|
1300
|
+
/** Only `question` → `request` (the lead reclassifies an owner message, §4.4). */
|
|
1301
|
+
kind: z.z.literal("request").optional(),
|
|
1302
|
+
state: z.z.enum(["open", "in_progress", "answered"]).optional(),
|
|
1303
|
+
firstReply: AttentionAnchorSchema.optional(),
|
|
1304
|
+
requestId: requestId.optional()
|
|
1305
|
+
}).refine((p) => !(p.bodyMd !== void 0 && p.appendMd !== void 0), "use bodyMd or appendMd, not both");
|
|
1306
|
+
z.z.object({
|
|
1307
|
+
outcome: z.z.enum(OWNER_BOARD_RESOLVE_OUTCOMES),
|
|
1308
|
+
note: note.optional(),
|
|
1309
|
+
/** Defaults to `lead`. */
|
|
1310
|
+
by: z.z.enum(["lead", "auto-first-reply"]).optional(),
|
|
1311
|
+
requestId: requestId.optional()
|
|
1312
|
+
});
|
|
1313
|
+
z.z.discriminatedUnion("action", [
|
|
1314
|
+
z.z.object({ action: z.z.literal("choose"), choice: z.z.string().trim().min(1).max(ATTENTION_LIMITS.optionIdChars), note: note.optional() }),
|
|
1315
|
+
z.z.object({ action: z.z.literal("resolve"), note: note.optional() }),
|
|
1316
|
+
z.z.object({ action: z.z.literal("reopen"), note: note.optional() })
|
|
1317
|
+
]);
|
|
1318
|
+
z.z.object({
|
|
1319
|
+
sessionId: id.optional(),
|
|
1320
|
+
/** `open` (default) = open + in_progress; `active` adds the latest `answered`; `all` = everything. */
|
|
1321
|
+
state: z.z.enum(["open", "active", "all"]).optional(),
|
|
1322
|
+
needsOwner: z.z.enum(["1", "true", "0", "false"]).optional(),
|
|
1323
|
+
/** Epoch ms; only items updated after it. */
|
|
1324
|
+
since: z.z.coerce.number().int().nonnegative().optional(),
|
|
1325
|
+
limit: z.z.coerce.number().int().min(1).max(ATTENTION_LIMITS.listMax).optional()
|
|
1326
|
+
});
|
|
1327
|
+
const OwnerBoardPostInputSchema = z.z.object({
|
|
1328
|
+
kind: z.z.enum(OWNER_BOARD_POST_KINDS),
|
|
1329
|
+
title,
|
|
1330
|
+
body_md: bodyMd.optional(),
|
|
1331
|
+
options: options.optional(),
|
|
1332
|
+
links: links.optional(),
|
|
1333
|
+
reply_to: id.optional(),
|
|
1334
|
+
key: key.optional(),
|
|
1335
|
+
anchor: z.z.union([z.z.literal("this_turn"), z.z.object({ localId: z.z.string().min(1).max(256) })]).optional(),
|
|
1336
|
+
request_id: requestId
|
|
1337
|
+
}).refine((p) => p.kind !== "decision" || p.options !== void 0, { message: "decision needs 2-4 options", path: ["options"] });
|
|
1338
|
+
const OwnerBoardUpdateInputSchema = z.z.object({
|
|
1339
|
+
id,
|
|
1340
|
+
title: title.optional(),
|
|
1341
|
+
body_md: bodyMd.optional(),
|
|
1342
|
+
append_md: bodyMd.optional(),
|
|
1343
|
+
options: options.optional(),
|
|
1344
|
+
links: links.optional(),
|
|
1345
|
+
state: z.z.enum(["open", "in_progress"]).optional(),
|
|
1346
|
+
request_id: requestId
|
|
1347
|
+
}).refine((p) => !(p.body_md !== void 0 && p.append_md !== void 0), "use body_md or append_md, not both");
|
|
1348
|
+
const OwnerBoardResolveInputSchema = z.z.object({
|
|
1349
|
+
id,
|
|
1350
|
+
outcome: z.z.enum(OWNER_BOARD_RESOLVE_OUTCOMES),
|
|
1351
|
+
note: note.optional(),
|
|
1352
|
+
request_id: requestId
|
|
1353
|
+
});
|
|
1354
|
+
const OwnerBoardListInputSchema = z.z.object({
|
|
1355
|
+
state: z.z.enum(["open", "all"]).optional(),
|
|
1356
|
+
/** ISO-8601 or epoch ms. */
|
|
1357
|
+
since: z.z.string().min(1).max(64).optional()
|
|
1358
|
+
});
|
|
1359
|
+
function ownerBoardPostToRest(sessionId, input, anchor) {
|
|
1360
|
+
return {
|
|
1361
|
+
sessionId,
|
|
1362
|
+
source: "lead",
|
|
1363
|
+
kind: input.kind,
|
|
1364
|
+
title: input.title,
|
|
1365
|
+
...input.body_md !== void 0 ? { bodyMd: input.body_md } : {},
|
|
1366
|
+
...input.options ? { options: input.options } : {},
|
|
1367
|
+
...input.links ? { links: input.links } : {},
|
|
1368
|
+
...anchor ? { anchor } : {},
|
|
1369
|
+
...input.reply_to ? { replyToId: input.reply_to } : {},
|
|
1370
|
+
...input.key ? { key: input.key } : {},
|
|
1371
|
+
requestId: input.request_id,
|
|
1372
|
+
inferred: false
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1175
1375
|
|
|
1176
1376
|
exports.AGENT_VERSION_SOURCES = AGENT_VERSION_SOURCES;
|
|
1377
|
+
exports.ATTENTION_DISABLED_ERROR = ATTENTION_DISABLED_ERROR;
|
|
1378
|
+
exports.ATTENTION_LIMITS = ATTENTION_LIMITS;
|
|
1379
|
+
exports.ATTENTION_SESSION_CAPABILITY = ATTENTION_SESSION_CAPABILITY;
|
|
1380
|
+
exports.AUTOMATION_ATTENTION_REASON_MAX_CHARS = AUTOMATION_ATTENTION_REASON_MAX_CHARS;
|
|
1177
1381
|
exports.AUTOMATION_CLAIM_MAX_RUNS = AUTOMATION_CLAIM_MAX_RUNS;
|
|
1178
1382
|
exports.AUTOMATION_DAEMON_CAPABILITY_PRECHECK = AUTOMATION_DAEMON_CAPABILITY_PRECHECK;
|
|
1179
1383
|
exports.AUTOMATION_DEFAULT_LEASE_MS = AUTOMATION_DEFAULT_LEASE_MS;
|
|
@@ -1192,6 +1396,10 @@ exports.BUILTIN_TODO_DISCOVERY = BUILTIN_TODO_DISCOVERY;
|
|
|
1192
1396
|
exports.BUILTIN_TODO_SKILL = BUILTIN_TODO_SKILL;
|
|
1193
1397
|
exports.CODEX_STEER_CAPABILITY = CODEX_STEER_CAPABILITY;
|
|
1194
1398
|
exports.HARNESS_INSTALL_CAPABILITY_VERSION = HARNESS_INSTALL_CAPABILITY_VERSION;
|
|
1399
|
+
exports.OwnerBoardListInputSchema = OwnerBoardListInputSchema;
|
|
1400
|
+
exports.OwnerBoardPostInputSchema = OwnerBoardPostInputSchema;
|
|
1401
|
+
exports.OwnerBoardResolveInputSchema = OwnerBoardResolveInputSchema;
|
|
1402
|
+
exports.OwnerBoardUpdateInputSchema = OwnerBoardUpdateInputSchema;
|
|
1195
1403
|
exports.PI_STEER_CAPABILITY = PI_STEER_CAPABILITY;
|
|
1196
1404
|
exports.PROJECT_SESSION_CAPABILITY = PROJECT_SESSION_CAPABILITY;
|
|
1197
1405
|
exports.PROMPT_QUEUE_CAPABILITY = PROMPT_QUEUE_CAPABILITY;
|
|
@@ -1203,11 +1411,13 @@ exports.ServerMigrateNoticeSchema = ServerMigrateNoticeSchema;
|
|
|
1203
1411
|
exports.createBuiltinTodoClient = createBuiltinTodoClient;
|
|
1204
1412
|
exports.createEnvelope = createEnvelope;
|
|
1205
1413
|
exports.getAgentCodeDefaults = getAgentCodeDefaults;
|
|
1414
|
+
exports.isAttentionBoardLocalId = isAttentionBoardLocalId;
|
|
1206
1415
|
exports.isAutomationRunTerminal = isAutomationRunTerminal;
|
|
1207
1416
|
exports.isClaudeOpus55Model = isClaudeOpus55Model;
|
|
1208
1417
|
exports.isHarnessInstallId = isHarnessInstallId;
|
|
1209
1418
|
exports.isInsideTeamWorktree = isInsideTeamWorktree;
|
|
1210
1419
|
exports.normalizeAgentKey = normalizeAgentKey;
|
|
1420
|
+
exports.ownerBoardPostToRest = ownerBoardPostToRest;
|
|
1211
1421
|
exports.rebaseTeamWorktreePath = rebaseTeamWorktreePath;
|
|
1212
1422
|
exports.streamKeyOf = streamKeyOf;
|
|
1213
1423
|
exports.supportsClaudeOpus55 = supportsClaudeOpus55;
|