@akanjs/cli 3.2.0-rc.7 → 3.2.0-rc.8
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-aq43sq64.js → CodeAgent-x2p3a3e0.js} +2 -2
- package/{CodeTui-pmychb3m.js → CodeTui-qstk5vpj.js} +1 -1
- package/README.ko.md +23 -0
- package/README.md +23 -0
- package/TunnelShare-c4xsfzg5.js +15 -0
- package/{agent.command-pdmb75bk.js → agent.command-9et2e27p.js} +19 -18
- package/akanCode.js +2 -2
- package/{application.command-xwch7rww.js → application.command-m4rq4wc2.js} +23 -16
- package/{applicationBuildRunner-6yjrxfqs.js → applicationBuildRunner-df7rx3ra.js} +7 -6
- package/buildBatch.proc.js +7 -6
- package/{cloud.command-6angaryd.js → cloud.command-a0gy0qq2.js} +21 -22
- package/cloud.script-xze4zh7n.js +31 -0
- package/{code.command-ceyhrgrc.js → code.command-5rsdqw8s.js} +7 -6
- package/{context.command-n7dbh0ca.js → context.command-rk1dwrg4.js} +18 -17
- package/context.runner-83ky5m1b.js +30 -0
- package/{guideline.command-h5dfzrng.js → guideline.command-mffxknbr.js} +3 -2
- package/guidelines/mcpRule/mcpRule.instruction.md +9 -0
- package/incrementalBuilder.proc.js +5 -4
- package/{index-bza4z89k.js → index-0gg15zwa.js} +4 -4
- package/{index-t0a5mng5.js → index-0hbtve0a.js} +10 -9
- package/{index-mtxbw4fy.js → index-28x1aszt.js} +13 -10
- package/{index-mcdezskv.js → index-2mf1aen9.js} +2 -2
- package/{index-g6ss1r1w.js → index-2r9ff9qm.js} +1 -1
- package/{index-z0r6bhqe.js → index-2vgv7fs7.js} +98 -18
- package/{index-dnqznx16.js → index-34792nh7.js} +1 -1
- package/{index-0fq1b5jp.js → index-3ghdb7p5.js} +9 -15
- package/{index-y9xbhs20.js → index-43f4h4cm.js} +3 -3
- package/{index-8bh9en9m.js → index-5radqwn2.js} +9 -9
- package/{index-dtxntsfx.js → index-5zwr4n6k.js} +1 -1
- package/{index-yp6mpazs.js → index-99qvtff2.js} +3 -3
- package/{index-df0r4008.js → index-an76bdrv.js} +1 -1
- package/{index-ggzb32a9.js → index-exn38bzx.js} +106 -69
- package/{index-y1a7dc7t.js → index-gcx48get.js} +1 -1
- package/{index-2b3n00gz.js → index-grxs6fts.js} +27 -17
- package/{index-qn5xmscz.js → index-gxav1bjz.js} +7 -7
- package/{index-ttrrm805.js → index-hqv34wzq.js} +4 -4
- package/{index-2m6gaatn.js → index-j3v29pq7.js} +78 -43
- package/index-j4yvgfhr.js +70 -0
- package/{index-n0vev0fv.js → index-j6gc8n14.js} +2 -2
- package/{index-kj7vyjng.js → index-j9790rhk.js} +67 -77
- package/{index-xzscbgx2.js → index-k92x3vne.js} +1 -1
- package/{index-qx12c8k5.js → index-nmvhjn8c.js} +1 -1
- package/{index-146p5x0r.js → index-ra9fvn7s.js} +6 -4
- package/{index-9km2h20g.js → index-rfzp4pqs.js} +2 -2
- package/{index-1kj847m5.js → index-rp4yf32g.js} +5 -4
- package/{index-80yc5q5y.js → index-skmtj8rm.js} +13 -6
- package/{index-w0nztbs0.js → index-swwjakt0.js} +3 -3
- package/{index-v50xjbbe.js → index-t4d0ckde.js} +1 -1
- package/{index-p9f6dsf2.js → index-vm0dn0mt.js} +3 -4
- package/{index-qtcm6s8p.js → index-w8yasvpc.js} +3 -3
- package/{index-wnxc9n5v.js → index-x40bdsca.js} +4 -4
- package/{index-36dywqhv.js → index-xvk2a75m.js} +2 -2
- package/{index-1xfdzwrt.js → index-xyn02k0w.js} +4 -4
- package/{index-fq72hk0a.js → index-yckz5t8b.js} +2 -2
- package/index.js +24 -23
- package/{library.command-4c2yjfqa.js → library.command-bmd7zc5m.js} +4 -3
- package/{localRegistry.command-mgb4fg60.js → localRegistry.command-y6en1599.js} +16 -15
- package/{module.command-c6284z1b.js → module.command-7exfffqw.js} +6 -5
- package/{package.command-3wh1hh2j.js → package.command-adskw2rj.js} +5 -4
- package/package.json +2 -2
- package/{page.command-sx22j4yv.js → page.command-dw01272p.js} +4 -3
- package/{pipeline.command-8kdcgy47.js → pipeline.command-0b1r3y5r.js} +3 -2
- package/{primitive.command-4jaegn0m.js → primitive.command-byw6vc04.js} +7 -6
- package/{projectTypecheck-t0r9argb.js → projectTypecheck-kkrpq60a.js} +2 -1
- package/{quality.command-46jhrbm2.js → quality.command-6rqnhzct.js} +6 -5
- package/{repair.command-dj4ke29k.js → repair.command-rw5zymak.js} +6 -5
- package/{scalar.command-qwvbhytf.js → scalar.command-2dyp9nh9.js} +5 -4
- package/skills/akan-debug/SKILL.md +1 -1
- package/skills/akan-mcp/SKILL.md +2 -1
- package/skills/akan-scaffold/SKILL.md +1 -1
- package/skills/akan-validate/SKILL.md +1 -0
- package/{subspace.command-48d86hvc.js → subspace.command-111ynwv1.js} +9 -8
- package/{tunnel.command-00v81x42.js → tunnel.command-2gcpfbdj.js} +8 -7
- package/typecheck.proc.js +5 -2
- package/{verify.command-sz542tvy.js → verify.command-djgs86ma.js} +17 -15
- package/{workflow.command-0ra9304f.js → workflow.command-n0k2mxr5.js} +30 -16
- package/{workspace.command-5mm9ahzc.js → workspace.command-fh1qwxfx.js} +31 -30
- package/TunnelShare-11a3fqxb.js +0 -14
- package/cloud.script-w5b0a1sm.js +0 -30
- package/context.runner-9d5rbt2p.js +0 -29
|
@@ -3,13 +3,14 @@ import {
|
|
|
3
3
|
HmrWatcher,
|
|
4
4
|
WatchRootResolver,
|
|
5
5
|
ApplicationBuildReporter
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-vm0dn0mt.js";
|
|
7
7
|
import {
|
|
8
8
|
CodegenLock,
|
|
9
9
|
WorkspaceExecutor,
|
|
10
10
|
AppExecutor
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-3ghdb7p5.js";
|
|
12
12
|
import"./index-bns3wcpc.js";
|
|
13
|
+
import"./index-j4yvgfhr.js";
|
|
13
14
|
import {
|
|
14
15
|
GraphClientEntryDiscovery,
|
|
15
16
|
RouteClientBuilder,
|
|
@@ -19,10 +20,10 @@ import {
|
|
|
19
20
|
DevChangePlanner,
|
|
20
21
|
DevGeneratedIndexSync,
|
|
21
22
|
SsrDevBundler
|
|
22
|
-
} from "./index-
|
|
23
|
+
} from "./index-w8yasvpc.js";
|
|
23
24
|
import {
|
|
24
25
|
ServerGraphFile
|
|
25
|
-
} from "./index-
|
|
26
|
+
} from "./index-nmvhjn8c.js";
|
|
26
27
|
import"./index-9p260r4e.js";
|
|
27
28
|
import {
|
|
28
29
|
FrameworkGraph
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
akanMcpInstallTargets
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-yckz5t8b.js";
|
|
5
5
|
import {
|
|
6
6
|
jsonText
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-2vgv7fs7.js";
|
|
8
8
|
import {
|
|
9
9
|
script
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-exn38bzx.js";
|
|
11
11
|
import {
|
|
12
12
|
ContextRunner2
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-j3v29pq7.js";
|
|
14
14
|
|
|
15
15
|
// pkgs/@akanjs/cli/context/context.script.ts
|
|
16
16
|
import { Logger } from "akanjs/common";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
script
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-exn38bzx.js";
|
|
5
5
|
import {
|
|
6
6
|
AppExecutor,
|
|
7
7
|
LibExecutor,
|
|
8
8
|
ModuleExecutor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-3ghdb7p5.js";
|
|
10
10
|
import {
|
|
11
11
|
InteractionScaffold,
|
|
12
12
|
workflowStatus,
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
normalizeFieldType,
|
|
23
23
|
ensureNamedImport,
|
|
24
24
|
ensureBaseImport,
|
|
25
|
-
ensureBaseTypeImport,
|
|
26
25
|
coerceFieldDefault,
|
|
27
26
|
fieldExpression,
|
|
28
27
|
viaBuilderParameterName,
|
|
@@ -43,12 +42,13 @@ import {
|
|
|
43
42
|
hasSignalFactoryEntry,
|
|
44
43
|
insertSignalFactoryEntry,
|
|
45
44
|
addFieldUiPolicyForType,
|
|
45
|
+
withFieldTypeImport,
|
|
46
46
|
KeyRename,
|
|
47
47
|
MutationScaffold
|
|
48
|
-
} from "./index-
|
|
48
|
+
} from "./index-2vgv7fs7.js";
|
|
49
49
|
import {
|
|
50
50
|
ModuleScript
|
|
51
|
-
} from "./index-
|
|
51
|
+
} from "./index-hqv34wzq.js";
|
|
52
52
|
import {
|
|
53
53
|
plainNameProblem
|
|
54
54
|
} from "./index-va90m8nd.js";
|
|
@@ -158,7 +158,7 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
|
|
|
158
158
|
const defaultCoercion = coerceFieldDefault(input.type, input.defaultValue);
|
|
159
159
|
if (defaultCoercion.diagnostic)
|
|
160
160
|
diagnostics.push(defaultCoercion.diagnostic);
|
|
161
|
-
constantContent =
|
|
161
|
+
constantContent = await withFieldTypeImport(sys, input.module, input.type, constantContent, diagnostics);
|
|
162
162
|
if (input.type === "Date" && defaultCoercion.expression)
|
|
163
163
|
constantContent = ensureBaseImport(constantContent, "dayjs");
|
|
164
164
|
}
|
|
@@ -452,13 +452,14 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
|
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
454
|
static #report(command, sys, changedFiles, diagnostics) {
|
|
455
|
+
const failed = workflowStatus(diagnostics) === "failed";
|
|
455
456
|
return createPrimitiveWriteReport({
|
|
456
457
|
command,
|
|
457
458
|
changedFiles,
|
|
458
|
-
generatedFiles: generatedFilesForSync(sys),
|
|
459
|
-
validationCommands: validationCommandsForTarget(sys.name),
|
|
459
|
+
generatedFiles: failed ? [] : generatedFilesForSync(sys),
|
|
460
|
+
validationCommands: failed ? [] : validationCommandsForTarget(sys.name),
|
|
460
461
|
diagnostics,
|
|
461
|
-
nextActions: nextActionsForTarget(sys.name)
|
|
462
|
+
nextActions: failed ? [] : nextActionsForTarget(sys.name)
|
|
462
463
|
});
|
|
463
464
|
}
|
|
464
465
|
static #targetMissing() {
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ApplicationBuildReporter
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-vm0dn0mt.js";
|
|
5
5
|
import {
|
|
6
6
|
script,
|
|
7
|
-
ExitCodeError,
|
|
8
7
|
markCliErrorPrinted,
|
|
9
8
|
assertPromptable
|
|
10
|
-
} from "./index-
|
|
9
|
+
} from "./index-exn38bzx.js";
|
|
10
|
+
import {
|
|
11
|
+
CliError
|
|
12
|
+
} from "./index-j4yvgfhr.js";
|
|
11
13
|
import {
|
|
12
14
|
SysExecutor,
|
|
13
15
|
AppExecutor,
|
|
14
16
|
LibExecutor,
|
|
15
17
|
PkgExecutor
|
|
16
|
-
} from "./index-
|
|
18
|
+
} from "./index-3ghdb7p5.js";
|
|
17
19
|
import {
|
|
18
20
|
DesktopServerStage
|
|
19
|
-
} from "./index-
|
|
21
|
+
} from "./index-an76bdrv.js";
|
|
20
22
|
import {
|
|
21
23
|
LibraryScript
|
|
22
|
-
} from "./index-
|
|
24
|
+
} from "./index-j6gc8n14.js";
|
|
23
25
|
import {
|
|
24
26
|
ApplicationRunner,
|
|
25
27
|
VerifyScope
|
|
26
|
-
} from "./index-
|
|
28
|
+
} from "./index-j9790rhk.js";
|
|
27
29
|
import {
|
|
28
30
|
PreviewChrome2,
|
|
29
31
|
PreviewView2,
|
|
@@ -31,7 +33,7 @@ import {
|
|
|
31
33
|
} from "./index-b4qq3rq0.js";
|
|
32
34
|
import {
|
|
33
35
|
formatSlicePlan
|
|
34
|
-
} from "./index-
|
|
36
|
+
} from "./index-gcx48get.js";
|
|
35
37
|
import {
|
|
36
38
|
assertPlainName
|
|
37
39
|
} from "./index-va90m8nd.js";
|
|
@@ -1260,6 +1262,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
1260
1262
|
#interrupt = new InterruptTeardown;
|
|
1261
1263
|
async confirmDatabaseModeDependencyInstall(databaseMode, installSpecs) {
|
|
1262
1264
|
assertPromptable(`Database mode '${databaseMode}' requires missing dependencies: ${installSpecs.join(", ")}`, {
|
|
1265
|
+
code: "failed",
|
|
1263
1266
|
remedy: `install them first with \`bun add ${installSpecs.join(" ")}\``
|
|
1264
1267
|
});
|
|
1265
1268
|
return await confirm({
|
|
@@ -1338,7 +1341,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
1338
1341
|
Logger3.rawLog(format === "json" ? JSON.stringify(report, null, 2) : AppPreview.render(report));
|
|
1339
1342
|
if (!report.pages.some((page) => page.failed))
|
|
1340
1343
|
return;
|
|
1341
|
-
const failure = new
|
|
1344
|
+
const failure = new CliError("checkFailed", "preview found broken pages");
|
|
1342
1345
|
markCliErrorPrinted(failure);
|
|
1343
1346
|
throw failure;
|
|
1344
1347
|
}
|
|
@@ -1680,7 +1683,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
1680
1683
|
await Promise.all(shares.map(async (share) => await share.close()));
|
|
1681
1684
|
}, "Abandoning the tunnel release; the shares expire on their own.");
|
|
1682
1685
|
await Promise.all(apps.map(async (app) => {
|
|
1683
|
-
const { TunnelShare } = await import("./TunnelShare-
|
|
1686
|
+
const { TunnelShare } = await import("./TunnelShare-c4xsfzg5.js");
|
|
1684
1687
|
const share = await TunnelShare.open(app, { workspace: app.workspace });
|
|
1685
1688
|
shares.push(share);
|
|
1686
1689
|
urls.set(app.name, share.url);
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-exn38bzx.js";
|
|
6
6
|
import {
|
|
7
7
|
generatedFilesForSync,
|
|
8
8
|
createPassedPrimitiveReport,
|
|
9
9
|
scalarChangedFiles
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-2vgv7fs7.js";
|
|
11
11
|
import {
|
|
12
12
|
pluralizeName
|
|
13
13
|
} from "./index-nz8prx9g.js";
|
|
@@ -157,7 +157,7 @@ class SubagentPool2 {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
async#run(id, kind, prompt, signal) {
|
|
160
|
-
const { CodeAgent } = await import("./CodeAgent-
|
|
160
|
+
const { CodeAgent } = await import("./CodeAgent-x2p3a3e0.js");
|
|
161
161
|
const budget = this.#options.parent.tools.subagent;
|
|
162
162
|
const child = SubagentPool2.childOf(this.#options.parent, kind);
|
|
163
163
|
const model = this.#options.model?.();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
AppExecutor,
|
|
4
4
|
LibExecutor
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-3ghdb7p5.js";
|
|
6
6
|
import {
|
|
7
7
|
createAst,
|
|
8
8
|
AkanIndex
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./index-va90m8nd.js";
|
|
14
14
|
import {
|
|
15
15
|
camelToKebabCase
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-exn38bzx.js";
|
|
17
17
|
|
|
18
18
|
// pkgs/@akanjs/devkit/workflow/artifacts.ts
|
|
19
19
|
import { capitalize as capitalize2 } from "akanjs/common";
|
|
@@ -184,11 +184,9 @@ var createWorkflowApplyReport = ({
|
|
|
184
184
|
nextActions = [],
|
|
185
185
|
plan
|
|
186
186
|
}) => {
|
|
187
|
-
const
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
action: inferNextActionCode(action, diagnostics)
|
|
191
|
-
}));
|
|
187
|
+
const status = workflowStatus(diagnostics);
|
|
188
|
+
const validationCommands = status === "failed" ? [] : recommendedValidationCommands ?? commands;
|
|
189
|
+
const nextActionsWithIntent = nextActions.map((action) => ({ ...action, action: inferNextActionCode(action, diagnostics) })).filter((action) => status !== "failed" || action.action !== "validate");
|
|
192
190
|
if (sourceChangeBlocked(diagnostics) && !nextActionsWithIntent.some((action) => action.action === "blocked")) {
|
|
193
191
|
nextActionsWithIntent.unshift({
|
|
194
192
|
command: `akan workflow explain ${workflow}`,
|
|
@@ -198,12 +196,12 @@ var createWorkflowApplyReport = ({
|
|
|
198
196
|
}
|
|
199
197
|
const orderedNextActions = uniqueBy(nextActionsWithIntent, (action) => action.command).sort((left, right) => nextActionPriority(left, diagnostics) - nextActionPriority(right, diagnostics));
|
|
200
198
|
const sourceFilesChanged = uniqueBy(changedFiles, (file) => `${file.action}:${file.path}:${file.reason}`);
|
|
201
|
-
const generatedFilesSynced = uniqueBy(generatedFiles, (file) => `${file.action}:${file.path}:${file.reason}`);
|
|
199
|
+
const generatedFilesSynced = status === "failed" ? [] : uniqueBy(generatedFiles, (file) => `${file.action}:${file.path}:${file.reason}`);
|
|
202
200
|
return {
|
|
203
201
|
schemaVersion: 1,
|
|
204
202
|
workflow,
|
|
205
203
|
mode,
|
|
206
|
-
status
|
|
204
|
+
status,
|
|
207
205
|
summary: {
|
|
208
206
|
sourceFilesChanged,
|
|
209
207
|
generatedFilesSynced
|
|
@@ -721,11 +719,6 @@ ${line}
|
|
|
721
719
|
`);
|
|
722
720
|
};
|
|
723
721
|
var ensureBaseImport = (content, name) => ensureNamedImport(content, "akanjs/base", name);
|
|
724
|
-
var ensureBaseTypeImport = (content, typeName) => {
|
|
725
|
-
if (typeName !== "Int" && typeName !== "Float")
|
|
726
|
-
return content;
|
|
727
|
-
return ensureBaseImport(content, typeName);
|
|
728
|
-
};
|
|
729
722
|
var numericDefault = (typeName, rawDefault) => {
|
|
730
723
|
if (typeof rawDefault === "number") {
|
|
731
724
|
if (!Number.isFinite(rawDefault))
|
|
@@ -2315,6 +2308,87 @@ class WorkflowExecutor {
|
|
|
2315
2308
|
return report();
|
|
2316
2309
|
}
|
|
2317
2310
|
}
|
|
2311
|
+
// pkgs/@akanjs/devkit/workflow/fieldType.ts
|
|
2312
|
+
import ts5 from "typescript";
|
|
2313
|
+
var builtInFieldTypes = new Set(["String", "Boolean", "Date", "Map"]);
|
|
2314
|
+
var baseFieldTypes = new Set(["Int", "Float", "ID", "Any", "Binary", "ImageResult"]);
|
|
2315
|
+
var fieldTypeReference = /^\[*([A-Za-z_$][\w$]*)((?:\.[A-Za-z_$][\w$]*)*)\]*$/;
|
|
2316
|
+
var ensureBaseTypeImport = (content, typeName) => {
|
|
2317
|
+
const [, name = "", member] = fieldTypeReference.exec(typeName) ?? [];
|
|
2318
|
+
if (member || !baseFieldTypes.has(name))
|
|
2319
|
+
return content;
|
|
2320
|
+
return ensureBaseImport(content, name);
|
|
2321
|
+
};
|
|
2322
|
+
var valueNamesOf = (content) => {
|
|
2323
|
+
const names = new Set;
|
|
2324
|
+
for (const statement of sourceFileFor("source.ts", content).statements) {
|
|
2325
|
+
if (ts5.isImportDeclaration(statement)) {
|
|
2326
|
+
const clause = statement.importClause;
|
|
2327
|
+
if (!clause || clause.isTypeOnly)
|
|
2328
|
+
continue;
|
|
2329
|
+
if (clause.name)
|
|
2330
|
+
names.add(clause.name.text);
|
|
2331
|
+
const bindings = clause.namedBindings;
|
|
2332
|
+
if (bindings && ts5.isNamespaceImport(bindings))
|
|
2333
|
+
names.add(bindings.name.text);
|
|
2334
|
+
else
|
|
2335
|
+
for (const element of bindings?.elements ?? [])
|
|
2336
|
+
if (!element.isTypeOnly)
|
|
2337
|
+
names.add(element.name.text);
|
|
2338
|
+
} else if (ts5.isVariableStatement(statement)) {
|
|
2339
|
+
for (const declaration of statement.declarationList.declarations)
|
|
2340
|
+
if (ts5.isIdentifier(declaration.name))
|
|
2341
|
+
names.add(declaration.name.text);
|
|
2342
|
+
} else if ((ts5.isClassDeclaration(statement) || ts5.isEnumDeclaration(statement) || ts5.isFunctionDeclaration(statement)) && statement.name)
|
|
2343
|
+
names.add(statement.name.text);
|
|
2344
|
+
}
|
|
2345
|
+
return names;
|
|
2346
|
+
};
|
|
2347
|
+
var fieldTypeSource = async (sys, module, typeName, constantContent) => {
|
|
2348
|
+
const reference = fieldTypeReference.exec(typeName);
|
|
2349
|
+
if (!reference)
|
|
2350
|
+
return {
|
|
2351
|
+
diagnostic: {
|
|
2352
|
+
severity: "error",
|
|
2353
|
+
code: "primitive-field-type-unknown",
|
|
2354
|
+
input: "type",
|
|
2355
|
+
message: `Field type "${typeName}" is not a type name field() takes. Name one type, such as Address, or a list of one, such as [Address], then plan this again.`
|
|
2356
|
+
}
|
|
2357
|
+
};
|
|
2358
|
+
const [, name = "", member] = reference;
|
|
2359
|
+
if (builtInFieldTypes.has(name) || baseFieldTypes.has(name) || valueNamesOf(constantContent).has(name))
|
|
2360
|
+
return {};
|
|
2361
|
+
const [scalars, models] = await Promise.all([sys.getScalarModules(), sys.getDatabaseModules()]);
|
|
2362
|
+
const scalar = member ? undefined : scalars.find((scalarName) => moduleComponentName(scalarName) === name);
|
|
2363
|
+
if (scalar)
|
|
2364
|
+
return { import: { name, from: `../__scalar/${scalar}/${scalar}.constant` } };
|
|
2365
|
+
const model = member ? undefined : models.find((modelName) => moduleComponentName(modelName) === name);
|
|
2366
|
+
if (model)
|
|
2367
|
+
return { import: { name, from: `../${model}/${model}.constant` } };
|
|
2368
|
+
const root = getSysRoot(sys);
|
|
2369
|
+
const constantPath = `${root}/${moduleSourcePaths(module).constant}`;
|
|
2370
|
+
const named = (kind, names) => names.length ? `Its ${kind} are ${names.map(moduleComponentName).join(", ")}.` : `It has no ${kind}.`;
|
|
2371
|
+
return {
|
|
2372
|
+
diagnostic: {
|
|
2373
|
+
severity: "error",
|
|
2374
|
+
code: "primitive-field-type-unknown",
|
|
2375
|
+
input: "type",
|
|
2376
|
+
message: [
|
|
2377
|
+
`Field type "${typeName}" names ${name}, which is not a built-in or akanjs/base type, not imported by ${constantPath}, and not a scalar or model in ${root}.`,
|
|
2378
|
+
named("scalars", scalars),
|
|
2379
|
+
named("models", models),
|
|
2380
|
+
`Create the scalar with the create-scalar workflow first, or import ${name} into ${constantPath}, then plan this again.`
|
|
2381
|
+
].join(" ")
|
|
2382
|
+
}
|
|
2383
|
+
};
|
|
2384
|
+
};
|
|
2385
|
+
var withFieldTypeImport = async (sys, module, typeName, content, diagnostics) => {
|
|
2386
|
+
const withBaseImport = ensureBaseTypeImport(content, typeName);
|
|
2387
|
+
const source = await fieldTypeSource(sys, module, typeName, withBaseImport);
|
|
2388
|
+
if (source.diagnostic)
|
|
2389
|
+
diagnostics.push(source.diagnostic);
|
|
2390
|
+
return source.import ? ensureNamedImport(withBaseImport, source.import.from, source.import.name) : withBaseImport;
|
|
2391
|
+
};
|
|
2318
2392
|
// pkgs/@akanjs/devkit/workflow/guardCatalog.ts
|
|
2319
2393
|
class GuardCatalog {
|
|
2320
2394
|
static frameworkGuards = ["Public"];
|
|
@@ -2395,7 +2469,7 @@ class GuardCatalog {
|
|
|
2395
2469
|
// pkgs/@akanjs/devkit/workflow/keyRename.ts
|
|
2396
2470
|
import { readFile } from "fs/promises";
|
|
2397
2471
|
import path2 from "path";
|
|
2398
|
-
import
|
|
2472
|
+
import ts6 from "typescript";
|
|
2399
2473
|
var indexedPath = /^(apps|libs)\/(?!(?:.*\/)?(?:node_modules|dist|\.akan)\/).*\.tsx?$/;
|
|
2400
2474
|
var keyPattern = /^[a-z][A-Za-z0-9]*$/;
|
|
2401
2475
|
var slashed = (fileName) => fileName.replace(/\\/g, "/");
|
|
@@ -2424,7 +2498,7 @@ class KeyRename {
|
|
|
2424
2498
|
const sourceRelative = `${getSysRoot(sys)}/${family === "slice" ? paths.signal : paths.document}`;
|
|
2425
2499
|
const sourcePath = slashed(path2.join(root, sourceRelative));
|
|
2426
2500
|
const texts = new Map;
|
|
2427
|
-
const index = new AkanIndex({ ts:
|
|
2501
|
+
const index = new AkanIndex({ ts: ts6, root });
|
|
2428
2502
|
for (const relative of await workspace.getAllFiles("{apps,libs}/**/*.{ts,tsx}")) {
|
|
2429
2503
|
if (!indexedPath.test(slashed(relative)))
|
|
2430
2504
|
continue;
|
|
@@ -3450,6 +3524,12 @@ var moduleNotDatabase = async (sys, spec, module) => {
|
|
|
3450
3524
|
].join(" ")
|
|
3451
3525
|
};
|
|
3452
3526
|
};
|
|
3527
|
+
var fieldTypeUnknown = async (sys, spec, module, type) => {
|
|
3528
|
+
if (spec.name !== "add-field" || !type || ["enum", "number", "numeric", "upload"].includes(type.toLowerCase()))
|
|
3529
|
+
return null;
|
|
3530
|
+
const constant = await sys.readFile(moduleSourcePaths(module).constant);
|
|
3531
|
+
return (await fieldTypeSource(sys, module, normalizeFieldType(type), constant)).diagnostic ?? null;
|
|
3532
|
+
};
|
|
3453
3533
|
var workflowTargetDiagnostics = async (workspace, spec, inputs) => {
|
|
3454
3534
|
const app = planString(inputs, "app");
|
|
3455
3535
|
if (!app)
|
|
@@ -3470,7 +3550,7 @@ var workflowTargetDiagnostics = async (workspace, spec, inputs) => {
|
|
|
3470
3550
|
const moduleSpec = spec.inputs.module;
|
|
3471
3551
|
if (!module || !moduleSpec?.mustExist)
|
|
3472
3552
|
return [];
|
|
3473
|
-
const refused = await moduleMissing(workspace, sys, module) ?? await moduleNotDatabase(sys, spec, module);
|
|
3553
|
+
const refused = await moduleMissing(workspace, sys, module) ?? await moduleNotDatabase(sys, spec, module) ?? await fieldTypeUnknown(sys, spec, module, planString(inputs, "type"));
|
|
3474
3554
|
return refused ? [refused] : [];
|
|
3475
3555
|
};
|
|
3476
3556
|
var inspectPlanTarget = async (workspace, spec, plan) => {
|
|
@@ -3839,4 +3919,4 @@ for (const candidate of toolingRolloutCandidates) {
|
|
|
3839
3919
|
if (isRestrictedCandidate(candidate))
|
|
3840
3920
|
restrictedCandidates.set(candidate.packageName, candidate);
|
|
3841
3921
|
}
|
|
3842
|
-
export { InteractionScaffold, jsonText, workflowStatus, compactDiagnostics, workflowPlanApproval, createWorkflowApplyReport, workflowCommandsForPlan, workflowPathsForPlan, workflowRunArtifactPath, writeWorkflowRunArtifact, workflowSyncDir, generatedFilePathsForTarget, writeGeneratedSyncState, readWorkflowRunArtifact, createWorkflowBaselineSummary, createWorkflowValidationRunReport, createDryRunWorkflowApplyReport, createRepairReport, sourceFile, moduleComponentName, moduleSourcePaths, generatedFilesForSync, validationCommandsForTarget, nextActionsForTarget, createPrimitiveWriteReport, createPassedPrimitiveReport, scalarChangedFiles, bilingualLabelForField, bilingualDescriptionForField, normalizeFieldType, ensureNamedImport, ensureBaseImport,
|
|
3922
|
+
export { InteractionScaffold, jsonText, workflowStatus, compactDiagnostics, workflowPlanApproval, createWorkflowApplyReport, workflowCommandsForPlan, workflowPathsForPlan, workflowRunArtifactPath, writeWorkflowRunArtifact, workflowSyncDir, generatedFilePathsForTarget, writeGeneratedSyncState, readWorkflowRunArtifact, createWorkflowBaselineSummary, createWorkflowValidationRunReport, createDryRunWorkflowApplyReport, createRepairReport, sourceFile, moduleComponentName, moduleSourcePaths, generatedFilesForSync, validationCommandsForTarget, nextActionsForTarget, createPrimitiveWriteReport, createPassedPrimitiveReport, scalarChangedFiles, bilingualLabelForField, bilingualDescriptionForField, normalizeFieldType, ensureNamedImport, ensureBaseImport, coerceFieldDefault, fieldExpression, viaBuilderParameterName, insertIntoObject, insertLightProjectionField, insertTemplateField, ensureEnumImport, insertEnumClass, insertDictionaryModelField, hasConstantInputField, hasDictionaryModelField, ensureConstantTypeImport, insertDictionaryEnum, parseValues, hasSourceParseErrors, hasClassMethod, insertClassMethod, hasSignalFactoryEntry, insertSignalFactoryEntry, buildAkanModuleContextIndex, addFieldUiPolicyForType, createWorkflowStepRegistry, WorkflowExecutor, withFieldTypeImport, KeyRename, MutationScaffold, listWorkflowSpecs, getWorkflowSpec, compactWorkflowInputs, createWorkflowPlan, workflowTargetDiagnostics, inspectWorkflowPlan, renderWorkflowList, renderWorkflowExplain, renderWorkflowPlan, renderWorkflowApply, renderWorkflowValidation, renderRepairReport, renderWorkflowRunArtifact, renderPrimitiveReport, toolingRolloutGate };
|
|
@@ -3,6 +3,10 @@ import {
|
|
|
3
3
|
getDirname2,
|
|
4
4
|
FileSys2
|
|
5
5
|
} from "./index-bns3wcpc.js";
|
|
6
|
+
import {
|
|
7
|
+
CliError,
|
|
8
|
+
TypecheckFailure
|
|
9
|
+
} from "./index-j4yvgfhr.js";
|
|
6
10
|
|
|
7
11
|
// pkgs/@akanjs/devkit/executors.ts
|
|
8
12
|
import {
|
|
@@ -2980,19 +2984,6 @@ class Spinner {
|
|
|
2980
2984
|
// pkgs/@akanjs/devkit/typecheck/projectTypecheck.ts
|
|
2981
2985
|
import { mkdir as mkdir2, rm as rm3 } from "fs/promises";
|
|
2982
2986
|
import path13 from "path";
|
|
2983
|
-
|
|
2984
|
-
// pkgs/@akanjs/devkit/typecheck/typecheckFailure.ts
|
|
2985
|
-
class TypecheckFailure extends Error {
|
|
2986
|
-
records;
|
|
2987
|
-
constructor(records) {
|
|
2988
|
-
super(records.slice(0, 20).map((record) => `${record.file ?? "-"}:${record.line}:${record.col} ${record.code} ${record.message}`).join(`
|
|
2989
|
-
`) || "Typecheck failed");
|
|
2990
|
-
this.records = records;
|
|
2991
|
-
this.name = "TypecheckFailure";
|
|
2992
|
-
}
|
|
2993
|
-
}
|
|
2994
|
-
|
|
2995
|
-
// pkgs/@akanjs/devkit/typecheck/projectTypecheck.ts
|
|
2996
2987
|
class ProjectTypecheck2 {
|
|
2997
2988
|
projectDir;
|
|
2998
2989
|
workspaceRoot;
|
|
@@ -3047,7 +3038,10 @@ class ProjectTypecheck2 {
|
|
|
3047
3038
|
const records = report === "records" ? ProjectTypecheck2.#parseRecords(stdout) : null;
|
|
3048
3039
|
if (records?.length)
|
|
3049
3040
|
throw new TypecheckFailure(records);
|
|
3050
|
-
|
|
3041
|
+
const output = (stderr || stdout).trim();
|
|
3042
|
+
if (exitCode === TypecheckFailure.workerExitCode && report === "pretty")
|
|
3043
|
+
throw new CliError("checkFailed", output || "Typecheck failed");
|
|
3044
|
+
throw new Error(output || `Typecheck failed with exit code ${exitCode}`);
|
|
3051
3045
|
}
|
|
3052
3046
|
static #parseRecords(stdout) {
|
|
3053
3047
|
try {
|
|
@@ -4513,4 +4507,4 @@ class ModuleExecutor extends Executor {
|
|
|
4513
4507
|
}
|
|
4514
4508
|
}
|
|
4515
4509
|
|
|
4516
|
-
export { AGENT_BLOCK_START, AGENT_BLOCK_END, stampBlockVersion, extractBlockVersion, readDevkitVersion, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock, CLAUDE_COMMENT_RULE, binPlatforms, ServerEnvProfile, AkanAppConfig, AkanWorkspaceConfig, AsyncDefaultExportDetector, StoreBootstrap, ROOT_LAYOUT_SYSTEM, isImplicitRootLayoutKey, resolveSsrPageEntriesForApp, CodegenLock, JsonFormatter, parseBiomeReport, Linter, LibSource, formatLibStatuses, rootAllowedFiles, rootAllowedDirs, isAllowedLibFacetRootFile, libFacetRootHintOf, barrelFacetDirs, facetIndexShadowOf, rootEntryHintOf, isScannedRootEntry, AppInfo, Spinner,
|
|
4510
|
+
export { AGENT_BLOCK_START, AGENT_BLOCK_END, stampBlockVersion, extractBlockVersion, readDevkitVersion, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock, CLAUDE_COMMENT_RULE, binPlatforms, ServerEnvProfile, AkanAppConfig, AkanWorkspaceConfig, AsyncDefaultExportDetector, StoreBootstrap, ROOT_LAYOUT_SYSTEM, isImplicitRootLayoutKey, resolveSsrPageEntriesForApp, CodegenLock, JsonFormatter, parseBiomeReport, Linter, LibSource, formatLibStatuses, rootAllowedFiles, rootAllowedDirs, isAllowedLibFacetRootFile, libFacetRootHintOf, barrelFacetDirs, facetIndexShadowOf, rootEntryHintOf, isScannedRootEntry, AppInfo, Spinner, ProjectTypecheck2, CommandExecutionError, parseEnvFile, Executor, WorkspaceExecutor, SysExecutor, AppExecutor, LibExecutor, PkgExecutor, ModuleExecutor };
|
|
@@ -5,17 +5,17 @@ import {
|
|
|
5
5
|
AkanAppConfig,
|
|
6
6
|
Executor,
|
|
7
7
|
WorkspaceExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-3ghdb7p5.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveAppId,
|
|
11
11
|
targetHtmlFilename
|
|
12
12
|
} from "./index-m9jj544v.js";
|
|
13
13
|
import {
|
|
14
14
|
CsrArtifactBuilder
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-xvk2a75m.js";
|
|
16
16
|
import {
|
|
17
17
|
ExitCodeError
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-exn38bzx.js";
|
|
19
19
|
|
|
20
20
|
// pkgs/@akanjs/devkit/mobile/desktopBin.ts
|
|
21
21
|
import { chmod, mkdir, rename, rm, writeFile } from "fs/promises";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
WorkspaceExecutor
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-3ghdb7p5.js";
|
|
5
5
|
import {
|
|
6
6
|
AkanContextAnalyzer
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-yckz5t8b.js";
|
|
8
8
|
import {
|
|
9
9
|
jsonText,
|
|
10
10
|
workflowPlanApproval,
|
|
@@ -30,27 +30,27 @@ import {
|
|
|
30
30
|
renderWorkflowApply,
|
|
31
31
|
renderWorkflowValidation,
|
|
32
32
|
renderWorkflowRunArtifact
|
|
33
|
-
} from "./index-
|
|
33
|
+
} from "./index-2vgv7fs7.js";
|
|
34
34
|
import {
|
|
35
35
|
CommandContainer,
|
|
36
36
|
runner
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-exn38bzx.js";
|
|
38
38
|
import {
|
|
39
39
|
ModuleScript
|
|
40
|
-
} from "./index-
|
|
40
|
+
} from "./index-hqv34wzq.js";
|
|
41
41
|
import {
|
|
42
42
|
PrimitiveScript
|
|
43
|
-
} from "./index-
|
|
43
|
+
} from "./index-0hbtve0a.js";
|
|
44
44
|
import {
|
|
45
45
|
spawnAkan,
|
|
46
46
|
isWorkspaceTarget
|
|
47
|
-
} from "./index-
|
|
47
|
+
} from "./index-99qvtff2.js";
|
|
48
48
|
import {
|
|
49
49
|
ScalarScript
|
|
50
|
-
} from "./index-
|
|
50
|
+
} from "./index-2mf1aen9.js";
|
|
51
51
|
import {
|
|
52
52
|
workflowSpecs
|
|
53
|
-
} from "./index-
|
|
53
|
+
} from "./index-t4d0ckde.js";
|
|
54
54
|
|
|
55
55
|
// pkgs/@akanjs/cli/workflow/workflow.runner.ts
|
|
56
56
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-yckz5t8b.js";
|
|
5
5
|
import {
|
|
6
6
|
writeWorkflowRunArtifact,
|
|
7
7
|
generatedFilePathsForTarget,
|
|
8
8
|
writeGeneratedSyncState,
|
|
9
9
|
createRepairReport,
|
|
10
10
|
renderRepairReport
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-2vgv7fs7.js";
|
|
12
12
|
import {
|
|
13
13
|
runner
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-exn38bzx.js";
|
|
15
15
|
import {
|
|
16
16
|
isWorkflowSysName,
|
|
17
17
|
isWorkflowModuleName
|