@akanjs/cli 3.2.0-rc.9 → 3.2.1-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 +2 -2
- package/CodeAgent-xdw73nbz.js +11 -0
- package/{CodeTui-qstk5vpj.js → CodeTui-0gewm71c.js} +822 -666
- package/README.ko.md +7 -0
- package/README.md +7 -0
- package/TunnelShare-cccfdgbm.js +16 -0
- package/agent.command-g1mj34wz.js +59 -0
- package/akanCode.js +12 -12
- package/appExecutor-rrx10jya.js +11 -0
- package/{application.command-m4rq4wc2.js → application.command-3w4v7t40.js} +84 -40
- package/{applicationBuildRunner-df7rx3ra.js → applicationBuildRunner-y5xbetyz.js} +51 -20
- package/buildBatch.proc.js +31 -16
- package/{cloud.command-a0gy0qq2.js → cloud.command-ph0rz6sw.js} +28 -29
- package/cloud.script-8bs9tp4j.js +30 -0
- package/{code.command-5rsdqw8s.js → code.command-9b967qpg.js} +13 -9
- package/context.command-ndzs5rbf.js +62 -0
- package/context.runner-bmstpng2.js +32 -0
- package/csrArtifactBuilder-gtvff6k7.js +10 -0
- package/{index-qd7xn2bk.js → dependencyScanner-93g8tk0r.js} +7 -6
- package/{devTui-h77zrjv5.js → devTui-rf374y2w.js} +1 -1
- package/{fileSys-zpvt5gtf.js → fileSys-e5mwt73x.js} +1 -1
- package/frameworkGraph-aneq2nwy.js +8 -0
- package/{guideline.command-mffxknbr.js → guideline.command-y8qz9kxy.js} +9 -5
- package/guidelines/agentRule/agentRule.instruction.md +25 -9
- package/guidelines/akanApi/akanApi.instruction.md +6 -4
- package/guidelines/conventions/core.md +23 -5
- package/guidelines/conventions/rules/app.md +4 -1
- package/guidelines/conventions/rules/page.md +5 -4
- package/guidelines/conventions/rules/ts.md +3 -3
- package/guidelines/errorCodes/errorCodes.instruction.md +165 -0
- package/guidelines/fieldRule/fieldRule.instruction.md +2 -1
- package/guidelines/mcpRule/mcpRule.instruction.md +225 -5
- package/guidelines/pageRule/pageRule.instruction.md +10 -1
- package/guidelines/queryRule/queryRule.instruction.md +3 -1
- package/guidelines/runtimeRule/runtimeRule.instruction.md +14 -8
- package/guidelines/transportRule/transportRule.instruction.md +31 -1
- package/incrementalBuilder.proc.js +609 -437
- package/{index-skmtj8rm.js → index-02v45hh9.js} +27 -10
- package/{index-j6gc8n14.js → index-0csk6jqm.js} +11 -9
- package/{index-2r9ff9qm.js → index-0wa5z6rm.js} +2 -2
- package/{index-nmvhjn8c.js → index-0z8sbdme.js} +93 -82
- package/{index-2vgv7fs7.js → index-1c2807kg.js} +727 -693
- package/{index-hj6w4ka1.js → index-1p81ecbz.js} +1 -1
- package/{index-2mf1aen9.js → index-1p9bxjmt.js} +2 -2
- package/{index-an76bdrv.js → index-2kh4xj3m.js} +1 -1
- package/{index-99qvtff2.js → index-2vn0m9z5.js} +5 -5
- package/{index-rp4yf32g.js → index-3569fr49.js} +36 -29
- package/{index-xvk2a75m.js → index-38x8ynrx.js} +25 -25
- package/{index-cmg5ngqa.js → index-3fmzz9sf.js} +20 -20
- package/{index-rfzp4pqs.js → index-45aprybg.js} +3 -3
- package/{index-k92x3vne.js → index-4a1n0nym.js} +1 -1
- package/{index-ra9fvn7s.js → index-4zgm54wf.js} +76 -40
- package/{index-exn38bzx.js → index-652f3bs8.js} +116 -54
- package/{index-grxs6fts.js → index-6gepp8yn.js} +57 -31
- package/{index-vm0dn0mt.js → index-6j351de4.js} +294 -157
- package/{index-w15mg3km.js → index-7ssr7wq4.js} +1 -1
- package/{index-gxav1bjz.js → index-82cmbpxc.js} +9 -9
- package/{index-2mrn1mrg.js → index-9f3reh2y.js} +1 -1
- package/{index-gcx48get.js → index-9rymt8d6.js} +2 -2
- package/{index-swwjakt0.js → index-ankyx6dj.js} +14 -18
- package/{index-28x1aszt.js → index-b0t92k71.js} +154 -58
- package/index-b372rck5.js +799 -0
- package/{index-yf9wc28h.js → index-bejy9zyc.js} +1 -1
- package/{index-r0a604h4.js → index-c669pbyb.js} +5 -4
- package/{index-xyn02k0w.js → index-cm9rb480.js} +662 -433
- package/{index-j9790rhk.js → index-d0n78fzc.js} +1635 -1139
- package/{index-hqv34wzq.js → index-dr1carpr.js} +10 -10
- package/index-f2arv0mv.js +30 -0
- package/{index-5radqwn2.js → index-gtydr9qc.js} +12 -12
- package/{index-j6eeh5d7.js → index-j3fqs8rc.js} +5 -5
- package/{index-yckz5t8b.js → index-jdw9m5c4.js} +516 -434
- package/{index-ny2k80mv.js → index-jf4vk1s0.js} +9 -2
- package/{index-x40bdsca.js → index-jg5rwrf7.js} +77 -115
- package/{index-5zwr4n6k.js → index-ktxdfqg5.js} +65 -8
- package/index-mnhrqjjq.js +127 -0
- package/{index-3ghdb7p5.js → index-pc42gxa5.js} +2777 -3676
- package/{index-0hbtve0a.js → index-q8h4eg5y.js} +32 -28
- package/{index-j3v29pq7.js → index-qh81drde.js} +219 -175
- package/{index-b4qq3rq0.js → index-rwgqba9p.js} +1 -1
- package/{index-w8yasvpc.js → index-scfsqen7.js} +2136 -2175
- package/{index-9p260r4e.js → index-trffs83s.js} +538 -250
- package/{index-0gg15zwa.js → index-twjgmryg.js} +6 -6
- package/index-whvhsb5f.js +80 -0
- package/{index-h7hehkw6.js → index-xczjdng6.js} +3 -1
- package/{index-39jz41jb.js → index-xs9a3ddt.js} +3 -3
- package/{index-35j83zkd.js → index-xv3pvdw4.js} +2 -2
- package/{index-34792nh7.js → index-y2g0s9tn.js} +1 -1
- package/{index-43f4h4cm.js → index-ymgsvhc5.js} +7 -8
- package/{index-ygdbn9jn.js → index-zyb0ebm4.js} +1 -1
- package/{index-bns3wcpc.js → index-zyjztrvc.js} +2 -2
- package/index.js +30 -24
- package/libExecutor-nstr00s7.js +10 -0
- package/{library.command-bmd7zc5m.js → library.command-b02aw1hm.js} +12 -5
- package/{localRegistry.command-y6en1599.js → localRegistry.command-3hg1p4aj.js} +24 -24
- package/{module.command-7exfffqw.js → module.command-bd9gz6cv.js} +11 -7
- package/{package.command-adskw2rj.js → package.command-xmr0mxze.js} +11 -10
- package/package.json +8 -8
- package/{page.command-dw01272p.js → page.command-x94qf58g.js} +8 -4
- package/{pipeline.command-0b1r3y5r.js → pipeline.command-n2843k6t.js} +15 -9
- package/pkgExecutor-cka27e3c.js +10 -0
- package/{primitive.command-byw6vc04.js → primitive.command-cs7v376h.js} +12 -8
- package/{projectTypecheck-kkrpq60a.js → projectTypecheck-za2n3nbr.js} +1 -1
- package/{prompter-qrwx1p17.js → prompter-d33wmdpa.js} +2 -2
- package/{quality.command-6rqnhzct.js → quality.command-nqngh1jd.js} +25 -16
- package/{recipeScanner-4b69ybe0.js → recipeScanner-rrx69awy.js} +1 -1
- package/{repair.command-rw5zymak.js → repair.command-v2medwsm.js} +12 -8
- package/{routeSourceValidator-4h947v7c.js → routeSourceValidator-8n6j1vn7.js} +4 -2
- package/{scalar.command-2dyp9nh9.js → scalar.command-61cjmxn1.js} +10 -6
- package/skills/akan-debug/SKILL.md +8 -5
- package/skills/akan-err/SKILL.md +7 -0
- package/skills/akan-mcp/SKILL.md +19 -1
- package/skills/akan-scaffold/SKILL.md +1 -1
- package/skills/akan-validate/SKILL.md +3 -3
- package/{subspace.command-111ynwv1.js → subspace.command-dtv8nfh7.js} +30 -24
- package/templates/app/page/_layout.tsx +13 -0
- package/templates/app/page/styles.css.template +40 -0
- package/templates/appSample/page/_index.tsx +9 -9
- package/templates/appSample/page/_layout.tsx +1 -0
- package/templates/appSample/page/styles.css.template +40 -5
- package/templates/appSample/ui/Recipe/jellyButton.ts +1 -1
- package/templates/biomeForm.ts +1 -1
- package/templates/env/_env.server.type.ts +1 -1
- package/templates/facetIndex/index.ts +2 -37
- package/templates/lib/sig.ts +0 -4
- package/templates/lib/useClient.ts +1 -1
- package/templates/workspaceRoot/.devcontainer/devcontainer.json.template +1 -1
- package/templates/workspaceRoot/AGENTS.md.template +2 -1
- package/templates/workspaceRoot/README.ts +4 -2
- package/{tunnel.command-2gcpfbdj.js → tunnel.command-fmwm5fgb.js} +15 -13
- package/{typeChecker-s640r6c0.js → typeChecker-7jt6abrs.js} +1 -1
- package/typecheck.proc.js +3 -2
- package/{verify.command-djgs86ma.js → verify.command-4f260t53.js} +19 -17
- package/{workflow.command-n0k2mxr5.js → workflow.command-tm5q9xsm.js} +21 -14
- package/{workspace.command-fh1qwxfx.js → workspace.command-75gc280j.js} +56 -54
- package/CodeAgent-x2p3a3e0.js +0 -11
- package/TunnelShare-c4xsfzg5.js +0 -15
- package/agent.command-9et2e27p.js +0 -52
- package/cloud.script-xze4zh7n.js +0 -31
- package/context.command-rk1dwrg4.js +0 -57
- package/context.runner-83ky5m1b.js +0 -30
- package/dependencyScanner-78sq8m4q.js +0 -8
- /package/templates/{appSample → app}/public/fonts/Pretendard-Bold.woff2 +0 -0
- /package/templates/{appSample → app}/public/fonts/Pretendard-Medium.woff2 +0 -0
- /package/templates/{appSample → app}/public/fonts/Pretendard-Regular.woff2 +0 -0
- /package/templates/{appSample → app}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script,
|
|
5
|
+
WorkspaceVersionCheck,
|
|
5
6
|
markCliErrorPrinted
|
|
6
|
-
} from "./index-
|
|
7
|
+
} from "./index-652f3bs8.js";
|
|
7
8
|
import {
|
|
8
9
|
CliError
|
|
9
10
|
} from "./index-j4yvgfhr.js";
|
|
@@ -14,41 +15,45 @@ import {
|
|
|
14
15
|
readDevkitVersion,
|
|
15
16
|
upsertAgentBlock,
|
|
16
17
|
renderRecipeEntries,
|
|
17
|
-
CLAUDE_COMMENT_RULE
|
|
18
|
-
|
|
19
|
-
LibExecutor
|
|
20
|
-
} from "./index-3ghdb7p5.js";
|
|
18
|
+
CLAUDE_COMMENT_RULE
|
|
19
|
+
} from "./index-pc42gxa5.js";
|
|
21
20
|
import {
|
|
22
|
-
|
|
23
|
-
} from "./index-
|
|
21
|
+
AppExecutor2
|
|
22
|
+
} from "./index-b372rck5.js";
|
|
24
23
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} from "./index-j6eeh5d7.js";
|
|
24
|
+
LibExecutor2
|
|
25
|
+
} from "./index-f2arv0mv.js";
|
|
28
26
|
import {
|
|
29
27
|
AkanContextAnalyzer
|
|
30
|
-
} from "./index-
|
|
28
|
+
} from "./index-jdw9m5c4.js";
|
|
31
29
|
import {
|
|
32
30
|
collectRecipeSources2,
|
|
33
31
|
scanRecipes2
|
|
34
|
-
} from "./index-
|
|
32
|
+
} from "./index-1p81ecbz.js";
|
|
33
|
+
import {
|
|
34
|
+
akanCodePaths2
|
|
35
|
+
} from "./index-xv3pvdw4.js";
|
|
36
|
+
import {
|
|
37
|
+
ConventionSet,
|
|
38
|
+
Prompter2
|
|
39
|
+
} from "./index-j3fqs8rc.js";
|
|
35
40
|
import {
|
|
36
41
|
ApplicationRunner,
|
|
37
42
|
VerifyScope
|
|
38
|
-
} from "./index-
|
|
43
|
+
} from "./index-d0n78fzc.js";
|
|
39
44
|
import {
|
|
40
45
|
WorkspaceRunner
|
|
41
|
-
} from "./index-
|
|
46
|
+
} from "./index-cm9rb480.js";
|
|
42
47
|
import {
|
|
43
48
|
VerifyComments,
|
|
44
49
|
VerifyPipeline,
|
|
45
50
|
VerifyReport
|
|
46
|
-
} from "./index-
|
|
51
|
+
} from "./index-4zgm54wf.js";
|
|
47
52
|
|
|
48
53
|
// pkgs/@akanjs/cli/agent/agent.script.ts
|
|
49
54
|
import { Logger as Logger3 } from "akanjs/common";
|
|
50
55
|
|
|
51
|
-
// pkgs/@akanjs/devkit/agentAssets.ts
|
|
56
|
+
// pkgs/@akanjs/devkit/guideline/agentAssets.ts
|
|
52
57
|
import fsPromise from "fs/promises";
|
|
53
58
|
import path from "path";
|
|
54
59
|
class AgentAssets {
|
|
@@ -81,7 +86,7 @@ class AgentAssets {
|
|
|
81
86
|
"modelUtil",
|
|
82
87
|
"framework"
|
|
83
88
|
],
|
|
84
|
-
"akan-err": [],
|
|
89
|
+
"akan-err": ["errorCodes"],
|
|
85
90
|
"akan-deps": [],
|
|
86
91
|
"akan-debug": [],
|
|
87
92
|
"akan-page": ["pageRule", "akanApi"],
|
|
@@ -237,8 +242,10 @@ class AgentHook {
|
|
|
237
242
|
"{apps,libs}/*/{ui,webkit,srvkit,common,plugin}/index.ts"
|
|
238
243
|
];
|
|
239
244
|
#workspace;
|
|
240
|
-
|
|
245
|
+
#cliVersion;
|
|
246
|
+
constructor(workspace, { cliVersion = process.env.AKAN_VERSION } = {}) {
|
|
241
247
|
this.#workspace = workspace;
|
|
248
|
+
this.#cliVersion = cliVersion;
|
|
242
249
|
}
|
|
243
250
|
static isEvent(value) {
|
|
244
251
|
return AgentHook.events.some((event) => event === value);
|
|
@@ -274,14 +281,22 @@ class AgentHook {
|
|
|
274
281
|
return { ...existing, hooks };
|
|
275
282
|
}
|
|
276
283
|
async run(event, input) {
|
|
284
|
+
const file = event === "stop" ? null : this.#relative(input.tool_input?.file_path);
|
|
285
|
+
if (event === "pre-edit")
|
|
286
|
+
return file ? this.#preEdit(file) : { block: false, message: "" };
|
|
287
|
+
if (file)
|
|
288
|
+
await this.#record(input.session_id, file);
|
|
289
|
+
const refusal = WorkspaceVersionCheck.refusal(this.#cliVersion, ["bun", "akan", "verify"], this.#workspace.workspaceRoot);
|
|
290
|
+
if (refusal) {
|
|
291
|
+
process.stderr.write(`${refusal}
|
|
292
|
+
`);
|
|
293
|
+
return { block: false, message: refusal };
|
|
294
|
+
}
|
|
277
295
|
if (event === "stop")
|
|
278
296
|
return await this.#stop(input);
|
|
279
|
-
const file = this.#relative(input.tool_input?.file_path);
|
|
280
297
|
if (!file)
|
|
281
298
|
return { block: false, message: "" };
|
|
282
|
-
|
|
283
|
-
return this.#preEdit(file);
|
|
284
|
-
return await this.#postEdit(file, input.session_id);
|
|
299
|
+
return await this.#verify([file], { lintOnly: true });
|
|
285
300
|
}
|
|
286
301
|
#preEdit(file) {
|
|
287
302
|
const pattern = AgentHook.generated.find((glob) => new Bun.Glob(glob).match(file));
|
|
@@ -292,10 +307,6 @@ class AgentHook {
|
|
|
292
307
|
message: `${file} is generated (${pattern}). Edit the source file it is generated from, then run \`akan sync <app-or-lib>\`.`
|
|
293
308
|
};
|
|
294
309
|
}
|
|
295
|
-
async#postEdit(file, session) {
|
|
296
|
-
await this.#record(session, file);
|
|
297
|
-
return await this.#verify([file], { lintOnly: true });
|
|
298
|
-
}
|
|
299
310
|
async#stop(input) {
|
|
300
311
|
const ledger = this.#ledgerPath(input.session_id);
|
|
301
312
|
const files = await this.#workspace.exists(ledger) ? (await this.#workspace.readFile(ledger)).split(`
|
|
@@ -434,6 +445,21 @@ ${Object.keys(AgentAssets.skillReferences).map((name) => `\`${name}\``).join(",
|
|
|
434
445
|
guideline.
|
|
435
446
|
|
|
436
447
|
`;
|
|
448
|
+
var maxListedChars = 160;
|
|
449
|
+
var renderNames = (names) => {
|
|
450
|
+
if (!names.length)
|
|
451
|
+
return "none";
|
|
452
|
+
const shown = [];
|
|
453
|
+
let length = 0;
|
|
454
|
+
for (const name of names) {
|
|
455
|
+
if (shown.length && length + name.length > maxListedChars)
|
|
456
|
+
break;
|
|
457
|
+
shown.push(name);
|
|
458
|
+
length += name.length + 2;
|
|
459
|
+
}
|
|
460
|
+
const rest = names.length - shown.length;
|
|
461
|
+
return rest ? `${shown.join(", ")}, and ${rest} more` : shown.join(", ");
|
|
462
|
+
};
|
|
437
463
|
var renderManagedBlock = async (workspace) => {
|
|
438
464
|
const context = await AkanContextAnalyzer.analyze(workspace);
|
|
439
465
|
const conventions = await Prompter2.getConventionSet();
|
|
@@ -443,9 +469,9 @@ var renderManagedBlock = async (workspace) => {
|
|
|
443
469
|
const block = `## Workspace
|
|
444
470
|
|
|
445
471
|
- Repo: ${context.repoName}
|
|
446
|
-
- Apps: ${appNames
|
|
447
|
-
- Libraries: ${context.libs.map((lib) => lib.name)
|
|
448
|
-
- Packages: ${context.pkgs.map((pkg) => pkg.name)
|
|
472
|
+
- Apps: ${renderNames(appNames)}
|
|
473
|
+
- Libraries: ${renderNames(context.libs.map((lib) => lib.name))}
|
|
474
|
+
- Packages: ${renderNames(context.pkgs.map((pkg) => pkg.name))}
|
|
449
475
|
|
|
450
476
|
${conventions.core}
|
|
451
477
|
|
|
@@ -595,9 +621,9 @@ class AgentRunner extends runner("agent") {
|
|
|
595
621
|
}
|
|
596
622
|
};
|
|
597
623
|
for (const name of libNames)
|
|
598
|
-
await syncScope(
|
|
624
|
+
await syncScope(LibExecutor2.from(workspace, name));
|
|
599
625
|
for (const name of appNames)
|
|
600
|
-
await syncScope(
|
|
626
|
+
await syncScope(AppExecutor2.from(workspace, name));
|
|
601
627
|
return written;
|
|
602
628
|
}
|
|
603
629
|
}
|