@demicodes/agent 0.14.1 → 0.15.0
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.d.mts +2 -1
- package/dist/index.mjs +4 -5
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -352,7 +352,8 @@ declare function toShellToolResult(result: ShellCommandStatus, options?: ShellTo
|
|
|
352
352
|
declare const SHELL_VIEW_MAX_CHARS = 32768;
|
|
353
353
|
/**
|
|
354
354
|
* Bounded UI view of a shell command stored on the tool_call block. Full
|
|
355
|
-
* output lives in the command artifact (
|
|
355
|
+
* output lives in the command artifact directory (real files on the host
|
|
356
|
+
* filesystem, see `artifactDir`), keyed by
|
|
356
357
|
* `commandId`; the view carries only the tail render window and never embeds
|
|
357
358
|
* raw or base64 bytes.
|
|
358
359
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -2350,7 +2350,7 @@ function toShellToolResult(result, options = {}) {
|
|
|
2350
2350
|
text: formatShellToolResult(result, options)
|
|
2351
2351
|
}];
|
|
2352
2352
|
if (result.status === "exited" && result.binaryStdout) {
|
|
2353
|
-
const verdict = binaryStreamVerdict(result.binaryStdout, result.
|
|
2353
|
+
const verdict = binaryStreamVerdict(result.binaryStdout, `${result.artifactDir}/stdout.bin`, options.model, {
|
|
2354
2354
|
...DEFAULT_MAX_MEDIA_BYTES,
|
|
2355
2355
|
...options.maxMediaBytes
|
|
2356
2356
|
});
|
|
@@ -2425,9 +2425,8 @@ function tailChunkWindow(chunks, maxChars) {
|
|
|
2425
2425
|
* magic matches the closed model-media set, the model accepts the type, and
|
|
2426
2426
|
* the stream was not truncated; otherwise explain why nothing was attached.
|
|
2427
2427
|
*/
|
|
2428
|
-
function binaryStreamVerdict(binary,
|
|
2428
|
+
function binaryStreamVerdict(binary, binPath, model, maxMediaBytes) {
|
|
2429
2429
|
const media = sniffModelMediaType(binary.data);
|
|
2430
|
-
const binPath = `/@/commands/${commandId}/stdout.bin`;
|
|
2431
2430
|
if (binary.truncated) return { note: `Binary stdout (${binary.totalBytes} bytes${media ? `, ${media.mediaType}` : ""}) exceeded the shell's ${binary.limitBytes}-byte binary limit (maxBinaryBytes) and was not attached; the raw bytes remain readable at ${binPath}. Produce a smaller version and re-run.` };
|
|
2432
2431
|
if (!media) return { note: `Binary stdout does not match any model-viewable media type; the raw bytes remain readable at ${binPath}.` };
|
|
2433
2432
|
if (!model || !modelAcceptsMediaType(model, media.mediaType)) return { note: `Binary stdout is ${media.mediaType}, which this model does not accept natively; the raw bytes remain readable at ${binPath}.` };
|
|
@@ -2525,7 +2524,7 @@ function formatShellToolResult(result, options) {
|
|
|
2525
2524
|
lines.push(`idleMs: ${result.idleMs}`);
|
|
2526
2525
|
appendArtifact(lines, "stdout", result.stdout);
|
|
2527
2526
|
appendArtifact(lines, "stderr", result.stderr);
|
|
2528
|
-
lines.push(`metaPath:
|
|
2527
|
+
lines.push(`metaPath: ${result.artifactDir}/meta.json`);
|
|
2529
2528
|
}
|
|
2530
2529
|
if (options.includePreview) appendPreview(lines, result, options.previewBudgetTokens ?? SMALL_CONTEXT_PREVIEW_TOKENS);
|
|
2531
2530
|
if (result.status === "running") lines.push("next: command is still running; check again with shell_status, or call yield to end this turn and be woken later, or shell_abort to stop it.");
|
|
@@ -2546,7 +2545,7 @@ function appendPreview(lines, result, budgetTokens) {
|
|
|
2546
2545
|
}
|
|
2547
2546
|
lines.push("preview:");
|
|
2548
2547
|
lines.push(preview.text);
|
|
2549
|
-
if (preview.truncated || result.output.truncated) lines.push(`previewTruncated: true; read
|
|
2548
|
+
if (preview.truncated || result.output.truncated) lines.push(`previewTruncated: true; read ${result.artifactDir}/stdout.txt or ${result.artifactDir}/stderr.txt for more.`);
|
|
2550
2549
|
}
|
|
2551
2550
|
function boundedPreview(text, budgetTokens) {
|
|
2552
2551
|
const maxChars = Math.max(0, Math.floor(budgetTokens * APPROX_CHARS_PER_TOKEN));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@demicodes/agent",
|
|
3
3
|
"description": "Session runtime and transport-neutral client and server protocol for Demi.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@demicodes/core": "^0.
|
|
23
|
-
"@demicodes/provider": "^0.
|
|
24
|
-
"@demicodes/shell": "^0.
|
|
25
|
-
"@demicodes/utils": "^0.
|
|
22
|
+
"@demicodes/core": "^0.15.0",
|
|
23
|
+
"@demicodes/provider": "^0.15.0",
|
|
24
|
+
"@demicodes/shell": "^0.15.0",
|
|
25
|
+
"@demicodes/utils": "^0.15.0"
|
|
26
26
|
},
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"main": "./dist/index.mjs",
|