structurecc 3.0.1 → 3.1.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/install.js +22 -24
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -4,17 +4,8 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const os = require('os');
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
// Files to copy
|
|
11
|
-
const FILES = [
|
|
12
|
-
'.claude-plugin/plugin.json',
|
|
13
|
-
'commands/structure.md',
|
|
14
|
-
'commands/structure-batch.md',
|
|
15
|
-
'prompts/chunk-extractor.md',
|
|
16
|
-
'README.md'
|
|
17
|
-
];
|
|
7
|
+
const CLAUDE_DIR = path.join(os.homedir(), '.claude');
|
|
8
|
+
const COMMANDS_DIR = path.join(CLAUDE_DIR, 'commands');
|
|
18
9
|
|
|
19
10
|
function copyFile(src, dest) {
|
|
20
11
|
const destDir = path.dirname(dest);
|
|
@@ -31,39 +22,44 @@ function install() {
|
|
|
31
22
|
║ STRUCTURECC ║
|
|
32
23
|
║ Document Structure Extraction ║
|
|
33
24
|
║ ║
|
|
34
|
-
║ Claude Code Plugin | v3.
|
|
25
|
+
║ Claude Code Plugin | v3.1 ║
|
|
35
26
|
║ ║
|
|
36
27
|
╚═══════════════════════════════════════════════════╝
|
|
37
28
|
`);
|
|
38
29
|
|
|
39
30
|
const sourceDir = __dirname;
|
|
40
31
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (!fs.existsSync(DEST_DIR)) {
|
|
45
|
-
fs.mkdirSync(DEST_DIR, { recursive: true });
|
|
32
|
+
// Ensure commands directory exists
|
|
33
|
+
if (!fs.existsSync(COMMANDS_DIR)) {
|
|
34
|
+
fs.mkdirSync(COMMANDS_DIR, { recursive: true });
|
|
46
35
|
}
|
|
47
36
|
|
|
48
|
-
|
|
37
|
+
console.log(`Installing to: ${COMMANDS_DIR}\n`);
|
|
38
|
+
|
|
39
|
+
// Copy command files to ~/.claude/commands/
|
|
40
|
+
const commands = [
|
|
41
|
+
{ src: 'commands/structure.md', dest: 'structure.md' },
|
|
42
|
+
{ src: 'commands/structure-batch.md', dest: 'structure-batch.md' }
|
|
43
|
+
];
|
|
44
|
+
|
|
49
45
|
let copied = 0;
|
|
50
|
-
for (const
|
|
51
|
-
const src = path.join(sourceDir,
|
|
52
|
-
const dest = path.join(
|
|
46
|
+
for (const cmd of commands) {
|
|
47
|
+
const src = path.join(sourceDir, cmd.src);
|
|
48
|
+
const dest = path.join(COMMANDS_DIR, cmd.dest);
|
|
53
49
|
|
|
54
50
|
if (fs.existsSync(src)) {
|
|
55
51
|
copyFile(src, dest);
|
|
56
|
-
console.log(` ✓ ${
|
|
52
|
+
console.log(` ✓ ${cmd.dest}`);
|
|
57
53
|
copied++;
|
|
58
54
|
} else {
|
|
59
|
-
console.log(` ✗ ${
|
|
55
|
+
console.log(` ✗ ${cmd.dest} (source not found)`);
|
|
60
56
|
}
|
|
61
57
|
}
|
|
62
58
|
|
|
63
59
|
console.log(`
|
|
64
60
|
────────────────────────────────────────────────────────────────────────
|
|
65
61
|
|
|
66
|
-
Installation complete! ${copied}
|
|
62
|
+
Installation complete! ${copied}/2 commands installed.
|
|
67
63
|
|
|
68
64
|
USAGE:
|
|
69
65
|
/structure <path> Extract from a single document
|
|
@@ -81,6 +77,8 @@ EXAMPLE:
|
|
|
81
77
|
|
|
82
78
|
Output: JSON + Markdown in same directory as source document
|
|
83
79
|
|
|
80
|
+
NOTE: Restart Claude Code for commands to appear.
|
|
81
|
+
|
|
84
82
|
────────────────────────────────────────────────────────────────────────
|
|
85
83
|
`);
|
|
86
84
|
}
|
package/package.json
CHANGED