dsh-github-copilot 0.4.0-alpha.122 → 0.4.0-alpha.124
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 +2 -1
- package/CHANGELOG.md +12 -0
- package/README.md +17 -6
- package/README.zh.md +15 -6
- package/deployment-baseline.json +27 -2
- package/docs/manual-compaction-recovery.md +6 -4
- package/docs/plugin-diagnostics.md +388 -0
- package/lib/client.js +1242 -399
- package/lib/client.js.map +1 -1
- package/lib/index.js +1135 -462
- package/lib/manual-compaction-recovery.js +73 -20
- package/lib/remote.js +195 -8
- package/lib/request-budget-Cui2hCi1.js +268 -0
- package/lib/routed-web.js +1 -1
- package/lib/{search-routing-CHyF6TbO.js → search-routing-CV2hs8as.js} +35 -35
- package/lib/types/client.d.ts +3 -0
- package/lib/types/compaction-continuation.d.ts +1 -1
- package/lib/types/compaction-input-estimate.d.ts +24 -0
- package/lib/types/config.d.ts +6 -2
- package/lib/types/copilot-accounts-host.d.ts +1 -0
- package/lib/types/diagnostics-card.d.ts +10 -0
- package/lib/types/diagnostics-client.d.ts +13 -0
- package/lib/types/diagnostics-collector.d.ts +36 -0
- package/lib/types/diagnostics-host.d.ts +72 -0
- package/lib/types/diagnostics-remote.d.ts +109 -0
- package/lib/types/diagnostics-types.d.ts +431 -0
- package/lib/types/remote.d.ts +1 -1
- package/lib/types/session-accounts-host.d.ts +1 -1
- package/lib/types/session-continuation-types.d.ts +2 -2
- package/package.json +6 -2
- package/lib/request-budget-DLY_aRq0.js +0 -87
|
@@ -3,6 +3,40 @@ import { getSupportedThinkingLevels } from "@earendil-works/pi-ai";
|
|
|
3
3
|
import { builtinProviders, getBuiltinModels } from "@earendil-works/pi-ai/providers/all";
|
|
4
4
|
import { WebError } from "@deepseek-ai/dsh-web";
|
|
5
5
|
import { attributionHeaders } from "@deepseek-ai/dsh-llm";
|
|
6
|
+
//#region lib/types/settings-reader.js
|
|
7
|
+
function isLiveSetting(value) {
|
|
8
|
+
return typeof value === "object" && value !== null && typeof Reflect.get(value, "get") === "function";
|
|
9
|
+
}
|
|
10
|
+
/** Capture a native volatile field for one operation, or retain a plain fixture value. */
|
|
11
|
+
function readConfigValue(value) {
|
|
12
|
+
return isLiveSetting(value) ? value.get() : value;
|
|
13
|
+
}
|
|
14
|
+
function isRecord(value) {
|
|
15
|
+
return typeof value === "object" && value !== null;
|
|
16
|
+
}
|
|
17
|
+
function isSettingsForms(value) {
|
|
18
|
+
return isRecord(value) && typeof value.describe === "function";
|
|
19
|
+
}
|
|
20
|
+
function isLegacySettings(value) {
|
|
21
|
+
return isRecord(value) && typeof value.get === "function";
|
|
22
|
+
}
|
|
23
|
+
/** Read non-secret configuration through the API available on the running Core. */
|
|
24
|
+
function readSettingsNamespace(ctx, namespace) {
|
|
25
|
+
const settings = ctx.get("settings");
|
|
26
|
+
if (isLegacySettings(settings)) return settings.get(namespace);
|
|
27
|
+
if (!isSettingsForms(settings)) return void 0;
|
|
28
|
+
return settings.describe({ redactSecrets: true }).find((candidate) => candidate.ns === namespace)?.value;
|
|
29
|
+
}
|
|
30
|
+
/** Subscribe to namespace changes across the legacy settings provider and current form service. */
|
|
31
|
+
function onSettingsNamespaceUpdated(ctx, listener) {
|
|
32
|
+
const disposeDocument = ctx.on("settings/document-updated", (namespace) => listener(namespace));
|
|
33
|
+
const disposeLegacy = ctx.on("settings/updated", (namespace) => listener(namespace));
|
|
34
|
+
return () => {
|
|
35
|
+
disposeDocument();
|
|
36
|
+
disposeLegacy();
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
6
40
|
//#region lib/types/model-protocol.js
|
|
7
41
|
/** Project only public leaves and the same pi library's supported wire efforts. */
|
|
8
42
|
function projectModelFacts(model) {
|
|
@@ -40,40 +74,6 @@ function isPluginPreviewProvider(ctx, provider) {
|
|
|
40
74
|
return typeof view === "object" && view !== null && Reflect.get(view, "provider") === provider;
|
|
41
75
|
}
|
|
42
76
|
//#endregion
|
|
43
|
-
//#region lib/types/settings-reader.js
|
|
44
|
-
function isLiveSetting(value) {
|
|
45
|
-
return typeof value === "object" && value !== null && typeof Reflect.get(value, "get") === "function";
|
|
46
|
-
}
|
|
47
|
-
/** Capture a native volatile field for one operation, or retain a plain fixture value. */
|
|
48
|
-
function readConfigValue(value) {
|
|
49
|
-
return isLiveSetting(value) ? value.get() : value;
|
|
50
|
-
}
|
|
51
|
-
function isRecord(value) {
|
|
52
|
-
return typeof value === "object" && value !== null;
|
|
53
|
-
}
|
|
54
|
-
function isSettingsForms(value) {
|
|
55
|
-
return isRecord(value) && typeof value.describe === "function";
|
|
56
|
-
}
|
|
57
|
-
function isLegacySettings(value) {
|
|
58
|
-
return isRecord(value) && typeof value.get === "function";
|
|
59
|
-
}
|
|
60
|
-
/** Read non-secret configuration through the API available on the running Core. */
|
|
61
|
-
function readSettingsNamespace(ctx, namespace) {
|
|
62
|
-
const settings = ctx.get("settings");
|
|
63
|
-
if (isLegacySettings(settings)) return settings.get(namespace);
|
|
64
|
-
if (!isSettingsForms(settings)) return void 0;
|
|
65
|
-
return settings.describe({ redactSecrets: true }).find((candidate) => candidate.ns === namespace)?.value;
|
|
66
|
-
}
|
|
67
|
-
/** Subscribe to namespace changes across the legacy settings provider and current form service. */
|
|
68
|
-
function onSettingsNamespaceUpdated(ctx, listener) {
|
|
69
|
-
const disposeDocument = ctx.on("settings/document-updated", (namespace) => listener(namespace));
|
|
70
|
-
const disposeLegacy = ctx.on("settings/updated", (namespace) => listener(namespace));
|
|
71
|
-
return () => {
|
|
72
|
-
disposeDocument();
|
|
73
|
-
disposeLegacy();
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
//#endregion
|
|
77
77
|
//#region lib/types/http.js
|
|
78
78
|
/**
|
|
79
79
|
* Shared HTTP plumbing for the capability probe and the inline wires:
|
|
@@ -789,4 +789,4 @@ async function routeSessionSearch(request, signal, deps) {
|
|
|
789
789
|
};
|
|
790
790
|
}
|
|
791
791
|
//#endregion
|
|
792
|
-
export { providerErrorMessage as C,
|
|
792
|
+
export { providerErrorMessage as C, onSettingsNamespaceUpdated as D, readCopilotCatalog as E, readConfigValue as O, isAbortError as S, isPluginPreviewProvider as T, sameCandidates as _, COPILOT_HOSTED_SEARCH_PROVIDER_ID as a, currentSearchSelection as b, applyRequestAuth as c, ANTHROPIC_WEB_SEARCH_TOOL_TYPE as d, GITHUB_COPILOT_CREDENTIAL_KEY as f, candidatesForRoute as g, WEB_SEARCH_TOOL_TYPE as h, describeSearchBackend as i, readSettingsNamespace as k, normalizeRequestAuth as l, SearchPlan as m, routeSessionSearch as n, GITHUB_COPILOT_HOSTED_SEARCH_PROVIDER_ID as o, RESPONSES_WEB_SEARCH_TOOL_TYPE as p, DescribedSearchFallbackError as r, createTraditionalSearchProvider as s, isCopilotSearchSelection as t, providerRequestHeaders as u, currentChatRoute as v, readBounded as w, abortable as x, currentSearchInitiator as y };
|
package/lib/types/client.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { createCompactAccount } from './compact-account.ts';
|
|
|
7
7
|
import type { CSSProperties, ReactElement } from 'react';
|
|
8
8
|
import type { GitHubCopilotAuthorizationView } from './authorization-controller.ts';
|
|
9
9
|
import type { ProviderCardExtrasOwnerProps, SettingsSectionOwnerProps } from './dsh-supported-types.ts';
|
|
10
|
+
import type { DiagnosticsRemote } from './diagnostics-card.ts';
|
|
10
11
|
export { HostedSearchSettingsCard, WebSearchRoutingCard } from './web-search-routing-card.ts';
|
|
11
12
|
export { ParentModelFollowCard } from './parent-model-follow-card.ts';
|
|
12
13
|
export { CopilotUsageCard } from './copilot-usage-card.ts';
|
|
@@ -120,6 +121,8 @@ export declare function GitHubCopilotSettingsSection(props: GitHubCopilotSetting
|
|
|
120
121
|
export declare function CopilotPluginSettingsPage(props: {
|
|
121
122
|
settings: ClientContext['remote']['settings'];
|
|
122
123
|
routing: ClientContext['remote']['githubCopilotSearchRouting'];
|
|
124
|
+
diagnostics?: DiagnosticsRemote;
|
|
125
|
+
diagnosticsControl?: ReactElement;
|
|
123
126
|
}): import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
124
127
|
/** Mount the plugin-owned Remote namespace and register the Models card seat. */
|
|
125
128
|
export declare function apply(ctx: ClientContext): Promise<() => Promise<void>>;
|
|
@@ -40,7 +40,7 @@ export declare const compactionContinuationDefinition: {
|
|
|
40
40
|
export declare function installCompactionContinuation(ctx: Context, enabled: (agent: Agent) => boolean): {
|
|
41
41
|
status(agent: Agent): {
|
|
42
42
|
id: string;
|
|
43
|
-
state: "running" | "
|
|
43
|
+
state: "running" | "cancelled" | "failed" | "completed" | "blocked";
|
|
44
44
|
} | undefined;
|
|
45
45
|
prepare(request: GenerateOptions): ((payload: unknown) => Promise<unknown>) | undefined;
|
|
46
46
|
dispose(): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Message, ToolSchema } from '@deepseek-ai/dsh-llm';
|
|
2
|
+
interface CompactionPlanningMessage {
|
|
3
|
+
readonly role: string;
|
|
4
|
+
readonly content: readonly {
|
|
5
|
+
readonly type: string;
|
|
6
|
+
readonly id?: string;
|
|
7
|
+
}[];
|
|
8
|
+
readonly toolCallId?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function compactionSafeBoundaries(messages: readonly CompactionPlanningMessage[]): readonly number[];
|
|
11
|
+
/**
|
|
12
|
+
* Conservative content-byte planning, not provider-exact token accounting.
|
|
13
|
+
* Native admission still checks converted replay, images and the full request.
|
|
14
|
+
*/
|
|
15
|
+
export declare function estimateCompactionInputBytes(input: {
|
|
16
|
+
readonly messages: readonly Message[];
|
|
17
|
+
readonly tools?: readonly ToolSchema[];
|
|
18
|
+
}): number;
|
|
19
|
+
export declare function reduceCompactionInputLimit(input: {
|
|
20
|
+
readonly messages: readonly Message[];
|
|
21
|
+
readonly tools?: readonly ToolSchema[];
|
|
22
|
+
}, inputLimit: number): number;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=compaction-input-estimate.d.ts.map
|
package/lib/types/config.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ import type { SessionAccountPreference } from './session-accounts.ts';
|
|
|
12
12
|
import type { SessionContinuationPreference } from './session-continuation-types.ts';
|
|
13
13
|
/** Plugin configuration. Defaults make the current chat route decide. */
|
|
14
14
|
export interface InlineConfig {
|
|
15
|
+
/** Opt-in local aggregate diagnostics; no uploads or scheduled analysis. */
|
|
16
|
+
diagnosticsEnabled?: boolean;
|
|
15
17
|
/** Hosted-search switch; managed chat requests remain enabled. */
|
|
16
18
|
enabled: boolean;
|
|
17
19
|
/**
|
|
@@ -78,13 +80,14 @@ export interface InlineConfig {
|
|
|
78
80
|
/** Internal JSON backup of route leaves temporarily owned by the GPT-6 overlay. */
|
|
79
81
|
temporaryRouteBackup?: string;
|
|
80
82
|
}
|
|
81
|
-
export type LiveInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'highCostModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId' | 'sessionAccounts' | 'sessionContinuation' | 'continuationDefaultHistory'> & {
|
|
83
|
+
export type LiveInlineConfig = Omit<InlineConfig, 'diagnosticsEnabled' | 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'highCostModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId' | 'sessionAccounts' | 'sessionContinuation' | 'continuationDefaultHistory'> & {
|
|
82
84
|
continuationDefaultHistory?: InlineConfig['continuationDefaultHistory'] | LiveSetting<ArrayLike<{
|
|
83
85
|
enabled: boolean;
|
|
84
86
|
changedAt: number;
|
|
85
87
|
}>>;
|
|
86
88
|
sessionContinuation?: SessionContinuationPreference[] | LiveSetting<ArrayLike<SessionContinuationPreference>>;
|
|
87
89
|
sessionAccounts?: SessionAccountPreference[] | LiveSetting<ArrayLike<SessionAccountPreference>>;
|
|
90
|
+
diagnosticsEnabled?: boolean | LiveSetting<boolean>;
|
|
88
91
|
activeAccountId?: string | LiveSetting<string | undefined>;
|
|
89
92
|
followParentModel?: boolean | LiveSetting<boolean>;
|
|
90
93
|
parentModelFollow?: ParentModelBinding[] | LiveSetting<ArrayLike<ParentModelBinding>>;
|
|
@@ -94,7 +97,8 @@ export type LiveInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting
|
|
|
94
97
|
searchRouting?: WebSearchRoutingConfig | LiveSetting<WebSearchRoutingConfig | undefined>;
|
|
95
98
|
temporaryRouteBackup?: string | LiveSetting<string | undefined>;
|
|
96
99
|
};
|
|
97
|
-
export type ResolvedInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'highCostModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId' | 'sessionAccounts' | 'sessionContinuation' | 'continuationDefaultHistory'> & {
|
|
100
|
+
export type ResolvedInlineConfig = Omit<InlineConfig, 'diagnosticsEnabled' | 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'highCostModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId' | 'sessionAccounts' | 'sessionContinuation' | 'continuationDefaultHistory'> & {
|
|
101
|
+
diagnosticsEnabled: LiveSetting<boolean>;
|
|
98
102
|
continuationDefaultHistory: LiveSetting<ArrayLike<{
|
|
99
103
|
enabled: boolean;
|
|
100
104
|
changedAt: number;
|
|
@@ -58,6 +58,7 @@ export declare class CopilotAccountsHost {
|
|
|
58
58
|
ensureIdentityFor(accountId: string): Promise<CopilotAccountsView>;
|
|
59
59
|
ensureAccountNamesFor(accountId: string): Promise<CopilotAccountsView>;
|
|
60
60
|
private readIdentity;
|
|
61
|
+
private readIdentityObserved;
|
|
61
62
|
private validateModels;
|
|
62
63
|
private assertIdentityCurrent;
|
|
63
64
|
switchAccount(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
|
+
export type DiagnosticsRemote = Context['remote']['githubCopilotDiagnostics'];
|
|
4
|
+
export declare function DiagnosticsCard({ remote }: {
|
|
5
|
+
remote?: DiagnosticsRemote;
|
|
6
|
+
}): import("react").DetailedReactHTMLElement<{
|
|
7
|
+
'aria-label': string;
|
|
8
|
+
style: CSSProperties;
|
|
9
|
+
}, HTMLElement>;
|
|
10
|
+
//# sourceMappingURL=diagnostics-card.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { DiagnosticsHandle } from './diagnostics-collector.ts';
|
|
3
|
+
import type { DiagnosticsOperation, DiagnosticsView } from './diagnostics-types.ts';
|
|
4
|
+
export declare function updateDiagnosticsClient(view: DiagnosticsView): void;
|
|
5
|
+
export declare function clientDiagnosticsReportingFailed(): boolean;
|
|
6
|
+
export declare function beginClientDiagnostics(operation: DiagnosticsOperation): DiagnosticsHandle | undefined;
|
|
7
|
+
export declare function createClientDiagnosticsScope(): {
|
|
8
|
+
begin(operation: DiagnosticsOperation): DiagnosticsHandle | undefined;
|
|
9
|
+
close(): void;
|
|
10
|
+
};
|
|
11
|
+
/** Bounded additive reporting, no retry after an uncertain RPC result. */
|
|
12
|
+
export declare function installDiagnosticsClient(ctx: Context): () => Promise<void>;
|
|
13
|
+
//# sourceMappingURL=diagnostics-client.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { DiagnosticsOperation, DiagnosticsStage, DiagnosticsOutcome, DiagnosticsReason, DiagnosticsRow, DiagnosticsSnapshot } from './diagnostics-types.ts';
|
|
2
|
+
export interface DiagnosticsHandle {
|
|
3
|
+
stage(stage: DiagnosticsStage): void;
|
|
4
|
+
finish(outcome: DiagnosticsOutcome, reason?: DiagnosticsReason): void;
|
|
5
|
+
}
|
|
6
|
+
export declare function emptyDiagnostics(): DiagnosticsSnapshot;
|
|
7
|
+
/** Only fixed dimensions cross this boundary; live handles never leave the owner. */
|
|
8
|
+
export declare class DiagnosticsCollector {
|
|
9
|
+
readonly version: string;
|
|
10
|
+
readonly layer: 'client' | 'host';
|
|
11
|
+
private readonly changed;
|
|
12
|
+
private readonly wall;
|
|
13
|
+
private readonly mono;
|
|
14
|
+
private data;
|
|
15
|
+
private readonly live;
|
|
16
|
+
private enabled;
|
|
17
|
+
private lastWall;
|
|
18
|
+
constructor(version: string, layer: 'client' | 'host', changed?: () => void, wall?: () => number, mono?: () => number);
|
|
19
|
+
restore(snapshot: DiagnosticsSnapshot): void;
|
|
20
|
+
setEnabled(enabled: boolean): void;
|
|
21
|
+
assertCanEnable(): void;
|
|
22
|
+
clear(): void;
|
|
23
|
+
begin(operation: DiagnosticsOperation): DiagnosticsHandle;
|
|
24
|
+
private settle;
|
|
25
|
+
private age;
|
|
26
|
+
private increment;
|
|
27
|
+
private expire;
|
|
28
|
+
private add;
|
|
29
|
+
private oldestIndex;
|
|
30
|
+
snapshot(): DiagnosticsSnapshot;
|
|
31
|
+
close(): void;
|
|
32
|
+
noteDropped(): void;
|
|
33
|
+
noteClientGaps(dropped: number, unconfirmed: number): void;
|
|
34
|
+
mergeClient(rows: readonly DiagnosticsRow[]): void;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=diagnostics-collector.d.ts.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
|
+
import type { DomainGlobalSpec } from '@deepseek-ai/dsh-storage-domain';
|
|
4
|
+
import { DiagnosticsCollector } from './diagnostics-collector.ts';
|
|
5
|
+
import type { DiagnosticsHandle } from './diagnostics-collector.ts';
|
|
6
|
+
import type { DiagnosticsOperation, DiagnosticsView } from './diagnostics-types.ts';
|
|
7
|
+
import type { ClientDiagnosticsBatch } from './diagnostics-remote.ts';
|
|
8
|
+
export declare const diagnosticsDomain: {
|
|
9
|
+
name: string;
|
|
10
|
+
version: number;
|
|
11
|
+
tables: {};
|
|
12
|
+
global: DomainGlobalSpec<{
|
|
13
|
+
schemaVersion: 1;
|
|
14
|
+
coverageVersion: 1;
|
|
15
|
+
epoch: number;
|
|
16
|
+
updatedAt: number;
|
|
17
|
+
rows: {
|
|
18
|
+
hour: number;
|
|
19
|
+
version: string;
|
|
20
|
+
layer: "client" | "host";
|
|
21
|
+
operation: "compaction" | "account-global-switch" | "account-session-select" | "account-session-inherit" | "identity-read" | "identity-flight" | "compaction-summary" | "collection";
|
|
22
|
+
stage: "ended" | "admitted" | "rpc-invoked" | "host-received" | "identity-validation" | "model-validation" | "cas" | "readback" | "response-received" | "decoded" | "client-settled" | "summary-attempt" | "checkpoint-committed" | "cache-hit" | "joined-flight" | "cooldown" | "dispatched";
|
|
23
|
+
metric: "paused" | "unknown" | "started" | "stage" | "success" | "no-op" | "cancelled" | "policy-rejected" | "revoked" | "environment-fault" | "failed" | "interrupted" | "dropped" | "expired" | "clock-discontinuity" | "pending-sample";
|
|
24
|
+
reason: "none" | "COPILOT_ACCOUNTS_SETTINGS_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_TIMEOUT" | "COPILOT_ACCOUNTS_IDENTITY_TLS" | "COPILOT_ACCOUNTS_IDENTITY_NETWORK" | "COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED" | "COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED" | "COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR" | "unknown" | "rpc-unavailable" | "decode-invalid" | "COPILOT_SESSION_ACCOUNTS_UNAVAILABLE" | "COPILOT_SESSION_ACCOUNTS_SETTINGS_UNAVAILABLE" | "COPILOT_SESSION_ACCOUNTS_COMMIT_UNCERTAIN" | "COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH" | "CONTEXT_WINDOW_EXCEEDED" | "COPILOT_MANUAL_RECOVERY_FIXED_PREFIX" | "COPILOT_MANUAL_RECOVERY_INDIVISIBLE" | "COPILOT_MANUAL_RECOVERY_CALL_LIMIT" | "COPILOT_MANUAL_RECOVERY_EMPTY_SUMMARY" | "COPILOT_MANUAL_RECOVERY_UNBALANCED";
|
|
25
|
+
bucket: number;
|
|
26
|
+
count: number;
|
|
27
|
+
}[];
|
|
28
|
+
pending: {
|
|
29
|
+
version: string;
|
|
30
|
+
operation: "compaction" | "account-global-switch" | "account-session-select" | "account-session-inherit" | "identity-read" | "identity-flight" | "compaction-summary" | "collection";
|
|
31
|
+
stage: "ended" | "admitted" | "rpc-invoked" | "host-received" | "identity-validation" | "model-validation" | "cas" | "readback" | "response-received" | "decoded" | "client-settled" | "summary-attempt" | "checkpoint-committed" | "cache-hit" | "joined-flight" | "cooldown" | "dispatched";
|
|
32
|
+
bucket: number;
|
|
33
|
+
count: number;
|
|
34
|
+
}[];
|
|
35
|
+
dropped: number;
|
|
36
|
+
clientDropped: number;
|
|
37
|
+
clientUnconfirmed: number;
|
|
38
|
+
saturated: number;
|
|
39
|
+
evicted: number;
|
|
40
|
+
interrupted: number;
|
|
41
|
+
}>;
|
|
42
|
+
};
|
|
43
|
+
export declare function diagnosticsDomainForProfile(profileId: string): typeof diagnosticsDomain;
|
|
44
|
+
declare module '@deepseek-ai/cordis' {
|
|
45
|
+
interface Context {
|
|
46
|
+
githubCopilotDiagnostics: DiagnosticsController;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export declare function beginDiagnostics(ctx: Context, operation: DiagnosticsOperation): DiagnosticsHandle | undefined;
|
|
50
|
+
/** Keeps diagnostics durability failures separate from observed business failures. */
|
|
51
|
+
export declare class DiagnosticsController extends TypertRemoteService {
|
|
52
|
+
readonly collector: DiagnosticsCollector;
|
|
53
|
+
private domain;
|
|
54
|
+
private state;
|
|
55
|
+
private problem;
|
|
56
|
+
private enabled;
|
|
57
|
+
private dirty;
|
|
58
|
+
private persistedAt;
|
|
59
|
+
private revision;
|
|
60
|
+
private writing;
|
|
61
|
+
private closed;
|
|
62
|
+
private settingsBusy;
|
|
63
|
+
private readonly brackets;
|
|
64
|
+
constructor(ctx: Context);
|
|
65
|
+
flush(): Promise<void>;
|
|
66
|
+
markCompactionCancelled(session: object): void;
|
|
67
|
+
get(): DiagnosticsView;
|
|
68
|
+
setEnabled(enabled: boolean): Promise<DiagnosticsView>;
|
|
69
|
+
clear(): Promise<DiagnosticsView>;
|
|
70
|
+
recordClient(batch: ClientDiagnosticsBatch): Promise<DiagnosticsView>;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=diagnostics-host.d.ts.map
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { DiagnosticsView } from './diagnostics-types.ts';
|
|
4
|
+
export declare const ClientDiagnosticsBatchSchema: z.ZodObject<{
|
|
5
|
+
epoch: z.ZodNumber;
|
|
6
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
7
|
+
hour: z.ZodNumber;
|
|
8
|
+
version: z.ZodString;
|
|
9
|
+
layer: z.ZodEnum<{
|
|
10
|
+
client: "client";
|
|
11
|
+
host: "host";
|
|
12
|
+
}>;
|
|
13
|
+
operation: z.ZodEnum<{
|
|
14
|
+
compaction: "compaction";
|
|
15
|
+
"account-global-switch": "account-global-switch";
|
|
16
|
+
"account-session-select": "account-session-select";
|
|
17
|
+
"account-session-inherit": "account-session-inherit";
|
|
18
|
+
"identity-read": "identity-read";
|
|
19
|
+
"identity-flight": "identity-flight";
|
|
20
|
+
"compaction-summary": "compaction-summary";
|
|
21
|
+
collection: "collection";
|
|
22
|
+
}>;
|
|
23
|
+
stage: z.ZodEnum<{
|
|
24
|
+
ended: "ended";
|
|
25
|
+
admitted: "admitted";
|
|
26
|
+
"rpc-invoked": "rpc-invoked";
|
|
27
|
+
"host-received": "host-received";
|
|
28
|
+
"identity-validation": "identity-validation";
|
|
29
|
+
"model-validation": "model-validation";
|
|
30
|
+
cas: "cas";
|
|
31
|
+
readback: "readback";
|
|
32
|
+
"response-received": "response-received";
|
|
33
|
+
decoded: "decoded";
|
|
34
|
+
"client-settled": "client-settled";
|
|
35
|
+
"summary-attempt": "summary-attempt";
|
|
36
|
+
"checkpoint-committed": "checkpoint-committed";
|
|
37
|
+
"cache-hit": "cache-hit";
|
|
38
|
+
"joined-flight": "joined-flight";
|
|
39
|
+
cooldown: "cooldown";
|
|
40
|
+
dispatched: "dispatched";
|
|
41
|
+
}>;
|
|
42
|
+
metric: z.ZodEnum<{
|
|
43
|
+
paused: "paused";
|
|
44
|
+
unknown: "unknown";
|
|
45
|
+
started: "started";
|
|
46
|
+
stage: "stage";
|
|
47
|
+
success: "success";
|
|
48
|
+
"no-op": "no-op";
|
|
49
|
+
cancelled: "cancelled";
|
|
50
|
+
"policy-rejected": "policy-rejected";
|
|
51
|
+
revoked: "revoked";
|
|
52
|
+
"environment-fault": "environment-fault";
|
|
53
|
+
failed: "failed";
|
|
54
|
+
interrupted: "interrupted";
|
|
55
|
+
dropped: "dropped";
|
|
56
|
+
expired: "expired";
|
|
57
|
+
"clock-discontinuity": "clock-discontinuity";
|
|
58
|
+
"pending-sample": "pending-sample";
|
|
59
|
+
}>;
|
|
60
|
+
reason: z.ZodEnum<{
|
|
61
|
+
none: "none";
|
|
62
|
+
COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE: "COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE";
|
|
63
|
+
COPILOT_ACCOUNTS_CHANGED: "COPILOT_ACCOUNTS_CHANGED";
|
|
64
|
+
COPILOT_ACCOUNTS_BUSY: "COPILOT_ACCOUNTS_BUSY";
|
|
65
|
+
COPILOT_ACCOUNTS_CONFLICT: "COPILOT_ACCOUNTS_CONFLICT";
|
|
66
|
+
COPILOT_ACCOUNTS_COMMIT_UNCERTAIN: "COPILOT_ACCOUNTS_COMMIT_UNCERTAIN";
|
|
67
|
+
COPILOT_ACCOUNTS_MODELS_FAILED: "COPILOT_ACCOUNTS_MODELS_FAILED";
|
|
68
|
+
COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE: "COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE";
|
|
69
|
+
COPILOT_ACCOUNTS_IDENTITY_INVALID: "COPILOT_ACCOUNTS_IDENTITY_INVALID";
|
|
70
|
+
COPILOT_ACCOUNTS_IDENTITY_TIMEOUT: "COPILOT_ACCOUNTS_IDENTITY_TIMEOUT";
|
|
71
|
+
COPILOT_ACCOUNTS_IDENTITY_TLS: "COPILOT_ACCOUNTS_IDENTITY_TLS";
|
|
72
|
+
COPILOT_ACCOUNTS_IDENTITY_NETWORK: "COPILOT_ACCOUNTS_IDENTITY_NETWORK";
|
|
73
|
+
COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED: "COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED";
|
|
74
|
+
COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED: "COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED";
|
|
75
|
+
COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR: "COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR";
|
|
76
|
+
unknown: "unknown";
|
|
77
|
+
"rpc-unavailable": "rpc-unavailable";
|
|
78
|
+
"decode-invalid": "decode-invalid";
|
|
79
|
+
COPILOT_SESSION_ACCOUNTS_UNAVAILABLE: "COPILOT_SESSION_ACCOUNTS_UNAVAILABLE";
|
|
80
|
+
COPILOT_SESSION_ACCOUNTS_SETTINGS_UNAVAILABLE: "COPILOT_SESSION_ACCOUNTS_SETTINGS_UNAVAILABLE";
|
|
81
|
+
COPILOT_SESSION_ACCOUNTS_COMMIT_UNCERTAIN: "COPILOT_SESSION_ACCOUNTS_COMMIT_UNCERTAIN";
|
|
82
|
+
COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH: "COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH";
|
|
83
|
+
CONTEXT_WINDOW_EXCEEDED: "CONTEXT_WINDOW_EXCEEDED";
|
|
84
|
+
COPILOT_MANUAL_RECOVERY_FIXED_PREFIX: "COPILOT_MANUAL_RECOVERY_FIXED_PREFIX";
|
|
85
|
+
COPILOT_MANUAL_RECOVERY_INDIVISIBLE: "COPILOT_MANUAL_RECOVERY_INDIVISIBLE";
|
|
86
|
+
COPILOT_MANUAL_RECOVERY_CALL_LIMIT: "COPILOT_MANUAL_RECOVERY_CALL_LIMIT";
|
|
87
|
+
COPILOT_MANUAL_RECOVERY_EMPTY_SUMMARY: "COPILOT_MANUAL_RECOVERY_EMPTY_SUMMARY";
|
|
88
|
+
COPILOT_MANUAL_RECOVERY_UNBALANCED: "COPILOT_MANUAL_RECOVERY_UNBALANCED";
|
|
89
|
+
}>;
|
|
90
|
+
bucket: z.ZodNumber;
|
|
91
|
+
count: z.ZodNumber;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
dropped: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
unconfirmed: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
export type ClientDiagnosticsBatch = z.infer<typeof ClientDiagnosticsBatchSchema>;
|
|
97
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
98
|
+
interface TypertRemoteNamespaceMap {
|
|
99
|
+
githubCopilotDiagnostics: {
|
|
100
|
+
get(): Promise<RemoteResult<DiagnosticsView>>;
|
|
101
|
+
setEnabled(enabled: boolean): Promise<RemoteResult<DiagnosticsView>>;
|
|
102
|
+
clear(): Promise<RemoteResult<DiagnosticsView>>;
|
|
103
|
+
recordClient(batch: ClientDiagnosticsBatch): Promise<RemoteResult<DiagnosticsView>>;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
declare const contribution: TypertRemoteContribution;
|
|
108
|
+
export default contribution;
|
|
109
|
+
//# sourceMappingURL=diagnostics-remote.d.ts.map
|