threadctx 0.4.1 → 0.5.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/dist/threadctx.mjs +30 -9
- package/package.json +15 -7
package/dist/threadctx.mjs
CHANGED
|
@@ -14739,7 +14739,7 @@ function applySuppressions(findings, inline, config, now, diagnostics) {
|
|
|
14739
14739
|
}
|
|
14740
14740
|
|
|
14741
14741
|
// ../rules/dist/version.js
|
|
14742
|
-
var ENGINE_VERSION = "0.
|
|
14742
|
+
var ENGINE_VERSION = "0.5.0";
|
|
14743
14743
|
var REGISTRY_VERSION = "2026.10.1";
|
|
14744
14744
|
|
|
14745
14745
|
// ../rules/dist/engine.js
|
|
@@ -14910,7 +14910,7 @@ function scan(fs, opts = {}) {
|
|
|
14910
14910
|
findings: unique,
|
|
14911
14911
|
diagnostics,
|
|
14912
14912
|
artifacts: artifacts.map((a) => ({ path: a.artifact.path, tool: a.artifact.tool, kind: a.artifact.kind, tokenEstimate: a.artifact.tokenEstimate, contentHash: a.artifact.contentHash, origin: a.artifact.origin })),
|
|
14913
|
-
tools: ADAPTERS.map((a, i) => ({ id: a.id, label: a.label, status: a.status, verified: a.verifiedAgainst.date, alwaysTokenEstimate: state.rootContexts[i].alwaysTokenEstimate, layers: state.rootContexts[i].layers.length })),
|
|
14913
|
+
tools: ADAPTERS.map((a, i) => ({ id: a.id, label: a.label, status: a.status, verified: a.verifiedAgainst.date, alwaysTokenEstimate: state.rootContexts[i].alwaysTokenEstimate, layers: state.rootContexts[i].layers.length, alwaysLoaded: [...new Set(state.rootContexts[i].layers.filter((l) => l.loading === "always").map((l) => l.path))] })),
|
|
14914
14914
|
mcpServers: state.mcp.map((s) => ({ client: s.client, name: s.name, source: s.sourcePath, transport: s.transport })),
|
|
14915
14915
|
rules: [...metas.values()].filter((m) => checks.some((c) => c.meta.id === m.id)),
|
|
14916
14916
|
facts: statedFacts(ctx)
|
|
@@ -15477,6 +15477,27 @@ function painter(color) {
|
|
|
15477
15477
|
return { red: wrap("31"), yellow: wrap("33"), blue: wrap("34"), green: wrap("32"), dim: wrap("2"), bold: wrap("1"), cyan: wrap("36") };
|
|
15478
15478
|
}
|
|
15479
15479
|
var GRADE_COLOR = { A: "green", B: "green", C: "yellow", D: "yellow", F: "red" };
|
|
15480
|
+
var SHORT_LABEL = { "agents-md": "Codex / AGENTS.md" };
|
|
15481
|
+
function renderAgentMap(result, p) {
|
|
15482
|
+
const tools = result.tools;
|
|
15483
|
+
if (!tools.some((t) => t.layers > 0))
|
|
15484
|
+
return [];
|
|
15485
|
+
const label2 = (t) => SHORT_LABEL[t.id] ?? t.label.split(" (")[0];
|
|
15486
|
+
const width = Math.max(...tools.map((t) => label2(t).length));
|
|
15487
|
+
const sharedExists = result.artifacts.some((a) => a.path === "AGENTS.md");
|
|
15488
|
+
const lines = ["", p.bold("What each agent loads at session start")];
|
|
15489
|
+
for (const t of tools) {
|
|
15490
|
+
const files = t.alwaysLoaded ?? [];
|
|
15491
|
+
const name = label2(t).padEnd(width);
|
|
15492
|
+
if (!files.length) {
|
|
15493
|
+
lines.push(` ${name} ${p.dim("nothing: this agent starts with no repository instructions")}`);
|
|
15494
|
+
continue;
|
|
15495
|
+
}
|
|
15496
|
+
const missesShared = sharedExists && t.id !== "agents-md" && !files.includes("AGENTS.md");
|
|
15497
|
+
lines.push(` ${name} ${files.join(" \u2192 ")} ${p.dim(`\u2248${t.alwaysTokenEstimate.toLocaleString("en-US")} tokens`)}` + (missesShared ? ` ${p.yellow("does not see AGENTS.md")}` : ""));
|
|
15498
|
+
}
|
|
15499
|
+
return lines;
|
|
15500
|
+
}
|
|
15480
15501
|
function renderText(result, opts) {
|
|
15481
15502
|
const p = painter(opts.color);
|
|
15482
15503
|
const out = [];
|
|
@@ -15502,10 +15523,7 @@ function renderText(result, opts) {
|
|
|
15502
15523
|
const fixable = open.filter((f) => f.fix?.kind === "safe").length;
|
|
15503
15524
|
if (fixable)
|
|
15504
15525
|
out.push(p.dim(`${fixable} finding${fixable === 1 ? "" : "s"} can be fixed automatically: threadctx fix`));
|
|
15505
|
-
|
|
15506
|
-
if (tools.length) {
|
|
15507
|
-
out.push(p.dim(`Always-loaded context (estimated tokens): ${tools.map((t) => `${t.label.split(" (")[0]} \u2248${t.alwaysTokenEstimate.toLocaleString("en-US")}`).join(" \xB7 ")}`));
|
|
15508
|
-
}
|
|
15526
|
+
out.push(...renderAgentMap(result, p));
|
|
15509
15527
|
if (opts.next?.length) {
|
|
15510
15528
|
const width = Math.max(...opts.next.map(([cmd]) => cmd.length));
|
|
15511
15529
|
out.push("", p.bold("Next"), ...opts.next.map(([cmd, why]) => ` ${p.cyan(cmd.padEnd(width))} ${p.dim(why)}`));
|
|
@@ -16168,7 +16186,7 @@ function planFixes(fs, findings, kinds = ["safe"]) {
|
|
|
16168
16186
|
}
|
|
16169
16187
|
|
|
16170
16188
|
// src/init.ts
|
|
16171
|
-
var ACTION_PIN = { sha: "
|
|
16189
|
+
var ACTION_PIN = { sha: "0fcf8348d004ae084b5e557dddd381da25a6db6a", tag: "v1.4.1" };
|
|
16172
16190
|
var CHECKOUT_PIN = { sha: "3d3c42e5aac5ba805825da76410c181273ba90b1", tag: "v7.0.1" };
|
|
16173
16191
|
var WORKFLOW_PATH = ".github/workflows/agent-context.yml";
|
|
16174
16192
|
function workflowYaml() {
|
|
@@ -16354,8 +16372,11 @@ function summarize(result) {
|
|
|
16354
16372
|
const lines = [`Grade ${result.grade} (${result.score}/100): ${result.counts.blocker} blockers, ${result.counts.warning} warnings, ${result.counts.info} info.`];
|
|
16355
16373
|
for (const f of open.slice(0, 25)) lines.push(`- ${f.severity} ${f.ruleId} ${f.path || "."}${f.line ? `:${f.line}` : ""}: ${f.message}${f.fix?.kind === "safe" ? " (fixable: threadctx fix)" : ""}`);
|
|
16356
16374
|
if (open.length > 25) lines.push(`\u2026and ${open.length - 25} more.`);
|
|
16357
|
-
const loaded = result.tools.filter((t) => t.layers > 0)
|
|
16358
|
-
if (loaded.length)
|
|
16375
|
+
const loaded = result.tools.filter((t) => t.layers > 0);
|
|
16376
|
+
if (loaded.length) {
|
|
16377
|
+
lines.push("Loaded at session start (estimates):");
|
|
16378
|
+
for (const t of result.tools) lines.push(`- ${t.label.split(" (")[0]}: ${t.alwaysLoaded.length ? `${t.alwaysLoaded.join(" \u2192 ")} (\u2248${t.alwaysTokenEstimate} tokens)` : "nothing"}`);
|
|
16379
|
+
}
|
|
16359
16380
|
return lines.join("\n");
|
|
16360
16381
|
}
|
|
16361
16382
|
function callTool(name, args, root) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "threadctx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"mcpName": "io.github.threadctx-dev/threadctx",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"threadctx": "dist/threadctx.mjs",
|
|
19
19
|
"ctx": "dist/threadctx.mjs"
|
|
20
20
|
},
|
|
21
|
-
"description": "
|
|
21
|
+
"description": "See exactly what each coding agent is told. Maps which AGENTS.md, CLAUDE.md, Cursor, Copilot and Gemini files every agent loads, flags stale paths, duplication and unpinned MCP servers, and fixes the mechanical ones. Offline, zero dependencies.",
|
|
22
22
|
"homepage": "https://threadctx.dev",
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
@@ -39,7 +39,15 @@
|
|
|
39
39
|
"context",
|
|
40
40
|
"lint",
|
|
41
41
|
"mcp",
|
|
42
|
-
"sarif"
|
|
42
|
+
"sarif",
|
|
43
|
+
"claude-md",
|
|
44
|
+
"cursor-rules",
|
|
45
|
+
"copilot-instructions",
|
|
46
|
+
"codex",
|
|
47
|
+
"linter",
|
|
48
|
+
"ai-agents",
|
|
49
|
+
"mcp-server",
|
|
50
|
+
"context-engineering"
|
|
43
51
|
],
|
|
44
52
|
"author": "threadctx",
|
|
45
53
|
"publishConfig": {
|
|
@@ -48,11 +56,11 @@
|
|
|
48
56
|
"dependencies": {},
|
|
49
57
|
"devDependencies": {
|
|
50
58
|
"diff": "^9.0.0",
|
|
51
|
-
"@threadctx/
|
|
52
|
-
"@threadctx/adapters": "0.1.0",
|
|
59
|
+
"@threadctx/report": "0.1.0",
|
|
53
60
|
"@threadctx/rules": "0.1.0",
|
|
54
|
-
"@threadctx/
|
|
55
|
-
"@threadctx/
|
|
61
|
+
"@threadctx/adapters": "0.1.0",
|
|
62
|
+
"@threadctx/core": "0.1.0",
|
|
63
|
+
"@threadctx/discovery": "0.1.0"
|
|
56
64
|
},
|
|
57
65
|
"scripts": {
|
|
58
66
|
"build": "tsc -b && node build.mjs"
|