@akanjs/cli 3.0.0-beta.2 → 3.0.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.build-stamp +1 -1
- package/CodeAgent-awv258wb.js +9 -0
- package/CodeAgentRpcHost-p7h6n2hp.js +7 -0
- package/CodeAgentRpcListener-7p7z5dd7.js +97 -0
- package/CodeTui-1nqh35ez.js +1457 -0
- package/README.md +3 -0
- package/TunnelShare-scf4e4pd.js +9 -0
- package/{agent.command-d2gfxfck.js → agent.command-1s9ag7sb.js} +8 -9
- package/akanCode.js +102 -0
- package/{application.command-pj2m7584.js → application.command-49hwy6va.js} +51 -78
- package/{applicationBuildRunner-kxwbssgn.js → applicationBuildRunner-ybyp97pv.js} +63 -64
- package/{applicationReleasePackager-4yasxwv9.js → applicationReleasePackager-esnrphw8.js} +40 -60
- package/buildBatch.proc.js +19 -24
- package/{capacitorApp-36rbr858.js → capacitorApp-1synz4en.js} +3 -4
- package/cloud.command-d7rqtzt9.js +94 -0
- package/cloud.script-bkbpcr96.js +19 -0
- package/code.command-nn48xzej.js +154 -0
- package/commandManifest.json +1 -1
- package/consoleToStderr-h5bryj94.js +7 -0
- package/context.command-s3mcmvpa.js +48 -0
- package/context.runner-k99nb5pk.js +21 -0
- package/{dependencyScanner-shs82ynp.js → dependencyScanner-ye2e6pdz.js} +2 -2
- package/{devTui-40ggmd99.js → devTui-q7k7bakd.js} +122 -40
- package/fileSys-5ngz93ga.js +9 -0
- package/guideline.command-sct4qnt5.js +42 -0
- package/guidelines/agentRule/agentRule.instruction.md +206 -25
- package/guidelines/conventions/conventions.instruction.md +79 -24
- package/guidelines/fieldRule/fieldRule.instruction.md +1 -0
- package/guidelines/mcpRule/mcpRule.instruction.md +7 -5
- package/guidelines/queryRule/queryRule.instruction.md +17 -7
- package/guidelines/runtimeRule/runtimeRule.instruction.md +74 -0
- package/guidelines/ssrRule/ssrRule.instruction.md +4 -2
- package/guidelines/transportRule/transportRule.instruction.md +51 -0
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +66 -3
- package/incrementalBuilder.proc.js +31 -48
- package/{index-h7yw2z9n.js → index-0bq14vr1.js} +8 -14
- package/index-13ffe9wp.js +69 -0
- package/index-22d57v4c.js +266 -0
- package/{index-fz5q3gd7.js → index-31yr441d.js} +10 -17
- package/index-3hx1z96c.js +87 -0
- package/index-3sq321ak.js +53 -0
- package/{index-kcxmv48c.js → index-3t7g9e4r.js} +45 -79
- package/{index-q0y2jq9j.js → index-5b6tavv3.js} +6 -3
- package/{index-47pj3aee.js → index-5e0n4hqx.js} +11 -12
- package/{index-259dsnz3.js → index-5pc1qrbv.js} +5 -8
- package/index-7md2g9vw.js +6 -0
- package/index-8mna0947.js +187 -0
- package/{index-zry5nz81.js → index-8sf7wmdr.js} +51 -30
- package/{index-2tv3fdx4.js → index-9d9bgcx4.js} +342 -765
- package/index-9dp031by.js +12 -0
- package/{index-ne2qy0nk.js → index-ahemdr5n.js} +12 -12
- package/{index-ws5e0j51.js → index-as7xmyz8.js} +40 -24
- package/index-axzjaqve.js +1118 -0
- package/{index-3d9y066c.js → index-bjwxs904.js} +9 -8
- package/index-c6eggbee.js +123 -0
- package/index-d2242ksy.js +99 -0
- package/{index-a64esmtb.js → index-ddxvdd1p.js} +169 -305
- package/{index-92zztqy1.js → index-dy0jx9ay.js} +2 -17
- package/{index-pnqbkf5p.js → index-dzf3r49a.js} +6 -2
- package/{index-w8kmx1b6.js → index-fgq75haa.js} +198 -290
- package/{index-by5gpp8x.js → index-hj6w4ka1.js} +2 -1
- package/{index-hwkygn9s.js → index-khpfpcsd.js} +302 -33
- package/{index-wt7qrtd4.js → index-mxav6j3c.js} +93 -232
- package/{index-gyd220p2.js → index-myhc3c1j.js} +554 -577
- package/{index-600zhnve.js → index-nv5976x3.js} +56 -197
- package/index-p6pbz9n5.js +25 -0
- package/{index-4edzf1gr.js → index-przybvy5.js} +77 -150
- package/index-smme4r47.js +49 -0
- package/{index-mak3cd28.js → index-w2zdcw3k.js} +137 -255
- package/index-wa5jbxj1.js +760 -0
- package/{index-v0qh106m.js → index-ww4z397j.js} +527 -723
- package/{index-j9yhg404.js → index-xqjwd384.js} +4 -7
- package/{index-7737gxcp.js → index-xqpzbab5.js} +107 -241
- package/index-xsjh6nzh.js +2729 -0
- package/{index-ktb5njgy.js → index-ygn77a5w.js} +47 -99
- package/index-ztp3e73t.js +700 -0
- package/index.js +23 -22
- package/{library.command-nbsky672.js → library.command-1gx04jgn.js} +4 -5
- package/{localRegistry.command-yeq57wjr.js → localRegistry.command-zndxj1q6.js} +22 -42
- package/{module.command-29vqzrh8.js → module.command-3waddk95.js} +8 -11
- package/{package.command-axv0abmn.js → package.command-zrc7br1y.js} +6 -7
- package/package.json +14 -5
- package/{page.command-vs9s3zrh.js → page.command-vpjgardh.js} +4 -5
- package/{primitive.command-cbxmqbtc.js → primitive.command-sz84tk4t.js} +9 -22
- package/prompter-ptaa3nk0.js +8 -0
- package/{quality.command-gmbs7nws.js → quality.command-g869hafs.js} +203 -376
- package/{recipeScanner-fpagtgc1.js → recipeScanner-4b69ybe0.js} +1 -1
- package/{repair.command-bqsjptsj.js → repair.command-chsnjvvv.js} +11 -35
- package/{routeSourceValidator-apyqw7wk.js → routeSourceValidator-7ycnfz0e.js} +0 -6
- package/{scalar.command-6k1vhe9s.js → scalar.command-2v21newx.js} +7 -10
- package/skills/akan-code/SKILL.md +130 -0
- package/skills/akan-debug/SKILL.md +42 -0
- package/skills/akan-deps/SKILL.md +50 -0
- package/skills/akan-err/SKILL.md +39 -0
- package/skills/akan-module/SKILL.md +45 -0
- package/skills/akan-scaffold/SKILL.md +76 -0
- package/skills/akan-scalar/SKILL.md +52 -0
- package/skills/akan-service/SKILL.md +34 -0
- package/skills/akan-store/SKILL.md +67 -0
- package/skills/akan-ui/SKILL.md +63 -0
- package/skills/akan-validate/SKILL.md +44 -0
- package/{subspace.command-fwjfcts7.js → subspace.command-ckcbwfp1.js} +138 -67
- package/templates/__scalar/__model__/__model__.abstract.md.template +8 -0
- package/templates/appSample/lib/__scalar/workHistory/workHistory.abstract.ts +8 -39
- package/templates/appSample/lib/_noti/noti.abstract.ts +6 -29
- package/templates/appSample/lib/task/task.abstract.ts +12 -32
- package/templates/appSample/lib/task/task.signal.spec.ts +15 -18
- package/templates/appSample/lib/task/task.signal.test.ts +15 -1
- package/templates/appSample/lib/task/task.signal.ts +1 -1
- package/templates/appSample/srvkit/{AuthGuard.ts → guards.ts} +7 -4
- package/templates/appSample/srvkit/{SessionInternalArg.ts → internalArgs.ts} +6 -4
- package/templates/client.ts +7 -30
- package/templates/crudPages/[__model__Id]/edit/page.tsx +2 -1
- package/templates/crudPages/[__model__Id]/page.tsx +2 -1
- package/templates/crudPages/new/page.tsx +2 -1
- package/templates/crudPages/page.tsx +2 -1
- package/templates/crudSinglePage/page.tsx +2 -1
- package/templates/lib/__lib/lib.dictionary.ts +0 -2
- package/templates/lib/__lib/lib.document.ts +0 -2
- package/templates/lib/sig.ts +8 -30
- package/templates/localDev/docker-compose.yaml.template +3 -14
- package/templates/module/__model__.signal.ts +12 -4
- package/templates/pkgRoot/tsconfig.json.template +2 -7
- package/templates/server.ts +0 -2
- package/templates/service/__model__.abstract.md.template +8 -0
- package/tunnel.command-kd2yr4fx.js +129 -0
- package/{typeChecker-3xgrzc2v.js → typeChecker-px49mezc.js} +1 -1
- package/typecheck.proc.js +1 -1
- package/workflow.command-44252cqv.js +79 -0
- package/{workspace.command-8s050m0h.js → workspace.command-fqcztt5p.js} +77 -109
- package/abstractCompactor-mjh5ppsq.js +0 -101
- package/cloud.command-jshwdq22.js +0 -93
- package/context.command-ez8a0zyz.js +0 -80
- package/devTuiView-c08ccbat.js +0 -9
- package/getDirname-dr3jz1xg.js +0 -7
- package/guideline.command-xmqwx8zm.js +0 -359
- package/guidelines/agentRule/agentRule.generate.json +0 -31
- package/guidelines/componentRule/componentRule.generate.json +0 -31
- package/guidelines/conventions/conventions.generate.json +0 -25
- package/guidelines/cssRule/cssRule.generate.json +0 -31
- package/guidelines/docPageRule/docPageRule.generate.json +0 -31
- package/guidelines/docPageRule/docPageRule.instruction.md +0 -25
- package/guidelines/docSyncRule/docSyncRule.generate.json +0 -31
- package/guidelines/docSyncRule/docSyncRule.instruction.md +0 -25
- package/guidelines/enumConstant/enumConstant.generate.json +0 -31
- package/guidelines/enumConstant/enumConstant.instruction.md +0 -28
- package/guidelines/fieldRule/fieldRule.generate.json +0 -31
- package/guidelines/framework/framework.generate.json +0 -32
- package/guidelines/mcpRule/mcpRule.generate.json +0 -35
- package/guidelines/modelConstant/modelConstant.generate.json +0 -32
- package/guidelines/modelDictionary/modelDictionary.generate.json +0 -32
- package/guidelines/modelDocument/modelDocument.generate.json +0 -31
- package/guidelines/modelService/modelService.generate.json +0 -31
- package/guidelines/modelSignal/modelSignal.generate.json +0 -31
- package/guidelines/modelStore/modelStore.generate.json +0 -31
- package/guidelines/modelTemplate/modelTemplate.generate.json +0 -31
- package/guidelines/modelUnit/modelUnit.generate.json +0 -31
- package/guidelines/modelUtil/modelUtil.generate.json +0 -31
- package/guidelines/modelView/modelView.generate.json +0 -31
- package/guidelines/modelZone/modelZone.generate.json +0 -31
- package/guidelines/moduleCodegen/moduleCodegen.generate.json +0 -31
- package/guidelines/moduleCodegen/moduleCodegen.instruction.md +0 -28
- package/guidelines/moduleOverview/moduleOverview.generate.json +0 -31
- package/guidelines/queryRule/queryRule.generate.json +0 -31
- package/guidelines/recipeRule/recipeRule.generate.json +0 -31
- package/guidelines/runtimeRule/runtimeRule.generate.json +0 -25
- package/guidelines/scalarConstant/scalarConstant.generate.json +0 -32
- package/guidelines/scalarDictionary/scalarDictionary.generate.json +0 -32
- package/guidelines/scalarModule/scalarModule.generate.json +0 -31
- package/guidelines/sharedUiUsage/sharedUiUsage.generate.json +0 -31
- package/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -25
- package/guidelines/ssrRule/ssrRule.generate.json +0 -31
- package/guidelines/transportRule/transportRule.generate.json +0 -31
- package/guidelines/utilUiUsage/utilUiUsage.generate.json +0 -31
- package/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -25
- package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +0 -24
- package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +0 -33
- package/index-2hq52jq3.js +0 -465
- package/index-6wwzs1bc.js +0 -7
- package/index-8pm30m73.js +0 -841
- package/index-kn1h7p1x.js +0 -560
- package/index-meh558jy.js +0 -65
- package/index-rwg2aa4f.js +0 -229
- package/templates/__scalar/__model__/__model__.abstract.md +0 -28
- package/templates/module/__model__.abstract.md +0 -28
- package/templates/service/__model__.abstract.md +0 -28
- package/workflow.command-nwpcdc8p.js +0 -107
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./index-
|
|
3
|
+
FileSys2
|
|
4
|
+
} from "./index-5b6tavv3.js";
|
|
5
5
|
import {
|
|
6
6
|
Spinner
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-9d9bgcx4.js";
|
|
8
8
|
|
|
9
9
|
// pkgs/@akanjs/devkit/applicationReleasePackager.ts
|
|
10
10
|
import { cp, mkdir, rm } from "fs/promises";
|
|
@@ -12,10 +12,7 @@ import path from "path";
|
|
|
12
12
|
|
|
13
13
|
// pkgs/@akanjs/devkit/uploadRelease.ts
|
|
14
14
|
import { Logger, RestClient } from "akanjs/common";
|
|
15
|
-
var spinning = (message) => {
|
|
16
|
-
const spinner = new Spinner(message, { prefix: message, enableSpin: true }).start();
|
|
17
|
-
return spinner;
|
|
18
|
-
};
|
|
15
|
+
var spinning = (message) => new Spinner(message, { prefix: message, enableSpin: true }).start();
|
|
19
16
|
var uploadRelease = async (appName, {
|
|
20
17
|
workspaceRoot,
|
|
21
18
|
environment,
|
|
@@ -27,28 +24,20 @@ var uploadRelease = async (appName, {
|
|
|
27
24
|
const logger = new Logger("uploadRelease");
|
|
28
25
|
const basePath = local ? "http://localhost:8282/backend" : "https://cloud.akanjs.com/backend";
|
|
29
26
|
const httpClient = new RestClient(basePath);
|
|
30
|
-
const buildPath = `${workspaceRoot}/releases/builds/${appName}-release.tar.gz`;
|
|
31
|
-
const appBuildPath = `${workspaceRoot}/releases/builds/${appName}-appBuild.zip`;
|
|
32
|
-
const sourcePath = `${workspaceRoot}/releases/sources/${appName}-source.tar.gz`;
|
|
33
27
|
const readingFilesSpinner = spinning("Reading files...");
|
|
34
28
|
try {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
29
|
+
const uploads = [
|
|
30
|
+
[`builds/${appName}-release.tar.gz`, `${appName}-release.tar.gz`],
|
|
31
|
+
[`sources/${appName}-source.tar.gz`, `${appName}-source.tar.gz`],
|
|
32
|
+
[`builds/${appName}-appBuild.zip`, `${appName}-appBuild.zip`]
|
|
33
|
+
].map(([relativePath, name]) => ({ file: Bun.file(`${workspaceRoot}/releases/${relativePath}`), name }));
|
|
34
|
+
const metas = uploads.map(({ file }) => ({ lastModifiedAt: new Date(file.lastModified), size: file.size }));
|
|
41
35
|
readingFilesSpinner.succeed("Reading files... done");
|
|
42
36
|
const preparingFormSpinner = spinning("Preparing form data...");
|
|
43
37
|
const formData = new FormData;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
formData.append("
|
|
47
|
-
formData.append("metas", JSON.stringify([
|
|
48
|
-
{ lastModifiedAt: buildStat.mtime, size: buildStat.size },
|
|
49
|
-
{ lastModifiedAt: sourceStat.mtime, size: sourceStat.size },
|
|
50
|
-
{ lastModifiedAt: appBuildStat.mtime, size: appBuildStat.size }
|
|
51
|
-
]));
|
|
38
|
+
for (const { file, name } of uploads)
|
|
39
|
+
formData.append("files", file, name);
|
|
40
|
+
formData.append("metas", JSON.stringify(metas));
|
|
52
41
|
formData.append("type", "release");
|
|
53
42
|
preparingFormSpinner.succeed("Preparing form data... done");
|
|
54
43
|
try {
|
|
@@ -113,10 +102,10 @@ class ApplicationReleasePackager {
|
|
|
113
102
|
const akanConfig = await this.#app.getConfig();
|
|
114
103
|
const platformVersion = akanConfig.mobile.version;
|
|
115
104
|
const buildRoot = `${this.#app.workspace.workspaceRoot}/releases/builds/${this.#app.name}`;
|
|
116
|
-
if (await
|
|
105
|
+
if (await FileSys2.dirExists(buildRoot))
|
|
117
106
|
await rm(buildRoot, { recursive: true, force: true });
|
|
118
107
|
await mkdir(buildRoot, { recursive: true });
|
|
119
|
-
if (rebuild || !await
|
|
108
|
+
if (rebuild || !await FileSys2.dirExists(`${this.#app.dist.cwdPath}/backend`))
|
|
120
109
|
await this.#build();
|
|
121
110
|
const buildVersion = `${platformVersion}-${buildNum}`;
|
|
122
111
|
const buildPath = `${buildRoot}/${buildVersion}`;
|
|
@@ -125,13 +114,12 @@ class ApplicationReleasePackager {
|
|
|
125
114
|
await cp(this.#app.dist.cwdPath, buildRoot, { recursive: true });
|
|
126
115
|
await rm(`${buildRoot}/frontend/.next`, { recursive: true, force: true });
|
|
127
116
|
const releaseRoot = this.#app.workspace.workspaceRoot;
|
|
128
|
-
|
|
129
|
-
await this.#app.workspace.spawn("tar", ["-zcf", releaseArchivePath, "-C", buildRoot, "./"], { cwd: releaseRoot });
|
|
117
|
+
await this.#tar(releaseRoot, `${releaseRoot}/releases/builds/${this.#app.name}-release.tar.gz`, buildRoot);
|
|
130
118
|
await this.#writeCsrZipIfPresent();
|
|
131
119
|
return { platformVersion };
|
|
132
120
|
}
|
|
133
121
|
async#writeCsrZipIfPresent() {
|
|
134
|
-
if (!await
|
|
122
|
+
if (!await FileSys2.dirExists(`${this.#app.dist.cwdPath}/csr`))
|
|
135
123
|
return;
|
|
136
124
|
await cp(`${this.#app.dist.cwdPath}/csr`, "./csr", { recursive: true });
|
|
137
125
|
await this.#app.workspace.spawn("zip", [
|
|
@@ -149,7 +137,7 @@ class ApplicationReleasePackager {
|
|
|
149
137
|
await Promise.all(libDeps.map((lib) => cp(`${this.#app.workspace.cwdPath}/libs/${lib}`, `${sourceRoot}/libs/${lib}`, { recursive: true })));
|
|
150
138
|
await Promise.all([".next", "ios", "android", "public/libs"].map(async (path2) => {
|
|
151
139
|
const targetPath = `${sourceRoot}/apps/${this.#app.name}/${path2}`;
|
|
152
|
-
if (await
|
|
140
|
+
if (await FileSys2.dirExists(targetPath))
|
|
153
141
|
await rm(targetPath, { recursive: true, force: true });
|
|
154
142
|
}));
|
|
155
143
|
const syncPaths = [".husky", ".gitignore", "package.json"];
|
|
@@ -157,18 +145,18 @@ class ApplicationReleasePackager {
|
|
|
157
145
|
await this.#writeSourceTsconfig(sourceRoot, libDeps);
|
|
158
146
|
await Bun.write(`${sourceRoot}/README.md`, readme);
|
|
159
147
|
const sourceCwd = this.#app.workspace.cwdPath;
|
|
160
|
-
|
|
161
|
-
|
|
148
|
+
await this.#tar(sourceCwd, `${sourceCwd}/releases/sources/${this.#app.name}-source.tar.gz`, sourceRoot);
|
|
149
|
+
}
|
|
150
|
+
async#tar(cwd, archivePath, sourceDir) {
|
|
151
|
+
const relativeArchivePath = path.relative(cwd, archivePath).split(path.sep).join("/");
|
|
152
|
+
await this.#app.workspace.spawn("tar", ["-zcf", relativeArchivePath, "-C", sourceDir, "./"], { cwd });
|
|
162
153
|
}
|
|
163
154
|
async#resetSourceRoot(sourceRoot) {
|
|
164
|
-
if (await
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
} catch {}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
155
|
+
if (await FileSys2.dirExists(sourceRoot))
|
|
156
|
+
for (let attempt = 0;attempt < 3; attempt++)
|
|
157
|
+
await rm(sourceRoot, { recursive: true, force: true }).catch(() => {
|
|
158
|
+
return;
|
|
159
|
+
});
|
|
172
160
|
await mkdir(sourceRoot, { recursive: true });
|
|
173
161
|
}
|
|
174
162
|
async#writeSourceTsconfig(sourceRoot, libDeps) {
|
|
@@ -180,6 +168,16 @@ class ApplicationReleasePackager {
|
|
|
180
168
|
tsconfig.compilerOptions.paths = Object.fromEntries(pathEntries);
|
|
181
169
|
await Bun.write(`${sourceRoot}/tsconfig.json`, JSON.stringify(tsconfig, null, 2));
|
|
182
170
|
}
|
|
171
|
+
static #envSetup = ` cat <<EOF >> .env
|
|
172
|
+
# ENV For Server => debug | debug.local | develop | develop.local | main | main.local
|
|
173
|
+
SERVER_ENV=debug.local
|
|
174
|
+
# Run Mode For Server => federation | batch | all
|
|
175
|
+
SERVER_MODE=federation
|
|
176
|
+
# ENV For Client => debug | debug.local | develop | develop.local | main | main.local
|
|
177
|
+
AKAN_PUBLIC_CLIENT_ENV=debug.local
|
|
178
|
+
ANALYZE=false
|
|
179
|
+
EOF
|
|
180
|
+
`;
|
|
183
181
|
#confidentialReadme() {
|
|
184
182
|
return `# ${this.#app.name}
|
|
185
183
|
\uBCF8 \uD504\uB85C\uC81D\uD2B8\uC758 \uC18C\uC2A4\uCF54\uB4DC \uBC0F \uAD00\uB828\uC790\uB8CC\uB294 \uBAA8\uB450 \uBE44\uBC00\uC815\uBCF4\uB85C \uAD00\uB9AC\uB429\uB2C8\uB2E4.
|
|
@@ -190,16 +188,7 @@ class ApplicationReleasePackager {
|
|
|
190
188
|
bun install -g bun
|
|
191
189
|
bun i
|
|
192
190
|
|
|
193
|
-
|
|
194
|
-
# ENV For Server => debug | debug.local | develop | develop.local | main | main.local
|
|
195
|
-
SERVER_ENV=debug.local
|
|
196
|
-
# Run Mode For Server => federation | batch | all
|
|
197
|
-
SERVER_MODE=federation
|
|
198
|
-
# ENV For Client => debug | debug.local | develop | develop.local | main | main.local
|
|
199
|
-
AKAN_PUBLIC_CLIENT_ENV=debug.local
|
|
200
|
-
ANALYZE=false
|
|
201
|
-
EOF
|
|
202
|
-
|
|
191
|
+
${ApplicationReleasePackager.#envSetup}
|
|
203
192
|
akn start-backend ${this.#app.name}
|
|
204
193
|
# or akn start-frontend ${this.#app.name}, etc
|
|
205
194
|
\`\`\`
|
|
@@ -217,16 +206,7 @@ class ApplicationReleasePackager {
|
|
|
217
206
|
## Get Started
|
|
218
207
|
Run the code below.
|
|
219
208
|
\`\`\`
|
|
220
|
-
|
|
221
|
-
# ENV For Server => debug | debug.local | develop | develop.local | main | main.local
|
|
222
|
-
SERVER_ENV=debug.local
|
|
223
|
-
# Run Mode For Server => federation | batch | all
|
|
224
|
-
SERVER_MODE=federation
|
|
225
|
-
# ENV For Client => debug | debug.local | develop | develop.local | main | main.local
|
|
226
|
-
AKAN_PUBLIC_CLIENT_ENV=debug.local
|
|
227
|
-
ANALYZE=false
|
|
228
|
-
EOF
|
|
229
|
-
|
|
209
|
+
${ApplicationReleasePackager.#envSetup}
|
|
230
210
|
akan start ${this.#app.name}
|
|
231
211
|
\`\`\`
|
|
232
212
|
|
package/buildBatch.proc.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ApplicationBuildReporter
|
|
4
|
+
} from "./index-khpfpcsd.js";
|
|
2
5
|
import {
|
|
3
6
|
WorkspaceExecutor,
|
|
4
7
|
AppExecutor
|
|
5
|
-
} from "./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-6wwzs1bc.js";
|
|
8
|
+
} from "./index-9d9bgcx4.js";
|
|
9
|
+
import"./index-5b6tavv3.js";
|
|
8
10
|
import {
|
|
9
11
|
CssCompiler,
|
|
10
12
|
PagesBundleBuilder,
|
|
11
13
|
CsrArtifactBuilder,
|
|
12
14
|
FontOptimizer,
|
|
13
15
|
SsrBaseArtifactBuilder
|
|
14
|
-
} from "./index-
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-hwkygn9s.js";
|
|
16
|
+
} from "./index-ddxvdd1p.js";
|
|
17
|
+
import"./index-fgq75haa.js";
|
|
17
18
|
import"./index-n68jx79w.js";
|
|
18
19
|
|
|
19
20
|
// pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
|
|
@@ -56,6 +57,13 @@ class BuildBatch {
|
|
|
56
57
|
}
|
|
57
58
|
});
|
|
58
59
|
}
|
|
60
|
+
#fail(need, label, err) {
|
|
61
|
+
const message = ApplicationBuildReporter.formatError(err, this.#request.workspaceRoot);
|
|
62
|
+
this.#logger.error(`${label} failed: ${message}`);
|
|
63
|
+
this.#result.errors[need] = message;
|
|
64
|
+
if (need !== "base")
|
|
65
|
+
this.#emitStatus(need, message);
|
|
66
|
+
}
|
|
59
67
|
async#buildBase() {
|
|
60
68
|
const started = Date.now();
|
|
61
69
|
try {
|
|
@@ -64,9 +72,7 @@ class BuildBatch {
|
|
|
64
72
|
this.#result.optimizedFonts = optimizedFonts;
|
|
65
73
|
this.#logger.verbose(`base-artifact ok buildId=${artifact.pagesBundleBuildId} (${Date.now() - started}ms)`);
|
|
66
74
|
} catch (err) {
|
|
67
|
-
|
|
68
|
-
this.#logger.error(`base-artifact failed: ${message}`);
|
|
69
|
-
this.#result.errors.base = message;
|
|
75
|
+
this.#fail("base", "base-artifact", err);
|
|
70
76
|
}
|
|
71
77
|
}
|
|
72
78
|
async#buildCsr() {
|
|
@@ -76,10 +82,7 @@ class BuildBatch {
|
|
|
76
82
|
this.#logger.verbose(`csr-rebundle ok (${Date.now() - started}ms)`);
|
|
77
83
|
this.#emitStatus("csr");
|
|
78
84
|
} catch (err) {
|
|
79
|
-
|
|
80
|
-
this.#logger.error(`csr-rebundle failed: ${message}`);
|
|
81
|
-
this.#result.errors.csr = message;
|
|
82
|
-
this.#emitStatus("csr", message);
|
|
85
|
+
this.#fail("csr", "csr-rebundle", err);
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
async#buildPages() {
|
|
@@ -98,10 +101,7 @@ class BuildBatch {
|
|
|
98
101
|
this.#emitStatus("pages");
|
|
99
102
|
this.#logger.verbose(`pages-rebundle ok buildId=${next.buildId} (${Date.now() - started}ms)`);
|
|
100
103
|
} catch (err) {
|
|
101
|
-
|
|
102
|
-
this.#logger.error(`pages-rebundle failed: ${message}`);
|
|
103
|
-
this.#result.errors.pages = message;
|
|
104
|
-
this.#emitStatus("pages", message);
|
|
104
|
+
this.#fail("pages", "pages-rebundle", err);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
async#buildCss() {
|
|
@@ -143,10 +143,7 @@ ${cssText}`).toString(36);
|
|
|
143
143
|
});
|
|
144
144
|
this.#logger.verbose(`css-compile ok assets=${Object.keys(cssAssets).length} (${Date.now() - started}ms)`);
|
|
145
145
|
} catch (err) {
|
|
146
|
-
|
|
147
|
-
this.#logger.error(`css-rebuild failed: ${message}`);
|
|
148
|
-
this.#result.errors.css = message;
|
|
149
|
-
this.#emitStatus("css", message);
|
|
146
|
+
this.#fail("css", "css-rebuild", err);
|
|
150
147
|
}
|
|
151
148
|
}
|
|
152
149
|
async#optimizeFonts() {
|
|
@@ -162,8 +159,6 @@ ${cssText}`).toString(36);
|
|
|
162
159
|
return optimizedFonts;
|
|
163
160
|
}
|
|
164
161
|
static #shouldReoptimizeFonts(previous, changedFiles) {
|
|
165
|
-
if (changedFiles.length === 0)
|
|
166
|
-
return false;
|
|
167
162
|
return changedFiles.some((file) => {
|
|
168
163
|
const normalized = path.resolve(file);
|
|
169
164
|
if (/\.(woff2?|ttf|otf)$/i.test(normalized))
|
|
@@ -187,7 +182,7 @@ ${cssText}`).toString(36);
|
|
|
187
182
|
process.send?.({ type: "build-batch-result", data: result });
|
|
188
183
|
}
|
|
189
184
|
}
|
|
190
|
-
BuildBatch.main().catch((err) => {
|
|
185
|
+
await BuildBatch.main().catch((err) => {
|
|
191
186
|
console.error(err);
|
|
192
187
|
process.exit(1);
|
|
193
188
|
});
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
isPlaceholderAppId2,
|
|
4
4
|
CapacitorApp2
|
|
5
|
-
} from "./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-q0y2jq9j.js";
|
|
5
|
+
} from "./index-mxav6j3c.js";
|
|
6
|
+
import"./index-9d9bgcx4.js";
|
|
7
|
+
import"./index-5b6tavv3.js";
|
|
9
8
|
export {
|
|
10
9
|
CapacitorApp2 as CapacitorApp,
|
|
11
10
|
isPlaceholderAppId2 as isPlaceholderAppId
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./index-5b6tavv3.js";
|
|
3
|
+
import {
|
|
4
|
+
GlobalConfig
|
|
5
|
+
} from "./index-22d57v4c.js";
|
|
6
|
+
import {
|
|
7
|
+
Workspace,
|
|
8
|
+
command
|
|
9
|
+
} from "./index-w2zdcw3k.js";
|
|
10
|
+
import"./index-9d9bgcx4.js";
|
|
11
|
+
import {
|
|
12
|
+
PlatformTestRun
|
|
13
|
+
} from "./index-axzjaqve.js";
|
|
14
|
+
import"./index-khpfpcsd.js";
|
|
15
|
+
import"./index-5pc1qrbv.js";
|
|
16
|
+
import"./index-ww4z397j.js";
|
|
17
|
+
import"./index-7md2g9vw.js";
|
|
18
|
+
import"./index-3t7g9e4r.js";
|
|
19
|
+
import"./index-as7xmyz8.js";
|
|
20
|
+
import {
|
|
21
|
+
CloudScript2
|
|
22
|
+
} from "./index-8sf7wmdr.js";
|
|
23
|
+
import"./index-xqjwd384.js";
|
|
24
|
+
|
|
25
|
+
// pkgs/@akanjs/cli/cloud/cloud.command.ts
|
|
26
|
+
var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
|
|
27
|
+
var resolveRegistryUrl = (registry) => registry === "local" ? localRegistryUrl() : undefined;
|
|
28
|
+
|
|
29
|
+
class CloudCommand extends command("cloud", [CloudScript2], ({ public: target }) => ({
|
|
30
|
+
login: target({ desc: "Login to Akan Cloud services" }).option("host", String, { desc: "host of the cloud", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
|
|
31
|
+
await this.cloudScript.login(workspace, host);
|
|
32
|
+
}),
|
|
33
|
+
logout: target({ desc: "Logout from Akan Cloud services" }).option("host", String, { desc: "host of the cloud", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
|
|
34
|
+
await this.cloudScript.logout(workspace, host);
|
|
35
|
+
}),
|
|
36
|
+
deployAkan: target({ devOnly: true, desc: "Deploy Akan.js framework to cloud (internal use)" }).option("test", Boolean, { desc: "test the deployment", default: true }).option("registry", String, {
|
|
37
|
+
desc: "registry target for publishing Akan packages",
|
|
38
|
+
ask: "Select a registry target",
|
|
39
|
+
enum: [
|
|
40
|
+
{ label: "local", value: "local" },
|
|
41
|
+
{ label: "npm", value: "npm" }
|
|
42
|
+
]
|
|
43
|
+
}).option("platforms", String, {
|
|
44
|
+
desc: "platforms to test on besides this machine, comma-separated: linux, windows (none to skip)",
|
|
45
|
+
default: "linux,windows"
|
|
46
|
+
}).with(Workspace).exec(async function(test, registry, platforms, workspace) {
|
|
47
|
+
await this.cloudScript.deployAkan(workspace, {
|
|
48
|
+
test,
|
|
49
|
+
registryUrl: resolveRegistryUrl(registry),
|
|
50
|
+
platforms: PlatformTestRun.parsePlatforms(platforms)
|
|
51
|
+
});
|
|
52
|
+
}),
|
|
53
|
+
testPlatforms: target({
|
|
54
|
+
devOnly: true,
|
|
55
|
+
desc: "Run the Akan package suites on Linux (Docker) and Windows (SSH) against a snapshot of this tree"
|
|
56
|
+
}).option("platforms", String, {
|
|
57
|
+
desc: "platforms to test on, comma-separated: linux, windows",
|
|
58
|
+
default: "linux,windows"
|
|
59
|
+
}).option("pkgs", String, {
|
|
60
|
+
flag: "k",
|
|
61
|
+
desc: "packages to test, comma-separated (default: every Akan package)",
|
|
62
|
+
nullable: true
|
|
63
|
+
}).with(Workspace).exec(async function(platforms, pkgs, workspace) {
|
|
64
|
+
await this.cloudScript.testPlatforms(workspace, {
|
|
65
|
+
platforms: PlatformTestRun.parsePlatforms(platforms),
|
|
66
|
+
pkgs: pkgs?.split(",").map((pkg) => pkg.trim()).filter(Boolean)
|
|
67
|
+
});
|
|
68
|
+
}),
|
|
69
|
+
update: target({ desc: "Update Akan.js framework to the latest version" }).with(Workspace).option("tag", String, {
|
|
70
|
+
desc: "tag of the update",
|
|
71
|
+
default: "latest",
|
|
72
|
+
enum: ["latest", "dev", "canary", "beta", "rc", "alpha"]
|
|
73
|
+
}).option("registry", String, {
|
|
74
|
+
desc: "registry target for resolving Akan packages",
|
|
75
|
+
ask: "Select a registry target",
|
|
76
|
+
enum: [
|
|
77
|
+
{ label: "npm", value: "npm" },
|
|
78
|
+
{ label: "local", value: "local" }
|
|
79
|
+
],
|
|
80
|
+
default: process.env.USE_AKANJS_PKGS === "true" ? undefined : "npm"
|
|
81
|
+
}).exec(async function(workspace, tag, registry) {
|
|
82
|
+
await this.cloudScript.update(workspace, tag, { registryUrl: resolveRegistryUrl(registry) });
|
|
83
|
+
}),
|
|
84
|
+
downloadEnv: target({ desc: "Download environment variables from cloud or SCP server" }).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
|
|
85
|
+
await this.cloudScript.downloadEnv(workspace, undefined, { host });
|
|
86
|
+
}),
|
|
87
|
+
uploadEnv: target({ desc: "Upload environment variables to cloud or SCP server" }).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
|
|
88
|
+
await this.cloudScript.uploadEnv(workspace, { host });
|
|
89
|
+
})
|
|
90
|
+
})) {
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
CloudCommand
|
|
94
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
CloudScript2
|
|
4
|
+
} from "./index-8sf7wmdr.js";
|
|
5
|
+
import"./index-axzjaqve.js";
|
|
6
|
+
import"./index-ww4z397j.js";
|
|
7
|
+
import"./index-xqjwd384.js";
|
|
8
|
+
import"./index-5pc1qrbv.js";
|
|
9
|
+
import"./index-as7xmyz8.js";
|
|
10
|
+
import"./index-22d57v4c.js";
|
|
11
|
+
import"./index-w2zdcw3k.js";
|
|
12
|
+
import"./index-7md2g9vw.js";
|
|
13
|
+
import"./index-khpfpcsd.js";
|
|
14
|
+
import"./index-9d9bgcx4.js";
|
|
15
|
+
import"./index-3t7g9e4r.js";
|
|
16
|
+
import"./index-5b6tavv3.js";
|
|
17
|
+
export {
|
|
18
|
+
CloudScript2 as CloudScript
|
|
19
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
Workspace,
|
|
4
|
+
runner,
|
|
5
|
+
script,
|
|
6
|
+
command
|
|
7
|
+
} from "./index-w2zdcw3k.js";
|
|
8
|
+
import"./index-5b6tavv3.js";
|
|
9
|
+
import"./index-9d9bgcx4.js";
|
|
10
|
+
import {
|
|
11
|
+
akanCodeDefaultModel2,
|
|
12
|
+
CodeAgentStreamPrinter2
|
|
13
|
+
} from "./index-c6eggbee.js";
|
|
14
|
+
|
|
15
|
+
// pkgs/@akanjs/cli/code/code.runner.ts
|
|
16
|
+
import { codeAgentPresets, isCodeAgentPresetName } from "akanjs/common";
|
|
17
|
+
|
|
18
|
+
class CodeRunner extends runner("code") {
|
|
19
|
+
async serve(options, listen) {
|
|
20
|
+
await import("./consoleToStderr-h5bryj94.js");
|
|
21
|
+
const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
|
|
22
|
+
import("./CodeAgent-awv258wb.js"),
|
|
23
|
+
import("./CodeAgentRpcHost-p7h6n2hp.js"),
|
|
24
|
+
import("./CodeAgentRpcListener-7p7z5dd7.js")
|
|
25
|
+
]);
|
|
26
|
+
const address = listen ? CodeAgentRpcListener.parse(listen) : null;
|
|
27
|
+
const agent = await CodeAgent.create({ ...await CodeRunner.#agentOptions(options, true), mode: "rpc" });
|
|
28
|
+
if (!address)
|
|
29
|
+
return await new CodeAgentRpcHost(agent).serve();
|
|
30
|
+
const listener = new CodeAgentRpcListener(new CodeAgentRpcHost(agent, null), address).listen();
|
|
31
|
+
process.stderr.write(`akan code rpc listening on ${"unix" in address ? address.unix : `${address.hostname}:${listener.port}`}
|
|
32
|
+
`);
|
|
33
|
+
await listener.serve();
|
|
34
|
+
}
|
|
35
|
+
async tui(options, seed) {
|
|
36
|
+
const [{ CodeAgent }, { CodeTui }] = await Promise.all([
|
|
37
|
+
import("./CodeAgent-awv258wb.js"),
|
|
38
|
+
import("./CodeTui-1nqh35ez.js")
|
|
39
|
+
]);
|
|
40
|
+
const agentOptions = await CodeRunner.#agentOptions(options, false);
|
|
41
|
+
let resume = options.resume;
|
|
42
|
+
let prompt = seed;
|
|
43
|
+
let notice;
|
|
44
|
+
for (;; ) {
|
|
45
|
+
const agent = await CodeAgent.create({ ...agentOptions, mode: "tui", ...resume ? { resume } : {} });
|
|
46
|
+
let next;
|
|
47
|
+
try {
|
|
48
|
+
next = await new CodeTui(agent, {
|
|
49
|
+
thinking: options.thinking,
|
|
50
|
+
...notice ? { notice } : {}
|
|
51
|
+
}).run(prompt);
|
|
52
|
+
} finally {
|
|
53
|
+
agent.dispose();
|
|
54
|
+
}
|
|
55
|
+
if (!next)
|
|
56
|
+
return;
|
|
57
|
+
resume = next.id;
|
|
58
|
+
notice = next.notice;
|
|
59
|
+
prompt = "";
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async run(prompt, options) {
|
|
63
|
+
const { CodeAgent } = await import("./CodeAgent-awv258wb.js");
|
|
64
|
+
const agent = await CodeAgent.create(await CodeRunner.#agentOptions(options, false));
|
|
65
|
+
const printer = new CodeAgentStreamPrinter2({ json: options.json, thinking: options.thinking });
|
|
66
|
+
agent.on((event) => printer.print(event));
|
|
67
|
+
agent.announce();
|
|
68
|
+
try {
|
|
69
|
+
await agent.prompt(prompt);
|
|
70
|
+
await agent.waitForIdle();
|
|
71
|
+
} finally {
|
|
72
|
+
printer.finish();
|
|
73
|
+
agent.dispose();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
static async#agentOptions(options, hostAttached) {
|
|
77
|
+
const profile = CodeRunner.profileOf(options, { hostAttached });
|
|
78
|
+
return {
|
|
79
|
+
workspace: options.workspace,
|
|
80
|
+
cwd: profile.paths.root,
|
|
81
|
+
profile,
|
|
82
|
+
apps: options.app ? [options.app] : await options.workspace.getApps(),
|
|
83
|
+
model: CodeRunner.modelOf(options.model)
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
static profileOf(options, { hostAttached }) {
|
|
87
|
+
if (!isCodeAgentPresetName(options.profile))
|
|
88
|
+
throw new Error(`Unknown profile: ${options.profile}. Use local, pod, review, or web.`);
|
|
89
|
+
const root = options.app ? `${options.workspace.workspaceRoot}/apps/${options.app}` : options.workspace.workspaceRoot;
|
|
90
|
+
const profile = codeAgentPresets[options.profile](root);
|
|
91
|
+
return { ...profile, ui: { ...profile.ui, canPrompt: CodeRunner.canPrompt(profile, hostAttached) } };
|
|
92
|
+
}
|
|
93
|
+
static canPrompt(profile, hostAttached) {
|
|
94
|
+
const forced = process.env.AKAN_CODE_CAN_PROMPT;
|
|
95
|
+
if (forced === "1")
|
|
96
|
+
return true;
|
|
97
|
+
if (forced === "0")
|
|
98
|
+
return false;
|
|
99
|
+
return hostAttached || profile.ui.canPrompt;
|
|
100
|
+
}
|
|
101
|
+
static modelOf(model) {
|
|
102
|
+
if (!model)
|
|
103
|
+
return;
|
|
104
|
+
const [provider, ...rest] = model.split("/");
|
|
105
|
+
if (!provider || !rest.length)
|
|
106
|
+
throw new Error(`Model must be "<provider>/<id>", e.g. ${akanCodeDefaultModel2.provider}/${akanCodeDefaultModel2.id}`);
|
|
107
|
+
return { provider, id: rest.join("/") };
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// pkgs/@akanjs/cli/code/code.script.ts
|
|
112
|
+
class CodeScript extends script("code", [CodeRunner]) {
|
|
113
|
+
async run(workspace, prompt, options) {
|
|
114
|
+
const run = {
|
|
115
|
+
workspace,
|
|
116
|
+
...options.app ? { app: options.app } : {},
|
|
117
|
+
profile: options.profile,
|
|
118
|
+
...options.model ? { model: options.model } : {},
|
|
119
|
+
json: options.json,
|
|
120
|
+
thinking: options.thinking,
|
|
121
|
+
...options.resume ? { resume: options.resume } : {}
|
|
122
|
+
};
|
|
123
|
+
if (options.rpcListen)
|
|
124
|
+
return await this.codeRunner.serve(run, options.rpcListen);
|
|
125
|
+
if (options.rpc)
|
|
126
|
+
return await this.codeRunner.serve(run);
|
|
127
|
+
const interactive = options.interactive || !prompt.trim() && !options.json && !!process.stdout.isTTY;
|
|
128
|
+
if (interactive)
|
|
129
|
+
return await this.codeRunner.tui(run, prompt);
|
|
130
|
+
if (!prompt.trim())
|
|
131
|
+
throw new Error('akan code needs a prompt when it has no terminal: akan code "add a comment module"');
|
|
132
|
+
await this.codeRunner.run(prompt, run);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// pkgs/@akanjs/cli/code/code.command.ts
|
|
137
|
+
class CodeCommand extends command("code", [CodeScript], ({ public: target }) => ({
|
|
138
|
+
code: target({ desc: "Run the akan coding agent on a prompt" }).arg("prompt", String, { desc: "what the agent should do", nullable: true }).option("app", String, { desc: "narrow the agent to one app instead of the whole repo", nullable: true }).option("profile", String, { desc: "local, pod, review, or web", default: "local" }).option("model", String, { desc: "<provider>/<id>, e.g. deepseek/deepseek-flash", nullable: true }).option("json", Boolean, { desc: "print one event per line as JSON", default: false }).option("thinking", Boolean, { desc: "print the model's reasoning", default: false }).option("rpc", Boolean, { desc: "serve the agent over stdio for another process to drive", default: false }).option("rpcListen", String, {
|
|
139
|
+
desc: "serve the RPC wire on unix:<path> or tcp:[host:]<port> instead of stdio",
|
|
140
|
+
flag: "L",
|
|
141
|
+
nullable: true
|
|
142
|
+
}).option("resume", String, { desc: "continue a stored session by id", flag: "R", nullable: true }).option("interactive", Boolean, {
|
|
143
|
+
desc: "open the full-screen session even when a prompt is given",
|
|
144
|
+
flag: "i",
|
|
145
|
+
default: false
|
|
146
|
+
}).with(Workspace).exec(async function(prompt, app, profile, model, json, thinking, rpc, rpcListen, resume, interactive, workspace) {
|
|
147
|
+
const options = { app, profile, model, json, thinking, rpc, rpcListen, interactive, resume };
|
|
148
|
+
await this.codeScript.run(workspace, prompt ?? "", options);
|
|
149
|
+
})
|
|
150
|
+
})) {
|
|
151
|
+
}
|
|
152
|
+
export {
|
|
153
|
+
CodeCommand
|
|
154
|
+
};
|
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","plan-slice":"application","sync":"application","
|
|
1
|
+
{"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","console":"application","logs":"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","db-export":"application","db-import":"application","dbdown":"application","configure-app":"application","create-library":"library","remove-library":"library","sync-library":"library","library-status":"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","deploy-akan":"cloud","test-platforms":"cloud","update":"cloud","download-env":"cloud","upload-env":"cloud","subspace":"subspace","guideline":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","repair":"repair","workflow":"workflow","tunnel":"tunnel"}}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
Workspace,
|
|
4
|
+
command
|
|
5
|
+
} from "./index-w2zdcw3k.js";
|
|
6
|
+
import"./index-5b6tavv3.js";
|
|
7
|
+
import"./index-9d9bgcx4.js";
|
|
8
|
+
import"./index-hj6w4ka1.js";
|
|
9
|
+
import"./index-myhc3c1j.js";
|
|
10
|
+
import"./index-ygn77a5w.js";
|
|
11
|
+
import"./index-nv5976x3.js";
|
|
12
|
+
import"./index-mxav6j3c.js";
|
|
13
|
+
import"./index-0bq14vr1.js";
|
|
14
|
+
import"./index-31yr441d.js";
|
|
15
|
+
import"./index-dzf3r49a.js";
|
|
16
|
+
import"./index-8mna0947.js";
|
|
17
|
+
import"./index-przybvy5.js";
|
|
18
|
+
import"./index-3sq321ak.js";
|
|
19
|
+
import"./index-xqpzbab5.js";
|
|
20
|
+
import {
|
|
21
|
+
ContextScript
|
|
22
|
+
} from "./index-13ffe9wp.js";
|
|
23
|
+
|
|
24
|
+
// pkgs/@akanjs/cli/context/context.command.ts
|
|
25
|
+
class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
|
|
26
|
+
context: target({ desc: "Print agent-readable Akan workspace context" }).option("format", String, { desc: "output format", default: "markdown", enum: ["markdown", "json"] }).option("app", String, { desc: "app name to include", nullable: true }).option("module", String, { desc: "module name to include with abstract content", nullable: true }).with(Workspace).exec(async function(format, app, module, workspace) {
|
|
27
|
+
await this.contextScript.context(workspace, { format, app, module });
|
|
28
|
+
}),
|
|
29
|
+
doctor: target({ desc: "Report Akan workspace convention diagnostics" }).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).option("strict", Boolean, { desc: "treat recommended conventions as errors", default: false }).option("ios", Boolean, {
|
|
30
|
+
desc: "report iOS/mobile config diagnostics (placeholder bundle ids, etc.)",
|
|
31
|
+
default: false
|
|
32
|
+
}).with(Workspace).exec(async function(format, strict, ios, workspace) {
|
|
33
|
+
await this.contextScript.doctor(workspace, { format, strict, ios });
|
|
34
|
+
}),
|
|
35
|
+
mcpInstall: target({ desc: "Install the Akan MCP server config for Cursor, Claude Code, and Codex" }).arg("target", String, { desc: "cursor, claude, codex, or all", nullable: true }).option("force", Boolean, { desc: "overwrite an existing Akan MCP server entry", default: false }).option("mode", String, { desc: "MCP permission mode", default: "apply", enum: ["readonly", "plan", "apply"] }).with(Workspace).exec(async function(targetName, force, mode, workspace) {
|
|
36
|
+
await this.contextScript.mcpInstall(workspace, targetName, { force, mode });
|
|
37
|
+
}),
|
|
38
|
+
mcp: target({ desc: "Start the Akan MCP server over stdio", stdio: true }).option("mode", String, { desc: "MCP permission mode", default: "readonly", enum: ["readonly", "plan", "apply"] }).with(Workspace).exec(async function(mode, workspace) {
|
|
39
|
+
await this.contextScript.mcp(workspace, { mode });
|
|
40
|
+
}),
|
|
41
|
+
mcpCall: target({ desc: "Call one Akan MCP tool for debugging without stdio JSON-RPC" }).arg("tool", String, { desc: "MCP tool name" }).option("mode", String, { desc: "MCP permission mode", default: "readonly", enum: ["readonly", "plan", "apply"] }).option("args", String, { desc: "JSON object to pass as MCP tool arguments", nullable: true }).option("format", String, { desc: "output format", default: "json", enum: ["json"] }).with(Workspace).exec(async function(tool, mode, args, format, workspace) {
|
|
42
|
+
await this.contextScript.mcpCall(workspace, tool, { mode, args, format });
|
|
43
|
+
})
|
|
44
|
+
})) {
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
ContextCommand
|
|
48
|
+
};
|