@akanjs/cli 3.1.0-rc.0 → 3.1.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-q7a4srt6.js → CodeAgent-kyprmy06.js} +2 -2
  3. package/{CodeTui-ak23dxc9.js → CodeTui-21mtze3j.js} +1 -1
  4. package/{TunnelShare-21mm6dr5.js → TunnelShare-q4jq08qg.js} +2 -2
  5. package/akanCode.js +2 -2
  6. package/{application.command-3v2d53gd.js → application.command-5s780vnz.js} +2 -2
  7. package/{cloud.command-kk2rwkvw.js → cloud.command-yj6xb2a7.js} +12 -7
  8. package/{cloud.script-r7eyfey4.js → cloud.script-h6pvcpa2.js} +5 -5
  9. package/{code.command-30sca09d.js → code.command-3wkn4ja5.js} +4 -4
  10. package/{context.command-k7eqacq6.js → context.command-9jjn3gcw.js} +3 -3
  11. package/{context.runner-hqd1ppqe.js → context.runner-atcrzz5b.js} +2 -2
  12. package/guidelines/conventions/conventions.instruction.md +5 -3
  13. package/guidelines/mcpRule/mcpRule.instruction.md +5 -0
  14. package/{index-kjvrq3nc.js → index-1w2qaee2.js} +9 -0
  15. package/{index-7bymavqk.js → index-56d2g8ms.js} +1 -1
  16. package/{index-y8q31011.js → index-8ggztp8k.js} +35 -11
  17. package/{index-jyv387qw.js → index-8r4d7cmt.js} +1 -1
  18. package/{index-0bm04n5g.js → index-ae5pwhgs.js} +1 -1
  19. package/{index-p9ystjrp.js → index-jx4bzvwg.js} +3 -3
  20. package/{index-2t4tqd1c.js → index-krq7btbt.js} +3 -3
  21. package/{index-r2tpeb3n.js → index-pgj2rt78.js} +17 -5
  22. package/{index-tn4rpqp1.js → index-rc5rwyps.js} +18 -5
  23. package/{index-nz15k0b6.js → index-rtct7d43.js} +1 -1
  24. package/index.js +8 -8
  25. package/{localRegistry.command-9e84e32q.js → localRegistry.command-vsreyy42.js} +4 -4
  26. package/package.json +2 -2
  27. package/{subspace.command-f02j5tge.js → subspace.command-md2teygq.js} +2 -2
  28. package/templates/app/env/env.client.type.ts +2 -3
  29. package/templates/app/page/styles.css.template +8 -0
  30. package/{tunnel.command-9x8nfn75.js → tunnel.command-jx3tdm2d.js} +2 -2
  31. package/{workspace.command-cmj6mqyk.js → workspace.command-yxd7rr7g.js} +7 -7
package/.build-stamp CHANGED
@@ -1 +1 @@
1
- c702579aa15c46bcfdf92573e0c21fe8ac72af8342adcec6e9978bcb7bea6f4b
1
+ ee31653f86d9a17de2cf6fbfbfb3f585db1d135b4d2fa1dceaa1e6faee5fa437
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  CodeAgent2
4
- } from "./index-2t4tqd1c.js";
5
- import"./index-nz15k0b6.js";
4
+ } from "./index-krq7btbt.js";
5
+ import"./index-rtct7d43.js";
6
6
  import"./index-7md2g9vw.js";
7
7
  export {
8
8
  CodeAgent2 as CodeAgent
@@ -4,7 +4,7 @@ import {
4
4
  McpServerConfig,
5
5
  McpTokenStore,
6
6
  McpSignIn
7
- } from "./index-nz15k0b6.js";
7
+ } from "./index-rtct7d43.js";
8
8
  import {
9
9
  CodeTuiLines2,
10
10
  CodeTuiAgents2,
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  TunnelShare2
4
- } from "./index-7bymavqk.js";
5
- import"./index-r2tpeb3n.js";
4
+ } from "./index-56d2g8ms.js";
5
+ import"./index-pgj2rt78.js";
6
6
  import"./index-52w0fvh8.js";
