dsh-github-copilot 0.4.0-alpha.19 → 0.4.0-alpha.21

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
@@ -1,4 +1,100 @@
1
1
  import { z } from "zod";
2
+ //#region lib/types/dual-model-remote.js
3
+ const id = z.string().min(1).max(512);
4
+ const revision = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
5
+ const DualModelConfigSchema = z.object({
6
+ enabled: z.boolean(),
7
+ plannerModel: z.string().max(512),
8
+ executorModel: z.string().max(512)
9
+ }).strict();
10
+ const DualModelViewSchema = z.object({
11
+ supported: z.boolean(),
12
+ diagnostic: z.string().min(1).max(128).optional(),
13
+ writable: z.boolean(),
14
+ revision: revision.nullable(),
15
+ configuration: DualModelConfigSchema,
16
+ models: z.array(z.object({
17
+ id,
18
+ name: z.string().min(1).max(1024)
19
+ }).strict()).max(512),
20
+ workspaces: z.array(z.object({
21
+ id,
22
+ name: z.string().min(1).max(1024)
23
+ }).strict()).max(1024)
24
+ }).strict();
25
+ const DualModelSaveSchema = z.object({
26
+ configuration: DualModelConfigSchema,
27
+ expectedRevision: revision
28
+ }).strict();
29
+ const DualModelCreateSchema = z.object({
30
+ requestId: z.string().uuid(),
31
+ workspaceId: id,
32
+ expectedRevision: revision
33
+ }).strict();
34
+ const DualModelCreateResultSchema = z.object({ sessionId: id }).strict();
35
+ const contribution$1 = {
36
+ package: "dsh-github-copilot",
37
+ descriptors: [
38
+ {
39
+ id: "dsh-github-copilot:githubCopilotDualModel.view",
40
+ namespace: "githubCopilotDualModel",
41
+ service: "githubCopilotDualModel",
42
+ method: "view",
43
+ invocation: { kind: "direct" },
44
+ parameters: [],
45
+ result: {
46
+ mode: "strict",
47
+ typeSymbol: "dsh-github-copilot#DualModelView",
48
+ schema: DualModelViewSchema
49
+ }
50
+ },
51
+ {
52
+ id: "dsh-github-copilot:githubCopilotDualModel.save",
53
+ namespace: "githubCopilotDualModel",
54
+ service: "githubCopilotDualModel",
55
+ method: "save",
56
+ invocation: { kind: "direct" },
57
+ parameters: [{
58
+ name: "input",
59
+ wire: "input",
60
+ source: "json",
61
+ codec: {
62
+ mode: "strict",
63
+ typeSymbol: "dsh-github-copilot#DualModelSaveRequest",
64
+ schema: DualModelSaveSchema
65
+ }
66
+ }],
67
+ result: {
68
+ mode: "strict",
69
+ typeSymbol: "dsh-github-copilot#DualModelView",
70
+ schema: DualModelViewSchema
71
+ }
72
+ },
73
+ {
74
+ id: "dsh-github-copilot:githubCopilotDualModel.create",
75
+ namespace: "githubCopilotDualModel",
76
+ service: "githubCopilotDualModel",
77
+ method: "create",
78
+ invocation: { kind: "direct" },
79
+ parameters: [{
80
+ name: "input",
81
+ wire: "input",
82
+ source: "json",
83
+ codec: {
84
+ mode: "strict",
85
+ typeSymbol: "dsh-github-copilot#DualModelCreateRequest",
86
+ schema: DualModelCreateSchema
87
+ }
88
+ }],
89
+ result: {
90
+ mode: "strict",
91
+ typeSymbol: "dsh-github-copilot#DualModelCreateResult",
92
+ schema: DualModelCreateResultSchema
93
+ }
94
+ }
95
+ ]
96
+ };
97
+ //#endregion
2
98
  //#region lib/types/remote.js
