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

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 (86) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-szbjv4gv.js → CodeAgent-q7a4srt6.js} +2 -2
  3. package/{CodeTui-5nw86ab6.js → CodeTui-ak23dxc9.js} +1 -1
  4. package/{TunnelShare-cwh9ezsm.js → TunnelShare-21mm6dr5.js} +2 -2
  5. package/{agent.command-np1dffkb.js → agent.command-f3gsc1gd.js} +5 -5
  6. package/akanCode.js +2 -2
  7. package/{application.command-fyjy9ryc.js → application.command-3v2d53gd.js} +38 -16
  8. package/{applicationBuildRunner-etrzfwjj.js → applicationBuildRunner-1yaqsrdq.js} +115 -103
  9. package/buildBatch.proc.js +17 -6
  10. package/cloud.command-kk2rwkvw.js +187 -0
  11. package/cloud.script-r7eyfey4.js +20 -0
  12. package/{code.command-hmtx14b2.js → code.command-30sca09d.js} +6 -6
  13. package/commandManifest.json +1 -1
  14. package/{context.command-6aqvdx43.js → context.command-k7eqacq6.js} +13 -13
  15. package/context.runner-hqd1ppqe.js +21 -0
  16. package/{guideline.command-axvf68gc.js → guideline.command-dtczrqpf.js} +2 -2
  17. package/guidelines/agentRule/agentRule.instruction.md +10 -2
  18. package/guidelines/conventions/conventions.instruction.md +68 -25
  19. package/guidelines/cssRule/cssRule.instruction.md +19 -0
  20. package/guidelines/mcpRule/mcpRule.instruction.md +67 -12
  21. package/guidelines/queryRule/queryRule.instruction.md +11 -1
  22. package/guidelines/runtimeRule/runtimeRule.instruction.md +97 -16
  23. package/guidelines/ssrRule/ssrRule.instruction.md +10 -7
  24. package/guidelines/transportRule/transportRule.instruction.md +19 -0
  25. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +6 -6
  26. package/incrementalBuilder.proc.js +25 -4
  27. package/{index-h9ht6s60.js → index-05g3jayg.js} +1 -1
  28. package/{index-j38qkvkk.js → index-0bm04n5g.js} +12 -10
  29. package/{index-g38nhv87.js → index-2etcv0sc.js} +1 -1
  30. package/{index-zyw622y1.js → index-2mx692qq.js} +3 -3
  31. package/{index-jb0hmt3k.js → index-2t4tqd1c.js} +3 -3
  32. package/{index-50wb2a26.js → index-55mynnqs.js} +354 -129
  33. package/{index-q6ft9fkc.js → index-6jjtnhkw.js} +8 -3
  34. package/index-6w0rbr9d.js +68 -0
  35. package/{index-2wc41k5w.js → index-7bymavqk.js} +2 -2
  36. package/{index-krjcg4y6.js → index-aprt7pkz.js} +7 -10
  37. package/{index-1bjkfvm9.js → index-c1x0be5j.js} +2 -2
  38. package/{index-d95tfg3n.js → index-c2yrsxdh.js} +14 -8
  39. package/{index-cb6yc5mb.js → index-c76k723e.js} +2 -2
  40. package/{index-6keyf4sg.js → index-ctanya41.js} +4 -4
  41. package/{index-f4e08ptp.js → index-e0cvze1s.js} +4 -4
  42. package/{index-hp3stk1m.js → index-fm46xrf1.js} +3 -3
  43. package/{index-3xmzr1p1.js → index-gnyf1fqy.js} +2 -2
  44. package/{index-zwd84m0w.js → index-jyv387qw.js} +4 -4
  45. package/{index-senscydg.js → index-k9rrten6.js} +6 -1
  46. package/{index-jk9xnck6.js → index-kjvrq3nc.js} +231 -133
  47. package/{index-xwprn9nr.js → index-nz15k0b6.js} +1 -1
  48. package/{index-61mmsdjg.js → index-p9ystjrp.js} +174 -72
  49. package/index-q958tqqg.js +77 -0
  50. package/{index-50jjwg8y.js → index-qt22xstj.js} +1 -1
  51. package/{index-94s080qm.js → index-r2tpeb3n.js} +127 -1
  52. package/{index-bsv901fd.js → index-rwq3ekqc.js} +7 -7
  53. package/{index-gvpvxdm1.js → index-tn4rpqp1.js} +96 -12
  54. package/{index-1gs9g12n.js → index-v29746vb.js} +4 -4
  55. package/index-ww9bhp67.js +62 -0
  56. package/{index-hxnnfy57.js → index-y8q31011.js} +180 -8
  57. package/index.js +22 -21
  58. package/{library.command-9m2rdwwz.js → library.command-gaga5bmq.js} +3 -3
  59. package/{localRegistry.command-vacc2njh.js → localRegistry.command-9e84e32q.js} +10 -10
  60. package/{module.command-q63dffya.js → module.command-7vpf6db4.js} +5 -5
  61. package/{package.command-y2jh0m99.js → package.command-twmvvf69.js} +3 -3
  62. package/package.json +2 -2
  63. package/{page.command-f3e4cwhh.js → page.command-5asq7fdf.js} +3 -3
  64. package/pipeline.command-d0v38572.js +1334 -0
  65. package/{primitive.command-r4kq75qj.js → primitive.command-dyrs2fm8.js} +6 -6
  66. package/projectTypecheck-cvtkrzp2.js +7 -0
  67. package/{quality.command-f7gzh26z.js → quality.command-6emsqpbg.js} +5 -4
  68. package/{repair.command-0qmyr6qa.js → repair.command-8t6aegv5.js} +5 -5
  69. package/{scalar.command-kddn7av4.js → scalar.command-bnggy1x7.js} +4 -4
  70. package/{subspace.command-j7ayp382.js → subspace.command-f02j5tge.js} +158 -91
  71. package/templates/app/tsconfig.json.template +1 -6
  72. package/templates/appSample/page/task/[taskId]/_index.tsx +2 -2
  73. package/templates/appSample/page/task/[taskId]/edit.tsx +2 -2
  74. package/templates/appSample/page/task/_index.tsx +2 -2
  75. package/templates/crudPages/[__model__Id]/edit/page.tsx +2 -2
  76. package/templates/crudPages/[__model__Id]/page.tsx +3 -3
  77. package/templates/crudPages/page.tsx +2 -2
  78. package/templates/crudSinglePage/page.tsx +3 -3
  79. package/templates/lib/cnst.ts +2 -2
  80. package/templates/lib/sig.ts +3 -3
  81. package/{tunnel.command-b3ymdk4f.js → tunnel.command-9x8nfn75.js} +16 -13
  82. package/{workflow.command-z1srcdfw.js → workflow.command-jx0wag5r.js} +10 -10
  83. package/{workspace.command-17c46dbp.js → workspace.command-cmj6mqyk.js} +58 -28
  84. package/cloud.command-c0rnwy65.js +0 -95
  85. package/cloud.script-6ba8e9v8.js +0 -20
  86. package/context.runner-hnkvv3z3.js +0 -21
