@agentshouse/mdruntime 0.1.0-c5d3fa6fb67bc → 0.1.0-c6636685d0c4b
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 +205 -205
- package/README.md +8 -8
- package/dist/adapter.d.ts +36 -9
- package/dist/adapter.d.ts.map +1 -1
- package/dist/bootstrap.d.ts +2 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +1 -1
- package/dist/change-set.d.ts +5 -2
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +6 -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/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 +12 -2
- package/dist/chat/messages.d.ts +2 -0
- package/dist/chat/messages.d.ts.map +1 -1
- package/dist/chat/messages.js +52 -20
- package/dist/chat/overlay.d.ts +1 -0
- package/dist/chat/overlay.d.ts.map +1 -1
- package/dist/chat/overlay.js +10 -0
- 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 +1 -0
- package/dist/chat/provider.d.ts.map +1 -1
- package/dist/chat/provider.js +23 -14
- 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 +1 -1
- package/dist/chat/ready.d.ts.map +1 -1
- package/dist/chat/ready.js +1 -1
- 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.js +1 -1
- package/dist/chat.d.ts +2 -2
- package/dist/chat.d.ts.map +1 -1
- package/dist/chat.js +2 -2
- package/dist/client.d.ts +6 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +16 -5
- package/dist/collection.d.ts +4 -3
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +128 -63
- package/dist/connection.d.ts +12 -4
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +577 -217
- package/dist/conversation.d.ts +12 -0
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +196 -41
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +2 -1
- package/dist/host.d.ts +5 -4
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +45 -5
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/memory.d.ts +6 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +17 -11
- package/dist/observation.d.ts +2 -0
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +9 -3
- package/dist/outcome.d.ts +14 -2
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +7 -0
- package/dist/overlay.d.ts +4 -4
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +181 -140
- package/dist/query.d.ts +26 -2
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +34 -6
- package/dist/reach.d.ts +4 -1
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +90 -21
- package/dist/react.d.ts +3 -3
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +7 -17
- package/dist/read-side.d.ts +3 -1
- package/dist/read-side.d.ts.map +1 -1
- package/dist/read-side.js +271 -82
- package/dist/reads.d.ts +11 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +98 -0
- package/dist/refresh.d.ts +4 -4
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +35 -16
- package/dist/replica.d.ts +11 -5
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +69 -40
- package/dist/room-draft.d.ts +12 -0
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +11 -12
- package/dist/rows.d.ts +1 -0
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +5 -0
- package/dist/save.d.ts +4 -2
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +195 -111
- package/dist/search.d.ts +17 -2
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +81 -7
- 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 +4 -0
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +63 -33
- package/dist/store.d.ts +18 -2
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +398 -316
- package/dist/turn.d.ts +5 -3
- package/dist/turn.d.ts.map +1 -1
- package/dist/turn.js +26 -7
- package/dist/windows.d.ts +26 -0
- package/dist/windows.d.ts.map +1 -0
- package/dist/windows.js +93 -0
- package/dist/wire.d.ts +16 -0
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +4 -0
- package/package.json +2 -2
- package/dist/acquisition.d.ts +0 -14
- package/dist/acquisition.d.ts.map +0 -1
- package/dist/acquisition.js +0 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/chat/message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/chat/message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AAoCf,eAAO,MAAM,MAAM,kCAAyB,MAAM,KAAK,IAAI,SAAe,CAAC;AA2O3E,wBAAgB,WAAW,IAAI,YAAY,CA+B1C;AAED,wBAAgB,YAAY,IAAI,YAAY,CAM3C;AAmBD,wBAAgB,WAAW,IAAI,YAAY,CAE1C;AAED,wBAAgB,gBAAgB,IAAI,YAAY,CA0F/C"}
|
package/dist/chat/message.js
CHANGED
|
@@ -23,6 +23,7 @@ import Terminal from 'lucide-react/dist/esm/icons/terminal.mjs';
|
|
|
23
23
|
import { SESSION_STARTED } from '../conversation.js';
|
|
24
24
|
import { buttonClass, Name, Working } from './kit.js';
|
|
25
25
|
import { StillRunning } from './lasting.js';
|
|
26
|
+
import { useChat } from './provider.js';
|
|
26
27
|
import { list, record, text } from './read.js';
|
|
27
28
|
export const Linked = createContext(null);
|
|
28
29
|
const groupBy = groupPartByType({
|
|
@@ -148,7 +149,7 @@ function Anchor({ node: _node, href = '', ...rest }) {
|
|
|
148
149
|
const LINKED = { a: Anchor };
|
|
149
150
|
const THOUGHT = { className: 'ahc-thought' };
|
|
150
151
|
function Said({ thought = false }) {
|
|
151
|
-
return (_jsx(MarkdownTextPrimitive, { className: "ahc-text ahc-markdown", containerProps: thought ? THOUGHT : undefined, remarkPlugins: GFM, components: LINKED }));
|
|
152
|
+
return (_jsx(MarkdownTextPrimitive, { className: "ahc-text ahc-markdown", containerProps: thought ? THOUGHT : undefined, remarkPlugins: GFM, components: LINKED, smooth: false }));
|
|
152
153
|
}
|
|
153
154
|
function UserText() {
|
|
154
155
|
return _jsx(MessagePartPrimitive.Text, { className: "ahc-said" });
|
|
@@ -157,7 +158,16 @@ export function UserMessage() {
|
|
|
157
158
|
const said = useAuiState((s) => s.message.parts.some((one) => one.type === 'text' && one.text !== ''));
|
|
158
159
|
const attached = useAuiState((s) => (s.message.attachments?.length ?? 0) > 0);
|
|
159
160
|
const undelivered = useAuiState((s) => s.message.metadata.custom.undelivered === true);
|
|
160
|
-
|
|
161
|
+
const unknown = useAuiState((s) => s.message.metadata.custom.unknown === true);
|
|
162
|
+
const id = useAuiState((s) => s.message.id);
|
|
163
|
+
return (_jsxs(MessagePrimitive.Root, { role: "group", "aria-label": "You", className: "ahc-you", children: [said ? (_jsx("div", { className: "ahc-bubble", children: _jsx(MessagePrimitive.Parts, { components: { Text: UserText } }) })) : null, attached ? (_jsx("div", { className: "ahc-chips", children: _jsx(MessagePrimitive.Attachments, { children: ({ attachment }) => (_jsxs("span", { className: "ahc-chip", children: [_jsx(Paperclip, { "aria-hidden": "true" }), _jsx(Name, { text: attachment.name })] })) }) })) : null, undelivered ? _jsx(Undelivered, {}) : null, unknown ? _jsx(DeliveryUnknown, { message: id }) : null] }));
|
|
164
|
+
}
|
|
165
|
+
export function HouseMessage() {
|
|
166
|
+
return (_jsx(MessagePrimitive.Root, { role: "group", "aria-label": "House", className: "ahc-house", children: _jsx(MessagePrimitive.Parts, { components: { Text: UserText } }) }));
|
|
167
|
+
}
|
|
168
|
+
function DeliveryUnknown({ message }) {
|
|
169
|
+
const chat = useChat();
|
|
170
|
+
return (_jsxs("span", { className: "ahc-meta", children: ["Delivery unknown", _jsx("button", { type: "button", className: buttonClass('outline', true, false), disabled: chat.acting.busy, onClick: () => void chat.retry(message), children: "Retry" })] }));
|
|
161
171
|
}
|
|
162
172
|
export function Undelivered() {
|
|
163
173
|
return _jsx("span", { className: "ahc-meta", children: "Telegram didn't receive this" });
|
package/dist/chat/messages.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ type Entry = ConversationView['messages'][number];
|
|
|
6
6
|
export type Said = {
|
|
7
7
|
readonly turn: string;
|
|
8
8
|
readonly user: boolean;
|
|
9
|
+
readonly house: boolean;
|
|
10
|
+
readonly waiting: boolean;
|
|
9
11
|
readonly text: string;
|
|
10
12
|
readonly parts: readonly Part[];
|
|
11
13
|
readonly context: TurnContext | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/chat/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAA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,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC,CAAC;AAaF,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAkBzC;AAiGD,wBAAgB,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,GAAG,OAAO,CAKjE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAO3F;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,GAAG,iBAAiB,EAAE,CA0D/E;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI,CAS3E"}
|
package/dist/chat/messages.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { contextIn, jobOf, partsOf, stillRunning } from './parts.js';
|
|
2
2
|
import { list, record, text } from './read.js';
|
|
3
|
+
const SAID = new WeakMap();
|
|
4
|
+
const CONVERTED = new WeakMap();
|
|
3
5
|
export function saidOf(entry) {
|
|
6
|
+
const held = SAID.get(entry);
|
|
7
|
+
if (held !== undefined)
|
|
8
|
+
return held;
|
|
4
9
|
const message = record(entry.message);
|
|
5
|
-
|
|
10
|
+
const said = {
|
|
6
11
|
turn: text(message, 'turn_id') ?? entry.turn,
|
|
7
12
|
user: text(message, 'role') === 'user',
|
|
13
|
+
house: text(message, 'role') === 'house',
|
|
14
|
+
waiting: message.waiting === true,
|
|
8
15
|
text: text(message, 'text') ?? '',
|
|
9
16
|
parts: partsOf(list(message, 'parts')),
|
|
10
17
|
context: contextIn(message.context),
|
|
@@ -12,6 +19,24 @@ export function saidOf(entry) {
|
|
|
12
19
|
undelivered: message.telegram_undelivered === true,
|
|
13
20
|
files: list(message, 'files').flatMap((one) => text(record(one), 'name') ?? []),
|
|
14
21
|
};
|
|
22
|
+
SAID.set(entry, said);
|
|
23
|
+
return said;
|
|
24
|
+
}
|
|
25
|
+
function sameWork(held, now) {
|
|
26
|
+
return (held.length === now.length &&
|
|
27
|
+
held.every((one, at) => one.kind === now[at].kind && one.title === now[at].title && one.next === now[at].next));
|
|
28
|
+
}
|
|
29
|
+
function converted(entry, lasting, again, unknown, convert) {
|
|
30
|
+
const held = CONVERTED.get(entry);
|
|
31
|
+
if (held !== undefined &&
|
|
32
|
+
held.again === again &&
|
|
33
|
+
held.unknown === unknown &&
|
|
34
|
+
sameWork(held.lasting, lasting)) {
|
|
35
|
+
return held.message;
|
|
36
|
+
}
|
|
37
|
+
const message = convert();
|
|
38
|
+
CONVERTED.set(entry, { lasting, again, unknown, message });
|
|
39
|
+
return message;
|
|
15
40
|
}
|
|
16
41
|
function markerArgs(part) {
|
|
17
42
|
if (part.marker !== 'job')
|
|
@@ -67,7 +92,7 @@ function leftRunning(view) {
|
|
|
67
92
|
return new Map();
|
|
68
93
|
const turns = view.messages.flatMap((entry) => {
|
|
69
94
|
const one = saidOf(entry);
|
|
70
|
-
return one.user ? [] : [{ turn: one.turn, parts: one.parts, ended: true }];
|
|
95
|
+
return one.user || one.house ? [] : [{ turn: one.turn, parts: one.parts, ended: true }];
|
|
71
96
|
});
|
|
72
97
|
return stillRunning(view.turn === null
|
|
73
98
|
? turns
|
|
@@ -75,15 +100,18 @@ function leftRunning(view) {
|
|
|
75
100
|
}
|
|
76
101
|
export function awaitsTurn(view) {
|
|
77
102
|
const newest = view?.messages.at(-1);
|
|
78
|
-
|
|
103
|
+
if (view?.turn !== null || newest === undefined)
|
|
104
|
+
return false;
|
|
105
|
+
const said = saidOf(newest);
|
|
106
|
+
return said.user || (said.house && !said.waiting);
|
|
79
107
|
}
|
|
80
108
|
export function askedBefore(view, id) {
|
|
81
109
|
const said = (view?.messages ?? []).map((entry) => ({ ...saidOf(entry), id: entry.identity }));
|
|
82
110
|
const asked = said
|
|
83
111
|
.slice(0, said.findIndex((one) => one.id === id) + 1)
|
|
84
112
|
.reverse()
|
|
85
|
-
.find((one) => one.user);
|
|
86
|
-
return asked === undefined || asked.text === '' ? null : asked.text;
|
|
113
|
+
.find((one) => one.user || one.house);
|
|
114
|
+
return asked === undefined || asked.house || asked.text === '' ? null : asked.text;
|
|
87
115
|
}
|
|
88
116
|
export function chatMessages(view) {
|
|
89
117
|
if (view === null)
|
|
@@ -92,8 +120,16 @@ export function chatMessages(view) {
|
|
|
92
120
|
const said = view.messages.map((entry, at) => {
|
|
93
121
|
const one = saidOf(entry);
|
|
94
122
|
const custom = { undelivered: one.undelivered };
|
|
123
|
+
if (one.house)
|
|
124
|
+
return converted(entry, [], false, false, () => ({
|
|
125
|
+
id: entry.identity,
|
|
126
|
+
role: 'system',
|
|
127
|
+
content: [{ type: 'text', text: one.text }],
|
|
128
|
+
metadata: { custom },
|
|
129
|
+
}));
|
|
95
130
|
if (one.user) {
|
|
96
|
-
|
|
131
|
+
const unknown = view.deliveryUnknown.includes(entry.identity);
|
|
132
|
+
return converted(entry, [], false, unknown, () => ({
|
|
97
133
|
id: entry.identity,
|
|
98
134
|
role: 'user',
|
|
99
135
|
content: [{ type: 'text', text: one.text }],
|
|
@@ -104,28 +140,24 @@ export function chatMessages(view) {
|
|
|
104
140
|
status: { type: 'complete' },
|
|
105
141
|
content: [],
|
|
106
142
|
})),
|
|
107
|
-
metadata: { custom },
|
|
108
|
-
};
|
|
143
|
+
metadata: { custom: { ...custom, unknown } },
|
|
144
|
+
}));
|
|
109
145
|
}
|
|
110
146
|
const failed = one.failure === null
|
|
111
147
|
? undefined
|
|
112
148
|
: { type: 'incomplete', reason: 'error', error: one.failure };
|
|
113
|
-
|
|
149
|
+
const working = lasting.get(one.turn) ?? [];
|
|
150
|
+
const again = failed !== undefined &&
|
|
151
|
+
view.turn === null &&
|
|
152
|
+
at === view.messages.length - 1 &&
|
|
153
|
+
askedBefore(view, view.messages[at - 1]?.identity ?? null) !== null;
|
|
154
|
+
return converted(entry, working, again, false, () => ({
|
|
114
155
|
id: entry.identity,
|
|
115
156
|
role: 'assistant',
|
|
116
157
|
content: contentOf(entry.identity, one.parts, false),
|
|
117
158
|
status: failed,
|
|
118
|
-
metadata: {
|
|
119
|
-
|
|
120
|
-
...custom,
|
|
121
|
-
lasting: lasting.get(one.turn) ?? [],
|
|
122
|
-
again: failed !== undefined &&
|
|
123
|
-
view.turn === null &&
|
|
124
|
-
at === view.messages.length - 1 &&
|
|
125
|
-
askedBefore(view, view.messages[at - 1]?.identity ?? null) !== null,
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
};
|
|
159
|
+
metadata: { custom: { ...custom, lasting: working, again } },
|
|
160
|
+
}));
|
|
129
161
|
});
|
|
130
162
|
if (view.turn === null)
|
|
131
163
|
return said;
|
package/dist/chat/overlay.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare function overlay(): Overlay;
|
|
|
24
24
|
export declare function sentMessage(key: string, into: readonly string[], said: ChatDraft, turn: string | null): Expectation;
|
|
25
25
|
export declare function optionChosen(conversation: string, option: string, value: string): Expectation;
|
|
26
26
|
export declare function questionAnswered(conversation: string, interaction: string): Expectation;
|
|
27
|
+
export declare function deliveryRetried(conversation: string, message: string): Expectation;
|
|
27
28
|
export declare function conversationListed(entry: ConversationEntry): Expectation;
|
|
28
29
|
export declare function conversationChanged(conversation: string, changes: Partial<Pick<ConversationEntry, 'name' | 'finished'>>, shown: (entry: ConversationEntry) => boolean): Expectation;
|
|
29
30
|
export declare function conversationGone(conversation: string): Expectation;
|
|
@@ -1 +1 @@
|
|
|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,GAAG,WAAW,CAUlF;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,WAAW,CAQxE;AAED,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,EAC9D,KAAK,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,GAC3C,WAAW,CAQb;AAED,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW,CAQlE"}
|
package/dist/chat/overlay.js
CHANGED
|
@@ -68,6 +68,16 @@ export function questionAnswered(conversation, interaction) {
|
|
|
68
68
|
shown: (held) => held.conversation === conversation && !held.questions.some(ours),
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
+
export function deliveryRetried(conversation, message) {
|
|
72
|
+
return {
|
|
73
|
+
key: `retry ${conversation} ${message}`,
|
|
74
|
+
view: 'conversation',
|
|
75
|
+
draw: (held) => held.conversation !== conversation
|
|
76
|
+
? held
|
|
77
|
+
: { ...held, deliveryUnknown: held.deliveryUnknown.filter((one) => one !== message) },
|
|
78
|
+
shown: (held) => held.conversation === conversation && !held.deliveryUnknown.includes(message),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
71
81
|
export function conversationListed(entry) {
|
|
72
82
|
const ours = (one) => one.conversation === entry.conversation;
|
|
73
83
|
return {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { fromMarkdown } from 'mdast-util-from-markdown';
|
|
2
|
+
export type Root = ReturnType<typeof fromMarkdown>;
|
|
3
|
+
export type Block = Root['children'][number];
|
|
4
|
+
export declare function parseMarkdown(text: string): Root;
|
|
5
|
+
export type Step = 'list' | 'item' | 'footnote' | 'table' | 'blockquote' | 'paragraph';
|
|
6
|
+
export interface Piece {
|
|
7
|
+
readonly nodes: readonly Block[];
|
|
8
|
+
readonly path: readonly Step[];
|
|
9
|
+
readonly join: string;
|
|
10
|
+
}
|
|
11
|
+
interface Level {
|
|
12
|
+
readonly kind: 'quote' | 'item' | 'note';
|
|
13
|
+
readonly line: number;
|
|
14
|
+
readonly column: number;
|
|
15
|
+
readonly size: number;
|
|
16
|
+
readonly carry: string;
|
|
17
|
+
readonly spread: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface Next {
|
|
20
|
+
readonly start: number;
|
|
21
|
+
readonly path: readonly Step[];
|
|
22
|
+
readonly join: string;
|
|
23
|
+
readonly carry: string;
|
|
24
|
+
readonly levels: readonly Level[];
|
|
25
|
+
}
|
|
26
|
+
interface Found {
|
|
27
|
+
readonly key: string;
|
|
28
|
+
readonly at: number;
|
|
29
|
+
readonly url: string;
|
|
30
|
+
}
|
|
31
|
+
interface Region {
|
|
32
|
+
readonly from: number;
|
|
33
|
+
readonly looks: readonly number[];
|
|
34
|
+
readonly last: ReadonlyMap<string, number>;
|
|
35
|
+
readonly runs: ReadonlyMap<number, number>;
|
|
36
|
+
}
|
|
37
|
+
interface Discovery {
|
|
38
|
+
readonly found: Found[];
|
|
39
|
+
next: Next | null;
|
|
40
|
+
}
|
|
41
|
+
export interface Long {
|
|
42
|
+
readonly text: string;
|
|
43
|
+
readonly starts: Int32Array;
|
|
44
|
+
readonly breaks: Int32Array;
|
|
45
|
+
readonly quoteBreaks: Int32Array;
|
|
46
|
+
readonly anchors: readonly number[];
|
|
47
|
+
readonly candidates: ReadonlyMap<string, readonly number[]>;
|
|
48
|
+
readonly pieces: Piece[];
|
|
49
|
+
next: Next | null;
|
|
50
|
+
readonly urls: Map<string, string>;
|
|
51
|
+
readonly spans: Map<string, readonly Found[]>;
|
|
52
|
+
readonly discoveries: Map<number, Discovery>;
|
|
53
|
+
readonly regions: Map<string, Region>;
|
|
54
|
+
readonly spreads: Map<number, boolean | null>;
|
|
55
|
+
}
|
|
56
|
+
export declare function identifierOf(label: string): string;
|
|
57
|
+
export declare function longOf(text: string): Long;
|
|
58
|
+
export declare function pieceAt(long: Long, index: number): Piece | null;
|
|
59
|
+
export declare function drawn(long: Long, count: number): Block[];
|
|
60
|
+
export declare function remaining(long: Long, count: number): boolean;
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=pieces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pieces.d.ts","sourceRoot":"","sources":["../../src/chat/pieces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIxD,MAAM,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACnD,MAAM,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAI7C,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEhD;AAsED,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,GAAG,WAAW,CAAC;AAIvF,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,KAAK,EAAE,SAAS,KAAK,EAAE,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,KAAK;IACb,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,UAAU,IAAI;IACZ,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC;IAC/B,QAAQ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