claude-ws 0.5.1-beta.4 → 0.5.1-beta.6
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.
|
|
3
|
+
"version": "0.5.1-beta.6",
|
|
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,24 +4,30 @@
|
|
|
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
|
+
|
|
7
13
|
### Task Delegation (CRITICAL)
|
|
8
14
|
ALL task execution (code changes, research, analysis, planning) must go through kanban workflow — NEVER execute directly in Butler context:
|
|
9
|
-
1. Use `
|
|
10
|
-
2. Or `
|
|
15
|
+
1. Use `pnpm butler kanban run` to create + execute in 1 step (default)
|
|
16
|
+
2. Or `pnpm butler kanban create` for backlog/planning only, then `pnpm butler kanban start` later
|
|
11
17
|
3. Keep Butler context clean for orchestration, monitoring, communication
|
|
12
18
|
4. Butler ONLY does: task CRUD, project CRUD, notifications, scheduler, monitoring
|
|
13
19
|
|
|
14
|
-
CLI: `
|
|
15
|
-
- **Run (default)**: `
|
|
16
|
-
- Start existing: `
|
|
17
|
-
- Create only: `
|
|
18
|
-
- List: `
|
|
19
|
-
- Update: `
|
|
20
|
-
- Monitor: `
|
|
20
|
+
CLI: `pnpm butler <command>`. Skills: `sync.claude/skills/`.
|
|
21
|
+
- **Run (default)**: `pnpm butler kanban run "<title>" "<description>" [project_id] [prompt]` — create + execute + monitor. Auto-worktree for code projects.
|
|
22
|
+
- Start existing: `pnpm butler kanban start <task_id> "<prompt>"` — execute previously created task. Auto-worktree for code projects.
|
|
23
|
+
- Create only: `pnpm butler kanban create "<title>" "<description>" [status] [project_id]` — backlog/planning only
|
|
24
|
+
- List: `pnpm butler kanban list [project_id]`
|
|
25
|
+
- Update: `pnpm butler kanban update <task_id> <status>`
|
|
26
|
+
- Monitor: `pnpm butler kanban monitor` — auto-called by scheduler
|
|
21
27
|
|
|
22
28
|
### Task-Project Separation (CRITICAL — MUST specify project_id)
|
|
23
|
-
- Code changes to claude-ws source (src/, server.ts, etc.) → `
|
|
24
|
-
- Butler operational tasks (monitoring, communication) → `
|
|
29
|
+
- Code changes to claude-ws source (src/, server.ts, etc.) → `pnpm butler kanban create "title" "desc" todo iMHZ_0aCSK3_0z0Kn6zQ1`
|
|
30
|
+
- Butler operational tasks (monitoring, communication) → `pnpm butler kanban create "title" "desc"` (defaults to Butler project)
|
|
25
31
|
- **NEVER** create code change tasks on Butler project — always pass claude-ws project ID
|
|
26
32
|
|
|
27
33
|
### Check Workspace DB First
|
|
@@ -59,13 +65,13 @@ Butler must proactively monitor tasks and communicate via browser notifications
|
|
|
59
65
|
### Task Management
|
|
60
66
|
- **Smart delegation** — Simple tasks (1-2 files, clear scope) → execute in-chat; complex tasks → kanban workflow.
|
|
61
67
|
- **Proactive reports** — Always check results + provide summary when tasks complete: status, files, compilation, commits, next steps.
|
|
62
|
-
- **Reuse task for follow-up** — `
|
|
68
|
+
- **Reuse task for follow-up** — `pnpm butler kanban start <existing_task_id> "<prompt>"` instead of creating new task for same issue.
|
|
63
69
|
- **No pre-task scouting** — Don't Explore/scout before creating tasks. DO read results (diff, response) after completion.
|
|
64
70
|
- **Monitor is task-centric** — monitor takes task_id (not attempt_id), queries DB for all attempts, waits until none active.
|
|
65
71
|
|
|
66
72
|
### Technical Rules
|
|
67
|
-
- **Use butler scheduler** — ALL cron/scheduling via butler scheduler REST API (`/api/butler/schedules`), or `
|
|
68
|
-
- **Use butler CLI** — All kanban + scheduler ops via `
|
|
73
|
+
- **Use butler scheduler** — ALL cron/scheduling via butler scheduler REST API (`/api/butler/schedules`), or `pnpm butler scheduler` CLI. Never CronCreate or RemoteTrigger.
|
|
74
|
+
- **Use pnpm butler CLI** — All kanban + scheduler ops via `pnpm butler` commands (TypeScript CLI in `packages/butler/`). Runtime prefix auto-resolved by `resolveButlerCliPrefix()`.
|
|
69
75
|
- **.claude → sync.claude** — Use `sync.claude/` paths with normal Edit/Write tools for skill files and config.
|
|
70
76
|
- **Write memory to project path** — Save to `data/butler/memory/`, NOT `~/.claude/projects/.../memory/`.
|
|
71
77
|
- **No git push without permission** — NEVER push to git without user's explicit approval.
|
|
@@ -83,8 +89,8 @@ Butler must proactively monitor tasks and communicate via browser notifications
|
|
|
83
89
|
- Runs inside claude-ws server (pm2 `claudews`), NOT separate process.
|
|
84
90
|
- Env auto-detected by `packages/butler/src/cli/utils/resolve-env.ts`.
|
|
85
91
|
- Endpoints: GET/POST/PATCH/DELETE `/api/butler/schedules`.
|
|
86
|
-
- CLI: `
|
|
87
|
-
- Monitor needs scheduler_id for self-delete → two-step create+update pattern (handled by `
|
|
92
|
+
- CLI: `pnpm butler scheduler create/list/delete`.
|
|
93
|
+
- Monitor needs scheduler_id for self-delete → two-step create+update pattern (handled by `pnpm butler kanban start`).
|
|
88
94
|
|
|
89
95
|
### Monitor Callback Flow
|
|
90
96
|
1. Task agent completes → monitor cron detects all attempts terminal
|
|
@@ -97,4 +103,3 @@ Butler must proactively monitor tasks and communicate via browser notifications
|
|
|
97
103
|
- `script_locks` table in claude-ws.db for tracking background script execution.
|
|
98
104
|
- Library: `packages/butler/src/cli/utils/script-lock.ts` — acquire/release/isRunning/listActive/cleanup.
|
|
99
105
|
- 3-day TTL auto-expires crashed scripts. Always release in try/finally.
|
|
100
|
-
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Resolve the butler CLI command prefix for the current environment.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Ensures scheduler-stored commands work regardless of environment.
|
|
3
|
+
* Primary: absolute tsx + butler-cli.ts path (works in both dev and prod).
|
|
4
|
+
* Fallback: `claude-ws butler` (global binary).
|
|
6
5
|
*/
|
|
7
6
|
import { existsSync } from 'fs';
|
|
8
7
|
import { join } from 'path';
|
|
@@ -20,7 +19,5 @@ export function resolveButlerCliPrefix(claudeWsRoot: string): string {
|
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
const isPnpmWorkspace = existsSync(join(claudeWsRoot, 'pnpm-lock.yaml'));
|
|
25
|
-
return isPnpmWorkspace ? 'pnpm butler' : 'claude-ws butler';
|
|
22
|
+
return 'claude-ws butler';
|
|
26
23
|
}
|
|
@@ -12,6 +12,24 @@
|
|
|
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
|
|
17
|
+
// (no pnpm workspace), replace with `claude-ws butler`.
|
|
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
|
+
|
|
22
|
+
if (!hasPnpmWorkspace && fs.existsSync(memoryPath)) {
|
|
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);
|
|
28
|
+
}
|
|
29
|
+
} catch { /* non-critical — skip silently */ }
|
|
30
|
+
}
|
|
31
|
+
// ── End MEMORY.md resolution ─────────────────────────────────────────
|
|
32
|
+
|
|
15
33
|
const PKG = '@homebridge/node-pty-prebuilt-multiarch';
|
|
16
34
|
const PKG_DIR = path.join(__dirname, '..', 'node_modules', '@homebridge', 'node-pty-prebuilt-multiarch');
|
|
17
35
|
|
package/server.ts
CHANGED
|
@@ -60,7 +60,7 @@ import { createAutopilotManager, appendQuestionAnswer, appendSubagentEnded, appe
|
|
|
60
60
|
import type { AutopilotMode } from './src/lib/autopilot';
|
|
61
61
|
import { createButlerManager, type ButlerManager } from './src/lib/butler';
|
|
62
62
|
import { ensureButlerMemoryFile, BUTLER_PROJECT_ID } from './src/lib/butler/butler-project-initializer';
|
|
63
|
-
import { createTaskService } from '
|
|
63
|
+
import { createTaskService } from './packages/agentic-sdk/src/services/task/task-crud-and-reorder';
|
|
64
64
|
import { createTaskServiceWithSocketEmit } from './src/lib/services/task-service-with-socket-emit';
|
|
65
65
|
|
|
66
66
|
import { getPort, getHostname } from './src/lib/server-port-configuration';
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from './autopilot-prompt-builder';
|
|
15
15
|
import type { AutopilotMode } from './autopilot-prompt-builder';
|
|
16
16
|
import { isValidModelId } from '../models';
|
|
17
|
-
import { createTaskService } from '
|
|
17
|
+
import { createTaskService } from '../../../packages/agentic-sdk/src/services/task/task-crud-and-reorder';
|
|
18
18
|
import { createTaskServiceWithSocketEmit } from '../services/task-service-with-socket-emit';
|
|
19
19
|
|
|
20
20
|
export type { AutopilotMode };
|