newmark-agent 0.5.14 → 0.6.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/conversation-utility-host.bundle.cjs +4565 -2998
- package/dist/conversation-utility-host.js +1 -1
- package/dist/core/agent.d.ts +108 -16
- package/dist/core/agent.js +698 -195
- package/dist/core/agentKernel/agent.d.ts +1 -0
- package/dist/core/agentKernel/agent.js +9 -0
- package/dist/core/agentKernelDiagnostics.d.ts +4 -6
- package/dist/core/agentKernelDiagnostics.js +12 -9
- package/dist/core/agentKernelRunner.d.ts +5 -0
- package/dist/core/agentKernelRunner.js +250 -107
- package/dist/core/autoRouter.js +17 -27
- package/dist/core/config.d.ts +2 -0
- package/dist/core/config.js +7 -1
- package/dist/core/conversationCommandState.d.ts +17 -0
- package/dist/core/conversationCommandState.js +140 -0
- package/dist/core/conversationKernel.d.ts +25 -4
- package/dist/core/conversationKernel.js +360 -89
- package/dist/core/conversationListEvent.d.ts +6 -0
- package/dist/core/conversationListEvent.js +14 -0
- package/dist/core/electronUtilityAgentClient.d.ts +4 -1
- package/dist/core/electronUtilityAgentClient.js +4 -4
- package/dist/core/electronUtilityRuntimePool.d.ts +8 -2
- package/dist/core/electronUtilityRuntimePool.js +11 -5
- package/dist/core/installUpdate.js +41 -29
- package/dist/core/modelResponseHealth.d.ts +17 -0
- package/dist/core/modelResponseHealth.js +193 -0
- package/dist/core/providerUsageAccounting.d.ts +47 -0
- package/dist/core/providerUsageAccounting.js +71 -0
- package/dist/core/requestContextEstimate.d.ts +18 -0
- package/dist/core/requestContextEstimate.js +54 -0
- package/dist/core/subagent.d.ts +89 -5
- package/dist/core/subagent.js +264 -41
- package/dist/core/subagentCommunication.d.ts +43 -0
- package/dist/core/subagentCommunication.js +167 -0
- package/dist/core/types.d.ts +34 -1
- package/dist/core/utilityAgentProtocol.d.ts +4 -0
- package/dist/core/workEventCoalescer.js +4 -1
- package/dist/core/wslAgentClient.d.ts +18 -5
- package/dist/core/wslAgentClient.js +79 -27
- package/dist/core/wslAgentProtocol.d.ts +7 -0
- package/dist/core/wslAgentRuntimePool.d.ts +8 -2
- package/dist/core/wslAgentRuntimePool.js +19 -6
- package/dist/core/wslRuntimeProcessTree.d.ts +10 -0
- package/dist/core/wslRuntimeProcessTree.js +104 -0
- package/dist/llm/provider.d.ts +5 -12
- package/dist/llm/provider.js +150 -269
- package/dist/main.js +582 -356
- package/dist/preload.js +3 -3
- package/dist/providers/chat-completions.adapter.d.ts +2 -0
- package/dist/providers/chat-completions.adapter.js +84 -36
- package/dist/providers/provider-adapter.d.ts +2 -0
- package/dist/providers/provider-events.d.ts +23 -14
- package/dist/providers/provider-events.js +148 -43
- package/dist/providers/provider-headers.d.ts +7 -3
- package/dist/providers/provider-headers.js +109 -39
- package/dist/providers/provider-request-compat.d.ts +6 -0
- package/dist/providers/provider-request-compat.js +37 -0
- package/dist/providers/responses.adapter.d.ts +2 -0
- package/dist/providers/responses.adapter.js +192 -126
- package/dist/server.d.ts +9 -2
- package/dist/server.js +100 -24
- package/dist/tools/index.js +17 -1
- package/dist/ui/index.html +2515 -693
- package/dist/ui/lucide-sprite.svg +7 -0
- package/dist/ui/startup.html +6 -6
- package/dist/wsl-agent-host.bundle.cjs +4575 -3006
- package/dist/wsl-agent-host.js +9 -4
- package/package.json +23 -4
package/dist/core/subagent.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { NewmarkToolResult } from './compat';
|
|
|
2
2
|
import type { AgentMode } from './types';
|
|
3
3
|
export type SubagentStatus = 'idle' | 'queued' | 'working' | 'completed' | 'closed' | 'error';
|
|
4
4
|
export type SubagentMessageKind = 'directive' | 'question' | 'result' | 'handoff';
|
|
5
|
+
export declare const SUBAGENT_RECOVERY_PROMPT = "[Peer runtime recovery] Continue the unfinished work from the persisted working history. Preserve completed tool results and follow the latest instruction; do not repeat completed work.";
|
|
5
6
|
export interface SubagentMessage {
|
|
6
7
|
id: string;
|
|
7
8
|
conversationId: string;
|
|
@@ -10,6 +11,15 @@ export interface SubagentMessage {
|
|
|
10
11
|
toAgentId: string;
|
|
11
12
|
kind: SubagentMessageKind;
|
|
12
13
|
body: string;
|
|
14
|
+
wakeup: boolean;
|
|
15
|
+
/** A message accepted by an existing job must survive that job settling. */
|
|
16
|
+
acceptedWhileActive: boolean;
|
|
17
|
+
/** Runtime-consumed control messages never become model continuation input. */
|
|
18
|
+
control?: {
|
|
19
|
+
action: 'stop';
|
|
20
|
+
runId: string;
|
|
21
|
+
force: boolean;
|
|
22
|
+
};
|
|
13
23
|
correlationId?: string;
|
|
14
24
|
replyTo?: string;
|
|
15
25
|
createdAt: string;
|
|
@@ -23,8 +33,16 @@ export interface SubagentRootMessage {
|
|
|
23
33
|
toAgentId: string;
|
|
24
34
|
kind: SubagentMessageKind;
|
|
25
35
|
body: string;
|
|
36
|
+
wakeup: boolean;
|
|
26
37
|
createdAt: string;
|
|
27
38
|
readAt?: string;
|
|
39
|
+
/** Only runtime-generated completion notices carry this provenance. */
|
|
40
|
+
source?: 'automatic-settlement';
|
|
41
|
+
settlementRevision?: number;
|
|
42
|
+
}
|
|
43
|
+
export interface SubagentSettlementReceipt {
|
|
44
|
+
peerId: string;
|
|
45
|
+
revision: number;
|
|
28
46
|
}
|
|
29
47
|
export interface SubagentMessageRecord {
|
|
30
48
|
role: string;
|
|
@@ -69,6 +87,8 @@ export interface SubagentInstance {
|
|
|
69
87
|
queueSequence?: number;
|
|
70
88
|
messages: Array<SubagentMessageRecord>;
|
|
71
89
|
result: string | null;
|
|
90
|
+
/** Monotonic per-peer result version, independent of timestamps/content. */
|
|
91
|
+
settlementRevision?: number;
|
|
72
92
|
error?: string;
|
|
73
93
|
createdAt: string;
|
|
74
94
|
startedAt?: string;
|
|
@@ -94,6 +114,8 @@ export interface SubagentState {
|
|
|
94
114
|
nextSequence: number;
|
|
95
115
|
/** Cooperative root-run stop gate. Pending peers stay durable but cannot start until the next root run resumes scheduling. */
|
|
96
116
|
schedulingPaused?: boolean;
|
|
117
|
+
/** Exact queued/in-flight inputs survive a restart between mailbox dispatch and child transcript persistence. */
|
|
118
|
+
jobs?: PendingJob[];
|
|
97
119
|
records: SubagentInstance[];
|
|
98
120
|
mailbox: SubagentMessage[];
|
|
99
121
|
rootInbox: SubagentRootMessage[];
|
|
@@ -142,7 +164,7 @@ export interface SubagentReadSnapshot {
|
|
|
142
164
|
inbound: number;
|
|
143
165
|
outbound: number;
|
|
144
166
|
unread: number;
|
|
145
|
-
latest: Array<Pick<SubagentMessage, 'id' | 'sequence' | 'fromAgentId' | 'toAgentId' | 'kind' | 'body' | 'createdAt' | 'readAt'>>;
|
|
167
|
+
latest: Array<Pick<SubagentMessage, 'id' | 'sequence' | 'fromAgentId' | 'toAgentId' | 'kind' | 'body' | 'wakeup' | 'acceptedWhileActive' | 'createdAt' | 'readAt'>>;
|
|
146
168
|
};
|
|
147
169
|
truncated: boolean;
|
|
148
170
|
}
|
|
@@ -167,6 +189,14 @@ export interface SubagentManagerOptions {
|
|
|
167
189
|
onRootInboxMessage?: (message: SubagentRootMessage) => boolean;
|
|
168
190
|
onSettled?: (record: SubagentInstance) => void;
|
|
169
191
|
}
|
|
192
|
+
interface PendingJob {
|
|
193
|
+
id: string;
|
|
194
|
+
prompt: string;
|
|
195
|
+
flowName: string;
|
|
196
|
+
sequence: number;
|
|
197
|
+
reason: SubagentExecutionJob['reason'];
|
|
198
|
+
inputCommitted?: boolean;
|
|
199
|
+
}
|
|
170
200
|
/** Conversation-owned flat peer-agent coordinator with durable FIFO scheduling. */
|
|
171
201
|
export declare class SubagentManager {
|
|
172
202
|
private subs;
|
|
@@ -174,6 +204,7 @@ export declare class SubagentManager {
|
|
|
174
204
|
private rootInbox;
|
|
175
205
|
private pending;
|
|
176
206
|
private running;
|
|
207
|
+
private activeJobs;
|
|
177
208
|
private schedulingPaused;
|
|
178
209
|
private nextSequence;
|
|
179
210
|
private concurrency;
|
|
@@ -182,33 +213,46 @@ export declare class SubagentManager {
|
|
|
182
213
|
private persist?;
|
|
183
214
|
private onMailboxMessage?;
|
|
184
215
|
private rootInboxListeners;
|
|
216
|
+
private bindingOwner?;
|
|
217
|
+
private ownerBindings;
|
|
185
218
|
private onSettled?;
|
|
186
219
|
private changedQueued;
|
|
187
220
|
private settledWaiters;
|
|
188
221
|
readonly conversationId: string;
|
|
189
222
|
readonly rootAgentId: string;
|
|
190
223
|
hasRecords(): boolean;
|
|
224
|
+
hasPendingWork(): boolean;
|
|
191
225
|
reset(): void;
|
|
192
226
|
constructor(options?: SubagentManagerOptions);
|
|
193
227
|
bind(options: Pick<SubagentManagerOptions, 'concurrency' | 'executor' | 'onChange' | 'persist' | 'onMailboxMessage' | 'onRootInboxMessage' | 'onSettled'>): void;
|
|
228
|
+
ownsExecutionBinding(listener: (message: SubagentRootMessage) => boolean): boolean;
|
|
229
|
+
private rememberOwnerBinding;
|
|
194
230
|
removeRootInboxListener(listener: (message: SubagentRootMessage) => boolean): void;
|
|
231
|
+
/** Detach one facade without clearing a newer owner's callbacks or live jobs. */
|
|
232
|
+
releaseOwnerBinding(listener: (message: SubagentRootMessage) => boolean): boolean;
|
|
195
233
|
create(name: string, prompt: string, model?: string, inputMode?: string, agentMode?: AgentMode, createdByAgentId?: string, flowName?: string, goalObjective?: string, flowPc?: number, buildRunId?: string, intelligenceTier?: string): string;
|
|
196
234
|
get(id: string): SubagentInstance | undefined;
|
|
197
|
-
send(id: string, prompt: string): boolean;
|
|
235
|
+
send(id: string, prompt: string, wakeup?: boolean): boolean;
|
|
236
|
+
broadcastStop(fromAgentId: string, runId: string, force?: boolean): {
|
|
237
|
+
count: number;
|
|
238
|
+
ids: string[];
|
|
239
|
+
peerIds: string[];
|
|
240
|
+
};
|
|
198
241
|
sendMessage(fromAgentId: string, toAgentId: string, body: string, kind?: SubagentMessageKind, details?: {
|
|
199
242
|
correlationId?: string;
|
|
200
243
|
replyTo?: string;
|
|
201
|
-
}): {
|
|
244
|
+
}, wakeup?: boolean): {
|
|
202
245
|
ok: boolean;
|
|
203
246
|
message?: SubagentMessage;
|
|
204
247
|
error?: string;
|
|
205
248
|
};
|
|
206
|
-
sendRootMessage(fromAgentId: string, body: string, kind?: SubagentMessageKind): {
|
|
249
|
+
sendRootMessage(fromAgentId: string, body: string, kind?: SubagentMessageKind, settlementRevision?: number, wakeup?: boolean): {
|
|
207
250
|
ok: boolean;
|
|
208
251
|
message?: SubagentRootMessage;
|
|
209
252
|
error?: string;
|
|
210
253
|
};
|
|
211
254
|
readRootInbox(): SubagentRootMessage[];
|
|
255
|
+
acknowledgeSettlementResults(receipts: SubagentSettlementReceipt[]): string[];
|
|
212
256
|
acknowledgeRootInbox(messageId: string): boolean;
|
|
213
257
|
consumeMailbox(agentId: string): SubagentMessage[];
|
|
214
258
|
acknowledgeMailbox(agentId: string, messageId: string): boolean;
|
|
@@ -219,7 +263,8 @@ export declare class SubagentManager {
|
|
|
219
263
|
error?: string;
|
|
220
264
|
};
|
|
221
265
|
appendAssistant(id: string, content: string): void;
|
|
222
|
-
replaceContext(id: string, history: Array<Record<string, unknown>>, compression: SubagentCompressionState | null): void;
|
|
266
|
+
replaceContext(id: string, history: Array<Record<string, unknown>>, compression: SubagentCompressionState | null, inputCommitted?: boolean): void;
|
|
267
|
+
patchMetadata(id: string, patch: Record<string, unknown>): void;
|
|
223
268
|
complete(id: string, result: string): void;
|
|
224
269
|
fail(id: string, error: string): void;
|
|
225
270
|
markWorking(id: string): void;
|
|
@@ -235,6 +280,44 @@ export declare class SubagentManager {
|
|
|
235
280
|
boundedResultTranscript(idOrName: string): string;
|
|
236
281
|
listActive(): SubagentInstance[];
|
|
237
282
|
listAll(): SubagentInstance[];
|
|
283
|
+
/** Model-facing list: detailed transcripts and request cache remain private. */
|
|
284
|
+
listSummaries(status?: string): {
|
|
285
|
+
id: string;
|
|
286
|
+
shortId: string;
|
|
287
|
+
natureSlug: string;
|
|
288
|
+
displayName: string;
|
|
289
|
+
qualifiedName: string;
|
|
290
|
+
name: string;
|
|
291
|
+
conversationId: string;
|
|
292
|
+
createdByAgentId: string;
|
|
293
|
+
buildRunId: string | undefined;
|
|
294
|
+
intelligenceTier: string | undefined;
|
|
295
|
+
prompt: string;
|
|
296
|
+
model: string;
|
|
297
|
+
inputMode: string;
|
|
298
|
+
agentMode: AgentMode;
|
|
299
|
+
mode: AgentMode;
|
|
300
|
+
status: SubagentStatus;
|
|
301
|
+
active: boolean;
|
|
302
|
+
goalObjective: string | undefined;
|
|
303
|
+
flowName: string | undefined;
|
|
304
|
+
flowPc: number | undefined;
|
|
305
|
+
queueSequence: number | undefined;
|
|
306
|
+
resultAvailable: boolean;
|
|
307
|
+
resultChars: number;
|
|
308
|
+
settlementRevision: number | undefined;
|
|
309
|
+
messageCount: number;
|
|
310
|
+
error: string | undefined;
|
|
311
|
+
createdAt: string;
|
|
312
|
+
startedAt: string | undefined;
|
|
313
|
+
updatedAt: string;
|
|
314
|
+
completedAt: string | undefined;
|
|
315
|
+
closedAt: string | undefined;
|
|
316
|
+
mailbox: {
|
|
317
|
+
total: number;
|
|
318
|
+
unread: number;
|
|
319
|
+
};
|
|
320
|
+
}[];
|
|
238
321
|
activeCountForBuild(buildRunId: string): number;
|
|
239
322
|
setConcurrencyLimit(value: number): void;
|
|
240
323
|
concurrencyLimit(): number;
|
|
@@ -258,4 +341,5 @@ export declare class SubagentManager {
|
|
|
258
341
|
}
|
|
259
342
|
export declare function sharedSubagentManager(key: string, options: SubagentManagerOptions): SubagentManager;
|
|
260
343
|
export declare function releaseSharedSubagentManager(key: string): void;
|
|
344
|
+
export {};
|
|
261
345
|
//# sourceMappingURL=subagent.d.ts.map
|