causoryn 0.0.0-stage → 0.2.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/.claude-plugin/plugin.json +36 -0
- package/.codex-plugin/mcp.json +19 -0
- package/.codex-plugin/plugin.json +38 -0
- package/.zcode-plugin/plugin.json +42 -0
- package/LICENSE +21 -0
- package/README.md +171 -2
- package/THIRD-PARTY-NOTICES.md +443 -0
- package/dist/bundle-manifest.json +39 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +253 -0
- package/dist/doctor.d.ts +13 -0
- package/dist/doctor.js +507 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/mcp-server.mjs +288477 -0
- package/dist/mcp-server.mjs.LEGAL.txt +17 -0
- package/dist/node_modules/better-sqlite3/LICENSE +21 -0
- package/dist/node_modules/better-sqlite3/lib/binding.js +62 -0
- package/dist/node_modules/better-sqlite3/lib/darwin-arm64.js +3 -0
- package/dist/node_modules/better-sqlite3/lib/darwin-x64.js +3 -0
- package/dist/node_modules/better-sqlite3/lib/database.js +109 -0
- package/dist/node_modules/better-sqlite3/lib/index.js +3 -0
- package/dist/node_modules/better-sqlite3/lib/linux-arm64.js +3 -0
- package/dist/node_modules/better-sqlite3/lib/linux-x64.js +3 -0
- package/dist/node_modules/better-sqlite3/lib/linuxmusl-arm64.js +4 -0
- package/dist/node_modules/better-sqlite3/lib/linuxmusl-x64.js +4 -0
- package/dist/node_modules/better-sqlite3/lib/methods/aggregate.js +43 -0
- package/dist/node_modules/better-sqlite3/lib/methods/backup.js +67 -0
- package/dist/node_modules/better-sqlite3/lib/methods/explain.js +9 -0
- package/dist/node_modules/better-sqlite3/lib/methods/function.js +31 -0
- package/dist/node_modules/better-sqlite3/lib/methods/inspect.js +7 -0
- package/dist/node_modules/better-sqlite3/lib/methods/pragma.js +12 -0
- package/dist/node_modules/better-sqlite3/lib/methods/serialize.js +16 -0
- package/dist/node_modules/better-sqlite3/lib/methods/table.js +195 -0
- package/dist/node_modules/better-sqlite3/lib/methods/transaction.js +78 -0
- package/dist/node_modules/better-sqlite3/lib/methods/wrappers.js +54 -0
- package/dist/node_modules/better-sqlite3/lib/sqlite-error.js +25 -0
- package/dist/node_modules/better-sqlite3/lib/util.js +12 -0
- package/dist/node_modules/better-sqlite3/lib/win32-arm64.js +3 -0
- package/dist/node_modules/better-sqlite3/lib/win32-x64.js +3 -0
- package/dist/node_modules/better-sqlite3/package.json +67 -0
- package/dist/node_modules/better-sqlite3/prebuilds/darwin-arm64.node +0 -0
- package/dist/node_modules/better-sqlite3/prebuilds/darwin-x64.node +0 -0
- package/dist/node_modules/better-sqlite3/prebuilds/linux-arm64.node +0 -0
- package/dist/node_modules/better-sqlite3/prebuilds/linux-x64.node +0 -0
- package/dist/node_modules/better-sqlite3/prebuilds/linuxmusl-arm64.node +0 -0
- package/dist/node_modules/better-sqlite3/prebuilds/linuxmusl-x64.node +0 -0
- package/dist/node_modules/better-sqlite3/prebuilds/win32-arm64.node +0 -0
- package/dist/node_modules/better-sqlite3/prebuilds/win32-x64.node +0 -0
- package/dist/runtime-stage.d.ts +8 -0
- package/dist/runtime-stage.js +159 -0
- package/dist/setup.d.ts +15 -0
- package/dist/setup.js +735 -0
- package/dist/toml-patch.d.ts +10 -0
- package/dist/toml-patch.js +587 -0
- package/dist/types.d.ts +144 -0
- package/dist/types.js +35 -0
- package/dist/typescript-lib/lib.d.ts +22 -0
- package/dist/typescript-lib/lib.decorators.d.ts +384 -0
- package/dist/typescript-lib/lib.decorators.legacy.d.ts +22 -0
- package/dist/typescript-lib/lib.dom.asynciterable.d.ts +41 -0
- package/dist/typescript-lib/lib.dom.d.ts +39429 -0
- package/dist/typescript-lib/lib.dom.iterable.d.ts +571 -0
- package/dist/typescript-lib/lib.es2015.collection.d.ts +147 -0
- package/dist/typescript-lib/lib.es2015.core.d.ts +597 -0
- package/dist/typescript-lib/lib.es2015.d.ts +28 -0
- package/dist/typescript-lib/lib.es2015.generator.d.ts +77 -0
- package/dist/typescript-lib/lib.es2015.iterable.d.ts +605 -0
- package/dist/typescript-lib/lib.es2015.promise.d.ts +81 -0
- package/dist/typescript-lib/lib.es2015.proxy.d.ts +128 -0
- package/dist/typescript-lib/lib.es2015.reflect.d.ts +144 -0
- package/dist/typescript-lib/lib.es2015.symbol.d.ts +46 -0
- package/dist/typescript-lib/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/dist/typescript-lib/lib.es2016.array.include.d.ts +116 -0
- package/dist/typescript-lib/lib.es2016.d.ts +21 -0
- package/dist/typescript-lib/lib.es2016.full.d.ts +23 -0
- package/dist/typescript-lib/lib.es2016.intl.d.ts +31 -0
- package/dist/typescript-lib/lib.es2017.arraybuffer.d.ts +21 -0
- package/dist/typescript-lib/lib.es2017.d.ts +26 -0
- package/dist/typescript-lib/lib.es2017.date.d.ts +31 -0
- package/dist/typescript-lib/lib.es2017.full.d.ts +23 -0
- package/dist/typescript-lib/lib.es2017.intl.d.ts +44 -0
- package/dist/typescript-lib/lib.es2017.object.d.ts +49 -0
- package/dist/typescript-lib/lib.es2017.sharedmemory.d.ts +135 -0
- package/dist/typescript-lib/lib.es2017.string.d.ts +45 -0
- package/dist/typescript-lib/lib.es2017.typedarrays.d.ts +53 -0
- package/dist/typescript-lib/lib.es2018.asyncgenerator.d.ts +77 -0
- package/dist/typescript-lib/lib.es2018.asynciterable.d.ts +53 -0
- package/dist/typescript-lib/lib.es2018.d.ts +24 -0
- package/dist/typescript-lib/lib.es2018.full.d.ts +24 -0
- package/dist/typescript-lib/lib.es2018.intl.d.ts +83 -0
- package/dist/typescript-lib/lib.es2018.promise.d.ts +30 -0
- package/dist/typescript-lib/lib.es2018.regexp.d.ts +37 -0
- package/dist/typescript-lib/lib.es2019.array.d.ts +79 -0
- package/dist/typescript-lib/lib.es2019.d.ts +24 -0
- package/dist/typescript-lib/lib.es2019.full.d.ts +24 -0
- package/dist/typescript-lib/lib.es2019.intl.d.ts +23 -0
- package/dist/typescript-lib/lib.es2019.object.d.ts +33 -0
- package/dist/typescript-lib/lib.es2019.string.d.ts +37 -0
- package/dist/typescript-lib/lib.es2019.symbol.d.ts +24 -0
- package/dist/typescript-lib/lib.es2020.bigint.d.ts +765 -0
- package/dist/typescript-lib/lib.es2020.d.ts +27 -0
- package/dist/typescript-lib/lib.es2020.date.d.ts +42 -0
- package/dist/typescript-lib/lib.es2020.full.d.ts +24 -0
- package/dist/typescript-lib/lib.es2020.intl.d.ts +474 -0
- package/dist/typescript-lib/lib.es2020.number.d.ts +28 -0
- package/dist/typescript-lib/lib.es2020.promise.d.ts +47 -0
- package/dist/typescript-lib/lib.es2020.sharedmemory.d.ts +99 -0
- package/dist/typescript-lib/lib.es2020.string.d.ts +44 -0
- package/dist/typescript-lib/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/dist/typescript-lib/lib.es2021.d.ts +23 -0
- package/dist/typescript-lib/lib.es2021.full.d.ts +24 -0
- package/dist/typescript-lib/lib.es2021.intl.d.ts +166 -0
- package/dist/typescript-lib/lib.es2021.promise.d.ts +48 -0
- package/dist/typescript-lib/lib.es2021.string.d.ts +33 -0
- package/dist/typescript-lib/lib.es2021.weakref.d.ts +78 -0
- package/dist/typescript-lib/lib.es2022.array.d.ts +121 -0
- package/dist/typescript-lib/lib.es2022.d.ts +25 -0
- package/dist/typescript-lib/lib.es2022.error.d.ts +75 -0
- package/dist/typescript-lib/lib.es2022.full.d.ts +24 -0
- package/dist/typescript-lib/lib.es2022.intl.d.ts +145 -0
- package/dist/typescript-lib/lib.es2022.object.d.ts +26 -0
- package/dist/typescript-lib/lib.es2022.regexp.d.ts +39 -0
- package/dist/typescript-lib/lib.es2022.string.d.ts +25 -0
- package/dist/typescript-lib/lib.es2023.array.d.ts +924 -0
- package/dist/typescript-lib/lib.es2023.collection.d.ts +21 -0
- package/dist/typescript-lib/lib.es2023.d.ts +22 -0
- package/dist/typescript-lib/lib.es2023.full.d.ts +24 -0
- package/dist/typescript-lib/lib.es2023.intl.d.ts +56 -0
- package/dist/typescript-lib/lib.es2024.arraybuffer.d.ts +65 -0
- package/dist/typescript-lib/lib.es2024.collection.d.ts +29 -0
- package/dist/typescript-lib/lib.es2024.d.ts +26 -0
- package/dist/typescript-lib/lib.es2024.full.d.ts +24 -0
- package/dist/typescript-lib/lib.es2024.object.d.ts +29 -0
- package/dist/typescript-lib/lib.es2024.promise.d.ts +35 -0
- package/dist/typescript-lib/lib.es2024.regexp.d.ts +25 -0
- package/dist/typescript-lib/lib.es2024.sharedmemory.d.ts +68 -0
- package/dist/typescript-lib/lib.es2024.string.d.ts +29 -0
- package/dist/typescript-lib/lib.es5.d.ts +4601 -0
- package/dist/typescript-lib/lib.es6.d.ts +23 -0
- package/dist/typescript-lib/lib.esnext.array.d.ts +35 -0
- package/dist/typescript-lib/lib.esnext.collection.d.ts +96 -0
- package/dist/typescript-lib/lib.esnext.d.ts +29 -0
- package/dist/typescript-lib/lib.esnext.decorators.d.ts +28 -0
- package/dist/typescript-lib/lib.esnext.disposable.d.ts +193 -0
- package/dist/typescript-lib/lib.esnext.error.d.ts +24 -0
- package/dist/typescript-lib/lib.esnext.float16.d.ts +445 -0
- package/dist/typescript-lib/lib.esnext.full.d.ts +24 -0
- package/dist/typescript-lib/lib.esnext.intl.d.ts +21 -0
- package/dist/typescript-lib/lib.esnext.iterator.d.ts +148 -0
- package/dist/typescript-lib/lib.esnext.promise.d.ts +34 -0
- package/dist/typescript-lib/lib.esnext.sharedmemory.d.ts +25 -0
- package/dist/typescript-lib/lib.scripthost.d.ts +322 -0
- package/dist/typescript-lib/lib.webworker.asynciterable.d.ts +41 -0
- package/dist/typescript-lib/lib.webworker.d.ts +13150 -0
- package/dist/typescript-lib/lib.webworker.importscripts.d.ts +23 -0
- package/dist/typescript-lib/lib.webworker.iterable.d.ts +340 -0
- package/licenses/Apache-2.0.txt +55 -0
- package/licenses/TypeScript-ThirdPartyNoticeText.txt +193 -0
- package/licenses/better-sqlite3-LICENSE.txt +21 -0
- package/mcp_config.json +16 -0
- package/native/go-worker/PROTOCOL.md +316 -0
- package/native/go-worker/cmd/worker/main.go +440 -0
- package/native/go-worker/go.mod +3 -0
- package/native/go-worker/internal/analyze/analyze.go +820 -0
- package/native/go-worker/internal/analyze/model.go +182 -0
- package/native/go-worker/internal/analyze/routes.go +181 -0
- package/native/python-worker/PROTOCOL.md +342 -0
- package/native/python-worker/worker.py +1190 -0
- package/native/roslyn-worker/Causoryn.RoslynWorker.csproj +40 -0
- package/native/roslyn-worker/Causoryn.RoslynWorker.deps.json +59 -0
- package/native/roslyn-worker/Causoryn.RoslynWorker.dll +0 -0
- package/native/roslyn-worker/Causoryn.RoslynWorker.runtimeconfig.json +13 -0
- package/native/roslyn-worker/Microsoft.CodeAnalysis.CSharp.dll +0 -0
- package/native/roslyn-worker/Microsoft.CodeAnalysis.dll +0 -0
- package/native/roslyn-worker/PROTOCOL.md +285 -0
- package/native/roslyn-worker/Program.cs +249 -0
- package/native/roslyn-worker/Protocol.cs +397 -0
- package/native/roslyn-worker/ReferenceResolver.cs +235 -0
- package/native/roslyn-worker/WorkerAnalyzer.cs +1669 -0
- package/native/roslyn-worker/packages.lock.json +30 -0
- package/native/rust-worker/Cargo.lock +107 -0
- package/native/rust-worker/Cargo.toml +23 -0
- package/native/rust-worker/PROTOCOL.md +294 -0
- package/native/rust-worker/src/analyzer.rs +1209 -0
- package/native/rust-worker/src/main.rs +127 -0
- package/native/rust-worker/src/protocol.rs +284 -0
- package/native/rust-worker/src/sha256.rs +136 -0
- package/package.json +71 -4
- package/plugin.json +17 -0
- package/scripts/causoryn.mjs +40 -0
- package/scripts/lib/node-version-guard.mjs +24 -0
- package/scripts/plugin-mcp-launcher.mjs +111 -0
- package/skills/causoryn/SKILL.md +53 -0
- package/skills/map-system/SKILL.md +69 -0
- package/skills/preflight-change/SKILL.md +38 -0
- package/skills/verify-change/SKILL.md +31 -0
package/dist/cli.js
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import readline from "node:readline/promises";
|
|
2
|
+
import { formatDoctorReportText, runDoctor } from "./doctor.js";
|
|
3
|
+
import { runSetup } from "./setup.js";
|
|
4
|
+
import { CAUSORYN_PACKAGE_VERSION, CausorynCliError, HOST_CLIENT_IDS, isHostClientId, } from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* `causoryn` CLI komut ayrıştırıcısı ve çalıştırıcısı (`setup`, `doctor`,
|
|
7
|
+
* `--version`, `--help`; `mcp` doğrudan `scripts/causoryn.mjs` tarafından
|
|
8
|
+
* saf `stdout` ile `dist/mcp-server.mjs` modülüne devredilir).
|
|
9
|
+
*/
|
|
10
|
+
const HELP_TEXT = `Usage:
|
|
11
|
+
causoryn mcp [--allow-cwd] [--root <path>] [--auto-data-dir] [--data-dir <path>] [--client <id>]
|
|
12
|
+
causoryn setup [--client <antigravity|claude-code|codex|zcode>...] [--all-detected] [--yes] [--dry-run] [--uninstall] [--skill | --no-skill] [--json]
|
|
13
|
+
causoryn doctor [--client <antigravity|claude-code|codex|zcode>...] [--json]
|
|
14
|
+
causoryn --version
|
|
15
|
+
causoryn --help
|
|
16
|
+
`;
|
|
17
|
+
function defaultCliIo() {
|
|
18
|
+
return {
|
|
19
|
+
stdout: (text) => {
|
|
20
|
+
process.stdout.write(text);
|
|
21
|
+
},
|
|
22
|
+
stderr: (text) => {
|
|
23
|
+
process.stderr.write(text);
|
|
24
|
+
},
|
|
25
|
+
isInteractive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
26
|
+
confirm: async (promptText) => {
|
|
27
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
const rl = readline.createInterface({
|
|
31
|
+
input: process.stdin,
|
|
32
|
+
output: process.stderr,
|
|
33
|
+
});
|
|
34
|
+
try {
|
|
35
|
+
const answer = (await rl.question(promptText)).trim().toLowerCase();
|
|
36
|
+
return answer === "y" || answer === "yes";
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
rl.close();
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function parseClientValues(raw) {
|
|
45
|
+
const parts = raw
|
|
46
|
+
.split(",")
|
|
47
|
+
.map((s) => s.trim())
|
|
48
|
+
.filter((s) => s.length > 0);
|
|
49
|
+
if (parts.length === 0) {
|
|
50
|
+
throw new CausorynCliError("cli/invalid-arguments", `--client için geçerli bir host kimliği gerekli (${HOST_CLIENT_IDS.join(", ")})`);
|
|
51
|
+
}
|
|
52
|
+
const parsed = [];
|
|
53
|
+
for (const part of parts) {
|
|
54
|
+
if (!isHostClientId(part)) {
|
|
55
|
+
throw new CausorynCliError("cli/invalid-arguments", `Geçersiz --client değeri "${part}". Desteklenen değerler: ${HOST_CLIENT_IDS.join(", ")}`);
|
|
56
|
+
}
|
|
57
|
+
parsed.push(part);
|
|
58
|
+
}
|
|
59
|
+
return parsed;
|
|
60
|
+
}
|
|
61
|
+
function parseSetupFlags(args) {
|
|
62
|
+
const clients = [];
|
|
63
|
+
let allDetected = false;
|
|
64
|
+
let yes = false;
|
|
65
|
+
let dryRun = false;
|
|
66
|
+
let uninstall = false;
|
|
67
|
+
let installSkills = true;
|
|
68
|
+
let json = false;
|
|
69
|
+
let help = false;
|
|
70
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
71
|
+
const arg = args[i] ?? "";
|
|
72
|
+
if (arg === "--help" || arg === "-h") {
|
|
73
|
+
help = true;
|
|
74
|
+
}
|
|
75
|
+
else if (arg === "--all-detected") {
|
|
76
|
+
allDetected = true;
|
|
77
|
+
}
|
|
78
|
+
else if (arg === "--yes" || arg === "-y") {
|
|
79
|
+
yes = true;
|
|
80
|
+
}
|
|
81
|
+
else if (arg === "--dry-run") {
|
|
82
|
+
dryRun = true;
|
|
83
|
+
}
|
|
84
|
+
else if (arg === "--uninstall") {
|
|
85
|
+
uninstall = true;
|
|
86
|
+
}
|
|
87
|
+
else if (arg === "--skill") {
|
|
88
|
+
installSkills = true;
|
|
89
|
+
}
|
|
90
|
+
else if (arg === "--no-skill") {
|
|
91
|
+
installSkills = false;
|
|
92
|
+
}
|
|
93
|
+
else if (arg === "--json") {
|
|
94
|
+
json = true;
|
|
95
|
+
}
|
|
96
|
+
else if (arg === "--client") {
|
|
97
|
+
const next = args[i + 1];
|
|
98
|
+
if (next === undefined || next.startsWith("-")) {
|
|
99
|
+
throw new CausorynCliError("cli/invalid-arguments", "--client bayrağı bir değer bekliyor");
|
|
100
|
+
}
|
|
101
|
+
clients.push(...parseClientValues(next));
|
|
102
|
+
i += 1;
|
|
103
|
+
}
|
|
104
|
+
else if (arg.startsWith("--client=")) {
|
|
105
|
+
clients.push(...parseClientValues(arg.slice("--client=".length)));
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
throw new CausorynCliError("cli/invalid-arguments", `Bilinmeyen setup argümanı: ${arg}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
clients,
|
|
113
|
+
allDetected,
|
|
114
|
+
yes,
|
|
115
|
+
dryRun,
|
|
116
|
+
uninstall,
|
|
117
|
+
installSkills,
|
|
118
|
+
json,
|
|
119
|
+
help,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function parseDoctorFlags(args) {
|
|
123
|
+
const clients = [];
|
|
124
|
+
let json = false;
|
|
125
|
+
let help = false;
|
|
126
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
127
|
+
const arg = args[i] ?? "";
|
|
128
|
+
if (arg === "--help" || arg === "-h") {
|
|
129
|
+
help = true;
|
|
130
|
+
}
|
|
131
|
+
else if (arg === "--json") {
|
|
132
|
+
json = true;
|
|
133
|
+
}
|
|
134
|
+
else if (arg === "--client") {
|
|
135
|
+
const next = args[i + 1];
|
|
136
|
+
if (next === undefined || next.startsWith("-")) {
|
|
137
|
+
throw new CausorynCliError("cli/invalid-arguments", "--client bayrağı bir değer bekliyor");
|
|
138
|
+
}
|
|
139
|
+
clients.push(...parseClientValues(next));
|
|
140
|
+
i += 1;
|
|
141
|
+
}
|
|
142
|
+
else if (arg.startsWith("--client=")) {
|
|
143
|
+
clients.push(...parseClientValues(arg.slice("--client=".length)));
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
throw new CausorynCliError("cli/invalid-arguments", `Bilinmeyen doctor argümanı: ${arg}`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return { clients, json, help };
|
|
150
|
+
}
|
|
151
|
+
function formatSetupActionsText(actions) {
|
|
152
|
+
if (actions.length === 0) {
|
|
153
|
+
return " (hiçbir değişiklik yok)\n";
|
|
154
|
+
}
|
|
155
|
+
return `${actions
|
|
156
|
+
.map((a) => ` - [${a.client}] ${a.operation.toUpperCase()} (${a.kind}): ${a.targetPath} (${a.detail})`)
|
|
157
|
+
.join("\n")}\n`;
|
|
158
|
+
}
|
|
159
|
+
function formatSetupResultText(result) {
|
|
160
|
+
const modeLabel = result.dryRun
|
|
161
|
+
? "DRY-RUN ÖNİZLEME"
|
|
162
|
+
: result.applied
|
|
163
|
+
? result.uninstall
|
|
164
|
+
? "KALDIRILDI"
|
|
165
|
+
: "UYGULANDI"
|
|
166
|
+
: "DEĞİŞİKLİK YOK";
|
|
167
|
+
const lines = [];
|
|
168
|
+
lines.push(`Causoryn Setup — ${modeLabel}`);
|
|
169
|
+
if (result.stagedRuntimeDir !== null) {
|
|
170
|
+
lines.push(`Staged Runtime: ${result.stagedRuntimeDir}`);
|
|
171
|
+
}
|
|
172
|
+
if (result.runtimeCleanedUp) {
|
|
173
|
+
lines.push("Staged Runtime Cleanup: ~/.causoryn/runtime silindi (kalan host referansı yok)");
|
|
174
|
+
}
|
|
175
|
+
lines.push("Planlanan / Uygulanan İşlemler:");
|
|
176
|
+
lines.push(formatSetupActionsText(result.actions).trimEnd());
|
|
177
|
+
return `${lines.join("\n")}\n`;
|
|
178
|
+
}
|
|
179
|
+
export async function runCli(argv, options = {}) {
|
|
180
|
+
const io = options.io ?? defaultCliIo();
|
|
181
|
+
const first = argv[0];
|
|
182
|
+
if (first === undefined || first === "--help" || first === "-h" || first === "help") {
|
|
183
|
+
io.stdout(HELP_TEXT);
|
|
184
|
+
return 0;
|
|
185
|
+
}
|
|
186
|
+
if (first === "--version" || first === "-v" || first === "version") {
|
|
187
|
+
io.stdout(`${CAUSORYN_PACKAGE_VERSION}\n`);
|
|
188
|
+
return 0;
|
|
189
|
+
}
|
|
190
|
+
try {
|
|
191
|
+
if (first === "setup") {
|
|
192
|
+
const flags = parseSetupFlags(argv.slice(1));
|
|
193
|
+
if (flags.help) {
|
|
194
|
+
io.stdout(HELP_TEXT);
|
|
195
|
+
return 0;
|
|
196
|
+
}
|
|
197
|
+
const confirmHandler = !flags.yes && !flags.dryRun && io.isInteractive === true && io.confirm !== undefined
|
|
198
|
+
? async (actions) => {
|
|
199
|
+
io.stderr(`Aşağıdaki değişiklikler uygulanacak:\n${formatSetupActionsText(actions)}`);
|
|
200
|
+
return await io.confirm("Devam edilsin mi? [y/N] ");
|
|
201
|
+
}
|
|
202
|
+
: undefined;
|
|
203
|
+
const result = await runSetup({
|
|
204
|
+
homeDir: options.homeDir,
|
|
205
|
+
codexHomeDir: options.codexHomeDir,
|
|
206
|
+
packageRoot: options.packageRoot,
|
|
207
|
+
ephemeralTmpDir: options.ephemeralTmpDir,
|
|
208
|
+
...(flags.clients.length > 0 ? { clients: flags.clients } : {}),
|
|
209
|
+
allDetected: flags.allDetected,
|
|
210
|
+
yes: flags.yes,
|
|
211
|
+
dryRun: flags.dryRun,
|
|
212
|
+
uninstall: flags.uninstall,
|
|
213
|
+
installSkills: flags.installSkills,
|
|
214
|
+
confirm: confirmHandler,
|
|
215
|
+
});
|
|
216
|
+
if (flags.json) {
|
|
217
|
+
io.stdout(`${JSON.stringify(result, null, 2)}\n`);
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
io.stdout(formatSetupResultText(result));
|
|
221
|
+
}
|
|
222
|
+
return 0;
|
|
223
|
+
}
|
|
224
|
+
if (first === "doctor") {
|
|
225
|
+
const flags = parseDoctorFlags(argv.slice(1));
|
|
226
|
+
if (flags.help) {
|
|
227
|
+
io.stdout(HELP_TEXT);
|
|
228
|
+
return 0;
|
|
229
|
+
}
|
|
230
|
+
const report = runDoctor({
|
|
231
|
+
homeDir: options.homeDir,
|
|
232
|
+
codexHomeDir: options.codexHomeDir,
|
|
233
|
+
packageRoot: options.packageRoot,
|
|
234
|
+
...(flags.clients.length > 0 ? { clients: flags.clients } : {}),
|
|
235
|
+
probeToolchain: options.probeToolchain,
|
|
236
|
+
});
|
|
237
|
+
if (flags.json) {
|
|
238
|
+
io.stdout(`${JSON.stringify(report, null, 2)}\n`);
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
io.stdout(formatDoctorReportText(report, flags.clients.length > 0 ? flags.clients : undefined));
|
|
242
|
+
}
|
|
243
|
+
return report.healthy ? 0 : 1;
|
|
244
|
+
}
|
|
245
|
+
throw new CausorynCliError("cli/invalid-arguments", `Bilinmeyen alt komut: "${first}". Yardım için \`causoryn --help\` çalıştırın.`);
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
249
|
+
io.stderr(`[causoryn] hata: ${message}\n`);
|
|
250
|
+
return 2;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/doctor.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type DoctorOptions, type DoctorReport, type HostClientId } from "./types.js";
|
|
2
|
+
export declare const DOCTOR_PROBE_ENV_ALLOWLIST: readonly ["PATH", "SystemRoot", "COMSPEC", "TEMP", "TMP", "USERPROFILE", "HOME", "APPDATA", "LOCALAPPDATA", "DOTNET_ROOT", "DOTNET_CLI_HOME", "GOPATH", "GOROOT", "GOCACHE", "GOMODCACHE", "GOENV", "CARGO_HOME", "RUSTUP_HOME"];
|
|
3
|
+
export declare function buildDoctorProbeEnv(sourceEnv?: NodeJS.ProcessEnv): Record<string, string>;
|
|
4
|
+
export declare function isLinuxMusl(platform?: NodeJS.Platform, getReport?: () => unknown): boolean;
|
|
5
|
+
type ExtendedDoctorOptions = DoctorOptions & {
|
|
6
|
+
readonly isMusl?: boolean | undefined;
|
|
7
|
+
readonly claudeConfigDir?: string | undefined;
|
|
8
|
+
readonly env?: NodeJS.ProcessEnv | undefined;
|
|
9
|
+
};
|
|
10
|
+
export declare function runDoctor(options?: ExtendedDoctorOptions): DoctorReport;
|
|
11
|
+
export declare function formatDoctorReportText(report: DoctorReport, selectedClients?: readonly HostClientId[]): string;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=doctor.d.ts.map
|