orizu 0.5.37 → 0.5.39
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 +18 -3
- package/dist/app-commands.d.ts.map +1 -1
- package/dist/app-commands.js +215 -57
- package/dist/app-publish-failure.d.ts +6 -0
- package/dist/app-publish-failure.d.ts.map +1 -0
- package/dist/app-publish-failure.js +9 -0
- package/dist/app-publish-paths.d.ts +4 -0
- package/dist/app-publish-paths.d.ts.map +1 -0
- package/dist/app-publish-paths.js +32 -0
- package/dist/app-publish-workspace.d.ts +16 -0
- package/dist/app-publish-workspace.d.ts.map +1 -0
- package/dist/app-publish-workspace.js +175 -0
- package/dist/artifacts-git-runtime.d.ts +5 -0
- package/dist/artifacts-git-runtime.d.ts.map +1 -1
- package/dist/artifacts-git-runtime.js +70 -25
- package/dist/artifacts-session-merge.d.ts +62 -0
- package/dist/artifacts-session-merge.d.ts.map +1 -0
- package/dist/artifacts-session-merge.js +123 -0
- package/dist/dataset-append-workflow.d.ts +12 -0
- package/dist/dataset-append-workflow.d.ts.map +1 -0
- package/dist/dataset-append-workflow.js +198 -0
- package/dist/dataset-commands.d.ts.map +1 -1
- package/dist/dataset-commands.js +11 -130
- package/dist/dataset-transfer-download.js +6 -6
- package/dist/dataset-transfer-upload.js +8 -8
- package/dist/git-credential.d.ts +1 -1
- package/dist/git-credential.d.ts.map +1 -1
- package/dist/git-credential.js +8 -1
- package/dist/help.js +3 -3
- package/dist/hosted-boot.d.ts +11 -0
- package/dist/hosted-boot.d.ts.map +1 -1
- package/dist/hosted-boot.js +46 -1
- package/dist/hosted-harvest.d.ts.map +1 -1
- package/dist/hosted-harvest.js +11 -1
- package/dist/hosted-session-cli.d.ts.map +1 -1
- package/dist/hosted-session-cli.js +6 -1
- package/dist/hosted-session-seed.d.ts +45 -0
- package/dist/hosted-session-seed.d.ts.map +1 -0
- package/dist/hosted-session-seed.js +61 -0
- package/dist/hosted-skill-staging.d.ts +8 -3
- package/dist/hosted-skill-staging.d.ts.map +1 -1
- package/dist/hosted-skill-staging.js +10 -3
- package/dist/jsonl-stream.d.ts +1 -0
- package/dist/jsonl-stream.d.ts.map +1 -1
- package/dist/jsonl-stream.js +7 -0
- package/dist/provider-list-workflow.d.ts +3 -0
- package/dist/provider-list-workflow.d.ts.map +1 -0
- package/dist/provider-list-workflow.js +95 -0
- package/dist/provider-wire-record.d.ts +3 -0
- package/dist/provider-wire-record.d.ts.map +1 -0
- package/dist/provider-wire-record.js +4 -0
- package/dist/providers-cli.d.ts.map +1 -1
- package/dist/providers-cli.js +5 -15
- package/dist/publish-merge-job.d.ts +68 -0
- package/dist/publish-merge-job.d.ts.map +1 -0
- package/dist/publish-merge-job.js +320 -0
- package/dist/publish-merge-timing.d.ts +18 -0
- package/dist/publish-merge-timing.d.ts.map +1 -0
- package/dist/publish-merge-timing.js +23 -0
- package/dist/workbench-cli.d.ts +4 -0
- package/dist/workbench-cli.d.ts.map +1 -1
- package/dist/workbench-cli.js +11 -1
- package/dist/workspace-bootstrap-job.d.ts +1 -0
- package/dist/workspace-bootstrap-job.d.ts.map +1 -1
- package/dist/workspace-bootstrap-job.js +1 -1
- package/package.json +5 -2
- package/src/app-commands.ts +234 -66
- package/src/app-publish-failure.ts +7 -0
- package/src/app-publish-paths.ts +27 -0
- package/src/app-publish-workspace.ts +207 -0
- package/src/artifacts-git-runtime.ts +73 -31
- package/src/artifacts-session-merge.ts +253 -0
- package/src/dataset-append-workflow.ts +205 -0
- package/src/dataset-commands.ts +10 -170
- package/src/dataset-transfer-download.ts +5 -5
- package/src/dataset-transfer-upload.ts +7 -7
- package/src/git-credential.ts +8 -1
- package/src/help.ts +3 -3
- package/src/hosted-boot.ts +56 -1
- package/src/hosted-harvest.ts +11 -1
- package/src/hosted-session-cli.ts +6 -1
- package/src/hosted-session-seed.ts +78 -0
- package/src/hosted-skill-staging.ts +11 -3
- package/src/jsonl-stream.ts +8 -0
- package/src/provider-list-workflow.ts +108 -0
- package/src/provider-wire-record.ts +4 -0
- package/src/providers-cli.ts +5 -13
- package/src/publish-merge-job.ts +350 -0
- package/src/publish-merge-timing.ts +27 -0
- package/src/workbench-cli.ts +15 -1
- package/src/workspace-bootstrap-job.ts +1 -1
- package/vendor/skills/orizu/flows/onboard.md +1 -1
- package/vendor/skills/orizu/references/authority-map.md +2 -2
- package/vendor/skills/orizu/references/building-apps.md +24 -0
- package/vendor/skills/orizu/references/cli-reference.md +13 -4
- package/vendor/skills/orizu/references/optimization-reports.md +1 -1
- package/vendor/skills/orizu/references/primer.md +1 -0
- package/vendor/skills/orizu/references/prompt-control-plane.md +9 -5
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { statSync } from 'node:fs';
|
|
2
|
+
import { extname } from 'node:path';
|
|
3
|
+
import { Context, Effect, Result, Schema } from 'effect';
|
|
4
|
+
import { parseDatasetFile } from './file-parser.js';
|
|
5
|
+
import { datasetTransferTimeoutMs } from './dataset-transfer-policy.js';
|
|
6
|
+
import { authedFetch } from './http.js';
|
|
7
|
+
import { streamJsonlRowChunks } from './jsonl-stream.js';
|
|
8
|
+
import { sanitizeTerminalText } from './json-response.js';
|
|
9
|
+
class AppendFailure extends Error {
|
|
10
|
+
outcome;
|
|
11
|
+
_tag = 'AppendFailure';
|
|
12
|
+
constructor(message, outcome) {
|
|
13
|
+
super(sanitizeTerminalText(message));
|
|
14
|
+
this.outcome = outcome;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const Acknowledgement = Schema.Struct({
|
|
18
|
+
dataset: Schema.Struct({ id: Schema.String, name: Schema.String, rowCount: Schema.Natural }),
|
|
19
|
+
appendedCount: Schema.Natural,
|
|
20
|
+
});
|
|
21
|
+
const RowsSchema = Schema.Array(Schema.Record(Schema.String, Schema.Unknown));
|
|
22
|
+
const appendTransport = Context.Service('orizu/cli/DatasetAppendTransport');
|
|
23
|
+
// Only responses naming an existing rows-route rejection establish a known
|
|
24
|
+
// refusal. A proxy body or a lost body is not evidence that nothing committed.
|
|
25
|
+
function isKnownRefusal(message, status) {
|
|
26
|
+
// These exact templates come from artifact preparation before the append RPC.
|
|
27
|
+
// Status alone or an arbitrary artifact/proxy prefix cannot prove rejection.
|
|
28
|
+
if (status === 400 && (message === 'Dataset row id cannot be stored as an artifact' ||
|
|
29
|
+
/^Invalid dataset row artifact reference at .+$/.test(message) ||
|
|
30
|
+
/^Dataset row artifact ref at .+ (?:is nested; v1 supports top-level fields only|was not issued by this server|belongs to a different project|has been deleted|has not been finalized|is expired|was issued to a different user|is not attachable|does not match server metadata|targets a different (?:dataset|field|row id))$/.test(message)))
|
|
31
|
+
return true;
|
|
32
|
+
if (status === 413 && (/^Dataset row .+ exceeds 65536 bytes after externalizing top-level fields$/.test(message) ||
|
|
33
|
+
/^.+ exceeds (?:26214400 bytes before compression|10485760 bytes after compression)$/.test(message)))
|
|
34
|
+
return true;
|
|
35
|
+
return /^(Missing bearer token|Unauthorized|Dataset not found|Only project curators\/admins can modify dataset rows|Dataset is locked and cannot be mutated|Duplicate row ids provided|One or more row ids already exist in this dataset|rows must contain at least one item|rows\[\d+\] must be an object|Dataset row is too large|Each row in p_rows must)/.test(message);
|
|
36
|
+
}
|
|
37
|
+
function liveTransport(timeoutMs, commandSignal, progress) {
|
|
38
|
+
return {
|
|
39
|
+
append: (datasetId, rows) => Effect.suspend(() => {
|
|
40
|
+
let admitted = false;
|
|
41
|
+
let timedOut = false;
|
|
42
|
+
const attempt = new AbortController();
|
|
43
|
+
let timer;
|
|
44
|
+
return Effect.tryPromise({
|
|
45
|
+
try: async (signal) => {
|
|
46
|
+
const abortFromEffect = () => attempt.abort(signal.reason);
|
|
47
|
+
const abortFromCommand = () => attempt.abort(commandSignal.reason);
|
|
48
|
+
try {
|
|
49
|
+
// Node 20.0 has no AbortSignal.any. This attempt owns both links
|
|
50
|
+
// and the physical fetch/body signal until its receipt is consumed.
|
|
51
|
+
if (signal.aborted)
|
|
52
|
+
abortFromEffect();
|
|
53
|
+
else
|
|
54
|
+
signal.addEventListener('abort', abortFromEffect, { once: true });
|
|
55
|
+
if (commandSignal.aborted)
|
|
56
|
+
abortFromCommand();
|
|
57
|
+
else
|
|
58
|
+
commandSignal.addEventListener('abort', abortFromCommand, { once: true });
|
|
59
|
+
const response = await authedFetch(`/api/cli/datasets/${encodeURIComponent(datasetId)}/rows`, {
|
|
60
|
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
61
|
+
body: JSON.stringify({ rows }), signal: attempt.signal,
|
|
62
|
+
}, () => {
|
|
63
|
+
admitted = true;
|
|
64
|
+
if (progress.chunk)
|
|
65
|
+
progress.chunk.outcome = 'unknown';
|
|
66
|
+
if (timer)
|
|
67
|
+
clearTimeout(timer);
|
|
68
|
+
timer = setTimeout(() => { timedOut = true; attempt.abort(); }, timeoutMs);
|
|
69
|
+
});
|
|
70
|
+
// The single admitted-attempt deadline includes the complete body.
|
|
71
|
+
const text = await response.text();
|
|
72
|
+
let value;
|
|
73
|
+
try {
|
|
74
|
+
value = JSON.parse(text);
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
throw new AppendFailure('Append returned an invalid acknowledgement', 'unknown');
|
|
78
|
+
}
|
|
79
|
+
if (!response.ok) {
|
|
80
|
+
const message = value && typeof value === 'object' && 'error' in value && typeof value.error === 'string' ? value.error : '';
|
|
81
|
+
const known = response.status >= 400 && response.status < 500 && isKnownRefusal(message, response.status);
|
|
82
|
+
throw new AppendFailure(message ? `Append failed: ${message}` : 'Append failed', known ? 'rejected' : 'unknown');
|
|
83
|
+
}
|
|
84
|
+
const result = Schema.decodeUnknownResult(Acknowledgement)(value);
|
|
85
|
+
if (Result.isFailure(result) || result.success.dataset.id.toLowerCase() !== datasetId.toLowerCase() || result.success.appendedCount !== rows.length)
|
|
86
|
+
throw new AppendFailure('Append returned an invalid acknowledgement', 'unknown');
|
|
87
|
+
return result.success;
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
if (timer)
|
|
91
|
+
clearTimeout(timer);
|
|
92
|
+
signal.removeEventListener('abort', abortFromEffect);
|
|
93
|
+
commandSignal.removeEventListener('abort', abortFromCommand);
|
|
94
|
+
attempt.abort();
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
catch: cause => cause instanceof AppendFailure ? cause : new AppendFailure(timedOut ? 'DATASET_TRANSFER_TIMEOUT: Dataset append exceeded its deadline' : admitted ? 'fetch failed' : cause instanceof Error ? cause.message : 'Append failed before the request was sent', admitted ? 'unknown' : 'not_sent'),
|
|
98
|
+
});
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function recovery(progress) {
|
|
103
|
+
if (progress.chunk?.outcome === 'unknown')
|
|
104
|
+
return 'This chunk may already be committed. Inspect the dataset and reconcile its rows before rerunning; do not blindly repeat this write.';
|
|
105
|
+
if (progress.confirmedRows > 0)
|
|
106
|
+
return 'Earlier acknowledged rows remain appended. Inspect the confirmed source prefix before retrying the remaining input.';
|
|
107
|
+
return 'Resolve the reported error before rerunning the command.';
|
|
108
|
+
}
|
|
109
|
+
function appendProgram(input, timeoutMs, progress, io, signal) {
|
|
110
|
+
return Effect.gen(function* () {
|
|
111
|
+
const rows = yield* Effect.try({
|
|
112
|
+
try: () => {
|
|
113
|
+
if (extname(input.file).toLowerCase() === '.jsonl')
|
|
114
|
+
return undefined;
|
|
115
|
+
let bytes;
|
|
116
|
+
try {
|
|
117
|
+
bytes = statSync(input.file).size;
|
|
118
|
+
}
|
|
119
|
+
catch (cause) {
|
|
120
|
+
const error = cause;
|
|
121
|
+
if (error.code === 'ENOENT')
|
|
122
|
+
throw new Error(`File not found: ${input.file}. Check the path and filename, then retry.`);
|
|
123
|
+
if (error.code === 'EPERM' || error.code === 'EACCES')
|
|
124
|
+
throw new Error(`Cannot read file: ${input.file}. Grant folder permission to your terminal app and retry.`);
|
|
125
|
+
throw new Error(`Failed to access file ${input.file}: ${error.message}`);
|
|
126
|
+
}
|
|
127
|
+
if (bytes > 50 * 1024 * 1024)
|
|
128
|
+
throw new Error(`Input file is ${(bytes / (1024 * 1024)).toFixed(1)} MB, which exceeds the 50 MB limit. Split the file into smaller parts and append each separately.`);
|
|
129
|
+
const parsed = parseDatasetFile(input.file).rows;
|
|
130
|
+
if (!Array.isArray(parsed) || parsed.length === 0)
|
|
131
|
+
throw new Error('Dataset append file must contain at least one row');
|
|
132
|
+
return parsed;
|
|
133
|
+
},
|
|
134
|
+
catch: cause => new AppendFailure(cause instanceof Error ? cause.message : 'Could not read append input', 'not_sent'),
|
|
135
|
+
});
|
|
136
|
+
const source = yield* Effect.acquireRelease(Effect.sync(() => rows ? (async function* () {
|
|
137
|
+
for (let offset = 0; offset < rows.length; offset += 500)
|
|
138
|
+
yield rows.slice(offset, offset + 500);
|
|
139
|
+
})() : streamJsonlRowChunks(input.file, { signal })), iterator => Effect.promise(async () => { await iterator.return(undefined); }));
|
|
140
|
+
const transport = liveTransport(timeoutMs, signal, progress);
|
|
141
|
+
let acknowledgement;
|
|
142
|
+
let index = 0;
|
|
143
|
+
while (true) {
|
|
144
|
+
const next = yield* Effect.tryPromise({ try: () => source.next(), catch: cause => new AppendFailure(cause instanceof Error ? cause.message : 'Could not read append input', 'not_sent') });
|
|
145
|
+
if (next.done)
|
|
146
|
+
break;
|
|
147
|
+
index++;
|
|
148
|
+
progress.chunk = { index, inputRows: next.value.length, outcome: 'not_sent' };
|
|
149
|
+
const rows = yield* Schema.decodeUnknownEffect(RowsSchema)(next.value).pipe(Effect.mapError(() => new AppendFailure('Dataset rows must be JSON objects', 'not_sent')));
|
|
150
|
+
if (!io.json)
|
|
151
|
+
yield* Effect.sync(() => io.print(`Uploading chunk ${index} (${rows.length} rows)...`));
|
|
152
|
+
acknowledgement = yield* appendTransport.use(api => api.append(input.datasetId, rows)).pipe(Effect.provideService(appendTransport, transport));
|
|
153
|
+
progress.confirmedRows += acknowledgement.appendedCount;
|
|
154
|
+
progress.confirmedChunks++;
|
|
155
|
+
progress.chunk = null;
|
|
156
|
+
}
|
|
157
|
+
if (!acknowledgement)
|
|
158
|
+
return yield* Effect.fail(new AppendFailure('Dataset append file must contain at least one row', 'not_sent'));
|
|
159
|
+
return { dataset: acknowledgement.dataset, appendedCount: progress.confirmedRows };
|
|
160
|
+
}).pipe(Effect.scoped);
|
|
161
|
+
}
|
|
162
|
+
/** Owns standalone append's source, admitted writes, progress and recovery. */
|
|
163
|
+
export async function appendDatasetWorkflow(resolveInput, io) {
|
|
164
|
+
const controller = new AbortController();
|
|
165
|
+
const progress = { datasetId: null, confirmedRows: 0, confirmedChunks: 0, chunk: null };
|
|
166
|
+
let interrupted;
|
|
167
|
+
const interrupt = () => { interrupted = 130; controller.abort(); };
|
|
168
|
+
const terminate = () => { interrupted = 143; controller.abort(); };
|
|
169
|
+
const program = Effect.gen(function* () {
|
|
170
|
+
const timeoutMs = yield* Effect.try({ try: datasetTransferTimeoutMs, catch: cause => new AppendFailure(cause instanceof Error ? cause.message : 'Invalid append configuration', 'not_sent') });
|
|
171
|
+
const input = yield* Effect.tryPromise({ try: resolveInput, catch: cause => new AppendFailure(cause instanceof Error ? cause.message : 'Could not resolve append input', 'not_sent') });
|
|
172
|
+
progress.datasetId = input.datasetId;
|
|
173
|
+
// Retained interactive selection does not accept a signal. Preserve
|
|
174
|
+
// natural Node termination until we own cancellable source/transport work.
|
|
175
|
+
return yield* Effect.acquireUseRelease(Effect.sync(() => { process.once('SIGINT', interrupt); process.once('SIGTERM', terminate); }), () => appendProgram(input, timeoutMs, progress, io, controller.signal), () => Effect.sync(() => { process.removeListener('SIGINT', interrupt); process.removeListener('SIGTERM', terminate); }));
|
|
176
|
+
});
|
|
177
|
+
const report = (message) => {
|
|
178
|
+
const error = sanitizeTerminalText(message);
|
|
179
|
+
const advice = recovery(progress);
|
|
180
|
+
io.print(io.json ? JSON.stringify({ error, datasetId: progress.datasetId, confirmedRows: progress.confirmedRows, confirmedChunks: progress.confirmedChunks, failedChunk: progress.chunk, recovery: advice })
|
|
181
|
+
: `${error}\n${progress.confirmedRows} rows from ${progress.confirmedChunks} chunk(s) were already appended. ${advice}`);
|
|
182
|
+
};
|
|
183
|
+
try {
|
|
184
|
+
const result = await Effect.runPromise(Effect.result(program), { signal: controller.signal });
|
|
185
|
+
if (Result.isFailure(result)) {
|
|
186
|
+
if (progress.chunk)
|
|
187
|
+
progress.chunk.outcome = result.failure.outcome;
|
|
188
|
+
report(result.failure.message);
|
|
189
|
+
return 1;
|
|
190
|
+
}
|
|
191
|
+
io.print(io.json ? JSON.stringify(result.success) : `Appended ${result.success.appendedCount} rows to dataset ${sanitizeTerminalText(result.success.dataset.name)} (${sanitizeTerminalText(result.success.dataset.id)}). New row count: ${result.success.dataset.rowCount}`);
|
|
192
|
+
return 0;
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
report(interrupted ? 'Dataset append interrupted' : 'Dataset append failed');
|
|
196
|
+
return interrupted ?? 1;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataset-commands.d.ts","sourceRoot":"","sources":["../src/dataset-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dataset-commands.d.ts","sourceRoot":"","sources":["../src/dataset-commands.ts"],"names":[],"mappings":"AA6IA,iBAAe,oBAAoB,kBAiClC;AAED,iBAAe,qBAAqB,kBAkDnC;AAED,iBAAe,YAAY,kBAW1B;AAsBD,iBAAe,aAAa,kBAiC3B;AAED,iBAAe,WAAW,kBAwCzB;AAED,iBAAe,gBAAgB,kBA+C9B;AAgBD,iBAAe,eAAe,kBA8B7B;AAED,iBAAe,iBAAiB,kBAU/B;AAED,iBAAe,eAAe,kBAyB7B;AAED,iBAAe,iBAAiB,kBAyC/B;AA0BD,iBAAe,aAAa,kBA8B3B;AAED,iBAAe,WAAW,kBAwCzB;AAED,iBAAe,YAAY,kBAuC1B;AAED,iBAAe,mBAAmB,kBA+BjC;AAED,OAAO,EACL,aAAa,EACb,YAAY,EACZ,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,mBAAmB,GACpB,CAAA"}
|
package/dist/dataset-commands.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ORI-2044: moved from index.ts to keep dataset commands together.
|
|
2
|
-
import { readFileSync,
|
|
2
|
+
import { readFileSync, writeFileSync } from 'fs';
|
|
3
3
|
import { basename, extname } from 'path';
|
|
4
4
|
import { createInterface } from 'readline/promises';
|
|
5
5
|
import { stdin as input, stdout as output } from 'process';
|
|
@@ -14,7 +14,6 @@ import { printDatasetSummaries } from './archive-artifacts-cli.js';
|
|
|
14
14
|
import { formatTerminalLink } from './auth-commands.js';
|
|
15
15
|
import { parseDatasetFile } from './file-parser.js';
|
|
16
16
|
import { parseDatasetReference } from './dataset-download.js';
|
|
17
|
-
import { streamJsonlRowChunks } from './jsonl-stream.js';
|
|
18
17
|
import { editDatasetRows as runEditDatasetRows } from './dataset-edit-rows.js';
|
|
19
18
|
import { parseCommaSeparated } from './task-commands.js';
|
|
20
19
|
const MAX_README_LENGTH = 200_000;
|
|
@@ -323,135 +322,17 @@ async function downloadDataset() {
|
|
|
323
322
|
}
|
|
324
323
|
printLine(`Saved dataset ${sanitizeTerminalText(datasetId)} (${format.toUpperCase()}) to ${sanitizeTerminalText(filename)}`);
|
|
325
324
|
}
|
|
326
|
-
const MAX_INPUT_FILE_SIZE_BYTES = 50 * 1024 * 1024; // 50 MB
|
|
327
|
-
const APPEND_CHUNK_SIZE_ROWS = 500;
|
|
328
|
-
async function appendChunk(datasetId, rows) {
|
|
329
|
-
const response = await authedFetch(`/api/cli/datasets/${encodeURIComponent(datasetId)}/rows`, {
|
|
330
|
-
method: 'POST',
|
|
331
|
-
headers: { 'Content-Type': 'application/json' },
|
|
332
|
-
body: JSON.stringify({ rows }),
|
|
333
|
-
});
|
|
334
|
-
if (!response.ok) {
|
|
335
|
-
throw new Error(`Append failed: ${await response.text()}`);
|
|
336
|
-
}
|
|
337
|
-
return parseJsonResponse(response, 'Dataset append');
|
|
338
|
-
}
|
|
339
|
-
async function appendJsonlDatasetRowsInChunks(datasetId, file) {
|
|
340
|
-
let totalAppended = 0;
|
|
341
|
-
let lastResult = null;
|
|
342
|
-
let chunkIndex = 0;
|
|
343
|
-
const chunks = streamJsonlRowChunks(file)[Symbol.asyncIterator]();
|
|
344
|
-
while (true) {
|
|
345
|
-
let nextChunk;
|
|
346
|
-
try {
|
|
347
|
-
nextChunk = await chunks.next();
|
|
348
|
-
}
|
|
349
|
-
catch (error) {
|
|
350
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
351
|
-
throw new Error(`Append stopped while reading the next JSONL chunk: ${message}\n` +
|
|
352
|
-
`${totalAppended} rows from ${chunkIndex} chunk(s) were already appended. ` +
|
|
353
|
-
`Fix the file, remove the first ${totalAppended} rows, and re-run the command.`);
|
|
354
|
-
}
|
|
355
|
-
if (nextChunk.done) {
|
|
356
|
-
break;
|
|
357
|
-
}
|
|
358
|
-
const chunk = nextChunk.value;
|
|
359
|
-
chunkIndex += 1;
|
|
360
|
-
printLine(`Uploading chunk ${chunkIndex} (${chunk.length} rows)...`);
|
|
361
|
-
try {
|
|
362
|
-
const data = await appendChunk(datasetId, chunk);
|
|
363
|
-
totalAppended += data.appendedCount;
|
|
364
|
-
lastResult = data;
|
|
365
|
-
}
|
|
366
|
-
catch (error) {
|
|
367
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
368
|
-
throw new Error(`Chunk ${chunkIndex} failed: ${message}\n` +
|
|
369
|
-
`${totalAppended} rows from ${chunkIndex - 1} chunk(s) were already appended. ` +
|
|
370
|
-
`To retry, remove the first ${totalAppended} rows from your file and re-run the command.`);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
if (!lastResult) {
|
|
374
|
-
throw new Error('Dataset append file must contain at least one row');
|
|
375
|
-
}
|
|
376
|
-
printLine(`Appended ${totalAppended} rows to dataset ${sanitizeTerminalText(lastResult.dataset.name)} (${sanitizeTerminalText(lastResult.dataset.id)}). New row count: ${lastResult.dataset.rowCount}`);
|
|
377
|
-
}
|
|
378
325
|
async function appendDatasetRows() {
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
datasetId
|
|
388
|
-
}
|
|
389
|
-
else {
|
|
390
|
-
const selected = await selectDatasetInteractively(projectArg);
|
|
391
|
-
datasetId = selected.datasetId;
|
|
392
|
-
}
|
|
393
|
-
const file = expandHomePath(fileArg);
|
|
394
|
-
if (extname(file).toLowerCase() === '.jsonl') {
|
|
395
|
-
await appendJsonlDatasetRowsInChunks(datasetId, file);
|
|
396
|
-
return;
|
|
397
|
-
}
|
|
398
|
-
// Check file size before reading to prevent OOM on large files (ALI-565).
|
|
399
|
-
// Wrap statSync in try/catch so missing/inaccessible files get friendly
|
|
400
|
-
// errors instead of raw Node.js ENOENT/EPERM (ALI-554).
|
|
401
|
-
let fileSizeBytes;
|
|
402
|
-
try {
|
|
403
|
-
fileSizeBytes = statSync(file).size;
|
|
404
|
-
}
|
|
405
|
-
catch (error) {
|
|
406
|
-
const maybeError = error;
|
|
407
|
-
if (maybeError.code === 'ENOENT') {
|
|
408
|
-
throw new Error(`File not found: ${file}. Check the path and filename, then retry.`);
|
|
409
|
-
}
|
|
410
|
-
if (maybeError.code === 'EPERM' || maybeError.code === 'EACCES') {
|
|
411
|
-
throw new Error(`Cannot read file: ${file}. Grant folder permission to your terminal app and retry.`);
|
|
412
|
-
}
|
|
413
|
-
throw new Error(`Failed to access file ${file}: ${maybeError.message}`);
|
|
414
|
-
}
|
|
415
|
-
if (fileSizeBytes > MAX_INPUT_FILE_SIZE_BYTES) {
|
|
416
|
-
const sizeMb = (fileSizeBytes / (1024 * 1024)).toFixed(1);
|
|
417
|
-
throw new Error(`Input file is ${sizeMb} MB, which exceeds the 50 MB limit. Split the file into smaller parts and append each separately.`);
|
|
418
|
-
}
|
|
419
|
-
const { rows } = parseDatasetFile(file);
|
|
420
|
-
if (!Array.isArray(rows) || rows.length === 0) {
|
|
421
|
-
throw new Error('Dataset append file must contain at least one row');
|
|
422
|
-
}
|
|
423
|
-
if (rows.length <= APPEND_CHUNK_SIZE_ROWS) {
|
|
424
|
-
const data = await appendChunk(datasetId, rows);
|
|
425
|
-
printLine(`Appended ${data.appendedCount} rows to dataset ${sanitizeTerminalText(data.dataset.name)} (${sanitizeTerminalText(data.dataset.id)}). New row count: ${data.dataset.rowCount}`);
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
// Chunked upload for large row counts (ALI-555: track partial progress)
|
|
429
|
-
let totalAppended = 0;
|
|
430
|
-
let lastResult = null;
|
|
431
|
-
const totalChunks = Math.ceil(rows.length / APPEND_CHUNK_SIZE_ROWS);
|
|
432
|
-
for (let offset = 0; offset < rows.length; offset += APPEND_CHUNK_SIZE_ROWS) {
|
|
433
|
-
const chunk = rows.slice(offset, offset + APPEND_CHUNK_SIZE_ROWS);
|
|
434
|
-
const chunkIndex = Math.floor(offset / APPEND_CHUNK_SIZE_ROWS) + 1;
|
|
435
|
-
printLine(`Uploading chunk ${chunkIndex}/${totalChunks} (${chunk.length} rows)...`);
|
|
436
|
-
try {
|
|
437
|
-
const data = await appendChunk(datasetId, chunk);
|
|
438
|
-
totalAppended += data.appendedCount;
|
|
439
|
-
lastResult = data;
|
|
440
|
-
}
|
|
441
|
-
catch (error) {
|
|
442
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
443
|
-
throw new Error(`Chunk ${chunkIndex}/${totalChunks} failed: ${msg}\n` +
|
|
444
|
-
`${totalAppended} rows from ${chunkIndex - 1} chunk(s) were already appended. ` +
|
|
445
|
-
`To retry, remove the first ${totalAppended} rows from your file and re-run the command.`);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
if (lastResult) {
|
|
449
|
-
if (hasJsonFlag()) {
|
|
450
|
-
printJson({ dataset: lastResult.dataset, appendedCount: totalAppended });
|
|
451
|
-
return;
|
|
452
|
-
}
|
|
453
|
-
printLine(`Appended ${totalAppended} rows to dataset ${sanitizeTerminalText(lastResult.dataset.name)} (${sanitizeTerminalText(lastResult.dataset.id)}). New row count: ${lastResult.dataset.rowCount}`);
|
|
454
|
-
}
|
|
326
|
+
const { appendDatasetWorkflow } = await import('./dataset-append-workflow.js');
|
|
327
|
+
process.exitCode = await appendDatasetWorkflow(async () => {
|
|
328
|
+
const projectArg = getArg('--project');
|
|
329
|
+
const datasetInput = getDatasetReferenceInput();
|
|
330
|
+
const fileArg = getArg('--file');
|
|
331
|
+
if (!fileArg)
|
|
332
|
+
throw new Error('Usage: orizu datasets append [--dataset <datasetId|datasetUrl>] [--project <team/project>] --file <path>');
|
|
333
|
+
const datasetId = datasetInput ? parseDatasetReference(datasetInput).datasetId : (await selectDatasetInteractively(projectArg)).datasetId;
|
|
334
|
+
return { datasetId, file: expandHomePath(fileArg) };
|
|
335
|
+
}, { json: hasJsonFlag(), print: printLine });
|
|
455
336
|
}
|
|
456
337
|
async function editDatasetRows() {
|
|
457
338
|
const projectArg = getArg('--project');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Effect,
|
|
1
|
+
import { Effect, Result, Schedule } from 'effect';
|
|
2
2
|
import { writeFileSync } from 'node:fs';
|
|
3
3
|
import { datasetTransferTimeoutMs } from './dataset-transfer-policy.js';
|
|
4
4
|
import { authedFetch } from './http.js';
|
|
@@ -30,9 +30,9 @@ export async function transferDatasetDownload(datasetId, format, filename) {
|
|
|
30
30
|
return new DownloadTransportError(cause);
|
|
31
31
|
return cause instanceof Error ? cause : new Error('Dataset download request failed', { cause });
|
|
32
32
|
},
|
|
33
|
-
}).pipe(Effect.
|
|
33
|
+
}).pipe(Effect.timeoutOrElse({
|
|
34
34
|
duration: timeoutMs,
|
|
35
|
-
|
|
35
|
+
orElse: () => Effect.fail(new Error('DATASET_TRANSFER_TIMEOUT: Dataset download exceeded its deadline')),
|
|
36
36
|
}), Effect.retry({
|
|
37
37
|
times: 2,
|
|
38
38
|
schedule: Schedule.spaced(100),
|
|
@@ -50,9 +50,9 @@ export async function transferDatasetDownload(datasetId, format, filename) {
|
|
|
50
50
|
process.once('SIGINT', handleInterrupt);
|
|
51
51
|
process.once('SIGTERM', handleInterrupt);
|
|
52
52
|
try {
|
|
53
|
-
const result = await Effect.runPromise(Effect.
|
|
54
|
-
if (
|
|
55
|
-
throw result.
|
|
53
|
+
const result = await Effect.runPromise(Effect.result(Effect.flatMap(download, write)), { signal: controller.signal });
|
|
54
|
+
if (Result.isFailure(result))
|
|
55
|
+
throw result.failure;
|
|
56
56
|
}
|
|
57
57
|
catch (error) {
|
|
58
58
|
if (controller.signal.aborted)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context, Effect,
|
|
1
|
+
import { Context, Effect, Layer, Result } from 'effect';
|
|
2
2
|
import { ensureDatasetUploadSnapshot } from './dataset-upload-snapshot.js';
|
|
3
3
|
import { datasetTransferTimeoutMs } from './dataset-transfer-policy.js';
|
|
4
4
|
import { extractErrorMessage } from './error-response.js';
|
|
@@ -17,7 +17,7 @@ class DatasetInputFailure extends Error {
|
|
|
17
17
|
_tag = 'DatasetInputFailure';
|
|
18
18
|
constructor(cause) { super(cause instanceof Error ? cause.message : String(cause), { cause }); }
|
|
19
19
|
}
|
|
20
|
-
const DatasetUploadApi = Context.
|
|
20
|
+
const DatasetUploadApi = Context.Service('orizu/DatasetUploadApi');
|
|
21
21
|
// Only the existing authentication client's rejected-token refresh may replay a
|
|
22
22
|
// request. No transient/transport retries belong around these non-idempotent writes.
|
|
23
23
|
function post(path, body, context, prefix, timeoutMs) {
|
|
@@ -35,9 +35,9 @@ function post(path, body, context, prefix, timeoutMs) {
|
|
|
35
35
|
return await parseJsonResponse(response, context);
|
|
36
36
|
},
|
|
37
37
|
catch: cause => cause instanceof DatasetWriteFailure ? cause : new DatasetWriteFailure(cause instanceof Error ? cause.message : String(cause), requestStarted ? 'unknown' : 'rejected', { cause }),
|
|
38
|
-
}).pipe(Effect.
|
|
38
|
+
}).pipe(Effect.timeoutOrElse({
|
|
39
39
|
duration: timeoutMs,
|
|
40
|
-
|
|
40
|
+
orElse: () => Effect.fail(new DatasetWriteFailure(`DATASET_TRANSFER_TIMEOUT: ${context} exceeded its deadline`, requestStarted ? 'unknown' : 'rejected')),
|
|
41
41
|
}));
|
|
42
42
|
});
|
|
43
43
|
}
|
|
@@ -53,10 +53,10 @@ function liveUploadApi(options) {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
async function expectedPromise(program) {
|
|
56
|
-
const result = await Effect.runPromise(Effect.
|
|
57
|
-
if (
|
|
58
|
-
throw result.
|
|
59
|
-
return result.
|
|
56
|
+
const result = await Effect.runPromise(Effect.result(program));
|
|
57
|
+
if (Result.isFailure(result))
|
|
58
|
+
throw result.failure;
|
|
59
|
+
return result.success;
|
|
60
60
|
}
|
|
61
61
|
function uploadProgram(options) {
|
|
62
62
|
return Effect.gen(function* () {
|
package/dist/git-credential.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface GitCredentialIo {
|
|
|
35
35
|
/** Injectable clock for strict provider credential expiry validation. */
|
|
36
36
|
nowMs?: () => number;
|
|
37
37
|
}
|
|
38
|
-
export declare const REPO_TOKEN_PURPOSES: readonly ["read", "write"];
|
|
38
|
+
export declare const REPO_TOKEN_PURPOSES: readonly ["read", "write", "team_read"];
|
|
39
39
|
export type RepoTokenPurpose = (typeof REPO_TOKEN_PURPOSES)[number];
|
|
40
40
|
export interface GitCredentialInvocation {
|
|
41
41
|
readonly operation: 'get' | 'store' | 'erase';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-credential.d.ts","sourceRoot":"","sources":["../src/git-credential.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,MAAM,MAAM,oBAAoB,GA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AAEV,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEtC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,CAAA;IAC7C,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAA;CAC1C;AAQD;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,uBAAuB,GAAG,IAAI,CA8BhC;AAED,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,EAAE,eAAe,GAClB,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAU1E;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA0BrE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAKrE;AA0RD,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAmGvF"}
|
package/dist/git-credential.js
CHANGED
|
@@ -38,6 +38,9 @@ const SAFE_REMOTE_COMPONENT = /^[^\u0000-\u0020\u007f\\?#]+$/;
|
|
|
38
38
|
export const REPO_TOKEN_PURPOSES = [
|
|
39
39
|
'read',
|
|
40
40
|
'write',
|
|
41
|
+
// ORI-2280: a hosted session's read key for its team copy, used by the
|
|
42
|
+
// `orizu-team` remote a publish conflict adds. Artifacts remotes only.
|
|
43
|
+
'team_read',
|
|
41
44
|
];
|
|
42
45
|
function isRepoTokenPurpose(value) {
|
|
43
46
|
return REPO_TOKEN_PURPOSES.includes(value);
|
|
@@ -294,7 +297,7 @@ async function mintArtifactsCredential(fetcher, workspaceId, purpose, expectedCr
|
|
|
294
297
|
const response = await fetcher(`/api/cli/workspaces/${encodeURIComponent(workspaceId)}/repo-token`, {
|
|
295
298
|
method: 'POST',
|
|
296
299
|
headers: { 'Content-Type': 'application/json' },
|
|
297
|
-
body: JSON.stringify({ purpose }),
|
|
300
|
+
body: JSON.stringify({ purpose, ...(purpose === 'team_read' ? { sessionId: process.env.ORIZU_SESSION_ID?.trim() } : {}) }),
|
|
298
301
|
});
|
|
299
302
|
if (!response.ok) {
|
|
300
303
|
return {
|
|
@@ -423,6 +426,10 @@ export async function runGitCredential(op, io) {
|
|
|
423
426
|
io.printErr('orizu git-credential: refusing GitHub credential selection without an exact repository path');
|
|
424
427
|
return 1;
|
|
425
428
|
}
|
|
429
|
+
if (io.purpose === 'team_read') {
|
|
430
|
+
io.printErr('orizu git-credential: team_read is only for an Artifacts team copy');
|
|
431
|
+
return 1;
|
|
432
|
+
}
|
|
426
433
|
const primaryPurpose = io.purpose ?? 'write';
|
|
427
434
|
let minted = await mintToken(fetcher, workspaceId, primaryPurpose, expectedRepoFullName);
|
|
428
435
|
if (!io.purpose && !minted.ok && minted.status === 403) {
|
package/dist/help.js
CHANGED
|
@@ -57,8 +57,8 @@ export const COMMAND_DOCS = [
|
|
|
57
57
|
{ path: ['instructions', 'profiles', 'rollback'], aliases: [['instruction-sets', 'profiles', 'rollback']], usage: 'orizu instructions profiles rollback <set> --project <team/project> --model-config <identity> --to <n> [--json]', summary: 'Create a rollback version and move profile production to it.', group: 'Instruction sets', options: [{ name: '--model-config <identity>', help: 'Profile model config.', required: true }, { name: '--to <n>', help: 'Historical profile version to copy.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions profiles rollback planner --project core/evals --model-config anthropic/claude-haiku --to 1'] },
|
|
58
58
|
{ path: ['instructions', 'default', 'show'], aliases: [['instruction-sets', 'default', 'show']], usage: 'orizu instructions default show <set> --project <team/project> [--json]', summary: 'Show the Default Profile and its Production state.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions default show planner --project core/evals'] },
|
|
59
59
|
{ path: ['instructions', 'default', 'move'], aliases: [['instruction-sets', 'default', 'move']], usage: 'orizu instructions default move <set> --project <team/project> --model-config <identity> [--json]', summary: 'Move the instruction-set Default to a Profile.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--model-config <identity>', help: 'Target Profile identity.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions default move planner --project core/evals --model-config anthropic/claude-haiku'] },
|
|
60
|
-
{ path: ['instructions', 'shape', 'add'], aliases: [['instruction-sets', 'shape', 'add']], usage: 'orizu instructions shape add <set> --project <team/project> --key <key> --from <manifest> [--json]', summary: 'Add
|
|
61
|
-
{ path: ['instructions', 'shape', 'remove'], aliases: [['instruction-sets', 'shape', 'remove']], usage: 'orizu instructions shape remove <set> --project <team/project> --key <key> [--json]', summary: 'Remove
|
|
60
|
+
{ path: ['instructions', 'shape', 'add'], aliases: [['instruction-sets', 'shape', 'add']], usage: 'orizu instructions shape add <set> --project <team/project> --key <key> --from <manifest> [--json]', summary: 'Add a component before first promotion; a frozen shape requires a new instruction set.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--key <key>', help: 'Component key to add.', required: true }, { name: '--from <manifest>', help: 'Manifest containing the component body.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions shape add planner --project core/evals --key skill --from planner.json'] },
|
|
61
|
+
{ path: ['instructions', 'shape', 'remove'], aliases: [['instruction-sets', 'shape', 'remove']], usage: 'orizu instructions shape remove <set> --project <team/project> --key <key> [--json]', summary: 'Remove a component before first promotion; a frozen shape requires a new instruction set.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--key <key>', help: 'Component key to remove.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions shape remove planner --project core/evals --key skill'] },
|
|
62
62
|
{
|
|
63
63
|
path: ['instructions', 'sync'],
|
|
64
64
|
aliases: [['instruction-sets', 'sync']],
|
|
@@ -715,7 +715,7 @@ export const COMMAND_DOCS = [
|
|
|
715
715
|
},
|
|
716
716
|
{
|
|
717
717
|
path: ['apps', 'create'],
|
|
718
|
-
usage: 'orizu apps create --project <team/project> --name <name> --dataset <datasetId> --file <path> --input-schema <json-path> --output-schema <json-path> [--component <name>]',
|
|
718
|
+
usage: 'orizu apps create --project <team/project> --name <name> --dataset <datasetId> --file <path> --input-schema <json-path> --output-schema <json-path> [--component <name>] [--id <app-id>]',
|
|
719
719
|
summary: 'Create a review app from a local component and schema files.',
|
|
720
720
|
group: 'Apps',
|
|
721
721
|
examples: [
|
package/dist/hosted-boot.d.ts
CHANGED
|
@@ -214,6 +214,17 @@ export declare function beginRunExecution(opts: {
|
|
|
214
214
|
sleep?: (ms: number) => Promise<void>;
|
|
215
215
|
attemptTimeoutMs?: number;
|
|
216
216
|
}): Promise<void>;
|
|
217
|
+
/** Mint a `team_read` key (ORI-2280 B1) to learn this session's team copy, so
|
|
218
|
+
* the boot can fill an empty session copy from it (ORI-2118). The credential
|
|
219
|
+
* helper mints its own keys for the git commands; this one only names the
|
|
220
|
+
* remote and lapses on its own (300 s). */
|
|
221
|
+
export declare function resolveTeamRemote(opts: {
|
|
222
|
+
baseUrl: string;
|
|
223
|
+
workspaceId: string;
|
|
224
|
+
sessionId: string;
|
|
225
|
+
bearer: string;
|
|
226
|
+
fetchImpl: BootFetch;
|
|
227
|
+
}): Promise<string>;
|
|
217
228
|
/** Mint a session_read repo token to learn the repo full name, then build the
|
|
218
229
|
* GitHub clone URL (mirrors the operator path's `defaultResolveRepo`). */
|
|
219
230
|
export declare function resolveRepo(opts: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-boot.d.ts","sourceRoot":"","sources":["../src/hosted-boot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;
|
|
1
|
+
{"version":3,"file":"hosted-boot.d.ts","sourceRoot":"","sources":["../src/hosted-boot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAkBH,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAEtB,MAAM,kBAAkB,CAAA;AAMzB,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;AAW9E,eAAO,MAAM,sBAAsB,uHAMzB,CAAA;AAEV,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB;wEACoE;IACpE,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,gFAAgF;IAChF,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB;wCACoC;IACpC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,2EAA2E;IAC3E,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CACjC;AAED;iFACiF;AACjF,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACtC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CA8BvE;AAED;0EAC0E;AAC1E,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAKjE;AA2BD;iFACiF;AACjF,wBAAg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