@akanjs/cli 3.0.0-beta.10 → 3.0.0-beta.12

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 (58) hide show
  1. package/.build-stamp +1 -1
  2. package/TunnelShare-sbsaggmb.js +9 -0
  3. package/{abstractCompactor-gmkc0z8j.js → abstractCompactor-bqh31fk5.js} +2 -2
  4. package/{agent.command-0q17pnrs.js → agent.command-7357vxd8.js} +5 -5
  5. package/{application.command-18y0s485.js → application.command-pc8mdn3w.js} +10 -10
  6. package/{applicationBuildRunner-kxwbssgn.js → applicationBuildRunner-4f1wrba0.js} +2 -2
  7. package/{applicationReleasePackager-4yasxwv9.js → applicationReleasePackager-jkjmy5ee.js} +1 -1
  8. package/buildBatch.proc.js +2 -2
  9. package/{capacitorApp-36rbr858.js → capacitorApp-hqvsrec4.js} +2 -2
  10. package/{cloud.command-av97ndh6.js → cloud.command-cawrd5nq.js} +10 -10
  11. package/cloud.script-1bmptvw0.js +20 -0
  12. package/commandManifest.json +1 -1
  13. package/{context.command-5v37ef3n.js → context.command-982b6kdp.js} +14 -14
  14. package/{devTui-m1atgkc9.js → devTui-hmteztv3.js} +4 -24
  15. package/{devTuiView-0hc2emhe.js → devTuiView-40jvjnyz.js} +1 -1
  16. package/{guideline.command-4pz9g1rt.js → guideline.command-jn0vwszx.js} +4 -4
  17. package/guidelines/agentRule/agentRule.instruction.md +69 -0
  18. package/incrementalBuilder.proc.js +1 -1
  19. package/{index-ktb5njgy.js → index-15r9a10e.js} +2 -2
  20. package/{index-vxtad5bd.js → index-1nwxbr2y.js} +2 -2
  21. package/{index-y6n8nmny.js → index-3pvkjza8.js} +10 -10
  22. package/{index-2tv3fdx4.js → index-5nyznra1.js} +1 -0
  23. package/{index-wt7qrtd4.js → index-7f4dsf9v.js} +1 -1
  24. package/{index-ffvk10zz.js → index-8pkvrcv1.js} +3 -3
  25. package/{index-rtxxan88.js → index-8tfmh0v6.js} +5 -5
  26. package/{index-2xp0kfkt.js → index-ay8wj00x.js} +7 -7
  27. package/{index-0g7r8xz3.js → index-b3ae16mg.js} +1 -1
  28. package/{index-m0xccmmm.js → index-bw2marpf.js} +9 -0
  29. package/{index-a17x49vg.js → index-ceph7zqj.js} +3 -3
  30. package/{index-04bk599g.js → index-em4swemt.js} +3 -3
  31. package/{index-5ystnsd5.js → index-fr2x3qvv.js} +5 -5
  32. package/index-jcekapz4.js +49 -0
  33. package/{index-gyd220p2.js → index-jwjaf9fy.js} +1 -1
  34. package/{index-d43r08tf.js → index-kbsach1y.js} +4 -4
  35. package/index-p6pbz9n5.js +25 -0
  36. package/{index-sj5vxr8f.js → index-r8bd61d9.js} +46 -11
  37. package/{index-k2j1hc4r.js → index-s3fvrydw.js} +3 -3
  38. package/{index-vyvre9en.js → index-sh88vtye.js} +1 -1
  39. package/{index-9077wzd2.js → index-t8gvwcrx.js} +2 -2
  40. package/{index-a64esmtb.js → index-vrwdx0zx.js} +1 -1
  41. package/{index-te54x9zm.js → index-yc1keaer.js} +2 -2
  42. package/{index-j9yhg404.js → index-ys7dvdb3.js} +1 -1
  43. package/index.js +20 -19
  44. package/{library.command-qzzbj6d8.js → library.command-1f9h2ex6.js} +3 -3
  45. package/{localRegistry.command-vyrgg4xw.js → localRegistry.command-rx758ajg.js} +9 -9
  46. package/{module.command-rq5hq3ax.js → module.command-c2eve036.js} +7 -7
  47. package/{package.command-d9hd6v9n.js → package.command-y2rh4np7.js} +3 -3
  48. package/package.json +2 -2
  49. package/{page.command-126d56te.js → page.command-e5h29fyt.js} +3 -3
  50. package/{primitive.command-taxd1538.js → primitive.command-c44f7z1s.js} +8 -8
  51. package/{quality.command-6gsna0a3.js → quality.command-5evdd263.js} +2 -2
  52. package/{repair.command-tq2dgy72.js → repair.command-c2amvt74.js} +5 -5
  53. package/{scalar.command-3bcmrrkv.js → scalar.command-xyzerygj.js} +6 -6
  54. package/{subspace.command-eddzqpx3.js → subspace.command-ebfwzypw.js} +5 -5
  55. package/tunnel.command-v6a7at16.js +130 -0
  56. package/{workflow.command-gtdnzvbz.js → workflow.command-t174m6sy.js} +11 -11
  57. package/{workspace.command-06wvstgr.js → workspace.command-bg3eveth.js} +21 -21
  58. package/cloud.script-cm11xjdz.js +0 -20
