@antasphere/slideless 0.13.7 → 0.13.8
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/bin.js +277 -156
- package/package.json +4 -4
package/dist/bin.js
CHANGED
|
@@ -3032,7 +3032,7 @@ var require_commander = __commonJS({
|
|
|
3032
3032
|
// src/bin.ts
|
|
3033
3033
|
import { createInterface } from "node:readline/promises";
|
|
3034
3034
|
|
|
3035
|
-
// ../../node_modules/.pnpm/@antasphere+cli-core@0.
|
|
3035
|
+
// ../../node_modules/.pnpm/@antasphere+cli-core@0.6.0/node_modules/@antasphere/cli-core/dist/config.js
|
|
3036
3036
|
import { chmodSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3037
3037
|
import { dirname, join } from "node:path";
|
|
3038
3038
|
var HUB_TOOL = "hub";
|
|
@@ -3099,8 +3099,13 @@ function redactKey(key) {
|
|
|
3099
3099
|
return "****";
|
|
3100
3100
|
return `${key.slice(0, 13)}\u2026${key.slice(-4)}`;
|
|
3101
3101
|
}
|
|
3102
|
-
function
|
|
3103
|
-
|
|
3102
|
+
function cachedConnectKey(profile, hubProfileName, hubEmail) {
|
|
3103
|
+
const entry = profile?.connectKeys?.[hubProfileName];
|
|
3104
|
+
const hub = hubEmail?.trim().toLowerCase();
|
|
3105
|
+
const minted = entry?.email?.trim().toLowerCase();
|
|
3106
|
+
if (!hub || !minted || hub !== minted)
|
|
3107
|
+
return void 0;
|
|
3108
|
+
return entry?.apiKey;
|
|
3104
3109
|
}
|
|
3105
3110
|
function storeConnectKey(env, tool, profileName, hubProfileName, entry, opts = {}) {
|
|
3106
3111
|
const config2 = loadConfig(env, tool);
|
|
@@ -3131,7 +3136,7 @@ function removeConnectKey(env, tool, profileName, hubProfileName) {
|
|
|
3131
3136
|
return true;
|
|
3132
3137
|
}
|
|
3133
3138
|
|
|
3134
|
-
// ../../node_modules/.pnpm/@antasphere+cli-core@0.
|
|
3139
|
+
// ../../node_modules/.pnpm/@antasphere+cli-core@0.6.0/node_modules/@antasphere/cli-core/dist/io.js
|
|
3135
3140
|
async function ask(io, question) {
|
|
3136
3141
|
if (!io.prompt) {
|
|
3137
3142
|
throw new Error("This command is interactive \u2014 no prompt available (pass the value as a flag).");
|
|
@@ -3146,7 +3151,7 @@ function printJson(io, value) {
|
|
|
3146
3151
|
`);
|
|
3147
3152
|
}
|
|
3148
3153
|
|
|
3149
|
-
// ../../node_modules/.pnpm/@antasphere+cli-core@0.
|
|
3154
|
+
// ../../node_modules/.pnpm/@antasphere+cli-core@0.6.0/node_modules/@antasphere/cli-core/dist/resolve.js
|
|
3150
3155
|
var CliUsageError = class extends Error {
|
|
3151
3156
|
exitCode;
|
|
3152
3157
|
constructor(message, opts = {}) {
|
|
@@ -3251,7 +3256,7 @@ function resolveApiKey(opts) {
|
|
|
3251
3256
|
return firstSet(opts.flag, opts.env[opts.envVar], opts.profile?.apiKey);
|
|
3252
3257
|
}
|
|
3253
3258
|
|
|
3254
|
-
// ../../node_modules/.pnpm/@antasphere+cli-core@0.
|
|
3259
|
+
// ../../node_modules/.pnpm/@antasphere+cli-core@0.6.0/node_modules/@antasphere/cli-core/dist/auth.js
|
|
3255
3260
|
var CliAuthError = class extends Error {
|
|
3256
3261
|
status;
|
|
3257
3262
|
code;
|
|
@@ -3306,7 +3311,7 @@ var CliAuthClient = class {
|
|
|
3306
3311
|
}
|
|
3307
3312
|
};
|
|
3308
3313
|
|
|
3309
|
-
// ../../node_modules/.pnpm/@antasphere+cli-core@0.
|
|
3314
|
+
// ../../node_modules/.pnpm/@antasphere+cli-core@0.6.0/node_modules/@antasphere/cli-core/dist/connect.js
|
|
3310
3315
|
var CliConnectError = class extends CliAuthError {
|
|
3311
3316
|
stage;
|
|
3312
3317
|
constructor(stage, status, code, message, details) {
|
|
@@ -3393,7 +3398,7 @@ var CliConnectClient = class {
|
|
|
3393
3398
|
}
|
|
3394
3399
|
};
|
|
3395
3400
|
|
|
3396
|
-
// ../../node_modules/.pnpm/@antasphere+cli-core@0.
|
|
3401
|
+
// ../../node_modules/.pnpm/@antasphere+cli-core@0.6.0/node_modules/@antasphere/cli-core/dist/connect-on-demand.js
|
|
3397
3402
|
async function probeToolInstance(toolBaseUrl, fetchImpl) {
|
|
3398
3403
|
const f = fetchImpl ?? globalThis.fetch.bind(globalThis);
|
|
3399
3404
|
try {
|
|
@@ -3416,8 +3421,15 @@ async function probeToolInstance(toolBaseUrl, fetchImpl) {
|
|
|
3416
3421
|
return null;
|
|
3417
3422
|
}
|
|
3418
3423
|
}
|
|
3419
|
-
|
|
3420
|
-
|
|
3424
|
+
var HUB_URL_ENV = "ANTASPHERE_URL";
|
|
3425
|
+
function selectHubProfile(env, opts = {}) {
|
|
3426
|
+
const config2 = loadConfig(env, HUB_TOOL);
|
|
3427
|
+
const apiUrl = firstSet(env[HUB_URL_ENV]);
|
|
3428
|
+
if (apiUrl) {
|
|
3429
|
+
const { name, profile } = selectProfile({ config: config2, apiUrl, cloudUrl: opts.cloudUrl });
|
|
3430
|
+
return { name, profile };
|
|
3431
|
+
}
|
|
3432
|
+
return resolveProfile(config2, void 0);
|
|
3421
3433
|
}
|
|
3422
3434
|
function defaultMissingHubLogin(tool) {
|
|
3423
3435
|
const envVar = `${tool.replace(/-/g, "_").toUpperCase()}_API_KEY`;
|
|
@@ -3438,11 +3450,11 @@ async function connectOnDemand(opts) {
|
|
|
3438
3450
|
const toolBaseUrl = normalizeUrl(opts.toolBaseUrl);
|
|
3439
3451
|
const messages = opts.messages ?? {};
|
|
3440
3452
|
const { profileName } = opts;
|
|
3441
|
-
const hub =
|
|
3453
|
+
const hub = selectHubProfile(opts.env, { cloudUrl: opts.hubCloudUrl });
|
|
3442
3454
|
const existing = loadConfig(opts.env, opts.tool).profiles[profileName];
|
|
3443
3455
|
const { place, at } = placeOf(existing, toolBaseUrl, opts.cloudUrl);
|
|
3444
3456
|
if (opts.cached !== false && place === "here" && hub.name) {
|
|
3445
|
-
const cachedKey =
|
|
3457
|
+
const cachedKey = cachedConnectKey(existing, hub.name, hub.profile?.email);
|
|
3446
3458
|
if (cachedKey)
|
|
3447
3459
|
return { outcome: "connected", key: cachedKey, cached: true };
|
|
3448
3460
|
}
|
|
@@ -3450,7 +3462,7 @@ async function connectOnDemand(opts) {
|
|
|
3450
3462
|
if (!probe?.cloud)
|
|
3451
3463
|
return { outcome: "not_cloud" };
|
|
3452
3464
|
const hubKey = firstSet(hub.profile?.apiKey);
|
|
3453
|
-
const hubBaseUrl = firstSet(hub.profile?.baseUrl);
|
|
3465
|
+
const hubBaseUrl = firstSet(hub.profile?.baseUrl, opts.hubCloudUrl);
|
|
3454
3466
|
if (!hubKey || !hubBaseUrl || !hub.name) {
|
|
3455
3467
|
throw new CliUsageError(messages.missingHubLogin ?? defaultMissingHubLogin(opts.tool));
|
|
3456
3468
|
}
|
|
@@ -3496,7 +3508,7 @@ async function connectOnDemand(opts) {
|
|
|
3496
3508
|
}
|
|
3497
3509
|
async function refreshConnectKey(opts) {
|
|
3498
3510
|
assertToolNamespace(opts.tool);
|
|
3499
|
-
const hub =
|
|
3511
|
+
const hub = selectHubProfile(opts.env, { cloudUrl: opts.hubCloudUrl });
|
|
3500
3512
|
const existing = loadConfig(opts.env, opts.tool).profiles[opts.profileName];
|
|
3501
3513
|
const { place } = placeOf(existing, normalizeUrl(opts.toolBaseUrl), opts.cloudUrl);
|
|
3502
3514
|
if (hub.name && place === "here")
|
|
@@ -3504,7 +3516,7 @@ async function refreshConnectKey(opts) {
|
|
|
3504
3516
|
return connectOnDemand({ ...opts, cached: false });
|
|
3505
3517
|
}
|
|
3506
3518
|
|
|
3507
|
-
// ../../node_modules/.pnpm/@antasphere+cli-core@0.
|
|
3519
|
+
// ../../node_modules/.pnpm/@antasphere+cli-core@0.6.0/node_modules/@antasphere/cli-core/dist/migrate.js
|
|
3508
3520
|
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
3509
3521
|
import { join as join2 } from "node:path";
|
|
3510
3522
|
function migrateLegacyConfig(env, spec) {
|
|
@@ -3535,33 +3547,33 @@ function migrateLegacyConfig(env, spec) {
|
|
|
3535
3547
|
return { migrated: true, from, to };
|
|
3536
3548
|
}
|
|
3537
3549
|
|
|
3538
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
3550
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/config.js
|
|
3539
3551
|
function createConfig(identity) {
|
|
3540
3552
|
const TOOL = identity.tool;
|
|
3541
3553
|
const LEGACY = { tool: TOOL, legacyDir: identity.legacyConfigDir };
|
|
3542
|
-
function
|
|
3554
|
+
function configPath3(env) {
|
|
3543
3555
|
return configPath(env, TOOL);
|
|
3544
3556
|
}
|
|
3545
|
-
function
|
|
3557
|
+
function loadConfig4(env) {
|
|
3546
3558
|
try {
|
|
3547
3559
|
migrateLegacyConfig(env, LEGACY);
|
|
3548
3560
|
} catch {
|
|
3549
3561
|
}
|
|
3550
3562
|
return loadConfig(env, TOOL);
|
|
3551
3563
|
}
|
|
3552
|
-
function
|
|
3564
|
+
function saveConfig4(env, config2) {
|
|
3553
3565
|
return saveConfig(env, TOOL, config2);
|
|
3554
3566
|
}
|
|
3555
|
-
function
|
|
3567
|
+
function clearConfig3(env) {
|
|
3556
3568
|
clearConfig(env, TOOL);
|
|
3557
3569
|
}
|
|
3558
|
-
function
|
|
3570
|
+
function removeConnectKey3(env, profileName, hubProfileName) {
|
|
3559
3571
|
return removeConnectKey(env, TOOL, profileName, hubProfileName);
|
|
3560
3572
|
}
|
|
3561
|
-
return { configPath:
|
|
3573
|
+
return { configPath: configPath3, loadConfig: loadConfig4, saveConfig: saveConfig4, clearConfig: clearConfig3, removeConnectKey: removeConnectKey3 };
|
|
3562
3574
|
}
|
|
3563
3575
|
|
|
3564
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-sdk@1.
|
|
3576
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-sdk@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-sdk/dist/index.js
|
|
3565
3577
|
var PlatformApiError = class extends Error {
|
|
3566
3578
|
status;
|
|
3567
3579
|
code;
|
|
@@ -3752,6 +3764,32 @@ var ChassisClient = class {
|
|
|
3752
3764
|
ssoCliConnect(req) {
|
|
3753
3765
|
return this.request("POST", "/sso/cli-connect", req);
|
|
3754
3766
|
}
|
|
3767
|
+
/**
|
|
3768
|
+
* Public, CLOUD EDITION only (404 on oss): download the tool's own CLI
|
|
3769
|
+
* package (a gzipped tarball, `instance().cli` names it) on a hub-minted
|
|
3770
|
+
* exchange token, the same token and the same one-time rule as
|
|
3771
|
+
* ssoCliConnect. The token rides in the body and the client's API key is
|
|
3772
|
+
* NEVER sent: the route refuses a machine credential (403
|
|
3773
|
+
* `endpoint_not_allowed`). Raw Response so the caller can stream it; a
|
|
3774
|
+
* non-2xx answer throws PlatformApiError (401 `invalid_token`, 404
|
|
3775
|
+
* `cli_not_packaged`, 404 `not_found` on an instance without the route).
|
|
3776
|
+
*/
|
|
3777
|
+
async downloadCliPackage(req) {
|
|
3778
|
+
const { authorization: _credential, ...headers } = this.baseHeaders();
|
|
3779
|
+
const res = await this.fetchImpl(`${this.baseUrl}/api/v1/cli/package`, {
|
|
3780
|
+
method: "POST",
|
|
3781
|
+
headers: { ...headers, "content-type": "application/json" },
|
|
3782
|
+
credentials: "same-origin",
|
|
3783
|
+
signal: this.signal("download"),
|
|
3784
|
+
// Browser-only field; cast keeps this isomorphic under a Node lib.
|
|
3785
|
+
cache: "no-store",
|
|
3786
|
+
body: JSON.stringify(req)
|
|
3787
|
+
});
|
|
3788
|
+
if (!res.ok) {
|
|
3789
|
+
await this.parse(res);
|
|
3790
|
+
}
|
|
3791
|
+
return res;
|
|
3792
|
+
}
|
|
3755
3793
|
/**
|
|
3756
3794
|
* CLOUD EDITION only (404 on oss); sessions only (machines 403 — the
|
|
3757
3795
|
* path is unlisted in the scope allowlist): single logout. The server
|
|
@@ -4074,7 +4112,22 @@ var ChassisClient = class {
|
|
|
4074
4112
|
}
|
|
4075
4113
|
};
|
|
4076
4114
|
|
|
4077
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
4115
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/identity.js
|
|
4116
|
+
var DEFAULT_HUB_URL = "https://account.antasphere.com";
|
|
4117
|
+
function cliIdentity(identity) {
|
|
4118
|
+
return {
|
|
4119
|
+
bin: identity.cli.bin,
|
|
4120
|
+
tool: identity.slug,
|
|
4121
|
+
legacyConfigDir: identity.cli.legacyConfigDir,
|
|
4122
|
+
displayName: identity.displayName,
|
|
4123
|
+
envPrefix: identity.cli.envPrefix,
|
|
4124
|
+
keyPrefix: identity.apiKeyPrefix,
|
|
4125
|
+
exportScope: identity.scopes.dataExport,
|
|
4126
|
+
cloudUrl: identity.cloud.url
|
|
4127
|
+
};
|
|
4128
|
+
}
|
|
4129
|
+
|
|
4130
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/workspace.js
|
|
4078
4131
|
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
4079
4132
|
function isWorkspaceId(value) {
|
|
4080
4133
|
return UUID_RE.test(value);
|
|
@@ -4181,7 +4234,7 @@ ${workspaceLines(me.workspaces)}`;
|
|
|
4181
4234
|
};
|
|
4182
4235
|
}
|
|
4183
4236
|
|
|
4184
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
4237
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/context.js
|
|
4185
4238
|
var CliApiRefusal = class extends CliUsageError {
|
|
4186
4239
|
status;
|
|
4187
4240
|
constructor(message, status) {
|
|
@@ -4220,19 +4273,19 @@ function printJson2(io, value) {
|
|
|
4220
4273
|
var appliedContexts = /* @__PURE__ */ new WeakMap();
|
|
4221
4274
|
function createContext(input) {
|
|
4222
4275
|
const { identity, createClient } = input;
|
|
4223
|
-
const { loadConfig:
|
|
4276
|
+
const { loadConfig: loadConfig4, removeConnectKey: removeConnectKey3 } = input.config;
|
|
4224
4277
|
const { describeSelection, explainRefusal, pickWorkspaceSelection } = input.workspace;
|
|
4225
4278
|
const unknownHint = `run \`${identity.bin} profiles\` to list them.`;
|
|
4226
|
-
function
|
|
4279
|
+
function resolveProfile3(config2, requested) {
|
|
4227
4280
|
const { name, profile } = selectProfile({ config: config2, requested, cloudUrl: identity.cloudUrl, unknownHint });
|
|
4228
4281
|
return { name, profile };
|
|
4229
4282
|
}
|
|
4230
|
-
function
|
|
4283
|
+
function profileUrl3(profile) {
|
|
4231
4284
|
return profile?.baseUrl ?? identity.cloudUrl;
|
|
4232
4285
|
}
|
|
4233
4286
|
function resolveContext2(cmd, io) {
|
|
4234
4287
|
const opts = cmd.optsWithGlobals();
|
|
4235
|
-
const config2 =
|
|
4288
|
+
const config2 = loadConfig4(io.env);
|
|
4236
4289
|
const apiUrl = opts.apiUrl ?? opts.url ?? io.env[`${identity.envPrefix}_URL`];
|
|
4237
4290
|
const selected = selectProfile({
|
|
4238
4291
|
config: config2,
|
|
@@ -4249,7 +4302,7 @@ function createContext(input) {
|
|
|
4249
4302
|
profile,
|
|
4250
4303
|
cloudUrl: identity.cloudUrl
|
|
4251
4304
|
});
|
|
4252
|
-
const sameProfileInstance = sameInstance(
|
|
4305
|
+
const sameProfileInstance = sameInstance(profileUrl3(profile), baseUrl);
|
|
4253
4306
|
let apiKey = resolveApiKey({
|
|
4254
4307
|
flag: opts.apiKey ?? stdinApiKeys.get(io),
|
|
4255
4308
|
env: io.env,
|
|
@@ -4258,10 +4311,9 @@ function createContext(input) {
|
|
|
4258
4311
|
});
|
|
4259
4312
|
let credentialSource = opts.apiKey !== void 0 || stdinApiKeys.get(io) !== void 0 ? "flag" : io.env[`${identity.envPrefix}_API_KEY`] ? "env" : apiKey ? "profile" : "none";
|
|
4260
4313
|
if (!apiKey && sameProfileInstance) {
|
|
4261
|
-
const hub =
|
|
4262
|
-
if (hub.name
|
|
4263
|
-
apiKey =
|
|
4264
|
-
}
|
|
4314
|
+
const hub = selectHubProfile(io.env, { cloudUrl: DEFAULT_HUB_URL });
|
|
4315
|
+
if (hub.name)
|
|
4316
|
+
apiKey = cachedConnectKey(profile, hub.name, hub.profile?.email);
|
|
4265
4317
|
if (apiKey)
|
|
4266
4318
|
credentialSource = "hub-cache";
|
|
4267
4319
|
}
|
|
@@ -4289,12 +4341,6 @@ function createContext(input) {
|
|
|
4289
4341
|
}
|
|
4290
4342
|
return ctx;
|
|
4291
4343
|
}
|
|
4292
|
-
function cachedForAnotherAccount(profile, slot, hubEmail) {
|
|
4293
|
-
const cached2 = profile?.connectKeys?.[slot]?.email;
|
|
4294
|
-
if (!cached2 || !hubEmail)
|
|
4295
|
-
return false;
|
|
4296
|
-
return cached2.toLowerCase() !== hubEmail.toLowerCase();
|
|
4297
|
-
}
|
|
4298
4344
|
const NO_KEY_MESSAGE = `An API key is required. Sign in (\`${identity.bin} login\`), pass --api-key, or set ${identity.envPrefix}_API_KEY.`;
|
|
4299
4345
|
const MISSING_HUB_LOGIN_MESSAGE = `This ${identity.displayName} instance signs in through Antasphere. Run \`${identity.bin} login\` once (or \`antasphere login\`), then retry \u2014 or pass --api-key <${identity.keyPrefix}_\u2026> / set ${identity.envPrefix}_API_KEY.`;
|
|
4300
4346
|
function connectOptions(ctx) {
|
|
@@ -4304,6 +4350,10 @@ function createContext(input) {
|
|
|
4304
4350
|
toolBaseUrl: ctx.baseUrl,
|
|
4305
4351
|
// A profile with no baseUrl of its own is at the cloud URL (cli-core 0.5.0).
|
|
4306
4352
|
cloudUrl: identity.cloudUrl,
|
|
4353
|
+
// The same for a hub profile (cli-core 0.6.0, verifier round 1, F4):
|
|
4354
|
+
// one with no baseUrl is at the default hub, so ANTASPHERE_URL naming
|
|
4355
|
+
// that hub finds it, and the slot it names is the one this kit reads.
|
|
4356
|
+
hubCloudUrl: DEFAULT_HUB_URL,
|
|
4307
4357
|
profileName: ctx.profileName ?? CLOUD_PROFILE,
|
|
4308
4358
|
env: io.env,
|
|
4309
4359
|
// Thread the injected fetch so the probe + exchange stay on the test
|
|
@@ -4330,9 +4380,10 @@ function createContext(input) {
|
|
|
4330
4380
|
const outcome = await refreshConnectKey(connectOptions(ctx));
|
|
4331
4381
|
if (outcome.outcome === "not_cloud")
|
|
4332
4382
|
return res;
|
|
4383
|
+
ctx.io.err.write("The cached key was refused; signed in again through Antasphere.\n");
|
|
4384
|
+
healHubAddress(ctx, outcome);
|
|
4333
4385
|
ctx.apiKey = outcome.key;
|
|
4334
4386
|
ctx.credentialSource = "hub-exchange";
|
|
4335
|
-
ctx.io.err.write("The cached key was refused; signed in again through Antasphere.\n");
|
|
4336
4387
|
const headers = new Headers(init?.headers);
|
|
4337
4388
|
headers.set("authorization", `Bearer ${outcome.key}`);
|
|
4338
4389
|
return base(input2, { ...init, headers });
|
|
@@ -4387,26 +4438,49 @@ function createContext(input) {
|
|
|
4387
4438
|
const noun = selection.kind === "org" ? "organization" : "workspace";
|
|
4388
4439
|
return ` (looked in the ${noun} "${selection.value}", selected by ${describeSelection(selection)})`;
|
|
4389
4440
|
}
|
|
4441
|
+
async function connect(ctx, overrides = {}) {
|
|
4442
|
+
const outcome = await connectOnDemand({ ...connectOptions(ctx), ...overrides });
|
|
4443
|
+
healHubAddress(ctx, outcome);
|
|
4444
|
+
return outcome;
|
|
4445
|
+
}
|
|
4446
|
+
function healHubAddress(ctx, outcome) {
|
|
4447
|
+
if (outcome.outcome !== "connected" || outcome.cached || !outcome.result)
|
|
4448
|
+
return;
|
|
4449
|
+
const answered = firstSet(outcome.result.user.email);
|
|
4450
|
+
if (!answered)
|
|
4451
|
+
return;
|
|
4452
|
+
const hub = selectHubProfile(ctx.io.env, { cloudUrl: DEFAULT_HUB_URL });
|
|
4453
|
+
const hubConfig = loadConfig(ctx.io.env, HUB_TOOL);
|
|
4454
|
+
const stored = hub.name ? hubConfig.profiles[hub.name] : void 0;
|
|
4455
|
+
const had = firstSet(stored?.email);
|
|
4456
|
+
if (!hub.name || !stored || had?.toLowerCase() === answered.toLowerCase())
|
|
4457
|
+
return;
|
|
4458
|
+
hubConfig.profiles[hub.name] = { ...stored, email: answered };
|
|
4459
|
+
saveConfig(ctx.io.env, HUB_TOOL, hubConfig);
|
|
4460
|
+
if (had) {
|
|
4461
|
+
ctx.io.err.write(`The Antasphere login's address is now ${answered}, replaced from ${had} (the hub's own answer).
|
|
4462
|
+
`);
|
|
4463
|
+
}
|
|
4464
|
+
}
|
|
4390
4465
|
async function connectForKey(ctx) {
|
|
4391
4466
|
const { io } = ctx;
|
|
4392
|
-
const hub =
|
|
4467
|
+
const hub = selectHubProfile(io.env, { cloudUrl: DEFAULT_HUB_URL });
|
|
4393
4468
|
if (ctx.profileName && hub.name) {
|
|
4394
|
-
const profile =
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
`);
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
}
|
|
4469
|
+
const profile = loadConfig4(io.env).profiles[ctx.profileName];
|
|
4470
|
+
const stale = profile?.connectKeys?.[hub.name];
|
|
4471
|
+
if (stale && !cachedConnectKey(profile, hub.name, hub.profile?.email)) {
|
|
4472
|
+
const hubEmail = firstSet(hub.profile?.email);
|
|
4473
|
+
io.err.write(`The ${identity.displayName} key cached for ${firstSet(stale.email) ?? "an unknown login"} is retired: ` + (hubEmail ? `the Antasphere login is now ${hubEmail}.
|
|
4474
|
+
` : "the Antasphere login carries no address to match it with.\n"));
|
|
4475
|
+
const auth = new CliAuthClient({
|
|
4476
|
+
baseUrl: profileUrl3(profile),
|
|
4477
|
+
...io.fetch ? { fetch: io.fetch } : {}
|
|
4478
|
+
});
|
|
4479
|
+
await auth.revoke(stale.apiKey).catch(() => void 0);
|
|
4480
|
+
removeConnectKey3(io.env, ctx.profileName, hub.name);
|
|
4407
4481
|
}
|
|
4408
4482
|
}
|
|
4409
|
-
const outcome = await
|
|
4483
|
+
const outcome = await connect(ctx);
|
|
4410
4484
|
if (outcome.outcome === "not_cloud") {
|
|
4411
4485
|
throw new CliUsageError(NO_KEY_MESSAGE);
|
|
4412
4486
|
}
|
|
@@ -4421,14 +4495,15 @@ function createContext(input) {
|
|
|
4421
4495
|
return outcome.key;
|
|
4422
4496
|
}
|
|
4423
4497
|
return {
|
|
4424
|
-
resolveProfile:
|
|
4498
|
+
resolveProfile: resolveProfile3,
|
|
4425
4499
|
resolveContext: resolveContext2,
|
|
4426
4500
|
requireApiKey: requireApiKey2,
|
|
4427
4501
|
workspaceSource,
|
|
4428
4502
|
explainWorkspaceRefusal,
|
|
4429
4503
|
workspaceNotFoundHint,
|
|
4430
|
-
profileUrl:
|
|
4431
|
-
connectOptions
|
|
4504
|
+
profileUrl: profileUrl3,
|
|
4505
|
+
connectOptions,
|
|
4506
|
+
connect
|
|
4432
4507
|
};
|
|
4433
4508
|
}
|
|
4434
4509
|
async function drainPages(first, fetchPage) {
|
|
@@ -4475,7 +4550,7 @@ var {
|
|
|
4475
4550
|
Help
|
|
4476
4551
|
} = import_index.default;
|
|
4477
4552
|
|
|
4478
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
4553
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/stdin.js
|
|
4479
4554
|
var claims = /* @__PURE__ */ new WeakMap();
|
|
4480
4555
|
async function readAllStdin() {
|
|
4481
4556
|
const chunks = [];
|
|
@@ -4496,9 +4571,8 @@ async function readSecretFromStdin(io, claimant) {
|
|
|
4496
4571
|
return value;
|
|
4497
4572
|
}
|
|
4498
4573
|
|
|
4499
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
4500
|
-
var
|
|
4501
|
-
var DEFAULT_HUB_URL = "https://account.antasphere.com";
|
|
4574
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/auth.js
|
|
4575
|
+
var HUB_URL_ENV2 = "ANTASPHERE_URL";
|
|
4502
4576
|
function describeCredential(source, profileName) {
|
|
4503
4577
|
switch (source) {
|
|
4504
4578
|
case "flag":
|
|
@@ -4530,10 +4604,10 @@ function organizationsLine(me) {
|
|
|
4530
4604
|
`;
|
|
4531
4605
|
}
|
|
4532
4606
|
function registerAuthCommands(kit, program2, io) {
|
|
4533
|
-
const { identity, createClient, clearConfig:
|
|
4607
|
+
const { identity, createClient, clearConfig: clearConfig3, configPath: configPath3, connect, loadConfig: loadConfig4, profileUrl: profileUrl3, removeConnectKey: removeConnectKey3, requireApiKey: requireApiKey2, resolveContext: resolveContext2, saveConfig: saveConfig4, workspaceSource } = kit;
|
|
4534
4608
|
const { describeSource } = kit.workspace;
|
|
4535
4609
|
function saveProfileKey(profileName, baseUrl, apiKey, email3) {
|
|
4536
|
-
const config3 =
|
|
4610
|
+
const config3 = loadConfig4(io.env);
|
|
4537
4611
|
const previous = config3.profiles[profileName];
|
|
4538
4612
|
config3.profiles[profileName] = {
|
|
4539
4613
|
...previous,
|
|
@@ -4542,25 +4616,25 @@ function registerAuthCommands(kit, program2, io) {
|
|
|
4542
4616
|
...email3 ? { email: email3 } : {}
|
|
4543
4617
|
};
|
|
4544
4618
|
config3.activeProfile = profileName;
|
|
4545
|
-
return
|
|
4619
|
+
return saveConfig4(io.env, config3);
|
|
4546
4620
|
}
|
|
4547
4621
|
function activate(profileName, baseUrl) {
|
|
4548
|
-
const config3 =
|
|
4622
|
+
const config3 = loadConfig4(io.env);
|
|
4549
4623
|
config3.profiles[profileName] = { ...config3.profiles[profileName], baseUrl: normalizeUrl(baseUrl) };
|
|
4550
4624
|
config3.activeProfile = profileName;
|
|
4551
|
-
return
|
|
4625
|
+
return saveConfig4(io.env, config3);
|
|
4552
4626
|
}
|
|
4553
4627
|
async function hubLogin(opts) {
|
|
4554
4628
|
const hubConfig = loadConfig(io.env, HUB_TOOL);
|
|
4555
4629
|
const selected = selectProfile({
|
|
4556
4630
|
config: hubConfig,
|
|
4557
|
-
apiUrl: io.env[
|
|
4631
|
+
apiUrl: io.env[HUB_URL_ENV2],
|
|
4558
4632
|
cloudUrl: DEFAULT_HUB_URL
|
|
4559
4633
|
});
|
|
4560
4634
|
const profile = selected.name ?? CLOUD_PROFILE;
|
|
4561
4635
|
const hubUrl = resolveBaseUrl({
|
|
4562
4636
|
env: io.env,
|
|
4563
|
-
envVar:
|
|
4637
|
+
envVar: HUB_URL_ENV2,
|
|
4564
4638
|
profile: selected.profile,
|
|
4565
4639
|
cloudUrl: DEFAULT_HUB_URL
|
|
4566
4640
|
});
|
|
@@ -4609,8 +4683,8 @@ function registerAuthCommands(kit, program2, io) {
|
|
|
4609
4683
|
const profileName = ctx.profileName ?? CLOUD_PROFILE;
|
|
4610
4684
|
const { baseUrl } = ctx;
|
|
4611
4685
|
const saved = ctx.config.profiles[profileName];
|
|
4612
|
-
if (saved && !sameInstance(
|
|
4613
|
-
throw new CliUsageError(`Profile "${profileName}" is the instance ${
|
|
4686
|
+
if (saved && !sameInstance(profileUrl3(saved), baseUrl)) {
|
|
4687
|
+
throw new CliUsageError(`Profile "${profileName}" is the instance ${profileUrl3(saved)}, and this login targets ${baseUrl}. Drop --profile to sign in on the profile of ${baseUrl}, or drop --api-url to sign in on "${profileName}".`);
|
|
4614
4688
|
}
|
|
4615
4689
|
const pasted = globals.apiKey ?? stdinApiKey(io);
|
|
4616
4690
|
if (pasted !== void 0) {
|
|
@@ -4637,35 +4711,37 @@ ${organizationsLine(me2)}`);
|
|
|
4637
4711
|
}
|
|
4638
4712
|
const probe = await probeToolInstance(baseUrl, io.fetch);
|
|
4639
4713
|
if (probe?.cloud) {
|
|
4640
|
-
let hub =
|
|
4641
|
-
const
|
|
4642
|
-
const
|
|
4714
|
+
let hub = selectHubProfile(io.env, { cloudUrl: DEFAULT_HUB_URL });
|
|
4715
|
+
const hasKey = Boolean(hub.profile?.apiKey);
|
|
4716
|
+
const stored = hasKey ? firstSet(hub.profile?.email) : void 0;
|
|
4717
|
+
const switching = hasKey && opts.email !== void 0 && (stored === void 0 || opts.email.toLowerCase() !== stored.toLowerCase());
|
|
4643
4718
|
if (switching) {
|
|
4644
|
-
io.err.write(`Replacing the Antasphere login ${stored} with ${opts.email}.
|
|
4719
|
+
io.err.write(stored ? `Replacing the Antasphere login ${stored} with ${opts.email}.
|
|
4720
|
+
` : `Signing in as ${opts.email}: the stored Antasphere login carries no address.
|
|
4645
4721
|
`);
|
|
4646
4722
|
}
|
|
4647
4723
|
if (!hub.profile?.apiKey || switching)
|
|
4648
4724
|
await hubLogin(opts);
|
|
4649
|
-
hub =
|
|
4650
|
-
const stale = hub.name ?
|
|
4725
|
+
hub = selectHubProfile(io.env, { cloudUrl: DEFAULT_HUB_URL });
|
|
4726
|
+
const stale = hub.name ? loadConfig4(io.env).profiles[profileName]?.connectKeys?.[hub.name] : void 0;
|
|
4651
4727
|
if (stale && hub.name) {
|
|
4652
4728
|
const auth = new CliAuthClient({
|
|
4653
|
-
baseUrl:
|
|
4729
|
+
baseUrl: profileUrl3(loadConfig4(io.env).profiles[profileName]),
|
|
4654
4730
|
...io.fetch ? { fetch: io.fetch } : {}
|
|
4655
4731
|
});
|
|
4656
4732
|
await auth.revoke(stale.apiKey).catch(() => void 0);
|
|
4657
|
-
|
|
4733
|
+
removeConnectKey3(io.env, profileName, hub.name);
|
|
4658
4734
|
}
|
|
4659
4735
|
let outcome;
|
|
4660
4736
|
try {
|
|
4661
|
-
outcome = await
|
|
4737
|
+
outcome = await connect(ctx, { profileName, cached: false });
|
|
4662
4738
|
} catch (e) {
|
|
4663
4739
|
if (!(e instanceof CliUsageError) || !/rejected/.test(e.message))
|
|
4664
4740
|
throw e;
|
|
4665
4741
|
io.err.write("The stored Antasphere login was rejected: signing in again.\n");
|
|
4666
4742
|
await hubLogin(opts);
|
|
4667
|
-
hub =
|
|
4668
|
-
outcome = await
|
|
4743
|
+
hub = selectHubProfile(io.env, { cloudUrl: DEFAULT_HUB_URL });
|
|
4744
|
+
outcome = await connect(ctx, { profileName, cached: false });
|
|
4669
4745
|
}
|
|
4670
4746
|
if (outcome.outcome === "not_cloud") {
|
|
4671
4747
|
throw new CliUsageError(`${baseUrl} stopped answering as an Antasphere-cloud instance; try again.`);
|
|
@@ -4709,11 +4785,11 @@ API key "${minted.keyName}" (${redactKey(minted.key)}) saved to profile "${profi
|
|
|
4709
4785
|
${organizationsLine(me)}`);
|
|
4710
4786
|
});
|
|
4711
4787
|
async function hubLogout() {
|
|
4712
|
-
const hub =
|
|
4788
|
+
const hub = selectHubProfile(io.env, { cloudUrl: DEFAULT_HUB_URL });
|
|
4713
4789
|
if (!hub.name || !hub.profile?.apiKey)
|
|
4714
4790
|
return null;
|
|
4715
4791
|
const auth = new CliAuthClient({
|
|
4716
|
-
baseUrl:
|
|
4792
|
+
baseUrl: hub.profile.baseUrl?.trim() || DEFAULT_HUB_URL,
|
|
4717
4793
|
...io.fetch ? { fetch: io.fetch } : {}
|
|
4718
4794
|
});
|
|
4719
4795
|
let revoked = false;
|
|
@@ -4737,7 +4813,7 @@ ${organizationsLine(me)}`);
|
|
|
4737
4813
|
const ctx = resolveContext2(cmd, io);
|
|
4738
4814
|
const profileName = ctx.profileName;
|
|
4739
4815
|
const profile = profileName ? ctx.config.profiles[profileName] : void 0;
|
|
4740
|
-
const hubLogin2 =
|
|
4816
|
+
const hubLogin2 = selectHubProfile(io.env, { cloudUrl: DEFAULT_HUB_URL }).profile;
|
|
4741
4817
|
if (!profileName || !profile) {
|
|
4742
4818
|
if (hubLogin2?.apiKey) {
|
|
4743
4819
|
if (opts.all) {
|
|
@@ -4752,7 +4828,7 @@ ${organizationsLine(me)}`);
|
|
|
4752
4828
|
}
|
|
4753
4829
|
throw new CliUsageError("No profile to log out of.");
|
|
4754
4830
|
}
|
|
4755
|
-
const baseUrl =
|
|
4831
|
+
const baseUrl = profileUrl3(profile);
|
|
4756
4832
|
const auth = new CliAuthClient({ baseUrl, ...io.fetch ? { fetch: io.fetch } : {} });
|
|
4757
4833
|
let revoked = 0;
|
|
4758
4834
|
let refused = 0;
|
|
@@ -4776,16 +4852,16 @@ ${organizationsLine(me)}`);
|
|
|
4776
4852
|
const slots = Object.entries(profile.connectKeys ?? {});
|
|
4777
4853
|
for (const [slot, entry] of slots) {
|
|
4778
4854
|
await revoke(entry.apiKey, `the key of the Antasphere login "${slot}"`);
|
|
4779
|
-
|
|
4855
|
+
removeConnectKey3(io.env, profileName, slot);
|
|
4780
4856
|
}
|
|
4781
4857
|
if (profile.apiKey)
|
|
4782
4858
|
await revoke(profile.apiKey, "the profile key");
|
|
4783
|
-
const config3 =
|
|
4859
|
+
const config3 = loadConfig4(io.env);
|
|
4784
4860
|
const current = config3.profiles[profileName];
|
|
4785
4861
|
if (current) {
|
|
4786
4862
|
delete current.apiKey;
|
|
4787
4863
|
delete current.email;
|
|
4788
|
-
|
|
4864
|
+
saveConfig4(io.env, config3);
|
|
4789
4865
|
}
|
|
4790
4866
|
const ended = opts.all ? await hubLogout() : null;
|
|
4791
4867
|
if (globals.json) {
|
|
@@ -4813,7 +4889,7 @@ ${organizationsLine(me)}`);
|
|
|
4813
4889
|
await requireApiKey2(ctx);
|
|
4814
4890
|
const me = await ctx.client.me();
|
|
4815
4891
|
const source = workspaceSource(ctx);
|
|
4816
|
-
const hub =
|
|
4892
|
+
const hub = selectHubProfile(io.env, { cloudUrl: DEFAULT_HUB_URL });
|
|
4817
4893
|
const hubLine = hubLoginLine(ctx, hub.profile);
|
|
4818
4894
|
if (ctx.json) {
|
|
4819
4895
|
return printJson2(io, {
|
|
@@ -4861,7 +4937,7 @@ ${organizationsLine(me)}`);
|
|
|
4861
4937
|
});
|
|
4862
4938
|
program2.command("use <profile>").description("Switch the active profile (the instance the commands run against)").action(async (name, _opts, cmd) => {
|
|
4863
4939
|
const globals = cmd.optsWithGlobals();
|
|
4864
|
-
const config3 =
|
|
4940
|
+
const config3 = loadConfig4(io.env);
|
|
4865
4941
|
if (!config3.profiles[name]) {
|
|
4866
4942
|
if (name !== CLOUD_PROFILE) {
|
|
4867
4943
|
throw new CliUsageError(`Unknown profile "${name}" \u2014 run \`${identity.bin} profiles\`.`);
|
|
@@ -4869,16 +4945,16 @@ ${organizationsLine(me)}`);
|
|
|
4869
4945
|
config3.profiles[name] = { baseUrl: normalizeUrl(identity.cloudUrl) };
|
|
4870
4946
|
}
|
|
4871
4947
|
config3.activeProfile = name;
|
|
4872
|
-
|
|
4948
|
+
saveConfig4(io.env, config3);
|
|
4873
4949
|
if (globals.json)
|
|
4874
4950
|
return printJson2(io, { activeProfile: name });
|
|
4875
|
-
io.out.write(`Active profile: ${name} (${
|
|
4951
|
+
io.out.write(`Active profile: ${name} (${profileUrl3(config3.profiles[name])})
|
|
4876
4952
|
`);
|
|
4877
4953
|
});
|
|
4878
4954
|
program2.command("profiles").description("List the profiles (one per instance) and how each signs in").action(async (_opts, cmd) => {
|
|
4879
4955
|
const globals = cmd.optsWithGlobals();
|
|
4880
|
-
const config3 =
|
|
4881
|
-
const hub =
|
|
4956
|
+
const config3 = loadConfig4(io.env);
|
|
4957
|
+
const hub = selectHubProfile(io.env, { cloudUrl: DEFAULT_HUB_URL });
|
|
4882
4958
|
const rows = Object.entries(config3.profiles);
|
|
4883
4959
|
if (!config3.profiles[CLOUD_PROFILE])
|
|
4884
4960
|
rows.unshift([CLOUD_PROFILE, { baseUrl: normalizeUrl(identity.cloudUrl) }]);
|
|
@@ -4890,8 +4966,9 @@ ${organizationsLine(me)}`);
|
|
|
4890
4966
|
if (entry)
|
|
4891
4967
|
return { kind: "hub", text: `via Antasphere${entry.email ? ` (${entry.email})` : ""}` };
|
|
4892
4968
|
const others = Object.keys(p.connectKeys ?? {});
|
|
4969
|
+
const chosen = firstSet(io.env[HUB_URL_ENV2]) ? "not the one ANTASPHERE_URL names" : "not the active one";
|
|
4893
4970
|
if (others.length > 0)
|
|
4894
|
-
return { kind: "hub", text: `via Antasphere (login "${others.join('", "')}",
|
|
4971
|
+
return { kind: "hub", text: `via Antasphere (login "${others.join('", "')}", ${chosen})` };
|
|
4895
4972
|
return { kind: "none", text: "(not signed in)" };
|
|
4896
4973
|
};
|
|
4897
4974
|
if (globals.json) {
|
|
@@ -4903,7 +4980,7 @@ ${organizationsLine(me)}`);
|
|
|
4903
4980
|
return [
|
|
4904
4981
|
n,
|
|
4905
4982
|
{
|
|
4906
|
-
baseUrl:
|
|
4983
|
+
baseUrl: profileUrl3(p),
|
|
4907
4984
|
saved: Boolean(config3.profiles[n]),
|
|
4908
4985
|
credential: cred.kind,
|
|
4909
4986
|
apiKey: p.apiKey ? redactKey(p.apiKey) : null,
|
|
@@ -4914,20 +4991,20 @@ ${organizationsLine(me)}`);
|
|
|
4914
4991
|
}))
|
|
4915
4992
|
});
|
|
4916
4993
|
}
|
|
4917
|
-
io.out.write(table(rows.map(([n, p]) => [activeName === n ? "*" : " ", n,
|
|
4994
|
+
io.out.write(table(rows.map(([n, p]) => [activeName === n ? "*" : " ", n, profileUrl3(p), credentialOf(p).text])));
|
|
4918
4995
|
});
|
|
4919
4996
|
const config2 = program2.command("config").description("Inspect or reset the CLI config file");
|
|
4920
4997
|
config2.command("show").description("Show the config path, active profile, and redacted keys").action(async (_opts, cmd) => {
|
|
4921
4998
|
const globals = cmd.optsWithGlobals();
|
|
4922
|
-
const cfg =
|
|
4923
|
-
const path =
|
|
4999
|
+
const cfg = loadConfig4(io.env);
|
|
5000
|
+
const path = configPath3(io.env);
|
|
4924
5001
|
const redacted = {
|
|
4925
5002
|
path,
|
|
4926
5003
|
activeProfile: cfg.activeProfile ?? null,
|
|
4927
5004
|
profiles: Object.fromEntries(Object.entries(cfg.profiles).map(([n, p]) => [
|
|
4928
5005
|
n,
|
|
4929
5006
|
{
|
|
4930
|
-
baseUrl:
|
|
5007
|
+
baseUrl: profileUrl3(p),
|
|
4931
5008
|
apiKey: p.apiKey ? redactKey(p.apiKey) : null,
|
|
4932
5009
|
email: p.email ?? null,
|
|
4933
5010
|
// Hub-connected keys (one per hub profile), redacted like the rest.
|
|
@@ -4944,14 +5021,14 @@ ${organizationsLine(me)}`);
|
|
|
4944
5021
|
});
|
|
4945
5022
|
config2.command("clear").description("Delete the config file (all profiles and stored keys)").action(async (_opts, cmd) => {
|
|
4946
5023
|
const globals = cmd.optsWithGlobals();
|
|
4947
|
-
|
|
5024
|
+
clearConfig3(io.env);
|
|
4948
5025
|
if (globals.json)
|
|
4949
5026
|
return printJson2(io, { cleared: true });
|
|
4950
5027
|
io.out.write("Config cleared.\n");
|
|
4951
5028
|
});
|
|
4952
5029
|
}
|
|
4953
5030
|
|
|
4954
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
5031
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/workspaces.js
|
|
4955
5032
|
function registerWorkspaceCommands(kit, program2, io) {
|
|
4956
5033
|
const { requireApiKey: requireApiKey2, resolveContext: resolveContext2, workspaceSource } = kit;
|
|
4957
5034
|
const { describeSelection } = kit.workspace;
|
|
@@ -5023,7 +5100,7 @@ function registerWorkspaceCommands(kit, program2, io) {
|
|
|
5023
5100
|
});
|
|
5024
5101
|
}
|
|
5025
5102
|
|
|
5026
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
5103
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/teams.js
|
|
5027
5104
|
function explainTeamRefusal(e, ctx) {
|
|
5028
5105
|
switch (e.code) {
|
|
5029
5106
|
case "forbidden":
|
|
@@ -5227,7 +5304,7 @@ ${teamLines(team)}`);
|
|
|
5227
5304
|
});
|
|
5228
5305
|
}
|
|
5229
5306
|
|
|
5230
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
5307
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/projects.js
|
|
5231
5308
|
var ROLES = ["viewer", "editor", "manager"];
|
|
5232
5309
|
function parseRole(value) {
|
|
5233
5310
|
if (ROLES.includes(value))
|
|
@@ -20016,7 +20093,7 @@ function date4(params) {
|
|
|
20016
20093
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
20017
20094
|
config(en_default());
|
|
20018
20095
|
|
|
20019
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
20096
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/common.js
|
|
20020
20097
|
var apiErrorSchema = external_exports.object({
|
|
20021
20098
|
error: external_exports.object({
|
|
20022
20099
|
code: external_exports.string(),
|
|
@@ -20121,12 +20198,12 @@ function isValidMediaType(value) {
|
|
|
20121
20198
|
return value.length >= 1 && value.length <= 255 && isLatin1(value) && MEDIA_TYPE_RE.test(value);
|
|
20122
20199
|
}
|
|
20123
20200
|
|
|
20124
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
20201
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/scope.js
|
|
20125
20202
|
function defineScopeSchema(scopes) {
|
|
20126
20203
|
return external_exports.enum(scopes);
|
|
20127
20204
|
}
|
|
20128
20205
|
|
|
20129
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
20206
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/seams.js
|
|
20130
20207
|
var KNOWN_AUTH_METHODS = [
|
|
20131
20208
|
"password",
|
|
20132
20209
|
"email-otp",
|
|
@@ -21710,7 +21787,7 @@ var HUB_TOOL_WIRE_INPUTS = {
|
|
|
21710
21787
|
}
|
|
21711
21788
|
};
|
|
21712
21789
|
|
|
21713
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
21790
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/entitlements.js
|
|
21714
21791
|
var entitlementTierSchema = billingPlanSchema;
|
|
21715
21792
|
var entitlementActionSchema = external_exports.object({
|
|
21716
21793
|
key: external_exports.string().min(1),
|
|
@@ -21744,7 +21821,7 @@ var entitlementProfileSchema = external_exports.object({
|
|
|
21744
21821
|
upgradeUrl: external_exports.string()
|
|
21745
21822
|
});
|
|
21746
21823
|
|
|
21747
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
21824
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/instance.js
|
|
21748
21825
|
var instanceInfoSchema2 = external_exports.object({
|
|
21749
21826
|
name: external_exports.string(),
|
|
21750
21827
|
instanceId: external_exports.string().nullable(),
|
|
@@ -21794,6 +21871,14 @@ var instanceInfoSchema2 = external_exports.object({
|
|
|
21794
21871
|
* false, so the self-hosted discovery bytes are unchanged.
|
|
21795
21872
|
*/
|
|
21796
21873
|
restricted: external_exports.boolean().optional(),
|
|
21874
|
+
/**
|
|
21875
|
+
* The tool's own CLI package (cloud edition, PRDCT-3312): present only when
|
|
21876
|
+
* the instance was released with it (`CLI_PACKAGE_DIR`), naming the npm
|
|
21877
|
+
* package `POST /cli/package` serves and its version. The `team` command
|
|
21878
|
+
* reads it to know what it installs and whether to update. ABSENT
|
|
21879
|
+
* otherwise, so older discovery bytes are unchanged.
|
|
21880
|
+
*/
|
|
21881
|
+
cli: external_exports.object({ name: external_exports.string(), version: external_exports.string() }).optional(),
|
|
21797
21882
|
/**
|
|
21798
21883
|
* What this version of the tool declares for the billing rail (its priced
|
|
21799
21884
|
* actions with their default credits, its limits and features per tier):
|
|
@@ -21805,7 +21890,7 @@ var instanceInfoSchema2 = external_exports.object({
|
|
|
21805
21890
|
entitlements: toolEntitlementsSchema.optional()
|
|
21806
21891
|
});
|
|
21807
21892
|
|
|
21808
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
21893
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/setup.js
|
|
21809
21894
|
var setupRequestSchema2 = external_exports.object({
|
|
21810
21895
|
instanceName: plainText(1, 120),
|
|
21811
21896
|
owner: external_exports.object({
|
|
@@ -21822,7 +21907,7 @@ var setupResponseSchema2 = external_exports.object({
|
|
|
21822
21907
|
ownerUserId: external_exports.string()
|
|
21823
21908
|
});
|
|
21824
21909
|
|
|
21825
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
21910
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/workspaces.js
|
|
21826
21911
|
var lookKey2 = external_exports.string().regex(/^[a-z][a-z0-9-]{0,31}$/, "a short lowercase key").nullable();
|
|
21827
21912
|
var lookLevel2 = external_exports.number().min(0).max(1).nullable();
|
|
21828
21913
|
var workspaceLookSchema2 = external_exports.object({
|
|
@@ -21862,7 +21947,7 @@ var workspaceUpdatedSchema2 = external_exports.object({
|
|
|
21862
21947
|
})
|
|
21863
21948
|
});
|
|
21864
21949
|
|
|
21865
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
21950
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/me.js
|
|
21866
21951
|
var onboardingDismissedSchema = external_exports.object({
|
|
21867
21952
|
dismissed: external_exports.literal(true)
|
|
21868
21953
|
});
|
|
@@ -22014,7 +22099,7 @@ function defineMeSchemas(scopeSchema3) {
|
|
|
22014
22099
|
return { meResponseSchema: meResponseSchema3 };
|
|
22015
22100
|
}
|
|
22016
22101
|
|
|
22017
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22102
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/members.js
|
|
22018
22103
|
var memberSchema2 = external_exports.object({
|
|
22019
22104
|
id: external_exports.string(),
|
|
22020
22105
|
userId: external_exports.string(),
|
|
@@ -22048,7 +22133,7 @@ var memberChangeEmailLinkSchema2 = external_exports.object({
|
|
|
22048
22133
|
expiresAt: external_exports.string()
|
|
22049
22134
|
});
|
|
22050
22135
|
|
|
22051
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22136
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/cli-auth.js
|
|
22052
22137
|
var cliAuthRequestSchema2 = external_exports.object({
|
|
22053
22138
|
email: external_exports.email()
|
|
22054
22139
|
});
|
|
@@ -22090,7 +22175,7 @@ function defineCliAuthSchemas(apiKeySchema3) {
|
|
|
22090
22175
|
return { cliAuthCompletedSchema: cliAuthCompletedSchema3 };
|
|
22091
22176
|
}
|
|
22092
22177
|
|
|
22093
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22178
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/sso-connect.js
|
|
22094
22179
|
var ssoCliConnectSchema = external_exports.object({
|
|
22095
22180
|
/** The hub-minted exchange JWT (compact JWS — three base64url segments). */
|
|
22096
22181
|
token: external_exports.string().min(20).max(4096),
|
|
@@ -22105,12 +22190,18 @@ var ssoCliConnectSchema = external_exports.object({
|
|
|
22105
22190
|
hubRefreshToken: external_exports.string().min(20).max(512).optional()
|
|
22106
22191
|
});
|
|
22107
22192
|
|
|
22108
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22193
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/cli-package.js
|
|
22194
|
+
var cliPackageRequestSchema = external_exports.object({
|
|
22195
|
+
/** The hub-minted exchange JWT (compact JWS — three base64url segments). */
|
|
22196
|
+
token: external_exports.string().min(1)
|
|
22197
|
+
});
|
|
22198
|
+
|
|
22199
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/sso-logout.js
|
|
22109
22200
|
var ssoLogoutResponseSchema = external_exports.object({
|
|
22110
22201
|
url: external_exports.string().nullable()
|
|
22111
22202
|
});
|
|
22112
22203
|
|
|
22113
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22204
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/invitations.js
|
|
22114
22205
|
var invitationSchema2 = external_exports.object({
|
|
22115
22206
|
id: external_exports.string(),
|
|
22116
22207
|
email: external_exports.string(),
|
|
@@ -22152,7 +22243,7 @@ var invitationAcceptedSchema2 = external_exports.object({
|
|
|
22152
22243
|
role: workspaceRoleSchema
|
|
22153
22244
|
});
|
|
22154
22245
|
|
|
22155
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22246
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/audit.js
|
|
22156
22247
|
var auditEntrySchema2 = external_exports.object({
|
|
22157
22248
|
id: external_exports.number(),
|
|
22158
22249
|
actorUserId: external_exports.string().nullable(),
|
|
@@ -22197,7 +22288,7 @@ var auditListSchema2 = external_exports.object({
|
|
|
22197
22288
|
total: external_exports.number().int().nullable()
|
|
22198
22289
|
});
|
|
22199
22290
|
|
|
22200
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22291
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/break-glass.js
|
|
22201
22292
|
var breakGlassClaimOwnershipRequestSchema2 = external_exports.object({
|
|
22202
22293
|
userId: external_exports.string().min(1).optional(),
|
|
22203
22294
|
workspaceId: external_exports.uuid().optional()
|
|
@@ -22222,7 +22313,7 @@ var breakGlassResetTwoFactorSchema2 = external_exports.object({
|
|
|
22222
22313
|
hadTwoFactor: external_exports.boolean()
|
|
22223
22314
|
});
|
|
22224
22315
|
|
|
22225
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22316
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/files.js
|
|
22226
22317
|
var fileSchema2 = external_exports.object({
|
|
22227
22318
|
id: external_exports.string(),
|
|
22228
22319
|
sha256: external_exports.string(),
|
|
@@ -22247,7 +22338,7 @@ var fileUploadQuerySchema2 = external_exports.object({
|
|
|
22247
22338
|
name: plainText(1, 255)
|
|
22248
22339
|
});
|
|
22249
22340
|
|
|
22250
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22341
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/projects.js
|
|
22251
22342
|
var projectRoleSchema = external_exports.enum(["manager", "editor", "viewer"]);
|
|
22252
22343
|
var PROJECT_METADATA_MAX_LENGTH = 16 * 1024;
|
|
22253
22344
|
var projectMetadataSchema = opaqueJsonChecks(external_exports.record(external_exports.string(), external_exports.unknown())).refine((v) => JSON.stringify(v).length <= PROJECT_METADATA_MAX_LENGTH, `metadata must serialize to at most ${PROJECT_METADATA_MAX_LENGTH} characters`);
|
|
@@ -22335,7 +22426,7 @@ var projectMemberParamsSchema = external_exports.object({
|
|
|
22335
22426
|
});
|
|
22336
22427
|
var projectTeamParamsSchema = external_exports.object({ id: external_exports.uuid(), teamId: external_exports.uuid() });
|
|
22337
22428
|
|
|
22338
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22429
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/teams.js
|
|
22339
22430
|
var teamSlugSchema2 = external_exports.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "lowercase letters and digits, joined by single dashes").min(1).max(60);
|
|
22340
22431
|
var teamSchema2 = external_exports.object({
|
|
22341
22432
|
id: external_exports.string(),
|
|
@@ -22389,7 +22480,7 @@ var teamMemberParamsSchema = external_exports.object({
|
|
|
22389
22480
|
userId: noControlChars(external_exports.string().min(1).max(200))
|
|
22390
22481
|
});
|
|
22391
22482
|
|
|
22392
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22483
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/demo-passes.js
|
|
22393
22484
|
var DEMO_PASS_MAX_MINUTES2 = 10080;
|
|
22394
22485
|
var demoPassSchema2 = external_exports.object({
|
|
22395
22486
|
id: external_exports.string(),
|
|
@@ -22430,7 +22521,7 @@ var demoPassRedeemedSchema2 = external_exports.object({
|
|
|
22430
22521
|
expiresAt: external_exports.string()
|
|
22431
22522
|
});
|
|
22432
22523
|
|
|
22433
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22524
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/schemas/api-keys.js
|
|
22434
22525
|
function defineApiKeySchemas(scopeSchema3) {
|
|
22435
22526
|
const apiKeySchema3 = external_exports.object({
|
|
22436
22527
|
id: external_exports.string(),
|
|
@@ -22475,7 +22566,7 @@ function defineApiKeySchemas(scopeSchema3) {
|
|
|
22475
22566
|
return { apiKeySchema: apiKeySchema3, apiKeysListSchema: apiKeysListSchema3, apiKeyCreateSchema: apiKeyCreateSchema3, apiKeyCreatedSchema: apiKeyCreatedSchema3 };
|
|
22476
22567
|
}
|
|
22477
22568
|
|
|
22478
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.
|
|
22569
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-contract@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-contract/dist/define.js
|
|
22479
22570
|
function defineChassisContract(tool) {
|
|
22480
22571
|
return buildChassisContract(defineScopeSchema(tool.scopes));
|
|
22481
22572
|
}
|
|
@@ -22489,7 +22580,7 @@ function buildChassisContract(scopeSchema3) {
|
|
|
22489
22580
|
};
|
|
22490
22581
|
}
|
|
22491
22582
|
|
|
22492
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
22583
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/owner-session.js
|
|
22493
22584
|
var SIGN_IN_WAITS_MS = [4e3, 8e3, 12e3];
|
|
22494
22585
|
var SESSION_COOKIE = /session_token$/;
|
|
22495
22586
|
function sessionCookie(res) {
|
|
@@ -22570,7 +22661,7 @@ async function withOwnerSession(ctx, options, run2) {
|
|
|
22570
22661
|
}
|
|
22571
22662
|
}
|
|
22572
22663
|
|
|
22573
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
22664
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/demo.js
|
|
22574
22665
|
var SWITCH_OFF = "Demo sign-in is off on this instance (DEMO_SIGN_IN), or this is the cloud edition, where demo links are minted at the Antasphere hub.";
|
|
22575
22666
|
var NOT_AN_OWNER = "Only an owner of this workspace manages demo links: the account that signed in is not one.";
|
|
22576
22667
|
var REFUSALS = /* @__PURE__ */ new Set([
|
|
@@ -22724,14 +22815,14 @@ function registerDemoCommands(kit, program2, io) {
|
|
|
22724
22815
|
});
|
|
22725
22816
|
}
|
|
22726
22817
|
|
|
22727
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
22818
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/files.js
|
|
22728
22819
|
import { createWriteStream } from "node:fs";
|
|
22729
22820
|
import { mkdir as mkdir2, readFile, writeFile } from "node:fs/promises";
|
|
22730
22821
|
import { basename, resolve as resolve2, win32 } from "node:path";
|
|
22731
22822
|
import { Readable } from "node:stream";
|
|
22732
22823
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
22733
22824
|
|
|
22734
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
22825
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/safe-write.js
|
|
22735
22826
|
import { constants as FS } from "node:fs";
|
|
22736
22827
|
import { mkdir, open, realpath, unlink } from "node:fs/promises";
|
|
22737
22828
|
import { dirname as dirname2, isAbsolute, relative, resolve } from "node:path";
|
|
@@ -22812,7 +22903,7 @@ async function streamContained(root, relPath, source) {
|
|
|
22812
22903
|
}
|
|
22813
22904
|
}
|
|
22814
22905
|
|
|
22815
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
22906
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/files.js
|
|
22816
22907
|
function safeDownloadName(originalName) {
|
|
22817
22908
|
const name = basename(win32.basename(originalName));
|
|
22818
22909
|
if (name === "" || name === "." || name === ".." || name.startsWith(".")) {
|
|
@@ -22939,7 +23030,7 @@ function registerFileCommands(kit, program2, io) {
|
|
|
22939
23030
|
});
|
|
22940
23031
|
}
|
|
22941
23032
|
|
|
22942
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
23033
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/commands/completion.js
|
|
22943
23034
|
function commandTree(program2) {
|
|
22944
23035
|
return program2.commands.filter((c) => !c.name().startsWith("help")).map((c) => ({
|
|
22945
23036
|
name: c.name(),
|
|
@@ -23014,7 +23105,7 @@ function registerCompletionCommand(identity, program2, io) {
|
|
|
23014
23105
|
});
|
|
23015
23106
|
}
|
|
23016
23107
|
|
|
23017
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
23108
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/program.js
|
|
23018
23109
|
function creditFigures(credit) {
|
|
23019
23110
|
const parts = [
|
|
23020
23111
|
typeof credit?.credits === "number" ? `this needs ${credit.credits} credits` : null,
|
|
@@ -23096,21 +23187,7 @@ function createProgram(kit, definition) {
|
|
|
23096
23187
|
return { buildProgram, run: run2 };
|
|
23097
23188
|
}
|
|
23098
23189
|
|
|
23099
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
23100
|
-
function cliIdentity(identity) {
|
|
23101
|
-
return {
|
|
23102
|
-
bin: identity.cli.bin,
|
|
23103
|
-
tool: identity.slug,
|
|
23104
|
-
legacyConfigDir: identity.cli.legacyConfigDir,
|
|
23105
|
-
displayName: identity.displayName,
|
|
23106
|
-
envPrefix: identity.cli.envPrefix,
|
|
23107
|
-
keyPrefix: identity.apiKeyPrefix,
|
|
23108
|
-
exportScope: identity.scopes.dataExport,
|
|
23109
|
-
cloudUrl: identity.cloud.url
|
|
23110
|
-
};
|
|
23111
|
-
}
|
|
23112
|
-
|
|
23113
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.0.2_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/open.js
|
|
23190
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/open.js
|
|
23114
23191
|
import { spawn } from "node:child_process";
|
|
23115
23192
|
function platformOpener(platform = process.platform) {
|
|
23116
23193
|
if (platform === "darwin")
|
|
@@ -23136,7 +23213,7 @@ function isInteractive(io) {
|
|
|
23136
23213
|
return io.out.isTTY === true;
|
|
23137
23214
|
}
|
|
23138
23215
|
|
|
23139
|
-
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.
|
|
23216
|
+
// ../../node_modules/.pnpm/@antasphere+chassis-cli@1.1.0_hono@4.12.27/node_modules/@antasphere/chassis-cli/dist/index.js
|
|
23140
23217
|
function defineCli(definition) {
|
|
23141
23218
|
const { identity, createClient } = definition;
|
|
23142
23219
|
const config2 = createConfig(identity);
|
|
@@ -23881,6 +23958,33 @@ var formResponsesSummarySchema = external_exports.object({
|
|
|
23881
23958
|
total: external_exports.number().int()
|
|
23882
23959
|
});
|
|
23883
23960
|
|
|
23961
|
+
// ../contract/dist/schemas/apps.js
|
|
23962
|
+
var appEntrySchema = external_exports.object({
|
|
23963
|
+
/** The tool's registry slug (`finance`, `hiring`, …): what picks its drawing and its sentence. */
|
|
23964
|
+
slug: external_exports.string(),
|
|
23965
|
+
/** The tool's display name. */
|
|
23966
|
+
name: external_exports.string(),
|
|
23967
|
+
/** Where opening the tool lands. */
|
|
23968
|
+
launchUrl: external_exports.string(),
|
|
23969
|
+
/** The operator's own sentence for the tool (the file source), else null. */
|
|
23970
|
+
description: external_exports.string().nullable(),
|
|
23971
|
+
/** The person has signed in to the tool (the hub source); false when nothing says so. */
|
|
23972
|
+
connected: external_exports.boolean(),
|
|
23973
|
+
/** When the person first signed in to the tool (the hub source), else null. */
|
|
23974
|
+
firstUsedAt: external_exports.string().nullable(),
|
|
23975
|
+
/** When the person last signed in to the tool (the hub source), else null. */
|
|
23976
|
+
lastUsedAt: external_exports.string().nullable(),
|
|
23977
|
+
/** This very tool: the page shows it, with no button. */
|
|
23978
|
+
current: external_exports.boolean()
|
|
23979
|
+
});
|
|
23980
|
+
var APP_SOURCES = ["hub", "file", "none"];
|
|
23981
|
+
var appsListSchema = external_exports.object({
|
|
23982
|
+
apps: external_exports.array(appEntrySchema),
|
|
23983
|
+
/** The account that signs the person in (the hub), when the instance knows one. */
|
|
23984
|
+
hub: external_exports.object({ url: external_exports.string(), name: external_exports.string() }).nullable(),
|
|
23985
|
+
source: external_exports.enum(APP_SOURCES)
|
|
23986
|
+
});
|
|
23987
|
+
|
|
23884
23988
|
// ../contract/dist/embed.js
|
|
23885
23989
|
var EMBED_PLACEMENT_RE = /^[A-Za-z0-9._-]{1,64}$/;
|
|
23886
23990
|
function buildEmbedSnippets(opts) {
|
|
@@ -24329,6 +24433,13 @@ var PlatformClient = class extends ChassisClient {
|
|
|
24329
24433
|
deleteFormResponse(id, responseId) {
|
|
24330
24434
|
return this.request("DELETE", `/presentations/${encodeURIComponent(id)}/responses/${encodeURIComponent(responseId)}`);
|
|
24331
24435
|
}
|
|
24436
|
+
// ── Apps ──────────────────────────────────────────────────────────────────
|
|
24437
|
+
// The other tools of the organization: a browser session's alone (an API key
|
|
24438
|
+
// or an OAuth token is refused 403). `me()` is the chassis client's.
|
|
24439
|
+
/** The tools the caller may open, the account that signs them in, and where the list came from. */
|
|
24440
|
+
apps() {
|
|
24441
|
+
return this.request("GET", "/apps");
|
|
24442
|
+
}
|
|
24332
24443
|
};
|
|
24333
24444
|
|
|
24334
24445
|
// src/cli.ts
|
|
@@ -24348,6 +24459,16 @@ var requireApiKey = cli.requireApiKey;
|
|
|
24348
24459
|
import { readFile as readFile3, stat as stat2 } from "node:fs/promises";
|
|
24349
24460
|
import { join as join4 } from "node:path";
|
|
24350
24461
|
|
|
24462
|
+
// ../../node_modules/.pnpm/@antasphere+cli-core@0.5.0/node_modules/@antasphere/cli-core/dist/resolve.js
|
|
24463
|
+
var CliUsageError2 = class extends Error {
|
|
24464
|
+
exitCode;
|
|
24465
|
+
constructor(message, opts = {}) {
|
|
24466
|
+
super(message);
|
|
24467
|
+
this.name = "CliUsageError";
|
|
24468
|
+
this.exitCode = opts.exitCode ?? 1;
|
|
24469
|
+
}
|
|
24470
|
+
};
|
|
24471
|
+
|
|
24351
24472
|
// src/manifest.ts
|
|
24352
24473
|
import { createHash } from "node:crypto";
|
|
24353
24474
|
import { createReadStream } from "node:fs";
|
|
@@ -24603,7 +24724,7 @@ function isReferenceType(value) {
|
|
|
24603
24724
|
function parseReferenceType(value) {
|
|
24604
24725
|
const wanted = value.trim().toLowerCase();
|
|
24605
24726
|
if (isReferenceType(wanted)) return wanted;
|
|
24606
|
-
throw new
|
|
24727
|
+
throw new CliUsageError2(`--type must be one of ${REFERENCE_TYPES.join(", ")} (got "${value}")`);
|
|
24607
24728
|
}
|
|
24608
24729
|
var OPEN_FENCE = /^---[ \t]*$/;
|
|
24609
24730
|
var CLOSE_FENCE = /^(?:---|\.\.\.)[ \t]*$/;
|
|
@@ -24685,7 +24806,7 @@ function referenceLines(refs) {
|
|
|
24685
24806
|
}
|
|
24686
24807
|
function resolveReference(candidates, value, what) {
|
|
24687
24808
|
const wanted = value.trim();
|
|
24688
|
-
if (!wanted) throw new
|
|
24809
|
+
if (!wanted) throw new CliUsageError2(`Name a ${what}: its id, its title, or the start of its title.`);
|
|
24689
24810
|
if (isDeckId(wanted)) {
|
|
24690
24811
|
const byId = candidates.find((r) => r.id.toLowerCase() === wanted.toLowerCase());
|
|
24691
24812
|
if (byId) return byId;
|
|
@@ -24697,13 +24818,13 @@ function resolveReference(candidates, value, what) {
|
|
|
24697
24818
|
const prefixed = candidates.filter((r) => r.title.trim().toLowerCase().startsWith(lower));
|
|
24698
24819
|
if (prefixed.length === 1) return prefixed[0];
|
|
24699
24820
|
if (prefixed.length > 1) throw ambiguous(prefixed, wanted, what);
|
|
24700
|
-
throw new
|
|
24821
|
+
throw new CliUsageError2(
|
|
24701
24822
|
`No ${what} named "${wanted}" among the ones you can read` + (candidates.length > 0 ? `. Yours:
|
|
24702
24823
|
${referenceLines(candidates)}` : ` (there are none).`)
|
|
24703
24824
|
);
|
|
24704
24825
|
}
|
|
24705
24826
|
function ambiguous(matches, wanted, what) {
|
|
24706
|
-
return new
|
|
24827
|
+
return new CliUsageError2(
|
|
24707
24828
|
`"${wanted}" names several ${what}s. Name one by its id:
|
|
24708
24829
|
${referenceLines(matches)}`
|
|
24709
24830
|
);
|
|
@@ -24712,7 +24833,7 @@ function splitRefAtVersion(value) {
|
|
|
24712
24833
|
const m = value.match(/^(.*)@(\d+)$/);
|
|
24713
24834
|
if (!m) return { ref: value, version: void 0 };
|
|
24714
24835
|
const version2 = Number(m[2]);
|
|
24715
|
-
if (version2 < 1) throw new
|
|
24836
|
+
if (version2 < 1) throw new CliUsageError2(`"${value}": a version is a whole number from 1.`);
|
|
24716
24837
|
return { ref: m[1], version: version2 };
|
|
24717
24838
|
}
|
|
24718
24839
|
var PROVENANCE_KEY = "references";
|
|
@@ -27419,7 +27540,7 @@ async function zipMode(ctx, io, id, responseId, filters, zip) {
|
|
|
27419
27540
|
}
|
|
27420
27541
|
|
|
27421
27542
|
// src/index.ts
|
|
27422
|
-
var VERSION = "0.13.
|
|
27543
|
+
var VERSION = "0.13.8";
|
|
27423
27544
|
function registerTool(program2, io) {
|
|
27424
27545
|
registerDeckCommands(program2, io);
|
|
27425
27546
|
registerContentCommands(program2, io);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antasphere/slideless",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.8",
|
|
4
4
|
"description": "The Slideless CLI — push, share, pull, and preview decks on a Slideless instance",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"test": "vitest run --passWithNoTests"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@antasphere/chassis-cli": "1.0
|
|
40
|
-
"@antasphere/chassis-contract": "1.0
|
|
41
|
-
"@antasphere/chassis-sdk": "1.0
|
|
39
|
+
"@antasphere/chassis-cli": "1.1.0",
|
|
40
|
+
"@antasphere/chassis-contract": "1.1.0",
|
|
41
|
+
"@antasphere/chassis-sdk": "1.1.0",
|
|
42
42
|
"@antasphere/cli-core": "^0.5.0",
|
|
43
43
|
"@slideless/contract": "workspace:*",
|
|
44
44
|
"@slideless/sdk": "workspace:*",
|