nolo-cli 0.53.0-alpha.1 → 0.54.0-alpha.2

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.
Files changed (110) hide show
  1. package/{_executeModel-36GKPAEZ.js → _executeModel-ANY4SIAS.js} +34 -35
  2. package/{action-IU6ON7ZB.js → action-Q4W5JPI5.js} +7 -7
  3. package/{addContentAction-5V5CCI3I.js → addContentAction-O25HFR37.js} +6 -6
  4. package/{addDialogAgentAction-KF3KZZNZ.js → addDialogAgentAction-GH7AUPPB.js} +5 -5
  5. package/{agentDeleteCommand-SBODEUPE.js → agentDeleteCommand-JWIKNWWI.js} +17 -17
  6. package/{agentEmailCommands-ME7BCY5S.js → agentEmailCommands-PL22BEU5.js} +39 -40
  7. package/{agentListCommands-QBWPKN5D.js → agentListCommands-6NR7AQEK.js} +19 -19
  8. package/{agentMachineCommands-KFFUPELZ.js → agentMachineCommands-TASPU6OA.js} +18 -18
  9. package/{agentRecordCommands-4BF6JIHS.js → agentRecordCommands-Z64TA63M.js} +38 -39
  10. package/{agentRunCommand-4MA7D6SV.js → agentRunCommand-4QJQLPRW.js} +39 -40
  11. package/{agentRuntimeLocal-RD52NPCG.js → agentRuntimeLocal-PCJJ56J2.js} +17 -17
  12. package/{agentSlice-AJABGQHU.js → agentSlice-KYLDUSNN.js} +6 -6
  13. package/{appDeleteCommands-I42NL3LP.js → appDeleteCommands-WLHMJAVT.js} +19 -19
  14. package/{appDeployCommands-CZWHXVPU.js → appDeployCommands-CKON7N2E.js} +19 -19
  15. package/{appDeployStatusCommands-PIQYXACM.js → appDeployStatusCommands-PXRLDASH.js} +19 -19
  16. package/{appGetCommands-CI2OWLT7.js → appGetCommands-RAB5RM4M.js} +19 -19
  17. package/{appListCommands-LWLSHPCP.js → appListCommands-GU57FB62.js} +19 -19
  18. package/{authCommand-WLWOEVYI.js → authCommand-QOPOEYEK.js} +7 -7
  19. package/{chatQueueReduxAdapter-V37RK3A6.js → chatQueueReduxAdapter-5O2WLITN.js} +16 -16
  20. package/chunk-2BWU4ORW.js +2574 -0
  21. package/{chunk-SG65C33A.js → chunk-32I5RVMY.js} +4 -4
  22. package/{chunk-X7S7OFUX.js → chunk-3QJTD6DO.js} +4 -4
  23. package/{chunk-CY5KIIPU.js → chunk-3Z3DXZBD.js} +12 -12
  24. package/{chunk-RO2IUWZE.js → chunk-4NN3EK7H.js} +1 -1
  25. package/{chunk-Y7TGWSUN.js → chunk-56W233KG.js} +1 -1
  26. package/{chunk-C2WF2OY7.js → chunk-5WADL4O7.js} +1 -1
  27. package/{chunk-QTH72J3N.js → chunk-6BGAQ3KR.js} +116 -23
  28. package/{chunk-67Q6IHM5.js → chunk-6FQ2552G.js} +142 -62
  29. package/{chunk-6XIE5ZGI.js → chunk-6HIGYUBQ.js} +1 -1
  30. package/{chunk-XPW6JLOB.js → chunk-6SZ52ORL.js} +8 -8
  31. package/{chunk-4ZL2KBI7.js → chunk-757BGY6Y.js} +1 -1
  32. package/{chunk-SQTVMYMU.js → chunk-7APQB6R6.js} +3 -3
  33. package/{chunk-QF27IZB3.js → chunk-7K5VMB4Q.js} +3 -3
  34. package/{chunk-V2IPBG5U.js → chunk-AA564GBL.js} +2 -2
  35. package/{chunk-76UA7376.js → chunk-AV6KQCM5.js} +6 -6
  36. package/{chunk-PGKZ2KGE.js → chunk-BJLYCOZK.js} +24 -24
  37. package/{chunk-VKSBVRGP.js → chunk-CVT7L2WZ.js} +1 -1
  38. package/{chunk-JVKFKKYN.js → chunk-D3JQPONH.js} +1 -1
  39. package/{chunk-KHCLMKZZ.js → chunk-EY7V7REW.js} +280 -6
  40. package/{chunk-4RXXP6WD.js → chunk-FGEYVPPR.js} +2 -2
  41. package/{chunk-AZ6DT2UD.js → chunk-GBADO3SM.js} +1 -1
  42. package/chunk-GLGD2JGY.js +1766 -0
  43. package/{chunk-POLE2QLO.js → chunk-GV35EHNA.js} +126 -59
  44. package/{chunk-HR5XDXYM.js → chunk-H4RYESI6.js} +3 -3
  45. package/{chunk-W3RZLXMA.js → chunk-IKTHA3JH.js} +2 -2
  46. package/{chunk-XB7ACJFH.js → chunk-INXBNYCG.js} +3 -3
  47. package/{chunk-F22JQTSX.js → chunk-KUUTWU4I.js} +3 -3
  48. package/{chunk-DFY6O64O.js → chunk-LA4IDAK7.js} +12 -12
  49. package/{chunk-IVKEJD7I.js → chunk-LN3OQJGG.js} +1 -1
  50. package/{chunk-YZ2WE6CW.js → chunk-MFI4FGHX.js} +2 -2
  51. package/{chunk-LGUQHYAL.js → chunk-O5FLGN2L.js} +3 -2
  52. package/{chunk-HCBQVVFZ.js → chunk-PAHILFNT.js} +1 -1
  53. package/{chunk-HHBXCRJS.js → chunk-PYKV6FSC.js} +1 -1
  54. package/{chunk-BO3YFOZR.js → chunk-QDHZCAH3.js} +1 -1
  55. package/{chunk-L3JWI7WX.js → chunk-QOKAKDPE.js} +15 -11
  56. package/{chunk-B54WOZ77.js → chunk-RTLJUGQH.js} +1 -1
  57. package/{chunk-Z7A54NFZ.js → chunk-RU5D3B22.js} +1 -1
  58. package/{chunk-JBL24PK6.js → chunk-SP3DPVBH.js} +2 -2
  59. package/{chunk-TZRB2I2M.js → chunk-TI5BCZCH.js} +18 -18
  60. package/{chunk-KOZ2G3ZG.js → chunk-U2A47SVI.js} +5 -5
  61. package/{chunk-3YVCM5PE.js → chunk-U5Z7LFZF.js} +1 -1
  62. package/{chunk-DIQCV4FR.js → chunk-UITMHBVK.js} +1 -1
  63. package/{chunk-H5QLIP6S.js → chunk-UW4INMD2.js} +2 -2
  64. package/{chunk-5SLTA66C.js → chunk-V4KZGLOI.js} +30 -30
  65. package/{chunk-AV4Z57LV.js → chunk-VRJUIUIY.js} +2 -2
  66. package/{chunk-5XCW6RQG.js → chunk-VRZIH5JO.js} +1 -1
  67. package/{chunk-2JYSSXLY.js → chunk-VULELK4T.js} +2 -2
  68. package/{chunk-VFN256RI.js → chunk-WL3UOGYO.js} +25 -0
  69. package/{chunk-PJASTA2U.js → chunk-Y7LNKP32.js} +3 -3
  70. package/{chunk-OZKJBDG4.js → chunk-YBV6QJKM.js} +14 -8
  71. package/{codingSkills-BYQI6EPT.js → codingSkills-BCQXRZOI.js} +3 -4
  72. package/{createAgentAutomationAction-5OZIWOK4.js → createAgentAutomationAction-UJLNFFFC.js} +17 -17
  73. package/{createDialogAction-334CHPJF.js → createDialogAction-TJCX6GUE.js} +20 -21
  74. package/{createPageAction-LXY22WTA.js → createPageAction-N3IYABHV.js} +18 -19
  75. package/{dbSlice-FWF5F4L7.js → dbSlice-D5CNGWPD.js} +5 -5
  76. package/{deleteFile-NPZ64DFN.js → deleteFile-44TUM34Y.js} +3 -3
  77. package/{dialogCommands-4MGUHAJI.js → dialogCommands-35M6RBAC.js} +18 -18
  78. package/{dialogSlice-76W7S3C4.js → dialogSlice-KO7ADD7H.js} +16 -16
  79. package/{docCreateCommands-346W5443.js → docCreateCommands-VXHZWQ3P.js} +20 -21
  80. package/{docDeleteCommands-FKEEPUUS.js → docDeleteCommands-4WFAJR6A.js} +20 -21
  81. package/{docReadCommands-AACI4DVO.js → docReadCommands-OYREEFAR.js} +20 -21
  82. package/{docStore-N7QTPHAX.js → docStore-5BU76DFK.js} +18 -18
  83. package/{docUpdateCommands-WHWVZ2XE.js → docUpdateCommands-A7QERSME.js} +20 -21
  84. package/{getPricing-JNOCWYDH.js → getPricing-HAU62AFM.js} +3 -3
  85. package/{handleSendMessageAction-EAXEX5AX.js → handleSendMessageAction-OSGQJQ45.js} +16 -16
  86. package/index.js +58 -58
  87. package/{machineCommands-XNWLQVTN.js → machineCommands-J43U3TX5.js} +38 -39
  88. package/{machineWsRunDispatch-56HWQ67L.js → machineWsRunDispatch-Z2Z6STXZ.js} +38 -39
  89. package/{models-N4NXQ44D.js → models-4QF4BJVY.js} +2 -2
  90. package/package.json +2 -3
  91. package/{read-J7RVVCHH.js → read-RGNPI5H2.js} +3 -3
  92. package/{readDocTool-G2WBM4IH.js → readDocTool-6ESWKTXD.js} +1 -1
  93. package/{readlineWorkspace-AXTB7DJC.js → readlineWorkspace-YRPV6JPN.js} +485 -222
  94. package/{removeDialogAgentAction-RMPISD42.js → removeDialogAgentAction-JYT73FU2.js} +7 -7
  95. package/{runAgentClientLoop-PU3R3UXA.js → runAgentClientLoop-5YM5WMAY.js} +32 -33
  96. package/{setDialogExtraReferencesAction-7BUTHDAL.js → setDialogExtraReferencesAction-D564LMYQ.js} +6 -6
  97. package/{setPrimaryDialogAgentAction-WCYIBGZ4.js → setPrimaryDialogAgentAction-ACY3BLYA.js} +7 -7
  98. package/{settingSlice-7NN2MI6Y.js → settingSlice-MKI3MNZJ.js} +6 -6
  99. package/{skillDiscovery-COX56OBO.js → skillDiscovery-GPUDHDTZ.js} +1 -2
  100. package/{spaceCommands-JYI3X4N2.js → spaceCommands-MY26V52L.js} +17 -17
  101. package/{spaceSlice-ERZ3RGWC.js → spaceSlice-JUIXC365.js} +17 -17
  102. package/{streamAgentChatTurn-2IH4MTQC.js → streamAgentChatTurn-XV5X5TNQ.js} +36 -37
  103. package/{switchDialogAgentAction-WGMMQHDI.js → switchDialogAgentAction-CJ5H6SAR.js} +5 -5
  104. package/{tableCommands-P2TXJ3CF.js → tableCommands-R6WFRDYF.js} +1 -1
  105. package/{tools-DJUTQEMP.js → tools-MIMELA2Y.js} +27 -28
  106. package/{tuiSummaryLlmCaller-U4EGD2SX.js → tuiSummaryLlmCaller-XJ5BKNNS.js} +12 -12
  107. package/{updateDialogTitleAction-OVOPGTC3.js → updateDialogTitleAction-EIZUSWHR.js} +17 -17
  108. package/chunk-AETZ7AD6.js +0 -274
  109. package/chunk-EUG45QJR.js +0 -6104
  110. package/chunk-OFZPJ3NT.js +0 -114
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  selectCurrentServer
3
- } from "./chunk-X7S7OFUX.js";
3
+ } from "./chunk-3QJTD6DO.js";
4
4
  import {
5
5
  patch
6
- } from "./chunk-76UA7376.js";
6
+ } from "./chunk-AV6KQCM5.js";
7
7
  import {
8
8
  selectIdentityToken
9
- } from "./chunk-HHBXCRJS.js";
9
+ } from "./chunk-PYKV6FSC.js";
10
10
  import {
11
11
  getIsDesktopApp
12
- } from "./chunk-L3JWI7WX.js";
12
+ } from "./chunk-QOKAKDPE.js";
13
13
 
