dsh-github-copilot 0.4.0-alpha.100
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 +312 -0
- package/CHANGELOG.md +479 -0
- package/CONTRIBUTING.md +46 -0
- package/LICENSE +21 -0
- package/README.md +203 -0
- package/README.zh.md +202 -0
- package/SECURITY.md +29 -0
- package/cordis.patch.yml +16 -0
- package/deployment-baseline.json +1299 -0
- package/docs/agent-readiness.md +110 -0
- package/docs/auto-task-routing.md +234 -0
- package/docs/automatic-model-routing.md +205 -0
- package/docs/copilot-accounts.md +236 -0
- package/docs/copilot-compaction.md +120 -0
- package/docs/copilot-usage.md +125 -0
- package/docs/dual-model.md +66 -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-model-preferences.png +0 -0
- package/docs/images/copilot-search-routing.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 +64 -0
- package/docs/model-compatibility-acceptance.md +164 -0
- package/docs/npm-distribution.md +149 -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 +16 -0
- package/docs/session-search-routing.md +133 -0
- package/docs/single-route-migration.md +130 -0
- package/docs/web-lifecycle-rc2.md +55 -0
- package/lib/client.js +10822 -0
- package/lib/client.js.map +1 -0
- package/lib/copilot-identity-DRZY_d2X.js +15 -0
- package/lib/index.js +11689 -0
- package/lib/manual-compaction-recovery.js +315 -0
- package/lib/remote.js +734 -0
- package/lib/request-budget-DLY_aRq0.js +87 -0
- package/lib/routed-web.js +120 -0
- package/lib/search-routing-CqysPLve.js +792 -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-controller.d.ts +119 -0
- package/lib/types/auto-assessment-evidence.d.ts +46 -0
- package/lib/types/auto-model-host.d.ts +27 -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 +59 -0
- package/lib/types/auto-selection-explanation.d.ts +9 -0
- package/lib/types/auto-task-assessment.d.ts +47 -0
- package/lib/types/auto-task-classifier.d.ts +9 -0
- package/lib/types/background-compaction.d.ts +30 -0
- package/lib/types/client.d.ts +115 -0
- package/lib/types/compact-account.d.ts +42 -0
- package/lib/types/compaction-pressure.d.ts +23 -0
- package/lib/types/compatibility.d.ts +17 -0
- package/lib/types/config.d.ts +89 -0
- package/lib/types/content-file.d.ts +10 -0
- package/lib/types/context-evidence-ui.d.ts +11 -0
- package/lib/types/context-evidence.d.ts +108 -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 +30 -0
- package/lib/types/copilot-accounts-host.d.ts +75 -0
- package/lib/types/copilot-accounts-remote.d.ts +77 -0
- package/lib/types/copilot-accounts-types.d.ts +42 -0
- package/lib/types/copilot-auth.d.ts +25 -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 +30 -0
- package/lib/types/copilot-usage-host.d.ts +58 -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/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 +52 -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/parent-model-follow-card.d.ts +41 -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 +66 -0
- package/lib/types/preview-route.d.ts +74 -0
- package/lib/types/probe.d.ts +39 -0
- package/lib/types/reasoning-presentation.d.ts +55 -0
- package/lib/types/remote-codec.d.ts +10 -0
- package/lib/types/remote.d.ts +199 -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 +26 -0
- package/lib/types/replay-recovery.d.ts +17 -0
- package/lib/types/request-body-evidence.d.ts +34 -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-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 +30 -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/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-selection-card.d.ts +10 -0
- package/lib/types/turn-selection-host.d.ts +11 -0
- package/lib/types/turn-selection-remote.d.ts +13 -0
- package/lib/types/turn-selection.d.ts +119 -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 +236 -0
- package/scripts/check-search-composition.mjs +191 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared HTTP plumbing for the capability probe and the inline wires:
|
|
3
|
+
* bounded response reading, caller-cancellation races for preflight steps,
|
|
4
|
+
* and the stable {@link WebError} translations. The patterns mirror the
|
|
5
|
+
* harness `dsh-web` package family (web-search-deepseek, model discovery) so
|
|
6
|
+
* every credentialed request rejects redirects before a `Location` target can
|
|
7
|
+
* be contacted.
|
|
8
|
+
* @module dsh-github-copilot/http
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Endpoint replies larger than this are refused. The endpoint is whatever
|
|
12
|
+
* base URL the configuration named, so the ceiling holds on the bytes
|
|
13
|
+
* actually read rather than on the length the server claims.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MAX_RESPONSE_BYTES: number;
|
|
16
|
+
/**
|
|
17
|
+
* Read a response body with a hard byte cap, refusing one that outgrows it.
|
|
18
|
+
* A declared length is checked first so an honest server is turned away
|
|
19
|
+
* without transferring anything; the accumulated total is what actually
|
|
20
|
+
* enforces the bound, because a server that under-declares (or streams) tells
|
|
21
|
+
* us nothing up front.
|
|
22
|
+
* @param response - the HTTP response whose body is read to completion.
|
|
23
|
+
* @param url - the requested URL, named in the refusal message.
|
|
24
|
+
* @returns the decoded body text.
|
|
25
|
+
* @throws WebError `WEB_PROVIDER_ERROR` when the body exceeds the cap.
|
|
26
|
+
*/
|
|
27
|
+
export declare function readBounded(response: Response, url: string): Promise<string>;
|
|
28
|
+
/** Whether an error is the fetch/`AbortSignal` abort signal. */
|
|
29
|
+
export declare function isAbortError(error: unknown): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Race a same-process asynchronous preflight (credential resolution) against
|
|
32
|
+
* a cancellation signal. The attached settlement handlers keep observing an
|
|
33
|
+
* uncooperative operation after the race is lost, so a later rejection cannot
|
|
34
|
+
* become unhandled.
|
|
35
|
+
* @param operation - the preflight promise.
|
|
36
|
+
* @param signal - the cancellation signal (request abort or idle watchdog).
|
|
37
|
+
* @returns the operation's value, or a rejection once the signal fires.
|
|
38
|
+
*/
|
|
39
|
+
export declare function abortable<T>(operation: Promise<T>, signal: AbortSignal | undefined): Promise<T>;
|
|
40
|
+
/**
|
|
41
|
+
* Extract a provider error message from an error envelope whose shape varies
|
|
42
|
+
* by protocol and vendor: `{ error: { message } }`, `{ error: "text" }`, or
|
|
43
|
+
* `{ message }`. Returns `undefined` when nothing usable is present.
|
|
44
|
+
* @param body - the parsed non-2xx response body.
|
|
45
|
+
* @returns the provider message, or `undefined`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function providerErrorMessage(body: unknown): string | undefined;
|
|
48
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AccountModelDescriptor } from './account-model-catalog.ts';
|
|
2
|
+
export type ImageInputFailure = 'COPILOT_IMAGE_INPUT_UNSUPPORTED' | 'COPILOT_IMAGE_MEDIA_TYPE_UNAVAILABLE' | 'COPILOT_IMAGE_MEDIA_TYPE_UNSUPPORTED';
|
|
3
|
+
/** Inspect native projected images, never infer wire formats from durable filenames. */
|
|
4
|
+
export declare function imageInputFailure(model: AccountModelDescriptor, messages: readonly unknown[]): ImageInputFailure | undefined;
|
|
5
|
+
//# sourceMappingURL=image-input-admission.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The inline web-search plugin: short-circuits agent-loop model calls on
|
|
3
|
+
* the `llm/stream` waterfall, injecting the server-side `web_search` tool
|
|
4
|
+
* into the wire request so search executes inside the model's own turn.
|
|
5
|
+
* The narrow gate keeps every other request on the normal adapter path.
|
|
6
|
+
* @module dsh-github-copilot
|
|
7
|
+
*/
|
|
8
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
9
|
+
import type { SettingsNamespace } from '@deepseek-ai/dsh-settings';
|
|
10
|
+
import type { LiveInlineConfig } from './config.ts';
|
|
11
|
+
export { COPILOT_HOSTED_SEARCH_PROVIDER_ID, GITHUB_COPILOT_HOSTED_SEARCH_PROVIDER_ID, } from './traditional-search.ts';
|
|
12
|
+
/** Cordis plugin name used by loader diagnostics. */
|
|
13
|
+
export declare const name = "github-copilot";
|
|
14
|
+
/**
|
|
15
|
+
* Bootstrap dependency. The integration itself is mounted below only after
|
|
16
|
+
* every service in {@link integrationInject}, including authorization, is
|
|
17
|
+
* active.
|
|
18
|
+
*/
|
|
19
|
+
export declare const inject: string[];
|
|
20
|
+
/** Settings namespace carrying this plugin's section. */
|
|
21
|
+
export declare const GITHUB_COPILOT_SETTINGS_NAMESPACE: SettingsNamespace;
|
|
22
|
+
/** Schema of the plugin's settings section, exported for composition consumers. */
|
|
23
|
+
export { Config } from './config.ts';
|
|
24
|
+
export type { InlineConfig } from './config.ts';
|
|
25
|
+
export { NO_DEFAULT_SEARCH_PROVIDER, WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE, WebSearchRoutingConfigSchema, } from './web-search-routing-config.ts';
|
|
26
|
+
export type { WebSearchRoutingConfig } from './web-search-routing-config.ts';
|
|
27
|
+
export { assertDshCompatibility, DSH_COMPATIBILITY } from './compatibility.ts';
|
|
28
|
+
export { GITHUB_COPILOT_CREDENTIAL_KEY, GitHubCopilotAuthorizationController, describeGitHubCopilotProviderProfile, ensureGitHubCopilotProviderProfile, LLM_PI_AI_SETTINGS_NAMESPACE, } from './authorization-controller.ts';
|
|
29
|
+
export type { AuthorizationNoticeView, GitHubCopilotAuthorizationPhase, GitHubCopilotAuthorizationView, GitHubCopilotRouteView, } from './authorization-controller.ts';
|
|
30
|
+
/**
|
|
31
|
+
* Register the inline short-circuit. The plan (candidates plus probe
|
|
32
|
+
* verdict) follows the settings section; the listener reads the CURRENT
|
|
33
|
+
* plan and config per request.
|
|
34
|
+
* @param ctx - context whose `llm` events and `systemPrompt` receive the
|
|
35
|
+
* registrations; both are effect-scoped and unregister on dispose.
|
|
36
|
+
* @param config - the composition entry config, used as the settings base layer.
|
|
37
|
+
*/
|
|
38
|
+
export declare function apply(ctx: Context, config: LiveInlineConfig): void;
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import BasicCompactionEngine from '@deepseek-ai/dsh-compaction-basic';
|
|
4
|
+
import type { ContentBlock, Message, TokenUsage, ToolSchema } from '@deepseek-ai/dsh-llm';
|
|
5
|
+
import type { CommandId } from '@deepseek-ai/dsh-commands/brand';
|
|
6
|
+
import type { CompactionResult } from '@deepseek-ai/dsh-compaction';
|
|
7
|
+
interface RecoveryMessage {
|
|
8
|
+
readonly role: string;
|
|
9
|
+
readonly content: readonly {
|
|
10
|
+
readonly type: string;
|
|
11
|
+
readonly id?: string;
|
|
12
|
+
}[];
|
|
13
|
+
readonly toolCallId?: string;
|
|
14
|
+
}
|
|
15
|
+
interface RecoveryInput<M> {
|
|
16
|
+
readonly messages: readonly M[];
|
|
17
|
+
readonly tools?: readonly ToolSchema[];
|
|
18
|
+
}
|
|
19
|
+
interface RecoveryResult {
|
|
20
|
+
readonly summary: ContentBlock[];
|
|
21
|
+
readonly provider: string;
|
|
22
|
+
readonly model: string;
|
|
23
|
+
readonly maxTokens?: number;
|
|
24
|
+
readonly usage?: TokenUsage;
|
|
25
|
+
}
|
|
26
|
+
interface RecoveryOptions<M extends RecoveryMessage, R extends RecoveryResult> {
|
|
27
|
+
readonly input: RecoveryInput<M>;
|
|
28
|
+
readonly inputLimit: number;
|
|
29
|
+
readonly maxCalls?: number;
|
|
30
|
+
readonly signal: AbortSignal;
|
|
31
|
+
readonly estimate: (input: RecoveryInput<M>) => number;
|
|
32
|
+
readonly summarize: (input: RecoveryInput<M>) => Promise<R>;
|
|
33
|
+
readonly makeCheckpoint: (summary: readonly ContentBlock[]) => M;
|
|
34
|
+
readonly assertCurrent?: () => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Bounded, explicit manual-only map/fold. The native engine still owns the only
|
|
38
|
+
* durable transaction, source-stability check, shrink check and cancellation.
|
|
39
|
+
*/
|
|
40
|
+
export declare function summarizeOversizedManualInput<M extends RecoveryMessage, R extends RecoveryResult>(options: RecoveryOptions<M, R>): Promise<RecoveryResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Deployment-selected alternative to stock BasicCompactionEngine. Do not
|
|
43
|
+
* mount both: Cordis compaction is a singleton, not an overridable service.
|
|
44
|
+
*/
|
|
45
|
+
export declare class CopilotManualRecoveryCompactionEngine extends BasicCompactionEngine {
|
|
46
|
+
private readonly manual;
|
|
47
|
+
constructor(ctx: Context, config?: ConstructorParameters<typeof BasicCompactionEngine>[1]);
|
|
48
|
+
compactNow(agent: Agent, signal: AbortSignal, sourceCommandId?: CommandId): Promise<CompactionResult | null>;
|
|
49
|
+
protected summarize(input: RecoveryInput<Message>, agent: Agent, signal?: AbortSignal): Promise<RecoveryResult>;
|
|
50
|
+
}
|
|
51
|
+
export default CopilotManualRecoveryCompactionEngine;
|
|
52
|
+
//# sourceMappingURL=manual-compaction-recovery.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Read-only, synchronous evidence for an independently authorized Ops migration. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
export interface MigrationSelection {
|
|
4
|
+
readonly provider: string;
|
|
5
|
+
readonly model: string;
|
|
6
|
+
readonly reasoningEffort?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface MigrationSession {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly status: 'idle' | 'running';
|
|
11
|
+
readonly effectiveSelection: MigrationSelection | null;
|
|
12
|
+
readonly selectionSource: 'pending' | 'request-header' | 'default' | 'unknown';
|
|
13
|
+
/** Latest recorded request config for running Agents, not proof of an in-flight model call. */
|
|
14
|
+
readonly activeRequestSelection: MigrationSelection | null;
|
|
15
|
+
}
|
|
16
|
+
/** Loaded plugin identity is not Desktop/Core byte attestation. Cold histories are not inspected. */
|
|
17
|
+
export interface GitHubCopilotMigrationStatus {
|
|
18
|
+
readonly plugin: {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly version: string;
|
|
21
|
+
};
|
|
22
|
+
readonly protocolVersion: 1;
|
|
23
|
+
readonly historyScope: 'live-agents-only';
|
|
24
|
+
readonly observedAt: number;
|
|
25
|
+
readonly capabilities: {
|
|
26
|
+
readonly agentsList: boolean;
|
|
27
|
+
readonly sessionProjections: boolean;
|
|
28
|
+
readonly settingsCas: boolean;
|
|
29
|
+
readonly providerRegistry: boolean;
|
|
30
|
+
readonly defaultSelection: boolean;
|
|
31
|
+
};
|
|
32
|
+
readonly complete: {
|
|
33
|
+
readonly sessions: boolean;
|
|
34
|
+
readonly defaultSelection: boolean;
|
|
35
|
+
readonly routes: boolean;
|
|
36
|
+
};
|
|
37
|
+
readonly defaultSelection: MigrationSelection | null;
|
|
38
|
+
readonly sessions: readonly MigrationSession[];
|
|
39
|
+
readonly routes: {
|
|
40
|
+
readonly nativeConfigured: boolean | null;
|
|
41
|
+
readonly nativeRegistered: boolean | null;
|
|
42
|
+
readonly managedRegistered: boolean | null;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Observe only public live leaves in one synchronous stack, without writes or network.
|
|
47
|
+
* This is not a cross-namespace transaction; callers must recheck immediately before CAS.
|
|
48
|
+
*/
|
|
49
|
+
export declare function migrationStatus(ctx: Context): GitHubCopilotMigrationStatus;
|
|
50
|
+
//# sourceMappingURL=migration-status.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const MAX_EXCLUDED_MODEL_IDS = 512;
|
|
2
|
+
/** Admission is bound to the native turn and its request signal, not the global picker. */
|
|
3
|
+
export declare class ModelExclusionTurns {
|
|
4
|
+
private readonly turns;
|
|
5
|
+
private readonly signals;
|
|
6
|
+
admit(owner: object, turn: number, model: string, signal: AbortSignal, excluded: ReadonlySet<string>): boolean;
|
|
7
|
+
permits(signal: AbortSignal | undefined, model: string): boolean;
|
|
8
|
+
end(owner: object): void;
|
|
9
|
+
}
|
|
10
|
+
export declare function normalizeExcludedModelIds(value: unknown): readonly string[];
|
|
11
|
+
export declare function excludedModelSet(value: unknown): ReadonlySet<string>;
|
|
12
|
+
export declare function filterExcludedModels<T extends {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
}>(models: readonly T[], value: unknown): readonly T[];
|
|
15
|
+
//# sourceMappingURL=model-exclusions.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { GitHubCopilotAuthorizationView } from './authorization-controller.ts';
|
|
4
|
+
export declare function GitHubCopilotModelPreferencesPanel(props: {
|
|
5
|
+
readonly remote: ClientContext['remote']['githubCopilot'];
|
|
6
|
+
readonly models: GitHubCopilotAuthorizationView['accountModels'];
|
|
7
|
+
readonly preferences: GitHubCopilotAuthorizationView['modelPreferences'];
|
|
8
|
+
}): ReactElement;
|
|
9
|
+
//# sourceMappingURL=model-preferences-card.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Api, Model } from '@earendil-works/pi-ai';
|
|
3
|
+
/** Public facts from this plugin's pi-ai dependency, not a claim about another Core copy. */
|
|
4
|
+
export interface CopilotModelFacts {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly provider: string;
|
|
7
|
+
readonly api: string;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly baseUrl: string;
|
|
10
|
+
readonly contextWindow: number;
|
|
11
|
+
readonly maxTokens: number;
|
|
12
|
+
readonly input: readonly ('text' | 'image')[];
|
|
13
|
+
readonly reasoning: boolean;
|
|
14
|
+
readonly supportsReasoningOff: boolean;
|
|
15
|
+
readonly reasoningEfforts: Readonly<Record<string, string>>;
|
|
16
|
+
readonly headers?: Readonly<Record<string, string | null>>;
|
|
17
|
+
}
|
|
18
|
+
export interface CopilotCatalogSnapshot {
|
|
19
|
+
readonly models: readonly CopilotModelFacts[];
|
|
20
|
+
/** True only for models whose actual native provider is built by this plugin. */
|
|
21
|
+
readonly authoritative: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Project only public leaves and the same pi library's supported wire efforts. */
|
|
24
|
+
export declare function projectModelFacts(model: Model<Api>): CopilotModelFacts;
|
|
25
|
+
/** Stock Core owns its own catalog; local metadata must not retire corrections on its behalf. */
|
|
26
|
+
export declare function readCopilotCatalog(_ctx: Context): CopilotCatalogSnapshot;
|
|
27
|
+
/** The preview uses this exact pi provider instance family, so local model facts are authoritative there. */
|
|
28
|
+
export declare function readPreviewCatalog(): CopilotCatalogSnapshot;
|
|
29
|
+
/** Scope optional preview contributions to this plugin's successfully mounted route service. */
|
|
30
|
+
export declare function isPluginPreviewProvider(ctx: Context, provider: string): boolean;
|
|
31
|
+
//# sourceMappingURL=model-protocol.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
type Settings = Context['remote']['settings'];
|
|
3
|
+
interface Snapshot {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
revision: number;
|
|
6
|
+
writable: boolean;
|
|
7
|
+
legacy: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface Props {
|
|
10
|
+
settings: Settings;
|
|
11
|
+
onSaved?: (revision: {
|
|
12
|
+
previous: number;
|
|
13
|
+
next: number;
|
|
14
|
+
}) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function readParentFollowSettings(settings: Settings): Promise<Snapshot>;
|
|
17
|
+
export declare function saveParentFollowSettings(settings: Settings, saved: Snapshot, enabled: boolean): Promise<{
|
|
18
|
+
snapshot: {
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
revision: number;
|
|
21
|
+
writable: boolean;
|
|
22
|
+
legacy: boolean;
|
|
23
|
+
};
|
|
24
|
+
revision: {
|
|
25
|
+
previous: number;
|
|
26
|
+
next: number;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
export declare function ParentModelFollowCard({ settings, onSaved }: Props): import("react").DetailedReactHTMLElement<{
|
|
30
|
+
'data-dsh-parent-model-follow': boolean;
|
|
31
|
+
'aria-busy': boolean;
|
|
32
|
+
style: {
|
|
33
|
+
padding: string;
|
|
34
|
+
marginTop: string;
|
|
35
|
+
display: "grid";
|
|
36
|
+
gap: string;
|
|
37
|
+
minWidth: number;
|
|
38
|
+
};
|
|
39
|
+
}, HTMLElement>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=parent-model-follow-card.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Explicit enrollment, never inferred from equality of parent and child models. */
|
|
2
|
+
export interface ParentModelBinding {
|
|
3
|
+
readonly childSessionId: string;
|
|
4
|
+
readonly parentSessionId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface FollowSelection {
|
|
7
|
+
readonly provider: string;
|
|
8
|
+
readonly model: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FollowState {
|
|
11
|
+
readonly inherited: number;
|
|
12
|
+
readonly turn: number | null;
|
|
13
|
+
readonly started: boolean;
|
|
14
|
+
readonly explicit: FollowSelection | null;
|
|
15
|
+
readonly descriptor: boolean;
|
|
16
|
+
readonly blocked: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface Event {
|
|
19
|
+
readonly seq: number;
|
|
20
|
+
readonly type: string;
|
|
21
|
+
readonly data: unknown;
|
|
22
|
+
}
|
|
23
|
+
export declare const PARENT_MODEL_FOLLOW_PROJECTION = "githubCopilotParentModelFollow";
|
|
24
|
+
export declare function followSelection(value: unknown): FollowSelection | undefined;
|
|
25
|
+
export declare function initialFollowState(inherited?: number): FollowState;
|
|
26
|
+
/** Fold only the child's own suffix; copied fork selections are not child overrides. */
|
|
27
|
+
export declare function foldFollowState(state: FollowState, event: Event): FollowState;
|
|
28
|
+
export declare class ParentModelFollowError extends Error {
|
|
29
|
+
readonly code: string;
|
|
30
|
+
constructor(code: string);
|
|
31
|
+
}
|
|
32
|
+
export interface FollowSubject {
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly parentId?: string;
|
|
35
|
+
readonly origin?: string;
|
|
36
|
+
readonly state: FollowState;
|
|
37
|
+
readonly pending: FollowSelection | null;
|
|
38
|
+
readonly recorded?: FollowSelection;
|
|
39
|
+
}
|
|
40
|
+
export declare function supportsParentFollowing(subject: FollowSubject): boolean;
|
|
41
|
+
/** Resolve a new turn's intent without changing any Session, setting or descriptor. */
|
|
42
|
+
export declare function resolveParentModel(child: FollowSubject, bindings: readonly ParentModelBinding[], lookup: (id: string) => FollowSubject | undefined, followAll?: boolean): FollowSelection | undefined;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=parent-model-follow.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Provider, AssistantMessageEventStream } from '@earendil-works/pi-ai';
|
|
2
|
+
import type { ResolvedPiAiProviderProfile } from '@deepseek-ai/dsh-llm-pi-ai';
|
|
3
|
+
export type CoreCompatibleProvider = NonNullable<ResolvedPiAiProviderProfile['piProvider']>;
|
|
4
|
+
export type SimpleNativeProvider = Pick<Provider, 'id' | 'name' | 'baseUrl' | 'headers' | 'auth' | 'getModels' | 'filterModels' | 'streamSimple'>;
|
|
5
|
+
type CoreStream = ReturnType<CoreCompatibleProvider['streamSimple']>;
|
|
6
|
+
type PublicCoreStream = Pick<CoreStream, keyof CoreStream>;
|
|
7
|
+
type PublicNativeStream = Pick<AssistantMessageEventStream, keyof AssistantMessageEventStream>;
|
|
8
|
+
type Assert<Condition extends true> = Condition;
|
|
9
|
+
/** Compile-time, bidirectional proof; a future real public event change must fail this gate. */
|
|
10
|
+
export type PiStreamPublicCompatibility = [
|
|
11
|
+
Assert<PublicNativeStream extends PublicCoreStream ? true : false>,
|
|
12
|
+
Assert<PublicCoreStream extends PublicNativeStream ? true : false>
|
|
13
|
+
];
|
|
14
|
+
/** Retain the same stream object after proving its public surface; only SDK-private nominal identity differs. */
|
|
15
|
+
export declare function coreEventStream(stream: AssistantMessageEventStream): CoreStream;
|
|
16
|
+
/**
|
|
17
|
+
* The published Core adapter consumes streamSimple. Do not pretend its older
|
|
18
|
+
* protocol-specific clients are interchangeable with a newer SDK's clients.
|
|
19
|
+
*/
|
|
20
|
+
export declare function coreProviderView(provider: SimpleNativeProvider): CoreCompatibleProvider;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=pi-provider-bridge.d.ts.map
|
|
@@ -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,66 @@
|
|
|
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 { CopilotStreamIdleError, CopilotStreamLiveness } from './copilot-stream-liveness.ts';
|
|
8
|
+
export type ManagedWireAbortCode = 'COPILOT_PREVIEW_CREDENTIAL_CHANGED' | 'COPILOT_PREVIEW_DISPOSED';
|
|
9
|
+
/** Identity, not upstream error text, proves that the plugin revoked this wire. */
|
|
10
|
+
export declare class ManagedWireAbortError extends Error {
|
|
11
|
+
readonly code: ManagedWireAbortCode;
|
|
12
|
+
constructor(code: ManagedWireAbortCode);
|
|
13
|
+
}
|
|
14
|
+
/** Per-call authorization/lifetime checks supplied by the owning route. */
|
|
15
|
+
export interface PreviewProviderGuard {
|
|
16
|
+
readonly signal: AbortSignal;
|
|
17
|
+
assertActive(): void;
|
|
18
|
+
assertAccount(credential: GitHubCopilotOAuthCredential): void;
|
|
19
|
+
beforeWire(model: Model<Api>, options?: StreamOptions): Promise<{
|
|
20
|
+
signal: AbortSignal;
|
|
21
|
+
release(): void;
|
|
22
|
+
}>;
|
|
23
|
+
/** Actual model HTTP 401, excluding proven Responses replay-scope failures; no request replay. */
|
|
24
|
+
onUnauthorized?(): void;
|
|
25
|
+
/** Dispatch-local, verified replay failure; never inferred from SDK error text. */
|
|
26
|
+
onReplayFailure?(error: CopilotResponsesReplayError): void;
|
|
27
|
+
/** Preserve an owned abort cause before SDK terminal delivery and lease cleanup. */
|
|
28
|
+
onWireAbort?(code: ManagedWireAbortCode): void;
|
|
29
|
+
/** Request-local safe guidance from a verified HTTP response; undefined clears prior evidence. */
|
|
30
|
+
onRequestBodyTimeout?(diagnostic: string | undefined): void;
|
|
31
|
+
/** Optional HTTP byte-idle bound paired with a separate native semantic deadline. */
|
|
32
|
+
readonly streamIdleTimeoutMs?: number;
|
|
33
|
+
onStreamLiveness?(control: Pick<CopilotStreamLiveness, 'pause' | 'resume'>): void;
|
|
34
|
+
onStreamIdleTimeout?(error: CopilotStreamIdleError): void;
|
|
35
|
+
}
|
|
36
|
+
/** Guard for one selected model in an account-bound descriptor snapshot. */
|
|
37
|
+
export interface AccountProviderGuard extends PreviewProviderGuard {
|
|
38
|
+
/** Explicit, request-admitted recovery; absent by default. */
|
|
39
|
+
recoverReplay?(payload: unknown): unknown;
|
|
40
|
+
/** Only exact verified scope HTTP failures may offer recovery evidence. */
|
|
41
|
+
onReplayScopeRejected?(body: string | undefined): void;
|
|
42
|
+
readonly selectedModelId?: string;
|
|
43
|
+
readonly retryReplay?: ResponsesRetryReplay;
|
|
44
|
+
readonly retrySignal?: AbortSignal;
|
|
45
|
+
/** Per-dispatch admission after native context conversion, before starting a model wire. */
|
|
46
|
+
inspectRequest?(model: Model<Api>, context: TranscriptContext, options?: StreamOptions): void;
|
|
47
|
+
/** Optional auxiliary-call deadline fence immediately before native Fetch dispatch. */
|
|
48
|
+
requestCheckpoint?(): void;
|
|
49
|
+
assertEntitled(credential: GitHubCopilotOAuthCredential, modelId: string): void;
|
|
50
|
+
}
|
|
51
|
+
/** The independent prompt limit is retained for the route's budget guard, not folded into context capacity. */
|
|
52
|
+
export type AccountPiModel = Model<AccountModelApi> & {
|
|
53
|
+
readonly maxInputTokens?: number;
|
|
54
|
+
readonly unmappedReasoningEfforts: readonly string[];
|
|
55
|
+
readonly minThinkingBudget?: number;
|
|
56
|
+
readonly maxThinkingBudget?: number;
|
|
57
|
+
};
|
|
58
|
+
export declare function copilotPublicHeaders(): Readonly<Record<string, string>>;
|
|
59
|
+
/** Materialize advertised capabilities only; model names and the local static catalog never select the API. */
|
|
60
|
+
export declare function accountModelFromDescriptor(descriptor: AccountModelDescriptor, baseURL: string): AccountPiModel;
|
|
61
|
+
/** Create a descriptor-driven, OAuth-only provider using native SDK serialization for all supported endpoints. */
|
|
62
|
+
export declare function createAccountProvider(descriptors: readonly AccountModelDescriptor[], guard: AccountProviderGuard, baseURL: string): {
|
|
63
|
+
provider: CoreCompatibleProvider;
|
|
64
|
+
models: readonly AccountPiModel[];
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=preview-provider.d.ts.map
|