knodin 0.7.6 → 0.8.2
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/README.md +19 -7
- package/benchmarks/competitors/SYNTHESIS.md +66 -0
- package/dist/bin/cli.js +2164 -108
- package/dist/bin/launcher.js +25 -3
- package/dist/src/agent-integration.js +304 -0
- package/dist/src/artifact-refresh.js +82 -0
- package/dist/src/cli-args.js +292 -0
- package/dist/src/cli-model.js +384 -0
- package/dist/src/codeflow-replay.js +81 -0
- package/dist/src/compact-structural.js +96 -0
- package/dist/src/compare.js +39 -0
- package/dist/src/competitive-cold-mcp.js +40 -0
- package/dist/src/competitive-constraints.js +21 -0
- package/dist/src/competitive-manifest.js +411 -0
- package/dist/src/competitive-measurement.js +183 -0
- package/dist/src/competitive-runner.js +487 -0
- package/dist/src/competitive-sandbox.js +108 -0
- package/dist/src/context-export.js +423 -0
- package/dist/src/context.js +102 -0
- package/dist/src/deterministic-random.js +34 -0
- package/dist/src/diagnostics-write-helper.js +473 -0
- package/dist/src/diagnostics.js +1476 -0
- package/dist/src/docs-sections.js +141 -0
- package/dist/src/doctor.js +382 -0
- package/dist/src/engine/ann-hnsw.js +261 -0
- package/dist/src/engine/embeddings.js +193 -0
- package/dist/src/engine/file-walker.js +49 -0
- package/dist/src/engine/git-history.js +289 -0
- package/dist/src/engine/index.js +14238 -0
- package/dist/src/engine/perf.js +115 -0
- package/dist/src/engine/prune.js +112 -0
- package/dist/src/engine/sarif-import.js +341 -0
- package/dist/src/engine/scip-import.js +423 -0
- package/dist/src/engine/source-policy.js +85 -0
- package/dist/src/engine/sqlite.js +71 -0
- package/dist/src/engine/state-paths.js +175 -0
- package/dist/src/engine/symbol-delete.js +58 -0
- package/dist/src/execution-profile.js +208 -0
- package/dist/src/failure-diagnosis.js +655 -0
- package/dist/src/fleet.js +7 -0
- package/dist/src/git-executable.js +31 -0
- package/dist/src/graph-layout.js +173 -0
- package/dist/src/graph-query-health.js +115 -0
- package/dist/src/hook-manager-integration.js +156 -0
- package/dist/src/index-activity.js +126 -0
- package/dist/src/init-progress-worker.js +106 -2
- package/dist/src/init-progress.js +155 -0
- package/dist/src/init.js +1295 -0
- package/dist/src/lifecycle-health.js +282 -0
- package/dist/src/lsp-readonly.js +217 -0
- package/dist/src/mcp-graph-worker.js +69 -0
- package/dist/src/mcp-reliability.js +154 -0
- package/dist/src/mcp-worker-supervisor.js +350 -0
- package/dist/src/mirror.js +290 -0
- package/dist/src/node-runtime.js +157 -0
- package/dist/src/output-compression.js +630 -0
- package/dist/src/output-telemetry.js +368 -0
- package/dist/src/pr-triage.js +638 -0
- package/dist/src/progressive-evidence.js +477 -0
- package/dist/src/pure-compression-cli.js +102 -0
- package/dist/src/relationship-adapters.js +377 -0
- package/dist/src/release-attestation.js +533 -0
- package/dist/src/release-preflight.js +513 -0
- package/dist/src/repair-lease.js +85 -0
- package/dist/src/repair-progress-worker.js +120 -2
- package/dist/src/repair-progress.js +262 -0
- package/dist/src/repository-init-process.js +177 -0
- package/dist/src/repository-management.js +1261 -0
- package/dist/src/response-budget.js +196 -0
- package/dist/src/server.js +217 -0
- package/dist/src/structural-fast-path.js +344 -0
- package/dist/src/structural-snapshot.js +37 -0
- package/dist/src/system-config.js +638 -0
- package/dist/src/terminal-help.js +83 -0
- package/dist/src/tools/knodin-tools.js +1640 -0
- package/dist/src/update-ceremony.js +162 -0
- package/dist/src/update-policy.js +944 -0
- package/dist/src/update-trust.js +504 -0
- package/dist/src/version.js +13 -0
- package/dist/src/visualization.js +515 -0
- package/dist/src/wait-for-fresh.js +98 -0
- package/dist/src/worktree-lifecycle.js +234 -0
- package/docs/BEHAVIORAL-CONTRACT.md +72 -0
- package/docs/CLI.md +20 -1
- package/docs/COMPARISON.md +403 -0
- package/docs/COMPETITIVE-LANDSCAPE-2026-08.md +267 -0
- package/docs/CONTAINED-EXECUTION.md +77 -0
- package/docs/DIAGNOSTICS.md +80 -0
- package/docs/GIT-HISTORY-REVIEW.md +39 -0
- package/docs/HANDOFF.md +180 -0
- package/docs/INSTALLATION.md +21 -18
- package/docs/MCP.md +59 -8
- package/docs/PROGRESSIVE-EVIDENCE.md +37 -0
- package/docs/PT-ACCESS-RECOMMENDATION.md +89 -0
- package/docs/RELEASE-0.3-EVIDENCE.md +73 -0
- package/docs/REPOSITORIES-AND-WORKTREES.md +18 -6
- package/docs/SCIP-IMPORT.md +62 -0
- package/docs/SIGNED-UPDATES.md +151 -0
- package/docs/TELEMETRY.md +46 -0
- package/docs/TOKEN-OPTIMIZER-SCORECARD.md +79 -0
- package/docs/assets/knodin-favicon.svg +4 -0
- package/docs/releases/0.3.0.md +46 -0
- package/docs/releases/0.4.0.md +68 -0
- package/docs/releases/0.4.1.md +28 -0
- package/docs/releases/0.4.2.md +27 -0
- package/docs/releases/0.4.3.md +23 -0
- package/docs/releases/0.5.0.md +29 -0
- package/docs/releases/0.5.1.md +17 -0
- package/docs/releases/0.6.0.md +18 -0
- package/docs/releases/0.7.0.md +24 -0
- package/docs/releases/0.7.1.md +21 -0
- package/docs/releases/0.7.2.md +21 -0
- package/docs/releases/0.7.3.md +23 -0
- package/docs/releases/0.7.4.md +17 -0
- package/docs/releases/0.7.5.md +20 -0
- package/docs/releases/0.8.0.md +74 -0
- package/docs/releases/0.8.2.md +34 -0
- package/package.json +127 -4
- package/roadmap/competitive-roadmap.md +3801 -0
- package/schemas/release-attestation-v1.schema.json +210 -0
- package/schemas/support-bundle-v2.schema.json +212 -0
- package/dist/chunks/chunk-DMQAGX77.js +0 -654
- package/dist/chunks/chunk-F4Z3Z766.js +0 -4
- package/dist/chunks/chunk-SIJAQVSX.js +0 -3
- package/dist/chunks/chunk-X6M4HUUE.js +0 -2
- package/dist/chunks/chunk-YPRMY2LP.js +0 -8
- package/dist/chunks/pure-compression-cli-4TA2TQD5.js +0 -5
- package/dist/chunks/server-7EDF4CBY.js +0 -14
- package/dist/chunks/structural-fast-path-KD5KQSPX.js +0 -4
- package/docs/releases/0.7.6.md +0 -25
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const DEFAULT_HELP_WIDTH = 100;
|
|
2
|
+
const MIN_HELP_WIDTH = 60;
|
|
3
|
+
function leadingWidth(line) {
|
|
4
|
+
return line.length - line.trimStart().length;
|
|
5
|
+
}
|
|
6
|
+
function logicalLines(template) {
|
|
7
|
+
const logical = [];
|
|
8
|
+
let current = null;
|
|
9
|
+
for (const raw of template.replaceAll("\t", " ").split("\n")) {
|
|
10
|
+
if (raw.trim() === "") {
|
|
11
|
+
if (current)
|
|
12
|
+
logical.push(current);
|
|
13
|
+
current = null;
|
|
14
|
+
logical.push(null);
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
if (current && leadingWidth(raw) >= 4) {
|
|
18
|
+
current.continuations.push(raw);
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (current)
|
|
22
|
+
logical.push(current);
|
|
23
|
+
current = { first: raw.trimEnd(), continuations: [] };
|
|
24
|
+
}
|
|
25
|
+
if (current)
|
|
26
|
+
logical.push(current);
|
|
27
|
+
return logical;
|
|
28
|
+
}
|
|
29
|
+
function wrapWords(text, firstPrefix, continuationPrefix, width) {
|
|
30
|
+
const words = text.trim().split(/\s+/);
|
|
31
|
+
const lines = [];
|
|
32
|
+
let line = firstPrefix;
|
|
33
|
+
for (const word of words) {
|
|
34
|
+
const separator = line.trim().length > 0 ? " " : "";
|
|
35
|
+
if (line.length + separator.length + word.length > width && line.trim().length > 0) {
|
|
36
|
+
lines.push(line.trimEnd());
|
|
37
|
+
line = `${continuationPrefix}${word}`;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
line += `${separator}${word}`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (line.trim().length > 0)
|
|
44
|
+
lines.push(line.trimEnd());
|
|
45
|
+
return lines;
|
|
46
|
+
}
|
|
47
|
+
function renderLogicalLine(line, width) {
|
|
48
|
+
const firstIndent = " ".repeat(leadingWidth(line.first));
|
|
49
|
+
const firstText = line.first.trim();
|
|
50
|
+
if (line.continuations.length === 0 && line.first.length <= width)
|
|
51
|
+
return [line.first];
|
|
52
|
+
const continuationColumn = line.continuations.length > 0
|
|
53
|
+
? Math.min(...line.continuations.map(leadingWidth))
|
|
54
|
+
: leadingWidth(line.first);
|
|
55
|
+
const joined = [firstText, ...line.continuations.map((value) => value.trim())].join(" ");
|
|
56
|
+
if (line.continuations.length > 0 && firstIndent.length + firstText.length > width * 0.55) {
|
|
57
|
+
return wrapWords(joined, firstIndent, `${firstIndent} `, width);
|
|
58
|
+
}
|
|
59
|
+
const separator = /\s{2,}/.exec(firstText);
|
|
60
|
+
if (separator?.index !== undefined) {
|
|
61
|
+
const left = firstText.slice(0, separator.index).trimEnd();
|
|
62
|
+
const description = joined.slice(separator.index + separator[0].length).trim();
|
|
63
|
+
const descriptionColumn = Math.max(firstIndent.length + left.length + 2, continuationColumn);
|
|
64
|
+
return wrapWords(description, `${firstIndent}${left}${" ".repeat(Math.max(2, descriptionColumn - firstIndent.length - left.length))}`, " ".repeat(descriptionColumn), width);
|
|
65
|
+
}
|
|
66
|
+
if (line.continuations.length > 0) {
|
|
67
|
+
const commandWidth = firstIndent.length + firstText.length;
|
|
68
|
+
const descriptionColumn = Math.max(commandWidth + 2, continuationColumn);
|
|
69
|
+
const description = line.continuations.map((value) => value.trim()).join(" ");
|
|
70
|
+
return wrapWords(description, `${firstIndent}${firstText}${" ".repeat(Math.max(2, descriptionColumn - commandWidth))}`, " ".repeat(descriptionColumn), width);
|
|
71
|
+
}
|
|
72
|
+
return wrapWords(firstText, firstIndent, firstIndent, width);
|
|
73
|
+
}
|
|
74
|
+
/** Reflow authored help to the active TTY, with a deterministic width for piped output. */
|
|
75
|
+
export function formatTerminalHelp(template, columns) {
|
|
76
|
+
const width = columns === undefined || !Number.isFinite(columns)
|
|
77
|
+
? DEFAULT_HELP_WIDTH
|
|
78
|
+
: Math.max(MIN_HELP_WIDTH, Math.floor(columns) - 1);
|
|
79
|
+
const rendered = logicalLines(template).flatMap((line) => line === null ? [""] : renderLogicalLine(line, width));
|
|
80
|
+
while (rendered.at(-1) === "")
|
|
81
|
+
rendered.pop();
|
|
82
|
+
return `${rendered.join("\n")}\n`;
|
|
83
|
+
}
|