dsh-github-copilot 0.4.0-alpha.33 → 0.4.0-alpha.35
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 -3
- package/CHANGELOG.md +16 -0
- package/README.md +14 -12
- package/README.zh.md +14 -12
- package/deployment-baseline.json +9 -2
- package/docs/copilot-usage.md +12 -2
- package/docs/dual-model.md +29 -74
- package/docs/official-first-016-alpha2.md +7 -1
- package/lib/client.js +51 -736
- package/lib/client.js.map +1 -1
- package/lib/index.js +42 -174
- package/lib/types/client.d.ts +0 -1
- package/lib/types/copilot-usage-types.d.ts +1 -1
- package/lib/types/dual-model-host.d.ts +1 -2
- package/package.json +1 -1
- package/lib/types/current-workspace.d.ts +0 -10
- package/lib/types/dual-model-card.d.ts +0 -53
- package/lib/types/dual-model-ui.d.ts +0 -5
package/lib/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { Config as Config$1, PiAiAdapter } from "@deepseek-ai/dsh-llm-pi-ai";
|
|
|
17
17
|
import { estimateContextTokens, estimateMessageTokens } from "@earendil-works/pi-ai/utils/estimate";
|
|
18
18
|
import { buildCopilotDynamicHeaders, hasCopilotVisionInput } from "@earendil-works/pi-ai/api/github-copilot-headers";
|
|
19
19
|
//#region lib/types/dual-model-host.js
|
|
20
|
-
/**
|
|
20
|
+
/** Retired planner/executor entry points; retained policies stay enforceable without migration. */
|
|
21
21
|
var __runInitializers$3 = function(thisArg, initializers, value) {
|
|
22
22
|
var useValue = arguments.length > 2;
|
|
23
23
|
for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
@@ -59,7 +59,6 @@ var __esDecorate$3 = function(ctor, descriptorIn, decorators, contextIn, initial
|
|
|
59
59
|
done = true;
|
|
60
60
|
};
|
|
61
61
|
const DUAL_MODEL_NAMESPACE = "github-copilot-dual-model";
|
|
62
|
-
const DUAL_MODEL_POLICY_EVENT = "github-copilot/dual-model-policy";
|
|
63
62
|
const DUAL_MODEL_PROJECTION = "githubCopilotDualModelPolicy";
|
|
64
63
|
const DUAL_MODEL_EXECUTE_TOOL = "copilot_execute";
|
|
65
64
|
const DEFAULT_CONFIG = Object.freeze({
|
|
@@ -87,10 +86,6 @@ const SaveJson = z$1.object({
|
|
|
87
86
|
configuration: ConfigJson,
|
|
88
87
|
expectedRevision: RevisionJson
|
|
89
88
|
}).strict();
|
|
90
|
-
const CatalogEntryJson = z$1.object({
|
|
91
|
-
id: z$1.string().min(1).max(512),
|
|
92
|
-
name: z$1.string().min(1).max(1024)
|
|
93
|
-
}).strict();
|
|
94
89
|
const ExecuteJson = z$1.object({
|
|
95
90
|
description: z$1.string().min(1).max(160),
|
|
96
91
|
prompt: z$1.string().min(1).max(1e5)
|
|
@@ -182,38 +177,6 @@ const dualModelProjection = {
|
|
|
182
177
|
return state;
|
|
183
178
|
}
|
|
184
179
|
};
|
|
185
|
-
const ROOT_TOOLS = [
|
|
186
|
-
DUAL_MODEL_EXECUTE_TOOL,
|
|
187
|
-
"read",
|
|
188
|
-
"read_image",
|
|
189
|
-
"glob",
|
|
190
|
-
"grep",
|
|
191
|
-
"skill",
|
|
192
|
-
"ask_user_question",
|
|
193
|
-
"todo_write",
|
|
194
|
-
"send_message",
|
|
195
|
-
"list_agents",
|
|
196
|
-
"interrupt_agent"
|
|
197
|
-
];
|
|
198
|
-
const EXECUTOR_TOOLS = [
|
|
199
|
-
"read",
|
|
200
|
-
"read_image",
|
|
201
|
-
"glob",
|
|
202
|
-
"grep",
|
|
203
|
-
"skill",
|
|
204
|
-
"write",
|
|
205
|
-
"edit",
|
|
206
|
-
"pwsh",
|
|
207
|
-
"bash",
|
|
208
|
-
"present",
|
|
209
|
-
"todo_write",
|
|
210
|
-
"send_message",
|
|
211
|
-
"list_agents",
|
|
212
|
-
"interrupt_agent",
|
|
213
|
-
"job_list",
|
|
214
|
-
"job_output",
|
|
215
|
-
"job_kill"
|
|
216
|
-
];
|
|
217
180
|
const EXECUTOR_PERSONA = "You are the execution agent for a dedicated Copilot planner/executor session. Implement only the delegated task. Your provider and model are fixed by the session policy. Do not create other agents, workflows, dynamic plugins, or alternate model calls. Report the changed files, verification, limitations, and actual results to your direct parent with send_message. Do not claim tests or work you did not perform.";
|
|
218
181
|
function roleText(policy, role) {
|
|
219
182
|
return role === "planner" ? `You are the planning and acceptance agent. Read the current code and evidence, plan, clarify, delegate implementation through ${DUAL_MODEL_EXECUTE_TOOL}, and independently review results. Do not implement changes or run commands directly. Your planning model is ${policy.plannerModel}; execution is fixed to ${policy.executorModel}. Use the original send_message/list_agents/interrupt_agent controls to continue and inspect your execution children. Provider: ${GITHUB_COPILOT_PREVIEW_PROVIDER_ID}.` : EXECUTOR_PERSONA;
|
|
@@ -238,6 +201,7 @@ function revision(value) {
|
|
|
238
201
|
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
239
202
|
}
|
|
240
203
|
const ERROR_REASONS = /* @__PURE__ */ new Set([
|
|
204
|
+
"DUAL_MODEL_RETIRED",
|
|
241
205
|
"DUAL_MODEL_UNSUPPORTED",
|
|
242
206
|
"DUAL_MODEL_READ_ONLY",
|
|
243
207
|
"DUAL_MODEL_REVISION_CONFLICT",
|
|
@@ -349,7 +313,6 @@ let GitHubCopilotDualModel = (() => {
|
|
|
349
313
|
lifetime = new AbortController();
|
|
350
314
|
creates = /* @__PURE__ */ new Map();
|
|
351
315
|
overlays = /* @__PURE__ */ new Map();
|
|
352
|
-
handles = /* @__PURE__ */ new Map();
|
|
353
316
|
settingsReady = false;
|
|
354
317
|
projectionReady = false;
|
|
355
318
|
registrationFailed = false;
|
|
@@ -429,7 +392,6 @@ let GitHubCopilotDualModel = (() => {
|
|
|
429
392
|
const subject = agent;
|
|
430
393
|
const overlay = this.overlays.get(subject);
|
|
431
394
|
this.overlays.delete(subject);
|
|
432
|
-
if (this.handles.get(agent.id)?.agent === subject) this.handles.delete(agent.id);
|
|
433
395
|
if (overlay) overlay.dispose().catch(() => {});
|
|
434
396
|
});
|
|
435
397
|
ctx.effect(() => async () => {
|
|
@@ -439,9 +401,7 @@ let GitHubCopilotDualModel = (() => {
|
|
|
439
401
|
await api$1(ctx, "subagents", ["drainContinuableDescendants"])?.drainContinuableDescendants(roots).catch(() => {});
|
|
440
402
|
for (const [agent] of this.overlays) agent.cancel({ kind: "disposed" });
|
|
441
403
|
await Promise.allSettled([...this.overlays.keys()].map((agent) => agent.whenIdle()));
|
|
442
|
-
await Promise.allSettled([...this.handles.values()].map((handle) => handle.dispose()));
|
|
443
404
|
await Promise.allSettled([...this.overlays.values()].map((overlay) => overlay.dispose()));
|
|
444
|
-
this.handles.clear();
|
|
445
405
|
this.overlays.clear();
|
|
446
406
|
});
|
|
447
407
|
for (const agent of api$1(ctx, "agents", ["list"])?.list() ?? []) try {
|
|
@@ -525,7 +485,7 @@ let GitHubCopilotDualModel = (() => {
|
|
|
525
485
|
async view() {
|
|
526
486
|
const empty = {
|
|
527
487
|
supported: false,
|
|
528
|
-
diagnostic: "
|
|
488
|
+
diagnostic: "DUAL_MODEL_RETIRED",
|
|
529
489
|
writable: false,
|
|
530
490
|
revision: null,
|
|
531
491
|
configuration: DEFAULT_CONFIG,
|
|
@@ -533,35 +493,9 @@ let GitHubCopilotDualModel = (() => {
|
|
|
533
493
|
workspaces: []
|
|
534
494
|
};
|
|
535
495
|
try {
|
|
536
|
-
const configuration = this.configuration(), cap = this.capabilities();
|
|
537
|
-
if (!cap) return {
|
|
538
|
-
...empty,
|
|
539
|
-
...configuration
|
|
540
|
-
};
|
|
541
|
-
let models = [], diagnostic;
|
|
542
|
-
try {
|
|
543
|
-
const preview = await cap.preview.discover({
|
|
544
|
-
force: false,
|
|
545
|
-
signal: this.lifetime.signal
|
|
546
|
-
});
|
|
547
|
-
if (preview.available && preview.state === "ready") models = z$1.array(CatalogEntryJson).max(512).parse(preview.models.map(({ id, name }) => ({
|
|
548
|
-
id,
|
|
549
|
-
name
|
|
550
|
-
})));
|
|
551
|
-
else diagnostic = "DUAL_MODEL_MODEL_UNAVAILABLE";
|
|
552
|
-
} catch {
|
|
553
|
-
diagnostic = "DUAL_MODEL_MODEL_UNAVAILABLE";
|
|
554
|
-
}
|
|
555
496
|
return {
|
|
556
|
-
|
|
557
|
-
...
|
|
558
|
-
writable: cap.settings.writable === true,
|
|
559
|
-
...configuration,
|
|
560
|
-
models,
|
|
561
|
-
workspaces: z$1.array(CatalogEntryJson).max(1024).parse(cap.workspaces.list().map((workspace) => ({
|
|
562
|
-
id: workspace.id,
|
|
563
|
-
name: workspace.title
|
|
564
|
-
})))
|
|
497
|
+
...empty,
|
|
498
|
+
...this.configuration()
|
|
565
499
|
};
|
|
566
500
|
} catch {
|
|
567
501
|
return empty;
|
|
@@ -575,18 +509,8 @@ let GitHubCopilotDualModel = (() => {
|
|
|
575
509
|
}
|
|
576
510
|
}
|
|
577
511
|
async saveOnce(input) {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
const cap = this.requireCapabilities(), { configuration, expectedRevision } = parsed.data;
|
|
581
|
-
if (cap.settings.writable !== true) fail$1("DUAL_MODEL_READ_ONLY");
|
|
582
|
-
if (this.configuration().revision !== expectedRevision) fail$1("DUAL_MODEL_REVISION_CONFLICT");
|
|
583
|
-
if (configuration.enabled) await this.assertModels(cap, [configuration.plannerModel, configuration.executorModel]);
|
|
584
|
-
try {
|
|
585
|
-
await cap.settings.replace(DUAL_MODEL_NAMESPACE, configuration, expectedRevision);
|
|
586
|
-
} catch (error) {
|
|
587
|
-
fail$1(reasonOf(error, "DUAL_MODEL_SAVE_FAILED"));
|
|
588
|
-
}
|
|
589
|
-
return this.view();
|
|
512
|
+
if (!SaveJson.safeParse(input).success) fail$1("DUAL_MODEL_INVALID_REQUEST");
|
|
513
|
+
fail$1("DUAL_MODEL_RETIRED");
|
|
590
514
|
}
|
|
591
515
|
create(input) {
|
|
592
516
|
const parsed = CreateJson.safeParse(input);
|
|
@@ -605,89 +529,33 @@ let GitHubCopilotDualModel = (() => {
|
|
|
605
529
|
async createOnce(request, id) {
|
|
606
530
|
let creation = "uncertain";
|
|
607
531
|
try {
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
await workspace.attachSession(id);
|
|
617
|
-
return { sessionId: id };
|
|
532
|
+
if (this.lifetime.signal.aborted) fail$1("DUAL_MODEL_UNSUPPORTED");
|
|
533
|
+
const ctx = this.owner.ctx;
|
|
534
|
+
const persistence = api$1(ctx, "sessionPersistence", ["stat"]);
|
|
535
|
+
const agents = api$1(ctx, "agents", ["get"]);
|
|
536
|
+
if (!persistence || !agents) fail$1("DUAL_MODEL_UNSUPPORTED");
|
|
537
|
+
if (await persistence.stat(id) === void 0 && !agents.get(id)) {
|
|
538
|
+
creation = "not-created";
|
|
539
|
+
fail$1("DUAL_MODEL_RETIRED");
|
|
618
540
|
}
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
if (
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
const
|
|
625
|
-
|
|
626
|
-
const
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
const executorTools = EXECUTOR_TOOLS.filter((name) => inheritedNames.has(name));
|
|
630
|
-
if (!executorTools.includes("send_message")) fail$1("DUAL_MODEL_UNSUPPORTED");
|
|
631
|
-
if (this.configuration().revision !== request.expectedRevision) fail$1("DUAL_MODEL_REVISION_CONFLICT");
|
|
632
|
-
if (cap.workspaces.get(workspace.id) !== workspace) fail$1("DUAL_MODEL_WORKSPACE_UNAVAILABLE");
|
|
633
|
-
const policy = {
|
|
634
|
-
version: 1,
|
|
635
|
-
rootSessionId: id,
|
|
636
|
-
requestId: request.requestId,
|
|
637
|
-
workspaceId: workspace.id,
|
|
638
|
-
settingsRevision: request.expectedRevision,
|
|
639
|
-
cwd: workspace.path,
|
|
640
|
-
agentPreset: preset.id,
|
|
641
|
-
provider: GITHUB_COPILOT_PREVIEW_PROVIDER_ID,
|
|
642
|
-
plannerModel: captured.plannerModel,
|
|
643
|
-
executorModel: captured.executorModel,
|
|
644
|
-
plannerTools: [...ROOT_TOOLS],
|
|
645
|
-
executorTools: [...executorTools]
|
|
646
|
-
};
|
|
647
|
-
creation = "uncertain";
|
|
648
|
-
const handle = await cap.agents.create({
|
|
649
|
-
sessionId: id,
|
|
650
|
-
agentOptions: {
|
|
651
|
-
provider: GITHUB_COPILOT_PREVIEW_PROVIDER_ID,
|
|
652
|
-
model: policy.plannerModel
|
|
653
|
-
},
|
|
654
|
-
meta: {
|
|
655
|
-
cwd: policy.cwd,
|
|
656
|
-
agentPreset: preset.id,
|
|
657
|
-
isSeeded: false
|
|
658
|
-
},
|
|
659
|
-
inheritedEventCount: 0,
|
|
660
|
-
seed: [{
|
|
661
|
-
type: DUAL_MODEL_POLICY_EVENT,
|
|
662
|
-
seq: 0,
|
|
663
|
-
time: Date.now(),
|
|
664
|
-
ignorable: true,
|
|
665
|
-
data: policy
|
|
666
|
-
}, {
|
|
667
|
-
type: "model/selection",
|
|
668
|
-
seq: 1,
|
|
669
|
-
time: Date.now(),
|
|
670
|
-
data: {
|
|
671
|
-
provider: GITHUB_COPILOT_PREVIEW_PROVIDER_ID,
|
|
672
|
-
model: policy.plannerModel
|
|
673
|
-
}
|
|
674
|
-
}],
|
|
675
|
-
signal: this.lifetime.signal,
|
|
676
|
-
setup: async (agentCtx, agent) => {
|
|
677
|
-
await cap.presets.mount(agentCtx, preset.id);
|
|
678
|
-
this.install(agent, policy, "planner");
|
|
679
|
-
}
|
|
680
|
-
});
|
|
681
|
-
this.handles.set(id, handle);
|
|
682
|
-
if (!await cap.sessions.flush(handle.agent.session)) fail$1("DUAL_MODEL_CREATE_UNCERTAIN");
|
|
541
|
+
const inspector = api$1(ctx, "sessionController", ["inspect"]);
|
|
542
|
+
const workspaces = api$1(ctx, "workspaceRegistry", ["get"]);
|
|
543
|
+
if (!inspector || !workspaces) fail$1("DUAL_MODEL_UNSUPPORTED");
|
|
544
|
+
const inspection = await inspector.inspect(id);
|
|
545
|
+
let state = dualModelProjection.init(inspection.meta, inspection.inheritedEventCount);
|
|
546
|
+
for (const event of inspection.events) state = dualModelProjection.apply(state, event);
|
|
547
|
+
if (state.id !== id || state.invalid || !state.policy || !policyMatches(state.policy, request)) fail$1("DUAL_MODEL_REQUEST_CONFLICT");
|
|
548
|
+
const workspace = this.workspace(workspaces, request.workspaceId);
|
|
549
|
+
if (workspace.path !== state.policy.cwd) fail$1("DUAL_MODEL_REQUEST_CONFLICT");
|
|
550
|
+
if (this.lifetime.signal.aborted) fail$1("DUAL_MODEL_UNSUPPORTED");
|
|
683
551
|
await workspace.attachSession(id);
|
|
684
552
|
return { sessionId: id };
|
|
685
553
|
} catch (error) {
|
|
686
554
|
fail$1(reasonOf(error, "DUAL_MODEL_CREATE_UNCERTAIN"), creation);
|
|
687
555
|
}
|
|
688
556
|
}
|
|
689
|
-
workspace(
|
|
690
|
-
const workspace =
|
|
557
|
+
workspace(workspaces, id) {
|
|
558
|
+
const workspace = workspaces.get(id);
|
|
691
559
|
if (!workspace || typeof workspace.path !== "string" || typeof workspace.attachSession !== "function") fail$1("DUAL_MODEL_WORKSPACE_UNAVAILABLE");
|
|
692
560
|
return workspace;
|
|
693
561
|
}
|
|
@@ -1263,17 +1131,15 @@ function createAccountModelAuth(credentials, renewRejectedCredential) {
|
|
|
1263
1131
|
};
|
|
1264
1132
|
}
|
|
1265
1133
|
//#endregion
|
|
1266
|
-
//#region lib/types/copilot-usage-types.js
|
|
1267
|
-
const COPILOT_USAGE_MAX_AMOUNT = 0xe8d4a51000;
|
|
1268
|
-
const COPILOT_USAGE_MAX_TIMESTAMP = 0xe677d21fdbff;
|
|
1269
|
-
//#endregion
|
|
1270
1134
|
//#region lib/types/copilot-usage-normalize.js
|
|
1271
|
-
const amount = z$1.number().finite().min(0).max(
|
|
1135
|
+
const amount = z$1.number().finite().min(0).max(0xe8d4a51000);
|
|
1272
1136
|
const entitlement = z$1.union([
|
|
1273
1137
|
amount,
|
|
1274
1138
|
z$1.literal(-1),
|
|
1275
1139
|
z$1.string().max(32).regex(/^(?:-1|(?:0|[1-9]\d*)(?:\.\d+)?)$/u)
|
|
1276
1140
|
]).transform(Number).refine((value) => Number.isFinite(value) && value <= 0xe8d4a51000);
|
|
1141
|
+
const resetSeconds = z$1.unknown().transform((value) => typeof value === "number" && Number.isInteger(value) && value > 0 && value <= Math.floor(0xe677d21fdbff / 1e3) ? value * 1e3 : void 0);
|
|
1142
|
+
const resetCalendar = z$1.unknown().transform(resetDate);
|
|
1277
1143
|
const snapshot = z$1.object({
|
|
1278
1144
|
unlimited: z$1.boolean(),
|
|
1279
1145
|
entitlement: entitlement.optional(),
|
|
@@ -1282,14 +1148,14 @@ const snapshot = z$1.object({
|
|
|
1282
1148
|
credits_used: amount.optional(),
|
|
1283
1149
|
has_quota: z$1.boolean().optional(),
|
|
1284
1150
|
token_based_billing: z$1.boolean().optional(),
|
|
1285
|
-
quota_reset_at:
|
|
1151
|
+
quota_reset_at: resetSeconds.optional()
|
|
1286
1152
|
});
|
|
1287
1153
|
const response = z$1.object({
|
|
1288
1154
|
token_based_billing: z$1.boolean().optional(),
|
|
1289
1155
|
access_type_sku: z$1.string().max(128).optional(),
|
|
1290
|
-
quota_reset_date:
|
|
1291
|
-
quota_reset_date_utc:
|
|
1292
|
-
limited_user_reset_date:
|
|
1156
|
+
quota_reset_date: resetCalendar.optional(),
|
|
1157
|
+
quota_reset_date_utc: resetCalendar.optional(),
|
|
1158
|
+
limited_user_reset_date: resetCalendar.optional(),
|
|
1293
1159
|
quota_snapshots: z$1.object({
|
|
1294
1160
|
chat: snapshot.optional(),
|
|
1295
1161
|
premium_interactions: snapshot.optional()
|
|
@@ -1306,7 +1172,7 @@ function unavailableCopilotUsage(diagnostic, billing = "unknown", budget = "unkn
|
|
|
1306
1172
|
};
|
|
1307
1173
|
}
|
|
1308
1174
|
function resetDate(value) {
|
|
1309
|
-
if (!/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:Z|[+-]\d{2}:\d{2}))?$/u.test(value)) return void 0;
|
|
1175
|
+
if (typeof value !== "string" || value.length > 64 || !/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:Z|[+-]\d{2}:\d{2}))?$/u.test(value)) return void 0;
|
|
1310
1176
|
const date = value.slice(0, 10);
|
|
1311
1177
|
const day = Date.parse(`${date}T00:00:00Z`);
|
|
1312
1178
|
if (!Number.isFinite(day) || new Date(day).toISOString().slice(0, 10) !== date) return void 0;
|
|
@@ -1325,10 +1191,12 @@ function normalizeCopilotUsage(input, observedAt) {
|
|
|
1325
1191
|
if (data.token_based_billing === void 0) return unavailableCopilotUsage("COPILOT_USAGE_BILLING_UNKNOWN");
|
|
1326
1192
|
const billing = data.token_based_billing ? "credits" : "requests";
|
|
1327
1193
|
const quota = data.access_type_sku === "free_limited_copilot" ? data.quota_snapshots?.chat : data.quota_snapshots?.premium_interactions;
|
|
1328
|
-
const
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1194
|
+
const resetAt = [
|
|
1195
|
+
quota?.quota_reset_at,
|
|
1196
|
+
data.quota_reset_date_utc,
|
|
1197
|
+
data.quota_reset_date,
|
|
1198
|
+
data.limited_user_reset_date
|
|
1199
|
+
].find((value) => value !== void 0 && value > observedAt);
|
|
1332
1200
|
const dates = {
|
|
1333
1201
|
observedAt,
|
|
1334
1202
|
...resetAt === void 0 ? {} : { resetAt }
|
|
@@ -1732,7 +1600,7 @@ let GitHubCopilotUsageController = (() => {
|
|
|
1732
1600
|
//#endregion
|
|
1733
1601
|
//#region package.json
|
|
1734
1602
|
var name$1 = "dsh-github-copilot";
|
|
1735
|
-
var version = "0.4.0-alpha.
|
|
1603
|
+
var version = "0.4.0-alpha.35";
|
|
1736
1604
|
//#endregion
|
|
1737
1605
|
//#region lib/types/probe.js
|
|
1738
1606
|
/**
|
package/lib/types/client.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ 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';
|
|
12
11
|
export { CopilotUsageCard } from './copilot-usage-card.ts';
|
|
13
12
|
export declare const inject: string[];
|
|
14
13
|
interface GitHubCopilotProviderCardProps extends ProviderCardExtrasOwnerProps {
|
|
@@ -7,7 +7,7 @@ export interface CopilotUsageView {
|
|
|
7
7
|
readonly remaining?: number;
|
|
8
8
|
readonly limit?: number;
|
|
9
9
|
readonly percentUsed?: number;
|
|
10
|
-
/** Unix epoch milliseconds,
|
|
10
|
+
/** Supplier-reported next reset in Unix epoch milliseconds, later than observedAt. */
|
|
11
11
|
readonly resetAt?: number;
|
|
12
12
|
readonly observedAt?: number;
|
|
13
13
|
readonly diagnostic?: string;
|
|
@@ -91,13 +91,12 @@ declare module '@deepseek-ai/cordis' {
|
|
|
91
91
|
githubCopilotDualModel: GitHubCopilotDualModel;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
/** Always mountable;
|
|
94
|
+
/** Always mountable; retired entry points coexist with retained policy enforcement. */
|
|
95
95
|
export default class GitHubCopilotDualModel extends TypertRemoteService {
|
|
96
96
|
private readonly owner;
|
|
97
97
|
private readonly lifetime;
|
|
98
98
|
private readonly creates;
|
|
99
99
|
private readonly overlays;
|
|
100
|
-
private readonly handles;
|
|
101
100
|
private settingsReady;
|
|
102
101
|
private projectionReady;
|
|
103
102
|
private registrationFailed;
|
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.35",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** Optional read-only projection of the public Client Session/Workspace lists. */
|
|
2
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
-
export interface CurrentWorkspaceSource {
|
|
4
|
-
getSnapshot(): string | undefined;
|
|
5
|
-
subscribe(listener: () => void): () => void;
|
|
6
|
-
dispose(): void;
|
|
7
|
-
}
|
|
8
|
-
/** Observe only current membership. Do not call navigation/create or use a recent-workspace fallback. */
|
|
9
|
-
export declare function createCurrentWorkspaceSource(ctx: Context): CurrentWorkspaceSource;
|
|
10
|
-
//# sourceMappingURL=current-workspace.d.ts.map
|
|
@@ -1,53 +0,0 @@
|
|
|
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
|
-
/** Current Client workspace; never a saved role setting or an implicit fallback. */
|
|
48
|
-
currentWorkspaceId?: string;
|
|
49
|
-
onOpenSession?: (id: string) => void;
|
|
50
|
-
}
|
|
51
|
-
/** Additive Models settings card. All mutations belong to the injected scoped Remote. */
|
|
52
|
-
export declare function DualModelCard(props: DualModelCardProps): ReactElement;
|
|
53
|
-
//# sourceMappingURL=dual-model-card.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|