very-happy-cli 0.2.182 → 0.2.183
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-9c-Jeaxd.mjs} +3 -3
- package/dist/{AcpBackend-JA5eu8Y0.cjs → AcpBackend-B-aMuEzO.cjs} +3 -3
- package/dist/{AcpSessionManager-DjYidq4C.cjs → AcpSessionManager-BxXe24AV.cjs} +10 -3
- package/dist/{AcpSessionManager-OrCww-Qv.mjs → AcpSessionManager-CS0FOSQk.mjs} +10 -3
- package/dist/{BasePermissionHandler-u-neo-iN.mjs → BasePermissionHandler-BJ1ID_Br.mjs} +1 -1
- package/dist/{BasePermissionHandler-D3PMKLBS.cjs → BasePermissionHandler-BREjppjP.cjs} +1 -1
- package/dist/{acpSessionResume-u2TwX5Jd.mjs → acpSessionResume-BKtI9Jq_.mjs} +1 -1
- package/dist/{acpSessionResume-Dxo8222T.cjs → acpSessionResume-mVoJ75vI.cjs} +1 -1
- package/dist/{agentHome-D3hNrnoA.mjs → agentHome-B8Ctr_Nu.mjs} +4 -4
- package/dist/{agentHome-CP1tCBXz.cjs → agentHome-rzjm56o4.cjs} +4 -4
- package/dist/{api-C_YSQnsi.mjs → api-C29WLYkW.mjs} +79 -12
- package/dist/{api-CZWcG7uh.cjs → api-xZiqVynF.cjs} +81 -11
- package/dist/{apiMachine-DPGrED5C.cjs → apiMachine-B-FNBIYG.cjs} +14 -14
- package/dist/{apiMachine-C_GA5Bm-.mjs → apiMachine-Dz6Yfk0m.mjs} +14 -14
- package/dist/{attachmentContent-I_dJIevE.cjs → attachmentContent-COV4LF8k.cjs} +2 -2
- package/dist/{attachmentContent-Ckzyb1Uy.mjs → attachmentContent-DwY0uIg6.mjs} +2 -2
- package/dist/{auth-Lw_utSMV.cjs → auth-CYtk9_ga.cjs} +5 -5
- package/dist/{auth-BKnE7uv7.cjs → auth-D_qsnVr3.cjs} +8 -8
- package/dist/{auth-DOXMI-xp.mjs → auth-DvbSDalm.mjs} +8 -8
- package/dist/{auth-CGgpiJ5-.mjs → auth-xT70IYMx.mjs} +5 -5
- package/dist/{auto-CIgFHIyQ.cjs → auto-DT_PfpCx.cjs} +32 -25
- package/dist/{auto-Z56mMZnH.mjs → auto-IiPqvIsN.mjs} +32 -26
- package/dist/{bootstrap-DsXp74wv.cjs → bootstrap-C50NkfPx.cjs} +2 -2
- package/dist/{bootstrap-D3vlOROj.mjs → bootstrap-DS8Acdhm.mjs} +2 -2
- package/dist/{browser-CUxGoATV.mjs → browser-1j9gdZoD.mjs} +1 -1
- package/dist/{browser-CZlA9AkO.cjs → browser-CxKZLd2T.cjs} +1 -1
- package/dist/{claudeLocal-oELvwiZL.cjs → claudeLocal-CgNWpepB.cjs} +5 -5
- package/dist/{claudeLocal-FnTUgwCi.mjs → claudeLocal-U1Fa9sJo.mjs} +5 -5
- package/dist/{claudeLocalLauncher-CO5YHCzi.mjs → claudeLocalLauncher-BjCsfZUE.mjs} +10 -10
- package/dist/{claudeLocalLauncher-QsVXEVdE.cjs → claudeLocalLauncher-IyFm0D6a.cjs} +10 -10
- package/dist/{claudeSessionFork-Cspr6QW0.mjs → claudeSessionFork-6-1vKISn.mjs} +1 -1
- package/dist/{claudeSessionFork-BA4GE5AL.cjs → claudeSessionFork-BUO1XdSm.cjs} +1 -1
- package/dist/{client-xnWiHqdb.cjs → client--vZueZYF.cjs} +4 -4
- package/dist/{client-o-meK7-a.mjs → client-5_zDNdOh.mjs} +2 -2
- package/dist/{client-Ctbw05Xj.mjs → client-BgHvK7lo.mjs} +15 -7
- package/dist/{client-CDuW4MS9.cjs → client-DYGDBD0M.cjs} +15 -7
- package/dist/{client-DK8CzUry.cjs → client-DcKJ0ul_.cjs} +2 -2
- package/dist/{client-BGfmSbWc.mjs → client-DfDyE322.mjs} +4 -4
- package/dist/codex/happyMcpStdioBridge.cjs +16 -16
- package/dist/codex/happyMcpStdioBridge.mjs +16 -16
- package/dist/{codexAppServerClient-DhNDTU_i.cjs → codexAppServerClient-C3nrTfwY.cjs} +3 -3
- package/dist/{codexAppServerClient-BlsOZLul.mjs → codexAppServerClient-DvBg4hGc.mjs} +3 -3
- package/dist/{codexCommand-BGx5NMQR.mjs → codexCommand-Bqp2--g_.mjs} +94 -60
- package/dist/{codexCommand-DJDPfpIs.cjs → codexCommand-DSiU6MNt.cjs} +94 -60
- package/dist/{codexTermination-CqPMuokw.cjs → codexTermination-D9TRTglF.cjs} +1 -1
- package/dist/{codexTermination-CVhhwHZU.mjs → codexTermination-DsliWl_s.mjs} +1 -1
- package/dist/{config-CHpxzXBL.cjs → config-CRhWiOwi.cjs} +3 -3
- package/dist/{config-CWAe08-Q.mjs → config-DeaqRn3o.mjs} +3 -3
- package/dist/{configuration-B-CugKJ3.cjs → configuration-K3I6yOjZ.cjs} +1 -1
- package/dist/{configuration-YXw_Dcsb.mjs → configuration-elzht62L.mjs} +1 -1
- package/dist/{connect-BmHvMXH2.cjs → connect-B5UbfmO3.cjs} +13 -13
- package/dist/{connect-CPeJXHha.mjs → connect-CT5cOlnC.mjs} +13 -13
- package/dist/{context-Drzs_Z38.mjs → context-CLj1_RYF.mjs} +1 -1
- package/dist/{context-BtIVqHI5.cjs → context-DNKNF8Yh.cjs} +1 -1
- package/dist/{controlClient-D0kGwKYx.cjs → controlClient-ChqmxgbB.cjs} +3 -3
- package/dist/{controlClient-BL4hb4l3.mjs → controlClient-CuYQs2aZ.mjs} +3 -3
- package/dist/{createSessionMetadata-DvGDsnsn.mjs → createSessionMetadata-C1MbLQnh.mjs} +2 -2
- package/dist/{createSessionMetadata-L499emJn.cjs → createSessionMetadata-QfiRx4Tf.cjs} +2 -2
- package/dist/daemonSupervisor-57JYYzMf.cjs +268 -0
- package/dist/daemonSupervisor-DfzrtNhM.mjs +245 -0
- package/dist/{defaultPermissionMode-MXpZlXud.cjs → defaultPermissionMode-DQmdZZIg.cjs} +2 -2
- package/dist/{defaultPermissionMode-BLfxu-Yz.mjs → defaultPermissionMode-U9LuUeQh.mjs} +2 -2
- package/dist/{deterministicJson-CfLkBRvU.cjs → deterministicJson-BBRUcB8i.cjs} +569 -17
- package/dist/{deterministicJson-B_UAbmQ4.mjs → deterministicJson-BixlyPWV.mjs} +572 -21
- package/dist/{doctor-DMvlzmnE.cjs → doctor-CKgHUV4W.cjs} +7 -7
- package/dist/{doctor-bKScPtZu.mjs → doctor-Dban2oE2.mjs} +7 -7
- package/dist/{downloadTarget-D33BFvew.cjs → downloadTarget-CmC11Y7E.cjs} +6 -6
- package/dist/{downloadTarget-J9j37eFG.mjs → downloadTarget-VUTd9lEO.mjs} +6 -6
- package/dist/{ensureDaemonRunning-2IqWROJp.cjs → ensureDaemonRunning-L0fl0cLE.cjs} +5 -5
- package/dist/{ensureDaemonRunning-DLvwhpNg.mjs → ensureDaemonRunning-khb8Nr1n.mjs} +5 -5
- package/dist/{handleResumeCommand-CjtjQ_I7.mjs → handleResumeCommand-CLDGWpTJ.mjs} +5 -5
- package/dist/{handleResumeCommand-Dp2Y-p6V.cjs → handleResumeCommand-D9myBN2N.cjs} +5 -5
- package/dist/{index-BOT0Tg5E.mjs → index-BMZx-699.mjs} +4 -4
- package/dist/{index-CZC7egJA.cjs → index-BdJs0465.cjs} +3 -3
- package/dist/{index-BI0h2Zks.mjs → index-BptfFoXM.mjs} +268 -77
- package/dist/{index-DymOv3kK.cjs → index-COSjJPIv.cjs} +4 -4
- package/dist/{index-D_LvOWUN.mjs → index-CtwqBeH6.mjs} +3 -3
- package/dist/{index-DYVIbhAJ.cjs → index-DgA79dVw.cjs} +40 -40
- package/dist/{index-oh8XEozJ.cjs → index-Fq-jxjsB.cjs} +277 -76
- package/dist/{index-Cllzqoes.mjs → index-GkkbUZX-.mjs} +4 -4
- package/dist/{index-kA46KMxN.mjs → index-IRI8s8kz.mjs} +41 -41
- package/dist/{index-B_aNaW9w.cjs → index-y4JNyz9H.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-D0inLCv-.mjs → install-F3rP8tBU.mjs} +2 -2
- package/dist/{install-C46mkr9a.mjs → install-JvCk2PJV.mjs} +3 -3
- package/dist/{install-BAa_Xmof.cjs → install-cn98bTCs.cjs} +3 -3
- 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-Bcs5kRHi.cjs} +1 -1
- package/dist/{lidState-D8Iuvjgl.mjs → lidState-DXeYTsrm.mjs} +1 -1
- package/dist/{localHappyAgentAuth-D3rQDRd9.mjs → localHappyAgentAuth-C1A4ChCR.mjs} +1 -1
- package/dist/{localHappyAgentAuth-SD6GM97y.cjs → localHappyAgentAuth-CypTSe42.cjs} +1 -1
- package/dist/{logger-DK1ytCz6.cjs → logger-Cgwz30rK.cjs} +2 -2
- package/dist/{logger-DpqihN1f.mjs → logger-RMPh5aqe.mjs} +2 -2
- package/dist/{machineMetadata-IJc6_iyx.cjs → machineMetadata-BSOGMNRi.cjs} +3 -3
- package/dist/{machineMetadata-D4E3qoIG.mjs → machineMetadata-BTUtPRth.mjs} +3 -3
- package/dist/{main-DUXh2rgW.cjs → main-4iiwYpCR.cjs} +61 -56
- package/dist/{main-CpUmw7hm.mjs → main-DNDL6t8z.mjs} +61 -56
- package/dist/{mcp-D5f3Vd-z.cjs → mcp-C7eEoGhz.cjs} +15 -15
- package/dist/{mcp-66g1TJ8P.mjs → mcp-DXYDPOpJ.mjs} +15 -15
- package/dist/{mirrorProtocol-bsCUcaCY.mjs → mirrorProtocol-DQRy5PaT.mjs} +3 -3
- package/dist/{mirrorProtocol-DkWOcZh9.cjs → mirrorProtocol-c5g5MgNc.cjs} +3 -3
- package/dist/{package-BfeqAzyJ.cjs → package-3aPiSpZj.cjs} +7 -7
- package/dist/{package-CKj8zndE.mjs → package-CTrz6U3C.mjs} +7 -7
- package/dist/{panels-r8LmaBs6.mjs → panels-B5sZ84vA.mjs} +5 -5
- package/dist/{panels-2PXsw9-d.cjs → panels-BmsmKHbw.cjs} +5 -5
- package/dist/{peerTools-D_id4d41.mjs → peerTools-DIPOX033.mjs} +5 -5
- package/dist/{peerTools-BVp1z0T_.cjs → peerTools-Dxe7iCi_.cjs} +5 -5
- package/dist/{persistence-BdpwWXKh.cjs → persistence-DZRMUZZS.cjs} +2 -2
- package/dist/{persistence-jOEuAFTS.mjs → persistence-zJo4r7YI.mjs} +2 -2
- package/dist/{piRunnerArgs-vxCHKnSA.cjs → piRunnerArgs-BSPiS6tZ.cjs} +1 -1
- package/dist/{piRunnerArgs-68I5F_M1.mjs → piRunnerArgs-IVdoHUB6.mjs} +1 -1
- package/dist/{piRuntime-C3Dg5uni.cjs → piRuntime-BJzjlMcN.cjs} +2 -2
- package/dist/{piRuntime-DgLIard1.mjs → piRuntime-BvHO3vgO.mjs} +2 -2
- package/dist/{piTerminal-C135BcLP.cjs → piTerminal-Cz4pW55d.cjs} +18 -18
- package/dist/{piTerminal-DJL0w-uA.mjs → piTerminal-D7vBOpkE.mjs} +18 -18
- package/dist/{pushNotifications-CMmRsbKv.mjs → pushNotifications-C4R9-1hU.mjs} +3 -3
- package/dist/{pushNotifications-CyQVDThC.cjs → pushNotifications-CgIrYml3.cjs} +3 -3
- package/dist/{query-CK--1fbL.cjs → query-CZQG1PdU.cjs} +1 -1
- package/dist/{query-CPXnDURZ.mjs → query-DKPmDsHS.mjs} +1 -1
- package/dist/{rateLimitWindows-DJxnNw-X.cjs → rateLimitWindows-CPV0nLeq.cjs} +1 -1
- package/dist/{rateLimitWindows-Cqa4AGaB.mjs → rateLimitWindows-HlHATOQ0.mjs} +1 -1
- package/dist/{registerCommonHandlers-DbNoM39q.cjs → registerCommonHandlers-D1pC83Op.cjs} +2 -2
- package/dist/{registerCommonHandlers-K8dICQO2.mjs → registerCommonHandlers-a9lHojSV.mjs} +2 -2
- package/dist/{registerKillSessionHandler-O1iriOMO.mjs → registerKillSessionHandler-Bp-fuH-w.mjs} +6 -6
- package/dist/{registerKillSessionHandler-DiS_go8d.cjs → registerKillSessionHandler-nTi2vVJy.cjs} +6 -6
- package/dist/{remoteSessionClient-BlURPulk.mjs → remoteSessionClient-Cwrddscy.mjs} +5 -5
- package/dist/{remoteSessionClient-CtV9mDko.cjs → remoteSessionClient-HQAKAvVd.cjs} +5 -5
- package/dist/{reportProgressTool-DlD_xjzU.cjs → reportProgressTool-Be-8ADI4.cjs} +4 -4
- package/dist/{reportProgressTool-nCExrHZH.mjs → reportProgressTool-CcZ32nrd.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-BBU8GyxE.mjs} +59 -243
- package/dist/{run-BBNrcCfI.cjs → run-CxRJk9qq.cjs} +69 -254
- package/dist/{runClaude-CFp27Tyi.mjs → runClaude-DR6pEQwd.mjs} +22 -22
- package/dist/{runClaude-B3KSeby4.cjs → runClaude-Dd5zJaUZ.cjs} +22 -22
- package/dist/{runClaudeDeps-DMcv93lA.mjs → runClaudeDeps-COgZaUZm.mjs} +50 -45
- package/dist/{runClaudeDeps-C_C9TCI0.cjs → runClaudeDeps-CTtZ_1mC.cjs} +45 -40
- package/dist/{runGemini-Bc6SY-hd.mjs → runGemini-DVoVUfPp.mjs} +37 -35
- package/dist/{runGemini-DzdSBAr9.cjs → runGemini-DX72qB92.cjs} +37 -35
- package/dist/{runOpenClaw-DI0qMlgF.mjs → runOpenClaw-BHjzmzeC.mjs} +18 -18
- package/dist/{runOpenClaw-DN6rEVqC.cjs → runOpenClaw-BSg4hFVt.cjs} +18 -18
- package/dist/{sandbox-v-ffe8LR.mjs → sandbox-CWR9EqoN.mjs} +4 -4
- package/dist/{sandbox-DtttPBMA.cjs → sandbox-D1T_hmgZ.cjs} +4 -4
- package/dist/{selfCheck-B-yy6bW3.cjs → selfCheck-CE7vlnNS.cjs} +36 -36
- package/dist/selfCheck-ZGgBtxFQ.mjs +85 -0
- package/dist/{send-DpBwSZuj.mjs → send-BDF0Zvxo.mjs} +8 -8
- package/dist/{send-ShzXYPRu.cjs → send-BxZqRCcG.cjs} +8 -8
- package/dist/{server-DScgJXxa.mjs → server-B4JtnDLF.mjs} +4 -4
- package/dist/{server-CEzKrfKj.cjs → server-DB7_70Mi.cjs} +6 -6
- package/dist/{sessionLock-Dc0fadGG.cjs → sessionLock-BXvFN6uw.cjs} +3 -3
- package/dist/{sessionLock-B6K4SBZD.mjs → sessionLock-CXOOX-VD.mjs} +3 -3
- package/dist/{sessionOps-Dx7wARjI.cjs → sessionOps-BWlDlFYP.cjs} +4 -4
- package/dist/{sessionOps-D0BPWPoh.mjs → sessionOps-ByVggB_q.mjs} +4 -4
- package/dist/{sessionScanner-BJ35TVG6.cjs → sessionScanner-DkxPB5VA.cjs} +3 -3
- package/dist/{sessionScanner-9Fpgaxtf.mjs → sessionScanner-r66RtF95.mjs} +3 -3
- package/dist/{sessions-TZGGAry1.cjs → sessions-BiJTxFy9.cjs} +10 -10
- package/dist/{sessions-CFtDlyZd.mjs → sessions-C1lLK_a9.mjs} +10 -10
- package/dist/{setupOfflineReconnection-Biaus-0T.mjs → setupOfflineReconnection-Bl3DuakT.mjs} +2 -2
- package/dist/{setupOfflineReconnection-B1GsVA8P.cjs → setupOfflineReconnection-CecTiFZ-.cjs} +2 -2
- package/dist/{spawn-CsoQ-Ecz.mjs → spawn-D-8MlEM6.mjs} +14 -14
- package/dist/{spawn-BRTuypQ2.cjs → spawn-D79mVa3h.cjs} +14 -14
- package/dist/{spawnAgents-Co-SLcx-.mjs → spawnAgents-DJHjq01u.mjs} +1 -1
- package/dist/{spawnAgents-CG211IW7.cjs → spawnAgents-Sfnf-4pN.cjs} +1 -1
- package/dist/{spawnHappyCLI-D47kX6jg.cjs → spawnHappyCLI-CQwQs9G5.cjs} +1 -1
- package/dist/{spawnHappyCLI-D1doCjkZ.mjs → spawnHappyCLI-v_bJwZ4Z.mjs} +1 -1
- package/dist/{specialCommands-Ch-Gvy-i.cjs → specialCommands-CWMVfT5s.cjs} +3 -3
- package/dist/{specialCommands-xSmqT_Fu.mjs → specialCommands-yMnFvS-W.mjs} +3 -3
- package/dist/{startFileWatcher-CCl2fFxT.mjs → startFileWatcher-BCDkT_tr.mjs} +1 -1
- package/dist/{startFileWatcher-gKQTstR6.cjs → startFileWatcher-GW4_E7dV.cjs} +1 -1
- package/dist/{startupSessionCreate-DlZc8yPl.mjs → startupSessionCreate-BcAGYo51.mjs} +1 -1
- package/dist/{startupSessionCreate-BXqoUX30.cjs → startupSessionCreate-tBRa_ze8.cjs} +1 -1
- package/dist/{streamRelay-DnJXsi36.mjs → streamRelay-BEDiy6_b.mjs} +1 -1
- package/dist/{streamRelay-B-J-4St1.cjs → streamRelay-BZ8drtof.cjs} +1 -1
- package/dist/{sync-BbjMC3sR.mjs → sync--QUIOuf8.mjs} +1 -1
- package/dist/{sync-BxMdnZzz.cjs → sync-BMDkyo75.cjs} +1 -1
- package/dist/{systemPrompt-C2KojRmK.cjs → systemPrompt-DoHSXrH0.cjs} +2 -2
- package/dist/{systemPrompt-CmSDAoIx.mjs → systemPrompt-O0Kd6vbA.mjs} +2 -2
- package/dist/{teams-DESdalox.cjs → teams-BkZop-sP.cjs} +9 -9
- package/dist/{teams-lRy1MS0Z.mjs → teams-CTF1gT48.mjs} +9 -9
- package/dist/{template-BaHAmH2K.cjs → template-CeC1dYe-.cjs} +32 -2
- package/dist/{template-CiOPa2rd.mjs → template-D1fm22em.mjs} +31 -3
- package/dist/{time-Cfknl7xG.mjs → time-B2KKdAym.mjs} +1 -1
- package/dist/{time-DNLeIRgR.cjs → time-CdCotzKU.cjs} +1 -1
- package/dist/{titleGenerator-ClnMSzwC.mjs → titleGenerator-BFDczskR.mjs} +1 -1
- package/dist/{titleGenerator-YNutaU88.cjs → titleGenerator-DZH1XqAf.cjs} +2 -2
- package/dist/{todo-DZbK5POc.mjs → todo-C2gyOUom.mjs} +6 -6
- package/dist/{todo-DS75Mboz.cjs → todo-DnTFTHmV.cjs} +6 -6
- package/dist/{tools-ClYcb1YQ.cjs → tools-C8rpwyIl.cjs} +1 -1
- package/dist/{tools-BgdU0dWp.mjs → tools-DUjkqSQL.mjs} +1 -1
- package/dist/{uninstall-bXenFevR.mjs → uninstall-B5Ew50mZ.mjs} +3 -3
- package/dist/{uninstall-Di1vPBLV.cjs → uninstall-CKMPWTMv.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,40 @@ 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({ type: z.z.literal("fail-operation"), operationId: id$
|
|
480
|
-
z.z.object({ type: z.z.literal("session-event"), sessionId: id$
|
|
481
|
-
z.z.object({ type: z.z.literal("message-delivered"), messageId: id$
|
|
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({ type: z.z.literal("fail-operation"), operationId: id$3, machineId: id$3, claimId: id$3, error: text$1, unknown: z.z.boolean().optional() }),
|
|
480
|
+
z.z.object({ type: z.z.literal("session-event"), sessionId: id$3, event: z.z.enum(["idle", "blocked", "exited"]) }),
|
|
481
|
+
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
482
|
]);
|
|
483
|
-
z.z.object({ requestId: id$
|
|
483
|
+
z.z.object({ requestId: id$3, action: TeamActionSchema });
|
|
484
484
|
const TeamProjectChoiceSchema = z.z.object({
|
|
485
|
-
projectId: id$
|
|
486
|
-
inheritFromSessionId: id$
|
|
485
|
+
projectId: id$3.optional(),
|
|
486
|
+
inheritFromSessionId: id$3.optional(),
|
|
487
487
|
create: z.z.boolean().optional(),
|
|
488
488
|
directory: z.z.string().min(1).max(4096).optional()
|
|
489
489
|
});
|
|
490
|
-
z.z.object({ name: id$
|
|
490
|
+
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
491
|
z.z.object({
|
|
492
|
-
projectId: id$
|
|
492
|
+
projectId: id$3.nullable().optional(),
|
|
493
493
|
create: z.z.boolean().optional(),
|
|
494
|
-
requestId: id$
|
|
494
|
+
requestId: id$3.optional()
|
|
495
495
|
}).refine((v) => v.projectId !== void 0 !== (v.create === true), "exactly one of projectId / create");
|
|
496
496
|
const TEAM_WORKTREE = /\/teams\/worktrees\/([^/]+)(?:\/|$)/;
|
|
497
497
|
function teamWorktreeId(path) {
|
|
@@ -508,7 +508,7 @@ function rebaseTeamWorktreePath(path, repository) {
|
|
|
508
508
|
const rest = normalized.slice(match.index + match[0].length).replace(/\/+$/, "");
|
|
509
509
|
return rest ? `${repository.replace(/\/+$/, "")}/${rest}` : repository;
|
|
510
510
|
}
|
|
511
|
-
const id$
|
|
511
|
+
const id$2 = z.z.string().min(1).max(128);
|
|
512
512
|
const text = z.z.string().min(1).max(32e3);
|
|
513
513
|
const AUTOMATION_NAME_PATTERN = /^[a-z0-9][a-z0-9-_.]{0,63}$/;
|
|
514
514
|
const AutomationNameSchema = z.z.string().regex(AUTOMATION_NAME_PATTERN, "automation name must match [a-z0-9][a-z0-9-_.]{0,63}");
|
|
@@ -517,6 +517,7 @@ const AUTOMATION_MAX_INTERVAL_MS = 366 * 864e5;
|
|
|
517
517
|
const AUTOMATION_MAX_TIMESTAMP = 864e13;
|
|
518
518
|
const AUTOMATION_PAYLOAD_MAX_BYTES = 65536;
|
|
519
519
|
const AUTOMATION_SUMMARY_MAX_CHARS = 4096;
|
|
520
|
+
const AUTOMATION_ATTENTION_REASON_MAX_CHARS = 512;
|
|
520
521
|
const AUTOMATION_DEFAULT_LEASE_MS = 6e4;
|
|
521
522
|
const AUTOMATION_CLAIM_MAX_RUNS = 8;
|
|
522
523
|
const AUTOMATION_PRECHECK_DEFAULT_TIMEOUT_MS = 6e4;
|
|
@@ -547,7 +548,7 @@ const AutomationActionSchema = z.z.discriminatedUnion("kind", [
|
|
|
547
548
|
worktree: z.z.boolean().optional(),
|
|
548
549
|
sticky: AutomationStickySchema.optional()
|
|
549
550
|
}),
|
|
550
|
-
z.z.object({ kind: z.z.literal("send"), sessionId: id$
|
|
551
|
+
z.z.object({ kind: z.z.literal("send"), sessionId: id$2, prompt: text }),
|
|
551
552
|
z.z.object({
|
|
552
553
|
kind: z.z.literal("script"),
|
|
553
554
|
command: z.z.array(z.z.string().min(1).max(4096)).min(1).max(256),
|
|
@@ -573,7 +574,7 @@ const maxRuntimeMs = z.z.number().int().min(6e4).max(7 * 864e5);
|
|
|
573
574
|
z.z.object({
|
|
574
575
|
name: AutomationNameSchema,
|
|
575
576
|
description: z.z.string().max(4e3).nullable().optional(),
|
|
576
|
-
machineId: id$
|
|
577
|
+
machineId: id$2,
|
|
577
578
|
trigger: AutomationTriggerSchema,
|
|
578
579
|
action: AutomationActionSchema,
|
|
579
580
|
concurrency: AutomationConcurrencySchema.optional(),
|
|
@@ -582,13 +583,13 @@ z.z.object({
|
|
|
582
583
|
/** B-548. Older servers strip it silently — clients must check the response echoes `precheck`. */
|
|
583
584
|
precheck: AutomationPrecheckSchema.nullable().optional(),
|
|
584
585
|
/** B-644: sessions this automation spawns join this project (quiet variant). Older servers strip it — check the echo. */
|
|
585
|
-
projectId: id$
|
|
586
|
+
projectId: id$2.nullable().optional()
|
|
586
587
|
});
|
|
587
588
|
z.z.object({
|
|
588
589
|
version: z.z.number().int().positive(),
|
|
589
590
|
name: AutomationNameSchema.optional(),
|
|
590
591
|
description: z.z.string().max(4e3).nullable().optional(),
|
|
591
|
-
machineId: id$
|
|
592
|
+
machineId: id$2.optional(),
|
|
592
593
|
trigger: AutomationTriggerSchema.optional(),
|
|
593
594
|
action: AutomationActionSchema.optional(),
|
|
594
595
|
concurrency: AutomationConcurrencySchema.optional(),
|
|
@@ -596,41 +597,41 @@ z.z.object({
|
|
|
596
597
|
/** B-548: omitted keeps the current precheck, `null` removes it. Changing `action` alone keeps it too. */
|
|
597
598
|
precheck: AutomationPrecheckSchema.nullable().optional(),
|
|
598
599
|
/** B-644: omitted keeps the current project, `null` detaches. */
|
|
599
|
-
projectId: id$
|
|
600
|
+
projectId: id$2.nullable().optional()
|
|
600
601
|
});
|
|
601
602
|
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
603
|
z.z.object({ payload: payload.optional(), dedupeKey: z.z.string().min(1).max(256).optional() });
|
|
603
604
|
z.z.object({ payload: payload.optional() });
|
|
604
605
|
z.z.object({
|
|
605
|
-
machineId: id$
|
|
606
|
+
machineId: id$2,
|
|
606
607
|
limit: z.z.number().int().min(1).max(AUTOMATION_CLAIM_MAX_RUNS).optional(),
|
|
607
608
|
leaseMs: z.z.number().int().min(5e3).max(36e5).optional(),
|
|
608
609
|
/** B-548: what this daemon can execute (e.g. `precheck`). Older daemons send nothing; older servers strip it. */
|
|
609
610
|
capabilities: z.z.array(z.z.string().min(1).max(64)).max(32).optional()
|
|
610
611
|
});
|
|
611
612
|
z.z.object({
|
|
612
|
-
claimId: id$
|
|
613
|
+
claimId: id$2.optional(),
|
|
613
614
|
status: z.z.enum(["running", "done", "failed", "skipped"]).optional(),
|
|
614
|
-
sessionId: id$
|
|
615
|
+
sessionId: id$2.nullable().optional(),
|
|
615
616
|
stickyKey: z.z.string().min(1).max(512).optional(),
|
|
616
617
|
summary: z.z.string().max(AUTOMATION_SUMMARY_MAX_CHARS).nullable().optional(),
|
|
617
618
|
error: z.z.string().max(AUTOMATION_SUMMARY_MAX_CHARS).nullable().optional(),
|
|
618
619
|
exitCode: z.z.number().int().nullable().optional(),
|
|
619
620
|
needsAttention: z.z.boolean().optional(),
|
|
620
|
-
attentionReason: z.z.string().max(
|
|
621
|
+
attentionReason: z.z.string().max(AUTOMATION_ATTENTION_REASON_MAX_CHARS).nullable().optional(),
|
|
621
622
|
leaseMs: z.z.number().int().min(5e3).max(36e5).optional()
|
|
622
623
|
});
|
|
623
624
|
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$
|
|
625
|
+
z.z.object({ key: z.z.string().min(1).max(512), sessionId: id$2 });
|
|
625
626
|
z.z.object({ key: z.z.string().min(1).max(512) });
|
|
626
627
|
z.z.object({
|
|
627
|
-
automationId: id$
|
|
628
|
+
automationId: id$2.optional(),
|
|
628
629
|
name: AutomationNameSchema.optional(),
|
|
629
630
|
status: z.z.string().min(1).max(64).optional(),
|
|
630
631
|
attention: z.z.enum(["1", "true", "0", "false"]).optional(),
|
|
631
632
|
limit: z.z.coerce.number().int().min(1).max(200).optional()
|
|
632
633
|
});
|
|
633
|
-
z.z.object({ machineId: id$
|
|
634
|
+
z.z.object({ machineId: id$2.optional() });
|
|
634
635
|
const PROJECT_SESSION_CAPABILITY = "project-v1";
|
|
635
636
|
const PROJECT_LIMITS = {
|
|
636
637
|
nameChars: 120,
|
|
@@ -642,11 +643,11 @@ const PROJECT_LIMITS = {
|
|
|
642
643
|
messageBytes: 64 * 1024,
|
|
643
644
|
presenceBatch: 200,
|
|
644
645
|
memberBatch: 200};
|
|
645
|
-
const id = z.z.string().min(1).max(128);
|
|
646
|
+
const id$1 = z.z.string().min(1).max(128);
|
|
646
647
|
const utf8Bytes = (value) => new TextEncoder().encode(value).length;
|
|
647
648
|
const boundedText = (maxBytes) => z.z.string().max(maxBytes).refine((v) => utf8Bytes(v) <= maxBytes, `exceeds ${maxBytes} bytes`);
|
|
648
649
|
const ProjectFolderSchema = z.z.object({
|
|
649
|
-
machineId: id,
|
|
650
|
+
machineId: id$1,
|
|
650
651
|
path: z.z.string().min(1).max(4096),
|
|
651
652
|
primary: z.z.boolean().optional()
|
|
652
653
|
});
|
|
@@ -666,9 +667,9 @@ z.z.object({
|
|
|
666
667
|
folders: z.z.array(ProjectFolderSchema).max(PROJECT_LIMITS.folders).optional(),
|
|
667
668
|
defaults: ProjectDefaultsSchema.optional(),
|
|
668
669
|
/** Idempotency: the same requestId returns the project it created. */
|
|
669
|
-
requestId: id.optional(),
|
|
670
|
+
requestId: id$1.optional(),
|
|
670
671
|
/** Optional initial members (e.g. "设为项目" moves a folder's sessions in one step). */
|
|
671
|
-
sessionIds: z.z.array(id).max(PROJECT_LIMITS.memberBatch).optional()
|
|
672
|
+
sessionIds: z.z.array(id$1).max(PROJECT_LIMITS.memberBatch).optional()
|
|
672
673
|
});
|
|
673
674
|
z.z.object({
|
|
674
675
|
name: z.z.string().trim().min(1).max(PROJECT_LIMITS.nameChars).optional(),
|
|
@@ -684,7 +685,7 @@ z.z.object({
|
|
|
684
685
|
summary: z.z.string().max(200).optional()
|
|
685
686
|
});
|
|
686
687
|
z.z.object({
|
|
687
|
-
sessionIds: z.z.array(id).min(1).max(PROJECT_LIMITS.memberBatch),
|
|
688
|
+
sessionIds: z.z.array(id$1).min(1).max(PROJECT_LIMITS.memberBatch),
|
|
688
689
|
via: ProjectMemberViaInputSchema.optional()
|
|
689
690
|
});
|
|
690
691
|
z.z.object({
|
|
@@ -694,15 +695,15 @@ z.z.object({
|
|
|
694
695
|
/** Entry id (or `#seq`) this entry replaces. */
|
|
695
696
|
supersedes: z.z.string().min(1).max(128).optional(),
|
|
696
697
|
/** Stamped by the wrapper (the agent cannot fill it). Absent = written by the user. */
|
|
697
|
-
authorSessionId: id.optional()
|
|
698
|
+
authorSessionId: id$1.optional()
|
|
698
699
|
});
|
|
699
700
|
z.z.object({
|
|
700
701
|
/** When set, only entries this session authored may be revoked. Absent = the owner. */
|
|
701
|
-
bySessionId: id.optional()
|
|
702
|
+
bySessionId: id$1.optional()
|
|
702
703
|
});
|
|
703
|
-
z.z.object({ teamId: id });
|
|
704
|
+
z.z.object({ teamId: id$1 });
|
|
704
705
|
const ProjectPresenceEntrySchema = z.z.object({
|
|
705
|
-
sessionId: id,
|
|
706
|
+
sessionId: id$1,
|
|
706
707
|
title: z.z.string().max(200).nullable().optional(),
|
|
707
708
|
agent: z.z.string().max(64).nullable().optional(),
|
|
708
709
|
machine: z.z.string().max(200).nullable().optional(),
|
|
@@ -714,19 +715,19 @@ const ProjectPresenceEntrySchema = z.z.object({
|
|
|
714
715
|
capabilities: z.z.array(z.z.string().max(64)).max(32).optional()
|
|
715
716
|
});
|
|
716
717
|
z.z.object({
|
|
717
|
-
machineId: id,
|
|
718
|
+
machineId: id$1,
|
|
718
719
|
sessions: z.z.array(ProjectPresenceEntrySchema).max(PROJECT_LIMITS.presenceBatch),
|
|
719
720
|
/** Sessions of this machine that stopped; their presence rows are marked `offline`. */
|
|
720
|
-
gone: z.z.array(id).max(PROJECT_LIMITS.presenceBatch).optional()
|
|
721
|
+
gone: z.z.array(id$1).max(PROJECT_LIMITS.presenceBatch).optional()
|
|
721
722
|
});
|
|
722
723
|
z.z.object({
|
|
723
|
-
fromSessionId: id,
|
|
724
|
-
toSessionId: id,
|
|
724
|
+
fromSessionId: id$1,
|
|
725
|
+
toSessionId: id$1,
|
|
725
726
|
body: boundedText(PROJECT_LIMITS.messageBytes).pipe(z.z.string().min(1))
|
|
726
727
|
});
|
|
727
728
|
z.z.object({
|
|
728
|
-
sessionId: id,
|
|
729
|
-
messageIds: z.z.array(id).min(1).max(100)
|
|
729
|
+
sessionId: id$1,
|
|
730
|
+
messageIds: z.z.array(id$1).min(1).max(100)
|
|
730
731
|
});
|
|
731
732
|
z.z.object({
|
|
732
733
|
full: z.z.enum(["0", "1", "true", "false"]).optional(),
|
|
@@ -765,9 +766,9 @@ function object(value) {
|
|
|
765
766
|
function stamp(value) {
|
|
766
767
|
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
767
768
|
}
|
|
768
|
-
function parseBuiltinTodo(raw,
|
|
769
|
+
function parseBuiltinTodo(raw, key2) {
|
|
769
770
|
if (!object(raw) || raw.schemaVersion !== 1 || typeof raw.id !== "string" || !UUID.test(raw.id)) return null;
|
|
770
|
-
if (
|
|
771
|
+
if (key2 !== void 0 && key2 !== BUILTIN_TODO_PREFIX + raw.id) return null;
|
|
771
772
|
if (typeof raw.title !== "string" || !raw.title.trim() || raw.title.length > TITLE_MAX_LENGTH) return null;
|
|
772
773
|
if (typeof raw.note !== "string" || raw.note.length > NOTE_MAX_LENGTH) return null;
|
|
773
774
|
if (raw.status !== "open" && raw.status !== "done") return null;
|
|
@@ -792,11 +793,11 @@ function encodeBuiltinTodo(todo) {
|
|
|
792
793
|
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
793
794
|
return btoa(binary);
|
|
794
795
|
}
|
|
795
|
-
function decodeBuiltinTodo(value,
|
|
796
|
+
function decodeBuiltinTodo(value, key2) {
|
|
796
797
|
try {
|
|
797
798
|
const binary = atob(value);
|
|
798
799
|
const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
799
|
-
return parseBuiltinTodo(JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)),
|
|
800
|
+
return parseBuiltinTodo(JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)), key2);
|
|
800
801
|
} catch {
|
|
801
802
|
return null;
|
|
802
803
|
}
|
|
@@ -804,12 +805,12 @@ function decodeBuiltinTodo(value, key) {
|
|
|
804
805
|
function sortBuiltinTodos(records) {
|
|
805
806
|
return [...records].sort((a, b) => a.order - b.order || a.id.localeCompare(b.id));
|
|
806
807
|
}
|
|
807
|
-
function createBuiltinTodoClient(credentials,
|
|
808
|
-
const serverUrl =
|
|
808
|
+
function createBuiltinTodoClient(credentials, options2) {
|
|
809
|
+
const serverUrl = options2.serverUrl.replace(/\/$/, "");
|
|
809
810
|
const token = credentials.token;
|
|
810
|
-
const clientId =
|
|
811
|
-
const fetcher =
|
|
812
|
-
const timeoutMs =
|
|
811
|
+
const clientId = options2.clientId;
|
|
812
|
+
const fetcher = options2.fetch ?? globalThis.fetch.bind(globalThis);
|
|
813
|
+
const timeoutMs = options2.timeoutMs ?? 15e3;
|
|
813
814
|
async function request(path, mutations, allowNotFound = false) {
|
|
814
815
|
const controller = new AbortController();
|
|
815
816
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
@@ -888,19 +889,19 @@ function createBuiltinTodoClient(credentials, options) {
|
|
|
888
889
|
const pendingCreates = /* @__PURE__ */ new Map();
|
|
889
890
|
async function get(id2) {
|
|
890
891
|
if (!UUID.test(id2)) throw new BuiltinTodoError("validation", "Invalid Todo ID");
|
|
891
|
-
const
|
|
892
|
-
const raw = await request(`/v1/kv/${encodeURIComponent(
|
|
892
|
+
const key2 = BUILTIN_TODO_PREFIX + id2;
|
|
893
|
+
const raw = await request(`/v1/kv/${encodeURIComponent(key2)}`, void 0, true);
|
|
893
894
|
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 !==
|
|
895
|
+
const todo = object(raw) && typeof raw.value === "string" ? decodeBuiltinTodo(raw.value, key2) : null;
|
|
896
|
+
if (!todo || !object(raw) || raw.key !== key2 || !Number.isSafeInteger(raw.version) || raw.version < 0) {
|
|
896
897
|
throw new BuiltinTodoError("invalid-response", "Invalid Todo read response");
|
|
897
898
|
}
|
|
898
899
|
return { ...todo, version: raw.version };
|
|
899
900
|
}
|
|
900
|
-
async function create(
|
|
901
|
-
const cleanTitle =
|
|
901
|
+
async function create(title2, note2 = "", id2) {
|
|
902
|
+
const cleanTitle = title2.trim();
|
|
902
903
|
if (id2 !== void 0 && !UUID.test(id2)) throw new BuiltinTodoError("validation", "Invalid Todo ID");
|
|
903
|
-
const payloadKey = JSON.stringify([cleanTitle,
|
|
904
|
+
const payloadKey = JSON.stringify([cleanTitle, note2, id2]);
|
|
904
905
|
let pending = pendingCreates.get(payloadKey);
|
|
905
906
|
if (pending?.operation) return pending.operation;
|
|
906
907
|
if (!pending) {
|
|
@@ -909,7 +910,7 @@ function createBuiltinTodoClient(credentials, options) {
|
|
|
909
910
|
schemaVersion: 1,
|
|
910
911
|
id: id2 ?? crypto.randomUUID(),
|
|
911
912
|
title: cleanTitle,
|
|
912
|
-
note,
|
|
913
|
+
note: note2,
|
|
913
914
|
status: "open",
|
|
914
915
|
order: 0,
|
|
915
916
|
createdAt: now,
|
|
@@ -922,14 +923,14 @@ function createBuiltinTodoClient(credentials, options) {
|
|
|
922
923
|
const entry = pending;
|
|
923
924
|
const operation = (async () => {
|
|
924
925
|
if (entry.attempted) {
|
|
925
|
-
const
|
|
926
|
-
const existing = await request(`/v1/kv/${encodeURIComponent(
|
|
926
|
+
const key2 = BUILTIN_TODO_PREFIX + entry.draft.id;
|
|
927
|
+
const existing = await request(`/v1/kv/${encodeURIComponent(key2)}`, void 0, true);
|
|
927
928
|
if (existing !== void 0) {
|
|
928
|
-
const todo = object(existing) && typeof existing.value === "string" ? decodeBuiltinTodo(existing.value,
|
|
929
|
-
if (!todo || !object(existing) || existing.key !==
|
|
929
|
+
const todo = object(existing) && typeof existing.value === "string" ? decodeBuiltinTodo(existing.value, key2) : null;
|
|
930
|
+
if (!todo || !object(existing) || existing.key !== key2 || !Number.isSafeInteger(existing.version) || existing.version < 0) {
|
|
930
931
|
throw new BuiltinTodoError("invalid-response", "Cannot confirm the previous Todo creation");
|
|
931
932
|
}
|
|
932
|
-
if (id2 && (todo.title !== cleanTitle || todo.note !==
|
|
933
|
+
if (id2 && (todo.title !== cleanTitle || todo.note !== note2)) throw new BuiltinTodoError("conflict", "This Todo ID already has different content; read it before deciding");
|
|
933
934
|
return { ...todo, version: existing.version };
|
|
934
935
|
}
|
|
935
936
|
}
|
|
@@ -1172,8 +1173,202 @@ const ServerMigrateNoticeSchema = z.z.object({
|
|
|
1172
1173
|
handoff: z.z.string().regex(/^vh1\.[A-Za-z0-9_-]{16,2048}\.[A-Za-z0-9_-]{43}$/),
|
|
1173
1174
|
issuedAt: z.z.number().int().positive()
|
|
1174
1175
|
});
|
|
1176
|
+
const ATTENTION_SESSION_CAPABILITY = "owner-board-v1";
|
|
1177
|
+
const ATTENTION_DISABLED_ERROR = "owner_board_disabled";
|
|
1178
|
+
const ATTENTION_LIMITS = {
|
|
1179
|
+
titleChars: 120,
|
|
1180
|
+
bodyBytes: 8 * 1024,
|
|
1181
|
+
keyChars: 256,
|
|
1182
|
+
options: { min: 2, max: 4 },
|
|
1183
|
+
optionIdChars: 16,
|
|
1184
|
+
optionLabelChars: 120,
|
|
1185
|
+
optionDetailChars: 1e3,
|
|
1186
|
+
links: 16,
|
|
1187
|
+
linkRefChars: 2048,
|
|
1188
|
+
linkLabelChars: 120,
|
|
1189
|
+
snippetChars: 200,
|
|
1190
|
+
noteChars: 2e3,
|
|
1191
|
+
listMax: 200,
|
|
1192
|
+
/** Open `needsOwner` items per session before the playbook asks the lead to merge or drop stale ones (§5.1 rule 6). */
|
|
1193
|
+
openPerSessionSoftCap: 5
|
|
1194
|
+
};
|
|
1195
|
+
const ATTENTION_SOURCES = ["lead", "agent", "owner", "automation", "team"];
|
|
1196
|
+
const ATTENTION_KINDS = ["decision", "todo", "blocked", "report", "answer", "question", "request", "pin"];
|
|
1197
|
+
const OWNER_BOARD_POST_KINDS = ["decision", "todo", "report", "answer"];
|
|
1198
|
+
const OWNER_BOARD_RESOLVE_OUTCOMES = ["done", "answered", "dropped", "superseded"];
|
|
1199
|
+
const ATTENTION_BOARD_LOCAL_ID_PREFIX = "board-";
|
|
1200
|
+
function isAttentionBoardLocalId(localId) {
|
|
1201
|
+
return typeof localId === "string" && localId.startsWith(ATTENTION_BOARD_LOCAL_ID_PREFIX);
|
|
1202
|
+
}
|
|
1203
|
+
const id = z.z.string().min(1).max(128);
|
|
1204
|
+
const title = z.z.string().trim().min(1).max(ATTENTION_LIMITS.titleChars);
|
|
1205
|
+
const bodyMd = z.z.string().max(ATTENTION_LIMITS.bodyBytes * 4).refine((v) => new TextEncoder().encode(v).length <= ATTENTION_LIMITS.bodyBytes, "body exceeds 8KB");
|
|
1206
|
+
const note = z.z.string().max(ATTENTION_LIMITS.noteChars);
|
|
1207
|
+
const requestId = z.z.string().min(1).max(128);
|
|
1208
|
+
const key = z.z.string().min(1).max(ATTENTION_LIMITS.keyChars);
|
|
1209
|
+
const AttentionOptionSchema = z.z.object({
|
|
1210
|
+
id: z.z.string().trim().min(1).max(ATTENTION_LIMITS.optionIdChars),
|
|
1211
|
+
label: z.z.string().trim().min(1).max(ATTENTION_LIMITS.optionLabelChars),
|
|
1212
|
+
detail: z.z.string().max(ATTENTION_LIMITS.optionDetailChars).optional(),
|
|
1213
|
+
recommended: z.z.boolean().optional()
|
|
1214
|
+
});
|
|
1215
|
+
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");
|
|
1216
|
+
const ATTENTION_LINK_TYPES = ["task", "pr", "commit", "url", "panel"];
|
|
1217
|
+
const AttentionLinkSchema = z.z.object({
|
|
1218
|
+
type: z.z.enum(ATTENTION_LINK_TYPES),
|
|
1219
|
+
ref: z.z.string().trim().min(1).max(ATTENTION_LIMITS.linkRefChars),
|
|
1220
|
+
label: z.z.string().max(ATTENTION_LIMITS.linkLabelChars).optional()
|
|
1221
|
+
});
|
|
1222
|
+
const links = z.z.array(AttentionLinkSchema).max(ATTENTION_LIMITS.links);
|
|
1223
|
+
const AttentionAnchorSchema = z.z.object({
|
|
1224
|
+
localId: z.z.string().min(1).max(256).optional(),
|
|
1225
|
+
messageId: z.z.string().min(1).max(128).optional(),
|
|
1226
|
+
snippet: z.z.string().max(ATTENTION_LIMITS.snippetChars).optional()
|
|
1227
|
+
}).refine((a) => a.localId !== void 0 || a.messageId !== void 0, "anchor needs localId or messageId");
|
|
1228
|
+
const AttentionItemSchema = z.z.object({
|
|
1229
|
+
id: z.z.string(),
|
|
1230
|
+
sessionId: z.z.string(),
|
|
1231
|
+
teamId: z.z.string().nullable(),
|
|
1232
|
+
projectId: z.z.string().nullable(),
|
|
1233
|
+
source: z.z.string(),
|
|
1234
|
+
kind: z.z.string(),
|
|
1235
|
+
key: z.z.string().nullable(),
|
|
1236
|
+
title: z.z.string(),
|
|
1237
|
+
bodyMd: z.z.string().nullable(),
|
|
1238
|
+
options: z.z.array(AttentionOptionSchema.passthrough()).nullable(),
|
|
1239
|
+
links: z.z.array(z.z.object({ type: z.z.string(), ref: z.z.string(), label: z.z.string().optional() }).passthrough()).nullable(),
|
|
1240
|
+
anchor: z.z.object({ localId: z.z.string().optional(), messageId: z.z.string().optional(), snippet: z.z.string().optional() }).nullable(),
|
|
1241
|
+
/** The lead's first in-stream reply to an owner question (auto-attached by the CLI, §4.4). */
|
|
1242
|
+
firstReply: z.z.object({ localId: z.z.string().optional(), messageId: z.z.string().optional(), snippet: z.z.string().optional() }).nullable(),
|
|
1243
|
+
replyToId: z.z.string().nullable(),
|
|
1244
|
+
/** D5: drafted by the CLI from the lead's text (「自动识别」), not posted by the lead. No push until the lead confirms it. */
|
|
1245
|
+
inferred: z.z.boolean().default(false),
|
|
1246
|
+
needsOwner: z.z.boolean(),
|
|
1247
|
+
state: z.z.string(),
|
|
1248
|
+
ownerChoice: z.z.string().nullable(),
|
|
1249
|
+
ownerNote: z.z.string().nullable(),
|
|
1250
|
+
resolvedBy: z.z.string().nullable(),
|
|
1251
|
+
/** The lead's `owner_board_resolve` note. */
|
|
1252
|
+
resolveNote: z.z.string().nullable(),
|
|
1253
|
+
/** Times the same `(sessionId, key)` was posted again and folded into this item. */
|
|
1254
|
+
repostCount: z.z.number(),
|
|
1255
|
+
createdAt: z.z.number(),
|
|
1256
|
+
updatedAt: z.z.number(),
|
|
1257
|
+
resolvedAt: z.z.number().nullable(),
|
|
1258
|
+
pushedAt: z.z.number().nullable(),
|
|
1259
|
+
/** Bumped on every mutation; clients keep the highest version per id. */
|
|
1260
|
+
version: z.z.number()
|
|
1261
|
+
});
|
|
1262
|
+
z.z.object({
|
|
1263
|
+
t: z.z.literal("attention-item"),
|
|
1264
|
+
item: AttentionItemSchema
|
|
1265
|
+
});
|
|
1266
|
+
z.z.object({
|
|
1267
|
+
sessionId: id,
|
|
1268
|
+
source: z.z.enum(ATTENTION_SOURCES),
|
|
1269
|
+
kind: z.z.enum(ATTENTION_KINDS),
|
|
1270
|
+
title,
|
|
1271
|
+
bodyMd: bodyMd.optional(),
|
|
1272
|
+
options: options.optional(),
|
|
1273
|
+
links: links.optional(),
|
|
1274
|
+
anchor: AttentionAnchorSchema.optional(),
|
|
1275
|
+
replyToId: id.optional(),
|
|
1276
|
+
key: key.optional(),
|
|
1277
|
+
requestId: requestId.optional(),
|
|
1278
|
+
/**
|
|
1279
|
+
* D5 draft: only the CLI's auto-detect path sets it (`owner_board_post` does
|
|
1280
|
+
* not expose it). A repost of the key with `false` confirms the draft (and
|
|
1281
|
+
* pushes once); a draft never downgrades a confirmed item.
|
|
1282
|
+
*/
|
|
1283
|
+
inferred: z.z.boolean().default(false)
|
|
1284
|
+
}).refine((p) => p.kind !== "decision" || p.options !== void 0, { message: "decision needs 2-4 options", path: ["options"] });
|
|
1285
|
+
z.z.object({
|
|
1286
|
+
title: title.optional(),
|
|
1287
|
+
bodyMd: bodyMd.nullable().optional(),
|
|
1288
|
+
appendMd: bodyMd.optional(),
|
|
1289
|
+
options: options.nullable().optional(),
|
|
1290
|
+
links: links.nullable().optional(),
|
|
1291
|
+
/** Only `question` → `request` (the lead reclassifies an owner message, §4.4). */
|
|
1292
|
+
kind: z.z.literal("request").optional(),
|
|
1293
|
+
state: z.z.enum(["open", "in_progress", "answered"]).optional(),
|
|
1294
|
+
firstReply: AttentionAnchorSchema.optional(),
|
|
1295
|
+
requestId: requestId.optional()
|
|
1296
|
+
}).refine((p) => !(p.bodyMd !== void 0 && p.appendMd !== void 0), "use bodyMd or appendMd, not both");
|
|
1297
|
+
z.z.object({
|
|
1298
|
+
outcome: z.z.enum(OWNER_BOARD_RESOLVE_OUTCOMES),
|
|
1299
|
+
note: note.optional(),
|
|
1300
|
+
/** Defaults to `lead`. */
|
|
1301
|
+
by: z.z.enum(["lead", "auto-first-reply"]).optional(),
|
|
1302
|
+
requestId: requestId.optional()
|
|
1303
|
+
});
|
|
1304
|
+
z.z.discriminatedUnion("action", [
|
|
1305
|
+
z.z.object({ action: z.z.literal("choose"), choice: z.z.string().trim().min(1).max(ATTENTION_LIMITS.optionIdChars), note: note.optional() }),
|
|
1306
|
+
z.z.object({ action: z.z.literal("resolve"), note: note.optional() }),
|
|
1307
|
+
z.z.object({ action: z.z.literal("reopen"), note: note.optional() })
|
|
1308
|
+
]);
|
|
1309
|
+
z.z.object({
|
|
1310
|
+
sessionId: id.optional(),
|
|
1311
|
+
/** `open` (default) = open + in_progress; `active` adds the latest `answered`; `all` = everything. */
|
|
1312
|
+
state: z.z.enum(["open", "active", "all"]).optional(),
|
|
1313
|
+
needsOwner: z.z.enum(["1", "true", "0", "false"]).optional(),
|
|
1314
|
+
/** Epoch ms; only items updated after it. */
|
|
1315
|
+
since: z.z.coerce.number().int().nonnegative().optional(),
|
|
1316
|
+
limit: z.z.coerce.number().int().min(1).max(ATTENTION_LIMITS.listMax).optional()
|
|
1317
|
+
});
|
|
1318
|
+
const OwnerBoardPostInputSchema = z.z.object({
|
|
1319
|
+
kind: z.z.enum(OWNER_BOARD_POST_KINDS),
|
|
1320
|
+
title,
|
|
1321
|
+
body_md: bodyMd.optional(),
|
|
1322
|
+
options: options.optional(),
|
|
1323
|
+
links: links.optional(),
|
|
1324
|
+
reply_to: id.optional(),
|
|
1325
|
+
key: key.optional(),
|
|
1326
|
+
anchor: z.z.union([z.z.literal("this_turn"), z.z.object({ localId: z.z.string().min(1).max(256) })]).optional(),
|
|
1327
|
+
request_id: requestId
|
|
1328
|
+
}).refine((p) => p.kind !== "decision" || p.options !== void 0, { message: "decision needs 2-4 options", path: ["options"] });
|
|
1329
|
+
const OwnerBoardUpdateInputSchema = z.z.object({
|
|
1330
|
+
id,
|
|
1331
|
+
title: title.optional(),
|
|
1332
|
+
body_md: bodyMd.optional(),
|
|
1333
|
+
append_md: bodyMd.optional(),
|
|
1334
|
+
options: options.optional(),
|
|
1335
|
+
links: links.optional(),
|
|
1336
|
+
state: z.z.enum(["open", "in_progress"]).optional(),
|
|
1337
|
+
request_id: requestId
|
|
1338
|
+
}).refine((p) => !(p.body_md !== void 0 && p.append_md !== void 0), "use body_md or append_md, not both");
|
|
1339
|
+
const OwnerBoardResolveInputSchema = z.z.object({
|
|
1340
|
+
id,
|
|
1341
|
+
outcome: z.z.enum(OWNER_BOARD_RESOLVE_OUTCOMES),
|
|
1342
|
+
note: note.optional(),
|
|
1343
|
+
request_id: requestId
|
|
1344
|
+
});
|
|
1345
|
+
const OwnerBoardListInputSchema = z.z.object({
|
|
1346
|
+
state: z.z.enum(["open", "all"]).optional(),
|
|
1347
|
+
/** ISO-8601 or epoch ms. */
|
|
1348
|
+
since: z.z.string().min(1).max(64).optional()
|
|
1349
|
+
});
|
|
1350
|
+
function ownerBoardPostToRest(sessionId, input, anchor) {
|
|
1351
|
+
return {
|
|
1352
|
+
sessionId,
|
|
1353
|
+
source: "lead",
|
|
1354
|
+
kind: input.kind,
|
|
1355
|
+
title: input.title,
|
|
1356
|
+
...input.body_md !== void 0 ? { bodyMd: input.body_md } : {},
|
|
1357
|
+
...input.options ? { options: input.options } : {},
|
|
1358
|
+
...input.links ? { links: input.links } : {},
|
|
1359
|
+
...anchor ? { anchor } : {},
|
|
1360
|
+
...input.reply_to ? { replyToId: input.reply_to } : {},
|
|
1361
|
+
...input.key ? { key: input.key } : {},
|
|
1362
|
+
requestId: input.request_id,
|
|
1363
|
+
inferred: false
|
|
1364
|
+
};
|
|
1365
|
+
}
|
|
1175
1366
|
|
|
1176
1367
|
exports.AGENT_VERSION_SOURCES = AGENT_VERSION_SOURCES;
|
|
1368
|
+
exports.ATTENTION_DISABLED_ERROR = ATTENTION_DISABLED_ERROR;
|
|
1369
|
+
exports.ATTENTION_LIMITS = ATTENTION_LIMITS;
|
|
1370
|
+
exports.ATTENTION_SESSION_CAPABILITY = ATTENTION_SESSION_CAPABILITY;
|
|
1371
|
+
exports.AUTOMATION_ATTENTION_REASON_MAX_CHARS = AUTOMATION_ATTENTION_REASON_MAX_CHARS;
|
|
1177
1372
|
exports.AUTOMATION_CLAIM_MAX_RUNS = AUTOMATION_CLAIM_MAX_RUNS;
|
|
1178
1373
|
exports.AUTOMATION_DAEMON_CAPABILITY_PRECHECK = AUTOMATION_DAEMON_CAPABILITY_PRECHECK;
|
|
1179
1374
|
exports.AUTOMATION_DEFAULT_LEASE_MS = AUTOMATION_DEFAULT_LEASE_MS;
|
|
@@ -1192,6 +1387,10 @@ exports.BUILTIN_TODO_DISCOVERY = BUILTIN_TODO_DISCOVERY;
|
|
|
1192
1387
|
exports.BUILTIN_TODO_SKILL = BUILTIN_TODO_SKILL;
|
|
1193
1388
|
exports.CODEX_STEER_CAPABILITY = CODEX_STEER_CAPABILITY;
|
|
1194
1389
|
exports.HARNESS_INSTALL_CAPABILITY_VERSION = HARNESS_INSTALL_CAPABILITY_VERSION;
|
|
1390
|
+
exports.OwnerBoardListInputSchema = OwnerBoardListInputSchema;
|
|
1391
|
+
exports.OwnerBoardPostInputSchema = OwnerBoardPostInputSchema;
|
|
1392
|
+
exports.OwnerBoardResolveInputSchema = OwnerBoardResolveInputSchema;
|
|
1393
|
+
exports.OwnerBoardUpdateInputSchema = OwnerBoardUpdateInputSchema;
|
|
1195
1394
|
exports.PI_STEER_CAPABILITY = PI_STEER_CAPABILITY;
|
|
1196
1395
|
exports.PROJECT_SESSION_CAPABILITY = PROJECT_SESSION_CAPABILITY;
|
|
1197
1396
|
exports.PROMPT_QUEUE_CAPABILITY = PROMPT_QUEUE_CAPABILITY;
|
|
@@ -1203,11 +1402,13 @@ exports.ServerMigrateNoticeSchema = ServerMigrateNoticeSchema;
|
|
|
1203
1402
|
exports.createBuiltinTodoClient = createBuiltinTodoClient;
|
|
1204
1403
|
exports.createEnvelope = createEnvelope;
|
|
1205
1404
|
exports.getAgentCodeDefaults = getAgentCodeDefaults;
|
|
1405
|
+
exports.isAttentionBoardLocalId = isAttentionBoardLocalId;
|
|
1206
1406
|
exports.isAutomationRunTerminal = isAutomationRunTerminal;
|
|
1207
1407
|
exports.isClaudeOpus55Model = isClaudeOpus55Model;
|
|
1208
1408
|
exports.isHarnessInstallId = isHarnessInstallId;
|
|
1209
1409
|
exports.isInsideTeamWorktree = isInsideTeamWorktree;
|
|
1210
1410
|
exports.normalizeAgentKey = normalizeAgentKey;
|
|
1411
|
+
exports.ownerBoardPostToRest = ownerBoardPostToRest;
|
|
1211
1412
|
exports.rebaseTeamWorktreePath = rebaseTeamWorktreePath;
|
|
1212
1413
|
exports.streamKeyOf = streamKeyOf;
|
|
1213
1414
|
exports.supportsClaudeOpus55 = supportsClaudeOpus55;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { statSync, readdirSync } from 'node:fs';
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
|
-
import { l as logger } from './logger-
|
|
4
|
-
import { r as readSettings } from './persistence-
|
|
3
|
+
import { l as logger } from './logger-RMPh5aqe.mjs';
|
|
4
|
+
import { r as readSettings } from './persistence-zJo4r7YI.mjs';
|
|
5
5
|
import { d as describeAgentHome, C as CLAUDE_CONFIG_DIR_ENV, a as CODEX_HOME_ENV, f as findClaudeConversation, b as agentHomeCandidates, c as findCodexThread, r as resolveAgentHomes, A as AGENT_HOME_ENV_NAMES, g as agentHomeEnv, p as probeLoginShellEnv } from './loginShellEnv-Dw8M7tkI.mjs';
|
|
6
6
|
export { h as claudeConversationPath, i as claudeProjectDirName, j as codexRolloutFileMatches, e as expandHomePath } from './loginShellEnv-Dw8M7tkI.mjs';
|
|
7
7
|
import 'chalk';
|
|
8
8
|
import 'node:util';
|
|
9
|
-
import './configuration-
|
|
9
|
+
import './configuration-elzht62L.mjs';
|
|
10
10
|
import 'node:path';
|
|
11
|
-
import './package-
|
|
11
|
+
import './package-CTrz6U3C.mjs';
|
|
12
12
|
import 'node:fs/promises';
|
|
13
13
|
import 'zod';
|
|
14
14
|
import './authRelay-DhQhkBvX.mjs';
|