@drisp/cli 0.5.23 → 0.5.24
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-CCCUR6KA.js → WorkflowInstallWizard-IMU47QWB.js} +2 -2
- package/dist/athena-gateway.js +26 -39
- package/dist/{chunk-MRAM6EYI.js → chunk-7GEQJQMR.js} +2 -2
- package/dist/{chunk-JHSADKDJ.js → chunk-7UUPLAP4.js} +153 -198
- package/dist/{chunk-EC67PEFT.js → chunk-QBMYQJFX.js} +734 -838
- package/dist/{chunk-BTY7MYYT.js → chunk-YU2WMPRC.js} +54 -8
- package/dist/cli.js +140 -135
- package/dist/dashboard-daemon.js +3 -3
- package/package.json +1 -1
|
@@ -475,6 +475,51 @@ function writeGatewayTrace(message) {
|
|
|
475
475
|
process.stderr.write(line);
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
+
// src/infra/db/openVersionedDb.ts
|
|
479
|
+
import fs4 from "fs";
|
|
480
|
+
import path3 from "path";
|
|
481
|
+
import Database from "better-sqlite3";
|
|
482
|
+
function migrateVersionedSchema(db, schema) {
|
|
483
|
+
db.exec(
|
|
484
|
+
"CREATE TABLE IF NOT EXISTS schema_version (version INTEGER NOT NULL)"
|
|
485
|
+
);
|
|
486
|
+
const existing = db.prepare("SELECT version FROM schema_version").get();
|
|
487
|
+
if (existing && existing.version > schema.version) {
|
|
488
|
+
throw schema.onNewerVersion?.(existing.version, schema.version) ?? new Error(
|
|
489
|
+
`Database has newer schema version ${existing.version} (expected <= ${schema.version}).`
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
schema.migrate(db, existing?.version);
|
|
493
|
+
if (!existing) {
|
|
494
|
+
db.prepare("INSERT INTO schema_version (version) VALUES (?)").run(
|
|
495
|
+
schema.version
|
|
496
|
+
);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
function openVersionedDb(dbPath, options) {
|
|
500
|
+
if (options.ensureDir && dbPath !== ":memory:") {
|
|
501
|
+
fs4.mkdirSync(path3.dirname(dbPath), {
|
|
502
|
+
recursive: true,
|
|
503
|
+
...options.dirMode !== void 0 ? { mode: options.dirMode } : {}
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
const db = new Database(dbPath);
|
|
507
|
+
db.exec("PRAGMA journal_mode = WAL");
|
|
508
|
+
if (options.foreignKeys) {
|
|
509
|
+
db.exec("PRAGMA foreign_keys = ON");
|
|
510
|
+
}
|
|
511
|
+
if (options.version === void 0) {
|
|
512
|
+
options.migrate(db, void 0);
|
|
513
|
+
} else {
|
|
514
|
+
migrateVersionedSchema(db, {
|
|
515
|
+
version: options.version,
|
|
516
|
+
migrate: options.migrate,
|
|
517
|
+
...options.onNewerVersion ? { onNewerVersion: options.onNewerVersion } : {}
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
return db;
|
|
521
|
+
}
|
|
522
|
+
|
|
478
523
|
// src/gateway/transport/types.ts
|
|
479
524
|
var TransportUnreachableError = class extends Error {
|
|
480
525
|
constructor(message) {
|
|
@@ -505,9 +550,9 @@ function redactFrame(value) {
|
|
|
505
550
|
}
|
|
506
551
|
|
|
507
552
|
// src/gateway/transport/uds.ts
|
|
508
|
-
import
|
|
553
|
+
import fs5 from "fs";
|
|
509
554
|
import net from "net";
|
|
510
|
-
import
|
|
555
|
+
import path4 from "path";
|
|
511
556
|
|
|
512
557
|
// src/gateway/transport/framing.ts
|
|
513
558
|
var DEFAULT_MAX_LINE_BYTES = 1024 * 1024;
|
|
@@ -567,7 +612,7 @@ function createUdsClientTransport(opts) {
|
|
|
567
612
|
async function listenUds(opts, onConnection) {
|
|
568
613
|
const logError = opts.logError ?? ((m) => process.stderr.write(m + "\n"));
|
|
569
614
|
await unlinkIfStale(opts.socketPath);
|
|
570
|
-
|
|
615
|
+
fs5.mkdirSync(path4.dirname(opts.socketPath), { recursive: true, mode: 448 });
|
|
571
616
|
const activeSockets = /* @__PURE__ */ new Set();
|
|
572
617
|
const server = net.createServer({ pauseOnConnect: false }, (socket) => {
|
|
573
618
|
activeSockets.add(socket);
|
|
@@ -581,7 +626,7 @@ async function listenUds(opts, onConnection) {
|
|
|
581
626
|
server.off("error", onError);
|
|
582
627
|
try {
|
|
583
628
|
if (process.platform !== "win32") {
|
|
584
|
-
|
|
629
|
+
fs5.chmodSync(opts.socketPath, 384);
|
|
585
630
|
}
|
|
586
631
|
} catch (err) {
|
|
587
632
|
logError(
|
|
@@ -599,7 +644,7 @@ async function listenUds(opts, onConnection) {
|
|
|
599
644
|
activeSockets.clear();
|
|
600
645
|
server.close(() => {
|
|
601
646
|
try {
|
|
602
|
-
|
|
647
|
+
fs5.unlinkSync(opts.socketPath);
|
|
603
648
|
} catch {
|
|
604
649
|
}
|
|
605
650
|
resolve();
|
|
@@ -638,7 +683,7 @@ async function connectUds(opts) {
|
|
|
638
683
|
return createSocketConnection(socket, "uds");
|
|
639
684
|
}
|
|
640
685
|
async function unlinkIfStale(socketPath) {
|
|
641
|
-
if (!
|
|
686
|
+
if (!fs5.existsSync(socketPath)) return;
|
|
642
687
|
const alive = await new Promise((resolve) => {
|
|
643
688
|
const probe = net.connect(socketPath);
|
|
644
689
|
const timer = setTimeout(() => {
|
|
@@ -657,7 +702,7 @@ async function unlinkIfStale(socketPath) {
|
|
|
657
702
|
});
|
|
658
703
|
if (!alive) {
|
|
659
704
|
try {
|
|
660
|
-
|
|
705
|
+
fs5.unlinkSync(socketPath);
|
|
661
706
|
} catch {
|
|
662
707
|
}
|
|
663
708
|
}
|
|
@@ -744,6 +789,7 @@ export {
|
|
|
744
789
|
readDashboardClientConfig,
|
|
745
790
|
writeDashboardClientConfig,
|
|
746
791
|
removeDashboardClientConfig,
|
|
792
|
+
openVersionedDb,
|
|
747
793
|
TransportUnreachableError,
|
|
748
794
|
traceGatewayFrame,
|
|
749
795
|
createUdsServerTransport,
|
|
@@ -772,4 +818,4 @@ export {
|
|
|
772
818
|
trackSetupCompleted,
|
|
773
819
|
refreshDashboardAccessToken
|
|
774
820
|
};
|
|
775
|
-
//# sourceMappingURL=chunk-
|
|
821
|
+
//# sourceMappingURL=chunk-YU2WMPRC.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-
|
|
5
|
+
} from "./chunk-7GEQJQMR.js";
|
|
6
6
|
import {
|
|
7
7
|
CREDENTIAL_SOURCES_TRIED,
|
|
8
8
|
EXEC_EXIT_CODE,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
GatewayUnreachableError,
|
|
11
11
|
IndexedTimeline,
|
|
12
12
|
PORTABLE_PROVIDER_ENV_VARS,
|
|
13
|
+
attachRuntimeEventLoop,
|
|
13
14
|
bootstrapRuntimeConfig,
|
|
14
15
|
buildApiKeyHelperSettings,
|
|
15
16
|
buildPostByToolUseId,
|
|
@@ -48,8 +49,6 @@ import {
|
|
|
48
49
|
getMostRecentAthenaSession,
|
|
49
50
|
getSessionMeta,
|
|
50
51
|
hintGlyphs,
|
|
51
|
-
ingestRuntimeDecision,
|
|
52
|
-
ingestRuntimeEvent,
|
|
53
52
|
isBashToolResponse,
|
|
54
53
|
isCommandPrefix,
|
|
55
54
|
isScopedPermissionsRequest,
|
|
@@ -87,6 +86,7 @@ import {
|
|
|
87
86
|
sessionsDir,
|
|
88
87
|
sliceAnsi,
|
|
89
88
|
spaces,
|
|
89
|
+
startDashboardDecisionDrain,
|
|
90
90
|
startSessionBridge,
|
|
91
91
|
stringWidth,
|
|
92
92
|
stripAnsi,
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
writeAttachmentMirror,
|
|
98
98
|
writeGatewayClientConfig,
|
|
99
99
|
wsClientOptionsForEndpoint
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-QBMYQJFX.js";
|
|
101
101
|
import {
|
|
102
102
|
generateId as generateId2
|
|
103
103
|
} from "./chunk-BTKQ67RE.js";
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
trackTelemetryOptedOut,
|
|
122
122
|
writeDashboardClientConfig,
|
|
123
123
|
writeGatewayTrace
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-YU2WMPRC.js";
|
|
125
125
|
import {
|
|
126
126
|
McpOptionsStep,
|
|
127
127
|
StepSelector,
|
|
@@ -158,7 +158,7 @@ import {
|
|
|
158
158
|
useWorkflowSessionController,
|
|
159
159
|
writeGlobalConfig,
|
|
160
160
|
writeProjectConfig
|
|
161
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-7UUPLAP4.js";
|
|
162
162
|
|
|
163
163
|
// src/app/entry/cli.tsx
|
|
164
164
|
import { render } from "ink";
|
|
@@ -1741,20 +1741,14 @@ function useFeed(runtime, messages = [], initialAllowedTools, sessionStore, opti
|
|
|
1741
1741
|
dashboardDecisionInboxRef.current = createDashboardDecisionInbox();
|
|
1742
1742
|
}
|
|
1743
1743
|
const inbox = dashboardDecisionInboxRef.current;
|
|
1744
|
-
const
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
};
|
|
1751
|
-
applyPending();
|
|
1752
|
-
const interval = setInterval(
|
|
1753
|
-
applyPending,
|
|
1754
|
-
options?.dashboardDecisionPollIntervalMs ?? 1e3
|
|
1755
|
-
);
|
|
1744
|
+
const drain = startDashboardDecisionDrain({
|
|
1745
|
+
runtime,
|
|
1746
|
+
inbox,
|
|
1747
|
+
athenaSessionId,
|
|
1748
|
+
...options?.dashboardDecisionPollIntervalMs !== void 0 ? { pollIntervalMs: options.dashboardDecisionPollIntervalMs } : {}
|
|
1749
|
+
});
|
|
1756
1750
|
return () => {
|
|
1757
|
-
|
|
1751
|
+
drain.stop();
|
|
1758
1752
|
};
|
|
1759
1753
|
}, [
|
|
1760
1754
|
runtime,
|
|
@@ -1943,43 +1937,47 @@ function useFeed(runtime, messages = [], initialAllowedTools, sessionStore, opti
|
|
|
1943
1937
|
...options?.relayQuestion ? { relayQuestion: options.relayQuestion } : {},
|
|
1944
1938
|
signal: abortRef.current.signal
|
|
1945
1939
|
};
|
|
1946
|
-
const
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1940
|
+
const loop = attachRuntimeEventLoop({
|
|
1941
|
+
runtime,
|
|
1942
|
+
ingest: () => ({
|
|
1943
|
+
mapper: mapperRef.current,
|
|
1944
|
+
store: sessionStoreRef.current,
|
|
1945
|
+
controllerCallbacks
|
|
1946
|
+
}),
|
|
1947
|
+
wrapEvent: (runtimeEvent, run) => {
|
|
1948
|
+
const parentCycleId = getActivePerfCycleId();
|
|
1949
|
+
const cycleId = startPerfCycle(`feed:${runtimeEvent.kind}`, {
|
|
1950
|
+
parent_cycle_id: parentCycleId ?? void 0,
|
|
1951
|
+
runtime_event_id: runtimeEvent.id,
|
|
1952
|
+
runtime_kind: runtimeEvent.kind,
|
|
1953
|
+
hook_name: runtimeEvent.hookName,
|
|
1954
|
+
tool_name: runtimeEvent.toolName
|
|
1955
|
+
});
|
|
1956
|
+
logPerfEvent("feed.runtime_event", {
|
|
1957
|
+
cycle_id: cycleId ?? void 0,
|
|
1958
|
+
runtime_event_id: runtimeEvent.id,
|
|
1959
|
+
runtime_kind: runtimeEvent.kind,
|
|
1960
|
+
hook_name: runtimeEvent.hookName,
|
|
1961
|
+
tool_name: runtimeEvent.toolName
|
|
1962
|
+
});
|
|
1963
|
+
const doneCause = startPerfStage("cause.start", {
|
|
1964
|
+
source: "runtime.event",
|
|
1965
|
+
runtime_kind: runtimeEvent.kind
|
|
1966
|
+
});
|
|
1967
|
+
try {
|
|
1968
|
+
run();
|
|
1969
|
+
} finally {
|
|
1970
|
+
doneCause();
|
|
1971
|
+
}
|
|
1972
|
+
},
|
|
1973
|
+
onEventReceived: (runtimeEvent) => {
|
|
1967
1974
|
if (options?.relayPermission && runtimeEvent.kind === "permission.request") {
|
|
1968
1975
|
writeGatewayTrace(
|
|
1969
1976
|
`useFeed permission event relay-enabled id=${runtimeEvent.id} tool=${runtimeEvent.toolName ?? ""}`
|
|
1970
1977
|
);
|
|
1971
1978
|
}
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
{
|
|
1975
|
-
mapper: mapperRef.current,
|
|
1976
|
-
store: sessionStoreRef.current,
|
|
1977
|
-
controllerCallbacks
|
|
1978
|
-
}
|
|
1979
|
-
);
|
|
1980
|
-
if (decision) {
|
|
1981
|
-
runtime.sendDecision(runtimeEvent.id, decision);
|
|
1982
|
-
}
|
|
1979
|
+
},
|
|
1980
|
+
emitEventFeed: (newFeedEvents, runtimeEvent) => {
|
|
1983
1981
|
if (!abortRef.current.signal.aborted && newFeedEvents.length > 0) {
|
|
1984
1982
|
for (const fe of newFeedEvents) {
|
|
1985
1983
|
if (fe.kind === "permission.decision" && fe.cause?.hook_request_id) {
|
|
@@ -1989,12 +1987,8 @@ function useFeed(runtime, messages = [], initialAllowedTools, sessionStore, opti
|
|
|
1989
1987
|
feedStoreRef.current.pushEvents(newFeedEvents);
|
|
1990
1988
|
publishDashboardFeedEvents(newFeedEvents, runtimeEvent);
|
|
1991
1989
|
}
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
}
|
|
1995
|
-
});
|
|
1996
|
-
const unsubDecision = runtime.onDecision(
|
|
1997
|
-
(eventId, decision) => {
|
|
1990
|
+
},
|
|
1991
|
+
wrapDecision: (eventId, decision, run) => {
|
|
1998
1992
|
const parentCycleId = getActivePerfCycleId();
|
|
1999
1993
|
const cycleId = startPerfCycle("feed:decision", {
|
|
2000
1994
|
parent_cycle_id: parentCycleId ?? void 0,
|
|
@@ -2013,31 +2007,31 @@ function useFeed(runtime, messages = [], initialAllowedTools, sessionStore, opti
|
|
|
2013
2007
|
decision_source: decision.source
|
|
2014
2008
|
});
|
|
2015
2009
|
try {
|
|
2016
|
-
|
|
2017
|
-
if (decision.intent?.kind === "question_answer" || decision.source === "timeout") {
|
|
2018
|
-
dequeueQuestion(eventId);
|
|
2019
|
-
}
|
|
2020
|
-
const feedEvent = ingestRuntimeDecision(eventId, decision, {
|
|
2021
|
-
mapper: mapperRef.current,
|
|
2022
|
-
store: sessionStoreRef.current
|
|
2023
|
-
});
|
|
2024
|
-
if (feedEvent) {
|
|
2025
|
-
feedStoreRef.current.pushEvents([feedEvent]);
|
|
2026
|
-
publishDashboardFeedEvents([feedEvent]);
|
|
2027
|
-
if (feedEvent.kind === "permission.decision" && feedEvent.cause?.hook_request_id) {
|
|
2028
|
-
dequeuePermission(feedEvent.cause.hook_request_id);
|
|
2029
|
-
}
|
|
2030
|
-
}
|
|
2010
|
+
run();
|
|
2031
2011
|
} finally {
|
|
2032
2012
|
doneCause();
|
|
2033
2013
|
}
|
|
2014
|
+
},
|
|
2015
|
+
skipDecision: () => abortRef.current.signal.aborted,
|
|
2016
|
+
beforeDecisionIngest: (eventId, decision) => {
|
|
2017
|
+
if (decision.intent?.kind === "question_answer" || decision.source === "timeout") {
|
|
2018
|
+
dequeueQuestion(eventId);
|
|
2019
|
+
}
|
|
2020
|
+
},
|
|
2021
|
+
emitDecisionFeed: (feedEvent) => {
|
|
2022
|
+
if (feedEvent) {
|
|
2023
|
+
feedStoreRef.current.pushEvents([feedEvent]);
|
|
2024
|
+
publishDashboardFeedEvents([feedEvent]);
|
|
2025
|
+
if (feedEvent.kind === "permission.decision" && feedEvent.cause?.hook_request_id) {
|
|
2026
|
+
dequeuePermission(feedEvent.cause.hook_request_id);
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2034
2029
|
}
|
|
2035
|
-
);
|
|
2030
|
+
});
|
|
2036
2031
|
refreshRuntimeStatus(true);
|
|
2037
2032
|
return () => {
|
|
2038
2033
|
abortRef.current.abort();
|
|
2039
|
-
|
|
2040
|
-
unsubDecision();
|
|
2034
|
+
loop.stop();
|
|
2041
2035
|
};
|
|
2042
2036
|
}, [
|
|
2043
2037
|
runtime,
|
|
@@ -11943,44 +11937,62 @@ function shouldShowSetup({
|
|
|
11943
11937
|
}
|
|
11944
11938
|
|
|
11945
11939
|
// src/app/entry/execCommand.ts
|
|
11940
|
+
import crypto2 from "crypto";
|
|
11941
|
+
|
|
11942
|
+
// src/app/entry/resumeResolution.ts
|
|
11946
11943
|
import crypto from "crypto";
|
|
11947
|
-
function
|
|
11948
|
-
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
if (
|
|
11944
|
+
function resolveResumeTarget(input) {
|
|
11945
|
+
const createSessionId = input.createSessionId ?? crypto.randomUUID;
|
|
11946
|
+
const getSessionMetaFn = input.getSessionMetaFn ?? getSessionMeta;
|
|
11947
|
+
const getMostRecentSessionFn = input.getMostRecentSessionFn ?? getMostRecentAthenaSession;
|
|
11948
|
+
const { request } = input;
|
|
11949
|
+
if (request.kind === "fresh") {
|
|
11953
11950
|
return {
|
|
11954
|
-
athenaSessionId:
|
|
11951
|
+
athenaSessionId: createSessionId(),
|
|
11955
11952
|
adapterResumeSessionId: void 0
|
|
11956
11953
|
};
|
|
11957
11954
|
}
|
|
11958
|
-
if (
|
|
11959
|
-
const
|
|
11960
|
-
if (!
|
|
11961
|
-
input.logError(
|
|
11962
|
-
"Error: --continue was provided but no previous Athena sessions exist for this project."
|
|
11963
|
-
);
|
|
11955
|
+
if (request.kind === "explicit") {
|
|
11956
|
+
const meta = getSessionMetaFn(request.sessionId);
|
|
11957
|
+
if (!meta) {
|
|
11958
|
+
input.logError(input.messages.unknownExplicit(request.sessionId));
|
|
11964
11959
|
return void 0;
|
|
11965
11960
|
}
|
|
11966
11961
|
return {
|
|
11967
|
-
athenaSessionId:
|
|
11968
|
-
adapterResumeSessionId:
|
|
11962
|
+
athenaSessionId: meta.id,
|
|
11963
|
+
adapterResumeSessionId: meta.adapterSessionIds.at(-1)
|
|
11969
11964
|
};
|
|
11970
11965
|
}
|
|
11971
|
-
const
|
|
11972
|
-
if (!
|
|
11973
|
-
input.logError(
|
|
11966
|
+
const recent = getMostRecentSessionFn(input.projectDir);
|
|
11967
|
+
if (!recent) {
|
|
11968
|
+
input.logError(input.messages.missingRecent);
|
|
11969
|
+
if (input.missingRecentPolicy === "fresh") {
|
|
11970
|
+
return {
|
|
11971
|
+
athenaSessionId: createSessionId(),
|
|
11972
|
+
adapterResumeSessionId: void 0
|
|
11973
|
+
};
|
|
11974
|
+
}
|
|
11974
11975
|
return void 0;
|
|
11975
11976
|
}
|
|
11976
11977
|
return {
|
|
11977
|
-
athenaSessionId:
|
|
11978
|
-
adapterResumeSessionId:
|
|
11978
|
+
athenaSessionId: recent.id,
|
|
11979
|
+
adapterResumeSessionId: recent.adapterSessionIds.at(-1)
|
|
11979
11980
|
};
|
|
11980
11981
|
}
|
|
11982
|
+
|
|
11983
|
+
// src/app/entry/execCommand.ts
|
|
11984
|
+
function isValidTimeout(timeoutMs) {
|
|
11985
|
+
if (timeoutMs === void 0) return true;
|
|
11986
|
+
return Number.isFinite(timeoutMs) && timeoutMs > 0;
|
|
11987
|
+
}
|
|
11988
|
+
function continueFlagToRequest(continueFlag) {
|
|
11989
|
+
if (continueFlag === void 0) return { kind: "fresh" };
|
|
11990
|
+
if (continueFlag === "") return { kind: "most-recent" };
|
|
11991
|
+
return { kind: "explicit", sessionId: continueFlag };
|
|
11992
|
+
}
|
|
11981
11993
|
async function runExecCommand(input, deps = {}) {
|
|
11982
11994
|
const logError = deps.logError ?? console.error;
|
|
11983
|
-
const createSessionId = deps.createSessionId ??
|
|
11995
|
+
const createSessionId = deps.createSessionId ?? crypto2.randomUUID;
|
|
11984
11996
|
const runExecFn = deps.runExecFn ?? runExec;
|
|
11985
11997
|
const getMostRecentSessionFn = deps.getMostRecentSessionFn ?? getMostRecentAthenaSession;
|
|
11986
11998
|
const getSessionMetaFn = deps.getSessionMetaFn ?? getSessionMeta;
|
|
@@ -11994,9 +12006,17 @@ async function runExecCommand(input, deps = {}) {
|
|
|
11994
12006
|
}
|
|
11995
12007
|
let continueResolution;
|
|
11996
12008
|
try {
|
|
11997
|
-
continueResolution =
|
|
12009
|
+
continueResolution = resolveResumeTarget({
|
|
11998
12010
|
projectDir: input.projectDir,
|
|
11999
|
-
|
|
12011
|
+
request: continueFlagToRequest(input.flags.continueFlag),
|
|
12012
|
+
// Headless exec treats a missing resume target as a hard error rather
|
|
12013
|
+
// than silently starting fresh, so a resume request that finds nothing
|
|
12014
|
+
// exits non-zero for callers/scripts.
|
|
12015
|
+
missingRecentPolicy: "error",
|
|
12016
|
+
messages: {
|
|
12017
|
+
unknownExplicit: (sessionId) => `Error: Unknown Athena session ID: ${sessionId}`,
|
|
12018
|
+
missingRecent: "Error: --continue was provided but no previous Athena sessions exist for this project."
|
|
12019
|
+
},
|
|
12000
12020
|
createSessionId,
|
|
12001
12021
|
getMostRecentSessionFn,
|
|
12002
12022
|
getSessionMetaFn,
|
|
@@ -12032,43 +12052,28 @@ async function runExecCommand(input, deps = {}) {
|
|
|
12032
12052
|
}
|
|
12033
12053
|
|
|
12034
12054
|
// src/app/entry/interactiveSession.ts
|
|
12035
|
-
import crypto2 from "crypto";
|
|
12036
12055
|
function resolveInteractiveSession(input) {
|
|
12037
|
-
const
|
|
12038
|
-
const
|
|
12039
|
-
|
|
12040
|
-
|
|
12041
|
-
|
|
12042
|
-
|
|
12043
|
-
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
Use 'athena-flow sessions' to choose an available session
|
|
12047
|
-
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
|
|
12051
|
-
|
|
12052
|
-
|
|
12053
|
-
|
|
12054
|
-
|
|
12055
|
-
if (input.resumeMostRecent) {
|
|
12056
|
-
const recent = getMostRecentSessionFn(input.projectDir);
|
|
12057
|
-
if (!recent) {
|
|
12058
|
-
logError("No previous sessions found. Starting new session.");
|
|
12059
|
-
return {
|
|
12060
|
-
athenaSessionId: createSessionId(),
|
|
12061
|
-
initialSessionId: void 0
|
|
12062
|
-
};
|
|
12063
|
-
}
|
|
12064
|
-
return {
|
|
12065
|
-
athenaSessionId: recent.id,
|
|
12066
|
-
initialSessionId: recent.adapterSessionIds.at(-1)
|
|
12067
|
-
};
|
|
12068
|
-
}
|
|
12056
|
+
const request = input.resumeSessionId ? { kind: "explicit", sessionId: input.resumeSessionId } : input.resumeMostRecent ? { kind: "most-recent" } : { kind: "fresh" };
|
|
12057
|
+
const target = resolveResumeTarget({
|
|
12058
|
+
projectDir: input.projectDir,
|
|
12059
|
+
request,
|
|
12060
|
+
// Interactive falls back to a fresh session when resume-most-recent finds
|
|
12061
|
+
// no history — the terminal stays usable rather than exiting.
|
|
12062
|
+
missingRecentPolicy: "fresh",
|
|
12063
|
+
messages: {
|
|
12064
|
+
unknownExplicit: (sessionId) => `Unknown session ID: ${sessionId}
|
|
12065
|
+
Use 'athena-flow sessions' to choose an available session.`,
|
|
12066
|
+
missingRecent: "No previous sessions found. Starting new session."
|
|
12067
|
+
},
|
|
12068
|
+
logError: input.logError ?? console.error,
|
|
12069
|
+
...input.createSessionId ? { createSessionId: input.createSessionId } : {},
|
|
12070
|
+
...input.getSessionMetaFn ? { getSessionMetaFn: input.getSessionMetaFn } : {},
|
|
12071
|
+
...input.getMostRecentSessionFn ? { getMostRecentSessionFn: input.getMostRecentSessionFn } : {}
|
|
12072
|
+
});
|
|
12073
|
+
if (!target) return void 0;
|
|
12069
12074
|
return {
|
|
12070
|
-
athenaSessionId:
|
|
12071
|
-
initialSessionId:
|
|
12075
|
+
athenaSessionId: target.athenaSessionId,
|
|
12076
|
+
initialSessionId: target.adapterResumeSessionId
|
|
12072
12077
|
};
|
|
12073
12078
|
}
|
|
12074
12079
|
|
|
@@ -12697,7 +12702,7 @@ var cachedVersion = null;
|
|
|
12697
12702
|
function readPackageVersion() {
|
|
12698
12703
|
if (cachedVersion !== null) return cachedVersion;
|
|
12699
12704
|
try {
|
|
12700
|
-
const injected = "0.5.
|
|
12705
|
+
const injected = "0.5.24";
|
|
12701
12706
|
if (typeof injected === "string" && injected.length > 0) {
|
|
12702
12707
|
cachedVersion = injected;
|
|
12703
12708
|
return cachedVersion;
|
|
@@ -15444,7 +15449,7 @@ Available commands: ${[...KNOWN_COMMANDS].join(", ")}`
|
|
|
15444
15449
|
await exitWith(1);
|
|
15445
15450
|
return;
|
|
15446
15451
|
}
|
|
15447
|
-
const { default: WorkflowInstallWizard } = await import("./WorkflowInstallWizard-
|
|
15452
|
+
const { default: WorkflowInstallWizard } = await import("./WorkflowInstallWizard-IMU47QWB.js");
|
|
15448
15453
|
const { waitUntilExit } = render(
|
|
15449
15454
|
/* @__PURE__ */ jsx25(
|
|
15450
15455
|
WorkflowInstallWizard,
|
package/dist/dashboard-daemon.js
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
ensureDaemonStateDir,
|
|
4
4
|
runDashboardRuntimeDaemon,
|
|
5
5
|
startUdsServer
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QBMYQJFX.js";
|
|
7
7
|
import "./chunk-BTKQ67RE.js";
|
|
8
8
|
import {
|
|
9
9
|
readDashboardClientConfig,
|
|
10
10
|
refreshDashboardAccessToken
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-YU2WMPRC.js";
|
|
12
|
+
import "./chunk-7UUPLAP4.js";
|
|
13
13
|
|
|
14
14
|
// src/infra/daemon/logFile.ts
|
|
15
15
|
import fs from "fs";
|