praxis-agent 0.31.0 → 0.33.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/dist/application/session-service.d.ts +45 -0
- package/dist/application/session-service.js +652 -101
- package/dist/application/subagent-service.js +6 -0
- package/dist/cli/interactive.d.ts +3 -1
- package/dist/cli/interactive.js +16 -1
- package/dist/cli/tui/hook-settings.js +14 -1
- package/dist/cli-runtime.d.ts +2 -0
- package/dist/cli-runtime.js +129 -31
- package/dist/compatibility/claude/context.d.ts +6 -1
- package/dist/compatibility/claude/context.js +14 -1
- package/dist/compatibility/claude/history.d.ts +8 -0
- package/dist/compatibility/claude/history.js +54 -0
- package/dist/compatibility/claude/interruption.d.ts +16 -0
- package/dist/compatibility/claude/interruption.js +147 -0
- package/dist/compatibility/claude/schema.js +22 -0
- package/dist/compatibility/claude/session-metadata.d.ts +44 -0
- package/dist/compatibility/claude/session-metadata.js +180 -0
- package/dist/core/runtime.d.ts +4 -1
- package/dist/core/runtime.js +9 -1
- package/dist/hooks/claude-file-change-watcher.d.ts +43 -0
- package/dist/hooks/claude-file-change-watcher.js +185 -0
- package/dist/hooks/claude-hook-tools.d.ts +2 -0
- package/dist/hooks/claude-hook-tools.js +45 -6
- package/dist/hooks/claude-hooks.d.ts +14 -2
- package/dist/hooks/claude-hooks.js +230 -5
- package/dist/hooks/claude-session-environment.d.ts +16 -0
- package/dist/hooks/claude-session-environment.js +112 -0
- package/dist/persistence/claude-session-index.d.ts +39 -0
- package/dist/persistence/claude-session-index.js +175 -0
- package/dist/persistence/claude-transcript-store.d.ts +6 -2
- package/dist/persistence/claude-transcript-store.js +78 -3
- package/dist/persistence/in-memory-transcript-store.js +1 -0
- package/dist/tools/claude-task-tools.d.ts +5 -0
- package/dist/tools/claude-task-tools.js +15 -1
- package/dist/tools/local-tools.d.ts +2 -0
- package/dist/tools/local-tools.js +11 -4
- package/package.json +2 -1
|
@@ -4,6 +4,8 @@ import { type DataPlane } from '../persistence/data-plane.js';
|
|
|
4
4
|
import { type ClaudeFileResource, type ClaudeFileResourceConfig } from '../compatibility/claude/file-resources.js';
|
|
5
5
|
import { type ClaudeDisplayTranscriptItem } from '../compatibility/claude/projection.js';
|
|
6
6
|
import { type ClaudeTranscriptEntry } from '../compatibility/claude/schema.js';
|
|
7
|
+
import { type ClaudeSessionMetadata } from '../compatibility/claude/session-metadata.js';
|
|
8
|
+
import { type ClaudeInterruptionClassification } from '../compatibility/claude/interruption.js';
|
|
7
9
|
import { type ModelDocument, type ModelImage, type ModelToolCall, type ModelProvider, type ModelUsage, type PermissionApproval, type PermissionDecision, type PermissionResolver, type PermissionUpdate, type RuntimeEventSink, type ToolRegistry } from '../core/runtime.js';
|
|
8
10
|
import { type BackgroundTaskSnapshot } from './background-task-runtime.js';
|
|
9
11
|
import type { ModelPricingRegistry } from '../core/usage.js';
|
|
@@ -38,6 +40,8 @@ export interface ClaudeSessionServiceOptions {
|
|
|
38
40
|
persistPermissionUpdates?: (updates: readonly PermissionUpdate[]) => void | Promise<void>;
|
|
39
41
|
approveTool?: (call: ModelToolCall, originalCall?: ModelToolCall, decision?: PermissionDecision) => PermissionApproval | Promise<PermissionApproval>;
|
|
40
42
|
approveRecovery?: (call: ModelToolCall) => boolean | Promise<boolean>;
|
|
43
|
+
/** Explicit Claude-compatible opt-in for replaying an interrupted turn. */
|
|
44
|
+
resumeInterruptedTurn?: boolean;
|
|
41
45
|
contextAssembler?: ContextAssembler;
|
|
42
46
|
conditionalRuleResolver?: Pick<ClaudeConditionalRuleResolver, 'resolve'>;
|
|
43
47
|
extensions?: ClaudeExtensionCatalog;
|
|
@@ -125,6 +129,12 @@ export interface SideQuestionForkResult {
|
|
|
125
129
|
export interface SessionSummary {
|
|
126
130
|
sessionId: string;
|
|
127
131
|
name?: string;
|
|
132
|
+
tag?: string;
|
|
133
|
+
agentName?: string;
|
|
134
|
+
agentColor?: string;
|
|
135
|
+
agentSetting?: string;
|
|
136
|
+
permissionMode?: string;
|
|
137
|
+
mode?: string;
|
|
128
138
|
lastPrompt: string | null;
|
|
129
139
|
updatedAt: string;
|
|
130
140
|
status: SessionStatus;
|
|
@@ -183,19 +193,26 @@ export declare class ClaudeSessionService {
|
|
|
183
193
|
private readonly worktreeManager;
|
|
184
194
|
private readonly sessionCwds;
|
|
185
195
|
private readonly discoveredProjectRoots;
|
|
196
|
+
private readonly explicitSessionFiles;
|
|
197
|
+
private readonly explicitResumeLeafUuids;
|
|
186
198
|
private readonly sessionPermissionUpdates;
|
|
187
199
|
private readonly hostedSubagents;
|
|
188
200
|
private readonly hostedSubagentsByRegistry;
|
|
189
201
|
private readonly backgroundNotificationWrites;
|
|
190
202
|
private readonly downloadedFileResourceSessions;
|
|
203
|
+
private readonly detachedHookRuns;
|
|
191
204
|
private activeProvider;
|
|
192
205
|
private mcpClosePromise;
|
|
193
206
|
private readonly sessionCostTrackers;
|
|
194
207
|
private activeCostSessionId;
|
|
195
208
|
private closeCostSavePromise;
|
|
209
|
+
private closeMetadataSavePromise;
|
|
210
|
+
private readonly durableMetadataSessions;
|
|
211
|
+
private readonly durableMetadataSnapshots;
|
|
196
212
|
private readonly sessionMemoryControllers;
|
|
197
213
|
private resolvedSessionMemoryProvider;
|
|
198
214
|
private readonly hookLifecycle;
|
|
215
|
+
private readonly fileChangeWatcher;
|
|
199
216
|
private runtimeCwd;
|
|
200
217
|
constructor(options: ClaudeSessionServiceOptions);
|
|
201
218
|
nextScheduledPrompt(signal?: AbortSignal): Promise<ScheduledPrompt | null>;
|
|
@@ -214,6 +231,23 @@ export declare class ClaudeSessionService {
|
|
|
214
231
|
close(): Promise<void>;
|
|
215
232
|
transitionHookSession(sessionId: string, reason: Exclude<HookSessionEndReason, 'other'>): Promise<void>;
|
|
216
233
|
reloadContextResources(sessionId: string): void;
|
|
234
|
+
notify(sessionId: string | undefined, message: string, notificationType: string, title?: string, signal?: AbortSignal): Promise<void>;
|
|
235
|
+
notifyDetached(sessionId: string | undefined, message: string, notificationType: string, title?: string): void;
|
|
236
|
+
private drainDetachedHookRuns;
|
|
237
|
+
instructionsLoaded(sessionId: string, resources: readonly {
|
|
238
|
+
path: string;
|
|
239
|
+
scope: 'local' | 'project' | 'user';
|
|
240
|
+
importedFrom?: string;
|
|
241
|
+
}[], reason: 'session_start' | 'compact' | 'resource_reload'): Promise<void>;
|
|
242
|
+
instructionLoaded(sessionId: string, resource: {
|
|
243
|
+
path: string;
|
|
244
|
+
memoryType: 'User' | 'Project' | 'Local' | 'Managed';
|
|
245
|
+
globs?: readonly string[];
|
|
246
|
+
triggerFilePath?: string;
|
|
247
|
+
parentFilePath?: string;
|
|
248
|
+
}, loadReason: 'session_start' | 'nested_traversal' | 'path_glob_match' | 'include' | 'compact'): Promise<void>;
|
|
249
|
+
private runAdvisoryHook;
|
|
250
|
+
private cwdChanged;
|
|
217
251
|
createHostedToolRegistry(sessionId: string): ToolRegistry;
|
|
218
252
|
run(prompt: string, signal?: AbortSignal, sessionId?: string, name?: string, images?: readonly ModelImage[], documents?: readonly ModelDocument[]): Promise<SessionRunResult>;
|
|
219
253
|
runShell(command: string, signal?: AbortSignal, sessionId?: string, name?: string): Promise<SessionRunResult>;
|
|
@@ -227,8 +261,12 @@ export declare class ClaudeSessionService {
|
|
|
227
261
|
inspect(sessionId: string): Promise<SessionInspection>;
|
|
228
262
|
readEffectiveAgentColor(sessionId: string): Promise<AgentColorName | undefined>;
|
|
229
263
|
export(sessionId: string): Promise<Buffer>;
|
|
264
|
+
registerResumePath(requestedPath: string): Promise<SessionSummary>;
|
|
230
265
|
transcript(sessionId: string, resumeSessionAt?: string): Promise<ClaudeDisplayTranscriptItem[]>;
|
|
266
|
+
interruption(sessionId: string): Promise<ClaudeInterruptionClassification>;
|
|
267
|
+
metadata(sessionId: string): Promise<ClaudeSessionMetadata>;
|
|
231
268
|
rename(sessionId: string, name: string): Promise<void>;
|
|
269
|
+
tag(sessionId: string, tag: string): Promise<void>;
|
|
232
270
|
changeCwd(sessionId: string | undefined, requestedCwd: string): Promise<string>;
|
|
233
271
|
recordCdUsage(sessionId: string): Promise<void>;
|
|
234
272
|
approveRecentlyDenied(sessionId: string, display: string): Promise<void>;
|
|
@@ -284,7 +322,14 @@ export declare class ClaudeSessionService {
|
|
|
284
322
|
private cdCommandEntries;
|
|
285
323
|
private localCommandEntries;
|
|
286
324
|
private store;
|
|
325
|
+
/**
|
|
326
|
+
* Refreshes metadata under the transcript lease before writing a compact
|
|
327
|
+
* tail snapshot. This prevents a long-lived process from overwriting a
|
|
328
|
+
* newer title or tag appended by another writer.
|
|
329
|
+
*/
|
|
330
|
+
private reappendDurableMetadata;
|
|
287
331
|
private turnStore;
|
|
332
|
+
private rememberDurableMetadata;
|
|
288
333
|
private assertSessionPersistence;
|
|
289
334
|
private assertWritable;
|
|
290
335
|
private sessionStatus;
|