@jkwd/inbase 0.1.9 → 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 +23 -7
- 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 +6 -0
- package/apps/explorer/scripts/patch-lib.mjs +6 -0
- package/apps/explorer/scripts/scan-target.mjs +46 -13
- package/apps/explorer/scripts/session-store.d.ts +64 -1
- package/apps/explorer/scripts/session-store.mjs +369 -88
- package/apps/explorer/scripts/tree-diff.mjs +121 -0
- package/apps/explorer/src/App.tsx +215 -86
- package/apps/explorer/src/agentIntent.ts +78 -0
- package/apps/explorer/src/branchChanges.ts +54 -0
- package/apps/explorer/src/index.css +152 -10
- package/apps/explorer/src/scene/FileBlock.tsx +55 -5
- package/apps/explorer/src/types.ts +46 -0
- package/apps/explorer/src/ui/HUD.tsx +670 -158
- package/apps/explorer/src/userContext.ts +11 -0
- package/apps/explorer/vite.config.ts +65 -5
- 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 +142 -89
package/skill/inbase/SKILL.md
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
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
|
-
|
|
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
|
|
10
|
+
questions.
|
|
8
11
|
---
|
|
9
12
|
|
|
10
13
|
# Inbase visual edits
|
|
@@ -13,41 +16,91 @@ Apply this skill **whenever the work is file changes in this repository**.
|
|
|
13
16
|
Skip it for git, lockfiles, `.inbase`, `.cursor`, or questions with no code
|
|
14
17
|
changes.
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
highlighted step, publishes only that step's diff, then waits for **Run step**
|
|
19
|
-
on the following step or an alternative instruction. When **Step by step** is
|
|
20
|
-
off, `inbase wait-for-approval` returns `VISUAL_CODER_EXECUTE` for every
|
|
21
|
-
remaining step without the user clicking Run step; after the last patch, wait
|
|
22
|
-
for the user to **Complete**. They can still walk Previous/Next over the diffs.
|
|
23
|
-
Always work via patch files. Do not Write, StrReplace, or Delete project files.
|
|
19
|
+
Sessions start only from the visualizer (**Setup LLM session**). This chat
|
|
20
|
+
cannot open a session.
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
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**:
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## Required sequence
|
|
29
|
+
```
|
|
30
|
+
direct chat interaction not allowed use /skipinbase [request] to bypass inbase.
|
|
31
|
+
```
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
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:
|
|
35
55
|
|
|
36
56
|
```bash
|
|
37
|
-
npx inbase
|
|
57
|
+
npx inbase attach
|
|
38
58
|
```
|
|
39
59
|
|
|
40
|
-
|
|
41
|
-
|
|
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.
|
|
42
90
|
|
|
43
91
|
```bash
|
|
44
|
-
npx inbase wait-for-blueprint --session "<
|
|
92
|
+
npx inbase wait-for-blueprint --session "<session-id>"
|
|
45
93
|
```
|
|
46
94
|
|
|
47
|
-
The
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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.
|
|
51
104
|
3. Read the handshake output between `VISUAL_CODER_BLUEPRINT_START` and
|
|
52
105
|
`VISUAL_CODER_BLUEPRINT_END`, or read
|
|
53
106
|
`.inbase/diff-sessions/<session-id>/blueprint.json`.
|
|
@@ -73,13 +126,13 @@ npx inbase wait-for-blueprint --session "<current-cursor-chat-id>"
|
|
|
73
126
|
and choose files from the request itself. Viewpoint never overrides the
|
|
74
127
|
blueprint: still follow this session's blueprint when `enabled` is true.
|
|
75
128
|
6. List **all** steps needed to finish the feature. Keep steps small enough that
|
|
76
|
-
one
|
|
77
|
-
edits).
|
|
78
|
-
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:
|
|
79
132
|
|
|
80
133
|
```bash
|
|
81
134
|
npx inbase report-plan \
|
|
82
|
-
--session "<
|
|
135
|
+
--session "<session-id>" \
|
|
83
136
|
--feature "short feature name" \
|
|
84
137
|
--steps "Add Clock component" \
|
|
85
138
|
--steps "Show Clock on Home"
|
|
@@ -88,92 +141,92 @@ npx inbase report-plan \
|
|
|
88
141
|
8. **Stop and wait for invocation**:
|
|
89
142
|
|
|
90
143
|
```bash
|
|
91
|
-
npx inbase wait-for-approval --session "<
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Do not write a patch until this prints `VISUAL_CODER_EXECUTE`. If Step by
|
|
95
|
-
step is off, this returns immediately for each remaining step.
|
|
96
|
-
9. Implement only the invoked step as a unified diff. Paths are relative to the
|
|
97
|
-
project root (same ids as `codebase.json`):
|
|
98
|
-
|
|
99
|
-
```diff
|
|
100
|
-
--- /dev/null
|
|
101
|
-
+++ b/src/components/Clock.tsx
|
|
102
|
-
@@ -0,0 +1,5 @@
|
|
103
|
-
+export function Clock() {
|
|
104
|
-
+ return <time>00:00</time>
|
|
105
|
-
+}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
```diff
|
|
109
|
-
--- a/src/pages/Home.tsx
|
|
110
|
-
+++ b/src/pages/Home.tsx
|
|
111
|
-
@@ -1,3 +1,4 @@
|
|
112
|
-
+import { Clock } from '../components/Clock'
|
|
113
|
-
import { Counter } from '../components/Counter'
|
|
144
|
+
npx inbase wait-for-approval --session "<session-id>"
|
|
114
145
|
```
|
|
115
146
|
|
|
116
|
-
|
|
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:
|
|
117
156
|
|
|
118
157
|
```bash
|
|
119
|
-
npx inbase propose-patch
|
|
120
|
-
--session "<current-cursor-chat-id>" \
|
|
121
|
-
/tmp/step.patch
|
|
158
|
+
npx inbase propose-patch --session "<session-id>"
|
|
122
159
|
```
|
|
123
160
|
|
|
124
|
-
|
|
125
|
-
stored in the session folder.
|
|
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.
|
|
126
163
|
|
|
127
|
-
10. **Stop
|
|
128
|
-
|
|
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.
|
|
167
|
+
11. Wait until the user clicks **Accept proposal** on the current step (or, when Step by
|
|
129
168
|
step is off, until the next step is auto-invoked), sends an alternative
|
|
130
|
-
instruction,
|
|
169
|
+
instruction, or stops the workflow:
|
|
131
170
|
|
|
132
171
|
```bash
|
|
133
|
-
npx inbase wait-for-approval --session "<
|
|
172
|
+
npx inbase wait-for-approval --session "<session-id>"
|
|
134
173
|
```
|
|
135
174
|
|
|
136
|
-
12. Read the wait command output
|
|
175
|
+
12. Read the wait command output. Reply in chat with the `VISUAL_CODER_ACK`
|
|
176
|
+
line first, then:
|
|
137
177
|
|
|
138
|
-
- Exit `0` (`VISUAL_CODER_EXECUTE`): the
|
|
139
|
-
|
|
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),
|
|
140
183
|
then wait again.
|
|
141
|
-
- Exit `5` (`VISUAL_CODER_FINISHED`): that was
|
|
142
|
-
already applied the final patch and removed
|
|
143
|
-
blueprint drafts. Optionally run `--clear` if
|
|
144
|
-
user the feature is done, and **stop**. Do not
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
`
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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.
|
|
157
204
|
|
|
158
205
|
13. After a finished handshake, the explorer already removed stored session
|
|
159
206
|
diffs and blueprint drafts. Optionally run:
|
|
160
207
|
|
|
161
208
|
```bash
|
|
162
|
-
npx inbase propose-patch --session "<
|
|
209
|
+
npx inbase propose-patch --session "<session-id>" --clear
|
|
163
210
|
```
|
|
164
211
|
|
|
165
212
|
## Do not
|
|
166
213
|
|
|
167
|
-
-
|
|
168
|
-
|
|
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
|
|
169
219
|
- Treat the chat request, viewpoint, or your own plan as overriding an enabled blueprint
|
|
170
220
|
- Skip, rename, relocate, or replace this session's `blueprint.json` files, islands, functions, variables, or imports when `enabled` is true
|
|
171
221
|
- Silently differ from the blueprint; ask the user first
|
|
172
222
|
- Read global `user-context.json` for placed files; those live on the session blueprint
|
|
173
223
|
- Follow the user's look when `followLook` is false
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
- Write a patch
|
|
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
|
|
177
230
|
- Propose the next step before `inbase wait-for-approval` returns `VISUAL_CODER_EXECUTE`
|
|
178
231
|
- Propose another patch after `VISUAL_CODER_FINISHED`
|
|
179
232
|
- Reuse, overwrite, or expand an existing session diff
|