@akanjs/cli 3.1.1-rc.17 → 3.1.1-rc.19
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-rsebcq9c.js +9 -0
- package/{CodeTui-0626gxqd.js → CodeTui-mpybfknz.js} +1 -1
- package/TunnelShare-da9qj2mh.js +14 -0
- package/{agent.command-hpza0pg9.js → agent.command-xc1mf4yz.js} +13 -13
- package/akanCode.js +7 -5
- package/{application.command-3a7q1hs2.js → application.command-frkm7n6t.js} +43 -11
- package/{applicationBuildRunner-s7yt71j4.js → applicationBuildRunner-r9nvz9ms.js} +5 -5
- package/buildBatch.proc.js +5 -5
- package/{cloud.command-4vg0pcea.js → cloud.command-gakbzmdj.js} +16 -15
- package/cloud.script-1krw7gjb.js +26 -0
- package/{code.command-fbntb67p.js → code.command-pvfczhpy.js} +6 -6
- package/commandManifest.json +1 -1
- package/{context.command-31rm54v0.js → context.command-cp6fstk3.js} +16 -16
- package/context.runner-hwq8pwrg.js +26 -0
- package/{devTui-q7k7bakd.js → devTui-evr3b35y.js} +1 -1
- package/{guideline.command-cv3by2ng.js → guideline.command-761yyxqb.js} +2 -2
- package/guidelines/conventions/core.md +4 -2
- package/incrementalBuilder.proc.js +3 -3
- package/{index-zre4m2ce.js → index-1qmfdbjf.js} +4 -4
- package/{index-rvynj5gz.js → index-3e0c4d9d.js} +1 -1
- package/{index-922k2zwq.js → index-40qsd2tg.js} +3 -3
- package/{index-js1gj6f6.js → index-4412550g.js} +8 -8
- package/{index-x5ecanqh.js → index-6c5h9egr.js} +2 -2
- package/{index-tdv66eah.js → index-6h6x9e1n.js} +4 -4
- package/{index-7zeb5r1p.js → index-6yvp6qcb.js} +9 -9
- package/{index-mt0wa941.js → index-88aq81dz.js} +3 -3
- package/index-9bv479q5.js +1 -0
- package/{index-1dhf8ymv.js → index-9h8a7w1c.js} +3 -3
- package/{index-3gccwenr.js → index-9jyxbbnh.js} +1 -1
- package/{index-0ht91675.js → index-9z3xf23k.js} +35 -177
- package/{index-9ndw5d8j.js → index-a675rkqs.js} +7 -7
- package/{index-wfczhj1z.js → index-a9sjjv6x.js} +1 -1
- package/{index-05nxx4m5.js → index-acta9x3j.js} +2 -2
- package/{index-12kzwak1.js → index-b2p3qq5f.js} +2 -2
- package/{index-f5adsa58.js → index-b3br6jhe.js} +4 -4
- package/{index-57q1ayd2.js → index-cb58gjk2.js} +79 -11
- package/{index-0zyatd10.js → index-d1c677h0.js} +2 -2
- package/{index-hm7x0c11.js → index-d2x0mxsa.js} +4 -4
- package/{index-mwj9q2ya.js → index-fjxwyj3f.js} +1 -1
- package/{index-3txrjt6n.js → index-gftc47rk.js} +2 -2
- package/{index-8s8b4eba.js → index-mgdzy0cz.js} +64 -4
- package/{index-0zwznvv1.js → index-nrstta07.js} +1 -1
- package/{index-64g9fsjy.js → index-nt5c22sg.js} +9 -1
- package/{index-5n5hds19.js → index-t8jp2d3r.js} +1016 -658
- package/index-tenw3mah.js +225 -0
- package/{index-6269mf2s.js → index-tnhh146g.js} +8 -8
- package/{index-kjrvwzav.js → index-tpv8j9kq.js} +3 -3
- package/{index-5kh9scvs.js → index-trz8jyh1.js} +3 -73
- package/{index-m6r88hhr.js → index-v8w6kjx4.js} +2 -2
- package/{index-et6ce601.js → index-vp77rhem.js} +1 -1
- package/{index-w134p86k.js → index-zb0807wt.js} +1 -1
- package/{index-hvv5rnaq.js → index-zvhy8nch.js} +2 -2
- package/index.js +23 -23
- package/{library.command-sh70fyvy.js → library.command-stwr5zyk.js} +3 -3
- package/{localRegistry.command-2nbyy84d.js → localRegistry.command-t42y3tn6.js} +15 -14
- package/{module.command-n0bmtzwy.js → module.command-q2tv04e1.js} +5 -5
- package/{package.command-7h9r51bz.js → package.command-zra0r49p.js} +3 -3
- package/package.json +2 -2
- package/{page.command-vjtpfbb1.js → page.command-s7trjw69.js} +3 -3
- package/{pipeline.command-c93se3ar.js → pipeline.command-7p7tagtq.js} +2 -2
- package/{primitive.command-a3075qp2.js → primitive.command-6snsrb00.js} +6 -6
- package/{projectTypecheck-sf9xwaga.js → projectTypecheck-0g5azdzh.js} +1 -1
- package/{quality.command-dw1y9hmy.js → quality.command-n5kk1z6x.js} +3 -3
- package/{repair.command-tg57d8yt.js → repair.command-qngfxjd6.js} +5 -5
- package/{routeSourceValidator-6jd0q6r6.js → routeSourceValidator-4h947v7c.js} +13 -3
- package/{scalar.command-cwzge353.js → scalar.command-s28v00sy.js} +4 -4
- package/skills/akan-debug/SKILL.md +37 -3
- package/{subspace.command-3h03c7kc.js → subspace.command-8atqm584.js} +8 -8
- package/{tunnel.command-czaz6ys4.js → tunnel.command-kvwnw6n8.js} +7 -7
- package/{verify.command-nzwhtz71.js → verify.command-5fpqe0xp.js} +13 -13
- package/{workflow.command-srhky88x.js → workflow.command-0y3gez01.js} +10 -10
- package/{workspace.command-9stchcd2.js → workspace.command-fg6m6bjz.js} +29 -28
- package/CodeAgent-fbcq8vks.js +0 -9
- package/TunnelShare-2p24xxza.js +0 -14
- package/cloud.script-nkmeyhet.js +0 -25
- package/context.runner-w01a32ph.js +0 -26
- package/index-7md2g9vw.js +0 -6
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-9jyxbbnh.js";
|
|
6
6
|
import {
|
|
7
7
|
ModuleExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-nt5c22sg.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-acta9x3j.js";
|
|
17
17
|
import {
|
|
18
18
|
PageScript
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-3e0c4d9d.js";
|
|
20
20
|
import {
|
|
21
21
|
pluralizeName
|
|
22
22
|
} from "./index-nz8prx9g.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
script,
|
|
5
5
|
ExitCodeError,
|
|
6
6
|
markCliErrorPrinted
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-9jyxbbnh.js";
|
|
8
8
|
import {
|
|
9
9
|
AGENT_BLOCK_START,
|
|
10
10
|
AGENT_BLOCK_END,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
CLAUDE_COMMENT_RULE,
|
|
16
16
|
AppExecutor,
|
|
17
17
|
LibExecutor
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-nt5c22sg.js";
|
|
19
19
|
import {
|
|
20
20
|
ConventionSet,
|
|
21
21
|
Prompter2
|
|
@@ -26,19 +26,19 @@ import {
|
|
|
26
26
|
} from "./index-hj6w4ka1.js";
|
|
27
27
|
import {
|
|
28
28
|
AkanContextAnalyzer
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-mgdzy0cz.js";
|
|
30
30
|
import {
|
|
31
|
-
ApplicationRunner
|
|
32
|
-
|
|
31
|
+
ApplicationRunner,
|
|
32
|
+
VerifyScope
|
|
33
|
+
} from "./index-cb58gjk2.js";
|
|
33
34
|
import {
|
|
34
35
|
WorkspaceRunner
|
|
35
|
-
} from "./index-
|
|
36
|
+
} from "./index-v8w6kjx4.js";
|
|
36
37
|
import {
|
|
37
38
|
VerifyComments,
|
|
38
39
|
VerifyPipeline,
|
|
39
|
-
VerifyReport
|
|
40
|
-
|
|
41
|
-
} from "./index-5kh9scvs.js";
|
|
40
|
+
VerifyReport
|
|
41
|
+
} from "./index-trz8jyh1.js";
|
|
42
42
|
import {
|
|
43
43
|
akanCodePaths2
|
|
44
44
|
} from "./index-jje9qzyq.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
resolveSsrPageEntriesForApp
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-nt5c22sg.js";
|
|
5
5
|
import {
|
|
6
6
|
computeRouteSeedIndex,
|
|
7
7
|
saveRouteSeedIndex,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
ClientEntriesBundler,
|
|
10
10
|
VENDOR_SPECIFIERS,
|
|
11
11
|
RouteClientBuilder
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-b2p3qq5f.js";
|
|
13
13
|
import {
|
|
14
14
|
SOURCE_EXTS
|
|
15
15
|
} from "./index-p6x5b7hr.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
createTsconfigPackageResolver,
|
|
20
20
|
rewriteBarrelImports,
|
|
21
21
|
PagesBundleBuilder
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-nrstta07.js";
|
|
23
23
|
import {
|
|
24
24
|
CssBlockParser
|
|
25
25
|
} from "./index-62md4dwy.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @bun
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
resolveSsrPageEntriesForApp
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-nt5c22sg.js";
|
|
5
5
|
import {
|
|
6
6
|
bundleDefine,
|
|
7
7
|
CsrEntryFiles,
|
|
8
8
|
PagesEntrySourceGenerator,
|
|
9
9
|
PagesBundleBuilder
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-nrstta07.js";
|
|
11
11
|
|
|
12
12
|
// pkgs/@akanjs/devkit/frontendBuild/csrArtifactBuilder.ts
|
|
13
13
|
import { mkdir as mkdir2, rm as rm2, unlink as unlink2 } from "fs/promises";
|
|
@@ -274,7 +274,7 @@ ${logs}` : ""}`);
|
|
|
274
274
|
await rm(stagingDir, { recursive: true, force: true });
|
|
275
275
|
}
|
|
276
276
|
static async discover(pageEntries, basePaths) {
|
|
277
|
-
const { RouteSourceValidator } = await import("./routeSourceValidator-
|
|
277
|
+
const { RouteSourceValidator } = await import("./routeSourceValidator-4h947v7c.js");
|
|
278
278
|
const roots = pageEntries.filter((entry) => parseRouteModuleKey(entry.key).isInternalRootLayout);
|
|
279
279
|
const overrides = pageEntries.filter((entry) => parseRouteModuleKey(entry.key).kind === "overrides");
|
|
280
280
|
const layoutNodes = new Set(pageEntries.flatMap((entry) => {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
LibExecutor,
|
|
11
11
|
PkgExecutor,
|
|
12
12
|
ModuleExecutor
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-nt5c22sg.js";
|
|
14
14
|
|
|
15
15
|
// pkgs/@akanjs/devkit/commandDecorators/camelToKebabCase.ts
|
|
16
16
|
var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
@@ -4,10 +4,11 @@ import {
|
|
|
4
4
|
McpServerConfig,
|
|
5
5
|
McpSignIn,
|
|
6
6
|
AkanCodeCompaction2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-a9sjjv6x.js";
|
|
8
8
|
import {
|
|
9
|
+
PreviewView2,
|
|
9
10
|
stripAnsi
|
|
10
|
-
} from "./index-
|
|
11
|
+
} from "./index-tenw3mah.js";
|
|
11
12
|
import {
|
|
12
13
|
akanCodeDefaultModel2,
|
|
13
14
|
akanCodeModel2,
|
|
@@ -441,149 +442,6 @@ ${lines.join(`
|
|
|
441
442
|
}
|
|
442
443
|
}
|
|
443
444
|
|
|
444
|
-
// pkgs/@akanjs/devkit/codeAgent/feedback/PreviewChrome.ts
|
|
445
|
-
import { existsSync as existsSync6 } from "fs";
|
|
446
|
-
import { homedir } from "os";
|
|
447
|
-
import path6 from "path";
|
|
448
|
-
|
|
449
|
-
class PreviewChrome2 {
|
|
450
|
-
static pathEnvKey = "BUN_CHROME_PATH";
|
|
451
|
-
static backendEnvKey = "AKAN_CODE_WEBVIEW_BACKEND";
|
|
452
|
-
static executables = [
|
|
453
|
-
"chromium",
|
|
454
|
-
"chromium-browser",
|
|
455
|
-
"google-chrome-stable",
|
|
456
|
-
"google-chrome",
|
|
457
|
-
"brave-browser",
|
|
458
|
-
"microsoft-edge",
|
|
459
|
-
"chrome"
|
|
460
|
-
];
|
|
461
|
-
static appBundles = [
|
|
462
|
-
"Google Chrome.app/Contents/MacOS/Google Chrome",
|
|
463
|
-
"Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",
|
|
464
|
-
"Chromium.app/Contents/MacOS/Chromium",
|
|
465
|
-
"Brave Browser.app/Contents/MacOS/Brave Browser",
|
|
466
|
-
"Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
|
|
467
|
-
];
|
|
468
|
-
static get backend() {
|
|
469
|
-
const declared = process.env[PreviewChrome2.backendEnvKey];
|
|
470
|
-
if (declared === "webkit" || declared === "chrome")
|
|
471
|
-
return declared;
|
|
472
|
-
return process.platform === "darwin" ? "webkit" : "chrome";
|
|
473
|
-
}
|
|
474
|
-
static executable() {
|
|
475
|
-
const declared = process.env[PreviewChrome2.pathEnvKey];
|
|
476
|
-
if (declared)
|
|
477
|
-
return declared;
|
|
478
|
-
for (const name of PreviewChrome2.executables) {
|
|
479
|
-
const found = Bun.which(name);
|
|
480
|
-
if (found)
|
|
481
|
-
return found;
|
|
482
|
-
}
|
|
483
|
-
if (process.platform !== "darwin")
|
|
484
|
-
return;
|
|
485
|
-
for (const root of ["/Applications", path6.join(homedir(), "Applications")])
|
|
486
|
-
for (const bundle of PreviewChrome2.appBundles) {
|
|
487
|
-
const candidate = path6.join(root, bundle);
|
|
488
|
-
if (existsSync6(candidate))
|
|
489
|
-
return candidate;
|
|
490
|
-
}
|
|
491
|
-
return;
|
|
492
|
-
}
|
|
493
|
-
static get available() {
|
|
494
|
-
return PreviewChrome2.backend === "webkit" ? process.platform === "darwin" : !!PreviewChrome2.executable();
|
|
495
|
-
}
|
|
496
|
-
static backendOption() {
|
|
497
|
-
if (PreviewChrome2.backend === "webkit")
|
|
498
|
-
return "webkit";
|
|
499
|
-
const argv = ["--disable-dev-shm-usage"];
|
|
500
|
-
if (process.getuid?.() === 0)
|
|
501
|
-
argv.push("--no-sandbox");
|
|
502
|
-
return { type: "chrome", argv };
|
|
503
|
-
}
|
|
504
|
-
static dockerRuns = [
|
|
505
|
-
"apt-get update && apt-get install -y --no-install-recommends chromium fonts-liberation fonts-noto-color-emoji fonts-noto-cjk && rm -rf /var/lib/apt/lists/*"
|
|
506
|
-
];
|
|
507
|
-
static unavailableReason() {
|
|
508
|
-
if (PreviewChrome2.available)
|
|
509
|
-
return;
|
|
510
|
-
if (PreviewChrome2.backend === "webkit")
|
|
511
|
-
return `The webkit WebView backend exists only on macOS. Set ${PreviewChrome2.backendEnvKey}=chrome and install a browser.`;
|
|
512
|
-
return [
|
|
513
|
-
"The page preview needs a browser and this machine has none on PATH.",
|
|
514
|
-
`Install one (${PreviewChrome2.dockerRuns[0]}) or point ${PreviewChrome2.pathEnvKey} at an existing Chrome.`
|
|
515
|
-
].join(" ");
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
// pkgs/@akanjs/devkit/codeAgent/feedback/PreviewView.ts
|
|
520
|
-
class PreviewView2 {
|
|
521
|
-
static get available() {
|
|
522
|
-
return typeof Bun.WebView === "function" && PreviewChrome2.available;
|
|
523
|
-
}
|
|
524
|
-
static unavailableReason() {
|
|
525
|
-
if (typeof Bun.WebView !== "function")
|
|
526
|
-
return "This Bun build has no WebView, so the page preview is off.";
|
|
527
|
-
return PreviewChrome2.unavailableReason();
|
|
528
|
-
}
|
|
529
|
-
static async probe(url, { screenshot = false, width = 1280, height = 800 } = {}) {
|
|
530
|
-
const logs = [];
|
|
531
|
-
const view = PreviewView2.#open({ width, height, onConsole: (line) => logs.push(line) });
|
|
532
|
-
try {
|
|
533
|
-
await view.navigate(url);
|
|
534
|
-
const result = {
|
|
535
|
-
url,
|
|
536
|
-
title: view.title,
|
|
537
|
-
consoleErrors: logs.filter((line) => line.startsWith("error") || line.startsWith("warn")),
|
|
538
|
-
pageErrors: PreviewView2.#strings(await view.evaluate(pageErrorsExpression)),
|
|
539
|
-
domFindings: PreviewView2.#strings(await view.evaluate(domFindingsExpression))
|
|
540
|
-
};
|
|
541
|
-
if (screenshot)
|
|
542
|
-
result.screenshot = await view.screenshot({ encoding: "base64" });
|
|
543
|
-
return result;
|
|
544
|
-
} finally {
|
|
545
|
-
await view.close();
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
static #open({ width, height, onConsole }) {
|
|
549
|
-
const Ctor = Bun.WebView;
|
|
550
|
-
return new Ctor({
|
|
551
|
-
width,
|
|
552
|
-
height,
|
|
553
|
-
dataStore: "ephemeral",
|
|
554
|
-
backend: PreviewChrome2.backendOption(),
|
|
555
|
-
console: (type, ...args) => onConsole(`${type} ${args.map(String).join(" ")}`)
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
static #strings(value) {
|
|
559
|
-
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
var pageErrorsExpression = `(() => {
|
|
563
|
-
const found = [];
|
|
564
|
-
const root = document.getElementById("__next") || document.body;
|
|
565
|
-
const rendered = root ? Array.from(root.children).filter((el) => !["SCRIPT", "STYLE", "TEMPLATE", "LINK", "NOSCRIPT"].includes(el.tagName)) : [];
|
|
566
|
-
if (!rendered.length && !(root && root.innerText && root.innerText.trim())) found.push("The page body rendered empty.");
|
|
567
|
-
const overlay = document.querySelector("[data-nextjs-dialog], .error-overlay, #akan-error");
|
|
568
|
-
if (overlay) found.push("An error overlay is on the page: " + overlay.textContent.slice(0, 400));
|
|
569
|
-
return found;
|
|
570
|
-
})()`;
|
|
571
|
-
var domFindingsExpression = `(() => {
|
|
572
|
-
const found = [];
|
|
573
|
-
const all = Array.from(document.querySelectorAll("body *"));
|
|
574
|
-
const overflowing = all.filter((el) => el.scrollWidth > document.documentElement.clientWidth + 8);
|
|
575
|
-
if (overflowing.length) found.push(overflowing.length + " element(s) overflow the viewport horizontally, first: " + (overflowing[0].tagName + "." + overflowing[0].className).slice(0, 120));
|
|
576
|
-
const invisibleText = all.filter((el) => {
|
|
577
|
-
if (!el.textContent || !el.textContent.trim()) return false;
|
|
578
|
-
const style = getComputedStyle(el);
|
|
579
|
-
return style.color === style.backgroundColor && style.backgroundColor !== "rgba(0, 0, 0, 0)";
|
|
580
|
-
});
|
|
581
|
-
if (invisibleText.length) found.push(invisibleText.length + " element(s) render text in the same colour as their background.");
|
|
582
|
-
const unresolved = all.filter((el) => /(^|\\s)(bg|text|border)-(base-100|base-content|primary-content|error)(\\s|$)/.test(el.className || ""));
|
|
583
|
-
if (unresolved.length) found.push(unresolved.length + " element(s) use a dropped daisyUI colour slot that renders no CSS.");
|
|
584
|
-
return found;
|
|
585
|
-
})()`;
|
|
586
|
-
|
|
587
445
|
// pkgs/@akanjs/devkit/codeAgent/feedback/PreviewFeedback.ts
|
|
588
446
|
class PreviewFeedback2 {
|
|
589
447
|
key = "preview";
|
|
@@ -606,7 +464,7 @@ class PreviewFeedback2 {
|
|
|
606
464
|
for (const route of this.#options.routes ?? ["/en/"]) {
|
|
607
465
|
const url = new URL(route, this.#options.previewUrl).toString();
|
|
608
466
|
const probe = await PreviewView2.probe(url, { screenshot: !!this.#options.canSeeImages });
|
|
609
|
-
const problems = [...probe.pageErrors, ...probe.consoleErrors, ...probe.domFindings];
|
|
467
|
+
const problems = [...probe.pageErrors, ...probe.consoleErrors, ...probe.consoleWarnings, ...probe.domFindings];
|
|
610
468
|
if (!problems.length)
|
|
611
469
|
continue;
|
|
612
470
|
findings.push(`**${url}**
|
|
@@ -692,8 +550,8 @@ class TurnFeedback2 {
|
|
|
692
550
|
}
|
|
693
551
|
|
|
694
552
|
// pkgs/@akanjs/devkit/codeAgent/tools/AkanCli.ts
|
|
695
|
-
import { existsSync as
|
|
696
|
-
import
|
|
553
|
+
import { existsSync as existsSync6 } from "fs";
|
|
554
|
+
import path6 from "path";
|
|
697
555
|
class AkanCli2 {
|
|
698
556
|
#cwd;
|
|
699
557
|
#entry;
|
|
@@ -720,10 +578,10 @@ class AkanCli2 {
|
|
|
720
578
|
}
|
|
721
579
|
static #resolveEntry() {
|
|
722
580
|
const candidates = [
|
|
723
|
-
|
|
724
|
-
|
|
581
|
+
path6.join(import.meta.dir, "index.js"),
|
|
582
|
+
path6.join(import.meta.dir, "..", "..", "..", "cli", "index.ts")
|
|
725
583
|
];
|
|
726
|
-
return candidates.find((candidate) =>
|
|
584
|
+
return candidates.find((candidate) => existsSync6(candidate)) ?? Bun.main;
|
|
727
585
|
}
|
|
728
586
|
}
|
|
729
587
|
|
|
@@ -792,7 +650,7 @@ class AkanToolPack2 {
|
|
|
792
650
|
return { name: "akan-tools", factory: async (pi) => await this.#register(pi) };
|
|
793
651
|
}
|
|
794
652
|
async names() {
|
|
795
|
-
const { ContextRunner } = await import("./context.runner-
|
|
653
|
+
const { ContextRunner } = await import("./context.runner-hwq8pwrg.js");
|
|
796
654
|
return [
|
|
797
655
|
...new ContextRunner().listMcpTools(this.#options.mode).map((tool) => tool.name),
|
|
798
656
|
AkanToolPack2.verifyToolName
|
|
@@ -800,7 +658,7 @@ class AkanToolPack2 {
|
|
|
800
658
|
}
|
|
801
659
|
static verifyToolName = "akan_verify";
|
|
802
660
|
async#register(pi) {
|
|
803
|
-
const { ContextRunner } = await import("./context.runner-
|
|
661
|
+
const { ContextRunner } = await import("./context.runner-hwq8pwrg.js");
|
|
804
662
|
const runner = new ContextRunner;
|
|
805
663
|
const guidelineNames = await AkanToolPack2.#guidelineNames();
|
|
806
664
|
for (const tool of runner.listMcpTools(this.#options.mode, { guidelineNames })) {
|
|
@@ -2064,7 +1922,7 @@ class CodeAgentEventMapper2 {
|
|
|
2064
1922
|
}
|
|
2065
1923
|
|
|
2066
1924
|
// pkgs/@akanjs/devkit/codeAgent/agent/CodeAgentGate.ts
|
|
2067
|
-
import
|
|
1925
|
+
import path7 from "path";
|
|
2068
1926
|
var writeTools = new Set(["write", "edit"]);
|
|
2069
1927
|
var commandTools = new Set(["bash"]);
|
|
2070
1928
|
|
|
@@ -2103,9 +1961,9 @@ class CodeAgentGate2 {
|
|
|
2103
1961
|
return `The command names "${hit}", which the profile's deny list covers. Ask the user for the value instead of reading the file.`;
|
|
2104
1962
|
}
|
|
2105
1963
|
#deniedReason(target) {
|
|
2106
|
-
const absolute =
|
|
2107
|
-
const relative =
|
|
2108
|
-
if (relative.startsWith("..") ||
|
|
1964
|
+
const absolute = path7.isAbsolute(target) ? target : path7.resolve(this.#profile.paths.root, target);
|
|
1965
|
+
const relative = path7.relative(this.#profile.paths.root, absolute);
|
|
1966
|
+
if (relative.startsWith("..") || path7.isAbsolute(relative))
|
|
2109
1967
|
return `Path is outside the agent root (${this.#profile.paths.root}).`;
|
|
2110
1968
|
if (this.#deny.some((glob) => glob.match(absolute) || glob.match(relative)))
|
|
2111
1969
|
return "Path is on the profile's deny list (secrets and environment files are never readable).";
|
|
@@ -2200,8 +2058,8 @@ class CodeAgentProxy {
|
|
|
2200
2058
|
}
|
|
2201
2059
|
|
|
2202
2060
|
// pkgs/@akanjs/devkit/codeAgent/agent/CodeAgentSuspended.ts
|
|
2203
|
-
import { existsSync as
|
|
2204
|
-
import
|
|
2061
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync2, readFileSync as readFileSync4, rmSync, writeFileSync } from "fs";
|
|
2062
|
+
import path8 from "path";
|
|
2205
2063
|
|
|
2206
2064
|
class CodeAgentSuspended {
|
|
2207
2065
|
#file;
|
|
@@ -2211,7 +2069,7 @@ class CodeAgentSuspended {
|
|
|
2211
2069
|
this.#state = CodeAgentSuspended.#read(file);
|
|
2212
2070
|
}
|
|
2213
2071
|
static fileOf(sessionDir, sessionId) {
|
|
2214
|
-
return sessionDir ?
|
|
2072
|
+
return sessionDir ? path8.join(sessionDir, `${sessionId}.suspended.json`) : null;
|
|
2215
2073
|
}
|
|
2216
2074
|
get question() {
|
|
2217
2075
|
return this.#state.question;
|
|
@@ -2256,12 +2114,12 @@ class CodeAgentSuspended {
|
|
|
2256
2114
|
rmSync(this.#file, { force: true });
|
|
2257
2115
|
return;
|
|
2258
2116
|
}
|
|
2259
|
-
mkdirSync2(
|
|
2117
|
+
mkdirSync2(path8.dirname(this.#file), { recursive: true });
|
|
2260
2118
|
writeFileSync(this.#file, `${JSON.stringify(this.#state)}
|
|
2261
2119
|
`);
|
|
2262
2120
|
}
|
|
2263
2121
|
static #read(file) {
|
|
2264
|
-
if (!file || !
|
|
2122
|
+
if (!file || !existsSync7(file))
|
|
2265
2123
|
return { approvals: [] };
|
|
2266
2124
|
try {
|
|
2267
2125
|
const parsed = JSON.parse(readFileSync4(file, "utf8"));
|
|
@@ -2315,7 +2173,7 @@ class CodeAgentUi2 {
|
|
|
2315
2173
|
// pkgs/@akanjs/devkit/codeAgent/agent/CodeMailbox.ts
|
|
2316
2174
|
import {
|
|
2317
2175
|
appendFileSync,
|
|
2318
|
-
existsSync as
|
|
2176
|
+
existsSync as existsSync8,
|
|
2319
2177
|
mkdirSync as mkdirSync3,
|
|
2320
2178
|
readdirSync as readdirSync3,
|
|
2321
2179
|
readFileSync as readFileSync5,
|
|
@@ -2323,7 +2181,7 @@ import {
|
|
|
2323
2181
|
statSync as statSync5,
|
|
2324
2182
|
writeFileSync as writeFileSync2
|
|
2325
2183
|
} from "fs";
|
|
2326
|
-
import
|
|
2184
|
+
import path9 from "path";
|
|
2327
2185
|
class CodeMailbox2 {
|
|
2328
2186
|
static staleMs = 20000;
|
|
2329
2187
|
static beatMs = 5000;
|
|
@@ -2342,11 +2200,11 @@ class CodeMailbox2 {
|
|
|
2342
2200
|
this.#name = name;
|
|
2343
2201
|
}
|
|
2344
2202
|
get inbox() {
|
|
2345
|
-
return
|
|
2203
|
+
return path9.join(this.#dir, "inbox", `${this.#id}.jsonl`);
|
|
2346
2204
|
}
|
|
2347
2205
|
open(cwd, onMail) {
|
|
2348
|
-
mkdirSync3(
|
|
2349
|
-
mkdirSync3(
|
|
2206
|
+
mkdirSync3(path9.join(this.#dir, "live"), { recursive: true });
|
|
2207
|
+
mkdirSync3(path9.join(this.#dir, "inbox"), { recursive: true });
|
|
2350
2208
|
this.#read = readJsonLines(this.inbox).length;
|
|
2351
2209
|
this.beat(cwd);
|
|
2352
2210
|
this.#beat = setInterval(() => this.beat(cwd), CodeMailbox2.beatMs);
|
|
@@ -2363,7 +2221,7 @@ class CodeMailbox2 {
|
|
|
2363
2221
|
this.#beat = null;
|
|
2364
2222
|
this.#poll = null;
|
|
2365
2223
|
try {
|
|
2366
|
-
rmSync2(
|
|
2224
|
+
rmSync2(path9.join(this.#dir, "live", `${this.#id}.json`), { force: true });
|
|
2367
2225
|
} catch {}
|
|
2368
2226
|
}
|
|
2369
2227
|
rename(name, cwd) {
|
|
@@ -2373,15 +2231,15 @@ class CodeMailbox2 {
|
|
|
2373
2231
|
beat(cwd) {
|
|
2374
2232
|
const peer = { id: this.#id, name: this.#name, cwd, pid: process.pid, at: Date.now() };
|
|
2375
2233
|
try {
|
|
2376
|
-
writeFileSync2(
|
|
2234
|
+
writeFileSync2(path9.join(this.#dir, "live", `${this.#id}.json`), JSON.stringify(peer));
|
|
2377
2235
|
} catch {}
|
|
2378
2236
|
}
|
|
2379
2237
|
peers() {
|
|
2380
|
-
const dir =
|
|
2381
|
-
if (!
|
|
2238
|
+
const dir = path9.join(this.#dir, "live");
|
|
2239
|
+
if (!existsSync8(dir))
|
|
2382
2240
|
return [];
|
|
2383
2241
|
const now = Date.now();
|
|
2384
|
-
return readdirSync3(dir).filter((entry) => entry.endsWith(".json")).map((entry) => CodeMailbox2.#peer(
|
|
2242
|
+
return readdirSync3(dir).filter((entry) => entry.endsWith(".json")).map((entry) => CodeMailbox2.#peer(path9.join(dir, entry))).filter((peer) => !!peer && peer.id !== this.#id && now - peer.at < CodeMailbox2.staleMs).sort((left, right) => right.at - left.at);
|
|
2385
2243
|
}
|
|
2386
2244
|
find(target) {
|
|
2387
2245
|
const needle = target.trim().toLowerCase();
|
|
@@ -2399,8 +2257,8 @@ class CodeMailbox2 {
|
|
|
2399
2257
|
throw new Error(`Too many messages: ${CodeMailbox2.sendsPerMinute} a minute is the ceiling.`);
|
|
2400
2258
|
this.#sent.push(now);
|
|
2401
2259
|
const mail = { at: now, from: this.#id, fromName: this.#name, text };
|
|
2402
|
-
mkdirSync3(
|
|
2403
|
-
appendFileSync(
|
|
2260
|
+
mkdirSync3(path9.join(this.#dir, "inbox"), { recursive: true });
|
|
2261
|
+
appendFileSync(path9.join(this.#dir, "inbox", `${to}.jsonl`), `${JSON.stringify(mail)}
|
|
2404
2262
|
`);
|
|
2405
2263
|
}
|
|
2406
2264
|
#drain() {
|
|
@@ -2424,7 +2282,7 @@ class CodeMailbox2 {
|
|
|
2424
2282
|
// pkgs/@akanjs/devkit/codeAgent/agent/CodeSessionFork.ts
|
|
2425
2283
|
import { randomBytes } from "crypto";
|
|
2426
2284
|
import { readFileSync as readFileSync6, writeFileSync as writeFileSync3 } from "fs";
|
|
2427
|
-
import
|
|
2285
|
+
import path10 from "path";
|
|
2428
2286
|
import { codeAgentSessionName } from "akanjs/common";
|
|
2429
2287
|
class CodeSessionFork2 {
|
|
2430
2288
|
static fork(dir, id, name) {
|
|
@@ -2444,7 +2302,7 @@ class CodeSessionFork2 {
|
|
|
2444
2302
|
first.id = forked;
|
|
2445
2303
|
first.timestamp = at.toISOString();
|
|
2446
2304
|
records.push(CodeSessionFork2.#named(records, name ?? CodeSessionFork2.#nameOf(records), at));
|
|
2447
|
-
const file =
|
|
2305
|
+
const file = path10.join(dir, `${at.toISOString().replace(/[:.]/g, "-")}_${forked}.jsonl`);
|
|
2448
2306
|
writeFileSync3(file, `${records.map((record) => JSON.stringify(record)).join(`
|
|
2449
2307
|
`)}
|
|
2450
2308
|
`);
|
|
@@ -2945,4 +2803,4 @@ Continue the task.`);
|
|
|
2945
2803
|
}
|
|
2946
2804
|
}
|
|
2947
2805
|
|
|
2948
|
-
export { AkanEditScope2, DevLogFeedback2,
|
|
2806
|
+
export { AkanEditScope2, DevLogFeedback2, PreviewFeedback2, TurnFeedback2, AkanCli2, AkanVerifier2, VerifyFeedback2, AkanToolPack2, MailToolPack2, McpUnauthorized2, McpClient2, McpToolPack2, SessionToolPack2, WebToolPack2, AkanCodePlugins2, AkanEnvKeys2, akanSystemPrompt2, CodeSessionIndex2, AkanCodeServices2, CodeAgentAsks2, CodeAgentEventMapper2, CodeAgentGate2, CodeAgentUi2, CodeMailbox2, CodeSessionFork2, CodeAgent2 };
|
|
@@ -4,27 +4,27 @@ import {
|
|
|
4
4
|
CloudApi,
|
|
5
5
|
CloudUpdates,
|
|
6
6
|
PipelineSecrets
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-d1c677h0.js";
|
|
8
8
|
import {
|
|
9
9
|
PkgExecutor
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-nt5c22sg.js";
|
|
11
11
|
import {
|
|
12
12
|
UpdatePackFolder,
|
|
13
13
|
NativePublicEnv,
|
|
14
14
|
NativeApp
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-tpv8j9kq.js";
|
|
16
16
|
import {
|
|
17
17
|
script
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-9jyxbbnh.js";
|
|
19
19
|
import {
|
|
20
20
|
ApplicationScript
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-t8jp2d3r.js";
|
|
22
22
|
import {
|
|
23
23
|
PackageScript
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-gftc47rk.js";
|
|
25
25
|
import {
|
|
26
26
|
CloudRunner
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-1qmfdbjf.js";
|
|
28
28
|
|
|
29
29
|
// pkgs/@akanjs/cli/cloud/cloud.script.ts
|
|
30
30
|
import { Logger } from "akanjs/common";
|
|
@@ -157,7 +157,7 @@ class SubagentPool2 {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
async#run(id, kind, prompt, signal) {
|
|
160
|
-
const { CodeAgent } = await import("./CodeAgent-
|
|
160
|
+
const { CodeAgent } = await import("./CodeAgent-rsebcq9c.js");
|
|
161
161
|
const budget = this.#options.parent.tools.subagent;
|
|
162
162
|
const child = SubagentPool2.childOf(this.#options.parent, kind);
|
|
163
163
|
const model = this.#options.model?.();
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
AppExecutor,
|
|
4
4
|
LibExecutor
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-nt5c22sg.js";
|
|
6
6
|
import {
|
|
7
7
|
camelToKebabCase
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-9jyxbbnh.js";
|
|
9
9
|
|
|
10
10
|
// pkgs/@akanjs/devkit/workflow/artifacts.ts
|
|
11
11
|
import { capitalize as capitalize2 } from "akanjs/common";
|
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
CsrDevPaths,
|
|
20
20
|
PagesEntrySourceGenerator,
|
|
21
21
|
PagesBundleBuilder
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-nrstta07.js";
|
|
23
23
|
import {
|
|
24
24
|
AsyncDefaultExportDetector,
|
|
25
25
|
resolveSsrPageEntriesForApp
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-nt5c22sg.js";
|
|
27
27
|
|
|
28
28
|
// pkgs/@akanjs/devkit/frontendBuild/autoImportSync.ts
|
|
29
29
|
import { readdir, readFile, stat } from "fs/promises";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
jsonText
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-acta9x3j.js";
|
|
5
5
|
import {
|
|
6
6
|
akanMcpInstallTargets
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-mgdzy0cz.js";
|
|
8
8
|
import {
|
|
9
9
|
script
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-9jyxbbnh.js";
|
|
11
11
|
import {
|
|
12
12
|
ContextRunner2
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-tnhh146g.js";
|
|
14
14
|
|
|
15
15
|
// pkgs/@akanjs/cli/context/context.script.ts
|
|
16
16
|
import { Logger } from "akanjs/common";
|