7
7
  export {
8
8
  TunnelShare2 as TunnelShare
package/akanCode.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  CodeMailbox2,
29
29
  CodeSessionFork2,
30
30
  CodeAgent2
31
- } from "./index-2t4tqd1c.js";
31
+ } from "./index-krq7btbt.js";
32
32
  import {
33
33
  akanCodeDefaultModel2,
34
34
  akanCodeModel2,
@@ -39,7 +39,7 @@ import {
39
39
  import {
40
40
  SubagentPool2,
41
41
  akanCodePaths2
42
- } from "./index-nz15k0b6.js";
42
+ } from "./index-rtct7d43.js";
43
43
  import"./index-7md2g9vw.js";
44
44
  import {
45
45
  CodeAgentRpcHost2
@@ -9,12 +9,12 @@ import {
9
9
  } from "./index-6jjtnhkw.js";
10
10
  import"./index-52w0fvh8.js";
11
11
  import"./index-55mynnqs.js";
12
- import"./index-kjvrq3nc.js";
12
+ import"./index-1w2qaee2.js";
13
13
  import"./index-k9rrten6.js";
14
14
  import"./index-c1x0be5j.js";
15
15
  import {
16
16
  ApplicationScript
17
- } from "./index-p9ystjrp.js";
17
+ } from "./index-jx4bzvwg.js";
18
18
  import"./index-7md2g9vw.js";
19
19
  import"./index-qt22xstj.js";
20
20
  import {
@@ -6,20 +6,20 @@ import {
6
6
  } from "./index-6jjtnhkw.js";
7
7
  import"./index-52w0fvh8.js";
8
8
  import"./index-55mynnqs.js";
9
- import"./index-kjvrq3nc.js";
10
- import"./index-r2tpeb3n.js";
9
+ import"./index-1w2qaee2.js";
10
+ import"./index-pgj2rt78.js";
11
11
  import {
12
12
  PlatformTestRun
13
- } from "./index-y8q31011.js";
13
+ } from "./index-8ggztp8k.js";
14
14
  import"./index-k9rrten6.js";
15
15
  import"./index-c1x0be5j.js";
16
- import"./index-p9ystjrp.js";
16
+ import"./index-jx4bzvwg.js";
17
17
  import"./index-7md2g9vw.js";
18
18
  import"./index-2ahj896a.js";
19
19
  import"./index-gnyf1fqy.js";
20
20
  import {
21
21
  CloudScript2
22
- } from "./index-tn4rpqp1.js";
22
+ } from "./index-rc5rwyps.js";
23
23
  import"./index-qt22xstj.js";
24
24
  import {
25
25
  getMobileTargetChoices
@@ -106,7 +106,11 @@ class CloudCommand extends command("cloud", [CloudScript2], ({ public: target })
106
106
  }),
