@drisp/cli 0.6.4 → 0.6.6

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-QVRTU2MM.js";
11
+ } from "./chunk-7FYAABQ4.js";
12
12
  import "./chunk-PZ5AY32C.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-JLB7P37Y.js.map
96
+ //# sourceMappingURL=WorkflowInstallWizard-R76OV74M.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  startRunnerProcess,
3
3
  waitForShutdownSignal
4
- } from "./chunk-BLCX7JVV.js";
4
+ } from "./chunk-QGAGV2OI.js";
5
5
 
6
6
  // src/app/entry/runnerDaemon.ts
7
7
  import path from "path";
@@ -46,4 +46,4 @@ if (process.argv.includes("--help")) {
46
46
  export {
47
47
  runRunnerDaemonEntry
48
48
  };
49
- //# sourceMappingURL=chunk-FY3TIGHI.js.map
49
+ //# sourceMappingURL=chunk-5V5YDSKZ.js.map
@@ -1048,7 +1048,6 @@ function hasProjectWorkflow(projectDir) {
1048
1048
  }
1049
1049
 
1050
1050
  // src/core/workflows/types.ts
1051
- var DEFAULT_MAX_TURN_TOKEN_COUNT = 13e4;
1052
1051
  var DEFAULT_NUDGE_CAP = 3;
1053
1052
  var DEFAULT_RETRY_CAP = 3;
1054
1053
  var DEFAULT_RETRY_BACKOFF_MS = 1e4;
@@ -3582,9 +3581,11 @@ function createWorkflowRunner(input) {
3582
3581
  stop(limit);
3583
3582
  return;
3584
3583
  }
3585
- if (!openingChecked && turn.continuation.mode === "fresh" && usage.openingContextSize != null) {
3584
+ const previous = memory.contextKey === cfg.contextKey ? memory.lastBoundedTurn : null;
3585
+ const measured = previous?.lastContextTokens ?? null;
3586
+ const ceiling = measured ?? usage.contextWindowSize ?? null;
3587
+ if (!openingChecked && turn.continuation.mode === "fresh" && usage.openingContextSize != null && ceiling != null) {
3586
3588
  openingChecked = true;
3587
- const previous = memory.contextKey === cfg.contextKey ? memory.lastBoundedTurn : null;
3588
3589
  const required = memory.checkpoint ? 0 : estimateTokenCount(
3589
3590
  journalAbsPath ? readJournal(journalAbsPath) : ""
3590
3591
  );
@@ -3595,8 +3596,8 @@ function createWorkflowRunner(input) {
3595
3596
  context: {
3596
3597
  opening: usage.openingContextSize,
3597
3598
  required,
3598
- ceiling: previous?.lastContextTokens ?? loop?.maxTurnTokenCount ?? DEFAULT_MAX_TURN_TOKEN_COUNT,
3599
- source: previous ? "conservative prior API occupancy" : "configured ceiling estimate; actual compaction point unknown"
3599
+ ceiling,
3600
+ source: measured !== null ? "conservative prior API occupancy" : "model context window estimate; actual compaction point unknown"
3600
3601
  }
3601
3602
  });
3602
3603
  if (decision) stop(decision);
@@ -3969,9 +3970,8 @@ function collectMcpServersWithOptions(pluginDirs) {
3969
3970
  }
3970
3971
 
3971
3972
  export {
3972
- DEFAULT_MAX_TURN_TOKEN_COUNT,
3973
- DEFAULT_PERMISSION_GRACE_MS,
3974
3973
  createSteerQueue,
3974
+ DEFAULT_PERMISSION_GRACE_MS,
3975
3975
  deserializeRunMemory,
3976
3976
  wakesFreshAfterHandover,
3977
3977
  createWorkflowRunner,
@@ -4006,4 +4006,4 @@ export {
4006
4006
  compileWorkflowPlan,
4007
4007
  collectMcpServersWithOptions
4008
4008
  };
4009
- //# sourceMappingURL=chunk-QVRTU2MM.js.map
4009
+ //# sourceMappingURL=chunk-7FYAABQ4.js.map
@@ -15,7 +15,6 @@ import {
15
15
  resolveHookSocketPath
16
16
  } from "./chunk-USK5VSQ7.js";
17
17
  import {
18
- DEFAULT_MAX_TURN_TOKEN_COUNT,
19
18
  DEFAULT_PERMISSION_GRACE_MS,
20
19
  compileWorkflowPlan,
21
20
  createSteerQueue,
@@ -34,7 +33,7 @@ import {
34
33
  resolveWorkflowPlugins,
35
34
  wakesFreshAfterHandover,
36
35
  workflowRegistryDir
37
- } from "./chunk-QVRTU2MM.js";
36
+ } from "./chunk-7FYAABQ4.js";
38
37
  import {
39
38
  __export
40
39
  } from "./chunk-PZ5AY32C.js";
@@ -3925,14 +3924,6 @@ function spawnClaude(options) {
3925
3924
  cwd: projectDir,
3926
3925
  stdio: ["ignore", "pipe", "pipe"],
3927
3926
  env: {
3928
- // Claude compacts around 95% of this window. The default sits well
3929
- // under the model window (ADR 0014 §5): Handover needs headroom to
3930
- // hold the conversation AND emit a Handoff file in the fork — the old
3931
- // 185k default sat at the window and defeated that. Precedence:
3932
- // default < process.env < extraEnv, so a workflow's explicit
3933
- // maxTurnTokenCount (delivered via extraEnv) beats a user env var,
3934
- // while the bare default stays env-overridable.
3935
- CLAUDE_CODE_AUTO_COMPACT_WINDOW: String(DEFAULT_MAX_TURN_TOKEN_COUNT),
3936
3927
  ...process.env,
3937
3928
  ...extraEnv ?? {},
3938
3929
  ATHENA_INSTANCE_ID: String(instanceId),
@@ -4078,16 +4069,6 @@ function mergeIsolation(base, pluginMcpConfig, perCommand) {
4078
4069
  ...pluginMcpConfig ? { mcpConfig: pluginMcpConfig } : {}
4079
4070
  };
4080
4071
  }
4081
- function resolveWorkflowSpawnEnv(workflow) {
4082
- const maxTurnTokenCount = workflow?.loop?.maxTurnTokenCount;
4083
- if (maxTurnTokenCount === void 0) {
4084
- return workflow?.env;
4085
- }
4086
- return {
4087
- ...workflow?.env,
4088
- CLAUDE_CODE_AUTO_COMPACT_WINDOW: String(maxTurnTokenCount)
4089
- };
4090
- }
4091
4072
  function resolveClaudeSessionId(continuation) {
4092
4073
  if (!continuation || continuation.mode === "fresh") {
4093
4074
  return void 0;
@@ -4307,7 +4288,7 @@ function useClaudeProcess(projectDir, instanceId, isolation, pluginMcpConfig, ve
4307
4288
  pluginMcpConfig,
4308
4289
  perCallIsolation
4309
4290
  ),
4310
- env: resolveWorkflowSpawnEnv(workflow),
4291
+ env: workflow?.env,
4311
4292
  ...verbose ? {
4312
4293
  jqFilter: JQ_ASSISTANT_TEXT_FILTER,
4313
4294
  onFilteredStdout: (data) => {
@@ -4482,7 +4463,7 @@ function createClaudeSessionController(input) {
4482
4463
  input.pluginMcpConfig,
4483
4464
  configOverride
4484
4465
  ),
4485
- env: resolveWorkflowSpawnEnv(input.workflow),
4466
+ env: input.workflow?.env,
4486
4467
  onStdout: (data) => {
4487
4468
  tokenAccumulator.feed(data);
4488
4469
  onUsage?.(tokenAccumulator.getUsage());
@@ -7474,11 +7455,6 @@ function buildCodexPromptOptions(input) {
7474
7455
  agentRoots: input.workflowPlan?.agentRoots && input.workflowPlan.agentRoots.length > 0 ? input.workflowPlan.agentRoots : void 0,
7475
7456
  plugins: resolveCodexWorkflowPlugins(input.workflowPlan),
7476
7457
  config: {
7477
- // The harness-neutral maxTurnTokenCount (ADR 0014 §5): the bound sits
7478
- // well under the model window so a Handover has headroom to hold the
7479
- // conversation and emit a Handoff file — the old 175k default sat at
7480
- // the window and defeated that.
7481
- model_auto_compact_token_limit: input.workflowPlan?.workflow.loop?.maxTurnTokenCount ?? DEFAULT_MAX_TURN_TOKEN_COUNT,
7482
7458
  // Steer Codex's history compaction toward a handoff-style summary.
7483
7459
  // `compact_prompt` replaces the default summarization prompt.
7484
7460
  compact_prompt: HANDOFF_COMPACT_PROMPT,
@@ -31119,6 +31095,10 @@ function createRunStreamClient(opts) {
31119
31095
  queue.shift();
31120
31096
  }
31121
31097
  }
31098
+ function continueSequenceAfter(lastAckedSeq) {
31099
+ for (const frame of queue) frame.seq += lastAckedSeq;
31100
+ nextSeq += lastAckedSeq;
31101
+ }
31122
31102
  function trimQueueUpToExclusive(expectedSeq) {
31123
31103
  while (queue.length > 0 && queue[0].seq < expectedSeq) {
31124
31104
  queue.shift();
@@ -31200,6 +31180,9 @@ function createRunStreamClient(opts) {
31200
31180
  switch (parsed.type) {
31201
31181
  case "resume": {
31202
31182
  resumeResolved = true;
31183
+ if (firstConnect) {
31184
+ continueSequenceAfter(parsed.lastAckedSeq);
31185
+ }
31203
31186
  trimQueueUpTo(parsed.lastAckedSeq);
31204
31187
  if (firstConnect) {
31205
31188
  const f = firstConnect;
@@ -31894,6 +31877,11 @@ function resolveWakeTarget(athenaSessionId) {
31894
31877
  ...resumable ? { adapterResumeSessionId: run.adapterSessionId } : {}
31895
31878
  };
31896
31879
  }
31880
+ function parseWake(value) {
31881
+ if (typeof value !== "object" || value === null) return {};
31882
+ const reply = value.reply;
31883
+ return typeof reply === "string" && reply.trim().length > 0 ? { wake: { reply } } : {};
31884
+ }
31897
31885
  function parseRemoteRunSpec(value) {
31898
31886
  if (typeof value !== "object" || value === null) return null;
31899
31887
  const obj = value;
@@ -31922,6 +31910,7 @@ function parseRemoteRunSpec(value) {
31922
31910
  )
31923
31911
  ) : void 0,
31924
31912
  timeoutSec: typeof obj["timeoutSec"] === "number" && Number.isFinite(obj["timeoutSec"]) ? obj["timeoutSec"] : void 0,
31913
+ ...parseWake(obj["wake"]),
31925
31914
  callbackWsUrl: typeof callbackWsUrl === "string" && callbackWsUrl.length > 0 ? callbackWsUrl : void 0,
31926
31915
  callbackToken: typeof callbackToken === "string" && callbackToken.length > 0 ? callbackToken : void 0
31927
31916
  };
@@ -32776,6 +32765,29 @@ function createDashboardPairedExecution(options) {
32776
32765
  origin: "hub",
32777
32766
  receivedAt: steer.receivedAt
32778
32767
  });
32768
+ const launch = launched.get(submission.runId);
32769
+ if (!entry && record2.status === "awaiting_attention" && launch) {
32770
+ steer.pending = false;
32771
+ log(
32772
+ "info",
32773
+ `steer for parked run ${submission.runId} wakes it: ${submission.text}`
32774
+ );
32775
+ const admission = launch_(launch.assignment, {
32776
+ projectDir: launch.projectDir,
32777
+ wake: {
32778
+ reply: `A person replied while the Run waited: ${submission.text}
32779
+ Continue the workflow with this.`
32780
+ }
32781
+ });
32782
+ if (admission.kind === "rejected") {
32783
+ steer.pending = true;
32784
+ log(
32785
+ "warn",
32786
+ `run ${submission.runId} could not be woken: ${admission.rejection.message}`
32787
+ );
32788
+ }
32789
+ return true;
32790
+ }
32779
32791
  log(
32780
32792
  "info",
32781
32793
  `steer ${entry ? "queued for the next Turn of" : "held for the continue of"} run ${submission.runId} (${record2.status}): ${submission.text}`
@@ -32798,6 +32810,7 @@ function createDashboardPairedExecution(options) {
32798
32810
  }
32799
32811
  function launch_(assignment, input = {}) {
32800
32812
  const { runId, runnerId } = assignment;
32813
+ const wake = input.wake ?? assignment.spec.wake;
32801
32814
  if (active.has(runId)) {
32802
32815
  const rejection = {
32803
32816
  reason: "duplicate",
@@ -32818,7 +32831,7 @@ function createDashboardPairedExecution(options) {
32818
32831
  const controller = new AbortController();
32819
32832
  const steerQueue = createSteerQueue();
32820
32833
  takeHeldSteers(runId, steerQueue);
32821
- const resumed = input.wake ? [...runHistory].reverse().find((r) => r.runId === runId) : void 0;
32834
+ const resumed = wake ? [...runHistory].reverse().find((r) => r.runId === runId) : void 0;
32822
32835
  const record2 = resumed ?? {
32823
32836
  runId,
32824
32837
  startedAt: now(),
@@ -32844,7 +32857,7 @@ function createDashboardPairedExecution(options) {
32844
32857
  decisionInbox,
32845
32858
  steerQueue,
32846
32859
  ...pairedFeedPublisher ? { dashboardFeedPublisher: pairedFeedPublisher } : {},
32847
- ...input.wake ? { wake: input.wake } : {}
32860
+ ...wake ? { wake } : {}
32848
32861
  }).then(() => {
32849
32862
  if (record2.status === "running") record2.status = "completed";
32850
32863
  }).catch((err) => {
@@ -34257,4 +34270,4 @@ export {
34257
34270
  startRunnerProcess,
34258
34271
  waitForShutdownSignal
34259
34272
  };
34260
- //# sourceMappingURL=chunk-BLCX7JVV.js.map
34273
+ //# sourceMappingURL=chunk-QGAGV2OI.js.map
package/dist/cli.js CHANGED
@@ -102,7 +102,7 @@ import {
102
102
  wrapText,
103
103
  writeAttachmentMirror,
104
104
  writeDashboardClientConfig
105
- } from "./chunk-BLCX7JVV.js";
105
+ } from "./chunk-QGAGV2OI.js";
106
106
  import {
107
107
  generateId as generateId2
108
108
  } from "./chunk-USK5VSQ7.js";
@@ -144,7 +144,7 @@ import {
144
144
  wakesFreshAfterHandover,
145
145
  writeGlobalConfig,
146
146
  writeProjectConfig
147
- } from "./chunk-QVRTU2MM.js";
147
+ } from "./chunk-7FYAABQ4.js";
148
148
  import "./chunk-PZ5AY32C.js";
149
149
 
150
150
  // src/app/entry/cli.tsx
@@ -13148,7 +13148,7 @@ var cachedVersion = null;
13148
13148
  function readPackageVersion() {
13149
13149
  if (cachedVersion !== null) return cachedVersion;
13150
13150
  try {
13151
- const injected = "0.6.4";
13151
+ const injected = "0.6.6";
13152
13152
  if (typeof injected === "string" && injected.length > 0) {
13153
13153
  cachedVersion = injected;
13154
13154
  return cachedVersion;
@@ -15570,7 +15570,7 @@ Available commands: ${[...KNOWN_COMMANDS].join(", ")}`
15570
15570
  await exitWith(1);
15571
15571
  return;
15572
15572
  }
15573
- const { default: WorkflowInstallWizard } = await import("./WorkflowInstallWizard-JLB7P37Y.js");
15573
+ const { default: WorkflowInstallWizard } = await import("./WorkflowInstallWizard-R76OV74M.js");
15574
15574
  const { waitUntilExit } = render(
15575
15575
  /* @__PURE__ */ jsx24(
15576
15576
  WorkflowInstallWizard,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  runRunnerDaemonEntry
3
- } from "./chunk-FY3TIGHI.js";
4
- import "./chunk-BLCX7JVV.js";
3
+ } from "./chunk-5V5YDSKZ.js";
4
+ import "./chunk-QGAGV2OI.js";
5
5
  import "./chunk-USK5VSQ7.js";
6
- import "./chunk-QVRTU2MM.js";
6
+ import "./chunk-7FYAABQ4.js";
7
7
  import "./chunk-PZ5AY32C.js";
8
8
  export {
9
9
  runRunnerDaemonEntry
package/dist/runner.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  runRunnerDaemonEntry
3
- } from "./chunk-FY3TIGHI.js";
4
- import "./chunk-BLCX7JVV.js";
3
+ } from "./chunk-5V5YDSKZ.js";
4
+ import "./chunk-QGAGV2OI.js";
5
5
  import "./chunk-USK5VSQ7.js";
6
- import "./chunk-QVRTU2MM.js";
6
+ import "./chunk-7FYAABQ4.js";
7
7
  import "./chunk-PZ5AY32C.js";
8
8
  export {
9
9
  runRunnerDaemonEntry
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "hooks",
18
18
  "dashboard"
19
19
  ],
20
- "version": "0.6.4",
20
+ "version": "0.6.6",
21
21
  "license": "MIT",
22
22
  "bin": {
23
23
  "athena": "dist/cli.js",