dsh-github-copilot 0.4.0-alpha.95 → 0.4.0-alpha.97

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/remote.js CHANGED
@@ -333,11 +333,14 @@ const contribution$2 = {
333
333
  };
334
334
  //#endregion
335
335
  //#region lib/types/replay-recovery-types.js
336
+ const ReplayRecoveryDurationSchema = z.enum(["next-turn", "session"]);
336
337
  const ReplayRecoveryViewSchema = z.discriminatedUnion("state", [z.object({ state: z.literal("unavailable") }).strict(), z.object({
337
338
  state: z.enum(["available", "enabled"]),
338
339
  revision: z.string().uuid(),
339
340
  itemCount: z.number().int().positive().max(512),
340
- model: z.string().min(1).max(256)
341
+ model: z.string().min(1).max(256),
342
+ duration: ReplayRecoveryDurationSchema.optional(),
343
+ expiresAt: z.number().int().nonnegative().optional()
341
344
  }).strict()]);
342
345
  //#endregion
343
346
  //#region lib/types/replay-recovery-remote.js
@@ -350,37 +353,63 @@ const agent = {
350
353
  };
351
354
  const contribution$1 = {
352
355
  package: "dsh-github-copilot",
353
- descriptors: [{
354
- id: "dsh-github-copilot:githubCopilotReplayRecovery.get",
355
- namespace: "githubCopilotReplayRecovery",
356
- service: "githubCopilotReplayRecovery",
357
- method: "get",
358
- invocation: { kind: "direct" },
359
- parameters: [agent],
360
- result: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryView", ReplayRecoveryViewSchema)
361
- }, {
362
- id: "dsh-github-copilot:githubCopilotReplayRecovery.setEnabled",
363
- namespace: "githubCopilotReplayRecovery",
364
- service: "githubCopilotReplayRecovery",
365
- method: "setEnabled",
366
- invocation: { kind: "direct" },
367
- parameters: [
368
- agent,
369
- {
370
- name: "revision",
371
- wire: "revision",
372
- source: "json",
373
- codec: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryRevision", z.string().uuid())
374
- },
375
- {
376
- name: "enabled",
377
- wire: "enabled",
378
- source: "json",
379
- codec: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryEnabled", z.boolean())
380
- }
381
- ],
382
- result: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryView", ReplayRecoveryViewSchema)
383
- }]
356
+ descriptors: [
357
+ {
358
+ id: "dsh-github-copilot:githubCopilotReplayRecovery.get",
359
+ namespace: "githubCopilotReplayRecovery",
360
+ service: "githubCopilotReplayRecovery",
361
+ method: "get",
362
+ invocation: { kind: "direct" },
363
+ parameters: [agent],
364
+ result: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryView", ReplayRecoveryViewSchema)
365
+ },
366
+ {
367
+ id: "dsh-github-copilot:githubCopilotReplayRecovery.authorize",
368
+ namespace: "githubCopilotReplayRecovery",
369
+ service: "githubCopilotReplayRecovery",
370
+ method: "authorize",
371
+ invocation: { kind: "direct" },
372
+ parameters: [
373
+ agent,
374
+ {
375
+ name: "revision",
376
+ wire: "revision",
377
+ source: "json",
378
+ codec: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryRevision", z.string().uuid())
379
+ },
380
+ {
381
+ name: "duration",
382
+ wire: "duration",
383
+ source: "json",
384
+ codec: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryDuration", ReplayRecoveryDurationSchema)
385
+ }
386
+ ],
387
+ result: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryView", ReplayRecoveryViewSchema)
388
+ },
389
+ {
390
+ id: "dsh-github-copilot:githubCopilotReplayRecovery.setEnabled",
391
+ namespace: "githubCopilotReplayRecovery",
392
+ service: "githubCopilotReplayRecovery",
393
+ method: "setEnabled",
394
+ invocation: { kind: "direct" },
395
+ parameters: [
396
+ agent,
397
+ {
398
+ name: "revision",
399
+ wire: "revision",
400
+ source: "json",
401
+ codec: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryRevision", z.string().uuid())
402
+ },
403
+ {
404
+ name: "enabled",
405
+ wire: "enabled",
406
+ source: "json",
407
+ codec: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryEnabled", z.boolean())
408
+ }
409
+ ],
410
+ result: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryView", ReplayRecoveryViewSchema)
411
+ }
412
+ ]
384
413
  };
