dsh-open-in-dsh 0.3.1 → 0.3.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-open-in-dsh",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -42,6 +42,7 @@ set -u
42
42
 
43
43
  # Mirrored from lib/index.js by hand; test/macos.test.ts keeps the copies honest.
44
44
  ROUTE_OPEN='/dsh-open-in-dsh/api/v1/open'
45
+ ROUTE_STATUS='/dsh-open-in-dsh/api/v1/status'
45
46
  DEFAULT_WEB_PORT=3080
46
47
  SOCKET_PATH_DEFAULT="$HOME/.dsh/run/dsh-open-in-dsh.sock"
47
48
 
@@ -121,11 +122,21 @@ bundle_executable() {
121
122
  # Desktop Beta 2.0.18-beta.1, pgrep -f sees every helper and crash-reporting
122
123
  # process of the app but *not* the packaged main process, so a running app read
123
124
  # as "closed" and every click would take the cold-start path. `ps -ww` prints
124
- # the untruncated command line, and an exact match keeps helpers (which carry
125
- # extra arguments) out.
125
+ # the untruncated command line.
126
+ #
127
+ # The match is a prefix match, not an exact one. The packaged main process now
128
+ # carries arguments: an auto-update relaunches it as `<exe> --updated` (DSH
129
+ # Desktop Beta 2.0.23-beta.1, measured 2026-11-14), and the host it spawns is
130
+ # `<exe> --expose-internals … host.js …`. An exact match read a just-updated
131
+ # app as closed, so *every* click took the cold-start path — which is why the
132
+ # cold-start-only `socket_ready` bug surfaced right after each update. Helper
133
+ # processes live under `Contents/Frameworks/… Helper.app/`, a different prefix,
134
+ # so they still never match.
126
135
  is_running() {
127
136
  [ -n "$1" ] || return 1
128
- ps -ww -Ao command= 2>/dev/null | grep -Fx -- "$1" >/dev/null 2>&1
137
+ ps -ww -Ao command= 2>/dev/null | awk -v exe="$1" '
138
+ index($0, exe) == 1 && (length($0) == length(exe) || substr($0, length(exe) + 1, 1) == " ") { found = 1 }
139
+ END { exit found ? 0 : 1 }'
129
140
  }
130
141
 
131
142
  # A running instance always wins: the click is meant for the DSH the user is