@wirecat/cli-template 0.8.0 → 0.10.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/.github/workflows/ci.yml +3 -3
- package/.github/workflows/release.yml +63 -0
- package/.gitleaks.toml +18 -0
- package/AGENTS.md +9 -15
- package/CHANGELOG.md +87 -1
- package/README.md +4 -3
- package/bin/release +5 -3
- package/contracts/plan.json +2 -2
- package/dist/bin/clidev.js +34 -12
- package/dist/bundle/all-profiles-XHC7BG3P.js +24 -0
- package/dist/bundle/anthropic-N6B3ZZHQ.js +70 -0
- package/dist/bundle/bun-HUJLS7KP.js +169 -0
- package/dist/bundle/bun-sqlite-OWFO2TVR.js +69 -0
- package/dist/bundle/chunk-222FANS2.js +161 -0
- package/dist/bundle/chunk-2CFBHYFA.js +884 -0
- package/dist/bundle/chunk-2KQZ24GI.js +82 -0
- package/dist/bundle/chunk-2TBVT4SZ.js +31 -0
- package/dist/bundle/chunk-437W3Z2M.js +76 -0
- package/dist/bundle/chunk-4QRLPOJ7.js +18 -0
- package/dist/bundle/chunk-54AJONOM.js +54 -0
- package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
- package/dist/bundle/chunk-6CBWO7OF.js +73 -0
- package/dist/bundle/chunk-75LVQQEK.js +35782 -0
- package/dist/bundle/chunk-7RB76E2L.js +264 -0
- package/dist/bundle/chunk-7RXBN7HP.js +63 -0
- package/dist/bundle/chunk-ABP7FDMJ.js +122 -0
- package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
- package/dist/bundle/chunk-AP7QKYBG.js +3531 -0
- package/dist/bundle/chunk-ASMH7JWZ.js +288 -0
- package/dist/bundle/chunk-B4EED2RF.js +100 -0
- package/dist/bundle/chunk-B4LM2B6F.js +1900 -0
- package/dist/bundle/chunk-BDSDQCV4.js +281 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DMCN22H6.js +35 -0
- package/dist/bundle/chunk-E42W72PQ.js +151 -0
- package/dist/bundle/chunk-EFHLQXG6.js +5104 -0
- package/dist/bundle/chunk-FIHDGZIB.js +34352 -0
- package/dist/bundle/chunk-FWVKHD2L.js +48 -0
- package/dist/bundle/chunk-FXS3X76A.js +193 -0
- package/dist/bundle/chunk-HTQTIKWP.js +928 -0
- package/dist/bundle/chunk-IJ3IA7EK.js +24 -0
- package/dist/bundle/chunk-JEBSORH7.js +3379 -0
- package/dist/bundle/chunk-JTTW5ZKF.js +45 -0
- package/dist/bundle/chunk-LSEF4QC3.js +3075 -0
- package/dist/bundle/chunk-LY7GS2YI.js +58 -0
- package/dist/bundle/chunk-MFS52LTZ.js +570 -0
- package/dist/bundle/chunk-MNSD5BX2.js +78 -0
- package/dist/bundle/chunk-MTGLJCAZ.js +24 -0
- package/dist/bundle/chunk-MZVV2JZT.js +744 -0
- package/dist/bundle/chunk-NE3NSB5O.js +8341 -0
- package/dist/bundle/chunk-NTLPDH76.js +440 -0
- package/dist/bundle/chunk-O3PBQVAB.js +447 -0
- package/dist/bundle/chunk-O5EHUB2V.js +2 -0
- package/dist/bundle/chunk-O5LMDQTO.js +82 -0
- package/dist/bundle/chunk-OPJ24VGH.js +1028 -0
- package/dist/bundle/chunk-OPPMGPFW.js +164 -0
- package/dist/bundle/chunk-QGNNMPUB.js +158 -0
- package/dist/bundle/chunk-QVJLOUQB.js +2 -0
- package/dist/bundle/chunk-S57AMKLX.js +6848 -0
- package/dist/bundle/chunk-TARN7CHN.js +215 -0
- package/dist/bundle/chunk-TJLGI3N6.js +1095 -0
- package/dist/bundle/chunk-VMTM46FH.js +7532 -0
- package/dist/bundle/chunk-W2IDKBNB.js +2315 -0
- package/dist/bundle/chunk-XFXBXQBS.js +630 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/clidev.js +22 -0
- package/dist/bundle/command-contract-PEM3S634.js +29 -0
- package/dist/bundle/dist-ESHIQU4M.js +7577 -0
- package/dist/bundle/echarts-2QGL2JP5.js +42501 -0
- package/dist/bundle/embed-HHAAGHA6.js +35 -0
- package/dist/bundle/embedder-W2OGVVYH.js +108 -0
- package/dist/bundle/first-run-WCJUDUBU.js +23 -0
- package/dist/bundle/first-screen-U4DFUKUC.js +27 -0
- package/dist/bundle/instructions-OTZHT6NV.js +9 -0
- package/dist/bundle/mcp-OQBZXELQ.js +165 -0
- package/dist/bundle/mcp-VVF6J7SQ.js +151 -0
- package/dist/bundle/mcp-Y7VCIZ2J.js +78 -0
- package/dist/bundle/node-P4E63KXA.js +2340 -0
- package/dist/bundle/node-SYD4GX5O.js +176 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-X2DGRFOZ.js +45 -0
- package/dist/bundle/oauth-42M34GQ5.js +17 -0
- package/dist/bundle/open-SWXRCDLN.js +19 -0
- package/dist/bundle/process-KAFGXZ7Q.js +91 -0
- package/dist/bundle/program-EHR4G7VN.js +16967 -0
- package/dist/bundle/prompt-ZQTMHRGX.js +12 -0
- package/dist/bundle/recognize-TTED4SE3.js +190 -0
- package/dist/bundle/remote-C37XJ4BP.js +26 -0
- package/dist/bundle/rerank-APFZAMQL.js +49 -0
- package/dist/bundle/serve-DDPIHDVZ.js +19 -0
- package/dist/bundle/server-L5GNG7KC.js +793 -0
- package/dist/bundle/server-LKVYA2AE.js +39 -0
- package/dist/bundle/state-WWPPHERF.js +33 -0
- package/dist/bundle/store-H6UIA4PK.js +120 -0
- package/dist/bundle/store-maintenance-command-EYBT64A2.js +40 -0
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +45 -30
- package/dist/commands/mcp.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/docs/commands.md +38 -22
- package/docs/dev/TESTING.md +14 -3
- package/docs/dev/reference-clis.md +17 -9
- package/docs/dev/skills/release/SKILL.md +9 -6
- package/docs/dev/skills/release/fresh-audit.md +4 -0
- package/docs/dev/test-matrix.md +10 -11
- package/docs/security.md +4 -0
- package/docs/usage.md +7 -6
- package/kit/dist/new.js +17 -2
- package/package.json +7 -5
- package/scripts/audit.sh +5 -3
- package/scripts/smoke-bundle.ts +63 -0
- package/scripts/test-matrix-untested.ts +4 -10
- package/scripts/version-level.test.ts +17 -1
- package/scripts/version-level.ts +35 -7
- package/skills/clidev-cli/SKILL.md +8 -0
- package/src/commands/mcp.ts +54 -33
- package/src/mcp-http.test.ts +20 -13
- package/src/mcp.test.ts +3 -3
- package/src/program.test.ts +8 -2
- package/src/roots.test.ts +2 -7
- package/src/version.ts +1 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
MAX_SECRET_INPUT,
|
|
5
|
+
bufferedInput,
|
|
6
|
+
inputPolicy
|
|
7
|
+
} from "./chunk-O5LMDQTO.js";
|
|
8
|
+
import {
|
|
9
|
+
CliError
|
|
10
|
+
} from "./chunk-EFHLQXG6.js";
|
|
11
|
+
import {
|
|
12
|
+
__name
|
|
13
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
14
|
+
|
|
15
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/terminal/prompt.js
|
|
16
|
+
import { createInterface } from "node:readline";
|
|
17
|
+
import { Writable } from "node:stream";
|
|
18
|
+
var readSecret = /* @__PURE__ */ __name(async (prompt, { input = process.stdin, output = process.stderr, echo = false, signal: givenSignal } = {}) => {
|
|
19
|
+
const policy = inputPolicy(input);
|
|
20
|
+
const signals = [givenSignal, policy.signal].filter((one) => one !== void 0);
|
|
21
|
+
const signal = signals.length ? AbortSignal.any(signals) : void 0;
|
|
22
|
+
const cancelled = /* @__PURE__ */ __name(() => new CliError("cancelled", "cancelled \u2014 nothing was stored"), "cancelled");
|
|
23
|
+
if (signal?.aborted)
|
|
24
|
+
throw cancelled();
|
|
25
|
+
if (input.isTTY && policy.noInput)
|
|
26
|
+
throw new CliError("validation_error", "interactive input is disabled \u2014 provide the input through a pipe", {
|
|
27
|
+
reason: "input.required"
|
|
28
|
+
});
|
|
29
|
+
if (!input.isTTY) {
|
|
30
|
+
return (await bufferedInput(input, {
|
|
31
|
+
maxBytes: Math.min(policy.maxBytes ?? MAX_SECRET_INPUT, MAX_SECRET_INPUT),
|
|
32
|
+
...signal ? { signal } : {}
|
|
33
|
+
})).toString("utf8").trim();
|
|
34
|
+
}
|
|
35
|
+
let muted = false;
|
|
36
|
+
const shim = new Writable({
|
|
37
|
+
write(chunk, _encoding, done) {
|
|
38
|
+
if (!muted)
|
|
39
|
+
output.write(chunk);
|
|
40
|
+
done();
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const reader = createInterface({ input, output: shim, terminal: true });
|
|
44
|
+
const abort = /* @__PURE__ */ __name(() => reader.close(), "abort");
|
|
45
|
+
let bytes = 0;
|
|
46
|
+
let inputFailure;
|
|
47
|
+
const data = /* @__PURE__ */ __name((chunk) => {
|
|
48
|
+
bytes += Buffer.byteLength(chunk);
|
|
49
|
+
if (bytes > Math.min(policy.maxBytes ?? MAX_SECRET_INPUT, MAX_SECRET_INPUT)) {
|
|
50
|
+
inputFailure = new CliError("validation_error", "secret input exceeds its byte limit", {
|
|
51
|
+
reason: "input.too-large",
|
|
52
|
+
retryable: false
|
|
53
|
+
});
|
|
54
|
+
reader.close();
|
|
55
|
+
}
|
|
56
|
+
}, "data");
|
|
57
|
+
const inputError = /* @__PURE__ */ __name((error) => {
|
|
58
|
+
inputFailure = error;
|
|
59
|
+
reader.close();
|
|
60
|
+
}, "inputError");
|
|
61
|
+
input.on("data", data).on("error", inputError);
|
|
62
|
+
try {
|
|
63
|
+
const answer = await new Promise((resolve, reject) => {
|
|
64
|
+
const cancel = /* @__PURE__ */ __name(() => reject(inputFailure ?? cancelled()), "cancel");
|
|
65
|
+
reader.once("SIGINT", cancel);
|
|
66
|
+
reader.once("close", cancel);
|
|
67
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
68
|
+
reader.question(prompt, resolve);
|
|
69
|
+
muted = !echo;
|
|
70
|
+
});
|
|
71
|
+
return answer.trim();
|
|
72
|
+
} finally {
|
|
73
|
+
input.off("data", data).off("error", inputError);
|
|
74
|
+
signal?.removeEventListener("abort", abort);
|
|
75
|
+
reader.close();
|
|
76
|
+
output.write("\n");
|
|
77
|
+
}
|
|
78
|
+
}, "readSecret");
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
readSecret
|
|
82
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
CliError,
|
|
5
|
+
finite,
|
|
6
|
+
getDotPath,
|
|
7
|
+
maxValue,
|
|
8
|
+
minValue,
|
|
9
|
+
number,
|
|
10
|
+
optional,
|
|
11
|
+
pipe,
|
|
12
|
+
safeParse
|
|
13
|
+
} from "./chunk-EFHLQXG6.js";
|
|
14
|
+
import {
|
|
15
|
+
__name
|
|
16
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
17
|
+
|
|
18
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/models/options.js
|
|
19
|
+
var checkedOptions = /* @__PURE__ */ __name((provider, schema, options) => {
|
|
20
|
+
const parsed = safeParse(schema, options);
|
|
21
|
+
if (!parsed.success) {
|
|
22
|
+
throw new CliError("validation_error", `${provider} option ${getDotPath(parsed.issues[0]) ?? "options"} is unknown or has the wrong type`);
|
|
23
|
+
}
|
|
24
|
+
return parsed.output;
|
|
25
|
+
}, "checkedOptions");
|
|
26
|
+
var range = /* @__PURE__ */ __name((min, max) => optional(pipe(number(), finite(), minValue(min), maxValue(max))), "range");
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
checkedOptions,
|
|
30
|
+
range
|
|
31
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
__name
|
|
5
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
6
|
+
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/mcp/stdio-wire.js
|
|
8
|
+
import { PassThrough, Writable } from "node:stream";
|
|
9
|
+
var lineReader = /* @__PURE__ */ __name((onMessage) => {
|
|
10
|
+
let rest = "";
|
|
11
|
+
return (chunk) => {
|
|
12
|
+
const lines = (rest + chunk.toString()).split("\n");
|
|
13
|
+
rest = lines.pop() ?? "";
|
|
14
|
+
for (const line of lines) {
|
|
15
|
+
try {
|
|
16
|
+
const message = JSON.parse(line);
|
|
17
|
+
if (message !== null && typeof message === "object")
|
|
18
|
+
onMessage(message);
|
|
19
|
+
} catch {
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}, "lineReader");
|
|
24
|
+
var answeredWire = /* @__PURE__ */ __name((source, sink) => {
|
|
25
|
+
const asked = /* @__PURE__ */ new Set();
|
|
26
|
+
let settle;
|
|
27
|
+
const input = new PassThrough();
|
|
28
|
+
const onData = lineReader(({ id, method }) => {
|
|
29
|
+
if (id !== void 0 && typeof method === "string")
|
|
30
|
+
asked.add(JSON.stringify(id));
|
|
31
|
+
});
|
|
32
|
+
const output = new Writable({
|
|
33
|
+
write: /* @__PURE__ */ __name((chunk, _encoding, done) => {
|
|
34
|
+
noteAnswer(chunk);
|
|
35
|
+
sink.write(chunk, done);
|
|
36
|
+
}, "write")
|
|
37
|
+
});
|
|
38
|
+
const noteAnswer = lineReader(({ id, method }) => {
|
|
39
|
+
if (id === void 0 || method !== void 0)
|
|
40
|
+
return;
|
|
41
|
+
asked.delete(JSON.stringify(id));
|
|
42
|
+
if (asked.size === 0)
|
|
43
|
+
settle?.();
|
|
44
|
+
});
|
|
45
|
+
const forward = /* @__PURE__ */ __name((chunk) => {
|
|
46
|
+
onData(chunk);
|
|
47
|
+
input.write(chunk);
|
|
48
|
+
}, "forward");
|
|
49
|
+
source.on("data", forward);
|
|
50
|
+
const ended = new Promise((resolve) => {
|
|
51
|
+
source.once("end", resolve);
|
|
52
|
+
source.once("close", resolve);
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
input,
|
|
56
|
+
output,
|
|
57
|
+
ended,
|
|
58
|
+
answered: /* @__PURE__ */ __name(() => new Promise((resolve) => {
|
|
59
|
+
if (asked.size === 0)
|
|
60
|
+
resolve();
|
|
61
|
+
else
|
|
62
|
+
settle = resolve;
|
|
63
|
+
}), "answered"),
|
|
64
|
+
/** Lets go of the real stdin, so it no longer holds the process open. */
|
|
65
|
+
release: /* @__PURE__ */ __name(() => {
|
|
66
|
+
source.off("data", forward);
|
|
67
|
+
if (source.listenerCount("data") === 0)
|
|
68
|
+
source.pause();
|
|
69
|
+
input.end();
|
|
70
|
+
}, "release")
|
|
71
|
+
};
|
|
72
|
+
}, "answeredWire");
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
answeredWire
|
|
76
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
resolvePaths
|
|
5
|
+
} from "./chunk-EFHLQXG6.js";
|
|
6
|
+
import {
|
|
7
|
+
__name
|
|
8
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
9
|
+
|
|
10
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/store/path.js
|
|
11
|
+
import { join } from "node:path";
|
|
12
|
+
var wirecatDirectory = /* @__PURE__ */ __name((env = process.env, platform) => resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env, ...platform ? { platform } : {} }).state, "wirecatDirectory");
|
|
13
|
+
var storePath = /* @__PURE__ */ __name((env = process.env) => env.MESSAGING_STORE ?? join(wirecatDirectory(env), "wirecat.db"), "storePath");
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
wirecatDirectory,
|
|
17
|
+
storePath
|
|
18
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
readSharedSection,
|
|
5
|
+
writeSharedSection
|
|
6
|
+
} from "./chunk-2CFBHYFA.js";
|
|
7
|
+
import {
|
|
8
|
+
CliError
|
|
9
|
+
} from "./chunk-EFHLQXG6.js";
|
|
10
|
+
import {
|
|
11
|
+
__name
|
|
12
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
13
|
+
|
|
14
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/cli/setup-answers.js
|
|
15
|
+
var PERMISSION_ANSWERS = ["readonly", "allow"];
|
|
16
|
+
var QUESTIONS = ["languages", "tools", "permissions"];
|
|
17
|
+
var SECTION = "setup";
|
|
18
|
+
var readSetupAnswers = /* @__PURE__ */ __name((path) => {
|
|
19
|
+
const section = readSharedSection(path, SECTION);
|
|
20
|
+
if (section === void 0)
|
|
21
|
+
return {};
|
|
22
|
+
const answers = section;
|
|
23
|
+
if (section === null || typeof section !== "object" || Array.isArray(section) || answers.languages !== void 0 && answers.languages !== true || answers.tools !== void 0 && answers.tools !== true || answers.permissions !== void 0 && !PERMISSION_ANSWERS.includes(answers.permissions))
|
|
24
|
+
throw new CliError("configuration_error", `${path}: ${SECTION} holds what setup asked \u2014 languages: true, tools: true, permissions: ${PERMISSION_ANSWERS.join(" | ")}`);
|
|
25
|
+
return answers;
|
|
26
|
+
}, "readSetupAnswers");
|
|
27
|
+
var unanswered = /* @__PURE__ */ __name((answers) => QUESTIONS.filter((question) => answers[question] === void 0), "unanswered");
|
|
28
|
+
var writeSetupAnswers = /* @__PURE__ */ __name((path, answers) => {
|
|
29
|
+
let kept = {};
|
|
30
|
+
try {
|
|
31
|
+
kept = readSetupAnswers(path);
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (!(error instanceof CliError) || !error.message.includes(`${SECTION} holds`))
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
writeSharedSection(path, SECTION, { ...kept, ...answers });
|
|
37
|
+
}, "writeSetupAnswers");
|
|
38
|
+
var permissionCeiling = /* @__PURE__ */ __name((path) => {
|
|
39
|
+
let answer;
|
|
40
|
+
try {
|
|
41
|
+
answer = readSetupAnswers(path).permissions;
|
|
42
|
+
} catch {
|
|
43
|
+
return "readonly";
|
|
44
|
+
}
|
|
45
|
+
return answer === "allow" ? void 0 : answer;
|
|
46
|
+
}, "permissionCeiling");
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
QUESTIONS,
|
|
50
|
+
readSetupAnswers,
|
|
51
|
+
unanswered,
|
|
52
|
+
writeSetupAnswers,
|
|
53
|
+
permissionCeiling
|
|
54
|
+
};
|