praxis-agent 0.32.0 → 0.34.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.
Files changed (36) hide show
  1. package/dist/application/background-agent-manager.d.ts +48 -3
  2. package/dist/application/background-agent-manager.js +249 -73
  3. package/dist/application/background-task-runtime.d.ts +20 -1
  4. package/dist/application/background-task-runtime.js +45 -6
  5. package/dist/application/managed-worktree.d.ts +8 -0
  6. package/dist/application/managed-worktree.js +54 -2
  7. package/dist/application/session-service.d.ts +38 -0
  8. package/dist/application/session-service.js +590 -70
  9. package/dist/application/subagent-service.d.ts +34 -7
  10. package/dist/application/subagent-service.js +694 -135
  11. package/dist/cli/interactive.d.ts +1 -0
  12. package/dist/cli/interactive.js +26 -1
  13. package/dist/cli/tui/task-panel.d.ts +1 -1
  14. package/dist/cli/tui/task-panel.js +2 -1
  15. package/dist/cli-runtime.d.ts +1 -0
  16. package/dist/cli-runtime.js +111 -31
  17. package/dist/compatibility/claude/history.d.ts +8 -0
  18. package/dist/compatibility/claude/history.js +54 -0
  19. package/dist/compatibility/claude/interruption.d.ts +16 -0
  20. package/dist/compatibility/claude/interruption.js +147 -0
  21. package/dist/compatibility/claude/projection.d.ts +4 -0
  22. package/dist/compatibility/claude/projection.js +82 -0
  23. package/dist/compatibility/claude/schema.js +22 -0
  24. package/dist/compatibility/claude/session-metadata.d.ts +44 -0
  25. package/dist/compatibility/claude/session-metadata.js +180 -0
  26. package/dist/compatibility/claude/sidechain.d.ts +5 -0
  27. package/dist/compatibility/claude/sidechain.js +13 -4
  28. package/dist/persistence/claude-session-index.d.ts +39 -0
  29. package/dist/persistence/claude-session-index.js +175 -0
  30. package/dist/persistence/claude-sidechain-store.js +19 -3
  31. package/dist/persistence/claude-transcript-store.d.ts +6 -2
  32. package/dist/persistence/claude-transcript-store.js +78 -3
  33. package/dist/persistence/in-memory-transcript-store.js +1 -0
  34. package/dist/persistence/subagent-lifecycle-store.d.ts +66 -0
  35. package/dist/persistence/subagent-lifecycle-store.js +299 -0
  36. package/package.json +2 -1
@@ -5,7 +5,7 @@ import { type ClaudeAgentRuntimeDefinition, type ClaudeExtensionCatalog } from '
5
5
  import type { ClaudeHookRunner } from '../hooks/claude-hooks.js';
6
6
  import type { ClaudeMcpRuntime } from '../mcp/claude-mcp-tools.js';
7
7
  import { type DataPlane } from '../persistence/data-plane.js';
