@akanjs/cli 2.3.9-rc.1 → 2.3.9-rc.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "2.3.9-rc.1",
3
+ "version": "2.3.9-rc.3",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -34,7 +34,7 @@
34
34
  "@langchain/openai": "^1.4.6",
35
35
  "@tailwindcss/node": "^4.3.0",
36
36
  "@trapezedev/project": "^7.1.4",
37
- "akanjs": "2.3.9-rc.1",
37
+ "akanjs": "2.3.9-rc.3",
38
38
  "chalk": "^5.6.2",
39
39
  "commander": "^14.0.3",
40
40
  "daisyui": "5.5.23",
@@ -17,7 +17,14 @@ alwaysApply: true
17
17
  `lib/useServer.ts`.
18
18
  - Prefer Akan MCP workflows before direct source edits: use `akan mcp --mode plan` for workflow discovery and
19
19
  planning, then `akan mcp --mode apply` only for allowlisted apply, validation, and repair tools.
20
+ - If `plan_workflow` returns `planPath` or `next.tool=apply_workflow`, call `apply_workflow({ planPath })` before
21
+ editing source files directly.
22
+ - After `apply_workflow`, run `run_validation` with `validationTarget` when present; otherwise use `applyReportPath`.
20
23
  - Direct source edits are denied when an allowlisted Akan workflow or repair tool can perform the change.
24
+ - Direct edits are fallback only after `list_workflows`/`explain_workflow` show no matching workflow, or after
25
+ `apply_workflow` reports unsupported/no-op/failed diagnostics that require manual action.
26
+ - For compound requests, split the request into workflows and apply each `planPath` in order, such as `create-module`
27
+ followed by `add-field`.
21
28
  - If generated output is stale or broken, update the owning source file and run `akan repair generated` or
22
29
  `akan sync <app-or-lib>` instead of patching generated files.
23
30
  - For new domain behavior, inspect sibling `constant`, `dictionary`, `signal`, `document`, `service`, `store`, and UI
@@ -63,17 +63,19 @@ Use the local module shape before adding a new abstraction.
63
63
  1. Read the nearby module and convention before creating files. If `*.abstract.md` exists, read it first.
64
64
  2. Put new files in the established Akan location instead of adding parallel architecture.
65
65
  3. Prefer Akan MCP workflows before direct source edits. Start with `akan mcp --mode plan` for `list_workflows`, `explain_workflow`, and `plan_workflow`.
66
- 4. Use `akan mcp --mode apply` only for allowlisted `apply_workflow`, `run_validation`, and repair tools.
67
- 5. Direct source edits are denied when an allowlisted Akan workflow or repair tool can perform the change.
68
- 6. If no workflow exists, edit only the owning source files and never patch generated files directly.
69
- 7. Keep page and layout files server-oriented: route-level `usePage`, headers, static layout, and `akanjs/ui` `Tab` composition belong there.
70
- 8. Put interactive loading, submit/import actions, local form state, and `router.push` in client `Util`, `Template`, or `Zone` components.
71
- 9. Prefer `Tab` for static mode selection instead of extra `useState`; render one focused client component inside each `Tab.Panel`.
72
- 10. Keep server-only logic out of client surfaces and client-only code out of server imports.
73
- 11. Treat `AKAN_PUBLIC_*` env vars as public. Never put secrets in them.
74
- 12. Add or update tests when behavior, contracts, or CLI output changes.
75
- 13. Update `*.abstract.md` when business invariants, workflows, or public behavior change.
76
- 14. Run the smallest relevant verification command after changes.
66
+ 4. If `plan_workflow` returns `planPath` or `next.tool=apply_workflow`, call `apply_workflow({ planPath })` before direct source edits.
67
+ 5. Use `akan mcp --mode apply` only for allowlisted `apply_workflow`, `run_validation`, and repair tools.
68
+ 6. After `apply_workflow`, run `run_validation` with `validationTarget` when present; otherwise use `applyReportPath`.
69
+ 7. Direct source edits are denied when an allowlisted Akan workflow or repair tool can perform the change.
70
+ 8. If no workflow exists, or apply reports unsupported/no-op/failed diagnostics that require manual action, edit only the owning source files and never patch generated files directly.
71
+ 9. Keep page and layout files server-oriented: route-level `usePage`, headers, static layout, and `akanjs/ui` `Tab` composition belong there.
72
+ 10. Put interactive loading, submit/import actions, local form state, and `router.push` in client `Util`, `Template`, or `Zone` components.
73
+ 11. Prefer `Tab` for static mode selection instead of extra `useState`; render one focused client component inside each `Tab.Panel`.
74
+ 12. Keep server-only logic out of client surfaces and client-only code out of server imports.
75
+ 13. Treat `AKAN_PUBLIC_*` env vars as public. Never put secrets in them.
76
+ 14. Add or update tests when behavior, contracts, or CLI output changes.
77
+ 15. Update `*.abstract.md` when business invariants, workflows, or public behavior change.
78
+ 16. Run the smallest relevant verification command after changes.
77
79
 
78
80
  ## Common Commands
79
81
 
@@ -134,15 +136,23 @@ Almost every Akan.js change follows this pattern. **Missing sync or repair is th
134
136
  # use list_workflows, explain_workflow, and plan_workflow