@@ -3,16 +3,16 @@ import {
3
3
  Workspace,
4
4
  script,
5
5
  command
6
- } from "./index-0g7r8xz3.js";
6
+ } from "./index-b3ae16mg.js";
7
7
  import"./index-q0y2jq9j.js";
8
- import"./index-2tv3fdx4.js";
8
+ import"./index-5nyznra1.js";
9
9
  import"./index-6wwzs1bc.js";
10
10
  import"./index-by5gpp8x.js";
11
- import"./index-gyd220p2.js";
12
- import"./index-ktb5njgy.js";
11
+ import"./index-jwjaf9fy.js";
12
+ import"./index-15r9a10e.js";
13
13
  import {
14
14
  RepairRunner
15
- } from "./index-04bk599g.js";
15
+ } from "./index-em4swemt.js";
16
16
 
17
17
  // pkgs/@akanjs/cli/repair/repair.script.ts
18
18
  import { Logger } from "akanjs/common";
@@ -2,19 +2,19 @@
2
2
  import {
3
3
  Sys,
4
4
  command
5
- } from "./index-0g7r8xz3.js";
5
+ } from "./index-b3ae16mg.js";
6
6
  import"./index-q0y2jq9j.js";
7
- import"./index-2tv3fdx4.js";
7
+ import"./index-5nyznra1.js";
8
8
  import"./index-6wwzs1bc.js";
9
9
  import {
10
10
  renderPrimitiveReport
11
- } from "./index-gyd220p2.js";
12
- import"./index-m0xccmmm.js";
13
- import"./index-te54x9zm.js";
11
+ } from "./index-jwjaf9fy.js";
12
+ import"./index-bw2marpf.js";
13
+ import"./index-yc1keaer.js";
14
14
  import"./index-h7yw2z9n.js";
15
15
  import {
16
16
  ScalarScript
17
- } from "./index-a17x49vg.js";
17
+ } from "./index-ceph7zqj.js";
18
18
 
19
19
  // pkgs/@akanjs/cli/scalar/scalar.command.ts
20
20
  import { Logger, lowerlize } from "akanjs/common";
@@ -4,23 +4,23 @@ import {
4
4
  } from "./index-q0y2jq9j.js";
5
5
  import {
6
6
  GlobalConfig
7
- } from "./index-m0xccmmm.js";
7
+ } from "./index-bw2marpf.js";
8
8
  import {
9
9
  Workspace,
10
10
  CommandContainer,
11
11
  runner,
12
12
  script,
13
13
  command
14
- } from "./index-0g7r8xz3.js";
14
+ } from "./index-b3ae16mg.js";
15
15
  import {
16
16
  Executor,
17
17
  WorkspaceExecutor,
18
18
  AppExecutor
19
- } from "./index-2tv3fdx4.js";
19
+ } from "./index-5nyznra1.js";
20
20
  import"./index-6wwzs1bc.js";
21
21
  import {
22
22
  SlicePlanner
23
- } from "./index-j9yhg404.js";
23
+ } from "./index-ys7dvdb3.js";
24
24
  import {
25
25
  LibSource
26
26
  } from "./index-3d9y066c.js";