3
99
  /**
4
100
  * Client-safe Remote contribution for the plugin-owned authorization bridge.
@@ -128,35 +224,39 @@ const GitHubCopilotMigrationStatusSchema = z.object({
128
224
  }).strict();
129
225
  const contribution = {
130
226
  package: "dsh-github-copilot",
131
- descriptors: [...[
132
- "status",
133
- "reconcile",
134
- "discoverModels",
135
- "ensureModels",
136
- "start",
137
- "cancel",
138
- "signOut"
139
- ].map((method) => ({
140
- id: `dsh-github-copilot:githubCopilot.${method}`,
141
- service: "githubCopilotAuthorization",
142
- namespace: "githubCopilot",
143
- method,
144
- invocation: direct,
145
- parameters: [],
146
- result
147
- })), {
148
- id: "dsh-github-copilot:githubCopilot.migrationStatus",
149
- service: "githubCopilotAuthorization",
150
- namespace: "githubCopilot",
151
- method: "migrationStatus",
152
- invocation: direct,
153
- parameters: [],
154
- result: {
155
- mode: "strict",
156
- typeSymbol: GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL,
157
- schema: GitHubCopilotMigrationStatusSchema
158
- }
159
- }]
227
+ descriptors: [
228
+ ...[
229
+ "status",
230
+ "reconcile",
231
+ "discoverModels",
232
+ "ensureModels",
233
+ "start",
234
+ "cancel",
235
+ "signOut"
236
+ ].map((method) => ({
237
+ id: `dsh-github-copilot:githubCopilot.${method}`,
238
+ service: "githubCopilotAuthorization",
239
+ namespace: "githubCopilot",
240
+ method,
241
+ invocation: direct,
242
+ parameters: [],
243
+ result
244
+ })),
245
+ {
246
+ id: "dsh-github-copilot:githubCopilot.migrationStatus",
247
+ service: "githubCopilotAuthorization",
248
+ namespace: "githubCopilot",
249
+ method: "migrationStatus",
250
+ invocation: direct,
251
+ parameters: [],
252
+ result: {
253
+ mode: "strict",
254
+ typeSymbol: GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL,
255
+ schema: GitHubCopilotMigrationStatusSchema
256
+ }
257
+ },
258
+ ...contribution$1.descriptors
259
+ ]
160
260
  };
161
261
  //#endregion
162
262
  export { GITHUB_COPILOT_AUTHORIZATION_VIEW_TYPE_SYMBOL, GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL, GitHubCopilotAuthorizationViewSchema, GitHubCopilotMigrationStatusSchema, contribution as default };
@@ -8,6 +8,7 @@ import type { CSSProperties, ReactElement } from 'react';
8
8
  import type { GitHubCopilotAuthorizationView } from './authorization-controller.ts';
9
9
  import type { ProviderCardExtrasOwnerProps, SettingsSectionOwnerProps } from './dsh-supported-types.ts';
10
10
  export { WebSearchRoutingCard } from './web-search-routing-card.ts';
11
+ export { DualModelCard } from './dual-model-card.ts';
11
12
  export declare const inject: string[];
12
13
  interface GitHubCopilotProviderCardProps extends ProviderCardExtrasOwnerProps {
13
14
  readonly remote: ClientContext['remote']['githubCopilot'];
@@ -0,0 +1,51 @@
1
+ import type { ReactElement } from 'react';
2
+ /** Client-owned contracts: no Host implementation or credential imports. */
3
+ export interface DualModelConfig {
4
+ enabled: boolean;
5
+ plannerModel: string;
6
+ executorModel: string;
7
+ }
8
+ export interface DualModelView {
9
+ supported: boolean;
10
+ diagnostic?: string;
11
+ writable: boolean;
12
+ revision: number | null;
13
+ configuration: DualModelConfig;
14
+ models: readonly {
15
+ id: string;
16
+ name: string;
17
+ }[];
18
+ workspaces: readonly {
19
+ id: string;
20
+ name: string;
21
+ }[];
22
+ }
23
+ export type Result<T> = {
24
+ ok: true;
25
+ value: T;
26
+ } | {
27
+ ok: false;
28
+ error: unknown;
29
+ };
30
+ export interface DualModelRemote {
31
+ view(): Promise<Result<DualModelView>>;
32
+ save(input: {
33
+ configuration: DualModelConfig;
34
+ expectedRevision: number;
35
+ }): Promise<Result<DualModelView>>;
36
+ create(input: {
37
+ requestId: string;
38
+ workspaceId: string;
39
+ expectedRevision: number;
40
+ }): Promise<Result<{
41
+ sessionId: string;
42
+ }>>;
43
+ }
44
+ export interface DualModelCardProps {
45
+ remote: DualModelRemote;
46
+ locale?: string;
47
+ onOpenSession?: (id: string) => void;
48
+ }
49
+ /** Additive Models settings card. All mutations belong to the injected scoped Remote. */
50
+ export declare function DualModelCard(props: DualModelCardProps): ReactElement;
51
+ //# sourceMappingURL=dual-model-card.d.ts.map
@@ -0,0 +1,119 @@
1
+ import { Context, Service } from '@deepseek-ai/cordis';
2
+ import { z as json } from 'zod';
3
+ import type { DualModelView, DualModelSaveRequest, DualModelCreateRequest, DualModelCreateResult } from './dual-model-types.ts';
4
+ export declare const DUAL_MODEL_NAMESPACE = "github-copilot-dual-model";
5
+ export declare const DUAL_MODEL_POLICY_EVENT = "github-copilot/dual-model-policy";
6
+ export declare const DUAL_MODEL_PROJECTION = "githubCopilotDualModelPolicy";
7
+ export declare const DUAL_MODEL_EXECUTE_TOOL = "copilot_execute";
8
+ declare const PolicyJson: json.ZodObject<{
9
+ version: json.ZodLiteral<1>;
10
+ rootSessionId: json.ZodString;
11
+ requestId: json.ZodString;
12
+ workspaceId: json.ZodString;
13
+ settingsRevision: json.ZodNumber;
14
+ cwd: json.ZodString;
15
+ agentPreset: json.ZodString;
16
+ provider: json.ZodLiteral<"github-copilot-preview">;
17
+ plannerModel: json.ZodString;
18
+ executorModel: json.ZodString;
19
+ executorTools: json.ZodArray<json.ZodString>;
20
+ plannerTools: json.ZodArray<json.ZodString>;
21
+ }, json.core.$strict>;
22
+ type Policy = json.infer<typeof PolicyJson>;
23
+ interface LogEvent {
24
+ readonly type: string;
25
+ readonly seq: number;
26
+ readonly data: unknown;
27
+ readonly ignorable?: true;
28
+ }
29
+ interface Header {
30
+ readonly id: string;
31
+ readonly cwd?: string;
32
+ readonly parentSession?: string;
33
+ readonly origin?: string;
34
+ readonly agentPreset?: string;
35
+ }
36
+ interface ChildDescriptor {
37
+ readonly version: 1;
38
+ readonly mode: 'continuable';
39
+ readonly provider: 'spawn';
40
+ readonly agentProvider: string;
41
+ readonly agentModel: string;
42
+ }
43
+ interface Projection {
44
+ readonly id: string;
45
+ readonly parentId: string | null;
46
+ readonly origin: string | null;
47
+ readonly inherited: number;
48
+ readonly policy: Policy | null;
49
+ readonly child: ChildDescriptor | null;
50
+ readonly invalid: boolean;
51
+ }
52
+ /** A root policy is authoritative only in its own suffix, never in a fork seed. */
53
+ export declare const dualModelProjection: {
54
+ key: string;
55
+ stateVersion: number;
56
+ stateSchema: json.ZodObject<{
57
+ id: json.ZodString;
58
+ parentId: json.ZodNullable<json.ZodString>;
59
+ origin: json.ZodNullable<json.ZodString>;
60
+ inherited: json.ZodNumber;
61
+ policy: json.ZodNullable<json.ZodObject<{
62
+ version: json.ZodLiteral<1>;
63
+ rootSessionId: json.ZodString;
64
+ requestId: json.ZodString;
65
+ workspaceId: json.ZodString;
66
+ settingsRevision: json.ZodNumber;
67
+ cwd: json.ZodString;
68
+ agentPreset: json.ZodString;
69
+ provider: json.ZodLiteral<"github-copilot-preview">;
70
+ plannerModel: json.ZodString;
71
+ executorModel: json.ZodString;
72
+ executorTools: json.ZodArray<json.ZodString>;
73
+ plannerTools: json.ZodArray<json.ZodString>;
74
+ }, json.core.$strict>>;
75
+ child: json.ZodNullable<json.ZodObject<{
76
+ version: json.ZodLiteral<1>;
77
+ mode: json.ZodLiteral<"continuable">;
78
+ provider: json.ZodLiteral<"spawn">;
79
+ agentProvider: json.ZodString;
80
+ agentModel: json.ZodString;
81
+ }, json.core.$strip>>;
82
+ invalid: json.ZodBoolean;
83
+ }, json.core.$strip>;
84
+ init: (header: Header, inherited?: number) => Projection;
85
+ apply: (state: Projection, event: LogEvent) => Projection;
86
+ };
87
+ export declare function dualModelSessionId(requestId: string): string;
88
+ declare module '@deepseek-ai/cordis' {
89
+ interface Context {
90
+ githubCopilotDualModel: GitHubCopilotDualModel;
91
+ }
92
+ }
93
+ /** Always mountable; missing optional APIs produce a safe unsupported view. */
94
+ export default class GitHubCopilotDualModel extends Service {
95
+ private readonly owner;
96
+ private readonly lifetime;
97
+ private readonly creates;
98
+ private readonly overlays;
99
+ private readonly handles;
100
+ private settingsReady;
101
+ private projectionReady;
102
+ private registrationFailed;
103
+ constructor(ctx: Context);
104
+ private capabilities;
105
+ private requireCapabilities;
106
+ private configuration;
107
+ view(): Promise<DualModelView>;
108
+ save(input: DualModelSaveRequest): Promise<DualModelView>;
109
+ private saveOnce;
110
+ create(input: DualModelCreateRequest): Promise<DualModelCreateResult>;
111
+ private createOnce;
112
+ private workspace;
113
+ private assertModels;
114
+ private projection;
115
+ private restore;
116
+ private install;
117
+ }
118
+ export {};
119
+ //# sourceMappingURL=dual-model-host.d.ts.map
@@ -0,0 +1,63 @@
1
+ /** Client-safe, strict wire contract for the optional Copilot model-role feature. */
2
+ import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
3
+ import { z } from 'zod';
4
+ import type { DualModelView, DualModelSaveRequest, DualModelCreateRequest, DualModelCreateResult } from './dual-model-types.ts';
5
+ export type { DualModelConfig, DualModelView, DualModelSaveRequest, DualModelCreateRequest, DualModelCreateResult } from './dual-model-types.ts';
6
+ declare module '@deepseek-ai/dsh-typert-protocol' {
7
+ interface RemoteErrorDetailsMap {
8
+ 'copilot/dual-model': {
9
+ readonly reason: string;
10
+ readonly creation?: 'not-created' | 'uncertain';
11
+ };
12
+ }
13
+ interface TypertRemoteNamespaceMap {
14
+ githubCopilotDualModel: {
15
+ view(): Promise<RemoteResult<DualModelView>>;
16
+ save(input: DualModelSaveRequest): Promise<RemoteResult<DualModelView>>;
17
+ create(input: DualModelCreateRequest): Promise<RemoteResult<DualModelCreateResult>>;
18
+ };
19
+ }
20
+ }
21
+ export declare const DualModelConfigSchema: z.ZodObject<{
22
+ enabled: z.ZodBoolean;
23
+ plannerModel: z.ZodString;
24
+ executorModel: z.ZodString;
25
+ }, z.core.$strict>;
26
+ export declare const DualModelViewSchema: z.ZodObject<{
27
+ supported: z.ZodBoolean;
28
+ diagnostic: z.ZodOptional<z.ZodString>;
29
+ writable: z.ZodBoolean;
30
+ revision: z.ZodNullable<z.ZodNumber>;
31
+ configuration: z.ZodObject<{
32
+ enabled: z.ZodBoolean;
33
+ plannerModel: z.ZodString;
34
+ executorModel: z.ZodString;
35
+ }, z.core.$strict>;
36
+ models: z.ZodArray<z.ZodObject<{
37
+ id: z.ZodString;
38
+ name: z.ZodString;
39
+ }, z.core.$strict>>;
40
+ workspaces: z.ZodArray<z.ZodObject<{
41
+ id: z.ZodString;
42
+ name: z.ZodString;
43
+ }, z.core.$strict>>;
44
+ }, z.core.$strict>;
45
+ export declare const DualModelSaveSchema: z.ZodObject<{
46
+ configuration: z.ZodObject<{
47
+ enabled: z.ZodBoolean;
48
+ plannerModel: z.ZodString;
49
+ executorModel: z.ZodString;
50
+ }, z.core.$strict>;
51
+ expectedRevision: z.ZodNumber;
52
+ }, z.core.$strict>;
53
+ export declare const DualModelCreateSchema: z.ZodObject<{
54
+ requestId: z.ZodString;
55
+ workspaceId: z.ZodString;
56
+ expectedRevision: z.ZodNumber;
57
+ }, z.core.$strict>;
58
+ export declare const DualModelCreateResultSchema: z.ZodObject<{
59
+ sessionId: z.ZodString;
60
+ }, z.core.$strict>;
61
+ declare const contribution: TypertRemoteContribution;
62
+ export default contribution;
63
+ //# sourceMappingURL=dual-model-remote.d.ts.map
@@ -0,0 +1,34 @@
1
+ /** Credential-free contracts shared by the optional dual-model Host and UI. */
2
+ export interface DualModelConfig {
3
+ readonly enabled: boolean;
4
+ readonly plannerModel: string;
5
+ readonly executorModel: string;
6
+ }
7
+ export interface DualModelView {
8
+ readonly supported: boolean;
9
+ readonly diagnostic?: string;
10
+ readonly writable: boolean;
11
+ readonly revision: number | null;
12
+ readonly configuration: DualModelConfig;
13
+ readonly models: readonly {
14
+ readonly id: string;
15
+ readonly name: string;
16
+ }[];
17
+ readonly workspaces: readonly {
18
+ readonly id: string;
19
+ readonly name: string;
20
+ }[];
21
+ }
22
+ export interface DualModelSaveRequest {
23
+ readonly configuration: DualModelConfig;
24
+ readonly expectedRevision: number;
25
+ }
26
+ export interface DualModelCreateRequest {
27
+ readonly requestId: string;
28
+ readonly workspaceId: string;
29
+ readonly expectedRevision: number;
30
+ }
31
+ export interface DualModelCreateResult {
32
+ readonly sessionId: string;
33
+ }
34
+ //# sourceMappingURL=dual-model-types.d.ts.map
@@ -0,0 +1,5 @@
1
+ /** Optional Models-page entry; feature absence never blocks account sign-in. */
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ /** A single visible seat under Models, with a section fallback on older Clients. */
4
+ export declare function registerDualModelUi(ctx: Context): () => void;
5
+ //# sourceMappingURL=dual-model-ui.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.19",
4
+ "version": "0.4.0-alpha.21",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "registry": "https://registry.npmjs.org/",
@@ -53,6 +53,8 @@
53
53
  "docs/single-route-migration.md",
