dsh-github-copilot 0.1.0-alpha.1.dsh.0.2.1.alpha.5
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 +439 -0
- package/CHANGELOG.md +875 -0
- package/CONTRIBUTING.md +55 -0
- package/LICENSE +21 -0
- package/README.md +366 -0
- package/README.zh.md +341 -0
- package/SECURITY.md +29 -0
- package/cordis.patch.yml +16 -0
- package/deployment-baseline.json +1580 -0
- package/docs/account-management-experience.md +143 -0
- package/docs/agent-readiness.md +110 -0
- package/docs/auto-high-cost.md +255 -0
- package/docs/auto-iteration-review.json +22 -0
- package/docs/auto-review-sampling.md +60 -0
- package/docs/auto-task-routing.md +341 -0
- package/docs/automatic-model-routing.md +236 -0
- package/docs/copilot-accounts.md +424 -0
- package/docs/copilot-compaction.md +148 -0
- package/docs/copilot-usage.md +133 -0
- package/docs/dual-model.md +66 -0
- package/docs/evidence-driven-iteration.md +86 -0
- package/docs/image-input-compatibility.md +64 -0
- package/docs/images/copilot-accounts-credits.png +0 -0
- package/docs/images/copilot-accounts.png +0 -0
- package/docs/images/copilot-current-provenance.json +39 -0
- package/docs/images/copilot-model-preferences.png +0 -0
- package/docs/images/copilot-search-routing.png +0 -0
- package/docs/images/copilot-session-continuation.png +0 -0
- package/docs/images/dual-model-desktop.png +0 -0
- package/docs/images/dual-model-mobile.png +0 -0
- package/docs/images/dual-model-provenance.json +35 -0
- package/docs/images/parent-model-follow.png +0 -0
- package/docs/manual-compaction-recovery.md +109 -0
- package/docs/mockups/copilot-account-dropdown.html +71 -0
- package/docs/mockups/copilot-account-management.html +393 -0
- package/docs/model-compatibility-acceptance.md +182 -0
- package/docs/npm-distribution.md +202 -0
- package/docs/official-first-016-alpha2.md +66 -0
- package/docs/official-first-020-rc1.md +32 -0
- package/docs/official-first-020-rc2.md +17 -0
- package/docs/official-first-021-alpha4.md +157 -0
- package/docs/official-first-021-alpha5.md +83 -0
- package/docs/plugin-diagnostics.md +605 -0
- package/docs/session-continuation.md +141 -0
- package/docs/session-search-routing.md +133 -0
- package/docs/single-route-migration.md +131 -0
- package/docs/web-lifecycle-rc2.md +55 -0
- package/lib/client.js +13236 -0
- package/lib/client.js.map +1 -0
- package/lib/copilot-identity-DRZY_d2X.js +15 -0
- package/lib/diagnostics-analysis-io.js +78 -0
- package/lib/diagnostics-analysis.js +427 -0
- package/lib/diagnostics-types-CF-qg8Do.js +708 -0
- package/lib/index.js +15661 -0
- package/lib/manual-compaction-recovery.js +485 -0
- package/lib/remote.js +1507 -0
- package/lib/request-budget-DLY_aRq0.js +87 -0
- package/lib/routed-web.js +120 -0
- package/lib/search-routing-CV2hs8as.js +792 -0
- package/lib/types/account-dropdown.d.ts +22 -0
- package/lib/types/account-model-auth.d.ts +15 -0
- package/lib/types/account-model-catalog.d.ts +70 -0
- package/lib/types/account-model-source.d.ts +85 -0
- package/lib/types/agent-compaction.d.ts +4 -0
- package/lib/types/authorization-code-clipboard.d.ts +4 -0
- package/lib/types/authorization-controller.d.ts +121 -0
- package/lib/types/auto-allocation-card.d.ts +9 -0
- package/lib/types/auto-allocation-diagnostics.d.ts +126 -0
- package/lib/types/auto-allocation-evidence.d.ts +44 -0
- package/lib/types/auto-allocation.d.ts +47 -0
- package/lib/types/auto-assessment-evidence.d.ts +111 -0
- package/lib/types/auto-model-host.d.ts +30 -0
- package/lib/types/auto-model-intent.d.ts +36 -0
- package/lib/types/auto-model-presentation.d.ts +57 -0
- package/lib/types/auto-model-routing.d.ts +64 -0
- package/lib/types/auto-review-sampling.d.ts +6 -0
- package/lib/types/auto-selection-explanation.d.ts +9 -0
- package/lib/types/auto-task-assessment.d.ts +49 -0
- package/lib/types/auto-task-classifier.d.ts +10 -0
- package/lib/types/background-compaction.d.ts +30 -0
- package/lib/types/client.d.ts +129 -0
- package/lib/types/compact-account.d.ts +42 -0
- package/lib/types/compaction-continuation-ui.d.ts +29 -0
- package/lib/types/compaction-continuation.d.ts +48 -0
- package/lib/types/compaction-input-estimate.d.ts +28 -0
- package/lib/types/compaction-pressure.d.ts +23 -0
- package/lib/types/compaction-replay.d.ts +18 -0
- package/lib/types/compatibility.d.ts +17 -0
- package/lib/types/composer-notice-style.d.ts +7 -0
- package/lib/types/config.d.ts +141 -0
- package/lib/types/content-file.d.ts +10 -0
- package/lib/types/context-evidence-ui.d.ts +28 -0
- package/lib/types/context-evidence.d.ts +256 -0
- package/lib/types/context-usage.d.ts +4 -0
- package/lib/types/copilot-account-presentation.d.ts +7 -0
- package/lib/types/copilot-accounts-card.d.ts +43 -0
- package/lib/types/copilot-accounts-host.d.ts +93 -0
- package/lib/types/copilot-accounts-remote.d.ts +85 -0
- package/lib/types/copilot-accounts-types.d.ts +43 -0
- package/lib/types/copilot-auth.d.ts +31 -0
- package/lib/types/copilot-grant.d.ts +11 -0
- package/lib/types/copilot-identity.d.ts +11 -0
- package/lib/types/copilot-request.d.ts +11 -0
- package/lib/types/copilot-stream-liveness.d.ts +23 -0
- package/lib/types/copilot-usage-card.d.ts +51 -0
- package/lib/types/copilot-usage-host.d.ts +61 -0
- package/lib/types/copilot-usage-normalize.d.ts +9 -0
- package/lib/types/copilot-usage-remote.d.ts +63 -0
- package/lib/types/copilot-usage-types.d.ts +20 -0
- package/lib/types/copilot-usage-ui.d.ts +4 -0
- package/lib/types/current-provider.d.ts +59 -0
- package/lib/types/deepseek-search-fallback.d.ts +11 -0
- package/lib/types/diagnostics-analysis-io.d.ts +23 -0
- package/lib/types/diagnostics-analysis.d.ts +298 -0
- package/lib/types/diagnostics-card.d.ts +12 -0
- package/lib/types/diagnostics-client.d.ts +13 -0
- package/lib/types/diagnostics-collector.d.ts +50 -0
- package/lib/types/diagnostics-host.d.ts +183 -0
- package/lib/types/diagnostics-remote.d.ts +113 -0
- package/lib/types/diagnostics-types.d.ts +893 -0
- package/lib/types/dual-model-host.d.ts +119 -0
- package/lib/types/dual-model-remote.d.ts +63 -0
- package/lib/types/dual-model-types.d.ts +34 -0
- package/lib/types/external-link.d.ts +3 -0
- package/lib/types/failure.d.ts +38 -0
- package/lib/types/http.d.ts +48 -0
- package/lib/types/image-input-admission.d.ts +5 -0
- package/lib/types/index.d.ts +39 -0
- package/lib/types/manual-compaction-recovery.d.ts +67 -0
- package/lib/types/migration-status.d.ts +50 -0
- package/lib/types/model-exclusions.d.ts +15 -0
- package/lib/types/model-preferences-card.d.ts +9 -0
- package/lib/types/model-protocol.d.ts +31 -0
- package/lib/types/native-select-style.d.ts +4 -0
- package/lib/types/native-settings-style.d.ts +10 -0
- package/lib/types/parent-model-follow-card.d.ts +32 -0
- package/lib/types/parent-model-follow.d.ts +44 -0
- package/lib/types/pi-provider-bridge.d.ts +22 -0
- package/lib/types/plan.d.ts +148 -0
- package/lib/types/pre-step-pressure.d.ts +8 -0
- package/lib/types/preview-provider.d.ts +77 -0
- package/lib/types/preview-route.d.ts +76 -0
- package/lib/types/probe.d.ts +39 -0
- package/lib/types/remote-codec.d.ts +10 -0
- package/lib/types/remote.d.ts +202 -0
- package/lib/types/replay-recovery-host.d.ts +28 -0
- package/lib/types/replay-recovery-remote.d.ts +14 -0
- package/lib/types/replay-recovery-types.d.ts +24 -0
- package/lib/types/replay-recovery-ui.d.ts +28 -0
- package/lib/types/replay-recovery.d.ts +17 -0
- package/lib/types/request-body-composition.d.ts +17 -0
- package/lib/types/request-body-evidence.d.ts +37 -0
- package/lib/types/request-body-timeout-marker.d.ts +2 -0
- package/lib/types/request-body-timeout.d.ts +4 -0
- package/lib/types/request-budget.d.ts +58 -0
- package/lib/types/request-diagnostics.d.ts +278 -0
- package/lib/types/request-upload-evidence.d.ts +23 -0
- package/lib/types/response-error-body.d.ts +3 -0
- package/lib/types/responses-reasoning-text.d.ts +24 -0
- package/lib/types/responses-reasoning.d.ts +7 -0
- package/lib/types/responses-replay-compat.d.ts +31 -0
- package/lib/types/responses-request-compression.d.ts +33 -0
- package/lib/types/route-ownership.d.ts +70 -0
- package/lib/types/routed-web.d.ts +50 -0
- package/lib/types/search-backend.d.ts +16 -0
- package/lib/types/search-routing-host.d.ts +19 -0
- package/lib/types/search-routing-policy.d.ts +18 -0
- package/lib/types/search-routing-remote.d.ts +20 -0
- package/lib/types/search-routing.d.ts +43 -0
- package/lib/types/search-tool-routing.d.ts +22 -0
- package/lib/types/serialize.d.ts +106 -0
- package/lib/types/session-accounts-controller.d.ts +20 -0
- package/lib/types/session-accounts-host.d.ts +33 -0
- package/lib/types/session-accounts-remote.d.ts +114 -0
- package/lib/types/session-accounts.d.ts +38 -0
- package/lib/types/session-continuation-host.d.ts +45 -0
- package/lib/types/session-continuation-remote.d.ts +22 -0
- package/lib/types/session-continuation-types.d.ts +62 -0
- package/lib/types/session-continuation-ui.d.ts +49 -0
- package/lib/types/session-continuation.d.ts +14 -0
- package/lib/types/settings-reader.d.ts +16 -0
- package/lib/types/sse.d.ts +28 -0
- package/lib/types/temporary-models.d.ts +25 -0
- package/lib/types/tool-schema-compat.d.ts +17 -0
- package/lib/types/traditional-search.d.ts +17 -0
- package/lib/types/turn-model-provenance.d.ts +45 -0
- package/lib/types/turn-request-models.d.ts +55 -0
- package/lib/types/turn-selection-card.d.ts +24 -0
- package/lib/types/turn-selection-host.d.ts +35 -0
- package/lib/types/turn-selection-remote.d.ts +17 -0
- package/lib/types/turn-selection.d.ts +186 -0
- package/lib/types/turn-usage-evidence.d.ts +66 -0
- package/lib/types/turn-usage-notice.d.ts +7 -0
- package/lib/types/types.d.ts +69 -0
- package/lib/types/usage.d.ts +26 -0
- package/lib/types/watchdog.d.ts +22 -0
- package/lib/types/web-delegate.d.ts +12 -0
- package/lib/types/web-search-routing-card.d.ts +16 -0
- package/lib/types/web-search-routing-config.d.ts +12 -0
- package/lib/types/wire-anthropic.d.ts +37 -0
- package/lib/types/wire.d.ts +56 -0
- package/lib/web-delegate.js +9 -0
- package/output/auto-model-mockup/index.html +207 -0
- package/package.json +261 -0
- package/scripts/analyze-diagnostics.mjs +91 -0
- package/scripts/check-search-composition.mjs +191 -0
- package/scripts/iteration-review.mjs +53 -0
- package/scripts/release-policy.mjs +353 -0
- package/scripts/select-core-release.mjs +11 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-private wire types for the two search-capable protocols this
|
|
3
|
+
* package speaks, restricted to the shapes the capability probe consumes:
|
|
4
|
+
* the OpenAI Responses API `web_search_call` evidence item and the
|
|
5
|
+
* Anthropic-compatible Messages API `web_search_tool_result` block. The
|
|
6
|
+
* probe's verdict is structural — a reply containing the evidence item means
|
|
7
|
+
* the endpoint executed native search inside the request.
|
|
8
|
+
* @module dsh-github-copilot/types
|
|
9
|
+
*/
|
|
10
|
+
/** A `web_search_call` output item: evidence that the server ran the tool. */
|
|
11
|
+
export interface WebSearchCallItem {
|
|
12
|
+
readonly type: 'web_search_call';
|
|
13
|
+
readonly id?: string;
|
|
14
|
+
readonly status?: string;
|
|
15
|
+
readonly action?: {
|
|
16
|
+
readonly sources?: readonly ResponsesWebSearchSource[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** One Responses citation or search source. */
|
|
20
|
+
export interface ResponsesWebSearchSource {
|
|
21
|
+
readonly url?: string;
|
|
22
|
+
readonly title?: string;
|
|
23
|
+
readonly snippet?: string;
|
|
24
|
+
readonly published_at?: string;
|
|
25
|
+
}
|
|
26
|
+
/** One annotation on generated output text. */
|
|
27
|
+
export interface ResponsesAnnotation extends ResponsesWebSearchSource {
|
|
28
|
+
readonly type?: string;
|
|
29
|
+
}
|
|
30
|
+
/** Generated output text carrying optional URL citations. */
|
|
31
|
+
export interface ResponsesOutputText {
|
|
32
|
+
readonly type: 'output_text';
|
|
33
|
+
readonly text?: string;
|
|
34
|
+
readonly annotations?: readonly ResponsesAnnotation[];
|
|
35
|
+
}
|
|
36
|
+
/** A generated message in a non-streamed Responses envelope. */
|
|
37
|
+
export interface ResponsesMessageItem {
|
|
38
|
+
readonly type: 'message';
|
|
39
|
+
readonly content?: readonly ResponsesOutputText[];
|
|
40
|
+
}
|
|
41
|
+
/** Any output item consumed by the probe or traditional-search bridge. */
|
|
42
|
+
export type ResponseOutputItem = WebSearchCallItem | ResponsesMessageItem | {
|
|
43
|
+
readonly type: string;
|
|
44
|
+
};
|
|
45
|
+
/** The non-streamed Responses envelope the probe parses. */
|
|
46
|
+
export interface ResponsesResponse {
|
|
47
|
+
readonly id?: string;
|
|
48
|
+
readonly status?: string;
|
|
49
|
+
readonly output?: readonly ResponseOutputItem[];
|
|
50
|
+
}
|
|
51
|
+
/** A `web_search_result` item inside a `web_search_tool_result` block. */
|
|
52
|
+
export interface WebSearchResultItem {
|
|
53
|
+
readonly type: string;
|
|
54
|
+
readonly url: string;
|
|
55
|
+
}
|
|
56
|
+
/** A `web_search_tool_result` content block: the citeable result shape. */
|
|
57
|
+
export interface WebSearchToolResultBlock {
|
|
58
|
+
readonly type: 'web_search_tool_result';
|
|
59
|
+
readonly content?: readonly WebSearchResultItem[];
|
|
60
|
+
}
|
|
61
|
+
/** Any content block; only `web_search_tool_result` is consumed by the probe. */
|
|
62
|
+
export type ContentBlock = WebSearchToolResultBlock | {
|
|
63
|
+
readonly type: string;
|
|
64
|
+
};
|
|
65
|
+
/** The Messages response envelope the probe parses. */
|
|
66
|
+
export interface AnthropicResponse {
|
|
67
|
+
readonly content?: readonly ContentBlock[];
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Usage mapping for the inline wire path: Responses-API usage objects
|
|
3
|
+
* project onto the harness TokenUsage shape exactly like the pi-ai adapter
|
|
4
|
+
* (input minus cached, cache and reasoning split out as separate fields).
|
|
5
|
+
* @module dsh-github-copilot/usage
|
|
6
|
+
*/
|
|
7
|
+
import type { TokenUsage } from '@deepseek-ai/dsh-llm';
|
|
8
|
+
/** The usage object carried by `response.completed` / `response.incomplete` (snake_case wire fields). */
|
|
9
|
+
export interface WireUsage {
|
|
10
|
+
readonly input_tokens: number;
|
|
11
|
+
readonly output_tokens: number;
|
|
12
|
+
readonly total_tokens: number;
|
|
13
|
+
readonly input_tokens_details?: {
|
|
14
|
+
readonly cached_tokens?: number;
|
|
15
|
+
};
|
|
16
|
+
readonly output_tokens_details?: {
|
|
17
|
+
readonly reasoning_tokens?: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Map a wire usage object to the harness TokenUsage shape.
|
|
22
|
+
* @param usage - the provider usage object (snake_case wire fields).
|
|
23
|
+
* @returns the harness usage; cache and reasoning fields are omitted when absent.
|
|
24
|
+
*/
|
|
25
|
+
export declare function mapUsage(usage: WireUsage): TokenUsage;
|
|
26
|
+
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Idle watchdog for the inline wire path: aborts when no data arrives for a
|
|
3
|
+
* configurable interval. The timeout resets on every `reset()` call, so a
|
|
4
|
+
* slow but alive stream never trips it.
|
|
5
|
+
* @module dsh-github-copilot/watchdog
|
|
6
|
+
*/
|
|
7
|
+
/** Abort-triggering idle timer. */
|
|
8
|
+
export declare class IdleWatchdog {
|
|
9
|
+
private readonly ms;
|
|
10
|
+
readonly signal: AbortSignal;
|
|
11
|
+
private readonly controller;
|
|
12
|
+
private timer;
|
|
13
|
+
/**
|
|
14
|
+
* @param ms - the idle bound in milliseconds.
|
|
15
|
+
*/
|
|
16
|
+
constructor(ms: number);
|
|
17
|
+
/** Restart the idle window. Call after every received event. */
|
|
18
|
+
reset(): void;
|
|
19
|
+
/** Stop the timer and release the signal. */
|
|
20
|
+
dispose(): void;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=watchdog.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { WebRuntime } from '@deepseek-ai/dsh-web';
|
|
3
|
+
declare module '@deepseek-ai/cordis' {
|
|
4
|
+
interface Context {
|
|
5
|
+
githubCopilotOriginalWeb: WebRuntime;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/** Expose the unchanged official service from the bundle's named web isolate. */
|
|
9
|
+
export declare const name = "github-copilot-web-delegate";
|
|
10
|
+
export declare const inject: string[];
|
|
11
|
+
export declare function apply(ctx: Context): void;
|
|
12
|
+
//# sourceMappingURL=web-delegate.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
interface SearchRoutingCardProps {
|
|
4
|
+
readonly settings: ClientContext['remote']['settings'];
|
|
5
|
+
readonly routing: ClientContext['remote']['githubCopilotSearchRouting'];
|
|
6
|
+
readonly settingsRevision?: {
|
|
7
|
+
previous: number;
|
|
8
|
+
next: number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** Edit only explicit Copilot hosted-search leaves; provider routing remains a separate CAS. */
|
|
12
|
+
export declare function HostedSearchSettingsCard({ settings }: Pick<SearchRoutingCardProps, 'settings'>): ReactElement;
|
|
13
|
+
/** Save provider routing independently of account discovery and provider-specific model settings. */
|
|
14
|
+
export declare function WebSearchRoutingCard(props: SearchRoutingCardProps): ReactElement;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=web-search-routing-card.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import z from '@deepseek-ai/schemastery';
|
|
2
|
+
import type { SettingsNamespace } from '@deepseek-ai/dsh-settings';
|
|
3
|
+
import type { WebSearchRoutingConfig } from './search-routing-policy.ts';
|
|
4
|
+
export { normalizeWebSearchRouting } from './search-routing-policy.ts';
|
|
5
|
+
export type { WebSearchRoutingConfig, NormalizedWebSearchRouting } from './search-routing-policy.ts';
|
|
6
|
+
/** Plugin-owned settings namespace for cross-provider web-search routing. */
|
|
7
|
+
export declare const WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE: SettingsNamespace;
|
|
8
|
+
/** Sentinel that disables the default/fixed search backend. */
|
|
9
|
+
export declare const NO_DEFAULT_SEARCH_PROVIDER = "none";
|
|
10
|
+
/** User-facing routing settings; provider-specific credentials and models remain provider-owned. */
|
|
11
|
+
export declare const WebSearchRoutingConfigSchema: z<WebSearchRoutingConfig>;
|
|
12
|
+
//# sourceMappingURL=web-search-routing-config.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anthropic Messages wire for the inline web search plugin: intercepts an
|
|
3
|
+
* agent-loop model call, builds a Messages streaming request carrying the
|
|
4
|
+
* server-side `web_search_20250305` tool, and maps the Anthropic event
|
|
5
|
+
* stream onto the harness StreamChunk contract. Server-side search blocks
|
|
6
|
+
* (`server_tool_use` / `web_search_tool_result`) are skipped — the gateway
|
|
7
|
+
* executes the search inside the same request and the model answers from
|
|
8
|
+
* its results in the same turn. The generator NEVER throws; every failure
|
|
9
|
+
* becomes a finish chunk.
|
|
10
|
+
* @module dsh-github-copilot/wire-anthropic
|
|
11
|
+
*/
|
|
12
|
+
import type { GenerateOptions, StreamChunk, TokenUsage } from '@deepseek-ai/dsh-llm';
|
|
13
|
+
import type { SearchPlanCandidate } from './plan.ts';
|
|
14
|
+
import type { InlineConfig } from './config.ts';
|
|
15
|
+
import type { InlineHooks } from './wire.ts';
|
|
16
|
+
/** Map an Anthropic usage object onto the harness TokenUsage shape. */
|
|
17
|
+
export declare function mapAnthropicUsage(usage: {
|
|
18
|
+
readonly input_tokens?: number;
|
|
19
|
+
readonly output_tokens?: number;
|
|
20
|
+
readonly cache_read_input_tokens?: number;
|
|
21
|
+
readonly cache_creation_input_tokens?: number;
|
|
22
|
+
readonly output_tokens_details?: {
|
|
23
|
+
readonly thinking_tokens?: number;
|
|
24
|
+
};
|
|
25
|
+
}): TokenUsage;
|
|
26
|
+
/**
|
|
27
|
+
* Run one inline model call through the Anthropic Messages API with the
|
|
28
|
+
* server-side web search tool injected. Never throws; always ends with a
|
|
29
|
+
* finish chunk.
|
|
30
|
+
* @param request - the frozen agent-loop request.
|
|
31
|
+
* @param candidate - the settled endpoint facts (probe-verified).
|
|
32
|
+
* @param hooks - credential hooks.
|
|
33
|
+
* @param cfg - the current plugin configuration.
|
|
34
|
+
* @returns the StreamChunk stream for the loop's assembler.
|
|
35
|
+
*/
|
|
36
|
+
export declare function inlineAnthropicStream(request: GenerateOptions, candidate: SearchPlanCandidate, hooks: InlineHooks, cfg: InlineConfig): AsyncGenerator<StreamChunk>;
|
|
37
|
+
//# sourceMappingURL=wire-anthropic.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The short-circuit wire: intercepts an agent-loop model call, builds a
|
|
3
|
+
* streaming request carrying the server-side `web_search` tool, and maps the
|
|
4
|
+
* SSE events onto the harness StreamChunk contract. The generator NEVER
|
|
5
|
+
* throws — every failure becomes a finish chunk, exactly what the loop's
|
|
6
|
+
* catch-less `for await` requires. {@link inlineWireStream} settles the plan
|
|
7
|
+
* first and then dispatches to the protocol the VERIFIED candidate speaks, so
|
|
8
|
+
* the wire always matches the probe verdict (never the chat route snapshot).
|
|
9
|
+
*
|
|
10
|
+
* Server-side `web_search_call` items are skipped: the gateway executes the
|
|
11
|
+
* search inside the same request and the model answers from its results in
|
|
12
|
+
* the same turn, so the harness never sees a tool call. (UI search cards
|
|
13
|
+
* were removed — the added latency outweighed the visual value.)
|
|
14
|
+
* @module dsh-github-copilot/wire
|
|
15
|
+
*/
|
|
16
|
+
import type { GenerateOptions, StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
17
|
+
import type { SearchPlan, SearchPlanCandidate } from './plan.ts';
|
|
18
|
+
import type { ResponsesReasoningOptions } from './serialize.ts';
|
|
19
|
+
import type { ResolvedRequestAuth } from './copilot-request.ts';
|
|
20
|
+
import type { InlineConfig } from './config.ts';
|
|
21
|
+
/** Credential and cancellation hooks the stream resolves per operation. */
|
|
22
|
+
export interface InlineHooks {
|
|
23
|
+
/** Resolve one credential reference through the credentials seam. */
|
|
24
|
+
resolveApiKey: (candidate: SearchPlanCandidate) => Promise<string | ResolvedRequestAuth | undefined>;
|
|
25
|
+
/** Validate effective model/profile reasoning and return its mapped wire value. */
|
|
26
|
+
resolveResponsesReasoning?: (request: GenerateOptions, candidate: SearchPlanCandidate) => ResponsesReasoningOptions | undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Whether the request carries an image attachment. Image blocks retain the
|
|
30
|
+
* harness attachment object that the official vision channel must consume.
|
|
31
|
+
*/
|
|
32
|
+
export declare function contentHasImageAttachments(request: GenerateOptions): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Run one inline model call through whichever wire the settled candidate
|
|
35
|
+
* speaks. The plan is settled HERE — once — so the protocol choice follows
|
|
36
|
+
* the probe verdict instead of the chat route snapshot taken before the
|
|
37
|
+
* probe ran.
|
|
38
|
+
* @param request - the frozen agent-loop request.
|
|
39
|
+
* @param plan - the search plan owning endpoint facts.
|
|
40
|
+
* @param hooks - credential hooks.
|
|
41
|
+
* @param cfg - the current plugin configuration.
|
|
42
|
+
* @returns the StreamChunk stream for the loop's assembler.
|
|
43
|
+
*/
|
|
44
|
+
export declare function inlineWireStream(request: GenerateOptions, plan: SearchPlan, hooks: InlineHooks, cfg: InlineConfig): AsyncGenerator<StreamChunk>;
|
|
45
|
+
/**
|
|
46
|
+
* Run one inline model call: fetch the Responses endpoint with the
|
|
47
|
+
* server-side web tool injected and translate the SSE stream into harness
|
|
48
|
+
* chunks. Never throws; always ends with a finish chunk.
|
|
49
|
+
* @param request - the frozen agent-loop request.
|
|
50
|
+
* @param candidate - the settled endpoint facts (probe-verified).
|
|
51
|
+
* @param hooks - credential hooks.
|
|
52
|
+
* @param cfg - the current plugin configuration.
|
|
53
|
+
* @returns the StreamChunk stream for the loop's assembler.
|
|
54
|
+
*/
|
|
55
|
+
export declare function inlineStream(request: GenerateOptions, candidate: SearchPlanCandidate, hooks: InlineHooks, cfg: InlineConfig): AsyncGenerator<StreamChunk>;
|
|
56
|
+
//# sourceMappingURL=wire.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region lib/types/web-delegate.js
|
|
2
|
+
/** Expose the unchanged official service from the bundle's named web isolate. */
|
|
3
|
+
const name = "github-copilot-web-delegate";
|
|
4
|
+
const inject = ["web"];
|
|
5
|
+
function apply(ctx) {
|
|
6
|
+
ctx.provide("githubCopilotOriginalWeb", ctx.web);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { apply, inject, name };
|
|
@@ -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">◈ Auto model design</div>
|
|
85
|
+
<div class="nav">◻ Sessions</div>
|
|
86
|
+
<div class="nav">◎ 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 / 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">▢ ♡ ⋯</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">▢ ♡ ⋯</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>
|