@gjsify/devtools-protocol 0.27.1 → 0.29.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/esm/index.js +1 -1
- package/lib/esm/routing.js +1 -1
- package/lib/types/routing.d.ts +33 -0
- package/package.json +3 -3
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEVTOOLS_INTERFACE as e}from"./constants.js";import{errResponse as t,okResponse as n}from"./envelope.js";import{DevtoolsError as r,formatDbusErrorMessage as i,parseDbusErrorMessage as a,toErrorPayload as o}from"./errors.js";import{GENERIC_METHODS as s}from"./methods.js";import"./transport.js";import{MethodRegistry as c}from"./registry.js";import{
|
|
1
|
+
import{DEVTOOLS_INTERFACE as e}from"./constants.js";import{errResponse as t,okResponse as n}from"./envelope.js";import{DevtoolsError as r,formatDbusErrorMessage as i,parseDbusErrorMessage as a,toErrorPayload as o}from"./errors.js";import{GENERIC_METHODS as s}from"./methods.js";import"./transport.js";import{MethodRegistry as c}from"./registry.js";import{DEVTOOLS_ADDRESS_DIR as l,DEVTOOLS_ADDRESS_ENV as u,DEVTOOLS_ENABLE_ENV as d,DEVTOOLS_INSTANCE_ENV as f,devtoolsAddressFilePath as p,isDevtoolsEnabledValue as m,resolveBusAddress as h,sanitizeInstanceId as g}from"./routing.js";import"./types.js";export{l as DEVTOOLS_ADDRESS_DIR,u as DEVTOOLS_ADDRESS_ENV,d as DEVTOOLS_ENABLE_ENV,f as DEVTOOLS_INSTANCE_ENV,e as DEVTOOLS_INTERFACE,r as DevtoolsError,s as GENERIC_METHODS,c as MethodRegistry,p as devtoolsAddressFilePath,t as errResponse,i as formatDbusErrorMessage,m as isDevtoolsEnabledValue,n as okResponse,a as parseDbusErrorMessage,h as resolveBusAddress,g as sanitizeInstanceId,o as toErrorPayload};
|
package/lib/esm/routing.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";function sanitizeInstanceId(e){let t=e.toLowerCase().replace(/[^a-z0-9]/g,``);return/^[a-z]/.test(t)?t:`i${t||`0`}`}function resolveBusAddress(e,t){let n=`/${e.replace(/\./g,`/`)}`,r=t&&t!=="default"?sanitizeInstanceId(t):`default`;return r==="default"?{busName:e,objectPath:`${n}/devtools`,instance:`default`}:{busName:`${e}.${r}`,objectPath:`${n}/${r}/devtools`,instance:r}}export{resolveBusAddress,sanitizeInstanceId};
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";function sanitizeInstanceId(e){let t=e.toLowerCase().replace(/[^a-z0-9]/g,``);return/^[a-z]/.test(t)?t:`i${t||`0`}`}function resolveBusAddress(e,t){let n=`/${e.replace(/\./g,`/`)}`,r=t&&t!=="default"?sanitizeInstanceId(t):`default`;return r==="default"?{busName:e,objectPath:`${n}/devtools`,instance:`default`}:{busName:`${e}.${r}`,objectPath:`${n}/${r}/devtools`,instance:r}}const e=`GJSIFY_DEVTOOLS`,t=`GJSIFY_DEVTOOLS_INSTANCE`,n=`GJSIFY_DEVTOOLS_ADDRESS`;function isDevtoolsEnabledValue(e){if(e==null)return!1;let t=e.toLowerCase();return t!==``&&t!==`0`&&t!==`false`}const r=`gjsify-devtools`;function devtoolsAddressFilePath(e,t,n){let{busName:i}=resolveBusAddress(t,n);return`${e}/${r}/${i}.address`}export{r as DEVTOOLS_ADDRESS_DIR,n as DEVTOOLS_ADDRESS_ENV,e as DEVTOOLS_ENABLE_ENV,t as DEVTOOLS_INSTANCE_ENV,devtoolsAddressFilePath,isDevtoolsEnabledValue,resolveBusAddress,sanitizeInstanceId};
|
package/lib/types/routing.d.ts
CHANGED
|
@@ -27,3 +27,36 @@ export interface BusAddress {
|
|
|
27
27
|
* - `("org.example.App", "host")` → `org.example.App.host` @ `/org/example/App/host/devtools`
|
|
28
28
|
*/
|
|
29
29
|
export declare function resolveBusAddress(base: string, label?: string): BusAddress;
|
|
30
|
+
/** Env var enabling the control plane at all (any value except ``, `0`, `false`). */
|
|
31
|
+
export declare const DEVTOOLS_ENABLE_ENV = "GJSIFY_DEVTOOLS";
|
|
32
|
+
/** Env var carrying the per-instance label for side-by-side apps. */
|
|
33
|
+
export declare const DEVTOOLS_INSTANCE_ENV = "GJSIFY_DEVTOOLS_INSTANCE";
|
|
34
|
+
/**
|
|
35
|
+
* Env var carrying a D-Bus address for the BUS-LESS peer-to-peer transport.
|
|
36
|
+
* On the app side it is the address to LISTEN on (`unix:tmpdir=/tmp`,
|
|
37
|
+
* `unix:path=…`, `nonce-tcp:host=127.0.0.1`); on the bridge side it is the
|
|
38
|
+
* address to DIAL. It exists because macOS and Windows have no session bus.
|
|
39
|
+
*/
|
|
40
|
+
export declare const DEVTOOLS_ADDRESS_ENV = "GJSIFY_DEVTOOLS_ADDRESS";
|
|
41
|
+
/** Whether a value read from {@link DEVTOOLS_ENABLE_ENV} turns devtools on. */
|
|
42
|
+
export declare function isDevtoolsEnabledValue(value: string | null | undefined): boolean;
|
|
43
|
+
/** Directory (under the user's runtime dir) holding the per-app peer-address files. */
|
|
44
|
+
export declare const DEVTOOLS_ADDRESS_DIR = "gjsify-devtools";
|
|
45
|
+
/**
|
|
46
|
+
* Path of the file an app on the peer transport writes its concrete CLIENT
|
|
47
|
+
* address into, so a bridge can find it with no environment at all. This is the
|
|
48
|
+
* bus-less analogue of `DBUS_SESSION_BUS_ADDRESS`: a peer socket has no
|
|
49
|
+
* well-known name to look up, so the address itself has to be discoverable.
|
|
50
|
+
*
|
|
51
|
+
* `runtimeDir` is passed IN rather than probed, keeping this package free of
|
|
52
|
+
* platform imports (both sides pass `GLib.get_user_runtime_dir()`).
|
|
53
|
+
*
|
|
54
|
+
* The name derives from the SAME bus name {@link resolveBusAddress} derives, so
|
|
55
|
+
* an instance label routes both transports identically:
|
|
56
|
+
* - `(dir, "org.example.App")` → `<dir>/gjsify-devtools/org.example.App.address`
|
|
57
|
+
* - `(dir, "org.example.App", "host")` → `<dir>/gjsify-devtools/org.example.App.host.address`
|
|
58
|
+
*
|
|
59
|
+
* Forward slashes unconditionally: GLib/GIO accept them as separators on win32
|
|
60
|
+
* too, and a per-platform separator would need a platform probe in a pure module.
|
|
61
|
+
*/
|
|
62
|
+
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.29.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.29.0",
|
|
39
|
+
"@gjsify/unit": "^0.29.0",
|
|
40
40
|
"@types/node": "^25.9.2",
|
|
41
41
|
"typescript": "^6.0.3"
|
|
42
42
|
},
|