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,42 @@
|
|
|
1
|
+
export declare const COPILOT_ACCOUNT_ID_PATTERN: RegExp;
|
|
2
|
+
export declare const COPILOT_ACCOUNTS_MAX = 32;
|
|
3
|
+
export declare const COPILOT_ACCOUNTS_DIAGNOSTICS: readonly ["COPILOT_ACCOUNTS_SELECTOR_INVALID", "COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE", "COPILOT_ACCOUNTS_SELECTED_MISSING", "COPILOT_ACCOUNTS_CREDENTIALS_UNAVAILABLE", "COPILOT_ACCOUNTS_CHANGED", "COPILOT_ACCOUNTS_BUSY", "COPILOT_ACCOUNTS_CONFLICT", "COPILOT_ACCOUNTS_COMMIT_UNCERTAIN", "COPILOT_ACCOUNTS_MODELS_FAILED", "COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE", "COPILOT_ACCOUNTS_IDENTITY_INVALID", "COPILOT_ACCOUNTS_IDENTITY_CHANGED", "COPILOT_ACCOUNTS_DUPLICATE", "COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED", "COPILOT_ACCOUNTS_ROUTE_BLOCKED", "COPILOT_ACCOUNTS_EVIDENCE_INCOMPLETE", "COPILOT_ACCOUNTS_LIMIT", "COPILOT_ACCOUNTS_AUTH_FAILED", "COPILOT_ACCOUNTS_AUTH_UNAVAILABLE", "COPILOT_ACCOUNTS_ACTIVE_REMOVE_BLOCKED", "COPILOT_ACCOUNTS_REMOVE_FAILED", "COPILOT_ACCOUNTS_DISPOSED"];
|
|
4
|
+
export type CopilotAccountsDiagnostic = typeof COPILOT_ACCOUNTS_DIAGNOSTICS[number];
|
|
5
|
+
export interface CopilotAccountIdentity {
|
|
6
|
+
readonly login: string;
|
|
7
|
+
readonly userId: number;
|
|
8
|
+
}
|
|
9
|
+
export interface CopilotAccountView {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly identity?: CopilotAccountIdentity;
|
|
12
|
+
readonly identityState: 'ready' | 'unavailable' | 'unknown';
|
|
13
|
+
readonly configured: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface CopilotAccountsNotice {
|
|
16
|
+
readonly message: string;
|
|
17
|
+
readonly url?: string;
|
|
18
|
+
readonly code?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface CopilotAccountsView {
|
|
21
|
+
readonly state: 'ready' | 'error';
|
|
22
|
+
readonly activeAccountId: string;
|
|
23
|
+
readonly revision?: number;
|
|
24
|
+
readonly writable: boolean;
|
|
25
|
+
readonly switchable: boolean;
|
|
26
|
+
readonly accounts: readonly CopilotAccountView[];
|
|
27
|
+
readonly operation?: 'authorizing' | 'switching';
|
|
28
|
+
readonly notices: readonly CopilotAccountsNotice[];
|
|
29
|
+
readonly diagnostic?: CopilotAccountsDiagnostic;
|
|
30
|
+
}
|
|
31
|
+
/** Host-only, immutable addressing. Never serialize this object into a Remote. */
|
|
32
|
+
export interface CopilotAccountBinding {
|
|
33
|
+
readonly accountId: string;
|
|
34
|
+
readonly key: string;
|
|
35
|
+
readonly generation: number;
|
|
36
|
+
assertCurrent(): void;
|
|
37
|
+
}
|
|
38
|
+
export interface CopilotAccountLease {
|
|
39
|
+
readonly binding: CopilotAccountBinding;
|
|
40
|
+
release(): void;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=copilot-accounts-types.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import type { CopilotAccountBinding } from './copilot-accounts-types.ts';
|
|
9
|
+
export { normalizeGitHubCopilotOAuthCredential } from './copilot-grant.ts';
|
|
10
|
+
export declare function captureActiveGitHubCopilotBinding(ctx: Context): CopilotAccountBinding | undefined;
|
|
11
|
+
/** Bind exactly one logical route to the canonical Host-owned credential record. */
|
|
12
|
+
export declare function createGitHubCopilotCredentialStore(ctx: Context, logicalProviderId?: typeof GITHUB_COPILOT_PROVIDER_ID | typeof GITHUB_COPILOT_PREVIEW_PROVIDER_ID, binding?: CopilotAccountBinding): CredentialStore;
|
|
13
|
+
/**
|
|
14
|
+
* Build one resolver whose pi-ai collection refreshes OAuth credentials inside
|
|
15
|
+
* the DSH record's serialized modify operation before exposing request auth.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createGitHubCopilotTokenResolver(ctx: Context, onCredentialChanged?: () => Promise<void>): (modelId: string) => Promise<GitHubCopilotRequestAuth | undefined>;
|
|
18
|
+
export interface GitHubCopilotRequestAuth {
|
|
19
|
+
readonly apiKey: string;
|
|
20
|
+
readonly baseURL: string;
|
|
21
|
+
readonly headers?: Readonly<Record<string, string | null>>;
|
|
22
|
+
}
|
|
23
|
+
/** Validate an OAuth-derived endpoint without disclosing its value or credential payload. */
|
|
24
|
+
export declare function trustedGitHubCopilotBaseUrl(value: string | undefined, grant: unknown): string;
|
|
25
|
+
//# 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,11 @@
|
|
|
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
|
+
export declare const GITHUB_COPILOT_AUTO_MODEL_ID = "auto";
|
|
7
|
+
export declare const GITHUB_COPILOT_AUTO_EFFICIENCY_MODEL_ID = "auto-efficiency";
|
|
8
|
+
export declare const GITHUB_COPILOT_AUTO_INTELLIGENCE_MODEL_ID = "auto-intelligence";
|
|
9
|
+
export type AutoModelPreference = 'efficiency' | 'balance' | 'intelligence';
|
|
10
|
+
export declare function autoModelPreference(model: string): AutoModelPreference | undefined;
|
|
11
|
+
//# 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,23 @@
|
|
|
1
|
+
export declare class CopilotStreamIdleError extends Error {
|
|
2
|
+
readonly timeoutMs: number;
|
|
3
|
+
constructor(timeoutMs: number, stage?: string, requestBytes?: number);
|
|
4
|
+
}
|
|
5
|
+
/** A request-local byte-idle bound; the native adapter separately bounds semantic silence. */
|
|
6
|
+
export declare class CopilotStreamLiveness {
|
|
7
|
+
private readonly timeoutMs;
|
|
8
|
+
private readonly controller;
|
|
9
|
+
private timer;
|
|
10
|
+
private disposed;
|
|
11
|
+
private paused;
|
|
12
|
+
private stage;
|
|
13
|
+
private requestBytes;
|
|
14
|
+
readonly signal: AbortSignal;
|
|
15
|
+
constructor(timeoutMs: number, upstream: AbortSignal);
|
|
16
|
+
pulse(): void;
|
|
17
|
+
beginRequest(body?: string): void;
|
|
18
|
+
pause(): void;
|
|
19
|
+
resume(): void;
|
|
20
|
+
observe(response: Response): Response;
|
|
21
|
+
dispose: () => void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=copilot-stream-liveness.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { CopilotUsageView } from './copilot-usage-types.ts';
|
|
3
|
+
import type { CopilotAccountsRemote } from './copilot-accounts-card.ts';
|
|
4
|
+
/** Client-only face: no credentials, provider transport or billing arithmetic. */
|
|
5
|
+
export interface CopilotUsageRemote {
|
|
6
|
+
get(): Promise<{
|
|
7
|
+
ok: true;
|
|
8
|
+
value: CopilotUsageView;
|
|
9
|
+
} | {
|
|
10
|
+
ok: false;
|
|
11
|
+
error: unknown;
|
|
12
|
+
}>;
|
|
13
|
+
refresh(): Promise<{
|
|
14
|
+
ok: true;
|
|
15
|
+
value: CopilotUsageView;
|
|
16
|
+
} | {
|
|
17
|
+
ok: false;
|
|
18
|
+
error: unknown;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
export interface CopilotUsageCardProps {
|
|
22
|
+
remote?: CopilotUsageRemote;
|
|
23
|
+
accountsRemote?: Pick<CopilotAccountsRemote, 'get' | 'refreshIdentity'>;
|
|
24
|
+
/** Changes revoke every in-flight read, including switches between Copilot routes. */
|
|
25
|
+
contextKey: string;
|
|
26
|
+
locale?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Mounted only for a proven effective Copilot selection in the owning Session. */
|
|
29
|
+
export declare function CopilotUsageCard(props: CopilotUsageCardProps): ReactElement;
|
|
30
|
+
//# sourceMappingURL=copilot-usage-card.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
|
+
import { Agent } from 'undici';
|
|
4
|
+
import type { CopilotUsageView } from './copilot-usage-types.ts';
|
|
5
|
+
export declare const COPILOT_USAGE_ENDPOINT = "https://api.github.com/copilot_internal/user";
|
|
6
|
+
interface Dependencies {
|
|
7
|
+
readonly accountId?: string;
|
|
8
|
+
readCredential(): Promise<unknown>;
|
|
9
|
+
fetch?: typeof globalThis.fetch;
|
|
10
|
+
now?: () => number;
|
|
11
|
+
getCACertificates?: (type: 'default' | 'system') => string[];
|
|
12
|
+
createDispatcher?: (options: Agent.Options) => Agent;
|
|
13
|
+
}
|
|
14
|
+
/** One Host-owned, memory-only account cache. No auth renewal, persistence or model transport. */
|
|
15
|
+
export declare class CopilotUsageSource {
|
|
16
|
+
private readonly dependencies;
|
|
17
|
+
private readonly fetcher;
|
|
18
|
+
private readonly now;
|
|
19
|
+
private dispatcher;
|
|
20
|
+
private generation;
|
|
21
|
+
private disposed;
|
|
22
|
+
private key;
|
|
23
|
+
private cached;
|
|
24
|
+
private last;
|
|
25
|
+
private nextRefreshAt;
|
|
26
|
+
private failureUntil;
|
|
27
|
+
private flight;
|
|
28
|
+
constructor(dependencies: Dependencies);
|
|
29
|
+
invalidate(): void;
|
|
30
|
+
dispose(): Promise<void>;
|
|
31
|
+
get(): Promise<CopilotUsageView>;
|
|
32
|
+
refresh(): Promise<CopilotUsageView>;
|
|
33
|
+
private active;
|
|
34
|
+
private readAuth;
|
|
35
|
+
private assertCurrent;
|
|
36
|
+
private diagnostic;
|
|
37
|
+
private quotaDispatcher;
|
|
38
|
+
private load;
|
|
39
|
+
private fetchQuota;
|
|
40
|
+
private request;
|
|
41
|
+
}
|
|
42
|
+
declare module '@deepseek-ai/cordis' {
|
|
43
|
+
interface Context {
|
|
44
|
+
githubCopilotUsage: GitHubCopilotUsageController;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export default class GitHubCopilotUsageController extends TypertRemoteService {
|
|
48
|
+
private source;
|
|
49
|
+
private accountSignature;
|
|
50
|
+
private sourceInitialized;
|
|
51
|
+
constructor(ctx: Context);
|
|
52
|
+
private createSource;
|
|
53
|
+
private current;
|
|
54
|
+
get(): Promise<CopilotUsageView>;
|
|
55
|
+
refresh(): Promise<CopilotUsageView>;
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=copilot-usage-host.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CopilotUsageView, CopilotUsageDiagnostic } from './copilot-usage-types.ts';
|
|
2
|
+
export declare function unavailableCopilotUsage(diagnostic: CopilotUsageDiagnostic, billing?: CopilotUsageView['billing'], budget?: CopilotUsageView['budget']): CopilotUsageView;
|
|
3
|
+
/**
|
|
4
|
+
* Pinned VS Code 44825207: parseQuotas/getQuotaUsage and chatStatusDashboard
|
|
5
|
+
* display account amounts directly. Only per-turn nano-AIU uses /1e9; it is
|
|
6
|
+
* intentionally absent here. Pooled credits_used never shares an entitlement.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeCopilotUsage(input: unknown, observedAt: number): CopilotUsageView;
|
|
9
|
+
//# sourceMappingURL=copilot-usage-normalize.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { CopilotUsageView } from './copilot-usage-types.ts';
|
|
4
|
+
export type { CopilotUsageView } from './copilot-usage-types.ts';
|
|
5
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
6
|
+
interface TypertRemoteNamespaceMap {
|
|
7
|
+
githubCopilotUsage: {
|
|
8
|
+
get(): Promise<RemoteResult<CopilotUsageView>>;
|
|
9
|
+
refresh(): Promise<RemoteResult<CopilotUsageView>>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export declare const CopilotUsageViewSchema: z.ZodObject<{
|
|
14
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
15
|
+
state: z.ZodEnum<{
|
|
16
|
+
ready: "ready";
|
|
17
|
+
unavailable: "unavailable";
|
|
18
|
+
stale: "stale";
|
|
19
|
+
"signed-out": "signed-out";
|
|
20
|
+
}>;
|
|
21
|
+
billing: z.ZodEnum<{
|
|
22
|
+
unknown: "unknown";
|
|
23
|
+
credits: "credits";
|
|
24
|
+
requests: "requests";
|
|
25
|
+
}>;
|
|
26
|
+
budget: z.ZodEnum<{
|
|
27
|
+
unknown: "unknown";
|
|
28
|
+
individual: "individual";
|
|
29
|
+
pooled: "pooled";
|
|
30
|
+
}>;
|
|
31
|
+
used: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
remaining: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
percentUsed: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
resetAt: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
observedAt: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
diagnostic: z.ZodOptional<z.ZodEnum<{
|
|
38
|
+
COPILOT_USAGE_SIGNED_OUT: "COPILOT_USAGE_SIGNED_OUT";
|
|
39
|
+
COPILOT_USAGE_INVALID_GRANT: "COPILOT_USAGE_INVALID_GRANT";
|
|
40
|
+
COPILOT_USAGE_CREDENTIALS_UNAVAILABLE: "COPILOT_USAGE_CREDENTIALS_UNAVAILABLE";
|
|
41
|
+
COPILOT_USAGE_ENTERPRISE_UNSUPPORTED: "COPILOT_USAGE_ENTERPRISE_UNSUPPORTED";
|
|
42
|
+
COPILOT_USAGE_ACCOUNT_CHANGED: "COPILOT_USAGE_ACCOUNT_CHANGED";
|
|
43
|
+
COPILOT_USAGE_DISPOSED: "COPILOT_USAGE_DISPOSED";
|
|
44
|
+
COPILOT_USAGE_BILLING_UNKNOWN: "COPILOT_USAGE_BILLING_UNKNOWN";
|
|
45
|
+
COPILOT_USAGE_SNAPSHOT_MISSING: "COPILOT_USAGE_SNAPSHOT_MISSING";
|
|
46
|
+
COPILOT_USAGE_INVALID_RESPONSE: "COPILOT_USAGE_INVALID_RESPONSE";
|
|
47
|
+
COPILOT_USAGE_POOLED_UNAVAILABLE: "COPILOT_USAGE_POOLED_UNAVAILABLE";
|
|
48
|
+
COPILOT_USAGE_POOLED_EXHAUSTED: "COPILOT_USAGE_POOLED_EXHAUSTED";
|
|
49
|
+
COPILOT_USAGE_NO_ALLOCATION: "COPILOT_USAGE_NO_ALLOCATION";
|
|
50
|
+
COPILOT_USAGE_NETWORK: "COPILOT_USAGE_NETWORK";
|
|
51
|
+
COPILOT_USAGE_TLS: "COPILOT_USAGE_TLS";
|
|
52
|
+
COPILOT_USAGE_TRUST_UNAVAILABLE: "COPILOT_USAGE_TRUST_UNAVAILABLE";
|
|
53
|
+
COPILOT_USAGE_TIMEOUT: "COPILOT_USAGE_TIMEOUT";
|
|
54
|
+
COPILOT_USAGE_BODY_TOO_LARGE: "COPILOT_USAGE_BODY_TOO_LARGE";
|
|
55
|
+
COPILOT_USAGE_REDIRECT: "COPILOT_USAGE_REDIRECT";
|
|
56
|
+
COPILOT_USAGE_AUTH_REJECTED: "COPILOT_USAGE_AUTH_REJECTED";
|
|
57
|
+
COPILOT_USAGE_HTTP_ERROR: "COPILOT_USAGE_HTTP_ERROR";
|
|
58
|
+
COPILOT_USAGE_RATE_LIMITED: "COPILOT_USAGE_RATE_LIMITED";
|
|
59
|
+
}>>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
declare const contribution: TypertRemoteContribution;
|
|
62
|
+
export default contribution;
|
|
63
|
+
//# sourceMappingURL=copilot-usage-remote.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Client-safe account snapshot. Amounts are credits or requests, never token estimates. */
|
|
2
|
+
export interface CopilotUsageView {
|
|
3
|
+
readonly accountId?: string;
|
|
4
|
+
readonly state: 'ready' | 'stale' | 'unavailable' | 'signed-out';
|
|
5
|
+
readonly billing: 'credits' | 'requests' | 'unknown';
|
|
6
|
+
readonly budget: 'individual' | 'pooled' | 'unknown';
|
|
7
|
+
readonly used?: number;
|
|
8
|
+
readonly remaining?: number;
|
|
9
|
+
readonly limit?: number;
|
|
10
|
+
readonly percentUsed?: number;
|
|
11
|
+
/** Supplier-reported next reset in Unix epoch milliseconds, later than observedAt. */
|
|
12
|
+
readonly resetAt?: number;
|
|
13
|
+
readonly observedAt?: number;
|
|
14
|
+
readonly diagnostic?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const COPILOT_USAGE_MAX_AMOUNT = 1000000000000;
|
|
17
|
+
export declare const COPILOT_USAGE_MAX_TIMESTAMP = 253402300799999;
|
|
18
|
+
export declare const COPILOT_USAGE_DIAGNOSTICS: readonly ["COPILOT_USAGE_SIGNED_OUT", "COPILOT_USAGE_INVALID_GRANT", "COPILOT_USAGE_CREDENTIALS_UNAVAILABLE", "COPILOT_USAGE_ENTERPRISE_UNSUPPORTED", "COPILOT_USAGE_ACCOUNT_CHANGED", "COPILOT_USAGE_DISPOSED", "COPILOT_USAGE_BILLING_UNKNOWN", "COPILOT_USAGE_SNAPSHOT_MISSING", "COPILOT_USAGE_INVALID_RESPONSE", "COPILOT_USAGE_POOLED_UNAVAILABLE", "COPILOT_USAGE_POOLED_EXHAUSTED", "COPILOT_USAGE_NO_ALLOCATION", "COPILOT_USAGE_NETWORK", "COPILOT_USAGE_TLS", "COPILOT_USAGE_TRUST_UNAVAILABLE", "COPILOT_USAGE_TIMEOUT", "COPILOT_USAGE_BODY_TOO_LARGE", "COPILOT_USAGE_REDIRECT", "COPILOT_USAGE_AUTH_REJECTED", "COPILOT_USAGE_HTTP_ERROR", "COPILOT_USAGE_RATE_LIMITED"];
|
|
19
|
+
export type CopilotUsageDiagnostic = typeof COPILOT_USAGE_DIAGNOSTICS[number];
|
|
20
|
+
//# sourceMappingURL=copilot-usage-types.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
/** Public additive dock only; native composer, ContextMeter and other features stay owned by Core. */
|
|
3
|
+
export declare function registerCopilotUsageUi(ctx: Context): () => void;
|
|
4
|
+
//# sourceMappingURL=copilot-usage-ui.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
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
|
+
import { z as json } from 'zod';
|
|
4
|
+
import type { DualModelView, DualModelSaveRequest, DualModelCreateRequest, DualModelCreateResult } from './dual-model-types.ts';
|
|
5
|
+
export declare const DUAL_MODEL_NAMESPACE = "github-copilot-dual-model";
|
|
6
|
+
export declare const DUAL_MODEL_POLICY_EVENT = "github-copilot/dual-model-policy";
|
|
7
|
+
export declare const DUAL_MODEL_PROJECTION = "githubCopilotDualModelPolicy";
|
|
8
|
+
export declare const DUAL_MODEL_EXECUTE_TOOL = "copilot_execute";
|
|
9
|
+
declare const PolicyJson: json.ZodObject<{
|
|
10
|
+
version: json.ZodLiteral<1>;
|
|
11
|
+
rootSessionId: json.ZodString;
|
|
12
|
+
requestId: json.ZodString;
|
|
13
|
+
workspaceId: json.ZodString;
|
|
14
|
+
settingsRevision: json.ZodNumber;
|
|
15
|
+
cwd: json.ZodString;
|
|
16
|
+
agentPreset: json.ZodString;
|
|
17
|
+
provider: json.ZodLiteral<"github-copilot-preview">;
|
|
18
|
+
plannerModel: json.ZodString;
|
|
19
|
+
executorModel: json.ZodString;
|
|
20
|
+
executorTools: json.ZodArray<json.ZodString>;
|
|
21
|
+
plannerTools: json.ZodArray<json.ZodString>;
|
|
22
|
+
}, json.core.$strict>;
|
|
23
|
+
type Policy = json.infer<typeof PolicyJson>;
|
|
24
|
+
interface LogEvent {
|
|
25
|
+
readonly type: string;
|
|
26
|
+
readonly seq: number;
|
|
27
|
+
readonly data: unknown;
|
|
28
|
+
readonly ignorable?: true;
|
|
29
|
+
}
|
|
30
|
+
interface Header {
|
|
31
|
+
readonly id: string;
|
|
32
|
+
readonly cwd?: string;
|
|
33
|
+
readonly parentSession?: string;
|
|
34
|
+
readonly origin?: string;
|
|
35
|
+
readonly agentPreset?: string;
|
|
36
|
+
}
|
|
37
|
+
interface ChildDescriptor {
|
|
38
|
+
readonly version: 3;
|
|
39
|
+
readonly mode: 'continuable';
|
|
40
|
+
readonly provider: 'spawn';
|
|
41
|
+
readonly agentProvider: string;
|
|
42
|
+
readonly agentModel: string;
|
|
43
|
+
}
|
|
44
|
+
interface Projection {
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly parentId: string | null;
|
|
47
|
+
readonly origin: string | null;
|
|
48
|
+
readonly inherited: number;
|
|
49
|
+
readonly policy: Policy | null;
|
|
50
|
+
readonly child: ChildDescriptor | null;
|
|
51
|
+
readonly invalid: boolean;
|
|
52
|
+
}
|
|
53
|
+
/** A root policy is authoritative only in its own suffix, never in a fork seed. */
|
|
54
|
+
export declare const dualModelProjection: {
|
|
55
|
+
key: string;
|
|
56
|
+
stateVersion: number;
|
|
57
|
+
stateSchema: json.ZodObject<{
|
|
58
|
+
id: json.ZodString;
|
|
59
|
+
parentId: json.ZodNullable<json.ZodString>;
|
|
60
|
+
origin: json.ZodNullable<json.ZodString>;
|
|
61
|
+
inherited: json.ZodNumber;
|
|
62
|
+
policy: json.ZodNullable<json.ZodObject<{
|
|
63
|
+
version: json.ZodLiteral<1>;
|
|
64
|
+
rootSessionId: json.ZodString;
|
|
65
|
+
requestId: json.ZodString;
|
|
66
|
+
workspaceId: json.ZodString;
|
|
67
|
+
settingsRevision: json.ZodNumber;
|
|
68
|
+
cwd: json.ZodString;
|
|
69
|
+
agentPreset: json.ZodString;
|
|
70
|
+
provider: json.ZodLiteral<"github-copilot-preview">;
|
|
71
|
+
plannerModel: json.ZodString;
|
|
72
|
+
executorModel: json.ZodString;
|
|
73
|
+
executorTools: json.ZodArray<json.ZodString>;
|
|
74
|
+
plannerTools: json.ZodArray<json.ZodString>;
|
|
75
|
+
}, json.core.$strict>>;
|
|
76
|
+
child: json.ZodNullable<json.ZodObject<{
|
|
77
|
+
version: json.ZodLiteral<3>;
|
|
78
|
+
mode: json.ZodLiteral<"continuable">;
|
|
79
|
+
provider: json.ZodLiteral<"spawn">;
|
|
80
|
+
agentProvider: json.ZodString;
|
|
81
|
+
agentModel: json.ZodString;
|
|
82
|
+
}, json.core.$strict>>;
|
|
83
|
+
invalid: json.ZodBoolean;
|
|
84
|
+
}, json.core.$strip>;
|
|
85
|
+
init: (header: Header, inherited?: number) => Projection;
|
|
86
|
+
apply: (state: Projection, event: LogEvent) => Projection;
|
|
87
|
+
};
|
|
88
|
+
export declare function dualModelSessionId(requestId: string): string;
|
|
89
|
+
declare module '@deepseek-ai/cordis' {
|
|
90
|
+
interface Context {
|
|
91
|
+
githubCopilotDualModel: GitHubCopilotDualModel;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** Always mountable; retired entry points coexist with retained policy enforcement. */
|
|
95
|
+
export default class GitHubCopilotDualModel extends TypertRemoteService {
|
|
96
|
+
private readonly owner;
|
|
97
|
+
private readonly lifetime;
|
|
98
|
+
private readonly creates;
|
|
99
|
+
private readonly overlays;
|
|
100
|
+
private settingsReady;
|
|
101
|
+
private projectionReady;
|
|
102
|
+
private registrationFailed;
|
|
103
|
+
constructor(ctx: Context);
|
|
104
|
+
private capabilities;
|
|
105
|
+
private requireCapabilities;
|
|
106
|
+
private configuration;
|
|
107
|
+
view(): Promise<DualModelView>;
|
|
108
|
+
save(input: DualModelSaveRequest): Promise<DualModelView>;
|
|
109
|
+
private saveOnce;
|
|
110
|
+
create(input: DualModelCreateRequest): Promise<DualModelCreateResult>;
|
|
111
|
+
private createOnce;
|
|
112
|
+
private workspace;
|
|
113
|
+
private assertModels;
|
|
114
|
+
private projection;
|
|
115
|
+
private restore;
|
|
116
|
+
private install;
|
|
117
|
+
}
|
|
118
|
+
export {};
|
|
119
|
+
//# sourceMappingURL=dual-model-host.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Client-safe, strict wire contract for the optional Copilot model-role feature. */
|
|
2
|
+
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import type { DualModelView, DualModelSaveRequest, DualModelCreateRequest, DualModelCreateResult } from './dual-model-types.ts';
|
|
5
|
+
export type { DualModelConfig, DualModelView, DualModelSaveRequest, DualModelCreateRequest, DualModelCreateResult } from './dual-model-types.ts';
|
|
6
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
7
|
+
interface RemoteErrorDetailsMap {
|
|
8
|
+
'copilot/dual-model': {
|
|
9
|
+
readonly reason: string;
|
|
10
|
+
readonly creation?: 'not-created' | 'uncertain';
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
interface TypertRemoteNamespaceMap {
|
|
14
|
+
githubCopilotDualModel: {
|
|
15
|
+
view(): Promise<RemoteResult<DualModelView>>;
|
|
16
|
+
save(input: DualModelSaveRequest): Promise<RemoteResult<DualModelView>>;
|
|
17
|
+
create(input: DualModelCreateRequest): Promise<RemoteResult<DualModelCreateResult>>;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export declare const DualModelConfigSchema: z.ZodObject<{
|
|
22
|
+
enabled: z.ZodBoolean;
|
|
23
|
+
plannerModel: z.ZodString;
|
|
24
|
+
executorModel: z.ZodString;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
export declare const DualModelViewSchema: z.ZodObject<{
|
|
27
|
+
supported: z.ZodBoolean;
|
|
28
|
+
diagnostic: z.ZodOptional<z.ZodString>;
|
|
29
|
+
writable: z.ZodBoolean;
|
|
30
|
+
revision: z.ZodNullable<z.ZodNumber>;
|
|
31
|
+
configuration: z.ZodObject<{
|
|
32
|
+
enabled: z.ZodBoolean;
|
|
33
|
+
plannerModel: z.ZodString;
|
|
34
|
+
executorModel: z.ZodString;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
models: z.ZodArray<z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
}, z.core.$strict>>;
|
|
40
|
+
workspaces: z.ZodArray<z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
}, z.core.$strict>>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
export declare const DualModelSaveSchema: z.ZodObject<{
|
|
46
|
+
configuration: z.ZodObject<{
|
|
47
|
+
enabled: z.ZodBoolean;
|
|
48
|
+
plannerModel: z.ZodString;
|
|
49
|
+
executorModel: z.ZodString;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
expectedRevision: z.ZodNumber;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
export declare const DualModelCreateSchema: z.ZodObject<{
|
|
54
|
+
requestId: z.ZodString;
|
|
55
|
+
workspaceId: z.ZodString;
|
|
56
|
+
expectedRevision: z.ZodNumber;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
export declare const DualModelCreateResultSchema: z.ZodObject<{
|
|
59
|
+
sessionId: z.ZodString;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
declare const contribution: TypertRemoteContribution;
|
|
62
|
+
export default contribution;
|
|
63
|
+
//# sourceMappingURL=dual-model-remote.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Credential-free contracts shared by the optional dual-model Host and UI. */
|
|
2
|
+
export interface DualModelConfig {
|
|
3
|
+
readonly enabled: boolean;
|
|
4
|
+
readonly plannerModel: string;
|
|
5
|
+
readonly executorModel: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DualModelView {
|
|
8
|
+
readonly supported: boolean;
|
|
9
|
+
readonly diagnostic?: string;
|
|
10
|
+
readonly writable: boolean;
|
|
11
|
+
readonly revision: number | null;
|
|
12
|
+
readonly configuration: DualModelConfig;
|
|
13
|
+
readonly models: readonly {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly name: string;
|
|
16
|
+
}[];
|
|
17
|
+
readonly workspaces: readonly {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly name: string;
|
|
20
|
+
}[];
|
|
21
|
+
}
|
|
22
|
+
export interface DualModelSaveRequest {
|
|
23
|
+
readonly configuration: DualModelConfig;
|
|
24
|
+
readonly expectedRevision: number;
|
|
25
|
+
}
|
|
26
|
+
export interface DualModelCreateRequest {
|
|
27
|
+
readonly requestId: string;
|
|
28
|
+
readonly workspaceId: string;
|
|
29
|
+
readonly expectedRevision: number;
|
|
30
|
+
}
|
|
31
|
+
export interface DualModelCreateResult {
|
|
32
|
+
readonly sessionId: string;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=dual-model-types.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Failure classification for the inline wire path. The codes must land in
|
|
3
|
+
* the harness vocabulary dsh-llm-retry understands (AUTH, RATE_LIMIT,
|
|
4
|
+
* INVALID_REQUEST, SERVER, TIMEOUT, TRANSPORT, QUOTA,
|
|
5
|
+
* CONTEXT_WINDOW_EXCEEDED, UNKNOWN) so the standard retry policy applies.
|
|
6
|
+
* Also owns the finish-chunk constructors the two wires share.
|
|
7
|
+
* @module dsh-github-copilot/failure
|
|
8
|
+
*/
|
|
9
|
+
import type { LlmFailure, StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
10
|
+
/**
|
|
11
|
+
* Classify a non-OK HTTP response into the harness failure vocabulary.
|
|
12
|
+
* @param status - the HTTP status code.
|
|
13
|
+
* @param retryAfterMs - optional provider-requested delay in milliseconds.
|
|
14
|
+
* @param requestId - optional provider request id for diagnostics.
|
|
15
|
+
* @param apiLabel - the API family named in the diagnostic, e.g. `Messages API`.
|
|
16
|
+
* @returns the failure object for a finish chunk.
|
|
17
|
+
*/
|
|
18
|
+
export declare function classifyHttpStatus(status: number, retryAfterMs?: number, requestId?: string, apiLabel?: string): LlmFailure;
|
|
19
|
+
/**
|
|
20
|
+
* Parse an HTTP `Retry-After` header value into milliseconds. Only a
|
|
21
|
+
* non-negative seconds integer is accepted; an HTTP-date or any other value
|
|
22
|
+
* yields `undefined` rather than a `NaN` delay.
|
|
23
|
+
* @param retryAfter - the raw header value, or `null` when absent.
|
|
24
|
+
* @returns the delay in milliseconds, or `undefined`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseRetryAfterMs(retryAfter: string | null): number | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Classify a transport-level error (fetch throw, timeout, malformed body)
|
|
29
|
+
* into the harness failure vocabulary.
|
|
30
|
+
* @param error - the thrown value.
|
|
31
|
+
* @returns the failure object for a finish chunk.
|
|
32
|
+
*/
|
|
33
|
+
export declare function classifyWireError(error: unknown): LlmFailure;
|
|
34
|
+
/** The finish chunk for any failure; the generator never throws it. */
|
|
35
|
+
export declare function errorFinish(failure: LlmFailure): StreamChunk;
|
|
36
|
+
/** The finish chunk for a caller-aborted request. */
|
|
37
|
+
export declare function abortedFinish(): StreamChunk;
|
|
38
|
+
//# sourceMappingURL=failure.d.ts.map
|