@bytetrue/byspace 0.2.0-beta.4 → 0.2.0
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/dist/commands/daemon/local-daemon.d.ts +2 -0
- package/dist/commands/daemon/local-daemon.js +21 -1
- package/dist/commands/daemon/start.js +11 -1
- package/node_modules/@bytetrue/byspace-client/dist/daemon-client.d.ts +3 -1
- package/node_modules/@bytetrue/byspace-client/dist/daemon-client.js +12 -0
- package/node_modules/@bytetrue/byspace-client/package.json +1 -1
- package/node_modules/@bytetrue/byspace-highlight/package.json +1 -1
- package/node_modules/@bytetrue/byspace-protocol/dist/generated/validation/ws-outbound.aot.js +9447 -9399
- package/node_modules/@bytetrue/byspace-protocol/dist/messages.d.ts +123 -0
- package/node_modules/@bytetrue/byspace-protocol/dist/messages.js +30 -0
- package/node_modules/@bytetrue/byspace-protocol/dist/validation/ws-outbound-schema-metadata.d.ts +20 -0
- package/node_modules/@bytetrue/byspace-protocol/package.json +1 -1
- package/node_modules/@bytetrue/byspace-relay/package.json +1 -1
- package/node_modules/@bytetrue/byspace-server/dist/server/server/config.js +1 -1
- package/node_modules/@bytetrue/byspace-server/dist/server/server/orchestration-skills.d.ts +11 -0
- package/node_modules/@bytetrue/byspace-server/dist/server/server/orchestration-skills.js +197 -0
- package/node_modules/@bytetrue/byspace-server/dist/server/server/session/daemon/daemon-session.d.ts +6 -0
- package/node_modules/@bytetrue/byspace-server/dist/server/server/session/daemon/daemon-session.js +15 -0
- package/node_modules/@bytetrue/byspace-server/dist/server/server/session.js +4 -0
- package/node_modules/@bytetrue/byspace-server/dist/server/server/websocket-server.js +2 -0
- package/node_modules/@bytetrue/byspace-server/dist/server/terminal/terminal-worker-process.js +8 -1
- package/node_modules/@bytetrue/byspace-server/dist/server/terminal/terminal.d.ts +1 -0
- package/node_modules/@bytetrue/byspace-server/dist/server/terminal/terminal.js +33 -10
- package/node_modules/@bytetrue/byspace-server/dist/server/terminal/worker-terminal-manager.js +3 -0
- package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/_expo/static/js/web/{index-38ca1829d34e8fa57f6076abc4391d37.js → index-ba698ed4743a3ed98c16928de3e54cb1.js} +33 -33
- package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/_expo/static/js/web/index-ba698ed4743a3ed98c16928de3e54cb1.js.br +0 -0
- package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/_expo/static/js/web/index-ba698ed4743a3ed98c16928de3e54cb1.js.gz +0 -0
- package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/index.html +1 -1
- package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/index.html.br +0 -0
- package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/index.html.gz +0 -0
- package/node_modules/@bytetrue/byspace-server/dist/skills/byspace/SKILL.md +147 -0
- package/node_modules/@bytetrue/byspace-server/dist/skills/byspace-advisor/SKILL.md +64 -0
- package/node_modules/@bytetrue/byspace-server/dist/skills/byspace-committee/SKILL.md +83 -0
- package/node_modules/@bytetrue/byspace-server/dist/skills/byspace-handoff/SKILL.md +71 -0
- package/node_modules/@bytetrue/byspace-server/dist/skills/byspace-loop/SKILL.md +45 -0
- package/node_modules/@bytetrue/byspace-server/package.json +3 -2
- package/package.json +6 -6
- package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/_expo/static/js/web/index-38ca1829d34e8fa57f6076abc4391d37.js.br +0 -0
- package/node_modules/@bytetrue/byspace-server/dist/server/web-ui/_expo/static/js/web/index-38ca1829d34e8fa57f6076abc4391d37.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -85,6 +85,6 @@
|
|
|
85
85
|
<body>
|
|
86
86
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
87
87
|
<div id="root"></div>
|
|
88
|
-
<script src="/_expo/static/js/web/index-
|
|
88
|
+
<script src="/_expo/static/js/web/index-ba698ed4743a3ed98c16928de3e54cb1.js" defer></script>
|
|
89
89
|
</body>
|
|
90
90
|
</html>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: byspace
|
|
3
|
+
description: BySpace reference for managing agents and worktrees. Load whenever you need to create agents, send them prompts, or manage worktrees.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
BySpace is a daemon that supervises AI coding agents on your machine. Control it through tools or a CLI.
|
|
7
|
+
|
|
8
|
+
## Worktrees
|
|
9
|
+
|
|
10
|
+
**`create_worktree`** — same target union as `create_agent.workspace.source.worktree.target`:
|
|
11
|
+
|
|
12
|
+
- From a PR: `{ target: { kind: "checkout-pr", githubPrNumber: 503 } }`.
|
|
13
|
+
- Branch off a base: `{ target: { kind: "branch-off", worktreeSlug: "foo", branchName: "fix/foo", baseBranch: "main" } }`.
|
|
14
|
+
- Checkout an existing branch: `{ target: { kind: "checkout-branch", branch: "feat/bar" } }`.
|
|
15
|
+
|
|
16
|
+
Returns `{ branchName, worktreePath, workspaceId }`. Pass `cwd` to target a specific repo.
|
|
17
|
+
|
|
18
|
+
In `branch-off`, `worktreeSlug` controls the worktree path slug and `branchName` controls the git branch. If `branchName` is omitted, BySpace defaults it from `worktreeSlug`. The returned `branchName` is authoritative; checkout and PR flows may return a branch name that differs from any requested slug.
|
|
19
|
+
|
|
20
|
+
**`list_worktrees`** — current repo (or pass `cwd`).
|
|
21
|
+
**`archive_worktree`** — `{ worktreePath }` or `{ worktreeSlug }`. Removes worktree and branch.
|
|
22
|
+
|
|
23
|
+
## Agents
|
|
24
|
+
|
|
25
|
+
**`create_agent`** — required: `relationship`, `workspace`, `title`, `provider` (`claude/opus`, `codex/gpt-5.4`, …), `initialPrompt`. Common: `notifyOnFinish`, `settings`, `labels`. Returns `{ agentId, … }`.
|
|
26
|
+
|
|
27
|
+
Initial runtime settings live under `settings`: `modeId`, `thinkingOptionId`, and provider-specific `features`. For Codex fast mode, pass `settings: { features: { "fast_mode": true } }` when creating the agent.
|
|
28
|
+
|
|
29
|
+
To create a new worktree and launch an agent in it, use `create_agent.workspace.source.kind = "worktree"`. Use `create_worktree` separately only when you need a worktree without launching an agent, or when you need a split flow; in a split flow, pass the returned `workspaceId` to `create_agent` with `workspace: { kind: "existing", workspaceId }`.
|
|
30
|
+
|
|
31
|
+
### Agent relationships
|
|
32
|
+
|
|
33
|
+
`relationship` controls parentage only:
|
|
34
|
+
|
|
35
|
+
- `{ kind: "subagent" }` — child under your subagents track. Use for advisors, committee members, planners, implementers, auditors, loop workers, and any agent whose lifetime belongs to your task.
|
|
36
|
+
- `{ kind: "detached" }` — root/sibling agent. Use for handoffs and fire-and-forget delegations the user may continue after you are archived.
|
|
37
|
+
|
|
38
|
+
`workspace` controls placement only:
|
|
39
|
+
|
|
40
|
+
- `{ kind: "current" }` — same workspace as the caller, with optional `cwd`.
|
|
41
|
+
- `{ kind: "existing", workspaceId: string, cwd?: string }` — attach to an existing workspace, usually from `create_worktree`.
|
|
42
|
+
- `{ kind: "create", source: { kind: "directory", path?: string } }` — new workspace rooted at a directory.
|
|
43
|
+
- `{ kind: "create", source: { kind: "worktree", cwd?: string, target: { kind: "branch-off", worktreeSlug?: string, branchName?: string, baseBranch?: string } } }`
|
|
44
|
+
- `{ kind: "create", source: { kind: "worktree", cwd?: string, target: { kind: "checkout-branch", branch: string } } }`
|
|
45
|
+
- `{ kind: "create", source: { kind: "worktree", cwd?: string, target: { kind: "checkout-pr", githubPrNumber: number } } }`
|
|
46
|
+
|
|
47
|
+
Agent-scoped `create_agent` defaults `notifyOnFinish` to true. Set it to `false` only for truly fire-and-forget agents.
|
|
48
|
+
|
|
49
|
+
**`send_agent_prompt`** — `{ agentId, prompt }`. Use for follow-ups to an existing agent. Agent-scoped prompt calls default to `background: true` and `notifyOnFinish: true`; top-level calls default to blocking with no callback. For a synchronous follow-up, pass `background: false` and use the returned result.
|
|
50
|
+
|
|
51
|
+
**`update_agent`** — `{ agentId, name?, labels?, settings? }`. Use `settings` for runtime changes on an existing agent: `modeId`, `model`, `thinkingOptionId`, and provider-specific `features`. For Codex fast mode, pass `settings: { features: { "fast_mode": true } }`.
|
|
52
|
+
|
|
53
|
+
**`list_agents`** — filter by `cwd`, `statuses`, `sinceHours`, `includeArchived`.
|
|
54
|
+
|
|
55
|
+
**`archive_agent`** — `{ agentId }`. Interrupts if running, removes from active list.
|
|
56
|
+
|
|
57
|
+
## Provider discovery
|
|
58
|
+
|
|
59
|
+
**`list_providers`** — compact provider availability and modes.
|
|
60
|
+
|
|
61
|
+
**`list_models`** — full model list for one provider. Use only when you need model IDs or thinking options; the list can be large.
|
|
62
|
+
|
|
63
|
+
**`inspect_provider`** — compact provider capability and feature inspection. Required: `provider`; pass `cwd` when you are not in an agent-scoped session. Optional: `settings` with draft `model`, `modeId`, `thinkingOptionId`, and `features`.
|
|
64
|
+
|
|
65
|
+
Only set feature IDs returned by `inspect_provider`. For Codex fast mode, look for `fast_mode` and pass `settings: { features: { "fast_mode": true } }` to `create_agent` or `update_agent`.
|
|
66
|
+
|
|
67
|
+
## Schedules and heartbeats
|
|
68
|
+
|
|
69
|
+
**`create_schedule`** — starts a new agent on a cron cadence. Required: `prompt`, `cron`, `provider`. Optional: `timezone`, `name`, `cwd`, `maxRuns`, `expiresIn`. Use when the recurring work should live in fresh agents.
|
|
70
|
+
|
|
71
|
+
**`create_heartbeat`** — sends you a prompt on a cron cadence. Required: `prompt`, `cron`. Optional: `timezone`, `name`, `maxRuns`, `expiresIn`. Use for reminders, PR/build babysitting, and status checks that should return to this conversation.
|
|
72
|
+
|
|
73
|
+
## Models
|
|
74
|
+
|
|
75
|
+
`claude/sonnet` (default), `claude/opus` (harder reasoning), `codex/gpt-5.4` (frontier coding), `claude/haiku` (tests only).
|
|
76
|
+
|
|
77
|
+
## Orchestration preferences
|
|
78
|
+
|
|
79
|
+
User-specific configuration at `~/.byspace/orchestration-preferences.json`. **Before any BySpace skill chooses a provider or creates an agent, it must read this file.** Reading means an actual file read, not relying on these examples or defaults. Never hardcode a provider string in another skill — resolve through this file.
|
|
80
|
+
|
|
81
|
+
Two parts:
|
|
82
|
+
|
|
83
|
+
- `providers` — map of role categories to provider strings. Pass straight to `create_agent`'s `provider` field.
|
|
84
|
+
- `preferences` — freeform string array. Read on startup; weave into agent prompts contextually.
|
|
85
|
+
|
|
86
|
+
Categories: `impl`, `ui`, `research`, `planning`, `audit`. Skills pick the category that matches the role they're launching.
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"providers": {
|
|
91
|
+
"impl": "codex/gpt-5.4",
|
|
92
|
+
"ui": "claude/opus",
|
|
93
|
+
"research": "codex/gpt-5.4",
|
|
94
|
+
"planning": "codex/gpt-5.4",
|
|
95
|
+
"audit": "codex/gpt-5.4"
|
|
96
|
+
},
|
|
97
|
+
"preferences": [
|
|
98
|
+
"Claude Opus is the right choice for anything artistic or human-skill-oriented: copywriting, naming, UX copy, visual design, styling. Codex is the workhorse for mechanical work."
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
If the file is missing, use sensible defaults and tell the user once.
|
|
104
|
+
|
|
105
|
+
## Waiting
|
|
106
|
+
|
|
107
|
+
Agents take time — 10–30+ minutes is routine. Favor asynchronous workflows.
|
|
108
|
+
|
|
109
|
+
For agent-scoped `create_agent` and background `send_agent_prompt`, leave `notifyOnFinish` omitted or set it to `true` unless the work is truly fire-and-forget. You will get notified when the target agent finishes, errors, or needs permission. Move on to other work. The notification arrives on its own.
|
|
110
|
+
|
|
111
|
+
Don't poll `list_agents` or `get_agent_status` to "check on" a running agent. The notification will tell you.
|
|
112
|
+
|
|
113
|
+
## CLI parity
|
|
114
|
+
|
|
115
|
+
The `byspace` CLI is a thin wrapper over the same daemon. Same surface:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
byspace run --provider codex/gpt-5.4 --mode full-access --worktree feat/x "<prompt>"
|
|
119
|
+
byspace send <agent-id> "<follow-up>"
|
|
120
|
+
byspace ls
|
|
121
|
+
byspace worktree ls
|
|
122
|
+
byspace schedule create --cron "*/15 * * * *" "ping main build"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Discover with `byspace --help` and `byspace <cmd> --help`.
|
|
126
|
+
|
|
127
|
+
## Ops and debugging
|
|
128
|
+
|
|
129
|
+
Daemon-client architecture: the daemon owns agent lifecycle, state, and the WebSocket API. The hosted Web app and CLI are clients.
|
|
130
|
+
|
|
131
|
+
| | Default |
|
|
132
|
+
| -------------- | ----------------------------------------------------------------- |
|
|
133
|
+
| Listen address | `127.0.0.1:6777` (override `BYSPACE_LISTEN`) |
|
|
134
|
+
| Home | `~/.byspace` (override `BYSPACE_HOME`) |
|
|
135
|
+
| Daemon log | `$BYSPACE_HOME/daemon.log` |
|
|
136
|
+
| Agent state | `$BYSPACE_HOME/agents/<id>.json` |
|
|
137
|
+
| Worktrees | `$BYSPACE_HOME/worktrees/` (or `worktrees.root` in `config.json`) |
|
|
138
|
+
| PID file | `$BYSPACE_HOME/byspace.pid` |
|
|
139
|
+
| Health | `GET http://127.0.0.1:6777/api/health` |
|
|
140
|
+
|
|
141
|
+
Debug order:
|
|
142
|
+
|
|
143
|
+
1. `tail -n 200 ~/.byspace/daemon.log`.
|
|
144
|
+
2. `byspace daemon status` for liveness.
|
|
145
|
+
3. `curl -s localhost:6777/api/health` if the CLI itself is suspect.
|
|
146
|
+
|
|
147
|
+
**Never restart the daemon without explicit user approval** — it kills every running agent, including, often, the one asking.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: byspace-advisor
|
|
3
|
+
description: Spin up a single agent as an advisor — second opinion on the current task. Use when the user says "advisor", "second opinion", "what does X think", or wants an outside take without delegating the work itself.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
argument-hint: "[--provider <name>] <question or topic>"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# BySpace Advisor
|
|
9
|
+
|
|
10
|
+
Single agent. Reads the situation you're in. Gives a judgment. You decide what to do — the advisor doesn't drive the work.
|
|
11
|
+
|
|
12
|
+
**User's request:** $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
Read the **byspace** skill. Before choosing a provider, read `~/.byspace/orchestration-preferences.json` unless the user explicitly named a provider in this request. Do not create the advisor until you have read it.
|
|
17
|
+
|
|
18
|
+
## Picking the advisor
|
|
19
|
+
|
|
20
|
+
1. **User named one** (`--provider claude/opus`) → use it.
|
|
21
|
+
2. **Otherwise** resolve from preferences — pick the category that matches the question:
|
|
22
|
+
- Design / approach question → `planning`
|
|
23
|
+
- "Did I miss something" review → `audit`
|
|
24
|
+
- "Is this even right" → `research`
|
|
25
|
+
3. **Contrast helps.** If your own provider matches what preferences would pick, swap to a different family on purpose — fresh perspective is the point.
|
|
26
|
+
|
|
27
|
+
## The briefing
|
|
28
|
+
|
|
29
|
+
The advisor has zero context. Make it self-contained:
|
|
30
|
+
|
|
31
|
+
- The question, sharply.
|
|
32
|
+
- What you've considered and what you've ruled out.
|
|
33
|
+
- Relevant files by path (don't paste — let the agent read).
|
|
34
|
+
- Explicit ask: "give me a recommendation, with reasoning."
|
|
35
|
+
|
|
36
|
+
End with the no-edits suffix:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
This is analysis only. Do NOT edit, create, or delete any files. Do NOT write code.
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Forwarded skills
|
|
43
|
+
|
|
44
|
+
If `$ARGUMENTS` contains another skill reference — `/unslop`, `/unslop-risk`, `$unslop`, etc. — the user is asking the advisor to run that skill against the current task. Examples:
|
|
45
|
+
|
|
46
|
+
- `/byspace-advisor /unslop` → advisor runs `/unslop` on the current diff.
|
|
47
|
+
- `/byspace-advisor /unslop-risk` → advisor does an unslop-risk review.
|
|
48
|
+
- `/byspace-advisor $diagnose this build failure` → advisor invokes `/diagnose`.
|
|
49
|
+
|
|
50
|
+
Parse the forwarded skill name out of `$ARGUMENTS` (`/<name>` or `$<name>`). In the briefing, tell the advisor explicitly:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
Invoke the `<name>` skill against this task. Load it via the Skill tool before doing anything else.
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Pass through any remaining arguments after the skill name as the skill's own input. The advisor — not you — runs the skill; you're still just the orchestrator handing it the work.
|
|
57
|
+
|
|
58
|
+
## Launch and synthesize
|
|
59
|
+
|
|
60
|
+
Create the advisor agent via BySpace with a `[Advisor] <topic>` title and the briefing as the initial prompt. Wait for it to finish. Read its response. Synthesize for the user — the advisor's verdict + your recommendation.
|
|
61
|
+
|
|
62
|
+
## Persistent advisor
|
|
63
|
+
|
|
64
|
+
If the user wants ongoing input ("keep this advisor for the next few decisions"), don't archive after the first reply. Send follow-ups when you need another take. Archive when the user says they're done, or when the topic shifts and a fresh context would serve better.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: byspace-committee
|
|
3
|
+
description: Form a committee of two high-reasoning agents to step back, do root cause analysis, and produce a plan. Use when stuck, looping, tunnel-visioning, or facing a hard planning problem.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Committee Skill
|
|
8
|
+
|
|
9
|
+
Two agents from contrasting providers, fresh context, planning a solution in parallel. They stay alive for review after implementation.
|
|
10
|
+
|
|
11
|
+
The purpose is to step back, not double down. The committee may propose a completely different approach.
|
|
12
|
+
|
|
13
|
+
**User's additional context:** $ARGUMENTS
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
Read the **byspace** skill. Before choosing committee members, read `~/.byspace/orchestration-preferences.json` unless the user explicitly named providers in this request. Do not create committee agents until you have read it.
|
|
18
|
+
|
|
19
|
+
Contrast is the point of a committee, so pick across providers deliberately using the configured preferences rather than hardcoded defaults.
|
|
20
|
+
|
|
21
|
+
## Composition
|
|
22
|
+
|
|
23
|
+
Two members with different reasoning styles, selected from orchestration preferences:
|
|
24
|
+
|
|
25
|
+
- one planning/research-strength provider
|
|
26
|
+
- one contrasting high-reasoning provider
|
|
27
|
+
|
|
28
|
+
Override only when the user explicitly asks for different members.
|
|
29
|
+
|
|
30
|
+
## Hard rules
|
|
31
|
+
|
|
32
|
+
- **No edits.** Every prompt to a committee member ends with the no-edits suffix:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
This is analysis only. Do NOT edit, create, or delete any files. Do NOT write code.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- **Trust the wait.** Do not poll, send hurry-ups, or interrupt. GPT-5.4 can reason 15–30 minutes; Opus does extended thinking. Long waits mean it found something worth thinking about.
|
|
39
|
+
- **You are the middleman.** Drive plan → implement → review without yielding to the user, except for divergences that need their call.
|
|
40
|
+
|
|
41
|
+
## Phase 1: Plan
|
|
42
|
+
|
|
43
|
+
Write a problem-level prompt:
|
|
44
|
+
|
|
45
|
+
- High-level goal and acceptance criteria
|
|
46
|
+
- Constraints
|
|
47
|
+
- Symptoms (if a bug)
|
|
48
|
+
- What you tried and why it failed
|
|
49
|
+
- Explicit: "do root cause analysis"
|
|
50
|
+
- Explicit: "state assumptions, ask why three levels deep, check whether you're patching a symptom or removing the problem"
|
|
51
|
+
|
|
52
|
+
Create both agents in parallel via BySpace with `[Committee] <task>` titles and the same prompt. Wait for both — not just whichever finishes first.
|
|
53
|
+
|
|
54
|
+
Read both responses. Challenge them — do not accept at face value:
|
|
55
|
+
|
|
56
|
+
- "Why does <underlying thing> happen? Symptom or cause?"
|
|
57
|
+
- Verify any assumption the plan makes about the code.
|
|
58
|
+
- "What did you considered and reject?"
|
|
59
|
+
|
|
60
|
+
Send follow-ups until the plan addresses root cause.
|
|
61
|
+
|
|
62
|
+
Synthesize:
|
|
63
|
+
|
|
64
|
+
- Convergence → unified plan.
|
|
65
|
+
- Significant divergence → involve the user.
|
|
66
|
+
|
|
67
|
+
Confirm the merged plan with both members. Multi-turn until consensus.
|
|
68
|
+
|
|
69
|
+
## Phase 2: Implement
|
|
70
|
+
|
|
71
|
+
Default: implement yourself. If the user said **"delegate"**, launch one impl agent and pass the merged plan.
|
|
72
|
+
|
|
73
|
+
The committee stays clean — not involved in implementation.
|
|
74
|
+
|
|
75
|
+
## Phase 3: Review
|
|
76
|
+
|
|
77
|
+
Send the diff to the committee:
|
|
78
|
+
|
|
79
|
+
> Implementation is done. Review changes against the plan. Flag drift or missing pieces. <no-edits suffix>
|
|
80
|
+
|
|
81
|
+
Apply feedback yourself, or send to the impl agent. Repeat 2 → 3 until consensus.
|
|
82
|
+
|
|
83
|
+
After ~10 iterations without convergence, start a fresh committee with the full history of what was tried — the current committee's context may have drifted too far.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: byspace-handoff
|
|
3
|
+
description: Hand off the current task to another agent with full context. Use when the user says "handoff", "hand off", "hand this to", or wants to pass work to another agent.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Handoff Skill
|
|
8
|
+
|
|
9
|
+
Transfer the current task — context, decisions, failed attempts, constraints — to a fresh agent. The receiving agent starts with **zero context**, so the handoff prompt must be a self-contained briefing.
|
|
10
|
+
|
|
11
|
+
**User's arguments:** $ARGUMENTS
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
Read the **byspace** skill. Before choosing a provider, read `~/.byspace/orchestration-preferences.json` unless the user explicitly named a provider in this request. Do not create the receiving agent until you have read it.
|
|
16
|
+
|
|
17
|
+
## Parsing arguments
|
|
18
|
+
|
|
19
|
+
1. **Provider** — explicit user request first; otherwise resolve from `impl` preference (or `ui` if the task is styling-only).
|
|
20
|
+
2. **Worktree** — "in a worktree" / "worktree" → create a worktree via BySpace with a short branch name derived from the task, based on the current branch.
|
|
21
|
+
3. **Task description** — anything else the user said.
|
|
22
|
+
|
|
23
|
+
## The handoff prompt
|
|
24
|
+
|
|
25
|
+
The receiving agent has zero context. Include:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
## Task
|
|
29
|
+
[Imperative description.]
|
|
30
|
+
|
|
31
|
+
## Context
|
|
32
|
+
[Why this task exists, required context.]
|
|
33
|
+
|
|
34
|
+
## Relevant files
|
|
35
|
+
- `path/to/file.ts` — [what it is and why it matters]
|
|
36
|
+
|
|
37
|
+
## Current state
|
|
38
|
+
[What's done, what works, what doesn't.]
|
|
39
|
+
|
|
40
|
+
## What was tried
|
|
41
|
+
- [Approach] — [why it failed or was abandoned]
|
|
42
|
+
|
|
43
|
+
## Decisions
|
|
44
|
+
- [Decision — rationale]
|
|
45
|
+
|
|
46
|
+
## Acceptance criteria
|
|
47
|
+
- [ ] [Criterion]
|
|
48
|
+
|
|
49
|
+
## Constraints
|
|
50
|
+
- [Must-not / must-preserve]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Preserve task semantics.** Investigate-only → "DO NOT edit files." Fix → "implement the fix." Refactor → "refactor, not rewrite." Carry the user's exact intent.
|
|
54
|
+
|
|
55
|
+
## Launch
|
|
56
|
+
|
|
57
|
+
Create the agent via BySpace with a `[Handoff] <task>` title, the briefing as initial prompt, and `relationship: { kind: "detached" }`.
|
|
58
|
+
|
|
59
|
+
Use `workspace` for placement:
|
|
60
|
+
|
|
61
|
+
- No worktree: `workspace: { kind: "current" }`.
|
|
62
|
+
- Worktree: `workspace: { kind: "create", source: { kind: "worktree", target: { kind: "branch-off", worktreeSlug: "<short-task-slug>", branchName: "fix/<short-task-slug>" } } }`.
|
|
63
|
+
- Existing worktree already created by `create_worktree`: `workspace: { kind: "existing", workspaceId: "<returned-workspace-id>" }`.
|
|
64
|
+
|
|
65
|
+
Do not use `workspace: { kind: "current", cwd: "<worktreePath>" }` to place a handoff in a worktree; that keeps the agent in the caller's workspace with only a different runtime cwd.
|
|
66
|
+
|
|
67
|
+
Leave `notifyOnFinish` omitted unless the user explicitly wants no callback.
|
|
68
|
+
|
|
69
|
+
Handoff agents are siblings/root agents, not your subagents. They must survive you being archived and must not appear in your subagent track.
|
|
70
|
+
|
|
71
|
+
Don't wait by default — the user decides whether to follow along or move on. Tell them the agent ID and how to follow along (the byspace skill explains).
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: byspace-loop
|
|
3
|
+
description: Run an agent loop until an exit condition is met. Use when the user says "loop", "babysit", "keep trying until", "check every X", "watch", or wants iterative autonomous execution.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# BySpace Loop Skill
|
|
8
|
+
|
|
9
|
+
A loop is a worker/verifier cycle: launch a worker → check verification → repeat until done or limits hit. Use for "keep trying", "babysit", or "watch this until X."
|
|
10
|
+
|
|
11
|
+
**User's arguments:** $ARGUMENTS
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
Read the **byspace** skill. Before choosing worker or verifier providers, read `~/.byspace/orchestration-preferences.json` unless the user explicitly named providers in this request. Do not start the loop until you have read it.
|
|
16
|
+
|
|
17
|
+
Loops are a CLI primitive: `byspace loop run`. Manage with `byspace loop ls`, `byspace loop inspect <id>`, `byspace loop logs <id>`, `byspace loop stop <id>`.
|
|
18
|
+
|
|
19
|
+
## Your job
|
|
20
|
+
|
|
21
|
+
1. Understand the user's intent from `$ARGUMENTS` and the conversation.
|
|
22
|
+
2. **Worker prompt** — self-contained, concrete about what to do this iteration, explicit about what counts as progress.
|
|
23
|
+
3. **Verification** — pick the right shape:
|
|
24
|
+
- Shell check (`--verify-check`) for objective criteria a command can answer (`gh pr checks --fail-fast`, `npm test`).
|
|
25
|
+
- Verifier prompt (`--verify`) for judgment ("Return done=true only if all tests pass and the changed files are coherent. Cite the command and the outcome.").
|
|
26
|
+
- Both, when shell rules out the obvious failures and the verifier judges the rest.
|
|
27
|
+
4. **Providers** — `--provider` for the worker, `--verify-provider` for the verifier. From preferences unless the user named them. For implementation loops, pair worker and verifier on different providers — each catches the other's blind spots.
|
|
28
|
+
5. **Sleep** — `--sleep` only when polling something external. Otherwise let it run as fast as the loop completes.
|
|
29
|
+
6. **Stops** — set a sensible `--max-iterations` and/or `--max-time`. Open-ended loops are how runaways happen.
|
|
30
|
+
7. **Archive** — `--archive` keeps agents after each iteration for inspection.
|
|
31
|
+
8. Launch with `byspace loop run`.
|
|
32
|
+
|
|
33
|
+
## Common shapes
|
|
34
|
+
|
|
35
|
+
**Babysit a PR** — worker checks PR state and fixes issues; shell check is `gh pr checks <n> --fail-fast`; sleep 2m; max-time 1h.
|
|
36
|
+
|
|
37
|
+
**Drive tests to green** — worker investigates failures and fixes code; shell check is the test command; verifier confirms all tests pass; max-iterations 10.
|
|
38
|
+
|
|
39
|
+
**Cross-provider implementation** — worker on `impl` provider, verifier on a different provider; verifier checks changed files, runs typecheck and tests; max-iterations and max-time both bounded; archive on so iterations can be inspected.
|
|
40
|
+
|
|
41
|
+
## Prompt rules
|
|
42
|
+
|
|
43
|
+
**Worker** — self-contained, concrete (commands, files, branches, tests, PRs, systems), explicit about what counts as progress this iteration.
|
|
44
|
+
|
|
45
|
+
**Verifier** — checks facts, doesn't suggest fixes, cites commands/outputs/file evidence, specific about what "done" means.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytetrue/byspace-server",
|
|
3
|
-
"version": "0.2.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "BySpace backend server",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist/server",
|
|
8
8
|
"dist/src",
|
|
9
9
|
"dist/scripts",
|
|
10
|
+
"dist/skills",
|
|
10
11
|
"!dist/**/*.map",
|
|
11
12
|
"README.md",
|
|
12
13
|
".env.example"
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"clean": "node ../../scripts/clean-package-dist.mjs",
|
|
37
38
|
"build": "npm run build:lib && npm run build:scripts",
|
|
38
39
|
"build:clean": "npm run clean && npm run build",
|
|
39
|
-
"build:lib": "tsc -p tsconfig.server.json --incremental false && node -e \"const fs=require('node:fs'); fs.mkdirSync('dist/server/server/speech/providers/local/sherpa/assets',{recursive:true}); fs.copyFileSync('src/server/speech/providers/local/sherpa/assets/silero_vad.onnx','dist/server/server/speech/providers/local/sherpa/assets/silero_vad.onnx'); fs.cpSync('src/terminal/shell-integration','dist/server/terminal/shell-integration',{recursive:true}); fs.cpSync('src/terminal/shell-integration','dist/src/terminal/shell-integration',{recursive:true}); fs.copyFileSync('src/terminal/terminal-ts-loader.mjs','dist/server/terminal/terminal-ts-loader.mjs');\"",
|
|
40
|
+
"build:lib": "tsc -p tsconfig.server.json --incremental false && node -e \"const fs=require('node:fs'); fs.mkdirSync('dist/server/server/speech/providers/local/sherpa/assets',{recursive:true}); fs.copyFileSync('src/server/speech/providers/local/sherpa/assets/silero_vad.onnx','dist/server/server/speech/providers/local/sherpa/assets/silero_vad.onnx'); fs.cpSync('src/terminal/shell-integration','dist/server/terminal/shell-integration',{recursive:true}); fs.cpSync('src/terminal/shell-integration','dist/src/terminal/shell-integration',{recursive:true}); fs.copyFileSync('src/terminal/terminal-ts-loader.mjs','dist/server/terminal/terminal-ts-loader.mjs'); fs.cpSync('../../skills','dist/skills',{recursive:true});\"",
|
|
40
41
|
"build:scripts": "tsc -p tsconfig.scripts.json --incremental false && node -e \"const fs=require('node:fs'); fs.mkdirSync('dist/scripts',{recursive:true}); fs.copyFileSync('scripts/mcp-stdio-socket-bridge-cli.mjs','dist/scripts/mcp-stdio-socket-bridge-cli.mjs');\"",
|
|
41
42
|
"prepack": "npm run build:clean && npm --prefix ../.. run build:daemon-web-ui",
|
|
42
43
|
"start": "node dist/scripts/supervisor-entrypoint.js",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytetrue/byspace",
|
|
3
|
-
"version": "0.2.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "BySpace CLI - control your AI coding agents from the command line",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@bytetrue/byspace-client": "0.2.0
|
|
25
|
-
"@bytetrue/byspace-protocol": "0.2.0
|
|
26
|
-
"@bytetrue/byspace-server": "0.2.0
|
|
24
|
+
"@bytetrue/byspace-client": "0.2.0",
|
|
25
|
+
"@bytetrue/byspace-protocol": "0.2.0",
|
|
26
|
+
"@bytetrue/byspace-server": "0.2.0",
|
|
27
27
|
"@clack/prompts": "^1.0.0",
|
|
28
28
|
"chalk": "^5.3.0",
|
|
29
29
|
"commander": "^12.0.0",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"@lezer/yaml": "^1.0.4",
|
|
51
51
|
"@replit/codemirror-lang-csharp": "^6.2.0",
|
|
52
52
|
"lezer-elixir": "^1.1.2",
|
|
53
|
-
"@bytetrue/byspace-highlight": "0.2.0
|
|
53
|
+
"@bytetrue/byspace-highlight": "0.2.0",
|
|
54
54
|
"zod": "^4.4.3",
|
|
55
55
|
"base64-js": "^1.5.1",
|
|
56
56
|
"tweetnacl": "^1.0.3",
|
|
57
|
-
"@bytetrue/byspace-relay": "0.2.0
|
|
57
|
+
"@bytetrue/byspace-relay": "0.2.0",
|
|
58
58
|
"@agentclientprotocol/sdk": "^0.17.1",
|
|
59
59
|
"@anthropic-ai/claude-agent-sdk": "^0.3.195",
|
|
60
60
|
"@anthropic-ai/sdk": "^0.104.2",
|
|
Binary file
|