@jkwd/inbase 0.1.10 → 0.1.11
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/LICENSE +21 -0
- package/README.md +22 -9
- package/apps/explorer/package.json +1 -0
- package/apps/explorer/scripts/branch-changes.d.ts +24 -0
- package/apps/explorer/scripts/branch-changes.mjs +237 -0
- package/apps/explorer/scripts/js-source.mjs +12 -15
- package/apps/explorer/scripts/patch-lib.d.ts +5 -0
- package/apps/explorer/scripts/patch-lib.mjs +5 -0
- package/apps/explorer/scripts/scan-target.mjs +46 -13
- package/apps/explorer/scripts/session-store.d.ts +58 -1
- package/apps/explorer/scripts/session-store.mjs +276 -52
- package/apps/explorer/scripts/tree-diff.mjs +121 -0
- package/apps/explorer/src/App.tsx +132 -27
- package/apps/explorer/src/agentIntent.ts +63 -0
- package/apps/explorer/src/branchChanges.ts +54 -0
- package/apps/explorer/src/index.css +124 -0
- package/apps/explorer/src/scene/FileBlock.tsx +55 -5
- package/apps/explorer/src/types.ts +44 -0
- package/apps/explorer/src/ui/HUD.tsx +576 -92
- package/apps/explorer/src/userContext.ts +11 -0
- package/apps/explorer/vite.config.ts +61 -7
- package/bin/inbase.mjs +23 -4
- package/bin/project.mjs +62 -4
- package/bin/session.mjs +215 -125
- package/package.json +20 -2
- package/skill/commands/inbase.md +17 -0
- package/skill/commands/skipinbase.md +9 -0
- package/skill/inbase/SKILL.md +141 -112
package/skill/inbase/SKILL.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
name: inbase
|
|
3
3
|
description: >-
|
|
4
4
|
Grounds source-file changes in the Inbase visual map. Use when creating,
|
|
5
|
-
editing, or deleting application source files in this repository
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
editing, or deleting application source files in this repository, including
|
|
6
|
+
when the user chats a change request without /inbase. Direct chat is blocked
|
|
7
|
+
unless they invoked /inbase or /skipinbase. Lists every feature step, then
|
|
8
|
+
edits live files after invocation and records each step with inbase
|
|
9
|
+
propose-patch (no patch file). Do not use for git, docs-only, lockfiles, or
|
|
9
10
|
questions.
|
|
10
11
|
---
|
|
11
12
|
|
|
@@ -15,50 +16,91 @@ Apply this skill **whenever the work is file changes in this repository**.
|
|
|
15
16
|
Skip it for git, lockfiles, `.inbase`, `.cursor`, or questions with no code
|
|
16
17
|
changes.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
step, publishes only that step's diff, then waits for **Accept proposal** on
|
|
21
|
-
that step or an alternative instruction. When **Step by step** is
|
|
22
|
-
off, `inbase wait-for-approval` returns `VISUAL_CODER_EXECUTE` for every
|
|
23
|
-
remaining step without the user clicking; after the last patch, wait
|
|
24
|
-
for the user to **Accept proposal**. They can still walk Previous/Next over the diffs.
|
|
19
|
+
Sessions start only from the visualizer (**Setup LLM session**). This chat
|
|
20
|
+
cannot open a session.
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
- **`/skipinbase`**: do the user's request without Inbase. Do not attach, wait,
|
|
23
|
+
or record patches.
|
|
24
|
+
- **`/inbase`**, or this conversation already has a `VISUAL_CODER_SESSION` from
|
|
25
|
+
`/inbase`: connect if needed, then follow Required sequence. Do not refuse.
|
|
26
|
+
- **Any other file-change request**: do not edit files and do not run Inbase
|
|
27
|
+
commands. Reply with exactly this line, then **stop**:
|
|
32
28
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Inbase must already be running (`inbase run` or `npx inbase run`). Prefer
|
|
37
|
-
`npx inbase` so the local package is used.
|
|
38
|
-
|
|
39
|
-
## Required sequence
|
|
29
|
+
```
|
|
30
|
+
direct chat interaction not allowed use /skipinbase [request] to bypass inbase.
|
|
31
|
+
```
|
|
40
32
|
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
The LLM uses a plan-first loop. It reports the complete plan before editing
|
|
34
|
+
files. When **Step by step** is on, it waits for the user to click **Create
|
|
35
|
+
proposal** on the first step, edits live files for that step, records them with `inbase propose-patch`,
|
|
36
|
+
then waits for **Accept proposal** or an alternative instruction. When **Step
|
|
37
|
+
by step** is off, `inbase wait-for-approval` returns `VISUAL_CODER_EXECUTE` for
|
|
38
|
+
every remaining step without the user clicking; after the last recorded step,
|
|
39
|
+
wait for the user to **Accept proposal**. They can still walk Previous/Next
|
|
40
|
+
over the recorded diffs.
|
|
41
|
+
|
|
42
|
+
**Recorded patches are the session record.** After `VISUAL_CODER_EXECUTE`, edit
|
|
43
|
+
live project files with Write, StrReplace, and Delete for that step only. Then
|
|
44
|
+
run `inbase propose-patch` with no patch file. Inbase diffs the working tree
|
|
45
|
+
against the snapshot taken at invoke and stores that patch. A later instruction
|
|
46
|
+
replaces the withdrawn step; edit from the accepted live files, not from the
|
|
47
|
+
withdrawn proposal. Do not write a unified diff yourself.
|
|
48
|
+
|
|
49
|
+
The visualizer stores immutable diffs under
|
|
50
|
+
`.inbase/diff-sessions/<session-id>/diffs/`. Inbase must already be running
|
|
51
|
+
(`inbase run` or `npx inbase run`). Prefer `npx inbase` so the local package
|
|
52
|
+
is used.
|
|
53
|
+
|
|
54
|
+
If this chat is not yet attached, run:
|
|
43
55
|
|
|
44
56
|
```bash
|
|
45
|
-
npx inbase
|
|
57
|
+
npx inbase attach
|
|
46
58
|
```
|
|
47
59
|
|
|
48
|
-
|
|
49
|
-
|
|
60
|
+
That attaches this chat to the session currently focused in the map. No id is
|
|
61
|
+
passed in; read `VISUAL_CODER_SESSION` from the output and use that
|
|
62
|
+
`--session` value for every later command. Then continue from
|
|
63
|
+
`wait-for-blueprint` below. Do **not** run `start-session`. Do **not** wait
|
|
64
|
+
for a blueprint handshake.
|
|
65
|
+
|
|
66
|
+
## Direct response
|
|
67
|
+
|
|
68
|
+
Visualizer signals arrive as `VISUAL_CODER_ACK` from `attach`,
|
|
69
|
+
`wait-for-blueprint`, and `wait-for-approval`. While a wait command is running
|
|
70
|
+
you cannot chat; that process is the listen loop.
|
|
71
|
+
|
|
72
|
+
The moment a command prints `VISUAL_CODER_ACK`, **reply in this chat first**
|
|
73
|
+
with one short sentence that acknowledges the signal. Echo the ack, for
|
|
74
|
+
example: `Got it — running step 2: Show ColorGenerator on Home.` Then continue
|
|
75
|
+
the required tools in the same turn. Do not wait for the user after the ack.
|
|
76
|
+
Do not start with a long analysis. Do not call tools before that sentence.
|
|
77
|
+
|
|
78
|
+
After `propose-patch` on a non-final step, the **next tool call must be**
|
|
79
|
+
`wait-for-approval`. Do not explore, search, or re-plan in between. **Accept
|
|
80
|
+
proposal** invokes the next step; when that wait returns `EXECUTE`, implement
|
|
81
|
+
that step immediately. Do not run `wait-for-blueprint` again. Do not report a
|
|
82
|
+
new plan.
|
|
83
|
+
|
|
84
|
+
## Required sequence
|
|
85
|
+
|
|
86
|
+
1. **Read the current layout**. `/inbase` already started the session. Run
|
|
87
|
+
this once to load the optional blueprint and instruction — it returns
|
|
88
|
+
immediately. Do not wait for the user to send a blueprint. Then report a
|
|
89
|
+
plan.
|
|
50
90
|
|
|
51
91
|
```bash
|
|
52
|
-
npx inbase wait-for-blueprint --session "<
|
|
92
|
+
npx inbase wait-for-blueprint --session "<session-id>"
|
|
53
93
|
```
|
|
54
94
|
|
|
55
|
-
The
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
95
|
+
The user may have placed files (`Space`) and islands (`B`), or left the
|
|
96
|
+
blueprint empty. That choice is already on the session. They can keep
|
|
97
|
+
placing on later steps. This chat's blueprint is stored only for this
|
|
98
|
+
session.
|
|
99
|
+
If `wait-for-blueprint` prints `VISUAL_CODER_INSTRUCTION_START` /
|
|
100
|
+
`VISUAL_CODER_INSTRUCTION_END`, that text is the user's request for this
|
|
101
|
+
session. Plan from that instruction and the blueprint together. The
|
|
102
|
+
instruction does not override an enabled blueprint; if they conflict,
|
|
103
|
+
ask the user.
|
|
62
104
|
3. Read the handshake output between `VISUAL_CODER_BLUEPRINT_START` and
|
|
63
105
|
`VISUAL_CODER_BLUEPRINT_END`, or read
|
|
64
106
|
`.inbase/diff-sessions/<session-id>/blueprint.json`.
|
|
@@ -84,13 +126,13 @@ npx inbase wait-for-blueprint --session "<current-cursor-chat-id>"
|
|
|
84
126
|
and choose files from the request itself. Viewpoint never overrides the
|
|
85
127
|
blueprint: still follow this session's blueprint when `enabled` is true.
|
|
86
128
|
6. List **all** steps needed to finish the feature. Keep steps small enough that
|
|
87
|
-
one
|
|
88
|
-
edits).
|
|
89
|
-
7. Report the plan before
|
|
129
|
+
one recorded step is one landscape change (usually one new file, or a few
|
|
130
|
+
related edits).
|
|
131
|
+
7. Report the plan before editing files:
|
|
90
132
|
|
|
91
133
|
```bash
|
|
92
134
|
npx inbase report-plan \
|
|
93
|
-
--session "<
|
|
135
|
+
--session "<session-id>" \
|
|
94
136
|
--feature "short feature name" \
|
|
95
137
|
--steps "Add Clock component" \
|
|
96
138
|
--steps "Show Clock on Home"
|
|
@@ -99,105 +141,92 @@ npx inbase report-plan \
|
|
|
99
141
|
8. **Stop and wait for invocation**:
|
|
100
142
|
|
|
101
143
|
```bash
|
|
102
|
-
npx inbase wait-for-approval --session "<
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Do not write a patch until this prints `VISUAL_CODER_EXECUTE`. If Step by
|
|
106
|
-
step is off, this returns immediately for each remaining step. Before
|
|
107
|
-
implementing, re-read this session's `blueprint.json`; the user can place
|
|
108
|
-
files and islands on any step.
|
|
109
|
-
9. Implement only the invoked step as a unified diff against the current live
|
|
110
|
-
files (baseline + accepted patch files). Paths are relative to the
|
|
111
|
-
project root (same ids as `codebase.json`):
|
|
112
|
-
|
|
113
|
-
```diff
|
|
114
|
-
--- /dev/null
|
|
115
|
-
+++ b/src/components/Clock.tsx
|
|
116
|
-
@@ -0,0 +1,5 @@
|
|
117
|
-
+export function Clock() {
|
|
118
|
-
+ return <time>00:00</time>
|
|
119
|
-
+}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
```diff
|
|
123
|
-
--- a/src/pages/Home.tsx
|
|
124
|
-
+++ b/src/pages/Home.tsx
|
|
125
|
-
@@ -1,3 +1,4 @@
|
|
126
|
-
+import { Clock } from '../components/Clock'
|
|
127
|
-
import { Counter } from '../components/Counter'
|
|
144
|
+
npx inbase wait-for-approval --session "<session-id>"
|
|
128
145
|
```
|
|
129
146
|
|
|
130
|
-
|
|
147
|
+
Do not edit project files until this prints `VISUAL_CODER_ACK execute` /
|
|
148
|
+
`VISUAL_CODER_EXECUTE`. If Step by step is off, this returns immediately for
|
|
149
|
+
each remaining step. First reply in chat acknowledging the ack, then re-read
|
|
150
|
+
this session's `blueprint.json`; the user can place files and islands on any
|
|
151
|
+
step.
|
|
152
|
+
9. Implement only the invoked step by editing the live project files (Write,
|
|
153
|
+
StrReplace, Delete). Paths are the same ids as `codebase.json`. Then record
|
|
154
|
+
the step — Inbase diffs the working tree against the snapshot taken at
|
|
155
|
+
invoke:
|
|
131
156
|
|
|
132
157
|
```bash
|
|
133
|
-
npx inbase propose-patch
|
|
134
|
-
--session "<current-cursor-chat-id>" \
|
|
135
|
-
/tmp/step.patch
|
|
158
|
+
npx inbase propose-patch --session "<session-id>"
|
|
136
159
|
```
|
|
137
160
|
|
|
138
|
-
|
|
139
|
-
stored in the session folder.
|
|
140
|
-
applies the live patch chain. Do not `git apply`, copy files, or edit
|
|
141
|
-
project files yourself.
|
|
161
|
+
Do not write a unified diff. Do not pass a `.patch` file. Never write or
|
|
162
|
+
replace a patch already stored in the session folder.
|
|
142
163
|
|
|
143
|
-
10. **Stop
|
|
144
|
-
|
|
164
|
+
10. **Stop editing** until the next `VISUAL_CODER_EXECUTE`. The stored patch is
|
|
165
|
+
the session record; disk already has your edits. Your next tool call is
|
|
166
|
+
`wait-for-approval` — nothing else.
|
|
145
167
|
11. Wait until the user clicks **Accept proposal** on the current step (or, when Step by
|
|
146
168
|
step is off, until the next step is auto-invoked), sends an alternative
|
|
147
169
|
instruction, or stops the workflow:
|
|
148
170
|
|
|
149
171
|
```bash
|
|
150
|
-
npx inbase wait-for-approval --session "<
|
|
172
|
+
npx inbase wait-for-approval --session "<session-id>"
|
|
151
173
|
```
|
|
152
174
|
|
|
153
|
-
12. Read the wait command output
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
`
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
12. Read the wait command output. Reply in chat with the `VISUAL_CODER_ACK`
|
|
176
|
+
line first, then:
|
|
177
|
+
|
|
178
|
+
- Exit `0` (`VISUAL_CODER_ACK execute` / `VISUAL_CODER_EXECUTE`): the
|
|
179
|
+
highlighted step was invoked. If this is a later step, implement it now —
|
|
180
|
+
do not explore, re-plan, or run `wait-for-blueprint`. Re-read this
|
|
181
|
+
session's `blueprint.json` only if you need placed files. Edit live files
|
|
182
|
+
for that step only, record with `inbase propose-patch` (no patch file),
|
|
183
|
+
then wait again.
|
|
184
|
+
- Exit `5` (`VISUAL_CODER_ACK finished` / `VISUAL_CODER_FINISHED`): that was
|
|
185
|
+
the last step. The visualizer already applied the final patch and removed
|
|
186
|
+
stored session diffs and blueprint drafts. Optionally run `--clear` if
|
|
187
|
+
anything remains, tell the user the feature is done, and **stop**. Do not
|
|
188
|
+
propose another patch.
|
|
189
|
+
- Exit `4` (`VISUAL_CODER_ACK replan` / `VISUAL_CODER_REPLAN`): do **not**
|
|
190
|
+
edit project files and do not rewrite an earlier accepted patch. The
|
|
191
|
+
withdrawn proposal is no longer live; disk is baseline + accepted patch
|
|
192
|
+
files. Follow the text between `VISUAL_CODER_INSTRUCTION_START` and
|
|
193
|
+
`VISUAL_CODER_INSTRUCTION_END`, read this session's `blueprint.json` when
|
|
194
|
+
it is enabled (files, islands, `addedFunctions`, `addedVariables`,
|
|
195
|
+
`addedImports`). The blueprint stays leading. If the new instruction would
|
|
196
|
+
differ from it, ask the user before replacing the plan. Read
|
|
197
|
+
`user-context.json` (follow the viewpoint only if `followLook` is true),
|
|
198
|
+
replace the plan from the current step onward using `inbase report-plan`,
|
|
199
|
+
then wait for the next `VISUAL_CODER_EXECUTE` before editing again. The
|
|
200
|
+
replacement edits must sit on the accepted live files, not the withdrawn
|
|
201
|
+
proposal.
|
|
202
|
+
- Exit `2` (`VISUAL_CODER_ACK stopped` / `VISUAL_CODER_STOPPED`) or `3`
|
|
203
|
+
(`VISUAL_CODER_ACK timeout`): make no further project changes.
|
|
178
204
|
|
|
179
205
|
13. After a finished handshake, the explorer already removed stored session
|
|
180
206
|
diffs and blueprint drafts. Optionally run:
|
|
181
207
|
|
|
182
208
|
```bash
|
|
183
|
-
npx inbase propose-patch --session "<
|
|
209
|
+
npx inbase propose-patch --session "<session-id>" --clear
|
|
184
210
|
```
|
|
185
211
|
|
|
186
212
|
## Do not
|
|
187
213
|
|
|
188
|
-
-
|
|
189
|
-
|
|
214
|
+
- Start a visual session from chat with `start-session`; sessions start only
|
|
215
|
+
from **Setup LLM session** in the map
|
|
216
|
+
- Edit files on a direct chat request; reply with the `/skipinbase` line and stop
|
|
217
|
+
- Invent a session id for `/inbase`; run `npx inbase attach` with no `--session`
|
|
218
|
+
- Skip `inbase wait-for-blueprint`; it returns immediately and provides the optional blueprint and instruction
|
|
190
219
|
- Treat the chat request, viewpoint, or your own plan as overriding an enabled blueprint
|
|
191
220
|
- Skip, rename, relocate, or replace this session's `blueprint.json` files, islands, functions, variables, or imports when `enabled` is true
|
|
192
221
|
- Silently differ from the blueprint; ask the user first
|
|
193
222
|
- Read global `user-context.json` for placed files; those live on the session blueprint
|
|
194
223
|
- Follow the user's look when `followLook` is false
|
|
195
|
-
-
|
|
196
|
-
-
|
|
197
|
-
-
|
|
198
|
-
|
|
199
|
-
-
|
|
200
|
-
-
|
|
224
|
+
- Edit project files before `VISUAL_CODER_EXECUTE`
|
|
225
|
+
- Keep editing after `inbase propose-patch` until the next `VISUAL_CODER_EXECUTE`
|
|
226
|
+
- Write a unified diff yourself; `inbase propose-patch` with no file records the git diff
|
|
227
|
+
- Pass a `.patch` file to `propose-patch` unless you are debugging the CLI
|
|
228
|
+
- Explore, search, or re-plan after `propose-patch` before `wait-for-approval`
|
|
229
|
+
- Stay silent or call tools before acknowledging a `VISUAL_CODER_ACK` in chat
|
|
201
230
|
- Propose the next step before `inbase wait-for-approval` returns `VISUAL_CODER_EXECUTE`
|
|
202
231
|
- Propose another patch after `VISUAL_CODER_FINISHED`
|
|
203
232
|
- Reuse, overwrite, or expand an existing session diff
|