@akanjs/cli 2.3.9-rc.2 → 2.3.9-rc.4
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.
|
|
3
|
+
"version": "2.3.9-rc.4",
|
|
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.
|
|
37
|
+
"akanjs": "2.3.9-rc.4",
|
|
38
38
|
"chalk": "^5.6.2",
|
|
39
39
|
"commander": "^14.0.3",
|
|
40
40
|
"daisyui": "5.5.23",
|
|
@@ -9,8 +9,7 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dic
|
|
|
9
9
|
return `
|
|
10
10
|
import { via } from "akanjs/constant";
|
|
11
11
|
|
|
12
|
-
export class ${dict.Model}Input extends via((
|
|
13
|
-
field: field(String).optional(),
|
|
12
|
+
export class ${dict.Model}Input extends via((_field) => ({
|
|
14
13
|
})) {}
|
|
15
14
|
|
|
16
15
|
export class ${dict.Model}Object extends via(${dict.Model}Input, (field) => ({})) {}
|
|
@@ -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.
|
|
67
|
-
5.
|
|
68
|
-
6.
|
|
69
|
-
7.
|
|
70
|
-
8.
|
|
71
|
-
9.
|
|
72
|
-
10.
|
|
73
|
-
11.
|
|
74
|
-
12.
|
|
75
|
-
13.
|
|
76
|
-
14.
|
|
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
|
|
138
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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... |
|