14
14
  // packages/ai/agent/cliChatClient.ts
15
15
  function getCliChatRequestConfig(thunkApi) {
@@ -13,7 +13,7 @@ import {
13
13
  toTimestampMs,
14
14
  upsert,
15
15
  write
16
- } from "./chunk-76UA7376.js";
16
+ } from "./chunk-AV6KQCM5.js";
17
17
  import {
18
18
  createUserKey,
19
19
  createUserPreferenceKey,
@@ -24,7 +24,7 @@ import {
24
24
  } from "./chunk-QSJ3HFEF.js";
25
25
  import {
26
26
  BUILTIN_NOLO_AGENT_KEY
27
- } from "./chunk-2JYSSXLY.js";
27
+ } from "./chunk-VULELK4T.js";
28
28
  import {
29
29
  asyncThunkCreator,
30
30
  buildCreateSlice,
@@ -32,12 +32,12 @@ import {
32
32
  createAsyncThunk,
33
33
  createSelector,
34
34
  selectIdentityUserId
35
- } from "./chunk-HHBXCRJS.js";
35
+ } from "./chunk-PYKV6FSC.js";
36
36
  import {
37
37
  getAllServers,
38
38
  getIsDesktopApp,
39
39
  isProduction
40
- } from "./chunk-L3JWI7WX.js";
40
+ } from "./chunk-QOKAKDPE.js";
41
41
  import {
42
42
  SERVERS
43
43
  } from "./chunk-LCBAMY2M.js";
