Fix ruflo CLI wrapper and hook paths for subdirectory execution

- Fix ruflo bin to walk node_modules tree instead of using require.resolve
  (blocked by @claude-flow/cli strict exports map)
- Use git rev-parse --show-toplevel for all hook paths in settings.json
  so hooks work from any subdirectory
- Update CLAUDE.md publishing rules to include ruflo as third package
- Bump ruflo to 3.1.0-alpha.16

Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
rUv committed 2026-02-16 18:22:49 +00:00
1 parent a3a54dd610
commit 502cd0e478
4 files changed
+57 -33

No files matched your search

+15 -15
View File
@@ -47,7 +47,7 @@
"hooks": [
{
"type": "command",
"command": "node .claude/helpers/hook-handler.cjs pre-bash",
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/hook-handler.cjs\" pre-bash",
"timeout": 5000
}
]
@@ -59,7 +59,7 @@
"hooks": [
{
"type": "command",
"command": "node .claude/helpers/hook-handler.cjs post-edit",
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/hook-handler.cjs\" post-edit",
"timeout": 10000
}
]
@@ -70,7 +70,7 @@
"hooks": [
{
"type": "command",
"command": "node .claude/helpers/hook-handler.cjs route",
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/hook-handler.cjs\" route",
"timeout": 10000
}
]
@@ -81,12 +81,12 @@
"hooks": [
{
"type": "command",
"command": "node .claude/helpers/hook-handler.cjs session-restore",
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/hook-handler.cjs\" session-restore",
"timeout": 15000
},
{
"type": "command",
"command": "node .claude/helpers/auto-memory-hook.mjs import",
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/auto-memory-hook.mjs\" import",
"timeout": 8000
}
]
@@ -97,7 +97,7 @@
"hooks": [
{
"type": "command",
"command": "node .claude/helpers/hook-handler.cjs session-end",
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/hook-handler.cjs\" session-end",
"timeout": 10000
}
]
@@ -108,7 +108,7 @@
"hooks": [
{
"type": "command",
"command": "node .claude/helpers/auto-memory-hook.mjs sync",
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/auto-memory-hook.mjs\" sync",
"timeout": 10000
}
]
@@ -120,11 +120,11 @@
"hooks": [
{
"type": "command",
"command": "node .claude/helpers/hook-handler.cjs compact-manual"
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/hook-handler.cjs\" compact-manual"
},
{
"type": "command",
"command": "node .claude/helpers/hook-handler.cjs session-end",
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/hook-handler.cjs\" session-end",
"timeout": 5000
}
]
@@ -134,11 +134,11 @@
"hooks": [
{
"type": "command",
"command": "node .claude/helpers/hook-handler.cjs compact-auto"
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/hook-handler.cjs\" compact-auto"
},
{
"type": "command",
"command": "node .claude/helpers/hook-handler.cjs session-end",
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/hook-handler.cjs\" session-end",
"timeout": 6000
}
]
@@ -149,7 +149,7 @@
"hooks": [
{
"type": "command",
"command": "node .claude/helpers/hook-handler.cjs status",
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/hook-handler.cjs\" status",
"timeout": 3000
}
]
@@ -160,7 +160,7 @@
"hooks": [
{
"type": "command",
"command": "node .claude/helpers/hook-handler.cjs post-task",
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/hook-handler.cjs\" post-task",
"timeout": 5000
}
]
@@ -171,7 +171,7 @@
"hooks": [
{
"type": "command",
"command": "node .claude/helpers/hook-handler.cjs post-task",
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/hook-handler.cjs\" post-task",
"timeout": 5000
}
]
@@ -286,7 +286,7 @@
},
"statusLine": {
"type": "command",
"command": "node .claude/helpers/statusline.cjs"
"command": "node \"$(git rev-parse --show-toplevel)/.claude/helpers/statusline.cjs\""
},
"mcpServers": {
"claude-flow": {
+22 -10
View File
@@ -826,10 +826,10 @@ npx claude-flow@v3alpha doctor --fix
### Publishing Rules
- MUST publish BOTH packages when publishing CLI changes
- MUST update ALL dist-tags for BOTH packages after publishing
- Always publish `@claude-flow/cli` first, then `claude-flow` (umbrella)
- MUST run verification before telling user publishing is complete
- MUST publish ALL THREE packages when publishing CLI changes: `@claude-flow/cli`, `claude-flow`, AND `ruflo`
- MUST update ALL dist-tags for ALL THREE packages after publishing
- Publish order: `@claude-flow/cli` first, then `claude-flow` (umbrella), then `ruflo` (alias umbrella)
- MUST run verification for ALL THREE before telling user publishing is complete
```bash
# STEP 1: Build and publish CLI
@@ -839,21 +839,28 @@ npm run build
npm publish --tag alpha
npm dist-tag add @claude-flow/cli@3.0.0-alpha.XXX latest
# STEP 2: Publish umbrella
# STEP 2: Publish claude-flow umbrella
cd /workspaces/claude-flow
npm version 3.0.0-alpha.YYY --no-git-tag-version
npm version 3.0.0-alpha.XXX --no-git-tag-version
npm publish --tag v3alpha
# STEP 3: Update ALL umbrella tags (CRITICAL - DON'T SKIP!)
npm dist-tag add claude-flow@3.0.0-alpha.YYY latest
npm dist-tag add claude-flow@3.0.0-alpha.YYY alpha
# STEP 3: Update ALL claude-flow umbrella tags (CRITICAL - DON'T SKIP!)
npm dist-tag add claude-flow@3.0.0-alpha.XXX latest
npm dist-tag add claude-flow@3.0.0-alpha.XXX alpha
# STEP 4: Publish ruflo umbrella (CRITICAL - DON'T FORGET!)
cd /workspaces/claude-flow/ruflo
npm version 3.0.0-alpha.XXX --no-git-tag-version
npm publish --tag alpha
npm dist-tag add ruflo@3.0.0-alpha.XXX latest
```
**Verification (run before telling user):**
```bash
npm view @claude-flow/cli dist-tags --json
npm view claude-flow dist-tags --json
# BOTH packages need: alpha AND latest pointing to newest version
npm view ruflo dist-tags --json
# ALL THREE packages need: alpha AND latest pointing to newest version
```
### All Tags That Must Be Updated
@@ -861,11 +868,16 @@ npm view claude-flow dist-tags --json
|---------|-----|-------------------|
| `@claude-flow/cli` | `alpha` | `npx @claude-flow/cli@alpha` |
| `@claude-flow/cli` | `latest` | `npx @claude-flow/cli@latest` |
| `@claude-flow/cli` | `v3alpha` | `npx @claude-flow/cli@v3alpha` |
| `claude-flow` | `alpha` | `npx claude-flow@alpha` — EASY TO FORGET |
| `claude-flow` | `latest` | `npx claude-flow@latest` |
| `claude-flow` | `v3alpha` | `npx claude-flow@v3alpha` |
| `ruflo` | `alpha` | `npx ruflo@alpha` — EASY TO FORGET |
| `ruflo` | `latest` | `npx ruflo@latest` |
- Never forget the `ruflo` package — it's a thin wrapper users run via `npx ruflo@alpha`
- Never forget the umbrella `alpha` tag — users run `npx claude-flow@alpha`
- `ruflo` source is in `/ruflo/` — it depends on `@claude-flow/cli`
## Plugin Registry Maintenance (IPFS/Pinata)
+19 -7
View File
@@ -1,16 +1,28 @@
#!/usr/bin/env node
// Ruflo CLI - thin wrapper around @claude-flow/cli
import { createRequire } from 'node:module';
import { fileURLToPath } from 'node:url';
import { dirname, resolve } from 'node:path';
import { dirname, resolve, join } from 'node:path';
import { existsSync } from 'node:fs';
const __dirname = dirname(fileURLToPath(import.meta.url));
// Try loading from @claude-flow/cli dependency first, fall back to bundled
try {
const cliPath = createRequire(import.meta.url).resolve('@claude-flow/cli/bin/cli.js');
// Walk up from ruflo/bin/ to find @claude-flow/cli in node_modules
function findCliPath() {
let dir = resolve(__dirname, '..');
for (let i = 0; i < 10; i++) {
const candidate = join(dir, 'node_modules', '@claude-flow', 'cli', 'bin', 'cli.js');
if (existsSync(candidate)) return candidate;
const parent = dirname(dir);
if (parent === dir) break;
dir = parent;
}
return null;
}
const cliPath = findCliPath();
if (cliPath) {
await import(cliPath);
} catch {
// Fallback: try relative path (for development / linked installs)
} else {
// Fallback: dev/linked installs
await import(resolve(__dirname, '../../v3/@claude-flow/cli/bin/cli.js'));
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ruflo",
"version": "3.1.0-alpha.14",
"version": "3.1.0-alpha.16",
"description": "Ruflo - Enterprise AI agent orchestration platform. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
"main": "bin/ruflo.js",
"type": "module",