@gjsify/devtools-protocol 0.39.0 → 0.41.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 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{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};
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,appIdToObjectPath as p,devtoolsAddressFilePath as m,isDevtoolsEnabledValue as h,resolveBusAddress as g,sanitizeInstanceId as _}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 appIdToObjectPath,m as devtoolsAddressFilePath,t as errResponse,i as formatDbusErrorMessage,h as isDevtoolsEnabledValue,n as okResponse,a as parseDbusErrorMessage,g as resolveBusAddress,_ as sanitizeInstanceId,o as toErrorPayload};
@@ -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}}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};
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 appIdToObjectPath(e){return`/${e.replace(/\./g,`/`).replace(/-/g,`_`)}`}function resolveBusAddress(e,t){let n=appIdToObjectPath(e),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,appIdToObjectPath,devtoolsAddressFilePath,isDevtoolsEnabledValue,resolveBusAddress,sanitizeInstanceId};
@@ -9,15 +9,29 @@ export interface BusAddress {
9
9
  objectPath: string;
10
10
  instance: string;
11
11
  }
12
+ /**
13
+ * An application id as `Gio.Application` itself spells it as an object path: dots become
14
+ * slashes, HYPHENS BECOME UNDERSCORES (gio `gapplicationimpl-dbus.c`,
15
+ * `application_path_from_appid`).
16
+ *
17
+ * The hyphen half is not cosmetic. `-` is not a legal D-Bus object-path character —
18
+ * measured on gjs 1.88.1, `GLib.Variant.is_object_path('/gjsify/examples/canvas2d-fireworks')`
19
+ * is `false`, and exporting there does NOT throw: it logs one
20
+ * `g_dbus_interface_skeleton_export: assertion 'g_variant_is_object_path (object_path)'
21
+ * failed` and exports nothing. Every `gjsify.examples.*-*` showcase carries such an id, so
22
+ * a dots-only derivation aimed the bus-less export and the bridge's prediction at a path
23
+ * that can never exist, silently, while the app itself sat at the underscore one.
24
+ */
25
+ export declare function appIdToObjectPath(appId: string): string;
12
26
  /**
13
27
  * Resolve an instance label to its DBus bus name + devtools object path, given the app's
14
28
  * base id. The default instance keeps the bare base; a named instance gets a
15
29
  * `.<segment>` bus-name suffix and a `/<segment>` path segment, so the bridge dials the
16
30
  * right process when several run side by side.
17
31
  *
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.
32
+ * Path derivation is {@link appIdToObjectPath} plus a `/devtools` leaf. The in-app adapter
33
+ * should prefer the authoritative `app.get_dbus_object_path() + '/devtools'`; this only
34
+ * lets the bridge PREDICT it.
21
35
  *
22
36
  * - `("org.example.App")` → `org.example.App` @ `/org/example/App/devtools`
23
37
  * - `("org.example.App", "host")` → `org.example.App.host` @ `/org/example/App/host/devtools`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/devtools-protocol",
3
- "version": "0.39.0",
3
+ "version": "0.41.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.0",
39
- "@gjsify/unit": "^0.39.0",
38
+ "@gjsify/cli": "^0.41.0",
39
+ "@gjsify/unit": "^0.41.0",
40
40
  "@types/node": "^25.9.2",
41
41
  "typescript": "^6.0.3"
42
42
  },