@@ -5,14 +5,14 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-H5QLIP6S.js";
8
+ } from "./chunk-UW4INMD2.js";
9
9
  import {
10
10
  INVALID_TOOL_ARGS_REPLACEMENT,
11
11
  buildInvalidToolCallSelfHealResult,
12
12
  parseToolCallArguments,
13
13
  performFetchRequest,
14
14
  sanitizeOutboundMessages
15
- } from "./chunk-TZRB2I2M.js";
15
+ } from "./chunk-TI5BCZCH.js";
16
16
  import {
17
17
  createSSEParser,
18
18
  createToolRunId,
@@ -23,22 +23,22 @@ import {
23
23
  toolRunSetPending,
24
24
  toolRunStarted,
25
25
  toolRunSucceeded
26
- } from "./chunk-5SLTA66C.js";
26
+ } from "./chunk-V4KZGLOI.js";
27
27
  import {
28
28
  getPublicImageAgentMode
29
29
  } from "./chunk-VIDPVFP3.js";
30
30
  import {
31
31
  getCurrentSpaceId
32
- } from "./chunk-DFY6O64O.js";
32
+ } from "./chunk-LA4IDAK7.js";
33
33
  import {
34
34
  addToolMessage,
35
35
  messageStreamEnd,
36
36
  messageStreaming,
37
37
  updateToolMessage
38
- } from "./chunk-PGKZ2KGE.js";
38
+ } from "./chunk-BJLYCOZK.js";
39
39
  import {
40
40
  streamAgentChatTurn
41
- } from "./chunk-KOZ2G3ZG.js";
41
+ } from "./chunk-U2A47SVI.js";
42
42
  import {
43
43
  addActiveController,
44
44
  removeActiveController,
@@ -56,19 +56,19 @@ import {
56
56
  import {
57
57
  EMPTY_ASSISTANT_REPAIR_PROMPT,
58
58
  getModelInfo
59
- } from "./chunk-F22JQTSX.js";
59
+ } from "./chunk-KUUTWU4I.js";
60
60
  import {
61
61
  getApiEndpoint
62
- } from "./chunk-BO3YFOZR.js";
62
+ } from "./chunk-QDHZCAH3.js";
63
63
  import {
64
64
  toErrorMessage
65
65
  } from "./chunk-HNMXYYJR.js";
