nolo-cli 0.82.0-alpha.5 → 0.83.0-alpha.1

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 (57) hide show
  1. package/{_executeModel-225YRU52.js → _executeModel-TRYFRXDJ.js} +12 -12
  2. package/{agentDeleteCommand-ZJNQGVR2.js → agentDeleteCommand-EKSPHWHV.js} +2 -1
  3. package/{agentEmailCommands-VLVWFWX2.js → agentEmailCommands-QD2K4YG6.js} +13 -12
  4. package/{agentListCommands-GHQGLAUU.js → agentListCommands-WFBYAQKO.js} +2 -1
  5. package/{agentMachineCommands-QDXYENZJ.js → agentMachineCommands-F5DKXCQP.js} +3 -2
  6. package/{agentRecordCommands-AQFYM5HS.js → agentRecordCommands-DAZ2FDZP.js} +13 -12
  7. package/{agentRunCommand-YSCD65HH.js → agentRunCommand-4VMDFEQF.js} +13 -12
  8. package/{agentRuntimeLocal-ZOHB7OOO.js → agentRuntimeLocal-FMOEMRUU.js} +2 -1
  9. package/{agentSlice-O2SBU5TK.js → agentSlice-Q5XOM2PN.js} +1 -1
  10. package/{appDeleteCommands-PRT6K5N2.js → appDeleteCommands-AXB7XZE7.js} +2 -1
  11. package/{appDeployCommands-63ZONFAN.js → appDeployCommands-ZLWI4QUC.js} +2 -1
  12. package/{appDeployStatusCommands-AFAYCVR3.js → appDeployStatusCommands-2RAEYJQF.js} +2 -1
  13. package/{appGetCommands-TNZDZE36.js → appGetCommands-QYUXS4W4.js} +2 -1
  14. package/{appListCommands-IA4SPG2X.js → appListCommands-GQLN4J5X.js} +2 -1
  15. package/{authCommand-EVGFLAHO.js → authCommand-7N2G6MXP.js} +78 -3
  16. package/{chatQueueReduxAdapter-4SM3DAWX.js → chatQueueReduxAdapter-WICMMQZT.js} +2 -2
  17. package/{chunk-NJ6WLAPS.js → chunk-5BVAAVIF.js} +1 -1
  18. package/{chunk-YSKEOTPH.js → chunk-5Q5LYRJH.js} +10 -10
  19. package/{chunk-Q46HQOW3.js → chunk-6RUOYAPM.js} +3 -3
  20. package/{chunk-SO7B7NW3.js → chunk-BHXK3KPV.js} +8 -8
  21. package/{chunk-6SD5OPQ4.js → chunk-BNQK6UPC.js} +3 -3
  22. package/{chunk-HHLTFENG.js → chunk-EWRS6HJ3.js} +288 -20
  23. package/chunk-FMODTASJ.js +109 -0
  24. package/{chunk-MYU3MJCF.js → chunk-GCJ3IS5M.js} +0 -1
  25. package/{chunk-FP27MNSX.js → chunk-JPVNC5B2.js} +2 -2
  26. package/{chunk-4UW2LDVA.js → chunk-JZYXSXMZ.js} +5 -5
  27. package/{chunk-EM6MPSEI.js → chunk-LKSDMMY2.js} +16 -4
  28. package/{chunk-5LSS6MFZ.js → chunk-LZIMZZYT.js} +1 -1
  29. package/{chunk-3W2JJOH3.js → chunk-N5KGQ5AD.js} +2 -2
  30. package/{chunk-3IT2PFHL.js → chunk-NB5SIWC4.js} +1 -1
  31. package/{chunk-YXLXHIT2.js → chunk-PFDKB7IZ.js} +1 -1
  32. package/{chunk-LSZXYE64.js → chunk-Q7TA25PG.js} +45 -7
  33. package/{chunk-73IOJLK2.js → chunk-XRMBP7IW.js} +3 -3
  34. package/{chunk-A3NNC2LA.js → chunk-YIR5OYHU.js} +6 -6
  35. package/{codingSkills-E6KSDNSJ.js → codingSkills-7S6523WH.js} +2 -2
  36. package/{contentThunks-ENAVF2YU.js → contentThunks-A2ZG3SW6.js} +3 -3
  37. package/{createAgentAutomationAction-CH6BYC7K.js → createAgentAutomationAction-QFQQPG35.js} +3 -3
  38. package/{createDialogAction-23UDOXSO.js → createDialogAction-WI73R5EQ.js} +5 -5
  39. package/{createPageAction-J6AEMLHK.js → createPageAction-XN237WPJ.js} +3 -3
  40. package/{dialogCommands-BJJGCCQR.js → dialogCommands-SFRDEMB3.js} +2 -1
  41. package/{dialogSlice-F7RD6PUY.js → dialogSlice-56G4Q4RU.js} +2 -2
  42. package/{docCreateCommands-53GB2FU3.js → docCreateCommands-OMQLZ3OW.js} +2 -1
  43. package/{docDeleteCommands-TAW5JEBU.js → docDeleteCommands-7RCC6P23.js} +2 -1
  44. package/{docReadCommands-F5N7N5E3.js → docReadCommands-5FABO4UV.js} +2 -1
  45. package/{docStore-WX4YBGXC.js → docStore-PZSZWXX3.js} +1 -1
  46. package/{docUpdateCommands-YQ7TRT35.js → docUpdateCommands-P5AQI6HB.js} +2 -1
  47. package/{handleSendMessageAction-CW4LULIR.js → handleSendMessageAction-MHKC4R3Q.js} +2 -2
  48. package/index.js +50 -46
  49. package/{machineCommands-FIYWY5EU.js → machineCommands-VJABZGD2.js} +13 -12
  50. package/{machineWsRunDispatch-KQ4OFFNR.js → machineWsRunDispatch-5SPILS2O.js} +13 -12
  51. package/package.json +1 -1
  52. package/{readlineWorkspace-QYI6BRNA.js → readlineWorkspace-GMYIPMRU.js} +13 -12
  53. package/{runAgentClientLoop-GZ5VUGAW.js → runAgentClientLoop-U3GEPCQI.js} +10 -10
  54. package/{spaceCommands-IYMIXCMC.js → spaceCommands-FNXBNF5X.js} +2 -1
  55. package/{streamAgentChatTurn-EAXIUJTK.js → streamAgentChatTurn-DAGDJH3L.js} +11 -11
  56. package/{tools-QWQOW6J4.js → tools-73VPBNX3.js} +8 -8
  57. package/{updateDialogTitleAction-2HCE2M7S.js → updateDialogTitleAction-RFQONESQ.js} +3 -3
