@akanjs/cli 3.1.1-rc.17 → 3.1.1-rc.19
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-rsebcq9c.js +9 -0
- package/{CodeTui-0626gxqd.js → CodeTui-mpybfknz.js} +1 -1
- package/TunnelShare-da9qj2mh.js +14 -0
- package/{agent.command-hpza0pg9.js → agent.command-xc1mf4yz.js} +13 -13
- package/akanCode.js +7 -5
- package/{application.command-3a7q1hs2.js → application.command-frkm7n6t.js} +43 -11
- package/{applicationBuildRunner-s7yt71j4.js → applicationBuildRunner-r9nvz9ms.js} +5 -5
- package/buildBatch.proc.js +5 -5
- package/{cloud.command-4vg0pcea.js → cloud.command-gakbzmdj.js} +16 -15
- package/cloud.script-1krw7gjb.js +26 -0
- package/{code.command-fbntb67p.js → code.command-pvfczhpy.js} +6 -6
- package/commandManifest.json +1 -1
- package/{context.command-31rm54v0.js → context.command-cp6fstk3.js} +16 -16
- package/context.runner-hwq8pwrg.js +26 -0
- package/{devTui-q7k7bakd.js → devTui-evr3b35y.js} +1 -1
- package/{guideline.command-cv3by2ng.js → guideline.command-761yyxqb.js} +2 -2
- package/guidelines/conventions/core.md +4 -2
- package/incrementalBuilder.proc.js +3 -3
- package/{index-zre4m2ce.js → index-1qmfdbjf.js} +4 -4
- package/{index-rvynj5gz.js → index-3e0c4d9d.js} +1 -1
- package/{index-922k2zwq.js → index-40qsd2tg.js} +3 -3
- package/{index-js1gj6f6.js → index-4412550g.js} +8 -8
- package/{index-x5ecanqh.js → index-6c5h9egr.js} +2 -2
- package/{index-tdv66eah.js → index-6h6x9e1n.js} +4 -4
- package/{index-7zeb5r1p.js → index-6yvp6qcb.js} +9 -9
- package/{index-mt0wa941.js → index-88aq81dz.js} +3 -3
- package/index-9bv479q5.js +1 -0
- package/{index-1dhf8ymv.js → index-9h8a7w1c.js} +3 -3
- package/{index-3gccwenr.js → index-9jyxbbnh.js} +1 -1
- package/{index-0ht91675.js → index-9z3xf23k.js} +35 -177
- package/{index-9ndw5d8j.js → index-a675rkqs.js} +7 -7
- package/{index-wfczhj1z.js → index-a9sjjv6x.js} +1 -1
- package/{index-05nxx4m5.js → index-acta9x3j.js} +2 -2
- package/{index-12kzwak1.js → index-b2p3qq5f.js} +2 -2
- package/{index-f5adsa58.js → index-b3br6jhe.js} +4 -4
- package/{index-57q1ayd2.js → index-cb58gjk2.js} +79 -11
- package/{index-0zyatd10.js → index-d1c677h0.js} +2 -2
- package/{index-hm7x0c11.js → index-d2x0mxsa.js} +4 -4
- package/{index-mwj9q2ya.js → index-fjxwyj3f.js} +1 -1
- package/{index-3txrjt6n.js → index-gftc47rk.js} +2 -2
- package/{index-8s8b4eba.js → index-mgdzy0cz.js} +64 -4
- package/{index-0zwznvv1.js → index-nrstta07.js} +1 -1
- package/{index-64g9fsjy.js → index-nt5c22sg.js} +9 -1
- package/{index-5n5hds19.js → index-t8jp2d3r.js} +1016 -658
- package/index-tenw3mah.js +225 -0
- package/{index-6269mf2s.js → index-tnhh146g.js} +8 -8
- package/{index-kjrvwzav.js → index-tpv8j9kq.js} +3 -3
- package/{index-5kh9scvs.js → index-trz8jyh1.js} +3 -73
- package/{index-m6r88hhr.js → index-v8w6kjx4.js} +2 -2
- package/{index-et6ce601.js → index-vp77rhem.js} +1 -1
- package/{index-w134p86k.js → index-zb0807wt.js} +1 -1
- package/{index-hvv5rnaq.js → index-zvhy8nch.js} +2 -2
- package/index.js +23 -23
- package/{library.command-sh70fyvy.js → library.command-stwr5zyk.js} +3 -3
- package/{localRegistry.command-2nbyy84d.js → localRegistry.command-t42y3tn6.js} +15 -14
- package/{module.command-n0bmtzwy.js → module.command-q2tv04e1.js} +5 -5
- package/{package.command-7h9r51bz.js → package.command-zra0r49p.js} +3 -3
- package/package.json +2 -2
- package/{page.command-vjtpfbb1.js → page.command-s7trjw69.js} +3 -3
- package/{pipeline.command-c93se3ar.js → pipeline.command-7p7tagtq.js} +2 -2
- package/{primitive.command-a3075qp2.js → primitive.command-6snsrb00.js} +6 -6
- package/{projectTypecheck-sf9xwaga.js → projectTypecheck-0g5azdzh.js} +1 -1
- package/{quality.command-dw1y9hmy.js → quality.command-n5kk1z6x.js} +3 -3
- package/{repair.command-tg57d8yt.js → repair.command-qngfxjd6.js} +5 -5
- package/{routeSourceValidator-6jd0q6r6.js → routeSourceValidator-4h947v7c.js} +13 -3
- package/{scalar.command-cwzge353.js → scalar.command-s28v00sy.js} +4 -4
- package/skills/akan-debug/SKILL.md +37 -3
- package/{subspace.command-3h03c7kc.js → subspace.command-8atqm584.js} +8 -8
- package/{tunnel.command-czaz6ys4.js → tunnel.command-kvwnw6n8.js} +7 -7
- package/{verify.command-nzwhtz71.js → verify.command-5fpqe0xp.js} +13 -13
- package/{workflow.command-srhky88x.js → workflow.command-0y3gez01.js} +10 -10
- package/{workspace.command-9stchcd2.js → workspace.command-fg6m6bjz.js} +29 -28
- package/CodeAgent-fbcq8vks.js +0 -9
- package/TunnelShare-2p24xxza.js +0 -14
- package/cloud.script-nkmeyhet.js +0 -25
- package/context.runner-w01a32ph.js +0 -26
- package/index-7md2g9vw.js +0 -6
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
AppExecutor,
|
|
8
8
|
LibExecutor,
|
|
9
9
|
PkgExecutor
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-nt5c22sg.js";
|
|
11
11
|
import {
|
|
12
12
|
UNAVAILABLE_REDIS_HOST,
|
|
13
13
|
redisTunnelPolicy,
|
|
@@ -46,24 +46,25 @@ import {
|
|
|
46
46
|
} from "./index-p6x5b7hr.js";
|
|
47
47
|
import {
|
|
48
48
|
runner,
|
|
49
|
+
ExitCodeError,
|
|
49
50
|
assertPromptable
|
|
50
|
-
} from "./index-
|
|
51
|
+
} from "./index-9jyxbbnh.js";
|
|
51
52
|
import {
|
|
52
53
|
UpdatePackFolder,
|
|
53
54
|
UpdateUploader,
|
|
54
55
|
NativePublicEnv,
|
|
55
56
|
NativeApp
|
|
56
|
-
} from "./index-
|
|
57
|
+
} from "./index-tpv8j9kq.js";
|
|
57
58
|
import {
|
|
58
59
|
DesktopServerStage
|
|
59
|
-
} from "./index-
|
|
60
|
+
} from "./index-zb0807wt.js";
|
|
60
61
|
import {
|
|
61
62
|
resolveMobileTargets,
|
|
62
63
|
resolveAppId
|
|
63
64
|
} from "./index-m9jj544v.js";
|
|
64
65
|
import {
|
|
65
66
|
SlicePlanner
|
|
66
|
-
} from "./index-
|
|
67
|
+
} from "./index-fjxwyj3f.js";
|
|
67
68
|
import {
|
|
68
69
|
openBrowser
|
|
69
70
|
} from "./index-9dp031by.js";
|
|
@@ -1895,7 +1896,7 @@ ${uniqueCandidates.map((candidate) => ` - ${candidate}`).join(`
|
|
|
1895
1896
|
|
|
1896
1897
|
// pkgs/@akanjs/cli/application/application.runner.ts
|
|
1897
1898
|
import { Logger as Logger3, toError } from "akanjs/common";
|
|
1898
|
-
var loadBuildRunner = async () => (await import("./applicationBuildRunner-
|
|
1899
|
+
var loadBuildRunner = async () => (await import("./applicationBuildRunner-r9nvz9ms.js")).ApplicationBuildRunner;
|
|
1899
1900
|
var loadPrompts = async () => await import("@inquirer/prompts");
|
|
1900
1901
|
|
|
1901
1902
|
class ApplicationRunner extends runner("application") {
|
|
@@ -1946,13 +1947,13 @@ class ApplicationRunner extends runner("application") {
|
|
|
1946
1947
|
stdio: "inherit"
|
|
1947
1948
|
});
|
|
1948
1949
|
}
|
|
1949
|
-
|
|
1950
|
+
static runtimeDirOf(app, override) {
|
|
1950
1951
|
return path5.resolve(override ?? process.env.AKAN_RUNTIME_DIR ?? path5.join(app.workspace.workspaceRoot, "local", "apps", app.name, "runtime"));
|
|
1951
1952
|
}
|
|
1952
1953
|
async runLogs(app, options) {
|
|
1953
1954
|
const { LogControlUnavailableError, LogTailClient } = await import("akanjs/server/logging/logTailClient");
|
|
1954
1955
|
const { LogQueryMatcher } = await import("akanjs/server/logging/logQuery");
|
|
1955
|
-
const runtimeDir =
|
|
1956
|
+
const runtimeDir = ApplicationRunner.runtimeDirOf(app, options.runtimeDir);
|
|
1956
1957
|
const socketPath = LogTailClient.socketPath(runtimeDir);
|
|
1957
1958
|
const { level, grep, endpoint, trace, child, role, origin, since } = options;
|
|
1958
1959
|
const query = Object.fromEntries(Object.entries({ level, grep, endpoint, trace, child, role, origin, since }).filter(([, value]) => value !== undefined && value !== null && value !== ""));
|
|
@@ -2005,7 +2006,7 @@ class ApplicationRunner extends runner("application") {
|
|
|
2005
2006
|
const serverPath = `${app.cwdPath}/server.ts`;
|
|
2006
2007
|
if (!await app.exists("server.ts"))
|
|
2007
2008
|
throw new Error(`Server file not found: apps/${app.name}/server.ts`);
|
|
2008
|
-
const runtimeDir =
|
|
2009
|
+
const runtimeDir = ApplicationRunner.runtimeDirOf(app);
|
|
2009
2010
|
const code = `
|
|
2010
2011
|
const serverModule = await import(${JSON.stringify(serverPath)});
|
|
2011
2012
|
const { assertAkanConsoleAllowed, startAkanConsole } = await import("akanjs/server");
|
|
@@ -2096,7 +2097,7 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
|
|
|
2096
2097
|
await new (await loadBuildRunner())(app).typecheck(options);
|
|
2097
2098
|
}
|
|
2098
2099
|
async typecheckLibrary(lib, options = {}) {
|
|
2099
|
-
const { ProjectTypecheck } = await import("./projectTypecheck-
|
|
2100
|
+
const { ProjectTypecheck } = await import("./projectTypecheck-0g5azdzh.js");
|
|
2100
2101
|
const root = lib.workspace.workspaceRoot;
|
|
2101
2102
|
await new ProjectTypecheck(lib.cwdPath, root, { ...process.env, AKAN_WORKSPACE_ROOT: root }).run([
|
|
2102
2103
|
"../../server.ts",
|
|
@@ -2520,4 +2521,71 @@ ${detail}`
|
|
|
2520
2521
|
}
|
|
2521
2522
|
}
|
|
2522
2523
|
|
|
2523
|
-
|
|
2524
|
+
// pkgs/@akanjs/cli/verify/verifyScope.ts
|
|
2525
|
+
class VerifyScope {
|
|
2526
|
+
targets;
|
|
2527
|
+
constructor(targets) {
|
|
2528
|
+
this.targets = targets;
|
|
2529
|
+
}
|
|
2530
|
+
get touchesTsx() {
|
|
2531
|
+
return this.targets.some((target) => target.files.some((file) => file.endsWith(".tsx")));
|
|
2532
|
+
}
|
|
2533
|
+
get changedFiles() {
|
|
2534
|
+
return new Set(this.targets.flatMap((target) => target.files));
|
|
2535
|
+
}
|
|
2536
|
+
static async changesIn(workspaceRoot) {
|
|
2537
|
+
const prefix = await VerifyScope.#git(workspaceRoot, ["rev-parse", "--show-prefix"]);
|
|
2538
|
+
if (prefix === null)
|
|
2539
|
+
return null;
|
|
2540
|
+
const status = await VerifyScope.#git(workspaceRoot, ["status", "--porcelain=v1", "-z", "--untracked-files=all"]);
|
|
2541
|
+
if (status === null)
|
|
2542
|
+
return null;
|
|
2543
|
+
return VerifyScope.parseStatus(status, prefix.trim());
|
|
2544
|
+
}
|
|
2545
|
+
static parseStatus(status, prefix = "") {
|
|
2546
|
+
const tokens = status.split("\x00");
|
|
2547
|
+
const changes = [];
|
|
2548
|
+
for (let idx = 0;idx < tokens.length; idx++) {
|
|
2549
|
+
const token = tokens[idx] ?? "";
|
|
2550
|
+
if (token.length < 4)
|
|
2551
|
+
continue;
|
|
2552
|
+
const code = token.slice(0, 2);
|
|
2553
|
+
const file = token.slice(3);
|
|
2554
|
+
if (code.includes("R") || code.includes("C"))
|
|
2555
|
+
idx++;
|
|
2556
|
+
if (!file.startsWith(prefix))
|
|
2557
|
+
continue;
|
|
2558
|
+
changes.push({ code, file: file.slice(prefix.length) });
|
|
2559
|
+
}
|
|
2560
|
+
return changes;
|
|
2561
|
+
}
|
|
2562
|
+
static resolve(changes, names, requested = []) {
|
|
2563
|
+
const known = VerifyScope.#knownTargets(names);
|
|
2564
|
+
const changedFilesOf = (dir) => changes.filter((change) => change.file.startsWith(`${dir}/`)).map((change) => change.file);
|
|
2565
|
+
if (requested.length) {
|
|
2566
|
+
const targets = requested.map((name) => {
|
|
2567
|
+
const target = known.find((candidate) => candidate.name === name);
|
|
2568
|
+
if (!target)
|
|
2569
|
+
throw new ExitCodeError(`${name} is not an app, library or package of this workspace`, 2);
|
|
2570
|
+
return { ...target, files: changedFilesOf(target.dir) };
|
|
2571
|
+
});
|
|
2572
|
+
return new VerifyScope(targets);
|
|
2573
|
+
}
|
|
2574
|
+
const targets = known.map((target) => ({ ...target, files: changedFilesOf(target.dir) })).filter((target) => target.files.length > 0);
|
|
2575
|
+
return new VerifyScope(targets);
|
|
2576
|
+
}
|
|
2577
|
+
static #knownTargets({ apps, libs, pkgs }) {
|
|
2578
|
+
return [
|
|
2579
|
+
...apps.map((name) => ({ type: "app", name, dir: `apps/${name}`, files: [] })),
|
|
2580
|
+
...libs.map((name) => ({ type: "lib", name, dir: `libs/${name}`, files: [] })),
|
|
2581
|
+
...pkgs.map((name) => ({ type: "pkg", name, dir: `pkgs/${name}`, files: [] }))
|
|
2582
|
+
];
|
|
2583
|
+
}
|
|
2584
|
+
static async#git(cwd, args) {
|
|
2585
|
+
const proc = Bun.spawn(["git", ...args], { cwd, stdout: "pipe", stderr: "ignore" });
|
|
2586
|
+
const [text, exitCode] = await Promise.all([new Response(proc.stdout).text(), proc.exited]);
|
|
2587
|
+
return exitCode === 0 ? text : null;
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
export { ApplicationRunner, VerifyScope };
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
UpdatePackFolder,
|
|
10
10
|
NativePublicEnv,
|
|
11
11
|
NativeApp
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-tpv8j9kq.js";
|
|
13
13
|
import {
|
|
14
14
|
ExitCodeError
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-9jyxbbnh.js";
|
|
16
16
|
import {
|
|
17
17
|
ConfigLock
|
|
18
18
|
} from "./index-bqbf654f.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
script
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-9jyxbbnh.js";
|
|
5
5
|
import {
|
|
6
6
|
AppExecutor,
|
|
7
7
|
LibExecutor,
|
|
8
8
|
ModuleExecutor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-nt5c22sg.js";
|
|
10
10
|
import {
|
|
11
11
|
InteractionScaffold,
|
|
12
12
|
workflowStatus,
|
|
@@ -43,10 +43,10 @@ import {
|
|
|
43
43
|
insertSignalFactoryEntry,
|
|
44
44
|
addFieldUiPolicyForType,
|
|
45
45
|
MutationScaffold
|
|
46
|
-
} from "./index-
|
|
46
|
+
} from "./index-acta9x3j.js";
|
|
47
47
|
import {
|
|
48
48
|
ModuleScript
|
|
49
|
-
} from "./index-
|
|
49
|
+
} from "./index-6h6x9e1n.js";
|
|
50
50
|
|
|
51
51
|
// pkgs/@akanjs/cli/primitive/primitive.script.ts
|
|
52
52
|
import { capitalize, lowerlize } from "akanjs/common";
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-9jyxbbnh.js";
|
|
6
6
|
import {
|
|
7
7
|
FileSys2
|
|
8
8
|
} from "./index-52w0fvh8.js";
|
|
9
9
|
import {
|
|
10
10
|
PkgExecutor
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-nt5c22sg.js";
|
|
12
12
|
import {
|
|
13
13
|
TypeScriptDependencyScanner2
|
|
14
14
|
} from "./index-tvehn2sp.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
isScannedRootEntry,
|
|
11
11
|
AppExecutor,
|
|
12
12
|
LibExecutor
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-nt5c22sg.js";
|
|
14
14
|
import {
|
|
15
15
|
FileSys2
|
|
16
16
|
} from "./index-52w0fvh8.js";
|
|
@@ -23,12 +23,12 @@ import {
|
|
|
23
23
|
workflowPathsForPlan,
|
|
24
24
|
workflowRunArtifactPath,
|
|
25
25
|
workflowSyncDir
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-acta9x3j.js";
|
|
27
27
|
|
|
28
28
|
// pkgs/@akanjs/devkit/akanContext.ts
|
|
29
29
|
import { readdir } from "fs/promises";
|
|
30
30
|
import path from "path";
|
|
31
|
-
import { capitalize, isRecord } from "akanjs/common";
|
|
31
|
+
import { capitalize, isRecord, parseRouteModuleKey } from "akanjs/common";
|
|
32
32
|
var guidelineResourceUri = (name) => `akan://guidelines/${name}`;
|
|
33
33
|
var staticResourceList = [
|
|
34
34
|
{ uri: "akan://docs/framework", name: "Akan framework guide", mimeType: "text/markdown" },
|
|
@@ -307,9 +307,33 @@ var getSysModules = async (workspace, sys, {
|
|
|
307
307
|
}
|
|
308
308
|
return modules.sort((a, b) => `${a.sysName}:${a.path}`.localeCompare(`${b.sysName}:${b.path}`));
|
|
309
309
|
};
|
|
310
|
+
var getAppRoutes = async (app, workspaceRoot) => {
|
|
311
|
+
const sources = await app.getRouteSources();
|
|
312
|
+
const guardedLayouts = new Set;
|
|
313
|
+
const pages = [];
|
|
314
|
+
for (const source of sources) {
|
|
315
|
+
const parsed = parseRouteModuleKey(source.key);
|
|
316
|
+
if (parsed.kind === "layout" && source.info.chain?.guarded)
|
|
317
|
+
guardedLayouts.add(parsed.routeSegments.join("/"));
|
|
318
|
+
else if (parsed.kind === "page")
|
|
319
|
+
pages.push({ source, parsed });
|
|
320
|
+
}
|
|
321
|
+
return pages.map(({ source, parsed }) => {
|
|
322
|
+
const segments = parsed.routeSegments;
|
|
323
|
+
const reach = parsed.leaf === "_index" ? segments.length : segments.length - 1;
|
|
324
|
+
const underGuard = Array.from({ length: reach + 1 }, (_, idx) => segments.slice(0, idx).join("/")).some((prefix) => guardedLayouts.has(prefix));
|
|
325
|
+
return {
|
|
326
|
+
path: parsed.pattern.replace(/^\/:lang/, "") || "/",
|
|
327
|
+
file: path.relative(workspaceRoot, source.absPath),
|
|
328
|
+
search: source.info.chain?.search ?? [],
|
|
329
|
+
guarded: !!source.info.chain?.guarded || underGuard,
|
|
330
|
+
devOnly: source.info.devOnly
|
|
331
|
+
};
|
|
332
|
+
}).sort((a, b) => a.path.localeCompare(b.path));
|
|
333
|
+
};
|
|
310
334
|
var getSysContext = async (workspace, type, name, options) => {
|
|
311
335
|
const sys = type === "app" ? AppExecutor.from(workspace, name) : LibExecutor.from(workspace, name);
|
|
312
|
-
|
|
336
|
+
const context = {
|
|
313
337
|
type,
|
|
314
338
|
name,
|
|
315
339
|
path: `${type}s/${name}`,
|
|
@@ -319,6 +343,9 @@ var getSysContext = async (workspace, type, name, options) => {
|
|
|
319
343
|
module: options.module
|
|
320
344
|
})
|
|
321
345
|
};
|
|
346
|
+
if (sys instanceof AppExecutor && options.app === name)
|
|
347
|
+
await getAppRoutes(sys, workspace.workspaceRoot).then((routes) => context.routes = routes, (error) => context.routeError = error instanceof Error ? error.message : String(error));
|
|
348
|
+
return context;
|
|
322
349
|
};
|
|
323
350
|
|
|
324
351
|
class AkanContextAnalyzer {
|
|
@@ -638,6 +665,12 @@ class AkanContextAnalyzer {
|
|
|
638
665
|
lines.push("", "## Apps", ...context.apps.map((app) => `- ${app.name}: ${app.modules.length} module(s)`));
|
|
639
666
|
lines.push("", "## Libraries", ...context.libs.map((lib) => `- ${lib.name}: ${lib.modules.length} module(s)`));
|
|
640
667
|
lines.push("", "## Packages", ...context.pkgs.map((pkg) => `- ${pkg.name}${pkg.version ? ` (${pkg.version})` : ""}`));
|
|
668
|
+
for (const app of context.apps) {
|
|
669
|
+
if (app.routeError)
|
|
670
|
+
lines.push("", `## Routes: ${app.name}`, `- Not read: ${app.routeError}`);
|
|
671
|
+
else if (app.routes)
|
|
672
|
+
lines.push("", `## Routes: ${app.name}`, ...AkanContextAnalyzer.#routeLines(app.name, app.routes));
|
|
673
|
+
}
|
|
641
674
|
const modules = AkanContextAnalyzer.findModules(context, moduleName);
|
|
642
675
|
lines.push("", "## Modules");
|
|
643
676
|
for (const module of modules) {
|
|
@@ -654,6 +687,33 @@ class AkanContextAnalyzer {
|
|
|
654
687
|
`)}
|
|
655
688
|
`;
|
|
656
689
|
}
|
|
690
|
+
static routeListLimit = 60;
|
|
691
|
+
static #routeLines(appName, routes) {
|
|
692
|
+
const folderOf = (route) => route.file.split("/").slice(0, 4).join("/");
|
|
693
|
+
const groups = Map.groupBy(routes, folderOf);
|
|
694
|
+
const folded = new Set;
|
|
695
|
+
let listed = routes.length;
|
|
696
|
+
for (const [folder, members] of [...groups].sort((a, b) => b[1].length - a[1].length)) {
|
|
697
|
+
if (listed <= AkanContextAnalyzer.routeListLimit)
|
|
698
|
+
break;
|
|
699
|
+
folded.add(folder);
|
|
700
|
+
listed -= members.length;
|
|
701
|
+
}
|
|
702
|
+
const lines = [`Paths omit the \`/:lang\` prefix; \`akan preview ${appName} <path>\` opens one.`];
|
|
703
|
+
for (const route of routes) {
|
|
704
|
+
if (folded.has(folderOf(route)))
|
|
705
|
+
continue;
|
|
706
|
+
const search = route.search.length ? ` ?${route.search.join("&")}` : "";
|
|
707
|
+
const marks = `${route.guarded ? " (guarded)" : ""}${route.devOnly ? " (dev only)" : ""}`;
|
|
708
|
+
lines.push(`- ${route.path}${search}${marks} \u2014 ${route.file}`);
|
|
709
|
+
}
|
|
710
|
+
for (const folder of folded) {
|
|
711
|
+
const members = groups.get(folder) ?? [];
|
|
712
|
+
const examples = members.slice(0, 3).map((route) => route.path);
|
|
713
|
+
lines.push(`- ${folder}/: ${members.length} routes folded (${examples.join(", ")}, \u2026); \`--format json\` lists every route`);
|
|
714
|
+
}
|
|
715
|
+
return lines;
|
|
716
|
+
}
|
|
657
717
|
}
|
|
658
718
|
|
|
659
719
|
export { buildResourceList, codexMcpConfigPath, akanMcpInstallTargets, akanMcpInstallConfigPaths, createAkanMcpServer, createAkanCodexMcpServerBlock, upsertCodexMcpServerBlock, renderDoctorText, AkanContextAnalyzer };
|
|
@@ -3830,7 +3830,7 @@ class SysExecutor extends Executor {
|
|
|
3830
3830
|
class AppExecutor extends SysExecutor {
|
|
3831
3831
|
static #routeSourceValidator = null;
|
|
3832
3832
|
static async#getRouteSourceValidator() {
|
|
3833
|
-
AppExecutor.#routeSourceValidator ??= (await import("./routeSourceValidator-
|
|
3833
|
+
AppExecutor.#routeSourceValidator ??= (await import("./routeSourceValidator-4h947v7c.js")).RouteSourceValidator;
|
|
3834
3834
|
return AppExecutor.#routeSourceValidator;
|
|
3835
3835
|
}
|
|
3836
3836
|
dist;
|
|
@@ -3960,6 +3960,7 @@ class AppExecutor extends SysExecutor {
|
|
|
3960
3960
|
return this.#akanConfig;
|
|
3961
3961
|
}
|
|
3962
3962
|
#pageKeys = null;
|
|
3963
|
+
#routeSources = [];
|
|
3963
3964
|
#excludeDevOnlyPages = false;
|
|
3964
3965
|
async getPageKeys({ refresh } = {}) {
|
|
3965
3966
|
if (this.#pageKeys && !refresh)
|
|
@@ -3971,6 +3972,7 @@ class AppExecutor extends SysExecutor {
|
|
|
3971
3972
|
const devOnlyKeys = new Set;
|
|
3972
3973
|
const devOnlyDirs = [];
|
|
3973
3974
|
const pageRoots = await this.getPageRoots();
|
|
3975
|
+
const routeSources = [];
|
|
3974
3976
|
const libKeyPrefixes = pageRoots.map((root) => root.keyPrefix).filter(Boolean);
|
|
3975
3977
|
for (const root of pageRoots) {
|
|
3976
3978
|
if (!await FileSys2.dirExists(root.dir))
|
|
@@ -4020,6 +4022,7 @@ class AppExecutor extends SysExecutor {
|
|
|
4020
4022
|
rootLayout: isRootLayout,
|
|
4021
4023
|
pattern: parsed.pattern
|
|
4022
4024
|
});
|
|
4025
|
+
routeSources.push({ key, absPath, info });
|
|
4023
4026
|
if (info.devOnly) {
|
|
4024
4027
|
devOnlyKeys.add(key);
|
|
4025
4028
|
if (parsed.kind === "layout")
|
|
@@ -4030,9 +4033,14 @@ class AppExecutor extends SysExecutor {
|
|
|
4030
4033
|
}
|
|
4031
4034
|
}
|
|
4032
4035
|
pageKeys.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
4036
|
+
this.#routeSources = routeSources.sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0);
|
|
4033
4037
|
this.#pageKeys = this.#excludeDevOnlyPages ? this.#dropDevOnlyPages(pageKeys, devOnlyKeys, devOnlyDirs) : pageKeys;
|
|
4034
4038
|
return this.#pageKeys;
|
|
4035
4039
|
}
|
|
4040
|
+
async getRouteSources({ refresh } = {}) {
|
|
4041
|
+
await this.getPageKeys({ refresh });
|
|
4042
|
+
return this.#routeSources;
|
|
4043
|
+
}
|
|
4036
4044
|
#dropDevOnlyPages(pageKeys, devOnlyKeys, devOnlyDirs) {
|
|
4037
4045
|
if (!devOnlyKeys.size)
|
|
4038
4046
|
return pageKeys;
|