@akanjs/cli 3.0.0-beta.19 → 3.0.0-beta.20

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 (95) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-6cm97kay.js → CodeAgent-awv258wb.js} +2 -2
  3. package/{CodeTui-za4jsm41.js → CodeTui-1nqh35ez.js} +20 -22
  4. package/TunnelShare-scf4e4pd.js +9 -0
  5. package/{agent.command-e0wpbbyg.js → agent.command-1s9ag7sb.js} +8 -9
  6. package/akanCode.js +4 -4
  7. package/{application.command-8wyxqc8q.js → application.command-49hwy6va.js} +25 -56
  8. package/{applicationBuildRunner-n9gzaxd0.js → applicationBuildRunner-ybyp97pv.js} +33 -59
  9. package/{applicationReleasePackager-vpggfqgq.js → applicationReleasePackager-esnrphw8.js} +40 -60
  10. package/buildBatch.proc.js +19 -24
  11. package/{capacitorApp-q3z0qht0.js → capacitorApp-1synz4en.js} +3 -4
  12. package/{cloud.command-4zwa5dsx.js → cloud.command-d7rqtzt9.js} +16 -26
  13. package/cloud.script-bkbpcr96.js +19 -0
  14. package/{code.command-468c9d7s.js → code.command-nn48xzej.js} +22 -37
  15. package/context.command-s3mcmvpa.js +48 -0
  16. package/context.runner-k99nb5pk.js +21 -0
  17. package/{dependencyScanner-0z2h2tks.js → dependencyScanner-ye2e6pdz.js} +2 -2
  18. package/{devTui-ffjsarqa.js → devTui-q7k7bakd.js} +5 -9
  19. package/fileSys-5ngz93ga.js +9 -0
  20. package/{guideline.command-vhw13pqr.js → guideline.command-sct4qnt5.js} +4 -5
  21. package/guidelines/conventions/conventions.instruction.md +5 -1
  22. package/guidelines/mcpRule/mcpRule.instruction.md +7 -5
  23. package/incrementalBuilder.proc.js +30 -48
  24. package/{index-s5rhm04y.js → index-0bq14vr1.js} +1 -1
  25. package/{index-10dkrrww.js → index-13ffe9wp.js} +4 -4
  26. package/{index-srmay5jw.js → index-22d57v4c.js} +84 -67
  27. package/{index-53176s7j.js → index-31yr441d.js} +10 -17
  28. package/index-3hx1z96c.js +87 -0
  29. package/{index-4m929vvn.js → index-3sq321ak.js} +10 -18
  30. package/{index-bhtmj233.js → index-3t7g9e4r.js} +41 -78
  31. package/{index-q0y2jq9j.js → index-5b6tavv3.js} +6 -3
  32. package/{index-47pj3aee.js → index-5e0n4hqx.js} +11 -12
  33. package/{index-7ep8qtvp.js → index-5pc1qrbv.js} +5 -8
  34. package/{index-esk82rvk.js → index-8mna0947.js} +34 -71
  35. package/{index-sq2dzkzm.js → index-8sf7wmdr.js} +6 -6
  36. package/{index-crmeqnmf.js → index-9d9bgcx4.js} +283 -722
  37. package/{index-bwf965h6.js → index-ahemdr5n.js} +6 -6
  38. package/{index-ab0c38ea.js → index-as7xmyz8.js} +20 -20
  39. package/{index-bc88j1ry.js → index-axzjaqve.js} +94 -142
  40. package/{index-3d9y066c.js → index-bjwxs904.js} +9 -8
  41. package/{index-667w0yah.js → index-c6eggbee.js} +2 -5
  42. package/{index-a1w6934z.js → index-ddxvdd1p.js} +169 -305
  43. package/{index-92zztqy1.js → index-dy0jx9ay.js} +2 -17
  44. package/{index-22xtgmhn.js → index-dzf3r49a.js} +1 -1
  45. package/{index-89hy31kf.js → index-fgq75haa.js} +172 -287
  46. package/{index-by5gpp8x.js → index-hj6w4ka1.js} +2 -1
  47. package/{index-hwkygn9s.js → index-khpfpcsd.js} +302 -33
  48. package/{index-vqx8bdxz.js → index-mxav6j3c.js} +78 -231
  49. package/{index-2446k7b4.js → index-myhc3c1j.js} +512 -588
  50. package/{index-3jrp517k.js → index-nv5976x3.js} +45 -128
  51. package/{index-zqgj2rt2.js → index-przybvy5.js} +69 -147
  52. package/{index-n3cv0tm4.js → index-smme4r47.js} +1 -1
  53. package/{index-qdgzsnhg.js → index-w2zdcw3k.js} +110 -231
  54. package/{index-14zrtgfa.js → index-wa5jbxj1.js} +6 -39
  55. package/{index-bftkz6cp.js → index-ww4z397j.js} +198 -555
  56. package/{index-kwaq3n9n.js → index-xqjwd384.js} +4 -7
  57. package/{index-txr7dj2g.js → index-xqpzbab5.js} +106 -240
  58. package/{index-e4v6vhxq.js → index-xsjh6nzh.js} +178 -165
  59. package/{index-18zybgkc.js → index-ygn77a5w.js} +47 -99
  60. package/{index-9d6nvkz2.js → index-ztp3e73t.js} +79 -35
  61. package/index.js +23 -24
  62. package/{library.command-cqr175dy.js → library.command-1gx04jgn.js} +4 -5
  63. package/{localRegistry.command-49z55qqz.js → localRegistry.command-zndxj1q6.js} +21 -42
  64. package/{module.command-9p8mm3b0.js → module.command-3waddk95.js} +6 -7
  65. package/{package.command-wxyz909t.js → package.command-zrc7br1y.js} +5 -6
  66. package/package.json +2 -2
  67. package/{page.command-gsrsfqqs.js → page.command-vpjgardh.js} +4 -5
  68. package/{primitive.command-ns1mptje.js → primitive.command-sz84tk4t.js} +9 -20
  69. package/{prompter-1f8d9pcc.js → prompter-ptaa3nk0.js} +2 -2
  70. package/{quality.command-e76k2q9k.js → quality.command-g869hafs.js} +129 -363
  71. package/{recipeScanner-fpagtgc1.js → recipeScanner-4b69ybe0.js} +1 -1
  72. package/{repair.command-pkrsm3cw.js → repair.command-chsnjvvv.js} +11 -35
  73. package/{scalar.command-0cpt3fc8.js → scalar.command-2v21newx.js} +5 -6
  74. package/skills/akan-code/SKILL.md +12 -4
  75. package/{subspace.command-fktpwp0g.js → subspace.command-ckcbwfp1.js} +39 -58
  76. package/templates/appSample/srvkit/{AuthGuard.ts → guards.ts} +3 -3
  77. package/templates/appSample/srvkit/{SessionInternalArg.ts → internalArgs.ts} +3 -3
  78. package/templates/client.ts +7 -30
  79. package/templates/lib/__lib/lib.dictionary.ts +0 -2
  80. package/templates/lib/__lib/lib.document.ts +0 -2
  81. package/templates/lib/sig.ts +8 -30
  82. package/templates/server.ts +0 -2
  83. package/{tunnel.command-d5jy9gk8.js → tunnel.command-kd2yr4fx.js} +5 -6
  84. package/{typeChecker-3xgrzc2v.js → typeChecker-px49mezc.js} +1 -1
  85. package/typecheck.proc.js +1 -1
  86. package/workflow.command-44252cqv.js +79 -0
  87. package/{workspace.command-gv84eh1p.js → workspace.command-fqcztt5p.js} +72 -107
  88. package/TunnelShare-2j6s511d.js +0 -9
  89. package/cloud.script-fwx3vb34.js +0 -20
  90. package/context.command-dsnw0jby.js +0 -80
  91. package/context.runner-rs4rj15d.js +0 -22
  92. package/devTuiView-1q1mdgrv.js +0 -9
  93. package/getDirname-dr3jz1xg.js +0 -7
  94. package/index-6wwzs1bc.js +0 -7
  95. package/workflow.command-6tkcysmx.js +0 -105
