@akanjs/cli 3.0.1 → 3.0.2
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-zfab7pkn.js → CodeAgent-szbjv4gv.js} +2 -2
- package/{CodeTui-0zhnr0pw.js → CodeTui-5nw86ab6.js} +1 -1
- package/{agent.command-aja6z9mn.js → agent.command-np1dffkb.js} +5 -5
- package/akanCode.js +2 -2
- package/{application.command-049ehgx3.js → application.command-gk69v1xs.js} +8 -8
- package/{applicationBuildRunner-75n5rpwp.js → applicationBuildRunner-wx09n9g6.js} +3 -3
- package/buildBatch.proc.js +4 -4
- package/{cloud.command-gw4kqxt8.js → cloud.command-tw06613r.js} +10 -10
- package/cloud.script-64gzba8r.js +20 -0
- package/{code.command-x9t6z5nw.js → code.command-hmtx14b2.js} +6 -6
- package/{context.command-yfbe1rtd.js → context.command-6aqvdx43.js} +13 -13
- package/context.runner-hnkvv3z3.js +21 -0
- package/{guideline.command-kq9gp690.js → guideline.command-axvf68gc.js} +2 -2
- package/guidelines/conventions/conventions.instruction.md +89 -17
- package/guidelines/queryRule/queryRule.instruction.md +4 -2
- package/guidelines/runtimeRule/runtimeRule.instruction.md +10 -5
- package/guidelines/transportRule/transportRule.instruction.md +40 -4
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +1 -1
- package/incrementalBuilder.proc.js +3 -3
- package/{index-66yspb67.js → index-1bjkfvm9.js} +29 -27
- package/{index-b95yhqjr.js → index-1gs9g12n.js} +3 -3
- package/{index-y7hx1ygz.js → index-3xmzr1p1.js} +2 -2
- package/{index-mzjb6zp4.js → index-50jjwg8y.js} +1 -1
- package/{index-150s07n8.js → index-50wb2a26.js} +313 -93
- package/{index-8b639zes.js → index-6keyf4sg.js} +4 -4
- package/{index-vs8mefhy.js → index-bsv901fd.js} +7 -7
- package/{index-5pvxf7z0.js → index-cb6yc5mb.js} +2 -2
- package/{index-rfcz04w9.js → index-f4e08ptp.js} +4 -4
- package/{index-25fvrxmy.js → index-g38nhv87.js} +1 -1
- package/{index-m3xsb1ms.js → index-gtjgnv36.js} +29 -11
- package/{index-mb59b8x0.js → index-h9ht6s60.js} +1 -1
- package/{index-5g4rkrvt.js → index-hp3stk1m.js} +3 -3
- package/{index-h54yj9wr.js → index-hxnnfy57.js} +6 -5
- package/{index-kn5d4jmg.js → index-j38qkvkk.js} +7 -7
- package/{index-y5ga5w9t.js → index-jb0hmt3k.js} +3 -3
- package/{index-7p4c0yer.js → index-jk9xnck6.js} +33 -11
- package/{index-senscydg.js → index-k9rrten6.js} +6 -1
- package/{index-qe71g4ze.js → index-nwd6qzvv.js} +42 -23
- package/{index-a37by9hn.js → index-q6ft9fkc.js} +4 -4
- package/{index-br8pkrk1.js → index-t91a7339.js} +5 -5
- package/{index-c14nsvnv.js → index-xwprn9nr.js} +1 -1
- package/{index-fkvb79qe.js → index-z750gk1j.js} +15 -11
- package/{index-5q14pwzd.js → index-zwd84m0w.js} +4 -4
- package/{index-8kvy8qb4.js → index-zyw622y1.js} +12 -2
- package/index.js +21 -21
- package/{library.command-keqjevpp.js → library.command-9m2rdwwz.js} +3 -3
- package/{localRegistry.command-pydeq5zf.js → localRegistry.command-kda81jyk.js} +9 -9
- package/{module.command-dkrnqx3v.js → module.command-q63dffya.js} +5 -5
- package/{package.command-wmc0ys5y.js → package.command-y2jh0m99.js} +3 -3
- package/package.json +2 -2
- package/{page.command-tf3erhrv.js → page.command-f3e4cwhh.js} +3 -3
- package/{primitive.command-7hqpegj4.js → primitive.command-r4kq75qj.js} +6 -6
- package/{quality.command-8122axq3.js → quality.command-f7gzh26z.js} +9 -2
- package/{repair.command-mcy12h0n.js → repair.command-0qmyr6qa.js} +5 -5
- package/{scalar.command-vvvbzttc.js → scalar.command-kddn7av4.js} +4 -4
- package/{subspace.command-pzvqfy5h.js → subspace.command-ft65qvc4.js} +5 -7
- package/templates/app/tsconfig.json.template +1 -6
- package/templates/app/ui/Recipe/jellyButton.ts +1 -0
- package/templates/facetIndex/index.ts +21 -6
- package/templates/lib/dict.ts +9 -1
- package/templates/lib/srv.ts +2 -3
- package/templates/libRoot/common/index.ts +2 -7
- package/templates/libRoot/srvkit/index.ts +2 -7
- package/templates/libRoot/ui/index.ts +2 -7
- package/templates/libRoot/webkit/index.ts +2 -7
- package/templates/moduleRoot/index.tsx +3 -3
- package/{tunnel.command-82zz5xnq.js → tunnel.command-b3ymdk4f.js} +2 -2
- package/{workflow.command-y8x3kgjv.js → workflow.command-z1srcdfw.js} +10 -10
- package/{workspace.command-jvsb7brc.js → workspace.command-vp6vmx3z.js} +21 -21
- package/cloud.script-c723cpcb.js +0 -20
- package/context.runner-erfe68j5.js +0 -21
- package/index-bjwxs904.js +0 -77
- package/templates/libRoot/common/commonLogic.ts +0 -14
- package/templates/libRoot/srvkit/backendLogic.ts +0 -13
- package/templates/libRoot/webkit/frontendLogic.ts +0 -13
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
script
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-q6ft9fkc.js";
|
|
5
5
|
import {
|
|
6
6
|
AppExecutor,
|
|
7
7
|
LibExecutor,
|
|
8
8
|
ModuleExecutor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-50wb2a26.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-h9ht6s60.js";
|
|
45
45
|
import {
|
|
46
46
|
ModuleScript
|
|
47
|
-
} from "./index-
|
|
47
|
+
} from "./index-f4e08ptp.js";
|
|
48
48
|
|
|
49
49
|
// pkgs/@akanjs/cli/primitive/primitive.script.ts
|
|
50
50
|
import { capitalize, lowerlize } from "akanjs/common";
|
|
@@ -22,26 +22,26 @@ import {
|
|
|
22
22
|
renderWorkflowApply,
|
|
23
23
|
renderWorkflowValidation,
|
|
24
24
|
renderWorkflowRunArtifact
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-h9ht6s60.js";
|
|
26
26
|
import {
|
|
27
27
|
AkanContextAnalyzer
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-zyw622y1.js";
|
|
29
29
|
import {
|
|
30
30
|
CommandContainer,
|
|
31
31
|
runner
|
|
32
|
-
} from "./index-
|
|
32
|
+
} from "./index-q6ft9fkc.js";
|
|
33
33
|
import {
|
|
34
34
|
ModuleScript
|
|
35
|
-
} from "./index-
|
|
35
|
+
} from "./index-f4e08ptp.js";
|
|
36
36
|
import {
|
|
37
37
|
PrimitiveScript
|
|
38
|
-
} from "./index-
|
|
38
|
+
} from "./index-6keyf4sg.js";
|
|
39
39
|
import {
|
|
40
40
|
spawnShell
|
|
41
|
-
} from "./index-
|
|
41
|
+
} from "./index-hp3stk1m.js";
|
|
42
42
|
import {
|
|
43
43
|
ScalarScript
|
|
44
|
-
} from "./index-
|
|
44
|
+
} from "./index-cb6yc5mb.js";
|
|
45
45
|
|
|
46
46
|
// pkgs/@akanjs/cli/workflow/workflow.runner.ts
|
|
47
47
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-q6ft9fkc.js";
|
|
6
6
|
import {
|
|
7
7
|
generatedFilesForSync,
|
|
8
8
|
createPassedPrimitiveReport,
|
|
9
9
|
scalarChangedFiles
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-h9ht6s60.js";
|
|
11
11
|
import {
|
|
12
12
|
pluralizeName
|
|
13
13
|
} from "./index-nz8prx9g.js";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-q6ft9fkc.js";
|
|
6
6
|
import {
|
|
7
7
|
ModuleExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-50wb2a26.js";
|
|
9
9
|
import {
|
|
10
10
|
sourceFile,
|
|
11
11
|
moduleSourcePaths,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
createPassedPrimitiveReport,
|
|
14
14
|
bilingualLabelForField,
|
|
15
15
|
bilingualDescriptionForField
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-h9ht6s60.js";
|
|
17
17
|
import {
|
|
18
18
|
PageScript
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-g38nhv87.js";
|
|
20
20
|
import {
|
|
21
21
|
pluralizeName
|
|
22
22
|
} from "./index-nz8prx9g.js";
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
SOURCE_EXTS,
|
|
4
4
|
WatchRootResolver
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-k9rrten6.js";
|
|
6
6
|
import {
|
|
7
7
|
FileSys2
|
|
8
8
|
} from "./index-52w0fvh8.js";
|
|
9
9
|
import {
|
|
10
10
|
AsyncDefaultExportDetector,
|
|
11
11
|
resolveSsrPageEntriesForApp
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-50wb2a26.js";
|
|
13
13
|
|
|
14
14
|
// pkgs/@akanjs/devkit/artifact/routeSeedIndex.ts
|
|
15
15
|
import path from "path";
|
|
@@ -2493,7 +2493,6 @@ class CsrDevResolver {
|
|
|
2493
2493
|
target: "browser",
|
|
2494
2494
|
metafile: true,
|
|
2495
2495
|
external: [...this.#context.externals ?? []],
|
|
2496
|
-
env: "AKAN_PUBLIC_*",
|
|
2497
2496
|
define: this.#context.define,
|
|
2498
2497
|
optimizeImports: this.#context.optimizeImports,
|
|
2499
2498
|
plugins: [PagesBundleBuilder.createCssStubPlugin()]
|
|
@@ -2516,7 +2515,6 @@ class CsrDevResolver {
|
|
|
2516
2515
|
metafile: true,
|
|
2517
2516
|
throw: false,
|
|
2518
2517
|
external: [...this.#context.externals ?? []],
|
|
2519
|
-
env: "AKAN_PUBLIC_*",
|
|
2520
2518
|
define: this.#context.define,
|
|
2521
2519
|
plugins: [
|
|
2522
2520
|
{
|
|
@@ -3489,7 +3487,6 @@ class CsrDevModuleCompiler {
|
|
|
3489
3487
|
naming: { entry: "[dir]/[name].[ext]", asset: "assets/[name]-[hash].[ext]" },
|
|
3490
3488
|
publicPath: this.#routePrefix,
|
|
3491
3489
|
metafile: true,
|
|
3492
|
-
env: "AKAN_PUBLIC_*",
|
|
3493
3490
|
define: { ...this.#context.define, "import.meta": "__akanMeta" },
|
|
3494
3491
|
optimizeImports: this.#context.optimizeImports,
|
|
3495
3492
|
plugins: [this.#registryPlugin(vendor, misses, macroOutputs)]
|
|
@@ -4186,7 +4183,9 @@ class DevGeneratedIndexSync {
|
|
|
4186
4183
|
}
|
|
4187
4184
|
async#facetContent(dir) {
|
|
4188
4185
|
const nameCasePattern = path23.basename(dir) === "ui" ? FACET_PASCAL_CASE_RE : FACET_CAMEL_CASE_RE;
|
|
4189
|
-
const entries = await readdir3(dir, { withFileTypes: true }).catch(() =>
|
|
4186
|
+
const entries = await readdir3(dir, { withFileTypes: true }).catch(() => null);
|
|
4187
|
+
if (!entries)
|
|
4188
|
+
return null;
|
|
4190
4189
|
const exportNames = entries.flatMap((entry) => {
|
|
4191
4190
|
const name = entry.name;
|
|
4192
4191
|
if (name.startsWith("."))
|
|
@@ -4199,9 +4198,10 @@ class DevGeneratedIndexSync {
|
|
|
4199
4198
|
return [];
|
|
4200
4199
|
const exportName = name.replace(FACET_SOURCE_FILE_RE, "");
|
|
4201
4200
|
return nameCasePattern.test(exportName) ? [exportName] : [];
|
|
4202
|
-
}).sort();
|
|
4201
|
+
}).sort(compareExportNames);
|
|
4203
4202
|
if (exportNames.length === 0)
|
|
4204
|
-
return
|
|
4203
|
+
return `export {};
|
|
4204
|
+
`;
|
|
4205
4205
|
return `${exportNames.map((name) => `export * from "./${name}";`).join(`
|
|
4206
4206
|
`)}
|
|
4207
4207
|
`;
|
|
@@ -4225,13 +4225,31 @@ class DevGeneratedIndexSync {
|
|
|
4225
4225
|
}
|
|
4226
4226
|
if (fileTypes.length === 0)
|
|
4227
4227
|
return null;
|
|
4228
|
-
return `
|
|
4229
|
-
${fileTypes.map((type) => `import * as ${type} from "./${modelName}.${type}";`).join(`
|
|
4228
|
+
return `${fileTypes.map((type) => `import * as ${type} from "./${modelName}.${type}";`).join(`
|
|
4230
4229
|
`)}
|
|
4231
4230
|
|
|
4232
|
-
export const ${modelName} = { ${fileTypes.join(", ")} }
|
|
4231
|
+
export const ${modelName} = { ${fileTypes.join(", ")} };
|
|
4232
|
+
`;
|
|
4233
4233
|
}
|
|
4234
4234
|
}
|
|
4235
|
+
var letterRankOf = (char) => char.toLowerCase().charCodeAt(0) * 2 + (char === char.toLowerCase() ? 1 : 0);
|
|
4236
|
+
var digitRunAt = (name, idx) => /^\d+/.exec(name.slice(idx))?.[0] ?? "";
|
|
4237
|
+
var compareExportNames = (a, b) => {
|
|
4238
|
+
for (let idx = 0;idx < a.length && idx < b.length; ) {
|
|
4239
|
+
const [runA, runB] = [digitRunAt(a, idx), digitRunAt(b, idx)];
|
|
4240
|
+
if (runA && runB && runA !== runB)
|
|
4241
|
+
return runA.length - runB.length || (runA < runB ? -1 : 1);
|
|
4242
|
+
if (runA && runB)
|
|
4243
|
+
idx += runA.length;
|
|
4244
|
+
else if (runA || runB)
|
|
4245
|
+
return runA ? -1 : 1;
|
|
4246
|
+
else if (a.charAt(idx) !== b.charAt(idx))
|
|
4247
|
+
return letterRankOf(a.charAt(idx)) - letterRankOf(b.charAt(idx));
|
|
4248
|
+
else
|
|
4249
|
+
idx++;
|
|
4250
|
+
}
|
|
4251
|
+
return a.length - b.length;
|
|
4252
|
+
};
|
|
4235
4253
|
var exists = async (file) => stat2(file).then(() => true).catch(() => false);
|
|
4236
4254
|
var formatError2 = (err) => err instanceof Error ? err.message : String(err);
|
|
4237
4255
|
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
writeGeneratedSyncState,
|
|
6
6
|
createRepairReport,
|
|
7
7
|
renderRepairReport
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-h9ht6s60.js";
|
|
9
9
|
import {
|
|
10
10
|
AkanContextAnalyzer
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-zyw622y1.js";
|
|
12
12
|
import {
|
|
13
13
|
runner
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-q6ft9fkc.js";
|
|
15
15
|
|
|
16
16
|
// pkgs/@akanjs/cli/repair/repair.runner.ts
|
|
17
17
|
var spawnShell = async (workspace, command) => await workspace.spawn("bash", ["-lc", command.startsWith("akan ") ? `bun run ${command}` : command], {
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
} from "./index-94s080qm.js";
|
|
7
7
|
import {
|
|
8
8
|
runner
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-q6ft9fkc.js";
|
|
10
10
|
import {
|
|
11
11
|
WorkspaceExecutor,
|
|
12
12
|
AppExecutor
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-50wb2a26.js";
|
|
14
14
|
import {
|
|
15
15
|
openBrowser
|
|
16
16
|
} from "./index-9dp031by.js";
|
|
@@ -145,7 +145,8 @@ class BunTestReport {
|
|
|
145
145
|
class PlatformTestTarget {
|
|
146
146
|
static installIdleMs = 5 * 60000;
|
|
147
147
|
static testIdleMs = 2 * 60000;
|
|
148
|
-
static
|
|
148
|
+
static remoteEnv = {
|
|
149
|
+
PUPPETEER_SKIP_DOWNLOAD: "true",
|
|
149
150
|
GIT_AUTHOR_NAME: "akan-test",
|
|
150
151
|
GIT_AUTHOR_EMAIL: "akan-test@localhost",
|
|
151
152
|
GIT_COMMITTER_NAME: "akan-test",
|
|
@@ -290,7 +291,7 @@ class LinuxDockerTarget extends PlatformTestTarget {
|
|
|
290
291
|
return await new IdleWatchedProcess([
|
|
291
292
|
"docker",
|
|
292
293
|
"exec",
|
|
293
|
-
...Object.entries(PlatformTestTarget.
|
|
294
|
+
...Object.entries(PlatformTestTarget.remoteEnv).flatMap(([key, value]) => ["-e", `${key}=${value}`]),
|
|
294
295
|
container,
|
|
295
296
|
"sh",
|
|
296
297
|
"-c",
|
|
@@ -461,7 +462,7 @@ class WindowsSshTarget extends PlatformTestTarget {
|
|
|
461
462
|
"$ProgressPreference = 'SilentlyContinue'",
|
|
462
463
|
"[Console]::OutputEncoding = [Text.Encoding]::UTF8",
|
|
463
464
|
"'PID=' + $PID",
|
|
464
|
-
...Object.entries(PlatformTestTarget.
|
|
465
|
+
...Object.entries(PlatformTestTarget.remoteEnv).map(([key, value]) => `$env:${key} = '${value}'`),
|
|
465
466
|
`Set-Location -LiteralPath '${runDir}\\w'`,
|
|
466
467
|
`cmd /c "${command} 2>&1"`,
|
|
467
468
|
"exit $LASTEXITCODE"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AppExecutor
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-50wb2a26.js";
|
|
5
5
|
import {
|
|
6
6
|
jsonText,
|
|
7
7
|
createWorkflowBaselineSummary,
|
|
8
8
|
buildAkanModuleContextIndex,
|
|
9
9
|
toolingRolloutGate
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-h9ht6s60.js";
|
|
11
11
|
import {
|
|
12
12
|
buildResourceList,
|
|
13
13
|
codexMcpConfigPath,
|
|
@@ -17,25 +17,25 @@ import {
|
|
|
17
17
|
upsertCodexMcpServerBlock,
|
|
18
18
|
renderDoctorText,
|
|
19
19
|
AkanContextAnalyzer
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-zyw622y1.js";
|
|
21
21
|
import {
|
|
22
22
|
runner
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-q6ft9fkc.js";
|
|
24
24
|
import {
|
|
25
25
|
getMobileTargets,
|
|
26
26
|
appIdsOf,
|
|
27
27
|
NativeApp,
|
|
28
28
|
isPlaceholderAppId
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-jk9xnck6.js";
|
|
30
30
|
import {
|
|
31
31
|
Prompter2
|
|
32
32
|
} from "./index-zzvvc845.js";
|
|
33
33
|
import {
|
|
34
34
|
RepairRunner
|
|
35
|
-
} from "./index-
|
|
35
|
+
} from "./index-hp3stk1m.js";
|
|
36
36
|
import {
|
|
37
37
|
WorkflowRunner
|
|
38
|
-
} from "./index-
|
|
38
|
+
} from "./index-bsv901fd.js";
|
|
39
39
|
|
|
40
40
|
// pkgs/@akanjs/devkit/akanMcpContract.ts
|
|
41
41
|
import path from "path";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
akanCodePaths2,
|
|
5
5
|
McpServerConfig,
|
|
6
6
|
McpSignIn
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-xwprn9nr.js";
|
|
8
8
|
import {
|
|
9
9
|
stripAnsi
|
|
10
10
|
} from "./index-7md2g9vw.js";
|
|
@@ -511,7 +511,7 @@ class AkanToolPack2 {
|
|
|
511
511
|
return { name: "akan-tools", factory: async (pi) => await this.#register(pi) };
|
|
512
512
|
}
|
|
513
513
|
async names() {
|
|
514
|
-
const { ContextRunner } = await import("./context.runner-
|
|
514
|
+
const { ContextRunner } = await import("./context.runner-hnkvv3z3.js");
|
|
515
515
|
return [
|
|
516
516
|
...new ContextRunner().listMcpTools(this.#options.mode).map((tool) => tool.name),
|
|
517
517
|
AkanToolPack2.verifyToolName
|
|
@@ -519,7 +519,7 @@ class AkanToolPack2 {
|
|
|
519
519
|
}
|
|
520
520
|
static verifyToolName = "akan_verify";
|
|
521
521
|
async#register(pi) {
|
|
522
|
-
const { ContextRunner } = await import("./context.runner-
|
|
522
|
+
const { ContextRunner } = await import("./context.runner-hnkvv3z3.js");
|
|
523
523
|
const runner = new ContextRunner;
|
|
524
524
|
const guidelineNames = await AkanToolPack2.#guidelineNames();
|
|
525
525
|
for (const tool of runner.listMcpTools(this.#options.mode, { guidelineNames })) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
binPlatforms,
|
|
4
4
|
Executor
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-50wb2a26.js";
|
|
6
6
|
|
|
7
7
|
// pkgs/@akanjs/devkit/mobile/mobileTarget.ts
|
|
8
8
|
var trimSlashes = (value) => value.replace(/^\/+|\/+$/g, "");
|
|
@@ -419,7 +419,8 @@ class NativeConfig {
|
|
|
419
419
|
screenCapture: target.desktop?.screenCapture,
|
|
420
420
|
window: NativeConfig.#compact({ ...target.desktop?.window }),
|
|
421
421
|
server: desktopServer,
|
|
422
|
-
bin: desktopBin
|
|
422
|
+
bin: desktopBin,
|
|
423
|
+
dmg: NativeConfig.#dmg(target.desktop?.dmg, abs)
|
|
423
424
|
});
|
|
424
425
|
const config = {
|
|
425
426
|
app: {
|
|
@@ -468,6 +469,16 @@ class NativeConfig {
|
|
|
468
469
|
return { image: abs(splash) };
|
|
469
470
|
return { ...splash, ...splash.image ? { image: abs(splash.image) } : {} };
|
|
470
471
|
}
|
|
472
|
+
static #dmg(dmg, abs) {
|
|
473
|
+
if (!dmg)
|
|
474
|
+
return;
|
|
475
|
+
const { background, background2x, ...layout } = dmg;
|
|
476
|
+
return {
|
|
477
|
+
...layout,
|
|
478
|
+
...background === undefined ? {} : { background: background === false ? false : abs(background) },
|
|
479
|
+
...background2x ? { background2x: abs(background2x) } : {}
|
|
480
|
+
};
|
|
481
|
+
}
|
|
471
482
|
static #updates(target, env) {
|
|
472
483
|
const { url, publicKey, channel = env, ...rest } = target.updates ?? {};
|
|
473
484
|
return url && publicKey ? { ...rest, url, publicKey, ...channel ? { channel } : {} } : undefined;
|
|
@@ -615,7 +626,7 @@ class NativeApp {
|
|
|
615
626
|
this.app = app;
|
|
616
627
|
this.target = target;
|
|
617
628
|
this.env = env;
|
|
618
|
-
this.targetRoot = path6.join(app.
|
|
629
|
+
this.targetRoot = path6.join(app.workspace.workspaceRoot, "dist", "native", app.name, target.name);
|
|
619
630
|
this.web = new NativeWebDir(path6.join(this.targetRoot, "web"));
|
|
620
631
|
}
|
|
621
632
|
outDir(platform) {
|
|
@@ -690,13 +701,14 @@ class NativeApp {
|
|
|
690
701
|
else
|
|
691
702
|
this.app.logger[read.level](read.message);
|
|
692
703
|
};
|
|
693
|
-
#task(platform, config, outDir = this.outDir(platform)) {
|
|
704
|
+
#task(platform, config, { outDir = this.outDir(platform), env = {} } = {}) {
|
|
694
705
|
return {
|
|
695
706
|
appDir: this.app.cwdPath,
|
|
696
707
|
config,
|
|
697
708
|
platform,
|
|
698
709
|
outDir,
|
|
699
710
|
envFiles: false,
|
|
711
|
+
env,
|
|
700
712
|
skipWebBuild: true,
|
|
701
713
|
log: (event) => {
|
|
702
714
|
if (event.level === "error")
|
|
@@ -712,13 +724,18 @@ class NativeApp {
|
|
|
712
724
|
}
|
|
713
725
|
};
|
|
714
726
|
}
|
|
727
|
+
async#runtimeEnv(server) {
|
|
728
|
+
if (this.env !== "local" || server || process.env.AKAN_PUBLIC_SERVER_URL)
|
|
729
|
+
return {};
|
|
730
|
+
return { PUBLIC_AKAN_SERVER_URL: `http://localhost:${await this.app.getDevPort()}` };
|
|
731
|
+
}
|
|
715
732
|
async build(platform, { profile = "release", server, installer = false, arch } = {}) {
|
|
716
733
|
NativeApp.#assertServerPlatform(platform, server);
|
|
717
734
|
NativeApp.assertInstaller(platform, installer);
|
|
718
735
|
await this.assembleWeb(platform);
|
|
719
736
|
const { api, config } = await this.prepare(platform, server, arch);
|
|
720
737
|
return await api.build({
|
|
721
|
-
...this.#task(platform, config),
|
|
738
|
+
...this.#task(platform, config, { env: await this.#runtimeEnv(server) }),
|
|
722
739
|
profile,
|
|
723
740
|
...arch ? { arch } : {},
|
|
724
741
|
...platform === "windows" ? {
|
|
@@ -741,7 +758,7 @@ class NativeApp {
|
|
|
741
758
|
await this.assembleWeb(platform);
|
|
742
759
|
const { api, config } = await this.prepare(platform, server);
|
|
743
760
|
return await api.run({
|
|
744
|
-
...this.#task(platform, config),
|
|
761
|
+
...this.#task(platform, config, { env: await this.#runtimeEnv(server) }),
|
|
745
762
|
profile,
|
|
746
763
|
onLine: this.#appLine,
|
|
747
764
|
...device ? { device } : {},
|
|
@@ -756,7 +773,7 @@ class NativeApp {
|
|
|
756
773
|
await this.web.clear();
|
|
757
774
|
const [{ api, config }, { api: routes }] = await Promise.all([this.prepare(platform), this.app.getConfig()]);
|
|
758
775
|
const session = await api.dev({
|
|
759
|
-
...this.#task(platform, config, this.devOutDir(platform)),
|
|
776
|
+
...this.#task(platform, config, { outDir: this.devOutDir(platform) }),
|
|
760
777
|
upstream,
|
|
761
778
|
hmrPath: "/_akan/hmr",
|
|
762
779
|
wsPaths: [`${routes.prefix}${routes.websocketPrefix}`],
|
|
@@ -792,7 +809,7 @@ class NativeApp {
|
|
|
792
809
|
await this.assembleWeb("ios");
|
|
793
810
|
const { api, config } = await this.prepare("ios");
|
|
794
811
|
return await api.release({
|
|
795
|
-
...this.#task("ios", config),
|
|
812
|
+
...this.#task("ios", config, { env: await this.#runtimeEnv() }),
|
|
796
813
|
platform: "ios",
|
|
797
814
|
signing: { ...teamId ? { teamId } : {}, ...adHoc ? { distribution: "ad-hoc" } : {} }
|
|
798
815
|
});
|
|
@@ -806,7 +823,7 @@ class NativeApp {
|
|
|
806
823
|
await this.assembleWeb(platform);
|
|
807
824
|
const { api, config } = await this.prepare(platform, server);
|
|
808
825
|
return await api.publishUpdate({
|
|
809
|
-
...this.#task(platform, config),
|
|
826
|
+
...this.#task(platform, config, { env: await this.#runtimeEnv(server) }),
|
|
810
827
|
platform,
|
|
811
828
|
out: this.updatesDir,
|
|
812
829
|
...channel ? { channel } : {},
|
|
@@ -851,7 +868,12 @@ class NativeApp {
|
|
|
851
868
|
const signing = NativeApp.androidSigning();
|
|
852
869
|
await this.assembleWeb("android");
|
|
853
870
|
const { api, config } = await this.prepare("android");
|
|
854
|
-
return await api.release({
|
|
871
|
+
return await api.release({
|
|
872
|
+
...this.#task("android", config, { env: await this.#runtimeEnv() }),
|
|
873
|
+
platform: "android",
|
|
874
|
+
signing,
|
|
875
|
+
formats
|
|
876
|
+
});
|
|
855
877
|
}
|
|
856
878
|
async packUpdate(platform, { out } = {}) {
|
|
857
879
|
await this.assembleWeb(platform);
|
|
@@ -861,7 +883,7 @@ class NativeApp {
|
|
|
861
883
|
const packed = await api.packUpdate({
|
|
862
884
|
...this.#task(platform, config),
|
|
863
885
|
platform,
|
|
864
|
-
out: out ?? path6.join(this.
|
|
886
|
+
out: out ?? path6.join(this.updatesDir, platform)
|
|
865
887
|
});
|
|
866
888
|
return { ...packed, channel: config.updates.channel ?? "production" };
|
|
867
889
|
}
|
|
@@ -80,6 +80,11 @@ import path3 from "path";
|
|
|
80
80
|
|
|
81
81
|
// pkgs/@akanjs/devkit/akanApp/devHostPolicy.ts
|
|
82
82
|
import path2 from "path";
|
|
83
|
+
var UNAVAILABLE_REDIS_HOST = "redis-tunnel-unavailable.invalid";
|
|
84
|
+
var redisTunnelPolicy = ({
|
|
85
|
+
environment,
|
|
86
|
+
databaseMode
|
|
87
|
+
}) => environment === "local" ? "none" : databaseMode === "single" ? "optional" : "required";
|
|
83
88
|
var BACKEND_RECOVERY_MAX_ATTEMPTS = 5;
|
|
84
89
|
var HELD_BUILDER_REQUEST_LIMIT = 64;
|
|
85
90
|
var BUILDER_MIN_RSS_RECYCLE_INTERVAL_MS = 30000;
|
|
@@ -833,4 +838,4 @@ class WatchRootResolver {
|
|
|
833
838
|
}
|
|
834
839
|
}
|
|
835
840
|
|
|
836
|
-
export { ApplicationBuildReporter, BUILDER_MIN_RSS_RECYCLE_INTERVAL_MS, SOURCE_EXTS, shouldRestartBackendByDevPlan, shouldRestartBuilderByDevPlan, shouldAbandonBackendRecovery, normalizeBackendReportedGeneration, shouldRestartDevHostByDevPlan, devHostStateOf, isLegacyBackendFallbackFile, shouldMarkBuildPhaseRecovered, shouldKeepBuildFailure, createBackendBuildStatus, backendRestartReasonFromMessage, mergeBackendRestartReasons, shouldReplaceLastGoodMessage, shouldQueueBuildStatusReplay, hasBuildFailureForGeneration, decideBuilderRssRecycle, decideBuilderRssSettle, decideIdleSuspend, resolveIdleSuspendMs, hasAnyBuildFailure, shouldRefreshConfigOnIdleWake, shouldHoldForReturningBuilder, shouldWarnBuilderRssCeilingTight, isRssCeilingUnreachable, shouldRelayRecycledFrontendState, mergeInvalidateMessages, buildStatusReplaySequence, filesChangedSince, HmrWatcher, WatchRootResolver };
|
|
841
|
+
export { ApplicationBuildReporter, UNAVAILABLE_REDIS_HOST, redisTunnelPolicy, BUILDER_MIN_RSS_RECYCLE_INTERVAL_MS, SOURCE_EXTS, shouldRestartBackendByDevPlan, shouldRestartBuilderByDevPlan, shouldAbandonBackendRecovery, normalizeBackendReportedGeneration, shouldRestartDevHostByDevPlan, devHostStateOf, isLegacyBackendFallbackFile, shouldMarkBuildPhaseRecovered, shouldKeepBuildFailure, createBackendBuildStatus, backendRestartReasonFromMessage, mergeBackendRestartReasons, shouldReplaceLastGoodMessage, shouldQueueBuildStatusReplay, hasBuildFailureForGeneration, decideBuilderRssRecycle, decideBuilderRssSettle, decideIdleSuspend, resolveIdleSuspendMs, hasAnyBuildFailure, shouldRefreshConfigOnIdleWake, shouldHoldForReturningBuilder, shouldWarnBuilderRssCeilingTight, isRssCeilingUnreachable, shouldRelayRecycledFrontendState, mergeInvalidateMessages, buildStatusReplaySequence, filesChangedSince, HmrWatcher, WatchRootResolver };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ApplicationBuildReporter,
|
|
4
|
+
UNAVAILABLE_REDIS_HOST,
|
|
5
|
+
redisTunnelPolicy,
|
|
4
6
|
BUILDER_MIN_RSS_RECYCLE_INTERVAL_MS,
|
|
5
7
|
SOURCE_EXTS,
|
|
6
8
|
shouldRestartBackendByDevPlan,
|
|
@@ -33,33 +35,33 @@ import {
|
|
|
33
35
|
filesChangedSince,
|
|
34
36
|
HmrWatcher,
|
|
35
37
|
WatchRootResolver
|
|
36
|
-
} from "./index-
|
|
38
|
+
} from "./index-k9rrten6.js";
|
|
37
39
|
import {
|
|
38
40
|
runner,
|
|
39
41
|
script
|
|
40
|
-
} from "./index-
|
|
42
|
+
} from "./index-q6ft9fkc.js";
|
|
41
43
|
import {
|
|
42
44
|
WorkspaceExecutor,
|
|
43
45
|
AppExecutor,
|
|
44
46
|
LibExecutor,
|
|
45
47
|
PkgExecutor
|
|
46
|
-
} from "./index-
|
|
48
|
+
} from "./index-50wb2a26.js";
|
|
47
49
|
import {
|
|
48
50
|
DesktopServerStage,
|
|
49
51
|
resolveMobileTargets,
|
|
50
52
|
resolveAppId,
|
|
51
53
|
NativeApp
|
|
52
|
-
} from "./index-
|
|
54
|
+
} from "./index-jk9xnck6.js";
|
|
53
55
|
import {
|
|
54
56
|
LibraryScript
|
|
55
|
-
} from "./index-
|
|
57
|
+
} from "./index-1bjkfvm9.js";
|
|
56
58
|
import {
|
|
57
59
|
stripAnsi
|
|
58
60
|
} from "./index-7md2g9vw.js";
|
|
59
61
|
import {
|
|
60
62
|
SlicePlanner,
|
|
61
63
|
formatSlicePlan
|
|
62
|
-
} from "./index-
|
|
64
|
+
} from "./index-50jjwg8y.js";
|
|
63
65
|
import {
|
|
64
66
|
openBrowser
|
|
65
67
|
} from "./index-9dp031by.js";
|
|
@@ -187,20 +189,29 @@ var closeBunSocket = (socket, error) => {
|
|
|
187
189
|
// pkgs/@akanjs/devkit/createTunnel.ts
|
|
188
190
|
var createTunnel = async (service, { app, environment, port = service === "postgres" ? 5432 : 6379 }) => {
|
|
189
191
|
const { serveDomain, repoName } = WorkspaceExecutor.getBaseDevEnv();
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
192
|
+
const host = `${app.name}-${environment}.${serveDomain}`;
|
|
193
|
+
const sshPort = process.env.SSH_TUNNEL_PORT ? parseInt(process.env.SSH_TUNNEL_PORT) : 32767;
|
|
194
|
+
const dstHost = `${service}-0.${service}-svc.${app.name}-${environment}.svc.cluster.local`;
|
|
195
|
+
const dstPort = service === "postgres" ? 5432 : 6379;
|
|
196
|
+
try {
|
|
197
|
+
await createSshTunnel({
|
|
198
|
+
localHost: "0.0.0.0",
|
|
199
|
+
localPort: port,
|
|
200
|
+
srcHost: "0.0.0.0",
|
|
201
|
+
srcPort: port,
|
|
202
|
+
dstHost,
|
|
203
|
+
dstPort,
|
|
204
|
+
sshOptions: {
|
|
205
|
+
host: host.endsWith(".localhost") ? "localhost" : host,
|
|
206
|
+
port: sshPort,
|
|
207
|
+
username: process.env.SSH_TUNNEL_USERNAME ?? "root",
|
|
208
|
+
password: process.env.SSH_TUNNEL_PASSWORD ?? repoName
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
} catch (error) {
|
|
212
|
+
const reasons = error instanceof AggregateError ? error.errors.map((reason) => reason instanceof Error ? reason.message : String(reason)).join("; ") : error instanceof Error ? error.message : String(error);
|
|
213
|
+
throw new Error(`Could not open the ${service} tunnel for ${app.name}-${environment}: SSH ${host}:${sshPort} -> ${dstHost}:${dstPort} failed (${reasons})`, { cause: error });
|
|
214
|
+
}
|
|
204
215
|
return `localhost:${port}`;
|
|
205
216
|
};
|
|
206
217
|
// pkgs/@akanjs/devkit/incrementalBuilder/incrementalBuilder.host.ts
|
|
@@ -818,9 +829,17 @@ class AkanAppHost {
|
|
|
818
829
|
}
|
|
819
830
|
async#prepareDatabase(type) {
|
|
820
831
|
const environment = WorkspaceExecutor.getBaseDevEnv().env;
|
|
821
|
-
|
|
832
|
+
const policy = redisTunnelPolicy({ environment, databaseMode: this.env.AKAN_DATABASE_MODE });
|
|
833
|
+
if (policy === "none")
|
|
822
834
|
return "localhost";
|
|
823
|
-
|
|
835
|
+
if (policy === "required")
|
|
836
|
+
return await createTunnel(type, { app: this.app, environment });
|
|
837
|
+
try {
|
|
838
|
+
return await createTunnel(type, { app: this.app, environment });
|
|
839
|
+
} catch (error) {
|
|
840
|
+
this.logger.warn(`${error instanceof Error ? error.message : String(error)} - continuing without Redis: the single database mode does not use it unless an app adaptor does`);
|
|
841
|
+
return UNAVAILABLE_REDIS_HOST;
|
|
842
|
+
}
|
|
824
843
|
}
|
|
825
844
|
#startBackend(startStatus = null) {
|
|
826
845
|
if (this.#stopping)
|
|
@@ -1867,7 +1886,7 @@ ${uniqueCandidates.map((candidate) => ` - ${candidate}`).join(`
|
|
|
1867
1886
|
|
|
1868
1887
|
// pkgs/@akanjs/cli/application/application.runner.ts
|
|
1869
1888
|
import { Logger as Logger3 } from "akanjs/common";
|
|
1870
|
-
var loadBuildRunner = async () => (await import("./applicationBuildRunner-
|
|
1889
|
+
var loadBuildRunner = async () => (await import("./applicationBuildRunner-wx09n9g6.js")).ApplicationBuildRunner;
|
|
1871
1890
|
var loadPrompts = async () => await import("@inquirer/prompts");
|
|
1872
1891
|
|
|
1873
1892
|
class ApplicationRunner extends runner("application") {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
LibExecutor,
|
|
11
11
|
PkgExecutor,
|
|
12
12
|
ModuleExecutor
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-50wb2a26.js";
|
|
14
14
|
|
|
15
15
|
// pkgs/@akanjs/devkit/commandDecorators/camelToKebabCase.ts
|
|
16
16
|
var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
@@ -373,14 +373,14 @@ var getOptionValue = async (argMeta, opt, context) => {
|
|
|
373
373
|
return convertArgValue(opt[argMeta.name], type ?? "string");
|
|
374
374
|
} else if (defaultValue !== undefined)
|
|
375
375
|
return defaultValue;
|
|
376
|
+
else if (nullable)
|
|
377
|
+
return null;
|
|
376
378
|
if (enumChoices) {
|
|
377
379
|
const choices = normalizeEnumChoices((typeof enumChoices === "function" ? await enumChoices(context) : enumChoices) ?? []);
|
|
378
380
|
if (choices.length === 1)
|
|
379
381
|
return choices[0]?.value;
|
|
380
382
|
return await select({ message: ask ?? desc ?? `Select the ${name} value`, choices });
|
|
381
|
-
} else if (
|
|
382
|
-
return null;
|
|
383
|
-
else if (type === "boolean") {
|
|
383
|
+
} else if (type === "boolean") {
|
|
384
384
|
const message = ask ?? desc ?? `Do you want to set ${name}? ${desc ? ` (${desc})` : ""}: `;
|
|
385
385
|
return await confirm({ message });
|
|
386
386
|
} else
|