@agentshouse/mdruntime-adapter 0.1.0-cd61dfca5d699 → 0.1.0-cd673d02b6e50
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/README.md +2 -2
- package/dist/actions.d.ts +6 -23
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +20 -134
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +204 -201
- package/dist/app-reference.d.ts +2 -0
- package/dist/app-reference.d.ts.map +1 -0
- package/dist/app-reference.js +2 -0
- package/dist/crockford.d.ts +4 -0
- package/dist/crockford.d.ts.map +1 -0
- package/dist/crockford.js +3 -0
- package/dist/discovery.d.ts +6 -10
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +36 -32
- package/dist/gather.d.ts +1 -2
- package/dist/gather.d.ts.map +1 -1
- package/dist/gather.js +5 -15
- package/dist/house-model.d.ts +2 -0
- package/dist/house-model.d.ts.map +1 -0
- package/dist/house-model.js +486 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/model.d.ts +5 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +11 -13
- package/dist/part.d.ts +14 -0
- package/dist/part.d.ts.map +1 -0
- package/dist/part.js +90 -0
- package/dist/read.d.ts +53 -27
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +262 -158
- package/dist/room-stream.d.ts +19 -0
- package/dist/room-stream.d.ts.map +1 -0
- package/dist/room-stream.js +57 -0
- package/dist/room-types.d.ts +7 -0
- package/dist/room-types.d.ts.map +1 -0
- package/dist/room-types.js +125 -0
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +47 -112
- package/dist/stream.d.ts +3 -3
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +38 -35
- package/dist/transport.d.ts +14 -8
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +2 -1
- package/dist/upload.d.ts +12 -0
- package/dist/upload.d.ts.map +1 -0
- package/dist/upload.js +63 -0
- package/dist/write.d.ts +16 -1
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +100 -55
- package/package.json +8 -4
- package/AGENTS.md +0 -299
- package/dist/handed.d.ts +0 -15
- package/dist/handed.d.ts.map +0 -1
- package/dist/handed.js +0 -38
- package/dist/referrer.d.ts +0 -7
- package/dist/referrer.d.ts.map +0 -1
- package/dist/referrer.js +0 -35
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { APP_REFERENCE_PATTERN } from './app-reference.js';
|
|
2
|
+
import { HOUSE_MODEL_TYPES } from './house-model.js';
|
|
3
|
+
export const INBOX_CHANNEL_KINDS = [
|
|
4
|
+
'telegram-bot',
|
|
5
|
+
'telegram-business',
|
|
6
|
+
'whatsapp',
|
|
7
|
+
'messenger',
|
|
8
|
+
'instagram',
|
|
9
|
+
'viber',
|
|
10
|
+
'tiktok',
|
|
11
|
+
];
|
|
12
|
+
export const INBOX_CHAT_TYPE = 'inbox-chat';
|
|
13
|
+
export const INBOX_MESSAGE_TYPE = 'inbox-message';
|
|
14
|
+
export const HOUSE_NAMEABLE_ROOM_TYPES = [INBOX_CHAT_TYPE, INBOX_MESSAGE_TYPE];
|
|
15
|
+
const WAYFINDING_MAP_TYPE = 'wayfinding-map';
|
|
16
|
+
const WAYFINDING_TICKET_TYPE = 'wayfinding-ticket';
|
|
17
|
+
const WAYFINDING_MAP_SECTIONS = [
|
|
18
|
+
'Destination',
|
|
19
|
+
'Notes',
|
|
20
|
+
'Decisions so far',
|
|
21
|
+
'Not yet specified',
|
|
22
|
+
'Out of scope',
|
|
23
|
+
];
|
|
24
|
+
const IDENTITY = "{ type: string, pattern: '^\\S+$' }";
|
|
25
|
+
const AGENT = [' agent: { type: string, format: uuid }', ' name: { type: string }'];
|
|
26
|
+
const ASSIGNEE = [
|
|
27
|
+
' type: object',
|
|
28
|
+
' properties:',
|
|
29
|
+
' user: { type: string, format: uuid }',
|
|
30
|
+
...AGENT,
|
|
31
|
+
];
|
|
32
|
+
export const HOUSE_ROOM_TYPES = [
|
|
33
|
+
`${INBOX_CHAT_TYPE}:`,
|
|
34
|
+
' properties:',
|
|
35
|
+
' inbox: { type: string, format: uuid }',
|
|
36
|
+
` channel: { enum: [${INBOX_CHANNEL_KINDS.join(', ')}] }`,
|
|
37
|
+
` chat: ${IDENTITY}`,
|
|
38
|
+
' customer:',
|
|
39
|
+
' type: object',
|
|
40
|
+
' properties:',
|
|
41
|
+
' name: { type: string }',
|
|
42
|
+
` username: ${IDENTITY}`,
|
|
43
|
+
` phone: ${IDENTITY}`,
|
|
44
|
+
' assignee:',
|
|
45
|
+
...ASSIGNEE,
|
|
46
|
+
' return_to:',
|
|
47
|
+
' type: object',
|
|
48
|
+
' properties:',
|
|
49
|
+
...AGENT,
|
|
50
|
+
' conversation: { type: string, format: uuid }',
|
|
51
|
+
' required: [inbox, channel, chat, customer]',
|
|
52
|
+
`${INBOX_MESSAGE_TYPE}:`,
|
|
53
|
+
' properties:',
|
|
54
|
+
' direction: { enum: [in, out] }',
|
|
55
|
+
' sender:',
|
|
56
|
+
' type: object',
|
|
57
|
+
' properties:',
|
|
58
|
+
' name: { type: string }',
|
|
59
|
+
` username: ${IDENTITY}`,
|
|
60
|
+
' sent_at: { type: string, format: date-time }',
|
|
61
|
+
` channel_message: ${IDENTITY}`,
|
|
62
|
+
' state: { enum: [sending, sent, failed] }',
|
|
63
|
+
' reason: { type: string }',
|
|
64
|
+
' reactions:',
|
|
65
|
+
' type: array',
|
|
66
|
+
' items:',
|
|
67
|
+
' type: object',
|
|
68
|
+
' properties:',
|
|
69
|
+
' reaction: { type: string, minLength: 1 }',
|
|
70
|
+
' sender:',
|
|
71
|
+
' type: object',
|
|
72
|
+
' properties:',
|
|
73
|
+
` id: ${IDENTITY}`,
|
|
74
|
+
' name: { type: string }',
|
|
75
|
+
` username: ${IDENTITY}`,
|
|
76
|
+
' count: { type: integer, minimum: 1 }',
|
|
77
|
+
' required: [reaction]',
|
|
78
|
+
` post: ${IDENTITY}`,
|
|
79
|
+
' assignee:',
|
|
80
|
+
...ASSIGNEE,
|
|
81
|
+
' sent_outside: { const: true }',
|
|
82
|
+
' template:',
|
|
83
|
+
' type: object',
|
|
84
|
+
' properties:',
|
|
85
|
+
' name: { type: string, minLength: 1 }',
|
|
86
|
+
' language: { type: string, minLength: 1 }',
|
|
87
|
+
' required: [name, language]',
|
|
88
|
+
' values:',
|
|
89
|
+
' type: object',
|
|
90
|
+
' additionalProperties: { type: string }',
|
|
91
|
+
' withheld: { const: true }',
|
|
92
|
+
' required: [direction]',
|
|
93
|
+
' if: { properties: { direction: { const: in } } }',
|
|
94
|
+
' then: { required: [sent_at] }',
|
|
95
|
+
`${WAYFINDING_MAP_TYPE}:`,
|
|
96
|
+
' properties:',
|
|
97
|
+
' title: { type: string }',
|
|
98
|
+
' required: [title]',
|
|
99
|
+
' sections:',
|
|
100
|
+
...WAYFINDING_MAP_SECTIONS.map((name) => ` ${name}: { kind: text, required: true }`),
|
|
101
|
+
`${WAYFINDING_TICKET_TYPE}:`,
|
|
102
|
+
' properties:',
|
|
103
|
+
' title: { type: string }',
|
|
104
|
+
' kind: { enum: [research, prototype, grilling, task] }',
|
|
105
|
+
' status: { enum: [open, in-progress, done, out-of-scope] }',
|
|
106
|
+
` map: { type: string, reference: ${WAYFINDING_MAP_TYPE} }`,
|
|
107
|
+
` blocked_by: { type: array, items: { type: string, reference: ${WAYFINDING_TICKET_TYPE} } }`,
|
|
108
|
+
' assignee:',
|
|
109
|
+
...ASSIGNEE,
|
|
110
|
+
' conversation: { type: string, format: uuid }',
|
|
111
|
+
` app: { type: string, pattern: '${APP_REFERENCE_PATTERN.source}' }`,
|
|
112
|
+
' required: [title, kind, status, map, blocked_by]',
|
|
113
|
+
' sections:',
|
|
114
|
+
' Question: { kind: text }',
|
|
115
|
+
' Answer: { kind: text }',
|
|
116
|
+
' allOf:',
|
|
117
|
+
' - if: { properties: { status: { enum: [in-progress, done, out-of-scope] } }, required: [status] }',
|
|
118
|
+
' then: { required: [assignee] }',
|
|
119
|
+
' else: { properties: { assignee: false } }',
|
|
120
|
+
' - if: { properties: { assignee: { required: [agent] } }, required: [assignee] }',
|
|
121
|
+
' else: { properties: { conversation: false } }',
|
|
122
|
+
' - if: { properties: { status: { enum: [done, out-of-scope] } }, required: [status] }',
|
|
123
|
+
' then: { sections: { Answer: { kind: text, required: true } } }',
|
|
124
|
+
HOUSE_MODEL_TYPES,
|
|
125
|
+
].join('\n');
|
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,EAUR,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAUR,MAAM,wBAAwB,CAAC;AAwBhC,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAgCxB,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,UAAQ,GAAG,OAAO,CAqN1F"}
|
package/dist/site.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { stepped } from '@agentshouse/mdruntime';
|
|
1
2
|
import { actionOutcome, SITE_SUBMIT } from './actions.js';
|
|
2
3
|
import { mapDiscovery, parseSiteDiscovery, siteCapabilities, siteTracked, } from './discovery.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { streamedModels, viewModels } from './model.js';
|
|
5
|
+
import { bootstrapping, parseEnumeration, refreshFrom, viewOf, wholeView, } from './read.js';
|
|
6
|
+
import { roomStreams } from './room-stream.js';
|
|
6
7
|
import { classifyDoor, classifyRead, discoveryFailure } from './refusal.js';
|
|
8
|
+
import { HOUSE_NAMEABLE_ROOM_TYPES, HOUSE_ROOM_TYPES } from './room-types.js';
|
|
7
9
|
import { houseNotifications } from './stream.js';
|
|
8
|
-
import { SITE_DOOR_BOOTSTRAP, SITE_DOOR_DISCOVER, SITE_DOOR_ENUMERATE, SITE_DOOR_SUBMIT,
|
|
9
|
-
import { houseReferrer } from './referrer.js';
|
|
10
|
+
import { SITE_DOOR_BOOTSTRAP, SITE_DOOR_DISCOVER, SITE_DOOR_ENUMERATE, SITE_DOOR_SUBMIT, SITE_FILES, } from './transport.js';
|
|
10
11
|
import { followsVersion, logPosition, presented, reachedVersion, roomVersion, } from './version.js';
|
|
11
12
|
const UNCERTAIN = { kind: 'transport-uncertainty' };
|
|
12
13
|
function unfound() {
|
|
@@ -18,32 +19,21 @@ function siteRoom(tracked) {
|
|
|
18
19
|
locator: tracked.locator,
|
|
19
20
|
handle: tracked.handle,
|
|
20
21
|
roomVersion: roomVersion(tracked),
|
|
21
|
-
operations: {
|
|
22
|
-
replica: { selection: tracked.locator, admission: 'admitted' },
|
|
22
|
+
operations: { write: [], delete: [] },
|
|
23
|
+
replica: { selection: tracked.locator, admission: 'admitted', offline: 'open' },
|
|
23
24
|
providerOwnedPaths: [],
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
|
-
function settled(refused) {
|
|
27
|
-
return refused.kind === 'beyond-horizon' ? UNCERTAIN : refused;
|
|
28
|
-
}
|
|
29
27
|
export function createSiteAdapter(transport, snapshot = false) {
|
|
30
28
|
const notifications = houseNotifications(transport, 'site');
|
|
31
29
|
const tracked = new Map();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return named === null || !tracked.has(named.locator) ? null : named;
|
|
35
|
-
}
|
|
30
|
+
const read = new Map();
|
|
31
|
+
const rooms = roomStreams('site');
|
|
36
32
|
function fileRoute(request) {
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
return { kind: '
|
|
40
|
-
}
|
|
41
|
-
if (request.fileRef === undefined)
|
|
42
|
-
return unfound();
|
|
43
|
-
const { room_ref, path, record } = named.referrer;
|
|
44
|
-
return `${SITE_FILES}${room_ref}/${encodeURIComponent(request.fileRef)}/${path === undefined
|
|
45
|
-
? `${SITE_FILE_RECORD}/${encodeURIComponent(record)}`
|
|
46
|
-
: encodeURIComponent(path)}`;
|
|
33
|
+
const entry = tracked.get(request.locator);
|
|
34
|
+
if (entry === undefined)
|
|
35
|
+
return { kind: 'room-not-readable', locator: request.locator };
|
|
36
|
+
return `${SITE_FILES}${entry.authority}/${encodeURIComponent(request.revision)}/${encodeURIComponent(request.path)}`;
|
|
47
37
|
}
|
|
48
38
|
async function enumerated(entry, from, page) {
|
|
49
39
|
const answer = await transport.door(SITE_DOOR_ENUMERATE, {
|
|
@@ -68,73 +58,35 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
68
58
|
const first = await enumerated(entry, from);
|
|
69
59
|
return 'kind' in first ? first : wholeView(first, (page) => enumerated(entry, from, page));
|
|
70
60
|
}
|
|
71
|
-
async function
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return scope === null ? { failure: UNCERTAIN } : { body: answer.body, scope };
|
|
61
|
+
async function openedRoom(entry, arriving, signal) {
|
|
62
|
+
const cut = read.get(entry.locator);
|
|
63
|
+
const answered = await transport.streamed(`${SITE_DOOR_BOOTSTRAP}${entry.authority}${cut === undefined ? '' : `?expired=${cut}`}`, signal ?? new AbortController().signal);
|
|
64
|
+
if (answered.room === null)
|
|
65
|
+
return classifyDoor(answered.status, answered.body, entry.locator) ?? UNCERTAIN;
|
|
66
|
+
const head = await rooms.head(entry, answered.room, arriving, signal);
|
|
67
|
+
const at = head.kind === 'bootstrap' ? logPosition(head.roomVersion) : null;
|
|
68
|
+
if (at !== null)
|
|
69
|
+
read.set(entry.locator, at.position);
|
|
70
|
+
return head;
|
|
82
71
|
}
|
|
83
|
-
async function
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
return UNCERTAIN;
|
|
87
|
-
}
|
|
88
|
-
let text = opened.content;
|
|
89
|
-
for (;;) {
|
|
90
|
-
const part = await bootstrapPart(entry, path, text.length);
|
|
91
|
-
if ('failure' in part)
|
|
92
|
-
return part.failure;
|
|
93
|
-
const [piece] = part.scope.contents;
|
|
94
|
-
if (piece === undefined ||
|
|
95
|
-
part.scope.contents.length !== 1 ||
|
|
96
|
-
piece.path !== path ||
|
|
97
|
-
piece.content.length === 0) {
|
|
98
|
-
return UNCERTAIN;
|
|
99
|
-
}
|
|
100
|
-
text += piece.content;
|
|
101
|
-
const more = siteBootstrapOffset(part.body);
|
|
102
|
-
if (more === null)
|
|
103
|
-
break;
|
|
104
|
-
if (more !== text.length)
|
|
105
|
-
return UNCERTAIN;
|
|
106
|
-
}
|
|
107
|
-
const file = scope.files.find((held) => held.path === path);
|
|
108
|
-
if (file === undefined || (await sha256Hex(text)) !== file.version)
|
|
109
|
-
return UNCERTAIN;
|
|
110
|
-
return { ...scope, contents: [...scope.contents.slice(0, -1), { path, content: text }] };
|
|
111
|
-
}
|
|
112
|
-
async function caughtUp(entry, after) {
|
|
113
|
-
const part = await bootstrapPart(entry, after, null);
|
|
114
|
-
if ('failure' in part)
|
|
72
|
+
async function streamedPage(entry, token) {
|
|
73
|
+
const part = await rooms.part(entry, token);
|
|
74
|
+
if ('kind' in part)
|
|
115
75
|
return part;
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
const { scope } = part;
|
|
125
|
-
if (after !== null || next !== null || roomVersion(scope) === roomVersion(entry)) {
|
|
126
|
-
return { scope, next };
|
|
127
|
-
}
|
|
128
|
-
const view = await enumeration(entry, scope);
|
|
129
|
-
if ('kind' in view)
|
|
130
|
-
return { failure: settled(view) };
|
|
131
|
-
return { scope: advancedScope(scope, view), next: null };
|
|
76
|
+
notifications.reach(entry.authority, part.scope);
|
|
77
|
+
const { folders: _folders, ...page } = await stepped(bootstrapping(part.scope));
|
|
78
|
+
return {
|
|
79
|
+
...page,
|
|
80
|
+
...(part.models === undefined ? {} : { models: part.models }),
|
|
81
|
+
...(part.pageToken === undefined ? {} : { pageToken: part.pageToken }),
|
|
82
|
+
bytes: part.bytes,
|
|
83
|
+
};
|
|
132
84
|
}
|
|
133
85
|
async function refreshed(entry, fromRoomVersion) {
|
|
134
86
|
const from = logPosition(fromRoomVersion);
|
|
135
87
|
if (from === null)
|
|
136
88
|
return { kind: 'beyond-horizon' };
|
|
137
|
-
const streamed = notifications.advance(entry, from);
|
|
89
|
+
const streamed = await stepped(notifications.advance(entry, from));
|
|
138
90
|
if (streamed !== null) {
|
|
139
91
|
const models = await streamedModels(streamed.schemas, entry, 'site');
|
|
140
92
|
return models === undefined ? streamed.page : { ...streamed.page, models };
|
|
@@ -143,7 +95,7 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
143
95
|
if ('kind' in view)
|
|
144
96
|
return view;
|
|
145
97
|
notifications.reach(entry.authority, view);
|
|
146
|
-
const answer = refreshFrom(view, fromRoomVersion);
|
|
98
|
+
const answer = await refreshFrom(view, fromRoomVersion);
|
|
147
99
|
if (answer.kind !== 'net-advancement')
|
|
148
100
|
return answer;
|
|
149
101
|
const models = await viewModels(view, entry);
|
|
@@ -152,6 +104,8 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
152
104
|
return {
|
|
153
105
|
localSaves: true,
|
|
154
106
|
exhaustiveDiscovery: true,
|
|
107
|
+
roomTypes: HOUSE_ROOM_TYPES,
|
|
108
|
+
nameableRoomTypes: HOUSE_NAMEABLE_ROOM_TYPES,
|
|
155
109
|
async authorize() {
|
|
156
110
|
return {};
|
|
157
111
|
},
|
|
@@ -174,24 +128,9 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
174
128
|
const entry = tracked.get(request.locator);
|
|
175
129
|
if (entry === undefined)
|
|
176
130
|
return { kind: 'room-not-readable', locator: request.locator };
|
|
177
|
-
|
|
178
|
-
?
|
|
179
|
-
:
|
|
180
|
-
const held = await caughtUp(entry, continued?.after ?? null);
|
|
181
|
-
if ('failure' in held)
|
|
182
|
-
return held.failure;
|
|
183
|
-
notifications.reach(entry.authority, held.scope);
|
|
184
|
-
const seen = [
|
|
185
|
-
...(continued?.seen ?? []),
|
|
186
|
-
...entry.schemas.filter((schema) => held.scope.files.some((file) => file.path === schema)),
|
|
187
|
-
];
|
|
188
|
-
const models = await partModels(held.scope, entry, new Set(seen), held.next === null);
|
|
189
|
-
const continuation = held.next === null ? null : { after: held.next, seen };
|
|
190
|
-
return {
|
|
191
|
-
...bootstrapOf(held.scope),
|
|
192
|
-
...(models === undefined ? {} : { models }),
|
|
193
|
-
...(continuation === null ? {} : { pageToken: JSON.stringify(continuation) }),
|
|
194
|
-
};
|
|
131
|
+
return request.pageToken === undefined
|
|
132
|
+
? openedRoom(entry, request.arriving, request.signal)
|
|
133
|
+
: streamedPage(entry, request.pageToken);
|
|
195
134
|
},
|
|
196
135
|
async refresh(_authorization, request) {
|
|
197
136
|
const entry = tracked.get(request.locator);
|
|
@@ -209,6 +148,9 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
209
148
|
async mutate() {
|
|
210
149
|
return { kind: 'rejected', affected: {}, code: 'write-grant', fields: {}, retryable: false };
|
|
211
150
|
},
|
|
151
|
+
async attach() {
|
|
152
|
+
return { kind: 'rejected', code: 'write-grant', fields: {}, retryable: false };
|
|
153
|
+
},
|
|
212
154
|
async history() {
|
|
213
155
|
return { kind: 'no-history' };
|
|
214
156
|
},
|
|
@@ -219,8 +161,8 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
219
161
|
const read = await transport.download(route);
|
|
220
162
|
if (read.status === 404)
|
|
221
163
|
return unfound();
|
|
222
|
-
return read.status === 200 && read.
|
|
223
|
-
? { kind: 'binary',
|
|
164
|
+
return read.status === 200 && read.body !== null
|
|
165
|
+
? { kind: 'binary', body: read.body, mediaType: read.mediaType }
|
|
224
166
|
: UNCERTAIN;
|
|
225
167
|
},
|
|
226
168
|
async link(_authorization, request) {
|
|
@@ -233,13 +175,6 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
233
175
|
name: request.path.slice(request.path.lastIndexOf('/') + 1),
|
|
234
176
|
};
|
|
235
177
|
},
|
|
236
|
-
referrerScope(referrer) {
|
|
237
|
-
const named = published(referrer);
|
|
238
|
-
if (named === null)
|
|
239
|
-
return null;
|
|
240
|
-
const { path } = named.referrer;
|
|
241
|
-
return { kind: 'room', locator: named.locator, ...(path === undefined ? {} : { path }) };
|
|
242
|
-
},
|
|
243
178
|
reached(locator, version, target) {
|
|
244
179
|
return reachedVersion(version, target, tracked.get(locator)?.logEpoch);
|
|
245
180
|
},
|
package/dist/stream.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ConversationStream, type RefreshPage, type RoomStreamEvent, type ServiceModeSignal, type StreamReceipts } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { TrackedAuthority } from './discovery.js';
|
|
3
3
|
import type { HouseDoor, HouseHeldRoom, HouseMode, HouseStreamEntry } from './transport.js';
|
|
4
4
|
import { type LogPosition } from './version.js';
|
|
5
5
|
export type HeldRevision = (path: string, revision: string) => boolean;
|
|
6
6
|
export type StreamedAdvancement = {
|
|
7
7
|
page: RefreshPage;
|
|
8
|
-
entries: readonly HouseStreamEntry[];
|
|
9
8
|
schemas: ReadonlyMap<string, HouseStreamEntry>;
|
|
10
9
|
};
|
|
11
10
|
export type HouseNotifications = {
|
|
@@ -16,7 +15,8 @@ export type HouseNotifications = {
|
|
|
16
15
|
reopen(): void;
|
|
17
16
|
track(authorities: readonly TrackedAuthority[]): void;
|
|
18
17
|
reach(authority: string, at: LogPosition): void;
|
|
19
|
-
|
|
18
|
+
edited(tracked: TrackedAuthority, from: LogPosition): readonly string[];
|
|
19
|
+
advance(tracked: TrackedAuthority, from: LogPosition, holds?: HeldRevision): Generator<number, StreamedAdvancement | null, void>;
|
|
20
20
|
conversations: ConversationStream;
|
|
21
21
|
serviceMode: ServiceModeSignal;
|
|
22
22
|
};
|
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,KAAK,
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,kBAAkB,EAEvB,KAAK,WAAW,EAChB,KAAK,eAAe,EAEpB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAEpB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAUvD,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EAEb,SAAS,EAET,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AA0C7D,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;AAEvE,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,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,EAAE,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI,CAAC;IACxF,IAAI,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,IAAI,CAAC;IAC5C,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC;IAClD,MAAM,IAAI,IAAI,CAAC;IACf,KAAK,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,GAAG,IAAI,CAAC;IACtD,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC;IAChD,MAAM,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,MAAM,EAAE,CAAC;IACxE,OAAO,CACL,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,WAAW,EACjB,KAAK,CAAC,EAAE,YAAY,GACnB,SAAS,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC;IACvD,aAAa,EAAE,kBAAkB,CAAC;IAClC,WAAW,EAAE,iBAAiB,CAAC;CAChC,CAAC;AAmFF,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,kBAAkB,CA8jB5F"}
|
package/dist/stream.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ROW_WEIGHT, } from '@agentshouse/mdruntime';
|
|
1
2
|
import { acceptedMessage } from './actions.js';
|
|
2
3
|
import { sha256Hex } from './digest.js';
|
|
3
|
-
import { binaryFileOf, headChange,
|
|
4
|
+
import { answered, answering, binaryFileOf, folded, forgotten, headChange, revised, } from './read.js';
|
|
4
5
|
import { roomVersion } from './version.js';
|
|
5
6
|
const HELD_FRAMES_MAX = 256;
|
|
6
7
|
function turnOperation(frame) {
|
|
@@ -555,7 +556,18 @@ export function houseNotifications(transport, mode) {
|
|
|
555
556
|
held,
|
|
556
557
|
});
|
|
557
558
|
},
|
|
558
|
-
|
|
559
|
+
edited(tracked, from) {
|
|
560
|
+
const line = lines.get(tracked.authority);
|
|
561
|
+
const start = position(from.position);
|
|
562
|
+
if (line === undefined || start === null || line.logEpoch !== from.logEpoch)
|
|
563
|
+
return [];
|
|
564
|
+
return [
|
|
565
|
+
...new Set(line.frames
|
|
566
|
+
.filter((frame) => frame.position > start)
|
|
567
|
+
.flatMap((frame) => frame.entries.flatMap((entry) => entry.kind === 'edited' && entry.revision !== undefined ? [entry.path] : []))),
|
|
568
|
+
];
|
|
569
|
+
},
|
|
570
|
+
*advance(tracked, from, holds) {
|
|
559
571
|
const line = lines.get(tracked.authority);
|
|
560
572
|
const start = position(from.position);
|
|
561
573
|
if (line === undefined || start === null || line.logEpoch !== from.logEpoch)
|
|
@@ -564,36 +576,26 @@ export function houseNotifications(transport, mode) {
|
|
|
564
576
|
const first = pending[0];
|
|
565
577
|
if (first === undefined || first.after > start)
|
|
566
578
|
return null;
|
|
567
|
-
const
|
|
568
|
-
const revisions = {};
|
|
569
|
-
const changes = {};
|
|
570
|
-
const binaryFiles = {};
|
|
571
|
-
const removals = [];
|
|
572
|
-
const applied = [];
|
|
579
|
+
const answer = answering();
|
|
573
580
|
const schemas = new Map();
|
|
574
|
-
const forget = (path) => {
|
|
575
|
-
delete documents[path];
|
|
576
|
-
delete revisions[path];
|
|
577
|
-
delete changes[path];
|
|
578
|
-
delete binaryFiles[path];
|
|
579
|
-
const removed = removals.indexOf(path);
|
|
580
|
-
if (removed !== -1)
|
|
581
|
-
removals.splice(removed, 1);
|
|
582
|
-
};
|
|
583
581
|
for (const frame of pending) {
|
|
584
582
|
for (const entry of frame.entries) {
|
|
583
|
+
yield ROW_WEIGHT + (entry.text?.length ?? 0);
|
|
584
|
+
if (entry.kind === 'folder') {
|
|
585
|
+
folded(answer, entry.path, entry.removed === true);
|
|
586
|
+
continue;
|
|
587
|
+
}
|
|
585
588
|
if (entry.kind === 'edited' &&
|
|
586
589
|
entry.revision !== undefined &&
|
|
587
590
|
holds?.(entry.path, entry.revision) === true) {
|
|
588
|
-
|
|
591
|
+
forgotten(answer, entry.path);
|
|
589
592
|
continue;
|
|
590
593
|
}
|
|
591
|
-
|
|
592
|
-
if (tracked.schemas.includes(entry.path))
|
|
594
|
+
if (entry.path === tracked.schema)
|
|
593
595
|
schemas.set(entry.path, entry);
|
|
594
596
|
if (entry.kind === 'removed') {
|
|
595
|
-
|
|
596
|
-
removals.
|
|
597
|
+
forgotten(answer, entry.path);
|
|
598
|
+
answer.removals.add(entry.path);
|
|
597
599
|
continue;
|
|
598
600
|
}
|
|
599
601
|
const binary = binaryFileOf(entry);
|
|
@@ -604,32 +606,33 @@ export function houseNotifications(transport, mode) {
|
|
|
604
606
|
const head = headChange(entry);
|
|
605
607
|
if (head === null)
|
|
606
608
|
return null;
|
|
607
|
-
|
|
609
|
+
forgotten(answer, entry.path);
|
|
608
610
|
if (binary === undefined)
|
|
609
|
-
documents
|
|
611
|
+
answer.documents.set(entry.path, entry.text);
|
|
610
612
|
else
|
|
611
|
-
binaryFiles
|
|
613
|
+
answer.binaryFiles.set(entry.path, binary);
|
|
612
614
|
const revision = entry.revision ?? binary?.sha256;
|
|
613
615
|
if (revision !== undefined)
|
|
614
|
-
|
|
616
|
+
revised(answer, entry.path, revision);
|
|
615
617
|
if (head !== undefined)
|
|
616
|
-
changes
|
|
618
|
+
answer.changes.set(entry.path, head);
|
|
617
619
|
}
|
|
618
620
|
}
|
|
619
621
|
const last = pending.at(-1);
|
|
620
|
-
lines.
|
|
622
|
+
const current = lines.get(tracked.authority);
|
|
623
|
+
if (current?.logEpoch === line.logEpoch) {
|
|
624
|
+
lines.set(tracked.authority, {
|
|
625
|
+
...current,
|
|
626
|
+
frames: current.frames.filter((frame) => frame.position > start),
|
|
627
|
+
held: current.held !== null && current.held > last.position ? current.held : last.position,
|
|
628
|
+
});
|
|
629
|
+
}
|
|
621
630
|
return {
|
|
622
631
|
page: {
|
|
623
632
|
kind: 'net-advancement',
|
|
624
633
|
roomVersion: roomVersion({ position: last.position.toString(), logEpoch: line.logEpoch }),
|
|
625
|
-
|
|
626
|
-
revisions,
|
|
627
|
-
...identities(revisions),
|
|
628
|
-
changes,
|
|
629
|
-
binaryFiles,
|
|
630
|
-
removals: removals.sort(),
|
|
634
|
+
...(yield* answered(answer)),
|
|
631
635
|
},
|
|
632
|
-
entries: applied,
|
|
633
636
|
schemas,
|
|
634
637
|
};
|
|
635
638
|
},
|
package/dist/transport.d.ts
CHANGED
|
@@ -15,27 +15,27 @@ export type HouseDoorAnswer = {
|
|
|
15
15
|
body: unknown;
|
|
16
16
|
};
|
|
17
17
|
export declare const DOOR_FILES_GET = "/door/files/get";
|
|
18
|
+
export declare const DOOR_FILES_ATTACH = "/door/files/attach";
|
|
19
|
+
export declare const DOOR_FILES_FINISH = "/door/files/finish";
|
|
18
20
|
export declare const SITE_FILES = "/_house/files/";
|
|
19
|
-
export
|
|
20
|
-
export type HouseByteAct = 'authored_batch_upload' | 'conversation_file_upload' | 'binary_stage';
|
|
21
|
-
export type HouseByteBody = string | ArrayBuffer | Uint8Array | Blob;
|
|
21
|
+
export type HouseByteAct = 'authored_batch_upload';
|
|
22
22
|
export type HouseBytesAnswer = {
|
|
23
23
|
status: number;
|
|
24
|
-
|
|
24
|
+
body: ReadableStream<Uint8Array> | null;
|
|
25
|
+
mediaType: string;
|
|
25
26
|
};
|
|
26
27
|
export type HouseByteTransfer = {
|
|
27
28
|
act: HouseByteAct;
|
|
28
29
|
url: string;
|
|
29
|
-
body:
|
|
30
|
-
operation?: string;
|
|
30
|
+
body: string;
|
|
31
31
|
};
|
|
32
32
|
export type HouseStreamEntry = {
|
|
33
33
|
path: string;
|
|
34
|
-
kind: 'edited' | 'removed' | 'piece';
|
|
34
|
+
kind: 'edited' | 'removed' | 'piece' | 'folder';
|
|
35
|
+
removed?: true;
|
|
35
36
|
revision?: string;
|
|
36
37
|
sha256?: string;
|
|
37
38
|
text?: string;
|
|
38
|
-
file?: string;
|
|
39
39
|
bytes?: number;
|
|
40
40
|
media_type?: string;
|
|
41
41
|
author?: {
|
|
@@ -164,17 +164,23 @@ export type HouseStream = {
|
|
|
164
164
|
opened(notify: (opening: HouseOpening) => void): () => void;
|
|
165
165
|
closed(notify: (closing: HouseClosing) => void): () => void;
|
|
166
166
|
};
|
|
167
|
+
export type HouseStreamed = HouseDoorAnswer & {
|
|
168
|
+
room: ReadableStream<Uint8Array> | null;
|
|
169
|
+
};
|
|
167
170
|
export type HouseDoor = {
|
|
168
171
|
door(route: string, body: unknown): Promise<HouseDoorAnswer>;
|
|
169
172
|
stream: HouseStream;
|
|
170
173
|
};
|
|
171
174
|
export type HouseTransport = HouseDoor & {
|
|
175
|
+
streamed(route: string, body: unknown, signal: AbortSignal): Promise<HouseStreamed>;
|
|
172
176
|
transfer(request: HouseByteTransfer): Promise<HouseDoorAnswer>;
|
|
177
|
+
put(url: string, body: Blob, headers: Readonly<Record<string, string>>): Promise<number>;
|
|
173
178
|
download(url: string): Promise<HouseBytesAnswer>;
|
|
174
179
|
};
|
|
175
180
|
export type HouseSiteTransport = HouseDoor & {
|
|
176
181
|
online(): boolean;
|
|
177
182
|
read(route: string): Promise<HouseDoorAnswer>;
|
|
183
|
+
streamed(route: string, signal: AbortSignal): Promise<HouseStreamed>;
|
|
178
184
|
download(route: string): Promise<HouseBytesAnswer>;
|
|
179
185
|
};
|
|
180
186
|
export {};
|
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,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE/E,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAE9C,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,eAAO,MAAM,UAAU,gBAAgB,CAAC;AAExC,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AAEtD,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D,eAAO,MAAM,mBAAmB,4BAA4B,CAAC;AAE7D,eAAO,MAAM,m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WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACpF,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/D,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,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACrE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACpD,CAAC"}
|
package/dist/transport.js
CHANGED
|
@@ -9,5 +9,6 @@ export const SITE_DOOR_BOOTSTRAP = '/_house/door/bootstrap/';
|
|
|
9
9
|
export const SITE_DOOR_ENUMERATE = '/_house/door/enumerate';
|
|
10
10
|
export const SITE_DOOR_SUBMIT = '/_house/door/submit';
|
|
11
11
|
export const DOOR_FILES_GET = '/door/files/get';
|
|
12
|
+
export const DOOR_FILES_ATTACH = '/door/files/attach';
|
|
13
|
+
export const DOOR_FILES_FINISH = '/door/files/finish';
|
|
12
14
|
export const SITE_FILES = '/_house/files/';
|
|
13
|
-
export const SITE_FILE_RECORD = 'record';
|
package/dist/upload.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type HouseDoorAnswer, type HouseTransport } from './transport.js';
|
|
2
|
+
export type HouseUpload = {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly partBytes: number;
|
|
5
|
+
readonly parts: readonly {
|
|
6
|
+
readonly part: number;
|
|
7
|
+
readonly url: string;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
export declare function houseUpload(value: unknown): HouseUpload | null;
|
|
11
|
+
export declare function finishedUpload(transport: HouseTransport, first: HouseUpload, blob: Blob): Promise<HouseDoorAnswer | null>;
|
|
12
|
+
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE9F,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;AA8BD,wBAAsB,cAAc,CAClC,SAAS,EAAE,cAAc,EACzB,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAejC"}
|