dsh-github-copilot 0.4.2-alpha.3 → 0.4.2-alpha.5

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,17 @@
1
+ import type { RequestBodyEvidence, RequestBodyProtocol } from './request-body-evidence.ts';
2
+ export declare const REQUEST_BODY_COMPOSITION_LIMITS: Readonly<{
3
+ bytes: number;
4
+ sliceCharacters: 65536;
5
+ elapsedMs: 2000;
6
+ concurrent: 4;
7
+ values: 65536;
8
+ tokens: 131072;
9
+ depth: 64;
10
+ keyCharacters: 128;
11
+ }>;
12
+ /** Only bounded keys/discriminators are decoded; payload values never form an object graph. */
13
+ export declare function requestBodyComposition(payload: string | undefined, protocol: RequestBodyProtocol, options?: {
14
+ signal?: AbortSignal;
15
+ isCurrent?: () => boolean;
16
+ }): Promise<RequestBodyEvidence>;
17
+ //# sourceMappingURL=request-body-composition.d.ts.map
@@ -20,11 +20,12 @@ export type RequestBodyEvidence = {
20
20
  readonly opaqueReplayBytes: number;
21
21
  readonly remainingConversationBytes: number;
22
22
  } | {
23
- readonly state: 'unavailable' | 'size-limit' | 'work-limit' | 'invalid-json' | 'unsupported-shape';
23
+ readonly state: 'unavailable' | 'size-limit' | 'work-limit' | 'invalid-json' | 'unsupported-shape' | 'cancelled' | 'time-limit';
24
24
  readonly totalBytes?: number;
25
25
  };
