@cydm/pie 2.7.13 → 2.7.14
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/builtin/extensions/ask-user/index.js +3 -3
- package/dist/builtin/extensions/document-attachments/index.js +3 -0
- package/dist/builtin/extensions/im-forward/index.js +980 -0
- package/dist/builtin/extensions/im-forward/package.json +11 -0
- package/dist/builtin/extensions/pie-ipc/index.js +1671 -0
- package/dist/builtin/extensions/pie-ipc/package.json +11 -0
- package/dist/builtin/extensions/plan-mode/index.js +3 -3
- package/dist/builtin/extensions/subagent/index.js +4 -4
- package/dist/builtin/extensions/todo/index.js +3 -3
- package/dist/chunks/{chunk-HGUYS5SF.js → chunk-5YU6MU2N.js} +1 -1
- package/dist/chunks/chunk-F7EBZTZO.js +26 -0
- package/dist/chunks/{chunk-D7RMNFVM.js → chunk-FOE2AW4L.js} +2 -2
- package/dist/chunks/{chunk-R46YPPTU.js → chunk-N4252GH3.js} +115 -88
- package/dist/chunks/{chunk-CIFC6QVB.js → chunk-VPTLDLI6.js} +3 -3
- package/dist/chunks/{src-5JJZZ5H7.js → src-4PG3KZUS.js} +2 -2
- package/dist/chunks/{test-stream-ZBTSPU7J.js → test-stream-OTKTTZ72.js} +1 -1
- package/dist/cli.js +177 -25
- package/package.json +3 -2
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
extractPlanTodoItems,
|
|
7
7
|
markCompletedPlanSteps,
|
|
8
8
|
restoreExecutionState
|
|
9
|
-
} from "../../../chunks/chunk-
|
|
10
|
-
import "../../../chunks/chunk-
|
|
11
|
-
import "../../../chunks/chunk-
|
|
9
|
+
} from "../../../chunks/chunk-VPTLDLI6.js";
|
|
10
|
+
import "../../../chunks/chunk-5YU6MU2N.js";
|
|
11
|
+
import "../../../chunks/chunk-N4252GH3.js";
|
|
12
12
|
import {
|
|
13
13
|
Type
|
|
14
14
|
} from "../../../chunks/chunk-XXGYUYXI.js";
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
formatTransportLifecycle,
|
|
7
7
|
getConfigDir,
|
|
8
8
|
logTransportLifecycle
|
|
9
|
-
} from "../../../chunks/chunk-
|
|
9
|
+
} from "../../../chunks/chunk-FOE2AW4L.js";
|
|
10
10
|
import {
|
|
11
11
|
SUBAGENT_SESSION_RECORD_VERSION,
|
|
12
12
|
createPolicyEnforcedTools,
|
|
13
13
|
createSharedFileSystemTools,
|
|
14
14
|
createSubagentCapability
|
|
15
|
-
} from "../../../chunks/chunk-
|
|
16
|
-
import "../../../chunks/chunk-
|
|
17
|
-
import "../../../chunks/chunk-
|
|
15
|
+
} from "../../../chunks/chunk-VPTLDLI6.js";
|
|
16
|
+
import "../../../chunks/chunk-5YU6MU2N.js";
|
|
17
|
+
import "../../../chunks/chunk-N4252GH3.js";
|
|
18
18
|
import "../../../chunks/chunk-XXGYUYXI.js";
|
|
19
19
|
import "../../../chunks/chunk-LZQXQOPJ.js";
|
|
20
20
|
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
executeManageTodoList,
|
|
9
9
|
executionStateToTodos,
|
|
10
10
|
restoreExecutionState
|
|
11
|
-
} from "../../../chunks/chunk-
|
|
12
|
-
import "../../../chunks/chunk-
|
|
13
|
-
import "../../../chunks/chunk-
|
|
11
|
+
} from "../../../chunks/chunk-VPTLDLI6.js";
|
|
12
|
+
import "../../../chunks/chunk-5YU6MU2N.js";
|
|
13
|
+
import "../../../chunks/chunk-N4252GH3.js";
|
|
14
14
|
import "../../../chunks/chunk-XXGYUYXI.js";
|
|
15
15
|
import "../../../chunks/chunk-LZQXQOPJ.js";
|
|
16
16
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/files/image-format.ts
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
|
+
function detectImageMime(bytes) {
|
|
6
|
+
if (bytes.length >= 3 && bytes[0] === 255 && bytes[1] === 216 && bytes[2] === 255) return { mime: "image/jpeg", ext: ".jpg" };
|
|
7
|
+
if (bytes.length >= 8 && bytes.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))) return { mime: "image/png", ext: ".png" };
|
|
8
|
+
if (bytes.length >= 6 && (bytes.subarray(0, 6).equals(Buffer.from("GIF87a")) || bytes.subarray(0, 6).equals(Buffer.from("GIF89a")))) return { mime: "image/gif", ext: ".gif" };
|
|
9
|
+
if (bytes.length >= 12 && bytes.subarray(0, 4).equals(Buffer.from("RIFF")) && bytes.subarray(8, 12).equals(Buffer.from("WEBP"))) return { mime: "image/webp", ext: ".webp" };
|
|
10
|
+
return { mime: "application/octet-stream", ext: ".bin" };
|
|
11
|
+
}
|
|
12
|
+
function readImageFormat(filePath) {
|
|
13
|
+
const fd = fs.openSync(filePath, "r");
|
|
14
|
+
try {
|
|
15
|
+
const header = Buffer.alloc(16);
|
|
16
|
+
const count = fs.readSync(fd, header, 0, header.length, 0);
|
|
17
|
+
return detectImageMime(header.subarray(0, count));
|
|
18
|
+
} finally {
|
|
19
|
+
fs.closeSync(fd);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
detectImageMime,
|
|
25
|
+
readImageFormat
|
|
26
|
+
};
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
defaultShellKindForPlatform,
|
|
8
8
|
interpretShellExit,
|
|
9
9
|
requestInteraction
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VPTLDLI6.js";
|
|
11
11
|
import {
|
|
12
12
|
EMPTY_ASSISTANT_CONTENT_ERROR,
|
|
13
13
|
OPENAI_COMPAT_PROTOCOL_ERROR_CODE,
|
|
14
14
|
getLogger
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-N4252GH3.js";
|
|
16
16
|
import {
|
|
17
17
|
Type
|
|
18
18
|
} from "./chunk-XXGYUYXI.js";
|
|
@@ -829,6 +829,14 @@ var SHA256 = class extends HashMD {
|
|
|
829
829
|
var sha256 = /* @__PURE__ */ createHasher(() => new SHA256());
|
|
830
830
|
|
|
831
831
|
// ../../packages/platform/src/sha256.ts
|
|
832
|
+
var utf8Owner;
|
|
833
|
+
function tryCreateUtf8Sha256Hasher() {
|
|
834
|
+
try {
|
|
835
|
+
return utf8Owner?.factory();
|
|
836
|
+
} catch {
|
|
837
|
+
return void 0;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
832
840
|
function createSha256Hasher() {
|
|
833
841
|
const hash = sha256.create();
|
|
834
842
|
return {
|
|
@@ -6462,100 +6470,119 @@ function jsonSha256(value) {
|
|
|
6462
6470
|
return hashJson(value);
|
|
6463
6471
|
}
|
|
6464
6472
|
function hashJson(value, parts) {
|
|
6465
|
-
const
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
used =
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6473
|
+
const utf8 = tryCreateUtf8Sha256Hasher();
|
|
6474
|
+
try {
|
|
6475
|
+
const hash = utf8 ? void 0 : createSha256Hasher();
|
|
6476
|
+
const bytes = new Uint8Array(utf8 ? 0 : 8192);
|
|
6477
|
+
let fragments = "";
|
|
6478
|
+
let used = 0;
|
|
6479
|
+
const byte = (n) => {
|
|
6480
|
+
bytes[used++] = n;
|
|
6481
|
+
if (used === bytes.length) {
|
|
6482
|
+
hash.update(bytes);
|
|
6483
|
+
used = 0;
|
|
6484
|
+
}
|
|
6485
|
+
};
|
|
6486
|
+
const emit = (text) => {
|
|
6487
|
+
if (utf8) {
|
|
6488
|
+
if (fragments.length + text.length > 8192) {
|
|
6489
|
+
if (fragments) utf8.updateUtf8(fragments);
|
|
6490
|
+
fragments = "";
|
|
6491
|
+
}
|
|
6492
|
+
if (text.length >= 8192) utf8.updateUtf8(text);
|
|
6493
|
+
else fragments += text;
|
|
6494
|
+
return;
|
|
6495
|
+
}
|
|
6496
|
+
for (let i = 0; i < text.length; i++) {
|
|
6497
|
+
const cp = text.codePointAt(i);
|
|
6498
|
+
if (cp < 128) byte(cp);
|
|
6499
|
+
else if (cp < 2048) {
|
|
6500
|
+
byte(192 | cp >> 6);
|
|
6501
|
+
byte(128 | cp & 63);
|
|
6502
|
+
} else if (cp < 65536) {
|
|
6503
|
+
byte(224 | cp >> 12);
|
|
6504
|
+
byte(128 | cp >> 6 & 63);
|
|
6505
|
+
byte(128 | cp & 63);
|
|
6506
|
+
} else {
|
|
6507
|
+
byte(240 | cp >> 18);
|
|
6508
|
+
byte(128 | cp >> 12 & 63);
|
|
6509
|
+
byte(128 | cp >> 6 & 63);
|
|
6510
|
+
byte(128 | cp & 63);
|
|
6511
|
+
i++;
|
|
6512
|
+
}
|
|
6513
|
+
}
|
|
6514
|
+
};
|
|
6515
|
+
const string = (text) => {
|
|
6516
|
+
emit('"');
|
|
6517
|
+
for (let start = 0; start < text.length; ) {
|
|
6518
|
+
let end = Math.min(start + 2048, text.length);
|
|
6519
|
+
if (end < text.length && text.charCodeAt(end - 1) >= 55296 && text.charCodeAt(end - 1) <= 56319) end--;
|
|
6520
|
+
const escaped = JSON.stringify(text.slice(start, end));
|
|
6521
|
+
emit(escaped.slice(1, -1));
|
|
6522
|
+
start = end;
|
|
6523
|
+
}
|
|
6524
|
+
emit('"');
|
|
6525
|
+
};
|
|
6526
|
+
const ancestors = /* @__PURE__ */ new Set();
|
|
6527
|
+
const omitted = (v) => v === void 0 || typeof v === "function" || typeof v === "symbol";
|
|
6528
|
+
const visit = (v) => {
|
|
6529
|
+
if (typeof v === "string") {
|
|
6530
|
+
string(v);
|
|
6531
|
+
return;
|
|
6532
|
+
}
|
|
6533
|
+
if (v === null || typeof v !== "object") {
|
|
6534
|
+
const encoded = JSON.stringify(v);
|
|
6535
|
+
if (encoded === void 0) throw new TypeError("Not a JSON value");
|
|
6536
|
+
emit(encoded);
|
|
6537
|
+
return;
|
|
6538
|
+
}
|
|
6539
|
+
const prototype = Object.getPrototypeOf(v);
|
|
6540
|
+
if (!Array.isArray(v) && prototype !== Object.prototype && prototype !== null || typeof v.toJSON === "function") throw new TypeError("Not a JSON snapshot");
|
|
6541
|
+
if (ancestors.has(v)) throw new TypeError("Circular JSON snapshot");
|
|
6542
|
+
ancestors.add(v);
|
|
6543
|
+
if (Array.isArray(v)) {
|
|
6544
|
+
emit("[");
|
|
6545
|
+
for (let i = 0; i < v.length; i++) {
|
|
6546
|
+
if (Object.getOwnPropertyDescriptor(v, i)?.get) throw new TypeError("Not a JSON snapshot");
|
|
6547
|
+
if (i) emit(",");
|
|
6548
|
+
visit(omitted(v[i]) ? null : v[i]);
|
|
6549
|
+
}
|
|
6550
|
+
emit("]");
|
|
6486
6551
|
} else {
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6552
|
+
emit("{");
|
|
6553
|
+
let first = true;
|
|
6554
|
+
for (const key of Object.keys(v)) {
|
|
6555
|
+
if (Object.getOwnPropertyDescriptor(v, key)?.get) throw new TypeError("Not a JSON snapshot");
|
|
6556
|
+
const entry = v[key];
|
|
6557
|
+
if (omitted(entry)) continue;
|
|
6558
|
+
if (!first) emit(",");
|
|
6559
|
+
first = false;
|
|
6560
|
+
string(key);
|
|
6561
|
+
emit(":");
|
|
6562
|
+
visit(entry);
|
|
6563
|
+
}
|
|
6564
|
+
emit("}");
|
|
6492
6565
|
}
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
emit('"');
|
|
6497
|
-
for (let start = 0; start < text.length; ) {
|
|
6498
|
-
let end = Math.min(start + 2048, text.length);
|
|
6499
|
-
if (end < text.length && text.charCodeAt(end - 1) >= 55296 && text.charCodeAt(end - 1) <= 56319) end--;
|
|
6500
|
-
const escaped = JSON.stringify(text.slice(start, end));
|
|
6501
|
-
emit(escaped.slice(1, -1));
|
|
6502
|
-
start = end;
|
|
6503
|
-
}
|
|
6504
|
-
emit('"');
|
|
6505
|
-
};
|
|
6506
|
-
const ancestors = /* @__PURE__ */ new Set();
|
|
6507
|
-
const omitted = (v) => v === void 0 || typeof v === "function" || typeof v === "symbol";
|
|
6508
|
-
const visit = (v) => {
|
|
6509
|
-
if (typeof v === "string") {
|
|
6510
|
-
string(v);
|
|
6511
|
-
return;
|
|
6512
|
-
}
|
|
6513
|
-
if (v === null || typeof v !== "object") {
|
|
6514
|
-
const encoded = JSON.stringify(v);
|
|
6515
|
-
if (encoded === void 0) throw new TypeError("Not a JSON value");
|
|
6516
|
-
emit(encoded);
|
|
6517
|
-
return;
|
|
6518
|
-
}
|
|
6519
|
-
const prototype = Object.getPrototypeOf(v);
|
|
6520
|
-
if (!Array.isArray(v) && prototype !== Object.prototype && prototype !== null || typeof v.toJSON === "function") throw new TypeError("Not a JSON snapshot");
|
|
6521
|
-
if (ancestors.has(v)) throw new TypeError("Circular JSON snapshot");
|
|
6522
|
-
ancestors.add(v);
|
|
6523
|
-
if (Array.isArray(v)) {
|
|
6566
|
+
ancestors.delete(v);
|
|
6567
|
+
};
|
|
6568
|
+
if (parts) {
|
|
6524
6569
|
emit("[");
|
|
6525
|
-
for (let i = 0; i <
|
|
6526
|
-
if (Object.getOwnPropertyDescriptor(v, i)?.get) throw new TypeError("Not a JSON snapshot");
|
|
6570
|
+
for (let i = 0; i < parts.count + parts.output.length; i++) {
|
|
6527
6571
|
if (i) emit(",");
|
|
6528
|
-
|
|
6572
|
+
const item = i < parts.count ? parts.input[i] : parts.output[i - parts.count];
|
|
6573
|
+
visit(omitted(item) ? null : item);
|
|
6529
6574
|
}
|
|
6530
6575
|
emit("]");
|
|
6531
|
-
} else
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
emit(":");
|
|
6542
|
-
visit(entry);
|
|
6543
|
-
}
|
|
6544
|
-
emit("}");
|
|
6545
|
-
}
|
|
6546
|
-
ancestors.delete(v);
|
|
6547
|
-
};
|
|
6548
|
-
if (parts) {
|
|
6549
|
-
emit("[");
|
|
6550
|
-
for (let i = 0; i < parts.count + parts.output.length; i++) {
|
|
6551
|
-
if (i) emit(",");
|
|
6552
|
-
const item = i < parts.count ? parts.input[i] : parts.output[i - parts.count];
|
|
6553
|
-
visit(omitted(item) ? null : item);
|
|
6554
|
-
}
|
|
6555
|
-
emit("]");
|
|
6556
|
-
} else visit(value);
|
|
6557
|
-
if (used) hash.update(bytes.subarray(0, used));
|
|
6558
|
-
return hash.digestHex();
|
|
6576
|
+
} else visit(value);
|
|
6577
|
+
if (utf8) {
|
|
6578
|
+
if (fragments) utf8.updateUtf8(fragments);
|
|
6579
|
+
return utf8.digestHex();
|
|
6580
|
+
}
|
|
6581
|
+
if (used) hash.update(bytes.subarray(0, used));
|
|
6582
|
+
return hash.digestHex();
|
|
6583
|
+
} finally {
|
|
6584
|
+
utf8?.dispose();
|
|
6585
|
+
}
|
|
6559
6586
|
}
|
|
6560
6587
|
function inputSha256(input, count = input.length, output = []) {
|
|
6561
6588
|
return hashJson(void 0, { input, count, output });
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
createAgentOperationError,
|
|
5
5
|
getAgentFailureMetadata,
|
|
6
6
|
getToolCallerIdentity
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5YU6MU2N.js";
|
|
8
8
|
import {
|
|
9
9
|
AssistantMessageEventStream,
|
|
10
10
|
FileSystemGateway,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
getPlatformConfig,
|
|
15
15
|
hashText,
|
|
16
16
|
streamSimple
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-N4252GH3.js";
|
|
18
18
|
import {
|
|
19
19
|
Type
|
|
20
20
|
} from "./chunk-XXGYUYXI.js";
|
|
@@ -8218,7 +8218,7 @@ var SessionTraceSnapshotWriter = class {
|
|
|
8218
8218
|
|
|
8219
8219
|
// ../../packages/agent-framework/src/delegation.ts
|
|
8220
8220
|
var DELEGATION_REPORT_MAX_CHARS = 24e3;
|
|
8221
|
-
var DELEGATION_REPORT_INSTRUCTION = 'Return your final response once as a JSON object: {"summary":string,"result":string,"remainingWork"?:string[],"evidenceRefs"?:string[]}. Keep the entire JSON response within 24,000 characters: give concise conclusions and bounded evidence references, not repeated drafting notes. Do not make an extra tool call to report. Evidence references are your claims, not runtime verification.';
|
|
8221
|
+
var DELEGATION_REPORT_INSTRUCTION = 'Return your final response once as a JSON object: {"summary":string,"result":string,"remainingWork"?:string[],"evidenceRefs"?:string[]}. Keep the entire JSON response within 24,000 characters: give concise conclusions and bounded evidence references, not repeated drafting notes. Do not make an extra tool call to report. Evidence references are your claims, not runtime verification. Emit the raw JSON object only \u2014 no markdown code fences around it, and no raw line breaks inside JSON string values (escape them as \\n); anything JSON.parse rejects is treated as no report.';
|
|
8222
8222
|
function parseDelegationReport(text, runId, truncated = false) {
|
|
8223
8223
|
const raw = (text ?? "").slice(0, DELEGATION_REPORT_MAX_CHARS);
|
|
8224
8224
|
const base = { version: 1, runId: runId.slice(0, 160), raw };
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
createToolCallerIdentity,
|
|
9
9
|
getAgentFailureMetadata,
|
|
10
10
|
getToolCallerIdentity
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-5YU6MU2N.js";
|
|
12
|
+
import "./chunk-N4252GH3.js";
|
|
13
13
|
import "./chunk-XXGYUYXI.js";
|
|
14
14
|
import "./chunk-LZQXQOPJ.js";
|
|
15
15
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
EventStream
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-N4252GH3.js";
|
|
5
5
|
import "./chunk-XXGYUYXI.js";
|
|
6
6
|
import "./chunk-LZQXQOPJ.js";
|
|
7
7
|
|