@drisp/cli 0.5.26 → 0.5.28

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
  isLoopbackHost
3
- } from "./chunk-3U37HT4T.js";
3
+ } from "./chunk-VAFS446Y.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-4NX4WFPB.js.map
76
+ //# sourceMappingURL=chunk-MSPZOJMJ.js.map
@@ -130,6 +130,15 @@ function createStopBlockResult(reason) {
130
130
  }
131
131
  };
132
132
  }
133
+ function createCompactBlockResult(reason) {
134
+ return {
135
+ action: "json_output",
136
+ stdout_json: {
137
+ decision: "block",
138
+ reason
139
+ }
140
+ };
141
+ }
133
142
 
134
143
  export {
135
144
  ATHENA_HOOK_SOCKET_ENV,
@@ -145,6 +154,7 @@ export {
145
154
  createAskUserQuestionResult,
146
155
  createPermissionRequestAllowResult,
147
156
  createPermissionRequestDenyResult,
148
- createStopBlockResult
157
+ createStopBlockResult,
158
+ createCompactBlockResult
149
159
  };
150
- //# sourceMappingURL=chunk-QYB6N2OT.js.map
160
+ //# sourceMappingURL=chunk-USK5VSQ7.js.map
@@ -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 ? "" : "";
173
+ var POSTHOG_API_KEY = true ? "phc_4UifMvZlZcJdgf3uDqzgEdIlQt98yAeUqVX5tobJcuD\n" : "";
174
174
  var POSTHOG_HOST = "https://us.i.posthog.com";
175
175
  var client = null;
176
176
  var deviceId = null;
@@ -1085,4 +1085,4 @@ export {
1085
1085
  trackSetupCompleted,
1086
1086
  refreshDashboardAccessToken
1087
1087
  };
1088
- //# sourceMappingURL=chunk-3U37HT4T.js.map
1088
+ //# sourceMappingURL=chunk-VAFS446Y.js.map
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import "./chunk-HXBCZAP7.js";
3
3
  import {
4
4
  rotateGatewayToken
5
- } from "./chunk-4NX4WFPB.js";
5
+ } from "./chunk-MSPZOJMJ.js";
6
6
  import {
7
7
  CREDENTIAL_SOURCES_TRIED,
8
8
  EXEC_EXIT_CODE,
@@ -45,6 +45,7 @@ import {
45
45
  get,
46
46
  getAll,
47
47
  getGlyphs,
48
+ getLatestRunForSession,
48
49
  getMostRecentAthenaSession,
49
50
  getSessionMeta,
50
51
  hintGlyphs,
@@ -52,6 +53,7 @@ import {
52
53
  isCommandPrefix,
53
54
  isScopedPermissionsRequest,
54
55
  isSupportedGatewayUrl,
56
+ listAwaitingAttentionRuns,
55
57
  listHarnessAdapters,
56
58
  listHarnessCapabilities,
57
59
  listSessions,
@@ -97,10 +99,10 @@ import {
97
99
  wrapText,
98
100
  writeAttachmentMirror,
99
101
  writeGatewayClientConfig
100
- } from "./chunk-YZ7RCBKO.js";
102
+ } from "./chunk-4HWBXCVY.js";
101
103
  import {
102
104
  generateId as generateId2
103
- } from "./chunk-QYB6N2OT.js";
105
+ } from "./chunk-USK5VSQ7.js";
104
106
  import {
105
107
  createWsClientTransport,
106
108
  dashboardClientConfigPath,
@@ -123,7 +125,7 @@ import {
123
125
  writeDashboardClientConfig,
124
126
  writeGatewayTrace,
125
127
  wsClientOptionsForEndpoint
126
- } from "./chunk-3U37HT4T.js";
128
+ } from "./chunk-VAFS446Y.js";
127
129
  import {
128
130
  McpOptionsStep,
129
131
  StepSelector,
@@ -160,7 +162,7 @@ import {
160
162
  useWorkflowSessionController,
161
163
  writeGlobalConfig,
162
164
  writeProjectConfig
163
- } from "./chunk-73V7GXV6.js";
165
+ } from "./chunk-2QV7YSX6.js";
164
166
 
165
167
  // src/app/entry/cli.tsx
166
168
  import { render } from "ink";
@@ -11883,6 +11885,21 @@ function resolveResumeTarget(input) {
11883
11885
  const createSessionId = input.createSessionId ?? crypto.randomUUID;
11884
11886
  const getSessionMetaFn = input.getSessionMetaFn ?? getSessionMeta;
11885
11887
  const getMostRecentSessionFn = input.getMostRecentSessionFn ?? getMostRecentAthenaSession;
11888
+ const getLatestRunFn = input.getLatestRunFn ?? getLatestRunForSession;
11889
+ function toTarget(meta) {
11890
+ const latestRun = getLatestRunFn(meta.id);
11891
+ if (latestRun?.status === "awaiting_attention") {
11892
+ return {
11893
+ athenaSessionId: meta.id,
11894
+ adapterResumeSessionId: latestRun.adapterSessionId ?? meta.adapterSessionIds.at(-1),
11895
+ resumeRunId: latestRun.id
11896
+ };
11897
+ }
11898
+ return {
11899
+ athenaSessionId: meta.id,
11900
+ adapterResumeSessionId: meta.adapterSessionIds.at(-1)
11901
+ };
11902
+ }
11886
11903
  const { request } = input;
11887
11904
  if (request.kind === "fresh") {
11888
11905
  return {
@@ -11896,10 +11913,7 @@ function resolveResumeTarget(input) {
11896
11913
  input.logError(input.messages.unknownExplicit(request.sessionId));
11897
11914
  return void 0;
11898
11915
  }
11899
- return {
11900
- athenaSessionId: meta.id,
11901
- adapterResumeSessionId: meta.adapterSessionIds.at(-1)
11902
- };
11916
+ return toTarget(meta);
11903
11917
  }
11904
11918
  const recent = getMostRecentSessionFn(input.projectDir);
11905
11919
  if (!recent) {
@@ -11912,10 +11926,7 @@ function resolveResumeTarget(input) {
11912
11926
  }
11913
11927
  return void 0;
11914
11928
  }
11915
- return {
11916
- athenaSessionId: recent.id,
11917
- adapterResumeSessionId: recent.adapterSessionIds.at(-1)
11918
- };
11929
+ return toTarget(recent);
11919
11930
  }
11920
11931
 
11921
11932
  // src/app/entry/execCommand.ts
@@ -11975,6 +11986,7 @@ async function runExecCommand(input, deps = {}) {
11975
11986
  harness: input.runtimeConfig.harness,
11976
11987
  athenaSessionId: continueResolution.athenaSessionId,
11977
11988
  adapterResumeSessionId: continueResolution.adapterResumeSessionId,
11989
+ resumeRunId: continueResolution.resumeRunId,
11978
11990
  isolationConfig: input.runtimeConfig.isolationConfig,
11979
11991
  pluginMcpConfig: input.runtimeConfig.pluginMcpConfig,
11980
11992
  workflow: input.runtimeConfig.workflow,
@@ -13025,7 +13037,7 @@ var cachedVersion = null;
13025
13037
  function readPackageVersion() {
13026
13038
  if (cachedVersion !== null) return cachedVersion;
13027
13039
  try {
13028
- const injected = "0.5.26";
13040
+ const injected = "0.5.28";
13029
13041
  if (typeof injected === "string" && injected.length > 0) {
13030
13042
  cachedVersion = injected;
13031
13043
  return cachedVersion;
@@ -15405,6 +15417,55 @@ async function runDoctorCommand(options) {
15405
15417
  return exitCode;
15406
15418
  }
15407
15419
 
15420
+ // src/app/entry/runsCommand.ts
15421
+ function formatAge(nowMs, thenMs) {
15422
+ const minutes = Math.max(0, Math.round((nowMs - thenMs) / 6e4));
15423
+ if (minutes < 60) return `${minutes}m ago`;
15424
+ const hours = Math.round(minutes / 60);
15425
+ if (hours < 48) return `${hours}h ago`;
15426
+ return `${Math.round(hours / 24)}d ago`;
15427
+ }
15428
+ function formatRun(run, nowMs) {
15429
+ const lines = [];
15430
+ lines.push(
15431
+ `\u25CF ${run.workflowName ?? "(no workflow)"} \u2014 awaiting attention (${formatAge(
15432
+ nowMs,
15433
+ run.sessionUpdatedAt
15434
+ )})`
15435
+ );
15436
+ lines.push(` session: ${run.athenaSessionId}`);
15437
+ lines.push(` project: ${run.projectDir}`);
15438
+ if (run.stopReason) {
15439
+ lines.push(` reason: ${run.stopReason}`);
15440
+ }
15441
+ lines.push(
15442
+ ` wake it: athena-flow exec --continue=${run.athenaSessionId} "<your reply>"`
15443
+ );
15444
+ return lines.join("\n");
15445
+ }
15446
+ function runRunsCommand(input) {
15447
+ const log = input.log ?? console.log;
15448
+ const listRunsFn = input.listRunsFn ?? listAwaitingAttentionRuns;
15449
+ const runs = listRunsFn(input.projectDir);
15450
+ if (input.json) {
15451
+ log(JSON.stringify({ awaitingAttention: runs }, null, 2));
15452
+ return 0;
15453
+ }
15454
+ if (runs.length === 0) {
15455
+ log("No workflow runs are awaiting attention.");
15456
+ return 0;
15457
+ }
15458
+ const now = Date.now();
15459
+ log(
15460
+ `${runs.length} workflow run${runs.length === 1 ? "" : "s"} awaiting attention:
15461
+ `
15462
+ );
15463
+ for (const run of runs) {
15464
+ log(formatRun(run, now) + "\n");
15465
+ }
15466
+ return 0;
15467
+ }
15468
+
15408
15469
  // src/app/entry/cli.tsx
15409
15470
  import { jsx as jsx24 } from "react/jsx-runtime";
15410
15471
  function resolvePackageJsonPath(entryUrl) {
@@ -15427,6 +15488,7 @@ var KNOWN_COMMANDS = /* @__PURE__ */ new Set([
15427
15488
  "setup",
15428
15489
  "sessions",
15429
15490
  "resume",
15491
+ "runs",
15430
15492
  "exec",
15431
15493
  "workflow",
15432
15494
  "mcp",
@@ -15567,6 +15629,7 @@ var cli = meow(
15567
15629
  setup Re-run setup wizard
15568
15630
  sessions Launch interactive session picker
15569
15631
  resume [sessionId] Resume most recent (or specified) session
15632
+ runs List workflow runs awaiting attention and how to wake them
15570
15633
  exec "<prompt>" Run non-interactively (CI/script mode)
15571
15634
  workflow <sub> Manage workflows (install, list, search, remove, upgrade, use)
15572
15635
  mcp <sub> Manage personal MCP servers (add, remove, list)
@@ -15812,7 +15875,7 @@ Available commands: ${[...KNOWN_COMMANDS].join(", ")}`
15812
15875
  await exitWith(1);
15813
15876
  return;
15814
15877
  }
15815
- const { default: WorkflowInstallWizard } = await import("./WorkflowInstallWizard-5FENJHBW.js");
15878
+ const { default: WorkflowInstallWizard } = await import("./WorkflowInstallWizard-7OSOOVS2.js");
15816
15879
  const { waitUntilExit } = render(
15817
15880
  /* @__PURE__ */ jsx24(
15818
15881
  WorkflowInstallWizard,
@@ -15932,6 +15995,14 @@ Available commands: ${[...KNOWN_COMMANDS].join(", ")}`
15932
15995
  );
15933
15996
  return;
15934
15997
  }
15998
+ if (command === "runs") {
15999
+ await exitWith(
16000
+ runRunsCommand({
16001
+ json: Boolean(cli.flags.json)
16002
+ })
16003
+ );
16004
+ return;
16005
+ }
15935
16006
  if (command === "doctor") {
15936
16007
  const harness = typeof cli.flags.harness === "string" && cli.flags.harness || "claude";
15937
16008
  await exitWith(
@@ -3,13 +3,13 @@ import {
3
3
  ensureDaemonStateDir,
4
4
  runDashboardRuntimeDaemon,
5
5
  startUdsServer
6
- } from "./chunk-YZ7RCBKO.js";
7
- import "./chunk-QYB6N2OT.js";
6
+ } from "./chunk-4HWBXCVY.js";
7
+ import "./chunk-USK5VSQ7.js";
8
8
  import {
9
9
  readDashboardClientConfig,
10
10
  refreshDashboardAccessToken
11
- } from "./chunk-3U37HT4T.js";
12
- import "./chunk-73V7GXV6.js";
11
+ } from "./chunk-VAFS446Y.js";
12
+ import "./chunk-2QV7YSX6.js";
13
13
 
14
14
  // src/infra/daemon/logFile.ts
15
15
  import fs from "fs";
@@ -3,7 +3,7 @@ import "./chunk-HXBCZAP7.js";
3
3
  import {
4
4
  ATHENA_HOOK_SOCKET_ENV,
5
5
  generateId
6
- } from "./chunk-QYB6N2OT.js";
6
+ } from "./chunk-USK5VSQ7.js";
7
7
 
8
8
  // src/harnesses/claude/hook-forwarder.ts
9
9
  import * as net from "net";
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "hooks",
18
18
  "dashboard"
19
19
  ],
20
- "version": "0.5.26",
20
+ "version": "0.5.28",
21
21
  "license": "MIT",
22
22
  "bin": {
23
23
  "athena": "dist/cli.js",
@@ -48,7 +48,7 @@
48
48
  "protocol:codex": "node scripts/update-codex-protocol-snapshot.mjs",
49
49
  "test": "vitest run",
50
50
  "test:watch": "vitest",
51
- "lint:format": "git ls-files -z | xargs -0 prettier --check --ignore-unknown",
51
+ "lint:format": "prettier --check .",
52
52
  "lint:eslint": "eslint .",
53
53
  "lint:staged": "lint-staged",
54
54
  "lint:dead": "knip --strict --exclude dependencies,unlisted,binaries",