@pure01fx/dsh-openai-codex-auth 0.10.0 → 0.11.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/sse.js CHANGED
@@ -1,18 +1,10 @@
1
- /** Bounded, cancellable Server-Sent Events byte framing. */
1
+ /** Cancellable Server-Sent Events byte framing. */
2
2
  import { LlmError } from '@deepseek-ai/dsh-llm';
3
- export const DEFAULT_MAX_SSE_EVENT_BYTES = 64 * 1024 * 1024;
4
3
  function aborted() {
5
4
  return new LlmError('native Codex SSE stream was cancelled', 'ABORTED');
6
5
  }
7
- function tooLarge() {
8
- return new LlmError('native Codex SSE event exceeded the size limit', 'SSE_EVENT_TOO_LARGE');
9
- }
10
- /** Decode a byte stream into bounded SSE frames. */
6
+ /** Decode a byte stream into SSE frames. */
11
7
  export async function* parseSse(stream, options = {}) {
12
- const limit = options.maxEventBytes ?? DEFAULT_MAX_SSE_EVENT_BYTES;
13
- if (!Number.isSafeInteger(limit) || limit <= 0) {
14
- throw new LlmError('native Codex SSE size limit is invalid', 'INVALID_CONFIG');
15
- }
16
8
  if (options.signal?.aborted === true)
17
9
  throw aborted();
18
10
  const reader = stream.getReader();
@@ -20,7 +12,6 @@ export async function* parseSse(stream, options = {}) {
20
12
  let pending = '';
21
13
  let dataLines = [];
22
14
  let eventName;
23
- let eventBytes = 0;
24
15
  let cancelled = false;
25
16
  const onAbort = () => {
26
17
  cancelled = true;
@@ -39,8 +30,6 @@ export async function* parseSse(stream, options = {}) {
39
30
  options.onActivity?.();
40
31
  options.onBytes?.(value.byteLength);
41
32
  pending += decoder.decode(value, { stream: true });
42
- if (Buffer.byteLength(pending) > limit && !pending.includes('\n'))
43
- throw tooLarge();
44
33
  let newline = pending.indexOf('\n');
45
34
  while (newline >= 0) {
46
35
  let line = pending.slice(0, newline);
@@ -57,12 +46,8 @@ export async function* parseSse(stream, options = {}) {
57
46
  }
58
47
  dataLines = [];
59
48
  eventName = undefined;
60
- eventBytes = 0;
61
49
  continue;
62
50
  }
63
- eventBytes += Buffer.byteLength(line) + 1;
64
- if (eventBytes > limit)
65
- throw tooLarge();
66
51
  if (line.startsWith(':'))
67
52
  options.onActivity?.();
68
53
  else if (line.startsWith('data:'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pure01fx/dsh-openai-codex-auth",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Native ChatGPT Codex provider, device-code-first login, and same-origin Web integration for DeepSeek Harness",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -86,16 +86,22 @@
86
86
  "LICENSE",
87
87
  "CODEX-COMPATIBILITY.md"
88
88
  ],
89
+ "scripts": {
90
+ "build": "tsc",
91
+ "typecheck": "tsc --noEmit",
92
+ "test": "vitest run",
93
+ "prepack": "pnpm build"
94
+ },
89
95
  "dsh": {
90
96
  "engines": {
91
- "dsh": "0.1.1-rc.2"
97
+ "dsh": "0.1.5-rc.1"
92
98
  },
93
99
  "bundle": {
94
100
  "patch": "./cordis.patch.yml"
95
101
  },
96
102
  "client": {
97
103
  "inject": [
98
- "@deepseek-ai/dsh-client-runtime",
104
+ "@deepseek-ai/dsh-client-ui-renderer",
99
105
  "@deepseek-ai/dsh-client-ui-model-selection",
100
106
  "@deepseek-ai/dsh-client-ui-conversation",
101
107
  "@deepseek-ai/dsh-client-ui-settings"
@@ -105,19 +111,19 @@
105
111
  },
106
112
  "peerDependencies": {
107
113
  "@deepseek-ai/cordis": "^4.0.1",
108
- "@deepseek-ai/dsh-attachment": "0.1.1-rc.2",
109
- "@deepseek-ai/dsh-credentials": "0.1.1-rc.2",
110
- "@deepseek-ai/dsh-fs": "0.1.1-rc.2",
111
- "@deepseek-ai/dsh-host-webserver": "0.1.1-rc.2",
112
- "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
113
- "@deepseek-ai/dsh-sandbox": "0.1.1-rc.2",
114
- "@deepseek-ai/dsh-sandbox-policy": "0.1.1-rc.2",
115
- "@deepseek-ai/dsh-shell": "0.1.1-rc.2",
116
- "@deepseek-ai/dsh-tools": "0.1.1-rc.2"
114
+ "@deepseek-ai/dsh-attachment": "0.1.5-rc.1",
115
+ "@deepseek-ai/dsh-credentials": "0.1.5-rc.1",
116
+ "@deepseek-ai/dsh-fs": "0.1.5-rc.1",
117
+ "@deepseek-ai/dsh-host-webserver": "0.1.5-rc.1",
118
+ "@deepseek-ai/dsh-llm": "0.1.5-rc.1",
119
+ "@deepseek-ai/dsh-sandbox": "0.1.5-rc.1",
120
+ "@deepseek-ai/dsh-sandbox-policy": "0.1.5-rc.1",
121
+ "@deepseek-ai/dsh-shell": "0.1.5-rc.1",
122
+ "@deepseek-ai/dsh-tools": "0.1.5-rc.1"
117
123
  },
118
124
  "dependencies": {
119
- "@deepseek-ai/dsh-atomic-write": "0.1.1-rc.2",
120
- "@deepseek-ai/dsh-home-paths": "0.1.1-rc.2",
125
+ "@deepseek-ai/dsh-atomic-write": "0.1.5-rc.1",
126
+ "@deepseek-ai/dsh-home-paths": "0.1.5-rc.1",
121
127
  "@deepseek-ai/schemastery": "^3.18.1",
122
128
  "https-proxy-agent": "7.0.6",
123
129
  "image-size": "^2.0.2",
@@ -125,23 +131,26 @@
125
131
  "ws": "8.21.3"
126
132
  },
127
133
  "devDependencies": {
134
+ "@deepseek-ai/dsh-client-ui-model-selection": "0.1.5-rc.1",
135
+ "@deepseek-ai/dsh-web-frontend": "0.1.5-rc.1",
128
136
  "@deepseek-ai/cordis": "^4.0.1",
129
- "@deepseek-ai/dsh-agent": "0.1.1-rc.2",
130
- "@deepseek-ai/dsh-attachment": "0.1.1-rc.2",
131
- "@deepseek-ai/dsh-attachment-local": "0.1.1-rc.2",
132
- "@deepseek-ai/dsh-credentials": "0.1.1-rc.2",
133
- "@deepseek-ai/dsh-fs": "0.1.1-rc.2",
134
- "@deepseek-ai/dsh-host-webserver": "0.1.1-rc.2",
135
- "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
136
- "@deepseek-ai/dsh-sandbox": "0.1.1-rc.2",
137
- "@deepseek-ai/dsh-sandbox-policy": "0.1.1-rc.2",
138
- "@deepseek-ai/dsh-scope": "0.1.1-rc.2",
139
- "@deepseek-ai/dsh-session": "0.1.1-rc.2",
140
- "@deepseek-ai/dsh-shell": "0.1.1-rc.2",
141
- "@deepseek-ai/dsh-system-prompt": "0.1.1-rc.2",
142
- "@deepseek-ai/dsh-tools": "0.1.1-rc.2",
137
+ "@deepseek-ai/dsh-agent": "0.1.5-rc.1",
138
+ "@deepseek-ai/dsh-attachment": "0.1.5-rc.1",
139
+ "@deepseek-ai/dsh-attachment-local": "0.1.5-rc.1",
140
+ "@deepseek-ai/dsh-credentials": "0.1.5-rc.1",
141
+ "@deepseek-ai/dsh-fs": "0.1.5-rc.1",
142
+ "@deepseek-ai/dsh-host-webserver": "0.1.5-rc.1",
143
+ "@deepseek-ai/dsh-llm": "0.1.5-rc.1",
144
+ "@deepseek-ai/dsh-sandbox": "0.1.5-rc.1",
145
+ "@deepseek-ai/dsh-sandbox-policy": "0.1.5-rc.1",
146
+ "@deepseek-ai/dsh-scope": "0.1.5-rc.1",
147
+ "@deepseek-ai/dsh-session": "0.1.5-rc.1",
148
+ "@deepseek-ai/dsh-shell": "0.1.5-rc.1",
149
+ "@deepseek-ai/dsh-system-prompt": "0.1.5-rc.1",
150
+ "@deepseek-ai/dsh-tools": "0.1.5-rc.1",
143
151
  "@types/node": "^22.20.0",
144
152
  "@types/proxy-from-env": "1.0.4",
153
+ "@types/ws": "8.18.1",
145
154
  "sharp": "^0.35.4",
146
155
  "typescript": "^6.0.3",
147
156
  "vitest": "^4.1.8"
@@ -165,9 +174,5 @@
165
174
  "@deepseek-ai/dsh-sandbox-policy": {
166
175
  "optional": true
167
176
  }
168
- },
169
- "scripts": {
170
- "build": "tsc",
171
- "test": "vitest run"
172
177
  }
173
- }
178
+ }