@@ -0,0 +1,79 @@
1
+ // @bun
2
+ import {
3
+ Workspace,
4
+ script,
5
+ command
6
+ } from "./index-w2zdcw3k.js";
7
+ import"./index-5b6tavv3.js";
8
+ import"./index-9d9bgcx4.js";
9
+ import"./index-hj6w4ka1.js";
10
+ import"./index-myhc3c1j.js";
11
+ import"./index-ygn77a5w.js";
12
+ import"./index-dzf3r49a.js";
13
+ import"./index-8mna0947.js";
14
+ import"./index-przybvy5.js";
15
+ import"./index-31yr441d.js";
16
+ import"./index-3sq321ak.js";
17
+ import {
18
+ WorkflowRunner
19
+ } from "./index-xqpzbab5.js";
20
+
21
+ // pkgs/@akanjs/cli/workflow/workflow.script.ts
22
+ import { Logger } from "akanjs/common";
23
+ class WorkflowScript extends script("workflow", [WorkflowRunner]) {
24
+ async workflow(action, workflow, inputs, {
25
+ format = "markdown",
26
+ out = null,
27
+ dryRun = false,
28
+ workspace
29
+ } = {}) {
30
+ if (action === "list") {
31
+ Logger.rawLog(this.workflowRunner.list({ format }));
32
+ return;
33
+ }
34
+ if (!workflow)
35
+ throw new Error(`Workflow name is required for "${action}".`);
36
+ if (action === "explain") {
37
+ Logger.rawLog(this.workflowRunner.explain(workflow, { format }));
38
+ return;
39
+ }
40
+ if (action === "plan") {
41
+ Logger.rawLog(await this.workflowRunner.plan(workflow, inputs, { format, out }));
42
+ return;
43
+ }
44
+ if (action === "apply") {
45
+ if (!workspace)
46
+ throw new Error("Workspace is required for workflow apply.");
47
+ const registry = WorkflowRunner.stepRegistry(workspace);
48
+ Logger.rawLog(await this.workflowRunner.apply(workflow, { dryRun, format, workspace, registry }));
49
+ return;
50
+ }
51
+ if (action === "validate") {
52
+ if (!workspace)
53
+ throw new Error("Workspace is required for workflow validate.");
54
+ Logger.rawLog(await this.workflowRunner.validate(workflow, { format, workspace }));
55
+ return;
56
+ }
57
+ if (action === "report") {
58
+ if (!workspace)
59
+ throw new Error("Workspace is required for workflow report.");
60
+ Logger.rawLog(await this.workflowRunner.report(workflow, { format, workspace }));
61
+ return;
62
+ }
63
+ throw new Error(`Unknown workflow action: ${action}. Use list, explain, plan, apply, validate, or report.`);
64
+ }
65
+ }
66
+
67
+ // pkgs/@akanjs/cli/workflow/workflow.command.ts
68
+ class WorkflowCommand extends command("workflow", [WorkflowScript], ({ public: target }) => ({
69
+ workflow: target({ desc: "List, explain, plan, apply, validate, or report Akan workflows" }).arg("action", String, {
70
+ desc: "list, explain, plan, apply, validate, or report",
71
+ enum: ["list", "explain", "plan", "apply", "validate", "report"]
72
+ }).arg("workflow", String, { desc: "workflow name, plan path, or run id", nullable: true }).with(Workspace).option("format", String, { desc: "output format", flag: "o", default: "markdown", enum: ["markdown", "json"] }).option("out", String, { flag: "w", desc: "write workflow plan JSON to this path", nullable: true }).option("dryRun", Boolean, { flag: "r", desc: "show predicted apply report without writing files", default: false }).option("app", String, { desc: "target app or library name", nullable: true }).option("module", String, { desc: "target module name", nullable: true }).option("field", String, { desc: "field name", nullable: true }).option("type", String, { desc: "field type or scalar name", nullable: true }).option("values", String, { flag: "l", desc: "comma-separated values", nullable: true }).option("default", String, { desc: "default value", nullable: true }).option("scalar", String, { flag: "c", desc: "scalar name", nullable: true }).option("surface", String, { flag: "u", desc: "UI surface name", nullable: true }).option("mutation", String, { flag: "n", desc: "mutation name", nullable: true }).option("slice", String, { flag: "i", desc: "slice name", nullable: true }).exec(async function(action, workflow, workspace, format, out, dryRun, app, module, field, typeName, values, defaultValue, scalar, surface, mutation, slice) {
73
+ await this.workflowScript.workflow(action, workflow, { app, module, field, type: typeName, values, default: defaultValue, scalar, surface, mutation, slice }, { format, out, dryRun, workspace });
74
+ })
75
+ })) {
76
+ }
77
+ export {
78
+ WorkflowCommand
79
+ };
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
- FileSys
4
- } from "./index-q0y2jq9j.js";
3
+ FileSys2
4
+ } from "./index-5b6tavv3.js";
5
5
  import {
6
6
  GlobalConfig
7
- } from "./index-srmay5jw.js";
7
+ } from "./index-22d57v4c.js";
8
8
  import {
9
9
  Exec,
10
10
  Workspace,
11
11
  runner,
12
12
  script,
13
13
  command
14
- } from "./index-qdgzsnhg.js";
14
+ } from "./index-w2zdcw3k.js";
15
15
  import {
16
16
  extractAgentBlock,
17
17
  collectScopeRecipeSources,
@@ -22,8 +22,7 @@ import {
22
22
  AppExecutor,
23
23
  LibExecutor,
24
24
  PkgExecutor
25
- } from "./index-crmeqnmf.js";
26
- import"./index-6wwzs1bc.js";
25
+ } from "./index-9d9bgcx4.js";
27
26
  import {
28
27
  countBlocking,
29
28
  formatStyleContract,
@@ -32,44 +31,44 @@ import {
32
31
  import {
33
32
  collectRecipeSources2,
34
33
  scanRecipes2
35
- } from "./index-by5gpp8x.js";
36
- import"./index-2446k7b4.js";
37
- import"./index-18zybgkc.js";
38
- import"./index-s5rhm04y.js";
34
+ } from "./index-hj6w4ka1.js";
35
+ import"./index-myhc3c1j.js";
36
+ import"./index-ygn77a5w.js";
37
+ import"./index-0bq14vr1.js";
39
38
  import {
40
39
  AgentScript
41
- } from "./index-bwf965h6.js";
42
- import {
43
- ApplicationScript
44
- } from "./index-bftkz6cp.js";
40
+ } from "./index-ahemdr5n.js";
41
+ import"./index-khpfpcsd.js";
45
42
  import {
46
43
  LibraryScript
47
- } from "./index-7ep8qtvp.js";
48
- import"./index-hwkygn9s.js";
44
+ } from "./index-5pc1qrbv.js";
45
+ import {
46
+ ApplicationScript
47
+ } from "./index-ww4z397j.js";
49
48
  import"./index-7md2g9vw.js";
