nolo-cli 0.74.0-alpha.1 → 0.74.0

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 (86) hide show
  1. package/{_executeModel-YEVZAJYX.js → _executeModel-IULR47HG.js} +20 -20
  2. package/{agentDeleteCommand-FSIMTL4K.js → agentDeleteCommand-2S4WCDQC.js} +16 -15
  3. package/{agentEmailCommands-HQT4EUOA.js → agentEmailCommands-V3ADGHX7.js} +30 -28
  4. package/{agentListCommands-2YWZYH52.js → agentListCommands-EPK3S274.js} +18 -17
  5. package/{agentMachineCommands-3TR7DVYO.js → agentMachineCommands-XMZWK7P3.js} +16 -15
  6. package/{agentRecordCommands-TRUY7Z6N.js → agentRecordCommands-WFPWLWOF.js} +29 -27
  7. package/{agentRunCommand-EHJOESHA.js → agentRunCommand-VUWNWC7C.js} +29 -27
  8. package/{agentRuntimeLocal-O6DZDTK4.js → agentRuntimeLocal-YRONTDLM.js} +15 -14
  9. package/{agentSlice-RRZS2UII.js → agentSlice-2P7OJFES.js} +1 -1
  10. package/{appDeleteCommands-HIJNWSK7.js → appDeleteCommands-YS7UGMP3.js} +17 -16
  11. package/{appDeployCommands-XULV2ZN6.js → appDeployCommands-XIE5Z4BE.js} +17 -16
  12. package/{appDeployStatusCommands-ETY4Z7K6.js → appDeployStatusCommands-54UDVYET.js} +17 -16
  13. package/{appGetCommands-M253LKDA.js → appGetCommands-6XYLBCRN.js} +17 -16
  14. package/{appListCommands-XYFXJMNP.js → appListCommands-VEGH7SF5.js} +17 -16
  15. package/{authCommand-EVGFLAHO.js → authCommand-JIEOFHXW.js} +84 -9
  16. package/{chatQueueReduxAdapter-LSBTGZW2.js → chatQueueReduxAdapter-GPYCH5Z2.js} +5 -5
  17. package/chromeCommands-VOIRNJBL.js +499 -0
  18. package/chromeOpsCommands-M7DPCX2T.js +258 -0
  19. package/{chunk-FARB62OB.js → chunk-3VPDELAP.js} +42 -31
  20. package/{chunk-CS36XM4N.js → chunk-4SZ37KLL.js} +21 -9
  21. package/{chunk-FPTQQSS6.js → chunk-73BR2IQT.js} +23 -2
  22. package/{chunk-PYXL2CJL.js → chunk-7FWPLK4M.js} +1 -1
  23. package/{chunk-DSRXPQWA.js → chunk-7QVPPOEC.js} +1 -1
  24. package/{chunk-KIS76A2P.js → chunk-AX7RMXSH.js} +1 -1
  25. package/{chunk-OXY5PKLG.js → chunk-BKJO7LDP.js} +2 -2
  26. package/{chunk-Q6FF2MCK.js → chunk-BOYUESO7.js} +1 -1
  27. package/{chunk-GBPZKFYK.js → chunk-BZNGCVAW.js} +1 -1
  28. package/{chunk-EXMHJN7C.js → chunk-CADAR6QU.js} +1 -1
  29. package/{chunk-2QDDKFG5.js → chunk-CQ3WA2NE.js} +77 -0
  30. package/{chunk-B62OSA77.js → chunk-D6XYLSOS.js} +1 -1
  31. package/{chunk-TI4CCL34.js → chunk-DM4FBSWG.js} +3 -3
  32. package/{chunk-JWO3RQSH.js → chunk-DUJWWUGV.js} +1 -1
  33. package/{chunk-XGZM6BTX.js → chunk-EBKMQULC.js} +66 -120
  34. package/{chunk-ZLPA7K55.js → chunk-ETLZZQJE.js} +2 -2
  35. package/chunk-FMODTASJ.js +109 -0
  36. package/{chunk-T7PQFKJU.js → chunk-FNGAF7C4.js} +2 -2
  37. package/{chunk-MYU3MJCF.js → chunk-GCJ3IS5M.js} +0 -1
  38. package/{chunk-XPQJXIF5.js → chunk-GHEJJGJI.js} +125 -25
  39. package/{chunk-DFY6PUV4.js → chunk-HTMVBPOF.js} +7 -7
  40. package/{chunk-VOEW2KF3.js → chunk-IDGYOD2O.js} +59 -55
  41. package/{chunk-YCDWJX45.js → chunk-KC5FAHVS.js} +1 -1
  42. package/{chunk-2JCTE5UN.js → chunk-KEZNSFGD.js} +3 -3
  43. package/{chunk-I4UWPYBH.js → chunk-KRMWO2NN.js} +2 -2
  44. package/{chunk-PGSKWZCB.js → chunk-LHDV2QUI.js} +1 -1
  45. package/{chunk-UJ63UXGE.js → chunk-MXUSPS2N.js} +289 -2
  46. package/{chunk-3IT2PFHL.js → chunk-NB5SIWC4.js} +1 -1
  47. package/{chunk-HXAINXPQ.js → chunk-NFT2AOK5.js} +2 -2
  48. package/{chunk-AUKZOZFG.js → chunk-NRALD3CC.js} +2 -2
  49. package/{chunk-CJ23A7U4.js → chunk-PF6O3GR3.js} +533 -57
  50. package/{chunk-K7AG465Q.js → chunk-PZCTYKGU.js} +3 -1
  51. package/chunk-QCZX4FTW.js +242 -0
  52. package/{chunk-QBA5KMJI.js → chunk-RZOJRTKR.js} +29 -15
  53. package/{chunk-OH5WRY7G.js → chunk-T25L377S.js} +18 -6
  54. package/{chunk-CMH2SYHX.js → chunk-TMPLPCVX.js} +1 -1
  55. package/{chunk-3U3EA3BO.js → chunk-U7YP7ECK.js} +3 -3
  56. package/{chunk-AWPU7GXU.js → chunk-URWDSZRW.js} +2 -2
  57. package/{chunk-Q4OT2DC7.js → chunk-WL2RKIBF.js} +1 -1
  58. package/{chunk-IDZTNRP2.js → chunk-X7HHHIOZ.js} +10 -2
  59. package/{chunk-57VRXRLF.js → chunk-Y3NZYLPG.js} +1 -1
  60. package/{chunk-V3ZKNK5D.js → chunk-ZVN6I33J.js} +5 -5
  61. package/{codingSkills-E6KSDNSJ.js → codingSkills-7S6523WH.js} +2 -2
  62. package/{contentThunks-476Y6CFR.js → contentThunks-THSCADSK.js} +6 -6
  63. package/{createAgentAutomationAction-DN4SFTP5.js → createAgentAutomationAction-WGN3UQ5A.js} +6 -6
  64. package/{createDialogAction-2GS4JCMU.js → createDialogAction-3EN2NLH7.js} +8 -8
  65. package/{createPageAction-44WTUMZ5.js → createPageAction-4VK473QV.js} +6 -6
  66. package/{dialogCommands-PE5FEFJ5.js → dialogCommands-PS4NWYY7.js} +17 -16
  67. package/{dialogSlice-7HEVCJFT.js → dialogSlice-CLV7SVOZ.js} +5 -5
  68. package/{docCreateCommands-IPDFZVPG.js → docCreateCommands-4KANZJR6.js} +16 -15
  69. package/{docDeleteCommands-VQ4Y66CM.js → docDeleteCommands-F2S2TRUF.js} +17 -16
  70. package/{docReadCommands-PD33VV27.js → docReadCommands-B2WDPZQE.js} +16 -15
  71. package/{docStore-LJ7KNKFB.js → docStore-TDLCHWPF.js} +1 -1
  72. package/{docUpdateCommands-CGUQ2JY3.js → docUpdateCommands-E7TKHRIO.js} +16 -15
  73. package/{getPricing-HRMSOF3E.js → getPricing-QVTUQQTM.js} +2 -2
  74. package/{handleSendMessageAction-ETA5QZIN.js → handleSendMessageAction-AHL3ZHE4.js} +5 -5
  75. package/index.js +118 -54
  76. package/{machineCommands-INAP62WH.js → machineCommands-OTABVXOA.js} +28 -26
  77. package/{machineWsRunDispatch-MT7VRNKX.js → machineWsRunDispatch-V4EVQSMZ.js} +28 -26
  78. package/package.json +1 -1
  79. package/{readlineWorkspace-5TV6ES57.js → readlineWorkspace-IIT3FQ6I.js} +439 -117
  80. package/{runAgentClientLoop-2PGZSCET.js → runAgentClientLoop-7TQM7IAR.js} +18 -18
  81. package/{spaceCommands-Y47DDAQD.js → spaceCommands-FSYH7AL4.js} +16 -15
  82. package/{streamAgentChatTurn-I6FUM6RV.js → streamAgentChatTurn-6EF6TVFK.js} +22 -22
  83. package/{tools-KU4X5HGZ.js → tools-R3QNWWTD.js} +15 -13
  84. package/{tuiSummaryLlmCaller-J5BEPLW5.js → tuiSummaryLlmCaller-PWOXTCBF.js} +5 -5
  85. package/{updateCommands-AJYSD73Y.js → updateCommands-Y363MC3L.js} +2 -2
  86. package/{updateDialogTitleAction-E3SNB75W.js → updateDialogTitleAction-F3EUOWOB.js} +6 -6
