@openwop/cli 1.7.0 → 1.8.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/README.md CHANGED
@@ -498,7 +498,7 @@ The `goals` group drives the host's standing goals — an objective the host pur
498
498
  openwop goals list --state active # the goal list (also satisfied | escalated | bound-exceeded | paused)
499
499
  openwop goals get goal_123 --json # inspect (objective, judge, continuation, bounds, iterations)
500
500
  openwop goals create --objective "Keep the triage backlog under 20" \
501
- --judge verifier --continuation schedule --max-iterations 50 --max-cost 5.00 --timeout-ms 600000
501
+ --verifier-ref <ref> --continuation schedule --max-iterations 50 --max-cost 5.00 --timeout-ms 600000
502
502
  openwop goals pause goal_123 # suspend continuation (resume to restart)
503
503
  openwop goals abandon goal_123 --yes # close the goal
504
504
  ```
package/dist/cli.js CHANGED
@@ -578,7 +578,7 @@ function errText(err) {
578
578
  // package.json
579
579
  var package_default = {
580
580
  name: "@openwop/cli",
581
- version: "1.7.0",
581
+ version: "1.8.0",
582
582
  description: "OpenWOP CLI for operating the workflow-engine demo app and OpenWOP-compatible hosts.",
583
583
  license: "Apache-2.0",
584
584
  type: "module",
@@ -20501,7 +20501,7 @@ var GOALS_ROUTES = [
20501
20501
  var GOALS_HELP = `Usage:
20502
20502
  openwop goals list [--state <s>] [--json]
20503
20503
  openwop goals get <goalId> [--json]
20504
- openwop goals create --objective <text> [--judge host|verifier] [--continuation <mode>]
20504
+ openwop goals create --objective <text> --verifier-ref <ref> [--continuation schedule|manual]
20505
20505
  [--max-iterations <n>] [--max-cost <usd>] [--timeout-ms <ms>] [--json]
20506
20506
  openwop goals pause <goalId> [--json]
20507
20507
  openwop goals resume <goalId> [--json]
@@ -20528,13 +20528,16 @@ Endpoints:
20528
20528
  resume POST /v1/host/openwop-app/goals/{id}/resume
20529
20529
  abandon POST /v1/host/openwop-app/goals/{id}/abandon
20530
20530
 
20531
- --state <s> (list) Filter by state (e.g. active, satisfied, escalated, bound-exceeded, paused).
20531
+ --state <s> (list) Filter by state: active, satisfied, escalated, abandoned, bound-exceeded.
20532
20532
  --objective <text> (create) The goal objective (required).
20533
- --judge host|verifier (create) completion.check \u2014 who decides completion (default: host).
20534
- --continuation <mode> (create) continuation.mode \u2014 the arm that re-engages work (e.g. schedule | commitment | manual).
20535
- --max-iterations <n> (create) Bound: bounds.maxLoopIterations.
20533
+ --verifier-ref <ref> (create) completion.verifierRef \u2014 the verifier registered on the host that
20534
+ judges this goal (required; the host refuses a ref it has not registered).
20535
+ --judge verifier (create) completion.check \u2014 who decides completion. 'verifier' is the only
20536
+ judge a host advertising agents.goals.judge=verifier honours (the default).
20537
+ --continuation <mode> (create) continuation.mode \u2014 schedule | manual (default: manual).
20538
+ --max-iterations <n> (create) Bound: bounds.maxLoopIterations (positive integer).
20536
20539
  --max-cost <usd> (create) Bound: bounds.maxCostUsd (accumulated USD).
20537
- --timeout-ms <ms> (create) Bound: bounds.runTimeoutMs (wall-clock, milliseconds).
20540
+ --timeout-ms <ms> (create) Bound: bounds.runTimeoutMs (wall-clock, positive milliseconds).
20538
20541
  --yes (abandon) Required to confirm.
20539
20542
  --json Print the raw host response instead of the rendered view.
20540
20543
 
@@ -20544,13 +20547,14 @@ termination guarantee (bounds).
20544
20547
 
20545
20548
  Exit codes (get/create/pause/resume reflect the goal's state, so scripts can gate
20546
20549
  on the verdict):
20547
- 0 satisfied 3 escalated or still open (active/paused) 1 bound-exceeded/abandoned or error
20550
+ 0 satisfied 3 escalated or still open (active) 1 bound-exceeded/abandoned or error
20551
+ A paused goal is still 'active' (pause stops its continuation, not the goal).
20548
20552
  \`list\` exits 0 on success.
20549
20553
 
20550
20554
  Examples:
20551
20555
  openwop goals list --state active
20552
20556
  openwop goals get goal_123 --json
20553
- openwop goals create --objective "Keep the triage backlog under 20" --judge verifier --continuation schedule --max-iterations 50 --max-cost 5.00 --timeout-ms 600000
20557
+ openwop goals create --objective "Keep the triage backlog under 20" --verifier-ref <ref> --continuation schedule --max-iterations 50 --max-cost 5.00 --timeout-ms 600000
20554
20558
  openwop goals pause goal_123
20555
20559
  openwop goals abandon goal_123 --yes
20556
20560
  `;
