@clearideas/agent-runtime-cli 0.4.0 → 0.4.2
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 +20 -1
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -677,6 +677,16 @@ const execute = async (command, args, io, signal) => {
|
|
|
677
677
|
await jsonlSink?.flush();
|
|
678
678
|
}
|
|
679
679
|
};
|
|
680
|
+
const assertSafeInlineWorkerConfiguration = (config) => {
|
|
681
|
+
const customDestinationProvider = Object.entries(config.providers).find(([, definition]) => definition.baseURL != null);
|
|
682
|
+
if (customDestinationProvider) {
|
|
683
|
+
throw new Error(`Inline worker configuration cannot define provider baseURL values; use a trusted configReference for provider "${customDestinationProvider[0]}".`);
|
|
684
|
+
}
|
|
685
|
+
if (Object.keys(config.connections).length > 0) {
|
|
686
|
+
throw new Error("Inline worker configuration cannot define MCP connections; use a trusted configReference.");
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
const MAXIMUM_WORKER_INPUT_BYTES = 16 * 1024 * 1024;
|
|
680
690
|
class PortableWorkerEventSink {
|
|
681
691
|
#onMessage;
|
|
682
692
|
constructor(onMessage) {
|
|
@@ -736,6 +746,9 @@ export const executeWorkerInvocation = async (invocation, options) => {
|
|
|
736
746
|
throw new Error("Worker request configReference requires a host resolveConfigReference callback.");
|
|
737
747
|
})()
|
|
738
748
|
: await resolveConfig(undefined, process.cwd());
|
|
749
|
+
if (requestSuppliedConfiguration) {
|
|
750
|
+
assertSafeInlineWorkerConfiguration(config);
|
|
751
|
+
}
|
|
739
752
|
const configuredRuntime = composeRuntime(manifest, config, requestSuppliedConfiguration
|
|
740
753
|
? { environment: options.environment ?? {} }
|
|
741
754
|
: options.environment
|
|
@@ -845,8 +858,14 @@ export const executeWorkerInvocation = async (invocation, options) => {
|
|
|
845
858
|
const readStandardInput = async () => {
|
|
846
859
|
process.stdin.setEncoding("utf8");
|
|
847
860
|
let source = "";
|
|
848
|
-
|
|
861
|
+
let byteLength = 0;
|
|
862
|
+
for await (const chunk of process.stdin) {
|
|
863
|
+
byteLength += Buffer.byteLength(chunk, "utf8");
|
|
864
|
+
if (byteLength > MAXIMUM_WORKER_INPUT_BYTES) {
|
|
865
|
+
throw new Error("Worker invocation exceeds the input size limit.");
|
|
866
|
+
}
|
|
849
867
|
source += chunk;
|
|
868
|
+
}
|
|
850
869
|
return source;
|
|
851
870
|
};
|
|
852
871
|
const worker = async (args, io, signal) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clearideas/agent-runtime-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Standalone CLI for validating, running, resuming, and inspecting declarative agents.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Clear Ideas Incorporated",
|
|
@@ -40,21 +40,21 @@
|
|
|
40
40
|
"postpack": "node ../../scripts/cleanup-package-license.mjs"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@clearideas/agent-runtime-condition-jexl": "0.4.
|
|
44
|
-
"@clearideas/agent-runtime-config": "0.4.
|
|
45
|
-
"@clearideas/agent-runtime-contracts": "0.4.
|
|
46
|
-
"@clearideas/agent-runtime-core": "0.4.
|
|
47
|
-
"@clearideas/agent-runtime-execution": "0.4.
|
|
48
|
-
"@clearideas/agent-runtime-step-loop": "0.4.
|
|
49
|
-
"@clearideas/agent-runtime-step-prompt": "0.4.
|
|
50
|
-
"@clearideas/agent-runtime-step-standard": "0.4.
|
|
51
|
-
"@clearideas/agent-runtime-store-local": "0.4.
|
|
52
|
-
"@clearideas/agent-runtime-store-sqlite": "0.4.
|
|
43
|
+
"@clearideas/agent-runtime-condition-jexl": "0.4.2",
|
|
44
|
+
"@clearideas/agent-runtime-config": "0.4.2",
|
|
45
|
+
"@clearideas/agent-runtime-contracts": "0.4.2",
|
|
46
|
+
"@clearideas/agent-runtime-core": "0.4.2",
|
|
47
|
+
"@clearideas/agent-runtime-execution": "0.4.2",
|
|
48
|
+
"@clearideas/agent-runtime-step-loop": "0.4.2",
|
|
49
|
+
"@clearideas/agent-runtime-step-prompt": "0.4.2",
|
|
50
|
+
"@clearideas/agent-runtime-step-standard": "0.4.2",
|
|
51
|
+
"@clearideas/agent-runtime-store-local": "0.4.2",
|
|
52
|
+
"@clearideas/agent-runtime-store-sqlite": "0.4.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@types/node": "^26.
|
|
55
|
+
"@types/node": "^26.4.0",
|
|
56
56
|
"typescript": "^7.0.2",
|
|
57
|
-
"vitest": "^4.
|
|
57
|
+
"vitest": "^4.1.11"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=24"
|