dsh-github-copilot 0.4.0-alpha.91 → 0.4.0-alpha.93
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/AGENTS.md +2 -0
- package/CHANGELOG.md +10 -0
- package/README.md +7 -7
- package/README.zh.md +7 -7
- package/deployment-baseline.json +22 -1
- package/docs/model-compatibility-acceptance.md +54 -0
- package/lib/client.js +326 -124
- package/lib/client.js.map +1 -1
- package/lib/index.js +739 -423
- package/lib/remote.js +56 -4
- package/lib/types/preview-provider.d.ts +4 -0
- package/lib/types/replay-recovery-host.d.ts +27 -0
- package/lib/types/replay-recovery-remote.d.ts +13 -0
- package/lib/types/replay-recovery-types.d.ts +14 -0
- package/lib/types/replay-recovery-ui.d.ts +19 -0
- package/lib/types/replay-recovery.d.ts +15 -0
- package/lib/types/responses-replay-compat.d.ts +7 -2
- package/package.json +1 -1
package/lib/remote.js
CHANGED
|
@@ -43,7 +43,7 @@ const DualModelCreateSchema = z.object({
|
|
|
43
43
|
expectedRevision: revision
|
|
44
44
|
}).strict();
|
|
45
45
|
const DualModelCreateResultSchema = z.object({ sessionId: id }).strict();
|
|
46
|
-
const contribution$
|
|
46
|
+
const contribution$5 = {
|
|
47
47
|
package: "dsh-github-copilot",
|
|
48
48
|
descriptors: [
|
|
49
49
|
{
|
|
@@ -85,7 +85,7 @@ const contribution$4 = {
|
|
|
85
85
|
}
|
|
86
86
|
]
|
|
87
87
|
};
|
|
88
|
-
const contribution$
|
|
88
|
+
const contribution$4 = {
|
|
89
89
|
package: "dsh-github-copilot",
|
|
90
90
|
descriptors: [{
|
|
91
91
|
id: "dsh-github-copilot:githubCopilotSearchRouting.providers",
|
|
@@ -181,7 +181,7 @@ const CopilotUsageViewSchema = z.object({
|
|
|
181
181
|
if (view.remaining !== void 0 && view.percentUsed !== void 0 && Math.abs((1 - view.remaining / view.limit) * 100 - view.percentUsed) > 1) invalid();
|
|
182
182
|
}
|
|
183
183
|
});
|
|
184
|
-
const contribution$
|
|
184
|
+
const contribution$3 = {
|
|
185
185
|
package: "dsh-github-copilot",
|
|
186
186
|
descriptors: ["get", "refresh"].map((method) => ({
|
|
187
187
|
id: `dsh-github-copilot:githubCopilotUsage.${method}`,
|
|
@@ -308,7 +308,7 @@ const TurnSelectionSchema = z.discriminatedUnion("mode", [
|
|
|
308
308
|
]);
|
|
309
309
|
//#endregion
|
|
310
310
|
//#region lib/types/turn-selection-remote.js
|
|
311
|
-
const contribution$
|
|
311
|
+
const contribution$2 = {
|
|
312
312
|
package: "dsh-github-copilot",
|
|
313
313
|
descriptors: [{
|
|
314
314
|
id: "dsh-github-copilot:githubCopilotTurnSelection.get",
|
|
@@ -332,6 +332,57 @@ const contribution$1 = {
|
|
|
332
332
|
}]
|
|
333
333
|
};
|
|
334
334
|
//#endregion
|
|
335
|
+
//#region lib/types/replay-recovery-types.js
|
|
336
|
+
const ReplayRecoveryViewSchema = z.discriminatedUnion("state", [z.object({ state: z.literal("unavailable") }).strict(), z.object({
|
|
337
|
+
state: z.enum(["available", "enabled"]),
|
|
338
|
+
revision: z.string().uuid(),
|
|
339
|
+
itemCount: z.number().int().positive().max(512),
|
|
340
|
+
model: z.string().min(1).max(256)
|
|
341
|
+
}).strict()]);
|
|
342
|
+
//#endregion
|
|
343
|
+
//#region lib/types/replay-recovery-remote.js
|
|
344
|
+
const agent = {
|
|
345
|
+
name: "agent",
|
|
346
|
+
wire: "agentId",
|
|
347
|
+
source: "lookup",
|
|
348
|
+
lookup: "agent",
|
|
349
|
+
codec: strictRemoteCodec("@deepseek-ai/dsh-session/types#SessionId", z.string().min(1).max(256))
|
|
350
|
+
};
|
|
351
|
+
const contribution$1 = {
|
|
352
|
+
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
|
+
}]
|
|
384
|
+
};
|
|
385
|
+
//#endregion
|
|
335
386
|
//#region lib/types/remote.js
|
|
336
387
|
/**
|
|
337
388
|
* Client-safe Remote contribution for the plugin-owned authorization bridge.
|
|
@@ -540,6 +591,7 @@ const contribution = {
|
|
|
540
591
|
parameters: [],
|
|
541
592
|
result: strictRemoteCodec(GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL, GitHubCopilotMigrationStatusSchema)
|
|
542
593
|
},
|
|
594
|
+
...contribution$5.descriptors,
|
|
543
595
|
...contribution$4.descriptors,
|
|
544
596
|
...contribution$3.descriptors,
|
|
545
597
|
...contribution$2.descriptors,
|
|
@@ -35,6 +35,10 @@ export interface PreviewProviderGuard {
|
|
|
35
35
|
}
|
|
36
36
|
/** Guard for one selected model in an account-bound descriptor snapshot. */
|
|
37
37
|
export interface AccountProviderGuard extends PreviewProviderGuard {
|
|
38
|
+
/** Explicit, request-admitted recovery; absent by default. */
|
|
39
|
+
recoverReplay?(payload: unknown): unknown;
|
|
40
|
+
/** Only exact verified scope HTTP failures may offer recovery evidence. */
|
|
41
|
+
onReplayScopeRejected?(body: string | undefined): void;
|
|
38
42
|
readonly selectedModelId?: string;
|
|
39
43
|
readonly retryReplay?: ResponsesRetryReplay;
|
|
40
44
|
readonly retrySignal?: AbortSignal;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { GenerateOptions } from '@deepseek-ai/dsh-llm';
|
|
4
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
5
|
+
import { ReplayRecoveryStore } from './replay-recovery.ts';
|
|
6
|
+
import type { ReplayRecoveryView } from './replay-recovery-types.ts';
|
|
7
|
+
declare module '@deepseek-ai/cordis' {
|
|
8
|
+
interface Context {
|
|
9
|
+
githubCopilotReplayRecovery: ReplayRecoveryController;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare class ReplayRecoveryController extends TypertRemoteService {
|
|
13
|
+
private readonly store;
|
|
14
|
+
private readonly proof;
|
|
15
|
+
private readonly busy;
|
|
16
|
+
constructor(ctx: Context, store: ReplayRecoveryStore, proof: () => string | undefined, busy: WeakSet<object>);
|
|
17
|
+
get(agent: Agent): ReplayRecoveryView;
|
|
18
|
+
setEnabled(agent: Agent, revision: string, enabled: boolean): ReplayRecoveryView;
|
|
19
|
+
}
|
|
20
|
+
export declare function installReplayRecovery(ctx: Context, proof: () => string | undefined): {
|
|
21
|
+
prepare(request: GenerateOptions): {
|
|
22
|
+
transform(payload: unknown): unknown;
|
|
23
|
+
rejected(body: string | undefined): void;
|
|
24
|
+
} | undefined;
|
|
25
|
+
dispose(): void;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=replay-recovery-host.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
2
|
+
import type { ReplayRecoveryView } from './replay-recovery-types.ts';
|
|
3
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
4
|
+
interface TypertRemoteNamespaceMap {
|
|
5
|
+
githubCopilotReplayRecovery: {
|
|
6
|
+
get(agentId: string): Promise<RemoteResult<ReplayRecoveryView>>;
|
|
7
|
+
setEnabled(agentId: string, revision: string, enabled: boolean): Promise<RemoteResult<ReplayRecoveryView>>;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
declare const contribution: TypertRemoteContribution;
|
|
12
|
+
export default contribution;
|
|
13
|
+
//# sourceMappingURL=replay-recovery-remote.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ReplayRecoveryViewSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
state: z.ZodLiteral<"unavailable">;
|
|
4
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
5
|
+
state: z.ZodEnum<{
|
|
6
|
+
enabled: "enabled";
|
|
7
|
+
available: "available";
|
|
8
|
+
}>;
|
|
9
|
+
revision: z.ZodString;
|
|
10
|
+
itemCount: z.ZodNumber;
|
|
11
|
+
model: z.ZodString;
|
|
12
|
+
}, z.core.$strict>], "state">;
|
|
13
|
+
export type ReplayRecoveryView = z.infer<typeof ReplayRecoveryViewSchema>;
|
|
14
|
+
//# sourceMappingURL=replay-recovery-types.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
export interface ReplayRecoveryRemote {
|
|
4
|
+
get(agentId: string): Promise<{
|
|
5
|
+
ok: boolean;
|
|
6
|
+
value?: unknown;
|
|
7
|
+
}>;
|
|
8
|
+
setEnabled(agentId: string, revision: string, enabled: boolean): Promise<{
|
|
9
|
+
ok: boolean;
|
|
10
|
+
value?: unknown;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export declare function ReplayRecoveryCard({ sessionId, remote, locale }: {
|
|
14
|
+
sessionId: string;
|
|
15
|
+
remote: ReplayRecoveryRemote;
|
|
16
|
+
locale?: string;
|
|
17
|
+
}): ReactElement;
|
|
18
|
+
export declare function registerReplayRecoveryUi(ctx: Context): () => void;
|
|
19
|
+
//# sourceMappingURL=replay-recovery-ui.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReplayRecoveryView } from './replay-recovery-types.ts';
|
|
2
|
+
/** Host-lifetime opt-in only. Stores fingerprints, never request bodies or opaque replay. */
|
|
3
|
+
export declare class ReplayRecoveryStore {
|
|
4
|
+
private readonly now;
|
|
5
|
+
private readonly owners;
|
|
6
|
+
constructor(now?: () => number);
|
|
7
|
+
private current;
|
|
8
|
+
view(owner: object, proof: string | undefined): ReplayRecoveryView;
|
|
9
|
+
recordFailure(owner: object, proof: string, model: string, body: string | undefined): void;
|
|
10
|
+
setEnabled(owner: object, proof: string | undefined, revision: string, enabled: boolean): ReplayRecoveryView;
|
|
11
|
+
prepare(owner: object, proof: string, model: string): (payload: unknown) => unknown;
|
|
12
|
+
remove(owner: object): void;
|
|
13
|
+
clear(): void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=replay-recovery.d.ts.map
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
type ReplayFailure = 'scope-mismatch' | 'unsupported' | 'invalid-payload';
|
|
2
|
-
|
|
2
|
+
interface ReplayDispatch {
|
|
3
|
+
readonly body?: string;
|
|
4
|
+
readonly sessionHeader?: boolean;
|
|
5
|
+
readonly clientRequestHeader?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Fixed diagnostics and bounded counts only; never retain request or replay content. */
|
|
3
8
|
export declare class CopilotResponsesReplayError extends Error {
|
|
4
|
-
constructor(reason?: ReplayFailure);
|
|
9
|
+
constructor(reason?: ReplayFailure, dispatch?: ReplayDispatch);
|
|
5
10
|
}
|
|
6
11
|
/** Normalize only the outgoing managed Responses payload, never stored history/context. */
|
|
7
12
|
export declare function normalizeCopilotResponsesPayload(payload: unknown): unknown;
|
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.
|
|
4
|
+
"version": "0.4.0-alpha.93",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|