@drisp/cli 0.7.4 → 0.7.5

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.
@@ -8,7 +8,7 @@ import {
8
8
  installWorkflowPlugins,
9
9
  resolveWorkflow,
10
10
  writeGlobalConfig
11
- } from "./chunk-TSIMXPJN.js";
11
+ } from "./chunk-UQWOGG3L.js";
12
12
  import "./chunk-G3PMV62Z.js";
13
13
 
14
14
  // src/setup/steps/WorkflowInstallWizard.tsx
@@ -93,4 +93,4 @@ function WorkflowInstallWizard({ source, onDone }) {
93
93
  export {
94
94
  WorkflowInstallWizard as default
95
95
  };
96
- //# sourceMappingURL=WorkflowInstallWizard-AJYDKFDL.js.map
96
+ //# sourceMappingURL=WorkflowInstallWizard-4GRQGM42.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runMachineRunners
3
- } from "./chunk-XG7B4OOC.js";
3
+ } from "./chunk-TG5EGPD2.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-F6XUMTMC.js.map
16
+ //# sourceMappingURL=chunk-N4B7HLBN.js.map
@@ -19,7 +19,6 @@ import {
19
19
  BUILD_STRINGS,
20
20
  DEFAULT_PERMISSION_GRACE_MS,
21
21
  LAYOUT_MARKERS,
22
- ORCHESTRATOR_LIMITS,
23
22
  ORCHESTRATOR_LOOP,
24
23
  WAITING_ON_CHILDREN_STOP_REASON,
25
24
  compileWorkflowPlan,
@@ -55,7 +54,7 @@ import {
55
54
  verifyRendered,
56
55
  wakesFreshAfterHandover,
57
56
  workflowRegistryDir
58
- } from "./chunk-TSIMXPJN.js";
57
+ } from "./chunk-UQWOGG3L.js";
59
58
  import {
60
59
  __commonJS,
61
60
  __toESM
@@ -13078,12 +13077,12 @@ var SIZE_CLASS_FORECASTS = {
13078
13077
  L: 12e5
13079
13078
  };
13080
13079
  function classOfCap(declaredCap) {
13081
- if (declaredCap <= SIZE_CLASS_CAPS.S) return "S";
13080
+ if (Number.isNaN(declaredCap) || declaredCap <= SIZE_CLASS_CAPS.S) return "S";
13082
13081
  if (declaredCap <= SIZE_CLASS_CAPS.M) return "M";
13083
13082
  return "L";
13084
13083
  }
13085
- function attemptCost(attempt) {
13086
- return attempt.closed ? SIZE_CLASS_FORECASTS[classOfCap(attempt.tokenCap)] : attempt.tokenCap;
13084
+ function forecastOfCap(declaredCap) {
13085
+ return SIZE_CLASS_FORECASTS[classOfCap(declaredCap)];
13087
13086
  }
13088
13087
 
13089
13088
  // ../../packages/protocol/src/v2.ts
@@ -14893,7 +14892,7 @@ async function restoreCheckpoint(store, input) {
14893
14892
 
14894
14893
  // ../../modules/runtime/src/software-version.ts
14895
14894
  import "fs";
14896
- var runnerSoftwareVersion = true ? "0.7.4" : JSON.parse(readFileSync2(new URL("../../../apps/cli/package.json", import.meta.url), "utf8")).version;
14895
+ var runnerSoftwareVersion = true ? "0.7.5" : JSON.parse(readFileSync2(new URL("../../../apps/cli/package.json", import.meta.url), "utf8")).version;
14897
14896
 
14898
14897
  // ../../modules/runtime/src/connection.ts
14899
14898
  var RunnerDisconnectedError = class extends Error {
@@ -20261,7 +20260,8 @@ var issueEntrySchema = external_exports.strictObject({
20261
20260
  workflowName: external_exports.string().max(128)
20262
20261
  });
20263
20262
  var buildPlanSchema = external_exports.strictObject({
20264
- version: external_exports.literal(2),
20263
+ /** 3 carries the forecast; 2 (read, never written) carried the sum of the children's caps. */
20264
+ version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]),
20265
20265
  orchestratorRunId: external_exports.string().min(1),
20266
20266
  planKey: external_exports.string().regex(/^plan:.+$/),
20267
20267
  projectId: external_exports.string().min(1),
@@ -20270,11 +20270,18 @@ var buildPlanSchema = external_exports.strictObject({
20270
20270
  templateVersion: external_exports.string().regex(/^[0-9a-f]{64}$/),
20271
20271
  branch: external_exports.string().regex(/^drisp\/build-[a-z0-9]+$/),
20272
20272
  commit: external_exports.string().regex(/^[0-9a-f]{40}$/),
20273
- budget: external_exports.strictObject({
20274
- tokenBudget: count,
20275
- orchestratorCap: count,
20276
- childCapsSum: count
20277
- }),
20273
+ budget: external_exports.union([
20274
+ external_exports.strictObject({
20275
+ tokenBudget: count,
20276
+ orchestratorCap: count,
20277
+ forecast: count
20278
+ }),
20279
+ external_exports.strictObject({
20280
+ tokenBudget: count,
20281
+ orchestratorCap: count,
20282
+ childCapsSum: count
20283
+ })
20284
+ ]),
20278
20285
  groups: external_exports.array(
20279
20286
  external_exports.strictObject({
20280
20287
  index: external_exports.number().int().positive(),
@@ -20627,11 +20634,12 @@ function planBuild(context) {
20627
20634
  });
20628
20635
  }
20629
20636
  const groups = layers.map((issues, index) => ({ index: index + 1, issues }));
20637
+ const forecast = groups.flatMap((group2) => group2.issues).reduce((sum, entry) => sum + SIZE_CLASS_FORECASTS[entry.sizeClass], 0);
20630
20638
  return {
20631
20639
  status: "planned",
20632
20640
  workflows,
20633
20641
  plan: {
20634
- version: 2,
20642
+ version: 3,
20635
20643
  orchestratorRunId: context.orchestratorRunId,
20636
20644
  planKey: `plan:${input.project.id}`,
20637
20645
  projectId: input.project.id,
@@ -20640,9 +20648,9 @@ function planBuild(context) {
20640
20648
  templateVersion: context.templateVersion,
20641
20649
  branch: buildBranch(input.project.slugId),
20642
20650
  budget: {
20643
- tokenBudget: ORCHESTRATOR_LIMITS.tokenBudget,
20651
+ tokenBudget: defaultBudget(forecast),
20644
20652
  orchestratorCap: ORCHESTRATOR_LOOP.maxRunTokens,
20645
- childCapsSum: groups.flatMap((group2) => group2.issues).reduce((sum, entry) => sum + entry.tokenCap, 0)
20653
+ forecast
20646
20654
  },
20647
20655
  groups,
20648
20656
  skipped,
@@ -20667,6 +20675,9 @@ function finalizePlan(draft, commit) {
20667
20675
  ...needsPerson ? { needsPerson } : {}
20668
20676
  };
20669
20677
  }
20678
+ function defaultBudget(forecast) {
20679
+ return Math.ceil(forecast * 1.5 / 1e5) * 1e5;
20680
+ }
20670
20681
 
20671
20682
  // src/core/build/childWorktree.ts
20672
20683
  import fs23 from "fs";
@@ -21899,7 +21910,7 @@ export {
21899
21910
  RUN_EXIT_CODE,
21900
21911
  localAnswerDecision,
21901
21912
  runExec,
21902
- attemptCost,
21913
+ forecastOfCap,
21903
21914
  repositoryBindingSchema,
21904
21915
  commandSchema,
21905
21916
  historyRecordSchema,
@@ -21956,4 +21967,4 @@ export {
21956
21967
  runMachineRunners,
21957
21968
  writeIdentityOnce
21958
21969
  };
21959
- //# sourceMappingURL=chunk-XG7B4OOC.js.map
21970
+ //# sourceMappingURL=chunk-TG5EGPD2.js.map
@@ -21287,7 +21287,6 @@ var workflow_default = '# Orchestrator: plan and run a Build\n\nYou plan and run
21287
21287
  var ORCHESTRATOR_WORKFLOW_NAME = "orchestrator";
21288
21288
  var ORCHESTRATOR_LIMITS = {
21289
21289
  maxChildren: 2,
21290
- tokenBudget: 6e7,
21291
21290
  tickAllowance: 300
21292
21291
  };
21293
21292
  var ORCHESTRATOR_LOOP = {
@@ -24251,4 +24250,4 @@ export {
24251
24250
  compileWorkflowPlan,
24252
24251
  collectMcpServersWithOptions
24253
24252
  };
24254
- //# sourceMappingURL=chunk-TSIMXPJN.js.map
24253
+ //# sourceMappingURL=chunk-UQWOGG3L.js.map
package/dist/cli.js CHANGED
@@ -10,7 +10,6 @@ import {
10
10
  ServiceNotEnabledError,
11
11
  approvalAnswer,
12
12
  attachRuntimeEventLoop,
13
- attemptCost,
14
13
  behindMain,
15
14
  bootstrapRuntimeConfig,
16
15
  buildApiKeyHelperSettings,
@@ -48,6 +47,7 @@ import {
48
47
  finalizePlan,
49
48
  fit,
50
49
  fitAnsi,
50
+ forecastOfCap,
51
51
  forgetRunner,
52
52
  formatClock,
53
53
  formatProbeCommand,
@@ -140,7 +140,7 @@ import {
140
140
  visualPositionToOffset,
141
141
  wrapText,
142
142
  writeIdentityOnce
143
- } from "./chunk-XG7B4OOC.js";
143
+ } from "./chunk-TG5EGPD2.js";
144
144
  import {
145
145
  generateId as generateId2
146
146
  } from "./chunk-PQIB66SG.js";
@@ -198,7 +198,7 @@ import {
198
198
  workflowRegistryDir,
199
199
  writeGlobalConfig,
200
200
  writeProjectConfig
201
- } from "./chunk-TSIMXPJN.js";
201
+ } from "./chunk-UQWOGG3L.js";
202
202
  import {
203
203
  __toESM
204
204
  } from "./chunk-G3PMV62Z.js";
@@ -14362,21 +14362,15 @@ function assessTick(facts) {
14362
14362
  }).length;
14363
14363
  const queue = [];
14364
14364
  if (!parkReason) {
14365
- let capped = Object.values(state.attempts).flat().reduce(
14366
- (sum, attempt) => sum + attemptCost({
14367
- tokenCap: attempt.tokenCap,
14368
- closed: views.get(attempt.runId)?.closed === true
14369
- }),
14370
- 0
14371
- );
14365
+ let committed = Object.values(state.attempts).flat().reduce((sum, attempt) => sum + forecastOfCap(attempt.tokenCap), 0);
14372
14366
  for (const entry of entries) {
14373
14367
  if (status.get(entry.id) !== "ready") continue;
14374
- if (capped + entry.tokenCap > facts.limits.tokenBudget) {
14368
+ if (committed + forecastOfCap(entry.tokenCap) > facts.limits.tokenBudget) {
14375
14369
  parkReason = "budget";
14376
14370
  break;
14377
14371
  }
14378
14372
  queue.push(entry);
14379
- capped += entry.tokenCap;
14373
+ committed += forecastOfCap(entry.tokenCap);
14380
14374
  }
14381
14375
  }
14382
14376
  return {
@@ -14535,7 +14529,11 @@ async function runBuildTick(deps) {
14535
14529
  state: stored,
14536
14530
  children: children.runs,
14537
14531
  templateVersion,
14538
- limits: buildLimits(ORCHESTRATOR_LIMITS, parent.delegation),
14532
+ // The approved plan's budget (the member's, once it is editable) narrowed by what the Hub enforces.
14533
+ limits: buildLimits(
14534
+ { ...ORCHESTRATOR_LIMITS, tokenBudget: plan.budget.tokenBudget },
14535
+ parent.delegation
14536
+ ),
14539
14537
  pullRequests: (branch) => deps.pullRequests(deps.folder, branch),
14540
14538
  locate: (entry) => locate(deps, entry, issues.get(entry.id)?.branchName),
14541
14539
  rebaseFailed: deps.rebaseFailed ?? [],
@@ -15960,7 +15958,7 @@ Available commands: ${[...KNOWN_COMMANDS].join(", ")}`
15960
15958
  await exitWith(1);
15961
15959
  return;
15962
15960
  }
15963
- const { default: WorkflowInstallWizard } = await import("./WorkflowInstallWizard-AJYDKFDL.js");
15961
+ const { default: WorkflowInstallWizard } = await import("./WorkflowInstallWizard-4GRQGM42.js");
15964
15962
  const { waitUntilExit } = render(
15965
15963
  /* @__PURE__ */ jsx24(
15966
15964
  WorkflowInstallWizard,
@@ -1,6 +1,6 @@
1
- import "./chunk-F6XUMTMC.js";
2
- import "./chunk-XG7B4OOC.js";
1
+ import "./chunk-N4B7HLBN.js";
2
+ import "./chunk-TG5EGPD2.js";
3
3
  import "./chunk-PQIB66SG.js";
4
- import "./chunk-TSIMXPJN.js";
4
+ import "./chunk-UQWOGG3L.js";
5
5
  import "./chunk-G3PMV62Z.js";
6
6
  //# sourceMappingURL=dashboard-daemon.js.map
package/dist/runner.js CHANGED
@@ -1,6 +1,6 @@
1
- import "./chunk-F6XUMTMC.js";
2
- import "./chunk-XG7B4OOC.js";
1
+ import "./chunk-N4B7HLBN.js";
2
+ import "./chunk-TG5EGPD2.js";
3
3
  import "./chunk-PQIB66SG.js";
4
- import "./chunk-TSIMXPJN.js";
4
+ import "./chunk-UQWOGG3L.js";
5
5
  import "./chunk-G3PMV62Z.js";
6
6
  //# sourceMappingURL=runner.js.map
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "hooks",
18
18
  "dashboard"
19
19
  ],
20
- "version": "0.7.4",
20
+ "version": "0.7.5",
21
21
  "license": "MIT",
22
22
  "bin": {
23
23
  "athena": "dist/cli.js",