@ycodium-ai/agent-grok 0.2.4343 → 0.2.4368
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/dist/index.js +200 -30
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var __export = (target, all) => {
|
|
|
8
8
|
import { definePlugin } from "@ycodium-ai/plugin-api";
|
|
9
9
|
|
|
10
10
|
// ../../packages/plugin-api/src/version.ts
|
|
11
|
-
var PLUGIN_API_VERSION =
|
|
11
|
+
var PLUGIN_API_VERSION = 112;
|
|
12
12
|
|
|
13
13
|
// src/index.ts
|
|
14
14
|
import {
|
|
@@ -479,9 +479,11 @@ var AcpExecutorRequestError = class extends AcpExecutorError {
|
|
|
479
479
|
}
|
|
480
480
|
};
|
|
481
481
|
var AcpConnectionClosedError = class extends Error {
|
|
482
|
+
reason;
|
|
482
483
|
constructor(message = "ACP connection closed", options) {
|
|
483
|
-
super(message, options);
|
|
484
|
+
super(message, options?.cause === void 0 ? void 0 : { cause: options.cause });
|
|
484
485
|
this.name = "AcpConnectionClosedError";
|
|
486
|
+
this.reason = options?.reason ?? "closed";
|
|
485
487
|
}
|
|
486
488
|
};
|
|
487
489
|
async function withStartupStderr(error62, stderrTail) {
|
|
@@ -491,9 +493,65 @@ async function withStartupStderr(error62, stderrTail) {
|
|
|
491
493
|
return new AcpConnectionClosedError(`${error62.message}
|
|
492
494
|
Agent stderr (last lines):
|
|
493
495
|
${tail}`, {
|
|
494
|
-
cause: error62
|
|
496
|
+
cause: error62,
|
|
497
|
+
reason: error62.reason
|
|
495
498
|
});
|
|
496
499
|
}
|
|
500
|
+
var AGENT_EXIT_STDERR_MAX_CHARS = 800;
|
|
501
|
+
var AGENT_EXIT_SETTLE_MS = 500;
|
|
502
|
+
var AcpAgentExitedError = class extends AcpConnectionClosedError {
|
|
503
|
+
exitCode;
|
|
504
|
+
constructor(message, exitCode, cause) {
|
|
505
|
+
super(message, { cause, reason: "input-ended" });
|
|
506
|
+
this.name = "AcpAgentExitedError";
|
|
507
|
+
this.exitCode = exitCode;
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
var REDACTION_MARKERS = ["[redacted]", "[pairing-url]"];
|
|
511
|
+
var lastLines = (text4, maxChars) => {
|
|
512
|
+
if (text4.length <= maxChars) return text4;
|
|
513
|
+
let start = text4.length - maxChars;
|
|
514
|
+
if (text4[start - 1] !== "\n") {
|
|
515
|
+
const lineEnd = text4.indexOf("\n", start);
|
|
516
|
+
if (lineEnd !== -1 && lineEnd < text4.length - 1) return text4.slice(lineEnd + 1);
|
|
517
|
+
const code = text4.charCodeAt(start);
|
|
518
|
+
if (code >= 56320 && code <= 57343) start += 1;
|
|
519
|
+
for (const marker of REDACTION_MARKERS) {
|
|
520
|
+
const at = text4.lastIndexOf(marker, start);
|
|
521
|
+
if (at !== -1 && at < start && start < at + marker.length) start = at + marker.length;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
return text4.slice(start);
|
|
525
|
+
};
|
|
526
|
+
var settledExitCode = async (exited) => {
|
|
527
|
+
if (exited === void 0) return void 0;
|
|
528
|
+
let timer;
|
|
529
|
+
try {
|
|
530
|
+
return await Promise.race([
|
|
531
|
+
exited.catch(() => void 0),
|
|
532
|
+
new Promise((resolve2) => {
|
|
533
|
+
timer = setTimeout(() => resolve2(void 0), AGENT_EXIT_SETTLE_MS);
|
|
534
|
+
})
|
|
535
|
+
]);
|
|
536
|
+
} finally {
|
|
537
|
+
clearTimeout(timer);
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
async function describeAgentExit(input2) {
|
|
541
|
+
const [exitCode, tail] = await Promise.all([
|
|
542
|
+
settledExitCode(input2.exited),
|
|
543
|
+
input2.stderrTail === void 0 ? "" : Promise.resolve().then(input2.stderrTail).catch(() => "")
|
|
544
|
+
]);
|
|
545
|
+
const head = exitCode === void 0 ? "The agent closed its connection." : exitCode === null ? "The agent process exited without an exit code." : `The agent process exited with code ${exitCode}.`;
|
|
546
|
+
const excerpt = lastLines(tail.trim(), AGENT_EXIT_STDERR_MAX_CHARS);
|
|
547
|
+
return new AcpAgentExitedError(
|
|
548
|
+
excerpt.length === 0 ? head : `${head}
|
|
549
|
+
Agent stderr (last lines):
|
|
550
|
+
${excerpt}`,
|
|
551
|
+
exitCode,
|
|
552
|
+
input2.cause
|
|
553
|
+
);
|
|
554
|
+
}
|
|
497
555
|
|
|
498
556
|
// ../../packages/ycodium-acp-executor/src/event-stream.ts
|
|
499
557
|
var UnboundedEventStream = class {
|
|
@@ -25428,7 +25486,8 @@ function createAcpConnection(options) {
|
|
|
25428
25486
|
options.onInboundFailure?.(error62);
|
|
25429
25487
|
void shutdown(
|
|
25430
25488
|
new AcpConnectionClosedError(
|
|
25431
|
-
`ACP inbound handling failed: ${error62 instanceof Error ? error62.message : String(error62)}
|
|
25489
|
+
`ACP inbound handling failed: ${error62 instanceof Error ? error62.message : String(error62)}`,
|
|
25490
|
+
{ reason: "inbound-failed" }
|
|
25432
25491
|
)
|
|
25433
25492
|
);
|
|
25434
25493
|
};
|
|
@@ -25473,19 +25532,21 @@ function createAcpConnection(options) {
|
|
|
25473
25532
|
} finally {
|
|
25474
25533
|
endInboundBatch();
|
|
25475
25534
|
}
|
|
25476
|
-
await shutdown(
|
|
25535
|
+
await shutdown(
|
|
25536
|
+
new AcpConnectionClosedError("ACP input stream ended", { reason: "input-ended" })
|
|
25537
|
+
);
|
|
25477
25538
|
});
|
|
25478
25539
|
};
|
|
25479
25540
|
const onError = (error62) => {
|
|
25480
25541
|
enqueueInbound(async () => {
|
|
25481
25542
|
await shutdown(
|
|
25482
|
-
error62 instanceof Error ? error62 : new AcpConnectionClosedError("ACP input stream error")
|
|
25543
|
+
error62 instanceof Error ? error62 : new AcpConnectionClosedError("ACP input stream error", { reason: "stream-error" })
|
|
25483
25544
|
);
|
|
25484
25545
|
});
|
|
25485
25546
|
};
|
|
25486
25547
|
const onWritableError = (error62) => {
|
|
25487
25548
|
void shutdown(
|
|
25488
|
-
error62 instanceof Error ? error62 : new AcpConnectionClosedError("ACP output stream error")
|
|
25549
|
+
error62 instanceof Error ? error62 : new AcpConnectionClosedError("ACP output stream error", { reason: "stream-error" })
|
|
25489
25550
|
);
|
|
25490
25551
|
};
|
|
25491
25552
|
options.readable.on("data", onData);
|
|
@@ -25548,7 +25609,8 @@ function createAcpConnection(options) {
|
|
|
25548
25609
|
awaitInboundIdle,
|
|
25549
25610
|
abandonPending,
|
|
25550
25611
|
close,
|
|
25551
|
-
closed
|
|
25612
|
+
closed,
|
|
25613
|
+
closeError: () => closedError
|
|
25552
25614
|
};
|
|
25553
25615
|
}
|
|
25554
25616
|
|
|
@@ -25957,7 +26019,8 @@ var ACP_FAILURE_CATEGORIES = [
|
|
|
25957
26019
|
"auth",
|
|
25958
26020
|
"model-unavailable",
|
|
25959
26021
|
"transport",
|
|
25960
|
-
"unknown"
|
|
26022
|
+
"unknown",
|
|
26023
|
+
"process-exit"
|
|
25961
26024
|
];
|
|
25962
26025
|
var isAcpFailureCategory = (value) => ACP_FAILURE_CATEGORIES.some((category) => category === value);
|
|
25963
26026
|
var readAcpFailureCategory = (error62) => {
|
|
@@ -25967,11 +26030,14 @@ var readAcpFailureCategory = (error62) => {
|
|
|
25967
26030
|
};
|
|
25968
26031
|
var withFailureCategory = (error62, category) => category === void 0 ? error62 : Object.assign(error62, { failureCategory: category });
|
|
25969
26032
|
var failureCategoryField = (category) => category === void 0 ? {} : { failureCategory: category };
|
|
25970
|
-
var
|
|
26033
|
+
var acpClosedConnectionCategory = (closeError, sessionEstablished, disposed) => {
|
|
26034
|
+
if (!sessionEstablished || disposed) return void 0;
|
|
26035
|
+
return closeError instanceof AcpConnectionClosedError && closeError.reason === "input-ended" ? "process-exit" : "transport";
|
|
26036
|
+
};
|
|
25971
26037
|
var acpPromptFailureCategory = (error62, input2) => {
|
|
25972
26038
|
const signaled = readAcpFailureCategory(error62);
|
|
25973
26039
|
if (signaled !== void 0) return signaled;
|
|
25974
|
-
return error62 instanceof AcpConnectionClosedError ?
|
|
26040
|
+
return error62 instanceof AcpConnectionClosedError ? acpClosedConnectionCategory(error62, input2.sessionEstablished, input2.disposed) : void 0;
|
|
25975
26041
|
};
|
|
25976
26042
|
|
|
25977
26043
|
// ../../packages/ycodium-acp-executor/src/tool-subagents.ts
|
|
@@ -25986,7 +26052,7 @@ var sealedHidden = (entry) => ({
|
|
|
25986
26052
|
});
|
|
25987
26053
|
function toolSubagentSettlementOfTurn(state, failureCategory) {
|
|
25988
26054
|
if (state === "cancelled") return "turn-interrupted";
|
|
25989
|
-
return state === "failed" && failureCategory === "
|
|
26055
|
+
return state === "failed" && failureCategory === "process-exit" ? "session-ended" : "turn-ended";
|
|
25990
26056
|
}
|
|
25991
26057
|
var sameFacts = (a, b) => a.title === b.title && a.description === b.description && a.summary === b.summary && a.role === b.role && a.model === b.model && a.effort === b.effort && a.rosterKind === b.rosterKind;
|
|
25992
26058
|
function linkage(taskId, toolCallId, facts) {
|
|
@@ -26603,14 +26669,19 @@ function createExecutorPrompt({
|
|
|
26603
26669
|
},
|
|
26604
26670
|
record4
|
|
26605
26671
|
);
|
|
26606
|
-
} catch (
|
|
26672
|
+
} catch (caught) {
|
|
26607
26673
|
if (shared.disposed) {
|
|
26608
26674
|
throw new AcpExecutorDisposedError();
|
|
26609
26675
|
}
|
|
26610
|
-
const failureCategory = acpPromptFailureCategory(
|
|
26676
|
+
const failureCategory = acpPromptFailureCategory(caught, {
|
|
26611
26677
|
sessionEstablished: shared.startResult !== void 0,
|
|
26612
26678
|
disposed: shared.disposed
|
|
26613
26679
|
});
|
|
26680
|
+
const error62 = failureCategory === "process-exit" && !interruptedTurnIds.has(turnId) ? await describeAgentExit({
|
|
26681
|
+
cause: caught,
|
|
26682
|
+
exited: options.exited,
|
|
26683
|
+
stderrTail: options.stderrTail
|
|
26684
|
+
}) : caught;
|
|
26614
26685
|
if (!interruptedTurnIds.has(turnId)) {
|
|
26615
26686
|
const errorMessage = error62 instanceof Error && error62.message.trim() || "ACP prompt failed";
|
|
26616
26687
|
if (settle2({
|
|
@@ -27946,24 +28017,40 @@ function createExecutorUpdates({
|
|
|
27946
28017
|
return;
|
|
27947
28018
|
}
|
|
27948
28019
|
};
|
|
27949
|
-
const
|
|
27950
|
-
for (const
|
|
28020
|
+
const emitHookEvents = (hookEvents) => {
|
|
28021
|
+
for (const hookEvent of hookEvents ?? []) {
|
|
28022
|
+
if (hookEvent.type === "runtime.warning") {
|
|
28023
|
+
const message = hookEvent.payload.message.trim();
|
|
28024
|
+
if (message.length === 0) continue;
|
|
28025
|
+
emit({
|
|
28026
|
+
type: "runtime.warning",
|
|
28027
|
+
...stamp(),
|
|
28028
|
+
provider: options.provider,
|
|
28029
|
+
threadId: options.threadId,
|
|
28030
|
+
...hookEvent.turnId !== void 0 ? { turnId: hookEvent.turnId } : {},
|
|
28031
|
+
payload: {
|
|
28032
|
+
message,
|
|
28033
|
+
...hookEvent.payload.detail !== void 0 ? { detail: hookEvent.payload.detail } : {}
|
|
28034
|
+
}
|
|
28035
|
+
});
|
|
28036
|
+
continue;
|
|
28037
|
+
}
|
|
27951
28038
|
emit({
|
|
27952
|
-
type:
|
|
28039
|
+
type: hookEvent.type,
|
|
27953
28040
|
...stamp(),
|
|
27954
28041
|
provider: options.provider,
|
|
27955
28042
|
threadId: options.threadId,
|
|
27956
|
-
...
|
|
27957
|
-
payload:
|
|
28043
|
+
...hookEvent.turnId !== void 0 ? { turnId: hookEvent.turnId } : {},
|
|
28044
|
+
payload: hookEvent.payload
|
|
27958
28045
|
});
|
|
27959
28046
|
}
|
|
27960
28047
|
};
|
|
27961
28048
|
const toolSubagents = hooks.toolSubagents === void 0 ? void 0 : createToolSubagentTracker(hooks.toolSubagents);
|
|
27962
|
-
const settleToolSubagents = (settlement, turnId) =>
|
|
28049
|
+
const settleToolSubagents = (settlement, turnId) => emitHookEvents(toolSubagents?.settle(settlement, turnId));
|
|
27963
28050
|
const settleSessionEnded = () => {
|
|
27964
28051
|
settleToolSubagents("session-ended");
|
|
27965
|
-
|
|
27966
|
-
|
|
28052
|
+
emitHookEvents(subagentSessions?.settleSessionEnded());
|
|
28053
|
+
emitHookEvents(hooks.onSessionEnded?.());
|
|
27967
28054
|
};
|
|
27968
28055
|
const observeContext = () => ({
|
|
27969
28056
|
turnId: shared.activeTurnId,
|
|
@@ -28025,7 +28112,7 @@ function createExecutorUpdates({
|
|
|
28025
28112
|
};
|
|
28026
28113
|
const hookResult = call === void 0 ? void 0 : toolSubagents?.onToolCallUpdated(call) ?? hooks.onToolCallUpdated?.(call);
|
|
28027
28114
|
const handledByHook = hookResult !== void 0 && "events" in hookResult && hookResult.handled === true;
|
|
28028
|
-
|
|
28115
|
+
emitHookEvents(
|
|
28029
28116
|
hookResult === void 0 ? [] : "events" in hookResult ? hookResult.events : hookResult
|
|
28030
28117
|
);
|
|
28031
28118
|
if (nextToolCall.status === "completed" && hookResult && "artifacts" in hookResult)
|
|
@@ -28122,7 +28209,7 @@ function createExecutorUpdates({
|
|
|
28122
28209
|
};
|
|
28123
28210
|
const receiveSessionUpdate = (params) => {
|
|
28124
28211
|
const foreign = !shared.ownSessionIds.has(params.sessionId) && (shared.childSessions.has(params.sessionId) || shared.sessionOpensInFlight === 0 && shared.ownSessionIds.size > 0);
|
|
28125
|
-
|
|
28212
|
+
emitHookEvents(
|
|
28126
28213
|
subagentSessions?.observe(params, {
|
|
28127
28214
|
turnId: shared.activeTurnId,
|
|
28128
28215
|
foreign,
|
|
@@ -28132,7 +28219,7 @@ function createExecutorUpdates({
|
|
|
28132
28219
|
);
|
|
28133
28220
|
if (!shared.sessionLoadInFlight) {
|
|
28134
28221
|
if (hooks.onSessionUpdate) {
|
|
28135
|
-
|
|
28222
|
+
emitHookEvents(hooks.onSessionUpdate(params, { ...observeContext(), foreign }));
|
|
28136
28223
|
}
|
|
28137
28224
|
}
|
|
28138
28225
|
if (!foreign) handleSessionUpdate(params);
|
|
@@ -28140,7 +28227,7 @@ function createExecutorUpdates({
|
|
|
28140
28227
|
const receiveExtensionNotification = (method, params) => {
|
|
28141
28228
|
if (shared.sessionLoadInFlight || !hooks.onExtensionNotification) return;
|
|
28142
28229
|
const result = hooks.onExtensionNotification(method, params, observeContext());
|
|
28143
|
-
if (Array.isArray(result))
|
|
28230
|
+
if (Array.isArray(result)) emitHookEvents(result);
|
|
28144
28231
|
};
|
|
28145
28232
|
return {
|
|
28146
28233
|
emitCompactionState,
|
|
@@ -28435,7 +28522,11 @@ function createAcpExecutor(options) {
|
|
|
28435
28522
|
settleAllUserInputs();
|
|
28436
28523
|
abortPendingSettlement(
|
|
28437
28524
|
"connection closed",
|
|
28438
|
-
|
|
28525
|
+
acpClosedConnectionCategory(
|
|
28526
|
+
connection.closeError(),
|
|
28527
|
+
shared.startResult !== void 0,
|
|
28528
|
+
shared.disposed
|
|
28529
|
+
)
|
|
28439
28530
|
);
|
|
28440
28531
|
shared.promptWaiters.splice(0).forEach((wake) => wake());
|
|
28441
28532
|
},
|
|
@@ -29601,6 +29692,7 @@ var NOTIFICATION_METHODS = /* @__PURE__ */ new Set([
|
|
|
29601
29692
|
"x.ai/session_notification",
|
|
29602
29693
|
"x.ai/session/update"
|
|
29603
29694
|
]);
|
|
29695
|
+
var isGrokSessionNotification = (method) => NOTIFICATION_METHODS.has(method.startsWith("_") ? method.slice(1) : method);
|
|
29604
29696
|
var record3 = (value) => isRecord10(value) ? value : {};
|
|
29605
29697
|
var text3 = trimmed2;
|
|
29606
29698
|
var count2 = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
@@ -29836,7 +29928,7 @@ function createGrokSubagents() {
|
|
|
29836
29928
|
}
|
|
29837
29929
|
};
|
|
29838
29930
|
return {
|
|
29839
|
-
onExtensionNotification: (method, params, ctx) =>
|
|
29931
|
+
onExtensionNotification: (method, params, ctx) => isGrokSessionNotification(method) ? fromEnvelope(params, ctx) : void 0,
|
|
29840
29932
|
onSessionUpdate: (notification, ctx) => ctx.foreign ? void 0 : fromEnvelope(notification, ctx),
|
|
29841
29933
|
handlesToolCall: (input2) => {
|
|
29842
29934
|
if (!spawnCalls.has(input2.toolCallId) && (record3(record3(input2.meta)["x.ai/tool"])["name"] === SPAWN_TOOL || record3(input2.rawInput)["variant"] === "Task")) {
|
|
@@ -29861,6 +29953,83 @@ function createGrokSubagents() {
|
|
|
29861
29953
|
};
|
|
29862
29954
|
}
|
|
29863
29955
|
|
|
29956
|
+
// src/grokRetryNotices.ts
|
|
29957
|
+
var GROK_RETRYING_CODE = "grok-retrying";
|
|
29958
|
+
var ERROR_TYPE_PATTERN = /^[a-z][a-z0-9_]{0,63}$/;
|
|
29959
|
+
var SEEN_EVENT_ID_LIMIT = 64;
|
|
29960
|
+
var RETRY_PHASE_ENDS = /* @__PURE__ */ new Set(["response_completed", "turn_completed"]);
|
|
29961
|
+
var positiveInteger = (value) => typeof value === "number" && Number.isInteger(value) && value > 0 ? value : void 0;
|
|
29962
|
+
var retryMessage = (errorType, attempt, maxRetries) => {
|
|
29963
|
+
const cause = errorType === "rate_limited" ? "Grok is rate limited." : "Grok request failed temporarily.";
|
|
29964
|
+
return `${cause} Retrying (attempt ${attempt} of ${maxRetries})`;
|
|
29965
|
+
};
|
|
29966
|
+
function grokObservationHooks(subagents) {
|
|
29967
|
+
const retryNotices = createGrokRetryNotices();
|
|
29968
|
+
return {
|
|
29969
|
+
onExtensionNotification: (method, params, ctx) => [
|
|
29970
|
+
...subagents.onExtensionNotification(method, params, ctx) ?? [],
|
|
29971
|
+
...isGrokSessionNotification(method) ? retryNotices.observe(params, ctx) : []
|
|
29972
|
+
],
|
|
29973
|
+
onSessionUpdate: (notification, ctx) => [
|
|
29974
|
+
...subagents.onSessionUpdate(notification, ctx) ?? [],
|
|
29975
|
+
...retryNotices.observe(notification, ctx)
|
|
29976
|
+
]
|
|
29977
|
+
};
|
|
29978
|
+
}
|
|
29979
|
+
function createGrokRetryNotices() {
|
|
29980
|
+
const seenEventIds = /* @__PURE__ */ new Set();
|
|
29981
|
+
let phase;
|
|
29982
|
+
return {
|
|
29983
|
+
observe: (envelope, ctx) => {
|
|
29984
|
+
if (!isRecord10(envelope) || !isRecord10(envelope["update"])) return [];
|
|
29985
|
+
if (ctx.sessionId === void 0 || envelope["sessionId"] !== ctx.sessionId) return [];
|
|
29986
|
+
const update = envelope["update"];
|
|
29987
|
+
if (update["sessionUpdate"] !== "retry_state") {
|
|
29988
|
+
if (RETRY_PHASE_ENDS.has(update["sessionUpdate"])) phase = void 0;
|
|
29989
|
+
return [];
|
|
29990
|
+
}
|
|
29991
|
+
if (update["type"] !== "retrying") {
|
|
29992
|
+
phase = void 0;
|
|
29993
|
+
return [];
|
|
29994
|
+
}
|
|
29995
|
+
const meta3 = isRecord10(envelope["_meta"]) ? envelope["_meta"] : {};
|
|
29996
|
+
if (meta3["isReplay"] === true) return [];
|
|
29997
|
+
const turnId = ctx.turnId;
|
|
29998
|
+
if (turnId === void 0) return [];
|
|
29999
|
+
const attempt = positiveInteger(update["attempt"]);
|
|
30000
|
+
const maxRetries = positiveInteger(update["max_retries"]);
|
|
30001
|
+
if (attempt === void 0 || maxRetries === void 0 || attempt > maxRetries) return [];
|
|
30002
|
+
const eventId = typeof meta3["eventId"] === "string" && meta3["eventId"].length > 0 ? meta3["eventId"] : void 0;
|
|
30003
|
+
if (eventId !== void 0) {
|
|
30004
|
+
if (seenEventIds.has(eventId)) return [];
|
|
30005
|
+
seenEventIds.add(eventId);
|
|
30006
|
+
if (seenEventIds.size > SEEN_EVENT_ID_LIMIT) {
|
|
30007
|
+
seenEventIds.delete(seenEventIds.values().next().value);
|
|
30008
|
+
}
|
|
30009
|
+
} else if (phase?.turnId === turnId && phase.attempt === attempt) {
|
|
30010
|
+
return [];
|
|
30011
|
+
}
|
|
30012
|
+
phase = { turnId, attempt };
|
|
30013
|
+
const errorType = typeof update["error_type"] === "string" && ERROR_TYPE_PATTERN.test(update["error_type"]) ? update["error_type"] : void 0;
|
|
30014
|
+
return [
|
|
30015
|
+
{
|
|
30016
|
+
type: "runtime.warning",
|
|
30017
|
+
turnId,
|
|
30018
|
+
payload: {
|
|
30019
|
+
message: retryMessage(errorType, attempt, maxRetries),
|
|
30020
|
+
detail: {
|
|
30021
|
+
code: GROK_RETRYING_CODE,
|
|
30022
|
+
attempt,
|
|
30023
|
+
maxRetries,
|
|
30024
|
+
...errorType === void 0 ? {} : { errorType }
|
|
30025
|
+
}
|
|
30026
|
+
}
|
|
30027
|
+
}
|
|
30028
|
+
];
|
|
30029
|
+
}
|
|
30030
|
+
};
|
|
30031
|
+
}
|
|
30032
|
+
|
|
29864
30033
|
// src/grokSupport.ts
|
|
29865
30034
|
import { modelSelectionStringOption } from "@ycodium-ai/plugin-api/executor";
|
|
29866
30035
|
var GROK_NATIVE_MODE_BY_RUNTIME_MODE = {
|
|
@@ -30773,6 +30942,7 @@ var createGrokInstance = (config2, host) => {
|
|
|
30773
30942
|
readable,
|
|
30774
30943
|
writable,
|
|
30775
30944
|
stderrTail,
|
|
30945
|
+
exited: handle.exited,
|
|
30776
30946
|
cwd,
|
|
30777
30947
|
threadId: input2.threadId,
|
|
30778
30948
|
provider: GROK_DRIVER_KIND,
|
|
@@ -30805,8 +30975,8 @@ var createGrokInstance = (config2, host) => {
|
|
|
30805
30975
|
artifacts: grokImageArtifacts(update.rawOutput),
|
|
30806
30976
|
...subagents.handlesToolCall(update) ? { handled: true } : {}
|
|
30807
30977
|
}),
|
|
30808
|
-
|
|
30809
|
-
|
|
30978
|
+
// 子 agent 名单与 CLI 自己重试(限流、容量不足)时的本轮提示。
|
|
30979
|
+
...grokObservationHooks(subagents),
|
|
30810
30980
|
onSessionEnded: subagents.onSessionEnded,
|
|
30811
30981
|
onExtensionRequest: async (method, params, ctx) => {
|
|
30812
30982
|
if (XAI_EXIT_PLAN_MODE_METHODS.includes(method)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/agent-grok",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4368",
|
|
4
4
|
"description": "Grok executor: grok CLI over Agent Client Protocol stdio.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"@types/node": "24.12.4",
|
|
22
22
|
"esbuild": "0.28.1",
|
|
23
23
|
"vite-plus": "0.2.2",
|
|
24
|
-
"ycodium-
|
|
24
|
+
"@ycodium-ai/plugin-api": "0.2.4368",
|
|
25
25
|
"ycodium-executor-testing": "0.0.0",
|
|
26
|
-
"
|
|
26
|
+
"ycodium-acp-executor": "0.2.4368"
|
|
27
27
|
},
|
|
28
28
|
"ycodium": {
|
|
29
29
|
"plugin": "./dist/index.js",
|