dsh-github-copilot 0.4.0-alpha.106 → 0.4.0-alpha.108
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 +6 -0
- package/CHANGELOG.md +12 -0
- package/README.md +13 -9
- package/README.zh.md +13 -9
- package/deployment-baseline.json +5 -1
- package/docs/copilot-accounts.md +17 -1
- package/docs/model-compatibility-acceptance.md +19 -4
- package/lib/client.js +394 -71
- package/lib/client.js.map +1 -1
- package/lib/index.js +11 -3
- package/lib/remote.js +5 -1
- package/lib/types/authorization-code-clipboard.d.ts +4 -0
- package/lib/types/client.d.ts +11 -3
- package/lib/types/composer-notice-style.d.ts +5 -0
- package/lib/types/copilot-accounts-card.d.ts +1 -0
- package/lib/types/copilot-accounts-remote.d.ts +1 -0
- package/lib/types/copilot-accounts-types.d.ts +1 -1
- package/lib/types/responses-replay-compat.d.ts +1 -0
- package/lib/types/session-accounts-remote.d.ts +1 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -2220,14 +2220,16 @@ function requestBodyEvidence(body, protocol) {
|
|
|
2220
2220
|
//#endregion
|
|
2221
2221
|
//#region lib/types/responses-replay-compat.js
|
|
2222
2222
|
const replayDiagnostics = {
|
|
2223
|
-
"scope-mismatch": "COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH: Copilot
|
|
2223
|
+
"scope-mismatch": "COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH: Copilot rejected history tied to another account or connection. Review Replay recovery options, or start a new conversation. Recovery requires consent; stored history is unchanged.",
|
|
2224
2224
|
unsupported: "COPILOT_RESPONSES_REPLAY_UNSUPPORTED: Copilot Responses input cannot be replayed safely without connection-scoped references.",
|
|
2225
2225
|
"invalid-payload": "COPILOT_RESPONSES_REPLAY_INVALID_PAYLOAD: Copilot Responses payload has an invalid replay structure."
|
|
2226
2226
|
};
|
|
2227
2227
|
/** Fixed diagnostics and bounded counts only; never retain request or replay content. */
|
|
2228
2228
|
var CopilotResponsesReplayError = class extends Error {
|
|
2229
|
+
dispatchEvidence;
|
|
2229
2230
|
constructor(reason = "unsupported", dispatch) {
|
|
2230
|
-
super(replayDiagnostics[reason]
|
|
2231
|
+
super(replayDiagnostics[reason]);
|
|
2232
|
+
if (reason === "scope-mismatch" && dispatch !== void 0) this.dispatchEvidence = replayDispatchEvidence(dispatch);
|
|
2231
2233
|
this.name = "CopilotResponsesReplayError";
|
|
2232
2234
|
}
|
|
2233
2235
|
};
|
|
@@ -2989,7 +2991,7 @@ function createAccountProvider(descriptors, guard, baseURL) {
|
|
|
2989
2991
|
var package_default = {
|
|
2990
2992
|
name: "dsh-github-copilot",
|
|
2991
2993
|
description: "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
|
|
2992
|
-
version: "0.4.0-alpha.
|
|
2994
|
+
version: "0.4.0-alpha.108",
|
|
2993
2995
|
publishConfig: {
|
|
2994
2996
|
"access": "public",
|
|
2995
2997
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -4090,6 +4092,8 @@ var CopilotAccountsHost = class {
|
|
|
4090
4092
|
}
|
|
4091
4093
|
}).then(async (result) => {
|
|
4092
4094
|
if (result.status !== "authorized") return;
|
|
4095
|
+
this.operation = "verifying";
|
|
4096
|
+
this.notices = [];
|
|
4093
4097
|
const binding = this.capture(accountId);
|
|
4094
4098
|
const signal = AbortSignal.any([attemptSignal, AbortSignal.timeout(6e4)]);
|
|
4095
4099
|
const identity = await this.identity(binding, signal);
|
|
@@ -11579,6 +11583,10 @@ function createAccountRuntime(ctx, config, binding, exclusionTurns, replayRecove
|
|
|
11579
11583
|
const guard = {
|
|
11580
11584
|
...lifetime.guard(lease),
|
|
11581
11585
|
...hooks,
|
|
11586
|
+
onReplayFailure(error) {
|
|
11587
|
+
if (error.dispatchEvidence !== void 0) ctx.logger.warn(`[github-copilot] ${error.dispatchEvidence}`);
|
|
11588
|
+
hooks.onReplayFailure?.(error);
|
|
11589
|
+
},
|
|
11582
11590
|
...enabled ? { streamIdleTimeoutMs: idle } : {},
|
|
11583
11591
|
onUnauthorized() {
|
|
11584
11592
|
if (lease === void 0 || !lifetime.isCurrent(lease.revision) || source.readDisplaySnapshot() !== lease.snapshot || provenSnapshot !== lease.snapshot || snapshotProof !== lease.proof) return;
|
package/lib/remote.js
CHANGED
|
@@ -507,7 +507,11 @@ const CopilotAccountsViewSchema = z.object({
|
|
|
507
507
|
userId: z.number().int().positive().max(Number.MAX_SAFE_INTEGER)
|
|
508
508
|
}).strict().optional()
|
|
509
509
|
}).strict()).max(32),
|
|
510
|
-
operation: z.enum([
|
|
510
|
+
operation: z.enum([
|
|
511
|
+
"authorizing",
|
|
512
|
+
"verifying",
|
|
513
|
+
"switching"
|
|
514
|
+
]).optional(),
|
|
511
515
|
notices: z.array(z.object({
|
|
512
516
|
message: z.string().min(1).max(512),
|
|
513
517
|
url: z.literal("https://github.com/login/device").optional(),
|
package/lib/types/client.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export { HostedSearchSettingsCard, WebSearchRoutingCard } from './web-search-rou
|
|
|
11
11
|
export { ParentModelFollowCard } from './parent-model-follow-card.ts';
|
|
12
12
|
export { CopilotUsageCard } from './copilot-usage-card.ts';
|
|
13
13
|
import type { CopilotAccountsRemote } from './copilot-accounts-card.ts';
|
|
14
|
+
import { copyAuthorizationCode } from './authorization-code-clipboard.ts';
|
|
15
|
+
export { copyAuthorizationCode };
|
|
14
16
|
export { GitHubCopilotModelPreferencesPanel } from './model-preferences-card.ts';
|
|
15
17
|
export declare const inject: string[];
|
|
16
18
|
interface GitHubCopilotProviderCardProps extends ProviderCardExtrasOwnerProps {
|
|
@@ -18,6 +20,13 @@ interface GitHubCopilotProviderCardProps extends ProviderCardExtrasOwnerProps {
|
|
|
18
20
|
}
|
|
19
21
|
interface GitHubCopilotSettingsSectionProps extends SettingsSectionOwnerProps {
|
|
20
22
|
readonly remote: ClientContext['remote']['githubCopilot'];
|
|
23
|
+
readonly locale?: string;
|
|
24
|
+
}
|
|
25
|
+
interface LocaleReader {
|
|
26
|
+
getLocale(): {
|
|
27
|
+
active: string;
|
|
28
|
+
};
|
|
29
|
+
subscribe(listener: () => void): () => void;
|
|
21
30
|
}
|
|
22
31
|
/** Older Remote clients may not decode results: project known fields before validating our own copy. */
|
|
23
32
|
export declare function authorizationViewFrom(value: unknown): GitHubCopilotAuthorizationView | undefined;
|
|
@@ -26,10 +35,7 @@ export declare function catalogWarningOf(status: GitHubCopilotAuthorizationView
|
|
|
26
35
|
export declare function previewAssignmentMessage(status: GitHubCopilotAuthorizationView | undefined): string | undefined;
|
|
27
36
|
export declare function routeStatusMessage(status: GitHubCopilotAuthorizationView | undefined): string | undefined;
|
|
28
37
|
export declare function activeAuthorizationNotice(status: GitHubCopilotAuthorizationView | undefined): GitHubCopilotAuthorizationView['notices'][number] | undefined;
|
|
29
|
-
type ClipboardWriter = Pick<Clipboard, 'writeText'>;
|
|
30
38
|
type CopyState = 'idle' | 'copying' | 'copied' | 'failed';
|
|
31
|
-
/** Copy a one-time authorization code through the browser clipboard boundary. */
|
|
32
|
-
export declare function copyAuthorizationCode(code: string, clipboard?: ClipboardWriter): Promise<void>;
|
|
33
39
|
interface AuthorizationNoticeProps {
|
|
34
40
|
readonly message: string;
|
|
35
41
|
readonly url?: string;
|
|
@@ -66,6 +72,7 @@ export declare function GitHubCopilotAccountModelsPanel(props: {
|
|
|
66
72
|
interface GitHubCopilotPreviewFooterProps {
|
|
67
73
|
readonly remote: ClientContext['remote']['githubCopilot'];
|
|
68
74
|
readonly accountsRemote?: CopilotAccountsRemote;
|
|
75
|
+
readonly locale?: string;
|
|
69
76
|
/** A slot coordinator owns this controller's attachment across surface handoffs. */
|
|
70
77
|
readonly account?: ReturnType<typeof createCompactAccount>;
|
|
71
78
|
readonly embedded?: boolean;
|
|
@@ -103,6 +110,7 @@ export declare function GitHubCopilotAccountSurface(props: GitHubCopilotPreviewF
|
|
|
103
110
|
readonly surfaces: ReturnType<typeof createAccountSurfaces>;
|
|
104
111
|
readonly seat: AccountSurfaceSeat;
|
|
105
112
|
readonly eligible?: boolean;
|
|
113
|
+
readonly localeReader?: LocaleReader;
|
|
106
114
|
}): ReactElement | null;
|
|
107
115
|
/** Unified fallback when the Models footer extension is absent or incompatible. */
|
|
108
116
|
export declare function GitHubCopilotSettingsSection(props: GitHubCopilotSettingsSectionProps): ReturnType<typeof createElement>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
export declare const composerNoticeStyle: CSSProperties;
|
|
3
|
+
export declare const composerNoticeParagraphStyle: CSSProperties;
|
|
4
|
+
export declare const composerNoticeButtonStyle: CSSProperties;
|
|
5
|
+
//# sourceMappingURL=composer-notice-style.d.ts.map
|
|
@@ -25,7 +25,7 @@ export interface CopilotAccountsView {
|
|
|
25
25
|
readonly writable: boolean;
|
|
26
26
|
readonly switchable: boolean;
|
|
27
27
|
readonly accounts: readonly CopilotAccountView[];
|
|
28
|
-
readonly operation?: 'authorizing' | 'switching';
|
|
28
|
+
readonly operation?: 'authorizing' | 'verifying' | 'switching';
|
|
29
29
|
readonly notices: readonly CopilotAccountsNotice[];
|
|
30
30
|
readonly diagnostic?: CopilotAccountsDiagnostic;
|
|
31
31
|
}
|
|
@@ -6,6 +6,7 @@ interface ReplayDispatch {
|
|
|
6
6
|
}
|
|
7
7
|
/** Fixed diagnostics and bounded counts only; never retain request or replay content. */
|
|
8
8
|
export declare class CopilotResponsesReplayError extends Error {
|
|
9
|
+
readonly dispatchEvidence?: string;
|
|
9
10
|
constructor(reason?: ReplayFailure, dispatch?: ReplayDispatch);
|
|
10
11
|
}
|
|
11
12
|
/** Normalize only the outgoing managed Responses payload, never stored history/context. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-github-copilot",
|
|
3
3
|
"description": "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
|
|
4
|
-
"version": "0.4.0-alpha.
|
|
4
|
+
"version": "0.4.0-alpha.108",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|