@@ -21,9 +21,9 @@ ${databaseModules.map((module) => `export * from "./${module}/${module}.constant
21
21
  ${databaseModules
22
22
  .map((module) => {
23
23
  const names = { Module: capitalize(module) };
24
- return `export const ${module} = ConstantRegistry.buildModel("${module}" as const, ${module}Cnst.${names.Module}Input, ${module}Cnst.${names.Module}Object, ${module}Cnst.${names.Module}, ${module}Cnst.Light${names.Module}, ${module}Cnst.${names.Module}Insight, ${module}Cnst);`;
24
+ return `export const ${module} = ConstantRegistry.buildModel("${module}" as const, ${module}Cnst.${names.Module}Input, ${module}Cnst.${names.Module}Object, ${module}Cnst.${names.Module}, ${module}Cnst.Light${names.Module}, ${module}Cnst.${names.Module}Insight, ${module}Cnst, "${scanInfo.name}");`;
25
25
  })
26
26
  .join("\n")}
27
- ${scalarModules.map((module) => `export const ${module} = ConstantRegistry.buildScalar("${module}" as const, ${module}Cnst.${capitalize(module)}, ${module}Cnst);`).join("\n")}
27
+ ${scalarModules.map((module) => `export const ${module} = ConstantRegistry.buildScalar("${module}" as const, ${module}Cnst.${capitalize(module)}, ${module}Cnst, "${scanInfo.name}");`).join("\n")}
28
28
  `;
29
29
  }
@@ -31,8 +31,8 @@ ${serviceModules.map((module) => `export * from "./_${module}/${module}.signal";
31
31
  ${databaseModules.map(serverSignalClass).join("\n")}
32
32
  ${serviceModules.map(serverSignalClass).join("\n")}
33
33
 
34
- ${databaseModules.map((module) => `export const ${module} = SignalRegistry.registerDatabase("${module}" as const, ${module}Sig.${capitalize(module)}Internal, ${module}Sig.${capitalize(module)}Endpoint, ${module}Sig.${capitalize(module)}Slice, ${capitalize(module)});`).join("\n")}
35
- ${serviceModules.map((module) => `export const ${module} = SignalRegistry.registerService("${module}" as const, ${module}Sig.${capitalize(module)}Internal, ${module}Sig.${capitalize(module)}Endpoint, ${capitalize(module)});`).join("\n")}
34
+ ${databaseModules.map((module) => `export const ${module} = SignalRegistry.registerDatabase("${module}" as const, ${module}Sig.${capitalize(module)}Internal, ${module}Sig.${capitalize(module)}Endpoint, ${module}Sig.${capitalize(module)}Slice, ${capitalize(module)}, "${scanInfo.name}");`).join("\n")}
35
+ ${serviceModules.map((module) => `export const ${module} = SignalRegistry.registerService("${module}" as const, ${module}Sig.${capitalize(module)}Internal, ${module}Sig.${capitalize(module)}Endpoint, ${capitalize(module)}, "${scanInfo.name}");`).join("\n")}
36
36
 
37
37
  export const fetchSignals = [${signalNames.join(", ")}] as const;
38
38
  export type Fetch = FetchClientType<typeof fetchSignals>;
@@ -41,6 +41,6 @@ export const fetch = FetchClient.from(...fetchSignals) as unknown as Fetch;
41
41
  // dictionary key and data instead of answering the original caller with Internal Server Error.
42
42
  fetch.setErrorConstructor(Err);
43
43
 
44
- export const getSerializedSignal = () => fetch.serializedSignal
44
+ export const getSerializedSignal = () => fetch.ownSerializedSignal
45
45
  `;
46
46
  }
@@ -1,21 +1,21 @@
1
1
  // @bun
2
- import"./index-52w0fvh8.js";
3
- import {
4
- GlobalConfig,
5
- CloudApi
6
- } from "./index-94s080qm.js";
7
2
  import {
8
3
  Workspace,
9
4
  runner,
10
5
  script,
11
6
  command
12
- } from "./index-q6ft9fkc.js";
7
+ } from "./index-6jjtnhkw.js";
8
+ import"./index-52w0fvh8.js";
13
9
  import {
14
10
  AppExecutor
15
- } from "./index-50wb2a26.js";
11
+ } from "./index-55mynnqs.js";
12
+ import {
13
+ GlobalConfig,
14
+ CloudApi
15
+ } from "./index-r2tpeb3n.js";
16
16
  import {
17
17
  TunnelShare2
18
- } from "./index-2wc41k5w.js";
18
+ } from "./index-7bymavqk.js";
19
19
  import {
20
20
  writeClipboard
21
21
  } from "./index-p6pbz9n5.js";
