dsh-github-copilot 0.4.0-alpha.105 → 0.4.0-alpha.107
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 +1 -1
- package/CHANGELOG.md +11 -0
- package/README.md +13 -9
- package/README.zh.md +13 -9
- package/deployment-baseline.json +9 -1
- package/docs/automatic-model-routing.md +29 -4
- package/docs/copilot-accounts.md +17 -1
- package/lib/client.js +477 -65
- package/lib/client.js.map +1 -1
- package/lib/index.js +232 -68
- package/lib/remote.js +43 -1
- package/lib/types/authorization-code-clipboard.d.ts +4 -0
- package/lib/types/client.d.ts +11 -3
- package/lib/types/context-evidence.d.ts +4 -4
- package/lib/types/copilot-accounts-card.d.ts +1 -0
- package/lib/types/copilot-accounts-remote.d.ts +1 -0
- package/lib/types/copilot-accounts-types.d.ts +1 -1
- package/lib/types/session-accounts-remote.d.ts +1 -0
- package/lib/types/turn-request-models.d.ts +55 -0
- package/lib/types/turn-selection-card.d.ts +10 -1
- package/lib/types/turn-selection-host.d.ts +2 -0
- package/lib/types/turn-selection-remote.d.ts +2 -0
- package/package.json +1 -1
package/lib/remote.js
CHANGED
|
@@ -342,6 +342,25 @@ const TurnSelectionSchema = z.discriminatedUnion("mode", [
|
|
|
342
342
|
}).strict()
|
|
343
343
|
]);
|
|
344
344
|
//#endregion
|
|
345
|
+
//#region lib/types/turn-request-models.js
|
|
346
|
+
const count = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
347
|
+
const route = z.object({
|
|
348
|
+
provider: z.string().trim().min(1).max(1024),
|
|
349
|
+
model: z.string().trim().min(1).max(1024)
|
|
350
|
+
}).strict();
|
|
351
|
+
const RequestedModelsSchema = z.object({
|
|
352
|
+
routes: z.array(route).max(32),
|
|
353
|
+
incomplete: z.boolean()
|
|
354
|
+
}).strict();
|
|
355
|
+
const row = RequestedModelsSchema.extend({ turn: count }).strict();
|
|
356
|
+
z.object({
|
|
357
|
+
active: z.object({
|
|
358
|
+
turn: count,
|
|
359
|
+
step: count.nullable()
|
|
360
|
+
}).strict().nullable(),
|
|
361
|
+
turns: z.array(row).max(128)
|
|
362
|
+
}).strict();
|
|
363
|
+
//#endregion
|
|
345
364
|
//#region lib/types/turn-selection-remote.js
|
|
346
365
|
const contribution$4 = {
|
|
347
366
|
package: "dsh-github-copilot",
|
|
@@ -364,6 +383,25 @@ const contribution$4 = {
|
|
|
364
383
|
codec: strictRemoteCodec("dsh-github-copilot#TurnSelectionTurn", z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER))
|
|
365
384
|
}],
|
|
366
385
|
result: strictRemoteCodec("dsh-github-copilot#TurnSelection", TurnSelectionSchema)
|
|
386
|
+
}, {
|
|
387
|
+
id: "dsh-github-copilot:githubCopilotTurnSelection.requestedModels",
|
|
388
|
+
namespace: "githubCopilotTurnSelection",
|
|
389
|
+
service: "githubCopilotTurnSelection",
|
|
390
|
+
method: "requestedModels",
|
|
391
|
+
invocation: { kind: "direct" },
|
|
392
|
+
parameters: [{
|
|
393
|
+
name: "agent",
|
|
394
|
+
wire: "agentId",
|
|
395
|
+
source: "lookup",
|
|
396
|
+
lookup: "agent",
|
|
397
|
+
codec: strictRemoteCodec("@deepseek-ai/dsh-session/types#SessionId", z.string().min(1).max(256))
|
|
398
|
+
}, {
|
|
399
|
+
name: "turn",
|
|
400
|
+
wire: "turn",
|
|
401
|
+
source: "json",
|
|
402
|
+
codec: strictRemoteCodec("dsh-github-copilot#TurnSelectionTurn", z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER))
|
|
403
|
+
}],
|
|
404
|
+
result: strictRemoteCodec("dsh-github-copilot#RequestedModels", RequestedModelsSchema)
|
|
367
405
|
}]
|
|
368
406
|
};
|
|
369
407
|
//#endregion
|
|
@@ -469,7 +507,11 @@ const CopilotAccountsViewSchema = z.object({
|
|
|
469
507
|
userId: z.number().int().positive().max(Number.MAX_SAFE_INTEGER)
|
|
470
508
|
}).strict().optional()
|
|
471
509
|
}).strict()).max(32),
|
|
472
|
-
operation: z.enum([
|
|
510
|
+
operation: z.enum([
|
|
511
|
+
"authorizing",
|
|
512
|
+
"verifying",
|
|
513
|
+
"switching"
|
|
514
|
+
]).optional(),
|
|
473
515
|
notices: z.array(z.object({
|
|
474
516
|
message: z.string().min(1).max(512),
|
|
475
517
|
url: z.literal("https://github.com/login/device").optional(),
|
package/lib/types/client.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export { HostedSearchSettingsCard, WebSearchRoutingCard } from './web-search-rou
|
|
|
11
11
|
export { ParentModelFollowCard } from './parent-model-follow-card.ts';
|
|
12
12
|
export { CopilotUsageCard } from './copilot-usage-card.ts';
|
|
13
13
|
import type { CopilotAccountsRemote } from './copilot-accounts-card.ts';
|
|
14
|
+
import { copyAuthorizationCode } from './authorization-code-clipboard.ts';
|
|
15
|
+
export { copyAuthorizationCode };
|
|
14
16
|
export { GitHubCopilotModelPreferencesPanel } from './model-preferences-card.ts';
|
|
15
17
|
export declare const inject: string[];
|
|
16
18
|
interface GitHubCopilotProviderCardProps extends ProviderCardExtrasOwnerProps {
|
|
@@ -18,6 +20,13 @@ interface GitHubCopilotProviderCardProps extends ProviderCardExtrasOwnerProps {
|
|
|
18
20
|
}
|
|
19
21
|
interface GitHubCopilotSettingsSectionProps extends SettingsSectionOwnerProps {
|
|
20
22
|
readonly remote: ClientContext['remote']['githubCopilot'];
|
|
23
|
+
readonly locale?: string;
|
|
24
|
+
}
|
|
25
|
+
interface LocaleReader {
|
|
26
|
+
getLocale(): {
|
|
27
|
+
active: string;
|
|
28
|
+
};
|
|
29
|
+
subscribe(listener: () => void): () => void;
|
|
21
30
|
}
|
|
22
31
|
/** Older Remote clients may not decode results: project known fields before validating our own copy. */
|
|
23
32
|
export declare function authorizationViewFrom(value: unknown): GitHubCopilotAuthorizationView | undefined;
|
|
@@ -26,10 +35,7 @@ export declare function catalogWarningOf(status: GitHubCopilotAuthorizationView
|
|
|
26
35
|
export declare function previewAssignmentMessage(status: GitHubCopilotAuthorizationView | undefined): string | undefined;
|
|
27
36
|
export declare function routeStatusMessage(status: GitHubCopilotAuthorizationView | undefined): string | undefined;
|
|
28
37
|
export declare function activeAuthorizationNotice(status: GitHubCopilotAuthorizationView | undefined): GitHubCopilotAuthorizationView['notices'][number] | undefined;
|
|
29
|
-
type ClipboardWriter = Pick<Clipboard, 'writeText'>;
|
|
30
38
|
type CopyState = 'idle' | 'copying' | 'copied' | 'failed';
|
|
31
|
-
/** Copy a one-time authorization code through the browser clipboard boundary. */
|
|
32
|
-
export declare function copyAuthorizationCode(code: string, clipboard?: ClipboardWriter): Promise<void>;
|
|
33
39
|
interface AuthorizationNoticeProps {
|
|
34
40
|
readonly message: string;
|
|
35
41
|
readonly url?: string;
|
|
@@ -66,6 +72,7 @@ export declare function GitHubCopilotAccountModelsPanel(props: {
|
|
|
66
72
|
interface GitHubCopilotPreviewFooterProps {
|
|
67
73
|
readonly remote: ClientContext['remote']['githubCopilot'];
|
|
68
74
|
readonly accountsRemote?: CopilotAccountsRemote;
|
|
75
|
+
readonly locale?: string;
|
|
69
76
|
/** A slot coordinator owns this controller's attachment across surface handoffs. */
|
|
70
77
|
readonly account?: ReturnType<typeof createCompactAccount>;
|
|
71
78
|
readonly embedded?: boolean;
|
|
@@ -103,6 +110,7 @@ export declare function GitHubCopilotAccountSurface(props: GitHubCopilotPreviewF
|
|
|
103
110
|
readonly surfaces: ReturnType<typeof createAccountSurfaces>;
|
|
104
111
|
readonly seat: AccountSurfaceSeat;
|
|
105
112
|
readonly eligible?: boolean;
|
|
113
|
+
readonly localeReader?: LocaleReader;
|
|
106
114
|
}): ReactElement | null;
|
|
107
115
|
/** Unified fallback when the Models footer extension is absent or incompatible. */
|
|
108
116
|
export declare function GitHubCopilotSettingsSection(props: GitHubCopilotSettingsSectionProps): ReturnType<typeof createElement>;
|
|
@@ -19,8 +19,8 @@ export declare const ContextEvidenceSchema: z.ZodObject<{
|
|
|
19
19
|
none: "none";
|
|
20
20
|
compaction: "compaction";
|
|
21
21
|
unknown: "unknown";
|
|
22
|
-
selection: "selection";
|
|
23
22
|
"failed-zero": "failed-zero";
|
|
23
|
+
selection: "selection";
|
|
24
24
|
}>;
|
|
25
25
|
}, z.core.$strict>;
|
|
26
26
|
export type ContextEvidence = z.infer<typeof ContextEvidenceSchema>;
|
|
@@ -57,8 +57,8 @@ export declare const contextEvidenceDefinition: {
|
|
|
57
57
|
none: "none";
|
|
58
58
|
compaction: "compaction";
|
|
59
59
|
unknown: "unknown";
|
|
60
|
-
selection: "selection";
|
|
61
60
|
"failed-zero": "failed-zero";
|
|
61
|
+
selection: "selection";
|
|
62
62
|
}>;
|
|
63
63
|
}, z.core.$strict>;
|
|
64
64
|
init: typeof initialContextEvidence;
|
|
@@ -82,8 +82,8 @@ export declare const contextEvidenceDefinition: {
|
|
|
82
82
|
none: "none";
|
|
83
83
|
compaction: "compaction";
|
|
84
84
|
unknown: "unknown";
|
|
85
|
-
selection: "selection";
|
|
86
85
|
"failed-zero": "failed-zero";
|
|
86
|
+
selection: "selection";
|
|
87
87
|
}>;
|
|
88
88
|
}, z.core.$strict>;
|
|
89
89
|
view: (state: ContextEvidence) => {
|
|
@@ -100,7 +100,7 @@ export declare const contextEvidenceDefinition: {
|
|
|
100
100
|
};
|
|
101
101
|
} | null;
|
|
102
102
|
invalid: boolean;
|
|
103
|
-
reason: "none" | "compaction" | "unknown" | "
|
|
103
|
+
reason: "none" | "compaction" | "unknown" | "failed-zero" | "selection";
|
|
104
104
|
};
|
|
105
105
|
};
|
|
106
106
|
};
|
|
@@ -25,7 +25,7 @@ export interface CopilotAccountsView {
|
|
|
25
25
|
readonly writable: boolean;
|
|
26
26
|
readonly switchable: boolean;
|
|
27
27
|
readonly accounts: readonly CopilotAccountView[];
|
|
28
|
-
readonly operation?: 'authorizing' | 'switching';
|
|
28
|
+
readonly operation?: 'authorizing' | 'verifying' | 'switching';
|
|
29
29
|
readonly notices: readonly CopilotAccountsNotice[];
|
|
30
30
|
readonly diagnostic?: CopilotAccountsDiagnostic;
|
|
31
31
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
export declare const TURN_REQUEST_MODELS = "githubCopilotTurnRequestModels";
|
|
4
|
+
export declare const RequestedModelsSchema: z.ZodObject<{
|
|
5
|
+
routes: z.ZodArray<z.ZodObject<{
|
|
6
|
+
provider: z.ZodString;
|
|
7
|
+
model: z.ZodString;
|
|
8
|
+
}, z.core.$strict>>;
|
|
9
|
+
incomplete: z.ZodBoolean;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
export type RequestedModels = z.infer<typeof RequestedModelsSchema>;
|
|
12
|
+
export declare const TurnRequestModelsStateSchema: z.ZodObject<{
|
|
13
|
+
active: z.ZodNullable<z.ZodObject<{
|
|
14
|
+
turn: z.ZodNumber;
|
|
15
|
+
step: z.ZodNullable<z.ZodNumber>;
|
|
16
|
+
}, z.core.$strict>>;
|
|
17
|
+
turns: z.ZodArray<z.ZodObject<{
|
|
18
|
+
routes: z.ZodArray<z.ZodObject<{
|
|
19
|
+
provider: z.ZodString;
|
|
20
|
+
model: z.ZodString;
|
|
21
|
+
}, z.core.$strict>>;
|
|
22
|
+
incomplete: z.ZodBoolean;
|
|
23
|
+
turn: z.ZodNumber;
|
|
24
|
+
}, z.core.$strict>>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
type State = z.infer<typeof TurnRequestModelsStateSchema>;
|
|
27
|
+
declare module '@deepseek-ai/dsh-session-projection/types' {
|
|
28
|
+
interface SessionProjectionStateMap {
|
|
29
|
+
githubCopilotTurnRequestModels: State;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export declare function foldTurnRequestModels(state: State, event: unknown): State;
|
|
33
|
+
export declare const turnRequestModelsDefinition: {
|
|
34
|
+
key: "githubCopilotTurnRequestModels";
|
|
35
|
+
stateVersion: number;
|
|
36
|
+
stateSchema: z.ZodObject<{
|
|
37
|
+
active: z.ZodNullable<z.ZodObject<{
|
|
38
|
+
turn: z.ZodNumber;
|
|
39
|
+
step: z.ZodNullable<z.ZodNumber>;
|
|
40
|
+
}, z.core.$strict>>;
|
|
41
|
+
turns: z.ZodArray<z.ZodObject<{
|
|
42
|
+
routes: z.ZodArray<z.ZodObject<{
|
|
43
|
+
provider: z.ZodString;
|
|
44
|
+
model: z.ZodString;
|
|
45
|
+
}, z.core.$strict>>;
|
|
46
|
+
incomplete: z.ZodBoolean;
|
|
47
|
+
turn: z.ZodNumber;
|
|
48
|
+
}, z.core.$strict>>;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
init: () => State;
|
|
51
|
+
apply: typeof foldTurnRequestModels;
|
|
52
|
+
};
|
|
53
|
+
export declare function installTurnRequestModels(ctx: Context): void;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=turn-request-models.d.ts.map
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { TurnSelection } from './turn-selection.ts';
|
|
3
3
|
import type { TurnAccountView } from './session-accounts-remote.ts';
|
|
4
|
-
|
|
4
|
+
import type { RecordedModel } from './turn-model-provenance.ts';
|
|
5
|
+
export interface TurnModelEvidence {
|
|
6
|
+
readonly kind: 'recorded' | 'requested' | 'unknown';
|
|
7
|
+
readonly routes: readonly RecordedModel[];
|
|
8
|
+
readonly incomplete: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function TurnSelectionCard({ selection, locale, incomplete, readState, retry, account, accountFailed, retryAccount, models, modelsFailed, retryModels }: {
|
|
5
11
|
selection: TurnSelection;
|
|
6
12
|
locale?: string;
|
|
7
13
|
incomplete?: boolean;
|
|
@@ -10,5 +16,8 @@ export declare function TurnSelectionCard({ selection, locale, incomplete, readS
|
|
|
10
16
|
account?: TurnAccountView;
|
|
11
17
|
accountFailed?: boolean;
|
|
12
18
|
retryAccount?: () => void;
|
|
19
|
+
models?: TurnModelEvidence;
|
|
20
|
+
modelsFailed?: boolean;
|
|
21
|
+
retryModels?: () => void;
|
|
13
22
|
}): ReactElement;
|
|
14
23
|
//# sourceMappingURL=turn-selection-card.d.ts.map
|
|
@@ -2,10 +2,12 @@ import type { Context } from '@deepseek-ai/cordis';
|
|
|
2
2
|
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
3
|
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
4
4
|
import type { TurnSelection, TurnSelectionStore } from './turn-selection.ts';
|
|
5
|
+
import type { RequestedModels } from './turn-request-models.ts';
|
|
5
6
|
/** Public Host binding for the existing bounded, runtime-only decision store. */
|
|
6
7
|
export declare class TurnSelectionController extends TypertRemoteService {
|
|
7
8
|
private readonly selections;
|
|
8
9
|
constructor(ctx: Context, selections: TurnSelectionStore);
|
|
9
10
|
get(agent: Agent, turn: number): TurnSelection;
|
|
11
|
+
requestedModels(agent: Agent, turn: number): RequestedModels;
|
|
10
12
|
}
|
|
11
13
|
//# sourceMappingURL=turn-selection-host.d.ts.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
2
2
|
import type { TurnSelection } from './turn-selection.ts';
|
|
3
|
+
import type { RequestedModels } from './turn-request-models.ts';
|
|
3
4
|
export { TurnSelectionSchema } from './turn-selection.ts';
|
|
4
5
|
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
5
6
|
interface TypertRemoteNamespaceMap {
|
|
6
7
|
githubCopilotTurnSelection: {
|
|
7
8
|
get(agentId: string, turn: number): Promise<RemoteResult<TurnSelection>>;
|
|
9
|
+
requestedModels(agentId: string, turn: number): Promise<RemoteResult<RequestedModels>>;
|
|
8
10
|
};
|
|
9
11
|
}
|
|
10
12
|
}
|
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.107",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|