@gjsify/devtools 0.39.0 → 0.40.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/install.js +1 -1
- package/package.json +4 -4
package/lib/esm/install.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{DevtoolsPeerServerError as e,removeDevtoolsAddressFile as t,startDevtoolsPeerServer as n,writeDevtoolsAddressFile as r}from"./peer-transport.js";import{DevtoolsService as i}from"./devtools-service.js";import a from"@girs/glib-2.0";import{DEVTOOLS_ADDRESS_ENV as o,DEVTOOLS_ENABLE_ENV as s,DEVTOOLS_INSTANCE_ENV as c,DEVTOOLS_INTERFACE as l,
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{DevtoolsPeerServerError as e,removeDevtoolsAddressFile as t,startDevtoolsPeerServer as n,writeDevtoolsAddressFile as r}from"./peer-transport.js";import{DevtoolsService as i}from"./devtools-service.js";import a from"@girs/glib-2.0";import{DEVTOOLS_ADDRESS_ENV as o,DEVTOOLS_ENABLE_ENV as s,DEVTOOLS_INSTANCE_ENV as c,DEVTOOLS_INTERFACE as l,appIdToObjectPath as u,devtoolsAddressFilePath as d,isDevtoolsEnabledValue as f}from"@gjsify/devtools-protocol";import p from"@girs/gio-2.0";const m=`DBUS_SESSION_BUS_ADDRESS`,h=new Set;function envEnabled(){return f(a.getenv(s))}function envValue(e){let t=a.getenv(e);return t&&t!==``?t:null}function sessionBusUsable(){if(!envValue(m))return!1;try{return p.bus_get_sync(p.BusType.SESSION,null),!0}catch{return!1}}function chooseDevtoolsTransport(e){return e.requestedAddress?{kind:`peer`,address:e.requestedAddress,reason:`requested`}:e.hasAppConnection?{kind:`session-bus`}:e.sessionBusUsable?{kind:`unregistered`}:{kind:`peer`,address:null,reason:`no-session-bus`}}function describeMissingConnection(e,t){return e?t?`[gjsify-devtools] the session bus answers but this application is not registered on it yet — call installDevtools() from the GtkApplication "startup" handler (the bus connection and object path exist only after registration).`:`[gjsify-devtools] ${m} is set (${e}) but no bus answers there — using the bus-less peer transport instead. On macOS this is the usual state: Homebrew's dbus listens on launchd, so the advertised address only works while that socket is live.`:`[gjsify-devtools] this machine has no session bus (${m} is unset) — using the bus-less peer transport instead. Point the bridge at the address below, or set ${o} on both the app and \`gjsify debug\` to pin it yourself.`}function installDevtools(e,t={}){if(!(t.enabled??envEnabled()))return null;let n=t.instance??envValue(c)??void 0,r=new i(e,{...t,instance:n});try{return exportDevtools(e,r,t,n)}catch(e){return r.unexport(),console.error(`[gjsify-devtools] devtools stayed OFF, the app is unaffected — ${describeInstallFailure(e)}`),null}}function describeInstallFailure(t){return t instanceof e||t instanceof Error?t.message:String(t)}function exportDevtools(e,i,s,c){let f=e.get_is_registered(),p=f?e.get_dbus_connection():null,g=f?e.get_dbus_object_path():null,_=envValue(m),v=!!(p&&g),y=v||sessionBusUsable(),b=chooseDevtoolsTransport({requestedAddress:s.address??envValue(o),hasAppConnection:v,sessionBusUsable:y}),x=e.get_application_id()??`unknown`,S=`${g??u(x)}/devtools`;if((b.kind===`unregistered`||b.kind===`peer`&&b.reason===`no-session-bus`)&&console.error(describeMissingConnection(_,y)),b.kind===`session-bus`&&p)i.export(p,S),console.log(`[gjsify-devtools] exported ${l} at ${S} (dest ${x})`);else if(b.kind===`peer`){let o=n(i,S,b.address??void 0),s=r(d(a.get_user_runtime_dir(),x,c),o.address);i.attachPeerServer(o,s),console.log(`[gjsify-devtools] exported ${l} at ${S} (peer address ${o.address}${s?`, published to ${s}`:``})`),s&&e.connect(`shutdown`,()=>t(s))}return h.add(i),i}function uninstallDevtools(e){e.unexport(),h.delete(e)}export{chooseDevtoolsTransport,describeMissingConnection,installDevtools,uninstallDevtools};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/devtools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "In-app DBus devtools control plane for GJS/GTK apps — inspect, screenshot, and drive a running app over org.gjsify.Devtools (gdbus or the MCP bridge)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"@girs/gobject-2.0": "^4.1.0",
|
|
44
44
|
"@girs/graphene-1.0": "^4.1.0",
|
|
45
45
|
"@girs/gtk-4.0": "^4.1.0",
|
|
46
|
-
"@gjsify/devtools-protocol": "^0.
|
|
46
|
+
"@gjsify/devtools-protocol": "^0.40.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@gjsify/cli": "^0.
|
|
50
|
-
"@gjsify/unit": "^0.
|
|
49
|
+
"@gjsify/cli": "^0.40.0",
|
|
50
|
+
"@gjsify/unit": "^0.40.0",
|
|
51
51
|
"@types/node": "^25.9.2",
|
|
52
52
|
"typescript": "^6.0.3"
|
|
53
53
|
},
|