@agentshouse/app-bridge 0.1.0-cafd492af28a7 → 0.1.0-cb198cb4a971a
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/index.d.ts +144 -49
- package/dist/mdmodel/document.d.ts +3 -2
- package/dist/mdmodel/index.d.ts +4 -5
- package/dist/mdmodel/kinds.d.ts +1 -2
- package/dist/mdmodel/markdown.d.ts +50 -0
- package/dist/mdmodel/reserved.d.ts +1 -0
- package/dist/mdruntime/adapter.d.ts +5 -34
- package/dist/mdruntime/client.d.ts +3 -1
- package/dist/mdruntime/conversation-live.d.ts +3 -4
- package/dist/mdruntime/conversation.d.ts +4 -6
- package/dist/mdruntime/failure.d.ts +1 -0
- package/dist/mdruntime/media.d.ts +1 -1
- package/dist/mdruntime/messages.d.ts +0 -3
- package/dist/mdruntime/query.d.ts +0 -1
- package/dist/mdruntime/readiness.d.ts +0 -1
- package/dist/mdruntime/replica.d.ts +1 -0
- package/dist/mdruntime/room-draft.d.ts +1 -3
- package/dist/mdruntime/save.d.ts +2 -0
- package/dist/mdruntime/socket/rooms.d.ts +2 -1
- package/dist/mdruntime/socket/session.d.ts +0 -1
- package/dist/mdruntime/socket.d.ts +1 -1
- package/dist/mdruntime/store/records.d.ts +1 -3
- package/dist/mdruntime/store/space.d.ts +1 -1
- package/dist/mdruntime/store.d.ts +1 -1
- package/dist/mdruntime/stored.d.ts +1 -1
- package/dist/mdruntime/tables.d.ts +0 -5
- package/dist/session-content/bounds.d.ts +7 -0
- package/dist/session-content/check.d.ts +18 -0
- package/dist/session-content/index.d.ts +7 -0
- package/dist/session-content/parts.d.ts +102 -0
- package/dist/session-content/state.d.ts +61 -0
- package/dist/session-content/turn.d.ts +328 -0
- package/docs/families.md +1 -1
- package/package.json +1 -1
- package/dist/mdmodel/blocks.d.ts +0 -10
- package/dist/mdmodel/links.d.ts +0 -28
- package/dist/mdmodel/profile.d.ts +0 -5
- package/dist/mdruntime/job.d.ts +0 -32
package/dist/index.d.ts
CHANGED
|
@@ -208,7 +208,6 @@ export interface HouseMethods {
|
|
|
208
208
|
readonly conversation_id: string;
|
|
209
209
|
readonly jobs: readonly {
|
|
210
210
|
readonly name: string;
|
|
211
|
-
readonly running_since: string;
|
|
212
211
|
}[];
|
|
213
212
|
readonly log_epoch: string;
|
|
214
213
|
readonly position: string;
|
|
@@ -232,47 +231,150 @@ export interface HouseMethods {
|
|
|
232
231
|
readonly conversation_id: string;
|
|
233
232
|
readonly messages: readonly {
|
|
234
233
|
readonly accepted_at: string;
|
|
235
|
-
readonly
|
|
236
|
-
readonly
|
|
237
|
-
|
|
234
|
+
readonly content: null | {
|
|
235
|
+
readonly parts: readonly ({
|
|
236
|
+
readonly calls: null | number;
|
|
237
|
+
readonly duration: null | number;
|
|
238
|
+
readonly kind: "agent" | "fork" | "workflow";
|
|
239
|
+
readonly name: null | string;
|
|
240
|
+
readonly parent: null | number;
|
|
241
|
+
readonly report: null | string;
|
|
242
|
+
readonly status: "done" | "failed" | "running" | "stopped";
|
|
243
|
+
readonly step: null | string;
|
|
244
|
+
readonly task: string;
|
|
245
|
+
readonly tokens: null | number;
|
|
246
|
+
readonly type: "subagent";
|
|
247
|
+
} | {
|
|
248
|
+
readonly command: string;
|
|
249
|
+
readonly parent: null | number;
|
|
250
|
+
readonly target: null | string;
|
|
251
|
+
readonly type: "message";
|
|
252
|
+
} | {
|
|
253
|
+
readonly duration: null | number;
|
|
254
|
+
readonly exit: null | number;
|
|
255
|
+
readonly kind: "command";
|
|
256
|
+
readonly line: string;
|
|
257
|
+
readonly output: string;
|
|
258
|
+
readonly parent: null | number;
|
|
259
|
+
readonly status: "done" | "failed" | "running" | "stopped";
|
|
260
|
+
readonly type: "call";
|
|
261
|
+
} | {
|
|
262
|
+
readonly duration: null | number;
|
|
263
|
+
readonly files: readonly {
|
|
264
|
+
readonly added: number;
|
|
265
|
+
readonly diff: null | string;
|
|
266
|
+
readonly path: string;
|
|
267
|
+
readonly removed: number;
|
|
268
|
+
}[];
|
|
269
|
+
readonly kind: "edit";
|
|
270
|
+
readonly line: string;
|
|
271
|
+
readonly parent: null | number;
|
|
272
|
+
readonly status: "done" | "failed" | "running" | "stopped";
|
|
273
|
+
readonly type: "call";
|
|
274
|
+
} | {
|
|
275
|
+
readonly duration: null | number;
|
|
276
|
+
readonly kind: "fetch" | "other" | "tool";
|
|
277
|
+
readonly line: string;
|
|
278
|
+
readonly output: string;
|
|
279
|
+
readonly parent: null | number;
|
|
280
|
+
readonly status: "done" | "failed" | "running" | "stopped";
|
|
281
|
+
readonly type: "call";
|
|
282
|
+
} | {
|
|
283
|
+
readonly duration: null | number;
|
|
284
|
+
readonly kind: "read" | "search";
|
|
285
|
+
readonly line: string;
|
|
286
|
+
readonly parent: null | number;
|
|
287
|
+
readonly returned: null | number;
|
|
288
|
+
readonly status: "done" | "failed" | "running" | "stopped";
|
|
289
|
+
readonly type: "call";
|
|
290
|
+
} | {
|
|
291
|
+
readonly entries: readonly {
|
|
292
|
+
readonly content: string;
|
|
293
|
+
readonly status: "done" | "pending" | "running";
|
|
294
|
+
}[];
|
|
295
|
+
readonly parent: null | number;
|
|
296
|
+
readonly type: "plan";
|
|
297
|
+
} | {
|
|
298
|
+
readonly file: string;
|
|
299
|
+
readonly media_type: string;
|
|
300
|
+
readonly name: string;
|
|
301
|
+
readonly parent: null | number;
|
|
302
|
+
readonly type: "image";
|
|
303
|
+
} | {
|
|
304
|
+
readonly kind: "compaction" | "error" | "info" | "mode" | "model" | "retry" | "warning";
|
|
305
|
+
readonly parent: null | number;
|
|
306
|
+
readonly text: string;
|
|
307
|
+
readonly type: "notice";
|
|
308
|
+
} | {
|
|
309
|
+
readonly kind: "monitor" | "schedule" | "shell" | "task";
|
|
310
|
+
readonly label: string;
|
|
311
|
+
readonly parent: null | number;
|
|
312
|
+
readonly status: "done" | "failed" | "running" | "stopped";
|
|
313
|
+
readonly type: "background";
|
|
314
|
+
} | {
|
|
315
|
+
readonly parent: null | number;
|
|
316
|
+
readonly text: string;
|
|
317
|
+
readonly type: "reasoning" | "text";
|
|
318
|
+
})[];
|
|
319
|
+
readonly state: {
|
|
320
|
+
readonly branch: null | string;
|
|
321
|
+
readonly context: null | {
|
|
322
|
+
readonly breakdown: readonly {
|
|
323
|
+
readonly name: string;
|
|
324
|
+
readonly tokens: number;
|
|
325
|
+
}[];
|
|
326
|
+
readonly used: number;
|
|
327
|
+
readonly window: number;
|
|
328
|
+
};
|
|
329
|
+
readonly cost: null | {
|
|
330
|
+
readonly amount: number;
|
|
331
|
+
readonly currency: string;
|
|
332
|
+
};
|
|
333
|
+
readonly duration: null | number;
|
|
334
|
+
readonly effort: null | string;
|
|
335
|
+
readonly files: readonly {
|
|
336
|
+
readonly added: number;
|
|
337
|
+
readonly path: string;
|
|
338
|
+
readonly removed: number;
|
|
339
|
+
}[];
|
|
340
|
+
readonly limits: readonly {
|
|
341
|
+
readonly minutes: number;
|
|
342
|
+
readonly name: null | string;
|
|
343
|
+
readonly percent: number;
|
|
344
|
+
readonly resets: null | string;
|
|
345
|
+
}[];
|
|
346
|
+
readonly mode: null | string;
|
|
347
|
+
readonly model: null | string;
|
|
348
|
+
readonly pull: null | {
|
|
349
|
+
readonly number: number;
|
|
350
|
+
readonly url: string;
|
|
351
|
+
};
|
|
352
|
+
readonly running: readonly {
|
|
353
|
+
readonly kind: "monitor" | "schedule" | "shell" | "subagent" | "task";
|
|
354
|
+
readonly label: string;
|
|
355
|
+
readonly next: null | string;
|
|
356
|
+
readonly progress: null | string;
|
|
357
|
+
}[];
|
|
358
|
+
readonly suggestion: null | string;
|
|
359
|
+
readonly title: null | string;
|
|
360
|
+
readonly tokens: null | {
|
|
361
|
+
readonly cache_read: number;
|
|
362
|
+
readonly cache_write: number;
|
|
363
|
+
readonly input: number;
|
|
364
|
+
readonly output: number;
|
|
365
|
+
};
|
|
366
|
+
readonly worktree: null | string;
|
|
367
|
+
};
|
|
368
|
+
readonly tokens: null | {
|
|
369
|
+
readonly cache_read: number;
|
|
370
|
+
readonly cache_write: number;
|
|
371
|
+
readonly input: number;
|
|
372
|
+
readonly output: number;
|
|
373
|
+
};
|
|
238
374
|
};
|
|
239
375
|
readonly conversation_id: string;
|
|
240
376
|
readonly failure: null | string;
|
|
241
377
|
readonly message_id: string;
|
|
242
|
-
readonly parts: readonly ({
|
|
243
|
-
readonly command: string;
|
|
244
|
-
readonly target: null | string;
|
|
245
|
-
readonly type: "message";
|
|
246
|
-
} | {
|
|
247
|
-
readonly count: number;
|
|
248
|
-
readonly type: "commands";
|
|
249
|
-
} | {
|
|
250
|
-
readonly description: string;
|
|
251
|
-
readonly result: null | string;
|
|
252
|
-
readonly status: "done" | "running";
|
|
253
|
-
readonly type: "subagent";
|
|
254
|
-
} | {
|
|
255
|
-
readonly entries: readonly {
|
|
256
|
-
readonly content: string;
|
|
257
|
-
readonly status: string;
|
|
258
|
-
}[];
|
|
259
|
-
readonly type: "plan";
|
|
260
|
-
} | {
|
|
261
|
-
readonly file: string;
|
|
262
|
-
readonly media_type: string;
|
|
263
|
-
readonly name: string;
|
|
264
|
-
readonly type: "image";
|
|
265
|
-
} | {
|
|
266
|
-
readonly marker: "compaction" | "job" | "mode" | "model" | "retry";
|
|
267
|
-
readonly text: string;
|
|
268
|
-
readonly type: "marker";
|
|
269
|
-
} | {
|
|
270
|
-
readonly text: string;
|
|
271
|
-
readonly type: "reasoning";
|
|
272
|
-
} | {
|
|
273
|
-
readonly text: string;
|
|
274
|
-
readonly type: "text";
|
|
275
|
-
})[];
|
|
276
378
|
readonly role: "assistant" | "house" | "user";
|
|
277
379
|
readonly sender?: "conversation" | "customer" | "owner" | "replier" | "report" | "requester" | "trigger";
|
|
278
380
|
readonly source?: {
|
|
@@ -356,12 +458,6 @@ export interface HouseMethods {
|
|
|
356
458
|
};
|
|
357
459
|
readonly telegram_undelivered?: true;
|
|
358
460
|
readonly text: string;
|
|
359
|
-
readonly tokens?: {
|
|
360
|
-
readonly cache_read: number;
|
|
361
|
-
readonly cache_write: number;
|
|
362
|
-
readonly input: number;
|
|
363
|
-
readonly output: number;
|
|
364
|
-
};
|
|
365
461
|
readonly transcripts?: readonly {
|
|
366
462
|
readonly path: string;
|
|
367
463
|
readonly text: string;
|
|
@@ -834,14 +930,14 @@ export interface HouseMethods {
|
|
|
834
930
|
readonly limit: "custom_domains" | "external_calls" | "publish_data" | "sites";
|
|
835
931
|
readonly outcome: "refused";
|
|
836
932
|
readonly position: number;
|
|
837
|
-
} | {
|
|
838
|
-
readonly code: "agent_function_not_found" | "agent_function_retired" | "app_function_not_found" | "app_not_found" | "environment_function_not_found" | "environment_offline" | "no_recipient" | "target_agent_unavailable";
|
|
839
|
-
readonly outcome: "no_target";
|
|
840
|
-
readonly position: number;
|
|
841
933
|
} | {
|
|
842
934
|
readonly code: "agent_function_request_not_started" | "internal_error";
|
|
843
935
|
readonly outcome: "failed";
|
|
844
936
|
readonly position: number;
|
|
937
|
+
} | {
|
|
938
|
+
readonly code: "agent_function_retired" | "environment_offline" | "no_recipient" | "not_found" | "target_agent_unavailable";
|
|
939
|
+
readonly outcome: "no_target";
|
|
940
|
+
readonly position: number;
|
|
845
941
|
} | {
|
|
846
942
|
readonly code: string;
|
|
847
943
|
readonly outcome: "refused";
|
|
@@ -937,7 +1033,6 @@ export interface HouseStatus {
|
|
|
937
1033
|
readonly sync: HouseSyncState | null;
|
|
938
1034
|
readonly refusal: {
|
|
939
1035
|
readonly code: string;
|
|
940
|
-
readonly retryable: boolean;
|
|
941
1036
|
} | null;
|
|
942
1037
|
readonly loss: string | null;
|
|
943
1038
|
readonly database: Open<HouseDatabaseFailure> | null;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type Definition } from './definition.js';
|
|
2
|
-
import { type
|
|
2
|
+
import { type HrefOccurrence, type Reading } from './markdown.js';
|
|
3
3
|
import type { ApplyResult, BodyResult, FrontmatterResult, Change, Document, Link, ParseResult, UnlinkedBody } from './types.js';
|
|
4
4
|
import { type YamlMap } from './yaml.js';
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function readingOf(document: Document): Reading;
|
|
6
|
+
export declare function linkDestinations(document: Document): readonly HrefOccurrence[];
|
|
6
7
|
export declare function parseFrontmatter(content: string, file?: string): FrontmatterResult;
|
|
7
8
|
export declare function parse(content: string, file?: string): ParseResult;
|
|
8
9
|
export declare function relativize(document: Document, file: string, handle: string, definition?: Definition, kept?: ReadonlySet<string>): ApplyResult;
|
package/dist/mdmodel/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { candidateOf, datePointers, facts, memberPointers, members, pointed, prosePaths, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './event.js';
|
|
2
2
|
export type { Actor, DocumentEvent, DocumentFacts, Fact, ItemFacts, MessageFacts, Resolved, WriteDoor, } from './event.js';
|
|
3
|
-
export { byCodePoint, compared, dated, fitsKind, instant, instantKey,
|
|
3
|
+
export { byCodePoint, compared, dated, fitsKind, instant, instantKey, kindOf, kindWords, } from './kinds.js';
|
|
4
4
|
export type { Kind, Ordering } from './kinds.js';
|
|
5
5
|
export { bodied, cursorOf, decodedCursor, identityOf, invalid, known, placeText, planOf, QueryError, queryKey, } from './query/language.js';
|
|
6
6
|
export type { Clause, Continuation, Direction, DocumentQuery, DocumentShape, Filter, GroupKey, GroupOrder, GroupQuery, GroupSelect, GroupShape, HeldRooms, Key, KeyPlan, LocalQuery, OrderOptions, Place, Predicate, QueryErrorCode, QueryPlan, Related, RoomFacts, Scope, Select, Test, Value, Where, } from './query/language.js';
|
|
@@ -9,8 +9,8 @@ export type { Candidate } from './query/match.js';
|
|
|
9
9
|
export { heldKind, indexed } from './query/rows.js';
|
|
10
10
|
export type { HeldKind, HeldLink, HeldValue, Indexed, Reach } from './query/rows.js';
|
|
11
11
|
export * as sql from './query/sql.js';
|
|
12
|
-
export { headingLines } from './
|
|
13
|
-
export type { HeadingLine } from './
|
|
12
|
+
export { headingLines } from './markdown.js';
|
|
13
|
+
export type { HeadingLine } from './markdown.js';
|
|
14
14
|
export { divide } from './divide.js';
|
|
15
15
|
export { apply, bodyLinks, links, parse, parseFrontmatter, relativize, relativizeBody, relinkBody, serialize, unlinkBody, } from './document.js';
|
|
16
16
|
export { documentFacts, referenceTarget, referenceTargets } from './facts.js';
|
|
@@ -19,10 +19,9 @@ export { HOUSE_FIELDS, MEMBER_FIELD, RECEIVED_FIELD, SITE_FIELD, TYPE_FIELD } fr
|
|
|
19
19
|
export { relative, retarget, roomPath, roomTarget, target } from './paths.js';
|
|
20
20
|
export { openPatternBudget } from './pattern.js';
|
|
21
21
|
export type { RoomTarget } from './paths.js';
|
|
22
|
-
export { MARKDOWN_SYNTAX_PROFILE } from './profile.js';
|
|
23
22
|
export { project } from './project.js';
|
|
24
23
|
export { references } from './references.js';
|
|
25
|
-
export { isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION } from './reserved.js';
|
|
24
|
+
export { CAPTURE_HOME, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION, } from './reserved.js';
|
|
26
25
|
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, } from './definition.js';
|
|
27
26
|
export type { Definition, FieldRules, JsonType, PatternFacts, PointerFacts, RuleValue, SectionSpec, Shape, Transition, ValueFacts, } from './definition.js';
|
|
28
27
|
export type { ApplyResult, BodyResult, Change, Division, DivisionContext, Document, DocumentCheck, Frontmatter, FrontmatterResult, Library, ModelVerification, Link, ParseResult, Projection, ProjectionContext, Reached, Reference, Refusal, RoomReference, Span, TypedPath, UnlinkedBody, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
|
package/dist/mdmodel/kinds.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ValueFacts } from './definition.js';
|
|
2
|
-
export
|
|
3
|
-
export type Kind = (typeof KINDS)[number];
|
|
2
|
+
export type Kind = 'string' | 'number' | 'integer' | 'boolean' | 'date' | 'date-time' | 'time' | 'enum' | 'reference';
|
|
4
3
|
export type Ordering = {
|
|
5
4
|
readonly direction: 'asc' | 'desc';
|
|
6
5
|
readonly nulls: 'first' | 'last';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Extent } from './types.js';
|
|
2
|
+
export type HeadingLine = {
|
|
3
|
+
readonly level: number;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly start: number;
|
|
6
|
+
readonly textEnd: number;
|
|
7
|
+
readonly next: number;
|
|
8
|
+
};
|
|
9
|
+
export type HrefOccurrence = {
|
|
10
|
+
readonly href: string;
|
|
11
|
+
readonly start: number;
|
|
12
|
+
readonly end: number;
|
|
13
|
+
readonly bracketed: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type LinkUse = {
|
|
16
|
+
readonly start: number;
|
|
17
|
+
readonly end: number;
|
|
18
|
+
readonly labelStart: number;
|
|
19
|
+
readonly labelEnd: number;
|
|
20
|
+
readonly destination: HrefOccurrence;
|
|
21
|
+
};
|
|
22
|
+
export type DefinitionBlock = {
|
|
23
|
+
readonly start: number;
|
|
24
|
+
readonly end: number;
|
|
25
|
+
readonly destination: HrefOccurrence;
|
|
26
|
+
};
|
|
27
|
+
export type Block = Extent & {
|
|
28
|
+
readonly items: readonly Extent[] | null;
|
|
29
|
+
};
|
|
30
|
+
export type Reading = {
|
|
31
|
+
readonly headings: readonly HeadingLine[];
|
|
32
|
+
readonly blocks: readonly Block[];
|
|
33
|
+
readonly uses: readonly LinkUse[];
|
|
34
|
+
readonly definitions: readonly DefinitionBlock[];
|
|
35
|
+
};
|
|
36
|
+
export declare function read(text: string, at?: number): Reading;
|
|
37
|
+
export declare function destinations(reading: Reading): readonly HrefOccurrence[];
|
|
38
|
+
export declare function hrefOccurrences(body: string): readonly HrefOccurrence[];
|
|
39
|
+
export declare function headingLines(content: string, from: number, to: number): HeadingLine[];
|
|
40
|
+
export type SectionSpan = {
|
|
41
|
+
readonly name: string;
|
|
42
|
+
readonly headingStart: number;
|
|
43
|
+
readonly bodyStart: number;
|
|
44
|
+
readonly bodyEnd: number;
|
|
45
|
+
};
|
|
46
|
+
export declare function sectionSpans(reading: Reading, end: number): SectionSpan[];
|
|
47
|
+
export declare function sectionsRecord(spans: readonly SectionSpan[], content: string): Record<string, string>;
|
|
48
|
+
export declare function headingsIn(reading: Reading, from: number, to: number): readonly HeadingLine[];
|
|
49
|
+
export declare function listItems(reading: Reading, from: number, to: number): Extent[] | null;
|
|
50
|
+
export declare function blockRanges(reading: Reading, from: number, to: number): Extent[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const ROOM_DESCRIPTION = "ROOM.md";
|
|
2
|
+
export declare const CAPTURE_HOME = "capture";
|
|
2
3
|
export declare const RESERVED_NAMES: readonly string[];
|
|
3
4
|
export declare function isReservedName(name: string): boolean;
|
|
4
5
|
export declare function isDocumentPath(path: string): boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SavedFacts, TypedPath } from '../mdmodel/index.js';
|
|
2
|
+
import type { Operation, SessionState } from '../session-content/index.js';
|
|
2
3
|
import type { ModelResult } from './model.js';
|
|
3
4
|
export type { SavedFacts, TypedPath };
|
|
4
5
|
import type { Open } from './open.js';
|
|
@@ -29,6 +30,7 @@ export type DiscoveredRoom = {
|
|
|
29
30
|
replica: ReplicaAdmission;
|
|
30
31
|
typedSelection?: TypedSelection;
|
|
31
32
|
providerOwnedPaths: readonly string[];
|
|
33
|
+
authoredPaths?: readonly string[];
|
|
32
34
|
};
|
|
33
35
|
export type Capability = {
|
|
34
36
|
name: string;
|
|
@@ -72,37 +74,10 @@ export type ConversationHistoryPage = {
|
|
|
72
74
|
export type ConversationHistories = {
|
|
73
75
|
histories: readonly ConversationHistoryPage[];
|
|
74
76
|
};
|
|
75
|
-
export type TurnContext = {
|
|
76
|
-
used: number;
|
|
77
|
-
window: number;
|
|
78
|
-
};
|
|
79
77
|
export type TurnOperation = {
|
|
80
78
|
op: 'begin';
|
|
81
79
|
at: string;
|
|
82
|
-
} |
|
|
83
|
-
op: 'start';
|
|
84
|
-
index: number;
|
|
85
|
-
part: unknown;
|
|
86
|
-
} | {
|
|
87
|
-
op: 'append';
|
|
88
|
-
index: number;
|
|
89
|
-
text: string;
|
|
90
|
-
} | {
|
|
91
|
-
op: 'status';
|
|
92
|
-
index: number;
|
|
93
|
-
status: string;
|
|
94
|
-
result: unknown;
|
|
95
|
-
} | {
|
|
96
|
-
op: 'count';
|
|
97
|
-
index: number;
|
|
98
|
-
count: number;
|
|
99
|
-
} | {
|
|
100
|
-
op: 'plan';
|
|
101
|
-
index: number;
|
|
102
|
-
entries: readonly unknown[];
|
|
103
|
-
} | ({
|
|
104
|
-
op: 'context';
|
|
105
|
-
} & TurnContext);
|
|
80
|
+
} | Operation;
|
|
106
81
|
export type ProcessCommand = {
|
|
107
82
|
[field: string]: unknown;
|
|
108
83
|
name: string;
|
|
@@ -139,10 +114,6 @@ export type SessionOption = (SessionOptionNaming & {
|
|
|
139
114
|
type: 'boolean';
|
|
140
115
|
currentValue: boolean;
|
|
141
116
|
});
|
|
142
|
-
export type RunningSubagent = {
|
|
143
|
-
description: string;
|
|
144
|
-
activity: string | null;
|
|
145
|
-
};
|
|
146
117
|
export type ConversationEvent = {
|
|
147
118
|
kind: 'turn';
|
|
148
119
|
conversation: string;
|
|
@@ -169,9 +140,9 @@ export type ConversationEvent = {
|
|
|
169
140
|
conversation: string;
|
|
170
141
|
step: string | null;
|
|
171
142
|
} | {
|
|
172
|
-
kind: '
|
|
143
|
+
kind: 'state';
|
|
173
144
|
conversation: string;
|
|
174
|
-
|
|
145
|
+
state: SessionState | null;
|
|
175
146
|
} | {
|
|
176
147
|
kind: 'link';
|
|
177
148
|
conversation: string;
|
|
@@ -18,7 +18,9 @@ import type { Readiness } from './readiness.js';
|
|
|
18
18
|
import type { ObservedRead } from './reads.js';
|
|
19
19
|
import type { SyncStatus } from './status.js';
|
|
20
20
|
import { type RuntimePort } from './wire.js';
|
|
21
|
+
export type BuildFile = (name: string) => Promise<Blob | null>;
|
|
21
22
|
export type MdRuntimeClient = {
|
|
23
|
+
buildFile(name: string): Promise<Blob | null>;
|
|
22
24
|
rooms(): Promise<readonly AppRoom[]>;
|
|
23
25
|
query: {
|
|
24
26
|
(query: DocumentQuery): Promise<DocumentResult | PendingResult>;
|
|
@@ -95,7 +97,7 @@ export type MdRuntimeClient = {
|
|
|
95
97
|
reauthorize(): Promise<void>;
|
|
96
98
|
settled(): Promise<void>;
|
|
97
99
|
};
|
|
98
|
-
export declare function connectMdRuntime(port: RuntimePort): MdRuntimeClient;
|
|
100
|
+
export declare function connectMdRuntime(port: RuntimePort, buildFile?: BuildFile): MdRuntimeClient;
|
|
99
101
|
export declare function inTurn(client: MdRuntimeClient, work: () => Promise<void>): Promise<void>;
|
|
100
102
|
export { chainedWindows, type WindowAnswer, type WindowChain } from './chain.js';
|
|
101
103
|
export { roomDraftRevision } from './identity.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SessionState } from '../session-content/index.js';
|
|
2
|
+
import type { AcceptedMessage, ConversationAction, ConversationHistoryRequest, ConversationStream, ListedAgent, ListedConversation, ProcessCommand, SessionOption } from './adapter.js';
|
|
2
3
|
import { type Cell } from './cell.js';
|
|
3
4
|
import type { ChangeSet } from './change-set.js';
|
|
4
5
|
import type { Asked, ConversationAgent, ConversationEntry, ConversationView, RunningTurn } from './conversation.js';
|
|
5
|
-
import type { JobMarker } from './job.js';
|
|
6
6
|
import type { CallResult } from './outcome.js';
|
|
7
7
|
import type { Recovery } from './recovery.js';
|
|
8
8
|
import type { ChatDraftRecord, RuntimeStore } from './store.js';
|
|
@@ -30,7 +30,7 @@ export type Live = {
|
|
|
30
30
|
commands: readonly ProcessCommand[];
|
|
31
31
|
options: readonly SessionOption[];
|
|
32
32
|
starting: string | null;
|
|
33
|
-
|
|
33
|
+
state: SessionState | null;
|
|
34
34
|
link: {
|
|
35
35
|
connected: boolean;
|
|
36
36
|
} | null;
|
|
@@ -46,7 +46,6 @@ type HeldWindow = {
|
|
|
46
46
|
readonly window: readonly AcceptedMessage[] | null;
|
|
47
47
|
readonly draft: ChatDraftRecord | null;
|
|
48
48
|
readonly ended: string | null;
|
|
49
|
-
readonly marked: readonly JobMarker[];
|
|
50
49
|
readonly more: boolean;
|
|
51
50
|
readonly total: number | null;
|
|
52
51
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Part, type SessionState } from '../session-content/index.js';
|
|
2
|
+
import type { ConversationEvent, ConversationMessage, ProcessCommand, SessionOption } from './adapter.js';
|
|
2
3
|
import { type ChangeSet } from './change-set.js';
|
|
3
4
|
import { type LiveConversations } from './conversation-live.js';
|
|
4
5
|
import { type ConversationHeld } from './conversation-row.js';
|
|
5
|
-
import type { OpenJob } from './job.js';
|
|
6
6
|
import type { Open } from './open.js';
|
|
7
7
|
import { type CallResult, type Offline } from './outcome.js';
|
|
8
8
|
import type { CycleProgress } from './status.js';
|
|
@@ -33,8 +33,7 @@ export type ConversationAgent = {
|
|
|
33
33
|
export type RunningTurn = {
|
|
34
34
|
turn: string;
|
|
35
35
|
started: string | null;
|
|
36
|
-
parts: readonly
|
|
37
|
-
context: TurnContext | null;
|
|
36
|
+
parts: readonly Part[];
|
|
38
37
|
};
|
|
39
38
|
export type ChatDraft = {
|
|
40
39
|
text: string;
|
|
@@ -61,7 +60,7 @@ export type ConversationView = {
|
|
|
61
60
|
commands: readonly ProcessCommand[];
|
|
62
61
|
options: readonly SessionOption[];
|
|
63
62
|
starting: string | null;
|
|
64
|
-
|
|
63
|
+
state: SessionState | null;
|
|
65
64
|
link: {
|
|
66
65
|
connected: boolean;
|
|
67
66
|
} | null;
|
|
@@ -69,7 +68,6 @@ export type ConversationView = {
|
|
|
69
68
|
chatDraft: (ChatDraft & {
|
|
70
69
|
readonly revision: string;
|
|
71
70
|
}) | null;
|
|
72
|
-
jobs: readonly OpenJob[];
|
|
73
71
|
};
|
|
74
72
|
export type ConversationSurface = {
|
|
75
73
|
list(): Promise<readonly ConversationEntry[]>;
|
|
@@ -9,4 +9,5 @@ export type Described = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare function runtimeError(code: string, message?: string, retryable?: boolean): RuntimeError;
|
|
11
11
|
export declare function failed(error: unknown): RuntimeError;
|
|
12
|
+
export declare function uncaught(error: unknown): void;
|
|
12
13
|
export declare function described(error: unknown): Described;
|
|
@@ -3,5 +3,5 @@ import { type ShownAnswer } from './outcome.js';
|
|
|
3
3
|
export declare const ROOM_MEDIA = "room-media";
|
|
4
4
|
type Show = (room: string, path: string, revision?: string) => Promise<ShownAnswer>;
|
|
5
5
|
export declare function shownBy(show: Show, client: MdRuntimeClient): MdRuntimeClient;
|
|
6
|
-
export declare function defineRoomMedia(client: Promise<MdRuntimeClient> | MdRuntimeClient
|
|
6
|
+
export declare function defineRoomMedia(client: Promise<MdRuntimeClient> | MdRuntimeClient): void;
|
|
7
7
|
export {};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { AcceptedMessage } from './adapter.js';
|
|
2
|
-
import type { JobMarker } from './job.js';
|
|
3
2
|
import type { Connection } from './tables.js';
|
|
4
3
|
export declare const MESSAGE_TABLES: readonly string[];
|
|
5
4
|
export declare const ROWS = "WITH chosen AS (\n SELECT listed.value AS conversation,\n (SELECT id FROM conversation_messages WHERE conversation = listed.value AND json_extract(message, '$.role') = 'assistant' ORDER BY position DESC, identity DESC LIMIT 1) AS answer,\n (SELECT id FROM conversation_messages WHERE conversation = listed.value AND text <> '' ORDER BY position DESC, identity DESC LIMIT 1) AS said,\n (SELECT id FROM conversation_messages WHERE conversation = listed.value AND json_extract(message, '$.role') = 'house' ORDER BY position, identity LIMIT 1) AS opened,\n (SELECT id FROM conversation_messages WHERE conversation = listed.value AND json_extract(message, '$.role') = 'house' AND json_extract(message, '$.waiting') = 1 ORDER BY position, identity LIMIT 1) AS asking\n FROM json_each(?) AS listed\n )\n SELECT chosen.conversation AS conversation,\n substr(said.text, 1, 512) AS said_text,\n json_extract(said.message, '$.role') AS said_role,\n json_extract(said.message, '$.accepted_at') AS said_at,\n substr(json_extract(answer.message, '$.failure'), 1, 512) AS failure,\n json_extract(opened.message, '$.source') AS opened_source,\n json_extract(opened.message, '$.sender') AS opened_sender,\n asking.identity AS asking_identity,\n asking.text AS asking_text,\n json_extract(asking.message, '$.accepted_at') AS asking_at,\n json_extract(asking.message, '$.source') AS asking_source,\n json_extract(asking.message, '$.sender') AS asking_sender\n FROM chosen\n LEFT JOIN conversation_messages said ON said.id = chosen.said\n LEFT JOIN conversation_messages answer ON answer.id = chosen.answer\n LEFT JOIN conversation_messages opened ON opened.id = chosen.opened\n LEFT JOIN conversation_messages asking ON asking.id = chosen.asking";
|
|
6
|
-
export declare const JOB_MARKERS = "SELECT json_extract(part.value, '$.text') AS said,\n json_extract(message, '$.accepted_at') AS at\n FROM conversation_messages, json_each(message, '$.parts') AS part\n WHERE conversation = ? AND instr(message, '\"marker\":\"job\"') > 0\n AND json_extract(part.value, '$.type') = 'marker'\n AND json_extract(part.value, '$.marker') = 'job'\n ORDER BY position, identity, part.key";
|
|
7
5
|
export type HeldConversation = {
|
|
8
6
|
readonly conversation: string;
|
|
9
7
|
readonly read: string | null | undefined;
|
|
@@ -45,7 +43,6 @@ export declare function keptMessages(connection: Connection, { conversation, mes
|
|
|
45
43
|
export declare function messageWindow(connection: Connection, conversation: string, limit: number, before: readonly [string, string] | null, phrase: string | null): MessageWindow;
|
|
46
44
|
export declare function messageCount(connection: Connection, conversation: string, phrase: string | null): number;
|
|
47
45
|
export declare function conversationRows(connection: Connection, conversations: readonly string[]): HeldRow[];
|
|
48
|
-
export declare function jobMarkers(connection: Connection, conversation: string): JobMarker[];
|
|
49
46
|
export declare function turnArrived(connection: Connection, conversation: string, turn: string): boolean;
|
|
50
47
|
export declare function droppedMessages(connection: Connection, conversations: readonly string[]): void;
|
|
51
48
|
export declare function forgottenMessages(connection: Connection): void;
|
|
@@ -24,7 +24,6 @@ export type InstallationAmount = {
|
|
|
24
24
|
};
|
|
25
25
|
export type Installation = {
|
|
26
26
|
readonly step: InstallationStep | null;
|
|
27
|
-
readonly rooms: InstallationAmount;
|
|
28
27
|
readonly bytes: InstallationAmount;
|
|
29
28
|
};
|
|
30
29
|
export type ReadinessStatus = Open<'preparing' | 'paused' | 'ready' | 'lost'>;
|
|
@@ -14,6 +14,7 @@ export type ReplicaRecord = {
|
|
|
14
14
|
readonly model: ModelState;
|
|
15
15
|
readonly typedSelection: TypedSelection | null;
|
|
16
16
|
readonly providerOwnedPaths: readonly string[];
|
|
17
|
+
readonly authoredPaths?: readonly string[];
|
|
17
18
|
readonly roomVersion: string;
|
|
18
19
|
readonly transfer: string;
|
|
19
20
|
readonly inventory: BootstrapInventory;
|
|
@@ -92,7 +92,7 @@ type ChangedUnderneath = {
|
|
|
92
92
|
export type ReturnReason = ProviderRefusal & {
|
|
93
93
|
readonly kind: Open<'conflicted' | 'rejected' | 'withdrawn'>;
|
|
94
94
|
};
|
|
95
|
-
export declare function returnedBy(
|
|
95
|
+
export declare function returnedBy(): ReturnReason;
|
|
96
96
|
export type RoomDraft = {
|
|
97
97
|
readonly room: string;
|
|
98
98
|
readonly path: string;
|
|
@@ -106,8 +106,6 @@ export type RoomDraftWrite = {
|
|
|
106
106
|
readonly roomDraft: RoomDraft | null;
|
|
107
107
|
} | {
|
|
108
108
|
readonly outcome: 'stale';
|
|
109
|
-
readonly code: string;
|
|
110
|
-
readonly retryable: boolean;
|
|
111
109
|
readonly current: RoomDraft | null;
|
|
112
110
|
};
|
|
113
111
|
export declare function staleWrite(current: RoomDraft | null): RoomDraftWrite;
|
package/dist/mdruntime/save.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type SaveInput = {
|
|
|
19
19
|
baseRoomVersion: string;
|
|
20
20
|
operations: import('./adapter.js').OperationScopes;
|
|
21
21
|
providerOwnedPaths: readonly string[];
|
|
22
|
+
authoredPaths?: readonly string[];
|
|
22
23
|
providerLimits: readonly ProviderLimit[];
|
|
23
24
|
pathRule: PathRule;
|
|
24
25
|
visible: VisibleLayer;
|
|
@@ -76,6 +77,7 @@ export type MoveSide = {
|
|
|
76
77
|
composition: Composition;
|
|
77
78
|
operations: OperationScopes;
|
|
78
79
|
providerOwnedPaths: readonly string[];
|
|
80
|
+
authoredPaths?: readonly string[];
|
|
79
81
|
visible: VisibleLayer;
|
|
80
82
|
folders: ReadonlySet<string>;
|
|
81
83
|
queued: ReadonlySet<string>;
|
|
@@ -7,7 +7,7 @@ export type Declared = {
|
|
|
7
7
|
readonly room: RoomDeclaration | null;
|
|
8
8
|
readonly available: boolean;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type RoomStanding = {
|
|
11
11
|
readonly unreadable: boolean;
|
|
12
12
|
readonly refusal: ProviderRefusal | null;
|
|
13
13
|
readonly unheldModel: ModelState | null;
|
|
@@ -40,3 +40,4 @@ export type Rooms = {
|
|
|
40
40
|
connectionLive(): void;
|
|
41
41
|
};
|
|
42
42
|
export declare function createRooms(): Rooms;
|
|
43
|
+
export {};
|
|
@@ -6,7 +6,6 @@ export type RefusalReason = 'missing-required-guarantee' | 'revoked-authorizatio
|
|
|
6
6
|
export type ConnectionRefusalCode = Open<RefusalReason>;
|
|
7
7
|
export type ConnectionRefusal = {
|
|
8
8
|
code: ConnectionRefusalCode;
|
|
9
|
-
retryable: boolean;
|
|
10
9
|
reauthorizationOffered: boolean;
|
|
11
10
|
refusal: ProviderRefusal | null;
|
|
12
11
|
};
|
|
@@ -8,7 +8,7 @@ import { type Lanes } from './socket/lanes.js';
|
|
|
8
8
|
import { type Rooms } from './socket/rooms.js';
|
|
9
9
|
import { type Session } from './socket/session.js';
|
|
10
10
|
export type { Live } from './socket/lanes.js';
|
|
11
|
-
export type {
|
|
11
|
+
export type { RoomDeclaration } from './socket/rooms.js';
|
|
12
12
|
export type { ConnectionRefusal, ConnectionRefusalCode, Moving, RefusalReason, } from './socket/session.js';
|
|
13
13
|
type SocketEvent = {
|
|
14
14
|
readonly kind: 'opened';
|