@akanjs/cli 3.1.1-rc.9 → 3.1.2-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.build-stamp +1 -1
- package/CodeAgent-dyc45f5w.js +11 -0
- package/{CodeAgentRpcHost-9g27hmer.js → CodeAgentRpcHost-6dzfkvsc.js} +1 -1
- package/CodeAgentRpcListener-tcwrdvst.js +182 -0
- package/{CodeTui-z5vkm9ea.js → CodeTui-q55b2zrn.js} +25 -8
- package/TunnelShare-hdq9h1hr.js +14 -0
- package/agent.command-20zaqe60.js +49 -0
- package/akanCode.js +13 -8
- package/{application.command-wthg8nn9.js → application.command-nd0fshsk.js} +45 -12
- package/{applicationBuildRunner-t2r84sz6.js → applicationBuildRunner-s13x3zqb.js} +14 -10
- package/buildBatch.proc.js +7 -7
- package/{cloud.command-sz11hpre.js → cloud.command-8kbddsz9.js} +28 -19
- package/cloud.script-hgvvajm3.js +27 -0
- package/code.command-625bg8s8.js +345 -0
- package/commandManifest.json +1 -1
- package/{context.command-15j9b7c0.js → context.command-p6haqjay.js} +20 -18
- package/context.runner-rsnqnk9j.js +27 -0
- package/{dependencyScanner-3afj2vt1.js → dependencyScanner-78sq8m4q.js} +2 -2
- package/{devTui-q7k7bakd.js → devTui-evr3b35y.js} +1 -1
- package/{fileSys-wzzrntkw.js → fileSys-zpvt5gtf.js} +1 -1
- package/{guideline.command-snh85ctf.js → guideline.command-195g0h9a.js} +4 -4
- package/guidelines/agentRule/agentRule.instruction.md +22 -8
- package/guidelines/conventions/core.md +106 -0
- package/guidelines/conventions/rules/app.md +83 -0
- package/guidelines/conventions/rules/auth.md +46 -0
- package/guidelines/conventions/rules/config.md +60 -0
- package/guidelines/conventions/rules/constant.md +24 -0
- package/guidelines/conventions/rules/gates.md +32 -0
- package/guidelines/conventions/rules/layer.md +25 -0
- package/guidelines/conventions/rules/migration.md +27 -0
- package/guidelines/conventions/rules/module.md +90 -0
- package/guidelines/conventions/rules/page.md +56 -0
- package/guidelines/conventions/rules/sensitive.md +16 -0
- package/guidelines/conventions/rules/server.md +91 -0
- package/guidelines/conventions/rules/ssr.md +47 -0
- package/guidelines/conventions/rules/style.md +43 -0
- package/guidelines/conventions/rules/test.md +34 -0
- package/guidelines/conventions/rules/ts.md +95 -0
- package/guidelines/conventions/rules/tsx.md +76 -0
- package/guidelines/mcpRule/mcpRule.instruction.md +1 -1
- package/guidelines/pageRule/pageRule.instruction.md +8 -7
- package/guidelines/queryRule/queryRule.instruction.md +4 -0
- package/guidelines/runtimeRule/runtimeRule.instruction.md +35 -25
- package/guidelines/ssrRule/ssrRule.instruction.md +11 -10
- package/guidelines/transportRule/transportRule.instruction.md +5 -4
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +4 -4
- package/incrementalBuilder.proc.js +7 -7
- package/{index-301pdbzz.js → index-00a7j05x.js} +7 -7
- package/{index-js6geqjn.js → index-0j1t1h2b.js} +3 -1
- package/{index-6txx6a9p.js → index-1h2jc0x3.js} +154 -88
- package/{index-55j120r8.js → index-1qsd8ft1.js} +65 -145
- package/{index-9th4gszy.js → index-2mwjshz5.js} +233 -1271
- package/index-2nxk8wgs.js +266 -0
- package/{index-j9vyj3dj.js → index-2phm56a1.js} +49 -8
- package/index-35j83zkd.js +61 -0
- package/index-4am4dvmf.js +29 -0
- package/index-75y7bcz4.js +28 -0
- package/index-7apsdr5g.js +487 -0
- package/{index-42j4a8zq.js → index-84h43kg6.js} +8 -6
- package/index-9bv479q5.js +1 -0
- package/{index-3wypz6xj.js → index-9zy8479y.js} +11 -5
- package/{index-a5dhqkdr.js → index-a1vb3x7t.js} +273 -259
- package/{index-52w0fvh8.js → index-bns3wcpc.js} +15 -0
- package/index-cjmjvg4r.js +3622 -0
- package/{index-pcwzkdqb.js → index-defp4gmb.js} +1 -1
- package/index-ewbmfarf.js +1606 -0
- package/index-fbewhg4g.js +590 -0
- package/index-fhw7yq2d.js +653 -0
- package/{index-wcej7g4z.js → index-g500c5j9.js} +271 -105
- package/{index-74tjjsnc.js → index-g841cap9.js} +33 -37
- package/{index-2azahjaw.js → index-gr9thy79.js} +5 -5
- package/{index-4pf8g7ff.js → index-h7hehkw6.js} +3 -0
- package/{index-xjf5j657.js → index-hm0tn7qv.js} +1001 -91
- package/index-j6eeh5d7.js +138 -0
- package/{index-31es1yev.js → index-j7hwy56s.js} +108 -7
- package/{index-skk9zc1x.js → index-jc2zbwra.js} +2 -2
- package/{index-905qdgqp.js → index-khk05tsf.js} +1 -1
- package/{index-5nd1wtkv.js → index-p6x5b7hr.js} +1 -1
- package/{index-tvehn2sp.js → index-qd7xn2bk.js} +1 -1
- package/{index-a58emady.js → index-qw6814m4.js} +55 -17
- package/index-raz588b3.js +445 -0
- package/{index-at7bz0xq.js → index-s4nvxpzm.js} +2 -0
- package/{index-bt438yxm.js → index-sp0qsr7a.js} +116 -13
- package/{index-xb8809yb.js → index-sveq36gh.js} +40 -43
- package/{index-hmt54t45.js → index-t1t9wq9a.js} +4 -4
- package/index-t78230d7.js +191 -0
- package/index-tenw3mah.js +225 -0
- package/{index-qfp55x1y.js → index-tgqameyb.js} +4 -4
- package/{index-espk51ah.js → index-tp56652m.js} +6 -6
- package/index-w15mg3km.js +389 -0
- package/{index-dy0jx9ay.js → index-wwe9rsrx.js} +14 -0
- package/{index-2xcc2ax5.js → index-y4kcmbt2.js} +2 -2
- package/index-yf9wc28h.js +52 -0
- package/{index-0fz95kxe.js → index-zbrwnmf1.js} +9 -7
- package/{index-40brg4px.js → index-zttm13c3.js} +5 -5
- package/index.js +24 -23
- package/{library.command-gycrwhf1.js → library.command-63hgt9te.js} +4 -4
- package/{localRegistry.command-jtd8gaes.js → localRegistry.command-g3f8k25t.js} +46 -22
- package/{module.command-v6hgs1bc.js → module.command-r4sa2khp.js} +7 -6
- package/{package.command-shzpcfph.js → package.command-96eheyvd.js} +5 -5
- package/package.json +2 -2
- package/{page.command-ptxn5kqk.js → page.command-gs6d841d.js} +4 -4
- package/{pipeline.command-zz31pgax.js → pipeline.command-wdfvdbfj.js} +3 -3
- package/{primitive.command-a1vse91z.js → primitive.command-dfsv4mpe.js} +8 -7
- package/{projectTypecheck-2ztky9cf.js → projectTypecheck-kqj1t6hb.js} +1 -1
- package/{prompter-76k56b37.js → prompter-qrwx1p17.js} +2 -2
- package/quality.command-webzxee2.js +78 -0
- package/{repair.command-cvazbz99.js → repair.command-3r3j1xre.js} +7 -6
- package/{routeSourceValidator-6jd0q6r6.js → routeSourceValidator-4h947v7c.js} +13 -3
- package/{scalar.command-0acvyp26.js → scalar.command-e8y47j6d.js} +6 -5
- package/skills/akan-agent/SKILL.md +43 -0
- package/skills/akan-code/SKILL.md +38 -11
- package/skills/akan-debug/SKILL.md +41 -6
- package/skills/akan-deps/SKILL.md +1 -2
- package/skills/akan-err/SKILL.md +2 -1
- package/skills/akan-mcp/SKILL.md +40 -0
- package/skills/akan-page/SKILL.md +44 -0
- package/skills/akan-query/SKILL.md +39 -0
- package/skills/akan-runtime/SKILL.md +43 -0
- package/skills/akan-scaffold/SKILL.md +16 -6
- package/skills/akan-transport/SKILL.md +40 -0
- package/skills/akan-validate/SKILL.md +13 -11
- package/{subspace.command-822qx2bx.js → subspace.command-a1sf9n5a.js} +12 -10
- package/templates/__scalar/__model__/__model__.constant.ts +3 -5
- package/templates/__scalar/__model__/__model__.dictionary.ts +6 -5
- package/templates/__scalar/__model__/__model__.document.ts +3 -3
- package/templates/app/akan.config.ts +2 -3
- package/templates/app/env/env.client.ts +2 -4
- package/templates/app/env/env.client.type.ts +2 -3
- package/templates/app/env/env.server.ts +2 -3
- package/templates/app/lib/___appName__/__appName__.dictionary.ts +1 -2
- package/templates/app/lib/___appName__/__appName__.service.ts +3 -3
- package/templates/app/lib/___appName__/__appName__.signal.ts +5 -5
- package/templates/app/lib/___appName__/__appName__.store.ts +4 -6
- package/templates/app/lib/option.ts +2 -3
- package/templates/app/main.ts +2 -4
- package/templates/app/page/_index.tsx +3 -3
- package/templates/app/page/_layout.tsx +13 -10
- package/templates/appSample/lib/__scalar/workHistory/workHistory.constant.ts +1 -5
- package/templates/appSample/lib/__scalar/workHistory/workHistory.dictionary.ts +1 -1
- package/templates/appSample/lib/_noti/noti.signal.ts +1 -1
- package/templates/appSample/lib/task/Task.Template.tsx +2 -1
- package/templates/appSample/lib/task/Task.Unit.tsx +3 -2
- package/templates/appSample/lib/task/Task.Util.tsx +16 -4
- package/templates/appSample/lib/task/task.constant.ts +1 -5
- package/templates/appSample/lib/task/task.dictionary.ts +2 -8
- package/templates/appSample/lib/task/task.document.ts +1 -1
- package/templates/appSample/lib/task/task.signal.ts +14 -9
- package/templates/appSample/page/task/_index.tsx +2 -1
- package/templates/appSample/page/task/new.tsx +2 -1
- package/templates/appSample/srvkit/guards.ts +11 -0
- package/templates/appSample/ui/QuantityControl.tsx +5 -9
- package/templates/biomeForm.ts +144 -0
- package/templates/crudPages/[__model__Id]/edit/page.tsx +3 -3
- package/templates/crudPages/[__model__Id]/page.tsx +5 -5
- package/templates/crudPages/new/page.tsx +4 -3
- package/templates/crudPages/page.tsx +3 -3
- package/templates/crudSinglePage/page.tsx +9 -5
- package/templates/libRoot/akan.config.ts +2 -3
- package/templates/libRoot/lib/___libName__/__libName__.dictionary.ts +1 -2
- package/templates/libRoot/lib/___libName__/__libName__.service.ts +5 -4
- package/templates/libRoot/lib/___libName__/__libName__.signal.ts +6 -5
- package/templates/libRoot/lib/___libName__/__libName__.store.ts +5 -6
- package/templates/libRoot/lib/option.ts +1 -2
- package/templates/module/__Model__.Template.tsx +11 -10
- package/templates/module/__Model__.Unit.tsx +18 -5
- package/templates/module/__Model__.Util.tsx +9 -7
- package/templates/module/__Model__.View.tsx +9 -6
- package/templates/module/__Model__.Zone.tsx +25 -17
- package/templates/module/__model__.constant.ts +8 -9
- package/templates/module/__model__.dictionary.ts +16 -17
- package/templates/module/__model__.document.ts +6 -8
- package/templates/module/__model__.service.ts +3 -3
- package/templates/module/__model__.signal.ts +11 -10
- package/templates/module/__model__.store.ts +3 -5
- package/templates/service/__model__.dictionary.ts +5 -6
- package/templates/service/__model__.service.ts +3 -3
- package/templates/service/__model__.signal.ts +5 -4
- package/templates/service/__model__.store.ts +3 -5
- package/templates/workspaceRoot/.gitignore.template +4 -0
- package/templates/workspaceRoot/.vscode/settings.json.template +21 -21
- package/templates/workspaceRoot/AGENTS.md.template +4 -10
- package/{tunnel.command-ycmja19q.js → tunnel.command-dcb0wg93.js} +25 -13
- package/{typeChecker-px49mezc.js → typeChecker-j2jdnqsr.js} +1 -1
- package/typecheck.proc.js +6 -1
- package/verify.command-yyepccbh.js +93 -0
- package/{workflow.command-abb1d5xy.js → workflow.command-z5pg9ay0.js} +49 -14
- package/workspace.command-d7x5jttw.js +290 -0
- package/CodeAgent-8d5qs787.js +0 -9
- package/CodeAgentRpcListener-7p7z5dd7.js +0 -97
- package/TunnelShare-qkm8zp03.js +0 -14
- package/agent.command-ydftceda.js +0 -25
- package/cloud.script-nqevg5qw.js +0 -24
- package/code.command-9h3yrzhe.js +0 -167
- package/context.runner-8gg030b0.js +0 -25
- package/guidelines/conventions/conventions.instruction.md +0 -617
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +0 -291
- package/index-2mwc0g0d.js +0 -49
- package/index-4vgbysa0.js +0 -279
- package/index-7md2g9vw.js +0 -6
- package/index-b70zct19.js +0 -856
- package/index-c6eggbee.js +0 -123
- package/index-zzvvc845.js +0 -74
- package/quality.command-ah8qcakd.js +0 -1478
- package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +0 -69
- package/templates/workspaceRoot/docs/GENERATED.md.template +0 -55
- package/workspace.command-qm7cw29v.js +0 -521
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// pkgs/@akanjs/cli/workflows/shared.ts
|
|
3
|
+
var sysInputs = {
|
|
4
|
+
app: {
|
|
5
|
+
type: "string",
|
|
6
|
+
required: true,
|
|
7
|
+
description: "Target app or library name."
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var moduleInput = {
|
|
11
|
+
module: {
|
|
12
|
+
type: "string",
|
|
13
|
+
required: true,
|
|
14
|
+
description: "Target domain, service, or scalar module name."
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var baseValidation = [
|
|
18
|
+
{
|
|
19
|
+
command: "akan verify <app-or-lib>",
|
|
20
|
+
reason: "Sync, lint, typecheck and build the target in one run, printing only what failed.",
|
|
21
|
+
kind: "verify"
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
var stepOf = (id, title, tool) => (description) => ({ id, title, tool, description });
|
|
25
|
+
var inspectModuleStep = stepOf("inspect-module", "Inspect module", "inspectModule");
|
|
26
|
+
var inspectSystemStep = stepOf("inspect-system", "Inspect target system", "inspectSystem");
|
|
27
|
+
var syncGeneratedStep = stepOf("sync-generated", "Sync generated files", "syncTarget");
|
|
28
|
+
var validateTargetStep = stepOf("validate-target", "Validate target", "lintTarget");
|
|
29
|
+
var validateTarget = validateTargetStep("Run validation commands for the target.");
|
|
30
|
+
|
|
31
|
+
// pkgs/@akanjs/cli/workflows/addEnumField.ts
|
|
32
|
+
var addEnumFieldWorkflowSpec = {
|
|
33
|
+
schemaVersion: 1,
|
|
34
|
+
name: "add-enum-field",
|
|
35
|
+
description: "Plan an enum field addition with option and dictionary coverage.",
|
|
36
|
+
whenToUse: "Use when the user asks to add a field with a closed set of values.",
|
|
37
|
+
inputs: {
|
|
38
|
+
...sysInputs,
|
|
39
|
+
...moduleInput,
|
|
40
|
+
field: { type: "string", required: true, description: "Name of the enum field to add." },
|
|
41
|
+
values: { type: "string-list", required: true, description: "Comma-separated enum values." },
|
|
42
|
+
default: { type: "string", description: "Optional default enum value." }
|
|
43
|
+
},
|
|
44
|
+
optionalSurfaces: {
|
|
45
|
+
dictionary: "include",
|
|
46
|
+
option: "include",
|
|
47
|
+
template: "infer",
|
|
48
|
+
unit: "infer",
|
|
49
|
+
view: "infer",
|
|
50
|
+
store: "infer"
|
|
51
|
+
},
|
|
52
|
+
steps: [
|
|
53
|
+
inspectModuleStep("Read module files and existing enum conventions."),
|
|
54
|
+
{
|
|
55
|
+
id: "update-constant",
|
|
56
|
+
title: "Update enum field",
|
|
57
|
+
tool: "updateConstantEnumField",
|
|
58
|
+
description: "Plan enum type and field shape changes."
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "update-dictionary",
|
|
62
|
+
title: "Update dictionary",
|
|
63
|
+
tool: "updateDictionaryEnum",
|
|
64
|
+
description: "Plan enum labels and field labels."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: "update-option",
|
|
68
|
+
title: "Update options",
|
|
69
|
+
tool: "updateOptionEnum",
|
|
70
|
+
description: "Plan option entries used by UI controls."
|
|
71
|
+
},
|
|
72
|
+
syncGeneratedStep("Refresh generated files after enum source changes."),
|
|
73
|
+
validateTarget
|
|
74
|
+
],
|
|
75
|
+
predictedChanges: [
|
|
76
|
+
{ target: "*/lib/<module>/<module>.constant.ts", action: "modify", reason: "Enum field shape is added." },
|
|
77
|
+
{ target: "*/lib/<module>/<module>.dictionary.ts", action: "modify", reason: "Enum labels are added." },
|
|
78
|
+
{ target: "*/lib/<module>/<module>.option.ts", action: "modify", reason: "Enum options may be added." }
|
|
79
|
+
],
|
|
80
|
+
validation: baseValidation,
|
|
81
|
+
completionCriteria: ["Enum values are represented.", "Labels and options exist.", "Sync, lint, and typecheck pass."]
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// pkgs/@akanjs/cli/workflows/addField.ts
|
|
85
|
+
var addFieldWorkflowSpec = {
|
|
86
|
+
schemaVersion: 1,
|
|
87
|
+
name: "add-field",
|
|
88
|
+
description: "Plan a field addition across domain and selected UI surfaces.",
|
|
89
|
+
whenToUse: "Use when the user asks to add a new field to an existing domain module.",
|
|
90
|
+
inputs: {
|
|
91
|
+
...sysInputs,
|
|
92
|
+
...moduleInput,
|
|
93
|
+
field: { type: "string", required: true, description: "Name of the field to add." },
|
|
94
|
+
type: {
|
|
95
|
+
type: "string",
|
|
96
|
+
required: true,
|
|
97
|
+
description: "Field type or scalar name. Use Int for integer fields or Float for decimal fields; do not use Number."
|
|
98
|
+
},
|
|
99
|
+
values: { type: "string-list", description: "Comma-separated enum values when type is enum." },
|
|
100
|
+
default: {
|
|
101
|
+
type: "string",
|
|
102
|
+
description: "Optional default value. plan/apply coerce by field type: Int/Float to numeric literals, Boolean to true/false, Date (now, a timestamp, or a date string) to a () => dayjs(...) thunk, String/scalar to string literals, and enum only when the value is in values."
|
|
103
|
+
},
|
|
104
|
+
surfaces: {
|
|
105
|
+
type: "string-list",
|
|
106
|
+
description: "Optional UI surfaces to update, comma-separated. Use template to auto-update simple generated Template forms; View/Unit stay planned as manual review."
|
|
107
|
+
},
|
|
108
|
+
includeInLight: {
|
|
109
|
+
type: "boolean",
|
|
110
|
+
description: "Whether to add the field to the Light<Model> projection used by list/card displays."
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
optionalSurfaces: {
|
|
114
|
+
dictionary: "include",
|
|
115
|
+
template: "infer",
|
|
116
|
+
unit: "infer",
|
|
117
|
+
view: "infer",
|
|
118
|
+
store: "infer"
|
|
119
|
+
},
|
|
120
|
+
steps: [
|
|
121
|
+
inspectModuleStep("Read module files and detect existing field/UI patterns."),
|
|
122
|
+
{
|
|
123
|
+
id: "update-constant",
|
|
124
|
+
title: "Update constant",
|
|
125
|
+
tool: "updateConstantField",
|
|
126
|
+
description: "Plan the source-of-truth field shape change."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: "update-dictionary",
|
|
130
|
+
title: "Update dictionary",
|
|
131
|
+
tool: "updateDictionaryField",
|
|
132
|
+
description: "Plan field labels and user-facing text."
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: "update-ui-surfaces",
|
|
136
|
+
title: "Update UI surfaces",
|
|
137
|
+
tool: "updateUiSurfaces",
|
|
138
|
+
description: "Plan optional Template, Unit, View, and Store updates according to inferred surfaces.",
|
|
139
|
+
when: "optionalSurfaces.* is include or infer"
|
|
140
|
+
},
|
|
141
|
+
syncGeneratedStep("Refresh generated files after source changes."),
|
|
142
|
+
validateTarget
|
|
143
|
+
],
|
|
144
|
+
predictedChanges: [
|
|
145
|
+
{
|
|
146
|
+
target: "*/lib/<module>/<module>.constant.ts",
|
|
147
|
+
action: "modify",
|
|
148
|
+
applyScope: "auto",
|
|
149
|
+
reason: "Field shape is added."
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
target: "*/lib/<module>/<module>.dictionary.ts",
|
|
153
|
+
action: "modify",
|
|
154
|
+
applyScope: "auto",
|
|
155
|
+
reason: "Field label is added."
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
target: "*/lib/<module>/<Module>.Template.tsx",
|
|
159
|
+
action: "modify",
|
|
160
|
+
applyScope: "manual-review",
|
|
161
|
+
reason: "Form surface may include the field."
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
target: "*/lib/cnst.ts",
|
|
165
|
+
action: "sync",
|
|
166
|
+
applyScope: "generated-sync",
|
|
167
|
+
reason: "Generated constants may change after sync."
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
target: "*/lib/dict.ts",
|
|
171
|
+
action: "sync",
|
|
172
|
+
applyScope: "generated-sync",
|
|
173
|
+
reason: "Generated dictionary barrel may change after sync."
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
validation: baseValidation,
|
|
177
|
+
completionCriteria: [
|
|
178
|
+
"Field exists in source-of-truth module shape.",
|
|
179
|
+
"Dictionary labels cover the field.",
|
|
180
|
+
"Generated files are refreshed.",
|
|
181
|
+
"Lint and typecheck pass."
|
|
182
|
+
]
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// pkgs/@akanjs/cli/workflows/addMutation.ts
|
|
186
|
+
var addMutationWorkflowSpec = {
|
|
187
|
+
schemaVersion: 1,
|
|
188
|
+
name: "add-mutation",
|
|
189
|
+
description: "Write one state-changing act end to end: document chain method, service method, guarded signal mutation, store action, dictionary entry, and a signal test placeholder.",
|
|
190
|
+
whenToUse: "Use when the user asks for a new state-changing module action, or when a store action or component chains two or more writes: bundle them into this one mutation with `with` and `after`.",
|
|
191
|
+
inputs: {
|
|
192
|
+
...sysInputs,
|
|
193
|
+
...moduleInput,
|
|
194
|
+
mutation: {
|
|
195
|
+
type: "string",
|
|
196
|
+
required: true,
|
|
197
|
+
description: "Mutation name with the model re-added (archiveTask); the document chain method drops it (archive)."
|
|
198
|
+
},
|
|
199
|
+
guard: {
|
|
200
|
+
type: "string-list",
|
|
201
|
+
required: true,
|
|
202
|
+
description: "Guard class names the endpoint names (Admin, or Every,Person). No default: each must be exported by the target's srvkit, a lib it reaches, or akanjs/signal; None is refused."
|
|
203
|
+
},
|
|
204
|
+
with: {
|
|
205
|
+
type: "string-list",
|
|
206
|
+
description: "<serviceRef>.<method> writes that must commit with the mutation (courtPc.pushPcCommand); the service method runs them inside this.transaction()."
|
|
207
|
+
},
|
|
208
|
+
after: {
|
|
209
|
+
type: "string-list",
|
|
210
|
+
description: "<serviceRef>.<method> side effects that run once the commit lands (noti.sendArchived); each goes through this.afterCommit()."
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
optionalSurfaces: {
|
|
214
|
+
document: "include",
|
|
215
|
+
service: "include",
|
|
216
|
+
signal: "include",
|
|
217
|
+
store: "include",
|
|
218
|
+
dictionary: "include",
|
|
219
|
+
test: "include",
|
|
220
|
+
util: "infer"
|
|
221
|
+
},
|
|
222
|
+
steps: [
|
|
223
|
+
inspectModuleStep("Read the document, service, signal, store, and dictionary the mutation spans."),
|
|
224
|
+
{
|
|
225
|
+
id: "update-document",
|
|
226
|
+
title: "Update document",
|
|
227
|
+
tool: "updateDocumentChain",
|
|
228
|
+
description: "Add the chain method (validate \u2192 mutate \u2192 return this, never save()) under a transition comment."
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: "update-service",
|
|
232
|
+
title: "Update service",
|
|
233
|
+
tool: "updateServiceMutation",
|
|
234
|
+
description: "Add the bare verb (archive for archiveMemo): load \u2192 chain \u2192 return await save(); with `with`/`after`, wrap it in this.transaction() and queue side effects in this.afterCommit(). Under a guard that only checks sign-in, a TODO marks where the acting user's right to the record is checked."
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
id: "update-signal",
|
|
238
|
+
title: "Update signal",
|
|
239
|
+
tool: "updateSignalMutation",
|
|
240
|
+
description: "Add the mutation to the Endpoint with the chosen guards and a one-line exec; the acting user comes through .with() only when the guard guarantees one."
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
id: "update-store",
|
|
244
|
+
title: "Update store",
|
|
245
|
+
tool: "updateStoreAction",
|
|
246
|
+
description: "Add the store action: one call to the endpoint, then set<Model> with the result."
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
id: "update-dictionary",
|
|
250
|
+
title: "Update dictionary",
|
|
251
|
+
tool: "updateDictionaryEndpoint",
|
|
252
|
+
description: "Add the .endpoint() entry with a [en, ko] label, a .desc(), and every .arg() named."
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
id: "add-signal-test",
|
|
256
|
+
title: "Add signal test",
|
|
257
|
+
tool: "addSignalTest",
|
|
258
|
+
description: "Add it.todo placeholders for the mutation to <module>.signal.test.ts, creating the file if missing."
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
id: "connect-action-ui",
|
|
262
|
+
title: "Connect action UI",
|
|
263
|
+
tool: "connectActionUi",
|
|
264
|
+
description: "Review where a Util control calls the new store action."
|
|
265
|
+
},
|
|
266
|
+
syncGeneratedStep("Refresh generated service, signal, and store barrels."),
|
|
267
|
+
validateTarget
|
|
268
|
+
],
|
|
269
|
+
predictedChanges: [
|
|
270
|
+
{
|
|
271
|
+
target: "*/lib/<module>/<module>.document.ts",
|
|
272
|
+
action: "modify",
|
|
273
|
+
applyScope: "auto",
|
|
274
|
+
reason: "Document chain method is added."
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
target: "*/lib/<module>/<module>.service.ts",
|
|
278
|
+
action: "modify",
|
|
279
|
+
applyScope: "auto",
|
|
280
|
+
reason: "Service mutation method is added, with injected services for `with`/`after`."
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
target: "*/lib/<module>/<module>.signal.ts",
|
|
284
|
+
action: "modify",
|
|
285
|
+
applyScope: "auto",
|
|
286
|
+
reason: "Guarded signal mutation is added."
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
target: "*/lib/<module>/<module>.store.ts",
|
|
290
|
+
action: "modify",
|
|
291
|
+
applyScope: "auto",
|
|
292
|
+
reason: "Store action calling the mutation is added."
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
target: "*/lib/<module>/<module>.dictionary.ts",
|
|
296
|
+
action: "modify",
|
|
297
|
+
applyScope: "auto",
|
|
298
|
+
reason: "Dictionary endpoint entry is added."
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
target: "*/lib/<module>/<module>.signal.test.ts",
|
|
302
|
+
action: "modify",
|
|
303
|
+
applyScope: "auto",
|
|
304
|
+
reason: "Signal test placeholders are added (the file is created when missing)."
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
target: "*/lib/<module>/<Module>.Util.tsx",
|
|
308
|
+
action: "modify",
|
|
309
|
+
applyScope: "manual-review",
|
|
310
|
+
reason: "A control may call the new store action."
|
|
311
|
+
},
|
|
312
|
+
{ target: "*/lib/srv.ts", action: "sync", reason: "Generated service barrel may change after sync." },
|
|
313
|
+
{ target: "*/lib/sig.ts", action: "sync", reason: "Generated signal barrel may change after sync." }
|
|
314
|
+
],
|
|
315
|
+
validation: baseValidation,
|
|
316
|
+
completionCriteria: [
|
|
317
|
+
"The chain method validates and mutates, and its transition comment names the real states.",
|
|
318
|
+
"Every write that must land together runs in the one service method; no store action sends a second mutation.",
|
|
319
|
+
"The endpoint names guards that admit exactly the intended caller.",
|
|
320
|
+
"The signal test placeholders are replaced by real cases.",
|
|
321
|
+
"Generated files are refreshed and validation passes."
|
|
322
|
+
],
|
|
323
|
+
replacesRules: [
|
|
324
|
+
"akan.store.multi-write",
|
|
325
|
+
"akan.component.write-chain",
|
|
326
|
+
"akan.store.root-write-chain",
|
|
327
|
+
"akan.write.placement"
|
|
328
|
+
]
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
// pkgs/@akanjs/cli/workflows/addSlice.ts
|
|
332
|
+
var addSliceWorkflowSpec = {
|
|
333
|
+
schemaVersion: 1,
|
|
334
|
+
name: "add-slice",
|
|
335
|
+
description: "Plan a list/query slice across data access, signal, and view surfaces.",
|
|
336
|
+
whenToUse: "Use when the user asks for a filtered list, tab, segment, or reusable query slice.",
|
|
337
|
+
inputs: {
|
|
338
|
+
...sysInputs,
|
|
339
|
+
...moduleInput,
|
|
340
|
+
slice: { type: "string", required: true, description: "Slice or query name." }
|
|
341
|
+
},
|
|
342
|
+
optionalSurfaces: {
|
|
343
|
+
service: "include",
|
|
344
|
+
signal: "include",
|
|
345
|
+
zone: "infer",
|
|
346
|
+
page: "infer",
|
|
347
|
+
dictionary: "include"
|
|
348
|
+
},
|
|
349
|
+
steps: [
|
|
350
|
+
inspectModuleStep("Read existing query, slice, zone, and page loading patterns."),
|
|
351
|
+
{
|
|
352
|
+
id: "update-service-query",
|
|
353
|
+
title: "Update service query",
|
|
354
|
+
tool: "updateServiceSlice",
|
|
355
|
+
description: "Plan the query helper or filter handling."
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
id: "update-signal-slice",
|
|
359
|
+
title: "Update signal slice",
|
|
360
|
+
tool: "updateSignalSlice",
|
|
361
|
+
description: "Plan the signal slice contract."
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
id: "connect-view-surfaces",
|
|
365
|
+
title: "Connect view surfaces",
|
|
366
|
+
tool: "connectSliceSurfaces",
|
|
367
|
+
description: "Plan optional Zone and page loader changes."
|
|
368
|
+
},
|
|
369
|
+
syncGeneratedStep("Refresh generated files after slice changes."),
|
|
370
|
+
validateTarget
|
|
371
|
+
],
|
|
372
|
+
predictedChanges: [
|
|
373
|
+
{
|
|
374
|
+
target: "*/lib/<module>/<module>.service.ts",
|
|
375
|
+
action: "modify",
|
|
376
|
+
applyScope: "auto",
|
|
377
|
+
reason: "Query helper method stub is added."
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
target: "*/lib/<module>/<module>.signal.ts",
|
|
381
|
+
action: "modify",
|
|
382
|
+
applyScope: "auto",
|
|
383
|
+
reason: "Signal slice entry is added."
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
target: "*/lib/<module>/<Module>.Zone.tsx",
|
|
387
|
+
action: "modify",
|
|
388
|
+
applyScope: "manual-review",
|
|
389
|
+
reason: "Zone may connect slice state."
|
|
390
|
+
},
|
|
391
|
+
{ target: "*/lib/sig.ts", action: "sync", reason: "Generated signal barrel may change after sync." }
|
|
392
|
+
],
|
|
393
|
+
validation: baseValidation,
|
|
394
|
+
completionCriteria: [
|
|
395
|
+
"Slice query and signal shape align.",
|
|
396
|
+
"Optional view surfaces are planned.",
|
|
397
|
+
"Validation passes."
|
|
398
|
+
]
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
// pkgs/@akanjs/cli/workflows/createInteraction.ts
|
|
402
|
+
var createInteractionWorkflowSpec = {
|
|
403
|
+
schemaVersion: 1,
|
|
404
|
+
name: "create-interaction",
|
|
405
|
+
description: "Plan a client interaction as a webkit hook over a pure, tested common/ class, so a component holds markup and not the logic behind it.",
|
|
406
|
+
whenToUse: "Use when a Zone, Util, or Template grows event handling, keyboard or pointer logic, or layout math, or reaches into the store for it: move it into the hook and the pure class instead.",
|
|
407
|
+
inputs: {
|
|
408
|
+
...sysInputs,
|
|
409
|
+
interaction: {
|
|
410
|
+
type: "string",
|
|
411
|
+
required: true,
|
|
412
|
+
description: "Interaction name in camelCase (boardKeys): webkit/useBoardKeys.tsx over common/boardKeys.ts."
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
optionalSurfaces: {
|
|
416
|
+
webkit: "include",
|
|
417
|
+
common: "include",
|
|
418
|
+
zone: "infer",
|
|
419
|
+
util: "infer"
|
|
420
|
+
},
|
|
421
|
+
steps: [
|
|
422
|
+
inspectSystemStep("Read the target's webkit and common layers."),
|
|
423
|
+
{
|
|
424
|
+
id: "create-interaction",
|
|
425
|
+
title: "Create interaction",
|
|
426
|
+
tool: "createInteraction",
|
|
427
|
+
description: "Create the use<X> hook, the pure <X> class, and its colocated test."
|
|
428
|
+
},
|
|
429
|
+
syncGeneratedStep("Refresh the webkit and common barrels."),
|
|
430
|
+
validateTarget
|
|
431
|
+
],
|
|
432
|
+
predictedChanges: [
|
|
433
|
+
{
|
|
434
|
+
target: "*/common/<interaction>.ts",
|
|
435
|
+
action: "create",
|
|
436
|
+
applyScope: "auto",
|
|
437
|
+
reason: "Pure, isomorphic interaction logic."
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
target: "*/common/<interaction>.test.ts",
|
|
441
|
+
action: "create",
|
|
442
|
+
applyScope: "auto",
|
|
443
|
+
reason: "Colocated test of the pure logic."
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
target: "*/webkit/use<Interaction>.tsx",
|
|
447
|
+
action: "create",
|
|
448
|
+
applyScope: "auto",
|
|
449
|
+
reason: '"use client" hook returning a named object of closures.'
|
|
450
|
+
},
|
|
451
|
+
{ target: "*/common/index.ts", action: "sync", reason: "Generated common barrel exports the new class." },
|
|
452
|
+
{ target: "*/webkit/index.ts", action: "sync", reason: "Generated webkit barrel exports the new hook." }
|
|
453
|
+
],
|
|
454
|
+
validation: [
|
|
455
|
+
...baseValidation,
|
|
456
|
+
{ command: "akan test <app-or-lib>", reason: "Run the pure logic's colocated test.", kind: "custom" }
|
|
457
|
+
],
|
|
458
|
+
completionCriteria: [
|
|
459
|
+
"Decisions live in the common/ class and are covered by its test.",
|
|
460
|
+
"The hook wires events and the store, and returns a named object.",
|
|
461
|
+
"The component calls the hook instead of holding the logic.",
|
|
462
|
+
"Generated barrels are refreshed and validation passes."
|
|
463
|
+
],
|
|
464
|
+
replacesRules: ["akan.component.store-access", "akan.write.placement"]
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
// pkgs/@akanjs/cli/workflows/createModule.ts
|
|
468
|
+
var createModuleWorkflowSpec = {
|
|
469
|
+
schemaVersion: 1,
|
|
470
|
+
name: "create-module",
|
|
471
|
+
description: "Plan a new database-backed domain module using Akan module conventions.",
|
|
472
|
+
whenToUse: "Use when the user asks for a new business entity with constant, service, signal, store, and UI surfaces.",
|
|
473
|
+
inputs: {
|
|
474
|
+
...sysInputs,
|
|
475
|
+
module: { type: "string", required: true, description: "Name of the module to create." }
|
|
476
|
+
},
|
|
477
|
+
optionalSurfaces: {
|
|
478
|
+
page: "infer",
|
|
479
|
+
template: "include",
|
|
480
|
+
unit: "include",
|
|
481
|
+
view: "include"
|
|
482
|
+
},
|
|
483
|
+
steps: [
|
|
484
|
+
inspectSystemStep("Check the target app or library before planning new module files."),
|
|
485
|
+
{
|
|
486
|
+
id: "create-module",
|
|
487
|
+
title: "Create module",
|
|
488
|
+
tool: "createModule",
|
|
489
|
+
description: "Use the existing create-module primitive to scaffold conventional module files."
|
|
490
|
+
},
|
|
491
|
+
syncGeneratedStep("Refresh generated barrels after adding a module."),
|
|
492
|
+
validateTargetStep("Run validation commands that prove the scaffold matches Akan conventions.")
|
|
493
|
+
],
|
|
494
|
+
predictedChanges: [
|
|
495
|
+
{ target: "*/lib/<module>/*", action: "create", reason: "New module source files are scaffolded." },
|
|
496
|
+
{ target: "*/lib/cnst.ts", action: "sync", reason: "Generated constant barrel may include the new module." },
|
|
497
|
+
{ target: "*/lib/srv.ts", action: "sync", reason: "Generated service barrel may include the new module." },
|
|
498
|
+
{ target: "*/lib/sig.ts", action: "sync", reason: "Generated signal barrel may include the new module." }
|
|
499
|
+
],
|
|
500
|
+
validation: baseValidation,
|
|
501
|
+
completionCriteria: [
|
|
502
|
+
"Module abstract and conventional files exist.",
|
|
503
|
+
"Generated files are refreshed with sync.",
|
|
504
|
+
"Lint passes for the target."
|
|
505
|
+
]
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
// pkgs/@akanjs/cli/workflows/createScalar.ts
|
|
509
|
+
var createScalarWorkflowSpec = {
|
|
510
|
+
schemaVersion: 1,
|
|
511
|
+
name: "create-scalar",
|
|
512
|
+
description: "Plan a reusable scalar value module without database ownership.",
|
|
513
|
+
whenToUse: "Use when the user asks for a reusable value object, primitive domain type, or shared scalar.",
|
|
514
|
+
inputs: {
|
|
515
|
+
...sysInputs,
|
|
516
|
+
scalar: { type: "string", required: true, description: "Name of the scalar to create." }
|
|
517
|
+
},
|
|
518
|
+
optionalSurfaces: {
|
|
519
|
+
dictionary: "include"
|
|
520
|
+
},
|
|
521
|
+
steps: [
|
|
522
|
+
inspectSystemStep("Check the target app or library before planning a scalar."),
|
|
523
|
+
{
|
|
524
|
+
id: "create-scalar",
|
|
525
|
+
title: "Create scalar",
|
|
526
|
+
tool: "createScalar",
|
|
527
|
+
description: "Use the existing create-scalar primitive to scaffold scalar files."
|
|
528
|
+
},
|
|
529
|
+
syncGeneratedStep("Refresh generated barrels after adding a scalar."),
|
|
530
|
+
validateTargetStep("Run validation commands for the scalar target.")
|
|
531
|
+
],
|
|
532
|
+
predictedChanges: [
|
|
533
|
+
{ target: "*/lib/__scalar/<scalar>/*", action: "create", reason: "New scalar source files are scaffolded." }
|
|
534
|
+
],
|
|
535
|
+
validation: baseValidation,
|
|
536
|
+
completionCriteria: ["Scalar files exist under __scalar.", "Generated files are refreshed.", "Lint passes."]
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
// pkgs/@akanjs/cli/workflows/createUi.ts
|
|
540
|
+
var createUiWorkflowSpec = {
|
|
541
|
+
schemaVersion: 1,
|
|
542
|
+
name: "create-ui",
|
|
543
|
+
description: "Plan creation of a conventional module UI surface.",
|
|
544
|
+
whenToUse: "Use when the user asks for a View, Unit, Template, Zone, or Util component for an existing module.",
|
|
545
|
+
inputs: {
|
|
546
|
+
...sysInputs,
|
|
547
|
+
...moduleInput,
|
|
548
|
+
surface: {
|
|
549
|
+
type: "string",
|
|
550
|
+
required: true,
|
|
551
|
+
description: "UI surface to create.",
|
|
552
|
+
allowedValues: ["view", "unit", "template", "zone", "util"]
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
optionalSurfaces: {
|
|
556
|
+
dictionary: "infer",
|
|
557
|
+
store: "infer"
|
|
558
|
+
},
|
|
559
|
+
steps: [
|
|
560
|
+
inspectModuleStep("Read existing module context and component files."),
|
|
561
|
+
{
|
|
562
|
+
id: "create-ui",
|
|
563
|
+
title: "Create UI surface",
|
|
564
|
+
tool: "createUi",
|
|
565
|
+
description: "Create the requested UI surface through an Akan primitive."
|
|
566
|
+
},
|
|
567
|
+
syncGeneratedStep("Refresh UI barrels after adding a component."),
|
|
568
|
+
validateTarget
|
|
569
|
+
],
|
|
570
|
+
predictedChanges: [
|
|
571
|
+
{ target: "*/lib/<module>/<Module>.<Surface>.tsx", action: "create", reason: "New UI component is created." },
|
|
572
|
+
{ target: "*/ui/index.ts", action: "sync", reason: "Generated UI barrel may include the new component." }
|
|
573
|
+
],
|
|
574
|
+
validation: baseValidation,
|
|
575
|
+
completionCriteria: ["Requested UI surface exists.", "UI barrels are refreshed.", "Lint passes."]
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
// pkgs/@akanjs/cli/workflows/index.ts
|
|
579
|
+
var workflowSpecs = [
|
|
580
|
+
createModuleWorkflowSpec,
|
|
581
|
+
createScalarWorkflowSpec,
|
|
582
|
+
createUiWorkflowSpec,
|
|
583
|
+
createInteractionWorkflowSpec,
|
|
584
|
+
addFieldWorkflowSpec,
|
|
585
|
+
addEnumFieldWorkflowSpec,
|
|
586
|
+
addMutationWorkflowSpec,
|
|
587
|
+
addSliceWorkflowSpec
|
|
588
|
+
];
|
|
589
|
+
|
|
590
|
+
export { sysInputs, workflowSpecs };
|