Skip to content

Commit a5f77e4

Browse files
committed
chore(cli): docs of plan
1 parent 192eeeb commit a5f77e4

8 files changed

Lines changed: 244 additions & 33 deletions

File tree

AGENTS.md

Lines changed: 57 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ The current milestone is limited to:
1313
4. add desktop Godot CEF compatibility, starting with macOS
1414
5. stabilize the Kirie plugin shape before adding larger tooling layers
1515

16-
Do not introduce extra packages, adapters, or CLI workflows unless they are
17-
required to make the current IPC milestone work. The existing `@gd-kirie/ipc`
18-
package is a thin browser-side transport wrapper; do not expand it into an
19-
application event or invocation layer unless the user explicitly asks for that
20-
higher-level work.
16+
Do not introduce extra packages, adapters, or broad CLI workflows unless they
17+
are required to make the current IPC milestone work. The existing
18+
`@gd-kirie/ipc` package is a thin browser-side transport wrapper; do not expand
19+
it into an application event or invocation layer unless the user explicitly asks
20+
for that higher-level work. The planned Kirie CLI v1 exception is limited to
21+
`kirie dev` for desktop development through Vite and Godot.
2122

2223
The mobile IPC v1 experiment keeps Kirie core byte-oriented and CBOR-based with
2324
text, binary, and data lanes. JSON belongs to callers or adapters, not to Kirie
@@ -43,9 +44,9 @@ reason to expose the full Godot CEF browser API through Kirie.
4344
- `packages/GdKirie.EventaAdapter`
4445
.NET 10 Eventa adapter over Kirie text IPC
4546
- `examples/basic-ipc`
46-
the first runnable manual integration target
47+
beginner-friendly demo project for the raw IPC flow
4748
- `examples/eventa-csharp`
48-
manual Godot C# Eventa adapter smoke example
49+
beginner-friendly demo project for Godot C# Eventa adapter usage
4950
- `tests/integration`
5051
exported-app platform bridge regression target
5152
- `scripts/build.ts`
@@ -111,18 +112,54 @@ label them as anecdotal when they influence a decision.
111112
scene, under a Godot `Window`, or in another scene structure.
112113
- Keep window organization, named routing, cross-view forwarding, and prefab
113114
window helpers above Kirie core until the user explicitly asks for that
114-
higher-level work.
115+
higher-level work. BrowserWindow remains a dream-level API and should not be
116+
implemented in GDScript; future high-level window APIs should target C# and
117+
TypeScript packages.
115118
- Keep the Godot-facing wrapper thin; prefer forwarding to the platform
116119
singleton over reimplementing platform lifecycle logic in GDScript.
117120
- Keep `KirieClient` as a thin C# wrapper over the same platform singleton.
118121
Expose Kirie signals as C# events, and keep internal Godot `Callable` usage as
119122
bridge plumbing rather than public API.
120-
- Kirie supports packaged web content sourced from project resources through
121-
`res://web` loading on the current native paths. Runtime-mounted Godot packs
122-
remain out of scope for that loading path.
123+
- Kirie supports packaged web content sourced from project resources. The
124+
planned Kirie app layout standardizes production web content at
125+
`res://src-web/dist/index.html`. When that migration is implemented, drop the
126+
previous `res://web` behavior instead of preserving a compatibility layer.
127+
Runtime-mounted Godot packs remain out of scope for that loading path.
123128
- If an API is needed by both GDScript and C#, keep the behavior aligned and
124129
keep C# as a thin wrapper.
125130

