@anna-ai/cli 0.1.33 → 0.1.35
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/{_lifecycle-shared-CUK2CE76.js → _lifecycle-shared-RyiRITI5.js} +4 -2
- package/dist/{account-bqao7Gp5.js → account-B4rdVDyg.js} +1 -1
- package/dist/{agent-CzPryLi6.js → agent-DAOr_aiE.js} +1 -1
- package/dist/{app-bundle-upload-CqT9KUOl.js → app-bundle-upload-DmVKWAj9.js} +3 -3
- package/dist/{apps-dvknZYI2.js → apps-C_Oln_om.js} +1 -1
- package/dist/apps-cut-MjSe2ph7.js +159 -0
- package/dist/{apps-destructive-B6RFjokU.js → apps-destructive-a2YBmWFm.js} +2 -2
- package/dist/{apps-discard-hVZxAQyj.js → apps-discard-BWLVVMu7.js} +12 -10
- package/dist/{apps-grants-DnXCnkH5.js → apps-grants-lmllFB02.js} +1 -1
- package/dist/{apps-publish-BKqVsS1W.js → apps-publish--EmBa0zN.js} +8 -7
- package/dist/apps-publish-B7reDBe1.js +17 -0
- package/dist/{apps-push-B3wZr9B4.js → apps-push-CkJ1gtpy.js} +16 -12
- package/dist/{apps-release-CyAPmWPU.js → apps-release-J-Sjkoym.js} +3 -3
- package/dist/{apps-rename-slug-D2BrWasG.js → apps-rename-slug-DYrk4Zpt.js} +3 -3
- package/dist/{apps-status-DV8V_y35.js → apps-status-CcCoYu6i.js} +1 -1
- package/dist/{apps-submit-review-DMFQI8JZ.js → apps-submit-review-DNrQc2ws.js} +2 -2
- package/dist/{apps-sync-meta-BOb6J_wz.js → apps-sync-meta-CL2PCMCv.js} +6 -4
- package/dist/{apps-versions-D1lixrmM.js → apps-versions-2BR8xo7C.js} +1 -1
- package/dist/binary-upload-CKMU5Rfw.js +181 -0
- package/dist/bridge-CzeSuRRL.js +3 -0
- package/dist/{bridge-CbjqAm0H.js → bridge-Dvck0e9c.js} +1 -1
- package/dist/{bundled-executas-06keEPP_.js → bundled-executas-Bp9Z6aiR.js} +1 -1
- package/dist/cli.js +80 -44
- package/dist/dev-CZLOk2qE.js +4 -0
- package/dist/{dev-Re6NyNDS.js → dev-GUFWek03.js} +5 -5
- package/dist/{dev-app-cache-Dv1dZ_bw.js → dev-app-cache-B3Wa5t6X.js} +18 -3
- package/dist/{doctor-VrfEkedz.js → doctor-C3Nx8E2L.js} +1 -1
- package/dist/{executa-cache-B0O79Hpb.js → executa-cache-WBkCLic7.js} +1 -1
- package/dist/{executa-destructive-Bz7vWxEO.js → executa-destructive-DCfQ1ez5.js} +3 -3
- package/dist/{executa-dev-B5Uz982M.js → executa-dev-CAw5X64R.js} +8 -8
- package/dist/{executa-install-BW9jjY7u.js → executa-install-Dz7hBUsn.js} +2 -2
- package/dist/executa-install-nOFLBwxv.js +7 -0
- package/dist/executa-publish-B_7k1gOf.js +11 -0
- package/dist/{executa-publish-Ah6J7jYd.js → executa-publish-kh4Ucd3o.js} +21 -5
- package/dist/{executa-reads-BXDJWWw6.js → executa-reads-BmwT_Yjp.js} +2 -2
- package/dist/executa-trusted-publisher-tVwzjI2d.js +91 -0
- package/dist/executa-upload-binaries-DURJTXRI.js +277 -0
- package/dist/executa-upload-binaries-DrwpzQp3.js +9 -0
- package/dist/{listing-meta-BlY7XMrw.js → listing-meta-CtVtyaWu.js} +13 -4
- package/dist/{manifest-DOMrcdCK.js → manifest-CAF3_r1T.js} +88 -11
- package/dist/{publish-GpvkaBIx.js → publish-DwIJWl46.js} +12 -10
- package/dist/{server-BMcGaUTy.js → server-BHWGGZsf.js} +1 -1
- package/dist/{storage-BkF4XyI0.js → storage-aii8EyPC.js} +1 -1
- package/dist/{token-uedeaAy7.js → token-COnYMRB-.js} +1 -1
- package/dist/{working-orchestration-1jzRuk34.js → working-orchestration-D7cW2Bf2.js} +7 -6
- package/package.json +1 -1
- package/dist/apps-cut-8870xpk-.js +0 -86
- package/dist/apps-publish-Djpw5cfG.js +0 -15
- package/dist/bridge-CzHB_IsQ.js +0 -3
- package/dist/dev-C3yWhzAp.js +0 -4
- package/dist/executa-install-Cyid8R7r.js +0 -7
- package/dist/executa-publish-DI_6M_ea.js +0 -9
- /package/dist/{app-cache-BqnTkxUw.js → app-cache-Cr3tKbux.js} +0 -0
- /package/dist/{bundled-executas-_H1A9M50.js → bundled-executas-rSIkaA6-.js} +0 -0
- /package/dist/{confirm-BuT56E_B.js → confirm-BSoOy1X2.js} +0 -0
- /package/dist/{dev-account-DqEFCmVg.js → dev-account-CfVdGa9j.js} +0 -0
- /package/dist/{executa-cache-Do1D7xC0.js → executa-cache-BFoUtb4J.js} +0 -0
- /package/dist/{executa-init-D-kWINZ3.js → executa-init-DKy7DMSD.js} +0 -0
- /package/dist/{executa-register-D5kvSSz_.js → executa-register-CmqKsoAU.js} +0 -0
- /package/dist/{executas-BhFed1B-.js → executas-CvQY_w2U.js} +0 -0
- /package/dist/{fixture-BUKQYR5e.js → fixture-BF1Z0Rry.js} +0 -0
- /package/dist/{host_upload-BVzAqvX1.js → host_upload-DrbQ-vk2.js} +0 -0
- /package/dist/{image-BLPyUbGQ.js → image-B4UrufYH.js} +0 -0
- /package/dist/{login-DhgBgsfx.js → login-DbETuUxy.js} +0 -0
- /package/dist/{logout-VYDkLYAx.js → logout-BzIEf-HU.js} +0 -0
- /package/dist/{runner-BxYjAmih.js → runner-Bka_coxb.js} +0 -0
- /package/dist/{sampling-XBIEYU4A.js → sampling-BpJcd6BC.js} +0 -0
- /package/dist/{whoami-C_x26b_k.js → whoami-Bn38ns8r.js} +0 -0
|
@@ -43,6 +43,13 @@ function loadAppManifest(cwd, manifestPath) {
|
|
|
43
43
|
const metadataLabel = hasAppJson ? "app.json" : "manifest.json";
|
|
44
44
|
const pickMeta = (k) => (appJsonRaw && pickString(appJsonRaw, k)) ?? pickString(raw, k);
|
|
45
45
|
const pickMetaArray = (k) => (appJsonRaw && pickStringArray(appJsonRaw, k)) ?? pickStringArray(raw, k);
|
|
46
|
+
const pickClearableMeta = (k) => {
|
|
47
|
+
const owner = appJsonRaw && k in appJsonRaw ? appJsonRaw : k in raw ? raw : null;
|
|
48
|
+
if (!owner) return void 0;
|
|
49
|
+
const v = owner[k];
|
|
50
|
+
if (v === null || v === "") return "";
|
|
51
|
+
return typeof v === "string" ? v : void 0;
|
|
52
|
+
};
|
|
46
53
|
const slug = pickMeta("slug");
|
|
47
54
|
const name = pickMeta("name") ?? slug ?? "";
|
|
48
55
|
const version = pickMeta("version") ?? "0.1.0";
|
|
@@ -67,11 +74,11 @@ function loadAppManifest(cwd, manifestPath) {
|
|
|
67
74
|
changelog: pickMeta("changelog"),
|
|
68
75
|
logoUrl: pickMeta("logo_url"),
|
|
69
76
|
logoFile: pickMeta("logo_file"),
|
|
70
|
-
coverUrl:
|
|
77
|
+
coverUrl: pickClearableMeta("cover_url"),
|
|
71
78
|
screenshots: pickMetaArray("screenshots"),
|
|
72
|
-
homepageUrl:
|
|
73
|
-
supportUrl:
|
|
74
|
-
privacyUrl:
|
|
79
|
+
homepageUrl: pickClearableMeta("homepage_url"),
|
|
80
|
+
supportUrl: pickClearableMeta("support_url"),
|
|
81
|
+
privacyUrl: pickClearableMeta("privacy_url"),
|
|
75
82
|
pricingModel: pickMeta("pricing_model")
|
|
76
83
|
};
|
|
77
84
|
}
|
|
@@ -92,7 +99,7 @@ function parseBundledExecutas(value, label) {
|
|
|
92
99
|
}
|
|
93
100
|
return out;
|
|
94
101
|
}
|
|
95
|
-
function loadExecutaManifest(cwd, manifestPath) {
|
|
102
|
+
function loadExecutaManifest(cwd, manifestPath, profileOverride) {
|
|
96
103
|
const path = resolve(cwd, manifestPath ?? "executa.json");
|
|
97
104
|
if (!existsSync(path)) throw new CliError(`no executa.json at ${path}`, 4);
|
|
98
105
|
const raw = readJson(path);
|
|
@@ -124,7 +131,7 @@ function loadExecutaManifest(cwd, manifestPath) {
|
|
|
124
131
|
changelog: pickString(raw, "changelog") ?? void 0,
|
|
125
132
|
skillContent,
|
|
126
133
|
executionMode: pickString(raw, "execution_mode") ?? void 0,
|
|
127
|
-
distribution: parseExecutaDistribution(raw["distribution"], t)
|
|
134
|
+
distribution: parseExecutaDistribution(raw["distribution"], t, profileOverride)
|
|
128
135
|
};
|
|
129
136
|
}
|
|
130
137
|
/**
|
|
@@ -155,20 +162,32 @@ function loadExecutaManifest(cwd, manifestPath) {
|
|
|
155
162
|
* still caught), but the returned `ExecutaDistribution` carries the
|
|
156
163
|
* fields of the *active* profile plus `active`/`profiles` for
|
|
157
164
|
* introspection. Downstream publish code stays profile-agnostic.
|
|
165
|
+
*
|
|
166
|
+
* The optional `profileOverride` (from the CLI `--profile <name>` flag)
|
|
167
|
+
* selects a declared profile for THIS invocation without touching the
|
|
168
|
+
* on-disk `active` field — so `active` can stay pinned to the production
|
|
169
|
+
* default (e.g. `binary`) while a developer temporarily pushes with
|
|
170
|
+
* `--profile local`. It is rejected if the block is the flat form (no
|
|
171
|
+
* `profiles`) or names an undeclared profile.
|
|
158
172
|
*/
|
|
159
|
-
function parseExecutaDistribution(value, executaType) {
|
|
173
|
+
function parseExecutaDistribution(value, executaType, profileOverride) {
|
|
160
174
|
if (value === void 0 || value === null) return void 0;
|
|
161
175
|
if (typeof value !== "object" || Array.isArray(value)) throw new CliError("executa.json `distribution` must be an object with a `type` field (or `profiles` for the switchable multi-mode form)", 4);
|
|
162
176
|
if (executaType === "skill") throw new CliError("executa.json `distribution` is only valid for `executa_type: \"tool\"` — skills are declarative Markdown and are not installed as a process", 4);
|
|
163
177
|
const d = value;
|
|
164
|
-
if (d["profiles"] !== void 0) return parseProfiledDistribution(d);
|
|
178
|
+
if (d["profiles"] !== void 0) return parseProfiledDistribution(d, profileOverride);
|
|
179
|
+
if (profileOverride !== void 0) throw new CliError(`--profile "${profileOverride}" was given but executa.json \`distribution\` is the flat single-mode form (no \`profiles\`) — declare a \`profiles\` map to switch between modes`, 4);
|
|
165
180
|
return parseDistributionProfile(d, "distribution");
|
|
166
181
|
}
|
|
167
182
|
/**
|
|
168
183
|
* Resolve the multi-profile `distribution` form into the selected profile.
|
|
169
184
|
* Validates *all* profiles and records them under `profiles`.
|
|
185
|
+
*
|
|
186
|
+
* Selection precedence: `profileOverride` (CLI `--profile`) > `active` field >
|
|
187
|
+
* the sole profile when exactly one is declared. The override never mutates
|
|
188
|
+
* the on-disk `active`; it only picks which profile this run publishes.
|
|
170
189
|
*/
|
|
171
|
-
function parseProfiledDistribution(d) {
|
|
190
|
+
function parseProfiledDistribution(d, profileOverride) {
|
|
172
191
|
if (d["type"] !== void 0) throw new CliError("executa.json `distribution` cannot set both `type` (flat form) and `profiles` (switchable form) — pick one", 4);
|
|
173
192
|
const profilesRaw = d["profiles"];
|
|
174
193
|
if (profilesRaw === null || typeof profilesRaw !== "object" || Array.isArray(profilesRaw)) throw new CliError("executa.json `distribution.profiles` must be an object mapping a profile name → distribution config", 4);
|
|
@@ -181,7 +200,10 @@ function parseProfiledDistribution(d) {
|
|
|
181
200
|
}
|
|
182
201
|
const active = pickString(d, "active");
|
|
183
202
|
let selected;
|
|
184
|
-
if (
|
|
203
|
+
if (profileOverride !== void 0) {
|
|
204
|
+
if (!(profileOverride in profiles)) throw new CliError(`--profile "${profileOverride}" is not a declared \`distribution.profiles\` entry — expected one of ${Object.keys(profiles).join(" | ")}`, 4);
|
|
205
|
+
selected = profileOverride;
|
|
206
|
+
} else if (active !== void 0) {
|
|
185
207
|
if (!(active in profiles)) throw new CliError(`executa.json \`distribution.active\` "${active}" is not a declared profile — expected one of ${Object.keys(profiles).join(" | ")}`, 4);
|
|
186
208
|
selected = active;
|
|
187
209
|
} else if (profileEntries.length === 1) selected = profileEntries[0][0];
|
|
@@ -206,15 +228,19 @@ function parseDistributionProfile(d, ctx) {
|
|
|
206
228
|
const executableName = pickString(d, "executable_name");
|
|
207
229
|
const supportsProtocol = pickBool(d, "supports_protocol");
|
|
208
230
|
const binaryUrls = parseBinaryUrls(d["binary_urls"], ctx);
|
|
231
|
+
const binaryArtifacts = parseBinaryArtifacts(d["binary_artifacts"], ctx);
|
|
209
232
|
const capabilities = parseCapabilities(d["capabilities"], ctx);
|
|
210
233
|
if (PACKAGE_BACKED.has(distType) && !packageName) throw new CliError(`executa.json \`${ctx}.package_name\` is required for \`${ctx}.type: "${distType}"\``, 4);
|
|
211
|
-
if (distType
|
|
234
|
+
if (binaryArtifacts && distType !== "binary") throw new CliError(`executa.json \`${ctx}.binary_artifacts\` is only valid for \`${ctx}.type: "binary"\``, 4);
|
|
235
|
+
if (binaryArtifacts && binaryUrls) throw new CliError(`executa.json \`${ctx}\` declares BOTH \`binary_urls\` and \`binary_artifacts\` — pick exactly one: \`binary_urls\` (a public GET-able source the platform pull-mirrors at cut) or \`binary_artifacts\` (local files pushed directly via \`anna-app executa upload-binaries\`; works for private repos)`, 4);
|
|
236
|
+
if (distType === "binary" && (!binaryUrls || Object.keys(binaryUrls).length === 0) && (!binaryArtifacts || Object.keys(binaryArtifacts).length === 0)) throw new CliError(`executa.json \`${ctx}\` requires exactly one of \`binary_urls\` (non-empty) or \`binary_artifacts\` (non-empty) for \`${ctx}.type: "binary"\``, 4);
|
|
212
237
|
return {
|
|
213
238
|
type: distType,
|
|
214
239
|
packageName,
|
|
215
240
|
executableName,
|
|
216
241
|
supportsProtocol,
|
|
217
242
|
binaryUrls,
|
|
243
|
+
binaryArtifacts,
|
|
218
244
|
capabilities
|
|
219
245
|
};
|
|
220
246
|
}
|
|
@@ -238,6 +264,57 @@ function parseBinaryUrls(value, ctx = "distribution") {
|
|
|
238
264
|
}
|
|
239
265
|
return out;
|
|
240
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* Canonical `<os>-<arch>` platform keys accepted for `binary_artifacts`
|
|
269
|
+
* (mirrors ALLOWED_PLATFORMS in matrix-nexus
|
|
270
|
+
* src/services/executa_binary_upload.py — both ends validate independently).
|
|
271
|
+
*/
|
|
272
|
+
const BINARY_ARTIFACT_PLATFORMS = new Set([
|
|
273
|
+
"darwin-arm64",
|
|
274
|
+
"darwin-x86_64",
|
|
275
|
+
"linux-x86_64",
|
|
276
|
+
"linux-arm64",
|
|
277
|
+
"linux-aarch64",
|
|
278
|
+
"windows-x86_64",
|
|
279
|
+
"windows-arm64"
|
|
280
|
+
]);
|
|
281
|
+
const MAX_BINARY_ARTIFACT_PLATFORMS = 8;
|
|
282
|
+
/** Infer the archive format from a path suffix (`.tar.gz`/`.tgz`/`.zip`). */
|
|
283
|
+
function inferArtifactFormat(path) {
|
|
284
|
+
const lower = path.toLowerCase();
|
|
285
|
+
if (lower.endsWith(".tar.gz") || lower.endsWith(".tgz")) return "tar.gz";
|
|
286
|
+
if (lower.endsWith(".zip")) return "zip";
|
|
287
|
+
return void 0;
|
|
288
|
+
}
|
|
289
|
+
function parseBinaryArtifacts(value, ctx = "distribution") {
|
|
290
|
+
if (value === void 0 || value === null) return void 0;
|
|
291
|
+
if (typeof value !== "object" || Array.isArray(value)) throw new CliError(`executa.json \`${ctx}.binary_artifacts\` must be an object mapping platform → { path, entrypoint?, format? }`, 4);
|
|
292
|
+
const entries = Object.entries(value);
|
|
293
|
+
if (entries.length > MAX_BINARY_ARTIFACT_PLATFORMS) throw new CliError(`executa.json \`${ctx}.binary_artifacts\` declares more than ${MAX_BINARY_ARTIFACT_PLATFORMS} platforms`, 4);
|
|
294
|
+
const out = {};
|
|
295
|
+
for (const [platform, decl] of entries) {
|
|
296
|
+
if (!BINARY_ARTIFACT_PLATFORMS.has(platform)) throw new CliError(`executa.json \`${ctx}.binary_artifacts["${platform}"]\` — unknown platform key; expected one of ` + [...BINARY_ARTIFACT_PLATFORMS].join(" | "), 4);
|
|
297
|
+
if (decl === null || typeof decl !== "object" || Array.isArray(decl)) throw new CliError(`executa.json \`${ctx}.binary_artifacts["${platform}"]\` must be an object \`{ path, entrypoint?, format? }\``, 4);
|
|
298
|
+
const d = decl;
|
|
299
|
+
const path = pickString(d, "path");
|
|
300
|
+
if (!path || !path.trim()) throw new CliError(`executa.json \`${ctx}.binary_artifacts["${platform}"]\` missing required \`path\``, 4);
|
|
301
|
+
const declared = pickString(d, "format");
|
|
302
|
+
let format;
|
|
303
|
+
if (declared !== void 0) if (declared === "tar.gz" || declared === "tgz") format = "tar.gz";
|
|
304
|
+
else if (declared === "zip") format = "zip";
|
|
305
|
+
else throw new CliError(`executa.json \`${ctx}.binary_artifacts["${platform}"].format\` "${declared}" is invalid — expected tar.gz | tgz | zip (bare executables must be archived)`, 4);
|
|
306
|
+
else {
|
|
307
|
+
format = inferArtifactFormat(path);
|
|
308
|
+
if (!format) throw new CliError(`executa.json \`${ctx}.binary_artifacts["${platform}"]\` — cannot infer archive format from "${path}"; use a .tar.gz/.tgz/.zip suffix or set \`format\` explicitly`, 4);
|
|
309
|
+
}
|
|
310
|
+
out[platform] = {
|
|
311
|
+
path,
|
|
312
|
+
entrypoint: pickString(d, "entrypoint"),
|
|
313
|
+
format
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
return out;
|
|
317
|
+
}
|
|
241
318
|
function parseCapabilities(value, ctx = "distribution") {
|
|
242
319
|
if (value === void 0 || value === null) return void 0;
|
|
243
320
|
if (!Array.isArray(value) || value.some((v) => typeof v !== "string")) throw new CliError(`executa.json \`${ctx}.capabilities\` must be an array of strings`, 4);
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import "./credentials-BTv2IfUZ.js";
|
|
2
2
|
import "./apps-DlVsVHQ5.js";
|
|
3
3
|
import { CliError } from "./client-D-_z1ALk.js";
|
|
4
|
-
import { withErrorHandling } from "./_lifecycle-shared-
|
|
5
|
-
import "./
|
|
6
|
-
import "./executas-
|
|
7
|
-
import "./
|
|
8
|
-
import
|
|
9
|
-
import "./
|
|
10
|
-
import "./
|
|
11
|
-
import "./
|
|
12
|
-
import "./app-
|
|
13
|
-
import
|
|
4
|
+
import { withErrorHandling } from "./_lifecycle-shared-RyiRITI5.js";
|
|
5
|
+
import "./executa-cache-BFoUtb4J.js";
|
|
6
|
+
import "./bundled-executas-rSIkaA6-.js";
|
|
7
|
+
import "./manifest-CAF3_r1T.js";
|
|
8
|
+
import "./executas-CvQY_w2U.js";
|
|
9
|
+
import { runExecutaPublish } from "./executa-publish-kh4Ucd3o.js";
|
|
10
|
+
import "./binary-upload-CKMU5Rfw.js";
|
|
11
|
+
import "./executa-upload-binaries-DURJTXRI.js";
|
|
12
|
+
import "./app-cache-Cr3tKbux.js";
|
|
13
|
+
import "./listing-meta-CtVtyaWu.js";
|
|
14
|
+
import "./app-bundle-upload-DmVKWAj9.js";
|
|
15
|
+
import { runAppsPublish } from "./apps-publish--EmBa0zN.js";
|
|
14
16
|
import { resolve } from "node:path";
|
|
15
17
|
import { existsSync } from "node:fs";
|
|
16
18
|
import { red, yellow } from "kleur/colors";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { canonicalHost, getAccount } from "./credentials-BTv2IfUZ.js";
|
|
2
|
-
import { BridgeRequestError } from "./bridge-
|
|
2
|
+
import { BridgeRequestError } from "./bridge-Dvck0e9c.js";
|
|
3
3
|
import { dirname, join, normalize, resolve } from "node:path";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { createReadStream, existsSync, readFileSync, statSync, watch } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { canonicalHost } from "./credentials-BTv2IfUZ.js";
|
|
2
|
-
import { hostOf, requireAccount, withCode } from "./dev-account-
|
|
2
|
+
import { hostOf, requireAccount, withCode } from "./dev-account-CfVdGa9j.js";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./credentials-BTv2IfUZ.js";
|
|
2
2
|
import "./client-D-_z1ALk.js";
|
|
3
|
-
import { resolveClient, withErrorHandling } from "./_lifecycle-shared-
|
|
3
|
+
import { resolveClient, withErrorHandling } from "./_lifecycle-shared-RyiRITI5.js";
|
|
4
4
|
import { bold, cyan, dim, green, red, yellow } from "kleur/colors";
|
|
5
5
|
|
|
6
6
|
//#region src/api/tokens.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { canonicalHost } from "./credentials-BTv2IfUZ.js";
|
|
2
2
|
import { createApp, findAppBySlug, getApp } from "./apps-DlVsVHQ5.js";
|
|
3
3
|
import { CliError } from "./client-D-_z1ALk.js";
|
|
4
|
-
import { parseExecutaIdOverrides, readExecutasLock, substituteBundledRefs, validateBundledHandles, writeBundleToolIdSidecar, writeExecutasLock } from "./bundled-executas-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { runExecutaInstall } from "./executa-install-
|
|
8
|
-
import { appCacheMatches, readAppIdentity, writeAppIdentity } from "./app-cache-
|
|
4
|
+
import { parseExecutaIdOverrides, readExecutasLock, substituteBundledRefs, validateBundledHandles, writeBundleToolIdSidecar, writeExecutasLock } from "./bundled-executas-rSIkaA6-.js";
|
|
5
|
+
import { loadExecutaManifest } from "./manifest-CAF3_r1T.js";
|
|
6
|
+
import { runExecutaPublish } from "./executa-publish-kh4Ucd3o.js";
|
|
7
|
+
import { runExecutaInstall } from "./executa-install-Dz7hBUsn.js";
|
|
8
|
+
import { appCacheMatches, readAppIdentity, writeAppIdentity } from "./app-cache-Cr3tKbux.js";
|
|
9
9
|
import { join, resolve } from "node:path";
|
|
10
10
|
import { dim, green, yellow } from "kleur/colors";
|
|
11
11
|
import { homedir } from "node:os";
|
|
@@ -60,6 +60,7 @@ async function resolveBundledExecutas(params) {
|
|
|
60
60
|
account: params.account,
|
|
61
61
|
quiet: true,
|
|
62
62
|
freeze,
|
|
63
|
+
profile: params.profile,
|
|
63
64
|
capture: (r) => {
|
|
64
65
|
captured = r;
|
|
65
66
|
}
|
|
@@ -129,7 +130,7 @@ async function installLocalBundledShims(params) {
|
|
|
129
130
|
const dir = resolve(cwd, decl.path);
|
|
130
131
|
let exManifest;
|
|
131
132
|
try {
|
|
132
|
-
exManifest = loadExecutaManifest(dir);
|
|
133
|
+
exManifest = loadExecutaManifest(dir, void 0, params.profile);
|
|
133
134
|
} catch {
|
|
134
135
|
continue;
|
|
135
136
|
}
|
package/package.json
CHANGED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { canonicalHost } from "./credentials-BTv2IfUZ.js";
|
|
2
|
-
import "./nexus-root-BlPwOusj.js";
|
|
3
|
-
import { cutWorkingDraft } from "./apps-DlVsVHQ5.js";
|
|
4
|
-
import { CliError } from "./client-D-_z1ALk.js";
|
|
5
|
-
import { resolveClient, withErrorHandling } from "./_lifecycle-shared-CUK2CE76.js";
|
|
6
|
-
import { readExecutasLock, writeExecutasLock } from "./bundled-executas-_H1A9M50.js";
|
|
7
|
-
import "./executas-BhFed1B-.js";
|
|
8
|
-
import "./executa-cache-Do1D7xC0.js";
|
|
9
|
-
import "./executa-publish-Ah6J7jYd.js";
|
|
10
|
-
import "./manifest-DOMrcdCK.js";
|
|
11
|
-
import "./dev-Re6NyNDS.js";
|
|
12
|
-
import "./executa-install-BW9jjY7u.js";
|
|
13
|
-
import "./app-cache-BqnTkxUw.js";
|
|
14
|
-
import { resolveAppBySlugOrCache } from "./working-orchestration-1jzRuk34.js";
|
|
15
|
-
import { resolve } from "node:path";
|
|
16
|
-
import { bold, cyan, dim, green, yellow } from "kleur/colors";
|
|
17
|
-
|
|
18
|
-
//#region src/commands/apps-cut.ts
|
|
19
|
-
async function runAppsCut(opts) {
|
|
20
|
-
return withErrorHandling(async () => {
|
|
21
|
-
const { client, host } = resolveClient({ account: opts.account });
|
|
22
|
-
const app = await resolveAppBySlugOrCache(client, host, {
|
|
23
|
-
slug: opts.slug,
|
|
24
|
-
cwd: opts.cwd
|
|
25
|
-
});
|
|
26
|
-
if (opts.dryRun) {
|
|
27
|
-
if (!opts.json) console.log(yellow(`[dry-run] would cut version ${opts.version} for apps/${app.slug} (app_id=${app.id})`));
|
|
28
|
-
return 0;
|
|
29
|
-
}
|
|
30
|
-
let result;
|
|
31
|
-
try {
|
|
32
|
-
result = await cutWorkingDraft(client, app.id, {
|
|
33
|
-
version: opts.version,
|
|
34
|
-
changelog: opts.changelog
|
|
35
|
-
});
|
|
36
|
-
} catch (e) {
|
|
37
|
-
if (e instanceof CliError && e.status === 409) throw new CliError(`version ${opts.version} already cut for apps/${app.slug}; choose a higher SemVer (e.g. bump patch/minor) and retry`, 9);
|
|
38
|
-
if (e instanceof CliError && (e.status === 400 || e.status === 422)) throw new CliError(`cannot cut: ${e.message} — fix the working draft and \`apps push\` again`, 4);
|
|
39
|
-
throw e;
|
|
40
|
-
}
|
|
41
|
-
if (result.frozen_executas.length > 0) {
|
|
42
|
-
const cwd = resolve(opts.cwd ?? process.cwd());
|
|
43
|
-
const lock = readExecutasLock(cwd, host);
|
|
44
|
-
if (lock) {
|
|
45
|
-
const byToolId = new Map(Object.entries(lock.executas).map(([h, e]) => [e.tool_id, h]));
|
|
46
|
-
for (const fr of result.frozen_executas) {
|
|
47
|
-
const handle = byToolId.get(fr.tool_id);
|
|
48
|
-
if (handle && lock.executas[handle]) lock.executas[handle] = {
|
|
49
|
-
...lock.executas[handle],
|
|
50
|
-
tool_id: fr.tool_id,
|
|
51
|
-
source: "cut"
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
writeExecutasLock(cwd, {
|
|
55
|
-
$schema: "anna-executas-lock/v1",
|
|
56
|
-
host: canonicalHost(host),
|
|
57
|
-
executas: lock.executas
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (opts.json) {
|
|
62
|
-
console.log(JSON.stringify({
|
|
63
|
-
app_id: app.id,
|
|
64
|
-
slug: app.slug,
|
|
65
|
-
host,
|
|
66
|
-
version_id: result.version_id,
|
|
67
|
-
version: result.version,
|
|
68
|
-
frozen_executas: result.frozen_executas,
|
|
69
|
-
bundle: result.bundle
|
|
70
|
-
}, null, 2));
|
|
71
|
-
return 0;
|
|
72
|
-
}
|
|
73
|
-
console.log(green(`✓ apps/${app.slug}: cut immutable version ${result.version} `) + dim(`(version_id=${result.version_id})`));
|
|
74
|
-
for (const fr of result.frozen_executas) console.log(dim(` froze ${fr.tool_id} → executa_version=${fr.executa_version_id}`) + (fr.version ? dim(` (v${fr.version})`) : ""));
|
|
75
|
-
if (result.bundle && typeof result.bundle === "object") {
|
|
76
|
-
const prefix = result.bundle.object_prefix;
|
|
77
|
-
if (prefix) console.log(dim(` bundle frozen at ${prefix}`));
|
|
78
|
-
}
|
|
79
|
-
console.log(dim(`→ run `) + cyan(`anna-app apps release ${result.version}`) + dim(` to go live`));
|
|
80
|
-
console.log(bold(cyan(`status: ${app.status}`)));
|
|
81
|
-
return 0;
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
//#endregion
|
|
86
|
-
export { runAppsCut };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import "./credentials-BTv2IfUZ.js";
|
|
2
|
-
import "./apps-DlVsVHQ5.js";
|
|
3
|
-
import "./client-D-_z1ALk.js";
|
|
4
|
-
import "./_lifecycle-shared-CUK2CE76.js";
|
|
5
|
-
import "./bundled-executas-_H1A9M50.js";
|
|
6
|
-
import "./executas-BhFed1B-.js";
|
|
7
|
-
import "./executa-cache-Do1D7xC0.js";
|
|
8
|
-
import "./executa-publish-Ah6J7jYd.js";
|
|
9
|
-
import "./manifest-DOMrcdCK.js";
|
|
10
|
-
import "./app-cache-BqnTkxUw.js";
|
|
11
|
-
import "./listing-meta-BlY7XMrw.js";
|
|
12
|
-
import "./app-bundle-upload-CqT9KUOl.js";
|
|
13
|
-
import { runAppsPublish } from "./apps-publish-BKqVsS1W.js";
|
|
14
|
-
|
|
15
|
-
export { runAppsPublish };
|
package/dist/bridge-CzHB_IsQ.js
DELETED
package/dist/dev-C3yWhzAp.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "./credentials-BTv2IfUZ.js";
|
|
2
|
-
import "./client-D-_z1ALk.js";
|
|
3
|
-
import "./_lifecycle-shared-CUK2CE76.js";
|
|
4
|
-
import "./executas-BhFed1B-.js";
|
|
5
|
-
import "./executa-cache-Do1D7xC0.js";
|
|
6
|
-
import { runExecutaPublish } from "./executa-publish-Ah6J7jYd.js";
|
|
7
|
-
import "./manifest-DOMrcdCK.js";
|
|
8
|
-
|
|
9
|
-
export { runExecutaPublish };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|