nolo-cli 0.18.0 → 0.24.0-alpha.13

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 (134) hide show
  1. package/README.md +9 -18
  2. package/{_executeModel-X5PCIZN6.js → _executeModel-ZPNYAEFW.js} +46 -44
  3. package/{action-LT7BRFLK.js → action-5MNAXR5B.js} +7 -6
  4. package/{addContentAction-PL3KKBDH.js → addContentAction-UNSYTVTB.js} +5 -5
  5. package/{addDialogAgentAction-FCMSKYAF.js → addDialogAgentAction-LJGNP2AO.js} +5 -5
  6. package/{agentDeleteCommand-2BZDQV36.js → agentDeleteCommand-5ZV4433K.js} +27 -26
  7. package/{agentEmailCommands-2QJDGRMB.js → agentEmailCommands-Z7KOYDVQ.js} +57 -55
  8. package/{agentListCommands-6VEPTKBI.js → agentListCommands-UQUXJYUN.js} +30 -26
  9. package/{agentMachineCommands-NVVHNWYI.js → agentMachineCommands-53O6P6L5.js} +25 -24
  10. package/{agentRecordCommands-4GGRDMD4.js → agentRecordCommands-ZRYNBSSS.js} +52 -50
  11. package/{agentRunCommand-XOLQNKBZ.js → agentRunCommand-B73MKVOG.js} +55 -54
  12. package/{agentRunControl-Y5AFH5PQ.js → agentRunControl-SNUKXN6J.js} +6 -2
  13. package/{agentRuntimeLocal-7WYWCGL4.js → agentRuntimeLocal-GVNERRKQ.js} +21 -18
  14. package/{agentSlice-EAXPGEYV.js → agentSlice-OJBHIL34.js} +5 -5
  15. package/{appDeleteCommands-77KR2RJ4.js → appDeleteCommands-23Z3Z6KE.js} +23 -22
  16. package/{appDeployCommands-K7CAHGBI.js → appDeployCommands-3MFAR4Z7.js} +23 -22
  17. package/{appDeployStatusCommands-4OEKLTBT.js → appDeployStatusCommands-JHU6GSN4.js} +23 -22
  18. package/{appGetCommands-VM2WDLAZ.js → appGetCommands-24J55H2Y.js} +23 -22
  19. package/{appListCommands-GX6BBA6U.js → appListCommands-HE5KP3PH.js} +23 -22
  20. package/{authCommand-DY6UUL6O.js → authCommand-KGRK6MNU.js} +12 -13
  21. package/{authCommands-XTBV7OFZ.js → authCommands-JSOG2H4E.js} +4 -5
  22. package/{chunk-OWOHNGCN.js → chunk-2MBTWINN.js} +42 -3
  23. package/{chunk-MVQ4TBSD.js → chunk-54VHTARN.js} +1 -1
  24. package/{chunk-RQN4SEKL.js → chunk-5DWZ46RJ.js} +1 -1
  25. package/{chunk-VYHDJEQD.js → chunk-5EDKWSQN.js} +136 -78
  26. package/{chunk-Z4NR32XR.js → chunk-5RGU3J7P.js} +13 -0
  27. package/{chunk-7BUYEZ6U.js → chunk-7H3UTGPM.js} +12 -72
  28. package/{chunk-3ZX7PERL.js → chunk-AAWJ5S3G.js} +20 -7
  29. package/{chunk-SCTYAHYK.js → chunk-ADE6577S.js} +237 -142
  30. package/{chunk-PJSV3IZ5.js → chunk-AOPOTHFK.js} +1 -1
  31. package/{chunk-3ND52WIL.js → chunk-ATWUOTJP.js} +180 -24
  32. package/{chunk-SWDPIPOY.js → chunk-AZW5AHMW.js} +1 -1
  33. package/chunk-CF7S2RYZ.js +376 -0
  34. package/{chunk-L4F3I4SR.js → chunk-CV6BM7LU.js} +4 -6
  35. package/{chunk-G5U6LDLG.js → chunk-CWTT2NZ6.js} +6 -6
  36. package/{chunk-MKA6QE5E.js → chunk-CZHE6LLV.js} +135 -55
  37. package/{chunk-KFEVY3ST.js → chunk-D34RI6NI.js} +18 -8
  38. package/{chunk-XRZJGPFI.js → chunk-FON47ACC.js} +4 -4
  39. package/{chunk-K6EUAOW3.js → chunk-FXFGNOT2.js} +67 -1
  40. package/{chunk-LLWKHDG4.js → chunk-G36SUBHA.js} +14 -6
  41. package/{chunk-REA4JLBH.js → chunk-GD23ZX7Z.js} +7 -6
  42. package/{chunk-ROWQEJRP.js → chunk-GE6IWA5N.js} +12 -4
  43. package/{chunk-EDV7EBOI.js → chunk-GGB6MPHD.js} +2155 -1503
  44. package/{chunk-IYEXFJPC.js → chunk-GNGOZMU2.js} +64 -57
  45. package/{chunk-4T5F7YZQ.js → chunk-I6RJGORZ.js} +1 -1
  46. package/{chunk-DFCFMCY6.js → chunk-J2WT5CEO.js} +2 -2
  47. package/{chunk-AHCY2S2I.js → chunk-JJ2WUBFN.js} +1 -1
  48. package/{chunk-UGUW3FHG.js → chunk-JMSCXQUG.js} +2 -2
  49. package/{chunk-VDXCXCXH.js → chunk-KURQBS7S.js} +1 -1
  50. package/{chunk-FQZZLA3C.js → chunk-KXKQO4Q6.js} +17 -0
  51. package/{chunk-3Q7WHGCB.js → chunk-L65QKSVJ.js} +1 -1
  52. package/{chunk-UAIVG4J6.js → chunk-LEHTC2FI.js} +1 -8
  53. package/{chunk-UBHAWFQ6.js → chunk-LLDGWLML.js} +42 -19
  54. package/{chunk-JLA4FXYC.js → chunk-MALVZUYL.js} +1 -1
  55. package/{chunk-N54HIJVJ.js → chunk-MCXQNEJ3.js} +101 -9
  56. package/{chunk-GFUIQ4RY.js → chunk-MXFQHRSS.js} +1 -1
  57. package/{chunk-LSFAWXKC.js → chunk-N7J63Q6C.js} +1 -0
  58. package/{chunk-6Y7A3OQQ.js → chunk-NRY4GCKJ.js} +2 -0
  59. package/{chunk-ELT65PZW.js → chunk-OXLLFZNF.js} +1 -1
  60. package/{chunk-YGW4G5W5.js → chunk-P3RZ6DHN.js} +133 -25
  61. package/{chunk-5MIDPSSK.js → chunk-PB7G5MAM.js} +3 -3
  62. package/{chunk-HEGV7BH3.js → chunk-PMCKFQYC.js} +1 -1
  63. package/{chunk-23FZYPLC.js → chunk-PTKI7TIN.js} +911 -1064
  64. package/{chunk-MHSGJW4Z.js → chunk-PXPISYEH.js} +44 -14
  65. package/{chunk-I2ZJKTG5.js → chunk-PY7VGC5M.js} +29 -10
  66. package/{chunk-PIZYJVHQ.js → chunk-RM464B7I.js} +4 -4
  67. package/{chunk-XHG22OEX.js → chunk-ROJI6DRT.js} +2 -2
  68. package/{chunk-VNAEBGDK.js → chunk-RZNYL4LW.js} +123 -26
  69. package/{chunk-RVOUXDFU.js → chunk-S6KVFOUG.js} +6 -34
  70. package/{chunk-BV4VEE3W.js → chunk-S7AV3NCK.js} +277 -357
  71. package/{chunk-R35XMF6F.js → chunk-SIUEKVK4.js} +484 -67
  72. package/{chunk-B5TOXZAK.js → chunk-SIZQB7BD.js} +1 -1
  73. package/{chunk-DFFIZ25G.js → chunk-SLOGKB7M.js} +4 -1
  74. package/{chunk-MPVYDS7I.js → chunk-TLYHUIWF.js} +3 -3
  75. package/{chunk-HWW2M4SN.js → chunk-TNM27YZ7.js} +5 -4
  76. package/{chunk-OK6YSWLH.js → chunk-TWA4L7J7.js} +1 -1
  77. package/chunk-UZ6XXCVR.js +50 -0
  78. package/{chunk-DKZFOK24.js → chunk-WCP5FDTF.js} +16 -304
  79. package/{chunk-TRT4I4UD.js → chunk-WSQLK2KR.js} +2 -2
  80. package/{chunk-FXUSIQC2.js → chunk-XNZJVYFS.js} +1 -1
  81. package/{chunk-V3ED5AWK.js → chunk-YJY7HODU.js} +27 -16
  82. package/chunk-YYLHWIW6.js +48 -0
  83. package/{chunk-CZ6NYQTV.js → chunk-ZFL3LTU7.js} +2 -2
  84. package/{chunk-34WPV75U.js → chunk-ZUXIXYJI.js} +1 -1
  85. package/{chunk-VC6OZXO5.js → chunk-ZWJOGMKH.js} +2 -26
  86. package/{cliExecutor-DNE7TCC4.js → cliExecutor-K3F7DMRO.js} +2 -2
  87. package/{codingSkills-36KN5NQT.js → codingSkills-EN6Z6G6U.js} +4 -4
  88. package/{createAgentAutomationAction-GNFF524X.js → createAgentAutomationAction-PO62NUR7.js} +19 -18
  89. package/{createDialogAction-RB55KCLO.js → createDialogAction-ORFRYI3C.js} +22 -20
  90. package/{createPageAction-Y7343GLU.js → createPageAction-XWVMNTYH.js} +20 -19
  91. package/{db-W3O47YGF.js → db-W5UHK4P3.js} +150 -0
  92. package/{dbSlice-CGSRFJN3.js → dbSlice-5BKDURDL.js} +4 -4
  93. package/{dialogCommands-IAZK6YHQ.js → dialogCommands-XTJHROXM.js} +24 -23
  94. package/{dialogSlice-UQAXF23P.js → dialogSlice-DJXC53YW.js} +24 -18
  95. package/{docCreateCommands-I2EWZGCI.js → docCreateCommands-T2XRVXYS.js} +24 -27
  96. package/{docDeleteCommands-IZ45UZKG.js → docDeleteCommands-L7RXFXY3.js} +25 -24
  97. package/{docReadCommands-R6Z4QJYU.js → docReadCommands-M5PYNADQ.js} +24 -23
  98. package/{docStore-5HOJ4D7D.js → docStore-6LKLLFDW.js} +20 -19
  99. package/{docUpdateCommands-2LRBKQPY.js → docUpdateCommands-OA5EGPLQ.js} +24 -27
  100. package/{fetchMessages-BMGVZVSE.js → fetchMessages-W4IKHPCS.js} +2 -3
  101. package/{getPricing-G7DLAST6.js → getPricing-6C3C47Y4.js} +3 -3
  102. package/{handleSendMessageAction-Q4HY35WX.js → handleSendMessageAction-ILFGZTN5.js} +23 -20
  103. package/index.js +74 -74
  104. package/{localDialogRead-4H3QJFLW.js → localDialogRead-JXTAHW2E.js} +2 -2
  105. package/{machineCommands-PKBPQKTY.js → machineCommands-AKAQGPAO.js} +59 -57
  106. package/{machineWsRunDispatch-UZAW4OXJ.js → machineWsRunDispatch-RSBERM64.js} +51 -49
  107. package/{models-DJFSJ7SW.js → models-ILWKIX2Y.js} +2 -2
  108. package/package.json +1 -1
  109. package/{read-3FMPZPER.js → read-F3L3T2WJ.js} +2 -1
  110. package/{readDocTool-VSYHKK3V.js → readDocTool-FOHWVA4R.js} +1 -1
  111. package/{readlineWorkspace-Y2RDOFZG.js → readlineWorkspace-TUH3SFHO.js} +937 -430
  112. package/{removeDialogAgentAction-OAGA2G3U.js → removeDialogAgentAction-QCFGIUIH.js} +8 -7
  113. package/{runAgentClientLoop-NBPIKJ6J.js → runAgentClientLoop-C3QB2EXV.js} +45 -38
  114. package/{setDialogExtraReferencesAction-JZEXA5SL.js → setDialogExtraReferencesAction-DK4CKERU.js} +5 -5
  115. package/{setPrimaryDialogAgentAction-4ZUQQKDG.js → setPrimaryDialogAgentAction-SJSO6N27.js} +8 -7
  116. package/{settingSlice-7MNKHZ6R.js → settingSlice-XNM5AFPU.js} +6 -5
  117. package/{spaceCommands-DHCZ7J5I.js → spaceCommands-SXYOFGUJ.js} +25 -24
  118. package/{spaceSlice-ZXLLG3CR.js → spaceSlice-6BHMRP5O.js} +21 -18
  119. package/{streamAgentChatTurn-L3YW6LSB.js → streamAgentChatTurn-GF5W5OIP.js} +140 -98
  120. package/switchDialogAgentAction-4OAC6QRN.js +61 -0
  121. package/{tableCommands-BEQAGE4I.js → tableCommands-QSZILI7I.js} +1 -1
  122. package/{toolApiClient-QI3YBNWB.js → toolApiClient-ISM4ZQX4.js} +2 -2
  123. package/{tools-ECGXR5QF.js → tools-KBCLJ43G.js} +36 -33
  124. package/{tuiSummaryLlmCaller-OMSCNHXA.js → tuiSummaryLlmCaller-ARIMGILF.js} +6 -6
  125. package/{updateCommands-XTW55TOT.js → updateCommands-AK2RDOFR.js} +8 -2
  126. package/{updateDialogTitleAction-HQ2EUDFT.js → updateDialogTitleAction-LMHZUY4Q.js} +28 -27
  127. package/chunk-DL6EPNIK.js +0 -50
  128. package/chunk-V5R4NZP2.js +0 -78
  129. package/chunk-X4Q4UZEY.js +0 -26
  130. package/queryRunOverlay-O4LOMMPO.js +0 -161
  131. package/runOverlayPresentation-ZO4VCWEU.js +0 -11
  132. package/types-ZSTJ7MPR.js +0 -7
  133. package/{chunk-X7W4TNB4.js → chunk-CMKUBIGW.js} +3 -3
  134. package/{runtimeDoctorCommands-E2OUORHK.js → runtimeDoctorCommands-HSU632DY.js} +3 -3
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  dialogMessageKey
3
- } from "./chunk-6Y7A3OQQ.js";
3
+ } from "./chunk-NRY4GCKJ.js";
4
4
  import {
5
5
  asOptionalFiniteNumber
6
6
  } from "./chunk-WWC7I6TA.js";