@@ -20696,18 +20700,24 @@ function renderGoal(ctx, g, fallbackId) {
20696
20700
  async function runGoalsCreate(ctx, argv) {
20697
20701
  const { options } = parseOptions(argv, {
20698
20702
  bool: ["--help"],
20699
- value: ["--objective", "--judge", "--continuation", "--max-iterations", "--max-cost", "--timeout-ms"]
20703
+ value: ["--objective", "--judge", "--verifier-ref", "--continuation", "--max-iterations", "--max-cost", "--timeout-ms"]
20700
20704
  });
20701
20705
  if (options.help || !options.objective) {
20702
- write(ctx.io.stdout, "Usage: openwop goals create --objective <text> [--judge host|verifier] [--continuation <mode>] [--max-iterations <n>] [--max-cost <usd>] [--timeout-ms <ms>] [--json]\n");
20706
+ write(ctx.io.stdout, "Usage: openwop goals create --objective <text> --verifier-ref <ref> [--continuation schedule|manual] [--max-iterations <n>] [--max-cost <usd>] [--timeout-ms <ms>] [--json]\n");
20703
20707
  return options.help ? 0 : 2;
20704
20708
  }
20705
- if (options.judge !== void 0 && !["host", "verifier"].includes(options.judge)) {
20706
- throw new CliError("--judge must be one of: host, verifier", 2);
20709
+ if (options.judge !== void 0 && options.judge !== "verifier") {
20710
+ throw new CliError("--judge must be: verifier", 2);
20711
+ }
20712
+ if (!options.verifierRef) {
20713
+ throw new CliError("goals create needs --verifier-ref <ref> \u2014 the verifier registered on the host that judges the goal", 2);
20714
+ }
20715
+ if (options.continuation !== void 0 && !["schedule", "manual"].includes(options.continuation)) {
20716
+ throw new CliError("--continuation must be one of: schedule, manual", 2);
20707
20717
  }
20708
20718
  const body = {
20709
20719
  objective: options.objective,
20710
- completion: { check: options.judge ?? "host" },
20720
+ completion: { check: "verifier", verifierRef: options.verifierRef },
20711
20721
  continuation: { mode: options.continuation ?? "manual" }
20712
20722
  };
20713
20723
  const bounds = {};
@@ -20723,7 +20733,7 @@ async function runGoalsCreate(ctx, argv) {
20723
20733
  }
20724
20734
  if (options.timeoutMs !== void 0) {
20725
20735
  const t = Number(options.timeoutMs);
20726
- if (!Number.isInteger(t) || t < 0) throw new CliError("--timeout-ms must be a non-negative integer (milliseconds)", 2);
20736
+ if (!Number.isInteger(t) || t <= 0) throw new CliError("--timeout-ms must be a positive integer (milliseconds)", 2);
20727
20737
  bounds.runTimeoutMs = t;
20728
20738
  }
20729
20739
  if (Object.keys(bounds).length) body.bounds = bounds;
@@ -20732,8 +20742,8 @@ async function runGoalsCreate(ctx, argv) {
20732
20742
  try {
20733
20743
  res = await requestJson(ctx, "/v1/host/openwop-app/goals", { method: "POST", body });
20734
20744
  } catch (err) {
20735
- if (err instanceof HttpError && err.status === 422) {
20736
- const detail2 = err.body?.message ?? "this host requires bounds on an active goal \u2014 pass --max-iterations, --max-cost, and/or --timeout-ms";
20745
+ if (err instanceof HttpError && (err.status === 422 || err.status === 400)) {
20746
+ const detail2 = err.body?.message ?? (err.status === 422 ? "this host requires bounds on an active goal \u2014 pass --max-iterations, --max-cost, and/or --timeout-ms" : "the host refused the goal as malformed");
20737
20747
  throw new CliError(`goals: ${detail2}`, 1);
20738
20748
  }
20739
20749
  gate4045(err);
@@ -20743,7 +20753,7 @@ async function runGoalsCreate(ctx, argv) {
20743
20753
  writeJson(ctx.io.stdout, g);
20744
20754
  return exitForState2(g.state);
20745
20755
  }
20746
- writeLine(ctx.io.stdout, `\u2713 Created goal ${g.goalId ?? g.id ?? ""} (state ${g.state ?? "active"}, check ${g.completion?.check ?? options.judge ?? "host"}).`);
20756
+ writeLine(ctx.io.stdout, `\u2713 Created goal ${g.goalId ?? g.id ?? ""} (state ${g.state ?? "active"}, check ${g.completion?.check ?? "verifier"}).`);
20747
20757
  return exitForState2(g.state);
20748
20758
  }
20749
20759
  async function runGoalsTransition(ctx, argv, verb) {
package/dist/openwop.js CHANGED
@@ -579,7 +579,7 @@ function errText(err) {
579
579
  // package.json
580
580
  var package_default = {
581
581
  name: "@openwop/cli",
582
- version: "1.7.0",
582
+ version: "1.8.0",
583
583
  description: "OpenWOP CLI for operating the workflow-engine demo app and OpenWOP-compatible hosts.",
584
584
  license: "Apache-2.0",
585
585
  type: "module",
@@ -20501,7 +20501,7 @@ var GOALS_ROUTES = [
20501
20501
  var GOALS_HELP = `Usage:
20502
20502
  openwop goals list [--state <s>] [--json]
20503
20503
  openwop goals get <goalId> [--json]
20504
- openwop goals create --objective <text> [--judge host|verifier] [--continuation <mode>]
20504
+ openwop goals create --objective <text> --verifier-ref <ref> [--continuation schedule|manual]
20505
20505
  [--max-iterations <n>] [--max-cost <usd>] [--timeout-ms <ms>] [--json]
20506
20506
  openwop goals pause <goalId> [--json]
20507
20507
  openwop goals resume <goalId> [--json]
@@ -20528,13 +20528,16 @@ Endpoints:
20528
20528
  resume POST /v1/host/openwop-app/goals/{id}/resume
20529
20529
  abandon POST /v1/host/openwop-app/goals/{id}/abandon
20530
20530
 
20531
- --state <s> (list) Filter by state (e.g. active, satisfied, escalated, bound-exceeded, paused).
20531
+ --state <s> (list) Filter by state: active, satisfied, escalated, abandoned, bound-exceeded.
20532
20532
  --objective <text> (create) The goal objective (required).
20533
- --judge host|verifier (create) completion.check \u2014 who decides completion (default: host).
20534
- --continuation <mode> (create) continuation.mode \u2014 the arm that re-engages work (e.g. schedule | commitment | manual).
20535
- --max-iterations <n> (create) Bound: bounds.maxLoopIterations.
20533
+ --verifier-ref <ref> (create) completion.verifierRef \u2014 the verifier registered on the host that
20534
+ judges this goal (required; the host refuses a ref it has not registered).
20535
+ --judge verifier (create) completion.check \u2014 who decides completion. 'verifier' is the only
20536
+ judge a host advertising agents.goals.judge=verifier honours (the default).
20537
+ --continuation <mode> (create) continuation.mode \u2014 schedule | manual (default: manual).
20538
+ --max-iterations <n> (create) Bound: bounds.maxLoopIterations (positive integer).
20536
20539
  --max-cost <usd> (create) Bound: bounds.maxCostUsd (accumulated USD).
20537
- --timeout-ms <ms> (create) Bound: bounds.runTimeoutMs (wall-clock, milliseconds).
20540
+ --timeout-ms <ms> (create) Bound: bounds.runTimeoutMs (wall-clock, positive milliseconds).
20538
20541
  --yes (abandon) Required to confirm.
20539
20542
  --json Print the raw host response instead of the rendered view.
20540
20543
 
@@ -20544,13 +20547,14 @@ termination guarantee (bounds).
20544
20547
 
20545
20548
  Exit codes (get/create/pause/resume reflect the goal's state, so scripts can gate
20546
20549
  on the verdict):
20547
- 0 satisfied 3 escalated or still open (active/paused) 1 bound-exceeded/abandoned or error
20550
+ 0 satisfied 3 escalated or still open (active) 1 bound-exceeded/abandoned or error
20551
+ A paused goal is still 'active' (pause stops its continuation, not the goal).
20548
20552
  \`list\` exits 0 on success.
20549
20553
 
20550
20554
  Examples:
20551
20555
  openwop goals list --state active
20552
20556
  openwop goals get goal_123 --json
20553
- openwop goals create --objective "Keep the triage backlog under 20" --judge verifier --continuation schedule --max-iterations 50 --max-cost 5.00 --timeout-ms 600000
20557
+ openwop goals create --objective "Keep the triage backlog under 20" --verifier-ref <ref> --continuation schedule --max-iterations 50 --max-cost 5.00 --timeout-ms 600000
20554
20558
  openwop goals pause goal_123
20555
20559
  openwop goals abandon goal_123 --yes
20556
20560
  `;
@@ -20696,18 +20700,24 @@ function renderGoal(ctx, g, fallbackId) {
20696
20700
  async function runGoalsCreate(ctx, argv) {
20697
20701
  const { options } = parseOptions(argv, {
20698
20702
  bool: ["--help"],
20699
- value: ["--objective", "--judge", "--continuation", "--max-iterations", "--max-cost", "--timeout-ms"]
20703
+ value: ["--objective", "--judge", "--verifier-ref", "--continuation", "--max-iterations", "--max-cost", "--timeout-ms"]
20700
20704
  });
20701
20705
  if (options.help || !options.objective) {
20702
- write(ctx.io.stdout, "Usage: openwop goals create --objective <text> [--judge host|verifier] [--continuation <mode>] [--max-iterations <n>] [--max-cost <usd>] [--timeout-ms <ms>] [--json]\n");
20706
+ write(ctx.io.stdout, "Usage: openwop goals create --objective <text> --verifier-ref <ref> [--continuation schedule|manual] [--max-iterations <n>] [--max-cost <usd>] [--timeout-ms <ms>] [--json]\n");
20703
20707
  return options.help ? 0 : 2;
20704
20708
  }
20705
- if (options.judge !== void 0 && !["host", "verifier"].includes(options.judge)) {
20706
- throw new CliError("--judge must be one of: host, verifier", 2);
20709
+ if (options.judge !== void 0 && options.judge !== "verifier") {
20710
+ throw new CliError("--judge must be: verifier", 2);
20711
+ }
20712
+ if (!options.verifierRef) {
20713
+ throw new CliError("goals create needs --verifier-ref <ref> \u2014 the verifier registered on the host that judges the goal", 2);
20714
+ }
20715
+ if (options.continuation !== void 0 && !["schedule", "manual"].includes(options.continuation)) {
20716
+ throw new CliError("--continuation must be one of: schedule, manual", 2);
20707
20717
  }
20708
20718
  const body = {
20709
20719
  objective: options.objective,
20710
- completion: { check: options.judge ?? "host" },
20720
+ completion: { check: "verifier", verifierRef: options.verifierRef },
20711
20721
  continuation: { mode: options.continuation ?? "manual" }
20712
20722
  };
20713
20723
  const bounds = {};
@@ -20723,7 +20733,7 @@ async function runGoalsCreate(ctx, argv) {
20723
20733
  }
20724
20734
  if (options.timeoutMs !== void 0) {
20725
20735
  const t = Number(options.timeoutMs);
20726
- if (!Number.isInteger(t) || t < 0) throw new CliError("--timeout-ms must be a non-negative integer (milliseconds)", 2);
20736
+ if (!Number.isInteger(t) || t <= 0) throw new CliError("--timeout-ms must be a positive integer (milliseconds)", 2);
20727
20737
  bounds.runTimeoutMs = t;
20728
20738
  }
20729
20739
  if (Object.keys(bounds).length) body.bounds = bounds;
@@ -20732,8 +20742,8 @@ async function runGoalsCreate(ctx, argv) {
20732
20742
  try {
20733
20743
  res = await requestJson(ctx, "/v1/host/openwop-app/goals", { method: "POST", body });
20734
20744
  } catch (err) {
20735
- if (err instanceof HttpError && err.status === 422) {
20736
- const detail2 = err.body?.message ?? "this host requires bounds on an active goal \u2014 pass --max-iterations, --max-cost, and/or --timeout-ms";
20745
+ if (err instanceof HttpError && (err.status === 422 || err.status === 400)) {
20746
+ const detail2 = err.body?.message ?? (err.status === 422 ? "this host requires bounds on an active goal \u2014 pass --max-iterations, --max-cost, and/or --timeout-ms" : "the host refused the goal as malformed");
20737
20747
  throw new CliError(`goals: ${detail2}`, 1);
20738
20748
  }
20739
20749
  gate4045(err);
@@ -20743,7 +20753,7 @@ async function runGoalsCreate(ctx, argv) {
20743
20753
  writeJson(ctx.io.stdout, g);
20744
20754
  return exitForState2(g.state);
20745
20755
  }
20746
- writeLine(ctx.io.stdout, `\u2713 Created goal ${g.goalId ?? g.id ?? ""} (state ${g.state ?? "active"}, check ${g.completion?.check ?? options.judge ?? "host"}).`);
20756
+ writeLine(ctx.io.stdout, `\u2713 Created goal ${g.goalId ?? g.id ?? ""} (state ${g.state ?? "active"}, check ${g.completion?.check ?? "verifier"}).`);
20747
20757
  return exitForState2(g.state);
20748
20758
  }
20749
20759
  async function runGoalsTransition(ctx, argv, verb) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openwop/cli",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "OpenWOP CLI for operating the workflow-engine demo app and OpenWOP-compatible hosts.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",