107
107
  pushUpdate: target({
108
108
  desc: "Pack an over-the-air update of a phone's web bundle and upload it to the akasys project, which signs and publishes it"
109
- }).with(App).option("platform", String, { enum: ["ios", "android"], desc: "the app it updates" }).option("target", String, targetOption).option("env", String, envOption).option("channel", String, { desc: "the channel (default: the target's updates.channel)", nullable: true }).option("notes", String, { desc: "release notes shown in the project", nullable: true }).option("subspace", String, { desc: "the subspace whose project gets it", nullable: true }).option("host", String, hostOption).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow packing with --env local", default: false }).with(Workspace).exec(async function(app, platform, target, env, channel, notes, subspace, host, write, allowLocalRelease, workspace) {
109
+ }).with(App).option("platform", String, { enum: ["ios", "android"], desc: "the app it updates" }).option("target", String, targetOption).option("env", String, envOption).option("channel", String, { desc: "the channel (default: the target's updates.channel)", nullable: true }).option("notes", String, { desc: "release notes shown in the project", nullable: true }).option("subspace", String, { desc: "the subspace whose project gets it", nullable: true }).option("host", String, hostOption).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow packing with --env local", default: false }).option("pack", String, {
110
+ flag: "d",
111
+ desc: "a folder `akan pack-update` wrote, uploaded instead of packing",
112
+ nullable: true
113
+ }).with(Workspace).exec(async function(app, platform, target, env, channel, notes, subspace, host, write, allowLocalRelease, pack, workspace) {
110
114
  await this.cloudScript.pushUpdate(workspace, app, {
111
115
  platform,
112
116
  target,
@@ -116,7 +120,8 @@ class CloudCommand extends command("cloud", [CloudScript2], ({ public: target })
116
120
  subspace,
117
121
  host,
118
122
  write,
119
- allowLocalRelease
123
+ allowLocalRelease,
124
+ pack
120
125
  });
121
126
  }),
122
127
  registerBinary: target({
@@ -1,14 +1,14 @@
1
1
  // @bun
2
2
  import {
3
3
  CloudScript2
4
- } from "./index-tn4rpqp1.js";
5
- import"./index-y8q31011.js";
6
- import"./index-p9ystjrp.js";
4
+ } from "./index-rc5rwyps.js";
5
+ import"./index-8ggztp8k.js";
6
+ import"./index-jx4bzvwg.js";
7
7
  import"./index-qt22xstj.js";
8
8
  import"./index-c1x0be5j.js";
9
9
  import"./index-gnyf1fqy.js";
10
- import"./index-kjvrq3nc.js";
11
- import"./index-r2tpeb3n.js";
10
+ import"./index-1w2qaee2.js";
11
+ import"./index-pgj2rt78.js";
12
12
  import"./index-6jjtnhkw.js";
13
13
  import"./index-7md2g9vw.js";
14
14
  import"./index-k9rrten6.js";
@@ -19,7 +19,7 @@ class CodeRunner extends runner("code") {
19
19
  async serve(options, listen) {
20
20
  await import("./consoleToStderr-h5bryj94.js");
21
21
  const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
22
- import("./CodeAgent-q7a4srt6.js"),
22
+ import("./CodeAgent-kyprmy06.js"),
23
23
  import("./CodeAgentRpcHost-p7h6n2hp.js"),
24
24
  import("./CodeAgentRpcListener-7p7z5dd7.js")
25
25
  ]);
@@ -34,8 +34,8 @@ class CodeRunner extends runner("code") {
34
34
  }
35
35
  async tui(options, seed) {
36
36
  const [{ CodeAgent }, { CodeTui }] = await Promise.all([
37
- import("./CodeAgent-q7a4srt6.js"),
38
- import("./CodeTui-ak23dxc9.js")
37
+ import("./CodeAgent-kyprmy06.js"),
38
+ import("./CodeTui-21mtze3j.js")
39
39
  ]);
40
40
  const agentOptions = await CodeRunner.#agentOptions(options, false);
41
41
  let resume = options.resume;
@@ -60,7 +60,7 @@ class CodeRunner extends runner("code") {
60
60
  }
61
61
  }
62
62
  async run(prompt, options) {
63
- const { CodeAgent } = await import("./CodeAgent-q7a4srt6.js");
63
+ const { CodeAgent } = await import("./CodeAgent-kyprmy06.js");
64
64
  const agent = await CodeAgent.create(await CodeRunner.#agentOptions(options, false));
65
65
  const printer = new CodeAgentStreamPrinter2({ json: options.json, thinking: options.thinking });
66
66
  agent.on((event) => printer.print(event));
@@ -8,8 +8,8 @@ import"./index-55mynnqs.js";
8
8
  import"./index-hj6w4ka1.js";
9
9
  import"./index-05g3jayg.js";
10
10
  import"./index-2mx692qq.js";
11
- import"./index-0bm04n5g.js";
12
- import"./index-kjvrq3nc.js";
11
+ import"./index-ae5pwhgs.js";
12
+ import"./index-1w2qaee2.js";
13
13
  import"./index-zzvvc845.js";
14
14
  import"./index-fm46xrf1.js";
15
15
  import"./index-2etcv0sc.js";
@@ -19,7 +19,7 @@ import"./index-c76k723e.js";
19
19
  import"./index-rwq3ekqc.js";
20
20
  import {
21
21
  ContextScript
22
- } from "./index-jyv387qw.js";
22
+ } from "./index-8r4d7cmt.js";
23
23
 
24
24
  // pkgs/@akanjs/cli/context/context.command.ts
25
25
  class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
@@ -1,14 +1,14 @@
1
1
  // @bun
2
2
  import {
3
3
  ContextRunner2
4
- } from "./index-0bm04n5g.js";
4
+ } from "./index-ae5pwhgs.js";
5
5
  import"./index-rwq3ekqc.js";
6
6
  import"./index-c76k723e.js";
7
7
  import"./index-ctanya41.js";
8
8
  import"./index-fm46xrf1.js";
9
9
  import"./index-e0cvze1s.js";
10
10
  import"./index-2etcv0sc.js";
11
- import"./index-kjvrq3nc.js";
11
+ import"./index-1w2qaee2.js";
12
12
  import"./index-2mx692qq.js";
13
13
  import"./index-05g3jayg.js";
14
14
  import"./index-zzvvc845.js";
@@ -842,9 +842,11 @@ it.
842
842
  - **The same page is a tool too, and an MCP Apps host renders it.** A `.prompt()` page answers `tools/call` with
843
843
  that briefing plus its web URL, and a host that declares the `io.modelcontextprotocol/ui` extension (claude.ai,
844
844
  ChatGPT, VS Code) shows the screen itself in the chat — the CSR bundle in a sandboxed iframe whose every call the
845
- host relays under the agent's token. An endpoint kept off the shelf only by `mcp: false` stays callable by that
846
- view and is listed to no model; a `Person` act is still refused there. `option.setMcp({ apps: false })` keeps
847
- pages prompts only, and a page named like an endpoint stays one (boot warns).
845
+ host relays under the agent's token. It shows the page alone: every layout above it still runs (guards, providers,
846
+ `<Agent.Guide>`) and draws nothing, unless it draws no page, as a gate does. Nothing is written for the view. An
847
+ endpoint kept off the shelf only by `mcp: false` stays callable by that view and is listed to no model; a `Person`
848
+ act is still refused there. `option.setMcp({ apps: false })` keeps pages prompts only, and a page named like an
849
+ endpoint stays one (boot warns).
848
850
 
849
851
  Full contract — configuration, wire behaviour, resource URIs, OAuth metadata, protocol revisions, and
850
852
  `McpProgress.report`: `get_guideline` with `mcpRule`, or `akan guideline show mcpRule`.
@@ -379,6 +379,11 @@ call is relayed by the host as `tools/call` under the host's token. Nothing is d
379
379
  - **The capability is read per request.** A legacy client declares it once at `initialize` and is issued an
380
380
  `Mcp-Session-Id` (`ui.<uuid>`) that stores nothing, since its id is the capability; with `modern: true` a modern
381
381
  request carries it in `_meta`. A client that declares nothing is issued no session, exactly as before.
382
+ - **The view is the page, not the app around it.** Each layout above it still runs — guards, providers,
383
+ `<Agent.Guide>` — but what it draws around `{children}` is hidden, with its frame chrome (`Layout.Navbar`,
384
+ `TopInset`, `BottomInset`, `BottomTab`), the `topInset` / `bottomInset` it reserves and the tools its controls
385
+ publish. A layout that draws no page, like a gate, is the screen then and is shown. The screen the view opened on
386
+ has no back button: there is nothing behind it.
382
387
  - **The view has no network.** `connect-src` stays closed; the app's own origin is opened for what a page loads by
383
388
  URL — fonts (served with `Access-Control-Allow-Origin: *`) and stored images — and every root-relative URL the
384
389
  page writes is pointed at it, since a host may block the document's `<base>` (Claude does).
@@ -927,6 +927,15 @@ class NativeApp {
927
927
  await Bun.write(path7.join(pack.out, "pack.json"), `${JSON.stringify(pack, null, 2)}
928
928
  `);
929
929
  }
930
+ static async readPack(dir) {
931
+ const file = Bun.file(path7.join(dir, "pack.json"));
932
+ if (!await file.exists())
933
+ throw new Error(`${dir} holds no pack.json: give the folder \`akan pack-update\` wrote.`);
934
+ const pack = await file.json();
935
+ if (pack.schema !== 1)
936
+ throw new Error(`${dir}/pack.json is schema ${pack.schema}, and this akan reads schema 1.`);
937
+ return { ...pack, out: path7.resolve(dir) };
938
+ }
930
939
  static async compareBundles(appDir, shipped, bundle) {
931
940
  return (await NativeApi.load(appDir)).compareBundles(shipped, bundle);
932
941
  }
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  GlobalConfig,
4
4
  CloudApi
5
- } from "./index-r2tpeb3n.js";
5
+ } from "./index-pgj2rt78.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/tunnel/TunnelShare.ts
8
8
  import { TunnelAgent } from "akanjs/server/tunnel";
