@drisp/cli 0.4.7 → 0.5.1

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,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  startDaemon
4
- } from "./chunk-SKWAGQXF.js";
5
- import "./chunk-D4W7RB25.js";
4
+ } from "./chunk-OB4HZXR5.js";
5
+ import "./chunk-MRAM6EYI.js";
6
6
  import {
7
7
  resolveGatewayPaths,
8
8
  resolveListenSpec
9
- } from "./chunk-WRHKXH5M.js";
9
+ } from "./chunk-BTY7MYYT.js";
10
10
 
11
11
  // src/gateway/entryArgs.ts
12
12
  function parseGatewayDaemonArgs(argv) {
@@ -170,7 +170,7 @@ function isLoopbackHost(host) {
170
170
 
171
171
  // src/infra/telemetry/client.ts
172
172
  import { PostHog } from "posthog-node";
173
- var POSTHOG_API_KEY = true ? "phc_4UifMvZlZcJdgf3uDqzgEdIlQt98yAeUqVX5tobJcuD\n" : "";
173
+ var POSTHOG_API_KEY = true ? "" : "";
174
174
  var POSTHOG_HOST = "https://us.i.posthog.com";
175
175
  var client = null;
176
176
  var deviceId = null;
@@ -772,4 +772,4 @@ export {
772
772
  trackSetupCompleted,
773
773
  refreshDashboardAccessToken
774
774
  };
775
- //# sourceMappingURL=chunk-WRHKXH5M.js.map
775
+ //# sourceMappingURL=chunk-BTY7MYYT.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isLoopbackHost
3
- } from "./chunk-WRHKXH5M.js";
3
+ } from "./chunk-BTY7MYYT.js";
4
4
 
5
5
  // src/gateway/auth.ts
6
6
  import crypto from "crypto";
@@ -73,4 +73,4 @@ export {
73
73
  timingSafeTokenEqual,
74
74
  requireTokenForBind
75
75
  };
76
- //# sourceMappingURL=chunk-D4W7RB25.js.map
76
+ //# sourceMappingURL=chunk-MRAM6EYI.js.map
@@ -2,7 +2,7 @@ import {
2
2
  loadOrCreateToken,
3
3
  requireTokenForBind,
4
4
  timingSafeTokenEqual
5
- } from "./chunk-D4W7RB25.js";
5
+ } from "./chunk-MRAM6EYI.js";
6
6
  import {
7
7
  CHANNEL_REQUEST_ID_REGEX,
8
8
  createUdsServerTransport,
@@ -18,7 +18,7 @@ import {
18
18
  trackGatewayTransportConnect,
19
19
  trackGatewayTransportDisconnect,
20
20
  writeGatewayTrace
21
- } from "./chunk-WRHKXH5M.js";
21
+ } from "./chunk-BTY7MYYT.js";
22
22
 
23
23
  // src/gateway/daemon.ts
24
24
  import fs4 from "fs";
