dsh-github-copilot 0.4.0-alpha.39 → 0.4.0-alpha.42

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.
@@ -0,0 +1,45 @@
1
+ export declare const AUTO_MODEL_ATTRIBUTION_KEY = "github-copilot-auto-model-attribution";
2
+ type Dispose = () => void;
3
+ export interface AutoModelAttribution {
4
+ readonly provider: string;
5
+ readonly model: string;
6
+ readonly taskClass: 'fast' | 'balanced' | 'strong';
7
+ readonly reason: 'short-text-turn' | 'standard-turn' | 'large-structured-turn' | 'image-capability';
8
+ readonly candidateCount: number;
9
+ }
10
+ interface AttributionState {
11
+ readonly turn: number;
12
+ readonly value: AutoModelAttribution;
13
+ }
14
+ interface Match {
15
+ readonly event: unknown;
16
+ }
17
+ interface Context {
18
+ readonly state?: AttributionState;
19
+ readonly matches: readonly Match[];
20
+ }
21
+ interface LocationData {
22
+ readonly kind: 'turn';
23
+ readonly turn: number;
24
+ readonly key: typeof AUTO_MODEL_ATTRIBUTION_KEY;
25
+ readonly value: AutoModelAttribution;
26
+ }
27
+ export declare const autoModelAttributionDefinition: {
28
+ kind: string;
29
+ match(event: unknown): {
30
+ id: string;
31
+ role: "start";
32
+ } | null;
33
+ start(_context: Context, match: Match): AttributionState;
34
+ update(context: Context & {
35
+ readonly state: AttributionState;
36
+ }): AttributionState;
37
+ buildLocationData(context: Context, scope: string, previous: LocationData | null): LocationData | null;
38
+ };
39
+ export declare function installAutoModelPresentation(capabilities: {
40
+ readonly slots: unknown;
41
+ readonly uiConversation: unknown;
42
+ readonly diagnostic: (code: string) => void;
43
+ }): Dispose;
44
+ export {};
45
+ //# sourceMappingURL=auto-model-presentation.d.ts.map
@@ -0,0 +1,26 @@
1
+ import type { AccountModelDescriptor } from './account-model-catalog.ts';
2
+ export type AutoModelClass = 'fast' | 'balanced' | 'strong';
3
+ export interface AutoModelFeatures {
4
+ readonly taskClass: AutoModelClass;
5
+ readonly textLength: number;
6
+ readonly codeFenceCount: number;
7
+ readonly requiresImage: boolean;
8
+ }
9
+ export interface AutoModelDecision {
10
+ readonly model: AccountModelDescriptor;
11
+ readonly taskClass: AutoModelClass;
12
+ readonly reason: 'short-text-turn' | 'standard-turn' | 'large-structured-turn' | 'image-capability';
13
+ readonly candidateCount: number;
14
+ }
15
+ export declare class AutoModelRoutingError extends Error {
16
+ readonly code: 'COPILOT_AUTO_NO_ELIGIBLE_MODEL';
17
+ constructor(code: 'COPILOT_AUTO_NO_ELIGIBLE_MODEL');
18
+ }
19
+ export declare function classifyAutoModelTurn(messages: readonly unknown[]): AutoModelFeatures;
20
+ /**
21
+ * MVP policy: filter only by account-verified hard capabilities, then choose a
22
+ * deterministic capacity tier. Capacity is not a quality, latency or price claim.
23
+ */
24
+ export declare function selectAutoModel(models: readonly AccountModelDescriptor[], messages: readonly unknown[]): AutoModelDecision;
25
+ export declare function autoModelInputModalities(models: readonly AccountModelDescriptor[]): readonly ('text' | 'image')[];
26
+ //# sourceMappingURL=auto-model-routing.d.ts.map
@@ -3,4 +3,5 @@ export declare const GITHUB_COPILOT_CREDENTIAL_KEY = "llm-pi-ai/github-copilot";
3
3
  export declare const GITHUB_COPILOT_PROVIDER_ID = "github-copilot";