@@ -4,7 +4,7 @@ import {
4
4
  GlobalConfig,
5
5
  CloudApi,
6
6
  UpdatePackUpload
7
- } from "./index-r2tpeb3n.js";
7
+ } from "./index-pgj2rt78.js";
8
8
  import {
9
9
  runner
10
10
  } from "./index-6jjtnhkw.js";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./index-55mynnqs.js";
15
15
  import {
16
16
  NativeApp
17
- } from "./index-kjvrq3nc.js";
17
+ } from "./index-1w2qaee2.js";
18
18
  import {
19
19
  SubspaceConfig
20
20
  } from "./index-ww9bhp67.js";
@@ -1151,12 +1151,34 @@ ${run.format(results)}
1151
1151
  });
1152
1152
  Logger.rawLog(removed ? `Removed ${name} for ${branch ? `branch ${branch}` : "every branch"}.` : `No ${name} for ${branch ? `branch ${branch}` : "every branch"} to remove.`);
1153
1153
  }
1154
+ static #packRecords = ["manifest.template.json", "bundle.json", "pack.json", "compat.json"];
1154
1155
  static async#tarPack(pack) {
1155
- const archive = path7.join(os3.tmpdir(), `akan-pack-${pack.app}-${pack.target}-${pack.platform}-${process.pid}.tgz`);
1156
- const tar = Bun.spawn(["tar", "-czf", archive, "-C", pack.out, "."], { stdout: "ignore", stderr: "pipe" });
1157
- if (await tar.exited !== 0)
1158
- throw new Error(`tar of ${pack.out} failed: ${(await new Response(tar.stderr).text()).trim()}`);
1159
- return archive;
1156
+ const templateFile = Bun.file(path7.join(pack.out, "manifest.template.json"));
1157
+ if (!await templateFile.exists())
1158
+ throw new Error(`${pack.out} holds no manifest.template.json: give the folder \`akan pack-update\` wrote.`);
1159
+ const template = await templateFile.json();
1160
+ const hashes = new Set((template.files ?? []).map((file) => file.sha256));
1161
+ if (![...hashes].every((hash) => typeof hash === "string" && /^[0-9a-f]{64}$/.test(hash)))
1162
+ throw new Error(`${pack.out}/manifest.template.json lists a file whose sha256 is not 64 hex digits.`);
1163
+ const present = await Promise.all(CloudRunner.#packRecords.map((name) => Bun.file(path7.join(pack.out, name)).exists()));
1164
+ const entries = [
1165
+ ...CloudRunner.#packRecords.filter((_, idx) => present[idx]),
1166
+ ...[...hashes].map((hash) => `files/${hash}`)
1167
+ ];
1168
+ const base = path7.join(os3.tmpdir(), `akan-pack-${pack.app}-${pack.target}-${pack.platform}-${process.pid}`);
1169
+ await Bun.write(`${base}.list`, entries.map((entry) => `./${entry}
1170
+ `).join(""));
1171
+ try {
1172
+ const tar = Bun.spawn(["tar", "-czf", `${base}.tgz`, "-C", pack.out, "-T", `${base}.list`], {
1173
+ stdout: "ignore",
1174
+ stderr: "pipe"
1175
+ });
1176
+ if (await tar.exited !== 0)
1177
+ throw new Error(`tar of ${pack.out} failed: ${(await new Response(tar.stderr).text()).trim()}`);
1178
+ } finally {
1179
+ await rm(`${base}.list`, { force: true });
1180
+ }
1181
+ return `${base}.tgz`;
1160
1182
  }