@@ -725,7 +725,7 @@ class SubspaceRunner extends runner("subspace") {
725
725
  if (!asked)
726
726
  return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
727
727
  const { libs } = await subspace.slice();
728
- const { CloudScript } = await import("./cloud.script-cm11xjdz.js");
728
+ const { CloudScript } = await import("./cloud.script-1bmptvw0.js");
729
729
  const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
730
730
  host,
731
731
  workspaceId,
@@ -0,0 +1,130 @@
1
+ // @bun
2
+ import"./index-q0y2jq9j.js";
3
+ import {
4
+ GlobalConfig,
5
+ CloudApi
6
+ } from "./index-bw2marpf.js";
7
+ import {
8
+ Workspace,
9
+ runner,
10
+ script,
11
+ command
12
+ } from "./index-b3ae16mg.js";
13
+ import {
14
+ AppExecutor
15
+ } from "./index-5nyznra1.js";
16
+ import"./index-6wwzs1bc.js";
17
+ import {
18
+ TunnelShare2
19
+ } from "./index-jcekapz4.js";
20
+ import {
21
+ writeClipboard
22
+ } from "./index-p6pbz9n5.js";
23
+
24
+ // pkgs/@akanjs/cli/tunnel/tunnel.script.ts
25
+ import { select } from "@inquirer/prompts";
26
+
27
+ // pkgs/@akanjs/cli/tunnel/tunnel.runner.ts
28
+ import { Logger } from "akanjs/common";
29
+ import chalk from "chalk";
30
+ class TunnelRunner extends runner("tunnel") {
31
+ async share(app, options) {
32
+ const spinner = app.spinning("Requesting a tunnel...");
33
+ const share = await TunnelShare2.open(app, {
34
+ ...options,
35
+ onLost: (reason) => Logger.rawLog(`tunnel disconnected (${reason}); reconnecting`, undefined, "error")
36
+ }).catch((error) => {
37
+ spinner.fail("Could not open the tunnel");
38
+ throw error;
39
+ });
40
+ spinner.succeed(`${app.name} is shared`);
41
+ const copied = await writeClipboard(share.url);
42
+ Logger.rawLog(`
43
+ ${chalk.bold(share.url)}${copied ? chalk.dim(" (copied)") : ""}`);
44
+ if (share.grant.expiresAt)
45
+ Logger.rawLog(chalk.dim(` expires ${share.grant.expiresAt}`));
46
+ Logger.rawLog(chalk.dim(` code ${share.grant.code} \u2014 stop it with: akan tunnel --stop ${share.grant.code}
47
+ `));
48
+ await TunnelRunner.holdUntilInterrupt(() => share.close());
49
+ }
50
+ async list(workspace, host = GlobalConfig.akanCloudHost) {
51
+ const api = await CloudApi.fromHost(workspace, host);
52
+ const tunnels = await api.tunnelListInSelf();
53
+ if (!tunnels.length) {
54
+ Logger.rawLog("No tunnels are open.");
55
+ return;
56
+ }
57
+ for (const tunnel of tunnels)
58
+ Logger.rawLog(`${tunnel.connected ? chalk.green("\u25CF") : chalk.dim("\u25CB")} ${tunnel.code} ${tunnel.url}` + `${tunnel.name ? ` ${chalk.dim(tunnel.name)}` : ""}` + `${tunnel.expiresAt ? chalk.dim(` expires ${tunnel.expiresAt}`) : ""}`);
59
+ }
60
+ async stop(code, workspace, host = GlobalConfig.akanCloudHost) {
61
+ const api = await CloudApi.fromHost(workspace, host);
62
+ const stopped = await api.revokeTunnel(code);
63
+ if (stopped)
64
+ Logger.rawLog(`Stopped ${code}.`);
65
+ else
66
+ Logger.rawLog(`No tunnel named ${code} is open.`, undefined, "error");
67
+ }
68
+ static holdUntilInterrupt(onInterrupt) {
69
+ return new Promise((resolve) => {
70
+ let closing = false;
71
+ const stop = () => {
72
+ if (closing) {
73
+ Logger.rawLog("Abandoning the tunnel release; it will expire on its own.", undefined, "error");
74
+ process.exit(130);
75
+ }
76
+ closing = true;
77
+ onInterrupt().then(() => resolve());
78
+ };
79
+ process.on("SIGINT", stop);
80
+ process.on("SIGTERM", stop);
81
+ });
82
+ }
83
+ }
84
+
85
+ // pkgs/@akanjs/cli/tunnel/tunnel.script.ts
86
+ class TunnelScript extends script("tunnel", [TunnelRunner]) {
87
+ static async resolveApp(workspace, name) {
88
+ const appNames = await workspace.getApps();
89
+ if (!appNames.length)
90
+ throw new Error("No apps found in this workspace (apps/<appName>/akan.config.ts)");
91
+ if (name && !appNames.includes(name))
92
+ throw new Error(`Unknown app: ${name}. Available: ${appNames.join(", ")}`);
93
+ if (name)
94
+ return AppExecutor.from(workspace, name);
95
+ const only = appNames.length === 1 ? appNames[0] : null;
96
+ if (only)
97
+ return AppExecutor.from(workspace, only);
98
+ return AppExecutor.from(workspace, await select({ message: "Select the app to share", choices: appNames }));
99
+ }
100
+ async share(name, { workspace, host, port, ttl }) {
101
+ const app = await TunnelScript.resolveApp(workspace, name);
102
+ await this.tunnelRunner.share(app, {
103
+ workspace,
104
+ ...host ? { host } : {},
105
+ ...port ? { port } : {},
106
+ ...ttl ? { ttlMinutes: ttl } : {}
107
+ });
108
+ }
109
+ async list(workspace, host) {
110
+ await this.tunnelRunner.list(workspace, host);
111
+ }
112
+ async stop(code, workspace, host) {
113
+ await this.tunnelRunner.stop(code, workspace, host);
114
+ }
115
+ }
116
+
117
+ // pkgs/@akanjs/cli/tunnel/tunnel.command.ts
118
+ class TunnelCommand extends command("tunnel", [TunnelScript], ({ public: target }) => ({
119
+ tunnel: target({ desc: "Share a locally running app on a public URL" }).arg("app", String, { desc: "app to share", nullable: true }).option("list", Boolean, { desc: "list the shares this account is holding", default: false }).option("stop", String, { desc: "stop the share with this code", default: "" }).option("host", String, { desc: "host of the cloud", default: GlobalConfig.akanCloudHost }).option("port", Number, { desc: "local port to share (default: the app's dev port)", nullable: true }).option("ttl", Number, { desc: "minutes before the share expires", nullable: true }).with(Workspace).exec(async function(app, list, stop, host, port, ttl, workspace) {
120
+ if (list)
121
+ return await this.tunnelScript.list(workspace, host);
122
+ if (stop)
123
+ return await this.tunnelScript.stop(stop, workspace, host);
124
+ await this.tunnelScript.share(app, { workspace, host, ...port ? { port } : {}, ...ttl ? { ttl } : {} });
125
+ })
126
+ })) {
127
+ }
128
+ export {
129
+ TunnelCommand
130
+ };
@@ -3,31 +3,31 @@ import {
3
3
  Workspace,
4
4
  script,
5
5
  command
6
- } from "./index-0g7r8xz3.js";
6
+ } from "./index-b3ae16mg.js";
7
7
  import"./index-q0y2jq9j.js";
