threadctx 0.4.0 → 0.4.1
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 +24 -4
- package/package.json +11 -3
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.4.
|
|
14742
|
+
var ENGINE_VERSION = "0.4.1";
|
|
14743
14743
|
var REGISTRY_VERSION = "2026.10.1";
|
|
14744
14744
|
|
|
14745
14745
|
// ../rules/dist/engine.js
|
|
@@ -15506,6 +15506,10 @@ function renderText(result, opts) {
|
|
|
15506
15506
|
if (tools.length) {
|
|
15507
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
15508
|
}
|
|
15509
|
+
if (opts.next?.length) {
|
|
15510
|
+
const width = Math.max(...opts.next.map(([cmd]) => cmd.length));
|
|
15511
|
+
out.push("", p.bold("Next"), ...opts.next.map(([cmd, why]) => ` ${p.cyan(cmd.padEnd(width))} ${p.dim(why)}`));
|
|
15512
|
+
}
|
|
15509
15513
|
for (const d of result.diagnostics) {
|
|
15510
15514
|
const tag = d.level === "error" ? p.red("error") : d.level === "warning" ? p.yellow("note") : p.dim("note");
|
|
15511
15515
|
out.push(`${tag} ${d.path ? `${d.path}${d.line ? `:${d.line}` : ""}: ` : ""}${d.message}`);
|
|
@@ -16164,7 +16168,7 @@ function planFixes(fs, findings, kinds = ["safe"]) {
|
|
|
16164
16168
|
}
|
|
16165
16169
|
|
|
16166
16170
|
// src/init.ts
|
|
16167
|
-
var ACTION_PIN = { sha: "
|
|
16171
|
+
var ACTION_PIN = { sha: "22e0830658b62f2ca8b8d41f7e4d9477d6942e62", tag: "v1.4.0" };
|
|
16168
16172
|
var CHECKOUT_PIN = { sha: "3d3c42e5aac5ba805825da76410c181273ba90b1", tag: "v7.0.1" };
|
|
16169
16173
|
var WORKFLOW_PATH = ".github/workflows/agent-context.yml";
|
|
16170
16174
|
function workflowYaml() {
|
|
@@ -16725,7 +16729,7 @@ async function main(argv, io) {
|
|
|
16725
16729
|
return 2;
|
|
16726
16730
|
}
|
|
16727
16731
|
io.stderr(`threadctx: unexpected error: ${e.stack ?? e}
|
|
16728
|
-
Please report
|
|
16732
|
+
Please report it at https://github.com/threadctx-dev/threadctx-cli/issues
|
|
16729
16733
|
`);
|
|
16730
16734
|
return 2;
|
|
16731
16735
|
}
|
|
@@ -16832,7 +16836,7 @@ async function cmdScan(pathArg, v, io, color) {
|
|
|
16832
16836
|
view = repo;
|
|
16833
16837
|
result = doScan(repo, v, io);
|
|
16834
16838
|
}
|
|
16835
|
-
const out = format === "json" ? renderJson(result) : format === "sarif" ? renderSarif(result) : format === "md" ? renderMarkdown(result) : renderText(result, { color: v.output ? false : color, verbose: Boolean(v.verbose) });
|
|
16839
|
+
const out = format === "json" ? renderJson(result) : format === "sarif" ? renderSarif(result) : format === "md" ? renderMarkdown(result) : renderText(result, { color: v.output ? false : color, verbose: Boolean(v.verbose), next: !v.output && !remoteLabel ? nextSteps(result, v, io) : void 0 });
|
|
16836
16840
|
if (v.output) {
|
|
16837
16841
|
const dest = resolve4(io.cwd, v.output);
|
|
16838
16842
|
mkdirSync3(dirname2(dest), { recursive: true });
|
|
@@ -17170,6 +17174,22 @@ function cmdPackValidate(file, io) {
|
|
|
17170
17174
|
`);
|
|
17171
17175
|
return 0;
|
|
17172
17176
|
}
|
|
17177
|
+
function nextSteps(result, v, io) {
|
|
17178
|
+
if (!io.isTTY || io.env.CI || io.env.THREADCTX_NO_UPSELL || io.env.THREADCTX_NO_HINTS) return void 0;
|
|
17179
|
+
const open = result.findings.filter((f) => !f.suppressed);
|
|
17180
|
+
const out = [];
|
|
17181
|
+
const hidden = v.verbose ? [] : open.filter((f) => f.severity === "info");
|
|
17182
|
+
if (hidden.length) {
|
|
17183
|
+
const byRule = /* @__PURE__ */ new Map();
|
|
17184
|
+
for (const f of hidden) byRule.set(f.ruleId, (byRule.get(f.ruleId) ?? 0) + 1);
|
|
17185
|
+
const top = [...byRule].sort((a, b) => b[1] - a[1]).slice(0, 2).map(([id, n2]) => `${RULES.find((r) => r.id === id)?.title ?? id}${n2 > 1 ? ` (${n2})` : ""}`);
|
|
17186
|
+
out.push(["threadctx scan --verbose", `${hidden.length} hidden info finding${hidden.length === 1 ? "" : "s"}: ${top.join("; ")}`]);
|
|
17187
|
+
}
|
|
17188
|
+
if (result.tools.some((t) => t.layers > 0)) out.push(["threadctx explain <file>", "which files each agent loads for that file, in order, with token estimates"]);
|
|
17189
|
+
const fixable = open.filter((f) => f.fix?.kind === "safe").length;
|
|
17190
|
+
if (fixable) out.push(["threadctx fix --pr", `${fixable} safe fix${fixable === 1 ? "" : "es"} in one pull request`]);
|
|
17191
|
+
return out.length ? out : void 0;
|
|
17192
|
+
}
|
|
17173
17193
|
var UPGRADE_URL = "https://threadctx.dev/pricing";
|
|
17174
17194
|
function maybeUpgradeLine(result, io, remote) {
|
|
17175
17195
|
if (!UPGRADE_URL || !io.isTTY || io.env.CI || io.env.THREADCTX_NO_UPSELL) return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "threadctx",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"mcpName": "io.github.threadctx-dev/threadctx",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -20,6 +20,14 @@
|
|
|
20
20
|
},
|
|
21
21
|
"description": "Your coding agents' instructions are stale and copied across tools. See what each agent is told, grade it, and fix it. Zero dependencies.",
|
|
22
22
|
"homepage": "https://threadctx.dev",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/threadctx-dev/threadctx-cli.git",
|
|
26
|
+
"directory": "packages/cli"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/threadctx-dev/threadctx-cli/issues"
|
|
30
|
+
},
|
|
23
31
|
"keywords": [
|
|
24
32
|
"agents",
|
|
25
33
|
"ai",
|
|
@@ -41,10 +49,10 @@
|
|
|
41
49
|
"devDependencies": {
|
|
42
50
|
"diff": "^9.0.0",
|
|
43
51
|
"@threadctx/core": "0.1.0",
|
|
52
|
+
"@threadctx/adapters": "0.1.0",
|
|
44
53
|
"@threadctx/rules": "0.1.0",
|
|
45
54
|
"@threadctx/discovery": "0.1.0",
|
|
46
|
-
"@threadctx/report": "0.1.0"
|
|
47
|
-
"@threadctx/adapters": "0.1.0"
|
|
55
|
+
"@threadctx/report": "0.1.0"
|
|
48
56
|
},
|
|
49
57
|
"scripts": {
|
|
50
58
|
"build": "tsc -b && node build.mjs"
|