praxis-agent 0.20.14 → 0.20.18
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/application/scheduled-prompt-manager.d.ts +4 -0
- package/dist/application/scheduled-prompt-manager.js +31 -2
- package/dist/application/session-service.d.ts +6 -1
- package/dist/application/session-service.js +97 -13
- package/dist/cli/interactive.js +1 -1
- package/dist/cli/tui/claude-style.d.ts +3 -2
- package/dist/cli/tui/claude-style.js +13 -7
- package/dist/cli-runtime.d.ts +9 -0
- package/dist/cli-runtime.js +56 -14
- package/dist/compatibility/claude/paths.d.ts +15 -0
- package/dist/compatibility/claude/paths.js +101 -1
- package/package.json +1 -1
|
@@ -38,6 +38,7 @@ export declare class ScheduledPromptManager {
|
|
|
38
38
|
private readonly sessionTasks;
|
|
39
39
|
private readonly dueAt;
|
|
40
40
|
private readonly dueQueue;
|
|
41
|
+
private readonly pendingConfirmations;
|
|
41
42
|
private readonly dynamicWakeups;
|
|
42
43
|
private readonly dynamicLoopStates;
|
|
43
44
|
private readonly durableIds;
|
|
@@ -54,6 +55,9 @@ export declare class ScheduledPromptManager {
|
|
|
54
55
|
create(input: CreateScheduledPromptInput): Promise<ListedScheduledPrompt>;
|
|
55
56
|
list(): Promise<ListedScheduledPrompt[]>;
|
|
56
57
|
delete(id: string): Promise<boolean>;
|
|
58
|
+
pendingScheduledPrompts(): ScheduledPrompt[];
|
|
59
|
+
approveScheduledPrompt(id: string): boolean;
|
|
60
|
+
declineScheduledPrompt(id: string): boolean;
|
|
57
61
|
scheduleWakeup(input: {
|
|
58
62
|
delaySeconds: number;
|
|
59
63
|
prompt: string;
|
|
@@ -97,6 +97,7 @@ export class ScheduledPromptManager {
|
|
|
97
97
|
sessionTasks = new Map();
|
|
98
98
|
dueAt = new Map();
|
|
99
99
|
dueQueue = [];
|
|
100
|
+
pendingConfirmations = new Map();
|
|
100
101
|
dynamicWakeups = new Map();
|
|
101
102
|
dynamicLoopStates = new Map();
|
|
102
103
|
durableIds = new Set();
|
|
@@ -181,10 +182,29 @@ export class ScheduledPromptManager {
|
|
|
181
182
|
async delete(id) {
|
|
182
183
|
await this.initialize();
|
|
183
184
|
const removed = await this.removeTask(id);
|
|
184
|
-
|
|
185
|
+
const declined = this.pendingConfirmations.delete(id);
|
|
186
|
+
if (removed || declined) {
|
|
185
187
|
this.dueAt.delete(id);
|
|
186
188
|
this.notifyChange();
|
|
187
189
|
}
|
|
190
|
+
return removed || declined;
|
|
191
|
+
}
|
|
192
|
+
pendingScheduledPrompts() {
|
|
193
|
+
return [...this.pendingConfirmations.values()];
|
|
194
|
+
}
|
|
195
|
+
approveScheduledPrompt(id) {
|
|
196
|
+
const pending = this.pendingConfirmations.get(id);
|
|
197
|
+
if (!pending)
|
|
198
|
+
return false;
|
|
199
|
+
this.pendingConfirmations.delete(id);
|
|
200
|
+
this.dueQueue.push(pending);
|
|
201
|
+
this.notifyChange();
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
declineScheduledPrompt(id) {
|
|
205
|
+
const removed = this.pendingConfirmations.delete(id);
|
|
206
|
+
if (removed)
|
|
207
|
+
this.notifyChange();
|
|
188
208
|
return removed;
|
|
189
209
|
}
|
|
190
210
|
scheduleWakeup(input) {
|
|
@@ -278,6 +298,7 @@ export class ScheduledPromptManager {
|
|
|
278
298
|
this.sessionTasks.clear();
|
|
279
299
|
this.dueAt.clear();
|
|
280
300
|
this.durableIds.clear();
|
|
301
|
+
this.pendingConfirmations.clear();
|
|
281
302
|
this.dueQueue.length = 0;
|
|
282
303
|
this.notifyChange();
|
|
283
304
|
}
|
|
@@ -316,7 +337,15 @@ export class ScheduledPromptManager {
|
|
|
316
337
|
if (this.closed)
|
|
317
338
|
return;
|
|
318
339
|
this.durableIds.delete(task.id);
|
|
319
|
-
|
|
340
|
+
if (task.recurring) {
|
|
341
|
+
this.dueQueue.push({ id: task.id, prompt: task.prompt });
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
this.pendingConfirmations.set(task.id, {
|
|
345
|
+
id: task.id,
|
|
346
|
+
prompt: task.prompt,
|
|
347
|
+
});
|
|
348
|
+
}
|
|
320
349
|
}
|
|
321
350
|
}
|
|
322
351
|
}
|
|
@@ -13,6 +13,7 @@ import type { ClaudeHookRunner } from '../hooks/claude-hooks.js';
|
|
|
13
13
|
import { type TranscriptParseIssue } from '../persistence/claude-transcript-store.js';
|
|
14
14
|
import type { ClaudeCostStateStore } from '../persistence/claude-cost-state-store.js';
|
|
15
15
|
import { type AgentPermissionMode } from './subagent-service.js';
|
|
16
|
+
import { type ScheduledPrompt } from './scheduled-prompt-manager.js';
|
|
16
17
|
import { type WorkflowTaskSnapshot } from './workflow-manager.js';
|
|
17
18
|
import type { WorkspaceContext } from './session-worktree.js';
|
|
18
19
|
import { type ClaudeSessionCostSnapshot } from './session-cost-tracker.js';
|
|
@@ -157,6 +158,7 @@ export declare class ClaudeSessionService {
|
|
|
157
158
|
private readonly backgroundTasks;
|
|
158
159
|
private readonly worktreeManager;
|
|
159
160
|
private readonly sessionCwds;
|
|
161
|
+
private readonly discoveredProjectRoots;
|
|
160
162
|
private readonly sessionPermissionUpdates;
|
|
161
163
|
private readonly hostedSubagents;
|
|
162
164
|
private readonly hostedSubagentsByRegistry;
|
|
@@ -169,7 +171,9 @@ export declare class ClaudeSessionService {
|
|
|
169
171
|
private closeCostSavePromise;
|
|
170
172
|
private runtimeCwd;
|
|
171
173
|
constructor(options: ClaudeSessionServiceOptions);
|
|
172
|
-
nextScheduledPrompt(signal?: AbortSignal): Promise<
|
|
174
|
+
nextScheduledPrompt(signal?: AbortSignal): Promise<ScheduledPrompt | null>;
|
|
175
|
+
private nextScheduledPromptForManager;
|
|
176
|
+
private confirmPendingScheduledPrompt;
|
|
173
177
|
workflows(): readonly WorkflowTaskSnapshot[];
|
|
174
178
|
mcpInspect(): Promise<readonly ClaudeMcpServerStatus[]>;
|
|
175
179
|
mcpReconnect(name: string): Promise<void>;
|
|
@@ -231,6 +235,7 @@ export declare class ClaudeSessionService {
|
|
|
231
235
|
private activeCwd;
|
|
232
236
|
private restoreWorktree;
|
|
233
237
|
private paths;
|
|
238
|
+
private discoverProjectRoot;
|
|
234
239
|
private appendCdCommand;
|
|
235
240
|
private appendAgentColorUsage;
|
|
236
241
|
private appendSystemLocalCommand;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { appendFile, copyFile, link, lstat, mkdir, readdir, realpath, stat, unlink, } from 'node:fs/promises';
|
|
3
3
|
import { homedir } from 'node:os';
|
|
4
|
-
import { basename, extname, isAbsolute, join, relative } from 'node:path';
|
|
4
|
+
import { basename, extname, isAbsolute, join, relative, resolve, } from 'node:path';
|
|
5
5
|
import { AGENT_COLOR_DEFAULT, agentColorMessage, getClaudeEffectiveAgentColor, } from '../compatibility/claude/agent-color.js';
|
|
6
6
|
import { createClaudeCompactEntries, formatClaudeCompactSummary, getCumulativeDroppedTokens, } from '../compatibility/claude/compaction.js';
|
|
7
|
-
import { isClaudeSessionId, resolveClaudePaths, resolveClaudeScheduledTaskFile, } from '../compatibility/claude/paths.js';
|
|
7
|
+
import { discoverClaudeProjectRoot, isClaudeSessionId, resolveClaudePaths, resolveClaudeScheduledTaskFile, } from '../compatibility/claude/paths.js';
|
|
8
8
|
import { downloadClaudeFileResources, } from '../compatibility/claude/file-resources.js';
|
|
9
9
|
import { createClaudeNativeFork } from '../compatibility/claude/fork.js';
|
|
10
10
|
import { selectClaudeActiveTranscript, selectClaudeTranscriptAtMessage, } from '../compatibility/claude/history.js';
|
|
@@ -24,7 +24,7 @@ import { ClaudeTranscriptStore, } from '../persistence/claude-transcript-store.j
|
|
|
24
24
|
import { InMemoryTranscriptStore } from '../persistence/in-memory-transcript-store.js';
|
|
25
25
|
import { ModelCompactor } from './model-compactor.js';
|
|
26
26
|
import { agentMemoryPrompt, ClaudeSubagentExecutor, StructuredOutputRegistry, } from './subagent-service.js';
|
|
27
|
-
import { ScheduledPromptManager } from './scheduled-prompt-manager.js';
|
|
27
|
+
import { ScheduledPromptManager, } from './scheduled-prompt-manager.js';
|
|
28
28
|
import { ClaudeScheduledToolRegistry } from '../tools/claude-scheduled-tools.js';
|
|
29
29
|
import { ClaudeTaskToolRegistry } from '../tools/claude-task-tools.js';
|
|
30
30
|
import { ClaudeWorkflowToolRegistry } from '../tools/claude-workflow-tools.js';
|
|
@@ -312,6 +312,7 @@ export class ClaudeSessionService {
|
|
|
312
312
|
backgroundTasks;
|
|
313
313
|
worktreeManager;
|
|
314
314
|
sessionCwds = new Map();
|
|
315
|
+
discoveredProjectRoots = new Map();
|
|
315
316
|
sessionPermissionUpdates = new Map();
|
|
316
317
|
hostedSubagents = new Set();
|
|
317
318
|
hostedSubagentsByRegistry = new WeakMap();
|
|
@@ -359,7 +360,53 @@ export class ClaudeSessionService {
|
|
|
359
360
|
}
|
|
360
361
|
}
|
|
361
362
|
nextScheduledPrompt(signal) {
|
|
362
|
-
|
|
363
|
+
const manager = this.scheduledPrompts;
|
|
364
|
+
if (!manager)
|
|
365
|
+
return Promise.resolve(null);
|
|
366
|
+
return this.nextScheduledPromptForManager(manager, signal);
|
|
367
|
+
}
|
|
368
|
+
async nextScheduledPromptForManager(manager, signal) {
|
|
369
|
+
// Scan durable tasks so a missed one-shot surfaces as a pending
|
|
370
|
+
// confirmation instead of silently entering the normal due drain.
|
|
371
|
+
await manager.list();
|
|
372
|
+
const pending = manager.pendingScheduledPrompts()[0];
|
|
373
|
+
if (!pending)
|
|
374
|
+
return manager.next(signal);
|
|
375
|
+
const askUser = this.options.interactiveTools?.callbacks.askUser;
|
|
376
|
+
if (!askUser)
|
|
377
|
+
return manager.next(signal);
|
|
378
|
+
const approved = await this.confirmPendingScheduledPrompt(manager, pending, askUser, signal);
|
|
379
|
+
if (!approved)
|
|
380
|
+
return null;
|
|
381
|
+
// Consume the approved prompt from the scheduler due queue exactly once.
|
|
382
|
+
return manager.next(signal);
|
|
383
|
+
}
|
|
384
|
+
async confirmPendingScheduledPrompt(manager, pending, askUser, signal) {
|
|
385
|
+
const question = {
|
|
386
|
+
header: 'Missed scheduled prompt',
|
|
387
|
+
question: pending.prompt,
|
|
388
|
+
options: [
|
|
389
|
+
{
|
|
390
|
+
label: 'Run now',
|
|
391
|
+
description: 'Run this scheduled prompt that was missed while Praxis was not running.',
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
label: 'Skip',
|
|
395
|
+
description: 'Decline this scheduled prompt and discard it.',
|
|
396
|
+
},
|
|
397
|
+
],
|
|
398
|
+
multiSelect: false,
|
|
399
|
+
};
|
|
400
|
+
const result = await askUser([question], signal);
|
|
401
|
+
const decision = result?.answers[question.question];
|
|
402
|
+
if (decision === 'Run now') {
|
|
403
|
+
return manager.approveScheduledPrompt(pending.id);
|
|
404
|
+
}
|
|
405
|
+
if (decision === 'Skip') {
|
|
406
|
+
manager.declineScheduledPrompt(pending.id);
|
|
407
|
+
return false;
|
|
408
|
+
}
|
|
409
|
+
return false;
|
|
363
410
|
}
|
|
364
411
|
workflows() {
|
|
365
412
|
return this.workflowManager?.list() ?? [];
|
|
@@ -817,23 +864,31 @@ export class ClaudeSessionService {
|
|
|
817
864
|
return validSessionName(metrics.text);
|
|
818
865
|
}
|
|
819
866
|
async sessions() {
|
|
820
|
-
const
|
|
867
|
+
const discoveredRoot = await discoverClaudeProjectRoot({
|
|
868
|
+
configRoot: this.options.configRoot,
|
|
869
|
+
cwd: this.activeCwd(),
|
|
870
|
+
});
|
|
871
|
+
const projectRoot = discoveredRoot ?? this.paths(randomUUID()).projectRoot;
|
|
821
872
|
let names;
|
|
822
873
|
try {
|
|
823
|
-
names = await readdir(
|
|
874
|
+
names = await readdir(projectRoot);
|
|
824
875
|
}
|
|
825
876
|
catch (error) {
|
|
826
877
|
if (error.code === 'ENOENT')
|
|
827
878
|
return [];
|
|
828
879
|
throw error;
|
|
829
880
|
}
|
|
830
|
-
const
|
|
881
|
+
const sessionIds = names
|
|
831
882
|
.filter((name) => extname(name) === '.jsonl')
|
|
832
|
-
.map(
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
883
|
+
.map((name) => basename(name, '.jsonl'))
|
|
884
|
+
.filter((sessionId) => isClaudeSessionId(sessionId));
|
|
885
|
+
if (discoveredRoot !== undefined) {
|
|
886
|
+
for (const sessionId of sessionIds) {
|
|
887
|
+
this.discoveredProjectRoots.set(sessionId, projectRoot);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
const summaries = await Promise.all(sessionIds.map(async (sessionId) => {
|
|
891
|
+
const sessionFile = join(projectRoot, `${sessionId}.jsonl`);
|
|
837
892
|
try {
|
|
838
893
|
const metadata = await lstat(sessionFile);
|
|
839
894
|
if (!metadata.isFile())
|
|
@@ -872,6 +927,7 @@ export class ClaudeSessionService {
|
|
|
872
927
|
}
|
|
873
928
|
async inspect(sessionId) {
|
|
874
929
|
this.assertSessionPersistence();
|
|
930
|
+
await this.discoverProjectRoot(sessionId);
|
|
875
931
|
const paths = this.paths(sessionId);
|
|
876
932
|
let metadata;
|
|
877
933
|
try {
|
|
@@ -912,6 +968,7 @@ export class ClaudeSessionService {
|
|
|
912
968
|
}
|
|
913
969
|
async export(sessionId) {
|
|
914
970
|
this.assertSessionPersistence();
|
|
971
|
+
await this.discoverProjectRoot(sessionId);
|
|
915
972
|
try {
|
|
916
973
|
return await this.store(sessionId).exportReadOnly();
|
|
917
974
|
}
|
|
@@ -923,6 +980,7 @@ export class ClaudeSessionService {
|
|
|
923
980
|
}
|
|
924
981
|
}
|
|
925
982
|
async transcript(sessionId, resumeSessionAt) {
|
|
983
|
+
await this.discoverProjectRoot(sessionId);
|
|
926
984
|
try {
|
|
927
985
|
const recovery = await this.store(sessionId).loadReadOnly();
|
|
928
986
|
if (recovery.entries.length === 0) {
|
|
@@ -1048,6 +1106,9 @@ export class ClaudeSessionService {
|
|
|
1048
1106
|
if (relocated.status === 'conflict') {
|
|
1049
1107
|
throw new Error(`Claude transcript relocation conflict: ${relocated.reason}`);
|
|
1050
1108
|
}
|
|
1109
|
+
// The transcript moved to the exact root for the new cwd; any
|
|
1110
|
+
// previously discovered alternate-hash root is now stale.
|
|
1111
|
+
this.discoveredProjectRoots.delete(sessionId);
|
|
1051
1112
|
}
|
|
1052
1113
|
else {
|
|
1053
1114
|
await this.appendCdCommand(sessionId, cwd);
|
|
@@ -1664,6 +1725,9 @@ export class ClaudeSessionService {
|
|
|
1664
1725
|
this.options.workspace?.setCwd(pinnedCwd);
|
|
1665
1726
|
}
|
|
1666
1727
|
this.runtimeCwd = pinnedCwd;
|
|
1728
|
+
if (requireExisting) {
|
|
1729
|
+
await this.discoverProjectRoot(sessionId);
|
|
1730
|
+
}
|
|
1667
1731
|
const sessionPaths = this.paths(sessionId);
|
|
1668
1732
|
const toolResultDirectory = join(sessionPaths.projectRoot, sessionId, 'tool-results');
|
|
1669
1733
|
const store = this.turnStore(sessionId);
|
|
@@ -3091,11 +3155,31 @@ export class ClaudeSessionService {
|
|
|
3091
3155
|
this.worktreeManager.restore(state);
|
|
3092
3156
|
}
|
|
3093
3157
|
paths(sessionId) {
|
|
3094
|
-
|
|
3158
|
+
const exact = resolveClaudePaths({
|
|
3095
3159
|
configDir: this.options.configRoot,
|
|
3096
3160
|
cwd: this.sessionCwds.get(sessionId) ?? this.activeCwd(),
|
|
3097
3161
|
sessionId,
|
|
3098
3162
|
});
|
|
3163
|
+
const discovered = this.discoveredProjectRoots.get(sessionId);
|
|
3164
|
+
if (discovered === undefined)
|
|
3165
|
+
return exact;
|
|
3166
|
+
return {
|
|
3167
|
+
...exact,
|
|
3168
|
+
projectRoot: discovered,
|
|
3169
|
+
sessionFile: resolve(discovered, `${sessionId}.jsonl`),
|
|
3170
|
+
};
|
|
3171
|
+
}
|
|
3172
|
+
async discoverProjectRoot(sessionId) {
|
|
3173
|
+
if (this.discoveredProjectRoots.has(sessionId))
|
|
3174
|
+
return;
|
|
3175
|
+
const discovered = await discoverClaudeProjectRoot({
|
|
3176
|
+
configRoot: this.options.configRoot,
|
|
3177
|
+
cwd: this.sessionCwds.get(sessionId) ?? this.activeCwd(),
|
|
3178
|
+
sessionId,
|
|
3179
|
+
});
|
|
3180
|
+
if (discovered !== undefined) {
|
|
3181
|
+
this.discoveredProjectRoots.set(sessionId, discovered);
|
|
3182
|
+
}
|
|
3099
3183
|
}
|
|
3100
3184
|
async appendCdCommand(sessionId, cwd) {
|
|
3101
3185
|
const result = await this.store(sessionId).withLease(async (lease) => {
|
package/dist/cli/interactive.js
CHANGED
|
@@ -5626,7 +5626,7 @@ export function InteractiveApp({ factory, initialSessions, initialPrompt, initia
|
|
|
5626
5626
|
}
|
|
5627
5627
|
editComposer();
|
|
5628
5628
|
});
|
|
5629
|
-
return (_jsx(TuiThemeProvider, { settings: themeSettings, children: _jsx(Box, { flexDirection: "column", children: selectingSession ? (_jsx(SessionPicker, { sessions: filteredPickerChoices, selectedIndex: selectedIndex, screenReader: axScreenReader, query: sessionSearch })) : (_jsxs(_Fragment, { children: [!axScreenReader && history.length === 0 && !sessionId ? (_jsx(WelcomePanel, { display: runtimeDisplay, width: width })) : null, sessionId ? (_jsxs(Text, { dimColor: true, children: ["Session ", sessionId.slice(0, 8)] })) : null, _jsx(Transcript, { items: history, activeText: activeText, activeThinking: activeThinking, thinkingExpanded: thinkingExpanded, detailedTranscript: thinkingExpanded || runtimeSettings.verbose, screenReader: axScreenReader }), externalEditorRequest !== null ||
|
|
5629
|
+
return (_jsx(TuiThemeProvider, { settings: themeSettings, children: _jsx(Box, { flexDirection: "column", children: selectingSession ? (_jsx(SessionPicker, { sessions: filteredPickerChoices, selectedIndex: selectedIndex, screenReader: axScreenReader, query: sessionSearch })) : (_jsxs(_Fragment, { children: [!axScreenReader && history.length === 0 && !sessionId ? (_jsx(WelcomePanel, { display: runtimeDisplay, width: width, showTips: runtimeSettings.tips })) : null, sessionId ? (_jsxs(Text, { dimColor: true, children: ["Session ", sessionId.slice(0, 8)] })) : null, _jsx(Transcript, { items: history, activeText: activeText, activeThinking: activeThinking, thinkingExpanded: thinkingExpanded, detailedTranscript: thinkingExpanded || runtimeSettings.verbose, screenReader: axScreenReader }), externalEditorRequest !== null ||
|
|
5630
5630
|
keybindingsEditing ||
|
|
5631
5631
|
memoryEditorRequest !== null ? (_jsx(ExternalEditorWait, { screenReader: axScreenReader })) : permission ? (permission.kind === 'tool' && toolPermissionModel ? (_jsx(ToolPermissionDialog, { model: toolPermissionModel, selection: permissionSelection, feedbackMode: permissionFeedbackMode, feedback: input, ruleEditor: permissionRuleEditor, screenReader: axScreenReader })) : (_jsxs(DialogFrame, { title: `Retry interrupted ${permission.call.name}?`, screenReader: axScreenReader, children: [_jsx(Box, { flexDirection: "column", paddingX: 1, paddingY: 1, children: _jsx(Text, { bold: true, children: describeTool(permission.call, sensitiveValues) }) }), _jsx(Text, { children: "Do you want to proceed?" }), _jsxs(Text, { inverse: !axScreenReader && permissionSelection === 0, children: [selectionPrefix(permissionSelection === 0, axScreenReader), "1. Yes"] }), _jsxs(Text, { inverse: !axScreenReader && permissionSelection === 1, children: [selectionPrefix(permissionSelection === 1, axScreenReader), "2. No"] }), permissionFeedbackMode ? (_jsxs(Text, { children: ["\u203A", ' ', input ||
|
|
5632
5632
|
(permissionSelection === 0
|
|
@@ -71,10 +71,11 @@ export interface TuiBtwEntry {
|
|
|
71
71
|
error?: string;
|
|
72
72
|
}
|
|
73
73
|
export declare function useTerminalWidth(override?: number): number;
|
|
74
|
-
export declare function WelcomePanel({ display, width, }: {
|
|
74
|
+
export declare function WelcomePanel({ display, width, showTips, }: {
|
|
75
75
|
display: TuiDisplayMetadata;
|
|
76
76
|
width: number;
|
|
77
|
-
|
|
77
|
+
showTips: boolean;
|
|
78
|
+
}): import("react").JSX.Element | null;
|
|
78
79
|
export declare function MarkdownText({ text }: {
|
|
79
80
|
text: string;
|
|
80
81
|
}): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -49,17 +49,23 @@ function selectionPrefix(selected, screenReader) {
|
|
|
49
49
|
return screenReader ? 'Selected: ' : ' ❯ ';
|
|
50
50
|
return screenReader ? '' : ' ';
|
|
51
51
|
}
|
|
52
|
-
export function WelcomePanel({ display, width, }) {
|
|
52
|
+
export function WelcomePanel({ display, width, showTips, }) {
|
|
53
53
|
const palette = useTuiPalette();
|
|
54
|
+
if (!showTips)
|
|
55
|
+
return null;
|
|
54
56
|
const panelWidth = Math.min(100, Math.max(32, width));
|
|
55
57
|
const wide = panelWidth >= 68;
|
|
56
58
|
const brand = 'Praxis';
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
const model = display.model ?? 'provider default';
|
|
60
|
+
const effort = display.effort ? ` · ${display.effort} effort` : '';
|
|
61
|
+
const cwd = compactPath(display.cwd);
|
|
62
|
+
// Title lives in the top border row:
|
|
63
|
+
// ╭───Praxis Code vX.Y.Z ───...───╮
|
|
64
|
+
// Fixed prefix/suffix = "╭───"(4) + "Praxis"(6) + " Code vX.Y.Z "(8 + version)
|
|
65
|
+
// + "╮"(1), so the fill keeps the row exactly at panelWidth.
|
|
66
|
+
const fill = Math.max(1, panelWidth - display.version.length - 19);
|
|
67
|
+
const identity = `Welcome to ${brand} · ${model}${effort} · ${cwd}`;
|
|
68
|
+
return (_jsxs(Box, { flexDirection: "column", width: panelWidth, children: [_jsxs(Text, { color: palette.muted, children: ['╭───', _jsx(Text, { color: palette.brand, bold: true, children: brand }), ` Code v${display.version} `, _jsx(Text, { dimColor: true, children: '─'.repeat(fill) }), '╮'] }), wide ? (_jsxs(_Fragment, { children: [_jsx(Text, { children: identity }), _jsx(Text, { children: "/init to create CLAUDE.md \u00B7 /config to open settings" })] })) : (_jsxs(_Fragment, { children: [_jsxs(Text, { children: ["Welcome to ", brand] }), _jsxs(Text, { children: [model, effort] }), _jsx(Text, { children: cwd }), _jsx(Text, { children: "/init to create CLAUDE.md" }), _jsx(Text, { children: "/config to open settings" })] }))] }));
|
|
63
69
|
}
|
|
64
70
|
const INLINE_SEGMENT_CACHE_MAX = 4096;
|
|
65
71
|
const inlineSegmentCache = new Map();
|
package/dist/cli-runtime.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { type ModelDocument, type ModelImage, type ModelProvider, type ModelTool
|
|
|
7
7
|
import type { InteractiveResumeOptions, InteractiveServiceFactory } from './cli/interactive.js';
|
|
8
8
|
import type { TuiSlashCommand } from './cli/tui/slash-commands.js';
|
|
9
9
|
import { type TuiHookConfiguration } from './cli/tui/hook-settings.js';
|
|
10
|
+
import { type PraxisRuntimeSettings } from './cli/tui/runtime-settings.js';
|
|
10
11
|
import { type ClaudePermissionMode } from './permissions/claude-permission-resolver.js';
|
|
11
12
|
import { type ClaudeMcpServerStatus, type ClaudeMcpToolInspection } from './mcp/claude-mcp-tools.js';
|
|
12
13
|
import { authenticateMcpServer } from './mcp/claude-mcp-oauth.js';
|
|
@@ -164,6 +165,14 @@ export interface CliDependencies extends InteractiveServiceFactory {
|
|
|
164
165
|
force?: boolean;
|
|
165
166
|
}) => Promise<SelfUpdateResult>;
|
|
166
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Shared runtime model precedence used by every consumer (provider
|
|
170
|
+
* construction, status/doctor output, and the interactive display):
|
|
171
|
+
* explicit CLI selection > non-empty PRAXIS_MODEL > Praxis settings model,
|
|
172
|
+
* with the configured default (settings.model === 'default') falling through
|
|
173
|
+
* to the existing default behavior (undefined).
|
|
174
|
+
*/
|
|
175
|
+
export declare function resolveRuntimeModel(explicitModel: string | undefined, environment: NodeJS.ProcessEnv, settings: PraxisRuntimeSettings | undefined): string | undefined;
|
|
167
176
|
export declare function createDefaultDependencies(entrypoint?: string): CliDependencies;
|
|
168
177
|
export declare function createBackgroundWorkerRuntime(workerSink: RuntimeEventSink, dispatch: {
|
|
169
178
|
argv: string[];
|
package/dist/cli-runtime.js
CHANGED
|
@@ -695,6 +695,20 @@ const consoleIO = {
|
|
|
695
695
|
isTTY: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
696
696
|
readStdinLines: () => process.stdin,
|
|
697
697
|
};
|
|
698
|
+
/**
|
|
699
|
+
* Shared runtime model precedence used by every consumer (provider
|
|
700
|
+
* construction, status/doctor output, and the interactive display):
|
|
701
|
+
* explicit CLI selection > non-empty PRAXIS_MODEL > Praxis settings model,
|
|
702
|
+
* with the configured default (settings.model === 'default') falling through
|
|
703
|
+
* to the existing default behavior (undefined).
|
|
704
|
+
*/
|
|
705
|
+
export function resolveRuntimeModel(explicitModel, environment, settings) {
|
|
706
|
+
const envModel = environment.PRAXIS_MODEL;
|
|
707
|
+
const settingsModel = settings && settings.model !== 'default' ? settings.model : undefined;
|
|
708
|
+
return (explicitModel ??
|
|
709
|
+
(envModel !== undefined && envModel.trim() !== '' ? envModel : undefined) ??
|
|
710
|
+
settingsModel);
|
|
711
|
+
}
|
|
698
712
|
const createDefaultService = async ({ eventSink, requireProvider, hooksOnly = false, approveRecovery, approveTool, agent, model: interactiveModel, effort: interactiveEffort, permissionMode: interactivePermissionMode, isSessionActionApproved, controls = DEFAULT_CLI_CONTROLS, interactive = false, sessionKind, signal, exposeToolRegistry = false, onElicitation, askUser, approvePlan, emitToolUseSummaries = false, cwd: requestedCwd, sandboxOriginalCwd, configRoot: requestedConfigRoot, environment, providerEnvironment: requestedProviderEnvironment, }) => {
|
|
699
713
|
const runtimeEnvironment = requestedProviderEnvironment ?? process.env;
|
|
700
714
|
const sandboxEnvironment = { ...runtimeEnvironment, ...environment };
|
|
@@ -740,7 +754,7 @@ const createDefaultService = async ({ eventSink, requireProvider, hooksOnly = fa
|
|
|
740
754
|
let providerForMainModel;
|
|
741
755
|
const context = parseContextEnvironment(runtimeEnvironment);
|
|
742
756
|
const apiKey = runtimeEnvironment.PRAXIS_API_KEY;
|
|
743
|
-
const model =
|
|
757
|
+
const model = resolveRuntimeModel(interactiveModel ?? controls.model, runtimeEnvironment, runtimeSettings);
|
|
744
758
|
const providerEnvironment = apiKey && model
|
|
745
759
|
? parseProviderEnvironment(runtimeEnvironment)
|
|
746
760
|
: cli.fileResources.length > 0
|
|
@@ -1300,7 +1314,9 @@ const createDefaultService = async ({ eventSink, requireProvider, hooksOnly = fa
|
|
|
1300
1314
|
];
|
|
1301
1315
|
const runtimeInfo = {
|
|
1302
1316
|
cwd: workspace.cwd(),
|
|
1303
|
-
model: provider?.model ??
|
|
1317
|
+
model: provider?.model ??
|
|
1318
|
+
resolveRuntimeModel(interactiveModel ?? controls.model, runtimeEnvironment, runtimeSettings) ??
|
|
1319
|
+
'unknown',
|
|
1304
1320
|
...(provider?.capabilities.contextWindowTokens === undefined
|
|
1305
1321
|
? {}
|
|
1306
1322
|
: { contextWindowTokens: provider.capabilities.contextWindowTokens }),
|
|
@@ -1457,7 +1473,7 @@ const createDefaultService = async ({ eventSink, requireProvider, hooksOnly = fa
|
|
|
1457
1473
|
cwd: workspace.cwd(),
|
|
1458
1474
|
model: service.model() ??
|
|
1459
1475
|
provider?.model ??
|
|
1460
|
-
|
|
1476
|
+
resolveRuntimeModel(interactiveModel ?? controls.model, runtimeEnvironment, runtimeSettings) ??
|
|
1461
1477
|
'unknown',
|
|
1462
1478
|
};
|
|
1463
1479
|
delete staticInfo.contextWindowTokens;
|
|
@@ -1498,7 +1514,12 @@ const createDefaultService = async ({ eventSink, requireProvider, hooksOnly = fa
|
|
|
1498
1514
|
};
|
|
1499
1515
|
const createDefaultAutoModeCritic = async ({ model }) => {
|
|
1500
1516
|
const apiKey = process.env.PRAXIS_API_KEY;
|
|
1501
|
-
const
|
|
1517
|
+
const configRoot = resolve(process.env.CLAUDE_CONFIG_DIR ?? resolve(homedir(), '.claude'));
|
|
1518
|
+
const runtimeSettings = await loadRuntimeSettings({
|
|
1519
|
+
configRoot,
|
|
1520
|
+
statePath: join(configRoot, '.claude.json'),
|
|
1521
|
+
});
|
|
1522
|
+
const selectedModel = resolveRuntimeModel(model, process.env, runtimeSettings);
|
|
1502
1523
|
if (!apiKey || !selectedModel) {
|
|
1503
1524
|
throw new Error('PRAXIS_API_KEY and a model (--model or PRAXIS_MODEL) are required');
|
|
1504
1525
|
}
|
|
@@ -1657,6 +1678,18 @@ export function createDefaultDependencies(entrypoint = fileURLToPath(import.meta
|
|
|
1657
1678
|
const { runInteractive } = await import('./cli/interactive.js');
|
|
1658
1679
|
const interactiveControls = controls ?? DEFAULT_CLI_CONTROLS;
|
|
1659
1680
|
const initialAdditionalDirectories = interactiveControls.addDirectories.map((directory) => realpathSync(resolve(process.cwd(), directory)));
|
|
1681
|
+
const configuredRoot = process.env.CLAUDE_CONFIG_DIR || undefined;
|
|
1682
|
+
const interactiveConfigRoot = resolve(configuredRoot ?? resolve(homedir(), '.claude'));
|
|
1683
|
+
const interactiveStatePath = configuredRoot
|
|
1684
|
+
? join(interactiveConfigRoot, '.claude.json')
|
|
1685
|
+
: resolve(homedir(), '.claude.json');
|
|
1686
|
+
const interactiveRuntimeSettings = interactiveControls.safeMode || interactiveControls.bare
|
|
1687
|
+
? undefined
|
|
1688
|
+
: await loadRuntimeSettings({
|
|
1689
|
+
configRoot: interactiveConfigRoot,
|
|
1690
|
+
statePath: interactiveStatePath,
|
|
1691
|
+
});
|
|
1692
|
+
const effectiveModel = resolveRuntimeModel(interactiveControls.model, process.env, interactiveRuntimeSettings);
|
|
1660
1693
|
return runInteractive({
|
|
1661
1694
|
factory: {
|
|
1662
1695
|
createService: ({ additionalDirectories, cwd, ...options }) => createDefaultService({
|
|
@@ -1670,8 +1703,7 @@ export function createDefaultDependencies(entrypoint = fileURLToPath(import.meta
|
|
|
1670
1703
|
},
|
|
1671
1704
|
interactive: true,
|
|
1672
1705
|
}),
|
|
1673
|
-
scheduledPrompts: Boolean(process.env.PRAXIS_API_KEY &&
|
|
1674
|
-
(interactiveControls.model ?? process.env.PRAXIS_MODEL)),
|
|
1706
|
+
scheduledPrompts: Boolean(process.env.PRAXIS_API_KEY && effectiveModel),
|
|
1675
1707
|
},
|
|
1676
1708
|
...(signal ? { signal } : {}),
|
|
1677
1709
|
...(initialPrompt === undefined ? {} : { initialPrompt }),
|
|
@@ -1686,11 +1718,7 @@ export function createDefaultDependencies(entrypoint = fileURLToPath(import.meta
|
|
|
1686
1718
|
display: {
|
|
1687
1719
|
version: VERSION,
|
|
1688
1720
|
cwd: process.cwd(),
|
|
1689
|
-
...(
|
|
1690
|
-
? { model: controls.model }
|
|
1691
|
-
: process.env.PRAXIS_MODEL
|
|
1692
|
-
? { model: process.env.PRAXIS_MODEL }
|
|
1693
|
-
: {}),
|
|
1721
|
+
...(effectiveModel === undefined ? {} : { model: effectiveModel }),
|
|
1694
1722
|
effort: controls?.effort ?? 'high',
|
|
1695
1723
|
permissionMode: controls?.dangerouslySkipPermissions
|
|
1696
1724
|
? 'bypassPermissions'
|
|
@@ -2090,6 +2118,7 @@ async function executeDoctorCommand(args, invocation, io) {
|
|
|
2090
2118
|
configRoot,
|
|
2091
2119
|
statePath: claudeStatePath,
|
|
2092
2120
|
});
|
|
2121
|
+
const effectiveModel = resolveRuntimeModel(invocation.model, process.env, runtimeSettings);
|
|
2093
2122
|
const report = await runDoctor({
|
|
2094
2123
|
version: VERSION,
|
|
2095
2124
|
executablePath: fileURLToPath(import.meta.url),
|
|
@@ -2098,7 +2127,9 @@ async function executeDoctorCommand(args, invocation, io) {
|
|
|
2098
2127
|
configRoot,
|
|
2099
2128
|
claudeStatePath,
|
|
2100
2129
|
cwd: process.cwd(),
|
|
2101
|
-
environment:
|
|
2130
|
+
environment: effectiveModel === undefined
|
|
2131
|
+
? process.env
|
|
2132
|
+
: { ...process.env, PRAXIS_MODEL: effectiveModel },
|
|
2102
2133
|
autoUpdateChannel: runtimeSettings.autoUpdatesChannel,
|
|
2103
2134
|
...(process.argv[1] === undefined
|
|
2104
2135
|
? {}
|
|
@@ -4053,6 +4084,10 @@ async function execute(argv, io, dependencies, signal) {
|
|
|
4053
4084
|
const startedAt = Date.now();
|
|
4054
4085
|
const sessionId = invocation.sessionId ?? randomUUID();
|
|
4055
4086
|
const configRoot = resolve(process.env.CLAUDE_CONFIG_DIR ?? join(homedir(), '.claude'));
|
|
4087
|
+
const runtimeSettings = await loadRuntimeSettings({
|
|
4088
|
+
configRoot,
|
|
4089
|
+
statePath: join(configRoot, '.claude.json'),
|
|
4090
|
+
});
|
|
4056
4091
|
const text = dependencies.loadReleaseNotes
|
|
4057
4092
|
? await dependencies.loadReleaseNotes(configRoot)
|
|
4058
4093
|
: await loadClaudeReleaseNotes({ configRoot });
|
|
@@ -4063,7 +4098,8 @@ async function execute(argv, io, dependencies, signal) {
|
|
|
4063
4098
|
};
|
|
4064
4099
|
const info = {
|
|
4065
4100
|
cwd: process.cwd(),
|
|
4066
|
-
model: invocation.model
|
|
4101
|
+
model: resolveRuntimeModel(invocation.model, process.env, runtimeSettings) ??
|
|
4102
|
+
'unknown',
|
|
4067
4103
|
tools: [],
|
|
4068
4104
|
mcpServers: [],
|
|
4069
4105
|
permissionMode: invocation.permissionMode,
|
|
@@ -4218,9 +4254,15 @@ async function execute(argv, io, dependencies, signal) {
|
|
|
4218
4254
|
io.stdout(transcript);
|
|
4219
4255
|
return 0;
|
|
4220
4256
|
}
|
|
4257
|
+
const configRoot = resolve(process.env.CLAUDE_CONFIG_DIR ?? join(homedir(), '.claude'));
|
|
4258
|
+
const runtimeSettings = await loadRuntimeSettings({
|
|
4259
|
+
configRoot,
|
|
4260
|
+
statePath: join(configRoot, '.claude.json'),
|
|
4261
|
+
});
|
|
4221
4262
|
const runtimeInfo = service.runtimeInfo?.() ?? {
|
|
4222
4263
|
cwd: process.cwd(),
|
|
4223
|
-
model: process.env
|
|
4264
|
+
model: resolveRuntimeModel(invocation.model, process.env, runtimeSettings) ??
|
|
4265
|
+
'unknown',
|
|
4224
4266
|
tools: [],
|
|
4225
4267
|
mcpServers: [],
|
|
4226
4268
|
permissionMode: 'default',
|
|
@@ -12,6 +12,21 @@ export interface ClaudePaths {
|
|
|
12
12
|
praxisRoot: string;
|
|
13
13
|
}
|
|
14
14
|
export declare function sanitizeClaudeProjectPath(path: string): string;
|
|
15
|
+
export interface DiscoverClaudeProjectRootOptions {
|
|
16
|
+
configRoot: string;
|
|
17
|
+
cwd: string;
|
|
18
|
+
sessionId?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Locates the Claude project directory for a cwd, preferring the exact
|
|
22
|
+
* sanitized hash path and falling back to a long-path truncated-prefix
|
|
23
|
+
* candidate when Claude used a different runtime hash. When a sessionId is
|
|
24
|
+
* supplied, the exact directory only matches if it contains the requested
|
|
25
|
+
* regular session file; an existing exact directory without that file still
|
|
26
|
+
* falls through to the long-path prefix scan. Candidate selection is
|
|
27
|
+
* directory-prefix based and never uses mtime; ambiguous prefixes are rejected.
|
|
28
|
+
*/
|
|
29
|
+
export declare function discoverClaudeProjectRoot({ configRoot, cwd, sessionId, }: DiscoverClaudeProjectRootOptions): Promise<string | undefined>;
|
|
15
30
|
export declare function resolveClaudeScheduledTaskFile(cwd: string): string;
|
|
16
31
|
export declare function resolveClaudePaths({ cwd, sessionId, configDir, }: ResolveClaudePathsOptions): ClaudePaths;
|
|
17
32
|
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { lstat, readdir } from 'node:fs/promises';
|
|
1
2
|
import { homedir } from 'node:os';
|
|
2
|
-
import { resolve } from 'node:path';
|
|
3
|
+
import { extname, resolve } from 'node:path';
|
|
3
4
|
import { getDataOwnership } from './ownership.js';
|
|
4
5
|
const MAX_SANITIZED_LENGTH = 200;
|
|
5
6
|
const SESSION_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
@@ -21,6 +22,105 @@ export function sanitizeClaudeProjectPath(path) {
|
|
|
21
22
|
}
|
|
22
23
|
return `${sanitized.slice(0, MAX_SANITIZED_LENGTH)}-${stablePathHash(path).toString(36)}`;
|
|
23
24
|
}
|
|
25
|
+
async function isDirectory(path) {
|
|
26
|
+
try {
|
|
27
|
+
return (await lstat(path)).isDirectory();
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (error.code === 'ENOENT')
|
|
31
|
+
return false;
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function isRegularFile(path) {
|
|
36
|
+
try {
|
|
37
|
+
return (await lstat(path)).isFile();
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (error.code === 'ENOENT')
|
|
41
|
+
return false;
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async function hasClaudeSessionTranscript(directory) {
|
|
46
|
+
let names;
|
|
47
|
+
try {
|
|
48
|
+
names = await readdir(directory);
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
if (error.code === 'ENOENT')
|
|
52
|
+
return false;
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
for (const name of names) {
|
|
56
|
+
if (extname(name) !== '.jsonl')
|
|
57
|
+
continue;
|
|
58
|
+
if (!isClaudeSessionId(name.slice(0, -'.jsonl'.length)))
|
|
59
|
+
continue;
|
|
60
|
+
if (await isRegularFile(resolve(directory, name)))
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Locates the Claude project directory for a cwd, preferring the exact
|
|
67
|
+
* sanitized hash path and falling back to a long-path truncated-prefix
|
|
68
|
+
* candidate when Claude used a different runtime hash. When a sessionId is
|
|
69
|
+
* supplied, the exact directory only matches if it contains the requested
|
|
70
|
+
* regular session file; an existing exact directory without that file still
|
|
71
|
+
* falls through to the long-path prefix scan. Candidate selection is
|
|
72
|
+
* directory-prefix based and never uses mtime; ambiguous prefixes are rejected.
|
|
73
|
+
*/
|
|
74
|
+
export async function discoverClaudeProjectRoot({ configRoot, cwd, sessionId, }) {
|
|
75
|
+
if (sessionId !== undefined && !isClaudeSessionId(sessionId)) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
const sanitized = sanitizeClaudeProjectPath(cwd);
|
|
79
|
+
const exactProjectRoot = resolve(configRoot, 'projects', sanitized);
|
|
80
|
+
if (sessionId !== undefined) {
|
|
81
|
+
// A sessionId targets a concrete transcript; an existing exact directory
|
|
82
|
+
// only matches when it actually holds the requested session file. Praxis
|
|
83
|
+
// may have created an empty exact directory before the transcript landed
|
|
84
|
+
// in an alternate long-path prefix directory, so fall through to the
|
|
85
|
+
// prefix scan instead of returning the empty exact directory.
|
|
86
|
+
if (await isRegularFile(resolve(exactProjectRoot, `${sessionId}.jsonl`))) {
|
|
87
|
+
return exactProjectRoot;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else if (await isDirectory(exactProjectRoot)) {
|
|
91
|
+
return exactProjectRoot;
|
|
92
|
+
}
|
|
93
|
+
if (sanitized.length <= MAX_SANITIZED_LENGTH)
|
|
94
|
+
return undefined;
|
|
95
|
+
const prefix = sanitized.slice(0, MAX_SANITIZED_LENGTH);
|
|
96
|
+
let names;
|
|
97
|
+
try {
|
|
98
|
+
names = await readdir(resolve(configRoot, 'projects'));
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
if (error.code === 'ENOENT')
|
|
102
|
+
return undefined;
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
const candidates = [];
|
|
106
|
+
for (const name of names) {
|
|
107
|
+
if (!name.startsWith(`${prefix}-`))
|
|
108
|
+
continue;
|
|
109
|
+
const candidate = resolve(configRoot, 'projects', name);
|
|
110
|
+
if (!(await isDirectory(candidate)))
|
|
111
|
+
continue;
|
|
112
|
+
if (sessionId !== undefined) {
|
|
113
|
+
if (await isRegularFile(resolve(candidate, `${sessionId}.jsonl`))) {
|
|
114
|
+
candidates.push(candidate);
|
|
115
|
+
}
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (await hasClaudeSessionTranscript(candidate)) {
|
|
119
|
+
candidates.push(candidate);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return candidates.length === 1 ? candidates[0] : undefined;
|
|
123
|
+
}
|
|
24
124
|
export function resolveClaudeScheduledTaskFile(cwd) {
|
|
25
125
|
const policy = getDataOwnership('scheduled-prompts');
|
|
26
126
|
if (policy.plane !== 'shared' ||
|