@gjsify/devtools-mcp 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.
|
@@ -33,10 +33,9 @@ export interface ConnectContext {
|
|
|
33
33
|
sessionBusAvailable: boolean;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
* The two I/O steps
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* defaults are the real GDBus calls.
|
|
36
|
+
* The resolution's two I/O steps, overridable ONLY so the specs can drive every row of
|
|
37
|
+
* the precedence — "stale file falls back to the session bus" included — on a host with
|
|
38
|
+
* no bus daemon, which is what CI and macOS are.
|
|
40
39
|
*/
|
|
41
40
|
export interface ConnectDeps {
|
|
42
41
|
dial?: (address: string) => Gio.DBusConnection;
|
|
@@ -46,21 +45,18 @@ export interface ConnectDeps {
|
|
|
46
45
|
* Resolve the precedence into a LIVE connection — dial-then-fallback, not
|
|
47
46
|
* dial-and-hope.
|
|
48
47
|
*
|
|
49
|
-
* The published address file outranks the session bus
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* file then degrades to "the session bus, as on any Linux desktop" or to the
|
|
58
|
-
* three-ways-in diagnostic, never to a raw localised GIO error.
|
|
48
|
+
* The published address file outranks the session bus as positive evidence that an app of
|
|
49
|
+
* exactly this id is listening NOW — but only if the claim is CHECKED, because nothing
|
|
50
|
+
* makes it true: GApplication handles SIGTERM only, so Ctrl-C, SIGKILL and a crash all
|
|
51
|
+
* leave the file behind, and `Gio.DBusConnection.new_for_address_sync` on a vanished
|
|
52
|
+
* socket throws `G_IO_ERROR_NOT_FOUND` (measured, gjs 1.88.1) out of the bridge's FIRST
|
|
53
|
+
* statement. So: dial it, and on failure delete it and continue down the precedence, which
|
|
54
|
+
* degrades to the session bus or to the three-ways-in diagnostic rather than to a raw
|
|
55
|
+
* localised GIO error.
|
|
59
56
|
*
|
|
60
|
-
* An EXPLICIT address (`--address`, `GJSIFY_DEVTOOLS_ADDRESS`) deliberately does
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* message naming that address and what to do — not with GIO's.
|
|
57
|
+
* An EXPLICIT address (`--address`, `GJSIFY_DEVTOOLS_ADDRESS`) deliberately does NOT fall
|
|
58
|
+
* back: the operator named it on both sides, so talking to something else would hide the
|
|
59
|
+
* typo instead of reporting it.
|
|
64
60
|
*/
|
|
65
61
|
export declare function connectToDevtools(ctx: ConnectContext, deps?: ConnectDeps): {
|
|
66
62
|
bus: Gio.DBusConnection;
|
|
@@ -81,9 +77,8 @@ export declare class DbusDevtoolsClient {
|
|
|
81
77
|
describeTarget(label?: string): string;
|
|
82
78
|
resolve(label?: string): BusAddress;
|
|
83
79
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* well-known name there gets `ServiceUnknown` from a peer that has never
|
|
80
|
+
* A peer connection has no bus daemon and no name registry, so the message must carry
|
|
81
|
+
* NO destination: the well-known name gets `ServiceUnknown` from a peer that has never
|
|
87
82
|
* heard of names.
|
|
88
83
|
*/
|
|
89
84
|
private _destination;
|
|
@@ -92,15 +87,15 @@ export declare class DbusDevtoolsClient {
|
|
|
92
87
|
/** Call a `() -> (s)` method and return its JSON string (pretty-printed). */
|
|
93
88
|
jsonCall(label: string | undefined, method: string, params?: GLib.Variant | null): Promise<string>;
|
|
94
89
|
/**
|
|
95
|
-
* Whether `busName` currently has an owner
|
|
96
|
-
*
|
|
97
|
-
*
|
|
90
|
+
* Whether `busName` currently has an owner, i.e. the app is running. In peer mode
|
|
91
|
+
* there is no name registry and being connected IS the answer, because the socket
|
|
92
|
+
* belongs to exactly one app process.
|
|
98
93
|
*/
|
|
99
94
|
nameHasOwner(busName: string): Promise<boolean>;
|
|
100
95
|
/**
|
|
101
|
-
* Enumerate devtools-enabled instances
|
|
102
|
-
*
|
|
103
|
-
*
|
|
96
|
+
* Enumerate devtools-enabled instances. Enumeration is a BUS feature: a peer address
|
|
97
|
+
* reaches exactly one app, so peer mode reports that one rather than pretending to
|
|
98
|
+
* have searched.
|
|
104
99
|
*/
|
|
105
100
|
listInstances(): Promise<DevtoolsInstanceRef[]>;
|
|
106
101
|
}
|
|
@@ -25,16 +25,13 @@ export type ClientTransportChoice =
|
|
|
25
25
|
* | unset | unset | absent | yes | `session-bus` — **Linux is byte-unchanged** |
|
|
26
26
|
* | unset | unset | absent | no | `unavailable` |
|
|
27
27
|
*
|
|
28
|
-
* The published address FILE deliberately outranks the session bus
|
|
29
|
-
* POSITIVE evidence
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* Linux stays unchanged in the default case regardless: with nothing in peer
|
|
37
|
-
* mode no address file is ever written, so that row is a stat() that misses.
|
|
28
|
+
* The published address FILE deliberately outranks the session bus, because it is
|
|
29
|
+
* POSITIVE evidence: it exists only while an app of exactly this id runs on the peer
|
|
30
|
+
* transport, and the app deletes it on shutdown, whereas "a session bus exists" says
|
|
31
|
+
* nothing about the app. Ranked the other way, an app launched with an explicit
|
|
32
|
+
* `GJSIFY_DEVTOOLS_ADDRESS` on a Linux desktop was reported as "no devtools-enabled app
|
|
33
|
+
* on the session bus". In the default case that row is a stat() that misses, since
|
|
34
|
+
* nothing in bus mode writes an address file.
|
|
38
35
|
*/
|
|
39
36
|
export declare function chooseClientTransport(input: {
|
|
40
37
|
optionAddress?: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/devtools-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "MCP↔devtools bridge for GJS apps — exposes a running app's org.gjsify.Devtools control plane (DBus) to an AI agent as MCP tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"@girs/gjs": "^4.1.0",
|
|
40
40
|
"@girs/glib-2.0": "^4.1.0",
|
|
41
41
|
"@girs/soup-3.0": "^4.1.0",
|
|
42
|
-
"@gjsify/devtools-protocol": "^0.
|
|
42
|
+
"@gjsify/devtools-protocol": "^0.38.0",
|
|
43
43
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
44
44
|
"zod": "^4.4.3"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@gjsify/devtools-cdp": "^0.
|
|
47
|
+
"@gjsify/devtools-cdp": "^0.38.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
50
50
|
"@gjsify/devtools-cdp": {
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@gjsify/cli": "^0.
|
|
56
|
-
"@gjsify/devtools-cdp": "^0.
|
|
57
|
-
"@gjsify/unit": "^0.
|
|
55
|
+
"@gjsify/cli": "^0.38.0",
|
|
56
|
+
"@gjsify/devtools-cdp": "^0.38.0",
|
|
57
|
+
"@gjsify/unit": "^0.38.0",
|
|
58
58
|
"@types/node": "^25.9.2",
|
|
59
59
|
"typescript": "^6.0.3"
|
|
60
60
|
},
|