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,85 @@
|
|
|
1
|
+
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { CopilotAccountsView } from './copilot-accounts-types.ts';
|
|
4
|
+
export type { CopilotAccountsView, CopilotAccountIdentity, CopilotAccountView } from './copilot-accounts-types.ts';
|
|
5
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
6
|
+
interface TypertRemoteNamespaceMap {
|
|
7
|
+
githubCopilotAccounts: {
|
|
8
|
+
get(): Promise<RemoteResult<CopilotAccountsView>>;
|
|
9
|
+
refreshIdentity(): Promise<RemoteResult<CopilotAccountsView>>;
|
|
10
|
+
ensureIdentity(): Promise<RemoteResult<CopilotAccountsView>>;
|
|
11
|
+
add(): Promise<RemoteResult<CopilotAccountsView>>;
|
|
12
|
+
cancel(): Promise<RemoteResult<CopilotAccountsView>>;
|
|
13
|
+
reauthorize(accountId: string, expectedRevision: number): Promise<RemoteResult<CopilotAccountsView>>;
|
|
14
|
+
switchAccount(accountId: string, expectedRevision: number): Promise<RemoteResult<CopilotAccountsView>>;
|
|
15
|
+
removeAccount(accountId: string, expectedRevision: number): Promise<RemoteResult<CopilotAccountsView>>;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export declare const CopilotAccountIdSchema: z.ZodString;
|
|
20
|
+
export declare const CopilotAccountsViewSchema: z.ZodObject<{
|
|
21
|
+
state: z.ZodEnum<{
|
|
22
|
+
error: "error";
|
|
23
|
+
ready: "ready";
|
|
24
|
+
}>;
|
|
25
|
+
activeAccountId: z.ZodString;
|
|
26
|
+
revision: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
writable: z.ZodBoolean;
|
|
28
|
+
switchable: z.ZodBoolean;
|
|
29
|
+
accounts: z.ZodArray<z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
configured: z.ZodBoolean;
|
|
32
|
+
identityState: z.ZodEnum<{
|
|
33
|
+
ready: "ready";
|
|
34
|
+
unavailable: "unavailable";
|
|
35
|
+
unknown: "unknown";
|
|
36
|
+
}>;
|
|
37
|
+
identity: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
login: z.ZodString;
|
|
39
|
+
userId: z.ZodNumber;
|
|
40
|
+
}, z.core.$strict>>;
|
|
41
|
+
}, z.core.$strict>>;
|
|
42
|
+
operation: z.ZodOptional<z.ZodEnum<{
|
|
43
|
+
authorizing: "authorizing";
|
|
44
|
+
verifying: "verifying";
|
|
45
|
+
switching: "switching";
|
|
46
|
+
}>>;
|
|
47
|
+
notices: z.ZodArray<z.ZodObject<{
|
|
48
|
+
message: z.ZodString;
|
|
49
|
+
url: z.ZodOptional<z.ZodLiteral<"https://github.com/login/device">>;
|
|
50
|
+
code: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strict>>;
|
|
52
|
+
diagnostic: z.ZodOptional<z.ZodEnum<{
|
|
53
|
+
COPILOT_ACCOUNTS_SELECTOR_INVALID: "COPILOT_ACCOUNTS_SELECTOR_INVALID";
|
|
54
|
+
COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE: "COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE";
|
|
55
|
+
COPILOT_ACCOUNTS_SELECTED_MISSING: "COPILOT_ACCOUNTS_SELECTED_MISSING";
|
|
56
|
+
COPILOT_ACCOUNTS_CREDENTIALS_UNAVAILABLE: "COPILOT_ACCOUNTS_CREDENTIALS_UNAVAILABLE";
|
|
57
|
+
COPILOT_ACCOUNTS_CHANGED: "COPILOT_ACCOUNTS_CHANGED";
|
|
58
|
+
COPILOT_ACCOUNTS_BUSY: "COPILOT_ACCOUNTS_BUSY";
|
|
59
|
+
COPILOT_ACCOUNTS_CONFLICT: "COPILOT_ACCOUNTS_CONFLICT";
|
|
60
|
+
COPILOT_ACCOUNTS_COMMIT_UNCERTAIN: "COPILOT_ACCOUNTS_COMMIT_UNCERTAIN";
|
|
61
|
+
COPILOT_ACCOUNTS_MODELS_FAILED: "COPILOT_ACCOUNTS_MODELS_FAILED";
|
|
62
|
+
COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE: "COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE";
|
|
63
|
+
COPILOT_ACCOUNTS_IDENTITY_INVALID: "COPILOT_ACCOUNTS_IDENTITY_INVALID";
|
|
64
|
+
COPILOT_ACCOUNTS_IDENTITY_TIMEOUT: "COPILOT_ACCOUNTS_IDENTITY_TIMEOUT";
|
|
65
|
+
COPILOT_ACCOUNTS_IDENTITY_TLS: "COPILOT_ACCOUNTS_IDENTITY_TLS";
|
|
66
|
+
COPILOT_ACCOUNTS_IDENTITY_NETWORK: "COPILOT_ACCOUNTS_IDENTITY_NETWORK";
|
|
67
|
+
COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED: "COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED";
|
|
68
|
+
COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED: "COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED";
|
|
69
|
+
COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR: "COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR";
|
|
70
|
+
COPILOT_ACCOUNTS_IDENTITY_CHANGED: "COPILOT_ACCOUNTS_IDENTITY_CHANGED";
|
|
71
|
+
COPILOT_ACCOUNTS_DUPLICATE: "COPILOT_ACCOUNTS_DUPLICATE";
|
|
72
|
+
COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED: "COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED";
|
|
73
|
+
COPILOT_ACCOUNTS_ROUTE_BLOCKED: "COPILOT_ACCOUNTS_ROUTE_BLOCKED";
|
|
74
|
+
COPILOT_ACCOUNTS_EVIDENCE_INCOMPLETE: "COPILOT_ACCOUNTS_EVIDENCE_INCOMPLETE";
|
|
75
|
+
COPILOT_ACCOUNTS_LIMIT: "COPILOT_ACCOUNTS_LIMIT";
|
|
76
|
+
COPILOT_ACCOUNTS_AUTH_FAILED: "COPILOT_ACCOUNTS_AUTH_FAILED";
|
|
77
|
+
COPILOT_ACCOUNTS_AUTH_UNAVAILABLE: "COPILOT_ACCOUNTS_AUTH_UNAVAILABLE";
|
|
78
|
+
COPILOT_ACCOUNTS_ACTIVE_REMOVE_BLOCKED: "COPILOT_ACCOUNTS_ACTIVE_REMOVE_BLOCKED";
|
|
79
|
+
COPILOT_ACCOUNTS_REMOVE_FAILED: "COPILOT_ACCOUNTS_REMOVE_FAILED";
|
|
80
|
+
COPILOT_ACCOUNTS_DISPOSED: "COPILOT_ACCOUNTS_DISPOSED";
|
|
81
|
+
}>>;
|
|
82
|
+
}, z.core.$strict>;
|
|
83
|
+
declare const contribution: TypertRemoteContribution;
|
|
84
|
+
export default contribution;
|
|
85
|
+
//# sourceMappingURL=copilot-accounts-remote.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const COPILOT_ACCOUNT_ID_PATTERN: RegExp;
|
|
2
|
+
export declare const COPILOT_ACCOUNTS_MAX = 32;
|
|
3
|
+
export declare const GITHUB_ACCOUNT_LOGIN_PATTERN: RegExp;
|
|
4
|
+
export declare const COPILOT_ACCOUNTS_DIAGNOSTICS: readonly ["COPILOT_ACCOUNTS_SELECTOR_INVALID", "COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE", "COPILOT_ACCOUNTS_SELECTED_MISSING", "COPILOT_ACCOUNTS_CREDENTIALS_UNAVAILABLE", "COPILOT_ACCOUNTS_CHANGED", "COPILOT_ACCOUNTS_BUSY", "COPILOT_ACCOUNTS_CONFLICT", "COPILOT_ACCOUNTS_COMMIT_UNCERTAIN", "COPILOT_ACCOUNTS_MODELS_FAILED", "COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE", "COPILOT_ACCOUNTS_IDENTITY_INVALID", "COPILOT_ACCOUNTS_IDENTITY_TIMEOUT", "COPILOT_ACCOUNTS_IDENTITY_TLS", "COPILOT_ACCOUNTS_IDENTITY_NETWORK", "COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED", "COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED", "COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR", "COPILOT_ACCOUNTS_IDENTITY_CHANGED", "COPILOT_ACCOUNTS_DUPLICATE", "COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED", "COPILOT_ACCOUNTS_ROUTE_BLOCKED", "COPILOT_ACCOUNTS_EVIDENCE_INCOMPLETE", "COPILOT_ACCOUNTS_LIMIT", "COPILOT_ACCOUNTS_AUTH_FAILED", "COPILOT_ACCOUNTS_AUTH_UNAVAILABLE", "COPILOT_ACCOUNTS_ACTIVE_REMOVE_BLOCKED", "COPILOT_ACCOUNTS_REMOVE_FAILED", "COPILOT_ACCOUNTS_DISPOSED"];
|
|
5
|
+
export type CopilotAccountsDiagnostic = typeof COPILOT_ACCOUNTS_DIAGNOSTICS[number];
|
|
6
|
+
export interface CopilotAccountIdentity {
|
|
7
|
+
readonly login: string;
|
|
8
|
+
readonly userId: number;
|
|
9
|
+
}
|
|
10
|
+
export interface CopilotAccountView {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly identity?: CopilotAccountIdentity;
|
|
13
|
+
readonly identityState: 'ready' | 'unavailable' | 'unknown';
|
|
14
|
+
readonly configured: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface CopilotAccountsNotice {
|
|
17
|
+
readonly message: string;
|
|
18
|
+
readonly url?: string;
|
|
19
|
+
readonly code?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CopilotAccountsView {
|
|
22
|
+
readonly state: 'ready' | 'error';
|
|
23
|
+
readonly activeAccountId: string;
|
|
24
|
+
readonly revision?: number;
|
|
25
|
+
readonly writable: boolean;
|
|
26
|
+
readonly switchable: boolean;
|
|
27
|
+
readonly accounts: readonly CopilotAccountView[];
|
|
28
|
+
readonly operation?: 'authorizing' | 'verifying' | 'switching';
|
|
29
|
+
readonly notices: readonly CopilotAccountsNotice[];
|
|
30
|
+
readonly diagnostic?: CopilotAccountsDiagnostic;
|
|
31
|
+
}
|
|
32
|
+
/** Host-only, immutable addressing. Never serialize this object into a Remote. */
|
|
33
|
+
export interface CopilotAccountBinding {
|
|
34
|
+
readonly accountId: string;
|
|
35
|
+
readonly key: string;
|
|
36
|
+
readonly generation: number;
|
|
37
|
+
assertCurrent(): void;
|
|
38
|
+
}
|
|
39
|
+
export interface CopilotAccountLease {
|
|
40
|
+
readonly binding: CopilotAccountBinding;
|
|
41
|
+
release(): void;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=copilot-accounts-types.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-side GitHub Copilot auth resolution over the same credential record
|
|
3
|
+
* that DSH's built-in llm-pi-ai adapter owns.
|
|
4
|
+
*/
|
|
5
|
+
import { type Context } from '@deepseek-ai/cordis';
|
|
6
|
+
import { type CredentialStore, type OAuthAuth } from '@earendil-works/pi-ai';
|
|
7
|
+
import { GITHUB_COPILOT_PROVIDER_ID, GITHUB_COPILOT_PREVIEW_PROVIDER_ID } from './copilot-identity.ts';
|
|
8
|
+
import type { GitHubCopilotOAuthCredential } from './copilot-grant.ts';
|
|
9
|
+
import type { CopilotAccountBinding } from './copilot-accounts-types.ts';
|
|
10
|
+
import type { CredentialChangeReason } from './request-diagnostics.ts';
|
|
11
|
+
export { normalizeGitHubCopilotOAuthCredential } from './copilot-grant.ts';
|
|
12
|
+
/** Only a validated native OAuth refresh may certify its exact returned object. */
|
|
13
|
+
export declare function certifyCopilotNativeRefresh(previous: GitHubCopilotOAuthCredential, result: GitHubCopilotOAuthCredential, derive: OAuthAuth['toAuth'], signal?: AbortSignal): Promise<void>;
|
|
14
|
+
/** Consume exactly one notification from the serialized, certified write. */
|
|
15
|
+
export declare function observeCopilotNativeRefresh(ctx: Context, key: string, diagnostic?: (phase: 'notification' | 'commit', reason: CredentialChangeReason) => void): Promise<boolean> | undefined;
|
|
16
|
+
export declare function captureActiveGitHubCopilotBinding(ctx: Context): CopilotAccountBinding | undefined;
|
|
17
|
+
/** Bind exactly one logical route to the canonical Host-owned credential record. */
|
|
18
|
+
export declare function createGitHubCopilotCredentialStore(ctx: Context, logicalProviderId?: typeof GITHUB_COPILOT_PROVIDER_ID | typeof GITHUB_COPILOT_PREVIEW_PROVIDER_ID, binding?: CopilotAccountBinding): CredentialStore;
|
|
19
|
+
/**
|
|
20
|
+
* Build one resolver whose pi-ai collection refreshes OAuth credentials inside
|
|
21
|
+
* the DSH record's serialized modify operation before exposing request auth.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createGitHubCopilotTokenResolver(ctx: Context, onCredentialChanged?: () => Promise<void>): (modelId: string) => Promise<GitHubCopilotRequestAuth | undefined>;
|
|
24
|
+
export interface GitHubCopilotRequestAuth {
|
|
25
|
+
readonly apiKey: string;
|
|
26
|
+
readonly baseURL: string;
|
|
27
|
+
readonly headers?: Readonly<Record<string, string | null>>;
|
|
28
|
+
}
|
|
29
|
+
/** Validate an OAuth-derived endpoint without disclosing its value or credential payload. */
|
|
30
|
+
export declare function trustedGitHubCopilotBaseUrl(value: string | undefined, grant: unknown): string;
|
|
31
|
+
//# sourceMappingURL=copilot-auth.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OAuthCredential } from '@earendil-works/pi-ai';
|
|
2
|
+
export interface GitHubCopilotOAuthCredential extends OAuthCredential {
|
|
3
|
+
readonly enterpriseUrl?: string;
|
|
4
|
+
readonly availableModelIds?: readonly string[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Rebuild pi-ai's GitHub Copilot grant as the exact JSON-safe provider shape.
|
|
8
|
+
* Prototype and unrelated extension members are intentionally not preserved.
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizeGitHubCopilotOAuthCredential(credential: unknown): GitHubCopilotOAuthCredential;
|
|
11
|
+
//# sourceMappingURL=copilot-grant.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Native OAuth ownership and the sole plugin-owned, account-discovered route. */
|
|
2
|
+
export declare const GITHUB_COPILOT_CREDENTIAL_KEY = "llm-pi-ai/github-copilot";
|
|
3
|
+
export declare const GITHUB_COPILOT_PROVIDER_ID = "github-copilot";
|
|
4
|
+
export declare const GITHUB_COPILOT_PREVIEW_PROVIDER_ID = "github-copilot-preview";
|
|
5
|
+
export declare const GITHUB_COPILOT_PREVIEW_MODEL_ID = "gpt-6-astra";
|
|
6
|
+
export declare const GITHUB_COPILOT_AUTO_MODEL_ID = "auto";
|
|
7
|
+
export declare const GITHUB_COPILOT_AUTO_EFFICIENCY_MODEL_ID = "auto-efficiency";
|
|
8
|
+
export declare const GITHUB_COPILOT_AUTO_INTELLIGENCE_MODEL_ID = "auto-intelligence";
|
|
9
|
+
export type AutoModelPreference = 'efficiency' | 'balance' | 'intelligence';
|
|
10
|
+
export declare function autoModelPreference(model: string): AutoModelPreference | undefined;
|
|
11
|
+
//# sourceMappingURL=copilot-identity.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SearchPlanCandidate } from './plan.ts';
|
|
2
|
+
export interface ResolvedRequestAuth {
|
|
3
|
+
readonly apiKey: string;
|
|
4
|
+
readonly baseURL?: string;
|
|
5
|
+
readonly headers?: Readonly<Record<string, string | null>>;
|
|
6
|
+
}
|
|
7
|
+
export declare function normalizeRequestAuth(auth: string | ResolvedRequestAuth | undefined): ResolvedRequestAuth | undefined;
|
|
8
|
+
export declare function applyRequestAuth(candidate: SearchPlanCandidate, auth: ResolvedRequestAuth): SearchPlanCandidate;
|
|
9
|
+
/** Materialize pi-ai catalog headers and Copilot's per-request metadata. */
|
|
10
|
+
export declare function providerRequestHeaders(candidate: SearchPlanCandidate, initiator: 'agent' | 'user'): Readonly<Record<string, string>>;
|
|
11
|
+
//# sourceMappingURL=copilot-request.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class CopilotStreamIdleError extends Error {
|
|
2
|
+
readonly timeoutMs: number;
|
|
3
|
+
constructor(timeoutMs: number, stage?: string, requestBytes?: number);
|
|
4
|
+
}
|
|
5
|
+
/** A request-local byte-idle bound; the native adapter separately bounds semantic silence. */
|
|
6
|
+
export declare class CopilotStreamLiveness {
|
|
7
|
+
private readonly timeoutMs;
|
|
8
|
+
private readonly controller;
|
|
9
|
+
private timer;
|
|
10
|
+
private disposed;
|
|
11
|
+
private paused;
|
|
12
|
+
private stage;
|
|
13
|
+
private requestBytes;
|
|
14
|
+
readonly signal: AbortSignal;
|
|
15
|
+
constructor(timeoutMs: number, upstream: AbortSignal);
|
|
16
|
+
pulse(): void;
|
|
17
|
+
beginRequest(body?: string): void;
|
|
18
|
+
pause(): void;
|
|
19
|
+
resume(): void;
|
|
20
|
+
observe(response: Response): Response;
|
|
21
|
+
dispose: () => void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=copilot-stream-liveness.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { CopilotUsageView } from './copilot-usage-types.ts';
|
|
3
|
+
import type { CopilotAccountsRemote } from './copilot-accounts-card.ts';
|
|
4
|
+
import type { SessionAccountView } from './session-accounts-remote.ts';
|
|
5
|
+
/** Client-only face: no credentials, provider transport or billing arithmetic. */
|
|
6
|
+
export interface CopilotUsageRemote {
|
|
7
|
+
get(): Promise<{
|
|
8
|
+
ok: true;
|
|
9
|
+
value: CopilotUsageView;
|
|
10
|
+
} | {
|
|
11
|
+
ok: false;
|
|
12
|
+
error: unknown;
|
|
13
|
+
}>;
|
|
14
|
+
refresh(): Promise<{
|
|
15
|
+
ok: true;
|
|
16
|
+
value: CopilotUsageView;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
error: unknown;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
export interface CopilotUsageCardProps {
|
|
23
|
+
remote?: CopilotUsageRemote;
|
|
24
|
+
accountsRemote?: Pick<CopilotAccountsRemote, 'get' | 'refreshIdentity' | 'ensureIdentity'>;
|
|
25
|
+
/** Changes revoke every in-flight read, including switches between Copilot routes. */
|
|
26
|
+
contextKey: string;
|
|
27
|
+
locale?: string;
|
|
28
|
+
continuation?: ReactElement;
|
|
29
|
+
onManage?: () => void;
|
|
30
|
+
/** Parent-owned consent; check the request signal after awaits and dismiss on abort. */
|
|
31
|
+
beforeAccountChange?: (accountId: string | null, signal: AbortSignal) => Promise<boolean>;
|
|
32
|
+
sessionAccount?: {
|
|
33
|
+
get(): Promise<{
|
|
34
|
+
ok: true;
|
|
35
|
+
value: SessionAccountView;
|
|
36
|
+
} | {
|
|
37
|
+
ok: false;
|
|
38
|
+
error: unknown;
|
|
39
|
+
}>;
|
|
40
|
+
set(accountId: string | null, revision: number): Promise<{
|
|
41
|
+
ok: true;
|
|
42
|
+
value: SessionAccountView;
|
|
43
|
+
} | {
|
|
44
|
+
ok: false;
|
|
45
|
+
error: unknown;
|
|
46
|
+
}>;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Mounted only for a proven effective Copilot selection in the owning Session. */
|
|
50
|
+
export declare function CopilotUsageCard(props: CopilotUsageCardProps): ReactElement;
|
|
51
|
+
//# sourceMappingURL=copilot-usage-card.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
|
+
import { Agent } from 'undici';
|
|
4
|
+
import type { CopilotUsageView } from './copilot-usage-types.ts';
|
|
5
|
+
import type { CopilotAccountBinding } from './copilot-accounts-types.ts';
|
|
6
|
+
export declare const COPILOT_USAGE_ENDPOINT = "https://api.github.com/copilot_internal/user";
|
|
7
|
+
interface Dependencies {
|
|
8
|
+
readonly accountId?: string;
|
|
9
|
+
readCredential(): Promise<unknown>;
|
|
10
|
+
fetch?: typeof globalThis.fetch;
|
|
11
|
+
now?: () => number;
|
|
12
|
+
getCACertificates?: (type: 'default' | 'system') => string[];
|
|
13
|
+
createDispatcher?: (options: Agent.Options) => Agent;
|
|
14
|
+
}
|
|
15
|
+
/** One Host-owned, memory-only account cache. No auth renewal, persistence or model transport. */
|
|
16
|
+
export declare class CopilotUsageSource {
|
|
17
|
+
private readonly dependencies;
|
|
18
|
+
private readonly fetcher;
|
|
19
|
+
private readonly now;
|
|
20
|
+
private dispatcher;
|
|
21
|
+
private generation;
|
|
22
|
+
private disposed;
|
|
23
|
+
private key;
|
|
24
|
+
private cached;
|
|
25
|
+
private last;
|
|
26
|
+
private nextRefreshAt;
|
|
27
|
+
private failureUntil;
|
|
28
|
+
private flight;
|
|
29
|
+
constructor(dependencies: Dependencies);
|
|
30
|
+
invalidate(): void;
|
|
31
|
+
dispose(): Promise<void>;
|
|
32
|
+
get(): Promise<CopilotUsageView>;
|
|
33
|
+
refresh(): Promise<CopilotUsageView>;
|
|
34
|
+
private active;
|
|
35
|
+
private readAuth;
|
|
36
|
+
private assertCurrent;
|
|
37
|
+
private diagnostic;
|
|
38
|
+
private quotaDispatcher;
|
|
39
|
+
private load;
|
|
40
|
+
private fetchQuota;
|
|
41
|
+
private request;
|
|
42
|
+
}
|
|
43
|
+
declare module '@deepseek-ai/cordis' {
|
|
44
|
+
interface Context {
|
|
45
|
+
githubCopilotUsage: GitHubCopilotUsageController;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export default class GitHubCopilotUsageController extends TypertRemoteService {
|
|
49
|
+
private readonly accountSources;
|
|
50
|
+
private source;
|
|
51
|
+
private accountSignature;
|
|
52
|
+
private sourceInitialized;
|
|
53
|
+
constructor(ctx: Context);
|
|
54
|
+
forAccount(binding: CopilotAccountBinding, force?: boolean): Promise<CopilotUsageView>;
|
|
55
|
+
private createSource;
|
|
56
|
+
private current;
|
|
57
|
+
get(): Promise<CopilotUsageView>;
|
|
58
|
+
refresh(): Promise<CopilotUsageView>;
|
|
59
|
+
}
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=copilot-usage-host.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CopilotUsageView, CopilotUsageDiagnostic } from './copilot-usage-types.ts';
|
|
2
|
+
export declare function unavailableCopilotUsage(diagnostic: CopilotUsageDiagnostic, billing?: CopilotUsageView['billing'], budget?: CopilotUsageView['budget']): CopilotUsageView;
|
|
3
|
+
/**
|
|
4
|
+
* Pinned VS Code 44825207: parseQuotas/getQuotaUsage and chatStatusDashboard
|
|
5
|
+
* display account amounts directly. Only per-turn nano-AIU uses /1e9; it is
|
|
6
|
+
* intentionally absent here. Pooled credits_used never shares an entitlement.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeCopilotUsage(input: unknown, observedAt: number): CopilotUsageView;
|
|
9
|
+
//# sourceMappingURL=copilot-usage-normalize.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { CopilotUsageView } from './copilot-usage-types.ts';
|
|
4
|
+
export type { CopilotUsageView } from './copilot-usage-types.ts';
|
|
5
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
6
|
+
interface TypertRemoteNamespaceMap {
|
|
7
|
+
githubCopilotUsage: {
|
|
8
|
+
get(): Promise<RemoteResult<CopilotUsageView>>;
|
|
9
|
+
refresh(): Promise<RemoteResult<CopilotUsageView>>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export declare const CopilotUsageViewSchema: z.ZodObject<{
|
|
14
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
15
|
+
state: z.ZodEnum<{
|
|
16
|
+
ready: "ready";
|
|
17
|
+
unavailable: "unavailable";
|
|
18
|
+
stale: "stale";
|
|
19
|
+
"signed-out": "signed-out";
|
|
20
|
+
}>;
|
|
21
|
+
billing: z.ZodEnum<{
|
|
22
|
+
unknown: "unknown";
|
|
23
|
+
requests: "requests";
|
|
24
|
+
credits: "credits";
|
|
25
|
+
}>;
|
|
26
|
+
budget: z.ZodEnum<{
|
|
27
|
+
unknown: "unknown";
|
|
28
|
+
individual: "individual";
|
|
29
|
+
pooled: "pooled";
|
|
30
|
+
}>;
|
|
31
|
+
used: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
remaining: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
percentUsed: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
resetAt: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
observedAt: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
diagnostic: z.ZodOptional<z.ZodEnum<{
|
|
38
|
+
COPILOT_USAGE_SIGNED_OUT: "COPILOT_USAGE_SIGNED_OUT";
|
|
39
|
+
COPILOT_USAGE_INVALID_GRANT: "COPILOT_USAGE_INVALID_GRANT";
|
|
40
|
+
COPILOT_USAGE_CREDENTIALS_UNAVAILABLE: "COPILOT_USAGE_CREDENTIALS_UNAVAILABLE";
|
|
41
|
+
COPILOT_USAGE_ENTERPRISE_UNSUPPORTED: "COPILOT_USAGE_ENTERPRISE_UNSUPPORTED";
|
|
42
|
+
COPILOT_USAGE_ACCOUNT_CHANGED: "COPILOT_USAGE_ACCOUNT_CHANGED";
|
|
43
|
+
COPILOT_USAGE_DISPOSED: "COPILOT_USAGE_DISPOSED";
|
|
44
|
+
COPILOT_USAGE_BILLING_UNKNOWN: "COPILOT_USAGE_BILLING_UNKNOWN";
|
|
45
|
+
COPILOT_USAGE_SNAPSHOT_MISSING: "COPILOT_USAGE_SNAPSHOT_MISSING";
|
|
46
|
+
COPILOT_USAGE_INVALID_RESPONSE: "COPILOT_USAGE_INVALID_RESPONSE";
|
|
47
|
+
COPILOT_USAGE_POOLED_UNAVAILABLE: "COPILOT_USAGE_POOLED_UNAVAILABLE";
|
|
48
|
+
COPILOT_USAGE_POOLED_EXHAUSTED: "COPILOT_USAGE_POOLED_EXHAUSTED";
|
|
49
|
+
COPILOT_USAGE_NO_ALLOCATION: "COPILOT_USAGE_NO_ALLOCATION";
|
|
50
|
+
COPILOT_USAGE_NETWORK: "COPILOT_USAGE_NETWORK";
|
|
51
|
+
COPILOT_USAGE_TLS: "COPILOT_USAGE_TLS";
|
|
52
|
+
COPILOT_USAGE_TRUST_UNAVAILABLE: "COPILOT_USAGE_TRUST_UNAVAILABLE";
|
|
53
|
+
COPILOT_USAGE_TIMEOUT: "COPILOT_USAGE_TIMEOUT";
|
|
54
|
+
COPILOT_USAGE_BODY_TOO_LARGE: "COPILOT_USAGE_BODY_TOO_LARGE";
|
|
55
|
+
COPILOT_USAGE_REDIRECT: "COPILOT_USAGE_REDIRECT";
|
|
56
|
+
COPILOT_USAGE_AUTH_REJECTED: "COPILOT_USAGE_AUTH_REJECTED";
|
|
57
|
+
COPILOT_USAGE_HTTP_ERROR: "COPILOT_USAGE_HTTP_ERROR";
|
|
58
|
+
COPILOT_USAGE_RATE_LIMITED: "COPILOT_USAGE_RATE_LIMITED";
|
|
59
|
+
}>>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
declare const contribution: TypertRemoteContribution;
|
|
62
|
+
export default contribution;
|
|
63
|
+
//# sourceMappingURL=copilot-usage-remote.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Client-safe account snapshot. Amounts are credits or requests, never token estimates. */
|
|
2
|
+
export interface CopilotUsageView {
|
|
3
|
+
readonly accountId?: string;
|
|
4
|
+
readonly state: 'ready' | 'stale' | 'unavailable' | 'signed-out';
|
|
5
|
+
readonly billing: 'credits' | 'requests' | 'unknown';
|
|
6
|
+
readonly budget: 'individual' | 'pooled' | 'unknown';
|
|
7
|
+
readonly used?: number;
|
|
8
|
+
readonly remaining?: number;
|
|
9
|
+
readonly limit?: number;
|
|
10
|
+
readonly percentUsed?: number;
|
|
11
|
+
/** Supplier-reported next reset in Unix epoch milliseconds, later than observedAt. */
|
|
12
|
+
readonly resetAt?: number;
|
|
13
|
+
readonly observedAt?: number;
|
|
14
|
+
readonly diagnostic?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const COPILOT_USAGE_MAX_AMOUNT = 1000000000000;
|
|
17
|
+
export declare const COPILOT_USAGE_MAX_TIMESTAMP = 253402300799999;
|
|
18
|
+
export declare const COPILOT_USAGE_DIAGNOSTICS: readonly ["COPILOT_USAGE_SIGNED_OUT", "COPILOT_USAGE_INVALID_GRANT", "COPILOT_USAGE_CREDENTIALS_UNAVAILABLE", "COPILOT_USAGE_ENTERPRISE_UNSUPPORTED", "COPILOT_USAGE_ACCOUNT_CHANGED", "COPILOT_USAGE_DISPOSED", "COPILOT_USAGE_BILLING_UNKNOWN", "COPILOT_USAGE_SNAPSHOT_MISSING", "COPILOT_USAGE_INVALID_RESPONSE", "COPILOT_USAGE_POOLED_UNAVAILABLE", "COPILOT_USAGE_POOLED_EXHAUSTED", "COPILOT_USAGE_NO_ALLOCATION", "COPILOT_USAGE_NETWORK", "COPILOT_USAGE_TLS", "COPILOT_USAGE_TRUST_UNAVAILABLE", "COPILOT_USAGE_TIMEOUT", "COPILOT_USAGE_BODY_TOO_LARGE", "COPILOT_USAGE_REDIRECT", "COPILOT_USAGE_AUTH_REJECTED", "COPILOT_USAGE_HTTP_ERROR", "COPILOT_USAGE_RATE_LIMITED"];
|
|
19
|
+
export type CopilotUsageDiagnostic = typeof COPILOT_USAGE_DIAGNOSTICS[number];
|
|
20
|
+
//# sourceMappingURL=copilot-usage-types.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
/** Public additive dock only; native composer, ContextMeter and other features stay owned by Core. */
|
|
3
|
+
export declare function registerCopilotUsageUi(ctx: Context): () => void;
|
|
4
|
+
//# sourceMappingURL=copilot-usage-ui.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detection of an operation's provider route: the initiating Agent or explicit
|
|
3
|
+
* request names a route and model, the `llm-pi-ai` settings
|
|
4
|
+
* section carries the route's profile, and the pi-ai catalog supplies the
|
|
5
|
+
* defaults (wire protocol, base URL) a profile that overrides nothing inherits.
|
|
6
|
+
* The probe and plan modules read this to decide which search-capable
|
|
7
|
+
* protocol to use without any configuration.
|
|
8
|
+
* @module dsh-github-copilot/current-provider
|
|
9
|
+
*/
|
|
10
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
11
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
12
|
+
/** The resolved chat-route facts this package consumes. */
|
|
13
|
+
export interface CurrentChatRoute {
|
|
14
|
+
/** Registered provider route key (the llm-pi-ai `providers` dict key). */
|
|
15
|
+
readonly provider: string;
|
|
16
|
+
/** Provider-owned model id. */
|
|
17
|
+
readonly model: string;
|
|
18
|
+
/** Wire protocol the route speaks, when determinable. */
|
|
19
|
+
readonly api?: string;
|
|
20
|
+
/** Endpoint base the route's requests go to. */
|
|
21
|
+
readonly baseURL?: string;
|
|
22
|
+
/** Credential reference the route resolves its key through. */
|
|
23
|
+
readonly apiKeyEnv?: string;
|
|
24
|
+
/** All interactive APIs advertised by this route's selected model. */
|
|
25
|
+
readonly supportedApis?: readonly string[];
|
|
26
|
+
/** Static provider/model request headers from pi-ai's catalog. */
|
|
27
|
+
readonly headers?: Readonly<Record<string, string | null>>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Read the public asynchronous initiator seam when supported by Core.
|
|
31
|
+
* Older Core and agentless callers have no session selection; never substitute
|
|
32
|
+
* the default-model service or an arbitrary registered Agent.
|
|
33
|
+
* @param ctx - Host context with the optional Agent registry.
|
|
34
|
+
* @returns the initiating Agent, or undefined when the capability/caller is absent.
|
|
35
|
+
*/
|
|
36
|
+
export declare function currentSearchInitiator(ctx: Context): Agent | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Capture the initiating Session's effective request route. Agent.options is
|
|
39
|
+
* only an activation seed; Core model-selection waterfalls need not update it.
|
|
40
|
+
* @param agent - initiating Agent recovered at the operation entry.
|
|
41
|
+
* @returns provider/model leaves from the last committed request header, or none.
|
|
42
|
+
*/
|
|
43
|
+
export declare function currentSearchSelection(agent: Agent | undefined): {
|
|
44
|
+
provider: string;
|
|
45
|
+
model: string;
|
|
46
|
+
} | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Resolve one operation's route. Explicit GenerateOptions fields are already
|
|
49
|
+
* resolved by Core and take precedence; otherwise use the initiating Session's
|
|
50
|
+
* effective request header. Missing request evidence fails closed.
|
|
51
|
+
* @param ctx - context used for public initiator, settings and catalog reads.
|
|
52
|
+
* @param explicit - explicit request selection, captured at operation entry.
|
|
53
|
+
* @returns owned route facts, or undefined without a usable selection.
|
|
54
|
+
*/
|
|
55
|
+
export declare function currentChatRoute(ctx: Context, explicit?: {
|
|
56
|
+
readonly provider?: string;
|
|
57
|
+
readonly model?: string;
|
|
58
|
+
}): CurrentChatRoute | undefined;
|
|
59
|
+
//# sourceMappingURL=current-provider.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { WebSearchProvider } from '@deepseek-ai/dsh-web';
|
|
4
|
+
/**
|
|
5
|
+
* Compose a known official fallback only when permitted. The public native class
|
|
6
|
+
* owns transport, redirects and parsing. A per-operation instance keeps backend
|
|
7
|
+
* disclosure aligned with that operation's options even during concurrent calls.
|
|
8
|
+
* canContinue must be the initiating router's captured operation-local guard.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createDeepSeekSearchFallback(ctx: Context, owner: Agent | undefined, canContinue: () => boolean): Promise<WebSearchProvider>;
|
|
11
|
+
//# sourceMappingURL=deepseek-search-fallback.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const DIAGNOSTICS_ANALYSIS_MAX_INPUT_BYTES: number;
|
|
2
|
+
interface FileStat {
|
|
3
|
+
isFile(): boolean;
|
|
4
|
+
isSymbolicLink(): boolean;
|
|
5
|
+
size: number;
|
|
6
|
+
mtimeMs: number;
|
|
7
|
+
dev: number;
|
|
8
|
+
ino: number;
|
|
9
|
+
}
|
|
10
|
+
interface ReadHandle {
|
|
11
|
+
stat(): Promise<FileStat>;
|
|
12
|
+
read(buffer: Buffer, offset: number, length: number, position: number): Promise<{
|
|
13
|
+
bytesRead: number;
|
|
14
|
+
}>;
|
|
15
|
+
close(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export interface DiagnosticsAnalysisFileSystem {
|
|
18
|
+
lstat(path: string): Promise<FileStat>;
|
|
19
|
+
open(path: string, flags: 'r'): Promise<ReadHandle>;
|
|
20
|
+
}
|
|
21
|
+
export declare function readBoundedDiagnosticsFile(filePath: string, io?: DiagnosticsAnalysisFileSystem): Promise<string>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=diagnostics-analysis-io.d.ts.map
|