turnzero 0.25.1 → 0.25.5-next.1
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/dist/turnzero-cloud.mjs +168 -99
- package/package.json +1 -1
package/dist/turnzero-cloud.mjs
CHANGED
|
@@ -552,7 +552,8 @@ var WIRE_FILE_NOUNS = Object.freeze({
|
|
|
552
552
|
var PLANE_OLDER_WAY_ON = "Nothing was started: run this command again once the origin serves a newer release.";
|
|
553
553
|
var PLANE_OLDER_FIRST_ACT_WAY_ON = "Nothing was started: once the origin serves a newer release, start again with the first act.";
|
|
554
554
|
var planeOlderSentence = (version, origin, key, needs, served, tokenCodeUnread) => `${TURNZERO_CLOUD_PACKAGE} ${version} needs ${WIRE_FILE_NOUNS[key]} of ${needs} or later, and ${origin} serves ${served}, an older Turn Zero Cloud. ${tokenCodeUnread === void 0 ? PLANE_OLDER_WAY_ON : `${PLANE_OLDER_FIRST_ACT_WAY_ON} ${tokenCodeUnread}`}`;
|
|
555
|
-
var
|
|
555
|
+
var COMMAND_LATEST_FORM = /^(?:0|[1-9]\d{0,8})\.(?:0|[1-9]\d{0,8})\.(?:0|[1-9]\d{0,8})$/;
|
|
556
|
+
var servedHealthOf = async (io2, origin) => {
|
|
556
557
|
const controller = new AbortController();
|
|
557
558
|
const cancel = io2.schedule(PLANE_CHECK_BOUND_SECONDS * 1e3, () => controller.abort());
|
|
558
559
|
try {
|
|
@@ -561,9 +562,13 @@ var servedWireOf = async (io2, origin) => {
|
|
|
561
562
|
await response.body?.cancel().catch(() => void 0);
|
|
562
563
|
return null;
|
|
563
564
|
}
|
|
564
|
-
const
|
|
565
|
-
if (
|
|
566
|
-
|
|
565
|
+
const body = planeObjectOf(await response.text());
|
|
566
|
+
if (body === null) return null;
|
|
567
|
+
const { wire, command_latest: latest } = body;
|
|
568
|
+
return {
|
|
569
|
+
wire: wire === null || typeof wire !== "object" || Array.isArray(wire) ? null : Object.fromEntries(Object.entries(wire).filter((entry) => typeof entry[1] === "string")),
|
|
570
|
+
commandLatest: typeof latest === "string" && COMMAND_LATEST_FORM.test(latest) ? latest : null
|
|
571
|
+
};
|
|
567
572
|
} catch {
|
|
568
573
|
return null;
|
|
569
574
|
} finally {
|
|
@@ -580,7 +585,9 @@ var olderMemberOf = (served, needed = PLANE_WIRE_NEEDED) => {
|
|
|
580
585
|
return null;
|
|
581
586
|
};
|
|
582
587
|
var planeWireRefusal = async (io2, origin, tokenCodeUnread) => {
|
|
583
|
-
const
|
|
588
|
+
const health = await servedHealthOf(io2, origin);
|
|
589
|
+
io2.noteCommandLatest?.(origin, health?.commandLatest ?? null);
|
|
590
|
+
const served = health?.wire ?? null;
|
|
584
591
|
if (served === null) return null;
|
|
585
592
|
const older = olderMemberOf(served);
|
|
586
593
|
return older === null ? null : planeOlderSentence(commandVersion(), origin, older.key, older.needs, older.served, tokenCodeUnread);
|
|
@@ -828,6 +835,7 @@ var loginLineFor = (io2, origin) => {
|
|
|
828
835
|
const line = loginLineOf(origin);
|
|
829
836
|
return onWindows(io2) ? windowsLineOf(line) : line;
|
|
830
837
|
};
|
|
838
|
+
var authorizeLineFor = (io2, origin) => printedLineOf(io2, commandLineOf(origin, AUTHORIZE_SUBCOMMAND, origin !== DEFAULT_COMMAND_ORIGIN ? { origin } : {}), origin);
|
|
831
839
|
var loginLinesFor = (io2, origin) => [
|
|
832
840
|
...ranThroughNpx(io2) ? [installLineOf(origin)] : [],
|
|
833
841
|
loginLineFor(io2, origin)
|
|
@@ -840,13 +848,12 @@ var CREDENTIAL_SOURCES = Object.freeze(["standard_input", "minted_token_variable
|
|
|
840
848
|
var credentialPlaces = (declared) => declared.places ?? `the command reads the grant from its standard input, as the line ${declared.call} answers pipes it in${declared.mintedToken ? `, and otherwise a minted token from ${MINTED_TOKEN_VARIABLE} where it is set, or this computer's token for the platform's address from its credential file, which login and authorize write` : declared.computerToken === true ? `, and otherwise this computer's token for the platform's address from its credential file, which login and authorize write, and never a minted token from ${MINTED_TOKEN_VARIABLE}` : ""}.`;
|
|
841
849
|
var unsetVariableWayOn = (declared) => `To run a line you wrote yourself under this computer's token, unset ${MINTED_TOKEN_VARIABLE} and run it again; or pipe ${declared.aGrant}.`;
|
|
842
850
|
var grantWaysOn = (declared) => `Pipe ${declared.aGrant}, as the line ${declared.call} answers pipes it, or, where you wrote the line yourself, pipe nothing to run it under this computer's token.`;
|
|
843
|
-
var emptyGrantRefusal = (declared) =>
|
|
844
|
-
var
|
|
845
|
-
var unendedReadRefusal = (declared, reading, nothingArrived = false) => unendedReadSentence(
|
|
851
|
+
var emptyGrantRefusal = (declared) => `The ${declared.grant} piped to the command was empty, so nothing was sent and nothing was started. ${grantWaysOn(declared)}`;
|
|
852
|
+
var unendedReadRefusal = (declared, reading) => unendedReadSentence(
|
|
846
853
|
declared.grant,
|
|
847
854
|
reading,
|
|
848
855
|
"nothing was sent and nothing was started.",
|
|
849
|
-
declared.computerToken === true ? grantWaysOn(declared) : pipeWholeWayOn(declared.aGrant, declared.call
|
|
856
|
+
declared.computerToken === true ? grantWaysOn(declared) : pipeWholeWayOn(declared.aGrant, declared.call)
|
|
850
857
|
);
|
|
851
858
|
var emptyTokenVariableRefusal = () => `${MINTED_TOKEN_VARIABLE} is set but empty, so nothing was sent and nothing was started: the read that set it for this line found no token. Set it to your minted token from where your tool keeps it, or unset it to use this computer's token.`;
|
|
852
859
|
var noCredentialRefusal = (declared, origin, expiredAt, again) => `No ${declared.grant} was read, so nothing was started: ${credentialPlaces(declared)} ${expiredAt === null ? `This computer's credential file holds no token for ${origin}.` : `This computer's token for ${origin} in its credential file expired at ${expiredAt}.`} ${again}`.trimEnd();
|
|
@@ -855,10 +862,10 @@ async function readCredential(io2, declared, again, line = { named: void 0, clos
|
|
|
855
862
|
if (declared.piped !== false) {
|
|
856
863
|
const read3 = await readStandardInputEnded(io2.input, io2.grantBoundMs);
|
|
857
864
|
const unended = unendedReadingOf(read3);
|
|
858
|
-
if (unended !== null) return { refusal: unendedReadRefusal(declared, unended
|
|
865
|
+
if (unended !== null) return { refusal: unendedReadRefusal(declared, unended) };
|
|
859
866
|
const grant = read3.text.trim();
|
|
860
867
|
if (declared.emptyPipeRefused === true && grant === "" && read3.bytes > 0) {
|
|
861
|
-
return { refusal:
|
|
868
|
+
return { refusal: emptyGrantRefusal(declared) };
|
|
862
869
|
}
|
|
863
870
|
if (grant !== "") {
|
|
864
871
|
if (!UPLOAD_GRANT_FORM.test(grant)) {
|
|
@@ -926,10 +933,7 @@ var variableReadSentence = (origin, standing) => {
|
|
|
926
933
|
};
|
|
927
934
|
var fileReadSentence = (origin) => `The credential this run read was this computer's token for ${origin}, from its credential file: where the platform no longer accepts it, run ${LOGIN_SUBCOMMAND}${originWordsOf(origin)} to authorize this computer again.`;
|
|
928
935
|
var noTokenSentence = (origin, expiredAt) => expiredAt === null ? `No credential was read, so nothing was sent: ${MINTED_TOKEN_VARIABLE} is not set, and this computer's credential file holds no token for ${origin}.` : `No credential was read, so nothing was sent: ${MINTED_TOKEN_VARIABLE} is not set, and this computer's token for ${origin} in its credential file expired at ${expiredAt}.`;
|
|
929
|
-
var VARIABLE_ROUTE_SENTENCES =
|
|
930
|
-
function variableRouteSentencesOf(then) {
|
|
931
|
-
return `A tool connected by a minted token, or a job, sets ${MINTED_TOKEN_VARIABLE} from where its token is kept, never by writing the value in a line, and ${ORIGIN_VARIABLE} to the address that minted the token where that is not ${DEFAULT_COMMAND_ORIGIN}, then ${then}. Such a tool cannot use ${MINT_TOKEN_ACTION}, which takes a sign-in alone. A tool sets ${MINTED_TOKEN_VARIABLE} for one line at a time and unsets it once that line ends.`;
|
|
932
|
-
}
|
|
936
|
+
var VARIABLE_ROUTE_SENTENCES = `A tool connected by a minted token, or a job, sets ${MINTED_TOKEN_VARIABLE} from where its token is kept, never by writing the value in a line, and ${ORIGIN_VARIABLE} to the address that minted the token where that is not ${DEFAULT_COMMAND_ORIGIN}, then runs the line again. Such a tool cannot use ${MINT_TOKEN_ACTION}, which takes a sign-in alone. A tool sets ${MINTED_TOKEN_VARIABLE} for one line at a time and unsets it once that line ends.`;
|
|
933
937
|
var LOGIN_ROUTE_OPENER = "A person logs this computer in once, in a terminal of their own, and its token then stays on this computer for 30 days:";
|
|
934
938
|
var DEPLOY_FILES_ROUTE_SENTENCE = "A folder within the caps of your tool's deploy_files call deploys now through deploy_files, with no login.";
|
|
935
939
|
var loginRouteLines = (io2, origin, deployFiles = true) => [
|
|
@@ -2313,7 +2317,14 @@ var scanForSegment = (data, segment, count) => {
|
|
|
2313
2317
|
var readHealthPath = (path, entries) => {
|
|
2314
2318
|
const count = { scanned: 0, candidates: 0 };
|
|
2315
2319
|
let decoded = 0;
|
|
2316
|
-
const
|
|
2320
|
+
const healthLike = /* @__PURE__ */ new Set();
|
|
2321
|
+
const answer = (found) => ({
|
|
2322
|
+
answer: found,
|
|
2323
|
+
decodedBytes: decoded,
|
|
2324
|
+
scannedBytes: count.scanned,
|
|
2325
|
+
candidates: count.candidates,
|
|
2326
|
+
nearest: found === "absent" ? nearestHealthPathOf(healthLike, path) : null
|
|
2327
|
+
});
|
|
2317
2328
|
const segmentText = healthSegmentOf(path);
|
|
2318
2329
|
if (segmentText === null) return answer("unread");
|
|
2319
2330
|
const segment = Buffer.from(segmentText, "utf8");
|
|
@@ -2331,11 +2342,35 @@ var readHealthPath = (path, entries) => {
|
|
|
2331
2342
|
decoded += data.length;
|
|
2332
2343
|
const found = scanForSegment(data, segment, count);
|
|
2333
2344
|
if (found !== "absent") return answer(found === "held" ? "held" : "unread");
|
|
2345
|
+
collectHealthLikePaths(data, healthLike);
|
|
2334
2346
|
}
|
|
2335
2347
|
return answer("absent");
|
|
2336
2348
|
};
|
|
2349
|
+
var HEALTH_LIKE_PATHS_MAX = 32;
|
|
2350
|
+
var HEALTH_LIKE_SEGMENT_MAX = 64;
|
|
2351
|
+
var QUOTED_PATH = /(["'`])(\/[A-Za-z0-9._~\/-]{1,200})\1/g;
|
|
2352
|
+
var collectHealthLikePaths = (data, found) => {
|
|
2353
|
+
if (found.size >= HEALTH_LIKE_PATHS_MAX) return;
|
|
2354
|
+
for (const match of data.toString("utf8").matchAll(QUOTED_PATH)) {
|
|
2355
|
+
const path = match[2];
|
|
2356
|
+
if (!/health/i.test(path) || path.includes("//") || path.length > 1 && path.endsWith("/")) continue;
|
|
2357
|
+
if (path.split("/").some((segment) => segment.length > HEALTH_LIKE_SEGMENT_MAX)) continue;
|
|
2358
|
+
found.add(path);
|
|
2359
|
+
if (found.size >= HEALTH_LIKE_PATHS_MAX) return;
|
|
2360
|
+
}
|
|
2361
|
+
};
|
|
2362
|
+
var nearestHealthPathOf = (found, path) => {
|
|
2363
|
+
const bare = bareHealthPath(path);
|
|
2364
|
+
let best = null;
|
|
2365
|
+
for (const candidate of found) {
|
|
2366
|
+
if (candidate === bare) continue;
|
|
2367
|
+
if (best === null || candidate.length < best.length || candidate.length === best.length && candidate < best) best = candidate;
|
|
2368
|
+
}
|
|
2369
|
+
return best;
|
|
2370
|
+
};
|
|
2337
2371
|
var shownHealthPath = (path) => shownNoteName(bareHealthPath(path));
|
|
2338
2372
|
var healthLineOf = (path) => `${WARNING_LINE_HEAD}${MANIFEST_FILE} names the health path ${shownHealthPath(path)}, and no other file of the zip holds its last segment, package files and documentation set aside. A deploy waits for that path to answer 200 three times in a row, so check that the application serves it. A route built in another form is not seen here.`;
|
|
2373
|
+
var nearestHealthLineOf = (nearest) => `The zip's source names the path ${shownHealthPath(nearest)}: where that is the health path meant, set the manifest's health to it and call submit_manifest.`;
|
|
2339
2374
|
var CREDENTIAL_FILE_NAMES = Object.freeze(["id_rsa", "id_dsa", "id_ecdsa", "id_ed25519", ".netrc", ".pgpass", ".htpasswd", "credentials.json"]);
|
|
2340
2375
|
var CLIENT_SECRET_OPENING = "client_secret";
|
|
2341
2376
|
var CLIENT_SECRET_ENDING = ".json";
|
|
@@ -2457,7 +2492,7 @@ var localWriteLineIn = (data) => {
|
|
|
2457
2492
|
var localWriteLineOf = (found) => found === null ? null : `${WARNING_LINE_HEAD}${shownNoteName(found.name)}, line ${found.line}, writes to a local file inside the application's folder. A running copy's disk is lost whenever the copy is replaced or stops: keep files in a storage area and records in a database, as read_documentation's pages /cloud/guides/store-files/ and /cloud/guides/add-a-database/ describe.`;
|
|
2458
2493
|
var LIST_LINE_HEAD = "file: ";
|
|
2459
2494
|
var listLineOf = (file) => `${LIST_LINE_HEAD}${file.size} ${shownWhole(file.name)}`;
|
|
2460
|
-
var NO_NOTES = Object.freeze({ leftOut: Object.freeze([]), rootZips: Object.freeze([]), rootRunOutput: Object.freeze([]), credentialFiles: Object.freeze([]), localWrite: null, unservedHealthPath: null });
|
|
2495
|
+
var NO_NOTES = Object.freeze({ leftOut: Object.freeze([]), rootZips: Object.freeze([]), rootRunOutput: Object.freeze([]), credentialFiles: Object.freeze([]), localWrite: null, unservedHealthPath: null, nearestHealthPath: null });
|
|
2461
2496
|
var noteLinesOf = (notes, health, zipped = null) => {
|
|
2462
2497
|
const lines = [];
|
|
2463
2498
|
const files = zipped === null ? null : filesLineOf(zipped.map((file) => file.name));
|
|
@@ -2472,7 +2507,10 @@ var noteLinesOf = (notes, health, zipped = null) => {
|
|
|
2472
2507
|
if (credential !== null) lines.push(credential);
|
|
2473
2508
|
const localWrite = localWriteLineOf(notes.localWrite);
|
|
2474
2509
|
if (localWrite !== null) lines.push(localWrite);
|
|
2475
|
-
if (health && notes.unservedHealthPath !== null)
|
|
2510
|
+
if (health && notes.unservedHealthPath !== null) {
|
|
2511
|
+
lines.push(healthLineOf(notes.unservedHealthPath));
|
|
2512
|
+
if (notes.nearestHealthPath !== null) lines.push(nearestHealthLineOf(notes.nearestHealthPath));
|
|
2513
|
+
}
|
|
2476
2514
|
return lines;
|
|
2477
2515
|
};
|
|
2478
2516
|
|
|
@@ -3479,6 +3517,7 @@ function zipFolder(root, seams = {}) {
|
|
|
3479
3517
|
const credentialFiles = [];
|
|
3480
3518
|
let localWrite = null;
|
|
3481
3519
|
const places = [];
|
|
3520
|
+
const healthLike = /* @__PURE__ */ new Set();
|
|
3482
3521
|
const zip = zipFiles(
|
|
3483
3522
|
files,
|
|
3484
3523
|
seams.read,
|
|
@@ -3489,7 +3528,10 @@ function zipFolder(root, seams = {}) {
|
|
|
3489
3528
|
const line = localWriteLineIn(data);
|
|
3490
3529
|
if (line !== null) localWrite = { name: file.name, line };
|
|
3491
3530
|
}
|
|
3492
|
-
if (segment !== null && !held && readForHealth(file.name)
|
|
3531
|
+
if (segment !== null && !held && readForHealth(file.name)) {
|
|
3532
|
+
if (holdsSegment(data, segment)) held = true;
|
|
3533
|
+
else collectHealthLikePaths(data, healthLike);
|
|
3534
|
+
}
|
|
3493
3535
|
},
|
|
3494
3536
|
(place) => places.push(place)
|
|
3495
3537
|
);
|
|
@@ -3504,7 +3546,8 @@ function zipFolder(root, seams = {}) {
|
|
|
3504
3546
|
rootRunOutput: files.filter((file) => rootRunOutputName(file.name)).map((file) => file.name),
|
|
3505
3547
|
credentialFiles,
|
|
3506
3548
|
localWrite,
|
|
3507
|
-
unservedHealthPath: segment !== null && !held ? healthPath : null
|
|
3549
|
+
unservedHealthPath: segment !== null && !held ? healthPath : null,
|
|
3550
|
+
nearestHealthPath: segment !== null && !held && healthPath !== null ? nearestHealthPathOf(healthLike, healthPath) : null
|
|
3508
3551
|
}
|
|
3509
3552
|
};
|
|
3510
3553
|
}
|
|
@@ -3672,8 +3715,9 @@ var BINDING_NOTHING_SENT = "Nothing further was read and nothing was sent.";
|
|
|
3672
3715
|
var NOTHING_UPLOADED_OR_STARTED = "Nothing was uploaded and nothing was started.";
|
|
3673
3716
|
var healthPathRefusalOf = (prepared, zip, places) => {
|
|
3674
3717
|
if (prepared.healthPathToRead === void 0 || places === null) return null;
|
|
3675
|
-
|
|
3676
|
-
|
|
3718
|
+
const read2 = readHealthPath(prepared.healthPathToRead, healthEntriesOf(zip, places));
|
|
3719
|
+
if (read2.answer !== "absent") return null;
|
|
3720
|
+
return [healthPathUnservedDetail(prepared.healthPathToRead), ...read2.nearest === null ? [] : [nearestHealthLineOf(read2.nearest)], NOTHING_UPLOADED_OR_STARTED];
|
|
3677
3721
|
};
|
|
3678
3722
|
var zipSha256 = (zip) => createHash2("sha256").update(zip).digest("hex");
|
|
3679
3723
|
var pathKindOf = (path) => {
|
|
@@ -5026,9 +5070,7 @@ async function readTakeCredential(io2, named, afterLogin, why) {
|
|
|
5026
5070
|
const unwritable = loginRouteRefusalOf(io2, NOTHING_WRITTEN2);
|
|
5027
5071
|
if (unwritable !== null) return { lines: [...head, VARIABLE_ROUTE_SENTENCES, unwritable] };
|
|
5028
5072
|
const route = loginRouteLines(io2, origin.origin, false);
|
|
5029
|
-
|
|
5030
|
-
const close = afterLogin(origin.origin);
|
|
5031
|
-
return { lines: [...head, close.variableRoute, ...route, close.afterLogin], signIn: origin.origin };
|
|
5073
|
+
return { lines: [...head, VARIABLE_ROUTE_SENTENCES, ...route, afterLogin] };
|
|
5032
5074
|
}
|
|
5033
5075
|
if ("refusal" in read2) return { lines: [read2.refusal] };
|
|
5034
5076
|
io2.hide(read2.credential, REDACTED_TOKEN);
|
|
@@ -5677,6 +5719,7 @@ var unboundSentence = "No port on this computer could be bound for the browser t
|
|
|
5677
5719
|
var unopenedSentence = "The browser could not be opened here: open the address yourself, approve the login, and paste here the code the page shows if it shows one.";
|
|
5678
5720
|
var noSendSentence = (seconds) => `No answer has come from the browser in ${seconds} seconds. Where the page shows a code, paste it here; the browser's answer still completes the login.`;
|
|
5679
5721
|
var noTerminalSentence2 = "This run has no terminal to paste a code into, so it waits for the browser's answer alone.";
|
|
5722
|
+
var toolRouteSentence = (authorizeLine) => `This line waits for a person to approve the login in a browser. A tool signed in to Turn Zero needs no browser: stop this line, run ${authorizeLine}, and make the mint_token call it prints.`;
|
|
5680
5723
|
var noWayInSentence = (line, minutes = PENDING_REQUEST_MS / 6e4) => `This run has no terminal to paste a code into and no port for the browser to answer, so nothing was minted and the request stays pending for ${minutesWords(minutes)}. Run ${line} in a terminal of your own.`;
|
|
5681
5724
|
var endedSentence = (minutes, line) => `No approval arrived within ${minutesWords(minutes)}, so nothing was minted and nothing was changed. Run ${line} again to log this computer in.`;
|
|
5682
5725
|
var stoppedSentence = (line) => `The code prompt was stopped, so nothing was minted. Run ${line} again to log this computer in.`;
|
|
@@ -5831,6 +5874,7 @@ async function login(call, io2) {
|
|
|
5831
5874
|
})
|
|
5832
5875
|
);
|
|
5833
5876
|
}
|
|
5877
|
+
if (io2.errorIsTerminal !== true) io2.print(toolRouteSentence(authorizeLineFor(io2, origin.origin)));
|
|
5834
5878
|
const arrival = await arrived;
|
|
5835
5879
|
for (const cancel of cancels) cancel();
|
|
5836
5880
|
prompt?.close();
|
|
@@ -6128,6 +6172,60 @@ var cacheOf = (text) => {
|
|
|
6128
6172
|
}
|
|
6129
6173
|
};
|
|
6130
6174
|
var NO_CHECK = Object.freeze({ finish: () => null });
|
|
6175
|
+
var releaseOf = (version) => version.replace(/-.*$/, "");
|
|
6176
|
+
var updateRunOf = (io2, tag) => {
|
|
6177
|
+
if (!ranThroughNpx(io2)) return { line: `npm install -g ${TURNZERO_CLOUD_PACKAGE}@${tag}`, npx: false };
|
|
6178
|
+
const head = commandRunnerOf(tag);
|
|
6179
|
+
return { line: onWindows(io2) ? windowsLineOf(head) : head, npx: true };
|
|
6180
|
+
};
|
|
6181
|
+
var updateNoticeOf = (io2, tag, version, running) => {
|
|
6182
|
+
const run = updateRunOf(io2, tag);
|
|
6183
|
+
return run.npx ? `A newer turnzero, ${version}, is published under ${tag} (this is ${running}): ${run.line} runs it.` : upgradeLineOf(tag, version, running);
|
|
6184
|
+
};
|
|
6185
|
+
var COMMAND_TOO_OLD_ERROR = "command_too_old";
|
|
6186
|
+
var commandTooOldLineOf = (io2, tag, running, latest) => {
|
|
6187
|
+
if (latest !== null && newerVersion(latest, releaseOf(running))) return updateNoticeOf(io2, tag, latest, running);
|
|
6188
|
+
const run = updateRunOf(io2, tag);
|
|
6189
|
+
return `This turnzero, ${running}, is older than the platform answers: ${run.line} ${run.npx ? "runs" : "installs"} the version published under ${tag}.`;
|
|
6190
|
+
};
|
|
6191
|
+
var startUpdateNotices = (io2, say, running, named) => {
|
|
6192
|
+
let origin = null;
|
|
6193
|
+
let latest = null;
|
|
6194
|
+
let notified = null;
|
|
6195
|
+
let tooOld = false;
|
|
6196
|
+
const tooOldTail = answerLineOf("", "refused", 426, COMMAND_TOO_OLD_ERROR);
|
|
6197
|
+
const watched = (print) => (line) => {
|
|
6198
|
+
if (line.endsWith(tooOldTail)) tooOld = true;
|
|
6199
|
+
print(line);
|
|
6200
|
+
};
|
|
6201
|
+
const printError = io2.printError;
|
|
6202
|
+
const runIo = {
|
|
6203
|
+
...io2,
|
|
6204
|
+
print: watched(io2.print),
|
|
6205
|
+
...printError !== void 0 ? { printError: watched(printError) } : {},
|
|
6206
|
+
noteCommandLatest: (at, served) => {
|
|
6207
|
+
origin ??= at;
|
|
6208
|
+
if (served === null || latest !== null) return;
|
|
6209
|
+
latest = served;
|
|
6210
|
+
if (!newerVersion(served, releaseOf(running))) return;
|
|
6211
|
+
notified = served;
|
|
6212
|
+
say(updateNoticeOf(io2, commandTagOf(at), served, running));
|
|
6213
|
+
}
|
|
6214
|
+
};
|
|
6215
|
+
return {
|
|
6216
|
+
io: runIo,
|
|
6217
|
+
finish: (daily) => {
|
|
6218
|
+
const lines = [];
|
|
6219
|
+
if (tooOld) {
|
|
6220
|
+
const at = origin ?? originReadOf(named[DEPLOY_OPTION.origin] ?? io2.env[ORIGIN_VARIABLE]);
|
|
6221
|
+
lines.push(commandTooOldLineOf(io2, commandTagOf(at), running, latest));
|
|
6222
|
+
}
|
|
6223
|
+
const line = daily.finish(notified);
|
|
6224
|
+
if (line !== null) lines.push(line);
|
|
6225
|
+
return lines;
|
|
6226
|
+
}
|
|
6227
|
+
};
|
|
6228
|
+
};
|
|
6131
6229
|
var startUpgradeCheck = (io2, subcommand, named, running) => {
|
|
6132
6230
|
const read2 = io2.registryFetch;
|
|
6133
6231
|
if (read2 === void 0 || !UPGRADE_CHECK_SUBCOMMANDS.includes(subcommand)) return NO_CHECK;
|
|
@@ -6168,9 +6266,10 @@ var startUpgradeCheck = (io2, subcommand, named, running) => {
|
|
|
6168
6266
|
}
|
|
6169
6267
|
})();
|
|
6170
6268
|
return {
|
|
6171
|
-
finish: () => {
|
|
6269
|
+
finish: (named2) => {
|
|
6172
6270
|
controller.abort();
|
|
6173
|
-
|
|
6271
|
+
if (arrived === null || !newerVersion(arrived, running)) return null;
|
|
6272
|
+
return typeof named2 === "string" && !newerVersion(arrived, named2) ? null : upgradeLineOf(tag, arrived, running);
|
|
6174
6273
|
}
|
|
6175
6274
|
};
|
|
6176
6275
|
};
|
|
@@ -6194,29 +6293,29 @@ var PROVISION_OPTIONS = Object.freeze([
|
|
|
6194
6293
|
name: PROVISION_OPTION.origin,
|
|
6195
6294
|
value: "<origin>",
|
|
6196
6295
|
required: false,
|
|
6197
|
-
description: `The platform's address, which is also written as ${LOCAL_RUN_SETTING.api} and ${LOCAL_RUN_SETTING.gatewayUrl}. Where absent, ${
|
|
6296
|
+
description: `The platform's address, which is also written as ${LOCAL_RUN_SETTING.api} and ${LOCAL_RUN_SETTING.gatewayUrl}. Where absent, the address ${ORIGIN_VARIABLE} holds, or ${DEFAULT_COMMAND_ORIGIN} where it is unset. Under ${MINTED_TOKEN_VARIABLE} the token is sent only to the address ${ORIGIN_VARIABLE} holds, or to ${DEFAULT_COMMAND_ORIGIN} where it is unset. Otherwise it names the address whose token the command reads from this computer's credential file, and that token is sent to that address alone.`
|
|
6198
6297
|
},
|
|
6199
6298
|
{
|
|
6200
6299
|
name: PROVISION_CLAIM_FLAG,
|
|
6201
6300
|
value: "",
|
|
6202
6301
|
required: false,
|
|
6203
6302
|
flag: true,
|
|
6204
|
-
description: `With no token for the address, presents this computer's pending verifier, the one the first act kept, as the credential of the provision grant the submit_manifest call recorded
|
|
6303
|
+
description: `With no token for the address, presents this computer's pending verifier, the one the first act kept, as the credential of the provision grant the submit_manifest call recorded. Where the platform holds no such grant, the run prints the first act. Under a token it runs as the line without it does.`
|
|
6205
6304
|
}
|
|
6206
6305
|
]);
|
|
6207
6306
|
var PROVISION_CREDENTIAL = Object.freeze({
|
|
6208
|
-
grant: "
|
|
6209
|
-
aGrant: "a
|
|
6307
|
+
grant: "minted token",
|
|
6308
|
+
aGrant: "a minted token",
|
|
6210
6309
|
call: "the submit_manifest call naming local_run",
|
|
6211
6310
|
mintedToken: true,
|
|
6212
|
-
|
|
6213
|
-
|
|
6311
|
+
piped: false,
|
|
6312
|
+
places: `the command reads no standard input: it reads a minted token from ${MINTED_TOKEN_VARIABLE} where it is set, as a tool connected by a minted token sets it from where its token is kept, or a job with no tool from its secret store, and otherwise this computer's token for the platform's address from its credential file, which ${LOGIN_SUBCOMMAND} and ${AUTHORIZE_SUBCOMMAND} write.`,
|
|
6214
6313
|
claim: `this computer's pending verifier, under ${PROVISION_CLAIM_FLAG}`
|
|
6215
6314
|
});
|
|
6315
|
+
var PROVISION_READS = `no standard input: a minted token from ${MINTED_TOKEN_VARIABLE} where it is set, and otherwise this computer's token for the platform's address from its credential file, which ${LOGIN_SUBCOMMAND} and ${AUTHORIZE_SUBCOMMAND} write, sent only to that address; else ${PROVISION_CREDENTIAL.claim}; with none, it keeps a verifier and prints the challenge and the submit_manifest call naming local_run and ${CODE_CHALLENGE_MEMBER}`;
|
|
6216
6316
|
var NOTHING_REMINTED = "Nothing was re-minted, and the environment file is as it stood.";
|
|
6217
6317
|
var CLAIM_FALLBACK_ERRORS = Object.freeze(["authentication_required", "secret_grant_not_admitted", "secret_grant_expired", "secret_grant_spent"]);
|
|
6218
6318
|
var claimRefusedSentence = (origin, error) => `This computer's pending verifier was presented to ${origin}, which holds no provision grant it claims (${error}), so nothing was re-minted, and the first act follows.`;
|
|
6219
|
-
var CLAIM_BESIDE_GRANT_REFUSAL = `${PROVISION_CLAIM_FLAG} presents this computer's pending verifier in place of a grant, so a grant piped beside it is refused: run the line the submit_manifest call answered as given. ${NOTHING_REMINTED}`;
|
|
6220
6319
|
var PROVISION_BARE_LINE_WORDS = commandLineOf(DEFAULT_COMMAND_ORIGIN, PROVISION_SUBCOMMAND, { options: [[PROVISION_OPTION.application, "<application id>"]] });
|
|
6221
6320
|
var freshLineOf = (io2, application, origin, envFile) => provisionLineFor(io2, { origin, application, ...envFile !== void 0 ? { envFile } : {} });
|
|
6222
6321
|
var freshLineSteps2 = (line) => `${line} with nothing piped, and where it prints a submit_manifest call, make that call from your tool and run the line it answers as given`;
|
|
@@ -6406,19 +6505,14 @@ async function provision(call, io2) {
|
|
|
6406
6505
|
io2.print(read2.refusal);
|
|
6407
6506
|
return COMMAND_STATUS.nothing_started;
|
|
6408
6507
|
}
|
|
6409
|
-
|
|
6410
|
-
io2.print(CLAIM_BESIDE_GRANT_REFUSAL);
|
|
6411
|
-
return COMMAND_STATUS.nothing_started;
|
|
6412
|
-
}
|
|
6413
|
-
if (read2.kind === "token") io2.hide(read2.credential, REDACTED_TOKEN);
|
|
6508
|
+
io2.hide(read2.credential, REDACTED_TOKEN);
|
|
6414
6509
|
const where = credentialOriginOf(io2.env, read2, { named: call.named[PROVISION_OPTION.origin], closing: NOTHING_REMINTED });
|
|
6415
6510
|
if ("refusal" in where) {
|
|
6416
6511
|
io2.print(where.refusal);
|
|
6417
6512
|
return COMMAND_STATUS.nothing_started;
|
|
6418
6513
|
}
|
|
6419
6514
|
const sent = { ...options, origin: where.origin };
|
|
6420
|
-
|
|
6421
|
-
return remintRun(io2, sent, agent.userAgent, { credential: read2.credential, kind: read2.kind, verifier }, standing.text, namedEnvFile);
|
|
6515
|
+
return remintRun(io2, sent, agent.userAgent, { credential: read2.credential, kind: "token", verifier: null }, standing.text, namedEnvFile);
|
|
6422
6516
|
}
|
|
6423
6517
|
async function claimRun(io2, call, options, userAgent, standing, namedEnvFile, unauthorized) {
|
|
6424
6518
|
const origin = authorizationOriginOf(io2.env, call.named[PROVISION_OPTION.origin], NOTHING_REMINTED);
|
|
@@ -6605,6 +6699,7 @@ var PROVISION_ROW = Object.freeze({
|
|
|
6605
6699
|
].join(", ")}, and ${LOCAL_RUN_SETTING.application}, the first two only where the application has a development database. It removes a ${RETIRED_PLATFORM_CREDENTIAL_SETTING} line, the platform credential's earlier name. It prints no credential value.`,
|
|
6606
6700
|
options: PROVISION_OPTIONS,
|
|
6607
6701
|
credential: PROVISION_CREDENTIAL,
|
|
6702
|
+
reads: PROVISION_READS,
|
|
6608
6703
|
statuses: {
|
|
6609
6704
|
done: "the settings written, or the first act printed its challenge and call",
|
|
6610
6705
|
failed: "the settings written without a connection limit, which the platform's answer did not carry",
|
|
@@ -6612,7 +6707,7 @@ var PROVISION_ROW = Object.freeze({
|
|
|
6612
6707
|
nothing_started: "nothing was re-minted"
|
|
6613
6708
|
},
|
|
6614
6709
|
note: [
|
|
6615
|
-
`Run ${PROVISION_BARE_LINE_WORDS} from the folder the application runs in. With
|
|
6710
|
+
`Run ${PROVISION_BARE_LINE_WORDS} from the folder the application runs in. With no token for the address, it prints a challenge and the submit_manifest call naming local_run and ${CODE_CHALLENGE_MEMBER}; your tool makes that call and runs the line it answers once, as given, before its grant expires, which presents the grant with this computer's verifier. On a computer logged in, the bare line re-mints at once.`,
|
|
6616
6711
|
`Each run revokes the development credentials the application had before it. A deployed development environment holds the revoked values until it restarts, so the line's last re-mint restarts it where development serves a version. Its redeploy takes both re-minted credentials from custody, the connection string and the platform credential, and does not count toward the day's deploys. Where a deploy of development is still in flight, the re-mint's answer names restart_application on development, and your tool calls it once that deploy ends. ${PROVISION_SUBCOMMAND} writes no ${PORT_SETTING}: ${RUN_SUBCOMMAND} sets it from ${RUN_OPTION.port}.`
|
|
6617
6712
|
],
|
|
6618
6713
|
afterOwnError: provisionAfterOwnError,
|
|
@@ -8705,21 +8800,18 @@ var folderRefusalOf = (io2, options, files, takeLines, lineOf) => {
|
|
|
8705
8800
|
return null;
|
|
8706
8801
|
};
|
|
8707
8802
|
var RUN_AGAIN = "Run the same line again.";
|
|
8708
|
-
var
|
|
8709
|
-
var AFTER_LOGIN_FINISH_WORDS = Object.freeze({ opening: `Once ${LOGIN_SUBCOMMAND} has printed authorized:,`, again: "" });
|
|
8710
|
-
var finishSentence = (entry, takeLine, words = FINISH_WORDS) => `${words.opening} run this line at the project's root, which takes the ${entry} entry${words.again} and installs, then run npm test in ${APPLICATION_FOLDER}/: ${takeLine}`;
|
|
8803
|
+
var finishSentence = (entry, takeLine) => `To finish, run this line at the project's root, which takes the ${entry} entry again whole and installs, then run npm test in ${APPLICATION_FOLDER}/: ${takeLine}`;
|
|
8711
8804
|
var LINE_COUNT_WORDS = Object.freeze({ 2: "two", 3: "three", 4: "four" });
|
|
8712
|
-
var finishEachSentence = (entries, takeLines
|
|
8713
|
-
|
|
8805
|
+
var finishEachSentence = (entries, takeLines) => [
|
|
8806
|
+
`To finish, run each of these ${LINE_COUNT_WORDS[takeLines.length] ?? takeLines.length} lines at the project's root, in order, which take the ${listedAnd(entries)} entries again whole and install, then run npm test in ${APPLICATION_FOLDER}/:`,
|
|
8714
8807
|
...takeLines
|
|
8715
8808
|
].join("\n");
|
|
8716
8809
|
var FINISH_UNTAKEN = `To finish, run npm install and then npm test in ${APPLICATION_FOLDER}/.`;
|
|
8717
|
-
var finishOf = (entry, takeLine
|
|
8810
|
+
var finishOf = (entry, takeLine) => {
|
|
8718
8811
|
const [entries, lines] = [listOf(entry), listOf(takeLine)];
|
|
8719
8812
|
if (entries.length === 0 || lines.length !== entries.length) return FINISH_UNTAKEN;
|
|
8720
|
-
return entries.length === 1 ? finishSentence(entries[0], lines[0]
|
|
8813
|
+
return entries.length === 1 ? finishSentence(entries[0], lines[0]) : finishEachSentence(entries, lines);
|
|
8721
8814
|
};
|
|
8722
|
-
var afterLoginFinishOf = (entries, takeLines) => finishOf(entries, takeLines, AFTER_LOGIN_FINISH_WORDS);
|
|
8723
8815
|
var writtenClause = (entry) => {
|
|
8724
8816
|
const entries = listOf(entry);
|
|
8725
8817
|
if (entries.length === 0) return "the service's files are written";
|
|
@@ -8764,11 +8856,11 @@ var standsWayOn = (template, takeLines) => {
|
|
|
8764
8856
|
return `${takes.length > 0 ? `. ${takes.join("\n")}` : `: ${SCAFFOLD_SUBCOMMAND} starts a new application and writes over none.`}
|
|
8765
8857
|
${STANDS_DEPLOY_LINE}`;
|
|
8766
8858
|
};
|
|
8767
|
-
var stoppedCloseOf = (state, template, takeLines
|
|
8859
|
+
var stoppedCloseOf = (state, template, takeLines) => {
|
|
8768
8860
|
const before = `before ${APPLICATION_FOLDER}/ was written`;
|
|
8769
8861
|
switch (state) {
|
|
8770
8862
|
case "template":
|
|
8771
|
-
return `after ${APPLICATION_FOLDER}/ was written. ${finishOf(TEMPLATE_FACTS[template].takes.map((take) => take.entry), takeLines
|
|
8863
|
+
return `after ${APPLICATION_FOLDER}/ was written. ${finishOf(TEMPLATE_FACTS[template].takes.map((take) => take.entry), takeLines)}`;
|
|
8772
8864
|
case "absent":
|
|
8773
8865
|
return `${before}, and no ${APPLICATION_FOLDER}/ stands. ${RUN_AGAIN}`;
|
|
8774
8866
|
case "empty":
|
|
@@ -8781,8 +8873,8 @@ var stoppedCloseOf = (state, template, takeLines, words = FINISH_WORDS) => {
|
|
|
8781
8873
|
return `${before}, and what stands at ${APPLICATION_FOLDER} could not be read: make it readable or move it, then run the same line again.`;
|
|
8782
8874
|
}
|
|
8783
8875
|
};
|
|
8784
|
-
var ownErrorLine = (error, state, template, takeLines
|
|
8785
|
-
var signalEndedLine = (state, template, takeLines
|
|
8876
|
+
var ownErrorLine = (error, state, template, takeLines) => `The command stopped on an error of its own (${errorWordOf(error)}) ${stoppedCloseOf(state, template, takeLines)}`;
|
|
8877
|
+
var signalEndedLine = (state, template, takeLines) => `A signal ended the command ${stoppedCloseOf(state, template, takeLines)}`;
|
|
8786
8878
|
var ApplicationArrived = class extends Error {
|
|
8787
8879
|
};
|
|
8788
8880
|
var arrivedLine = (template, takeLines) => `${APPLICATION_FOLDER}/ took a file or a folder while the scaffold ran, so an application stands there and the template was not written${standsWayOn(template, takeLines)}`;
|
|
@@ -8880,7 +8972,6 @@ async function scaffold(call, io2) {
|
|
|
8880
8972
|
let lineOrigin = origin;
|
|
8881
8973
|
const lineOf = (entry) => takeLineFor(entry, lineOrigin);
|
|
8882
8974
|
let takeLines = takeLinesFor(lineOrigin);
|
|
8883
|
-
let finishWords = FINISH_WORDS;
|
|
8884
8975
|
let reached = "checks";
|
|
8885
8976
|
const stateNow = () => {
|
|
8886
8977
|
if (reached === "template") return "template";
|
|
@@ -8902,44 +8993,26 @@ async function scaffold(call, io2) {
|
|
|
8902
8993
|
if (refused !== null) return refuse(...refused);
|
|
8903
8994
|
const checks = [];
|
|
8904
8995
|
let held;
|
|
8905
|
-
let unsigned = null;
|
|
8906
|
-
const untaken = () => untakenLibraryOf(io2, root, (library) => writesOver(library, app));
|
|
8907
8996
|
if (takes.length === 0) {
|
|
8908
|
-
const found =
|
|
8997
|
+
const found = untakenLibraryOf(io2, root, (library) => writesOver(library, app));
|
|
8909
8998
|
if ("lines" in found) return refuse(...found.lines);
|
|
8910
8999
|
held = found;
|
|
8911
9000
|
} else {
|
|
8912
|
-
const
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
if (
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
const found = untaken();
|
|
8924
|
-
if ("lines" in found) return refuse(...found.lines);
|
|
8925
|
-
held = found;
|
|
8926
|
-
unsigned = credential.lines;
|
|
8927
|
-
finishWords = AFTER_LOGIN_FINISH_WORDS;
|
|
8928
|
-
} else {
|
|
8929
|
-
lineOrigin = credential.origin;
|
|
8930
|
-
takeLines = takeLinesFor(lineOrigin);
|
|
8931
|
-
for (const take of takes) {
|
|
8932
|
-
const copy = join10(app, "lib", take.entry);
|
|
8933
|
-
const planOf = (library) => writesOver(library, copy) ? { refusal: LIBRARY_OVER_APPLICATION } : { application: app, copy, declared: null, declaredAt: null };
|
|
8934
|
-
const read2 = await readTake(io2, { entry: take.entry, root, named: options.named, origin: credential.origin }, agent.userAgent, credential.bearer, planOf, checks.length > 0);
|
|
8935
|
-
if ("lines" in read2) return refuse(...read2.lines);
|
|
8936
|
-
if (read2.plan === null) {
|
|
8937
|
-
return refuse(`The ${take.entry} entry the library served carries no compiled modules, which the service's package file declares and installs. That is the platform's to fix: report it. ${NOTHING_WRITTEN2}`);
|
|
8938
|
-
}
|
|
8939
|
-
checks.push(read2);
|
|
9001
|
+
const credential = await readTakeCredential(io2, call.named[SCAFFOLD_OPTION.origin], SCAFFOLD_AFTER_LOGIN, SCAFFOLD_SIGN_IN_WHY);
|
|
9002
|
+
if ("lines" in credential) return refuse(...credential.lines);
|
|
9003
|
+
lineOrigin = credential.origin;
|
|
9004
|
+
takeLines = takeLinesFor(lineOrigin);
|
|
9005
|
+
for (const take of takes) {
|
|
9006
|
+
const copy = join10(app, "lib", take.entry);
|
|
9007
|
+
const planOf = (library) => writesOver(library, copy) ? { refusal: LIBRARY_OVER_APPLICATION } : { application: app, copy, declared: null, declaredAt: null };
|
|
9008
|
+
const read2 = await readTake(io2, { entry: take.entry, root, named: options.named, origin: credential.origin }, agent.userAgent, credential.bearer, planOf, checks.length > 0);
|
|
9009
|
+
if ("lines" in read2) return refuse(...read2.lines);
|
|
9010
|
+
if (read2.plan === null) {
|
|
9011
|
+
return refuse(`The ${take.entry} entry the library served carries no compiled modules, which the service's package file declares and installs. That is the platform's to fix: report it. ${NOTHING_WRITTEN2}`);
|
|
8940
9012
|
}
|
|
8941
|
-
|
|
9013
|
+
checks.push(read2);
|
|
8942
9014
|
}
|
|
9015
|
+
held = { library: checks[0].library, fresh: checks[0].fresh, packages: takenPackagesOf(checks) };
|
|
8943
9016
|
}
|
|
8944
9017
|
const arrived = folderRefusalOf(io2, options, files, takeLines, lineOf);
|
|
8945
9018
|
if (arrived !== null) return refuse(...arrived);
|
|
@@ -8948,7 +9021,7 @@ async function scaffold(call, io2) {
|
|
|
8948
9021
|
let ended = false;
|
|
8949
9022
|
release = io2.whenEnded(() => {
|
|
8950
9023
|
ended = true;
|
|
8951
|
-
printEach(io2, signalEndedLine(stateNow(), template, takeLines
|
|
9024
|
+
printEach(io2, signalEndedLine(stateNow(), template, takeLines));
|
|
8952
9025
|
});
|
|
8953
9026
|
reached = "writes";
|
|
8954
9027
|
if (io2.stat(root) === null) io2.makeFolder(root);
|
|
@@ -8964,16 +9037,12 @@ async function scaffold(call, io2) {
|
|
|
8964
9037
|
await io2.sleep(LOOP_TURN_MS);
|
|
8965
9038
|
release();
|
|
8966
9039
|
if (ended) return COMMAND_STATUS.unknown;
|
|
8967
|
-
if (unsigned !== null) {
|
|
8968
|
-
for (const line of unsigned) printEach(io2, line);
|
|
8969
|
-
return COMMAND_STATUS.failed;
|
|
8970
|
-
}
|
|
8971
9040
|
const taken = checks.map((check2, index) => ({ entry: takes[index].entry, version: check2.entry.version, line: takeLines[index] }));
|
|
8972
9041
|
return await installAndTest(io2, app, template, taken, lineOrigin, { tools, claude: claudeStands });
|
|
8973
9042
|
} catch (error) {
|
|
8974
9043
|
const state = stateNow();
|
|
8975
9044
|
const arrivedAs = error instanceof ApplicationArrived ? state : null;
|
|
8976
|
-
printEach(io2, arrivedAs === "held" ? arrivedLine(template, takeLines) : arrivedAs === "no folder" ? ARRIVED_NO_FOLDER_LINE : ownErrorLine(error, state, template, takeLines
|
|
9045
|
+
printEach(io2, arrivedAs === "held" ? arrivedLine(template, takeLines) : arrivedAs === "no folder" ? ARRIVED_NO_FOLDER_LINE : ownErrorLine(error, state, template, takeLines));
|
|
8977
9046
|
return COMMAND_STATUS.unknown;
|
|
8978
9047
|
} finally {
|
|
8979
9048
|
release();
|
|
@@ -9021,17 +9090,17 @@ async function installAndTest(io2, app, template, taken, origin, left) {
|
|
|
9021
9090
|
}
|
|
9022
9091
|
var SCAFFOLD_CREDENTIAL = LIBRARY_CREDENTIAL;
|
|
9023
9092
|
var SCAFFOLD_READS = `under a template that takes library entries what library take reads, ${LIBRARY_READS}; and under a template that takes none, no credential`;
|
|
9024
|
-
var
|
|
9093
|
+
var SCAFFOLD_AFTER_LOGIN = `Once ${LOGIN_SUBCOMMAND} has printed authorized:, run this ${SCAFFOLD_SUBCOMMAND} line again. ${NOTHING_WRITTEN2}`;
|
|
9025
9094
|
var SCAFFOLD_SIGN_IN_WHY = `A template that takes library entries needs a sign-in, since the library's reads are under a credential; ${SCAFFOLD_DEFAULT_TEMPLATE}, which takes none, runs without one.`;
|
|
9026
9095
|
var SCAFFOLD_ROW = Object.freeze({
|
|
9027
9096
|
name: SCAFFOLD_SUBCOMMAND,
|
|
9028
|
-
summary: `Writes a new service from a template into a project, ${SCAFFOLD_DEFAULT_TEMPLATE} where the line names no ${SCAFFOLD_OPTION.template}. A template that takes library entries, as database-service takes the Database entry and web-app takes three, takes each as library take does, under the credential library take reads, checking each file's SHA-256 and each entry's closure hash before it writes anything. It then writes the template's files under app/, the manifest's packages member filled from the library folder's rows, runs npm install and npm test there, and prints the next steps. Where such a template reads no credential, it writes
|
|
9097
|
+
summary: `Writes a new service from a template into a project, ${SCAFFOLD_DEFAULT_TEMPLATE} where the line names no ${SCAFFOLD_OPTION.template}. A template that takes library entries, as database-service takes the Database entry and web-app takes three, takes each as library take does, under the credential library take reads, checking each file's SHA-256 and each entry's closure hash before it writes anything. It then writes the template's files under app/, the manifest's packages member filled from the library folder's rows, runs npm install and npm test there, and prints the next steps. Where such a template reads no credential, it writes nothing and prints the login route, closed by this line to run again once signed in. It starts a new application and writes over none. A template that takes no entry reads no credential.`,
|
|
9029
9098
|
options: SCAFFOLD_OPTIONS,
|
|
9030
9099
|
credential: SCAFFOLD_CREDENTIAL,
|
|
9031
9100
|
reads: SCAFFOLD_READS,
|
|
9032
9101
|
statuses: {
|
|
9033
9102
|
done: "the files written and installed, the entries taken where the template takes any, and the tests passed",
|
|
9034
|
-
failed: "the files written, and npm install or the tests failed
|
|
9103
|
+
failed: "the files written, and npm install or the tests failed",
|
|
9035
9104
|
unknown: "the run stopped before its end, by an interrupt or another signal that ended npm, by an error of the command's own, or by something that came to stand at app while it wrote: the printed sentence names the way on",
|
|
9036
9105
|
nothing_started: "nothing was written"
|
|
9037
9106
|
},
|
|
@@ -9982,9 +10051,9 @@ async function runGuarded(argv2, io2) {
|
|
|
9982
10051
|
return COMMAND_STATUS.nothing_started;
|
|
9983
10052
|
}
|
|
9984
10053
|
const upgrade = startUpgradeCheck(io2, parsed.subcommand.name, parsed.call.named, version);
|
|
9985
|
-
const
|
|
9986
|
-
const
|
|
9987
|
-
|
|
10054
|
+
const notices = startUpdateNotices(io2, say, version, parsed.call.named);
|
|
10055
|
+
const status = await parsed.subcommand.run(parsed.call, notices.io);
|
|
10056
|
+
for (const line of notices.finish(upgrade)) say(line);
|
|
9988
10057
|
return status;
|
|
9989
10058
|
}
|
|
9990
10059
|
var outputOf = (argv2, io2) => argv2[0] === TOKEN_SUBCOMMAND && argv2[1] === TOKEN_CLAIM_ACT ? io2.printError ?? io2.print : io2.print;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "turnzero",
|
|
3
|
-
"version": "0.25.1",
|
|
3
|
+
"version": "0.25.5-next.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Turn Zero Cloud command, which an AI coding tool runs on your machine to deploy an application, store a secret, upload a file, download an export, take a library entry, write a local run's settings, start the application locally, and scaffold a new service from a template.",
|
|
6
6
|
"license": "Apache-2.0",
|