@rkat/web 0.4.12 → 0.5.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/events.d.ts +1 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +1 -1
- package/dist/events.js.map +1 -1
- package/dist/generated/events.d.ts +221 -0
- package/dist/generated/events.d.ts.map +1 -0
- package/dist/generated/events.js +36 -0
- package/dist/generated/events.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mob.d.ts +48 -11
- package/dist/mob.d.ts.map +1 -1
- package/dist/mob.js +100 -11
- package/dist/mob.js.map +1 -1
- package/dist/runtime.d.ts +30 -9
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +39 -10
- package/dist/runtime.js.map +1 -1
- package/dist/session.d.ts +9 -6
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +51 -6
- package/dist/session.js.map +1 -1
- package/dist/types.d.ts +103 -75
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -7
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/proxy/cli.mjs +0 -0
- package/wasm/meerkat_web_runtime.d.ts +77 -28
- package/wasm/meerkat_web_runtime.js +179 -42
- package/wasm/meerkat_web_runtime_bg.wasm +0 -0
- package/wasm/meerkat_web_runtime_bg.wasm.d.ts +10 -1
- package/wasm/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { KNOWN_AGENT_EVENT_TYPES } from './generated/events.js';
|
|
2
|
+
import type { AgentEvent, Usage } from './generated/events.js';
|
|
1
3
|
/** Configuration for {@link MeerkatRuntime.init}. */
|
|
2
4
|
export interface RuntimeConfig {
|
|
3
5
|
/** Backward-compat single API key (treated as Anthropic fallback). */
|
|
@@ -48,8 +50,8 @@ export interface SessionConfig {
|
|
|
48
50
|
geminiBaseUrl?: string;
|
|
49
51
|
/** Enable comms for this session. */
|
|
50
52
|
commsName?: string;
|
|
51
|
-
/** Whether this session runs in
|
|
52
|
-
|
|
53
|
+
/** Whether this session runs in keep-alive mode. */
|
|
54
|
+
keepAlive?: boolean;
|
|
53
55
|
/** Application-defined labels. */
|
|
54
56
|
labels?: Record<string, string>;
|
|
55
57
|
/** Additional instruction sections appended to the system prompt. */
|
|
@@ -66,6 +68,19 @@ export type ContentBlock = {
|
|
|
66
68
|
media_type: string;
|
|
67
69
|
data: string;
|
|
68
70
|
};
|
|
71
|
+
/** Canonical ordinary content input. */
|
|
72
|
+
export type ContentInput = string | ContentBlock[];
|
|
73
|
+
/** Runtime handling mode for ordinary work. */
|
|
74
|
+
export type HandlingMode = 'queue' | 'steer';
|
|
75
|
+
/** Standardized rendering class for injected ordinary work. */
|
|
76
|
+
export type RenderClass = 'user_prompt' | 'peer_message' | 'peer_request' | 'peer_response' | 'external_event' | 'flow_step' | 'continuation' | 'system_notice' | 'tool_scope_notice' | 'ops_progress';
|
|
77
|
+
/** Normalized rendering salience for injected work. */
|
|
78
|
+
export type RenderSalience = 'background' | 'normal' | 'important' | 'urgent';
|
|
79
|
+
/** Normalized rendering metadata for injected work. */
|
|
80
|
+
export interface RenderMetadata {
|
|
81
|
+
class: RenderClass;
|
|
82
|
+
salience?: RenderSalience;
|
|
83
|
+
}
|
|
69
84
|
/** Options for a single turn. */
|
|
70
85
|
export interface TurnOptions {
|
|
71
86
|
/** Additional instructions for this turn only. */
|
|
@@ -85,6 +100,18 @@ export interface AppendSystemContextResult {
|
|
|
85
100
|
handle: number;
|
|
86
101
|
status: 'staged' | 'duplicate';
|
|
87
102
|
}
|
|
103
|
+
/** Runtime-backed state for a direct browser session façade. */
|
|
104
|
+
export interface SessionState {
|
|
105
|
+
handle: number;
|
|
106
|
+
session_id: string;
|
|
107
|
+
mob_id: string;
|
|
108
|
+
model: string;
|
|
109
|
+
usage: Usage;
|
|
110
|
+
run_counter: number;
|
|
111
|
+
message_count: number;
|
|
112
|
+
is_active: boolean;
|
|
113
|
+
last_assistant_text?: string | null;
|
|
114
|
+
}
|
|
88
115
|
/** Result of appending runtime system context to a mob member session. */
|
|
89
116
|
export interface MobAppendSystemContextResult {
|
|
90
117
|
mob_id: string;
|
|
@@ -92,6 +119,24 @@ export interface MobAppendSystemContextResult {
|
|
|
92
119
|
session_id: string;
|
|
93
120
|
status: 'staged' | 'duplicate';
|
|
94
121
|
}
|
|
122
|
+
/** Delivery receipt for a direct mob member turn. */
|
|
123
|
+
export interface MemberDeliveryReceipt {
|
|
124
|
+
member_id: string;
|
|
125
|
+
session_id: string;
|
|
126
|
+
handling_mode: HandlingMode;
|
|
127
|
+
}
|
|
128
|
+
/** Respawn receipt for a mob member. */
|
|
129
|
+
export interface MemberRespawnReceipt {
|
|
130
|
+
member_id: string;
|
|
131
|
+
old_session_id?: string | null;
|
|
132
|
+
new_session_id?: string | null;
|
|
133
|
+
}
|
|
134
|
+
/** Result envelope for a member respawn operation. */
|
|
135
|
+
export interface MobRespawnResult {
|
|
136
|
+
status: 'completed' | 'topology_restore_failed';
|
|
137
|
+
receipt: MemberRespawnReceipt;
|
|
138
|
+
failed_peer_ids?: string[];
|
|
139
|
+
}
|
|
95
140
|
/** Result of a turn execution. */
|
|
96
141
|
export interface TurnResult {
|
|
97
142
|
/** Canonical text returned by the runtime. */
|
|
@@ -104,10 +149,7 @@ export interface TurnResult {
|
|
|
104
149
|
session_id?: string;
|
|
105
150
|
status?: string;
|
|
106
151
|
}
|
|
107
|
-
export
|
|
108
|
-
input_tokens: number;
|
|
109
|
-
output_tokens: number;
|
|
110
|
-
}
|
|
152
|
+
export type { AgentEvent, BudgetType, HookId, HookPatch, HookPatchEnvelope, HookPoint, HookReasonCode, HookRevision, InteractionId, KnownAgentEventType, ReasoningCompleteEvent, ReasoningDeltaEvent, RunCompletedEvent, RunFailedEvent, RunStartedEvent, SessionId, SkillId, SkillsResolvedEvent, SkillResolutionFailedEvent, StopReason, StreamTruncatedEvent, TextCompleteEvent, TextDeltaEvent, ToolCallRequestedEvent, ToolConfigChangeOperation, ToolConfigChangedEvent, ToolConfigChangedPayload, ToolExecutionCompletedEvent, ToolExecutionStartedEvent, ToolExecutionTimedOutEvent, ToolResultReceivedEvent, TurnCompletedEvent, TurnStartedEvent, Usage, HookStartedEvent, HookCompletedEvent, HookFailedEvent, HookDeniedEvent, HookRewriteAppliedEvent, HookPatchPublishedEvent, CompactionStartedEvent, CompactionCompletedEvent, CompactionFailedEvent, BudgetWarningEvent, RetryingEvent, InteractionCompleteEvent, InteractionFailedEvent, } from './generated/events.js';
|
|
111
153
|
/**
|
|
112
154
|
* Mob definition passed to {@link MeerkatRuntime.createMob}.
|
|
113
155
|
*
|
|
@@ -193,7 +235,7 @@ export interface SpawnSpec {
|
|
|
193
235
|
profile: string;
|
|
194
236
|
meerkat_id: string;
|
|
195
237
|
runtime_mode?: 'turn_driven' | 'autonomous_host';
|
|
196
|
-
initial_message?: string;
|
|
238
|
+
initial_message?: string | ContentBlock[];
|
|
197
239
|
labels?: Record<string, string>;
|
|
198
240
|
}
|
|
199
241
|
/** Result of a spawn operation. */
|
|
@@ -207,18 +249,59 @@ export interface MobMember {
|
|
|
207
249
|
meerkat_id: string;
|
|
208
250
|
profile: string;
|
|
209
251
|
member_ref: Record<string, unknown>;
|
|
252
|
+
peer_id?: string;
|
|
253
|
+
external_peer_specs?: Record<string, Record<string, unknown>>;
|
|
210
254
|
runtime_mode?: string;
|
|
211
255
|
state?: string;
|
|
212
256
|
wired_to?: string[];
|
|
213
257
|
labels?: Record<string, string>;
|
|
258
|
+
status?: string;
|
|
259
|
+
error?: string;
|
|
260
|
+
is_final?: boolean;
|
|
261
|
+
current_session_id?: string;
|
|
262
|
+
}
|
|
263
|
+
export interface ExternalPeerTarget {
|
|
264
|
+
external: {
|
|
265
|
+
name: string;
|
|
266
|
+
peer_id: string;
|
|
267
|
+
address: string;
|
|
268
|
+
};
|
|
214
269
|
}
|
|
270
|
+
export type MobPeerTarget = string | ExternalPeerTarget;
|
|
215
271
|
/** Mob status. */
|
|
216
272
|
export interface MobStatus {
|
|
217
273
|
mob_id: string;
|
|
218
274
|
state: string;
|
|
219
275
|
}
|
|
276
|
+
/** Unreachable peer entry from a live member connectivity snapshot. */
|
|
277
|
+
export interface MobUnreachablePeer {
|
|
278
|
+
peer: string;
|
|
279
|
+
reason?: string;
|
|
280
|
+
}
|
|
281
|
+
/** Live peer connectivity projection for a mob member snapshot. */
|
|
282
|
+
export interface MobPeerConnectivitySnapshot {
|
|
283
|
+
reachable_peer_count: number;
|
|
284
|
+
unknown_peer_count: number;
|
|
285
|
+
unreachable_peers: MobUnreachablePeer[];
|
|
286
|
+
}
|
|
287
|
+
/** Point-in-time execution snapshot for a mob member. */
|
|
288
|
+
export interface MobMemberSnapshot {
|
|
289
|
+
status: string;
|
|
290
|
+
output_preview?: string;
|
|
291
|
+
error?: string;
|
|
292
|
+
tokens_used: number;
|
|
293
|
+
is_final: boolean;
|
|
294
|
+
current_session_id?: string;
|
|
295
|
+
peer_connectivity?: MobPeerConnectivitySnapshot;
|
|
296
|
+
}
|
|
297
|
+
/** Result envelope for helper-style mob flows. */
|
|
298
|
+
export interface MobHelperResult {
|
|
299
|
+
output?: string;
|
|
300
|
+
tokens_used: number;
|
|
301
|
+
session_id?: string;
|
|
302
|
+
}
|
|
220
303
|
/** Mob lifecycle actions. */
|
|
221
|
-
export type MobLifecycleAction = 'stop' | 'resume' | 'complete' | 'destroy';
|
|
304
|
+
export type MobLifecycleAction = 'stop' | 'resume' | 'complete' | 'reset' | 'destroy';
|
|
222
305
|
/** Envelope wrapping an agent event with metadata. */
|
|
223
306
|
export interface EventEnvelope {
|
|
224
307
|
session_id?: string;
|
|
@@ -229,12 +312,23 @@ export interface EventEnvelope {
|
|
|
229
312
|
[key: string]: unknown;
|
|
230
313
|
};
|
|
231
314
|
}
|
|
315
|
+
/** Poll/subscribe lag sentinel emitted by the browser runtime. */
|
|
316
|
+
export interface SubscriptionLaggedEvent {
|
|
317
|
+
type: 'lagged';
|
|
318
|
+
skipped: number;
|
|
319
|
+
}
|
|
320
|
+
/** Direct-session event item. */
|
|
321
|
+
export type SessionEvent = AgentEvent | SubscriptionLaggedEvent;
|
|
322
|
+
/** Member subscription item from the browser runtime. */
|
|
323
|
+
export type MemberEventItem = EventEnvelope | SubscriptionLaggedEvent;
|
|
232
324
|
/** Attributed mob-wide event from mob subscriptions. */
|
|
233
325
|
export interface AttributedEvent {
|
|
234
326
|
source: string;
|
|
235
327
|
profile: string;
|
|
236
328
|
envelope: EventEnvelope;
|
|
237
329
|
}
|
|
330
|
+
/** Mob-wide subscription item from the browser runtime. */
|
|
331
|
+
export type AttributedEventItem = AttributedEvent | SubscriptionLaggedEvent;
|
|
238
332
|
/** Structural mob event from the mob event log. */
|
|
239
333
|
export interface MobEvent {
|
|
240
334
|
cursor: number;
|
|
@@ -242,73 +336,7 @@ export interface MobEvent {
|
|
|
242
336
|
mob_id: string;
|
|
243
337
|
kind: Record<string, unknown>;
|
|
244
338
|
}
|
|
245
|
-
|
|
246
|
-
* Known agent event types (discriminated union on `type`).
|
|
247
|
-
*
|
|
248
|
-
* Matches Rust `AgentEvent` with `#[serde(tag = "type", rename_all = "snake_case")]`.
|
|
249
|
-
*/
|
|
250
|
-
export type AgentEvent = TextDeltaEvent | TextCompleteEvent | ToolCallRequestedEvent | ToolResultReceivedEvent | TurnStartedEvent | TurnCompletedEvent | RunCompletedEvent | RunFailedEvent | ToolExecutionStartedEvent | ToolExecutionCompletedEvent | ReasoningDeltaEvent | ReasoningCompleteEvent;
|
|
251
|
-
export interface TextDeltaEvent {
|
|
252
|
-
type: 'text_delta';
|
|
253
|
-
delta: string;
|
|
254
|
-
}
|
|
255
|
-
export interface TextCompleteEvent {
|
|
256
|
-
type: 'text_complete';
|
|
257
|
-
content: string;
|
|
258
|
-
}
|
|
259
|
-
export interface ToolCallRequestedEvent {
|
|
260
|
-
type: 'tool_call_requested';
|
|
261
|
-
id: string;
|
|
262
|
-
name: string;
|
|
263
|
-
args: unknown;
|
|
264
|
-
}
|
|
265
|
-
export interface ToolResultReceivedEvent {
|
|
266
|
-
type: 'tool_result_received';
|
|
267
|
-
id: string;
|
|
268
|
-
name: string;
|
|
269
|
-
is_error: boolean;
|
|
270
|
-
}
|
|
271
|
-
export interface TurnStartedEvent {
|
|
272
|
-
type: 'turn_started';
|
|
273
|
-
turn_number: number;
|
|
274
|
-
}
|
|
275
|
-
export interface TurnCompletedEvent {
|
|
276
|
-
type: 'turn_completed';
|
|
277
|
-
stop_reason: string;
|
|
278
|
-
usage: Usage;
|
|
279
|
-
}
|
|
280
|
-
export interface RunCompletedEvent {
|
|
281
|
-
type: 'run_completed';
|
|
282
|
-
session_id: string;
|
|
283
|
-
result: string;
|
|
284
|
-
usage: Usage;
|
|
285
|
-
}
|
|
286
|
-
export interface RunFailedEvent {
|
|
287
|
-
type: 'run_failed';
|
|
288
|
-
session_id: string;
|
|
289
|
-
error: string;
|
|
290
|
-
}
|
|
291
|
-
export interface ToolExecutionStartedEvent {
|
|
292
|
-
type: 'tool_execution_started';
|
|
293
|
-
id: string;
|
|
294
|
-
name: string;
|
|
295
|
-
}
|
|
296
|
-
export interface ToolExecutionCompletedEvent {
|
|
297
|
-
type: 'tool_execution_completed';
|
|
298
|
-
id: string;
|
|
299
|
-
name: string;
|
|
300
|
-
result: string;
|
|
301
|
-
is_error: boolean;
|
|
302
|
-
duration_ms: number;
|
|
303
|
-
}
|
|
304
|
-
export interface ReasoningDeltaEvent {
|
|
305
|
-
type: 'reasoning_delta';
|
|
306
|
-
delta: string;
|
|
307
|
-
}
|
|
308
|
-
export interface ReasoningCompleteEvent {
|
|
309
|
-
type: 'reasoning_complete';
|
|
310
|
-
content: string;
|
|
311
|
-
}
|
|
339
|
+
export { KNOWN_AGENT_EVENT_TYPES };
|
|
312
340
|
/** Type guard for known event types. */
|
|
313
341
|
export declare function isKnownEvent(event: {
|
|
314
342
|
type: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAI/D,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sBAAsB;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uBAAuB;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uBAAuB;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,0CAA0C;AAC1C,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,6DAA6D;AAC7D,MAAM,WAAW,aAAa;IAC5B,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8CAA8C;I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uB,EAAE,CAAC;AAEnC,wCAAwC;AACxC,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,IAAI,UAAU,CAEzE;AAID,yCAAyC;AACzC,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,4CAA4C;AAC5C,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,gCAAgC;AAChC,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAIzE,gCAAgC;AAChC,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
package/dist/types.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { KNOWN_AGENT_EVENT_TYPES } from './generated/events.js';
|
|
2
|
+
export { KNOWN_AGENT_EVENT_TYPES };
|
|
2
3
|
/** Type guard for known event types. */
|
|
3
4
|
export function isKnownEvent(event) {
|
|
4
|
-
return
|
|
5
|
-
'text_delta', 'text_complete', 'tool_call_requested', 'tool_result_received',
|
|
6
|
-
'turn_started', 'turn_completed', 'run_completed', 'run_failed',
|
|
7
|
-
'tool_execution_started', 'tool_execution_completed',
|
|
8
|
-
'reasoning_delta', 'reasoning_complete',
|
|
9
|
-
].includes(event.type);
|
|
5
|
+
return KNOWN_AGENT_EVENT_TYPES.includes(event.type);
|
|
10
6
|
}
|
|
11
7
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAubhE,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,wCAAwC;AACxC,MAAM,UAAU,YAAY,CAAC,KAAuB;IAClD,OAAQ,uBAA6C,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC7E,CAAC"}
|
package/package.json
CHANGED
package/proxy/cli.mjs
CHANGED
|
File without changes
|
|
@@ -37,7 +37,7 @@ export class IntoUnderlyingSource {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* Append runtime system context to a
|
|
40
|
+
* Append runtime system context to a browser session handle.
|
|
41
41
|
*/
|
|
42
42
|
export function append_system_context(handle: number, request_json: string): any;
|
|
43
43
|
|
|
@@ -54,24 +54,24 @@ export function close_subscription(handle: number): void;
|
|
|
54
54
|
/**
|
|
55
55
|
* Create a session from a mobpack + config.
|
|
56
56
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* `config_json`: `{ "model": "...", "api_key": "sk-...", "max_tokens"?: N,
|
|
61
|
-
* "comms_name"?: "...", "host_mode"?: true }`
|
|
57
|
+
* Allocates a real session through the initialized runtime-backed session
|
|
58
|
+
* service, then returns a browser-local session handle for convenience.
|
|
62
59
|
*/
|
|
63
60
|
export function create_session(mobpack_bytes: Uint8Array, config_json: string): number;
|
|
64
61
|
|
|
65
62
|
/**
|
|
66
|
-
* Create a session
|
|
67
|
-
*
|
|
68
|
-
* `config_json`: `{ "model": "...", "api_key": "sk-...", "system_prompt"?: "...",
|
|
69
|
-
* "max_tokens"?: N, "additional_instructions"?: ["..."] }`
|
|
70
|
-
*
|
|
71
|
-
* Uses `register_tool_callback` tools if any were registered before this call.
|
|
63
|
+
* Create a standalone session through initialized runtime state.
|
|
72
64
|
*/
|
|
73
65
|
export function create_session_simple(config_json: string): number;
|
|
74
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Tear down the embedded runtime and release all local handles/subscriptions.
|
|
69
|
+
*
|
|
70
|
+
* Existing `Session`, `Mob`, and subscription handles become invalid after
|
|
71
|
+
* this call.
|
|
72
|
+
*/
|
|
73
|
+
export function destroy_runtime(): void;
|
|
74
|
+
|
|
75
75
|
/**
|
|
76
76
|
* Remove a session.
|
|
77
77
|
*/
|
|
@@ -139,10 +139,20 @@ export function mob_events(mob_id: string, after_cursor: number, limit: number):
|
|
|
139
139
|
*/
|
|
140
140
|
export function mob_flow_status(mob_id: string, run_id: string): Promise<any>;
|
|
141
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Force-cancel an active mob member turn.
|
|
144
|
+
*/
|
|
145
|
+
export function mob_force_cancel(mob_id: string, meerkat_id: string): Promise<void>;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Fork a short-lived helper from an existing member and return its terminal result.
|
|
149
|
+
*/
|
|
150
|
+
export function mob_fork_helper(mob_id: string, request_json: string): Promise<any>;
|
|
151
|
+
|
|
142
152
|
/**
|
|
143
153
|
* Perform a lifecycle action on a mob.
|
|
144
154
|
*
|
|
145
|
-
* `action`: one of "stop", "resume", "complete", "destroy".
|
|
155
|
+
* `action`: one of "stop", "resume", "complete", "reset", "destroy".
|
|
146
156
|
*/
|
|
147
157
|
export function mob_lifecycle(mob_id: string, action: string): Promise<void>;
|
|
148
158
|
|
|
@@ -160,6 +170,18 @@ export function mob_list(): Promise<any>;
|
|
|
160
170
|
*/
|
|
161
171
|
export function mob_list_members(mob_id: string): Promise<any>;
|
|
162
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Send external work to a spawned meerkat through the canonical member path.
|
|
175
|
+
*
|
|
176
|
+
* Returns a JSON-encoded delivery receipt.
|
|
177
|
+
*/
|
|
178
|
+
export function mob_member_send(mob_id: string, meerkat_id: string, request_json: string): Promise<string>;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Read the current execution snapshot for a mob member.
|
|
182
|
+
*/
|
|
183
|
+
export function mob_member_status(mob_id: string, meerkat_id: string): Promise<any>;
|
|
184
|
+
|
|
163
185
|
/**
|
|
164
186
|
* Subscribe to a mob member's session event stream.
|
|
165
187
|
*
|
|
@@ -174,7 +196,7 @@ export function mob_member_subscribe(mob_id: string, meerkat_id: string): Promis
|
|
|
174
196
|
/**
|
|
175
197
|
* Retire and re-spawn a meerkat with the same profile.
|
|
176
198
|
*
|
|
177
|
-
* Returns JSON
|
|
199
|
+
* Returns JSON result envelope with receipt.
|
|
178
200
|
*/
|
|
179
201
|
export function mob_respawn(mob_id: string, meerkat_id: string, initial_message?: string | null): Promise<any>;
|
|
180
202
|
|
|
@@ -190,23 +212,21 @@ export function mob_retire(mob_id: string, meerkat_id: string): Promise<void>;
|
|
|
190
212
|
*/
|
|
191
213
|
export function mob_run_flow(mob_id: string, flow_id: string, params_json: string): Promise<any>;
|
|
192
214
|
|
|
193
|
-
/**
|
|
194
|
-
* Send an external message to a spawned meerkat.
|
|
195
|
-
*
|
|
196
|
-
* Returns the session ID of the session that handled the turn.
|
|
197
|
-
*/
|
|
198
|
-
export function mob_send_message(mob_id: string, meerkat_id: string, message: string): Promise<string>;
|
|
199
|
-
|
|
200
215
|
/**
|
|
201
216
|
* Spawn one or more meerkats in a mob.
|
|
202
217
|
*
|
|
203
218
|
* `specs_json`: JSON array of `{ "profile": "...", "meerkat_id": "...", "initial_message"?: "...",
|
|
204
|
-
* "runtime_mode"?: "autonomous_host"|"turn_driven", "backend"?: "
|
|
219
|
+
* "runtime_mode"?: "autonomous_host"|"turn_driven", "backend"?: "session"|"external" }`
|
|
205
220
|
*
|
|
206
221
|
* Returns JSON array of results per spec.
|
|
207
222
|
*/
|
|
208
223
|
export function mob_spawn(mob_id: string, specs_json: string): Promise<any>;
|
|
209
224
|
|
|
225
|
+
/**
|
|
226
|
+
* Spawn a short-lived helper and return its terminal result.
|
|
227
|
+
*/
|
|
228
|
+
export function mob_spawn_helper(mob_id: string, request_json: string): Promise<any>;
|
|
229
|
+
|
|
210
230
|
/**
|
|
211
231
|
* Get the status of a mob.
|
|
212
232
|
*
|
|
@@ -231,11 +251,31 @@ export function mob_subscribe_events(mob_id: string): Promise<number>;
|
|
|
231
251
|
*/
|
|
232
252
|
export function mob_unwire(mob_id: string, a: string, b: string): Promise<void>;
|
|
233
253
|
|
|
254
|
+
/**
|
|
255
|
+
* Unwire a local member from a local or external peer target.
|
|
256
|
+
*/
|
|
257
|
+
export function mob_unwire_peer(mob_id: string, member: string, peer_json: string): Promise<void>;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Unwire a local meerkat from a local or external peer target.
|
|
261
|
+
*/
|
|
262
|
+
export function mob_unwire_target(mob_id: string, local: string, target_json: string): Promise<void>;
|
|
263
|
+
|
|
234
264
|
/**
|
|
235
265
|
* Wire bidirectional trust between two meerkats.
|
|
236
266
|
*/
|
|
237
267
|
export function mob_wire(mob_id: string, a: string, b: string): Promise<void>;
|
|
238
268
|
|
|
269
|
+
/**
|
|
270
|
+
* Wire a local member to a local or external peer target.
|
|
271
|
+
*/
|
|
272
|
+
export function mob_wire_peer(mob_id: string, member: string, peer_json: string): Promise<void>;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Wire a local meerkat to a local or external peer target.
|
|
276
|
+
*/
|
|
277
|
+
export function mob_wire_target(mob_id: string, local: string, target_json: string): Promise<void>;
|
|
278
|
+
|
|
239
279
|
/**
|
|
240
280
|
* Drain and return all pending agent events from the last turn(s).
|
|
241
281
|
*
|
|
@@ -260,13 +300,13 @@ export function poll_subscription(handle: number): string;
|
|
|
260
300
|
/**
|
|
261
301
|
* Register a fire-and-forget tool from JavaScript.
|
|
262
302
|
*
|
|
263
|
-
*
|
|
303
|
+
* Requires initialized runtime state.
|
|
264
304
|
* When the agent calls this tool, `dispatch()` returns `"acknowledged"`
|
|
265
305
|
* immediately and the agent loop continues without waiting.
|
|
266
306
|
*
|
|
267
307
|
* The host should watch `ToolCallRequested` events in the event stream to
|
|
268
308
|
* capture the tool call arguments and act on them asynchronously. Any
|
|
269
|
-
* response (e.g. human approval) should be sent back via `
|
|
309
|
+
* response (e.g. human approval) should be sent back via `mob_member_send`.
|
|
270
310
|
*
|
|
271
311
|
* Example (JS):
|
|
272
312
|
* ```js
|
|
@@ -289,7 +329,7 @@ export function register_js_tool(name: string, description: string, schema_json:
|
|
|
289
329
|
/**
|
|
290
330
|
* Register a tool implementation from JavaScript.
|
|
291
331
|
*
|
|
292
|
-
*
|
|
332
|
+
* Requires initialized runtime state.
|
|
293
333
|
* The `callback` receives a JSON string of tool arguments and must return
|
|
294
334
|
* a `Promise<string>` resolving to JSON `{"content": "...", "is_error": false}`.
|
|
295
335
|
*
|
|
@@ -309,12 +349,12 @@ export function register_tool_callback(name: string, description: string, schema
|
|
|
309
349
|
export function runtime_version(): string;
|
|
310
350
|
|
|
311
351
|
/**
|
|
312
|
-
* Run a turn through the
|
|
352
|
+
* Run a turn through the runtime-backed session service.
|
|
313
353
|
*
|
|
314
354
|
* Returns JSON: `{ "text", "usage", "status", "session_id", "turns", "tool_calls" }`
|
|
315
355
|
*
|
|
316
356
|
* Convention: always resolves (Ok). Check `status` field for "completed" vs "failed".
|
|
317
|
-
* Only rejects (Err) for infrastructure errors (session not found,
|
|
357
|
+
* Only rejects (Err) for infrastructure errors (session not found, busy, etc).
|
|
318
358
|
* Agent-level errors (LLM failure, timeout) resolve with `status: "failed"` + `error` field.
|
|
319
359
|
*/
|
|
320
360
|
export function start_turn(handle: number, prompt: string, options_json: string): Promise<any>;
|
|
@@ -341,6 +381,7 @@ export interface InitOutput {
|
|
|
341
381
|
readonly close_subscription: (a: number) => [number, number];
|
|
342
382
|
readonly create_session: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
343
383
|
readonly create_session_simple: (a: number, b: number) => [number, number, number];
|
|
384
|
+
readonly destroy_runtime: () => [number, number];
|
|
344
385
|
readonly destroy_session: (a: number) => [number, number];
|
|
345
386
|
readonly get_session_state: (a: number) => [number, number, number, number];
|
|
346
387
|
readonly init_runtime: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
@@ -351,19 +392,27 @@ export interface InitOutput {
|
|
|
351
392
|
readonly mob_create: (a: number, b: number) => any;
|
|
352
393
|
readonly mob_events: (a: number, b: number, c: number, d: number) => any;
|
|
353
394
|
readonly mob_flow_status: (a: number, b: number, c: number, d: number) => any;
|
|
395
|
+
readonly mob_force_cancel: (a: number, b: number, c: number, d: number) => any;
|
|
396
|
+
readonly mob_fork_helper: (a: number, b: number, c: number, d: number) => any;
|
|
354
397
|
readonly mob_lifecycle: (a: number, b: number, c: number, d: number) => any;
|
|
355
398
|
readonly mob_list: () => any;
|
|
356
399
|
readonly mob_list_members: (a: number, b: number) => any;
|
|
400
|
+
readonly mob_member_send: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
401
|
+
readonly mob_member_status: (a: number, b: number, c: number, d: number) => any;
|
|
357
402
|
readonly mob_member_subscribe: (a: number, b: number, c: number, d: number) => any;
|
|
358
403
|
readonly mob_respawn: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
359
404
|
readonly mob_retire: (a: number, b: number, c: number, d: number) => any;
|
|
360
405
|
readonly mob_run_flow: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
361
|
-
readonly mob_send_message: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
362
406
|
readonly mob_spawn: (a: number, b: number, c: number, d: number) => any;
|
|
407
|
+
readonly mob_spawn_helper: (a: number, b: number, c: number, d: number) => any;
|
|
363
408
|
readonly mob_status: (a: number, b: number) => any;
|
|
364
409
|
readonly mob_subscribe_events: (a: number, b: number) => any;
|
|
365
410
|
readonly mob_unwire: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
411
|
+
readonly mob_unwire_peer: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
412
|
+
readonly mob_unwire_target: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
366
413
|
readonly mob_wire: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
414
|
+
readonly mob_wire_peer: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
415
|
+
readonly mob_wire_target: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
367
416
|
readonly poll_events: (a: number) => [number, number, number, number];
|
|
368
417
|
readonly poll_subscription: (a: number) => [number, number, number, number];
|
|
369
418
|
readonly register_js_tool: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|