dsh-github-copilot 0.1.0-alpha.1.dsh.0.2.1.alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +439 -0
- package/CHANGELOG.md +875 -0
- package/CONTRIBUTING.md +55 -0
- package/LICENSE +21 -0
- package/README.md +366 -0
- package/README.zh.md +341 -0
- package/SECURITY.md +29 -0
- package/cordis.patch.yml +16 -0
- package/deployment-baseline.json +1580 -0
- package/docs/account-management-experience.md +143 -0
- package/docs/agent-readiness.md +110 -0
- package/docs/auto-high-cost.md +255 -0
- package/docs/auto-iteration-review.json +22 -0
- package/docs/auto-review-sampling.md +60 -0
- package/docs/auto-task-routing.md +341 -0
- package/docs/automatic-model-routing.md +236 -0
- package/docs/copilot-accounts.md +424 -0
- package/docs/copilot-compaction.md +148 -0
- package/docs/copilot-usage.md +133 -0
- package/docs/dual-model.md +66 -0
- package/docs/evidence-driven-iteration.md +86 -0
- package/docs/image-input-compatibility.md +64 -0
- package/docs/images/copilot-accounts-credits.png +0 -0
- package/docs/images/copilot-accounts.png +0 -0
- package/docs/images/copilot-current-provenance.json +39 -0
- package/docs/images/copilot-model-preferences.png +0 -0
- package/docs/images/copilot-search-routing.png +0 -0
- package/docs/images/copilot-session-continuation.png +0 -0
- package/docs/images/dual-model-desktop.png +0 -0
- package/docs/images/dual-model-mobile.png +0 -0
- package/docs/images/dual-model-provenance.json +35 -0
- package/docs/images/parent-model-follow.png +0 -0
- package/docs/manual-compaction-recovery.md +109 -0
- package/docs/mockups/copilot-account-dropdown.html +71 -0
- package/docs/mockups/copilot-account-management.html +393 -0
- package/docs/model-compatibility-acceptance.md +182 -0
- package/docs/npm-distribution.md +202 -0
- package/docs/official-first-016-alpha2.md +66 -0
- package/docs/official-first-020-rc1.md +32 -0
- package/docs/official-first-020-rc2.md +17 -0
- package/docs/official-first-021-alpha4.md +157 -0
- package/docs/official-first-021-alpha5.md +83 -0
- package/docs/plugin-diagnostics.md +605 -0
- package/docs/session-continuation.md +141 -0
- package/docs/session-search-routing.md +133 -0
- package/docs/single-route-migration.md +131 -0
- package/docs/web-lifecycle-rc2.md +55 -0
- package/lib/client.js +13236 -0
- package/lib/client.js.map +1 -0
- package/lib/copilot-identity-DRZY_d2X.js +15 -0
- package/lib/diagnostics-analysis-io.js +78 -0
- package/lib/diagnostics-analysis.js +427 -0
- package/lib/diagnostics-types-CF-qg8Do.js +708 -0
- package/lib/index.js +15661 -0
- package/lib/manual-compaction-recovery.js +485 -0
- package/lib/remote.js +1507 -0
- package/lib/request-budget-DLY_aRq0.js +87 -0
- package/lib/routed-web.js +120 -0
- package/lib/search-routing-CV2hs8as.js +792 -0
- package/lib/types/account-dropdown.d.ts +22 -0
- package/lib/types/account-model-auth.d.ts +15 -0
- package/lib/types/account-model-catalog.d.ts +70 -0
- package/lib/types/account-model-source.d.ts +85 -0
- package/lib/types/agent-compaction.d.ts +4 -0
- package/lib/types/authorization-code-clipboard.d.ts +4 -0
- package/lib/types/authorization-controller.d.ts +121 -0
- package/lib/types/auto-allocation-card.d.ts +9 -0
- package/lib/types/auto-allocation-diagnostics.d.ts +126 -0
- package/lib/types/auto-allocation-evidence.d.ts +44 -0
- package/lib/types/auto-allocation.d.ts +47 -0
- package/lib/types/auto-assessment-evidence.d.ts +111 -0
- package/lib/types/auto-model-host.d.ts +30 -0
- package/lib/types/auto-model-intent.d.ts +36 -0
- package/lib/types/auto-model-presentation.d.ts +57 -0
- package/lib/types/auto-model-routing.d.ts +64 -0
- package/lib/types/auto-review-sampling.d.ts +6 -0
- package/lib/types/auto-selection-explanation.d.ts +9 -0
- package/lib/types/auto-task-assessment.d.ts +49 -0
- package/lib/types/auto-task-classifier.d.ts +10 -0
- package/lib/types/background-compaction.d.ts +30 -0
- package/lib/types/client.d.ts +129 -0
- package/lib/types/compact-account.d.ts +42 -0
- package/lib/types/compaction-continuation-ui.d.ts +29 -0
- package/lib/types/compaction-continuation.d.ts +48 -0
- package/lib/types/compaction-input-estimate.d.ts +28 -0
- package/lib/types/compaction-pressure.d.ts +23 -0
- package/lib/types/compaction-replay.d.ts +18 -0
- package/lib/types/compatibility.d.ts +17 -0
- package/lib/types/composer-notice-style.d.ts +7 -0
- package/lib/types/config.d.ts +141 -0
- package/lib/types/content-file.d.ts +10 -0
- package/lib/types/context-evidence-ui.d.ts +28 -0
- package/lib/types/context-evidence.d.ts +256 -0
- package/lib/types/context-usage.d.ts +4 -0
- package/lib/types/copilot-account-presentation.d.ts +7 -0
- package/lib/types/copilot-accounts-card.d.ts +43 -0
- package/lib/types/copilot-accounts-host.d.ts +93 -0
- package/lib/types/copilot-accounts-remote.d.ts +85 -0
- package/lib/types/copilot-accounts-types.d.ts +43 -0
- package/lib/types/copilot-auth.d.ts +31 -0
- package/lib/types/copilot-grant.d.ts +11 -0
- package/lib/types/copilot-identity.d.ts +11 -0
- package/lib/types/copilot-request.d.ts +11 -0
- package/lib/types/copilot-stream-liveness.d.ts +23 -0
- package/lib/types/copilot-usage-card.d.ts +51 -0
- package/lib/types/copilot-usage-host.d.ts +61 -0
- package/lib/types/copilot-usage-normalize.d.ts +9 -0
- package/lib/types/copilot-usage-remote.d.ts +63 -0
- package/lib/types/copilot-usage-types.d.ts +20 -0
- package/lib/types/copilot-usage-ui.d.ts +4 -0
- package/lib/types/current-provider.d.ts +59 -0
- package/lib/types/deepseek-search-fallback.d.ts +11 -0
- package/lib/types/diagnostics-analysis-io.d.ts +23 -0
- package/lib/types/diagnostics-analysis.d.ts +298 -0
- package/lib/types/diagnostics-card.d.ts +12 -0
- package/lib/types/diagnostics-client.d.ts +13 -0
- package/lib/types/diagnostics-collector.d.ts +50 -0
- package/lib/types/diagnostics-host.d.ts +183 -0
- package/lib/types/diagnostics-remote.d.ts +113 -0
- package/lib/types/diagnostics-types.d.ts +893 -0
- package/lib/types/dual-model-host.d.ts +119 -0
- package/lib/types/dual-model-remote.d.ts +63 -0
- package/lib/types/dual-model-types.d.ts +34 -0
- package/lib/types/external-link.d.ts +3 -0
- package/lib/types/failure.d.ts +38 -0
- package/lib/types/http.d.ts +48 -0
- package/lib/types/image-input-admission.d.ts +5 -0
- package/lib/types/index.d.ts +39 -0
- package/lib/types/manual-compaction-recovery.d.ts +67 -0
- package/lib/types/migration-status.d.ts +50 -0
- package/lib/types/model-exclusions.d.ts +15 -0
- package/lib/types/model-preferences-card.d.ts +9 -0
- package/lib/types/model-protocol.d.ts +31 -0
- package/lib/types/native-select-style.d.ts +4 -0
- package/lib/types/native-settings-style.d.ts +10 -0
- package/lib/types/parent-model-follow-card.d.ts +32 -0
- package/lib/types/parent-model-follow.d.ts +44 -0
- package/lib/types/pi-provider-bridge.d.ts +22 -0
- package/lib/types/plan.d.ts +148 -0
- package/lib/types/pre-step-pressure.d.ts +8 -0
- package/lib/types/preview-provider.d.ts +77 -0
- package/lib/types/preview-route.d.ts +76 -0
- package/lib/types/probe.d.ts +39 -0
- package/lib/types/remote-codec.d.ts +10 -0
- package/lib/types/remote.d.ts +202 -0
- package/lib/types/replay-recovery-host.d.ts +28 -0
- package/lib/types/replay-recovery-remote.d.ts +14 -0
- package/lib/types/replay-recovery-types.d.ts +24 -0
- package/lib/types/replay-recovery-ui.d.ts +28 -0
- package/lib/types/replay-recovery.d.ts +17 -0
- package/lib/types/request-body-composition.d.ts +17 -0
- package/lib/types/request-body-evidence.d.ts +37 -0
- package/lib/types/request-body-timeout-marker.d.ts +2 -0
- package/lib/types/request-body-timeout.d.ts +4 -0
- package/lib/types/request-budget.d.ts +58 -0
- package/lib/types/request-diagnostics.d.ts +278 -0
- package/lib/types/request-upload-evidence.d.ts +23 -0
- package/lib/types/response-error-body.d.ts +3 -0
- package/lib/types/responses-reasoning-text.d.ts +24 -0
- package/lib/types/responses-reasoning.d.ts +7 -0
- package/lib/types/responses-replay-compat.d.ts +31 -0
- package/lib/types/responses-request-compression.d.ts +33 -0
- package/lib/types/route-ownership.d.ts +70 -0
- package/lib/types/routed-web.d.ts +50 -0
- package/lib/types/search-backend.d.ts +16 -0
- package/lib/types/search-routing-host.d.ts +19 -0
- package/lib/types/search-routing-policy.d.ts +18 -0
- package/lib/types/search-routing-remote.d.ts +20 -0
- package/lib/types/search-routing.d.ts +43 -0
- package/lib/types/search-tool-routing.d.ts +22 -0
- package/lib/types/serialize.d.ts +106 -0
- package/lib/types/session-accounts-controller.d.ts +20 -0
- package/lib/types/session-accounts-host.d.ts +33 -0
- package/lib/types/session-accounts-remote.d.ts +114 -0
- package/lib/types/session-accounts.d.ts +38 -0
- package/lib/types/session-continuation-host.d.ts +45 -0
- package/lib/types/session-continuation-remote.d.ts +22 -0
- package/lib/types/session-continuation-types.d.ts +62 -0
- package/lib/types/session-continuation-ui.d.ts +49 -0
- package/lib/types/session-continuation.d.ts +14 -0
- package/lib/types/settings-reader.d.ts +16 -0
- package/lib/types/sse.d.ts +28 -0
- package/lib/types/temporary-models.d.ts +25 -0
- package/lib/types/tool-schema-compat.d.ts +17 -0
- package/lib/types/traditional-search.d.ts +17 -0
- package/lib/types/turn-model-provenance.d.ts +45 -0
- package/lib/types/turn-request-models.d.ts +55 -0
- package/lib/types/turn-selection-card.d.ts +24 -0
- package/lib/types/turn-selection-host.d.ts +35 -0
- package/lib/types/turn-selection-remote.d.ts +17 -0
- package/lib/types/turn-selection.d.ts +186 -0
- package/lib/types/turn-usage-evidence.d.ts +66 -0
- package/lib/types/turn-usage-notice.d.ts +7 -0
- package/lib/types/types.d.ts +69 -0
- package/lib/types/usage.d.ts +26 -0
- package/lib/types/watchdog.d.ts +22 -0
- package/lib/types/web-delegate.d.ts +12 -0
- package/lib/types/web-search-routing-card.d.ts +16 -0
- package/lib/types/web-search-routing-config.d.ts +12 -0
- package/lib/types/wire-anthropic.d.ts +37 -0
- package/lib/types/wire.d.ts +56 -0
- package/lib/web-delegate.js +9 -0
- package/output/auto-model-mockup/index.html +207 -0
- package/package.json +261 -0
- package/scripts/analyze-diagnostics.mjs +91 -0
- package/scripts/check-search-composition.mjs +191 -0
- package/scripts/iteration-review.mjs +53 -0
- package/scripts/release-policy.mjs +353 -0
- package/scripts/select-core-release.mjs +11 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { ReplayRecoveryDuration } from './replay-recovery-types.ts';
|
|
4
|
+
import type { SessionContinuationRemote } from './session-continuation-ui.ts';
|
|
5
|
+
export interface ReplayRecoveryRemote {
|
|
6
|
+
get(agentId: string): Promise<{
|
|
7
|
+
ok: boolean;
|
|
8
|
+
value?: unknown;
|
|
9
|
+
}>;
|
|
10
|
+
setEnabled(agentId: string, revision: string, enabled: boolean): Promise<{
|
|
11
|
+
ok: boolean;
|
|
12
|
+
value?: unknown;
|
|
13
|
+
}>;
|
|
14
|
+
authorize(agentId: string, revision: string, duration: ReplayRecoveryDuration): Promise<{
|
|
15
|
+
ok: boolean;
|
|
16
|
+
value?: unknown;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
export declare function ReplayRecoveryCard({ sessionId, remote, continuation, locale, running, refreshKey }: {
|
|
20
|
+
sessionId: string;
|
|
21
|
+
remote: ReplayRecoveryRemote;
|
|
22
|
+
locale?: string;
|
|
23
|
+
running?: boolean;
|
|
24
|
+
refreshKey?: string;
|
|
25
|
+
continuation?: SessionContinuationRemote;
|
|
26
|
+
}): ReactElement | null;
|
|
27
|
+
export declare function registerReplayRecoveryUi(ctx: Context): () => void;
|
|
28
|
+
//# 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,17 @@
|
|
|
1
|
+
import type { RequestBodyEvidence, RequestBodyProtocol } from './request-body-evidence.ts';
|
|
2
|
+
export declare const REQUEST_BODY_COMPOSITION_LIMITS: Readonly<{
|
|
3
|
+
bytes: number;
|
|
4
|
+
sliceCharacters: 65536;
|
|
5
|
+
elapsedMs: 2000;
|
|
6
|
+
concurrent: 4;
|
|
7
|
+
values: 65536;
|
|
8
|
+
tokens: 131072;
|
|
9
|
+
depth: 64;
|
|
10
|
+
keyCharacters: 128;
|
|
11
|
+
}>;
|
|
12
|
+
/** Only bounded keys/discriminators are decoded; payload values never form an object graph. */
|
|
13
|
+
export declare function requestBodyComposition(payload: string | undefined, protocol: RequestBodyProtocol, options?: {
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
isCurrent?: () => boolean;
|
|
16
|
+
}): Promise<RequestBodyEvidence>;
|
|
17
|
+
//# sourceMappingURL=request-body-composition.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { RequestUploadEvidence } from './request-upload-evidence.ts';
|
|
2
|
+
import type { RequestCompressionEvidence } from './responses-request-compression.ts';
|
|
3
|
+
export type RequestBodyProtocol = 'openai-responses' | 'openai-completions' | 'anthropic-messages';
|
|
4
|
+
export declare const REQUEST_BODY_EVIDENCE_LIMITS: Readonly<{
|
|
5
|
+
bytes: number;
|
|
6
|
+
values: 65536;
|
|
7
|
+
tokens: 131072;
|
|
8
|
+
depth: 64;
|
|
9
|
+
keyCharacters: 128;
|
|
10
|
+
}>;
|
|
11
|
+
export type RequestBodyEvidence = {
|
|
12
|
+
readonly state: 'complete';
|
|
13
|
+
readonly totalBytes: number;
|
|
14
|
+
readonly conversationBytes: number;
|
|
15
|
+
readonly toolSchemaBytes: number;
|
|
16
|
+
readonly systemBytes: number;
|
|
17
|
+
readonly otherBytes: number;
|
|
18
|
+
/** Disjoint subsets of conversationBytes, not additional payload bytes. */
|
|
19
|
+
readonly imageBlockBytes: number;
|
|
20
|
+
readonly opaqueReplayBytes: number;
|
|
21
|
+
readonly remainingConversationBytes: number;
|
|
22
|
+
} | {
|
|
23
|
+
readonly state: 'unavailable' | 'size-limit' | 'work-limit' | 'invalid-json' | 'unsupported-shape' | 'cancelled' | 'time-limit';
|
|
24
|
+
readonly totalBytes?: number;
|
|
25
|
+
};
|
|
26
|
+
export interface RequestBodyDispatchEvidence {
|
|
27
|
+
readonly protocol: RequestBodyProtocol;
|
|
28
|
+
readonly composition?: Promise<RequestBodyEvidence>;
|
|
29
|
+
/** Fetch invocation to response headers, not upload duration or clone-observation time. */
|
|
30
|
+
readonly responseHeadersMs: number;
|
|
31
|
+
readonly upload?: RequestUploadEvidence;
|
|
32
|
+
readonly compression?: RequestCompressionEvidence;
|
|
33
|
+
}
|
|
34
|
+
export declare function formatRequestBodyEvidence(evidence: RequestBodyEvidence, responseHeadersMs?: number, compression?: RequestCompressionEvidence): string;
|
|
35
|
+
/** Diagnostic-only traversal of the original JSON spans; never reserializes or changes a request. */
|
|
36
|
+
export declare function requestBodyEvidence(body: string | undefined, protocol: RequestBodyProtocol): RequestBodyEvidence;
|
|
37
|
+
//# 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,278 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { RequestBodyEvidence } from './request-body-evidence.ts';
|
|
3
|
+
import type { RequestUploadEvidence } from './request-upload-evidence.ts';
|
|
4
|
+
export declare const REQUEST_DIAGNOSTICS_MAX_ROWS = 128;
|
|
5
|
+
export declare const REQUEST_DIAGNOSTICS_RETENTION_MS: number;
|
|
6
|
+
export declare const CredentialChangeReasonSchema: z.ZodEnum<{
|
|
7
|
+
expired: "expired";
|
|
8
|
+
qualified: "qualified";
|
|
9
|
+
"unknown-source": "unknown-source";
|
|
10
|
+
"account-changed": "account-changed";
|
|
11
|
+
"endpoint-changed": "endpoint-changed";
|
|
12
|
+
"entitlements-changed": "entitlements-changed";
|
|
13
|
+
"auth-mismatch": "auth-mismatch";
|
|
14
|
+
"duplicate-notification": "duplicate-notification";
|
|
15
|
+
"missing-notification": "missing-notification";
|
|
16
|
+
"commit-mismatch": "commit-mismatch";
|
|
17
|
+
"write-failed": "write-failed";
|
|
18
|
+
"write-conflict": "write-conflict";
|
|
19
|
+
}>;
|
|
20
|
+
export declare const CredentialChangeSchema: z.ZodObject<{
|
|
21
|
+
changeId: z.ZodString;
|
|
22
|
+
observedAt: z.ZodNumber;
|
|
23
|
+
version: z.ZodString;
|
|
24
|
+
phase: z.ZodEnum<{
|
|
25
|
+
notification: "notification";
|
|
26
|
+
commit: "commit";
|
|
27
|
+
}>;
|
|
28
|
+
reason: z.ZodEnum<{
|
|
29
|
+
expired: "expired";
|
|
30
|
+
qualified: "qualified";
|
|
31
|
+
"unknown-source": "unknown-source";
|
|
32
|
+
"account-changed": "account-changed";
|
|
33
|
+
"endpoint-changed": "endpoint-changed";
|
|
34
|
+
"entitlements-changed": "entitlements-changed";
|
|
35
|
+
"auth-mismatch": "auth-mismatch";
|
|
36
|
+
"duplicate-notification": "duplicate-notification";
|
|
37
|
+
"missing-notification": "missing-notification";
|
|
38
|
+
"commit-mismatch": "commit-mismatch";
|
|
39
|
+
"write-failed": "write-failed";
|
|
40
|
+
"write-conflict": "write-conflict";
|
|
41
|
+
}>;
|
|
42
|
+
preparing: z.ZodNumber;
|
|
43
|
+
dispatched: z.ZodNumber;
|
|
44
|
+
alreadyAborted: z.ZodNumber;
|
|
45
|
+
preserved: z.ZodNumber;
|
|
46
|
+
revoked: z.ZodNumber;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
export type CredentialChangeReason = z.infer<typeof CredentialChangeReasonSchema>;
|
|
49
|
+
export type CredentialChangeEvidence = Omit<z.infer<typeof CredentialChangeSchema>, 'changeId' | 'observedAt' | 'version'>;
|
|
50
|
+
export interface CredentialChangeHandle {
|
|
51
|
+
record(evidence: CredentialChangeEvidence): void;
|
|
52
|
+
cancel(): void;
|
|
53
|
+
}
|
|
54
|
+
export declare const RequestDiagnosticSchema: z.ZodObject<{
|
|
55
|
+
streamId: z.ZodString;
|
|
56
|
+
dispatchIndex: z.ZodNumber;
|
|
57
|
+
version: z.ZodString;
|
|
58
|
+
startedAt: z.ZodNumber;
|
|
59
|
+
elapsedMs: z.ZodNumber;
|
|
60
|
+
model: z.ZodString;
|
|
61
|
+
protocol: z.ZodEnum<{
|
|
62
|
+
"openai-completions": "openai-completions";
|
|
63
|
+
"openai-responses": "openai-responses";
|
|
64
|
+
"anthropic-messages": "anthropic-messages";
|
|
65
|
+
}>;
|
|
66
|
+
composition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
67
|
+
state: z.ZodLiteral<"complete">;
|
|
68
|
+
totalBytes: z.ZodNumber;
|
|
69
|
+
conversationBytes: z.ZodNumber;
|
|
70
|
+
toolSchemaBytes: z.ZodNumber;
|
|
71
|
+
systemBytes: z.ZodNumber;
|
|
72
|
+
otherBytes: z.ZodNumber;
|
|
73
|
+
imageBlockBytes: z.ZodNumber;
|
|
74
|
+
opaqueReplayBytes: z.ZodNumber;
|
|
75
|
+
remainingConversationBytes: z.ZodNumber;
|
|
76
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
77
|
+
state: z.ZodEnum<{
|
|
78
|
+
unavailable: "unavailable";
|
|
79
|
+
"work-limit": "work-limit";
|
|
80
|
+
"size-limit": "size-limit";
|
|
81
|
+
"invalid-json": "invalid-json";
|
|
82
|
+
"unsupported-shape": "unsupported-shape";
|
|
83
|
+
cancelled: "cancelled";
|
|
84
|
+
"time-limit": "time-limit";
|
|
85
|
+
}>;
|
|
86
|
+
totalBytes: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
}, z.core.$strict>], "state">;
|
|
88
|
+
encoding: z.ZodEnum<{
|
|
89
|
+
unknown: "unknown";
|
|
90
|
+
identity: "identity";
|
|
91
|
+
gzip: "gzip";
|
|
92
|
+
}>;
|
|
93
|
+
wireBytes: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
upload: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
95
|
+
state: z.ZodLiteral<"observed">;
|
|
96
|
+
bodyWrite: z.ZodEnum<{
|
|
97
|
+
observed: "observed";
|
|
98
|
+
"not-observed": "not-observed";
|
|
99
|
+
}>;
|
|
100
|
+
bodyWriteCompleteMs: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
nativeResponseHeadersMs: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
alpn: z.ZodEnum<{
|
|
103
|
+
h2: "h2";
|
|
104
|
+
unavailable: "unavailable";
|
|
105
|
+
"http/1.1": "http/1.1";
|
|
106
|
+
}>;
|
|
107
|
+
nodeWritableBufferBytes: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
109
|
+
state: z.ZodEnum<{
|
|
110
|
+
unavailable: "unavailable";
|
|
111
|
+
"work-limit": "work-limit";
|
|
112
|
+
}>;
|
|
113
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
114
|
+
state: z.ZodLiteral<"ambiguous">;
|
|
115
|
+
requestCount: z.ZodNumber;
|
|
116
|
+
}, z.core.$strict>], "state">>;
|
|
117
|
+
responseHeadersMs: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
outcome: z.ZodEnum<{
|
|
120
|
+
cancelled: "cancelled";
|
|
121
|
+
"http-error": "http-error";
|
|
122
|
+
"transport-error": "transport-error";
|
|
123
|
+
"stream-done": "stream-done";
|
|
124
|
+
"stream-error": "stream-error";
|
|
125
|
+
interrupted: "interrupted";
|
|
126
|
+
}>;
|
|
127
|
+
reason: z.ZodEnum<{
|
|
128
|
+
none: "none";
|
|
129
|
+
unknown: "unknown";
|
|
130
|
+
"request-body-timeout": "request-body-timeout";
|
|
131
|
+
"caller-abort": "caller-abort";
|
|
132
|
+
"credential-changed": "credential-changed";
|
|
133
|
+
disposed: "disposed";
|
|
134
|
+
"byte-idle-timeout": "byte-idle-timeout";
|
|
135
|
+
"signal-abort": "signal-abort";
|
|
136
|
+
}>;
|
|
137
|
+
}, z.core.$strict>;
|
|
138
|
+
export declare const RequestDiagnosticsSchema: z.ZodObject<{
|
|
139
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
140
|
+
streamId: z.ZodString;
|
|
141
|
+
dispatchIndex: z.ZodNumber;
|
|
142
|
+
version: z.ZodString;
|
|
143
|
+
startedAt: z.ZodNumber;
|
|
144
|
+
elapsedMs: z.ZodNumber;
|
|
145
|
+
model: z.ZodString;
|
|
146
|
+
protocol: z.ZodEnum<{
|
|
147
|
+
"openai-completions": "openai-completions";
|
|
148
|
+
"openai-responses": "openai-responses";
|
|
149
|
+
"anthropic-messages": "anthropic-messages";
|
|
150
|
+
}>;
|
|
151
|
+
composition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
152
|
+
state: z.ZodLiteral<"complete">;
|
|
153
|
+
totalBytes: z.ZodNumber;
|
|
154
|
+
conversationBytes: z.ZodNumber;
|
|
155
|
+
toolSchemaBytes: z.ZodNumber;
|
|
156
|
+
systemBytes: z.ZodNumber;
|
|
157
|
+
otherBytes: z.ZodNumber;
|
|
158
|
+
imageBlockBytes: z.ZodNumber;
|
|
159
|
+
opaqueReplayBytes: z.ZodNumber;
|
|
160
|
+
remainingConversationBytes: z.ZodNumber;
|
|
161
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
162
|
+
state: z.ZodEnum<{
|
|
163
|
+
unavailable: "unavailable";
|
|
164
|
+
"work-limit": "work-limit";
|
|
165
|
+
"size-limit": "size-limit";
|
|
166
|
+
"invalid-json": "invalid-json";
|
|
167
|
+
"unsupported-shape": "unsupported-shape";
|
|
168
|
+
cancelled: "cancelled";
|
|
169
|
+
"time-limit": "time-limit";
|
|
170
|
+
}>;
|
|
171
|
+
totalBytes: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
}, z.core.$strict>], "state">;
|
|
173
|
+
encoding: z.ZodEnum<{
|
|
174
|
+
unknown: "unknown";
|
|
175
|
+
identity: "identity";
|
|
176
|
+
gzip: "gzip";
|
|
177
|
+
}>;
|
|
178
|
+
wireBytes: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
upload: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
180
|
+
state: z.ZodLiteral<"observed">;
|
|
181
|
+
bodyWrite: z.ZodEnum<{
|
|
182
|
+
observed: "observed";
|
|
183
|
+
"not-observed": "not-observed";
|
|
184
|
+
}>;
|
|
185
|
+
bodyWriteCompleteMs: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
nativeResponseHeadersMs: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
alpn: z.ZodEnum<{
|
|
188
|
+
h2: "h2";
|
|
189
|
+
unavailable: "unavailable";
|
|
190
|
+
"http/1.1": "http/1.1";
|
|
191
|
+
}>;
|
|
192
|
+
nodeWritableBufferBytes: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
194
|
+
state: z.ZodEnum<{
|
|
195
|
+
unavailable: "unavailable";
|
|
196
|
+
"work-limit": "work-limit";
|
|
197
|
+
}>;
|
|
198
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
199
|
+
state: z.ZodLiteral<"ambiguous">;
|
|
200
|
+
requestCount: z.ZodNumber;
|
|
201
|
+
}, z.core.$strict>], "state">>;
|
|
202
|
+
responseHeadersMs: z.ZodOptional<z.ZodNumber>;
|
|
203
|
+
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
204
|
+
outcome: z.ZodEnum<{
|
|
205
|
+
cancelled: "cancelled";
|
|
206
|
+
"http-error": "http-error";
|
|
207
|
+
"transport-error": "transport-error";
|
|
208
|
+
"stream-done": "stream-done";
|
|
209
|
+
"stream-error": "stream-error";
|
|
210
|
+
interrupted: "interrupted";
|
|
211
|
+
}>;
|
|
212
|
+
reason: z.ZodEnum<{
|
|
213
|
+
none: "none";
|
|
214
|
+
unknown: "unknown";
|
|
215
|
+
"request-body-timeout": "request-body-timeout";
|
|
216
|
+
"caller-abort": "caller-abort";
|
|
217
|
+
"credential-changed": "credential-changed";
|
|
218
|
+
disposed: "disposed";
|
|
219
|
+
"byte-idle-timeout": "byte-idle-timeout";
|
|
220
|
+
"signal-abort": "signal-abort";
|
|
221
|
+
}>;
|
|
222
|
+
}, z.core.$strict>>;
|
|
223
|
+
dropped: z.ZodNumber;
|
|
224
|
+
evicted: z.ZodNumber;
|
|
225
|
+
pending: z.ZodOptional<z.ZodNumber>;
|
|
226
|
+
interruptedOnReopen: z.ZodOptional<z.ZodNumber>;
|
|
227
|
+
credentialChanges: z.ZodOptional<z.ZodObject<{
|
|
228
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
229
|
+
changeId: z.ZodString;
|
|
230
|
+
observedAt: z.ZodNumber;
|
|
231
|
+
version: z.ZodString;
|
|
232
|
+
phase: z.ZodEnum<{
|
|
233
|
+
notification: "notification";
|
|
234
|
+
commit: "commit";
|
|
235
|
+
}>;
|
|
236
|
+
reason: z.ZodEnum<{
|
|
237
|
+
expired: "expired";
|
|
238
|
+
qualified: "qualified";
|
|
239
|
+
"unknown-source": "unknown-source";
|
|
240
|
+
"account-changed": "account-changed";
|
|
241
|
+
"endpoint-changed": "endpoint-changed";
|
|
242
|
+
"entitlements-changed": "entitlements-changed";
|
|
243
|
+
"auth-mismatch": "auth-mismatch";
|
|
244
|
+
"duplicate-notification": "duplicate-notification";
|
|
245
|
+
"missing-notification": "missing-notification";
|
|
246
|
+
"commit-mismatch": "commit-mismatch";
|
|
247
|
+
"write-failed": "write-failed";
|
|
248
|
+
"write-conflict": "write-conflict";
|
|
249
|
+
}>;
|
|
250
|
+
preparing: z.ZodNumber;
|
|
251
|
+
dispatched: z.ZodNumber;
|
|
252
|
+
alreadyAborted: z.ZodNumber;
|
|
253
|
+
preserved: z.ZodNumber;
|
|
254
|
+
revoked: z.ZodNumber;
|
|
255
|
+
}, z.core.$strict>>;
|
|
256
|
+
dropped: z.ZodNumber;
|
|
257
|
+
evicted: z.ZodNumber;
|
|
258
|
+
pending: z.ZodOptional<z.ZodNumber>;
|
|
259
|
+
interruptedOnReopen: z.ZodOptional<z.ZodNumber>;
|
|
260
|
+
}, z.core.$strict>>;
|
|
261
|
+
}, z.core.$strict>;
|
|
262
|
+
export type RequestDiagnostic = z.infer<typeof RequestDiagnosticSchema>;
|
|
263
|
+
export interface RequestDiagnosticHandle {
|
|
264
|
+
composition?(evidence: RequestBodyEvidence): void;
|
|
265
|
+
isCurrent?(): boolean;
|
|
266
|
+
headers(status: number | undefined, ms: number | undefined, upload?: RequestUploadEvidence): void;
|
|
267
|
+
finish(outcome: RequestDiagnostic['outcome'], reason?: RequestDiagnostic['reason']): void;
|
|
268
|
+
}
|
|
269
|
+
export interface RequestDiagnosticStart {
|
|
270
|
+
streamId: string;
|
|
271
|
+
dispatchIndex: number;
|
|
272
|
+
model: string;
|
|
273
|
+
protocol: RequestDiagnostic['protocol'];
|
|
274
|
+
composition: RequestBodyEvidence;
|
|
275
|
+
encoding: RequestDiagnostic['encoding'];
|
|
276
|
+
wireBytes?: number;
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=request-diagnostics.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
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { GenerateOptions } from '@deepseek-ai/dsh-llm';
|
|
3
|
+
import type { SearchPlanCandidate } from './plan.ts';
|
|
4
|
+
import type { ResponsesReasoningOptions } from './serialize.ts';
|
|
5
|
+
/** Resolve only the selected model's declared/native efforts, with the same precedence as Core. */
|
|
6
|
+
export declare function resolveCopilotResponsesReasoning(ctx: Context, request: GenerateOptions, candidate: Pick<SearchPlanCandidate, 'protocol' | 'model'>): ResponsesReasoningOptions | undefined;
|
|
7
|
+
//# sourceMappingURL=responses-reasoning.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
type ReplayFailure = 'scope-mismatch' | 'unsupported' | 'invalid-payload';
|
|
2
|
+
interface ReplayDispatch {
|
|
3
|
+
readonly body?: string;
|
|
4
|
+
readonly sessionHeader?: boolean;
|
|
5
|
+
readonly clientRequestHeader?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Fixed diagnostics and bounded counts only; never retain request or replay content. */
|
|
8
|
+
export declare class CopilotResponsesReplayError extends Error {
|
|
9
|
+
readonly dispatchEvidence?: string;
|
|
10
|
+
constructor(reason?: ReplayFailure, dispatch?: ReplayDispatch);
|
|
11
|
+
}
|
|
12
|
+
/** Normalize only the outgoing managed Responses payload, never stored history/context. */
|
|
13
|
+
export declare function normalizeCopilotResponsesPayload(payload: unknown): unknown;
|
|
14
|
+
/** A single lease can admit one HTTP-verified retry at a time; it never reads durable history. */
|
|
15
|
+
export declare class ResponsesRetryReplay {
|
|
16
|
+
private snapshot;
|
|
17
|
+
private active;
|
|
18
|
+
private disposed;
|
|
19
|
+
dispose(): void;
|
|
20
|
+
belongsTo(sessionId: string): boolean;
|
|
21
|
+
begin(context: unknown, signal?: AbortSignal, sessionId?: string, modelId?: string): ResponsesRetryAttempt;
|
|
22
|
+
}
|
|
23
|
+
export interface ResponsesRetryAttempt {
|
|
24
|
+
normalize(payload: unknown, transform?: (payload: unknown) => unknown): unknown;
|
|
25
|
+
observe(body: string | undefined, status: number): void;
|
|
26
|
+
finish(): void;
|
|
27
|
+
}
|
|
28
|
+
/** Observe a cloned, bounded 401 body; every unknown result retains native auth behavior. */
|
|
29
|
+
export declare function isCopilotInputItemScopeError(response: Response, signal?: AbortSignal): Promise<boolean>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=responses-replay-compat.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type ResponsesCompressionSkipReason = 'disabled' | 'unsupported-protocol' | 'custom-fetch' | 'untrusted-origin' | 'unsupported-request' | 'unsupported-body' | 'unsupported-content-type' | 'existing-encoding' | 'transfer-encoding' | 'invalid-content-length' | 'below-minimum' | 'work-limit' | 'not-beneficial' | 'compression-failed' | 'aborted';
|
|
2
|
+
export type RequestCompressionEvidence = {
|
|
3
|
+
readonly encoding: 'identity';
|
|
4
|
+
readonly reason: ResponsesCompressionSkipReason;
|
|
5
|
+
readonly originalBytes?: number;
|
|
6
|
+
} | {
|
|
7
|
+
readonly encoding: 'gzip';
|
|
8
|
+
readonly reason: 'compressed';
|
|
9
|
+
readonly originalBytes: number;
|
|
10
|
+
readonly wireBytes: number;
|
|
11
|
+
};
|
|
12
|
+
type PreparedRequest = {
|
|
13
|
+
readonly input: RequestInfo | URL;
|
|
14
|
+
readonly init: RequestInit | undefined;
|
|
15
|
+
readonly evidence: RequestCompressionEvidence;
|
|
16
|
+
};
|
|
17
|
+
export type PreparedResponsesRequest = (PreparedRequest & {
|
|
18
|
+
readonly applied: false;
|
|
19
|
+
readonly reason: ResponsesCompressionSkipReason;
|
|
20
|
+
readonly originalBytes?: number;
|
|
21
|
+
}) | (PreparedRequest & {
|
|
22
|
+
readonly applied: true;
|
|
23
|
+
readonly evidence: Extract<RequestCompressionEvidence, {
|
|
24
|
+
encoding: 'gzip';
|
|
25
|
+
}>;
|
|
26
|
+
readonly originalBytes: number;
|
|
27
|
+
readonly wireBytes: number;
|
|
28
|
+
});
|
|
29
|
+
export declare function satisfiesCompressionSavings(originalBytes: number, wireBytes: number): boolean;
|
|
30
|
+
/** Prepares one dispatch without changing the native request when compression is ineligible. */
|
|
31
|
+
export declare function prepareResponsesRequest(input: RequestInfo | URL, init: RequestInit | undefined, accountBaseUrl: string, enabled: boolean, customFetch: boolean, signal?: AbortSignal, api?: string): Promise<PreparedResponsesRequest>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=responses-request-compression.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** Journal provenance only; process identity is not namespace lifetime evidence. */
|
|
2
|
+
export declare const ROUTE_OWNERSHIP_EPOCH: `${string}-${string}-${string}-${string}-${string}`;
|
|
3
|
+
export type RouteMutation = {
|
|
4
|
+
readonly op: 'set';
|
|
5
|
+
readonly path: string[];
|
|
6
|
+
readonly value: unknown;
|
|
7
|
+
} | {
|
|
8
|
+
readonly op: 'unset';
|
|
9
|
+
readonly path: string[];
|
|
10
|
+
};
|
|
11
|
+
export interface RouteSettings {
|
|
12
|
+
describe(options?: {
|
|
13
|
+
redactSecrets?: boolean;
|
|
14
|
+
}): Array<{
|
|
15
|
+
ns: string;
|
|
16
|
+
value: unknown;
|
|
17
|
+
revision: number;
|
|
18
|
+
user?: unknown;
|
|
19
|
+
base?: unknown;
|
|
20
|
+
secrets?: readonly {
|
|
21
|
+
path: readonly string[];
|
|
22
|
+
set: boolean;
|
|
23
|
+
}[];
|
|
24
|
+
}>;
|
|
25
|
+
mutate(namespace: string, operations: readonly RouteMutation[], expectedRevision?: number): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export declare class TemporaryRouteConflictError extends Error {
|
|
28
|
+
readonly code: 'TEMPORARY_ROUTE_OWNERSHIP_CONFLICT' | 'TEMPORARY_ROUTE_LEGACY_CONFLICT' | 'TEMPORARY_ROUTE_INVALID_BACKUP';
|
|
29
|
+
constructor(code?: 'TEMPORARY_ROUTE_OWNERSHIP_CONFLICT' | 'TEMPORARY_ROUTE_LEGACY_CONFLICT' | 'TEMPORARY_ROUTE_INVALID_BACKUP');
|
|
30
|
+
}
|
|
31
|
+
export declare function object(value: unknown): Record<string, unknown> | undefined;
|
|
32
|
+
export declare function profileAt(value: unknown): Record<string, unknown> | undefined;
|
|
33
|
+
/** Bounded comparison; never stringify or copy unknown model extras or headers. */
|
|
34
|
+
export declare function equalJson(a: unknown, b: unknown, depth?: number): boolean;
|
|
35
|
+
interface Leaves {
|
|
36
|
+
readonly api?: string;
|
|
37
|
+
readonly models?: readonly Record<string, unknown>[];
|
|
38
|
+
}
|
|
39
|
+
export interface RouteBackup {
|
|
40
|
+
readonly version: 2;
|
|
41
|
+
readonly providerExisted: boolean;
|
|
42
|
+
readonly preimage: Leaves;
|
|
43
|
+
readonly postimage: Leaves;
|
|
44
|
+
readonly ownedHeaders: Readonly<Record<string, string>>;
|
|
45
|
+
readonly phase: 'overlay' | 'restoring';
|
|
46
|
+
readonly sourceRevision: number;
|
|
47
|
+
readonly sourceEpoch: string;
|
|
48
|
+
readonly target?: Leaves;
|
|
49
|
+
readonly removeProfile?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export declare function leavesOf(profile: Record<string, unknown> | undefined): Leaves;
|
|
52
|
+
export declare function encodeBackup(backup: RouteBackup): string;
|
|
53
|
+
export declare function readBackup(value: unknown): RouteBackup | undefined;
|
|
54
|
+
export declare function settingsSnapshot(settings: RouteSettings): {
|
|
55
|
+
current: Record<string, unknown> | undefined;
|
|
56
|
+
raw: Record<string, unknown> | undefined;
|
|
57
|
+
base: Record<string, unknown> | undefined;
|
|
58
|
+
hasSecrets: boolean;
|
|
59
|
+
hasOwnedSecrets: boolean;
|
|
60
|
+
routeRevision: number;
|
|
61
|
+
markerRevision: number;
|
|
62
|
+
backup: RouteBackup | undefined;
|
|
63
|
+
};
|
|
64
|
+
export declare function assertOwned(current: Record<string, unknown> | undefined, backup: RouteBackup): 'preimage' | 'postimage' | 'target';
|
|
65
|
+
export declare function leafOperations(current: Record<string, unknown> | undefined, target: Leaves): RouteMutation[];
|
|
66
|
+
export declare function ownedHeaderRemoval(current: Record<string, unknown> | undefined, backup: RouteBackup): RouteMutation[];
|
|
67
|
+
/** Raw shape, not schema-resolved defaults, proves whole-profile ownership. */
|
|
68
|
+
export declare function wholeProfileOwned(snapshot: ReturnType<typeof settingsSnapshot>, backup: RouteBackup): boolean;
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=route-ownership.d.ts.map
|