@akanjs/cli 3.0.0-alpha.7 → 3.0.0-alpha.71
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/README.ko.md +1 -1
- package/README.md +1 -1
- package/{abstractCompactor-e5yq60qz.js → abstractCompactor-20e0cwbs.js} +2 -2
- package/{agent.command-pggr92jj.js → agent.command-xdvw642m.js} +9 -7
- package/{application.command-692yap1d.js → application.command-g3f7xj25.js} +31 -6
- package/{applicationBuildRunner-ha3y8ew8.js → applicationBuildRunner-af0wtspv.js} +19 -14
- package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-93nzdfsy.js} +1 -1
- package/buildBatch.proc.js +7 -5
- package/{capacitorApp-p0z5yab2.js → capacitorApp-b0ppke3m.js} +29 -27
- package/{cloud.command-wqfsyzv2.js → cloud.command-0hmsv44q.js} +12 -10
- package/commandManifest.json +1 -1
- package/{context.command-9bxtdn0w.js → context.command-x92afrnf.js} +17 -15
- package/{dependencyScanner-f6grrep3.js → dependencyScanner-rbs2407b.js} +1 -1
- package/getDirname-ka11hm7e.js +8 -0
- package/{guideline.command-nfqahxex.js → guideline.command-hpq08q66.js} +8 -6
- package/guidelines/agentRule/agentRule.generate.json +31 -0
- package/guidelines/agentRule/agentRule.instruction.md +525 -0
- package/guidelines/conventions/conventions.generate.json +25 -0
- package/guidelines/conventions/conventions.instruction.md +839 -0
- package/guidelines/cssRule/cssRule.instruction.md +7 -0
- package/guidelines/framework/framework.generate.json +3 -2
- package/guidelines/framework/framework.instruction.md +1 -9
- package/guidelines/mcpRule/mcpRule.generate.json +25 -0
- package/guidelines/mcpRule/mcpRule.instruction.md +217 -0
- package/guidelines/queryRule/queryRule.generate.json +31 -0
- package/guidelines/queryRule/queryRule.instruction.md +143 -0
- package/guidelines/runtimeRule/runtimeRule.generate.json +25 -0
- package/guidelines/runtimeRule/runtimeRule.instruction.md +176 -0
- package/guidelines/transportRule/transportRule.generate.json +31 -0
- package/guidelines/transportRule/transportRule.instruction.md +60 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +24 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +263 -0
- package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +33 -0
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +402 -0
- package/incrementalBuilder.proc.js +8 -6
- package/index-1577bej2.js +7 -0
- package/{index-vg0sj9nc.js → index-5f4gnt4c.js} +258 -97
- package/{index-bjpxzr6s.js → index-5vy2jzar.js} +1 -1
- package/{index-mssqn2sq.js → index-6d5r8q6k.js} +54 -15
- package/{index-p3f4q532.js → index-737aj4fm.js} +14 -13
- package/{index-2c3e2xh8.js → index-8besc14m.js} +1 -1
- package/{index-qb61h0k7.js → index-abyjt72y.js} +333 -540
- package/{index-xhgtkekh.js → index-cbfp5wyp.js} +1 -1
- package/{index-5dw57f0d.js → index-cp00yns2.js} +80 -14
- package/{index-ztpw544k.js → index-ety6takb.js} +3 -3
- package/index-f39512t6.js +255 -0
- package/{index-6rhabeev.js → index-gvq17wqn.js} +5 -3
- package/{index-js368gk9.js → index-hs70d8ed.js} +6 -6
- package/{index-7myvn0f0.js → index-j37qq1f2.js} +1 -1
- package/{index-azv0xjb5.js → index-jybbmwed.js} +8 -4
- package/{index-4hek879p.js → index-m5gfc86a.js} +1 -1
- package/{index-w6wbb612.js → index-nq3avsf6.js} +13 -13
- package/{index-vtj3zps1.js → index-p27h7535.js} +8 -8
- package/{index-5pmx7bkg.js → index-pehn44hr.js} +3 -3
- package/{index-j9cxndc0.js → index-qnv0aqmm.js} +9 -6
- package/{index-gmy45vz2.js → index-r691v756.js} +4 -4
- package/{index-0cj2zxbm.js → index-sh01r3pm.js} +1 -1
- package/{index-a1e0j63x.js → index-sqsfv8wg.js} +15 -7
- package/{index-gex7c8kd.js → index-wbbswwqt.js} +51 -24
- package/{index-bz2sfzzt.js → index-wybbcgxn.js} +4 -4
- package/index.js +21 -19
- package/{library.command-md9715jz.js → library.command-8vgrdtwy.js} +6 -4
- package/{localRegistry.command-exkbamyj.js → localRegistry.command-0gtqj0r0.js} +11 -9
- package/{module.command-w5aaddxk.js → module.command-rama4zya.js} +10 -8
- package/{package.command-yfkrcy0z.js → package.command-6jxapdsg.js} +6 -4
- package/package.json +4 -5
- package/{page.command-echbavp4.js → page.command-hxy7x525.js} +6 -4
- package/{primitive.command-9fbhspw2.js → primitive.command-4bf6xcc3.js} +11 -9
- package/{quality.command-3pnt9yep.js → quality.command-h5edwegz.js} +192 -97
- package/{recipeScanner-tghkzrrt.js → recipeScanner-zrzev25x.js} +3 -3
- package/{repair.command-carj4vax.js → repair.command-rgqf6px6.js} +8 -6
- package/{routeSourceValidator-e4jmbfcx.js → routeSourceValidator-7fycdqyv.js} +1 -1
- package/{scalar.command-51ryzypc.js → scalar.command-6krkz6tw.js} +9 -7
- package/templates/app/env/env.client.debug.ts.template +1 -5
- package/templates/app/env/env.client.develop.ts.template +1 -5
- package/templates/app/env/env.client.local.ts.template +1 -5
- package/templates/app/env/env.client.main.ts.template +1 -5
- package/templates/app/env/env.client.testing.ts.template +1 -5
- package/templates/app/env/env.client.type.ts +2 -6
- package/templates/app/env/env.server.debug.ts.template +1 -5
- package/templates/app/env/env.server.develop.ts.template +1 -5
- package/templates/app/env/env.server.local.ts.template +1 -5
- package/templates/app/env/env.server.main.ts.template +1 -5
- package/templates/app/main.ts +3 -1
- package/templates/app/page/styles.css.template +3 -3
- package/templates/appSample/srvkit/AuthGuard.ts +9 -5
- package/templates/appSample/srvkit/SessionInternalArg.ts +4 -3
- package/templates/crudPages/[__model__Id]/edit/page.tsx +1 -1
- package/templates/crudPages/new/page.tsx +1 -1
- package/templates/crudSinglePage/page.tsx +1 -1
- package/templates/env/_env.server.type.ts +7 -5
- package/templates/lib/db.ts +1 -1
- package/templates/lib/dict.ts +1 -1
- package/templates/lib/sig.ts +1 -1
- package/templates/lib/srv.ts +6 -2
- package/templates/module/__Model__.Util.tsx +1 -1
- package/templates/module/__Model__.Zone.tsx +3 -5
- package/templates/workspaceRoot/AGENTS.md.template +4 -972
- package/templates/workspaceRoot/CLAUDE.md.template +19 -0
- package/templates/workspaceRoot/biome.json.template +4 -244
- package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +10 -14
- package/templates/workspaceRoot/docs/GENERATED.md.template +12 -10
- package/templates/workspaceRoot/package.json.template +1 -1
- package/{typeChecker-kravn7ns.js → typeChecker-g6bh0xfv.js} +1 -1
- package/typecheck.proc.js +1 -1
- package/{workflow.command-91wmvm8k.js → workflow.command-dwhwrqhd.js} +16 -14
- package/{workspace.command-wa10mfd9.js → workspace.command-f5h11gjn.js} +71 -52
- package/templates/workspaceRoot/.cursor/rules/akan-page-routing.mdc.template +0 -43
- package/templates/workspaceRoot/.cursor/rules/akan-sync-conventions.mdc.template +0 -34
- package/templates/workspaceRoot/.cursor/rules/application-test-commands.mdc.template +0 -16
- package/templates/workspaceRoot/.cursor/rules/change-scope.mdc.template +0 -12
- package/templates/workspaceRoot/.cursor/rules/client-server-boundaries.mdc.template +0 -18
- package/templates/workspaceRoot/.cursor/rules/coding-comments.mdc.template +0 -25
- package/templates/workspaceRoot/.cursor/rules/coding-style.mdc.template +0 -44
- package/templates/workspaceRoot/.cursor/rules/domain-module-conventions.mdc.template +0 -17
- package/templates/workspaceRoot/.cursor/rules/format-lint.mdc.template +0 -12
- package/templates/workspaceRoot/.cursor/rules/lint-enforced-rules.mdc.template +0 -19
- package/templates/workspaceRoot/.cursor/rules/module-file-playbook.mdc.template +0 -62
- package/templates/workspaceRoot/.cursor/rules/naming-conventions.mdc.template +0 -15
- package/templates/workspaceRoot/.cursor/rules/react-component-style.mdc.template +0 -21
- package/templates/workspaceRoot/.cursor/rules/repo-overview.mdc.template +0 -17
- package/templates/workspaceRoot/.cursor/rules/scalar-modeling.mdc.template +0 -99
- package/templates/workspaceRoot/.cursor/rules/secrets-and-env.mdc.template +0 -13
- package/templates/workspaceRoot/.cursor/rules/service-signal-conventions.mdc.template +0 -83
- package/templates/workspaceRoot/.cursor/rules/srvkit-adapters-and-guards.mdc.template +0 -50
- package/templates/workspaceRoot/.cursor/rules/ssr-first.mdc.template +0 -59
- package/templates/workspaceRoot/.cursor/rules/typescript-imports.mdc.template +0 -16
- /package/{index-r24hmh0q.js → index-yb2wsc7f.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-6d5r8q6k.js";
|
|
5
5
|
import {
|
|
6
6
|
WorkflowExecutor,
|
|
7
7
|
compactWorkflowInputs,
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
workflowCommandsForPlan,
|
|
24
24
|
workflowPlanApproval,
|
|
25
25
|
writeWorkflowRunArtifact
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-8besc14m.js";
|
|
27
27
|
import {
|
|
28
28
|
runner
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-gvq17wqn.js";
|
|
30
30
|
|
|
31
31
|
// pkgs/@akanjs/cli/workflow/workflow.runner.ts
|
|
32
32
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
@@ -849,6 +849,7 @@ class ClientEntriesBundler {
|
|
|
849
849
|
#externalSubpaths;
|
|
850
850
|
#externalAliases;
|
|
851
851
|
#command;
|
|
852
|
+
#target;
|
|
852
853
|
#outputSubdir;
|
|
853
854
|
#reactFastRefresh;
|
|
854
855
|
#artifactDir;
|
|
@@ -870,6 +871,7 @@ class ClientEntriesBundler {
|
|
|
870
871
|
this.#externalSubpaths = options.externalSubpaths ?? [];
|
|
871
872
|
this.#externalAliases = options.externalAliases ?? {};
|
|
872
873
|
this.#command = options.command ?? "start";
|
|
874
|
+
this.#target = options.target ?? "browser";
|
|
873
875
|
this.#outputSubdir = options.outputSubdir ?? "client";
|
|
874
876
|
this.#reactFastRefresh = options.reactFastRefresh ?? false;
|
|
875
877
|
this.#artifactDir = `${this.#command === "build" ? this.#app.dist.cwdPath : this.#app.cwdPath}/.akan/artifact`;
|
|
@@ -883,7 +885,7 @@ class ClientEntriesBundler {
|
|
|
883
885
|
entrypoints: this.#opaqueEntries.entries,
|
|
884
886
|
outdir: this.#outdir,
|
|
885
887
|
splitting: true,
|
|
886
|
-
target:
|
|
888
|
+
target: this.#target,
|
|
887
889
|
format: "esm",
|
|
888
890
|
naming: CLIENT_BUNDLE_NAMING,
|
|
889
891
|
metafile: true,
|
|
@@ -1117,7 +1119,8 @@ var VENDOR_SPECIFIERS = [
|
|
|
1117
1119
|
"akanjs/store",
|
|
1118
1120
|
"akanjs/base",
|
|
1119
1121
|
"akanjs/common",
|
|
1120
|
-
"akanjs/constant"
|
|
1122
|
+
"akanjs/constant",
|
|
1123
|
+
"akanjs/fetch"
|
|
1121
1124
|
];
|
|
1122
1125
|
|
|
1123
1126
|
// pkgs/@akanjs/devkit/frontendBuild/routeClientBuilder.ts
|
|
@@ -1226,12 +1229,11 @@ class RouteClientBuilder {
|
|
|
1226
1229
|
}).bundle();
|
|
1227
1230
|
}
|
|
1228
1231
|
async#buildSsrBundle(bootstrapEntries) {
|
|
1229
|
-
const externalOptions = RouteClientBuilder.resolveSsrClientExternalOptions(this.#command);
|
|
1230
1232
|
return new ClientEntriesBundler({
|
|
1231
1233
|
app: this.#app,
|
|
1232
1234
|
entries: bootstrapEntries.buildEntries,
|
|
1233
1235
|
plugins: [await createBarrelImportsPlugin(this.#app)],
|
|
1234
|
-
...
|
|
1236
|
+
...RouteClientBuilder.resolveSsrClientBundleOptions(this.#command),
|
|
1235
1237
|
outputSubdir: "client-ssr",
|
|
1236
1238
|
command: this.#command
|
|
1237
1239
|
}).bundle();
|
|
@@ -1293,15 +1295,16 @@ ${defaultNames.map((name) => `export default ${name};`).join(`
|
|
|
1293
1295
|
const serverEntry = RouteClientBuilder.resolveAkanServerEntry();
|
|
1294
1296
|
return { [Bun.resolveSync("akanjs/fetch", serverEntry)]: "akanjs/fetch" };
|
|
1295
1297
|
}
|
|
1296
|
-
static
|
|
1298
|
+
static resolveSsrClientBundleOptions(command) {
|
|
1297
1299
|
if (command === "start") {
|
|
1298
1300
|
return {
|
|
1301
|
+
target: "bun",
|
|
1299
1302
|
external: SSR_CLIENT_EXTERNALS,
|
|
1300
1303
|
externalSubpaths: ["akanjs/fetch"],
|
|
1301
1304
|
externalAliases: RouteClientBuilder.resolveSsrClientRuntimeAliases()
|
|
1302
1305
|
};
|
|
1303
1306
|
}
|
|
1304
|
-
return { external: SSR_CLIENT_ALIAS_EXTERNALS };
|
|
1307
|
+
return { target: "bun", external: SSR_CLIENT_ALIAS_EXTERNALS };
|
|
1305
1308
|
}
|
|
1306
1309
|
static resolveAkanServerEntry() {
|
|
1307
1310
|
try {
|
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
} from "./index-ss469dec.js";
|
|
5
5
|
import {
|
|
6
6
|
AiSession
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-sh01r3pm.js";
|
|
8
8
|
import {
|
|
9
9
|
createPassedPrimitiveReport,
|
|
10
10
|
generatedFilesForSync,
|
|
11
11
|
scalarChangedFiles
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-8besc14m.js";
|
|
13
13
|
import {
|
|
14
14
|
Prompter
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-j37qq1f2.js";
|
|
16
16
|
import {
|
|
17
17
|
runner,
|
|
18
18
|
script
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-gvq17wqn.js";
|
|
20
20
|
|
|
21
21
|
// pkgs/@akanjs/cli/scalar/scalar.prompt.ts
|
|
22
22
|
import { input } from "@inquirer/prompts";
|
|
@@ -240,7 +240,7 @@ import { ChatOpenAI } from "@langchain/openai";
|
|
|
240
240
|
import { Logger } from "akanjs/common";
|
|
241
241
|
import chalk from "chalk";
|
|
242
242
|
var MAX_ASK_TRY = 300;
|
|
243
|
-
var deepSeekLlmModels = ["deepseek-
|
|
243
|
+
var deepSeekLlmModels = ["deepseek-v4-flash", "deepseek-v4-pro"];
|
|
244
244
|
var openAiLlmModels = ["gpt-5.5"];
|
|
245
245
|
var supportedLlmModels = [...deepSeekLlmModels, ...openAiLlmModels];
|
|
246
246
|
var isOpenAiLlmModel = (model) => openAiLlmModels.includes(model);
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-gvq17wqn.js";
|
|
6
6
|
import {
|
|
7
7
|
LibExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-5f4gnt4c.js";
|
|
9
9
|
|
|
10
10
|
// pkgs/@akanjs/cli/semver.ts
|
|
11
|
-
|
|
11
|
+
var stripRangeOperator = (version) => version.replace(/^[\s^~>=<v]+/, "").trim();
|
|
12
|
+
var parseVersion = (version) => {
|
|
12
13
|
return version.replace(/^[^\d]*/, "").split(/[.-]/).map((part) => Number.parseInt(part, 10)).map((part) => Number.isFinite(part) ? part : 0);
|
|
13
|
-
}
|
|
14
|
-
|
|
14
|
+
};
|
|
15
|
+
var compareNumeric = (a, b) => {
|
|
15
16
|
const left = parseVersion(a);
|
|
16
17
|
const right = parseVersion(b);
|
|
17
18
|
const length = Math.max(left.length, right.length);
|
|
@@ -21,7 +22,14 @@ function compareSemver(a, b) {
|
|
|
21
22
|
return diff > 0 ? 1 : -1;
|
|
22
23
|
}
|
|
23
24
|
return 0;
|
|
24
|
-
}
|
|
25
|
+
};
|
|
26
|
+
var compareSemver = (a, b) => {
|
|
27
|
+
try {
|
|
28
|
+
return Bun.semver.order(stripRangeOperator(a), stripRangeOperator(b));
|
|
29
|
+
} catch {
|
|
30
|
+
return compareNumeric(a, b);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
25
33
|
|
|
26
34
|
// pkgs/@akanjs/cli/library/library.runner.ts
|
|
27
35
|
class LibraryRunner extends runner("library") {
|
|
@@ -70,7 +78,7 @@ class LibraryRunner extends runner("library") {
|
|
|
70
78
|
return [dep, newerVersion];
|
|
71
79
|
}));
|
|
72
80
|
Object.keys(allDependencies).sort().forEach((dep) => {
|
|
73
|
-
if (
|
|
81
|
+
if (libPackageJson.dependencies?.[dep] || rootPackageJson.dependencies?.[dep])
|
|
74
82
|
dependencies[dep] = allDependencies[dep];
|
|
75
83
|
else
|
|
76
84
|
devDependencies[dep] = allDependencies[dep];
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-6d5r8q6k.js";
|
|
5
5
|
import {
|
|
6
6
|
Prompter
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-j37qq1f2.js";
|
|
8
8
|
import {
|
|
9
9
|
runner,
|
|
10
10
|
script
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-gvq17wqn.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT_BLOCK_END,
|
|
14
14
|
AGENT_BLOCK_START,
|
|
15
15
|
AppExecutor,
|
|
16
|
+
CLAUDE_COMMENT_RULE,
|
|
16
17
|
LibExecutor,
|
|
18
|
+
readDevkitVersion,
|
|
17
19
|
renderRecipeEntries,
|
|
20
|
+
stampBlockVersion,
|
|
18
21
|
upsertAgentBlock
|
|
19
|
-
} from "./index-
|
|
22
|
+
} from "./index-5f4gnt4c.js";
|
|
20
23
|
import {
|
|
21
24
|
collectRecipeSources,
|
|
22
25
|
scanRecipes
|
|
@@ -87,15 +90,14 @@ ${scopeIndexPointer}
|
|
|
87
90
|
`;
|
|
88
91
|
return `## Recipes
|
|
89
92
|
|
|
90
|
-
Framework UI recipes (Tailwind-variant look factories), importable from every app and lib
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
the
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
near-duplicate.** Full authoring/consumption policy: the \`recipeRule\` guideline.
|
|
93
|
+
Framework UI recipes (Tailwind-variant look factories), importable from every app and lib: \`import { <name> } from
|
|
94
|
+
"akanjs/ui"\`, then \`<name>(variants?, className?)\`. The second arg merges internally and takes **an array too**, so
|
|
95
|
+
never wrap it in \`cn()\`: \`<name>({}, ["h-full", isWide && "w-full", className])\`. The list below is the full
|
|
96
|
+
contract (\`*\` marks the default, \`key?\` is a boolean flag) \u2014 do not guess a name, path, or variant value, and do
|
|
97
|
+
not open the recipe file to consume one. **Before inlining a repeated surface (card, box, tile, \u2026): reuse a recipe,
|
|
98
|
+
or add one as \`apps/<app>/ui/Recipe/<name>.ts\`, one per file, re-exported from that folder's \`index.ts\` \u2014 never
|
|
99
|
+
re-implement the same look inline in several places, and never author a near-duplicate.** Full policy: the
|
|
100
|
+
\`recipeRule\` guideline.
|
|
99
101
|
|
|
100
102
|
${renderRecipeEntries(recipes)}
|
|
101
103
|
|
|
@@ -103,19 +105,33 @@ ${scopeIndexPointer}
|
|
|
103
105
|
|
|
104
106
|
`;
|
|
105
107
|
};
|
|
108
|
+
var renderGuides = async (context) => {
|
|
109
|
+
const conventions = (await Prompter.getInstruction("conventions")).trim();
|
|
110
|
+
if (context.pkgs.some((pkg) => pkg.name === "akanjs"))
|
|
111
|
+
return conventions;
|
|
112
|
+
const onboarding = (await Prompter.getInstruction("workspaceOnboarding")).trim();
|
|
113
|
+
const appName = context.apps[0]?.name ?? "app";
|
|
114
|
+
return `${conventions}
|
|
115
|
+
|
|
116
|
+
${onboarding.replaceAll("<%= appName %>", appName)}`;
|
|
117
|
+
};
|
|
106
118
|
var renderManagedBlock = async (workspace) => {
|
|
107
119
|
const context = await AkanContextAnalyzer.analyze(workspace);
|
|
108
120
|
const frameworkGuide = await Prompter.getInstruction("framework");
|
|
109
121
|
const appNames = context.apps.map((app) => app.name);
|
|
110
122
|
const sampleCleanup = await renderSampleCleanup(workspace, appNames);
|
|
111
123
|
const recipeIndex = await renderRecipeIndex(workspace);
|
|
112
|
-
|
|
124
|
+
const guides = await renderGuides(context);
|
|
125
|
+
const version = await readDevkitVersion();
|
|
126
|
+
const block = `## Workspace
|
|
113
127
|
|
|
114
128
|
- Repo: ${context.repoName}
|
|
115
129
|
- Apps: ${context.apps.map((app) => app.name).join(", ") || "none"}
|
|
116
130
|
- Libraries: ${context.libs.map((lib) => lib.name).join(", ") || "none"}
|
|
117
131
|
- Packages: ${context.pkgs.map((pkg) => pkg.name).join(", ") || "none"}
|
|
118
132
|
|
|
133
|
+
${guides}
|
|
134
|
+
|
|
119
135
|
${sampleCleanup}## Akan Module Abstracts
|
|
120
136
|
|
|
121
137
|
- Before changing a domain, service, or scalar module, read its \`*.abstract.md\` file first.
|
|
@@ -131,15 +147,12 @@ If generated output is stale or broken, update the owning source file and run \`
|
|
|
131
147
|
|
|
132
148
|
${recipeIndex}## MCP Workflow Policy
|
|
133
149
|
|
|
134
|
-
- Prefer Akan
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
- If no workflow exists, or apply reports unsupported/no-op/failed diagnostics that require manual action, keep edits scoped to owning source files and never patch generated files directly.
|
|
141
|
-
- For compound requests, split the request into workflows and apply each \`planPath\` in order, such as \`create-module\` followed by \`add-field\`.
|
|
142
|
-
- **CLI-only fallback (MCP not connected):** \`akan mcp\` starts a stdio MCP server, so the \`list_workflows\`/\`plan_workflow\`/\`apply_workflow\` tools exist only when your agent is wired to it as an MCP client. When they are unavailable, the CLI is a first-class equivalent: \`akan workflow list\` / \`explain <name>\` / \`plan <name> ... --format json --out <planPath>\` / \`apply <planPath> --format json\`, \`akan doctor --strict --format json\` for validation, and \`akan repair generated|imports|module-shape --app <app> --format json\` for repairs. Scaffolding primitives (\`create-module\`/\`create-scalar\`/\`create-service\` take the target app/lib as a POSITIONAL arg; \`add-field\`/\`add-enum-field\` use \`--app\`/\`--module\` flags) call the same code the workflows do.
|
|
150
|
+
- **Prefer an Akan workflow to a direct source edit.** A direct edit is denied when an allowlisted workflow or repair tool can make the change.
|
|
151
|
+
- Inspect with \`akan mcp --mode plan\` (\`list_workflows\`, \`explain_workflow\`, \`plan_workflow\`); apply with \`akan mcp --mode apply\`, which allowlists \`apply_workflow\`, \`run_validation\`, and the repair tools.
|
|
152
|
+
- If \`plan_workflow\` returns \`planPath\` or \`next.tool=apply_workflow\`, call \`apply_workflow({ planPath })\` before editing source. Then run \`run_validation\` with \`validationTarget\` when present, otherwise \`applyReportPath\`.
|
|
153
|
+
- Split a compound request into workflows and apply each \`planPath\` in order, such as \`create-module\` followed by \`add-field\`.
|
|
154
|
+
- When no workflow exists, or apply reports unsupported/no-op/failed diagnostics needing manual action, keep edits scoped to owning source files and never patch generated files directly.
|
|
155
|
+
- **MCP not connected?** The CLI is a first-class equivalent \u2014 \`akan workflow list\` / \`explain\` / \`plan\` / \`apply\`, \`akan doctor\`, \`akan repair\`. See the onboarding guide's CLI-only fallback for the exact flags.
|
|
143
156
|
|
|
144
157
|
## Validation
|
|
145
158
|
|
|
@@ -148,7 +161,19 @@ ${context.validationCommands.map((command) => `- \`${command}\``).join(`
|
|
|
148
161
|
|
|
149
162
|
## Framework Guide
|
|
150
163
|
|
|
151
|
-
${frameworkGuide.trim()}
|
|
164
|
+
${frameworkGuide.trim()}
|
|
165
|
+
|
|
166
|
+
## Before You Finish
|
|
167
|
+
|
|
168
|
+
1. \`bun run akan lint <appName>\` \u2014 Tailwind class order, \`Err\`, \`console\`, \`#private\` scope, unused imports.
|
|
169
|
+
2. \`bun run akan typecheck <appName>\` \u2014 server/client boundary violations.
|
|
170
|
+
3. \`bun run akan sync <appName>\` if you added, renamed, or deleted any file.
|
|
171
|
+
4. Did you write or change a \`.tsx\` file? \`bun run akan quality ssr\` \u2014 did the server share hold, and did you add
|
|
172
|
+
a \`"use client"\` you cannot justify?
|
|
173
|
+
5. Re-read the file you wrote against its section above.
|
|
174
|
+
6. Did you add a comment? Delete it unless it documents an external constraint or a security decision.
|
|
175
|
+
7. Did behavior or an invariant change? Update the module's \`*.abstract.md\`.`;
|
|
176
|
+
return version ? stampBlockVersion(block, version) : block;
|
|
152
177
|
};
|
|
153
178
|
var renderAgentsMd = async (workspace, existing) => {
|
|
154
179
|
const block = await renderManagedBlock(workspace);
|
|
@@ -171,6 +196,8 @@ var renderClaudeMd = async (workspace) => {
|
|
|
171
196
|
return `# ${context.repoName} \u2014 Claude Code Guide
|
|
172
197
|
|
|
173
198
|
@AGENTS.md
|
|
199
|
+
|
|
200
|
+
${CLAUDE_COMMENT_RULE}
|
|
174
201
|
`;
|
|
175
202
|
};
|
|
176
203
|
var renderCursorRule = () => `---
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ModuleScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-p27h7535.js";
|
|
5
5
|
import {
|
|
6
6
|
addFieldUiPolicyForType,
|
|
7
7
|
coerceFieldDefault,
|
|
@@ -34,15 +34,15 @@ import {
|
|
|
34
34
|
sourceFile,
|
|
35
35
|
validationCommandsForTarget,
|
|
36
36
|
viaBuilderParameterName
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-8besc14m.js";
|
|
38
38
|
import {
|
|
39
39
|
script
|
|
40
|
-
} from "./index-
|
|
40
|
+
} from "./index-gvq17wqn.js";
|
|
41
41
|
import {
|
|
42
42
|
AppExecutor,
|
|
43
43
|
LibExecutor,
|
|
44
44
|
ModuleExecutor
|
|
45
|
-
} from "./index-
|
|
45
|
+
} from "./index-5f4gnt4c.js";
|
|
46
46
|
|
|
47
47
|
// pkgs/@akanjs/cli/primitive/primitive.script.ts
|
|
48
48
|
import { capitalize } from "akanjs/common";
|
package/index.js
CHANGED
|
@@ -4,35 +4,37 @@ import {
|
|
|
4
4
|
getTargetCommandNames,
|
|
5
5
|
getTargetMetas,
|
|
6
6
|
runCommands
|
|
7
|
-
} from "./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
} from "./index-gvq17wqn.js";
|
|
8
|
+
import"./index-5f4gnt4c.js";
|
|
9
|
+
import"./index-f39512t6.js";
|
|
9
10
|
import"./index-mxvakhsm.js";
|
|
11
|
+
import"./index-1577bej2.js";
|
|
10
12
|
import"./index-67546d0j.js";
|
|
11
13
|
import {
|
|
12
14
|
__require
|
|
13
|
-
} from "./index-
|
|
15
|
+
} from "./index-yb2wsc7f.js";
|
|
14
16
|
|
|
15
17
|
// pkgs/@akanjs/cli/commandManifest.ts
|
|
16
18
|
import path from "path";
|
|
17
19
|
|
|
18
20
|
// pkgs/@akanjs/cli/commandModules.ts
|
|
19
21
|
var commandModules = {
|
|
20
|
-
workspace: async () => (await import("./workspace.command-
|
|
21
|
-
agent: async () => (await import("./agent.command-
|
|
22
|
-
application: async () => (await import("./application.command-
|
|
23
|
-
library: async () => (await import("./library.command-
|
|
24
|
-
localRegistry: async () => (await import("./localRegistry.command-
|
|
25
|
-
package: async () => (await import("./package.command-
|
|
26
|
-
module: async () => (await import("./module.command-
|
|
27
|
-
page: async () => (await import("./page.command-
|
|
28
|
-
context: async () => (await import("./context.command-
|
|
29
|
-
cloud: async () => (await import("./cloud.command-
|
|
30
|
-
guideline: async () => (await import("./guideline.command-
|
|
31
|
-
scalar: async () => (await import("./scalar.command-
|
|
32
|
-
primitive: async () => (await import("./primitive.command-
|
|
33
|
-
quality: async () => (await import("./quality.command-
|
|
34
|
-
repair: async () => (await import("./repair.command-
|
|
35
|
-
workflow: async () => (await import("./workflow.command-
|
|
22
|
+
workspace: async () => (await import("./workspace.command-f5h11gjn.js")).WorkspaceCommand,
|
|
23
|
+
agent: async () => (await import("./agent.command-xdvw642m.js")).AgentCommand,
|
|
24
|
+
application: async () => (await import("./application.command-g3f7xj25.js")).ApplicationCommand,
|
|
25
|
+
library: async () => (await import("./library.command-8vgrdtwy.js")).LibraryCommand,
|
|
26
|
+
localRegistry: async () => (await import("./localRegistry.command-0gtqj0r0.js")).LocalRegistryCommand,
|
|
27
|
+
package: async () => (await import("./package.command-6jxapdsg.js")).PackageCommand,
|
|
28
|
+
module: async () => (await import("./module.command-rama4zya.js")).ModuleCommand,
|
|
29
|
+
page: async () => (await import("./page.command-hxy7x525.js")).PageCommand,
|
|
30
|
+
context: async () => (await import("./context.command-x92afrnf.js")).ContextCommand,
|
|
31
|
+
cloud: async () => (await import("./cloud.command-0hmsv44q.js")).CloudCommand,
|
|
32
|
+
guideline: async () => (await import("./guideline.command-hpq08q66.js")).GuidelineCommand,
|
|
33
|
+
scalar: async () => (await import("./scalar.command-6krkz6tw.js")).ScalarCommand,
|
|
34
|
+
primitive: async () => (await import("./primitive.command-4bf6xcc3.js")).PrimitiveCommand,
|
|
35
|
+
quality: async () => (await import("./quality.command-h5edwegz.js")).QualityCommand,
|
|
36
|
+
repair: async () => (await import("./repair.command-rgqf6px6.js")).RepairCommand,
|
|
37
|
+
workflow: async () => (await import("./workflow.command-dwhwrqhd.js")).WorkflowCommand
|
|
36
38
|
};
|
|
37
39
|
var commandModuleIds = Object.keys(commandModules);
|
|
38
40
|
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
LibraryScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-sqsfv8wg.js";
|
|
5
5
|
import {
|
|
6
6
|
Lib,
|
|
7
7
|
Workspace,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-gvq17wqn.js";
|
|
10
|
+
import"./index-5f4gnt4c.js";
|
|
11
|
+
import"./index-f39512t6.js";
|
|
11
12
|
import"./index-mxvakhsm.js";
|
|
13
|
+
import"./index-1577bej2.js";
|
|
12
14
|
import"./index-67546d0j.js";
|
|
13
|
-
import"./index-
|
|
15
|
+
import"./index-yb2wsc7f.js";
|
|
14
16
|
|
|
15
17
|
// pkgs/@akanjs/cli/library/library.command.ts
|
|
16
18
|
class LibraryCommand extends command("library", [LibraryScript], ({ public: target }) => ({
|
|
@@ -2,31 +2,33 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CloudRunner,
|
|
4
4
|
getNpmRegistryUrl
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-737aj4fm.js";
|
|
6
6
|
import {
|
|
7
7
|
PackageScript
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
} from "./index-jybbmwed.js";
|
|
9
|
+
import"./index-sh01r3pm.js";
|
|
10
10
|
import {
|
|
11
11
|
ApplicationScript
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-cp00yns2.js";
|
|
13
|
+
import"./index-sqsfv8wg.js";
|
|
13
14
|
import"./index-76rn3g2c.js";
|
|
14
|
-
import"./index-a1e0j63x.js";
|
|
15
15
|
import {
|
|
16
16
|
Workspace,
|
|
17
17
|
command,
|
|
18
18
|
runner,
|
|
19
19
|
script
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-gvq17wqn.js";
|
|
21
21
|
import"./index-fgc8r6dj.js";
|
|
22
|
-
import"./index-
|
|
22
|
+
import"./index-5vy2jzar.js";
|
|
23
23
|
import {
|
|
24
24
|
PkgExecutor
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-5f4gnt4c.js";
|
|
26
|
+
import"./index-f39512t6.js";
|
|
26
27
|
import"./index-mxvakhsm.js";
|
|
28
|
+
import"./index-1577bej2.js";
|
|
27
29
|
import"./index-46tjzh6s.js";
|
|
28
30
|
import"./index-67546d0j.js";
|
|
29
|
-
import"./index-
|
|
31
|
+
import"./index-yb2wsc7f.js";
|
|
30
32
|
|
|
31
33
|
// pkgs/@akanjs/cli/localRegistry/localRegistry.runner.ts
|
|
32
34
|
import { mkdir, rm } from "fs/promises";
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ModuleScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-4hek879p.js";
|
|
4
|
+
} from "./index-p27h7535.js";
|
|
6
5
|
import"./index-ss469dec.js";
|
|
7
|
-
import"./index-
|
|
6
|
+
import"./index-m5gfc86a.js";
|
|
7
|
+
import"./index-sh01r3pm.js";
|
|
8
8
|
import {
|
|
9
9
|
renderPrimitiveReport
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
} from "./index-8besc14m.js";
|
|
11
|
+
import"./index-j37qq1f2.js";
|
|
12
12
|
import {
|
|
13
13
|
Module,
|
|
14
14
|
Sys,
|
|
15
15
|
command
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
16
|
+
} from "./index-gvq17wqn.js";
|
|
17
|
+
import"./index-5f4gnt4c.js";
|
|
18
|
+
import"./index-f39512t6.js";
|
|
18
19
|
import"./index-mxvakhsm.js";
|
|
20
|
+
import"./index-1577bej2.js";
|
|
19
21
|
import"./index-67546d0j.js";
|
|
20
|
-
import"./index-
|
|
22
|
+
import"./index-yb2wsc7f.js";
|
|
21
23
|
|
|
22
24
|
// pkgs/@akanjs/cli/module/module.command.ts
|
|
23
25
|
import { Logger, lowerlize } from "akanjs/common";
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PackageScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-jybbmwed.js";
|
|
5
5
|
import {
|
|
6
6
|
Pkg,
|
|
7
7
|
Workspace,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-gvq17wqn.js";
|
|
10
|
+
import"./index-5f4gnt4c.js";
|
|
11
|
+
import"./index-f39512t6.js";
|
|
11
12
|
import"./index-mxvakhsm.js";
|
|
13
|
+
import"./index-1577bej2.js";
|
|
12
14
|
import"./index-46tjzh6s.js";
|
|
13
15
|
import"./index-67546d0j.js";
|
|
14
|
-
import"./index-
|
|
16
|
+
import"./index-yb2wsc7f.js";
|
|
15
17
|
|
|
16
18
|
// pkgs/@akanjs/cli/package/package.command.ts
|
|
17
19
|
class PackageCommand extends command("package", [PackageScript], ({ public: target }) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.71",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"directory": "pkgs/@akanjs/cli"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
|
-
"bun": ">=1.
|
|
17
|
+
"bun": ">=1.4.0"
|
|
18
18
|
},
|
|
19
19
|
"bin": {
|
|
20
20
|
"akan": "./index.js",
|
|
@@ -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": "3.0.0-alpha.
|
|
37
|
+
"akanjs": "3.0.0-alpha.71",
|
|
38
38
|
"chalk": "^5.6.2",
|
|
39
39
|
"commander": "^14.0.3",
|
|
40
40
|
"dayjs": "^1.11.20",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"fonteditor-core": "^2.6.3",
|
|
43
43
|
"ignore": "^7.0.5",
|
|
44
44
|
"ink": "^6.8.0",
|
|
45
|
-
"js-yaml": "^4.1.1",
|
|
46
45
|
"ora": "^9.4.0",
|
|
47
46
|
"qrcode": "^1.5.4",
|
|
48
47
|
"react": "19.2.7",
|
|
@@ -56,4 +55,4 @@
|
|
|
56
55
|
"bun": {
|
|
57
56
|
"platform": "bun"
|
|
58
57
|
}
|
|
59
|
-
}
|
|
58
|
+
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PageScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-m5gfc86a.js";
|
|
5
5
|
import {
|
|
6
6
|
App,
|
|
7
7
|
Module,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-gvq17wqn.js";
|
|
10
|
+
import"./index-5f4gnt4c.js";
|
|
11
|
+
import"./index-f39512t6.js";
|
|
11
12
|
import"./index-mxvakhsm.js";
|
|
13
|
+
import"./index-1577bej2.js";
|
|
12
14
|
import"./index-67546d0j.js";
|
|
13
|
-
import"./index-
|
|
15
|
+
import"./index-yb2wsc7f.js";
|
|
14
16
|
|
|
15
17
|
// pkgs/@akanjs/cli/page/page.command.ts
|
|
16
18
|
class PageCommand extends command("page", [PageScript], ({ public: target }) => ({
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PrimitiveScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-4hek879p.js";
|
|
4
|
+
} from "./index-wybbcgxn.js";
|
|
5
|
+
import"./index-p27h7535.js";
|
|
7
6
|
import"./index-ss469dec.js";
|
|
8
|
-
import"./index-
|
|
7
|
+
import"./index-m5gfc86a.js";
|
|
8
|
+
import"./index-sh01r3pm.js";
|
|
9
9
|
import {
|
|
10
10
|
renderPrimitiveReport
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
} from "./index-8besc14m.js";
|
|
12
|
+
import"./index-j37qq1f2.js";
|
|
13
13
|
import {
|
|
14
14
|
Workspace,
|
|
15
15
|
command
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
16
|
+
} from "./index-gvq17wqn.js";
|
|
17
|
+
import"./index-5f4gnt4c.js";
|
|
18
|
+
import"./index-f39512t6.js";
|
|
18
19
|
import"./index-mxvakhsm.js";
|
|
20
|
+
import"./index-1577bej2.js";
|
|
19
21
|
import"./index-67546d0j.js";
|
|
20
|
-
import"./index-
|
|
22
|
+
import"./index-yb2wsc7f.js";
|
|
21
23
|
|
|
22
24
|
// pkgs/@akanjs/cli/primitive/primitive.command.ts
|
|
23
25
|
import { Logger } from "akanjs/common";
|