385
414
  //#endregion
386
415
  //#region lib/types/remote.js
@@ -3,7 +3,7 @@ import type { Agent } from '@deepseek-ai/dsh-agent';
3
3
  import type { GenerateOptions } from '@deepseek-ai/dsh-llm';
4
4
  import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
5
5
  import { ReplayRecoveryStore } from './replay-recovery.ts';
6
- import type { ReplayRecoveryView } from './replay-recovery-types.ts';
6
+ import type { ReplayRecoveryDuration, ReplayRecoveryView } from './replay-recovery-types.ts';
7
7
  declare module '@deepseek-ai/cordis' {
8
8
  interface Context {
9
9
  githubCopilotReplayRecovery: ReplayRecoveryController;
@@ -16,6 +16,7 @@ export declare class ReplayRecoveryController extends TypertRemoteService {
16
16
  constructor(ctx: Context, store: ReplayRecoveryStore, proof: () => string | undefined, busy: WeakSet<object>);
17
17
  get(agent: Agent): ReplayRecoveryView;
18
18
  setEnabled(agent: Agent, revision: string, enabled: boolean): ReplayRecoveryView;
19
+ authorize(agent: Agent, revision: string, duration: ReplayRecoveryDuration): ReplayRecoveryView;
19
20
  }
20
21
  export declare function installReplayRecovery(ctx: Context, proof: () => string | undefined): {
21
22
  prepare(request: GenerateOptions): {
@@ -1,10 +1,11 @@
1
1
  import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
2
- import type { ReplayRecoveryView } from './replay-recovery-types.ts';
2
+ import type { ReplayRecoveryDuration, ReplayRecoveryView } from './replay-recovery-types.ts';
3
3
  declare module '@deepseek-ai/dsh-typert-protocol' {
4
4
  interface TypertRemoteNamespaceMap {
5
5
  githubCopilotReplayRecovery: {
6
6
  get(agentId: string): Promise<RemoteResult<ReplayRecoveryView>>;
7
7
  setEnabled(agentId: string, revision: string, enabled: boolean): Promise<RemoteResult<ReplayRecoveryView>>;
8
+ authorize(agentId: string, revision: string, duration: ReplayRecoveryDuration): Promise<RemoteResult<ReplayRecoveryView>>;
8
9
  };
9
10
  }
10
11
  }
@@ -1,4 +1,9 @@
1
1
  import { z } from 'zod';
2
+ export declare const ReplayRecoveryDurationSchema: z.ZodEnum<{
3
+ session: "session";
4
+ "next-turn": "next-turn";
5
+ }>;
6
+ export type ReplayRecoveryDuration = z.infer<typeof ReplayRecoveryDurationSchema>;
2
7
  export declare const ReplayRecoveryViewSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
8
  state: z.ZodLiteral<"unavailable">;
4
9
  }, z.core.$strict>, z.ZodObject<{
@@ -9,6 +14,11 @@ export declare const ReplayRecoveryViewSchema: z.ZodDiscriminatedUnion<[z.ZodObj
9
14
  revision: z.ZodString;
10
15
  itemCount: z.ZodNumber;
11
16
  model: z.ZodString;
17
+ duration: z.ZodOptional<z.ZodEnum<{
18
+ session: "session";
19
+ "next-turn": "next-turn";
20
+ }>>;
21
+ expiresAt: z.ZodOptional<z.ZodNumber>;
12
22
  }, z.core.$strict>], "state">;
13
23
  export type ReplayRecoveryView = z.infer<typeof ReplayRecoveryViewSchema>;
14
24
  //# sourceMappingURL=replay-recovery-types.d.ts.map
@@ -1,5 +1,6 @@
1
1
  import type { Context } from '@deepseek-ai/cordis';
2
2
  import type { ReactElement } from 'react';
3
+ import type { ReplayRecoveryDuration } from './replay-recovery-types.ts';
3
4
  export interface ReplayRecoveryRemote {
4
5
  get(agentId: string): Promise<{
5
6
  ok: boolean;
@@ -9,11 +10,17 @@ export interface ReplayRecoveryRemote {
9
10
  ok: boolean;
10
11
  value?: unknown;
11
12
  }>;
13
+ authorize(agentId: string, revision: string, duration: ReplayRecoveryDuration): Promise<{
14
+ ok: boolean;
15
+ value?: unknown;
16
+ }>;
12
17
  }
13
- export declare function ReplayRecoveryCard({ sessionId, remote, locale }: {
18
+ export declare function ReplayRecoveryCard({ sessionId, remote, locale, running, refreshKey }: {
14
19
  sessionId: string;
15
20
  remote: ReplayRecoveryRemote;
16
21
  locale?: string;
17
- }): ReactElement;
22
+ running?: boolean;
23
+ refreshKey?: string;
24
+ }): ReactElement | null;
18
25
  export declare function registerReplayRecoveryUi(ctx: Context): () => void;
19
26
  //# sourceMappingURL=replay-recovery-ui.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { ReplayRecoveryView } from './replay-recovery-types.ts';
1
+ import type { ReplayRecoveryDuration, ReplayRecoveryView } from './replay-recovery-types.ts';
2
2
  /** Host-lifetime opt-in only. Stores fingerprints, never request bodies or opaque replay. */
3
3
  export declare class ReplayRecoveryStore {
4
4
  private readonly now;
@@ -8,7 +8,9 @@ export declare class ReplayRecoveryStore {
8
8
  view(owner: object, proof: string | undefined): ReplayRecoveryView;
9
9
  recordFailure(owner: object, proof: string, model: string, body: string | undefined): void;
10
10
  setEnabled(owner: object, proof: string | undefined, revision: string, enabled: boolean): ReplayRecoveryView;
11
- prepare(owner: object, proof: string, model: string): (payload: unknown) => unknown;
11
+ authorize(owner: object, proof: string | undefined, revision: string, duration: ReplayRecoveryDuration): ReplayRecoveryView;
12
+ endTurn(owner: object, turn: number): void;
13
+ prepare(owner: object, proof: string, model: string, turn?: number): (payload: unknown) => unknown;
12
14
  remove(owner: object): void;
13
15
  clear(): void;
14
16
  }
@@ -1,3 +1,4 @@
1
+ import type { RequestUploadEvidence } from './request-upload-evidence.ts';
1
2
  export type RequestBodyProtocol = 'openai-responses' | 'openai-completions' | 'anthropic-messages';
2
3
  export declare const REQUEST_BODY_EVIDENCE_LIMITS: Readonly<{
3
4
  bytes: number;
@@ -25,6 +26,7 @@ export interface RequestBodyDispatchEvidence {
25
26
  readonly protocol: RequestBodyProtocol;
26
27
  /** Fetch invocation to response headers, not upload duration or clone-observation time. */
27
28
  readonly responseHeadersMs: number;
29
+ readonly upload?: RequestUploadEvidence;
28
30
  }
29
31
  export declare function formatRequestBodyEvidence(evidence: RequestBodyEvidence, responseHeadersMs?: number): string;
30
32
  /** Diagnostic-only traversal of the original JSON spans; never reserializes or changes a request. */
@@ -0,0 +1,23 @@
1
+ export type RequestUploadEvidence = {
2
+ readonly state: 'observed';
3
+ readonly bodyWrite: 'observed' | 'not-observed';
4
+ readonly bodyWriteCompleteMs?: number;
5
+ readonly nativeResponseHeadersMs?: number;
6
+ readonly alpn: 'h2' | 'http/1.1' | 'unavailable';
7
+ readonly nodeWritableBufferBytes?: number;
8
+ } | {
9
+ readonly state: 'unavailable';
10
+ } | {
11
+ readonly state: 'work-limit';
12
+ } | {
13
+ readonly state: 'ambiguous';
14
+ readonly requestCount: number;
15
+ };
16
+ /** Observe public native events only; never read request fields, mutate transport or imply remote receipt. */
17
+ export declare function createRequestUploadObserver(): {
18
+ run<T>(operation: () => T): T;
19
+ snapshot(): RequestUploadEvidence;
20
+ close(): void;
21
+ };
22
+ export declare function formatRequestUploadEvidence(evidence: RequestUploadEvidence | undefined): string;
23
+ //# sourceMappingURL=request-upload-evidence.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.0-alpha.95",
4
+ "version": "0.4.0-alpha.97",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "registry": "https://registry.npmjs.org/",