131+
## Planned Kirie CLI Direction
132+
133+
The planned Kirie app layout is:
134+
135+
- `kirie.config.ts`
136+
- `package.json`
137+
- `project.godot`
138+
- `src-godot/`
139+
- `src-web/`
140+
- `addons/kirie/`
141+
- optional `addons/godot_cef/`
142+
143+
Kirie CLI v1 should only implement `kirie dev` for desktop Godot development.
144+
It should be installed through npm, call Vite's JavaScript API directly, let
145+
Vite resolve port conflicts, launch Godot as a child process, and inject
146+
`KIRIE_DEV=1` and `KIRIE_WEB_URL=<resolved Vite URL>`.
147+
148+
Keep `kirie create`, `kirie build`, `kirie export`, addon installation, Godot
149+
CEF installation, export preset management, and mobile dev targets outside the
150+
CLI v1 scope. These may be implemented later when explicitly planned. Future
151+
mobile dev targets should use a unified platform and device selector such as
152+
`kirie dev ios --device <selector>` or
153+
`kirie dev android --device <selector>`; do not expose simulator and real device
154+
as separate user-facing target names.
155+
156+
Kirie enforces Vite for user web source. Advanced Vite options belong in
157+
`kirie.config.ts` under `web.vite`, but Kirie owns `root`, `base`,
158+
`server.host`, `server.port`, `server.open`, and `build.outDir`.
159+
160+
Kirie user projects should not contain Capacitor-style `ios/` or `android/`
161+
native project directories. Native features belong in Godot plugins.
162+
126163
## Android Packaging Direction
127164

128165
The repository is allowed to evolve internally, but the intended external shape
@@ -291,7 +328,7 @@ configured yet.
291328

292329
### Validation
293330

294-
- Use `examples/basic-ipc` for manual smoke validation and `tests/integration`
331+
- Use `examples/basic-ipc` for manual demo validation and `tests/integration`
295332
for exported-app platform bridge regressions.
296333
- Run the relevant lint target through mise after changing a covered language:
297334
- GDScript: `mise run lint:gdscript`
@@ -314,7 +351,7 @@ configured yet.
314351
- After changing iOS native code under `packages/kirie/native/ios`, always run
315352
`mise run build:ios-xcframework` before device testing.
316353
- When changing the IPC shape, make sure at least one real request/response
317-
exchange remains manually smoke-tested through `examples/basic-ipc` or covered
354+
exchange remains manually exercised through `examples/basic-ipc` or covered
318355
by integration tests once those tests are migrated to the lane API.
319356
- When changing `KirieClient`, compile it against the Godot .NET SDK. A platform
320357
integration smoke test for its C# event API is still pending.
@@ -360,20 +397,21 @@ configured yet.
360397
- Be explicit about readiness and lifecycle transitions before sending bridge
361398
messages.
362399

363-
## Planned But Not Yet Configured
400+
## Configured And Pending Coverage
364401

365-
The following directions are intentional, but they are not fully set up in the
366-
repository yet. Agents should treat them as targets, not as already-enforced
367-
infrastructure.
402+
The following directions are intentional, but some are only partially covered.
403+
Agents should distinguish already-enforced infrastructure from remaining
404+
coverage gaps.
368405

369406
- GitHub Actions are configured for lint, Android platform integration, iOS
370407
platform integration, npm package publishing, and addon release packaging.
371408
Broader release matrix coverage beyond the current addon zip is still not
372409
configured.
373410
- Automated platform integration coverage for the C# `KirieClient` wrapper does
374411
not exist yet.
375-
- Desktop Godot CEF integration coverage runs through `tests/integration`.
376-
Desktop CI and macOS export coverage are not configured yet.
412+
- Desktop Godot CEF integration coverage runs through `tests/integration`, with
413+
desktop CI configured for macOS, Windows, and Linux. macOS export coverage is
414+
still not configured yet.
377415
- Browser-side Eventa adapter support exists in `@gd-kirie/ipc-eventa`.
378416
- `GdKirie.EventaAdapter` is a .NET 10-only package. It supports Eventa events
379417
and unary RPC over Kirie text IPC, keeps Eventa source out of `addons/kirie`,

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ example, and regression-test areas:
5555
- `packages/ipc`: a thin browser-side transport wrapper for Kirie WebView pages
5656
- `packages/ipc-eventa`: browser-side Eventa adapter over Kirie text IPC
5757
- `packages/GdKirie.EventaAdapter`: .NET 10 Eventa adapter over Kirie text IPC
58-
- `examples/basic-ipc`: the first runnable manual integration example
59-
- `examples/eventa-csharp`: manual Godot C# Eventa adapter smoke example
58+
- `examples/basic-ipc`: beginner-friendly demo project for the raw IPC flow
59+
- `examples/eventa-csharp`: beginner-friendly demo project for Godot C# Eventa adapter usage
6060
- `tests/integration`: exported-app platform integration tests
6161
- `scripts/build.ts`: mise task entrypoint re-exports
6262
- `scripts/build-kirie.ts`: Kirie addon artifact and packaging tasks

