@clearideas/agent-runtime-cli 0.4.0 → 0.4.1

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -1
  2. package/package.json +12 -12
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
- for await (const chunk of process.stdin)
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.0",
3
+ "version": "0.4.1",
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,19 +40,19 @@
40
40
  "postpack": "node ../../scripts/cleanup-package-license.mjs"
41
41
  },
42
42
  "dependencies": {
43
- "@clearideas/agent-runtime-condition-jexl": "0.4.0",
44
- "@clearideas/agent-runtime-config": "0.4.0",
45
- "@clearideas/agent-runtime-contracts": "0.4.0",
46
- "@clearideas/agent-runtime-core": "0.4.0",
47
- "@clearideas/agent-runtime-execution": "0.4.0",
48
- "@clearideas/agent-runtime-step-loop": "0.4.0",
49
- "@clearideas/agent-runtime-step-prompt": "0.4.0",
50
- "@clearideas/agent-runtime-step-standard": "0.4.0",
51
- "@clearideas/agent-runtime-store-local": "0.4.0",
52
- "@clearideas/agent-runtime-store-sqlite": "0.4.0"
43
+ "@clearideas/agent-runtime-condition-jexl": "0.4.1",
44
+ "@clearideas/agent-runtime-config": "0.4.1",
45
+ "@clearideas/agent-runtime-contracts": "0.4.1",
46
+ "@clearideas/agent-runtime-core": "0.4.1",
47
+ "@clearideas/agent-runtime-execution": "0.4.1",
48
+ "@clearideas/agent-runtime-step-loop": "0.4.1",
49
+ "@clearideas/agent-runtime-step-prompt": "0.4.1",
50
+ "@clearideas/agent-runtime-step-standard": "0.4.1",
51
+ "@clearideas/agent-runtime-store-local": "0.4.1",
52
+ "@clearideas/agent-runtime-store-sqlite": "0.4.1"
53
53
  },
54
54
  "devDependencies": {
55
- "@types/node": "^26.1.2",
55
+ "@types/node": "^26.2.0",
56
56
  "typescript": "^7.0.2",
57
57
  "vitest": "^4.0.18"
58
58
  },