@jkwd/inbase 0.1.21 → 0.1.23
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/README.md +13 -7
- package/apps/explorer/package.json +1 -0
- package/apps/explorer/scripts/explain-store.d.ts +135 -0
- package/apps/explorer/scripts/explain-store.mjs +666 -0
- package/apps/explorer/scripts/patch-lib.mjs +4 -0
- package/apps/explorer/scripts/scan-target.mjs +22 -5
- package/apps/explorer/scripts/session-store.d.ts +86 -11
- package/apps/explorer/scripts/session-store.mjs +371 -58
- package/apps/explorer/scripts/target-config.d.ts +38 -3
- package/apps/explorer/scripts/target-config.mjs +147 -3
- package/apps/explorer/src/App.tsx +1073 -158
- package/apps/explorer/src/agentIntent.ts +61 -7
- package/apps/explorer/src/codebase.ts +1 -1
- package/apps/explorer/src/devTargets.ts +66 -0
- package/apps/explorer/src/explain.ts +312 -0
- package/apps/explorer/src/index.css +874 -222
- package/apps/explorer/src/layout.ts +55 -0
- package/apps/explorer/src/scene/DistantFileBlocks.tsx +4 -2
- package/apps/explorer/src/scene/FileBlock.tsx +95 -72
- package/apps/explorer/src/scene/FolderArea.tsx +55 -32
- package/apps/explorer/src/scene/MapView.tsx +506 -33
- package/apps/explorer/src/scene/RelationLines.tsx +7 -0
- package/apps/explorer/src/scene/World.tsx +146 -32
- package/apps/explorer/src/speech.ts +228 -0
- package/apps/explorer/src/theme.ts +29 -0
- package/apps/explorer/src/types.ts +98 -8
- package/apps/explorer/src/ui/CanvasErrorBoundary.tsx +1 -1
- package/apps/explorer/src/ui/ExplainAskCard.tsx +142 -0
- package/apps/explorer/src/ui/ExplainHud.tsx +524 -0
- package/apps/explorer/src/ui/ExplainInfoPanel.tsx +135 -0
- package/apps/explorer/src/ui/ExplainPointer.tsx +73 -0
- package/apps/explorer/src/ui/EyeIcon.tsx +38 -1
- package/apps/explorer/src/ui/HUD.tsx +1067 -795
- package/apps/explorer/src/ui/NameInput.tsx +114 -5
- package/apps/explorer/src/userContext.ts +0 -11
- package/apps/explorer/src/userCreated.ts +54 -1
- package/apps/explorer/vite.config.ts +173 -26
- package/bin/inbase.mjs +11 -2
- package/bin/project.mjs +6 -4
- package/bin/session.mjs +287 -38
- package/package.json +4 -1
- package/skill/commands/amber.md +23 -0
- package/skill/commands/blue.md +13 -0
- package/skill/commands/coral.md +23 -0
- package/skill/commands/explain.md +77 -0
- package/skill/commands/green.md +23 -0
- package/skill/commands/inbase.md +7 -5
- package/skill/commands/lime.md +23 -0
- package/skill/commands/orange.md +23 -0
- package/skill/commands/purple.md +23 -0
- package/skill/commands/red.md +23 -0
- package/skill/commands/skipinbase.md +1 -1
- package/skill/commands/violet.md +23 -0
- package/skill/commands/yellow.md +23 -0
- package/skill/inbase/SKILL.md +124 -76
- package/apps/explorer/src/scene/BlockPlacer.tsx +0 -78
- package/apps/explorer/src/scene/IslandPlacer.tsx +0 -31
- package/apps/explorer/src/scene/SelectionThumbnail.tsx +0 -1069
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Attach this chat to the Lime Inbase session
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/lime`. Attach this chat to the **Lime** Inbase session, not the next empty slot.
|
|
6
|
+
|
|
7
|
+
Do **not** ask for a session id. Do **not** run `inbase start-session`.
|
|
8
|
+
|
|
9
|
+
1. Attach to the Lime session:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx inbase attach --color lime
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
If attach fails with `VISUAL_CODER_NOT_RUNNING`, `VISUAL_CODER_CHAT_LIMIT`, `VISUAL_CODER_COLOR_BUSY`, or `VISUAL_CODER_COLOR_UNKNOWN`, reply with that message and stop.
|
|
16
|
+
|
|
17
|
+
2. Read `VISUAL_CODER_SESSION` from the output. That id is the session to use for every later `inbase` command.
|
|
18
|
+
|
|
19
|
+
3. Continue the Inbase visual edits skill from `wait-for-blueprint` onward with that `--session` id. Attach already started the session. `wait-for-blueprint` only reads the optional blueprint, instruction, and attached files; it does not wait.
|
|
20
|
+
|
|
21
|
+
The user's request is:
|
|
22
|
+
|
|
23
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Attach this chat to the Orange Inbase session
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/orange`. Attach this chat to the **Orange** Inbase session, not the next empty slot.
|
|
6
|
+
|
|
7
|
+
Do **not** ask for a session id. Do **not** run `inbase start-session`.
|
|
8
|
+
|
|
9
|
+
1. Attach to the Orange session:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx inbase attach --color orange
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
If attach fails with `VISUAL_CODER_NOT_RUNNING`, `VISUAL_CODER_CHAT_LIMIT`, `VISUAL_CODER_COLOR_BUSY`, or `VISUAL_CODER_COLOR_UNKNOWN`, reply with that message and stop.
|
|
16
|
+
|
|
17
|
+
2. Read `VISUAL_CODER_SESSION` from the output. That id is the session to use for every later `inbase` command.
|
|
18
|
+
|
|
19
|
+
3. Continue the Inbase visual edits skill from `wait-for-blueprint` onward with that `--session` id. Attach already started the session. `wait-for-blueprint` only reads the optional blueprint, instruction, and attached files; it does not wait.
|
|
20
|
+
|
|
21
|
+
The user's request is:
|
|
22
|
+
|
|
23
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Attach this chat to the Violet (purple) Inbase session
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/purple`. Attach this chat to the **Violet** Inbase session, not the next empty slot.
|
|
6
|
+
|
|
7
|
+
Do **not** ask for a session id. Do **not** run `inbase start-session`.
|
|
8
|
+
|
|
9
|
+
1. Attach to the Violet session:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx inbase attach --color purple
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
If attach fails with `VISUAL_CODER_NOT_RUNNING`, `VISUAL_CODER_CHAT_LIMIT`, `VISUAL_CODER_COLOR_BUSY`, or `VISUAL_CODER_COLOR_UNKNOWN`, reply with that message and stop.
|
|
16
|
+
|
|
17
|
+
2. Read `VISUAL_CODER_SESSION` from the output. That id is the session to use for every later `inbase` command.
|
|
18
|
+
|
|
19
|
+
3. Continue the Inbase visual edits skill from `wait-for-blueprint` onward with that `--session` id. Attach already started the session. `wait-for-blueprint` only reads the optional blueprint, instruction, and attached files; it does not wait.
|
|
20
|
+
|
|
21
|
+
The user's request is:
|
|
22
|
+
|
|
23
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Attach this chat to the Coral (red) Inbase session
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/red`. Attach this chat to the **Coral** Inbase session, not the next empty slot.
|
|
6
|
+
|
|
7
|
+
Do **not** ask for a session id. Do **not** run `inbase start-session`.
|
|
8
|
+
|
|
9
|
+
1. Attach to the Coral session:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx inbase attach --color red
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
If attach fails with `VISUAL_CODER_NOT_RUNNING`, `VISUAL_CODER_CHAT_LIMIT`, `VISUAL_CODER_COLOR_BUSY`, or `VISUAL_CODER_COLOR_UNKNOWN`, reply with that message and stop.
|
|
16
|
+
|
|
17
|
+
2. Read `VISUAL_CODER_SESSION` from the output. That id is the session to use for every later `inbase` command.
|
|
18
|
+
|
|
19
|
+
3. Continue the Inbase visual edits skill from `wait-for-blueprint` onward with that `--session` id. Attach already started the session. `wait-for-blueprint` only reads the optional blueprint, instruction, and attached files; it does not wait.
|
|
20
|
+
|
|
21
|
+
The user's request is:
|
|
22
|
+
|
|
23
|
+
$ARGUMENTS
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
description: Bypass Inbase and do the request directly in this chat
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
The user invoked `/skipinbase`. Do **not** start or attach an Inbase visual session.
|
|
5
|
+
The user invoked `/skipinbase`. Do **not** start or attach an Inbase visual session.
|
|
6
6
|
|
|
7
7
|
Fulfill this request directly, without the Inbase plan/patch loop:
|
|
8
8
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Attach this chat to the Violet Inbase session
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/violet`. Attach this chat to the **Violet** Inbase session, not the next empty slot.
|
|
6
|
+
|
|
7
|
+
Do **not** ask for a session id. Do **not** run `inbase start-session`.
|
|
8
|
+
|
|
9
|
+
1. Attach to the Violet session:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx inbase attach --color violet
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
If attach fails with `VISUAL_CODER_NOT_RUNNING`, `VISUAL_CODER_CHAT_LIMIT`, `VISUAL_CODER_COLOR_BUSY`, or `VISUAL_CODER_COLOR_UNKNOWN`, reply with that message and stop.
|
|
16
|
+
|
|
17
|
+
2. Read `VISUAL_CODER_SESSION` from the output. That id is the session to use for every later `inbase` command.
|
|
18
|
+
|
|
19
|
+
3. Continue the Inbase visual edits skill from `wait-for-blueprint` onward with that `--session` id. Attach already started the session. `wait-for-blueprint` only reads the optional blueprint, instruction, and attached files; it does not wait.
|
|
20
|
+
|
|
21
|
+
The user's request is:
|
|
22
|
+
|
|
23
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Attach this chat to the Amber (yellow) Inbase session
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/yellow`. Attach this chat to the **Amber** Inbase session, not the next empty slot.
|
|
6
|
+
|
|
7
|
+
Do **not** ask for a session id. Do **not** run `inbase start-session`.
|
|
8
|
+
|
|
9
|
+
1. Attach to the Amber session:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx inbase attach --color yellow
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
If attach fails with `VISUAL_CODER_NOT_RUNNING`, `VISUAL_CODER_CHAT_LIMIT`, `VISUAL_CODER_COLOR_BUSY`, or `VISUAL_CODER_COLOR_UNKNOWN`, reply with that message and stop.
|
|
16
|
+
|
|
17
|
+
2. Read `VISUAL_CODER_SESSION` from the output. That id is the session to use for every later `inbase` command.
|
|
18
|
+
|
|
19
|
+
3. Continue the Inbase visual edits skill from `wait-for-blueprint` onward with that `--session` id. Attach already started the session. `wait-for-blueprint` only reads the optional blueprint, instruction, and attached files; it does not wait.
|
|
20
|
+
|
|
21
|
+
The user's request is:
|
|
22
|
+
|
|
23
|
+
$ARGUMENTS
|
package/skill/inbase/SKILL.md
CHANGED
|
@@ -3,11 +3,11 @@ name: inbase
|
|
|
3
3
|
description: >-
|
|
4
4
|
Grounds source-file changes in the Inbase visual map. Use when creating,
|
|
5
5
|
editing, or deleting application source files in this repository, including
|
|
6
|
-
when the user chats a change request without /inbase.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
questions.
|
|
6
|
+
when the user chats a change request without /inbase. Connects this chat to
|
|
7
|
+
the next empty Inbase session, or to a color with /coral /red /amber and
|
|
8
|
+
the other session colors. Lists every feature step, then edits live
|
|
9
|
+
files after invocation and records each step with inbase propose-patch (no
|
|
10
|
+
patch file). Do not use for git, docs-only, lockfiles, or questions.
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
# Inbase visual edits
|
|
@@ -16,19 +16,18 @@ Apply this skill **whenever the work is file changes in this repository**.
|
|
|
16
16
|
Skip it for git, lockfiles, `.inbase`, `.cursor`, or questions with no code
|
|
17
17
|
changes.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
`npx inbase run` creates 5 empty chat slots. A regular Cursor chat connects to
|
|
20
|
+
the next unconnected slot. You do not need `/inbase`.
|
|
21
21
|
|
|
22
|
+
- **`/coral` `/amber` `/lime` `/orange` `/violet`**: attach this chat to that
|
|
23
|
+
color's empty slot. Aliases: `/red` (Coral), `/yellow` (Amber), `/green`
|
|
24
|
+
(Lime), `/purple` (Violet). The text after the command is the user's request.
|
|
25
|
+
- **`/blue`**: Blue is the global blueprint, not a chat. Do not attach.
|
|
22
26
|
- **`/skipinbase`**: do the user's request without Inbase. Do not attach, wait,
|
|
23
27
|
or record patches.
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
commands. Reply with exactly this line, then **stop**:
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
direct chat interaction not allowed use /skipinbase [request] to bypass inbase.
|
|
31
|
-
```
|
|
28
|
+
- **Any other file-change request**, or this conversation already has a
|
|
29
|
+
`VISUAL_CODER_SESSION`: connect if needed, then follow Required sequence.
|
|
30
|
+
Do not refuse.
|
|
32
31
|
|
|
33
32
|
The LLM uses a plan-first loop. It reports the complete plan before editing
|
|
34
33
|
files. When **Step by step** is on, it waits for the user to click **Create
|
|
@@ -51,18 +50,46 @@ The visualizer stores immutable diffs under
|
|
|
51
50
|
(`inbase run` or `npx inbase run`). Prefer `npx inbase` so the local package
|
|
52
51
|
is used.
|
|
53
52
|
|
|
54
|
-
If this chat is not yet attached
|
|
53
|
+
If this chat is not yet attached:
|
|
54
|
+
|
|
55
|
+
- If the user invoked `/coral`, `/red`, `/amber`, `/yellow`, `/lime`,
|
|
56
|
+
`/green`, `/orange`, `/violet`, or `/purple`, run
|
|
57
|
+
`npx inbase attach --color <that command name>` (for example `/red` →
|
|
58
|
+
`--color red`).
|
|
59
|
+
- Otherwise run:
|
|
55
60
|
|
|
56
61
|
```bash
|
|
57
62
|
npx inbase attach
|
|
58
63
|
```
|
|
59
64
|
|
|
60
|
-
That attaches this chat to the
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
for
|
|
65
|
+
That attaches this chat to the matching color's empty slot, or to the next
|
|
66
|
+
unconnected visualizer session (oldest first). Already-connected sessions are
|
|
67
|
+
skipped unless you asked for that color — then attach fails with
|
|
68
|
+
`VISUAL_CODER_COLOR_BUSY`. Window focus does not matter.
|
|
69
|
+
No id is passed in; read `VISUAL_CODER_SESSION` from the output and use that
|
|
70
|
+
`--session` value for every later command. Read `VISUAL_CODER_COLOR` and **reply
|
|
71
|
+
in this chat first** with one short sentence that names that color, for example:
|
|
72
|
+
`Connecting to the Coral session.` Then continue from `wait-for-blueprint` below.
|
|
73
|
+
|
|
74
|
+
If attach fails:
|
|
75
|
+
|
|
76
|
+
- `VISUAL_CODER_NOT_RUNNING`: reply with exactly this line, then **stop**:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Inbase isn't running. Start it with `npx inbase run`, then send this request again.
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- `VISUAL_CODER_CHAT_LIMIT`: reply with exactly this line, then **stop**:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
Only 5 Inbase chats can be connected at once. Finish or stop one in the map, then start a new chat.
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
- `VISUAL_CODER_COLOR_BUSY` or `VISUAL_CODER_COLOR_UNKNOWN`: reply with the rest
|
|
89
|
+
of that line (it names the color), then **stop**.
|
|
90
|
+
|
|
91
|
+
Then continue from `wait-for-blueprint` below. Do **not** run `start-session`.
|
|
92
|
+
Do **not** wait for a blueprint handshake.
|
|
66
93
|
|
|
67
94
|
## Direct response
|
|
68
95
|
|
|
@@ -71,8 +98,9 @@ Visualizer signals arrive as `VISUAL_CODER_ACK` from `attach`,
|
|
|
71
98
|
you cannot chat; that process is the listen loop.
|
|
72
99
|
|
|
73
100
|
The moment a command prints `VISUAL_CODER_ACK`, **reply in this chat first**
|
|
74
|
-
with one short sentence that acknowledges the signal.
|
|
75
|
-
|
|
101
|
+
with one short sentence that acknowledges the signal. After `attach`, name the
|
|
102
|
+
color from `VISUAL_CODER_COLOR`, for example: `Connecting to the Coral session.`
|
|
103
|
+
For later acks, echo the signal, for example: `Got it — running step 2: Show ColorGenerator on Home.` Then continue
|
|
76
104
|
the required tools in the same turn. Do not wait for the user after the ack.
|
|
77
105
|
Do not start with a long analysis. Do not call tools before that sentence.
|
|
78
106
|
|
|
@@ -84,18 +112,22 @@ new plan.
|
|
|
84
112
|
|
|
85
113
|
## Required sequence
|
|
86
114
|
|
|
87
|
-
1. **Read the current layout**.
|
|
115
|
+
1. **Read the current layout**. Attach already started the session. Run
|
|
88
116
|
this once to load the optional blueprint, instruction, and attached files — it returns
|
|
89
|
-
immediately. Do not wait for the user to send a blueprint.
|
|
90
|
-
|
|
117
|
+
immediately. Do not wait for the user to send a blueprint. If that output
|
|
118
|
+
includes `VISUAL_CODER_ACK explain`, follow exit `7` below. If you cannot
|
|
119
|
+
report a plan yet (no instruction and no enabled blueprint work), **do not
|
|
120
|
+
ask in chat**. Immediately run `wait-for-approval` so `?` clicks on the map
|
|
121
|
+
are heard. Then report a plan when you have one.
|
|
91
122
|
|
|
92
123
|
```bash
|
|
93
124
|
npx inbase wait-for-blueprint --session "<session-id>"
|
|
94
125
|
```
|
|
95
126
|
|
|
96
|
-
The user may have placed files
|
|
97
|
-
|
|
98
|
-
|
|
127
|
+
The user may have placed files and islands on the map, or left the
|
|
128
|
+
blueprints empty. The **global** (blue) blueprint is shared across sessions.
|
|
129
|
+
This chat also has a **local** blueprint in this session's color; only this
|
|
130
|
+
chat receives it. They can keep placing at any time.
|
|
99
131
|
If `wait-for-blueprint` prints `VISUAL_CODER_INSTRUCTION_START` /
|
|
100
132
|
`VISUAL_CODER_INSTRUCTION_END`, that text is the user's request for this
|
|
101
133
|
session. If it prints `VISUAL_CODER_CONTEXT_FILES_START` /
|
|
@@ -106,32 +138,26 @@ npx inbase wait-for-blueprint --session "<session-id>"
|
|
|
106
138
|
instruction does not override an enabled blueprint; if they conflict,
|
|
107
139
|
ask the user.
|
|
108
140
|
3. Read the handshake output between `VISUAL_CODER_BLUEPRINT_START` and
|
|
109
|
-
`VISUAL_CODER_BLUEPRINT_END
|
|
110
|
-
|
|
141
|
+
`VISUAL_CODER_BLUEPRINT_END` (global, shared), and between
|
|
142
|
+
`VISUAL_CODER_LOCAL_BLUEPRINT_START` and `VISUAL_CODER_LOCAL_BLUEPRINT_END`
|
|
143
|
+
(this session's color only). You can also read the global
|
|
144
|
+
`.inbase/blueprint.json`.
|
|
145
|
+
If either dump has `enabled` true, **that blueprint is leading**. Treat
|
|
111
146
|
`userCreatedBlocks`, `userCreatedIslands`, `addedFunctions`,
|
|
112
147
|
`addedVariables`, and `addedImports` as the source of truth for this chat.
|
|
113
148
|
Create those paths and add those symbols even if they are not on disk.
|
|
114
|
-
|
|
149
|
+
Honor the global blueprint and this session's local blueprint. Do not use
|
|
150
|
+
another session's local blueprint.
|
|
115
151
|
Do not omit, rename, relocate, or replace a blueprint file, island, symbol,
|
|
116
152
|
or import. Extra edits to existing files are allowed when needed to finish
|
|
117
|
-
the feature. Extra new files that are not in
|
|
118
|
-
If the user request,
|
|
119
|
-
differ from
|
|
153
|
+
the feature. Extra new files that are not in either blueprint are a deviation.
|
|
154
|
+
If the user request, a later instruction, or your own plan would
|
|
155
|
+
differ from an enabled blueprint, **stop and ask the user in chat** before
|
|
120
156
|
reporting the plan. Do not silently deviate.
|
|
121
|
-
4.
|
|
122
|
-
5. Use the user's viewpoint only when `followLook` is true:
|
|
123
|
-
- `island` is where they are standing
|
|
124
|
-
- `lookingAt` / `lookingAtFiles` are the blocks they are looking at
|
|
125
|
-
- `selected` is the block they clicked
|
|
126
|
-
- `filesOnIsland` is the rest of that folder
|
|
127
|
-
Prefer those files while `followLook` is true, unless the request clearly
|
|
128
|
-
needs something else. If `followLook` is false or missing, ignore viewpoint
|
|
129
|
-
and choose files from the request itself. Viewpoint never overrides the
|
|
130
|
-
blueprint: still follow the shared blueprint when `enabled` is true.
|
|
131
|
-
6. List **all** steps needed to finish the feature. Keep steps small enough that
|
|
157
|
+
4. List **all** steps needed to finish the feature. Keep steps small enough that
|
|
132
158
|
one recorded step is one landscape change (usually one new file, or a few
|
|
133
159
|
related edits).
|
|
134
|
-
|
|
160
|
+
5. Report the plan before editing files:
|
|
135
161
|
|
|
136
162
|
```bash
|
|
137
163
|
npx inbase report-plan \
|
|
@@ -141,20 +167,23 @@ npx inbase report-plan \
|
|
|
141
167
|
--steps "Show Clock on Home"
|
|
142
168
|
```
|
|
143
169
|
|
|
144
|
-
|
|
170
|
+
6. **Stop and wait for invocation**:
|
|
145
171
|
|
|
146
172
|
```bash
|
|
147
173
|
npx inbase wait-for-approval --session "<session-id>"
|
|
148
174
|
```
|
|
149
175
|
|
|
150
176
|
Describe this tool call as `inbase wait-for-approval`, not "waiting for the
|
|
151
|
-
user to invoke". The command keeps running until they invoke
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
177
|
+
user to invoke". The command keeps running until they invoke, click
|
|
178
|
+
**Explain proposal**, or click `?` on a file, folder, or symbol; when it
|
|
179
|
+
returns, they already did. Do not edit project
|
|
180
|
+
files until this prints `VISUAL_CODER_ACK execute` / `VISUAL_CODER_EXECUTE`.
|
|
181
|
+
If it prints `VISUAL_CODER_ACK explain`, follow exit `7` below, then wait
|
|
182
|
+
again. If Step by step is off, this returns immediately for each remaining
|
|
183
|
+
step. First reply in chat acknowledging the ack, then re-read the global
|
|
184
|
+
`blueprint.json` and this session's local blueprint; the user can place
|
|
185
|
+
files and islands at any time.
|
|
186
|
+
7. Implement only the invoked step by editing the live project files (Write,
|
|
158
187
|
StrReplace, Delete). Paths are the same ids as `codebase.json`. Then record
|
|
159
188
|
the step — Inbase diffs the working tree against the snapshot taken at
|
|
160
189
|
invoke:
|
|
@@ -166,10 +195,10 @@ npx inbase propose-patch --session "<session-id>"
|
|
|
166
195
|
Do not write a unified diff. Do not pass a `.patch` file. Never write or
|
|
167
196
|
replace a patch already stored in the session folder.
|
|
168
197
|
|
|
169
|
-
|
|
198
|
+
8. **Stop editing** until the next `VISUAL_CODER_EXECUTE`. The stored patch is
|
|
170
199
|
the session record; disk already has your edits. Your next tool call is
|
|
171
200
|
`wait-for-approval` — nothing else.
|
|
172
|
-
|
|
201
|
+
9. Wait until the user clicks **Accept proposal** or **Explain proposal** on the current step (or, when Step by
|
|
173
202
|
step is off, until the next step is auto-invoked), sends an alternative
|
|
174
203
|
instruction, or stops the workflow:
|
|
175
204
|
|
|
@@ -177,7 +206,7 @@ npx inbase propose-patch --session "<session-id>"
|
|
|
177
206
|
npx inbase wait-for-approval --session "<session-id>"
|
|
178
207
|
```
|
|
179
208
|
|
|
180
|
-
|
|
209
|
+
10. Read the wait command output. Reply in chat with the `VISUAL_CODER_ACK`
|
|
181
210
|
line first, then:
|
|
182
211
|
|
|
183
212
|
- Exit `0` (`VISUAL_CODER_ACK execute` / `VISUAL_CODER_EXECUTE`): follow
|
|
@@ -186,17 +215,20 @@ npx inbase wait-for-approval --session "<session-id>"
|
|
|
186
215
|
patch file), then wait again for **Accept proposal**. Do not start the
|
|
187
216
|
next step and do not report a new plan. Otherwise the highlighted step
|
|
188
217
|
was invoked: implement that step now — do not explore, re-plan, or run
|
|
189
|
-
`wait-for-blueprint`. Re-read the
|
|
190
|
-
placed files. Edit live files for
|
|
218
|
+
`wait-for-blueprint`. Re-read the global `blueprint.json` and this
|
|
219
|
+
session's local blueprint if you need placed files. Edit live files for
|
|
220
|
+
that step only, record with
|
|
191
221
|
`inbase propose-patch` (no patch file), then wait again.
|
|
192
|
-
- Exit `6` (`VISUAL_CODER_ACK blueprint` / `VISUAL_CODER_BLUEPRINT`):
|
|
193
|
-
|
|
194
|
-
|
|
222
|
+
- Exit `6` (`VISUAL_CODER_ACK blueprint` / `VISUAL_CODER_BLUEPRINT`): a
|
|
223
|
+
blueprint this chat can see changed (global, this session's color, or
|
|
224
|
+
both). Follow the latest files, islands, functions, variables, and
|
|
225
|
+
imports from those dumps. Do not omit, rename, relocate, or replace them.
|
|
226
|
+
Ignore other sessions' local blueprints.
|
|
195
227
|
If this would differ from the current plan, ask the user before replacing
|
|
196
228
|
the plan. Then run `wait-for-approval` again.
|
|
197
229
|
- Exit `5` (`VISUAL_CODER_ACK finished` / `VISUAL_CODER_FINISHED`): that was
|
|
198
230
|
the last step. The visualizer already applied the final patch and removed
|
|
199
|
-
stored session diffs. The
|
|
231
|
+
stored session diffs. The global blueprint remains. Optionally run
|
|
200
232
|
`--clear` if anything remains, tell the user the feature is done, and
|
|
201
233
|
**stop**. Do not propose another patch.
|
|
202
234
|
- Exit `4` (`VISUAL_CODER_ACK replan` / `VISUAL_CODER_REPLAN`): live files
|
|
@@ -205,11 +237,27 @@ npx inbase wait-for-approval --session "<session-id>"
|
|
|
205
237
|
`VISUAL_CODER_INSTRUCTION_END`, edit those live files, then
|
|
206
238
|
`inbase propose-patch`. Wait for **Accept proposal**. Do not start the
|
|
207
239
|
next step.
|
|
240
|
+
- Exit `7` (`VISUAL_CODER_ACK explain` / `VISUAL_CODER_EXPLAIN`): the user
|
|
241
|
+
wants something explained on the map — either the current proposal or a
|
|
242
|
+
file/folder they clicked **?** next to. Do not edit project files and
|
|
243
|
+
do not invoke the next step. Follow the printed `VISUAL_CODER_EXPLAIN`
|
|
244
|
+
line: `npx inbase explain start --question "..."`, inspect the named
|
|
245
|
+
file or folder (or the live files this proposal changed / this plan step
|
|
246
|
+
will use), then
|
|
247
|
+
`npx inbase explain report` with `--step` /
|
|
248
|
+
`--body` / `--files` / `--folders` / `--select` / `--zoom` / `--info` /
|
|
249
|
+
`--highlight` / `--point`. After
|
|
250
|
+
reporting, run `npx inbase explain wait`. If that returns
|
|
251
|
+
`VISUAL_CODER_EXPLAIN_QUESTION`, report sub-steps with `--parent` and wait
|
|
252
|
+
again. If it returns another `VISUAL_CODER_EXPLAIN` for a file or folder,
|
|
253
|
+
replace the explanation. When explain wait returns stopped or timeout, run
|
|
254
|
+
`wait-for-approval` again. The plan is still waiting for
|
|
255
|
+
**Create proposal** or **Accept proposal**.
|
|
208
256
|
- Exit `2` (`VISUAL_CODER_ACK stopped` / `VISUAL_CODER_STOPPED`) or `3`
|
|
209
257
|
(`VISUAL_CODER_ACK timeout`): make no further project changes.
|
|
210
258
|
|
|
211
|
-
|
|
212
|
-
diffs. The
|
|
259
|
+
11. After a finished handshake, the explorer already removed stored session
|
|
260
|
+
diffs. The global blueprint remains. Optionally run:
|
|
213
261
|
|
|
214
262
|
```bash
|
|
215
263
|
npx inbase propose-patch --session "<session-id>" --clear
|
|
@@ -217,16 +265,16 @@ npx inbase propose-patch --session "<session-id>" --clear
|
|
|
217
265
|
|
|
218
266
|
## Do not
|
|
219
267
|
|
|
220
|
-
- Start a visual session from chat with `start-session`;
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
- Invent a session id for `/inbase`; run `npx inbase attach` with no `--session`
|
|
268
|
+
- Start a visual session from chat with `start-session`; `npx inbase run` already opened 5 empty slots
|
|
269
|
+
- Invent a session id; run `npx inbase attach` with no `--session`, or
|
|
270
|
+
`npx inbase attach --color <name>` when the user invoked a color command
|
|
224
271
|
- Skip `inbase wait-for-blueprint`; it returns immediately and provides the optional blueprint, instruction, and attached files
|
|
225
|
-
- Treat the chat request
|
|
226
|
-
- Skip, rename, relocate, or replace
|
|
227
|
-
- Silently differ from
|
|
228
|
-
- Read global `user-context.json` for placed files; those live on the
|
|
229
|
-
- Follow
|
|
272
|
+
- Treat the chat request or your own plan as overriding an enabled blueprint
|
|
273
|
+
- Skip, rename, relocate, or replace files, islands, functions, variables, or imports from the global blueprint or this session's local blueprint when that dump is `enabled`
|
|
274
|
+
- Silently differ from an enabled blueprint; ask the user first
|
|
275
|
+
- Read global `user-context.json` for placed files; those live on the global or this session's local blueprint
|
|
276
|
+
- Follow another session's local blueprint
|
|
277
|
+
- Use the user's camera viewpoint to choose files
|
|
230
278
|
- Edit project files before `VISUAL_CODER_EXECUTE`
|
|
231
279
|
- Keep editing after `inbase propose-patch` until the next `VISUAL_CODER_EXECUTE`
|
|
232
280
|
- Write a unified diff yourself; `inbase propose-patch` with no file records the git diff
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react'
|
|
2
|
-
import { useThree } from '@react-three/fiber'
|
|
3
|
-
import * as THREE from 'three'
|
|
4
|
-
import { folderAt } from '../layout'
|
|
5
|
-
import { shouldIgnoreShortcut } from '../keyboard'
|
|
6
|
-
import type { WorldLayout } from '../types'
|
|
7
|
-
|
|
8
|
-
type BlockPlacerProps = {
|
|
9
|
-
enabled: boolean
|
|
10
|
-
layout: WorldLayout
|
|
11
|
-
onPlace: (spot: { x: number; z: number; folder: string }) => void
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const ndc = new THREE.Vector2(0, 0)
|
|
15
|
-
const raycaster = new THREE.Raycaster()
|
|
16
|
-
const ground = new THREE.Plane(new THREE.Vector3(0, 1, 0), 0)
|
|
17
|
-
const hit = new THREE.Vector3()
|
|
18
|
-
const forward = new THREE.Vector3()
|
|
19
|
-
|
|
20
|
-
const PLACE_MIN = 3
|
|
21
|
-
const PLACE_MAX = 22
|
|
22
|
-
|
|
23
|
-
function lookPoint(camera: THREE.Camera): { x: number; z: number } {
|
|
24
|
-
raycaster.setFromCamera(ndc, camera)
|
|
25
|
-
const reached = raycaster.ray.intersectPlane(ground, hit)
|
|
26
|
-
camera.getWorldDirection(forward)
|
|
27
|
-
forward.y = 0
|
|
28
|
-
if (forward.lengthSq() === 0) forward.set(0, 0, 1)
|
|
29
|
-
else forward.normalize()
|
|
30
|
-
|
|
31
|
-
let x: number
|
|
32
|
-
let z: number
|
|
33
|
-
if (reached) {
|
|
34
|
-
x = hit.x
|
|
35
|
-
z = hit.z
|
|
36
|
-
} else {
|
|
37
|
-
x = camera.position.x + forward.x * 8
|
|
38
|
-
z = camera.position.z + forward.z * 8
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const dx = x - camera.position.x
|
|
42
|
-
const dz = z - camera.position.z
|
|
43
|
-
const distance = Math.hypot(dx, dz)
|
|
44
|
-
if (distance < 0.001) {
|
|
45
|
-
return {
|
|
46
|
-
x: camera.position.x + forward.x * PLACE_MIN,
|
|
47
|
-
z: camera.position.z + forward.z * PLACE_MIN,
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
const clamped = Math.min(PLACE_MAX, Math.max(PLACE_MIN, distance))
|
|
51
|
-
const scale = clamped / distance
|
|
52
|
-
return {
|
|
53
|
-
x: camera.position.x + dx * scale,
|
|
54
|
-
z: camera.position.z + dz * scale,
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function BlockPlacer({ enabled, layout, onPlace }: BlockPlacerProps) {
|
|
59
|
-
const { camera } = useThree()
|
|
60
|
-
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
const onKey = (event: KeyboardEvent) => {
|
|
63
|
-
if (!enabled || event.repeat || event.code !== 'Space') return
|
|
64
|
-
if (shouldIgnoreShortcut(event)) return
|
|
65
|
-
event.preventDefault()
|
|
66
|
-
const { x, z } = lookPoint(camera)
|
|
67
|
-
const island =
|
|
68
|
-
folderAt(x, z, layout) ??
|
|
69
|
-
folderAt(camera.position.x, camera.position.z, layout)
|
|
70
|
-
onPlace({ x, z, folder: island?.path ?? '.' })
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
window.addEventListener('keydown', onKey)
|
|
74
|
-
return () => window.removeEventListener('keydown', onKey)
|
|
75
|
-
}, [camera, enabled, layout, onPlace])
|
|
76
|
-
|
|
77
|
-
return null
|
|
78
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react'
|
|
2
|
-
import { useThree } from '@react-three/fiber'
|
|
3
|
-
import { folderAt } from '../layout'
|
|
4
|
-
import { shouldIgnoreShortcut } from '../keyboard'
|
|
5
|
-
import type { WorldLayout } from '../types'
|
|
6
|
-
|
|
7
|
-
type IslandPlacerProps = {
|
|
8
|
-
enabled: boolean
|
|
9
|
-
layout: WorldLayout
|
|
10
|
-
onPlace: (parent: string) => void
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function IslandPlacer({ enabled, layout, onPlace }: IslandPlacerProps) {
|
|
14
|
-
const { camera } = useThree()
|
|
15
|
-
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
const onKey = (event: KeyboardEvent) => {
|
|
18
|
-
if (!enabled || event.repeat || event.code !== 'KeyB') return
|
|
19
|
-
if (shouldIgnoreShortcut(event)) return
|
|
20
|
-
const island = folderAt(camera.position.x, camera.position.z, layout)
|
|
21
|
-
if (!island) return
|
|
22
|
-
event.preventDefault()
|
|
23
|
-
onPlace(island.path)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
window.addEventListener('keydown', onKey)
|
|
27
|
-
return () => window.removeEventListener('keydown', onKey)
|
|
28
|
-
}, [camera, enabled, layout, onPlace])
|
|
29
|
-
|
|
30
|
-
return null
|
|
31
|
-
}
|