nolo-cli 0.19.0 → 0.24.0-alpha.7

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 (133) hide show
  1. package/{_executeModel-X5PCIZN6.js → _executeModel-ARCMGGMY.js} +46 -44
  2. package/{action-LT7BRFLK.js → action-5MNAXR5B.js} +7 -6
  3. package/{addContentAction-PL3KKBDH.js → addContentAction-UNSYTVTB.js} +5 -5
  4. package/{addDialogAgentAction-FCMSKYAF.js → addDialogAgentAction-LJGNP2AO.js} +5 -5
  5. package/{agentDeleteCommand-2BZDQV36.js → agentDeleteCommand-C5PIEBMZ.js} +27 -26
  6. package/{agentEmailCommands-2QJDGRMB.js → agentEmailCommands-QTGQ3ZAD.js} +57 -55
  7. package/{agentListCommands-6VEPTKBI.js → agentListCommands-LRHBS3A5.js} +30 -26
  8. package/{agentMachineCommands-NVVHNWYI.js → agentMachineCommands-4PXIT4BP.js} +25 -24
  9. package/{agentRecordCommands-4GGRDMD4.js → agentRecordCommands-ZZPTYTYR.js} +52 -50
  10. package/{agentRunCommand-XOLQNKBZ.js → agentRunCommand-7ZTPZNUX.js} +55 -54
  11. package/{agentRunControl-Y5AFH5PQ.js → agentRunControl-SNUKXN6J.js} +6 -2
  12. package/{agentRuntimeLocal-7WYWCGL4.js → agentRuntimeLocal-QOYY5UV2.js} +19 -18
  13. package/{agentSlice-EAXPGEYV.js → agentSlice-J3W3RX2I.js} +5 -5
  14. package/{appDeleteCommands-77KR2RJ4.js → appDeleteCommands-7NS46XDH.js} +23 -22
  15. package/{appDeployCommands-K7CAHGBI.js → appDeployCommands-RSRNQ67U.js} +23 -22
  16. package/{appDeployStatusCommands-4OEKLTBT.js → appDeployStatusCommands-EF4RSGC6.js} +23 -22
  17. package/{appGetCommands-VM2WDLAZ.js → appGetCommands-YA7JWYUX.js} +23 -22
  18. package/{appListCommands-GX6BBA6U.js → appListCommands-WM2ON6JW.js} +23 -22
  19. package/{authCommand-DY6UUL6O.js → authCommand-HJP7FURK.js} +12 -13
  20. package/{authCommands-XTBV7OFZ.js → authCommands-NYZM2B2I.js} +4 -5
  21. package/{chunk-MKA6QE5E.js → chunk-2IPEVBUO.js} +126 -68
  22. package/{chunk-OWOHNGCN.js → chunk-2MBTWINN.js} +42 -3
  23. package/{chunk-K6EUAOW3.js → chunk-35RYGII3.js} +1 -1
  24. package/{chunk-TRT4I4UD.js → chunk-4POUK2BV.js} +2 -2
  25. package/{chunk-LLWKHDG4.js → chunk-4ULSC37S.js} +1 -3
  26. package/{chunk-EDV7EBOI.js → chunk-4ZH6GUJF.js} +2151 -1500
  27. package/{chunk-MVQ4TBSD.js → chunk-54VHTARN.js} +1 -1
  28. package/{chunk-L4F3I4SR.js → chunk-5HQQ4LUU.js} +4 -6
  29. package/{chunk-Z4NR32XR.js → chunk-5RGU3J7P.js} +13 -0
  30. package/{chunk-7BUYEZ6U.js → chunk-7H3UTGPM.js} +12 -72
  31. package/{chunk-RQN4SEKL.js → chunk-7W6GFNJL.js} +1 -1
  32. package/{chunk-HEGV7BH3.js → chunk-AQZCWJOG.js} +1 -1
  33. package/{chunk-3ND52WIL.js → chunk-ATWUOTJP.js} +180 -24
  34. package/chunk-CF7S2RYZ.js +376 -0
  35. package/{chunk-I2ZJKTG5.js → chunk-CGVRC2TB.js} +7 -7
  36. package/{chunk-UAIVG4J6.js → chunk-CHSCAUZN.js} +1 -8
  37. package/{chunk-KFEVY3ST.js → chunk-D34RI6NI.js} +18 -8
  38. package/{chunk-ROWQEJRP.js → chunk-DXJS7VSG.js} +3 -2
  39. package/{chunk-MHSGJW4Z.js → chunk-EHOYZRTI.js} +44 -14
  40. package/{chunk-XRZJGPFI.js → chunk-FON47ACC.js} +4 -4
  41. package/{chunk-SCTYAHYK.js → chunk-H2NAWOLH.js} +217 -141
  42. package/{chunk-MPVYDS7I.js → chunk-H6ODMJR3.js} +3 -3
  43. package/{chunk-R35XMF6F.js → chunk-H73ZV2GL.js} +352 -30
  44. package/{chunk-4T5F7YZQ.js → chunk-I6RJGORZ.js} +1 -1
  45. package/{chunk-OK6YSWLH.js → chunk-IICW77GI.js} +1 -1
  46. package/{chunk-VDXCXCXH.js → chunk-IUDMBCXC.js} +1 -1
  47. package/{chunk-AHCY2S2I.js → chunk-JADNODCQ.js} +1 -1
  48. package/{chunk-DFCFMCY6.js → chunk-JBLY6HQP.js} +2 -2
  49. package/{chunk-UGUW3FHG.js → chunk-JMSCXQUG.js} +2 -2
  50. package/{chunk-N54HIJVJ.js → chunk-KFUCLS7Z.js} +101 -9
  51. package/{chunk-FQZZLA3C.js → chunk-KXKQO4Q6.js} +17 -0
  52. package/{chunk-3Q7WHGCB.js → chunk-L65QKSVJ.js} +1 -1
  53. package/{chunk-3ZX7PERL.js → chunk-LALVWNE4.js} +20 -7
  54. package/{chunk-PJSV3IZ5.js → chunk-M3TMVJKG.js} +1 -1
  55. package/{chunk-REA4JLBH.js → chunk-M5OZCOBV.js} +7 -6
  56. package/{chunk-JLA4FXYC.js → chunk-MALVZUYL.js} +1 -1
  57. package/{chunk-GFUIQ4RY.js → chunk-MXFQHRSS.js} +1 -1
  58. package/{chunk-LSFAWXKC.js → chunk-N7J63Q6C.js} +1 -0
  59. package/{chunk-6Y7A3OQQ.js → chunk-NRY4GCKJ.js} +2 -0
  60. package/{chunk-G5U6LDLG.js → chunk-NVHPMDSZ.js} +6 -6
  61. package/{chunk-23FZYPLC.js → chunk-OJFYT3ZQ.js} +842 -1060
  62. package/{chunk-ELT65PZW.js → chunk-OXLLFZNF.js} +1 -1
  63. package/{chunk-CZ6NYQTV.js → chunk-P4QWLZGU.js} +2 -2
  64. package/{chunk-5MIDPSSK.js → chunk-PB7G5MAM.js} +3 -3
  65. package/{chunk-HWW2M4SN.js → chunk-QLVWFXZQ.js} +5 -4
  66. package/{chunk-VYHDJEQD.js → chunk-QNLLGS37.js} +136 -78
  67. package/{chunk-XHG22OEX.js → chunk-ROJI6DRT.js} +2 -2
  68. package/{chunk-BV4VEE3W.js → chunk-ROYOKSX4.js} +243 -354
  69. package/{chunk-VNAEBGDK.js → chunk-RZNYL4LW.js} +123 -26
  70. package/{chunk-RVOUXDFU.js → chunk-S6KVFOUG.js} +6 -34
  71. package/{chunk-V3ED5AWK.js → chunk-S77SCVBU.js} +27 -16
  72. package/{chunk-UBHAWFQ6.js → chunk-S7RWIPDI.js} +42 -19
  73. package/{chunk-B5TOXZAK.js → chunk-SIZQB7BD.js} +1 -1
  74. package/{chunk-DFFIZ25G.js → chunk-SLOGKB7M.js} +4 -1
  75. package/{chunk-FXUSIQC2.js → chunk-SROR5TSM.js} +1 -1
  76. package/{chunk-PIZYJVHQ.js → chunk-TN4YHAI3.js} +4 -4
  77. package/{chunk-IYEXFJPC.js → chunk-TW35GDNW.js} +64 -57
  78. package/chunk-UZ6XXCVR.js +50 -0
  79. package/{chunk-DKZFOK24.js → chunk-UZH44DWK.js} +7 -288
  80. package/{chunk-YGW4G5W5.js → chunk-X546QUDT.js} +61 -12
  81. package/chunk-YYLHWIW6.js +48 -0
  82. package/{chunk-SWDPIPOY.js → chunk-ZGVW7MSZ.js} +1 -1
  83. package/{chunk-34WPV75U.js → chunk-ZUXIXYJI.js} +1 -1
  84. package/{chunk-VC6OZXO5.js → chunk-ZWJOGMKH.js} +2 -26
  85. package/{cliExecutor-DNE7TCC4.js → cliExecutor-K3F7DMRO.js} +2 -2
  86. package/{codingSkills-36KN5NQT.js → codingSkills-EN6Z6G6U.js} +4 -4
  87. package/{createAgentAutomationAction-GNFF524X.js → createAgentAutomationAction-MKQWN4VQ.js} +19 -18
  88. package/{createDialogAction-RB55KCLO.js → createDialogAction-YWIZPLFS.js} +22 -20
  89. package/{createPageAction-Y7343GLU.js → createPageAction-74TTEIPC.js} +20 -19
  90. package/{db-W3O47YGF.js → db-W5UHK4P3.js} +150 -0
  91. package/{dbSlice-CGSRFJN3.js → dbSlice-5BKDURDL.js} +4 -4
  92. package/{dialogCommands-IAZK6YHQ.js → dialogCommands-MJIP32FL.js} +24 -23
  93. package/{dialogSlice-UQAXF23P.js → dialogSlice-KLLVH4WI.js} +24 -18
  94. package/{docCreateCommands-I2EWZGCI.js → docCreateCommands-5DN472U6.js} +24 -27
  95. package/{docDeleteCommands-IZ45UZKG.js → docDeleteCommands-HE76LBN4.js} +25 -24
  96. package/{docReadCommands-R6Z4QJYU.js → docReadCommands-XVGZSCBS.js} +24 -23
  97. package/{docStore-5HOJ4D7D.js → docStore-SPH3D6BT.js} +20 -19
  98. package/{docUpdateCommands-2LRBKQPY.js → docUpdateCommands-P7IAWUAD.js} +24 -27
  99. package/{fetchMessages-BMGVZVSE.js → fetchMessages-W4IKHPCS.js} +2 -3
  100. package/{getPricing-G7DLAST6.js → getPricing-WENPBVWH.js} +3 -3
  101. package/{handleSendMessageAction-Q4HY35WX.js → handleSendMessageAction-ZU6WJVL7.js} +23 -20
  102. package/index.js +74 -74
  103. package/{localDialogRead-4H3QJFLW.js → localDialogRead-JXTAHW2E.js} +2 -2
  104. package/{machineCommands-PKBPQKTY.js → machineCommands-NI76PVHK.js} +59 -57
  105. package/{machineWsRunDispatch-UZAW4OXJ.js → machineWsRunDispatch-W3G6NJVQ.js} +51 -49
  106. package/{models-DJFSJ7SW.js → models-DB27UAE3.js} +2 -2
  107. package/package.json +1 -1
  108. package/{read-3FMPZPER.js → read-F3L3T2WJ.js} +2 -1
  109. package/{readDocTool-VSYHKK3V.js → readDocTool-FOHWVA4R.js} +1 -1
  110. package/{readlineWorkspace-Y2RDOFZG.js → readlineWorkspace-BDH4G477.js} +880 -425
  111. package/{removeDialogAgentAction-OAGA2G3U.js → removeDialogAgentAction-QCFGIUIH.js} +8 -7
  112. package/{runAgentClientLoop-NBPIKJ6J.js → runAgentClientLoop-ZPKMXCM5.js} +45 -38
  113. package/{setDialogExtraReferencesAction-JZEXA5SL.js → setDialogExtraReferencesAction-DK4CKERU.js} +5 -5
  114. package/{setPrimaryDialogAgentAction-4ZUQQKDG.js → setPrimaryDialogAgentAction-SJSO6N27.js} +8 -7
  115. package/{settingSlice-7MNKHZ6R.js → settingSlice-XNM5AFPU.js} +6 -5
  116. package/{spaceCommands-DHCZ7J5I.js → spaceCommands-3GGBJRQR.js} +25 -24
  117. package/{spaceSlice-ZXLLG3CR.js → spaceSlice-47Z6XLFQ.js} +21 -18
  118. package/{streamAgentChatTurn-L3YW6LSB.js → streamAgentChatTurn-VT5K5JSD.js} +140 -98
  119. package/switchDialogAgentAction-4OAC6QRN.js +61 -0
  120. package/{tableCommands-BEQAGE4I.js → tableCommands-HEQYT2KP.js} +1 -1
  121. package/{toolApiClient-QI3YBNWB.js → toolApiClient-ISM4ZQX4.js} +2 -2
  122. package/{tools-ECGXR5QF.js → tools-L7RCHAPT.js} +36 -33
  123. package/{tuiSummaryLlmCaller-OMSCNHXA.js → tuiSummaryLlmCaller-3DYOLTVN.js} +6 -6
  124. package/{updateCommands-XTW55TOT.js → updateCommands-HTCOBXCA.js} +2 -2
  125. package/{updateDialogTitleAction-HQ2EUDFT.js → updateDialogTitleAction-KMPVPQ4A.js} +28 -27
  126. package/chunk-DL6EPNIK.js +0 -50
  127. package/chunk-V5R4NZP2.js +0 -78
  128. package/chunk-X4Q4UZEY.js +0 -26
  129. package/queryRunOverlay-O4LOMMPO.js +0 -161
  130. package/runOverlayPresentation-ZO4VCWEU.js +0 -11
  131. package/types-ZSTJ7MPR.js +0 -7
  132. package/{chunk-X7W4TNB4.js → chunk-CMKUBIGW.js} +3 -3
  133. package/{runtimeDoctorCommands-E2OUORHK.js → runtimeDoctorCommands-HSU632DY.js} +3 -3
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-23FZYPLC.js";
4
+ } from "./chunk-OJFYT3ZQ.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-EDV7EBOI.js";
7
+ } from "./chunk-4ZH6GUJF.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-YGW4G5W5.js";
10
+ } from "./chunk-X546QUDT.js";
11
11
  import {
12
12
  resolveLocalRuntimeEnvFromPolicy
13
13
  } from "./chunk-5CS33IBL.js";