docs/architecture.md

Lines changed: 111 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ We are standardizing only the minimum plugin shape needed to support:
1212
- packaged `res://` web resource loading for exported apps
1313
- a repo-level platform integration test project
1414

15-
Anything beyond that, such as CLI tooling or broad application frameworks, is
16-
deferred until the IPC model is proven. The current `@gd-kirie/ipc` package is
17-
intentionally only a browser-side transport wrapper on top of the raw native
18-
bridge. Eventa adapters live above Kirie and use that low-level text transport.
15+
Anything beyond that, such as broad application frameworks, is deferred until
16+
the IPC model is proven. The current `@gd-kirie/ipc` package is intentionally
17+
only a browser-side transport wrapper on top of the raw native bridge. Eventa
18+
adapters live above Kirie and use that low-level text transport.
1919

2020
The mobile IPC experiment keeps Kirie core byte-oriented and CBOR-based while
2121
preserving separate text, binary, and data lanes. Higher-level protocols,
@@ -76,6 +76,9 @@ scene structure that fits their project.
7676
Kirie core should not own window organization. Optional higher-level helpers may
7777
later provide prefab window, panel, workspace, cross-view forwarding, or routing
7878
APIs, but those helpers must live above the low-level WebView and IPC surface.
79+
Do not add Electron-like BrowserWindow APIs to GDScript; future high-level
80+
window APIs should live in C# and TypeScript packages, with GDScript remaining
81+
the low-level plugin substrate.
7982

8083
The public Godot API should primarily let users address WebViews through node
8184
references:
@@ -88,8 +91,10 @@ references:
8891
Native implementations may keep internal handles or IDs to manage platform instances.
8992
Android and iOS use private view IDs only to route callbacks back to the owning `KirieNode`; public routing names, browser-driven cross-view forwarding, and window helper APIs are deferred higher-level concerns.
9093

91-
Kirie supports loading packaged offline web content from Godot project resources
92-
through the `res://web` path described below.
94+
Kirie supports loading packaged offline web content from Godot project
95+
resources. The current native resolvers can serve packaged `res://` paths. The
96+
planned Kirie CLI app layout standardizes production web content at
97+
`res://src-web/dist/index.html`, as described below.
9398

9499
## Runtime debug configuration
95100

@@ -112,6 +117,99 @@ Exports use `Kirie-release.aar` by default. Repository-local Android native
112117
debugging can opt into `Kirie-debug.aar` for a single export by passing
113118
`-- --kirie-android-aar=debug` to the Godot export command.
114119

