@drisp/cli 0.7.14 → 0.7.15

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runMachineRunners
3
- } from "./chunk-HCTFAAGU.js";
3
+ } from "./chunk-YXDCO7SI.js";
4
4
 
5
5
  // src/app/entry/runnerDaemon.ts
6
6
  if (process.argv.includes("--help")) {
@@ -13,4 +13,4 @@ if (process.argv.includes("--help")) {
13
13
  process.exitCode = 1;
14
14
  });
15
15
  }
16
- //# sourceMappingURL=chunk-3LF5QYZK.js.map
16
+ //# sourceMappingURL=chunk-PAPYHUIO.js.map
@@ -18649,6 +18649,21 @@ var ExecutionStore = class {
18649
18649
  close() {
18650
18650
  this.sql.close();
18651
18651
  }
18652
+ /** Earlier admitted attempts retain the Hub-issued budgets used by a parked Run's saved identity. */
18653
+ priorGrants(grant) {
18654
+ return this.sql.query(
18655
+ `SELECT payload FROM received WHERE state='admitted'
18656
+ AND json_extract(payload,'$.runId')=? AND json_extract(payload,'$.sessionId')=?
18657
+ AND json_extract(payload,'$.hubEpoch')=? AND json_extract(payload,'$.runnerId')=?
18658
+ AND json_extract(payload,'$.installationId')=? AND json_extract(payload,'$.generation')<? ORDER BY rowid DESC`,
18659
+ grant.runId,
18660
+ grant.sessionId,
18661
+ grant.hubEpoch,
18662
+ grant.runnerId,
18663
+ grant.installationId,
18664
+ grant.generation
18665
+ ).map((row) => grantSchema.parse(JSON.parse(row.payload)));
18666
+ }
18652
18667
  transaction(fn) {
18653
18668
  return this.sql.transaction(fn);
18654
18669
  }
@@ -19923,7 +19938,7 @@ async function restoreCheckpoint(store, input) {
19923
19938
 
19924
19939
  // ../../modules/runtime/src/software-version.ts
19925
19940
  import "fs";
19926
- var runnerSoftwareVersion = true ? "0.7.14" : JSON.parse(readFileSync2(new URL("../../../apps/cli/package.json", import.meta.url), "utf8")).version;
19941
+ var runnerSoftwareVersion = true ? "0.7.15" : JSON.parse(readFileSync2(new URL("../../../apps/cli/package.json", import.meta.url), "utf8")).version;
19927
19942
 
19928
19943
  // ../../modules/runtime/src/connection.ts
19929
19944
  var runnerCapabilities = [
@@ -23384,24 +23399,50 @@ function startWorkflowExecution(input, options = {}) {
23384
23399
  "The requested Workflow Run is not the current parked Run for this session."
23385
23400
  );
23386
23401
  }
23387
- const identity = executionIdentity({
23402
+ const identityInput = {
23388
23403
  projectDir: input.projectDir,
23389
23404
  harness: input.harness ?? "claude-code",
23390
23405
  workflow: input.workflow,
23391
23406
  isolationConfig: options.isolationConfig,
23392
23407
  workflowPlan: options.workflowPlan,
23393
23408
  pluginMcpConfig: options.pluginMcpConfig
23394
- });
23409
+ };
23410
+ const identity = executionIdentity(identityInput);
23395
23411
  if (resume?.runMemoryJson && !deserializeRunMemory(resume.runMemoryJson))
23396
23412
  throw new Error(
23397
23413
  "Saved workflow memory is unreadable; refusing to reset continuation budgets."
23398
23414
  );
23399
23415
  if (resume) {
23400
- const warning = validateResumeIdentity(
23401
- resume,
23402
- identity,
23403
- input.workflow?.name
23404
- );
23416
+ const check2 = () => {
23417
+ try {
23418
+ return validateResumeIdentity(resume, identity, input.workflow?.name);
23419
+ } catch (error) {
23420
+ if (input.workflow?.loop) {
23421
+ for (const budget of options.resumeTokenBudgets ?? []) {
23422
+ const previousIdentity = executionIdentity({
23423
+ ...identityInput,
23424
+ workflow: {
23425
+ ...input.workflow,
23426
+ loop: {
23427
+ ...input.workflow.loop,
23428
+ maxRunTokens: budget.maxRunTokens
23429
+ }
23430
+ }
23431
+ });
23432
+ try {
23433
+ return validateResumeIdentity(
23434
+ resume,
23435
+ previousIdentity,
23436
+ input.workflow.name
23437
+ );
23438
+ } catch {
23439
+ }
23440
+ }
23441
+ }
23442
+ throw error;
23443
+ }
23444
+ };
23445
+ const warning = check2();
23405
23446
  if (warning) input.onWarning?.(warning);
23406
23447
  }
23407
23448
  const resources = createExecutionResources();
@@ -26747,6 +26788,7 @@ async function runOwnedExecution(options, resources) {
26747
26788
  {
26748
26789
  store,
26749
26790
  isolationConfig: options.isolationConfig,
26791
+ resumeTokenBudgets: options.resumeTokenBudgets,
26750
26792
  workflowPlan: options.workflowPlan,
26751
26793
  pluginMcpConfig: options.pluginMcpConfig,
26752
26794
  runtime,
@@ -29259,6 +29301,7 @@ function createWorkflowExecutor(dependencies = {}) {
29259
29301
  if (refusal) throw new RunSetupError(BUILD_SETTINGS_NEED_LOOP, refusal);
29260
29302
  const stop = loop ? runTokenStop(loop.maxRunTokens, grant) : void 0;
29261
29303
  const boundedLoop = loop && stop !== loop.maxRunTokens ? { ...loop, maxRunTokens: stop } : loop;
29304
+ const resumeTokenBudgets2 = grant.purpose === "resume" && (grant.tokenBudget ?? grant.spec.tokenBudget) !== void 0 ? [...new Set(store.priorGrants(grant).map((prior) => runTokenStop(loop?.maxRunTokens, prior)))].map((maxRunTokens) => ({ maxRunTokens })) : void 0;
29262
29305
  const config2 = {
29263
29306
  ...bootstrapped,
29264
29307
  isolationConfig: {
@@ -29363,7 +29406,8 @@ ${prompt2}`;
29363
29406
  displayText: displayText2,
29364
29407
  sweepArtifacts: sweepArtifacts2,
29365
29408
  usage: usage2,
29366
- reportLiveUsage: reportLiveUsage2
29409
+ reportLiveUsage: reportLiveUsage2,
29410
+ resumeTokenBudgets: resumeTokenBudgets2
29367
29411
  };
29368
29412
  };
29369
29413
  let setup2;
@@ -29386,7 +29430,8 @@ ${prompt2}`;
29386
29430
  displayText,
29387
29431
  sweepArtifacts,
29388
29432
  usage,
29389
- reportLiveUsage
29433
+ reportLiveUsage,
29434
+ resumeTokenBudgets
29390
29435
  } = setup2;
29391
29436
  const queue = createSteerQueue();
29392
29437
  queues.set(grant.runId, queue);
@@ -29449,6 +29494,7 @@ ${prompt2}`;
29449
29494
  runId: grant.runId,
29450
29495
  athenaSessionId: grant.sessionId,
29451
29496
  ...grant.purpose === "resume" ? { resumeRunId: grant.runId } : {},
29497
+ ...resumeTokenBudgets ? { resumeTokenBudgets } : {},
29452
29498
  ...adapterResumeSessionId ? { adapterResumeSessionId } : {},
29453
29499
  isolationConfig,
29454
29500
  pluginMcpConfig: config.pluginMcpConfig,
@@ -30145,4 +30191,4 @@ export {
30145
30191
  runMachineRunners,
30146
30192
  writeIdentityOnce
30147
30193
  };
30148
- //# sourceMappingURL=chunk-HCTFAAGU.js.map
30194
+ //# sourceMappingURL=chunk-YXDCO7SI.js.map
package/dist/cli.js CHANGED
@@ -297,7 +297,7 @@ import {
297
297
  workVerificationAttemptSchema,
298
298
  wrapText,
299
299
  writeIdentityOnce
300
- } from "./chunk-HCTFAAGU.js";
300
+ } from "./chunk-YXDCO7SI.js";
301
301
  import {
302
302
  generateId as generateId2
303
303
  } from "./chunk-PQIB66SG.js";
@@ -1,5 +1,5 @@
1
- import "./chunk-3LF5QYZK.js";
2
- import "./chunk-HCTFAAGU.js";
1
+ import "./chunk-PAPYHUIO.js";
2
+ import "./chunk-YXDCO7SI.js";
3
3
  import "./chunk-PQIB66SG.js";
4
4
  import "./chunk-GGAPZULS.js";
5
5
  import "./chunk-G3PMV62Z.js";
package/dist/runner.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./chunk-3LF5QYZK.js";
2
- import "./chunk-HCTFAAGU.js";
1
+ import "./chunk-PAPYHUIO.js";
2
+ import "./chunk-YXDCO7SI.js";
3
3
  import "./chunk-PQIB66SG.js";
4
4
  import "./chunk-GGAPZULS.js";
5
5
  import "./chunk-G3PMV62Z.js";
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "hooks",
18
18
  "dashboard"
19
19
  ],
20
- "version": "0.7.14",
20
+ "version": "0.7.15",
21
21
  "license": "MIT",
22
22
  "bin": {
23
23
  "athena": "dist/cli.js",