codebase-snapshot 0.9.4 → 0.9.6
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 +84 -0
- package/README.md +4 -1
- package/dist/bin.js +594 -304
- package/dist/{chunk-FCWD4LY7.js → chunk-3KUL3QRH.js} +564 -318
- package/dist/{chunk-EWZYK3VX.js → chunk-ZKZOGGM3.js} +33 -7
- package/dist/cli.cjs +697 -411
- package/dist/cli.d.cts +7 -1
- package/dist/cli.d.ts +7 -1
- package/dist/cli.js +19 -6
- package/dist/index.cjs +570 -312
- package/dist/index.d.cts +54 -2
- package/dist/index.d.ts +54 -2
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +31 -4
- package/dist/mcp.d.cts +14 -1
- package/dist/mcp.d.ts +14 -1
- package/dist/mcp.js +2 -2
- package/docs/cli.md +29 -2
- package/docs/mcp.md +3 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GENERATOR_VERSION, MIN_MAX_PART_BYTES, SCHEMA_VERSION, GENERATOR_NAME, ARTIFACT_NAMES, PRESETS, generateSnapshot, validateSnapshot, explainPath, renderExplainText, describeManifestShapeProblem, loadConfigFileDetailed, parseByteSize, resolveConfig } from './chunk-
|
|
1
|
+
import { GENERATOR_VERSION, MIN_MAX_PART_BYTES, SCHEMA_VERSION, GENERATOR_NAME, ARTIFACT_NAMES, PRESETS, generateSnapshot, validateSnapshot, explainPath, renderExplainText, describeManifestShapeProblem, loadConfigFileDetailed, parseByteSize, resolveConfig } from './chunk-3KUL3QRH.js';
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import * as path2 from 'path';
|
|
4
4
|
|
|
@@ -238,6 +238,18 @@ function applyDefaults(schema, value) {
|
|
|
238
238
|
}
|
|
239
239
|
return out;
|
|
240
240
|
}
|
|
241
|
+
function coerceNumericStrings(schema, value) {
|
|
242
|
+
const out = { ...value };
|
|
243
|
+
for (const [key, propertySchema] of Object.entries(schema.properties)) {
|
|
244
|
+
const raw = out[key];
|
|
245
|
+
if (typeof raw !== "string") continue;
|
|
246
|
+
if (propertySchema.type !== "number" && propertySchema.type !== "integer") continue;
|
|
247
|
+
if (raw.trim().length === 0) continue;
|
|
248
|
+
const parsed = Number(raw);
|
|
249
|
+
if (Number.isFinite(parsed)) out[key] = parsed;
|
|
250
|
+
}
|
|
251
|
+
return out;
|
|
252
|
+
}
|
|
241
253
|
|
|
242
254
|
// src/mcp/server.ts
|
|
243
255
|
function capabilities() {
|
|
@@ -326,7 +338,8 @@ function createMcpServer(options) {
|
|
|
326
338
|
if (!isJsonObject(rawArguments)) {
|
|
327
339
|
return errorResponse(id, ERROR_CODES.invalidParams, '"arguments" must be a JSON object.');
|
|
328
340
|
}
|
|
329
|
-
const
|
|
341
|
+
const supplied = coerceNumericStrings(tool.inputSchema, rawArguments);
|
|
342
|
+
const problems = validateArguments(tool.inputSchema, supplied);
|
|
330
343
|
if (problems.length > 0) {
|
|
331
344
|
return ok(
|
|
332
345
|
id,
|
|
@@ -338,7 +351,7 @@ function createMcpServer(options) {
|
|
|
338
351
|
modern
|
|
339
352
|
);
|
|
340
353
|
}
|
|
341
|
-
const args = applyDefaults(tool.inputSchema,
|
|
354
|
+
const args = applyDefaults(tool.inputSchema, supplied);
|
|
342
355
|
let outcome;
|
|
343
356
|
try {
|
|
344
357
|
outcome = await tool.handler(args, options.context);
|
|
@@ -1445,6 +1458,7 @@ var VALIDATE_OPTIONS = [
|
|
|
1445
1458
|
"no-config",
|
|
1446
1459
|
"discovery",
|
|
1447
1460
|
"format",
|
|
1461
|
+
"no-update-check",
|
|
1448
1462
|
"mode",
|
|
1449
1463
|
"help",
|
|
1450
1464
|
"version"
|
|
@@ -1468,6 +1482,7 @@ var COMMAND_OPTION_SCOPE = {
|
|
|
1468
1482
|
"watch",
|
|
1469
1483
|
"autopilot",
|
|
1470
1484
|
"no-install",
|
|
1485
|
+
"no-update-check",
|
|
1471
1486
|
"help",
|
|
1472
1487
|
"version"
|
|
1473
1488
|
],
|
|
@@ -1483,6 +1498,7 @@ var COMMAND_OPTION_SCOPE = {
|
|
|
1483
1498
|
"skip-artifacts",
|
|
1484
1499
|
"only-artifacts",
|
|
1485
1500
|
"no-config",
|
|
1501
|
+
"no-update-check",
|
|
1486
1502
|
"format",
|
|
1487
1503
|
"mode",
|
|
1488
1504
|
"help",
|
|
@@ -1500,12 +1516,13 @@ var COMMAND_OPTION_SCOPE = {
|
|
|
1500
1516
|
"only-artifacts",
|
|
1501
1517
|
"no-config",
|
|
1502
1518
|
"discovery",
|
|
1519
|
+
"no-update-check",
|
|
1503
1520
|
"format",
|
|
1504
1521
|
"mode",
|
|
1505
1522
|
"help",
|
|
1506
1523
|
"version"
|
|
1507
1524
|
],
|
|
1508
|
-
diff: ["format", "mode", "no-config", "help", "version"],
|
|
1525
|
+
diff: ["format", "mode", "no-config", "no-update-check", "help", "version"],
|
|
1509
1526
|
describe: ["format", "mode", "help", "version"],
|
|
1510
1527
|
init: [
|
|
1511
1528
|
"cwd",
|
|
@@ -1520,6 +1537,7 @@ var COMMAND_OPTION_SCOPE = {
|
|
|
1520
1537
|
"yes",
|
|
1521
1538
|
"force",
|
|
1522
1539
|
"dry-run",
|
|
1540
|
+
"no-update-check",
|
|
1523
1541
|
"format",
|
|
1524
1542
|
"mode",
|
|
1525
1543
|
"help",
|
|
@@ -1543,6 +1561,7 @@ var COMMAND_OPTION_SCOPE = {
|
|
|
1543
1561
|
"force",
|
|
1544
1562
|
"no-install",
|
|
1545
1563
|
"dry-run",
|
|
1564
|
+
"no-update-check",
|
|
1546
1565
|
"format",
|
|
1547
1566
|
"mode",
|
|
1548
1567
|
"help",
|
|
@@ -1975,6 +1994,13 @@ function buildAgentContract() {
|
|
|
1975
1994
|
default: false,
|
|
1976
1995
|
appliesTo: optionAppliesTo("no-install"),
|
|
1977
1996
|
summary: "Skip installing the dependency before generating: `setup`, or `generate --autopilot` (CI, offline, or a lockfile you do not want a package manager to touch)."
|
|
1997
|
+
},
|
|
1998
|
+
{
|
|
1999
|
+
flag: "--no-update-check",
|
|
2000
|
+
type: "boolean",
|
|
2001
|
+
default: false,
|
|
2002
|
+
appliesTo: optionAppliesTo("no-update-check"),
|
|
2003
|
+
summary: "Skip the once-a-day check for a newer published version. The check is already skipped when stdout is not a terminal, in CI, in a JSON invocation, and in `mcp`, which makes no network requests."
|
|
1978
2004
|
}
|
|
1979
2005
|
],
|
|
1980
2006
|
presets: PRESETS.map((preset) => ({
|
|
@@ -2572,6 +2598,6 @@ async function runStdioServer(options) {
|
|
|
2572
2598
|
return code;
|
|
2573
2599
|
}
|
|
2574
2600
|
|
|
2575
|
-
export { COMMAND_OPTION_SCOPE, ERROR_CODES, LEGACY_PROTOCOL_VERSIONS, MAX_LINE_BYTES, METHOD, MODERN_PROTOCOL_VERSIONS, SERVER_INSTRUCTIONS, SKILL_NAME, SUPPORTED_PROTOCOL_VERSIONS, buildAgentContract, buildPrompts, buildResourceProvider, buildTools, classifyRequest, commandsForOption, createLineReader, createMcpServer, createServer, createSession, createWriter, inspectModernMeta, negotiateLegacyVersion, renderContractText, renderSkill, runStdioServer, validateArguments };
|
|
2576
|
-
//# sourceMappingURL=chunk-
|
|
2577
|
-
//# sourceMappingURL=chunk-
|
|
2601
|
+
export { COMMAND_OPTION_SCOPE, ERROR_CODES, LEGACY_PROTOCOL_VERSIONS, MAX_LINE_BYTES, METHOD, MODERN_PROTOCOL_VERSIONS, SERVER_INSTRUCTIONS, SKILL_NAME, SUPPORTED_PROTOCOL_VERSIONS, buildAgentContract, buildPrompts, buildResourceProvider, buildTools, classifyRequest, coerceNumericStrings, commandsForOption, createLineReader, createMcpServer, createServer, createSession, createWriter, inspectModernMeta, negotiateLegacyVersion, renderContractText, renderSkill, runStdioServer, validateArguments };
|
|
2602
|
+
//# sourceMappingURL=chunk-ZKZOGGM3.js.map
|
|
2603
|
+
//# sourceMappingURL=chunk-ZKZOGGM3.js.map
|