@akanjs/cli 3.3.0-rc.12 → 3.3.0-rc.13
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-cqbf9gsv.js → CodeAgent-zkr3s3xy.js} +2 -2
- package/{CodeTui-ehdr4hgw.js → CodeTui-1qvrzfmy.js} +1 -1
- package/TunnelShare-8j95ta3w.js +16 -0
- package/{agent.command-x55ncdjm.js → agent.command-dejgb8vz.js} +18 -17
- package/akanCode.js +2 -2
- package/{appExecutor-1ctzymwa.js → appExecutor-nj95a6en.js} +3 -3
- package/{application.command-xpntxnh8.js → application.command-3tnq1587.js} +45 -15
- package/{applicationBuildRunner-19c76791.js → applicationBuildRunner-cbjy05yg.js} +75 -12
- package/buildBatch.proc.js +10 -10
- package/{cloud.command-p3ybjes7.js → cloud.command-qae6et2e.js} +19 -18
- package/cloud.script-34xmprty.js +31 -0
- package/{code.command-m6skj1kj.js → code.command-xrh506zf.js} +10 -10
- package/commandManifest.json +1 -1
- package/{context.command-3c3nv0d6.js → context.command-fxyzkwg5.js} +18 -18
- package/context.runner-bz1jwxkk.js +32 -0
- package/{csrArtifactBuilder-mdh9ykn2.js → csrArtifactBuilder-rqg85wbg.js} +2 -2
- package/{guideline.command-725fq5p0.js → guideline.command-7dgscqjq.js} +6 -6
- package/guidelines/conventions/rules/config.md +5 -0
- package/guidelines/conventions/rules/page.md +3 -0
- package/guidelines/errorCodes/errorCodes.instruction.md +4 -0
- package/guidelines/pageRule/pageRule.instruction.md +19 -0
- package/guidelines/runtimeRule/runtimeRule.instruction.md +109 -6
- package/incrementalBuilder.proc.js +8 -8
- package/{index-3mj5trqc.js → index-0bzrcv91.js} +1 -1
- package/{index-q63nbpv7.js → index-0zkxsdsg.js} +3 -3
- package/{index-wxqp1amd.js → index-1c52g4st.js} +11 -9
- package/{index-vnk1qwgr.js → index-22h6vq3f.js} +4 -4
- package/index-35p43f33.js +16 -0
- package/{index-fagjtk6m.js → index-3q7ectss.js} +2 -2
- package/{index-se7n78fh.js → index-54g085ty.js} +1 -1
- package/{index-rt7q20sj.js → index-5sa1tr7w.js} +1 -1
- package/{index-h8w1n11r.js → index-6a3rmwxx.js} +4 -4
- package/{index-yey1envc.js → index-741xbhes.js} +1 -1
- package/{index-9a9t77hz.js → index-77627y32.js} +2 -2
- package/{index-4r8dgm4x.js → index-8javbznc.js} +3 -3
- package/{index-hxg6ctk2.js → index-a2a3nh57.js} +3 -3
- package/{index-j2wq064m.js → index-aezpcphy.js} +121 -15
- package/{index-3r1crbct.js → index-ay4vkwr8.js} +1 -1
- package/{index-t23dgyaf.js → index-b4m7bjbx.js} +7 -7
- package/{index-rdcgz02t.js → index-bma8tmgb.js} +4 -4
- package/{index-3zkhg65e.js → index-c4g8egm2.js} +40 -13
- package/{index-9gjcbp2g.js → index-c8kj74zz.js} +1 -1
- package/{index-fjqapyex.js → index-es2wkn41.js} +40 -5
- package/{index-pyjkbg8e.js → index-extg77rx.js} +2 -2
- package/{index-nmdmkjt2.js → index-fey1dd49.js} +4 -4
- package/{index-c669pbyb.js → index-fjzeak0t.js} +68 -37
- package/{index-f4jydw2x.js → index-gdgbgn82.js} +1 -1
- package/{index-4yvtqcme.js → index-gyyscjzx.js} +16 -4
- package/{index-qecrqpt6.js → index-hxcefw29.js} +1 -1
- package/{index-a4gcdffy.js → index-k380ww64.js} +3 -3
- package/index-kqxs1d7z.js +377 -0
- package/{index-nnmw56fz.js → index-mv3ke0fc.js} +5 -5
- package/{index-m303nhv6.js → index-mvdmb73w.js} +6 -6
- package/{index-cbm9gzgx.js → index-pa53zktp.js} +5 -5
- package/{index-3a3vy2xy.js → index-psvxwemh.js} +8 -8
- package/{index-ckcc9ab3.js → index-r24mj2pw.js} +8 -8
- package/{index-8bta5pnr.js → index-serpfvat.js} +2 -2
- package/{index-kbnvyhy4.js → index-shjjjdte.js} +3 -3
- package/{index-pr9nypg7.js → index-sjmk7wp7.js} +2 -2
- package/{index-wkwe91sn.js → index-th7qbjfz.js} +11 -11
- package/{index-5ahe641t.js → index-vgd07z61.js} +8 -8
- package/{index-crd99zqs.js → index-wzvvqkcy.js} +1 -1
- package/{index-v16gj2as.js → index-ys1sjp6m.js} +90 -51
- package/{index-22bwg8hy.js → index-zc43cyg8.js} +1 -1
- package/index.js +27 -27
- package/{libExecutor-n8hpm8s7.js → libExecutor-mqxnn0h6.js} +2 -2
- package/{library.command-8abb26pg.js → library.command-4kefxh8z.js} +7 -7
- package/{localRegistry.command-sa211m1z.js → localRegistry.command-phgrhkks.js} +18 -17
- package/{module.command-z3cwjf0p.js → module.command-8476gwze.js} +9 -9
- package/{package.command-akynhtee.js → package.command-ygxm5pp9.js} +8 -8
- package/package.json +2 -2
- package/{page.command-3fpdavk9.js → page.command-f7fwkj8y.js} +7 -7
- package/{pipeline.command-ca95n8rd.js → pipeline.command-9htjbrdm.js} +6 -6
- package/{pkgExecutor-a73q41vx.js → pkgExecutor-6a91xng5.js} +2 -2
- package/{primitive.command-xwe9ggnf.js → primitive.command-0k0h0cm0.js} +10 -10
- package/{projectTypecheck-7g542ymk.js → projectTypecheck-7kakbacs.js} +1 -1
- package/{quality.command-7wz7y8z1.js → quality.command-frsfdfc5.js} +9 -8
- package/{repair.command-dej1qtfq.js → repair.command-yag3bpq2.js} +9 -9
- package/{scalar.command-z9qfxnvm.js → scalar.command-qtyrywvt.js} +8 -8
- package/skills/akan-runtime/SKILL.md +20 -0
- package/{subspace.command-9wekm4gn.js → subspace.command-kr53abzt.js} +10 -10
- package/{tunnel.command-cxc4h3j8.js → tunnel.command-pswe6nye.js} +9 -9
- package/{typeChecker-7jt6abrs.js → typeChecker-epg7ebfy.js} +2 -1
- package/typecheck.proc.js +2 -1
- package/{verify.command-j0w9dr5c.js → verify.command-ghhhzgrw.js} +15 -14
- package/{workflow.command-yt4sz04b.js → workflow.command-fpwqth4w.js} +14 -14
- package/{workspace.command-8mp4mcp2.js → workspace.command-6bbmtn3w.js} +33 -31
- package/TunnelShare-0p4dy89e.js +0 -16
- package/cloud.script-0dsyd10v.js +0 -30
- package/context.runner-yyp7a112.js +0 -32
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
WithheldEnvFile
|
|
4
|
+
} from "./index-35p43f33.js";
|
|
5
|
+
|
|
2
6
|
// pkgs/@akanjs/devkit/typecheck/typeChecker.ts
|
|
3
7
|
import { readFileSync } from "fs";
|
|
4
|
-
import * as
|
|
8
|
+
import * as path2 from "path";
|
|
5
9
|
import chalk from "chalk";
|
|
10
|
+
import * as ts2 from "typescript";
|
|
11
|
+
|
|
12
|
+
// pkgs/@akanjs/devkit/typecheck/withheldDiagnostics.ts
|
|
13
|
+
import * as path from "path";
|
|
6
14
|
import * as ts from "typescript";
|
|
15
|
+
class WithheldDiagnostics {
|
|
16
|
+
static note = WithheldEnvFile.note;
|
|
17
|
+
static isWithheld(fileName) {
|
|
18
|
+
return WithheldEnvFile.isEnvFile(fileName);
|
|
19
|
+
}
|
|
20
|
+
static applies(diagnostic) {
|
|
21
|
+
return WithheldDiagnostics.isWithheld(diagnostic.file?.fileName);
|
|
22
|
+
}
|
|
23
|
+
static message(diagnostic) {
|
|
24
|
+
return WithheldDiagnostics.applies(diagnostic) ? WithheldDiagnostics.note : ts.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
25
|
+
`);
|
|
26
|
+
}
|
|
27
|
+
static format(diagnostic, host) {
|
|
28
|
+
const related = diagnostic.relatedInformation?.filter(({ file }) => !WithheldDiagnostics.isWithheld(file?.fileName));
|
|
29
|
+
if (!WithheldDiagnostics.applies(diagnostic))
|
|
30
|
+
return ts.formatDiagnosticsWithColorAndContext([
|
|
31
|
+
related?.length === diagnostic.relatedInformation?.length ? diagnostic : { ...diagnostic, relatedInformation: related }
|
|
32
|
+
], host);
|
|
33
|
+
const { file, start } = diagnostic;
|
|
34
|
+
const at = file && start !== undefined ? file.getLineAndCharacterOfPosition(start) : { line: -1, character: -1 };
|
|
35
|
+
const name = path.relative(host.getCurrentDirectory(), file?.fileName ?? "");
|
|
36
|
+
return `${name}:${at.line + 1}:${at.character + 1} - error TS${diagnostic.code}: ${WithheldDiagnostics.note}${host.getNewLine()}`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
7
39
|
|
|
40
|
+
// pkgs/@akanjs/devkit/typecheck/typeChecker.ts
|
|
8
41
|
class TypeChecker2 {
|
|
9
42
|
configPath;
|
|
10
43
|
configFile;
|
|
@@ -14,10 +47,10 @@ class TypeChecker2 {
|
|
|
14
47
|
if (!configPath)
|
|
15
48
|
throw new Error("No tsconfig.json found in the project");
|
|
16
49
|
this.configPath = configPath;
|
|
17
|
-
this.configFile =
|
|
18
|
-
const parsedConfig =
|
|
50
|
+
this.configFile = ts2.readConfigFile(this.configPath, (fileName) => ts2.sys.readFile(fileName));
|
|
51
|
+
const parsedConfig = ts2.parseJsonConfigFileContent(this.configFile.config, ts2.sys, path2.dirname(this.configPath), undefined, this.configPath);
|
|
19
52
|
if (parsedConfig.errors.length > 0) {
|
|
20
|
-
const errorMessages = parsedConfig.errors.map((error) =>
|
|
53
|
+
const errorMessages = parsedConfig.errors.map((error) => ts2.flattenDiagnosticMessageText(error.messageText, `
|
|
21
54
|
`)).join(`
|
|
22
55
|
`);
|
|
23
56
|
throw new Error(`Error parsing tsconfig.json:
|
|
@@ -26,20 +59,20 @@ ${errorMessages}`);
|
|
|
26
59
|
this.config = parsedConfig;
|
|
27
60
|
}
|
|
28
61
|
#findConfigFile(searchPath) {
|
|
29
|
-
return
|
|
62
|
+
return ts2.findConfigFile(searchPath, (fileName) => ts2.sys.fileExists(fileName), "tsconfig.json");
|
|
30
63
|
}
|
|
31
64
|
check(filePath) {
|
|
32
|
-
const program =
|
|
65
|
+
const program = ts2.createProgram([filePath], this.config.options);
|
|
33
66
|
const diagnostics = [
|
|
34
67
|
...program.getSemanticDiagnostics(),
|
|
35
68
|
...program.getSyntacticDiagnostics(),
|
|
36
69
|
...this.config.options.declaration ? program.getDeclarationDiagnostics() : []
|
|
37
70
|
];
|
|
38
|
-
const errors = diagnostics.filter((diagnostic) => diagnostic.category ===
|
|
39
|
-
const warnings = diagnostics.filter((diagnostic) => diagnostic.category ===
|
|
71
|
+
const errors = diagnostics.filter((diagnostic) => diagnostic.category === ts2.DiagnosticCategory.Error);
|
|
72
|
+
const warnings = diagnostics.filter((diagnostic) => diagnostic.category === ts2.DiagnosticCategory.Warning);
|
|
40
73
|
const fileDiagnostics = diagnostics.filter((diagnostic) => diagnostic.file?.fileName === filePath);
|
|
41
|
-
const fileErrors = fileDiagnostics.filter((diagnostic) => diagnostic.category ===
|
|
42
|
-
const fileWarnings = fileDiagnostics.filter((diagnostic) => diagnostic.category ===
|
|
74
|
+
const fileErrors = fileDiagnostics.filter((diagnostic) => diagnostic.category === ts2.DiagnosticCategory.Error);
|
|
75
|
+
const fileWarnings = fileDiagnostics.filter((diagnostic) => diagnostic.category === ts2.DiagnosticCategory.Warning);
|
|
43
76
|
return { diagnostics, errors, warnings, fileDiagnostics, fileErrors, fileWarnings };
|
|
44
77
|
}
|
|
45
78
|
formatDiagnostics(diagnostics) {
|
|
@@ -51,11 +84,11 @@ ${errorMessages}`);
|
|
|
51
84
|
let suggestionCount = 0;
|
|
52
85
|
const diagnosticsByFile = new Map;
|
|
53
86
|
diagnostics.forEach((diagnostic) => {
|
|
54
|
-
if (diagnostic.category ===
|
|
87
|
+
if (diagnostic.category === ts2.DiagnosticCategory.Error)
|
|
55
88
|
errorCount++;
|
|
56
|
-
else if (diagnostic.category ===
|
|
89
|
+
else if (diagnostic.category === ts2.DiagnosticCategory.Warning)
|
|
57
90
|
warningCount++;
|
|
58
|
-
else if (diagnostic.category ===
|
|
91
|
+
else if (diagnostic.category === ts2.DiagnosticCategory.Suggestion)
|
|
59
92
|
suggestionCount++;
|
|
60
93
|
diagnosticsByFile.getOrInsert(diagnostic.file?.fileName ?? "", []).push(diagnostic);
|
|
61
94
|
});
|
|
@@ -64,9 +97,8 @@ ${errorMessages}`);
|
|
|
64
97
|
output.push(`
|
|
65
98
|
${chalk.cyan(fileName)}`);
|
|
66
99
|
fileDiagnostics.forEach((diagnostic) => {
|
|
67
|
-
const [categoryText, categoryColor, icon] = diagnostic.category ===
|
|
68
|
-
const message =
|
|
69
|
-
`);
|
|
100
|
+
const [categoryText, categoryColor, icon] = diagnostic.category === ts2.DiagnosticCategory.Error ? ["error", chalk.red, "\u274C"] : diagnostic.category === ts2.DiagnosticCategory.Warning ? ["warning", chalk.yellow, "\u26A0\uFE0F"] : ["suggestion", chalk.blue, "\uD83D\uDCA1"];
|
|
101
|
+
const message = WithheldDiagnostics.message(diagnostic);
|
|
70
102
|
const tsCode = chalk.dim(`(TS${diagnostic.code})`);
|
|
71
103
|
if (diagnostic.file && diagnostic.start !== undefined) {
|
|
72
104
|
const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
|
|
@@ -75,7 +107,7 @@ ${chalk.cyan(fileName)}`);
|
|
|
75
107
|
output.push(` ${chalk.gray("at")} ${fileName}:${chalk.bold(`${line + 1}:${character + 1}`)}`);
|
|
76
108
|
const sourceLines = diagnostic.file.text.split(`
|
|
77
109
|
`);
|
|
78
|
-
if (line < sourceLines.length) {
|
|
110
|
+
if (!WithheldDiagnostics.applies(diagnostic) && line < sourceLines.length) {
|
|
79
111
|
const sourceLine = sourceLines[line];
|
|
80
112
|
const lineNumber = (line + 1).toString().padStart(5, " ");
|
|
81
113
|
output.push(`
|
|
@@ -103,21 +135,20 @@ ${summary.join(", ")} found${output.join(`
|
|
|
103
135
|
}
|
|
104
136
|
getDetailedDiagnostics(filePath) {
|
|
105
137
|
const { diagnostics } = this.check(filePath);
|
|
106
|
-
const sourceFile =
|
|
138
|
+
const sourceFile = ts2.createSourceFile(filePath, readFileSync(filePath, "utf8"), ts2.ScriptTarget.Latest, true);
|
|
107
139
|
const details = diagnostics.map((diagnostic) => {
|
|
108
140
|
if (diagnostic.file && diagnostic.start !== undefined) {
|
|
109
141
|
const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
|
|
110
|
-
const message =
|
|
111
|
-
`);
|
|
142
|
+
const message = WithheldDiagnostics.message(diagnostic);
|
|
112
143
|
const lines = sourceFile.text.split(`
|
|
113
144
|
`);
|
|
114
|
-
const codeSnippet = line < lines.length ? lines[line] : undefined;
|
|
145
|
+
const codeSnippet = line < lines.length && !WithheldDiagnostics.applies(diagnostic) ? lines[line] : undefined;
|
|
115
146
|
return { line: line + 1, column: character + 1, message, code: diagnostic.code, codeSnippet };
|
|
116
147
|
}
|
|
117
148
|
return {
|
|
118
149
|
line: 0,
|
|
119
150
|
column: 0,
|
|
120
|
-
message:
|
|
151
|
+
message: ts2.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
121
152
|
`),
|
|
122
153
|
code: diagnostic.code
|
|
123
154
|
};
|
|
@@ -135,8 +166,8 @@ ${summary.join(", ")} found${output.join(`
|
|
|
135
166
|
static checkProject(configPath, overrides = {}) {
|
|
136
167
|
const parsedConfig = TypeChecker2.parseConfig(configPath);
|
|
137
168
|
const options = { ...parsedConfig.options, ...overrides };
|
|
138
|
-
const host =
|
|
139
|
-
const builderProgram =
|
|
169
|
+
const host = ts2.createIncrementalCompilerHost(options);
|
|
170
|
+
const builderProgram = ts2.createIncrementalProgram({
|
|
140
171
|
rootNames: parsedConfig.fileNames,
|
|
141
172
|
options,
|
|
142
173
|
projectReferences: parsedConfig.projectReferences,
|
|
@@ -144,8 +175,8 @@ ${summary.join(", ")} found${output.join(`
|
|
|
144
175
|
host
|
|
145
176
|
});
|
|
146
177
|
const diagnostics = [...TypeChecker2.#preEmitDiagnostics(builderProgram), ...builderProgram.emit().diagnostics];
|
|
147
|
-
const errors = diagnostics.filter((diagnostic) => diagnostic.category ===
|
|
148
|
-
const warnings = diagnostics.filter((diagnostic) => diagnostic.category ===
|
|
178
|
+
const errors = diagnostics.filter((diagnostic) => diagnostic.category === ts2.DiagnosticCategory.Error);
|
|
179
|
+
const warnings = diagnostics.filter((diagnostic) => diagnostic.category === ts2.DiagnosticCategory.Warning);
|
|
149
180
|
return {
|
|
150
181
|
configPath,
|
|
151
182
|
diagnostics,
|
|
@@ -156,7 +187,7 @@ ${summary.join(", ")} found${output.join(`
|
|
|
156
187
|
}
|
|
157
188
|
static #preEmitDiagnostics(builderProgram) {
|
|
158
189
|
const { declaration, composite } = builderProgram.getCompilerOptions();
|
|
159
|
-
return
|
|
190
|
+
return ts2.sortAndDeduplicateDiagnostics([
|
|
160
191
|
...builderProgram.getConfigFileParsingDiagnostics(),
|
|
161
192
|
...builderProgram.getOptionsDiagnostics(),
|
|
162
193
|
...builderProgram.getSyntacticDiagnostics(),
|
|
@@ -166,37 +197,37 @@ ${summary.join(", ")} found${output.join(`
|
|
|
166
197
|
]);
|
|
167
198
|
}
|
|
168
199
|
static parseConfig(configPath) {
|
|
169
|
-
const configFile =
|
|
200
|
+
const configFile = ts2.readConfigFile(configPath, (fileName) => ts2.sys.readFile(fileName));
|
|
170
201
|
const configDiagnostics = configFile.error ? [configFile.error] : [];
|
|
171
202
|
if (!configFile.config) {
|
|
172
203
|
const message = TypeChecker2.formatDiagnosticMessages(configDiagnostics);
|
|
173
204
|
throw new Error(message || `Error reading tsconfig.json: ${configPath}`);
|
|
174
205
|
}
|
|
175
|
-
const parsedConfig =
|
|
206
|
+
const parsedConfig = ts2.parseJsonConfigFileContent(configFile.config, ts2.sys, path2.dirname(configPath), undefined, configPath);
|
|
176
207
|
if (parsedConfig.errors.length > 0)
|
|
177
208
|
throw new Error(TypeChecker2.formatDiagnosticMessages(parsedConfig.errors));
|
|
178
209
|
return parsedConfig;
|
|
179
210
|
}
|
|
180
211
|
static toRecords(diagnostics, root) {
|
|
181
|
-
return diagnostics.filter((diagnostic) => diagnostic.category ===
|
|
212
|
+
return diagnostics.filter((diagnostic) => diagnostic.category === ts2.DiagnosticCategory.Error || diagnostic.category === ts2.DiagnosticCategory.Warning).map((diagnostic) => {
|
|
182
213
|
const position = diagnostic.file && diagnostic.start !== undefined ? diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : null;
|
|
183
214
|
return {
|
|
184
|
-
file: diagnostic.file ?
|
|
215
|
+
file: diagnostic.file ? path2.relative(root, diagnostic.file.fileName).split(path2.sep).join("/") : null,
|
|
185
216
|
line: position ? position.line + 1 : 0,
|
|
186
217
|
col: position ? position.character + 1 : 0,
|
|
187
218
|
code: `TS${diagnostic.code}`,
|
|
188
|
-
severity: diagnostic.category ===
|
|
189
|
-
message:
|
|
190
|
-
`)
|
|
219
|
+
severity: diagnostic.category === ts2.DiagnosticCategory.Error ? "error" : "warning",
|
|
220
|
+
message: WithheldDiagnostics.message(diagnostic)
|
|
191
221
|
};
|
|
192
222
|
});
|
|
193
223
|
}
|
|
194
224
|
static formatDiagnosticMessages(diagnostics) {
|
|
195
|
-
|
|
225
|
+
const host = {
|
|
196
226
|
getCanonicalFileName: (fileName) => fileName,
|
|
197
227
|
getCurrentDirectory: () => process.cwd(),
|
|
198
|
-
getNewLine: () =>
|
|
199
|
-
}
|
|
228
|
+
getNewLine: () => ts2.sys.newLine
|
|
229
|
+
};
|
|
230
|
+
return diagnostics.map((diagnostic) => WithheldDiagnostics.format(diagnostic, host)).join("");
|
|
200
231
|
}
|
|
201
232
|
}
|
|
202
233
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
SOURCE_EXTS,
|
|
4
4
|
WatchRootResolver
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-serpfvat.js";
|
|
6
6
|
import {
|
|
7
7
|
loaderFor,
|
|
8
8
|
BarrelAnalyzer,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
CsrDevPaths,
|
|
19
19
|
PagesEntrySourceGenerator,
|
|
20
20
|
PagesBundleBuilder
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-0bzrcv91.js";
|
|
22
22
|
import {
|
|
23
23
|
FileSys2
|
|
24
24
|
} from "./index-zyjztrvc.js";
|
|
@@ -26,12 +26,14 @@ import {
|
|
|
26
26
|
AsyncDefaultExportDetector,
|
|
27
27
|
StoreBootstrap,
|
|
28
28
|
resolveSsrPageEntriesForApp
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-77627y32.js";
|
|
30
30
|
|
|
31
31
|
// pkgs/@akanjs/devkit/frontendBuild/clientEntryDiscovery.ts
|
|
32
32
|
import fs from "fs";
|
|
33
33
|
import path from "path";
|
|
34
34
|
var USE_CLIENT_RE = /^\s*(?:\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\/\s*|\/\/[^\n]*\n\s*)*["']use client["']/;
|
|
35
|
+
var EXPORT_STAR_RE = /^\s*export\s*\*/m;
|
|
36
|
+
var HOOK_NAME_RE = /^use[A-Z0-9]/;
|
|
35
37
|
var NODE_MODULES_RE = /[\\/]node_modules[\\/]/;
|
|
36
38
|
var AKANJS_NODE_MODULE_RE = /[\\/]node_modules[\\/]akanjs[\\/]/;
|
|
37
39
|
var NON_SOURCE_EXT_RE = /\.(css|scss|sass|less|json|svg|png|jpe?g|webp|gif|avif|ico|woff2?|ttf|otf|mp3|mp4|wav)$/i;
|
|
@@ -147,7 +149,7 @@ class GraphClientEntryDiscovery {
|
|
|
147
149
|
return null;
|
|
148
150
|
this.#readFiles.add(absPath);
|
|
149
151
|
if (USE_CLIENT_RE.test(content))
|
|
150
|
-
return { isClientEntry:
|
|
152
|
+
return { isClientEntry: !this.#exportsOnlyHooks(content), imports: [] };
|
|
151
153
|
return { isClientEntry: false, imports: this.#scanImports(await this.#rewrite(content, absPath)) };
|
|
152
154
|
})();
|
|
153
155
|
this.#factsCache.set(absPath, cached);
|
|
@@ -165,6 +167,16 @@ class GraphClientEntryDiscovery {
|
|
|
165
167
|
return content;
|
|
166
168
|
}
|
|
167
169
|
}
|
|
170
|
+
#exportsOnlyHooks(content) {
|
|
171
|
+
if (EXPORT_STAR_RE.test(content))
|
|
172
|
+
return false;
|
|
173
|
+
try {
|
|
174
|
+
const { exports } = this.#tsTranspiler.scan(content);
|
|
175
|
+
return exports.length > 0 && exports.every((name) => HOOK_NAME_RE.test(name));
|
|
176
|
+
} catch {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
168
180
|
#scanImports(source) {
|
|
169
181
|
try {
|
|
170
182
|
return this.#tsTranspiler.scanImports(source);
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
SubagentPool2,
|
|
20
20
|
McpSignIn,
|
|
21
21
|
AkanCodeCompaction2
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-zc43cyg8.js";
|
|
23
23
|
import {
|
|
24
24
|
codeAgentIsLoopback,
|
|
25
25
|
codeAgentHostListed,
|
|
@@ -676,7 +676,7 @@ class AkanToolPack2 {
|
|
|
676
676
|
return { name: "akan-tools", factory: async (pi) => await this.#register(pi) };
|
|
677
677
|
}
|
|
678
678
|
async names() {
|
|
679
|
-
const { ContextRunner } = await import("./context.runner-
|
|
679
|
+
const { ContextRunner } = await import("./context.runner-bz1jwxkk.js");
|
|
680
680
|
return [
|
|
681
681
|
...new ContextRunner().listMcpTools(this.#options.mode).map((tool) => tool.name),
|
|
682
682
|
AkanToolPack2.verifyToolName
|
|
@@ -684,7 +684,7 @@ class AkanToolPack2 {
|
|
|
684
684
|
}
|
|
685
685
|
static verifyToolName = "akan_verify";
|
|
686
686
|
async#register(pi) {
|
|
687
|
-
const { ContextRunner } = await import("./context.runner-
|
|
687
|
+
const { ContextRunner } = await import("./context.runner-bz1jwxkk.js");
|
|
688
688
|
const runner = new ContextRunner;
|
|
689
689
|
const guidelineNames = await AkanToolPack2.#guidelineNames();
|
|
690
690
|
for (const tool of runner.listMcpTools(this.#options.mode, { guidelineNames })) {
|