8
- import"./index-2tv3fdx4.js";
8
+ import"./index-5nyznra1.js";
9
9
  import"./index-6wwzs1bc.js";
10
10
  import {
11
11
  createWorkflowStepRegistry
12
- } from "./index-gyd220p2.js";
13
- import"./index-m0xccmmm.js";
14
- import"./index-te54x9zm.js";
12
+ } from "./index-jwjaf9fy.js";
13
+ import"./index-bw2marpf.js";
14
+ import"./index-yc1keaer.js";
15
15
  import {
16
16
  ModuleScript
17
- } from "./index-5ystnsd5.js";
18
- import"./index-vyvre9en.js";
17
+ } from "./index-fr2x3qvv.js";
18
+ import"./index-sh88vtye.js";
19
19
  import"./index-h7yw2z9n.js";
20
20
  import {
21
21
  PrimitiveScript
22
- } from "./index-d43r08tf.js";
22
+ } from "./index-kbsach1y.js";
23
23
  import {
24
24
  ScalarScript
25
- } from "./index-a17x49vg.js";
25
+ } from "./index-ceph7zqj.js";
26
26
  import"./index-by5gpp8x.js";
27
- import"./index-ktb5njgy.js";
27
+ import"./index-15r9a10e.js";
28
28
  import {
29
29
  WorkflowRunner
30
- } from "./index-ffvk10zz.js";
30
+ } from "./index-8pkvrcv1.js";
31
31
 
32
32
  // pkgs/@akanjs/cli/workflow/workflow.script.ts
33
33
  import { Logger } from "akanjs/common";
@@ -4,14 +4,14 @@ import {
4
4
  } from "./index-q0y2jq9j.js";
