dsh-github-copilot 0.4.0-alpha.18
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 +233 -0
- package/CONTRIBUTING.md +46 -0
- package/LICENSE +21 -0
- package/README.md +365 -0
- package/README.zh.md +376 -0
- package/SECURITY.md +29 -0
- package/cordis.patch.yml +16 -0
- package/deployment-baseline.json +752 -0
- package/docs/agent-readiness.md +95 -0
- package/docs/images/copilot-auth-card-signed-in.png +0 -0
- package/docs/images/copilot-device-code-copy.png +0 -0
- package/docs/images/copilot-model-freshness.png +0 -0
- package/docs/images/copilot-model-refreshing.png +0 -0
- package/docs/images/copilot-provider-authorization.png +0 -0
- package/docs/images/copilot-provider-entry.png +0 -0
- package/docs/images/github-copilot-auth-flow.gif +0 -0
- package/docs/model-compatibility-acceptance.md +46 -0
- package/docs/npm-distribution.md +134 -0
- package/docs/session-search-routing.md +53 -0
- package/docs/single-route-migration.md +115 -0
- package/lib/client.js +7153 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +5384 -0
- package/lib/remote.js +162 -0
- package/lib/routed-web.js +80 -0
- package/lib/search-routing-pFLux0W7.js +763 -0
- package/lib/types/account-model-auth.d.ts +15 -0
- package/lib/types/account-model-catalog.d.ts +67 -0
- package/lib/types/account-model-source.d.ts +85 -0
- package/lib/types/authorization-controller.d.ts +100 -0
- package/lib/types/client.d.ts +106 -0
- package/lib/types/compact-account.d.ts +42 -0
- package/lib/types/compatibility.d.ts +17 -0
- package/lib/types/config.d.ts +42 -0
- package/lib/types/content-file.d.ts +10 -0
- package/lib/types/copilot-auth.d.ts +23 -0
- package/lib/types/copilot-grant.d.ts +11 -0
- package/lib/types/copilot-identity.d.ts +6 -0
- package/lib/types/copilot-request.d.ts +11 -0
- package/lib/types/current-provider.d.ts +59 -0
- package/lib/types/deepseek-search-fallback.d.ts +11 -0
- package/lib/types/failure.d.ts +38 -0
- package/lib/types/http.d.ts +48 -0
- package/lib/types/index.d.ts +39 -0
- package/lib/types/migration-status.d.ts +50 -0
- package/lib/types/model-protocol.d.ts +31 -0
- package/lib/types/pi-provider-bridge.d.ts +22 -0
- package/lib/types/plan.d.ts +148 -0
- package/lib/types/preview-provider.d.ts +35 -0
- package/lib/types/preview-route.d.ts +63 -0
- package/lib/types/probe.d.ts +39 -0
- package/lib/types/reasoning-presentation.d.ts +55 -0
- package/lib/types/remote.d.ts +151 -0
- package/lib/types/responses-reasoning-text.d.ts +24 -0
- package/lib/types/responses-reasoning.d.ts +7 -0
- package/lib/types/route-ownership.d.ts +70 -0
- package/lib/types/routed-web.d.ts +38 -0
- package/lib/types/search-backend.d.ts +16 -0
- package/lib/types/search-routing.d.ts +43 -0
- package/lib/types/serialize.d.ts +109 -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/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 +10 -0
- package/lib/types/web-search-routing-config.d.ts +16 -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/package.json +200 -0
- package/scripts/check-search-composition.mjs +191 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CredentialStore } from '@earendil-works/pi-ai';
|
|
2
|
+
import type { GitHubCopilotOAuthCredential } from './copilot-grant.ts';
|
|
3
|
+
import type { AccountModelSourceDependencies } from './account-model-source.ts';
|
|
4
|
+
/** Native getAuth renews within five minutes; reserve another thirty seconds for metadata preparation. */
|
|
5
|
+
export declare const ACCOUNT_MODEL_AUTH_MIN_VALIDITY_MS: number;
|
|
6
|
+
/** An opaque, process-local account key. Never a substitute for request credentials. */
|
|
7
|
+
export declare function copilotAccountKey(grant: GitHubCopilotOAuthCredential): string;
|
|
8
|
+
/** Compare normalized permission snapshots without retaining model credentials. */
|
|
9
|
+
export declare function copilotEntitlementKey(grant: Pick<GitHubCopilotOAuthCredential, 'availableModelIds'>): string;
|
|
10
|
+
/**
|
|
11
|
+
* Bind model discovery to the existing native OAuth lifecycle. No model catalog,
|
|
12
|
+
* login, environment fallback or separate credential record is introduced here.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createAccountModelAuth(credentials: CredentialStore): Pick<AccountModelSourceDependencies, 'resolveAuth' | 'assertAuthCurrent'>;
|
|
15
|
+
//# sourceMappingURL=account-model-auth.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/** Pure normalization of account /models metadata; no transport, credentials, or model-name rules. */
|
|
2
|
+
export declare const ACCOUNT_MODEL_CATALOG_LIMITS: Readonly<{
|
|
3
|
+
maxBytes: number;
|
|
4
|
+
maxModels: 512;
|
|
5
|
+
maxIdLength: 200;
|
|
6
|
+
maxNameLength: 256;
|
|
7
|
+
maxEndpoints: 16;
|
|
8
|
+
maxEndpointLength: 128;
|
|
9
|
+
maxEfforts: 32;
|
|
10
|
+
maxEffortLength: 64;
|
|
11
|
+
maxMediaTypes: 32;
|
|
12
|
+
}>;
|
|
13
|
+
export type AccountModelApi = 'anthropic-messages' | 'openai-responses' | 'openai-completions';
|
|
14
|
+
export type AccountModelHttpEndpoint = '/v1/messages' | '/responses' | '/chat/completions';
|
|
15
|
+
type RecognizedEndpoint = AccountModelHttpEndpoint | 'ws:/responses';
|
|
16
|
+
/** Advertised data only; consumers must not turn unfamiliar labels into supported Core controls. */
|
|
17
|
+
export interface AccountModelReasoning {
|
|
18
|
+
readonly advertisedEfforts: readonly string[];
|
|
19
|
+
readonly unmappedEfforts: readonly string[];
|
|
20
|
+
readonly adaptiveThinking?: boolean;
|
|
21
|
+
readonly minThinkingBudget?: number;
|
|
22
|
+
readonly maxThinkingBudget?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface AccountModelDescriptor {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly name: string;
|
|
27
|
+
readonly api: AccountModelApi;
|
|
28
|
+
readonly contextWindow: number;
|
|
29
|
+
/** Independent server prompt limit; absence is not replaced with the context window. */
|
|
30
|
+
readonly maxInputTokens?: number;
|
|
31
|
+
readonly maxTokens: number;
|
|
32
|
+
readonly input: readonly ('text' | 'image')[];
|
|
33
|
+
readonly reasoning: AccountModelReasoning;
|
|
34
|
+
readonly evidence: {
|
|
35
|
+
/** Recognized endpoint literals only, never arbitrary URLs or query strings. */
|
|
36
|
+
readonly endpoints: readonly RecognizedEndpoint[];
|
|
37
|
+
readonly unsupportedEndpointCount: number;
|
|
38
|
+
readonly selectedEndpoint: AccountModelHttpEndpoint;
|
|
39
|
+
readonly apiSource: 'advertised-native' | 'advertised-priority';
|
|
40
|
+
readonly policySource: 'server-enabled' | 'account-available-id';
|
|
41
|
+
readonly contextWindowSource: 'max_context_window_tokens' | 'max_prompt_tokens';
|
|
42
|
+
readonly visionMediaTypes?: readonly string[];
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface AccountModelRejection {
|
|
46
|
+
readonly id?: string;
|
|
47
|
+
readonly code: string;
|
|
48
|
+
}
|
|
49
|
+
export interface AccountModelCatalog {
|
|
50
|
+
readonly models: readonly AccountModelDescriptor[];
|
|
51
|
+
readonly rejected: readonly AccountModelRejection[];
|
|
52
|
+
}
|
|
53
|
+
export interface AccountModelCatalogOptions {
|
|
54
|
+
readonly nativeApis?: ReadonlyMap<string, string>;
|
|
55
|
+
/** Proof supplied by the account-bound caller; used only when policy is absent. */
|
|
56
|
+
readonly availableModelIds?: ReadonlySet<string>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Normalize an account-bound /models response without model-name inference.
|
|
60
|
+
* JSON text is byte-bounded before parsing. Already-parsed objects have a
|
|
61
|
+
* bounded known-field work budget; unknown fields are deliberately not visited,
|
|
62
|
+
* so callers accepting objects must also bound the original transport body.
|
|
63
|
+
* Returned candidates do not replace request-time OAuth/account checks.
|
|
64
|
+
*/
|
|
65
|
+
export declare function normalizeAccountModelCatalog(raw: unknown, options?: AccountModelCatalogOptions): AccountModelCatalog;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=account-model-catalog.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { AccountModelCatalog } from './account-model-catalog.ts';
|
|
2
|
+
/** Transient native OAuth result. Only accountKey is permitted in a published snapshot. */
|
|
3
|
+
export interface AccountModelAuth {
|
|
4
|
+
readonly apiKey: string;
|
|
5
|
+
/** Already trust-validated by the native credential owner; this source additionally requires an HTTPS root. */
|
|
6
|
+
readonly baseURL: string;
|
|
7
|
+
readonly accountKey: string;
|
|
8
|
+
readonly availableModelIds?: readonly string[] | ReadonlySet<string>;
|
|
9
|
+
}
|
|
10
|
+
export interface AccountModelSourceDependencies {
|
|
11
|
+
resolveAuth(signal: AbortSignal): Promise<AccountModelAuth>;
|
|
12
|
+
/** Must reject if the account/token is no longer current. This callback must not perform OAuth refresh. */
|
|
13
|
+
assertAuthCurrent(auth: AccountModelAuth, signal: AbortSignal): void | Promise<void>;
|
|
14
|
+
fetch?: typeof globalThis.fetch;
|
|
15
|
+
/** Public static request headers only; credential/routing/framing headers are refused. */
|
|
16
|
+
headers?: Readonly<Record<string, string>>;
|
|
17
|
+
nativeApis?: ReadonlyMap<string, string>;
|
|
18
|
+
now?: () => number;
|
|
19
|
+
ttlMs?: number | (() => number);
|
|
20
|
+
/** Failure backoff for non-force discovery only; never a background retry timer. */
|
|
21
|
+
failureCooldownMs?: number | (() => number);
|
|
22
|
+
timeoutMs?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface AccountModelSnapshot extends AccountModelCatalog {
|
|
25
|
+
readonly accountKey: string;
|
|
26
|
+
readonly fetchedAt: number;
|
|
27
|
+
readonly generation: number;
|
|
28
|
+
}
|
|
29
|
+
export interface AccountModelSourceView {
|
|
30
|
+
readonly state: 'idle' | 'loading' | 'ready' | 'stale' | 'error' | 'disposed';
|
|
31
|
+
readonly generation: number;
|
|
32
|
+
readonly modelCount: number;
|
|
33
|
+
readonly rejectedCount: number;
|
|
34
|
+
readonly fetchedAt?: number;
|
|
35
|
+
readonly error?: AccountModelSourceErrorCode;
|
|
36
|
+
}
|
|
37
|
+
export interface AccountModelLoadOptions {
|
|
38
|
+
readonly force?: boolean;
|
|
39
|
+
readonly signal?: AbortSignal;
|
|
40
|
+
}
|
|
41
|
+
declare const codes: readonly ["COPILOT_MODEL_SOURCE_INVALID_CONFIG", "COPILOT_MODEL_SOURCE_INVALID_AUTH", "COPILOT_MODEL_SOURCE_AUTH_FAILED", "COPILOT_MODEL_SOURCE_AUTH_CHANGED", "COPILOT_MODEL_SOURCE_FETCH_FAILED", "COPILOT_MODEL_SOURCE_HTTP_ERROR", "COPILOT_MODEL_SOURCE_REDIRECTED_RESPONSE", "COPILOT_MODEL_SOURCE_BODY_FAILED", "COPILOT_MODEL_SOURCE_RESPONSE_TOO_LARGE", "COPILOT_MODEL_SOURCE_INVALID_RESPONSE", "COPILOT_MODEL_SOURCE_INVALID_CATALOG", "COPILOT_MODEL_SOURCE_INVALIDATED", "COPILOT_MODEL_SOURCE_ABORTED", "COPILOT_MODEL_SOURCE_TIMEOUT", "COPILOT_MODEL_SOURCE_DISPOSED"];
|
|
42
|
+
export type AccountModelSourceErrorCode = typeof codes[number];
|
|
43
|
+
export declare class AccountModelSourceError extends Error {
|
|
44
|
+
readonly code: AccountModelSourceErrorCode;
|
|
45
|
+
constructor(code: AccountModelSourceErrorCode);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Lazy account metadata, not model-call authorization. The owner must invalidate
|
|
49
|
+
* on credential/account changes and validate the account again before model wire.
|
|
50
|
+
* Cache reads do not refresh OAuth or claim authority over a separate Core catalog.
|
|
51
|
+
*/
|
|
52
|
+
export declare class AccountModelSource {
|
|
53
|
+
private readonly dependencies;
|
|
54
|
+
private readonly timeoutMs;
|
|
55
|
+
private readonly now;
|
|
56
|
+
private readonly fetch;
|
|
57
|
+
private readonly headers;
|
|
58
|
+
private readonly nativeApis;
|
|
59
|
+
private generation;
|
|
60
|
+
private disposed;
|
|
61
|
+
private cache;
|
|
62
|
+
private flight;
|
|
63
|
+
private failure;
|
|
64
|
+
private failedAt;
|
|
65
|
+
private readonly operations;
|
|
66
|
+
constructor(dependencies: AccountModelSourceDependencies);
|
|
67
|
+
private cacheDuration;
|
|
68
|
+
/** Display only: TTL expiry is allowed, but invalidation and clock guards still apply.
|
|
69
|
+
* The owner must additionally validate its account/token/entitlement proof before display. */
|
|
70
|
+
readDisplaySnapshot(): AccountModelSnapshot | undefined;
|
|
71
|
+
readSnapshot(): AccountModelSnapshot | undefined;
|
|
72
|
+
getView(): AccountModelSourceView;
|
|
73
|
+
load(options?: AccountModelLoadOptions): Promise<AccountModelSnapshot>;
|
|
74
|
+
/** Revoke definitively rejected metadata and back off passive reuse/recovery. */
|
|
75
|
+
rejectSnapshot(snapshot: AccountModelSnapshot): boolean;
|
|
76
|
+
invalidate(): void;
|
|
77
|
+
dispose(): void;
|
|
78
|
+
private start;
|
|
79
|
+
private current;
|
|
80
|
+
private validateCurrent;
|
|
81
|
+
private perform;
|
|
82
|
+
}
|
|
83
|
+
export declare function createAccountModelSource(dependencies: AccountModelSourceDependencies): AccountModelSource;
|
|
84
|
+
export {};
|
|
85
|
+
//# sourceMappingURL=account-model-source.d.ts.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host-side bridge between the Models-page companion UI and DSH's neutral
|
|
3
|
+
* authorization, credential-record, and settings seams.
|
|
4
|
+
*/
|
|
5
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
6
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
7
|
+
import { type GitHubCopilotMigrationStatus } from './migration-status.ts';
|
|
8
|
+
export { GITHUB_COPILOT_CREDENTIAL_KEY, GITHUB_COPILOT_PROVIDER_ID } from './copilot-identity.ts';
|
|
9
|
+
export declare const LLM_PI_AI_SETTINGS_NAMESPACE = "llm-pi-ai";
|
|
10
|
+
export type GitHubCopilotModelCatalogState = 'current' | 'partially-outdated' | 'outdated';
|
|
11
|
+
export interface GitHubCopilotModelCatalogView {
|
|
12
|
+
readonly state: GitHubCopilotModelCatalogState;
|
|
13
|
+
readonly accountModelCount: number;
|
|
14
|
+
readonly supportedModelCount: number;
|
|
15
|
+
readonly unknownModelIds: readonly string[];
|
|
16
|
+
readonly temporarilyUnavailableModelIds?: readonly string[];
|
|
17
|
+
/** Exact models served by the plugin-owned route, not canonical Core metadata. */
|
|
18
|
+
readonly previewModelIds?: readonly string[];
|
|
19
|
+
}
|
|
20
|
+
export interface GitHubCopilotProviderProfileResult {
|
|
21
|
+
readonly changed: boolean;
|
|
22
|
+
/** Legacy result field retained for consumers; canonical repair does not project a catalog. */
|
|
23
|
+
readonly catalog?: GitHubCopilotModelCatalogView;
|
|
24
|
+
}
|
|
25
|
+
export interface AuthorizationNoticeView {
|
|
26
|
+
readonly message: string;
|
|
27
|
+
readonly url?: string;
|
|
28
|
+
readonly code?: string;
|
|
29
|
+
}
|
|
30
|
+
export type GitHubCopilotAuthorizationPhase = 'signed-out' | 'authorizing' | 'signed-in' | 'error';
|
|
31
|
+
export interface GitHubCopilotRouteView {
|
|
32
|
+
/** Legacy canonical configuration only; intentional absence is not an OAuth or managed-route failure. */
|
|
33
|
+
readonly state: 'ready' | 'needs-repair' | 'not-configured' | 'conflict' | 'error';
|
|
34
|
+
readonly diagnosticCode?: 'ROUTE_READ_FAILED' | 'RECONCILIATION_FAILED' | 'ROUTE_CONFLICT';
|
|
35
|
+
}
|
|
36
|
+
export interface GitHubCopilotAccountModelsView {
|
|
37
|
+
readonly state: 'idle' | 'loading' | 'ready' | 'stale' | 'error' | 'disposed' | 'unconfigured' | 'unavailable';
|
|
38
|
+
readonly models: readonly {
|
|
39
|
+
readonly id: string;
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly api: string;
|
|
42
|
+
}[];
|
|
43
|
+
readonly rejected: readonly {
|
|
44
|
+
readonly id?: string;
|
|
45
|
+
readonly code: string;
|
|
46
|
+
}[];
|
|
47
|
+
readonly warnings?: readonly {
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly code: string;
|
|
50
|
+
}[];
|
|
51
|
+
readonly discoveredAt?: number;
|
|
52
|
+
readonly error?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface GitHubCopilotAuthorizationView {
|
|
55
|
+
readonly phase: GitHubCopilotAuthorizationPhase;
|
|
56
|
+
readonly configured: boolean;
|
|
57
|
+
readonly writable: boolean;
|
|
58
|
+
readonly inFlight: boolean;
|
|
59
|
+
readonly notices: readonly AuthorizationNoticeView[];
|
|
60
|
+
readonly catalog?: GitHubCopilotModelCatalogView;
|
|
61
|
+
readonly route?: GitHubCopilotRouteView;
|
|
62
|
+
readonly accountModels?: GitHubCopilotAccountModelsView;
|
|
63
|
+
readonly error?: string;
|
|
64
|
+
}
|
|
65
|
+
/** Read-only legacy configuration planning; not-configured permits managed-only use and never requests creation. */
|
|
66
|
+
export declare function describeGitHubCopilotProviderProfile(ctx: Context): Promise<{
|
|
67
|
+
state: 'ready' | 'needs-repair' | 'not-configured' | 'conflict';
|
|
68
|
+
catalog?: GitHubCopilotModelCatalogView;
|
|
69
|
+
}>;
|
|
70
|
+
export declare function inspectGitHubCopilotProviderProfile(ctx: Context): Promise<GitHubCopilotProviderProfileResult>;
|
|
71
|
+
export declare function ensureGitHubCopilotProviderProfile(ctx: Context): Promise<boolean>;
|
|
72
|
+
/**
|
|
73
|
+
* Remote owner for the browser companion. No credential payload crosses this
|
|
74
|
+
* service: status uses record descriptions, sign-in delegates to the
|
|
75
|
+
* registered llm-pi-ai flow, and sign-out asks the credential seam to delete
|
|
76
|
+
* only llm-pi-ai's Copilot record.
|
|
77
|
+
*/
|
|
78
|
+
export declare class GitHubCopilotAuthorizationController extends TypertRemoteService {
|
|
79
|
+
private notices;
|
|
80
|
+
private failure;
|
|
81
|
+
private reconciliationFailed;
|
|
82
|
+
private attempt;
|
|
83
|
+
constructor(ctx: Context);
|
|
84
|
+
/** No-argument Ops evidence; deliberately independent of ordinary account status. */
|
|
85
|
+
migrationStatus(): GitHubCopilotMigrationStatus;
|
|
86
|
+
status(): Promise<GitHubCopilotAuthorizationView>;
|
|
87
|
+
/** Explicit model discovery: may refresh OAuth and GET the account catalog, never changes selection. */
|
|
88
|
+
discoverModels(): Promise<GitHubCopilotAuthorizationView>;
|
|
89
|
+
/** Ensure metadata for a visible account view, honoring shared cache and failure cooldown. */
|
|
90
|
+
ensureModels(): Promise<GitHubCopilotAuthorizationView>;
|
|
91
|
+
private loadAccountModels;
|
|
92
|
+
/** Explicit route repair over the stored account snapshot; never forces OAuth or a network probe. */
|
|
93
|
+
reconcile(): Promise<GitHubCopilotAuthorizationView>;
|
|
94
|
+
start(): Promise<GitHubCopilotAuthorizationView>;
|
|
95
|
+
cancel(): Promise<GitHubCopilotAuthorizationView>;
|
|
96
|
+
signOut(): Promise<GitHubCopilotAuthorizationView>;
|
|
97
|
+
private ensureProviderProfile;
|
|
98
|
+
}
|
|
99
|
+
export default GitHubCopilotAuthorizationController;
|
|
100
|
+
//# sourceMappingURL=authorization-controller.d.ts.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser companion for the Models provider-card slot.
|
|
3
|
+
*/
|
|
4
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
5
|
+
import { createElement } from 'react';
|
|
6
|
+
import { createCompactAccount } from './compact-account.ts';
|
|
7
|
+
import type { CSSProperties, ReactElement } from 'react';
|
|
8
|
+
import type { GitHubCopilotAuthorizationView } from './authorization-controller.ts';
|
|
9
|
+
import type { ProviderCardExtrasOwnerProps, SettingsSectionOwnerProps } from './dsh-supported-types.ts';
|
|
10
|
+
export { WebSearchRoutingCard } from './web-search-routing-card.ts';
|
|
11
|
+
export declare const inject: string[];
|
|
12
|
+
interface GitHubCopilotProviderCardProps extends ProviderCardExtrasOwnerProps {
|
|
13
|
+
readonly remote: ClientContext['remote']['githubCopilot'];
|
|
14
|
+
}
|
|
15
|
+
interface GitHubCopilotSettingsSectionProps extends SettingsSectionOwnerProps {
|
|
16
|
+
readonly remote: ClientContext['remote']['githubCopilot'];
|
|
17
|
+
}
|
|
18
|
+
/** Older Remote clients may not decode results: project known fields before validating our own copy. */
|
|
19
|
+
export declare function authorizationViewFrom(value: unknown): GitHubCopilotAuthorizationView | undefined;
|
|
20
|
+
export declare function catalogWarningOf(status: GitHubCopilotAuthorizationView | undefined): string | undefined;
|
|
21
|
+
/** Account allocation is not a claim that a route is loaded or a model request succeeded. */
|
|
22
|
+
export declare function previewAssignmentMessage(status: GitHubCopilotAuthorizationView | undefined): string | undefined;
|
|
23
|
+
export declare function routeStatusMessage(status: GitHubCopilotAuthorizationView | undefined): string | undefined;
|
|
24
|
+
export declare function activeAuthorizationNotice(status: GitHubCopilotAuthorizationView | undefined): GitHubCopilotAuthorizationView['notices'][number] | undefined;
|
|
25
|
+
type ClipboardWriter = Pick<Clipboard, 'writeText'>;
|
|
26
|
+
type CopyState = 'idle' | 'copying' | 'copied' | 'failed';
|
|
27
|
+
/** Copy a one-time authorization code through the browser clipboard boundary. */
|
|
28
|
+
export declare function copyAuthorizationCode(code: string, clipboard?: ClipboardWriter): Promise<void>;
|
|
29
|
+
interface AuthorizationNoticeProps {
|
|
30
|
+
readonly message: string;
|
|
31
|
+
readonly url?: string;
|
|
32
|
+
readonly code?: string;
|
|
33
|
+
readonly copyState: CopyState;
|
|
34
|
+
readonly onCopy: () => void;
|
|
35
|
+
readonly buttonStyle?: CSSProperties;
|
|
36
|
+
}
|
|
37
|
+
/** Pure presentation for the in-flight GitHub device-code handoff. */
|
|
38
|
+
export declare function GitHubCopilotAuthorizationNotice(props: AuthorizationNoticeProps): ReactElement;
|
|
39
|
+
/** Shared account authorization controls, mounted by the account footer or its fallback only. */
|
|
40
|
+
export declare function GitHubCopilotProviderCard(props: GitHubCopilotProviderCardProps): ReturnType<typeof createElement> | null;
|
|
41
|
+
type AccountModelsSnapshot = NonNullable<GitHubCopilotAuthorizationView['accountModels']>;
|
|
42
|
+
export interface AccountModelsUpdatedAt {
|
|
43
|
+
readonly text: string;
|
|
44
|
+
readonly dateTime: string;
|
|
45
|
+
readonly title: string;
|
|
46
|
+
readonly ariaLabel: string;
|
|
47
|
+
}
|
|
48
|
+
/** Pure presentation of the Host's last successful cache update; never invent freshness evidence. */
|
|
49
|
+
export declare function formatAccountModelsUpdatedAt(discoveredAt: number | undefined, now: number, locales?: Intl.LocalesArgument): AccountModelsUpdatedAt | undefined;
|
|
50
|
+
/** Display-only clock: no Remote, status, discovery, or controller lifecycle ownership. */
|
|
51
|
+
export declare function GitHubCopilotAccountModelsUpdatedAt(props: {
|
|
52
|
+
readonly discoveredAt: number | undefined;
|
|
53
|
+
}): ReactElement | null;
|
|
54
|
+
/** A discovery snapshot is metadata evidence, not proof of a successful model call. */
|
|
55
|
+
export declare function GitHubCopilotAccountModelsSummary(props: {
|
|
56
|
+
readonly snapshot: AccountModelsSnapshot;
|
|
57
|
+
}): ReactElement;
|
|
58
|
+
/** Explicit account discovery only: no mount-time request, polling, or automatic retry. */
|
|
59
|
+
export declare function GitHubCopilotAccountModelsPanel(props: {
|
|
60
|
+
readonly remote: ClientContext['remote']['githubCopilot'];
|
|
61
|
+
}): ReactElement;
|
|
62
|
+
interface GitHubCopilotPreviewFooterProps {
|
|
63
|
+
readonly remote: ClientContext['remote']['githubCopilot'];
|
|
64
|
+
/** A slot coordinator owns this controller's attachment across surface handoffs. */
|
|
65
|
+
readonly account?: ReturnType<typeof createCompactAccount>;
|
|
66
|
+
readonly embedded?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** One lifecycle owner; disclosure toggles never mount another status or discovery controller. */
|
|
69
|
+
export declare function GitHubCopilotCompactAccount(props: GitHubCopilotPreviewFooterProps): ReactElement;
|
|
70
|
+
/** Standalone footer presentation; registered Models seats use the shared surface coordinator. */
|
|
71
|
+
export declare function GitHubCopilotPreviewFooter(props: GitHubCopilotPreviewFooterProps): ReactElement;
|
|
72
|
+
type AccountSurfaceKind = 'provider' | 'footer' | 'settings';
|
|
73
|
+
interface AccountSurfaceSeat {
|
|
74
|
+
readonly kind: AccountSurfaceKind;
|
|
75
|
+
active: boolean;
|
|
76
|
+
}
|
|
77
|
+
type AccountController = ReturnType<typeof createCompactAccount>;
|
|
78
|
+
type AccountSurfaceOwner = {
|
|
79
|
+
readonly token: symbol;
|
|
80
|
+
readonly account: AccountController;
|
|
81
|
+
};
|
|
82
|
+
/** Only the mounted canonical row owns embedded controls. Credential presence is not row presence. */
|
|
83
|
+
export declare function isGitHubCopilotAccountRow(props: ProviderCardExtrasOwnerProps): boolean;
|
|
84
|
+
/** Plugin-owned mounted-seat leases, not a view into Core's settings or provider store.
|
|
85
|
+
* One controller follows the winning surface, retaining in-flight work during a
|
|
86
|
+
* handoff. Slot disposal revokes its leases even before React unmounts the rows.
|
|
87
|
+
*/
|
|
88
|
+
export declare function createAccountSurfaces(): {
|
|
89
|
+
getSnapshot: () => AccountSurfaceOwner | undefined;
|
|
90
|
+
invalidate(): void;
|
|
91
|
+
subscribe(listener: () => void): () => void;
|
|
92
|
+
mount(seat: AccountSurfaceSeat, token: symbol, remote: GitHubCopilotPreviewFooterProps["remote"]): () => void;
|
|
93
|
+
revoke(seat: AccountSurfaceSeat): void;
|
|
94
|
+
dispose(): void;
|
|
95
|
+
};
|
|
96
|
+
/** Arbitration happens in committed layout effects, never during speculative render. */
|
|
97
|
+
export declare function GitHubCopilotAccountSurface(props: GitHubCopilotPreviewFooterProps & {
|
|
98
|
+
readonly surfaces: ReturnType<typeof createAccountSurfaces>;
|
|
99
|
+
readonly seat: AccountSurfaceSeat;
|
|
100
|
+
readonly eligible?: boolean;
|
|
101
|
+
}): ReactElement | null;
|
|
102
|
+
/** Unified fallback when the Models footer extension is absent or incompatible. */
|
|
103
|
+
export declare function GitHubCopilotSettingsSection(props: GitHubCopilotSettingsSectionProps): ReturnType<typeof createElement>;
|
|
104
|
+
/** Mount the plugin-owned Remote namespace and register the Models card seat. */
|
|
105
|
+
export declare function apply(ctx: ClientContext): Promise<() => Promise<void>>;
|
|
106
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { GitHubCopilotAuthorizationView as View } from './authorization-controller.ts';
|
|
2
|
+
export interface CompactAccountRemote {
|
|
3
|
+
status(): Promise<unknown>;
|
|
4
|
+
start(): Promise<unknown>;
|
|
5
|
+
cancel(): Promise<unknown>;
|
|
6
|
+
signOut(): Promise<unknown>;
|
|
7
|
+
discoverModels(): Promise<unknown>;
|
|
8
|
+
ensureModels(): Promise<unknown>;
|
|
9
|
+
reconcile(): Promise<unknown>;
|
|
10
|
+
}
|
|
11
|
+
type Operation = 'start' | 'cancel' | 'signOut' | 'discoverModels' | 'reconcile';
|
|
12
|
+
export declare const AUTHORIZATION_POLL_INITIAL_MS = 500;
|
|
13
|
+
export declare const AUTHORIZATION_POLL_MAX_MS = 2000;
|
|
14
|
+
export interface CompactAccountSnapshot {
|
|
15
|
+
readonly view: View | undefined;
|
|
16
|
+
readonly checking: boolean;
|
|
17
|
+
readonly operation: Operation | undefined;
|
|
18
|
+
readonly error: string | undefined;
|
|
19
|
+
readonly copyState: 'idle' | 'copying' | 'copied' | 'failed';
|
|
20
|
+
}
|
|
21
|
+
/** One mounted account's snapshot, bounded freshness check and explicit actions.
|
|
22
|
+
* Initial signed-in status ensures missing/idle/stale/error metadata once or
|
|
23
|
+
* joins loading metadata; the Host owns single flight and failure cooldown.
|
|
24
|
+
* A confirmed user Start earns one forced discovery after sign-in completes.
|
|
25
|
+
* No Remote call occurs during construction. Every await is fenced by lifetime
|
|
26
|
+
* and request generation; UI disclosure changes never reconstruct this owner.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createCompactAccount(remote: CompactAccountRemote, decode: (value: unknown) => View | undefined, copy: (code: string) => Promise<void>): {
|
|
29
|
+
getSnapshot: () => CompactAccountSnapshot;
|
|
30
|
+
subscribe(listener: () => void): () => void;
|
|
31
|
+
attach(): () => void;
|
|
32
|
+
invalidate(): void;
|
|
33
|
+
retryStatus: () => Promise<void>;
|
|
34
|
+
start: () => Promise<void>;
|
|
35
|
+
cancel: () => Promise<void>;
|
|
36
|
+
signOut: () => Promise<void>;
|
|
37
|
+
refreshModels: () => Promise<void>;
|
|
38
|
+
reconcile: () => Promise<void>;
|
|
39
|
+
copyCode(): Promise<void>;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=compact-account.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fail-closed runtime validation for the DSH service APIs this integration
|
|
3
|
+
* consumes. Version ranges are validated by the deployment baseline; this
|
|
4
|
+
* check protects source and unpacked installs from API-shape drift.
|
|
5
|
+
* @module dsh-github-copilot/compatibility
|
|
6
|
+
*/
|
|
7
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
8
|
+
export declare const DSH_COMPATIBILITY: {
|
|
9
|
+
readonly release: "0.1.5-alpha.2";
|
|
10
|
+
readonly developmentRelease: "0.1.2-rc.1";
|
|
11
|
+
readonly peerRange: "0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.3-alpha.1 || 0.1.5-alpha.1 || 0.1.5-alpha.2 || 0.1.5-rc.1 || 0.1.5-rc.2";
|
|
12
|
+
readonly supportedReleases: readonly ["0.1.1-rc.2", "0.1.2-rc.1", "0.1.3-alpha.1", "0.1.5-alpha.1", "0.1.5-alpha.2", "0.1.5-rc.1", "0.1.5-rc.2"];
|
|
13
|
+
readonly requiredApis: readonly ["agentDefaultModel.currentSelection", "authorization.describe", "authorization.begin", "authorization.cancel", "credentials.describeRecord", "credentials.readRecord", "credentials.listRecords", "credentials.modifyRecord", "credentials.deleteRecord", "settings.get", "settings.describe", "settings.mutate", "settings.installSection", "web.registerSearchProvider", "systemPrompt.section", "context.on", "context.effect", "context.plugin"];
|
|
14
|
+
};
|
|
15
|
+
/** Assert every required Core service shape before registering any effects. */
|
|
16
|
+
export declare function assertDshCompatibility(ctx: Context): void;
|
|
17
|
+
//# sourceMappingURL=compatibility.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings section of the inline web-search plugin: the narrow-gate switch,
|
|
3
|
+
* provider whitelist, wire controls, and probe bounds. Everything is
|
|
4
|
+
* configurable through the settings seam; defaults follow the chat route.
|
|
5
|
+
* @module dsh-github-copilot/config
|
|
6
|
+
*/
|
|
7
|
+
import z from '@deepseek-ai/schemastery';
|
|
8
|
+
/** Plugin configuration. Defaults make the current chat route decide. */
|
|
9
|
+
export interface InlineConfig {
|
|
10
|
+
/** Master switch; false sends every request down the normal adapter path. */
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Provider whitelist (llm-pi-ai route keys). Empty = follow the current
|
|
14
|
+
* chat route, whose candidates decide whether the plugin can serve.
|
|
15
|
+
*/
|
|
16
|
+
providers: string[];
|
|
17
|
+
/** Append `include: ['web_search_call.action.sources']` to wire requests. */
|
|
18
|
+
includeSources: boolean;
|
|
19
|
+
/** Strip function-tool variants of the server-side web tools from the wire. */
|
|
20
|
+
stripServerTools: boolean;
|
|
21
|
+
/** Idle bound for one inline request, in milliseconds. */
|
|
22
|
+
idleTimeoutMs: number;
|
|
23
|
+
/** Verify the endpoint executes native search before serving. */
|
|
24
|
+
probe: boolean;
|
|
25
|
+
/** Bound on one probe request, in milliseconds. */
|
|
26
|
+
probeTimeoutMs: number;
|
|
27
|
+
/** Maximum reuse of account model metadata; credential proof guards still take precedence. */
|
|
28
|
+
accountModelTtlMs?: number;
|
|
29
|
+
/** Minimum delay after failed passive discovery; explicit Refresh bypasses it. */
|
|
30
|
+
accountModelFailureCooldownMs?: number;
|
|
31
|
+
/** Route the official web-search consumer by initiating Session when the bundle isolate is mounted. */
|
|
32
|
+
routeWebSearch?: boolean;
|
|
33
|
+
/** Automatic fallback, disclosed in results; no per-search approval dialog. */
|
|
34
|
+
searchFallback?: 'none' | 'deepseek';
|
|
35
|
+
/** Copilot model used when `github-copilot-hosted` serves independently of the initiating chat model. */
|
|
36
|
+
searchModel?: string;
|
|
37
|
+
/** Internal JSON backup of route leaves temporarily owned by the GPT-6 overlay. */
|
|
38
|
+
temporaryRouteBackup?: string;
|
|
39
|
+
}
|
|
40
|
+
/** Schema of the plugin's settings section. */
|
|
41
|
+
export declare const Config: z<InlineConfig>;
|
|
42
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** File-content detection shared by the hosted-search preflight. */
|
|
2
|
+
/** Structural signature of Core's recursive file-content helper. */
|
|
3
|
+
export type ContentHasFile = (content: readonly unknown[]) => boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Prefer Core's official recursive predicate when the installed release exports
|
|
6
|
+
* it. The structural fallback retains rc.2/rc.1 compatibility and follows the
|
|
7
|
+
* same `tool-result.content` recursion so file context always fails closed.
|
|
8
|
+
*/
|
|
9
|
+
export declare function contentHasFileCompat(content: readonly unknown[], official?: ContentHasFile | undefined): boolean;
|
|
10
|
+
//# sourceMappingURL=content-file.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-side GitHub Copilot auth resolution over the same credential record
|
|
3
|
+
* that DSH's built-in llm-pi-ai adapter owns.
|
|
4
|
+
*/
|
|
5
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
+
import { type CredentialStore } from '@earendil-works/pi-ai';
|
|
7
|
+
import { GITHUB_COPILOT_PROVIDER_ID, GITHUB_COPILOT_PREVIEW_PROVIDER_ID } from './copilot-identity.ts';
|
|
8
|
+
export { normalizeGitHubCopilotOAuthCredential } from './copilot-grant.ts';
|
|
9
|
+
/** Bind exactly one logical route to the canonical Host-owned credential record. */
|
|
10
|
+
export declare function createGitHubCopilotCredentialStore(ctx: Context, logicalProviderId?: typeof GITHUB_COPILOT_PROVIDER_ID | typeof GITHUB_COPILOT_PREVIEW_PROVIDER_ID): CredentialStore;
|
|
11
|
+
/**
|
|
12
|
+
* Build one resolver whose pi-ai collection refreshes OAuth credentials inside
|
|
13
|
+
* the DSH record's serialized modify operation before exposing request auth.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createGitHubCopilotTokenResolver(ctx: Context, onCredentialChanged?: () => Promise<void>): (modelId: string) => Promise<GitHubCopilotRequestAuth | undefined>;
|
|
16
|
+
export interface GitHubCopilotRequestAuth {
|
|
17
|
+
readonly apiKey: string;
|
|
18
|
+
readonly baseURL: string;
|
|
19
|
+
readonly headers?: Readonly<Record<string, string | null>>;
|
|
20
|
+
}
|
|
21
|
+
/** Validate an OAuth-derived endpoint without disclosing its value or credential payload. */
|
|
22
|
+
export declare function trustedGitHubCopilotBaseUrl(value: string | undefined, grant: unknown): string;
|
|
23
|
+
//# sourceMappingURL=copilot-auth.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OAuthCredential } from '@earendil-works/pi-ai';
|
|
2
|
+
export interface GitHubCopilotOAuthCredential extends OAuthCredential {
|
|
3
|
+
readonly enterpriseUrl?: string;
|
|
4
|
+
readonly availableModelIds?: readonly string[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Rebuild pi-ai's GitHub Copilot grant as the exact JSON-safe provider shape.
|
|
8
|
+
* Prototype and unrelated extension members are intentionally not preserved.
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizeGitHubCopilotOAuthCredential(credential: unknown): GitHubCopilotOAuthCredential;
|
|
11
|
+
//# sourceMappingURL=copilot-grant.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Native OAuth ownership and the sole plugin-owned, account-discovered route. */
|
|
2
|
+
export declare const GITHUB_COPILOT_CREDENTIAL_KEY = "llm-pi-ai/github-copilot";
|
|
3
|
+
export declare const GITHUB_COPILOT_PROVIDER_ID = "github-copilot";
|
|
4
|
+
export declare const GITHUB_COPILOT_PREVIEW_PROVIDER_ID = "github-copilot-preview";
|
|
5
|
+
export declare const GITHUB_COPILOT_PREVIEW_MODEL_ID = "gpt-6-astra";
|
|
6
|
+
//# sourceMappingURL=copilot-identity.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SearchPlanCandidate } from './plan.ts';
|
|
2
|
+
export interface ResolvedRequestAuth {
|
|
3
|
+
readonly apiKey: string;
|
|
4
|
+
readonly baseURL?: string;
|
|
5
|
+
readonly headers?: Readonly<Record<string, string | null>>;
|
|
6
|
+
}
|
|
7
|
+
export declare function normalizeRequestAuth(auth: string | ResolvedRequestAuth | undefined): ResolvedRequestAuth | undefined;
|
|
8
|
+
export declare function applyRequestAuth(candidate: SearchPlanCandidate, auth: ResolvedRequestAuth): SearchPlanCandidate;
|
|
9
|
+
/** Materialize pi-ai catalog headers and Copilot's per-request metadata. */
|
|
10
|
+
export declare function providerRequestHeaders(candidate: SearchPlanCandidate, initiator: 'agent' | 'user'): Readonly<Record<string, string>>;
|
|
11
|
+
//# sourceMappingURL=copilot-request.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detection of an operation's provider route: the initiating Agent or explicit
|
|
3
|
+
* request names a route and model, the `llm-pi-ai` settings
|
|
4
|
+
* section carries the route's profile, and the pi-ai catalog supplies the
|
|
5
|
+
* defaults (wire protocol, base URL) a profile that overrides nothing inherits.
|
|
6
|
+
* The probe and plan modules read this to decide which search-capable
|
|
7
|
+
* protocol to use without any configuration.
|
|
8
|
+
* @module dsh-github-copilot/current-provider
|
|
9
|
+
*/
|
|
10
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
11
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
12
|
+
/** The resolved chat-route facts this package consumes. */
|
|
13
|
+
export interface CurrentChatRoute {
|
|
14
|
+
/** Registered provider route key (the llm-pi-ai `providers` dict key). */
|
|
15
|
+
readonly provider: string;
|
|
16
|
+
/** Provider-owned model id. */
|
|
17
|
+
readonly model: string;
|
|
18
|
+
/** Wire protocol the route speaks, when determinable. */
|
|
19
|
+
readonly api?: string;
|
|
20
|
+
/** Endpoint base the route's requests go to. */
|
|
21
|
+
readonly baseURL?: string;
|
|
22
|
+
/** Credential reference the route resolves its key through. */
|
|
23
|
+
readonly apiKeyEnv?: string;
|
|
24
|
+
/** All interactive APIs advertised by this route's selected model. */
|
|
25
|
+
readonly supportedApis?: readonly string[];
|
|
26
|
+
/** Static provider/model request headers from pi-ai's catalog. */
|
|
27
|
+
readonly headers?: Readonly<Record<string, string | null>>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Read the public asynchronous initiator seam when supported by Core.
|
|
31
|
+
* Older Core and agentless callers have no session selection; never substitute
|
|
32
|
+
* the default-model service or an arbitrary registered Agent.
|
|
33
|
+
* @param ctx - Host context with the optional Agent registry.
|
|
34
|
+
* @returns the initiating Agent, or undefined when the capability/caller is absent.
|
|
35
|
+
*/
|
|
36
|
+
export declare function currentSearchInitiator(ctx: Context): Agent | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Capture the initiating Session's effective request route. Agent.options is
|
|
39
|
+
* only an activation seed; Core model-selection waterfalls need not update it.
|
|
40
|
+
* @param agent - initiating Agent recovered at the operation entry.
|
|
41
|
+
* @returns provider/model leaves from the last committed request header, or none.
|
|
42
|
+
*/
|
|
43
|
+
export declare function currentSearchSelection(agent: Agent | undefined): {
|
|
44
|
+
provider: string;
|
|
45
|
+
model: string;
|
|
46
|
+
} | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Resolve one operation's route. Explicit GenerateOptions fields are already
|
|
49
|
+
* resolved by Core and take precedence; otherwise use the initiating Session's
|
|
50
|
+
* effective request header. Missing request evidence fails closed.
|
|
51
|
+
* @param ctx - context used for public initiator, settings and catalog reads.
|
|
52
|
+
* @param explicit - explicit request selection, captured at operation entry.
|
|
53
|
+
* @returns owned route facts, or undefined without a usable selection.
|
|
54
|
+
*/
|
|
55
|
+
export declare function currentChatRoute(ctx: Context, explicit?: {
|
|
56
|
+
readonly provider?: string;
|
|
57
|
+
readonly model?: string;
|
|
58
|
+
}): CurrentChatRoute | undefined;
|
|
59
|
+
//# sourceMappingURL=current-provider.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { WebSearchProvider } from '@deepseek-ai/dsh-web';
|
|
4
|
+
/**
|
|
5
|
+
* Compose a known official fallback only when permitted. The public native class
|
|
6
|
+
* owns transport, redirects and parsing. A per-operation instance keeps backend
|
|
7
|
+
* disclosure aligned with that operation's options even during concurrent calls.
|
|
8
|
+
* canContinue must be the initiating router's captured operation-local guard.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createDeepSeekSearchFallback(ctx: Context, owner: Agent | undefined, canContinue: () => boolean): Promise<WebSearchProvider>;
|
|
11
|
+
//# sourceMappingURL=deepseek-search-fallback.d.ts.map
|