@@ -23,8 +23,11 @@ var extractCustomId = (key) => {
23
23
  }
24
24
  return extractKeyPart(key, 2);
25
25
  };
26
+ var PUBLIC_AGENT_KEY_PREFIX = "agent-pub-";
27
+ var publicAgentKey = (id) => `${PUBLIC_AGENT_KEY_PREFIX}${id}`;
26
28
 
27
29
  export {
28
30
  extractUserId,
29
- extractCustomId
31
+ extractCustomId,
32
+ publicAgentKey
30
33
  };
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-23FZYPLC.js";
4
+ } from "./chunk-PTKI7TIN.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-EDV7EBOI.js";
7
+ } from "./chunk-GGB6MPHD.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-YGW4G5W5.js";
10
+ } from "./chunk-P3RZ6DHN.js";
11
11
  import {
12
12
  resolveLocalRuntimeEnvFromPolicy
13
13
  } from "./chunk-5CS33IBL.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  listUserRecordsFromServers,
3
3
  readLiveDbRecordAfterTombstoneMerge
4
- } from "./chunk-HEGV7BH3.js";
4
+ } from "./chunk-PMCKFQYC.js";
5
5
  import {
6
6
  agentRecordHasConfiguredCredential
7
- } from "./chunk-DFCFMCY6.js";
7
+ } from "./chunk-J2WT5CEO.js";
8
8
  import {
9
9
  toSafeAgentSummary
10
- } from "./chunk-3ZX7PERL.js";
10
+ } from "./chunk-AAWJ5S3G.js";
11
11
 
