@akanjs/cli 3.1.1-rc.4 → 3.1.1-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.build-stamp +1 -1
- package/{CodeAgent-8hfzq1zs.js → CodeAgent-y6ppa10x.js} +2 -2
- package/{CodeTui-kj6ng91g.js → CodeTui-dy37zz3j.js} +1 -1
- package/TunnelShare-mnn0jxnp.js +14 -0
- package/{agent.command-2gay26y4.js → agent.command-ydftceda.js} +5 -5
- package/akanCode.js +2 -2
- package/{application.command-a3aepayy.js → application.command-fdghyjfj.js} +9 -9
- package/{applicationBuildRunner-xye2sqrm.js → applicationBuildRunner-t2r84sz6.js} +72 -26
- package/buildBatch.proc.js +5 -5
- package/{cloud.command-t2zdcw87.js → cloud.command-eyxwxnrn.js} +13 -13
- package/cloud.script-c9f92bev.js +24 -0
- package/{code.command-184jfjtk.js → code.command-4kqbrjt9.js} +6 -6
- package/{context.command-kx0kzz3t.js → context.command-h56yvjay.js} +16 -16
- package/context.runner-cf11819z.js +25 -0
- package/{guideline.command-72psmnpx.js → guideline.command-snh85ctf.js} +2 -2
- package/guidelines/agentRule/agentRule.instruction.md +5 -2
- package/guidelines/conventions/conventions.instruction.md +10 -7
- package/guidelines/pageRule/pageRule.instruction.md +8 -0
- package/guidelines/queryRule/queryRule.instruction.md +10 -1
- package/guidelines/runtimeRule/runtimeRule.instruction.md +12 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +2 -1
- package/incrementalBuilder.proc.js +3 -3
- package/{index-0fpeb7x7.js → index-0fz95kxe.js} +1 -1
- package/{index-jn8gfj2b.js → index-12ny6e0x.js} +9 -9
- package/{index-sxqjxb4j.js → index-2xcc2ax5.js} +2 -2
- package/{index-md6026rp.js → index-31es1yev.js} +24 -2
- package/{index-azrhhgtb.js → index-3wypz6xj.js} +59 -8
- package/{index-kb51mayy.js → index-40brg4px.js} +3 -3
- package/{index-mtf0cx8t.js → index-42j4a8zq.js} +2 -2
- package/{index-x6c29k5m.js → index-44hh6bx2.js} +7 -7
- package/{index-qp73c26e.js → index-4vgbysa0.js} +3 -3
- package/{index-5anqj3bm.js → index-74tjjsnc.js} +4 -4
- package/{index-q0e6604h.js → index-905qdgqp.js} +1 -1
- package/{index-0dnv1039.js → index-b70zct19.js} +7 -7
- package/{index-bxjacq5c.js → index-bksa6cqh.js} +3 -3
- package/{index-s28awecf.js → index-ds2tmxgx.js} +3 -3
- package/{index-hrc7q2e6.js → index-e9b3zh22.js} +2 -2
- package/{index-eyhqttvh.js → index-espk51ah.js} +2 -2
- package/{index-3wfw8jb8.js → index-hmt54t45.js} +4 -4
- package/{index-zz5731qs.js → index-j9vyj3dj.js} +3 -3
- package/{index-xhnw8n74.js → index-jg2xev75.js} +2 -1
- package/{index-rqcmr940.js → index-jhbkzc8c.js} +4 -4
- package/{index-hqaa4y3y.js → index-kr9vpvdn.js} +8 -8
- package/{index-v1gz5vja.js → index-krz4bcg5.js} +1 -1
- package/{index-yaz7yks8.js → index-pcwzkdqb.js} +1 -1
- package/{index-ssseyt0n.js → index-secyhsjs.js} +4 -4
- package/{index-4q1amb3p.js → index-skk9zc1x.js} +2 -2
- package/{index-trjhp735.js → index-wcej7g4z.js} +5 -5
- package/{index-4g6te8sa.js → index-xb8809yb.js} +2 -2
- package/{index-9z37veck.js → index-xjf5j657.js} +1 -1
- package/{index-ggfjqpp4.js → index-zz4vrw85.js} +1 -1
- package/index.js +22 -22
- package/{library.command-tnxw0yb4.js → library.command-gycrwhf1.js} +3 -3
- package/{localRegistry.command-dy0byd6z.js → localRegistry.command-bajag7gm.js} +12 -12
- package/{module.command-8pjk6vmm.js → module.command-v6hgs1bc.js} +5 -5
- package/{package.command-b831nx2n.js → package.command-shzpcfph.js} +3 -3
- package/package.json +2 -2
- package/{page.command-earjccmn.js → page.command-ptxn5kqk.js} +3 -3
- package/{pipeline.command-yt8bq91c.js → pipeline.command-zz31pgax.js} +2 -2
- package/{primitive.command-8dw8ra1x.js → primitive.command-a1vse91z.js} +6 -6
- package/{projectTypecheck-btbw3nyf.js → projectTypecheck-2ztky9cf.js} +1 -1
- package/{quality.command-j2c4a2zg.js → quality.command-ah8qcakd.js} +2 -2
- package/{repair.command-7jv7bgc4.js → repair.command-cvazbz99.js} +5 -5
- package/{scalar.command-vwjk94zr.js → scalar.command-0acvyp26.js} +4 -4
- package/{subspace.command-xjw4tc0p.js → subspace.command-dzpfbc99.js} +8 -8
- package/templates/app/tsconfig.json.template +2 -7
- package/templates/workspaceRoot/bunfig.toml.template +0 -4
- package/{tunnel.command-zm29dgkr.js → tunnel.command-cfw6f0vz.js} +7 -7
- package/{workflow.command-nyjc1mxx.js → workflow.command-abb1d5xy.js} +10 -10
- package/{workspace.command-rq7mgq6f.js → workspace.command-5rc8f0wt.js} +30 -31
- package/TunnelShare-ycmz33ve.js +0 -14
- package/cloud.script-mm636g83.js +0 -24
- package/context.runner-d7dhvbc7.js +0 -25
package/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
391c408b48e51aeae62b642c223b7629e843c7917e382c56410dbba209e0c3fe
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
TunnelShare2
|
|
4
|
+
} from "./index-zz4vrw85.js";
|
|
5
|
+
import"./index-e9b3zh22.js";
|
|
6
|
+
import"./index-ds2tmxgx.js";
|
|
7
|
+
import"./index-m9jj544v.js";
|
|
8
|
+
import"./index-xb8809yb.js";
|
|
9
|
+
import"./index-0fz95kxe.js";
|
|
10
|
+
import"./index-wcej7g4z.js";
|
|
11
|
+
import"./index-52w0fvh8.js";
|
|
12
|
+
export {
|
|
13
|
+
TunnelShare2 as TunnelShare
|
|
14
|
+
};
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-3wypz6xj.js";
|
|
6
6
|
import"./index-52w0fvh8.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-wcej7g4z.js";
|
|
8
8
|
import"./index-hj6w4ka1.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
import"./index-xjf5j657.js";
|
|
10
|
+
import"./index-31es1yev.js";
|
|
11
11
|
import"./index-zzvvc845.js";
|
|
12
12
|
import {
|
|
13
13
|
AgentScript
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-4vgbysa0.js";
|
|
15
15
|
|
|
16
16
|
// pkgs/@akanjs/cli/agent/agent.command.ts
|
|
17
17
|
class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
|
package/akanCode.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
CodeMailbox2,
|
|
29
29
|
CodeSessionFork2,
|
|
30
30
|
CodeAgent2
|
|
31
|
-
} from "./index-
|
|
31
|
+
} from "./index-bksa6cqh.js";
|
|
32
32
|
import {
|
|
33
33
|
akanCodeDefaultModel2,
|
|
34
34
|
akanCodeModel2,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
SubagentPool2,
|
|
41
41
|
akanCodePaths2,
|
|
42
42
|
AkanCodeCompaction2
|
|
43
|
-
} from "./index-
|
|
43
|
+
} from "./index-krz4bcg5.js";
|
|
44
44
|
import"./index-7md2g9vw.js";
|
|
45
45
|
import {
|
|
46
46
|
CodeAgentRpcHost2
|
|
@@ -7,19 +7,19 @@ import {
|
|
|
7
7
|
Exec,
|
|
8
8
|
Workspace,
|
|
9
9
|
command
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-3wypz6xj.js";
|
|
11
11
|
import"./index-52w0fvh8.js";
|
|
12
|
-
import"./index-
|
|
12
|
+
import"./index-wcej7g4z.js";
|
|
13
13
|
import"./index-5nd1wtkv.js";
|
|
14
|
-
import"./index-
|
|
14
|
+
import"./index-jg2xev75.js";
|
|
15
15
|
import"./index-m9jj544v.js";
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
16
|
+
import"./index-ds2tmxgx.js";
|
|
17
|
+
import"./index-xb8809yb.js";
|
|
18
|
+
import"./index-0fz95kxe.js";
|
|
19
|
+
import"./index-2xcc2ax5.js";
|
|
20
20
|
import {
|
|
21
21
|
ApplicationScript
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-12ny6e0x.js";
|
|
23
23
|
import"./index-7md2g9vw.js";
|
|
24
24
|
import {
|
|
25
25
|
writeOption,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
allowLocalOption,
|
|
29
29
|
publicEnvOption
|
|
30
30
|
} from "./index-mdjc93e1.js";
|
|
31
|
-
import"./index-
|
|
31
|
+
import"./index-pcwzkdqb.js";
|
|
32
32
|
|
|
33
33
|
// pkgs/@akanjs/cli/application/application.command.ts
|
|
34
34
|
import { MigrationCommand } from "akanjs/server/migration/migrationCommand";
|
|
@@ -4,27 +4,60 @@ import {
|
|
|
4
4
|
Spinner,
|
|
5
5
|
ProjectTypecheck2,
|
|
6
6
|
WorkspaceExecutor
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-wcej7g4z.js";
|
|
8
8
|
import"./index-52w0fvh8.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
import"./index-espk51ah.js";
|
|
10
|
+
import"./index-0fz95kxe.js";
|
|
11
11
|
import {
|
|
12
12
|
AllRoutesBuilder,
|
|
13
13
|
FontPruner,
|
|
14
14
|
precompressArtifacts,
|
|
15
15
|
SsrBaseArtifactBuilder
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-40brg4px.js";
|
|
17
17
|
import {
|
|
18
18
|
CsrArtifactBuilder
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-xb8809yb.js";
|
|
20
20
|
import"./index-62md4dwy.js";
|
|
21
21
|
|
|
22
22
|
// pkgs/@akanjs/devkit/applicationBuildRunner.ts
|
|
23
|
-
import
|
|
23
|
+
import path3 from "path";
|
|
24
|
+
import { toError } from "akanjs/common";
|
|
25
|
+
|
|
26
|
+
// pkgs/@akanjs/devkit/akanConfig/productionLockfile.ts
|
|
27
|
+
import { mkdtemp, rm } from "fs/promises";
|
|
28
|
+
import os from "os";
|
|
29
|
+
import path from "path";
|
|
30
|
+
|
|
31
|
+
class ProductionLockfile {
|
|
32
|
+
static fileName = "bun.lock";
|
|
33
|
+
static async prune(workspaceRoot, packageJson) {
|
|
34
|
+
const workspaceLock = Bun.file(path.join(workspaceRoot, ProductionLockfile.fileName));
|
|
35
|
+
if (!await workspaceLock.exists())
|
|
36
|
+
throw new Error(`the workspace root has no ${ProductionLockfile.fileName}`);
|
|
37
|
+
const dir = await mkdtemp(path.join(os.tmpdir(), "akan-production-lock-"));
|
|
38
|
+
try {
|
|
39
|
+
await Promise.all([
|
|
40
|
+
Bun.write(path.join(dir, "package.json"), JSON.stringify(packageJson, null, 2)),
|
|
41
|
+
Bun.write(path.join(dir, ProductionLockfile.fileName), workspaceLock)
|
|
42
|
+
]);
|
|
43
|
+
const install = Bun.spawn([process.execPath, "install", "--lockfile-only", "--no-progress"], {
|
|
44
|
+
cwd: dir,
|
|
45
|
+
stdout: "ignore",
|
|
46
|
+
stderr: "pipe"
|
|
47
|
+
});
|
|
48
|
+
const [exitCode, stderr] = await Promise.all([install.exited, new Response(install.stderr).text()]);
|
|
49
|
+
if (exitCode !== 0)
|
|
50
|
+
throw new Error(stderr.trim() || `bun install --lockfile-only exited with ${exitCode}`);
|
|
51
|
+
return await Bun.file(path.join(dir, ProductionLockfile.fileName)).text();
|
|
52
|
+
} finally {
|
|
53
|
+
await rm(dir, { recursive: true, force: true });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
24
57
|
|
|
25
58
|
// pkgs/@akanjs/devkit/transforms/serverEnvPlugin.ts
|
|
26
59
|
import { existsSync, realpathSync } from "fs";
|
|
27
|
-
import
|
|
60
|
+
import path2 from "path";
|
|
28
61
|
var escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
29
62
|
var createServerEnvPlugin = ({
|
|
30
63
|
envDir,
|
|
@@ -34,7 +67,7 @@ var createServerEnvPlugin = ({
|
|
|
34
67
|
onLibEnv
|
|
35
68
|
}) => {
|
|
36
69
|
const others = [...new Set(environments)].filter((name) => name !== environment);
|
|
37
|
-
const dirs = new Set([
|
|
70
|
+
const dirs = new Set([path2.resolve(envDir), existsSync(envDir) ? realpathSync.native(envDir) : envDir]);
|
|
38
71
|
const folder = `^(?:${[...dirs].map(escapeRegExp).join("|")})[\\\\/]env\\.server\\.`;
|
|
39
72
|
const filter = new RegExp(`${folder}(?:${others.map(escapeRegExp).join("|")})\\.ts$`);
|
|
40
73
|
const own = new RegExp(`${folder}${escapeRegExp(environment)}\\.ts$`);
|
|
@@ -50,11 +83,11 @@ var createServerEnvPlugin = ({
|
|
|
50
83
|
if (profile)
|
|
51
84
|
build.onLoad({ filter: own }, async (args) => ({
|
|
52
85
|
loader: "ts",
|
|
53
|
-
contents: await ServerEnvProfile.sourceInPlaceOf(
|
|
86
|
+
contents: await ServerEnvProfile.sourceInPlaceOf(path2.join(path2.dirname(args.path), ServerEnvProfile.fileName(environment, profile)), args.path, profile)
|
|
54
87
|
}));
|
|
55
88
|
if (others.length)
|
|
56
89
|
build.onLoad({ filter }, async (args) => {
|
|
57
|
-
const name =
|
|
90
|
+
const name = path2.basename(args.path, ".ts").slice("env.server.".length);
|
|
58
91
|
const { exports } = new Bun.Transpiler({ loader: "ts" }).scan(await Bun.file(args.path).text());
|
|
59
92
|
const message = `env/env.server.${name}.ts is not in this build: \`akan build\` bundles the server env of AKAN_PUBLIC_ENV=${environment} alone, the environment its image runs. To run ${name}, build for it: AKAN_PUBLIC_ENV=${name} in the workspace's .env, which outranks the shell, or --env ${name} on a desktop or mobile build.`;
|
|
60
93
|
return {
|
|
@@ -69,8 +102,8 @@ var createServerEnvPlugin = ({
|
|
|
69
102
|
});
|
|
70
103
|
if (profile)
|
|
71
104
|
build.onLoad({ filter: ServerEnvProfile.envFilePattern }, async (args) => {
|
|
72
|
-
const name =
|
|
73
|
-
if (dirs.has(
|
|
105
|
+
const name = path2.basename(args.path, ".ts").slice("env.server.".length);
|
|
106
|
+
if (dirs.has(path2.dirname(args.path)) || name === "type" || name === "example")
|
|
74
107
|
return { loader: "ts", contents: await Bun.file(args.path).text() };
|
|
75
108
|
if (!libEnvs.has(args.path))
|
|
76
109
|
libEnvs.set(args.path, libEnv(args.path));
|
|
@@ -122,7 +155,7 @@ class ApplicationBuildRunner {
|
|
|
122
155
|
this.#profile = profile;
|
|
123
156
|
}
|
|
124
157
|
get #envDir() {
|
|
125
|
-
return
|
|
158
|
+
return path3.join(this.#app.cwdPath, "env");
|
|
126
159
|
}
|
|
127
160
|
#pinImageEnv(baseDevEnv, environment) {
|
|
128
161
|
const imageEnv = {
|
|
@@ -159,14 +192,14 @@ class ApplicationBuildRunner {
|
|
|
159
192
|
phases: this.#phases,
|
|
160
193
|
durationMs: Date.now() - this.#startedAt,
|
|
161
194
|
outputDir: this.#app.dist.cwdPath,
|
|
162
|
-
artifactDir:
|
|
195
|
+
artifactDir: path3.join(this.#app.dist.cwdPath, ".akan/artifact")
|
|
163
196
|
};
|
|
164
197
|
}
|
|
165
198
|
async typecheck(options = {}) {
|
|
166
199
|
await this.#app.getPageKeys({ refresh: true });
|
|
167
200
|
const typecheck = new ProjectTypecheck2(this.#app.cwdPath, this.#app.workspace.workspaceRoot, this.#app.getCommandEnv());
|
|
168
201
|
const libPageIncludes = (await this.#app.getPageRoots()).filter((root) => root.keyPrefix).flatMap((root) => {
|
|
169
|
-
const rel =
|
|
202
|
+
const rel = path3.relative(typecheck.typecheckDir, root.realDir).split(path3.sep).join("/");
|
|
170
203
|
return [`${rel}/**/*.ts`, `${rel}/**/*.tsx`];
|
|
171
204
|
});
|
|
172
205
|
await typecheck.run([
|
|
@@ -198,9 +231,14 @@ class ApplicationBuildRunner {
|
|
|
198
231
|
}
|
|
199
232
|
async buildAppMeta() {
|
|
200
233
|
const akanConfig = await this.#app.getConfig();
|
|
201
|
-
const
|
|
234
|
+
const packageJson = akanConfig.getProductionPackageJson();
|
|
235
|
+
const lockfile = await this.#pruneLockfile(packageJson);
|
|
236
|
+
const dockerfile = akanConfig.dockerfileFor(this.#environment ?? akanConfig.baseDevEnv.env, {
|
|
237
|
+
lockfile: lockfile !== null
|
|
238
|
+
});
|
|
202
239
|
await Promise.all([
|
|
203
|
-
this.#app.dist.writeJson("package.json",
|
|
240
|
+
this.#app.dist.writeJson("package.json", packageJson),
|
|
241
|
+
...lockfile !== null ? [this.#app.dist.writeFile(`${this.#app.dist.cwdPath}/${ProductionLockfile.fileName}`, lockfile)] : [],
|
|
204
242
|
this.#app.dist.writeFile(`${this.#app.dist.cwdPath}/Dockerfile`, dockerfile),
|
|
205
243
|
this.#app.dist.writeJson("akan.build.json", {
|
|
206
244
|
buildId: await this.#resolveBuildId(),
|
|
@@ -209,6 +247,14 @@ class ApplicationBuildRunner {
|
|
|
209
247
|
})
|
|
210
248
|
]);
|
|
211
249
|
}
|
|
250
|
+
async#pruneLockfile(packageJson) {
|
|
251
|
+
try {
|
|
252
|
+
return await ProductionLockfile.prune(this.#app.workspace.workspaceRoot, packageJson);
|
|
253
|
+
} catch (error) {
|
|
254
|
+
this.#app.logger.warn(`The image installs its dependencies unlocked, at the newest versions package.json allows: ${toError(error).message}`);
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
212
258
|
async#resolveBuildId() {
|
|
213
259
|
const fromEnv = process.env.AKAN_BUILD_ID?.trim();
|
|
214
260
|
if (fromEnv)
|
|
@@ -236,8 +282,8 @@ class ApplicationBuildRunner {
|
|
|
236
282
|
if (profileFile || !stripped.length || this.#warnedLibEnvs.has(file))
|
|
237
283
|
return;
|
|
238
284
|
this.#warnedLibEnvs.add(file);
|
|
239
|
-
const lib =
|
|
240
|
-
this.#app.logger.warn(`${lib}: the "${this.#profile}" build leaves out ${stripped.join(", ")}. Give the lib ${
|
|
285
|
+
const lib = path3.relative(this.#app.workspace.workspaceRoot, file);
|
|
286
|
+
this.#app.logger.warn(`${lib}: the "${this.#profile}" build leaves out ${stripped.join(", ")}. Give the lib ${path3.basename(ServerEnvProfile.profileFileOf(file, this.#profile ?? ""))} to say what this profile runs with.`);
|
|
241
287
|
}
|
|
242
288
|
});
|
|
243
289
|
return this.#serverEnv;
|
|
@@ -283,7 +329,7 @@ class ApplicationBuildRunner {
|
|
|
283
329
|
};
|
|
284
330
|
}
|
|
285
331
|
async#writeConsoleShim() {
|
|
286
|
-
await Bun.write(
|
|
332
|
+
await Bun.write(path3.join(this.#app.dist.cwdPath, "console.js"), `process.env.AKAN_COMMAND_TYPE = "console";
|
|
287
333
|
const { cnst, db, dict, option, server, sig, srv } = await import("./server.js");
|
|
288
334
|
const { assertAkanConsoleAllowed, startAkanConsole } = await import("./console-runtime.js");
|
|
289
335
|
|
|
@@ -307,14 +353,14 @@ void run().catch((error) => {
|
|
|
307
353
|
try {
|
|
308
354
|
return Bun.resolveSync("akanjs/server/rsc-worker", import.meta.dir);
|
|
309
355
|
} catch {
|
|
310
|
-
return
|
|
356
|
+
return path3.join(this.#app.workspace.workspaceRoot, "pkgs/akanjs/server/rscWorker.tsx");
|
|
311
357
|
}
|
|
312
358
|
}
|
|
313
359
|
#resolveConsoleRuntimeBuildEntry() {
|
|
314
360
|
try {
|
|
315
|
-
return
|
|
361
|
+
return path3.join(path3.dirname(Bun.resolveSync("akanjs/server", import.meta.dir)), "console.ts");
|
|
316
362
|
} catch {
|
|
317
|
-
return
|
|
363
|
+
return path3.join(this.#app.workspace.workspaceRoot, "pkgs/akanjs/server/console.ts");
|
|
318
364
|
}
|
|
319
365
|
}
|
|
320
366
|
async#buildSsr() {
|
|
@@ -332,13 +378,13 @@ void run().catch((error) => {
|
|
|
332
378
|
}
|
|
333
379
|
async#buildOrThrow(label, config) {
|
|
334
380
|
const flag = process.env.AKAN_BUILD_METAFILE;
|
|
335
|
-
const metafileDir = flag && flag !== "0" && flag !== "false" ?
|
|
381
|
+
const metafileDir = flag && flag !== "0" && flag !== "false" ? path3.join(this.#app.workspace.workspaceRoot, "local", "build-meta", path3.basename(this.#app.cwdPath)) : null;
|
|
336
382
|
const result = await Bun.build(metafileDir ? { ...config, metafile: true } : config);
|
|
337
383
|
if (!result.success)
|
|
338
384
|
throw new AggregateError(result.logs, `[${label}] Bun.build failed`);
|
|
339
385
|
if (metafileDir && result.metafile) {
|
|
340
|
-
const entry =
|
|
341
|
-
await Bun.write(
|
|
386
|
+
const entry = path3.parse(String(config.entrypoints[0] ?? label)).name;
|
|
387
|
+
await Bun.write(path3.join(metafileDir, `${entry}.json`), JSON.stringify(result.metafile));
|
|
342
388
|
}
|
|
343
389
|
return result;
|
|
344
390
|
}
|
package/buildBatch.proc.js
CHANGED
|
@@ -6,26 +6,26 @@ import {
|
|
|
6
6
|
resolveSsrPageEntriesForApp,
|
|
7
7
|
WorkspaceExecutor,
|
|
8
8
|
AppExecutor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-wcej7g4z.js";
|
|
10
10
|
import {
|
|
11
11
|
computeRouteSeedIndex,
|
|
12
12
|
saveRouteSeedIndex,
|
|
13
13
|
CsrDevBundler,
|
|
14
14
|
SsrDevBundler
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-espk51ah.js";
|
|
16
16
|
import"./index-52w0fvh8.js";
|
|
17
17
|
import {
|
|
18
18
|
ServerGraphFile,
|
|
19
19
|
PagesBundleBuilder
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-0fz95kxe.js";
|
|
21
21
|
import {
|
|
22
22
|
CssCompiler,
|
|
23
23
|
FontOptimizer,
|
|
24
24
|
SsrBaseArtifactBuilder
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-40brg4px.js";
|
|
26
26
|
import {
|
|
27
27
|
CsrArtifactBuilder
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-xb8809yb.js";
|
|
29
29
|
import"./index-62md4dwy.js";
|
|
30
30
|
|
|
31
31
|
// pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
|
|
@@ -3,27 +3,27 @@ import {
|
|
|
3
3
|
App,
|
|
4
4
|
Workspace,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-3wypz6xj.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
import"./index-wcej7g4z.js";
|
|
9
|
+
import"./index-e9b3zh22.js";
|
|
10
10
|
import {
|
|
11
11
|
PlatformTestRun
|
|
12
|
-
} from "./index-
|
|
13
|
-
import"./index-
|
|
12
|
+
} from "./index-jhbkzc8c.js";
|
|
13
|
+
import"./index-jg2xev75.js";
|
|
14
14
|
import"./index-m9jj544v.js";
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
15
|
+
import"./index-ds2tmxgx.js";
|
|
16
|
+
import"./index-xb8809yb.js";
|
|
17
|
+
import"./index-0fz95kxe.js";
|
|
18
18
|
import"./index-5nd1wtkv.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
19
|
+
import"./index-2xcc2ax5.js";
|
|
20
|
+
import"./index-12ny6e0x.js";
|
|
21
21
|
import"./index-7md2g9vw.js";
|
|
22
22
|
import"./index-tvehn2sp.js";
|
|
23
|
-
import"./index-
|
|
23
|
+
import"./index-42j4a8zq.js";
|
|
24
24
|
import {
|
|
25
25
|
CloudScript2
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-44hh6bx2.js";
|
|
27
27
|
import {
|
|
28
28
|
writeOption,
|
|
29
29
|
oneNativeTargetOption,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
hostOption,
|
|
35
35
|
subspaceOption
|
|
36
36
|
} from "./index-mdjc93e1.js";
|
|
37
|
-
import"./index-
|
|
37
|
+
import"./index-pcwzkdqb.js";
|
|
38
38
|
|
|
39
39
|
// pkgs/@akanjs/cli/cloud/cloud.command.ts
|
|
40
40
|
var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
CloudScript2
|
|
4
|
+
} from "./index-44hh6bx2.js";
|
|
5
|
+
import"./index-jhbkzc8c.js";
|
|
6
|
+
import"./index-12ny6e0x.js";
|
|
7
|
+
import"./index-pcwzkdqb.js";
|
|
8
|
+
import"./index-2xcc2ax5.js";
|
|
9
|
+
import"./index-42j4a8zq.js";
|
|
10
|
+
import"./index-jg2xev75.js";
|
|
11
|
+
import"./index-e9b3zh22.js";
|
|
12
|
+
import"./index-ds2tmxgx.js";
|
|
13
|
+
import"./index-m9jj544v.js";
|
|
14
|
+
import"./index-3wypz6xj.js";
|
|
15
|
+
import"./index-7md2g9vw.js";
|
|
16
|
+
import"./index-xb8809yb.js";
|
|
17
|
+
import"./index-5nd1wtkv.js";
|
|
18
|
+
import"./index-0fz95kxe.js";
|
|
19
|
+
import"./index-wcej7g4z.js";
|
|
20
|
+
import"./index-tvehn2sp.js";
|
|
21
|
+
import"./index-52w0fvh8.js";
|
|
22
|
+
export {
|
|
23
|
+
CloudScript2 as CloudScript
|
|
24
|
+
};
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-3wypz6xj.js";
|
|
8
8
|
import"./index-52w0fvh8.js";
|
|
9
|
-
import"./index-
|
|
9
|
+
import"./index-wcej7g4z.js";
|
|
10
10
|
import {
|
|
11
11
|
akanCodeDefaultModel2,
|
|
12
12
|
CodeAgentStreamPrinter2
|
|
@@ -19,7 +19,7 @@ class CodeRunner extends runner("code") {
|
|
|
19
19
|
async serve(options, listen) {
|
|
20
20
|
await import("./consoleToStderr-h5bryj94.js");
|
|
21
21
|
const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
|
|
22
|
-
import("./CodeAgent-
|
|
22
|
+
import("./CodeAgent-y6ppa10x.js"),
|
|
23
23
|
import("./CodeAgentRpcHost-9g27hmer.js"),
|
|
24
24
|
import("./CodeAgentRpcListener-7p7z5dd7.js")
|
|
25
25
|
]);
|
|
@@ -34,8 +34,8 @@ class CodeRunner extends runner("code") {
|
|
|
34
34
|
}
|
|
35
35
|
async tui(options, seed) {
|
|
36
36
|
const [{ CodeAgent }, { CodeTui }] = await Promise.all([
|
|
37
|
-
import("./CodeAgent-
|
|
38
|
-
import("./CodeTui-
|
|
37
|
+
import("./CodeAgent-y6ppa10x.js"),
|
|
38
|
+
import("./CodeTui-dy37zz3j.js")
|
|
39
39
|
]);
|
|
40
40
|
const agentOptions = await CodeRunner.#agentOptions(options, false);
|
|
41
41
|
let resume = options.resume;
|
|
@@ -67,7 +67,7 @@ class CodeRunner extends runner("code") {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
async run(prompt, options) {
|
|
70
|
-
const { CodeAgent } = await import("./CodeAgent-
|
|
70
|
+
const { CodeAgent } = await import("./CodeAgent-y6ppa10x.js");
|
|
71
71
|
const agent = await CodeAgent.create(await CodeRunner.#agentOptions(options, false));
|
|
72
72
|
const printer = new CodeAgentStreamPrinter2({ json: options.json, thinking: options.thinking });
|
|
73
73
|
agent.on((event) => printer.print(event));
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-3wypz6xj.js";
|
|
6
6
|
import"./index-52w0fvh8.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-wcej7g4z.js";
|
|
8
8
|
import"./index-hj6w4ka1.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
9
|
+
import"./index-xjf5j657.js";
|
|
10
|
+
import"./index-31es1yev.js";
|
|
11
|
+
import"./index-kr9vpvdn.js";
|
|
12
|
+
import"./index-jg2xev75.js";
|
|
13
13
|
import"./index-m9jj544v.js";
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
14
|
+
import"./index-ds2tmxgx.js";
|
|
15
|
+
import"./index-xb8809yb.js";
|
|
16
|
+
import"./index-0fz95kxe.js";
|
|
17
17
|
import"./index-zzvvc845.js";
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
18
|
+
import"./index-j9vyj3dj.js";
|
|
19
|
+
import"./index-905qdgqp.js";
|
|
20
|
+
import"./index-hmt54t45.js";
|
|
21
|
+
import"./index-74tjjsnc.js";
|
|
22
|
+
import"./index-skk9zc1x.js";
|
|
23
|
+
import"./index-b70zct19.js";
|
|
24
24
|
import {
|
|
25
25
|
ContextScript
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-secyhsjs.js";
|
|
27
27
|
|
|
28
28
|
// pkgs/@akanjs/cli/context/context.command.ts
|
|
29
29
|
class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ContextRunner2
|
|
4
|
+
} from "./index-kr9vpvdn.js";
|
|
5
|
+
import"./index-b70zct19.js";
|
|
6
|
+
import"./index-skk9zc1x.js";
|
|
7
|
+
import"./index-74tjjsnc.js";
|
|
8
|
+
import"./index-j9vyj3dj.js";
|
|
9
|
+
import"./index-hmt54t45.js";
|
|
10
|
+
import"./index-905qdgqp.js";
|
|
11
|
+
import"./index-jg2xev75.js";
|
|
12
|
+
import"./index-ds2tmxgx.js";
|
|
13
|
+
import"./index-m9jj544v.js";
|
|
14
|
+
import"./index-31es1yev.js";
|
|
15
|
+
import"./index-xjf5j657.js";
|
|
16
|
+
import"./index-zzvvc845.js";
|
|
17
|
+
import"./index-3wypz6xj.js";
|
|
18
|
+
import"./index-xb8809yb.js";
|
|
19
|
+
import"./index-0fz95kxe.js";
|
|
20
|
+
import"./index-wcej7g4z.js";
|
|
21
|
+
import"./index-hj6w4ka1.js";
|
|
22
|
+
import"./index-52w0fvh8.js";
|
|
23
|
+
export {
|
|
24
|
+
ContextRunner2 as ContextRunner
|
|
25
|
+
};
|
|
@@ -31,7 +31,10 @@ pages declaring one name never clash, and a registry kept outside the surface re
|
|
|
31
31
|
**refuses every call until the app names a guard of its own** — the same answer `None` gives, with no boot
|
|
32
32
|
warning. A product with accounts names it in its `option.ts`, `option.setAgentAccess(SignedIn)`, taking the same
|
|
33
33
|
guard classes every endpoint takes (an array is ANDed, `null` clears what a library set); without one the chat
|
|
34
|
-
cannot spend the LLM key.
|
|
34
|
+
cannot spend the LLM key. **The guard decides who, not what** — the browser writes the instructions, tools and
|
|
35
|
+
transcript — so `option.setAgentRequestPolicy((request, { account, ip }) => request)` sees each turn after the
|
|
36
|
+
guard, before the quota and the model (tool names as the page published them), and returns what is sent, or
|
|
37
|
+
throws an `Err` (`agent.error.requestRefused`) to refuse it.
|
|
35
38
|
`persist` keeps the transcript across reloads (sessionStorage; `{ storage: "local" }` to outlive the tab),
|
|
36
39
|
default off, and `shortcut={false}` gives the browser back the Cmd/Ctrl+L the launcher otherwise captures.
|
|
37
40
|
**`persist` also takes a `SessionHistory` of the app's own** — `{ load, save, clear }` — which is how a
|
|
@@ -630,7 +633,7 @@ pages declaring one name never clash, and a registry kept outside the surface re
|
|
|
630
633
|
|
|
631
634
|
## Built-In Tools
|
|
632
635
|
- The framework publishes six built-ins on every store surface: `navigate` (internal paths only, the same router
|
|
633
|
-
`Link` rides), `goBack` (this session's history — global, because history is not a control a page owns and a page
|
|
636
|
+
`Link` rides, so the app's navigation guards are asked and a refusal is reported as a kept page), `goBack` (this session's history — global, because history is not a control a page owns and a page
|
|
634
637
|
that draws no back link is not one you may not leave — a screen that must not be left withholds them with `builtins`,
|
|
635
638
|
not with prose), `readScreen` (the rendered DOM as compact text — headings, links, control values, and `(disabled)`
|
|
636
639
|
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
|
|
@@ -253,7 +253,8 @@ Declared in `akan.config.ts`, narrowed — never widened — by an env at boot;
|
|
|
253
253
|
`ca-certificates` and `tzdata`.
|
|
254
254
|
- **Native apps are the `native` section** (iOS, Android, desktop). A desktop app's carried server listens on a
|
|
255
255
|
loopback port any local program can call — guard it as a network server — and ships `private/` and its env
|
|
256
|
-
readable on the user's computer; read runtime files from `AKAN_APP_DIR
|
|
256
|
+
readable on the user's computer; read runtime files from `AKAN_APP_DIR`, and keep a secret the user gives it with
|
|
257
|
+
`NativeSecret` (the OS credential store), never in a file.
|
|
257
258
|
- **`database: { modes: [...] }`** (`single`, `multiple`, `cluster`), chosen by `AKAN_DATABASE_MODE`; an app running
|
|
258
259
|
in two modes avoids `q.raw`.
|
|
259
260
|
|
|
@@ -334,8 +335,9 @@ orchestration in `service`, client state in `store`; `Template` is forms, `Unit`
|
|
|
334
335
|
`remove<Model>(id)`, and `pickAndWrite` writes through the save hooks (`queryRule`).
|
|
335
336
|
- **`<model>.service.ts`** — a few lines: load → chain → `return await ….save()` (keep the `return await`). Side
|
|
336
337
|
effects go in `override async _preUpdate` / `_postCreate`; fire-and-forget is `void`-ed. Load every referenced
|
|
337
|
-
document, then save, then notify
|
|
338
|
-
|
|
338
|
+
document, then save, then notify; writes that must land together go in `this.transaction(async () => …)` and
|
|
339
|
+
their notification in `this.afterCommit(…)` (`queryRule`). Return `null` / `false` for not allowed or not found;
|
|
340
|
+
the signal decides whether that is an error.
|
|
339
341
|
- **`<model>.signal.ts`** — `XInternal` → `XSlice` → `XEndpoint`, all three even when empty; `exec` is a one-liner
|
|
340
342
|
calling the service.
|
|
341
343
|
- **`<model>.store.ts`** — custom actions only for a toast, an optimistic update, or a multi-field write:
|
|
@@ -395,9 +397,9 @@ orchestration in `service`, client state in `store`; `Template` is forms, `Unit`
|
|
|
395
397
|
wrong JSON type, a value outside its enum or a missing required field answers 400 with `data.name` naming the
|
|
396
398
|
path (`data.items.2.price`); a defaulted field may be left out, an undeclared key is dropped, and a stored model's
|
|
397
399
|
input keeps an absent field absent.
|
|
398
|
-
- **Reserved names**: generated CRUD (`create<Model>`, `update<Model>`, `remove<Model>`, …) exists for every model
|
|
399
|
-
|
|
400
|
-
|
|
400
|
+
- **Reserved names**: generated CRUD (`create<Model>`, `update<Model>`, `remove<Model>`, …) exists for every model
|
|
401
|
+
whose slice mounts the verb. `fetch.*` is one namespace across modules and a pubsub or message is routed by its bare
|
|
402
|
+
name, so the server refuses to boot on two claims of one name (`[DI:fetch]`, `[DI:socket]`), naming both.
|
|
401
403
|
- **Queries (`queryRule`)**: the root slice takes `queryKey` + `args`, never a raw query. A slice `exec` returns a
|
|
402
404
|
`query<Filter>(…)` descriptor (never a `list<Filter>` array) and is paged through `initX(…, { sort, page, limit })`.
|
|
403
405
|
A projection is bare on the facade (`pickById(id, { secret: true })`), under `select` on a filter accessor — the
|
|
@@ -415,7 +417,8 @@ orchestration in `service`, client state in `store`; `Template` is forms, `Unit`
|
|
|
415
417
|
screen with `page().prompt(name, description)`, and publish one component a host draws with
|
|
416
418
|
`page().app(name, description, load)` — a read-only tool whose `load` may only query.
|
|
417
419
|
- **In-page agent (`agentRule`)**: mount `<Agent.Chat />` once in a layout; it never executes tools and refuses
|
|
418
|
-
every call until `option.setAgentAccess(<guard>)
|
|
420
|
+
every call until `option.setAgentAccess(<guard>)`, which decides who — what a turn may ask is
|
|
421
|
+
`option.setAgentRequestPolicy`; the LLM is `option.setLlm({ apiKey, model, host })`, never env.
|
|
419
422
|
The surface is what components declare — `st.tool(…).exec(fn)` beside its control, `st.use` / `st.sel` /
|
|
420
423
|
`st.ref` keys — never a store class. `st.use.x({ agent: false })` hides a key; its model's `hidden` / `secret` /
|
|
421
424
|
`visual` fields are stripped at read. A tool value is capped at 20,000 characters. Route guidance is
|