66
66
  import {
67
67
  selectCurrentServer
68
- } from "./chunk-X7S7OFUX.js";
68
+ } from "./chunk-3QJTD6DO.js";
69
69
  import {
70
70
  write
71
- } from "./chunk-76UA7376.js";
71
+ } from "./chunk-AV6KQCM5.js";
72
72
  import {
73
73
  createDialogMessageKeyAndId,
74
74
  dialogMessageKey,
@@ -80,10 +80,10 @@ import {
80
80
  import {
81
81
  createAsyncThunk,
82
82
  selectIdentityToken
83
- } from "./chunk-HHBXCRJS.js";
83
+ } from "./chunk-PYKV6FSC.js";
84
84
  import {
85
85
  isAbortError
86
- } from "./chunk-L3JWI7WX.js";
86
+ } from "./chunk-QOKAKDPE.js";
87
87
  import {
88
88
  isRecord
89
89
  } from "./chunk-KUG52IAP.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_AGENT_BASE_POLICY,
3
3
  DEFAULT_USER_PREFERENCE_PROFILE
4
- } from "./chunk-X7S7OFUX.js";
4
+ } from "./chunk-3QJTD6DO.js";
5
5
 
6
6
  // packages/ai/policy/runtimePolicy.ts
7
7
  var clampLevel = (value, fallback) => {
@@ -4,7 +4,7 @@ import {
4
4
  openrouterModels,
5
5
  platformHostedModels,
6
6
  zaiModels
7
- } from "./chunk-VFN256RI.js";
7
+ } from "./chunk-WL3UOGYO.js";
8
8
 
