@agentshouse/mdruntime-adapter 0.1.0-cefa8b4106453 → 0.1.0-cf03cdc5ecb06
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 +1 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +34 -11
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +124 -116
- package/dist/authored-path.d.ts +54 -3
- package/dist/authored-path.d.ts.map +1 -1
- package/dist/authored-path.js +142 -11
- package/dist/chunks.d.ts +2 -3
- package/dist/chunks.d.ts.map +1 -1
- package/dist/chunks.js +72 -38
- package/dist/discovery.d.ts +25 -5
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +169 -21
- package/dist/history.d.ts +1 -6
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +21 -28
- package/dist/index.d.ts +7 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -9
- package/dist/model.d.ts +5 -5
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +17 -27
- package/dist/read.d.ts +11 -24
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +74 -47
- package/dist/refusal.d.ts +5 -1
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +23 -6
- package/dist/renamed.d.ts +10 -0
- package/dist/renamed.d.ts.map +1 -0
- package/dist/renamed.js +20 -0
- package/dist/room-query.d.ts +4 -0
- package/dist/room-query.d.ts.map +1 -0
- package/dist/room-query.js +63 -0
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +4 -4
- package/dist/session-content/check.d.ts +4 -2
- package/dist/session-content/index.d.ts +3 -4
- package/dist/session-content/parts.d.ts +16 -88
- package/dist/session-content/state.d.ts +21 -23
- package/dist/session-content/turn.d.ts +82 -258
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +56 -22
- package/dist/space-schema.d.ts.map +1 -1
- package/dist/space-schema.js +1 -8
- package/dist/stream.d.ts +4 -4
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +151 -82
- package/dist/transport.d.ts +70 -18
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +47 -9
- 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 +7 -1
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +49 -6
- package/dist/write.d.ts +3 -8
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +88 -106
- package/package.json +4 -3
- package/dist/app-reference.d.ts +0 -1
- package/dist/app-reference.d.ts.map +0 -1
- package/dist/app-reference.js +0 -2
- package/dist/crockford.d.ts +0 -3
- package/dist/crockford.d.ts.map +0 -1
- package/dist/crockford.js +0 -3
- package/dist/house-model.d.ts +0 -830
- package/dist/house-model.d.ts.map +0 -1
- package/dist/house-model.js +0 -465
- package/dist/room-types.d.ts +0 -4
- package/dist/room-types.d.ts.map +0 -1
- package/dist/room-types.js +0 -135
- package/dist/session-content/bounds.d.ts +0 -7
package/dist/transport.d.ts
CHANGED
|
@@ -1,25 +1,40 @@
|
|
|
1
|
-
import type { ConversationEvent, SavedFacts } from '@agentshouse/mdruntime';
|
|
1
|
+
import type { ConversationActivity, ConversationEvent, ListedAgent, SavedFacts } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { Operation, SessionState } from './session-content/index.js';
|
|
3
3
|
export declare const HOUSE_RUNTIME_READS: {
|
|
4
|
-
readonly acts: readonly ['
|
|
5
|
-
readonly frames: readonly ['app-message', 'authority_changed', 'carried', 'caught_up', 'commands', 'conversation', 'conversation_deleted', 'conversations', 'deliveries', 'deployment', 'held', 'interactions', '
|
|
4
|
+
readonly acts: readonly ['account_update.set', 'app.screenshot', 'app.source', 'app_update.feature_set', 'conversations/history/list', 'files/attach', 'files/finish', 'files/read', 'files/revisions/list', 'info', 'room-chunks/list', 'rooms/discover', 'rooms/search', 'update'];
|
|
5
|
+
readonly frames: readonly ['agent', 'app-message', 'app-rooms', 'authority_changed', 'carried', 'caught_up', 'commands', 'conversation', 'conversation_deleted', 'conversations', 'deliveries', 'deployment', 'held', 'interactions', 'message', 'opening', 'options', 'part', 'process', 'received', 'report', 'request', 'request_removed', 'requests', 'signal', 'site', 'starting', 'state', 'tab-icon', 'turn'];
|
|
6
6
|
};
|
|
7
7
|
export type HouseRuntimeAct = (typeof HOUSE_RUNTIME_READS.acts)[number];
|
|
8
8
|
export type HouseRuntimeFrame = (typeof HOUSE_RUNTIME_READS.frames)[number];
|
|
9
9
|
export declare function houseDoorRoute(act: HouseRuntimeAct): string;
|
|
10
|
-
export declare function houseSiteRoute(act: 'chunks' | 'discover'): string;
|
|
10
|
+
export declare function houseSiteRoute(act: 'chunks' | 'discover' | 'query'): string;
|
|
11
|
+
export declare const SITE_QUERY = "query";
|
|
12
|
+
export declare const SITE_FRESH_QUERY = "fresh";
|
|
13
|
+
export declare const SITE_QUERY_ROUTE_CHARACTERS = 12000;
|
|
14
|
+
export declare function siteQueryRoute(room: string, query: Readonly<Record<string, unknown>>, fresh?: boolean): string;
|
|
15
|
+
export declare function siteQueryAsked(address: string): Readonly<Record<string, unknown>> | null;
|
|
11
16
|
export declare const SITES_SUBMISSIONS_CREATE = "sites/submissions/create";
|
|
12
17
|
export declare const SITE_DOOR_SUBMIT = "/_house/door/submit";
|
|
18
|
+
export declare const SITES_FUNCTIONS_CALL = "sites/functions/call";
|
|
19
|
+
export declare const SITE_DOOR_FUNCTION = "/_house/door/function";
|
|
20
|
+
interface SiteDoorAct {
|
|
21
|
+
readonly op: string;
|
|
22
|
+
readonly route: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const SITE_DOOR_ACTS: Readonly<Record<string, SiteDoorAct>>;
|
|
25
|
+
export declare const SITE_DOOR_TOOL = "app_update";
|
|
13
26
|
export type HouseMode = 'credential' | 'site';
|
|
14
27
|
export type HouseDoorAnswer = {
|
|
15
28
|
status: number;
|
|
16
29
|
body: unknown;
|
|
17
30
|
};
|
|
18
31
|
export declare const SITE_FILES = "/_house/files/";
|
|
32
|
+
export declare const SITE_IMAGE_COPIES_HEADER = "X-House-Image-Copies";
|
|
19
33
|
export type HouseBytesAnswer = {
|
|
20
34
|
status: number;
|
|
21
35
|
body: ReadableStream<Uint8Array> | null;
|
|
22
36
|
mediaType: string;
|
|
37
|
+
copies?: string | null;
|
|
23
38
|
};
|
|
24
39
|
export type HouseByteTransfer = {
|
|
25
40
|
url: string;
|
|
@@ -31,7 +46,6 @@ export type HouseStreamEntry = {
|
|
|
31
46
|
removed?: true;
|
|
32
47
|
revision?: string;
|
|
33
48
|
sha256?: string;
|
|
34
|
-
text?: string;
|
|
35
49
|
bytes?: number;
|
|
36
50
|
media_type?: string;
|
|
37
51
|
author?: {
|
|
@@ -40,30 +54,44 @@ export type HouseStreamEntry = {
|
|
|
40
54
|
} | {
|
|
41
55
|
site: string;
|
|
42
56
|
name: string;
|
|
57
|
+
} | {
|
|
58
|
+
inbox: string;
|
|
59
|
+
name: string;
|
|
60
|
+
} | {
|
|
61
|
+
app: string;
|
|
62
|
+
function: string;
|
|
63
|
+
release: string;
|
|
64
|
+
name: string;
|
|
43
65
|
};
|
|
44
66
|
changed_at?: string;
|
|
45
67
|
created_at?: string;
|
|
68
|
+
content?: string;
|
|
46
69
|
facts?: SavedFacts;
|
|
70
|
+
move?: 'arrival' | 'leaving';
|
|
47
71
|
space?: string;
|
|
48
72
|
};
|
|
73
|
+
export type HouseStreamedRequest = {
|
|
74
|
+
room_ref: string;
|
|
75
|
+
name: string;
|
|
76
|
+
document: string;
|
|
77
|
+
};
|
|
49
78
|
type LiveFact<K extends ConversationEvent['kind']> = Extract<ConversationEvent, {
|
|
50
79
|
kind: K;
|
|
51
80
|
}>;
|
|
52
81
|
export type HouseListedConversation = {
|
|
53
82
|
conversation_id: string;
|
|
54
83
|
agent_id: string;
|
|
55
|
-
agent_name: string;
|
|
56
|
-
agent_retired: boolean;
|
|
57
84
|
name: string;
|
|
58
85
|
created_at: string;
|
|
59
|
-
finished_at: string | null;
|
|
60
86
|
outcome: string | null;
|
|
61
87
|
waiting: boolean;
|
|
62
|
-
newest:
|
|
63
|
-
accepted_at: string;
|
|
64
|
-
message_id: string;
|
|
65
|
-
} | null;
|
|
88
|
+
newest: number | null;
|
|
66
89
|
process_ended_at: string | null;
|
|
90
|
+
activity: ConversationActivity | null;
|
|
91
|
+
subject: string | null;
|
|
92
|
+
room_ref: string | null;
|
|
93
|
+
model: string | null;
|
|
94
|
+
effort: string | null;
|
|
67
95
|
};
|
|
68
96
|
type Listed<Frame extends {
|
|
69
97
|
readonly type: HouseRuntimeFrame;
|
|
@@ -85,17 +113,23 @@ export type HouseStreamFrame = Listed<{
|
|
|
85
113
|
} | {
|
|
86
114
|
type: 'opening';
|
|
87
115
|
member: unknown;
|
|
116
|
+
time_zone: unknown;
|
|
88
117
|
bounds: unknown;
|
|
89
118
|
actions: readonly unknown[];
|
|
90
119
|
shapes: readonly unknown[];
|
|
91
120
|
rooms: readonly unknown[];
|
|
121
|
+
listed: readonly unknown[];
|
|
122
|
+
spaces: readonly unknown[];
|
|
92
123
|
} | {
|
|
93
124
|
type: 'caught_up';
|
|
94
125
|
expired: readonly string[];
|
|
95
126
|
} | {
|
|
96
127
|
type: 'authority_changed';
|
|
97
128
|
member: unknown;
|
|
129
|
+
time_zone: unknown;
|
|
98
130
|
authorities: readonly unknown[];
|
|
131
|
+
listed: readonly unknown[];
|
|
132
|
+
spaces: readonly unknown[];
|
|
99
133
|
left: readonly string[];
|
|
100
134
|
} | {
|
|
101
135
|
type: 'turn';
|
|
@@ -118,6 +152,7 @@ export type HouseStreamFrame = Listed<{
|
|
|
118
152
|
} | {
|
|
119
153
|
type: 'deliveries';
|
|
120
154
|
conversation_id: string;
|
|
155
|
+
waiting: readonly string[];
|
|
121
156
|
unknown: readonly string[];
|
|
122
157
|
} | {
|
|
123
158
|
type: 'process';
|
|
@@ -139,12 +174,9 @@ export type HouseStreamFrame = Listed<{
|
|
|
139
174
|
type: 'state';
|
|
140
175
|
conversation_id: string;
|
|
141
176
|
state: SessionState;
|
|
142
|
-
} | {
|
|
143
|
-
type: 'link';
|
|
144
|
-
conversation_id: string;
|
|
145
|
-
connected: boolean;
|
|
146
177
|
} | {
|
|
147
178
|
type: 'conversations';
|
|
179
|
+
agents: readonly ListedAgent[];
|
|
148
180
|
conversations: readonly HouseListedConversation[];
|
|
149
181
|
whole: boolean;
|
|
150
182
|
more: boolean;
|
|
@@ -152,22 +184,42 @@ export type HouseStreamFrame = Listed<{
|
|
|
152
184
|
} | {
|
|
153
185
|
type: 'conversation';
|
|
154
186
|
conversation: HouseListedConversation;
|
|
187
|
+
} | {
|
|
188
|
+
type: 'agent';
|
|
189
|
+
agent: ListedAgent;
|
|
155
190
|
} | {
|
|
156
191
|
type: 'conversation_deleted';
|
|
157
192
|
conversation_id: string;
|
|
158
193
|
} | {
|
|
159
194
|
type: 'signal';
|
|
160
195
|
service_mode: string;
|
|
196
|
+
} | {
|
|
197
|
+
type: 'report';
|
|
198
|
+
} | {
|
|
199
|
+
type: 'request';
|
|
200
|
+
request: HouseStreamedRequest;
|
|
201
|
+
} | {
|
|
202
|
+
type: 'request_removed';
|
|
203
|
+
room_ref: string;
|
|
204
|
+
request: string;
|
|
205
|
+
} | {
|
|
206
|
+
type: 'requests';
|
|
207
|
+
room_ref: string | null;
|
|
208
|
+
requests: readonly HouseStreamedRequest[];
|
|
209
|
+
whole: boolean;
|
|
210
|
+
more: boolean;
|
|
211
|
+
cursor: string;
|
|
161
212
|
}>;
|
|
162
213
|
export type HouseHeldRoom = {
|
|
163
214
|
authority: string;
|
|
164
215
|
position: string;
|
|
165
216
|
log_epoch: string;
|
|
217
|
+
requests?: string;
|
|
166
218
|
};
|
|
167
219
|
export type HouseOpening = {
|
|
168
|
-
hold(rooms: readonly HouseHeldRoom[], runtime: string, conversations: string | null): void;
|
|
220
|
+
hold(rooms: readonly HouseHeldRoom[], runtime: string, conversations: string | null, sent?: string): void;
|
|
169
221
|
received(authority: string, carry: string, index: number): void;
|
|
170
|
-
close(): void;
|
|
222
|
+
close(failure?: unknown): void;
|
|
171
223
|
};
|
|
172
224
|
export type HouseClosing = {
|
|
173
225
|
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":"
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,EACX,UAAU,EACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5E,eAAO,MAAM,mBAAmB;aAC9B,IAAI,YACF,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,wBAAwB,EACxB,4BAA4B,EAC5B,cAAc,EACd,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,QAAQ;aAEV,MAAM,YACJ,OAAO,EACP,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,cAAc,EACd,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,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,C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READS = {
|
|
2
3
|
acts: [
|
|
3
|
-
'
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'apps/source/top/read',
|
|
4
|
+
'account_update.set',
|
|
5
|
+
'app.screenshot',
|
|
6
|
+
'app.source',
|
|
7
|
+
'app_update.feature_set',
|
|
8
8
|
'conversations/history/list',
|
|
9
9
|
'files/attach',
|
|
10
|
-
'files/batch',
|
|
11
|
-
'files/batch-upload',
|
|
12
10
|
'files/finish',
|
|
13
11
|
'files/read',
|
|
14
12
|
'files/revisions/list',
|
|
13
|
+
'info',
|
|
15
14
|
'room-chunks/list',
|
|
16
15
|
'rooms/discover',
|
|
17
16
|
'rooms/search',
|
|
18
|
-
'
|
|
17
|
+
'update',
|
|
19
18
|
],
|
|
20
19
|
frames: [
|
|
20
|
+
'agent',
|
|
21
21
|
'app-message',
|
|
22
|
+
'app-rooms',
|
|
22
23
|
'authority_changed',
|
|
23
24
|
'carried',
|
|
24
25
|
'caught_up',
|
|
@@ -30,13 +31,16 @@ export const HOUSE_RUNTIME_READS = {
|
|
|
30
31
|
'deployment',
|
|
31
32
|
'held',
|
|
32
33
|
'interactions',
|
|
33
|
-
'link',
|
|
34
34
|
'message',
|
|
35
35
|
'opening',
|
|
36
36
|
'options',
|
|
37
37
|
'part',
|
|
38
38
|
'process',
|
|
39
39
|
'received',
|
|
40
|
+
'report',
|
|
41
|
+
'request',
|
|
42
|
+
'request_removed',
|
|
43
|
+
'requests',
|
|
40
44
|
'signal',
|
|
41
45
|
'site',
|
|
42
46
|
'starting',
|
|
@@ -51,6 +55,40 @@ export function houseDoorRoute(act) {
|
|
|
51
55
|
export function houseSiteRoute(act) {
|
|
52
56
|
return `/_house/door/${act}`;
|
|
53
57
|
}
|
|
58
|
+
export const SITE_QUERY = 'query';
|
|
59
|
+
export const SITE_FRESH_QUERY = 'fresh';
|
|
60
|
+
export const SITE_QUERY_ROUTE_CHARACTERS = 12_000;
|
|
61
|
+
function addressed(text) {
|
|
62
|
+
let binary = '';
|
|
63
|
+
for (const byte of new TextEncoder().encode(text))
|
|
64
|
+
binary += String.fromCharCode(byte);
|
|
65
|
+
return btoa(binary).replaceAll('+', '-').replaceAll('/', '_').replace(/=+$/u, '');
|
|
66
|
+
}
|
|
67
|
+
export function siteQueryRoute(room, query, fresh = false) {
|
|
68
|
+
const canonical = queryKey(JSON.parse(JSON.stringify(query)));
|
|
69
|
+
const named = fresh ? SITE_FRESH_QUERY : SITE_QUERY;
|
|
70
|
+
return `${houseSiteRoute('query')}/${room}?${named}=${addressed(canonical)}`;
|
|
71
|
+
}
|
|
72
|
+
export function siteQueryAsked(address) {
|
|
73
|
+
let asked;
|
|
74
|
+
try {
|
|
75
|
+
const binary = atob(address.replaceAll('-', '+').replaceAll('_', '/'));
|
|
76
|
+
const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
77
|
+
asked = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes));
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
return plain(asked) && addressed(queryKey(asked)) === address ? asked : null;
|
|
83
|
+
}
|
|
54
84
|
export const SITES_SUBMISSIONS_CREATE = 'sites/submissions/create';
|
|
55
85
|
export const SITE_DOOR_SUBMIT = '/_house/door/submit';
|
|
86
|
+
export const SITES_FUNCTIONS_CALL = 'sites/functions/call';
|
|
87
|
+
export const SITE_DOOR_FUNCTION = '/_house/door/function';
|
|
88
|
+
export const SITE_DOOR_ACTS = {
|
|
89
|
+
[SITES_SUBMISSIONS_CREATE]: { op: 'submission_create', route: SITE_DOOR_SUBMIT },
|
|
90
|
+
[SITES_FUNCTIONS_CALL]: { op: 'function_call', route: SITE_DOOR_FUNCTION },
|
|
91
|
+
};
|
|
92
|
+
export const SITE_DOOR_TOOL = 'app_update';
|
|
56
93
|
export const SITE_FILES = '/_house/files/';
|
|
94
|
+
export const SITE_IMAGE_COPIES_HEADER = 'X-House-Image-Copies';
|
|
@@ -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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TransportUncertainty } from '@agentshouse/mdruntime';
|
|
1
2
|
import { type HouseDoorAnswer, type HouseTransport } from './transport.js';
|
|
2
3
|
export type HouseUpload = {
|
|
3
4
|
readonly id: string;
|
|
@@ -8,4 +9,9 @@ export type HouseUpload = {
|
|
|
8
9
|
}[];
|
|
9
10
|
};
|
|
10
11
|
export declare function houseUpload(value: unknown): HouseUpload | null;
|
|
11
|
-
export declare function finishedUpload(transport: HouseTransport, first: HouseUpload, blob: Blob): Promise<HouseDoorAnswer |
|
|
12
|
+
export declare function finishedUpload(transport: HouseTransport, first: HouseUpload, blob: Blob): Promise<HouseDoorAnswer | {
|
|
13
|
+
readonly unfinished: number;
|
|
14
|
+
}>;
|
|
15
|
+
type StagedFile = (sha256: unknown) => Promise<Blob> | null;
|
|
16
|
+
export declare function stagedBatch(transport: HouseTransport, body: Readonly<Record<string, unknown>>, file: StagedFile): Promise<HouseDoorAnswer | TransportUncertainty>;
|
|
17
|
+
export {};
|
package/dist/upload.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGpF,OAAO,EAAkB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG3F,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;AAED,KAAK,UAAU,GAAG,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAsB5D,wBAAsB,WAAW,CAC/B,SAAS,EAAE,cAAc,EACzB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACvC,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,eAAe,GAAG,oBAAoB,CAAC,CAoBjD"}
|
package/dist/upload.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { sha256 } from '@agentshouse/mdruntime/digest';
|
|
2
|
+
import { answeredFailure, doorRefusal } from './refusal.js';
|
|
2
3
|
import { houseDoorRoute } from './transport.js';
|
|
4
|
+
import { unusable } from './uncertain.js';
|
|
3
5
|
const FINISHING_ROUNDS = 24;
|
|
4
6
|
function record(value) {
|
|
5
7
|
return value !== null && typeof value === 'object' ? value : {};
|
|
@@ -37,17 +39,19 @@ async function sent(transport, upload, blob, digests) {
|
|
|
37
39
|
for (const { part: number, url } of upload.parts) {
|
|
38
40
|
const start = (number - 1) * upload.partBytes;
|
|
39
41
|
const slice = blob.slice(start, start + upload.partBytes);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
const stored = await transport.put(url, slice, checksum(digests[number - 1]));
|
|
43
|
+
if (stored !== 200)
|
|
44
|
+
return stored;
|
|
42
45
|
}
|
|
43
|
-
return
|
|
46
|
+
return 200;
|
|
44
47
|
}
|
|
45
48
|
export async function finishedUpload(transport, first, blob) {
|
|
46
49
|
const digests = await partSha256(blob, first.partBytes);
|
|
47
50
|
let upload = first;
|
|
48
51
|
for (let round = 0; round < FINISHING_ROUNDS; round += 1) {
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
const stored = await sent(transport, upload, blob, digests);
|
|
53
|
+
if (stored !== 200)
|
|
54
|
+
return { unfinished: stored };
|
|
51
55
|
const answer = await transport.door(houseDoorRoute('files/finish'), {
|
|
52
56
|
upload: upload.id,
|
|
53
57
|
part_sha256: digests,
|
|
@@ -59,5 +63,44 @@ export async function finishedUpload(transport, first, blob) {
|
|
|
59
63
|
return answer;
|
|
60
64
|
upload = missing;
|
|
61
65
|
}
|
|
62
|
-
return
|
|
66
|
+
return { unfinished: 200 };
|
|
67
|
+
}
|
|
68
|
+
function unstagedRefusal(answer) {
|
|
69
|
+
const refusal = doorRefusal(answer.body);
|
|
70
|
+
return refusal?.code === 'files_unstaged' ? refusal : null;
|
|
71
|
+
}
|
|
72
|
+
async function staged(transport, named, file) {
|
|
73
|
+
const upload = houseUpload(named);
|
|
74
|
+
if (upload === null)
|
|
75
|
+
return unusable();
|
|
76
|
+
const blob = file(record(named).sha256);
|
|
77
|
+
if (blob === null)
|
|
78
|
+
return unusable();
|
|
79
|
+
const sent = await finishedUpload(transport, upload, await blob);
|
|
80
|
+
if ('unfinished' in sent)
|
|
81
|
+
return answeredFailure(sent.unfinished, null);
|
|
82
|
+
if (sent.status !== 200)
|
|
83
|
+
return answeredFailure(sent.status, sent.body);
|
|
84
|
+
return record(sent.body).staged === true ? null : unusable();
|
|
85
|
+
}
|
|
86
|
+
export async function stagedBatch(transport, body, file) {
|
|
87
|
+
let answer = await transport.door(houseDoorRoute('update'), body);
|
|
88
|
+
const finished = new Set();
|
|
89
|
+
for (let unstaged = unstagedRefusal(answer); unstaged !== null; unstaged = unstagedRefusal(answer)) {
|
|
90
|
+
const named = unstaged.fields.upload;
|
|
91
|
+
if (!Array.isArray(named))
|
|
92
|
+
return unusable();
|
|
93
|
+
const fresh = named.filter((upload) => !finished.has(record(upload).id));
|
|
94
|
+
if (fresh.length === 0)
|
|
95
|
+
return answeredFailure(answer.status, answer.body);
|
|
96
|
+
for (const upload of fresh) {
|
|
97
|
+
const staging = await staged(transport, upload, file);
|
|
98
|
+
if (staging !== null)
|
|
99
|
+
return staging;
|
|
100
|
+
}
|
|
101
|
+
for (const upload of fresh)
|
|
102
|
+
finished.add(record(upload).id);
|
|
103
|
+
answer = await transport.door(houseDoorRoute('update'), body);
|
|
104
|
+
}
|
|
105
|
+
return answer;
|
|
63
106
|
}
|
package/dist/write.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ChangeBatch, type HistoryResult, type MutationResult } from '@agentshouse/mdruntime';
|
|
1
|
+
import { type ChangeBatch, type HistoryResult, type MutationResult, type Written } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { HouseBounds } from './discovery.js';
|
|
3
3
|
export type HouseOperation = Readonly<Record<string, unknown>>;
|
|
4
4
|
export type ChangeMapping = {
|
|
@@ -9,19 +9,14 @@ export type ChangeMapping = {
|
|
|
9
9
|
path: string;
|
|
10
10
|
rule: string;
|
|
11
11
|
};
|
|
12
|
-
export declare function houseChanges(batch: ChangeBatch, handle: string): ChangeMapping;
|
|
13
|
-
export declare function houseParts(saved: readonly {
|
|
14
|
-
readonly path: string;
|
|
15
|
-
readonly parts: unknown;
|
|
16
|
-
}[], handle: string): ChangeMapping;
|
|
12
|
+
export declare function houseChanges(batch: ChangeBatch, handle: string, written: Written): ChangeMapping;
|
|
17
13
|
export declare function houseMove(batch: ChangeBatch, source: string, destination: string): ChangeMapping;
|
|
18
14
|
export type OperationHead = {
|
|
19
15
|
readonly operation_id: string;
|
|
20
|
-
readonly room_ref: string;
|
|
21
16
|
readonly app_ref?: string;
|
|
22
17
|
readonly release?: string;
|
|
23
18
|
};
|
|
24
|
-
export declare function operationHead(batch: ChangeBatch
|
|
19
|
+
export declare function operationHead(batch: ChangeBatch): OperationHead;
|
|
25
20
|
export declare function batchPaths(changes: readonly HouseOperation[]): readonly string[];
|
|
26
21
|
export declare function deltaBody(changes: readonly HouseOperation[]): string;
|
|
27
22
|
export declare function deltaBytes(delta: string): number;
|
package/dist/write.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src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