50
- import"./index-bhtmj233.js";
49
+ import"./index-3t7g9e4r.js";
51
50
  import {
52
51
  PackageScript
53
- } from "./index-ab0c38ea.js";
52
+ } from "./index-as7xmyz8.js";
54
53
  import {
55
54
  getNpmRegistryUrl,
56
55
  getLatestPackageVersion
57
- } from "./index-bc88j1ry.js";
56
+ } from "./index-axzjaqve.js";
58
57
  import {
59
58
  CloudScript2
60
- } from "./index-sq2dzkzm.js";
61
- import"./index-3jrp517k.js";
62
- import"./index-vqx8bdxz.js";
63
- import"./index-53176s7j.js";
64
- import"./index-txr7dj2g.js";
65
- import"./index-22xtgmhn.js";
66
- import"./index-esk82rvk.js";
67
- import"./index-zqgj2rt2.js";
68
- import"./index-4m929vvn.js";
59
+ } from "./index-8sf7wmdr.js";
60
+ import"./index-nv5976x3.js";
61
+ import"./index-mxav6j3c.js";
62
+ import"./index-31yr441d.js";
63
+ import"./index-dzf3r49a.js";
64
+ import"./index-8mna0947.js";
65
+ import"./index-przybvy5.js";
66
+ import"./index-3sq321ak.js";
67
+ import"./index-xqpzbab5.js";
69
68
  import {
70
69
  ContextScript
71
- } from "./index-10dkrrww.js";
72
- import"./index-kwaq3n9n.js";
70
+ } from "./index-13ffe9wp.js";
71
+ import"./index-xqjwd384.js";
73
72
 
