@akanjs/cli 3.0.0-beta.8 → 3.0.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 (224) hide show
  1. package/.build-stamp +1 -1
  2. package/CodeAgent-2vmp9qe0.js +9 -0
  3. package/CodeAgentRpcHost-p7h6n2hp.js +7 -0
  4. package/CodeAgentRpcListener-7p7z5dd7.js +97 -0
  5. package/CodeTui-5ed6bg2a.js +1457 -0
  6. package/README.ko.md +83 -28
  7. package/README.md +70 -27
  8. package/TunnelShare-cwh9ezsm.js +9 -0
  9. package/{agent.command-0q17pnrs.js → agent.command-gn73rhe7.js} +8 -9
  10. package/akanCode.js +102 -0
  11. package/application.command-e968t0hw.js +246 -0
  12. package/{applicationBuildRunner-kxwbssgn.js → applicationBuildRunner-64taxseg.js} +121 -77
  13. package/buildBatch.proc.js +120 -32
  14. package/cloud.command-0jm301rr.js +95 -0
  15. package/cloud.script-nemnzjpv.js +20 -0
  16. package/code.command-18kcm7hq.js +154 -0
  17. package/commandManifest.json +1 -1
  18. package/consoleToStderr-h5bryj94.js +7 -0
  19. package/context.command-trd9bn18.js +48 -0
  20. package/context.runner-y5hwh673.js +21 -0
  21. package/{dependencyScanner-shs82ynp.js → dependencyScanner-06z2dmrr.js} +2 -2
  22. package/{devTui-m1atgkc9.js → devTui-q7k7bakd.js} +122 -40
  23. package/fileSys-wzzrntkw.js +9 -0
  24. package/guideline.command-bdmdn2de.js +42 -0
  25. package/guidelines/agentRule/agentRule.instruction.md +154 -26
  26. package/guidelines/conventions/conventions.instruction.md +134 -48
  27. package/guidelines/mcpRule/mcpRule.instruction.md +7 -5
  28. package/guidelines/queryRule/queryRule.instruction.md +21 -7
  29. package/guidelines/runtimeRule/runtimeRule.instruction.md +291 -6
  30. package/guidelines/ssrRule/ssrRule.instruction.md +4 -2
  31. package/guidelines/transportRule/transportRule.instruction.md +10 -8
  32. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +20 -0
  33. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +66 -3
  34. package/incrementalBuilder.proc.js +564 -109
  35. package/index-0wpybxtr.js +2729 -0
  36. package/{index-kcxmv48c.js → index-2ahj896a.js} +45 -79
  37. package/index-2wc41k5w.js +49 -0
  38. package/index-3hx1z96c.js +87 -0
  39. package/{index-2tv3fdx4.js → index-3w94e7n3.js} +1228 -1458
  40. package/{index-hwkygn9s.js → index-48k96p55.js} +325 -36
  41. package/index-4npz05nm.js +187 -0
  42. package/{index-q0y2jq9j.js → index-52w0fvh8.js} +21 -4
  43. package/index-6he6gvfg.js +4300 -0
  44. package/index-7md2g9vw.js +6 -0
  45. package/{index-04bk599g.js → index-93j60em0.js} +10 -17
  46. package/index-94s080qm.js +266 -0
  47. package/index-9dp031by.js +12 -0
  48. package/{index-ktb5njgy.js → index-9z771ptz.js} +49 -99
  49. package/{index-y6n8nmny.js → index-abxpehf8.js} +75 -203
  50. package/{index-3d9y066c.js → index-bjwxs904.js} +9 -8
  51. package/{index-9077wzd2.js → index-by9pxkr0.js} +43 -26
  52. package/index-c6eggbee.js +123 -0
  53. package/index-d2242ksy.js +99 -0
  54. package/index-drehwpdt.js +1119 -0
  55. package/{index-92zztqy1.js → index-dy0jx9ay.js} +2 -17
  56. package/{index-ffvk10zz.js → index-f3c78nd6.js} +107 -241
  57. package/index-gbggbqcp.js +1058 -0
  58. package/{index-by5gpp8x.js → index-hj6w4ka1.js} +2 -1
  59. package/index-hsmtysz4.js +53 -0
  60. package/{index-j9yhg404.js → index-jmrn54tt.js} +4 -7
  61. package/{index-a64esmtb.js → index-kcdj1z5v.js} +523 -1022
  62. package/{index-d43r08tf.js → index-kqabytj7.js} +77 -150
  63. package/{index-vyvre9en.js → index-mbxbhay5.js} +6 -2
  64. package/{index-vxtad5bd.js → index-mgxpx3f2.js} +5 -8
  65. package/index-p6pbz9n5.js +25 -0
  66. package/{index-sj5vxr8f.js → index-p993efkq.js} +981 -897
  67. package/{index-2xp0kfkt.js → index-pmhqttv3.js} +37 -25
  68. package/index-tqm7jjcn.js +700 -0
  69. package/{index-0g7r8xz3.js → index-vpj42xwt.js} +114 -232
  70. package/index-wa5jbxj1.js +760 -0
  71. package/{index-k2j1hc4r.js → index-wprnsjms.js} +12 -12
  72. package/{index-gyd220p2.js → index-y3mphr1m.js} +554 -577
  73. package/index-yg7jhz8x.js +69 -0
  74. package/{index-h7yw2z9n.js → index-zzvvc845.js} +8 -14
  75. package/index.js +23 -22
  76. package/{library.command-qzzbj6d8.js → library.command-9h749a1x.js} +4 -5
  77. package/{localRegistry.command-vyrgg4xw.js → localRegistry.command-2bqqhxyz.js} +23 -43
  78. package/{module.command-rq5hq3ax.js → module.command-nv8nzgft.js} +8 -12
  79. package/{package.command-d9hd6v9n.js → package.command-mq4bggp6.js} +6 -7
  80. package/package.json +15 -7
  81. package/{page.command-126d56te.js → page.command-j639n707.js} +4 -5
  82. package/{primitive.command-taxd1538.js → primitive.command-kz6849th.js} +9 -23
  83. package/prompter-76k56b37.js +8 -0
  84. package/{quality.command-6gsna0a3.js → quality.command-4hyabwkb.js} +205 -377
  85. package/{recipeScanner-fpagtgc1.js → recipeScanner-4b69ybe0.js} +1 -1
  86. package/{repair.command-tq2dgy72.js → repair.command-a9awpbqr.js} +11 -35
  87. package/{routeSourceValidator-apyqw7wk.js → routeSourceValidator-7ycnfz0e.js} +0 -6
  88. package/{scalar.command-3bcmrrkv.js → scalar.command-ma4fpm9m.js} +7 -11
  89. package/skills/akan-code/SKILL.md +130 -0
  90. package/skills/akan-debug/SKILL.md +42 -0
  91. package/skills/akan-deps/SKILL.md +50 -0
  92. package/skills/akan-err/SKILL.md +39 -0
  93. package/skills/akan-module/SKILL.md +45 -0
  94. package/skills/akan-scaffold/SKILL.md +76 -0
  95. package/skills/akan-scalar/SKILL.md +52 -0
  96. package/skills/akan-service/SKILL.md +34 -0
  97. package/skills/akan-store/SKILL.md +67 -0
  98. package/skills/akan-ui/SKILL.md +63 -0
  99. package/skills/akan-validate/SKILL.md +44 -0
  100. package/{subspace.command-eddzqpx3.js → subspace.command-3k2pmrs4.js} +53 -62
  101. package/templates/__scalar/__model__/__model__.abstract.md.template +8 -0
  102. package/templates/app/page/_index.tsx +257 -258
  103. package/templates/app/page/_layout.tsx +5 -1
  104. package/templates/app/page/_overrides.tsx +12 -0
  105. package/templates/app/page/styles.css.template +316 -14
  106. package/templates/app/public/apple-touch-icon.png +0 -0
  107. package/templates/app/public/favicon.ico +0 -0
  108. package/templates/app/public/jelly/cloud.webp +0 -0
  109. package/templates/app/public/jelly/comet.webp +0 -0
  110. package/templates/app/public/jelly/moon.webp +0 -0
  111. package/templates/app/public/jelly/planet.webp +0 -0
  112. package/templates/app/public/jelly/rocket.webp +0 -0
  113. package/templates/app/public/jelly/star.webp +0 -0
  114. package/templates/app/public/jelly/sugar.webp +0 -0
  115. package/templates/app/public/logo.png +0 -0
  116. package/templates/app/ui/Recipe/index.ts +9 -0
  117. package/templates/app/ui/Recipe/jellyButton.ts +63 -0
  118. package/templates/appSample/lib/__scalar/workHistory/workHistory.abstract.ts +8 -39
  119. package/templates/appSample/lib/_noti/noti.abstract.ts +6 -29
  120. package/templates/appSample/lib/task/Task.Unit.tsx +1 -1
  121. package/templates/appSample/lib/task/Task.Util.tsx +10 -13
  122. package/templates/appSample/lib/task/Task.View.tsx +2 -2
  123. package/templates/appSample/lib/task/Task.Zone.tsx +5 -2
  124. package/templates/appSample/lib/task/task.abstract.ts +12 -32
  125. package/templates/appSample/lib/task/task.signal.spec.ts +1 -15
  126. package/templates/appSample/lib/task/task.signal.test.ts +15 -1
  127. package/templates/appSample/lib/task/task.signal.ts +10 -8
  128. package/templates/appSample/page/task/[taskId]/_index.tsx +6 -6
  129. package/templates/appSample/page/task/[taskId]/edit.tsx +5 -4
  130. package/templates/appSample/page/task/_index.tsx +4 -3
  131. package/templates/appSample/page/task/_layout.tsx +1 -1
  132. package/templates/appSample/page/task/new.tsx +5 -4
  133. package/templates/appSample/srvkit/{AuthGuard.ts → guards.ts} +7 -4
  134. package/templates/appSample/srvkit/{SessionInternalArg.ts → internalArgs.ts} +6 -4
  135. package/templates/appSample/ui/GlobalLoading.tsx +2 -1
  136. package/templates/appSample/ui/QuantityControl.tsx +3 -3
  137. package/templates/client.ts +7 -30
  138. package/templates/crudPages/[__model__Id]/edit/page.tsx +2 -1
  139. package/templates/crudPages/[__model__Id]/page.tsx +2 -1
  140. package/templates/crudPages/new/page.tsx +2 -1
  141. package/templates/crudPages/page.tsx +2 -1
  142. package/templates/crudSinglePage/page.tsx +2 -1
  143. package/templates/lib/__lib/lib.dictionary.ts +0 -2
  144. package/templates/lib/__lib/lib.document.ts +0 -2
  145. package/templates/lib/sig.ts +8 -30
  146. package/templates/localDev/docker-compose.yaml.template +3 -14
  147. package/templates/module/__model__.signal.ts +12 -4
  148. package/templates/pkgRoot/tsconfig.json.template +2 -7
  149. package/templates/server.ts +1 -3
  150. package/templates/service/__model__.abstract.md.template +8 -0
  151. package/templates/workspaceRoot/.gitignore.template +0 -1
  152. package/templates/workspaceRoot/AGENTS.md.template +6 -0
  153. package/templates/workspaceRoot/package.json.template +1 -3
  154. package/tunnel.command-xwr46b66.js +129 -0
  155. package/{typeChecker-3xgrzc2v.js → typeChecker-px49mezc.js} +1 -1
  156. package/typecheck.proc.js +1 -1
  157. package/workflow.command-t7wqe4h7.js +79 -0
  158. package/{workspace.command-06wvstgr.js → workspace.command-4derhzrh.js} +79 -109
  159. package/abstractCompactor-gmkc0z8j.js +0 -102
  160. package/application.command-18y0s485.js +0 -204
  161. package/applicationReleasePackager-4yasxwv9.js +0 -244
  162. package/capacitorApp-36rbr858.js +0 -12
  163. package/cloud.command-av97ndh6.js +0 -94
  164. package/cloud.script-cm11xjdz.js +0 -20
  165. package/context.command-5v37ef3n.js +0 -81
  166. package/devTuiView-0hc2emhe.js +0 -9
  167. package/getDirname-dr3jz1xg.js +0 -7
  168. package/guideline.command-4pz9g1rt.js +0 -360
  169. package/guidelines/agentRule/agentRule.generate.json +0 -31
  170. package/guidelines/componentRule/componentRule.generate.json +0 -31
  171. package/guidelines/conventions/conventions.generate.json +0 -25
  172. package/guidelines/cssRule/cssRule.generate.json +0 -31
  173. package/guidelines/docPageRule/docPageRule.generate.json +0 -31
  174. package/guidelines/docPageRule/docPageRule.instruction.md +0 -25
  175. package/guidelines/docSyncRule/docSyncRule.generate.json +0 -31
  176. package/guidelines/docSyncRule/docSyncRule.instruction.md +0 -25
  177. package/guidelines/enumConstant/enumConstant.generate.json +0 -31
  178. package/guidelines/enumConstant/enumConstant.instruction.md +0 -28
  179. package/guidelines/fieldRule/fieldRule.generate.json +0 -31
  180. package/guidelines/framework/framework.generate.json +0 -32
  181. package/guidelines/mcpRule/mcpRule.generate.json +0 -35
  182. package/guidelines/modelConstant/modelConstant.generate.json +0 -32
  183. package/guidelines/modelDictionary/modelDictionary.generate.json +0 -32
  184. package/guidelines/modelDocument/modelDocument.generate.json +0 -31
  185. package/guidelines/modelService/modelService.generate.json +0 -31
  186. package/guidelines/modelSignal/modelSignal.generate.json +0 -31
  187. package/guidelines/modelStore/modelStore.generate.json +0 -31
  188. package/guidelines/modelTemplate/modelTemplate.generate.json +0 -31
  189. package/guidelines/modelUnit/modelUnit.generate.json +0 -31
  190. package/guidelines/modelUtil/modelUtil.generate.json +0 -31
  191. package/guidelines/modelView/modelView.generate.json +0 -31
  192. package/guidelines/modelZone/modelZone.generate.json +0 -31
  193. package/guidelines/moduleCodegen/moduleCodegen.generate.json +0 -31
  194. package/guidelines/moduleCodegen/moduleCodegen.instruction.md +0 -28
  195. package/guidelines/moduleOverview/moduleOverview.generate.json +0 -31
  196. package/guidelines/queryRule/queryRule.generate.json +0 -31
  197. package/guidelines/recipeRule/recipeRule.generate.json +0 -31
  198. package/guidelines/runtimeRule/runtimeRule.generate.json +0 -25
  199. package/guidelines/scalarConstant/scalarConstant.generate.json +0 -32
  200. package/guidelines/scalarDictionary/scalarDictionary.generate.json +0 -32
  201. package/guidelines/scalarModule/scalarModule.generate.json +0 -31
  202. package/guidelines/sharedUiUsage/sharedUiUsage.generate.json +0 -31
  203. package/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -25
  204. package/guidelines/ssrRule/ssrRule.generate.json +0 -31
  205. package/guidelines/transportRule/transportRule.generate.json +0 -31
  206. package/guidelines/utilUiUsage/utilUiUsage.generate.json +0 -31
  207. package/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -25
  208. package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +0 -24
  209. package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +0 -33
  210. package/index-47pj3aee.js +0 -76
  211. package/index-5ystnsd5.js +0 -841
  212. package/index-6wwzs1bc.js +0 -7
  213. package/index-a17x49vg.js +0 -229
  214. package/index-m0xccmmm.js +0 -228
  215. package/index-meh558jy.js +0 -65
  216. package/index-rtxxan88.js +0 -471
  217. package/index-te54x9zm.js +0 -338
  218. package/index-w8kmx1b6.js +0 -2176
  219. package/index-wt7qrtd4.js +0 -1516
  220. package/templates/__scalar/__model__/__model__.abstract.md +0 -28
  221. package/templates/module/__model__.abstract.md +0 -28
  222. package/templates/service/__model__.abstract.md +0 -28
  223. package/templates/workspaceRoot/patches/react-dom@19.2.7.patch.template +0 -62
  224. package/workflow.command-gtdnzvbz.js +0 -108
