@akanjs/cli 3.1.1-rc.15 → 3.1.1-rc.17
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-gtwn7tmb.js → CodeAgent-fbcq8vks.js} +2 -2
- package/{CodeTui-v941fqdh.js → CodeTui-0626gxqd.js} +1 -1
- package/TunnelShare-2p24xxza.js +14 -0
- package/agent.command-hpza0pg9.js +46 -0
- package/akanCode.js +5 -3
- package/{application.command-j1reb9p1.js → application.command-3a7q1hs2.js} +11 -10
- package/{applicationBuildRunner-w20x63mz.js → applicationBuildRunner-s7yt71j4.js} +6 -5
- package/buildBatch.proc.js +6 -6
- package/{cloud.command-zd2mfkm0.js → cloud.command-4vg0pcea.js} +15 -14
- package/cloud.script-nkmeyhet.js +25 -0
- package/{code.command-dyet4xn6.js → code.command-fbntb67p.js} +6 -6
- package/commandManifest.json +1 -1
- package/{context.command-79gxczm4.js → context.command-31rm54v0.js} +18 -17
- package/context.runner-w01a32ph.js +26 -0
- package/{guideline.command-xwkskvky.js → guideline.command-cv3by2ng.js} +3 -3
- package/guidelines/conventions/core.md +104 -0
- package/guidelines/conventions/rules/app.md +83 -0
- package/guidelines/conventions/rules/auth.md +45 -0
- package/guidelines/conventions/rules/config.md +56 -0
- package/guidelines/conventions/rules/constant.md +24 -0
- package/guidelines/conventions/rules/gates.md +31 -0
- package/guidelines/conventions/rules/layer.md +25 -0
- package/guidelines/conventions/rules/migration.md +27 -0
- package/guidelines/conventions/rules/module.md +90 -0
- package/guidelines/conventions/rules/page.md +56 -0
- package/guidelines/conventions/rules/sensitive.md +16 -0
- package/guidelines/conventions/rules/server.md +86 -0
- package/guidelines/conventions/rules/ssr.md +47 -0
- package/guidelines/conventions/rules/style.md +43 -0
- package/guidelines/conventions/rules/test.md +34 -0
- package/guidelines/conventions/rules/ts.md +95 -0
- package/guidelines/conventions/rules/tsx.md +75 -0
- package/guidelines/mcpRule/mcpRule.instruction.md +1 -1
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +3 -3
- package/incrementalBuilder.proc.js +6 -6
- package/{index-pqdz7rat.js → index-05nxx4m5.js} +952 -47
- package/{index-41d3zx66.js → index-0ht91675.js} +37 -59
- package/{index-cz9g85xh.js → index-0zwznvv1.js} +1 -1
- package/{index-7ktk2hnz.js → index-0zyatd10.js} +2 -2
- package/{index-8jb5ep2e.js → index-12kzwak1.js} +3 -3
- package/{index-yknrmkmt.js → index-1dhf8ymv.js} +2 -2
- package/{index-qmeh0s05.js → index-3gccwenr.js} +2 -2
- package/{index-hdzjaq7s.js → index-3txrjt6n.js} +2 -2
- package/{index-tzzs52h0.js → index-57q1ayd2.js} +18 -1240
- package/index-5kh9scvs.js +514 -0
- package/index-5n5hds19.js +1246 -0
- package/{index-pc9ps0hx.js → index-6269mf2s.js} +10 -9
- package/{index-1e2955yd.js → index-64g9fsjy.js} +43 -12
- package/index-7zeb5r1p.js +653 -0
- package/{index-kr62ph5a.js → index-8s8b4eba.js} +45 -4
- package/{index-wvvwdzfw.js → index-922k2zwq.js} +3 -3
- package/{index-brpk7gd8.js → index-9ndw5d8j.js} +7 -7
- package/{index-xeh7m2j5.js → index-et6ce601.js} +1 -1
- package/{index-jtydvvq7.js → index-f5adsa58.js} +4 -4
- package/index-fbewhg4g.js +590 -0
- package/{index-7abjzny1.js → index-hm7x0c11.js} +33 -37
- package/{index-rshwdv9w.js → index-hvv5rnaq.js} +2 -2
- package/index-jje9qzyq.js +27 -0
- package/index-js1gj6f6.js +410 -0
- package/{index-2qzzp0c9.js → index-kjrvwzav.js} +3 -3
- package/index-m5n3ka0p.js +18 -0
- package/index-m6r88hhr.js +3582 -0
- package/{index-4rwfh2de.js → index-mt0wa941.js} +4 -4
- package/{index-553xyb55.js → index-mwj9q2ya.js} +1 -1
- package/{index-5nd1wtkv.js → index-p6x5b7hr.js} +1 -1
- package/index-r2wedvqn.js +138 -0
- package/{index-ygy8c12j.js → index-rvynj5gz.js} +1 -1
- package/{index-nmy1rana.js → index-tdv66eah.js} +4 -4
- package/{index-8rvwgd1r.js → index-w134p86k.js} +1 -1
- package/{index-jjd97ya6.js → index-wfczhj1z.js} +14 -36
- package/{index-dy0jx9ay.js → index-wwe9rsrx.js} +14 -0
- package/{index-kbbyzs6j.js → index-x5ecanqh.js} +2 -2
- package/{index-ch1sv7ke.js → index-zre4m2ce.js} +9 -21
- package/index.js +23 -22
- package/{library.command-td8t85kb.js → library.command-sh70fyvy.js} +3 -3
- package/{localRegistry.command-jx9zkmxf.js → localRegistry.command-2nbyy84d.js} +17 -14
- package/{module.command-j70mqgpp.js → module.command-n0bmtzwy.js} +5 -5
- package/{package.command-1b1v6k5v.js → package.command-7h9r51bz.js} +3 -3
- package/package.json +2 -2
- package/{page.command-m31w2tsz.js → page.command-vjtpfbb1.js} +3 -3
- package/{pipeline.command-q7b8wy55.js → pipeline.command-c93se3ar.js} +2 -2
- package/{primitive.command-4zrbhkb9.js → primitive.command-a3075qp2.js} +6 -6
- package/{projectTypecheck-synx6qff.js → projectTypecheck-sf9xwaga.js} +1 -1
- package/{prompter-76k56b37.js → prompter-hgcta8pb.js} +1 -1
- package/quality.command-dw1y9hmy.js +76 -0
- package/{repair.command-98n6zxg7.js → repair.command-tg57d8yt.js} +5 -5
- package/{scalar.command-rak5pjk3.js → scalar.command-cwzge353.js} +4 -4
- package/skills/akan-agent/SKILL.md +36 -0
- package/skills/akan-debug/SKILL.md +3 -3
- package/skills/akan-deps/SKILL.md +1 -2
- package/skills/akan-mcp/SKILL.md +40 -0
- package/skills/akan-page/SKILL.md +44 -0
- package/skills/akan-query/SKILL.md +38 -0
- package/skills/akan-runtime/SKILL.md +40 -0
- package/skills/akan-scaffold/SKILL.md +16 -6
- package/skills/akan-transport/SKILL.md +40 -0
- package/skills/akan-validate/SKILL.md +13 -11
- package/{subspace.command-ej0rk116.js → subspace.command-3h03c7kc.js} +8 -8
- package/templates/workspaceRoot/.gitignore.template +3 -0
- package/templates/workspaceRoot/AGENTS.md.template +4 -10
- package/{tunnel.command-kdx3amrc.js → tunnel.command-czaz6ys4.js} +7 -7
- package/{typeChecker-px49mezc.js → typeChecker-j2jdnqsr.js} +1 -1
- package/typecheck.proc.js +6 -1
- package/verify.command-nzwhtz71.js +91 -0
- package/{workflow.command-gffk9nj9.js → workflow.command-srhky88x.js} +47 -13
- package/workspace.command-9stchcd2.js +262 -0
- package/TunnelShare-26ty9skr.js +0 -14
- package/agent.command-h82gepwn.js +0 -25
- package/cloud.script-vdj8ymch.js +0 -24
- package/context.runner-ejag7mhr.js +0 -25
- package/guidelines/conventions/conventions.instruction.md +0 -617
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +0 -291
- package/index-6pzt55w3.js +0 -279
- package/index-y5m4j2w6.js +0 -856
- package/index-zzvvc845.js +0 -74
- package/quality.command-cy0pgqjz.js +0 -1478
- package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +0 -69
- package/templates/workspaceRoot/docs/GENERATED.md.template +0 -55
- package/workspace.command-097hv6n1.js +0 -521
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
resolveSsrPageEntriesForApp
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-64g9fsjy.js";
|
|
5
5
|
import {
|
|
6
6
|
computeRouteSeedIndex,
|
|
7
7
|
saveRouteSeedIndex,
|
|
@@ -9,17 +9,17 @@ import {
|
|
|
9
9
|
ClientEntriesBundler,
|
|
10
10
|
VENDOR_SPECIFIERS,
|
|
11
11
|
RouteClientBuilder
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-12kzwak1.js";
|
|
13
13
|
import {
|
|
14
14
|
SOURCE_EXTS
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-p6x5b7hr.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-0zwznvv1.js";
|
|
23
23
|
import {
|
|
24
24
|
CssBlockParser
|
|
25
25
|
} from "./index-62md4dwy.js";
|
|
@@ -836,4 +836,4 @@ class HmrWatcher {
|
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
|
|
839
|
-
export {
|
|
839
|
+
export { 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, ApplicationBuildReporter };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
getDirname2
|
|
4
|
+
} from "./index-52w0fvh8.js";
|
|
5
|
+
|
|
6
|
+
// pkgs/@akanjs/devkit/conventionSet.ts
|
|
7
|
+
import fsPromise from "fs/promises";
|
|
8
|
+
import path from "path";
|
|
9
|
+
|
|
10
|
+
class ConventionSet {
|
|
11
|
+
core;
|
|
12
|
+
rules;
|
|
13
|
+
constructor(core, rules) {
|
|
14
|
+
this.core = core;
|
|
15
|
+
this.rules = rules;
|
|
16
|
+
}
|
|
17
|
+
static async load(dir) {
|
|
18
|
+
const core = await fsPromise.readFile(path.join(dir, "core.md"), "utf-8");
|
|
19
|
+
const files = (await fsPromise.readdir(path.join(dir, "rules"))).filter((file) => file.endsWith(".md")).sort();
|
|
20
|
+
const rules = await Promise.all(files.map(async (file) => ConventionSet.parseRule(file.slice(0, -3), await fsPromise.readFile(path.join(dir, "rules", file), "utf-8"))));
|
|
21
|
+
return new ConventionSet(core.trim(), rules);
|
|
22
|
+
}
|
|
23
|
+
static parseRule(name, text) {
|
|
24
|
+
const match = /^---\n([\s\S]*?)\n---\n/.exec(text);
|
|
25
|
+
if (!match)
|
|
26
|
+
throw new Error(`Convention rule ${name} has no frontmatter`);
|
|
27
|
+
const front = match[1] ?? "";
|
|
28
|
+
const described = /^description:\s*(.+)$/m.exec(front);
|
|
29
|
+
const description = described?.[1]?.trim() ?? "";
|
|
30
|
+
const paths = [...front.matchAll(/^\s+-\s+"([^"]+)"$/gm)].map((entry) => entry[1] ?? "");
|
|
31
|
+
if (!description || paths.length === 0)
|
|
32
|
+
throw new Error(`Convention rule ${name} needs a description and paths`);
|
|
33
|
+
return { name, description, paths, body: text.slice(match[0].length).trim() };
|
|
34
|
+
}
|
|
35
|
+
static expand(glob) {
|
|
36
|
+
const open = glob.indexOf("{");
|
|
37
|
+
if (open === -1)
|
|
38
|
+
return [glob];
|
|
39
|
+
const close = glob.indexOf("}", open);
|
|
40
|
+
if (close === -1)
|
|
41
|
+
return [glob];
|
|
42
|
+
const head = glob.slice(0, open);
|
|
43
|
+
const tail = glob.slice(close + 1);
|
|
44
|
+
return glob.slice(open + 1, close).split(",").flatMap((choice) => ConventionSet.expand(`${head}${choice}${tail}`));
|
|
45
|
+
}
|
|
46
|
+
static demote(markdown) {
|
|
47
|
+
let fenced = false;
|
|
48
|
+
return markdown.split(`
|
|
49
|
+
`).map((line) => {
|
|
50
|
+
if (line.startsWith("```"))
|
|
51
|
+
fenced = !fenced;
|
|
52
|
+
return !fenced && /^#{1,5} /.test(line) ? `#${line}` : line;
|
|
53
|
+
}).join(`
|
|
54
|
+
`);
|
|
55
|
+
}
|
|
56
|
+
get instruction() {
|
|
57
|
+
return `${[this.core, ...this.rules.map((rule) => ConventionSet.demote(rule.body))].join(`
|
|
58
|
+
|
|
59
|
+
`)}
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// pkgs/@akanjs/devkit/prompter.ts
|
|
65
|
+
import fsPromise2 from "fs/promises";
|
|
66
|
+
import { input, select } from "@inquirer/prompts";
|
|
67
|
+
class Prompter2 {
|
|
68
|
+
static async#getGuidelineRoot() {
|
|
69
|
+
const dirname = getDirname2(import.meta.url);
|
|
70
|
+
const candidates = [`${dirname}/guidelines`, `${dirname}/../cli/guidelines`];
|
|
71
|
+
for (const candidate of candidates) {
|
|
72
|
+
try {
|
|
73
|
+
await fsPromise2.access(candidate);
|
|
74
|
+
return candidate;
|
|
75
|
+
} catch {}
|
|
76
|
+
}
|
|
77
|
+
return candidates[0];
|
|
78
|
+
}
|
|
79
|
+
static async selectGuideline() {
|
|
80
|
+
const guideNames = await Prompter2.listGuidelines();
|
|
81
|
+
return await select({
|
|
82
|
+
message: "Select a guideline",
|
|
83
|
+
choices: guideNames.map((name) => ({ name, value: name }))
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
static async listGuidelines() {
|
|
87
|
+
const guidelineRoot = await Prompter2.#getGuidelineRoot();
|
|
88
|
+
return (await fsPromise2.readdir(guidelineRoot)).filter((name) => !name.startsWith("_")).sort();
|
|
89
|
+
}
|
|
90
|
+
static async getInstruction(guideName) {
|
|
91
|
+
const guideNames = await Prompter2.listGuidelines();
|
|
92
|
+
if (!guideNames.includes(guideName))
|
|
93
|
+
throw new Error(`Unknown guideline "${guideName}". Available: ${guideNames.join(", ")}`);
|
|
94
|
+
const guidelineRoot = await Prompter2.#getGuidelineRoot();
|
|
95
|
+
const composed = `${guidelineRoot}/${guideName}/core.md`;
|
|
96
|
+
if (await Bun.file(composed).exists())
|
|
97
|
+
return (await ConventionSet.load(`${guidelineRoot}/${guideName}`)).instruction;
|
|
98
|
+
return await fsPromise2.readFile(`${guidelineRoot}/${guideName}/${guideName}.instruction.md`, "utf-8");
|
|
99
|
+
}
|
|
100
|
+
static async getConventionSet() {
|
|
101
|
+
return await ConventionSet.load(`${await Prompter2.#getGuidelineRoot()}/conventions`);
|
|
102
|
+
}
|
|
103
|
+
static async getUpdateRequest(guideName) {
|
|
104
|
+
return await input({
|
|
105
|
+
message: `What do you want to update in ${guideName}?`
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
async makeTsFileUpdatePrompt({ context, request }) {
|
|
109
|
+
return `You are a senior developer writing TypeScript-based programs using Akan.js, an in-house framework. Here's an overview of the Akan.js framework:
|
|
110
|
+
${await this.getDocumentation("framework")}
|
|
111
|
+
Please understand the following background information, write code that meets the requirements, verify that it satisfies the validation conditions, and return the result.
|
|
112
|
+
|
|
113
|
+
# Code Style
|
|
114
|
+
- Use double quotes for all string literals in TypeScript/TSX code. Do not use single quotes.
|
|
115
|
+
|
|
116
|
+
# Background Information
|
|
117
|
+
\`\`\`markdown
|
|
118
|
+
${context}
|
|
119
|
+
\`\`\`
|
|
120
|
+
|
|
121
|
+
# Requirements
|
|
122
|
+
\`\`\`markdown
|
|
123
|
+
${request}
|
|
124
|
+
\`\`\`
|
|
125
|
+
`;
|
|
126
|
+
}
|
|
127
|
+
async getDocumentation(guideName) {
|
|
128
|
+
const guidelineRoot = await Prompter2.#getGuidelineRoot();
|
|
129
|
+
const filePath = `${guidelineRoot}/${guideName}/${guideName}.instruction.md`;
|
|
130
|
+
const document = await fsPromise2.readFile(filePath, "utf-8");
|
|
131
|
+
return `\`\`\`markdown
|
|
132
|
+
${document}
|
|
133
|
+
\`\`\`
|
|
134
|
+
`;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export { ConventionSet, Prompter2 };
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-3gccwenr.js";
|
|
6
6
|
import {
|
|
7
7
|
ModuleExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-64g9fsjy.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-05nxx4m5.js";
|
|
17
17
|
import {
|
|
18
18
|
PageScript
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-rvynj5gz.js";
|
|
20
20
|
import {
|
|
21
21
|
pluralizeName
|
|
22
22
|
} from "./index-nz8prx9g.js";
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ConfigLock
|
|
4
4
|
} from "./index-bqbf654f.js";
|
|
5
|
+
import {
|
|
6
|
+
akanCodePaths2
|
|
7
|
+
} from "./index-jje9qzyq.js";
|
|
5
8
|
|
|
6
9
|
// pkgs/@akanjs/devkit/codeAgent/agent/AkanCodeCompaction.ts
|
|
7
10
|
class AkanCodeCompaction2 {
|
|
@@ -41,31 +44,6 @@ class AkanCodeCompaction2 {
|
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
|
|
44
|
-
// pkgs/@akanjs/devkit/codeAgent/agent/akanCodePaths.ts
|
|
45
|
-
import { existsSync } from "fs";
|
|
46
|
-
import { homedir } from "os";
|
|
47
|
-
import path from "path";
|
|
48
|
-
var builtinSkillsDir = () => {
|
|
49
|
-
const candidates = [path.join(import.meta.dir, "skills"), path.join(import.meta.dir, "..", "skills")];
|
|
50
|
-
return candidates.find((candidate) => existsSync(candidate));
|
|
51
|
-
};
|
|
52
|
-
var globalDir = () => process.env.AKAN_CODE_HOME ?? path.join(homedir(), ".akan", "code");
|
|
53
|
-
var akanCodePaths2 = {
|
|
54
|
-
workspaceDir: (workspaceRoot) => path.join(workspaceRoot, ".akan", "code"),
|
|
55
|
-
sessionsDir: (workspaceRoot) => path.join(workspaceRoot, ".akan", "code", "sessions"),
|
|
56
|
-
extensionsDir: (workspaceRoot) => path.join(workspaceRoot, ".akan", "code", "extensions"),
|
|
57
|
-
skillsDir: (workspaceRoot) => path.join(workspaceRoot, ".akan", "code", "skills"),
|
|
58
|
-
mailDir: (workspaceRoot) => path.join(workspaceRoot, ".akan", "code", "mail"),
|
|
59
|
-
builtinSkillsDir,
|
|
60
|
-
mcpFile: (workspaceRoot) => path.join(workspaceRoot, ".akan", "code", "mcp.json"),
|
|
61
|
-
globalMcpFile: () => path.join(globalDir(), "mcp.json"),
|
|
62
|
-
globalSkillsDir: () => path.join(globalDir(), "skills"),
|
|
63
|
-
globalDir,
|
|
64
|
-
authFile: () => path.join(globalDir(), "auth.json"),
|
|
65
|
-
mcpAuthFile: () => path.join(globalDir(), "mcpAuth.json"),
|
|
66
|
-
modelsFile: () => path.join(globalDir(), "models.json")
|
|
67
|
-
};
|
|
68
|
-
|
|
69
47
|
// pkgs/@akanjs/devkit/codeAgent/agent/SubagentPool.ts
|
|
70
48
|
import { codeAgentReadOnlyBuiltins } from "akanjs/common";
|
|
71
49
|
import { Type } from "typebox";
|
|
@@ -179,7 +157,7 @@ class SubagentPool2 {
|
|
|
179
157
|
}
|
|
180
158
|
}
|
|
181
159
|
async#run(id, kind, prompt, signal) {
|
|
182
|
-
const { CodeAgent } = await import("./CodeAgent-
|
|
160
|
+
const { CodeAgent } = await import("./CodeAgent-fbcq8vks.js");
|
|
183
161
|
const budget = this.#options.parent.tools.subagent;
|
|
184
162
|
const child = SubagentPool2.childOf(this.#options.parent, kind);
|
|
185
163
|
const model = this.#options.model?.();
|
|
@@ -232,8 +210,8 @@ class SubagentPool2 {
|
|
|
232
210
|
}
|
|
233
211
|
|
|
234
212
|
// pkgs/@akanjs/devkit/codeAgent/tools/McpServerConfig.ts
|
|
235
|
-
import { existsSync
|
|
236
|
-
import
|
|
213
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
214
|
+
import path from "path";
|
|
237
215
|
class McpServerConfig {
|
|
238
216
|
static file(workspaceRoot, scope = "workspace") {
|
|
239
217
|
return scope === "global" ? akanCodePaths2.globalMcpFile() : akanCodePaths2.mcpFile(workspaceRoot);
|
|
@@ -261,7 +239,7 @@ class McpServerConfig {
|
|
|
261
239
|
const entry = /^https?:\/\//.test(head) ? { url: head } : { command: head, args: rest };
|
|
262
240
|
const { file, key, map } = McpServerConfig.#parse(workspaceRoot, scope);
|
|
263
241
|
const next = { ...map, [name]: entry };
|
|
264
|
-
mkdirSync(
|
|
242
|
+
mkdirSync(path.dirname(file), { recursive: true });
|
|
265
243
|
writeFileSync(file, `${JSON.stringify({ [key]: next }, null, 2)}
|
|
266
244
|
`);
|
|
267
245
|
return McpServerConfig.#refOf(name, entry);
|
|
@@ -297,7 +275,7 @@ class McpServerConfig {
|
|
|
297
275
|
}
|
|
298
276
|
static problem(workspaceRoot) {
|
|
299
277
|
for (const { file } of McpServerConfig.files(workspaceRoot)) {
|
|
300
|
-
if (!
|
|
278
|
+
if (!existsSync(file))
|
|
301
279
|
continue;
|
|
302
280
|
try {
|
|
303
281
|
JSON.parse(readFileSync(file, "utf8"));
|
|
@@ -310,7 +288,7 @@ class McpServerConfig {
|
|
|
310
288
|
static #parse(workspaceRoot, scope) {
|
|
311
289
|
const file = McpServerConfig.file(workspaceRoot, scope);
|
|
312
290
|
const empty = { file, key: "mcpServers", map: {} };
|
|
313
|
-
if (!
|
|
291
|
+
if (!existsSync(file))
|
|
314
292
|
return empty;
|
|
315
293
|
try {
|
|
316
294
|
const parsed = JSON.parse(readFileSync(file, "utf8"));
|
|
@@ -548,8 +526,8 @@ class McpOAuthLoopback {
|
|
|
548
526
|
}
|
|
549
527
|
|
|
550
528
|
// pkgs/@akanjs/devkit/codeAgent/tools/McpTokenStore.ts
|
|
551
|
-
import { chmodSync, existsSync as
|
|
552
|
-
import
|
|
529
|
+
import { chmodSync, existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync2, renameSync, writeFileSync as writeFileSync2 } from "fs";
|
|
530
|
+
import path2 from "path";
|
|
553
531
|
class McpTokenStore {
|
|
554
532
|
static file() {
|
|
555
533
|
return akanCodePaths2.mcpAuthFile();
|
|
@@ -580,7 +558,7 @@ class McpTokenStore {
|
|
|
580
558
|
static skewMs = 60000;
|
|
581
559
|
static #all() {
|
|
582
560
|
const file = McpTokenStore.file();
|
|
583
|
-
if (!
|
|
561
|
+
if (!existsSync2(file))
|
|
584
562
|
return {};
|
|
585
563
|
try {
|
|
586
564
|
const parsed = JSON.parse(readFileSync2(file, "utf8"));
|
|
@@ -591,7 +569,7 @@ class McpTokenStore {
|
|
|
591
569
|
}
|
|
592
570
|
static #save(servers) {
|
|
593
571
|
const file = McpTokenStore.file();
|
|
594
|
-
mkdirSync2(
|
|
572
|
+
mkdirSync2(path2.dirname(file), { recursive: true, mode: 448 });
|
|
595
573
|
const temp = `${file}.${process.pid}.tmp`;
|
|
596
574
|
writeFileSync2(temp, `${JSON.stringify({ servers }, null, 2)}
|
|
597
575
|
`, { mode: 384 });
|
|
@@ -737,4 +715,4 @@ ${stored.refreshToken}`;
|
|
|
737
715
|
}
|
|
738
716
|
}
|
|
739
717
|
|
|
740
|
-
export { SubagentPool2,
|
|
718
|
+
export { SubagentPool2, McpServerConfig, McpTokenStore, McpSignIn, AkanCodeCompaction2 };
|
|
@@ -166,6 +166,20 @@ ${summary.join(", ")} found${output.join(`
|
|
|
166
166
|
throw new Error(TypeChecker2.formatDiagnosticMessages(parsedConfig.errors));
|
|
167
167
|
return parsedConfig;
|
|
168
168
|
}
|
|
169
|
+
static toRecords(diagnostics, root) {
|
|
170
|
+
return diagnostics.filter((diagnostic) => diagnostic.category === ts.DiagnosticCategory.Error || diagnostic.category === ts.DiagnosticCategory.Warning).map((diagnostic) => {
|
|
171
|
+
const position = diagnostic.file && diagnostic.start !== undefined ? diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : null;
|
|
172
|
+
return {
|
|
173
|
+
file: diagnostic.file ? path.relative(root, diagnostic.file.fileName).split(path.sep).join("/") : null,
|
|
174
|
+
line: position ? position.line + 1 : 0,
|
|
175
|
+
col: position ? position.character + 1 : 0,
|
|
176
|
+
code: `TS${diagnostic.code}`,
|
|
177
|
+
severity: diagnostic.category === ts.DiagnosticCategory.Error ? "error" : "warning",
|
|
178
|
+
message: ts.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
179
|
+
`)
|
|
180
|
+
};
|
|
181
|
+
});
|
|
182
|
+
}
|
|
169
183
|
static formatDiagnosticMessages(diagnostics) {
|
|
170
184
|
return ts.formatDiagnosticsWithColorAndContext(diagnostics, {
|
|
171
185
|
getCanonicalFileName: (fileName) => fileName,
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-3gccwenr.js";
|
|
6
6
|
import {
|
|
7
7
|
generatedFilesForSync,
|
|
8
8
|
createPassedPrimitiveReport,
|
|
9
9
|
scalarChangedFiles
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-05nxx4m5.js";
|
|
11
11
|
import {
|
|
12
12
|
pluralizeName
|
|
13
13
|
} from "./index-nz8prx9g.js";
|
|
@@ -6,44 +6,32 @@ import {
|
|
|
6
6
|
CloudApi,
|
|
7
7
|
CloudUpdates,
|
|
8
8
|
PipelineSecrets
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-0zyatd10.js";
|
|
10
10
|
import {
|
|
11
11
|
resolveMobileTargets
|
|
12
12
|
} from "./index-m9jj544v.js";
|
|
13
13
|
import {
|
|
14
14
|
WorkspaceExecutor,
|
|
15
15
|
AppExecutor
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-64g9fsjy.js";
|
|
17
17
|
import {
|
|
18
18
|
NativeApp
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-kjrvwzav.js";
|
|
20
20
|
import {
|
|
21
21
|
runner,
|
|
22
22
|
assertPromptable
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-3gccwenr.js";
|
|
24
24
|
import {
|
|
25
25
|
SubspaceConfig
|
|
26
26
|
} from "./index-4pf8g7ff.js";
|
|
27
|
+
import {
|
|
28
|
+
getNpmRegistryUrl,
|
|
29
|
+
getLatestPackageVersion
|
|
30
|
+
} from "./index-m5n3ka0p.js";
|
|
27
31
|
import {
|
|
28
32
|
openBrowser
|
|
29
33
|
} from "./index-9dp031by.js";
|
|
30
34
|
|
|
31
|
-
// pkgs/@akanjs/cli/npmRegistry.ts
|
|
32
|
-
var defaultNpmRegistry = "https://registry.npmjs.org";
|
|
33
|
-
var getNpmRegistryUrl = (registryUrl = process.env.AKAN_NPM_REGISTRY ?? defaultNpmRegistry) => registryUrl.replace(/\/+$/, "");
|
|
34
|
-
async function getLatestPackageVersion(packageName, tag = "latest", registryUrl) {
|
|
35
|
-
const registry = getNpmRegistryUrl(registryUrl);
|
|
36
|
-
const url = `${registry}/${encodeURIComponent(packageName).replace(/^%40/, "@")}`;
|
|
37
|
-
const res = await fetch(url);
|
|
38
|
-
if (!res.ok)
|
|
39
|
-
throw new Error(`Failed to fetch ${packageName} metadata from ${registry}`);
|
|
40
|
-
const metadata = await res.json();
|
|
41
|
-
const version = metadata["dist-tags"]?.[tag];
|
|
42
|
-
if (!version)
|
|
43
|
-
throw new Error(`No npm dist-tag "${tag}" found for ${packageName}`);
|
|
44
|
-
return version;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
35
|
// pkgs/@akanjs/cli/cloud/cloud.runner.ts
|
|
48
36
|
import path7 from "path";
|
|
49
37
|
|
|
@@ -1327,4 +1315,4 @@ ${run.format(results)}
|
|
|
1327
1315
|
}
|
|
1328
1316
|
}
|
|
1329
1317
|
|
|
1330
|
-
export {
|
|
1318
|
+
export { PlatformTestRun, CloudRunner };
|
package/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
getTargetMetas,
|
|
5
5
|
getTargetCommandNames,
|
|
6
6
|
runCommands
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-3gccwenr.js";
|
|
8
8
|
import"./index-52w0fvh8.js";
|
|
9
|
-
import"./index-
|
|
9
|
+
import"./index-64g9fsjy.js";
|
|
10
10
|
|
|
11
11
|
// pkgs/@akanjs/cli/bunVersionGuard.ts
|
|
12
12
|
class BunVersionGuard {
|
|
@@ -22,26 +22,27 @@ import path from "path";
|
|
|
22
22
|
|
|
23
23
|
// pkgs/@akanjs/cli/commandModules.ts
|
|
24
24
|
var commandModules = {
|
|
25
|
-
workspace: async () => (await import("./workspace.command-
|
|
26
|
-
agent: async () => (await import("./agent.command-
|
|
27
|
-
code: async () => (await import("./code.command-
|
|
28
|
-
application: async () => (await import("./application.command-
|
|
29
|
-
library: async () => (await import("./library.command-
|
|
30
|
-
localRegistry: async () => (await import("./localRegistry.command-
|
|
31
|
-
package: async () => (await import("./package.command-
|
|
32
|
-
module: async () => (await import("./module.command-
|
|
33
|
-
page: async () => (await import("./page.command-
|
|
34
|
-
context: async () => (await import("./context.command-
|
|
35
|
-
cloud: async () => (await import("./cloud.command-
|
|
36
|
-
subspace: async () => (await import("./subspace.command-
|
|
37
|
-
guideline: async () => (await import("./guideline.command-
|
|
38
|
-
scalar: async () => (await import("./scalar.command-
|
|
39
|
-
primitive: async () => (await import("./primitive.command-
|
|
40
|
-
quality: async () => (await import("./quality.command-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
25
|
+
workspace: async () => (await import("./workspace.command-9stchcd2.js")).WorkspaceCommand,
|
|
26
|
+
agent: async () => (await import("./agent.command-hpza0pg9.js")).AgentCommand,
|
|
27
|
+
code: async () => (await import("./code.command-fbntb67p.js")).CodeCommand,
|
|
28
|
+
application: async () => (await import("./application.command-3a7q1hs2.js")).ApplicationCommand,
|
|
29
|
+
library: async () => (await import("./library.command-sh70fyvy.js")).LibraryCommand,
|
|
30
|
+
localRegistry: async () => (await import("./localRegistry.command-2nbyy84d.js")).LocalRegistryCommand,
|
|
31
|
+
package: async () => (await import("./package.command-7h9r51bz.js")).PackageCommand,
|
|
32
|
+
module: async () => (await import("./module.command-n0bmtzwy.js")).ModuleCommand,
|
|
33
|
+
page: async () => (await import("./page.command-vjtpfbb1.js")).PageCommand,
|
|
34
|
+
context: async () => (await import("./context.command-31rm54v0.js")).ContextCommand,
|
|
35
|
+
cloud: async () => (await import("./cloud.command-4vg0pcea.js")).CloudCommand,
|
|
36
|
+
subspace: async () => (await import("./subspace.command-3h03c7kc.js")).SubspaceCommand,
|
|
37
|
+
guideline: async () => (await import("./guideline.command-cv3by2ng.js")).GuidelineCommand,
|
|
38
|
+
scalar: async () => (await import("./scalar.command-cwzge353.js")).ScalarCommand,
|
|
39
|
+
primitive: async () => (await import("./primitive.command-a3075qp2.js")).PrimitiveCommand,
|
|
40
|
+
quality: async () => (await import("./quality.command-dw1y9hmy.js")).QualityCommand,
|
|
41
|
+
verify: async () => (await import("./verify.command-nzwhtz71.js")).VerifyCommand,
|
|
42
|
+
repair: async () => (await import("./repair.command-tg57d8yt.js")).RepairCommand,
|
|
43
|
+
workflow: async () => (await import("./workflow.command-srhky88x.js")).WorkflowCommand,
|
|
44
|
+
pipeline: async () => (await import("./pipeline.command-c93se3ar.js")).PipelineCommand,
|
|
45
|
+
tunnel: async () => (await import("./tunnel.command-czaz6ys4.js")).TunnelCommand
|
|
45
46
|
};
|
|
46
47
|
var commandModuleIds = Object.keys(commandModules);
|
|
47
48
|
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
Lib,
|
|
4
4
|
Workspace,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-3gccwenr.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-64g9fsjy.js";
|
|
9
9
|
import {
|
|
10
10
|
LibraryScript
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-hvv5rnaq.js";
|
|
12
12
|
|
|
13
13
|
// pkgs/@akanjs/cli/library/library.command.ts
|
|
14
14
|
class LibraryCommand extends command("library", [LibraryScript], ({ public: target }) => ({
|
|
@@ -4,32 +4,35 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-3gccwenr.js";
|
|
8
8
|
import"./index-52w0fvh8.js";
|
|
9
9
|
import {
|
|
10
10
|
PkgExecutor
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
11
|
+
} from "./index-64g9fsjy.js";
|
|
12
|
+
import"./index-p6x5b7hr.js";
|
|
13
|
+
import"./index-kjrvwzav.js";
|
|
14
|
+
import"./index-w134p86k.js";
|
|
15
15
|
import"./index-m9jj544v.js";
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
16
|
+
import"./index-1dhf8ymv.js";
|
|
17
|
+
import"./index-0zwznvv1.js";
|
|
18
|
+
import"./index-hvv5rnaq.js";
|
|
19
|
+
import"./index-57q1ayd2.js";
|
|
19
20
|
import {
|
|
20
21
|
ApplicationScript
|
|
21
|
-
} from "./index-
|
|
22
|
+
} from "./index-5n5hds19.js";
|
|
22
23
|
import"./index-7md2g9vw.js";
|
|
23
|
-
import"./index-
|
|
24
|
+
import"./index-0zyatd10.js";
|
|
24
25
|
import {
|
|
25
|
-
getNpmRegistryUrl,
|
|
26
26
|
CloudRunner
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-zre4m2ce.js";
|
|
28
28
|
import"./index-tvehn2sp.js";
|
|
29
29
|
import {
|
|
30
30
|
PackageScript
|
|
31
|
-
} from "./index-
|
|
32
|
-
import
|
|
31
|
+
} from "./index-3txrjt6n.js";
|
|
32
|
+
import {
|
|
33
|
+
getNpmRegistryUrl
|
|
34
|
+
} from "./index-m5n3ka0p.js";
|
|
35
|
+
import"./index-mwj9q2ya.js";
|
|
33
36
|
|
|
34
37
|
// pkgs/@akanjs/cli/localRegistry/localRegistry.runner.ts
|
|
35
38
|
import { mkdir, rm } from "fs/promises";
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
Sys,
|
|
4
4
|
Module,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-3gccwenr.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-64g9fsjy.js";
|
|
9
9
|
import {
|
|
10
10
|
renderPrimitiveReport
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
} from "./index-05nxx4m5.js";
|
|
12
|
+
import"./index-rvynj5gz.js";
|
|
13
13
|
import {
|
|
14
14
|
ModuleScript
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-tdv66eah.js";
|
|
16
16
|
|
|
17
17
|
// pkgs/@akanjs/cli/module/module.command.ts
|
|
18
18
|
import { Logger, lowerlize } from "akanjs/common";
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
Pkg,
|
|
4
4
|
Workspace,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-3gccwenr.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-64g9fsjy.js";
|
|
9
9
|
import"./index-tvehn2sp.js";
|
|
10
10
|
import {
|
|
11
11
|
PackageScript
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-3txrjt6n.js";
|
|
13
13
|
|
|
14
14
|
// pkgs/@akanjs/cli/package/package.command.ts
|
|
15
15
|
class PackageCommand extends command("package", [PackageScript], ({ public: target }) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "3.1.1-rc.
|
|
3
|
+
"version": "3.1.1-rc.17",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@earendil-works/pi-tui": "1.3.0",
|
|
40
40
|
"@inquirer/prompts": "^8.7.3",
|
|
41
41
|
"@tailwindcss/node": "^4.3.3",
|
|
42
|
-
"akanjs": "3.1.1-rc.
|
|
42
|
+
"akanjs": "3.1.1-rc.17",
|
|
43
43
|
"chalk": "^6.0.1",
|
|
44
44
|
"commander": "^15.0.0",
|
|
45
45
|
"dayjs": "^1.11.23",
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
App,
|
|
4
4
|
Module,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-3gccwenr.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-64g9fsjy.js";
|
|
9
9
|
import {
|
|
10
10
|
PageScript
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-rvynj5gz.js";
|
|
12
12
|
|
|
13
13
|
// pkgs/@akanjs/cli/page/page.command.ts
|
|
14
14
|
class PageCommand extends command("page", [PageScript], ({ public: target }) => ({
|