@akanjs/cli 3.2.0-rc.3 → 3.2.0-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 +2 -1
- package/{CodeAgent-e9c712an.js → CodeAgent-4a2skdph.js} +3 -3
- package/{CodeTui-wv9yf7eq.js → CodeTui-enrzsnzc.js} +1 -1
- package/{TunnelShare-zkfkrw8w.js → TunnelShare-xs5rrpf1.js} +5 -5
- package/{agent.command-9erafkcb.js → agent.command-y22t9x1e.js} +11 -11
- package/akanCode.js +3 -3
- package/{application.command-6515t682.js → application.command-yhj5arwc.js} +10 -10
- package/{applicationBuildRunner-bqbyeg84.js → applicationBuildRunner-6w1fd61b.js} +5 -5
- package/buildBatch.proc.js +4 -4
- package/{cloud.command-32esk0v1.js → cloud.command-bqfh4cnx.js} +13 -13
- package/{cloud.script-arsagnq6.js → cloud.script-8jvfw1sh.js} +13 -13
- package/{code.command-xk7rwq2x.js → code.command-y94hwxsn.js} +5 -5
- package/{context.command-jwenkkf0.js → context.command-xz65fhrn.js} +15 -15
- package/context.runner-dpt5wjb7.js +29 -0
- package/{devTui-cd03z4mx.js → devTui-h77zrjv5.js} +1 -1
- package/{guideline.command-w6yqpdec.js → guideline.command-sn843nw6.js} +1 -1
- package/guidelines/conventions/rules/page.md +4 -0
- package/guidelines/pageRule/pageRule.instruction.md +5 -0
- package/guidelines/runtimeRule/runtimeRule.instruction.md +5 -1
- package/guidelines/transportRule/transportRule.instruction.md +5 -0
- package/incrementalBuilder.proc.js +2 -2
- package/{index-xrmrvafh.js → index-02b8qvww.js} +2 -2
- package/{index-j1hjb477.js → index-2rcptfyp.js} +1 -1
- package/{index-84c2pgak.js → index-3rff2c48.js} +1 -0
- package/{index-dpgywgeq.js → index-3wen6ddy.js} +1 -1
- package/{index-43acpsc7.js → index-49y45vbj.js} +9 -9
- package/{index-8gm4yag8.js → index-4mgabs8t.js} +4 -4
- package/{index-ytpmk3pb.js → index-50mg8bsm.js} +4 -4
- package/{index-20wvskt8.js → index-5hhe0rdd.js} +1 -1
- package/{index-kcpk2d20.js → index-5qq6qky3.js} +8 -8
- package/{index-vbhx60x5.js → index-5w8amdr7.js} +1 -1
- package/{index-bdmgqzb5.js → index-8vxdsqra.js} +35 -22
- package/{index-ddk49ypz.js → index-ah09graf.js} +53 -26
- package/{index-sc0g6zbm.js → index-b4qq3rq0.js} +23 -10
- package/{index-2eym1yjb.js → index-b9q5aw30.js} +10 -10
- package/{index-ngpt3zz3.js → index-fqx74yxn.js} +11 -8
- package/{index-djc5nxpy.js → index-g43360sn.js} +2 -2
- package/{index-bak9f2br.js → index-gsty3pkx.js} +5 -1
- package/{index-386canwe.js → index-hkq0q73d.js} +44 -25
- package/{index-s34v3y28.js → index-jgj6ajnk.js} +4 -4
- package/{index-zhkcab5a.js → index-jqsj5wjb.js} +1 -1
- package/{index-54s6knqe.js → index-jrdp7c4h.js} +2 -2
- package/{index-wr9magsr.js → index-jxaq2evq.js} +1 -1
- package/{index-h0p6n4k1.js → index-kgxhwgdk.js} +3 -3
- package/{index-6h775rv3.js → index-kjmrkc45.js} +4 -4
- package/{index-qrk06tfp.js → index-kr8dvqnr.js} +1 -1
- package/{index-j4hkbzj6.js → index-qrp98bmp.js} +4 -4
- package/{index-0ba8nj4d.js → index-sjj3ywn5.js} +16 -9
- package/index-va90m8nd.js +25 -0
- package/{index-e22zedc2.js → index-vftjqv28.js} +2 -2
- package/{index-2rqyrvcy.js → index-w15hnxmb.js} +5 -5
- package/{index-zcdmnfrf.js → index-w88xghey.js} +6 -6
- package/{index-7kmbqp0b.js → index-z9b72teg.js} +1 -1
- package/index.js +22 -22
- package/{library.command-qs8beggh.js → library.command-6eafevmj.js} +2 -2
- package/{localRegistry.command-hz4ged9n.js → localRegistry.command-9tef2qsj.js} +12 -12
- package/{module.command-z9js77m2.js → module.command-pn1k7dfk.js} +9 -5
- package/{package.command-zqenq8c0.js → package.command-kbg9z7re.js} +2 -2
- package/package.json +2 -2
- package/{page.command-t0nx1jat.js → page.command-st0y2xg8.js} +2 -2
- package/{pipeline.command-2yjeas7m.js → pipeline.command-76m32y7z.js} +1 -1
- package/{primitive.command-v5kypwy4.js → primitive.command-ax6wg70s.js} +5 -5
- package/{quality.command-q55j2htd.js → quality.command-0gzskga8.js} +2 -2
- package/{repair.command-7ssbbdq2.js → repair.command-g5kc3x89.js} +4 -4
- package/{scalar.command-p5jb7z57.js → scalar.command-ck8621dy.js} +3 -3
- package/skills/akan-debug/SKILL.md +6 -2
- package/skills/akan-transport/SKILL.md +2 -0
- package/{subspace.command-7wxy6ptj.js → subspace.command-vh6dye0v.js} +6 -6
- package/{tunnel.command-22g11n0x.js → tunnel.command-4mezrypt.js} +6 -6
- package/{verify.command-m0wnndd7.js → verify.command-f2n4bwp7.js} +8 -8
- package/{workflow.command-jx8dqs9n.js → workflow.command-bx9xwgs5.js} +9 -9
- package/{workspace.command-ca9kfyt3.js → workspace.command-04qgwsst.js} +27 -27
- package/context.runner-mqpp67br.js +0 -29
- package/index-x3x31df8.js +0 -14
|
@@ -58,6 +58,7 @@ var SysOrOnlyApp = createInternalArgToken("Sys", { onlyApp: true });
|
|
|
58
58
|
var Exec = createInternalArgToken("Exec");
|
|
59
59
|
var Pkg = createInternalArgToken("Pkg");
|
|
60
60
|
var Module = createInternalArgToken("Module");
|
|
61
|
+
var ModuleOrService = createInternalArgToken("Module", { services: true });
|
|
61
62
|
var Workspace = createInternalArgToken("Workspace");
|
|
62
63
|
// pkgs/@akanjs/devkit/commandDecorators/command.ts
|
|
63
64
|
import path3 from "path";
|
|
@@ -594,6 +595,14 @@ var getInternalArgumentValue = async (argMeta, value, workspace, rerun, { destru
|
|
|
594
595
|
throw refusalOf(problemOf(kind), "this command deletes files and never picks its target", refusal);
|
|
595
596
|
assertPromptable(problemOf(kind), refusal);
|
|
596
597
|
};
|
|
598
|
+
const takeOnly = (kind, names, take) => {
|
|
599
|
+
const [only] = names;
|
|
600
|
+
if (value || destructive || process.stdin.isTTY || names.length !== 1 || !only)
|
|
601
|
+
return null;
|
|
602
|
+
const how = rerun ? `: ${rerun(only)}` : "";
|
|
603
|
+
Logger.rawLog(`No ${kind} named, so this runs on '${only}', the only one in this workspace${how}`, undefined, "error");
|
|
604
|
+
return take(only);
|
|
605
|
+
};
|
|
597
606
|
if (sysType === "sys" || sysType === "exec") {
|
|
598
607
|
const pkgChoices = sysType === "exec" ? pkgNames : [];
|
|
599
608
|
const execOf = (name) => {
|
|
@@ -612,12 +621,9 @@ var getInternalArgumentValue = async (argMeta, value, workspace, rerun, { destru
|
|
|
612
621
|
return AppExecutor.from(workspace, appNames[0]);
|
|
613
622
|
const [kind, placeholder] = sysType === "exec" ? ["app, lib or pkg", "<app-lib-or-pkg>"] : ["app or lib", "<app-or-lib>"];
|
|
614
623
|
const choices = [...appNames, ...libNames, ...pkgChoices];
|
|
615
|
-
const only = choices
|
|
616
|
-
if (
|
|
617
|
-
const how = rerun ? `: ${rerun(only.name)}` : "";
|
|
618
|
-
Logger.rawLog(`No ${kind} named, so this runs on '${only.name}', the only one in this workspace${how}`, undefined, "error");
|
|
624
|
+
const only = takeOnly(kind, choices, execOf);
|
|
625
|
+
if (only)
|
|
619
626
|
return only;
|
|
620
|
-
}
|
|
621
627
|
assertAskable(kind, choices, placeholder);
|
|
622
628
|
const name = await select({
|
|
623
629
|
message: sysType === "exec" ? `Select the App or Lib or Pkg name` : `Select the App or Lib name`,
|
|
@@ -638,6 +644,9 @@ var getInternalArgumentValue = async (argMeta, value, workspace, rerun, { destru
|
|
|
638
644
|
} else if (sysType === "lib") {
|
|
639
645
|
if (value && libNames.includes(value))
|
|
640
646
|
return LibExecutor.from(workspace, value);
|
|
647
|
+
const only = takeOnly("lib", libNames, (name) => LibExecutor.from(workspace, name));
|
|
648
|
+
if (only)
|
|
649
|
+
return only;
|
|
641
650
|
assertAskable("lib", libNames, "<lib>");
|
|
642
651
|
const libName = await select({ message: `Select the ${sysType} name`, choices: libNames });
|
|
643
652
|
return LibExecutor.from(workspace, libName);
|
|
@@ -645,34 +654,44 @@ var getInternalArgumentValue = async (argMeta, value, workspace, rerun, { destru
|
|
|
645
654
|
const pkgs = await workspace.getPkgs();
|
|
646
655
|
if (value && pkgs.includes(value))
|
|
647
656
|
return PkgExecutor.from(workspace, value);
|
|
657
|
+
const only = takeOnly("pkg", pkgs, (name) => PkgExecutor.from(workspace, name));
|
|
658
|
+
if (only)
|
|
659
|
+
return only;
|
|
648
660
|
assertAskable("pkg", pkgs, "<pkg>");
|
|
649
661
|
const pkgName = await select({ message: `Select the ${sysType} name`, choices: pkgs });
|
|
650
662
|
return PkgExecutor.from(workspace, pkgName);
|
|
651
663
|
} else if (sysType === "module") {
|
|
664
|
+
const systems = [
|
|
665
|
+
...appNames.map((name) => AppExecutor.from(workspace, name)),
|
|
666
|
+
...libNames.map((name) => LibExecutor.from(workspace, name))
|
|
667
|
+
];
|
|
668
|
+
const modulesOf = async (sys) => [
|
|
669
|
+
...await sys.getModules(),
|
|
670
|
+
...argMeta.option?.services ? await sys.getServiceModules() : []
|
|
671
|
+
];
|
|
672
|
+
const listModules = async () => (await Promise.all(systems.map(async (sys) => (await modulesOf(sys)).map((m) => `${sys.name}:${m}`)))).flat();
|
|
652
673
|
if (value) {
|
|
653
674
|
const [sysName, moduleName] = value.split(":");
|
|
654
675
|
if (!sysName || !moduleName)
|
|
655
676
|
throw new Error(`Invalid module name: ${value}`);
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
const modules = await app.getModules();
|
|
659
|
-
if (modules.includes(moduleName))
|
|
660
|
-
return ModuleExecutor.from(app, moduleName);
|
|
661
|
-
else
|
|
662
|
-
throw new Error(`Invalid module name: ${moduleName}`);
|
|
663
|
-
} else if (libNames.includes(sysName)) {
|
|
664
|
-
const lib = LibExecutor.from(workspace, sysName);
|
|
665
|
-
const modules = await lib.getModules();
|
|
666
|
-
if (modules.includes(moduleName))
|
|
667
|
-
return ModuleExecutor.from(lib, moduleName);
|
|
668
|
-
} else
|
|
677
|
+
const sys = systems.find((each) => each.name === sysName);
|
|
678
|
+
if (!sys)
|
|
669
679
|
throw new Error(`Invalid system name: ${sysName}`);
|
|
680
|
+
if ((await modulesOf(sys)).includes(moduleName))
|
|
681
|
+
return ModuleExecutor.from(sys, moduleName);
|
|
682
|
+
throw refusalOf(problemOf("module"), `${sysName} has no such module`, {
|
|
683
|
+
choices: await listModules(),
|
|
684
|
+
...rerunRemedyOf(rerun, "<sys:module>")
|
|
685
|
+
});
|
|
670
686
|
}
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
687
|
+
const choices = process.stdin.isTTY && !destructive ? [] : await listModules();
|
|
688
|
+
const only = takeOnly("module", choices, (label) => {
|
|
689
|
+
const [sysName, moduleName = ""] = label.split(":");
|
|
690
|
+
const sys = systems.find((each) => each.name === sysName);
|
|
691
|
+
return sys ? ModuleExecutor.from(sys, moduleName) : null;
|
|
692
|
+
});
|
|
693
|
+
if (only)
|
|
694
|
+
return only;
|
|
676
695
|
assertAskable("module", choices, "<sys:module>");
|
|
677
696
|
const { type, name } = await select({
|
|
678
697
|
message: `select the App or Lib name`,
|
|
@@ -682,7 +701,7 @@ var getInternalArgumentValue = async (argMeta, value, workspace, rerun, { destru
|
|
|
682
701
|
]
|
|
683
702
|
});
|
|
684
703
|
const executor = type === "app" ? AppExecutor.from(workspace, name) : LibExecutor.from(workspace, name);
|
|
685
|
-
const modules = await executor
|
|
704
|
+
const modules = await modulesOf(executor);
|
|
686
705
|
const moduleName = await select({
|
|
687
706
|
message: `Select the module name`,
|
|
688
707
|
choices: modules.map((name) => ({ name: `${executor.name}:${name}`, value: name }))
|
|
@@ -895,4 +914,4 @@ function command(refName, depsOrBuilder, builder) {
|
|
|
895
914
|
}
|
|
896
915
|
return CommandBase;
|
|
897
916
|
}
|
|
898
|
-
export { camelToKebabCase, getTargetMetas, getTargetCommandNames, App, Apps, Lib, Sys, SysOrOnlyApp, Exec, Pkg, Module, Workspace, CommandContainer, runner, script, ExitCodeError, markCliErrorPrinted, assertPromptable, runCommands, command };
|
|
917
|
+
export { camelToKebabCase, getTargetMetas, getTargetCommandNames, App, Apps, Lib, Sys, SysOrOnlyApp, Exec, Pkg, Module, ModuleOrService, Workspace, CommandContainer, runner, script, ExitCodeError, markCliErrorPrinted, assertPromptable, runCommands, command };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-hkq0q73d.js";
|
|
6
6
|
import {
|
|
7
7
|
ModuleExecutor
|
|
8
8
|
} from "./index-wfmpxke3.js";
|
|
@@ -13,16 +13,16 @@ import {
|
|
|
13
13
|
createPassedPrimitiveReport,
|
|
14
14
|
bilingualLabelForField,
|
|
15
15
|
bilingualDescriptionForField
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-02b8qvww.js";
|
|
17
17
|
import {
|
|
18
18
|
PageScript
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-z9b72teg.js";
|
|
20
20
|
import {
|
|
21
21
|
pluralizeName
|
|
22
22
|
} from "./index-nz8prx9g.js";
|
|
23
23
|
import {
|
|
24
24
|
assertPlainName
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-va90m8nd.js";
|
|
26
26
|
|
|
27
27
|
// pkgs/@akanjs/cli/module/module.script.ts
|
|
28
28
|
import { capitalize as capitalize2 } from "akanjs/common";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-hkq0q73d.js";
|
|
6
6
|
import {
|
|
7
7
|
LibSource,
|
|
8
8
|
formatLibStatuses,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./index-wfmpxke3.js";
|
|
12
12
|
import {
|
|
13
13
|
assertPlainName
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-va90m8nd.js";
|
|
15
15
|
|
|
16
16
|
// pkgs/@akanjs/cli/library/library.script.ts
|
|
17
17
|
import { Logger } from "akanjs/common";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
CsrEntryFiles,
|
|
11
11
|
PagesEntrySourceGenerator,
|
|
12
12
|
PagesBundleBuilder
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-3rff2c48.js";
|
|
14
14
|
|
|
15
15
|
// pkgs/@akanjs/devkit/frontendBuild/csrArtifactBuilder.ts
|
|
16
16
|
import { mkdir as mkdir2, rm as rm2, unlink as unlink2 } from "fs/promises";
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-hkq0q73d.js";
|
|
6
6
|
import {
|
|
7
7
|
generatedFilesForSync,
|
|
8
8
|
createPassedPrimitiveReport,
|
|
9
9
|
scalarChangedFiles
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-02b8qvww.js";
|
|
11
11
|
import {
|
|
12
12
|
pluralizeName
|
|
13
13
|
} from "./index-nz8prx9g.js";
|
|
14
14
|
import {
|
|
15
15
|
assertPlainName
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-va90m8nd.js";
|
|
17
17
|
|
|
18
18
|
// pkgs/@akanjs/cli/scalar/scalar.runner.ts
|
|
19
19
|
class ScalarRunner extends runner("scalar") {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
CloudApi,
|
|
7
7
|
CloudUpdates,
|
|
8
8
|
PipelineSecrets
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-vftjqv28.js";
|
|
10
10
|
import {
|
|
11
11
|
resolveMobileTargets
|
|
12
12
|
} from "./index-m9jj544v.js";
|
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
} from "./index-wfmpxke3.js";
|
|
17
17
|
import {
|
|
18
18
|
NativeApp
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-g43360sn.js";
|
|
20
20
|
import {
|
|
21
21
|
runner,
|
|
22
22
|
assertPromptable
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-hkq0q73d.js";
|
|
24
24
|
import {
|
|
25
25
|
getNpmRegistryUrl,
|
|
26
26
|
getPublishedVersions,
|
|
@@ -1244,7 +1244,7 @@ ${run.format(results)}
|
|
|
1244
1244
|
async downloadEnv(cloudApi, workspace, workspaceId) {
|
|
1245
1245
|
await workspace.mkdir("local");
|
|
1246
1246
|
const localPath = await cloudApi.downloadEnv(workspaceId).catch((error) => {
|
|
1247
|
-
throw CloudApi.refusal(error, "
|
|
1247
|
+
throw CloudApi.refusal(error, "only the repository owner, or an owner or operator they allowed on the project's settings page, can download its env archive; sign in as one of them with `akan login`");
|
|
1248
1248
|
});
|
|
1249
1249
|
await EnvArchive.extract(workspace, localPath);
|
|
1250
1250
|
await workspace.remove(localPath);
|
|
@@ -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-4a2skdph.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?.();
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
akanMcpInstallTargets
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-fqx74yxn.js";
|
|
5
5
|
import {
|
|
6
6
|
jsonText
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-02b8qvww.js";
|
|
8
8
|
import {
|
|
9
9
|
script
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-hkq0q73d.js";
|
|
11
11
|
import {
|
|
12
12
|
ContextRunner2
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-b9q5aw30.js";
|
|
14
14
|
|
|
15
15
|
// pkgs/@akanjs/cli/context/context.script.ts
|
|
16
16
|
import { Logger } from "akanjs/common";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
script
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-hkq0q73d.js";
|
|
5
5
|
import {
|
|
6
6
|
AppExecutor,
|
|
7
7
|
LibExecutor,
|
|
@@ -45,10 +45,13 @@ import {
|
|
|
45
45
|
addFieldUiPolicyForType,
|
|
46
46
|
KeyRename,
|
|
47
47
|
MutationScaffold
|
|
48
|
-
} from "./index-
|
|
48
|
+
} from "./index-02b8qvww.js";
|
|
49
49
|
import {
|
|
50
50
|
ModuleScript
|
|
51
|
-
} from "./index-
|
|
51
|
+
} from "./index-jgj6ajnk.js";
|
|
52
|
+
import {
|
|
53
|
+
plainNameProblem
|
|
54
|
+
} from "./index-va90m8nd.js";
|
|
52
55
|
|
|
53
56
|
// pkgs/@akanjs/cli/primitive/primitive.script.ts
|
|
54
57
|
import { capitalize, lowerlize } from "akanjs/common";
|
|
@@ -65,11 +68,9 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
|
|
|
65
68
|
}
|
|
66
69
|
async createUi(workspace, input) {
|
|
67
70
|
const sys = await this.resolveSys(workspace, input.app);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
!input.module && PrimitiveScript.#inputMissing("module")
|
|
72
|
-
]));
|
|
71
|
+
const moduleProblem = PrimitiveScript.#moduleProblem(input.module);
|
|
72
|
+
if (!sys || !input.module || moduleProblem)
|
|
73
|
+
return PrimitiveScript.#refuse("create-ui", compactDiagnostics([!sys && PrimitiveScript.#targetMissing(), moduleProblem]));
|
|
73
74
|
const mod = ModuleExecutor.from(sys, input.module);
|
|
74
75
|
if (input.surface === "view")
|
|
75
76
|
return await this.moduleScript.createView(mod);
|
|
@@ -91,7 +92,7 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
|
|
|
91
92
|
const normalizedType = input.type ? normalizeFieldType(input.type) : null;
|
|
92
93
|
const diagnostics = compactDiagnostics([
|
|
93
94
|
!sys && PrimitiveScript.#targetMissing(),
|
|
94
|
-
|
|
95
|
+
PrimitiveScript.#moduleProblem(input.module),
|
|
95
96
|
!input.field && PrimitiveScript.#inputMissing("field"),
|
|
96
97
|
!input.type && PrimitiveScript.#inputMissing("type"),
|
|
97
98
|
enumValues?.length === 0 && PrimitiveScript.#inputMissing("values", "Enum values are required."),
|
|
@@ -466,6 +467,12 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
|
|
|
466
467
|
static #inputMissing(input, message = `${capitalize(input)} is required.`) {
|
|
467
468
|
return { severity: "error", code: "primitive-input-missing", message, input };
|
|
468
469
|
}
|
|
470
|
+
static #moduleProblem(module) {
|
|
471
|
+
if (!module)
|
|
472
|
+
return PrimitiveScript.#inputMissing("module");
|
|
473
|
+
const message = plainNameProblem("module", module);
|
|
474
|
+
return message ? { severity: "error", code: "primitive-input-invalid", message, input: "module" } : null;
|
|
475
|
+
}
|
|
469
476
|
static #sourceMissing(kind, path) {
|
|
470
477
|
return {
|
|
471
478
|
severity: "error",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// pkgs/@akanjs/devkit/workflow/plainName.ts
|
|
3
|
+
var sysNamePattern = /^[a-z0-9][a-zA-Z0-9_-]*$/;
|
|
4
|
+
var identifierPattern = /^_{0,2}[a-zA-Z][a-zA-Z0-9_-]*$/;
|
|
5
|
+
var packageNamePattern = /^(@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/;
|
|
6
|
+
var isWorkflowSysName = (value) => typeof value === "string" && sysNamePattern.test(value);
|
|
7
|
+
var isWorkflowModuleName = (value) => typeof value === "string" && identifierPattern.test(value);
|
|
8
|
+
var plainNameProblem = (kind, name) => {
|
|
9
|
+
const isSys = kind === "app" || kind === "lib";
|
|
10
|
+
if (isSys ? isWorkflowSysName(name) : isWorkflowModuleName(name))
|
|
11
|
+
return null;
|
|
12
|
+
return `${JSON.stringify(name)} is no ${kind} name; use letters, digits, - and _, starting with ${isSys ? "a lowercase letter or digit" : "a letter"}`;
|
|
13
|
+
};
|
|
14
|
+
var assertPlainName = (kind, name) => {
|
|
15
|
+
const problem = plainNameProblem(kind, name);
|
|
16
|
+
if (problem)
|
|
17
|
+
throw new Error(problem);
|
|
18
|
+
};
|
|
19
|
+
var assertPackageName = (name) => {
|
|
20
|
+
if (packageNamePattern.test(name))
|
|
21
|
+
return;
|
|
22
|
+
throw new Error(`${JSON.stringify(name)} is no package name; use name or @scope/name, each of lowercase letters, digits, -, . and _, starting with a letter or digit`);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { sysNamePattern, identifierPattern, isWorkflowSysName, isWorkflowModuleName, plainNameProblem, assertPlainName, assertPackageName };
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
UpdatePackFolder,
|
|
10
10
|
NativePublicEnv,
|
|
11
11
|
NativeApp
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-g43360sn.js";
|
|
13
13
|
import {
|
|
14
14
|
ExitCodeError
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-hkq0q73d.js";
|
|
16
16
|
import {
|
|
17
17
|
ConfigLock
|
|
18
18
|
} from "./index-bqbf654f.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
script,
|
|
5
5
|
ExitCodeError,
|
|
6
6
|
markCliErrorPrinted
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-hkq0q73d.js";
|
|
8
8
|
import {
|
|
9
9
|
AGENT_BLOCK_START,
|
|
10
10
|
AGENT_BLOCK_END,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from "./index-j6eeh5d7.js";
|
|
26
26
|
import {
|
|
27
27
|
AkanContextAnalyzer
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-fqx74yxn.js";
|
|
29
29
|
import {
|
|
30
30
|
collectRecipeSources2,
|
|
31
31
|
scanRecipes2
|
|
@@ -33,15 +33,15 @@ import {
|
|
|
33
33
|
import {
|
|
34
34
|
ApplicationRunner,
|
|
35
35
|
VerifyScope
|
|
36
|
-
} from "./index-
|
|
36
|
+
} from "./index-5qq6qky3.js";
|
|
37
37
|
import {
|
|
38
38
|
WorkspaceRunner
|
|
39
|
-
} from "./index-
|
|
39
|
+
} from "./index-jqsj5wjb.js";
|
|
40
40
|
import {
|
|
41
41
|
VerifyComments,
|
|
42
42
|
VerifyPipeline,
|
|
43
43
|
VerifyReport
|
|
44
|
-
} from "./index-
|
|
44
|
+
} from "./index-3wen6ddy.js";
|
|
45
45
|
|
|
46
46
|
// pkgs/@akanjs/cli/agent/agent.script.ts
|
|
47
47
|
import { Logger as Logger3 } from "akanjs/common";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
CloudApi,
|
|
5
5
|
CloudUpdates,
|
|
6
6
|
PipelineSecrets
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-vftjqv28.js";
|
|
8
8
|
import {
|
|
9
9
|
PkgExecutor
|
|
10
10
|
} from "./index-wfmpxke3.js";
|
|
@@ -12,19 +12,19 @@ import {
|
|
|
12
12
|
UpdatePackFolder,
|
|
13
13
|
NativePublicEnv,
|
|
14
14
|
NativeApp
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-g43360sn.js";
|
|
16
16
|
import {
|
|
17
17
|
script
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-hkq0q73d.js";
|
|
19
19
|
import {
|
|
20
20
|
ApplicationScript
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-ah09graf.js";
|
|
22
22
|
import {
|
|
23
23
|
PackageScript
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-gsty3pkx.js";
|
|
25
25
|
import {
|
|
26
26
|
CloudRunner
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-kjmrkc45.js";
|
|
28
28
|
|
|
29
29
|
// pkgs/@akanjs/cli/cloud/cloud.script.ts
|
|
30
30
|
import { Logger } from "akanjs/common";
|
package/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getTargetMetas,
|
|
5
5
|
getTargetCommandNames,
|
|
6
6
|
runCommands
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-hkq0q73d.js";
|
|
8
8
|
import"./index-bns3wcpc.js";
|
|
9
9
|
import"./index-wfmpxke3.js";
|
|
10
10
|
|
|
@@ -22,27 +22,27 @@ import path from "path";
|
|
|
22
22
|
|
|
23
23
|
// pkgs/@akanjs/cli/commandModules.ts
|
|
24
24
|
var commandModules = {
|
|
25
|
-
workspace: async () => (await import("./workspace.command-
|
|
26
|
-
agent: async () => (await import("./agent.command-
|
|
27
|
-
code: async () => (await import("./code.command-
|
|
28
|
-
application: async () => (await import("./application.command-
|
|
29
|
-
library: async () => (await import("./library.command-
|
|
30
|
-
localRegistry: async () => (await import("./localRegistry.command-
|
|
31
|
-
package: async () => (await import("./package.command-
|
|
32
|
-
module: async () => (await import("./module.command-
|
|
33
|
-
page: async () => (await import("./page.command-
|
|
34
|
-
context: async () => (await import("./context.command-
|
|
35
|
-
cloud: async () => (await import("./cloud.command-
|
|
36
|
-
subspace: async () => (await import("./subspace.command-
|
|
37
|
-
guideline: async () => (await import("./guideline.command-
|
|
38
|
-
scalar: async () => (await import("./scalar.command-
|
|
39
|
-
primitive: async () => (await import("./primitive.command-
|
|
40
|
-
quality: async () => (await import("./quality.command-
|
|
41
|
-
verify: async () => (await import("./verify.command-
|
|
42
|
-
repair: async () => (await import("./repair.command-
|
|
43
|
-
workflow: async () => (await import("./workflow.command-
|
|
44
|
-
pipeline: async () => (await import("./pipeline.command-
|
|
45
|
-
tunnel: async () => (await import("./tunnel.command-
|
|
25
|
+
workspace: async () => (await import("./workspace.command-04qgwsst.js")).WorkspaceCommand,
|
|
26
|
+
agent: async () => (await import("./agent.command-y22t9x1e.js")).AgentCommand,
|
|
27
|
+
code: async () => (await import("./code.command-y94hwxsn.js")).CodeCommand,
|
|
28
|
+
application: async () => (await import("./application.command-yhj5arwc.js")).ApplicationCommand,
|
|
29
|
+
library: async () => (await import("./library.command-6eafevmj.js")).LibraryCommand,
|
|
30
|
+
localRegistry: async () => (await import("./localRegistry.command-9tef2qsj.js")).LocalRegistryCommand,
|
|
31
|
+
package: async () => (await import("./package.command-kbg9z7re.js")).PackageCommand,
|
|
32
|
+
module: async () => (await import("./module.command-pn1k7dfk.js")).ModuleCommand,
|
|
33
|
+
page: async () => (await import("./page.command-st0y2xg8.js")).PageCommand,
|
|
34
|
+
context: async () => (await import("./context.command-xz65fhrn.js")).ContextCommand,
|
|
35
|
+
cloud: async () => (await import("./cloud.command-bqfh4cnx.js")).CloudCommand,
|
|
36
|
+
subspace: async () => (await import("./subspace.command-vh6dye0v.js")).SubspaceCommand,
|
|
37
|
+
guideline: async () => (await import("./guideline.command-sn843nw6.js")).GuidelineCommand,
|
|
38
|
+
scalar: async () => (await import("./scalar.command-ck8621dy.js")).ScalarCommand,
|
|
39
|
+
primitive: async () => (await import("./primitive.command-ax6wg70s.js")).PrimitiveCommand,
|
|
40
|
+
quality: async () => (await import("./quality.command-0gzskga8.js")).QualityCommand,
|
|
41
|
+
verify: async () => (await import("./verify.command-f2n4bwp7.js")).VerifyCommand,
|
|
42
|
+
repair: async () => (await import("./repair.command-g5kc3x89.js")).RepairCommand,
|
|
43
|
+
workflow: async () => (await import("./workflow.command-bx9xwgs5.js")).WorkflowCommand,
|
|
44
|
+
pipeline: async () => (await import("./pipeline.command-76m32y7z.js")).PipelineCommand,
|
|
45
|
+
tunnel: async () => (await import("./tunnel.command-4mezrypt.js")).TunnelCommand
|
|
46
46
|
};
|
|
47
47
|
var commandModuleIds = Object.keys(commandModules);
|
|
48
48
|
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
Lib,
|
|
4
4
|
Workspace,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-hkq0q73d.js";
|
|
7
7
|
import"./index-bns3wcpc.js";
|
|
8
8
|
import"./index-wfmpxke3.js";
|
|
9
9
|
import {
|
|
10
10
|
LibraryScript
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-jrdp7c4h.js";
|
|
12
12
|
|
|
13
13
|
// pkgs/@akanjs/cli/library/library.command.ts
|
|
14
14
|
class LibraryCommand extends command("library", [LibraryScript], ({ public: target }) => ({
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-hkq0q73d.js";
|
|
8
8
|
import"./index-bns3wcpc.js";
|
|
9
9
|
import {
|
|
10
10
|
parseEnvFile,
|
|
@@ -16,28 +16,28 @@ import {
|
|
|
16
16
|
getNpmRegistryUrl
|
|
17
17
|
} from "./index-ny2k80mv.js";
|
|
18
18
|
import"./index-y725zb1a.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
19
|
+
import"./index-g43360sn.js";
|
|
20
|
+
import"./index-5hhe0rdd.js";
|
|
21
21
|
import"./index-m9jj544v.js";
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
22
|
+
import"./index-3rff2c48.js";
|
|
23
|
+
import"./index-jxaq2evq.js";
|
|
24
|
+
import"./index-jrdp7c4h.js";
|
|
25
|
+
import"./index-5qq6qky3.js";
|
|
26
|
+
import"./index-b4qq3rq0.js";
|
|
27
27
|
import {
|
|
28
28
|
ApplicationScript
|
|
29
|
-
} from "./index-
|
|
30
|
-
import"./index-
|
|
29
|
+
} from "./index-ah09graf.js";
|
|
30
|
+
import"./index-vftjqv28.js";
|
|
31
31
|
import {
|
|
32
32
|
CloudRunner
|
|
33
|
-
} from "./index-
|
|
33
|
+
} from "./index-kjmrkc45.js";
|
|
34
34
|
import"./index-qd7xn2bk.js";
|
|
35
35
|
import"./index-9p260r4e.js";
|
|
36
36
|
import"./index-cmg5ngqa.js";
|
|
37
37
|
import"./index-ygrdw6jw.js";
|
|
38
38
|
import {
|
|
39
39
|
PackageScript
|
|
40
|
-
} from "./index-
|
|
40
|
+
} from "./index-gsty3pkx.js";
|
|
41
41
|
import"./index-8jpc5fqv.js";
|
|
42
42
|
import"./index-9bv479q5.js";
|
|
43
43
|
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Sys,
|
|
4
4
|
Module,
|
|
5
|
+
ModuleOrService,
|
|
5
6
|
command
|
|
6
|
-
} from "./index-
|
|
7
|
+
} from "./index-hkq0q73d.js";
|
|
7
8
|
import"./index-bns3wcpc.js";
|
|
8
9
|
import"./index-wfmpxke3.js";
|
|
9
10
|
import {
|
|
10
11
|
renderPrimitiveReport
|
|
11
|
-
} from "./index-
|
|
12
|
+
} from "./index-02b8qvww.js";
|
|
12
13
|
import"./index-9p260r4e.js";
|
|
13
|
-
import"./index-
|
|
14
|
+
import"./index-z9b72teg.js";
|
|
14
15
|
import {
|
|
15
16
|
ModuleScript
|
|
16
|
-
} from "./index-
|
|
17
|
+
} from "./index-jgj6ajnk.js";
|
|
17
18
|
|
|
18
19
|
// pkgs/@akanjs/cli/module/module.command.ts
|
|
19
20
|
import { Logger, lowerlize } from "akanjs/common";
|
|
@@ -23,7 +24,10 @@ class ModuleCommand extends command("module", [ModuleScript], ({ public: target
|
|
|
23
24
|
const report = await this.moduleScript.createModuleTemplate(sys, name, { page });
|
|
24
25
|
Logger.rawLog(renderPrimitiveReport(report, format));
|
|
25
26
|
}),
|
|
26
|
-
removeModule: target({
|
|
27
|
+
removeModule: target({
|
|
28
|
+
desc: "Remove a module, or a service module as <sys>:_<name>, from an app or library",
|
|
29
|
+
destructive: true
|
|
30
|
+
}).with(ModuleOrService).exec(async function(module) {
|
|
27
31
|
await this.moduleScript.removeModule(module);
|
|
28
32
|
}),
|
|
29
33
|
createService: target({ desc: "Create a service module without database files" }).arg("serviceName", String, { desc: "name of service module" }).with(Sys).option("format", String, { flag: "o", desc: "output format", default: "markdown", enum: ["markdown", "json"] }).exec(async function(serviceName, sys, format) {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
Pkg,
|
|
4
4
|
Workspace,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-hkq0q73d.js";
|
|
7
7
|
import"./index-bns3wcpc.js";
|
|
8
8
|
import"./index-wfmpxke3.js";
|
|
9
9
|
import"./index-qd7xn2bk.js";
|
|
@@ -12,7 +12,7 @@ import"./index-cmg5ngqa.js";
|
|
|
12
12
|
import"./index-ygrdw6jw.js";
|
|
13
13
|
import {
|
|
14
14
|
PackageScript
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-gsty3pkx.js";
|
|
16
16
|
|
|
17
17
|
// pkgs/@akanjs/cli/package/package.command.ts
|
|
18
18
|
class PackageCommand extends command("package", [PackageScript], ({ public: target }) => ({
|