@agentrix/agentrix-run 0.4.0 → 0.6.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.cjs CHANGED
@@ -5,12 +5,14 @@ var shared = require('@agentrix/shared');
5
5
 
6
6
  const DEFAULT_RESPONSE_MODE = "stream";
7
7
  const DEFAULT_WAIT_TIMEOUT_SECONDS = 1800;
8
+ const DEFAULT_AGENTRIX_BASE_URL = "https://agentrix.xmz.ai";
8
9
  function usage() {
9
10
  return [
10
11
  "Usage: agentrix-run --agent <agent> --prompt <prompt> [options]",
11
12
  "",
12
13
  "Options:",
13
14
  " --title <text>",
15
+ " --allow-filesystem-agent",
14
16
  " --repo <json>",
15
17
  " --output-schema <json>",
16
18
  " --ref <ref>",
@@ -25,7 +27,7 @@ function usage() {
25
27
  " --capability-profile <name>",
26
28
  " --runner-id <cloud-id|machine-id>",
27
29
  " --result-file <path>",
28
- " --base-url <url>",
30
+ ` --base-url <url> (default: ${DEFAULT_AGENTRIX_BASE_URL})`,
29
31
  " --api-key <api-key>",
30
32
  " --metadata <key=value>",
31
33
  " --help"
@@ -161,6 +163,7 @@ function parseInteger(value, flag) {
161
163
  function parseArgs(argv) {
162
164
  const options = {
163
165
  agent: "",
166
+ allowFilesystemAgent: false,
164
167
  prompt: "",
165
168
  responseMode: DEFAULT_RESPONSE_MODE,
166
169
  metadata: {}
@@ -175,6 +178,9 @@ function parseArgs(argv) {
175
178
  options.agent = requireValue(argv, index, arg);
176
179
  index += 1;
177
180
  break;
181
+ case "--allow-filesystem-agent":
182
+ options.allowFilesystemAgent = true;
183
+ break;
178
184
  case "--title":
179
185
  options.title = requireValue(argv, index, arg);
180
186
  index += 1;
@@ -311,6 +317,10 @@ function optionalPositiveInt(value) {
311
317
  const parsed = Number.parseInt(value, 10);
312
318
  return Number.isFinite(parsed) && parsed > 0 ? parsed : void 0;
313
319
  }
320
+ function readBooleanEnv(name) {
321
+ const value = process.env[name]?.trim().toLowerCase();
322
+ return value === "1" || value === "true" || value === "yes" || value === "on";
323
+ }
314
324
  function getNestedNumber(value, ...keys) {
315
325
  let current = value;
316
326
  for (const key of keys) {
@@ -405,6 +415,7 @@ function buildRequest(options, detected) {
405
415
  const repo = mergeRepo(options.repo, detected.repo);
406
416
  const request = {
407
417
  agent: options.agent,
418
+ allowFilesystemAgent: options.allowFilesystemAgent || readBooleanEnv("AGENTRIX_ALLOW_FILESYSTEM_AGENT") || void 0,
408
419
  responseMode: options.responseMode,
409
420
  title: options.title,
410
421
  prompt: options.prompt,
@@ -441,10 +452,7 @@ function buildRequest(options, detected) {
441
452
  return shared.CreateCiRunRequestSchema.parse(request);
442
453
  }
443
454
  function resolveBaseUrl(options) {
444
- const value = options.baseUrl || process.env.AGENTRIX_BASE_URL;
445
- if (!value) {
446
- throw new Error("Missing --base-url and AGENTRIX_BASE_URL");
447
- }
455
+ const value = options.baseUrl || process.env.AGENTRIX_BASE_URL || DEFAULT_AGENTRIX_BASE_URL;
448
456
  return value.replace(/\/+$/, "");
449
457
  }
450
458
  function resolveApiKey(options) {
package/dist/index.mjs CHANGED
@@ -3,12 +3,14 @@ import { CreateCiRunRequestSchema, CiRunStatusResponseSchema, CreateCiRunRespons
3
3
 
4
4
  const DEFAULT_RESPONSE_MODE = "stream";
5
5
  const DEFAULT_WAIT_TIMEOUT_SECONDS = 1800;
6
+ const DEFAULT_AGENTRIX_BASE_URL = "https://agentrix.xmz.ai";
6
7
  function usage() {
7
8
  return [
8
9
  "Usage: agentrix-run --agent <agent> --prompt <prompt> [options]",
9
10
  "",
10
11
  "Options:",
11
12
  " --title <text>",
13
+ " --allow-filesystem-agent",
12
14
  " --repo <json>",
13
15
  " --output-schema <json>",
14
16
  " --ref <ref>",
@@ -23,7 +25,7 @@ function usage() {
23
25
  " --capability-profile <name>",
24
26
  " --runner-id <cloud-id|machine-id>",
25
27
  " --result-file <path>",
26
- " --base-url <url>",
28
+ ` --base-url <url> (default: ${DEFAULT_AGENTRIX_BASE_URL})`,
27
29
  " --api-key <api-key>",
28
30
  " --metadata <key=value>",
29
31
  " --help"
@@ -159,6 +161,7 @@ function parseInteger(value, flag) {
159
161
  function parseArgs(argv) {
160
162
  const options = {
161
163
  agent: "",
164
+ allowFilesystemAgent: false,
162
165
  prompt: "",
163
166
  responseMode: DEFAULT_RESPONSE_MODE,
164
167
  metadata: {}
@@ -173,6 +176,9 @@ function parseArgs(argv) {
173
176
  options.agent = requireValue(argv, index, arg);
174
177
  index += 1;
175
178
  break;
179
+ case "--allow-filesystem-agent":
180
+ options.allowFilesystemAgent = true;
181
+ break;
176
182
  case "--title":
177
183
  options.title = requireValue(argv, index, arg);
178
184
  index += 1;
@@ -309,6 +315,10 @@ function optionalPositiveInt(value) {
309
315
  const parsed = Number.parseInt(value, 10);
310
316
  return Number.isFinite(parsed) && parsed > 0 ? parsed : void 0;
311
317
  }
318
+ function readBooleanEnv(name) {
319
+ const value = process.env[name]?.trim().toLowerCase();
320
+ return value === "1" || value === "true" || value === "yes" || value === "on";
321
+ }
312
322
  function getNestedNumber(value, ...keys) {
313
323
  let current = value;
314
324
  for (const key of keys) {
@@ -403,6 +413,7 @@ function buildRequest(options, detected) {
403
413
  const repo = mergeRepo(options.repo, detected.repo);
404
414
  const request = {
405
415
  agent: options.agent,
416
+ allowFilesystemAgent: options.allowFilesystemAgent || readBooleanEnv("AGENTRIX_ALLOW_FILESYSTEM_AGENT") || void 0,
406
417
  responseMode: options.responseMode,
407
418
  title: options.title,
408
419
  prompt: options.prompt,
@@ -439,10 +450,7 @@ function buildRequest(options, detected) {
439
450
  return CreateCiRunRequestSchema.parse(request);
440
451
  }
441
452
  function resolveBaseUrl(options) {
442
- const value = options.baseUrl || process.env.AGENTRIX_BASE_URL;
443
- if (!value) {
444
- throw new Error("Missing --base-url and AGENTRIX_BASE_URL");
445
- }
453
+ const value = options.baseUrl || process.env.AGENTRIX_BASE_URL || DEFAULT_AGENTRIX_BASE_URL;
446
454
  return value.replace(/\/+$/, "");
447
455
  }
448
456
  function resolveApiKey(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentrix/agentrix-run",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Native CI submit-and-observe wrapper for Agentrix",
5
5
  "type": "module",
6
6
  "bin": {
@@ -32,7 +32,7 @@
32
32
  "prepublishOnly": "yarn build"
33
33
  },
34
34
  "dependencies": {
35
- "@agentrix/shared": "^2.26.0"
35
+ "@agentrix/shared": "^2.33.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": ">=20",