tines 0.0.169 → 0.0.170

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
@@ -5,6 +5,10 @@ built for humans and their agents: work moves through workflows, every action is
5
5
  record, and a supervisor hands eligible issues to agents. This package talks to the same
6
6
  HTTP API the web app uses.
7
7
 
8
+ Awaiting-session continuation policy fields are staged and default off. Runtime continuation is
9
+ unavailable until support for the runner's provider is released; configuring thresholds does not
10
+ enable continuation.
11
+
8
12
  ```sh
9
13
  npm install -g tines # or, one-shot with no install:
10
14
  npx -y tines --help
package/dist/index.js CHANGED
@@ -3474,6 +3474,10 @@ function parsePrSpec(spec) {
3474
3474
  }
3475
3475
  var MODEL_TIERS = ["smartest", "balanced", "cheapest"];
3476
3476
  var RUNNER_ONLINE_WINDOW_MS = 2 * 60 * 1e3;
3477
+ var DEFAULT_RESUME_WINDOW_HOURS = 48;
3478
+ var DEFAULT_RESUME_MAX_TURNS = 25;
3479
+ var DEFAULT_RESUME_MAX_TOKENS = 1e5;
3480
+ var DEFAULT_RESUME_MAX_COST_USD = 2;
3477
3481
  var RUNNER_OFFLINE_FAIL_MS = 5 * 60 * 1e3;
3478
3482
  var LAUNCH_STALL_MS = 5 * 60 * 1e3;
3479
3483
  var RUN_KEY_SLACK_MS = 10 * 60 * 1e3;
@@ -4436,7 +4440,7 @@ function runRow(run) {
4436
4440
  run.issue_ref ? issueRef(run.issue_ref) : run.issue_id,
4437
4441
  run.runner_name,
4438
4442
  `${run.tier}${run.model ? ` (${run.model})` : ""}`,
4439
- run.status,
4443
+ `${run.status}${run.resumed_from_run_id ? ` \xB7 resumed run ${run.resumed_from_run_id}` : ""}`,
4440
4444
  runDurationLabel(run),
4441
4445
  runCostLabel(run) ?? "\u2014",
4442
4446
  timestamp(run.created_at)
@@ -8461,6 +8465,29 @@ function runGit(args, cwd, batcher) {
8461
8465
  }
8462
8466
 
8463
8467
  // src/commands/runners.ts
8468
+ function parseBoolean(value) {
8469
+ if (value === "true") return true;
8470
+ if (value === "false") return false;
8471
+ throw new InvalidArgumentError("must be true or false");
8472
+ }
8473
+ function boundedInteger(min, max) {
8474
+ return (value) => {
8475
+ if (!/^\d+$/.test(value))
8476
+ throw new InvalidArgumentError(`must be an integer between ${min} and ${max}`);
8477
+ const parsed = Number(value);
8478
+ if (!Number.isSafeInteger(parsed) || parsed < min || parsed > max) {
8479
+ throw new InvalidArgumentError(`must be an integer between ${min} and ${max}`);
8480
+ }
8481
+ return parsed;
8482
+ };
8483
+ }
8484
+ function resumeCost(value) {
8485
+ const parsed = Number(value);
8486
+ if (!Number.isFinite(parsed) || parsed <= 0 || parsed > 1e3) {
8487
+ throw new InvalidArgumentError("must be greater than 0 and at most 1000");
8488
+ }
8489
+ return parsed;
8490
+ }
8464
8491
  function printTierTable(runner) {
8465
8492
  if (!runner.tier_models && !runner.tiers) {
8466
8493
  console.log("tiers: don't apply to this runner (fixed configuration)");
@@ -8527,6 +8554,12 @@ function register8(program3) {
8527
8554
  if (runner.type !== "local") {
8528
8555
  console.log(`api key: ${runner.has_api_key ? "set (write-only)" : "missing"}`);
8529
8556
  }
8557
+ console.log(
8558
+ `resume awaiting sessions: ${runner.resume_enabled ?? false ? "enabled" : "disabled"} window: ${runner.resume_window_hours ?? DEFAULT_RESUME_WINDOW_HOURS}h (staged; runtime continuation unavailable)`
8559
+ );
8560
+ console.log(
8561
+ `resume limits: ${runner.resume_max_turns ?? DEFAULT_RESUME_MAX_TURNS} local turns ${(runner.resume_max_tokens ?? DEFAULT_RESUME_MAX_TOKENS).toLocaleString()} managed tokens $${runner.resume_max_cost_usd ?? DEFAULT_RESUME_MAX_COST_USD} managed cost`
8562
+ );
8530
8563
  if (runner.budget) {
8531
8564
  const b = runner.budget;
8532
8565
  const parts = [];
@@ -8540,6 +8573,39 @@ function register8(program3) {
8540
8573
  printTierTable(runner);
8541
8574
  }
8542
8575
  );
8576
+ withCommon(
8577
+ runners.command("edit <name>").description("Edit staged awaiting-session continuation policy (runtime unavailable)").option(
8578
+ "--resume-enabled <true|false>",
8579
+ "stage opt-in policy (enabling is unavailable until provider support ships)",
8580
+ parseBoolean
8581
+ ).option("--resume-window-hours <n>", "continuation window (1-168)", boundedInteger(1, 168)).option(
8582
+ "--resume-max-turns <n>",
8583
+ "local conversation turn limit (1-1000)",
8584
+ boundedInteger(1, 1e3)
8585
+ ).option(
8586
+ "--resume-max-tokens <n>",
8587
+ "managed conversation token limit (1-10000000)",
8588
+ boundedInteger(1, 1e7)
8589
+ ).option("--resume-max-cost-usd <n>", "managed conversation cost limit (0-1000]", resumeCost)
8590
+ ).action(
8591
+ async (ref, opts) => {
8592
+ const patch = {
8593
+ ...opts.resumeEnabled !== void 0 ? { resume_enabled: opts.resumeEnabled } : {},
8594
+ ...opts.resumeWindowHours !== void 0 ? { resume_window_hours: opts.resumeWindowHours } : {},
8595
+ ...opts.resumeMaxTurns !== void 0 ? { resume_max_turns: opts.resumeMaxTurns } : {},
8596
+ ...opts.resumeMaxTokens !== void 0 ? { resume_max_tokens: opts.resumeMaxTokens } : {},
8597
+ ...opts.resumeMaxCostUsd !== void 0 ? { resume_max_cost_usd: opts.resumeMaxCostUsd } : {}
8598
+ };
8599
+ if (Object.keys(patch).length === 0) die("provide at least one resume setting");
8600
+ const api = client(opts);
8601
+ const runner = await resolveRunner(api, ref);
8602
+ const updated = await api.updateRunner(runner.id, patch);
8603
+ if (opts.json) return printJson(updated);
8604
+ console.log(
8605
+ `updated runner "${updated.name}"; awaiting-session resume is ${updated.resume_enabled ? "enabled" : "disabled"}`
8606
+ );
8607
+ }
8608
+ );
8543
8609
  withCommon(
8544
8610
  runners.command("tiers <name>").description("Show or edit a runner's tier\u2192model mapping").option("--default <tier>", "set the default tier (used by targets without an explicit tier)").option("--set <tier=model...>", "override a tier with an exact model id (repeatable)").option("--unset <tier...>", "drop an override, falling back to the built-in (repeatable)")
8545
8611
  ).action(
@@ -8836,7 +8902,9 @@ function register8(program3) {
8836
8902
  const api = client(opts);
8837
8903
  const run = await api.getRun(id);
8838
8904
  if (opts.json) return printJson(run);
8839
- console.log(`${run.id} ${run.status} on ${run.runner_name}`);
8905
+ console.log(
8906
+ `${run.id} ${run.status} on ${run.runner_name}${run.resumed_from_run_id ? ` \xB7 resumed run ${run.resumed_from_run_id}` : ""}`
8907
+ );
8840
8908
  if (run.issue_ref) console.log(`issue: ${issueRef(run.issue_ref)} \u2014 ${run.issue_ref.title}`);
8841
8909
  console.log(`tier: ${run.tier} model: ${run.model ?? "(n/a)"}`);
8842
8910
  console.log(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tines",
3
- "version": "0.0.169",
3
+ "version": "0.0.170",
4
4
  "description": "CLI for Tines, an orchestration layer for AI agents",
5
5
  "repository": {
6
6
  "type": "git",