@@ -46,8 +46,8 @@ class TunnelRunner extends runner("tunnel") {
46
46
  `));
47
47
  await TunnelRunner.holdUntilInterrupt(() => share.close());
48
48
  }
49
- async list(workspace, host = GlobalConfig.akanCloudHost) {
50
- const api = await CloudApi.fromHost(workspace, host);
49
+ async list(workspace, host) {
50
+ const api = await CloudApi.fromHost(workspace, await GlobalConfig.hostFor(workspace, host));
51
51
  const tunnels = await api.tunnelListInSelf();
52
52
  if (!tunnels.length) {
53
53
  Logger.rawLog("No tunnels are open.");
@@ -56,8 +56,8 @@ class TunnelRunner extends runner("tunnel") {
56
56
  for (const tunnel of tunnels)
57
57
  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}`) : ""}`);
58
58
  }
59
- async stop(code, workspace, host = GlobalConfig.akanCloudHost) {
60
- const api = await CloudApi.fromHost(workspace, host);
59
+ async stop(code, workspace, host) {
60
+ const api = await CloudApi.fromHost(workspace, await GlobalConfig.hostFor(workspace, host));
61
61
  const stopped = await api.revokeTunnel(code);
62
62
  if (stopped)
63
63
  Logger.rawLog(`Stopped ${code}.`);
@@ -115,7 +115,10 @@ class TunnelScript extends script("tunnel", [TunnelRunner]) {
115
115
 
116
116
  // pkgs/@akanjs/cli/tunnel/tunnel.command.ts
117
117
  class TunnelCommand extends command("tunnel", [TunnelScript], ({ public: target }) => ({
118
- 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) {
118
+ 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, {
119
+ desc: "host of the cloud (default: cloud.host of the root akan.config.ts, else Akan Cloud)",
120
+ nullable: true
121
+ }).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) {
119
122
  if (list)
120
123
  return await this.tunnelScript.list(workspace, host);
121
124
  if (stop)
@@ -3,20 +3,20 @@ import {
3
3
  Workspace,
4
4
  script,
5
5
  command
6
- } from "./index-q6ft9fkc.js";
6
+ } from "./index-6jjtnhkw.js";
7
7
  import"./index-52w0fvh8.js";
8
- import"./index-50wb2a26.js";
8
+ import"./index-55mynnqs.js";
9
9
  import"./index-hj6w4ka1.js";
10
- import"./index-h9ht6s60.js";
11
- import"./index-zyw622y1.js";
12
- import"./index-g38nhv87.js";
13
- import"./index-f4e08ptp.js";
14
- import"./index-6keyf4sg.js";
15
- import"./index-hp3stk1m.js";
16
- import"./index-cb6yc5mb.js";
10
+ import"./index-05g3jayg.js";
11
+ import"./index-2mx692qq.js";
12
+ import"./index-2etcv0sc.js";
13
+ import"./index-e0cvze1s.js";
14
+ import"./index-ctanya41.js";
15
+ import"./index-fm46xrf1.js";
16
+ import"./index-c76k723e.js";
17
17
  import {
18
18
  WorkflowRunner
19
- } from "./index-bsv901fd.js";
19
+ } from "./index-rwq3ekqc.js";
20
20
 
21
21
  // pkgs/@akanjs/cli/workflow/workflow.script.ts
22
22
  import { Logger } from "akanjs/common";
@@ -1,17 +1,14 @@
1
1
  // @bun
2
- import {
3
- FileSys2
4
- } from "./index-52w0fvh8.js";
5
- import {
6
- GlobalConfig
7
- } from "./index-94s080qm.js";
8
2
  import {
9
3
  Exec,
10
4
  Workspace,
11
5
  runner,
12
6
  script,
13
7
  command
14
- } from "./index-q6ft9fkc.js";
8
+ } from "./index-6jjtnhkw.js";
9
+ import {
10
+ FileSys2
11
+ } from "./index-52w0fvh8.js";
15
12
  import {
16
13
  extractAgentBlock,
17
14
  collectScopeRecipeSources,
@@ -22,7 +19,7 @@ import {
22
19
  AppExecutor,
23
20
  LibExecutor,
24
21
  PkgExecutor
25
- } from "./index-50wb2a26.js";
22
+ } from "./index-55mynnqs.js";
26
23
  import {
27
24
  countBlocking,
28
25
  formatStyleContract,
@@ -32,45 +29,48 @@ import {
32
29
  collectRecipeSources2,
33
30
  scanRecipes2
34
31
  } from "./index-hj6w4ka1.js";
35
- import"./index-h9ht6s60.js";
36
- import"./index-zyw622y1.js";
32
+ import"./index-05g3jayg.js";
33
+ import"./index-2mx692qq.js";
37
34
  import"./index-zzvvc845.js";
38
35
  import {
39
36
  AgentScript
40
- } from "./index-1gs9g12n.js";
41
- import"./index-senscydg.js";
42
- import"./index-jk9xnck6.js";
37
+ } from "./index-v29746vb.js";
38
+ import"./index-k9rrten6.js";
39
+ import"./index-kjvrq3nc.js";
43
40
  import {
44
41
  LibraryScript
45
- } from "./index-1bjkfvm9.js";
42
+ } from "./index-c1x0be5j.js";
46
43
  import {
47
44
  ApplicationScript
48
- } from "./index-61mmsdjg.js";
45
+ } from "./index-p9ystjrp.js";
49
46
  import"./index-7md2g9vw.js";
47
+ import"./index-r2tpeb3n.js";
50
48
  import"./index-2ahj896a.js";
51
49
  import {
52
50
  PackageScript
53
- } from "./index-3xmzr1p1.js";
51
+ } from "./index-gnyf1fqy.js";
54
52
  import {
55
53
  getNpmRegistryUrl,
56
54
  getLatestPackageVersion
57
- } from "./index-hxnnfy57.js";
55
+ } from "./index-y8q31011.js";
58
56
  import {
59
57
  CloudScript2
60
- } from "./index-gvpvxdm1.js";
61
- import"./index-j38qkvkk.js";
62
- import"./index-hp3stk1m.js";
63
- import"./index-g38nhv87.js";
64
- import"./index-f4e08ptp.js";
65
- import"./index-6keyf4sg.js";
66
- import"./index-cb6yc5mb.js";
67
- import"./index-bsv901fd.js";
58
+ } from "./index-tn4rpqp1.js";
59
+ import"./index-0bm04n5g.js";
60
+ import"./index-fm46xrf1.js";
61
+ import"./index-2etcv0sc.js";
62
+ import"./index-e0cvze1s.js";
63
+ import"./index-ctanya41.js";
64
+ import"./index-c76k723e.js";
65
+ import"./index-rwq3ekqc.js";
68
66
  import {
69
67
  ContextScript
70
- } from "./index-zwd84m0w.js";
71
- import"./index-50jjwg8y.js";
68
+ } from "./index-jyv387qw.js";
69
+ import"./index-qt22xstj.js";
72
70
 
73
71
  // pkgs/@akanjs/cli/workspace/workspace.runner.ts
72
+ import { generateKeyPairSync } from "crypto";
73
+ import { mkdir, writeFile } from "fs/promises";
74
74
  import path from "path";
75
75
 
76
76
  // pkgs/@akanjs/devkit/biomeBase.ts
@@ -95,6 +95,22 @@ var defaultWorkspacePeerDependencies = new Set([
95
95
  var defaultMaxDiagnostics = 200;
96
96
 
97
97
  class WorkspaceRunner extends runner("workspace") {
98
+ async machineKeygen(workspace, out) {
99
+ const file = path.resolve(workspace.workspaceRoot, out);
100
+ const { privateKey, publicKey } = generateKeyPairSync("ed25519");
101
+ await mkdir(path.dirname(file), { recursive: true });
102
+ try {
103
+ await writeFile(file, privateKey.export({ format: "pem", type: "pkcs8" }).toString(), {
104
+ mode: 384,
105
+ flag: "wx"
106
+ });
107
+ } catch (error) {
108
+ if (error.code === "EEXIST")
109
+ throw new Error(`${file} exists; machine-keygen never overwrites a key. Name another file.`);
110
+ throw error;
111
+ }
112
+ return { file, publicKey: publicKey.export({ format: "jwk" }).x ?? "" };
113
+ }
98
114
  async generateAgentRules(workspace, { overwrite = false, cursorRules = true } = {}) {
99
115
  const [appNames] = await workspace.getExecs();
100
116
  const dict = { repoName: workspace.repoName, appName: appNames[0] ?? "app" };
@@ -365,6 +381,12 @@ class WorkspaceScript extends script("workspace", [
365
381
  await this.agentScript.agent(workspace, "install", "agents-md", { force: overwrite });
366
382
  spinner.succeed(`Agent rules ready (${files.length} file${files.length === 1 ? "" : "s"})`);
367
383
  }
384
+ async machineKeygen(workspace, out) {
385
+ const { file, publicKey } = await this.workspaceRunner.machineKeygen(workspace, out);
386
+ Logger.rawLog(`Wrote the private key to ${file} (mode 600). Set it as AKAN_MACHINE_PRIVATE_KEY on the server that issues machine tokens; nothing else needs it.`);
387
+ Logger.rawLog(`A server that only verifies them takes the public key:
388
+ AKAN_MACHINE_PUBLIC_KEY=${publicKey}`);
389
+ }
368
390
  async lint(exec, workspace, { fix = true, maxDiagnostics } = {}) {
369
391
  if (exec instanceof AppExecutor)
370
392
  await this.applicationScript.sync(exec);
@@ -471,10 +493,18 @@ class WorkspaceCommand extends command("workspace", [WorkspaceScript], ({ public
471
493
  lintAll: target({ desc: "Lint and fix code in all apps and libraries" }).option("fix", Boolean, { default: true }).option("maxDiagnostics", Number, maxDiagnosticsOption).with(Workspace).exec(async function(fix, maxDiagnostics, workspace) {
472
494
  await this.workspaceScript.lintAll(workspace, { fix, maxDiagnostics });
473
495
  }),
496
+ machineKeygen: target({
497
+ desc: "Make an Ed25519 key for machine tokens: write the private key to a file, print the public key"
498
+ }).arg("out", String, { desc: "file the private key is written to (mode 600); an existing one is refused" }).with(Workspace).exec(async function(out, workspace) {
499
+ await this.workspaceScript.machineKeygen(workspace, out);
500
+ }),
474
501
  syncAll: target({ desc: "Sync dependencies and configuration for all apps and libraries" }).with(Workspace).exec(async function(workspace) {
475
502
  await this.workspaceScript.syncAll(workspace);
476
503
  }),
477
- init: target({ desc: "Initialize the workspace", runsOnWorkspaceRoot: false }).arg("devProjectId", String, { desc: "the ID of the workspace" }).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(devProjectId, host, workspace) {
504
+ init: target({ desc: "Initialize the workspace", runsOnWorkspaceRoot: false }).arg("devProjectId", String, { desc: "the ID of the workspace" }).option("host", String, {
505
+ desc: "host of the cloud to target (default: cloud.host of the root akan.config.ts, else Akan Cloud)",
506
+ nullable: true
507
+ }).with(Workspace).exec(async function(devProjectId, host, workspace) {
478
508
  await this.workspaceScript.init(devProjectId, workspace, { host });
479
509
  })
480
510
  })) {
@@ -1,95 +0,0 @@
1
- // @bun
2
- import"./index-52w0fvh8.js";
3
- import {
4
- GlobalConfig
5
- } from "./index-94s080qm.js";
6
- import {
7
- Workspace,
8
- command
9
- } from "./index-q6ft9fkc.js";
10
- import"./index-50wb2a26.js";
11
- import {
12
- PlatformTestRun
13
- } from "./index-hxnnfy57.js";
14
- import"./index-senscydg.js";
15
- import"./index-jk9xnck6.js";
16
- import"./index-1bjkfvm9.js";
17
- import"./index-61mmsdjg.js";
18
- import"./index-7md2g9vw.js";
19
- import"./index-2ahj896a.js";
20
- import"./index-3xmzr1p1.js";
21
- import {
22
- CloudScript2
23
- } from "./index-gvpvxdm1.js";
24
- import"./index-50jjwg8y.js";
25
-
26
- // pkgs/@akanjs/cli/cloud/cloud.command.ts
27
- var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
28
- var resolveRegistryUrl = (registry) => registry === "local" ? localRegistryUrl() : undefined;
29
-
30
- class CloudCommand extends command("cloud", [CloudScript2], ({ public: target }) => ({
31
- login: target({ desc: "Login to Akan Cloud services" }).option("host", String, { desc: "host of the cloud", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
32
- await this.cloudScript.login(workspace, host);
33
- }),
34
- logout: target({ desc: "Logout from Akan Cloud services" }).option("host", String, { desc: "host of the cloud", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
35
- await this.cloudScript.logout(workspace, host);
36
- }),
37
- deployAkan: target({ devOnly: true, desc: "Deploy Akan.js framework to cloud (internal use)" }).option("test", Boolean, { desc: "test the deployment", default: true }).option("registry", String, {
38
- desc: "registry target for publishing Akan packages",
39
- ask: "Select a registry target",
40
- enum: [
41
- { label: "local", value: "local" },
42
- { label: "npm", value: "npm" }
43
- ]
44
- }).option("platforms", String, {
45
- desc: "platforms to test on besides this machine, comma-separated: linux, windows (none to skip)",
46
- default: "linux,windows"
47
- }).with(Workspace).exec(async function(test, registry, platforms, workspace) {
48
- await this.cloudScript.deployAkan(workspace, {
49
- test,
50
- registryUrl: resolveRegistryUrl(registry),
51
- platforms: PlatformTestRun.parsePlatforms(platforms)
52
- });
53
- }),
54
- testPlatforms: target({
55
- devOnly: true,
56
- desc: "Run the Akan package suites on Linux (Docker) and Windows (SSH) against a snapshot of this tree"
57
- }).option("platforms", String, {
58
- desc: "platforms to test on, comma-separated: linux, windows",
59
- default: "linux,windows"
60
- }).option("pkgs", String, {
61
- flag: "k",
62
- desc: "packages to test, comma-separated (default: every Akan package)",
63
- nullable: true
64
- }).with(Workspace).exec(async function(platforms, pkgs, workspace) {
65
- await this.cloudScript.testPlatforms(workspace, {
66
- platforms: PlatformTestRun.parsePlatforms(platforms),
67
- pkgs: pkgs?.split(",").map((pkg) => pkg.trim()).filter(Boolean)
68
- });
69
- }),
70
- update: target({ desc: "Update Akan.js framework to the latest version" }).with(Workspace).option("tag", String, {
71
- desc: "tag of the update",
72
- default: "latest",
73
- enum: ["latest", "dev", "canary", "beta", "rc", "alpha"]
74
- }).option("registry", String, {
75
- desc: "registry target for resolving Akan packages",
76
- ask: "Select a registry target",
77
- enum: [
78
- { label: "npm", value: "npm" },
79
- { label: "local", value: "local" }
80
- ],
81
- default: process.env.USE_AKANJS_PKGS === "true" ? undefined : "npm"
82
- }).exec(async function(workspace, tag, registry) {
83
- await this.cloudScript.update(workspace, tag, { registryUrl: resolveRegistryUrl(registry) });
84
- }),
85
- downloadEnv: target({ desc: "Download environment variables from cloud or SCP server" }).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
86
- await this.cloudScript.downloadEnv(workspace, undefined, { host });
87
- }),
88
- uploadEnv: target({ desc: "Upload environment variables to cloud or SCP server" }).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
89
- await this.cloudScript.uploadEnv(workspace, { host });
90
- })
91
- })) {
92
- }
93
- export {
94
- CloudCommand
95
- };
@@ -1,20 +0,0 @@
1
- // @bun
2
- import {
3
- CloudScript2
4
- } from "./index-gvpvxdm1.js";
5
- import"./index-hxnnfy57.js";
6
- import"./index-3xmzr1p1.js";
7
- import"./index-61mmsdjg.js";
8
- import"./index-50jjwg8y.js";
9
- import"./index-1bjkfvm9.js";
10
- import"./index-jk9xnck6.js";
11
- import"./index-94s080qm.js";
12
- import"./index-q6ft9fkc.js";
13
- import"./index-7md2g9vw.js";
14
- import"./index-senscydg.js";
15
- import"./index-50wb2a26.js";
16
- import"./index-2ahj896a.js";
17
- import"./index-52w0fvh8.js";
18
- export {
19
- CloudScript2 as CloudScript
20
- };
@@ -1,21 +0,0 @@
1
- // @bun
2
- import {
3
- ContextRunner2
4
- } from "./index-j38qkvkk.js";
5
- import"./index-bsv901fd.js";
6
- import"./index-cb6yc5mb.js";
7
- import"./index-6keyf4sg.js";
8
- import"./index-hp3stk1m.js";
9
- import"./index-f4e08ptp.js";
10
- import"./index-g38nhv87.js";
11
- import"./index-jk9xnck6.js";
12
- import"./index-zyw622y1.js";
13
- import"./index-h9ht6s60.js";
14
- import"./index-zzvvc845.js";
15
- import"./index-q6ft9fkc.js";
16
- import"./index-50wb2a26.js";
17
- import"./index-hj6w4ka1.js";
18
- import"./index-52w0fvh8.js";
19
- export {
20
- ContextRunner2 as ContextRunner
21
- };