5
5
  import {
6
6
  GlobalConfig
7
- } from "./index-m0xccmmm.js";
7
+ } from "./index-bw2marpf.js";
8
8
  import {
9
9
  Exec,
10
10
  Workspace,
11
11
  runner,
12
12
  script,
13
13
  command
14
- } from "./index-0g7r8xz3.js";
14
+ } from "./index-b3ae16mg.js";
15
15
  import {
16
16
  extractAgentBlock,
17
17
  collectScopeRecipeSources,
@@ -21,7 +21,7 @@ import {
21
21
  AppExecutor,
22
22
  LibExecutor,
23
23
  PkgExecutor
24
- } from "./index-2tv3fdx4.js";
24
+ } from "./index-5nyznra1.js";
25
25
  import"./index-6wwzs1bc.js";
26
26
  import {
27
27
  countBlocking,
@@ -32,42 +32,42 @@ import {
32
32
  collectRecipeSources2,
33
33
  scanRecipes2
34
34
  } from "./index-by5gpp8x.js";
35
- import"./index-gyd220p2.js";
36
- import"./index-ktb5njgy.js";
35
+ import"./index-jwjaf9fy.js";
36
+ import"./index-15r9a10e.js";
37
37
  import"./index-h7yw2z9n.js";
38
38
  import {
39
39
  AgentScript
40
- } from "./index-k2j1hc4r.js";
40
+ } from "./index-s3fvrydw.js";
41
41
  import {
42
42
  ApplicationScript
43
- } from "./index-sj5vxr8f.js";
43
+ } from "./index-r8bd61d9.js";
44
44
  import {
45
45
  LibraryScript
46
- } from "./index-vxtad5bd.js";
46
+ } from "./index-1nwxbr2y.js";
47
47
  import"./index-hwkygn9s.js";
48
- import"./index-te54x9zm.js";
48
+ import"./index-yc1keaer.js";
49
49
  import"./index-kcxmv48c.js";
50
50
  import {
51
51
  PackageScript
52
- } from "./index-9077wzd2.js";
52
+ } from "./index-t8gvwcrx.js";
53
53
  import {
54
54
  getNpmRegistryUrl,
55
55
  getLatestPackageVersion
56
- } from "./index-rtxxan88.js";
56
+ } from "./index-8tfmh0v6.js";
57
57
  import {
58
58
  CloudScript2
59
- } from "./index-2xp0kfkt.js";
59
+ } from "./index-ay8wj00x.js";
60
60
  import {
61
61
  ContextScript
62
- } from "./index-y6n8nmny.js";
63
- import"./index-wt7qrtd4.js";
64
- import"./index-04bk599g.js";
65
- import"./index-ffvk10zz.js";
66
- import"./index-5ystnsd5.js";
67
- import"./index-vyvre9en.js";
68
- import"./index-d43r08tf.js";
69
- import"./index-a17x49vg.js";
70
- import"./index-j9yhg404.js";
62
+ } from "./index-3pvkjza8.js";
63
+ import"./index-7f4dsf9v.js";
64
+ import"./index-em4swemt.js";
65
+ import"./index-8pkvrcv1.js";
66
+ import"./index-fr2x3qvv.js";
67
+ import"./index-sh88vtye.js";
68
+ import"./index-kbsach1y.js";
69
+ import"./index-ceph7zqj.js";
70
+ import"./index-ys7dvdb3.js";
71
71
 
72
72
  // pkgs/@akanjs/cli/workspace/workspace.runner.ts
73
73
  import path from "path";
@@ -1,20 +0,0 @@
1
- // @bun
2
- import {
3
- CloudScript2
4
- } from "./index-2xp0kfkt.js";
5
- import"./index-rtxxan88.js";
6
- import"./index-sj5vxr8f.js";
7
- import"./index-j9yhg404.js";
8
- import"./index-vxtad5bd.js";
9
- import"./index-9077wzd2.js";
10
- import"./index-te54x9zm.js";
11
- import"./index-m0xccmmm.js";
12
- import"./index-0g7r8xz3.js";
13
- import"./index-hwkygn9s.js";
14
- import"./index-2tv3fdx4.js";
15
- import"./index-6wwzs1bc.js";
16
- import"./index-kcxmv48c.js";
17
- import"./index-q0y2jq9j.js";
18
- export {
19
- CloudScript2 as CloudScript
20
- };