@visorcraft/idlehands 4.0.13 → 4.0.14
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/CHANGELOG.md +7 -0
- package/dist/{agent-via-gateway-C1akskt-.js → agent-via-gateway-B0077UOc.js} +1 -1
- package/dist/{agent-via-gateway-C9xTFnnb.js → agent-via-gateway-BCActbIf.js} +7 -7
- package/dist/{agent-via-gateway-B7gDrTh2.js → agent-via-gateway-D-FbIr6E.js} +2 -2
- package/dist/{agent-via-gateway-Cq6YTkRw.js → agent-via-gateway-DFnFArbP.js} +1 -1
- package/dist/{agents-BEWuTIwE.js → agents-DBtNXoSW.js} +4 -4
- package/dist/{agents.config-s_1D920P.js → agents.config-C48CGAxv.js} +1 -1
- package/dist/{agents.config-cH3kcrKU.js → agents.config-a7WEBiP9.js} +1 -1
- package/dist/{anton-bQ51g5Ec.js → anton-BiE961do.js} +137 -11
- package/dist/{anton-gFIz387q.js → anton-BzjiLD-a.js} +137 -11
- package/dist/{anton-DZGESeSl.js → anton-GmxStpbM.js} +137 -11
- package/dist/{anton-Cs3aBMKq.js → anton-fsipCiB9.js} +137 -11
- package/dist/{audio-preflight-vD3mDc6w.js → audio-preflight-CSSlgO89.js} +4 -4
- package/dist/{auth-choice-CoDCd8IM.js → auth-choice-B9F26cWG.js} +1 -1
- package/dist/{auth-choice-Dunr1I8A.js → auth-choice-DCHD89CG.js} +1 -1
- package/dist/{banner-XXOWQkH8.js → banner-DGxHi5f3.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +2 -2
- package/dist/{channel-options-JZ8UUgne.js → channel-options-BURifbbT.js} +1 -1
- package/dist/{channel-options-DcbnvkV8.js → channel-options-DZ237bIi.js} +1 -1
- package/dist/{channel-web-Z-H-wjMO.js → channel-web-Dx3LCcqS.js} +2 -2
- package/dist/{channel-web-Dz8l9j3Z.js → channel-web-Ylr-WudQ.js} +2 -2
- package/dist/{channels-cli-DVTF8msL.js → channels-cli-BHyVWKE_.js} +7 -7
- package/dist/{channels-cli-F1TB2Ms2.js → channels-cli-CntOyA1l.js} +7 -7
- package/dist/{chrome-DEnkfZ9p.js → chrome-Do5potHV.js} +9 -9
- package/dist/{cli-Cysh5mku.js → cli-DnAZgvLv.js} +2 -2
- package/dist/{cli-CLfBho_N.js → cli-DxFD9X-g.js} +2 -2
- package/dist/{command-registry-BzM89IOr.js → command-registry-BB2Vnuy4.js} +10 -10
- package/dist/{completion-cli-C5Y0omSs.js → completion-cli-Cd_zlB-2.js} +1 -1
- package/dist/{completion-cli-CWl8tMGs.js → completion-cli-eFXXaRI-.js} +2 -2
- package/dist/{config-cli-DY7H5mxq.js → config-cli-C0kgcpE4.js} +1 -1
- package/dist/{config-cli-DrupHrLQ.js → config-cli-CNuPoVE4.js} +1 -1
- package/dist/{configure-teHRuPU7.js → configure-BDO6l1oe.js} +3 -3
- package/dist/{configure-CEhvh4Tl.js → configure-DEyZZjPG.js} +3 -3
- package/dist/{deliver-5FLCa6tB.js → deliver-whAbSPLk.js} +1 -1
- package/dist/{deps--Jd_1mvW.js → deps-7AsluBQV.js} +1 -1
- package/dist/{deps-BuqRbUb-.js → deps-8ieGS4Mv.js} +1 -1
- package/dist/{deps-CEc0DzO7.js → deps-CIF1pkFi.js} +1 -1
- package/dist/{deps-DOKkEv5X.js → deps-CXtbmEWH.js} +1 -1
- package/dist/{doctor-completion-jhxR4t3O.js → doctor-completion-BM1W0ErJ.js} +1 -1
- package/dist/{doctor-completion-C47EWkPr.js → doctor-completion-DZ7EW_dp.js} +1 -1
- package/dist/{emergency-stop-DeVGttt7.js → emergency-stop-BQVndluY.js} +2 -2
- package/dist/{emergency-stop-BDOqqnou.js → emergency-stop-C5022igA.js} +2 -2
- package/dist/{emergency-stop-CC3HM3fX.js → emergency-stop-DdNkOB3t.js} +2 -2
- package/dist/{emergency-stop-C1Aq7hF2.js → emergency-stop-DpTSZhRz.js} +7 -7
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +7 -7
- package/dist/{gateway-cli-CwuxFfnq.js → gateway-cli-CgCMdrYY.js} +9 -9
- package/dist/{gateway-cli-Bg9EHlHZ.js → gateway-cli-DvDS1_s1.js} +9 -9
- package/dist/{health-B5FcoZjN.js → health-Bs81nsdt.js} +1 -1
- package/dist/{health-D-LRUDN7.js → health-CPiopwcS.js} +1 -1
- package/dist/{hooks-cli-hH93rV1P.js → hooks-cli-CNq30Huh.js} +3 -3
- package/dist/{hooks-cli-DrwJGeyQ.js → hooks-cli-DXM6dTkU.js} +3 -3
- package/dist/{image-C_aN5P6-.js → image-BAsQlUqT.js} +1 -1
- package/dist/index.js +7 -7
- package/dist/llm-slug-generator.js +2 -2
- package/dist/{models-C7BxqYrW.js → models-CVGwjQpG.js} +2 -2
- package/dist/{models-cli-CDDj0F5v.js → models-cli-2QkLeKdt.js} +4 -4
- package/dist/{models-cli-CqjmKMK2.js → models-cli-bkbKnWld.js} +3 -3
- package/dist/{npm-resolution-BjPIvwHA.js → npm-resolution-CmAIOir0.js} +1 -1
- package/dist/{npm-resolution-C_gT5wrI.js → npm-resolution-DHetuEi8.js} +1 -1
- package/dist/{onboard-CAifMogc.js → onboard-Du522rv9.js} +2 -2
- package/dist/{onboard-DyZAtFGg.js → onboard-IDM50Cwp.js} +2 -2
- package/dist/{onboard-channels-Bk3dz_Jr.js → onboard-channels-5uQfEVIz.js} +1 -1
- package/dist/{onboard-channels-DAk60Ns1.js → onboard-channels-CHLOUR52.js} +1 -1
- package/dist/{onboarding-DxXFvGbr.js → onboarding-B73ADr9Y.js} +3 -3
- package/dist/{onboarding-kCJZ-hVf.js → onboarding-Ct8sM6do.js} +3 -3
- package/dist/{onboarding.finalize-Dl63X819.js → onboarding.finalize-DEVkNjj0.js} +6 -6
- package/dist/{onboarding.finalize-CLyBIGRt.js → onboarding.finalize-mNlZG1KO.js} +7 -7
- package/dist/{pi-embedded-B4tp4aBd.js → pi-embedded-ChimfAJ-.js} +11 -11
- package/dist/{pi-embedded-CNvCKXkm.js → pi-embedded-bwvtdswf.js} +26 -26
- package/dist/{pi-embedded-helpers-C2j0LfJC.js → pi-embedded-helpers-Ct2rwp-P.js} +4 -4
- package/dist/{plugin-registry-CVL1r-yd.js → plugin-registry-BBx7owin.js} +1 -1
- package/dist/{plugin-registry-n---u7EU.js → plugin-registry-CYh53OcU.js} +1 -1
- package/dist/plugin-sdk/{agent-via-gateway-nyxykUkn.js → agent-via-gateway-C2tn6sON.js} +2 -2
- package/dist/plugin-sdk/{anton-BdO0Oxvp.js → anton-_MnTuJJ-.js} +137 -11
- package/dist/plugin-sdk/{channel-web-CtnWXT6I.js → channel-web-DwtLzVOR.js} +2 -2
- package/dist/plugin-sdk/{deps-Be1yXgl3.js → deps-mdAvVF88.js} +1 -1
- package/dist/plugin-sdk/{emergency-stop-qkFklwE3.js → emergency-stop-DYCGWJzN.js} +2 -2
- package/dist/plugin-sdk/index.js +3 -3
- package/dist/plugin-sdk/{reply-Csf1i8F8.js → reply-B-q4HnAx.js} +11 -11
- package/dist/plugin-sdk/{web-Cs2SXpS-.js → web-P5eS5E4t.js} +3 -3
- package/dist/{plugins-cli--xMWIg-4.js → plugins-cli-SxHWgGz6.js} +3 -3
- package/dist/{plugins-cli-D3VgmVpQ.js → plugins-cli-TmKS47EG.js} +3 -3
- package/dist/{program-C4UqPGzI.js → program-ZVWCD0Zm.js} +8 -8
- package/dist/{program-context-Dp52v2OQ.js → program-context-3VJmK0G6.js} +18 -18
- package/dist/{prompt-select-styled-DlX1LGGJ.js → prompt-select-styled-D7s-dTdd.js} +4 -4
- package/dist/{prompt-select-styled-CsGzk9Gq.js → prompt-select-styled-DefgYXen.js} +4 -4
- package/dist/{provider-auth-helpers-Czzq_QPi.js → provider-auth-helpers-DZhIVPGv.js} +1 -1
- package/dist/{provider-auth-helpers-DOkJeW-i.js → provider-auth-helpers-ZH_-N5zd.js} +1 -1
- package/dist/{push-apns-RknfH2wN.js → push-apns-Do1ENlJt.js} +1 -1
- package/dist/{push-apns-BtFayED4.js → push-apns-xWUFiO5-.js} +1 -1
- package/dist/{pw-ai-DjmrIQle.js → pw-ai-yrIWfcWX.js} +1 -1
- package/dist/{register.agent-C35pTLnm.js → register.agent-BQjgsbPA.js} +9 -9
- package/dist/{register.agent-BiHrmIpA.js → register.agent-oVyiMffI.js} +8 -8
- package/dist/{register.configure-BPdGcoT-.js → register.configure-24YtUj4s.js} +8 -8
- package/dist/{register.configure-DCf6SaYp.js → register.configure-D_zfBA_E.js} +8 -8
- package/dist/{register.maintenance-DUdYmaQm.js → register.maintenance-BccFDIZU.js} +9 -9
- package/dist/{register.maintenance-DujCPOfC.js → register.maintenance-CkYNqabD.js} +8 -8
- package/dist/{register.message-BhzLKaq7.js → register.message-CPejF6cS.js} +3 -3
- package/dist/{register.message-BHLa16p6.js → register.message-CySQp5gA.js} +3 -3
- package/dist/{register.onboard-DqRuNACj.js → register.onboard-BddM-Tey.js} +2 -2
- package/dist/{register.onboard-hOo1cBls.js → register.onboard-Cg5R87xG.js} +2 -2
- package/dist/{register.orchestrator-anton-DDUP6r-1.js → register.orchestrator-anton-Dfd2g3y-.js} +2 -2
- package/dist/{register.orchestrator-anton-gJUfWbMJ.js → register.orchestrator-anton-uFQntDpJ.js} +2 -2
- package/dist/{register.setup-Cg9pGGKa.js → register.setup-Bla4J47z.js} +2 -2
- package/dist/{register.setup-1kqsk9Nz.js → register.setup-Cnil6_M-.js} +2 -2
- package/dist/{register.status-health-sessions-DWCD-xxm.js → register.status-health-sessions-CI6-RlLt.js} +4 -4
- package/dist/{register.status-health-sessions-DGVjxQ4x.js → register.status-health-sessions-CiakJrlx.js} +4 -4
- package/dist/{register.subclis-C39R-X4d.js → register.subclis-9fhzxHCF.js} +9 -9
- package/dist/{reply-DuYN0-Pb.js → reply-Cmj0wbnT.js} +11 -11
- package/dist/{run-main-DhnKFvJ8.js → run-main-DUtPECK6.js} +15 -15
- package/dist/{runner-CZW_eyf2.js → runner-Bv_BA3vd.js} +1 -1
- package/dist/{server-node-events-CsvrVnbd.js → server-node-events--qmTbghp.js} +3 -3
- package/dist/{server-node-events-S-Ffj9aJ.js → server-node-events-DwUtqxW5.js} +3 -3
- package/dist/{status-OrfDNo6n.js → status-CMG5erwf.js} +2 -2
- package/dist/{status-DtnoXYQp.js → status-CPCpSX9k.js} +2 -2
- package/dist/{subagent-registry-CV8jrQca.js → subagent-registry-DHwrN9Oj.js} +11 -11
- package/dist/{update-cli-UpWfq3c5.js → update-cli-CQhZlXlT.js} +8 -8
- package/dist/{update-cli-DZfUy8hM.js → update-cli-DMjQ-pCl.js} +9 -9
- package/dist/{update-runner-GJO5-g7n.js → update-runner-BnTu_uJ4.js} +1 -1
- package/dist/{update-runner-DTzgmQYD.js → update-runner-CghbY9Ay.js} +1 -1
- package/dist/{web-y9QkD_tf.js → web-BJk05p_4.js} +8 -8
- package/dist/{web-DpyY5rK8.js → web-J7TF5rpD.js} +3 -3
- package/dist/{web-CwYkIq_A.js → web-U5rtNi4Q.js} +3 -3
- package/dist/{web-BC36pno5.js → web-weF5X5MU.js} +3 -3
- package/extensions/acpx/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/discord/package.json +1 -1
- package/extensions/feishu/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/hand/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +6 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +6 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +6 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +6 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +6 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +6 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +6 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Docs: https://docs.idlehands.ai
|
|
4
4
|
|
|
5
|
+
## 4.0.14
|
|
6
|
+
|
|
7
|
+
### Fixes
|
|
8
|
+
|
|
9
|
+
- Anton preflight reliability: add multi-pass discovery with structured JSON extraction, repair-pass retries, and fallback plan persistence so discovery can recover when models return malformed output or claim success without writing the plan file.
|
|
10
|
+
- Anton preflight redundancy: when discovery reports `incomplete` but no plan file exists, Anton now validates declared paths, attempts deterministic plan recovery, and only advances when a non-empty plan file is verified.
|
|
11
|
+
|
|
5
12
|
## 4.0.13
|
|
6
13
|
|
|
7
14
|
### Fixes
|
|
@@ -4,7 +4,7 @@ import { t as formatCliCommand } from "./command-format-CPa5ksO_.js";
|
|
|
4
4
|
import { r as listAgentIds } from "./agent-scope-mLXQGQde.js";
|
|
5
5
|
import { s as normalizeAgentId } from "./session-key-B9ePuoPx.js";
|
|
6
6
|
import { h as GATEWAY_CLIENT_NAMES, l as normalizeMessageChannel, m as GATEWAY_CLIENT_MODES } from "./message-channel-Qpj4ExtQ.js";
|
|
7
|
-
import { D as resolveSessionKeyForRequest, E as agentCommand } from "./subagent-registry-
|
|
7
|
+
import { D as resolveSessionKeyForRequest, E as agentCommand } from "./subagent-registry-DHwrN9Oj.js";
|
|
8
8
|
import { a as randomIdempotencyKey, n as callGateway } from "./call-DuNslqj2.js";
|
|
9
9
|
import { n as withProgress } from "./progress-B76RkFx7.js";
|
|
10
10
|
|
|
@@ -11,14 +11,14 @@ import { t as formatCliCommand } from "./command-format-BAxx4PW5.js";
|
|
|
11
11
|
import "./env-BpvqFD5n.js";
|
|
12
12
|
import "./dock-QcCdS4qA.js";
|
|
13
13
|
import "./tokens-Cg4XNE3H.js";
|
|
14
|
-
import { H as callGateway, U as randomIdempotencyKey, a as agentCommand, o as resolveSessionKeyForRequest, v as withProgress } from "./pi-embedded-
|
|
14
|
+
import { H as callGateway, U as randomIdempotencyKey, a as agentCommand, o as resolveSessionKeyForRequest, v as withProgress } from "./pi-embedded-bwvtdswf.js";
|
|
15
15
|
import "./plugins-D-_jp4FO.js";
|
|
16
16
|
import "./accounts-BwrguHMw.js";
|
|
17
17
|
import "./bindings-hT7SPhiA.js";
|
|
18
18
|
import "./auth-store-D1JaYlig.js";
|
|
19
19
|
import "./send-J10cQN4A.js";
|
|
20
20
|
import "./send-DLZt92Da.js";
|
|
21
|
-
import "./deliver-
|
|
21
|
+
import "./deliver-whAbSPLk.js";
|
|
22
22
|
import "./diagnostic-jHCdo9Am.js";
|
|
23
23
|
import "./diagnostic-session-state-Bx2Le86J.js";
|
|
24
24
|
import "./accounts-BRVjft5i.js";
|
|
@@ -26,8 +26,8 @@ import "./send-Dd4xdAHf.js";
|
|
|
26
26
|
import "./image-ops-BDG-MYYV.js";
|
|
27
27
|
import "./pi-model-discovery-Dic-M5qw.js";
|
|
28
28
|
import { d as GATEWAY_CLIENT_MODES, f as GATEWAY_CLIENT_NAMES, s as normalizeMessageChannel } from "./message-channel-DqqfOIdx.js";
|
|
29
|
-
import "./pi-embedded-helpers-
|
|
30
|
-
import "./chrome-
|
|
29
|
+
import "./pi-embedded-helpers-Ct2rwp-P.js";
|
|
30
|
+
import "./chrome-Do5potHV.js";
|
|
31
31
|
import "./ssrf-DappnhDp.js";
|
|
32
32
|
import "./skills-nQcWk6Z6.js";
|
|
33
33
|
import "./path-alias-guards-CGbCFqW8.js";
|
|
@@ -40,7 +40,7 @@ import "./accounts-CBoBCTgA.js";
|
|
|
40
40
|
import "./paths-vOrMwCEQ.js";
|
|
41
41
|
import "./tool-images-CpZSs-zE.js";
|
|
42
42
|
import "./thinking-BFsWfunr.js";
|
|
43
|
-
import "./image-
|
|
43
|
+
import "./image-BAsQlUqT.js";
|
|
44
44
|
import "./manager-DYOflU5p.js";
|
|
45
45
|
import "./gemini-auth-m2hi6OmF.js";
|
|
46
46
|
import "./fetch-guard-BdCPmLBP.js";
|
|
@@ -54,7 +54,7 @@ import "./ir-BwkcXPZC.js";
|
|
|
54
54
|
import "./render-Ddkk6wf8.js";
|
|
55
55
|
import "./commands-registry-1-Rv2-IS.js";
|
|
56
56
|
import "./skill-commands-CHpRgsOw.js";
|
|
57
|
-
import "./runner-
|
|
57
|
+
import "./runner-Bv_BA3vd.js";
|
|
58
58
|
import "./fetch-ChVgjTkv.js";
|
|
59
59
|
import "./channel-activity-C3LJmSjf.js";
|
|
60
60
|
import "./tables-CJKtUpY0.js";
|
|
@@ -64,7 +64,7 @@ import "./send-Cn2wvd3W.js";
|
|
|
64
64
|
import "./resolve-route-BI3VjtwE.js";
|
|
65
65
|
import "./proxy-CNZpb4NE.js";
|
|
66
66
|
import "./replies-CqYEEgmA.js";
|
|
67
|
-
import "./deps-
|
|
67
|
+
import "./deps-CIF1pkFi.js";
|
|
68
68
|
|
|
69
69
|
//#region src/commands/agent-via-gateway.ts
|
|
70
70
|
const NO_GATEWAY_TIMEOUT_MS = 2147e6;
|
|
@@ -12,7 +12,7 @@ import "./boolean-CE7i9tBR.js";
|
|
|
12
12
|
import "./env-B5G1qwGc.js";
|
|
13
13
|
import "./dock-BgOmHcbh.js";
|
|
14
14
|
import "./tokens-BRLyURxW.js";
|
|
15
|
-
import { H as randomIdempotencyKey, V as callGateway, a as agentCommand, o as resolveSessionKeyForRequest, v as withProgress } from "./pi-embedded-
|
|
15
|
+
import { H as randomIdempotencyKey, V as callGateway, a as agentCommand, o as resolveSessionKeyForRequest, v as withProgress } from "./pi-embedded-ChimfAJ-.js";
|
|
16
16
|
import "./plugins-CRB60mCJ.js";
|
|
17
17
|
import "./accounts-Dk8mJIrQ.js";
|
|
18
18
|
import "./bindings-D3b5Fmc9.js";
|
|
@@ -67,7 +67,7 @@ import "./send-D4bMycQu.js";
|
|
|
67
67
|
import "./resolve-route-DuttYY7A.js";
|
|
68
68
|
import "./proxy-CRB9oCP5.js";
|
|
69
69
|
import "./replies-6_GxvQYe.js";
|
|
70
|
-
import "./deps
|
|
70
|
+
import "./deps-7AsluBQV.js";
|
|
71
71
|
|
|
72
72
|
//#region src/commands/agent-via-gateway.ts
|
|
73
73
|
const NO_GATEWAY_TIMEOUT_MS = 2147e6;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { Mt as resolveSessionKeyForRequest, jt as agentCommand } from "./reply-
|
|
2
|
+
import { Mt as resolveSessionKeyForRequest, jt as agentCommand } from "./reply-Cmj0wbnT.js";
|
|
3
3
|
import { r as listAgentIds } from "./agent-scope-RA0zXRpu.js";
|
|
4
4
|
import { s as normalizeAgentId } from "./session-key-Cuihcz_O.js";
|
|
5
5
|
import { It as loadConfig } from "./model-selection-0dGxYGp8.js";
|
|
@@ -6,18 +6,18 @@ import { t as formatCliCommand } from "./command-format-CPa5ksO_.js";
|
|
|
6
6
|
import { a as resolveAgentDir, b as DEFAULT_IDENTITY_FILENAME, d as resolveDefaultAgentId, n as listAgentEntries, u as resolveAgentWorkspaceDir } from "./agent-scope-mLXQGQde.js";
|
|
7
7
|
import { m as DEFAULT_ACCOUNT_ID, s as normalizeAgentId, t as DEFAULT_AGENT_ID } from "./session-key-B9ePuoPx.js";
|
|
8
8
|
import { n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin } from "./plugins-CCrfZ49T.js";
|
|
9
|
-
import { M as identityHasValues, P as parseIdentityMarkdown } from "./subagent-registry-
|
|
9
|
+
import { M as identityHasValues, P as parseIdentityMarkdown } from "./subagent-registry-DHwrN9Oj.js";
|
|
10
10
|
import { l as resolveSessionTranscriptsDirForAgent } from "./paths-CC17i2eK.js";
|
|
11
11
|
import { a as ensureWorkspaceAndSessions, l as moveToTrash } from "./onboard-helpers-Dp6wXNs7.js";
|
|
12
12
|
import { t as WizardCancelledError } from "./prompts-D3HHe1ZZ.js";
|
|
13
13
|
import { t as createClackPrompter } from "./clack-prompter-Bo7vS5xP.js";
|
|
14
14
|
import { t as resolveChannelDefaultAccountId } from "./helpers-CIyuenBU.js";
|
|
15
15
|
import { a as parseBindingSpecs, i as describeBinding, n as applyAgentBindings, o as removeAgentBindings, r as buildChannelBindings, t as requireValidConfigSnapshot } from "./config-validation-BgKexeQb.js";
|
|
16
|
-
import { a as pruneAgentConfig, i as loadAgentIdentity, n as buildAgentSummaries, r as findAgentEntryIndex, t as applyAgentConfig } from "./agents.config-
|
|
17
|
-
import { r as setupChannels } from "./onboard-channels-
|
|
16
|
+
import { a as pruneAgentConfig, i as loadAgentIdentity, n as buildAgentSummaries, r as findAgentEntryIndex, t as applyAgentConfig } from "./agents.config-C48CGAxv.js";
|
|
17
|
+
import { r as setupChannels } from "./onboard-channels-CHLOUR52.js";
|
|
18
18
|
import { n as logConfigUpdated } from "./logging-MF6Thoxk.js";
|
|
19
19
|
import { n as promptAuthChoiceGrouped } from "./auth-choice-prompt-kycZqH8q.js";
|
|
20
|
-
import { i as applyAuthChoice, r as warnIfModelConfigLooksOff } from "./auth-choice-
|
|
20
|
+
import { i as applyAuthChoice, r as warnIfModelConfigLooksOff } from "./auth-choice-B9F26cWG.js";
|
|
21
21
|
import path from "node:path";
|
|
22
22
|
import fs from "node:fs/promises";
|
|
23
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as resolveAgentDir, d as resolveDefaultAgentId, n as listAgentEntries, u as resolveAgentWorkspaceDir } from "./agent-scope-mLXQGQde.js";
|
|
2
2
|
import { s as normalizeAgentId } from "./session-key-B9ePuoPx.js";
|
|
3
|
-
import { M as identityHasValues, N as loadAgentIdentityFromWorkspace } from "./subagent-registry-
|
|
3
|
+
import { M as identityHasValues, N as loadAgentIdentityFromWorkspace } from "./subagent-registry-DHwrN9Oj.js";
|
|
4
4
|
|
|
5
5
|
//#region src/commands/agents.config.ts
|
|
6
6
|
function findAgentEntryIndex(list, agentId) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { en as identityHasValues, tn as loadAgentIdentityFromWorkspace } from "./reply-
|
|
1
|
+
import { en as identityHasValues, tn as loadAgentIdentityFromWorkspace } from "./reply-Cmj0wbnT.js";
|
|
2
2
|
import { a as resolveAgentDir, d as resolveDefaultAgentId, n as listAgentEntries, u as resolveAgentWorkspaceDir } from "./agent-scope-RA0zXRpu.js";
|
|
3
3
|
import { s as normalizeAgentId } from "./session-key-Cuihcz_O.js";
|
|
4
4
|
|
|
@@ -222,18 +222,19 @@ async function loadAntonConfig() {
|
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
async function runAgentTask(args) {
|
|
225
|
-
const { agentCliCommand } = await import("./agent-via-gateway-
|
|
225
|
+
const { agentCliCommand } = await import("./agent-via-gateway-DFnFArbP.js").then((n) => n.n);
|
|
226
226
|
const extraSystemPrompt = args.workspaceDir ? `Your working directory is: ${args.workspaceDir}\nAll file paths are relative to this directory. Use this as your cwd for all operations.` : void 0;
|
|
227
|
-
await agentCliCommand({
|
|
227
|
+
const result = await agentCliCommand({
|
|
228
228
|
message: args.message,
|
|
229
229
|
agent: args.agent,
|
|
230
230
|
to: args.to,
|
|
231
231
|
sessionId: args.sessionId,
|
|
232
232
|
timeout: args.timeout,
|
|
233
|
-
json:
|
|
233
|
+
json: true,
|
|
234
234
|
deliver: false,
|
|
235
235
|
extraSystemPrompt
|
|
236
236
|
}, args.runtime, args.deps);
|
|
237
|
+
return { text: (result && typeof result === "object" && "result" in result ? result.result?.payloads ?? [] : []).map((p) => typeof p?.text === "string" ? p.text.trim() : "").filter(Boolean).join("\n\n").trim() };
|
|
237
238
|
}
|
|
238
239
|
function makePlanFilePath(planDir, taskIndex) {
|
|
239
240
|
return path.join(planDir, `task-${taskIndex}-${Date.now()}.md`);
|
|
@@ -249,6 +250,63 @@ async function isPlanFileValid(filePath) {
|
|
|
249
250
|
return false;
|
|
250
251
|
}
|
|
251
252
|
}
|
|
253
|
+
function extractJsonObject(text) {
|
|
254
|
+
const trimmed = text.trim();
|
|
255
|
+
if (!trimmed) return null;
|
|
256
|
+
const tryParse = (candidate) => {
|
|
257
|
+
try {
|
|
258
|
+
const parsed = JSON.parse(candidate);
|
|
259
|
+
if (!parsed || typeof parsed !== "object") return null;
|
|
260
|
+
return parsed;
|
|
261
|
+
} catch {
|
|
262
|
+
return null;
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
const direct = tryParse(trimmed);
|
|
266
|
+
if (direct) return direct;
|
|
267
|
+
const fencedMatch = trimmed.match(/```(?:json)?\s*([\s\S]*?)```/i);
|
|
268
|
+
if (fencedMatch?.[1]) {
|
|
269
|
+
const fenced = tryParse(fencedMatch[1].trim());
|
|
270
|
+
if (fenced) return fenced;
|
|
271
|
+
}
|
|
272
|
+
const first = trimmed.indexOf("{");
|
|
273
|
+
const last = trimmed.lastIndexOf("}");
|
|
274
|
+
if (first >= 0 && last > first) {
|
|
275
|
+
const sliced = tryParse(trimmed.slice(first, last + 1));
|
|
276
|
+
if (sliced) return sliced;
|
|
277
|
+
}
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
function extractPlanMarkdownFromText(text) {
|
|
281
|
+
const candidate = text.match(/```(?:markdown|md)?\s*([\s\S]*?)```/i)?.[1]?.trim() ?? text.trim();
|
|
282
|
+
if (candidate.length < 60) return;
|
|
283
|
+
return candidate;
|
|
284
|
+
}
|
|
285
|
+
function normalizeDiscoveryFilename(filename, expectedPlanFile) {
|
|
286
|
+
const trimmed = filename?.trim();
|
|
287
|
+
if (!trimmed) return expectedPlanFile;
|
|
288
|
+
return path.resolve(trimmed);
|
|
289
|
+
}
|
|
290
|
+
function buildDiscoveryRepairPrompt(task, taskFile, planFilePath) {
|
|
291
|
+
return `RETRY: your previous preflight response did not produce a valid plan file.
|
|
292
|
+
|
|
293
|
+
You MUST complete these steps exactly:
|
|
294
|
+
1) Write the implementation plan to: ${planFilePath}
|
|
295
|
+
2) Verify the file exists and is non-empty
|
|
296
|
+
3) Return ONLY strict JSON: {"status":"incomplete","filename":"${planFilePath}"}
|
|
297
|
+
|
|
298
|
+
If task is already complete, return ONLY: {"status":"complete","filename":""}
|
|
299
|
+
|
|
300
|
+
Do not include THOUGHT, markdown fences, or extra commentary.
|
|
301
|
+
Task file: ${taskFile}
|
|
302
|
+
Task: ${task}`;
|
|
303
|
+
}
|
|
304
|
+
async function tryPersistPlanFallback(params) {
|
|
305
|
+
const planText = (((typeof params.parsed?.planMarkdown === "string" ? params.parsed.planMarkdown : void 0) ?? (typeof params.parsed?.plan === "string" ? params.parsed.plan : void 0))?.trim() || extractPlanMarkdownFromText(params.rawText) || "").trim();
|
|
306
|
+
if (planText.length < 60) return false;
|
|
307
|
+
await fs.writeFile(params.planFile, `${planText}\n`, "utf8");
|
|
308
|
+
return await isPlanFileValid(params.planFile);
|
|
309
|
+
}
|
|
252
310
|
async function runDiscoveryPhase(args) {
|
|
253
311
|
const planFile = makePlanFilePath(args.planDir, args.taskNum);
|
|
254
312
|
await ensurePlanDir(args.planDir);
|
|
@@ -268,7 +326,7 @@ async function runDiscoveryPhase(args) {
|
|
|
268
326
|
task: `Discovery (attempt ${attempt + 1})`,
|
|
269
327
|
sessionId
|
|
270
328
|
});
|
|
271
|
-
await runAgentTask({
|
|
329
|
+
const firstPass = await runAgentTask({
|
|
272
330
|
message: buildDiscoveryPrompt(args.task.text, args.taskFile, planFile),
|
|
273
331
|
sessionId,
|
|
274
332
|
timeout: args.timeout,
|
|
@@ -278,23 +336,91 @@ async function runDiscoveryPhase(args) {
|
|
|
278
336
|
deps: args.deps,
|
|
279
337
|
workspaceDir: args.workspaceDir
|
|
280
338
|
});
|
|
281
|
-
|
|
339
|
+
const firstParsed = extractJsonObject(firstPass.text);
|
|
340
|
+
if ((firstParsed?.status ?? "").toLowerCase() === "complete") return { status: "complete" };
|
|
341
|
+
const declaredPlanFile = normalizeDiscoveryFilename(firstParsed?.filename, planFile);
|
|
342
|
+
if (await isPlanFileValid(declaredPlanFile)) {
|
|
282
343
|
await args.notify({
|
|
283
344
|
phase: "discovery_complete",
|
|
284
345
|
index: args.taskNum,
|
|
285
346
|
total: args.total,
|
|
286
347
|
task: args.task.text,
|
|
287
|
-
planFile
|
|
348
|
+
planFile: declaredPlanFile
|
|
288
349
|
});
|
|
289
350
|
return {
|
|
290
351
|
status: "plan_ready",
|
|
291
|
-
planFile
|
|
352
|
+
planFile: declaredPlanFile
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
if ((firstParsed?.status ?? "").toLowerCase() === "incomplete" && await tryPersistPlanFallback({
|
|
356
|
+
planFile: declaredPlanFile,
|
|
357
|
+
parsed: firstParsed,
|
|
358
|
+
rawText: firstPass.text
|
|
359
|
+
})) {
|
|
360
|
+
await args.notify({
|
|
361
|
+
phase: "discovery_complete",
|
|
362
|
+
index: args.taskNum,
|
|
363
|
+
total: args.total,
|
|
364
|
+
task: args.task.text,
|
|
365
|
+
planFile: declaredPlanFile
|
|
366
|
+
});
|
|
367
|
+
return {
|
|
368
|
+
status: "plan_ready",
|
|
369
|
+
planFile: declaredPlanFile
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
const repairSessionId = `anton-discovery-repair-${Date.now()}-${args.taskNum}-${attempt}`;
|
|
373
|
+
await args.notify({
|
|
374
|
+
phase: "task_agent_spawned",
|
|
375
|
+
index: args.taskNum,
|
|
376
|
+
total: args.total,
|
|
377
|
+
task: `Discovery repair (attempt ${attempt + 1})`,
|
|
378
|
+
sessionId: repairSessionId
|
|
379
|
+
});
|
|
380
|
+
const repairPass = await runAgentTask({
|
|
381
|
+
message: buildDiscoveryRepairPrompt(args.task.text, args.taskFile, declaredPlanFile),
|
|
382
|
+
sessionId: repairSessionId,
|
|
383
|
+
timeout: args.timeout,
|
|
384
|
+
agent: args.agent,
|
|
385
|
+
to: args.to,
|
|
386
|
+
runtime: args.runtime,
|
|
387
|
+
deps: args.deps,
|
|
388
|
+
workspaceDir: args.workspaceDir
|
|
389
|
+
});
|
|
390
|
+
const repairParsed = extractJsonObject(repairPass.text);
|
|
391
|
+
if ((repairParsed?.status ?? "").toLowerCase() === "complete") return { status: "complete" };
|
|
392
|
+
const repairPlanFile = normalizeDiscoveryFilename(repairParsed?.filename, declaredPlanFile);
|
|
393
|
+
if (await isPlanFileValid(repairPlanFile) || await tryPersistPlanFallback({
|
|
394
|
+
planFile: repairPlanFile,
|
|
395
|
+
parsed: repairParsed,
|
|
396
|
+
rawText: repairPass.text
|
|
397
|
+
})) {
|
|
398
|
+
await args.notify({
|
|
399
|
+
phase: "discovery_complete",
|
|
400
|
+
index: args.taskNum,
|
|
401
|
+
total: args.total,
|
|
402
|
+
task: args.task.text,
|
|
403
|
+
planFile: repairPlanFile
|
|
404
|
+
});
|
|
405
|
+
return {
|
|
406
|
+
status: "plan_ready",
|
|
407
|
+
planFile: repairPlanFile
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
if (attempt === args.maxRetries) {
|
|
411
|
+
const reason = "Discovery did not produce a valid plan file after primary + repair passes";
|
|
412
|
+
await args.notify({
|
|
413
|
+
phase: "discovery_failed",
|
|
414
|
+
index: args.taskNum,
|
|
415
|
+
total: args.total,
|
|
416
|
+
task: args.task.text,
|
|
417
|
+
error: reason
|
|
418
|
+
});
|
|
419
|
+
return {
|
|
420
|
+
status: "failed",
|
|
421
|
+
error: reason
|
|
292
422
|
};
|
|
293
423
|
}
|
|
294
|
-
if (attempt === args.maxRetries) return {
|
|
295
|
-
status: "failed",
|
|
296
|
-
error: "Discovery did not produce a valid plan file"
|
|
297
|
-
};
|
|
298
424
|
} catch (err) {
|
|
299
425
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
300
426
|
if (attempt === args.maxRetries) {
|
|
@@ -216,18 +216,19 @@ async function loadAntonConfig() {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
async function runAgentTask(args) {
|
|
219
|
-
const { agentCliCommand } = await import("./agent-via-gateway-
|
|
219
|
+
const { agentCliCommand } = await import("./agent-via-gateway-BCActbIf.js");
|
|
220
220
|
const extraSystemPrompt = args.workspaceDir ? `Your working directory is: ${args.workspaceDir}\nAll file paths are relative to this directory. Use this as your cwd for all operations.` : void 0;
|
|
221
|
-
await agentCliCommand({
|
|
221
|
+
const result = await agentCliCommand({
|
|
222
222
|
message: args.message,
|
|
223
223
|
agent: args.agent,
|
|
224
224
|
to: args.to,
|
|
225
225
|
sessionId: args.sessionId,
|
|
226
226
|
timeout: args.timeout,
|
|
227
|
-
json:
|
|
227
|
+
json: true,
|
|
228
228
|
deliver: false,
|
|
229
229
|
extraSystemPrompt
|
|
230
230
|
}, args.runtime, args.deps);
|
|
231
|
+
return { text: (result && typeof result === "object" && "result" in result ? result.result?.payloads ?? [] : []).map((p) => typeof p?.text === "string" ? p.text.trim() : "").filter(Boolean).join("\n\n").trim() };
|
|
231
232
|
}
|
|
232
233
|
function makePlanFilePath(planDir, taskIndex) {
|
|
233
234
|
return path.join(planDir, `task-${taskIndex}-${Date.now()}.md`);
|
|
@@ -243,6 +244,63 @@ async function isPlanFileValid(filePath) {
|
|
|
243
244
|
return false;
|
|
244
245
|
}
|
|
245
246
|
}
|
|
247
|
+
function extractJsonObject(text) {
|
|
248
|
+
const trimmed = text.trim();
|
|
249
|
+
if (!trimmed) return null;
|
|
250
|
+
const tryParse = (candidate) => {
|
|
251
|
+
try {
|
|
252
|
+
const parsed = JSON.parse(candidate);
|
|
253
|
+
if (!parsed || typeof parsed !== "object") return null;
|
|
254
|
+
return parsed;
|
|
255
|
+
} catch {
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
const direct = tryParse(trimmed);
|
|
260
|
+
if (direct) return direct;
|
|
261
|
+
const fencedMatch = trimmed.match(/```(?:json)?\s*([\s\S]*?)```/i);
|
|
262
|
+
if (fencedMatch?.[1]) {
|
|
263
|
+
const fenced = tryParse(fencedMatch[1].trim());
|
|
264
|
+
if (fenced) return fenced;
|
|
265
|
+
}
|
|
266
|
+
const first = trimmed.indexOf("{");
|
|
267
|
+
const last = trimmed.lastIndexOf("}");
|
|
268
|
+
if (first >= 0 && last > first) {
|
|
269
|
+
const sliced = tryParse(trimmed.slice(first, last + 1));
|
|
270
|
+
if (sliced) return sliced;
|
|
271
|
+
}
|
|
272
|
+
return null;
|
|
273
|
+
}
|
|
274
|
+
function extractPlanMarkdownFromText(text) {
|
|
275
|
+
const candidate = text.match(/```(?:markdown|md)?\s*([\s\S]*?)```/i)?.[1]?.trim() ?? text.trim();
|
|
276
|
+
if (candidate.length < 60) return;
|
|
277
|
+
return candidate;
|
|
278
|
+
}
|
|
279
|
+
function normalizeDiscoveryFilename(filename, expectedPlanFile) {
|
|
280
|
+
const trimmed = filename?.trim();
|
|
281
|
+
if (!trimmed) return expectedPlanFile;
|
|
282
|
+
return path.resolve(trimmed);
|
|
283
|
+
}
|
|
284
|
+
function buildDiscoveryRepairPrompt(task, taskFile, planFilePath) {
|
|
285
|
+
return `RETRY: your previous preflight response did not produce a valid plan file.
|
|
286
|
+
|
|
287
|
+
You MUST complete these steps exactly:
|
|
288
|
+
1) Write the implementation plan to: ${planFilePath}
|
|
289
|
+
2) Verify the file exists and is non-empty
|
|
290
|
+
3) Return ONLY strict JSON: {"status":"incomplete","filename":"${planFilePath}"}
|
|
291
|
+
|
|
292
|
+
If task is already complete, return ONLY: {"status":"complete","filename":""}
|
|
293
|
+
|
|
294
|
+
Do not include THOUGHT, markdown fences, or extra commentary.
|
|
295
|
+
Task file: ${taskFile}
|
|
296
|
+
Task: ${task}`;
|
|
297
|
+
}
|
|
298
|
+
async function tryPersistPlanFallback(params) {
|
|
299
|
+
const planText = (((typeof params.parsed?.planMarkdown === "string" ? params.parsed.planMarkdown : void 0) ?? (typeof params.parsed?.plan === "string" ? params.parsed.plan : void 0))?.trim() || extractPlanMarkdownFromText(params.rawText) || "").trim();
|
|
300
|
+
if (planText.length < 60) return false;
|
|
301
|
+
await fs.writeFile(params.planFile, `${planText}\n`, "utf8");
|
|
302
|
+
return await isPlanFileValid(params.planFile);
|
|
303
|
+
}
|
|
246
304
|
async function runDiscoveryPhase(args) {
|
|
247
305
|
const planFile = makePlanFilePath(args.planDir, args.taskNum);
|
|
248
306
|
await ensurePlanDir(args.planDir);
|
|
@@ -262,7 +320,7 @@ async function runDiscoveryPhase(args) {
|
|
|
262
320
|
task: `Discovery (attempt ${attempt + 1})`,
|
|
263
321
|
sessionId
|
|
264
322
|
});
|
|
265
|
-
await runAgentTask({
|
|
323
|
+
const firstPass = await runAgentTask({
|
|
266
324
|
message: buildDiscoveryPrompt(args.task.text, args.taskFile, planFile),
|
|
267
325
|
sessionId,
|
|
268
326
|
timeout: args.timeout,
|
|
@@ -272,23 +330,91 @@ async function runDiscoveryPhase(args) {
|
|
|
272
330
|
deps: args.deps,
|
|
273
331
|
workspaceDir: args.workspaceDir
|
|
274
332
|
});
|
|
275
|
-
|
|
333
|
+
const firstParsed = extractJsonObject(firstPass.text);
|
|
334
|
+
if ((firstParsed?.status ?? "").toLowerCase() === "complete") return { status: "complete" };
|
|
335
|
+
const declaredPlanFile = normalizeDiscoveryFilename(firstParsed?.filename, planFile);
|
|
336
|
+
if (await isPlanFileValid(declaredPlanFile)) {
|
|
276
337
|
await args.notify({
|
|
277
338
|
phase: "discovery_complete",
|
|
278
339
|
index: args.taskNum,
|
|
279
340
|
total: args.total,
|
|
280
341
|
task: args.task.text,
|
|
281
|
-
planFile
|
|
342
|
+
planFile: declaredPlanFile
|
|
282
343
|
});
|
|
283
344
|
return {
|
|
284
345
|
status: "plan_ready",
|
|
285
|
-
planFile
|
|
346
|
+
planFile: declaredPlanFile
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
if ((firstParsed?.status ?? "").toLowerCase() === "incomplete" && await tryPersistPlanFallback({
|
|
350
|
+
planFile: declaredPlanFile,
|
|
351
|
+
parsed: firstParsed,
|
|
352
|
+
rawText: firstPass.text
|
|
353
|
+
})) {
|
|
354
|
+
await args.notify({
|
|
355
|
+
phase: "discovery_complete",
|
|
356
|
+
index: args.taskNum,
|
|
357
|
+
total: args.total,
|
|
358
|
+
task: args.task.text,
|
|
359
|
+
planFile: declaredPlanFile
|
|
360
|
+
});
|
|
361
|
+
return {
|
|
362
|
+
status: "plan_ready",
|
|
363
|
+
planFile: declaredPlanFile
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
const repairSessionId = `anton-discovery-repair-${Date.now()}-${args.taskNum}-${attempt}`;
|
|
367
|
+
await args.notify({
|
|
368
|
+
phase: "task_agent_spawned",
|
|
369
|
+
index: args.taskNum,
|
|
370
|
+
total: args.total,
|
|
371
|
+
task: `Discovery repair (attempt ${attempt + 1})`,
|
|
372
|
+
sessionId: repairSessionId
|
|
373
|
+
});
|
|
374
|
+
const repairPass = await runAgentTask({
|
|
375
|
+
message: buildDiscoveryRepairPrompt(args.task.text, args.taskFile, declaredPlanFile),
|
|
376
|
+
sessionId: repairSessionId,
|
|
377
|
+
timeout: args.timeout,
|
|
378
|
+
agent: args.agent,
|
|
379
|
+
to: args.to,
|
|
380
|
+
runtime: args.runtime,
|
|
381
|
+
deps: args.deps,
|
|
382
|
+
workspaceDir: args.workspaceDir
|
|
383
|
+
});
|
|
384
|
+
const repairParsed = extractJsonObject(repairPass.text);
|
|
385
|
+
if ((repairParsed?.status ?? "").toLowerCase() === "complete") return { status: "complete" };
|
|
386
|
+
const repairPlanFile = normalizeDiscoveryFilename(repairParsed?.filename, declaredPlanFile);
|
|
387
|
+
if (await isPlanFileValid(repairPlanFile) || await tryPersistPlanFallback({
|
|
388
|
+
planFile: repairPlanFile,
|
|
389
|
+
parsed: repairParsed,
|
|
390
|
+
rawText: repairPass.text
|
|
391
|
+
})) {
|
|
392
|
+
await args.notify({
|
|
393
|
+
phase: "discovery_complete",
|
|
394
|
+
index: args.taskNum,
|
|
395
|
+
total: args.total,
|
|
396
|
+
task: args.task.text,
|
|
397
|
+
planFile: repairPlanFile
|
|
398
|
+
});
|
|
399
|
+
return {
|
|
400
|
+
status: "plan_ready",
|
|
401
|
+
planFile: repairPlanFile
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
if (attempt === args.maxRetries) {
|
|
405
|
+
const reason = "Discovery did not produce a valid plan file after primary + repair passes";
|
|
406
|
+
await args.notify({
|
|
407
|
+
phase: "discovery_failed",
|
|
408
|
+
index: args.taskNum,
|
|
409
|
+
total: args.total,
|
|
410
|
+
task: args.task.text,
|
|
411
|
+
error: reason
|
|
412
|
+
});
|
|
413
|
+
return {
|
|
414
|
+
status: "failed",
|
|
415
|
+
error: reason
|
|
286
416
|
};
|
|
287
417
|
}
|
|
288
|
-
if (attempt === args.maxRetries) return {
|
|
289
|
-
status: "failed",
|
|
290
|
-
error: "Discovery did not produce a valid plan file"
|
|
291
|
-
};
|
|
292
418
|
} catch (err) {
|
|
293
419
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
294
420
|
if (attempt === args.maxRetries) {
|