@akanjs/cli 3.1.1-rc.6 → 3.1.1-rc.7
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/.build-stamp +1 -1
- package/{CodeAgent-y6ppa10x.js → CodeAgent-3sy7kjgj.js} +2 -2
- package/{CodeTui-dy37zz3j.js → CodeTui-rqxarxsn.js} +1 -1
- package/{TunnelShare-mnn0jxnp.js → TunnelShare-q38dxrrr.js} +3 -3
- package/akanCode.js +2 -2
- package/{application.command-fdghyjfj.js → application.command-fm2yn6hj.js} +3 -3
- package/{cloud.command-eyxwxnrn.js → cloud.command-ya0evzfq.js} +15 -10
- package/{cloud.script-c9f92bev.js → cloud.script-zg43jse2.js} +6 -6
- package/{code.command-4kqbrjt9.js → code.command-719k3e9q.js} +4 -4
- package/{context.command-h56yvjay.js → context.command-c4t4z1vy.js} +4 -4
- package/{context.runner-cf11819z.js → context.runner-qb15sjf8.js} +3 -3
- package/{index-ds2tmxgx.js → index-5max10jx.js} +533 -137
- package/{index-bksa6cqh.js → index-5phjb48k.js} +3 -3
- package/{index-krz4bcg5.js → index-8ap5z1n5.js} +1 -1
- package/{index-kr9vpvdn.js → index-8w76g4rm.js} +4 -4
- package/{index-44hh6bx2.js → index-hqegmnb5.js} +53 -6
- package/{index-jhbkzc8c.js → index-jh72e64b.js} +42 -1
- package/{index-12ny6e0x.js → index-pbtzb54h.js} +11 -9
- package/{index-jg2xev75.js → index-qd5km521.js} +3 -97
- package/{index-zz4vrw85.js → index-vah0fgkr.js} +1 -1
- package/{index-e9b3zh22.js → index-xy97mqgq.js} +34 -3
- package/{index-secyhsjs.js → index-zrte51fn.js} +1 -1
- package/index.js +8 -8
- package/{localRegistry.command-bajag7gm.js → localRegistry.command-h924ek5g.js} +5 -5
- package/package.json +2 -2
- package/{subspace.command-dzpfbc99.js → subspace.command-vem71tr5.js} +3 -3
- package/{tunnel.command-cfw6f0vz.js → tunnel.command-vy08ecyp.js} +3 -3
- package/{workspace.command-5rc8f0wt.js → workspace.command-fmgycnbr.js} +8 -8
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
McpServerConfig,
|
|
6
6
|
McpSignIn,
|
|
7
7
|
AkanCodeCompaction2
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-8ap5z1n5.js";
|
|
9
9
|
import {
|
|
10
10
|
stripAnsi
|
|
11
11
|
} from "./index-7md2g9vw.js";
|
|
@@ -809,7 +809,7 @@ class AkanToolPack2 {
|
|
|
809
809
|
return { name: "akan-tools", factory: async (pi) => await this.#register(pi) };
|
|
810
810
|
}
|
|
811
811
|
async names() {
|
|
812
|
-
const { ContextRunner } = await import("./context.runner-
|
|
812
|
+
const { ContextRunner } = await import("./context.runner-qb15sjf8.js");
|
|
813
813
|
return [
|
|
814
814
|
...new ContextRunner().listMcpTools(this.#options.mode).map((tool) => tool.name),
|
|
815
815
|
AkanToolPack2.verifyToolName
|
|
@@ -817,7 +817,7 @@ class AkanToolPack2 {
|
|
|
817
817
|
}
|
|
818
818
|
static verifyToolName = "akan_verify";
|
|
819
819
|
async#register(pi) {
|
|
820
|
-
const { ContextRunner } = await import("./context.runner-
|
|
820
|
+
const { ContextRunner } = await import("./context.runner-qb15sjf8.js");
|
|
821
821
|
const runner = new ContextRunner;
|
|
822
822
|
const guidelineNames = await AkanToolPack2.#guidelineNames();
|
|
823
823
|
for (const tool of runner.listMcpTools(this.#options.mode, { guidelineNames })) {
|
|
@@ -179,7 +179,7 @@ class SubagentPool2 {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
async#run(id, kind, prompt, signal) {
|
|
182
|
-
const { CodeAgent } = await import("./CodeAgent-
|
|
182
|
+
const { CodeAgent } = await import("./CodeAgent-3sy7kjgj.js");
|
|
183
183
|
const budget = this.#options.parent.tools.subagent;
|
|
184
184
|
const child = SubagentPool2.childOf(this.#options.parent, kind);
|
|
185
185
|
const agent = await CodeAgent.create({
|
|
@@ -21,16 +21,16 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
runner
|
|
23
23
|
} from "./index-3wypz6xj.js";
|
|
24
|
+
import {
|
|
25
|
+
NativeApp
|
|
26
|
+
} from "./index-5max10jx.js";
|
|
24
27
|
import {
|
|
25
28
|
isPlaceholderAppId
|
|
26
|
-
} from "./index-
|
|
29
|
+
} from "./index-qd5km521.js";
|
|
27
30
|
import {
|
|
28
31
|
getMobileTargets,
|
|
29
32
|
appIdsOf
|
|
30
33
|
} from "./index-m9jj544v.js";
|
|
31
|
-
import {
|
|
32
|
-
NativeApp
|
|
33
|
-
} from "./index-ds2tmxgx.js";
|
|
34
34
|
import {
|
|
35
35
|
Prompter2
|
|
36
36
|
} from "./index-zzvvc845.js";
|
|
@@ -4,26 +4,27 @@ import {
|
|
|
4
4
|
CloudApi,
|
|
5
5
|
CloudUpdates,
|
|
6
6
|
PipelineSecrets
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-xy97mqgq.js";
|
|
8
8
|
import {
|
|
9
9
|
PkgExecutor
|
|
10
10
|
} from "./index-wcej7g4z.js";
|
|
11
11
|
import {
|
|
12
|
+
UpdatePackFolder,
|
|
12
13
|
NativePublicEnv,
|
|
13
|
-
|
|
14
|
-
} from "./index-
|
|
14
|
+
NativeApp
|
|
15
|
+
} from "./index-5max10jx.js";
|
|
15
16
|
import {
|
|
16
17
|
script
|
|
17
18
|
} from "./index-3wypz6xj.js";
|
|
18
19
|
import {
|
|
19
20
|
ApplicationScript
|
|
20
|
-
} from "./index-
|
|
21
|
+
} from "./index-pbtzb54h.js";
|
|
21
22
|
import {
|
|
22
23
|
PackageScript
|
|
23
24
|
} from "./index-42j4a8zq.js";
|
|
24
25
|
import {
|
|
25
26
|
CloudRunner
|
|
26
|
-
} from "./index-
|
|
27
|
+
} from "./index-jh72e64b.js";
|
|
27
28
|
|
|
28
29
|
// pkgs/@akanjs/cli/cloud/cloud.script.ts
|
|
29
30
|
import { Logger } from "akanjs/common";
|
|
@@ -93,6 +94,7 @@ class CloudScript2 extends script("cloud", [CloudRunner, ApplicationScript, Pack
|
|
|
93
94
|
}
|
|
94
95
|
async pushUpdate(workspace, app, {
|
|
95
96
|
platform,
|
|
97
|
+
arch = null,
|
|
96
98
|
target,
|
|
97
99
|
env,
|
|
98
100
|
channel,
|
|
@@ -104,6 +106,22 @@ class CloudScript2 extends script("cloud", [CloudRunner, ApplicationScript, Pack
|
|
|
104
106
|
pack: packDir,
|
|
105
107
|
publicEnv
|
|
106
108
|
}) {
|
|
109
|
+
if (platform && platform !== "ios" && platform !== "android") {
|
|
110
|
+
if (packDir || publicEnv)
|
|
111
|
+
throw new Error("--pack and --public-env take a phone's web bundle; a desktop release goes up as `akan publish-update` wrote it.");
|
|
112
|
+
return await this.#pushRelease(workspace, app, platform, {
|
|
113
|
+
arch,
|
|
114
|
+
target,
|
|
115
|
+
env: env ?? "main",
|
|
116
|
+
channel,
|
|
117
|
+
notes,
|
|
118
|
+
subspace,
|
|
119
|
+
given,
|
|
120
|
+
allowLocalRelease
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
if (arch)
|
|
124
|
+
throw new Error("--arch picks a desktop release's CPU; a phone's update is its web bundle.");
|
|
107
125
|
if (packDir && publicEnv)
|
|
108
126
|
throw new Error("--public-env picks what a pack is built with, and --pack uploads one already built: give one.");
|
|
109
127
|
const devProjectId = await this.cloudRunner.projectOf(workspace, subspace, app.name);
|
|
@@ -116,6 +134,35 @@ class CloudScript2 extends script("cloud", [CloudRunner, ApplicationScript, Pack
|
|
|
116
134
|
notes
|
|
117
135
|
});
|
|
118
136
|
}
|
|
137
|
+
async#pushRelease(workspace, app, platform, {
|
|
138
|
+
arch,
|
|
139
|
+
target,
|
|
140
|
+
env,
|
|
141
|
+
channel,
|
|
142
|
+
notes,
|
|
143
|
+
subspace,
|
|
144
|
+
given,
|
|
145
|
+
allowLocalRelease
|
|
146
|
+
}) {
|
|
147
|
+
const hostArch = process.arch === "arm64" || process.arch === "x64" ? process.arch : null;
|
|
148
|
+
const cpu = arch ?? hostArch;
|
|
149
|
+
if (!cpu)
|
|
150
|
+
throw new Error(`This computer's CPU is ${process.arch}: name the release's with --arch arm64 or x64.`);
|
|
151
|
+
if (env === "local" && !allowLocalRelease)
|
|
152
|
+
throw new Error("A release with --env local is blocked. Pass --allow-local-release only for explicit local release testing.");
|
|
153
|
+
const devProjectId = await this.cloudRunner.projectOf(workspace, subspace, app.name);
|
|
154
|
+
const read = await this.cloudRunner.readRelease(app, {
|
|
155
|
+
platform: platform === "desktop" ? NativeApp.desktopPlatform() : platform,
|
|
156
|
+
arch: cpu,
|
|
157
|
+
target,
|
|
158
|
+
env,
|
|
159
|
+
channel
|
|
160
|
+
});
|
|
161
|
+
return await this.cloudRunner.pushRelease(await this.#cloudApi(workspace, given), devProjectId, app, {
|
|
162
|
+
...read,
|
|
163
|
+
notes
|
|
164
|
+
});
|
|
165
|
+
}
|
|
119
166
|
async#packToPush(app, {
|
|
120
167
|
platform,
|
|
121
168
|
target,
|
|
@@ -128,7 +175,7 @@ class CloudScript2 extends script("cloud", [CloudRunner, ApplicationScript, Pack
|
|
|
128
175
|
if (packDir)
|
|
129
176
|
return await this.cloudRunner.readPack(app, packDir, { platform, target, env, allowLocalRelease });
|
|
130
177
|
if (!platform)
|
|
131
|
-
throw new Error("push-update needs --platform ios or android to pack, or --pack <dir> to upload what `akan pack-update` wrote.");
|
|
178
|
+
throw new Error("push-update needs --platform ios or android to pack, or --pack <dir> to upload what `akan pack-update` wrote, or --platform desktop for the release `akan publish-update` wrote.");
|
|
132
179
|
return await this.applicationScript.packUpdate(app, platform, {
|
|
133
180
|
target: target ?? undefined,
|
|
134
181
|
env: env ?? "main",
|
|
@@ -6,11 +6,17 @@ import {
|
|
|
6
6
|
CloudApi,
|
|
7
7
|
CloudUpdates,
|
|
8
8
|
PipelineSecrets
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-xy97mqgq.js";
|
|
10
|
+
import {
|
|
11
|
+
resolveMobileTargets
|
|
12
|
+
} from "./index-m9jj544v.js";
|
|
10
13
|
import {
|
|
11
14
|
WorkspaceExecutor,
|
|
12
15
|
AppExecutor
|
|
13
16
|
} from "./index-wcej7g4z.js";
|
|
17
|
+
import {
|
|
18
|
+
NativeApp
|
|
19
|
+
} from "./index-5max10jx.js";
|
|
14
20
|
import {
|
|
15
21
|
runner,
|
|
16
22
|
assertPromptable
|
|
@@ -1242,6 +1248,41 @@ ${run.format(results)}
|
|
|
1242
1248
|
async pushUpdate(cloudApi, devProjectId, pack, options) {
|
|
1243
1249
|
return await new CloudUpdates(cloudApi, devProjectId).push(pack, options);
|
|
1244
1250
|
}
|
|
1251
|
+
async readRelease(app, {
|
|
1252
|
+
platform,
|
|
1253
|
+
arch,
|
|
1254
|
+
target,
|
|
1255
|
+
env,
|
|
1256
|
+
channel
|
|
1257
|
+
}) {
|
|
1258
|
+
const targets = await resolveMobileTargets(app, target ?? undefined);
|
|
1259
|
+
const [mobileTarget] = targets;
|
|
1260
|
+
if (!mobileTarget || targets.length > 1)
|
|
1261
|
+
throw new Error("push-update uploads one native target's release at a time; pass --target <name>.");
|
|
1262
|
+
const { release, url, exeName } = await new NativeApp(app, mobileTarget, env).publishedRelease(platform, {
|
|
1263
|
+
arch,
|
|
1264
|
+
channel
|
|
1265
|
+
});
|
|
1266
|
+
const { signer, unread } = await release.signer({ exeName });
|
|
1267
|
+
if (unread)
|
|
1268
|
+
app.logger.warn(`release.json names no signer: ${unread}.`);
|
|
1269
|
+
return { release, url, signer, target: mobileTarget.name };
|
|
1270
|
+
}
|
|
1271
|
+
async pushRelease(cloudApi, devProjectId, app, {
|
|
1272
|
+
release,
|
|
1273
|
+
url,
|
|
1274
|
+
signer,
|
|
1275
|
+
target,
|
|
1276
|
+
notes
|
|
1277
|
+
}) {
|
|
1278
|
+
return await new CloudUpdates(cloudApi, devProjectId).pushRelease(release, {
|
|
1279
|
+
appName: app.name,
|
|
1280
|
+
target,
|
|
1281
|
+
notes,
|
|
1282
|
+
signer,
|
|
1283
|
+
url
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1245
1286
|
async registerBinary(cloudApi, devProjectId, app, pack, options) {
|
|
1246
1287
|
return await new CloudUpdates(cloudApi, devProjectId).registerBinary(app, pack, options);
|
|
1247
1288
|
}
|
|
@@ -52,18 +52,18 @@ import {
|
|
|
52
52
|
PkgExecutor
|
|
53
53
|
} from "./index-wcej7g4z.js";
|
|
54
54
|
import {
|
|
55
|
-
|
|
56
|
-
UpdateUploader
|
|
57
|
-
|
|
55
|
+
UpdatePackFolder,
|
|
56
|
+
UpdateUploader,
|
|
57
|
+
NativePublicEnv,
|
|
58
|
+
NativeApp
|
|
59
|
+
} from "./index-5max10jx.js";
|
|
60
|
+
import {
|
|
61
|
+
DesktopServerStage
|
|
62
|
+
} from "./index-qd5km521.js";
|
|
58
63
|
import {
|
|
59
64
|
resolveMobileTargets,
|
|
60
65
|
resolveAppId
|
|
61
66
|
} from "./index-m9jj544v.js";
|
|
62
|
-
import {
|
|
63
|
-
NativePublicEnv,
|
|
64
|
-
UpdatePackFolder,
|
|
65
|
-
NativeApp
|
|
66
|
-
} from "./index-ds2tmxgx.js";
|
|
67
67
|
import {
|
|
68
68
|
LibraryScript
|
|
69
69
|
} from "./index-2xcc2ax5.js";
|
|
@@ -2309,6 +2309,8 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
|
|
|
2309
2309
|
const { publicKey, keyId, keyPath, created } = await new NativeApp(app, mobileTarget).updateKeygen(nativePlatform);
|
|
2310
2310
|
app.log(`${appId}: ${created ? "made" : "read"} ${keyPath}${created ? " (keep it private and backed up: without it, installed apps take no more updates)" : ""}`);
|
|
2311
2311
|
app.log(` native: { updates: { url: "https://\u2026/${app.name}", publicKeys: [${JSON.stringify(publicKey)}] } }`);
|
|
2312
|
+
if (platform === "desktop")
|
|
2313
|
+
app.log(" url: hosted on Akan Cloud, register this public key as an external key on the release screen and use the URL it gives; self-hosted, the public address you upload the release to");
|
|
2312
2314
|
app.log(` keyId ${keyId}: what publish-update --revoke and updates.revokedKeys name this key by`);
|
|
2313
2315
|
const { publicKey: one, publicKeys } = mobileTarget.config.updates ?? {};
|
|
2314
2316
|
const declared = publicKeys ?? (one ? [one] : null);
|
|
@@ -3706,7 +3708,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
3706
3708
|
await Promise.all(shares.map(async (share) => await share.close()));
|
|
3707
3709
|
}, "Abandoning the tunnel release; the shares expire on their own.");
|
|
3708
3710
|
await Promise.all(apps.map(async (app) => {
|
|
3709
|
-
const { TunnelShare } = await import("./TunnelShare-
|
|
3711
|
+
const { TunnelShare } = await import("./TunnelShare-q38dxrrr.js");
|
|
3710
3712
|
const share = await TunnelShare.open(app, { workspace: app.workspace });
|
|
3711
3713
|
shares.push(share);
|
|
3712
3714
|
urls.set(app.name, share.url);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
DesktopBin
|
|
4
|
-
|
|
5
|
-
} from "./index-ds2tmxgx.js";
|
|
3
|
+
DesktopBin
|
|
4
|
+
} from "./index-5max10jx.js";
|
|
6
5
|
// pkgs/@akanjs/devkit/mobile/desktopServerStage.ts
|
|
7
6
|
import { cp, mkdir, readdir, rm, writeFile } from "fs/promises";
|
|
8
7
|
import path from "path";
|
|
@@ -146,97 +145,4 @@ var isPlaceholderAppId = (appId) => {
|
|
|
146
145
|
return true;
|
|
147
146
|
return normalized.split(".").some((segment) => placeholderAppIdSegment.test(segment));
|
|
148
147
|
};
|
|
149
|
-
|
|
150
|
-
import { readdir as readdir2 } from "fs/promises";
|
|
151
|
-
import path2 from "path";
|
|
152
|
-
import { isRecord, trimTrailingSlashes } from "akanjs/common";
|
|
153
|
-
class UpdateUploader {
|
|
154
|
-
bucket;
|
|
155
|
-
prefix;
|
|
156
|
-
static #manifest = /\.json(?:\.sig)?$/;
|
|
157
|
-
static parseTarget(target) {
|
|
158
|
-
const match = /^s3:\/\/([^/]+)(?:\/(.*))?$/.exec(target.trim());
|
|
159
|
-
if (!match?.[1])
|
|
160
|
-
throw new Error(`--upload takes s3://<bucket>/<prefix>, not ${JSON.stringify(target)}.`);
|
|
161
|
-
return { bucket: match[1], prefix: trimTrailingSlashes(match[2] ?? "") };
|
|
162
|
-
}
|
|
163
|
-
static order(files) {
|
|
164
|
-
const manifests = files.filter((file) => UpdateUploader.#manifest.test(file));
|
|
165
|
-
return {
|
|
166
|
-
releases: files.filter((file) => !UpdateUploader.#manifest.test(file)).sort((a, b) => a.localeCompare(b)),
|
|
167
|
-
manifests: manifests.sort((a, b) => Number(a.endsWith(".json")) - Number(b.endsWith(".json")) || a.localeCompare(b))
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
static async releaseFiles(updatesDir, { dir, channel, bundle }) {
|
|
171
|
-
const keyOf = (file) => UpdateUploader.#keyOf(updatesDir, dir, file);
|
|
172
|
-
const desktop = await UpdateUploader.#read(path2.join(dir, `${channel}.json`));
|
|
173
|
-
if (desktop?.bundle === bundle) {
|
|
174
|
-
const archive = desktop.archive?.url;
|
|
175
|
-
const patches = UpdateUploader.#field(desktop.patches, "url");
|
|
176
|
-
return [archive, ...patches, `${channel}.json.sig`, `${channel}.json`].map(keyOf);
|
|
177
|
-
}
|
|
178
|
-
const names = await readdir2(path2.join(dir, channel)).catch(() => []);
|
|
179
|
-
for (const name of names.filter((name) => name.endsWith(".json"))) {
|
|
180
|
-
const envelope = await UpdateUploader.#read(path2.join(dir, channel, name));
|
|
181
|
-
const manifest = typeof envelope?.manifest === "string" ? UpdateUploader.#parse(Buffer.from(envelope.manifest, "base64").toString("utf8")) : null;
|
|
182
|
-
if (manifest?.bundle !== bundle)
|
|
183
|
-
continue;
|
|
184
|
-
const hashes = [...new Set(UpdateUploader.#field(manifest.files, "sha256"))];
|
|
185
|
-
if (!hashes.every((hash) => typeof hash === "string" && /^[0-9a-f]{64}$/.test(hash)))
|
|
186
|
-
throw new Error(`${path2.join(dir, channel, name)} lists a file whose sha256 is not 64 hex digits; nothing was uploaded.`);
|
|
187
|
-
return [...hashes.map((hash) => `${UpdatePackFolder.filesDir}/${hash}`), `${channel}/${name}`].map(keyOf);
|
|
188
|
-
}
|
|
189
|
-
throw new Error(`${dir} holds no ${channel} manifest of release ${bundle}; nothing was uploaded.`);
|
|
190
|
-
}
|
|
191
|
-
static #keyOf(updatesDir, dir, file) {
|
|
192
|
-
const resolved = typeof file === "string" ? path2.resolve(dir, file) : "";
|
|
193
|
-
const key = path2.relative(updatesDir, resolved);
|
|
194
|
-
if (!resolved.startsWith(`${path2.resolve(dir)}${path2.sep}`) || key.startsWith("..") || path2.isAbsolute(key))
|
|
195
|
-
throw new Error(`The release in ${dir} names ${typeof file === "string" ? JSON.stringify(file) : "a file with no path"}, which is not inside that folder; nothing was uploaded.`);
|
|
196
|
-
return key.split(path2.sep).join("/");
|
|
197
|
-
}
|
|
198
|
-
static #field(list, key) {
|
|
199
|
-
return Array.isArray(list) ? list.map((item) => isRecord(item) ? item[key] : undefined) : [];
|
|
200
|
-
}
|
|
201
|
-
static async#read(file) {
|
|
202
|
-
const text = await Bun.file(file).text().catch(() => "");
|
|
203
|
-
return UpdateUploader.#parse(text);
|
|
204
|
-
}
|
|
205
|
-
static #parse(text) {
|
|
206
|
-
try {
|
|
207
|
-
const value = JSON.parse(text);
|
|
208
|
-
return isRecord(value) ? value : null;
|
|
209
|
-
} catch {
|
|
210
|
-
return null;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
constructor(bucket, prefix) {
|
|
214
|
-
this.bucket = bucket;
|
|
215
|
-
this.prefix = prefix;
|
|
216
|
-
}
|
|
217
|
-
static forTarget(target) {
|
|
218
|
-
const { bucket, prefix } = UpdateUploader.parseTarget(target);
|
|
219
|
-
return new UpdateUploader(new Bun.S3Client({ bucket }), prefix);
|
|
220
|
-
}
|
|
221
|
-
async upload(updatesDir, release) {
|
|
222
|
-
const { releases, manifests } = UpdateUploader.order(await UpdateUploader.releaseFiles(updatesDir, release));
|
|
223
|
-
const keyOf = (file) => this.prefix ? `${this.prefix}/${file}` : file;
|
|
224
|
-
let uploaded = 0;
|
|
225
|
-
let skipped = 0;
|
|
226
|
-
for (const file of releases) {
|
|
227
|
-
if (await this.bucket.exists(keyOf(file))) {
|
|
228
|
-
skipped++;
|
|
229
|
-
continue;
|
|
230
|
-
}
|
|
231
|
-
await this.bucket.write(keyOf(file), Bun.file(path2.join(updatesDir, file)));
|
|
232
|
-
uploaded++;
|
|
233
|
-
}
|
|
234
|
-
for (const file of manifests) {
|
|
235
|
-
const type = file.endsWith(".json") ? "application/json" : "text/plain";
|
|
236
|
-
await this.bucket.write(keyOf(file), Bun.file(path2.join(updatesDir, file)), { type });
|
|
237
|
-
uploaded++;
|
|
238
|
-
}
|
|
239
|
-
return { uploaded, skipped };
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
export { DesktopServerStage, isPlaceholderAppId, UpdateUploader };
|
|
148
|
+
export { DesktopServerStage, isPlaceholderAppId };
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
resolveMobileTargets
|
|
7
7
|
} from "./index-m9jj544v.js";
|
|
8
8
|
import {
|
|
9
|
-
NativePublicEnv,
|
|
10
9
|
UpdatePackFolder,
|
|
10
|
+
NativePublicEnv,
|
|
11
11
|
NativeApp
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-5max10jx.js";
|
|
13
13
|
import {
|
|
14
14
|
ExitCodeError
|
|
15
15
|
} from "./index-3wypz6xj.js";
|
|
@@ -384,6 +384,7 @@ import { Logger as Logger2 } from "akanjs/common";
|
|
|
384
384
|
import { Logger, sleep } from "akanjs/common";
|
|
385
385
|
class UpdatePackUpload {
|
|
386
386
|
static maxBytes = 200 * 1024 * 1024;
|
|
387
|
+
static maxAppBytes = 1024 * 1024 * 1024;
|
|
387
388
|
static #transientPut = new Set([0, 408, 429, 500, 502, 503, 504]);
|
|
388
389
|
static #putFloorBytesPerSecond = 64 * 1024;
|
|
389
390
|
static #maxPutRetryAfterMs = 60000;
|
|
@@ -415,7 +416,10 @@ class UpdatePackUpload {
|
|
|
415
416
|
}
|
|
416
417
|
async stage(archive, fields) {
|
|
417
418
|
const file = Bun.file(archive);
|
|
418
|
-
if (
|
|
419
|
+
if (fields.kind === "app") {
|
|
420
|
+
if (file.size < 1 || file.size > UpdatePackUpload.maxAppBytes)
|
|
421
|
+
throw new Error(`The release archive is ${file.size} bytes; a project takes 1 byte to 1 GiB.`);
|
|
422
|
+
} else if (file.size < 1 || file.size > UpdatePackUpload.maxBytes)
|
|
419
423
|
throw new Error(`The pack archive is ${file.size} bytes; a project takes 1 byte to 200 MiB.`);
|
|
420
424
|
const hasher = new Bun.CryptoHasher("sha256");
|
|
421
425
|
for await (const chunk of file.stream())
|
|
@@ -550,6 +554,33 @@ ${(release.problems ?? []).map((problem) => ` - ${problem}`).join(`
|
|
|
550
554
|
return release;
|
|
551
555
|
});
|
|
552
556
|
}
|
|
557
|
+
async pushRelease(release, {
|
|
558
|
+
appName,
|
|
559
|
+
target,
|
|
560
|
+
notes,
|
|
561
|
+
signer,
|
|
562
|
+
url
|
|
563
|
+
}) {
|
|
564
|
+
const { platform, arch, channel } = release;
|
|
565
|
+
return await release.withArchive(release.record(signer), async (archive) => {
|
|
566
|
+
const record = await new UpdatePackUpload(this.cloudApi, this.devProjectId).send(archive, { appName, target, platform, kind: "app", arch, channel, notes }).catch((error) => {
|
|
567
|
+
throw CloudApi.refusal(error, "a release is uploaded by a project member signed in with `akan login`");
|
|
568
|
+
});
|
|
569
|
+
const label = `${appName} ${target} ${platform}-${arch} on channel ${channel}: release ${record.id}`;
|
|
570
|
+
const problems = (record.problems ?? []).map((problem) => ` - ${problem}`).join(`
|
|
571
|
+
`);
|
|
572
|
+
if (record.status === "rejected")
|
|
573
|
+
throw new ExitCodeError(`The project rejected ${label}:
|
|
574
|
+
${problems}`, 2);
|
|
575
|
+
const manifestUrl = typeof record.manifestUrl === "string" ? record.manifestUrl : `${url}/${platform}-${arch}/${channel}.json`;
|
|
576
|
+
const what = `${label} (${release.manifest.bundle}, ${release.payloads.length + 3} files)`;
|
|
577
|
+
Logger2.rawLog(record.status === "published" ? `Published ${what}. Installed apps read ${manifestUrl}.` : `Staged ${what}. Publish it from the project's release screen; installed apps read ${manifestUrl}.`);
|
|
578
|
+
if (problems)
|
|
579
|
+
Logger2.rawLog(`The project noted:
|
|
580
|
+
${problems}`);
|
|
581
|
+
return record;
|
|
582
|
+
});
|
|
583
|
+
}
|
|
553
584
|
async registerBinary(app, pack, { distribution, env }) {
|
|
554
585
|
const { cloudApi, devProjectId } = this;
|
|
555
586
|
const bundlePath = await CloudUpdates.storeBundlePath(app, pack.target, pack.platform);
|
package/index.js
CHANGED
|
@@ -22,18 +22,18 @@ import path from "path";
|
|
|
22
22
|
|
|
23
23
|
// pkgs/@akanjs/cli/commandModules.ts
|
|
24
24
|
var commandModules = {
|
|
25
|
-
workspace: async () => (await import("./workspace.command-
|
|
25
|
+
workspace: async () => (await import("./workspace.command-fmgycnbr.js")).WorkspaceCommand,
|
|
26
26
|
agent: async () => (await import("./agent.command-ydftceda.js")).AgentCommand,
|
|
27
|
-
code: async () => (await import("./code.command-
|
|
28
|
-
application: async () => (await import("./application.command-
|
|
27
|
+
code: async () => (await import("./code.command-719k3e9q.js")).CodeCommand,
|
|
28
|
+
application: async () => (await import("./application.command-fm2yn6hj.js")).ApplicationCommand,
|
|
29
29
|
library: async () => (await import("./library.command-gycrwhf1.js")).LibraryCommand,
|
|
30
|
-
localRegistry: async () => (await import("./localRegistry.command-
|
|
30
|
+
localRegistry: async () => (await import("./localRegistry.command-h924ek5g.js")).LocalRegistryCommand,
|
|
31
31
|
package: async () => (await import("./package.command-shzpcfph.js")).PackageCommand,
|
|
32
32
|
module: async () => (await import("./module.command-v6hgs1bc.js")).ModuleCommand,
|
|
33
33
|
page: async () => (await import("./page.command-ptxn5kqk.js")).PageCommand,
|
|
34
|
-
context: async () => (await import("./context.command-
|
|
35
|
-
cloud: async () => (await import("./cloud.command-
|
|
36
|
-
subspace: async () => (await import("./subspace.command-
|
|
34
|
+
context: async () => (await import("./context.command-c4t4z1vy.js")).ContextCommand,
|
|
35
|
+
cloud: async () => (await import("./cloud.command-ya0evzfq.js")).CloudCommand,
|
|
36
|
+
subspace: async () => (await import("./subspace.command-vem71tr5.js")).SubspaceCommand,
|
|
37
37
|
guideline: async () => (await import("./guideline.command-snh85ctf.js")).GuidelineCommand,
|
|
38
38
|
scalar: async () => (await import("./scalar.command-0acvyp26.js")).ScalarCommand,
|
|
39
39
|
primitive: async () => (await import("./primitive.command-a1vse91z.js")).PrimitiveCommand,
|
|
@@ -41,7 +41,7 @@ var commandModules = {
|
|
|
41
41
|
repair: async () => (await import("./repair.command-cvazbz99.js")).RepairCommand,
|
|
42
42
|
workflow: async () => (await import("./workflow.command-abb1d5xy.js")).WorkflowCommand,
|
|
43
43
|
pipeline: async () => (await import("./pipeline.command-zz31pgax.js")).PipelineCommand,
|
|
44
|
-
tunnel: async () => (await import("./tunnel.command-
|
|
44
|
+
tunnel: async () => (await import("./tunnel.command-vy08ecyp.js")).TunnelCommand
|
|
45
45
|
};
|
|
46
46
|
var commandModuleIds = Object.keys(commandModules);
|
|
47
47
|
|
|
@@ -10,21 +10,21 @@ import {
|
|
|
10
10
|
PkgExecutor
|
|
11
11
|
} from "./index-wcej7g4z.js";
|
|
12
12
|
import"./index-5nd1wtkv.js";
|
|
13
|
-
import"./index-
|
|
13
|
+
import"./index-5max10jx.js";
|
|
14
|
+
import"./index-qd5km521.js";
|
|
14
15
|
import"./index-m9jj544v.js";
|
|
15
|
-
import"./index-ds2tmxgx.js";
|
|
16
16
|
import"./index-xb8809yb.js";
|
|
17
17
|
import"./index-0fz95kxe.js";
|
|
18
18
|
import"./index-2xcc2ax5.js";
|
|
19
19
|
import {
|
|
20
20
|
ApplicationScript
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-pbtzb54h.js";
|
|
22
22
|
import"./index-7md2g9vw.js";
|
|
23
|
-
import"./index-
|
|
23
|
+
import"./index-xy97mqgq.js";
|
|
24
24
|
import {
|
|
25
25
|
getNpmRegistryUrl,
|
|
26
26
|
CloudRunner
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-jh72e64b.js";
|
|
28
28
|
import"./index-tvehn2sp.js";
|
|
29
29
|
import {
|
|
30
30
|
PackageScript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "3.1.1-rc.
|
|
3
|
+
"version": "3.1.1-rc.7",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@earendil-works/pi-tui": "1.3.0",
|
|
40
40
|
"@inquirer/prompts": "^8.7.3",
|
|
41
41
|
"@tailwindcss/node": "^4.3.3",
|
|
42
|
-
"akanjs": "3.1.1-rc.
|
|
42
|
+
"akanjs": "3.1.1-rc.7",
|
|
43
43
|
"chalk": "^6.0.1",
|
|
44
44
|
"commander": "^15.0.0",
|
|
45
45
|
"dayjs": "^1.11.23",
|
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
} from "./index-wcej7g4z.js";
|
|
18
18
|
import {
|
|
19
19
|
GlobalConfig
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-xy97mqgq.js";
|
|
21
21
|
import"./index-m9jj544v.js";
|
|
22
|
-
import"./index-
|
|
22
|
+
import"./index-5max10jx.js";
|
|
23
23
|
import"./index-xb8809yb.js";
|
|
24
24
|
import"./index-0fz95kxe.js";
|
|
25
25
|
import {
|
|
@@ -816,7 +816,7 @@ class SubspaceRunner extends runner("subspace") {
|
|
|
816
816
|
if (!asked)
|
|
817
817
|
return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
|
|
818
818
|
const { libs } = await subspace.slice();
|
|
819
|
-
const { CloudScript } = await import("./cloud.script-
|
|
819
|
+
const { CloudScript } = await import("./cloud.script-zg43jse2.js");
|
|
820
820
|
const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
|
|
821
821
|
host,
|
|
822
822
|
workspaceId,
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
GlobalConfig,
|
|
14
14
|
CloudApi
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-xy97mqgq.js";
|
|
16
16
|
import"./index-m9jj544v.js";
|
|
17
|
-
import"./index-
|
|
17
|
+
import"./index-5max10jx.js";
|
|
18
18
|
import"./index-xb8809yb.js";
|
|
19
19
|
import"./index-0fz95kxe.js";
|
|
20
20
|
import {
|
|
21
21
|
TunnelShare2
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-vah0fgkr.js";
|
|
23
23
|
import {
|
|
24
24
|
writeClipboard
|
|
25
25
|
} from "./index-p6pbz9n5.js";
|
|
@@ -36,9 +36,9 @@ import {
|
|
|
36
36
|
AgentScript
|
|
37
37
|
} from "./index-4vgbysa0.js";
|
|
38
38
|
import"./index-5nd1wtkv.js";
|
|
39
|
-
import"./index-
|
|
39
|
+
import"./index-5max10jx.js";
|
|
40
|
+
import"./index-qd5km521.js";
|
|
40
41
|
import"./index-m9jj544v.js";
|
|
41
|
-
import"./index-ds2tmxgx.js";
|
|
42
42
|
import"./index-xb8809yb.js";
|
|
43
43
|
import"./index-0fz95kxe.js";
|
|
44
44
|
import {
|
|
@@ -46,9 +46,9 @@ import {
|
|
|
46
46
|
} from "./index-2xcc2ax5.js";
|
|
47
47
|
import {
|
|
48
48
|
ApplicationScript
|
|
49
|
-
} from "./index-
|
|
49
|
+
} from "./index-pbtzb54h.js";
|
|
50
50
|
import"./index-7md2g9vw.js";
|
|
51
|
-
import"./index-
|
|
51
|
+
import"./index-xy97mqgq.js";
|
|
52
52
|
import"./index-tvehn2sp.js";
|
|
53
53
|
import {
|
|
54
54
|
PackageScript
|
|
@@ -56,11 +56,11 @@ import {
|
|
|
56
56
|
import {
|
|
57
57
|
getNpmRegistryUrl,
|
|
58
58
|
getLatestPackageVersion
|
|
59
|
-
} from "./index-
|
|
59
|
+
} from "./index-jh72e64b.js";
|
|
60
60
|
import {
|
|
61
61
|
CloudScript2
|
|
62
|
-
} from "./index-
|
|
63
|
-
import"./index-
|
|
62
|
+
} from "./index-hqegmnb5.js";
|
|
63
|
+
import"./index-8w76g4rm.js";
|
|
64
64
|
import"./index-j9vyj3dj.js";
|
|
65
65
|
import"./index-905qdgqp.js";
|
|
66
66
|
import"./index-hmt54t45.js";
|
|
@@ -69,7 +69,7 @@ import"./index-skk9zc1x.js";
|
|
|
69
69
|
import"./index-b70zct19.js";
|
|
70
70
|
import {
|
|
71
71
|
ContextScript
|
|
72
|
-
} from "./index-
|
|
72
|
+
} from "./index-zrte51fn.js";
|
|
73
73
|
import"./index-pcwzkdqb.js";
|
|
74
74
|
|
|
75
75
|
// pkgs/@akanjs/cli/workspace/workspace.runner.ts
|