@@ -2240,7 +2240,7 @@ var cachedVersion = null;
2240
2240
  function readVersion() {
2241
2241
  if (cachedVersion !== null) return cachedVersion;
2242
2242
  try {
2243
- const injected = "0.4.7";
2243
+ const injected = "0.5.1";
2244
2244
  if (typeof injected === "string" && injected.length > 0) {
2245
2245
  cachedVersion = injected;
2246
2246
  return cachedVersion;
@@ -4121,4 +4121,4 @@ async function startDaemon(opts) {
4121
4121
  export {
4122
4122
  startDaemon
4123
4123
  };
4124
- //# sourceMappingURL=chunk-SKWAGQXF.js.map
4124
+ //# sourceMappingURL=chunk-OB4HZXR5.js.map
@@ -27,7 +27,7 @@ import {
27
27
  traceGatewayFrame,
28
28
  trackGatewayTransportReconnect,
29
29
  writeGatewayTrace
30
- } from "./chunk-WRHKXH5M.js";
30
+ } from "./chunk-BTY7MYYT.js";
31
31
  import {
32
32
  compileWorkflowPlan,
33
33
  createWorkflowRunner,
@@ -11781,6 +11781,22 @@ async function runExec(options) {
11781
11781
  return result;
11782
11782
  }
11783
11783
 
11784
+ // src/app/bootstrap/harnessOverride.ts
11785
+ function normalizeHarnessOverride(value) {
11786
+ switch (value) {
11787
+ case "claude":
11788
+ case "claude-code":
11789
+ return "claude-code";
11790
+ case "codex":
11791
+ case "openai-codex":
11792
+ return "openai-codex";
11793
+ case "opencode":
11794
+ return "opencode";
11795
+ default:
11796
+ return void 0;
11797
+ }
11798
+ }
11799
+
11784
11800
  // src/app/dashboard/runStreamClient.ts
11785
11801
  import { WebSocket as WebSocket2 } from "ws";
11786
11802
  var DEFAULT_RECONNECT_DELAYS_MS = [250, 1e3, 2e3, 5e3, 15e3];
@@ -12085,6 +12101,7 @@ function parseRunSpec(value) {
12085
12101
  ...typeof workflowObj["source"] === "string" ? { source: workflowObj["source"] } : {},
12086
12102
  ...typeof workflowObj["version"] === "string" ? { version: workflowObj["version"] } : {}
12087
12103
  } : void 0,
12104
+ harness: normalizeHarnessOverride(obj["harness"]),
12088
12105
  env: typeof env === "object" && env !== null ? Object.fromEntries(
12089
12106
  Object.entries(env).filter(
12090
12107
  (entry) => typeof entry[1] === "string"
@@ -12267,6 +12284,7 @@ async function executeRemoteAssignment({
12267
12284
  projectDir,
12268
12285
  showSetup: false,
12269
12286
  isolationPreset: "minimal",
12287
+ harnessOverride: spec.harness,
12270
12288
  workflowOverride
12271
12289
  });
12272
12290
  } catch (err) {
@@ -12714,6 +12732,7 @@ async function runDashboardRuntimeDaemon(options = {}) {
12714
12732
  const feedOutbox = options.feedOutbox ?? createDashboardFeedOutbox();
12715
12733
  const decisionInbox = options.decisionInbox ?? createDashboardDecisionInbox();
12716
12734
  const feedDrainIntervalMs = options.feedDrainIntervalMs ?? DEFAULT_FEED_DRAIN_INTERVAL_MS;
12735
+ const retryInitialConnect = options.retryInitialConnect ?? true;
12717
12736
  const startedAt = now();
12718
12737
  let stopped = false;
12719
12738
  let reconnectAttempt = 0;
@@ -12932,7 +12951,18 @@ async function runDashboardRuntimeDaemon(options = {}) {
12932
12951
  }
12933
12952
  }
12934
12953
  }
12935
- await connectOnce();
12954
+ try {
12955
+ await connectOnce();
12956
+ } catch (err) {
12957
+ if (!retryInitialConnect) {
12958
+ throw err;
12959
+ }
12960
+ log(
12961
+ "warn",
12962
+ `dashboard runtime daemon initial connect failed: ${err instanceof Error ? err.message : String(err)}`
12963
+ );
12964
+ void reconnectLoop();
12965
+ }
12936
12966
  return {
12937
12967
  snapshot() {
12938
12968
  const executionSnapshot = pairedExecution.snapshot();
@@ -13236,8 +13266,9 @@ export {
13236
13266
  bootstrapRuntimeConfig,
13237
13267
  EXEC_EXIT_CODE,
13238
13268
  runExec,
13269
+ normalizeHarnessOverride,
13239
13270
  runDashboardRuntimeDaemon,
13240
13271
  startUdsServer,
13241
13272
  sendUdsRequest
13242
13273
  };
13243
- //# sourceMappingURL=chunk-TQKNZNDP.js.map
13274
+ //# sourceMappingURL=chunk-PEBITVZQ.js.map
package/dist/cli.js CHANGED
@@ -45,6 +45,7 @@ import {
45
45
  lookupCredential,
46
46
  makeSkippedProbe,
47
47
  messageGlyphs,
48
+ normalizeHarnessOverride,
48
49
  probeSkipReason,
49
50
  processRegistry,
50
51
  progressGlyphs,
@@ -67,13 +68,13 @@ import {
67
68
  todoGlyphSet,
68
69
  writeGatewayClientConfig,
69
70
  wsClientOptionsForEndpoint
70
- } from "./chunk-TQKNZNDP.js";
71
+ } from "./chunk-PEBITVZQ.js";
71
72
  import {
72
73
  generateId as generateId2
73
74
  } from "./chunk-BTKQ67RE.js";
74
75
  import {
75
76
  rotateGatewayToken
76
- } from "./chunk-D4W7RB25.js";
77
+ } from "./chunk-MRAM6EYI.js";
77
78
  import {
78
79
  readAttachmentMirror,
79
80
  readPidLock,
@@ -100,7 +101,7 @@ import {
100
101
  trackTelemetryOptedOut,
101
102
  writeDashboardClientConfig,
102
103
  writeGatewayTrace
103
- } from "./chunk-WRHKXH5M.js";
104
+ } from "./chunk-BTY7MYYT.js";
104
105
  import {
105
106
  McpOptionsStep,
106
107
  StepSelector,
@@ -10679,6 +10680,22 @@ function deriveStatus(currentRun, runSummaries, errorReason) {
10679
10680
  if (last.status === "SUCCEEDED") return "idle";
10680
10681
  return "idle";
10681
10682
  }
10683
+ function isCodexHarness(input) {
10684
+ const rawHarness = input.harness?.toLowerCase() ?? "";
10685
+ const rawAgentType = input.session?.agent_type?.toLowerCase() ?? "";
10686
+ return rawHarness.includes("codex") || rawAgentType.includes("codex");
10687
+ }
10688
+ function countDistinctTurnIds(events) {
10689
+ const turnIds = /* @__PURE__ */ new Set();
10690
+ for (const event of events) {
10691
+ const data = typeof event.data === "object" && event.data !== null ? event.data : {};
10692
+ const turnId = data["turn_id"];
10693
+ if (typeof turnId === "string" && turnId.length > 0) {
10694
+ turnIds.add(turnId);
10695
+ }
10696
+ }
10697
+ return turnIds.size;
10698
+ }
10682
10699
  function buildHeaderModel(input) {
10683
10700
  const {
10684
10701
  session,
@@ -10697,6 +10714,7 @@ function buildHeaderModel(input) {
10697
10714
  Math.max(1, Math.trunc(input.sessionIndex ?? sessionTotal)),
10698
10715
  sessionTotal
10699
10716
  ) : null;
10717
+ const codexHarness = isCodexHarness(input);
10700
10718
  return {
10701
10719
  session_id: session?.session_id ?? "\u2013",
10702
10720
  session_index: sessionIndex,
@@ -10706,7 +10724,9 @@ function buildHeaderModel(input) {
10706
10724
  model_name: input.modelName ?? null,
10707
10725
  context: { used: input.contextUsed ?? null, max: input.contextMax ?? null },
10708
10726
  total_tokens: input.totalTokens ?? null,
10709
- run_count: input.runCount ?? 0,
10727
+ token_label: codexHarness ? "Billable" : "Tokens",
10728
+ run_count: codexHarness ? input.turnCount ?? input.runCount ?? 0 : input.runCount ?? 0,
10729
+ run_label: codexHarness ? "Turns" : "Runs",
10710
10730
  engine: session?.agent_type,
10711
10731
  progress: todoPanel.todoItems.length > 0 ? { done: todoPanel.doneCount, total: todoPanel.todoItems.length } : void 0,
10712
10732
  status,
@@ -10719,6 +10739,11 @@ function buildHeaderModel(input) {
10719
10739
  function formatTokenCount(value) {
10720
10740
  if (value === null) return "--";
10721
10741
  if (value < 1e3) return String(value);
10742
+ if (value >= 1e6) {
10743
+ const m = value / 1e6;
10744
+ if (Number.isInteger(m)) return `${m}m`;
10745
+ return `${parseFloat(m.toFixed(1))}m`;
10746
+ }
10722
10747
  const k = value / 1e3;
10723
10748
  if (Number.isInteger(k)) return `${k}k`;
10724
10749
  return `${parseFloat(k.toFixed(1))}k`;
@@ -10906,6 +10931,8 @@ function renderHeaderLines(model, width, hasColor, theme) {
10906
10931
  const wfText = `${style("Workflow: ", palette.label)}${style(model.workflow, palette.value)}`;
10907
10932
  const harnessText = `${style("Harness: ", palette.label)}${style(model.harness, palette.value)}`;
10908
10933
  const modelText = `${style("Model: ", palette.label)}${style(formatModelName(model.model_name), palette.value)}`;
10934
+ const tokenLabel = model.token_label ?? "Tokens";
10935
+ const runLabel = model.run_label ?? "Runs";
10909
10936
  const leftTokens = [
10910
10937
  { text: athena, priority: 100 },
10911
10938
  { text: divider, priority: 5 },
@@ -10916,14 +10943,14 @@ function renderHeaderLines(model, width, hasColor, theme) {
10916
10943
  // Token count (e.g., "Tokens: 45.2k")
10917
10944
  ...model.total_tokens !== null ? [
10918
10945
  {
10919
- text: `${style("Tokens: ", palette.label)}${style(formatTokenCount(model.total_tokens), palette.value)}`,
10946
+ text: `${style(`${tokenLabel}: `, palette.label)}${style(formatTokenCount(model.total_tokens), palette.value)}`,
10920
10947
  priority: 40
10921
10948
  }
10922
10949
  ] : [],
10923
10950
  // Run count (e.g., "Runs: 3")
10924
10951
  ...model.run_count > 0 ? [
10925
10952
  {
10926
- text: `${style("Runs: ", palette.label)}${style(String(model.run_count), palette.value)}`,
10953
+ text: `${style(`${runLabel}: `, palette.label)}${style(String(model.run_count), palette.value)}`,
10927
10954
  priority: 50
10928
10955
  }
10929
10956
  ] : []
@@ -11042,6 +11069,7 @@ function parseRunSpec(value) {
11042
11069
  sessionId: typeof obj["sessionId"] === "string" && obj["sessionId"].length > 0 ? obj["sessionId"] : void 0,
11043
11070
  projectDir: typeof obj["projectDir"] === "string" && obj["projectDir"].length > 0 ? obj["projectDir"] : void 0,
11044
11071
  workflow: typeof workflow === "object" && workflow !== null && typeof workflow["ref"] === "string" ? { ref: workflow["ref"] } : void 0,
11072
+ harness: normalizeHarnessOverride(obj["harness"]),
11045
11073
  env: typeof env2 === "object" && env2 !== null ? Object.fromEntries(
11046
11074
  Object.entries(env2).filter(
11047
11075
  (entry) => typeof entry[1] === "string"
@@ -11153,6 +11181,7 @@ async function executeAssignment(input) {
11153
11181
  projectDir,
11154
11182
  showSetup: false,
11155
11183
  isolationPreset: "minimal",
11184
+ harnessOverride: spec.harness,
11156
11185
  workflowOverride: workflowNameFromRef(spec.workflow?.ref)
11157
11186
  });
11158
11187
  } catch (err) {
@@ -13517,6 +13546,10 @@ function AppContent({
13517
13546
  verbose
13518
13547
  });
13519
13548
  const { runSummaries, filteredEntries, searchMatches, getEntrySearchText } = timeline;
13549
+ const codexTurnCount = useMemo17(
13550
+ () => countDistinctTurnIds(feedEvents),
13551
+ [feedEvents]
13552
+ );
13520
13553
  const todoPanel = useTodoPanel({
13521
13554
  tasks,
13522
13555
  isWorking: appMode.type === "working",
@@ -14206,6 +14239,7 @@ function AppContent({
14206
14239
  contextMax: tokenUsage.contextWindowSize,
14207
14240
  totalTokens: tokenUsage.total,
14208
14241
  runCount: runSummaries.length,
14242
+ turnCount: codexTurnCount,
14209
14243
  sessionIndex: sessionScope.current,
14210
14244
  sessionTotal: sessionScope.total,
14211
14245
  harness,
@@ -14219,6 +14253,7 @@ function AppContent({
14219
14253
  sessionAgentType,
14220
14254
  timelineCurrentRun,
14221
14255
  runSummaries,
14256
+ codexTurnCount,
14222
14257
  metrics.failures,
14223
14258
  metrics.blocks,
14224
14259
  todoPanel.doneCount,
@@ -16017,7 +16052,7 @@ var cachedVersion = null;
16017
16052
  function readPackageVersion() {
16018
16053
  if (cachedVersion !== null) return cachedVersion;
16019
16054
  try {
16020
- const injected = "0.4.7";
16055
+ const injected = "0.5.1";
16021
16056
  if (typeof injected === "string" && injected.length > 0) {
16022
16057
  cachedVersion = injected;
16023
16058
  return cachedVersion;
@@ -16491,6 +16526,7 @@ async function runDashboardCommand(input, deps = {}) {
16491
16526
  refreshAccessToken: async () => performRefreshImpl("connect"),
16492
16527
  makeInstanceSocketClient: deps.makeInstanceSocketClient,
16493
16528
  executeRemoteAssignment: deps.executeRemoteAssignment,
16529
+ retryInitialConnect: false,
16494
16530
  log: (level, message) => {
16495
16531
  if (level === "error" || level === "warn") {
16496
16532
  logError(`dashboard daemon: ${message}`);
@@ -2,7 +2,7 @@ import {
2
2
  ensureDaemonStateDir,
3
3
  runDashboardRuntimeDaemon,
4
4
  startUdsServer
5
- } from "./chunk-TQKNZNDP.js";
5
+ } from "./chunk-PEBITVZQ.js";
6
6
  import "./chunk-BTKQ67RE.js";
7
7
  import {
8
8
  openDaemonLog
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  readDashboardClientConfig,
15
15
  refreshDashboardAccessToken
16
- } from "./chunk-WRHKXH5M.js";
16
+ } from "./chunk-BTY7MYYT.js";
17
17
  import "./chunk-A54HGVML.js";
18
18
 
19
19
  // src/app/entry/dashboardDaemon.ts
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  startDaemon
4
- } from "./chunk-SKWAGQXF.js";
5
- import "./chunk-D4W7RB25.js";
4
+ } from "./chunk-OB4HZXR5.js";
5
+ import "./chunk-MRAM6EYI.js";
6
6
  import {
7
7
  openDaemonLog
8
8
  } from "./chunk-2OJ3GGIP.js";
@@ -17,7 +17,7 @@ import {
17
17
  refreshDashboardAccessToken,
18
18
  resolveGatewayPaths,
19
19
  resolveListenSpec
20
- } from "./chunk-WRHKXH5M.js";
20
+ } from "./chunk-BTY7MYYT.js";
21
21
 
22
22
  // src/app/entry/supervisor.tsx
23
23
  import { spawn } from "child_process";
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "hooks",
18
18
  "dashboard"
19
19
  ],
20
- "version": "0.4.7",
20
+ "version": "0.5.1",
21
21
  "license": "MIT",
22
22
  "bin": {
23
23
  "athena": "dist/cli.js",