74
73
  // pkgs/@akanjs/cli/workspace/workspace.runner.ts
75
74
  import path from "path";
@@ -98,29 +97,15 @@ var defaultMaxDiagnostics = 200;
98
97
  class WorkspaceRunner extends runner("workspace") {
99
98
  async generateAgentRules(workspace, { overwrite = false, cursorRules = true } = {}) {
100
99
  const [appNames] = await workspace.getExecs();
101
- const dict = {
102
- repoName: workspace.repoName,
103
- appName: appNames[0] ?? "app"
104
- };
105
- const created = await workspace.applyTemplate({
106
- basePath: ".",
107
- template: "workspaceRoot/AGENTS.md.template",
108
- dict,
109
- overwrite
110
- });
111
- created.push(...await workspace.applyTemplate({
112
- basePath: ".",
113
- template: "workspaceRoot/CLAUDE.md.template",
114
- dict,
115
- overwrite
116
- }));
117
- if (cursorRules)
118
- created.push(...await workspace.applyTemplate({
119
- basePath: ".cursor/rules",
120
- template: "workspaceRoot/.cursor/rules/akan.mdc.template",
121
- dict,
122
- overwrite
123
- }));
100
+ const dict = { repoName: workspace.repoName, appName: appNames[0] ?? "app" };
101
+ const templates = [
102
+ [".", "workspaceRoot/AGENTS.md.template"],
103
+ [".", "workspaceRoot/CLAUDE.md.template"],
104
+ ...cursorRules ? [[".cursor/rules", "workspaceRoot/.cursor/rules/akan.mdc.template"]] : []
105
+ ];
106
+ const created = [];
107
+ for (const [basePath, template] of templates)
108
+ created.push(...await workspace.applyTemplate({ basePath, template, dict, overwrite }));
124
109
  return created;
125
110
  }
126
111
  async createWorkspace(repoName, appName, {
@@ -183,53 +168,43 @@ class WorkspaceRunner extends runner("workspace") {
183
168
  return Object.fromEntries(Object.entries(dependencyVersions).filter(([dependency]) => defaultWorkspacePeerDependencies.has(dependency)));
184
169
  }
185
170
  async#getCliPackageJson() {
186
- const packageJsonCandidates = [
171
+ const found = await this.#findPackageJson("@akanjs/cli", [
187
172
  path.join(import.meta.dir, "../package.json"),
188
173
  path.join(import.meta.dir, "package.json"),
189
174
  path.join(path.dirname(Bun.main), "package.json")
190
- ];
191
- try {
192
- packageJsonCandidates.unshift(Bun.resolveSync("@akanjs/cli/package.json", import.meta.dir));
193
- } catch {}
194
- for (const packageJsonPath of packageJsonCandidates) {
195
- if (!await Bun.file(packageJsonPath).exists())
196
- continue;
197
- const packageJson = await FileSys.readJson(packageJsonPath);
198
- if (packageJson.name === "@akanjs/cli")
199
- return packageJson;
200
- }
201
- return { name: "@akanjs/cli", version: "0.0.0", description: "@akanjs/cli" };
175
+ ]);
176
+ return found ?? { name: "@akanjs/cli", version: "0.0.0", description: "@akanjs/cli" };
202
177
  }