@@ -1,102 +0,0 @@
1
- // @bun
2
- import"./index-q0y2jq9j.js";
3
- import"./index-m0xccmmm.js";
4
- import {
5
- AiSession
6
- } from "./index-te54x9zm.js";
7
- import {
8
- AbstractDoc
9
- } from "./index-meh558jy.js";
10
-
11
- // pkgs/@akanjs/devkit/abstractCompactor.ts
12
- import { Logger } from "akanjs/common";
13
- import chalk from "chalk";
14
- class AbstractCompactor {
15
- static #reviewRequest = `Review the compacted file you just wrote against the original.
16
- - Did you drop an invariant, a security reason, or a workflow step that the source files cannot show by themselves? Restore it.
17
- - Did you keep anything that only restates code, scaffold wording, or history? Remove it.
18
- - Is it in the same language as the original, within the line budget, and one short line per bullet?
19
- Respond with exactly one \`\`\`markdown code block holding the corrected file and nothing else. If nothing needs to change, repeat the file unchanged.`;
20
- #sys;
21
- #minLines;
22
- #interactive;
23
- constructor(sys, { minLines = AbstractDoc.compactMinLines, interactive = false } = {}) {
24
- this.#sys = sys;
25
- this.#minLines = minLines;
26
- this.#interactive = interactive;
27
- }
28
- async compactAll({ module } = {}) {
29
- const docs = await AbstractDoc.findAll(this.#sys, { module });
30
- const targets = docs.filter((doc) => doc.lineCount > this.#minLines);
31
- const reports = [];
32
- for (const doc of targets)
33
- reports.push(await this.compact(doc));
34
- return { scanned: docs.length, reports };
35
- }
36
- async compact(doc) {
37
- const session = new AiSession("compactAbstract", {
38
- workspace: this.#sys.workspace,
39
- cacheKey: `${this.#sys.name}-${doc.moduleName}`
40
- });
41
- const approve = !this.#interactive;
42
- const compacted = await session.editMarkdown(this.#request(doc), { approve });
43
- const reviewed = await session.editMarkdown(AbstractCompactor.#reviewRequest, { approve });
44
- const next = [reviewed, compacted].map((candidate) => candidate.trim()).find((candidate) => doc.canReplaceWith(candidate));
45
- const beforeLines = doc.lineCount;
46
- if (!next) {
47
- Logger.rawLog(chalk.yellow(`${doc.path}: the editor returned no shorter abstract, keeping the current file`));
48
- return { path: doc.path, beforeLines, afterLines: beforeLines, status: "failed" };
49
- }
50
- if (next === doc.content.trim())
51
- return { path: doc.path, beforeLines, afterLines: beforeLines, status: "unchanged" };
52
- const content = `${next}
53
- `;
54
- await this.#sys.writeFile(doc.path, content);
55
- return { path: doc.path, beforeLines, afterLines: AbstractDoc.lineCountOf(content), status: "compacted" };
56
- }
57
- #targetShape(kind) {
58
- if (kind === "other")
59
- return " - keep the headings that still carry information and drop the rest; do not impose a new structure";
60
- return [
61
- " - `# <name> Abstract` title line",
62
- " - one declarative sentence naming what this module owns",
63
- " - `## Rules` \u2014 two to five bullets, each an invariant the code cannot show by itself",
64
- " - optional `## Workflow` \u2014 the lifecycle as an arrow chain (`draft -> signed -> active`) or a few bullets"
65
- ].join(`
66
- `);
67
- }
68
- #request(doc) {
69
- return `You are compacting an Akan.js abstract file.
70
-
71
- An abstract is the summary a coding agent reads before changing a module. Repeated edits have made this one
72
- bloated, and it has to shrink back to what the source files cannot show by themselves.
73
-
74
- # Target file
75
- ${this.#sys.type}s/${this.#sys.name}/${doc.path} (${doc.kind} module "${doc.moduleName}", ${doc.lineCount} lines)
76
-
77
- # Source files in the same folder
78
- ${doc.siblingFiles.join(", ") || "none"}
79
-
80
- # Current content
81
- \`\`\`markdown
82
- ${doc.content}
83
- \`\`\`
84
-
85
- # Rules for the compacted file
86
- - Write it in the SAME language as the current content. Never translate.
87
- - Keep every invariant, constraint, security reason, and workflow step that the source files cannot show by
88
- themselves. Merge duplicates instead of dropping either one.
89
- - Delete what the code already states: field lists, types, labels, signatures, file lists, and imports.
90
- - Delete scaffold and placeholder wording, changelog or migration history, TODOs, and any instruction about
91
- reading or updating this file.
92
- - Never invent a rule that the current content does not state.
93
- - Keep every bullet to one short line, and stay under ${AbstractDoc.compactMinLines} lines in total.
94
- - Shape:
95
- ${this.#targetShape(doc.kind)}
96
-
97
- Respond with exactly one \`\`\`markdown code block holding the whole new file and nothing else.`;
98
- }
99
- }
100
- export {
101
- AbstractCompactor
102
- };
@@ -1,204 +0,0 @@
1
- // @bun
2
- import {
3
- App,
4
- Apps,
5
- Sys,
6
- Exec,
7
- Workspace,
8
- command
9
- } from "./index-0g7r8xz3.js";
10
- import"./index-q0y2jq9j.js";
11
- import"./index-2tv3fdx4.js";
12
- import"./index-6wwzs1bc.js";
13
- import {
14
- ApplicationScript
15
- } from "./index-sj5vxr8f.js";
16
- import"./index-vxtad5bd.js";
17
- import"./index-hwkygn9s.js";
18
- import {
19
- AbstractDoc
20
- } from "./index-meh558jy.js";
21
- import"./index-j9yhg404.js";
22
- import {
23
- getMobileTargetChoices
24
- } from "./index-47pj3aee.js";
25
-
26
- // pkgs/@akanjs/cli/application/application.command.ts
27
- import { select } from "@inquirer/prompts";
28
- var mobileTargetOption = {
29
- desc: "mobile target name or all",
30
- ask: "Select mobile target",
31
- enum: async ({ app }) => await getMobileTargetChoices(app)
32
- };
33
-
34
- class ApplicationCommand extends command("application", [ApplicationScript], ({ public: target }) => ({
35
- createApplication: target({ desc: "Create a new application in the workspace" }).arg("appName", String, { desc: "name of application" }).option("start", Boolean, { desc: "start application", default: false }).with(Workspace).exec(async function(appName, start, workspace) {
36
- await this.applicationScript.createApplication(appName.toLowerCase().replace(/ /g, "-"), workspace, { start });
37
- }),
38
- removeApplication: target({ desc: "Remove an application from the workspace" }).with(App).exec(async function(app) {
39
- await this.applicationScript.removeApplication(app);
40
- }),
41
- planSlice: target({ desc: "List the exact files an app needs to live in a workspace of its own" }).with(App).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).exec(async function(app, format) {
42
- await this.applicationScript.planSlice(app, format);
43
- }),
44
- sync: target({ desc: "Sync dependencies and configuration for an app or library" }).with(Sys).exec(async function(sys) {
45
- await this.applicationScript.sync(sys);
46
- }),
47
- compact: target({ desc: "Compact the *.abstract.md files of an app or library with the AI editor" }).with(Sys).option("module", String, { desc: "single module to compact", nullable: true }).option("minLines", Number, {
48
- flag: "n",
49
- desc: "only compact abstracts longer than this",
50
- default: AbstractDoc.compactMinLines
51
- }).option("interactive", Boolean, { desc: "confirm or refine each rewrite", default: false }).exec(async function(sys, module, minLines, interactive) {
52
- await this.applicationScript.compact(sys, { module, minLines, interactive });
53
- }),
54
- script: target({ desc: "Run a custom script in the application" }).with(App).arg("filename", String, { desc: "name of script", nullable: true }).exec(async function(app, filename) {
55
- await this.applicationScript.script(app, filename);
56
- }),
57
- console: target({ desc: "Open an interactive server console for the application" }).with(App).exec(async function(app) {
58
- await this.applicationScript.console(app);
59
- }),
60
- logs: target({ desc: "Tail the running application's logs, filtered (attaches to akan-control.sock)" }).with(App).option("level", String, { desc: "minimum level: trace, verbose, debug, info, warn, error", nullable: true }).option("grep", String, { desc: "substring the message must contain", nullable: true }).option("endpoint", String, {
61
- desc: "endpoint glob(s), comma-separated: mutation:*, query:userList",
62
- nullable: true
63
- }).option("trace", String, { desc: "one request's traceId", nullable: true }).option("child", String, { desc: "replica index(es), comma-separated", nullable: true }).option("role", String, { flag: "R", desc: "process role(s): gateway, all, batch, rsc-worker", nullable: true }).option("origin", String, { desc: "call origin(s): http, websocket, mcp, internal, page", nullable: true }).option("since", String, { desc: "only records newer than this: 5m, 30s, or epoch ms", nullable: true }).option("replay", Number, { flag: "n", desc: "records to replay from the buffer before following", default: 0 }).option("json", Boolean, { desc: "print NDJSON records instead of rendered lines", default: false }).option("follow", Boolean, { desc: "keep streaming; pass --follow false for history only", default: true }).option("runtimeDir", String, {
64
- flag: "d",
65
- desc: "runtime dir holding akan-control.sock (default: local/apps/<app>/runtime)",
66
- nullable: true
67
- }).exec(async function(app, level, grep, endpoint, trace, child, role, origin, since, replay, json, follow, runtimeDir) {
68
- await this.applicationScript.logs(app, {
69
- level,
70
- grep,
71
- endpoint,
72
- trace,
73
- child,
74
- role,
75
- origin,
76
- since,
77
- replay,
78
- json,
79
- follow,
80
- runtimeDir
81
- });
82
- }),
83
- build: target({ short: true, desc: "Build the application for production (frontend + backend)" }).with(App).option("write", Boolean, { desc: "write code generation", default: true }).option("fast", Boolean, { desc: "fast build", default: false }).option("quiet", Boolean, { desc: "hide build progress output", default: false }).exec(async function(app, write, fast, quiet) {
84
- await this.applicationScript.build(app, { write, fast, quiet });
85
- }),
86
- typecheck: target({ short: true, desc: "Typecheck the application" }).with(App).option("write", Boolean, { desc: "write code generation", default: true }).option("clean", Boolean, { desc: "clear typecheck cache before running", default: false }).option("incremental", Boolean, { desc: "reuse TypeScript incremental cache", default: true }).exec(async function(app, write, clean, incremental) {
87
- await this.applicationScript.typecheck(app, { write, clean, incremental });
88
- }),
89
- test: target({ desc: "Prepare and test an app, library, or package" }).with(Exec).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(exec, write) {
90
- await this.applicationScript.test(exec, { write });
91
- }),
92
- buildIos: target({ short: true, desc: "Build iOS app with Capacitor" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
93
- enum: ["local", "debug", "develop", "main"],
94
- desc: "backend environment",
95
- default: "debug"
96
- }).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).exec(async function(app, target, env, write, regenerate) {
97
- await this.applicationScript.buildIos(app, { target, env, write, regenerate });
98
- }),
99
- buildAndroid: target({ short: true, desc: "Build Android app with Capacitor" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
100
- enum: ["local", "debug", "develop", "main"],
101
- desc: "backend environment",
102
- default: "debug"
103
- }).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).exec(async function(app, target, env, write, regenerate) {
104
- await this.applicationScript.buildAndroid(app, { target, env, write, regenerate });
105
- }),
106
- start: target({ short: true, desc: "Start development server(s) (frontend SSR + backend)" }).with(Apps).option("plain", Boolean, { desc: "print prefixed lines instead of the full-screen view", default: false }).option("kill", Boolean, { flag: "k", desc: "free the dev ports first, whoever is holding them", default: false }).option("concurrency", Number, {
107
- desc: "apps to boot at a time (default: what this machine's memory and cores allow)",
108
- nullable: true
109
- }).option("dbup", Boolean, { desc: "start the local database first", default: true }).option("open", Boolean, { desc: "open web browser?", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(apps, plain, kill, concurrency, dbup, open, write) {
110
- await this.applicationScript.start(apps, { plain, kill, concurrency, dbup, open, write });
111
- }),
112
- startIos: target({ short: true, desc: "Start iOS app in simulator or device" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
113
- enum: ["local", "debug", "develop", "main"],
114
- desc: "backend environment",
115
- default: "local"
116
- }).option("open", Boolean, { desc: "open ios simulator", default: false }).option("release", Boolean, { desc: "release mode", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).option("noAllowProvisioningUpdates", Boolean, {
117
- desc: "disable automatic iOS provisioning updates for physical devices",
118
- default: false
119
- }).option("device", String, {
120
- desc: "run target to select non-interactively: udid, device name, or runtime (e.g. 'iPhone 16' or 'iOS 18')",
121
- default: ""
122
- }).exec(async function(app, target, env, open, release, write, regenerate, noAllowProvisioningUpdates, device) {
123
- await this.applicationScript.startIos(app, {
124
- target,
125
- env,
126
- open,
127
- operation: release ? "release" : "local",
128
- write,
129
- regenerate,
130
- noAllowProvisioningUpdates,
131
- device: device || undefined
132
- });
133
- }),
134
- startAndroid: target({ short: true, desc: "Start Android app in emulator or device" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
135
- enum: ["local", "debug", "develop", "main"],
136
- desc: "backend environment",
137
- default: "local"
138
- }).option("release", Boolean, { desc: "release mode", default: false }).option("open", Boolean, { desc: "open android simulator", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).exec(async function(app, target, env, release, open, write, regenerate) {
139
- await this.applicationScript.startAndroid(app, {
140
- target,
141
- env,
142
- open,
143
- operation: release ? "release" : "local",
144
- write,
145
- regenerate
146
- });
147
- }),
148
- releaseIos: target({ desc: "Build and package iOS app for release (App Store)" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
149
- enum: ["debug", "develop", "main", "local"],
150
- desc: "backend environment",
151
- default: "main"
152
- }).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, target, env, write, regenerate, allowLocalRelease) {
153
- await this.applicationScript.releaseIos(app, {
154
- target,
155
- env,
156
- write,
157
- regenerate,
158
- allowLocalRelease
159
- });
160
- }),
161
- releaseAndroid: target({ desc: "Build and package Android app for release (Play Store)" }).with(App).option("assembleType", String, { enum: ["apk", "aab"], default: "apk" }).option("target", String, mobileTargetOption).option("env", String, {
162
- enum: ["debug", "develop", "main", "local"],
163
- desc: "backend environment",
164
- default: "main"
165
- }).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, assembleType, target, env, write, regenerate, allowLocalRelease) {
166
- await this.applicationScript.releaseAndroid(app, assembleType, {
167
- target,
168
- env,
169
- write,
170
- regenerate,
171
- allowLocalRelease
172
- });
173
- }),
174
- releaseSource: target({ desc: "Release app source code with OTA update support" }).with(App).option("rebuild", Boolean, { desc: "rebuild", default: false }).option("buildNum", Number, { desc: "build number", default: 0 }).option("environment", String, { desc: "environment", default: "debug" }).option("local", Boolean, { desc: "local", default: true }).exec(async function(app, rebuild, buildNum, environment, local) {
175
- await this.applicationScript.releaseSource(app, { rebuild, buildNum, environment, local });
176
- }),
177
- codepush: target({ desc: "Deploy over-the-air (OTA) update for mobile app" }).with(App).exec(async function(app) {
178
- const os = await select({
179
- message: "Select os",
180
- choices: [
181
- { value: "ios", name: "ios", description: "ios" },
182
- { value: "android", name: "android", description: "android" }
183
- ]
184
- });
185
- await this.applicationScript.codepush(app, os);
186
- }),
187
- dbup: target({ desc: "Start local database services for a database mode" }).with(Workspace).option("mode", String, {
188
- desc: "database mode",
189
- default: "multiple",
190
- enum: ["single", "multiple", "cluster"]
191
- }).exec(async function(workspace, mode) {
192
- await this.applicationScript.dbup(workspace, mode);
193
- }),
194
- dbdown: target({ desc: "Stop local database services" }).with(Workspace).exec(async function(workspace) {
195
- await this.applicationScript.dbdown(workspace);
196
- }),
197
- configureApp: target({ desc: "Configure application settings interactively" }).with(App).exec(async function(app) {
198
- await this.applicationScript.configureApp(app);
199
- })
200
- })) {
201
- }
202
- export {
203
- ApplicationCommand
204
- };
@@ -1,244 +0,0 @@
1
- // @bun
2
- import {
3
- FileSys
4
- } from "./index-q0y2jq9j.js";
5
- import {
6
- Spinner
7
- } from "./index-2tv3fdx4.js";
8
-
9
- // pkgs/@akanjs/devkit/applicationReleasePackager.ts
10
- import { cp, mkdir, rm } from "fs/promises";
11
- import path from "path";
12
-
13
- // pkgs/@akanjs/devkit/uploadRelease.ts
14
- import { Logger, RestClient } from "akanjs/common";
15
- var spinning = (message) => {
16
- const spinner = new Spinner(message, { prefix: message, enableSpin: true }).start();
17
- return spinner;
18
- };
19
- var uploadRelease = async (appName, {
20
- workspaceRoot,
21
- environment,
22
- buildNum,
23
- platformVersion,
24
- os,
25
- local
26
- }) => {
27
- const logger = new Logger("uploadRelease");
28
- const basePath = local ? "http://localhost:8282/backend" : "https://cloud.akanjs.com/backend";
29
- const httpClient = new RestClient(basePath);
30
- const buildPath = `${workspaceRoot}/releases/builds/${appName}-release.tar.gz`;
31
- const appBuildPath = `${workspaceRoot}/releases/builds/${appName}-appBuild.zip`;
32
- const sourcePath = `${workspaceRoot}/releases/sources/${appName}-source.tar.gz`;
33
- const readingFilesSpinner = spinning("Reading files...");
34
- try {
35
- const buildFile = Bun.file(buildPath);
36
- const sourceFile = Bun.file(sourcePath);
37
- const appBuildFile = Bun.file(appBuildPath);
38
- const buildStat = { mtime: new Date(buildFile.lastModified), size: buildFile.size };
39
- const sourceStat = { mtime: new Date(sourceFile.lastModified), size: sourceFile.size };
40
- const appBuildStat = { mtime: new Date(appBuildFile.lastModified), size: appBuildFile.size };
41
- readingFilesSpinner.succeed("Reading files... done");
42
- const preparingFormSpinner = spinning("Preparing form data...");
43
- const formData = new FormData;
44
- formData.append("files", buildFile, `${appName}-release.tar.gz`);
45
- formData.append("files", sourceFile, `${appName}-source.tar.gz`);
46
- formData.append("files", appBuildFile, `${appName}-appBuild.zip`);
47
- formData.append("metas", JSON.stringify([
48
- { lastModifiedAt: buildStat.mtime, size: buildStat.size },
49
- { lastModifiedAt: sourceStat.mtime, size: sourceStat.size },
50
- { lastModifiedAt: appBuildStat.mtime, size: appBuildStat.size }
51
- ]));
52
- formData.append("type", "release");
53
- preparingFormSpinner.succeed("Preparing form data... done");
54
- try {
55
- const uploadingFilesSpinner = spinning("Uploading files to server...");
56
- const [buildFile, sourceFile, appBuildFile] = await httpClient.post("/file/addFiles", formData);
57
- uploadingFilesSpinner.succeed("Uploading files to server... done");
58
- const fetchingAppSpinner = spinning(`Fetching dev app information for ${appName}...`);
59
- const major = platformVersion ? parseInt(platformVersion.split(".")[0]) : 1;
60
- const minor = platformVersion ? parseInt(platformVersion.split(".")[1]) : 0;
61
- const patch = platformVersion ? parseInt(platformVersion.split(".")[2]) : 0;
62
- const devApp = await httpClient.get(`/devApp/devAppInName/${appName}`);
63
- fetchingAppSpinner.succeed(`Fetching dev app information for ${appName}... done`);
64
- const pushingReleaseSpinner = spinning(`Pushing release to ${environment} environment...`);
65
- const release = await httpClient.post(`/release/pushRelease/${devApp.id}/${environment}/${major}/${minor}/${patch}/${sourceFile.id}/${buildFile.id}/${appBuildFile.id}${os ? `/${os}` : ""}`);
66
- pushingReleaseSpinner.succeed(`Pushing release to ${environment} environment... done`);
67
- new Spinner(`Successfully pushed release to ${appName}-${environment} server. `, {
68
- prefix: `Successfully pushed release to ${appName}-${environment} server. `,
69
- enableSpin: false
70
- }).succeed(`Successfully pushed release to ${appName}-${environment} server. `);
71
- return release;
72
- } catch (e) {
73
- const errorMessage = e instanceof Error ? e.message : "Unknown error";
74
- logger.error(`Upload release failed: ${errorMessage}`);
75
- return null;
76
- }
77
- } catch (e) {
78
- const errorMessage = e instanceof Error ? e.message : "Unknown error";
79
- readingFilesSpinner.fail(`Reading files failed: ${errorMessage}`);
80
- return null;
81
- }
82
- };
83
-
84
- // pkgs/@akanjs/devkit/applicationReleasePackager.ts
85
- class ApplicationReleasePackager {
86
- #app;
87
- #build;
88
- constructor(app, options) {
89
- this.#app = app;
90
- this.#build = options.build;
91
- }
92
- async releaseSource({
93
- rebuild,
94
- buildNum = 0,
95
- environment = "debug",
96
- local = true
97
- } = {}) {
98
- const { platformVersion } = await this.#prepareReleaseBuild({ rebuild, buildNum });
99
- await this.#writeSourceArchive({ readme: this.#confidentialReadme() });
100
- await uploadRelease(this.#app.name, {
101
- local,
102
- buildNum,
103
- environment,
104
- platformVersion,
105
- workspaceRoot: this.#app.workspace.cwdPath
106
- });
107
- }
108
- async compressProjectFiles({ rebuild, buildNum = 0 } = {}) {
109
- await this.#prepareReleaseBuild({ rebuild, buildNum });
110
- await this.#writeSourceArchive({ readme: this.#publicReadme() });
111
- }
112
- async#prepareReleaseBuild({ rebuild, buildNum }) {
113
- const akanConfig = await this.#app.getConfig();
114
- const platformVersion = akanConfig.mobile.version;
115
- const buildRoot = `${this.#app.workspace.workspaceRoot}/releases/builds/${this.#app.name}`;
116
- if (await FileSys.dirExists(buildRoot))
117
- await rm(buildRoot, { recursive: true, force: true });
118
- await mkdir(buildRoot, { recursive: true });
119
- if (rebuild || !await FileSys.dirExists(`${this.#app.dist.cwdPath}/backend`))
120
- await this.#build();
121
- const buildVersion = `${platformVersion}-${buildNum}`;
122
- const buildPath = `${buildRoot}/${buildVersion}`;
123
- await mkdir(buildPath, { recursive: true });
124
- await cp(`${this.#app.dist.cwdPath}/backend`, `${buildPath}/backend`, { recursive: true });
125
- await cp(this.#app.dist.cwdPath, buildRoot, { recursive: true });
126
- await rm(`${buildRoot}/frontend/.next`, { recursive: true, force: true });
127
- const releaseRoot = this.#app.workspace.workspaceRoot;
128
- const releaseArchivePath = path.relative(releaseRoot, `${releaseRoot}/releases/builds/${this.#app.name}-release.tar.gz`).split(path.sep).join("/");
129
- await this.#app.workspace.spawn("tar", ["-zcf", releaseArchivePath, "-C", buildRoot, "./"], { cwd: releaseRoot });
130
- await this.#writeCsrZipIfPresent();
131
- return { platformVersion };
132
- }
133
- async#writeCsrZipIfPresent() {
134
- if (!await FileSys.dirExists(`${this.#app.dist.cwdPath}/csr`))
135
- return;
136
- await cp(`${this.#app.dist.cwdPath}/csr`, "./csr", { recursive: true });
137
- await this.#app.workspace.spawn("zip", [
138
- "-r",
139
- `${this.#app.workspace.workspaceRoot}/releases/builds/${this.#app.name}-appBuild.zip`,
140
- "./csr"
141
- ]);
142
- await rm("./csr", { recursive: true, force: true });
143
- }
144
- async#writeSourceArchive({ readme }) {
145
- const sourceRoot = `${this.#app.workspace.workspaceRoot}/releases/sources/${this.#app.name}`;
146
- await this.#resetSourceRoot(sourceRoot);
147
- await cp(this.#app.dist.cwdPath, `${sourceRoot}/apps/${this.#app.name}`, { recursive: true });
148
- const libDeps = ["social", "shared", "platform", "util"];
149
- await Promise.all(libDeps.map((lib) => cp(`${this.#app.workspace.cwdPath}/libs/${lib}`, `${sourceRoot}/libs/${lib}`, { recursive: true })));
150
- await Promise.all([".next", "ios", "android", "public/libs"].map(async (path2) => {
151
- const targetPath = `${sourceRoot}/apps/${this.#app.name}/${path2}`;
152
- if (await FileSys.dirExists(targetPath))
153
- await rm(targetPath, { recursive: true, force: true });
154
- }));
155
- const syncPaths = [".husky", ".gitignore", "package.json"];
156
- await Promise.all(syncPaths.map((path2) => cp(`${this.#app.workspace.cwdPath}/${path2}`, `${sourceRoot}/${path2}`, { recursive: true })));
157
- await this.#writeSourceTsconfig(sourceRoot, libDeps);
158
- await Bun.write(`${sourceRoot}/README.md`, readme);
159
- const sourceCwd = this.#app.workspace.cwdPath;
160
- const sourceArchivePath = path.relative(sourceCwd, `${sourceCwd}/releases/sources/${this.#app.name}-source.tar.gz`).split(path.sep).join("/");
161
- await this.#app.workspace.spawn("tar", ["-zcf", sourceArchivePath, "-C", sourceRoot, "./"], { cwd: sourceCwd });
162
- }
163
- async#resetSourceRoot(sourceRoot) {
164
- if (await FileSys.dirExists(sourceRoot)) {
165
- const maxRetry = 3;
166
- for (let i = 0;i < maxRetry; i++) {
167
- try {
168
- await rm(sourceRoot, { recursive: true, force: true });
169
- } catch {}
170
- }
171
- }
172
- await mkdir(sourceRoot, { recursive: true });
173
- }
174
- async#writeSourceTsconfig(sourceRoot, libDeps) {
175
- const tsconfig = await this.#app.workspace.readJson("tsconfig.json");
176
- const pathEntries = [[`@${this.#app.name}/*`, [`apps/${this.#app.name}/*`]]];
177
- for (const lib of libDeps) {
178
- pathEntries.push([`@${lib}`, [`libs/${lib}/index.ts`]], [`@${lib}/*`, [`libs/${lib}/*`]]);
179
- }
180
- tsconfig.compilerOptions.paths = Object.fromEntries(pathEntries);
181
- await Bun.write(`${sourceRoot}/tsconfig.json`, JSON.stringify(tsconfig, null, 2));
182
- }
183
- #confidentialReadme() {
184
- return `# ${this.#app.name}
185
- \uBCF8 \uD504\uB85C\uC81D\uD2B8\uC758 \uC18C\uC2A4\uCF54\uB4DC \uBC0F \uAD00\uB828\uC790\uB8CC\uB294 \uBAA8\uB450 \uBE44\uBC00\uC815\uBCF4\uB85C \uAD00\uB9AC\uB429\uB2C8\uB2E4.
186
-
187
- ## Get Started
188
- Run the code below.
189
- \`\`\`
190
- bun install -g bun
191
- bun i
192
-
193
- cat <<EOF >> .env
194
- # ENV For Server => debug | debug.local | develop | develop.local | main | main.local
195
- SERVER_ENV=debug.local
196
- # Run Mode For Server => federation | batch | all
197
- SERVER_MODE=federation
198
- # ENV For Client => debug | debug.local | develop | develop.local | main | main.local
199
- AKAN_PUBLIC_CLIENT_ENV=debug.local
200
- ANALYZE=false
201
- EOF
202
-
203
- akn start-backend ${this.#app.name}
204
- # or akn start-frontend ${this.#app.name}, etc
205
- \`\`\`
206
-
207
- ## Build
208
- Run the code below.
209
- \`\`\`
210
- akn build-backend ${this.#app.name}
211
- # or akn build-frontend ${this.#app.name}, etc
212
- \`\`\`
213
- `;
214
- }
215
- #publicReadme() {
216
- return `# ${this.#app.name}
217
- ## Get Started
218
- Run the code below.
219
- \`\`\`
220
- cat <<EOF >> .env
221
- # ENV For Server => debug | debug.local | develop | develop.local | main | main.local
222
- SERVER_ENV=debug.local
223
- # Run Mode For Server => federation | batch | all
224
- SERVER_MODE=federation
225
- # ENV For Client => debug | debug.local | develop | develop.local | main | main.local
226
- AKAN_PUBLIC_CLIENT_ENV=debug.local
227
- ANALYZE=false
228
- EOF
229
-
230
- akan start ${this.#app.name}
231
- \`\`\`
232
-
233
- ## Build
234
- Run the code below.
235
- \`\`\`
236
- akan build ${this.#app.name}
237
- # or akn build-frontend ${this.#app.name}, etc
238
- \`\`\`
239
- `;
240
- }
241
- }
242
- export {
243
- ApplicationReleasePackager
244
- };
@@ -1,12 +0,0 @@
1
- // @bun
2
- import {
3
- isPlaceholderAppId2,
4
- CapacitorApp2
5
- } from "./index-wt7qrtd4.js";
6
- import"./index-2tv3fdx4.js";
7
- import"./index-6wwzs1bc.js";
8
- import"./index-q0y2jq9j.js";
9
- export {
10
- CapacitorApp2 as CapacitorApp,
11
- isPlaceholderAppId2 as isPlaceholderAppId
12
- };
@@ -1,94 +0,0 @@
1
- // @bun
2
- import"./index-q0y2jq9j.js";
3
- import {
4
- GlobalConfig
5
- } from "./index-m0xccmmm.js";
6
- import {
7
- Workspace,
8
- command
9
- } from "./index-0g7r8xz3.js";
10
- import"./index-2tv3fdx4.js";
11
- import"./index-6wwzs1bc.js";
12
- import"./index-te54x9zm.js";
13
- import"./index-sj5vxr8f.js";
14
- import"./index-vxtad5bd.js";
15
- import"./index-hwkygn9s.js";
16
- import"./index-kcxmv48c.js";
17
- import"./index-9077wzd2.js";
18
- import"./index-rtxxan88.js";
19
- import {
20
- CloudScript2
21
- } from "./index-2xp0kfkt.js";
22
- import"./index-j9yhg404.js";
23
-
24
- // pkgs/@akanjs/cli/cloud/cloud.command.ts
25
- var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
26
- var resolveRegistryUrl = (registry) => registry === "local" ? localRegistryUrl() : undefined;
27
-
28
- class CloudCommand extends command("cloud", [CloudScript2], ({ public: target }) => ({
29
- 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) {
30
- await this.cloudScript.login(workspace, host);
31
- }),
32
- 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) {
33
- await this.cloudScript.logout(workspace, host);
34
- }),
35
- setLlm: target({ desc: "Configure LLM (Large Language Model) API key" }).with(Workspace).exec(async function(workspace) {
36
- await this.cloudScript.setLlm(workspace);
37
- }),
38
- resetLlm: target({ desc: "Reset LLM configuration to default" }).with(Workspace).exec(function(workspace) {
39
- this.cloudScript.resetLlm(workspace);
40
- }),
41
- ask: target({
42
- devOnly: true,
43
- desc: "Ask AI assistant a question about your project"
44
- }).option("question", String, { ask: "question to ask" }).with(Workspace).exec(async function(question, workspace) {
45
- await this.cloudScript.ask(question, workspace);
46
- }),
47
- deployAkan: target({
48
- devOnly: true,
49
- desc: "Deploy Akan.js framework to cloud (internal use)"
50
- }).option("test", Boolean, { desc: "test the deployment", default: true }).option("registry", String, {
51
- desc: "registry target for publishing Akan packages",
52
- ask: "Select a registry target",
53
- enum: [
54
- { label: "local", value: "local" },
55
- { label: "npm", value: "npm" }
56
- ]
57
- }).with(Workspace).exec(async function(test, registry, workspace) {
58
- await this.cloudScript.deployAkan(workspace, {
59
- test,
60
- registryUrl: resolveRegistryUrl(registry)
61
- });
62
- }),
63
- update: target({ desc: "Update Akan.js framework to the latest version" }).with(Workspace).option("tag", String, {
64
- desc: "tag of the update",
65
- default: "latest",
66
- enum: ["latest", "dev", "canary", "beta", "rc", "alpha"]
67
- }).option("registry", String, {
68
- desc: "registry target for resolving Akan packages",
69
- ask: "Select a registry target",
70
- enum: [
71
- { label: "npm", value: "npm" },
72
- { label: "local", value: "local" }
73
- ],
74
- default: process.env.USE_AKANJS_PKGS === "true" ? undefined : "npm"
75
- }).exec(async function(workspace, tag, registry) {
76
- await this.cloudScript.update(workspace, tag, {
77
- registryUrl: resolveRegistryUrl(registry)
78
- });
79
- }),
80
- downloadEnv: target({
81
- desc: "Download environment variables from cloud or SCP server"
82
- }).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
83
- await this.cloudScript.downloadEnv(workspace, undefined, { host });
84
- }),
85
- uploadEnv: target({
86
- desc: "Upload environment variables to cloud or SCP server"
87
- }).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
88
- await this.cloudScript.uploadEnv(workspace, { host });
89
- })
90
- })) {
91
- }
92
- export {
93
- CloudCommand
94
- };