@ycodium-ai/agent-claude 0.2.4486 → 0.2.5004
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 +38 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as NodePath20 from "node:path";
|
|
|
3
3
|
import { definePlugin } from "@ycodium-ai/plugin-api";
|
|
4
4
|
|
|
5
5
|
// ../../packages/plugin-api/src/version.ts
|
|
6
|
-
var PLUGIN_API_VERSION =
|
|
6
|
+
var PLUGIN_API_VERSION = 142;
|
|
7
7
|
|
|
8
8
|
// src/index.ts
|
|
9
9
|
import {
|
|
@@ -53,6 +53,7 @@ var CLAUDE_CARD = {
|
|
|
53
53
|
customModelIdExample: "claude-sonnet-5",
|
|
54
54
|
// 不改写用户的选择:`opus` / `sonnet` 这类简称的含义随 CLI 版本变,由 Claude 自己解析。
|
|
55
55
|
modelSlugAliases: null,
|
|
56
|
+
mcpToolCallCeilingSeconds: 630,
|
|
56
57
|
mcpTransports: ["stdio", "http", "sse"],
|
|
57
58
|
pluginManaged: true,
|
|
58
59
|
verifiedSkills: true,
|
|
@@ -122,6 +123,7 @@ var CLAUDE_CARD = {
|
|
|
122
123
|
type: "string",
|
|
123
124
|
"x-ycodium-form": {
|
|
124
125
|
titleKey: "form.homePath.title",
|
|
126
|
+
machineLocal: true,
|
|
125
127
|
descriptionKey: "form.homePath.description",
|
|
126
128
|
placeholderKey: "form.homePath.placeholder"
|
|
127
129
|
}
|
|
@@ -130,6 +132,7 @@ var CLAUDE_CARD = {
|
|
|
130
132
|
type: "string",
|
|
131
133
|
"x-ycodium-form": {
|
|
132
134
|
titleKey: "form.credentialsPath.title",
|
|
135
|
+
machineLocal: true,
|
|
133
136
|
descriptionKey: "form.credentialsPath.description",
|
|
134
137
|
placeholderKey: "form.credentialsPath.placeholder"
|
|
135
138
|
}
|
|
@@ -24568,6 +24571,7 @@ var settleStartup = (context, outcome) => {
|
|
|
24568
24571
|
const startup = context.startup;
|
|
24569
24572
|
if (startup === void 0 || startup.settled) return;
|
|
24570
24573
|
startup.settled = true;
|
|
24574
|
+
if (outcome === "established") startup.messages.length = 0;
|
|
24571
24575
|
startup.outcome.resolve(outcome);
|
|
24572
24576
|
};
|
|
24573
24577
|
var noteStartupEstablished = (context) => {
|
|
@@ -24611,12 +24615,14 @@ var makeSdkStream = (deps) => {
|
|
|
24611
24615
|
switch (message.type) {
|
|
24612
24616
|
case "stream_event":
|
|
24613
24617
|
await handleStreamEvent(context, message);
|
|
24618
|
+
noteStartupEstablished(context);
|
|
24614
24619
|
return;
|
|
24615
24620
|
case "user":
|
|
24616
24621
|
await handleUserMessage(context, message);
|
|
24617
24622
|
return;
|
|
24618
24623
|
case "assistant":
|
|
24619
24624
|
await handleAssistantMessage(context, message);
|
|
24625
|
+
if (!isClaudeSyntheticApiErrorMessage(message)) noteStartupEstablished(context);
|
|
24620
24626
|
return;
|
|
24621
24627
|
case "result":
|
|
24622
24628
|
await handleResultMessage(context, message);
|
|
@@ -25361,6 +25367,24 @@ var makeSendTurn = (deps) => {
|
|
|
25361
25367
|
return { sendTurn };
|
|
25362
25368
|
};
|
|
25363
25369
|
|
|
25370
|
+
// src/requestStatement.ts
|
|
25371
|
+
function claudeRequestStatement(toolName, requestType, input) {
|
|
25372
|
+
const isCommand = requestType === "command_execution_approval";
|
|
25373
|
+
const covered = [];
|
|
25374
|
+
const description = isCommand || classifyToolItemType(toolName) === "collab_agent_tool_call" ? readString2(input.description) : void 0;
|
|
25375
|
+
if (description !== void 0) covered.push("description");
|
|
25376
|
+
const command = isCommand ? readString2(input.command) : void 0;
|
|
25377
|
+
if (command !== void 0) covered.push("command");
|
|
25378
|
+
const outsideSandbox = input.dangerouslyDisableSandbox === true;
|
|
25379
|
+
if (outsideSandbox) covered.push("dangerouslyDisableSandbox");
|
|
25380
|
+
return {
|
|
25381
|
+
...description !== void 0 ? { description } : {},
|
|
25382
|
+
...command !== void 0 ? { command } : {},
|
|
25383
|
+
...outsideSandbox ? { outsideSandbox: true } : {},
|
|
25384
|
+
...covered.length > 0 ? { coveredArgs: covered } : {}
|
|
25385
|
+
};
|
|
25386
|
+
}
|
|
25387
|
+
|
|
25364
25388
|
// src/usage.ts
|
|
25365
25389
|
function maxClaudeContextWindowFromModelUsage(modelUsage) {
|
|
25366
25390
|
if (!modelUsage) return void 0;
|
|
@@ -25739,6 +25763,7 @@ var makeSessionCallbacks = (deps) => {
|
|
|
25739
25763
|
toolName: requestToolName,
|
|
25740
25764
|
args: toolInput,
|
|
25741
25765
|
...fileChanges ? { fileChanges } : {},
|
|
25766
|
+
statement: claudeRequestStatement(toolName, requestType, toolInput),
|
|
25742
25767
|
declineReasonRelay: "native"
|
|
25743
25768
|
},
|
|
25744
25769
|
providerRefs: nativeProviderRefs({
|
|
@@ -26840,6 +26865,8 @@ var makeStartSession = (deps) => {
|
|
|
26840
26865
|
};
|
|
26841
26866
|
|
|
26842
26867
|
// src/unresumableSessions.ts
|
|
26868
|
+
var GATEWAY_REBOUND_PREFIX = "API Error: 400 ";
|
|
26869
|
+
var GATEWAY_REBOUND_PHRASE = "\u6B64 session \u5DF2\u7ED1\u5B9A\u53E6\u5916\u7684ai\u8D26\u53F7";
|
|
26843
26870
|
var missingConversationLine = (sessionId) => `No conversation found with session ID: ${sessionId}`.toLowerCase();
|
|
26844
26871
|
var createUnresumableSessions = () => {
|
|
26845
26872
|
const reasons = /* @__PURE__ */ new Map();
|
|
@@ -26853,6 +26880,14 @@ var createUnresumableSessions = () => {
|
|
|
26853
26880
|
return {
|
|
26854
26881
|
/** 失败结果里 CLI 列出的错误项,逐项整条比。 */
|
|
26855
26882
|
noteResultErrors: noteDiagnostics,
|
|
26883
|
+
/** 失败结果的状态码与正文:网关拒绝续接这个号(见模块头部)。 */
|
|
26884
|
+
noteRejectedResume: (context, apiErrorStatus, resultText) => {
|
|
26885
|
+
const { launch } = context;
|
|
26886
|
+
if (!launch.resumed || context.launchConfirmed || apiErrorStatus !== 400) return;
|
|
26887
|
+
const text2 = resultText?.trim();
|
|
26888
|
+
if (text2 !== void 0 && text2.startsWith(GATEWAY_REBOUND_PREFIX) && text2.includes(GATEWAY_REBOUND_PHRASE))
|
|
26889
|
+
reasons.set(launch.sessionId, "missing");
|
|
26890
|
+
},
|
|
26856
26891
|
/** CLI 写给 stderr 的尾巴,逐行整行比。 */
|
|
26857
26892
|
noteStderr: (context, stderr) => noteDiagnostics(context, stderr.split(/\r?\n/u)),
|
|
26858
26893
|
/** 进程自己退了(不是宿主停的):新会话还没建立就退,预先定的号作废。 */
|
|
@@ -28284,13 +28319,14 @@ var makeTurnMessageHandlers = (deps) => {
|
|
|
28284
28319
|
if (status === "failed") {
|
|
28285
28320
|
if ("errors" in message && Array.isArray(message.errors))
|
|
28286
28321
|
unresumableSessions.noteResultErrors(context, message.errors);
|
|
28322
|
+
if ("result" in message)
|
|
28323
|
+
unresumableSessions.noteRejectedResume(context, message.api_error_status, message.result);
|
|
28287
28324
|
const missingConversation = unresumableSessions.reasonFor(context.launch.sessionId) === "missing";
|
|
28288
28325
|
if (suppressStartupFailure(context, missingConversation)) return;
|
|
28289
28326
|
await emitRuntimeError(context, errorMessage ?? "Claude turn failed.", void 0, category);
|
|
28290
28327
|
}
|
|
28291
28328
|
await completeTurn(context, status, errorMessage, message, category);
|
|
28292
28329
|
settleStartup(context, "established");
|
|
28293
|
-
if (context.startup) context.startup.messages.length = 0;
|
|
28294
28330
|
};
|
|
28295
28331
|
return { handleUserMessage, handleAssistantMessage, handleResultMessage };
|
|
28296
28332
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/agent-claude",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5004",
|
|
4
4
|
"description": "Claude executor: Claude Code CLI via @anthropic-ai/claude-agent-sdk.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"@types/node": "24.12.4",
|
|
25
25
|
"esbuild": "0.28.1",
|
|
26
26
|
"vite-plus": "0.2.2",
|
|
27
|
-
"@ycodium-ai/plugin-api": "0.2.4486",
|
|
28
27
|
"ycodium-composer-tokens": "0.0.0",
|
|
28
|
+
"@ycodium-ai/plugin-api": "0.2.5004",
|
|
29
29
|
"ycodium-executor-testing": "0.0.0",
|
|
30
30
|
"ycodium-jsonl-stream": "0.0.0"
|
|
31
31
|
},
|