9
9
  // packages/ai/llm/modelAbility.ts
10
10
  var MODEL_ABILITY_TABLE = {
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-DQLYEGP7.js";
8
8
  import {
9
9
  toSafeAgentSummary
10
- } from "./chunk-Z7A54NFZ.js";
10
+ } from "./chunk-RU5D3B22.js";
11
11
  import {
12
12
  PUBLIC_AGENT_KEY_PREFIX,
13
13
  isOwnedAgentKey,
@@ -7,7 +7,7 @@ import {
7
7
  providerHttpFailure,
8
8
  readSseFrames,
9
9
  throwIfChatCompletionStreamFailed
10
- } from "./chunk-XB7ACJFH.js";
10
+ } from "./chunk-INXBNYCG.js";
11
11
  import {
12
12
  FRESH_TOOL_OUTPUT_MAX_CHARS,
13
13
  MAX_HISTORICAL_TOOL_CONTENT_CHARS,
@@ -17,7 +17,7 @@ import {
17
17
  resolveHistoricalToolContentCap,
18
18
  resolveToolOutputProfile,
19
19
  stripImagePartsFromMessages
20
- } from "./chunk-VKSBVRGP.js";
20
+ } from "./chunk-CVT7L2WZ.js";
21
21
  import {
22
22
  sanitizeForOutbound
23
23
  } from "./chunk-T27IEBNQ.js";
