very-happy-cli 0.2.181 → 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-DZGCSuXF.mjs → AcpBackend-9c-Jeaxd.mjs} +3 -3
- package/dist/{AcpBackend-CgHb_ya5.cjs → AcpBackend-B-aMuEzO.cjs} +3 -3
- package/dist/{AcpSessionManager-CacC2EVn.cjs → AcpSessionManager-BxXe24AV.cjs} +10 -3
- package/dist/{AcpSessionManager-DwuPzWBh.mjs → AcpSessionManager-CS0FOSQk.mjs} +10 -3
- package/dist/{BasePermissionHandler-Uo-GUjbb.mjs → BasePermissionHandler-BJ1ID_Br.mjs} +1 -1
- package/dist/{BasePermissionHandler-DCP8ZEB4.cjs → BasePermissionHandler-BREjppjP.cjs} +1 -1
- package/dist/{acpSessionResume-9OLTD6kT.mjs → acpSessionResume-BKtI9Jq_.mjs} +1 -1
- package/dist/{acpSessionResume-BaVMD80f.cjs → acpSessionResume-mVoJ75vI.cjs} +1 -1
- package/dist/{agentHome-B1BsKeqD.mjs → agentHome-B8Ctr_Nu.mjs} +4 -4
- package/dist/{agentHome-BtUmGcPX.cjs → agentHome-rzjm56o4.cjs} +4 -4
- package/dist/{api-Dr3wXL_7.mjs → api-C29WLYkW.mjs} +79 -12
- package/dist/{api-COHFAkb_.cjs → api-xZiqVynF.cjs} +81 -11
- package/dist/{apiMachine-D8H7CXaz.cjs → apiMachine-B-FNBIYG.cjs} +19 -14
- package/dist/{apiMachine-CHEzPQdS.mjs → apiMachine-Dz6Yfk0m.mjs} +19 -14
- package/dist/{attachmentContent-mIhbtRKl.cjs → attachmentContent-COV4LF8k.cjs} +2 -2
- package/dist/{attachmentContent-1YwtKgWl.mjs → attachmentContent-DwY0uIg6.mjs} +2 -2
- package/dist/{auth-CgQP7d0q.cjs → auth-CYtk9_ga.cjs} +5 -5
- package/dist/{auth-Fg8fLadK.cjs → auth-D_qsnVr3.cjs} +8 -8
- package/dist/{auth-CbZkcMAb.mjs → auth-DvbSDalm.mjs} +8 -8
- package/dist/{auth-DZsthtSk.mjs → auth-xT70IYMx.mjs} +5 -5
- package/dist/{auto-BB7kqSh5.cjs → auto-DT_PfpCx.cjs} +32 -25
- package/dist/{auto-_T-Ud-z5.mjs → auto-IiPqvIsN.mjs} +32 -26
- package/dist/{bootstrap-CYtOtbi7.cjs → bootstrap-C50NkfPx.cjs} +2 -2
- package/dist/{bootstrap-B6EkZh4u.mjs → bootstrap-DS8Acdhm.mjs} +2 -2
- package/dist/{browser-C2qhUHSE.mjs → browser-1j9gdZoD.mjs} +1 -1
- package/dist/{browser-DjNNQQk2.cjs → browser-CxKZLd2T.cjs} +1 -1
- package/dist/{claudeLocal-O_w7-fBh.cjs → claudeLocal-CgNWpepB.cjs} +5 -5
- package/dist/{claudeLocal-BAFjWhZ8.mjs → claudeLocal-U1Fa9sJo.mjs} +5 -5
- package/dist/{claudeLocalLauncher-CWn30LZR.mjs → claudeLocalLauncher-BjCsfZUE.mjs} +10 -10
- package/dist/{claudeLocalLauncher-Df3zg1q0.cjs → claudeLocalLauncher-IyFm0D6a.cjs} +10 -10
- package/dist/{claudeSessionFork-2ZkSTOGn.mjs → claudeSessionFork-6-1vKISn.mjs} +1 -1
- package/dist/{claudeSessionFork-pwcKqB-e.cjs → claudeSessionFork-BUO1XdSm.cjs} +1 -1
- package/dist/{client-CUO3ItoB.cjs → client--vZueZYF.cjs} +14 -4
- package/dist/{client-BKyU66lg.mjs → client-5_zDNdOh.mjs} +2 -2
- package/dist/{client-CXOnzuOy.mjs → client-BgHvK7lo.mjs} +15 -7
- package/dist/{client-D_U2VjO3.cjs → client-DYGDBD0M.cjs} +15 -7
- package/dist/{client-DWs6k041.cjs → client-DcKJ0ul_.cjs} +2 -2
- package/dist/{client-DsQcxVUV.mjs → client-DfDyE322.mjs} +14 -4
- package/dist/codex/happyMcpStdioBridge.cjs +20 -19
- package/dist/codex/happyMcpStdioBridge.mjs +20 -19
- package/dist/{codexAppServerClient-BRX3JZ_5.cjs → codexAppServerClient-C3nrTfwY.cjs} +3 -3
- package/dist/{codexAppServerClient-C3JO3pwM.mjs → codexAppServerClient-DvBg4hGc.mjs} +3 -3
- package/dist/{codexCommand-BZIAAqKS.mjs → codexCommand-Bqp2--g_.mjs} +96 -61
- package/dist/{codexCommand-dKOc5iQl.cjs → codexCommand-DSiU6MNt.cjs} +96 -61
- package/dist/{codexTermination-BVR9HeVI.cjs → codexTermination-D9TRTglF.cjs} +1 -1
- package/dist/{codexTermination-ztFkwHrG.mjs → codexTermination-DsliWl_s.mjs} +1 -1
- package/dist/{config-cftYxLC7.cjs → config-CRhWiOwi.cjs} +3 -3
- package/dist/{config-NbHjx8ge.mjs → config-DeaqRn3o.mjs} +3 -3
- package/dist/{configuration-C8JgseHy.cjs → configuration-K3I6yOjZ.cjs} +1 -1
- package/dist/{configuration-BPrfb17M.mjs → configuration-elzht62L.mjs} +1 -1
- package/dist/{connect-Br8VMrK1.cjs → connect-B5UbfmO3.cjs} +13 -13
- package/dist/{connect-CLD1ai0k.mjs → connect-CT5cOlnC.mjs} +13 -13
- package/dist/{context-_YGq8xdH.mjs → context-CLj1_RYF.mjs} +1 -1
- package/dist/{context-D1lgQTJC.cjs → context-DNKNF8Yh.cjs} +1 -1
- package/dist/{controlClient-D68Zj7Q-.cjs → controlClient-ChqmxgbB.cjs} +3 -3
- package/dist/{controlClient-CkNpT5zS.mjs → controlClient-CuYQs2aZ.mjs} +3 -3
- package/dist/{createSessionMetadata-3WAj3_xl.mjs → createSessionMetadata-C1MbLQnh.mjs} +2 -2
- package/dist/{createSessionMetadata-DNIbKLHg.cjs → createSessionMetadata-QfiRx4Tf.cjs} +2 -2
- package/dist/daemonSupervisor-57JYYzMf.cjs +268 -0
- package/dist/daemonSupervisor-DfzrtNhM.mjs +245 -0
- package/dist/{defaultPermissionMode-BmvjP32v.cjs → defaultPermissionMode-DQmdZZIg.cjs} +2 -2
- package/dist/{defaultPermissionMode-DXMznl8v.mjs → defaultPermissionMode-U9LuUeQh.mjs} +2 -2
- package/dist/{deterministicJson-BS7D7URE.cjs → deterministicJson-BBRUcB8i.cjs} +569 -17
- package/dist/{deterministicJson-BcBIKKf1.mjs → deterministicJson-BixlyPWV.mjs} +572 -21
- package/dist/{doctor-Be7zC0AF.cjs → doctor-CKgHUV4W.cjs} +7 -7
- package/dist/{doctor-CoOaPq6w.mjs → doctor-Dban2oE2.mjs} +7 -7
- package/dist/{downloadTarget-LyOiucn_.cjs → downloadTarget-CmC11Y7E.cjs} +6 -6
- package/dist/{downloadTarget-CeaAXdJj.mjs → downloadTarget-VUTd9lEO.mjs} +6 -6
- package/dist/{ensureDaemonRunning-B8z37VKD.cjs → ensureDaemonRunning-L0fl0cLE.cjs} +5 -5
- package/dist/{ensureDaemonRunning--98j7-17.mjs → ensureDaemonRunning-khb8Nr1n.mjs} +5 -5
- package/dist/fsMkdir-0K3yENml.cjs +56 -0
- package/dist/fsMkdir-DumgLTzR.mjs +53 -0
- package/dist/{handleResumeCommand-gO8I4keP.mjs → handleResumeCommand-CLDGWpTJ.mjs} +5 -5
- package/dist/{handleResumeCommand-BFZlrFVH.cjs → handleResumeCommand-D9myBN2N.cjs} +5 -5
- package/dist/{index-WUj3954m.mjs → index-BMZx-699.mjs} +4 -4
- package/dist/{index-BRMq9gOe.cjs → index-BdJs0465.cjs} +3 -3
- package/dist/{index-CeRXrGnH.mjs → index-BptfFoXM.mjs} +283 -77
- package/dist/{index-jF2t3ACW.cjs → index-COSjJPIv.cjs} +4 -4
- package/dist/{index-hQ8LP1C2.mjs → index-CtwqBeH6.mjs} +3 -3
- package/dist/{index-B5PXbZjW.cjs → index-DgA79dVw.cjs} +41 -40
- package/dist/{index-Df2eHm3O.cjs → index-Fq-jxjsB.cjs} +294 -76
- package/dist/{index-CO0n9ue6.mjs → index-GkkbUZX-.mjs} +4 -4
- package/dist/{index-DneHoQXf.mjs → index-IRI8s8kz.mjs} +42 -41
- package/dist/{index-BkluinoS.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-DkYFiVK4.mjs → install-JvCk2PJV.mjs} +3 -3
- package/dist/{install-FqkSUjPC.cjs → install-cn98bTCs.cjs} +3 -3
- package/dist/lib.cjs +12 -12
- package/dist/lib.d.cts +2 -1
- package/dist/lib.d.mts +2 -1
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-x8cJ8J_9.cjs → lidState-Bcs5kRHi.cjs} +1 -1
- package/dist/{lidState-DghbfRbr.mjs → lidState-DXeYTsrm.mjs} +1 -1
- package/dist/{localHappyAgentAuth-IKmeRpuQ.mjs → localHappyAgentAuth-C1A4ChCR.mjs} +1 -1
- package/dist/{localHappyAgentAuth-DZ2kb9uq.cjs → localHappyAgentAuth-CypTSe42.cjs} +1 -1
- package/dist/{logger-DgBwUSgS.cjs → logger-Cgwz30rK.cjs} +2 -2
- package/dist/{logger-LFr8iPgl.mjs → logger-RMPh5aqe.mjs} +2 -2
- package/dist/{machineMetadata-DB03ez4K.cjs → machineMetadata-BSOGMNRi.cjs} +5 -3
- package/dist/{machineMetadata-BglCsfvf.mjs → machineMetadata-BTUtPRth.mjs} +5 -3
- package/dist/{main-YQ-Vkakw.cjs → main-4iiwYpCR.cjs} +61 -56
- package/dist/{main-_1LSzlLv.mjs → main-DNDL6t8z.mjs} +61 -56
- package/dist/{mcp-BIY80jSc.cjs → mcp-C7eEoGhz.cjs} +17 -15
- package/dist/{mcp-Csj-mT5Y.mjs → mcp-DXYDPOpJ.mjs} +17 -15
- package/dist/{mirrorProtocol-CAxOMBkb.mjs → mirrorProtocol-DQRy5PaT.mjs} +3 -3
- package/dist/{mirrorProtocol-BphKIAK9.cjs → mirrorProtocol-c5g5MgNc.cjs} +3 -3
- package/dist/{package-NoD8QOOM.cjs → package-3aPiSpZj.cjs} +7 -7
- package/dist/{package-DYGwlmXl.mjs → package-CTrz6U3C.mjs} +7 -7
- package/dist/{panels-B8zRm7_d.mjs → panels-B5sZ84vA.mjs} +5 -5
- package/dist/{panels-DYEc1NyQ.cjs → panels-BmsmKHbw.cjs} +5 -5
- package/dist/{peerTools-CK3JYu1k.mjs → peerTools-DIPOX033.mjs} +5 -5
- package/dist/{peerTools-CP-x-Peu.cjs → peerTools-Dxe7iCi_.cjs} +5 -5
- package/dist/{persistence-BY-D00wT.cjs → persistence-DZRMUZZS.cjs} +2 -2
- package/dist/{persistence-D2Djrf7t.mjs → persistence-zJo4r7YI.mjs} +2 -2
- package/dist/{piRunnerArgs-gxLYIZH4.cjs → piRunnerArgs-BSPiS6tZ.cjs} +1 -1
- package/dist/{piRunnerArgs-IZLoL7TG.mjs → piRunnerArgs-IVdoHUB6.mjs} +1 -1
- package/dist/{piRuntime-o5L8uX-W.cjs → piRuntime-BJzjlMcN.cjs} +2 -2
- package/dist/{piRuntime-D7Y4oHVL.mjs → piRuntime-BvHO3vgO.mjs} +2 -2
- package/dist/{piTerminal-C_-JDkLN.cjs → piTerminal-Cz4pW55d.cjs} +20 -18
- package/dist/{piTerminal-Kphx8Uhw.mjs → piTerminal-D7vBOpkE.mjs} +20 -18
- package/dist/{pushNotifications-DXGIhE-A.mjs → pushNotifications-C4R9-1hU.mjs} +5 -3
- package/dist/{pushNotifications-BXoOSq_G.cjs → pushNotifications-CgIrYml3.cjs} +5 -3
- package/dist/{query-CdCxzuaB.cjs → query-CZQG1PdU.cjs} +1 -1
- package/dist/{query-CcA6DVZK.mjs → query-DKPmDsHS.mjs} +1 -1
- package/dist/{rateLimitWindows-OpAmdOtC.cjs → rateLimitWindows-CPV0nLeq.cjs} +1 -1
- package/dist/{rateLimitWindows-ZtHZHe-l.mjs → rateLimitWindows-HlHATOQ0.mjs} +1 -1
- package/dist/{registerCommonHandlers-CRjBoJLK.cjs → registerCommonHandlers-D1pC83Op.cjs} +2 -2
- package/dist/{registerCommonHandlers-DF6bdDtd.mjs → registerCommonHandlers-a9lHojSV.mjs} +2 -2
- package/dist/{registerKillSessionHandler-DDCKL3wf.mjs → registerKillSessionHandler-Bp-fuH-w.mjs} +6 -6
- package/dist/{registerKillSessionHandler-7fOm6ooh.cjs → registerKillSessionHandler-nTi2vVJy.cjs} +6 -6
- package/dist/{remoteSessionClient-B2POSKFT.mjs → remoteSessionClient-Cwrddscy.mjs} +5 -5
- package/dist/{remoteSessionClient-CFCn42bs.cjs → remoteSessionClient-HQAKAvVd.cjs} +5 -5
- package/dist/{reportProgressTool-th4trcET.cjs → reportProgressTool-Be-8ADI4.cjs} +4 -4
- package/dist/{reportProgressTool-tPxEvh6x.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-cKQBbVi4.mjs → run-BBU8GyxE.mjs} +63 -244
- package/dist/{run-C_FumCQk.cjs → run-CxRJk9qq.cjs} +73 -255
- package/dist/{runClaude-CYnM6krL.mjs → runClaude-DR6pEQwd.mjs} +23 -22
- package/dist/{runClaude-z_2YC_aa.cjs → runClaude-Dd5zJaUZ.cjs} +23 -22
- package/dist/{runClaudeDeps-duS06Pb4.mjs → runClaudeDeps-COgZaUZm.mjs} +50 -45
- package/dist/{runClaudeDeps-CLubzWnA.cjs → runClaudeDeps-CTtZ_1mC.cjs} +45 -40
- package/dist/{runGemini-C_Pc2EhH.mjs → runGemini-DVoVUfPp.mjs} +40 -37
- package/dist/{runGemini-vEoXV6qT.cjs → runGemini-DX72qB92.cjs} +40 -37
- package/dist/{runOpenClaw-Cxun1qLC.mjs → runOpenClaw-BHjzmzeC.mjs} +19 -18
- package/dist/{runOpenClaw-CXJCtMgB.cjs → runOpenClaw-BSg4hFVt.cjs} +19 -18
- package/dist/{sandbox-CsvPnTmz.mjs → sandbox-CWR9EqoN.mjs} +4 -4
- package/dist/{sandbox-CO46H2tK.cjs → sandbox-D1T_hmgZ.cjs} +4 -4
- package/dist/{selfCheck-DIr7Gc0i.cjs → selfCheck-CE7vlnNS.cjs} +36 -36
- package/dist/selfCheck-ZGgBtxFQ.mjs +85 -0
- package/dist/{send-DMoFg6F1.mjs → send-BDF0Zvxo.mjs} +8 -8
- package/dist/{send-X2mfVEyr.cjs → send-BxZqRCcG.cjs} +8 -8
- package/dist/{server-CkqQ0sRH.mjs → server-B4JtnDLF.mjs} +4 -4
- package/dist/{server-BwTEdbkr.cjs → server-DB7_70Mi.cjs} +6 -6
- package/dist/{sessionLock-CdIRJlHH.cjs → sessionLock-BXvFN6uw.cjs} +3 -3
- package/dist/{sessionLock-JIfwCqMk.mjs → sessionLock-CXOOX-VD.mjs} +3 -3
- package/dist/{sessionOps-DVA-00nR.cjs → sessionOps-BWlDlFYP.cjs} +4 -4
- package/dist/{sessionOps-DqlftXxe.mjs → sessionOps-ByVggB_q.mjs} +4 -4
- package/dist/{sessionScanner-BMwgGAhY.cjs → sessionScanner-DkxPB5VA.cjs} +3 -3
- package/dist/{sessionScanner-BI0Vo1xT.mjs → sessionScanner-r66RtF95.mjs} +3 -3
- package/dist/{sessions-DjgEcHaT.cjs → sessions-BiJTxFy9.cjs} +10 -10
- package/dist/{sessions-D6IimX7b.mjs → sessions-C1lLK_a9.mjs} +10 -10
- package/dist/{setupOfflineReconnection-DgJK_4m1.mjs → setupOfflineReconnection-Bl3DuakT.mjs} +2 -2
- package/dist/{setupOfflineReconnection-CjuCiKY3.cjs → setupOfflineReconnection-CecTiFZ-.cjs} +2 -2
- package/dist/{spawn-Dvzy-tzc.mjs → spawn-D-8MlEM6.mjs} +14 -14
- package/dist/{spawn-rhF28shY.cjs → spawn-D79mVa3h.cjs} +14 -14
- package/dist/{spawnAgents-CCnlq-FI.mjs → spawnAgents-DJHjq01u.mjs} +1 -1
- package/dist/{spawnAgents-iwuqrgR9.cjs → spawnAgents-Sfnf-4pN.cjs} +1 -1
- package/dist/{spawnHappyCLI-DnKmIsEt.cjs → spawnHappyCLI-CQwQs9G5.cjs} +1 -1
- package/dist/{spawnHappyCLI-Dq3LLXLb.mjs → spawnHappyCLI-v_bJwZ4Z.mjs} +1 -1
- package/dist/{specialCommands-Zwr2C6A2.cjs → specialCommands-CWMVfT5s.cjs} +3 -3
- package/dist/{specialCommands-CcyZ1hGA.mjs → specialCommands-yMnFvS-W.mjs} +3 -3
- package/dist/{startFileWatcher-4thXDK9d.mjs → startFileWatcher-BCDkT_tr.mjs} +1 -1
- package/dist/{startFileWatcher-K6hJSyiR.cjs → startFileWatcher-GW4_E7dV.cjs} +1 -1
- package/dist/{startupSessionCreate-BfByJ16A.mjs → startupSessionCreate-BcAGYo51.mjs} +1 -1
- package/dist/{startupSessionCreate-CKEbq0tL.cjs → startupSessionCreate-tBRa_ze8.cjs} +1 -1
- package/dist/{streamRelay-LcDvyEjK.mjs → streamRelay-BEDiy6_b.mjs} +1 -1
- package/dist/{streamRelay-Gy8Xfnon.cjs → streamRelay-BZ8drtof.cjs} +1 -1
- package/dist/{sync-DO-2PU45.mjs → sync--QUIOuf8.mjs} +1 -1
- package/dist/{sync-1hQ5KHpL.cjs → sync-BMDkyo75.cjs} +1 -1
- package/dist/{systemPrompt-Dj7pgkMK.cjs → systemPrompt-DoHSXrH0.cjs} +2 -2
- package/dist/{systemPrompt-BctLfMZs.mjs → systemPrompt-O0Kd6vbA.mjs} +2 -2
- package/dist/{teams-uQxUlyyz.cjs → teams-BkZop-sP.cjs} +13 -10
- package/dist/{teams-Bu8YeOoF.mjs → teams-CTF1gT48.mjs} +13 -10
- package/dist/{template-BaHAmH2K.cjs → template-CeC1dYe-.cjs} +32 -2
- package/dist/{template-CiOPa2rd.mjs → template-D1fm22em.mjs} +31 -3
- package/dist/{time-BcoJaG8E.mjs → time-B2KKdAym.mjs} +1 -1
- package/dist/{time-nqa9shu8.cjs → time-CdCotzKU.cjs} +1 -1
- package/dist/{titleGenerator-D5r06bhf.mjs → titleGenerator-BFDczskR.mjs} +1 -1
- package/dist/{titleGenerator-D09XyYYG.cjs → titleGenerator-DZH1XqAf.cjs} +2 -2
- package/dist/{todo-D1q8146q.mjs → todo-C2gyOUom.mjs} +6 -6
- package/dist/{todo-CCOnL7pT.cjs → todo-DnTFTHmV.cjs} +6 -6
- package/dist/{tools-DiCXnAC5.cjs → tools-C8rpwyIl.cjs} +1 -1
- package/dist/{tools-D2E--n1x.mjs → tools-DUjkqSQL.mjs} +1 -1
- package/dist/{uninstall-CtwXi1Rt.mjs → uninstall-B5Ew50mZ.mjs} +3 -3
- package/dist/{uninstall-BrNwwwSD.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-NamtBHVB.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,42 +458,57 @@ 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
|
-
const
|
|
496
|
+
const TEAM_WORKTREE = /\/teams\/worktrees\/([^/]+)(?:\/|$)/;
|
|
497
|
+
function teamWorktreeId(path) {
|
|
498
|
+
if (!path) return null;
|
|
499
|
+
return path.replace(/\\/g, "/").match(TEAM_WORKTREE)?.[1] ?? null;
|
|
500
|
+
}
|
|
501
|
+
function isInsideTeamWorktree(path) {
|
|
502
|
+
return teamWorktreeId(path) !== null;
|
|
503
|
+
}
|
|
504
|
+
function rebaseTeamWorktreePath(path, repository) {
|
|
505
|
+
const normalized = path.replace(/\\/g, "/");
|
|
506
|
+
const match = normalized.match(TEAM_WORKTREE);
|
|
507
|
+
if (!match || match.index === void 0) return path;
|
|
508
|
+
const rest = normalized.slice(match.index + match[0].length).replace(/\/+$/, "");
|
|
509
|
+
return rest ? `${repository.replace(/\/+$/, "")}/${rest}` : repository;
|
|
510
|
+
}
|
|
511
|
+
const id$2 = z.z.string().min(1).max(128);
|
|
497
512
|
const text = z.z.string().min(1).max(32e3);
|
|
498
513
|
const AUTOMATION_NAME_PATTERN = /^[a-z0-9][a-z0-9-_.]{0,63}$/;
|
|
499
514
|
const AutomationNameSchema = z.z.string().regex(AUTOMATION_NAME_PATTERN, "automation name must match [a-z0-9][a-z0-9-_.]{0,63}");
|
|
@@ -502,6 +517,7 @@ const AUTOMATION_MAX_INTERVAL_MS = 366 * 864e5;
|
|
|
502
517
|
const AUTOMATION_MAX_TIMESTAMP = 864e13;
|
|
503
518
|
const AUTOMATION_PAYLOAD_MAX_BYTES = 65536;
|
|
504
519
|
const AUTOMATION_SUMMARY_MAX_CHARS = 4096;
|
|
520
|
+
const AUTOMATION_ATTENTION_REASON_MAX_CHARS = 512;
|
|
505
521
|
const AUTOMATION_DEFAULT_LEASE_MS = 6e4;
|
|
506
522
|
const AUTOMATION_CLAIM_MAX_RUNS = 8;
|
|
507
523
|
const AUTOMATION_PRECHECK_DEFAULT_TIMEOUT_MS = 6e4;
|
|
@@ -532,7 +548,7 @@ const AutomationActionSchema = z.z.discriminatedUnion("kind", [
|
|
|
532
548
|
worktree: z.z.boolean().optional(),
|
|
533
549
|
sticky: AutomationStickySchema.optional()
|
|
534
550
|
}),
|
|
535
|
-
z.z.object({ kind: z.z.literal("send"), sessionId: id$
|
|
551
|
+
z.z.object({ kind: z.z.literal("send"), sessionId: id$2, prompt: text }),
|
|
536
552
|
z.z.object({
|
|
537
553
|
kind: z.z.literal("script"),
|
|
538
554
|
command: z.z.array(z.z.string().min(1).max(4096)).min(1).max(256),
|
|
@@ -558,7 +574,7 @@ const maxRuntimeMs = z.z.number().int().min(6e4).max(7 * 864e5);
|
|
|
558
574
|
z.z.object({
|
|
559
575
|
name: AutomationNameSchema,
|
|
560
576
|
description: z.z.string().max(4e3).nullable().optional(),
|
|
561
|
-
machineId: id$
|
|
577
|
+
machineId: id$2,
|
|
562
578
|
trigger: AutomationTriggerSchema,
|
|
563
579
|
action: AutomationActionSchema,
|
|
564
580
|
concurrency: AutomationConcurrencySchema.optional(),
|
|
@@ -567,13 +583,13 @@ z.z.object({
|
|
|
567
583
|
/** B-548. Older servers strip it silently — clients must check the response echoes `precheck`. */
|
|
568
584
|
precheck: AutomationPrecheckSchema.nullable().optional(),
|
|
569
585
|
/** B-644: sessions this automation spawns join this project (quiet variant). Older servers strip it — check the echo. */
|
|
570
|
-
projectId: id$
|
|
586
|
+
projectId: id$2.nullable().optional()
|
|
571
587
|
});
|
|
572
588
|
z.z.object({
|
|
573
589
|
version: z.z.number().int().positive(),
|
|
574
590
|
name: AutomationNameSchema.optional(),
|
|
575
591
|
description: z.z.string().max(4e3).nullable().optional(),
|
|
576
|
-
machineId: id$
|
|
592
|
+
machineId: id$2.optional(),
|
|
577
593
|
trigger: AutomationTriggerSchema.optional(),
|
|
578
594
|
action: AutomationActionSchema.optional(),
|
|
579
595
|
concurrency: AutomationConcurrencySchema.optional(),
|
|
@@ -581,41 +597,41 @@ z.z.object({
|
|
|
581
597
|
/** B-548: omitted keeps the current precheck, `null` removes it. Changing `action` alone keeps it too. */
|
|
582
598
|
precheck: AutomationPrecheckSchema.nullable().optional(),
|
|
583
599
|
/** B-644: omitted keeps the current project, `null` detaches. */
|
|
584
|
-
projectId: id$
|
|
600
|
+
projectId: id$2.nullable().optional()
|
|
585
601
|
});
|
|
586
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");
|
|
587
603
|
z.z.object({ payload: payload.optional(), dedupeKey: z.z.string().min(1).max(256).optional() });
|
|
588
604
|
z.z.object({ payload: payload.optional() });
|
|
589
605
|
z.z.object({
|
|
590
|
-
machineId: id$
|
|
606
|
+
machineId: id$2,
|
|
591
607
|
limit: z.z.number().int().min(1).max(AUTOMATION_CLAIM_MAX_RUNS).optional(),
|
|
592
608
|
leaseMs: z.z.number().int().min(5e3).max(36e5).optional(),
|
|
593
609
|
/** B-548: what this daemon can execute (e.g. `precheck`). Older daemons send nothing; older servers strip it. */
|
|
594
610
|
capabilities: z.z.array(z.z.string().min(1).max(64)).max(32).optional()
|
|
595
611
|
});
|
|
596
612
|
z.z.object({
|
|
597
|
-
claimId: id$
|
|
613
|
+
claimId: id$2.optional(),
|
|
598
614
|
status: z.z.enum(["running", "done", "failed", "skipped"]).optional(),
|
|
599
|
-
sessionId: id$
|
|
615
|
+
sessionId: id$2.nullable().optional(),
|
|
600
616
|
stickyKey: z.z.string().min(1).max(512).optional(),
|
|
601
617
|
summary: z.z.string().max(AUTOMATION_SUMMARY_MAX_CHARS).nullable().optional(),
|
|
602
618
|
error: z.z.string().max(AUTOMATION_SUMMARY_MAX_CHARS).nullable().optional(),
|
|
603
619
|
exitCode: z.z.number().int().nullable().optional(),
|
|
604
620
|
needsAttention: z.z.boolean().optional(),
|
|
605
|
-
attentionReason: z.z.string().max(
|
|
621
|
+
attentionReason: z.z.string().max(AUTOMATION_ATTENTION_REASON_MAX_CHARS).nullable().optional(),
|
|
606
622
|
leaseMs: z.z.number().int().min(5e3).max(36e5).optional()
|
|
607
623
|
});
|
|
608
624
|
z.z.object({ by: z.z.string().min(1).max(64).optional() });
|
|
609
|
-
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 });
|
|
610
626
|
z.z.object({ key: z.z.string().min(1).max(512) });
|
|
611
627
|
z.z.object({
|
|
612
|
-
automationId: id$
|
|
628
|
+
automationId: id$2.optional(),
|
|
613
629
|
name: AutomationNameSchema.optional(),
|
|
614
630
|
status: z.z.string().min(1).max(64).optional(),
|
|
615
631
|
attention: z.z.enum(["1", "true", "0", "false"]).optional(),
|
|
616
632
|
limit: z.z.coerce.number().int().min(1).max(200).optional()
|
|
617
633
|
});
|
|
618
|
-
z.z.object({ machineId: id$
|
|
634
|
+
z.z.object({ machineId: id$2.optional() });
|
|
619
635
|
const PROJECT_SESSION_CAPABILITY = "project-v1";
|
|
620
636
|
const PROJECT_LIMITS = {
|
|
621
637
|
nameChars: 120,
|
|
@@ -627,11 +643,11 @@ const PROJECT_LIMITS = {
|
|
|
627
643
|
messageBytes: 64 * 1024,
|
|
628
644
|
presenceBatch: 200,
|
|
629
645
|
memberBatch: 200};
|
|
630
|
-
const id = z.z.string().min(1).max(128);
|
|
646
|
+
const id$1 = z.z.string().min(1).max(128);
|
|
631
647
|
const utf8Bytes = (value) => new TextEncoder().encode(value).length;
|
|
632
648
|
const boundedText = (maxBytes) => z.z.string().max(maxBytes).refine((v) => utf8Bytes(v) <= maxBytes, `exceeds ${maxBytes} bytes`);
|
|
633
649
|
const ProjectFolderSchema = z.z.object({
|
|
634
|
-
machineId: id,
|
|
650
|
+
machineId: id$1,
|
|
635
651
|
path: z.z.string().min(1).max(4096),
|
|
636
652
|
primary: z.z.boolean().optional()
|
|
637
653
|
});
|
|
@@ -651,9 +667,9 @@ z.z.object({
|
|
|
651
667
|
folders: z.z.array(ProjectFolderSchema).max(PROJECT_LIMITS.folders).optional(),
|
|
652
668
|
defaults: ProjectDefaultsSchema.optional(),
|
|
653
669
|
/** Idempotency: the same requestId returns the project it created. */
|
|
654
|
-
requestId: id.optional(),
|
|
670
|
+
requestId: id$1.optional(),
|
|
655
671
|
/** Optional initial members (e.g. "设为项目" moves a folder's sessions in one step). */
|
|
656
|
-
sessionIds: z.z.array(id).max(PROJECT_LIMITS.memberBatch).optional()
|
|
672
|
+
sessionIds: z.z.array(id$1).max(PROJECT_LIMITS.memberBatch).optional()
|
|
657
673
|
});
|
|
658
674
|
z.z.object({
|
|
659
675
|
name: z.z.string().trim().min(1).max(PROJECT_LIMITS.nameChars).optional(),
|
|
@@ -669,7 +685,7 @@ z.z.object({
|
|
|
669
685
|
summary: z.z.string().max(200).optional()
|
|
670
686
|
});
|
|
671
687
|
z.z.object({
|
|
672
|
-
sessionIds: z.z.array(id).min(1).max(PROJECT_LIMITS.memberBatch),
|
|
688
|
+
sessionIds: z.z.array(id$1).min(1).max(PROJECT_LIMITS.memberBatch),
|
|
673
689
|
via: ProjectMemberViaInputSchema.optional()
|
|
674
690
|
});
|
|
675
691
|
z.z.object({
|
|
@@ -679,15 +695,15 @@ z.z.object({
|
|
|
679
695
|
/** Entry id (or `#seq`) this entry replaces. */
|
|
680
696
|
supersedes: z.z.string().min(1).max(128).optional(),
|
|
681
697
|
/** Stamped by the wrapper (the agent cannot fill it). Absent = written by the user. */
|
|
682
|
-
authorSessionId: id.optional()
|
|
698
|
+
authorSessionId: id$1.optional()
|
|
683
699
|
});
|
|
684
700
|
z.z.object({
|
|
685
701
|
/** When set, only entries this session authored may be revoked. Absent = the owner. */
|
|
686
|
-
bySessionId: id.optional()
|
|
702
|
+
bySessionId: id$1.optional()
|
|
687
703
|
});
|
|
688
|
-
z.z.object({ teamId: id });
|
|
704
|
+
z.z.object({ teamId: id$1 });
|
|
689
705
|
const ProjectPresenceEntrySchema = z.z.object({
|
|
690
|
-
sessionId: id,
|
|
706
|
+
sessionId: id$1,
|
|
691
707
|
title: z.z.string().max(200).nullable().optional(),
|
|
692
708
|
agent: z.z.string().max(64).nullable().optional(),
|
|
693
709
|
machine: z.z.string().max(200).nullable().optional(),
|
|
@@ -699,19 +715,19 @@ const ProjectPresenceEntrySchema = z.z.object({
|
|
|
699
715
|
capabilities: z.z.array(z.z.string().max(64)).max(32).optional()
|
|
700
716
|
});
|
|
701
717
|
z.z.object({
|
|
702
|
-
machineId: id,
|
|
718
|
+
machineId: id$1,
|
|
703
719
|
sessions: z.z.array(ProjectPresenceEntrySchema).max(PROJECT_LIMITS.presenceBatch),
|
|
704
720
|
/** Sessions of this machine that stopped; their presence rows are marked `offline`. */
|
|
705
|
-
gone: z.z.array(id).max(PROJECT_LIMITS.presenceBatch).optional()
|
|
721
|
+
gone: z.z.array(id$1).max(PROJECT_LIMITS.presenceBatch).optional()
|
|
706
722
|
});
|
|
707
723
|
z.z.object({
|
|
708
|
-
fromSessionId: id,
|
|
709
|
-
toSessionId: id,
|
|
724
|
+
fromSessionId: id$1,
|
|
725
|
+
toSessionId: id$1,
|
|
710
726
|
body: boundedText(PROJECT_LIMITS.messageBytes).pipe(z.z.string().min(1))
|
|
711
727
|
});
|
|
712
728
|
z.z.object({
|
|
713
|
-
sessionId: id,
|
|
714
|
-
messageIds: z.z.array(id).min(1).max(100)
|
|
729
|
+
sessionId: id$1,
|
|
730
|
+
messageIds: z.z.array(id$1).min(1).max(100)
|
|
715
731
|
});
|
|
716
732
|
z.z.object({
|
|
717
733
|
full: z.z.enum(["0", "1", "true", "false"]).optional(),
|
|
@@ -750,9 +766,9 @@ function object(value) {
|
|
|
750
766
|
function stamp(value) {
|
|
751
767
|
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
752
768
|
}
|
|
753
|
-
function parseBuiltinTodo(raw,
|
|
769
|
+
function parseBuiltinTodo(raw, key2) {
|
|
754
770
|
if (!object(raw) || raw.schemaVersion !== 1 || typeof raw.id !== "string" || !UUID.test(raw.id)) return null;
|
|
755
|
-
if (
|
|
771
|
+
if (key2 !== void 0 && key2 !== BUILTIN_TODO_PREFIX + raw.id) return null;
|
|
756
772
|
if (typeof raw.title !== "string" || !raw.title.trim() || raw.title.length > TITLE_MAX_LENGTH) return null;
|
|
757
773
|
if (typeof raw.note !== "string" || raw.note.length > NOTE_MAX_LENGTH) return null;
|
|
758
774
|
if (raw.status !== "open" && raw.status !== "done") return null;
|
|
@@ -777,11 +793,11 @@ function encodeBuiltinTodo(todo) {
|
|
|
777
793
|
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
778
794
|
return btoa(binary);
|
|
779
795
|
}
|
|
780
|
-
function decodeBuiltinTodo(value,
|
|
796
|
+
function decodeBuiltinTodo(value, key2) {
|
|
781
797
|
try {
|
|
782
798
|
const binary = atob(value);
|
|
783
799
|
const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
784
|
-
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);
|
|
785
801
|
} catch {
|
|
786
802
|
return null;
|
|
787
803
|
}
|
|
@@ -789,12 +805,12 @@ function decodeBuiltinTodo(value, key) {
|
|
|
789
805
|
function sortBuiltinTodos(records) {
|
|
790
806
|
return [...records].sort((a, b) => a.order - b.order || a.id.localeCompare(b.id));
|
|
791
807
|
}
|
|
792
|
-
function createBuiltinTodoClient(credentials,
|
|
793
|
-
const serverUrl =
|
|
808
|
+
function createBuiltinTodoClient(credentials, options2) {
|
|
809
|
+
const serverUrl = options2.serverUrl.replace(/\/$/, "");
|
|
794
810
|
const token = credentials.token;
|
|
795
|
-
const clientId =
|
|
796
|
-
const fetcher =
|
|
797
|
-
const timeoutMs =
|
|
811
|
+
const clientId = options2.clientId;
|
|
812
|
+
const fetcher = options2.fetch ?? globalThis.fetch.bind(globalThis);
|
|
813
|
+
const timeoutMs = options2.timeoutMs ?? 15e3;
|
|
798
814
|
async function request(path, mutations, allowNotFound = false) {
|
|
799
815
|
const controller = new AbortController();
|
|
800
816
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
@@ -873,19 +889,19 @@ function createBuiltinTodoClient(credentials, options) {
|
|
|
873
889
|
const pendingCreates = /* @__PURE__ */ new Map();
|
|
874
890
|
async function get(id2) {
|
|
875
891
|
if (!UUID.test(id2)) throw new BuiltinTodoError("validation", "Invalid Todo ID");
|
|
876
|
-
const
|
|
877
|
-
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);
|
|
878
894
|
if (raw === void 0) return null;
|
|
879
|
-
const todo = object(raw) && typeof raw.value === "string" ? decodeBuiltinTodo(raw.value,
|
|
880
|
-
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) {
|
|
881
897
|
throw new BuiltinTodoError("invalid-response", "Invalid Todo read response");
|
|
882
898
|
}
|
|
883
899
|
return { ...todo, version: raw.version };
|
|
884
900
|
}
|
|
885
|
-
async function create(
|
|
886
|
-
const cleanTitle =
|
|
901
|
+
async function create(title2, note2 = "", id2) {
|
|
902
|
+
const cleanTitle = title2.trim();
|
|
887
903
|
if (id2 !== void 0 && !UUID.test(id2)) throw new BuiltinTodoError("validation", "Invalid Todo ID");
|
|
888
|
-
const payloadKey = JSON.stringify([cleanTitle,
|
|
904
|
+
const payloadKey = JSON.stringify([cleanTitle, note2, id2]);
|
|
889
905
|
let pending = pendingCreates.get(payloadKey);
|
|
890
906
|
if (pending?.operation) return pending.operation;
|
|
891
907
|
if (!pending) {
|
|
@@ -894,7 +910,7 @@ function createBuiltinTodoClient(credentials, options) {
|
|
|
894
910
|
schemaVersion: 1,
|
|
895
911
|
id: id2 ?? crypto.randomUUID(),
|
|
896
912
|
title: cleanTitle,
|
|
897
|
-
note,
|
|
913
|
+
note: note2,
|
|
898
914
|
status: "open",
|
|
899
915
|
order: 0,
|
|
900
916
|
createdAt: now,
|
|
@@ -907,14 +923,14 @@ function createBuiltinTodoClient(credentials, options) {
|
|
|
907
923
|
const entry = pending;
|
|
908
924
|
const operation = (async () => {
|
|
909
925
|
if (entry.attempted) {
|
|
910
|
-
const
|
|
911
|
-
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);
|
|
912
928
|
if (existing !== void 0) {
|
|
913
|
-
const todo = object(existing) && typeof existing.value === "string" ? decodeBuiltinTodo(existing.value,
|
|
914
|
-
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) {
|
|
915
931
|
throw new BuiltinTodoError("invalid-response", "Cannot confirm the previous Todo creation");
|
|
916
932
|
}
|
|
917
|
-
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");
|
|
918
934
|
return { ...todo, version: existing.version };
|
|
919
935
|
}
|
|
920
936
|
}
|
|
@@ -1157,8 +1173,202 @@ const ServerMigrateNoticeSchema = z.z.object({
|
|
|
1157
1173
|
handoff: z.z.string().regex(/^vh1\.[A-Za-z0-9_-]{16,2048}\.[A-Za-z0-9_-]{43}$/),
|
|
1158
1174
|
issuedAt: z.z.number().int().positive()
|
|
1159
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
|
+
}
|
|
1160
1366
|
|
|
1161
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;
|
|
1162
1372
|
exports.AUTOMATION_CLAIM_MAX_RUNS = AUTOMATION_CLAIM_MAX_RUNS;
|
|
1163
1373
|
exports.AUTOMATION_DAEMON_CAPABILITY_PRECHECK = AUTOMATION_DAEMON_CAPABILITY_PRECHECK;
|
|
1164
1374
|
exports.AUTOMATION_DEFAULT_LEASE_MS = AUTOMATION_DEFAULT_LEASE_MS;
|
|
@@ -1177,6 +1387,10 @@ exports.BUILTIN_TODO_DISCOVERY = BUILTIN_TODO_DISCOVERY;
|
|
|
1177
1387
|
exports.BUILTIN_TODO_SKILL = BUILTIN_TODO_SKILL;
|
|
1178
1388
|
exports.CODEX_STEER_CAPABILITY = CODEX_STEER_CAPABILITY;
|
|
1179
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;
|
|
1180
1394
|
exports.PI_STEER_CAPABILITY = PI_STEER_CAPABILITY;
|
|
1181
1395
|
exports.PROJECT_SESSION_CAPABILITY = PROJECT_SESSION_CAPABILITY;
|
|
1182
1396
|
exports.PROMPT_QUEUE_CAPABILITY = PROMPT_QUEUE_CAPABILITY;
|
|
@@ -1188,9 +1402,13 @@ exports.ServerMigrateNoticeSchema = ServerMigrateNoticeSchema;
|
|
|
1188
1402
|
exports.createBuiltinTodoClient = createBuiltinTodoClient;
|
|
1189
1403
|
exports.createEnvelope = createEnvelope;
|
|
1190
1404
|
exports.getAgentCodeDefaults = getAgentCodeDefaults;
|
|
1405
|
+
exports.isAttentionBoardLocalId = isAttentionBoardLocalId;
|
|
1191
1406
|
exports.isAutomationRunTerminal = isAutomationRunTerminal;
|
|
1192
1407
|
exports.isClaudeOpus55Model = isClaudeOpus55Model;
|
|
1193
1408
|
exports.isHarnessInstallId = isHarnessInstallId;
|
|
1409
|
+
exports.isInsideTeamWorktree = isInsideTeamWorktree;
|
|
1194
1410
|
exports.normalizeAgentKey = normalizeAgentKey;
|
|
1411
|
+
exports.ownerBoardPostToRest = ownerBoardPostToRest;
|
|
1412
|
+
exports.rebaseTeamWorktreePath = rebaseTeamWorktreePath;
|
|
1195
1413
|
exports.streamKeyOf = streamKeyOf;
|
|
1196
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';
|