@agentshouse/mdruntime 0.1.0-c5d3fa6fb67bc → 0.1.0-c63ad08fad0c3
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/AGENTS.md +240 -220
- package/README.md +9 -8
- package/dist/adapter.d.ts +72 -24
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +4 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +13 -3
- package/dist/bootstrap.d.ts +26 -7
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +167 -82
- package/dist/chain.d.ts +11 -0
- package/dist/chain.d.ts.map +1 -0
- package/dist/chain.js +64 -0
- package/dist/change-set.d.ts +9 -16
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +11 -89
- package/dist/change.d.ts +31 -1
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +10 -1
- package/dist/chat/earlier.d.ts +10 -0
- package/dist/chat/earlier.d.ts.map +1 -0
- package/dist/chat/earlier.js +54 -0
- package/dist/chat/house.d.ts +25 -0
- package/dist/chat/house.d.ts.map +1 -0
- package/dist/chat/house.js +38 -0
- package/dist/chat/input.d.ts +3 -1
- package/dist/chat/input.d.ts.map +1 -1
- package/dist/chat/input.js +11 -18
- package/dist/chat/kit.js +1 -1
- package/dist/chat/list.d.ts +2 -1
- package/dist/chat/list.d.ts.map +1 -1
- package/dist/chat/list.js +45 -5
- package/dist/chat/markdown.d.ts +1 -0
- package/dist/chat/markdown.d.ts.map +1 -1
- package/dist/chat/markdown.js +78 -20
- package/dist/chat/message.d.ts +1 -0
- package/dist/chat/message.d.ts.map +1 -1
- package/dist/chat/message.js +73 -11
- package/dist/chat/messages.d.ts +14 -1
- package/dist/chat/messages.d.ts.map +1 -1
- package/dist/chat/messages.js +79 -24
- package/dist/chat/name.d.ts +1 -0
- package/dist/chat/name.d.ts.map +1 -1
- package/dist/chat/name.js +1 -1
- package/dist/chat/opened.d.ts +1 -0
- package/dist/chat/opened.d.ts.map +1 -1
- package/dist/chat/opened.js +2 -0
- package/dist/chat/overlay.d.ts +1 -0
- package/dist/chat/overlay.d.ts.map +1 -1
- package/dist/chat/overlay.js +11 -5
- package/dist/chat/parts.d.ts +1 -0
- package/dist/chat/parts.d.ts.map +1 -1
- package/dist/chat/parts.js +3 -2
- package/dist/chat/pieces.d.ts +62 -0
- package/dist/chat/pieces.d.ts.map +1 -0
- package/dist/chat/pieces.js +1110 -0
- package/dist/chat/provider.d.ts +8 -1
- package/dist/chat/provider.d.ts.map +1 -1
- package/dist/chat/provider.js +98 -92
- package/dist/chat/question.d.ts +1 -1
- package/dist/chat/question.d.ts.map +1 -1
- package/dist/chat/question.js +7 -18
- package/dist/chat/ready.d.ts +5 -2
- package/dist/chat/ready.d.ts.map +1 -1
- package/dist/chat/ready.js +7 -5
- package/dist/chat/room-file.d.ts +8 -0
- package/dist/chat/room-file.d.ts.map +1 -0
- package/dist/chat/room-file.js +72 -0
- package/dist/chat/steady.d.ts +3 -0
- package/dist/chat/steady.d.ts.map +1 -0
- package/dist/chat/steady.js +26 -0
- package/dist/chat/style.d.ts.map +1 -1
- package/dist/chat/style.js +6 -1
- package/dist/chat.d.ts +3 -2
- package/dist/chat.d.ts.map +1 -1
- package/dist/chat.js +2 -2
- package/dist/client.d.ts +11 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +45 -7
- package/dist/collection.d.ts +6 -19
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +30 -287
- package/dist/compile.d.ts +16 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +721 -0
- package/dist/connection.d.ts +22 -8
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +2509 -830
- package/dist/conversation.d.ts +15 -3
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +238 -94
- package/dist/digest.d.ts +7 -0
- package/dist/digest.d.ts.map +1 -0
- package/dist/digest.js +113 -0
- package/dist/durability.d.ts +3 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/entry.d.ts +3 -1
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +18 -23
- package/dist/file.d.ts +2 -10
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +3 -120
- package/dist/fulltext.d.ts +27 -0
- package/dist/fulltext.d.ts.map +1 -0
- package/dist/fulltext.js +368 -0
- package/dist/host.d.ts +5 -4
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +57 -7
- package/dist/identity.d.ts +0 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +0 -3
- package/dist/index.d.ts +12 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/live.d.ts +22 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +123 -0
- package/dist/memory.d.ts +7 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +39 -17
- package/dist/messages.d.ts +28 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +90 -0
- package/dist/name.d.ts +4 -0
- package/dist/name.d.ts.map +1 -0
- package/dist/name.js +122 -0
- package/dist/observation.d.ts +14 -0
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +93 -3
- package/dist/opened.d.ts +22 -0
- package/dist/opened.d.ts.map +1 -0
- package/dist/opened.js +107 -0
- package/dist/outcome.d.ts +35 -4
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +28 -0
- package/dist/overlay.d.ts +2 -5
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +86 -171
- package/dist/query.d.ts +29 -2
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +46 -7
- package/dist/reach.d.ts +5 -1
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +167 -48
- package/dist/react.d.ts +3 -3
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +7 -17
- package/dist/readiness.d.ts +18 -3
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +1 -1
- package/dist/reads.d.ts +11 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +100 -0
- package/dist/recovery.d.ts +2 -2
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +8 -7
- package/dist/refresh.d.ts +13 -15
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +78 -51
- package/dist/replica.d.ts +57 -33
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +295 -186
- package/dist/room-draft.d.ts +15 -1
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +32 -25
- package/dist/rows.d.ts +29 -30
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +113 -64
- package/dist/save.d.ts +51 -14
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +518 -180
- package/dist/search.d.ts +25 -42
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +30 -169
- package/dist/seed.d.ts +16 -0
- package/dist/seed.d.ts.map +1 -0
- package/dist/seed.js +75 -0
- package/dist/shared.d.ts +8 -3
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +129 -66
- package/dist/store.d.ts +97 -88
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +335 -659
- package/dist/stored.d.ts +145 -0
- package/dist/stored.d.ts.map +1 -0
- package/dist/stored.js +567 -0
- package/dist/tables.d.ts +342 -0
- package/dist/tables.d.ts.map +1 -0
- package/dist/tables.js +576 -0
- package/dist/turn.d.ts +5 -3
- package/dist/turn.d.ts.map +1 -1
- package/dist/turn.js +51 -21
- package/dist/validation.d.ts +30 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +162 -0
- package/dist/windows.d.ts +22 -0
- package/dist/windows.d.ts.map +1 -0
- package/dist/windows.js +89 -0
- package/dist/wire.d.ts +32 -0
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +8 -0
- package/dist/words.d.ts +19 -0
- package/dist/words.d.ts.map +1 -0
- package/dist/words.js +150 -0
- package/package.json +10 -4
- package/dist/acquisition.d.ts +0 -14
- package/dist/acquisition.d.ts.map +0 -1
- package/dist/acquisition.js +0 -24
- package/dist/read-side.d.ts +0 -25
- package/dist/read-side.d.ts.map +0 -1
- package/dist/read-side.js +0 -642
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import FileGlyph from 'lucide-react/dist/esm/icons/file.mjs';
|
|
4
|
+
import { useObserve } from '../react.js';
|
|
5
|
+
import { Name } from './kit.js';
|
|
6
|
+
import { useChatScope } from './provider.js';
|
|
7
|
+
const ROOM_PATH = /^\/rooms\/([^/]+)\/(.+)$/u;
|
|
8
|
+
const INLINE_IMAGE = /^image\/(?:png|jpeg|gif|webp)$/u;
|
|
9
|
+
const NOTHING = { rooms: [], select: {} };
|
|
10
|
+
export function isRoomPath(href) {
|
|
11
|
+
return ROOM_PATH.test(href);
|
|
12
|
+
}
|
|
13
|
+
function useHeld(href) {
|
|
14
|
+
const { client } = useChatScope();
|
|
15
|
+
const rooms = useObserve(client, 'rooms');
|
|
16
|
+
const [, handle, path] = ROOM_PATH.exec(href) ?? [];
|
|
17
|
+
const locator = rooms.state === 'ready'
|
|
18
|
+
? (rooms.value.find((room) => room.handle === handle)?.locator ?? null)
|
|
19
|
+
: null;
|
|
20
|
+
const query = useMemo(() => locator === null || path === undefined
|
|
21
|
+
? null
|
|
22
|
+
: { rooms: [locator], paths: [path], select: {} }, [locator, path]);
|
|
23
|
+
const found = useObserve(query === null ? null : client, 'query', query ?? NOTHING);
|
|
24
|
+
if (locator === null || path === undefined || found.state !== 'ready')
|
|
25
|
+
return null;
|
|
26
|
+
const held = 'documents' in found.value ? found.value.documents[0]?.binaryFile : undefined;
|
|
27
|
+
return held?.state === 'accepted'
|
|
28
|
+
? { locator, path, revision: held.revision, mediaType: held.mediaType }
|
|
29
|
+
: null;
|
|
30
|
+
}
|
|
31
|
+
function Picture({ held, name }) {
|
|
32
|
+
const { client } = useChatScope();
|
|
33
|
+
const [address, setAddress] = useState(null);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
let live = true;
|
|
36
|
+
let made = null;
|
|
37
|
+
void client.binaryFile
|
|
38
|
+
.read(held.locator, held.path, held.revision)
|
|
39
|
+
.then((answer) => answer.kind === 'binary'
|
|
40
|
+
? new Response(answer.stream, { headers: { 'content-type': answer.mediaType } }).blob()
|
|
41
|
+
: null)
|
|
42
|
+
.then((blob) => {
|
|
43
|
+
if (!live || blob === null)
|
|
44
|
+
return;
|
|
45
|
+
made = URL.createObjectURL(blob);
|
|
46
|
+
setAddress(made);
|
|
47
|
+
});
|
|
48
|
+
return () => {
|
|
49
|
+
live = false;
|
|
50
|
+
if (made !== null)
|
|
51
|
+
URL.revokeObjectURL(made);
|
|
52
|
+
};
|
|
53
|
+
}, [client, held.locator, held.path, held.revision]);
|
|
54
|
+
return address === null ? null : _jsx("img", { className: "ahc-picture", src: address, alt: name });
|
|
55
|
+
}
|
|
56
|
+
function Opened({ held, name }) {
|
|
57
|
+
const { client } = useChatScope();
|
|
58
|
+
const open = () => void client.binaryFile.link(held.locator, held.path, held.revision).then((answer) => {
|
|
59
|
+
if (answer.kind !== 'link')
|
|
60
|
+
return;
|
|
61
|
+
const anchor = document.createElement('a');
|
|
62
|
+
anchor.href = answer.url;
|
|
63
|
+
anchor.click();
|
|
64
|
+
});
|
|
65
|
+
return (_jsxs("button", { type: "button", className: "ahc-chip", onClick: open, children: [_jsx(FileGlyph, { "aria-hidden": "true" }), _jsx(Name, { text: name })] }));
|
|
66
|
+
}
|
|
67
|
+
export function RoomFile({ href, name, otherwise, }) {
|
|
68
|
+
const held = useHeld(href);
|
|
69
|
+
if (held === null)
|
|
70
|
+
return otherwise;
|
|
71
|
+
return INLINE_IMAGE.test(held.mediaType) ? (_jsx(Picture, { held: held, name: name })) : (_jsx(Opened, { held: held, name: name }));
|
|
72
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steady.d.ts","sourceRoot":"","sources":["../../src/chat/steady.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAwB3D,wBAAgB,SAAS,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,GAAG,gBAAgB,GAAG,IAAI,CAMhF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
function same(held, now) {
|
|
3
|
+
return (held.turn === now.turn &&
|
|
4
|
+
held.text === now.text &&
|
|
5
|
+
JSON.stringify(held.message) === JSON.stringify(now.message));
|
|
6
|
+
}
|
|
7
|
+
function steadied(before, after) {
|
|
8
|
+
if (before === null || before.conversation !== after.conversation)
|
|
9
|
+
return after;
|
|
10
|
+
const held = new Map(before.messages.map((one) => [one.identity, one]));
|
|
11
|
+
return {
|
|
12
|
+
...after,
|
|
13
|
+
messages: after.messages.map((one) => {
|
|
14
|
+
const was = held.get(one.identity);
|
|
15
|
+
return was !== undefined && same(was, one) ? was : one;
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function useSteady(held) {
|
|
20
|
+
const [steady, setSteady] = useState({ from: held, view: held });
|
|
21
|
+
if (steady.from === held)
|
|
22
|
+
return steady.view;
|
|
23
|
+
const view = held === null ? null : steadied(steady.view, held);
|
|
24
|
+
setSteady({ from: held, view });
|
|
25
|
+
return view;
|
|
26
|
+
}
|
package/dist/chat/style.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/chat/style.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,eAAO,MAAM,kBAAkB,QAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/chat/style.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,eAAO,MAAM,kBAAkB,QAAsB,CAAC;AAgTtD,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CASrD"}
|
package/dist/chat/style.js
CHANGED
|
@@ -209,7 +209,7 @@ const CSS = `
|
|
|
209
209
|
.ahc-deleted__icon { flex: none; display: flex; padding-top: 2px; }
|
|
210
210
|
|
|
211
211
|
.ahc-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; }
|
|
212
|
-
.ahc-viewport { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
|
|
212
|
+
.ahc-viewport { flex: 1; min-height: 0; overflow-y: auto; overflow-anchor: none; display: flex; flex-direction: column; }
|
|
213
213
|
.ahc-column { max-width: var(--ahc-column); margin: 0 var(--ahc-gutter); display: flex; flex-direction: column; font-size: var(--ahc-read); line-height: var(--ahc-read-lead); }
|
|
214
214
|
.ahc-messages { flex: 1; }
|
|
215
215
|
.ahc-footer { position: sticky; z-index: 2; bottom: 0; padding-bottom: var(--ahc-block); background: var(--ahc-bg); }
|
|
@@ -223,6 +223,11 @@ const CSS = `
|
|
|
223
223
|
.ahc-you { align-self: flex-end; max-width: 85%; display: flex; flex-direction: column; align-items: flex-end; }
|
|
224
224
|
.ahc-bubble { max-width: 100%; padding: 10px var(--ahc-stack); border-radius: var(--ahc-r-bubble); background: var(--ahc-well); font-size: var(--ahc-read); line-height: var(--ahc-read-lead); text-wrap: pretty; }
|
|
225
225
|
.ahc-said { white-space: pre-wrap; }
|
|
226
|
+
.ahc-transcript { display: block; margin-block: var(--ahc-unit); }
|
|
227
|
+
.ahc-picture { display: block; max-width: 100%; max-height: 320px; border-radius: var(--ahc-r-control); }
|
|
228
|
+
.ahc-house { display: flex; flex-direction: column; gap: var(--ahc-unit); padding: var(--ahc-inset) var(--ahc-stack); border: 1px solid var(--ahc-line); border-radius: var(--ahc-r-tile); font-size: var(--ahc-read); line-height: var(--ahc-read-lead); }
|
|
229
|
+
.ahc-house__from { display: flex; flex-direction: column; }
|
|
230
|
+
.ahc-house__title { font-size: var(--ahc-meta); line-height: var(--ahc-meta-lead); font-weight: 500; }
|
|
226
231
|
.ahc-turn { position: relative; display: flex; flex-direction: column; min-width: 0; }
|
|
227
232
|
.ahc-text { margin: 0; font-size: var(--ahc-read); line-height: var(--ahc-read-lead); text-wrap: pretty; }
|
|
228
233
|
.ahc-text > :first-child { margin-top: 0; }
|
package/dist/chat.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
export { ChatProvider, useChat, type ChatActing, type ChatOpened, type ChatProviderProps, type ChatQueued, type ChatState, } from './chat/provider.js';
|
|
2
|
-
export { chatMessages } from './chat/messages.js';
|
|
2
|
+
export { awaitsTurn, chatMessages } from './chat/messages.js';
|
|
3
3
|
export { Chat, mountChat, type ChatProps, type ChatWidth, type MountedChat } from './chat/ready.js';
|
|
4
4
|
export { ChatMessageList, type ChatMessageListProps } from './chat/list.js';
|
|
5
5
|
export { ChatInput, type ChatInputProps } from './chat/input.js';
|
|
6
6
|
export { ChatQuestionCard, type ChatQuestionCardProps } from './chat/question.js';
|
|
7
7
|
export type { ChatNoteProps } from './chat/kit.js';
|
|
8
8
|
export { ChatName } from './chat/name.js';
|
|
9
|
-
export { Markdown, anchorOf, plainText, slugOf, type FileReference, type MarkdownProps, } from './chat/markdown.js';
|
|
9
|
+
export { Markdown, anchorOf, plainText, revealed, slugOf, type FileReference, type MarkdownProps, } from './chat/markdown.js';
|
|
10
10
|
export type { ChatOutcome } from './chat/acts.js';
|
|
11
|
+
export type { ChatRequest } from './chat/house.js';
|
|
11
12
|
export type { ChatWork } from './chat/parts.js';
|
|
12
13
|
export type { ChatCommand, ChatOption, ChatOptionValue } from './chat/process.js';
|
|
13
14
|
export type { ChatAnswer, ChatChoice, ChatField, ChatLone, ChatQuestion, } from './chat/questions.js';
|
package/dist/chat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../src/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,OAAO,EACP,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,SAAS,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../src/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,OAAO,EACP,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,SAAS,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClF,YAAY,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EACR,YAAY,GACb,MAAM,qBAAqB,CAAC"}
|
package/dist/chat.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { ChatProvider, useChat, } from './chat/provider.js';
|
|
2
|
-
export { chatMessages } from './chat/messages.js';
|
|
2
|
+
export { awaitsTurn, chatMessages } from './chat/messages.js';
|
|
3
3
|
export { Chat, mountChat } from './chat/ready.js';
|
|
4
4
|
export { ChatMessageList } from './chat/list.js';
|
|
5
5
|
export { ChatInput } from './chat/input.js';
|
|
6
6
|
export { ChatQuestionCard } from './chat/question.js';
|
|
7
7
|
export { ChatName } from './chat/name.js';
|
|
8
|
-
export { Markdown, anchorOf, plainText, slugOf, } from './chat/markdown.js';
|
|
8
|
+
export { Markdown, anchorOf, plainText, revealed, slugOf, } from './chat/markdown.js';
|
package/dist/client.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { AppRoom, ConnectionRefusal, HistoryQuery, RoomSchemas, SavedRoomDraft, SaveResult } from './connection.js';
|
|
1
|
+
import type { AppRoom, ConnectionRefusal, HistoryQuery, RoomSchemas, SavedParts, SavedRoomDraft, SaveResult } from './connection.js';
|
|
2
2
|
import type { Member, ServiceMode } from './adapter.js';
|
|
3
3
|
import type { ChatDraft, ConversationAgent, ConversationEntry, ConversationOptions, ConversationView } from './conversation.js';
|
|
4
4
|
import { type Observation } from './observation.js';
|
|
5
5
|
import type { BinaryReference } from './binary.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { ChosenFile } from './file.js';
|
|
7
|
+
import type { BinaryAnswer, BinaryLinkAnswer, CallResult, HistoryAnswer, Offline, QueueEntry, Resolution } from './outcome.js';
|
|
7
8
|
import type { DocumentQuery, DocumentResult, GroupQuery, GroupResult, PendingResult } from './query.js';
|
|
8
9
|
import type { RoomDraft, RoomDraftParts, RoomDraftWrite } from './room-draft.js';
|
|
9
10
|
import type { SearchRequest, SearchResult } from './search.js';
|
|
@@ -25,15 +26,18 @@ export type MdRuntimeClient = {
|
|
|
25
26
|
discard(room: string, path: string, revision: string): Promise<RoomDraftWrite>;
|
|
26
27
|
};
|
|
27
28
|
save(room: string, roomDrafts: readonly SavedRoomDraft[]): Promise<SaveResult>;
|
|
29
|
+
saveParts(room: string, parts: readonly SavedParts[]): Promise<SaveResult>;
|
|
28
30
|
presentation: {
|
|
29
31
|
read(): Promise<unknown>;
|
|
30
32
|
write(value: unknown): Promise<void>;
|
|
33
|
+
edit(members: Readonly<Record<string, unknown>>): Promise<void>;
|
|
31
34
|
};
|
|
32
35
|
conversation: {
|
|
33
36
|
list(): Promise<readonly ConversationEntry[]>;
|
|
34
37
|
read(conversation: string, options?: ConversationOptions): Promise<ConversationView>;
|
|
35
38
|
create(input: unknown): Promise<CallResult>;
|
|
36
39
|
send(conversation: string, operation?: string, draft?: ChatDraft): Promise<CallResult | Offline>;
|
|
40
|
+
attach(room: string, file: ChosenFile): Promise<CallResult | Offline>;
|
|
37
41
|
answer(conversation: string, answer: unknown): Promise<CallResult>;
|
|
38
42
|
interrupt(conversation: string): Promise<CallResult>;
|
|
39
43
|
kill(conversation: string): Promise<CallResult>;
|
|
@@ -42,11 +46,14 @@ export type MdRuntimeClient = {
|
|
|
42
46
|
};
|
|
43
47
|
chatDraft: {
|
|
44
48
|
write(conversation: string, draft: ChatDraft, revision?: string): Promise<void>;
|
|
49
|
+
prepend(conversation: string, draft: ChatDraft): Promise<void>;
|
|
45
50
|
discard(conversation: string): Promise<void>;
|
|
46
51
|
};
|
|
47
52
|
history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
|
|
53
|
+
resolve(room: string, path: string, destination: string): Promise<Resolution>;
|
|
48
54
|
binaryFile: {
|
|
49
55
|
read(room: string, path: string, revision?: string): Promise<BinaryAnswer>;
|
|
56
|
+
link(room: string, path: string, revision?: string): Promise<BinaryLinkAnswer>;
|
|
50
57
|
readReference(reference: BinaryReference): Promise<BinaryAnswer>;
|
|
51
58
|
};
|
|
52
59
|
call(name: string, input: unknown): Promise<CallResult>;
|
|
@@ -54,6 +61,7 @@ export type MdRuntimeClient = {
|
|
|
54
61
|
log(): Promise<string>;
|
|
55
62
|
persistence(): Promise<boolean>;
|
|
56
63
|
retry(): Promise<void>;
|
|
64
|
+
cleanUp(): Promise<number>;
|
|
57
65
|
observe: {
|
|
58
66
|
(topic: 'deployment-facts'): Promise<Observation<unknown>>;
|
|
59
67
|
(topic: 'rooms'): Promise<Observation<readonly AppRoom[]>>;
|
|
@@ -77,6 +85,7 @@ export type MdRuntimeClient = {
|
|
|
77
85
|
};
|
|
78
86
|
export declare function connectMdRuntime(port: RuntimePort): MdRuntimeClient;
|
|
79
87
|
export declare function inTurn(client: MdRuntimeClient, work: () => Promise<void>): Promise<void>;
|
|
88
|
+
export { chainedWindows, type WindowAnswer, type WindowChain } from './chain.js';
|
|
80
89
|
export type { Observation } from './observation.js';
|
|
81
90
|
export type { Open } from './open.js';
|
|
82
91
|
export { unanswered, type RuntimePort, type WireMember } from './wire.js';
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,UAAU,EACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAY,KAAK,WAAW,EAAiB,MAA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K,EAAE,cAAc,EACrB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC1C,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,iBAAiB,EAAE,CAAC,CAAC,CAAC;QAC7E,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,iBAAiB,EAAE,CAAC,CAAC,CAAC;KACvE,CAAC;IACF,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B,CAAC;AAMF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,eAAe,CA+PnE;AAID,wBAAgB,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAUxF;AAED,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AACjF,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/client.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { observed } from './observation.js';
|
|
2
2
|
import { runtimeError } from './failure.js';
|
|
3
3
|
import { answer, AUTHORIZATION_ENDED, PORT_CLOSED, } from './wire.js';
|
|
4
|
+
// React renders an arrived value in a later task and opens what that render observes as it commits, so this many frames opening nothing mean the page drew what it observes.
|
|
5
|
+
const SETTLED_FRAMES = 2;
|
|
4
6
|
function refused(refusal) {
|
|
5
7
|
return runtimeError(refusal.code, refusal.code, refusal.retryable);
|
|
6
8
|
}
|
|
@@ -131,6 +133,29 @@ export function connectMdRuntime(port) {
|
|
|
131
133
|
drawing?.();
|
|
132
134
|
});
|
|
133
135
|
}
|
|
136
|
+
function streamed(answer) {
|
|
137
|
+
if (answer.kind !== 'binary')
|
|
138
|
+
return answer;
|
|
139
|
+
const { file, byteLength, mediaType } = answer;
|
|
140
|
+
let part = 0;
|
|
141
|
+
let received = 0;
|
|
142
|
+
const stream = new ReadableStream({
|
|
143
|
+
async pull(controller) {
|
|
144
|
+
const bytes = await ask('binaryFile.part', [file, part]);
|
|
145
|
+
if (bytes === null) {
|
|
146
|
+
if (received === byteLength)
|
|
147
|
+
controller.close();
|
|
148
|
+
else
|
|
149
|
+
controller.error(runtimeError('binary-file-absent', 'The file ended early'));
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
part += 1;
|
|
153
|
+
received += bytes.byteLength;
|
|
154
|
+
controller.enqueue(bytes);
|
|
155
|
+
},
|
|
156
|
+
}, { highWaterMark: 0 });
|
|
157
|
+
return { kind: 'binary', stream, byteLength, mediaType };
|
|
158
|
+
}
|
|
134
159
|
function settled() {
|
|
135
160
|
if (settling !== null)
|
|
136
161
|
return settling;
|
|
@@ -141,14 +166,19 @@ export function connectMdRuntime(port) {
|
|
|
141
166
|
if (opening.size > 0)
|
|
142
167
|
return;
|
|
143
168
|
const at = moved;
|
|
144
|
-
|
|
169
|
+
const waited = (frames) => {
|
|
145
170
|
requestAnimationFrame(() => {
|
|
171
|
+
if (frames < SETTLED_FRAMES) {
|
|
172
|
+
waited(frames + 1);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
146
175
|
if (moved !== at || opening.size > 0)
|
|
147
176
|
return;
|
|
148
177
|
drawing = null;
|
|
149
178
|
resolve();
|
|
150
179
|
});
|
|
151
|
-
}
|
|
180
|
+
};
|
|
181
|
+
waited(1);
|
|
152
182
|
};
|
|
153
183
|
drawing = check;
|
|
154
184
|
check();
|
|
@@ -167,15 +197,18 @@ export function connectMdRuntime(port) {
|
|
|
167
197
|
discard: (room, path, revision) => ask('roomDraft.discard', [room, path, revision]),
|
|
168
198
|
},
|
|
169
199
|
save: (room, roomDrafts) => ask('save', [room, roomDrafts]),
|
|
200
|
+
saveParts: (room, parts) => ask('saveParts', [room, parts]),
|
|
170
201
|
presentation: {
|
|
171
202
|
read: () => ask('presentation.read', []),
|
|
172
203
|
write: (value) => ask('presentation.write', [value]),
|
|
204
|
+
edit: (members) => ask('presentation.edit', [members]),
|
|
173
205
|
},
|
|
174
206
|
conversation: {
|
|
175
207
|
list: () => ask('conversation.list', []),
|
|
176
208
|
read: (conversation, options) => ask('conversation.read', [conversation, options]),
|
|
177
209
|
create: (input) => ask('conversation.create', [input]),
|
|
178
210
|
send: (conversation, operation, draft) => ask('conversation.send', [conversation, operation, draft]),
|
|
211
|
+
attach: (room, file) => ask('conversation.attach', [room, file]),
|
|
179
212
|
answer: (conversation, answer) => ask('conversation.answer', [conversation, answer]),
|
|
180
213
|
interrupt: (conversation) => ask('conversation.interrupt', [conversation]),
|
|
181
214
|
kill: (conversation) => ask('conversation.kill', [conversation]),
|
|
@@ -184,18 +217,22 @@ export function connectMdRuntime(port) {
|
|
|
184
217
|
},
|
|
185
218
|
chatDraft: {
|
|
186
219
|
write: (conversation, draft, revision) => ask('chatDraft.write', [conversation, draft, revision]),
|
|
220
|
+
prepend: (conversation, draft) => ask('chatDraft.prepend', [conversation, draft]),
|
|
187
221
|
discard: (conversation) => ask('chatDraft.discard', [conversation]),
|
|
188
222
|
},
|
|
189
223
|
history: (locator, path, query) => ask('history', [locator, path, query]),
|
|
224
|
+
resolve: (room, path, destination) => ask('resolve', [room, path, destination]),
|
|
190
225
|
binaryFile: {
|
|
191
|
-
read: (room, path, revision) => ask('binaryFile.read', [room, path, revision]),
|
|
192
|
-
|
|
226
|
+
read: (room, path, revision) => ask('binaryFile.read', [room, path, revision]).then(streamed),
|
|
227
|
+
link: (room, path, revision) => ask('binaryFile.link', [room, path, revision]),
|
|
228
|
+
readReference: (reference) => ask('binaryFile.readReference', [reference]).then(streamed),
|
|
193
229
|
},
|
|
194
230
|
call: (name, input) => ask('call', [name, input]),
|
|
195
231
|
reached: (locator, roomVersion, path) => ask('reached', [locator, roomVersion, path]),
|
|
196
232
|
log: () => ask('log', []),
|
|
197
233
|
persistence: () => ask('persistence', []),
|
|
198
234
|
retry: () => ask('retry', []),
|
|
235
|
+
cleanUp: () => ask('cleanUp', []),
|
|
199
236
|
observe: ((topic, ...input) => watch(topic, input)),
|
|
200
237
|
reauthorize: () => ask('reauthorize', []),
|
|
201
238
|
settled,
|
|
@@ -203,8 +240,9 @@ export function connectMdRuntime(port) {
|
|
|
203
240
|
}
|
|
204
241
|
const turns = new WeakMap();
|
|
205
242
|
export function inTurn(client, work) {
|
|
206
|
-
const
|
|
207
|
-
turns.set(client,
|
|
208
|
-
return
|
|
243
|
+
const turn = (turns.get(client) ?? Promise.resolve()).then(work);
|
|
244
|
+
turns.set(client, turn.then(() => undefined, () => undefined));
|
|
245
|
+
return turn;
|
|
209
246
|
}
|
|
247
|
+
export { chainedWindows } from './chain.js';
|
|
210
248
|
export { unanswered } from './wire.js';
|
package/dist/collection.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { type Document
|
|
2
|
-
import {
|
|
1
|
+
import { type Document } from '@agentshouse/mdmodel';
|
|
2
|
+
import type { ModelState } from './model.js';
|
|
3
3
|
import type { MdModelIdentity } from './adapter.js';
|
|
4
4
|
import { type Paths } from './shared.js';
|
|
5
5
|
import type { Refused } from './transfer.js';
|
|
6
|
-
import { type Later } from './turn.js';
|
|
7
6
|
export declare const MD_MODEL: MdModelIdentity;
|
|
8
7
|
export type Collection = {
|
|
9
8
|
text: Readonly<Record<string, string>>;
|
|
@@ -17,23 +16,11 @@ export type Composition = {
|
|
|
17
16
|
model: ModelState;
|
|
18
17
|
} | null;
|
|
19
18
|
};
|
|
19
|
+
export declare function selected(composition: Composition, path: string): boolean;
|
|
20
20
|
export declare function governing(composition: Composition, path: string): ModelState;
|
|
21
|
-
export declare function collectionOf(text: Readonly<Record<string, string>>, composition: Composition
|
|
22
|
-
export declare function
|
|
23
|
-
export declare function
|
|
24
|
-
export declare function unreadable(text: Readonly<Record<string, string>>, previous?: Readonly<Record<string, string>>): Refused | null;
|
|
21
|
+
export declare function collectionOf(text: Readonly<Record<string, string>>, composition: Composition): Collection;
|
|
22
|
+
export declare function documentsOf(collection: Collection): Generator<number, Iterable<readonly [string, Document]>, void>;
|
|
23
|
+
export declare function unreadable(text: Paths<string>, paths?: Iterable<string> | null): Generator<number, Refused | null, void>;
|
|
25
24
|
export declare function validRoot(root: unknown): root is string;
|
|
26
|
-
export declare function validateCollection(text: Readonly<Record<string, string>>, binaryTargets: readonly string[], composition: Composition): Validation;
|
|
27
|
-
type Held = {
|
|
28
|
-
text: Paths<string>;
|
|
29
|
-
binaries: Paths<unknown>;
|
|
30
|
-
};
|
|
31
|
-
export declare function indexReferrers(held: Held, composition: Composition): Later<void>;
|
|
32
|
-
export declare function referencesIndexed(held: Held, composition: Composition): boolean;
|
|
33
|
-
export declare function referring(held: Held, composition: Composition, targets: Iterable<string>): ReadonlySet<string> | null;
|
|
34
25
|
export declare function available(composition: Composition): boolean;
|
|
35
|
-
export declare function changedCleanly(next: Held, previous: Held & {
|
|
36
|
-
composition: Composition;
|
|
37
|
-
}, composition: Composition): boolean;
|
|
38
|
-
export {};
|
|
39
26
|
//# sourceMappingURL=collection.d.ts.map
|
package/dist/collection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,KAAK,EAAE,UAAU,EAAE,MA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