@@ -36,7 +36,7 @@ import {
36
36
  requiresBareImageUrl,
37
37
  resolveToolGuidedSections,
38
38
  toBareImageUrlMessages
39
- } from "./chunk-OZKJBDG4.js";
39
+ } from "./chunk-YBV6QJKM.js";
40
40
  import {
41
41
  convertMessagesToResponsesInput,
42
42
  extractReasoningFromResponseOutput,
@@ -50,7 +50,7 @@ import {
50
50
  import {
51
51
  buildProviderAuthHeaders,
52
52
  buildProviderExecutionPlan
53
- } from "./chunk-JBL24PK6.js";
53
+ } from "./chunk-SP3DPVBH.js";
54
54
  import {
55
55
  NOLO_WORKSPACE_TOOL_NAMES,
56
56
  buildNoloWorkspaceCommandArgs,
@@ -69,7 +69,7 @@ import {
69
69
  resolveEmptyAssistantFallbackMessage,
70
70
  resolveEmptyAssistantOutcome,
71
71
  resolveTruncatedReasoningTailLog
72
- } from "./chunk-F22JQTSX.js";
72
+ } from "./chunk-KUUTWU4I.js";
73
73
  import {
74
74
  COMPACTION_SUMMARY_SCHEMA_VERSION,
75
75
  COMPACTION_SUMMARY_SYSTEM_PROMPT,
@@ -83,7 +83,7 @@ import {
83
83
  formatMessagesForSummaryWithTruncation,
84
84
  planCompression,
85
85
  planContextUsage
86
- } from "./chunk-HR5XDXYM.js";
86
+ } from "./chunk-H4RYESI6.js";
87
87
  import {
88
88
  resolveNoloStateDir
89
89
  } from "./chunk-FD36SCCD.js";
@@ -174,6 +174,26 @@ function readTitleParams(value) {
174
174
  return Object.fromEntries(entries);
175
175
  }
176
176
 
177
+ // packages/agent-runtime/fileWritePolicy.ts
178
+ function evaluateFileWritePolicy(args) {
179
+ if (args.sessionApproved) return { permissionDecision: "allow" };
180
+ return {
181
+ permissionDecision: "ask",
182
+ permissionRequest: {
183
+ id: "permission-file-write-session",
184
+ tool: args.tool,
185
+ action: "file_write",
186
+ title: "\u786E\u8BA4\u5199\u5165\u6587\u4EF6",
187
+ body: `\u672C\u4F1A\u8BDD\u9996\u6B21\u5199\u5165\u6587\u4EF6\uFF1A${args.path}\u3002\u6279\u51C6\u540E\u672C\u4F1A\u8BDD\u540E\u7EED\u5199\u5165\u4E0D\u518D\u9010\u6B21\u786E\u8BA4\u3002`,
188
+ command: args.path,
189
+ suggestedRule: {
190
+ scope: "session",
191
+ pattern: { capability: "file_write", target: "session" }
192
+ }
193
+ }
194
+ };
195
+ }
196
+
177
197
  // packages/agent-runtime/toolCallPairing.ts
178
198
  function readToolCallId(message) {
179
199
  if (typeof message.tool_call_id === "string" && message.tool_call_id) {
@@ -1540,6 +1560,41 @@ function applyPersistedTurnInput(messages, persistedInput, persistedInputReferen
1540
1560
  };
1541
1561
  });
1542
1562
  }
