@akanjs/devkit 3.3.0-rc.1 → 3.3.0-rc.11
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/CHANGELOG.md +230 -2
- package/README.ko.md +3 -2
- package/README.md +3 -3
- package/akanApp/akanApp.host.test.ts +22 -5
- package/akanApp/akanApp.host.ts +46 -9
- package/akanApp/akanApp.host.wiring.test.ts +206 -2
- package/akanApp/devBackend.ts +3 -1
- package/akanApp/devBuilder.ts +5 -1
- package/akanApp/devStartTimeline.test.ts +115 -0
- package/akanApp/devStartTimeline.ts +69 -0
- package/akanConfig/akanConfig.test.ts +57 -8
- package/akanConfig/akanConfig.ts +12 -65
- package/akanConfig/dockerImage.ts +17 -0
- package/akanConfig/nativeKeys.ts +52 -0
- package/app/applicationBuildRunner.test.ts +49 -1
- package/app/applicationBuildRunner.ts +3 -1
- package/codeAgent/agent/CodeAgent.ts +36 -16
- package/codeAgent/agent/CodeAgentAllowed.ts +35 -0
- package/codeAgent/agent/CodeAgentCommandLine.ts +372 -0
- package/codeAgent/agent/CodeAgentGate.ts +23 -4
- package/codeAgent/agent/CodeAgentRpcHost.ts +1 -1
- package/codeAgent/agent/codeAgent.test.ts +62 -0
- package/codeAgent/agent/codeAgentCommandLine.test.ts +212 -0
- package/codeAgent/agent/codeAgentContract.test.ts +117 -5
- package/codeAgent/skills/akan-agent/SKILL.md +8 -1
- package/codeAgent/skills/akan-code/SKILL.md +38 -3
- package/codeAgent/skills/akan-page/SKILL.md +18 -13
- package/codeAgent/skills/akan-runtime/SKILL.md +21 -16
- package/codeAgent/skills/akan-service/SKILL.md +2 -2
- package/docs/apiReference.test.ts +5 -0
- package/docs/apiReference.ts +7 -3
- package/docs/declarationReader.ts +28 -1
- package/executors/appExecutor.ts +35 -11
- package/executors/executors.test.ts +30 -3
- package/frontendBuild/buildCacheStamp.test.ts +42 -0
- package/frontendBuild/buildCacheStamp.ts +23 -0
- package/frontendBuild/buildRouteClient.test.ts +2 -7
- package/frontendBuild/clientEntryDiscovery.ts +2 -2
- package/frontendBuild/cssCandidateCache.test.ts +70 -1
- package/frontendBuild/cssCandidateCache.ts +17 -10
- package/frontendBuild/cssCompiler.test.ts +112 -0
- package/frontendBuild/cssCompiler.ts +41 -21
- package/frontendBuild/devBarrelImports.test.ts +30 -0
- package/frontendBuild/devBarrelImports.ts +2 -2
- package/frontendBuild/fontOptimizer.test.ts +144 -3
- package/frontendBuild/fontOptimizer.ts +103 -18
- package/frontendBuild/pagesBundleBuilder.ts +3 -1
- package/frontendBuild/plainStylesheet.test.ts +155 -0
- package/frontendBuild/plainStylesheet.ts +197 -0
- package/frontendBuild/rscServerRendererGuard.test.ts +60 -0
- package/frontendBuild/rscServerRendererGuard.ts +68 -0
- package/frontendBuild/ssrBaseArtifactBuilder.test.ts +30 -1
- package/frontendBuild/ssrBaseArtifactBuilder.ts +40 -12
- package/guideline/agentAssets.test.ts +10 -0
- package/guideline/agentAssets.ts +52 -11
- package/incrementalBuilder/buildBatch.proc.ts +11 -10
- package/incrementalBuilder/buildBatchProtocol.ts +2 -1
- package/incrementalBuilder/builderBoot.ts +14 -7
- package/incrementalBuilder/builderChannel.ts +8 -2
- package/incrementalBuilder/builderGraphPayloads.ts +4 -4
- package/incrementalBuilder/builderLanes.ts +2 -2
- package/incrementalBuilder/builderWatch.ts +8 -8
- package/incrementalBuilder/csrRegistry.ts +4 -4
- package/incrementalBuilder/incrementalBuilder.host.test.ts +16 -0
- package/incrementalBuilder/incrementalBuilder.host.ts +7 -1
- package/incrementalBuilder/incrementalBuilder.proc.test.ts +41 -0
- package/incrementalBuilder/incrementalBuilder.proc.ts +9 -8
- package/incrementalBuilder/ssrRegistry.ts +6 -6
- package/index.ts +1 -1
- package/integration/renderAdmissionSoak.test.ts +99 -0
- package/integration/renderAdmissionSoak.ts +609 -0
- package/mobile/nativeConfig.test.ts +100 -0
- package/mobile/nativeConfig.ts +55 -16
- package/mobile/nativePublicEnv.ts +2 -1
- package/package.json +14 -169
- package/packageExports.test.ts +38 -24
- package/transforms/barrelAnalyzer.ts +2 -2
- package/transforms/transforms.test.ts +3 -3
- package/tunnel/createTunnel.test.ts +29 -8
- package/tunnel/createTunnel.ts +18 -11
- package/util/fileEditor.ts +1 -0
- package/util/fileSys.test.ts +13 -0
- package/util/fileSys.ts +2 -2
- package/util/selectModel.ts +1 -0
- package/workspace/getRelatedCnsts.ts +7 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { CodeAgentCommandLine } from "./CodeAgentCommandLine";
|
|
3
|
+
|
|
4
|
+
const names = (line: string) => CodeAgentCommandLine.allowable(line);
|
|
5
|
+
|
|
6
|
+
describe("CodeAgentCommandLine.allowable", () => {
|
|
7
|
+
test("a command is named by its program, and by its sub-command where that is what matters", () => {
|
|
8
|
+
expect(names("ls -la apps")).toEqual(["ls"]);
|
|
9
|
+
expect(names("git status --short")).toEqual(["git status"]);
|
|
10
|
+
expect(names("bun test --isolate ./a.test.ts")).toEqual(["bun test"]);
|
|
11
|
+
expect(names("bun x cowsay hi")).toEqual(["bun x"]);
|
|
12
|
+
expect(names("kubectl get pods -n web")).toEqual(["kubectl get"]);
|
|
13
|
+
expect(names("akan verify @akanjs/cli")).toEqual(["akan verify"]);
|
|
14
|
+
expect(names("bunx tsc --noEmit")).toEqual(["bunx tsc"]);
|
|
15
|
+
expect(names("./scripts/check.sh --all")).toEqual(["./scripts/check.sh"]);
|
|
16
|
+
expect(names("/usr/bin/git diff")).toEqual(["/usr/bin/git diff"]);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("a harmless variable set in front of a command does not change its name", () => {
|
|
20
|
+
expect(names("CI=1 NODE_ENV=test bun test")).toEqual(["bun test"]);
|
|
21
|
+
expect(
|
|
22
|
+
names("FORCE_COLOR=0 NO_COLOR=1 TZ=UTC LANG=C LC_ALL=C.UTF-8 TERM=dumb DEBUG=app:* PORT=3000 bun test"),
|
|
23
|
+
).toEqual(["bun test"]);
|
|
24
|
+
expect(names("CI=1; ls")).toEqual(["ls"]);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test("any other variable set in front of a command, or one whose value is not a plain word, has no name to remember", () => {
|
|
28
|
+
for (const line of [
|
|
29
|
+
"GIT_SSH_COMMAND='ssh -i key' git status",
|
|
30
|
+
"PATH=/tmp/bin git status",
|
|
31
|
+
"GIT_PAGER=less git log",
|
|
32
|
+
"LD_PRELOAD=./x.so ls",
|
|
33
|
+
"BASH_ENV=./x.sh ls",
|
|
34
|
+
"NODE_OPTIONS=--require=./x.js bun test",
|
|
35
|
+
"CI=1 PATH=/tmp/bin ls",
|
|
36
|
+
"PATH=/tmp/bin; git status",
|
|
37
|
+
'CI="1" bun test',
|
|
38
|
+
"CI=\\1 bun test",
|
|
39
|
+
"CI=$X bun test",
|
|
40
|
+
"CI=$(date) bun test",
|
|
41
|
+
"CI+=1 bun test",
|
|
42
|
+
"TZ=~/zone ls",
|
|
43
|
+
"'CI=1' ls",
|
|
44
|
+
])
|
|
45
|
+
expect(names(line)).toBeUndefined();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test("every command of a compound line is named once", () => {
|
|
49
|
+
expect(names("cd apps && bun test; git status | head -5 || git status")).toEqual([
|
|
50
|
+
"cd",
|
|
51
|
+
"bun test",
|
|
52
|
+
"git status",
|
|
53
|
+
"head",
|
|
54
|
+
]);
|
|
55
|
+
expect(names("(cd apps && ls) & wait")).toEqual(["cd", "ls", "wait"]);
|
|
56
|
+
expect(names('echo "at $(git rev-parse HEAD)" $(date +%s)')).toEqual(["git rev-parse", "date", "echo"]);
|
|
57
|
+
expect(names("bun test\ngit diff --stat")).toEqual(["bun test", "git diff"]);
|
|
58
|
+
expect(names("bun test \\\n --bail # stop early")).toEqual(["bun test"]);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test("quotes keep a separator inside an argument, and are read through in a program's name", () => {
|
|
62
|
+
expect(names(`git commit -m "fix: a && b; c | d"`)).toEqual(["git commit"]);
|
|
63
|
+
expect(names(`grep -rn 'a|b' src`)).toEqual(["grep"]);
|
|
64
|
+
expect(names(`'git' "status"`)).toEqual(["git status"]);
|
|
65
|
+
expect(names(`echo \\; done`)).toEqual(["echo"]);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test("a redirection is read past when it writes no file", () => {
|
|
69
|
+
expect(names("bun test 2>&1 | tail -20")).toEqual(["bun test", "tail"]);
|
|
70
|
+
expect(names("bun test > /dev/null 2>&1")).toEqual(["bun test"]);
|
|
71
|
+
expect(names("bun test &>/dev/null")).toEqual(["bun test"]);
|
|
72
|
+
expect(names("sort < names.txt")).toEqual(["sort"]);
|
|
73
|
+
expect(names("grep -c x <<< hello")).toEqual(["grep"]);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test("a line that writes a file through a redirection has no name to remember", () => {
|
|
77
|
+
for (const line of ["echo hi > out.txt", "echo hi >> ~/.zshrc", "bun test 2> err.log", "ls &> all.log", "ls >&out"])
|
|
78
|
+
expect(names(line)).toBeUndefined();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test("the always-asked commands have no name to remember, however they are spelled", () => {
|
|
82
|
+
for (const line of [
|
|
83
|
+
"curl https://example.com",
|
|
84
|
+
"ssh deploy@host",
|
|
85
|
+
"git push",
|
|
86
|
+
"git push origin main",
|
|
87
|
+
"/usr/bin/git push",
|
|
88
|
+
`git "push" -f`,
|
|
89
|
+
"g''it pu\\sh",
|
|
90
|
+
"rm -rf build",
|
|
91
|
+
"/bin/rm a.txt",
|
|
92
|
+
"RM a.txt",
|
|
93
|
+
"sudo ls",
|
|
94
|
+
"env FOO=1 ls",
|
|
95
|
+
"timeout 5 bun test",
|
|
96
|
+
"ls | xargs wc -l",
|
|
97
|
+
"sh -c 'ls'",
|
|
98
|
+
"bash scripts/x.sh",
|
|
99
|
+
"eval ls",
|
|
100
|
+
"ls && rm a.txt",
|
|
101
|
+
"echo $(curl https://example.com)",
|
|
102
|
+
'echo "$(rm a.txt)"',
|
|
103
|
+
"(git push)",
|
|
104
|
+
])
|
|
105
|
+
expect(names(line)).toBeUndefined();
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test("a command the shell itself uses to run another, or to set what a later one runs, has no name to remember", () => {
|
|
109
|
+
for (const line of [
|
|
110
|
+
"builtin eval ls",
|
|
111
|
+
"source ./x.sh",
|
|
112
|
+
". ./x.sh",
|
|
113
|
+
"trap 'ls' EXIT",
|
|
114
|
+
"alias a='ls'",
|
|
115
|
+
"coproc ls",
|
|
116
|
+
"export PATH=/tmp/bin",
|
|
117
|
+
"declare -x A=1",
|
|
118
|
+
"typeset -x A=1",
|
|
119
|
+
"readonly A=1",
|
|
120
|
+
"ls && export CI=1",
|
|
121
|
+
])
|
|
122
|
+
expect(names(line)).toBeUndefined();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
test("a redirection that opens a connection has no name to remember", () => {
|
|
126
|
+
for (const line of [
|
|
127
|
+
"bun test </dev/tcp/host/80",
|
|
128
|
+
"bun test < /dev/udp/host/53",
|
|
129
|
+
"cat <//dev/tcp/host/80",
|
|
130
|
+
"ls > /dev/tcp/host/80",
|
|
131
|
+
"ls 3<>/dev/tcp/host/80",
|
|
132
|
+
"sort < $FILE",
|
|
133
|
+
])
|
|
134
|
+
expect(names(line)).toBeUndefined();
|
|
135
|
+
expect(names('grep -c x <<< "$VALUE"')).toEqual(["grep"]);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
test("a command that sends something out of the machine has no name to remember", () => {
|
|
139
|
+
for (const line of [
|
|
140
|
+
"npm publish",
|
|
141
|
+
"pnpm publish --no-git-checks",
|
|
142
|
+
"yarn publish",
|
|
143
|
+
"yarn npm publish",
|
|
144
|
+
"bun publish",
|
|
145
|
+
"cargo publish",
|
|
146
|
+
"docker push repo/image",
|
|
147
|
+
"docker image push repo/image",
|
|
148
|
+
"docker compose push",
|
|
149
|
+
"docker build --push -t repo/image .",
|
|
150
|
+
"docker buildx build --push=true .",
|
|
151
|
+
"ls && npm publish",
|
|
152
|
+
])
|
|
153
|
+
expect(names(line)).toBeUndefined();
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
test("gh is named two words deep, and gh api has no name to remember", () => {
|
|
157
|
+
expect(names("gh pr view 12")).toEqual(["gh pr view"]);
|
|
158
|
+
expect(names("gh issue list --state open")).toEqual(["gh issue list"]);
|
|
159
|
+
expect(names("gh status")).toEqual(["gh status"]);
|
|
160
|
+
expect(names("gh pr view 12 && gh pr merge 12")).toEqual(["gh pr view", "gh pr merge"]);
|
|
161
|
+
for (const line of [
|
|
162
|
+
"gh",
|
|
163
|
+
"gh api repos/o/r",
|
|
164
|
+
"gh api -X POST repos/o/r",
|
|
165
|
+
"gh pr --repo o/r merge 12",
|
|
166
|
+
"gh -R o/r pr view",
|
|
167
|
+
])
|
|
168
|
+
expect(names(line)).toBeUndefined();
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
test("a line continued after a space joins its words, and one continued inside a word joins the word", () => {
|
|
172
|
+
expect(names("git \\\npush")).toBeUndefined();
|
|
173
|
+
expect(names("git \\\n push origin main")).toBeUndefined();
|
|
174
|
+
expect(names("git \\\nstatus")).toEqual(["git status"]);
|
|
175
|
+
expect(names("git\\\npush")).toEqual(["gitpush"]);
|
|
176
|
+
expect(names("git \\\r\npush")).toBeUndefined();
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
test("a sub-command that is not the word right after its program is not guessed", () => {
|
|
180
|
+
for (const line of ["git -C ../other push", "git --git-dir=x status", "git", "bun --cwd apps test", "git $SUB"])
|
|
181
|
+
expect(names(line)).toBeUndefined();
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
test("a line it cannot read with confidence has no name", () => {
|
|
185
|
+
for (const line of [
|
|
186
|
+
"",
|
|
187
|
+
"FOO=1",
|
|
188
|
+
"# only a comment",
|
|
189
|
+
"echo `date`",
|
|
190
|
+
"$TOOL --version",
|
|
191
|
+
"for f in *.ts; do wc -l $f; done",
|
|
192
|
+
"if true; then ls; fi",
|
|
193
|
+
"! ls",
|
|
194
|
+
"[ -f a ] && ls",
|
|
195
|
+
"{ ls; }",
|
|
196
|
+
"find . -name '*.log' -exec cat {} \\;",
|
|
197
|
+
"cat <<EOF\nhi\nEOF",
|
|
198
|
+
"diff <(ls a) <(ls b)",
|
|
199
|
+
"echo $((1 + 2))",
|
|
200
|
+
"echo $'a\\x62'",
|
|
201
|
+
// biome-ignore lint/suspicious/noTemplateCurlyInString: a shell expansion, not a template
|
|
202
|
+
"echo ${A:-$(date)}",
|
|
203
|
+
"ls 'unterminated",
|
|
204
|
+
'ls "unterminated',
|
|
205
|
+
"ls )",
|
|
206
|
+
"echo $(ls",
|
|
207
|
+
"ls >",
|
|
208
|
+
"ls > > a",
|
|
209
|
+
])
|
|
210
|
+
expect(names(line)).toBeUndefined();
|
|
211
|
+
});
|
|
212
|
+
});
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
} from "akanjs/common";
|
|
17
17
|
import { akanCodeModelWarnings } from "./akanCodeModel";
|
|
18
18
|
import { CodeAgentAsks } from "./CodeAgentAsks";
|
|
19
|
+
import { CodeAgentCommandLine } from "./CodeAgentCommandLine";
|
|
19
20
|
import { CodeAgentEventMapper } from "./CodeAgentEventMapper";
|
|
20
21
|
import { CodeAgentGate } from "./CodeAgentGate";
|
|
21
22
|
import { CodeAgentStreamPrinter } from "./CodeAgentStreamPrinter";
|
|
@@ -107,7 +108,15 @@ describe("codeAgentPresets", () => {
|
|
|
107
108
|
|
|
108
109
|
test("web asks before writing even though the runner is isolated", () => {
|
|
109
110
|
expect(codeAgentPresets.web(root).approval).toBe("writes");
|
|
110
|
-
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
test("local asks before a shell command and nothing else, and a pod asks about neither", () => {
|
|
114
|
+
const local = new CodeAgentGate(codeAgentPresets.local(root));
|
|
115
|
+
expect(local.verdict("bash", { command: "git status" }).approval).toBe("run: git status");
|
|
116
|
+
expect(local.verdict("bash", { command: "curl https://example.com" }).strict).toBe(true);
|
|
117
|
+
expect(local.verdict("write", { path: "a.ts" })).toEqual({});
|
|
118
|
+
expect(local.verdict("read", { path: "a.ts" })).toEqual({});
|
|
119
|
+
expect(new CodeAgentGate(codeAgentPresets.pod(root)).verdict("bash", { command: "git status" })).toEqual({});
|
|
111
120
|
});
|
|
112
121
|
|
|
113
122
|
test("every preset denies env files and secrets", () => {
|
|
@@ -134,6 +143,8 @@ describe("codeAgentPresets", () => {
|
|
|
134
143
|
});
|
|
135
144
|
});
|
|
136
145
|
|
|
146
|
+
const localUnasked = () => ({ ...codeAgentPresets.local(root), approval: "never" as const });
|
|
147
|
+
|
|
137
148
|
describe("CodeAgentGate", () => {
|
|
138
149
|
test("blocks a path on the deny list", () => {
|
|
139
150
|
const gate = new CodeAgentGate(codeAgentPresets.local(root));
|
|
@@ -174,6 +185,107 @@ describe("CodeAgentGate", () => {
|
|
|
174
185
|
});
|
|
175
186
|
});
|
|
176
187
|
|
|
188
|
+
describe("CodeAgentGate allow for this session", () => {
|
|
189
|
+
const gate = () => new CodeAgentGate(codeAgentPresets.local(root));
|
|
190
|
+
const allow = (target: CodeAgentGate, names: string[]) => {
|
|
191
|
+
target.allowed.offer("a0", names);
|
|
192
|
+
target.allowed.settle("a0", true);
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
test("a command asks with the name a session answer would remember", () => {
|
|
196
|
+
expect(gate().verdict("bash", { command: "git status --short" })).toEqual({
|
|
197
|
+
approval: "run: git status --short",
|
|
198
|
+
remember: ["git status"],
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
test("an allowed command runs unasked, and another sub-command of its program still asks", () => {
|
|
203
|
+
const local = gate();
|
|
204
|
+
allow(local, ["git status", "bun test"]);
|
|
205
|
+
expect(local.verdict("bash", { command: "git status" })).toEqual({});
|
|
206
|
+
expect(local.verdict("bash", { command: "bun test --isolate ./a.test.ts" })).toEqual({});
|
|
207
|
+
expect(local.verdict("bash", { command: "git diff" }).remember).toEqual(["git diff"]);
|
|
208
|
+
expect(local.verdict("bash", { command: "bun x cowsay" }).remember).toEqual(["bun x"]);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
test("a compound line runs unasked only once every command in it is allowed, and offers the ones that are not", () => {
|
|
212
|
+
const local = gate();
|
|
213
|
+
allow(local, ["bun test"]);
|
|
214
|
+
const line = { command: "cd apps && bun test 2>&1 | tail -20" };
|
|
215
|
+
expect(local.verdict("bash", line).remember).toEqual(["cd", "tail"]);
|
|
216
|
+
allow(local, ["cd"]);
|
|
217
|
+
expect(local.verdict("bash", line).remember).toEqual(["tail"]);
|
|
218
|
+
allow(local, ["tail"]);
|
|
219
|
+
expect(local.verdict("bash", line)).toEqual({});
|
|
220
|
+
expect(local.verdict("bash", { command: "bun test && echo $(git log -1)" }).remember).toEqual(["git log", "echo"]);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
test("a networking command, git push, rm and a command that runs another are asked every time with no session answer", () => {
|
|
224
|
+
const local = gate();
|
|
225
|
+
allow(local, [...CodeAgentCommandLine.alwaysAsked, "git", "ls", "echo"]);
|
|
226
|
+
for (const command of [
|
|
227
|
+
"curl https://example.com",
|
|
228
|
+
"curl http://127.0.0.1:3000/health",
|
|
229
|
+
"ls && ssh deploy@host",
|
|
230
|
+
"git push",
|
|
231
|
+
"git push origin main",
|
|
232
|
+
"ls; rm -rf build",
|
|
233
|
+
"sudo ls",
|
|
234
|
+
"timeout 5 ls",
|
|
235
|
+
"sh -c 'ls'",
|
|
236
|
+
"ls | xargs echo",
|
|
237
|
+
"source ./x.sh",
|
|
238
|
+
"npm publish",
|
|
239
|
+
"gh api user",
|
|
240
|
+
"PATH=/tmp/bin ls",
|
|
241
|
+
"ls </dev/tcp/host/80",
|
|
242
|
+
]) {
|
|
243
|
+
const verdict = local.verdict("bash", { command });
|
|
244
|
+
expect(verdict.approval).toBeDefined();
|
|
245
|
+
expect(verdict.remember).toBeUndefined();
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
test("a networking command stays asked every time where network requests are not asked about", () => {
|
|
250
|
+
const { askOutside: _ask, ...network } = codeAgentPresets.local(root).network;
|
|
251
|
+
const quiet = new CodeAgentGate({ ...codeAgentPresets.local(root), network });
|
|
252
|
+
expect(quiet.verdict("bash", { command: "curl https://example.com" })).toEqual({
|
|
253
|
+
approval: "run: curl https://example.com",
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
test("a line that cannot be split with confidence, or that writes a file by redirection, asks with no session answer", () => {
|
|
258
|
+
const local = gate();
|
|
259
|
+
allow(local, ["echo", "ls", "wc"]);
|
|
260
|
+
for (const command of ["echo `ls`", "for f in a b; do wc -l $f; done", "echo hi > ~/.zshrc", "ls | wc -l > n.txt"])
|
|
261
|
+
expect(local.verdict("bash", { command })).toEqual({ approval: `run: ${command}` });
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
test("forgetting what was allowed asks again", () => {
|
|
265
|
+
const local = gate();
|
|
266
|
+
allow(local, ["ls"]);
|
|
267
|
+
expect(local.allowed.names).toEqual(["ls"]);
|
|
268
|
+
expect(local.allowed.clear()).toBe(1);
|
|
269
|
+
expect(local.verdict("bash", { command: "ls" }).remember).toEqual(["ls"]);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
test("a file write that waits for approval has no session answer", () => {
|
|
273
|
+
const web = new CodeAgentGate(codeAgentPresets.web(root));
|
|
274
|
+
expect(web.verdict("write", { path: "a.ts" })).toEqual({ approval: "write a.ts" });
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
test("an approval still waiting is covered once the names it offered are all allowed", () => {
|
|
278
|
+
const local = gate();
|
|
279
|
+
local.allowed.offer("a1", ["bun test"]);
|
|
280
|
+
local.allowed.offer("a2", ["bun test"]);
|
|
281
|
+
local.allowed.offer("a3", ["bun test", "cd"]);
|
|
282
|
+
expect(local.allowed.settle("a1", true)).toEqual(["bun test"]);
|
|
283
|
+
expect(local.allowed.covered()).toEqual(["a2"]);
|
|
284
|
+
expect(local.allowed.settle("a2", false)).toEqual([]);
|
|
285
|
+
expect(local.allowed.covered()).toEqual([]);
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
|
|
177
289
|
describe("CodeAgentAsks", () => {
|
|
178
290
|
const questionOf = (questionId: string): CodeAgentQuestion => ({
|
|
179
291
|
questionId,
|
|
@@ -409,15 +521,15 @@ describe("CodeAgentGate bash", () => {
|
|
|
409
521
|
expect(gate.verdict("bash", { command: "openssl x509 -in server.pem" }).block).toContain(".pem");
|
|
410
522
|
});
|
|
411
523
|
|
|
412
|
-
test("leaves an ordinary command alone", () => {
|
|
413
|
-
const gate = new CodeAgentGate(
|
|
524
|
+
test("leaves an ordinary command alone where commands are not asked about", () => {
|
|
525
|
+
const gate = new CodeAgentGate(localUnasked());
|
|
414
526
|
expect(gate.verdict("bash", { command: "bun test --isolate" })).toEqual({});
|
|
415
527
|
expect(gate.verdict("bash", { command: "grep -r TODO ." })).toEqual({});
|
|
416
528
|
});
|
|
417
529
|
});
|
|
418
530
|
|
|
419
531
|
describe("CodeAgentGate secrets", () => {
|
|
420
|
-
const gate = () => new CodeAgentGate(
|
|
532
|
+
const gate = () => new CodeAgentGate(localUnasked());
|
|
421
533
|
|
|
422
534
|
test("a per-environment server env file is refused for read, write and shell, and its loader is not", () => {
|
|
423
535
|
const file = "apps/a/env/env.server.main.ts";
|
|
@@ -477,7 +589,7 @@ describe("CodeAgentGate secrets", () => {
|
|
|
477
589
|
});
|
|
478
590
|
|
|
479
591
|
describe("CodeAgentGate network", () => {
|
|
480
|
-
const gate = () => new CodeAgentGate(
|
|
592
|
+
const gate = () => new CodeAgentGate(localUnasked());
|
|
481
593
|
|
|
482
594
|
test("the local profile asks before fetching a host off its list, and not for a listed one or loopback", () => {
|
|
483
595
|
expect(gate().verdict("web_fetch", { url: "https://example.com/x" })).toEqual({
|
|
@@ -36,7 +36,14 @@ agent nothing, and only the current page's declarations are live.
|
|
|
36
36
|
|
|
37
37
|
- `st.use.x({ agent: false })` hides a key; `hidden`, `secret` and `visual` fields are stripped from every read.
|
|
38
38
|
- Page text is data the model reads, never instructions: after a screen read the next call that changes something
|
|
39
|
-
asks once, and `data-agent-private="<label>"` keeps a region's text out of every read.
|
|
39
|
+
asks once, and `data-agent-private="<label>"` keeps a region's text out of every read. An `@` mention of a record
|
|
40
|
+
counts as a screen read.
|
|
41
|
+
- A turn's context carries ids, enum members, numbers and booleans. Any other string, a search param, a path
|
|
42
|
+
param or a list row's title included, is left out and read with `readState` or `readScreen`, so instructions say
|
|
43
|
+
"read `searchParams`", never "the query is in the route context". A search param rides inline when a store
|
|
44
|
+
declares its key with `search()`; of the others at most four short ones do. A zone's `label` and a value
|
|
45
|
+
published with `st.expose`, `st.useState` or `useAgentResource` ride whole: publish an id or a count there, never
|
|
46
|
+
text a user wrote.
|
|
40
47
|
- A tool value is capped at 20,000 characters.
|
|
41
48
|
- Route guidance is `<Agent.Guide instructions="…" />`; model-facing text is English.
|
|
42
49
|
|
|
@@ -139,13 +139,48 @@ akan code -i "<prompt>" open the session with the prompt already sent
|
|
|
139
139
|
--compact-at <percent> compact once the window is this full (10, 20, … 100)
|
|
140
140
|
--trust-workspace start this repo's MCP servers and extensions without asking
|
|
141
141
|
--no-ask-network never ask before an unlisted host (local profile)
|
|
142
|
+
--no-ask-commands run shell commands without asking (local profile)
|
|
143
|
+
--no-ask both of those at once: this session asks before nothing it runs (local profile)
|
|
142
144
|
--rpc-listen unix:<path>|tcp:[host:]<port> serve the RPC wire on a socket instead of stdio
|
|
143
145
|
```
|
|
144
146
|
|
|
145
147
|
`local` runs as the user: it refuses known secret files and the home credential stores, and asks before it
|
|
146
|
-
fetches a page from a host off a short documentation list or a shell command that
|
|
147
|
-
(`curl`, `ssh`, …)
|
|
148
|
-
|
|
148
|
+
runs a shell command, fetches a page from a host off a short documentation list, or runs a shell command that
|
|
149
|
+
reaches the network (`curl`, `ssh`, …). Where nobody can answer, as in a one-shot `akan code "<prompt>"` or
|
|
150
|
+
inside a sub-agent, an ordinary command runs unasked and those network calls are refused outright. It is not a
|
|
151
|
+
sandbox; `pod` in a container is.
|
|
152
|
+
|
|
153
|
+
An approval for a shell command reads `approve? run: <command> [y/n/a]`. `y` runs it once, `n` or esc refuses
|
|
154
|
+
it, and `a` runs it and stops asking about that command until the session ends. What `a` remembers is the
|
|
155
|
+
program, and the sub-command too for `git`, `bun`, `bunx`, `npm`, `npx`, `pnpm`, `yarn`, `akan`, `docker`,
|
|
156
|
+
`kubectl`, `helm`, `cargo` and `go`: allowing `git status` leaves `git diff` asked about, and allowing
|
|
157
|
+
`bun test` leaves `bun x` asked about. `gh` is remembered two words deep, so allowing `gh pr view` leaves
|
|
158
|
+
`gh pr merge` asked about. A line of several commands (`&&`, `;`, `|`, `$(…)`, a subshell) runs unasked only
|
|
159
|
+
once every command in it is allowed, and its prompt names the ones `a` would add. `/allowed` lists what the
|
|
160
|
+
session has allowed and `/allowed clear` forgets it. Nothing is written down: a resumed, forked or reloaded
|
|
161
|
+
session asks again.
|
|
162
|
+
|
|
163
|
+
Some lines are asked about every time and their prompt offers only `[y/n]`:
|
|
164
|
+
|
|
165
|
+
- a networking command: `curl`, `wget`, `nc`, `ncat`, `netcat`, `socat`, `telnet`, `ssh`, `scp`, `sftp`,
|
|
166
|
+
`rsync`, `ftp`, and a redirection to or from `/dev/tcp/…` or `/dev/udp/…`;
|
|
167
|
+
- a command that sends something out of the machine: `git push`, `npm publish`, `pnpm publish`,
|
|
168
|
+
`yarn publish`, `yarn npm`, `bun publish`, `cargo publish`, `gh api`, and a `docker` line with `push` or
|
|
169
|
+
`--push` in it (`docker push`, `docker image push`, `docker build --push`);
|
|
170
|
+
- `rm`;
|
|
171
|
+
- a command that runs another, or sets what a later one runs: `sudo`, `env`, `command`, `exec`, `nohup`,
|
|
172
|
+
`time`, `timeout`, `nice`, `watch`, `stdbuf`, `xargs`, `sh`, `bash`, `zsh`, `dash`, `ksh`, `fish`, `eval`,
|
|
173
|
+
`builtin`, `source`, `.`, `trap`, `alias`, `coproc`, `export`, `declare`, `typeset`, `readonly`, `find -exec`;
|
|
174
|
+
- a variable set in front of a command, other than `CI`, `NODE_ENV`, `FORCE_COLOR`, `NO_COLOR`, `TZ`, `LANG`,
|
|
175
|
+
`LC_ALL`, `TERM`, `DEBUG` or `PORT` given one plain word (`CI=1 bun test` is read as `bun test`);
|
|
176
|
+
- a line that writes a file with `>` or `>>` (other than to `/dev/null`);
|
|
177
|
+
- a line the reader cannot split with confidence: a loop or `if`, backticks, a here-document, a program named
|
|
178
|
+
by a variable, a flag between `git` and its sub-command.
|
|
179
|
+
|
|
180
|
+
`--no-ask` is `--no-ask-commands --no-ask-network` under one name, for a run where the user has decided not to
|
|
181
|
+
be asked: it prints one line at start saying so. It changes nothing else: the secret files stay refused, this
|
|
182
|
+
repo's MCP servers and extensions still wait for their own approval (`--trust-workspace`), the agent's own
|
|
183
|
+
questions are still asked, and the other profiles behave as they did.
|
|
149
184
|
|
|
150
185
|
A `tcp:` listener asks every connection to open with `{"auth":"<token>"}` on its first line; the token is a
|
|
151
186
|
fresh one in `~/.akan/code/rpc/<port>.token`, or the one in the file `AKAN_CODE_RPC_TOKEN_FILE` names.
|
|
@@ -26,19 +26,19 @@ export default page()
|
|
|
26
26
|
## Steps
|
|
27
27
|
|
|
28
28
|
1. Place the file: `<route>.tsx` or `<dir>/_index.tsx` serves the path, `_layout.tsx` nests a layout (`layout()`;
|
|
29
|
-
the root one is `rootLayout()`), `[id]` is a dynamic segment, `(group)` groups without a segment.
|
|
30
|
-
route modules only — no helpers, no `.ts` files.
|
|
29
|
+
the root one is `rootLayout()`), `[id]` is a dynamic segment, `(group)` groups without a segment.
|
|
31
30
|
2. Name every `[x]` segment with `.param("x", Type)` and read a query key only with `.search("k", Type)`. Values
|
|
32
|
-
arrive typed
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
arrive typed: `ID` / `String` → string, `Int` / `Float` → number, `Boolean`, `Date` → Dayjs, an `enumOf` class →
|
|
32
|
+
its union, `[T]` → array. A path value the type refuses answers not-found, and a search value that fails is
|
|
33
|
+
dropped. `lang` reaches every stage and is never declared.
|
|
34
|
+
3. Gate with `.guard(() => signedIn())` on the `_layout.tsx`, and repeat a stricter guard on a page that needs more.
|
|
35
|
+
`.guard((_, { path }) => signedIn({ path }))` sends a refused visitor to `/signin?redirect=<path>`.
|
|
36
36
|
4. In `.render()`: `usePage()`, then fetch, then return. Hand `fetch.init*` / `view*` / `edit*` fields to sections
|
|
37
37
|
unawaited; await only what the shell reads, in one `Promise.all`.
|
|
38
|
-
5. `.head()` takes JSX (or a function returning it), never a metadata object.
|
|
39
|
-
page's own head.
|
|
38
|
+
5. `.head()` takes JSX (or a function returning it), never a metadata object.
|
|
40
39
|
6. Re-skin an `akanjs/ui` component for a subtree with `_overrides.tsx`:
|
|
41
|
-
`export default override({ Slot: AppComponent })`, no logic.
|
|
40
|
+
`export default override({ Slot: AppComponent })`, no logic. Nested ones merge slot by slot, the closest winning;
|
|
41
|
+
`componentRule` lists the slots.
|
|
42
42
|
|
|
43
43
|
## API at a glance
|
|
44
44
|
|
|
@@ -50,12 +50,16 @@ declared params and search keys plus `lang`.
|
|
|
50
50
|
where `Book` is the `common/` interface for the query's `Any` return (`akan-service`).
|
|
51
51
|
- Async page: `.render(async ({ id }) => { const book = (await fetch.book(id)) as Book | null; if (!book) return router.notFound(); … })`;
|
|
52
52
|
the same query in `.head()` and `.render()` is one request.
|
|
53
|
+
- Loading: `.loading(() => <Skeleton />)` on a page or layout is what that level shows until its `.render()` and the
|
|
54
|
+
levels below it resolve; the levels above it stream first.
|
|
53
55
|
- `router.notFound()` from `.guard()`, `.head()` or `.render()` answers 404 with the nearest layout's `.notFound()`
|
|
54
56
|
above it (an unmatched URL: the deepest layout covering it), else the built-in 404.
|
|
55
57
|
- A layout's own 404 and error views: `.notFound(({ pathname }) => …)` and `.error(({ error }) => …)` on `layout()`
|
|
56
|
-
or `rootLayout()`.
|
|
58
|
+
or `rootLayout()`. A `<title>` and `<meta>` at the top of what they return replace the page's head:
|
|
59
|
+
`.notFound(() => <><title>Not found</title>…</>)`, except below a `.loading()`, where the head is already out.
|
|
57
60
|
- `<Link href="/books/OL45804W">`: write the path without the locale; Link adds it, or leaves it off for the default
|
|
58
|
-
locale under `i18n.localePrefix: "as-needed"`.
|
|
61
|
+
locale under `i18n.localePrefix: "as-needed"`. It renders an `<a>` and takes its attributes; `activeClassName`
|
|
62
|
+
marks the current one.
|
|
59
63
|
- From a handler: `router.push(href)` / `router.replace(href)`; in a server stage, `router.redirect(href)`.
|
|
60
64
|
- A client filter kept in the URL without reloading the page: ``router.replace(`/books?q=${q}`, { shallow: true,
|
|
61
65
|
scrollToTop: false })`` in a `"use client"` component, read back with `usePageLocation().searchParams`. Shallow
|
|
@@ -68,5 +72,6 @@ declared params and search keys plus `lang`.
|
|
|
68
72
|
- `useState`, `useEffect`, comments, a named export beside the chain, or the legacy `export default async function`.
|
|
69
73
|
- Editing a lib page through its link in `page/(libs)/` — edit the lib's own `page/` source.
|
|
70
74
|
|
|
71
|
-
Full detail: `get_guideline` with `pageRule
|
|
72
|
-
signature, the router's methods, Link's props and every
|
|
75
|
+
Full detail: `get_guideline` with `pageRule` (guards in depth, heads, MCP apps, CSR root layouts, lib pages), or
|
|
76
|
+
`ssrRule` for what may render on the server. Every stage's signature, the router's methods, Link's props and every
|
|
77
|
+
import path are in the `akanApi-*` references below.
|
|
@@ -5,8 +5,9 @@ description: "Configure how an app runs: web surfaces, route prefixes, gateway v
|
|
|
5
5
|
|
|
6
6
|
# Akan runtime
|
|
7
7
|
|
|
8
|
-
Runtime and build settings are declared in `akan.config.ts
|
|
9
|
-
|
|
8
|
+
Runtime and build settings are declared in `akan.config.ts`. What must hold when you edit it, `main.ts` or an env
|
|
9
|
+
file — the prefixes, the `main.ts` import, the image, log sinks, the desktop server's guard — is the `config` rule in
|
|
10
|
+
the agent guide's Path Rules table.
|
|
10
11
|
|
|
11
12
|
## Where each setting lives
|
|
12
13
|
|
|
@@ -16,28 +17,32 @@ Domain code reaches none of them.
|
|
|
16
17
|
| Move the API or websocket mount | `new AkanApp({ prefix, websocketPrefix })` in `main.ts`, mirrored in `api: { … }`; read with `getApiPrefix()` / `getWsPrefix()` |
|
|
17
18
|
| The production image | `docker: string \| { image, preRuns, postRuns, command }` |
|
|
18
19
|
| iOS, Android, desktop | the `native` section; `desktop: { server: true }` carries the server |
|
|
19
|
-
| SQLite, several databases, a cluster | `database: { modes: [...] }`, picked by `AKAN_DATABASE_MODE` |
|
|
20
|
+
| SQLite, several databases, a cluster | `database: { modes: [...] }` (`single`, `multiple`, `cluster`), picked by `AKAN_DATABASE_MODE` |
|
|
20
21
|
| URLs without `/<locale>/`: one language, or paths fixed from outside (OAuth callback, QR code, mail link) | `i18n: { localePrefix: "as-needed" }` — the default locale's pages and `<Link>` hrefs drop the prefix, other locales keep it |
|
|
21
22
|
|
|
22
|
-
- `main.ts` imports `AkanApp` from `akanjs/server/akanApp`, never the barrel.
|
|
23
|
-
- Never write `/api` or `/ws` literally, and never pass a prefix as a prop.
|
|
24
|
-
- The generated image installs only `ca-certificates` and `tzdata`; add the rest in `preRuns`.
|
|
25
|
-
- An app running in two database modes avoids `q.raw`.
|
|
26
|
-
|
|
27
23
|
## Running and logs
|
|
28
24
|
|
|
29
25
|
- `akan start <app>` (`a,b` or `all` for several) runs the dev server; `akan build <app>` checks the production
|
|
30
|
-
build. A supervised session writes `local/apps/<app>/runtime/dev.log` — hand over that
|
|
31
|
-
live view. Tail with `akan logs <app>`.
|
|
26
|
+
build. A supervised session writes `local/apps/<app>/runtime/dev.log` (previous: `dev.prev.log`) — hand over that
|
|
27
|
+
path, not a paste of the live view. Tail with `akan logs <app>`.
|
|
32
28
|
- Run a build without Docker with `cd dist/apps/<app> && bun main.js`: it boots with the env the Dockerfile sets,
|
|
33
29
|
read from `akan.env.json` beside it, and a variable you set yourself (`PORT=3000`) wins.
|
|
34
|
-
- Give every log sink a floor (`Logger.addSink(sink, { minLevel })`) and never log once per delivered record.
|
|
35
30
|
|
|
36
31
|
## Native and desktop
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
A `start-*` command loads its pages from a running `akan start`; a desktop app carrying its server starts it itself.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
akan start-desktop <app> # Run the desktop app on this computer
|
|
37
|
+
akan start-ios <app> # Run it in a simulator or on an iPhone (start-android alike)
|
|
38
|
+
akan build-desktop <app> # Build it for this computer into dist/native/<app>/<target>/build
|
|
39
|
+
akan build-desktop <app> --installer true # Windows: add a per-user setup program
|
|
40
|
+
akan update-keygen <app> # Make the update signing key once; print its public key
|
|
41
|
+
akan publish-update <app> # Build a key-signed release for updates.url; --sign true also code-signs it
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
A device capability the framework lacks is a plugin the app owns in `native/<id>/`: `native-plugin.json`,
|
|
45
|
+
`src/index.ts` (the page API, used from a `webkit/` hook), `src/desktop.ts`, Kotlin and Swift.
|
|
42
46
|
|
|
43
|
-
Full detail: `get_guideline` with `runtimeRule
|
|
47
|
+
Full detail: `get_guideline` with `runtimeRule` (keys, `--plain`, boot waves, `--kill`, watch scope, booting a
|
|
48
|
+
server in a test, native targets and updates).
|
|
@@ -106,5 +106,5 @@ The page calls it as `await fetch.book(id)` (`fetch` from `@apps/<app>/client`)
|
|
|
106
106
|
`common/`, or return a scalar (`akan create-scalar`) for a typed wire shape. A query that answers `null` without
|
|
107
107
|
`nullable: true` fails the render, naming the endpoint.
|
|
108
108
|
|
|
109
|
-
Full detail: `get_guideline` with `modelService
|
|
110
|
-
|
|
109
|
+
Full detail: `get_guideline` with `modelService`. The exact signatures of serve, adapt, endpoint and
|
|
110
|
+
serviceDictionary, and every import path, are in the `akanApi-*` references below.
|
|
@@ -28,6 +28,11 @@ describe("ApiReference", () => {
|
|
|
28
28
|
expect(rendered).toMatch(/^\/\*\* .+ \*\/\nserverMode\?: "batch" \| "federation";$/m);
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
+
test("says what Link takes beyond its own props, and names its static parts", () => {
|
|
32
|
+
expect(rendered).toContain('Every prop of `Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href">`, and:');
|
|
33
|
+
expect(rendered).toMatch(/^Link\.Back\(.+\): Element$/m);
|
|
34
|
+
});
|
|
35
|
+
|
|
31
36
|
test("lists the keys of akan.config.ts, so the web and i18n shapes have a field to belong to", () => {
|
|
32
37
|
const appConfig = rendered.slice(rendered.indexOf("### `AppConfigInput`"));
|
|
33
38
|
expect(appConfig).toMatch(/^web\?: AkanWebOption;$/m);
|
package/docs/apiReference.ts
CHANGED
|
@@ -153,7 +153,7 @@ export class ApiReference {
|
|
|
153
153
|
"Generated from the akanjs sources of this release: the import paths and signatures a first app needs, so none of",
|
|
154
154
|
"them has to be looked up in `node_modules`. A stage's return type is the same chain, left out below.",
|
|
155
155
|
"",
|
|
156
|
-
"## Imports",
|
|
156
|
+
"## Imports (`akanjs/*`, `@apps/<app>/client`, `../cnst`, `../dict`, `../srv`, layer barrels)",
|
|
157
157
|
"",
|
|
158
158
|
"```ts",
|
|
159
159
|
...importLines,
|
|
@@ -183,8 +183,12 @@ export class ApiReference {
|
|
|
183
183
|
return [heading, "", "```ts", reader.declarationText(symbol), "```"].join("\n");
|
|
184
184
|
if (item.show.kind === "signature")
|
|
185
185
|
return [heading, "", "```ts", ...reader.signatures(symbol, item.name), "```"].join("\n");
|
|
186
|
-
if (item.show.kind === "props")
|
|
187
|
-
|
|
186
|
+
if (item.show.kind === "props") {
|
|
187
|
+
const bases = reader.foreignBases(symbol).map((base) => `\`${base}\``);
|
|
188
|
+
const inherits = bases.length ? ["", `Every prop of ${bases.join(" and ")}, and:`] : [];
|
|
189
|
+
const props = reader.props(reader.declaredType(symbol), item.show.omit);
|
|
190
|
+
return [heading, ...inherits, "", "```ts", ...props, "```"].join("\n");
|
|
191
|
+
}
|
|
188
192
|
const members = reader.members(reader.instanceType(symbol), item.show);
|
|
189
193
|
return [heading, "", "```ts", ...members.map(([, line]) => line), "```"].join("\n");
|
|
190
194
|
}
|