4
4
  export declare const GITHUB_COPILOT_PREVIEW_PROVIDER_ID = "github-copilot-preview";
5
5
  export declare const GITHUB_COPILOT_PREVIEW_MODEL_ID = "gpt-6-astra";
6
+ export declare const GITHUB_COPILOT_AUTO_MODEL_ID = "auto";
6
7
  //# sourceMappingURL=copilot-identity.d.ts.map
@@ -0,0 +1,207 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>DSH Auto model - interaction mockup</title>
7
+ <style>
8
+ :root { color-scheme: dark; font-family: "Segoe UI", system-ui, sans-serif; background: #0b0e14; color: #e9edf6; }
9
+ * { box-sizing: border-box; }
10
+ body { margin: 0; }
11
+ button { font: inherit; cursor: pointer; }
12
+ .frame { min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0, 1fr); }
13
+ aside { background: #10141c; border-right: 1px solid #252b39; padding: 28px 18px; }
14
+ .brand { display: flex; align-items: center; gap: 11px; font-size: 16px; font-weight: 720; padding: 0 10px 32px; }
15
+ .mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: white; background: linear-gradient(145deg, #566cff, #8c61fc); }
16
+ .section-label { color: #7f899c; font-size: 11px; letter-spacing: .13em; font-weight: 700; padding: 0 12px 12px; }
17
+ .nav { display: block; color: #a7b0c1; border-radius: 10px; padding: 12px; margin-bottom: 5px; font-size: 14px; }
18
+ .nav.active { color: #f5f7fd; background: #222b42; }
19
+ .sidebar-foot { margin-top: 52px; padding: 14px 12px; border-top: 1px solid #242b38; color: #8e9aab; font-size: 12px; line-height: 1.6; }
20
+ main { min-width: 0; padding: 26px clamp(20px, 5vw, 80px) 32px; }
21
+ .top { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #9ca7b9; font-size: 13px; }
22
+ .tag { color: #9fb3ff; border: 1px solid #353e60; background: #202945; border-radius: 99px; padding: 6px 10px; font-size: 11px; }
23
+ .content { max-width: 860px; margin: 46px auto 0; }
24
+ .eyebrow { color: #9da7bb; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
25
+ h1 { font-size: clamp(24px, 3vw, 34px); line-height: 1.2; letter-spacing: -.03em; margin: 10px 0 11px; }
26
+ .intro { color: #a3aec1; font-size: 14px; line-height: 1.7; margin: 0 0 27px; }
27
+ .tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid #293144; gap: 25px; margin-bottom: 25px; }
28
+ .tabs button { color: #8d9aaf; background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 12px 3px; font-size: 14px; }
29
+ .tabs button.active { color: #d8e3ff; border-color: #758cff; }
30
+ .timeline { display: grid; gap: 16px; min-height: 275px; }
31
+ .bubble { border: 1px solid #2b3342; background: #171c27; border-radius: 15px; padding: 17px 20px; }
32
+ .bubble.user { margin-left: 12%; background: #20283a; border-color: #34415f; }
33
+ .bubble h2 { font-size: 12px; font-weight: 650; margin: 0 0 9px; color: #a5b2c8; }
34
+ .bubble p { font-size: 14px; line-height: 1.6; margin: 0; }
35
+ .answer-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 18px; color: #8995a8; font-size: 12px; }
36
+ .footer-actions, .footer-meta { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 12px; }
37
+ .footer-meta { position: relative; }
38
+ .footer-actions { font-size: 16px; letter-spacing: .06em; }
39
+ .route { color: #aebbd0; }
40
+ .explain { font-size: 12px; }
41
+ .explain summary { display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1px solid #66748a; border-radius: 50%; cursor: pointer; list-style: none; font-size: 11px; line-height: 1; }
42
+ .explain summary::-webkit-details-marker { display: none; }
43
+ .explain span { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 2; width: min(320px, 80vw); padding: 10px 12px; border: 1px solid #3e4b65; border-radius: 9px; background: #222b3b; color: #d5deef; line-height: 1.5; box-shadow: 0 8px 24px #0008; }
44
+ .child-card { border: 1px solid #465477; background: #1b2434; border-radius: 15px; padding: 18px 20px; }
45
+ .child-card[hidden], .child-override[hidden] { display: none; }
46
+ .child-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
47
+ .child-heading strong { font-size: 13px; }
48
+ .child-heading span { font-size: 11px; color: #97a7c1; }
49
+ .child-card p { font-size: 13px; color: #b7c5d9; line-height: 1.5; margin: 0 0 13px; }
50
+ .child-override { background: transparent; border: 1px solid #43526e; color: #bcccdf; border-radius: 8px; padding: 6px 9px; font-size: 11px; margin-bottom: 12px; }
51
+ .composer { margin-top: 26px; border: 1px solid #596fbb; background: #171c29; border-radius: 16px; box-shadow: 0 0 0 4px #28376130; padding: 18px; position: relative; }
52
+ .input-placeholder { color: #8996ad; font-size: 14px; min-height: 65px; }
53
+ .toolbar { display: flex; align-items: center; gap: 9px; }
54
+ .tool { background: #252d3e; color: #c9d5e9; border: 1px solid #394357; border-radius: 9px; padding: 8px 11px; font-size: 12px; }
55
+ .tool:hover, .option:hover { background: #303b56; }
56
+ .picker-trigger { background: #263457; border-color: #5367a5; color: #dfe7ff; }
57
+ .send { margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 10px; background: #6887ff; color: white; }
58
+ .menu { display: none; position: absolute; bottom: 59px; left: 18px; width: min(395px, calc(100% - 36px)); max-height: min(540px, 70vh); overflow-y: auto; background: #202634; border: 1px solid #3c465b; border-radius: 16px; box-shadow: 0 20px 55px #000a; padding: 8px; z-index: 5; }
59
+ .menu.open { display: block; }
60
+ .menu-title { display: flex; justify-content: space-between; color: #a4b0c5; font-size: 12px; padding: 10px 12px 8px; }
61
+ .menu-title span:last-child { color: #8f9aad; }
62
+ .provider-header { display: flex; justify-content: space-between; align-items: center; color: #d5deef; font-size: 12px; font-weight: 700; padding: 13px 12px 5px; }
63
+ .provider-header span { font-size: 10px; font-weight: 500; color: #93a1b8; }
64
+ .option { display: flex; align-items: center; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 10px; color: #e9edf6; padding: 12px; gap: 12px; }
65
+ .option.active { background: #2a3556; }
66
+ .option .icon { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; background: #394e91; color: #f2f4ff; }
67
+ .option .model-icon { background: #39404f; }
68
+ .option .option-text { display: grid; gap: 4px; flex: 1; }
69
+ .option small { color: #9ba8bd; font-size: 11px; line-height: 1.4; }
70
+ .check { color: #91a7ff; font-weight: 700; }
71
+ .divider { border-top: 1px solid #374152; margin: 7px 7px; }
72
+ .footnote { color: #8290a5; font-size: 12px; line-height: 1.6; margin: 16px 3px 0; }
73
+ .goal-steps { display: grid; gap: 10px; margin-top: 4px; }
74
+ .goal-step { border: 1px solid #334057; border-radius: 10px; padding: 10px 12px; color: #b4c0d2; font-size: 12px; }
75
+ .goal-step.current { border-color: #5b73c0; background: #242e4c; color: #e6eaff; }
76
+ @media (max-width: 740px) { .frame { grid-template-columns: 1fr; } aside { display: none; } main { padding: 20px; } .content { margin-top: 32px; } .bubble.user { margin-left: 0; } .child-heading { flex-wrap: wrap; } }
77
+ </style>
78
+ </head>
79
+ <body>
80
+ <div class="frame">
81
+ <aside>
82
+ <div class="brand"><span class="mark">✦</span> DeepSeek Harness</div>
83
+ <div class="section-label">WORKSPACE</div>
84
+ <div class="nav active">◈ &nbsp; Auto model design</div>
85
+ <div class="nav">◻ &nbsp; Sessions</div>
86
+ <div class="nav">◎ &nbsp; Goals</div>
87
+ <div class="sidebar-foot">Interaction concept only.<br>Not connected to a model or account.</div>
88
+ </aside>
89
+ <main>
90
+ <header class="top"><span>Sessions &nbsp; / &nbsp; Auto model design</span><span class="tag">INTERACTIVE MOCKUP</span></header>
91
+ <div class="content">
92
+ <div class="eyebrow">Model routing · MVP concept</div>
93
+ <h1>Auto within GitHub Copilot. Manual models everywhere else.</h1>
94
+ <p class="intro">Pick Auto under GitHub Copilot to route between eligible Copilot models. Other providers remain available for manual selection; Auto never crosses provider boundaries. The actual model appears beside the timestamp at the end of each completed answer.</p>
95
+ <div class="tabs" role="tablist" aria-label="Example scenario">
96
+ <button id="chatTab" role="tab" aria-selected="true" class="active">Chat turn</button>
97
+ <button id="goalTab" role="tab" aria-selected="false">Goal rounds</button>
98
+ <button id="childTab" role="tab" aria-selected="false">Subagent</button>
99
+ </div>
100
+ <div class="timeline" aria-live="polite">
101
+ <div class="bubble user"><h2 id="userLabel">You · new turn</h2><p id="userText">Explain why this function returns an empty result.</p></div>
102
+ <div class="bubble">
103
+ <p id="assistantText">I’ll inspect the function and its call site, then explain the condition that produces the empty result.</p>
104
+ <div id="scenarioSteps" class="goal-steps" hidden></div>
105
+ <div class="answer-footer">
106
+ <span class="footer-actions" aria-label="Answer actions">▢ &nbsp; ♡ &nbsp; ⋯</span>
107
+ <span class="footer-meta"><span>▤ Usage 12.4k tok</span><span>◷ Ran for 18s</span><time datetime="2026-09-30T22:12:00+08:00">22:12</time><span id="realModel" class="route">Auto · Copilot model A</span><details class="explain"><summary aria-label="Why this model" title="Why this model">?</summary><span id="reason">Routing reason: bounded explanation · The model stays fixed through tools and follow-up steps in this turn.</span></details></span>
108
+ </div>
109
+ </div>
110
+ <div class="child-card" id="childCard" hidden>
111
+ <div class="child-heading"><strong>↳ Subagent · regression investigator</strong><span>Separate session · own turn</span></div>
112
+ <button class="child-override" id="childOverride" type="button">Preview explicit child override</button>
113
+ <p>I’ll trace the failing test and check the affected API contract.</p>
114
+ <div class="answer-footer">
115
+ <span class="footer-actions" aria-label="Subagent answer actions">▢ &nbsp; ♡ &nbsp; ⋯</span>
116
+ <span class="footer-meta"><span>▤ Usage 8.2k tok</span><span>◷ Ran for 12s</span><time datetime="2026-09-30T22:13:00+08:00">22:13</time><span id="childModel" class="route">Inherited · Copilot model A</span><details class="explain"><summary aria-label="Why this model" title="Why this model">?</summary><span id="childReason">Native MVP behavior: the child inherits the parent’s resolved concrete model.</span></details></span>
117
+ </div>
118
+ </div>
119
+ </div>
120
+ <div class="composer">
121
+ <div class="menu" id="picker" aria-label="Model picker">
122
+ <div class="menu-title"><span>Choose a model</span><span>Across providers</span></div>
123
+ <div class="provider-header">GitHub Copilot <span>Account models</span></div>
124
+ <button class="option active" data-model="auto"><span class="icon">✦</span><span class="option-text"><strong>Auto</strong><small>Choose one eligible Copilot model per turn. Copilot only.</small></span><span class="check">✓</span></button>
125
+ <button class="option" data-model="copilot-a"><span class="icon model-icon">A</span><span class="option-text"><strong>Copilot model A</strong><small>Use this specific Copilot model.</small></span><span class="check"></span></button>
126
+ <button class="option" data-model="copilot-b"><span class="icon model-icon">B</span><span class="option-text"><strong>Copilot model B</strong><small>Use this specific Copilot model.</small></span><span class="check"></span></button>
127
+ <div class="divider"></div>
128
+ <div class="provider-header">DeepSeek <span>Manual selection only</span></div>
129
+ <button class="option" data-model="deepseek-chat"><span class="icon model-icon">D</span><span class="option-text"><strong>DeepSeek Chat</strong><small>Different provider · no Copilot Auto routing.</small></span><span class="check"></span></button>
130
+ </div>
131
+ <div class="input-placeholder">Ask a follow-up or continue this goal…</div>
132
+ <div class="toolbar"><button class="tool" aria-label="Add attachment">+</button><button class="tool picker-trigger" id="trigger" aria-expanded="false" aria-controls="picker">GitHub Copilot · Auto ⌄</button><button class="send" aria-label="Send" title="Illustration only">↑</button></div>
133
+ </div>
134
+ <p class="footnote">Concept only: the answer-footer model label is a proposed addition, not current DSH UI; current DSH shows the route inside the end-of-turn usage details in detailed mode. Copilot model A/B are placeholders, not account models or benchmark rankings. In the plugin-only MVP, native children inherit the parent’s resolved concrete model; independent child Auto is deferred because unchanged Core does not preserve enough Auto intent and override evidence. Selecting through the current native picker also updates the future global default.</p>
135
+ </div>
136
+ </main>
137
+ </div>
138
+ <script>
139
+ const picker = document.querySelector('#picker');
140
+ const trigger = document.querySelector('#trigger');
141
+ const options = [...document.querySelectorAll('[data-model]')];
142
+ const models = {
143
+ 'copilot-a': { provider: 'GitHub Copilot', name: 'Copilot model A' },
144
+ 'copilot-b': { provider: 'GitHub Copilot', name: 'Copilot model B' },
145
+ 'deepseek-chat': { provider: 'DeepSeek', name: 'DeepSeek Chat' }
146
+ };
147
+ let selected = 'auto';
148
+ let scenario = 'chat';
149
+ let childOverridden = false;
150
+ function render() {
151
+ for (const tab of ['chat', 'goal', 'child']) {
152
+ const element = document.querySelector(`#${tab}Tab`);
153
+ element.classList.toggle('active', scenario === tab);
154
+ element.setAttribute('aria-selected', String(scenario === tab));
155
+ }
156
+ const auto = selected === 'auto';
157
+ const parentModel = auto ? models['copilot-a'] : models[selected];
158
+ const real = auto && scenario === 'goal' ? models['copilot-b'] : parentModel;
159
+ const childModel = auto ? (childOverridden ? models['copilot-b'] : real) : parentModel;
160
+ trigger.textContent = `${parentModel.provider} · ${auto ? 'Auto' : parentModel.name} ⌄`;
161
+ document.querySelector('#realModel').textContent = `${auto ? 'Auto' : real.provider} · ${real.name}`;
162
+ document.querySelector('#userLabel').textContent = scenario === 'goal' ? 'Goal · continuation round 2' : scenario === 'child' ? 'Parent · delegate a task' : 'You · new turn';
163
+ document.querySelector('#userText').textContent = scenario === 'goal' ? 'Continue the goal: investigate the failing integration test and update the implementation.' : scenario === 'child' ? 'Investigate the regression in a separate subagent while I review the API change.' : 'Explain why this function returns an empty result.';
164
+ document.querySelector('#assistantText').textContent = scenario === 'goal' ? 'This is a new Goal round. I’ll investigate the failure, make a focused fix and run the relevant test.' : scenario === 'child' ? 'I’ll review the API change while the subagent investigates the regression.' : 'I’ll inspect the function and its call site, then explain the condition that produces the empty result.';
165
+ document.querySelector('#reason').textContent = auto ? (scenario === 'goal' ? 'Routing reason: broader debugging work · The model stays fixed for every step in round 2.' : scenario === 'child' ? 'Parent selected Auto · the native child inherits this turn’s resolved concrete model.' : 'Routing reason: bounded explanation · The model stays fixed through tools and follow-up steps in this turn.') : `Manual selection · Auto is off for ${parentModel.provider}.`;
166
+ const steps = document.querySelector('#scenarioSteps');
167
+ steps.hidden = scenario !== 'goal';
168
+ steps.innerHTML = scenario === 'goal'
169
+ ? '<div class="goal-step">Round 1 · inspect the issue</div><div class="goal-step current">Round 2 · debug, fix and run tests (one model throughout)</div>'
170
+ : '';
171
+ document.querySelector('#childCard').hidden = scenario !== 'child';
172
+ document.querySelector('#childModel').textContent = `${auto && !childOverridden ? 'Inherited' : childModel.provider} · ${childModel.name}`;
173
+ document.querySelector('#childReason').textContent = auto ? childOverridden
174
+ ? 'Explicit child model overrides Auto. The parent remains on Auto.'
175
+ : 'Native MVP behavior: the child inherits the parent’s resolved concrete model; independent child Auto is deferred.'
176
+ : `The child inherits ${parentModel.provider} / ${parentModel.name}; no Auto routing.`;
177
+ const override = document.querySelector('#childOverride');
178
+ override.hidden = !auto;
179
+ override.textContent = childOverridden ? 'Remove child override' : 'Preview explicit child override';
180
+ for (const option of options) {
181
+ const active = option.dataset.model === selected;
182
+ option.classList.toggle('active', active);
183
+ option.querySelector('.check').textContent = active ? '✓' : '';
184
+ }
185
+ }
186
+ trigger.addEventListener('click', () => {
187
+ const open = picker.classList.toggle('open');
188
+ trigger.setAttribute('aria-expanded', String(open));
189
+ });
190
+ for (const option of options) option.addEventListener('click', () => {
191
+ selected = option.dataset.model;
192
+ childOverridden = false;
193
+ picker.classList.remove('open');
194
+ trigger.setAttribute('aria-expanded', 'false');
195
+ render();
196
+ });
197
+ document.querySelector('#chatTab').addEventListener('click', () => { scenario = 'chat'; render(); });
198
+ document.querySelector('#goalTab').addEventListener('click', () => { scenario = 'goal'; render(); });
199
+ document.querySelector('#childTab').addEventListener('click', () => { scenario = 'child'; render(); });
200
+ document.querySelector('#childOverride').addEventListener('click', () => { childOverridden = !childOverridden; render(); });
201
+ document.addEventListener('keydown', event => {
202
+ if (event.key === 'Escape') { picker.classList.remove('open'); trigger.setAttribute('aria-expanded', 'false'); }
203
+ });
204
+ render();
205
+ </script>
206
+ </body>
207
+ </html>
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.39",
4
+ "version": "0.4.0-alpha.42",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "registry": "https://registry.npmjs.org/",
@@ -59,6 +59,8 @@
59
59
  "docs/official-first-020-rc2.md",
60
60
  "docs/copilot-compaction.md",
61
61
  "docs/copilot-usage.md",
62
+ "docs/automatic-model-routing.md",
63
+ "output/auto-model-mockup/index.html",
62
64
  "docs/images/dual-model-provenance.json",
63
65
  "scripts/check-search-composition.mjs",
64
66
  "docs/images/"