nolo-cli 0.82.0-alpha.6 → 0.83.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_executeModel-225YRU52.js → _executeModel-TRYFRXDJ.js} +12 -12
- package/{agentDeleteCommand-ZJNQGVR2.js → agentDeleteCommand-YZ74ZWP5.js} +2 -1
- package/{agentEmailCommands-VLVWFWX2.js → agentEmailCommands-RMTYKFBY.js} +13 -12
- package/{agentListCommands-GHQGLAUU.js → agentListCommands-5WZ7MGH4.js} +2 -1
- package/{agentMachineCommands-QDXYENZJ.js → agentMachineCommands-U7QFPT5D.js} +3 -2
- package/{agentRecordCommands-AQFYM5HS.js → agentRecordCommands-RJRU2YVT.js} +13 -12
- package/{agentRunCommand-YSCD65HH.js → agentRunCommand-ZXEAWYLV.js} +13 -12
- package/{agentRuntimeLocal-ZOHB7OOO.js → agentRuntimeLocal-PQEIUOJU.js} +2 -1
- package/{agentSlice-O2SBU5TK.js → agentSlice-Q5XOM2PN.js} +1 -1
- package/{appDeleteCommands-PRT6K5N2.js → appDeleteCommands-UVLHOLVH.js} +2 -1
- package/{appDeployCommands-63ZONFAN.js → appDeployCommands-NTKUPWIJ.js} +2 -1
- package/{appDeployStatusCommands-AFAYCVR3.js → appDeployStatusCommands-SXJHAM6D.js} +2 -1
- package/{appGetCommands-TNZDZE36.js → appGetCommands-MAV3RF4X.js} +2 -1
- package/{appListCommands-IA4SPG2X.js → appListCommands-7HWANPQU.js} +2 -1
- package/{authCommand-EVGFLAHO.js → authCommand-7N2G6MXP.js} +78 -3
- package/{chatQueueReduxAdapter-4SM3DAWX.js → chatQueueReduxAdapter-WICMMQZT.js} +2 -2
- package/{chunk-HHLTFENG.js → chunk-2OVE3GVB.js} +327 -20
- package/{chunk-LSZXYE64.js → chunk-3447FUKM.js} +45 -7
- package/{chunk-NJ6WLAPS.js → chunk-5BVAAVIF.js} +1 -1
- package/{chunk-73IOJLK2.js → chunk-5G3IP3R6.js} +3 -3
- package/{chunk-YSKEOTPH.js → chunk-5Q5LYRJH.js} +10 -10
- package/{chunk-Q46HQOW3.js → chunk-6RUOYAPM.js} +3 -3
- package/{chunk-SO7B7NW3.js → chunk-BHXK3KPV.js} +8 -8
- package/{chunk-6SD5OPQ4.js → chunk-BNQK6UPC.js} +3 -3
- package/{chunk-YXLXHIT2.js → chunk-EH7BNTCR.js} +1 -1
- package/chunk-FMODTASJ.js +109 -0
- package/{chunk-MYU3MJCF.js → chunk-GCJ3IS5M.js} +0 -1
- package/{chunk-FP27MNSX.js → chunk-JPVNC5B2.js} +2 -2
- package/{chunk-4UW2LDVA.js → chunk-JZYXSXMZ.js} +5 -5
- package/{chunk-EM6MPSEI.js → chunk-LKSDMMY2.js} +16 -4
- package/{chunk-A3NNC2LA.js → chunk-LLJM5TW2.js} +6 -6
- package/{chunk-5LSS6MFZ.js → chunk-LZIMZZYT.js} +1 -1
- package/{chunk-3W2JJOH3.js → chunk-N5KGQ5AD.js} +2 -2
- package/{chunk-3IT2PFHL.js → chunk-NB5SIWC4.js} +1 -1
- package/{codingSkills-E6KSDNSJ.js → codingSkills-7S6523WH.js} +2 -2
- package/{contentThunks-ENAVF2YU.js → contentThunks-A2ZG3SW6.js} +3 -3
- package/{createAgentAutomationAction-CH6BYC7K.js → createAgentAutomationAction-QFQQPG35.js} +3 -3
- package/{createDialogAction-23UDOXSO.js → createDialogAction-WI73R5EQ.js} +5 -5
- package/{createPageAction-J6AEMLHK.js → createPageAction-XN237WPJ.js} +3 -3
- package/{dialogCommands-BJJGCCQR.js → dialogCommands-LWKIIWKC.js} +2 -1
- package/{dialogSlice-F7RD6PUY.js → dialogSlice-56G4Q4RU.js} +2 -2
- package/{docCreateCommands-53GB2FU3.js → docCreateCommands-FC5IRW2I.js} +2 -1
- package/{docDeleteCommands-TAW5JEBU.js → docDeleteCommands-GUGLMPIP.js} +2 -1
- package/{docReadCommands-F5N7N5E3.js → docReadCommands-JVMVMNQZ.js} +2 -1
- package/{docStore-WX4YBGXC.js → docStore-PZSZWXX3.js} +1 -1
- package/{docUpdateCommands-YQ7TRT35.js → docUpdateCommands-XZRIQPK4.js} +2 -1
- package/{handleSendMessageAction-CW4LULIR.js → handleSendMessageAction-MHKC4R3Q.js} +2 -2
- package/index.js +50 -46
- package/{machineCommands-FIYWY5EU.js → machineCommands-KSTY7PYK.js} +13 -12
- package/{machineWsRunDispatch-KQ4OFFNR.js → machineWsRunDispatch-MG6KR26V.js} +13 -12
- package/package.json +1 -1
- package/{readlineWorkspace-QYI6BRNA.js → readlineWorkspace-FG4NFANI.js} +13 -12
- package/{runAgentClientLoop-GZ5VUGAW.js → runAgentClientLoop-U3GEPCQI.js} +10 -10
- package/{spaceCommands-IYMIXCMC.js → spaceCommands-CB6SU7KK.js} +2 -1
- package/{streamAgentChatTurn-EAXIUJTK.js → streamAgentChatTurn-DAGDJH3L.js} +11 -11
- package/{tools-QWQOW6J4.js → tools-73VPBNX3.js} +8 -8
- package/{updateDialogTitleAction-2HCE2M7S.js → updateDialogTitleAction-RFQONESQ.js} +3 -3
|
@@ -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-
|
|
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,326 @@ 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 parseDevinConnectTrailer(payload) {
|
|
20327
|
+
const text = payload.toString("utf8").trim();
|
|
20328
|
+
if (!text || text === "{}") return null;
|
|
20329
|
+
try {
|
|
20330
|
+
const parsed = JSON.parse(text);
|
|
20331
|
+
if (!parsed.error) {
|
|
20332
|
+
return new Error(`Devin Connect invalid terminal trailer: ${text}`);
|
|
20333
|
+
}
|
|
20334
|
+
const code = typeof parsed.error.code === "string" ? parsed.error.code : "unknown";
|
|
20335
|
+
const message = typeof parsed.error.message === "string" ? parsed.error.message : "Unknown error";
|
|
20336
|
+
return new Error(`Devin Connect upstream error ${code}: ${message}`);
|
|
20337
|
+
} catch {
|
|
20338
|
+
return new Error(`Devin Connect invalid terminal trailer: ${text}`);
|
|
20339
|
+
}
|
|
20340
|
+
}
|
|
20341
|
+
function decodeDevinResponsePayload(payload) {
|
|
20342
|
+
let offset = 0;
|
|
20343
|
+
let content = "";
|
|
20344
|
+
let reasoning = "";
|
|
20345
|
+
let finishReason = null;
|
|
20346
|
+
const events = [];
|
|
20347
|
+
while (offset < payload.length) {
|
|
20348
|
+
let tag = 0;
|
|
20349
|
+
let shift = 0;
|
|
20350
|
+
while (offset < payload.length) {
|
|
20351
|
+
const b = payload[offset++];
|
|
20352
|
+
tag |= (b & 127) << shift;
|
|
20353
|
+
if (!(b & 128)) break;
|
|
20354
|
+
shift += 7;
|
|
20355
|
+
}
|
|
20356
|
+
const fieldNum = tag >>> 3;
|
|
20357
|
+
const wireType = tag & 7;
|
|
20358
|
+
if (wireType === 0) {
|
|
20359
|
+
let val = 0;
|
|
20360
|
+
let s = 0;
|
|
20361
|
+
while (offset < payload.length) {
|
|
20362
|
+
const b = payload[offset++];
|
|
20363
|
+
val |= (b & 127) << s;
|
|
20364
|
+
if (!(b & 128)) break;
|
|
20365
|
+
s += 7;
|
|
20366
|
+
}
|
|
20367
|
+
if (fieldNum === 5) {
|
|
20368
|
+
finishReason = val === 2 ? "stop" : "length";
|
|
20369
|
+
}
|
|
20370
|
+
} else if (wireType === 2) {
|
|
20371
|
+
let len = 0;
|
|
20372
|
+
let s = 0;
|
|
20373
|
+
while (offset < payload.length) {
|
|
20374
|
+
const b = payload[offset++];
|
|
20375
|
+
len |= (b & 127) << s;
|
|
20376
|
+
if (!(b & 128)) break;
|
|
20377
|
+
s += 7;
|
|
20378
|
+
}
|
|
20379
|
+
const valBytes = payload.subarray(offset, offset + len);
|
|
20380
|
+
offset += len;
|
|
20381
|
+
if (fieldNum === 3) {
|
|
20382
|
+
const text = valBytes.toString("utf8");
|
|
20383
|
+
content += text;
|
|
20384
|
+
events.push({ type: "content", text });
|
|
20385
|
+
} else if (fieldNum === 9) {
|
|
20386
|
+
const text = valBytes.toString("utf8");
|
|
20387
|
+
reasoning += text;
|
|
20388
|
+
events.push({ type: "reasoning", text });
|
|
20389
|
+
}
|
|
20390
|
+
} else {
|
|
20391
|
+
break;
|
|
20392
|
+
}
|
|
20393
|
+
}
|
|
20394
|
+
return { content, reasoning, finishReason, events };
|
|
20395
|
+
}
|
|
20396
|
+
function createDevinProvider(options) {
|
|
20397
|
+
const { token, model = "swe-2", fetchImpl = fetch } = options;
|
|
20398
|
+
return {
|
|
20399
|
+
model,
|
|
20400
|
+
async complete(messages, opts) {
|
|
20401
|
+
const selectedModel = model;
|
|
20402
|
+
const requestPayload = buildGetChatMessageRequest({
|
|
20403
|
+
token,
|
|
20404
|
+
messages,
|
|
20405
|
+
model: selectedModel
|
|
20406
|
+
});
|
|
20407
|
+
const frame = buildDevinConnectFrame(requestPayload);
|
|
20408
|
+
const response = await fetchImpl(DEVIN_CONNECT_URL, {
|
|
20409
|
+
method: "POST",
|
|
20410
|
+
headers: {
|
|
20411
|
+
"authorization": `Basic ${token}-${token}`,
|
|
20412
|
+
"content-type": "application/connect+proto",
|
|
20413
|
+
"connect-protocol-version": "1"
|
|
20414
|
+
},
|
|
20415
|
+
body: new Uint8Array(frame),
|
|
20416
|
+
signal: opts?.signal
|
|
20417
|
+
});
|
|
20418
|
+
if (!response.ok) {
|
|
20419
|
+
const errText = await response.text().catch(() => "");
|
|
20420
|
+
throw new Error(
|
|
20421
|
+
`Devin Connect upstream returned error ${response.status}: ${errText}`
|
|
20422
|
+
);
|
|
20423
|
+
}
|
|
20424
|
+
if (!response.body) {
|
|
20425
|
+
throw new Error("Devin Connect response body is null");
|
|
20426
|
+
}
|
|
20427
|
+
let text = "";
|
|
20428
|
+
let reasoning = "";
|
|
20429
|
+
let buffer3 = Buffer.alloc(0);
|
|
20430
|
+
let sawTrailer = false;
|
|
20431
|
+
const reader = response.body.getReader();
|
|
20432
|
+
try {
|
|
20433
|
+
while (true) {
|
|
20434
|
+
const { done: done4, value } = await reader.read();
|
|
20435
|
+
if (done4) break;
|
|
20436
|
+
buffer3 = Buffer.concat([buffer3, Buffer.from(value)]);
|
|
20437
|
+
const { frames, remainder } = parseDevinConnectFrames(buffer3);
|
|
20438
|
+
buffer3 = Buffer.from(remainder);
|
|
20439
|
+
for (const f of frames) {
|
|
20440
|
+
if (sawTrailer) {
|
|
20441
|
+
throw new Error("Devin Connect received a frame after the terminal trailer");
|
|
20442
|
+
}
|
|
20443
|
+
if (f.flags & 2) {
|
|
20444
|
+
sawTrailer = true;
|
|
20445
|
+
const trailerError = parseDevinConnectTrailer(f.payload);
|
|
20446
|
+
if (trailerError) throw trailerError;
|
|
20447
|
+
continue;
|
|
20448
|
+
}
|
|
20449
|
+
const delta = decodeDevinResponsePayload(f.payload);
|
|
20450
|
+
text += delta.content;
|
|
20451
|
+
reasoning += delta.reasoning;
|
|
20452
|
+
for (const event of delta.events) {
|
|
20453
|
+
if (event.type === "reasoning") {
|
|
20454
|
+
opts?.onReasoningDelta?.(event.text);
|
|
20455
|
+
} else {
|
|
20456
|
+
opts?.onTextDelta?.(event.text);
|
|
20457
|
+
}
|
|
20458
|
+
}
|
|
20459
|
+
}
|
|
20460
|
+
}
|
|
20461
|
+
} finally {
|
|
20462
|
+
reader.releaseLock();
|
|
20463
|
+
}
|
|
20464
|
+
if (buffer3.length > 0) {
|
|
20465
|
+
throw new Error("Devin Connect upstream ended with an incomplete frame");
|
|
20466
|
+
}
|
|
20467
|
+
if (!sawTrailer) {
|
|
20468
|
+
throw new Error("Devin Connect upstream ended before the terminal trailer");
|
|
20469
|
+
}
|
|
20470
|
+
if (!text && !reasoning) {
|
|
20471
|
+
throw new Error("Devin Connect upstream completed without content");
|
|
20472
|
+
}
|
|
20473
|
+
return {
|
|
20474
|
+
content: text,
|
|
20475
|
+
model: selectedModel,
|
|
20476
|
+
provider: "devin",
|
|
20477
|
+
reasoning_content: reasoning || void 0
|
|
20478
|
+
};
|
|
20479
|
+
}
|
|
20480
|
+
};
|
|
20481
|
+
}
|
|
20482
|
+
|
|
20177
20483
|
export {
|
|
20178
20484
|
Option_exports,
|
|
20179
20485
|
Duration_exports,
|
|
@@ -20226,5 +20532,6 @@ export {
|
|
|
20226
20532
|
shouldUseGeminiNativeToolRoute,
|
|
20227
20533
|
buildGeminiGenerateContentRequest,
|
|
20228
20534
|
resolveAntigravityFinishReason,
|
|
20229
|
-
fetchAntigravityCloudCodeCompletion
|
|
20535
|
+
fetchAntigravityCloudCodeCompletion,
|
|
20536
|
+
createDevinProvider
|
|
20230
20537
|
};
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
import {
|
|
61
61
|
inlineImageUrlsForCustomProvider,
|
|
62
62
|
prepareTools
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-N5KGQ5AD.js";
|
|
64
64
|
import {
|
|
65
65
|
getServerProviderSecret
|
|
66
66
|
} from "./chunk-HS7MLR74.js";
|
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
rememberMemoryFunctionSchema,
|
|
79
79
|
resolveAgentRequiredPackIds,
|
|
80
80
|
setTodoListFunc
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-5Q5LYRJH.js";
|
|
82
82
|
import {
|
|
83
83
|
fetchWithTransientRetry,
|
|
84
84
|
isTransientFetchError
|
|
@@ -101,13 +101,13 @@ import {
|
|
|
101
101
|
prepareTokenUsageData,
|
|
102
102
|
resolveBuiltinPlatformAgentConfig,
|
|
103
103
|
runKeyed
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-BHXK3KPV.js";
|
|
105
105
|
import {
|
|
106
106
|
BUILTIN_TITLE_LLM_CONFIG
|
|
107
107
|
} from "./chunk-EVBFYPDC.js";
|
|
108
108
|
import {
|
|
109
109
|
fetchServerSyncedCredential
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-6RUOYAPM.js";
|
|
111
111
|
import {
|
|
112
112
|
require_date_fns
|
|
113
113
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
applySystemBuiltinSkillFilter,
|
|
124
124
|
expandEnabledPacks,
|
|
125
125
|
resolveEffectiveEnabledPacks
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-GCJ3IS5M.js";
|
|
127
127
|
import {
|
|
128
128
|
DEFAULT_HYBRID_READ_TIMEOUT_MS,
|
|
129
129
|
Duration_exports,
|
|
@@ -139,6 +139,7 @@ import {
|
|
|
139
139
|
buildLocalWorkspaceToolset,
|
|
140
140
|
buildNoloWorkspaceCliToolExecutors,
|
|
141
141
|
codexStreamFailureStatus,
|
|
142
|
+
createDevinProvider,
|
|
142
143
|
createHybridRecordStore,
|
|
143
144
|
createLocalWorkspaceToolExecutors,
|
|
144
145
|
evaluateFileWritePolicy,
|
|
@@ -159,7 +160,7 @@ import {
|
|
|
159
160
|
resolveOpenAiCompatibleProviderConfig,
|
|
160
161
|
shouldUseGeminiNativeToolRoute,
|
|
161
162
|
summarizeToolArguments
|
|
162
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-2OVE3GVB.js";
|
|
163
164
|
import {
|
|
164
165
|
PlatformStreamInterruptedError,
|
|
165
166
|
buildPlatformChatCompletionRequest,
|
|
@@ -172,6 +173,9 @@ import {
|
|
|
172
173
|
resolvePlatformChatProviderConfig,
|
|
173
174
|
shouldUsePlatformChatProvider
|
|
174
175
|
} from "./chunk-QC5LGHYP.js";
|
|
176
|
+
import {
|
|
177
|
+
isDevinOAuthAgent
|
|
178
|
+
} from "./chunk-FMODTASJ.js";
|
|
175
179
|
import {
|
|
176
180
|
resolveAgentRuntimeConfigFromRecord,
|
|
177
181
|
resolveHistoricalToolContentCap
|
|
@@ -9311,6 +9315,39 @@ var resolveCursorTransport = async (ctx) => {
|
|
|
9311
9315
|
return null;
|
|
9312
9316
|
};
|
|
9313
9317
|
|
|
9318
|
+
// packages/cli/client/providerResolution/devinTransport.ts
|
|
9319
|
+
var resolveDevinTransport = async (ctx) => {
|
|
9320
|
+
const { agentConfig, apiKeyRefResolver } = ctx;
|
|
9321
|
+
if (isDevinOAuthAgent(agentConfig)) {
|
|
9322
|
+
const accessToken = await apiKeyRefResolver("devin");
|
|
9323
|
+
if (!accessToken) {
|
|
9324
|
+
throw new Error(
|
|
9325
|
+
'OAuth credential for "devin" not found locally. Run `nolo auth devin`.'
|
|
9326
|
+
);
|
|
9327
|
+
}
|
|
9328
|
+
const model = agentConfig.model || "swe-2-max";
|
|
9329
|
+
logLocalRuntimeDiagnostic("provider.selected", {
|
|
9330
|
+
agentKey: agentConfig.key,
|
|
9331
|
+
transport: "devin-connect",
|
|
9332
|
+
provider: "devin",
|
|
9333
|
+
model,
|
|
9334
|
+
hasApiKey: true
|
|
9335
|
+
});
|
|
9336
|
+
const devinProvider = createDevinProvider({
|
|
9337
|
+
token: accessToken,
|
|
9338
|
+
model,
|
|
9339
|
+
fetchImpl: ctx.fetchImpl
|
|
9340
|
+
});
|
|
9341
|
+
return {
|
|
9342
|
+
model,
|
|
9343
|
+
complete: async (messages, options) => {
|
|
9344
|
+
return devinProvider.complete(messages, options);
|
|
9345
|
+
}
|
|
9346
|
+
};
|
|
9347
|
+
}
|
|
9348
|
+
return null;
|
|
9349
|
+
};
|
|
9350
|
+
|
|
9314
9351
|
// packages/cli/client/providerResolution/directOpenAiCompatibleTransport.ts
|
|
9315
9352
|
var resolveDirectOpenAiCompatibleTransport = async (ctx) => {
|
|
9316
9353
|
const { agentConfig, deps, fetchImpl, loopbackRequest, additionalToolNames, buildProviderOpenAiTools, recordLocalAvailability, apiKeyRefResolver, credentialBroker, syncFetcher, serverUrl, authToken } = ctx;
|
|
@@ -9704,6 +9741,7 @@ var TRANSPORTS = [
|
|
|
9704
9741
|
resolveAnthropicOAuthTransport,
|
|
9705
9742
|
resolveCodexOAuthTransport,
|
|
9706
9743
|
resolveCursorTransport,
|
|
9744
|
+
resolveDevinTransport,
|
|
9707
9745
|
resolveGeminiNativeToolTransport,
|
|
9708
9746
|
resolvePlatformProxyTransport,
|
|
9709
9747
|
// 兜底必须留在最后。
|
|
@@ -11679,7 +11717,7 @@ var REFRESH_BY_PROVIDER = {
|
|
|
11679
11717
|
cursor: cursorRefresh
|
|
11680
11718
|
};
|
|
11681
11719
|
function isOAuthProvider(value) {
|
|
11682
|
-
return value === "chatgpt" || value === "xai" || value === "antigravity" || value === "claude" || value === "cursor";
|
|
11720
|
+
return value === "chatgpt" || value === "xai" || value === "antigravity" || value === "claude" || value === "cursor" || value === "devin";
|
|
11683
11721
|
}
|
|
11684
11722
|
function createOAuthApiKeyRefResolver(options = {}) {
|
|
11685
11723
|
return async (ref, opts) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3447FUKM.js";
|
|
5
5
|
import {
|
|
6
6
|
clipMultilineText
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5Q5LYRJH.js";
|
|
8
8
|
import {
|
|
9
9
|
runLocalAgentTurn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2OVE3GVB.js";
|
|
11
11
|
import {
|
|
12
12
|
applyToolSurfaceConstraints
|
|
13
13
|
} from "./chunk-ZVN6I33J.js";
|
|
@@ -81,14 +81,14 @@ import {
|
|
|
81
81
|
} from "./chunk-VF4K2QE6.js";
|
|
82
82
|
import {
|
|
83
83
|
createDocState
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-JPVNC5B2.js";
|
|
85
85
|
import {
|
|
86
86
|
BUILTIN_OBJECT_SKILL_IDS,
|
|
87
87
|
buildBuiltinObjectSkillConfig,
|
|
88
88
|
buildBuiltinObjectSkillDbKey,
|
|
89
89
|
buildBuiltinObjectSkillPageContent,
|
|
90
90
|
createDialogAction
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-BNQK6UPC.js";
|
|
92
92
|
import {
|
|
93
93
|
DEFAULT_COLLAPSED_CATEGORIES,
|
|
94
94
|
addContentToSpace,
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
updateContentCategory,
|
|
107
107
|
updateContentTitle,
|
|
108
108
|
writeStoredCollapsedCategories
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-LZIMZZYT.js";
|
|
110
110
|
import {
|
|
111
111
|
getCurrentSpaceId,
|
|
112
112
|
getCurrentSpaceIdRaw,
|
|
@@ -128,14 +128,14 @@ import {
|
|
|
128
128
|
selectMsgById,
|
|
129
129
|
uiAskChoiceFunc,
|
|
130
130
|
uiAskChoiceFunctionSchema
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-BHXK3KPV.js";
|
|
132
132
|
import {
|
|
133
133
|
createAgent,
|
|
134
134
|
deleteServerSyncedCredential,
|
|
135
135
|
runLlm,
|
|
136
136
|
streamAgentChatTurn,
|
|
137
137
|
updateAgent
|
|
138
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-6RUOYAPM.js";
|
|
139
139
|
import {
|
|
140
140
|
getActiveDialogKey,
|
|
141
141
|
selectCurrentDialogKey,
|
|
@@ -150,10 +150,10 @@ import {
|
|
|
150
150
|
buildCodingSkillContentBySlug,
|
|
151
151
|
buildCodingSkillId,
|
|
152
152
|
buildCodingSkillPageKey
|
|
153
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-NB5SIWC4.js";
|
|
154
154
|
import {
|
|
155
155
|
CAPABILITY_PACKS
|
|
156
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-GCJ3IS5M.js";
|
|
157
157
|
import {
|
|
158
158
|
buildSkillDocMarkdown,
|
|
159
159
|
normalizeSkillModalities,
|
|
@@ -4672,7 +4672,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
4672
4672
|
const deletedDialogIds = [];
|
|
4673
4673
|
const deletedDialogKeys = [];
|
|
4674
4674
|
const failures = [];
|
|
4675
|
-
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-
|
|
4675
|
+
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-56G4Q4RU.js");
|
|
4676
4676
|
for (const target of targets) {
|
|
4677
4677
|
try {
|
|
4678
4678
|
await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
|
|
@@ -15546,7 +15546,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
15546
15546
|
if (!executionInput) {
|
|
15547
15547
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
15548
15548
|
}
|
|
15549
|
-
const { findToolExecutor: findToolExecutor2 } = await import("./tools-
|
|
15549
|
+
const { findToolExecutor: findToolExecutor2 } = await import("./tools-73VPBNX3.js");
|
|
15550
15550
|
const { executor } = findToolExecutor2(run.toolName);
|
|
15551
15551
|
toolRunStarted({
|
|
15552
15552
|
id: run.id,
|
|
@@ -18053,7 +18053,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
18053
18053
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
18054
18054
|
};
|
|
18055
18055
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
18056
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
18056
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-PZSZWXX3.js");
|
|
18057
18057
|
if (getDocState().pageKey === id) {
|
|
18058
18058
|
applyExternalDocUpdate({
|
|
18059
18059
|
slateData: finalSlateData,
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
344
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-DAGDJH3L.js");
|
|
345
345
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
346
346
|
}),
|
|
347
347
|
/**
|