AI協調開発研究ドキュメントの完成と Phase 10.9-β 進捗
【AI協調開発研究】 - AI二重化モデルの学術論文draft完成(workshop_paper_draft.md) - 「隠れた危機」分析とbirthの原則哲学化 - TyEnv「唯一の真実」協調会話を保存・研究資料に統合 - papers管理構造の整備(wip/under-review/published分離) 【Phase 10.9-β HostCall進捗】 - JitConfigBox: relax_numeric フラグ追加(i64→f64コアーション制御) - HostcallRegistryBox: 署名検証・白黒リスト・コアーション対応 - JitHostcallRegistryBox: Nyash側レジストリ操作API - Lower統合: env直読 → jit::config::current() 参照に統一 - 数値緩和設定: NYASH_JIT_HOSTCALL_RELAX_NUMERIC/Config.set_flag 【検証サンプル拡充】 - math.sin/cos/abs/min/max 関数スタイル(examples/jit_math_function_style_*.nyash) - 境界ケース: 署名不一致・コアーション許可・mutating拒否サンプル - E2E実証: String.length→allow, Array.push→fallback, math関数の署名一致観測 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
122
tools/codex-tmux-driver/bridge-control.js
Normal file
122
tools/codex-tmux-driver/bridge-control.js
Normal file
@ -0,0 +1,122 @@
|
||||
// bridge-control.js
|
||||
// Codex-Claudeブリッジの制御用CLI
|
||||
|
||||
const WebSocket = require('ws');
|
||||
const readline = require('readline');
|
||||
|
||||
const ws = new WebSocket('ws://localhost:8768');
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
prompt: 'Bridge> '
|
||||
});
|
||||
|
||||
// 接続時の処理
|
||||
ws.on('open', () => {
|
||||
console.log('🌉 Connected to Codex-Claude Bridge');
|
||||
console.log('Commands:');
|
||||
console.log(' status - Show bridge status');
|
||||
console.log(' queue - Show pending items');
|
||||
console.log(' approve N - Approve queue item N');
|
||||
console.log(' toggle - Enable/disable bridge');
|
||||
console.log(' exit - Quit');
|
||||
console.log('');
|
||||
|
||||
// 初期ステータス取得
|
||||
ws.send(JSON.stringify({ op: 'status' }));
|
||||
|
||||
rl.prompt();
|
||||
});
|
||||
|
||||
ws.on('message', (data) => {
|
||||
const msg = JSON.parse(data);
|
||||
|
||||
switch (msg.type) {
|
||||
case 'status':
|
||||
console.log('\n📊 Bridge Status:');
|
||||
console.log(` Active: ${msg.state.active ? '✅' : '❌'}`);
|
||||
console.log(` Bridges: ${msg.state.bridgeCount}`);
|
||||
console.log(` Queue: ${msg.state.queue.length} items`);
|
||||
console.log('\n📈 Statistics:');
|
||||
console.log(` Total: ${msg.stats.total}`);
|
||||
console.log(` Forwarded: ${msg.stats.forwarded}`);
|
||||
console.log(` Blocked: ${msg.stats.blocked}`);
|
||||
console.log(` Queued: ${msg.stats.queued}`);
|
||||
break;
|
||||
|
||||
case 'queue':
|
||||
console.log('\n📋 Pending Queue:');
|
||||
if (msg.items.length === 0) {
|
||||
console.log(' (empty)');
|
||||
} else {
|
||||
msg.items.forEach((item, idx) => {
|
||||
console.log(` [${idx}] ${item.reason.reason}`);
|
||||
console.log(` "${item.message.data.substring(0, 50)}..."`);
|
||||
console.log(` ${new Date(item.timestamp).toLocaleTimeString()}`);
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case 'toggled':
|
||||
console.log(`\n🔄 Bridge is now ${msg.active ? 'ACTIVE' : 'INACTIVE'}`);
|
||||
break;
|
||||
|
||||
default:
|
||||
console.log(`\n[${msg.type}]`, msg);
|
||||
}
|
||||
|
||||
rl.prompt();
|
||||
});
|
||||
|
||||
ws.on('error', (err) => {
|
||||
console.error('❌ Connection error:', err.message);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
ws.on('close', () => {
|
||||
console.log('\n🔌 Disconnected');
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
// コマンド処理
|
||||
rl.on('line', (line) => {
|
||||
const parts = line.trim().split(' ');
|
||||
const cmd = parts[0];
|
||||
|
||||
switch (cmd) {
|
||||
case 'status':
|
||||
ws.send(JSON.stringify({ op: 'status' }));
|
||||
break;
|
||||
|
||||
case 'queue':
|
||||
ws.send(JSON.stringify({ op: 'queue' }));
|
||||
break;
|
||||
|
||||
case 'approve':
|
||||
const id = parseInt(parts[1]);
|
||||
if (!isNaN(id)) {
|
||||
ws.send(JSON.stringify({ op: 'approve', id }));
|
||||
console.log(`✅ Approving item ${id}...`);
|
||||
} else {
|
||||
console.log('❌ Usage: approve <number>');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'toggle':
|
||||
ws.send(JSON.stringify({ op: 'toggle' }));
|
||||
break;
|
||||
|
||||
case 'exit':
|
||||
case 'quit':
|
||||
ws.close();
|
||||
rl.close();
|
||||
return;
|
||||
|
||||
default:
|
||||
if (cmd) {
|
||||
console.log(`❓ Unknown command: ${cmd}`);
|
||||
}
|
||||
}
|
||||
|
||||
rl.prompt();
|
||||
});
|
||||
Reference in New Issue
Block a user