@drisp/cli 0.7.3 → 0.7.4

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-6HOVFCCB.js";
3
+ } from "./chunk-XG7B4OOC.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-7R3HR7VJ.js.map
16
+ //# sourceMappingURL=chunk-F6XUMTMC.js.map
@@ -13066,6 +13066,26 @@ var AssignmentRejectedReasonSchema = external_exports.enum([
13066
13066
  "workspace_invalid"
13067
13067
  ]);
13068
13068
 
13069
+ // ../../packages/protocol/src/budget.ts
13070
+ var SIZE_CLASS_CAPS = {
13071
+ S: 3e6,
13072
+ M: 6e6,
13073
+ L: 12e6
13074
+ };
13075
+ var SIZE_CLASS_FORECASTS = {
13076
+ S: 15e4,
13077
+ M: 4e5,
13078
+ L: 12e5
13079
+ };
13080
+ function classOfCap(declaredCap) {
13081
+ if (declaredCap <= SIZE_CLASS_CAPS.S) return "S";
13082
+ if (declaredCap <= SIZE_CLASS_CAPS.M) return "M";
13083
+ return "L";
13084
+ }
13085
+ function attemptCost(attempt) {
13086
+ return attempt.closed ? SIZE_CLASS_FORECASTS[classOfCap(attempt.tokenCap)] : attempt.tokenCap;
13087
+ }
13088
+
13069
13089
  // ../../packages/protocol/src/v2.ts
13070
13090
  var protocolVersion = { major: 2, minor: 2 };
13071
13091
  var conversationContinuationCapability = "conversation_continuation";
@@ -14873,7 +14893,7 @@ async function restoreCheckpoint(store, input) {
14873
14893
 
14874
14894
  // ../../modules/runtime/src/software-version.ts
14875
14895
  import "fs";
14876
- var runnerSoftwareVersion = true ? "0.7.3" : JSON.parse(readFileSync2(new URL("../../../apps/cli/package.json", import.meta.url), "utf8")).version;
14896
+ var runnerSoftwareVersion = true ? "0.7.4" : JSON.parse(readFileSync2(new URL("../../../apps/cli/package.json", import.meta.url), "utf8")).version;
14877
14897
 
14878
14898
  // ../../modules/runtime/src/connection.ts
14879
14899
  var RunnerDisconnectedError = class extends Error {
@@ -21879,6 +21899,7 @@ export {
21879
21899
  RUN_EXIT_CODE,
21880
21900
  localAnswerDecision,
21881
21901
  runExec,
21902
+ attemptCost,
21882
21903
  repositoryBindingSchema,
21883
21904
  commandSchema,
21884
21905
  historyRecordSchema,
@@ -21935,4 +21956,4 @@ export {
21935
21956
  runMachineRunners,
21936
21957
  writeIdentityOnce
21937
21958
  };
21938
- //# sourceMappingURL=chunk-6HOVFCCB.js.map
21959
+ //# sourceMappingURL=chunk-XG7B4OOC.js.map
package/dist/cli.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  ServiceNotEnabledError,
11
11
  approvalAnswer,
12
12
  attachRuntimeEventLoop,
13
+ attemptCost,
13
14
  behindMain,
14
15
  bootstrapRuntimeConfig,
15
16
  buildApiKeyHelperSettings,
@@ -139,7 +140,7 @@ import {
139
140
  visualPositionToOffset,
140
141
  wrapText,
141
142
  writeIdentityOnce
142
- } from "./chunk-6HOVFCCB.js";
143
+ } from "./chunk-XG7B4OOC.js";
143
144
  import {
144
145
  generateId as generateId2
145
146
  } from "./chunk-PQIB66SG.js";
@@ -14361,7 +14362,13 @@ function assessTick(facts) {
14361
14362
  }).length;
14362
14363
  const queue = [];
14363
14364
  if (!parkReason) {
14364
- let capped = Object.values(state.attempts).flat().reduce((sum, attempt) => sum + attempt.tokenCap, 0);
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
14372
  for (const entry of entries) {
14366
14373
  if (status.get(entry.id) !== "ready") continue;
14367
14374
  if (capped + entry.tokenCap > facts.limits.tokenBudget) {
@@ -1,5 +1,5 @@
1
- import "./chunk-7R3HR7VJ.js";
2
- import "./chunk-6HOVFCCB.js";
1
+ import "./chunk-F6XUMTMC.js";
2
+ import "./chunk-XG7B4OOC.js";
3
3
  import "./chunk-PQIB66SG.js";
4
4
  import "./chunk-TSIMXPJN.js";
5
5
  import "./chunk-G3PMV62Z.js";
package/dist/runner.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./chunk-7R3HR7VJ.js";
2
- import "./chunk-6HOVFCCB.js";
1
+ import "./chunk-F6XUMTMC.js";
2
+ import "./chunk-XG7B4OOC.js";
3
3
  import "./chunk-PQIB66SG.js";
4
4
  import "./chunk-TSIMXPJN.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.3",
20
+ "version": "0.7.4",
21
21
  "license": "MIT",
22
22
  "bin": {
23
23
  "athena": "dist/cli.js",