120+
## Kirie app layout and CLI direction
121+
122+
The planned Kirie application shape is a Godot project with a Vite web frontend
123+
beside the Godot source:
124+
125+
```text
126+
kirie.config.ts
127+
package.json
128+
pnpm-lock.yaml / bun.lock / package-lock.json
129+
project.godot
130+
src-godot/
131+
main.tscn
132+
main.gd or main.cs
133+
src-web/
134+
index.html
135+
src/
136+
assets/
137+
dist/
138+
addons/
139+
kirie/
140+
godot_cef/
141+
others/
142+
```
143+
144+
Directory responsibilities are:
145+
146+
- `src-godot`: Godot host application source.
147+
- `src-web`: Vite web UI source and production build output.
148+
- `addons`: Godot plugins. Kirie remains installed as `addons/kirie`, and Godot
149+
CEF remains installed as `addons/godot_cef`.
150+
- `kirie.config.ts`: Kirie CLI development-time configuration.
151+
152+
Kirie does not own native platform project directories. Do not introduce
153+
Capacitor-style `ios/` or `android/` project trees into Kirie user projects.
154+
Native capabilities should be provided by Godot plugins.
155+
156+
Kirie CLI v1 is scoped to one command:
157+
158+
```sh
159+
kirie dev
160+
```
161+
162+
`kirie dev` targets desktop Godot only in v1. It starts a Vite development
163+
server through Vite's JavaScript API, reads the actual resolved URL after Vite
164+
listens, launches Godot as a child process, and injects:
165+
166+
```text
167+
KIRIE_DEV=1
168+
KIRIE_WEB_URL=http://127.0.0.1:<actual-port>/
169+
```
170+
171+
The CLI does not support Finder, Dock, or other non-CLI launched macOS app
172+
processes. It only supports development sessions that the CLI starts and owns.
173+
174+
Kirie CLI v1 does not implement:
175+
176+
- `kirie create`
177+
- `kirie build`
178+
- `kirie export`
179+
- addon installation
180+
- Godot CEF installation
181+
- export preset management
182+
- BrowserWindow APIs
183+
184+
Kirie enforces Vite as the web toolchain. Users should not hand-write a fixed
185+
development URL. The CLI should let Vite handle port conflicts, then pass the
186+
resolved URL to Godot. Advanced Vite configuration belongs under
187+
`web.vite` in `kirie.config.ts`; Kirie owns the base Vite invariants:
188+
189+
```text
190+
root = web.root
191+
base = "./"
192+
server.host = "127.0.0.1"
193+
server.port = 5173
194+
server.strictPort = false
195+
server.open = false
196+
build.outDir = "dist"
197+
```
198+
199+
User-supplied `web.vite` may extend Vite for plugins, aliases, defines, CSS,
200+
JSON, extra assets, proxying, headers, HMR details, Rollup options, and
201+
dependency optimization. It must not override Kirie-owned invariants such as
202+
`root`, `base`, `server.host`, `server.port`, `server.open`, or
203+
`build.outDir`.
204+
205+
Future mobile development targets should use one platform command with unified
206+
device selection, for example `kirie dev ios --device <selector>` and
207+
`kirie dev android --device <selector>`. The user-facing API should not split
208+
iOS simulator and iOS device into separate target names. Kirie may still use
209+
different launch backends internally for simulators, real devices, Android
210+
emulators, and Android devices. Mobile development targets are explicitly out
211+
of scope for CLI v1.
212+
115213
## Packaged web resource loading
116214

117215
`res://` web loading is scoped to resources that are exported with the
@@ -126,9 +224,13 @@ When loading `http://`, `https://`, or `file://` URLs, Kirie should keep using
126224
the platform WebView's default loading behavior instead of intercepting or
127225
rewriting those URLs.
128226

129-
The addon export plugin currently includes `res://web` in the iOS app bundle.
130-
Android example exports still rely on the project export preset include filters
131-
for packaged web files.
227+
The planned Kirie CLI app layout uses `res://src-web/dist/index.html` as the
228+
default production entry. When that migration is implemented, the addon export
229+
plugin should package `res://src-web/dist` for Android and iOS exports, fail
230+
export when `res://src-web/dist/index.html` is missing, and drop the previous
231+
`res://web` behavior instead of preserving a compatibility layer. Users should
232+
continue to use Godot's official export preset flow; Kirie should not create or
233+
manage export presets.
132234

133235
## Desktop Godot CEF direction
134236

docs/dreams/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ and `AGENTS.md`.
1010

1111
Current dream notes:
1212

13+
- [Kirie BrowserWindow](./browser-window.md)
1314
- [Kirie IPC Interaction TestKit](./kirie-testkit.md)
1415
- [Kirie Remote Debugging](./remote-debugging.md)

