dsh-plugin-subscription-oauth 0.16.0 → 0.16.2

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.
@@ -12,7 +12,7 @@ import { LlmAdapter, errorChain, ReasoningEffortId, ToolCallId, } from '@deepsee
12
12
  import { idleWatchdog, mapFetchFailure } from './common.js';
13
13
  import { proxiedFetch } from '../http.js';
14
14
  import { findEntry } from './catalog.js';
15
- import { WORKBUDDY_ENDPOINT, WORKBUDDY_UA_VERSION, workbuddyHeaders } from '../auth/workbuddy-flow.js';
15
+ import { WORKBUDDY_ENDPOINT, workbuddyHeaders } from '../auth/workbuddy-flow.js';
16
16
  import { recordSpend } from './workbuddy-credits.js';
17
17
  /** The `workbuddy` provider route key (China build). */
18
18
  export const WORKBUDDY_PROVIDER_ID = 'workbuddy';
@@ -80,12 +80,6 @@ function unflagMessages(messages) {
80
80
  }
81
81
  return messages;
82
82
  }
83
- /** 32 hex digits, for the chat ids WorkBuddy's own client makes. */
84
- function randomHex() {
85
- const bytes = new Uint8Array(16);
86
- crypto.getRandomValues(bytes);
87
- return [...bytes].map((byte) => byte.toString(16).padStart(2, '0')).join('');
88
- }
89
83
  /** A tool's name may hold letters, digits, `_`, `-`; another character is refused. */
90
84
  const NAME_OK = /^[A-Za-z0-9_-]+$/;
91
85
  /** A name with each character WorkBuddy refuses as `_`, kept apart from `taken`. */
@@ -285,18 +279,7 @@ export class WorkBuddyAdapter extends LlmAdapter {
285
279
  const body = this.requestBody(options);
286
280
  const response = await this.fetchFn(WORKBUDDY_API, {
287
281
  method: 'POST',
288
- headers: {
289
- 'Content-Type': 'application/json',
290
- 'Accept': 'text/event-stream',
291
- ...workbuddyHeaders(token),
292
- // Name the chat the way WorkBuddy's own client does: the conversation, the
293
- // turn, and the message. Without these the gateway counts the request under no
294
- // client and cuts the stream, which is why the reply stopped after a few seconds.
295
- 'X-Conversation-Message-ID': randomHex(),
296
- 'X-Request-ID': randomHex(),
297
- 'X-Conversation-Request-ID': randomHex(),
298
- 'X-Conversation-ID': randomHex(),
299
- },
282
+ headers: workbuddyHeaders(token),
300
283
  body: JSON.stringify(body),
301
284
  signal: watchdog.signal,
302
285
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-subscription-oauth",
3
- "version": "0.16.0",
3
+ "version": "0.16.2",
4
4
  "description": "Use subscription accounts as DeepSeek Harness LLM providers — Kimi Code (OAuth device flow), Grok / X Premium (OIDC + PKCE), Google Antigravity (Google OAuth + Cloud Code Assist) and GLM / BigModel (ZCode's browser sign-in) — with per-model visibility, drag-to-reorder Auto fallback and plan quotas from the web Settings page",
5
5
  "license": "MIT",
6
6
  "author": "EricFL1998",