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,74 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { PiAiProviderProfile } from '@deepseek-ai/dsh-llm-pi-ai';
|
|
3
|
+
import { GITHUB_COPILOT_PREVIEW_PROVIDER_ID } from './copilot-identity.ts';
|
|
4
|
+
import type { AccountModelLoadOptions } from './account-model-source.ts';
|
|
5
|
+
import type { AccountModelDescriptor, AccountModelRejection } from './account-model-catalog.ts';
|
|
6
|
+
import type { InlineConfig } from './config.ts';
|
|
7
|
+
import type { RequestBudgetPolicy } from './request-budget.ts';
|
|
8
|
+
/** Safe request knobs; identities, model tables, endpoints and credentials are not configurable. */
|
|
9
|
+
export type PreviewRouteConfig = Pick<PiAiProviderProfile, 'reasoning' | 'cacheRetention' | 'transport' | 'timeoutMs' | 'websocketConnectTimeoutMs' | 'streamIdleTimeoutMs' | 'maxRequestImageBytes' | 'requestImagePixelBudget' | 'requestImageMaxBytes' | 'retryPolicy'> & Pick<InlineConfig, 'accountModelTtlMs' | 'accountModelFailureCooldownMs'> & {
|
|
10
|
+
readonly streamLiveness?: boolean;
|
|
11
|
+
readonly chatRequestSettings?: () => Pick<InlineConfig, 'chatStreamIdleTimeoutMs' | 'chatStreamLiveness' | 'chatMaxRequestImageBytes'>;
|
|
12
|
+
readonly accountModelSettings?: () => Pick<InlineConfig, 'accountModelTtlMs' | 'accountModelFailureCooldownMs' | 'excludedModelIds' | 'parentModelFollow' | 'followParentModel' | 'autoSemanticAssessment'>;
|
|
13
|
+
readonly requestBudget?: Partial<RequestBudgetPolicy>;
|
|
14
|
+
readonly requestBudgetSettings?: () => Partial<RequestBudgetPolicy>;
|
|
15
|
+
};
|
|
16
|
+
export interface GitHubCopilotPreviewView {
|
|
17
|
+
readonly provider: typeof GITHUB_COPILOT_PREVIEW_PROVIDER_ID;
|
|
18
|
+
readonly configured: boolean;
|
|
19
|
+
readonly available: boolean;
|
|
20
|
+
readonly correctionActive: boolean;
|
|
21
|
+
readonly state: 'idle' | 'loading' | 'ready' | 'stale' | 'unconfigured' | 'unavailable' | 'error' | 'disposed';
|
|
22
|
+
readonly models: readonly {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly api: string;
|
|
26
|
+
}[];
|
|
27
|
+
readonly rejected: readonly AccountModelRejection[];
|
|
28
|
+
readonly warnings: readonly {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly code: string;
|
|
31
|
+
}[];
|
|
32
|
+
readonly discoveredAt?: number;
|
|
33
|
+
readonly error?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface GitHubCopilotPreview {
|
|
36
|
+
getView(): GitHubCopilotPreviewView;
|
|
37
|
+
/** Synchronous, account-proven capacities for an explicit manual summary; never triggers discovery. */
|
|
38
|
+
recoveryLimits(modelId: string): {
|
|
39
|
+
readonly limits: Pick<AccountModelDescriptor, 'contextWindow' | 'maxInputTokens' | 'maxTokens'>;
|
|
40
|
+
readonly policy: Partial<RequestBudgetPolicy>;
|
|
41
|
+
readonly assertCurrent: () => void;
|
|
42
|
+
} | undefined;
|
|
43
|
+
/** Host-only current endpoint facts; no discovery and no credential material. */
|
|
44
|
+
routeFacts(modelId: string): {
|
|
45
|
+
readonly api: string;
|
|
46
|
+
readonly baseURL: string;
|
|
47
|
+
} | undefined;
|
|
48
|
+
/** Capture credential-proof continuity, independent of ordinary metadata cache TTL. */
|
|
49
|
+
captureSearchProof(): () => boolean;
|
|
50
|
+
/** Host-only credential resolution for an independent, account-scoped search request. */
|
|
51
|
+
resolveRequestAuth(modelId: string, signal?: AbortSignal): Promise<{
|
|
52
|
+
readonly apiKey: string;
|
|
53
|
+
readonly baseURL: string;
|
|
54
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
55
|
+
}>;
|
|
56
|
+
/** Read stored credentials/status only; never starts native refresh or discovery. */
|
|
57
|
+
refresh(): Promise<GitHubCopilotPreviewView>;
|
|
58
|
+
/** Explicit account model discovery. May refresh native OAuth and GET /models. */
|
|
59
|
+
discover(options?: AccountModelLoadOptions): Promise<GitHubCopilotPreviewView>;
|
|
60
|
+
}
|
|
61
|
+
declare module '@deepseek-ai/cordis' {
|
|
62
|
+
interface Context {
|
|
63
|
+
githubCopilotPreview: GitHubCopilotPreview;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Register one stable account route; attach/status remain network-free. */
|
|
67
|
+
export declare function apply(ctx: Context, config?: PreviewRouteConfig): void;
|
|
68
|
+
declare const _default: {
|
|
69
|
+
name: string;
|
|
70
|
+
inject: string[];
|
|
71
|
+
apply: typeof apply;
|
|
72
|
+
};
|
|
73
|
+
export default _default;
|
|
74
|
+
//# sourceMappingURL=preview-route.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability probe: one bounded operation per candidate protocol that forces
|
|
3
|
+
* the server-side web tool to run and checks the reply for the structured
|
|
4
|
+
* evidence that it did. A protocol claim is trusted only after this passes —
|
|
5
|
+
* several "Responses-compatible" gateways accept the `web_search` tool field
|
|
6
|
+
* and silently ignore it (DeepSeek documents that unknown tool types are
|
|
7
|
+
* ignored), which is exactly the failure mode static protocol detection
|
|
8
|
+
* cannot see. The probe is what makes the auto-disable decision honest.
|
|
9
|
+
* @module dsh-github-copilot/probe
|
|
10
|
+
*/
|
|
11
|
+
import type { ResponsesWebSearchToolType, SearchPlanCandidate } from './plan.ts';
|
|
12
|
+
import type { ResolvedRequestAuth } from './copilot-request.ts';
|
|
13
|
+
/** The outcome of probing one candidate. */
|
|
14
|
+
export interface ProbeOutcome {
|
|
15
|
+
readonly supported: boolean;
|
|
16
|
+
/** Why the candidate failed, for the auto-disable diagnostic. */
|
|
17
|
+
readonly detail: string;
|
|
18
|
+
/**
|
|
19
|
+
* The Responses tool spelling the probe verified (openai-responses only).
|
|
20
|
+
* May differ from the candidate's primary spelling when the fallback won;
|
|
21
|
+
* the wire must use this verified value.
|
|
22
|
+
*/
|
|
23
|
+
readonly webSearchToolType?: ResponsesWebSearchToolType;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Probe one candidate protocol with a bounded request sequence. The verdict is
|
|
27
|
+
* structural: a Responses reply must contain a `web_search_call` item and a
|
|
28
|
+
* Messages reply must contain a `web_search_tool_result` block; anything else
|
|
29
|
+
* — HTTP error, unparseable body, silent tool ignore — is "not supported".
|
|
30
|
+
* The timeout bounds the WHOLE probe, including credential resolution; the
|
|
31
|
+
* probe never throws — every failure becomes a verdict.
|
|
32
|
+
* @param candidate - the resolved endpoint facts to verify.
|
|
33
|
+
* @param resolveApiKey - resolves the candidate's credential reference.
|
|
34
|
+
* @param timeoutMs - bound on the whole probe.
|
|
35
|
+
* @param signal - optional owner lifecycle cancellation; abort forbids later attempts.
|
|
36
|
+
* @returns the verdict and a diagnostic detail.
|
|
37
|
+
*/
|
|
38
|
+
export declare function probeCandidate(candidate: SearchPlanCandidate, resolveApiKey: (candidate: SearchPlanCandidate) => Promise<string | ResolvedRequestAuth | undefined>, timeoutMs: number, signal?: AbortSignal): Promise<ProbeOutcome>;
|
|
39
|
+
//# sourceMappingURL=probe.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** Plugin-owned, Step-scoped provenance; never a model route or durable message. */
|
|
2
|
+
export declare const ASSISTANT_ORIGIN_KEY = "github-copilot-assistant-origin";
|
|
3
|
+
type Dispose = () => void;
|
|
4
|
+
export interface AssistantOrigin {
|
|
5
|
+
readonly seq: number;
|
|
6
|
+
readonly provider: string;
|
|
7
|
+
readonly model: string;
|
|
8
|
+
}
|
|
9
|
+
interface OriginState {
|
|
10
|
+
readonly turn: number;
|
|
11
|
+
readonly step: number;
|
|
12
|
+
readonly origin: AssistantOrigin | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface OriginMatch {
|
|
15
|
+
readonly event: unknown;
|
|
16
|
+
}
|
|
17
|
+
interface OriginContext {
|
|
18
|
+
readonly state?: OriginState | undefined;
|
|
19
|
+
readonly matches: readonly OriginMatch[];
|
|
20
|
+
}
|
|
21
|
+
interface OriginLocationData {
|
|
22
|
+
readonly kind: 'step';
|
|
23
|
+
readonly turn: number;
|
|
24
|
+
readonly step: number;
|
|
25
|
+
readonly key: typeof ASSISTANT_ORIGIN_KEY;
|
|
26
|
+
readonly value: AssistantOrigin;
|
|
27
|
+
}
|
|
28
|
+
/** Targetless Definition: registration rebuilds existing bindings, including cold history. */
|
|
29
|
+
export declare const assistantOriginDefinition: {
|
|
30
|
+
kind: string;
|
|
31
|
+
match(event: unknown): {
|
|
32
|
+
id: string;
|
|
33
|
+
role: "start" | "update";
|
|
34
|
+
} | null;
|
|
35
|
+
start(_context: OriginContext, match: OriginMatch): OriginState;
|
|
36
|
+
update(context: OriginContext & {
|
|
37
|
+
readonly state: OriginState;
|
|
38
|
+
}, match: OriginMatch): OriginState;
|
|
39
|
+
buildLocationData(context: OriginContext, scope: string, previous: OriginLocationData | null): OriginLocationData | null;
|
|
40
|
+
};
|
|
41
|
+
/** Shallow UI-only projection. Unchanged input retains its exact props identity. */
|
|
42
|
+
export declare function projectReasoningPresentation<Props extends object>(props: Props, origin: unknown): Props;
|
|
43
|
+
export interface ReasoningPresentationCapabilities {
|
|
44
|
+
readonly slots: unknown;
|
|
45
|
+
readonly uiConversation: unknown;
|
|
46
|
+
/** Receives stable codes only, never message text, model payloads or error bodies. */
|
|
47
|
+
readonly diagnostic: (code: string) => void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Optional Client enhancement. The caller owns the returned disposer in its
|
|
51
|
+
* dependency-scoped effect; missing older-Core seams leave native UI alone.
|
|
52
|
+
*/
|
|
53
|
+
export declare function installReasoningPresentation(capabilities: ReasoningPresentationCapabilities): Dispose;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=reasoning-presentation.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Client-safe bridge between legacy schema codecs and alpha.2 create factories. */
|
|
2
|
+
export declare function strictRemoteCodec<Schema extends {
|
|
3
|
+
parse(value: unknown): unknown;
|
|
4
|
+
}>(typeSymbol: string, schema: Schema): {
|
|
5
|
+
mode: "strict";
|
|
6
|
+
typeSymbol: string;
|
|
7
|
+
schema: Schema;
|
|
8
|
+
create: () => Schema;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=remote-codec.d.ts.map
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-safe Remote contribution for the plugin-owned authorization bridge.
|
|
3
|
+
*/
|
|
4
|
+
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { GitHubCopilotAuthorizationView, GitHubCopilotModelPreferencesView } from './authorization-controller.ts';
|
|
7
|
+
import type { GitHubCopilotMigrationStatus } from './migration-status.ts';
|
|
8
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
9
|
+
interface TypertRemoteNamespaceMap {
|
|
10
|
+
githubCopilot: {
|
|
11
|
+
migrationStatus(): Promise<RemoteResult<GitHubCopilotMigrationStatus>>;
|
|
12
|
+
status(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
13
|
+
reconcile(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
14
|
+
discoverModels(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
15
|
+
ensureModels(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
16
|
+
excludeModel(modelId: string): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
17
|
+
restoreModel(modelId: string): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
18
|
+
setModelExcluded(modelId: string, excluded: boolean): Promise<RemoteResult<GitHubCopilotModelPreferencesView>>;
|
|
19
|
+
start(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
20
|
+
cancel(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
21
|
+
signOut(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export declare const GITHUB_COPILOT_AUTHORIZATION_VIEW_TYPE_SYMBOL = "dsh-github-copilot#GitHubCopilotAuthorizationView";
|
|
26
|
+
export declare const GitHubCopilotAuthorizationViewSchema: z.ZodObject<{
|
|
27
|
+
phase: z.ZodEnum<{
|
|
28
|
+
error: "error";
|
|
29
|
+
authorizing: "authorizing";
|
|
30
|
+
"signed-out": "signed-out";
|
|
31
|
+
"signed-in": "signed-in";
|
|
32
|
+
}>;
|
|
33
|
+
configured: z.ZodBoolean;
|
|
34
|
+
writable: z.ZodBoolean;
|
|
35
|
+
inFlight: z.ZodBoolean;
|
|
36
|
+
notices: z.ZodArray<z.ZodObject<{
|
|
37
|
+
message: z.ZodString;
|
|
38
|
+
url: z.ZodOptional<z.ZodString>;
|
|
39
|
+
code: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, z.core.$strict>>;
|
|
41
|
+
catalog: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
state: z.ZodEnum<{
|
|
43
|
+
current: "current";
|
|
44
|
+
"partially-outdated": "partially-outdated";
|
|
45
|
+
outdated: "outdated";
|
|
46
|
+
}>;
|
|
47
|
+
accountModelCount: z.ZodNumber;
|
|
48
|
+
supportedModelCount: z.ZodNumber;
|
|
49
|
+
unknownModelIds: z.ZodArray<z.ZodString>;
|
|
50
|
+
temporarilyUnavailableModelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
51
|
+
previewModelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
}, z.core.$strict>>;
|
|
53
|
+
accountModels: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
state: z.ZodEnum<{
|
|
55
|
+
ready: "ready";
|
|
56
|
+
unavailable: "unavailable";
|
|
57
|
+
error: "error";
|
|
58
|
+
idle: "idle";
|
|
59
|
+
loading: "loading";
|
|
60
|
+
stale: "stale";
|
|
61
|
+
disposed: "disposed";
|
|
62
|
+
unconfigured: "unconfigured";
|
|
63
|
+
}>;
|
|
64
|
+
models: z.ZodArray<z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
api: z.ZodString;
|
|
68
|
+
}, z.core.$strict>>;
|
|
69
|
+
rejected: z.ZodArray<z.ZodObject<{
|
|
70
|
+
id: z.ZodOptional<z.ZodString>;
|
|
71
|
+
code: z.ZodString;
|
|
72
|
+
}, z.core.$strict>>;
|
|
73
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
code: z.ZodString;
|
|
76
|
+
}, z.core.$strict>>>;
|
|
77
|
+
discoveredAt: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
error: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
modelPreferences: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
state: z.ZodEnum<{
|
|
82
|
+
ready: "ready";
|
|
83
|
+
error: "error";
|
|
84
|
+
}>;
|
|
85
|
+
writable: z.ZodBoolean;
|
|
86
|
+
revision: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
excludedModelIds: z.ZodArray<z.ZodString>;
|
|
88
|
+
lockedModelIds: z.ZodArray<z.ZodString>;
|
|
89
|
+
unavailableExcludedModelIds: z.ZodArray<z.ZodString>;
|
|
90
|
+
error: z.ZodOptional<z.ZodEnum<{
|
|
91
|
+
COPILOT_MODEL_PREFERENCES_UNAVAILABLE: "COPILOT_MODEL_PREFERENCES_UNAVAILABLE";
|
|
92
|
+
COPILOT_MODEL_EXCLUSION_SELECTED: "COPILOT_MODEL_EXCLUSION_SELECTED";
|
|
93
|
+
COPILOT_MODEL_EXCLUSION_CONFLICT: "COPILOT_MODEL_EXCLUSION_CONFLICT";
|
|
94
|
+
COPILOT_MODEL_EXCLUSION_SAVE_FAILED: "COPILOT_MODEL_EXCLUSION_SAVE_FAILED";
|
|
95
|
+
COPILOT_MODEL_SETTINGS_UNAVAILABLE: "COPILOT_MODEL_SETTINGS_UNAVAILABLE";
|
|
96
|
+
COPILOT_MODEL_SETTINGS_INVALID: "COPILOT_MODEL_SETTINGS_INVALID";
|
|
97
|
+
COPILOT_MODEL_SELECTION_UNAVAILABLE: "COPILOT_MODEL_SELECTION_UNAVAILABLE";
|
|
98
|
+
}>>;
|
|
99
|
+
}, z.core.$strict>>;
|
|
100
|
+
route: z.ZodOptional<z.ZodObject<{
|
|
101
|
+
state: z.ZodEnum<{
|
|
102
|
+
ready: "ready";
|
|
103
|
+
error: "error";
|
|
104
|
+
"needs-repair": "needs-repair";
|
|
105
|
+
"not-configured": "not-configured";
|
|
106
|
+
conflict: "conflict";
|
|
107
|
+
}>;
|
|
108
|
+
diagnosticCode: z.ZodOptional<z.ZodEnum<{
|
|
109
|
+
ROUTE_READ_FAILED: "ROUTE_READ_FAILED";
|
|
110
|
+
RECONCILIATION_FAILED: "RECONCILIATION_FAILED";
|
|
111
|
+
ROUTE_CONFLICT: "ROUTE_CONFLICT";
|
|
112
|
+
}>>;
|
|
113
|
+
}, z.core.$strict>>;
|
|
114
|
+
error: z.ZodOptional<z.ZodString>;
|
|
115
|
+
authorizationMilestone: z.ZodOptional<z.ZodEnum<{
|
|
116
|
+
AUTHORIZATION_REQUESTED: "AUTHORIZATION_REQUESTED";
|
|
117
|
+
INTERACTION_PROMPT_OBSERVED: "INTERACTION_PROMPT_OBSERVED";
|
|
118
|
+
INTERACTION_NOTICE_OBSERVED: "INTERACTION_NOTICE_OBSERVED";
|
|
119
|
+
}>>;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
export declare const GitHubCopilotModelPreferencesViewSchema: z.ZodObject<{
|
|
122
|
+
state: z.ZodEnum<{
|
|
123
|
+
ready: "ready";
|
|
124
|
+
error: "error";
|
|
125
|
+
}>;
|
|
126
|
+
writable: z.ZodBoolean;
|
|
127
|
+
revision: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
excludedModelIds: z.ZodArray<z.ZodString>;
|
|
129
|
+
lockedModelIds: z.ZodArray<z.ZodString>;
|
|
130
|
+
unavailableExcludedModelIds: z.ZodArray<z.ZodString>;
|
|
131
|
+
error: z.ZodOptional<z.ZodEnum<{
|
|
132
|
+
COPILOT_MODEL_PREFERENCES_UNAVAILABLE: "COPILOT_MODEL_PREFERENCES_UNAVAILABLE";
|
|
133
|
+
COPILOT_MODEL_EXCLUSION_SELECTED: "COPILOT_MODEL_EXCLUSION_SELECTED";
|
|
134
|
+
COPILOT_MODEL_EXCLUSION_CONFLICT: "COPILOT_MODEL_EXCLUSION_CONFLICT";
|
|
135
|
+
COPILOT_MODEL_EXCLUSION_SAVE_FAILED: "COPILOT_MODEL_EXCLUSION_SAVE_FAILED";
|
|
136
|
+
COPILOT_MODEL_SETTINGS_UNAVAILABLE: "COPILOT_MODEL_SETTINGS_UNAVAILABLE";
|
|
137
|
+
COPILOT_MODEL_SETTINGS_INVALID: "COPILOT_MODEL_SETTINGS_INVALID";
|
|
138
|
+
COPILOT_MODEL_SELECTION_UNAVAILABLE: "COPILOT_MODEL_SELECTION_UNAVAILABLE";
|
|
139
|
+
}>>;
|
|
140
|
+
}, z.core.$strict>;
|
|
141
|
+
export declare const GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL = "dsh-github-copilot#GitHubCopilotMigrationStatus";
|
|
142
|
+
/** Independent Ops result: strict at every object level; no account or private Session data. */
|
|
143
|
+
export declare const GitHubCopilotMigrationStatusSchema: z.ZodObject<{
|
|
144
|
+
plugin: z.ZodObject<{
|
|
145
|
+
name: z.ZodLiteral<"dsh-github-copilot">;
|
|
146
|
+
version: z.ZodString;
|
|
147
|
+
}, z.core.$strict>;
|
|
148
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
149
|
+
historyScope: z.ZodLiteral<"live-agents-only">;
|
|
150
|
+
observedAt: z.ZodNumber;
|
|
151
|
+
capabilities: z.ZodObject<{
|
|
152
|
+
agentsList: z.ZodBoolean;
|
|
153
|
+
sessionProjections: z.ZodBoolean;
|
|
154
|
+
settingsCas: z.ZodBoolean;
|
|
155
|
+
providerRegistry: z.ZodBoolean;
|
|
156
|
+
defaultSelection: z.ZodBoolean;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
complete: z.ZodObject<{
|
|
159
|
+
sessions: z.ZodBoolean;
|
|
160
|
+
defaultSelection: z.ZodBoolean;
|
|
161
|
+
routes: z.ZodBoolean;
|
|
162
|
+
}, z.core.$strict>;
|
|
163
|
+
defaultSelection: z.ZodNullable<z.ZodObject<{
|
|
164
|
+
provider: z.ZodString;
|
|
165
|
+
model: z.ZodString;
|
|
166
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
167
|
+
}, z.core.$strict>>;
|
|
168
|
+
sessions: z.ZodArray<z.ZodObject<{
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
status: z.ZodEnum<{
|
|
171
|
+
idle: "idle";
|
|
172
|
+
running: "running";
|
|
173
|
+
}>;
|
|
174
|
+
effectiveSelection: z.ZodNullable<z.ZodObject<{
|
|
175
|
+
provider: z.ZodString;
|
|
176
|
+
model: z.ZodString;
|
|
177
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
178
|
+
}, z.core.$strict>>;
|
|
179
|
+
selectionSource: z.ZodEnum<{
|
|
180
|
+
unknown: "unknown";
|
|
181
|
+
default: "default";
|
|
182
|
+
pending: "pending";
|
|
183
|
+
"request-header": "request-header";
|
|
184
|
+
}>;
|
|
185
|
+
activeRequestSelection: z.ZodNullable<z.ZodObject<{
|
|
186
|
+
provider: z.ZodString;
|
|
187
|
+
model: z.ZodString;
|
|
188
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
189
|
+
}, z.core.$strict>>;
|
|
190
|
+
}, z.core.$strict>>;
|
|
191
|
+
routes: z.ZodObject<{
|
|
192
|
+
nativeConfigured: z.ZodNullable<z.ZodBoolean>;
|
|
193
|
+
nativeRegistered: z.ZodNullable<z.ZodBoolean>;
|
|
194
|
+
managedRegistered: z.ZodNullable<z.ZodBoolean>;
|
|
195
|
+
}, z.core.$strict>;
|
|
196
|
+
}, z.core.$strict>;
|
|
197
|
+
declare const contribution: TypertRemoteContribution;
|
|
198
|
+
export default contribution;
|
|
199
|
+
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { GenerateOptions } from '@deepseek-ai/dsh-llm';
|
|
4
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
5
|
+
import { ReplayRecoveryStore } from './replay-recovery.ts';
|
|
6
|
+
import type { ReplayRecoveryDuration, ReplayRecoveryView } from './replay-recovery-types.ts';
|
|
7
|
+
declare module '@deepseek-ai/cordis' {
|
|
8
|
+
interface Context {
|
|
9
|
+
githubCopilotReplayRecovery: ReplayRecoveryController;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare class ReplayRecoveryController extends TypertRemoteService {
|
|
13
|
+
private readonly store;
|
|
14
|
+
private readonly proof;
|
|
15
|
+
private readonly busy;
|
|
16
|
+
constructor(ctx: Context, store: ReplayRecoveryStore, proof: () => string | undefined, busy: WeakSet<object>);
|
|
17
|
+
get(agent: Agent): ReplayRecoveryView;
|
|
18
|
+
setEnabled(agent: Agent, revision: string, enabled: boolean): ReplayRecoveryView;
|
|
19
|
+
authorize(agent: Agent, revision: string, duration: ReplayRecoveryDuration): ReplayRecoveryView;
|
|
20
|
+
}
|
|
21
|
+
export declare function installReplayRecovery(ctx: Context, proof: () => string | undefined): {
|
|
22
|
+
prepare(request: GenerateOptions): {
|
|
23
|
+
transform(payload: unknown): unknown;
|
|
24
|
+
rejected(body: string | undefined): void;
|
|
25
|
+
} | undefined;
|
|
26
|
+
dispose(): void;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=replay-recovery-host.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
2
|
+
import type { ReplayRecoveryDuration, ReplayRecoveryView } from './replay-recovery-types.ts';
|
|
3
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
4
|
+
interface TypertRemoteNamespaceMap {
|
|
5
|
+
githubCopilotReplayRecovery: {
|
|
6
|
+
get(agentId: string): Promise<RemoteResult<ReplayRecoveryView>>;
|
|
7
|
+
setEnabled(agentId: string, revision: string, enabled: boolean): Promise<RemoteResult<ReplayRecoveryView>>;
|
|
8
|
+
authorize(agentId: string, revision: string, duration: ReplayRecoveryDuration): Promise<RemoteResult<ReplayRecoveryView>>;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
declare const contribution: TypertRemoteContribution;
|
|
13
|
+
export default contribution;
|
|
14
|
+
//# sourceMappingURL=replay-recovery-remote.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ReplayRecoveryDurationSchema: z.ZodEnum<{
|
|
3
|
+
session: "session";
|
|
4
|
+
"next-turn": "next-turn";
|
|
5
|
+
}>;
|
|
6
|
+
export type ReplayRecoveryDuration = z.infer<typeof ReplayRecoveryDurationSchema>;
|
|
7
|
+
export declare const ReplayRecoveryViewSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
8
|
+
state: z.ZodLiteral<"unavailable">;
|
|
9
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
10
|
+
state: z.ZodEnum<{
|
|
11
|
+
enabled: "enabled";
|
|
12
|
+
available: "available";
|
|
13
|
+
}>;
|
|
14
|
+
revision: z.ZodString;
|
|
15
|
+
itemCount: z.ZodNumber;
|
|
16
|
+
model: z.ZodString;
|
|
17
|
+
duration: z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
session: "session";
|
|
19
|
+
"next-turn": "next-turn";
|
|
20
|
+
}>>;
|
|
21
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
}, z.core.$strict>], "state">;
|
|
23
|
+
export type ReplayRecoveryView = z.infer<typeof ReplayRecoveryViewSchema>;
|
|
24
|
+
//# sourceMappingURL=replay-recovery-types.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { ReplayRecoveryDuration } from './replay-recovery-types.ts';
|
|
4
|
+
export interface ReplayRecoveryRemote {
|
|
5
|
+
get(agentId: string): Promise<{
|
|
6
|
+
ok: boolean;
|
|
7
|
+
value?: unknown;
|
|
8
|
+
}>;
|
|
9
|
+
setEnabled(agentId: string, revision: string, enabled: boolean): Promise<{
|
|
10
|
+
ok: boolean;
|
|
11
|
+
value?: unknown;
|
|
12
|
+
}>;
|
|
13
|
+
authorize(agentId: string, revision: string, duration: ReplayRecoveryDuration): Promise<{
|
|
14
|
+
ok: boolean;
|
|
15
|
+
value?: unknown;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
export declare function ReplayRecoveryCard({ sessionId, remote, locale, running, refreshKey }: {
|
|
19
|
+
sessionId: string;
|
|
20
|
+
remote: ReplayRecoveryRemote;
|
|
21
|
+
locale?: string;
|
|
22
|
+
running?: boolean;
|
|
23
|
+
refreshKey?: string;
|
|
24
|
+
}): ReactElement | null;
|
|
25
|
+
export declare function registerReplayRecoveryUi(ctx: Context): () => void;
|
|
26
|
+
//# sourceMappingURL=replay-recovery-ui.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReplayRecoveryDuration, ReplayRecoveryView } from './replay-recovery-types.ts';
|
|
2
|
+
/** Host-lifetime opt-in only. Stores fingerprints, never request bodies or opaque replay. */
|
|
3
|
+
export declare class ReplayRecoveryStore {
|
|
4
|
+
private readonly now;
|
|
5
|
+
private readonly owners;
|
|
6
|
+
constructor(now?: () => number);
|
|
7
|
+
private current;
|
|
8
|
+
view(owner: object, proof: string | undefined): ReplayRecoveryView;
|
|
9
|
+
recordFailure(owner: object, proof: string, model: string, body: string | undefined): void;
|
|
10
|
+
setEnabled(owner: object, proof: string | undefined, revision: string, enabled: boolean): ReplayRecoveryView;
|
|
11
|
+
authorize(owner: object, proof: string | undefined, revision: string, duration: ReplayRecoveryDuration): ReplayRecoveryView;
|
|
12
|
+
endTurn(owner: object, turn: number): void;
|
|
13
|
+
prepare(owner: object, proof: string, model: string, turn?: number): (payload: unknown) => unknown;
|
|
14
|
+
remove(owner: object): void;
|
|
15
|
+
clear(): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=replay-recovery.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { RequestUploadEvidence } from './request-upload-evidence.ts';
|
|
2
|
+
export type RequestBodyProtocol = 'openai-responses' | 'openai-completions' | 'anthropic-messages';
|
|
3
|
+
export declare const REQUEST_BODY_EVIDENCE_LIMITS: Readonly<{
|
|
4
|
+
bytes: number;
|
|
5
|
+
values: 65536;
|
|
6
|
+
tokens: 131072;
|
|
7
|
+
depth: 64;
|
|
8
|
+
keyCharacters: 128;
|
|
9
|
+
}>;
|
|
10
|
+
export type RequestBodyEvidence = {
|
|
11
|
+
readonly state: 'complete';
|
|
12
|
+
readonly totalBytes: number;
|
|
13
|
+
readonly conversationBytes: number;
|
|
14
|
+
readonly toolSchemaBytes: number;
|
|
15
|
+
readonly systemBytes: number;
|
|
16
|
+
readonly otherBytes: number;
|
|
17
|
+
/** Disjoint subsets of conversationBytes, not additional payload bytes. */
|
|
18
|
+
readonly imageBlockBytes: number;
|
|
19
|
+
readonly opaqueReplayBytes: number;
|
|
20
|
+
readonly remainingConversationBytes: number;
|
|
21
|
+
} | {
|
|
22
|
+
readonly state: 'unavailable' | 'size-limit' | 'work-limit' | 'invalid-json' | 'unsupported-shape';
|
|
23
|
+
readonly totalBytes?: number;
|
|
24
|
+
};
|
|
25
|
+
export interface RequestBodyDispatchEvidence {
|
|
26
|
+
readonly protocol: RequestBodyProtocol;
|
|
27
|
+
/** Fetch invocation to response headers, not upload duration or clone-observation time. */
|
|
28
|
+
readonly responseHeadersMs: number;
|
|
29
|
+
readonly upload?: RequestUploadEvidence;
|
|
30
|
+
}
|
|
31
|
+
export declare function formatRequestBodyEvidence(evidence: RequestBodyEvidence, responseHeadersMs?: number): string;
|
|
32
|
+
/** Diagnostic-only traversal of the original JSON spans; never reserializes or changes a request. */
|
|
33
|
+
export declare function requestBodyEvidence(body: string | undefined, protocol: RequestBodyProtocol): RequestBodyEvidence;
|
|
34
|
+
//# sourceMappingURL=request-body-evidence.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RequestBodyDispatchEvidence } from './request-body-evidence.ts';
|
|
2
|
+
/** Verified provider evidence, not guessed capabilities, token limits or network cause. */
|
|
3
|
+
export declare function requestBodyTimeoutDiagnostic(response: Response, body?: string, signal?: AbortSignal, dispatch?: RequestBodyDispatchEvidence): Promise<string | undefined>;
|
|
4
|
+
//# sourceMappingURL=request-body-timeout.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { AccountModelDescriptor } from './account-model-catalog.ts';
|
|
2
|
+
/** Managed-route admission and compaction defaults; these never replace catalog capacities. */
|
|
3
|
+
export interface RequestBudgetPolicy {
|
|
4
|
+
/** Estimated framing/tokenization headroom deducted from admissible input, once. */
|
|
5
|
+
readonly safetyTokens: number;
|
|
6
|
+
/** Fraction of hard input headroom used only by callers eligible for proactive compaction. */
|
|
7
|
+
readonly pressureRatio: number;
|
|
8
|
+
/** Used only for compaction with no caller or adapter-resolved effort. */
|
|
9
|
+
readonly compactionReasoning: 'prefer-low' | 'preserve';
|
|
10
|
+
}
|
|
11
|
+
/** The safety allowance matches the pinned native SDK; pressure is a separate opt-in check. */
|
|
12
|
+
export declare const DEFAULT_REQUEST_BUDGET_POLICY: Readonly<RequestBudgetPolicy>;
|
|
13
|
+
/** Validate deployment policy before applying defaults; unknown keys fail rather than silently drift. */
|
|
14
|
+
export declare function resolveRequestBudgetPolicy(config?: Partial<RequestBudgetPolicy>): Readonly<RequestBudgetPolicy>;
|
|
15
|
+
export type RequestBudgetLimits = Pick<AccountModelDescriptor, 'contextWindow' | 'maxInputTokens' | 'maxTokens'>;
|
|
16
|
+
/** A detached operational budget alongside, not in place of, the supplier capacities. */
|
|
17
|
+
export interface RequestBudget {
|
|
18
|
+
readonly contextWindow: number;
|
|
19
|
+
readonly maxInputTokens?: number;
|
|
20
|
+
readonly maxOutputTokens: number;
|
|
21
|
+
/** Explicit request cap, or the model's output capability when the request omits one. */
|
|
22
|
+
readonly outputReservation: number;
|
|
23
|
+
readonly hardInputLimit: number;
|
|
24
|
+
readonly pressureInputLimit: number;
|
|
25
|
+
readonly limitingFactor: 'prompt' | 'context';
|
|
26
|
+
}
|
|
27
|
+
export type RequestBudgetFailureCode = 'COPILOT_REQUEST_INVALID_LIMITS' | 'COPILOT_REQUEST_INVALID_OUTPUT_LIMIT' | 'COPILOT_REQUEST_OUTPUT_LIMIT_EXCEEDED' | 'COPILOT_REQUEST_NO_INPUT_HEADROOM' | 'COPILOT_REQUEST_INVALID_ESTIMATE' | 'COPILOT_REQUEST_INPUT_LIMIT_EXCEEDED' | 'COPILOT_REQUEST_CONTEXT_LIMIT_EXCEEDED' | 'COPILOT_REQUEST_PRESSURE_EXCEEDED';
|
|
28
|
+
/** Owned diagnostics only; no credentials, request content, or provider error bodies. */
|
|
29
|
+
export interface RequestBudgetFailure {
|
|
30
|
+
readonly ok: false;
|
|
31
|
+
readonly code: RequestBudgetFailureCode;
|
|
32
|
+
readonly message: string;
|
|
33
|
+
}
|
|
34
|
+
export type RequestBudgetResult = Readonly<{
|
|
35
|
+
ok: true;
|
|
36
|
+
budget: Readonly<RequestBudget>;
|
|
37
|
+
}> | RequestBudgetFailure;
|
|
38
|
+
export type RequestBudgetAdmission = Readonly<{
|
|
39
|
+
ok: true;
|
|
40
|
+
}> | RequestBudgetFailure;
|
|
41
|
+
/**
|
|
42
|
+
* Reserve output under the combined context and independently enforce the prompt ceiling.
|
|
43
|
+
* `policy` must come from resolveRequestBudgetPolicy; no caller cap or catalog object is changed.
|
|
44
|
+
*/
|
|
45
|
+
export declare function calculateRequestBudget(limits: RequestBudgetLimits, requestedMaxTokens?: number, policy?: Readonly<RequestBudgetPolicy>): RequestBudgetResult;
|
|
46
|
+
/**
|
|
47
|
+
* Check an estimated full prompt; estimates are not provider-exact token counts.
|
|
48
|
+
* Enable pressure only for an owned ordinary loop call with a compaction recovery path.
|
|
49
|
+
* Auxiliary and agentless calls use hard admission, including compaction itself.
|
|
50
|
+
*/
|
|
51
|
+
export declare function assessRequestBudget(estimatedInput: number, budget: Readonly<RequestBudget>, pressure?: boolean): RequestBudgetAdmission;
|
|
52
|
+
/**
|
|
53
|
+
* Select a low-cost supported effort only for a caller-confirmed compaction request.
|
|
54
|
+
* A supplied effort, including a materialized provider default, wins unchanged; native validation
|
|
55
|
+
* remains authoritative. Unsupported low-cost controls preserve the provider default, never off/none.
|
|
56
|
+
*/
|
|
57
|
+
export declare function selectCompactionReasoning<Effort extends string>(supportedEfforts: readonly Effort[], requestedEffort?: Effort, mode?: RequestBudgetPolicy['compactionReasoning']): Effort | undefined;
|
|
58
|
+
//# sourceMappingURL=request-budget.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type RequestUploadEvidence = {
|
|
2
|
+
readonly state: 'observed';
|
|
3
|
+
readonly bodyWrite: 'observed' | 'not-observed';
|
|
4
|
+
readonly bodyWriteCompleteMs?: number;
|
|
5
|
+
readonly nativeResponseHeadersMs?: number;
|
|
6
|
+
readonly alpn: 'h2' | 'http/1.1' | 'unavailable';
|
|
7
|
+
readonly nodeWritableBufferBytes?: number;
|
|
8
|
+
} | {
|
|
9
|
+
readonly state: 'unavailable';
|
|
10
|
+
} | {
|
|
11
|
+
readonly state: 'work-limit';
|
|
12
|
+
} | {
|
|
13
|
+
readonly state: 'ambiguous';
|
|
14
|
+
readonly requestCount: number;
|
|
15
|
+
};
|
|
16
|
+
/** Observe public native events only; never read request fields, mutate transport or imply remote receipt. */
|
|
17
|
+
export declare function createRequestUploadObserver(): {
|
|
18
|
+
run<T>(operation: () => T): T;
|
|
19
|
+
snapshot(): RequestUploadEvidence;
|
|
20
|
+
close(): void;
|
|
21
|
+
};
|
|
22
|
+
export declare function formatRequestUploadEvidence(evidence: RequestUploadEvidence | undefined): string;
|
|
23
|
+
//# sourceMappingURL=request-upload-evidence.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Public Responses reasoning text only; encrypted replay payloads are never read. */
|
|
2
|
+
type Family = 'summary' | 'raw';
|
|
3
|
+
export declare function responseIndex(value: unknown): number | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Append-only public text for one output item. Snapshots complete streamed
|
|
6
|
+
* prefixes rather than repeating them. If both public representations occur,
|
|
7
|
+
* stream the first and retain the other until item end so an identical mirror
|
|
8
|
+
* can be omitted without dropping a distinct public summary.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ResponsesReasoningText {
|
|
11
|
+
private family;
|
|
12
|
+
private readonly parts;
|
|
13
|
+
private emitted;
|
|
14
|
+
private finished;
|
|
15
|
+
get text(): string;
|
|
16
|
+
private render;
|
|
17
|
+
update(family: Family, index: unknown, value: unknown, done: boolean): string;
|
|
18
|
+
/** Only recognized public text fields are examined; no copying of the item. */
|
|
19
|
+
snapshot(item: unknown): string;
|
|
20
|
+
/** Flush a distinct secondary representation, including on failure/abort. */
|
|
21
|
+
finish(): string;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=responses-reasoning-text.d.ts.map
|