docs/dreams/browser-window.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Kirie BrowserWindow
2+
3+
BrowserWindow is a future high-level application API idea. It is not part of
4+
the current Kirie CLI or plugin milestone.
5+
6+
## Direction
7+
8+
Kirie's low-level primitive remains `KirieNode`: a scene-friendly owner for a
9+
platform WebView and IPC lanes.
10+
11+
A future BrowserWindow layer would sit above that primitive:
12+
13+
```text
14+
BrowserWindow = Godot Window + KirieNode + web entry resolver
15+
```
16+
17+
The intended mental model is close to Electron's host-side window API, but the
18+
implementation should stay native to Godot's scene and window model. Godot's
19+
`Window` node owns window behavior, while `KirieNode` owns WebView creation and
20+
IPC.
21+
22+
## API boundary
23+
24+
Do not add BrowserWindow as a GDScript API. GDScript remains the low-level
25+
plugin substrate with `GdKirie` and `KirieNode`.
26+
27+
Future high-level window APIs should target:
28+
29+
- C# host-side APIs for creating and controlling windows.
30+
- TypeScript web-side APIs for renderer/window cooperation.
31+
32+
This keeps the framework API in languages with package and module boundaries
33+
instead of expanding the addon GDScript surface.
34+
35+
## Dependencies
36+
37+
BrowserWindow should wait until the Kirie app layout and web entry resolver are
38+
stable. The planned CLI/app layout gives future window APIs a single way to
39+
resolve development and production entries:
40+
41+
```text
42+
development: KIRIE_WEB_URL from `kirie dev`
43+
production: res://src-web/dist/index.html and sibling route entries
44+
```
45+
46+
Until that resolver exists, users can manually compose Godot `Window` nodes and
47+
`KirieNode` instances in their own projects.
48+
49+
## Out of scope
50+
51+
Keep BrowserWindow separate from the current CLI v1 work. Do not combine it
52+
with:
53+
54+
- `kirie dev`
55+
- the `src-godot` / `src-web` example migration
56+
- export plugin web-root migration
57+
- platform integration tests
58+
59+
It is also not a reason to expose the full Godot CEF browser-control API through
60+
Kirie core.

docs/references.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ packaging, or platform WebView bridge details.
157157
- [Vite build guide](https://vite.dev/guide/build)
158158
Reference for production HTML builds used by the platform integration web
159159
fixture.
160+
- [Vite JavaScript API](https://vite.dev/guide/api-javascript.html)
161+
Reference for `createServer()`, `build()`, `mergeConfig()`, and dev server
162+
`resolvedUrls`, which underpin the planned `kirie dev` implementation.
163+
- [Vite server options](https://vite.dev/config/server-options.html)
164+
Reference for development server host, port, strict port behavior, and related
165+
options owned by Kirie CLI defaults.
166+
- [Electron BrowserWindow](https://www.electronjs.org/docs/latest/api/browser-window)
167+
Comparison point for future high-level host-side browser window APIs.
160168
- [Electron preload scripts](https://www.electronjs.org/docs/latest/tutorial/tutorial-preload)
161169
Comparison point for renderer-side runtime injection before a page is loaded.
162170
- [Tauri WebviewWindowBuilder initialization scripts](https://docs.rs/tauri/latest/src/tauri/webview/webview_window.rs.html)
@@ -205,3 +213,5 @@ packaging, or platform WebView bridge details.
205213
support, mise task configuration, and Execa.
206214
- When changing the platform integration web fixture, start with the Vite build
207215
guide and `@gd-kirie/ipc`.
216+
- When changing planned Kirie CLI development-server behavior, start with the
217+
Vite JavaScript API and Vite server options.

examples/basic-ipc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ mise run run:example -- ios basic-ipc
9898

9999
This iOS example runner is currently simulator-only because it reuses the same
100100
local Godot iOS export path used by integration testing. That is a tooling
101-
shortcut, not a design requirement for examples. Example smoke runs should
101+
shortcut, not a design requirement for examples. Manual example runs should
102102
eventually allow the most useful local target, such as an iOS Simulator, a real
103103
iOS device, or an iOS app running directly on an Apple Silicon Mac.

0 commit comments

Comments
 (0)