dsh-github-copilot 0.4.0-alpha.104 → 0.4.0-alpha.106
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 +3 -1
- package/CHANGELOG.md +12 -0
- package/README.md +10 -6
- package/README.zh.md +10 -6
- package/deployment-baseline.json +12 -1
- package/docs/automatic-model-routing.md +29 -4
- package/docs/copilot-accounts.md +21 -3
- package/lib/client.js +201 -28
- package/lib/client.js.map +1 -1
- package/lib/index.js +370 -94
- package/lib/remote.js +46 -0
- package/lib/types/context-evidence.d.ts +4 -4
- package/lib/types/copilot-accounts-card.d.ts +1 -0
- package/lib/types/copilot-accounts-host.d.ts +8 -0
- package/lib/types/copilot-accounts-remote.d.ts +7 -0
- package/lib/types/copilot-accounts-types.d.ts +1 -1
- package/lib/types/copilot-usage-card.d.ts +1 -1
- package/lib/types/session-accounts-controller.d.ts +2 -0
- package/lib/types/session-accounts-remote.d.ts +7 -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
|
@@ -143,6 +143,12 @@ const COPILOT_ACCOUNTS_DIAGNOSTICS = [
|
|
|
143
143
|
"COPILOT_ACCOUNTS_MODELS_FAILED",
|
|
144
144
|
"COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE",
|
|
145
145
|
"COPILOT_ACCOUNTS_IDENTITY_INVALID",
|
|
146
|
+
"COPILOT_ACCOUNTS_IDENTITY_TIMEOUT",
|
|
147
|
+
"COPILOT_ACCOUNTS_IDENTITY_TLS",
|
|
148
|
+
"COPILOT_ACCOUNTS_IDENTITY_NETWORK",
|
|
149
|
+
"COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED",
|
|
150
|
+
"COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED",
|
|
151
|
+
"COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR",
|
|
146
152
|
"COPILOT_ACCOUNTS_IDENTITY_CHANGED",
|
|
147
153
|
"COPILOT_ACCOUNTS_DUPLICATE",
|
|
148
154
|
"COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED",
|
|
@@ -336,6 +342,25 @@ const TurnSelectionSchema = z.discriminatedUnion("mode", [
|
|
|
336
342
|
}).strict()
|
|
337
343
|
]);
|
|
338
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
|
|
339
364
|
//#region lib/types/turn-selection-remote.js
|
|
340
365
|
const contribution$4 = {
|
|
341
366
|
package: "dsh-github-copilot",
|
|
@@ -358,6 +383,25 @@ const contribution$4 = {
|
|
|
358
383
|
codec: strictRemoteCodec("dsh-github-copilot#TurnSelectionTurn", z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER))
|
|
359
384
|
}],
|
|
360
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)
|
|
361
405
|
}]
|
|
362
406
|
};
|
|
363
407
|
//#endregion
|
|
@@ -489,6 +533,7 @@ const contribution$2 = {
|
|
|
489
533
|
descriptors: [
|
|
490
534
|
"get",
|
|
491
535
|
"refreshIdentity",
|
|
536
|
+
"ensureIdentity",
|
|
492
537
|
"add",
|
|
493
538
|
"cancel",
|
|
494
539
|
"switchAccount",
|
|
@@ -542,6 +587,7 @@ const contribution$1 = {
|
|
|
542
587
|
"get",
|
|
543
588
|
"set",
|
|
544
589
|
"refreshIdentity",
|
|
590
|
+
"ensureIdentity",
|
|
545
591
|
"usage",
|
|
546
592
|
"refreshUsage",
|
|
547
593
|
"turn"
|
|
@@ -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
|
};
|
|
@@ -10,6 +10,7 @@ type AccountResult = {
|
|
|
10
10
|
export interface CopilotAccountsRemote {
|
|
11
11
|
get(): Promise<AccountResult>;
|
|
12
12
|
refreshIdentity(): Promise<AccountResult>;
|
|
13
|
+
ensureIdentity(): Promise<AccountResult>;
|
|
13
14
|
add(): Promise<AccountResult>;
|
|
14
15
|
cancel(): Promise<AccountResult>;
|
|
15
16
|
switchAccount(accountId: string, expectedRevision: number): Promise<AccountResult>;
|
|
@@ -18,6 +18,8 @@ export declare class CopilotAccountsHost {
|
|
|
18
18
|
private readonly accountLeases;
|
|
19
19
|
private readonly identities;
|
|
20
20
|
private readonly unavailableIdentities;
|
|
21
|
+
private readonly identityFlights;
|
|
22
|
+
private readonly identityFailures;
|
|
21
23
|
private readonly listeners;
|
|
22
24
|
private readonly abort;
|
|
23
25
|
private operation;
|
|
@@ -32,6 +34,7 @@ export declare class CopilotAccountsHost {
|
|
|
32
34
|
selectionChanged(): void;
|
|
33
35
|
isActiveRecord(key: string): boolean;
|
|
34
36
|
credentialChanged(key: string): void;
|
|
37
|
+
private invalidateIdentity;
|
|
35
38
|
onChanged(listener: () => void): () => void;
|
|
36
39
|
cachedIdentity(accountId: string): CopilotAccountIdentity | undefined;
|
|
37
40
|
capture(accountId?: string): CopilotAccountBinding;
|
|
@@ -47,9 +50,13 @@ export declare class CopilotAccountsHost {
|
|
|
47
50
|
private accountView;
|
|
48
51
|
private identity;
|
|
49
52
|
private fetchIdentity;
|
|
53
|
+
private fetchIdentityResponse;
|
|
50
54
|
refreshIdentity(): Promise<CopilotAccountsView>;
|
|
55
|
+
ensureIdentity(): Promise<CopilotAccountsView>;
|
|
51
56
|
viewForAccount(accountId: string): Promise<CopilotAccountsView>;
|
|
52
57
|
refreshIdentityFor(accountId: string): Promise<CopilotAccountsView>;
|
|
58
|
+
ensureIdentityFor(accountId: string): Promise<CopilotAccountsView>;
|
|
59
|
+
private readIdentity;
|
|
53
60
|
private validateModels;
|
|
54
61
|
private assertIdentityCurrent;
|
|
55
62
|
switchAccount(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
|
|
@@ -73,6 +80,7 @@ export default class GitHubCopilotAccountsController extends TypertRemoteService
|
|
|
73
80
|
constructor(ctx: Context);
|
|
74
81
|
get(): Promise<CopilotAccountsView>;
|
|
75
82
|
refreshIdentity(): Promise<CopilotAccountsView>;
|
|
83
|
+
ensureIdentity(): Promise<CopilotAccountsView>;
|
|
76
84
|
add(): Promise<CopilotAccountsView>;
|
|
77
85
|
cancel(): Promise<CopilotAccountsView>;
|
|
78
86
|
reauthorize(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
|
|
@@ -7,6 +7,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
7
7
|
githubCopilotAccounts: {
|
|
8
8
|
get(): Promise<RemoteResult<CopilotAccountsView>>;
|
|
9
9
|
refreshIdentity(): Promise<RemoteResult<CopilotAccountsView>>;
|
|
10
|
+
ensureIdentity(): Promise<RemoteResult<CopilotAccountsView>>;
|
|
10
11
|
add(): Promise<RemoteResult<CopilotAccountsView>>;
|
|
11
12
|
cancel(): Promise<RemoteResult<CopilotAccountsView>>;
|
|
12
13
|
reauthorize(accountId: string, expectedRevision: number): Promise<RemoteResult<CopilotAccountsView>>;
|
|
@@ -59,6 +60,12 @@ export declare const CopilotAccountsViewSchema: z.ZodObject<{
|
|
|
59
60
|
COPILOT_ACCOUNTS_MODELS_FAILED: "COPILOT_ACCOUNTS_MODELS_FAILED";
|
|
60
61
|
COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE: "COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE";
|
|
61
62
|
COPILOT_ACCOUNTS_IDENTITY_INVALID: "COPILOT_ACCOUNTS_IDENTITY_INVALID";
|
|
63
|
+
COPILOT_ACCOUNTS_IDENTITY_TIMEOUT: "COPILOT_ACCOUNTS_IDENTITY_TIMEOUT";
|
|
64
|
+
COPILOT_ACCOUNTS_IDENTITY_TLS: "COPILOT_ACCOUNTS_IDENTITY_TLS";
|
|
65
|
+
COPILOT_ACCOUNTS_IDENTITY_NETWORK: "COPILOT_ACCOUNTS_IDENTITY_NETWORK";
|
|
66
|
+
COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED: "COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED";
|
|
67
|
+
COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED: "COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED";
|
|
68
|
+
COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR: "COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR";
|
|
62
69
|
COPILOT_ACCOUNTS_IDENTITY_CHANGED: "COPILOT_ACCOUNTS_IDENTITY_CHANGED";
|
|
63
70
|
COPILOT_ACCOUNTS_DUPLICATE: "COPILOT_ACCOUNTS_DUPLICATE";
|
|
64
71
|
COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED: "COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const COPILOT_ACCOUNT_ID_PATTERN: RegExp;
|
|
2
2
|
export declare const COPILOT_ACCOUNTS_MAX = 32;
|
|
3
3
|
export declare const GITHUB_ACCOUNT_LOGIN_PATTERN: RegExp;
|
|
4
|
-
export declare const COPILOT_ACCOUNTS_DIAGNOSTICS: readonly ["COPILOT_ACCOUNTS_SELECTOR_INVALID", "COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE", "COPILOT_ACCOUNTS_SELECTED_MISSING", "COPILOT_ACCOUNTS_CREDENTIALS_UNAVAILABLE", "COPILOT_ACCOUNTS_CHANGED", "COPILOT_ACCOUNTS_BUSY", "COPILOT_ACCOUNTS_CONFLICT", "COPILOT_ACCOUNTS_COMMIT_UNCERTAIN", "COPILOT_ACCOUNTS_MODELS_FAILED", "COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE", "COPILOT_ACCOUNTS_IDENTITY_INVALID", "COPILOT_ACCOUNTS_IDENTITY_CHANGED", "COPILOT_ACCOUNTS_DUPLICATE", "COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED", "COPILOT_ACCOUNTS_ROUTE_BLOCKED", "COPILOT_ACCOUNTS_EVIDENCE_INCOMPLETE", "COPILOT_ACCOUNTS_LIMIT", "COPILOT_ACCOUNTS_AUTH_FAILED", "COPILOT_ACCOUNTS_AUTH_UNAVAILABLE", "COPILOT_ACCOUNTS_ACTIVE_REMOVE_BLOCKED", "COPILOT_ACCOUNTS_REMOVE_FAILED", "COPILOT_ACCOUNTS_DISPOSED"];
|
|
4
|
+
export declare const COPILOT_ACCOUNTS_DIAGNOSTICS: readonly ["COPILOT_ACCOUNTS_SELECTOR_INVALID", "COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE", "COPILOT_ACCOUNTS_SELECTED_MISSING", "COPILOT_ACCOUNTS_CREDENTIALS_UNAVAILABLE", "COPILOT_ACCOUNTS_CHANGED", "COPILOT_ACCOUNTS_BUSY", "COPILOT_ACCOUNTS_CONFLICT", "COPILOT_ACCOUNTS_COMMIT_UNCERTAIN", "COPILOT_ACCOUNTS_MODELS_FAILED", "COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE", "COPILOT_ACCOUNTS_IDENTITY_INVALID", "COPILOT_ACCOUNTS_IDENTITY_TIMEOUT", "COPILOT_ACCOUNTS_IDENTITY_TLS", "COPILOT_ACCOUNTS_IDENTITY_NETWORK", "COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED", "COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED", "COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR", "COPILOT_ACCOUNTS_IDENTITY_CHANGED", "COPILOT_ACCOUNTS_DUPLICATE", "COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED", "COPILOT_ACCOUNTS_ROUTE_BLOCKED", "COPILOT_ACCOUNTS_EVIDENCE_INCOMPLETE", "COPILOT_ACCOUNTS_LIMIT", "COPILOT_ACCOUNTS_AUTH_FAILED", "COPILOT_ACCOUNTS_AUTH_UNAVAILABLE", "COPILOT_ACCOUNTS_ACTIVE_REMOVE_BLOCKED", "COPILOT_ACCOUNTS_REMOVE_FAILED", "COPILOT_ACCOUNTS_DISPOSED"];
|
|
5
5
|
export type CopilotAccountsDiagnostic = typeof COPILOT_ACCOUNTS_DIAGNOSTICS[number];
|
|
6
6
|
export interface CopilotAccountIdentity {
|
|
7
7
|
readonly login: string;
|
|
@@ -21,7 +21,7 @@ export interface CopilotUsageRemote {
|
|
|
21
21
|
}
|
|
22
22
|
export interface CopilotUsageCardProps {
|
|
23
23
|
remote?: CopilotUsageRemote;
|
|
24
|
-
accountsRemote?: Pick<CopilotAccountsRemote, 'get' | 'refreshIdentity'>;
|
|
24
|
+
accountsRemote?: Pick<CopilotAccountsRemote, 'get' | 'refreshIdentity' | 'ensureIdentity'>;
|
|
25
25
|
/** Changes revoke every in-flight read, including switches between Copilot routes. */
|
|
26
26
|
contextKey: string;
|
|
27
27
|
locale?: string;
|
|
@@ -10,6 +10,8 @@ export declare class SessionAccountController extends TypertRemoteService {
|
|
|
10
10
|
get(agent: Agent): Promise<SessionAccountView>;
|
|
11
11
|
set(agent: Agent, accountId: string | null, revision: number): Promise<SessionAccountView>;
|
|
12
12
|
refreshIdentity(agent: Agent): Promise<SessionAccountView>;
|
|
13
|
+
ensureIdentity(agent: Agent): Promise<SessionAccountView>;
|
|
14
|
+
private readIdentity;
|
|
13
15
|
private readUsage;
|
|
14
16
|
usage(agent: Agent): Promise<CopilotUsageView>;
|
|
15
17
|
refreshUsage(agent: Agent): Promise<CopilotUsageView>;
|
|
@@ -53,6 +53,12 @@ export declare const SessionAccountViewSchema: z.ZodObject<{
|
|
|
53
53
|
COPILOT_ACCOUNTS_MODELS_FAILED: "COPILOT_ACCOUNTS_MODELS_FAILED";
|
|
54
54
|
COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE: "COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE";
|
|
55
55
|
COPILOT_ACCOUNTS_IDENTITY_INVALID: "COPILOT_ACCOUNTS_IDENTITY_INVALID";
|
|
56
|
+
COPILOT_ACCOUNTS_IDENTITY_TIMEOUT: "COPILOT_ACCOUNTS_IDENTITY_TIMEOUT";
|
|
57
|
+
COPILOT_ACCOUNTS_IDENTITY_TLS: "COPILOT_ACCOUNTS_IDENTITY_TLS";
|
|
58
|
+
COPILOT_ACCOUNTS_IDENTITY_NETWORK: "COPILOT_ACCOUNTS_IDENTITY_NETWORK";
|
|
59
|
+
COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED: "COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED";
|
|
60
|
+
COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED: "COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED";
|
|
61
|
+
COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR: "COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR";
|
|
56
62
|
COPILOT_ACCOUNTS_IDENTITY_CHANGED: "COPILOT_ACCOUNTS_IDENTITY_CHANGED";
|
|
57
63
|
COPILOT_ACCOUNTS_DUPLICATE: "COPILOT_ACCOUNTS_DUPLICATE";
|
|
58
64
|
COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED: "COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED";
|
|
@@ -95,6 +101,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
95
101
|
get(agentId: string): Promise<RemoteResult<SessionAccountView>>;
|
|
96
102
|
set(agentId: string, accountId: string | null, revision: number): Promise<RemoteResult<SessionAccountView>>;
|
|
97
103
|
refreshIdentity(agentId: string): Promise<RemoteResult<SessionAccountView>>;
|
|
104
|
+
ensureIdentity(agentId: string): Promise<RemoteResult<SessionAccountView>>;
|
|
98
105
|
usage(agentId: string): Promise<RemoteResult<CopilotUsageView>>;
|
|
99
106
|
refreshUsage(agentId: string): Promise<RemoteResult<CopilotUsageView>>;
|
|
100
107
|
turn(agentId: string, turn: number): Promise<RemoteResult<TurnAccountView>>;
|
|
@@ -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.106",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|