12
12
  // packages/cli/agentListHelpers.ts
13
13
  function parseAgentRecordId(privateKey, explicitId) {
@@ -51,7 +51,8 @@ function normalizeListedAgent(record) {
51
51
  credentialRef,
52
52
  apiKeyRef,
53
53
  ...typeof record?.apiSource === "string" && record.apiSource ? { apiSource: record.apiSource } : {},
54
- ...typeof record?.cliProvider === "string" && record.cliProvider ? { cliProvider: record.cliProvider } : {}
54
+ ...typeof record?.cliProvider === "string" && record.cliProvider ? { cliProvider: record.cliProvider } : {},
55
+ ...typeof record?.nextAvailableAt === "number" && Number.isFinite(record.nextAvailableAt) ? { nextAvailableAt: record.nextAvailableAt } : {}
55
56
  };
56
57
  }
57
58
  function toSafeListedAgentSummary(agent, options) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getAntigravityUserAgent
3
- } from "./chunk-FXUSIQC2.js";
3
+ } from "./chunk-XNZJVYFS.js";
4
4
  import {
5
5
  writeOAuthCredential
6
6
  } from "./chunk-JZPBVBIY.js";
@@ -0,0 +1,50 @@
1
+ // packages/ai/tools/agentCapabilities.ts
2
+ var SYSTEM_AGENT_CAPABILITIES = [
3
+ {
4
+ id: "web-search",
5
+ label: "\u8054\u7F51\u641C\u7D22",
6
+ description: "\u8BA9 agent \u80FD\u641C\u7D22\u4E92\u8054\u7F51\u3001\u6293\u53D6\u7F51\u9875\u5185\u5BB9\uFF0C\u83B7\u53D6\u6700\u65B0\u4FE1\u606F\u3002",
7
+ tools: ["exa_search", "fetchWebpage"],
8
+ defaultEnabled: true,
9
+ icon: "\u{1F310}"
10
+ },
11
+ {
12
+ id: "web-scrape",
13
+ label: "\u6DF1\u5EA6\u7F51\u9875\u6293\u53D6",
14
+ description: "\u5728\u666E\u901A\u8054\u7F51\u641C\u7D22\u4E4B\u5916\uFF0C\u7528 Firecrawl \u505A\u7ED3\u6784\u5316\u641C\u7D22\u4E0E\u6574\u9875\u6293\u53D6\uFF0C\u9002\u5408\u9700\u8981\u5B8C\u6574\u6B63\u6587\u3001\u6587\u6863\u7AD9\u70B9\u6216\u7AD9\u5185\u68C0\u7D22\u7684\u573A\u666F\u3002",
15
+ tools: ["firecrawl_search", "firecrawl_scrape"],
16
+ defaultEnabled: true,
17
+ icon: "\u{1F578}\uFE0F"
18
+ },
19
+ {
20
+ id: "conversation-todo",
21
+ label: "\u5BF9\u8BDD Todo",
22
+ description: "\u5728\u591A\u6B65\u9AA4\u5BF9\u8BDD\u4E2D\u663E\u793A\u548C\u66F4\u65B0\u4EFB\u52A1\u8FDB\u5EA6\u3002\u5173\u95ED\u540E\uFF0CAgent \u4E0D\u4F1A\u4F7F\u7528\u5BF9\u8BDD\u5185 Todo \u5DE5\u5177\u3002",
23
+ tools: ["setTodoList"],
24
+ defaultEnabled: true,
25
+ icon: "\u2611\uFE0F"
26
+ },
27
+ {
28
+ id: "agent-orchestration",
29
+ label: "\u591A agent \u7F16\u6392",
30
+ description: "\u5148\u6309\u6536\u85CF\u3001\u7B80\u4ECB\u3001\u80FD\u529B\u548C\u6210\u672C\u5217\u51FA\u5B89\u5168 agent \u6458\u8981\uFF0C\u6309\u9700\u8BFB\u53D6\u5019\u9009\u914D\u7F6E\u89E3\u6790\u53EF\u8FD0\u884C key\uFF0C\u518D\u540E\u53F0\u542F\u52A8\u5176\u4ED6 agent \u6267\u884C\u5B50\u4EFB\u52A1\uFF0C\u5E76\u89C2\u5BDF\u3001\u67E5\u8BE2\u3001\u505C\u6B62\u8FD0\u884C\u4E2D\u7684 agent run\u2014\u2014\u9002\u5408\u5E76\u884C\u6D3E\u53D1\u3001\u957F\u4EFB\u52A1\u8DDF\u8E2A\u3001\u4E2D\u9014\u53EB\u505C\u7B49\u7F16\u6392\u573A\u666F\u3002",
31
+ tools: ["startAgentRun", "controlAgentRun", "listAgents"],
32
+ defaultEnabled: true,
33
+ icon: "\u{1F9E9}"
34
+ }
35
+ ];
36
+ var SYSTEM_AGENT_CAPABILITY_IDS = SYSTEM_AGENT_CAPABILITIES.map(
37
+ ({ id }) => id
38
+ );
39
+ var DEFAULT_SYSTEM_AGENT_CAPABILITIES = Object.fromEntries(
40
+ SYSTEM_AGENT_CAPABILITIES.map(({ id, defaultEnabled }) => [
41
+ id,
42
+ defaultEnabled
43
+ ])
44
+ );
45
+
46
+ export {
47
+ SYSTEM_AGENT_CAPABILITIES,
48
+ SYSTEM_AGENT_CAPABILITY_IDS,
49
+ DEFAULT_SYSTEM_AGENT_CAPABILITIES
50
+ };
@@ -127,180 +127,6 @@ function redactAgentRecordForWorkspaceTool(record) {
127
127
  return redacted;
128
128
  }
