@goodandready/dsh-usage-guard 0.1.17 → 0.1.19

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/telemetry.js CHANGED
@@ -124,12 +124,17 @@ export function isTrustedSettingsRequest(request, options = {}) {
124
124
  if (referer) {
125
125
  try {
126
126
  const url = new URL(referer);
127
- if (host && url.host.toLowerCase() === host.toLowerCase()) {
128
- return true;
127
+ // Apply strict host matching only to standard web referers (http/https).
128
+ // Non-http schemes (e.g. dsh-app:// in DSH Desktop Electron forwarder)
129
+ // fall through to loopback and token verification (#55).
130
+ if (url.protocol === 'http:' || url.protocol === 'https:') {
131
+ if (host && url.host.toLowerCase() === host.toLowerCase()) {
132
+ return true;
133
+ }
134
+ return false;
129
135
  }
130
- return false;
131
136
  } catch {
132
- return false;
137
+ // Non-standard or unparseable referers fall through to auth/loopback checks
133
138
  }
134
139
  }
135
140
 
package/lib/updater.js CHANGED
@@ -174,14 +174,23 @@ export async function getUpdateStatus(options, target = runtime()) {
174
174
  };
175
175
  }
176
176
 
177
+ export function buildInstallArgs(cliEntry, profileName, packageSpec, options = {}) {
178
+ return [
179
+ cliEntry, 'plugin', '--profile', profileName, 'add',
180
+ packageSpec,
181
+ `--registry=${options.registry ?? 'https://registry.npmjs.org/'}`,
182
+ ];
183
+ }
184
+
177
185
  async function installExact(target, packageSpec, options) {
178
186
  if (target.cliEntry === undefined) throw new Error('Automatic update is unavailable in this runtime.');
179
187
  await new Promise((resolvePromise, reject) => {
180
- const child = spawn(process.execPath, [
181
- target.cliEntry, 'plugin', '--profile', target.profileName, 'add',
182
- '--config.minimumReleaseAge=0', packageSpec,
183
- `--registry=${options.registry ?? 'https://registry.npmjs.org/'}`,
184
- ], {
188
+ const child = spawn(process.execPath, buildInstallArgs(
189
+ target.cliEntry,
190
+ target.profileName,
191
+ packageSpec,
192
+ options,
193
+ ), {
185
194
  cwd: target.profileDir,
186
195
  windowsHide: true,
187
196
  stdio: ['ignore', 'pipe', 'pipe'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-usage-guard",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "Keeps a malformed token-usage sample from taking a whole session history down with it: a missing or non-numeric counter becomes zero before the harness adds it up, so the fold never yields NaN and already-broken sessions open again.",
5
5
  "keywords": [
6
6
  "deepseek-harness",