26
26
  export interface RequestBodyDispatchEvidence {
27
27
  readonly protocol: RequestBodyProtocol;
28
+ readonly composition?: Promise<RequestBodyEvidence>;
28
29
  /** Fetch invocation to response headers, not upload duration or clone-observation time. */
29
30
  readonly responseHeadersMs: number;
30
31
  readonly upload?: RequestUploadEvidence;
@@ -0,0 +1,196 @@
1
+ import { z } from 'zod';
2
+ import type { RequestBodyEvidence } from './request-body-evidence.ts';
3
+ import type { RequestUploadEvidence } from './request-upload-evidence.ts';
4
+ export declare const REQUEST_DIAGNOSTICS_MAX_ROWS = 128;
5
+ export declare const REQUEST_DIAGNOSTICS_RETENTION_MS: number;
6
+ export declare const RequestDiagnosticSchema: z.ZodObject<{
7
+ streamId: z.ZodString;
8
+ dispatchIndex: z.ZodNumber;
9
+ version: z.ZodString;
10
+ startedAt: z.ZodNumber;
11
+ elapsedMs: z.ZodNumber;
12
+ model: z.ZodString;
13
+ protocol: z.ZodEnum<{
14
+ "openai-completions": "openai-completions";
15
+ "openai-responses": "openai-responses";
16
+ "anthropic-messages": "anthropic-messages";
17
+ }>;
18
+ composition: z.ZodDiscriminatedUnion<[z.ZodObject<{
19
+ state: z.ZodLiteral<"complete">;
20
+ totalBytes: z.ZodNumber;
21
+ conversationBytes: z.ZodNumber;
22
+ toolSchemaBytes: z.ZodNumber;
23
+ systemBytes: z.ZodNumber;
24
+ otherBytes: z.ZodNumber;
25
+ imageBlockBytes: z.ZodNumber;
26
+ opaqueReplayBytes: z.ZodNumber;
27
+ remainingConversationBytes: z.ZodNumber;
28
+ }, z.core.$strict>, z.ZodObject<{
29
+ state: z.ZodEnum<{
30
+ unavailable: "unavailable";
31
+ "work-limit": "work-limit";
32
+ "size-limit": "size-limit";
33
+ "invalid-json": "invalid-json";
34
+ "unsupported-shape": "unsupported-shape";
35
+ cancelled: "cancelled";
36
+ "time-limit": "time-limit";
37
+ }>;
38
+ totalBytes: z.ZodOptional<z.ZodNumber>;
39
+ }, z.core.$strict>], "state">;
40
+ encoding: z.ZodEnum<{
41
+ unknown: "unknown";
42
+ identity: "identity";
43
+ gzip: "gzip";
44
+ }>;
45
+ wireBytes: z.ZodOptional<z.ZodNumber>;
46
+ upload: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
47
+ state: z.ZodLiteral<"observed">;
48
+ bodyWrite: z.ZodEnum<{
49
+ observed: "observed";
50
+ "not-observed": "not-observed";
51
+ }>;
52
+ bodyWriteCompleteMs: z.ZodOptional<z.ZodNumber>;
53
+ nativeResponseHeadersMs: z.ZodOptional<z.ZodNumber>;
54
+ alpn: z.ZodEnum<{
55
+ h2: "h2";
56
+ unavailable: "unavailable";
57
+ "http/1.1": "http/1.1";
58
+ }>;
59
+ nodeWritableBufferBytes: z.ZodOptional<z.ZodNumber>;
60
+ }, z.core.$strict>, z.ZodObject<{
61
+ state: z.ZodEnum<{
62
+ unavailable: "unavailable";
63
+ "work-limit": "work-limit";
64
+ }>;
65
+ }, z.core.$strict>, z.ZodObject<{
66
+ state: z.ZodLiteral<"ambiguous">;
67
+ requestCount: z.ZodNumber;
68
+ }, z.core.$strict>], "state">>;
69
+ responseHeadersMs: z.ZodOptional<z.ZodNumber>;
70
+ httpStatus: z.ZodOptional<z.ZodNumber>;
71
+ outcome: z.ZodEnum<{
72
+ cancelled: "cancelled";
73
+ "http-error": "http-error";
74
+ "transport-error": "transport-error";
75
+ "stream-done": "stream-done";
76
+ "stream-error": "stream-error";
77
+ interrupted: "interrupted";
78
+ }>;
79
+ reason: z.ZodEnum<{
80
+ none: "none";
81
+ unknown: "unknown";
82
+ "request-body-timeout": "request-body-timeout";
83
+ "caller-abort": "caller-abort";
84
+ "credential-changed": "credential-changed";
85
+ disposed: "disposed";
86
+ "byte-idle-timeout": "byte-idle-timeout";
87
+ "signal-abort": "signal-abort";
88
+ }>;
89
+ }, z.core.$strict>;
90
+ export declare const RequestDiagnosticsSchema: z.ZodObject<{
91
+ rows: z.ZodArray<z.ZodObject<{
92
+ streamId: z.ZodString;
93
+ dispatchIndex: z.ZodNumber;
94
+ version: z.ZodString;
95
+ startedAt: z.ZodNumber;
96
+ elapsedMs: z.ZodNumber;
97
+ model: z.ZodString;
98
+ protocol: z.ZodEnum<{
99
+ "openai-completions": "openai-completions";
100
+ "openai-responses": "openai-responses";
101
+ "anthropic-messages": "anthropic-messages";
102
+ }>;
103
+ composition: z.ZodDiscriminatedUnion<[z.ZodObject<{
104
+ state: z.ZodLiteral<"complete">;
105
+ totalBytes: z.ZodNumber;
106
+ conversationBytes: z.ZodNumber;
107
+ toolSchemaBytes: z.ZodNumber;
108
+ systemBytes: z.ZodNumber;
109
+ otherBytes: z.ZodNumber;
110
+ imageBlockBytes: z.ZodNumber;
111
+ opaqueReplayBytes: z.ZodNumber;
112
+ remainingConversationBytes: z.ZodNumber;
113
+ }, z.core.$strict>, z.ZodObject<{
114
+ state: z.ZodEnum<{
115
+ unavailable: "unavailable";
116
+ "work-limit": "work-limit";
117
+ "size-limit": "size-limit";
118
+ "invalid-json": "invalid-json";
119
+ "unsupported-shape": "unsupported-shape";
120
+ cancelled: "cancelled";
121
+ "time-limit": "time-limit";
122
+ }>;
123
+ totalBytes: z.ZodOptional<z.ZodNumber>;
124
+ }, z.core.$strict>], "state">;
125
+ encoding: z.ZodEnum<{
126
+ unknown: "unknown";
127
+ identity: "identity";
128
+ gzip: "gzip";
129
+ }>;
130
+ wireBytes: z.ZodOptional<z.ZodNumber>;
131
+ upload: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
132
+ state: z.ZodLiteral<"observed">;
133
+ bodyWrite: z.ZodEnum<{
134
+ observed: "observed";
135
+ "not-observed": "not-observed";
136
+ }>;
137
+ bodyWriteCompleteMs: z.ZodOptional<z.ZodNumber>;
138
+ nativeResponseHeadersMs: z.ZodOptional<z.ZodNumber>;
139
+ alpn: z.ZodEnum<{
140
+ h2: "h2";
141
+ unavailable: "unavailable";
142
+ "http/1.1": "http/1.1";
143
+ }>;
144
+ nodeWritableBufferBytes: z.ZodOptional<z.ZodNumber>;
145
+ }, z.core.$strict>, z.ZodObject<{
146
+ state: z.ZodEnum<{
147
+ unavailable: "unavailable";
148
+ "work-limit": "work-limit";
149
+ }>;
150
+ }, z.core.$strict>, z.ZodObject<{
151
+ state: z.ZodLiteral<"ambiguous">;
152
+ requestCount: z.ZodNumber;
153
+ }, z.core.$strict>], "state">>;
154
+ responseHeadersMs: z.ZodOptional<z.ZodNumber>;
155
+ httpStatus: z.ZodOptional<z.ZodNumber>;
156
+ outcome: z.ZodEnum<{
157
+ cancelled: "cancelled";
158
+ "http-error": "http-error";
159
+ "transport-error": "transport-error";
160
+ "stream-done": "stream-done";
161
+ "stream-error": "stream-error";
162
+ interrupted: "interrupted";
163
+ }>;
164
+ reason: z.ZodEnum<{
165
+ none: "none";
166
+ unknown: "unknown";
167
+ "request-body-timeout": "request-body-timeout";
168
+ "caller-abort": "caller-abort";
169
+ "credential-changed": "credential-changed";
170
+ disposed: "disposed";
171
+ "byte-idle-timeout": "byte-idle-timeout";
172
+ "signal-abort": "signal-abort";
173
+ }>;
174
+ }, z.core.$strict>>;
175
+ dropped: z.ZodNumber;
176
+ evicted: z.ZodNumber;
177
+ pending: z.ZodOptional<z.ZodNumber>;
178
+ interruptedOnReopen: z.ZodOptional<z.ZodNumber>;
179
+ }, z.core.$strict>;
180
+ export type RequestDiagnostic = z.infer<typeof RequestDiagnosticSchema>;
181
+ export interface RequestDiagnosticHandle {
182
+ composition?(evidence: RequestBodyEvidence): void;
183
+ isCurrent?(): boolean;
184
+ headers(status: number | undefined, ms: number | undefined, upload?: RequestUploadEvidence): void;
185
+ finish(outcome: RequestDiagnostic['outcome'], reason?: RequestDiagnostic['reason']): void;
186
+ }
187
+ export interface RequestDiagnosticStart {
188
+ streamId: string;
189
+ dispatchIndex: number;
190
+ model: string;
191
+ protocol: RequestDiagnostic['protocol'];
192
+ composition: RequestBodyEvidence;
193
+ encoding: RequestDiagnostic['encoding'];
194
+ wireBytes?: number;
195
+ }
196
+ //# sourceMappingURL=request-diagnostics.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-github-copilot",
3
3
  "description": "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
4
- "version": "0.4.2-alpha.3",
4
+ "version": "0.4.2-alpha.5",
5
5
  "releaseNotes": "CHANGELOG.md",
6
6
  "publishConfig": {
7
7
  "access": "public",