203
178
  async#getAkanPackageJson() {
204
- const packageJsonCandidates = [
179
+ const ancestors = [];
180
+ for (let current = import.meta.dir, depth = 0;depth < 6; depth++) {
181
+ ancestors.push(path.join(current, "package.json"));
182
+ if (path.dirname(current) === current)
183
+ break;
184
+ current = path.dirname(current);
185
+ }
186
+ const found = await this.#findPackageJson("akanjs", [
205
187
  path.join(import.meta.dir, "../../../akanjs/package.json"),
206
188
  path.join(process.cwd(), "pkgs/akanjs/package.json"),
207
- path.join(path.dirname(Bun.main), "node_modules/akanjs/package.json")
208
- ];
189
+ path.join(path.dirname(Bun.main), "node_modules/akanjs/package.json"),
190
+ ...ancestors
191
+ ]);
192
+ if (!found)
193
+ throw new Error(`[workspace] failed to locate akanjs package.json from ${import.meta.dir}`);
194
+ return found;
195
+ }
196
+ async#findPackageJson(name, candidates) {
209
197
  try {
210
- packageJsonCandidates.unshift(Bun.resolveSync("akanjs/package.json", import.meta.dir));
198
+ candidates.unshift(Bun.resolveSync(`${name}/package.json`, import.meta.dir));
211
199
  } catch {}
212
- for (const packageJsonPath of packageJsonCandidates) {
200
+ for (const packageJsonPath of candidates) {
213
201
  if (!await Bun.file(packageJsonPath).exists())
214
202
  continue;
215
- const packageJson = await FileSys.readJson(packageJsonPath);
216
- if (packageJson.name === "akanjs")
203
+ const packageJson = await FileSys2.readJson(packageJsonPath);
204
+ if (packageJson.name === name)
217
205
  return packageJson;
218
206
  }
219
- let current = import.meta.dir;
220
- for (let depth = 0;depth < 6; depth++) {
221
- const packageJsonPath = path.join(current, "package.json");
222
- if (await Bun.file(packageJsonPath).exists()) {
223
- const packageJson = await FileSys.readJson(packageJsonPath);
224
- if (packageJson.name === "akanjs")
225
- return packageJson;
226
- }
227
- const parent = path.dirname(current);
228
- if (parent === current)
229
- break;
230
- current = parent;
231
- }
232
- throw new Error(`[workspace] failed to locate akanjs package.json from ${import.meta.dir}`);
207
+ return null;
233
208
  }