@@ -4,45 +4,50 @@ import {
4
4
  providerHttpFailure,
5
5
  readSseFrames,
6
6
  throwIfChatCompletionStreamFailed
7
- } from "./chunk-N54HIJVJ.js";
7
+ } from "./chunk-KFUCLS7Z.js";
8
8
  import {
9
9
  parseToolArgumentsJson
10
- } from "./chunk-YGW4G5W5.js";
10
+ } from "./chunk-X546QUDT.js";
11
11
  import {
12
12
  createThinkParserState,
13
13
  createToolCallAccumulator,
14
14
  createToolCallTextParserState,
15
15
  extractThinkContent,
16
16
  finalizeAccumulatedToolCalls
17
- } from "./chunk-LSFAWXKC.js";
17
+ } from "./chunk-N7J63Q6C.js";
18
18
  import {
19
19
  requiresBareImageUrl,
20
20
  toBareImageUrlMessages
21
- } from "./chunk-34WPV75U.js";
21
+ } from "./chunk-ZUXIXYJI.js";
22
22
  import {
23
23
  shouldStripReasoningContentForOutbound,
24
24
  toOpenAiCompatibleMessages
25
- } from "./chunk-KFEVY3ST.js";
25
+ } from "./chunk-D34RI6NI.js";
26
26
  import {
27
27
  buildProviderAuthHeaders,
28
28
  buildProviderExecutionPlan
29
- } from "./chunk-MHSGJW4Z.js";
29
+ } from "./chunk-EHOYZRTI.js";
30
30
  import {
31
- createGlob,
32
- resolveExecutableOnPath
33
- } from "./chunk-DKZFOK24.js";
31
+ NOLO_WORKSPACE_TOOL_NAMES,
32
+ buildNoloWorkspaceCommandArgs,
33
+ noloStringArg,
34
+ parseNoloWorkspaceToolArguments
35
+ } from "./chunk-UZH44DWK.js";
34
36
  import {
35
- toErrorMessage
36
- } from "./chunk-HNMXYYJR.js";
37
+ buildDialogFallbackTitleFromUserInput
38
+ } from "./chunk-2MBTWINN.js";
37
39
  import {
38
40
  canonicalizeToolName
39
41
  } from "./chunk-ZZ2MH7LE.js";