135
137
  ```
136
138
 
137
- 2. **Apply or edit source** — Use allowlisted apply/repair tools when available. If no workflow exists, edit only
138
- owning source files such as `task.constant.ts`, `task.dictionary.ts`, `Task.Template.tsx`, or `Task.Unit.tsx`.
139
- Never edit generated files.
139
+ 2. **Apply the plan** — If `plan_workflow` returns `planPath` or `next.tool=apply_workflow`, call
140
+ `apply_workflow({ planPath })`. Do not copy the workflow plan into direct source edits.
140
141
  ```
141
142
  akan mcp --mode apply
142
143
  # use apply_workflow, run_validation, repair_generated, repair_imports, or repair_module_shape
143
144
  ```
144
145
 
145
- 3. **Sync or repair** Regenerate barrel files so Akan discovers your change. This regenerates:
146
+ Direct edits are fallback only: use them after `list_workflows`/`explain_workflow` confirm no matching workflow, or
147
+ after apply reports unsupported/no-op/failed diagnostics that require manual action. Keep fallback edits to owning
148
+ source files such as `task.constant.ts`, `task.dictionary.ts`, `Task.Template.tsx`, or `Task.Unit.tsx`.
149
+
150
+ 3. **Validate the apply report** — Use the apply report artifact, not the original raw plan, when it is available.
151
+ ```
152
+ # run_validation with validationTarget first; otherwise use applyReportPath
153
+ ```
154
+
155
+ 4. **Sync or repair** — Regenerate barrel files so Akan discovers your change. This regenerates:
146
156
  `cnst.ts`, `db.ts`, `srv.ts`, `sig.ts`, `st.ts`, `dict.ts`, `useClient.ts`, `useServer.ts`,
147
157
  `ui/index.ts`, `webkit/index.ts`, `srvkit/index.ts`, `common/index.ts`, and all module `index.ts` files.
148
158
  ```
@@ -152,7 +162,7 @@ Almost every Akan.js change follows this pattern. **Missing sync or repair is th
152
162
  **CRITICAL**: Sync after EVERY file add, delete, or rename. Without sync, other modules cannot
153
163
  `import * as cnst from "../cnst"` and find your new model.
154
164
 
155
- 4. **Check** — Verify your change compiles and lints.
165
+ 5. **Check** — Verify your change compiles and lints.
156
166
  ```
157
167
  akan start <%= appName %> # dev server with live feedback (preferred)
158
168
  akan lint <%= appName %> # quick lint-only check
@@ -163,6 +173,10 @@ Almost every Akan.js change follows this pattern. **Missing sync or repair is th
163
173
  - `akan build <%= appName %>` — full rebuild catches type errors sync may miss
164
174
  - Re-run `akan create-module <name> --app <%= appName %>` if the scaffold is corrupted
165
175
 
176
+ For compound natural-language requests, split the request into workflows and apply each artifact in order. For example,
177
+ "create a project module and add a budget field" should run `create-module` plan/apply first, then `add-field`
178
+ plan/apply, then validation/doctor on the returned `validationTarget`.
179
+
166
180
  ## Quick Decision Matrix — "Where do I put this code?"
167
181
 
168
182
  | You want to... | Create in... | Run after... |
@@ -8,8 +8,25 @@
8
8
  "lint": "akan lint",
9
9
  "typecheck": "akan typecheck",
10
10
  "test": "akan test",
11
- "setup:agent": "akan agent install all",
12
- "build": "akan build"
11
+ "build": "akan build",
12
+ "setup:agent": "akan agent install all --force",
13
+ "agent:setup": "akan agent install all --force",
14
+ "agent:doctor": "akan doctor --strict --format json",
15
+ "agent:context": "akan context --format json",
16
+ "agent:mcp:readonly": "akan mcp-install cursor --mode readonly --force",
17
+ "agent:mcp:plan": "akan mcp-install cursor --mode plan --force",
18
+ "agent:mcp:apply": "akan mcp-install cursor --mode apply --force",
19
+ "agent:workflows": "akan workflow list",
20
+ "agent:sample:context": "akan context --format markdown --app <%= appName %> --module project",
21
+ "agent:sample:service": "akan create-service billing <%= appName %> --format json",
22
+ "agent:sample:module": "akan create-module project <%= appName %> --page=true --format json",
23
+ "agent:sample:field": "akan add-field --app <%= appName %> --module project --field budget --type Int --default 0 --format json",
24
+ "agent:sample:status": "akan add-enum-field --app <%= appName %> --module project --field status --values draft,active,archived --default draft --format json",
25
+ "agent:sample:sync": "akan sync <%= appName %>",
26
+ "agent:sample:check": "akan doctor --strict --format json",
27
+ "agent:sample:workflow:explain": "akan workflow explain add-field",
28
+ "agent:sample:workflow:plan": "akan workflow plan add-field --app <%= appName %> --module task --field priority --type enum --values low,medium,high --default medium --format json --out .akan/workflows/plans/task-priority.json",
29
+ "agent:sample:workflow:dry-run": "akan workflow apply .akan/workflows/plans/task-priority.json --dry-run --format json"
13
30
  },
14
31
  "dependencies": {},
15
32
  "devDependencies": {},