Skip to content

Commit 8844ae2

Browse files
Shahinyanmclaude
andcommitted
feat(plugin): add npm wrapper + mcpServers config for plugin distribution
Adds package.json with postinstall script that installs Rust binaries via cargo install. Updates plugin.json and marketplace.json with mcpServers configuration so Claude Code auto-starts task-journal-mcp. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e0d10b1 commit 8844ae2

4 files changed

Lines changed: 145 additions & 9 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
11
{
2-
"name": "claude-memory",
3-
"description": "Task Journal plugin: append-only reasoning chain memory for AI-coding tasks",
2+
"name": "task-journal",
43
"owner": {
5-
"name": "Mher Shahinyan"
4+
"name": "Digital-Threads",
5+
"email": "shahinyanm@gmail.com"
6+
},
7+
"metadata": {
8+
"description": "Task Journal — append-only reasoning chain memory for AI-coding tasks",
9+
"version": "0.1.1"
610
},
711
"plugins": [
812
{
913
"name": "task-journal",
10-
"description": "Append-only journal of AI-coding task reasoning chains. Captures hypotheses, decisions, rejections, evidence — and renders compact resume packs so an agent can pick up a 2-week-old task with full context.",
11-
"version": "0.1.0",
1214
"source": "./plugin",
15+
"description": "Append-only journal of AI-coding task reasoning chains. Captures hypotheses, decisions, rejections, evidence — renders compact resume packs so an agent can pick up a 2-week-old task with full context.",
16+
"version": "0.1.1",
1317
"author": {
14-
"name": "Mher Shahinyan"
15-
}
18+
"name": "Digital-Threads"
19+
},
20+
"category": "development",
21+
"keywords": [
22+
"mcp",
23+
"task-journal",
24+
"memory",
25+
"ai-coding",
26+
"reasoning",
27+
"context-recovery"
28+
]
1629
}
1730
]
1831
}

plugin/.claude-plugin/plugin.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "task-journal",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Append-only journal of AI-coding task reasoning chains: hypotheses, decisions, rejections, evidence. Renders compact resume packs so an agent can pick up a 2-week-old task with full context.",
55
"author": {
66
"name": "Mher Shahinyan"
@@ -12,5 +12,10 @@
1212
"reasoning",
1313
"ai-coding",
1414
"mcp"
15-
]
15+
],
16+
"mcpServers": {
17+
"task-journal": {
18+
"command": "task-journal-mcp"
19+
}
20+
}
1621
}

plugin/package.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "task-journal",
3+
"version": "0.1.1",
4+
"description": "Append-only journal of AI-coding task reasoning chains. Captures hypotheses, decisions, rejections, evidence — renders compact resume packs so an agent can pick up a 2-week-old task with full context.",
5+
"author": {
6+
"name": "Mher Shahinyan",
7+
"email": "shahinyanm@gmail.com"
8+
},
9+
"homepage": "https://github.com/Digital-Threads/Task-Journal#readme",
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/Digital-Threads/Task-Journal.git"
13+
},
14+
"bugs": {
15+
"url": "https://github.com/Digital-Threads/Task-Journal/issues"
16+
},
17+
"license": "MIT",
18+
"keywords": [
19+
"mcp",
20+
"mcp-server",
21+
"claude",
22+
"claude-code",
23+
"task-journal",
24+
"memory",
25+
"reasoning",
26+
"ai-coding",
27+
"append-only",
28+
"context-recovery",
29+
"developer-tools"
30+
],
31+
"mcpServers": {
32+
"task-journal": {
33+
"command": "task-journal-mcp"
34+
}
35+
},
36+
"files": [
37+
".claude-plugin/",
38+
"commands/",
39+
"skills/",
40+
"scripts/",
41+
"README.md"
42+
],
43+
"scripts": {
44+
"postinstall": "node scripts/postinstall.mjs"
45+
},
46+
"engines": {
47+
"node": ">=18.0.0"
48+
}
49+
}

plugin/scripts/postinstall.mjs

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env node
2+
3+
/**
4+
* postinstall — ensures the Rust binaries (task-journal-cli, task-journal-mcp)
5+
* are available. If not found in PATH, installs them via `cargo install`.
6+
*/
7+
8+
import { execSync } from "node:child_process";
9+
10+
function binExists(name) {
11+
try {
12+
execSync(`which ${name} 2>/dev/null || where ${name} 2>nul`, {
13+
stdio: "pipe",
14+
});
15+
return true;
16+
} catch {
17+
return false;
18+
}
19+
}
20+
21+
const bins = [
22+
{ crate: "task-journal-cli", bin: "task-journal" },
23+
{ crate: "task-journal-mcp", bin: "task-journal-mcp" },
24+
];
25+
26+
const missing = bins.filter((b) => !binExists(b.bin));
27+
28+
if (missing.length === 0) {
29+
console.log("✓ task-journal binaries already installed");
30+
process.exit(0);
31+
}
32+
33+
// Check if cargo is available
34+
try {
35+
execSync("cargo --version", { stdio: "pipe" });
36+
} catch {
37+
console.error(
38+
[
39+
"",
40+
"╔══════════════════════════════════════════════════════════════╗",
41+
"║ task-journal requires Rust toolchain (cargo) to install ║",
42+
"║ the MCP server and CLI binaries. ║",
43+
"║ ║",
44+
"║ Install Rust: https://rustup.rs ║",
45+
"║ ║",
46+
"║ Then run: ║",
47+
"║ cargo install task-journal-cli task-journal-mcp ║",
48+
"╚══════════════════════════════════════════════════════════════╝",
49+
"",
50+
].join("\n")
51+
);
52+
// Don't fail the npm install — the plugin structure is still valid,
53+
// the user just needs to install binaries manually.
54+
process.exit(0);
55+
}
56+
57+
const crates = missing.map((b) => b.crate).join(" ");
58+
console.log(`Installing ${crates} from crates.io...`);
59+
60+
try {
61+
execSync(`cargo install ${crates}`, { stdio: "inherit" });
62+
console.log("✓ task-journal binaries installed successfully");
63+
} catch (err) {
64+
console.error(
65+
`\n⚠ Failed to install binaries. Run manually:\n cargo install ${crates}\n`
66+
);
67+
// Non-fatal — don't break npm install
68+
process.exit(0);
69+
}

0 commit comments

Comments
 (0)