54
54
  "docs/session-search-routing.md",
55
55
  "docs/npm-distribution.md",
56
+ "docs/dual-model.md",
57
+ "docs/images/dual-model-provenance.json",
56
58
  "scripts/check-search-composition.mjs",
57
59
  "docs/images/"
58
60
  ],
@@ -87,10 +89,12 @@
87
89
  "@deepseek-ai/dsh-launch-environment": "0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.3-alpha.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1",
88
90
  "@deepseek-ai/dsh-llm": "0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.3-alpha.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1",
89
91
  "@deepseek-ai/dsh-llm-pi-ai": "0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.3-alpha.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1",
92
+ "@deepseek-ai/dsh-scope": "0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.3-alpha.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1",
90
93
  "@deepseek-ai/dsh-settings": "0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.3-alpha.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1",
91
94
  "@deepseek-ai/dsh-typert-protocol": "0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.3-alpha.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1",
92
95
  "@deepseek-ai/dsh-web": "0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.3-alpha.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1",
93
96
  "@deepseek-ai/dsh-web-search-deepseek": "0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.3-alpha.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1",
97
+ "@deepseek-ai/schemastery": "^3.18.2",
94
98
  "react": "^18.2.0"
95
99
  },
96
100
  "peerDependenciesMeta": {
@@ -103,9 +107,6 @@
103
107
  "@deepseek-ai/dsh-api-remotes": {
104
108
  "optional": true
105
109
  },
106
- "@deepseek-ai/dsh-authorization": {
107
- "optional": true
108
- },
109
110
  "@deepseek-ai/dsh-client-ui-renderer": {
110
111
  "optional": true
111
112
  },
@@ -120,8 +121,6 @@
120
121
  }
121
122
  },
122
123
  "dependencies": {
123
- "@deepseek-ai/dsh-authorization": "0.1.2-rc.1",
124
- "@deepseek-ai/schemastery": "^3.18.2",
125
124
  "@earendil-works/pi-ai": "0.85.1",
126
125
  "zod": "^4.4.3"
127
126
  },
@@ -152,10 +151,13 @@
152
151
  "@deepseek-ai/dsh-typert-registry": "0.1.2-rc.1",
153
152
  "@deepseek-ai/dsh-web": "0.1.2-rc.1",
154
153
  "@deepseek-ai/dsh-web-search-deepseek": "0.1.2-rc.1",
154
+ "@deepseek-ai/schemastery": "^3.18.2",
155
155
  "@types/node": "^22.0.0",
156
156
  "@types/react": "~18.3.1",
157
+ "@types/react-dom": "18.3.7",
157
158
  "jsdom": "^26.1.0",
158
159
  "react": "^18.2.0",
160
+ "react-dom": "18.3.1",
159
161
  "tsdown": "^0.22.2",
160
162
  "typescript": "^5.9.0",
161
163
  "vitest": "^3.2.0"