1563
+ var fileWriteSessionApproval = /* @__PURE__ */ new WeakMap();
1564
+ var fileWriteSessionKeys = /* @__PURE__ */ new Map();
1565
+ function getFileWriteSessionApproval(input) {
1566
+ if (input.fileWriteSessionId) {
1567
+ let key2 = fileWriteSessionKeys.get(input.fileWriteSessionId);
1568
+ if (!key2) {
1569
+ key2 = {};
1570
+ fileWriteSessionKeys.set(input.fileWriteSessionId, key2);
1571
+ }
1572
+ const existing2 = fileWriteSessionApproval.get(key2);
1573
+ if (existing2) return existing2;
1574
+ const created2 = { approved: false };
1575
+ fileWriteSessionApproval.set(key2, created2);
1576
+ return created2;
1577
+ }
1578
+ const key = input.adapter;
1579
+ const existing = fileWriteSessionApproval.get(key);
1580
+ if (existing) return existing;
1581
+ const created = { approved: false };
1582
+ fileWriteSessionApproval.set(key, created);
1583
+ return created;
1584
+ }
1585
+ function readToolPathForWriteGate(argumentsValue) {
1586
+ try {
1587
+ const parsed = JSON.parse(argumentsValue);
1588
+ return typeof parsed.path === "string" && parsed.path.trim() ? parsed.path.trim() : "the requested file";
1589
+ } catch {
1590
+ return "the requested file";
1591
+ }
1592
+ }
1593
+ function isCompletedActionGateResult(value) {
1594
+ return Boolean(
1595
+ value && typeof value === "object" && value.status === "completed"
1596
+ );
1597
+ }
1543
1598
  async function runLocalAgentTurn(input) {
1544
1599
  const agentConfig = await input.adapter.loadAgentConfig(input.agentRef);
1545
1600
  if (!agentConfig) {
@@ -1865,25 +1920,62 @@ ${reasoningTailLog}
1865
1920
  }
1866
1921
  );
