@opennous/cli 0.19.0 → 0.19.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @opennous/cli changelog
2
2
 
3
+ ## 0.19.1
4
+
5
+ ### Changed: the first history read goes as far back as your workspace chose
6
+
7
+ The runner's own first read of your history used six months. It now uses the range picked in
8
+ onboarding: 3 months by default, or 6 or 12 (GET-1328).
9
+
3
10
  ## 0.19.0
4
11
 
5
12
  ### Added: read on your own API key
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opennous/cli",
3
- "version": "0.19.0",
3
+ "version": "0.19.2",
4
4
  "description": "Ownable CLI — set up Ownable, connect it to your coding agent, and read the Context API from your terminal",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -695,9 +695,10 @@ runnerCmd
695
695
  .option("--api-key", "read on your own Anthropic or OpenAI API key instead of your plan (asked for once, kept only on this machine)")
696
696
  .option("--workspace <id>", "the workspace to read; the app's command fills this in")
697
697
  .option("--url <url>", "API base URL (default: https://api.opennous.cloud)")
698
- .action(async (opts) => {
698
+ .action(async (own, cmd) => {
699
699
  const { detectAgents, installedAgents, NO_AGENT } = await import("./backfill.js");
700
- const { installService } = await import("./runner.js");
700
+ const { installService, withParentOpts } = await import("./runner.js");
701
+ const opts = withParentOpts(cmd, own);
701
702
  const agent = await pickAgent(opts.agent, opts.apiKey ? installedAgents : detectAgents, NO_AGENT);
702
703
  // Your own API key (GET-1310): from the environment, or asked for now, and kept in ~/.nous (yours only).
703
704
  if (opts.apiKey) await saveModelKey(agent);
package/src/runner.js CHANGED
@@ -120,9 +120,11 @@ export async function runRunner({ api, agent, host = hostname(), version = null,
120
120
  // read itself, on this plan, and answers its calls like any other.
121
121
  if (page.needs_backfill && api.startBackfill && now() - backfillAt >= BACKFILL_RETRY_MS) {
122
122
  backfillAt = now();
123
+ // How far back comes from the workspace (GET-1328: 3 months unless they chose 6 or 12).
124
+ const days = Number(page.backfill_days) > 0 ? Number(page.backfill_days) : BACKFILL_DAYS;
123
125
  try {
124
- await api.startBackfill({ days: BACKFILL_DAYS, confirm: "yes" });
125
- log(`Reading your last ${BACKFILL_DAYS / 30} months of calls and email on your plan. This can take a while; everything new is read after.`);
126
+ await api.startBackfill({ days, confirm: "yes" });
127
+ log(`Reading your last ${Math.round(days / 30)} months of calls and email on your plan. This can take a while; everything new is read after.`);
126
128
  } catch (err) {
127
129
  log(`Your history read can't start yet (${err.message}). Trying again in ${BACKFILL_RETRY_MS / 60000} minutes.`);
128
130
  }
@@ -259,3 +261,14 @@ export function serviceStatus({ run = spawnSync, os = platform(), home = homedir
259
261
  : run("systemctl", ["--user", "is-active", "opennous-runner.service"], { encoding: "utf8" });
260
262
  return { installed: true, running: r.status === 0, ...where };
261
263
  }
264
+
265
+ /**
266
+ * A subcommand's options plus its parent's. `runner` and `runner install` both take --agent,
267
+ * --workspace, --api-key and --url, and commander gives a flag to the parent when both define it,
268
+ * so `runner install --agent codex --workspace X` reached install with neither (GET-1345).
269
+ */
270
+ export function withParentOpts(cmd, opts = cmd.opts()) {
271
+ const parent = cmd.parent?.opts?.() ?? {};
272
+ const own = Object.fromEntries(Object.entries(opts).filter(([, v]) => v !== undefined));
273
+ return { ...parent, ...own };
274
+ }