@akanjs/cli 3.2.0-rc.30 → 3.2.0-rc.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.build-stamp +2 -2
- package/{CodeAgent-c17abdbf.js → CodeAgent-7m6cmdf8.js} +2 -2
- package/{CodeTui-jed1nj82.js → CodeTui-c6de37ea.js} +1 -1
- package/README.ko.md +7 -0
- package/README.md +7 -0
- package/TunnelShare-9ry4vh0y.js +18 -0
- package/{agent.command-9whnc6vb.js → agent.command-3qstwjef.js} +26 -21
- package/akanCode.js +2 -2
- package/{appExecutor-020cyesq.js → appExecutor-79azsb2w.js} +3 -3
- package/{application.command-4eqvyxkw.js → application.command-8y4kxzvc.js} +36 -24
- package/{applicationBuildRunner-frtcrqfd.js → applicationBuildRunner-trfxv3pd.js} +43 -15
- package/buildBatch.proc.js +10 -10
- package/{cloud.command-hbvmeezn.js → cloud.command-zczv575c.js} +28 -28
- package/cloud.script-t268m15f.js +35 -0
- package/{code.command-0ayrenk4.js → code.command-069wchwn.js} +10 -10
- package/context.command-v3e98f2h.js +64 -0
- package/context.runner-3jr6chgz.js +34 -0
- package/{guideline.command-w1grfwh7.js → guideline.command-zwypaqsh.js} +7 -7
- package/guidelines/akanApi/akanApi.instruction.md +1 -1
- package/guidelines/errorCodes/errorCodes.instruction.md +7 -0
- package/guidelines/mcpRule/mcpRule.instruction.md +155 -20
- package/guidelines/queryRule/queryRule.instruction.md +3 -1
- package/guidelines/runtimeRule/runtimeRule.instruction.md +7 -3
- package/guidelines/transportRule/transportRule.instruction.md +28 -0
- package/incrementalBuilder.proc.js +12 -9
- package/{index-5d57kx0s.js → index-275a4r3n.js} +3 -3
- package/{index-6zb17wcm.js → index-2jmvfa62.js} +3 -3
- package/{index-9rv2zt48.js → index-2yn3r67f.js} +78 -25
- package/{index-6pxmcaq8.js → index-3txdtztz.js} +1 -1
- package/{index-nm7nt9vm.js → index-4ss4gkv3.js} +2 -2
- package/{index-9wab2ngg.js → index-612fdtbk.js} +1 -1
- package/{index-7bs463x7.js → index-6dzjer7p.js} +6 -6
- package/{index-qssq2d41.js → index-71y6176j.js} +11 -6
- package/{index-4st0hq72.js → index-73x6z7ym.js} +24 -17
- package/{index-vjbne22r.js → index-7wf8snar.js} +1 -1
- package/{index-yvzm8mby.js → index-9wh04mqy.js} +1 -1
- package/{index-yxkjsyx8.js → index-a860mx0m.js} +2 -2
- package/{index-42jhx2ya.js → index-b2sdtgc7.js} +3 -3
- package/{index-1pjwsh2g.js → index-baccvws5.js} +1 -1
- package/{index-99kjwyma.js → index-c669pbyb.js} +4 -3
- package/{index-prgvqqxe.js → index-cd839jw2.js} +126 -113
- package/{index-6469101k.js → index-dadwp2aw.js} +33 -98
- package/{index-7v7tvgt7.js → index-dmcpetwe.js} +123 -43
- package/{index-ba2xd32s.js → index-e9w8wq0a.js} +27 -22
- package/{index-fp5xf6ef.js → index-ebn9kgea.js} +3 -3
- package/{index-s3m89wt2.js → index-exzkev4k.js} +7 -7
- package/{index-m5gg0wzv.js → index-gec8q5z9.js} +57 -30
- package/{index-m3t28rt3.js → index-gt8phqpt.js} +4 -4
- package/{index-g7jgd4xs.js → index-j592zfqc.js} +1 -1
- package/{index-cb91b6d8.js → index-jek2re5k.js} +3 -3
- package/{index-ffa52fwf.js → index-jf4vk1s0.js} +8 -1
- package/{index-v929w7j7.js → index-kykky4re.js} +59 -15
- package/{index-9wjrwjgz.js → index-nk374pqd.js} +8 -8
- package/{index-28nk8w3j.js → index-pk2ja04e.js} +8 -8
- package/{index-jgj31xvw.js → index-qcp6e2ht.js} +22 -5
- package/{index-at6haq2x.js → index-qyhr8wst.js} +61 -18
- package/{index-f16kr6vj.js → index-s885g0jj.js} +2 -2
- package/{index-bj8s07s7.js → index-t2zhw8c7.js} +4 -4
- package/{index-11d7nh8a.js → index-v7ajmsh3.js} +1 -1
- package/{index-dss3ds74.js → index-w1zexzpx.js} +1 -1
- package/{index-g45y5f3e.js → index-wzp3yg01.js} +1 -1
- package/{index-ze48c0vd.js → index-z92zm3wd.js} +2 -2
- package/{index-na8r4a27.js → index-zfnz878d.js} +1 -1
- package/{index-0gaj78wn.js → index-zmd9xxgd.js} +3 -3
- package/{index-p06kfhdf.js → index-zzebpyr0.js} +4 -4
- package/index.js +27 -27
- package/{libExecutor-tq994592.js → libExecutor-jc6f8hm6.js} +2 -2
- package/{library.command-x219mhcx.js → library.command-nxvesvhb.js} +11 -8
- package/{localRegistry.command-zvdcejhn.js → localRegistry.command-4a655xnq.js} +20 -20
- package/{module.command-k6cwcm7g.js → module.command-aaws9byg.js} +9 -9
- package/{package.command-vw7x09f8.js → package.command-j7hv26p0.js} +10 -10
- package/package.json +8 -8
- package/{page.command-gf06paq2.js → page.command-7yffs7n9.js} +7 -7
- package/{pipeline.command-y07dgj9b.js → pipeline.command-7yk0zcng.js} +8 -7
- package/{pkgExecutor-stde3yc3.js → pkgExecutor-arxmvx4t.js} +2 -2
- package/{primitive.command-edydvh07.js → primitive.command-7a1pt715.js} +10 -10
- package/{projectTypecheck-mk8wefvd.js → projectTypecheck-f4qhbecd.js} +1 -1
- package/{quality.command-mdb45vyr.js → quality.command-08bn42t4.js} +13 -10
- package/{repair.command-kvtaeecy.js → repair.command-r59jat74.js} +9 -9
- package/{scalar.command-sjt9p5e1.js → scalar.command-2ex84spb.js} +8 -8
- package/skills/akan-mcp/SKILL.md +9 -2
- package/skills/akan-validate/SKILL.md +3 -3
- package/{subspace.command-mkkqync4.js → subspace.command-2nxakmk3.js} +16 -13
- package/templates/workspaceRoot/.devcontainer/devcontainer.json.template +1 -1
- package/templates/workspaceRoot/README.ts +4 -2
- package/{tunnel.command-tr5b3030.js → tunnel.command-f7ep1qfa.js} +12 -12
- package/{typeChecker-bfrd1n9n.js → typeChecker-7jt6abrs.js} +1 -1
- package/typecheck.proc.js +3 -2
- package/{verify.command-0p9h8tpp.js → verify.command-xbztwp1r.js} +17 -17
- package/{workflow.command-9mfcwqzj.js → workflow.command-pmyx55y4.js} +18 -15
- package/{workspace.command-5hjtmcfs.js → workspace.command-89p90zvb.js} +36 -36
- package/TunnelShare-mbfcaqg0.js +0 -18
- package/cloud.script-9kmbr3d6.js +0 -35
- package/context.command-php852kf.js +0 -61
- package/context.runner-nngmn7c0.js +0 -34
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-2yn3r67f.js";
|
|
8
8
|
import"./index-j4yvgfhr.js";
|
|
9
|
-
import"./index-
|
|
9
|
+
import"./index-71y6176j.js";
|
|
10
10
|
import"./index-by2tvsq6.js";
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
11
|
+
import"./index-z92zm3wd.js";
|
|
12
|
+
import"./index-zfnz878d.js";
|
|
13
|
+
import"./index-w1zexzpx.js";
|
|
14
14
|
import {
|
|
15
15
|
AkanCodeEnv,
|
|
16
16
|
akanCodePaths2
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
CodeAgentStreamPrinter2,
|
|
21
21
|
WorkspaceTrust
|
|
22
22
|
} from "./index-0dm25wvf.js";
|
|
23
|
-
import"./index-
|
|
23
|
+
import"./index-7wf8snar.js";
|
|
24
24
|
|
|
25
25
|
// pkgs/@akanjs/cli/code/code.runner.ts
|
|
26
26
|
import { randomBytes } from "crypto";
|
|
@@ -82,7 +82,7 @@ class CodeRunner extends runner("code") {
|
|
|
82
82
|
async serve(options, listen) {
|
|
83
83
|
await import("./consoleToStderr-h5bryj94.js");
|
|
84
84
|
const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
|
|
85
|
-
import("./CodeAgent-
|
|
85
|
+
import("./CodeAgent-7m6cmdf8.js"),
|
|
86
86
|
import("./CodeAgentRpcHost-6dzfkvsc.js"),
|
|
87
87
|
import("./CodeAgentRpcListener-tcwrdvst.js")
|
|
88
88
|
]);
|
|
@@ -116,8 +116,8 @@ class CodeRunner extends runner("code") {
|
|
|
116
116
|
}
|
|
117
117
|
async tui(options, seed) {
|
|
118
118
|
const [{ CodeAgent }, { CodeTui }] = await Promise.all([
|
|
119
|
-
import("./CodeAgent-
|
|
120
|
-
import("./CodeTui-
|
|
119
|
+
import("./CodeAgent-7m6cmdf8.js"),
|
|
120
|
+
import("./CodeTui-c6de37ea.js")
|
|
121
121
|
]);
|
|
122
122
|
const start = await CodeRunner.#start(options, { hostAttached: false, interactive: true, ask: true });
|
|
123
123
|
const agentOptions = start.agent;
|
|
@@ -153,7 +153,7 @@ class CodeRunner extends runner("code") {
|
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
async run(prompt, options) {
|
|
156
|
-
const { CodeAgent } = await import("./CodeAgent-
|
|
156
|
+
const { CodeAgent } = await import("./CodeAgent-7m6cmdf8.js");
|
|
157
157
|
const ask = !!process.stdin.isTTY && !!process.stderr.isTTY;
|
|
158
158
|
const start = await CodeRunner.#start(options, { hostAttached: false, interactive: false, ask });
|
|
159
159
|
for (const warning of start.warnings)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
Workspace,
|
|
4
|
+
command
|
|
5
|
+
} from "./index-2yn3r67f.js";
|
|
6
|
+
import"./index-j4yvgfhr.js";
|
|
7
|
+
import"./index-71y6176j.js";
|
|
8
|
+
import"./index-by2tvsq6.js";
|
|
9
|
+
import"./index-z92zm3wd.js";
|
|
10
|
+
import"./index-zfnz878d.js";
|
|
11
|
+
import"./index-w1zexzpx.js";
|
|
12
|
+
import"./index-zmd9xxgd.js";
|
|
13
|
+
import"./index-trffs83s.js";
|
|
14
|
+
import"./index-t2zhw8c7.js";
|
|
15
|
+
import"./index-1p81ecbz.js";
|
|
16
|
+
import"./index-nk374pqd.js";
|
|
17
|
+
import"./index-knpm8sdm.js";
|
|
18
|
+
import"./index-ebn9kgea.js";
|
|
19
|
+
import"./index-612fdtbk.js";
|
|
20
|
+
import"./index-m9jj544v.js";
|
|
21
|
+
import"./index-9wh04mqy.js";
|
|
22
|
+
import"./index-a860mx0m.js";
|
|
23
|
+
import"./index-zyb0ebm4.js";
|
|
24
|
+
import"./index-xs9a3ddt.js";
|
|
25
|
+
import"./index-b2sdtgc7.js";
|
|
26
|
+
import"./index-3txdtztz.js";
|
|
27
|
+
import"./index-gt8phqpt.js";
|
|
28
|
+
import"./index-6dzjer7p.js";
|
|
29
|
+
import"./index-4ss4gkv3.js";
|
|
30
|
+
import"./index-t4d0ckde.js";
|
|
31
|
+
import"./index-pk2ja04e.js";
|
|
32
|
+
import {
|
|
33
|
+
ContextScript
|
|
34
|
+
} from "./index-zzebpyr0.js";
|
|
35
|
+
import"./index-7wf8snar.js";
|
|
36
|
+
|
|
37
|
+
// pkgs/@akanjs/cli/context/context.command.ts
|
|
38
|
+
class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
|
|
39
|
+
context: target({ desc: "Print agent-readable Akan workspace context", readOnly: true }).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) {
|
|
40
|
+
await this.contextScript.context(workspace, { format, app, module });
|
|
41
|
+
}),
|
|
42
|
+
doctor: target({ desc: "Report Akan workspace convention diagnostics", readOnly: true }).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, {
|
|
43
|
+
desc: "report iOS/native config diagnostics (placeholder bundle ids, etc.)",
|
|
44
|
+
default: false
|
|
45
|
+
}).with(Workspace).exec(async function(format, strict, ios, workspace) {
|
|
46
|
+
await this.contextScript.doctor(workspace, { format, strict, ios });
|
|
47
|
+
}),
|
|
48
|
+
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) {
|
|
49
|
+
await this.contextScript.mcpInstall(workspace, targetName, { force, mode });
|
|
50
|
+
}),
|
|
51
|
+
mcp: target({ desc: "Start the Akan MCP server over stdio", stdio: true, readOnly: ({ mode }) => mode !== "apply" }).option("mode", String, { desc: "MCP permission mode", default: "readonly", enum: ["readonly", "plan", "apply"] }).with(Workspace).exec(async function(mode, workspace) {
|
|
52
|
+
await this.contextScript.mcp(workspace, { mode });
|
|
53
|
+
}),
|
|
54
|
+
mcpCall: target({
|
|
55
|
+
desc: "Call one Akan MCP tool for debugging without stdio JSON-RPC",
|
|
56
|
+
readOnly: ({ mode }) => mode !== "apply"
|
|
57
|
+
}).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) {
|
|
58
|
+
await this.contextScript.mcpCall(workspace, tool, { mode, args, format });
|
|
59
|
+
})
|
|
60
|
+
})) {
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
ContextCommand
|
|
64
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ContextRunner2
|
|
4
|
+
} from "./index-nk374pqd.js";
|
|
5
|
+
import"./index-pk2ja04e.js";
|
|
6
|
+
import"./index-b2sdtgc7.js";
|
|
7
|
+
import"./index-4ss4gkv3.js";
|
|
8
|
+
import"./index-6dzjer7p.js";
|
|
9
|
+
import"./index-gt8phqpt.js";
|
|
10
|
+
import"./index-3txdtztz.js";
|
|
11
|
+
import"./index-t4d0ckde.js";
|
|
12
|
+
import"./index-t2zhw8c7.js";
|
|
13
|
+
import"./index-612fdtbk.js";
|
|
14
|
+
import"./index-zmd9xxgd.js";
|
|
15
|
+
import"./index-ebn9kgea.js";
|
|
16
|
+
import"./index-m9jj544v.js";
|
|
17
|
+
import"./index-knpm8sdm.js";
|
|
18
|
+
import"./index-2yn3r67f.js";
|
|
19
|
+
import"./index-xs9a3ddt.js";
|
|
20
|
+
import"./index-zyb0ebm4.js";
|
|
21
|
+
import"./index-trffs83s.js";
|
|
22
|
+
import"./index-a860mx0m.js";
|
|
23
|
+
import"./index-9wh04mqy.js";
|
|
24
|
+
import"./index-7wf8snar.js";
|
|
25
|
+
import"./index-z92zm3wd.js";
|
|
26
|
+
import"./index-zfnz878d.js";
|
|
27
|
+
import"./index-w1zexzpx.js";
|
|
28
|
+
import"./index-71y6176j.js";
|
|
29
|
+
import"./index-j4yvgfhr.js";
|
|
30
|
+
import"./index-1p81ecbz.js";
|
|
31
|
+
import"./index-by2tvsq6.js";
|
|
32
|
+
export {
|
|
33
|
+
ContextRunner2 as ContextRunner
|
|
34
|
+
};
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
script,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-2yn3r67f.js";
|
|
6
6
|
import"./index-j4yvgfhr.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-71y6176j.js";
|
|
8
8
|
import"./index-by2tvsq6.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
9
|
+
import"./index-z92zm3wd.js";
|
|
10
|
+
import"./index-zfnz878d.js";
|
|
11
|
+
import"./index-w1zexzpx.js";
|
|
12
12
|
import {
|
|
13
13
|
Prompter2
|
|
14
14
|
} from "./index-knpm8sdm.js";
|
|
15
|
-
import"./index-
|
|
15
|
+
import"./index-7wf8snar.js";
|
|
16
16
|
|
|
17
17
|
// pkgs/@akanjs/cli/guideline/guideline.script.ts
|
|
18
18
|
import { Logger } from "akanjs/common";
|
|
@@ -37,7 +37,7 @@ class GuidelineScript extends script("guideline") {
|
|
|
37
37
|
|
|
38
38
|
// pkgs/@akanjs/cli/guideline/guideline.command.ts
|
|
39
39
|
class GuidelineCommand extends command("guideline", [GuidelineScript], ({ public: target }) => ({
|
|
40
|
-
guideline: target({ desc: "List or show Akan AI guideline instructions" }).arg("action", String, { desc: "list or show" }).arg("name", String, { desc: "guideline name for show", nullable: true }).exec(async function(action, name) {
|
|
40
|
+
guideline: target({ desc: "List or show Akan AI guideline instructions", readOnly: true }).arg("action", String, { desc: "list or show" }).arg("name", String, { desc: "guideline name for show", nullable: true }).exec(async function(action, name) {
|
|
41
41
|
await this.guidelineScript.guideline(action, name);
|
|
42
42
|
})
|
|
43
43
|
})) {
|
|
@@ -120,7 +120,7 @@ Only on `page()`:
|
|
|
120
120
|
|
|
121
121
|
```ts
|
|
122
122
|
.prompt(name: string, description: string)
|
|
123
|
-
.app<Name extends string>(name: Name & FreeName<Name, Record<never, never>>, description: string, load: (args: RouteBaseArgs) => PromiseOrObject<ReactNode
|
|
123
|
+
.app<Name extends string>(name: Name & FreeName<Name, Record<never, never>>, description: string, load: (args: RouteBaseArgs) => PromiseOrObject<ReactNode>, option?: { static?: boolean; })
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
On `layout()` and `rootLayout()`, where a line replaces its shared form above:
|
|
@@ -73,6 +73,7 @@ Generated from the akanjs sources of this release: every code a framework error
|
|
|
73
73
|
| `listFailed` | 500 | `AkanError` | no | yes | `base/akanError.ts` |
|
|
74
74
|
| `liveAlreadySet` | 500 | `SignalDeclarationError` | no | yes | `signal/signalDeclarationError.ts` |
|
|
75
75
|
| `livePaused` | 409 | `AkanError` | no | yes | `base/akanError.ts` |
|
|
76
|
+
| `liveRoomLimit` | 429 | `LiveRoomLimitError` | yes | yes | `service/liveRoomLimitError.ts` |
|
|
76
77
|
| `liveRoomTaken` | 500 | `AkanError` | no | yes | `base/akanError.ts` |
|
|
77
78
|
| `locked` | 500 | `MigrationError` | no | yes | `server/migration/migrationError.ts` |
|
|
78
79
|
| `logControlUnavailable` | 503 | `LogControlUnavailableError` | no | yes | `server/logging/logTailClient.ts` |
|
|
@@ -95,6 +96,12 @@ Generated from the akanjs sources of this release: every code a framework error
|
|
|
95
96
|
| `payloadTooLarge` | 413 | `ImageOptimizerError` | no | yes | `server/imageOptimizerError.ts` |
|
|
96
97
|
| `planChanged` | 500 | `MigrationError` | no | yes | `server/migration/migrationError.ts` |
|
|
97
98
|
| `redisUriMissing` | 500 | `AkanError` | no | yes | `base/akanError.ts` |
|
|
99
|
+
| `remoteOAuth` | 502 | `RemoteError` | no | yes | `server/remote/remoteError.ts` |
|
|
100
|
+
| `remoteProtocol` | 502 | `RemoteError` | no | yes | `server/remote/remoteError.ts` |
|
|
101
|
+
| `remoteTooLarge` | 502 | `RemoteError` | no | yes | `server/remote/remoteError.ts` |
|
|
102
|
+
| `remoteUnauthorized` | 401 | `RemoteError` | no | yes | `server/remote/remoteError.ts` |
|
|
103
|
+
| `remoteUnavailable` | 502 | `RemoteError` | no | yes | `server/remote/remoteError.ts` |
|
|
104
|
+
| `remoteUrlRejected` | 502 | `RemoteError` | no | yes | `server/remote/remoteError.ts` |
|
|
98
105
|
| `renderAborted` | 499 | `AkanError` | no | yes | `base/akanError.ts` |
|
|
99
106
|
| `routeConflict` | 500 | `AkanError` | no | yes | `base/akanError.ts` |
|
|
100
107
|
| `routeNotFound` | 404 | `AkanError` | no | yes | `base/akanError.ts` |
|
|
@@ -499,6 +499,19 @@ export default page()
|
|
|
499
499
|
- `option.setMcp({ apps: false })` / `AKAN_MCP_APPS=false` publishes no page tools: no app is published and every
|
|
500
500
|
prompt stays a prompt only. `web: { csr: false }` publishes the app tools with no view, and an API-only build
|
|
501
501
|
(`web: false`) has no pages to publish.
|
|
502
|
+
- **`{ static: true }` sends the app as HTML to a host that runs no view.** `.app(name, description, load,
|
|
503
|
+
{ static: true })` marks the tool `_meta["akanjs/static"]: true` wherever the server renders pages, view or not. A
|
|
504
|
+
`tools/call` whose `params._meta["akanjs/render"]` is `"html"` then gets, after the usual blocks, an embedded
|
|
505
|
+
`text/html` resource `ui://<app>/static/<name>`: one document drawn under the caller's credential after the route
|
|
506
|
+
guards, with the load under the same query-only rule — the element inside the root layout's `McpAppRoot` (no
|
|
507
|
+
`_overrides.tsx`), the layout's theme as `data-theme`, `<base href="<web origin>/" target="_blank">`, the stylesheet
|
|
508
|
+
as an absolute link, every Suspense boundary resolved in place, and no `<script>`: no view, no Flight payload,
|
|
509
|
+
nothing runs. Mark an app static only when its server render is the whole picture — nothing hydrates, so a client
|
|
510
|
+
component shows its first state and a button does nothing.
|
|
511
|
+
- **A static app sends no HTML, and the call answers as if none was asked** (with a server warning), when the guards
|
|
512
|
+
refuse, the drawing fails or passes 1 MB, the body is empty or a fallback stands in for content, or a component needs
|
|
513
|
+
a browser: `lazy(…, { ssr: false })` says so itself, and a component whose look only a browser finishes (a canvas, a
|
|
514
|
+
chart drawn in an effect, data read after mount) calls `needsBrowser()` from `akanjs/webkit` while it renders.
|
|
502
515
|
|
|
503
516
|
## Progress Reporting
|
|
504
517
|
**`McpProgress.report(n, { total, message })`** reports progress from anywhere inside a call, a service or adapter
|
|
@@ -543,29 +556,79 @@ at every event.
|
|
|
543
556
|
lists the toolkits. An opened toolkit's tools are listed from the next round on; `openToolkit` never reaches
|
|
544
557
|
`approve` and counts as no tool call. A resume reopens what stored calls and a summary's `toolkits` opened.
|
|
545
558
|
- **The open screen's tools.** `clientTools` takes `new AgentClientTools().list()` from a page the member has open
|
|
546
|
-
(`akanjs/ui`), sent over your own transport. It is client input
|
|
547
|
-
|
|
548
|
-
|
|
559
|
+
(`akanjs/ui`), sent over your own transport. It is client input: a name an endpoint holds is dropped, every one
|
|
560
|
+
counts as a write whatever `readOnly` it was sent with, and past 128 tools, 200,000 characters of definitions or
|
|
561
|
+
64 levels of nesting the run ends with `agent.error.clientToolsRefused` (413, `data.limit` `"tools"`, `"chars"` or
|
|
562
|
+
`"depth"`). Which of them may run after a read is the app's to say, in `approve`, by name. The run never runs one:
|
|
563
|
+
`approve` is asked, then the run ends `awaiting` with `client: true`. Have the page `run(call)` and resume with
|
|
564
|
+
what it returned as `answer` — or `answer: { id, error }` when no page answers. The page keeps its own rule beside
|
|
565
|
+
the run's: `run(call)` asks the member through `host.approve` when a call that changes something follows a `taint:
|
|
566
|
+
"source"` read. The run's rule below is the wider one, counting every result, the page's included, so with no
|
|
567
|
+
`approve` a client call is refused once the run has read anything; an `approve` that allows a client call leaves
|
|
568
|
+
that question to the page.
|
|
549
569
|
- **Asking the member.** `ask: true` lists `askUser({ question, choices?, multiple? })`, the in-page chat's own tool.
|
|
550
|
-
A call ends the run `awaiting` with `question: true`; put the question to the member
|
|
551
|
-
`{ id,
|
|
552
|
-
|
|
553
|
-
- **
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
`
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
570
|
+
A call ends the run `awaiting` with `question: true`; put the question to the member and resume with
|
|
571
|
+
`answer: { id, result }` — or `{ id, error }` when they dismiss it. It never reaches `approve`, counts as no tool
|
|
572
|
+
call, and `untrusted` never sees the answer. A `clientTools` entry by that name is dropped.
|
|
573
|
+
- **Answering a parked call.** `answer` is the only way in for what a client sends, and `messages` holds only your
|
|
574
|
+
own user messages and what `onMessage` handed over: never append a client's result to them. Never take `messages`
|
|
575
|
+
from a request either: store what `onMessage` hands out, and pass from the client only `answer`, as a tool message
|
|
576
|
+
a client wrote reads exactly like one the run stored. Pass `answer` only after an `awaiting` event with `client`
|
|
577
|
+
or `question` named that call. `approve` is not asked about an answered call, as nothing runs on the server, so an
|
|
578
|
+
answer given for a call `approve` deferred, or for one a run died before parking on, is stored as it stands. A run
|
|
579
|
+
parks on one call, the first of its last batch that nothing answered, so `answer` is accepted for that call alone
|
|
580
|
+
and only when it is a client tool's or `askUser`'s. The run names the result after the call, whatever name was
|
|
581
|
+
sent, hands it to `onMessage`, emits it as a `toolResult` and runs the calls the batch has left. Every part of it
|
|
582
|
+
is bounded: `result`, `error` and `changes` as one value are clipped at 20,000 characters like a tool's result,
|
|
583
|
+
`code` is kept only when it is a failure code, and of its `attachments` the first four carrying `data` or `text`
|
|
584
|
+
are kept, never a `url`. An endpoint tool's call is answered only by running it: an `answer` naming one, a call
|
|
585
|
+
the run has not reached, or a call already answered ends the run with `agent.error.answerRefused` before anything
|
|
586
|
+
runs, and a resume without it carries on. Only `askUser`'s answer is the member's own word; a client tool's always
|
|
587
|
+
taints the run, by the rule below. A call parked with `connect` takes one answer only, the user's refusal as
|
|
588
|
+
`{ id, error }`; see "Calling Another Server".
|
|
589
|
+
- **Other servers.** `remotes` takes other MCP servers, each a toolkit named after it: none is listed or contacted
|
|
590
|
+
until the model opens it, and its tools then read `<name>.<tool>`. See "Calling Another Server" below.
|
|
591
|
+
- **Writes after a read.** What a tool returns may be text someone else wrote, so the run is tainted from the first
|
|
592
|
+
result of a call that ran — an endpoint tool's or a client tool's, an error included — and every later call
|
|
593
|
+
reaches `approve(call, { tainted, tool, client })` with `tainted` set, and `client: true` when the call is to a
|
|
594
|
+
page's tool. `askUser`'s answer, `openToolkit`'s and a call the run refused without running taint nothing. A
|
|
595
|
+
remote is the exception on each count: opening one taints the run, and so does any call into one, refused or not,
|
|
596
|
+
whatever `untrusted` returns and with none given. A batch is judged before it runs, since the model wrote it
|
|
597
|
+
before reading its results. Without `approve`, a `needsConfirm`
|
|
598
|
+
tool — on this catalogue, a mutation with the `destructive` hint above — is refused, and so is every write once
|
|
599
|
+
tainted: such a run writes only in the batch written before any result, and a later write is answered with the
|
|
600
|
+
code `writeAfterRead` and a sentence naming the two ways on. Pass `approve` to decide those calls, or pass
|
|
601
|
+
`untrusted(result)` to say which endpoint results carry another party's text: `(result) => !own.has(result.name)`
|
|
602
|
+
trusts the endpoints you name, and `() => false` trusts every endpoint result, which is right only when nothing
|
|
603
|
+
they return was written by anyone but the app and the member. No endpoint option says whose text a tool returns —
|
|
604
|
+
`readOnly` says only that it changes nothing — so the predicate is where that is declared. It is never asked about
|
|
605
|
+
a client tool's answer, which taints the run whatever it is named: a page may lend a tool under the name of an
|
|
606
|
+
endpoint this run does not list, and a predicate reading names would trust it. Only `approve` lets a write follow
|
|
607
|
+
a page's answer. `"defer"` holds the whole batch, emits `awaiting` and ends the run as `"awaiting"`.
|
|
608
|
+
- **Resuming.** Store each message `onMessage` hands over — it is awaited, and a retried run may hand one over twice
|
|
609
|
+
— and call `loop` again with them. A stored result is read as the answer to the call its id names, under that
|
|
610
|
+
call's name. It is judged as an endpoint's only when that call names an endpoint this run lists: any other, a
|
|
611
|
+
page's tool, a remote's, the open of a remote or a tool this run no longer has, taints the run without asking
|
|
612
|
+
`untrusted`, whatever mark it was stored with. The run's own answer to a tool name the model made up,
|
|
613
|
+
`Unknown tool: <name>.` with nothing beside it, taints nothing, and neither does its own sentence for a connection
|
|
614
|
+
the user refused. Keep `ask`, `toolkits` and `remotes` the same for
|
|
615
|
+
the life of a transcript: a stored `askUser` or `openToolkit` answer is the run's own only under the options it
|
|
616
|
+
was given with, and one whose name the page lends taints. Trailing calls nothing answered go to `approve` again before any model call, and the taint is rebuilt from
|
|
617
|
+
the `tainted` marks on stored messages and by re-applying `untrusted`, which sees a result whole during the run
|
|
618
|
+
and clipped on a resume; with no `untrusted` every stored tool result taints, a refusal included, as a resume
|
|
619
|
+
cannot tell one from a result. Store every message whole, marks included. `compacted` says the first `replaced`
|
|
620
|
+
messages are now `summary`; its `tainted` marker stands in for the results it replaced, and a summary with no
|
|
621
|
+
marker counts as tainted. A batch's results reach `onMessage` one tool message a call, as each call finishes, so a
|
|
622
|
+
resume runs only the calls that had not finished, even after a crash mid-batch. It cannot tell a call that was
|
|
623
|
+
running when the run died from one that never started: both go to `approve` again and run again, so a write that
|
|
624
|
+
must not land twice needs an idempotent endpoint or an `approve` that defers it. A stored result of that batch
|
|
625
|
+
which `untrusted` marks taints them too: a resume judges on everything stored, where an uninterrupted run judges a
|
|
626
|
+
batch before any of it runs.
|
|
566
627
|
- **Metering.** Each model call, compactions included, is its own turn for the request policy, the quota and the
|
|
567
628
|
usage hook. It gets a fresh `id`, `loop { id, round }`, a copy of the request's `meta` — server-set, so it may key
|
|
568
|
-
billing — empty headers and no ip. The relay's default size caps skip loop rounds
|
|
629
|
+
billing — empty headers and no ip. The relay's default size caps skip loop rounds, except in a run that lists
|
|
630
|
+
`clientTools` or names `remotes`: its turns carry `loop.client` or `loop.remote`, and one past
|
|
631
|
+
`AgentRelayPolicy.defaultLimits` ends the run with `agent.error.requestRefused`. A refused quota ends the run as
|
|
569
632
|
`"quota"`.
|
|
570
633
|
- **Limits.** `maxRounds` (12), `budget { tokens, toolCalls, wallMs }` (`"budget"`), `signal` (`"aborted"`) and a
|
|
571
634
|
provider cut (`"length"`). A limit that is not a valid number is an `error` before any model call. `wallMs` and
|
|
@@ -580,6 +643,78 @@ at every event.
|
|
|
580
643
|
error. An adaptor with its own size cap throws that error with `{ limit, requested }` in its own unit, bytes
|
|
581
644
|
included, and the run lowers `at` to where that request would have fit.
|
|
582
645
|
|
|
646
|
+
## Calling Another Server — `remotes`
|
|
647
|
+
|
|
648
|
+
The other direction: an agent running here calls another server's `/mcp` as the signed-in user. The other server needs
|
|
649
|
+
no change; any akan app is one already, and so is any MCP server that speaks OAuth 2.1 with dynamic registration.
|
|
650
|
+
|
|
651
|
+
```ts
|
|
652
|
+
// lib/option.ts — off by default, since it lets a signed-in user make this server call an address they name
|
|
653
|
+
export const option = new AkanOption<ModulesOptions>().transformEnv((env) => ({ ...env, remote: { enabled: true } }));
|
|
654
|
+
|
|
655
|
+
// a service that runs the loop
|
|
656
|
+
const remotes = this.remoteService.sources(account, [
|
|
657
|
+
{ name: "shop", url: project.serverUrl, description: "Orders and refunds of the shop this project runs." },
|
|
658
|
+
]);
|
|
659
|
+
for await (const event of this.agentService.loop({ account, allow, messages, remotes, approve, onMessage })) {
|
|
660
|
+
if (event.type === "awaiting" && event.connect) /* tell the page: this run waits for a connection to event.connect */;
|
|
661
|
+
}
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
- **A connection is the user's own OAuth grant at the other server.** `libs/shared`'s `remote` service registers this
|
|
665
|
+
app there once, sends the user to that server's consent page, and keeps the tokens sealed on the server. The other
|
|
666
|
+
server judges every call by its own guards, as it judges any agent's, so `Person` endpoints stay closed. Accounts
|
|
667
|
+
are never matched across servers.
|
|
668
|
+
- **Connecting happens in the chat.** Opening a remote the account has no connection to ends the run `awaiting` with
|
|
669
|
+
`connect: "<name>"` and leaves the call unanswered. Render `<Remote.Util.Connect url={…} onConnected={resume} />`:
|
|
670
|
+
it opens the other server's sign-in in a window and calls back once `page/remote/callback` finished the exchange.
|
|
671
|
+
Resume with the stored messages and no `answer`, and the run opens the toolkit itself. When the user declines,
|
|
672
|
+
resume with `answer: { id, error }` for that call. The `error` only says that they refused: the run stores a
|
|
673
|
+
sentence of its own naming the remote, coded `remoteDeclined`, as the open's result and goes on, and none of your
|
|
674
|
+
text reaches the model or `onMessage`. That sentence taints neither this run nor a later resume, while the error
|
|
675
|
+
of an open that failed still does. The stored messages do not say why a run stopped at an open, so a refusal is
|
|
676
|
+
taken for any first unanswered open of a remote, one in a batch `approve` deferred included: all it does is keep
|
|
677
|
+
that open from running, and the rest of the batch is judged as usual. An `answer` carrying a `result` for an open
|
|
678
|
+
is refused with
|
|
679
|
+
`agent.error.answerRefused`, as only the server sees whether a connection exists.
|
|
680
|
+
- **What a remote lists and returns is another party's text.** Opening a remote taints the run, whatever `untrusted`
|
|
681
|
+
says and with none given: its tools' names, descriptions and schemas reach the model with the open, and so does
|
|
682
|
+
the error of an open that failed. A resume reads it off the stored call, mark or no mark: a stored result of a
|
|
683
|
+
`<name>.<tool>` call, or of an `openToolkit` call that names a remote, taints unasked. An open that only asks the
|
|
684
|
+
user to connect taints nothing. A call's arguments leave for that server,
|
|
685
|
+
and `readOnly` is the remote's own word for its tool, so a request with `remotes` and no `approve` is refused
|
|
686
|
+
before any model call, as `base.error.requiredArgument` naming `approve`: pass one with `remotes`. It is told the
|
|
687
|
+
target as `state.remote`, and hears a tool the remote does not call read-only as a `needsConfirm` one. Show the
|
|
688
|
+
user that server's name and the arguments before allowing a write: a record on one server can ask the model to
|
|
689
|
+
write to another.
|
|
690
|
+
- **Names.** A remote's `name` is `[a-z][A-Za-z0-9]{0,15}` and may not be a toolkit's. A tool name too long or with
|
|
691
|
+
characters a provider refuses is listed under a shortened alias and still called by its real name. A run takes
|
|
692
|
+
at most 120 tools from one remote, a description to 1,000 characters and a parameter schema to 8,000, and stops
|
|
693
|
+
listing at 120,000 characters in all; the open's result counts the tools left out as `omitted`. Pass `allow` in
|
|
694
|
+
the remote's entry to choose which tools those are. A run keeps at most four remotes open, as each listing rides
|
|
695
|
+
every later round: the open of a fifth is answered with an error and that server is not contacted. Of a call's
|
|
696
|
+
result the run keeps `result`, `error`, `code`, `changes` and `attachments`, each bounded as the parts of an
|
|
697
|
+
`answer` are, and nothing else the remote sent; the run's rounds meet the relay's size caps (see Metering).
|
|
698
|
+
- **Addresses.** `url` is the server's address or its MCP endpoint; a bare origin means `/mcp`. Every request goes
|
|
699
|
+
through `RemoteFetch`: https only, no private address, no redirect, the checked address pinned. A local run
|
|
700
|
+
(`operationMode: "local"`) reaches loopback over http, so two dev servers can connect; `remote.allowUrl` narrows
|
|
701
|
+
the addresses an app accepts.
|
|
702
|
+
- **A screen in the result.** When the called tool is a `page().app()`, the `toolResult` event carries `view`
|
|
703
|
+
(`{ remote, tool, args, href?, static?, resourceUri? }`) beside the result, without an `href` or `resourceUri`
|
|
704
|
+
longer than 2,048 characters. It never reaches the model or `onMessage`; store it yourself and draw `<Remote.Zone.Screen url tool={view.tool} args={view.args} href={view.href}
|
|
705
|
+
drawn={view.static} />`. For an app the other server declared `{ static: true }` the card asks `remoteScreen` for
|
|
706
|
+
that server's script-less HTML when it scrolls into view and shows it in a frame that runs no script; for any other
|
|
707
|
+
app, draw `<Remote.Zone.View url tool args uri={view.resourceUri} href />`: it frames that server's view (its
|
|
708
|
+
client bundle) with scripts on but no origin, under a policy that lets it load only from that server and connect
|
|
709
|
+
nowhere, and relays the view's own calls to that one server through `McpAppHost` (`akanjs/webkit`). A view cannot
|
|
710
|
+
write into the model's context, and a link it opens must stay on its server. Neither card stores what it drew: the
|
|
711
|
+
HTML and the view's data are fetched again on every draw, since what the user may see there can change. A view
|
|
712
|
+
weighs over a megabyte, so prefer `{ static: true }` on the other server for anything a person only reads.
|
|
713
|
+
- **Not published onward.** The connection endpoints take `Person` and are `mcp: false`, and remote tools exist only
|
|
714
|
+
inside the run: an outside agent connected to this app's `/mcp` never reaches a user's other servers through it.
|
|
715
|
+
|
|
716
|
+
Without `libs/shared`, build each entry from `RemoteSource` (`akanjs/server`) with your own `access { token, renew }`.
|
|
717
|
+
|
|
583
718
|
## Rolling MCP Out To An App
|
|
584
719
|
|
|
585
720
|
The goal of exposing a service over MCP is that a person uses it through an agent instead of through the page:
|
|
@@ -129,7 +129,9 @@ this is the full contract behind them.
|
|
|
129
129
|
server has one database, so it covers every model, hooks and query-level writes included; a nested call joins the
|
|
130
130
|
outer one, with no savepoint. Cache, `memory` and outside calls are not in it — hand them to
|
|
131
131
|
`this.afterCommit(fn)`, run once the commit lands, never after a rollback, at once outside one; one that throws is
|
|
132
|
-
logged, never thrown, and the rest still run. On SQLite it holds the only write turn:
|
|
132
|
+
logged, never thrown, and the rest still run. On SQLite it holds the only write turn: another request's write
|
|
133
|
+
waits until it ends, its read does not and sees the last commit. Keep it short, and never await inside it a write
|
|
134
|
+
started outside it.
|
|
133
135
|
`@Transaction()` is deprecated.
|
|
134
136
|
|
|
135
137
|
## Text Search In A Filter — `q.search()`
|
|
@@ -200,7 +200,8 @@ normalized to `info` with one warning.
|
|
|
200
200
|
- **The hub lives with whoever owns the surface**: the gateway when there is one, the replica itself under solo
|
|
201
201
|
(`AKAN_REPLICA=0,0,1`), the same rule as the rotating log file and `/_akan/app/*`. It keeps a ring
|
|
202
202
|
(`AKAN_LOG_BUFFER` records / `AKAN_LOG_BUFFER_MB`, default 2000 / 4), suppresses a line repeating more than 20
|
|
203
|
-
times a second into one counted line, and
|
|
203
|
+
times a second into one counted line there, in live tails and in the log file (never a request line; the ndjson
|
|
204
|
+
stdout gets every record), and serves `<runtimeDir>/akan-control.sock` (`0600`, NDJSON). A child
|
|
204
205
|
forwards records only while a subscriber wants that level (`log.level` IPC), so an unwatched process sends
|
|
205
206
|
nothing; `AKAN_LOG_STREAM=1` keeps it on. The RSC worker forwards to its replica the same way.
|
|
206
207
|
- **`akan logs <app>`** is the client: `--level --grep --endpoint --trace --child --role --origin --since`
|
|
@@ -216,9 +217,12 @@ normalized to `info` with one warning.
|
|
|
216
217
|
solo replica) its only writer** — every other server process turns its console off and forwards from
|
|
217
218
|
`AKAN_LOG_STDOUT_LEVEL` (default: the console level); a child's or the RSC worker's crash stack is wrapped as a
|
|
218
219
|
`raw=true` record instead of breaking the stream. Text stays the default; turn it on in the deployment.
|
|
219
|
-
- **`AKAN_LOG_STREAM_TOKEN` mounts `/_akan/app/logs`** (SSE, `Last-Event-ID` resume, explicit `gap` events
|
|
220
|
+
- **`AKAN_LOG_STREAM_TOKEN` mounts `/_akan/app/logs`** (SSE, `Last-Event-ID` resume, explicit `gap` events;
|
|
221
|
+
a client that stops reading holds at most 4 MiB of live records beyond a resume's replay, hears `{type:"dropped",count}` when it reads again, and is cut off
|
|
222
|
+
past 10,000 dropped records);
|
|
220
223
|
unset, the route does not exist. The same bearer also unlocks the health detail and metrics.
|
|
221
|
-
- **`AKAN_LOG_CANONICAL=1|slow`** writes one `ok|error <endpoint> ms= status=` line per call
|
|
224
|
+
- **`AKAN_LOG_CANONICAL=1|slow`** writes one `ok|error <endpoint> ms= status=` line per call, at `info`, `warn` under
|
|
225
|
+
500, or `error` with `type` and `stack` for a 5xx (then the only 5xx record); **`AKAN_LOG_FLIGHT=1`**
|
|
222
226
|
keeps each call's last 64 sub-level records and promotes them (`flight=true`) only when it failed or ran past
|
|
223
227
|
`AKAN_LOG_FLIGHT_MS`; an `x-akan-debug` header lowers one request to `trace` — under the local dev runtime, or
|
|
224
228
|
with the `AKAN_LOG_DEBUG_HEADER` secret.
|
|
@@ -233,6 +233,34 @@ HTTP verb a mutation is mounted under. `conventions` carries the invariants —
|
|
|
233
233
|
``await this.rateLimit.consume(`otp:${phone}`, { calls: 5, windowMs: 3_600_000 })``, which answers
|
|
234
234
|
`{ ok: true } | { ok: false, retryAfterMs }` and is never switched off — throw the module's own `Err` with the
|
|
235
235
|
wait when it refuses.
|
|
236
|
+
- **Rooms per socket are capped at 256, live or not** (`option.setLiveRoomLimit({ roomsPerSocket })`, merged in
|
|
237
|
+
mount order with the app last; `AKAN_LIVE_ROOMS_PER_SOCKET=<count>|off` wins over it). A subscribe past the cap is
|
|
238
|
+
refused with 429 `base.error.liveRoomLimit`, `data: { limit, per: "socket" }`; the rooms already held keep their events,
|
|
239
|
+
subscribing a held room again does not count twice, and leaving a room or closing the socket frees its place.
|
|
240
|
+
- **Rooms per caller are capped at 2,000 per server process**, across its sockets (`roomsPerCaller`,
|
|
241
|
+
`AKAN_LIVE_ROOMS_PER_CALLER`). The caller is `accountKey(account)`, else the address (`addressBlockOf`: an IPv4
|
|
242
|
+
address, mapped or not, as itself, an IPv6 one by its /64); one whose address is unknown is bounded per socket
|
|
243
|
+
only. A subscribe past it is refused the same way with `per: "caller"`, and the count drops as its sockets leave
|
|
244
|
+
rooms or close. Sockets per address stay unlimited: this count bounds the rooms whatever their number.
|
|
245
|
+
- **Live rooms per model are capped at 50,000 per server process** (`roomsPerModel` in the same setting,
|
|
246
|
+
`AKAN_LIVE_ROOMS_PER_MODEL`), counting only the rooms every write evaluates: those no equality index files and the
|
|
247
|
+
invalidating ones. An indexed room is reached through its key and never counts. A new counted room past it is
|
|
248
|
+
refused the same way with `per: "model"`, existing rooms keep working, and the refusal is warned at most once a
|
|
249
|
+
minute per model. It is a backstop behind the per-caller cap, which about 25 distinct callers at 2,000 rooms each
|
|
250
|
+
can reach; both count per server process, not across replicas.
|
|
251
|
+
- **A subscribe refused with 429 names its room** (`requestRoomId` on the error frame) and echoes the subscribe
|
|
252
|
+
frame's `token`, so the client ignores a refusal that answers an earlier subscribe of the room. Refused with
|
|
253
|
+
`liveRoomLimit`, the client drops that room, so a reconnect does not send it again, and calls the subscriber's
|
|
254
|
+
`onRefused(error)` fetch policy once. Refused for a budget (`tooManyRequests`), it sends the subscribe again after
|
|
255
|
+
the frame's `data.seconds` (1 to 60) plus up to a second of jitter per attempt, resyncs the room on the retry's
|
|
256
|
+
ack as a reconnect does, and drops the room the same way after five tries without an ack. A live slice whose room is dropped shows the error as a message, marks its list
|
|
257
|
+
stale, and subscribes again only on its next watch, such as the next mount — never in a loop.
|
|
258
|
+
- **Subscribe frames have a budget of their own**, over every pubsub endpoint: 1,000 a minute per websocket, counted
|
|
259
|
+
before the arguments are read, and 10,000 a minute per caller (the same caller as the room cap; one whose address
|
|
260
|
+
is unknown is counted per socket only), shared through the cache. A reconnect resubscribing every held room fits
|
|
261
|
+
either. `option.setRateLimit({ subscribe: { perSocket, perCaller } })` changes them (`{ calls,
|
|
262
|
+
windowMs? }`, or `false` to lift one; `subscribe: false` lifts both), and `AKAN_RATE_LIMIT=off` and a `local`
|
|
263
|
+
environment turn them off with every other budget. A refusal is the same 429 `base.error.tooManyRequests`.
|
|
236
264
|
|
|
237
265
|
## Calling Another Server
|
|
238
266
|
|
|
@@ -3,21 +3,21 @@ import {
|
|
|
3
3
|
HmrWatcher,
|
|
4
4
|
WatchRootResolver,
|
|
5
5
|
ApplicationBuildReporter
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-dmcpetwe.js";
|
|
7
7
|
import {
|
|
8
8
|
CodegenLock,
|
|
9
9
|
WorkspaceExecutor
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-71y6176j.js";
|
|
11
11
|
import"./index-by2tvsq6.js";
|
|
12
12
|
import"./index-j4yvgfhr.js";
|
|
13
13
|
import {
|
|
14
14
|
AppExecutor2
|
|
15
|
-
} from "./index-
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
15
|
+
} from "./index-z92zm3wd.js";
|
|
16
|
+
import"./index-zfnz878d.js";
|
|
17
|
+
import"./index-w1zexzpx.js";
|
|
18
18
|
import {
|
|
19
19
|
ServerGraphFile
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-9wh04mqy.js";
|
|
21
21
|
import {
|
|
22
22
|
GraphClientEntryDiscovery,
|
|
23
23
|
RouteClientBuilder,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
DevChangePlanner,
|
|
28
28
|
DevGeneratedIndexSync,
|
|
29
29
|
SsrDevBundler
|
|
30
|
-
} from "./index-
|
|
30
|
+
} from "./index-jek2re5k.js";
|
|
31
31
|
import"./index-trffs83s.js";
|
|
32
32
|
import {
|
|
33
33
|
FrameworkGraph
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
import {
|
|
42
42
|
prepareDevWatchBatch
|
|
43
43
|
} from "./index-a5vmm6x4.js";
|
|
44
|
-
import"./index-
|
|
44
|
+
import"./index-7wf8snar.js";
|
|
45
45
|
|
|
46
46
|
// pkgs/@akanjs/devkit/incrementalBuilder/incrementalBuilder.proc.ts
|
|
47
47
|
import path6 from "path";
|
|
@@ -880,7 +880,10 @@ class SsrRegistry {
|
|
|
880
880
|
#ssrArming = null;
|
|
881
881
|
#ssrBroken = false;
|
|
882
882
|
#ssrCrashedAt = null;
|
|
883
|
-
static #crashRetryMs
|
|
883
|
+
static get #crashRetryMs() {
|
|
884
|
+
const ms = Number(process.env.AKAN_DEV_SSR_CRASH_RETRY_MS);
|
|
885
|
+
return Number.isInteger(ms) && ms > 0 ? ms : 1e4;
|
|
886
|
+
}
|
|
884
887
|
constructor(app, { logger, lanes, artifactDir }, links) {
|
|
885
888
|
this.#app = app;
|
|
886
889
|
this.#logger = logger;
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-2yn3r67f.js";
|
|
6
6
|
import {
|
|
7
7
|
FileSys2
|
|
8
8
|
} from "./index-by2tvsq6.js";
|
|
9
9
|
import {
|
|
10
10
|
PkgExecutor2
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-w1zexzpx.js";
|
|
12
12
|
import {
|
|
13
13
|
FrameworkGraph
|
|
14
14
|
} from "./index-p7beqww9.js";
|
|
15
15
|
import {
|
|
16
16
|
MaintainabilityBaseline
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-baccvws5.js";
|
|
18
18
|
import {
|
|
19
19
|
TypeScriptDependencyScanner2
|
|
20
20
|
} from "./index-2ny1e95c.js";
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-2yn3r67f.js";
|
|
6
6
|
import {
|
|
7
7
|
CommandExecutionError,
|
|
8
8
|
LibSource,
|
|
9
9
|
formatLibStatuses
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-71y6176j.js";
|
|
11
11
|
import {
|
|
12
12
|
LibExecutor2
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-zfnz878d.js";
|
|
14
14
|
import {
|
|
15
15
|
assertPlainName
|
|
16
16
|
} from "./index-va90m8nd.js";
|