1161
1183
  async pushUpdate(cloudApi, devProjectId, pack, { channel, notes }) {
1162
1184
  const archive = await CloudRunner.#tarPack(pack);
@@ -1194,15 +1216,17 @@ ${(release.problems ?? []).map((problem) => ` - ${problem}`).join(`
1194
1216
  if (bundle.nativeApi?.hash !== pack.nativeApi)
1195
1217
  throw new Error(`The store build at ${bundlePath} provides native API ${bundle.nativeApi?.hash}, and this commit's pack needs ${pack.nativeApi}: build the store binary from this commit.`);
1196
1218
  const archive = await CloudRunner.#tarPack(pack);
1219
+ const channel = bundle.updates.channel ?? pack.channel;
1220
+ const upload = new UpdatePackUpload(cloudApi, devProjectId);
1197
1221
  try {
1198
- const binary = await cloudApi.registerAppBinary(devProjectId, {
1222
+ const binary = await upload.stage(archive, { appName: pack.app, target: pack.target, platform: pack.platform, channel, notes: null }).then((packUploadId) => upload.settle(() => cloudApi.registerAppBinary(devProjectId, {
1199
1223
  appName: pack.app,
1200
1224
  target: pack.target,
1201
1225
  distribution,
1202
1226
  bundle: bundleFile,
1203
- pack: Bun.file(archive),
1204
- ...bundle.updates.channel ? { channel: bundle.updates.channel } : {}
1205
- }).catch((error) => {
1227
+ packUploadId,
1228
+ channel
1229
+ }))).catch((error) => {
1206
1230
  throw CloudRunner.#refusal(error, "a binary is registered by a project member signed in with `akan login`");
1207
1231
  });
1208
1232
  Logger.rawLog(`Registered ${pack.app} ${pack.target} ${pack.platform} (${distribution}): binary ${binary.id}, native API ${pack.nativeApi}.`);
@@ -10,7 +10,7 @@ import {
10
10
  } from "./index-6jjtnhkw.js";
11
11
  import {
12
12
  ContextRunner2
13
- } from "./index-0bm04n5g.js";
13
+ } from "./index-ae5pwhgs.js";
14
14
 
15
15
  // pkgs/@akanjs/cli/context/context.script.ts
16
16
  import { Logger } from "akanjs/common";
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  NativeApp,
26
26
  isPlaceholderAppId
27
- } from "./index-kjvrq3nc.js";
27
+ } from "./index-1w2qaee2.js";
28
28
  import {
29
29
  Prompter2
30
30
  } from "./index-zzvvc845.js";
@@ -50,7 +50,7 @@ import {
50
50
  DesktopServerStage,
51
51
  NativeApp,
52
52
  UpdateUploader
53
- } from "./index-kjvrq3nc.js";
53
+ } from "./index-1w2qaee2.js";
54
54
  import {
55
55
  LibraryScript
56
56
  } from "./index-c1x0be5j.js";
@@ -2223,7 +2223,7 @@ try {
2223
2223
  app.logger.info(`runs in the store build of ${against}`);
2224
2224
  return pack;
2225
2225
  }
2226
- app.logger.error(`This bundle needs a new store build; the one ${against} came from provides another native API:
2226
+ app.logger.error(`This bundle needs a new store build; it differs from the one ${against} came from:
2227
2227
  - ${pack.compat.problems.join(`
2228
2228
  - `)}`);
2229
2229
  process.exitCode = 2;
@@ -3593,7 +3593,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
3593
3593
  await Promise.all(shares.map(async (share) => await share.close()));
3594
3594
  }, "Abandoning the tunnel release; the shares expire on their own.");
3595
3595
  await Promise.all(apps.map(async (app) => {
3596
- const { TunnelShare } = await import("./TunnelShare-21mm6dr5.js");
3596
+ const { TunnelShare } = await import("./TunnelShare-q4jq08qg.js");
3597
3597
  const share = await TunnelShare.open(app, { workspace: app.workspace });
3598
3598
  shares.push(share);
3599
3599
  urls.set(app.name, share.url);
@@ -4,7 +4,7 @@ import {
4
4
  akanCodePaths2,
5
5
  McpServerConfig,
6
6
  McpSignIn
7
- } from "./index-nz15k0b6.js";
7
+ } from "./index-rtct7d43.js";
8
8
  import {
9
9
  stripAnsi
10
10
  } from "./index-7md2g9vw.js";
@@ -511,7 +511,7 @@ class AkanToolPack2 {
511
511
  return { name: "akan-tools", factory: async (pi) => await this.#register(pi) };
512
512
  }
513
513
  async names() {
514
- const { ContextRunner } = await import("./context.runner-hqd1ppqe.js");
514
+ const { ContextRunner } = await import("./context.runner-atcrzz5b.js");
515
515
  return [
516
516
  ...new ContextRunner().listMcpTools(this.#options.mode).map((tool) => tool.name),
517
517
  AkanToolPack2.verifyToolName
@@ -519,7 +519,7 @@ class AkanToolPack2 {
519
519
  }
520
520
  static verifyToolName = "akan_verify";
521
521
  async#register(pi) {
522
- const { ContextRunner } = await import("./context.runner-hqd1ppqe.js");
522
+ const { ContextRunner } = await import("./context.runner-atcrzz5b.js");
523
523
  const runner = new ContextRunner;
524
524
  const guidelineNames = await AkanToolPack2.#guidelineNames();
525
525
  for (const tool of runner.listMcpTools(this.#options.mode, { guidelineNames })) {
@@ -262,9 +262,13 @@ class CloudApi {
262
262
  if (binary.channel)
263
263
  formData.append("channel", binary.channel);
264
264
  formData.append("bundle", binary.bundle, "bundle.json");
265
+ if (binary.packUploadId)
266
+ formData.append("packUploadId", binary.packUploadId);
265
267
  if (binary.pack)
266
268
  formData.append("pack", binary.pack, "pack.tgz");
267
- return await this.#api.post(`/registerAppBinary/${encodeURIComponent(devProjectId)}`, formData);
269
+ return await this.#api.post(`/registerAppBinary/${encodeURIComponent(devProjectId)}`, formData, {
270
+ signal: AbortSignal.timeout(11 * 60000)
271
+ });
268
272
  }
269
273
  async downloadEnv(devProjectId) {
270
274
  const localPath = `${this.#workspace.workspaceRoot}/local/env.tar`;
@@ -323,6 +327,10 @@ class UpdatePackUpload {
323
327
  this.#commitLimitMs = commitLimitMs;
324
328
  }
325
329
  async send(archive, fields) {
330
+ const uploadId = await this.stage(archive, fields);
331
+ return await this.settle(() => this.#api.commitUpdateUpload(this.#devProjectId, uploadId));
332
+ }
333
+ async stage(archive, fields) {
326
334
  const file = Bun.file(archive);
327
335
  if (file.size < 1 || file.size > UpdatePackUpload.maxBytes)
328
336
  throw new Error(`The pack archive is ${file.size} bytes; a project takes 1 byte to 200 MiB.`);
@@ -334,7 +342,7 @@ class UpdatePackUpload {
334
342
  const { uploadId, uploadUrl, contentType } = await this.#request(upload);
335
343
  const status = await this.#put(uploadUrl, contentType, file);
336
344
  if (status >= 200 && status < 300)
337
- return await this.#commit(uploadId);
345
+ return uploadId;
338
346
  if (status !== 403 || ticket === 2)
339
347
  throw new Error(`The storage refused the pack upload (${status ? `HTTP ${status}` : "no response"}).`);
340
348
  }
@@ -360,15 +368,15 @@ class UpdatePackUpload {
360
368
  await sleep(this.#putRetryMs * (retry + 1));
361
369
  }
362
370
  }
363
- async#commit(uploadId) {
371
+ async settle(call) {
364
372
  const limit = performance.now() + this.#commitLimitMs;
365
373
  let cutOffSince = null;
366
374
  for (;; ) {
367
375
  try {
368
- return await this.#api.commitUpdateUpload(this.#devProjectId, uploadId);
376
+ return await call();
369
377
  } catch (error) {
370
378
  const now = performance.now();
371
- if (CloudApi.statusOf(error) === 409)
379
+ if (UpdatePackUpload.#inProgress(error))
372
380
  cutOffSince = null;
373
381
  else if (UpdatePackUpload.#cutOff(error))
374
382
  cutOffSince ??= now;
@@ -382,6 +390,10 @@ class UpdatePackUpload {
382
390
  }
383
391
  }
384
392
  }
393
+ static #inProgress(error) {
394
+ const message = error instanceof Error ? error.message : String(error);
395
+ return CloudApi.statusOf(error) === 409 && message.includes("uploadCommitInProgress");
396
+ }
385
397
  static #cutOff(error) {
386
398
  const status = CloudApi.statusOf(error);
387
399
  if (status === null)
@@ -2,22 +2,25 @@
2
2
  import {
3
3
  GlobalConfig,
4
4
  CloudApi
5
- } from "./index-r2tpeb3n.js";
5
+ } from "./index-pgj2rt78.js";
6
6
  import {
7
7
  script
8
8
  } from "./index-6jjtnhkw.js";
9
9
  import {
10
10
  PkgExecutor
11
11
  } from "./index-55mynnqs.js";
12
+ import {
13
+ NativeApp
14
+ } from "./index-1w2qaee2.js";
12
15
  import {
13
16
  ApplicationScript
14
- } from "./index-p9ystjrp.js";
17
+ } from "./index-jx4bzvwg.js";
15
18
  import {
16
19
  PackageScript
17
20
  } from "./index-gnyf1fqy.js";
18
21
  import {
19
22
  CloudRunner
20
- } from "./index-y8q31011.js";
23
+ } from "./index-8ggztp8k.js";
21
24
 
22
25
  // pkgs/@akanjs/cli/cloud/cloud.script.ts
23
26
  import { Logger } from "akanjs/common";
@@ -99,15 +102,25 @@ class CloudScript2 extends script("cloud", [CloudRunner, ApplicationScript, Pack
99
102
  subspace,
100
103
  host: given,
101
104
  write,
102
- allowLocalRelease
105
+ allowLocalRelease,
106
+ pack: packDir
103
107
  }) {
104
108
  const devProjectId = await this.cloudRunner.secretProject(workspace, subspace);
105
- const pack = await this.applicationScript.packUpdate(app, platform, {
109
+ const pack = packDir ? await NativeApp.readPack(packDir) : await this.applicationScript.packUpdate(app, platform, {
106
110
  target,
107
111
  env,
108
112
  write,
109
113
  allowLocalRelease
110
114
  });
115
+ if (pack.app !== app.name || pack.platform !== platform || target && pack.target !== target)
116
+ throw new Error(`The pack in ${pack.out} is ${pack.app} ${pack.target} ${pack.platform}, not ${app.name} ${target ?? pack.target} ${platform}.`);
117
+ if (pack.compat && !pack.compat.compatible) {
118
+ Logger.error(`The pack in ${pack.out} needs a new store build; it differs from the one ${pack.compat.against} came from:
119
+ - ${pack.compat.problems.join(`
120
+ - `)}`);
121
+ process.exitCode = 2;
122
+ return null;
123
+ }
111
124
  const host = await GlobalConfig.hostFor(workspace, given);
112
125
  await this.login(workspace, host);
113
126
  return await this.cloudRunner.pushUpdate(await CloudApi.fromHost(workspace, host), devProjectId, pack, {
@@ -116,7 +116,7 @@ class SubagentPool2 {
116
116
  }
117
117
  }
118
118
  async#run(id, kind, prompt, signal) {
119
- const { CodeAgent } = await import("./CodeAgent-q7a4srt6.js");
119
+ const { CodeAgent } = await import("./CodeAgent-kyprmy06.js");
120
120
  const budget = this.#options.parent.tools.subagent;
121
121
  const child = SubagentPool2.childOf(this.#options.parent, kind);
122
122
  const agent = await CodeAgent.create({
package/index.js CHANGED
@@ -13,18 +13,18 @@ import path from "path";
13
13
 
14
14
  // pkgs/@akanjs/cli/commandModules.ts
15
15
  var commandModules = {
16
- workspace: async () => (await import("./workspace.command-cmj6mqyk.js")).WorkspaceCommand,
16
+ workspace: async () => (await import("./workspace.command-yxd7rr7g.js")).WorkspaceCommand,
17
17
  agent: async () => (await import("./agent.command-f3gsc1gd.js")).AgentCommand,
18
- code: async () => (await import("./code.command-30sca09d.js")).CodeCommand,
19
- application: async () => (await import("./application.command-3v2d53gd.js")).ApplicationCommand,
18
+ code: async () => (await import("./code.command-3wkn4ja5.js")).CodeCommand,
19
+ application: async () => (await import("./application.command-5s780vnz.js")).ApplicationCommand,
20
20
  library: async () => (await import("./library.command-gaga5bmq.js")).LibraryCommand,
21
- localRegistry: async () => (await import("./localRegistry.command-9e84e32q.js")).LocalRegistryCommand,
21
+ localRegistry: async () => (await import("./localRegistry.command-vsreyy42.js")).LocalRegistryCommand,
22
22
  package: async () => (await import("./package.command-twmvvf69.js")).PackageCommand,
23
23
  module: async () => (await import("./module.command-7vpf6db4.js")).ModuleCommand,
24
24
  page: async () => (await import("./page.command-5asq7fdf.js")).PageCommand,
25
- context: async () => (await import("./context.command-k7eqacq6.js")).ContextCommand,
26
- cloud: async () => (await import("./cloud.command-kk2rwkvw.js")).CloudCommand,
27
- subspace: async () => (await import("./subspace.command-f02j5tge.js")).SubspaceCommand,
25
+ context: async () => (await import("./context.command-9jjn3gcw.js")).ContextCommand,
26
+ cloud: async () => (await import("./cloud.command-yj6xb2a7.js")).CloudCommand,
27
+ subspace: async () => (await import("./subspace.command-md2teygq.js")).SubspaceCommand,
28
28
  guideline: async () => (await import("./guideline.command-dtczrqpf.js")).GuidelineCommand,
29
29
  scalar: async () => (await import("./scalar.command-bnggy1x7.js")).ScalarCommand,
30
30
  primitive: async () => (await import("./primitive.command-dyrs2fm8.js")).PrimitiveCommand,
@@ -32,7 +32,7 @@ var commandModules = {
32
32
  repair: async () => (await import("./repair.command-8t6aegv5.js")).RepairCommand,
33
33
  workflow: async () => (await import("./workflow.command-jx0wag5r.js")).WorkflowCommand,
34
34
  pipeline: async () => (await import("./pipeline.command-d0v38572.js")).PipelineCommand,
35
- tunnel: async () => (await import("./tunnel.command-9x8nfn75.js")).TunnelCommand
35
+ tunnel: async () => (await import("./tunnel.command-jx3tdm2d.js")).TunnelCommand
36
36
  };
37
37
  var commandModuleIds = Object.keys(commandModules);
38
38
 
@@ -10,17 +10,17 @@ import {
10
10
  PkgExecutor
11
11
  } from "./index-55mynnqs.js";
12
12
  import"./index-k9rrten6.js";
13
- import"./index-kjvrq3nc.js";
13
+ import"./index-1w2qaee2.js";
14
14
  import"./index-c1x0be5j.js";
15
15
  import {
16
16
  ApplicationScript
17
- } from "./index-p9ystjrp.js";
17
+ } from "./index-jx4bzvwg.js";
18
18
  import"./index-7md2g9vw.js";
19
- import"./index-r2tpeb3n.js";
19
+ import"./index-pgj2rt78.js";
20
20
  import {
21
21
  getNpmRegistryUrl,
22
22
  CloudRunner
23
- } from "./index-y8q31011.js";
23
+ } from "./index-8ggztp8k.js";
24
24
  import"./index-2ahj896a.js";
25
25
  import {
26
26
  PackageScript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.1.0-rc.0",
3
+ "version": "3.1.0-rc.1",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -39,7 +39,7 @@
39
39
  "@earendil-works/pi-tui": "0.86.1",
40
40
  "@inquirer/prompts": "^8.4.3",
41
41
  "@tailwindcss/node": "^4.3.0",
42
- "akanjs": "3.1.0-rc.0",
42
+ "akanjs": "3.1.0-rc.1",
43
43
  "chalk": "^5.6.2",
44
44
  "commander": "^14.0.3",
45
45
  "dayjs": "^1.11.20",
@@ -17,7 +17,7 @@ import {
17
17
  } from "./index-55mynnqs.js";
18
18
  import {
19
19
  GlobalConfig
20
- } from "./index-r2tpeb3n.js";
20
+ } from "./index-pgj2rt78.js";
21
21
  import {
22
22
  SubspaceConfig
23
23
  } from "./index-ww9bhp67.js";
@@ -767,7 +767,7 @@ class SubspaceRunner extends runner("subspace") {
767
767
  if (!asked)
768
768
  return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
769
769
  const { libs } = await subspace.slice();
770
- const { CloudScript } = await import("./cloud.script-r7eyfey4.js");
770
+ const { CloudScript } = await import("./cloud.script-h6pvcpa2.js");
771
771
  const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
772
772
  host,
773
773
  workspaceId,
@@ -5,8 +5,7 @@ interface Dict {
5
5
  }
6
6
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict = {}) {
7
7
  return `
8
- export type AppClientEnv = {
9
- // apply public envs here
10
- };
8
+ // Replace with the public env keys this app reads, e.g. { google?: { mapKey: string } }.
9
+ export type AppClientEnv = Record<never, never>;
11
10
  `;
12
11
  }
@@ -317,3 +317,11 @@
317
317
  margin-block: -0.15em;
318
318
  }
319
319
  }
320
+
321
+ /* A descendant with a surface of its own covers the clipped sugar, so the transparent color it inherits would leave
322
+ it blank. It takes the primary color back; layered under utilities, a text-* class of its own still wins. */
323
+ @layer base {
324
+ .text-primary:not(svg, [class*="bg-"], [class*="jelly"], [class*="glass"], [class*="-current"]) [class*="bg-"]:not([class*="bg-clip"]) {
325
+ color: var(--primary);
326
+ }
327
+ }
@@ -12,10 +12,10 @@ import {
12
12
  import {
13
13
  GlobalConfig,
14
14
  CloudApi
15
- } from "./index-r2tpeb3n.js";
15
+ } from "./index-pgj2rt78.js";
16
16
  import {
17
17
  TunnelShare2
18
- } from "./index-7bymavqk.js";
18
+ } from "./index-56d2g8ms.js";
19
19
  import {
20
20
  writeClipboard
21
21
  } from "./index-p6pbz9n5.js";
@@ -36,15 +36,15 @@ import {
36
36
  AgentScript
37
37
  } from "./index-v29746vb.js";
38
38
  import"./index-k9rrten6.js";
39
- import"./index-kjvrq3nc.js";
39
+ import"./index-1w2qaee2.js";
40
40
  import {
41
41
  LibraryScript
42
42
  } from "./index-c1x0be5j.js";
43
43
  import {
44
44
  ApplicationScript
45
- } from "./index-p9ystjrp.js";
45
+ } from "./index-jx4bzvwg.js";
46
46
  import"./index-7md2g9vw.js";
47
- import"./index-r2tpeb3n.js";
47
+ import"./index-pgj2rt78.js";
48
48
  import"./index-2ahj896a.js";
49
49
  import {
50
50
  PackageScript
@@ -52,11 +52,11 @@ import {
52
52
  import {
53
53
  getNpmRegistryUrl,
54
54
  getLatestPackageVersion
55
- } from "./index-y8q31011.js";
55
+ } from "./index-8ggztp8k.js";
56
56
  import {
57
57
  CloudScript2
58
- } from "./index-tn4rpqp1.js";
59
- import"./index-0bm04n5g.js";
58
+ } from "./index-rc5rwyps.js";
59
+ import"./index-ae5pwhgs.js";
60
60
  import"./index-fm46xrf1.js";
61
61
  import"./index-2etcv0sc.js";
62
62
  import"./index-e0cvze1s.js";
@@ -65,7 +65,7 @@ import"./index-c76k723e.js";
65
65
  import"./index-rwq3ekqc.js";
66
66
  import {
67
67
  ContextScript
68
- } from "./index-jyv387qw.js";
68
+ } from "./index-8r4d7cmt.js";
69
69
  import"./index-qt22xstj.js";
70
70
 
71
71
  // pkgs/@akanjs/cli/workspace/workspace.runner.ts