@akanjs/cli 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/.build-stamp +2 -2
- package/CodeAgent-cqbf9gsv.js +11 -0
- package/{CodeAgentRpcHost-6dzfkvsc.js → CodeAgentRpcHost-pwps2d67.js} +1 -1
- package/{CodeTui-zee8atsr.js → CodeTui-ehdr4hgw.js} +46 -6
- package/TunnelShare-0p4dy89e.js +16 -0
- package/{agent.command-x65f2ags.js → agent.command-x55ncdjm.js} +20 -22
- package/akanCode.js +7 -7
- package/appExecutor-1ctzymwa.js +11 -0
- package/{application.command-azbd1pb2.js → application.command-xpntxnh8.js} +18 -20
- package/{applicationBuildRunner-trfxv3pd.js → applicationBuildRunner-19c76791.js} +16 -13
- package/buildBatch.proc.js +19 -19
- package/{cloud.command-gapp4634.js → cloud.command-p3ybjes7.js} +19 -24
- package/cloud.script-0dsyd10v.js +30 -0
- package/{code.command-5smx61yf.js → code.command-m6skj1kj.js} +34 -19
- package/{context.command-ym5jbkny.js → context.command-3c3nv0d6.js} +20 -22
- package/context.runner-yyp7a112.js +32 -0
- package/csrArtifactBuilder-mdh9ykn2.js +9 -0
- package/{index-2ny1e95c.js → dependencyScanner-93g8tk0r.js} +6 -5
- package/{fileSys-q22646yc.js → fileSys-e5mwt73x.js} +1 -1
- package/frameworkGraph-aneq2nwy.js +8 -0
- package/{guideline.command-zwypaqsh.js → guideline.command-725fq5p0.js} +8 -8
- package/guidelines/agentRule/agentRule.instruction.md +46 -7
- package/guidelines/akanApi/akanApi.instruction.md +7 -2
- package/guidelines/conventions/core.md +6 -11
- package/guidelines/conventions/rules/app.md +1 -2
- package/guidelines/conventions/rules/auth.md +18 -27
- package/guidelines/conventions/rules/config.md +15 -46
- package/guidelines/conventions/rules/page.md +19 -34
- package/guidelines/conventions/rules/server.md +1 -4
- package/guidelines/conventions/rules/ssr.md +3 -4
- package/guidelines/conventions/rules/ts.md +2 -1
- package/guidelines/cssRule/cssRule.instruction.md +3 -0
- package/guidelines/errorCodes/errorCodes.instruction.md +4 -0
- package/guidelines/mcpRule/mcpRule.instruction.md +11 -4
- package/guidelines/pageRule/pageRule.instruction.md +6 -53
- package/guidelines/runtimeRule/runtimeRule.instruction.md +68 -4
- package/incrementalBuilder.proc.js +24 -18
- package/{index-nc3br31y.js → index-22bwg8hy.js} +2 -2
- package/{index-9f3reh2y.js → index-2v38x3ad.js} +12 -1
- package/{index-67sd09ag.js → index-3a3vy2xy.js} +8 -8
- package/{index-p7beqww9.js → index-3fmzz9sf.js} +18 -18
- package/{index-9wh04mqy.js → index-3mj5trqc.js} +65 -11
- package/{index-7wf8snar.js → index-3r1crbct.js} +1 -1
- package/{index-41a03gkj.js → index-3zkhg65e.js} +19 -19
- package/{index-2jmvfa62.js → index-4r8dgm4x.js} +3 -3
- package/{index-jek2re5k.js → index-4yvtqcme.js} +8 -8
- package/{index-j0wr4e32.js → index-5ahe641t.js} +9 -9
- package/{index-0dm25wvf.js → index-7ssr7wq4.js} +1 -1
- package/{index-dmcpetwe.js → index-8bta5pnr.js} +98 -23
- package/{index-z92zm3wd.js → index-9a9t77hz.js} +29 -11
- package/{index-3txdtztz.js → index-9gjcbp2g.js} +1 -1
- package/{index-8jtqfye2.js → index-a4gcdffy.js} +488 -53
- package/{index-xwwex8rf.js → index-cbm9gzgx.js} +5 -5
- package/{index-j6jjmn2r.js → index-ckcc9ab3.js} +62 -21
- package/{index-w1zexzpx.js → index-crd99zqs.js} +1 -1
- package/{index-612fdtbk.js → index-f4jydw2x.js} +1 -1
- package/{index-4ss4gkv3.js → index-fagjtk6m.js} +2 -2
- package/{index-ebn9kgea.js → index-fjqapyex.js} +45 -16
- package/{index-h901f24n.js → index-h8w1n11r.js} +5 -5
- package/{index-275a4r3n.js → index-hxg6ctk2.js} +12 -16
- package/{index-78y75t0a.js → index-j2wq064m.js} +6 -7
- package/{index-knpm8sdm.js → index-j3fqs8rc.js} +1 -1
- package/{index-kfvjzk8r.js → index-kbnvyhy4.js} +3 -3
- package/{index-6dzjer7p.js → index-m303nhv6.js} +6 -6
- package/{index-dadwp2aw.js → index-nmdmkjt2.js} +271 -39
- package/{index-2yn3r67f.js → index-nnmw56fz.js} +6 -6
- package/{index-a860mx0m.js → index-pr9nypg7.js} +24 -24
- package/{index-s885g0jj.js → index-pyjkbg8e.js} +3 -3
- package/{index-zmd9xxgd.js → index-q63nbpv7.js} +3 -3
- package/{index-v7ajmsh3.js → index-qecrqpt6.js} +4 -21
- package/{index-gt8phqpt.js → index-rdcgz02t.js} +4 -4
- package/{index-j592zfqc.js → index-rt7q20sj.js} +1 -1
- package/{index-baccvws5.js → index-se7n78fh.js} +1 -1
- package/{index-s4nvxpzm.js → index-sxbsrndq.js} +1 -1
- package/{index-k6vwww45.js → index-t23dgyaf.js} +7 -7
- package/{index-71y6176j.js → index-v16gj2as.js} +86 -66
- package/{index-0s7w2085.js → index-vnk1qwgr.js} +4 -4
- package/{index-z96ks033.js → index-wkwe91sn.js} +169 -51
- package/{index-ybcb9wc8.js → index-wxqp1amd.js} +9 -9
- package/{index-p5zh7pmc.js → index-xv3pvdw4.js} +1 -1
- package/{index-zfnz878d.js → index-yey1envc.js} +1 -1
- package/{index-by2tvsq6.js → index-zyjztrvc.js} +1 -1
- package/index.js +30 -28
- package/{libExecutor-jc6f8hm6.js → libExecutor-n8hpm8s7.js} +3 -3
- package/{library.command-nxvesvhb.js → library.command-8abb26pg.js} +8 -8
- package/{localRegistry.command-xz62e4ng.js → localRegistry.command-sa211m1z.js} +18 -23
- package/{module.command-aaws9byg.js → module.command-z3cwjf0p.js} +10 -10
- package/{package.command-j7hv26p0.js → package.command-akynhtee.js} +9 -12
- package/package.json +3 -2
- package/{page.command-7yffs7n9.js → page.command-3fpdavk9.js} +8 -8
- package/{pipeline.command-7yk0zcng.js → pipeline.command-ca95n8rd.js} +7 -7
- package/{pkgExecutor-arxmvx4t.js → pkgExecutor-a73q41vx.js} +3 -3
- package/{primitive.command-7a1pt715.js → primitive.command-xwe9ggnf.js} +11 -11
- package/{projectTypecheck-f4qhbecd.js → projectTypecheck-7g542ymk.js} +1 -1
- package/{prompter-qyggfhqd.js → prompter-d33wmdpa.js} +2 -2
- package/{quality.command-c6mvrjh1.js → quality.command-7wz7y8z1.js} +9 -9
- package/{repair.command-093adzt9.js → repair.command-dej1qtfq.js} +10 -10
- package/{scalar.command-2ex84spb.js → scalar.command-z9qfxnvm.js} +9 -9
- package/skills/akan-agent/SKILL.md +8 -1
- package/skills/akan-code/SKILL.md +38 -3
- package/skills/akan-page/SKILL.md +18 -13
- package/skills/akan-runtime/SKILL.md +21 -16
- package/skills/akan-service/SKILL.md +2 -2
- package/{subspace.command-4n4n4jpv.js → subspace.command-9wekm4gn.js} +11 -13
- package/templates/localDev/docker-compose.yaml.template +2 -2
- package/{tunnel.command-f7ep1qfa.js → tunnel.command-cxc4h3j8.js} +10 -12
- package/{verify.command-zrkxnvct.js → verify.command-j0w9dr5c.js} +15 -17
- package/{workflow.command-ks16jegk.js → workflow.command-yt4sz04b.js} +15 -15
- package/{workspace.command-ahhfpaag.js → workspace.command-8mp4mcp2.js} +34 -38
- package/CodeAgent-fx6088tv.js +0 -11
- package/TunnelShare-9ry4vh0y.js +0 -18
- package/appExecutor-79azsb2w.js +0 -11
- package/cloud.script-3b401efv.js +0 -35
- package/context.runner-kctbfsde.js +0 -34
- package/dependencyScanner-ge10gb52.js +0 -8
|
@@ -4,23 +4,23 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-nnmw56fz.js";
|
|
8
8
|
import"./index-j4yvgfhr.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
9
|
+
import"./index-v16gj2as.js";
|
|
10
|
+
import"./index-zyjztrvc.js";
|
|
11
|
+
import"./index-9a9t77hz.js";
|
|
12
|
+
import"./index-yey1envc.js";
|
|
13
|
+
import"./index-crd99zqs.js";
|
|
14
14
|
import {
|
|
15
15
|
AkanCodeEnv,
|
|
16
16
|
akanCodePaths2
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-xv3pvdw4.js";
|
|
18
18
|
import {
|
|
19
19
|
akanCodeDefaultModel2,
|
|
20
20
|
CodeAgentStreamPrinter2,
|
|
21
21
|
WorkspaceTrust
|
|
22
|
-
} from "./index-
|
|
23
|
-
import"./index-
|
|
22
|
+
} from "./index-7ssr7wq4.js";
|
|
23
|
+
import"./index-3r1crbct.js";
|
|
24
24
|
|
|
25
25
|
// pkgs/@akanjs/cli/code/code.runner.ts
|
|
26
26
|
import { randomBytes } from "crypto";
|
|
@@ -82,8 +82,8 @@ 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-
|
|
86
|
-
import("./CodeAgentRpcHost-
|
|
85
|
+
import("./CodeAgent-cqbf9gsv.js"),
|
|
86
|
+
import("./CodeAgentRpcHost-pwps2d67.js"),
|
|
87
87
|
import("./CodeAgentRpcListener-tcwrdvst.js")
|
|
88
88
|
]);
|
|
89
89
|
const address = listen ? CodeAgentRpcListener.parse(listen, { anyHost: !!options.rpcBindAny }) : null;
|
|
@@ -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-cqbf9gsv.js"),
|
|
120
|
+
import("./CodeTui-ehdr4hgw.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-cqbf9gsv.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)
|
|
@@ -185,7 +185,7 @@ class CodeRunner extends runner("code") {
|
|
|
185
185
|
model: CodeRunner.modelOf(options.model),
|
|
186
186
|
...options.compactAt !== undefined ? { autoCompactAt: options.compactAt } : {}
|
|
187
187
|
};
|
|
188
|
-
return { agent, warnings: [...CodeRunner.startWarnings(profile), ...trust] };
|
|
188
|
+
return { agent, warnings: [...CodeRunner.startWarnings(profile, options.ask === false), ...trust] };
|
|
189
189
|
}
|
|
190
190
|
static profileOf(options, { hostAttached, interactive = true }) {
|
|
191
191
|
if (!isCodeAgentPresetName(options.profile))
|
|
@@ -193,9 +193,12 @@ class CodeRunner extends runner("code") {
|
|
|
193
193
|
const root = options.app ? `${options.workspace.workspaceRoot}/apps/${options.app}` : options.workspace.workspaceRoot;
|
|
194
194
|
const profile = codeAgentPresets[options.profile](root);
|
|
195
195
|
const { askOutside: _ask, ...network } = profile.network;
|
|
196
|
+
const askNetwork = options.ask !== false && options.askNetwork !== false;
|
|
197
|
+
const askCommands = options.ask !== false && options.askCommands !== false;
|
|
196
198
|
return {
|
|
197
199
|
...profile,
|
|
198
|
-
...
|
|
200
|
+
...askNetwork ? {} : { network },
|
|
201
|
+
...!askCommands && profile.approval === "commands" ? { approval: "never" } : {},
|
|
199
202
|
ui: { ...profile.ui, canPrompt: CodeRunner.canPrompt(profile, hostAttached, interactive) }
|
|
200
203
|
};
|
|
201
204
|
}
|
|
@@ -207,11 +210,11 @@ class CodeRunner extends runner("code") {
|
|
|
207
210
|
return false;
|
|
208
211
|
return hostAttached || interactive && profile.ui.canPrompt;
|
|
209
212
|
}
|
|
210
|
-
static startWarnings(profile) {
|
|
213
|
+
static startWarnings(profile, unasked = false) {
|
|
211
214
|
return [
|
|
212
215
|
...AkanCodeEnv.ignored(),
|
|
213
216
|
...profile.name === "local" ? [
|
|
214
|
-
"The local profile is not a sandbox: it refuses known secret files and asks before an unlisted host, but a command
|
|
217
|
+
unasked ? "--no-ask: this session runs shell commands and network requests without asking. The local profile is not a sandbox: it refuses known secret files, but a command can read anything you can. Use --profile pod inside a container to isolate it." : "The local profile is not a sandbox: it refuses known secret files and asks before a shell command and an unlisted host, but a command you approve can read anything you can. Use --profile pod inside a container to isolate it."
|
|
215
218
|
] : []
|
|
216
219
|
];
|
|
217
220
|
}
|
|
@@ -278,6 +281,8 @@ class CodeScript extends script("code", [CodeRunner]) {
|
|
|
278
281
|
...options.resume ? { resume: options.resume } : {},
|
|
279
282
|
trustWorkspace: options.trustWorkspace,
|
|
280
283
|
askNetwork: options.askNetwork,
|
|
284
|
+
askCommands: options.askCommands,
|
|
285
|
+
ask: options.ask,
|
|
281
286
|
rpcBindAny: options.rpcBindAny,
|
|
282
287
|
rpcToken: options.rpcToken
|
|
283
288
|
};
|
|
@@ -316,6 +321,14 @@ class CodeCommand extends command("code", [CodeScript], ({ public: target }) =>
|
|
|
316
321
|
desc: "ask before fetching an unlisted host or running a networking command (local profile)",
|
|
317
322
|
flag: "N",
|
|
318
323
|
default: true
|
|
324
|
+
}).option("askCommands", Boolean, {
|
|
325
|
+
desc: "ask before running a shell command (local profile)",
|
|
326
|
+
flag: "C",
|
|
327
|
+
default: true
|
|
328
|
+
}).option("ask", Boolean, {
|
|
329
|
+
desc: "ask before a shell command or a network request; --no-ask runs this session without asking (local profile)",
|
|
330
|
+
flag: "A",
|
|
331
|
+
default: true
|
|
319
332
|
}).option("rpcBindAny", Boolean, {
|
|
320
333
|
desc: "let --rpc-listen bind an address other machines can reach",
|
|
321
334
|
flag: "B",
|
|
@@ -324,7 +337,7 @@ class CodeCommand extends command("code", [CodeScript], ({ public: target }) =>
|
|
|
324
337
|
desc: "make a --rpc-listen tcp: connection open with its token",
|
|
325
338
|
flag: "K",
|
|
326
339
|
default: true
|
|
327
|
-
}).with(Workspace).exec(async function(prompt, app, profile, model, compactAt, json, thinking, rpc, rpcListen, resume, interactive, trustWorkspace, askNetwork, rpcBindAny, rpcToken, workspace) {
|
|
340
|
+
}).with(Workspace).exec(async function(prompt, app, profile, model, compactAt, json, thinking, rpc, rpcListen, resume, interactive, trustWorkspace, askNetwork, askCommands, ask, rpcBindAny, rpcToken, workspace) {
|
|
328
341
|
const options = {
|
|
329
342
|
app,
|
|
330
343
|
profile,
|
|
@@ -338,6 +351,8 @@ class CodeCommand extends command("code", [CodeScript], ({ public: target }) =>
|
|
|
338
351
|
resume,
|
|
339
352
|
trustWorkspace,
|
|
340
353
|
askNetwork,
|
|
354
|
+
askCommands,
|
|
355
|
+
ask,
|
|
341
356
|
rpcBindAny,
|
|
342
357
|
rpcToken
|
|
343
358
|
};
|
|
@@ -2,37 +2,35 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-nnmw56fz.js";
|
|
6
6
|
import"./index-j4yvgfhr.js";
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
7
|
+
import"./index-v16gj2as.js";
|
|
8
|
+
import"./index-zyjztrvc.js";
|
|
9
|
+
import"./index-9a9t77hz.js";
|
|
10
|
+
import"./index-yey1envc.js";
|
|
11
|
+
import"./index-crd99zqs.js";
|
|
12
|
+
import"./index-q63nbpv7.js";
|
|
13
13
|
import"./index-trffs83s.js";
|
|
14
|
-
import"./index-
|
|
14
|
+
import"./index-h8w1n11r.js";
|
|
15
15
|
import"./index-1p81ecbz.js";
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
16
|
+
import"./index-5ahe641t.js";
|
|
17
|
+
import"./index-j3fqs8rc.js";
|
|
18
|
+
import"./index-fjqapyex.js";
|
|
19
|
+
import"./index-f4jydw2x.js";
|
|
20
20
|
import"./index-m9jj544v.js";
|
|
21
|
-
import"./index-9wh04mqy.js";
|
|
22
|
-
import"./index-a860mx0m.js";
|
|
23
21
|
import"./index-zyb0ebm4.js";
|
|
24
22
|
import"./index-xs9a3ddt.js";
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
29
|
-
import"./index-
|
|
23
|
+
import"./index-kbnvyhy4.js";
|
|
24
|
+
import"./index-9gjcbp2g.js";
|
|
25
|
+
import"./index-rdcgz02t.js";
|
|
26
|
+
import"./index-m303nhv6.js";
|
|
27
|
+
import"./index-fagjtk6m.js";
|
|
30
28
|
import"./index-t4d0ckde.js";
|
|
31
|
-
import"./index-
|
|
29
|
+
import"./index-3a3vy2xy.js";
|
|
32
30
|
import {
|
|
33
31
|
ContextScript
|
|
34
|
-
} from "./index-
|
|
35
|
-
import"./index-
|
|
32
|
+
} from "./index-vnk1qwgr.js";
|
|
33
|
+
import"./index-3r1crbct.js";
|
|
36
34
|
|
|
37
35
|
// pkgs/@akanjs/cli/context/context.command.ts
|
|
38
36
|
class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ContextRunner2
|
|
4
|
+
} from "./index-5ahe641t.js";
|
|
5
|
+
import"./index-3a3vy2xy.js";
|
|
6
|
+
import"./index-fagjtk6m.js";
|
|
7
|
+
import"./index-m303nhv6.js";
|
|
8
|
+
import"./index-kbnvyhy4.js";
|
|
9
|
+
import"./index-rdcgz02t.js";
|
|
10
|
+
import"./index-9gjcbp2g.js";
|
|
11
|
+
import"./index-t4d0ckde.js";
|
|
12
|
+
import"./index-h8w1n11r.js";
|
|
13
|
+
import"./index-q63nbpv7.js";
|
|
14
|
+
import"./index-j3fqs8rc.js";
|
|
15
|
+
import"./index-f4jydw2x.js";
|
|
16
|
+
import"./index-fjqapyex.js";
|
|
17
|
+
import"./index-m9jj544v.js";
|
|
18
|
+
import"./index-nnmw56fz.js";
|
|
19
|
+
import"./index-xs9a3ddt.js";
|
|
20
|
+
import"./index-zyb0ebm4.js";
|
|
21
|
+
import"./index-trffs83s.js";
|
|
22
|
+
import"./index-3r1crbct.js";
|
|
23
|
+
import"./index-9a9t77hz.js";
|
|
24
|
+
import"./index-yey1envc.js";
|
|
25
|
+
import"./index-crd99zqs.js";
|
|
26
|
+
import"./index-v16gj2as.js";
|
|
27
|
+
import"./index-j4yvgfhr.js";
|
|
28
|
+
import"./index-1p81ecbz.js";
|
|
29
|
+
import"./index-zyjztrvc.js";
|
|
30
|
+
export {
|
|
31
|
+
ContextRunner2 as ContextRunner
|
|
32
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
FileSys2
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-zyjztrvc.js";
|
|
5
5
|
|
|
6
6
|
// pkgs/@akanjs/devkit/workspace/dependencyScanner.ts
|
|
7
7
|
import { builtinModules } from "module";
|
|
@@ -17,7 +17,7 @@ var isSkippedPath = (filePath) => {
|
|
|
17
17
|
var builtinModuleSet = new Set([...builtinModules, ...builtinModules.map((mod) => `node:${mod}`)]);
|
|
18
18
|
var stripShebang = (source) => source.replace(/^#!.*(?:\r?\n|$)/, "");
|
|
19
19
|
|
|
20
|
-
class
|
|
20
|
+
class TypeScriptDependencyScanner {
|
|
21
21
|
#fileDependencies = new Map;
|
|
22
22
|
#fileRuntimeDependencies = new Map;
|
|
23
23
|
#fileTypeDependencies = new Map;
|
|
@@ -255,7 +255,7 @@ ${externalImports.map((imp) => ` \u2192 ${imp}
|
|
|
255
255
|
exec.workspace.getPackageJson(),
|
|
256
256
|
exec.workspace.getGitignorePatterns()
|
|
257
257
|
]);
|
|
258
|
-
return new
|
|
258
|
+
return new TypeScriptDependencyScanner(exec.cwdPath, {
|
|
259
259
|
workspaceRoot: exec.workspace.cwdPath,
|
|
260
260
|
tsconfig,
|
|
261
261
|
rootPackageJson,
|
|
@@ -263,5 +263,6 @@ ${externalImports.map((imp) => ` \u2192 ${imp}
|
|
|
263
263
|
});
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
export {
|
|
267
|
+
TypeScriptDependencyScanner
|
|
268
|
+
};
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
script,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-nnmw56fz.js";
|
|
6
6
|
import"./index-j4yvgfhr.js";
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
7
|
+
import"./index-v16gj2as.js";
|
|
8
|
+
import"./index-zyjztrvc.js";
|
|
9
|
+
import"./index-9a9t77hz.js";
|
|
10
|
+
import"./index-yey1envc.js";
|
|
11
|
+
import"./index-crd99zqs.js";
|
|
12
12
|
import {
|
|
13
13
|
Prompter2
|
|
14
|
-
} from "./index-
|
|
15
|
-
import"./index-
|
|
14
|
+
} from "./index-j3fqs8rc.js";
|
|
15
|
+
import"./index-3r1crbct.js";
|
|
16
16
|
|
|
17
17
|
// pkgs/@akanjs/cli/guideline/guideline.script.ts
|
|
18
18
|
import { Logger } from "akanjs/common";
|
|
@@ -116,6 +116,19 @@ pages declaring one name never clash, and a registry kept outside the surface re
|
|
|
116
116
|
blocks, the results ride in a *user* turn, roles must alternate — so two wire turns that map to one role are
|
|
117
117
|
merged — and `max_tokens` is required. **Both require `model`**: a default would age into a 404, and worse, it
|
|
118
118
|
would decide the vision claim for the app.
|
|
119
|
+
- **A turn's context is data in a user turn, never part of the system prompt.** Both adaptors send
|
|
120
|
+
`request.context` as a `<turn-context …>` block that ends the turn's last user-role content, after that turn's
|
|
121
|
+
tool results, so the system prompt is the instructions alone and stays the same text from turn to turn. The
|
|
122
|
+
block closes on a delimiter chosen so its content cannot contain it. A block marked `untrusted: true` holds text
|
|
123
|
+
someone other than the developer or the user may have written; it goes in a `<page-content …>` block of its own,
|
|
124
|
+
the one a `readScreen` result arrives in, and the turn counts as an untrusted read. A compaction summary is
|
|
125
|
+
history the model wrote, so it too rides a user turn, in a `<conversation-summary …>` block, never the system
|
|
126
|
+
role. `LlmContext.of(context)` and `LlmContext.summary(text)` (`akanjs/service`) build them. An adaptor of the
|
|
127
|
+
app's own that does not go through `OpenaiDialect.requestBody` appends the context text to its last user-role
|
|
128
|
+
content, maps a `summary` message to a user turn, and writes neither into its system prompt — `systemPrompt`
|
|
129
|
+
returns the instructions alone, so pairing it with hand-built messages sends no context. A dialect added to the
|
|
130
|
+
framework is a class with a static `requestBody`; `llmDialect.conformance.test.ts` finds it by that and fails
|
|
131
|
+
until it passes the same checks.
|
|
119
132
|
- **`OpenaiLlm` claims vision for its default host and for nothing else.** OpenAI's own endpoint takes image
|
|
120
133
|
parts, so that is what it answers with no `host` set. A `host` the app named is a gateway the class knows
|
|
121
134
|
nothing about, and it stays text-only until `option.setLlm({ accepts })` says otherwise — handing bytes to a
|
|
@@ -233,7 +246,13 @@ pages declaring one name never clash, and a registry kept outside the surface re
|
|
|
233
246
|
pointed at — leaving a live reference showing the result with no record of what it was changed from.
|
|
234
247
|
`refName`/`refId`/`path` travel so a tool can read the current value when the answer needs it, and
|
|
235
248
|
`AgentService.referenced` folds the whole lot into the message text in one place, so every provider carries a
|
|
236
|
-
reference without either adaptor knowing the word. **
|
|
249
|
+
reference without either adaptor knowing the word. **A reference is the record's own text, not the user's**: its
|
|
250
|
+
pointer, label, value and note reach the model together in one `<page-content …>` block under a heading, the
|
|
251
|
+
token in the user's words is sent as `@[pointer](mention:pointer)` so the title is in that block only — or as
|
|
252
|
+
`@[ref-1a2b3c4d](mention:ref-1a2b3c4d)`, with the pointer spelled in the block, when the id or path is not a
|
|
253
|
+
token, as a slug is not — and a
|
|
254
|
+
message that carries one counts as a page read, so the first change after a mention asks the user first, as after
|
|
255
|
+
`readScreen`. **The value is masked on the way in and nowhere else**: masking
|
|
237
256
|
needs the model class, which no wire carries, so the model a host names when it stages the reference is the whole
|
|
238
257
|
of the decision about what leaves the browser — name the class that actually holds the field, because a `Light`
|
|
239
258
|
one usually does not. **The ceiling is 20,000 characters per reference**, applied as it is staged and again on
|
|
@@ -342,7 +361,8 @@ pages declaring one name never clash, and a registry kept outside the surface re
|
|
|
342
361
|
`AgentConfirm.set({ byName })` moves that default app-wide. After a tool marked `taint: "source"` (`readScreen`,
|
|
343
362
|
`readState`, `viewImage`) returns text the user did not write, the next call that changes something asks once,
|
|
344
363
|
whatever its own `confirm` says, until the user approves a call; `taint: "exempt"` marks a tool that only moves the
|
|
345
|
-
view, and `AgentConfirm.set({ afterScreenRead: false })` turns the rule off.
|
|
364
|
+
view, and `AgentConfirm.set({ afterScreenRead: false })` turns the rule off. A message that points at a record
|
|
365
|
+
with an `@` mention counts as such a read, and so does a turn whose context holds a block marked `untrusted`. `st.tool("x", { label:
|
|
346
366
|
l("ticket.archive") })` gives the action a name a person reads — `Agent.useScreenActions()` hands it to a command
|
|
347
367
|
palette, and the model never sees it. Reach a store action
|
|
348
368
|
from the body — `.exec((id) => st.do.removeX(id))` — which is how an agent gets CRUD; `st.do` on its own
|
|
@@ -552,7 +572,25 @@ pages declaring one name never clash, and a registry kept outside the surface re
|
|
|
552
572
|
`st.useState(name, Type, { set: true }).desc("…").init(initial)` local state, read-only without `set`. Both
|
|
553
573
|
end in a hook, so a conditional surface withholds the name rather than skipping the chain. A subscribed store key is listed in
|
|
554
574
|
the state context block by name and pulled with `readState(key)`, masked by the model that key declares — while
|
|
555
|
-
a key the screen does not read stays unreadable even when a sibling key of the same store is live. **
|
|
575
|
+
a key the screen does not read stays unreadable even when a sibling key of the same store is live. **The block
|
|
576
|
+
carries a value only when it is an id, an enum member, a number or a boolean**: a string rides inline when it is
|
|
577
|
+
one token of up to 40 letters, digits, `.`, `_` or `-`, of at most three words — a word ends at a separator or
|
|
578
|
+
at a lower-to-upper case change, so `created-at-desc` and `createdAtDesc` pass and four joined words are a
|
|
579
|
+
sentence; more parts pass only as an id's, each hex with a digit or eight characters long, as in a UUID; a run of
|
|
580
|
+
over sixteen letters with no digit never passes — and any other string is listed by key and type alone, because
|
|
581
|
+
free text is whatever the record's author wrote and the model reads that through `readState`, where it arrives as
|
|
582
|
+
page content. The route block follows the same rule for each path segment and path param, up to twelve words of
|
|
583
|
+
each. **A search param rides inline when a store declares its key with `search("key", …)`** and its value is a
|
|
584
|
+
token; of the others at most four ride, key and value both tokens, and the rest are left out, key and value, with
|
|
585
|
+
their count in `searchParamsWithheld`. A page's own typed `search` is read on the server and does not count, so
|
|
586
|
+
declare the params an agent should see in a store. What is left out is named in `withheld` as `pathname`,
|
|
587
|
+
`params` or `searchParams`, and `readState` answers those three whether or not a component subscribes them. The
|
|
588
|
+
screen block applies the rule to a `Load` scope's label, which is its record's title, and to the ids and labels
|
|
589
|
+
of a list scope's `items` — a row whose id is not a token, a slug or a mixed-case random id, is left out — and
|
|
590
|
+
then says to read the scope with `readScreen`. So instructions never say "the query is in the route context";
|
|
591
|
+
they say to read `searchParams`. **Three things still ride whole, because no read returns them**: an
|
|
592
|
+
`Agent.Zone`'s `label` and a value published with `st.expose`, `st.useState` or `useAgentResource`. Publish an
|
|
593
|
+
id, a count or an enum member there, never text a user wrote. **There is no
|
|
556
594
|
store-level exposure declaration**: a store class says nothing about agents, and `st.use.x({ agent: false })` is
|
|
557
595
|
how the component that subscribes a value keeps it off the surface. Base-store plumbing does the same at the
|
|
558
596
|
call site — `st.use.path({ agent: false })`, `st.use.tryJwt({ agent: false })` — so routing and the caller's
|
|
@@ -624,8 +662,8 @@ pages declaring one name never clash, and a registry kept outside the surface re
|
|
|
624
662
|
have, and the next one asks again — a summarizer that was momentarily unreachable says nothing about whether
|
|
625
663
|
this transcript can shrink. One that *landed* and shrank nothing does, so that one is not retried until another
|
|
626
664
|
threshold's worth has been added. On the
|
|
627
|
-
wire a summary wears the user's role because the wire has no other, so a provider mapping frames it as
|
|
628
|
-
|
|
665
|
+
wire a summary wears the user's role because the wire has no other, so a provider mapping frames it as fenced
|
|
666
|
+
history in a user turn and `/retry` steps over it — replaying it would send the notes back as a question. **While a summary is
|
|
629
667
|
being written the transcript says so** (`session.isCompacting`, distinct from `isRunning`, which an
|
|
630
668
|
auto-compaction runs inside): that turn takes as long as any other and answers nothing the user asked, so a chat
|
|
631
669
|
that only shows the running dot reads as a question being ignored.
|
|
@@ -664,7 +702,8 @@ pages declaring one name never clash, and a registry kept outside the surface re
|
|
|
664
702
|
not with prose), `readScreen` (the rendered DOM as compact text — headings, links, control values, and `(disabled)`
|
|
665
703
|
on a control or button that has it; the chat's own UI is skipped via `data-agent-ui`, and a password value is never
|
|
666
704
|
read), `readState(key)` (one masked store key — a key that is unknown or that this screen does not read is refused
|
|
667
|
-
*with the keys it can* read, the way `readScreen` names its sections
|
|
705
|
+
*with the keys it can* read, the way `readScreen` names its sections; the route's own `pathname`, `params` and
|
|
706
|
+
`searchParams` are always readable), `highlight(target)`, and `viewImage(src)` (one
|
|
668
707
|
`<img>` on screen, redrawn as a JPEG at most 1568px long and attached to the result — `src` must be one this view
|
|
669
708
|
shows, as `readScreen({ images: true })` printed it, so the agent cannot have the browser fetch an address of its
|
|
670
709
|
own, and a `data:` one is refused). Declaring a hook tool under one of those names shadows the built-in, so reuse
|
|
@@ -760,7 +799,7 @@ pages declaring one name never clash, and a registry kept outside the surface re
|
|
|
760
799
|
above the cut and a result this large arrives below it. Clipped rather than dropped, because a model handed a
|
|
761
800
|
value it cannot see the end of asks a narrower question, where one handed nothing answers from the field names.
|
|
762
801
|
The cap is a safety rail, not the design: a tool should return what answers the question — an id, a count, the
|
|
763
|
-
three fields the agent asked about — and `AgentContext` inlines only
|
|
802
|
+
three fields the agent asked about — and `AgentContext` inlines only numbers, booleans and one-token strings.
|
|
764
803
|
- **A slow tool reports its own progress with `AgentProgress.report(message, { done, total })`** from wherever the
|
|
765
804
|
work is — a store action, an upload loop, an adapter — reached through a module slot rather than a parameter, and
|
|
766
805
|
a no-op when nobody is rendering it. The chat shows it on that call's row until the row resolves. It is the
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Generated from the akanjs sources of this release: the import paths and signatures a first app needs, so none of
|
|
4
4
|
them has to be looked up in `node_modules`. A stage's return type is the same chain, left out below.
|
|
5
5
|
|
|
6
|
-
## Imports
|
|
6
|
+
## Imports (`akanjs/*`, `@apps/<app>/client`, `../cnst`, `../dict`, `../srv`, layer barrels)
|
|
7
7
|
|
|
8
8
|
```ts
|
|
9
9
|
import { Any, Binary, dayjs, Float, ID, Int, Upload } from "akanjs/base";
|
|
@@ -75,10 +75,15 @@ external?: boolean;
|
|
|
75
75
|
|
|
76
76
|
```ts
|
|
77
77
|
Link({ className, href, disabled, children, ...props }: CommonLinkProps): Element
|
|
78
|
+
Link.Back({ className, children, fallback }: BackProps): Element
|
|
79
|
+
Link.Close({ className, children }: ActionProps): Element
|
|
80
|
+
Link.Lang({ className, lang, children }: LangProps): Element
|
|
78
81
|
```
|
|
79
82
|
|
|
80
83
|
### `CommonLinkProps`
|
|
81
84
|
|
|
85
|
+
Every prop of `Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href">`, and:
|
|
86
|
+
|
|
82
87
|
```ts
|
|
83
88
|
/** Omitted, or with `disabled`, Link renders a plain div around the same children. */
|
|
84
89
|
href?: string;
|
|
@@ -244,7 +249,7 @@ errors?: EndpointErrors;
|
|
|
244
249
|
/** A slow subscriber of a `pubsub(Binary)`: `"coalesce"` (default) keeps only the newest frame per room, `"queue"` delivers every frame and grows the send buffer with the slowest subscriber. */
|
|
245
250
|
backpressure?: "coalesce" | "queue";
|
|
246
251
|
enabled?: boolean;
|
|
247
|
-
operationMode?: ("local" | "edge" | "cloud"
|
|
252
|
+
operationMode?: ((string & {}) | "local" | "edge" | "cloud")[];
|
|
248
253
|
```
|
|
249
254
|
|
|
250
255
|
## Dictionaries (`*.dictionary.ts`)
|
|
@@ -90,17 +90,12 @@ contract. Path rules name their checks the same way.
|
|
|
90
90
|
|
|
91
91
|
## Code Style
|
|
92
92
|
|
|
93
|
-
- `const`
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
-
|
|
99
|
-
`// TODO: <issue url>` aside) — a vendor quirk, an infrastructure constraint, security reasoning, a domain field's
|
|
100
|
-
meaning, a state transition, a rejected alternative. Never restate code, label a section or add JSDoc; retire a
|
|
101
|
-
symbol with `/** @deprecated <what instead> */`.
|
|
102
|
-
- Server rendering is the default: `"use client"` only for a hook, an event handler, the store, a browser global or
|
|
103
|
-
a client-only package.
|
|
93
|
+
- `const` arrows, `interface` for shapes, no non-null assertions or `as any`, `#private` (but `private` in
|
|
94
|
+
`*.{constant,document,service,store}.ts`), one class per file [ts].
|
|
95
|
+
- Identifiers and logs are English; what a user reads goes through `l("model.field")` or `l.trans({ en, ko })` [ts].
|
|
96
|
+
- Comment only what the code cannot say — a vendor quirk, an infrastructure constraint, security reasoning, a domain
|
|
97
|
+
field's meaning, a state transition, a rejected alternative (`akan.comment.added`) [ts].
|
|
98
|
+
- `"use client"` only for a hook, an event handler, the store, a browser global or a client-only package [ssr].
|
|
104
99
|
|
|
105
100
|
## Where Code Goes
|
|
106
101
|
|
|
@@ -82,5 +82,4 @@ each plugin's header and diagnostic carry its full reasoning.
|
|
|
82
82
|
Warts in older files — never copy them; when two shapes disagree, follow the newer neighbour: `children: any`
|
|
83
83
|
(use `ReactNode`); hard-coded API keys or secrets (they belong in `option.ts` or env); large commented-out blocks;
|
|
84
84
|
stale `// TODO: Implement …` above implemented methods; `{cond && <X/>}`, hard-coded Korean bypassing `l()`,
|
|
85
|
-
`window.alert(...)`; bare `/* eslint-disable */` blocks; raw palette grays like `text-gray-400`.
|
|
86
|
-
another through `(this as unknown as RootStore)` is **not** a wart — it is the sanctioned way.
|
|
85
|
+
`window.alert(...)`; bare `/* eslint-disable */` blocks; raw palette grays like `text-gray-400`.
|
|
@@ -7,17 +7,27 @@ paths:
|
|
|
7
7
|
|
|
8
8
|
# Authorization
|
|
9
9
|
|
|
10
|
-
- **Every
|
|
10
|
+
- **Every endpoint and named slice names its guards** (`no-unguarded-endpoint`, a warning) — a `query` / `mutation` /
|
|
11
|
+
`pubsub` / `message`, a named slice's `init()`, or a `slice()` map without `root` that names none (or `guards: []`)
|
|
12
|
+
answers every call with 403 on every transport, and outside local operation the server does not boot. Write
|
|
13
|
+
`guards: [Public]` when anonymous access is the intent; `AKAN_UNGUARDED_ENDPOINTS=open` is a deployment's stopgap,
|
|
14
|
+
never the fix.
|
|
15
|
+
- **A `slice()` takes its guard map as a second argument**, and `root:` is always `Admin`:
|
|
16
|
+
`slice(srv.task, { guards: { root: Admin, get: SignedIn, cru: SignedIn } }, (init) => ({...}))`.
|
|
11
17
|
`guards: { cru: false }` (or per verb) takes a generated verb off HTTP; `mcp: { cru: false }` only keeps it off the
|
|
12
18
|
agent shelf.
|
|
13
|
-
- **
|
|
14
|
-
generated endpoints,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
- **An `endpoint()` takes no guard argument** — `endpoint(srv.task, ({ mutation }) => ({...}))` — and the slice map
|
|
20
|
+
reaches only generated endpoints, so every custom `mutation` / `query` / `message` names its own array:
|
|
21
|
+
`mutation(cnst.Task, { guards: [SignedIn] })`. A `pubsub` / `message` without its own declares none.
|
|
22
|
+
- `Public` always allows. It belongs on a slice `get:`; on a mutation only for an act that must work signed out
|
|
23
|
+
(sign-up/in, token refresh, an OAuth route), which also declares a `rateLimit`. MCP refuses a mutation guarded only
|
|
24
|
+
by `Public`. Other guards implement the `Guard` interface in `srvkit/` (server-only).
|
|
18
25
|
- Guards serve HTTP and websocket alike: read `context.get<T>("account")`, never `getHttpContext()` /
|
|
19
|
-
`getWebSocketContext()`; keep them side-effect free and re-runnable.
|
|
20
|
-
|
|
26
|
+
`getWebSocketContext()`; keep them side-effect free and re-runnable.
|
|
27
|
+
- **The acting user comes from an `InternalArg`**, never a client-supplied id:
|
|
28
|
+
`mutation(cnst.Task, { guards: [SignedIn] }).with(CurrentUserId).exec(async function (currentUserId) { ... })`, or
|
|
29
|
+
`.with(Self)` / `.with(Me)`; the caller's address from `.with(Ip)`. Generated CRUD and `serve()` service methods /
|
|
30
|
+
lifecycle hooks receive no session context, so an operation that needs the acting user is a custom endpoint.
|
|
21
31
|
- Keep `static name = "User";` on guard classes — `fetch` serializes it and the API explorer filters on it. It looks
|
|
22
32
|
dead, so comment it.
|
|
23
33
|
- **Every guard declares `static scope: GuardScope`, no default**: `"account"` reads only the caller (MCP listings
|
|
@@ -25,22 +35,3 @@ paths:
|
|
|
25
35
|
`Admin` / roles are `"account"`, every `Can<Verb><Model>` is `"resource"`; `Person` adds `static agents = false`.
|
|
26
36
|
- `Can<Verb><Model>` guards in `srvkit/guards.ts` fail closed and ship with the model's library (`transportRule`).
|
|
27
37
|
Services re-check ownership behind a guard — two independent gates.
|
|
28
|
-
|
|
29
|
-
- **Every endpoint and named slice names its guards** (`no-unguarded-endpoint`, a warning) — a `query` / `mutation` /
|
|
30
|
-
`pubsub` / `message`, a named slice's `init()`, or a `slice()` map without `root` that names none (or `guards: []`)
|
|
31
|
-
refuses every caller, and outside local operation the server does not boot. Write `guards: [Public]` when
|
|
32
|
-
anonymous access is the intent.
|
|
33
|
-
|
|
34
|
-
- **A `slice()` takes its guard map as a second argument**, `slice(srv.task, { guards: { root: Admin, get: SignedIn,
|
|
35
|
-
cru: SignedIn } }, (init) => ({...}))`. An `endpoint()` takes no guard argument at all —
|
|
36
|
-
`endpoint(srv.task, ({ mutation }) => ({...}))` — so **every custom `mutation` / `query` / `message` names its own
|
|
37
|
-
`guards: [...]` array**: `mutation(cnst.Task, { guards: [SignedIn] })`. `Public` always allows; other guards
|
|
38
|
-
implement the `Guard` interface in `srvkit/` (server-only).
|
|
39
|
-
- **Read the caller inside a guard** with `context.get<T>("account")`, which works on HTTP and websocket calls
|
|
40
|
-
alike — never branch on `getHttpContext()` / `getWebSocketContext()`. Every guard class also declares
|
|
41
|
-
`static scope: GuardScope`, `"account"` or `"resource"`, with no default.
|
|
42
|
-
- **Read the current user inside a custom endpoint** by injecting an `InternalArg` with `.with(...)`:
|
|
43
|
-
`mutation(cnst.Task, { guards: [SignedIn] }).with(CurrentUserId).exec(async function (currentUserId) { ... })`.
|
|
44
|
-
- **Auto-generated CRUD and `serve()` service methods / lifecycle hooks do not receive session context.** If an
|
|
45
|
-
operation needs the acting user, expose a custom endpoint that takes it via `.with(CurrentUserId)` — never trust a
|
|
46
|
-
client-supplied user id.
|