praxis-agent 0.33.0 → 0.35.0
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/README.md +4 -0
- package/dist/application/background-agent-manager.d.ts +48 -3
- package/dist/application/background-agent-manager.js +249 -73
- package/dist/application/background-task-runtime.d.ts +20 -1
- package/dist/application/background-task-runtime.js +45 -6
- package/dist/application/managed-worktree.d.ts +8 -0
- package/dist/application/managed-worktree.js +54 -2
- package/dist/application/session-service.d.ts +12 -1
- package/dist/application/session-service.js +1849 -1628
- package/dist/application/subagent-service.d.ts +34 -7
- package/dist/application/subagent-service.js +720 -150
- package/dist/application/turn-lifecycle.d.ts +38 -0
- package/dist/application/turn-lifecycle.js +36 -0
- package/dist/cli/interactive.d.ts +1 -0
- package/dist/cli/interactive.js +43 -8
- package/dist/cli/protocol.js +5 -2
- package/dist/cli/tui/claude-style.d.ts +5 -48
- package/dist/cli/tui/claude-style.js +19 -73
- package/dist/cli/tui/task-panel.d.ts +1 -1
- package/dist/cli/tui/task-panel.js +2 -1
- package/dist/cli/tui/transcript-presentation.d.ts +89 -0
- package/dist/cli/tui/transcript-presentation.js +169 -0
- package/dist/cli/tui/transcript-viewport.d.ts +5 -34
- package/dist/cli/tui/transcript-viewport.js +639 -158
- package/dist/cli/tui/tui-view-model.d.ts +6 -2
- package/dist/cli/tui/tui-view-model.js +23 -6
- package/dist/compatibility/claude/context.d.ts +2 -2
- package/dist/compatibility/claude/context.js +2 -14
- package/dist/compatibility/claude/data-plane-adapter.d.ts +9 -0
- package/dist/compatibility/claude/data-plane-adapter.js +44 -0
- package/dist/compatibility/claude/paths.js +2 -2
- package/dist/compatibility/claude/projection.d.ts +4 -0
- package/dist/compatibility/claude/projection.js +82 -0
- package/dist/compatibility/claude/shared-resources.d.ts +7 -38
- package/dist/compatibility/claude/sidechain.d.ts +5 -0
- package/dist/compatibility/claude/sidechain.js +13 -4
- package/dist/compatibility/claude/transcript-codec.d.ts +21 -0
- package/dist/compatibility/claude/transcript-codec.js +512 -0
- package/dist/core/context.d.ts +25 -7
- package/dist/core/context.js +46 -0
- package/dist/core/prompt-composer.d.ts +8 -16
- package/dist/core/prompt-composer.js +65 -25
- package/dist/core/resources.d.ts +39 -0
- package/dist/core/resources.js +2 -0
- package/dist/core/runtime.d.ts +1 -1
- package/dist/core/session.d.ts +2 -0
- package/dist/core/session.js +5 -0
- package/dist/core/transcript-codec.d.ts +70 -0
- package/dist/core/transcript-codec.js +60 -0
- package/dist/core/transcript-event.d.ts +33 -0
- package/dist/core/transcript-event.js +198 -0
- package/dist/persistence/claude-sidechain-store.js +19 -3
- package/dist/persistence/data-plane-adapter.d.ts +32 -0
- package/dist/persistence/data-plane-adapter.js +2 -0
- package/dist/persistence/data-plane.d.ts +4 -20
- package/dist/persistence/data-plane.js +10 -47
- package/dist/persistence/native-data-plane-adapter.d.ts +9 -0
- package/dist/persistence/native-data-plane-adapter.js +39 -0
- package/dist/persistence/native-resources.d.ts +4 -4
- package/dist/persistence/native-transcript-codec.d.ts +13 -0
- package/dist/persistence/native-transcript-codec.js +102 -0
- package/dist/persistence/subagent-lifecycle-store.d.ts +66 -0
- package/dist/persistence/subagent-lifecycle-store.js +299 -0
- package/dist/tools/claude-user-message.d.ts +0 -1
- package/dist/tools/claude-user-message.js +0 -1
- package/package.json +6 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execFile } from 'node:child_process';
|
|
2
|
-
import { lstat, mkdir } from 'node:fs/promises';
|
|
3
|
-
import { join, resolve } from 'node:path';
|
|
2
|
+
import { lstat, mkdir, realpath } from 'node:fs/promises';
|
|
3
|
+
import { isAbsolute, join, resolve } from 'node:path';
|
|
4
4
|
import { promisify } from 'node:util';
|
|
5
5
|
const execFileAsync = promisify(execFile);
|
|
6
6
|
async function git(cwd, args) {
|
|
@@ -124,4 +124,56 @@ export async function createManagedWorktree(options) {
|
|
|
124
124
|
},
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
+
/** Reattaches only to a real, registered Git worktree. Persisted metadata is
|
|
128
|
+
* untrusted input, so an arbitrary directory can never become an execution
|
|
129
|
+
* cwd merely because it exists. Restored worktrees are retained for audit. */
|
|
130
|
+
export async function restoreManagedWorktree(options) {
|
|
131
|
+
if (!isAbsolute(options.path) || options.path.includes('\0')) {
|
|
132
|
+
throw new Error(`Invalid retained ${options.label.toLowerCase()} worktree path`);
|
|
133
|
+
}
|
|
134
|
+
const path = resolve(options.path);
|
|
135
|
+
let entry;
|
|
136
|
+
try {
|
|
137
|
+
entry = await lstat(path);
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
if (error.code === 'ENOENT') {
|
|
141
|
+
throw new Error(`Retained ${options.label.toLowerCase()} worktree is missing: ${path}`);
|
|
142
|
+
}
|
|
143
|
+
throw error;
|
|
144
|
+
}
|
|
145
|
+
if (entry.isSymbolicLink() || !entry.isDirectory()) {
|
|
146
|
+
throw new Error(`Retained ${options.label.toLowerCase()} worktree must be a real directory: ${path}`);
|
|
147
|
+
}
|
|
148
|
+
let root;
|
|
149
|
+
let registered;
|
|
150
|
+
let canonicalPath;
|
|
151
|
+
try {
|
|
152
|
+
;
|
|
153
|
+
[root, canonicalPath] = await Promise.all([
|
|
154
|
+
git(options.cwd, ['rev-parse', '--show-toplevel']),
|
|
155
|
+
realpath(path),
|
|
156
|
+
]);
|
|
157
|
+
registered = await registeredWorktrees(root);
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
throw new Error(`Could not inspect retained ${options.label.toLowerCase()} worktree ${path}: ${error.message}`);
|
|
161
|
+
}
|
|
162
|
+
if (!registered.has(path) && !registered.has(canonicalPath)) {
|
|
163
|
+
throw new Error(`Retained ${options.label.toLowerCase()} worktree is not registered: ${path}`);
|
|
164
|
+
}
|
|
165
|
+
const worktreeRoot = await realpath(resolve(await git(path, ['rev-parse', '--show-toplevel'])));
|
|
166
|
+
if (worktreeRoot !== canonicalPath) {
|
|
167
|
+
throw new Error(`Retained ${options.label.toLowerCase()} worktree path is not its root: ${path}`);
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
cwd: path,
|
|
171
|
+
async cleanup() {
|
|
172
|
+
return {
|
|
173
|
+
retained: true,
|
|
174
|
+
reason: `${options.label} worktree was restored and retained at ${path}`,
|
|
175
|
+
};
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
}
|
|
127
179
|
//# sourceMappingURL=managed-worktree.js.map
|
|
@@ -197,8 +197,14 @@ export declare class ClaudeSessionService {
|
|
|
197
197
|
private readonly explicitResumeLeafUuids;
|
|
198
198
|
private readonly sessionPermissionUpdates;
|
|
199
199
|
private readonly hostedSubagents;
|
|
200
|
+
private readonly subagentExecutors;
|
|
200
201
|
private readonly hostedSubagentsByRegistry;
|
|
202
|
+
private readonly subagentExecutorSessions;
|
|
203
|
+
private readonly hostedSubagentNotificationPumps;
|
|
204
|
+
private readonly hostedSubagentPumpPromises;
|
|
205
|
+
private readonly hostedSubagentNotificationReservations;
|
|
201
206
|
private readonly backgroundNotificationWrites;
|
|
207
|
+
private closing;
|
|
202
208
|
private readonly downloadedFileResourceSessions;
|
|
203
209
|
private readonly detachedHookRuns;
|
|
204
210
|
private activeProvider;
|
|
@@ -227,6 +233,10 @@ export declare class ClaudeSessionService {
|
|
|
227
233
|
private requireMcp;
|
|
228
234
|
taskSnapshots(sessionId: string): Promise<BackgroundTaskSnapshot>;
|
|
229
235
|
stopTask(sessionId: string, taskId: string): Promise<void>;
|
|
236
|
+
backgroundForegroundTask(sessionId: string): import("./background-agent-manager.js").BackgroundAgentSnapshot;
|
|
237
|
+
private sendOwnedBackgroundAgent;
|
|
238
|
+
private sessionSubagentExecutors;
|
|
239
|
+
private collectSubagentNotifications;
|
|
230
240
|
private applyPermissionUpdates;
|
|
231
241
|
close(): Promise<void>;
|
|
232
242
|
transitionHookSession(sessionId: string, reason: Exclude<HookSessionEndReason, 'other'>): Promise<void>;
|
|
@@ -255,6 +265,7 @@ export declare class ClaudeSessionService {
|
|
|
255
265
|
resumeShell(sessionId: string, command: string, signal?: AbortSignal, name?: string, resumeSessionAt?: string): Promise<SessionRunResult>;
|
|
256
266
|
answerSideQuestion(sessionId: string | undefined, question: string, signal?: AbortSignal, onDelta?: (delta: string) => void, permissionMode?: ClaudePermissionMode): Promise<SideQuestionResult>;
|
|
257
267
|
forkSideQuestion(sessionId: string, question: string, signal?: AbortSignal): Promise<SideQuestionForkResult>;
|
|
268
|
+
private startHostedSubagentNotificationPump;
|
|
258
269
|
promptSuggestion(sessionId: string, signal?: AbortSignal): Promise<string | null>;
|
|
259
270
|
sessionNameSuggestion(sessionId: string, signal?: AbortSignal): Promise<string | null>;
|
|
260
271
|
sessions(): Promise<SessionSummary[]>;
|
|
@@ -288,6 +299,7 @@ export declare class ClaudeSessionService {
|
|
|
288
299
|
private persistActiveSessionCost;
|
|
289
300
|
private recordAuxiliaryMetrics;
|
|
290
301
|
costSnapshot(sessionId: string): Promise<ClaudeSessionCostSnapshot>;
|
|
302
|
+
private withDetachedSubagentUsage;
|
|
291
303
|
private executeTurn;
|
|
292
304
|
private ensureFileResources;
|
|
293
305
|
private translationContext;
|
|
@@ -338,7 +350,6 @@ export declare class ClaudeSessionService {
|
|
|
338
350
|
private providerForAgent;
|
|
339
351
|
private resolveAgent;
|
|
340
352
|
private mainAgentSystemPrompt;
|
|
341
|
-
private assembledSystemMessages;
|
|
342
353
|
private contextBudget;
|
|
343
354
|
private sessionMemoryEnabled;
|
|
344
355
|
private sessionMemoryController;
|