@ycodium-ai/agent-claude 0.2.2696 → 0.2.2700
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 +15 -30
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -98,7 +98,12 @@ var CLAUDE_CARD = {
|
|
|
98
98
|
contextCompaction: "native",
|
|
99
99
|
turnSteering: true,
|
|
100
100
|
// 子代理、workflow 与其成员经 SDK 的 task_* 系统消息报成 task.*(claudeInstance.ts)。
|
|
101
|
-
reportsSpawnedAgents: true
|
|
101
|
+
reportsSpawnedAgents: true,
|
|
102
|
+
// 出处:Anthropic Messages API 的视觉文档——单张图片 5 MB、宽高各不超过 8000 像素,超了
|
|
103
|
+
// API 直接拒掉整轮。5 MB 量的是 base64 之后的长度(SDK 把图片以 base64 块发出),所以
|
|
104
|
+
// 原始字节上限是它的 3/4。宿主据此把更大的图退化成路径(Claude 自己的 Read 工具会读那个
|
|
105
|
+
// 路径)。mimeTypes 缺席 = 宿主认的四种,与 types.ts 的 SUPPORTED_CLAUDE_IMAGE_MIME_TYPES 一致。
|
|
106
|
+
inlineImages: { maxBytes: Math.floor(5 * 1024 * 1024 * 3 / 4), maxEdgePixels: 8e3 }
|
|
102
107
|
},
|
|
103
108
|
credentialSources: [
|
|
104
109
|
{
|
|
@@ -20164,9 +20169,14 @@ function modelIdFromSelection(selection) {
|
|
|
20164
20169
|
const model = selection["model"];
|
|
20165
20170
|
return typeof model === "string" ? model.trim() || void 0 : void 0;
|
|
20166
20171
|
}
|
|
20172
|
+
var RETIRED_CLAUDE_EFFORT = "ultrathink";
|
|
20167
20173
|
function currentSelectValue(descriptor, raw) {
|
|
20174
|
+
if (raw === RETIRED_CLAUDE_EFFORT && (descriptor.promptInjectedValues?.includes(raw) || !descriptor.options.some((option) => option.id === raw))) {
|
|
20175
|
+
return void 0;
|
|
20176
|
+
}
|
|
20168
20177
|
if (raw && descriptor.options.some((option) => option.id === raw)) return raw;
|
|
20169
|
-
|
|
20178
|
+
const defaultEffort = descriptor.options.find((option) => option.isDefault)?.id;
|
|
20179
|
+
return defaultEffort === RETIRED_CLAUDE_EFFORT && descriptor.promptInjectedValues?.includes(defaultEffort) ? void 0 : defaultEffort;
|
|
20170
20180
|
}
|
|
20171
20181
|
function resolveClaudeEffort(caps, raw) {
|
|
20172
20182
|
const descriptor = caps.optionDescriptors.find((entry) => entry.id === "effort");
|
|
@@ -20174,7 +20184,7 @@ function resolveClaudeEffort(caps, raw) {
|
|
|
20174
20184
|
return currentSelectValue(descriptor, raw);
|
|
20175
20185
|
}
|
|
20176
20186
|
function normalizeClaudeCliEffort(effort) {
|
|
20177
|
-
if (!effort
|
|
20187
|
+
if (!effort) {
|
|
20178
20188
|
return void 0;
|
|
20179
20189
|
}
|
|
20180
20190
|
if (effort === "ultracode") {
|
|
@@ -20195,28 +20205,6 @@ function claudeCliModelId(input) {
|
|
|
20195
20205
|
];
|
|
20196
20206
|
return matchCatalogModel(input.requestedModelId, known) ?? input.placeholder;
|
|
20197
20207
|
}
|
|
20198
|
-
function resolvePromptInjectedEffort(caps, rawEffort) {
|
|
20199
|
-
const trimmed = rawEffort?.trim();
|
|
20200
|
-
if (!trimmed) return void 0;
|
|
20201
|
-
const descriptor = caps.optionDescriptors.find((entry) => entry.id === "effort");
|
|
20202
|
-
if (!descriptor || descriptor.type !== "select") return void 0;
|
|
20203
|
-
if (!descriptor.promptInjectedValues?.includes(trimmed)) return void 0;
|
|
20204
|
-
return trimmed;
|
|
20205
|
-
}
|
|
20206
|
-
function applyClaudePromptEffortPrefix(text, effort) {
|
|
20207
|
-
const trimmed = text.trim();
|
|
20208
|
-
if (!trimmed) {
|
|
20209
|
-
return trimmed;
|
|
20210
|
-
}
|
|
20211
|
-
if (effort !== "ultrathink" || /^\/[^\s/]+(?:\s|$)/u.test(trimmed)) {
|
|
20212
|
-
return trimmed;
|
|
20213
|
-
}
|
|
20214
|
-
if (trimmed.startsWith("Ultrathink:")) {
|
|
20215
|
-
return trimmed;
|
|
20216
|
-
}
|
|
20217
|
-
return `Ultrathink:
|
|
20218
|
-
${trimmed}`;
|
|
20219
|
-
}
|
|
20220
20208
|
function getEffectiveClaudeAgentEffort(effort) {
|
|
20221
20209
|
const normalized = normalizeClaudeCliEffort(effort);
|
|
20222
20210
|
return normalized ? normalized : null;
|
|
@@ -24355,11 +24343,8 @@ function boundModelSelection(value, boundInstanceId) {
|
|
|
24355
24343
|
}
|
|
24356
24344
|
return selection;
|
|
24357
24345
|
}
|
|
24358
|
-
function buildPromptText(
|
|
24359
|
-
|
|
24360
|
-
const rawEffort = selection ? getModelSelectionStringOptionValue(selection, "effort") : null;
|
|
24361
|
-
const promptEffort = resolvePromptInjectedEffort(caps, rawEffort);
|
|
24362
|
-
return applyClaudePromptEffortPrefix(input.input?.trim() ?? "", promptEffort);
|
|
24346
|
+
function buildPromptText(_caps, input, _boundInstanceId) {
|
|
24347
|
+
return input.input?.trim() ?? "";
|
|
24363
24348
|
}
|
|
24364
24349
|
function buildUserMessage(input) {
|
|
24365
24350
|
return {
|
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.2700",
|
|
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.2696",
|
|
28
27
|
"ycodium-executor-testing": "0.0.0",
|
|
28
|
+
"@ycodium-ai/plugin-api": "0.2.2700",
|
|
29
29
|
"ycodium-jsonl-stream": "0.0.0"
|
|
30
30
|
},
|
|
31
31
|
"ycodium": {
|