@nahisaho/shikigami 2.1.0 → 2.1.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/mcp-server/package.json +1 -1
- package/package.json +1 -1
- package/scripts/cli.js +1 -11
- package/scripts/init.js +0 -16
- package/scripts/setup-cowork.js +0 -367
package/mcp-server/package.json
CHANGED
package/package.json
CHANGED
package/scripts/cli.js
CHANGED
|
@@ -32,7 +32,6 @@ Usage: npx shikigami [command] [options]
|
|
|
32
32
|
Commands:
|
|
33
33
|
init Initialize SHIKIGAMI files in current directory
|
|
34
34
|
upgrade, update Upgrade SHIKIGAMI files (same as init --force) (v1.23.0)
|
|
35
|
-
cowork [options] Set up Microsoft Copilot Cowork MCP (v2.0.0)
|
|
36
35
|
new [name] Create a new research project
|
|
37
36
|
find-related [keyword] Find related projects by keywords (v1.7.0)
|
|
38
37
|
inherit [options] Prepare knowledge inheritance from past reports (v1.8.0)
|
|
@@ -42,8 +41,6 @@ Commands:
|
|
|
42
41
|
Examples:
|
|
43
42
|
npx shikigami init # Initialize SHIKIGAMI
|
|
44
43
|
npx shikigami upgrade # Upgrade to latest version
|
|
45
|
-
npx shikigami cowork # Set up Copilot Cowork MCP (v2.0.0)
|
|
46
|
-
npx shikigami cowork --status # Check Cowork installation status
|
|
47
44
|
npx shikigami new my-research # Create new project "my-research"
|
|
48
45
|
npx shikigami new # Create new project with auto-numbered name
|
|
49
46
|
npx shikigami find-related レアアース # Find projects related to "レアアース"
|
|
@@ -71,13 +68,6 @@ if (command === 'upgrade' || command === 'update') {
|
|
|
71
68
|
process.exit(0);
|
|
72
69
|
}
|
|
73
70
|
|
|
74
|
-
// Cowork command (v2.0.0)
|
|
75
|
-
if (command === 'cowork') {
|
|
76
|
-
const { setup } = require('./setup-cowork.js');
|
|
77
|
-
setup();
|
|
78
|
-
process.exit(0);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
71
|
// New project command
|
|
82
72
|
if (command === 'new') {
|
|
83
73
|
const projectName = args[1];
|
|
@@ -99,7 +89,7 @@ if (command === 'inherit') {
|
|
|
99
89
|
}
|
|
100
90
|
|
|
101
91
|
// Unknown command
|
|
102
|
-
if (command !== 'find-related' && command !== 'inherit' && command !== 'upgrade' && command !== 'update'
|
|
92
|
+
if (command !== 'find-related' && command !== 'inherit' && command !== 'upgrade' && command !== 'update') {
|
|
103
93
|
console.error(`Unknown command: ${command}`);
|
|
104
94
|
console.log('Run "npx shikigami --help" for usage information.');
|
|
105
95
|
process.exit(1);
|
package/scripts/init.js
CHANGED
|
@@ -167,22 +167,6 @@ function init() {
|
|
|
167
167
|
console.log(`📊 Summary: ${copiedCount} copied, ${overwrittenCount} overwritten, ${skippedCount} skipped`);
|
|
168
168
|
console.log('');
|
|
169
169
|
|
|
170
|
-
// Check Cowork MCP status
|
|
171
|
-
try {
|
|
172
|
-
const { isInstalled, isMcpConfigured } = require('./setup-cowork.js');
|
|
173
|
-
if (!isInstalled() || !isMcpConfigured()) {
|
|
174
|
-
console.log('🤝 Copilot Cowork MCP (M365連携):');
|
|
175
|
-
console.log(' メール・カレンダー・Teams・OneDrive にCopilot CLIからアクセス可能に');
|
|
176
|
-
console.log(' セットアップ: npx shikigami cowork');
|
|
177
|
-
console.log('');
|
|
178
|
-
} else {
|
|
179
|
-
console.log('🤝 Copilot Cowork MCP: ✅ Configured');
|
|
180
|
-
console.log('');
|
|
181
|
-
}
|
|
182
|
-
} catch {
|
|
183
|
-
// Ignore errors from cowork check
|
|
184
|
-
}
|
|
185
|
-
|
|
186
170
|
console.log('📝 Next steps:');
|
|
187
171
|
console.log(' 1. cd mcp-server && npm install && npm run build');
|
|
188
172
|
console.log(' 2. Restart VS Code to activate Agent Skills');
|
package/scripts/setup-cowork.js
DELETED
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* SHIKIGAMI - Copilot Cowork MCP Setup
|
|
4
|
-
* Usage: npx shikigami cowork [options]
|
|
5
|
-
*
|
|
6
|
-
* Sets up Microsoft Copilot Cowork as an MCP server for GitHub Copilot CLI.
|
|
7
|
-
* Enables access to M365 data (Mail, Calendar, Teams, Files) from Copilot CLI.
|
|
8
|
-
*
|
|
9
|
-
* v2.0.0: Initial release
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
const fs = require('fs');
|
|
13
|
-
const path = require('path');
|
|
14
|
-
const { execSync } = require('child_process');
|
|
15
|
-
|
|
16
|
-
const COWORK_REPO = 'https://github.com/msartem/copilot_cowork_mcp.git';
|
|
17
|
-
const COPILOT_DIR = path.join(require('os').homedir(), '.copilot');
|
|
18
|
-
const PLUGINS_DIR = path.join(COPILOT_DIR, 'installed-plugins');
|
|
19
|
-
const COWORK_DIR = path.join(PLUGINS_DIR, 'copilot_cowork_mcp');
|
|
20
|
-
const MCP_CONFIG = path.join(COPILOT_DIR, '.mcp.json');
|
|
21
|
-
|
|
22
|
-
function parseArgs() {
|
|
23
|
-
const args = process.argv.slice(2).filter(a => a !== 'cowork');
|
|
24
|
-
return {
|
|
25
|
-
uninstall: args.includes('--uninstall'),
|
|
26
|
-
status: args.includes('--status'),
|
|
27
|
-
help: args.includes('--help') || args.includes('-h'),
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function showHelp() {
|
|
32
|
-
console.log(`
|
|
33
|
-
🤝 SHIKIGAMI - Copilot Cowork Setup
|
|
34
|
-
|
|
35
|
-
Usage: npx shikigami cowork [options]
|
|
36
|
-
|
|
37
|
-
Options:
|
|
38
|
-
--status Check installation status
|
|
39
|
-
--uninstall Remove Cowork MCP configuration
|
|
40
|
-
-h, --help Show this help message
|
|
41
|
-
|
|
42
|
-
What is Copilot Cowork?
|
|
43
|
-
Microsoft Copilot Cowork MCP enables GitHub Copilot CLI to access
|
|
44
|
-
your M365 data: Mail, Calendar, Teams messages, and OneDrive files.
|
|
45
|
-
|
|
46
|
-
Requirements:
|
|
47
|
-
- Python 3.10+
|
|
48
|
-
- Microsoft 365 account
|
|
49
|
-
- First run requires browser sign-in (Edge/Chromium)
|
|
50
|
-
|
|
51
|
-
After setup:
|
|
52
|
-
1. Restart Copilot CLI (or start a new session)
|
|
53
|
-
2. First use will open a browser for M365 authentication
|
|
54
|
-
3. After sign-in, tokens are cached for ~90 days
|
|
55
|
-
`);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function checkPython() {
|
|
59
|
-
try {
|
|
60
|
-
const version = execSync('python3 --version 2>&1', { encoding: 'utf-8' }).trim();
|
|
61
|
-
const match = version.match(/Python (\d+)\.(\d+)/);
|
|
62
|
-
if (match && (parseInt(match[1]) > 3 || (parseInt(match[1]) === 3 && parseInt(match[2]) >= 10))) {
|
|
63
|
-
return { ok: true, version };
|
|
64
|
-
}
|
|
65
|
-
return { ok: false, version, error: 'Python 3.10+ required' };
|
|
66
|
-
} catch {
|
|
67
|
-
return { ok: false, version: null, error: 'Python 3 not found' };
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function checkGit() {
|
|
72
|
-
try {
|
|
73
|
-
execSync('git --version', { encoding: 'utf-8' });
|
|
74
|
-
return true;
|
|
75
|
-
} catch {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function isInstalled() {
|
|
81
|
-
return fs.existsSync(path.join(COWORK_DIR, 'server.py'));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function isMcpConfigured() {
|
|
85
|
-
if (!fs.existsSync(MCP_CONFIG)) return false;
|
|
86
|
-
try {
|
|
87
|
-
const config = JSON.parse(fs.readFileSync(MCP_CONFIG, 'utf-8'));
|
|
88
|
-
return !!(config.mcpServers && config.mcpServers.cowork);
|
|
89
|
-
} catch {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function checkDependencies() {
|
|
95
|
-
const deps = ['fastmcp', 'requests', 'playwright'];
|
|
96
|
-
const results = {};
|
|
97
|
-
for (const dep of deps) {
|
|
98
|
-
try {
|
|
99
|
-
execSync(`python3 -c "import ${dep}" 2>&1`, { encoding: 'utf-8' });
|
|
100
|
-
results[dep] = true;
|
|
101
|
-
} catch {
|
|
102
|
-
results[dep] = false;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return results;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function showStatus() {
|
|
109
|
-
console.log('');
|
|
110
|
-
console.log('🤝 Copilot Cowork MCP Status');
|
|
111
|
-
console.log('════════════════════════════');
|
|
112
|
-
console.log('');
|
|
113
|
-
|
|
114
|
-
const python = checkPython();
|
|
115
|
-
console.log(` Python: ${python.ok ? `✅ ${python.version}` : `❌ ${python.error}`}`);
|
|
116
|
-
|
|
117
|
-
const installed = isInstalled();
|
|
118
|
-
console.log(` Plugin: ${installed ? '✅ Installed' : '❌ Not installed'}`);
|
|
119
|
-
|
|
120
|
-
if (installed) {
|
|
121
|
-
const deps = checkDependencies();
|
|
122
|
-
for (const [dep, ok] of Object.entries(deps)) {
|
|
123
|
-
console.log(` ${dep.padEnd(14)} ${ok ? '✅' : '❌ Missing'}`);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const configured = isMcpConfigured();
|
|
128
|
-
console.log(` MCP Config: ${configured ? '✅ Configured' : '❌ Not configured'}`);
|
|
129
|
-
console.log(` Config Path: ${MCP_CONFIG}`);
|
|
130
|
-
console.log('');
|
|
131
|
-
|
|
132
|
-
if (installed && configured) {
|
|
133
|
-
console.log(' ✨ Ready to use! Restart Copilot CLI to activate.');
|
|
134
|
-
} else {
|
|
135
|
-
console.log(' Run "npx shikigami cowork" to set up.');
|
|
136
|
-
}
|
|
137
|
-
console.log('');
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function installDependencies() {
|
|
141
|
-
const deps = checkDependencies();
|
|
142
|
-
const missing = Object.entries(deps).filter(([, ok]) => !ok).map(([dep]) => dep);
|
|
143
|
-
|
|
144
|
-
if (missing.length === 0) {
|
|
145
|
-
console.log(' ✅ All Python dependencies already installed');
|
|
146
|
-
return true;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
console.log(` 📦 Installing: ${missing.join(', ')}...`);
|
|
150
|
-
try {
|
|
151
|
-
// Try with --break-system-packages first (Ubuntu/Debian), fallback to without
|
|
152
|
-
try {
|
|
153
|
-
execSync(`pip install --break-system-packages ${missing.join(' ')} 2>&1`, {
|
|
154
|
-
encoding: 'utf-8',
|
|
155
|
-
stdio: 'pipe',
|
|
156
|
-
});
|
|
157
|
-
} catch {
|
|
158
|
-
execSync(`pip install ${missing.join(' ')} 2>&1`, {
|
|
159
|
-
encoding: 'utf-8',
|
|
160
|
-
stdio: 'pipe',
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Install Playwright browser if playwright was just installed
|
|
165
|
-
if (missing.includes('playwright')) {
|
|
166
|
-
console.log(' 🌐 Installing Playwright browser (chromium)...');
|
|
167
|
-
execSync('python3 -m playwright install chromium 2>&1', {
|
|
168
|
-
encoding: 'utf-8',
|
|
169
|
-
stdio: 'pipe',
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
console.log(' ✅ Dependencies installed');
|
|
174
|
-
return true;
|
|
175
|
-
} catch (err) {
|
|
176
|
-
console.error(` ❌ Failed to install dependencies: ${err.message}`);
|
|
177
|
-
console.log(' 💡 Try manually: pip install fastmcp requests playwright');
|
|
178
|
-
return false;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function clonePlugin() {
|
|
183
|
-
if (isInstalled()) {
|
|
184
|
-
console.log(' ✅ Plugin already installed');
|
|
185
|
-
// Pull latest
|
|
186
|
-
try {
|
|
187
|
-
execSync(`git -C "${COWORK_DIR}" pull --quiet 2>&1`, {
|
|
188
|
-
encoding: 'utf-8',
|
|
189
|
-
stdio: 'pipe',
|
|
190
|
-
});
|
|
191
|
-
console.log(' 🔄 Updated to latest version');
|
|
192
|
-
} catch {
|
|
193
|
-
// Ignore pull errors
|
|
194
|
-
}
|
|
195
|
-
return true;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
console.log(' 📥 Cloning Copilot Cowork MCP...');
|
|
199
|
-
try {
|
|
200
|
-
fs.mkdirSync(PLUGINS_DIR, { recursive: true });
|
|
201
|
-
execSync(`git clone "${COWORK_REPO}" "${COWORK_DIR}" 2>&1`, {
|
|
202
|
-
encoding: 'utf-8',
|
|
203
|
-
stdio: 'pipe',
|
|
204
|
-
});
|
|
205
|
-
console.log(' ✅ Plugin cloned');
|
|
206
|
-
return true;
|
|
207
|
-
} catch (err) {
|
|
208
|
-
console.error(` ❌ Failed to clone: ${err.message}`);
|
|
209
|
-
return false;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
function configureMcp() {
|
|
214
|
-
if (isMcpConfigured()) {
|
|
215
|
-
console.log(' ✅ MCP already configured');
|
|
216
|
-
return true;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
console.log(' ⚙️ Configuring MCP server...');
|
|
220
|
-
try {
|
|
221
|
-
fs.mkdirSync(COPILOT_DIR, { recursive: true });
|
|
222
|
-
|
|
223
|
-
let config = { mcpServers: {} };
|
|
224
|
-
if (fs.existsSync(MCP_CONFIG)) {
|
|
225
|
-
try {
|
|
226
|
-
config = JSON.parse(fs.readFileSync(MCP_CONFIG, 'utf-8'));
|
|
227
|
-
if (!config.mcpServers) config.mcpServers = {};
|
|
228
|
-
} catch {
|
|
229
|
-
// Corrupted config, start fresh but keep backup
|
|
230
|
-
const backup = `${MCP_CONFIG}.bak`;
|
|
231
|
-
fs.copyFileSync(MCP_CONFIG, backup);
|
|
232
|
-
console.log(` ⚠️ Backed up corrupted config to ${backup}`);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
config.mcpServers.cowork = {
|
|
237
|
-
type: 'stdio',
|
|
238
|
-
command: 'python3',
|
|
239
|
-
args: [path.join(COWORK_DIR, 'server.py')],
|
|
240
|
-
env: {
|
|
241
|
-
COWORK_SHOW_THINKING: 'false',
|
|
242
|
-
},
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
fs.writeFileSync(MCP_CONFIG, JSON.stringify(config, null, 2) + '\n');
|
|
246
|
-
console.log(' ✅ MCP configured');
|
|
247
|
-
return true;
|
|
248
|
-
} catch (err) {
|
|
249
|
-
console.error(` ❌ Failed to configure MCP: ${err.message}`);
|
|
250
|
-
return false;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function uninstall() {
|
|
255
|
-
console.log('');
|
|
256
|
-
console.log('🤝 Uninstalling Copilot Cowork MCP...');
|
|
257
|
-
console.log('');
|
|
258
|
-
|
|
259
|
-
// Remove from MCP config
|
|
260
|
-
if (fs.existsSync(MCP_CONFIG)) {
|
|
261
|
-
try {
|
|
262
|
-
const config = JSON.parse(fs.readFileSync(MCP_CONFIG, 'utf-8'));
|
|
263
|
-
if (config.mcpServers && config.mcpServers.cowork) {
|
|
264
|
-
delete config.mcpServers.cowork;
|
|
265
|
-
fs.writeFileSync(MCP_CONFIG, JSON.stringify(config, null, 2) + '\n');
|
|
266
|
-
console.log(' ✅ Removed from MCP config');
|
|
267
|
-
} else {
|
|
268
|
-
console.log(' ⏭️ Not in MCP config');
|
|
269
|
-
}
|
|
270
|
-
} catch {
|
|
271
|
-
console.log(' ⚠️ Could not parse MCP config');
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// Remove plugin directory
|
|
276
|
-
if (fs.existsSync(COWORK_DIR)) {
|
|
277
|
-
fs.rmSync(COWORK_DIR, { recursive: true, force: true });
|
|
278
|
-
console.log(' ✅ Removed plugin files');
|
|
279
|
-
} else {
|
|
280
|
-
console.log(' ⏭️ Plugin not installed');
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
console.log('');
|
|
284
|
-
console.log(' ✨ Uninstall complete. Restart Copilot CLI to apply.');
|
|
285
|
-
console.log('');
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
function setup() {
|
|
289
|
-
const { uninstall: doUninstall, status, help } = parseArgs();
|
|
290
|
-
|
|
291
|
-
if (help) {
|
|
292
|
-
showHelp();
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
if (status) {
|
|
297
|
-
showStatus();
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if (doUninstall) {
|
|
302
|
-
uninstall();
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
console.log('');
|
|
307
|
-
console.log('🤝 Setting up Copilot Cowork MCP');
|
|
308
|
-
console.log('═════════════════════════════════');
|
|
309
|
-
console.log('');
|
|
310
|
-
|
|
311
|
-
// Step 1: Check prerequisites
|
|
312
|
-
console.log('Step 1/4: Checking prerequisites...');
|
|
313
|
-
const python = checkPython();
|
|
314
|
-
if (!python.ok) {
|
|
315
|
-
console.error(` ❌ ${python.error}`);
|
|
316
|
-
console.log(' 💡 Install Python 3.10+: https://www.python.org/downloads/');
|
|
317
|
-
process.exit(1);
|
|
318
|
-
}
|
|
319
|
-
console.log(` ✅ ${python.version}`);
|
|
320
|
-
|
|
321
|
-
if (!checkGit()) {
|
|
322
|
-
console.error(' ❌ Git not found');
|
|
323
|
-
process.exit(1);
|
|
324
|
-
}
|
|
325
|
-
console.log(' ✅ Git available');
|
|
326
|
-
console.log('');
|
|
327
|
-
|
|
328
|
-
// Step 2: Clone plugin
|
|
329
|
-
console.log('Step 2/4: Installing plugin...');
|
|
330
|
-
if (!clonePlugin()) process.exit(1);
|
|
331
|
-
console.log('');
|
|
332
|
-
|
|
333
|
-
// Step 3: Install dependencies
|
|
334
|
-
console.log('Step 3/4: Installing dependencies...');
|
|
335
|
-
if (!installDependencies()) process.exit(1);
|
|
336
|
-
console.log('');
|
|
337
|
-
|
|
338
|
-
// Step 4: Configure MCP
|
|
339
|
-
console.log('Step 4/4: Configuring MCP...');
|
|
340
|
-
if (!configureMcp()) process.exit(1);
|
|
341
|
-
console.log('');
|
|
342
|
-
|
|
343
|
-
// Done
|
|
344
|
-
console.log('═════════════════════════════════');
|
|
345
|
-
console.log('✨ Copilot Cowork MCP setup complete!');
|
|
346
|
-
console.log('');
|
|
347
|
-
console.log('📝 Next steps:');
|
|
348
|
-
console.log(' 1. Restart Copilot CLI (or start a new session)');
|
|
349
|
-
console.log(' 2. First use will open a browser for M365 sign-in');
|
|
350
|
-
console.log(' 3. After sign-in, tokens are cached for ~90 days');
|
|
351
|
-
console.log('');
|
|
352
|
-
console.log('💡 Usage examples:');
|
|
353
|
-
console.log(' "メールの未読を要約して"');
|
|
354
|
-
console.log(' "明日の会議は?"');
|
|
355
|
-
console.log(' "Teamsで自分にhelloとメッセージ送って"');
|
|
356
|
-
console.log('');
|
|
357
|
-
console.log('🔧 Commands:');
|
|
358
|
-
console.log(' npx shikigami cowork --status # Check status');
|
|
359
|
-
console.log(' npx shikigami cowork --uninstall # Remove');
|
|
360
|
-
console.log('');
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
module.exports = { setup, showStatus, isInstalled, isMcpConfigured };
|
|
364
|
-
|
|
365
|
-
if (require.main === module) {
|
|
366
|
-
setup();
|
|
367
|
-
}
|