@akanjs/cli 2.4.2-rc.2 → 2.4.2-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.build-stamp +1 -1
- package/abstractCompactor-bjd2h5pq.js +103 -0
- package/{agent.command-ej4g9pbb.js → agent.command-dwxr73jr.js} +8 -7
- package/{application.command-smn51a28.js → application.command-8k6xs7q0.js} +16 -5
- package/{applicationBuildRunner-554a2vnk.js → applicationBuildRunner-hn86q106.js} +5 -4
- package/{applicationReleasePackager-pjbxc793.js → applicationReleasePackager-b1zh40kd.js} +1 -1
- package/buildBatch.proc.js +4 -3
- package/{capacitorApp-yg9b4ajz.js → capacitorApp-sqr41tck.js} +27 -26
- package/{cloud.command-2v7ga38h.js → cloud.command-5wh9krwx.js} +9 -8
- package/commandManifest.json +1 -1
- package/{context.command-hhjyjtp7.js → context.command-rydtf2vy.js} +15 -14
- package/{dependencyScanner-f6grrep3.js → dependencyScanner-rbs2407b.js} +1 -1
- package/{guideline.command-vj956kfr.js → guideline.command-dtkrftpc.js} +5 -4
- package/incrementalBuilder.proc.js +3 -2
- package/{index-pfnh87f9.js → index-0476y8pz.js} +1 -1
- package/index-0wae5ebk.js +65 -0
- package/{index-40w1kqp1.js → index-2f6mjanp.js} +4 -3
- package/{index-xftstr5s.js → index-3f3bjcwc.js} +1 -1
- package/{index-xwfg9bam.js → index-3g17wsqr.js} +10 -5
- package/{index-7ppn9v4n.js → index-3hyw3026.js} +3 -3
- package/{index-s9s0n5fz.js → index-4fh6v6qr.js} +2 -2
- package/{index-y1e79mz3.js → index-4j0qw1hz.js} +11 -11
- package/{index-z36qzgzp.js → index-6a9008sh.js} +2 -2
- package/{index-h971erkm.js → index-90a0z8xq.js} +3 -3
- package/{index-04as43rp.js → index-dscrzdk0.js} +7 -6
- package/{index-7k9sj7j5.js → index-f2s5z0p7.js} +91 -341
- package/index-f39512t6.js +255 -0
- package/{index-d0h48d2f.js → index-g10wmymm.js} +2 -2
- package/{index-panyahn4.js → index-hr3n31n0.js} +24 -10
- package/{index-dgeaqwmw.js → index-jf5k3bt8.js} +1 -1
- package/{index-majzj044.js → index-med3vqnc.js} +7 -7
- package/{index-zfp1gz9f.js → index-ms3vpys1.js} +1 -1
- package/{index-v9jqrdd1.js → index-n3drhjgc.js} +2 -2
- package/{index-z5v766nx.js → index-pw9qhve8.js} +3 -3
- package/{index-acwxfncv.js → index-r8drwwr8.js} +4 -4
- package/{index-j3j3qc9j.js → index-z1eqzrj9.js} +3 -3
- package/index.js +20 -19
- package/{library.command-68ah07a3.js → library.command-w11wnq7q.js} +5 -4
- package/{localRegistry.command-nmyc5vwv.js → localRegistry.command-fkq49j84.js} +10 -9
- package/{module.command-t68xhamx.js → module.command-wyjgbg0d.js} +8 -7
- package/{package.command-00ncttab.js → package.command-5ann132q.js} +5 -4
- package/package.json +2 -2
- package/{page.command-1096s18n.js → page.command-e75nxwrw.js} +5 -4
- package/{primitive.command-02eqpx6t.js → primitive.command-gy7nwn5w.js} +9 -8
- package/{quality.command-vap6xegb.js → quality.command-41tw1g5g.js} +32 -6
- package/{repair.command-7dynpnf1.js → repair.command-xr4664h4.js} +7 -6
- package/{routeSourceValidator-cncd92fv.js → routeSourceValidator-rk64s1g4.js} +2 -1
- package/{scalar.command-3kxy3fkh.js → scalar.command-agc839az.js} +7 -6
- package/templates/module/__Model__.Template.tsx +2 -1
- package/templates/module/__Model__.Unit.tsx +2 -1
- package/templates/module/__Model__.Util.tsx +2 -1
- package/templates/module/__Model__.View.tsx +2 -1
- package/templates/module/__Model__.Zone.tsx +2 -1
- package/{typeChecker-kravn7ns.js → typeChecker-g6bh0xfv.js} +1 -1
- package/typecheck.proc.js +1 -1
- package/{workflow.command-yy0d9gk3.js → workflow.command-jf09cq6k.js} +12 -11
- package/{workspace.command-hq1x5605.js → workspace.command-a57b7ybw.js} +23 -22
- /package/{index-r24hmh0q.js → index-yb2wsc7f.js} +0 -0
package/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
31c7511a2ef7f21119fcdd0932e6ef6daa98d2530428043b0b8633de5c50e1e3
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
AbstractDoc
|
|
4
|
+
} from "./index-0wae5ebk.js";
|
|
5
|
+
import {
|
|
6
|
+
AiSession
|
|
7
|
+
} from "./index-nsj2ftxj.js";
|
|
8
|
+
import"./index-67546d0j.js";
|
|
9
|
+
import"./index-6pz1j0zj.js";
|
|
10
|
+
import"./index-yb2wsc7f.js";
|
|
11
|
+
|
|
12
|
+
// pkgs/@akanjs/devkit/abstractCompactor.ts
|
|
13
|
+
import { Logger } from "akanjs/common";
|
|
14
|
+
import chalk from "chalk";
|
|
15
|
+
class AbstractCompactor {
|
|
16
|
+
static #reviewRequest = `Review the compacted file you just wrote against the original.
|
|
17
|
+
- Did you drop an invariant, a security reason, or a workflow step that the source files cannot show by themselves? Restore it.
|
|
18
|
+
- Did you keep anything that only restates code, scaffold wording, or history? Remove it.
|
|
19
|
+
- Is it in the same language as the original, within the line budget, and one short line per bullet?
|
|
20
|
+
Respond with exactly one \`\`\`markdown code block holding the corrected file and nothing else. If nothing needs to change, repeat the file unchanged.`;
|
|
21
|
+
#sys;
|
|
22
|
+
#minLines;
|
|
23
|
+
#interactive;
|
|
24
|
+
constructor(sys, { minLines = AbstractDoc.compactMinLines, interactive = false } = {}) {
|
|
25
|
+
this.#sys = sys;
|
|
26
|
+
this.#minLines = minLines;
|
|
27
|
+
this.#interactive = interactive;
|
|
28
|
+
}
|
|
29
|
+
async compactAll({ module } = {}) {
|
|
30
|
+
const docs = await AbstractDoc.findAll(this.#sys, { module });
|
|
31
|
+
const targets = docs.filter((doc) => doc.lineCount > this.#minLines);
|
|
32
|
+
const reports = [];
|
|
33
|
+
for (const doc of targets)
|
|
34
|
+
reports.push(await this.compact(doc));
|
|
35
|
+
return { scanned: docs.length, reports };
|
|
36
|
+
}
|
|
37
|
+
async compact(doc) {
|
|
38
|
+
const session = new AiSession("compactAbstract", {
|
|
39
|
+
workspace: this.#sys.workspace,
|
|
40
|
+
cacheKey: `${this.#sys.name}-${doc.moduleName}`
|
|
41
|
+
});
|
|
42
|
+
const approve = !this.#interactive;
|
|
43
|
+
const compacted = await session.editMarkdown(this.#request(doc), { approve });
|
|
44
|
+
const reviewed = await session.editMarkdown(AbstractCompactor.#reviewRequest, { approve });
|
|
45
|
+
const next = [reviewed, compacted].map((candidate) => candidate.trim()).find((candidate) => doc.canReplaceWith(candidate));
|
|
46
|
+
const beforeLines = doc.lineCount;
|
|
47
|
+
if (!next) {
|
|
48
|
+
Logger.rawLog(chalk.yellow(`${doc.path}: the editor returned no shorter abstract, keeping the current file`));
|
|
49
|
+
return { path: doc.path, beforeLines, afterLines: beforeLines, status: "failed" };
|
|
50
|
+
}
|
|
51
|
+
if (next === doc.content.trim())
|
|
52
|
+
return { path: doc.path, beforeLines, afterLines: beforeLines, status: "unchanged" };
|
|
53
|
+
const content = `${next}
|
|
54
|
+
`;
|
|
55
|
+
await this.#sys.writeFile(doc.path, content);
|
|
56
|
+
return { path: doc.path, beforeLines, afterLines: AbstractDoc.lineCountOf(content), status: "compacted" };
|
|
57
|
+
}
|
|
58
|
+
#targetShape(kind) {
|
|
59
|
+
if (kind === "other")
|
|
60
|
+
return " - keep the headings that still carry information and drop the rest; do not impose a new structure";
|
|
61
|
+
return [
|
|
62
|
+
" - `# <name> Abstract` title line",
|
|
63
|
+
" - one declarative sentence naming what this module owns",
|
|
64
|
+
" - `## Rules` \u2014 two to five bullets, each an invariant the code cannot show by itself",
|
|
65
|
+
" - optional `## Workflow` \u2014 the lifecycle as an arrow chain (`draft -> signed -> active`) or a few bullets"
|
|
66
|
+
].join(`
|
|
67
|
+
`);
|
|
68
|
+
}
|
|
69
|
+
#request(doc) {
|
|
70
|
+
return `You are compacting an Akan.js abstract file.
|
|
71
|
+
|
|
72
|
+
An abstract is the summary a coding agent reads before changing a module. Repeated edits have made this one
|
|
73
|
+
bloated, and it has to shrink back to what the source files cannot show by themselves.
|
|
74
|
+
|
|
75
|
+
# Target file
|
|
76
|
+
${this.#sys.type}s/${this.#sys.name}/${doc.path} (${doc.kind} module "${doc.moduleName}", ${doc.lineCount} lines)
|
|
77
|
+
|
|
78
|
+
# Source files in the same folder
|
|
79
|
+
${doc.siblingFiles.join(", ") || "none"}
|
|
80
|
+
|
|
81
|
+
# Current content
|
|
82
|
+
\`\`\`markdown
|
|
83
|
+
${doc.content}
|
|
84
|
+
\`\`\`
|
|
85
|
+
|
|
86
|
+
# Rules for the compacted file
|
|
87
|
+
- Write it in the SAME language as the current content. Never translate.
|
|
88
|
+
- Keep every invariant, constraint, security reason, and workflow step that the source files cannot show by
|
|
89
|
+
themselves. Merge duplicates instead of dropping either one.
|
|
90
|
+
- Delete what the code already states: field lists, types, labels, signatures, file lists, and imports.
|
|
91
|
+
- Delete scaffold and placeholder wording, changelog or migration history, TODOs, and any instruction about
|
|
92
|
+
reading or updating this file.
|
|
93
|
+
- Never invent a rule that the current content does not state.
|
|
94
|
+
- Keep every bullet to one short line, and stay under ${AbstractDoc.compactMinLines} lines in total.
|
|
95
|
+
- Shape:
|
|
96
|
+
${this.#targetShape(doc.kind)}
|
|
97
|
+
|
|
98
|
+
Respond with exactly one \`\`\`markdown code block holding the whole new file and nothing else.`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
AbstractCompactor
|
|
103
|
+
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AgentScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
4
|
+
} from "./index-2f6mjanp.js";
|
|
5
|
+
import"./index-n3drhjgc.js";
|
|
6
|
+
import"./index-0476y8pz.js";
|
|
7
|
+
import"./index-3f3bjcwc.js";
|
|
8
8
|
import {
|
|
9
9
|
Workspace,
|
|
10
10
|
command
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
} from "./index-g10wmymm.js";
|
|
12
|
+
import"./index-3g17wsqr.js";
|
|
13
13
|
import"./index-67546d0j.js";
|
|
14
|
+
import"./index-f39512t6.js";
|
|
14
15
|
import"./index-6pz1j0zj.js";
|
|
15
|
-
import"./index-
|
|
16
|
+
import"./index-yb2wsc7f.js";
|
|
16
17
|
|
|
17
18
|
// pkgs/@akanjs/cli/agent/agent.command.ts
|
|
18
19
|
class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
AbstractDoc
|
|
4
|
+
} from "./index-0wae5ebk.js";
|
|
2
5
|
import {
|
|
3
6
|
ApplicationScript
|
|
4
|
-
} from "./index-
|
|
7
|
+
} from "./index-hr3n31n0.js";
|
|
5
8
|
import {
|
|
6
9
|
getMobileTargetChoices
|
|
7
10
|
} from "./index-76rn3g2c.js";
|
|
8
|
-
import"./index-
|
|
11
|
+
import"./index-4fh6v6qr.js";
|
|
9
12
|
import {
|
|
10
13
|
App,
|
|
11
14
|
Exec,
|
|
12
15
|
Sys,
|
|
13
16
|
Workspace,
|
|
14
17
|
command
|
|
15
|
-
} from "./index-
|
|
18
|
+
} from "./index-g10wmymm.js";
|
|
16
19
|
import"./index-fgc8r6dj.js";
|
|
17
|
-
import"./index-
|
|
20
|
+
import"./index-3g17wsqr.js";
|
|
18
21
|
import"./index-67546d0j.js";
|
|
19
22
|
import"./index-bjpxzr6s.js";
|
|
23
|
+
import"./index-f39512t6.js";
|
|
20
24
|
import"./index-6pz1j0zj.js";
|
|
21
|
-
import"./index-
|
|
25
|
+
import"./index-yb2wsc7f.js";
|
|
22
26
|
|
|
23
27
|
// pkgs/@akanjs/cli/application/application.command.ts
|
|
24
28
|
import { select } from "@inquirer/prompts";
|
|
@@ -39,6 +43,13 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
|
|
|
39
43
|
sync: target({ desc: "Sync dependencies and configuration for an app or library" }).with(Sys).exec(async function(sys) {
|
|
40
44
|
await this.applicationScript.sync(sys);
|
|
41
45
|
}),
|
|
46
|
+
compact: target({ desc: "Compact the *.abstract.md files of an app or library with the AI editor" }).with(Sys).option("module", String, { desc: "single module to compact", nullable: true }).option("minLines", Number, {
|
|
47
|
+
flag: "n",
|
|
48
|
+
desc: "only compact abstracts longer than this",
|
|
49
|
+
default: AbstractDoc.compactMinLines
|
|
50
|
+
}).option("interactive", Boolean, { desc: "confirm or refine each rewrite", default: false }).exec(async function(sys, module, minLines, interactive) {
|
|
51
|
+
await this.applicationScript.compact(sys, { module, minLines, interactive });
|
|
52
|
+
}),
|
|
42
53
|
script: target({ desc: "Run a custom script in the application" }).with(App).arg("filename", String, { desc: "name of script", nullable: true }).exec(async function(app, filename) {
|
|
43
54
|
await this.applicationScript.script(app, filename);
|
|
44
55
|
}),
|
|
@@ -4,13 +4,14 @@ import {
|
|
|
4
4
|
CsrArtifactBuilder,
|
|
5
5
|
SsrBaseArtifactBuilder,
|
|
6
6
|
precompressArtifacts
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-f2s5z0p7.js";
|
|
8
8
|
import"./index-rh16j3c7.js";
|
|
9
9
|
import"./index-bjpxzr6s.js";
|
|
10
|
+
import"./index-f39512t6.js";
|
|
10
11
|
import {
|
|
11
12
|
Spinner
|
|
12
13
|
} from "./index-6pz1j0zj.js";
|
|
13
|
-
import"./index-
|
|
14
|
+
import"./index-yb2wsc7f.js";
|
|
14
15
|
|
|
15
16
|
// pkgs/@akanjs/devkit/applicationBuildRunner.ts
|
|
16
17
|
import { mkdir, rm } from "fs/promises";
|
|
@@ -286,6 +287,6 @@ void run().catch((error) => {
|
|
|
286
287
|
}
|
|
287
288
|
}
|
|
288
289
|
export {
|
|
289
|
-
|
|
290
|
-
|
|
290
|
+
AKAN_OPTIONAL_BACKEND_EXTERNALS,
|
|
291
|
+
ApplicationBuildRunner
|
|
291
292
|
};
|
package/buildBatch.proc.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
AppExecutor,
|
|
4
4
|
WorkspaceExecutor
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-3g17wsqr.js";
|
|
6
6
|
import"./index-67546d0j.js";
|
|
7
7
|
import {
|
|
8
8
|
CsrArtifactBuilder,
|
|
@@ -10,11 +10,12 @@ import {
|
|
|
10
10
|
FontOptimizer,
|
|
11
11
|
PagesBundleBuilder,
|
|
12
12
|
SsrBaseArtifactBuilder
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-f2s5z0p7.js";
|
|
14
14
|
import"./index-rh16j3c7.js";
|
|
15
15
|
import"./index-bjpxzr6s.js";
|
|
16
|
+
import"./index-f39512t6.js";
|
|
16
17
|
import"./index-6pz1j0zj.js";
|
|
17
|
-
import"./index-
|
|
18
|
+
import"./index-yb2wsc7f.js";
|
|
18
19
|
|
|
19
20
|
// pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
|
|
20
21
|
import path from "path";
|
|
@@ -24,35 +24,36 @@ import {
|
|
|
24
24
|
selectLocalDevHost,
|
|
25
25
|
sortIosRunTargets,
|
|
26
26
|
writeRootCapacitorConfig
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-ms3vpys1.js";
|
|
28
28
|
import"./index-76rn3g2c.js";
|
|
29
|
-
import"./index-
|
|
29
|
+
import"./index-3g17wsqr.js";
|
|
30
30
|
import"./index-67546d0j.js";
|
|
31
|
+
import"./index-f39512t6.js";
|
|
31
32
|
import"./index-6pz1j0zj.js";
|
|
32
|
-
import"./index-
|
|
33
|
+
import"./index-yb2wsc7f.js";
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
-
sortIosRunTargets,
|
|
36
|
-
selectLocalDevHost,
|
|
37
|
-
sanitizeIosNativeRunEnv,
|
|
38
|
-
rootCapacitorConfigPaths,
|
|
39
|
-
rootCapacitorConfigFilenames,
|
|
40
|
-
raiseGradleMinSdkVersion,
|
|
41
|
-
parseSimctlDevices,
|
|
42
|
-
parseIosRuntimeMajor,
|
|
43
|
-
parseDevicectlDevices,
|
|
44
|
-
materializeCapacitorConfig,
|
|
45
|
-
isPlaceholderAppId,
|
|
46
|
-
getMissingAndroidReleaseSigningKeys,
|
|
47
|
-
getAdbDeviceStateIssues,
|
|
48
|
-
formatIosRunFailureMessage,
|
|
49
|
-
formatAndroidReleaseSigningError,
|
|
50
|
-
clearRootCapacitorConfigs,
|
|
51
|
-
classifyIosRunFailure,
|
|
52
|
-
buildIosNativeRunCommand,
|
|
53
|
-
assertJsonSerializable,
|
|
54
|
-
SWIFTUICORE_MIN_IOS_MAJOR,
|
|
55
|
-
PLACEHOLDER_APP_IDS,
|
|
35
|
+
ANDROID_MIN_SDK_VERSION,
|
|
56
36
|
CapacitorApp,
|
|
57
|
-
|
|
37
|
+
PLACEHOLDER_APP_IDS,
|
|
38
|
+
SWIFTUICORE_MIN_IOS_MAJOR,
|
|
39
|
+
assertJsonSerializable,
|
|
40
|
+
buildIosNativeRunCommand,
|
|
41
|
+
classifyIosRunFailure,
|
|
42
|
+
clearRootCapacitorConfigs,
|
|
43
|
+
formatAndroidReleaseSigningError,
|
|
44
|
+
formatIosRunFailureMessage,
|
|
45
|
+
getAdbDeviceStateIssues,
|
|
46
|
+
getMissingAndroidReleaseSigningKeys,
|
|
47
|
+
isPlaceholderAppId,
|
|
48
|
+
materializeCapacitorConfig,
|
|
49
|
+
parseDevicectlDevices,
|
|
50
|
+
parseIosRuntimeMajor,
|
|
51
|
+
parseSimctlDevices,
|
|
52
|
+
raiseGradleMinSdkVersion,
|
|
53
|
+
rootCapacitorConfigFilenames,
|
|
54
|
+
rootCapacitorConfigPaths,
|
|
55
|
+
sanitizeIosNativeRunEnv,
|
|
56
|
+
selectLocalDevHost,
|
|
57
|
+
sortIosRunTargets,
|
|
58
|
+
writeRootCapacitorConfig
|
|
58
59
|
};
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
CloudScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-med3vqnc.js";
|
|
5
|
+
import"./index-z1eqzrj9.js";
|
|
6
|
+
import"./index-6a9008sh.js";
|
|
6
7
|
import {
|
|
7
8
|
GlobalConfig
|
|
8
9
|
} from "./index-nsj2ftxj.js";
|
|
9
|
-
import"./index-
|
|
10
|
+
import"./index-hr3n31n0.js";
|
|
10
11
|
import"./index-76rn3g2c.js";
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-z36qzgzp.js";
|
|
12
|
+
import"./index-4fh6v6qr.js";
|
|
13
13
|
import {
|
|
14
14
|
Workspace,
|
|
15
15
|
command
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-g10wmymm.js";
|
|
17
17
|
import"./index-fgc8r6dj.js";
|
|
18
|
-
import"./index-
|
|
18
|
+
import"./index-3g17wsqr.js";
|
|
19
19
|
import"./index-46tjzh6s.js";
|
|
20
20
|
import"./index-67546d0j.js";
|
|
21
21
|
import"./index-bjpxzr6s.js";
|
|
22
|
+
import"./index-f39512t6.js";
|
|
22
23
|
import"./index-6pz1j0zj.js";
|
|
23
|
-
import"./index-
|
|
24
|
+
import"./index-yb2wsc7f.js";
|
|
24
25
|
|
|
25
26
|
// pkgs/@akanjs/cli/cloud/cloud.command.ts
|
|
26
27
|
var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
|
package/commandManifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","create-application":"application","remove-application":"application","sync":"application","script":"application","console":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","release-ios":"application","release-android":"application","release-source":"application","codepush":"application","dbup":"application","dbdown":"application","configure-app":"application","create-library":"library","remove-library":"library","sync-library":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","set-llm":"cloud","reset-llm":"cloud","ask":"cloud","deploy-akan":"cloud","update":"cloud","download-env":"cloud","upload-env":"cloud","guideline":"guideline","generate-instruction":"guideline","update-instruction":"guideline","generate-document":"guideline","reapply-instruction":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","repair":"repair","workflow":"workflow"}}
|
|
1
|
+
{"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","create-application":"application","remove-application":"application","sync":"application","compact":"application","script":"application","console":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","release-ios":"application","release-android":"application","release-source":"application","codepush":"application","dbup":"application","dbdown":"application","configure-app":"application","create-library":"library","remove-library":"library","sync-library":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","set-llm":"cloud","reset-llm":"cloud","ask":"cloud","deploy-akan":"cloud","update":"cloud","download-env":"cloud","upload-env":"cloud","guideline":"guideline","generate-instruction":"guideline","update-instruction":"guideline","generate-document":"guideline","reapply-instruction":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","repair":"repair","workflow":"workflow"}}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ContextScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
4
|
+
} from "./index-4j0qw1hz.js";
|
|
5
|
+
import"./index-3hyw3026.js";
|
|
6
|
+
import"./index-90a0z8xq.js";
|
|
7
|
+
import"./index-pw9qhve8.js";
|
|
8
|
+
import"./index-r8drwwr8.js";
|
|
9
|
+
import"./index-dscrzdk0.js";
|
|
10
|
+
import"./index-jf5k3bt8.js";
|
|
11
11
|
import"./index-ss469dec.js";
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
12
|
+
import"./index-ms3vpys1.js";
|
|
13
|
+
import"./index-n3drhjgc.js";
|
|
14
|
+
import"./index-0476y8pz.js";
|
|
15
|
+
import"./index-3f3bjcwc.js";
|
|
16
16
|
import"./index-nsj2ftxj.js";
|
|
17
17
|
import"./index-76rn3g2c.js";
|
|
18
18
|
import {
|
|
19
19
|
Workspace,
|
|
20
20
|
command
|
|
21
|
-
} from "./index-
|
|
22
|
-
import"./index-
|
|
21
|
+
} from "./index-g10wmymm.js";
|
|
22
|
+
import"./index-3g17wsqr.js";
|
|
23
23
|
import"./index-67546d0j.js";
|
|
24
|
+
import"./index-f39512t6.js";
|
|
24
25
|
import"./index-6pz1j0zj.js";
|
|
25
|
-
import"./index-
|
|
26
|
+
import"./index-yb2wsc7f.js";
|
|
26
27
|
|
|
27
28
|
// pkgs/@akanjs/cli/context/context.command.ts
|
|
28
29
|
class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
Prompter
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-3f3bjcwc.js";
|
|
5
5
|
import {
|
|
6
6
|
AiSession
|
|
7
7
|
} from "./index-nsj2ftxj.js";
|
|
@@ -10,15 +10,16 @@ import {
|
|
|
10
10
|
command,
|
|
11
11
|
runner,
|
|
12
12
|
script
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-g10wmymm.js";
|
|
14
14
|
import {
|
|
15
15
|
getDirname
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-3g17wsqr.js";
|
|
17
17
|
import {
|
|
18
18
|
FileSys
|
|
19
19
|
} from "./index-67546d0j.js";
|
|
20
|
+
import"./index-f39512t6.js";
|
|
20
21
|
import"./index-6pz1j0zj.js";
|
|
21
|
-
import"./index-
|
|
22
|
+
import"./index-yb2wsc7f.js";
|
|
22
23
|
|
|
23
24
|
// pkgs/@akanjs/cli/guideline/guideline.script.ts
|
|
24
25
|
import { Logger } from "akanjs/common";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
AppExecutor,
|
|
7
7
|
WorkspaceExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-3g17wsqr.js";
|
|
9
9
|
import"./index-67546d0j.js";
|
|
10
10
|
import {
|
|
11
11
|
AutoImportSync,
|
|
@@ -18,8 +18,9 @@ import {
|
|
|
18
18
|
HmrWatcher,
|
|
19
19
|
WatchRootResolver
|
|
20
20
|
} from "./index-bjpxzr6s.js";
|
|
21
|
+
import"./index-f39512t6.js";
|
|
21
22
|
import"./index-6pz1j0zj.js";
|
|
22
|
-
import"./index-
|
|
23
|
+
import"./index-yb2wsc7f.js";
|
|
23
24
|
|
|
24
25
|
// pkgs/@akanjs/devkit/incrementalBuilder/incrementalBuilder.proc.ts
|
|
25
26
|
import path2 from "path";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// pkgs/@akanjs/devkit/abstractDoc.ts
|
|
3
|
+
class AbstractDoc {
|
|
4
|
+
path;
|
|
5
|
+
content;
|
|
6
|
+
siblingFiles;
|
|
7
|
+
static suffix = ".abstract.md";
|
|
8
|
+
static maxLines = 300;
|
|
9
|
+
static compactMinLines = 40;
|
|
10
|
+
static #facetRoots = "{lib,ui,webkit,srvkit,common,plugin}";
|
|
11
|
+
static isAbstractPath(filePath) {
|
|
12
|
+
return filePath.endsWith(AbstractDoc.suffix);
|
|
13
|
+
}
|
|
14
|
+
static lineCountOf(content) {
|
|
15
|
+
return content.split(/\r?\n/).length;
|
|
16
|
+
}
|
|
17
|
+
static kindOf(filePath) {
|
|
18
|
+
const [root, folder, ...rest] = filePath.split("/");
|
|
19
|
+
if (root !== "lib" || !folder)
|
|
20
|
+
return "other";
|
|
21
|
+
if (folder === "__scalar")
|
|
22
|
+
return rest.length === 2 ? "scalar" : "other";
|
|
23
|
+
if (rest.length !== 1)
|
|
24
|
+
return "other";
|
|
25
|
+
return folder.startsWith("_") ? "service" : "domain";
|
|
26
|
+
}
|
|
27
|
+
static async findAll(sys, { module } = {}) {
|
|
28
|
+
const filePaths = (await sys.getAllFiles(`${AbstractDoc.#facetRoots}/**/*${AbstractDoc.suffix}`)).sort();
|
|
29
|
+
const docs = await Promise.all(filePaths.map((filePath) => AbstractDoc.read(sys, filePath)));
|
|
30
|
+
if (!module)
|
|
31
|
+
return docs;
|
|
32
|
+
return docs.filter((doc) => doc.moduleName === module || doc.folderName === module);
|
|
33
|
+
}
|
|
34
|
+
static async read(sys, filePath) {
|
|
35
|
+
const dirPath = filePath.split("/").slice(0, -1).join("/");
|
|
36
|
+
const [content, folderFiles] = await Promise.all([sys.readFile(filePath), sys.readdir(dirPath)]);
|
|
37
|
+
return new AbstractDoc(filePath, content, folderFiles.filter((fileName) => !AbstractDoc.isAbstractPath(fileName)));
|
|
38
|
+
}
|
|
39
|
+
constructor(path, content, siblingFiles) {
|
|
40
|
+
this.path = path;
|
|
41
|
+
this.content = content;
|
|
42
|
+
this.siblingFiles = siblingFiles;
|
|
43
|
+
}
|
|
44
|
+
get kind() {
|
|
45
|
+
return AbstractDoc.kindOf(this.path);
|
|
46
|
+
}
|
|
47
|
+
get folderName() {
|
|
48
|
+
return this.path.split("/").at(-2) ?? "";
|
|
49
|
+
}
|
|
50
|
+
get moduleName() {
|
|
51
|
+
return (this.path.split("/").at(-1) ?? "").slice(0, -AbstractDoc.suffix.length);
|
|
52
|
+
}
|
|
53
|
+
get lineCount() {
|
|
54
|
+
return AbstractDoc.lineCountOf(this.content);
|
|
55
|
+
}
|
|
56
|
+
canReplaceWith(candidate) {
|
|
57
|
+
const next = candidate.trim();
|
|
58
|
+
if (!next.startsWith("#"))
|
|
59
|
+
return false;
|
|
60
|
+
const lineCount = AbstractDoc.lineCountOf(next);
|
|
61
|
+
return lineCount >= 3 && lineCount < this.lineCount;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { AbstractDoc };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-n3drhjgc.js";
|
|
5
5
|
import {
|
|
6
6
|
Prompter
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-3f3bjcwc.js";
|
|
8
8
|
import {
|
|
9
9
|
runner,
|
|
10
10
|
script
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-g10wmymm.js";
|
|
12
12
|
|
|
13
13
|
// pkgs/@akanjs/cli/agent/agent.script.ts
|
|
14
14
|
import { Logger } from "akanjs/common";
|
|
@@ -79,6 +79,7 @@ ${sampleCleanup}## Akan Module Abstracts
|
|
|
79
79
|
- Update the abstract when business invariants, workflows, or public behavior change.
|
|
80
80
|
- Do not update the abstract for formatting-only, import-only, or style-only changes.
|
|
81
81
|
- Service modules live in \`lib/_<service>\`, but their abstract file is \`<service>.abstract.md\`.
|
|
82
|
+
- Keep an abstract short. Run \`akan compact <app-or-lib>\` to rewrite bloated abstracts down to the invariants the code cannot show; \`akan quality scan\` warns past 300 lines.
|
|
82
83
|
|
|
83
84
|
## Generated Files
|
|
84
85
|
|
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
FileSys
|
|
4
4
|
} from "./index-67546d0j.js";
|
|
5
|
+
import {
|
|
6
|
+
getRootBoundarySegments,
|
|
7
|
+
isRootBoundarySegments
|
|
8
|
+
} from "./index-f39512t6.js";
|
|
5
9
|
import {
|
|
6
10
|
Spinner
|
|
7
11
|
} from "./index-6pz1j0zj.js";
|
|
8
12
|
import {
|
|
9
13
|
__require
|
|
10
|
-
} from "./index-
|
|
14
|
+
} from "./index-yb2wsc7f.js";
|
|
11
15
|
|
|
12
16
|
// pkgs/@akanjs/devkit/executors.ts
|
|
13
17
|
import {
|
|
@@ -876,7 +880,7 @@ var moduleUiFileTypes = {
|
|
|
876
880
|
};
|
|
877
881
|
var testFilePattern = /\.(test|spec)\.(ts|tsx)$/;
|
|
878
882
|
var rootSignalTestFilePattern = /^[A-Za-z][A-Za-z0-9_-]*\.signal\.(test|spec)\.(ts|tsx)$/;
|
|
879
|
-
var createDependencyScanner = async (exec) => (await import("./dependencyScanner-
|
|
883
|
+
var createDependencyScanner = async (exec) => (await import("./dependencyScanner-rbs2407b.js")).TypeScriptDependencyScanner.from(exec);
|
|
880
884
|
var isAllowedTestFile = (filename) => testFilePattern.test(filename);
|
|
881
885
|
var isAllowedLibRootFile = (filename) => libRootAllowedFiles.has(filename) || rootSignalTestFilePattern.test(filename);
|
|
882
886
|
var getScanPath = (exec, relativePath) => path4.posix.join(`${exec.type}s`, exec.name, relativePath.split(path4.sep).join("/"));
|
|
@@ -1917,7 +1921,7 @@ class Executor {
|
|
|
1917
1921
|
return this._applyTemplate({ ...options, dict });
|
|
1918
1922
|
}
|
|
1919
1923
|
async getTypeChecker() {
|
|
1920
|
-
const { TypeChecker } = await import("./typeChecker-
|
|
1924
|
+
const { TypeChecker } = await import("./typeChecker-g6bh0xfv.js");
|
|
1921
1925
|
this.typeChecker ??= new TypeChecker(this);
|
|
1922
1926
|
return this.typeChecker;
|
|
1923
1927
|
}
|
|
@@ -2363,7 +2367,7 @@ class SysExecutor extends Executor {
|
|
|
2363
2367
|
class AppExecutor extends SysExecutor {
|
|
2364
2368
|
static #routeSourceValidator = null;
|
|
2365
2369
|
static async#getRouteSourceValidator() {
|
|
2366
|
-
AppExecutor.#routeSourceValidator ??= (await import("./routeSourceValidator-
|
|
2370
|
+
AppExecutor.#routeSourceValidator ??= (await import("./routeSourceValidator-rk64s1g4.js")).RouteSourceValidator;
|
|
2367
2371
|
return AppExecutor.#routeSourceValidator;
|
|
2368
2372
|
}
|
|
2369
2373
|
dist;
|
|
@@ -2519,7 +2523,8 @@ class AppExecutor extends SysExecutor {
|
|
|
2519
2523
|
}
|
|
2520
2524
|
if (!owner)
|
|
2521
2525
|
owners.set(routeId, { absPath, fromLib });
|
|
2522
|
-
const
|
|
2526
|
+
const layoutSegments = getRootBoundarySegments(key);
|
|
2527
|
+
const isRootLayout = layoutSegments !== null && isRootBoundarySegments(layoutSegments, akanConfig2.basePaths);
|
|
2523
2528
|
const routeSource = await Bun.file(absPath).text();
|
|
2524
2529
|
const validator = await AppExecutor.#getRouteSourceValidator();
|
|
2525
2530
|
if (parsed.kind === "overrides")
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-n3drhjgc.js";
|
|
5
5
|
import {
|
|
6
6
|
createRepairReport,
|
|
7
7
|
generatedFilePathsForTarget,
|
|
8
8
|
renderRepairReport,
|
|
9
9
|
writeGeneratedSyncState,
|
|
10
10
|
writeWorkflowRunArtifact
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-0476y8pz.js";
|
|
12
12
|
import {
|
|
13
13
|
runner
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-g10wmymm.js";
|
|
15
15
|
|
|
16
16
|
// pkgs/@akanjs/cli/repair/repair.runner.ts
|
|
17
17
|
var commandForShell = (command) => command.startsWith("akan ") ? `bun run ${command}` : command;
|