@gapi/gcli 1.8.267 → 1.8.269

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.
@@ -0,0 +1,23 @@
1
+ ## 2026-11-18 - local-workspaces: Terminal watch and listings honour .gitignore, with or without git
2
+
3
+ **Feature:** local-workspaces · **Type:** fix
4
+
5
+ - Found live by the owner: with the browser terminal open, a running build
6
+ (dist/, .parcel-cache/) sent every written file to the editor, which read
7
+ each one back through the tunnel.
8
+ - `TerminalManager`: changed paths batched (150 ms), de-duplicated and
9
+ filtered by `WorkspaceFiles.notIgnored` before they are pushed.
10
+ - `notIgnored`: git's `check-ignore --stdin` inside a repo with git
11
+ installed; otherwise `gitignore.ts` (`GitignoreMatcher`, our own - no
12
+ package: nested `.gitignore` files, `!`, `dir/`, `/` anchors, `*`, `**`,
13
+ `?`, `[...]`, nothing back from inside an ignored folder). A changed
14
+ `.gitignore` re-reads the rules.
15
+ - The listing of a folder WITHOUT git now skips ignored files and folders
16
+ too (with git it already used `git ls-files --exclude-standard`).
17
+ - **Test:** `npx jest test/workspace-gitignore.spec.ts test/workspace-terminals.spec.ts --coverage=false`.
18
+ - **Debug:** a build still floods the editor -> its output is not in a
19
+ `.gitignore`; check with `git check-ignore -v <path>` (git) or the matcher
20
+ spec's table (no git).
21
+ - **Verification:** tsc clean, eslint, jest 24 suites / 208 tests (pattern
22
+ table 13, nested + negation, no-git folder watch filter + listing, rule
23
+ reload; a real git repo dropping dist/).
@@ -0,0 +1,20 @@
1
+ ## 2026-11-18 - local-workspaces: workspace:start --allow-terminal: browser terminals (script PTY) and file watch pushed to Lambforge
2
+
3
+ **Feature:** local-workspaces · **Type:** feat
4
+
5
+ - Plan 36 phase 2 (gcli). `--allow-terminal` lets the owner open a shell in
6
+ the workspace root from the Lambforge editor; without it every
7
+ `terminal/*` op answers 403 with the hint.
8
+ - `terminals.ts` (`TerminalManager`): `$SHELL -i` in a PTY through the
9
+ system's `script` (no native dependency; pipes where it is missing), a
10
+ recursive `fs.watch` of the root (`node_modules`/`.git` ignored), events
11
+ on an rxjs Subject; the connection batches them (40 ms) into
12
+ `pushLocalWorkspaceTerminalEvents`. Max 4 terminals; close kills the
13
+ process group; stop closes all.
14
+ - Ops `terminal/open`, `terminal/input`, `terminal/close` added to
15
+ `WORKSPACE_OPS`.
16
+ - **Test:** `npx jest test/workspace-terminals.spec.ts --coverage=false`
17
+ (output, changed file, close, cap, flag required).
18
+ - **Debug:** no PTY (no echo/line editing) -> `script` missing on the
19
+ machine; no changed-file events -> recursive `fs.watch` unsupported there.
20
+ - **Verification:** tsc clean, eslint, jest workspace + terminals 30/30.
@@ -19,6 +19,24 @@ the outbound WebSocket tunnel local AI runners use.
19
19
  | `src/commands/workspace/processes.ts` | `runCommand` (timeout, process-group kill, output tails), `ProcessManager` (background processes, ring buffer, waitFor), `buildEnv` |
20
20
  | `src/commands/workspace/{start,list,delete,config,index}.ts` | the commands; `~/.graphql-server/workspaces.json` (0600, keyed by directory) |
21
21
 
22
+ ## Browser terminal (`--allow-terminal`, plan 36)
23
+
24
+ `src/commands/workspace/terminals.ts` (`TerminalManager`): `terminal/open`
25
+ spawns `$SHELL -i` in the root - in a PTY through `script` (Linux
26
+ `script -qfec`, macOS `script -q /dev/null`), plain pipes without it - plus
27
+ a recursive `fs.watch`. Output, exits and changed paths go out on
28
+ `events$`; `WorkspaceConnection` batches them (40 ms) into
29
+ `pushLocalWorkspaceTerminalEvents`. `terminal/input` writes stdin,
30
+ `terminal/close` kills the process group. Changed paths are batched
31
+ (150 ms) and `.gitignore`d ones dropped before they reach the browser
32
+ (`WorkspaceFiles.notIgnored`): git's `check-ignore` inside a repo with git
33
+ installed, otherwise our own matcher (`gitignore.ts`: nested files,
34
+ negation, `dir/`, anchors, `*`/`**`/`?`/`[...]`) - which also filters the
35
+ listing of a folder without git. No package for it (gcli's only dependency
36
+ is esbuild). Without `--allow-terminal` every
37
+ `terminal/*` op answers 403. Canonical: graphql-server
38
+ `docs/features/local-workspaces.md` "Browser terminal".
39
+
22
40
  ## Protocol (what the backend sends)
23
41
 
24
42
  `POST /workspace/<op>` with a JSON body, answered `head(status) + chunks + end`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gapi/gcli",
3
- "version": "1.8.267",
3
+ "version": "1.8.269",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/Stradivario/gapi.git"