dsh-github-copilot 0.4.0-alpha.105 → 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 +1 -1
- package/CHANGELOG.md +5 -0
- package/README.md +8 -6
- package/README.zh.md +8 -6
- package/deployment-baseline.json +9 -1
- package/docs/automatic-model-routing.md +29 -4
- package/lib/client.js +147 -17
- package/lib/client.js.map +1 -1
- package/lib/index.js +230 -68
- package/lib/remote.js +38 -0
- package/lib/types/context-evidence.d.ts +4 -4
- 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
|
|
@@ -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
|
};
|
|
@@ -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/",
|