@gjsify/devtools-protocol 0.36.0 → 0.38.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/lib/types/methods.d.ts +9 -13
- package/lib/types/routing.d.ts +22 -29
- package/package.json +3 -3
package/lib/types/methods.d.ts
CHANGED
|
@@ -6,20 +6,16 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export type MethodKind = 'read-only' | 'presence' | 'mutating';
|
|
8
8
|
/**
|
|
9
|
-
* The generic, toolkit-neutral devtools methods and their kinds. Adapters
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* method name, so a new method cannot bypass the pause policy unnoticed.
|
|
9
|
+
* The generic, toolkit-neutral devtools methods and their kinds. Adapters implement the
|
|
10
|
+
* subset they support and the bridge advertises only those; app-specific methods arrive
|
|
11
|
+
* through extensions with their own kinds, and the registry rejects an unclassified name
|
|
12
|
+
* so nothing can bypass the pause policy unnoticed.
|
|
14
13
|
*
|
|
15
|
-
* A NAME HERE IS A PROMISE, so nothing may be listed ahead of an adapter.
|
|
16
|
-
*
|
|
17
|
-
* no
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* made a method look supported and the pause policy look complete. Both were
|
|
21
|
-
* removed rather than stubbed; add each back in the change that lands its
|
|
22
|
-
* adapter, which is the only change that can prove the kind is right.
|
|
14
|
+
* A NAME HERE IS A PROMISE, so nothing may be listed ahead of an adapter. `SetProperty`
|
|
15
|
+
* and `EmitSignal` were once classified `mutating` here while existing on no wire at all
|
|
16
|
+
* — no XML fragment, no handler, no MCP tool — so a caller read the contract, called
|
|
17
|
+
* them and got `UnknownMethod`, while the pause policy looked complete. Add a method back
|
|
18
|
+
* in the change that lands its adapter, which is the only change that can prove the kind.
|
|
23
19
|
*/
|
|
24
20
|
export declare const GENERIC_METHODS: {
|
|
25
21
|
readonly GetStatus: "read-only";
|
package/lib/types/routing.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Coerce a free-form instance label into a valid app-id segment
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* the byte-identical hand-maintained duplication the map-editor needed when
|
|
6
|
-
* its bridge was dependency-free.
|
|
2
|
+
* Coerce a free-form instance label into a valid app-id segment (letter-led, lowercase
|
|
3
|
+
* alphanumeric). Shared by the in-app adapter and the MCP bridge, so both derive the
|
|
4
|
+
* SAME per-instance bus name.
|
|
7
5
|
*/
|
|
8
6
|
export declare function sanitizeInstanceId(label: string): string;
|
|
9
7
|
export interface BusAddress {
|
|
@@ -12,16 +10,14 @@ export interface BusAddress {
|
|
|
12
10
|
instance: string;
|
|
13
11
|
}
|
|
14
12
|
/**
|
|
15
|
-
* Resolve an instance label to its DBus bus name + devtools object path,
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* when several run side by side.
|
|
13
|
+
* Resolve an instance label to its DBus bus name + devtools object path, given the app's
|
|
14
|
+
* base id. The default instance keeps the bare base; a named instance gets a
|
|
15
|
+
* `.<segment>` bus-name suffix and a `/<segment>` path segment, so the bridge dials the
|
|
16
|
+
* right process when several run side by side.
|
|
20
17
|
*
|
|
21
|
-
* Mirrors `Gio.Application`'s own
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* helper lets the bridge predict the same address for the dotted-id case.
|
|
18
|
+
* Mirrors `Gio.Application`'s own path derivation (id dots → slashes, leading slash) plus
|
|
19
|
+
* a `/devtools` leaf. The in-app adapter should prefer the authoritative
|
|
20
|
+
* `app.get_dbus_object_path() + '/devtools'`; this only lets the bridge PREDICT it.
|
|
25
21
|
*
|
|
26
22
|
* - `("org.example.App")` → `org.example.App` @ `/org/example/App/devtools`
|
|
27
23
|
* - `("org.example.App", "host")` → `org.example.App.host` @ `/org/example/App/host/devtools`
|
|
@@ -32,10 +28,9 @@ export declare const DEVTOOLS_ENABLE_ENV = "GJSIFY_DEVTOOLS";
|
|
|
32
28
|
/** Env var carrying the per-instance label for side-by-side apps. */
|
|
33
29
|
export declare const DEVTOOLS_INSTANCE_ENV = "GJSIFY_DEVTOOLS_INSTANCE";
|
|
34
30
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* `
|
|
38
|
-
* address to DIAL. It exists because macOS and Windows have no session bus.
|
|
31
|
+
* D-Bus address for the BUS-LESS peer transport, which exists because macOS and Windows
|
|
32
|
+
* have no session bus. The app LISTENS on it (`unix:tmpdir=/tmp`, `unix:path=…`,
|
|
33
|
+
* `nonce-tcp:host=127.0.0.1`), the bridge DIALS it.
|
|
39
34
|
*/
|
|
40
35
|
export declare const DEVTOOLS_ADDRESS_ENV = "GJSIFY_DEVTOOLS_ADDRESS";
|
|
41
36
|
/** Whether a value read from {@link DEVTOOLS_ENABLE_ENV} turns devtools on. */
|
|
@@ -43,20 +38,18 @@ export declare function isDevtoolsEnabledValue(value: string | null | undefined)
|
|
|
43
38
|
/** Directory (under the user's runtime dir) holding the per-app peer-address files. */
|
|
44
39
|
export declare const DEVTOOLS_ADDRESS_DIR = "gjsify-devtools";
|
|
45
40
|
/**
|
|
46
|
-
* Path of the file an app on the peer transport writes its concrete CLIENT
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* well-known name to look up, so the address itself has to be discoverable.
|
|
41
|
+
* Path of the file an app on the peer transport writes its concrete CLIENT address into,
|
|
42
|
+
* so a bridge can find it with no environment at all — the bus-less analogue of
|
|
43
|
+
* `DBUS_SESSION_BUS_ADDRESS`, since a peer socket has no well-known name to look up.
|
|
50
44
|
*
|
|
51
|
-
* `runtimeDir` is passed IN rather than probed,
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* an instance label routes both transports identically:
|
|
45
|
+
* `runtimeDir` is passed IN rather than probed, which keeps this package free of platform
|
|
46
|
+
* imports (both sides pass `GLib.get_user_runtime_dir()`). The name derives from the SAME
|
|
47
|
+
* bus name {@link resolveBusAddress} does, so one instance label routes both transports
|
|
48
|
+
* identically:
|
|
56
49
|
* - `(dir, "org.example.App")` → `<dir>/gjsify-devtools/org.example.App.address`
|
|
57
50
|
* - `(dir, "org.example.App", "host")` → `<dir>/gjsify-devtools/org.example.App.host.address`
|
|
58
51
|
*
|
|
59
|
-
* Forward slashes unconditionally: GLib/GIO accept them
|
|
60
|
-
*
|
|
52
|
+
* Forward slashes unconditionally: GLib/GIO accept them on win32 too, and a per-platform
|
|
53
|
+
* separator would need a platform probe in a pure module.
|
|
61
54
|
*/
|
|
62
55
|
export declare function devtoolsAddressFilePath(runtimeDir: string, base: string, label?: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/devtools-protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "Transport-agnostic devtools contract (methods, JSON envelope, method-kinds, transport interface) shared by every gjsify devtools adapter and the MCP bridge",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@gjsify/cli": "^0.
|
|
39
|
-
"@gjsify/unit": "^0.
|
|
38
|
+
"@gjsify/cli": "^0.38.0",
|
|
39
|
+
"@gjsify/unit": "^0.38.0",
|
|
40
40
|
"@types/node": "^25.9.2",
|
|
41
41
|
"typescript": "^6.0.3"
|
|
42
42
|
},
|