@erdoai/cli 0.211.0 → 0.213.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.
Files changed (2) hide show
  1. package/dist/index.js +22 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2302,7 +2302,12 @@ var ErdoClient = class {
2302
2302
  }
2303
2303
  // --- automations (heartbeats) ---
2304
2304
  listHeartbeats(opts = {}) {
2305
- return this.request("GET", opts.includeRefresh ? "/v1/heartbeats?include_refresh=true" : "/v1/heartbeats");
2305
+ const query = new URLSearchParams();
2306
+ if (opts.includeRefresh) query.set("include_refresh", "true");
2307
+ if (opts.limit !== void 0) query.set("limit", String(opts.limit));
2308
+ if (opts.offset !== void 0) query.set("offset", String(opts.offset));
2309
+ const suffix = query.toString() ? `?${query.toString()}` : "";
2310
+ return this.request("GET", `/v1/heartbeats${suffix}`);
2306
2311
  }
2307
2312
  createHeartbeat(body) {
2308
2313
  return this.request("POST", "/v1/heartbeats", body);
@@ -2458,10 +2463,11 @@ var ErdoClient = class {
2458
2463
  { reason, organization_slug }
2459
2464
  );
2460
2465
  }
2461
- getDecision(slug) {
2466
+ getDecision(slug, organization_slug) {
2467
+ const query = organization_slug ? `?organization_slug=${encodeURIComponent(organization_slug)}` : "";
2462
2468
  return this.request(
2463
2469
  "GET",
2464
- `/v1/decisions/${encodeURIComponent(slug)}`
2470
+ `/v1/decisions/${encodeURIComponent(slug)}${query}`
2465
2471
  );
2466
2472
  }
2467
2473
  // Raw aggregates with their denominators — no eligibility verdict, and no single
@@ -5254,7 +5260,7 @@ thread: ${res.thread_id}`);
5254
5260
  fail(e);
5255
5261
  }
5256
5262
  });
5257
- agentCmd.command("send <threadId> <message>").description("Send a message to a thread and print the agent's reply; message accepts @path to a UTF-8 file").option("-a, --agent <key>", "agent to invoke (e.g. erdo.artifact-builder)").option(
5263
+ agentCmd.command("send <threadId> <message>").description("Send a message to a thread and print the agent's reply; message accepts @path to a UTF-8 file").option("-a, --agent <key>", "agent to invoke (e.g. erdo.artifact-builder)").option("--model <id>", "model to use for this turn; empty uses the agent default").option(
5258
5264
  "--context <text>",
5259
5265
  "application context for this turn, or @path to a UTF-8 file; omitted from the visible user message"
5260
5266
  ).option(
@@ -5268,6 +5274,7 @@ agentCmd.command("send <threadId> <message>").description("Send a message to a t
5268
5274
  message: readMaybeFile(message) ?? "",
5269
5275
  context: readMaybeFile(opts.context),
5270
5276
  agent_key: opts.agent,
5277
+ model: opts.model,
5271
5278
  async: !opts.sync,
5272
5279
  read_only: opts.readOnly
5273
5280
  });
@@ -5886,9 +5893,9 @@ decisionsCmd.command("retire <slug>").description("End a standing workstream com
5886
5893
  });
5887
5894
  decisionsCmd.command("show <slug>").description(
5888
5895
  "Show one decision in full: the commitment and its authority, every exact action it authorized with how each one ended, every declared effect with the evidence that settled it, and what it replaced or was replaced by"
5889
- ).option("--json", "output raw JSON").action(async (slug, opts) => {
5896
+ ).option("--organization <slug>", "read a decision of an authorized client organization (default: active organization)").option("--json", "output raw JSON").action(async (slug, opts) => {
5890
5897
  try {
5891
- const detail = await new ErdoClient().getDecision(slug);
5898
+ const detail = await new ErdoClient().getDecision(slug, opts.organization);
5892
5899
  if (opts.json) {
5893
5900
  print(detail);
5894
5901
  return;
@@ -11019,9 +11026,15 @@ autoCmd.command("create <name>").description(
11019
11026
  }
11020
11027
  }
11021
11028
  );
11022
- autoCmd.command("list").description("List automations").option("--include-refresh", "Also list dataset refresh jobs with their state, including auto-paused ones and any that will pause soon").action(async (opts) => {
11023
- try {
11024
- const { heartbeats, refreshes } = await new ErdoClient().listHeartbeats({ includeRefresh: opts.includeRefresh });
11029
+ autoCmd.command("list").description("List automations").option("--include-refresh", "Also list dataset refresh jobs with their state, including auto-paused ones and any that will pause soon").option("--limit <n>", "Number of automations to return").option("--offset <n>", "Number of automations to skip", "0").action(async (opts) => {
11030
+ try {
11031
+ const rawLimit = opts.limit;
11032
+ const limit = rawLimit === void 0 ? void 0 : Number(rawLimit);
11033
+ const offset = Number(opts.offset);
11034
+ if (rawLimit !== void 0 && (!/^\d+$/.test(rawLimit) || limit === void 0 || limit < 1 || limit > 50)) throw new Error("limit must be an integer between 1 and 50");
11035
+ if (!/^\d+$/.test(opts.offset) || !Number.isInteger(offset) || offset < 0) throw new Error("offset must be a non-negative integer");
11036
+ const { heartbeats, refreshes, has_more } = await new ErdoClient().listHeartbeats({ includeRefresh: opts.includeRefresh, limit, offset: offset || void 0 });
11037
+ if (has_more) console.error(`more automations exist: rerun with --offset ${offset + heartbeats.length}`);
11025
11038
  for (const h of heartbeats) console.log(`${h.id} ${h.state} ${h.name} ${h.kind === "script" ? "script" : h.thread_id ? `thread:${h.thread_id}` : h.conversation ?? "new"}${h.persona_id ? ` persona:${h.persona_id}` : ""}${h.model ? ` model:${h.model}` : ""}${heartbeatBounds(h)}`);
11026
11039
  if (opts.includeRefresh) {
11027
11040
  for (const r of refreshes ?? []) console.log(formatRefreshJobRow(r));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.211.0",
3
+ "version": "0.213.0",
4
4
  "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {