claude-ws 0.5.1-beta.7 → 0.5.1-beta.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-ws",
3
- "version": "0.5.1-beta.7",
3
+ "version": "0.5.1-beta.8",
4
4
  "private": false,
5
5
  "description": "AI-powered workspace for solo CEOs and indie builders — manage your entire business with AI agents, not just code. Kanban board, code editor, Git integration, claw agent hub, local-first SQLite.",
6
6
  "keywords": [
@@ -4,12 +4,6 @@
4
4
 
5
5
  ## Workspace Rules
6
6
 
7
- ### Butler CLI — Environment Resolution
8
- - **Dev**: `pnpm butler <command>` (pnpm workspace script)
9
- - **Prod**: `claude-ws butler <command>` (auto-replaced by postinstall)
10
- - **Runtime (scheduler/monitor)**: auto-resolved by `resolveButlerCliPrefix()` in `packages/butler/src/cli/utils/resolve-butler-cli-prefix.ts`
11
- - This file ships with `pnpm butler` as default. Postinstall replaces with `claude-ws butler` in non-workspace installs.
12
-
13
7
  ### Task Delegation (CRITICAL)
14
8
  ALL task execution (code changes, research, analysis, planning) must go through kanban workflow — NEVER execute directly in Butler context:
15
9
  1. Use `pnpm butler kanban run` to create + execute in 1 step (default)
@@ -2,7 +2,7 @@
2
2
  * List tasks on claude-ws kanban board for a project.
3
3
  * Replaces list-kanban-tasks-by-project.sh (17 LOC bash).
4
4
  *
5
- * Usage: claude-ws butler kanban list [project_id]
5
+ * Usage: pnpm butler kanban list [project_id]
6
6
  */
7
7
  import { resolveEnv } from '../utils/resolve-env';
8
8
  import { createApiClient } from '../utils/api-client';
@@ -12,21 +12,38 @@
12
12
  const path = require('path');
13
13
  const fs = require('fs');
14
14
 
15
- // ── Butler MEMORY.md env resolution ──────────────────────────────────
16
- // MEMORY.md uses `pnpm butler` (dev default). In production installs
15
+ // ── Butler CLI prefix resolution ─────────────────────────────────────
16
+ // Files ship with `pnpm butler` (dev default). In production installs
17
17
  // (no pnpm workspace), replace with `claude-ws butler`.
18
18
  const pkgRoot = path.join(__dirname, '..');
19
- const memoryPath = path.join(pkgRoot, 'packages', 'butler', 'MEMORY.md');
20
- const hasPnpmWorkspace = fs.existsSync(path.join(pkgRoot, 'pnpm-workspace.yaml'));
21
19
 
22
- if (!hasPnpmWorkspace && fs.existsSync(memoryPath)) {
20
+ /** Recursively find files matching a pattern (simple *.ext glob) */
21
+ function glob(dir) {
22
+ const results = [];
23
23
  try {
24
- const content = fs.readFileSync(memoryPath, 'utf-8');
25
- const updated = content.replace(/pnpm butler/g, 'claude-ws butler');
26
- if (updated !== content) {
27
- fs.writeFileSync(memoryPath, updated);
24
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
25
+ const full = path.join(dir, entry.name);
26
+ if (entry.isDirectory()) results.push(...glob(full));
27
+ else if (entry.name.endsWith('.md')) results.push(full);
28
28
  }
29
- } catch { /* non-critical skip silently */ }
29
+ } catch { /* dir may not exist */ }
30
+ return results;
31
+ }
32
+ const memoryPath = path.join(pkgRoot, 'packages', 'butler', 'MEMORY.md');
33
+ const hasPnpmWorkspace = fs.existsSync(path.join(pkgRoot, 'pnpm-workspace.yaml'));
34
+
35
+ if (!hasPnpmWorkspace) {
36
+ const filesToPatch = [
37
+ memoryPath,
38
+ ...glob(path.join(pkgRoot, 'data', 'butler', 'sync.claude', 'skills', '**', '*.md')),
39
+ ];
40
+ for (const filePath of filesToPatch) {
41
+ try {
42
+ const content = fs.readFileSync(filePath, 'utf-8');
43
+ const updated = content.replace(/pnpm butler/g, 'claude-ws butler');
44
+ if (updated !== content) fs.writeFileSync(filePath, updated);
45
+ } catch { /* non-critical — skip silently */ }
46
+ }
30
47
  }
31
48
  // ── End MEMORY.md resolution ─────────────────────────────────────────
32
49