@inventarch/cli 1.2.0 → 2.0.0
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 +12 -5
- package/SPEC.md +39 -7
- package/assets/host/3d2c8530db8d14755410b17be8228a230d88de96f9dc78f953979d3ca7c6ea62.tgz +0 -0
- package/assets/host.json +4 -4
- package/dist/bundled-base.d.ts +18 -0
- package/dist/bundled-base.d.ts.map +1 -0
- package/dist/bundled-base.js +44 -0
- package/dist/bundled-base.js.map +1 -0
- package/dist/capture.d.ts +30 -3
- package/dist/capture.d.ts.map +1 -1
- package/dist/capture.js +112 -37
- package/dist/capture.js.map +1 -1
- package/dist/commands.d.ts +23 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +175 -13
- package/dist/commands.js.map +1 -1
- package/dist/compile.d.ts +3 -4
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +29 -70
- package/dist/compile.js.map +1 -1
- package/dist/consumer.d.ts.map +1 -1
- package/dist/consumer.js +9 -2
- package/dist/consumer.js.map +1 -1
- package/dist/distribute.d.ts +25 -5
- package/dist/distribute.d.ts.map +1 -1
- package/dist/distribute.js +75 -52
- package/dist/distribute.js.map +1 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +113 -60
- package/dist/doctor.js.map +1 -1
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +2 -1
- package/dist/format.js.map +1 -1
- package/dist/host-projection.d.ts +73 -6
- package/dist/host-projection.d.ts.map +1 -1
- package/dist/host-projection.js +296 -38
- package/dist/host-projection.js.map +1 -1
- package/dist/host.d.ts +100 -30
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +235 -120
- package/dist/host.js.map +1 -1
- package/dist/init.d.ts +280 -35
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +1238 -194
- package/dist/init.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +3 -1
- package/dist/main.js.map +1 -1
- package/dist/migration-journal.d.ts +35 -0
- package/dist/migration-journal.d.ts.map +1 -0
- package/dist/migration-journal.js +205 -0
- package/dist/migration-journal.js.map +1 -0
- package/dist/next.d.ts +21 -0
- package/dist/next.d.ts.map +1 -0
- package/dist/next.js +210 -0
- package/dist/next.js.map +1 -0
- package/dist/operation-help.d.ts.map +1 -1
- package/dist/operation-help.js +14 -3
- package/dist/operation-help.js.map +1 -1
- package/dist/pack.d.ts.map +1 -1
- package/dist/pack.js +24 -2
- package/dist/pack.js.map +1 -1
- package/dist/position.d.ts +22 -0
- package/dist/position.d.ts.map +1 -0
- package/dist/position.js +242 -0
- package/dist/position.js.map +1 -0
- package/dist/project.d.ts +42 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +232 -0
- package/dist/project.js.map +1 -0
- package/dist/read.d.ts +12 -2
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +29 -18
- package/dist/read.js.map +1 -1
- package/dist/render.d.ts +8 -0
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +16 -0
- package/dist/render.js.map +1 -1
- package/dist/session.d.ts +9 -3
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +24 -8
- package/dist/session.js.map +1 -1
- package/package.json +6 -6
- package/assets/host/c5fb2bfbba619cbd558ecc1e94dd2c16e37aa8599b4e423f1f59ed01f2074e03.tgz +0 -0
package/dist/position.js
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ia position`: position-and-projection §1, §6 and §7 and design item 10; decisions scope-key-caps and
|
|
3
|
+
* scope-verb-dispatch.
|
|
4
|
+
*
|
|
5
|
+
* The consumer verb over the runtime's `position`: body(K) for the scope key the flags name, its digest and the host
|
|
6
|
+
* note. No flag names K0, the repository's workspace with its pointers and tallies only; a key naming any part takes
|
|
7
|
+
* the runtime's defaults for the others (`normalizeScopeKey`). This verb prints the key used and the capture's
|
|
8
|
+
* freshness, then the body's sections and its two widening keys as `ia position` commands, or with `--json` what the
|
|
9
|
+
* Door's `position` operation returns. It is that operation as a consumer verb beside the frozen `ia scope` route,
|
|
10
|
+
* never a machine route (plan amendment A2), and its key is read from closed flags only, so no request text reaches it.
|
|
11
|
+
*
|
|
12
|
+
* The workspace opens as every read verb opens it, without the db cache, and the position is read through the
|
|
13
|
+
* whole-workspace scope, whose body also names the admission findings on loaded records (db PT5). Nothing is written:
|
|
14
|
+
* a position needs no capture (plan amendment A9), whose state is only the note's freshness.
|
|
15
|
+
*/
|
|
16
|
+
import { COORDINATE_DOMAINS, RuntimeError, SCOPE_KEY_CAPS, normalizeScopeKey, parseLocator, position, } from '@inventarch/runtime';
|
|
17
|
+
import { Refusal, requireRoot, respell } from './consumer.js';
|
|
18
|
+
import { atom, document, entry, headerLine, quote, remedyWords, sectionLabel, terminalSafe, truncateDigest, words, } from './render.js';
|
|
19
|
+
import { openSession } from './session.js';
|
|
20
|
+
export function positionEnvelope(output) {
|
|
21
|
+
return { version: 1, ok: true, body: output.body, digest: output.digest, hostNote: output.hostNote };
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The partial key the flags name, each part as given, so the runtime checks its closed sets and caps and names the
|
|
25
|
+
* command to run when one is outside them. A seat that spells a canonical identity is a record; any other is a
|
|
26
|
+
* workspace path (`./` makes a path that would read as an identity one). A depth or budget of digits is its number;
|
|
27
|
+
* any other text is passed on for the runtime to refuse.
|
|
28
|
+
*/
|
|
29
|
+
function partialKey(args) {
|
|
30
|
+
const seat = args.value('seat'), integer = (name) => {
|
|
31
|
+
const value = args.value(name);
|
|
32
|
+
return value === undefined || !/^[0-9]+$/.test(value) ? value : Number(value);
|
|
33
|
+
};
|
|
34
|
+
const parts = {
|
|
35
|
+
seat: seat === undefined ? undefined : parseLocator(seat)?.form === 'identity' ? seat : { path: seat },
|
|
36
|
+
shape: args.value('shape'),
|
|
37
|
+
phase: args.value('phase'),
|
|
38
|
+
depth: integer('depth'),
|
|
39
|
+
budget: integer('budget'),
|
|
40
|
+
word: args.value('word'),
|
|
41
|
+
};
|
|
42
|
+
return Object.fromEntries(Object.entries(parts).filter(([, value]) => value !== undefined));
|
|
43
|
+
}
|
|
44
|
+
/** A location as `--seat` and this output spell it: the workspace root `''` as `.`. */
|
|
45
|
+
const spelled = (path) => (path === '' ? '.' : path);
|
|
46
|
+
/** A key's seat as `--seat` spells it: a location `''` as `.`, and a path that would read as an identity with `./`. */
|
|
47
|
+
function seatFlag(seat) {
|
|
48
|
+
if (seat === undefined || typeof seat === 'string')
|
|
49
|
+
return seat;
|
|
50
|
+
const path = spelled(seat.path);
|
|
51
|
+
return parseLocator(path)?.form === 'identity' ? `./${path}` : path;
|
|
52
|
+
}
|
|
53
|
+
/** The `ia position` command for a key, every part spelled so it runs as the key it names, with the invocation's root. */
|
|
54
|
+
function positionCommand(key, rooted, seat = seatFlag(key.seat)) {
|
|
55
|
+
return ([
|
|
56
|
+
'ia position',
|
|
57
|
+
...(seat === undefined ? [] : [`--seat ${quote(seat)}`]),
|
|
58
|
+
...['shape', 'phase', 'depth', 'budget', 'word'].flatMap((part) => key[part] === undefined ? [] : [`--${part} ${quote(String(key[part]))}`]),
|
|
59
|
+
].join(' ') + rooted);
|
|
60
|
+
}
|
|
61
|
+
/** The rule db D02b declares a location at a record by. */
|
|
62
|
+
const DECLARED = {
|
|
63
|
+
system: 'its system folder',
|
|
64
|
+
root: 'a root it declares',
|
|
65
|
+
repository: "the repository's own @workspace",
|
|
66
|
+
};
|
|
67
|
+
/** How an entry was first reached, in words: the row or field from its side, or its composition class. */
|
|
68
|
+
function viaText(via) {
|
|
69
|
+
if (via === undefined)
|
|
70
|
+
return 'the seat';
|
|
71
|
+
switch (via.by) {
|
|
72
|
+
case 'row':
|
|
73
|
+
return `${via.spelling} row from ${via.from}, declared by ${via.declaredBy}`;
|
|
74
|
+
case 'field':
|
|
75
|
+
return via.direction === 'out' ? `${via.field} of ${via.from}` : `its ${via.field} names ${via.from}`;
|
|
76
|
+
case 'membership':
|
|
77
|
+
return `captured under ${via.root === '' ? 'the workspace root' : via.root}`;
|
|
78
|
+
case 'word':
|
|
79
|
+
return `word member of ${via.system}`;
|
|
80
|
+
case 'claim':
|
|
81
|
+
return `claims it by ${via.matches.map((match) => `${match.field} ${match.selection}`).join(', ')}`;
|
|
82
|
+
case 'declared-at':
|
|
83
|
+
return `the record it is declared at, by ${DECLARED[via.rule]}`;
|
|
84
|
+
case 'subject':
|
|
85
|
+
return `${via.label}: ${via.matches.map((match) => `${match.field} ${match.value} (${match.record})`).join(', ')}`;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** One record entry: its identity, then its word, owner system, band, hop and reach, then its steward. */
|
|
89
|
+
const recordFacts = (record) => [
|
|
90
|
+
[atom(record.identity, 'cyan', 0)],
|
|
91
|
+
words(`@${record.word} of ${record.system}, band ${record.band}, hop ${record.hop}, ${viaText(record.via)}`, 'dim'),
|
|
92
|
+
...(record.steward === undefined ? [] : [[atom('steward', 'dim', 0), atom(record.steward, 'cyan', 2)]]),
|
|
93
|
+
...(record.workspace === undefined ? [] : [[atom('in workspace', 'dim', 0), atom(record.workspace, 'cyan', 2)]]),
|
|
94
|
+
];
|
|
95
|
+
const loadedFacts = (loaded) => 'identity' in loaded
|
|
96
|
+
? recordFacts(loaded)
|
|
97
|
+
: [[atom(spelled(loaded.path), 'cyan', 0)], words('a location, not a record', 'dim')];
|
|
98
|
+
/** One section: its label and an entry per item, or one dim line when it is empty. */
|
|
99
|
+
function section(label, items, facts, empty, caps) {
|
|
100
|
+
return [
|
|
101
|
+
sectionLabel(label, caps),
|
|
102
|
+
...(items.length === 0
|
|
103
|
+
? entry([words(empty, 'dim')], { depth: 1 }, caps)
|
|
104
|
+
: items.flatMap((item) => entry(facts(item), { depth: 1, symbol: 'info' }, caps))),
|
|
105
|
+
];
|
|
106
|
+
}
|
|
107
|
+
/** One tally line: the owner system, the count and what it counts, then that system's steward. */
|
|
108
|
+
const tallyText = (tally, what) => `${tally.system}: ${tally.count} ${what}${tally.steward === undefined ? '' : `, steward ${tally.steward}`}`;
|
|
109
|
+
/** A pointer or applies-by-word tally: the records past the listed ones of one word and owner system. */
|
|
110
|
+
const moreFacts = (tally) => [
|
|
111
|
+
words(tallyText(tally, `more @${tally.word}`)),
|
|
112
|
+
];
|
|
113
|
+
/** The key as the note names it: each part, the seat as the caller spelled it or the repository's workspace. */
|
|
114
|
+
function keyText(key) {
|
|
115
|
+
const seat = key.seat === undefined
|
|
116
|
+
? "the repository's workspace"
|
|
117
|
+
: typeof key.seat === 'string'
|
|
118
|
+
? key.seat
|
|
119
|
+
: spelled(key.seat.path);
|
|
120
|
+
const parts = `seat ${seat}, shape ${key.shape}, phase ${key.phase}, depth ${key.depth}, budget ${key.budget}`;
|
|
121
|
+
return key.word === undefined ? parts : `${parts}, word ${key.word}`;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The key used and the capture's freshness; the loaded records, the pointers and their tallies; the rules and playbooks
|
|
125
|
+
* that apply by word, with their tallies, and the playbook cells; the rules reserved outside the budget; the mandates;
|
|
126
|
+
* the frontier; the unknowns; then the two widening keys as `ia position` commands, with the root this invocation gave:
|
|
127
|
+
* one hop deeper (absent at depth 2), and the re-seat at any pointer or applies-by-word entry. Every string of the
|
|
128
|
+
* output, what a source authored (cell text, a finding's message, identities and paths) included, is escaped by
|
|
129
|
+
* `terminalSafe` before it is laid out, so no terminal control reaches the terminal; `--json` prints the output as is.
|
|
130
|
+
*/
|
|
131
|
+
export function renderPosition(output, caps, rooted = '') {
|
|
132
|
+
const { body, digest, hostNote } = terminalSafe(output), seated = body.seat.identity ?? spelled(body.seat.path ?? '');
|
|
133
|
+
const freshness = hostNote.freshness === 'stale'
|
|
134
|
+
? `stale: the capture is at revision ${truncateDigest(hostNote.capturedRevision ?? '', caps.ascii)}; run "ia capture${rooted}" to capture this one`
|
|
135
|
+
: hostNote.freshness === 'current'
|
|
136
|
+
? 'current: the capture is at this revision'
|
|
137
|
+
: 'no-capture: no capture is written; the body reads the live admitted revision';
|
|
138
|
+
const counts = body.counts;
|
|
139
|
+
const widening = [
|
|
140
|
+
...(body.widening.deeper === undefined
|
|
141
|
+
? []
|
|
142
|
+
: [remedyWords(`Run "${positionCommand(body.widening.deeper, rooted)}" for one hop deeper.`)]),
|
|
143
|
+
remedyWords(`Run "${positionCommand(body.widening.reseat, rooted, '<identity>')}" with a pointer's or an applies-by-word entry's identity to re-seat there.`),
|
|
144
|
+
];
|
|
145
|
+
return document([
|
|
146
|
+
headerLine('Position', seated, [{ text: `revision ${truncateDigest(body.revision, caps.ascii)}`, column: 50 }], caps),
|
|
147
|
+
entry([
|
|
148
|
+
[atom('key', 'dim', 0), ...words(keyText(hostNote.key), null, 2)],
|
|
149
|
+
[atom('freshness', 'dim', 0), ...words(freshness, null, 2)],
|
|
150
|
+
[atom('digest', 'dim', 0), atom(`sha256 ${truncateDigest(digest, caps.ascii)}`, null, 2)],
|
|
151
|
+
words(`${counts.loaded} loaded of ${counts.seeds} seeds and ${counts.composition} composition, ${counts.truncatedLoaded} past the budget; ${counts.rules} rules, ${counts.pointers} pointers, ${counts.appliesByWord} applying by word, ${counts.frontier} frontier`, 'dim'),
|
|
152
|
+
], { depth: 1, symbol: 'info' }, caps),
|
|
153
|
+
section('Loaded', body.loaded, loadedFacts, 'Nothing is loaded.', caps),
|
|
154
|
+
section('Pointers', body.pointers, recordFacts, 'No pointer.', caps),
|
|
155
|
+
...(body.pointerTallies.length === 0
|
|
156
|
+
? []
|
|
157
|
+
: [section('Pointer tallies', body.pointerTallies, moreFacts, '', caps)]),
|
|
158
|
+
section('Applies by word (field match, not a row)', body.appliesByWord, recordFacts, 'No rule or playbook applies by word.', caps),
|
|
159
|
+
...(body.appliesByWordTallies.length === 0
|
|
160
|
+
? []
|
|
161
|
+
: [section('Applies-by-word tallies', body.appliesByWordTallies, moreFacts, '', caps)]),
|
|
162
|
+
section('Cells', body.cells, (cell) => 'address' in cell
|
|
163
|
+
? [[atom(cell.address, 'cyan', 0)], words(cell.text)]
|
|
164
|
+
: [[atom(cell.missing, 'cyan', 0)], words(cell.message, 'dim')], 'No playbook cell.', caps),
|
|
165
|
+
section('Rules (reserved outside the budget)', body.rules, recordFacts, 'No blocking rule.', caps),
|
|
166
|
+
section('Mandates', body.mandates, recordFacts, 'No mandate governs the seat.', caps),
|
|
167
|
+
section('Frontier', body.frontier, (t) => [words(tallyText(t, `of kind ${t.kind}`))], 'No frontier.', caps),
|
|
168
|
+
section('Unknowns', body.unknowns, (unknown) => [
|
|
169
|
+
[atom(unknown.kind, null, 0), ...words(unknown.message, null, 2)],
|
|
170
|
+
...(unknown.path === undefined
|
|
171
|
+
? []
|
|
172
|
+
: [[atom(`${unknown.path}${unknown.line === undefined ? '' : `:${unknown.line}`}`, 'dim', 0)]]),
|
|
173
|
+
], 'No unknown.', caps),
|
|
174
|
+
widening.flatMap((fact) => entry([fact], { depth: 0, symbol: 'step' }, caps)),
|
|
175
|
+
], { leadingBlank: true });
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Design row 27: the one command after a refusal of the key or of its seat, with the root the invocation gave, which
|
|
179
|
+
* the runtime's own `next` (R14, R15) does not carry. The runtime's `next` names the part it corrects, and this verb
|
|
180
|
+
* names that correction as a command it runs (design §11: the same call with the printed closed set): a shape or phase
|
|
181
|
+
* outside its closed set, or a depth or budget past its cap, is this call again with the closed set or the cap in its
|
|
182
|
+
* place; a word the closure does not register is the vocabulary; a seat of another form, one the workspace does not
|
|
183
|
+
* admit, a path outside it and a seat at runtime placement are the position without it, K0, unless that seat is the one
|
|
184
|
+
* K0 takes, which names the overview of what the workspace admits.
|
|
185
|
+
*/
|
|
186
|
+
function positionNext(error, context, rooted) {
|
|
187
|
+
const [, , part] = (error.next ?? '').split(' ');
|
|
188
|
+
switch (part) {
|
|
189
|
+
case '--shape':
|
|
190
|
+
return `Run "${respell(context, { options: { shape: [`<${COORDINATE_DOMAINS.shape.join('|')}>`] } })}" with one of the five shapes.`;
|
|
191
|
+
case '--phase':
|
|
192
|
+
return `Run "${respell(context, { options: { phase: [`<${COORDINATE_DOMAINS.phase.join('|')}>`] } })}" with one of the four phases.`;
|
|
193
|
+
case '--depth':
|
|
194
|
+
return `Run "${respell(context, { options: { depth: [String(SCOPE_KEY_CAPS.depth)] } })}" for the deepest position a key admits.`;
|
|
195
|
+
case '--budget':
|
|
196
|
+
return `Run "${respell(context, { options: { budget: [String(SCOPE_KEY_CAPS.budget)] } })}" for the largest budget a key admits.`;
|
|
197
|
+
}
|
|
198
|
+
if (error.next === 'ia vocabulary')
|
|
199
|
+
return 'Run "ia vocabulary" for the words and the systems that own them; the message lists those this workspace registers.';
|
|
200
|
+
if (error.next === 'ia inspect')
|
|
201
|
+
return `Run "ia inspect${rooted}" for the overview of what the workspace admits.`;
|
|
202
|
+
return `Run "ia position${rooted}" for the position of the repository's workspace, K0.`;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* §4.1: the runtime's refusal with its code and message unchanged. The key's form (its closed sets and caps) is
|
|
206
|
+
* checked before the workspace is read, so its refusal reads nothing and is usage, exit 2; a word or seat the workspace
|
|
207
|
+
* does not answer is exit 1, as `ia inspect` refuses an identity it does not admit, located at the workspace with a
|
|
208
|
+
* seat identity as its identity.
|
|
209
|
+
*/
|
|
210
|
+
export function positionRefusal(error, context, root) {
|
|
211
|
+
if (!(error instanceof RuntimeError) || error.next === undefined)
|
|
212
|
+
return error;
|
|
213
|
+
const supplied = context.args.value('root'), rooted = supplied === undefined ? '' : ` --root ${quote(supplied)}`, seat = partialKey(context.args).seat, identity = typeof seat === 'string' ? { identity: seat } : {};
|
|
214
|
+
return new Refusal(error.code, error.message, root === undefined ? 2 : 1, root === undefined ? null : { path: root, ...identity }, positionNext(error, context, rooted));
|
|
215
|
+
}
|
|
216
|
+
export function runPosition(context) {
|
|
217
|
+
const { args, caps, json } = context;
|
|
218
|
+
const partial = partialKey(args);
|
|
219
|
+
try {
|
|
220
|
+
normalizeScopeKey(partial);
|
|
221
|
+
}
|
|
222
|
+
catch (error) {
|
|
223
|
+
throw positionRefusal(error, context, undefined);
|
|
224
|
+
}
|
|
225
|
+
const supplied = args.value('root'), rooted = supplied === undefined ? '' : ` --root ${quote(supplied)}`;
|
|
226
|
+
const root = requireRoot(context);
|
|
227
|
+
const session = openSession(root);
|
|
228
|
+
let got;
|
|
229
|
+
try {
|
|
230
|
+
got = position(session.reader, session.reader.resolveScope().token, partial);
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
throw positionRefusal(error, context, root);
|
|
234
|
+
}
|
|
235
|
+
finally {
|
|
236
|
+
session.close();
|
|
237
|
+
}
|
|
238
|
+
return json
|
|
239
|
+
? { exitCode: 0, stdout: JSON.stringify(positionEnvelope(got)) + '\n', stderr: '' }
|
|
240
|
+
: { exitCode: 0, stdout: renderPosition(got, caps, rooted), stderr: '' };
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=position.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.js","sourceRoot":"","sources":["../src/position.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,UAAU,EACV,KAAK,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,KAAK,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,UAAU,gBAAgB,CAAC,MAAsB;IACrD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,C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C,KAAK,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;IACD,OAAO,IAAI;QACT,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;QACnF,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { PacketReceipt } from '@inventarch/runtime';
|
|
2
|
+
import type { Context, Result } from './consumer.js';
|
|
3
|
+
import type { HostName } from './host-projection.js';
|
|
4
|
+
import type { Element } from './host.js';
|
|
5
|
+
import type { Capabilities } from './render.js';
|
|
6
|
+
export interface ProjectView {
|
|
7
|
+
readonly root: string;
|
|
8
|
+
readonly host: HostName;
|
|
9
|
+
/** `--root` as the invocation typed it, or undefined when the root was discovered. */
|
|
10
|
+
readonly given: string | undefined;
|
|
11
|
+
/** This plan rebuilt from the parsed arguments, `--root` as typed: the command every repair runs next. */
|
|
12
|
+
readonly invocation: string;
|
|
13
|
+
/** B1's entry count of the packet the plan renders, and its digest. */
|
|
14
|
+
readonly entries: number;
|
|
15
|
+
readonly packetDigest: string;
|
|
16
|
+
/** `ia host`'s projection element for that rendering: its file plan, its guard step, or the conflict it found. */
|
|
17
|
+
readonly projection: Element;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The plan. A host outside the adapters is usage, refused before anything is read (§3); then the root is resolved and
|
|
21
|
+
* must be initialized and free of a pending host journal, as for `ia host`, and admit, as `renderProjectionFor`
|
|
22
|
+
* requires. It reads the workspace and writes nothing.
|
|
23
|
+
*/
|
|
24
|
+
export declare function collectProject(context: Context): ProjectView;
|
|
25
|
+
/**
|
|
26
|
+
* The apply: the packet rendered again and re-planned through `ia host`'s projection element, so a file that changed
|
|
27
|
+
* since the plan refuses before anything is written, then `applyHostProjection`, which returns the receipt it wrote.
|
|
28
|
+
*/
|
|
29
|
+
export declare function applyProject(view: ProjectView): PacketReceipt;
|
|
30
|
+
/** `--json`: the plan always, and `applied`, the receipt written, only after an apply. */
|
|
31
|
+
export declare const projectEnvelope: (view: ProjectView, applied: PacketReceipt | null) => unknown;
|
|
32
|
+
/** The plan as a terminal reads it: it says nothing was written, and names the apply only when nothing refuses it. */
|
|
33
|
+
export declare function renderProjectPlan(view: ProjectView, caps: Capabilities): string;
|
|
34
|
+
/**
|
|
35
|
+
* An apply's report, read from the receipt it wrote (B12): the files with their digests, the legacy files deleted, the
|
|
36
|
+
* foreign files left in place and the guard's retirement. It says what was written, never that the host read it
|
|
37
|
+
* (design §4, adapter rule 3).
|
|
38
|
+
*/
|
|
39
|
+
export declare function renderProjectApplied(view: ProjectView, receipt: PacketReceipt, caps: Capabilities): string;
|
|
40
|
+
export declare const CONFIRMATION = "Apply this projection? [y/N] ";
|
|
41
|
+
export declare function runProject(context: Context): Promise<Result>;
|
|
42
|
+
//# sourceMappingURL=project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,KAAK,EAAY,OAAO,EAAE,MAAM,WAA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* and B12; decision cli-commands-as-operations), milestone position-packet task ia-project-verb.
|
|
4
|
+
*
|
|
5
|
+
* The workspace projection alone: the position packet of the workspace's admitted records (runtime R19), rendered by
|
|
6
|
+
* the host's adapter for the consumer target (R20) through `renderProjectionFor`, the render `ia host`, `ia doctor` and
|
|
7
|
+
* the install refresh read. It plans by default, as `ia host` and `ia install` do (B8), and the plan writes nothing: it
|
|
8
|
+
* is `ia host`'s projection element (`projectionElement`), the steward-guard retirement and the file plan an apply
|
|
9
|
+
* would make, beside the packet's entry count and digest. `--apply` re-plans through the same element
|
|
10
|
+
* (`replanProjection`) and writes through `applyHostProjection`, the one writer of projection files, which retires a
|
|
11
|
+
* steward guard an earlier release registered before any file changes (B11), deletes the owned 1.x steward files,
|
|
12
|
+
* leaves foreign ones and writes the receipt (B12). It registers no MCP server and no hook; those stay `ia host`'s,
|
|
13
|
+
* whose projection element is this same plan and apply. The packet reads the live admitted revision, so no capture is
|
|
14
|
+
* required (B8). A plan with a conflict is a successful report naming the file, as `ia host`'s is (§4); only `--apply`
|
|
15
|
+
* refuses it, before anything is asked or written, naming the plan to run once the file is out of the way. The `ia
|
|
16
|
+
* project`, `ia validate` and `ia init` commands a next action names carry the root as the invocation typed it; the
|
|
17
|
+
* `ia recover` command a pending host journal or a held host lock names carries the resolved root, because
|
|
18
|
+
* its distribution mechanism takes only an absolute root, and a workspace whose sources cannot be opened names the resolved
|
|
19
|
+
* root, as for every workspace verb (`openSession`).
|
|
20
|
+
*/
|
|
21
|
+
import { workspaceRow } from '@inventarch/distribution/hosts';
|
|
22
|
+
import { confirm, Refusal, requireRoot } from './consumer.js';
|
|
23
|
+
import { applyHostProjection, renderProjectionFor } from './host-projection.js';
|
|
24
|
+
import { GUARD_RETIRE, GUARD_RETIRED, GUARD_SCOPE, projectionElement, projectionFailure, projectionFileRows, projectionRepair, replanProjection, requireIdle, requireInitialized, rootedNext, STATE, } from './host.js';
|
|
25
|
+
import { atom, commandFacts, document, entry, fieldRows, headerLine, indentOf, quote, remedyWords, sectionLabel, truncateDigest, words, } from './render.js';
|
|
26
|
+
/**
|
|
27
|
+
* The host a positional names, when the host table gives it a workspace set; null for any other. Those are the hosts an
|
|
28
|
+
* adapter renders the packet for (runtime R20), because `renderProjectionFor` takes only a workspace host.
|
|
29
|
+
*/
|
|
30
|
+
const projectHost = (named) => named === undefined ? null : (workspaceRow(named)?.id ?? null);
|
|
31
|
+
/** Design row 27: the repair a conflict needs, worded as `ia host` words it, then this plan, which shows the file. */
|
|
32
|
+
const conflictNext = (view, conflict) => projectionRepair(view.host, conflict.path, view.invocation, conflict.code);
|
|
33
|
+
const conflictRefusal = (view, conflict) => new Refusal(conflict.code, conflict.reason, 3, { path: conflict.path }, conflictNext(view, conflict));
|
|
34
|
+
/**
|
|
35
|
+
* The plan. A host outside the adapters is usage, refused before anything is read (§3); then the root is resolved and
|
|
36
|
+
* must be initialized and free of a pending host journal, as for `ia host`, and admit, as `renderProjectionFor`
|
|
37
|
+
* requires. It reads the workspace and writes nothing.
|
|
38
|
+
*/
|
|
39
|
+
export function collectProject(context) {
|
|
40
|
+
const { args } = context;
|
|
41
|
+
const given = args.value('root'), option = given === undefined ? '' : ` --root ${quote(given)}`, named = args.positionals[0] ?? '', host = projectHost(named);
|
|
42
|
+
if (host === null)
|
|
43
|
+
throw new Refusal('IA-CLI-USAGE', `ia project takes claude or codex; got ${named}`, 2, null, `Run "ia project claude${option}" to plan the Claude projection, or name codex in its place.`);
|
|
44
|
+
const root = requireRoot(context);
|
|
45
|
+
requireInitialized(root, given ?? root);
|
|
46
|
+
// The journal's recovery names the resolved root: the distribution mechanism takes only an absolute one.
|
|
47
|
+
requireIdle(root, root);
|
|
48
|
+
const rendered = renderProjectionFor(root, host);
|
|
49
|
+
return {
|
|
50
|
+
root,
|
|
51
|
+
host,
|
|
52
|
+
given,
|
|
53
|
+
invocation: `ia project ${host}${option}`,
|
|
54
|
+
entries: rendered.receipt.entries,
|
|
55
|
+
packetDigest: rendered.receipt.packetDigest,
|
|
56
|
+
projection: projectionElement(root, host, rendered),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A failed apply, named as `ia host` names one: a pending host journal's recovery, a held host lock's, or else the
|
|
61
|
+
* apply again, which converges whatever it found written (`applyHostProjection`).
|
|
62
|
+
*/
|
|
63
|
+
function applyFailure(error, view) {
|
|
64
|
+
return projectionFailure(error, view.root, view.host, `${view.invocation} --apply`);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The apply: the packet rendered again and re-planned through `ia host`'s projection element, so a file that changed
|
|
68
|
+
* since the plan refuses before anything is written, then `applyHostProjection`, which returns the receipt it wrote.
|
|
69
|
+
*/
|
|
70
|
+
export function applyProject(view) {
|
|
71
|
+
const rendered = renderProjectionFor(view.root, view.host);
|
|
72
|
+
replanProjection(view.root, view.host, rendered, (conflict) => conflictRefusal(view, conflict));
|
|
73
|
+
try {
|
|
74
|
+
// A render's apply always writes its receipt; only a removal, which this verb never runs, leaves none.
|
|
75
|
+
return applyHostProjection(view.root, view.host, rendered).receipt;
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
throw applyFailure(error, view);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** `--json`: the plan always, and `applied`, the receipt written, only after an apply. */
|
|
82
|
+
export const projectEnvelope = (view, applied) => ({
|
|
83
|
+
version: 1,
|
|
84
|
+
command: 'project',
|
|
85
|
+
root: view.root,
|
|
86
|
+
host: view.host,
|
|
87
|
+
apply: applied !== null,
|
|
88
|
+
plan: {
|
|
89
|
+
entries: view.entries,
|
|
90
|
+
packetDigest: view.packetDigest,
|
|
91
|
+
// With a conflict `files` is empty and `guard` null: an apply refuses it, so it writes and retires nothing.
|
|
92
|
+
files: view.projection.files ?? [],
|
|
93
|
+
guard: view.projection.guard ?? null,
|
|
94
|
+
conflict: view.projection.conflict,
|
|
95
|
+
},
|
|
96
|
+
...(applied === null ? {} : { applied }),
|
|
97
|
+
});
|
|
98
|
+
const headerBlock = (label, value, view, digest, caps) => [
|
|
99
|
+
...headerLine(label, value, [{ text: `packet ${truncateDigest(digest, caps.ascii)}`, column: 35 }], caps),
|
|
100
|
+
...headerLine('Root', view.root, [], caps),
|
|
101
|
+
];
|
|
102
|
+
/** The packet, the B11 step and any conflict, then the file plan in `ia host`'s words, then the guard's note. */
|
|
103
|
+
function planBlocks(view, caps) {
|
|
104
|
+
const { conflict, files, guard } = view.projection;
|
|
105
|
+
const fields = [
|
|
106
|
+
{
|
|
107
|
+
symbol: 'info',
|
|
108
|
+
label: 'packet',
|
|
109
|
+
value: words(`${view.entries} entries, digest ${truncateDigest(view.packetDigest, caps.ascii)}`),
|
|
110
|
+
},
|
|
111
|
+
...(guard === undefined
|
|
112
|
+
? []
|
|
113
|
+
: [
|
|
114
|
+
{
|
|
115
|
+
symbol: guard === 'retire' ? 'success' : 'info',
|
|
116
|
+
label: 'guard',
|
|
117
|
+
value: words(guard === 'retire' ? GUARD_RETIRE : 'no steward guard to retire'),
|
|
118
|
+
},
|
|
119
|
+
]),
|
|
120
|
+
...(conflict === null
|
|
121
|
+
? []
|
|
122
|
+
: [
|
|
123
|
+
{
|
|
124
|
+
symbol: 'error',
|
|
125
|
+
label: 'refused',
|
|
126
|
+
value: words(`${conflict.code} ${conflict.reason}`),
|
|
127
|
+
action: remedyWords(conflictNext(view, conflict)),
|
|
128
|
+
},
|
|
129
|
+
]),
|
|
130
|
+
];
|
|
131
|
+
return [
|
|
132
|
+
[sectionLabel('Projection', caps), ...fieldRows(fields, { depth: 1 }, caps)],
|
|
133
|
+
files === undefined ? [] : [sectionLabel('Files', caps), ...projectionFileRows(files, indentOf(1), caps)],
|
|
134
|
+
guard === 'retire' ? entry([words(GUARD_SCOPE)], { depth: 1, symbol: 'info' }, caps) : [],
|
|
135
|
+
];
|
|
136
|
+
}
|
|
137
|
+
const applyFacts = (view, caps) => commandFacts('Apply with "', `${view.invocation} --apply --yes`, '".', 3, caps);
|
|
138
|
+
/** The plan as a terminal reads it: it says nothing was written, and names the apply only when nothing refuses it. */
|
|
139
|
+
export function renderProjectPlan(view, caps) {
|
|
140
|
+
return document([
|
|
141
|
+
headerBlock('Plan', `project ${view.host}`, view, view.packetDigest, caps),
|
|
142
|
+
entry([words('This is a preview. Nothing has been written.')], { depth: 1 }, caps),
|
|
143
|
+
...planBlocks(view, caps),
|
|
144
|
+
view.projection.conflict === null ? entry(applyFacts(view, caps), { depth: 0, symbol: 'step' }, caps) : [],
|
|
145
|
+
], { leadingBlank: true });
|
|
146
|
+
}
|
|
147
|
+
/** §2.8 rule 3's summary: the plan without its note or footer, because the question is the action. */
|
|
148
|
+
const renderProjectSummary = (view, caps) => document([headerBlock('Plan', `project ${view.host}`, view, view.packetDigest, caps), ...planBlocks(view, caps)], {
|
|
149
|
+
leadingBlank: true,
|
|
150
|
+
});
|
|
151
|
+
/**
|
|
152
|
+
* An apply's report, read from the receipt it wrote (B12): the files with their digests, the legacy files deleted, the
|
|
153
|
+
* foreign files left in place and the guard's retirement. It says what was written, never that the host read it
|
|
154
|
+
* (design §4, adapter rule 3).
|
|
155
|
+
*/
|
|
156
|
+
export function renderProjectApplied(view, receipt, caps) {
|
|
157
|
+
const digest = (value) => truncateDigest(value, caps.ascii);
|
|
158
|
+
const listed = (label, rows, symbol) => rows.length === 0
|
|
159
|
+
? []
|
|
160
|
+
: [
|
|
161
|
+
sectionLabel(label, caps),
|
|
162
|
+
...rows.flatMap((row) => entry([
|
|
163
|
+
[
|
|
164
|
+
atom(row.path, 'cyan', 0),
|
|
165
|
+
...(row.sha256 === undefined ? [] : words(`sha256 ${digest(row.sha256)}`, 'dim', 2)),
|
|
166
|
+
],
|
|
167
|
+
], { depth: 1, symbol }, caps)),
|
|
168
|
+
];
|
|
169
|
+
const doctor = `ia doctor${view.given === undefined ? '' : ` --root ${quote(view.given)}`}`;
|
|
170
|
+
return document([
|
|
171
|
+
headerBlock('Project', view.host, view, receipt.packetDigest, caps),
|
|
172
|
+
entry([
|
|
173
|
+
words(`Projected ${receipt.entries} entries for ${view.host}: written; not observed being read.`),
|
|
174
|
+
...(receipt.guard === 'retired' ? [words(GUARD_RETIRED)] : []),
|
|
175
|
+
], { depth: 1, symbol: 'success' }, caps),
|
|
176
|
+
[sectionLabel('Receipt', caps), ...entry([[atom(STATE.receipt(view.host), 'cyan', 0)]], { depth: 1 }, caps)],
|
|
177
|
+
listed('Files', receipt.files, 'added'),
|
|
178
|
+
listed('Removed', receipt.removed, 'removed'),
|
|
179
|
+
listed('Foreign, left in place', receipt.foreign.map((path) => ({ path })), 'info'),
|
|
180
|
+
entry([remedyWords(`Run "${doctor}" for the observed projection state.`)], { depth: 0, symbol: 'step' }, caps),
|
|
181
|
+
], { leadingBlank: true });
|
|
182
|
+
}
|
|
183
|
+
export const CONFIRMATION = 'Apply this projection? [y/N] ';
|
|
184
|
+
/** A refusal another module worded, its `ia validate` and `ia project` commands given `--root` as typed. */
|
|
185
|
+
function rootedRefusal(context, error) {
|
|
186
|
+
const given = context.args.value('root'), host = projectHost(context.args.positionals[0]);
|
|
187
|
+
if (!(error instanceof Refusal) || error.next === null || given === undefined || host === null)
|
|
188
|
+
return error;
|
|
189
|
+
return new Refusal(error.code, error.message, error.exit, error.where, rootedNext(error.next, host, given), error.at);
|
|
190
|
+
}
|
|
191
|
+
export async function runProject(context) {
|
|
192
|
+
const { args, caps, host, json } = context;
|
|
193
|
+
let view;
|
|
194
|
+
try {
|
|
195
|
+
view = collectProject(context);
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
throw rootedRefusal(context, error);
|
|
199
|
+
}
|
|
200
|
+
const report = (applied) => json
|
|
201
|
+
? { exitCode: 0, stdout: JSON.stringify(projectEnvelope(view, applied)) + '\n', stderr: '' }
|
|
202
|
+
: {
|
|
203
|
+
exitCode: 0,
|
|
204
|
+
stdout: applied === null ? renderProjectPlan(view, caps) : renderProjectApplied(view, applied, caps),
|
|
205
|
+
stderr: '',
|
|
206
|
+
};
|
|
207
|
+
// §4: a plan with a conflict is a successful report; only --apply refuses it, before it asks anything.
|
|
208
|
+
if (!args.flag('apply'))
|
|
209
|
+
return report(null);
|
|
210
|
+
if (view.projection.conflict !== null)
|
|
211
|
+
throw conflictRefusal(view, view.projection.conflict);
|
|
212
|
+
// §2.8 rule 3. Parsing has already refused every --apply whose question cannot be asked or answered.
|
|
213
|
+
if (!args.flag('yes') && !(await confirm(host.interaction, renderProjectSummary(view, caps), CONFIRMATION)))
|
|
214
|
+
return {
|
|
215
|
+
exitCode: 0,
|
|
216
|
+
stdout: document([
|
|
217
|
+
entry([words('Nothing was applied.')], { depth: 0, symbol: 'info' }, caps),
|
|
218
|
+
entry(applyFacts(view, caps), { depth: 0, symbol: 'step' }, caps),
|
|
219
|
+
], { leadingBlank: true }),
|
|
220
|
+
stderr: '',
|
|
221
|
+
};
|
|
222
|
+
host.signal?.throwIfAborted();
|
|
223
|
+
let receipt;
|
|
224
|
+
try {
|
|
225
|
+
receipt = applyProject(view);
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
throw rootedRefusal(context, error);
|
|
229
|
+
}
|
|
230
|
+
return report(receipt);
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAG9D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhF,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EACl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C;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC"}
|
package/dist/read.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReadBody, ReadRefusal } from '@inventarch/runtime';
|
|
1
|
+
import type { ReadBody, ReadBodyOptions, ReadRefusal } from '@inventarch/runtime';
|
|
2
2
|
import type { Context, Result } from './consumer.js';
|
|
3
3
|
import { Refusal } from './consumer.js';
|
|
4
4
|
import type { Capabilities } from './render.js';
|
|
@@ -6,7 +6,11 @@ import type { Session } from './session.js';
|
|
|
6
6
|
/** The line every human read prints beside the digest (IM-43). */
|
|
7
7
|
export declare const NOT_CERTIFIED = "body not certified by this read";
|
|
8
8
|
export declare function readEnvelope(body: ReadBody): unknown;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* What was read, its digest and the not-certified line, then the body exactly as read. The header's identity, locator
|
|
11
|
+
* and path are escaped by `terminalText`; the body is the source's own bytes, terminal controls included, and `--json`
|
|
12
|
+
* is the form that escapes them (apps/cli/SPEC.md, `read`).
|
|
13
|
+
*/
|
|
10
14
|
export declare function renderRead(body: ReadBody, caps: Capabilities): string;
|
|
11
15
|
/**
|
|
12
16
|
* §4.1: the runtime's read refusal with its code and message unchanged. A locator that answers no record, or no part of
|
|
@@ -17,5 +21,11 @@ export declare function renderRead(body: ReadBody, caps: Capabilities): string;
|
|
|
17
21
|
export declare function readRefusal(refusal: ReadRefusal, context: Pick<Context, 'args'>, root: string,
|
|
18
22
|
/** The workspace, still open, so an identity no source holds is answered as `ia inspect` answers it. */
|
|
19
23
|
reader?: Session['reader']): Refusal;
|
|
24
|
+
/**
|
|
25
|
+
* What `ia read` hands the runtime: the workspace file reader the capture already uses, and the directory
|
|
26
|
+
* `.ia/workspace.json` binds each adopted mount to. The runtime Door reads through db `readWorkspaceBytes` and the same
|
|
27
|
+
* bindings, and tests/read.test.ts holds the two to the same bodies, digests and refusals.
|
|
28
|
+
*/
|
|
29
|
+
export declare function readOptions(root: string, reader: Session['reader'], includeRuntime: boolean): ReadBodyOptions;
|
|
20
30
|
export declare function runRead(context: Context): Result;
|
|
21
31
|
//# sourceMappingURL=read.d.ts.map
|
package/dist/read.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,OAAO,EAAe,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,kEAAkE;AAClE,eAAO,MAAM,aAAa,oCAAoC,CAAC;AAE/D,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAWpD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAuBrE;AA8BD;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAC9B,IAAI,EAAE,MAAM;AACZ,wGAAwG;AACxG,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GACzB,OAAO,CAeT;AAeD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,OAAO,GAAG,eAAe,CAM7G;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CA4BhD"}
|