234
209
  async lint(exec, workspace, { fix = true, maxDiagnostics = defaultMaxDiagnostics } = {}) {
235
210
  const configPath = await WorkspaceRunner.resolveBiomeConfigPath(workspace);
@@ -441,10 +416,13 @@ class WorkspaceScript extends script("workspace", [
441
416
  }
442
417
 
443
418
  // pkgs/@akanjs/cli/workspace/workspace.command.ts
419
+ var maxDiagnosticsOption = {
420
+ desc: "How many diagnostics Biome prints before truncating (0 for no limit)",
421
+ default: defaultMaxDiagnostics
422
+ };
423
+
444
424
  class WorkspaceCommand extends command("workspace", [WorkspaceScript], ({ public: target }) => ({
445
- createWorkspace: target({ desc: "Create a new Akan.js workspace", runsOnWorkspaceRoot: false }).arg("workspaceName", String, { desc: "what is the name of your organization?" }).option("app", String, {
446
- desc: "what is the codename of your first application? (e.g. myapp)"
447
- }).option("dir", String, {
425
+ createWorkspace: target({ desc: "Create a new Akan.js workspace", runsOnWorkspaceRoot: false }).arg("workspaceName", String, { desc: "what is the name of your organization?" }).option("app", String, { desc: "what is the codename of your first application? (e.g. myapp)" }).option("dir", String, {
448
426
  desc: "directory of workspace",
449
427
  default: process.env.USE_AKANJS_PKGS === "true" ? "local" : "."
450
428
  }).option("libs", Boolean, {
@@ -457,17 +435,10 @@ class WorkspaceCommand extends command("workspace", [WorkspaceScript], ({ public
457
435
  }
458
436
  ],
459
437
  default: false
460
- }).option("init", Boolean, {
461
- desc: "Do you want to initialize the workspace? (Recommended)",
462
- default: true
463
- }).option("registry", String, {
438
+ }).option("init", Boolean, { desc: "Do you want to initialize the workspace? (Recommended)", default: true }).option("registry", String, {
464
439
  desc: "npm registry URL for installing Akan packages",
465
440
  default: process.env.AKAN_NPM_REGISTRY ?? "https://registry.npmjs.org"
466
- }).option("owner", String, {
467
- desc: "owner of the workspace",
468
- default: process.env.GITHUB_OWNER,
469
- nullable: true
470
- }).option("mcpInstall", Boolean, {
441
+ }).option("owner", String, { desc: "owner of the workspace", default: process.env.GITHUB_OWNER, nullable: true }).option("mcpInstall", Boolean, {
471
442
  desc: "Install the Akan MCP server config for Cursor, Claude Code, and Codex? (Recommended)",
472
443
  default: true
473
444
  }).option("agentInstall", Boolean, {
@@ -491,16 +462,10 @@ class WorkspaceCommand extends command("workspace", [WorkspaceScript], ({ public
491
462
  }).option("overwrite", Boolean, { desc: "Overwrite existing agent rule files", default: false }).option("cursorRules", Boolean, { desc: "Generate .cursor/rules/akan.mdc", default: true }).with(Workspace).exec(async function(overwrite, cursorRules, workspace) {
492
463
  await this.workspaceScript.generateAgentRules(workspace, { overwrite, cursorRules });
493
464
  }),
494
- lint: target({ desc: "Lint and fix code in a specific app/lib/pkg" }).with(Exec).option("fix", Boolean, { default: true }).option("maxDiagnostics", Number, {
495
- desc: "How many diagnostics Biome prints before truncating (0 for no limit)",
496
- default: defaultMaxDiagnostics
497
- }).with(Workspace).exec(async function(exec, fix, maxDiagnostics, workspace) {
465
+ lint: target({ desc: "Lint and fix code in a specific app/lib/pkg" }).with(Exec).option("fix", Boolean, { default: true }).option("maxDiagnostics", Number, maxDiagnosticsOption).with(Workspace).exec(async function(exec, fix, maxDiagnostics, workspace) {
498
466
  await this.workspaceScript.lint(exec, workspace, { fix, maxDiagnostics });
499
467
  }),
500
- lintAll: target({ desc: "Lint and fix code in all apps and libraries" }).option("fix", Boolean, { default: true }).option("maxDiagnostics", Number, {
501
- desc: "How many diagnostics Biome prints before truncating (0 for no limit)",
502
- default: defaultMaxDiagnostics
503
- }).with(Workspace).exec(async function(fix, maxDiagnostics, workspace) {
468
+ 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) {
504
469
  await this.workspaceScript.lintAll(workspace, { fix, maxDiagnostics });
505
470
  }),
506
471
  syncAll: target({ desc: "Sync dependencies and configuration for all apps and libraries" }).with(Workspace).exec(async function(workspace) {
@@ -1,9 +0,0 @@
1
- // @bun
2
- import {
3
- TunnelShare2
4
- } from "./index-n3cv0tm4.js";
5
- import"./index-srmay5jw.js";
6
- import"./index-q0y2jq9j.js";
7
- export {
8
- TunnelShare2 as TunnelShare
9
- };
@@ -1,20 +0,0 @@
1
- // @bun
2
- import {
3
- CloudScript2
4
- } from "./index-sq2dzkzm.js";
5
- import"./index-bc88j1ry.js";
6
- import"./index-bftkz6cp.js";
7
- import"./index-kwaq3n9n.js";
8
- import"./index-7ep8qtvp.js";
9
- import"./index-ab0c38ea.js";
10
- import"./index-srmay5jw.js";
11
- import"./index-qdgzsnhg.js";
12
- import"./index-7md2g9vw.js";
13
- import"./index-hwkygn9s.js";
14
- import"./index-crmeqnmf.js";
15
- import"./index-6wwzs1bc.js";
16
- import"./index-bhtmj233.js";
17
- import"./index-q0y2jq9j.js";
18
- export {
19
- CloudScript2 as CloudScript
20
- };
@@ -1,80 +0,0 @@
1
- // @bun
2
- import {
3
- Workspace,
4
- command
5
- } from "./index-qdgzsnhg.js";
6
- import"./index-q0y2jq9j.js";
7
- import"./index-crmeqnmf.js";
8
- import"./index-6wwzs1bc.js";
9
- import"./index-by5gpp8x.js";
10
- import"./index-2446k7b4.js";
11
- import"./index-18zybgkc.js";
12
- import"./index-3jrp517k.js";
13
- import"./index-vqx8bdxz.js";
14
- import"./index-s5rhm04y.js";
15
- import"./index-53176s7j.js";
16
- import"./index-txr7dj2g.js";
17
- import"./index-22xtgmhn.js";
18
- import"./index-esk82rvk.js";
19
- import"./index-zqgj2rt2.js";
20
- import"./index-4m929vvn.js";
21
- import {
22
- ContextScript
23
- } from "./index-10dkrrww.js";
24
-
25
- // pkgs/@akanjs/cli/context/context.command.ts
26
- class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
27
- context: target({ desc: "Print agent-readable Akan workspace context" }).option("format", String, {
28
- desc: "output format",
29
- default: "markdown",
30
- enum: ["markdown", "json"]
31
- }).option("app", String, { desc: "app name to include", nullable: true }).option("module", String, { desc: "module name to include with abstract content", nullable: true }).with(Workspace).exec(async function(format, app, module, workspace) {
32
- await this.contextScript.context(workspace, { format, app, module });
33
- }),
34
- doctor: target({ desc: "Report Akan workspace convention diagnostics" }).option("format", String, {
35
- desc: "output format",
36
- default: "text",
37
- enum: ["text", "json"]
38
- }).option("strict", Boolean, { desc: "treat recommended conventions as errors", default: false }).option("ios", Boolean, {
39
- desc: "report iOS/mobile config diagnostics (placeholder bundle ids, etc.)",
40
- default: false
41
- }).with(Workspace).exec(async function(format, strict, ios, workspace) {
42
- await this.contextScript.doctor(workspace, { format, strict, ios });
43
- }),
44
- mcpInstall: target({ desc: "Install the Akan MCP server config for Cursor, Claude Code, and Codex" }).arg("target", String, { desc: "cursor, claude, codex, or all", nullable: true }).option("force", Boolean, { desc: "overwrite an existing Akan MCP server entry", default: false }).option("mode", String, {
45
- desc: "MCP permission mode",
46
- default: "apply",
47
- enum: ["readonly", "plan", "apply"]
48
- }).with(Workspace).exec(async function(targetName, force, mode, workspace) {
49
- await this.contextScript.mcpInstall(workspace, targetName, {
50
- force,
51
- mode
52
- });
53
- }),
54
- mcp: target({ desc: "Start the Akan MCP server over stdio", stdio: true }).option("mode", String, {
55
- desc: "MCP permission mode",
56
- default: "readonly",
57
- enum: ["readonly", "plan", "apply"]
58
- }).with(Workspace).exec(async function(mode, workspace) {
59
- await this.contextScript.mcp(workspace, { mode });
60
- }),
61
- mcpCall: target({ desc: "Call one Akan MCP tool for debugging without stdio JSON-RPC" }).arg("tool", String, { desc: "MCP tool name" }).option("mode", String, {
62
- desc: "MCP permission mode",
63
- default: "readonly",
64
- enum: ["readonly", "plan", "apply"]
65
- }).option("args", String, { desc: "JSON object to pass as MCP tool arguments", nullable: true }).option("format", String, {
66
- desc: "output format",
67
- default: "json",
68
- enum: ["json"]
69
- }).with(Workspace).exec(async function(tool, mode, args, format, workspace) {
70
- await this.contextScript.mcpCall(workspace, tool, {
71
- mode,
72
- args,
73
- format
74
- });
75
- })
76
- })) {
77
- }
78
- export {
79
- ContextCommand
80
- };
@@ -1,22 +0,0 @@
1
- // @bun
2
- import {
3
- ContextRunner2
4
- } from "./index-3jrp517k.js";
5
- import"./index-53176s7j.js";
6
- import"./index-txr7dj2g.js";
7
- import"./index-4m929vvn.js";
8
- import"./index-zqgj2rt2.js";
9
- import"./index-esk82rvk.js";
10
- import"./index-22xtgmhn.js";
11
- import"./index-18zybgkc.js";
12
- import"./index-2446k7b4.js";
13
- import"./index-s5rhm04y.js";
14
- import"./index-vqx8bdxz.js";
15
- import"./index-qdgzsnhg.js";
16
- import"./index-crmeqnmf.js";
17
- import"./index-by5gpp8x.js";
18
- import"./index-6wwzs1bc.js";
19
- import"./index-q0y2jq9j.js";
20
- export {
21
- ContextRunner2 as ContextRunner
22
- };
@@ -1,9 +0,0 @@
1
- // @bun
2
- // pkgs/@akanjs/cli/application/devTuiView.ts
3
- var createDevTuiView = async (supervisor) => {
4
- const { DevTui } = await import("./devTui-ffjsarqa.js");
5
- return new DevTui(supervisor);
6
- };
7
- export {
8
- createDevTuiView
9
- };
@@ -1,7 +0,0 @@
1
- // @bun
2
- import {
3
- getDirname2
4
- } from "./index-6wwzs1bc.js";
5
- export {
6
- getDirname2 as getDirname
7
- };
package/index-6wwzs1bc.js DELETED
@@ -1,7 +0,0 @@
1
- // @bun
2
- // pkgs/@akanjs/devkit/getDirname.ts
3
- import path from "path";
4
- import { fileURLToPath } from "url";
5
- var getDirname2 = (url) => path.dirname(fileURLToPath(url));
6
-
7
- export { getDirname2 };
@@ -1,105 +0,0 @@
1
- // @bun
2
- import {
3
- Workspace,
4
- script,
5
- command
6
- } from "./index-qdgzsnhg.js";
7
- import"./index-q0y2jq9j.js";
8
- import"./index-crmeqnmf.js";
9
- import"./index-6wwzs1bc.js";
10
- import {
11
- createWorkflowStepRegistry
12
- } from "./index-2446k7b4.js";
13
- import"./index-22xtgmhn.js";
14
- import {
15
- ModuleScript
16
- } from "./index-esk82rvk.js";
17
- import {
18
- PrimitiveScript
19
- } from "./index-zqgj2rt2.js";
20
- import {
21
- ScalarScript
22
- } from "./index-4m929vvn.js";
23
- import"./index-by5gpp8x.js";
24
- import"./index-18zybgkc.js";
25
- import {
26
- WorkflowRunner
27
- } from "./index-txr7dj2g.js";
28
-
29
- // pkgs/@akanjs/cli/workflow/workflow.script.ts
30
- import { Logger } from "akanjs/common";
31
- class WorkflowScript extends script("workflow", [WorkflowRunner, ModuleScript, ScalarScript, PrimitiveScript]) {
32
- async workflow(action, workflow, inputs, {
33
- format = "markdown",
34
- out = null,
35
- dryRun = false,
36
- workspace
37
- } = {}) {
38
- if (action === "list") {
39
- Logger.rawLog(this.workflowRunner.list({ format }));
40
- return;
41
- }
42
- if (!workflow)
43
- throw new Error(`Workflow name is required for "${action}".`);
44
- if (action === "explain") {
45
- Logger.rawLog(this.workflowRunner.explain(workflow, { format }));
46
- return;
47
- }
48
- if (action === "plan") {
49
- Logger.rawLog(await this.workflowRunner.plan(workflow, inputs, { format, out }));
50
- return;
51
- }
52
- if (action === "apply") {
53
- if (!workspace)
54
- throw new Error("Workspace is required for workflow apply.");
55
- Logger.rawLog(await this.workflowRunner.apply(workflow, {
56
- dryRun,
57
- format,
58
- workspace,
59
- registry: createWorkflowStepRegistry({
60
- workspace,
61
- createModule: (sys, module) => this.moduleScript.createModuleTemplate(sys, module),
62
- createScalar: (sys, scalar) => this.scalarScript.createScalar(sys, scalar),
63
- createUi: (input) => this.primitiveScript.createUi(workspace, input),
64
- addField: (input) => this.primitiveScript.addField(workspace, input),
65
- addEnumField: (input) => this.primitiveScript.addEnumField(workspace, input),
66
- addMutation: (input) => this.primitiveScript.addMutation(workspace, input),
67
- addSlice: (input) => this.primitiveScript.addSlice(workspace, input)
68
- })
69
- }));
70
- return;
71
- }
72
- if (action === "validate") {
73
- if (!workspace)
74
- throw new Error("Workspace is required for workflow validate.");
75
- Logger.rawLog(await this.workflowRunner.validate(workflow, { format, workspace }));
76
- return;
77
- }
78
- if (action === "report") {
79
- if (!workspace)
80
- throw new Error("Workspace is required for workflow report.");
81
- Logger.rawLog(await this.workflowRunner.report(workflow, { format, workspace }));
82
- return;
83
- }
84
- throw new Error(`Unknown workflow action: ${action}. Use list, explain, plan, apply, validate, or report.`);
85
- }
86
- }
87
-
88
- // pkgs/@akanjs/cli/workflow/workflow.command.ts
89
- class WorkflowCommand extends command("workflow", [WorkflowScript], ({ public: target }) => ({
90
- workflow: target({ desc: "List, explain, plan, apply, validate, or report Akan workflows" }).arg("action", String, {
91
- desc: "list, explain, plan, apply, validate, or report",
92
- enum: ["list", "explain", "plan", "apply", "validate", "report"]
93
- }).arg("workflow", String, { desc: "workflow name, plan path, or run id", nullable: true }).with(Workspace).option("format", String, {
94
- desc: "output format",
95
- flag: "o",
96
- default: "markdown",
97
- enum: ["markdown", "json"]
98
- }).option("out", String, { flag: "w", desc: "write workflow plan JSON to this path", nullable: true }).option("dryRun", Boolean, { flag: "r", desc: "show predicted apply report without writing files", default: false }).option("app", String, { desc: "target app or library name", nullable: true }).option("module", String, { desc: "target module name", nullable: true }).option("field", String, { desc: "field name", nullable: true }).option("type", String, { desc: "field type or scalar name", nullable: true }).option("values", String, { flag: "l", desc: "comma-separated values", nullable: true }).option("default", String, { desc: "default value", nullable: true }).option("scalar", String, { flag: "c", desc: "scalar name", nullable: true }).option("surface", String, { flag: "u", desc: "UI surface name", nullable: true }).option("mutation", String, { flag: "n", desc: "mutation name", nullable: true }).option("slice", String, { flag: "i", desc: "slice name", nullable: true }).exec(async function(action, workflow, workspace, format, out, dryRun, app, module, field, typeName, values, defaultValue, scalar, surface, mutation, slice) {
99
- await this.workflowScript.workflow(action, workflow, { app, module, field, type: typeName, values, default: defaultValue, scalar, surface, mutation, slice }, { format, out, dryRun, workspace });
100
- })
101
- })) {
102
- }
103
- export {
104
- WorkflowCommand
105
- };