@iowarp/clio-coder 0.3.0
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/CHANGELOG.md +407 -0
- package/CODE_OF_CONDUCT.md +21 -0
- package/CONTRIBUTING.md +224 -0
- package/LICENSE +202 -0
- package/NOTICE +9 -0
- package/README.md +798 -0
- package/SECURITY.md +72 -0
- package/assets/clio-coder-logo-128.webp +0 -0
- package/damage-control-rules.yaml +419 -0
- package/dist/acp-UMLFVA3F.js +92 -0
- package/dist/agents-Q4MYPMUW.js +91 -0
- package/dist/auth-O6HYIJ6J.js +521 -0
- package/dist/chunk-262G75JS.js +35 -0
- package/dist/chunk-26BZQOAD.js +1281 -0
- package/dist/chunk-2J63S4SF.js +508 -0
- package/dist/chunk-3DANZDGR.js +717 -0
- package/dist/chunk-4UQA7NCT.js +29 -0
- package/dist/chunk-527KG6XR.js +497 -0
- package/dist/chunk-5LDRNKX2.js +1063 -0
- package/dist/chunk-5N2FG33Q.js +25 -0
- package/dist/chunk-67MTHP2E.js +135 -0
- package/dist/chunk-6CWDTGUC.js +20 -0
- package/dist/chunk-7BHLZB3A.js +2115 -0
- package/dist/chunk-7RBKDI66.js +348 -0
- package/dist/chunk-AMFR5YA3.js +541 -0
- package/dist/chunk-BBUH4VAA.js +1224 -0
- package/dist/chunk-BYEU76JP.js +899 -0
- package/dist/chunk-CLJ5HLUD.js +458 -0
- package/dist/chunk-D5YD55AR.js +116 -0
- package/dist/chunk-DXQNI4PC.js +61 -0
- package/dist/chunk-E3NYWENM.js +1004 -0
- package/dist/chunk-GNGDQYDU.js +34688 -0
- package/dist/chunk-GOTUR54M.js +9 -0
- package/dist/chunk-HBU5MTAM.js +41 -0
- package/dist/chunk-HMYNFFY4.js +28 -0
- package/dist/chunk-JPOWPFCU.js +1010 -0
- package/dist/chunk-JWHCJDCI.js +1215 -0
- package/dist/chunk-KBR4MZZR.js +41 -0
- package/dist/chunk-KKKPTZLM.js +93 -0
- package/dist/chunk-ME6DNWIU.js +66 -0
- package/dist/chunk-NI4DEJMC.js +88 -0
- package/dist/chunk-O4EJEDHO.js +659 -0
- package/dist/chunk-PIDUD6M2.js +31 -0
- package/dist/chunk-PS4PFJQP.js +29459 -0
- package/dist/chunk-QV47YRF4.js +48 -0
- package/dist/chunk-RQDWMVRB.js +279 -0
- package/dist/chunk-TFSSEXL6.js +136 -0
- package/dist/chunk-TKHQ4DGZ.js +8290 -0
- package/dist/chunk-TPOCL34A.js +2876 -0
- package/dist/chunk-UGYAX5YI.js +565 -0
- package/dist/chunk-UHTSULZS.js +461 -0
- package/dist/chunk-UU3R62TT.js +128 -0
- package/dist/chunk-UWIJNAOB.js +3906 -0
- package/dist/chunk-VOO7NYPP.js +914 -0
- package/dist/chunk-VPAWTYLY.js +117 -0
- package/dist/chunk-WD6AJM35.js +1216 -0
- package/dist/chunk-X3BR7HWV.js +115 -0
- package/dist/chunk-X3NE4WVW.js +120 -0
- package/dist/chunk-XNISANGE.js +1395 -0
- package/dist/chunk-XV4ZJ6ZM.js +3177 -0
- package/dist/cli/index.js +236 -0
- package/dist/clio-KIQ5SNDS.js +53 -0
- package/dist/components-JVHMUBEB.js +653 -0
- package/dist/config-ZFCDBMDC.js +372 -0
- package/dist/configure-G4E3A2PG.js +27 -0
- package/dist/context-CDXTP2MP.js +293 -0
- package/dist/context-E3KIFVXI.js +185 -0
- package/dist/context-clear-3F4PLXOS.js +102 -0
- package/dist/context-index-Q7YSYTR3.js +106 -0
- package/dist/docs-YIETIWZI.js +280 -0
- package/dist/doctor-M5HJJZOL.js +61 -0
- package/dist/domains/agents/builtins/architect.md +33 -0
- package/dist/domains/agents/builtins/coder.md +31 -0
- package/dist/domains/agents/builtins/context-bootstrap.md +38 -0
- package/dist/domains/agents/builtins/debugger.md +30 -0
- package/dist/domains/agents/builtins/documenter.md +31 -0
- package/dist/domains/agents/builtins/git-master.md +30 -0
- package/dist/domains/agents/builtins/provenance.md +30 -0
- package/dist/domains/agents/builtins/researcher.md +71 -0
- package/dist/domains/agents/builtins/scout.md +42 -0
- package/dist/domains/agents/builtins/tester.md +31 -0
- package/dist/domains/agents/builtins/verifier.md +30 -0
- package/dist/domains/agents/builtins/wiki-writer.md +41 -0
- package/dist/eval-B3KZZESM.js +2674 -0
- package/dist/evidence-V67CHM35.js +233 -0
- package/dist/evolve-YDZSUQYA.js +518 -0
- package/dist/extensions-SRG7XCAH.js +207 -0
- package/dist/fleet-CA2CRTVG.js +760 -0
- package/dist/fleet-preflight-CLIAX7YR.js +21 -0
- package/dist/init-2OZDJE2D.js +227 -0
- package/dist/memory-3PIQQAKX.js +207 -0
- package/dist/models-DY35XI7Y.js +237 -0
- package/dist/paths-5OMXW7Z4.js +57 -0
- package/dist/preload-KZVHET2B.js +11 -0
- package/dist/reset-PIFYNOS3.js +216 -0
- package/dist/run-3VSPP24F.js +735 -0
- package/dist/share-D36RQCXM.js +241 -0
- package/dist/skills-F2MRLELY.js +445 -0
- package/dist/skills-eval-E2ZTW4PL.js +932 -0
- package/dist/targets-DZMEZAH4.js +977 -0
- package/dist/trace-7NYCUI2J.js +250 -0
- package/dist/uninstall-AD3JWHBB.js +322 -0
- package/dist/upgrade-WYYBKGDY.js +301 -0
- package/dist/usage-ULIDAGFF.js +755 -0
- package/dist/version-ROZ6CZKH.js +16 -0
- package/dist/wiki-generate-PKFIX6OB.js +377 -0
- package/dist/worker/entry.js +1739 -0
- package/docs/README.md +93 -0
- package/docs/acp.md +120 -0
- package/docs/alcf-provider.md +72 -0
- package/docs/architecture.md +172 -0
- package/docs/artifact-versions.md +54 -0
- package/docs/built-in-agents.md +265 -0
- package/docs/capacity-and-scheduling.md +97 -0
- package/docs/commands-and-modes.md +554 -0
- package/docs/config-knobs-audit.md +115 -0
- package/docs/configuration-and-targets.md +812 -0
- package/docs/context-engine.md +236 -0
- package/docs/dispatch-architecture-rationale.md +126 -0
- package/docs/documentation-coverage.md +46 -0
- package/docs/documentation-guide.md +166 -0
- package/docs/environment-variables.md +105 -0
- package/docs/eval-runner.md +205 -0
- package/docs/evals-internal.md +298 -0
- package/docs/evidence-and-memory.md +243 -0
- package/docs/evolution.md +143 -0
- package/docs/exit-codes-and-output.md +74 -0
- package/docs/extensions-and-sharing.md +306 -0
- package/docs/fleet-demo-runbook.md +179 -0
- package/docs/fleet-dispatch.md +591 -0
- package/docs/glossary.md +75 -0
- package/docs/html/agents_blueprint.html +936 -0
- package/docs/html/alcf_blueprint.html +324 -0
- package/docs/html/architecture_blueprint.html +850 -0
- package/docs/html/commands_blueprint.html +794 -0
- package/docs/html/config_knobs_audit_blueprint.html +178 -0
- package/docs/html/configuration_blueprint.html +1080 -0
- package/docs/html/context_blueprint.html +603 -0
- package/docs/html/documentation_blueprint.html +832 -0
- package/docs/html/environment_blueprint.html +404 -0
- package/docs/html/eval_blueprint.html +743 -0
- package/docs/html/evals_internal_blueprint.html +190 -0
- package/docs/html/evolution_blueprint.html +674 -0
- package/docs/html/extensions_blueprint.html +2065 -0
- package/docs/html/fleet_dispatch_blueprint.html +286 -0
- package/docs/html/index.html +919 -0
- package/docs/html/lifecycle_blueprint.html +723 -0
- package/docs/html/memory_blueprint.html +699 -0
- package/docs/html/middleware_blueprint.html +664 -0
- package/docs/html/models_blueprint.html +2366 -0
- package/docs/html/observability_blueprint.html +683 -0
- package/docs/html/provider_adapter_blueprint.html +245 -0
- package/docs/html/safety_blueprint.html +1386 -0
- package/docs/html/shared.css +571 -0
- package/docs/html/shared.js +143 -0
- package/docs/html/skills_blueprint.html +671 -0
- package/docs/html/soak_blueprint.html +182 -0
- package/docs/html/tool_usage_blueprint.html +350 -0
- package/docs/html/tools_blueprint.html +2249 -0
- package/docs/html/trace_blueprint.html +235 -0
- package/docs/html/tui_design_blueprint.html +314 -0
- package/docs/html/validation_blueprint.html +961 -0
- package/docs/html/worker_dispatch_blueprint.html +231 -0
- package/docs/installation-and-lifecycle.md +308 -0
- package/docs/middleware-and-components.md +148 -0
- package/docs/model-catalog.md +189 -0
- package/docs/observability.md +233 -0
- package/docs/proactive-memory.md +452 -0
- package/docs/prompt-envelope-and-tools.md +142 -0
- package/docs/provider-adapter-cookbook.md +148 -0
- package/docs/release-cut-checklist.md +138 -0
- package/docs/safety-model.md +357 -0
- package/docs/scientific-validation.md +105 -0
- package/docs/session-lifecycle.md +156 -0
- package/docs/skills-marketplace.md +46 -0
- package/docs/tool-usage.md +527 -0
- package/docs/trace-store.md +132 -0
- package/docs/troubleshooting.md +33 -0
- package/docs/tui-design.md +239 -0
- package/docs/worker-dispatch-mechanics.md +242 -0
- package/package.json +132 -0
- package/skills/README.md +408 -0
- package/skills/git/commit-crafting/SKILL.md +79 -0
- package/skills/git/commit-crafting/evals.md +92 -0
- package/skills/git/create-pr/SKILL.md +116 -0
- package/skills/git/create-pr/evals.md +114 -0
- package/skills/git/investigate-issue/SKILL.md +139 -0
- package/skills/git/investigate-issue/evals.md +94 -0
- package/skills/git/resolve-merge-conflicts/SKILL.md +96 -0
- package/skills/git/resolve-merge-conflicts/evals.md +58 -0
- package/skills/git/review-changes/SKILL.md +103 -0
- package/skills/git/review-changes/evals.md +85 -0
- package/skills/git/worktree-create/SKILL.md +92 -0
- package/skills/git/worktree-create/evals.md +97 -0
- package/skills/git/worktree-create/references/worktree-setup.md +66 -0
- package/skills/git/worktree-merge/SKILL.md +95 -0
- package/skills/git/worktree-merge/evals.md +114 -0
- package/skills/skill-marketplace.json +261 -0
- package/skills/workflow/cut-it/SKILL.md +86 -0
- package/skills/workflow/cut-it/evals.md +42 -0
- package/src/domains/agents/builtins/architect.md +33 -0
- package/src/domains/agents/builtins/coder.md +31 -0
- package/src/domains/agents/builtins/context-bootstrap.md +38 -0
- package/src/domains/agents/builtins/debugger.md +30 -0
- package/src/domains/agents/builtins/documenter.md +31 -0
- package/src/domains/agents/builtins/git-master.md +30 -0
- package/src/domains/agents/builtins/provenance.md +30 -0
- package/src/domains/agents/builtins/researcher.md +71 -0
- package/src/domains/agents/builtins/scout.md +42 -0
- package/src/domains/agents/builtins/tester.md +31 -0
- package/src/domains/agents/builtins/verifier.md +30 -0
- package/src/domains/agents/builtins/wiki-writer.md +41 -0
- package/src/domains/agents/fleets/build-review.md +34 -0
- package/src/domains/agents/fleets/build-test.md +35 -0
- package/src/domains/agents/fleets/sdlc.md +86 -0
- package/src/domains/prompts/fragments/identity/clio-worker.md +11 -0
- package/src/domains/prompts/fragments/identity/clio.md +26 -0
- package/src/domains/prompts/fragments/operating/contract.md +64 -0
- package/src/domains/prompts/fragments/safety/auto-edit.md +14 -0
- package/src/domains/prompts/fragments/safety/full-auto.md +14 -0
- package/src/domains/prompts/fragments/safety/read-only.md +13 -0
- package/src/domains/prompts/fragments/safety/suggest.md +13 -0
- package/src/domains/prompts/fragments/wiki/page.md +75 -0
- package/src/domains/prompts/fragments/wiki/plan.md +48 -0
- package/src/domains/providers/models/cloud-models/alcf.yaml +40 -0
- package/src/domains/providers/models/local-models/clio-local-coding-targets.yaml +993 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// src/domains/context/codewiki/digest.ts
|
|
2
|
+
function compareStrings(a, b) {
|
|
3
|
+
return a.localeCompare(b);
|
|
4
|
+
}
|
|
5
|
+
function topTwoSegments(path) {
|
|
6
|
+
const parts = path.split("/").slice(0, -1);
|
|
7
|
+
if (parts.length === 0) return ".";
|
|
8
|
+
return parts.slice(0, 2).join("/");
|
|
9
|
+
}
|
|
10
|
+
function sourceFiles(codewiki) {
|
|
11
|
+
return codewiki.files.filter((file) => file.lang !== "config").sort((a, b) => a.path.localeCompare(b.path));
|
|
12
|
+
}
|
|
13
|
+
function countBy(items) {
|
|
14
|
+
const counts = /* @__PURE__ */ new Map();
|
|
15
|
+
for (const item of items) counts.set(item, (counts.get(item) ?? 0) + 1);
|
|
16
|
+
return [...counts.entries()].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]));
|
|
17
|
+
}
|
|
18
|
+
function entryPoints(codewiki, limit) {
|
|
19
|
+
const files = sourceFiles(codewiki);
|
|
20
|
+
const tagged = files.filter((file) => file.role === "entry");
|
|
21
|
+
if (tagged.length >= limit) return tagged.slice(0, limit);
|
|
22
|
+
const fileById = new Map(files.map((file) => [file.id, file]));
|
|
23
|
+
const inDegree = /* @__PURE__ */ new Map();
|
|
24
|
+
for (const edge of codewiki.edges) {
|
|
25
|
+
if ("toFileId" in edge) inDegree.set(edge.toFileId, (inDegree.get(edge.toFileId) ?? 0) + 1);
|
|
26
|
+
}
|
|
27
|
+
const taggedIds = new Set(tagged.map((file) => file.id));
|
|
28
|
+
const ranked = [...inDegree.entries()].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).map(([id]) => fileById.get(id)).filter((file) => file !== void 0 && !taggedIds.has(file.id));
|
|
29
|
+
return [...tagged, ...ranked].slice(0, limit);
|
|
30
|
+
}
|
|
31
|
+
function keySymbols(codewiki, limit) {
|
|
32
|
+
const rank = /* @__PURE__ */ new Map([
|
|
33
|
+
["class", 0],
|
|
34
|
+
["trait", 1],
|
|
35
|
+
["iface", 2],
|
|
36
|
+
["type", 3],
|
|
37
|
+
["func", 4],
|
|
38
|
+
["method", 5],
|
|
39
|
+
["const", 6],
|
|
40
|
+
["var", 7]
|
|
41
|
+
]);
|
|
42
|
+
return [...codewiki.symbols].sort((a, b) => {
|
|
43
|
+
const rankCmp = (rank.get(a.kind) ?? 99) - (rank.get(b.kind) ?? 99);
|
|
44
|
+
return rankCmp || a.name.localeCompare(b.name) || a.fileId.localeCompare(b.fileId) || a.line - b.line;
|
|
45
|
+
}).slice(0, limit);
|
|
46
|
+
}
|
|
47
|
+
function dependencyLines(codewiki, limit) {
|
|
48
|
+
const fileById = new Map(codewiki.files.map((file) => [file.id, file]));
|
|
49
|
+
const byFile = /* @__PURE__ */ new Map();
|
|
50
|
+
for (const edge of codewiki.edges) {
|
|
51
|
+
const deps = byFile.get(edge.fileId) ?? { internal: [], external: [] };
|
|
52
|
+
if ("toFileId" in edge) {
|
|
53
|
+
const target = fileById.get(edge.toFileId);
|
|
54
|
+
if (target) deps.internal.push(target.path);
|
|
55
|
+
} else {
|
|
56
|
+
deps.external.push(edge.externalModule);
|
|
57
|
+
}
|
|
58
|
+
byFile.set(edge.fileId, deps);
|
|
59
|
+
}
|
|
60
|
+
return [...byFile.entries()].map(([fileId, deps]) => {
|
|
61
|
+
const file = fileById.get(fileId);
|
|
62
|
+
if (!file) return "";
|
|
63
|
+
const internal = [...new Set(deps.internal)].sort(compareStrings).slice(0, 4);
|
|
64
|
+
const external = [...new Set(deps.external)].sort(compareStrings).slice(0, 4);
|
|
65
|
+
return `- ${file.path}: internal=[${internal.join(", ")}] external=[${external.join(", ")}]`;
|
|
66
|
+
}).filter((line) => line.length > 0).sort(compareStrings).slice(0, limit);
|
|
67
|
+
}
|
|
68
|
+
function fitLines(lines, tokenBudget) {
|
|
69
|
+
const maxChars = Math.max(256, Math.floor(tokenBudget * 4));
|
|
70
|
+
const out = [];
|
|
71
|
+
let used = 0;
|
|
72
|
+
for (const line of lines) {
|
|
73
|
+
const next = used + line.length + 1;
|
|
74
|
+
if (next > maxChars) {
|
|
75
|
+
out.push("[digest truncated]");
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
out.push(line);
|
|
79
|
+
used = next;
|
|
80
|
+
}
|
|
81
|
+
return out.join("\n");
|
|
82
|
+
}
|
|
83
|
+
function entryPointLine(file) {
|
|
84
|
+
const base = `- ${file.path} (${file.lang}, ${file.loc} loc)`;
|
|
85
|
+
return file.summary ? `${base}: ${file.summary.slice(0, 160)}` : base;
|
|
86
|
+
}
|
|
87
|
+
function renderCodewikiDigest(codewiki, tokenBudget = 1200) {
|
|
88
|
+
const files = sourceFiles(codewiki);
|
|
89
|
+
const areaCounts = countBy(files.map((file) => topTwoSegments(file.path))).slice(0, 10).map(([area, count]) => `${area}=${count}`);
|
|
90
|
+
const languageCounts = countBy(files.map((file) => file.lang)).map(([language, count]) => `${language}=${count}`).join(", ");
|
|
91
|
+
const roleCounts = countBy(files.map((file) => file.role)).map(([role, count]) => `${role}=${count}`).join(", ");
|
|
92
|
+
const fileById = new Map(codewiki.files.map((file) => [file.id, file]));
|
|
93
|
+
const lines = [
|
|
94
|
+
`codewiki v${codewiki.version} language=${codewiki.language} files=${files.length} configs=${codewiki.files.length - files.length} symbols=${codewiki.symbols.length} edges=${codewiki.edges.length}`,
|
|
95
|
+
`languages: ${languageCounts || "none"}`,
|
|
96
|
+
`roles: ${roleCounts || "none"}`,
|
|
97
|
+
`areas: ${areaCounts.join(", ") || "none"}`,
|
|
98
|
+
"entry points:",
|
|
99
|
+
...entryPoints(codewiki, 12).map(entryPointLine),
|
|
100
|
+
"key symbols:",
|
|
101
|
+
...keySymbols(codewiki, 40).map((symbol) => {
|
|
102
|
+
const file = fileById.get(symbol.fileId);
|
|
103
|
+
const location = file ? `${file.path}:${symbol.line}` : `${symbol.fileId}:${symbol.line}`;
|
|
104
|
+
return `- ${symbol.name} ${symbol.kind} ${location}`;
|
|
105
|
+
}),
|
|
106
|
+
"dependencies:",
|
|
107
|
+
...dependencyLines(codewiki, 24)
|
|
108
|
+
];
|
|
109
|
+
return fitLines(lines, tokenBudget);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export {
|
|
113
|
+
renderCodewikiDigest
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=chunk-X3BR7HWV.js.map
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// src/core/xdg.ts
|
|
2
|
+
import { existsSync, mkdirSync, statSync } from "node:fs";
|
|
3
|
+
import { homedir, platform } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
var cachedConfigDir;
|
|
6
|
+
var cachedDataDir;
|
|
7
|
+
var cachedStateDir;
|
|
8
|
+
var cachedCacheDir;
|
|
9
|
+
function envOrNull(key) {
|
|
10
|
+
const v = process.env[key]?.trim();
|
|
11
|
+
return v && v.length > 0 ? v : null;
|
|
12
|
+
}
|
|
13
|
+
function platformDefaults() {
|
|
14
|
+
const p = platform();
|
|
15
|
+
const h = homedir();
|
|
16
|
+
if (p === "win32") {
|
|
17
|
+
const appData = process.env.APPDATA ?? join(h, "AppData", "Roaming");
|
|
18
|
+
const localAppData = process.env.LOCALAPPDATA ?? join(h, "AppData", "Local");
|
|
19
|
+
return {
|
|
20
|
+
config: join(appData, "clio-coder", "config"),
|
|
21
|
+
data: join(appData, "clio-coder", "data"),
|
|
22
|
+
state: join(localAppData, "clio-coder", "state"),
|
|
23
|
+
cache: join(localAppData, "clio-coder", "cache")
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (p === "darwin") {
|
|
27
|
+
const base = join(h, "Library", "Application Support", "clio-coder");
|
|
28
|
+
return {
|
|
29
|
+
config: join(base, "config"),
|
|
30
|
+
data: join(base, "data"),
|
|
31
|
+
state: join(base, "state"),
|
|
32
|
+
cache: join(h, "Library", "Caches", "clio-coder")
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME ?? join(h, ".config");
|
|
36
|
+
const xdgData = process.env.XDG_DATA_HOME ?? join(h, ".local", "share");
|
|
37
|
+
const xdgState = process.env.XDG_STATE_HOME ?? join(h, ".local", "state");
|
|
38
|
+
const xdgCache = process.env.XDG_CACHE_HOME ?? join(h, ".cache");
|
|
39
|
+
return {
|
|
40
|
+
config: join(xdgConfig, "clio-coder"),
|
|
41
|
+
data: join(xdgData, "clio-coder"),
|
|
42
|
+
state: join(xdgState, "clio-coder"),
|
|
43
|
+
cache: join(xdgCache, "clio-coder")
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function ensureDir(dir) {
|
|
47
|
+
try {
|
|
48
|
+
mkdirSync(dir, { recursive: true });
|
|
49
|
+
} catch (err) {
|
|
50
|
+
const e = err;
|
|
51
|
+
if (e.code !== "EEXIST") throw err;
|
|
52
|
+
}
|
|
53
|
+
const s = statSync(dir);
|
|
54
|
+
if (!s.isDirectory()) throw new Error(`Expected directory at ${dir}`);
|
|
55
|
+
return dir;
|
|
56
|
+
}
|
|
57
|
+
function clioHomeOrNull() {
|
|
58
|
+
return envOrNull("CLIO_CODER_HOME");
|
|
59
|
+
}
|
|
60
|
+
function resolveRole(specificVar, role, defaults) {
|
|
61
|
+
const specific = envOrNull(specificVar);
|
|
62
|
+
if (specific) return specific;
|
|
63
|
+
const home = clioHomeOrNull();
|
|
64
|
+
if (home) return join(home, role);
|
|
65
|
+
return defaults[role];
|
|
66
|
+
}
|
|
67
|
+
function resolveClioDirs() {
|
|
68
|
+
const defaults = platformDefaults();
|
|
69
|
+
return {
|
|
70
|
+
config: resolveRole("CLIO_CODER_CONFIG_DIR", "config", defaults),
|
|
71
|
+
data: resolveRole("CLIO_CODER_DATA_DIR", "data", defaults),
|
|
72
|
+
state: resolveRole("CLIO_CODER_STATE_DIR", "state", defaults),
|
|
73
|
+
cache: resolveRole("CLIO_CODER_CACHE_DIR", "cache", defaults)
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function clioConfigDir() {
|
|
77
|
+
if (cachedConfigDir) return cachedConfigDir;
|
|
78
|
+
cachedConfigDir = ensureDir(resolveClioDirs().config);
|
|
79
|
+
return cachedConfigDir;
|
|
80
|
+
}
|
|
81
|
+
function clioDataDir() {
|
|
82
|
+
if (cachedDataDir) return cachedDataDir;
|
|
83
|
+
cachedDataDir = ensureDir(resolveClioDirs().data);
|
|
84
|
+
return cachedDataDir;
|
|
85
|
+
}
|
|
86
|
+
function clioStateDir() {
|
|
87
|
+
if (cachedStateDir) return cachedStateDir;
|
|
88
|
+
cachedStateDir = ensureDir(resolveClioDirs().state);
|
|
89
|
+
return cachedStateDir;
|
|
90
|
+
}
|
|
91
|
+
function clioCacheDir() {
|
|
92
|
+
if (cachedCacheDir) return cachedCacheDir;
|
|
93
|
+
cachedCacheDir = ensureDir(resolveClioDirs().cache);
|
|
94
|
+
return cachedCacheDir;
|
|
95
|
+
}
|
|
96
|
+
function clioStatePath() {
|
|
97
|
+
return cachedStateDir ?? resolveClioDirs().state;
|
|
98
|
+
}
|
|
99
|
+
function stateRootRemoved() {
|
|
100
|
+
if (cachedStateDir === void 0) return false;
|
|
101
|
+
return !existsSync(cachedStateDir);
|
|
102
|
+
}
|
|
103
|
+
function resetXdgCache() {
|
|
104
|
+
cachedConfigDir = void 0;
|
|
105
|
+
cachedDataDir = void 0;
|
|
106
|
+
cachedStateDir = void 0;
|
|
107
|
+
cachedCacheDir = void 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export {
|
|
111
|
+
resolveClioDirs,
|
|
112
|
+
clioConfigDir,
|
|
113
|
+
clioDataDir,
|
|
114
|
+
clioStateDir,
|
|
115
|
+
clioCacheDir,
|
|
116
|
+
clioStatePath,
|
|
117
|
+
stateRootRemoved,
|
|
118
|
+
resetXdgCache
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=chunk-X3NE4WVW.js.map
|