42
+ import {
43
+ toErrorMessage
44
+ } from "./chunk-HNMXYYJR.js";
40
45
  import {
41
46
  asRecordOrEmpty
42
47
  } from "./chunk-KX6YBIHG.js";
43
48
  import {
44
49
  dialogMessageKey
45
- } from "./chunk-6Y7A3OQQ.js";
50
+ } from "./chunk-NRY4GCKJ.js";
46
51
  import {
47
52
  asOptionalFiniteNumber
48
53
  } from "./chunk-WWC7I6TA.js";
@@ -443,21 +448,37 @@ function extractLastUserText(messages) {
443
448
  return "";
444
449
  }
445
450
  function resolveDialogTitle(args) {
446
- if (typeof args.existingDialog?.title === "string" && args.existingDialog.title.trim()) {
447
- return args.existingDialog.title;
451
+ const existing = args.existingDialog?.title;
452
+ if (typeof existing === "string" && existing.trim()) {
453
+ return existing.trim();
448
454
  }
449
455
  const lastUserText = extractLastUserText(args.messages).trim();
450
- return lastUserText ? lastUserText.slice(0, 80) : "Local agent run";
456
+ return buildDialogFallbackTitleFromUserInput(lastUserText) || "Local agent run";
451
457
  }
452
458
  function pickDialogTitle(args) {
453
- const existing = args.existingDialog?.title;
454
- if (typeof existing === "string" && existing.trim()) return existing.trim();
459
+ const existingSource = args.existingDialog?.titleSource;
460
+ const existingIsManual = existingSource === "manual";
455
461
  const override = args.titleOverride?.trim();
456
- if (override) return override;
457
- return resolveDialogTitle({
458
- existingDialog: args.existingDialog,
459
- messages: args.messages
460
- });
462
+ if (override && !existingIsManual) {
463
+ return { title: override, titleSource: "generated" };
464
+ }
465
+ const existing = args.existingDialog?.title;
466
+ if (typeof existing === "string" && existing.trim()) {
467
+ return {
468
+ title: existing.trim(),
469
+ titleSource: existingIsManual ? "manual" : "generated"
470
+ };
471
+ }
472
+ if (override) {
473
+ return { title: override, titleSource: "generated" };
474
+ }
475
+ return {
476
+ title: resolveDialogTitle({
477
+ existingDialog: args.existingDialog,
478
+ messages: args.messages
479
+ }),
480
+ titleSource: "generated"
481
+ };
461
482
  }
462
483
  function normalizeSubjectRef(ref) {
463
484
  if (!ref || typeof ref !== "object") return null;
@@ -472,6 +493,15 @@ function normalizeSubjectRef(ref) {
472
493
  ...role ? { role } : {}
473
494
  };
474
495
  }
496
+ function parseTitleUpdatedAtMs(existingDialog) {
497
+ const raw = existingDialog?.titleUpdatedAt;
498
+ if (typeof raw === "number" && !Number.isNaN(raw)) return raw;
499
+ if (typeof raw === "string" && raw.trim()) {
500
+ const parsed = Date.parse(raw);
501
+ if (!Number.isNaN(parsed)) return parsed;
502
+ }
503
+ return 0;
504
+ }
475
505
  function mergeSubjectRefs(...groups) {
476
506
  const refs = [];
477
507
  const seen = /* @__PURE__ */ new Set();
@@ -550,6 +580,14 @@ function buildAgentRuntimeDialogWritePlan(args) {
550
580
  cybots: [args.input.agentKey],
551
581
  primaryAgentKey: args.input.agentKey
552
582
  };
583
+ const pickedTitle = pickDialogTitle({
584
+ existingDialog: args.existingDialog,
585
+ titleOverride: args.titleOverride,
586
+ messages: args.input.messages
587
+ });
588
+ const existingTitleUpdatedAtMs = parseTitleUpdatedAtMs(args.existingDialog);
589
+ const titleChanged = typeof args.titleOverride === "string" && args.titleOverride.trim().length > 0;
590
+ const titleUpdatedAtIso = titleChanged ? nowIso : existingTitleUpdatedAtMs > 0 ? new Date(existingTitleUpdatedAtMs).toISOString() : args.existingDialog?.createdAt ?? nowIso;
553
591
  const dialogRecord = {
554
592
  ...asRecordOrEmpty(args.existingDialog),
555
593
  id: dialogId,
@@ -557,11 +595,9 @@ function buildAgentRuntimeDialogWritePlan(args) {
557
595
  type: "dialog",
558
596
  userId: args.userId,
559
597
  ...dialogAgentFields,
560
- title: pickDialogTitle({
561
- existingDialog: args.existingDialog,
562
- titleOverride: args.titleOverride,
563
- messages: args.input.messages
564
- }),
598
+ title: pickedTitle.title,
599
+ titleSource: pickedTitle.titleSource,
600
+ titleUpdatedAt: titleUpdatedAtIso,
565
601
  status: args.input.result.error === true ? "failed" : "done",
566
602
  triggerType: `${args.runtimeHost}-local`,
567
603
  executionMode: args.existingDialog?.executionMode ?? "foreground",
@@ -1124,11 +1160,185 @@ async function executeLocalToolWithPolicy(args) {
1124
1160
  }
1125
1161
 
1126
1162
  // packages/agent-runtime/localWorkspaceTools.ts
1127
- import { existsSync } from "node:fs";
1163
+ import { existsSync as existsSync2 } from "node:fs";
1128
1164
  import { mkdir, readdir, readFile, stat, writeFile } from "node:fs/promises";
1129
1165
  import { dirname, relative, resolve, sep } from "node:path";
1130
1166
  import { spawnSync, spawn as spawnChildProcess } from "node:child_process";
1131
1167
 
1168
+ // packages/agent-runtime/runtimeCompat.ts
1169
+ import { existsSync, readdirSync, statSync } from "node:fs";
1170
+ import { join } from "node:path";
1171
+ import { spawn } from "node:child_process";
1172
+ var IS_WINDOWS = process.platform === "win32";
1173
+ function isExecutableFile(candidate) {
1174
+ if (!existsSync(candidate)) return false;
1175
+ try {
1176
+ return statSync(candidate).isFile();
1177
+ } catch {
1178
+ return false;
1179
+ }
1180
+ }
1181
+ function resolveExecutableOnPath(name) {
1182
+ if (IS_WINDOWS && !/\.[a-z]+$/i.test(name)) {
1183
+ const exts = (process.env.PATHEXT || ".EXE;.CMD;.BAT").split(";").filter(Boolean);
1184
+ for (const ext of exts) {
1185
+ const found = resolveExecutableOnPath(name + ext);
1186
+ if (found) return found;
1187
+ }
1188
+ return null;
1189
+ }
1190
+ const pathEnv = process.env.PATH ?? "";
1191
+ const sep2 = pathEnv.includes(";") && IS_WINDOWS ? ";" : ":";
1192
+ const pathDirs = pathEnv.split(sep2).filter(Boolean);
1193
+ const fallbackDirs = IS_WINDOWS ? [] : [
1194
+ "/opt/homebrew/bin",
1195
+ "/usr/local/bin",
1196
+ "/usr/bin",
1197
+ "/bin",
1198
+ `${process.env.HOME ?? ""}/.local/bin`
1199
+ ].filter(Boolean);
1200
+ for (const dir of [...pathDirs, ...fallbackDirs]) {
1201
+ const candidate = join(dir, name);
1202
+ if (isExecutableFile(candidate)) return candidate;
1203
+ }
1204
+ return null;
1205
+ }
1206
+ function createGlob(pattern) {
1207
+ const regex = globToRegExp(pattern);
1208
+ return {
1209
+ match(path) {
1210
+ return regex.test(path);
1211
+ },
1212
+ scanSync(opts) {
1213
+ const dot = opts.dot ?? false;
1214
+ const results = [];
1215
+ walkDir(opts.cwd, "", dot, results);
1216
+ return results.filter((rel) => regex.test(rel));
1217
+ }
1218
+ };
1219
+ }
1220
+ function walkDir(dir, prefix, dot, out) {
1221
+ let entries;
1222
+ try {
1223
+ entries = readdirSync(dir, { withFileTypes: true, encoding: "utf8" });
1224
+ } catch {
1225
+ return;
1226
+ }
1227
+ for (const entry of entries) {
1228
+ const name = String(entry.name);
1229
+ if (!dot && name.startsWith(".")) continue;
1230
+ const rel = prefix ? `${prefix}/${name}` : name;
1231
+ const full = join(dir, name);
1232
+ if (entry.isDirectory()) {
1233
+ walkDir(full, rel, dot, out);
1234
+ } else if (entry.isFile()) {
1235
+ out.push(rel);
1236
+ }
1237
+ }
1238
+ }
1239
+ function globToRegExp(pattern) {
1240
+ const trailingDir = pattern.endsWith("/");
1241
+ const src = trailingDir ? pattern.slice(0, -1) : pattern;
1242
+ const anchored = src.startsWith("/");
1243
+ const body = anchored ? src.slice(1) : src;
1244
+ let regex = "^";
1245
+ if (!anchored) regex += "(?:.*/)?";
1246
+ regex += convertBody(body);
1247
+ if (trailingDir) {
1248
+ regex += "(?:/.*)?";
1249
+ }
1250
+ regex += "$";
1251
+ return new RegExp(regex);
1252
+ }
1253
+ function convertBody(p) {
1254
+ let out = "";
1255
+ let i = 0;
1256
+ while (i < p.length) {
1257
+ const c = p[i];
1258
+ if (c === "*") {
1259
+ if (p[i + 1] === "*") {
1260
+ i += 2;
1261
+ if (p[i] === "/") {
1262
+ out += "(?:.*/)?";
1263
+ i += 1;
1264
+ } else {
1265
+ out += ".*";
1266
+ }
1267
+ } else {
1268
+ out += "[^/]*";
1269
+ i += 1;
1270
+ }
1271
+ } else if (c === "?") {
1272
+ out += "[^/]";
1273
+ i += 1;
1274
+ } else if (c === "[") {
1275
+ out += "[";
1276
+ i += 1;
1277
+ if (p[i] === "!") {
1278
+ out += "^";
1279
+ i += 1;
1280
+ }
1281
+ while (i < p.length && p[i] !== "]") {
1282
+ out += p[i] === "\\" ? "\\\\" : p[i];
1283
+ i += 1;
1284
+ }
1285
+ if (p[i] === "]") {
1286
+ out += "]";
1287
+ i += 1;
1288
+ }
1289
+ } else if (c === "{") {
1290
+ let depth = 1;
1291
+ let j = i + 1;
1292
+ let bodyStr = "";
1293
+ while (j < p.length && depth > 0) {
1294
+ if (p[j] === "{") depth += 1;
1295
+ else if (p[j] === "}") depth -= 1;
1296
+ if (depth > 0) bodyStr += p[j];
1297
+ j += 1;
1298
+ }
1299
+ const alts = bodyStr.split(",").map((alt) => convertBody(alt));
1300
+ out += `(?:${alts.join("|")})`;
1301
+ i = j;
1302
+ } else {
1303
+ out += escapeRegexChar(c);
1304
+ i += 1;
1305
+ }
1306
+ }
1307
+ return out;
1308
+ }
1309
+ function escapeRegexChar(c) {
1310
+ if ("\\^$.|+()".includes(c)) {
1311
+ return `\\${c}`;
1312
+ }
1313
+ return c;
1314
+ }
1315
+ function spawnToWebStreams(options) {
1316
+ const [command, ...args] = options.cmd;
1317
+ const child = spawn(command, args, {
1318
+ env: options.env,
1319
+ stdio: ["ignore", "pipe", "pipe"]
1320
+ });
1321
+ const exited = new Promise((resolve2) => {
1322
+ child.on("exit", (code) => resolve2(code ?? 1));
1323
+ child.on("error", () => resolve2(127));
1324
+ });
1325
+ const toWeb = (stream) => {
1326
+ if (!stream) return null;
1327
+ return stream.toWeb?.() ?? new ReadableStream({
1328
+ start(controller) {
1329
+ stream.on("data", (chunk) => controller.enqueue(new Uint8Array(chunk)));
1330
+ stream.on("end", () => controller.close());
1331
+ stream.on("error", (e) => controller.error(e));
1332
+ }
1333
+ });
1334
+ };
1335
+ return {
1336
+ stdout: toWeb(child.stdout),
1337
+ stderr: toWeb(child.stderr),
1338
+ exited
1339
+ };
1340
+ }
1341
+
1132
1342
  // packages/agent-runtime/processRegistry.ts
1133
1343
  var ProcessRegistry = class {
1134
1344
  processes = /* @__PURE__ */ new Map();
@@ -2494,7 +2704,7 @@ function resolveRipgrepBinary(env = process.env) {
2494
2704
  const fromEnv = asOptionalTrimmedString(env.NOLO_BUNDLED_RG);
2495
2705
  if (fromEnv) {
2496
2706
  try {
2497
- if (existsSync(fromEnv)) return fromEnv;
2707
+ if (existsSync2(fromEnv)) return fromEnv;
2498
2708
  } catch {
2499
2709
  }
2500
2710
  }
@@ -3656,6 +3866,116 @@ function createLocalWorkspaceToolExecutors(args) {
3656
3866
  };
3657
3867
  }
3658
3868
 
3869
+ // packages/agent-runtime/noloWorkspaceTools.node.ts
3870
+ async function readNoloProcessStream(readable) {
3871
+ if (!readable) return "";
3872
+ return new Response(readable).text();
3873
+ }
3874
+ async function runNoloWorkspaceCliTool(call, args) {
3875
+ const cliArgs = buildNoloWorkspaceCommandArgs(call);
3876
+ const bunSpawn = globalThis.Bun?.spawn;
3877
+ const spawn2 = args.spawn ?? (typeof bunSpawn === "function" ? bunSpawn : nodeSpawnFallback);
3878
+ const execPath = args.processExecPath ?? process.execPath;
3879
+ const entrypoint = args.cliEntrypoint;
3880
+ const cmd = entrypoint && entrypoint !== execPath ? [execPath, entrypoint, ...cliArgs] : [execPath, ...cliArgs];
3881
+ const proc = spawn2({
3882
+ cmd,
3883
+ stdout: "pipe",
3884
+ stderr: "pipe",
3885
+ env: args.env
3886
+ });
3887
+ const [stdout, stderr, exitCode] = await Promise.all([
3888
+ readNoloProcessStream(proc.stdout),
3889
+ readNoloProcessStream(proc.stderr),
3890
+ proc.exited
3891
+ ]);
3892
+ const content = `${stdout}${stderr}`;
3893
+ if (exitCode !== 0) {
3894
+ throw new Error(content.trim() || `nolo ${cliArgs.join(" ")} exited ${exitCode}`);
3895
+ }
3896
+ return {
3897
+ content,
3898
+ metadata: {
3899
+ [args.metadataKind ?? "noloWorkspaceTool"]: true,
3900
+ command: ["nolo", ...cliArgs].join(" "),
3901
+ exitCode
3902
+ }
3903
+ };
3904
+ }
3905
+ function buildNoloWorkspaceCliToolExecutors(args) {
3906
+ const executors = {};
3907
+ for (const toolName of NOLO_WORKSPACE_TOOL_NAMES) {
3908
+ if (toolName === "loadSkill") continue;
3909
+ executors[toolName] = (call) => runNoloWorkspaceCliTool(call, args);
3910
+ }
3911
+ return executors;
3912
+ }
3913
+ var nodeSpawnFallback = (options) => {
3914
+ return spawnToWebStreams({ cmd: options.cmd, env: options.env });
3915
+ };
3916
+ function buildLoadSkillExecutor(args) {
3917
+ return async (call) => {
3918
+ const parsed = parseNoloWorkspaceToolArguments(call.arguments);
3919
+ const name = noloStringArg(parsed.name ?? parsed.skillName ?? parsed.skill);
3920
+ if (!name) {
3921
+ return {
3922
+ content: await formatUnknownSkillMessage(args.cwd, "(no name provided)"),
3923
+ metadata: { loadSkill: true, resolved: false }
3924
+ };
3925
+ }
3926
+ const { resolveSkillByName } = await import("./skillDiscovery-KJWT7JBU.js");
3927
+ const resolved = resolveSkillByName(args.cwd, name);
3928
+ if (!resolved) {
3929
+ const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-EN6Z6G6U.js");
3930
+ const builtinSlug = resolveCodingBuiltinSlug(name);
3931
+ if (builtinSlug) {
3932
+ const body = buildCodingSkillContentBySlug(builtinSlug);
3933
+ return {
3934
+ content: `Skill "${name}" loaded inline. Follow its instructions.
3935
+
3936
+ ${body}`,
3937
+ metadata: { loadSkill: true, resolved: true, name, requestedName: name, builtin: true }
3938
+ };
3939
+ }
3940
+ return {
3941
+ content: await formatUnknownSkillMessage(args.cwd, name),
3942
+ metadata: { loadSkill: true, resolved: false, name, requestedName: name }
3943
+ };
3944
+ }
3945
+ try {
3946
+ const { readFileSync } = await import("node:fs");
3947
+ const body = readFileSync(resolved, "utf8");
3948
+ return {
3949
+ content: `Skill "${name}" loaded inline. Follow its instructions.
3950
+
3951
+ ${body}`,
3952
+ metadata: { loadSkill: true, resolved: true, name, requestedName: name, path: resolved }
3953
+ };
3954
+ } catch (err) {
3955
+ const message = err instanceof Error ? err.message : String(err);
3956
+ return {
3957
+ content: `Skill "${name}" could not be read: ${message}`,
3958
+ metadata: { loadSkill: true, resolved: true, name, requestedName: name, path: resolved, readError: message }
3959
+ };
3960
+ }
3961
+ };
3962
+ }
3963
+ async function formatUnknownSkillMessage(cwd, requestedName) {
3964
+ const { discoverSkills } = await import("./skillDiscovery-KJWT7JBU.js");
3965
+ let available = [];
3966
+ try {
3967
+ available = discoverSkills(cwd).map((s) => s.name);
3968
+ } catch {
3969
+ }
3970
+ const header = `Skill "${requestedName}" not found in this workspace's skill directory (.agents/skills/<name>/SKILL.md).`;
3971
+ if (available.length === 0) return `${header}
3972
+
3973
+ No skills were discovered in this workspace.`;
3974
+ return `${header}
3975
+
3976
+ Available skills: ${available.join(", ")}`;
3977
+ }
3978
+
3659
3979
  export {
3660
3980
  parseSseDataLineJson,
3661
3981
  parseSseDataLineObject,
@@ -3678,5 +3998,7 @@ export {
3678
3998
  buildLocalWorkspaceToolset,
3679
3999
  buildLocalWorkspacePolicyToolNames,
3680
4000
  buildLocalWorkspaceOpenAiTools,
3681
- createLocalWorkspaceToolExecutors
4001
+ createLocalWorkspaceToolExecutors,
4002
+ buildNoloWorkspaceCliToolExecutors,
4003
+ buildLoadSkillExecutor
3682
4004
  };
@@ -199,7 +199,7 @@ async function readDocFunc(args, thunkApi) {
199
199
  throw new Error(`\u65E0\u6548\u7684\u9875\u9762 ID: ${id}\u3002\u9875\u9762 ID \u901A\u5E38\u4EE5 "page-" \u5F00\u5934\u3002`);
200
200
  }
201
201
  try {
202
- const { readAction } = await import("./read-3FMPZPER.js");
202
+ const { readAction } = await import("./read-F3L3T2WJ.js");
203
203
  const pageData = await readAction({ dbKey: id }, thunkApi);
204
204
  if (!pageData) {
205
205
  throw new Error(`\u672A\u627E\u5230 ID \u4E3A ${id} \u7684\u9875\u9762\u3002`);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getAntigravityUserAgent
3
- } from "./chunk-FXUSIQC2.js";
3
+ } from "./chunk-SROR5TSM.js";
4
4
  import {
5
5
  writeOAuthCredential
6
6
  } from "./chunk-JZPBVBIY.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generatePkcePair,
3
3
  startCallbackServer
4
- } from "./chunk-OK6YSWLH.js";
4
+ } from "./chunk-IICW77GI.js";
5
5
  import {
6
6
  toErrorMessage
7
7
  } from "./chunk-HNMXYYJR.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-VYHDJEQD.js";
4
+ } from "./chunk-QNLLGS37.js";
5
5
 
6
6
  // packages/ai/agent/fetchAgentContexts.ts
7
7
  async function fetchAgentContexts(references, dispatch) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildLocalAgentLookupKeys,
3
3
  shouldReadAgentKeyRemotely
4
- } from "./chunk-SWDPIPOY.js";
4
+ } from "./chunk-ZGVW7MSZ.js";
5
5
  import {
6
6
  resolveCliAgentKeyInput
7
7
  } from "./chunk-VHBWHNVT.js";
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-A7GB5UGH.js";
22
22
  import {
23
23
  createAgentKey
24
- } from "./chunk-6Y7A3OQQ.js";
24
+ } from "./chunk-NRY4GCKJ.js";
25
25
 
26
26
  // packages/cli/agentRecordHelpers.ts
27
27
  import { readFileSync } from "node:fs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  selectCurrentServer,
3
3
  selectRemoteServers
4
- } from "./chunk-RVOUXDFU.js";
4
+ } from "./chunk-S6KVFOUG.js";
5
5
  import {
6
6
  createUserKey,
7
7
  extractAgentInfo,
@@ -10,7 +10,7 @@ import {
10
10
  sanitizeShareData,
11
11
  shareKey,
12
12
  toNonEmptyString
13
- } from "./chunk-6Y7A3OQQ.js";
13
+ } from "./chunk-NRY4GCKJ.js";
14
14
  import {
15
15
  noloDeleteRequest,
16
16
  noloWriteRequest,