@dsh-enhanced/coding-subscription-provider 0.1.2 → 0.1.4

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.
@@ -0,0 +1,50 @@
1
+ import { type ContentBlock, type GenerateOptions, type StreamChunk } from '@deepseek-ai/dsh-llm';
2
+ type ImageBlock = Extract<ContentBlock, {
3
+ type: 'image';
4
+ }>;
5
+ type ImageAttachmentRef = ImageBlock['attachment'];
6
+ export interface CodexDirectImageReader {
7
+ readImage(ref: ImageAttachmentRef, signal?: AbortSignal): Promise<{
8
+ readonly data: Uint8Array;
9
+ readonly ref: ImageAttachmentRef;
10
+ }>;
11
+ }
12
+ /** The sole authenticated capability accepted by this transport. */
13
+ export type CodexResponsesRequester = (body: string, signal: AbortSignal) => Promise<Response>;
14
+ export interface CodexDirectResponsesDependencies {
15
+ readonly request: CodexResponsesRequester;
16
+ readonly attachments?: CodexDirectImageReader;
17
+ /** Optional lifecycle signal; adapters normally also place it on `GenerateOptions.signal`. */
18
+ readonly signal?: AbortSignal;
19
+ readonly maxRequestBytes?: number;
20
+ readonly maxRequestImageBytes?: number;
21
+ readonly maxResponseBytes?: number;
22
+ readonly maxSseEventBytes?: number;
23
+ }
24
+ /** Auditable wire shape. Authentication and endpoint selection live outside this module. */
25
+ export interface CodexResponsesRequest {
26
+ readonly model: string;
27
+ readonly instructions: string;
28
+ readonly input: readonly unknown[];
29
+ readonly stream: true;
30
+ readonly store: false;
31
+ readonly include: readonly ['reasoning.encrypted_content'];
32
+ readonly tools?: readonly unknown[];
33
+ readonly tool_choice: 'auto';
34
+ readonly parallel_tool_calls: true;
35
+ readonly reasoning: Readonly<{
36
+ effort: string;
37
+ summary: 'auto';
38
+ }> | null;
39
+ }
40
+ export declare class CodexDirectResponsesError extends Error {
41
+ readonly status: number | undefined;
42
+ constructor(message: string, cause: 'protocol' | 'prompt-limit' | 'subscription-auth' | 'provider-http' | 'provider-failure' | 'context-window' | 'quota' | 'content-filter' | 'empty-response', status?: number);
43
+ }
44
+ /**
45
+ * Translate one DSH call to Codex's private Responses dialect and stream only
46
+ * provider-neutral chunks. It never reads credentials and never executes tools.
47
+ */
48
+ export declare function runCodexDirectResponses(options: GenerateOptions, dependencies: CodexDirectResponsesDependencies): AsyncIterable<StreamChunk>;
49
+ export {};
50
+ //# sourceMappingURL=codex-direct-responses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-direct-responses.d.ts","sourceRoot":"","sources":["../src/codex-direct-responses.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,eAAe,EAEpB,KAAK,WAAW,EAEjB,MAAM,sBAAsB,CAAA;AAW7B,KAAK,UAAU,GAAG,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAA;AAC1D,KAAK,kBAAkB,GAAG,UAAU,CAAC,YAAY,CAAC,CAAA;AAElD,MAAM,WAAW,sBAAsB;IACrC,SAAS,CACP,GAAG,EAAE,kBAAkB,EACvB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAA;CAC5E;AAED,oEAAoE;AACpE,MAAM,MAAM,uBAAuB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;AAE9F,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,OAAO,EAAE,uBAAuB,CAAA;IACzC,QAAQ,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAA;IAC7C,8FAA8F;IAC9F,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM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