@cuylabs/agent-core 0.8.0 → 0.9.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/{builder-UpOWQMW3.d.ts → builder-BgZ_j4Vs.d.ts} +2 -1
- package/dist/{chunk-RZITT45F.js → chunk-4QFNWPIF.js} +4 -4
- package/dist/{chunk-BFM2YHNM.js → chunk-5ARZJWD2.js} +74 -37
- package/dist/{chunk-KUVSERLJ.js → chunk-DXFBQMXP.js} +5 -2
- package/dist/{chunk-CAA7FHIH.js → chunk-EKR6PKXU.js} +0 -100
- package/dist/{chunk-IVUJDISU.js → chunk-GFTW23FV.js} +5 -14
- package/dist/{chunk-7VKQ4WPB.js → chunk-H3FUYU52.js} +11 -3
- package/dist/chunk-I6PKJ7XQ.js +292 -0
- package/dist/chunk-IYWQOJMQ.js +102 -0
- package/dist/{chunk-4BDA7DQY.js → chunk-J4QDGZIA.js} +19 -3
- package/dist/{chunk-7MUFEN4K.js → chunk-JLXG2SH7.js} +349 -3
- package/dist/{chunk-YSLSEQ6B.js → chunk-MAZ5DY5B.js} +18 -30
- package/dist/{chunk-P6YF7USR.js → chunk-MHKK374K.js} +12 -11
- package/dist/{chunk-VBWWUHWI.js → chunk-OFDKHNCX.js} +4 -1
- package/dist/{chunk-YUUJK53A.js → chunk-RKEW5WXI.js} +1 -1
- package/dist/{chunk-LRHOS4ZN.js → chunk-SPILYYDF.js} +3 -2
- package/dist/{chunk-RFEKJKTO.js → chunk-UDCZ673N.js} +321 -275
- package/dist/{chunk-BDBZ3SLK.js → chunk-UHCJEM2E.js} +39 -2
- package/dist/chunk-WGZAPU6N.js +929 -0
- package/dist/{chunk-N6HWIEEA.js → chunk-WKHDSSXG.js} +140 -23
- package/dist/index-BCqEGzBj.d.ts +251 -0
- package/dist/{index-CWSchSql.d.ts → index-DQuTZ8xL.d.ts} +290 -13
- package/dist/index.d.ts +23 -29
- package/dist/index.js +776 -490
- package/dist/{errors → inference/errors}/index.d.ts +2 -2
- package/dist/{errors → inference/errors}/index.js +1 -1
- package/dist/inference/index.d.ts +10 -9
- package/dist/inference/index.js +34 -8
- package/dist/middleware/index.d.ts +5 -4
- package/dist/middleware/index.js +3 -3
- package/dist/models/index.d.ts +18 -16
- package/dist/models/index.js +47 -11
- package/dist/models/reasoning/index.d.ts +4 -0
- package/dist/{reasoning → models/reasoning}/index.js +2 -3
- package/dist/plugin/index.d.ts +414 -0
- package/dist/plugin/index.js +32 -0
- package/dist/presets/index.d.ts +3 -3
- package/dist/presets/index.js +7 -5
- package/dist/prompt/index.d.ts +6 -5
- package/dist/prompt/index.js +3 -2
- package/dist/runner-CI-XeR16.d.ts +91 -0
- package/dist/runtime/index.d.ts +7 -6
- package/dist/runtime/index.js +6 -7
- package/dist/safety/index.d.ts +1 -1
- package/dist/safety/index.js +1 -1
- package/dist/{session-manager-B_CWGTsl.d.ts → session-manager-KbYt2WUh.d.ts} +8 -0
- package/dist/signal/index.js +1 -1
- package/dist/skill/index.d.ts +2 -2
- package/dist/skill/index.js +3 -3
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.js +1 -1
- package/dist/sub-agent/index.d.ts +10 -9
- package/dist/sub-agent/index.js +21 -4
- package/dist/tool/index.d.ts +19 -5
- package/dist/tool/index.js +2 -2
- package/dist/{tool-BHbyUAy3.d.ts → tool-CZWN3KbO.d.ts} +1 -10
- package/dist/{tool-DLXAR9Ce.d.ts → tool-DkhSCV2Y.d.ts} +1 -1
- package/dist/tracking/index.d.ts +1 -1
- package/dist/tracking/index.js +1 -1
- package/dist/{types-KKDrdU9Y.d.ts → types-BlOKk-Bb.d.ts} +9 -4
- package/dist/{types-BnpEOYV-.d.ts → types-BlZwmnuW.d.ts} +1 -1
- package/dist/{runner-e2YRcUoX.d.ts → types-DTSkxakL.d.ts} +3 -138
- package/dist/{types-QKHHQLLq.d.ts → types-DmDwi2zI.d.ts} +7 -4
- package/package.json +15 -9
- package/dist/chunk-DWYX7ASF.js +0 -26
- package/dist/chunk-SQU2AJHO.js +0 -305
- package/dist/reasoning/index.d.ts +0 -116
- package/dist/types-QA4WhEfz.d.ts +0 -138
|
@@ -34,7 +34,7 @@ function normalizeToolReplayPolicy(policy, fileOps) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// src/tool/truncation.ts
|
|
37
|
-
import * as
|
|
37
|
+
import * as fsSync from "fs";
|
|
38
38
|
import * as path from "path";
|
|
39
39
|
import * as os from "os";
|
|
40
40
|
import * as crypto from "crypto";
|
|
@@ -55,8 +55,11 @@ function truncateOutput(output, options = {}) {
|
|
|
55
55
|
}
|
|
56
56
|
const hash = crypto.createHash("sha256").update(output).digest("hex").slice(0, 16);
|
|
57
57
|
const outputPath = path.join(TRUNCATE_DIR, `output-${hash}.txt`);
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
try {
|
|
59
|
+
fsSync.mkdirSync(TRUNCATE_DIR, { recursive: true });
|
|
60
|
+
fsSync.writeFileSync(outputPath, output, "utf-8");
|
|
61
|
+
} catch {
|
|
62
|
+
}
|
|
60
63
|
let truncated;
|
|
61
64
|
if (lines.length > maxLines) {
|
|
62
65
|
const keepLines = Math.floor(maxLines / 2);
|
|
@@ -71,9 +74,10 @@ function truncateOutput(output, options = {}) {
|
|
|
71
74
|
...lastPart
|
|
72
75
|
].join("\n");
|
|
73
76
|
} else {
|
|
77
|
+
const buf = Buffer.from(output, "utf-8");
|
|
74
78
|
const keepBytes = Math.floor(maxBytes / 2);
|
|
75
|
-
const start =
|
|
76
|
-
const end =
|
|
79
|
+
const start = buf.subarray(0, keepBytes).toString("utf-8");
|
|
80
|
+
const end = buf.subarray(buf.length - keepBytes).toString("utf-8");
|
|
77
81
|
const omittedBytes = bytes - keepBytes * 2;
|
|
78
82
|
truncated = `${start}
|
|
79
83
|
... (${omittedBytes} bytes omitted, full output saved to ${outputPath}) ...
|
|
@@ -111,8 +115,9 @@ var Tool;
|
|
|
111
115
|
);
|
|
112
116
|
const originalExecute = toolInfo.execute;
|
|
113
117
|
const execute = async (params, ctx) => {
|
|
118
|
+
let validated;
|
|
114
119
|
try {
|
|
115
|
-
toolInfo.parameters.parse(params);
|
|
120
|
+
validated = toolInfo.parameters.parse(params);
|
|
116
121
|
} catch (error) {
|
|
117
122
|
if (error instanceof z.ZodError && toolInfo.formatValidationError) {
|
|
118
123
|
throw new Error(toolInfo.formatValidationError(error), {
|
|
@@ -125,7 +130,7 @@ Please rewrite the input so it satisfies the expected schema.`,
|
|
|
125
130
|
{ cause: error }
|
|
126
131
|
);
|
|
127
132
|
}
|
|
128
|
-
const result = await originalExecute(
|
|
133
|
+
const result = await originalExecute(validated, ctx);
|
|
129
134
|
if (result.metadata.truncated !== void 0) {
|
|
130
135
|
return result;
|
|
131
136
|
}
|
|
@@ -149,10 +154,6 @@ Please rewrite the input so it satisfies the expected schema.`,
|
|
|
149
154
|
};
|
|
150
155
|
}
|
|
151
156
|
Tool2.define = define;
|
|
152
|
-
function defineSimple(id, config) {
|
|
153
|
-
return define(id, config);
|
|
154
|
-
}
|
|
155
|
-
Tool2.defineSimple = defineSimple;
|
|
156
157
|
})(Tool || (Tool = {}));
|
|
157
158
|
function defineTool(definition) {
|
|
158
159
|
return Tool.define(definition.id, {
|
|
@@ -508,6 +508,9 @@ async function createGitStyleDiffPlaceholder() {
|
|
|
508
508
|
}
|
|
509
509
|
|
|
510
510
|
// src/tracking/turn-tracker/tracker.ts
|
|
511
|
+
function logTurnTrackerWarning(message) {
|
|
512
|
+
console.warn(message);
|
|
513
|
+
}
|
|
511
514
|
var TurnChangeTracker = class {
|
|
512
515
|
config;
|
|
513
516
|
currentTurn = null;
|
|
@@ -584,7 +587,7 @@ var TurnChangeTracker = class {
|
|
|
584
587
|
return false;
|
|
585
588
|
}
|
|
586
589
|
if (this.currentTurn.baselines.size >= this.config.maxTrackedFiles) {
|
|
587
|
-
|
|
590
|
+
logTurnTrackerWarning(
|
|
588
591
|
`[TurnTracker] Max tracked files (${this.config.maxTrackedFiles}) reached, skipping: ${filePath}`
|
|
589
592
|
);
|
|
590
593
|
return false;
|
|
@@ -487,9 +487,10 @@ var SkillRegistry = class {
|
|
|
487
487
|
for (const skill of this.skills.values()) {
|
|
488
488
|
lines.push("");
|
|
489
489
|
lines.push(`<skill name="${skill.name}" scope="${skill.scope}">`);
|
|
490
|
-
lines.push(skill.description);
|
|
490
|
+
lines.push(` <description>${skill.description}</description>`);
|
|
491
|
+
lines.push(` <file>${skill.filePath}</file>`);
|
|
491
492
|
if (skill.dependencies && skill.dependencies.length > 0) {
|
|
492
|
-
lines.push(`
|
|
493
|
+
lines.push(` <depends-on>${skill.dependencies.join(", ")}</depends-on>`);
|
|
493
494
|
}
|
|
494
495
|
lines.push("</skill>");
|
|
495
496
|
}
|