@drisp/cli 0.7.8 → 0.7.10
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/dist/{WorkflowInstallWizard-IOJD3YOA.js → WorkflowInstallWizard-FKASDA6N.js} +2 -2
- package/dist/{chunk-OYUBT6RS.js → chunk-FYXEDUQ6.js} +11 -1
- package/dist/{chunk-HGMJ3YL2.js → chunk-ISH6VEYL.js} +131 -21
- package/dist/{chunk-TBUUNMC6.js → chunk-OORYDPD6.js} +2 -2
- package/dist/cli.js +28 -5
- package/dist/dashboard-daemon.js +3 -3
- package/dist/runner.js +3 -3
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
installWorkflowPlugins,
|
|
9
9
|
resolveWorkflow,
|
|
10
10
|
writeGlobalConfig
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FYXEDUQ6.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-
|
|
96
|
+
//# sourceMappingURL=WorkflowInstallWizard-FKASDA6N.js.map
|
|
@@ -22447,6 +22447,15 @@ function budgetTokens(memory) {
|
|
|
22447
22447
|
if (memory.cumulativeTokens === null) return null;
|
|
22448
22448
|
return Math.max(0, memory.cumulativeTokens - (memory.usage?.cacheRead ?? 0));
|
|
22449
22449
|
}
|
|
22450
|
+
function runUsage(memory) {
|
|
22451
|
+
const counted = budgetTokens(memory);
|
|
22452
|
+
if (counted === null) return null;
|
|
22453
|
+
const whole = (tokens) => Number.isFinite(tokens) ? Math.min(Math.max(0, Math.round(tokens)), Number.MAX_SAFE_INTEGER) : 0;
|
|
22454
|
+
return {
|
|
22455
|
+
counted: whole(counted),
|
|
22456
|
+
cacheRead: whole(memory.usage?.cacheRead ?? 0)
|
|
22457
|
+
};
|
|
22458
|
+
}
|
|
22450
22459
|
function resourceInterruption(stop) {
|
|
22451
22460
|
const names2 = {
|
|
22452
22461
|
tokens: "token budget",
|
|
@@ -24308,6 +24317,7 @@ export {
|
|
|
24308
24317
|
WAITING_ON_CHILDREN_STOP_REASON,
|
|
24309
24318
|
AWAITING_APPROVAL_STOP_REASON,
|
|
24310
24319
|
budgetTokens,
|
|
24320
|
+
runUsage,
|
|
24311
24321
|
createSteerQueue,
|
|
24312
24322
|
DEFAULT_PERMISSION_GRACE_MS,
|
|
24313
24323
|
serializeRunMemory,
|
|
@@ -24374,4 +24384,4 @@ export {
|
|
|
24374
24384
|
compileWorkflowPlan,
|
|
24375
24385
|
collectMcpServersWithOptions
|
|
24376
24386
|
};
|
|
24377
|
-
//# sourceMappingURL=chunk-
|
|
24387
|
+
//# sourceMappingURL=chunk-FYXEDUQ6.js.map
|
|
@@ -48,6 +48,7 @@ import {
|
|
|
48
48
|
resolveWorkflow,
|
|
49
49
|
resolveWorkflowManifestPath,
|
|
50
50
|
resolveWorkflowPlugins,
|
|
51
|
+
runUsage,
|
|
51
52
|
selectWorkflowCapabilities,
|
|
52
53
|
serializeRunMemory,
|
|
53
54
|
sizeClassLimits,
|
|
@@ -55,7 +56,7 @@ import {
|
|
|
55
56
|
verifyRendered,
|
|
56
57
|
wakesFreshAfterHandover,
|
|
57
58
|
workflowRegistryDir
|
|
58
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-FYXEDUQ6.js";
|
|
59
60
|
import {
|
|
60
61
|
__commonJS,
|
|
61
62
|
__toESM
|
|
@@ -13085,14 +13086,24 @@ function classOfCap(declaredCap) {
|
|
|
13085
13086
|
function forecastOfCap(declaredCap) {
|
|
13086
13087
|
return SIZE_CLASS_FORECASTS[classOfCap(declaredCap)];
|
|
13087
13088
|
}
|
|
13089
|
+
var classCalibrationSchema = external_exports.strictObject({
|
|
13090
|
+
S: external_exports.strictObject({ forecast: external_exports.number(), runs: external_exports.number() }).optional(),
|
|
13091
|
+
M: external_exports.strictObject({ forecast: external_exports.number(), runs: external_exports.number() }).optional(),
|
|
13092
|
+
L: external_exports.strictObject({ forecast: external_exports.number(), runs: external_exports.number() }).optional()
|
|
13093
|
+
});
|
|
13094
|
+
var calibrationSchema = external_exports.record(external_exports.string(), classCalibrationSchema);
|
|
13095
|
+
function forecastOfClass(sizeClass, calibration) {
|
|
13096
|
+
return calibration?.[sizeClass]?.forecast ?? SIZE_CLASS_FORECASTS[sizeClass];
|
|
13097
|
+
}
|
|
13088
13098
|
|
|
13089
13099
|
// ../../packages/protocol/src/v2.ts
|
|
13090
|
-
var protocolVersion = { major: 2, minor:
|
|
13100
|
+
var protocolVersion = { major: 2, minor: 3 };
|
|
13091
13101
|
var conversationContinuationCapability = "conversation_continuation";
|
|
13092
13102
|
var abandonedConversationContinuationCapability = "abandoned_conversation_continuation";
|
|
13093
13103
|
var repositoryAccessCapability = "repository_checkout_v1";
|
|
13094
13104
|
var workflowInstallCapability = "workflow_install_v1";
|
|
13095
13105
|
var runDelegationCapability = "run_delegation_v1";
|
|
13106
|
+
var runUsageCapability = "run_usage_v1";
|
|
13096
13107
|
var runArtifactNameSchema = external_exports.string().regex(/^[a-z][a-z0-9_]{0,63}$/);
|
|
13097
13108
|
var runArtifactMaxBytes = 64 * 1024;
|
|
13098
13109
|
var secretEnvironmentSchema = external_exports.record(
|
|
@@ -13160,6 +13171,8 @@ var factIdentity = {
|
|
|
13160
13171
|
executionRevision: positive,
|
|
13161
13172
|
emittedAt: timestamp
|
|
13162
13173
|
};
|
|
13174
|
+
var runUsageSchema = external_exports.strictObject({ counted: sequence, cacheRead: sequence });
|
|
13175
|
+
var reportedUsage = { usage: runUsageSchema.optional() };
|
|
13163
13176
|
var controlRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
13164
13177
|
/** Instance-scoped, not tied to a Run: the full replacement inventory of installed Workflows. */
|
|
13165
13178
|
external_exports.strictObject({ kind: external_exports.literal("workflows.changed"), workflows: installedWorkflowsSchema }),
|
|
@@ -13190,7 +13203,8 @@ var controlRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
|
13190
13203
|
external_exports.strictObject({ kind: external_exports.literal("local_checkpoint"), checkpointId: id }),
|
|
13191
13204
|
external_exports.strictObject({ kind: external_exports.literal("portable_checkpoint"), checkpointId: id }),
|
|
13192
13205
|
external_exports.strictObject({ kind: external_exports.literal("repair_required"), detail: external_exports.string().max(4096) })
|
|
13193
|
-
])
|
|
13206
|
+
]),
|
|
13207
|
+
...reportedUsage
|
|
13194
13208
|
}),
|
|
13195
13209
|
external_exports.strictObject({
|
|
13196
13210
|
kind: external_exports.literal("run.finished"),
|
|
@@ -13203,8 +13217,14 @@ var controlRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
|
13203
13217
|
* Why a Build Run failed, as its close reason (docs/specs/build-orchestrator.md). Sent only for a grant with
|
|
13204
13218
|
* `parent` or `delegationToken`, which only a Hub that knows this field issues.
|
|
13205
13219
|
*/
|
|
13206
|
-
reason: buildCloseReasonSchema.optional()
|
|
13220
|
+
reason: buildCloseReasonSchema.optional(),
|
|
13221
|
+
...reportedUsage
|
|
13207
13222
|
}),
|
|
13223
|
+
/**
|
|
13224
|
+
* The usage of a Run while it executes, for a grant marked `reportUsage`. Not an execution fact: it carries no
|
|
13225
|
+
* execution revision, so it never advances, parks or closes the Run, and never wakes its parent.
|
|
13226
|
+
*/
|
|
13227
|
+
external_exports.strictObject({ kind: external_exports.literal("run.usage"), runId: id, attemptId: id, ...runUsageSchema.shape }),
|
|
13208
13228
|
external_exports.strictObject({ kind: external_exports.literal("command.applied"), runId: id, attemptId: id, commandId: id }),
|
|
13209
13229
|
external_exports.strictObject({
|
|
13210
13230
|
kind: external_exports.literal("command.rejected"),
|
|
@@ -13343,7 +13363,9 @@ var grantSchema = external_exports.strictObject({
|
|
|
13343
13363
|
/** This attempt's delegation token: only for a Run started with `delegation`, only to a `run_delegation_v1` Runner. */
|
|
13344
13364
|
delegationToken: external_exports.string().min(32).max(256).optional(),
|
|
13345
13365
|
/** Copied from the start intent of a delegated child. */
|
|
13346
|
-
parent: runParentSchema.optional()
|
|
13366
|
+
parent: runParentSchema.optional(),
|
|
13367
|
+
/** The runner reports this attempt's usage: set only for a `run_usage_v1` Runner. */
|
|
13368
|
+
reportUsage: external_exports.literal(true).optional()
|
|
13347
13369
|
});
|
|
13348
13370
|
var historyRecordSchema = external_exports.strictObject({
|
|
13349
13371
|
eventId: id,
|
|
@@ -13404,7 +13426,13 @@ var runViewSchema = external_exports.object({
|
|
|
13404
13426
|
label: external_exports.string().max(160).optional(),
|
|
13405
13427
|
key: runKeySchema.optional(),
|
|
13406
13428
|
parent: runParentSchema.optional(),
|
|
13407
|
-
|
|
13429
|
+
/**
|
|
13430
|
+
* Not strict, unlike the start intent's: a Hub keeps more on the Run's delegation (`initialTokenBudget`) than it
|
|
13431
|
+
* shows, and a client never refuses a view for a field it does not read.
|
|
13432
|
+
*/
|
|
13433
|
+
delegation: external_exports.object(delegationSchema.shape).optional(),
|
|
13434
|
+
/** The largest cumulative usage the Run's Runner reported; absent until one does (an older Runner never does). */
|
|
13435
|
+
usage: runUsageSchema.optional(),
|
|
13408
13436
|
/** Resolved by the runner at start; absent until the Run starts and for runners that predate reporting. */
|
|
13409
13437
|
workflow: workflowIdentitySchema.optional(),
|
|
13410
13438
|
execution: external_exports.object({
|
|
@@ -14529,6 +14557,7 @@ var ExecutionHost = class {
|
|
|
14529
14557
|
const outcome = await this.executor.execute(run.grant, this.store, abort.signal);
|
|
14530
14558
|
if (publish && !abort.signal.aborted && ["completed", "awaiting_attention"].includes(outcome.status))
|
|
14531
14559
|
await publish(run.grant, abort.signal);
|
|
14560
|
+
const usage = outcome.usage && run.grant.reportUsage ? { usage: outcome.usage } : {};
|
|
14532
14561
|
this.store.transaction(() => {
|
|
14533
14562
|
this.store.fact(runId, (identity) => {
|
|
14534
14563
|
if (outcome.status === "awaiting_attention")
|
|
@@ -14547,7 +14576,8 @@ var ExecutionHost = class {
|
|
|
14547
14576
|
continuation: {
|
|
14548
14577
|
kind: this.portableCheckpoints ? "portable_checkpoint" : "local_checkpoint",
|
|
14549
14578
|
checkpointId: crypto.randomUUID()
|
|
14550
|
-
}
|
|
14579
|
+
},
|
|
14580
|
+
...usage
|
|
14551
14581
|
};
|
|
14552
14582
|
return {
|
|
14553
14583
|
...identity,
|
|
@@ -14559,7 +14589,8 @@ var ExecutionHost = class {
|
|
|
14559
14589
|
// resend it forever. Portable checkpoints are configured only on managed Runners.
|
|
14560
14590
|
...outcome.workspaceMissing && this.portableCheckpoints && run.grant.spec.repository ? { workspaceUnavailable: true } : {},
|
|
14561
14591
|
// Only a Hub that issues `parent` or a delegation token knows the field; an older one rejects it.
|
|
14562
|
-
...outcome.reason && (run.grant.parent || run.grant.delegationToken) ? { reason: outcome.reason } : {}
|
|
14592
|
+
...outcome.reason && (run.grant.parent || run.grant.delegationToken) ? { reason: outcome.reason } : {},
|
|
14593
|
+
...usage
|
|
14563
14594
|
};
|
|
14564
14595
|
});
|
|
14565
14596
|
if (this.portableCheckpoints && outcome.status !== "awaiting_attention" && !outcome.workspaceMissing)
|
|
@@ -14893,9 +14924,18 @@ async function restoreCheckpoint(store, input) {
|
|
|
14893
14924
|
|
|
14894
14925
|
// ../../modules/runtime/src/software-version.ts
|
|
14895
14926
|
import "fs";
|
|
14896
|
-
var runnerSoftwareVersion = true ? "0.7.
|
|
14927
|
+
var runnerSoftwareVersion = true ? "0.7.10" : JSON.parse(readFileSync2(new URL("../../../apps/cli/package.json", import.meta.url), "utf8")).version;
|
|
14897
14928
|
|
|
14898
14929
|
// ../../modules/runtime/src/connection.ts
|
|
14930
|
+
var runnerCapabilities = [
|
|
14931
|
+
"local_checkpoint",
|
|
14932
|
+
conversationContinuationCapability,
|
|
14933
|
+
abandonedConversationContinuationCapability,
|
|
14934
|
+
repositoryAccessCapability,
|
|
14935
|
+
workflowInstallCapability,
|
|
14936
|
+
runDelegationCapability,
|
|
14937
|
+
runUsageCapability
|
|
14938
|
+
];
|
|
14899
14939
|
var RunnerDisconnectedError = class extends Error {
|
|
14900
14940
|
constructor() {
|
|
14901
14941
|
super("runner_disconnected");
|
|
@@ -15032,7 +15072,7 @@ var RunnerConnection = class {
|
|
|
15032
15072
|
runnerId: store.identity.runnerId,
|
|
15033
15073
|
installationId: store.identity.installationId,
|
|
15034
15074
|
softwareVersion: runnerSoftwareVersion,
|
|
15035
|
-
capabilities: [
|
|
15075
|
+
capabilities: [...runnerCapabilities],
|
|
15036
15076
|
...this.options.workflows ? { workflows: this.options.workflows.current() } : {},
|
|
15037
15077
|
...this.options.readiness?.current() ? { readiness: this.options.readiness.current() } : {},
|
|
15038
15078
|
control: {
|
|
@@ -20283,6 +20323,7 @@ var SKIP_REASONS = [
|
|
|
20283
20323
|
"not-ready-for-agent"
|
|
20284
20324
|
];
|
|
20285
20325
|
var count = external_exports.number().int().nonnegative();
|
|
20326
|
+
var calibratedClass = external_exports.strictObject({ forecast: count, runs: count });
|
|
20286
20327
|
var issueEntrySchema = external_exports.strictObject({
|
|
20287
20328
|
id: external_exports.string(),
|
|
20288
20329
|
identifier: external_exports.string(),
|
|
@@ -20318,7 +20359,13 @@ var buildPlanSchema = external_exports.strictObject({
|
|
|
20318
20359
|
external_exports.strictObject({
|
|
20319
20360
|
tokenBudget: count,
|
|
20320
20361
|
orchestratorCap: count,
|
|
20321
|
-
forecast: count
|
|
20362
|
+
forecast: count,
|
|
20363
|
+
/** The classes whose forecast the Hub measured from finished Runs (DRI-244); absent when none was. */
|
|
20364
|
+
calibrated: external_exports.strictObject({
|
|
20365
|
+
S: calibratedClass.optional(),
|
|
20366
|
+
M: calibratedClass.optional(),
|
|
20367
|
+
L: calibratedClass.optional()
|
|
20368
|
+
}).optional()
|
|
20322
20369
|
}),
|
|
20323
20370
|
external_exports.strictObject({
|
|
20324
20371
|
tokenBudget: count,
|
|
@@ -20730,7 +20777,16 @@ function planBuild(context) {
|
|
|
20730
20777
|
});
|
|
20731
20778
|
}
|
|
20732
20779
|
const groups = layers.map((issues, index) => ({ index: index + 1, issues }));
|
|
20733
|
-
const forecast = groups.flatMap((group2) => group2.issues).reduce(
|
|
20780
|
+
const forecast = groups.flatMap((group2) => group2.issues).reduce(
|
|
20781
|
+
(sum, entry) => sum + forecastOfClass(entry.sizeClass, context.calibration),
|
|
20782
|
+
0
|
|
20783
|
+
);
|
|
20784
|
+
const inPlan = new Set(groups.flatMap((g) => g.issues.map((e) => e.sizeClass)));
|
|
20785
|
+
const calibrated = Object.fromEntries(
|
|
20786
|
+
["S", "M", "L"].filter(
|
|
20787
|
+
(sizeClass) => inPlan.has(sizeClass) && context.calibration?.[sizeClass]
|
|
20788
|
+
).map((sizeClass) => [sizeClass, context.calibration[sizeClass]])
|
|
20789
|
+
);
|
|
20734
20790
|
return {
|
|
20735
20791
|
status: "planned",
|
|
20736
20792
|
workflows,
|
|
@@ -20746,7 +20802,8 @@ function planBuild(context) {
|
|
|
20746
20802
|
budget: {
|
|
20747
20803
|
tokenBudget: defaultBudget(forecast),
|
|
20748
20804
|
orchestratorCap: ORCHESTRATOR_LOOP.maxRunTokens,
|
|
20749
|
-
forecast
|
|
20805
|
+
forecast,
|
|
20806
|
+
...Object.keys(calibrated).length > 0 ? { calibrated } : {}
|
|
20750
20807
|
},
|
|
20751
20808
|
groups,
|
|
20752
20809
|
skipped,
|
|
@@ -21361,6 +21418,25 @@ function runArtifactEmitter(directory, record, midTurnMinGapMs = MID_TURN_MIN_GA
|
|
|
21361
21418
|
// ../../modules/runtime/src/run-usage.ts
|
|
21362
21419
|
import { readFileSync as readFileSync5, renameSync, writeFileSync as writeFileSync4 } from "fs";
|
|
21363
21420
|
import { join as join8 } from "path";
|
|
21421
|
+
var LIVE_USAGE_MIN_TOKENS = 1e5;
|
|
21422
|
+
var LIVE_USAGE_MIN_INTERVAL_MS = 3e4;
|
|
21423
|
+
function liveUsageReporter(grant, store, read3, now = Date.now) {
|
|
21424
|
+
if (!grant.reportUsage) return () => {
|
|
21425
|
+
};
|
|
21426
|
+
let last = { counted: read3()?.counted ?? 0, at: now() };
|
|
21427
|
+
return () => {
|
|
21428
|
+
const usage = read3();
|
|
21429
|
+
const at = now();
|
|
21430
|
+
if (!usage || usage.counted - last.counted < LIVE_USAGE_MIN_TOKENS || at - last.at < LIVE_USAGE_MIN_INTERVAL_MS)
|
|
21431
|
+
return;
|
|
21432
|
+
const sent = store.transaction(() => {
|
|
21433
|
+
if (store.run(grant.runId).phase !== "executing") return false;
|
|
21434
|
+
store.appendControl({ kind: "run.usage", runId: grant.runId, attemptId: grant.attemptId, ...usage });
|
|
21435
|
+
return true;
|
|
21436
|
+
});
|
|
21437
|
+
if (sent) last = { counted: usage.counted, at };
|
|
21438
|
+
};
|
|
21439
|
+
}
|
|
21364
21440
|
var isMark = (value) => {
|
|
21365
21441
|
const mark = value;
|
|
21366
21442
|
return !!mark && Number.isInteger(mark.index) && typeof mark.title === "string" && typeof mark.tokens === "number" && Number.isFinite(mark.tokens) && mark.tokens >= 0;
|
|
@@ -21567,6 +21643,11 @@ function createWorkflowExecutor(dependencies = {}) {
|
|
|
21567
21643
|
}
|
|
21568
21644
|
emitArtifacts(midTurn);
|
|
21569
21645
|
};
|
|
21646
|
+
const usage2 = () => {
|
|
21647
|
+
const memory = deserializeRunMemory(view2.getLatestRun()?.runMemoryJson);
|
|
21648
|
+
return memory ? runUsage(memory) : null;
|
|
21649
|
+
};
|
|
21650
|
+
const reportLiveUsage2 = liveUsageReporter(grant, store, usage2, dependencies.now);
|
|
21570
21651
|
const previous = view2.getLatestRun();
|
|
21571
21652
|
const predecessor = grant.previousRun ? store.sessionValues(grant.sessionId, "workflow").find((snapshot) => snapshot.id === grant.previousRun.runId) : void 0;
|
|
21572
21653
|
const adapterResumeSessionId2 = grant.purpose === "resume" ? previous?.adapterSessionId : predecessor?.adapterSessionId;
|
|
@@ -21610,7 +21691,18 @@ ${JSON.stringify(continuation.answer)}` : grant.spec.prompt;
|
|
|
21610
21691
|
Current human request:
|
|
21611
21692
|
${prompt2}`;
|
|
21612
21693
|
}
|
|
21613
|
-
return {
|
|
21694
|
+
return {
|
|
21695
|
+
workingDirectory: workingDirectory2,
|
|
21696
|
+
config: config2,
|
|
21697
|
+
view: view2,
|
|
21698
|
+
adapterResumeSessionId: adapterResumeSessionId2,
|
|
21699
|
+
storedAnswer: storedAnswer2,
|
|
21700
|
+
prompt: prompt2,
|
|
21701
|
+
displayText: displayText2,
|
|
21702
|
+
sweepArtifacts: sweepArtifacts2,
|
|
21703
|
+
usage: usage2,
|
|
21704
|
+
reportLiveUsage: reportLiveUsage2
|
|
21705
|
+
};
|
|
21614
21706
|
};
|
|
21615
21707
|
let setup2;
|
|
21616
21708
|
try {
|
|
@@ -21622,7 +21714,18 @@ ${prompt2}`;
|
|
|
21622
21714
|
if (error instanceof RunSetupError && isBuildCloseReason(error.code)) return { status: "failed", reason: error.code };
|
|
21623
21715
|
return { status: "failed" };
|
|
21624
21716
|
}
|
|
21625
|
-
const {
|
|
21717
|
+
const {
|
|
21718
|
+
workingDirectory,
|
|
21719
|
+
config,
|
|
21720
|
+
view,
|
|
21721
|
+
adapterResumeSessionId,
|
|
21722
|
+
storedAnswer,
|
|
21723
|
+
prompt,
|
|
21724
|
+
displayText,
|
|
21725
|
+
sweepArtifacts,
|
|
21726
|
+
usage,
|
|
21727
|
+
reportLiveUsage
|
|
21728
|
+
} = setup2;
|
|
21626
21729
|
const queue = createSteerQueue();
|
|
21627
21730
|
queues.set(grant.runId, queue);
|
|
21628
21731
|
const sweep = setInterval(() => {
|
|
@@ -21630,6 +21733,10 @@ ${prompt2}`;
|
|
|
21630
21733
|
sweepArtifacts(true);
|
|
21631
21734
|
} catch {
|
|
21632
21735
|
}
|
|
21736
|
+
try {
|
|
21737
|
+
reportLiveUsage();
|
|
21738
|
+
} catch {
|
|
21739
|
+
}
|
|
21633
21740
|
}, dependencies.artifactIntervalMs ?? 2e3);
|
|
21634
21741
|
sweep.unref();
|
|
21635
21742
|
const result = await trackHarnessProcesses(store, grant.runId, () => (dependencies.execute ?? runExec)({
|
|
@@ -21697,8 +21804,10 @@ ${prompt2}`;
|
|
|
21697
21804
|
runMemoryJson: serializeRunMemory({ ...memory, pendingSteers })
|
|
21698
21805
|
});
|
|
21699
21806
|
});
|
|
21807
|
+
const reported = usage();
|
|
21808
|
+
const withUsage = (outcome) => reported ? { ...outcome, usage: reported } : outcome;
|
|
21700
21809
|
if (status === "awaiting_attention" && !result.workflowOutcome.interruption && result.workflowOutcome.stopReason === WAITING_ON_CHILDREN_STOP_REASON)
|
|
21701
|
-
return { status, interruption: { kind: "waiting", message: WAITING_ON_CHILDREN_MESSAGE } };
|
|
21810
|
+
return withUsage({ status, interruption: { kind: "waiting", message: WAITING_ON_CHILDREN_MESSAGE } });
|
|
21702
21811
|
if (status === "awaiting_attention" && !result.workflowOutcome.interruption && result.workflowOutcome.stopReason === AWAITING_APPROVAL_STOP_REASON) {
|
|
21703
21812
|
const question = config.workflow?.approvalQuestion;
|
|
21704
21813
|
if (!question) {
|
|
@@ -21706,13 +21815,13 @@ ${prompt2}`;
|
|
|
21706
21815
|
code: "approval_question_missing",
|
|
21707
21816
|
message: "The Journal ended with AWAITING_APPROVAL, but the Workflow has no approvalQuestion."
|
|
21708
21817
|
});
|
|
21709
|
-
return { status: "failed", reason: "approval_question_missing" };
|
|
21818
|
+
return withUsage({ status: "failed", reason: "approval_question_missing" });
|
|
21710
21819
|
}
|
|
21711
21820
|
record(APPROVAL_REQUESTED, { question, plan: emittedPlan(store, grant.runId) });
|
|
21712
|
-
return { status, interruption: { kind: "question", message: question } };
|
|
21821
|
+
return withUsage({ status, interruption: { kind: "question", message: question } });
|
|
21713
21822
|
}
|
|
21714
21823
|
const interruption = status === "awaiting_attention" ? result.workflowOutcome.interruption ?? interruptionFromSuspension(result.workflowOutcome.stopReason) : void 0;
|
|
21715
|
-
return {
|
|
21824
|
+
return withUsage({
|
|
21716
21825
|
status,
|
|
21717
21826
|
...interruption ? {
|
|
21718
21827
|
interruption: {
|
|
@@ -21724,7 +21833,7 @@ ${prompt2}`;
|
|
|
21724
21833
|
...interruption.kind === "question" && interruption.requestId ? { requestId: interruption.requestId } : {}
|
|
21725
21834
|
}
|
|
21726
21835
|
} : {}
|
|
21727
|
-
};
|
|
21836
|
+
});
|
|
21728
21837
|
}
|
|
21729
21838
|
};
|
|
21730
21839
|
}
|
|
@@ -22063,6 +22172,7 @@ export {
|
|
|
22063
22172
|
localAnswerDecision,
|
|
22064
22173
|
runExec,
|
|
22065
22174
|
forecastOfCap,
|
|
22175
|
+
calibrationSchema,
|
|
22066
22176
|
repositoryBindingSchema,
|
|
22067
22177
|
commandSchema,
|
|
22068
22178
|
historyRecordSchema,
|
|
@@ -22121,4 +22231,4 @@ export {
|
|
|
22121
22231
|
runMachineRunners,
|
|
22122
22232
|
writeIdentityOnce
|
|
22123
22233
|
};
|
|
22124
|
-
//# sourceMappingURL=chunk-
|
|
22234
|
+
//# sourceMappingURL=chunk-ISH6VEYL.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runMachineRunners
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ISH6VEYL.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-
|
|
16
|
+
//# sourceMappingURL=chunk-OORYDPD6.js.map
|
package/dist/cli.js
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
buildPlanSchema,
|
|
18
18
|
buildPostByToolUseId,
|
|
19
19
|
buildProbeConfigs,
|
|
20
|
+
calibrationSchema,
|
|
20
21
|
centerAnsi,
|
|
21
22
|
childWorktreePath,
|
|
22
23
|
classifyFailure,
|
|
@@ -142,7 +143,7 @@ import {
|
|
|
142
143
|
visualPositionToOffset,
|
|
143
144
|
wrapText,
|
|
144
145
|
writeIdentityOnce
|
|
145
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-ISH6VEYL.js";
|
|
146
147
|
import {
|
|
147
148
|
generateId as generateId2
|
|
148
149
|
} from "./chunk-PQIB66SG.js";
|
|
@@ -201,7 +202,7 @@ import {
|
|
|
201
202
|
workflowRegistryDir,
|
|
202
203
|
writeGlobalConfig,
|
|
203
204
|
writeProjectConfig
|
|
204
|
-
} from "./chunk-
|
|
205
|
+
} from "./chunk-FYXEDUQ6.js";
|
|
205
206
|
import {
|
|
206
207
|
__toESM
|
|
207
208
|
} from "./chunk-G3PMV62Z.js";
|
|
@@ -13775,7 +13776,8 @@ function runBuildPlan(deps) {
|
|
|
13775
13776
|
folder: deps.folder,
|
|
13776
13777
|
runnerId,
|
|
13777
13778
|
templateVersion,
|
|
13778
|
-
layout
|
|
13779
|
+
layout,
|
|
13780
|
+
...deps.calibration ? { calibration: deps.calibration } : {}
|
|
13779
13781
|
});
|
|
13780
13782
|
if (result.status === "failed") return fail(result.reason);
|
|
13781
13783
|
if (result.status === "needs_fills")
|
|
@@ -13901,6 +13903,10 @@ var DrispClient = class _DrispClient {
|
|
|
13901
13903
|
await this.request(`/runs/${encodeURIComponent(runId)}/artifacts/${encodeURIComponent(name)}`)
|
|
13902
13904
|
);
|
|
13903
13905
|
}
|
|
13906
|
+
/** The measured size-class forecasts per harness (root ADR-0011): only classes with enough finished Runs appear. */
|
|
13907
|
+
async calibration() {
|
|
13908
|
+
return calibrationSchema.parse(await this.request("/calibration"));
|
|
13909
|
+
}
|
|
13904
13910
|
async run(runId) {
|
|
13905
13911
|
return runViewSchema.parse(await this.request(`/runs/${encodeURIComponent(runId)}`));
|
|
13906
13912
|
}
|
|
@@ -15172,6 +15178,20 @@ function runBuildChecks(cwd, deps) {
|
|
|
15172
15178
|
}));
|
|
15173
15179
|
return evaluateRemoteChecks(withJobs);
|
|
15174
15180
|
}
|
|
15181
|
+
async function measuredForecasts(env2) {
|
|
15182
|
+
const token = env2["DRISP_RUN_TOKEN"];
|
|
15183
|
+
const hubUrl = env2["DRISP_HUB_URL"];
|
|
15184
|
+
if (!token || !hubUrl) return void 0;
|
|
15185
|
+
try {
|
|
15186
|
+
const calibration = await DrispClient.delegated(
|
|
15187
|
+
hubUrl,
|
|
15188
|
+
token
|
|
15189
|
+
).calibration();
|
|
15190
|
+
return calibration["claude-code"];
|
|
15191
|
+
} catch {
|
|
15192
|
+
return void 0;
|
|
15193
|
+
}
|
|
15194
|
+
}
|
|
15175
15195
|
async function runBuildCommand(input) {
|
|
15176
15196
|
const stdout = input.stdout ?? process.stdout;
|
|
15177
15197
|
const stderr = input.stderr ?? process.stderr;
|
|
@@ -15179,7 +15199,8 @@ async function runBuildCommand(input) {
|
|
|
15179
15199
|
try {
|
|
15180
15200
|
let output;
|
|
15181
15201
|
switch (input.subcommand) {
|
|
15182
|
-
case "plan":
|
|
15202
|
+
case "plan": {
|
|
15203
|
+
const calibration = input.dependencies?.calibration ?? await measuredForecasts(env2);
|
|
15183
15204
|
output = runBuildPlan({
|
|
15184
15205
|
env: env2,
|
|
15185
15206
|
folder: input.cwd,
|
|
@@ -15187,9 +15208,11 @@ async function runBuildCommand(input) {
|
|
|
15187
15208
|
worktreesRoot: defaultWorktreesRoot(),
|
|
15188
15209
|
hostCapabilities: () => hostCapabilities(input.cwd),
|
|
15189
15210
|
pullRequests: githubPullRequests,
|
|
15211
|
+
...calibration ? { calibration } : {},
|
|
15190
15212
|
...input.dependencies
|
|
15191
15213
|
});
|
|
15192
15214
|
break;
|
|
15215
|
+
}
|
|
15193
15216
|
case "tick": {
|
|
15194
15217
|
requireEnv(env2, "DRISP_RUN_ID");
|
|
15195
15218
|
requireEnv(env2, "DRISP_RUNNER_ID");
|
|
@@ -16323,7 +16346,7 @@ Available commands: ${[...KNOWN_COMMANDS].join(", ")}`
|
|
|
16323
16346
|
await exitWith(1);
|
|
16324
16347
|
return;
|
|
16325
16348
|
}
|
|
16326
|
-
const { default: WorkflowInstallWizard } = await import("./WorkflowInstallWizard-
|
|
16349
|
+
const { default: WorkflowInstallWizard } = await import("./WorkflowInstallWizard-FKASDA6N.js");
|
|
16327
16350
|
const { waitUntilExit } = render(
|
|
16328
16351
|
/* @__PURE__ */ jsx24(
|
|
16329
16352
|
WorkflowInstallWizard,
|
package/dist/dashboard-daemon.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./chunk-
|
|
2
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-OORYDPD6.js";
|
|
2
|
+
import "./chunk-ISH6VEYL.js";
|
|
3
3
|
import "./chunk-PQIB66SG.js";
|
|
4
|
-
import "./chunk-
|
|
4
|
+
import "./chunk-FYXEDUQ6.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-
|
|
2
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-OORYDPD6.js";
|
|
2
|
+
import "./chunk-ISH6VEYL.js";
|
|
3
3
|
import "./chunk-PQIB66SG.js";
|
|
4
|
-
import "./chunk-
|
|
4
|
+
import "./chunk-FYXEDUQ6.js";
|
|
5
5
|
import "./chunk-G3PMV62Z.js";
|
|
6
6
|
//# sourceMappingURL=runner.js.map
|