@akanjs/cli 3.1.1-rc.0 → 3.1.1-rc.2
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-4pnxwptq.js → CodeAgent-8hfzq1zs.js} +2 -2
- package/{CodeTui-hhndze8h.js → CodeTui-kj6ng91g.js} +1 -1
- package/TunnelShare-ycmz33ve.js +14 -0
- package/{agent.command-p02330r6.js → agent.command-2gay26y4.js} +5 -5
- package/akanCode.js +2 -2
- package/{application.command-ywks5ywm.js → application.command-a3aepayy.js} +16 -11
- package/{applicationBuildRunner-9cnnsdm5.js → applicationBuildRunner-xye2sqrm.js} +5 -5
- package/buildBatch.proc.js +5 -5
- package/{cloud.command-1tzkvje1.js → cloud.command-t2zdcw87.js} +13 -13
- package/cloud.script-mm636g83.js +24 -0
- package/{code.command-16pm1p2v.js → code.command-184jfjtk.js} +6 -6
- package/{context.command-6ys86sqf.js → context.command-kx0kzz3t.js} +16 -16
- package/context.runner-d7dhvbc7.js +25 -0
- package/{guideline.command-3zay3d8g.js → guideline.command-72psmnpx.js} +2 -2
- package/guidelines/conventions/conventions.instruction.md +7 -3
- package/guidelines/mcpRule/mcpRule.instruction.md +13 -6
- package/guidelines/pageRule/pageRule.instruction.md +13 -5
- package/guidelines/runtimeRule/runtimeRule.instruction.md +8 -2
- package/guidelines/ssrRule/ssrRule.instruction.md +6 -1
- package/guidelines/transportRule/transportRule.instruction.md +12 -5
- package/incrementalBuilder.proc.js +3 -3
- package/{index-sh9mmp5v.js → index-0dnv1039.js} +7 -7
- package/{index-jgs8z8xb.js → index-0fpeb7x7.js} +1 -1
- package/{index-b5vptvnt.js → index-3wfw8jb8.js} +4 -4
- package/{index-q8age5az.js → index-4g6te8sa.js} +2 -2
- package/{index-sng3vt0p.js → index-4q1amb3p.js} +2 -2
- package/{index-zn6bn1s2.js → index-5anqj3bm.js} +4 -4
- package/{index-ynqxpwx6.js → index-9z37veck.js} +1 -1
- package/{index-p4dnj2wc.js → index-azrhhgtb.js} +1 -1
- package/{index-4w3skd33.js → index-bxjacq5c.js} +3 -3
- package/{index-ngpn9hzy.js → index-eyhqttvh.js} +2 -2
- package/{index-kcbq2qcf.js → index-ggfjqpp4.js} +1 -1
- package/{index-bb4hj03s.js → index-hqaa4y3y.js} +8 -8
- package/{index-1f33g2z5.js → index-hrc7q2e6.js} +17 -12
- package/{index-qtkycaqn.js → index-jn8gfj2b.js} +30 -15
- package/{index-e9e9cebg.js → index-kb51mayy.js} +3 -3
- package/{index-z6v7k9sb.js → index-md6026rp.js} +2 -2
- package/{index-tk3jg2bm.js → index-mtf0cx8t.js} +2 -2
- package/{index-g2s33373.js → index-q0e6604h.js} +1 -1
- package/{index-1mfyyxh5.js → index-qp73c26e.js} +3 -3
- package/{index-vg28jsf9.js → index-rqcmr940.js} +172 -70
- package/{index-z9xepn8t.js → index-s28awecf.js} +3 -3
- package/{index-jaa81e9r.js → index-ssseyt0n.js} +4 -4
- package/{index-qkcwsg6r.js → index-sxqjxb4j.js} +2 -2
- package/{index-rr7jk14m.js → index-trjhp735.js} +8 -5
- package/{index-9hbhm6cs.js → index-v1gz5vja.js} +1 -1
- package/{index-68c3gzvg.js → index-x6c29k5m.js} +7 -7
- package/{index-ekpp5tax.js → index-xhnw8n74.js} +1 -1
- package/{index-fmder14z.js → index-yaz7yks8.js} +1 -1
- package/{index-qfzfaq96.js → index-zz5731qs.js} +3 -3
- package/index.js +22 -22
- package/{library.command-a8n9h8j4.js → library.command-tnxw0yb4.js} +3 -3
- package/{localRegistry.command-1e6m7w2f.js → localRegistry.command-dy0byd6z.js} +12 -12
- package/{module.command-b6f1p1xa.js → module.command-8pjk6vmm.js} +5 -5
- package/{package.command-tc27ftmy.js → package.command-b831nx2n.js} +3 -3
- package/package.json +2 -2
- package/{page.command-m5wyqfkd.js → page.command-earjccmn.js} +3 -3
- package/{pipeline.command-4qxyafpz.js → pipeline.command-yt8bq91c.js} +2 -2
- package/{primitive.command-9yaatk0d.js → primitive.command-8dw8ra1x.js} +6 -6
- package/{projectTypecheck-87k6z6ab.js → projectTypecheck-btbw3nyf.js} +1 -1
- package/{quality.command-ht1wjhv8.js → quality.command-j2c4a2zg.js} +387 -73
- package/{repair.command-evg9g911.js → repair.command-7jv7bgc4.js} +5 -5
- package/{scalar.command-xsejjeq1.js → scalar.command-vwjk94zr.js} +4 -4
- package/{subspace.command-ps12q5y7.js → subspace.command-xjw4tc0p.js} +8 -8
- package/templates/env/_env.server.type.ts +10 -5
- package/templates/facetIndex/index.ts +2 -2
- package/{tunnel.command-khzgvrj8.js → tunnel.command-zm29dgkr.js} +7 -7
- package/{workflow.command-qpyq0ya5.js → workflow.command-nyjc1mxx.js} +10 -10
- package/{workspace.command-3dq7e9g2.js → workspace.command-rq7mgq6f.js} +27 -25
- package/TunnelShare-zmq6bbar.js +0 -14
- package/cloud.script-8g83xqdg.js +0 -24
- package/context.runner-3jrypwe3.js +0 -25
package/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
38e5d701205b086217ece1347934c9ac7c5aa7b31adb4dac7728403307aab399
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
TunnelShare2
|
|
4
|
+
} from "./index-ggfjqpp4.js";
|
|
5
|
+
import"./index-hrc7q2e6.js";
|
|
6
|
+
import"./index-s28awecf.js";
|
|
7
|
+
import"./index-m9jj544v.js";
|
|
8
|
+
import"./index-4g6te8sa.js";
|
|
9
|
+
import"./index-0fpeb7x7.js";
|
|
10
|
+
import"./index-trjhp735.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-azrhhgtb.js";
|
|
6
6
|
import"./index-52w0fvh8.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-trjhp735.js";
|
|
8
8
|
import"./index-hj6w4ka1.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
import"./index-9z37veck.js";
|
|
10
|
+
import"./index-md6026rp.js";
|
|
11
11
|
import"./index-zzvvc845.js";
|
|
12
12
|
import {
|
|
13
13
|
AgentScript
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-qp73c26e.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-bxjacq5c.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-v1gz5vja.js";
|
|
44
44
|
import"./index-7md2g9vw.js";
|
|
45
45
|
import {
|
|
46
46
|
CodeAgentRpcHost2
|
|
@@ -7,19 +7,19 @@ import {
|
|
|
7
7
|
Exec,
|
|
8
8
|
Workspace,
|
|
9
9
|
command
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-azrhhgtb.js";
|
|
11
11
|
import"./index-52w0fvh8.js";
|
|
12
|
-
import"./index-
|
|
12
|
+
import"./index-trjhp735.js";
|
|
13
13
|
import"./index-5nd1wtkv.js";
|
|
14
|
-
import"./index-
|
|
14
|
+
import"./index-xhnw8n74.js";
|
|
15
15
|
import"./index-m9jj544v.js";
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
16
|
+
import"./index-s28awecf.js";
|
|
17
|
+
import"./index-4g6te8sa.js";
|
|
18
|
+
import"./index-0fpeb7x7.js";
|
|
19
|
+
import"./index-sxqjxb4j.js";
|
|
20
20
|
import {
|
|
21
21
|
ApplicationScript
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-jn8gfj2b.js";
|
|
23
23
|
import"./index-7md2g9vw.js";
|
|
24
24
|
import {
|
|
25
25
|
writeOption,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
allowLocalOption,
|
|
29
29
|
publicEnvOption
|
|
30
30
|
} from "./index-mdjc93e1.js";
|
|
31
|
-
import"./index-
|
|
31
|
+
import"./index-yaz7yks8.js";
|
|
32
32
|
|
|
33
33
|
// pkgs/@akanjs/cli/application/application.command.ts
|
|
34
34
|
import { MigrationCommand } from "akanjs/server/migration/migrationCommand";
|
|
@@ -130,8 +130,13 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
|
|
|
130
130
|
typecheck: target({ short: true, desc: "Typecheck an app or a library, its tests and specs included" }).with(SysOrOnlyApp).option("write", Boolean, writeOption).option("clean", Boolean, { desc: "clear typecheck cache before running", default: false }).option("incremental", Boolean, { desc: "reuse TypeScript incremental cache", default: true }).option("tests", Boolean, { desc: "check its *.test.ts / *.spec.ts too, which nothing imports", default: true }).exec(async function(sys, write, clean, incremental, tests) {
|
|
131
131
|
await this.applicationScript.typecheck(sys, { write, clean, incremental, tests });
|
|
132
132
|
}),
|
|
133
|
-
test: target({ desc: "Prepare and test an app, library, or package" }).with(Exec).
|
|
134
|
-
|
|
133
|
+
test: target({ desc: "Prepare and test an app, library, or package" }).with(Exec).arg("files", String, {
|
|
134
|
+
desc: "test files or folders to run, relative to the target or the workspace root, comma-separated (default: all)",
|
|
135
|
+
example: "lib/user/user.signal.test.ts",
|
|
136
|
+
nullable: true
|
|
137
|
+
}).option("write", Boolean, writeOption).exec(async function(exec, files, write) {
|
|
138
|
+
const testFiles = (files ?? "").split(",").map((file) => file.trim()).filter(Boolean);
|
|
139
|
+
await this.applicationScript.test(exec, { write, files: testFiles });
|
|
135
140
|
}),
|
|
136
141
|
buildIos: target({ short: true, desc: "Build the iOS app on the native runtime" }).with(App).option("target", String, nativeTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("write", Boolean, writeOption).exec(async function(app, target, env, debug, write) {
|
|
137
142
|
await this.applicationScript.buildIos(app, { target, env, profile: debug ? "debug" : "release", write });
|
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
Spinner,
|
|
5
5
|
ProjectTypecheck2,
|
|
6
6
|
WorkspaceExecutor
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-trjhp735.js";
|
|
8
8
|
import"./index-52w0fvh8.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
import"./index-eyhqttvh.js";
|
|
10
|
+
import"./index-0fpeb7x7.js";
|
|
11
11
|
import {
|
|
12
12
|
AllRoutesBuilder,
|
|
13
13
|
FontPruner,
|
|
14
14
|
precompressArtifacts,
|
|
15
15
|
SsrBaseArtifactBuilder
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-kb51mayy.js";
|
|
17
17
|
import {
|
|
18
18
|
CsrArtifactBuilder
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-4g6te8sa.js";
|
|
20
20
|
import"./index-62md4dwy.js";
|
|
21
21
|
|
|
22
22
|
// pkgs/@akanjs/devkit/applicationBuildRunner.ts
|
package/buildBatch.proc.js
CHANGED
|
@@ -6,26 +6,26 @@ import {
|
|
|
6
6
|
resolveSsrPageEntriesForApp,
|
|
7
7
|
WorkspaceExecutor,
|
|
8
8
|
AppExecutor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-trjhp735.js";
|
|
10
10
|
import {
|
|
11
11
|
computeRouteSeedIndex,
|
|
12
12
|
saveRouteSeedIndex,
|
|
13
13
|
CsrDevBundler,
|
|
14
14
|
SsrDevBundler
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-eyhqttvh.js";
|
|
16
16
|
import"./index-52w0fvh8.js";
|
|
17
17
|
import {
|
|
18
18
|
ServerGraphFile,
|
|
19
19
|
PagesBundleBuilder
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-0fpeb7x7.js";
|
|
21
21
|
import {
|
|
22
22
|
CssCompiler,
|
|
23
23
|
FontOptimizer,
|
|
24
24
|
SsrBaseArtifactBuilder
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-kb51mayy.js";
|
|
26
26
|
import {
|
|
27
27
|
CsrArtifactBuilder
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-4g6te8sa.js";
|
|
29
29
|
import"./index-62md4dwy.js";
|
|
30
30
|
|
|
31
31
|
// pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
|
|
@@ -3,27 +3,27 @@ import {
|
|
|
3
3
|
App,
|
|
4
4
|
Workspace,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-azrhhgtb.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
import"./index-trjhp735.js";
|
|
9
|
+
import"./index-hrc7q2e6.js";
|
|
10
10
|
import {
|
|
11
11
|
PlatformTestRun
|
|
12
|
-
} from "./index-
|
|
13
|
-
import"./index-
|
|
12
|
+
} from "./index-rqcmr940.js";
|
|
13
|
+
import"./index-xhnw8n74.js";
|
|
14
14
|
import"./index-m9jj544v.js";
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
15
|
+
import"./index-s28awecf.js";
|
|
16
|
+
import"./index-4g6te8sa.js";
|
|
17
|
+
import"./index-0fpeb7x7.js";
|
|
18
18
|
import"./index-5nd1wtkv.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
19
|
+
import"./index-sxqjxb4j.js";
|
|
20
|
+
import"./index-jn8gfj2b.js";
|
|
21
21
|
import"./index-7md2g9vw.js";
|
|
22
22
|
import"./index-tvehn2sp.js";
|
|
23
|
-
import"./index-
|
|
23
|
+
import"./index-mtf0cx8t.js";
|
|
24
24
|
import {
|
|
25
25
|
CloudScript2
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-x6c29k5m.js";
|
|
27
27
|
import {
|
|
28
28
|
writeOption,
|
|
29
29
|
oneNativeTargetOption,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
hostOption,
|
|
35
35
|
subspaceOption
|
|
36
36
|
} from "./index-mdjc93e1.js";
|
|
37
|
-
import"./index-
|
|
37
|
+
import"./index-yaz7yks8.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-x6c29k5m.js";
|
|
5
|
+
import"./index-rqcmr940.js";
|
|
6
|
+
import"./index-jn8gfj2b.js";
|
|
7
|
+
import"./index-yaz7yks8.js";
|
|
8
|
+
import"./index-sxqjxb4j.js";
|
|
9
|
+
import"./index-mtf0cx8t.js";
|
|
10
|
+
import"./index-xhnw8n74.js";
|
|
11
|
+
import"./index-hrc7q2e6.js";
|
|
12
|
+
import"./index-s28awecf.js";
|
|
13
|
+
import"./index-m9jj544v.js";
|
|
14
|
+
import"./index-azrhhgtb.js";
|
|
15
|
+
import"./index-7md2g9vw.js";
|
|
16
|
+
import"./index-4g6te8sa.js";
|
|
17
|
+
import"./index-5nd1wtkv.js";
|
|
18
|
+
import"./index-0fpeb7x7.js";
|
|
19
|
+
import"./index-trjhp735.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-azrhhgtb.js";
|
|
8
8
|
import"./index-52w0fvh8.js";
|
|
9
|
-
import"./index-
|
|
9
|
+
import"./index-trjhp735.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-8hfzq1zs.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-8hfzq1zs.js"),
|
|
38
|
+
import("./CodeTui-kj6ng91g.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-8hfzq1zs.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));
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-azrhhgtb.js";
|
|
6
6
|
import"./index-52w0fvh8.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-trjhp735.js";
|
|
8
8
|
import"./index-hj6w4ka1.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
9
|
+
import"./index-9z37veck.js";
|
|
10
|
+
import"./index-md6026rp.js";
|
|
11
|
+
import"./index-hqaa4y3y.js";
|
|
12
|
+
import"./index-xhnw8n74.js";
|
|
13
13
|
import"./index-m9jj544v.js";
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
14
|
+
import"./index-s28awecf.js";
|
|
15
|
+
import"./index-4g6te8sa.js";
|
|
16
|
+
import"./index-0fpeb7x7.js";
|
|
17
17
|
import"./index-zzvvc845.js";
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
18
|
+
import"./index-zz5731qs.js";
|
|
19
|
+
import"./index-q0e6604h.js";
|
|
20
|
+
import"./index-3wfw8jb8.js";
|
|
21
|
+
import"./index-5anqj3bm.js";
|
|
22
|
+
import"./index-4q1amb3p.js";
|
|
23
|
+
import"./index-0dnv1039.js";
|
|
24
24
|
import {
|
|
25
25
|
ContextScript
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-ssseyt0n.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-hqaa4y3y.js";
|
|
5
|
+
import"./index-0dnv1039.js";
|
|
6
|
+
import"./index-4q1amb3p.js";
|
|
7
|
+
import"./index-5anqj3bm.js";
|
|
8
|
+
import"./index-zz5731qs.js";
|
|
9
|
+
import"./index-3wfw8jb8.js";
|
|
10
|
+
import"./index-q0e6604h.js";
|
|
11
|
+
import"./index-xhnw8n74.js";
|
|
12
|
+
import"./index-s28awecf.js";
|
|
13
|
+
import"./index-m9jj544v.js";
|
|
14
|
+
import"./index-md6026rp.js";
|
|
15
|
+
import"./index-9z37veck.js";
|
|
16
|
+
import"./index-zzvvc845.js";
|
|
17
|
+
import"./index-azrhhgtb.js";
|
|
18
|
+
import"./index-4g6te8sa.js";
|
|
19
|
+
import"./index-0fpeb7x7.js";
|
|
20
|
+
import"./index-trjhp735.js";
|
|
21
|
+
import"./index-hj6w4ka1.js";
|
|
22
|
+
import"./index-52w0fvh8.js";
|
|
23
|
+
export {
|
|
24
|
+
ContextRunner2 as ContextRunner
|
|
25
|
+
};
|
|
@@ -160,9 +160,10 @@ not "fix" it back.
|
|
|
160
160
|
- Bun's runner (`describe`, `expect`, `test` from `bun:test`); colocated `*.test.ts` / `*.spec.ts`; focused behavior
|
|
161
161
|
tests of public contracts and edge cases. A placeholder `it` with a descriptive title is the floor; a
|
|
162
162
|
security-relevant behaviour gets a real suite.
|
|
163
|
-
- Run `bun run akan test <pkg
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
- Run `bun run akan test <pkg> [files]` from the root (`files`: comma-separated paths from the target or the root;
|
|
164
|
+
the only way a signal test runs), or `cd <pkg> && bun test --isolate ./<file>`. Plain `bun test` shares one global
|
|
165
|
+
object across files and fails dozens of tests from that pollution (`bunfig.toml` `[test] isolate` is not honored as
|
|
166
|
+
of Bun 1.4.4); from the repo root it breaks subprocess stdio pipes.
|
|
166
167
|
- Signal tests split in two: `<model>.signal.spec.ts` holds fixtures on `sampleOf(cnst.XInput)` with explicit
|
|
167
168
|
`Promise<cnst.X>` returns and **no assertions**; `<model>.signal.test.ts` holds `describe("<Model> Signal")`,
|
|
168
169
|
describe-scope `let` fixtures, one `beforeAll`, story-ordered `it`s, negatives via
|
|
@@ -505,6 +506,9 @@ export default page()
|
|
|
505
506
|
- `.render()` gets the declared args flat and typed (no `PageProps`, no `loader=` prop). Order: `usePage()`, fetch,
|
|
506
507
|
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
|
|
507
508
|
(title, redirect, link id) in one `Promise.all`.
|
|
509
|
+
- **A route never writes while it renders**: a `fetch.<mutation>()` in a stage or a component it renders throws
|
|
510
|
+
`base.error.mutationInRender`, since opening a link would perform it. Send it from a user action;
|
|
511
|
+
`{ duringRender: true }` only for a write harmless to repeat and safe for anyone to trigger (`ssrRule`).
|
|
508
512
|
- Gate auth with `.guard(() => signedIn())` (`@libs/shared/webkit`; a new workspace has that lib only with
|
|
509
513
|
`create-workspace --libs true`) at `_layout.tsx`, and repeat it on a page that needs more; it is a courtesy, the
|
|
510
514
|
endpoint guards are the gate. `getSelf({ unauthorize })` in a body still works. `async` only when the body awaits;
|
|
@@ -40,6 +40,9 @@ export class FileSlice extends slice(srv.file, {
|
|
|
40
40
|
`update`, `remove`), same fallbacks (`create`/`update`/`remove` inherit `cru`), and the same scope: it narrows
|
|
41
41
|
the root slice and the generated CRUD, and never reaches a named slice or a custom endpoint. Those declare
|
|
42
42
|
their own `mcp` beside their own `guards`. The bare `mcp: false` is every key at once, still within that scope.
|
|
43
|
+
- **An app's slice replaces a lib's whole**, on the server and in the client: its own `guards` (a `None` verb is
|
|
44
|
+
denied everywhere) and its own `mcp` map, or, when it writes none, every verb the lib's slice took off stays off.
|
|
45
|
+
To keep a mounted lib's tools off without its slice, use `setMcp({ excludeSignals, excludeEndpoints })` (below).
|
|
43
46
|
- **A view keeps reaching it.** To a host that renders MCP Apps views, an endpoint refused for `mcp: false` alone
|
|
44
47
|
is published with `visibility: ["app"]`: an app's view may call it, the model is never shown it (below). Every
|
|
45
48
|
other refusal still holds there.
|
|
@@ -56,11 +59,13 @@ export class FileSlice extends slice(srv.file, {
|
|
|
56
59
|
## Configuration
|
|
57
60
|
Settings live in the app's `lib/option.ts` — `option.setMcp({ … })`, taking `enabled`, `readOnly`, `path`,
|
|
58
61
|
`version`, `instructions`, `allowedOrigins`, `pageSize`, `language`, `legacyTextBlock`, `outputSchema`, `rateLimit`,
|
|
59
|
-
`promptBudget`, `apps`, `modern`, and `
|
|
62
|
+
`promptBudget`, `apps`, `modern`, `auth`, and `excludeSignals` / `excludeEndpoints` (curation like `mcp: false`,
|
|
63
|
+
added up across libs, an unmatched name warned at boot) — or `setMcp((env) => …)` for settings derived from the
|
|
64
|
+
server env.
|
|
60
65
|
**Not `main.ts`**: the gateway
|
|
61
66
|
there only spawns children, and `option.ts` is the app-authored file `server.ts` already hands to the process that
|
|
62
67
|
mounts `/mcp`. Every lib's option is read in mount order with the app's last, so an app tightens what a library
|
|
63
|
-
declared without restating it. Each field also has an env spelling (`AKAN_MCP`, `AKAN_MCP_READONLY`,
|
|
68
|
+
declared without restating it. Each field but the two lists also has an env spelling (`AKAN_MCP`, `AKAN_MCP_READONLY`,
|
|
64
69
|
`AKAN_MCP_PATH`, `AKAN_MCP_VERSION`, `AKAN_MCP_INSTRUCTIONS`, `AKAN_MCP_ALLOWED_ORIGINS`, `AKAN_MCP_PAGE_SIZE`,
|
|
65
70
|
`AKAN_MCP_LANGUAGE`, `AKAN_MCP_LEGACY_TEXT`, `AKAN_MCP_OUTPUT_SCHEMA`, `AKAN_MCP_RATE_LIMIT`, `AKAN_MCP_CONCURRENT`,
|
|
66
71
|
`AKAN_MCP_PROMPT_BUDGET`, `AKAN_MCP_APPS`, `AKAN_MCP_MODERN`, `AKAN_MCP_AUTH_SERVERS`, `AKAN_MCP_SCOPES`, `AKAN_MCP_RESOURCE`) for a deployment that configures what the source does
|
|
@@ -410,8 +415,9 @@ export default page()
|
|
|
410
415
|
names share one namespace with the prompts, and an endpoint keeps its name over an app's, with a boot warning.
|
|
411
416
|
- **`load` may only query.** A mutation, a file upload, a room subscription or a message sent while it runs throws
|
|
412
417
|
`base.error.mutationInApp` before anything is sent — on the server through every `await`, in a browser for its
|
|
413
|
-
synchronous part.
|
|
414
|
-
`.guard()`: a `getSelf({ unauthorize })` inside `load` would
|
|
418
|
+
synchronous part, `{ duringRender: true }` or not. The buttons and forms that write stay in `.render()` around the
|
|
419
|
+
element (the `Close` above), and gating stays in `.guard()`: a `getSelf({ unauthorize })` inside `load` would
|
|
420
|
+
redirect a view.
|
|
415
421
|
- **A host that declares the extension** (claude.ai, Claude Desktop, ChatGPT, VS Code, Goose) is also given
|
|
416
422
|
`_meta.ui.resourceUri` (`ui://<app>/apps/<name>`) and draws the app's own view in place of the result: one HTML
|
|
417
423
|
document per app, which `akan build` writes to `mcp-apps/<name>.html` beside `csr/` and `akan start` writes to
|
|
@@ -444,8 +450,9 @@ export default page()
|
|
|
444
450
|
reaches the host with `base.error.readOnlyDeployment`, toasted in the person's language. A `.prompt()` page's text
|
|
445
451
|
tool is dropped, since its run renders the whole page; the prompt stays.
|
|
446
452
|
- **`.prompt()` is a briefing, never a view.** Its page is also a text tool of the same name, marked
|
|
447
|
-
`readOnlyHint: false`, since running the page makes its own `fetch.*` calls
|
|
448
|
-
|
|
453
|
+
`readOnlyHint: false`, since running the page makes its own `fetch.*` calls; like any render it refuses a mutation
|
|
454
|
+
with `base.error.mutationInRender` unless the call passes `{ duringRender: true }`. To have a host draw part of that
|
|
455
|
+
screen, declare an `.app()` beside it.
|
|
449
456
|
- **The view has no network.** `connect-src` stays closed; the app's own origin is opened for what a page loads by
|
|
450
457
|
URL — fonts (served with `Access-Control-Allow-Origin: *`) and stored images — and every root-relative URL the
|
|
451
458
|
page writes is pointed at it, since a host may block the document's `<base>` (Claude does).
|
|
@@ -41,6 +41,13 @@ body shape — this is the full contract behind them. Before changing route beha
|
|
|
41
41
|
hydration, so an effect that needs the query on its first run takes the page's `.search()` value as a prop.
|
|
42
42
|
- There is no `loader=` / `render=` page prop and no `PageProps` interface: the chain declares the arguments and
|
|
43
43
|
`.render()` receives them flat, typed, with `lang` on every route and `children` added for a layout.
|
|
44
|
+
- **A route only reads while it renders.** A `fetch.<mutation>()` (or socket message) sent from `.render()`, `.guard()`,
|
|
45
|
+
`.head()`, `.loading()` or a layout's `.notFound()` / `.error()` (a `.prompt()` run included) throws
|
|
46
|
+
`base.error.mutationInRender` synchronously, before it is sent — a `.catch()` on its promise never sees it: opening a
|
|
47
|
+
link to the page would perform it. Send a write from a user action — a button through a store action. Only a write
|
|
48
|
+
that is harmless to repeat and safe for anyone to trigger (a warm-up) passes `{ duringRender: true }` as the option
|
|
49
|
+
after the endpoint's own arguments (`fetch.updateX(id, data, { duringRender: true })`). `akan quality` flags the call,
|
|
50
|
+
same-file helpers included, as `akan.ssr.render-mutation`.
|
|
44
51
|
|
|
45
52
|
## Route Guards — `.guard()`
|
|
46
53
|
|
|
@@ -82,11 +89,12 @@ body shape — this is the full contract behind them. Before changing route beha
|
|
|
82
89
|
source), shares one namespace with every page's prompts and apps, and needs an English description. A name
|
|
83
90
|
`.render()` already receives (`lang`, a `.param()` / `.search()` name, another app) fails to compile and throws when
|
|
84
91
|
the module loads, as does an app named like the page's `.prompt()`.
|
|
85
|
-
- **`load` may only query** (`base.error.mutationInApp` otherwise
|
|
86
|
-
gating in `.guard()`. The view runs `load` with no layout body
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
chain is the `export default` expression itself: one
|
|
92
|
+
- **`load` may only query** (`base.error.mutationInApp` otherwise, `duringRender` or not): keep the buttons and forms
|
|
93
|
+
that write in `.render()` around the element, and gating in `.guard()`. The view runs `load` with no layout body
|
|
94
|
+
and no `.render()`: it gets the root layout's theme, fonts and framework providers through the generated
|
|
95
|
+
`McpAppRoot` and the `_overrides.tsx` over the page (one the web draws outside the root layout wraps `McpAppRoot`,
|
|
96
|
+
its toasts included), and nothing a layout body provides. The chain is the `export default` expression itself: one
|
|
97
|
+
bound to a name fails the build. Full contract: `mcpRule`.
|
|
90
98
|
|
|
91
99
|
## Heads
|
|
92
100
|
|
|
@@ -101,6 +101,10 @@ worker per web-serving replica.
|
|
|
101
101
|
- **A solo process answers `/_akan/app/health`, `/_akan/app/metrics` and `/_akan/bench/ping` itself**, in the
|
|
102
102
|
gateway's own shape — a `children` array with one entry — so a probe reads one contract either way. It owns the
|
|
103
103
|
rotating log file the gateway would otherwise write, in the same `runtime/logs` directory.
|
|
104
|
+
- **Health detail and metrics answer only `Authorization: Bearer $AKAN_STATUS_TOKEN`** (or the log stream token)
|
|
105
|
+
outside `local`: without it `/_akan/app/health` is `{ status }` alone (still 200) and `/_akan/app/metrics` is 401.
|
|
106
|
+
A probe that reads only the status code needs nothing; give a scraper or monitor `AKAN_STATUS_TOKEN`, which reads
|
|
107
|
+
nothing else.
|
|
104
108
|
- **Nothing supervises a solo process but the orchestrator**, since the gateway's crash-restart-with-backoff went
|
|
105
109
|
with it. `infra/app/templates/app.yaml` carries the liveness, readiness and startup probes that replace it.
|
|
106
110
|
- **`PORT` is the whole tree's port, and a server-side self-call follows it.** `AkanApp` resolves it once
|
|
@@ -209,7 +213,7 @@ normalized to `info` with one warning.
|
|
|
209
213
|
`AKAN_LOG_STDOUT_LEVEL` (default: the console level); a child's or the RSC worker's crash stack is wrapped as a
|
|
210
214
|
`raw=true` record instead of breaking the stream. Text stays the default; turn it on in the deployment.
|
|
211
215
|
- **`AKAN_LOG_STREAM_TOKEN` mounts `/_akan/app/logs`** (SSE, `Last-Event-ID` resume, explicit `gap` events);
|
|
212
|
-
unset, the route does not exist.
|
|
216
|
+
unset, the route does not exist. The same bearer also unlocks the health detail and metrics.
|
|
213
217
|
- **`AKAN_LOG_CANONICAL=1|slow`** writes one `ok|error <endpoint> ms= status=` line per call; **`AKAN_LOG_FLIGHT=1`**
|
|
214
218
|
keeps each call's last 64 sub-level records and promotes them (`flight=true`) only when it failed or ran past
|
|
215
219
|
`AKAN_LOG_FLIGHT_MS`; an `x-akan-debug` header lowers one request to `trace` — in `local`, or with the
|
|
@@ -532,7 +536,9 @@ bypasses the store akanjs picks per platform (the shell's Preferences in an app)
|
|
|
532
536
|
code never touches `document.cookie`, `localStorage` or `sessionStorage` (`no-document-cookie`, `no-web-storage`): it
|
|
533
537
|
uses `getCookie` / `setCookie` / `removeCookie`, `storage`, and `secretStorage` for tokens and credentials, all from
|
|
534
538
|
`akanjs/client`. `setCookie` writes `path=/; SameSite=Lax; Secure`, and an options object overrides only the keys it
|
|
535
|
-
names — pass `sameSite: "none"` only for a cookie a cross-site POST must carry back.
|
|
539
|
+
names — pass `sameSite: "none"` only for a cookie a cross-site POST must carry back. `getCookie` reads a name sent
|
|
540
|
+
twice as unset, since a sibling subdomain can plant a second copy; server code reads `cookieJar()` from
|
|
541
|
+
`akanjs/fetch`, or `CookieJar.parse(req.headers.get("cookie"))`, never `req.cookies`. Browser APIs an app WebView lacks
|
|
536
542
|
stay in a `webkit/` hook that branches on `isNativeApp()` from `akanjs/client/native`, which is where the app side goes
|
|
537
543
|
too (`no-web-only-api-outside-webkit`, a warning): `navigator.share` / `canShare` (Android's WebView has none),
|
|
538
544
|
`navigator.serviceWorker` and `Notification.requestPermission` / `.permission` (no app page has them),
|
|
@@ -28,7 +28,12 @@ on the client side**.
|
|
|
28
28
|
- `akan.ssr.client-static-markup` — a large subtree wraps one or two interactive touches. Keep the interactive
|
|
29
29
|
element in the client component and hoist the static subtree into a server component received as `children`.
|
|
30
30
|
- `akan.ssr.client-mount-load` — a `useEffect(…, [])` loads server data. Fetch it in the route and pass the
|
|
31
|
-
init/view object down.
|
|
31
|
+
init/view object down. A mutation is not a load: send it from a user action (a button through a store action),
|
|
32
|
+
never from the route.
|
|
33
|
+
- `akan.ssr.render-mutation` — a route's stages (a layout's `.notFound()` / `.error()` included), or a same-file
|
|
34
|
+
function they call, send a mutation, which throws `base.error.mutationInRender`: opening a link would perform it.
|
|
35
|
+
Move it to a user action; pass `{ duringRender: true }`, as the option after the endpoint's own arguments, only for
|
|
36
|
+
a write that is harmless to repeat and safe for anyone to trigger.
|
|
32
37
|
- `akan.ssr.module-missing-server-view` — a module renders only from `Template`/`Zone`/`Util` and declares no
|
|
33
38
|
`Unit`/`View`. Add them and have the `Zone` delegate.
|
|
34
39
|
- `akan.ssr.template-client-state` — a `Template` holds form state in `useState`. Bind to the store instead:
|
|
@@ -20,14 +20,21 @@ HTTP verb a mutation is mounted under. `conventions` carries the invariants —
|
|
|
20
20
|
- A websocket carries its credential in the handshake snapshot on `ws.data` (`AppWsData`); clients that hold the token in memory send it with `fetch.setJwt(...)`, which forwards an auth frame over the socket.
|
|
21
21
|
- **Never read the caller's IP off the socket or the request peer — take `.with(Ip)`.** Whenever a federation
|
|
22
22
|
gateway is in front, `ws.remoteAddress` and the child's own peer are the *gateway* (`127.0.0.1`) for every
|
|
23
|
-
caller and for the whole life of every socket. `Ip` reads
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
caller and for the whole life of every socket. `Ip` reads forwarded headers only from a trusted peer — loopback,
|
|
24
|
+
a unix socket, and the private ranges until `AKAN_TRUSTED_PROXIES` (CIDRs or addresses, plus `private`, `none`,
|
|
25
|
+
`*`) replaces them; any other peer is the caller itself. Unset or `*`, it reads `x-real-ip`, else the leftmost
|
|
26
|
+
`x-forwarded-for` entry. A list walks `x-forwarded-for` from the nearest hop to the first untrusted address and
|
|
27
|
+
reads `x-real-ip` only without one — so list the load balancer's and ingress controller's own addresses (or a CIDR
|
|
28
|
+
holding only them), and have the proxy set or append `X-Forwarded-For` rather than pass the client's through.
|
|
29
|
+
`private` lets any pod in those ranges name any caller: pair it with a NetworkPolicy admitting only the ingress.
|
|
30
|
+
From any other peer `x-forwarded-host` / `-proto` / `-port` are dropped before a route runs, so a public proxy
|
|
31
|
+
that rewrites `Host` must be listed, or the browser's mutations fail the cross-site check.
|
|
32
|
+
The gateway hands its children the one address it resolved; `context.getClientIp()` is the same answer inside a
|
|
33
|
+
guard or middleware. It arrives in one canonical spelling, unwrapped from
|
|
27
34
|
its `::ffff:` IPv4-mapped form, so it can address a `udp4` socket as well as identify a caller, and it is
|
|
28
35
|
`null` rather than a placeholder when genuinely unknown — a loopback-looking address for an unknown caller
|
|
29
36
|
is the failure this replaced. The gateway also forwards the client port (`x-forwarded-port`, read with
|
|
30
|
-
`context.getClientPort()`)
|
|
37
|
+
`context.getClientPort()`), host and protocol, each taken from the request only when its peer is trusted.
|
|
31
38
|
- **A device or another server proves itself with a machine token.** `MachineToken.issue({ kind, id, version },
|
|
32
39
|
{ expiresAt? })` in `akanjs/server` signs an EdDSA JWT (`typ: akan-machine+jwt`, `aud: <app>/<environment>`) with
|
|
33
40
|
`AKAN_MACHINE_PRIVATE_KEY`; it never expires unless asked. `akan machine-keygen <file>` writes that key to a file
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
CodegenLock,
|
|
9
9
|
WorkspaceExecutor,
|
|
10
10
|
AppExecutor
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-trjhp735.js";
|
|
12
12
|
import"./index-52w0fvh8.js";
|
|
13
13
|
import {
|
|
14
14
|
GraphClientEntryDiscovery,
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
DevChangePlanner,
|
|
20
20
|
DevGeneratedIndexSync,
|
|
21
21
|
SsrDevBundler
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-eyhqttvh.js";
|
|
23
23
|
import {
|
|
24
24
|
ServerGraphFile
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-0fpeb7x7.js";
|
|
26
26
|
import {
|
|
27
27
|
prepareDevWatchBatch
|
|
28
28
|
} from "./index-a5vmm6x4.js";
|