@akanjs/cli 3.1.0-rc.2 → 3.1.0-rc.20
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-q50k4s45.js → CodeAgent-n3tzjm91.js} +2 -2
- package/{CodeAgentRpcHost-p7h6n2hp.js → CodeAgentRpcHost-9g27hmer.js} +1 -1
- package/{CodeTui-62g35ztk.js → CodeTui-fnm9ft4d.js} +47 -4
- package/TunnelShare-661cxz5e.js +14 -0
- package/{agent.command-adfd5299.js → agent.command-3qxf4xcj.js} +5 -5
- package/akanCode.js +7 -5
- package/{application.command-hj3gv1rx.js → application.command-zfja7x4r.js} +12 -11
- package/{applicationBuildRunner-by10r9gf.js → applicationBuildRunner-vh4j6vdv.js} +16 -9
- package/buildBatch.proc.js +7 -7
- package/{cloud.command-k2fhaape.js → cloud.command-fcc8e8tp.js} +17 -16
- package/cloud.script-1xt3tnts.js +24 -0
- package/{code.command-kt5zgcc2.js → code.command-130bdmhe.js} +25 -12
- package/{context.command-8fgn42jw.js → context.command-0qx447mb.js} +17 -16
- package/context.runner-1vsjztjg.js +25 -0
- package/{dependencyScanner-06z2dmrr.js → dependencyScanner-3afj2vt1.js} +1 -1
- package/{guideline.command-3yxxr2mm.js → guideline.command-cv5bmrx2.js} +2 -2
- package/guidelines/agentRule/agentRule.instruction.md +25 -10
- package/guidelines/conventions/conventions.instruction.md +463 -1084
- package/guidelines/cssRule/cssRule.instruction.md +16 -1
- package/guidelines/fieldRule/fieldRule.instruction.md +74 -0
- package/guidelines/framework/framework.instruction.md +4 -7
- package/guidelines/mcpRule/mcpRule.instruction.md +16 -9
- package/guidelines/modelConstant/modelConstant.instruction.md +2 -1
- package/guidelines/modelStore/modelStore.instruction.md +16 -0
- package/guidelines/pageRule/pageRule.instruction.md +80 -0
- package/guidelines/queryRule/queryRule.instruction.md +47 -12
- package/guidelines/runtimeRule/runtimeRule.instruction.md +89 -2
- package/guidelines/ssrRule/ssrRule.instruction.md +13 -0
- package/guidelines/transportRule/transportRule.instruction.md +107 -8
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +4 -4
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +70 -7
- package/incrementalBuilder.proc.js +4 -4
- package/{index-nq045px5.js → index-192ha4xh.js} +356 -307
- package/{index-t7nws9mx.js → index-1djcjcre.js} +661 -448
- package/{index-h85cxfkg.js → index-1p98exm2.js} +2 -2
- package/{index-hnby7p9n.js → index-1xj2t7cb.js} +7 -7
- package/{index-wa5jbxj1.js → index-2mrn1mrg.js} +1 -0
- package/{index-58vvz603.js → index-35hc95h5.js} +1 -1
- package/{index-tv8fjaba.js → index-4mhy6qme.js} +4 -4
- package/{index-rk9sdys3.js → index-5edzv8fn.js} +5 -5
- package/{index-k9rrten6.js → index-5nd1wtkv.js} +92 -94
- package/index-62md4dwy.js +260 -0
- package/{index-kc8z134d.js → index-665zp9rs.js} +38 -15
- package/{index-jwqtchha.js → index-86jt2a0e.js} +1 -1
- package/{index-d2242ksy.js → index-at7bz0xq.js} +3 -0
- package/{index-sqfdmb5b.js → index-awbdfcf2.js} +4 -4
- package/{index-azh29dc8.js → index-axs61rna.js} +19 -14
- package/{index-3hx1z96c.js → index-bqbf654f.js} +1 -1
- package/{index-6726qr1m.js → index-cpb3nvma.js} +57 -58
- package/{index-pyxn1b53.js → index-d72hfmdm.js} +13 -13
- package/{index-8zdwpxef.js → index-dye8pnxx.js} +119 -81
- package/{index-z507nzhg.js → index-fmzcs8v6.js} +4 -4
- package/{index-3reaaa1h.js → index-fyq1z6kt.js} +29 -27
- package/{index-0909wckt.js → index-g1mbppa9.js} +238 -236
- package/{index-fjsv10hd.js → index-hsadfb6c.js} +7 -7
- package/{index-tz5evhdr.js → index-j237xtew.js} +6 -6
- package/{index-nq2ja5e0.js → index-j4mkhz93.js} +3 -3
- package/{index-31ce9vhg.js → index-jw1zm273.js} +28 -30
- package/{index-q958tqqg.js → index-m9jj544v.js} +1 -1
- package/{index-8935h3n1.js → index-mdjc93e1.js} +1 -1
- package/{index-bea2gwc6.js → index-pydbnfez.js} +2 -2
- package/{index-20cebtth.js → index-qtfmtcrw.js} +17 -15
- package/{index-sby8fe1p.js → index-qwa5k1j8.js} +1 -1
- package/{index-e9prnmyt.js → index-tamvyvj3.js} +3 -3
- package/{index-rhbabmja.js → index-trpasv9q.js} +260 -259
- package/{index-2ahj896a.js → index-tvehn2sp.js} +1 -1
- package/{index-2etqq75t.js → index-va06nr10.js} +1090 -1078
- package/{index-g0vwzy9m.js → index-vk0pa0mn.js} +20 -21
- package/{index-xpdgxsj5.js → index-w44cy4vs.js} +2216 -2216
- package/index.js +22 -22
- package/{library.command-8tw59xzj.js → library.command-erp2f56n.js} +3 -3
- package/{localRegistry.command-tf3dmznd.js → localRegistry.command-hj3p16p5.js} +15 -14
- package/{module.command-9vm8hffy.js → module.command-gs2r615e.js} +5 -5
- package/{package.command-erbxe2tz.js → package.command-j10r76ax.js} +4 -4
- package/package.json +21 -21
- package/{page.command-jpavcj0p.js → page.command-4h4a8pnh.js} +3 -3
- package/{pipeline.command-b8rzvjvv.js → pipeline.command-a2nrk26m.js} +3 -3
- package/{primitive.command-sm32chzk.js → primitive.command-w6t0asqz.js} +6 -6
- package/{projectTypecheck-jamtx95x.js → projectTypecheck-f534enqj.js} +1 -1
- package/{quality.command-pkd17n6y.js → quality.command-77x7vbbx.js} +4 -4
- package/{repair.command-8y4mq6hs.js → repair.command-y6sstev7.js} +5 -5
- package/{scalar.command-q8khmyx5.js → scalar.command-20b8cy0k.js} +4 -4
- package/skills/akan-code/SKILL.md +4 -0
- package/skills/akan-store/SKILL.md +2 -1
- package/{subspace.command-51n0ykbx.js → subspace.command-baz73jpk.js} +11 -10
- package/templates/appSample/lib/task/Task.Util.tsx +7 -7
- package/templates/appSample/lib/task/Task.Zone.tsx +1 -1
- package/templates/appSample/ui/QuantityControl.tsx +2 -2
- package/templates/crudSinglePage/page.tsx +1 -1
- package/templates/lib/cnst.ts +0 -1
- package/templates/workspaceRoot/.gitignore.template +23 -52
- package/templates/workspaceRoot/biome.json.template +1 -1
- package/{tunnel.command-7820vtxq.js → tunnel.command-2kw8vt9g.js} +8 -7
- package/{workflow.command-n5sv4wqz.js → workflow.command-2djwmpqf.js} +10 -10
- package/{workspace.command-zdy60jh8.js → workspace.command-jqs7vjhe.js} +29 -28
- package/TunnelShare-f1egrktx.js +0 -13
- package/cloud.script-z8p5dz7e.js +0 -23
- package/context.runner-hnh0rg7m.js +0 -24
- package/index-n68jx79w.js +0 -120
|
@@ -1,17 +1,40 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
resolveSsrPageEntriesForApp
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-va06nr10.js";
|
|
5
5
|
import {
|
|
6
6
|
bundleDefine,
|
|
7
7
|
CsrEntryFiles,
|
|
8
8
|
PagesEntrySourceGenerator,
|
|
9
9
|
PagesBundleBuilder
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-192ha4xh.js";
|
|
11
11
|
|
|
12
12
|
// pkgs/@akanjs/devkit/frontendBuild/csrArtifactBuilder.ts
|
|
13
13
|
import { mkdir, rm, unlink } from "fs/promises";
|
|
14
|
+
import path2 from "path";
|
|
15
|
+
|
|
16
|
+
// pkgs/@akanjs/devkit/transforms/browserDirnamePlugin.ts
|
|
14
17
|
import path from "path";
|
|
18
|
+
var vendorScript = /[\\/]node_modules[\\/].+\.[cm]?js$/;
|
|
19
|
+
var createBrowserDirnamePlugin = () => ({
|
|
20
|
+
name: "akan-browser-dirname",
|
|
21
|
+
setup(build) {
|
|
22
|
+
build.onLoad({ filter: vendorScript }, async (args) => {
|
|
23
|
+
const source = await Bun.file(args.path).text();
|
|
24
|
+
if (!source.includes("__dirname") && !source.includes("__filename"))
|
|
25
|
+
return;
|
|
26
|
+
const posixPath = args.path.replaceAll("\\", "/");
|
|
27
|
+
const filename = posixPath.slice(posixPath.indexOf("/node_modules/"));
|
|
28
|
+
const define = { __dirname: JSON.stringify(path.posix.dirname(filename)), __filename: JSON.stringify(filename) };
|
|
29
|
+
return {
|
|
30
|
+
loader: "js",
|
|
31
|
+
contents: new Bun.Transpiler({ loader: "js", target: "browser", define }).transformSync(source)
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// pkgs/@akanjs/devkit/frontendBuild/csrArtifactBuilder.ts
|
|
15
38
|
class CsrArtifactBuilder {
|
|
16
39
|
#app;
|
|
17
40
|
#command;
|
|
@@ -67,11 +90,11 @@ ${logs}` : ""}`);
|
|
|
67
90
|
minify: true,
|
|
68
91
|
define: bundleDefine(app, command, "csr"),
|
|
69
92
|
optimizeImports,
|
|
70
|
-
plugins: [PagesBundleBuilder.createCssStubPlugin()]
|
|
93
|
+
plugins: [PagesBundleBuilder.createCssStubPlugin(), createBrowserDirnamePlugin()]
|
|
71
94
|
};
|
|
72
95
|
}
|
|
73
96
|
static publicEnvPath(app) {
|
|
74
|
-
return
|
|
97
|
+
return path2.join(app.dist.cwdPath, ".akan", "artifact", "csr-public-env.json");
|
|
75
98
|
}
|
|
76
99
|
static async writePublicEnv(app, define) {
|
|
77
100
|
const prefix = "process.env.";
|
|
@@ -89,20 +112,20 @@ ${logs}` : ""}`);
|
|
|
89
112
|
return CsrEntryFiles.entryFilename(basePath);
|
|
90
113
|
}
|
|
91
114
|
static basePathOfHtml(htmlPath) {
|
|
92
|
-
const name =
|
|
115
|
+
const name = path2.basename(htmlPath, ".html");
|
|
93
116
|
return name === "index" ? "" : name;
|
|
94
117
|
}
|
|
95
118
|
get #outputDir() {
|
|
96
|
-
return
|
|
119
|
+
return path2.join(this.#command === "build" ? this.#app.dist.cwdPath : this.#app.cwdPath, this.#command === "build" ? "csr" : ".akan/artifact/csr");
|
|
97
120
|
}
|
|
98
121
|
get #generatedDir() {
|
|
99
|
-
return
|
|
122
|
+
return path2.join(this.#app.cwdPath, ".akan/generated/csr");
|
|
100
123
|
}
|
|
101
124
|
get #artifactDir() {
|
|
102
|
-
return
|
|
125
|
+
return path2.join(this.#command === "build" ? this.#app.dist.cwdPath : this.#app.cwdPath, ".akan/artifact");
|
|
103
126
|
}
|
|
104
127
|
#generatedPath(filename) {
|
|
105
|
-
return
|
|
128
|
+
return path2.join(this.#generatedDir, filename);
|
|
106
129
|
}
|
|
107
130
|
async#createEntryFile(basePath, pageEntries) {
|
|
108
131
|
return [
|
|
@@ -135,7 +158,7 @@ void bootCsr(pages);
|
|
|
135
158
|
async#loadCssAssets() {
|
|
136
159
|
if (this.#cssAssets)
|
|
137
160
|
return this.#cssAssets;
|
|
138
|
-
const artifactFile = Bun.file(
|
|
161
|
+
const artifactFile = Bun.file(path2.join(this.#artifactDir, "base-artifact.json"));
|
|
139
162
|
if (!await artifactFile.exists())
|
|
140
163
|
return {};
|
|
141
164
|
const artifact = await artifactFile.json();
|
|
@@ -150,7 +173,7 @@ void bootCsr(pages);
|
|
|
150
173
|
const basePath = CsrArtifactBuilder.basePathOfHtml(htmlPath);
|
|
151
174
|
const cssAsset = cssAssets[basePath];
|
|
152
175
|
if (!cssAsset) {
|
|
153
|
-
this.#app.logger.warn(`[csr-build] base-artifact.json has no compiled stylesheet for ${basePath || "root"}; ${
|
|
176
|
+
this.#app.logger.warn(`[csr-build] base-artifact.json has no compiled stylesheet for ${basePath || "root"}; ${path2.basename(htmlPath)} ships without CSS`);
|
|
154
177
|
}
|
|
155
178
|
const inlined = await this.#inlineHtmlAssets(await htmlFile.text(), htmlPath, cssAsset);
|
|
156
179
|
for (const filePath of inlined.jsFiles)
|
|
@@ -171,7 +194,7 @@ ${remainingAssets.join(`
|
|
|
171
194
|
async#inlineHtmlAssets(html, htmlPath, cssAsset) {
|
|
172
195
|
let next = html;
|
|
173
196
|
if (cssAsset) {
|
|
174
|
-
const css = await Bun.file(
|
|
197
|
+
const css = await Bun.file(path2.join(this.#artifactDir, cssAsset.cssRelPath)).text();
|
|
175
198
|
next = CsrArtifactBuilder.injectBeforeHeadEnd(next, CsrArtifactBuilder.createInlineStyle(css));
|
|
176
199
|
}
|
|
177
200
|
const jsFiles = [];
|
|
@@ -189,7 +212,7 @@ ${remainingAssets.join(`
|
|
|
189
212
|
if (predicate(filePath))
|
|
190
213
|
files.push(filePath);
|
|
191
214
|
}
|
|
192
|
-
return files.sort();
|
|
215
|
+
return files.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
193
216
|
}
|
|
194
217
|
static injectBeforeHeadEnd(html, snippet) {
|
|
195
218
|
const scannable = CsrArtifactBuilder.blankEmbeddedContent(html);
|
|
@@ -205,7 +228,7 @@ ${html.slice(bodyStart)}`;
|
|
|
205
228
|
${snippet}`;
|
|
206
229
|
}
|
|
207
230
|
static blankEmbeddedContent(html) {
|
|
208
|
-
return html.replace(/<script\b[^>]*>[\s\S]
|
|
231
|
+
return html.replace(/<script\b[^>]*>[\s\S]*?(?:<\/script(?:[\s/][^<>]*)?>|$)|<style\b[^>]*>[\s\S]*?(?:<\/style(?:[\s/][^<>]*)?>|$)|<!--[\s\S]*?(?:--!?>|$)/gi, (match) => " ".repeat(match.length));
|
|
209
232
|
}
|
|
210
233
|
static createInlineStyle(css) {
|
|
211
234
|
return `<style data-akan-css="active">
|
|
@@ -241,7 +264,7 @@ ${CsrArtifactBuilder.escapeInlineScript(await loadScript(src))}
|
|
|
241
264
|
throw new Error(`[csr-build] cannot inline external script: ${src}`);
|
|
242
265
|
}
|
|
243
266
|
const normalized = src.startsWith("/") ? src.slice(1) : src;
|
|
244
|
-
return
|
|
267
|
+
return path2.resolve(path2.dirname(htmlPath), normalized);
|
|
245
268
|
}
|
|
246
269
|
}
|
|
247
270
|
|
|
@@ -77,6 +77,9 @@ class CodeAgentRpcHost2 {
|
|
|
77
77
|
case "set_model":
|
|
78
78
|
await this.#agent.setModel({ provider: command.provider, id: command.modelId });
|
|
79
79
|
return await this.#agent.state();
|
|
80
|
+
case "set_auto_compact":
|
|
81
|
+
this.#agent.setAutoCompactAt(command.percent);
|
|
82
|
+
return await this.#agent.state();
|
|
80
83
|
case "get_state":
|
|
81
84
|
return await this.#agent.state(command.sinceSeq === undefined ? {} : { sinceSeq: command.sinceSeq });
|
|
82
85
|
case "shutdown":
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
script
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-jw1zm273.js";
|
|
5
5
|
import {
|
|
6
6
|
AppExecutor,
|
|
7
7
|
LibExecutor,
|
|
8
8
|
ModuleExecutor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-va06nr10.js";
|
|
10
10
|
import {
|
|
11
11
|
workflowStatus,
|
|
12
12
|
compactDiagnostics,
|
|
@@ -41,10 +41,10 @@ import {
|
|
|
41
41
|
hasSignalFactoryEntry,
|
|
42
42
|
insertSignalFactoryEntry,
|
|
43
43
|
addFieldUiPolicyForType
|
|
44
|
-
} from "./index-
|
|
44
|
+
} from "./index-trpasv9q.js";
|
|
45
45
|
import {
|
|
46
46
|
ModuleScript
|
|
47
|
-
} from "./index-
|
|
47
|
+
} from "./index-fmzcs8v6.js";
|
|
48
48
|
|
|
49
49
|
// pkgs/@akanjs/cli/primitive/primitive.script.ts
|
|
50
50
|
import { capitalize, lowerlize } from "akanjs/common";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
resolveSsrPageEntriesForApp
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-va06nr10.js";
|
|
5
5
|
import {
|
|
6
6
|
computeRouteSeedIndex,
|
|
7
7
|
saveRouteSeedIndex,
|
|
@@ -9,17 +9,20 @@ import {
|
|
|
9
9
|
ClientEntriesBundler,
|
|
10
10
|
VENDOR_SPECIFIERS,
|
|
11
11
|
RouteClientBuilder
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-w44cy4vs.js";
|
|
13
13
|
import {
|
|
14
14
|
SOURCE_EXTS
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-5nd1wtkv.js";
|
|
16
16
|
import {
|
|
17
17
|
CsrEntryFiles,
|
|
18
18
|
BarrelAnalyzer,
|
|
19
19
|
createTsconfigPackageResolver,
|
|
20
20
|
rewriteBarrelImports,
|
|
21
21
|
PagesBundleBuilder
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-192ha4xh.js";
|
|
23
|
+
import {
|
|
24
|
+
CssBlockParser
|
|
25
|
+
} from "./index-62md4dwy.js";
|
|
23
26
|
var __require = import.meta.require;
|
|
24
27
|
|
|
25
28
|
// pkgs/@akanjs/devkit/frontendBuild/allRoutesBuilder.ts
|
|
@@ -127,7 +130,6 @@ class AllRoutesBuilder {
|
|
|
127
130
|
this.#knownSet.add(abs);
|
|
128
131
|
}
|
|
129
132
|
}
|
|
130
|
-
|
|
131
133
|
// pkgs/@akanjs/devkit/frontendBuild/cssCompiler.ts
|
|
132
134
|
import path3 from "path";
|
|
133
135
|
import { Logger } from "akanjs/common";
|
|
@@ -135,10 +137,10 @@ import { compile } from "tailwindcss";
|
|
|
135
137
|
|
|
136
138
|
// pkgs/@akanjs/devkit/frontendBuild/cssCandidateCache.ts
|
|
137
139
|
import { stat } from "fs/promises";
|
|
138
|
-
var CANDIDATE_RE = /-?(?:[\w@]|\[[
|
|
140
|
+
var CANDIDATE_RE = /-?(?:[\w@]|\[(?:[^[\]\s]|\[[^[\]\s]+\])+\])[\w:/.-]*(?:(?:\[(?:[^[\]\s]|\[[^[\]\s]+\])+\]|\((?:[a-z-]+:)?--[^)\s]+\))[\w:/.-]*)*/g;
|
|
139
141
|
|
|
140
142
|
class CssCandidateCache {
|
|
141
|
-
static #version =
|
|
143
|
+
static #version = 5;
|
|
142
144
|
#path;
|
|
143
145
|
#entries = new Map;
|
|
144
146
|
#dirty = false;
|
|
@@ -651,13 +653,19 @@ function isIgnoredNodeModuleSource(filePath) {
|
|
|
651
653
|
return NODE_MODULES_RE.test(filePath) && !AKANJS_NODE_MODULE_RE.test(filePath);
|
|
652
654
|
}
|
|
653
655
|
function declaredCustomProperties(css) {
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
+
const names = new Set;
|
|
657
|
+
CssBlockParser.walk(CssBlockParser.parse(css), true, (node) => {
|
|
658
|
+
if (node.kind === "block")
|
|
659
|
+
return node.atRule === "@theme" ? null : true;
|
|
660
|
+
if (node.property.startsWith("--"))
|
|
661
|
+
names.add(node.property);
|
|
662
|
+
return null;
|
|
663
|
+
});
|
|
664
|
+
return [...names];
|
|
656
665
|
}
|
|
657
666
|
function getPageKeyBasePath(pageKey, basePaths) {
|
|
658
667
|
return CsrEntryFiles.basePathOfPageKey(pageKey, basePaths);
|
|
659
668
|
}
|
|
660
|
-
|
|
661
669
|
// pkgs/@akanjs/devkit/frontendBuild/fontOptimizer.ts
|
|
662
670
|
import { mkdir, stat as stat2 } from "fs/promises";
|
|
663
671
|
import path4 from "path";
|
|
@@ -1045,7 +1053,7 @@ class FontOptimizer {
|
|
|
1045
1053
|
const filePaths = [];
|
|
1046
1054
|
for await (const filePath of glob.scan({ cwd: root, absolute: true }))
|
|
1047
1055
|
filePaths.push(filePath);
|
|
1048
|
-
for (const filePath of filePaths.sort())
|
|
1056
|
+
for (const filePath of filePaths.sort((a, b) => a < b ? -1 : a > b ? 1 : 0))
|
|
1049
1057
|
parts.push(await Bun.file(filePath).text());
|
|
1050
1058
|
}
|
|
1051
1059
|
return parts.join("");
|
|
@@ -1146,7 +1154,6 @@ ${declarations.map(([prop, value]) => ` ${prop}: ${value};`).join(`
|
|
|
1146
1154
|
return JSON.stringify(value);
|
|
1147
1155
|
}
|
|
1148
1156
|
}
|
|
1149
|
-
|
|
1150
1157
|
// pkgs/@akanjs/devkit/frontendBuild/fontPruner.ts
|
|
1151
1158
|
import { rm, rmdir, stat as stat3 } from "fs/promises";
|
|
1152
1159
|
import path5 from "path";
|
|
@@ -1310,7 +1317,6 @@ class FontPruner {
|
|
|
1310
1317
|
return await stat3(dir).then((entry) => entry.isDirectory(), () => false);
|
|
1311
1318
|
}
|
|
1312
1319
|
}
|
|
1313
|
-
|
|
1314
1320
|
// pkgs/@akanjs/devkit/frontendBuild/precompressArtifacts.ts
|
|
1315
1321
|
import fs from "fs";
|
|
1316
1322
|
import path6 from "path";
|
|
@@ -1370,7 +1376,6 @@ async function shouldPrecompress(filePath) {
|
|
|
1370
1376
|
return false;
|
|
1371
1377
|
return file.size >= MIN_COMPRESS_BYTES;
|
|
1372
1378
|
}
|
|
1373
|
-
|
|
1374
1379
|
// pkgs/@akanjs/devkit/frontendBuild/ssrBaseArtifactBuilder.ts
|
|
1375
1380
|
import path7 from "path";
|
|
1376
1381
|
import { optimize } from "@tailwindcss/node";
|
|
@@ -26,7 +26,7 @@ class ConfigLock {
|
|
|
26
26
|
}
|
|
27
27
|
static async#take(lockPath) {
|
|
28
28
|
const handle = await open(lockPath, "wx", 384).catch((error) => {
|
|
29
|
-
if (error.code === "EEXIST")
|
|
29
|
+
if (error.code === "EEXIST" || process.platform === "win32" && error.code === "EPERM")
|
|
30
30
|
return null;
|
|
31
31
|
throw error;
|
|
32
32
|
});
|
|
@@ -2,23 +2,73 @@
|
|
|
2
2
|
import {
|
|
3
3
|
FileSys2
|
|
4
4
|
} from "./index-52w0fvh8.js";
|
|
5
|
+
import {
|
|
6
|
+
resolveMobileTargets
|
|
7
|
+
} from "./index-m9jj544v.js";
|
|
5
8
|
import {
|
|
6
9
|
NativePublicEnv,
|
|
7
10
|
UpdatePackFolder,
|
|
8
11
|
NativeApp
|
|
9
|
-
} from "./index-
|
|
10
|
-
import {
|
|
11
|
-
resolveMobileTargets
|
|
12
|
-
} from "./index-q958tqqg.js";
|
|
12
|
+
} from "./index-g1mbppa9.js";
|
|
13
13
|
import {
|
|
14
14
|
ExitCodeError
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-jw1zm273.js";
|
|
16
16
|
import {
|
|
17
17
|
ConfigLock
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-bqbf654f.js";
|
|
19
|
+
|
|
20
|
+
// pkgs/@akanjs/devkit/cloud/cloudHttpError.ts
|
|
21
|
+
import { isRecord } from "akanjs/common";
|
|
22
|
+
|
|
23
|
+
class CloudHttpError extends Error {
|
|
24
|
+
status;
|
|
25
|
+
statusText;
|
|
26
|
+
url;
|
|
27
|
+
body;
|
|
28
|
+
headers;
|
|
29
|
+
static #errKey = /^[\w$-]+\.error\.[\w$-]+$/;
|
|
30
|
+
name = "CloudHttpError";
|
|
31
|
+
constructor(status, statusText, url, body, headers = new Headers) {
|
|
32
|
+
super(`${status} ${statusText} from ${url}: ${body.slice(0, 200)}`);
|
|
33
|
+
this.status = status;
|
|
34
|
+
this.statusText = statusText;
|
|
35
|
+
this.url = url;
|
|
36
|
+
this.body = body;
|
|
37
|
+
this.headers = headers;
|
|
38
|
+
}
|
|
39
|
+
static async of(response, url) {
|
|
40
|
+
return new CloudHttpError(response.status, response.statusText, url, await response.text(), response.headers);
|
|
41
|
+
}
|
|
42
|
+
static statusOf(error) {
|
|
43
|
+
return error instanceof CloudHttpError ? error.status : null;
|
|
44
|
+
}
|
|
45
|
+
get error() {
|
|
46
|
+
try {
|
|
47
|
+
const parsed = JSON.parse(this.body);
|
|
48
|
+
return isRecord(parsed) && typeof parsed.error === "string" ? parsed.error : null;
|
|
49
|
+
} catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
get errKey() {
|
|
54
|
+
const { error } = this;
|
|
55
|
+
return error && CloudHttpError.#errKey.test(error) ? error : null;
|
|
56
|
+
}
|
|
57
|
+
get retryAfterMs() {
|
|
58
|
+
return CloudHttpError.retryAfterMs(this.headers.get("retry-after"));
|
|
59
|
+
}
|
|
60
|
+
static retryAfterMs(header) {
|
|
61
|
+
const value = header?.trim() ?? "";
|
|
62
|
+
if (!value)
|
|
63
|
+
return null;
|
|
64
|
+
const ms = /^\d+$/.test(value) ? Number(value) * 1000 : Date.parse(value) - Date.now();
|
|
65
|
+
return Number.isFinite(ms) ? Math.max(0, ms) : null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
19
68
|
|
|
20
69
|
// pkgs/@akanjs/devkit/cloud/globalConfig.ts
|
|
21
70
|
import { mkdir, rm, writeFile } from "fs/promises";
|
|
71
|
+
import { trimTrailingSlashes } from "akanjs/common";
|
|
22
72
|
import dayjs from "dayjs";
|
|
23
73
|
|
|
24
74
|
// pkgs/@akanjs/devkit/cloud/constants.ts
|
|
@@ -68,7 +118,7 @@ class GlobalConfig {
|
|
|
68
118
|
}
|
|
69
119
|
static #normalizeHost(host) {
|
|
70
120
|
const url = URL.canParse(host) ? new URL(host) : null;
|
|
71
|
-
return url && (url.protocol === "https:" || url.protocol === "http:") ? `${url.origin}${url.pathname
|
|
121
|
+
return url && (url.protocol === "https:" || url.protocol === "http:") ? `${url.origin}${trimTrailingSlashes(url.pathname)}` : trimTrailingSlashes(host);
|
|
72
122
|
}
|
|
73
123
|
static async getHostConfig(host = GlobalConfig.akanCloudHost) {
|
|
74
124
|
const akanConfig = await GlobalConfig.#getAkanGlobalConfig();
|
|
@@ -169,55 +219,6 @@ class GlobalConfig {
|
|
|
169
219
|
}
|
|
170
220
|
}
|
|
171
221
|
|
|
172
|
-
// pkgs/@akanjs/devkit/cloud/cloudHttpError.ts
|
|
173
|
-
import { isRecord } from "akanjs/common";
|
|
174
|
-
|
|
175
|
-
class CloudHttpError extends Error {
|
|
176
|
-
status;
|
|
177
|
-
statusText;
|
|
178
|
-
url;
|
|
179
|
-
body;
|
|
180
|
-
headers;
|
|
181
|
-
static #errKey = /^[\w$-]+\.error\.[\w$-]+$/;
|
|
182
|
-
name = "CloudHttpError";
|
|
183
|
-
constructor(status, statusText, url, body, headers = new Headers) {
|
|
184
|
-
super(`${status} ${statusText} from ${url}: ${body.slice(0, 200)}`);
|
|
185
|
-
this.status = status;
|
|
186
|
-
this.statusText = statusText;
|
|
187
|
-
this.url = url;
|
|
188
|
-
this.body = body;
|
|
189
|
-
this.headers = headers;
|
|
190
|
-
}
|
|
191
|
-
static async of(response, url) {
|
|
192
|
-
return new CloudHttpError(response.status, response.statusText, url, await response.text(), response.headers);
|
|
193
|
-
}
|
|
194
|
-
static statusOf(error) {
|
|
195
|
-
return error instanceof CloudHttpError ? error.status : null;
|
|
196
|
-
}
|
|
197
|
-
get error() {
|
|
198
|
-
try {
|
|
199
|
-
const parsed = JSON.parse(this.body);
|
|
200
|
-
return isRecord(parsed) && typeof parsed.error === "string" ? parsed.error : null;
|
|
201
|
-
} catch {
|
|
202
|
-
return null;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
get errKey() {
|
|
206
|
-
const { error } = this;
|
|
207
|
-
return error && CloudHttpError.#errKey.test(error) ? error : null;
|
|
208
|
-
}
|
|
209
|
-
get retryAfterMs() {
|
|
210
|
-
return CloudHttpError.retryAfterMs(this.headers.get("retry-after"));
|
|
211
|
-
}
|
|
212
|
-
static retryAfterMs(header) {
|
|
213
|
-
const value = header?.trim() ?? "";
|
|
214
|
-
if (!value)
|
|
215
|
-
return null;
|
|
216
|
-
const ms = /^\d+$/.test(value) ? Number(value) * 1000 : Date.parse(value) - Date.now();
|
|
217
|
-
return Number.isFinite(ms) ? Math.max(0, ms) : null;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
222
|
// pkgs/@akanjs/devkit/cloud/cloudApi.ts
|
|
222
223
|
class HttpClient {
|
|
223
224
|
baseUrl;
|
|
@@ -370,7 +371,6 @@ class CloudApi {
|
|
|
370
371
|
}
|
|
371
372
|
}
|
|
372
373
|
}
|
|
373
|
-
|
|
374
374
|
// pkgs/@akanjs/devkit/cloud/cloudUpdates.ts
|
|
375
375
|
import path2 from "path";
|
|
376
376
|
import { Logger as Logger2 } from "akanjs/common";
|
|
@@ -585,7 +585,6 @@ ${(release.problems ?? []).map((problem) => ` - ${problem}`).join(`
|
|
|
585
585
|
});
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
|
-
|
|
589
588
|
// pkgs/@akanjs/devkit/cloud/pipelineSecrets.ts
|
|
590
589
|
import { capitalize, Logger as Logger3, PipelineNames } from "akanjs/common";
|
|
591
590
|
class PipelineSecrets {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AppExecutor
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-va06nr10.js";
|
|
5
5
|
import {
|
|
6
6
|
jsonText,
|
|
7
7
|
createWorkflowBaselineSummary,
|
|
8
8
|
buildAkanModuleContextIndex,
|
|
9
9
|
toolingRolloutGate
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-trpasv9q.js";
|
|
11
11
|
import {
|
|
12
12
|
buildResourceList,
|
|
13
13
|
codexMcpConfigPath,
|
|
@@ -17,29 +17,29 @@ import {
|
|
|
17
17
|
upsertCodexMcpServerBlock,
|
|
18
18
|
renderDoctorText,
|
|
19
19
|
AkanContextAnalyzer
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-5edzv8fn.js";
|
|
21
21
|
import {
|
|
22
22
|
runner
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-jw1zm273.js";
|
|
24
24
|
import {
|
|
25
25
|
isPlaceholderAppId
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-vk0pa0mn.js";
|
|
27
|
+
import {
|
|
28
|
+
getMobileTargets,
|
|
29
|
+
appIdsOf
|
|
30
|
+
} from "./index-m9jj544v.js";
|
|
27
31
|
import {
|
|
28
32
|
NativeApp
|
|
29
|
-
} from "./index-
|
|
33
|
+
} from "./index-g1mbppa9.js";
|
|
30
34
|
import {
|
|
31
35
|
Prompter2
|
|
32
36
|
} from "./index-zzvvc845.js";
|
|
33
37
|
import {
|
|
34
38
|
RepairRunner
|
|
35
|
-
} from "./index-
|
|
39
|
+
} from "./index-j4mkhz93.js";
|
|
36
40
|
import {
|
|
37
41
|
WorkflowRunner
|
|
38
|
-
} from "./index-
|
|
39
|
-
import {
|
|
40
|
-
getMobileTargets,
|
|
41
|
-
appIdsOf
|
|
42
|
-
} from "./index-q958tqqg.js";
|
|
42
|
+
} from "./index-1xj2t7cb.js";
|
|
43
43
|
|
|
44
44
|
// pkgs/@akanjs/devkit/akanMcpContract.ts
|
|
45
45
|
import path from "path";
|
|
@@ -127,7 +127,7 @@ var inspectAkanContextInputSchema = {
|
|
|
127
127
|
},
|
|
128
128
|
required: ["question", "draft", "review", "request"]
|
|
129
129
|
};
|
|
130
|
-
var slugPart = (value) => typeof value === "string" ? value.trim().replace(/[^a-zA-Z0-9]+/g, "-").replace(
|
|
130
|
+
var slugPart = (value) => typeof value === "string" ? value.trim().replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-|-$/g, "").toLowerCase() : "";
|
|
131
131
|
var optionalString = (args, key) => {
|
|
132
132
|
const value = args[key];
|
|
133
133
|
return typeof value === "string" && value ? value : undefined;
|