@routinecrew/routinecode 2.31.85 → 2.31.87
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/bin/cli.sh +10 -0
- package/bin/prompt-vault.dat +1 -1
- package/bin/rc-board.js +58 -0
- package/bin/rc-skills.js +31 -0
- package/bin/setup.js +1 -1
- package/hooks/hooks-config.json +10 -1
- package/hooks/lib/agent_telemetry.py +143 -0
- package/hooks/lib/attest_reader.py +16 -1
- package/hooks/lib/board-golden.json +268 -0
- package/hooks/lib/board.py +503 -0
- package/hooks/lib/board_sync.py +535 -0
- package/hooks/lib/completion_log.py +12 -5
- package/hooks/lib/config_bash_track.py +14 -26
- package/hooks/lib/config_guard.py +133 -4
- package/hooks/lib/design_pick_nudge.py +86 -0
- package/hooks/lib/edit_tracker.py +182 -0
- package/hooks/lib/i18n.py +62 -20
- package/hooks/lib/knowledge_items.py +74 -8
- package/hooks/lib/usage_v2.py +12 -0
- package/hooks/post-agent-return.sh +5 -0
- package/hooks/post-edit-track.sh +19 -28
- package/hooks/post-orch-decision.sh +17 -0
- package/hooks/pre-account-guard.sh +1 -1
- package/hooks/pre-agent-spawn.mjs +1 -1
- package/hooks/pre-agent-spawn.sh +12 -0
- package/hooks/pre-credit-guard.sh +1 -1
- package/hooks/pre-edit-board.sh +44 -0
- package/hooks/pre-edit-check.sh +27 -3
- package/hooks/pre-mark-complete.sh +71 -15
- package/hooks/session-start.sh +62 -3
- package/hooks/skill-knowledge.sh +6 -0
- package/hooks/user-prompt-submit.sh +9 -0
- package/mcp-plan-manager/dist/file-ops.js +1 -1
- package/mcp-routinecode/dist/board.js +1 -0
- package/mcp-routinecode/dist/build-id.js +1 -0
- package/mcp-routinecode/dist/changeset.js +1 -1
- package/mcp-routinecode/dist/config-auth.js +1 -1
- package/mcp-routinecode/dist/config-map/applied.js +1 -0
- package/mcp-routinecode/dist/config-map/arch-graph.js +1 -1
- package/mcp-routinecode/dist/config-map/architect-store.js +1 -7
- package/mcp-routinecode/dist/config-map/audit-cli.js +1 -1
- package/mcp-routinecode/dist/config-map/audit.js +1 -1
- package/mcp-routinecode/dist/config-map/blocks.js +1 -1
- package/mcp-routinecode/dist/config-map/convention-candidates.js +1 -1
- package/mcp-routinecode/dist/config-map/decisions.js +1 -1
- package/mcp-routinecode/dist/config-map/dup-safety.js +1 -1
- package/mcp-routinecode/dist/config-map/field-contract.js +1 -1
- package/mcp-routinecode/dist/config-map/hash.js +1 -1
- package/mcp-routinecode/dist/config-map/index-store.js +62 -5
- package/mcp-routinecode/dist/config-map/link.js +1 -1
- package/mcp-routinecode/dist/config-map/linked-repos.js +1 -1
- package/mcp-routinecode/dist/config-map/maintenance-cli.js +1 -1
- package/mcp-routinecode/dist/config-map/proposals.js +1 -1
- package/mcp-routinecode/dist/config-map/repo-id.js +1 -1
- package/mcp-routinecode/dist/config-map/route-security.js +1 -1
- package/mcp-routinecode/dist/config-map/rule-import.js +1 -1
- package/mcp-routinecode/dist/config-map/shape-eval.js +1 -1
- package/mcp-routinecode/dist/config-map/shape.js +1 -1
- package/mcp-routinecode/dist/config-map/snapshot.js +1 -1
- package/mcp-routinecode/dist/config-map/sole-impl.js +1 -1
- package/mcp-routinecode/dist/config-map/stable-id.js +1 -1
- package/mcp-routinecode/dist/config-map/store.js +1 -1
- package/mcp-routinecode/dist/config-map/swagger-check.js +1 -1
- package/mcp-routinecode/dist/config-map/templates.js +1 -1
- package/mcp-routinecode/dist/contracts.generated.js +1 -1
- package/mcp-routinecode/dist/coverage.js +1 -1
- package/mcp-routinecode/dist/criteria-card.js +1 -0
- package/mcp-routinecode/dist/design-judge.js +1 -0
- package/mcp-routinecode/dist/edit-tracker.js +1 -0
- package/mcp-routinecode/dist/explorer-advisor.js +1 -1
- package/mcp-routinecode/dist/failure-tracker.js +1 -1
- package/mcp-routinecode/dist/file-lock-registry.js +1 -1
- package/mcp-routinecode/dist/file-risk-scorer.js +1 -1
- package/mcp-routinecode/dist/index.js +1 -1
- package/mcp-routinecode/dist/known-solutions.js +1 -1
- package/mcp-routinecode/dist/ledger-miner.js +1 -1
- package/mcp-routinecode/dist/normalize-sig.js +1 -1
- package/mcp-routinecode/dist/observed-draft.js +1 -1
- package/mcp-routinecode/dist/observed-escalation.js +1 -0
- package/mcp-routinecode/dist/pattern-matcher.js +1 -1
- package/mcp-routinecode/dist/route-match.js +1 -1
- package/mcp-routinecode/dist/routines.js +1 -1
- package/mcp-routinecode/dist/rule-engine.js +1 -1
- package/mcp-routinecode/dist/rule-promoter.js +1 -1
- package/mcp-routinecode/dist/session-registry.js +1 -0
- package/mcp-routinecode/dist/skill-pack/sync.js +655 -0
- package/mcp-routinecode/dist/skill-pack/validate.js +278 -0
- package/mcp-routinecode/dist/test-runner.js +1 -1
- package/mcp-routinecode/dist/thinking-judge.js +1 -0
- package/mcp-routinecode/dist/verification.js +1 -1
- package/mcp-routinecode/package.json +1 -1
- package/package.json +2 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/agents/analyzer.md.sealed +1 -1
- package/plugin/agents/architect.md.sealed +1 -1
- package/plugin/agents/crawler.md.sealed +1 -1
- package/plugin/agents/explorer.md.sealed +1 -1
- package/plugin/agents/implementor.md.sealed +1 -1
- package/plugin/agents/looker.md.sealed +1 -1
- package/plugin/agents/planner.md.sealed +1 -1
- package/plugin/agents/recorder.md.sealed +1 -1
- package/plugin/agents/reviewer.md.sealed +1 -1
- package/plugin/agents/verifier.md.sealed +1 -1
- package/plugin/commands/analyze.md.sealed +1 -1
- package/plugin/commands/plan.md.sealed +1 -1
- package/plugin/commands/rc.md.sealed +1 -1
- package/plugin/commands/receipt.md.sealed +1 -1
- package/plugin/commands/recharge.md.sealed +1 -1
- package/plugin/commands/routines.md.sealed +1 -1
- package/plugin/commands/share.md.sealed +1 -1
- package/plugin/routinecode-prompt.md.sealed +1 -1
package/bin/rc-board.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `routinecode board` — 이 레포의 공유 판을 터미널에 보여 준다(설계 31 W7). 읽기 전용, 서버로 보내지 않는다.
|
|
3
|
+
// routinecode board 진행·막힘·열림·최근 완료(24h)·최근 노트
|
|
4
|
+
// routinecode board <taskId> 그 과제만 (노트 전부)
|
|
5
|
+
// routinecode board --json JSON
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
|
+
|
|
9
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
const json = args.includes('--json');
|
|
12
|
+
const taskId = args.find((a) => !a.startsWith('-'));
|
|
13
|
+
|
|
14
|
+
let B;
|
|
15
|
+
try {
|
|
16
|
+
B = await import(pathToFileURL(path.join(here, '..', 'mcp-routinecode', 'dist', 'board.js')).href);
|
|
17
|
+
} catch {
|
|
18
|
+
console.error('board: mcp-routinecode 빌드가 없습니다 (npm run build)');
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const ctx = { dir: B.boardDirOf(process.cwd()), pid: process.ppid, project: process.cwd(), by: { session: 'cli', agent: null } };
|
|
23
|
+
const v = B.viewBoard(ctx, { taskId, notes: taskId ? 100 : 8 });
|
|
24
|
+
if (json) {
|
|
25
|
+
console.log(JSON.stringify(v, null, 2));
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
const line = (s) => console.log(s);
|
|
29
|
+
const ago = (iso) => {
|
|
30
|
+
const m = Math.round((Date.now() - Date.parse(iso)) / 60000);
|
|
31
|
+
return m < 60 ? `${m}분 전` : m < 1440 ? `${Math.round(m / 60)}시간 전` : `${Math.round(m / 1440)}일 전`;
|
|
32
|
+
};
|
|
33
|
+
const total = v.open.length + v.claimed.length + v.blocked.length + v.landed.length;
|
|
34
|
+
if (total === 0 && v.notes.length === 0) {
|
|
35
|
+
line('공유 판이 비어 있습니다. 세션에서 board_post 로 과제를 올리면 여기에 보입니다.');
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
line(`공유 판 ${v.board}`);
|
|
39
|
+
if (v.claimed.length) {
|
|
40
|
+
line('\n진행 중');
|
|
41
|
+
for (const t of v.claimed) line(` ${t.id} ${t.title} — ${t.by.session}${t.by.agent ? '/' + t.by.agent : ''}${t.stale ? ' (세션 종료됨, 다시 잡을 수 있음)' : ''}`);
|
|
42
|
+
}
|
|
43
|
+
if (v.blocked.length) {
|
|
44
|
+
line('\n막힘');
|
|
45
|
+
for (const t of v.blocked) line(` ${t.id} ${t.title} — ${t.blockedReason ?? ''}`);
|
|
46
|
+
}
|
|
47
|
+
if (v.open.length) {
|
|
48
|
+
line('\n열림');
|
|
49
|
+
for (const t of v.open) line(` ${t.id} ${t.title}${t.parent ? ` (← ${t.parent})` : ''}`);
|
|
50
|
+
}
|
|
51
|
+
if (v.landed.length) {
|
|
52
|
+
line('\n완료 (24시간)');
|
|
53
|
+
for (const t of v.landed) line(` ${t.id} ${t.title} — ${ago(t.at)}, 증거 ${t.evidence.join(', ')}`);
|
|
54
|
+
}
|
|
55
|
+
if (v.notes.length) {
|
|
56
|
+
line('\n최근 노트');
|
|
57
|
+
for (const n of v.notes) line(` [${n.topic}] ${n.task ?? '판'} · ${n.session} · ${ago(n.at)} ${n.text.slice(0, 140)}`);
|
|
58
|
+
}
|
package/bin/rc-skills.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// RoutineCode 디자인 스킬 팩 (zero-dep 평문 래퍼, ESM) — 설계 23 §5.1.
|
|
3
|
+
//
|
|
4
|
+
// routinecode skills status | on | off | sync
|
|
5
|
+
//
|
|
6
|
+
// 실제 동작은 mcp-routinecode/dist/skill-pack/sync.js(평문, PLAIN_DIST)의 main. 기본 켜짐(설계 23 v11) — `off` 를 고르면 내려받지 않는다.
|
|
7
|
+
// session-start.sh 가 `sync` 를 부르고 첫 줄(changed|notice|…)을 읽는다. sync 는 어떤 실패에도 0 으로 끝난다(세션 시작을 막지 않음).
|
|
8
|
+
|
|
9
|
+
import { dirname, join } from 'node:path';
|
|
10
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
11
|
+
|
|
12
|
+
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const SYNC = join(HERE, '..', 'mcp-routinecode', 'dist', 'skill-pack', 'sync.js');
|
|
14
|
+
const args = process.argv.slice(2);
|
|
15
|
+
const cmd = args[0] === 'skills' ? args.slice(1) : args;
|
|
16
|
+
const isSync = (cmd[0] ?? 'status') === 'sync';
|
|
17
|
+
|
|
18
|
+
let mod = null;
|
|
19
|
+
try {
|
|
20
|
+
mod = await import(pathToFileURL(SYNC).href);
|
|
21
|
+
} catch (e) {
|
|
22
|
+
if (isSync) { process.stdout.write('error\n'); process.exit(0); }
|
|
23
|
+
process.stderr.write(`routinecode skills: ${SYNC} 를 불러오지 못했다 — 빌드되지 않은 체크아웃이면 npm run build (${e?.message ?? e})\n`);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
process.exitCode = await mod.main(cmd);
|
|
29
|
+
} catch (e) {
|
|
30
|
+
if (isSync) { process.stdout.write('error\n'); process.exitCode = 0; } else { process.stderr.write(`routinecode skills: ${e?.message ?? e}\n`); process.exitCode = 1; }
|
|
31
|
+
}
|
package/bin/setup.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/* rc-min */
|
|
3
3
|
|
|
4
|
-
import{readFileSync,writeFileSync,existsSync,mkdirSync,chmodSync}from'fs';import{join,dirname}from'path';import{fileURLToPath}from'url';import{execSync}from'child_process';import{homedir}from'os';import{randomBytes}from'crypto';import{createInterface}from'readline';import{extractPrompts}from'./prompt-vault.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),PACKAGE_ROOT=join(__dirname,'..'),CLAUDE_DIR=join(homedir(),'.claude'),SETTINGS_PATH=join(CLAUDE_DIR,'settings.json'),RC_CONFIG_DIR=join(homedir(),'.routinecode'),RC_CONFIG_PATH=join(RC_CONFIG_DIR,'config.json'),MCP_SERVERS=['mcp-routinecode','mcp-log-watcher','mcp-intelligence','mcp-project-context','mcp-plan-manager','mcp-doc-fetcher','mcp-dev-tester','mcp-db-manager','mcp-html-renderer'];function ask(a){const b=createInterface({'input':process['stdin'],'output':process['stdout']});return new Promise(c=>{b['question'](a,d=>{b['close'](),c(d['trim']());});});}function loadSettings(){if(!existsSync(SETTINGS_PATH))return{};return JSON['parse'](readFileSync(SETTINGS_PATH,'utf-8'));}function saveSettings(a){if(!existsSync(CLAUDE_DIR))mkdirSync(CLAUDE_DIR,{'recursive':!![]});writeFileSync(SETTINGS_PATH,JSON['stringify'](a,null,0x2)+'\x0a','utf-8');}const CLAUDE_JSON_PATH=join(homedir(),'.claude.json');function loadClaudeJson(){if(!existsSync(CLAUDE_JSON_PATH))return{};try{return JSON['parse'](readFileSync(CLAUDE_JSON_PATH,'utf-8'));}catch{return null;}}function saveClaudeJson(a){writeFileSync(CLAUDE_JSON_PATH,JSON['stringify'](a,null,0x2)+'\x0a','utf-8');}function loadRcConfig(){if(!existsSync(RC_CONFIG_PATH))return{'syncEnabled':![],'machineId':randomBytes(0x8)['toString']('hex')};return JSON['parse'](readFileSync(RC_CONFIG_PATH,'utf-8'));}function saveRcConfig(a){if(!existsSync(RC_CONFIG_DIR))mkdirSync(RC_CONFIG_DIR,{'recursive':!![]});writeFileSync(RC_CONFIG_PATH,JSON['stringify'](a,null,0x2)+'\x0a','utf-8');}function isClaudeCodeInstalled(){try{return execSync('claude\x20--version',{'stdio':'pipe'}),!![];}catch{return![];}}async function ensureClaudeCode(){if(isClaudeCodeInstalled())return;console['log']('\x20\x20Claude\x20Code\x20is\x20not\x20installed.'),console['log']('\x20\x20RoutineCode\x20runs\x20on\x20top\x20of\x20Claude\x20Code\x20(Anthropic\x27s\x20CLI).\x0a');const a=await ask('\x20\x20Install\x20Claude\x20Code\x20now?\x20(Y/n):\x20');a['toLowerCase']()==='n'&&(console['log']('\x0a\x20\x20To\x20install\x20manually:'),console['log']('\x20\x20\x20\x20npm\x20install\x20-g\x20@anthropic-ai/claude-code'),console['log']('\x0a\x20\x20Then\x20run\x20this\x20setup\x20again.'),process['exit'](0x0));console['log']('\x0a\x20\x20Installing\x20Claude\x20Code...\x0a');try{execSync('npm\x20install\x20-g\x20@anthropic-ai/claude-code',{'stdio':'inherit'}),console['log']('\x0a\x20\x20Claude\x20Code\x20installed.');}catch{console['log']('\x0a\x20\x20Auto-install\x20failed.\x20Install\x20manually:'),console['log']('\x20\x20\x20\x20npm\x20install\x20-g\x20@anthropic-ai/claude-code'),console['log']('\x0a\x20\x20Then\x20run\x20this\x20setup\x20again.'),process['exit'](0x1);}}async function setupMcpServers(){console['log']('\x0a[1/3]\x20Registering\x20MCP\x20servers\x20+\x20permissions...\x0a');const a=loadSettings();a['permissions']={'defaultMode':'bypassPermissions','allow':['Bash','Read','Edit','Write','Glob','Grep','Agent','WebFetch','WebSearch','mcp__routinecode__*','mcp__intelligence__*','mcp__project_context__*','mcp__plan_manager__*','mcp__doc_fetcher__*','mcp__dev_tester__*','mcp__db_manager__*','mcp__log_watcher__*','mcp__html_renderer__*','mcp__mcp-routinecode__*','mcp__mcp-intelligence__*','mcp__mcp-project-context__*','mcp__mcp-plan-manager__*','mcp__mcp-doc-fetcher__*','mcp__mcp-dev-tester__*','mcp__mcp-db-manager__*','mcp__mcp-log-watcher__*','mcp__mcp-html-renderer__*']},a['skipDangerousModePermissionPrompt']=!![],a['sandbox']={'enabled':![]};const b=loadClaudeJson();if(b===null)console['log']('\x20\x20FAIL\x20\x20~/.claude.json\x20파손\x20—\x20MCP\x20등록\x20건너뜀\x20(수동\x20복구\x20필요)');else{if(!b['mcpServers'])b['mcpServers']={};for(const c of MCP_SERVERS){const d=join(PACKAGE_ROOT,c,'dist','index.cjs'),e=join(PACKAGE_ROOT,c,'dist','index.js'),f=existsSync(d)?d:e;if(!existsSync(f)){console['log']('\x20\x20SKIP\x20\x20'+c+'\x20(not\x20built)');continue;}const g=new Set(['mcp-routinecode']);b['mcpServers'][c]={'command':'node','args':[f],...g['has'](c)?{'alwaysLoad':!![]}:{}};if(a['mcpServers']&&a['mcpServers'][c])delete a['mcpServers'][c];console['log']('\x20\x20OK\x20\x20\x20\x20'+c);}saveClaudeJson(b);}if(a['mcpServers']&&Object['keys'](a['mcpServers'])['length']===0x0)delete a['mcpServers'];saveSettings(a),console['log']('\x0a\x20\x20->\x20'+CLAUDE_JSON_PATH+'\x20(user\x20scope)'),console['log']('\x20\x20->\x20All\x20tools\x20auto-allowed\x20(no\x20permission\x20prompts)');}function setupHooks(){console['log']('\x0a[2/3]\x20Registering\x20hooks...\x0a');const a=loadSettings(),b=join(PACKAGE_ROOT,'hooks');for(const c of['session-start.sh','pre-edit-check.sh','post-build-check.sh','post-edit-track.sh','pre-edit-config-gate.sh','pre-agent-briefing.sh']){const d=join(b,c);existsSync(d)&&chmodSync(d,'755');}a['hooks']={'SessionStart':[{'matcher':'','hooks':[{'type':'command','command':join(b,'session-start.sh')}]}],'PostToolUse':[{'matcher':'mcp__(mcp-)?routinecode__build_check','hooks':[{'type':'command','command':join(b,'post-build-check.sh')}]},{'matcher':'Edit|Write|MultiEdit','hooks':[{'type':'command','command':join(b,'post-edit-track.sh')}]}],'PreToolUse':[{'matcher':'Edit','hooks':[{'type':'command','command':join(b,'pre-edit-check.sh')}]},{'matcher':'Edit|Write|MultiEdit','hooks':[{'type':'command','command':join(b,'pre-edit-config-gate.sh')}]},{'matcher':'Agent','hooks':[{'type':'command','command':join(b,'pre-agent-briefing.sh')}]}]},saveSettings(a),console['log']('\x20\x20OK\x20\x20\x20\x20SessionStart\x20\x20(escalation\x20reset)'),console['log']('\x20\x20OK\x20\x20\x20\x20PostToolUse\x20\x20\x20(build\x20failure\x20->\x20knowledge\x20query)'),console['log']('\x20\x20OK\x20\x20\x20\x20PostToolUse\x20\x20\x20(edit\x20capture\x20->\x20build\x20reminder)'),console['log']('\x20\x20OK\x20\x20\x20\x20PreToolUse\x20\x20\x20\x20(3-Strike\x20edit\x20block\x20+\x20attempt\x20reminder)'),console['log']('\x20\x20OK\x20\x20\x20\x20PreToolUse\x20\x20\x20\x20(config\x20gate:\x20reuse\x20existing\x20code\x20+\x20structure\x20rules)'),console['log']('\x20\x20OK\x20\x20\x20\x20PreToolUse\x20\x20\x20\x20(subagent\x20architecture\x20briefing)');}function setupPlugin(){console['log']('\x0a[3/3]\x20Registering\x20plugin...\x0a');const a=loadSettings();if(!a['enabledPlugins'])a['enabledPlugins']={};const b=join(PACKAGE_ROOT,'plugin');try{extractPrompts();}catch(d){console['log']('\x20\x20WARN\x20\x20prompt\x20extract\x20failed:\x20'+d['message']);}const c=['routinecode-prompt.md','routinecode-prompt.md.sealed',join('agents','explorer.md')]['some'](g=>existsSync(join(b,g)));if(c){if(!a['extraKnownMarketplaces'])a['extraKnownMarketplaces']={};a['extraKnownMarketplaces']['routinecode-marketplace']={'source':{'source':'directory','path':PACKAGE_ROOT}},delete a['enabledPlugins']['routinecode@local'],a['enabledPlugins']['routinecode@routinecode-marketplace']=!![],console['log']('\x20\x20OK\x20\x20\x20\x20routinecode\x20plugin\x20(9\x20agents\x20+\x20/rc\x20command)'),console['log']('\x20\x20PATH\x20\x20'+b);}else console['log']('\x20\x20SKIP\x20\x20plugin\x20directory\x20not\x20found');saveSettings(a);}async function activateApiKey(a){console['log']('\x0a[4/4]\x20Activating\x20intelligence\x20sync...\x0a');const b=loadRcConfig();let c=a||null;if(!c&&b['tenantId']&&b['apiKey']){console['log']('\x20\x20Already\x20activated:\x20tenant='+b['tenantId']);const e=await ask('\x20\x20Re-activate\x20with\x20a\x20different\x20key?\x20(y/N):\x20');if(e['toLowerCase']()!=='y')return;}!c&&(console['log']('\x20\x20On\x20a\x20machine\x20with\x20a\x20browser,\x20just\x20run:\x20routinecode\x20login\x20(the\x20key\x20is\x20issued\x20automatically)'),console['log']('\x20\x20Server\x20/\x20CI\x20(no\x20browser):\x20issue\x20a\x20key\x20at\x20https://routinecode.routinecrew.net/dashboard#ci-keys'),console['log']('\x20\x20then\x20run:\x20routinecode\x20setup\x20--key\x20YOUR_KEY\x0a'),c=await ask('\x20\x20API\x20Key:\x20'));if(!c){console['log']('\x0a\x20\x20Skipped.\x20Run\x20`routinecode\x20setup`\x20again\x20to\x20activate\x20later.');return;}const d='https://api.routinecrew.com';console['log']('\x0a\x20\x20Validating...');try{const f=await fetch(d+'/api/v1/api-keys/verify',{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+c},'signal':AbortSignal['timeout'](0x2710)});if(f['ok']){const g=await f['json']();b['tenantId']=String(g['tenantId']),b['userId']=String(g['userId']??g['createdBy']??null),b['tenantCode']=g['tenantCode']??null,b['serverUrl']=d,b['publishingUrl']='https://publishing.routinecrew.com',b['apiKey']=c,b['syncEnabled']=!![],saveRcConfig(b),console['log']('\x0a\x20\x20Activated!'),console['log']('\x20\x20Tenant:\x20\x20'+(b['tenantCode']??b['tenantId'])),console['log']('\x20\x20Sync:\x20\x20\x20\x20enabled'),console['log']('\x20\x20Your\x20development\x20intelligence\x20will\x20sync\x20to\x20your\x20account.');}else f['status']===0x191?console['log']('\x0a\x20\x20Invalid\x20API\x20Key.\x20Run\x20routinecode\x20login,\x20or\x20issue\x20a\x20new\x20key\x20at\x20routinecode.routinecrew.net/dashboard#ci-keys'):(b['serverUrl']=d,b['apiKey']=c,b['syncEnabled']=!![],saveRcConfig(b),console['log']('\x0a\x20\x20Server\x20unavailable\x20('+f['status']+').\x20Key\x20saved.'),console['log']('\x20\x20Intelligence\x20sync\x20will\x20activate\x20automatically\x20when\x20connected.'));}catch{b['serverUrl']=d,b['apiKey']=c,b['syncEnabled']=!![],saveRcConfig(b),console['log']('\x0a\x20\x20Offline.\x20Key\x20saved.'),console['log']('\x20\x20Intelligence\x20sync\x20will\x20activate\x20when\x20connected.');}}function showStatus(){console['log']('\x0a===\x20RoutineCode\x20Status\x20===\x0a');const a=loadRcConfig();console['log']('Account:'),console['log']('\x20\x20tenantId:\x20\x20\x20\x20'+(a['tenantId']??'(not\x20activated)')),console['log']('\x20\x20tenantCode:\x20\x20'+(a['tenantCode']??'-')),console['log']('\x20\x20userId:\x20\x20\x20\x20\x20\x20'+(a['userId']??'-')),console['log']('\x20\x20machineId:\x20\x20\x20'+a['machineId']),console['log']('\x20\x20syncEnabled:\x20'+a['syncEnabled']),console['log']('\x20\x20serverUrl:\x20\x20\x20'+(a['serverUrl']??'(not\x20set)'));const b=join(RC_CONFIG_DIR,'knowledge');console['log']('\x0aKnowledge:');for(const h of['events.jsonl','patterns.jsonl','quirks.jsonl']){const i=join(b,h);if(existsSync(i)){const j=readFileSync(i,'utf-8')['trim']()['split']('\x0a')['filter'](Boolean)['length'];console['log']('\x20\x20'+h+':\x20'+j+'\x20entries');}else console['log']('\x20\x20'+h+':\x20(empty)');}const c=loadSettings(),d=(loadClaudeJson()||{})['mcpServers']||{};console['log']('\x0aMCP\x20Servers:');for(const k of MCP_SERVERS){const l=d[k]||c['mcpServers']?.[k]?'ON':'OFF';console['log']('\x20\x20'+l+'\x20\x20'+k);}console['log']('\x0aHooks:');const e=c['hooks'];console['log']('\x20\x20SessionStart:\x20'+(e?.['SessionStart']?'ON':'OFF')),console['log']('\x20\x20PostToolUse:\x20\x20'+(e?.['PostToolUse']?'ON':'OFF')),console['log']('\x20\x20PreToolUse:\x20\x20\x20'+(e?.['PreToolUse']?'ON':'OFF')),console['log']('\x0aPermissions:');const f=c['permissions']?.['allow']??[],g=f['filter'](m=>m['startsWith']('mcp__'));console['log']('\x20\x20Auto-allowed:\x20'+g['length']+'\x20MCP\x20tool\x20patterns');}function mcpDepsHealthy(){const a=['node_modules','@modelcontextprotocol','sdk','package.json'];return existsSync(join(PACKAGE_ROOT,...a))||existsSync(join(PACKAGE_ROOT,'mcp-routinecode',...a));}async function ensureMcpDeps(){if(mcpDepsHealthy())return;console['log']('\x0a\x20\x20MCP\x20runtime\x20dependencies\x20missing\x20—\x20installing...'),await installDeps();}async function installDeps(){console['log']('\x0aInstalling\x20MCP\x20server\x20dependencies...\x0a');const a=[];for(const b of MCP_SERVERS){const c=join(PACKAGE_ROOT,b);if(!existsSync(join(c,'package.json'))){console['log']('\x20\x20SKIP\x20\x20'+b);continue;}console['log']('\x20\x20...\x20\x20\x20'+b);try{execSync('npm\x20install\x20--production\x20--silent',{'cwd':c,'stdio':'pipe'});if(!existsSync(join(c,'node_modules','@modelcontextprotocol','sdk')))throw new Error('@modelcontextprotocol/sdk\x20missing\x20after\x20install');console['log']('\x20\x20OK\x20\x20\x20\x20'+b);}catch(d){console['log']('\x20\x20FAIL\x20\x20'+b+':\x20'+d['message']),a['push'](b);}}if(a['length'])return console['log']('\x0a\x20\x20⚠\x20'+a['length']+'/'+MCP_SERVERS['length']+'\x20MCP\x20server(s)\x20FAILED\x20dependency\x20install:'),console['log']('\x20\x20\x20\x20\x20\x20'+a['join'](',\x20')),console['log']('\x20\x20이\x20서버들은\x20의존성이\x20설치될\x20때까지\x20기동되지\x20않습니다(무음\x20실패\x20방지).'),console['log']('\x20\x20네트워크/npm\x20확인\x20후\x20재실행:\x20\x20routinecode\x20install-deps'),process['exitCode']=0x1,![];return console['log']('\x0a\x20\x20All\x20'+MCP_SERVERS['length']+'\x20MCP\x20servers\x20verified\x20(deps\x20+\x20SDK\x20present).'),!![];}function getPackageVersion(){try{const a=JSON['parse'](readFileSync(join(PACKAGE_ROOT,'package.json'),'utf-8'));return a['version']??'unknown';}catch{return'unknown';}}function saveInstallInfo(){const a=loadRcConfig();a['installPath']=PACKAGE_ROOT,a['installedVersion']=getPackageVersion(),a['lastUpdated']=new Date()['toISOString'](),saveRcConfig(a);}async function runUpdate(){const a=loadRcConfig(),b=a['installedVersion']??'unknown',c=getPackageVersion();console['log']('\x20\x20Updating:\x20'+b+'\x20->\x20'+c),await ensureMcpDeps(),await setupMcpServers(),setupHooks(),setupPlugin(),saveInstallInfo(),console['log']('\x0a\x20\x20Updated\x20to\x20v'+c),console['log']('\x20\x20Run\x20`routinecode`\x20to\x20start\x20with\x20updated\x20config.\x0a');}const command=process['argv'][0x2]||'help';function parseFlag(a){const b=process['argv']['indexOf'](a);return b!==-0x1&&b+0x1<process['argv']['length']?process['argv'][b+0x1]:null;}const silent=process['argv']['includes']('--silent');!silent&&(console['log'](''),console['log']('\x20\x20RoutineCode\x20v'+getPackageVersion()),console['log']('\x20\x20Claude\x20Code\x20Superset\x20—\x2059\x20MCP\x20Tools\x20+\x20Multi-Agent\x20Orchestration'),console['log']('\x20\x20https://github.com/routinecrew/routinecode'),console['log'](''));switch(command){case'setup':{const keyArg=parseFlag('--key');await ensureClaudeCode(),await ensureMcpDeps(),await setupMcpServers(),setupHooks(),setupPlugin(),saveInstallInfo(),await activateApiKey(keyArg),console['log']('\x0a===\x20Setup\x20Complete\x20==='),console['log']('\x0aRun\x20`routinecode`\x20to\x20start.\x0a');break;}case'update':await runUpdate();break;case'status':showStatus();break;case'install-deps':await installDeps();break;case'help':default:if(command!=='help')console['log']('Unknown\x20command:\x20'+command+'\x0a');console['log']('Usage:'),console['log']('\x20\x20routinecode\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Launch\x20RoutineCode\x20(Claude\x20Code\x20superset)'),console['log']('\x20\x20routinecode\x20setup\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Full\x20setup\x20(interactive\x20API\x20key)'),console['log']('\x20\x20routinecode\x20setup\x20--key\x20<KEY>\x20\x20\x20\x20\x20\x20Full\x20setup\x20with\x20API\x20key'),console['log']('\x20\x20routinecode\x20update\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Update\x20MCP\x20servers\x20+\x20hooks\x20(non-interactive)'),console['log']('\x20\x20routinecode\x20status\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20current\x20configuration'),console['log']('\x20\x20routinecode\x20install-deps\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Install\x20MCP\x20server\x20dependencies'),process['exit'](command==='help'?0x0:0x1);}
|
|
4
|
+
import{readFileSync,writeFileSync,existsSync,mkdirSync,chmodSync}from'fs';import{join,dirname}from'path';import{fileURLToPath}from'url';import{execSync}from'child_process';import{homedir}from'os';import{randomBytes}from'crypto';import{createInterface}from'readline';import{extractPrompts}from'./prompt-vault.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),PACKAGE_ROOT=join(__dirname,'..'),CLAUDE_DIR=join(homedir(),'.claude'),SETTINGS_PATH=join(CLAUDE_DIR,'settings.json'),RC_CONFIG_DIR=join(homedir(),'.routinecode'),RC_CONFIG_PATH=join(RC_CONFIG_DIR,'config.json'),MCP_SERVERS=['mcp-routinecode','mcp-log-watcher','mcp-intelligence','mcp-project-context','mcp-plan-manager','mcp-doc-fetcher','mcp-dev-tester','mcp-db-manager','mcp-html-renderer'];function ask(a){const b=createInterface({'input':process['stdin'],'output':process['stdout']});return new Promise(c=>{b['question'](a,d=>{b['close'](),c(d['trim']());});});}function loadSettings(){if(!existsSync(SETTINGS_PATH))return{};return JSON['parse'](readFileSync(SETTINGS_PATH,'utf-8'));}function saveSettings(a){if(!existsSync(CLAUDE_DIR))mkdirSync(CLAUDE_DIR,{'recursive':!![]});writeFileSync(SETTINGS_PATH,JSON['stringify'](a,null,0x2)+'\x0a','utf-8');}const CLAUDE_JSON_PATH=join(homedir(),'.claude.json');function loadClaudeJson(){if(!existsSync(CLAUDE_JSON_PATH))return{};try{return JSON['parse'](readFileSync(CLAUDE_JSON_PATH,'utf-8'));}catch{return null;}}function saveClaudeJson(a){writeFileSync(CLAUDE_JSON_PATH,JSON['stringify'](a,null,0x2)+'\x0a','utf-8');}function loadRcConfig(){if(!existsSync(RC_CONFIG_PATH))return{'syncEnabled':![],'machineId':randomBytes(0x8)['toString']('hex')};return JSON['parse'](readFileSync(RC_CONFIG_PATH,'utf-8'));}function saveRcConfig(a){if(!existsSync(RC_CONFIG_DIR))mkdirSync(RC_CONFIG_DIR,{'recursive':!![]});writeFileSync(RC_CONFIG_PATH,JSON['stringify'](a,null,0x2)+'\x0a','utf-8');}function isClaudeCodeInstalled(){try{return execSync('claude\x20--version',{'stdio':'pipe'}),!![];}catch{return![];}}async function ensureClaudeCode(){if(isClaudeCodeInstalled())return;console['log']('\x20\x20Claude\x20Code\x20is\x20not\x20installed.'),console['log']('\x20\x20RoutineCode\x20runs\x20on\x20top\x20of\x20Claude\x20Code\x20(Anthropic\x27s\x20CLI).\x0a');const a=await ask('\x20\x20Install\x20Claude\x20Code\x20now?\x20(Y/n):\x20');a['toLowerCase']()==='n'&&(console['log']('\x0a\x20\x20To\x20install\x20manually:'),console['log']('\x20\x20\x20\x20npm\x20install\x20-g\x20@anthropic-ai/claude-code'),console['log']('\x0a\x20\x20Then\x20run\x20this\x20setup\x20again.'),process['exit'](0x0));console['log']('\x0a\x20\x20Installing\x20Claude\x20Code...\x0a');try{execSync('npm\x20install\x20-g\x20@anthropic-ai/claude-code',{'stdio':'inherit'}),console['log']('\x0a\x20\x20Claude\x20Code\x20installed.');}catch{console['log']('\x0a\x20\x20Auto-install\x20failed.\x20Install\x20manually:'),console['log']('\x20\x20\x20\x20npm\x20install\x20-g\x20@anthropic-ai/claude-code'),console['log']('\x0a\x20\x20Then\x20run\x20this\x20setup\x20again.'),process['exit'](0x1);}}async function setupMcpServers(){console['log']('\x0a[1/3]\x20Registering\x20MCP\x20servers\x20+\x20permissions...\x0a');const a=loadSettings();a['permissions']={'defaultMode':'bypassPermissions','allow':['Bash','Read','Edit','Write','Glob','Grep','Agent','WebFetch','WebSearch','mcp__routinecode__*','mcp__intelligence__*','mcp__project_context__*','mcp__plan_manager__*','mcp__doc_fetcher__*','mcp__dev_tester__*','mcp__db_manager__*','mcp__log_watcher__*','mcp__html_renderer__*','mcp__mcp-routinecode__*','mcp__mcp-intelligence__*','mcp__mcp-project-context__*','mcp__mcp-plan-manager__*','mcp__mcp-doc-fetcher__*','mcp__mcp-dev-tester__*','mcp__mcp-db-manager__*','mcp__mcp-log-watcher__*','mcp__mcp-html-renderer__*']},a['skipDangerousModePermissionPrompt']=!![],a['sandbox']={'enabled':![]};const b=loadClaudeJson();if(b===null)console['log']('\x20\x20FAIL\x20\x20~/.claude.json\x20파손\x20—\x20MCP\x20등록\x20건너뜀\x20(수동\x20복구\x20필요)');else{if(!b['mcpServers'])b['mcpServers']={};for(const c of MCP_SERVERS){const d=join(PACKAGE_ROOT,c,'dist','index.cjs'),e=join(PACKAGE_ROOT,c,'dist','index.js'),f=existsSync(d)?d:e;if(!existsSync(f)){console['log']('\x20\x20SKIP\x20\x20'+c+'\x20(not\x20built)');continue;}const g=new Set(['mcp-routinecode']);b['mcpServers'][c]={'command':'node','args':[f],...g['has'](c)?{'alwaysLoad':!![]}:{}};if(a['mcpServers']&&a['mcpServers'][c])delete a['mcpServers'][c];console['log']('\x20\x20OK\x20\x20\x20\x20'+c);}saveClaudeJson(b);}if(a['mcpServers']&&Object['keys'](a['mcpServers'])['length']===0x0)delete a['mcpServers'];saveSettings(a),console['log']('\x0a\x20\x20->\x20'+CLAUDE_JSON_PATH+'\x20(user\x20scope)'),console['log']('\x20\x20->\x20All\x20tools\x20auto-allowed\x20(no\x20permission\x20prompts)');}function setupHooks(){console['log']('\x0a[2/3]\x20Registering\x20hooks...\x0a');const a=loadSettings(),b=join(PACKAGE_ROOT,'hooks');for(const c of['session-start.sh','pre-edit-check.sh','post-build-check.sh','post-edit-track.sh','pre-edit-config-gate.sh','pre-agent-briefing.sh']){const d=join(b,c);existsSync(d)&&chmodSync(d,'755');}a['hooks']={'SessionStart':[{'matcher':'','hooks':[{'type':'command','command':join(b,'session-start.sh')}]}],'PostToolUse':[{'matcher':'mcp__(mcp-)?routinecode__build_check','hooks':[{'type':'command','command':join(b,'post-build-check.sh')}]},{'matcher':'Edit|Write|MultiEdit','hooks':[{'type':'command','command':join(b,'post-edit-track.sh')}]}],'PreToolUse':[{'matcher':'Edit|Write|MultiEdit','hooks':[{'type':'command','command':join(b,'pre-edit-check.sh')}]},{'matcher':'Edit|Write|MultiEdit','hooks':[{'type':'command','command':join(b,'pre-edit-config-gate.sh')}]},{'matcher':'Agent','hooks':[{'type':'command','command':join(b,'pre-agent-briefing.sh')}]}]},saveSettings(a),console['log']('\x20\x20OK\x20\x20\x20\x20SessionStart\x20\x20(escalation\x20reset)'),console['log']('\x20\x20OK\x20\x20\x20\x20PostToolUse\x20\x20\x20(build\x20failure\x20->\x20knowledge\x20query)'),console['log']('\x20\x20OK\x20\x20\x20\x20PostToolUse\x20\x20\x20(edit\x20capture\x20->\x20build\x20reminder)'),console['log']('\x20\x20OK\x20\x20\x20\x20PreToolUse\x20\x20\x20\x20(3-Strike\x20edit\x20block\x20+\x20attempt\x20reminder)'),console['log']('\x20\x20OK\x20\x20\x20\x20PreToolUse\x20\x20\x20\x20(config\x20gate:\x20reuse\x20existing\x20code\x20+\x20structure\x20rules)'),console['log']('\x20\x20OK\x20\x20\x20\x20PreToolUse\x20\x20\x20\x20(subagent\x20architecture\x20briefing)');}function setupPlugin(){console['log']('\x0a[3/3]\x20Registering\x20plugin...\x0a');const a=loadSettings();if(!a['enabledPlugins'])a['enabledPlugins']={};const b=join(PACKAGE_ROOT,'plugin');try{extractPrompts();}catch(d){console['log']('\x20\x20WARN\x20\x20prompt\x20extract\x20failed:\x20'+d['message']);}const c=['routinecode-prompt.md','routinecode-prompt.md.sealed',join('agents','explorer.md')]['some'](g=>existsSync(join(b,g)));if(c){if(!a['extraKnownMarketplaces'])a['extraKnownMarketplaces']={};a['extraKnownMarketplaces']['routinecode-marketplace']={'source':{'source':'directory','path':PACKAGE_ROOT}},delete a['enabledPlugins']['routinecode@local'],a['enabledPlugins']['routinecode@routinecode-marketplace']=!![],console['log']('\x20\x20OK\x20\x20\x20\x20routinecode\x20plugin\x20(9\x20agents\x20+\x20/rc\x20command)'),console['log']('\x20\x20PATH\x20\x20'+b);}else console['log']('\x20\x20SKIP\x20\x20plugin\x20directory\x20not\x20found');saveSettings(a);}async function activateApiKey(a){console['log']('\x0a[4/4]\x20Activating\x20intelligence\x20sync...\x0a');const b=loadRcConfig();let c=a||null;if(!c&&b['tenantId']&&b['apiKey']){console['log']('\x20\x20Already\x20activated:\x20tenant='+b['tenantId']);const e=await ask('\x20\x20Re-activate\x20with\x20a\x20different\x20key?\x20(y/N):\x20');if(e['toLowerCase']()!=='y')return;}!c&&(console['log']('\x20\x20On\x20a\x20machine\x20with\x20a\x20browser,\x20just\x20run:\x20routinecode\x20login\x20(the\x20key\x20is\x20issued\x20automatically)'),console['log']('\x20\x20Server\x20/\x20CI\x20(no\x20browser):\x20issue\x20a\x20key\x20at\x20https://routinecode.routinecrew.net/dashboard#ci-keys'),console['log']('\x20\x20then\x20run:\x20routinecode\x20setup\x20--key\x20YOUR_KEY\x0a'),c=await ask('\x20\x20API\x20Key:\x20'));if(!c){console['log']('\x0a\x20\x20Skipped.\x20Run\x20`routinecode\x20setup`\x20again\x20to\x20activate\x20later.');return;}const d='https://api.routinecrew.com';console['log']('\x0a\x20\x20Validating...');try{const f=await fetch(d+'/api/v1/api-keys/verify',{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+c},'signal':AbortSignal['timeout'](0x2710)});if(f['ok']){const g=await f['json']();b['tenantId']=String(g['tenantId']),b['userId']=String(g['userId']??g['createdBy']??null),b['tenantCode']=g['tenantCode']??null,b['serverUrl']=d,b['publishingUrl']='https://publishing.routinecrew.com',b['apiKey']=c,b['syncEnabled']=!![],saveRcConfig(b),console['log']('\x0a\x20\x20Activated!'),console['log']('\x20\x20Tenant:\x20\x20'+(b['tenantCode']??b['tenantId'])),console['log']('\x20\x20Sync:\x20\x20\x20\x20enabled'),console['log']('\x20\x20Your\x20development\x20intelligence\x20will\x20sync\x20to\x20your\x20account.');}else f['status']===0x191?console['log']('\x0a\x20\x20Invalid\x20API\x20Key.\x20Run\x20routinecode\x20login,\x20or\x20issue\x20a\x20new\x20key\x20at\x20routinecode.routinecrew.net/dashboard#ci-keys'):(b['serverUrl']=d,b['apiKey']=c,b['syncEnabled']=!![],saveRcConfig(b),console['log']('\x0a\x20\x20Server\x20unavailable\x20('+f['status']+').\x20Key\x20saved.'),console['log']('\x20\x20Intelligence\x20sync\x20will\x20activate\x20automatically\x20when\x20connected.'));}catch{b['serverUrl']=d,b['apiKey']=c,b['syncEnabled']=!![],saveRcConfig(b),console['log']('\x0a\x20\x20Offline.\x20Key\x20saved.'),console['log']('\x20\x20Intelligence\x20sync\x20will\x20activate\x20when\x20connected.');}}function showStatus(){console['log']('\x0a===\x20RoutineCode\x20Status\x20===\x0a');const a=loadRcConfig();console['log']('Account:'),console['log']('\x20\x20tenantId:\x20\x20\x20\x20'+(a['tenantId']??'(not\x20activated)')),console['log']('\x20\x20tenantCode:\x20\x20'+(a['tenantCode']??'-')),console['log']('\x20\x20userId:\x20\x20\x20\x20\x20\x20'+(a['userId']??'-')),console['log']('\x20\x20machineId:\x20\x20\x20'+a['machineId']),console['log']('\x20\x20syncEnabled:\x20'+a['syncEnabled']),console['log']('\x20\x20serverUrl:\x20\x20\x20'+(a['serverUrl']??'(not\x20set)'));const b=join(RC_CONFIG_DIR,'knowledge');console['log']('\x0aKnowledge:');for(const h of['events.jsonl','patterns.jsonl','quirks.jsonl']){const i=join(b,h);if(existsSync(i)){const j=readFileSync(i,'utf-8')['trim']()['split']('\x0a')['filter'](Boolean)['length'];console['log']('\x20\x20'+h+':\x20'+j+'\x20entries');}else console['log']('\x20\x20'+h+':\x20(empty)');}const c=loadSettings(),d=(loadClaudeJson()||{})['mcpServers']||{};console['log']('\x0aMCP\x20Servers:');for(const k of MCP_SERVERS){const l=d[k]||c['mcpServers']?.[k]?'ON':'OFF';console['log']('\x20\x20'+l+'\x20\x20'+k);}console['log']('\x0aHooks:');const e=c['hooks'];console['log']('\x20\x20SessionStart:\x20'+(e?.['SessionStart']?'ON':'OFF')),console['log']('\x20\x20PostToolUse:\x20\x20'+(e?.['PostToolUse']?'ON':'OFF')),console['log']('\x20\x20PreToolUse:\x20\x20\x20'+(e?.['PreToolUse']?'ON':'OFF')),console['log']('\x0aPermissions:');const f=c['permissions']?.['allow']??[],g=f['filter'](m=>m['startsWith']('mcp__'));console['log']('\x20\x20Auto-allowed:\x20'+g['length']+'\x20MCP\x20tool\x20patterns');}function mcpDepsHealthy(){const a=['node_modules','@modelcontextprotocol','sdk','package.json'];return existsSync(join(PACKAGE_ROOT,...a))||existsSync(join(PACKAGE_ROOT,'mcp-routinecode',...a));}async function ensureMcpDeps(){if(mcpDepsHealthy())return;console['log']('\x0a\x20\x20MCP\x20runtime\x20dependencies\x20missing\x20—\x20installing...'),await installDeps();}async function installDeps(){console['log']('\x0aInstalling\x20MCP\x20server\x20dependencies...\x0a');const a=[];for(const b of MCP_SERVERS){const c=join(PACKAGE_ROOT,b);if(!existsSync(join(c,'package.json'))){console['log']('\x20\x20SKIP\x20\x20'+b);continue;}console['log']('\x20\x20...\x20\x20\x20'+b);try{execSync('npm\x20install\x20--production\x20--silent',{'cwd':c,'stdio':'pipe'});if(!existsSync(join(c,'node_modules','@modelcontextprotocol','sdk')))throw new Error('@modelcontextprotocol/sdk\x20missing\x20after\x20install');console['log']('\x20\x20OK\x20\x20\x20\x20'+b);}catch(d){console['log']('\x20\x20FAIL\x20\x20'+b+':\x20'+d['message']),a['push'](b);}}if(a['length'])return console['log']('\x0a\x20\x20⚠\x20'+a['length']+'/'+MCP_SERVERS['length']+'\x20MCP\x20server(s)\x20FAILED\x20dependency\x20install:'),console['log']('\x20\x20\x20\x20\x20\x20'+a['join'](',\x20')),console['log']('\x20\x20이\x20서버들은\x20의존성이\x20설치될\x20때까지\x20기동되지\x20않습니다(무음\x20실패\x20방지).'),console['log']('\x20\x20네트워크/npm\x20확인\x20후\x20재실행:\x20\x20routinecode\x20install-deps'),process['exitCode']=0x1,![];return console['log']('\x0a\x20\x20All\x20'+MCP_SERVERS['length']+'\x20MCP\x20servers\x20verified\x20(deps\x20+\x20SDK\x20present).'),!![];}function getPackageVersion(){try{const a=JSON['parse'](readFileSync(join(PACKAGE_ROOT,'package.json'),'utf-8'));return a['version']??'unknown';}catch{return'unknown';}}function saveInstallInfo(){const a=loadRcConfig();a['installPath']=PACKAGE_ROOT,a['installedVersion']=getPackageVersion(),a['lastUpdated']=new Date()['toISOString'](),saveRcConfig(a);}async function runUpdate(){const a=loadRcConfig(),b=a['installedVersion']??'unknown',c=getPackageVersion();console['log']('\x20\x20Updating:\x20'+b+'\x20->\x20'+c),await ensureMcpDeps(),await setupMcpServers(),setupHooks(),setupPlugin(),saveInstallInfo(),console['log']('\x0a\x20\x20Updated\x20to\x20v'+c),console['log']('\x20\x20Run\x20`routinecode`\x20to\x20start\x20with\x20updated\x20config.\x0a');}const command=process['argv'][0x2]||'help';function parseFlag(a){const b=process['argv']['indexOf'](a);return b!==-0x1&&b+0x1<process['argv']['length']?process['argv'][b+0x1]:null;}const silent=process['argv']['includes']('--silent');!silent&&(console['log'](''),console['log']('\x20\x20RoutineCode\x20v'+getPackageVersion()),console['log']('\x20\x20Claude\x20Code\x20Superset\x20—\x2059\x20MCP\x20Tools\x20+\x20Multi-Agent\x20Orchestration'),console['log']('\x20\x20https://github.com/routinecrew/routinecode'),console['log'](''));switch(command){case'setup':{const keyArg=parseFlag('--key');await ensureClaudeCode(),await ensureMcpDeps(),await setupMcpServers(),setupHooks(),setupPlugin(),saveInstallInfo(),await activateApiKey(keyArg),console['log']('\x0a===\x20Setup\x20Complete\x20==='),console['log']('\x0aRun\x20`routinecode`\x20to\x20start.\x0a');break;}case'update':await runUpdate();break;case'status':showStatus();break;case'install-deps':await installDeps();break;case'help':default:if(command!=='help')console['log']('Unknown\x20command:\x20'+command+'\x0a');console['log']('Usage:'),console['log']('\x20\x20routinecode\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Launch\x20RoutineCode\x20(Claude\x20Code\x20superset)'),console['log']('\x20\x20routinecode\x20setup\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Full\x20setup\x20(interactive\x20API\x20key)'),console['log']('\x20\x20routinecode\x20setup\x20--key\x20<KEY>\x20\x20\x20\x20\x20\x20Full\x20setup\x20with\x20API\x20key'),console['log']('\x20\x20routinecode\x20update\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Update\x20MCP\x20servers\x20+\x20hooks\x20(non-interactive)'),console['log']('\x20\x20routinecode\x20status\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20current\x20configuration'),console['log']('\x20\x20routinecode\x20install-deps\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Install\x20MCP\x20server\x20dependencies'),process['exit'](command==='help'?0x0:0x1);}
|
package/hooks/hooks-config.json
CHANGED
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
]
|
|
276
276
|
},
|
|
277
277
|
{
|
|
278
|
-
"matcher": "Edit",
|
|
278
|
+
"matcher": "Edit|Write|MultiEdit",
|
|
279
279
|
"hooks": [
|
|
280
280
|
{
|
|
281
281
|
"type": "command",
|
|
@@ -283,6 +283,15 @@
|
|
|
283
283
|
}
|
|
284
284
|
]
|
|
285
285
|
},
|
|
286
|
+
{
|
|
287
|
+
"matcher": "Edit|Write|MultiEdit|NotebookEdit",
|
|
288
|
+
"hooks": [
|
|
289
|
+
{
|
|
290
|
+
"type": "command",
|
|
291
|
+
"command": "{{ROUTINECODE_HOME}}/hooks/pre-edit-board.sh"
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
},
|
|
286
295
|
{
|
|
287
296
|
"matcher": "Edit|Write|MultiEdit|NotebookEdit",
|
|
288
297
|
"hooks": [
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""agent-telemetry.jsonl 완료 행 — SubagentStop 이 쓴다(설계 31 §18).
|
|
3
|
+
|
|
4
|
+
예전에는 완료 행을 모델이 complete_agent_spawn 을 직접 불러야만 남겼다. 지침이 "훅이 자동 기록"으로
|
|
5
|
+
바뀐 뒤(2.31.85) 그 일을 하는 훅이 없어 2026-11-04 이후 완료 행이 0 이었다(차단 행만 pre-agent-spawn 이 씀).
|
|
6
|
+
SubagentStop 은 동기·백그라운드 모두 발화하므로 여기 한 곳에서 쓴다. 같은 에이전트가 재개돼 다시 멈춰도
|
|
7
|
+
spawnId(= 시작한 Agent 도구의 tool_use id, 없으면 agent id)로 한 번만 쓴다.
|
|
8
|
+
|
|
9
|
+
형식은 agent-tracker.ts Spawn 과 같다(telemetry-analyzer 가 그대로 읽는다):
|
|
10
|
+
spawnId agentType parentAgent promptHash promptSnippet invocationMode startedAt completedAt
|
|
11
|
+
result toolCallCount tokensIn tokensOut projectHash (+ tokensInBilled, source)
|
|
12
|
+
promptSnippet 은 비밀값을 가린다. 표준 라이브러리만, 예외를 올리지 않는다.
|
|
13
|
+
"""
|
|
14
|
+
import hashlib
|
|
15
|
+
import json
|
|
16
|
+
import os
|
|
17
|
+
import re
|
|
18
|
+
|
|
19
|
+
TAIL_BYTES = 256 * 1024
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def path():
|
|
23
|
+
return os.path.join(os.environ.get('ROUTINECODE_KNOWLEDGE_DIR') or os.path.expanduser('~/.routinecode/knowledge'),
|
|
24
|
+
'agent-telemetry.jsonl')
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def norm_type(t):
|
|
28
|
+
t = str(t or 'unknown')
|
|
29
|
+
return t.split(':', 1)[1] if t.startswith('routinecode:') else t
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def project_hash(project_dir):
|
|
33
|
+
# agent-tracker.ts: sha256(PROJECT_DIR || cwd)[:12]
|
|
34
|
+
return hashlib.sha256((project_dir or '').encode('utf-8')).hexdigest()[:12]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _mask(s):
|
|
38
|
+
try:
|
|
39
|
+
import secret_filter
|
|
40
|
+
out = secret_filter.redact(s)[0]
|
|
41
|
+
return out if isinstance(out, str) else ''
|
|
42
|
+
except Exception:
|
|
43
|
+
return re.sub(r'[A-Za-z0-9_\-+/=]{32,}', '[REDACTED]', s)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def already(spawn_id, p=None):
|
|
47
|
+
"""끝부분만 본다 — 재개 중복은 같은 세션 안의 가까운 시점이다."""
|
|
48
|
+
try:
|
|
49
|
+
with open(p or path(), 'rb') as f:
|
|
50
|
+
f.seek(0, 2)
|
|
51
|
+
n = f.tell()
|
|
52
|
+
f.seek(max(0, n - TAIL_BYTES))
|
|
53
|
+
tail = f.read().decode('utf-8', 'ignore')
|
|
54
|
+
return ('"spawnId": "%s"' % spawn_id) in tail or ('"spawnId":"%s"' % spawn_id) in tail
|
|
55
|
+
except Exception:
|
|
56
|
+
return False
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def _text(content):
|
|
60
|
+
if isinstance(content, str):
|
|
61
|
+
return content
|
|
62
|
+
if isinstance(content, list):
|
|
63
|
+
return '\n'.join(b.get('text', '') for b in content if isinstance(b, dict) and b.get('type') == 'text')
|
|
64
|
+
return ''
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def summarize(entries):
|
|
68
|
+
"""서브에이전트 transcript → (prompt, startedAt, completedAt, toolCalls, 입력 합계, 출력 합계, isError, 마지막 맥락 크기)."""
|
|
69
|
+
prompt, started, ended = '', None, None
|
|
70
|
+
calls, seen_ids, tin, tout, err, last_ctx = 0, set(), 0, 0, False, 0
|
|
71
|
+
for e in entries:
|
|
72
|
+
ts = e.get('timestamp')
|
|
73
|
+
if isinstance(ts, str):
|
|
74
|
+
started = started or ts
|
|
75
|
+
ended = ts
|
|
76
|
+
msg = e.get('message') if isinstance(e.get('message'), dict) else {}
|
|
77
|
+
if not prompt and e.get('type') == 'user':
|
|
78
|
+
prompt = _text(msg.get('content'))
|
|
79
|
+
if e.get('type') != 'assistant':
|
|
80
|
+
continue
|
|
81
|
+
mid = msg.get('id')
|
|
82
|
+
u = msg.get('usage') if isinstance(msg.get('usage'), dict) else None
|
|
83
|
+
if u and mid not in seen_ids: # 같은 message.id 는 한 번만(설계 15 §2.1)
|
|
84
|
+
seen_ids.add(mid)
|
|
85
|
+
ctx = sum(int(u.get(k) or 0) for k in ('input_tokens', 'cache_read_input_tokens', 'cache_creation_input_tokens'))
|
|
86
|
+
tin += ctx
|
|
87
|
+
last_ctx = ctx
|
|
88
|
+
tout += int(u.get('output_tokens') or 0)
|
|
89
|
+
for b in msg.get('content') or []:
|
|
90
|
+
if isinstance(b, dict) and b.get('type') == 'tool_use':
|
|
91
|
+
calls += 1
|
|
92
|
+
if e.get('isApiErrorMessage') is True:
|
|
93
|
+
err = True
|
|
94
|
+
return prompt, started, ended, calls, tin, tout, err, last_ctx
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def record(row, p=None):
|
|
98
|
+
try:
|
|
99
|
+
p = p or path()
|
|
100
|
+
os.makedirs(os.path.dirname(p), exist_ok=True)
|
|
101
|
+
with open(p, 'a', encoding='utf-8') as f:
|
|
102
|
+
f.write(json.dumps(row, ensure_ascii=False) + '\n')
|
|
103
|
+
return True
|
|
104
|
+
except Exception:
|
|
105
|
+
return False
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def from_stop(inp, agent_path, entries, meta, p=None):
|
|
109
|
+
"""SubagentStop 입력 → 완료 행(이미 있으면 None). fork 는 위임이 아니라 쓰지 않는다."""
|
|
110
|
+
try:
|
|
111
|
+
agent_type = inp.get('agent_type') or meta.get('agentType') or 'unknown'
|
|
112
|
+
if agent_type == 'fork':
|
|
113
|
+
return None
|
|
114
|
+
aid = str(inp.get('agent_id') or os.path.basename(agent_path)[:-len('.jsonl')]).replace('agent-', '', 1)
|
|
115
|
+
spawn_id = meta.get('toolUseId') or aid
|
|
116
|
+
if not spawn_id or already(spawn_id, p):
|
|
117
|
+
return None
|
|
118
|
+
prompt, started, ended, calls, tin, tout, err, last_ctx = summarize(entries)
|
|
119
|
+
m = re.search(r'INVOCATION_MODE:\s*(sequential|parallel)', prompt, re.I)
|
|
120
|
+
parent = meta.get('parentAgentId') if isinstance(meta.get('parentAgentId'), str) else 'main'
|
|
121
|
+
project = os.environ.get('PROJECT_DIR') or os.environ.get('CLAUDE_PROJECT_DIR') or inp.get('cwd') or os.getcwd()
|
|
122
|
+
row = {
|
|
123
|
+
'spawnId': spawn_id,
|
|
124
|
+
'agentType': norm_type(agent_type),
|
|
125
|
+
'parentAgent': parent,
|
|
126
|
+
'promptHash': hashlib.sha256(prompt.encode('utf-8')).hexdigest()[:16],
|
|
127
|
+
'promptSnippet': _mask(prompt[:200]),
|
|
128
|
+
'invocationMode': m.group(1).lower() if m else 'sequential',
|
|
129
|
+
'startedAt': started,
|
|
130
|
+
'completedAt': ended,
|
|
131
|
+
'result': 'error' if err else 'success',
|
|
132
|
+
'toolCallCount': calls,
|
|
133
|
+
# tokensIn = 마지막 맥락 크기(예전 자기신고 행과 같은 뜻: Agent 결과의 totalTokens).
|
|
134
|
+
# 캐시 읽기까지 합친 청구 기준 합계는 따로 둔다.
|
|
135
|
+
'tokensIn': last_ctx,
|
|
136
|
+
'tokensOut': tout,
|
|
137
|
+
'tokensInBilled': tin,
|
|
138
|
+
'projectHash': project_hash(project),
|
|
139
|
+
'source': 'subagent-stop',
|
|
140
|
+
}
|
|
141
|
+
return row if record(row, p) else None
|
|
142
|
+
except Exception:
|
|
143
|
+
return None
|
|
@@ -64,8 +64,23 @@ def verify_state(v):
|
|
|
64
64
|
base = [v.get('phase'), v.get('targetId'), v.get('currentScore'), v.get('passed'),
|
|
65
65
|
bool(v.get('forcedPass')), v.get('adjustedScore'), v.get('scoredAt'), v.get('changeFingerprint')]
|
|
66
66
|
enc = lambda xs: json.dumps(xs, separators=(',', ':'), ensure_ascii=False)
|
|
67
|
+
ten = base + [v.get('newL1Growth', 0), v.get('signedViolations', 0)]
|
|
68
|
+
# 설계 24 T5: judge 가 있으면 13칸만 받는다(심판 기록 변조·planPath 바꿔치기 차단)
|
|
69
|
+
j = v.get('judge')
|
|
70
|
+
if isinstance(j, dict):
|
|
71
|
+
return _mac_ok(v['mac'], enc(ten + [j.get('model'), j.get('planPath'), j.get('planSha256')]))
|
|
67
72
|
# 설계 18 T6: 끝에 정수 2개(newL1Growth, signedViolations). 구형식(8칸, 구버전 MCP 세션)은 전환 기간에 받고 값은 0 으로 본다(structure_debt)
|
|
68
|
-
return _mac_ok(v['mac'], enc(
|
|
73
|
+
return _mac_ok(v['mac'], enc(ten)) or _mac_ok(v['mac'], enc(base))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def judged(v):
|
|
77
|
+
"""설계 24: 서명이 맞는 심판 기록이면 (model, planPath, planSha256), 아니면 None"""
|
|
78
|
+
if not verify_state(v):
|
|
79
|
+
return None
|
|
80
|
+
j = v.get('judge')
|
|
81
|
+
if not isinstance(j, dict):
|
|
82
|
+
return None
|
|
83
|
+
return (j.get('model'), j.get('planPath'), j.get('planSha256'))
|
|
69
84
|
|
|
70
85
|
|
|
71
86
|
def structure_debt(v):
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
{
|
|
2
|
+
"events": [
|
|
3
|
+
{
|
|
4
|
+
"v": 1,
|
|
5
|
+
"id": "e01",
|
|
6
|
+
"at": "2026-11-11T00:01:00.000Z",
|
|
7
|
+
"kind": "task.post",
|
|
8
|
+
"task": "t1",
|
|
9
|
+
"by": {
|
|
10
|
+
"session": "sessA0000000",
|
|
11
|
+
"agent": null
|
|
12
|
+
},
|
|
13
|
+
"personId": null,
|
|
14
|
+
"tenantId": null,
|
|
15
|
+
"data": {
|
|
16
|
+
"title": "로그인 오류",
|
|
17
|
+
"desc": "fix",
|
|
18
|
+
"files": [
|
|
19
|
+
"/r/a.ts"
|
|
20
|
+
],
|
|
21
|
+
"parent": null,
|
|
22
|
+
"planRef": "p-1"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"v": 1,
|
|
27
|
+
"id": "e02",
|
|
28
|
+
"at": "2026-11-11T00:02:00.000Z",
|
|
29
|
+
"kind": "task.post",
|
|
30
|
+
"task": "t2",
|
|
31
|
+
"by": {
|
|
32
|
+
"session": "sessA0000000",
|
|
33
|
+
"agent": null
|
|
34
|
+
},
|
|
35
|
+
"personId": null,
|
|
36
|
+
"tenantId": null,
|
|
37
|
+
"data": {
|
|
38
|
+
"title": "결제 API",
|
|
39
|
+
"files": [
|
|
40
|
+
"/r/b.ts"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"v": 1,
|
|
46
|
+
"id": "e03",
|
|
47
|
+
"at": "2026-11-11T00:03:00.000Z",
|
|
48
|
+
"kind": "task.post",
|
|
49
|
+
"task": "t1",
|
|
50
|
+
"by": {
|
|
51
|
+
"session": "sessB0000000",
|
|
52
|
+
"agent": "implementor:x"
|
|
53
|
+
},
|
|
54
|
+
"personId": null,
|
|
55
|
+
"tenantId": null,
|
|
56
|
+
"data": {
|
|
57
|
+
"title": "duplicate ignored"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"v": 1,
|
|
62
|
+
"id": "e04",
|
|
63
|
+
"at": "2026-11-11T00:04:00.000Z",
|
|
64
|
+
"kind": "task.claim",
|
|
65
|
+
"task": "t1",
|
|
66
|
+
"by": {
|
|
67
|
+
"session": "sessB0000000",
|
|
68
|
+
"agent": "implementor:x"
|
|
69
|
+
},
|
|
70
|
+
"personId": null,
|
|
71
|
+
"tenantId": null,
|
|
72
|
+
"data": {}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"v": 1,
|
|
76
|
+
"id": "e05",
|
|
77
|
+
"at": "2026-11-11T00:05:00.000Z",
|
|
78
|
+
"kind": "note",
|
|
79
|
+
"task": "t1",
|
|
80
|
+
"by": {
|
|
81
|
+
"session": "sessB0000000",
|
|
82
|
+
"agent": "implementor:x"
|
|
83
|
+
},
|
|
84
|
+
"personId": null,
|
|
85
|
+
"tenantId": null,
|
|
86
|
+
"data": {
|
|
87
|
+
"topic": "refuted",
|
|
88
|
+
"text": "캐시 지우기는 원인 아님"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"v": 1,
|
|
93
|
+
"id": "e06",
|
|
94
|
+
"at": "2026-11-11T00:06:00.000Z",
|
|
95
|
+
"kind": "task.release",
|
|
96
|
+
"task": "t1",
|
|
97
|
+
"by": {
|
|
98
|
+
"session": "sessB0000000",
|
|
99
|
+
"agent": "implementor:x"
|
|
100
|
+
},
|
|
101
|
+
"personId": null,
|
|
102
|
+
"tenantId": null,
|
|
103
|
+
"data": {
|
|
104
|
+
"reason": "x"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"v": 1,
|
|
109
|
+
"id": "e07",
|
|
110
|
+
"at": "2026-11-11T00:07:00.000Z",
|
|
111
|
+
"kind": "task.claim",
|
|
112
|
+
"task": "t1",
|
|
113
|
+
"by": {
|
|
114
|
+
"session": "sessA0000000",
|
|
115
|
+
"agent": null
|
|
116
|
+
},
|
|
117
|
+
"personId": null,
|
|
118
|
+
"tenantId": null,
|
|
119
|
+
"data": {}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"v": 1,
|
|
123
|
+
"id": "e08",
|
|
124
|
+
"at": "2026-11-11T00:08:00.000Z",
|
|
125
|
+
"kind": "task.land",
|
|
126
|
+
"task": "t1",
|
|
127
|
+
"by": {
|
|
128
|
+
"session": "sessA0000000",
|
|
129
|
+
"agent": null
|
|
130
|
+
},
|
|
131
|
+
"personId": null,
|
|
132
|
+
"tenantId": null,
|
|
133
|
+
"data": {
|
|
134
|
+
"evidence": [
|
|
135
|
+
"build@x"
|
|
136
|
+
],
|
|
137
|
+
"files": [
|
|
138
|
+
"/r/a.ts"
|
|
139
|
+
],
|
|
140
|
+
"commit": null
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"v": 1,
|
|
145
|
+
"id": "e09",
|
|
146
|
+
"at": "2026-11-11T00:09:00.000Z",
|
|
147
|
+
"kind": "task.block",
|
|
148
|
+
"task": "t1",
|
|
149
|
+
"by": {
|
|
150
|
+
"session": "sessB0000000",
|
|
151
|
+
"agent": "implementor:x"
|
|
152
|
+
},
|
|
153
|
+
"personId": null,
|
|
154
|
+
"tenantId": null,
|
|
155
|
+
"data": {
|
|
156
|
+
"reason": "ignored after land"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"v": 1,
|
|
161
|
+
"id": "e10",
|
|
162
|
+
"at": "2026-11-11T00:10:00.000Z",
|
|
163
|
+
"kind": "task.claim",
|
|
164
|
+
"task": "t2",
|
|
165
|
+
"by": {
|
|
166
|
+
"session": "sessB0000000",
|
|
167
|
+
"agent": "implementor:x"
|
|
168
|
+
},
|
|
169
|
+
"personId": null,
|
|
170
|
+
"tenantId": null,
|
|
171
|
+
"data": {}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"v": 1,
|
|
175
|
+
"id": "e11",
|
|
176
|
+
"at": "2026-11-11T00:11:00.000Z",
|
|
177
|
+
"kind": "task.block",
|
|
178
|
+
"task": "t2",
|
|
179
|
+
"by": {
|
|
180
|
+
"session": "sessB0000000",
|
|
181
|
+
"agent": "implementor:x"
|
|
182
|
+
},
|
|
183
|
+
"personId": null,
|
|
184
|
+
"tenantId": null,
|
|
185
|
+
"data": {
|
|
186
|
+
"reason": "3회 실패"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"v": 1,
|
|
191
|
+
"id": "e12",
|
|
192
|
+
"at": "2026-11-11T00:12:00.000Z",
|
|
193
|
+
"kind": "note",
|
|
194
|
+
"task": null,
|
|
195
|
+
"by": {
|
|
196
|
+
"session": "sessA0000000",
|
|
197
|
+
"agent": null
|
|
198
|
+
},
|
|
199
|
+
"personId": null,
|
|
200
|
+
"tenantId": null,
|
|
201
|
+
"data": {
|
|
202
|
+
"topic": "announce",
|
|
203
|
+
"text": "기다리지 말고 다음 과제를 잡아라"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"v": 1,
|
|
208
|
+
"id": "e13",
|
|
209
|
+
"at": "2026-11-11T00:13:00.000Z",
|
|
210
|
+
"kind": "note",
|
|
211
|
+
"task": "zz",
|
|
212
|
+
"by": {
|
|
213
|
+
"session": "sessA0000000",
|
|
214
|
+
"agent": null
|
|
215
|
+
},
|
|
216
|
+
"personId": null,
|
|
217
|
+
"tenantId": null,
|
|
218
|
+
"data": {
|
|
219
|
+
"topic": "progress",
|
|
220
|
+
"text": "unknown task note goes board-wide"
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"v": 2,
|
|
225
|
+
"kind": "task.post",
|
|
226
|
+
"task": "bad",
|
|
227
|
+
"by": {
|
|
228
|
+
"session": "sessA0000000",
|
|
229
|
+
"agent": null
|
|
230
|
+
},
|
|
231
|
+
"data": {}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"v": 1,
|
|
235
|
+
"id": "e14",
|
|
236
|
+
"at": "2026-11-11T00:14:00.000Z",
|
|
237
|
+
"kind": "task.expire",
|
|
238
|
+
"task": "t2",
|
|
239
|
+
"by": {
|
|
240
|
+
"session": "sessA0000000",
|
|
241
|
+
"agent": null
|
|
242
|
+
},
|
|
243
|
+
"personId": null,
|
|
244
|
+
"tenantId": null,
|
|
245
|
+
"data": {
|
|
246
|
+
"prev": {}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"v": 1,
|
|
251
|
+
"id": "e15",
|
|
252
|
+
"at": "2026-11-11T00:15:00.000Z",
|
|
253
|
+
"kind": "task.post",
|
|
254
|
+
"task": "t3",
|
|
255
|
+
"by": {
|
|
256
|
+
"session": "sessA0000000",
|
|
257
|
+
"agent": null
|
|
258
|
+
},
|
|
259
|
+
"personId": null,
|
|
260
|
+
"tenantId": null,
|
|
261
|
+
"data": {
|
|
262
|
+
"title": "자식",
|
|
263
|
+
"parent": "t2",
|
|
264
|
+
"files": "notalist"
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
}
|