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,50 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { WebRuntime } from '@deepseek-ai/dsh-web';
|
|
3
|
+
import type { WebRuntimeConfig, WebSearchRequest, WebSearchResult, WebSearchProvider, WebFetchProvider, WebFetchRequest, WebFetchResult } from '@deepseek-ai/dsh-web';
|
|
4
|
+
/** Parent dispatch captured from the exact WebRuntime instance serving this call. */
|
|
5
|
+
export type NativeSearch = (request: WebSearchRequest, signal?: AbortSignal) => Promise<WebSearchResult>;
|
|
6
|
+
/** Exact-id dispatch over providers registered through the routed facade. */
|
|
7
|
+
export type ProviderSearch = (providerId: string, request: WebSearchRequest, signal?: AbortSignal) => Promise<WebSearchResult>;
|
|
8
|
+
/** Captured facade registration; no provider implementation object crosses the Client boundary. */
|
|
9
|
+
export interface CapturedSearchProvider {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly signal: AbortSignal;
|
|
12
|
+
current(): boolean;
|
|
13
|
+
/** Identity proof for a router-owned provider, never an inference from its id. */
|
|
14
|
+
owns(provider: WebSearchProvider): boolean;
|
|
15
|
+
search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult>;
|
|
16
|
+
}
|
|
17
|
+
/** Resolve one registered id synchronously before the routing operation starts awaiting. */
|
|
18
|
+
export type CaptureSearchProvider = (providerId: string) => CapturedSearchProvider | undefined;
|
|
19
|
+
/** Host-owned router; credentials and provider implementation objects stay inside the facade. */
|
|
20
|
+
export interface GitHubCopilotSearchRouter {
|
|
21
|
+
search(request: WebSearchRequest, signal: AbortSignal | undefined, delegate: NativeSearch, selectProvider?: ProviderSearch, captureSearchProvider?: CaptureSearchProvider): Promise<WebSearchResult>;
|
|
22
|
+
}
|
|
23
|
+
declare module '@deepseek-ai/cordis' {
|
|
24
|
+
interface Context {
|
|
25
|
+
githubCopilotSearchRouter: GitHubCopilotSearchRouter;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Plugin-owned WebRuntime facade. The bundle isolates, but does not reconfigure,
|
|
30
|
+
* the original official service. Normal search, fetch and registrations delegate
|
|
31
|
+
* through its public APIs. A second private official WebRuntime supplies the same
|
|
32
|
+
* validation/source cap for the Copilot branch. No Core prototypes or private
|
|
33
|
+
* registries are read or changed.
|
|
34
|
+
*/
|
|
35
|
+
export default class CopilotRoutedWeb extends WebRuntime {
|
|
36
|
+
static inject: string[];
|
|
37
|
+
private readonly bounded;
|
|
38
|
+
private readonly lifetime;
|
|
39
|
+
private readonly pending;
|
|
40
|
+
private readonly mirroredSearchProviders;
|
|
41
|
+
constructor(ctx: Context, config?: WebRuntimeConfig);
|
|
42
|
+
private disposedError;
|
|
43
|
+
private searchWithProvider;
|
|
44
|
+
private captureSearchProvider;
|
|
45
|
+
registerSearchProvider(provider: WebSearchProvider): () => void;
|
|
46
|
+
registerFetchProvider(provider: WebFetchProvider): () => void;
|
|
47
|
+
fetch(request: WebFetchRequest, signal?: AbortSignal): Promise<WebFetchResult>;
|
|
48
|
+
search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult>;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=routed-web.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { WebError } from '@deepseek-ai/dsh-web';
|
|
2
|
+
/** Safe request-option leaves; never includes auth, URL path/query or opaque provider state. */
|
|
3
|
+
export interface SearchBackend {
|
|
4
|
+
readonly provider: 'deepseek-official';
|
|
5
|
+
readonly origin: string;
|
|
6
|
+
readonly model: string;
|
|
7
|
+
readonly customEndpoint: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Bounded metadata included in the same query's successful or failed fallback notice. */
|
|
10
|
+
export declare function describeSearchBackend(backend: SearchBackend): string;
|
|
11
|
+
/** Known sanitized failure, distinct from arbitrary native provider exception messages. */
|
|
12
|
+
export declare class DescribedSearchFallbackError extends WebError {
|
|
13
|
+
readonly backend: SearchBackend | undefined;
|
|
14
|
+
constructor(backend: SearchBackend | undefined, code?: WebError['code']);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=search-backend.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Read-only search catalog bridge; no credentials, availability probes or writes. */
|
|
2
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
4
|
+
import type { SearchProviderCatalog } from './search-routing-remote.ts';
|
|
5
|
+
export interface SearchProviderDirectory {
|
|
6
|
+
/** Fresh IDs from facade-owned registrations, not a process-wide registry. */
|
|
7
|
+
list(): readonly string[];
|
|
8
|
+
}
|
|
9
|
+
declare module '@deepseek-ai/cordis' {
|
|
10
|
+
interface Context {
|
|
11
|
+
githubCopilotSearchCatalog: SearchProviderDirectory;
|
|
12
|
+
githubCopilotSearchRouting: SearchRoutingController;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export default class SearchRoutingController extends TypertRemoteService {
|
|
16
|
+
constructor(ctx: Context);
|
|
17
|
+
providers(): SearchProviderCatalog;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=search-routing-host.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Shared Client-safe settings shape; provider credentials and models remain provider-owned. */
|
|
2
|
+
export interface WebSearchRoutingConfig {
|
|
3
|
+
/** Auto follows the initiating Chat provider; a concrete id pins the primary, and none disables search. */
|
|
4
|
+
searchProvider?: string;
|
|
5
|
+
/** Legacy primary selection; used only when searchProvider has not been explicitly saved. */
|
|
6
|
+
searchMode?: 'auto' | 'fixed';
|
|
7
|
+
/** Final fallback provider id, or none; legacy fixed mode also uses this id as its primary. */
|
|
8
|
+
defaultSearchProvider?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Operation-local normalized policy; reading legacy settings never migrates them on disk. */
|
|
11
|
+
export interface NormalizedWebSearchRouting {
|
|
12
|
+
readonly primaryProvider: string;
|
|
13
|
+
readonly defaultProvider: string;
|
|
14
|
+
readonly legacy: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Resolve old and new settings without guessing registered providers or dropping unknown ids. */
|
|
17
|
+
export declare function normalizeWebSearchRouting(config: WebSearchRoutingConfig): NormalizedWebSearchRouting;
|
|
18
|
+
//# sourceMappingURL=search-routing-policy.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Client-safe catalog of search registrations observed by the routed facade. */
|
|
2
|
+
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export declare const SearchProviderCatalogSchema: z.ZodObject<{
|
|
5
|
+
supported: z.ZodBoolean;
|
|
6
|
+
providers: z.ZodArray<z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
}, z.core.$strict>>;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export type SearchProviderCatalog = z.infer<typeof SearchProviderCatalogSchema>;
|
|
11
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
12
|
+
interface TypertRemoteNamespaceMap {
|
|
13
|
+
githubCopilotSearchRouting: {
|
|
14
|
+
providers(): Promise<RemoteResult<SearchProviderCatalog>>;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
declare const contribution: TypertRemoteContribution;
|
|
19
|
+
export default contribution;
|
|
20
|
+
//# sourceMappingURL=search-routing-remote.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { WebSearchProvider, WebSearchRequest, WebSearchResult } from '@deepseek-ai/dsh-web';
|
|
2
|
+
/** Explicit cross-provider spending policy; disabled unless the operator selects DeepSeek. */
|
|
3
|
+
export type SearchFallback = 'none' | 'deepseek';
|
|
4
|
+
/** Selection captured from the initiating request, never from a global default. */
|
|
5
|
+
export interface SearchSelection {
|
|
6
|
+
readonly provider: string;
|
|
7
|
+
readonly model: string;
|
|
8
|
+
}
|
|
9
|
+
/** Public, non-secret provenance retained outside the canonical WebSearchResult. */
|
|
10
|
+
export interface SearchRouting {
|
|
11
|
+
readonly requestedProvider: 'github-copilot-hosted';
|
|
12
|
+
readonly actualProvider: 'github-copilot-hosted' | 'deepseek-official';
|
|
13
|
+
readonly model: string;
|
|
14
|
+
readonly fallback: boolean;
|
|
15
|
+
readonly reason?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Delegated results have no plugin provenance and retain their original object identity. */
|
|
18
|
+
export interface RoutedSearchResult {
|
|
19
|
+
readonly result: WebSearchResult;
|
|
20
|
+
readonly routing?: SearchRouting;
|
|
21
|
+
}
|
|
22
|
+
/** Operation-local dependencies; providers must be owned instances, not private-registry lookups. */
|
|
23
|
+
export interface SessionSearchDependencies {
|
|
24
|
+
readonly selection: SearchSelection | undefined;
|
|
25
|
+
readonly managedOwned: boolean;
|
|
26
|
+
readonly fallback: SearchFallback;
|
|
27
|
+
readonly copilot: WebSearchProvider;
|
|
28
|
+
readonly delegate: (request: WebSearchRequest, signal?: AbortSignal) => Promise<WebSearchResult>;
|
|
29
|
+
readonly resolveDeepSeek: () => Promise<WebSearchProvider>;
|
|
30
|
+
/** Recheck captured owner/account generation after every asynchronous boundary. */
|
|
31
|
+
readonly canContinue: () => boolean;
|
|
32
|
+
}
|
|
33
|
+
/** Match only the canonical route or a verified plugin-owned managed route. */
|
|
34
|
+
export declare function isCopilotSearchSelection(selection: SearchSelection | undefined, managedOwned: boolean): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Route one already-validated search using captured request identity.
|
|
37
|
+
* Non-Copilot calls delegate untouched. Copilot failures reach a known DeepSeek
|
|
38
|
+
* provider only under the explicit spending policy; cancellation and invalidated
|
|
39
|
+
* ownership never trigger fallback. Consumer validation, batching and deadlines
|
|
40
|
+
* remain the caller's responsibility, not this provider-selection function.
|
|
41
|
+
*/
|
|
42
|
+
export declare function routeSessionSearch(request: WebSearchRequest, signal: AbortSignal | undefined, deps: SessionSearchDependencies): Promise<RoutedSearchResult>;
|
|
43
|
+
//# sourceMappingURL=search-routing.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { WebSearchRequest, WebSearchResult } from '@deepseek-ai/dsh-web';
|
|
2
|
+
/** An already selected, operation-owned search entry; availability remains its owner's responsibility. */
|
|
3
|
+
export interface SearchToolProvider {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult>;
|
|
6
|
+
}
|
|
7
|
+
/** Captured policy for one primary attempt and at most one distinct final fallback. */
|
|
8
|
+
export interface SearchToolRoutingDependencies {
|
|
9
|
+
readonly primary?: SearchToolProvider | undefined;
|
|
10
|
+
readonly fallback?: SearchToolProvider | undefined;
|
|
11
|
+
/** False, or a thrown error, revokes this operation without permitting fallback. */
|
|
12
|
+
readonly canContinue: () => boolean;
|
|
13
|
+
/** Legacy failure-spending control; does not prevent fallback when no primary was resolved. */
|
|
14
|
+
readonly allowFailureFallback?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Execute a captured primary and optional final fallback without registry or credential access.
|
|
18
|
+
* The caller resolves Auto, handles disabled policy, proves registrations and supplies lifetime guards.
|
|
19
|
+
* Generic providers must honor the signal; this helper cannot inspect their internal auth/HTTP boundary.
|
|
20
|
+
*/
|
|
21
|
+
export declare function routeSearchTools(request: WebSearchRequest, signal: AbortSignal | undefined, deps: SearchToolRoutingDependencies): Promise<WebSearchResult>;
|
|
22
|
+
//# sourceMappingURL=search-tool-routing.d.ts.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text/tool serialization for the inline wire path, plus server-side web
|
|
3
|
+
* search injection. Reasoning and opaque replay histories remain Core-owned;
|
|
4
|
+
* this limited serializer refuses them instead of inventing Responses items.
|
|
5
|
+
* @module dsh-github-copilot/serialize
|
|
6
|
+
*/
|
|
7
|
+
import type { GenerateOptions, RequestMessage, ToolSchema } from '@deepseek-ai/dsh-llm';
|
|
8
|
+
import type { ResponsesWebSearchToolType } from './plan.ts';
|
|
9
|
+
import type { InlineConfig } from './config.ts';
|
|
10
|
+
/** Mapped only after the selected model's native capability checks succeed. */
|
|
11
|
+
export interface ResponsesReasoningOptions {
|
|
12
|
+
readonly effort: string;
|
|
13
|
+
readonly summary: 'auto';
|
|
14
|
+
}
|
|
15
|
+
/** Keep Core-owned reasoning provenance and opaque replay state out of this serializer. */
|
|
16
|
+
export declare function hasResponsesReplayContext(messages: readonly RequestMessage[]): boolean;
|
|
17
|
+
/** Thrown for content whose projection must remain with Core. */
|
|
18
|
+
export declare class UnsupportedContentError extends Error {
|
|
19
|
+
constructor(detail: string);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Stable short hash (FNV-1a variant) for synthesizing item ids.
|
|
23
|
+
* @param input - any string.
|
|
24
|
+
* @returns an 8-character base36 string.
|
|
25
|
+
*/
|
|
26
|
+
export declare function shortHash(input: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Split a harness call id into the Responses `call_id`/`id` pair. Harness
|
|
29
|
+
* ids produced by the pi-ai adapter carry the `call_id|item_id` shape; ids
|
|
30
|
+
* from other origins get a synthesized item id.
|
|
31
|
+
* @param id - the harness tool-call id.
|
|
32
|
+
* @returns the call id and item id.
|
|
33
|
+
*/
|
|
34
|
+
export declare function splitCallId(id: string): {
|
|
35
|
+
callId: string;
|
|
36
|
+
itemId: string;
|
|
37
|
+
};
|
|
38
|
+
export declare function flattenText(content: readonly unknown[]): string;
|
|
39
|
+
/** Detect a grounded sandbox denial in either current tool-role or retained legacy message layout. */
|
|
40
|
+
export declare function hasToolResultText(message: RequestMessage, needle: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Serialize one dsh message into Responses input items.
|
|
43
|
+
* @param message - the harness message.
|
|
44
|
+
* @returns the wire input items; may be empty for content-free messages.
|
|
45
|
+
* @throws UnsupportedContentError for image or Core-owned reasoning/replay content.
|
|
46
|
+
*/
|
|
47
|
+
export declare function serializeMessage(message: RequestMessage, pairedCallIds?: ReadonlySet<string>): unknown[];
|
|
48
|
+
/**
|
|
49
|
+
* Return call ids that have both an assistant function call and a user tool
|
|
50
|
+
* result. Responses rejects either half when replayed alone, which can happen
|
|
51
|
+
* when a prior provider/tool failure ended the step before persistence wrote
|
|
52
|
+
* the matching result.
|
|
53
|
+
*/
|
|
54
|
+
export declare function pairedToolCallIds(messages: readonly RequestMessage[]): ReadonlySet<string>;
|
|
55
|
+
/**
|
|
56
|
+
* Build the wire tools array: function tools (optionally stripped of the
|
|
57
|
+
* variants shadowed by server-side web tools) plus the server-side web
|
|
58
|
+
* search tool in the candidate's verified spelling.
|
|
59
|
+
* @param tools - the harness tool schemas.
|
|
60
|
+
* @param stripServerTools - whether to drop the shadowed function variants.
|
|
61
|
+
* @param webSearchToolType - the Responses spelling the probe verified.
|
|
62
|
+
* @returns the wire tools array.
|
|
63
|
+
*/
|
|
64
|
+
export declare function wireTools(tools: readonly ToolSchema[] | undefined, stripServerTools: boolean, webSearchToolType: ResponsesWebSearchToolType): unknown[];
|
|
65
|
+
/**
|
|
66
|
+
* Build the complete Responses request body for one inline call.
|
|
67
|
+
* @param request - the harness request.
|
|
68
|
+
* @param cfg - the wire controls.
|
|
69
|
+
* @param model - the model the plan resolved (config override or the loop's
|
|
70
|
+
* route model); the same model the capability probe verified.
|
|
71
|
+
* @param webSearchToolType - the Responses spelling the probe verified; the
|
|
72
|
+
* wire must send exactly the spelling that passed.
|
|
73
|
+
* @returns the JSON body to POST.
|
|
74
|
+
*/
|
|
75
|
+
export declare function buildWireBody(request: GenerateOptions, cfg: Pick<InlineConfig, 'includeSources' | 'stripServerTools'>, model: string, webSearchToolType: ResponsesWebSearchToolType, reasoning?: ResponsesReasoningOptions): unknown;
|
|
76
|
+
/**
|
|
77
|
+
* Build the Anthropic Messages wire tools array: function tools (optionally
|
|
78
|
+
* stripped of the `web_search` variant, which shadows the server-side tool)
|
|
79
|
+
* plus the server-side web search tool. Function tools carry no `type`.
|
|
80
|
+
* @param tools - the harness tool schemas.
|
|
81
|
+
* @param stripServerTools - whether to drop the shadowed function variants.
|
|
82
|
+
* @returns the wire tools array.
|
|
83
|
+
*/
|
|
84
|
+
export declare function anthropicWireTools(tools: readonly ToolSchema[] | undefined, stripServerTools: boolean): unknown[];
|
|
85
|
+
/**
|
|
86
|
+
* Serialize one dsh message into Anthropic Messages content items.
|
|
87
|
+
* Assistant messages aggregate their blocks into one content array
|
|
88
|
+
* (reasoning without a usable signature becomes plain text).
|
|
89
|
+
* @param message - the harness message.
|
|
90
|
+
* @returns the Anthropic content items for this message.
|
|
91
|
+
* @throws UnsupportedContentError for image content.
|
|
92
|
+
*/
|
|
93
|
+
export declare function serializeAnthropicMessage(message: RequestMessage): unknown[];
|
|
94
|
+
/**
|
|
95
|
+
* Build the complete Anthropic Messages request body for one inline call.
|
|
96
|
+
* The system prompt goes to the top-level `system` field (unlike the
|
|
97
|
+
* Responses wire, the Anthropic gateway keeps server-side web_search native
|
|
98
|
+
* with a top-level system).
|
|
99
|
+
* @param request - the harness request.
|
|
100
|
+
* @param cfg - the wire controls.
|
|
101
|
+
* @param model - the model the plan resolved (config override or the loop's
|
|
102
|
+
* route model); the same model the capability probe verified.
|
|
103
|
+
* @returns the JSON body to POST.
|
|
104
|
+
*/
|
|
105
|
+
export declare function buildAnthropicWireBody(request: GenerateOptions, cfg: Pick<InlineConfig, 'stripServerTools'>, model: string): unknown;
|
|
106
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
4
|
+
import type { SessionAccountsHost } from './session-accounts-host.ts';
|
|
5
|
+
import type { SessionAccountView, TurnAccountView } from './session-accounts-remote.ts';
|
|
6
|
+
import type { CopilotUsageView } from './copilot-usage-types.ts';
|
|
7
|
+
export declare class SessionAccountController extends TypertRemoteService {
|
|
8
|
+
private readonly owner;
|
|
9
|
+
constructor(ctx: Context, owner: SessionAccountsHost);
|
|
10
|
+
get(agent: Agent): Promise<SessionAccountView>;
|
|
11
|
+
set(agent: Agent, accountId: string | null, revision: number): Promise<SessionAccountView>;
|
|
12
|
+
refreshIdentity(agent: Agent): Promise<SessionAccountView>;
|
|
13
|
+
ensureIdentity(agent: Agent): Promise<SessionAccountView>;
|
|
14
|
+
private readIdentity;
|
|
15
|
+
private readUsage;
|
|
16
|
+
usage(agent: Agent): Promise<CopilotUsageView>;
|
|
17
|
+
refreshUsage(agent: Agent): Promise<CopilotUsageView>;
|
|
18
|
+
turn(agent: Agent, turn: number): TurnAccountView;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=session-accounts-controller.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { SessionAccountTurns } from './session-accounts.ts';
|
|
3
|
+
import type { SessionAccountSelection } from './session-accounts.ts';
|
|
4
|
+
import type { CopilotAccountBinding } from './copilot-accounts-types.ts';
|
|
5
|
+
declare module '@deepseek-ai/cordis' {
|
|
6
|
+
interface Context {
|
|
7
|
+
githubCopilotSessionAccounts: SessionAccountsHost;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
interface SessionOwner {
|
|
11
|
+
readonly session: {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** Host-only routing owner; credentials remain in the existing account service. */
|
|
16
|
+
export declare class SessionAccountsHost {
|
|
17
|
+
private readonly ctx;
|
|
18
|
+
readonly turns: SessionAccountTurns;
|
|
19
|
+
private readonly leases;
|
|
20
|
+
constructor(ctx: Context);
|
|
21
|
+
selected(agent: SessionOwner): SessionAccountSelection;
|
|
22
|
+
admit(agent: SessionOwner, turn: number, signal: AbortSignal): CopilotAccountBinding;
|
|
23
|
+
end(session: object, turn: number): void;
|
|
24
|
+
remove(session: object): void;
|
|
25
|
+
dispose(): void;
|
|
26
|
+
bindingForAccount(accountId: string): CopilotAccountBinding;
|
|
27
|
+
private captureIdentity;
|
|
28
|
+
recordRequest(signal?: AbortSignal): void;
|
|
29
|
+
requestBinding(signal?: AbortSignal): CopilotAccountBinding;
|
|
30
|
+
set(agent: SessionOwner, accountId: string | null, revision: number, observed?: import('./diagnostics-collector.ts').DiagnosticsHandle): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=session-accounts-host.d.ts.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
|
+
import type { CopilotUsageView } from './copilot-usage-types.ts';
|
|
4
|
+
import type { CopilotAccountsView } from './copilot-accounts-types.ts';
|
|
5
|
+
export declare const SessionAccountViewSchema: z.ZodObject<{
|
|
6
|
+
source: z.ZodEnum<{
|
|
7
|
+
session: "session";
|
|
8
|
+
global: "global";
|
|
9
|
+
}>;
|
|
10
|
+
accountId: z.ZodString;
|
|
11
|
+
globalAccountId: z.ZodString;
|
|
12
|
+
runningAccountId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
accounts: z.ZodObject<{
|
|
14
|
+
state: z.ZodEnum<{
|
|
15
|
+
error: "error";
|
|
16
|
+
ready: "ready";
|
|
17
|
+
}>;
|
|
18
|
+
activeAccountId: z.ZodString;
|
|
19
|
+
revision: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
writable: z.ZodBoolean;
|
|
21
|
+
switchable: z.ZodBoolean;
|
|
22
|
+
accounts: z.ZodArray<z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
configured: z.ZodBoolean;
|
|
25
|
+
identityState: z.ZodEnum<{
|
|
26
|
+
ready: "ready";
|
|
27
|
+
unavailable: "unavailable";
|
|
28
|
+
unknown: "unknown";
|
|
29
|
+
}>;
|
|
30
|
+
identity: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
login: z.ZodString;
|
|
32
|
+
userId: z.ZodNumber;
|
|
33
|
+
}, z.core.$strict>>;
|
|
34
|
+
}, z.core.$strict>>;
|
|
35
|
+
operation: z.ZodOptional<z.ZodEnum<{
|
|
36
|
+
authorizing: "authorizing";
|
|
37
|
+
verifying: "verifying";
|
|
38
|
+
switching: "switching";
|
|
39
|
+
}>>;
|
|
40
|
+
notices: z.ZodArray<z.ZodObject<{
|
|
41
|
+
message: z.ZodString;
|
|
42
|
+
url: z.ZodOptional<z.ZodLiteral<"https://github.com/login/device">>;
|
|
43
|
+
code: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strict>>;
|
|
45
|
+
diagnostic: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
COPILOT_ACCOUNTS_SELECTOR_INVALID: "COPILOT_ACCOUNTS_SELECTOR_INVALID";
|
|
47
|
+
COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE: "COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE";
|
|
48
|
+
COPILOT_ACCOUNTS_SELECTED_MISSING: "COPILOT_ACCOUNTS_SELECTED_MISSING";
|
|
49
|
+
COPILOT_ACCOUNTS_CREDENTIALS_UNAVAILABLE: "COPILOT_ACCOUNTS_CREDENTIALS_UNAVAILABLE";
|
|
50
|
+
COPILOT_ACCOUNTS_CHANGED: "COPILOT_ACCOUNTS_CHANGED";
|
|
51
|
+
COPILOT_ACCOUNTS_BUSY: "COPILOT_ACCOUNTS_BUSY";
|
|
52
|
+
COPILOT_ACCOUNTS_CONFLICT: "COPILOT_ACCOUNTS_CONFLICT";
|
|
53
|
+
COPILOT_ACCOUNTS_COMMIT_UNCERTAIN: "COPILOT_ACCOUNTS_COMMIT_UNCERTAIN";
|
|
54
|
+
COPILOT_ACCOUNTS_MODELS_FAILED: "COPILOT_ACCOUNTS_MODELS_FAILED";
|
|
55
|
+
COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE: "COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE";
|
|
56
|
+
COPILOT_ACCOUNTS_IDENTITY_INVALID: "COPILOT_ACCOUNTS_IDENTITY_INVALID";
|
|
57
|
+
COPILOT_ACCOUNTS_IDENTITY_TIMEOUT: "COPILOT_ACCOUNTS_IDENTITY_TIMEOUT";
|
|
58
|
+
COPILOT_ACCOUNTS_IDENTITY_TLS: "COPILOT_ACCOUNTS_IDENTITY_TLS";
|
|
59
|
+
COPILOT_ACCOUNTS_IDENTITY_NETWORK: "COPILOT_ACCOUNTS_IDENTITY_NETWORK";
|
|
60
|
+
COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED: "COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED";
|
|
61
|
+
COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED: "COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED";
|
|
62
|
+
COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR: "COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR";
|
|
63
|
+
COPILOT_ACCOUNTS_IDENTITY_CHANGED: "COPILOT_ACCOUNTS_IDENTITY_CHANGED";
|
|
64
|
+
COPILOT_ACCOUNTS_DUPLICATE: "COPILOT_ACCOUNTS_DUPLICATE";
|
|
65
|
+
COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED: "COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED";
|
|
66
|
+
COPILOT_ACCOUNTS_ROUTE_BLOCKED: "COPILOT_ACCOUNTS_ROUTE_BLOCKED";
|
|
67
|
+
COPILOT_ACCOUNTS_EVIDENCE_INCOMPLETE: "COPILOT_ACCOUNTS_EVIDENCE_INCOMPLETE";
|
|
68
|
+
COPILOT_ACCOUNTS_LIMIT: "COPILOT_ACCOUNTS_LIMIT";
|
|
69
|
+
COPILOT_ACCOUNTS_AUTH_FAILED: "COPILOT_ACCOUNTS_AUTH_FAILED";
|
|
70
|
+
COPILOT_ACCOUNTS_AUTH_UNAVAILABLE: "COPILOT_ACCOUNTS_AUTH_UNAVAILABLE";
|
|
71
|
+
COPILOT_ACCOUNTS_ACTIVE_REMOVE_BLOCKED: "COPILOT_ACCOUNTS_ACTIVE_REMOVE_BLOCKED";
|
|
72
|
+
COPILOT_ACCOUNTS_REMOVE_FAILED: "COPILOT_ACCOUNTS_REMOVE_FAILED";
|
|
73
|
+
COPILOT_ACCOUNTS_DISPOSED: "COPILOT_ACCOUNTS_DISPOSED";
|
|
74
|
+
}>>;
|
|
75
|
+
}, z.core.$strict>;
|
|
76
|
+
}, z.core.$strict>;
|
|
77
|
+
export interface SessionAccountView {
|
|
78
|
+
readonly source: 'global' | 'session';
|
|
79
|
+
readonly accountId: string;
|
|
80
|
+
readonly globalAccountId: string;
|
|
81
|
+
readonly runningAccountId?: string;
|
|
82
|
+
readonly accounts: CopilotAccountsView;
|
|
83
|
+
}
|
|
84
|
+
export declare const TurnAccountViewSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
85
|
+
state: z.ZodLiteral<"unknown">;
|
|
86
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
87
|
+
state: z.ZodLiteral<"recorded">;
|
|
88
|
+
accountId: z.ZodString;
|
|
89
|
+
source: z.ZodEnum<{
|
|
90
|
+
session: "session";
|
|
91
|
+
global: "global";
|
|
92
|
+
}>;
|
|
93
|
+
identity: z.ZodOptional<z.ZodObject<{
|
|
94
|
+
login: z.ZodString;
|
|
95
|
+
userId: z.ZodNumber;
|
|
96
|
+
}, z.core.$strict>>;
|
|
97
|
+
}, z.core.$strict>], "state">;
|
|
98
|
+
export type TurnAccountView = z.infer<typeof TurnAccountViewSchema>;
|
|
99
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
100
|
+
interface TypertRemoteNamespaceMap {
|
|
101
|
+
githubCopilotSessionAccount: {
|
|
102
|
+
get(agentId: string): Promise<RemoteResult<SessionAccountView>>;
|
|
103
|
+
set(agentId: string, accountId: string | null, revision: number): Promise<RemoteResult<SessionAccountView>>;
|
|
104
|
+
refreshIdentity(agentId: string): Promise<RemoteResult<SessionAccountView>>;
|
|
105
|
+
ensureIdentity(agentId: string): Promise<RemoteResult<SessionAccountView>>;
|
|
106
|
+
usage(agentId: string): Promise<RemoteResult<CopilotUsageView>>;
|
|
107
|
+
refreshUsage(agentId: string): Promise<RemoteResult<CopilotUsageView>>;
|
|
108
|
+
turn(agentId: string, turn: number): Promise<RemoteResult<TurnAccountView>>;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
declare const contribution: TypertRemoteContribution;
|
|
113
|
+
export default contribution;
|
|
114
|
+
//# sourceMappingURL=session-accounts-remote.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CopilotAccountIdentity } from './copilot-accounts-types.ts';
|
|
2
|
+
export declare const SESSION_ACCOUNTS_MAX = 2048;
|
|
3
|
+
export interface SessionAccountPreference {
|
|
4
|
+
readonly sessionId: string;
|
|
5
|
+
readonly accountId: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SessionAccountSelection {
|
|
8
|
+
readonly accountId: string;
|
|
9
|
+
readonly source: 'global' | 'session';
|
|
10
|
+
}
|
|
11
|
+
export interface TurnAccountEvidence extends SessionAccountSelection {
|
|
12
|
+
readonly identity?: CopilotAccountIdentity;
|
|
13
|
+
}
|
|
14
|
+
interface Admission extends SessionAccountSelection {
|
|
15
|
+
readonly turn: number;
|
|
16
|
+
readonly signal: AbortSignal;
|
|
17
|
+
}
|
|
18
|
+
export declare function parseSessionAccounts(value: unknown): readonly SessionAccountPreference[];
|
|
19
|
+
export declare function resolveSessionAccount(sessionId: string, preferences: readonly SessionAccountPreference[], globalAccountId: string): SessionAccountSelection;
|
|
20
|
+
/** Active turns are never evicted; bounded historical evidence may become unknown. */
|
|
21
|
+
export declare class SessionAccountTurns {
|
|
22
|
+
private readonly active;
|
|
23
|
+
private readonly signals;
|
|
24
|
+
private readonly identities;
|
|
25
|
+
private readonly history;
|
|
26
|
+
admit(agent: object, turn: number, signal: AbortSignal, selection: SessionAccountSelection): Admission;
|
|
27
|
+
record(agent: object, turn: number, identity?: CopilotAccountIdentity): void;
|
|
28
|
+
current(agent: object): Admission | undefined;
|
|
29
|
+
forSignal(signal: AbortSignal): Admission | undefined;
|
|
30
|
+
evidence(agent: object, turn: number): TurnAccountEvidence | undefined;
|
|
31
|
+
end(agent: object, turn: number): void;
|
|
32
|
+
remove(agent: object): void;
|
|
33
|
+
clear(): void;
|
|
34
|
+
recordSignal(signal: AbortSignal, identity?: CopilotAccountIdentity): void;
|
|
35
|
+
captureIdentity(signal: AbortSignal, identity: CopilotAccountIdentity): void;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=session-accounts.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { GenerateOptions } from '@deepseek-ai/dsh-llm';
|
|
4
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
5
|
+
import { SessionContinuationTurn } from './session-continuation.ts';
|
|
6
|
+
import type { SessionContinuationView } from './session-continuation-types.ts';
|
|
7
|
+
import type { CompactionContinuationStatus } from './session-continuation-types.ts';
|
|
8
|
+
declare module '@deepseek-ai/cordis' {
|
|
9
|
+
interface Context {
|
|
10
|
+
githubCopilotSessionContinuation: SessionContinuationController;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
interface Admission {
|
|
14
|
+
readonly turn: number;
|
|
15
|
+
readonly enabled: boolean;
|
|
16
|
+
readonly persistentEnabled: boolean;
|
|
17
|
+
readonly filter: SessionContinuationTurn;
|
|
18
|
+
step: number;
|
|
19
|
+
signal: AbortSignal;
|
|
20
|
+
}
|
|
21
|
+
export declare class SessionContinuationController extends TypertRemoteService {
|
|
22
|
+
private readonly active;
|
|
23
|
+
private readonly once;
|
|
24
|
+
private readonly ready;
|
|
25
|
+
private readonly summaryStatus;
|
|
26
|
+
constructor(ctx: Context, active: Map<object, Admission>, once?: Set<object>, ready?: Promise<void>, summaryStatus?: (agent: Agent) => CompactionContinuationStatus | undefined);
|
|
27
|
+
get(agent: Agent): Promise<SessionContinuationView>;
|
|
28
|
+
set(agent: Agent, revision: number, enabled: boolean | null): Promise<SessionContinuationView>;
|
|
29
|
+
authorizeNext(agent: Agent, revision: number, enabled: boolean): Promise<SessionContinuationView>;
|
|
30
|
+
defaults(): Promise<{
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
revision: number;
|
|
33
|
+
}>;
|
|
34
|
+
setDefault(revision: number, enabled: boolean): Promise<{
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
revision: number;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
export declare function installSessionContinuation(ctx: Context): {
|
|
40
|
+
ready: Promise<void>;
|
|
41
|
+
prepare(request: GenerateOptions): ((payload: unknown) => Promise<unknown>) | undefined;
|
|
42
|
+
dispose(): void;
|
|
43
|
+
};
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=session-continuation-host.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
2
|
+
import type { SessionContinuationView } from './session-continuation-types.ts';
|
|
3
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
4
|
+
interface TypertRemoteNamespaceMap {
|
|
5
|
+
githubCopilotSessionContinuation: {
|
|
6
|
+
get(agentId: string): Promise<RemoteResult<SessionContinuationView>>;
|
|
7
|
+
set(agentId: string, revision: number, enabled: boolean | null): Promise<RemoteResult<SessionContinuationView>>;
|
|
8
|
+
authorizeNext(agentId: string, revision: number, enabled: boolean): Promise<RemoteResult<SessionContinuationView>>;
|
|
9
|
+
defaults(): Promise<RemoteResult<{
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
revision: number;
|
|
12
|
+
}>>;
|
|
13
|
+
setDefault(revision: number, enabled: boolean): Promise<RemoteResult<{
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
revision: number;
|
|
16
|
+
}>>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
declare const contribution: TypertRemoteContribution;
|
|
21
|
+
export default contribution;
|
|
22
|
+
//# sourceMappingURL=session-continuation-remote.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const COMPACTION_CONTINUATION = "githubCopilotCompactionLifecycle";
|
|
3
|
+
export declare const CompactionContinuationStatusSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
state: z.ZodEnum<{
|
|
6
|
+
running: "running";
|
|
7
|
+
failed: "failed";
|
|
8
|
+
cancelled: "cancelled";
|
|
9
|
+
completed: "completed";
|
|
10
|
+
blocked: "blocked";
|
|
11
|
+
}>;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export type CompactionContinuationStatus = z.infer<typeof CompactionContinuationStatusSchema>;
|
|
14
|
+
export declare const CompactionContinuationLifecycleSchema: z.ZodObject<{
|
|
15
|
+
id: z.ZodNullable<z.ZodString>;
|
|
16
|
+
running: z.ZodBoolean;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
export type CompactionContinuationLifecycle = z.infer<typeof CompactionContinuationLifecycleSchema>;
|
|
19
|
+
export declare const SessionContinuationPreferenceSchema: z.ZodObject<{
|
|
20
|
+
sessionId: z.ZodString;
|
|
21
|
+
version: z.ZodLiteral<1>;
|
|
22
|
+
consentedAt: z.ZodNumber;
|
|
23
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
export declare const SessionContinuationPreferencesSchema: z.ZodArray<z.ZodObject<{
|
|
26
|
+
sessionId: z.ZodString;
|
|
27
|
+
version: z.ZodLiteral<1>;
|
|
28
|
+
consentedAt: z.ZodNumber;
|
|
29
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
}, z.core.$strict>>;
|
|
31
|
+
export type SessionContinuationPreference = z.infer<typeof SessionContinuationPreferenceSchema>;
|
|
32
|
+
export declare const ContinuationDefaultHistorySchema: z.ZodArray<z.ZodObject<{
|
|
33
|
+
enabled: z.ZodBoolean;
|
|
34
|
+
changedAt: z.ZodNumber;
|
|
35
|
+
}, z.core.$strict>>;
|
|
36
|
+
export type ContinuationDefaultChange = z.infer<typeof ContinuationDefaultHistorySchema>[number];
|
|
37
|
+
export declare const ContinuationDefaultViewSchema: z.ZodObject<{
|
|
38
|
+
enabled: z.ZodBoolean;
|
|
39
|
+
revision: z.ZodNumber;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
export declare const SessionContinuationViewSchema: z.ZodObject<{
|
|
42
|
+
enabled: z.ZodBoolean;
|
|
43
|
+
revision: z.ZodNumber;
|
|
44
|
+
activeTurnEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
default: "default";
|
|
47
|
+
session: "session";
|
|
48
|
+
}>>;
|
|
49
|
+
nextTurnAuthorized: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
compaction: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
id: z.ZodString;
|
|
52
|
+
state: z.ZodEnum<{
|
|
53
|
+
running: "running";
|
|
54
|
+
failed: "failed";
|
|
55
|
+
cancelled: "cancelled";
|
|
56
|
+
completed: "completed";
|
|
57
|
+
blocked: "blocked";
|
|
58
|
+
}>;
|
|
59
|
+
}, z.core.$strict>>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
export type SessionContinuationView = z.infer<typeof SessionContinuationViewSchema>;
|
|
62
|
+
//# sourceMappingURL=session-continuation-types.d.ts.map
|