@canonmsg/claude-code-plugin 0.19.0 → 0.19.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/approval-diff.js +5 -3
- package/package.json +5 -5
package/dist/approval-diff.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isAbsolute, join, relative } from 'node:path';
|
|
2
|
-
import { truncateUnifiedDiff, } from '@canonmsg/core';
|
|
2
|
+
import { sanitizeUnifiedDiffForSharing, truncateUnifiedDiff, } from '@canonmsg/core';
|
|
3
3
|
/** Unified-hunk context lines on either side of a change (git default). */
|
|
4
4
|
const HUNK_CONTEXT_LINES = 3;
|
|
5
5
|
/**
|
|
@@ -68,7 +68,9 @@ export async function synthesizeClaudeApprovalDiff(toolName, toolInput, options)
|
|
|
68
68
|
const hunks = buildUnifiedHunks(oldText, postImage);
|
|
69
69
|
if (!hunks)
|
|
70
70
|
return undefined;
|
|
71
|
-
|
|
71
|
+
// Sanitize before truncating so byte budgets are spent on hunks that ship —
|
|
72
|
+
// secret-bearing paths and private-key blocks lose their hunk text here.
|
|
73
|
+
return truncateUnifiedDiff(sanitizeUnifiedDiffForSharing({
|
|
72
74
|
files: [{
|
|
73
75
|
path: toDisplayPath(resolvedPath, options.cwd),
|
|
74
76
|
status,
|
|
@@ -76,7 +78,7 @@ export async function synthesizeClaudeApprovalDiff(toolName, toolInput, options)
|
|
|
76
78
|
additions: hunks.additions,
|
|
77
79
|
deletions: hunks.deletions,
|
|
78
80
|
}],
|
|
79
|
-
});
|
|
81
|
+
}));
|
|
80
82
|
}
|
|
81
83
|
// ── Edit splicing ────────────────────────────────────────────────────
|
|
82
84
|
function parseSingleEdit(toolInput) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonmsg/claude-code-plugin",
|
|
3
|
-
"version": "0.19.
|
|
4
|
-
"description": "Canon channel plugin for Claude Code
|
|
3
|
+
"version": "0.19.1",
|
|
4
|
+
"description": "Canon channel plugin for Claude Code \u2014 messaging where AI agents are first-class citizens",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
".claude-plugin"
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
|
-
"prepare:workspace-deps": "
|
|
26
|
+
"prepare:workspace-deps": "node ../../scripts/run-workspace-prep.mjs ../core ../agent-sdk",
|
|
27
27
|
"build": "npm run prepare:workspace-deps && node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
|
|
28
28
|
"dev": "npm run prepare:workspace-deps && tsc --watch",
|
|
29
29
|
"prepack": "npm run build",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@anthropic-ai/claude-agent-sdk": "^0.2.141",
|
|
34
|
-
"@canonmsg/agent-sdk": "^3.2.
|
|
35
|
-
"@canonmsg/core": "^2.
|
|
34
|
+
"@canonmsg/agent-sdk": "^3.2.3",
|
|
35
|
+
"@canonmsg/core": "^2.6.0",
|
|
36
36
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
37
37
|
"zod": "^4.0.0"
|
|
38
38
|
},
|