@ycodium-ai/agent-claude 0.2.3904 → 0.2.3927
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 +1 -103
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -22912,25 +22912,6 @@ function readClaudeToolUseResult(message) {
|
|
|
22912
22912
|
const result = message.tool_use_result;
|
|
22913
22913
|
return result !== null && typeof result === "object" && !Array.isArray(result) ? result : void 0;
|
|
22914
22914
|
}
|
|
22915
|
-
function imageBlocksFromToolResult(block) {
|
|
22916
|
-
if (!block || typeof block !== "object") return [];
|
|
22917
|
-
const content = block.content;
|
|
22918
|
-
if (!Array.isArray(content)) return [];
|
|
22919
|
-
const images = [];
|
|
22920
|
-
for (const entry of content) {
|
|
22921
|
-
if (!entry || typeof entry !== "object") continue;
|
|
22922
|
-
const candidate = entry;
|
|
22923
|
-
if (candidate.type !== "image") continue;
|
|
22924
|
-
const source = candidate.source;
|
|
22925
|
-
if (!source || typeof source !== "object") continue;
|
|
22926
|
-
const typedSource = source;
|
|
22927
|
-
if (typedSource.type !== "base64" || typeof typedSource.media_type !== "string" || typeof typedSource.data !== "string" || typedSource.data.length === 0) {
|
|
22928
|
-
continue;
|
|
22929
|
-
}
|
|
22930
|
-
images.push({ mimeType: typedSource.media_type, base64: typedSource.data });
|
|
22931
|
-
}
|
|
22932
|
-
return images;
|
|
22933
|
-
}
|
|
22934
22915
|
function extractExitPlanModePlan(value) {
|
|
22935
22916
|
if (!value || typeof value !== "object") {
|
|
22936
22917
|
return void 0;
|
|
@@ -23181,49 +23162,6 @@ function describeUnknownSdkMessage(kind, message) {
|
|
|
23181
23162
|
return preview ? `${kind} \u2014 ${preview}` : `${kind} (no displayable text content)`;
|
|
23182
23163
|
}
|
|
23183
23164
|
|
|
23184
|
-
// src/imageMime.ts
|
|
23185
|
-
var IMAGE_EXTENSION_BY_MIME_TYPE = {
|
|
23186
|
-
"image/avif": ".avif",
|
|
23187
|
-
"image/bmp": ".bmp",
|
|
23188
|
-
"image/gif": ".gif",
|
|
23189
|
-
"image/heic": ".heic",
|
|
23190
|
-
"image/heif": ".heif",
|
|
23191
|
-
"image/jpeg": ".jpg",
|
|
23192
|
-
"image/jpg": ".jpg",
|
|
23193
|
-
"image/png": ".png",
|
|
23194
|
-
"image/svg+xml": ".svg",
|
|
23195
|
-
"image/tiff": ".tiff",
|
|
23196
|
-
"image/webp": ".webp"
|
|
23197
|
-
};
|
|
23198
|
-
var SAFE_IMAGE_FILE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
23199
|
-
".avif",
|
|
23200
|
-
".bmp",
|
|
23201
|
-
".gif",
|
|
23202
|
-
".heic",
|
|
23203
|
-
".heif",
|
|
23204
|
-
".ico",
|
|
23205
|
-
".jpeg",
|
|
23206
|
-
".jpg",
|
|
23207
|
-
".png",
|
|
23208
|
-
".svg",
|
|
23209
|
-
".tiff",
|
|
23210
|
-
".webp"
|
|
23211
|
-
]);
|
|
23212
|
-
function inferImageExtension(input) {
|
|
23213
|
-
const key = input.mimeType.toLowerCase();
|
|
23214
|
-
const fromMime = Object.hasOwn(IMAGE_EXTENSION_BY_MIME_TYPE, key) ? IMAGE_EXTENSION_BY_MIME_TYPE[key] : void 0;
|
|
23215
|
-
if (fromMime) {
|
|
23216
|
-
return fromMime;
|
|
23217
|
-
}
|
|
23218
|
-
const fileName = input.fileName?.trim() ?? "";
|
|
23219
|
-
const extensionMatch = /\.([a-z0-9]{1,8})$/i.exec(fileName);
|
|
23220
|
-
const fileNameExtension = extensionMatch ? `.${extensionMatch[1].toLowerCase()}` : "";
|
|
23221
|
-
if (SAFE_IMAGE_FILE_EXTENSIONS.has(fileNameExtension)) {
|
|
23222
|
-
return fileNameExtension;
|
|
23223
|
-
}
|
|
23224
|
-
return ".bin";
|
|
23225
|
-
}
|
|
23226
|
-
|
|
23227
23165
|
// src/types.ts
|
|
23228
23166
|
var PROVIDER = "claudeAgent";
|
|
23229
23167
|
var PromptQueue = class {
|
|
@@ -23370,19 +23308,6 @@ async function buildUserMessageFromTurn(input) {
|
|
|
23370
23308
|
}
|
|
23371
23309
|
return buildUserMessage({ sdkContent });
|
|
23372
23310
|
}
|
|
23373
|
-
async function persistProducedImage(input) {
|
|
23374
|
-
if (!input.attachmentsApi) return null;
|
|
23375
|
-
try {
|
|
23376
|
-
return await input.attachmentsApi.store({
|
|
23377
|
-
threadId: input.threadId,
|
|
23378
|
-
name: `image${inferImageExtension({ mimeType: input.mimeType })}`,
|
|
23379
|
-
mimeType: input.mimeType,
|
|
23380
|
-
bytes: input.bytes
|
|
23381
|
-
});
|
|
23382
|
-
} catch {
|
|
23383
|
-
return null;
|
|
23384
|
-
}
|
|
23385
|
-
}
|
|
23386
23311
|
|
|
23387
23312
|
// src/adapter/assistantText.ts
|
|
23388
23313
|
var makeAssistantText = (emitter) => {
|
|
@@ -27790,32 +27715,6 @@ var makeTurnMessageHandlers = (deps) => {
|
|
|
27790
27715
|
payload: message
|
|
27791
27716
|
}
|
|
27792
27717
|
});
|
|
27793
|
-
const producedImages = imageBlocksFromToolResult(toolResult.block);
|
|
27794
|
-
if (producedImages.length > 0) {
|
|
27795
|
-
const persisted = [];
|
|
27796
|
-
for (const image of producedImages) {
|
|
27797
|
-
persisted.push(
|
|
27798
|
-
await persistProducedImage({
|
|
27799
|
-
attachmentsApi: deps.attachments,
|
|
27800
|
-
threadId: context.session.threadId,
|
|
27801
|
-
mimeType: image.mimeType,
|
|
27802
|
-
bytes: Buffer.from(image.base64, "base64")
|
|
27803
|
-
})
|
|
27804
|
-
);
|
|
27805
|
-
}
|
|
27806
|
-
const attachments = persisted.filter((entry) => entry !== null);
|
|
27807
|
-
if (attachments.length > 0) {
|
|
27808
|
-
const attachmentStamp = await makeEventStamp();
|
|
27809
|
-
offerRuntimeEvent(context, {
|
|
27810
|
-
type: "assistant.attachment.produced",
|
|
27811
|
-
...eventHeader(context, attachmentStamp),
|
|
27812
|
-
...context.turnState ? { turnId: asCanonicalTurnId(context.turnState.turnId) } : {},
|
|
27813
|
-
itemId: asRuntimeItemId(tool.itemId),
|
|
27814
|
-
payload: { attachments },
|
|
27815
|
-
providerRefs: nativeProviderRefs({ providerItemId: tool.itemId })
|
|
27816
|
-
});
|
|
27817
|
-
}
|
|
27818
|
-
}
|
|
27819
27718
|
const streamKind = toolResultStreamKind(tool.itemType);
|
|
27820
27719
|
if (streamKind && toolResult.text.length > 0 && context.turnState) {
|
|
27821
27720
|
const deltaStamp = await makeEventStamp();
|
|
@@ -29435,7 +29334,6 @@ function createClaudeAdapter(recipe, host, options) {
|
|
|
29435
29334
|
log: options?.log ?? host.log,
|
|
29436
29335
|
now,
|
|
29437
29336
|
buildLaunchEnvironment,
|
|
29438
|
-
attachments: options?.attachments,
|
|
29439
29337
|
emitRuntimeError,
|
|
29440
29338
|
emitProposedPlanCompleted,
|
|
29441
29339
|
emitClaudeTaskPlanUpdated,
|
|
@@ -29712,7 +29610,7 @@ var executors = [
|
|
|
29712
29610
|
];
|
|
29713
29611
|
var index_default = definePlugin({
|
|
29714
29612
|
id: "agent-claude",
|
|
29715
|
-
apiVersion:
|
|
29613
|
+
apiVersion: 68,
|
|
29716
29614
|
executors,
|
|
29717
29615
|
activate(ctx) {
|
|
29718
29616
|
ctx.command({
|
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.3927",
|
|
4
4
|
"description": "Claude executor: Claude Code CLI via @anthropic-ai/claude-agent-sdk.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -24,10 +24,10 @@
|
|
|
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.
|
|
27
|
+
"@ycodium-ai/plugin-api": "0.2.3927",
|
|
28
28
|
"ycodium-composer-tokens": "0.0.0",
|
|
29
|
-
"ycodium-
|
|
30
|
-
"ycodium-
|
|
29
|
+
"ycodium-executor-testing": "0.0.0",
|
|
30
|
+
"ycodium-jsonl-stream": "0.0.0"
|
|
31
31
|
},
|
|
32
32
|
"ycodium": {
|
|
33
33
|
"plugin": "./dist/index.js",
|