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,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search-plan resolution: which protocol and endpoint native search runs
|
|
3
|
+
* through. The initiating Agent's captured chat route (selection plus the
|
|
4
|
+
* `llm-pi-ai` settings section) is detected and probed — its own protocol
|
|
5
|
+
* when that can search. The {@link SearchPlan} class owns the probe lifecycle so
|
|
6
|
+
* `available()` stays synchronous while the verdict lands in the background.
|
|
7
|
+
* @module dsh-github-copilot/plan
|
|
8
|
+
*/
|
|
9
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
10
|
+
import type { ProbeOutcome } from './probe.ts';
|
|
11
|
+
import type { CurrentChatRoute } from './current-provider.ts';
|
|
12
|
+
/** The two search-capable wire protocols this package speaks. */
|
|
13
|
+
export type SearchProtocol = 'openai-responses' | 'anthropic-messages';
|
|
14
|
+
/** Credential record that owns GitHub Copilot OAuth state and refresh. */
|
|
15
|
+
export declare const GITHUB_COPILOT_CREDENTIAL_KEY = "llm-pi-ai/github-copilot";
|
|
16
|
+
/** Default `anthropic-version` header value. */
|
|
17
|
+
export declare const DEFAULT_API_VERSION = "2023-06-01";
|
|
18
|
+
/**
|
|
19
|
+
* The server-side Responses web tool spellings. The standard `web_search`
|
|
20
|
+
* is the preferred Copilot spelling; `web_search_2025_08_26` is retained as
|
|
21
|
+
* a probe fallback for provider-side protocol variation.
|
|
22
|
+
*/
|
|
23
|
+
export type ResponsesWebSearchToolType = 'web_search' | 'web_search_2025_08_26';
|
|
24
|
+
/** Standard server-side web search tool type (OpenAI/DeepSeek official). */
|
|
25
|
+
export declare const WEB_SEARCH_TOOL_TYPE: ResponsesWebSearchToolType;
|
|
26
|
+
/**
|
|
27
|
+
* Versioned Responses spelling retained as a capability-probe fallback.
|
|
28
|
+
*/
|
|
29
|
+
export declare const RESPONSES_WEB_SEARCH_TOOL_TYPE: ResponsesWebSearchToolType;
|
|
30
|
+
/** Anthropic server-side web search tool type (versioned). */
|
|
31
|
+
export declare const ANTHROPIC_WEB_SEARCH_TOOL_TYPE = "web_search_20250305";
|
|
32
|
+
/**
|
|
33
|
+
* Fully defaulted endpoint facts one search (or probe) operation runs with.
|
|
34
|
+
* Every field is resolved once at plan build time so the adapters never fall
|
|
35
|
+
* back mid-operation.
|
|
36
|
+
*/
|
|
37
|
+
export interface SearchPlanCandidate {
|
|
38
|
+
readonly protocol: SearchProtocol;
|
|
39
|
+
/** Endpoint base; `/responses` or `/messages` is appended by the adapter. */
|
|
40
|
+
readonly baseURL: string;
|
|
41
|
+
readonly model: string;
|
|
42
|
+
/** Credential reference resolved through the credentials seam. */
|
|
43
|
+
readonly apiKeyEnv: string;
|
|
44
|
+
/** `anthropic-version` header value (anthropic-messages only). */
|
|
45
|
+
readonly apiVersion: string;
|
|
46
|
+
/** Static provider/model headers inherited from pi-ai's catalog. */
|
|
47
|
+
readonly headers?: Readonly<Record<string, string | null>>;
|
|
48
|
+
/**
|
|
49
|
+
* The Responses web tool spelling this candidate serves with (probe-verified;
|
|
50
|
+
* openai-responses only). The probe may settle on the fallback spelling, in
|
|
51
|
+
* which case the chosen candidate carries the verified one.
|
|
52
|
+
*/
|
|
53
|
+
readonly webSearchToolType?: ResponsesWebSearchToolType;
|
|
54
|
+
}
|
|
55
|
+
/** The plugin-config fields the plan reads; `apply` projects the full section onto this. */
|
|
56
|
+
export interface PlanConfig {
|
|
57
|
+
/** Whether a live capability probe verifies each candidate before use. */
|
|
58
|
+
readonly probe: boolean;
|
|
59
|
+
/** Bound on one probe request, in milliseconds. */
|
|
60
|
+
readonly probeTimeoutMs: number;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Normalize an anthropic-messages base so appending `/messages` reaches the
|
|
64
|
+
* Messages endpoint under either base convention: the SDK-style root
|
|
65
|
+
* (`https://api.anthropic.com` → `/v1/messages`) and the v1-included base
|
|
66
|
+
* (`https://api.deepseek.com/anthropic/v1` → `/messages`).
|
|
67
|
+
* @param baseURL - the configured or catalog base.
|
|
68
|
+
* @returns the base `/messages` is appended to.
|
|
69
|
+
*/
|
|
70
|
+
export declare function ensureV1Base(baseURL: string): string;
|
|
71
|
+
/**
|
|
72
|
+
* Return the selected Copilot model's native search protocol. No endpoint or
|
|
73
|
+
* cross-provider sibling is guessed.
|
|
74
|
+
* @param route - the current chat route facts.
|
|
75
|
+
* @returns the single native candidate, or none for an unsupported route.
|
|
76
|
+
*/
|
|
77
|
+
export declare function siblingCandidates(route: CurrentChatRoute): readonly {
|
|
78
|
+
protocol: SearchProtocol;
|
|
79
|
+
baseURL: string;
|
|
80
|
+
}[];
|
|
81
|
+
/**
|
|
82
|
+
* Resolve the candidate set for one plan from the current chat route. An
|
|
83
|
+
* empty result means the plugin auto-disables — nothing to probe, nothing to
|
|
84
|
+
* register.
|
|
85
|
+
* @param ctx - plugin context for route detection.
|
|
86
|
+
* @param config - the currently authoritative plan config.
|
|
87
|
+
* @returns the candidates in probe order.
|
|
88
|
+
*/
|
|
89
|
+
export declare function resolveCandidates(ctx: Context, _config: PlanConfig): readonly SearchPlanCandidate[];
|
|
90
|
+
/**
|
|
91
|
+
* Build only from the route captured by the caller, without rereading selection.
|
|
92
|
+
* @param route - operation-local route facts.
|
|
93
|
+
* @returns native Copilot candidates, or none without supported facts.
|
|
94
|
+
*/
|
|
95
|
+
export declare function candidatesForRoute(route: CurrentChatRoute | undefined): readonly SearchPlanCandidate[];
|
|
96
|
+
/** Lifecycle state of one search plan. */
|
|
97
|
+
export type SearchPlanStatus = 'probing' | 'ready' | 'failed';
|
|
98
|
+
/**
|
|
99
|
+
* One candidate set plus its probe lifecycle. The probe runs in the
|
|
100
|
+
* background so plugin load never blocks on a provider round-trip;
|
|
101
|
+
* `available()` stays synchronous and `settle()` awaits the verdict. A
|
|
102
|
+
* failed plan keeps its reason so the first search (or tool call) surfaces
|
|
103
|
+
* the auto-disable diagnostic instead of a bare "no provider" error.
|
|
104
|
+
*/
|
|
105
|
+
export declare class SearchPlan {
|
|
106
|
+
private readonly probe;
|
|
107
|
+
/** Captured owner/proof lifetime, shared by probes and every served operation. */
|
|
108
|
+
readonly signal?: AbortSignal | undefined;
|
|
109
|
+
readonly candidates: readonly SearchPlanCandidate[];
|
|
110
|
+
/** Resolves when the probe verdict (or the immediate decision) lands. */
|
|
111
|
+
readonly settled: Promise<void>;
|
|
112
|
+
private status;
|
|
113
|
+
private chosen;
|
|
114
|
+
private reason;
|
|
115
|
+
/**
|
|
116
|
+
* @param candidates - the candidates in probe order; empty disables the plan.
|
|
117
|
+
* @param probe - verifies one candidate; called sequentially until one passes.
|
|
118
|
+
* @param probeEnabled - when false the first candidate is trusted outright.
|
|
119
|
+
* @param signal - captured owner/proof cancellation, retained through final HTTP.
|
|
120
|
+
*/
|
|
121
|
+
constructor(candidates: readonly SearchPlanCandidate[], probe: (candidate: SearchPlanCandidate) => Promise<ProbeOutcome>, probeEnabled: boolean,
|
|
122
|
+
/** Captured owner/proof lifetime, shared by probes and every served operation. */
|
|
123
|
+
signal?: AbortSignal | undefined);
|
|
124
|
+
/** Probe candidates in order; the first supported verdict wins. */
|
|
125
|
+
private runProbe;
|
|
126
|
+
/**
|
|
127
|
+
* Cheap synchronous usability check for the listener gate. While probing
|
|
128
|
+
* the plan is PROVISIONALLY available — the first gated request may enter
|
|
129
|
+
* and await {@link settle} — so the probe verdict and the stream start in
|
|
130
|
+
* parallel; only a failed (or candidate-less) plan is unavailable and keeps
|
|
131
|
+
* the request on the normal adapter path.
|
|
132
|
+
* @returns whether a search can currently be served.
|
|
133
|
+
*/
|
|
134
|
+
available(): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Await the probe verdict and return the winning candidate.
|
|
137
|
+
* @returns the candidate whose probe passed (or the first, when probing is off).
|
|
138
|
+
* @throws WebError `WEB_PROVIDER_UNAVAILABLE` naming the auto-disable reason.
|
|
139
|
+
*/
|
|
140
|
+
settle(): Promise<SearchPlanCandidate>;
|
|
141
|
+
/** The candidate currently serving searches, once the plan settled on one. */
|
|
142
|
+
chosenCandidate(): SearchPlanCandidate | undefined;
|
|
143
|
+
/** The auto-disable reason, once a probe failed (or no candidate existed). */
|
|
144
|
+
failureReason(): string | undefined;
|
|
145
|
+
}
|
|
146
|
+
/** Whether two candidate sets are identical (skips re-probing on no-op settings changes). */
|
|
147
|
+
export declare function sameCandidates(left: readonly SearchPlanCandidate[], right: readonly SearchPlanCandidate[]): boolean;
|
|
148
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { CopilotCompactionPressureCallbacks } from './compaction-pressure.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Prevent a continuing, unchanged route's known pressure from becoming an
|
|
5
|
+
* unsampled model attempt. Final converted-request admission stays independent.
|
|
6
|
+
*/
|
|
7
|
+
export declare function installCopilotPreStepPressure(ctx: Context, callbacks: CopilotCompactionPressureCallbacks): () => void;
|
|
8
|
+
//# sourceMappingURL=pre-step-pressure.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Api, Model, StreamOptions, TranscriptContext } from '@earendil-works/pi-ai';
|
|
2
|
+
import type { AccountModelApi, AccountModelDescriptor } from './account-model-catalog.ts';
|
|
3
|
+
import type { CoreCompatibleProvider } from './pi-provider-bridge.ts';
|
|
4
|
+
import type { GitHubCopilotOAuthCredential } from './copilot-grant.ts';
|
|
5
|
+
import { CopilotResponsesReplayError } from './responses-replay-compat.ts';
|
|
6
|
+
import type { ResponsesRetryReplay } from './responses-replay-compat.ts';
|
|
7
|
+
import type { RequestDiagnosticHandle, RequestDiagnosticStart } from './request-diagnostics.ts';
|
|
8
|
+
import { CopilotStreamIdleError, CopilotStreamLiveness } from './copilot-stream-liveness.ts';
|
|
9
|
+
export type ManagedWireAbortCode = 'COPILOT_PREVIEW_CREDENTIAL_CHANGED' | 'COPILOT_PREVIEW_DISPOSED';
|
|
10
|
+
/** Identity, not upstream error text, proves that the plugin revoked this wire. */
|
|
11
|
+
export declare class ManagedWireAbortError extends Error {
|
|
12
|
+
readonly code: ManagedWireAbortCode;
|
|
13
|
+
constructor(code: ManagedWireAbortCode);
|
|
14
|
+
}
|
|
15
|
+
/** Per-call authorization/lifetime checks supplied by the owning route. */
|
|
16
|
+
export interface PreviewProviderGuard {
|
|
17
|
+
readonly signal: AbortSignal;
|
|
18
|
+
assertActive(): void;
|
|
19
|
+
assertAccount(credential: GitHubCopilotOAuthCredential): void;
|
|
20
|
+
beforeWire(model: Model<Api>, options?: StreamOptions): Promise<{
|
|
21
|
+
signal: AbortSignal;
|
|
22
|
+
release(): void;
|
|
23
|
+
dispatch?(): void;
|
|
24
|
+
}>;
|
|
25
|
+
/** Actual model HTTP 401, excluding proven Responses replay-scope failures; no request replay. */
|
|
26
|
+
onUnauthorized?(): void;
|
|
27
|
+
/** Dispatch-local, verified replay failure; never inferred from SDK error text. */
|
|
28
|
+
onReplayFailure?(error: CopilotResponsesReplayError): void;
|
|
29
|
+
/** Preserve an owned abort cause before SDK terminal delivery and lease cleanup. */
|
|
30
|
+
onWireAbort?(code: ManagedWireAbortCode): void;
|
|
31
|
+
/** Request-local safe guidance from a verified HTTP response; undefined clears prior evidence. */
|
|
32
|
+
onRequestBodyTimeout?(diagnostic: string | undefined): void;
|
|
33
|
+
/** Optional HTTP byte-idle bound paired with a separate native semantic deadline. */
|
|
34
|
+
readonly streamIdleTimeoutMs?: number;
|
|
35
|
+
onStreamLiveness?(control: Pick<CopilotStreamLiveness, 'pause' | 'resume'>): void;
|
|
36
|
+
onStreamIdleTimeout?(error: CopilotStreamIdleError): void;
|
|
37
|
+
requestDiagnostics?: {
|
|
38
|
+
enabled(): boolean;
|
|
39
|
+
begin(start: RequestDiagnosticStart): RequestDiagnosticHandle | undefined;
|
|
40
|
+
failed(): void;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/** Guard for one selected model in an account-bound descriptor snapshot. */
|
|
44
|
+
export interface AccountProviderGuard extends PreviewProviderGuard {
|
|
45
|
+
/** Explicit lossless HTTP encoding; default-off and independent of context admission. */
|
|
46
|
+
readonly responsesRequestCompression?: boolean;
|
|
47
|
+
/** Explicit compatibility override for all managed Responses requests. */
|
|
48
|
+
readonly responsesOmitTemperature?: boolean;
|
|
49
|
+
/** Explicit, request-admitted recovery; absent by default. */
|
|
50
|
+
recoverReplay?(payload: unknown): unknown;
|
|
51
|
+
/** Only exact verified scope HTTP failures may offer recovery evidence. */
|
|
52
|
+
onReplayScopeRejected?(body: string | undefined): void;
|
|
53
|
+
readonly selectedModelId?: string;
|
|
54
|
+
readonly retryReplay?: ResponsesRetryReplay;
|
|
55
|
+
readonly retrySignal?: AbortSignal;
|
|
56
|
+
/** Per-dispatch admission after native context conversion, before starting a model wire. */
|
|
57
|
+
inspectRequest?(model: Model<Api>, context: TranscriptContext, options?: StreamOptions): void;
|
|
58
|
+
/** Optional auxiliary-call deadline fence immediately before native Fetch dispatch. */
|
|
59
|
+
requestCheckpoint?(): void;
|
|
60
|
+
assertEntitled(credential: GitHubCopilotOAuthCredential, modelId: string): void;
|
|
61
|
+
}
|
|
62
|
+
/** The independent prompt limit is retained for the route's budget guard, not folded into context capacity. */
|
|
63
|
+
export type AccountPiModel = Model<AccountModelApi> & {
|
|
64
|
+
readonly maxInputTokens?: number;
|
|
65
|
+
readonly unmappedReasoningEfforts: readonly string[];
|
|
66
|
+
readonly minThinkingBudget?: number;
|
|
67
|
+
readonly maxThinkingBudget?: number;
|
|
68
|
+
};
|
|
69
|
+
export declare function copilotPublicHeaders(): Readonly<Record<string, string>>;
|
|
70
|
+
/** Materialize advertised capabilities only; model names and the local static catalog never select the API. */
|
|
71
|
+
export declare function accountModelFromDescriptor(descriptor: AccountModelDescriptor, baseURL: string, classifierReasoningOff?: boolean): AccountPiModel;
|
|
72
|
+
/** Create a descriptor-driven, OAuth-only provider using native SDK serialization for all supported endpoints. */
|
|
73
|
+
export declare function createAccountProvider(descriptors: readonly AccountModelDescriptor[], guard: AccountProviderGuard, baseURL: string, classifierReasoningOff?: boolean): {
|
|
74
|
+
provider: CoreCompatibleProvider;
|
|
75
|
+
models: readonly AccountPiModel[];
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=preview-provider.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { PiAiProviderProfile } from '@deepseek-ai/dsh-llm-pi-ai';
|
|
4
|
+
import { GITHUB_COPILOT_PREVIEW_PROVIDER_ID } from './copilot-identity.ts';
|
|
5
|
+
import type { AccountModelLoadOptions } from './account-model-source.ts';
|
|
6
|
+
import type { AccountModelDescriptor, AccountModelRejection } from './account-model-catalog.ts';
|
|
7
|
+
import type { InlineConfig } from './config.ts';
|
|
8
|
+
import type { RequestBudgetPolicy } from './request-budget.ts';
|
|
9
|
+
/** Safe request knobs; identities, model tables, endpoints and credentials are not configurable. */
|
|
10
|
+
export type PreviewRouteConfig = Pick<PiAiProviderProfile, 'reasoning' | 'cacheRetention' | 'transport' | 'timeoutMs' | 'websocketConnectTimeoutMs' | 'streamIdleTimeoutMs' | 'maxRequestImageBytes' | 'requestImagePixelBudget' | 'requestImageMaxBytes' | 'retryPolicy'> & Pick<InlineConfig, 'accountModelTtlMs' | 'accountModelFailureCooldownMs'> & {
|
|
11
|
+
readonly streamLiveness?: boolean;
|
|
12
|
+
readonly chatRequestSettings?: () => Pick<InlineConfig, 'chatStreamIdleTimeoutMs' | 'chatStreamLiveness' | 'chatMaxRequestImageBytes' | 'responsesRequestCompression' | 'responsesOmitTemperature'>;
|
|
13
|
+
readonly accountModelSettings?: () => Pick<InlineConfig, 'accountModelTtlMs' | 'accountModelFailureCooldownMs' | 'excludedModelIds' | 'highCostModelIds' | 'parentModelFollow' | 'followParentModel' | 'autoSemanticAssessment' | 'autoSemanticAssessmentTimeoutMs' | 'autoSemanticAssessmentModel' | 'autoAllocationEvidence'>;
|
|
14
|
+
readonly requestBudget?: Partial<RequestBudgetPolicy>;
|
|
15
|
+
readonly requestBudgetSettings?: () => Partial<RequestBudgetPolicy>;
|
|
16
|
+
};
|
|
17
|
+
export interface GitHubCopilotPreviewView {
|
|
18
|
+
readonly provider: typeof GITHUB_COPILOT_PREVIEW_PROVIDER_ID;
|
|
19
|
+
readonly configured: boolean;
|
|
20
|
+
readonly available: boolean;
|
|
21
|
+
readonly correctionActive: boolean;
|
|
22
|
+
readonly state: 'idle' | 'loading' | 'ready' | 'stale' | 'unconfigured' | 'unavailable' | 'error' | 'disposed';
|
|
23
|
+
readonly models: readonly {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly api: string;
|
|
27
|
+
}[];
|
|
28
|
+
readonly rejected: readonly AccountModelRejection[];
|
|
29
|
+
readonly warnings: readonly {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly code: string;
|
|
32
|
+
}[];
|
|
33
|
+
readonly discoveredAt?: number;
|
|
34
|
+
readonly error?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface GitHubCopilotPreview {
|
|
37
|
+
getView(): GitHubCopilotPreviewView;
|
|
38
|
+
/** Synchronous, account-proven summary capacities for the initiating Agent; never triggers discovery. */
|
|
39
|
+
recoveryLimits(modelId: string, agent?: Agent): {
|
|
40
|
+
readonly api: AccountModelDescriptor['api'];
|
|
41
|
+
readonly limits: Pick<AccountModelDescriptor, 'contextWindow' | 'maxInputTokens' | 'maxTokens'>;
|
|
42
|
+
readonly policy: Partial<RequestBudgetPolicy>;
|
|
43
|
+
readonly assertCurrent: () => void;
|
|
44
|
+
} | undefined;
|
|
45
|
+
/** Host-only current endpoint facts; no discovery and no credential material. */
|
|
46
|
+
routeFacts(modelId: string): {
|
|
47
|
+
readonly api: string;
|
|
48
|
+
readonly baseURL: string;
|
|
49
|
+
} | undefined;
|
|
50
|
+
/** Capture credential-proof continuity, independent of ordinary metadata cache TTL. */
|
|
51
|
+
captureSearchProof(): () => boolean;
|
|
52
|
+
/** Host-only credential resolution for an independent, account-scoped search request. */
|
|
53
|
+
resolveRequestAuth(modelId: string, signal?: AbortSignal): Promise<{
|
|
54
|
+
readonly apiKey: string;
|
|
55
|
+
readonly baseURL: string;
|
|
56
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
57
|
+
}>;
|
|
58
|
+
/** Read stored credentials/status only; never starts native refresh or discovery. */
|
|
59
|
+
refresh(): Promise<GitHubCopilotPreviewView>;
|
|
60
|
+
/** Explicit account model discovery. May refresh native OAuth and GET /models. */
|
|
61
|
+
discover(options?: AccountModelLoadOptions): Promise<GitHubCopilotPreviewView>;
|
|
62
|
+
}
|
|
63
|
+
declare module '@deepseek-ai/cordis' {
|
|
64
|
+
interface Context {
|
|
65
|
+
githubCopilotPreview: GitHubCopilotPreview;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/** Register services once; account switches affect the directory, not admitted turns. */
|
|
69
|
+
export declare function apply(ctx: Context, config?: PreviewRouteConfig): void;
|
|
70
|
+
declare const _default: {
|
|
71
|
+
name: string;
|
|
72
|
+
inject: string[];
|
|
73
|
+
apply: typeof apply;
|
|
74
|
+
};
|
|
75
|
+
export default _default;
|
|
76
|
+
//# sourceMappingURL=preview-route.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability probe: one bounded operation per candidate protocol that forces
|
|
3
|
+
* the server-side web tool to run and checks the reply for the structured
|
|
4
|
+
* evidence that it did. A protocol claim is trusted only after this passes —
|
|
5
|
+
* several "Responses-compatible" gateways accept the `web_search` tool field
|
|
6
|
+
* and silently ignore it (DeepSeek documents that unknown tool types are
|
|
7
|
+
* ignored), which is exactly the failure mode static protocol detection
|
|
8
|
+
* cannot see. The probe is what makes the auto-disable decision honest.
|
|
9
|
+
* @module dsh-github-copilot/probe
|
|
10
|
+
*/
|
|
11
|
+
import type { ResponsesWebSearchToolType, SearchPlanCandidate } from './plan.ts';
|
|
12
|
+
import type { ResolvedRequestAuth } from './copilot-request.ts';
|
|
13
|
+
/** The outcome of probing one candidate. */
|
|
14
|
+
export interface ProbeOutcome {
|
|
15
|
+
readonly supported: boolean;
|
|
16
|
+
/** Why the candidate failed, for the auto-disable diagnostic. */
|
|
17
|
+
readonly detail: string;
|
|
18
|
+
/**
|
|
19
|
+
* The Responses tool spelling the probe verified (openai-responses only).
|
|
20
|
+
* May differ from the candidate's primary spelling when the fallback won;
|
|
21
|
+
* the wire must use this verified value.
|
|
22
|
+
*/
|
|
23
|
+
readonly webSearchToolType?: ResponsesWebSearchToolType;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Probe one candidate protocol with a bounded request sequence. The verdict is
|
|
27
|
+
* structural: a Responses reply must contain a `web_search_call` item and a
|
|
28
|
+
* Messages reply must contain a `web_search_tool_result` block; anything else
|
|
29
|
+
* — HTTP error, unparseable body, silent tool ignore — is "not supported".
|
|
30
|
+
* The timeout bounds the WHOLE probe, including credential resolution; the
|
|
31
|
+
* probe never throws — every failure becomes a verdict.
|
|
32
|
+
* @param candidate - the resolved endpoint facts to verify.
|
|
33
|
+
* @param resolveApiKey - resolves the candidate's credential reference.
|
|
34
|
+
* @param timeoutMs - bound on the whole probe.
|
|
35
|
+
* @param signal - optional owner lifecycle cancellation; abort forbids later attempts.
|
|
36
|
+
* @returns the verdict and a diagnostic detail.
|
|
37
|
+
*/
|
|
38
|
+
export declare function probeCandidate(candidate: SearchPlanCandidate, resolveApiKey: (candidate: SearchPlanCandidate) => Promise<string | ResolvedRequestAuth | undefined>, timeoutMs: number, signal?: AbortSignal): Promise<ProbeOutcome>;
|
|
39
|
+
//# sourceMappingURL=probe.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Client-safe bridge between legacy schema codecs and alpha.2 create factories. */
|
|
2
|
+
export declare function strictRemoteCodec<Schema extends {
|
|
3
|
+
parse(value: unknown): unknown;
|
|
4
|
+
}>(typeSymbol: string, schema: Schema): {
|
|
5
|
+
mode: "strict";
|
|
6
|
+
typeSymbol: string;
|
|
7
|
+
schema: Schema;
|
|
8
|
+
create: () => Schema;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=remote-codec.d.ts.map
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-safe Remote contribution for the plugin-owned authorization bridge.
|
|
3
|
+
*/
|
|
4
|
+
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { GitHubCopilotAuthorizationView, GitHubCopilotModelPreferencesView } from './authorization-controller.ts';
|
|
7
|
+
import type { GitHubCopilotMigrationStatus } from './migration-status.ts';
|
|
8
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
9
|
+
interface TypertRemoteNamespaceMap {
|
|
10
|
+
githubCopilot: {
|
|
11
|
+
migrationStatus(): Promise<RemoteResult<GitHubCopilotMigrationStatus>>;
|
|
12
|
+
status(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
13
|
+
reconcile(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
14
|
+
discoverModels(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
15
|
+
ensureModels(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
16
|
+
excludeModel(modelId: string): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
17
|
+
restoreModel(modelId: string): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
18
|
+
setModelExcluded(modelId: string, excluded: boolean): Promise<RemoteResult<GitHubCopilotModelPreferencesView>>;
|
|
19
|
+
setModelHighCost(modelId: string, highCost: boolean): Promise<RemoteResult<GitHubCopilotModelPreferencesView>>;
|
|
20
|
+
start(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
21
|
+
cancel(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
22
|
+
signOut(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export declare const GITHUB_COPILOT_AUTHORIZATION_VIEW_TYPE_SYMBOL = "dsh-github-copilot#GitHubCopilotAuthorizationView";
|
|
27
|
+
export declare const GitHubCopilotAuthorizationViewSchema: z.ZodObject<{
|
|
28
|
+
phase: z.ZodEnum<{
|
|
29
|
+
error: "error";
|
|
30
|
+
authorizing: "authorizing";
|
|
31
|
+
"signed-out": "signed-out";
|
|
32
|
+
"signed-in": "signed-in";
|
|
33
|
+
}>;
|
|
34
|
+
configured: z.ZodBoolean;
|
|
35
|
+
writable: z.ZodBoolean;
|
|
36
|
+
inFlight: z.ZodBoolean;
|
|
37
|
+
notices: z.ZodArray<z.ZodObject<{
|
|
38
|
+
message: z.ZodString;
|
|
39
|
+
url: z.ZodOptional<z.ZodString>;
|
|
40
|
+
code: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, z.core.$strict>>;
|
|
42
|
+
catalog: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
state: z.ZodEnum<{
|
|
44
|
+
current: "current";
|
|
45
|
+
"partially-outdated": "partially-outdated";
|
|
46
|
+
outdated: "outdated";
|
|
47
|
+
}>;
|
|
48
|
+
accountModelCount: z.ZodNumber;
|
|
49
|
+
supportedModelCount: z.ZodNumber;
|
|
50
|
+
unknownModelIds: z.ZodArray<z.ZodString>;
|
|
51
|
+
temporarilyUnavailableModelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
previewModelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
53
|
+
}, z.core.$strict>>;
|
|
54
|
+
accountModels: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
state: z.ZodEnum<{
|
|
56
|
+
error: "error";
|
|
57
|
+
ready: "ready";
|
|
58
|
+
unavailable: "unavailable";
|
|
59
|
+
disposed: "disposed";
|
|
60
|
+
loading: "loading";
|
|
61
|
+
idle: "idle";
|
|
62
|
+
stale: "stale";
|
|
63
|
+
unconfigured: "unconfigured";
|
|
64
|
+
}>;
|
|
65
|
+
models: z.ZodArray<z.ZodObject<{
|
|
66
|
+
id: z.ZodString;
|
|
67
|
+
name: z.ZodString;
|
|
68
|
+
api: z.ZodString;
|
|
69
|
+
}, z.core.$strict>>;
|
|
70
|
+
rejected: z.ZodArray<z.ZodObject<{
|
|
71
|
+
id: z.ZodOptional<z.ZodString>;
|
|
72
|
+
code: z.ZodString;
|
|
73
|
+
}, z.core.$strict>>;
|
|
74
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
code: z.ZodString;
|
|
77
|
+
}, z.core.$strict>>>;
|
|
78
|
+
discoveredAt: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
error: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strict>>;
|
|
81
|
+
modelPreferences: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
state: z.ZodEnum<{
|
|
83
|
+
error: "error";
|
|
84
|
+
ready: "ready";
|
|
85
|
+
}>;
|
|
86
|
+
writable: z.ZodBoolean;
|
|
87
|
+
revision: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
excludedModelIds: z.ZodArray<z.ZodString>;
|
|
89
|
+
lockedModelIds: z.ZodArray<z.ZodString>;
|
|
90
|
+
unavailableExcludedModelIds: z.ZodArray<z.ZodString>;
|
|
91
|
+
highCostModelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
92
|
+
error: z.ZodOptional<z.ZodEnum<{
|
|
93
|
+
COPILOT_MODEL_PREFERENCES_UNAVAILABLE: "COPILOT_MODEL_PREFERENCES_UNAVAILABLE";
|
|
94
|
+
COPILOT_MODEL_EXCLUSION_SELECTED: "COPILOT_MODEL_EXCLUSION_SELECTED";
|
|
95
|
+
COPILOT_MODEL_EXCLUSION_CONFLICT: "COPILOT_MODEL_EXCLUSION_CONFLICT";
|
|
96
|
+
COPILOT_MODEL_EXCLUSION_SAVE_FAILED: "COPILOT_MODEL_EXCLUSION_SAVE_FAILED";
|
|
97
|
+
COPILOT_MODEL_SETTINGS_UNAVAILABLE: "COPILOT_MODEL_SETTINGS_UNAVAILABLE";
|
|
98
|
+
COPILOT_MODEL_SETTINGS_INVALID: "COPILOT_MODEL_SETTINGS_INVALID";
|
|
99
|
+
COPILOT_MODEL_SELECTION_UNAVAILABLE: "COPILOT_MODEL_SELECTION_UNAVAILABLE";
|
|
100
|
+
}>>;
|
|
101
|
+
}, z.core.$strict>>;
|
|
102
|
+
route: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
state: z.ZodEnum<{
|
|
104
|
+
error: "error";
|
|
105
|
+
ready: "ready";
|
|
106
|
+
"needs-repair": "needs-repair";
|
|
107
|
+
"not-configured": "not-configured";
|
|
108
|
+
conflict: "conflict";
|
|
109
|
+
}>;
|
|
110
|
+
diagnosticCode: z.ZodOptional<z.ZodEnum<{
|
|
111
|
+
ROUTE_READ_FAILED: "ROUTE_READ_FAILED";
|
|
112
|
+
RECONCILIATION_FAILED: "RECONCILIATION_FAILED";
|
|
113
|
+
ROUTE_CONFLICT: "ROUTE_CONFLICT";
|
|
114
|
+
}>>;
|
|
115
|
+
}, z.core.$strict>>;
|
|
116
|
+
error: z.ZodOptional<z.ZodString>;
|
|
117
|
+
authorizationMilestone: z.ZodOptional<z.ZodEnum<{
|
|
118
|
+
AUTHORIZATION_REQUESTED: "AUTHORIZATION_REQUESTED";
|
|
119
|
+
INTERACTION_PROMPT_OBSERVED: "INTERACTION_PROMPT_OBSERVED";
|
|
120
|
+
INTERACTION_NOTICE_OBSERVED: "INTERACTION_NOTICE_OBSERVED";
|
|
121
|
+
}>>;
|
|
122
|
+
}, z.core.$strict>;
|
|
123
|
+
export declare const GitHubCopilotModelPreferencesViewSchema: z.ZodObject<{
|
|
124
|
+
state: z.ZodEnum<{
|
|
125
|
+
error: "error";
|
|
126
|
+
ready: "ready";
|
|
127
|
+
}>;
|
|
128
|
+
writable: z.ZodBoolean;
|
|
129
|
+
revision: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
excludedModelIds: z.ZodArray<z.ZodString>;
|
|
131
|
+
lockedModelIds: z.ZodArray<z.ZodString>;
|
|
132
|
+
unavailableExcludedModelIds: z.ZodArray<z.ZodString>;
|
|
133
|
+
highCostModelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
134
|
+
error: z.ZodOptional<z.ZodEnum<{
|
|
135
|
+
COPILOT_MODEL_PREFERENCES_UNAVAILABLE: "COPILOT_MODEL_PREFERENCES_UNAVAILABLE";
|
|
136
|
+
COPILOT_MODEL_EXCLUSION_SELECTED: "COPILOT_MODEL_EXCLUSION_SELECTED";
|
|
137
|
+
COPILOT_MODEL_EXCLUSION_CONFLICT: "COPILOT_MODEL_EXCLUSION_CONFLICT";
|
|
138
|
+
COPILOT_MODEL_EXCLUSION_SAVE_FAILED: "COPILOT_MODEL_EXCLUSION_SAVE_FAILED";
|
|
139
|
+
COPILOT_MODEL_SETTINGS_UNAVAILABLE: "COPILOT_MODEL_SETTINGS_UNAVAILABLE";
|
|
140
|
+
COPILOT_MODEL_SETTINGS_INVALID: "COPILOT_MODEL_SETTINGS_INVALID";
|
|
141
|
+
COPILOT_MODEL_SELECTION_UNAVAILABLE: "COPILOT_MODEL_SELECTION_UNAVAILABLE";
|
|
142
|
+
}>>;
|
|
143
|
+
}, z.core.$strict>;
|
|
144
|
+
export declare const GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL = "dsh-github-copilot#GitHubCopilotMigrationStatus";
|
|
145
|
+
/** Independent Ops result: strict at every object level; no account or private Session data. */
|
|
146
|
+
export declare const GitHubCopilotMigrationStatusSchema: z.ZodObject<{
|
|
147
|
+
plugin: z.ZodObject<{
|
|
148
|
+
name: z.ZodLiteral<"dsh-github-copilot">;
|
|
149
|
+
version: z.ZodString;
|
|
150
|
+
}, z.core.$strict>;
|
|
151
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
152
|
+
historyScope: z.ZodLiteral<"live-agents-only">;
|
|
153
|
+
observedAt: z.ZodNumber;
|
|
154
|
+
capabilities: z.ZodObject<{
|
|
155
|
+
agentsList: z.ZodBoolean;
|
|
156
|
+
sessionProjections: z.ZodBoolean;
|
|
157
|
+
settingsCas: z.ZodBoolean;
|
|
158
|
+
providerRegistry: z.ZodBoolean;
|
|
159
|
+
defaultSelection: z.ZodBoolean;
|
|
160
|
+
}, z.core.$strict>;
|
|
161
|
+
complete: z.ZodObject<{
|
|
162
|
+
sessions: z.ZodBoolean;
|
|
163
|
+
defaultSelection: z.ZodBoolean;
|
|
164
|
+
routes: z.ZodBoolean;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
defaultSelection: z.ZodNullable<z.ZodObject<{
|
|
167
|
+
provider: z.ZodString;
|
|
168
|
+
model: z.ZodString;
|
|
169
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
170
|
+
}, z.core.$strict>>;
|
|
171
|
+
sessions: z.ZodArray<z.ZodObject<{
|
|
172
|
+
id: z.ZodString;
|
|
173
|
+
status: z.ZodEnum<{
|
|
174
|
+
running: "running";
|
|
175
|
+
idle: "idle";
|
|
176
|
+
}>;
|
|
177
|
+
effectiveSelection: z.ZodNullable<z.ZodObject<{
|
|
178
|
+
provider: z.ZodString;
|
|
179
|
+
model: z.ZodString;
|
|
180
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, z.core.$strict>>;
|
|
182
|
+
selectionSource: z.ZodEnum<{
|
|
183
|
+
default: "default";
|
|
184
|
+
unknown: "unknown";
|
|
185
|
+
pending: "pending";
|
|
186
|
+
"request-header": "request-header";
|
|
187
|
+
}>;
|
|
188
|
+
activeRequestSelection: z.ZodNullable<z.ZodObject<{
|
|
189
|
+
provider: z.ZodString;
|
|
190
|
+
model: z.ZodString;
|
|
191
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strict>>;
|
|
193
|
+
}, z.core.$strict>>;
|
|
194
|
+
routes: z.ZodObject<{
|
|
195
|
+
nativeConfigured: z.ZodNullable<z.ZodBoolean>;
|
|
196
|
+
nativeRegistered: z.ZodNullable<z.ZodBoolean>;
|
|
197
|
+
managedRegistered: z.ZodNullable<z.ZodBoolean>;
|
|
198
|
+
}, z.core.$strict>;
|
|
199
|
+
}, z.core.$strict>;
|
|
200
|
+
declare const contribution: TypertRemoteContribution;
|
|
201
|
+
export default contribution;
|
|
202
|
+
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { GenerateOptions } from '@deepseek-ai/dsh-llm';
|
|
4
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
5
|
+
import { ReplayRecoveryStore } from './replay-recovery.ts';
|
|
6
|
+
import type { ReplayRecoveryDuration, ReplayRecoveryView } from './replay-recovery-types.ts';
|
|
7
|
+
declare module '@deepseek-ai/cordis' {
|
|
8
|
+
interface Context {
|
|
9
|
+
githubCopilotReplayRecovery: ReplayRecoveryController;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare class ReplayRecoveryController extends TypertRemoteService {
|
|
13
|
+
private readonly store;
|
|
14
|
+
private readonly proof;
|
|
15
|
+
private readonly busy;
|
|
16
|
+
constructor(ctx: Context, store: ReplayRecoveryStore, proof: (agent?: Agent, request?: GenerateOptions) => string | undefined, busy: WeakSet<object>);
|
|
17
|
+
get(agent: Agent): ReplayRecoveryView;
|
|
18
|
+
setEnabled(agent: Agent, revision: string, enabled: boolean): ReplayRecoveryView;
|
|
19
|
+
authorize(agent: Agent, revision: string, duration: ReplayRecoveryDuration): ReplayRecoveryView;
|
|
20
|
+
}
|
|
21
|
+
export declare function installReplayRecovery(ctx: Context, proof: (agent?: Agent, request?: GenerateOptions) => string | undefined): {
|
|
22
|
+
prepare(request: GenerateOptions): {
|
|
23
|
+
transform(payload: unknown): unknown;
|
|
24
|
+
rejected(body: string | undefined): void;
|
|
25
|
+
} | undefined;
|
|
26
|
+
dispose(): void;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=replay-recovery-host.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
2
|
+
import type { ReplayRecoveryDuration, ReplayRecoveryView } from './replay-recovery-types.ts';
|
|
3
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
4
|
+
interface TypertRemoteNamespaceMap {
|
|
5
|
+
githubCopilotReplayRecovery: {
|
|
6
|
+
get(agentId: string): Promise<RemoteResult<ReplayRecoveryView>>;
|
|
7
|
+
setEnabled(agentId: string, revision: string, enabled: boolean): Promise<RemoteResult<ReplayRecoveryView>>;
|
|
8
|
+
authorize(agentId: string, revision: string, duration: ReplayRecoveryDuration): Promise<RemoteResult<ReplayRecoveryView>>;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
declare const contribution: TypertRemoteContribution;
|
|
13
|
+
export default contribution;
|
|
14
|
+
//# sourceMappingURL=replay-recovery-remote.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ReplayRecoveryDurationSchema: z.ZodEnum<{
|
|
3
|
+
session: "session";
|
|
4
|
+
"next-turn": "next-turn";
|
|
5
|
+
}>;
|
|
6
|
+
export type ReplayRecoveryDuration = z.infer<typeof ReplayRecoveryDurationSchema>;
|
|
7
|
+
export declare const ReplayRecoveryViewSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
8
|
+
state: z.ZodLiteral<"unavailable">;
|
|
9
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
10
|
+
state: z.ZodEnum<{
|
|
11
|
+
enabled: "enabled";
|
|
12
|
+
available: "available";
|
|
13
|
+
}>;
|
|
14
|
+
revision: z.ZodString;
|
|
15
|
+
itemCount: z.ZodNumber;
|
|
16
|
+
model: z.ZodString;
|
|
17
|
+
duration: z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
session: "session";
|
|
19
|
+
"next-turn": "next-turn";
|
|
20
|
+
}>>;
|
|
21
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
}, z.core.$strict>], "state">;
|
|
23
|
+
export type ReplayRecoveryView = z.infer<typeof ReplayRecoveryViewSchema>;
|
|
24
|
+
//# sourceMappingURL=replay-recovery-types.d.ts.map
|