1867
1922
  try {
1868
- const executePromise = input.adapter.executeTool({
1869
- id: toolCall.id,
1870
- name: toolName,
1871
- arguments: toolCall.function.arguments,
1872
- ...userInputText ? { userInput: userInputText } : {},
1873
- ...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {},
1874
- ...input.abortSignal ? { abortSignal: input.abortSignal } : {}
1875
- }, {
1876
- ...input.abortSignal ? { abortSignal: input.abortSignal } : {},
1877
- ...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {}
1878
- });
1879
- toolResult = await raceWithAbort(input, executePromise, toolName);
1923
+ const writeTool = toolName === "writeFile" || toolName === "editFile";
1924
+ if (writeTool && input.onActionGate && input.fileWriteGateEnabled !== false) {
1925
+ const writeSession = getFileWriteSessionApproval(input);
1926
+ const policy = evaluateFileWritePolicy({
1927
+ tool: toolName,
1928
+ path: readToolPathForWriteGate(toolCall.function.arguments),
1929
+ sessionApproved: writeSession.approved
1930
+ });
1931
+ if (policy.permissionDecision === "ask") {
1932
+ const gate = {
1933
+ ...policy.permissionRequest,
1934
+ id: `${policy.permissionRequest.id}-${toolCall.id}`,
1935
+ kind: "confirm",
1936
+ toolName,
1937
+ toolCallId: toolCall.id
1938
+ };
1939
+ const replacement = await raceWithAbort(
1940
+ input,
1941
+ input.onActionGate(gate),
1942
+ `${toolName} confirmation`
1943
+ );
1944
+ const gateResult = replacement?.metadata?.actionGateResult;
1945
+ if (replacement !== void 0 && isCompletedActionGateResult(gateResult)) {
1946
+ writeSession.approved = true;
1947
+ } else {
1948
+ toolResult = replacement ?? {
1949
+ content: `${toolName} cancelled: user declined file write confirmation.`,
1950
+ metadata: {
1951
+ cancelled: true,
1952
+ actionGateResult: { gateId: gate.id, status: "cancelled" }
1953
+ }
1954
+ };
1955
+ }
1956
+ }
1957
+ }
1958
+ if (!toolResult) {
1959
+ const executePromise = input.adapter.executeTool({
1960
+ id: toolCall.id,
1961
+ name: toolName,
1962
+ arguments: toolCall.function.arguments,
1963
+ ...userInputText ? { userInput: userInputText } : {},
1964
+ ...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {},
1965
+ ...input.abortSignal ? { abortSignal: input.abortSignal } : {}
1966
+ }, {
1967
+ ...input.abortSignal ? { abortSignal: input.abortSignal } : {},
1968
+ ...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {}
1969
+ });
1970
+ toolResult = await raceWithAbort(input, executePromise, toolName);
1971
+ }
1880
1972
  const actionGate = buildActionGate({
1881
1973
  toolName,
1882
1974
  toolCallId: toolCall.id,
1883
1975
  metadata: toolResult.metadata
1884
1976
  });
1885
1977
  if (actionGate && input.onActionGate) {
1886
- const replacement = await input.onActionGate(actionGate);
1978
+ const replacement = await raceWithAbort(input, input.onActionGate(actionGate), `${toolName} action gate`);
1887
1979
  if (replacement) {
1888
1980
  toolResult = replacement;
1889
1981
  }
@@ -1899,7 +1991,7 @@ ${reasoningTailLog}
1899
1991
  toolCallId: toolCall.id,
1900
1992
  toolName,
1901
1993
  atMs: finishedAt,
1902
- ok: true,
1994
+ ok: toolResult.metadata?.cancelled !== true && toolResult.metadata?.actionGateResult?.status !== "cancelled" && toolResult.metadata?.actionGateResult?.status !== "failed",
1903
1995
  elapsedMs: Math.max(0, finishedAt - startedAt),
1904
1996
  ...summary ? { summary } : {},
1905
1997
  ...safeMetadata ? { metadata: safeMetadata } : {}
@@ -6894,10 +6986,10 @@ function buildLoadSkillExecutor(args) {
6894
6986
  metadata: { loadSkill: true, resolved: false }
6895
6987
  };
6896
6988
  }
6897
- const { resolveSkillByName } = await import("./skillDiscovery-COX56OBO.js");
6989
+ const { resolveSkillByName } = await import("./skillDiscovery-GPUDHDTZ.js");
6898
6990
  const resolved = resolveSkillByName(args.cwd, name);
6899
6991
  if (!resolved) {
6900
- const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-BYQI6EPT.js");
6992
+ const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-BCQXRZOI.js");
6901
6993
  const builtinSlug = resolveCodingBuiltinSlug(name);
6902
6994
  if (builtinSlug) {
6903
6995
  const body = buildCodingSkillContentBySlug(builtinSlug);
@@ -6932,7 +7024,7 @@ ${body}`,
6932
7024
  };
6933
7025
  }
6934
7026
  async function formatUnknownSkillMessage(cwd, requestedName) {
6935
- const { discoverSkills } = await import("./skillDiscovery-COX56OBO.js");
7027
+ const { discoverSkills } = await import("./skillDiscovery-GPUDHDTZ.js");
6936
7028
  let available = [];
6937
7029
  try {
6938
7030
  available = discoverSkills(cwd).map((s) => s.name);
@@ -6950,6 +7042,7 @@ Available skills: ${available.join(", ")}`;
6950
7042
  export {
6951
7043
  readCommandActionGatePayload,
6952
7044
  readActionGate,
7045
+ evaluateFileWritePolicy,
6953
7046
  summarizeToolArguments,
6954
7047
  LOCAL_AGENT_CONFIG_MISSING_CODE,
6955
7048
  LOCAL_TURN_ABORTED_CODE,