129
129
 
130
- // packages/agent-runtime/runtimeCompat.ts
131
- import { existsSync, readdirSync, statSync } from "node:fs";
132
- import { join } from "node:path";
133
- import { spawn } from "node:child_process";
134
- var IS_WINDOWS = process.platform === "win32";
135
- function isExecutableFile(candidate) {
136
- if (!existsSync(candidate)) return false;
137
- try {
138
- return statSync(candidate).isFile();
139
- } catch {
140
- return false;
141
- }
142
- }
143
- function resolveExecutableOnPath(name) {
144
- if (IS_WINDOWS && !/\.[a-z]+$/i.test(name)) {
145
- const exts = (process.env.PATHEXT || ".EXE;.CMD;.BAT").split(";").filter(Boolean);
146
- for (const ext of exts) {
147
- const found = resolveExecutableOnPath(name + ext);
148
- if (found) return found;
149
- }
150
- return null;
151
- }
152
- const pathEnv = process.env.PATH ?? "";
153
- const sep = pathEnv.includes(";") && IS_WINDOWS ? ";" : ":";
154
- const pathDirs = pathEnv.split(sep).filter(Boolean);
155
- const fallbackDirs = IS_WINDOWS ? [] : [
156
- "/opt/homebrew/bin",
157
- "/usr/local/bin",
158
- "/usr/bin",
159
- "/bin",
160
- `${process.env.HOME ?? ""}/.local/bin`
161
- ].filter(Boolean);
162
- for (const dir of [...pathDirs, ...fallbackDirs]) {
163
- const candidate = join(dir, name);
164
- if (isExecutableFile(candidate)) return candidate;
165
- }
166
- return null;
167
- }
168
- function createGlob(pattern) {
169
- const regex = globToRegExp(pattern);
170
- return {
171
- match(path) {
172
- return regex.test(path);
173
- },
174
- scanSync(opts) {
175
- const dot = opts.dot ?? false;
176
- const results = [];
177
- walkDir(opts.cwd, "", dot, results);
178
- return results.filter((rel) => regex.test(rel));
179
- }
180
- };
181
- }
182
- function walkDir(dir, prefix, dot, out) {
183
- let entries;
184
- try {
185
- entries = readdirSync(dir, { withFileTypes: true, encoding: "utf8" });
186
- } catch {
187
- return;
188
- }
189
- for (const entry of entries) {
190
- const name = String(entry.name);
191
- if (!dot && name.startsWith(".")) continue;
192
- const rel = prefix ? `${prefix}/${name}` : name;
193
- const full = join(dir, name);
194
- if (entry.isDirectory()) {
195
- walkDir(full, rel, dot, out);
196
- } else if (entry.isFile()) {
197
- out.push(rel);
198
- }
199
- }
200
- }
201
- function globToRegExp(pattern) {
202
- const trailingDir = pattern.endsWith("/");
203
- const src = trailingDir ? pattern.slice(0, -1) : pattern;
204
- const anchored = src.startsWith("/");
205
- const body = anchored ? src.slice(1) : src;
206
- let regex = "^";
207
- if (!anchored) regex += "(?:.*/)?";
208
- regex += convertBody(body);
209
- if (trailingDir) {
210
- regex += "(?:/.*)?";
211
- }
212
- regex += "$";
213
- return new RegExp(regex);
214
- }
215
- function convertBody(p) {
216
- let out = "";
217
- let i = 0;
218
- while (i < p.length) {
219
- const c = p[i];
220
- if (c === "*") {
221
- if (p[i + 1] === "*") {
222
- i += 2;
223
- if (p[i] === "/") {
224
- out += "(?:.*/)?";
225
- i += 1;
226
- } else {
227
- out += ".*";
228
- }
229
- } else {
230
- out += "[^/]*";
231
- i += 1;
232
- }
233
- } else if (c === "?") {
234
- out += "[^/]";
235
- i += 1;
236
- } else if (c === "[") {
237
- out += "[";
238
- i += 1;
239
- if (p[i] === "!") {
240
- out += "^";
241
- i += 1;
242
- }
243
- while (i < p.length && p[i] !== "]") {
244
- out += p[i] === "\\" ? "\\\\" : p[i];
245
- i += 1;
246
- }
247
- if (p[i] === "]") {
248
- out += "]";
249
- i += 1;
250
- }
251
- } else if (c === "{") {
252
- let depth = 1;
253
- let j = i + 1;
254
- let bodyStr = "";
255
- while (j < p.length && depth > 0) {
256
- if (p[j] === "{") depth += 1;
257
- else if (p[j] === "}") depth -= 1;
258
- if (depth > 0) bodyStr += p[j];
259
- j += 1;
260
- }
261
- const alts = bodyStr.split(",").map((alt) => convertBody(alt));
262
- out += `(?:${alts.join("|")})`;
263
- i = j;
264
- } else {
265
- out += escapeRegexChar(c);
266
- i += 1;
267
- }
268
- }
269
- return out;
270
- }
271
- function escapeRegexChar(c) {
272
- if ("\\^$.|+()".includes(c)) {
273
- return `\\${c}`;
274
- }
275
- return c;
276
- }
277
- function spawnToWebStreams(options) {
278
- const [command, ...args] = options.cmd;
279
- const child = spawn(command, args, {
280
- env: options.env,
281
- stdio: ["ignore", "pipe", "pipe"]
282
- });
283
- const exited = new Promise((resolve) => {
284
- child.on("exit", (code) => resolve(code ?? 1));
285
- child.on("error", () => resolve(127));
286
- });
287
- const toWeb = (stream) => {
288
- if (!stream) return null;
289
- return stream.toWeb?.() ?? new ReadableStream({
290
- start(controller) {
291
- stream.on("data", (chunk) => controller.enqueue(new Uint8Array(chunk)));
292
- stream.on("end", () => controller.close());
293
- stream.on("error", (e) => controller.error(e));
294
- }
295
- });
296
- };
297
- return {
298
- stdout: toWeb(child.stdout),
299
- stderr: toWeb(child.stderr),
300
- exited
301
- };
302
- }
303
-
304
130
  // packages/agent-runtime/noloWorkspaceTools.ts