@@ -11,7 +11,7 @@ import {
11
11
  getAntigravityUserAgent,
12
12
  normalizeAntigravityTokenPayload,
13
13
  refreshAntigravityToken
14
- } from "./chunk-PGSKWZCB.js";
14
+ } from "./chunk-LHDV2QUI.js";
15
15
  import {
16
16
  writeOAuthCredential
17
17
  } from "./chunk-ONXOABJR.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-AGGIDPCZ.js";
7
7
  import {
8
8
  getModelConfig
9
- } from "./chunk-UJ63UXGE.js";
9
+ } from "./chunk-MXUSPS2N.js";
10
10
  import {
11
11
  isPlatformHostedImageModel
12
12
  } from "./chunk-AJHEFRGJ.js";
@@ -160,6 +160,82 @@ function hasParsableObjectArguments(raw) {
160
160
  return false;
161
161
  }
162
162
  }
163
+ var STRICT_JSON_STRING_TOKEN = /^"(?:[^"\\\u0000-\u001F]|\\["\\/bfnrt]|\\u[0-9A-Fa-f]{4})*"$/;
164
+ function isStrictJsonStringToken(value) {
165
+ if (!STRICT_JSON_STRING_TOKEN.test(value)) return false;
166
+ try {
167
+ return typeof JSON.parse(value) === "string";
168
+ } catch {
169
+ return false;
170
+ }
171
+ }
172
+ function closersOf(openStack) {
173
+ return openStack.slice().reverse().map((ch) => ch === "{" ? "}" : "]").join("");
174
+ }
175
+ function scanJsonForTailRepair(input) {
176
+ const stack = [];
177
+ let inString = false;
178
+ let escaped = false;
179
+ let lastCommaOutsideString = null;
180
+ for (let i = 0; i < input.length; i += 1) {
181
+ const ch = input[i];
182
+ if (inString) {
183
+ if (escaped) escaped = false;
184
+ else if (ch === "\\") escaped = true;
185
+ else if (ch === '"') inString = false;
186
+ continue;
187
+ }
188
+ if (ch === '"') {
189
+ inString = true;
190
+ continue;
191
+ }
192
+ if (ch === "{" || ch === "[") {
193
+ stack.push(ch);
194
+ continue;
195
+ }
196
+ if (ch === "}" || ch === "]") {
197
+ const open = stack.pop();
198
+ if (open !== (ch === "}" ? "{" : "[")) return null;
199
+ continue;
200
+ }
201
+ if (ch === ",") {
202
+ lastCommaOutsideString = { index: i, closers: closersOf(stack) };
203
+ continue;
204
+ }
205
+ }
206
+ return { inString, closers: closersOf(stack), lastCommaOutsideString };
207
+ }
208
+ function repairTruncatedToolArguments(raw) {
209
+ if (typeof raw !== "string") return null;
210
+ const withoutTrailingSpace = raw.replace(/\s+$/, "");
211
+ const endsWithComma = withoutTrailingSpace.endsWith(",");
212
+ const trimmed = endsWithComma ? withoutTrailingSpace.slice(0, -1).replace(/\s+$/, "") : withoutTrailingSpace;
213
+ if (trimmed === "" || trimmed.endsWith(",")) return null;
214
+ const scan = scanJsonForTailRepair(trimmed);
215
+ if (!scan || scan.inString) return null;
216
+ const lastChar = trimmed[trimmed.length - 1];
217
+ const tailIsCompleteToken = endsWithComma || lastChar === '"' || lastChar === "}" || lastChar === "]";
218
+ if (!tailIsCompleteToken) return null;
219
+ const candidates = [trimmed + scan.closers];
220
+ const lastComma = scan.lastCommaOutsideString;
221
+ if (lastComma && lastComma.index > 0) {
222
+ const tailAfterComma = trimmed.slice(lastComma.index + 1).trim();
223
+ if (isStrictJsonStringToken(tailAfterComma)) {
224
+ const head = trimmed.slice(0, lastComma.index);
225
+ candidates.push(head + lastComma.closers);
226
+ }
227
+ }
228
+ for (const candidate of candidates) {
229
+ try {
230
+ const parsed = JSON.parse(candidate);
231
+ if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) && Object.keys(parsed).length > 0) {
232
+ return candidate;
233
+ }
234
+ } catch {
235
+ }
236
+ }
237
+ return null;
238
+ }
163
239
  function downgradeUnparsableToolCalls(messages) {
164
240
  if (!Array.isArray(messages) || messages.length === 0) {
165
241
  return { messages, downgraded: 0 };
@@ -218,5 +294,6 @@ function downgradeUnparsableToolCalls(messages) {
218
294
  export {
219
295
  sanitizeForOutbound,
220
296
  hasParsableObjectArguments,
297
+ repairTruncatedToolArguments,
221
298
  downgradeUnparsableToolCalls
222
299
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readDbRecord,
3
3
  writeAgentRecord
4
- } from "./chunk-AUKZOZFG.js";
4
+ } from "./chunk-NRALD3CC.js";
5
5
  import {
6
6
  buildSkillSummaryMarker
7
7
  } from "./chunk-VF4K2QE6.js";
@@ -304,7 +304,7 @@ var slice = createSliceWithThunks({
304
304
  const overrides = {};
305
305
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
306
306
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
307
- const { _executeModel } = await import("./_executeModel-YEVZAJYX.js");
307
+ const { _executeModel } = await import("./_executeModel-IULR47HG.js");
308
308
  return _executeModel(
309
309
  {
310
310
  isStreaming: args.isStreaming ?? false,
@@ -325,7 +325,7 @@ var slice = createSliceWithThunks({
325
325
  * - 循环直到无工具调用或触发其他运行时停止条件
326
326
  */
327
327
  runAgent: create.asyncThunk(async (args, thunkApi) => {
328
- const { runAgentClientLoop } = await import("./runAgentClientLoop-2PGZSCET.js");
328
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-7TQM7IAR.js");
329
329
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
330
330
  {
331
331
  agentKey: args.agentKey,
@@ -341,7 +341,7 @@ var slice = createSliceWithThunks({
341
341
  * 聊天轮次流式 Agent 调用
342
342
  */
343
343
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
344
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-I6FUM6RV.js");
344
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-6EF6TVFK.js");
345
345
  return streamAgentChatTurnHandler(args, thunkApi);
346
346
  }),
347
347
  /**
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  requireTokenUser
3
- } from "./chunk-B62OSA77.js";
3
+ } from "./chunk-D6XYLSOS.js";
4
4
  import {
5
5
  resolveServerUrl
6
6
  } from "./chunk-A7GB5UGH.js";
@@ -9,7 +9,7 @@ import {
9
9
  initReactI18next,
10
10
  instance,
11
11
  toast
12
- } from "./chunk-VOEW2KF3.js";
12
+ } from "./chunk-IDGYOD2O.js";
13
13
  import {
14
14
  require_date_fns
15
15
  } from "./chunk-M76ECQRD.js";
@@ -72,7 +72,8 @@ import {
72
72
  scheduleWriteReplication
73
73
  } from "./chunk-3RAG2NAD.js";
74
74
  import {
75
- createClientLogger
75
+ createClientLogger,
76
+ isAbortError
76
77
  } from "./chunk-QOKAKDPE.js";
77
78
  import {
78
79
  selectIdentityUserId
@@ -102,6 +103,7 @@ var import_date_fns2 = __toESM(require_date_fns(), 1);
102
103
  import { ulid as ulid3 } from "ulid";
103
104
 
104
105
  // packages/render/table/fetchAndCacheTableRows.ts
106
+ var TABLE_ROWS_FETCH_TIMEOUT_MS = 5e3;
105
107
  var getRowTimestamp = (row) => {
106
108
  if (!row || typeof row !== "object") return 0;
107
109
  return asOptionalPositiveFiniteNumber(Date.parse(row.updatedAt ?? "")) ?? asOptionalPositiveFiniteNumber(Date.parse(row.createdAt ?? "")) ?? 0;
@@ -155,46 +157,63 @@ var loadLocalTableRows = async (db, tenantId, tableId) => {
155
157
  }
156
158
  return rows;
157
159
  };
158
- var fetchTableRowsFromServer = async (server, tenantId, tableId, headers) => {
159
- const res = await fetch(`${server}/rpc/listTableRows`, {
160
- method: "POST",
161
- headers,
162
- body: JSON.stringify({
163
- tenantId,
164
- tableId,
165
- includeDeleted: true,
166
- envelope: TABLE_SYNC_ENVELOPE
167
- })
168
- });
169
- if (!res.ok) {
170
- let msg = `\u52A0\u8F7D\u8868 ${tableId} \u884C\u5931\u8D25\uFF08${res.status}\uFF09`;
171
- try {
172
- const err2 = await res.json();
173
- if (err2 && typeof err2.message === "string") {
174
- msg = err2.message;
160
+ var fetchTableRowsFromServer = async (server, tenantId, tableId, headers, fetchImpl = fetch) => {
161
+ const controller = new AbortController();
162
+ const timeoutId = setTimeout(
163
+ () => controller.abort(),
164
+ TABLE_ROWS_FETCH_TIMEOUT_MS
165
+ );
166
+ try {
167
+ const res = await fetchImpl(`${server}/rpc/listTableRows`, {
168
+ method: "POST",
169
+ headers,
170
+ body: JSON.stringify({
171
+ tenantId,
172
+ tableId,
173
+ includeDeleted: true,
174
+ envelope: TABLE_SYNC_ENVELOPE
175
+ }),
176
+ signal: controller.signal
177
+ });
178
+ if (!res.ok) {
179
+ let msg = `\u52A0\u8F7D\u8868 ${tableId} \u884C\u5931\u8D25\uFF08${res.status}\uFF09`;
180
+ try {
181
+ const err2 = await res.json();
182
+ if (err2 && typeof err2.message === "string") {
183
+ msg = err2.message;
184
+ }
185
+ } catch {
175
186
  }
176
- } catch {
187
+ throw new Error(msg);
188
+ }
189
+ const data = await res.json();
190
+ if (Array.isArray(data)) {
191
+ return {
192
+ rows: data,
193
+ deletedRows: [],
194
+ tableMeta: null,
195
+ complete: false
196
+ };
197
+ }
198
+ if (!data || typeof data !== "object" || !Array.isArray(data.rows)) {
199
+ throw new Error("\u670D\u52A1\u5668\u8FD4\u56DE\u683C\u5F0F\u9519\u8BEF\uFF1A\u9884\u671F\u4E3A\u6570\u7EC4");
177
200
  }
178
- throw new Error(msg);
179
- }
180
- const data = await res.json();
181
- if (Array.isArray(data)) {
182
201
  return {
183
- rows: data,
184
- deletedRows: [],
185
- tableMeta: null,
186
- complete: false
202
+ rows: data.rows,
203
+ deletedRows: Array.isArray(data.deletedRows) ? data.deletedRows : [],
204
+ tableMeta: data.tableMeta ?? null,
205
+ complete: data.complete === true
187
206
  };
207
+ } catch (err2) {
208
+ if (isAbortError(err2)) {
209
+ throw new Error(
210
+ `\u52A0\u8F7D\u8868 ${tableId} \u884C\u8D85\u65F6\uFF1A${server} \u5728 ${TABLE_ROWS_FETCH_TIMEOUT_MS / 1e3}s \u5185\u65E0\u54CD\u5E94`
211
+ );
212
+ }
213
+ throw err2;
214
+ } finally {
215
+ clearTimeout(timeoutId);
188
216
  }
189
- if (!data || typeof data !== "object" || !Array.isArray(data.rows)) {
190
- throw new Error("\u670D\u52A1\u5668\u8FD4\u56DE\u683C\u5F0F\u9519\u8BEF\uFF1A\u9884\u671F\u4E3A\u6570\u7EC4");
191
- }
192
- return {
193
- rows: data.rows,
194
- deletedRows: Array.isArray(data.deletedRows) ? data.deletedRows : [],
195
- tableMeta: data.tableMeta ?? null,
196
- complete: data.complete === true
197
- };
198
217
  };
199
218
  var cacheMergedTableRows = async (db, mergedRows) => {
200
219
  if (!db) return;
@@ -252,7 +271,8 @@ var fetchAndCacheTableRows = async ({
252
271
  tenantId,
253
272
  tableId,
254
273
  token,
255
- remoteServers = []
274
+ remoteServers = [],
275
+ fetchImpl = fetch
256
276
  }) => {
257
277
  const headers = {
258
278
  "Content-Type": "application/json"
@@ -263,7 +283,7 @@ var fetchAndCacheTableRows = async ({
263
283
  const localRows = await loadLocalTableRows(db, tenantId, tableId);
264
284
  const remoteResults = await Promise.allSettled(
265
285
  remoteServers.map(
266
- (server) => fetchTableRowsFromServer(server, tenantId, tableId, headers)
286
+ (server) => fetchTableRowsFromServer(server, tenantId, tableId, headers, fetchImpl)
267
287
  )
268
288
  );
269
289
  const fulfilledRemoteSnapshots = remoteResults.filter(
@@ -367,43 +387,6 @@ function reorderColumnInMeta(meta, input, deps) {
367
387
  buildMeta(meta, reorderList(meta.columns, fromIndex, toIndex), deps.nowIso)
368
388
  );
369
389
  }
370
- function renameColumnInMeta(meta, rows, input, deps) {
371
- const { oldName } = input;
372
- const { nowIso } = deps;
373
- const newName = input.newName.trim();
374
- if (!newName) {
375
- return err("\u65B0\u7684\u5B57\u6BB5\u540D\u4E0D\u80FD\u4E3A\u7A7A");
376
- }
377
- if (!meta.columns.some((c) => c.name === oldName)) {
378
- return err(`\u5B57\u6BB5 ${oldName} \u4E0D\u5B58\u5728`);
379
- }
380
- if (meta.columns.some((c) => c.name === newName)) {
381
- return err(`\u5B57\u6BB5 ${newName} \u5DF2\u5B58\u5728`);
382
- }
383
- const newColumns = meta.columns.map(
384
- (c) => c.name === oldName ? { ...c, name: newName } : c
385
- );
386
- const rowPatches = rows.filter((row) => hasOwn(row, oldName)).map((row) => ({
387
- dbKey: row.dbKey,
388
- changes: {
389
- [newName]: row[oldName],
390
- [oldName]: null,
391
- updatedAt: nowIso
392
- }
393
- }));
394
- const newRows = rows.map((row) => {
395
- if (!hasOwn(row, oldName)) {
396
- return row;
397
- }
398
- const { [oldName]: oldValue, ...rest } = row;
399
- return { ...rest, [newName]: oldValue, updatedAt: nowIso };
400
- });
401
- return ok({
402
- ...buildMeta(meta, newColumns, nowIso),
403
- rows: newRows,
404
- rowPatches
405
- });
406
- }
407
390
  function renameColumnLabelInMeta(meta, input, deps) {
408
391
  const { columnId } = input;
409
392
  const label = input.label.trim();
@@ -460,7 +443,13 @@ import { ulid as ulid2 } from "ulid";
460
443
  instance.use(initReactI18next).init({
461
444
  ...i18nBaseConfig,
462
445
  lng: "zh-CN" /* ZH_CN */,
463
- fallbackLng: "zh-CN" /* ZH_CN */,
446
+ fallbackLng: {
447
+ ["en" /* EN */]: ["en" /* EN */],
448
+ ["zh-CN" /* ZH_CN */]: ["zh-CN" /* ZH_CN */, "en" /* EN */],
449
+ ["zh-Hant" /* ZH_HANT */]: ["zh-Hant" /* ZH_HANT */, "zh-CN" /* ZH_CN */, "en" /* EN */],
450
+ ["ja" /* JA */]: ["ja" /* JA */, "en" /* EN */],
451
+ default: ["en" /* EN */]
452
+ },
464
453
  compatibilityJSON: "v3"
465
454
  });
466
455
  var client_default = instance;
@@ -1189,49 +1178,6 @@ var reorderColumn = createTableCommand(
1189
1178
  }
1190
1179
  }
1191
1180
  );
1192
- var renameColumn = createTableCommand(
1193
- "table/renameColumn",
1194
- async (args, { dispatch } = {}) => {
1195
- const { tenantId, tableId, oldName, newName } = args;
1196
- const meta = state.currentTable;
1197
- if (!meta || meta.tenantId !== tenantId || meta.tableId !== tableId) {
1198
- throw new Error("\u5F53\u524D\u6CA1\u6709\u52A0\u8F7D\u5BF9\u5E94\u7684\u8868\u5B9A\u4E49");
1199
- }
1200
- const result = renameColumnInMeta(
1201
- meta,
1202
- state.rows,
1203
- { oldName, newName },
1204
- { nowIso: (0, import_date_fns2.formatISO)(/* @__PURE__ */ new Date()) }
1205
- );
1206
- if (!result.ok) {
1207
- throw new Error(result.error);
1208
- }
1209
- const { meta: nextMeta, metaChanges, rows: newRows, rowPatches } = result.value;
1210
- setState((s) => ({ ...s, error: null }));
1211
- try {
1212
- if (dispatch) {
1213
- await Promise.all(
1214
- rowPatches.map((p) => safeDispatch(dispatch, patch(p)))
1215
- );
1216
- await safeDispatch(
1217
- dispatch,
1218
- patch({ dbKey: meta.dbKey, changes: metaChanges })
1219
- );
1220
- }
1221
- setState((s) => ({
1222
- ...s,
1223
- currentTable: nextMeta,
1224
- rows: newRows,
1225
- isInitialized: true
1226
- }));
1227
- return { meta: nextMeta, rows: newRows };
1228
- } catch (e) {
1229
- const msg = e?.message || "\u91CD\u547D\u540D\u5B57\u6BB5\u5931\u8D25";
1230
- setState((s) => ({ ...s, error: msg }));
1231
- throw e;
1232
- }
1233
- }
1234
- );
1235
1181
  var renameColumnLabel = createTableCommand(
1236
1182
  "table/renameColumnLabel",
1237
1183
  async (args, { dispatch } = {}) => {
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk-PUOC4YRO.js";
5
5
  import {
6
6
  AGENT_SELECTION_PRIORITY_INSTRUCTIONS
7
- } from "./chunk-V3ZKNK5D.js";
7
+ } from "./chunk-ZVN6I33J.js";
8
8
  import {
9
9
  getModelContextWindow
10
- } from "./chunk-DSRXPQWA.js";
10
+ } from "./chunk-7QVPPOEC.js";
11
11
  import {
12
12
  estimateTokenCount
13
13
  } from "./chunk-PSCNXBYA.js";
@@ -0,0 +1,109 @@
1
+ // packages/agent-runtime/devinOAuth.ts
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import { homedir } from "node:os";
4
+ import { join } from "node:path";
5
+ var DEVIN_CONNECT_URL = "https://server.codeium.com/exa.api_server_pb.ApiServerService/GetChatMessage";
6
+ function buildDevinAuthUrl(orgId) {
7
+ const cleanOrg = orgId?.trim();
8
+ if (cleanOrg) {
9
+ return `https://app.devin.ai/org/${encodeURIComponent(cleanOrg)}/settings/keys`;
10
+ }
11
+ return "https://app.devin.ai/settings/keys";
12
+ }
13
+ function extractDevinToken(input) {
14
+ const raw = input?.trim();
15
+ if (!raw) return null;
16
+ if (/^https?:\/\//i.test(raw)) {
17
+ try {
18
+ const url = new URL(raw);
19
+ const queryToken = url.searchParams.get("token") || url.searchParams.get("access_token") || url.searchParams.get("auth_token");
20
+ if (queryToken?.trim()) return queryToken.trim();
21
+ if (url.hash) {
22
+ const hashParams = new URLSearchParams(url.hash.replace(/^#/, ""));
23
+ const hashToken = hashParams.get("token") || hashParams.get("access_token") || hashParams.get("auth_token");
24
+ if (hashToken?.trim()) return hashToken.trim();
25
+ }
26
+ } catch {
27
+ }
28
+ }
29
+ return raw || null;
30
+ }
31
+ function parseDevinCredentialsToml(content) {
32
+ for (const line of content.split(/\r?\n/)) {
33
+ const cogMatch = line.match(/(cog_[A-Za-z0-9_-]+)/);
34
+ if (cogMatch?.[1]) {
35
+ return cogMatch[1].trim();
36
+ }
37
+ const match = line.match(
38
+ /^\s*(?:windsurf_api_key|devin_api_key|api_key|api_token|token)\s*=\s*"([^"]+)"\s*$/i
39
+ );
40
+ if (match?.[1]) {
41
+ return match[1].trim();
42
+ }
43
+ }
44
+ return null;
45
+ }
46
+ function detectLocalDevinCredentials(options) {
47
+ const baseHome = options?.homeDir || homedir();
48
+ const xdgData = process.env.XDG_DATA_HOME;
49
+ const candidateCliPaths = [
50
+ xdgData ? join(xdgData, "devin", "credentials.toml") : null,
51
+ join(baseHome, ".local", "share", "devin", "credentials.toml"),
52
+ process.env.APPDATA ? join(process.env.APPDATA, "devin", "credentials.toml") : null
53
+ ].filter((p) => Boolean(p));
54
+ for (const credPath of candidateCliPaths) {
55
+ if (existsSync(credPath)) {
56
+ try {
57
+ const content = readFileSync(credPath, "utf-8");
58
+ const token = parseDevinCredentialsToml(content);
59
+ if (token) {
60
+ return {
61
+ found: true,
62
+ token,
63
+ source: "devin-cli",
64
+ sourcePath: credPath
65
+ };
66
+ }
67
+ } catch {
68
+ }
69
+ }
70
+ }
71
+ const codeiumPath = join(baseHome, ".codeium", "config.json");
72
+ if (existsSync(codeiumPath)) {
73
+ try {
74
+ const parsed = JSON.parse(readFileSync(codeiumPath, "utf-8"));
75
+ const token = parsed.apiKey || parsed.api_key;
76
+ if (token?.trim()) {
77
+ return {
78
+ found: true,
79
+ token: token.trim(),
80
+ source: "codeium-config",
81
+ sourcePath: codeiumPath
82
+ };
83
+ }
84
+ } catch {
85
+ }
86
+ }
87
+ return { found: false };
88
+ }
89
+ function buildDevinOAuthCredential(token, now = Date.now()) {
90
+ return {
91
+ provider: "devin",
92
+ accessToken: token.trim(),
93
+ obtainedAt: now
94
+ };
95
+ }
96
+ function isDevinOAuthAgent(agent) {
97
+ const ref = agent.apiKeyRef?.trim().toLowerCase();
98
+ const prov = agent.provider?.trim().toLowerCase();
99
+ return ref === "devin" || prov === "devin";
100
+ }
101
+
102
+ export {
103
+ DEVIN_CONNECT_URL,
104
+ buildDevinAuthUrl,
105
+ extractDevinToken,
106
+ detectLocalDevinCredentials,
107
+ buildDevinOAuthCredential,
108
+ isDevinOAuthAgent
109
+ };
@@ -7,7 +7,7 @@ import {
7
7
  listUserRecordsFromServers,
8
8
  readDbRecordFromServers,
9
9
  readLiveDbRecordAfterTombstoneMerge
10
- } from "./chunk-Q4OT2DC7.js";
10
+ } from "./chunk-WL2RKIBF.js";
11
11
  import {
12
12
  fetchWithTransientRetry
13
13
  } from "./chunk-5XTOKQLW.js";
@@ -30,7 +30,7 @@ import {
30
30
  boundSummaryText,
31
31
  buildDialogReadEnvelope,
32
32
  projectDialogReadForAgent
33
- } from "./chunk-V3ZKNK5D.js";
33
+ } from "./chunk-ZVN6I33J.js";
34
34
  import {
35
35
  toErrorMessage
36
36
  } from "./chunk-HNMXYYJR.js";
@@ -75,7 +75,6 @@ var TOOL_PACKS = {
75
75
  "taskWait",
76
76
  "taskLogs",
77
77
  "taskStop",
78
- "tasks",
79
78
  // watchCompletion:push 后登记「业务终态订阅」,部署结束时服务端唤醒父对话
80
79
  // (等待期间 0 轮询 0 token)。与代码工作流同链路(push → CI → 通知),随
81
80
  // 「代码执行」能力包走。