@agentshouse/mdruntime 0.1.0-c99e5271060cd → 0.1.0-ca10e63188fc5
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 +21 -8
- package/dist/adapter.d.ts +134 -30
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +5 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +21 -4
- package/dist/attempt.d.ts +16 -0
- package/dist/attempt.d.ts.map +1 -0
- package/dist/attempt.js +70 -0
- package/dist/binary.d.ts +18 -0
- package/dist/binary.d.ts.map +1 -0
- package/dist/binary.js +8 -0
- package/dist/bootstrap.d.ts +32 -9
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +192 -67
- 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 -14
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +11 -62
- package/dist/change.d.ts +41 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +34 -0
- package/dist/client.d.ts +31 -12
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +104 -7
- package/dist/collection.d.ts +12 -6
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +51 -76
- package/dist/compile.d.ts +16 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +765 -0
- package/dist/connection.d.ts +52 -16
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +3656 -766
- package/dist/conversation.d.ts +37 -11
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +576 -179
- 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 +5 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +5 -0
- package/dist/entry.d.ts +19 -0
- package/dist/entry.d.ts.map +1 -0
- package/dist/entry.js +151 -0
- package/dist/expectation.d.ts +21 -0
- package/dist/expectation.d.ts.map +1 -0
- package/dist/expectation.js +70 -0
- package/dist/fence.d.ts +6 -0
- package/dist/fence.d.ts.map +1 -0
- package/dist/fence.js +10 -0
- package/dist/file.d.ts +2 -19
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +7 -122
- 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 +15 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +131 -15
- package/dist/identity.d.ts +3 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +9 -0
- package/dist/index.d.ts +18 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/live.d.ts +22 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +124 -0
- package/dist/media.d.ts +8 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +205 -0
- package/dist/memory.d.ts +12 -5
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +112 -24
- package/dist/messages.d.ts +28 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +90 -0
- package/dist/model.d.ts +10 -2
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +17 -2
- 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 +20 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +113 -12
- 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 +52 -1
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +46 -0
- package/dist/overlay.d.ts +15 -5
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +129 -177
- package/dist/query.d.ts +68 -4
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +48 -7
- package/dist/reach.d.ts +17 -4
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +226 -50
- package/dist/react.d.ts +10 -7
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +7 -17
- package/dist/readiness.d.ts +64 -0
- package/dist/readiness.d.ts.map +1 -0
- package/dist/readiness.js +33 -0
- 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 +25 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +198 -0
- package/dist/refresh.d.ts +16 -15
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +113 -54
- package/dist/replica.d.ts +59 -33
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +309 -157
- package/dist/room-draft.d.ts +35 -3
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +174 -16
- package/dist/rows.d.ts +37 -35
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +173 -102
- package/dist/save.d.ts +68 -3
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +795 -143
- package/dist/search.d.ts +39 -28
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +37 -105
- 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 +16 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +431 -0
- package/dist/status.d.ts +4 -1
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +0 -8
- package/dist/store.d.ts +126 -80
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +371 -457
- package/dist/stored.d.ts +152 -0
- package/dist/stored.d.ts.map +1 -0
- package/dist/stored.js +571 -0
- package/dist/tables.d.ts +354 -0
- package/dist/tables.d.ts.map +1 -0
- package/dist/tables.js +624 -0
- package/dist/turn.d.ts +9 -0
- package/dist/turn.d.ts.map +1 -0
- package/dist/turn.js +75 -0
- 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 +169 -30
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +57 -29
- package/dist/words.d.ts +19 -0
- package/dist/words.d.ts.map +1 -0
- package/dist/words.js +150 -0
- package/package.json +26 -15
- package/AGENTS.md +0 -269
- package/dist/attachment.d.ts +0 -3
- package/dist/attachment.d.ts.map +0 -1
- package/dist/attachment.js +0 -8
- package/dist/read-side.d.ts +0 -18
- package/dist/read-side.d.ts.map +0 -1
- package/dist/read-side.js +0 -433
package/dist/room-draft.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { apply, equalValue, frontmatterValue, parse, serialize } from '@agentshouse/mdmodel';
|
|
1
|
+
import { apply, equalValue, frontmatterValue, parse, serialize, } from '@agentshouse/mdmodel';
|
|
2
2
|
import { runtimeError } from './failure.js';
|
|
3
|
+
import { sha256 } from './digest.js';
|
|
4
|
+
import { binaryLocalId } from './identity.js';
|
|
3
5
|
import { normalize } from './paths.js';
|
|
4
6
|
export function returnedBy(kind) {
|
|
5
7
|
return { kind, code: kind, fields: {}, retryable: false };
|
|
@@ -60,6 +62,7 @@ const PART_NAMES = new Set([
|
|
|
60
62
|
'creation',
|
|
61
63
|
'move',
|
|
62
64
|
'removal',
|
|
65
|
+
'file',
|
|
63
66
|
]);
|
|
64
67
|
export function readParts(value) {
|
|
65
68
|
if (!plain(value) || Object.keys(value).some((name) => !PART_NAMES.has(name)))
|
|
@@ -87,7 +90,12 @@ export function readParts(value) {
|
|
|
87
90
|
if (!plain(value.move))
|
|
88
91
|
malformed();
|
|
89
92
|
const base = markdownBase(value.move.base);
|
|
90
|
-
|
|
93
|
+
const room = optionalText(value.move.room);
|
|
94
|
+
parts.move = {
|
|
95
|
+
to: text(value.move.to),
|
|
96
|
+
...(room === undefined ? {} : { room }),
|
|
97
|
+
...(base === undefined ? {} : { base }),
|
|
98
|
+
};
|
|
91
99
|
}
|
|
92
100
|
if (value.removal !== undefined) {
|
|
93
101
|
if (!plain(value.removal))
|
|
@@ -95,6 +103,13 @@ export function readParts(value) {
|
|
|
95
103
|
const base = markdownBase(value.removal.base);
|
|
96
104
|
parts.removal = base === undefined ? {} : { base };
|
|
97
105
|
}
|
|
106
|
+
if (value.file !== undefined) {
|
|
107
|
+
if (!plain(value.file) || !(value.file.blob instanceof Blob))
|
|
108
|
+
malformed();
|
|
109
|
+
if (Object.keys(value).length > 1)
|
|
110
|
+
throw runtimeError('room-draft-file-exclusive');
|
|
111
|
+
parts.file = { blob: value.file.blob };
|
|
112
|
+
}
|
|
98
113
|
return parts;
|
|
99
114
|
}
|
|
100
115
|
function named(record) {
|
|
@@ -110,15 +125,76 @@ function kept(prior, base) {
|
|
|
110
125
|
throw runtimeError('room-draft-base-missing');
|
|
111
126
|
return base;
|
|
112
127
|
}
|
|
128
|
+
function movePart(current, move) {
|
|
129
|
+
return {
|
|
130
|
+
to: move.to,
|
|
131
|
+
...(move.room === undefined ? {} : { room: move.room }),
|
|
132
|
+
base: kept(current, move.base),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
113
135
|
function editsText(parts) {
|
|
114
136
|
return (parts.preamble !== undefined ||
|
|
115
137
|
named(parts.fields).length > 0 ||
|
|
116
138
|
named(parts.sections).length > 0);
|
|
117
139
|
}
|
|
118
|
-
|
|
140
|
+
function partNames(parts) {
|
|
141
|
+
const names = [];
|
|
142
|
+
for (const [name, part] of Object.entries(parts)) {
|
|
143
|
+
if (name === 'preamble' || name === 'markdown')
|
|
144
|
+
names.push(name);
|
|
145
|
+
else if ((name === 'fields' || name === 'sections') && plain(part))
|
|
146
|
+
names.push(...Object.keys(part).map((one) => `${name}/${one}`));
|
|
147
|
+
else
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
return names.sort().join('\u0000');
|
|
151
|
+
}
|
|
152
|
+
function withBaseOf(prior, part) {
|
|
153
|
+
return plain(part) && plain(prior) && Object.hasOwn(prior, 'base')
|
|
154
|
+
? { ...part, base: prior.base }
|
|
155
|
+
: part;
|
|
156
|
+
}
|
|
157
|
+
export function gatheredParts(earlier, later) {
|
|
158
|
+
if (!plain(earlier) || !plain(later))
|
|
159
|
+
return null;
|
|
160
|
+
const named = partNames(earlier);
|
|
161
|
+
if (named === null || named !== partNames(later))
|
|
162
|
+
return null;
|
|
163
|
+
return Object.fromEntries(Object.entries(later).map(([name, part]) => [
|
|
164
|
+
name,
|
|
165
|
+
name === 'fields' || name === 'sections'
|
|
166
|
+
? Object.fromEntries(Object.entries(part).map(([one, value]) => [
|
|
167
|
+
one,
|
|
168
|
+
withBaseOf(earlier[name][one], value),
|
|
169
|
+
]))
|
|
170
|
+
: withBaseOf(earlier[name], part),
|
|
171
|
+
]));
|
|
172
|
+
}
|
|
173
|
+
export function held(current, parts, file) {
|
|
119
174
|
if (parts.markdown !== undefined && editsText(parts)) {
|
|
120
175
|
throw runtimeError('room-draft-markdown-exclusive');
|
|
121
176
|
}
|
|
177
|
+
if (file !== undefined) {
|
|
178
|
+
if (current !== undefined && current.file === undefined) {
|
|
179
|
+
throw runtimeError('room-draft-file-exclusive');
|
|
180
|
+
}
|
|
181
|
+
return { file: { ...file, base: current?.file === undefined ? file.base : current.file.base } };
|
|
182
|
+
}
|
|
183
|
+
if (current?.file !== undefined) {
|
|
184
|
+
if (editsText(parts) ||
|
|
185
|
+
parts.markdown !== undefined ||
|
|
186
|
+
parts.creation !== undefined ||
|
|
187
|
+
(parts.move === undefined && parts.removal === undefined)) {
|
|
188
|
+
throw runtimeError('room-draft-file-exclusive');
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
file: current.file,
|
|
192
|
+
...(parts.move === undefined ? {} : { move: movePart(current.move, parts.move) }),
|
|
193
|
+
...(parts.removal === undefined
|
|
194
|
+
? {}
|
|
195
|
+
: { removal: { base: kept(current.removal, parts.removal.base) } }),
|
|
196
|
+
};
|
|
197
|
+
}
|
|
122
198
|
const next = {};
|
|
123
199
|
const fields = named(parts.fields);
|
|
124
200
|
if (fields.length > 0) {
|
|
@@ -148,9 +224,8 @@ export function held(current, parts) {
|
|
|
148
224
|
}
|
|
149
225
|
if (parts.creation !== undefined)
|
|
150
226
|
next.creation = parts.creation;
|
|
151
|
-
if (parts.move !== undefined)
|
|
152
|
-
next.move =
|
|
153
|
-
}
|
|
227
|
+
if (parts.move !== undefined)
|
|
228
|
+
next.move = movePart(current?.move, parts.move);
|
|
154
229
|
if (parts.removal !== undefined) {
|
|
155
230
|
next.removal = { base: kept(current?.removal, parts.removal.base) };
|
|
156
231
|
}
|
|
@@ -198,8 +273,27 @@ export function underneath(parts, path, visible) {
|
|
|
198
273
|
report.move = markdown;
|
|
199
274
|
if (parts.removal !== undefined && markdown !== parts.removal.base)
|
|
200
275
|
report.removal = markdown;
|
|
276
|
+
if (parts.file !== undefined) {
|
|
277
|
+
const file = binaryBase(visible, path);
|
|
278
|
+
if (file !== parts.file.base || markdown !== null)
|
|
279
|
+
report.file = file;
|
|
280
|
+
}
|
|
201
281
|
return report;
|
|
202
282
|
}
|
|
283
|
+
const UNTYPED_MEDIA_TYPE = 'application/octet-stream';
|
|
284
|
+
export async function heldFile(blob, base) {
|
|
285
|
+
return {
|
|
286
|
+
localId: binaryLocalId(),
|
|
287
|
+
...(blob instanceof File ? { name: blob.name } : {}),
|
|
288
|
+
byteLength: blob.size,
|
|
289
|
+
mediaType: blob.type === '' ? UNTYPED_MEDIA_TYPE : blob.type,
|
|
290
|
+
sha256: await sha256(blob),
|
|
291
|
+
base,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
export function binaryBase(visible, path) {
|
|
295
|
+
return visible?.binaries[path] === undefined ? null : (visible.revisions[path] ?? null);
|
|
296
|
+
}
|
|
203
297
|
export function changedParts(path, report) {
|
|
204
298
|
return [
|
|
205
299
|
...(report.creation === undefined ? [] : [{ path, part: 'creation' }]),
|
|
@@ -209,6 +303,7 @@ export function changedParts(path, report) {
|
|
|
209
303
|
...(report.markdown === undefined ? [] : [{ path, part: 'markdown' }]),
|
|
210
304
|
...(report.move === undefined ? [] : [{ path, part: 'move' }]),
|
|
211
305
|
...(report.removal === undefined ? [] : [{ path, part: 'removal' }]),
|
|
306
|
+
...(report.file === undefined ? [] : [{ path, part: 'file' }]),
|
|
212
307
|
];
|
|
213
308
|
}
|
|
214
309
|
function joined(existing, returned) {
|
|
@@ -225,16 +320,15 @@ function frontmatterOf(fields) {
|
|
|
225
320
|
const opened = parse('---\n---\n');
|
|
226
321
|
if (!opened.ok)
|
|
227
322
|
return malformed();
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
return serialize(document);
|
|
323
|
+
const next = apply(opened.document, fields.map(([name, part]) => ({
|
|
324
|
+
kind: 'field',
|
|
325
|
+
name,
|
|
326
|
+
value: part.value,
|
|
327
|
+
prior: undefined,
|
|
328
|
+
})));
|
|
329
|
+
return next.outcome === 'applied' ? serialize(next.document) : malformed();
|
|
236
330
|
}
|
|
237
|
-
function
|
|
331
|
+
export function partsAfter(markdown, parts) {
|
|
238
332
|
const fields = named(parts.fields);
|
|
239
333
|
const pieces = [
|
|
240
334
|
...(fields.length === 0 ? [] : [frontmatterOf(fields)]),
|
|
@@ -265,18 +359,21 @@ export function returnedInto(existing, returned) {
|
|
|
265
359
|
delete next.fields;
|
|
266
360
|
delete next.sections;
|
|
267
361
|
delete next.preamble;
|
|
268
|
-
const value =
|
|
362
|
+
const value = partsAfter(whole.value, existing.markdown === undefined ? existing : returned);
|
|
269
363
|
next.markdown = { value, base: whole.base };
|
|
270
364
|
}
|
|
271
365
|
const creation = existing.creation ?? returned.creation;
|
|
272
366
|
const move = existing.move ?? returned.move;
|
|
273
367
|
const removal = existing.removal ?? returned.removal;
|
|
368
|
+
const file = existing.file ?? returned.file;
|
|
274
369
|
if (creation !== undefined)
|
|
275
370
|
next.creation = creation;
|
|
276
371
|
if (move !== undefined)
|
|
277
372
|
next.move = move;
|
|
278
373
|
if (removal !== undefined)
|
|
279
374
|
next.removal = removal;
|
|
375
|
+
if (file !== undefined)
|
|
376
|
+
next.file = file;
|
|
280
377
|
return next;
|
|
281
378
|
}
|
|
282
379
|
export function moveTarget(move) {
|
|
@@ -312,9 +409,70 @@ export function changesOf(path, parts) {
|
|
|
312
409
|
if (parts.markdown !== undefined) {
|
|
313
410
|
changes.push({ kind: 'replace', path, content: parts.markdown.value });
|
|
314
411
|
}
|
|
412
|
+
if (parts.file !== undefined && parts.removal === undefined) {
|
|
413
|
+
const { base, name: _name, ...file } = parts.file;
|
|
414
|
+
const at = parts.move === undefined ? path : moveTarget(parts.move);
|
|
415
|
+
if (base !== null && at !== path)
|
|
416
|
+
changes.push({ kind: 'move', path, to: at });
|
|
417
|
+
changes.push({ kind: 'binary', path: at, ...file });
|
|
418
|
+
if (base === null && at !== path)
|
|
419
|
+
bases.push({ kind: 'absent', path: at });
|
|
420
|
+
return { changes, bases };
|
|
421
|
+
}
|
|
422
|
+
if (parts.file?.base === null)
|
|
423
|
+
return { changes, bases };
|
|
315
424
|
if (parts.move !== undefined)
|
|
316
425
|
changes.push({ kind: 'move', path, to: moveTarget(parts.move) });
|
|
317
426
|
if (parts.removal !== undefined)
|
|
318
427
|
changes.push({ kind: 'remove', path });
|
|
319
428
|
return { changes, bases };
|
|
320
429
|
}
|
|
430
|
+
function rebased(before, after) {
|
|
431
|
+
return before === undefined ? after : { ...after, base: before.base };
|
|
432
|
+
}
|
|
433
|
+
function rebasedAll(before, after) {
|
|
434
|
+
return {
|
|
435
|
+
...before,
|
|
436
|
+
...Object.fromEntries(Object.entries(after).map(([name, part]) => [name, rebased(before?.[name], part)])),
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
export function joinedDraft(carried, saved) {
|
|
440
|
+
const draft = saved.find((item) => item.path === carried.path);
|
|
441
|
+
if (draft === undefined)
|
|
442
|
+
return carried;
|
|
443
|
+
const held = carried.parts;
|
|
444
|
+
const next = draft.parts;
|
|
445
|
+
return {
|
|
446
|
+
path: carried.path,
|
|
447
|
+
parts: {
|
|
448
|
+
...held,
|
|
449
|
+
...next,
|
|
450
|
+
...(next.fields === undefined ? {} : { fields: rebasedAll(held.fields, next.fields) }),
|
|
451
|
+
...(next.sections === undefined
|
|
452
|
+
? {}
|
|
453
|
+
: { sections: rebasedAll(held.sections, next.sections) }),
|
|
454
|
+
...(next.preamble === undefined ? {} : { preamble: rebased(held.preamble, next.preamble) }),
|
|
455
|
+
...(next.markdown === undefined ? {} : { markdown: rebased(held.markdown, next.markdown) }),
|
|
456
|
+
},
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
export function withdrawnDrafts(drafts, changes) {
|
|
460
|
+
return drafts.flatMap((draft) => {
|
|
461
|
+
const file = draft.parts.file;
|
|
462
|
+
const at = draft.parts.move?.to ?? draft.path;
|
|
463
|
+
const change = changes.find((item) => (item.kind === 'move' || item.kind === 'remove') && item.path === at);
|
|
464
|
+
if (file === undefined || change === undefined)
|
|
465
|
+
return [draft];
|
|
466
|
+
if (change.kind === 'move') {
|
|
467
|
+
return [
|
|
468
|
+
{
|
|
469
|
+
path: draft.path,
|
|
470
|
+
parts: change.to === draft.path ? { file } : { file, move: { to: change.to, base: null } },
|
|
471
|
+
},
|
|
472
|
+
];
|
|
473
|
+
}
|
|
474
|
+
return file.base === null
|
|
475
|
+
? []
|
|
476
|
+
: [{ path: draft.path, parts: { file, removal: { base: null } } }];
|
|
477
|
+
});
|
|
478
|
+
}
|
package/dist/rows.d.ts
CHANGED
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
import { type Document } from '@agentshouse/mdmodel';
|
|
2
|
-
import type { HeadChange } from './adapter.js';
|
|
3
1
|
import { type Composition } from './collection.js';
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
values: Fields;
|
|
13
|
-
reached: Readonly<Record<string, readonly unknown[]>>;
|
|
14
|
-
directories: readonly string[];
|
|
15
|
-
body: string;
|
|
16
|
-
change: HeadChange | null;
|
|
2
|
+
export type ValueKind = 'string' | 'number' | 'boolean' | 'null' | 'array' | 'object' | 'undefined';
|
|
3
|
+
type HeldValue = {
|
|
4
|
+
readonly keys: string;
|
|
5
|
+
readonly places: string;
|
|
6
|
+
readonly item: number;
|
|
7
|
+
readonly kind: ValueKind;
|
|
8
|
+
readonly value: string | number | null;
|
|
9
|
+
readonly size: number | null;
|
|
17
10
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
kind:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
markdown: string;
|
|
11
|
+
type LinkKind = 'field' | 'section' | 'body';
|
|
12
|
+
type HeldLink = {
|
|
13
|
+
readonly kind: LinkKind;
|
|
14
|
+
readonly keys: string;
|
|
15
|
+
readonly places: string;
|
|
16
|
+
readonly target: string;
|
|
17
|
+
readonly field: string;
|
|
26
18
|
};
|
|
27
|
-
export type
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
export type Described = {
|
|
20
|
+
readonly type: string | null;
|
|
21
|
+
readonly declared: string | null;
|
|
22
|
+
readonly queried: boolean;
|
|
23
|
+
readonly folder: string;
|
|
24
|
+
readonly fields: string | null;
|
|
25
|
+
};
|
|
26
|
+
export type Derived = Described & {
|
|
27
|
+
readonly values: readonly HeldValue[];
|
|
28
|
+
readonly links: readonly HeldLink[];
|
|
37
29
|
};
|
|
38
|
-
export type Row = DocumentRow | BodyRow | ReferenceRow;
|
|
39
30
|
export declare function documentKey(room: string, path: string): string;
|
|
40
31
|
export declare function roomOfKey(key: string): string;
|
|
32
|
+
export declare function pathOfKey(key: string): string;
|
|
41
33
|
export declare function markdownPath(path: string): boolean;
|
|
42
|
-
export declare function
|
|
34
|
+
export declare function folderOf(path: string): string;
|
|
35
|
+
export type Reach = 'exact' | 'value' | 'link';
|
|
36
|
+
export type Placed = {
|
|
37
|
+
readonly keys: string;
|
|
38
|
+
readonly places: string;
|
|
39
|
+
readonly glob: boolean;
|
|
40
|
+
};
|
|
41
|
+
export declare function placedOf(pointer: string, reach: Reach): Placed;
|
|
42
|
+
export declare function kindOf(value: unknown): ValueKind;
|
|
43
|
+
export declare function described(path: string, content: string | null): Described;
|
|
44
|
+
export declare function derived(path: string, content: string | null, composition: Composition): Derived;
|
|
43
45
|
export {};
|
|
44
46
|
//# sourceMappingURL=rows.d.ts.map
|
package/dist/rows.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../src/rows.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../src/rows.ts"],"names":[],"mappings":"AAWA,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9D,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEpG,KAAK,SAAS,GAAG;IACf,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF,KAAK,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE7C,KAAK,QAAQ,GAAG;IACd,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG;IAChC,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;CACrC,CAAC;AAMF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAWD,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAE/C,MAAM,MAAM,MAAM,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhG,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,CAuB9D;AAwBD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAMhD;AAiJD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAEzE;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAO/F"}
|