305
131
  var NOLO_WORKSPACE_TOOL_NAMES = [
306
132
  "listDialogs",
@@ -347,23 +173,23 @@ function buildNoloWorkspaceOpenAiTools(args) {
347
173
  limit: { type: "integer", description: "Maximum dialogs to return." },
348
174
  space: stringToolParam("Optional space id or URL.")
349
175
  });
350
- add("readDialog", "Read one persisted dialog in the Nolo workspace.", {
351
- dialog: stringToolParam("Dialog id, dialog db key, or dialog URL."),
176
+ add("readDialog", "Read one persisted dialog in the Nolo workspace by full dbKey (dialog-<userId>-<id>) or URL. Use listDialogs first if target is unclear; bare id works for current user only.", {
177
+ dialog: stringToolParam("Dialog dbKey (dialog-<userId>-<id>), dialog URL, or bare id (current user only)."),
352
178
  limit: { type: "integer", description: "Optional message limit." }
353
179
  }, ["dialog"]);
354
180
  add("queryDialogsBySubjectRef", "Query persisted dialog evidence by a generic dialog.subjectRefs target.", {
355
- rowDbKey: stringToolParam("Optional convenience alias for subjectKind=table-row, subjectId=<rowDbKey>, subjectRole=task."),
356
- subjectKind: stringToolParam("Generic subject ref kind, for example table-row, page, file, commit, or artifact."),
357
- subjectId: stringToolParam("Generic subject ref id."),
181
+ rowDbKey: stringToolParam("Optional alias for subjectKind=table-row, subjectId=<rowDbKey>, subjectRole=task."),
182
+ subjectKind: stringToolParam("Subject ref kind (e.g. table-row, page, file, commit, artifact)."),
183
+ subjectId: stringToolParam("Subject ref id."),
358
184
  subjectRole: stringToolParam("Optional subject ref role."),
359
185
  limit: { type: "integer", description: "Maximum matching dialog summaries to return." },
360
- status: stringToolParam("Optional dialog status filter, for example running, done, or failed."),
186
+ status: stringToolParam("Optional dialog status filter (running, done, failed)."),
361
187
  checkpointStatus: stringToolParam("Optional runtimeCheckpoint.status filter."),
362
188
  hasArtifacts: { type: "boolean", description: "When true, only return dialogs with artifact evidence." },
363
- excludeDialogId: stringToolParam("Optional dialog id or dialog dbKey to exclude from evidence results, typically the current caller dialog.")
189
+ excludeDialogId: stringToolParam("Optional dialog id to exclude from results.")
364
190
  });
365
- add("deleteDialogs", "Find and delete the current user's dialogs by title/id/dbKey. This is destructive: preview matches first and wait for explicit user confirmation before deleting.", {
366
- query: stringToolParam("Dialog title/id/dbKey search text, for example \u4E2D\u533B\u8BC4\u6D4B or a dialog id."),
191
+ add("deleteDialogs", "Find and delete dialogs by title/id/dbKey. Preview matches and wait for user confirmation before deleting.", {
192
+ query: stringToolParam("Dialog title/id/dbKey search text."),
367
193
  matchMode: {
368
194
  type: "string",
369
195
  enum: ["contains", "exact", "prefix", "dialogId"],
@@ -375,16 +201,12 @@ function buildNoloWorkspaceOpenAiTools(args) {
375
201
  description: "Confirmed dialog ids or dbKeys to delete."
376
202
  }
377
203
  }, ["query"]);
378
- add("listAgents", "List the current user's agents as safe summaries; use readAgent to resolve the runnable agentKey before delegation.", {
204
+ add("listAgents", "List the current user's agents with runnable agentKey for delegation. Copy the agentKey verbatim; do not infer it from the display name.", {
379
205
  space: stringToolParam("Optional space id or URL."),
380
206
  publicOnly: { type: "boolean", description: "Only show public agents." }
381
- // 端间差异(LOW-R2-3):CLI 命令 `nolo agent list` 无 --limit(parseAgentListArgs
382
- // 仅支持 --json/--public-only/--ids-only),本地缓存全量列出;web 端
383
- // listAgentsFunc 另有 limit(默认 100,最大 500)。如后续对齐需在
384
- // parseAgentListArgs / agentListCommands 增加 --limit 透传。
385
207
  });
386
- add("readAgent", "Read one agent's full config from the Nolo workspace. Accepts an agent dbKey (agent-xxx), plain id, alias, or agent URL; resolves it (including public agents via agent-pub-<id>; the server runtime also falls back to handle lookup) and returns the runnable agentKey plus a redacted record with fields such as model, provider, apiSource, tools, prompt, inputPrice, outputPrice, and isPublic. Use it before delegation to confirm an agent's identity and capabilities, or to resolve the agentKey that startAgentRun requires.", {
387
- agent: stringToolParam("Agent dbKey (e.g. agent-xxx), agent id, alias, or agent URL.")
208
+ add("readAgent", "Read one agent's full config by exact agentKey returned by listAgents (agent-<userId>-<id> or agent-pub-<id>); do not use the display name.", {
209
+ agent: stringToolParam("Exact agentKey from listAgents (preferred; copy verbatim; plain id or URL are compatibility fallbacks).")
388
210
  }, ["agent"]);
389
211
  add("listSpaces", "List joined spaces in the Nolo workspace.", {});
390
212
  add("readSpace", "Read one space in the Nolo workspace.", {
@@ -398,8 +220,8 @@ function buildNoloWorkspaceOpenAiTools(args) {
398
220
  add("readSkillDoc", "Read one skill doc in the Nolo workspace.", {
399
221
  doc: stringToolParam("Skill doc/page key.")
400
222
  }, ["doc"]);
401
- add("loadSkill", "Load a Skill by name from the workspace skill directory (.agents/skills/<name>/SKILL.md) and return its full SKILL.md content inline so you can follow its instructions. Use this instead of readFile when you want to activate a skill. On an unknown name the tool returns a plain text list of available skill names rather than failing.", {
402
- name: stringToolParam("Skill name (the name advertised in the skill-discovery layer).")
223
+ add("loadSkill", "Load a skill by name (.agents/skills/<name>/SKILL.md) and return its full instructions inline. Returns available skills if not found.", {
224
+ name: stringToolParam("Skill name advertised in skill discovery.")
403
225
  }, ["name"]);
404
226
  add("listTables", "List tables in the current user scope or an optional space scope.", {
405
227
  limit: { type: "integer", description: "Maximum tables to return." },
@@ -760,122 +582,13 @@ function buildNoloWorkspaceCommandArgs(call) {
760
582
  throw new Error(`Unsupported Nolo workspace tool: ${call.name}`);
761
583
  }
762
584
  }
763
- async function readNoloProcessStream(readable) {
764
- if (!readable) return "";
765
- return new Response(readable).text();
766
- }
767
- async function runNoloWorkspaceCliTool(call, args) {
768
- const cliArgs = buildNoloWorkspaceCommandArgs(call);
769
- const bunSpawn = globalThis.Bun?.spawn;
770
- const spawn2 = args.spawn ?? (typeof bunSpawn === "function" ? bunSpawn : nodeSpawnFallback);
771
- const execPath = args.processExecPath ?? process.execPath;
772
- const entrypoint = args.cliEntrypoint;
773
- const cmd = entrypoint && entrypoint !== execPath ? [execPath, entrypoint, ...cliArgs] : [execPath, ...cliArgs];
774
- const proc = spawn2({
775
- cmd,
776
- stdout: "pipe",
777
- stderr: "pipe",
778
- env: args.env
779
- });
780
- const [stdout, stderr, exitCode] = await Promise.all([
781
- readNoloProcessStream(proc.stdout),
782
- readNoloProcessStream(proc.stderr),
783
- proc.exited
784
- ]);
785
- const content = `${stdout}${stderr}`;
786
- if (exitCode !== 0) {
787
- throw new Error(content.trim() || `nolo ${cliArgs.join(" ")} exited ${exitCode}`);
788
- }
789
- return {
790
- content,
791
- metadata: {
792
- [args.metadataKind ?? "noloWorkspaceTool"]: true,
793
- command: ["nolo", ...cliArgs].join(" "),
794
- exitCode
795
- }
796
- };
797
- }
798
- function buildNoloWorkspaceCliToolExecutors(args) {
799
- const executors = {};
800
- for (const toolName of NOLO_WORKSPACE_TOOL_NAMES) {
801
- if (toolName === "loadSkill") continue;
802
- executors[toolName] = (call) => runNoloWorkspaceCliTool(call, args);
803
- }
804
- return executors;
805
- }
806
- function buildLoadSkillExecutor(args) {
807
- return async (call) => {
808
- const parsed = parseNoloWorkspaceToolArguments(call.arguments);
809
- const name = noloStringArg(parsed.name ?? parsed.skillName ?? parsed.skill);
810
- if (!name) {
811
- return {
812
- content: await formatUnknownSkillMessage(args.cwd, "(no name provided)"),
813
- metadata: { loadSkill: true, resolved: false }
814
- };
815
- }
816
- const { resolveSkillByName } = await import("./skillDiscovery-KJWT7JBU.js");
817
- const resolved = resolveSkillByName(args.cwd, name);
818
- if (!resolved) {
819
- const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-36KN5NQT.js");
820
- const builtinSlug = resolveCodingBuiltinSlug(name);
821
- if (builtinSlug) {
822
- const body = buildCodingSkillContentBySlug(builtinSlug);
823
- return {
824
- content: `Skill "${name}" loaded inline. Follow its instructions.
825
-
826
- ${body}`,
827
- metadata: { loadSkill: true, resolved: true, name, requestedName: name, builtin: true }
828
- };
829
- }
830
- return {
831
- content: await formatUnknownSkillMessage(args.cwd, name),
832
- metadata: { loadSkill: true, resolved: false, name, requestedName: name }
833
- };
834
- }
835
- try {
836
- const { readFileSync } = await import("node:fs");
837
- const body = readFileSync(resolved, "utf8");
838
- return {
839
- content: `Skill "${name}" loaded inline. Follow its instructions.
840
-
841
- ${body}`,
842
- metadata: { loadSkill: true, resolved: true, name, requestedName: name, path: resolved }
843
- };
844
- } catch (err) {
845
- const message = err instanceof Error ? err.message : String(err);
846
- return {
847
- content: `Skill "${name}" could not be read: ${message}`,
848
- metadata: { loadSkill: true, resolved: true, name, requestedName: name, path: resolved, readError: message }
849
- };
850
- }
851
- };
852
- }
853
- async function formatUnknownSkillMessage(cwd, requestedName) {
854
- const { discoverSkills } = await import("./skillDiscovery-KJWT7JBU.js");
855
- let available = [];
856
- try {
857
- available = discoverSkills(cwd).map((s) => s.name);
858
- } catch {
859
- }
860
- const header = `Skill "${requestedName}" not found in this workspace's skill directory (.agents/skills/<name>/SKILL.md).`;
861
- if (available.length === 0) return `${header}
862
-
863
- No skills were discovered in this workspace.`;
864
- return `${header}
865
-
866
- Available skills: ${available.join(", ")}`;
867
- }
868
- var nodeSpawnFallback = (options) => {
869
- return spawnToWebStreams({ cmd: options.cmd, env: options.env });
870
- };
871
585
 
872
586
  export {
873
587
  resolveRuntimeToolSurfaceForAgent,
874
588
  redactAgentRecordForWorkspaceTool,
875
- resolveExecutableOnPath,
876
- createGlob,
877
589
  NOLO_WORKSPACE_TOOL_NAMES,
878
590
  buildNoloWorkspaceOpenAiTools,
591
+ noloStringArg,
879
592
  parseNoloWorkspaceToolArguments,
880
593
  clampNoloPositiveInteger,
881
594
  getNoloDialogIdFromKey,
@@ -887,6 +600,5 @@ export {
887
600
  filterNoloDialogSubjectRefEvidence,
888
601
  verifyNoloDialogSubjectRefQuery,
889
602
  buildNoloTableQueryRequest,
890
- buildNoloWorkspaceCliToolExecutors,
891
- buildLoadSkillExecutor
603
+ buildNoloWorkspaceCommandArgs
892
604
  };
@@ -11,7 +11,7 @@ import {
11
11
  getDefaultProfileConfigPath,
12
12
  loadProfileConfig,
13
13
  saveDefaultProfile
14
- } from "./chunk-ROWQEJRP.js";
14
+ } from "./chunk-GE6IWA5N.js";
15
15
  import {
16
16
  resolveAuthTokenFromEnv
17
17
  } from "./chunk-A7GB5UGH.js";
@@ -23,7 +23,7 @@ import {
23
23
  createMemoryOwnerIndexKey,
24
24
  createMemorySubjectKindIndexKey,
25
25
  memoryOwnerRange
26
- } from "./chunk-6Y7A3OQQ.js";
26
+ } from "./chunk-NRY4GCKJ.js";
27
27
  import {
28
28
  asTrimmedNonEmptyStringArray
29
29
  } from "./chunk-I42VC5KR.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  trimTrailingSlash
3
- } from "./chunk-MHSGJW4Z.js";
3
+ } from "./chunk-PXPISYEH.js";
4
4
  import {
5
5
  asTrimmedLowercaseString
6
6
  } from "./chunk-QSJ3HFEF.js";
@@ -7,11 +7,11 @@ import {
7
7
  listUserRecordsFromServers,
8
8
  readDbRecordFromServers,
9
9
  readLiveDbRecordAfterTombstoneMerge
10
- } from "./chunk-HEGV7BH3.js";
10
+ } from "./chunk-PMCKFQYC.js";
11
11
  import {
12
12
  buildDialogAttachmentPlan,
13
13
  extractFileContentIds
14
- } from "./chunk-B5TOXZAK.js";
14
+ } from "./chunk-SIZQB7BD.js";
15
15
  import {
16
16
  toErrorMessage
17
17
  } from "./chunk-HNMXYYJR.js";
@@ -624,9 +624,9 @@ async function tryHttpDialogCandidates(args) {
624
624
  }
625
625
  throw Object.assign(new Error("All HTTP dialog reads failed"), { attempts });
626
626
  }
627
- async function readDialogFromLocalDb(dialogKey, dialogId, limit) {
628
- const { readDialogFromLocalDb: readLocalDialog } = await import("./localDialogRead-4H3QJFLW.js");
629
- const result = await readLocalDialog({ dialogKey, dialogId, limit });
627
+ async function readDialogFromLocalDb(dialogKey, dialogId, limit, readLocalDialog) {
628
+ const reader = readLocalDialog ?? (await import("./localDialogRead-JXTAHW2E.js")).readDialogFromLocalDb;
629
+ const result = await reader({ dialogKey, dialogId, limit });
630
630
  return {
631
631
  ...result,
632
632
  source: "local-db-fallback"
@@ -650,18 +650,29 @@ async function readDialogSnapshot(args) {
650
650
  const statuses = attempts.map((attempt) => attempt.status).filter((status) => typeof status === "number");
651
651
  const all404 = attempts.length > 0 && statuses.length === attempts.length && statuses.every((status) => status === 404);
652
652
  const localhostCandidate = candidateBases.find(isLocalBaseUrl);
653
- if (!localhostCandidate || all404) {
654
- throw Object.assign(new Error(
655
- all404 ? `dialog not found on tried servers: ${candidateBases.join(", ")}` : `read dialog failed across candidates: ${attempts.map((attempt) => `${attempt.base} -> ${attempt.status ?? attempt.message}`).join("; ")}`
656
- ), { attempts });
653
+ const remoteError = Object.assign(new Error(
654
+ all404 ? `dialog not found on tried servers: ${candidateBases.join(", ")}` : `read dialog failed across candidates: ${attempts.map((attempt) => `${attempt.base} -> ${attempt.status ?? attempt.message}`).join("; ")}`
655
+ ), { attempts });
656
+ if (all404 || localhostCandidate) {
657
+ try {
658
+ const fallback = await readDialogFromLocalDb(
659
+ args.dialogKey,
660
+ args.dialogId,
661
+ args.limit,
662
+ args.readLocalDialog
663
+ );
664
+ return {
665
+ ...fallback,
666
+ // Keep the configured base stable for callers that render it; the
667
+ // source field identifies that the payload came from local storage.
668
+ resolvedBase: localhostCandidate ?? args.base,
669
+ attempts,
670
+ candidateBases
671
+ };
672
+ } catch {
673
+ }
657
674
  }
658
- const fallback = await readDialogFromLocalDb(args.dialogKey, args.dialogId, args.limit);
659
- return {
660
- ...fallback,
661
- resolvedBase: localhostCandidate,
662
- attempts,
663
- candidateBases
664
- };
675
+ throw remoteError;
665
676
  }
666
677
  }
667
678
  function compact(value, max = 180) {
@@ -0,0 +1,48 @@
1
+ import {
2
+ asTrimmedLowercaseString
3
+ } from "./chunk-QSJ3HFEF.js";
4
+
5
+ // packages/agent-runtime/serverProxyPolicy.ts
6
+ var OAUTH_APIKEY_REFS = /* @__PURE__ */ new Set([
7
+ "antigravity",
8
+ "xai",
9
+ "chatgpt",
10
+ "claude",
11
+ "cursor"
12
+ ]);
13
+ function isGoogleFamilyProvider(provider) {
14
+ const normalized = asTrimmedLowercaseString(provider);
15
+ return normalized === "google" || normalized.startsWith("google-");
16
+ }
17
+ function isOAuthApiKeyRef(value) {
18
+ const ref = asTrimmedLowercaseString(value);
19
+ return ref.length > 0 && OAUTH_APIKEY_REFS.has(ref);
20
+ }
21
+ function shouldUseServerProxy(agentConfig, requestProvider) {
22
+ const effectiveProvider = (requestProvider || agentConfig.provider || "").toLowerCase();
23
+ if (isGoogleFamilyProvider(effectiveProvider)) {
24
+ return true;
25
+ }
26
+ if (isOAuthApiKeyRef(agentConfig.apiKeyRef)) {
27
+ return true;
28
+ }
29
+ if (agentConfig.apiSource === "custom" && isRemoteCustomEndpoint(agentConfig.customProviderUrl)) {
30
+ return true;
31
+ }
32
+ return !!agentConfig.useServerProxy;
33
+ }
34
+ var LOCAL_HOSTS = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "::1", "0.0.0.0"]);
35
+ function isRemoteCustomEndpoint(url) {
36
+ if (typeof url !== "string") return false;
37
+ try {
38
+ const host = new URL(url).hostname.toLowerCase();
39
+ return !LOCAL_HOSTS.has(host);
40
+ } catch {
41
+ return false;
42
+ }
43
+ }
44
+
45
+ export {
46
+ isOAuthApiKeyRef,
47
+ shouldUseServerProxy
48
+ };
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  i18n_default,
3
3
  toolRegistry
4
- } from "./chunk-EDV7EBOI.js";
4
+ } from "./chunk-GGB6MPHD.js";
5
5
  import {
6
6
  canonicalizeToolNames
7
7
  } from "./chunk-ZZ2MH7LE.js";
8
8
  import {
9
9
  isNoloHostedProvider
10
- } from "./chunk-MKA6QE5E.js";
10
+ } from "./chunk-CZHE6LLV.js";
11
11
  import {
12
12
  asTrimmedLowercaseString
13
13
  } from "./chunk-QSJ3HFEF.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isImageUrlPart
3
- } from "./chunk-KFEVY3ST.js";
3
+ } from "./chunk-D34RI6NI.js";
4
4
  import {
5
5
  canonicalizeToolNames
6
6
  } from "./chunk-ZZ2MH7LE.js";