praxis-agent 0.30.0 → 0.32.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/claude-project-purge.js +18 -5
- package/dist/application/project-memory.d.ts +141 -0
- package/dist/application/project-memory.js +607 -0
- package/dist/application/session-service.d.ts +24 -0
- package/dist/application/session-service.js +412 -44
- package/dist/application/subagent-service.js +6 -0
- package/dist/cli/interactive.d.ts +3 -1
- package/dist/cli/interactive.js +37 -4
- package/dist/cli/protocol.d.ts +1 -0
- package/dist/cli/protocol.js +24 -0
- package/dist/cli/tui/hook-settings.js +14 -1
- package/dist/cli/tui/memory-files.d.ts +2 -1
- package/dist/cli/tui/memory-files.js +30 -30
- package/dist/cli-runtime.d.ts +1 -0
- package/dist/cli-runtime.js +144 -24
- package/dist/compatibility/claude/context.d.ts +6 -1
- package/dist/compatibility/claude/context.js +16 -2
- package/dist/compatibility/claude/dynamic-context.js +2 -1
- package/dist/compatibility/claude/paths.js +2 -13
- package/dist/compatibility/claude/shared-resources.d.ts +4 -4
- package/dist/compatibility/claude/shared-resources.js +14 -35
- package/dist/core/context-budget.d.ts +9 -8
- package/dist/core/context-budget.js +16 -21
- package/dist/core/project-memory.d.ts +19 -0
- package/dist/core/project-memory.js +58 -0
- package/dist/core/runtime.d.ts +10 -1
- package/dist/core/runtime.js +47 -3
- 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/maintenance/doctor.js +29 -5
- package/dist/mcp/claude-mcp-management.js +2 -0
- package/dist/persistence/native-resources.d.ts +3 -1
- package/dist/persistence/native-resources.js +19 -6
- package/dist/platform/path-containment.d.ts +2 -0
- package/dist/platform/path-containment.js +7 -0
- package/dist/platform/project-identity.d.ts +6 -0
- package/dist/platform/project-identity.js +66 -0
- package/dist/platform/project-memory-paths.d.ts +13 -0
- package/dist/platform/project-memory-paths.js +28 -0
- package/dist/platform/project-path-key.d.ts +2 -0
- package/dist/platform/project-path-key.js +16 -0
- package/dist/providers/fallback-provider.js +3 -1
- 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 +1 -1
|
@@ -283,6 +283,13 @@ export async function planClaudeProjectPurge(options) {
|
|
|
283
283
|
},
|
|
284
284
|
]
|
|
285
285
|
: []),
|
|
286
|
+
{
|
|
287
|
+
kind: 'memory',
|
|
288
|
+
name: dataPlane === 'native'
|
|
289
|
+
? join('state', 'project-memory')
|
|
290
|
+
: join('praxis', 'project-memory'),
|
|
291
|
+
description: 'all private Project-memory operational state',
|
|
292
|
+
},
|
|
286
293
|
{
|
|
287
294
|
kind: 'tasks',
|
|
288
295
|
name: 'tasks',
|
|
@@ -336,7 +343,6 @@ export async function planClaudeProjectPurge(options) {
|
|
|
336
343
|
const targetPaths = [...new Set([requestedPath, targetPath])];
|
|
337
344
|
const projectIdentity = await resolveClaudeProjectIdentity({
|
|
338
345
|
cwd: targetPath,
|
|
339
|
-
homeDirectory: options.homeDirectory ?? homedir(),
|
|
340
346
|
});
|
|
341
347
|
const projectRootPaths = await discoverProjectRoots(configRoot, targetPaths, dataPlane);
|
|
342
348
|
const sessionIdSet = new Set();
|
|
@@ -352,16 +358,23 @@ export async function planClaudeProjectPurge(options) {
|
|
|
352
358
|
await addExistingPath(items, configRoot, removePathItem('debug', join(configRoot, 'debug', `${sessionId}.txt`), `debug log for session ${sessionId}`));
|
|
353
359
|
await addExistingPath(items, configRoot, removePathItem('file-history', join(configRoot, 'file-history', sessionId), `file edit history for session ${sessionId}`));
|
|
354
360
|
}
|
|
361
|
+
const projectKeys = new Set([
|
|
362
|
+
...targetPaths.map(sanitizeClaudeProjectPath),
|
|
363
|
+
...projectRootPaths.map((path) => basename(path)),
|
|
364
|
+
sanitizeClaudeProjectPath(projectIdentity),
|
|
365
|
+
]);
|
|
355
366
|
if (dataPlane === 'native') {
|
|
356
|
-
const projectKeys = new Set([
|
|
357
|
-
...targetPaths.map(sanitizeClaudeProjectPath),
|
|
358
|
-
...projectRootPaths.map((path) => basename(path)),
|
|
359
|
-
]);
|
|
360
367
|
for (const projectKey of projectKeys) {
|
|
361
368
|
await addExistingPath(items, configRoot, removePathItem('memory', join(configRoot, 'memory', projectKey), `memory for project ${projectKey}`));
|
|
369
|
+
await addExistingPath(items, configRoot, removePathItem('memory', join(configRoot, 'state', 'project-memory', projectKey), `private Project-memory state for project ${projectKey}`));
|
|
362
370
|
await addExistingPath(items, configRoot, removePathItem('scheduled', join(configRoot, 'scheduled', `${projectKey}.json`), `scheduled prompts for project ${projectKey}`));
|
|
363
371
|
}
|
|
364
372
|
}
|
|
373
|
+
else {
|
|
374
|
+
for (const projectKey of projectKeys) {
|
|
375
|
+
await addExistingPath(items, configRoot, removePathItem('memory', join(configRoot, 'praxis', 'project-memory', projectKey), `private Project-memory state for project ${projectKey}`));
|
|
376
|
+
}
|
|
377
|
+
}
|
|
365
378
|
for (const projectRoot of projectRootPaths) {
|
|
366
379
|
await addExistingPath(items, configRoot, removePathItem('project', projectRoot, dataPlane === 'native'
|
|
367
380
|
? 'project transcripts'
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { type ModelProvider } from '../core/runtime.js';
|
|
2
|
+
export type ProjectMemoryTopicType = 'user' | 'feedback' | 'project' | 'reference';
|
|
3
|
+
export interface ProjectMemoryTopic {
|
|
4
|
+
path: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string | null;
|
|
7
|
+
type: ProjectMemoryTopicType | null;
|
|
8
|
+
rawType?: string;
|
|
9
|
+
typeStatus: 'known' | 'missing' | 'unknown';
|
|
10
|
+
content: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ProjectMemoryCandidate extends Omit<ProjectMemoryTopic, 'content'> {
|
|
13
|
+
modifiedAtMs: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ProjectMemoryRecallPayload {
|
|
16
|
+
content: string;
|
|
17
|
+
attachmentCount: number;
|
|
18
|
+
}
|
|
19
|
+
export interface ProjectMemoryIndex {
|
|
20
|
+
path: string;
|
|
21
|
+
scope: 'project';
|
|
22
|
+
content: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ProjectMemorySelector {
|
|
25
|
+
select(input: {
|
|
26
|
+
prompt: string;
|
|
27
|
+
candidates: readonly ProjectMemoryCandidate[];
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
}): Promise<readonly string[]>;
|
|
30
|
+
}
|
|
31
|
+
export interface ProjectMemoryMessage {
|
|
32
|
+
id: string;
|
|
33
|
+
role: 'user' | 'assistant';
|
|
34
|
+
content: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ProjectMemoryExtractorInput {
|
|
37
|
+
directory: string;
|
|
38
|
+
sessionId: string;
|
|
39
|
+
messages: readonly ProjectMemoryMessage[];
|
|
40
|
+
constraints: {
|
|
41
|
+
persistTranscript: false;
|
|
42
|
+
allowSubagents: false;
|
|
43
|
+
allowRemote: false;
|
|
44
|
+
maxModelTurns: 4;
|
|
45
|
+
tools: readonly ['Read', 'Write', 'Edit'];
|
|
46
|
+
};
|
|
47
|
+
signal: AbortSignal;
|
|
48
|
+
}
|
|
49
|
+
export interface ProjectMemoryExtractor {
|
|
50
|
+
extract(input: ProjectMemoryExtractorInput): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
export declare function loadProjectMemoryIndex(directory: string): Promise<ProjectMemoryIndex | null>;
|
|
53
|
+
export declare function parseProjectMemoryTopic(path: string, source: string): ProjectMemoryTopic;
|
|
54
|
+
export declare function listProjectMemoryCandidates(directory: string): Promise<ProjectMemoryCandidate[]>;
|
|
55
|
+
export interface ProjectMemoryRecallHandle {
|
|
56
|
+
consumeIfSettled(): ProjectMemoryRecallPayload | null;
|
|
57
|
+
}
|
|
58
|
+
export interface ProjectMemoryRecallRuntime {
|
|
59
|
+
prefetch(input: {
|
|
60
|
+
sessionId: string;
|
|
61
|
+
turnId: string;
|
|
62
|
+
prompt: string;
|
|
63
|
+
signal?: AbortSignal;
|
|
64
|
+
}): ProjectMemoryRecallHandle;
|
|
65
|
+
recordRead(sessionId: string, path: string): void;
|
|
66
|
+
recordCompact(sessionId: string): void;
|
|
67
|
+
clearSession?(sessionId: string): void;
|
|
68
|
+
}
|
|
69
|
+
export interface ProjectMemoryExtractionRuntime {
|
|
70
|
+
observe(observation: ProjectMemoryObservation): void;
|
|
71
|
+
close(timeoutMs?: number): Promise<void>;
|
|
72
|
+
}
|
|
73
|
+
export declare class ProjectMemoryRecallController {
|
|
74
|
+
private readonly options;
|
|
75
|
+
private readonly sessions;
|
|
76
|
+
private readonly turns;
|
|
77
|
+
constructor(options: {
|
|
78
|
+
directory: string;
|
|
79
|
+
selector: ProjectMemorySelector;
|
|
80
|
+
});
|
|
81
|
+
prefetch(input: {
|
|
82
|
+
sessionId: string;
|
|
83
|
+
turnId: string;
|
|
84
|
+
prompt: string;
|
|
85
|
+
signal?: AbortSignal;
|
|
86
|
+
}): ProjectMemoryRecallHandle;
|
|
87
|
+
recordRead(sessionId: string, path: string): void;
|
|
88
|
+
recordCompact(sessionId: string): void;
|
|
89
|
+
clearSession(sessionId: string): void;
|
|
90
|
+
private session;
|
|
91
|
+
private select;
|
|
92
|
+
private consume;
|
|
93
|
+
}
|
|
94
|
+
export interface ProjectMemoryObservation {
|
|
95
|
+
sessionId: string;
|
|
96
|
+
messages: readonly ProjectMemoryMessage[];
|
|
97
|
+
directMaintenance?: boolean;
|
|
98
|
+
}
|
|
99
|
+
export declare class ProjectMemoryExtractionController {
|
|
100
|
+
private readonly options;
|
|
101
|
+
private trailing;
|
|
102
|
+
private pump;
|
|
103
|
+
private cursorLoaded;
|
|
104
|
+
private cursor;
|
|
105
|
+
private controller;
|
|
106
|
+
constructor(options: {
|
|
107
|
+
directory: string;
|
|
108
|
+
cursorPath: string;
|
|
109
|
+
extractor: ProjectMemoryExtractor;
|
|
110
|
+
onWarning?: (message: string) => void;
|
|
111
|
+
});
|
|
112
|
+
observe(observation: ProjectMemoryObservation): void;
|
|
113
|
+
drain(timeoutMs?: number): Promise<void>;
|
|
114
|
+
close(timeoutMs?: number): Promise<void>;
|
|
115
|
+
private run;
|
|
116
|
+
private ensurePump;
|
|
117
|
+
private process;
|
|
118
|
+
private loadCursor;
|
|
119
|
+
private saveCursor;
|
|
120
|
+
private warn;
|
|
121
|
+
}
|
|
122
|
+
export declare class ProjectMemoryModelSelector implements ProjectMemorySelector {
|
|
123
|
+
private readonly options;
|
|
124
|
+
constructor(options: {
|
|
125
|
+
directory: string;
|
|
126
|
+
providerFactory: () => ModelProvider;
|
|
127
|
+
});
|
|
128
|
+
select(input: {
|
|
129
|
+
prompt: string;
|
|
130
|
+
candidates: readonly ProjectMemoryCandidate[];
|
|
131
|
+
signal?: AbortSignal;
|
|
132
|
+
}): Promise<readonly string[]>;
|
|
133
|
+
}
|
|
134
|
+
export declare class ProjectMemoryAgentExtractor implements ProjectMemoryExtractor {
|
|
135
|
+
private readonly options;
|
|
136
|
+
constructor(options: {
|
|
137
|
+
providerFactory: () => ModelProvider;
|
|
138
|
+
});
|
|
139
|
+
extract(input: ProjectMemoryExtractorInput): Promise<void>;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=project-memory.d.ts.map
|