@slayzone/cli 0.36.2 → 0.36.3
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/slay.js +30 -28
- package/package.json +1 -1
package/dist/slay.js
CHANGED
|
@@ -22874,6 +22874,9 @@ function prepareProjectCreate(input) {
|
|
|
22874
22874
|
};
|
|
22875
22875
|
}
|
|
22876
22876
|
|
|
22877
|
+
// ../../shared/platform/src/computer-identity.ts
|
|
22878
|
+
var DEFAULT_LOCAL_COMPUTER_NAME = "local-computer";
|
|
22879
|
+
|
|
22877
22880
|
// src/commands/projects.ts
|
|
22878
22881
|
var DEFAULT_PROJECT_COLOR = "#3b82f6";
|
|
22879
22882
|
function narrowProject(p) {
|
|
@@ -25283,21 +25286,22 @@ ${parts.join(", ")} for "${projectName}"`);
|
|
|
25283
25286
|
console.log(`All ${stats.skipped} skills up to date for "${projectName}"`);
|
|
25284
25287
|
}
|
|
25285
25288
|
}
|
|
25286
|
-
async function
|
|
25287
|
-
if (explicit) return explicit;
|
|
25289
|
+
async function resolveTargetProject(explicit) {
|
|
25290
|
+
if (explicit) return { ref: explicit, localFolder: null };
|
|
25288
25291
|
const { data } = await apiGet(
|
|
25289
25292
|
`/api/projects/resolve-by-path?path=${encodeURIComponent(process.cwd())}`
|
|
25290
25293
|
);
|
|
25291
|
-
return data.id;
|
|
25294
|
+
return { ref: data.id, localFolder: data.path };
|
|
25292
25295
|
}
|
|
25293
25296
|
async function runInstall(opts) {
|
|
25294
|
-
const projectRef = await
|
|
25297
|
+
const { ref: projectRef, localFolder } = await resolveTargetProject(opts.project);
|
|
25295
25298
|
const { data } = await apiPost(
|
|
25296
25299
|
`/api/projects/${encodeURIComponent(projectRef)}/skills`,
|
|
25297
25300
|
{}
|
|
25298
25301
|
);
|
|
25299
25302
|
const { project, providers, stats, skills } = data;
|
|
25300
|
-
const
|
|
25303
|
+
const candidate = localFolder ?? project.path;
|
|
25304
|
+
const localPath = candidate && import_node_fs3.default.existsSync(candidate) ? candidate : null;
|
|
25301
25305
|
if (opts.writeInstructions && localPath) {
|
|
25302
25306
|
const written = writeInstructionsToDisk(localPath, providers);
|
|
25303
25307
|
for (const f of written) console.log(` Appended instructions to ${f}`);
|
|
@@ -26116,11 +26120,6 @@ var import_node_path9 = require("node:path");
|
|
|
26116
26120
|
// ../../shared/platform/src/slayzone-config.ts
|
|
26117
26121
|
var import_node_fs5 = require("node:fs");
|
|
26118
26122
|
var import_node_path6 = require("node:path");
|
|
26119
|
-
|
|
26120
|
-
// ../../shared/platform/src/computer-identity.ts
|
|
26121
|
-
var DEFAULT_LOCAL_COMPUTER_NAME = "local-computer";
|
|
26122
|
-
|
|
26123
|
-
// ../../shared/platform/src/slayzone-config.ts
|
|
26124
26123
|
var HUB_CONFIG_SWITCH_KEYS = [
|
|
26125
26124
|
"requireLogin",
|
|
26126
26125
|
"enablePassword",
|
|
@@ -26540,7 +26539,7 @@ var import_node_child_process3 = require("node:child_process");
|
|
|
26540
26539
|
var import_node_fs7 = require("node:fs");
|
|
26541
26540
|
var import_node_module = require("node:module");
|
|
26542
26541
|
var import_node_path8 = require("node:path");
|
|
26543
|
-
var CLI_VERSION = true ? "0.36.
|
|
26542
|
+
var CLI_VERSION = true ? "0.36.3" : "";
|
|
26544
26543
|
function fail(message) {
|
|
26545
26544
|
console.error(message);
|
|
26546
26545
|
process.exit(1);
|
|
@@ -26977,6 +26976,25 @@ function postJson2(transport, url, body, timeoutMs) {
|
|
|
26977
26976
|
});
|
|
26978
26977
|
}
|
|
26979
26978
|
|
|
26979
|
+
// ../../domains/hub-auth/src/client/sign-in-error.ts
|
|
26980
|
+
var ASK_ADMIN = "If it keeps failing, ask your administrator.";
|
|
26981
|
+
var MESSAGES2 = {
|
|
26982
|
+
// T-09 refuses every ID token that fails its checks with this generic code: another
|
|
26983
|
+
// tenant, no MFA, no SlayZone app role, no email (the audit line names which).
|
|
26984
|
+
unable_to_get_user_info: "Microsoft refused this account for this hub: it may belong to another organisation, have signed in without multi-factor authentication, or not be assigned to SlayZone. Ask your administrator.",
|
|
26985
|
+
ACCOUNT_DISABLED: "This account is disabled on this hub. Ask your administrator.",
|
|
26986
|
+
account_not_linked: "The email of this Microsoft account already belongs to another account on this hub, so it cannot sign in. Ask your administrator.",
|
|
26987
|
+
unable_to_link_account: "This Microsoft account could not be connected to an account on this hub. Ask your administrator.",
|
|
26988
|
+
access_denied: "Sign-in was cancelled at Microsoft. Try again.",
|
|
26989
|
+
state_mismatch: "The sign-in took too long or was started in another tab. Try again.",
|
|
26990
|
+
please_restart_the_process: "The sign-in took too long or was started in another tab. Try again.",
|
|
26991
|
+
invalid_callback_request: "The sign-in took too long or was started in another tab. Try again.",
|
|
26992
|
+
no_session: `Microsoft sign-in did not complete. Try again. ${ASK_ADMIN}`,
|
|
26993
|
+
// App sign-in (`src/server/app-sign-in.ts`).
|
|
26994
|
+
flow_expired: "The sign-in took too long or its browser window was closed. Try again.",
|
|
26995
|
+
temporarily_unavailable: "Too many sign-ins are waiting on this hub. Try again in a few minutes."
|
|
26996
|
+
};
|
|
26997
|
+
|
|
26980
26998
|
// ../../domains/hub-auth/src/client/health.ts
|
|
26981
26999
|
async function fetchHubHealth(transport, baseUrl, timeoutMs) {
|
|
26982
27000
|
try {
|
|
@@ -27163,22 +27181,6 @@ async function fetchSessionEmail(transport, baseUrl, token, timeoutMs = AUTH_TIM
|
|
|
27163
27181
|
}
|
|
27164
27182
|
}
|
|
27165
27183
|
|
|
27166
|
-
// ../../domains/hub-auth/src/client/sign-in-error.ts
|
|
27167
|
-
var ASK_ADMIN = "If it keeps failing, ask your administrator.";
|
|
27168
|
-
var MESSAGES2 = {
|
|
27169
|
-
// T-09 refuses every ID token that fails its checks with this generic code: another
|
|
27170
|
-
// tenant, no MFA, no SlayZone app role, no email (the audit line names which).
|
|
27171
|
-
unable_to_get_user_info: "Microsoft refused this account for this hub: it may belong to another organisation, have signed in without multi-factor authentication, or not be assigned to SlayZone. Ask your administrator.",
|
|
27172
|
-
ACCOUNT_DISABLED: "This account is disabled on this hub. Ask your administrator.",
|
|
27173
|
-
account_not_linked: "The email of this Microsoft account already belongs to another account on this hub, so it cannot sign in. Ask your administrator.",
|
|
27174
|
-
unable_to_link_account: "This Microsoft account could not be connected to an account on this hub. Ask your administrator.",
|
|
27175
|
-
access_denied: "Sign-in was cancelled at Microsoft. Try again.",
|
|
27176
|
-
state_mismatch: "The sign-in took too long or was started in another tab. Try again.",
|
|
27177
|
-
please_restart_the_process: "The sign-in took too long or was started in another tab. Try again.",
|
|
27178
|
-
invalid_callback_request: "The sign-in took too long or was started in another tab. Try again.",
|
|
27179
|
-
no_session: `Microsoft sign-in did not complete. Try again. ${ASK_ADMIN}`
|
|
27180
|
-
};
|
|
27181
|
-
|
|
27182
27184
|
// ../../domains/hub-auth/src/client-node/index.ts
|
|
27183
27185
|
var import_node_http3 = __toESM(require("node:http"), 1);
|
|
27184
27186
|
var import_node_https = __toESM(require("node:https"), 1);
|
|
@@ -29102,7 +29104,7 @@ function updateCommand() {
|
|
|
29102
29104
|
}
|
|
29103
29105
|
|
|
29104
29106
|
// src/index.ts
|
|
29105
|
-
var program2 = new Command().name("slay").description("SlayZone CLI").version("0.36.
|
|
29107
|
+
var program2 = new Command().name("slay").description("SlayZone CLI").version("0.36.3").option("--dev", "Use development database (slayzone.dev.data.sqlite)").option("--hub <name|port>", "Target a specific hub on this machine (see `slay hub ls`)").showSuggestionAfterError(true).showHelpAfterError(true).hook("preAction", async (thisCommand) => {
|
|
29106
29108
|
const root = thisCommand.parent ?? thisCommand;
|
|
29107
29109
|
const opts = root.opts();
|
|
29108
29110
|
if (opts.dev) process.env.SLAYZONE_DEV = "1";
|