@@ -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-225YRU52.js");
307
+ const { _executeModel } = await import("./_executeModel-TRYFRXDJ.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-GZ5VUGAW.js");
328
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-U3GEPCQI.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-EAXIUJTK.js");
344
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-DAGDJH3L.js");
345
345
  return streamAgentChatTurnHandler(args, thunkApi);
346
346
  }),
347
347
  /**
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-AGGIDPCZ.js";
14
14
  import {
15
15
  runLlm
16
- } from "./chunk-Q46HQOW3.js";
16
+ } from "./chunk-6RUOYAPM.js";
17
17
  import {
18
18
  cleanupCliSessionForDialog
19
19
  } from "./chunk-BJCWNHVU.js";
@@ -17126,7 +17126,7 @@ var messageSlice = createSliceWithThunks({
17126
17126
  runtimeOptions: args.runtimeOptions
17127
17127
  });
17128
17128
  if (agentKeyToUse) {
17129
- const { streamAgentChatTurn } = await import("./agentSlice-O2SBU5TK.js");
17129
+ const { streamAgentChatTurn } = await import("./agentSlice-Q5XOM2PN.js");
17130
17130
  await dispatch(
17131
17131
  streamAgentChatTurn({
17132
17132
  agentKey: agentKeyToUse,
@@ -18259,7 +18259,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
18259
18259
  }
18260
18260
  if (isCurrentDialog) {
18261
18261
  await thunkApi.dispatch(resetMsgs());
18262
- const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-F7RD6PUY.js");
18262
+ const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-56G4Q4RU.js");
18263
18263
  dispatch(clearPendingAttachments2());
18264
18264
  }
18265
18265
  return { dialogKey, isCurrentDialog, attachmentPlan };
@@ -18267,15 +18267,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
18267
18267
 
18268
18268
  // packages/chat/dialog/dialogSlice.ts
18269
18269
  var runCreateDialogAction = async (args, thunkApi) => {
18270
- const { createDialogAction } = await import("./createDialogAction-23UDOXSO.js");
18270
+ const { createDialogAction } = await import("./createDialogAction-WI73R5EQ.js");
18271
18271
  return createDialogAction(args, thunkApi);
18272
18272
  };
18273
18273
  var runCreateAgentAutomationAction = async (args, thunkApi) => {
18274
- const { createAgentAutomationAction } = await import("./createAgentAutomationAction-CH6BYC7K.js");
18274
+ const { createAgentAutomationAction } = await import("./createAgentAutomationAction-QFQQPG35.js");
18275
18275
  return createAgentAutomationAction(args, thunkApi);
18276
18276
  };
18277
18277
  var runUpdateDialogTitleAction = async (args, thunkApi) => {
18278
- const { updateDialogTitleAction } = await import("./updateDialogTitleAction-2HCE2M7S.js");
18278
+ const { updateDialogTitleAction } = await import("./updateDialogTitleAction-RFQONESQ.js");
18279
18279
  return updateDialogTitleAction(args, thunkApi);
18280
18280
  };
18281
18281
  var runAddDialogAgentAction = async (args, thunkApi) => {
@@ -18299,7 +18299,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
18299
18299
  return setDialogExtraReferencesAction(args, thunkApi);
18300
18300
  };
18301
18301
  var runHandleSendMessageAction = async (args, thunkApi) => {
18302
- const { handleSendMessageAction } = await import("./handleSendMessageAction-CW4LULIR.js");
18302
+ const { handleSendMessageAction } = await import("./handleSendMessageAction-MHKC4R3Q.js");
18303
18303
  return handleSendMessageAction(args, thunkApi);
18304
18304
  };
18305
18305
  function clearDialogState() {
@@ -18312,7 +18312,7 @@ var createPageAndAddReference = createAsyncThunk(
18312
18312
  async (payload, { dispatch, getState, rejectWithValue }) => {
18313
18313
  const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
18314
18314
  try {
18315
- const { createDocState } = await import("./docStore-WX4YBGXC.js");
18315
+ const { createDocState } = await import("./docStore-PZSZWXX3.js");
18316
18316
  const pageKey = await createDocState(
18317
18317
  { slateData, title },
18318
18318
  { dispatch, getState }
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-5LSS6MFZ.js";
3
+ } from "./chunk-LZIMZZYT.js";
4
4
  import {
5
5
  prepareAndPersistMessage,
6
6
  uiAskChoiceFunc,
7
7
  uiAskChoiceFunctionSchema
8
- } from "./chunk-SO7B7NW3.js";
8
+ } from "./chunk-BHXK3KPV.js";
9
9
  import {
10
10
  require_date_fns
11
11
  } from "./chunk-M76ECQRD.js";
12
12
  import {
13
13
  TOOL_PACKS
14
- } from "./chunk-MYU3MJCF.js";
14
+ } from "./chunk-GCJ3IS5M.js";
15
15
  import {
16
16
  buildSkillDocMarkdown
17
17
  } from "./chunk-AETZ7AD6.js";
@@ -9,6 +9,9 @@ import {
9
9
  streamSseDataValues,
10
10
  throwIfChatCompletionStreamFailed
11
11
  } from "./chunk-QC5LGHYP.js";
12
+ import {
13
+ DEVIN_CONNECT_URL
14
+ } from "./chunk-FMODTASJ.js";
12
15
  import {
13
16
  clipToolText,
14
17
  hasImageInRuntimeMessages,
@@ -15574,7 +15577,6 @@ var DEFAULT_LOCAL_TOOLS = /* @__PURE__ */ new Set([
15574
15577
  "taskWait",
15575
15578
  "taskLogs",
15576
15579
  "taskStop",
15577
- "tasks",
15578
15580
  // Scheduling tools: forking/observing sub-agents is a declared capability
15579
15581
  // of capable agents, and the blast radius is strictly narrower than
15580
15582
  // execShell (already default-enabled). Requiring an env allowlist for these
@@ -17573,7 +17575,6 @@ var WORKSPACE_TOOL_NAMES = [
17573
17575
  "taskWait",
17574
17576
  "taskLogs",
17575
17577
  "taskStop",
17576
- "tasks",
17577
17578
  "openDesktopPreview"
17578
17579
  ];
17579
17580
  var SHELL_TOOL_NAMES = [
@@ -17582,8 +17583,7 @@ var SHELL_TOOL_NAMES = [
17582
17583
  "listProcesses",
17583
17584
  "taskWait",
17584
17585
  "taskLogs",
17585
- "taskStop",
17586
- "tasks"
17586
+ "taskStop"
17587
17587
  ];
17588
17588
  var WORKSPACE_TOOL_NAME_SET = new Set(WORKSPACE_TOOL_NAMES);
17589
17589
  function buildWorkspacePathProperty() {
@@ -17895,19 +17895,6 @@ function buildTaskStopTool() {
17895
17895
  }
17896
17896
  };
17897
17897
  }
17898
- function buildTasksTool() {
17899
- return {
17900
- type: "function",
17901
- function: {
17902
- name: "tasks",
17903
- description: "List background tasks you can still wait on, read logs from, or stop. Returns {count, tasks: {taskId, pid, label, status, startedAt, persist}[]}. Use it to recover a taskId you lost track of; foreground commands still running inside execShell are not listed.",
17904
- parameters: {
17905
- type: "object",
17906
- properties: {}
17907
- }
17908
- }
17909
- };
17910
- }
17911
17898
  function buildWorkspaceToolDefinition(toolName) {
17912
17899
  if (toolName === "readFile") {
17913
17900
  return buildReadWorkspaceFileTool();
@@ -17929,7 +17916,6 @@ function buildWorkspaceToolDefinition(toolName) {
17929
17916
  if (toolName === "taskWait") return buildTaskWaitTool();
17930
17917
  if (toolName === "taskLogs") return buildTaskLogsTool();
17931
17918
  if (toolName === "taskStop") return buildTaskStopTool();
17932
- if (toolName === "tasks") return buildTasksTool();
17933
17919
  return null;
17934
17920
  }
17935
17921
  function filterDeclaredWorkspaceToolNames(args2) {
@@ -19395,7 +19381,7 @@ function buildLoadSkillExecutor(args2) {
19395
19381
  const { resolveSkillByName } = await import("./skillDiscovery-CYUCJMAG.js");
19396
19382
  const resolved = resolveSkillByName(args2.cwd, name);
19397
19383
  if (!resolved) {
19398
- const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-E6KSDNSJ.js");
19384
+ const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-7S6523WH.js");
19399
19385
  const builtinSlug = resolveCodingBuiltinSlug(name);
19400
19386
  if (builtinSlug) {
19401
19387
  const body = buildCodingSkillContentBySlug(builtinSlug);
@@ -20174,6 +20160,287 @@ async function fetchAntigravityCloudCodeCompletion(args2) {
20174
20160
  return normalized;
20175
20161
  }
20176
20162
 
20163
+ // packages/agent-runtime/devin/devinProvider.ts
20164
+ import { randomBytes, randomUUID as randomUUID2 } from "node:crypto";
20165
+ var CLIENT_NAME = "chisel";
20166
+ var CLIENT_VERSION = "2026.8.18";
20167
+ function writeVarint(fieldNum, value) {
20168
+ const tag = fieldNum << 3 | 0;
20169
+ const bytes = [];
20170
+ let t = tag;
20171
+ while (t >= 128) {
20172
+ bytes.push(t & 127 | 128);
20173
+ t >>>= 7;
20174
+ }
20175
+ bytes.push(t);
20176
+ let v = value;
20177
+ while (v >= 128) {
20178
+ bytes.push(v & 127 | 128);
20179
+ v >>>= 7;
20180
+ }
20181
+ bytes.push(v);
20182
+ return Buffer.from(bytes);
20183
+ }
20184
+ function writeLengthDelimited(fieldNum, content) {
20185
+ const tag = fieldNum << 3 | 2;
20186
+ const tagBytes = [];
20187
+ let t = tag;
20188
+ while (t >= 128) {
20189
+ tagBytes.push(t & 127 | 128);
20190
+ t >>>= 7;
20191
+ }
20192
+ tagBytes.push(t);
20193
+ const lenBytes = [];
20194
+ let len = content.length;
20195
+ while (len >= 128) {
20196
+ lenBytes.push(len & 127 | 128);
20197
+ len >>>= 7;
20198
+ }
20199
+ lenBytes.push(len);
20200
+ return Buffer.concat([Buffer.from(tagBytes), Buffer.from(lenBytes), content]);
20201
+ }
20202
+ function writeStringField(fieldNum, str) {
20203
+ return writeLengthDelimited(fieldNum, Buffer.from(str, "utf8"));
20204
+ }
20205
+ function writeMessageField(fieldNum, message) {
20206
+ return writeLengthDelimited(fieldNum, message);
20207
+ }
20208
+ function generateFingerprint() {
20209
+ return randomBytes(366).toString("hex");
20210
+ }
20211
+ function encodeDevinClientMetadata(token) {
20212
+ return Buffer.concat([
20213
+ writeStringField(1, CLIENT_NAME),
20214
+ writeStringField(2, CLIENT_VERSION),
20215
+ writeStringField(3, token),
20216
+ writeStringField(4, "en"),
20217
+ writeStringField(5, process.platform === "win32" ? "windows" : "linux"),
20218
+ writeStringField(7, CLIENT_VERSION),
20219
+ writeStringField(12, CLIENT_NAME),
20220
+ writeStringField(31, generateFingerprint())
20221
+ ]);
20222
+ }
20223
+ function encodeDevinChatMessage(msg) {
20224
+ const source = msg.role === "assistant" ? 2 : 1;
20225
+ return Buffer.concat([
20226
+ writeStringField(1, randomUUID2()),
20227
+ writeVarint(2, source),
20228
+ writeStringField(3, msg.text)
20229
+ ]);
20230
+ }
20231
+ function writeFixed64Field(fieldNum, val) {
20232
+ const b = Buffer.alloc(8);
20233
+ b.writeDoubleLE(val, 0);
20234
+ const tag = fieldNum << 3 | 1;
20235
+ const tagBytes = [];
20236
+ let t = tag;
20237
+ while (t >= 128) {
20238
+ tagBytes.push(t & 127 | 128);
20239
+ t >>>= 7;
20240
+ }
20241
+ tagBytes.push(t);
20242
+ return Buffer.concat([Buffer.from(tagBytes), b]);
20243
+ }
20244
+ function buildCompletionConfig(params) {
20245
+ const maxTokens = params?.maxTokens ?? 4096;
20246
+ const temp = params?.temperature ?? 0.4;
20247
+ const topP = params?.topP ?? 0.95;
20248
+ return Buffer.concat([
20249
+ writeVarint(1, 1),
20250
+ writeVarint(2, maxTokens),
20251
+ writeVarint(3, 128e3),
20252
+ writeFixed64Field(5, temp),
20253
+ writeVarint(7, 40),
20254
+ writeFixed64Field(8, topP)
20255
+ ]);
20256
+ }
20257
+ function buildGetChatMessageRequest(params) {
20258
+ const { token, messages, model } = params;
20259
+ const metadata = encodeDevinClientMetadata(token);
20260
+ let systemPrompt = "";
20261
+ const filteredMessages = [];
20262
+ for (const m of messages) {
20263
+ const text = typeof m.content === "string" ? m.content : Array.isArray(m.content) ? m.content.filter((p) => p?.type === "text").map((p) => p.text).join("\n") : "";
20264
+ if (m.role === "system") {
20265
+ systemPrompt = systemPrompt ? `${systemPrompt}
20266
+
20267
+ ${text}` : text;
20268
+ } else if (m.role === "user" || m.role === "assistant") {
20269
+ filteredMessages.push({ role: m.role, text });
20270
+ }
20271
+ }
20272
+ const coalesced = [];
20273
+ for (const item of filteredMessages) {
20274
+ const last = coalesced[coalesced.length - 1];
20275
+ if (last && last.role === item.role) {
20276
+ last.text = `${last.text}
20277
+
20278
+ ${item.text}`;
20279
+ } else {
20280
+ coalesced.push({ ...item });
20281
+ }
20282
+ }
20283
+ const chatMessageBuffers = coalesced.map((m) => encodeDevinChatMessage(m));
20284
+ const completionConfig = buildCompletionConfig();
20285
+ const modelConfig = Buffer.concat([
20286
+ writeStringField(1, randomUUID2()),
20287
+ writeVarint(2, 1),
20288
+ writeVarint(3, 4)
20289
+ ]);
20290
+ return Buffer.concat([
20291
+ writeMessageField(1, metadata),
20292
+ writeStringField(2, systemPrompt),
20293
+ ...chatMessageBuffers.map((b) => writeMessageField(3, b)),
20294
+ writeVarint(7, 5),
20295
+ writeMessageField(8, completionConfig),
20296
+ writeMessageField(15, modelConfig),
20297
+ writeStringField(16, randomUUID2()),
20298
+ writeVarint(20, 1),
20299
+ writeStringField(21, model)
20300
+ ]);
20301
+ }
20302
+ function buildDevinConnectFrame(payload, flags = 0) {
20303
+ const header = Buffer.alloc(5);
20304
+ header[0] = flags & 255;
20305
+ header.writeUInt32BE(payload.length, 1);
20306
+ return Buffer.concat([header, payload]);
20307
+ }
20308
+ function parseDevinConnectFrames(buffer3) {
20309
+ const frames = [];
20310
+ let offset = 0;
20311
+ while (offset + 5 <= buffer3.length) {
20312
+ const flags = buffer3[offset];
20313
+ const length = buffer3.readUInt32BE(offset + 1);
20314
+ if (offset + 5 + length > buffer3.length) {
20315
+ break;
20316
+ }
20317
+ const payload = buffer3.subarray(offset + 5, offset + 5 + length);
20318
+ frames.push({ flags, payload });
20319
+ offset += 5 + length;
20320
+ }
20321
+ return {
20322
+ frames,
20323
+ remainder: buffer3.subarray(offset)
20324
+ };
20325
+ }
20326
+ function decodeDevinResponsePayload(payload) {
20327
+ let offset = 0;
20328
+ let content = "";
20329
+ let reasoning = "";
20330
+ let finishReason = null;
20331
+ while (offset < payload.length) {
20332
+ let tag = 0;
20333
+ let shift = 0;
20334
+ while (offset < payload.length) {
20335
+ const b = payload[offset++];
20336
+ tag |= (b & 127) << shift;
20337
+ if (!(b & 128)) break;
20338
+ shift += 7;
20339
+ }
20340
+ const fieldNum = tag >>> 3;
20341
+ const wireType = tag & 7;
20342
+ if (wireType === 0) {
20343
+ let val = 0;
20344
+ let s = 0;
20345
+ while (offset < payload.length) {
20346
+ const b = payload[offset++];
20347
+ val |= (b & 127) << s;
20348
+ if (!(b & 128)) break;
20349
+ s += 7;
20350
+ }
20351
+ if (fieldNum === 5) {
20352
+ finishReason = val === 2 ? "stop" : "length";
20353
+ }
20354
+ } else if (wireType === 2) {
20355
+ let len = 0;
20356
+ let s = 0;
20357
+ while (offset < payload.length) {
20358
+ const b = payload[offset++];
20359
+ len |= (b & 127) << s;
20360
+ if (!(b & 128)) break;
20361
+ s += 7;
20362
+ }
20363
+ const valBytes = payload.subarray(offset, offset + len);
20364
+ offset += len;
20365
+ if (fieldNum === 3) {
20366
+ content += valBytes.toString("utf8");
20367
+ } else if (fieldNum === 9) {
20368
+ reasoning += valBytes.toString("utf8");
20369
+ }
20370
+ } else {
20371
+ break;
20372
+ }
20373
+ }
20374
+ return { content, reasoning, finishReason };
20375
+ }
20376
+ function createDevinProvider(options) {
20377
+ const { token, model = "swe-2", fetchImpl = fetch } = options;
20378
+ return {
20379
+ model,
20380
+ async complete(messages, opts) {
20381
+ const selectedModel = model;
20382
+ const requestPayload = buildGetChatMessageRequest({
20383
+ token,
20384
+ messages,
20385
+ model: selectedModel
20386
+ });
20387
+ const frame = buildDevinConnectFrame(requestPayload);
20388
+ const response = await fetchImpl(DEVIN_CONNECT_URL, {
20389
+ method: "POST",
20390
+ headers: {
20391
+ "authorization": `Basic ${token}-${token}`,
20392
+ "content-type": "application/connect+proto",
20393
+ "connect-protocol-version": "1"
20394
+ },
20395
+ body: new Uint8Array(frame),
20396
+ signal: opts?.signal
20397
+ });
20398
+ if (!response.ok) {
20399
+ const errText = await response.text().catch(() => "");
20400
+ throw new Error(
20401
+ `Devin Connect upstream returned error ${response.status}: ${errText}`
20402
+ );
20403
+ }
20404
+ if (!response.body) {
20405
+ throw new Error("Devin Connect response body is null");
20406
+ }
20407
+ let text = "";
20408
+ let reasoning = "";
20409
+ let buffer3 = Buffer.alloc(0);
20410
+ const reader = response.body.getReader();
20411
+ try {
20412
+ while (true) {
20413
+ const { done: done4, value } = await reader.read();
20414
+ if (done4) break;
20415
+ buffer3 = Buffer.concat([buffer3, Buffer.from(value)]);
20416
+ const { frames, remainder } = parseDevinConnectFrames(buffer3);
20417
+ buffer3 = Buffer.from(remainder);
20418
+ for (const f of frames) {
20419
+ if (f.flags & 2) continue;
20420
+ const delta = decodeDevinResponsePayload(f.payload);
20421
+ if (delta.reasoning) {
20422
+ reasoning += delta.reasoning;
20423
+ opts?.onReasoningDelta?.(delta.reasoning);
20424
+ }
20425
+ if (delta.content) {
20426
+ text += delta.content;
20427
+ opts?.onTextDelta?.(delta.content);
20428
+ }
20429
+ }
20430
+ }
20431
+ } finally {
20432
+ reader.releaseLock();
20433
+ }
20434
+ return {
20435
+ content: text,
20436
+ model: selectedModel,
20437
+ provider: "devin",
20438
+ reasoning_content: reasoning || void 0
20439
+ };
20440
+ }
20441
+ };
20442
+ }
20443
+
20177
20444
  export {
20178
20445
  Option_exports,
20179
20446
  Duration_exports,
@@ -20226,5 +20493,6 @@ export {
20226
20493
  shouldUseGeminiNativeToolRoute,
20227
20494
  buildGeminiGenerateContentRequest,
20228
20495
  resolveAntigravityFinishReason,
20229
- fetchAntigravityCloudCodeCompletion
20496
+ fetchAntigravityCloudCodeCompletion,
20497
+ createDevinProvider
20230
20498
  };
@@ -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
+ };
@@ -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
  // 「代码执行」能力包走。
@@ -326,7 +326,7 @@ async function saveDocState(arg, { dispatch, getState }) {
326
326
  ).unwrap();
327
327
  if (dbSpaceId) {
328
328
  try {
329
- const { updateContentTitle } = await import("./contentThunks-ENAVF2YU.js");
329
+ const { updateContentTitle } = await import("./contentThunks-A2ZG3SW6.js");
330
330
  await dispatch(
331
331
  updateContentTitle({
332
332
  spaceId: dbSpaceId,
@@ -365,7 +365,7 @@ async function saveDocState(arg, { dispatch, getState }) {
365
365
  }
366
366
  }
367
367
  async function createDocState(args, thunkApi) {
368
- const { createPageAction } = await import("./createPageAction-J6AEMLHK.js");
368
+ const { createPageAction } = await import("./createPageAction-XN237WPJ.js");
369
369
  return createPageAction(args, thunkApi);
370
370
  }
371
371
  function subscribe(listener) {
@@ -5,14 +5,14 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-3W2JJOH3.js";
8
+ } from "./chunk-N5KGQ5AD.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-EM6MPSEI.js";
15
+ } from "./chunk-LKSDMMY2.js";
16
16
  import {
17
17
  createSSEParser,
18
18
  createToolRunId,
@@ -23,7 +23,7 @@ import {
23
23
  toolRunSetPending,
24
24
  toolRunStarted,
25
25
  toolRunSucceeded
26
- } from "./chunk-YSKEOTPH.js";
26
+ } from "./chunk-5Q5LYRJH.js";
27
27
  import {
28
28
  getPublicImageAgentMode
29
29
  } from "./chunk-VIDPVFP3.js";
@@ -35,10 +35,10 @@ import {
35
35
  messageStreamEnd,
36
36
  messageStreaming,
37
37
  updateToolMessage
38
- } from "./chunk-SO7B7NW3.js";
38
+ } from "./chunk-BHXK3KPV.js";
39
39
  import {
40
40
  streamAgentChatTurn
41
- } from "./chunk-Q46HQOW3.js";
41
+ } from "./chunk-6RUOYAPM.js";
42
42
  import {
43
43
  addActiveController,
44
44
  removeActiveController,