8
- import { type BackgroundAgentSnapshot } from './background-agent-manager.js';
8
+ import { type BackgroundAgentNotificationIdentity, type BackgroundAgentSnapshot } from './background-agent-manager.js';
9
9
  export interface WorkflowAgentRunOptions {
10
10
  sessionId: string;
11
11
  promptId: string;
@@ -76,6 +76,17 @@ export interface ClaudeSubagentExecutorOptions {
76
76
  providerForModel?: (model: string) => ModelProvider;
77
77
  toolNames?: readonly string[];
78
78
  backgroundTaskNotifications?: (waitForRunning: boolean) => Promise<string[]>;
79
+ notificationDelivered?: (notification: {
80
+ agentId: string;
81
+ toolUseId: string;
82
+ status: 'completed' | 'failed' | 'killed';
83
+ }) => boolean;
84
+ stopOwnedBackgroundAgent?: (sessionId: string, agentId: string) => Promise<string | null>;
85
+ outputOwnedBackgroundAgent?: (sessionId: string, agentId: string, options: {
86
+ block: boolean;
87
+ timeout: number;
88
+ }) => Promise<string | null>;
89
+ sendOwnedBackgroundAgent?: (sessionId: string, agentId: string, message: string, summary: string | undefined, toolUseId: string) => string | null;
79
90
  persistence?: 'disk' | 'memory';
80
91
  onLineChanges?: (changes: {
81
92
  readonly linesAdded: number;
@@ -88,34 +99,50 @@ export declare class ClaudeSubagentExecutor {
88
99
  private calls;
89
100
  private readonly background;
90
101
  private readonly ephemeralSidechains;
102
+ private readonly foreground;
91
103
  isEnabled(name: string): boolean;
92
104
  constructor(options: ClaudeSubagentExecutorOptions);
93
105
  close(): Promise<void>;
94
106
  backgroundSnapshots(): readonly BackgroundAgentSnapshot[];
95
- stopBackgroundTask(taskId: string): string;
107
+ hasForegroundTask(): boolean;
108
+ backgroundForegroundTask(identifier?: string): BackgroundAgentSnapshot;
109
+ stopBackgroundTask(taskId: string): Promise<string>;
110
+ outputBackgroundTask(taskId: string, options: {
111
+ block: boolean;
112
+ timeout: number;
113
+ }): Promise<string>;
114
+ sendBackgroundMessage(agentId: string, message: string, summary: string | undefined, toolUseId: string): string;
115
+ stopAllBackgroundTasks(): readonly string[];
96
116
  private cwd;
97
117
  private agentDefinition;
98
118
  private resolveAgentInput;
99
- registry(sessionId: string, depth: number, promptIdForCall: (callId: string) => string | null): ToolRegistry;
119
+ registry(sessionId: string, depth: number, promptIdForCall: (callId: string) => string | null, parentAgentId?: string): ToolRegistry;
100
120
  definitions(): ModelToolDefinition;
101
121
  managementDefinitions(): readonly ModelToolDefinition[];
102
122
  prepare(call: ModelToolCall, depth: number): ModelToolCall;
103
- execute(call: ModelToolCall, sessionId: string, depth: number, promptId: string, context: ToolExecutionContext): Promise<ToolExecutionResult>;
123
+ execute(call: ModelToolCall, sessionId: string, depth: number, promptId: string, context: ToolExecutionContext, parentAgentId?: string): Promise<ToolExecutionResult>;
104
124
  private sidechainStore;
105
125
  private sessionPaths;
106
126
  private createAgentWorktree;
107
127
  private createBackgroundAgentRun;
108
128
  runWorkflowAgent(options: WorkflowAgentRunOptions): Promise<WorkflowAgentRunResult>;
109
129
  prepareManagement(call: ModelToolCall): ModelToolCall;
110
- executeManagement(call: ModelToolCall, sessionId: string): Promise<ToolExecutionResult>;
111
- notifications(waitForRunning: boolean): Promise<{
130
+ executeManagement(call: ModelToolCall, sessionId: string, context: ToolExecutionContext): Promise<ToolExecutionResult>;
131
+ notifications(waitForRunning: boolean, consume?: boolean): Promise<{
112
132
  messages: string[];
113
133
  usage: ModelUsage;
114
134
  modelUsage?: ModelUsageByModel;
115
135
  durationApiMs?: number;
116
136
  durationApiWithoutRetriesMs?: number;
117
137
  }>;
118
- private hydrateCompletedTask;
138
+ acknowledgeNotifications(messages: readonly string[]): Promise<void>;
139
+ prepareNotificationsDetached(messages: readonly string[]): Promise<void>;
140
+ confirmNotificationsDetached(messages: readonly string[]): Promise<void>;
141
+ reconcileDeliveredNotifications(delivered?: (notification: BackgroundAgentNotificationIdentity) => boolean): Promise<void>;
142
+ reconcileDetachedNotifications(delivered: (notification: BackgroundAgentNotificationIdentity) => boolean): Promise<void>;
143
+ notificationClaimAgentIds(): string[];
144
+ hydratePersistedTasks(sessionId: string, parentCwd: string, excludedAgentIds?: ReadonlySet<string>): Promise<void>;
145
+ private hydratePersistedTask;
119
146
  private resolvePersistedSidechain;
120
147
  private discoverSidechainCandidates;
121
148
  private asyncLaunchResult;