@jxsuite/protocol 3.0.0 → 5.0.0

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 CHANGED
@@ -7,11 +7,11 @@ The **Studio Backend Protocol**: the wire types and canonical route table that e
7
7
 
8
8
  ## Who implements this
9
9
 
10
- | Backend | Transport |
11
- | ------------------------------- | --------------------------------------------------------------------------------------------------------- |
12
- | `@jxsuite/server` (dev server) | The literal `/__studio/*` HTTP routes (the reference implementation) |
13
- | Desktop (Electrobun / Chromium) | Typed RPC / WebSocket JSON-RPC dispatching into the same handlers |
14
- | Cloud platforms | HTTP behind a session gateway (e.g. `/api/v1/p/:owner/:repo/:branch/studio/*`), same sub-paths and shapes |
10
+ | Backend | Transport |
11
+ | ------------------------------ | --------------------------------------------------------------------------------------------------------- |
12
+ | `@jxsuite/server` (dev server) | The literal `/__studio/*` HTTP routes (the reference implementation) |
13
+ | Desktop (Electron / Chromium) | Typed RPC / WebSocket JSON-RPC dispatching into the same handlers |
14
+ | Cloud platforms | HTTP behind a session gateway (e.g. `/api/v1/p/:owner/:repo/:branch/studio/*`), same sub-paths and shapes |
15
15
 
16
16
  A backend is free to change the transport and path prefix; the **sub-path, method, and body shapes are the contract**. `STUDIO_PROTOCOL_VERSION` bumps when any shape changes incompatibly.
17
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxsuite/protocol",
3
- "version": "3.0.0",
3
+ "version": "5.0.0",
4
4
  "description": "The Studio Backend Protocol — wire types and the canonical route table every Jx Studio backend implements",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -27,6 +27,6 @@
27
27
  "test:coverage": "bun test --isolate --coverage"
28
28
  },
29
29
  "dependencies": {
30
- "@jxsuite/schema": "^4.0.0"
30
+ "@jxsuite/schema": "^4.1.0"
31
31
  }
32
32
  }
package/src/routes.ts CHANGED
@@ -12,17 +12,6 @@
12
12
  /** Bumped when a route's request/response shape changes incompatibly. */
13
13
  export const STUDIO_PROTOCOL_VERSION = 1;
14
14
 
15
- /**
16
- * Hidden file a browser-hosted Studio drops into a folder chosen with `showDirectoryPicker()` so
17
- * the backend can find it (specs/desktop.md §8.2.1). Its contents are a one-shot random id; the
18
- * backend matches on those contents, not on the filename, and deletes the file once it matches.
19
- *
20
- * Lives here because the writer (`@jxsuite/studio/directory-picker`) and the reader (the backend
21
- * serving `locateDirectory`) must agree on it, and this package is the contract both already
22
- * share.
23
- */
24
- export const LOCATION_ID_FILE = ".jx-loc-id";
25
-
26
15
  export type StudioRouteMethod = "GET" | "POST" | "PUT" | "DELETE";
27
16
 
28
17
  export interface StudioRoute {
@@ -81,18 +70,6 @@ export const STUDIO_ROUTES = {
81
70
  "Enumerate site projects [{config, path}] (backs listProjects)",
82
71
  "The welcome screen's Projects catalogue stays hidden.",
83
72
  ),
84
- findProject: route(
85
- "GET",
86
- "/__studio/find-project",
87
- "Locate a project directory by name outside the root",
88
- "openProject falls back to config-matching only.",
89
- ),
90
- locateDirectory: route(
91
- "GET",
92
- "/__studio/locate-directory",
93
- `Resolve the absolute path of a showDirectoryPicker() folder by the id in its ${LOCATION_ID_FILE}`,
94
- "Browse… reports that the folder could not be placed; the Location is typed by hand.",
95
- ),
96
73
  createProject: route(
97
74
  "POST",
98
75
  "/__studio/create-project",
package/src/types.ts CHANGED
@@ -223,6 +223,12 @@ export interface GitStatusResult {
223
223
  export interface GitBranchesResult {
224
224
  current: string;
225
225
  branches: string[];
226
+ /**
227
+ * The repository's default branch (the one a pull request merges into), when the host knows it. A
228
+ * host whose branches are sessions reports it so a review is never committed to the live branch;
229
+ * a local repository may omit it.
230
+ */
231
+ defaultBranch?: string;
226
232
  }
227
233
 
228
234
  export interface GitLogEntry {