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
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var mirrorProtocol = require('./mirrorProtocol-
|
|
4
|
-
var
|
|
3
|
+
var mirrorProtocol = require('./mirrorProtocol-c5g5MgNc.cjs');
|
|
4
|
+
var fsMkdir = require('./fsMkdir-0K3yENml.cjs');
|
|
5
|
+
var piRunnerArgs = require('./piRunnerArgs-BSPiS6tZ.cjs');
|
|
5
6
|
var fs = require('fs/promises');
|
|
6
7
|
var os$1 = require('os');
|
|
7
8
|
var tmp = require('tmp');
|
|
8
9
|
var axios = require('axios');
|
|
9
10
|
var node_fs = require('node:fs');
|
|
10
11
|
var path = require('node:path');
|
|
11
|
-
var configuration = require('./configuration-
|
|
12
|
-
var api = require('./api-
|
|
13
|
-
var spawnAgents = require('./spawnAgents-
|
|
14
|
-
var logger = require('./logger-
|
|
15
|
-
var index$2 = require('./index-
|
|
16
|
-
var auth = require('./auth-
|
|
12
|
+
var configuration = require('./configuration-K3I6yOjZ.cjs');
|
|
13
|
+
var api = require('./api-xZiqVynF.cjs');
|
|
14
|
+
var spawnAgents = require('./spawnAgents-Sfnf-4pN.cjs');
|
|
15
|
+
var logger = require('./logger-Cgwz30rK.cjs');
|
|
16
|
+
var index$2 = require('./index-BdJs0465.cjs');
|
|
17
|
+
var auth = require('./auth-CYtk9_ga.cjs');
|
|
17
18
|
var child_process = require('child_process');
|
|
18
|
-
var _package = require('./package-
|
|
19
|
-
var doctor = require('./doctor-
|
|
20
|
-
var spawnHappyCLI = require('./spawnHappyCLI-
|
|
21
|
-
var persistence = require('./persistence-
|
|
22
|
-
var controlClient = require('./controlClient-
|
|
23
|
-
var sessionOps = require('./sessionOps-
|
|
19
|
+
var _package = require('./package-3aPiSpZj.cjs');
|
|
20
|
+
var doctor = require('./doctor-CKgHUV4W.cjs');
|
|
21
|
+
var spawnHappyCLI = require('./spawnHappyCLI-CQwQs9G5.cjs');
|
|
22
|
+
var persistence = require('./persistence-DZRMUZZS.cjs');
|
|
23
|
+
var controlClient = require('./controlClient-ChqmxgbB.cjs');
|
|
24
|
+
var sessionOps = require('./sessionOps-BWlDlFYP.cjs');
|
|
24
25
|
var fastify = require('fastify');
|
|
25
26
|
var z = require('zod');
|
|
26
27
|
var fastifyTypeProviderZod = require('fastify-type-provider-zod');
|
|
@@ -28,66 +29,65 @@ var authRelay = require('./authRelay-Dy1qU9td.cjs');
|
|
|
28
29
|
var node_crypto = require('node:crypto');
|
|
29
30
|
var previewPath = require('./previewPath-B0rBdhy1.cjs');
|
|
30
31
|
var backgroundTaskActivity = require('./backgroundTaskActivity-CBvUdj39.cjs');
|
|
31
|
-
var rateLimitWindows = require('./rateLimitWindows-
|
|
32
|
-
var peerTools = require('./peerTools-
|
|
32
|
+
var rateLimitWindows = require('./rateLimitWindows-CPV0nLeq.cjs');
|
|
33
|
+
var peerTools = require('./peerTools-Dxe7iCi_.cjs');
|
|
33
34
|
var os = require('node:os');
|
|
34
|
-
var remoteSessionClient = require('./remoteSessionClient-
|
|
35
|
-
var bootstrap = require('./bootstrap-
|
|
36
|
-
var index$1 = require('./index-
|
|
35
|
+
var remoteSessionClient = require('./remoteSessionClient-HQAKAvVd.cjs');
|
|
36
|
+
var bootstrap = require('./bootstrap-C50NkfPx.cjs');
|
|
37
|
+
var index$1 = require('./index-y4JNyz9H.cjs');
|
|
37
38
|
var require$$0 = require('fs');
|
|
38
39
|
var require$$1 = require('path');
|
|
39
40
|
var node_child_process = require('node:child_process');
|
|
40
41
|
var projectPath = require('./projectPath-C3ioB4Bu.cjs');
|
|
41
42
|
var doctorReadiness = require('./doctorReadiness-Dl6yRQCy.cjs');
|
|
42
|
-
var machineMetadata = require('./machineMetadata-
|
|
43
|
+
var machineMetadata = require('./machineMetadata-BSOGMNRi.cjs');
|
|
43
44
|
var fileStore = require('./fileStore-7qhnbs6N.cjs');
|
|
44
45
|
var pi = require('./pi-DlsrPCTa.cjs');
|
|
45
46
|
var require$$3 = require('crypto');
|
|
46
47
|
var detectCLI = require('./detectCLI-BuYR_Qxe.cjs');
|
|
47
|
-
var handleResumeCommand = require('./handleResumeCommand-
|
|
48
|
+
var handleResumeCommand = require('./handleResumeCommand-D9myBN2N.cjs');
|
|
48
49
|
var webPanels = require('./webPanels-FCgFKvVe.cjs');
|
|
49
|
-
var index = require('./index-
|
|
50
|
+
var index = require('./index-Fq-jxjsB.cjs');
|
|
50
51
|
var promises = require('node:fs/promises');
|
|
51
52
|
var cliUpdate = require('./cliUpdate-DsKXPFYp.cjs');
|
|
52
|
-
var client = require('./client-
|
|
53
|
-
var client$1 = require('./client-
|
|
54
|
-
var
|
|
53
|
+
var client = require('./client-DcKJ0ul_.cjs');
|
|
54
|
+
var client$1 = require('./client-DYGDBD0M.cjs');
|
|
55
|
+
var daemonSupervisor = require('./daemonSupervisor-57JYYzMf.cjs');
|
|
55
56
|
var path$1 = require('./path-B7zW-WwE.cjs');
|
|
56
57
|
var editPaths = require('./editPaths-Bqp4OFPw.cjs');
|
|
57
|
-
var startFileWatcher = require('./startFileWatcher-
|
|
58
|
-
var sync = require('./sync-
|
|
58
|
+
var startFileWatcher = require('./startFileWatcher-GW4_E7dV.cjs');
|
|
59
|
+
var sync = require('./sync-BMDkyo75.cjs');
|
|
59
60
|
var types = require('./types-CRS-srZK.cjs');
|
|
60
61
|
var tmuxSocket = require('./tmuxSocket-D-Xt6Vn-.cjs');
|
|
61
|
-
var sessionLock = require('./sessionLock-
|
|
62
|
+
var sessionLock = require('./sessionLock-BXvFN6uw.cjs');
|
|
62
63
|
var doctor$1 = require('./doctor-u46qYYKX.cjs');
|
|
63
|
-
var resources = require('./resources-
|
|
64
|
+
var resources = require('./resources-CqwHPhdK.cjs');
|
|
64
65
|
var node_util = require('node:util');
|
|
65
|
-
var template = require('./template-
|
|
66
|
-
var daemonSupervisor = require('./daemonSupervisor-B-SPSqhs.cjs');
|
|
66
|
+
var template = require('./template-CeC1dYe-.cjs');
|
|
67
67
|
var loginShellEnv = require('./loginShellEnv-BkuYtExZ.cjs');
|
|
68
|
-
require('./acpSessionResume-
|
|
69
|
-
require('./lidState-
|
|
68
|
+
require('./acpSessionResume-mVoJ75vI.cjs');
|
|
69
|
+
require('./lidState-Bcs5kRHi.cjs');
|
|
70
70
|
require('node:events');
|
|
71
71
|
require('socket.io-client');
|
|
72
|
-
require('./pushNotifications-
|
|
72
|
+
require('./pushNotifications-CgIrYml3.cjs');
|
|
73
73
|
require('./contentLogMetadata-ZSFk_NjQ.cjs');
|
|
74
74
|
require('./limits-C-a7gr04.cjs');
|
|
75
|
-
require('./time-
|
|
76
|
-
require('./registerCommonHandlers-
|
|
75
|
+
require('./time-CdCotzKU.cjs');
|
|
76
|
+
require('./registerCommonHandlers-D1pC83Op.cjs');
|
|
77
77
|
require('util');
|
|
78
78
|
require('cross-spawn');
|
|
79
79
|
require('@paralleldrive/cuid2');
|
|
80
80
|
require('chalk');
|
|
81
|
+
require('node:module');
|
|
81
82
|
require('tweetnacl');
|
|
82
|
-
require('./browser-
|
|
83
|
+
require('./browser-CxKZLd2T.cjs');
|
|
83
84
|
require('open');
|
|
84
85
|
require('./ids-B6ZC0HGt.cjs');
|
|
85
86
|
require('url');
|
|
86
|
-
require('./localHappyAgentAuth-
|
|
87
|
+
require('./localHappyAgentAuth-CypTSe42.cjs');
|
|
87
88
|
require('./processTreeSnapshot-mDbnuojn.cjs');
|
|
88
89
|
require('ps-list');
|
|
89
90
|
|
|
90
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
91
91
|
function _interopNamespaceDefault(e) {
|
|
92
92
|
var n = Object.create(null);
|
|
93
93
|
if (e) {
|
|
@@ -5114,196 +5114,6 @@ async function waitForSessionLive(sessionId, live, timeoutMs = AUTOMATION_WAKE_T
|
|
|
5114
5114
|
return true;
|
|
5115
5115
|
}
|
|
5116
5116
|
|
|
5117
|
-
const CLAUDE_KEYCHAIN_SERVICE_PREFIX = "Claude Code";
|
|
5118
|
-
function keychainIdentity(env = process.env, deps = {}) {
|
|
5119
|
-
const home = deps.home ?? os.homedir();
|
|
5120
|
-
const secureDir = env.CLAUDE_SECURESTORAGE_CONFIG_DIR?.trim();
|
|
5121
|
-
const configDirEnv = env.CLAUDE_CONFIG_DIR?.trim();
|
|
5122
|
-
const configDir = secureDir || configDirEnv || path.join(home, ".claude");
|
|
5123
|
-
const hasCustomDir = Boolean(secureDir || configDirEnv);
|
|
5124
|
-
const dirSuffix = hasCustomDir ? "-" + node_crypto.createHash("sha256").update(configDir.normalize("NFC")).digest("hex").slice(0, 8) : "";
|
|
5125
|
-
const oauthSuffix = env.CLAUDE_CODE_OAUTH_CLIENT_ID?.trim() ? "-custom-oauth" : "";
|
|
5126
|
-
const rawAccount = env.USER || safeUsername(deps.username);
|
|
5127
|
-
const account = /^[a-zA-Z0-9._-]+$/.test(rawAccount) ? rawAccount : "claude-code-user";
|
|
5128
|
-
return {
|
|
5129
|
-
service: `${CLAUDE_KEYCHAIN_SERVICE_PREFIX}${oauthSuffix}-credentials${dirSuffix}`,
|
|
5130
|
-
account,
|
|
5131
|
-
configDir,
|
|
5132
|
-
credentialsPath: path.join(configDir, ".credentials.json")
|
|
5133
|
-
};
|
|
5134
|
-
}
|
|
5135
|
-
function safeUsername(provider) {
|
|
5136
|
-
try {
|
|
5137
|
-
return provider ? provider() : os.userInfo().username;
|
|
5138
|
-
} catch {
|
|
5139
|
-
return "";
|
|
5140
|
-
}
|
|
5141
|
-
}
|
|
5142
|
-
|
|
5143
|
-
const CLAUDE_AUTH_PROBE_VERSION = 1;
|
|
5144
|
-
const LOCAL_CREDENTIAL_SOURCE = "Claude local credentials";
|
|
5145
|
-
function classifyAuthStatus(run, credentialSource) {
|
|
5146
|
-
const localSource = credentialSource === void 0 || credentialSource === LOCAL_CREDENTIAL_SOURCE;
|
|
5147
|
-
if (run.spawnError) {
|
|
5148
|
-
return { status: "error", diagnosis: "probe-crash", detail: `could not run claude auth status: ${run.spawnError}` };
|
|
5149
|
-
}
|
|
5150
|
-
if (run.timedOut) {
|
|
5151
|
-
return { status: "error", diagnosis: "probe-timeout", detail: "claude auth status did not answer within the timeout" };
|
|
5152
|
-
}
|
|
5153
|
-
const parsed = parseJsonObject(run.stdout);
|
|
5154
|
-
if (!parsed) {
|
|
5155
|
-
if (!localSource) return { status: "unknown", authMethod: credentialSource, detail: `auth status unparseable under ${credentialSource}` };
|
|
5156
|
-
return { status: "error", diagnosis: "probe-crash", detail: `claude auth status returned no JSON (exit ${run.exitCode ?? "null"})` };
|
|
5157
|
-
}
|
|
5158
|
-
const authMethod = typeof parsed.authMethod === "string" ? parsed.authMethod : void 0;
|
|
5159
|
-
const subscriptionType = typeof parsed.subscriptionType === "string" ? parsed.subscriptionType : void 0;
|
|
5160
|
-
if (parsed.loggedIn === true) {
|
|
5161
|
-
return { status: "ok", authMethod: localSource ? authMethod : credentialSource, subscriptionType };
|
|
5162
|
-
}
|
|
5163
|
-
if (!localSource) {
|
|
5164
|
-
return { status: "unknown", authMethod: credentialSource, detail: `Claude Code reports loggedIn=false under ${credentialSource}; not a local-credential failure` };
|
|
5165
|
-
}
|
|
5166
|
-
return { status: "not-logged-in", authMethod, subscriptionType, detail: "Claude Code in the daemon context reports it is not logged in" };
|
|
5167
|
-
}
|
|
5168
|
-
function parseJsonObject(text) {
|
|
5169
|
-
const trimmed = text.trim();
|
|
5170
|
-
if (!trimmed) return null;
|
|
5171
|
-
const start = trimmed.indexOf("{");
|
|
5172
|
-
if (start < 0) return null;
|
|
5173
|
-
try {
|
|
5174
|
-
const value = JSON.parse(trimmed.slice(start));
|
|
5175
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
5176
|
-
} catch {
|
|
5177
|
-
return null;
|
|
5178
|
-
}
|
|
5179
|
-
}
|
|
5180
|
-
function resolveSdkClaudeBinary(platform = process.platform, arch = process.arch, resolver = (s) => module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('run-C_FumCQk.cjs', document.baseURI).href))).resolve(s)) {
|
|
5181
|
-
const platformArch = `${platform}-${arch}`;
|
|
5182
|
-
const candidates = [
|
|
5183
|
-
`@anthropic-ai/claude-agent-sdk-${platformArch}/claude`,
|
|
5184
|
-
`@anthropic-ai/claude-agent-sdk-${platformArch}/claude.exe`
|
|
5185
|
-
];
|
|
5186
|
-
for (const candidate of candidates) {
|
|
5187
|
-
try {
|
|
5188
|
-
return resolver(candidate);
|
|
5189
|
-
} catch {
|
|
5190
|
-
}
|
|
5191
|
-
}
|
|
5192
|
-
return null;
|
|
5193
|
-
}
|
|
5194
|
-
function interpretSecurityRead(result) {
|
|
5195
|
-
if (result.error === "ENOENT") return { kind: "unsupported" };
|
|
5196
|
-
if (result.error === "timeout") return { kind: "error", detail: "security timed out" };
|
|
5197
|
-
if (result.exitCode === 44) return { kind: "absent" };
|
|
5198
|
-
if (result.exitCode === 36) return { kind: "unreadable" };
|
|
5199
|
-
if (result.exitCode !== 0) return { kind: "error", detail: `security exited ${result.exitCode ?? "null"}` };
|
|
5200
|
-
const raw = result.stdout.trim();
|
|
5201
|
-
if (!raw) return { kind: "absent" };
|
|
5202
|
-
const parsed = parseJsonObject(raw);
|
|
5203
|
-
const oauth = parsed && typeof parsed.claudeAiOauth === "object" && parsed.claudeAiOauth ? parsed.claudeAiOauth : null;
|
|
5204
|
-
if (!oauth) return { kind: "present", accessToken: "", refreshToken: "", raw };
|
|
5205
|
-
return {
|
|
5206
|
-
kind: "present",
|
|
5207
|
-
accessToken: typeof oauth.accessToken === "string" ? oauth.accessToken : "",
|
|
5208
|
-
refreshToken: typeof oauth.refreshToken === "string" ? oauth.refreshToken : "",
|
|
5209
|
-
raw
|
|
5210
|
-
};
|
|
5211
|
-
}
|
|
5212
|
-
function interpretCredentialsFile(text) {
|
|
5213
|
-
if (text === null) return { exists: false, hasTokens: false, refreshToken: "" };
|
|
5214
|
-
const parsed = parseJsonObject(text);
|
|
5215
|
-
const oauth = parsed && typeof parsed.claudeAiOauth === "object" && parsed.claudeAiOauth ? parsed.claudeAiOauth : null;
|
|
5216
|
-
const access = oauth && typeof oauth.accessToken === "string" ? oauth.accessToken : "";
|
|
5217
|
-
const refresh = oauth && typeof oauth.refreshToken === "string" ? oauth.refreshToken : "";
|
|
5218
|
-
return { exists: true, hasTokens: access.length > 0 && refresh.length > 0, refreshToken: refresh };
|
|
5219
|
-
}
|
|
5220
|
-
function tokenTail(token) {
|
|
5221
|
-
return token ? node_crypto.createHash("sha256").update(token).digest("hex").slice(-6) : "";
|
|
5222
|
-
}
|
|
5223
|
-
const CREDENTIALS_REJECTED_DETAIL = "Credentials exist but Claude Code rejects them in the daemon context \u2014 the refresh token has most likely been rotated away by another store or another machine using the same credentials. Log in again with `claude` on this machine.";
|
|
5224
|
-
function diagnoseStores(input) {
|
|
5225
|
-
const { status, keychain, file } = input;
|
|
5226
|
-
if (keychain.kind === "present") {
|
|
5227
|
-
const empty = keychain.accessToken.length === 0 && keychain.refreshToken.length === 0;
|
|
5228
|
-
if (empty && file.hasTokens && status === "not-logged-in") {
|
|
5229
|
-
return {
|
|
5230
|
-
diagnosis: "keychain-empty-item",
|
|
5231
|
-
repairable: "delete-empty-keychain-item",
|
|
5232
|
-
keychainRaw: keychain.raw,
|
|
5233
|
-
detail: "The login keychain holds a Claude Code credentials item with empty tokens; Claude Code prefers it over the valid ~/.claude/.credentials.json and reports not logged in."
|
|
5234
|
-
};
|
|
5235
|
-
}
|
|
5236
|
-
if (!empty && file.hasTokens && tokenTail(keychain.refreshToken) !== tokenTail(file.refreshToken)) {
|
|
5237
|
-
return {
|
|
5238
|
-
diagnosis: "store-divergence",
|
|
5239
|
-
detail: "Keychain and ~/.claude/.credentials.json hold different refresh tokens; one of them will stop working at its next refresh. Treat the daemon-context login as canonical, or pin credentialStore=file."
|
|
5240
|
-
};
|
|
5241
|
-
}
|
|
5242
|
-
return {};
|
|
5243
|
-
}
|
|
5244
|
-
if ((keychain.kind === "absent" || keychain.kind === "unreadable" || keychain.kind === "unsupported") && !file.hasTokens) {
|
|
5245
|
-
return { diagnosis: "no-credentials", detail: "No Claude Code credentials found for this daemon context; log in with `claude` on this machine." };
|
|
5246
|
-
}
|
|
5247
|
-
if (keychain.kind === "unreadable" && file.hasTokens && status === "not-logged-in") {
|
|
5248
|
-
return { diagnosis: "credentials-rejected", detail: CREDENTIALS_REJECTED_DETAIL };
|
|
5249
|
-
}
|
|
5250
|
-
if (keychain.kind === "error") {
|
|
5251
|
-
return { detail: `keychain check failed: ${keychain.detail}` };
|
|
5252
|
-
}
|
|
5253
|
-
return {};
|
|
5254
|
-
}
|
|
5255
|
-
function securityReadArgs(identity) {
|
|
5256
|
-
return ["find-generic-password", "-s", identity.service, "-a", identity.account, "-w"];
|
|
5257
|
-
}
|
|
5258
|
-
function securityDeleteArgs(identity) {
|
|
5259
|
-
return ["delete-generic-password", "-s", identity.service, "-a", identity.account];
|
|
5260
|
-
}
|
|
5261
|
-
const HAPPY_DAEMON_LAUNCHD_LABEL = "com.mereith.happy-daemon";
|
|
5262
|
-
function classifyLineage(input) {
|
|
5263
|
-
if (input.platform !== "darwin") return "other";
|
|
5264
|
-
const label = input.label ?? HAPPY_DAEMON_LAUNCHD_LABEL;
|
|
5265
|
-
if (input.env.XPC_SERVICE_NAME !== label) return "other";
|
|
5266
|
-
if (input.launchdJobPid !== null && input.ancestorPids.includes(input.launchdJobPid)) return "launchd";
|
|
5267
|
-
return "inherited-env";
|
|
5268
|
-
}
|
|
5269
|
-
function parseLaunchctlPid(printOutput) {
|
|
5270
|
-
const match = /^\s*pid\s*=\s*(\d+)/m.exec(printOutput);
|
|
5271
|
-
return match ? Number(match[1]) : null;
|
|
5272
|
-
}
|
|
5273
|
-
function keychainOffShimDir(happyLibDir) {
|
|
5274
|
-
return path.join(happyLibDir, "scripts", "shims", "keychain-off");
|
|
5275
|
-
}
|
|
5276
|
-
function withKeychainOffPath(path$1, shimDir) {
|
|
5277
|
-
const parts = (path$1 ?? "").split(path.delimiter).filter((p) => p && p !== shimDir);
|
|
5278
|
-
return [shimDir, ...parts].join(path.delimiter);
|
|
5279
|
-
}
|
|
5280
|
-
function buildClaudeAuthState(input) {
|
|
5281
|
-
const { classification, diagnosis } = input;
|
|
5282
|
-
const detail = (diagnosis?.detail ?? classification.detail)?.slice(0, 200);
|
|
5283
|
-
const state = {
|
|
5284
|
-
probeVersion: CLAUDE_AUTH_PROBE_VERSION,
|
|
5285
|
-
daemonPid: input.daemonPid,
|
|
5286
|
-
status: classification.status,
|
|
5287
|
-
context: { platform: input.platform, lineage: input.lineage, credentialStore: input.credentialStore },
|
|
5288
|
-
checkedAt: input.now ?? Date.now()
|
|
5289
|
-
};
|
|
5290
|
-
if (classification.authMethod) state.authMethod = classification.authMethod;
|
|
5291
|
-
if (classification.subscriptionType) state.subscriptionType = classification.subscriptionType;
|
|
5292
|
-
const diag = diagnosis?.diagnosis ?? classification.diagnosis;
|
|
5293
|
-
if (diag) state.diagnosis = diag;
|
|
5294
|
-
if (detail) state.detail = detail;
|
|
5295
|
-
if (diagnosis?.repairable) state.repairable = diagnosis.repairable;
|
|
5296
|
-
return state;
|
|
5297
|
-
}
|
|
5298
|
-
function claudeAuthStateChanged(prev, next) {
|
|
5299
|
-
if (!prev) return true;
|
|
5300
|
-
const strip = ({ checkedAt: _c, ...rest }) => JSON.stringify(rest);
|
|
5301
|
-
return strip(prev) !== strip(next);
|
|
5302
|
-
}
|
|
5303
|
-
function keychainIdentityFor(env) {
|
|
5304
|
-
return keychainIdentity(env);
|
|
5305
|
-
}
|
|
5306
|
-
|
|
5307
5117
|
const CLAUDE_AUTH_PROBE_INTERVAL_MS = 10 * 60 * 1e3;
|
|
5308
5118
|
const CLAUDE_AUTH_REFRESH_INTERVAL_MS = 30 * 60 * 1e3;
|
|
5309
5119
|
const PROBE_TIMEOUT_MS = 8e3;
|
|
@@ -5314,6 +5124,7 @@ class ClaudeAuthService {
|
|
|
5314
5124
|
this.opts = opts;
|
|
5315
5125
|
this.env = opts.env ?? process.env;
|
|
5316
5126
|
this.platform = opts.platform ?? process.platform;
|
|
5127
|
+
this.lineage = opts.lineage ?? null;
|
|
5317
5128
|
}
|
|
5318
5129
|
timer = null;
|
|
5319
5130
|
signalTimer = null;
|
|
@@ -5354,7 +5165,7 @@ class ClaudeAuthService {
|
|
|
5354
5165
|
if (this.opts.getCredentialStore() !== "file") return {};
|
|
5355
5166
|
const shim = this.resolveShimDir();
|
|
5356
5167
|
if (!shim) return {};
|
|
5357
|
-
return { PATH: withKeychainOffPath(this.env.PATH, shim) };
|
|
5168
|
+
return { PATH: daemonSupervisor.withKeychainOffPath(this.env.PATH, shim) };
|
|
5358
5169
|
}
|
|
5359
5170
|
effectiveCredentialStore() {
|
|
5360
5171
|
if (this.opts.getCredentialStore() !== "file") return "auto";
|
|
@@ -5378,8 +5189,8 @@ class ClaudeAuthService {
|
|
|
5378
5189
|
const state = await this.probe("repair-precheck", true);
|
|
5379
5190
|
const seen = this.lastDiagnosis;
|
|
5380
5191
|
if (state.diagnosis !== "keychain-empty-item" || !seen?.keychainRaw) return { error: "precondition-failed", claudeAuth: state };
|
|
5381
|
-
const identity = keychainIdentityFor(this.env);
|
|
5382
|
-
const again = interpretSecurityRead(await this.security(securityReadArgs(identity)));
|
|
5192
|
+
const identity = daemonSupervisor.keychainIdentityFor(this.env);
|
|
5193
|
+
const again = daemonSupervisor.interpretSecurityRead(await this.security(daemonSupervisor.securityReadArgs(identity)));
|
|
5383
5194
|
if (again.kind !== "present" || again.raw !== seen.keychainRaw || again.accessToken || again.refreshToken) {
|
|
5384
5195
|
return { error: "precondition-failed", claudeAuth: state };
|
|
5385
5196
|
}
|
|
@@ -5390,7 +5201,7 @@ class ClaudeAuthService {
|
|
|
5390
5201
|
} catch (error) {
|
|
5391
5202
|
return { error: `backup-failed: ${String(error)}`, claudeAuth: state };
|
|
5392
5203
|
}
|
|
5393
|
-
const del = await this.security(securityDeleteArgs(identity));
|
|
5204
|
+
const del = await this.security(daemonSupervisor.securityDeleteArgs(identity));
|
|
5394
5205
|
if (del.exitCode !== 0) return { error: `delete-failed: security exited ${del.exitCode ?? "null"}`, claudeAuth: state };
|
|
5395
5206
|
logger.logger.debug("[CLAUDE AUTH] deleted empty-token keychain item after backup");
|
|
5396
5207
|
const after = await this.probe("repair-done", true);
|
|
@@ -5398,7 +5209,7 @@ class ClaudeAuthService {
|
|
|
5398
5209
|
}
|
|
5399
5210
|
// ── internals ────────────────────────────────────────────────────────
|
|
5400
5211
|
resolveShimDir() {
|
|
5401
|
-
const dir = keychainOffShimDir(this.opts.happyLibDir);
|
|
5212
|
+
const dir = daemonSupervisor.keychainOffShimDir(this.opts.happyLibDir);
|
|
5402
5213
|
const bin = path.join(dir, "security");
|
|
5403
5214
|
try {
|
|
5404
5215
|
if (!node_fs.statSync(bin).isFile()) return null;
|
|
@@ -5418,20 +5229,20 @@ class ClaudeAuthService {
|
|
|
5418
5229
|
diagnosis = await this.diagnose(classification.status);
|
|
5419
5230
|
this.lastDiagnosis = diagnosis;
|
|
5420
5231
|
} else if (classification.status === "not-logged-in") {
|
|
5421
|
-
const file = interpretCredentialsFile(this.readCredentialsFile());
|
|
5232
|
+
const file = daemonSupervisor.interpretCredentialsFile(this.readCredentialsFile());
|
|
5422
5233
|
if (!file.hasTokens) {
|
|
5423
5234
|
diagnosis = {
|
|
5424
5235
|
diagnosis: "no-credentials",
|
|
5425
5236
|
detail: store === "file" ? "credentialStore=file and ~/.claude/.credentials.json has no tokens; log in with `claude` from a terminal on this machine." : "No Claude Code credentials found for this daemon context; log in with `claude` on this machine."
|
|
5426
5237
|
};
|
|
5427
5238
|
} else {
|
|
5428
|
-
diagnosis = { diagnosis: "credentials-rejected", detail: CREDENTIALS_REJECTED_DETAIL };
|
|
5239
|
+
diagnosis = { diagnosis: "credentials-rejected", detail: daemonSupervisor.CREDENTIALS_REJECTED_DETAIL };
|
|
5429
5240
|
}
|
|
5430
5241
|
}
|
|
5431
5242
|
if (storeRequested === "file" && store === "auto") {
|
|
5432
|
-
diagnosis = { ...diagnosis ?? {}, detail: `credentialStore=file requested but the keychain-off shim is missing under ${keychainOffShimDir(this.opts.happyLibDir)}; running in auto mode.` };
|
|
5243
|
+
diagnosis = { ...diagnosis ?? {}, detail: `credentialStore=file requested but the keychain-off shim is missing under ${daemonSupervisor.keychainOffShimDir(this.opts.happyLibDir)}; running in auto mode.` };
|
|
5433
5244
|
}
|
|
5434
|
-
const state = buildClaudeAuthState({
|
|
5245
|
+
const state = daemonSupervisor.buildClaudeAuthState({
|
|
5435
5246
|
daemonPid: process.pid,
|
|
5436
5247
|
platform: this.platform,
|
|
5437
5248
|
lineage: await this.resolveLineage(),
|
|
@@ -5440,7 +5251,7 @@ class ClaudeAuthService {
|
|
|
5440
5251
|
diagnosis,
|
|
5441
5252
|
now: this.opts.now?.() ?? Date.now()
|
|
5442
5253
|
});
|
|
5443
|
-
const changed = claudeAuthStateChanged(this.last, state);
|
|
5254
|
+
const changed = daemonSupervisor.claudeAuthStateChanged(this.last, state);
|
|
5444
5255
|
const stale = state.checkedAt - this.lastPublishedAt >= CLAUDE_AUTH_REFRESH_INTERVAL_MS;
|
|
5445
5256
|
if (changed) {
|
|
5446
5257
|
logger.logger.debug(`[CLAUDE AUTH] ${reason}: status=${state.status} diagnosis=${state.diagnosis ?? "-"} lineage=${state.context.lineage} store=${state.context.credentialStore}`);
|
|
@@ -5458,7 +5269,7 @@ class ClaudeAuthService {
|
|
|
5458
5269
|
return state;
|
|
5459
5270
|
}
|
|
5460
5271
|
async runAuthStatus() {
|
|
5461
|
-
const binary = resolveSdkClaudeBinary(this.platform, process.arch);
|
|
5272
|
+
const binary = daemonSupervisor.resolveSdkClaudeBinary(this.platform, process.arch);
|
|
5462
5273
|
if (!binary) {
|
|
5463
5274
|
return { status: "claude-missing", diagnosis: "sdk-binary-missing", detail: "The Claude Code binary bundled with the Agent SDK is missing; remote sessions cannot start." };
|
|
5464
5275
|
}
|
|
@@ -5503,16 +5314,16 @@ class ClaudeAuthService {
|
|
|
5503
5314
|
done({ stdout, exitCode: code, timedOut: false });
|
|
5504
5315
|
});
|
|
5505
5316
|
});
|
|
5506
|
-
return classifyAuthStatus(run, this.opts.credentialSource);
|
|
5317
|
+
return daemonSupervisor.classifyAuthStatus(run, this.opts.credentialSource);
|
|
5507
5318
|
}
|
|
5508
5319
|
async diagnose(status) {
|
|
5509
|
-
const identity = keychainIdentityFor(this.env);
|
|
5510
|
-
const keychain = interpretSecurityRead(await this.security(securityReadArgs(identity)));
|
|
5511
|
-
const file = interpretCredentialsFile(this.readCredentialsFile(identity.credentialsPath));
|
|
5512
|
-
return diagnoseStores({ status, keychain, file });
|
|
5320
|
+
const identity = daemonSupervisor.keychainIdentityFor(this.env);
|
|
5321
|
+
const keychain = daemonSupervisor.interpretSecurityRead(await this.security(daemonSupervisor.securityReadArgs(identity)));
|
|
5322
|
+
const file = daemonSupervisor.interpretCredentialsFile(this.readCredentialsFile(identity.credentialsPath));
|
|
5323
|
+
return daemonSupervisor.diagnoseStores({ status, keychain, file });
|
|
5513
5324
|
}
|
|
5514
5325
|
readCredentialsFile(path) {
|
|
5515
|
-
const target = path ?? keychainIdentityFor(this.env).credentialsPath;
|
|
5326
|
+
const target = path ?? daemonSupervisor.keychainIdentityFor(this.env).credentialsPath;
|
|
5516
5327
|
try {
|
|
5517
5328
|
return node_fs.existsSync(target) ? node_fs.readFileSync(target, "utf8") : null;
|
|
5518
5329
|
} catch {
|
|
@@ -5537,9 +5348,9 @@ class ClaudeAuthService {
|
|
|
5537
5348
|
return this.lineage;
|
|
5538
5349
|
}
|
|
5539
5350
|
const uid = typeof process.getuid === "function" ? process.getuid() : null;
|
|
5540
|
-
const launchdJobPid = uid === null ? null : parseLaunchctlPid(await this.exec("launchctl", ["print", `gui/${uid}/${HAPPY_DAEMON_LAUNCHD_LABEL}`]));
|
|
5351
|
+
const launchdJobPid = uid === null ? null : daemonSupervisor.parseLaunchctlPid(await this.exec("launchctl", ["print", `gui/${uid}/${daemonSupervisor.HAPPY_DAEMON_LAUNCHD_LABEL}`]));
|
|
5541
5352
|
const ancestors = await this.ancestorPids();
|
|
5542
|
-
this.lineage = classifyLineage({ platform: this.platform, env: this.env, launchdJobPid, ancestorPids: ancestors });
|
|
5353
|
+
this.lineage = daemonSupervisor.classifyLineage({ platform: this.platform, env: this.env, launchdJobPid, ancestorPids: ancestors });
|
|
5543
5354
|
return this.lineage;
|
|
5544
5355
|
}
|
|
5545
5356
|
async ancestorPids() {
|
|
@@ -6952,7 +6763,9 @@ function createAutomationRunner(deps) {
|
|
|
6952
6763
|
function persist(receipt) {
|
|
6953
6764
|
writeReceipt(home, receipt, now());
|
|
6954
6765
|
}
|
|
6955
|
-
async function finish(item,
|
|
6766
|
+
async function finish(item, input) {
|
|
6767
|
+
const { report: report2, clipped } = template.clipAutomationReport(input);
|
|
6768
|
+
if (clipped.length) deps.log(`Automation run ${item.runId} report clipped: ${clipped.map((c) => `${c.field} ${c.from}\u2192${c.to}`).join(", ")}`);
|
|
6956
6769
|
try {
|
|
6957
6770
|
await client.report(item.runId, report2);
|
|
6958
6771
|
} catch (error) {
|
|
@@ -8592,8 +8405,10 @@ async function startDaemon() {
|
|
|
8592
8405
|
}
|
|
8593
8406
|
});
|
|
8594
8407
|
const daemonClaudeCredentials = doctorReadiness.resolveClaudeCredentialReadiness();
|
|
8595
|
-
const
|
|
8596
|
-
|
|
8408
|
+
const launchdJob = process.platform === "darwin" ? await daemonSupervisor.probeLaunchdJob() : null;
|
|
8409
|
+
const daemonSupervisor$1 = daemonSupervisor.detectDaemonSupervisor(process.env, process.platform, launchdJob);
|
|
8410
|
+
const lineage = daemonSupervisor.daemonLineage(daemonSupervisor$1, process.env, process.platform, launchdJob);
|
|
8411
|
+
logger.logger.debug(`[DAEMON RUN] Supervisor: ${daemonSupervisor$1} (lineage ${lineage}${launchdJob ? `, launchd job pid ${launchdJob.jobPid ?? "-"}` : ""})`);
|
|
8597
8412
|
let fileState = {
|
|
8598
8413
|
pid: process.pid,
|
|
8599
8414
|
httpPort: controlPort,
|
|
@@ -8676,7 +8491,8 @@ async function startDaemon() {
|
|
|
8676
8491
|
await persistence.writeSettings({ ...settings, claudeCredentialStore: store });
|
|
8677
8492
|
claudeCredentialStoreSetting = store;
|
|
8678
8493
|
},
|
|
8679
|
-
publish: (state) => apiMachine.setClaudeAuthState(state)
|
|
8494
|
+
publish: (state) => apiMachine.setClaudeAuthState(state),
|
|
8495
|
+
lineage
|
|
8680
8496
|
});
|
|
8681
8497
|
claudeAuthServiceRef = claudeAuthService;
|
|
8682
8498
|
apiMachine.setClaudeAuthHandlers({
|
|
@@ -8853,8 +8669,8 @@ async function startDaemon() {
|
|
|
8853
8669
|
await controlClient.cleanupDaemonState();
|
|
8854
8670
|
await persistence.releaseDaemonLock(daemonLockHandle);
|
|
8855
8671
|
await stopCaffeinate();
|
|
8856
|
-
if (daemonSupervisor$1
|
|
8857
|
-
logger.logger.debug(`[DAEMON RUN]
|
|
8672
|
+
if (daemonSupervisor$1 !== "none") {
|
|
8673
|
+
logger.logger.debug(`[DAEMON RUN] ${daemonSupervisor$1}-supervised: exiting ${HANDOVER_EXIT_CODE} for the supervisor to restart on the new bundle`);
|
|
8858
8674
|
process.exit(HANDOVER_EXIT_CODE);
|
|
8859
8675
|
}
|
|
8860
8676
|
try {
|
|
@@ -8946,7 +8762,9 @@ async function startDaemon() {
|
|
|
8946
8762
|
// B-688: this daemon serves the model-config-* RPCs (web gates 「模型与 Provider」 on it).
|
|
8947
8763
|
modelConfigVersion: MODEL_CONFIG_CAPABILITY_VERSION,
|
|
8948
8764
|
// B-719: this daemon serves `harness-install` (web gates the Install / Update buttons on it).
|
|
8949
|
-
harnessInstallVersion: index.HARNESS_INSTALL_CAPABILITY_VERSION
|
|
8765
|
+
harnessInstallVersion: index.HARNESS_INSTALL_CAPABILITY_VERSION,
|
|
8766
|
+
// B-755: this daemon serves `fs-mkdir` (web gates 「新建工作目录」 on it).
|
|
8767
|
+
fsMkdirVersion: fsMkdir.FS_MKDIR_CAPABILITY_VERSION
|
|
8950
8768
|
})).catch(() => logger.logger.debug("[DAEMON RUN] Teams capability publication will retry on reconnect"));
|
|
8951
8769
|
const cleanupAndShutdown = async (source, errorMessage) => {
|
|
8952
8770
|
webPanelsSync.stop();
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
|
-
import { c as claimSessionOrExit, a as applyServerSnapshot, b as applyReconnectReplay, w as withoutServerSnapshot, m as mergeReconnectMetadata, e as exitCursorStamp } from './sessionLock-
|
|
3
|
-
import { r as readSettings, H as HIBERNATION_CAPABILITY, a as resolveCheckMs, l as latchKeepAwake, e as evaluateWrapperIdle } from './persistence-
|
|
4
|
-
import { D as DEFAULT_CLAUDE_PERMISSION_MODE, H as HibernationProbe, c as commitHibernation } from './defaultPermissionMode-
|
|
2
|
+
import { c as claimSessionOrExit, a as applyServerSnapshot, b as applyReconnectReplay, w as withoutServerSnapshot, m as mergeReconnectMetadata, e as exitCursorStamp } from './sessionLock-CXOOX-VD.mjs';
|
|
3
|
+
import { r as readSettings, H as HIBERNATION_CAPABILITY, a as resolveCheckMs, l as latchKeepAwake, e as evaluateWrapperIdle } from './persistence-zJo4r7YI.mjs';
|
|
4
|
+
import { D as DEFAULT_CLAUDE_PERMISSION_MODE, H as HibernationProbe, c as commitHibernation } from './defaultPermissionMode-U9LuUeQh.mjs';
|
|
5
5
|
import { randomUUID } from 'node:crypto';
|
|
6
|
-
import { c as connectionState, A as ApiClient, s as startOfflineReconnection } from './api-
|
|
7
|
-
import { l as logger } from './logger-
|
|
8
|
-
import { s as spawnOriginTags, a as sessionWorktreeMetadata } from './createSessionMetadata-
|
|
9
|
-
import { p as packageJson } from './package-
|
|
10
|
-
import { P as PROMPT_QUEUE_CAPABILITY, a as PROJECT_SESSION_CAPABILITY } from './index-
|
|
6
|
+
import { c as connectionState, A as ApiClient, s as startOfflineReconnection } from './api-C29WLYkW.mjs';
|
|
7
|
+
import { l as logger } from './logger-RMPh5aqe.mjs';
|
|
8
|
+
import { s as spawnOriginTags, a as sessionWorktreeMetadata } from './createSessionMetadata-C1MbLQnh.mjs';
|
|
9
|
+
import { p as packageJson } from './package-CTrz6U3C.mjs';
|
|
10
|
+
import { P as PROMPT_QUEUE_CAPABILITY, a as PROJECT_SESSION_CAPABILITY } from './index-BptfFoXM.mjs';
|
|
11
11
|
import { F as FORK_BACKFILL_CAPABILITY, p as publishForkBackfillWhenCommitted } from './forkBackfill-DYIjlN1Z.mjs';
|
|
12
|
-
import { c as configuration } from './configuration-
|
|
13
|
-
import { n as notifyDaemonSessionStarted, c as checkDaemonHibernation } from './controlClient-
|
|
14
|
-
import { g as getInitialMachineMetadata } from './machineMetadata-
|
|
12
|
+
import { c as configuration } from './configuration-elzht62L.mjs';
|
|
13
|
+
import { n as notifyDaemonSessionStarted, c as checkDaemonHibernation } from './controlClient-CuYQs2aZ.mjs';
|
|
14
|
+
import { g as getInitialMachineMetadata } from './machineMetadata-BTUtPRth.mjs';
|
|
15
15
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
16
16
|
import { resolve, join } from 'node:path';
|
|
17
|
-
import { c as createSessionForStartup } from './startupSessionCreate-
|
|
17
|
+
import { c as createSessionForStartup } from './startupSessionCreate-BcAGYo51.mjs';
|
|
18
18
|
import { a as applySandboxPermissionPolicy, r as resolveInitialClaudePermissionMode, m as mapToClaudeMode, b as reconcilePublishedPermissionMode } from './permissionMode-CH4FoZfU.mjs';
|
|
19
19
|
import { d as decodeBase64, e as encodeBase64 } from './authRelay-DhQhkBvX.mjs';
|
|
20
20
|
import { readFile } from 'node:fs/promises';
|
|
21
|
-
import { C as CLAUDE_ATTACHMENT_KINDS, s as stripAttachmentManifest } from './attachmentContent-
|
|
21
|
+
import { C as CLAUDE_ATTACHMENT_KINDS, s as stripAttachmentManifest } from './attachmentContent-DwY0uIg6.mjs';
|
|
22
22
|
import { T as TranscriptPathHints } from './transcriptCursor-B7T_gkQ0.mjs';
|
|
23
23
|
import { p as planClaudeStartup } from './startupPlan-DFMyNgAs.mjs';
|
|
24
24
|
import 'node:fs';
|
|
@@ -26,35 +26,36 @@ import './processTreeSnapshot-CuLJDNC-.mjs';
|
|
|
26
26
|
import 'node:child_process';
|
|
27
27
|
import 'zod';
|
|
28
28
|
import 'axios';
|
|
29
|
-
import './lidState-
|
|
29
|
+
import './lidState-DXeYTsrm.mjs';
|
|
30
30
|
import 'os';
|
|
31
31
|
import 'child_process';
|
|
32
32
|
import 'node:events';
|
|
33
33
|
import 'socket.io-client';
|
|
34
|
-
import './pushNotifications-
|
|
34
|
+
import './pushNotifications-C4R9-1hU.mjs';
|
|
35
35
|
import './contentLogMetadata-BlWI0egu.mjs';
|
|
36
36
|
import './limits-DIo7rEBR.mjs';
|
|
37
|
-
import './time-
|
|
38
|
-
import './registerCommonHandlers-
|
|
37
|
+
import './time-B2KKdAym.mjs';
|
|
38
|
+
import './registerCommonHandlers-a9lHojSV.mjs';
|
|
39
39
|
import 'util';
|
|
40
40
|
import 'fs/promises';
|
|
41
41
|
import 'crypto';
|
|
42
42
|
import 'path';
|
|
43
43
|
import 'cross-spawn';
|
|
44
44
|
import '@paralleldrive/cuid2';
|
|
45
|
-
import './sync
|
|
45
|
+
import './sync--QUIOuf8.mjs';
|
|
46
46
|
import './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
47
47
|
import 'chalk';
|
|
48
48
|
import 'node:util';
|
|
49
49
|
import './detectCLI-CSGMlV51.mjs';
|
|
50
50
|
import 'fs';
|
|
51
|
-
import './localHappyAgentAuth-
|
|
51
|
+
import './localHappyAgentAuth-C1A4ChCR.mjs';
|
|
52
52
|
import 'tweetnacl';
|
|
53
|
+
import './fsMkdir-DumgLTzR.mjs';
|
|
53
54
|
import 'url';
|
|
54
55
|
|
|
55
56
|
const DEFAULT_CLAUDE_MODEL = void 0;
|
|
56
57
|
const DEFAULT_CLAUDE_EFFORT = void 0;
|
|
57
|
-
const importRunClaudeDeps = () => import('./runClaudeDeps-
|
|
58
|
+
const importRunClaudeDeps = () => import('./runClaudeDeps-COgZaUZm.mjs');
|
|
58
59
|
async function runClaude(credentials, options = {}) {
|
|
59
60
|
logger.debug(`[CLAUDE] ===== CLAUDE MODE STARTING =====`);
|
|
60
61
|
logger.debug(`[CLAUDE] This is the Claude agent, NOT Gemini`);
|
|
@@ -68,7 +69,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
68
69
|
const isAssistantVariant = process.env.HAPPY_SESSION_VARIANT === "assistant";
|
|
69
70
|
if (isAssistantVariant) {
|
|
70
71
|
try {
|
|
71
|
-
const { bootstrapAssistantHome } = await import('./bootstrap-
|
|
72
|
+
const { bootstrapAssistantHome } = await import('./bootstrap-DS8Acdhm.mjs');
|
|
72
73
|
await bootstrapAssistantHome();
|
|
73
74
|
} catch (error) {
|
|
74
75
|
logger.debug("[START] Assistant home bootstrap failed:", error);
|
|
@@ -188,7 +189,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
188
189
|
}
|
|
189
190
|
if (!response) {
|
|
190
191
|
let offlineSessionId = null;
|
|
191
|
-
const { claudeLocal } = await import('./claudeLocal-
|
|
192
|
+
const { claudeLocal } = await import('./claudeLocal-U1Fa9sJo.mjs');
|
|
192
193
|
const { createSessionScanner: createSessionScanner2 } = await loadDeps();
|
|
193
194
|
const reconnection = startOfflineReconnection({
|
|
194
195
|
serverUrl: configuration.serverUrl,
|