@akanjs/cli 3.1.0-rc.20 → 3.1.0-rc.22
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-n3tzjm91.js → CodeAgent-fee0pnwp.js} +2 -2
- package/{CodeTui-fnm9ft4d.js → CodeTui-xh71b2k8.js} +1 -1
- package/TunnelShare-s7bpe55e.js +14 -0
- package/{agent.command-3qxf4xcj.js → agent.command-tge9rvmt.js} +5 -5
- package/akanCode.js +2 -2
- package/{application.command-zfja7x4r.js → application.command-j5b8yrcf.js} +35 -9
- package/{applicationBuildRunner-vh4j6vdv.js → applicationBuildRunner-s41mgz21.js} +21 -7
- package/buildBatch.proc.js +9 -9
- package/{cloud.command-fcc8e8tp.js → cloud.command-q9srng6e.js} +13 -13
- package/cloud.script-vfsd4gxs.js +24 -0
- package/{code.command-130bdmhe.js → code.command-n6r6zt97.js} +6 -6
- package/commandManifest.json +1 -1
- package/{context.command-0qx447mb.js → context.command-1je84w1b.js} +16 -16
- package/context.runner-xg0ngz93.js +25 -0
- package/{guideline.command-cv5bmrx2.js → guideline.command-0e0sx2vg.js} +2 -2
- package/guidelines/conventions/conventions.instruction.md +42 -13
- package/guidelines/mcpRule/mcpRule.instruction.md +88 -47
- package/guidelines/pageRule/pageRule.instruction.md +53 -8
- package/guidelines/runtimeRule/runtimeRule.instruction.md +8 -1
- package/guidelines/ssrRule/ssrRule.instruction.md +8 -5
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +1 -1
- package/incrementalBuilder.proc.js +3 -3
- package/{index-fmzcs8v6.js → index-1bhv9dh4.js} +4 -4
- package/{index-qtfmtcrw.js → index-1xqq3va9.js} +71 -18
- package/{index-86jt2a0e.js → index-3xhak9e0.js} +1 -1
- package/{index-tamvyvj3.js → index-4fe4qqgn.js} +3 -3
- package/{index-g1mbppa9.js → index-551gh8h2.js} +5 -5
- package/{index-trpasv9q.js → index-5m0s0gdv.js} +1 -1
- package/index-6mprvdt8.js +566 -0
- package/{index-192ha4xh.js → index-6nqnqzv1.js} +1 -1
- package/{index-dye8pnxx.js → index-73esn3y2.js} +1 -1
- package/{index-4mhy6qme.js → index-7xy30jev.js} +4 -4
- package/{index-1xj2t7cb.js → index-85h3dhe0.js} +7 -7
- package/{index-axs61rna.js → index-8abyrfw8.js} +5 -4
- package/{index-1p98exm2.js → index-94jq9cbz.js} +2 -2
- package/{index-cpb3nvma.js → index-9h0z0tjr.js} +2 -2
- package/{index-hsadfb6c.js → index-c9rfak6r.js} +7 -7
- package/{index-w44cy4vs.js → index-cgyqx6q1.js} +2 -2
- package/{index-d72hfmdm.js → index-cq5x7a9k.js} +8 -8
- package/{index-j237xtew.js → index-deckcwbg.js} +2 -2
- package/{index-vk0pa0mn.js → index-ex35dg39.js} +2 -1
- package/{index-35hc95h5.js → index-f9118j70.js} +1 -1
- package/{index-jw1zm273.js → index-g5px5pxd.js} +53 -9
- package/{index-va06nr10.js → index-gxqvev8w.js} +52 -12
- package/{index-fyq1z6kt.js → index-hagw9c94.js} +3 -3
- package/{index-pydbnfez.js → index-p44jnjfr.js} +2 -2
- package/{index-awbdfcf2.js → index-rp9anyeb.js} +4 -4
- package/{index-j4mkhz93.js → index-t8npm331.js} +3 -3
- package/{index-5edzv8fn.js → index-tbmtmkhx.js} +2 -2
- package/{index-1djcjcre.js → index-vyh8kemm.js} +3 -3
- package/{index-qwa5k1j8.js → index-x7bny3wv.js} +1 -1
- package/index.js +22 -22
- package/{library.command-erp2f56n.js → library.command-ys9s0mtc.js} +3 -3
- package/{localRegistry.command-hj3p16p5.js → localRegistry.command-kmp3sd47.js} +12 -12
- package/{module.command-gs2r615e.js → module.command-5sx9453y.js} +5 -5
- package/{package.command-j10r76ax.js → package.command-s0d3417k.js} +3 -3
- package/package.json +2 -2
- package/{page.command-4h4a8pnh.js → page.command-zsa03pmc.js} +3 -3
- package/{pipeline.command-a2nrk26m.js → pipeline.command-j8h6qsha.js} +2 -2
- package/{primitive.command-w6t0asqz.js → primitive.command-n2978nmw.js} +6 -6
- package/{projectTypecheck-f534enqj.js → projectTypecheck-qg2jf80j.js} +1 -1
- package/{quality.command-77x7vbbx.js → quality.command-7kgz46st.js} +2 -2
- package/{repair.command-y6sstev7.js → repair.command-2sszcckw.js} +5 -5
- package/{routeSourceValidator-7ycnfz0e.js → routeSourceValidator-6jd0q6r6.js} +47 -14
- package/{scalar.command-20b8cy0k.js → scalar.command-230jrhzf.js} +4 -4
- package/{subspace.command-baz73jpk.js → subspace.command-y5v4ypd3.js} +8 -8
- package/templates/migration/__migrationId__.ts +23 -0
- package/templates/server.ts +8 -1
- package/{tunnel.command-2kw8vt9g.js → tunnel.command-ja29zghd.js} +7 -7
- package/{workflow.command-2djwmpqf.js → workflow.command-0eg8czt5.js} +10 -10
- package/{workspace.command-jqs7vjhe.js → workspace.command-zcym1dk5.js} +24 -24
- package/TunnelShare-661cxz5e.js +0 -14
- package/cloud.script-1xt3tnts.js +0 -24
- package/context.runner-1vsjztjg.js +0 -25
- package/index-665zp9rs.js +0 -271
package/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ff52b306f8c96b86a1bb9a1ea7d4a3a02deeb65d3184e77f02398b6eab82b052
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
TunnelShare2
|
|
4
|
+
} from "./index-x7bny3wv.js";
|
|
5
|
+
import"./index-9h0z0tjr.js";
|
|
6
|
+
import"./index-551gh8h2.js";
|
|
7
|
+
import"./index-m9jj544v.js";
|
|
8
|
+
import"./index-6mprvdt8.js";
|
|
9
|
+
import"./index-6nqnqzv1.js";
|
|
10
|
+
import"./index-gxqvev8w.js";
|
|
11
|
+
import"./index-52w0fvh8.js";
|
|
12
|
+
export {
|
|
13
|
+
TunnelShare2 as TunnelShare
|
|
14
|
+
};
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-g5px5pxd.js";
|
|
6
6
|
import"./index-52w0fvh8.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-gxqvev8w.js";
|
|
8
8
|
import"./index-hj6w4ka1.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
import"./index-5m0s0gdv.js";
|
|
10
|
+
import"./index-tbmtmkhx.js";
|
|
11
11
|
import"./index-zzvvc845.js";
|
|
12
12
|
import {
|
|
13
13
|
AgentScript
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-4fe4qqgn.js";
|
|
15
15
|
|
|
16
16
|
// pkgs/@akanjs/cli/agent/agent.command.ts
|
|
17
17
|
class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
|
package/akanCode.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
CodeMailbox2,
|
|
29
29
|
CodeSessionFork2,
|
|
30
30
|
CodeAgent2
|
|
31
|
-
} from "./index-
|
|
31
|
+
} from "./index-vyh8kemm.js";
|
|
32
32
|
import {
|
|
33
33
|
akanCodeDefaultModel2,
|
|
34
34
|
akanCodeModel2,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
SubagentPool2,
|
|
41
41
|
akanCodePaths2,
|
|
42
42
|
AkanCodeCompaction2
|
|
43
|
-
} from "./index-
|
|
43
|
+
} from "./index-73esn3y2.js";
|
|
44
44
|
import"./index-7md2g9vw.js";
|
|
45
45
|
import {
|
|
46
46
|
CodeAgentRpcHost2
|
|
@@ -7,18 +7,19 @@ import {
|
|
|
7
7
|
Exec,
|
|
8
8
|
Workspace,
|
|
9
9
|
command
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-g5px5pxd.js";
|
|
11
11
|
import"./index-52w0fvh8.js";
|
|
12
|
-
import"./index-
|
|
12
|
+
import"./index-gxqvev8w.js";
|
|
13
13
|
import"./index-5nd1wtkv.js";
|
|
14
|
-
import"./index-
|
|
14
|
+
import"./index-ex35dg39.js";
|
|
15
15
|
import"./index-m9jj544v.js";
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
16
|
+
import"./index-551gh8h2.js";
|
|
17
|
+
import"./index-6mprvdt8.js";
|
|
18
|
+
import"./index-6nqnqzv1.js";
|
|
19
|
+
import"./index-p44jnjfr.js";
|
|
19
20
|
import {
|
|
20
21
|
ApplicationScript
|
|
21
|
-
} from "./index-
|
|
22
|
+
} from "./index-1xqq3va9.js";
|
|
22
23
|
import"./index-7md2g9vw.js";
|
|
23
24
|
import {
|
|
24
25
|
writeOption,
|
|
@@ -27,10 +28,11 @@ import {
|
|
|
27
28
|
allowLocalOption,
|
|
28
29
|
publicEnvOption
|
|
29
30
|
} from "./index-mdjc93e1.js";
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-665zp9rs.js";
|
|
31
|
+
import"./index-f9118j70.js";
|
|
32
32
|
|
|
33
33
|
// pkgs/@akanjs/cli/application/application.command.ts
|
|
34
|
+
import { MigrationCommand } from "akanjs/server/migration/migrationCommand";
|
|
35
|
+
import { MigrationError } from "akanjs/server/migration/migrationError";
|
|
34
36
|
var deviceOption = {
|
|
35
37
|
desc: "simulator, emulator or device to run on: its id or name (e.g. 'iPhone 17' or 'Pixel_10')",
|
|
36
38
|
default: ""
|
|
@@ -62,6 +64,30 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
|
|
|
62
64
|
script: target({ desc: "Run a custom script in the application" }).with(App).arg("filename", String, { desc: "name of script", nullable: true }).exec(async function(app, filename) {
|
|
63
65
|
await this.applicationScript.script(app, filename);
|
|
64
66
|
}),
|
|
67
|
+
migrate: target({
|
|
68
|
+
desc: "List, plan, apply, verify or roll back the app's data migrations in script/migration",
|
|
69
|
+
stdio: true,
|
|
70
|
+
usageExitCode: 2,
|
|
71
|
+
onFailure: async (error, { usage, given }) => {
|
|
72
|
+
if (given.json !== true)
|
|
73
|
+
return;
|
|
74
|
+
const failure = usage ? new MigrationError("usage", MigrationError.messageOf(error)) : error;
|
|
75
|
+
await MigrationCommand.print(MigrationCommand.failure(null, failure), true);
|
|
76
|
+
}
|
|
77
|
+
}).with(App).arg("action", String, { desc: "list, plan, apply, verify or rollback", default: "list" }).arg("target", String, { desc: "migration id; for rollback, an apply's run id too", nullable: true }).option("param", String, { desc: "a param the migration declares, as name=value", multiple: true }).option("expect", String, { desc: "the plan hash an apply must still match", nullable: true }).option("items", Number, { desc: "how many planned decisions to print", nullable: true }).option("actor", String, { desc: "who runs it, as the ledger records", nullable: true }).option("json", Boolean, { desc: "print the result as one JSON line", default: false }).exec(async function(app, action, target, param, expect, items, actor, json) {
|
|
78
|
+
await this.applicationScript.migrate(app, [
|
|
79
|
+
action,
|
|
80
|
+
...target ? [target] : [],
|
|
81
|
+
...param.map((each) => `--param=${each}`),
|
|
82
|
+
...expect ? [`--expect=${expect}`] : [],
|
|
83
|
+
...items === null ? [] : [`--items=${items}`],
|
|
84
|
+
...actor ? [`--actor=${actor}`] : [],
|
|
85
|
+
...json ? ["--json"] : []
|
|
86
|
+
]);
|
|
87
|
+
}),
|
|
88
|
+
createMigration: target({ desc: "Create a data migration in the app's script/migration" }).arg("migrationName", String, { desc: "what it does, in camelCase", example: "bizLicenseOwnership" }).with(App).exec(async function(migrationName, app) {
|
|
89
|
+
await this.applicationScript.createMigration(app, migrationName);
|
|
90
|
+
}),
|
|
65
91
|
console: target({ desc: "Open an interactive server console for the application" }).with(App).exec(async function(app) {
|
|
66
92
|
await this.applicationScript.console(app);
|
|
67
93
|
}),
|
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
Spinner,
|
|
5
5
|
ProjectTypecheck2,
|
|
6
6
|
WorkspaceExecutor
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-gxqvev8w.js";
|
|
8
8
|
import"./index-52w0fvh8.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
import"./index-cgyqx6q1.js";
|
|
10
|
+
import"./index-6nqnqzv1.js";
|
|
11
11
|
import {
|
|
12
12
|
AllRoutesBuilder,
|
|
13
13
|
FontPruner,
|
|
14
14
|
precompressArtifacts,
|
|
15
15
|
SsrBaseArtifactBuilder
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-62md4dwy.js";
|
|
16
|
+
} from "./index-8abyrfw8.js";
|
|
18
17
|
import {
|
|
19
18
|
CsrArtifactBuilder
|
|
20
|
-
} from "./index-
|
|
19
|
+
} from "./index-6mprvdt8.js";
|
|
20
|
+
import"./index-62md4dwy.js";
|
|
21
21
|
|
|
22
22
|
// pkgs/@akanjs/devkit/applicationBuildRunner.ts
|
|
23
23
|
import path2 from "path";
|
|
@@ -124,12 +124,26 @@ class ApplicationBuildRunner {
|
|
|
124
124
|
get #envDir() {
|
|
125
125
|
return path2.join(this.#app.cwdPath, "env");
|
|
126
126
|
}
|
|
127
|
+
#pinImageEnv(baseDevEnv, environment) {
|
|
128
|
+
const imageEnv = {
|
|
129
|
+
AKAN_PUBLIC_ENV: environment,
|
|
130
|
+
AKAN_PUBLIC_REPO_NAME: baseDevEnv.repoName,
|
|
131
|
+
AKAN_PUBLIC_SERVE_DOMAIN: baseDevEnv.serveDomain
|
|
132
|
+
};
|
|
133
|
+
const outranked = Object.entries(imageEnv).filter(([key, value]) => {
|
|
134
|
+
const given = process.env[key];
|
|
135
|
+
return !!given && given !== value && !(key === "AKAN_PUBLIC_ENV" && this.#environment);
|
|
136
|
+
});
|
|
137
|
+
if (outranked.length)
|
|
138
|
+
this.#app.logger.warn(`The workspace .env outranks this process's environment: the bundles and the image take ${outranked.map(([key, value]) => `${key}=${value} (not ${process.env[key]})`).join(", ")}.`);
|
|
139
|
+
Object.assign(process.env, imageEnv);
|
|
140
|
+
}
|
|
127
141
|
async build({ spinner = false } = {}) {
|
|
128
142
|
this.#spinner = spinner;
|
|
129
143
|
const { web, assets, baseDevEnv } = await this.#app.getConfig();
|
|
130
144
|
const environment = this.#environment ?? baseDevEnv.env;
|
|
131
145
|
WorkspaceExecutor.assertDeployableEnv(baseDevEnv, environment, "akan build");
|
|
132
|
-
|
|
146
|
+
this.#pinImageEnv(baseDevEnv, environment);
|
|
133
147
|
if (this.#profile)
|
|
134
148
|
await ServerEnvProfile.assertShippable({ envDir: this.#envDir, environment, profile: this.#profile });
|
|
135
149
|
await this.#runPhase("prepare", "Preparing output directory", () => this.#app.prepareCommand("build"));
|
package/buildBatch.proc.js
CHANGED
|
@@ -6,27 +6,27 @@ import {
|
|
|
6
6
|
resolveSsrPageEntriesForApp,
|
|
7
7
|
WorkspaceExecutor,
|
|
8
8
|
AppExecutor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-gxqvev8w.js";
|
|
10
10
|
import {
|
|
11
11
|
computeRouteSeedIndex,
|
|
12
12
|
saveRouteSeedIndex,
|
|
13
13
|
CsrDevBundler,
|
|
14
14
|
SsrDevBundler
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-cgyqx6q1.js";
|
|
16
16
|
import"./index-52w0fvh8.js";
|
|
17
17
|
import {
|
|
18
18
|
ServerGraphFile,
|
|
19
19
|
PagesBundleBuilder
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-6nqnqzv1.js";
|
|
21
21
|
import {
|
|
22
22
|
CssCompiler,
|
|
23
23
|
FontOptimizer,
|
|
24
24
|
SsrBaseArtifactBuilder
|
|
25
|
-
} from "./index-
|
|
26
|
-
import"./index-62md4dwy.js";
|
|
25
|
+
} from "./index-8abyrfw8.js";
|
|
27
26
|
import {
|
|
28
27
|
CsrArtifactBuilder
|
|
29
|
-
} from "./index-
|
|
28
|
+
} from "./index-6mprvdt8.js";
|
|
29
|
+
import"./index-62md4dwy.js";
|
|
30
30
|
|
|
31
31
|
// pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
|
|
32
32
|
import path from "path";
|
|
@@ -116,10 +116,10 @@ class BuildBatch {
|
|
|
116
116
|
async#buildShell() {
|
|
117
117
|
const started = Date.now();
|
|
118
118
|
try {
|
|
119
|
-
await new CsrArtifactBuilder(this.#app, "start", "en", { cssAssets: this.#request.cssAssets }).
|
|
120
|
-
this.#logger.verbose(`
|
|
119
|
+
await new CsrArtifactBuilder(this.#app, "start", "en", { cssAssets: this.#request.cssAssets }).buildMcpAppViews();
|
|
120
|
+
this.#logger.verbose(`mcp-app-views ok (${Date.now() - started}ms)`);
|
|
121
121
|
} catch (err) {
|
|
122
|
-
this.#fail("shell", "
|
|
122
|
+
this.#fail("shell", "mcp-app-views", err);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
async#rebuildCsrArtifact(started) {
|
|
@@ -3,26 +3,27 @@ import {
|
|
|
3
3
|
App,
|
|
4
4
|
Workspace,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-g5px5pxd.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
import"./index-gxqvev8w.js";
|
|
9
|
+
import"./index-9h0z0tjr.js";
|
|
10
10
|
import {
|
|
11
11
|
PlatformTestRun
|
|
12
|
-
} from "./index-
|
|
13
|
-
import"./index-
|
|
12
|
+
} from "./index-hagw9c94.js";
|
|
13
|
+
import"./index-ex35dg39.js";
|
|
14
14
|
import"./index-m9jj544v.js";
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
15
|
+
import"./index-551gh8h2.js";
|
|
16
|
+
import"./index-6mprvdt8.js";
|
|
17
|
+
import"./index-6nqnqzv1.js";
|
|
17
18
|
import"./index-5nd1wtkv.js";
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
19
|
+
import"./index-p44jnjfr.js";
|
|
20
|
+
import"./index-1xqq3va9.js";
|
|
20
21
|
import"./index-7md2g9vw.js";
|
|
21
22
|
import"./index-tvehn2sp.js";
|
|
22
|
-
import"./index-
|
|
23
|
+
import"./index-deckcwbg.js";
|
|
23
24
|
import {
|
|
24
25
|
CloudScript2
|
|
25
|
-
} from "./index-
|
|
26
|
+
} from "./index-c9rfak6r.js";
|
|
26
27
|
import {
|
|
27
28
|
writeOption,
|
|
28
29
|
oneNativeTargetOption,
|
|
@@ -33,8 +34,7 @@ import {
|
|
|
33
34
|
hostOption,
|
|
34
35
|
subspaceOption
|
|
35
36
|
} from "./index-mdjc93e1.js";
|
|
36
|
-
import"./index-
|
|
37
|
-
import"./index-665zp9rs.js";
|
|
37
|
+
import"./index-f9118j70.js";
|
|
38
38
|
|
|
39
39
|
// pkgs/@akanjs/cli/cloud/cloud.command.ts
|
|
40
40
|
var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
CloudScript2
|
|
4
|
+
} from "./index-c9rfak6r.js";
|
|
5
|
+
import"./index-hagw9c94.js";
|
|
6
|
+
import"./index-1xqq3va9.js";
|
|
7
|
+
import"./index-f9118j70.js";
|
|
8
|
+
import"./index-p44jnjfr.js";
|
|
9
|
+
import"./index-deckcwbg.js";
|
|
10
|
+
import"./index-ex35dg39.js";
|
|
11
|
+
import"./index-9h0z0tjr.js";
|
|
12
|
+
import"./index-551gh8h2.js";
|
|
13
|
+
import"./index-m9jj544v.js";
|
|
14
|
+
import"./index-g5px5pxd.js";
|
|
15
|
+
import"./index-7md2g9vw.js";
|
|
16
|
+
import"./index-6mprvdt8.js";
|
|
17
|
+
import"./index-5nd1wtkv.js";
|
|
18
|
+
import"./index-6nqnqzv1.js";
|
|
19
|
+
import"./index-gxqvev8w.js";
|
|
20
|
+
import"./index-tvehn2sp.js";
|
|
21
|
+
import"./index-52w0fvh8.js";
|
|
22
|
+
export {
|
|
23
|
+
CloudScript2 as CloudScript
|
|
24
|
+
};
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-g5px5pxd.js";
|
|
8
8
|
import"./index-52w0fvh8.js";
|
|
9
|
-
import"./index-
|
|
9
|
+
import"./index-gxqvev8w.js";
|
|
10
10
|
import {
|
|
11
11
|
akanCodeDefaultModel2,
|
|
12
12
|
CodeAgentStreamPrinter2
|
|
@@ -19,7 +19,7 @@ class CodeRunner extends runner("code") {
|
|
|
19
19
|
async serve(options, listen) {
|
|
20
20
|
await import("./consoleToStderr-h5bryj94.js");
|
|
21
21
|
const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
|
|
22
|
-
import("./CodeAgent-
|
|
22
|
+
import("./CodeAgent-fee0pnwp.js"),
|
|
23
23
|
import("./CodeAgentRpcHost-9g27hmer.js"),
|
|
24
24
|
import("./CodeAgentRpcListener-7p7z5dd7.js")
|
|
25
25
|
]);
|
|
@@ -34,8 +34,8 @@ class CodeRunner extends runner("code") {
|
|
|
34
34
|
}
|
|
35
35
|
async tui(options, seed) {
|
|
36
36
|
const [{ CodeAgent }, { CodeTui }] = await Promise.all([
|
|
37
|
-
import("./CodeAgent-
|
|
38
|
-
import("./CodeTui-
|
|
37
|
+
import("./CodeAgent-fee0pnwp.js"),
|
|
38
|
+
import("./CodeTui-xh71b2k8.js")
|
|
39
39
|
]);
|
|
40
40
|
const agentOptions = await CodeRunner.#agentOptions(options, false);
|
|
41
41
|
let resume = options.resume;
|
|
@@ -67,7 +67,7 @@ class CodeRunner extends runner("code") {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
async run(prompt, options) {
|
|
70
|
-
const { CodeAgent } = await import("./CodeAgent-
|
|
70
|
+
const { CodeAgent } = await import("./CodeAgent-fee0pnwp.js");
|
|
71
71
|
const agent = await CodeAgent.create(await CodeRunner.#agentOptions(options, false));
|
|
72
72
|
const printer = new CodeAgentStreamPrinter2({ json: options.json, thinking: options.thinking });
|
|
73
73
|
agent.on((event) => printer.print(event));
|
package/commandManifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","machine-keygen":"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","build-desktop":"application","bd":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","start-desktop":"application","sd":"application","release-ios":"application","release-android":"application","pack-update":"application","update-keygen":"application","publish-update":"application","dbup":"application","db-export":"application","db-import":"application","dbdown":"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","push-update":"cloud","register-binary":"cloud","upload-secret":"cloud","list-secrets":"cloud","remove-secret":"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","pipeline":"pipeline","tunnel":"tunnel"}}
|
|
1
|
+
{"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","machine-keygen":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","migrate":"application","create-migration":"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","build-desktop":"application","bd":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","start-desktop":"application","sd":"application","release-ios":"application","release-android":"application","pack-update":"application","update-keygen":"application","publish-update":"application","dbup":"application","db-export":"application","db-import":"application","dbdown":"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","push-update":"cloud","register-binary":"cloud","upload-secret":"cloud","list-secrets":"cloud","remove-secret":"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","pipeline":"pipeline","tunnel":"tunnel"}}
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-g5px5pxd.js";
|
|
6
6
|
import"./index-52w0fvh8.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-gxqvev8w.js";
|
|
8
8
|
import"./index-hj6w4ka1.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
9
|
+
import"./index-5m0s0gdv.js";
|
|
10
|
+
import"./index-tbmtmkhx.js";
|
|
11
|
+
import"./index-cq5x7a9k.js";
|
|
12
|
+
import"./index-ex35dg39.js";
|
|
13
13
|
import"./index-m9jj544v.js";
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
14
|
+
import"./index-551gh8h2.js";
|
|
15
|
+
import"./index-6mprvdt8.js";
|
|
16
|
+
import"./index-6nqnqzv1.js";
|
|
16
17
|
import"./index-zzvvc845.js";
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
22
|
-
import"./index-
|
|
18
|
+
import"./index-t8npm331.js";
|
|
19
|
+
import"./index-3xhak9e0.js";
|
|
20
|
+
import"./index-1bhv9dh4.js";
|
|
21
|
+
import"./index-rp9anyeb.js";
|
|
22
|
+
import"./index-94jq9cbz.js";
|
|
23
|
+
import"./index-85h3dhe0.js";
|
|
23
24
|
import {
|
|
24
25
|
ContextScript
|
|
25
|
-
} from "./index-
|
|
26
|
-
import"./index-665zp9rs.js";
|
|
26
|
+
} from "./index-7xy30jev.js";
|
|
27
27
|
|
|
28
28
|
// pkgs/@akanjs/cli/context/context.command.ts
|
|
29
29
|
class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ContextRunner2
|
|
4
|
+
} from "./index-cq5x7a9k.js";
|
|
5
|
+
import"./index-85h3dhe0.js";
|
|
6
|
+
import"./index-94jq9cbz.js";
|
|
7
|
+
import"./index-rp9anyeb.js";
|
|
8
|
+
import"./index-t8npm331.js";
|
|
9
|
+
import"./index-1bhv9dh4.js";
|
|
10
|
+
import"./index-3xhak9e0.js";
|
|
11
|
+
import"./index-ex35dg39.js";
|
|
12
|
+
import"./index-551gh8h2.js";
|
|
13
|
+
import"./index-m9jj544v.js";
|
|
14
|
+
import"./index-tbmtmkhx.js";
|
|
15
|
+
import"./index-5m0s0gdv.js";
|
|
16
|
+
import"./index-zzvvc845.js";
|
|
17
|
+
import"./index-g5px5pxd.js";
|
|
18
|
+
import"./index-6mprvdt8.js";
|
|
19
|
+
import"./index-6nqnqzv1.js";
|
|
20
|
+
import"./index-gxqvev8w.js";
|
|
21
|
+
import"./index-hj6w4ka1.js";
|
|
22
|
+
import"./index-52w0fvh8.js";
|
|
23
|
+
export {
|
|
24
|
+
ContextRunner2 as ContextRunner
|
|
25
|
+
};
|
|
@@ -55,7 +55,8 @@ not "fix" it back.
|
|
|
55
55
|
the module dictionary's `.error({})` — imported from `"../dict"` on the server, from `"@libs/<lib>/client"` /
|
|
56
56
|
`"@apps/<app>/client"` in UI. A `throw` is an error; a raw `Error` rejected, returned or stored loses the key and
|
|
57
57
|
status too (a warning for now). Exempt: tests, `*.constant.ts`, a root `native/` folder (plugins throw
|
|
58
|
-
`AkanNativeError`), and `common/**` / `env/**`, which have
|
|
58
|
+
`AkanNativeError`), `script/migration/**` (an operator reads its message), and `common/**` / `env/**`, which have
|
|
59
|
+
no legal `Err` import — keep throwing code out of them.
|
|
59
60
|
- **Never import a third-party package** from `page/**`, any barrel, a module logic file
|
|
60
61
|
(`*.{constant,dictionary,document,service,signal,store}.ts`) or module component
|
|
61
62
|
(`*.{Template,Unit,Util,View,Zone}.tsx`) — re-export it through a lib first (one-line shims in a lib's `common/`,
|
|
@@ -89,6 +90,10 @@ not "fix" it back.
|
|
|
89
90
|
- **Never wrap a form setter in a pass-through arrow** — `(v) => st.do.setTypeOnTicket(v)` emits no
|
|
90
91
|
`data-akan-action` and publishes no agent tool. A wrapper that transforms, adds a statement, or calls `writeOnX`
|
|
91
92
|
is legal; publish it with an explicit `st.tool`.
|
|
93
|
+
- **Never call an `st` hook conditionally** — `st.use.*`, `st.sel`, `st.ref` and the last step of `st.tool` /
|
|
94
|
+
`st.useState` / `st.expose` are hooks Biome's `useHookAtTopLevel` cannot see. Behind `||` / `&&` / `??`, a ternary,
|
|
95
|
+
an `if`, a loop or a callback, a skipped call shifts every later hook, and production React crashes elsewhere. Read
|
|
96
|
+
each into its own `const` at the top of the component, then combine.
|
|
92
97
|
- **No deep imports past a barrel**, except cross-module constants (`../map/map.constant`).
|
|
93
98
|
- **Never import across the client/server boundary** (`apps/**`, `libs/**`). Client files (`ui/`, `webkit/`,
|
|
94
99
|
`page/`, `*.store.ts`, every `.tsx`) never import a `*.document|dictionary|service|signal.ts`, `srvkit/`, a
|
|
@@ -223,8 +228,8 @@ Playbook (warning table, code, checklist: `ssrRule`): ① wrap the interaction a
|
|
|
223
228
|
`useEffect(…, [])` load; ④ a store-reading `Zone` holds no markup and delegates to a server `View`; ⑤ hand each
|
|
224
229
|
promise across — `const { xInitInY, xListInY } = fetch.initXInY(id)`, `xInitInY` to a `Zone`, `xListInY` to
|
|
225
230
|
`<Load.Stream>` (model instances, server-only) — and `await` only what the shell must contain; ⑥ named `ReactNode`
|
|
226
|
-
slots (`Layout.Navbar`); ⑦ derived display logic on `Light<Model>`; ⑧
|
|
227
|
-
`_layout.tsx` (
|
|
231
|
+
slots (`Layout.Navbar`); ⑦ derived display logic on `Light<Model>`; ⑧ `.guard(() => signedIn())` on
|
|
232
|
+
`_layout.tsx` (a real 3xx before anything renders; `getSelf({ unauthorize })` in a body redirects in-page after I/O); ⑨ CSS (`data-*` +
|
|
228
233
|
`group-data-[…]`, `<details>`) over client state for visibility; ⑩ heavy islands behind `index_.tsx` + `lazy()`.
|
|
229
234
|
|
|
230
235
|
## Runtime & Build Configuration
|
|
@@ -401,8 +406,9 @@ orchestration in `service`, client state in `store`; `Template` is forms, `Unit`
|
|
|
401
406
|
- **MCP (`mcpRule`)**: `/mcp` publishes every guarded endpoint by default; `mcp: false` (or a `slice()` `mcp` map
|
|
402
407
|
mirroring `guards`) is curation, not authorization. `guards: [Every, Person]` reserves an act for a person;
|
|
403
408
|
`.with(AgentCall)` narrows an agent's call. Settings are `option.setMcp` in `lib/option.ts`; `JWT_SECRET` is
|
|
404
|
-
required outside `local`. Never make a refusal message more helpful. Every entry needs a `.desc()`;
|
|
405
|
-
screen with `page().prompt(name, description)
|
|
409
|
+
required outside `local`. Never make a refusal message more helpful. Every entry needs a `.desc()`; brief a
|
|
410
|
+
screen with `page().prompt(name, description)`, and publish one component a host draws with
|
|
411
|
+
`page().app(name, description, load)` — a read-only tool whose `load` may only query.
|
|
406
412
|
- **In-page agent (`agentRule`)**: mount `<Agent.Chat />` once in a layout; it never executes tools and refuses
|
|
407
413
|
every call until `option.setAgentAccess(<guard>)`; the LLM is `option.setLlm({ apiKey, model, host })`, never env.
|
|
408
414
|
The surface is what components declare — `st.tool(…).exec(fn)` beside its control, `st.use` / `st.sel` /
|
|
@@ -460,15 +466,15 @@ orchestration in `service`, client state in `store`; `Template` is forms, `Unit`
|
|
|
460
466
|
|
|
461
467
|
## Akan Page Routing (`apps/**/page/**`)
|
|
462
468
|
|
|
463
|
-
Full contract — heads, CSR root layouts, typed params, lib pages, `devOnly`: `pageRule`.
|
|
469
|
+
Full contract — guards, apps, heads, CSR root layouts, typed params, lib pages, `devOnly`: `pageRule`.
|
|
464
470
|
|
|
465
471
|
- `page/` holds `.tsx` route modules only: `<routeName>.tsx` or `_index.tsx`, `_layout.tsx`, `_overrides.tsx` — no
|
|
466
472
|
other `_*.tsx`, helpers, `.ts` / `.js` files, or uppercase filenames. `[id]` is a dynamic segment, `(group)` a
|
|
467
473
|
route group.
|
|
468
474
|
- **A route file exports one chain** — `page()`, `layout()` in a `_layout.tsx`, `rootLayout()` in a root
|
|
469
|
-
`_layout.tsx` — and every setting is a stage (`.param`, `.search`, `.config`, `.head`, `.loading`;
|
|
470
|
-
`.error` on layouts; `.fonts` / `.theme` / `.manifest` / … on the root; `.prompt` on a page).
|
|
471
|
-
beside it fails the build.
|
|
475
|
+
`_layout.tsx` — and every setting is a stage (`.param`, `.search`, `.config`, `.guard`, `.head`, `.loading`;
|
|
476
|
+
`.notFound` / `.error` on layouts; `.fonts` / `.theme` / `.manifest` / … on the root; `.prompt` / `.app` on a page).
|
|
477
|
+
A named export beside it fails the build.
|
|
472
478
|
- **Name every `[x]` segment with `.param("x", Type)`** and read query keys only via `.search("k", Type)`; values
|
|
473
479
|
arrive typed. `lang` is never declared — every stage receives it.
|
|
474
480
|
- `.head()` takes JSX or a function returning it — never a metadata object; deeper heads replace by tag identity,
|
|
@@ -484,18 +490,19 @@ Full contract — heads, CSR root layouts, typed params, lib pages, `devOnly`: `
|
|
|
484
490
|
export default page()
|
|
485
491
|
.param("orgId", ID)
|
|
486
492
|
.config({ transition: "stack" })
|
|
493
|
+
.guard(() => signedIn())
|
|
487
494
|
.render(({ orgId }) => {
|
|
488
495
|
const { l } = usePage();
|
|
489
|
-
getSelf({ unauthorize: "/signin" });
|
|
490
496
|
const { taskInitInOrg } = fetch.initTaskInOrg(orgId);
|
|
491
497
|
return <Task.Zone.Card init={taskInitInOrg} prefix={`/org/${orgId}`} />;
|
|
492
498
|
});
|
|
493
499
|
```
|
|
494
500
|
|
|
495
|
-
- `.render()` gets the declared args flat and typed (no `PageProps`, no `loader=` prop). Order: `usePage()`,
|
|
496
|
-
|
|
501
|
+
- `.render()` gets the declared args flat and typed (no `PageProps`, no `loader=` prop). Order: `usePage()`, fetch,
|
|
502
|
+
return; auth is the chain's `.guard()`, which runs before anything renders. Hand `fetch.init*` / `view*` / `edit*` fields to sections unawaited; await only what the shell reads
|
|
497
503
|
(title, redirect, link id) in one `Promise.all`.
|
|
498
|
-
- Gate auth
|
|
504
|
+
- Gate auth with `.guard(() => signedIn())` (`@libs/shared/webkit`) at `_layout.tsx`, and repeat it on a page that
|
|
505
|
+
needs more; it is a courtesy, the endpoint guards are the gate. `getSelf({ unauthorize })` in a body still works. `async` only when the body awaits; the
|
|
499
506
|
callback is not a React component, so it takes no name and no return type. No `useState`, `useEffect`, or
|
|
500
507
|
comments in page files.
|
|
501
508
|
|
|
@@ -551,6 +558,28 @@ export default page()
|
|
|
551
558
|
barrel holds only `export *` lines). `ui/<Folder>/index_.tsx` is the `"use client"` + `lazy()` boundary beside a
|
|
552
559
|
server-safe `index.tsx` — merging the pair breaks RSC.
|
|
553
560
|
|
|
561
|
+
## Data Migrations (`apps/*/script/migration/**`)
|
|
562
|
+
|
|
563
|
+
A change that reshapes stored documents ships a migration: `akan create-migration <name> <app>` writes
|
|
564
|
+
`script/migration/<yyyyMMddHHmm>_<name>.ts`, a default-exported `migration(title)` from `akanjs/server`, which
|
|
565
|
+
`akan migrate <app>` runs locally and `bun main.js ops migrate` in a built container (the `cheatsheet/dev/migration`
|
|
566
|
+
docs page).
|
|
567
|
+
|
|
568
|
+
- The new code reads both shapes until every environment has applied it — a deploy serves traffic first.
|
|
569
|
+
- Write only through `table(refName)`, never a service, a document or raw `sql` — a service write runs the model's
|
|
570
|
+
hooks, and none of them reaches the change log a rollback reverts. Call nothing outside the database.
|
|
571
|
+
- `plan` reads only and must hash the same on unchanged data: a timestamp, `createId()` or random value in it makes
|
|
572
|
+
every `apply --expect <planHash>` refuse as `planChanged`.
|
|
573
|
+
- Past about five seconds on SQLite, an apply's one transaction makes the live server's writes fail. Take
|
|
574
|
+
`.config({ transaction: false })`, which commits each `rewrite` batch and resumes a `partial` run from the top of
|
|
575
|
+
`apply` — so a second run must change nothing (a `where` the new shape no longer matches).
|
|
576
|
+
- `$ne` leaves out rows whose path is missing or `null` (match them with `{ path: null }`; `$exists: false` misses a
|
|
577
|
+
stored `null`); `find`, `count` and `rewrite` include removed rows unless `{ withRemoved: false }`; a `table()` write
|
|
578
|
+
leaves `updatedAt` alone.
|
|
579
|
+
- Throw a plain `Error` an operator can act on. Never edit a migration an environment has applied — write another;
|
|
580
|
+
delete it once every environment has, unless its `.rollback(fn)` may still be needed: without the file a rollback
|
|
581
|
+
runs the default undo.
|
|
582
|
+
|
|
554
583
|
## Present In The Code — Do Not Imitate
|
|
555
584
|
|
|
556
585
|
Warts in older files — never copy them; when two shapes disagree, follow the newer neighbour: `children: any`
|