@claude-flow/plugin-加斯敦-桥
@claude-flow/plugin-加斯敦-桥 —— 允许代理驱动的 Ruflo 插件 天然气镇 通过经过验证的MCP工具调用 gt 财务报告和审定财务报表 bd (原始内容存档于2018-03-26). CLIs.
支持的环境 : 节点:js 20+- 无害环境管理和共同JS- gt编号 :bd 现场通话的CLI
快速启动
npm install @claude-flow/plugin-gastown-bridge
import { GasTownBridgePlugin, validateBeadId } from '@claude-flow/plugin-gastown-bridge';
const plugin = new GasTownBridgePlugin();
console.log('tools:', plugin.getMCPTools().length);
console.log('bead id:', validateBeadId('gt-abc12'));
try {
validateBeadId('gt-abc; echo injected');
} catch (err) {
console.log('rejected:', err.code);
}
预期产出:
tools: 20
bead id: gt-abc12
rejected: GT_INVALID_BEAD_ID
安装到 Ruflo 工程中 @claude-flow/cli数字 : npx @claude-flow/cli@latest plugins install -n @claude-flow/plugin-gastown-bridge。 。 。 .
WASM-加速桥通向史蒂夫·耶格的天然气镇多能代理 Orchestrator
导言
这个 煤气镇桥插件 给史蒂夫·耶格带来力量 天然气镇 claude Flow V3的多代理管弦乐手. Gas Town)引入了经过战斗测试的持久工作流程执行概念,以补充克洛德·福林斯(Claude Flow)的群情.
煤气镇是什么?
Gas Town是一个75 000行的Go编码基地,执行:
- 圆珠 - 以图表语义进行Git后置问题跟踪
- 公式 - TOML定义的工作流程(召集、工作流程、扩展、方面)
- 车队 - 追踪代理之间“沉滞”工作的工作订单
- 几内亚 - Gastown Universal Propulsion 相撞性处决原则
- 分子/风向 - 链式工作单元,用于持久、可恢复的工作流程
为什么是这个插件?
| 挑战 | 解决方案 |
|---|---|
| 煤气镇只有GO | CLI 桥包 gt 财务报告和审定财务报表 bd 命令 |
| 无法编译到 WASM( syscalls) | 混合结构: I/O 的 CLI, WASM 的计算 |
| JS 的公式解析很慢 | Rust-WASM公司提供 352x 加速 |
| 图形操作瓶颈 | WASM DAG行动是 150个更快 |
特征
QQ WASM 加速计算
| 运行 | Java 脚本 | 刚才 | 加速 |
|---|---|---|---|
| 公式解析( TOML- AST) | 53分钟 | 0.15毫米口径 | 352辆 |
| 可变烹饪 | 35分钟 | 0.1毫米口径 | 350辆 |
| 批量厨师(10个配方) | 350毫米口径 | 1分钟 | 350辆 |
| DAG 地理学类 | 75分钟 | 0.5ms (单位:千米) | 150辆 |
| 循环检测 | 45分钟 | 0.3 分钟 | 150辆 |
| 关键路径分析 | 120毫米口径 | 0.8毫米口径 | 150辆 |
| 模式搜索( HNSW) | 5000亿 | 5分钟 | 1000x- 12500x 车型 |
20 MCP 工具
┌─────────────────────────────────────────────────────────────┐
│ MCP Tool Categories │
├─────────────────┬─────────────────┬─────────────────────────┤
│ Beads (5) │ Convoy (3) │ Formula (4) │
│ ├─ create │ ├─ create │ ├─ list │
│ ├─ ready │ ├─ status │ ├─ cook (WASM) │
│ ├─ show │ └─ track │ ├─ execute │
│ ├─ dep │ │ └─ create │
│ └─ sync │ │ │
├─────────────────┼─────────────────┼─────────────────────────┤
│ Orchestration │ WASM (5) │ │
│ ├─ sling │ ├─ parse │ │
│ ├─ agents │ ├─ resolve │ │
│ └─ mail │ ├─ cook_batch │ │
│ │ ├─ match │ │
│ │ └─ optimize │ │
└─────────────────┴─────────────────┴─────────────────────────┘
安全第一设计
- 输入验证: 所有参数的 Zod 计划
- 指令注射预防: 只允许列表的 CLI 执行
- 路径倾覆保护: 严格路径验证
- 不执行贝壳: 用途
execFile与shell: false
QQ 双向同步
Gas Town's Beads和克洛德·福福德的代理DB之间无缝同步:
┌──────────────┐ SyncBridge ┌──────────────┐
│ │ ←───────────────→ │ │
│ Beads │ Conflict Res. │ AgentDB │
│ (JSONL) │ • beads-wins │ (SQLite) │
│ │ • newest-wins │ │
│ │ • merge │ │
└──────────────┘ └──────────────┘
增强和比较
煤气镇诉克洛德福克 V3
| 特性 | 天然气镇 | 克洛德·福克通 V3 | 使用此插件 |
|---|---|---|---|
| 问题跟踪 | 圆珠( 吉特后置) | 代理数据库 | 统一同步 |
| 工作流量 | TOML 公式 | 类型脚本 | 两者均获得支持 |
| 代理角色 | 市长,波兰猫,船员 | 等级组合 | 互可操作 |
| 崩溃恢复 | GUPP 钩 | 持续会期 | 合并 |
| 工作分布 | 铃声 | 任务协调 | 通过吊桥工具 |
| 模式搜索 | 不详 | HNSW(慢联署材料) | HNSW WASM(1 000x更快) |
业绩比较
| 度量衡 | 纯 Java 脚本 | 此插件( WASM) | 改进 |
|---|---|---|---|
| 公式解析 | 53分钟 | 0.15毫米口径 | 352转快 |
| 百节点 DAG 排序 | 75分钟 | 0.5ms (单位:千米) | 150个更快 |
| 模式搜索( 10k) | 5000亿 | 5分钟 | 1000个更快 |
| 内存使用情况 | 48MB (英语) | 12MB (英语) | 减少4倍 |
| 启动时间 | 850毫米口径 | 120毫米口径 | 7个更快 |
结构比较
| 方针 | 专业 | 计数 | 此插件 |
|---|---|---|---|
| 完整类型脚本端口 | 原生,无道具 | 75克到端口的线路 | ❌ |
| Go WASM 编译 | 重用代码 | Syscalls 挡住它 | ❌ |
| 纯 CLI 桥 | 简单 | 计算慢 | 部分内容 |
| 混合CLI+WASM | 两者中最好的 | 两个密码库 | 选中 |
安装
# Install via Claude Flow CLI (recommended)
npx claude-flow@latest plugins install -n @claude-flow/plugin-gastown-bridge
# Or install directly via npm
npm install @claude-flow/plugin-gastown-bridge
# Prerequisites: Gas Town and Beads CLI (optional - for full CLI integration)
# See: https://github.com/steveyegge/gastown
go install github.com/steveyegge/gastown/cmd/gt@latest
go install github.com/steveyegge/beads/cmd/bd@latest
使用量
基本设置
import { GasTownBridgePlugin } from '@claude-flow/plugin-gastown-bridge';
// Initialize the plugin
const plugin = new GasTownBridgePlugin({
gtPath: '/usr/local/bin/gt', // Optional: path to gt CLI
bdPath: '/usr/local/bin/bd', // Optional: path to bd CLI
wasmEnabled: true, // Enable WASM acceleration
});
// Register with Claude Flow
await claudeFlow.registerPlugin(plugin);
使用 MCP 工具
// Create a bead (issue)
const bead = await plugin.tools.gt_beads_create({
title: 'Implement feature X',
description: 'Full description here',
priority: 2,
labels: ['feature', 'v3'],
});
// List ready beads (no blockers)
const ready = await plugin.tools.gt_beads_ready({
limit: 10,
rig: 'main',
});
// Cook a formula (WASM-accelerated, 352x faster)
const cooked = await plugin.tools.gt_formula_cook({
formula: 'implement-feature',
vars: {
feature_name: 'Authentication',
target_module: 'src/auth',
},
});
// Sling work to an agent
await plugin.tools.gt_sling({
bead_id: 'gt-abc123',
target: 'polecat',
formula: 'code-review',
});
WASM 加速操作
// Parse formula (352x faster than JS)
const ast = await plugin.tools.gt_wasm_parse_formula({
content: `
[formula]
name = "deploy-service"
type = "convoy"
[[legs]]
id = "build"
title = "Build the service"
`,
});
// Resolve dependencies (150x faster)
const sorted = await plugin.tools.gt_wasm_resolve_deps({
beads: beadList,
action: 'topo_sort',
});
// Batch cook formulas (352x faster)
const cooked = await plugin.tools.gt_wasm_cook_batch({
formulas: formulaList,
vars: [{ env: 'prod' }, { env: 'staging' }],
});
// Find similar patterns (1000x-12500x faster)
const matches = await plugin.tools.gt_wasm_match_pattern({
query: 'authentication flow',
candidates: formulaNames,
k: 5,
});
在 Beads 和 AgentDB 之间同步
// Sync beads to AgentDB
await plugin.tools.gt_beads_sync({
direction: 'push',
rig: 'main',
namespace: 'project-x',
});
// Pull from AgentDB to Beads
await plugin.tools.gt_beads_sync({
direction: 'pull',
conflictStrategy: 'newest-wins',
});
// Bidirectional sync
await plugin.tools.gt_beads_sync({
direction: 'both',
conflictStrategy: 'merge',
});
教学
* 教导1:你的第一气镇一体化
步骤1:核实先决条件
# Check Gas Town CLI
gt --version
# Check Beads CLI
bd --version
# Both should output version numbers
步骤2: 在您的工程中初始化插件
// claude-flow.config.ts
import { defineConfig } from 'claude-flow';
import { GasTownBridgePlugin } from '@claude-flow/plugin-gastown-bridge';
export default defineConfig({
plugins: [
new GasTownBridgePlugin({
wasmEnabled: true,
}),
],
});
步骤 3: 创建您的第一个bead
const bead = await claudeFlow.mcp.call('gt_beads_create', {
title: 'Hello Gas Town',
description: 'My first bead from Claude Flow!',
priority: 3,
labels: ['tutorial'],
});
console.log(`Created bead: ${bead.id}`);
// Output: Created bead: gt-a1b2c3
步骤4:清单准备工作
const ready = await claudeFlow.mcp.call('gt_beads_ready', {
limit: 5,
});
console.log('Ready beads:', ready.beads.map(b => b.title));
辅导2:与公式合作
理解公式类型
| 类型 | 目的 | 示例 |
|---|---|---|
convoy | 多腿工作订单 | 特性实施 |
workflow | 逐步进程 | CI/CD管道 |
expansion | 生成多颗珠 | 测试套件创建 |
aspect | 贯穿各领域的关切问题 | 伐木、计量 |
创建自定义公式
// Create a code review formula
await claudeFlow.mcp.call('gt_formula_create', {
name: 'code-review-flow',
type: 'workflow',
steps: [
{
id: 'checkout',
title: 'Checkout branch',
description: 'Clone and checkout the PR branch',
},
{
id: 'lint',
title: 'Run linters',
description: 'Execute ESLint and Prettier',
needs: ['checkout'],
},
{
id: 'test',
title: 'Run tests',
description: 'Execute test suite',
needs: ['checkout'],
},
{
id: 'review',
title: 'Code review',
description: 'Manual code review',
needs: ['lint', 'test'],
},
],
vars: {
branch: { type: 'string', required: true },
reviewer: { type: 'string', default: 'auto' },
},
});
制作公式(WASM加速)
// Cook the formula with variables
const cooked = await claudeFlow.mcp.call('gt_formula_cook', {
formula: 'code-review-flow',
vars: {
branch: 'feature/auth',
reviewer: '@alice',
},
});
// cooked.steps now have variables substituted
console.log(cooked.steps[3].description);
// Output: "Manual code review by @alice"
教习3:旅社管理
骑兵团是什么?
一个车队是一个"工作令",它追踪一系列相关的珠子,贯穿其生命周期. 把它当作短跑或里程碑.
创建军团
// Create convoy for a feature
const convoy = await claudeFlow.mcp.call('gt_convoy_create', {
name: 'v2.0-release',
description: 'Version 2.0 release convoy',
issues: ['gt-abc1', 'gt-abc2', 'gt-abc3'],
});
console.log(`Convoy created: ${convoy.id}`);
跟踪车队的进展
// Check convoy status
const status = await claudeFlow.mcp.call('gt_convoy_status', {
convoy_id: convoy.id,
detailed: true,
});
console.log(`Progress: ${status.progress}%`);
console.log(`Completed: ${status.completed}/${status.total}`);
优化车队执行(WASM)
// Get optimal execution order (150x faster with WASM)
const optimized = await claudeFlow.mcp.call('gt_wasm_optimize_convoy', {
convoy_id: convoy.id,
strategy: 'parallel', // or 'serial', 'hybrid'
});
console.log('Execution plan:', optimized.plan);
// Output shows which beads can run in parallel
4: 向特工工作
煤气镇代理角色
| 作用 | 目的 |
|---|---|
mayor | 协调员,分配工作 |
polecat | 一般工人代理人 |
crew | 专门小组成员 |
refinery | 处理和转化 |
witness | 核查和审定 |
deacon | 行政任务 |
dog | 警卫职责,警卫 |
铺设工作
// Sling a bead to a polecat for coding
await claudeFlow.mcp.call('gt_sling', {
bead_id: 'gt-abc123',
target: 'polecat',
formula: 'implement-feature',
});
// The work is now "on the polecat's hook"
// GUPP: "If work is on your hook, YOU MUST RUN IT"
列出可用的代理
const agents = await claudeFlow.mcp.call('gt_agents', {
rig: 'main',
role: 'polecat',
include_inactive: false,
});
agents.forEach(agent => {
console.log(`${agent.name}: ${agent.status} (${agent.workload} tasks)`);
});
教程 : Beads- AgentDB 同步
同步策略
| 战略 | 使用大小写 |
|---|---|
push | 导出珠到代理数据库 |
pull | 从代理数据库导入到贝兹 |
both | 双向同步 |
解决冲突
| 决议 | 行为 |
|---|---|
beads-wins | Bads 数据覆盖代理数据库 |
agentdb-wins | 代理DB 数据覆盖光标 |
newest-wins | 最新修改获胜 |
merge | 合并非冲突领域 |
manual | 将冲突排入手动解决 |
示例:生产同步工作流程
// Morning: Pull overnight changes from shared AgentDB
await claudeFlow.mcp.call('gt_beads_sync', {
direction: 'pull',
rig: 'production',
conflictStrategy: 'newest-wins',
});
// During work: Push local changes
await claudeFlow.mcp.call('gt_beads_sync', {
direction: 'push',
rig: 'production',
namespace: 'team-alpha',
});
// End of day: Full bidirectional sync
const result = await claudeFlow.mcp.call('gt_beads_sync', {
direction: 'both',
conflictStrategy: 'merge',
});
console.log(`Synced: ${result.pushed} pushed, ${result.pulled} pulled`);
console.log(`Conflicts: ${result.conflicts.length}`);
6:WASM 性能优化
何时使用 WASM 工具
| 使用 WASM 软件 | 使用 CLI |
|---|---|
| 解析公式 | 创建珠子 |
| 图表操作 | 文件一/O |
| 模式匹配 | SQLite 查询 |
| 批处理 | 代理通讯 |
最大性能批处理
// Instead of this (slow):
for (const formula of formulas) {
await claudeFlow.mcp.call('gt_formula_cook', {
formula: formula.name,
vars: formula.vars,
});
}
// Do this (352x faster):
const results = await claudeFlow.mcp.call('gt_wasm_cook_batch', {
formulas: formulas.map(f => f.name),
vars: formulas.map(f => f.vars),
});
剖析WASM 性能
// All WASM tools return timing metrics
const result = await claudeFlow.mcp.call('gt_wasm_parse_formula', {
content: formulaToml,
});
console.log(`Parse time: ${result.durationMs}ms`);
// Output: Parse time: 0.14ms
API 参考
插件配置
interface GasTownBridgeConfig {
/** Path to gt CLI (default: auto-detect) */
gtPath?: string;
/** Path to bd CLI (default: auto-detect) */
bdPath?: string;
/** Enable WASM acceleration (default: true) */
wasmEnabled?: boolean;
/** Default rig for operations */
defaultRig?: string;
/** Sync conflict resolution strategy */
conflictStrategy?: 'beads-wins' | 'agentdb-wins' | 'newest-wins' | 'merge' | 'manual';
/** CLI execution timeout in ms (default: 30000) */
timeout?: number;
}
工具参考
见 MCP 工具文档 用于完整的 API 参考.
建筑
┌─────────────────────────────────────────────────────────────────────┐
│ Claude Flow V3 Plugin Host │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────┐ ┌─────────────────────────────────────┐ │
│ │ CLI Bridge │ │ WASM Computation Layer │ │
│ │ (I/O Operations) │ │ (352x faster) │ │
│ │ │ │ │ │
│ │ • gt commands │ │ ┌──────────────┐ ┌──────────────┐ │ │
│ │ • bd commands │ │ │ gastown- │ │ ruvector- │ │ │
│ │ • File read/write │ │ │ formula-wasm │ │ gnn-wasm │ │ │
│ │ • SQLite queries │ │ │ │ │ │ │ │
│ │ │ │ │ • TOML parse │ │ • DAG ops │ │ │
│ │ [Node.js FFI] │ │ │ • Variable │ │ • Topo sort │ │ │
│ │ │ │ │ cooking │ │ • Cycle │ │ │
│ └─────────────────────┘ │ │ • Molecule │ │ detection │ │ │
│ │ │ generation │ │ • Critical │ │ │
│ │ └──────────────┘ │ path │ │ │
│ │ └──────────────┘ │ │
│ │ │ │
│ │ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ micro-hnsw- │ │ ruvector- │ │ │
│ │ │ wasm │ │ learning-wasm│ │ │
│ │ │ │ │ │ │ │
│ │ │ • Pattern │ │ • SONA │ │ │
│ │ │ search │ │ patterns │ │ │
│ │ │ • 1000x+ │ │ • MoE routing│ │ │
│ │ │ speedup │ │ • EWC++ │ │ │
│ │ └──────────────┘ └──────────────┘ │ │
│ │ │ │
│ │ [wasm-bindgen interface] │ │
│ └─────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────┘
相关资源
捐款
见 捐款额 (c) 发展结构和准则.
许可证
麻省理工学院执照 - 看 自由主义 详细情况.
由克洛德·福克(Claude Flow)团队建造