@agentshouse/mdruntime-adapter 0.1.0-c8d322eea4abd → 0.1.0-c8f2ffa9f2e89
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/actions.d.ts.map +1 -1
- package/dist/actions.js +7 -6
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +51 -36
- package/dist/authored-path.js +1 -1
- package/dist/chunks.d.ts +1 -1
- package/dist/chunks.d.ts.map +1 -1
- package/dist/chunks.js +37 -15
- package/dist/history.d.ts +1 -6
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +21 -28
- package/dist/house-model.d.ts +133 -4
- package/dist/house-model.d.ts.map +1 -1
- package/dist/house-model.js +157 -98
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/refusal.d.ts +2 -1
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +12 -6
- package/dist/room-types.d.ts.map +1 -1
- package/dist/room-types.js +62 -46
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +4 -4
- package/dist/session-content/index.d.ts +1 -1
- package/dist/session-content/parts.d.ts +4 -3
- package/dist/session-content/turn.d.ts +3 -3
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +12 -10
- package/dist/space-schema.d.ts +1 -1
- package/dist/space-schema.d.ts.map +1 -1
- package/dist/space-schema.js +2 -2
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +34 -11
- package/dist/transport.d.ts +3 -5
- package/dist/transport.d.ts.map +1 -1
- package/dist/uncertain.d.ts +5 -0
- package/dist/uncertain.d.ts.map +1 -0
- package/dist/uncertain.js +11 -0
- package/dist/upload.d.ts +3 -1
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +8 -6
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +17 -15
- package/package.json +2 -2
package/dist/refusal.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { refusedFor, UNANSWERED, unusable } from './uncertain.js';
|
|
1
2
|
export function doorRefusal(body) {
|
|
2
3
|
if (typeof body !== 'object' || body === null)
|
|
3
4
|
return null;
|
|
@@ -9,6 +10,12 @@ export function doorRefusal(body) {
|
|
|
9
10
|
const { code, retryable, ...fields } = error;
|
|
10
11
|
return { code, fields, retryable: retryable === true };
|
|
11
12
|
}
|
|
13
|
+
export function answeredFailure(status, body) {
|
|
14
|
+
const refusal = doorRefusal(body);
|
|
15
|
+
if (refusal !== null)
|
|
16
|
+
return refusedFor(refusal);
|
|
17
|
+
return status === 0 || (status >= 500 && body === null) ? UNANSWERED : unusable();
|
|
18
|
+
}
|
|
12
19
|
export function resetOf(refusal) {
|
|
13
20
|
const reset = refusal?.fields.retry_at;
|
|
14
21
|
return refusal?.retryable === true && typeof reset === 'string' ? reset : undefined;
|
|
@@ -18,19 +25,18 @@ export function scopedRefusal(locator, scope, refusal) {
|
|
|
18
25
|
}
|
|
19
26
|
function doorFailure(status, body) {
|
|
20
27
|
if (status === 0)
|
|
21
|
-
return
|
|
28
|
+
return UNANSWERED;
|
|
22
29
|
if (status === 401)
|
|
23
30
|
return { kind: 'revoked-authorization' };
|
|
24
31
|
const refusal = doorRefusal(body);
|
|
25
|
-
if (refusal?.retryable === true || refusal?.code === 'update_required')
|
|
26
|
-
return
|
|
27
|
-
}
|
|
32
|
+
if (refusal?.retryable === true || refusal?.code === 'update_required')
|
|
33
|
+
return refusedFor(refusal);
|
|
28
34
|
if (status === 404 || refusal?.code === 'room_not_found')
|
|
29
35
|
return { kind: 'room-not-readable' };
|
|
30
36
|
if (status < 400)
|
|
31
37
|
return null;
|
|
32
38
|
if (refusal === null)
|
|
33
|
-
return
|
|
39
|
+
return answeredFailure(status, body);
|
|
34
40
|
return { kind: 'refused', scope: status === 403 ? 'operation' : 'undisclosed', refusal };
|
|
35
41
|
}
|
|
36
42
|
export function classifyDoor(status, body, locator) {
|
|
@@ -52,5 +58,5 @@ export function discoveryFailure(status, body) {
|
|
|
52
58
|
if (failure.kind === 'refused') {
|
|
53
59
|
return { kind: 'contract-unavailable', ...failure.refusal };
|
|
54
60
|
}
|
|
55
|
-
return
|
|
61
|
+
return failure.kind === 'transport-uncertainty' ? failure : answeredFailure(status, body);
|
|
56
62
|
}
|
package/dist/room-types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"room-types.d.ts","sourceRoot":"","sources":["../src/room-types.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,YAC9B,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,WAAW,EACX,OAAO,EACP,QAAQ,CACA,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,yBAAyB,UAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"room-types.d.ts","sourceRoot":"","sources":["../src/room-types.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,YAC9B,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,WAAW,EACX,OAAO,EACP,QAAQ,CACA,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,yBAAyB,UAAiC,CAAC;AAkCxE,eAAO,MAAM,gBAAgB,QAiGjB,CAAC"}
|
package/dist/room-types.js
CHANGED
|
@@ -13,101 +13,117 @@ export const INBOX_CHANNEL_KINDS = [
|
|
|
13
13
|
export const HOUSE_NAMEABLE_ROOM_TYPES = [CHAT_TYPE, CHAT_MESSAGE_TYPE];
|
|
14
14
|
const WAYFINDING_MAP_TYPE = 'wayfinding-map';
|
|
15
15
|
const WAYFINDING_TICKET_TYPE = 'wayfinding-ticket';
|
|
16
|
-
const
|
|
17
|
-
'Destination',
|
|
18
|
-
'Notes',
|
|
19
|
-
'Decisions so far',
|
|
20
|
-
'Not yet specified',
|
|
21
|
-
'Out of scope',
|
|
16
|
+
const WAYFINDING_MAP_TEXTS = [
|
|
17
|
+
['destination', 'Destination'],
|
|
18
|
+
['notes', 'Notes'],
|
|
19
|
+
['decisions_so_far', 'Decisions so far'],
|
|
20
|
+
['not_yet_specified', 'Not yet specified'],
|
|
21
|
+
['out_of_scope', 'Out of scope'],
|
|
22
|
+
];
|
|
23
|
+
function markdown(title) {
|
|
24
|
+
return `{ type: string, contentMediaType: text/markdown, title: ${title} }`;
|
|
25
|
+
}
|
|
26
|
+
function identity(title) {
|
|
27
|
+
return `{ type: string, pattern: '^\\S+$', title: ${title} }`;
|
|
28
|
+
}
|
|
29
|
+
const AGENT = [
|
|
30
|
+
' agent: { type: string, format: uuid, title: Agent }',
|
|
31
|
+
' name: { type: string, title: Name }',
|
|
22
32
|
];
|
|
23
|
-
const IDENTITY = "{ type: string, pattern: '^\\S+$' }";
|
|
24
|
-
const AGENT = [' agent: { type: string, format: uuid }', ' name: { type: string }'];
|
|
25
33
|
const ASSIGNEE = [
|
|
26
34
|
' type: object',
|
|
27
35
|
' properties:',
|
|
28
|
-
' user: { type: string, format: uuid }',
|
|
36
|
+
' user: { type: string, format: uuid, title: User }',
|
|
29
37
|
...AGENT,
|
|
30
38
|
];
|
|
31
39
|
export const HOUSE_ROOM_TYPES = [
|
|
32
40
|
`${CHAT_TYPE}:`,
|
|
33
41
|
' properties:',
|
|
34
|
-
' inbox: { type: string, format: uuid }',
|
|
35
|
-
` channel: { enum: [${INBOX_CHANNEL_KINDS.join(', ')}] }`,
|
|
36
|
-
` chat: ${
|
|
42
|
+
' inbox: { type: string, format: uuid, title: Inbox }',
|
|
43
|
+
` channel: { enum: [${INBOX_CHANNEL_KINDS.join(', ')}], title: Channel }`,
|
|
44
|
+
` chat: ${identity('Chat')}`,
|
|
37
45
|
' customer:',
|
|
46
|
+
' title: Customer',
|
|
38
47
|
' type: object',
|
|
39
48
|
' properties:',
|
|
40
|
-
' name: { type: string }',
|
|
41
|
-
` username: ${
|
|
42
|
-
` phone: ${
|
|
49
|
+
' name: { type: string, title: Name }',
|
|
50
|
+
` username: ${identity('Username')}`,
|
|
51
|
+
` phone: ${identity('Phone')}`,
|
|
43
52
|
' assignee:',
|
|
53
|
+
' title: Assignee',
|
|
44
54
|
...ASSIGNEE,
|
|
45
55
|
' return_to:',
|
|
56
|
+
' title: Return to',
|
|
46
57
|
' type: object',
|
|
47
58
|
' properties:',
|
|
48
59
|
...AGENT,
|
|
49
60
|
' required: [chat, customer]',
|
|
50
61
|
`${CHAT_MESSAGE_TYPE}:`,
|
|
51
62
|
' properties:',
|
|
52
|
-
' direction: { enum: [in, out] }',
|
|
63
|
+
' direction: { enum: [in, out], title: Direction }',
|
|
53
64
|
' sender:',
|
|
65
|
+
' title: Sender',
|
|
54
66
|
...ASSIGNEE,
|
|
55
|
-
` username: ${
|
|
56
|
-
' sent_at: { type: string, format: date-time }',
|
|
57
|
-
` channel_message: ${
|
|
58
|
-
' labelled: { const: true }',
|
|
67
|
+
` username: ${identity('Username')}`,
|
|
68
|
+
' sent_at: { type: string, format: date-time, title: Sent at }',
|
|
69
|
+
` channel_message: ${identity('Channel message')}`,
|
|
70
|
+
' labelled: { const: true, title: Labelled }',
|
|
59
71
|
' reactions:',
|
|
72
|
+
' title: Reactions',
|
|
60
73
|
' type: array',
|
|
61
74
|
' items:',
|
|
62
75
|
' type: object',
|
|
63
76
|
' properties:',
|
|
64
|
-
' reaction: { type: string, minLength: 1 }',
|
|
77
|
+
' reaction: { type: string, minLength: 1, title: Reaction }',
|
|
65
78
|
' sender:',
|
|
79
|
+
' title: Sender',
|
|
66
80
|
' type: object',
|
|
67
81
|
' properties:',
|
|
68
|
-
` id: ${
|
|
69
|
-
' name: { type: string }',
|
|
70
|
-
` username: ${
|
|
71
|
-
' count: { type: integer, minimum: 1 }',
|
|
82
|
+
` id: ${identity('ID')}`,
|
|
83
|
+
' name: { type: string, title: Name }',
|
|
84
|
+
` username: ${identity('Username')}`,
|
|
85
|
+
' count: { type: integer, minimum: 1, title: Count }',
|
|
72
86
|
' required: [reaction]',
|
|
73
|
-
` post: ${
|
|
87
|
+
` post: ${identity('Post')}`,
|
|
74
88
|
' assignee:',
|
|
89
|
+
' title: Assignee',
|
|
75
90
|
...ASSIGNEE,
|
|
76
|
-
' sent_outside: { const: true }',
|
|
91
|
+
' sent_outside: { const: true, title: Sent outside }',
|
|
77
92
|
' template:',
|
|
93
|
+
' title: Template',
|
|
78
94
|
' type: object',
|
|
79
95
|
' properties:',
|
|
80
|
-
' name: { type: string, minLength: 1 }',
|
|
81
|
-
' language: { type: string, minLength: 1 }',
|
|
96
|
+
' name: { type: string, minLength: 1, title: Name }',
|
|
97
|
+
' language: { type: string, minLength: 1, title: Language }',
|
|
82
98
|
' required: [name, language]',
|
|
83
99
|
' values:',
|
|
100
|
+
' title: Values',
|
|
84
101
|
' type: object',
|
|
85
102
|
' additionalProperties: { type: string }',
|
|
86
|
-
' withheld: { const: true }',
|
|
103
|
+
' withheld: { const: true, title: Withheld }',
|
|
87
104
|
' required: [direction]',
|
|
88
105
|
' if: { properties: { direction: { const: in } } }',
|
|
89
106
|
' then: { required: [sent_at] }',
|
|
90
107
|
`${WAYFINDING_MAP_TYPE}:`,
|
|
91
108
|
' properties:',
|
|
92
|
-
'
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
...WAYFINDING_MAP_SECTIONS.map((name) => ` ${name}: { kind: text, required: true }`),
|
|
109
|
+
' name: { type: string, title: Name }',
|
|
110
|
+
...WAYFINDING_MAP_TEXTS.map(([key, title]) => ` ${key}: ${markdown(title)}`),
|
|
111
|
+
` required: [name, ${WAYFINDING_MAP_TEXTS.map(([key]) => key).join(', ')}]`,
|
|
96
112
|
`${WAYFINDING_TICKET_TYPE}:`,
|
|
97
113
|
' properties:',
|
|
98
|
-
'
|
|
99
|
-
' kind: { enum: [research, prototype, grilling, task] }',
|
|
100
|
-
' status: { enum: [open, in-progress, done, out-of-scope] }',
|
|
101
|
-
` map: { type: string, reference: ${WAYFINDING_MAP_TYPE} }`,
|
|
102
|
-
` blocked_by: { type: array, items: { type: string, reference: ${WAYFINDING_TICKET_TYPE} } }`,
|
|
114
|
+
' name: { type: string, title: Name }',
|
|
115
|
+
' kind: { enum: [research, prototype, grilling, task], title: Kind }',
|
|
116
|
+
' status: { enum: [open, in-progress, done, out-of-scope], title: Status }',
|
|
117
|
+
` map: { type: string, reference: ${WAYFINDING_MAP_TYPE}, title: Map }`,
|
|
118
|
+
` blocked_by: { type: array, items: { type: string, reference: ${WAYFINDING_TICKET_TYPE} }, title: Blocked by }`,
|
|
103
119
|
' assignee:',
|
|
120
|
+
' title: Assignee',
|
|
104
121
|
...ASSIGNEE,
|
|
105
|
-
' conversation: { type: string, format: uuid }',
|
|
106
|
-
` app: { type: string, pattern: '${APP_REFERENCE_PATTERN.source}' }`,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
'
|
|
110
|
-
' Answer: { kind: text }',
|
|
122
|
+
' conversation: { type: string, format: uuid, title: Conversation }',
|
|
123
|
+
` app: { type: string, pattern: '${APP_REFERENCE_PATTERN.source}', title: App }`,
|
|
124
|
+
` question: ${markdown('Question')}`,
|
|
125
|
+
` answer: ${markdown('Answer')}`,
|
|
126
|
+
' required: [name, kind, status, map, blocked_by]',
|
|
111
127
|
' allOf:',
|
|
112
128
|
' - if: { properties: { status: { enum: [in-progress, done, out-of-scope] } }, required: [status] }',
|
|
113
129
|
' then: { required: [assignee] }',
|
|
@@ -115,6 +131,6 @@ export const HOUSE_ROOM_TYPES = [
|
|
|
115
131
|
' - if: { properties: { assignee: { required: [agent] } }, required: [assignee] }',
|
|
116
132
|
' else: { properties: { conversation: false } }',
|
|
117
133
|
' - if: { properties: { status: { enum: [done, out-of-scope] } }, required: [status] }',
|
|
118
|
-
' then: {
|
|
134
|
+
' then: { required: [answer], properties: { answer: { minLength: 1, title: Answer } } }',
|
|
119
135
|
HOUSE_MODEL_TYPES,
|
|
120
136
|
].join('\n');
|
package/dist/search.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAa,MAAM,wBAAwB,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAa,MAAM,wBAAwB,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAoBrE,wBAAsB,WAAW,CAC/B,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,EACvC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,OAAO,EAAE,SAAS,GACjB,OAAO,CAAC,YAAY,CAAC,CAsBvB"}
|
package/dist/search.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { doorRefusal } from './refusal.js';
|
|
1
|
+
import { answeredFailure, doorRefusal } from './refusal.js';
|
|
2
2
|
import { houseDoorRoute } from './transport.js';
|
|
3
3
|
const ROOMS = '/rooms/';
|
|
4
|
-
const UNCERTAIN = { kind: 'transport-uncertainty' };
|
|
5
4
|
function hitOf(file, locators) {
|
|
6
5
|
if (typeof file !== 'object' || file === null)
|
|
7
6
|
return null;
|
|
@@ -37,8 +36,9 @@ export async function houseSearch(transport, tracked, request) {
|
|
|
37
36
|
if (refusal !== null)
|
|
38
37
|
return { kind: 'rejected', ...refusal };
|
|
39
38
|
const files = answer.body?.files;
|
|
40
|
-
if (answer.status !== 200 || !Array.isArray(files))
|
|
41
|
-
return
|
|
39
|
+
if (answer.status !== 200 || !Array.isArray(files)) {
|
|
40
|
+
return answeredFailure(answer.status, answer.body);
|
|
41
|
+
}
|
|
42
42
|
const locators = new Map(tracked.map((entry) => [entry.handle, entry.locator]));
|
|
43
43
|
return {
|
|
44
44
|
kind: 'found',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DIFF_CHARACTERS, FIRST_PART_CHARACTERS, firstPart, keptDiff, lastLines, OUTPUT_CHARACTERS, OUTPUT_LINES, } from './bounds.js';
|
|
2
2
|
export { isOwn, isPart } from './parts.js';
|
|
3
|
-
export type { Call, FileChange, Part, Status } from './parts.js';
|
|
3
|
+
export type { Call, FileChange, Part, PartOf, Status } from './parts.js';
|
|
4
4
|
export { isState, standingState } from './state.js';
|
|
5
5
|
export type { SessionState, Tokens } from './state.js';
|
|
6
6
|
export { applied, isOperation, isTurn } from './turn.js';
|
|
@@ -66,7 +66,7 @@ declare const PART: Check<import("./check.js").Shaped<{
|
|
|
66
66
|
}> | import("./check.js").Shaped<{
|
|
67
67
|
readonly type: Check<"message">;
|
|
68
68
|
readonly parent: Check<number | null>;
|
|
69
|
-
readonly command: Check<
|
|
69
|
+
readonly command: Check<"agent-functions/cancel" | "agent-functions/mail/send" | "agent-functions/send">;
|
|
70
70
|
readonly target: Check<string | null>;
|
|
71
71
|
}> | import("./check.js").Shaped<{
|
|
72
72
|
readonly type: Check<"image">;
|
|
@@ -94,9 +94,10 @@ declare const PART: Check<import("./check.js").Shaped<{
|
|
|
94
94
|
readonly status: Check<"done" | "failed" | "running" | "stopped">;
|
|
95
95
|
}>>;
|
|
96
96
|
export type Part = Checked<typeof PART>;
|
|
97
|
-
export type
|
|
98
|
-
readonly type:
|
|
97
|
+
export type PartOf<T extends Part['type']> = Extract<Part, {
|
|
98
|
+
readonly type: T;
|
|
99
99
|
}>;
|
|
100
|
+
export type Call = PartOf<'call'>;
|
|
100
101
|
export declare const isPart: Check<Part>;
|
|
101
102
|
export declare function isOwn(part: Part): boolean;
|
|
102
103
|
export {};
|
|
@@ -60,7 +60,7 @@ declare const OPERATION: Check<import("./check.js").Shaped<{
|
|
|
60
60
|
}> | import("./check.js").Shaped<{
|
|
61
61
|
readonly type: Check<"message">;
|
|
62
62
|
readonly parent: Check<number | null>;
|
|
63
|
-
readonly command: Check<
|
|
63
|
+
readonly command: Check<"agent-functions/cancel" | "agent-functions/mail/send" | "agent-functions/send">;
|
|
64
64
|
readonly target: Check<string | null>;
|
|
65
65
|
}> | import("./check.js").Shaped<{
|
|
66
66
|
readonly type: Check<"image">;
|
|
@@ -151,7 +151,7 @@ declare const OPERATION: Check<import("./check.js").Shaped<{
|
|
|
151
151
|
}> | import("./check.js").Shaped<{
|
|
152
152
|
readonly type: Check<"message">;
|
|
153
153
|
readonly parent: Check<number | null>;
|
|
154
|
-
readonly command: Check<
|
|
154
|
+
readonly command: Check<"agent-functions/cancel" | "agent-functions/mail/send" | "agent-functions/send">;
|
|
155
155
|
readonly target: Check<string | null>;
|
|
156
156
|
}> | import("./check.js").Shaped<{
|
|
157
157
|
readonly type: Check<"image">;
|
|
@@ -239,7 +239,7 @@ declare const TURN: Check<import("./check.js").Shaped<{
|
|
|
239
239
|
}> | import("./check.js").Shaped<{
|
|
240
240
|
readonly type: Check<"message">;
|
|
241
241
|
readonly parent: Check<number | null>;
|
|
242
|
-
readonly command: Check<
|
|
242
|
+
readonly command: Check<"agent-functions/cancel" | "agent-functions/mail/send" | "agent-functions/send">;
|
|
243
243
|
readonly target: Check<string | null>;
|
|
244
244
|
}> | import("./check.js").Shaped<{
|
|
245
245
|
readonly type: Check<"image">;
|
package/dist/site.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAQR,MAAM,wBAAwB,CAAC;AAgBhC,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAQR,MAAM,wBAAwB,CAAC;AAgBhC,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAwBxB,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,UAAQ,GAAG,OAAO,CAkK1F"}
|
package/dist/site.js
CHANGED
|
@@ -2,14 +2,14 @@ import { actionOutcome } from './actions.js';
|
|
|
2
2
|
import { chunkedHead, chunkPart, siteChunkList } from './chunks.js';
|
|
3
3
|
import { mapDiscovery, parseSiteDiscovery, siteCapabilities, siteTracked, } from './discovery.js';
|
|
4
4
|
import { spaceSchemas } from './space-schema.js';
|
|
5
|
-
import { discoveryFailure } from './refusal.js';
|
|
5
|
+
import { answeredFailure, discoveryFailure } from './refusal.js';
|
|
6
6
|
import { admittedPath } from './authored-path.js';
|
|
7
7
|
import { HOUSE_TYPED_PATHS } from './house-model.js';
|
|
8
8
|
import { HOUSE_NAMEABLE_ROOM_TYPES, HOUSE_ROOM_TYPES } from './room-types.js';
|
|
9
9
|
import { houseNotifications } from './stream.js';
|
|
10
10
|
import { houseSiteRoute, SITE_DOOR_SUBMIT, SITE_FILES, SITES_SUBMISSIONS_CREATE, } from './transport.js';
|
|
11
|
+
import { UNANSWERED, unusable } from './uncertain.js';
|
|
11
12
|
import { followsVersion, reachedVersion, roomVersion } from './version.js';
|
|
12
|
-
const UNCERTAIN = { kind: 'transport-uncertainty' };
|
|
13
13
|
function unfound() {
|
|
14
14
|
return { kind: 'rejected', code: 'not_found', fields: {}, retryable: false };
|
|
15
15
|
}
|
|
@@ -57,10 +57,10 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
57
57
|
const room = chunked.get(entry.locator);
|
|
58
58
|
const address = room?.chunks.get(id);
|
|
59
59
|
if (room === undefined || address === undefined)
|
|
60
|
-
return
|
|
60
|
+
return UNANSWERED;
|
|
61
61
|
const read = await transport.download(address.url);
|
|
62
62
|
if (read.status !== 200)
|
|
63
|
-
return
|
|
63
|
+
return answeredFailure(read.status, null);
|
|
64
64
|
return chunkPart(read.body, room, id, arriving);
|
|
65
65
|
}
|
|
66
66
|
async function discovered() {
|
|
@@ -70,7 +70,7 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
70
70
|
return failed;
|
|
71
71
|
const document = parseSiteDiscovery(answer.body);
|
|
72
72
|
if (document === null)
|
|
73
|
-
return
|
|
73
|
+
return unusable();
|
|
74
74
|
const entries = siteTracked(document);
|
|
75
75
|
tracked.clear();
|
|
76
76
|
for (const entry of entries)
|
|
@@ -103,7 +103,7 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
103
103
|
if (entry === undefined)
|
|
104
104
|
return { kind: 'room-not-readable', locator: request.locator };
|
|
105
105
|
if (request.pageToken !== undefined)
|
|
106
|
-
return
|
|
106
|
+
return UNANSWERED;
|
|
107
107
|
return request.fromRoomVersion === roomVersion(entry)
|
|
108
108
|
? { kind: 'still-current' }
|
|
109
109
|
: { kind: 'beyond-horizon' };
|
|
@@ -126,9 +126,11 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
126
126
|
const read = await transport.download(route);
|
|
127
127
|
if (read.status === 404)
|
|
128
128
|
return unfound();
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
if (read.status !== 200)
|
|
130
|
+
return answeredFailure(read.status, null);
|
|
131
|
+
if (read.body === null)
|
|
132
|
+
return unusable();
|
|
133
|
+
return { kind: 'binary', body: read.body, mediaType: read.mediaType };
|
|
132
134
|
},
|
|
133
135
|
async link(_authorization, request) {
|
|
134
136
|
const route = fileRoute(request);
|
|
@@ -156,7 +158,7 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
156
158
|
};
|
|
157
159
|
}
|
|
158
160
|
if (!transport.online())
|
|
159
|
-
return
|
|
161
|
+
return UNANSWERED;
|
|
160
162
|
return actionOutcome(await transport.door(SITE_DOOR_SUBMIT, request.input), SITES_SUBMISSIONS_CREATE, request.input);
|
|
161
163
|
},
|
|
162
164
|
roomStream: snapshot
|
package/dist/space-schema.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export type SpaceSchemas = {
|
|
|
2
2
|
held(space: string, revision: string): string | undefined;
|
|
3
3
|
keep(space: string, revision: string, text: string): void;
|
|
4
4
|
};
|
|
5
|
-
export declare function spaceSchemas(): SpaceSchemas;
|
|
5
|
+
export declare function spaceSchemas(most?: number): SpaceSchemas;
|
|
6
6
|
export declare function spaceIdentity(space: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space-schema.d.ts","sourceRoot":"","sources":["../src/space-schema.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1D,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3D,CAAC;AAEF,wBAAgB,YAAY,IAAI,YAAY,
|
|
1
|
+
{"version":3,"file":"space-schema.d.ts","sourceRoot":"","sources":["../src/space-schema.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1D,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3D,CAAC;AAEF,wBAAgB,YAAY,CAAC,IAAI,SAAa,GAAG,YAAY,CAY5D;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
package/dist/space-schema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const HELD_TEXTS = 16;
|
|
2
|
-
export function spaceSchemas() {
|
|
2
|
+
export function spaceSchemas(most = HELD_TEXTS) {
|
|
3
3
|
const texts = new Map();
|
|
4
4
|
const key = (space, revision) => `${space} ${revision}`;
|
|
5
5
|
return {
|
|
@@ -8,7 +8,7 @@ export function spaceSchemas() {
|
|
|
8
8
|
const named = key(space, revision);
|
|
9
9
|
texts.delete(named);
|
|
10
10
|
texts.set(named, text);
|
|
11
|
-
if (texts.size >
|
|
11
|
+
if (texts.size > most)
|
|
12
12
|
texts.delete(texts.keys().next().value);
|
|
13
13
|
},
|
|
14
14
|
};
|
package/dist/stream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,eAAe,EAEpB,KAAK,SAAS,EACd,KAAK,kBAAkB,EAEvB,KAAK,QAAQ,EAGb,KAAK,eAAe,EAEpB,KAAK,iBAAiB,EAEvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAYtD,OAAO,EAEL,KAAK,SAAS,EAEd,KAAK,SAAS,EAGd,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AAaxB,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC;AAE/E,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,gBAAgB,EAAE;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAC,CAAC;AAElG,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IACnE,OAAO,CAAC,KAAK,EAAE,0BAA0B,GAAG,eAAe,GAAG,IAAI,CAAC;IACnE,OAAO,CAAC,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC9D,IAAI,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAC;IACvC,KAAK,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,GAAG,IAAI,CAAC;IACtD,aAAa,EAAE,kBAAkB,CAAC;IAClC,WAAW,EAAE,iBAAiB,CAAC;CAChC,CAAC;AAyHF,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,SAAS,EACf,WAAW,EAAE,gBAAgB,EAC7B,MAAM,EAAE,YAAY,GACnB,kBAAkB,CA+XpB"}
|
package/dist/stream.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ROW_WEIGHT, stepped, } from '@agentshouse/mdruntime';
|
|
2
|
-
import { acceptedMessage,
|
|
1
|
+
import { ROW_WEIGHT, stepped, uncertainError, } from '@agentshouse/mdruntime';
|
|
2
|
+
import { acceptedMessage, changeCursor, houseHistory } from './history.js';
|
|
3
3
|
import { keptSpaceSchemas, streamedModels } from './model.js';
|
|
4
4
|
import { answered, answering, binaryFileOf, createdOf, folded, forgotten, headChange, revised, } from './read.js';
|
|
5
5
|
import { classifyDoor } from './refusal.js';
|
|
@@ -10,16 +10,34 @@ function turnOperation(frame) {
|
|
|
10
10
|
}
|
|
11
11
|
async function houseAgents(transport) {
|
|
12
12
|
const answer = await transport.door(houseDoorRoute('agents/list'), {});
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const failure = classifyDoor(answer.status, answer.body, 'agents/list');
|
|
14
|
+
if (failure?.kind === 'transport-uncertainty') {
|
|
15
|
+
throw uncertainError(failure);
|
|
15
16
|
}
|
|
16
17
|
const agents = answer.status === 200 ? answer.body?.agents : null;
|
|
17
18
|
if (!Array.isArray(agents))
|
|
18
19
|
return null;
|
|
19
20
|
return agents.flatMap((one) => {
|
|
20
|
-
const { id, name, retired_at: retired } = (one ?? {});
|
|
21
|
-
return typeof id === 'string' &&
|
|
22
|
-
|
|
21
|
+
const { id, name, cli, environment, environment_name: environmentName, environment_connected: connected, retired_at: retired, } = (one ?? {});
|
|
22
|
+
return typeof id === 'string' &&
|
|
23
|
+
typeof name === 'string' &&
|
|
24
|
+
typeof cli === 'string' &&
|
|
25
|
+
typeof environment === 'string' &&
|
|
26
|
+
typeof environmentName === 'string' &&
|
|
27
|
+
typeof connected === 'boolean'
|
|
28
|
+
? [
|
|
29
|
+
{
|
|
30
|
+
agent: id,
|
|
31
|
+
name,
|
|
32
|
+
retired: retired !== null && retired !== undefined,
|
|
33
|
+
cli,
|
|
34
|
+
environment: {
|
|
35
|
+
identity: environment,
|
|
36
|
+
name: environmentName,
|
|
37
|
+
state: connected ? 'online' : 'offline',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
]
|
|
23
41
|
: [];
|
|
24
42
|
});
|
|
25
43
|
}
|
|
@@ -34,7 +52,7 @@ function listedConversation(listed) {
|
|
|
34
52
|
finished: listed.finished_at,
|
|
35
53
|
outcome: listed.outcome,
|
|
36
54
|
waiting: listed.waiting,
|
|
37
|
-
newest: listed.newest === null ? null :
|
|
55
|
+
newest: listed.newest === null ? null : changeCursor(listed.newest),
|
|
38
56
|
processEnded: listed.process_ended_at,
|
|
39
57
|
};
|
|
40
58
|
}
|
|
@@ -153,9 +171,9 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
153
171
|
}
|
|
154
172
|
announced = { kind: 'discovered', discovery };
|
|
155
173
|
emit(announced);
|
|
156
|
-
}, () => {
|
|
174
|
+
}, (failure) => {
|
|
157
175
|
if (socket === via)
|
|
158
|
-
via.close();
|
|
176
|
+
via.close(failure);
|
|
159
177
|
});
|
|
160
178
|
}
|
|
161
179
|
function converse(frame) {
|
|
@@ -203,7 +221,12 @@ export function houseNotifications(transport, mode, discovering, spaces) {
|
|
|
203
221
|
return;
|
|
204
222
|
}
|
|
205
223
|
if (frame.type === 'deliveries') {
|
|
206
|
-
emitConversation({
|
|
224
|
+
emitConversation({
|
|
225
|
+
kind: 'deliveries',
|
|
226
|
+
conversation,
|
|
227
|
+
waiting: [...frame.waiting],
|
|
228
|
+
unknown: [...frame.unknown],
|
|
229
|
+
});
|
|
207
230
|
return;
|
|
208
231
|
}
|
|
209
232
|
if (frame.type === 'interactions') {
|
package/dist/transport.d.ts
CHANGED
|
@@ -59,10 +59,7 @@ export type HouseListedConversation = {
|
|
|
59
59
|
finished_at: string | null;
|
|
60
60
|
outcome: string | null;
|
|
61
61
|
waiting: boolean;
|
|
62
|
-
newest:
|
|
63
|
-
accepted_at: string;
|
|
64
|
-
message_id: string;
|
|
65
|
-
} | null;
|
|
62
|
+
newest: number | null;
|
|
66
63
|
process_ended_at: string | null;
|
|
67
64
|
};
|
|
68
65
|
type Listed<Frame extends {
|
|
@@ -118,6 +115,7 @@ export type HouseStreamFrame = Listed<{
|
|
|
118
115
|
} | {
|
|
119
116
|
type: 'deliveries';
|
|
120
117
|
conversation_id: string;
|
|
118
|
+
waiting: readonly string[];
|
|
121
119
|
unknown: readonly string[];
|
|
122
120
|
} | {
|
|
123
121
|
type: 'process';
|
|
@@ -167,7 +165,7 @@ export type HouseHeldRoom = {
|
|
|
167
165
|
export type HouseOpening = {
|
|
168
166
|
hold(rooms: readonly HouseHeldRoom[], runtime: string, conversations: string | null): void;
|
|
169
167
|
received(authority: string, carry: string, index: number): void;
|
|
170
|
-
close(): void;
|
|
168
|
+
close(failure?: unknown): void;
|
|
171
169
|
};
|
|
172
170
|
export type HouseClosing = {
|
|
173
171
|
revoked: boolean;
|
package/dist/transport.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5E,eAAO,MAAM,mBAAmB;aAC9B,IAAI,YACF,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,uBAAuB;aAEzB,MAAM,YACJ,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,cAAc,EACd,MAAM,EACN,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,UAAU,EACV,OAAO,EACP,UAAU,EACV,MAAM;CAEA,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,wBAAgB,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAE3D;AAED,wBAAgB,cAAc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,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzF,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,MAAM,IAAI,OAAO,CAAC;IAClB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACpD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ProviderRefusal, type TransportUncertainty } from '@agentshouse/mdruntime';
|
|
2
|
+
export declare const UNANSWERED: TransportUncertainty;
|
|
3
|
+
export declare function failedOn(failure: unknown): TransportUncertainty;
|
|
4
|
+
export declare function unusable(): TransportUncertainty;
|
|
5
|
+
export declare function refusedFor(refusal: ProviderRefusal): TransportUncertainty;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uncertain.d.ts","sourceRoot":"","sources":["../src/uncertain.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,UAAU,EAAE,oBAAwD,CAAC;AAElF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,oBAAoB,CAE/D;AAED,wBAAgB,QAAQ,IAAI,oBAAoB,CAE/C;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,oBAAoB,CAEzE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { refusalError, } from '@agentshouse/mdruntime';
|
|
2
|
+
export const UNANSWERED = { kind: 'transport-uncertainty' };
|
|
3
|
+
export function failedOn(failure) {
|
|
4
|
+
return { kind: 'transport-uncertainty', failure };
|
|
5
|
+
}
|
|
6
|
+
export function unusable() {
|
|
7
|
+
return failedOn(new Error());
|
|
8
|
+
}
|
|
9
|
+
export function refusedFor(refusal) {
|
|
10
|
+
return failedOn(refusalError(refusal));
|
|
11
|
+
}
|
package/dist/upload.d.ts
CHANGED
|
@@ -8,4 +8,6 @@ export type HouseUpload = {
|
|
|
8
8
|
}[];
|
|
9
9
|
};
|
|
10
10
|
export declare function houseUpload(value: unknown): HouseUpload | null;
|
|
11
|
-
export declare function finishedUpload(transport: HouseTransport, first: HouseUpload, blob: Blob): Promise<HouseDoorAnswer |
|
|
11
|
+
export declare function finishedUpload(transport: HouseTransport, first: HouseUpload, blob: Blob): Promise<HouseDoorAnswer | {
|
|
12
|
+
readonly unfinished: number;
|
|
13
|
+
}>;
|
package/dist/upload.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE3F,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC5E,CAAC;AAeF,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAQ9D;
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE3F,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC5E,CAAC;AAeF,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAQ9D;AA+BD,wBAAsB,cAAc,CAClC,SAAS,EAAE,cAAc,EACzB,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,eAAe,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAgB5D"}
|