dsh-github-copilot 0.4.0-alpha.43 → 0.4.0-alpha.45
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 +5 -5
- package/CHANGELOG.md +7 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +13 -11
- package/README.zh.md +13 -11
- package/deployment-baseline.json +7 -3
- package/lib/client.js +15 -4
- package/lib/client.js.map +1 -1
- package/lib/index.js +11 -2
- package/lib/remote.js +6 -1
- package/lib/types/authorization-controller.d.ts +4 -0
- package/lib/types/remote.d.ts +5 -0
- package/package.json +2 -1
package/lib/index.js
CHANGED
|
@@ -1602,7 +1602,7 @@ let GitHubCopilotUsageController = (() => {
|
|
|
1602
1602
|
//#endregion
|
|
1603
1603
|
//#region package.json
|
|
1604
1604
|
var name$1 = "dsh-github-copilot";
|
|
1605
|
-
var version = "0.4.0-alpha.
|
|
1605
|
+
var version = "0.4.0-alpha.45";
|
|
1606
1606
|
//#endregion
|
|
1607
1607
|
//#region lib/types/probe.js
|
|
1608
1608
|
/**
|
|
@@ -4583,6 +4583,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4583
4583
|
failure;
|
|
4584
4584
|
reconciliationFailed = false;
|
|
4585
4585
|
attempt;
|
|
4586
|
+
authorizationMilestone;
|
|
4586
4587
|
constructor(ctx) {
|
|
4587
4588
|
super(ctx, "githubCopilotAuthorization", { namespace: "githubCopilot" });
|
|
4588
4589
|
}
|
|
@@ -4625,7 +4626,8 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4625
4626
|
route,
|
|
4626
4627
|
...catalog === void 0 ? {} : { catalog },
|
|
4627
4628
|
...discovered === void 0 ? {} : { accountModels: discovered },
|
|
4628
|
-
...this.failure === void 0 ? {} : { error: this.failure }
|
|
4629
|
+
...this.failure === void 0 ? {} : { error: this.failure },
|
|
4630
|
+
...this.authorizationMilestone === void 0 ? {} : { authorizationMilestone: this.authorizationMilestone }
|
|
4629
4631
|
};
|
|
4630
4632
|
}
|
|
4631
4633
|
/** Explicit model discovery: may refresh OAuth and GET the account catalog, never changes selection. */
|
|
@@ -4688,6 +4690,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4688
4690
|
this.notices = [];
|
|
4689
4691
|
this.failure = void 0;
|
|
4690
4692
|
this.reconciliationFailed = false;
|
|
4693
|
+
this.authorizationMilestone = "AUTHORIZATION_REQUESTED";
|
|
4691
4694
|
let begun;
|
|
4692
4695
|
try {
|
|
4693
4696
|
begun = authorization.begin({
|
|
@@ -4695,9 +4698,11 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4695
4698
|
method: oauth.id,
|
|
4696
4699
|
interaction: {
|
|
4697
4700
|
notify: (notice) => {
|
|
4701
|
+
this.authorizationMilestone = "INTERACTION_NOTICE_OBSERVED";
|
|
4698
4702
|
this.notices = [...this.notices, { ...notice }];
|
|
4699
4703
|
},
|
|
4700
4704
|
prompt: (prompt) => {
|
|
4705
|
+
this.authorizationMilestone = "INTERACTION_PROMPT_OBSERVED";
|
|
4701
4706
|
if (prompt.kind === "text" && /GitHub Enterprise URL\/domain/i.test(prompt.message)) return Promise.resolve("");
|
|
4702
4707
|
return Promise.reject(/* @__PURE__ */ new Error("github-copilot: this browser bridge cannot answer the authorization prompt"));
|
|
4703
4708
|
}
|
|
@@ -4709,11 +4714,13 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4709
4714
|
const running = begun.then(async (outcome) => {
|
|
4710
4715
|
if (outcome.status === "authorized") {
|
|
4711
4716
|
this.notices = [];
|
|
4717
|
+
this.authorizationMilestone = void 0;
|
|
4712
4718
|
await this.ensureProviderProfile();
|
|
4713
4719
|
if (this.reconciliationFailed) this.failure = "COPILOT_ROUTE_REPAIR_FAILED";
|
|
4714
4720
|
return;
|
|
4715
4721
|
}
|
|
4716
4722
|
this.notices = [];
|
|
4723
|
+
this.authorizationMilestone = void 0;
|
|
4717
4724
|
}).catch(() => {
|
|
4718
4725
|
this.notices = [];
|
|
4719
4726
|
this.failure = "COPILOT_AUTHORIZATION_BEGIN_FAILED";
|
|
@@ -4731,6 +4738,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4731
4738
|
"cancel"
|
|
4732
4739
|
]);
|
|
4733
4740
|
this.notices = [];
|
|
4741
|
+
this.authorizationMilestone = void 0;
|
|
4734
4742
|
authorization.cancel(GITHUB_COPILOT_CREDENTIAL_KEY);
|
|
4735
4743
|
return this.status();
|
|
4736
4744
|
}
|
|
@@ -4744,6 +4752,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4744
4752
|
this.notices = [];
|
|
4745
4753
|
this.failure = void 0;
|
|
4746
4754
|
this.reconciliationFailed = false;
|
|
4755
|
+
this.authorizationMilestone = void 0;
|
|
4747
4756
|
return this.status();
|
|
4748
4757
|
}
|
|
4749
4758
|
async ensureProviderProfile() {
|
package/lib/remote.js
CHANGED
|
@@ -266,7 +266,12 @@ const GitHubCopilotAuthorizationViewSchema = z.object({
|
|
|
266
266
|
"ROUTE_CONFLICT"
|
|
267
267
|
]).optional()
|
|
268
268
|
}).strict().optional(),
|
|
269
|
-
error: z.string().optional()
|
|
269
|
+
error: z.string().optional(),
|
|
270
|
+
authorizationMilestone: z.enum([
|
|
271
|
+
"AUTHORIZATION_REQUESTED",
|
|
272
|
+
"INTERACTION_PROMPT_OBSERVED",
|
|
273
|
+
"INTERACTION_NOTICE_OBSERVED"
|
|
274
|
+
]).optional()
|
|
270
275
|
}).strict();
|
|
271
276
|
const result = strictRemoteCodec(GITHUB_COPILOT_AUTHORIZATION_VIEW_TYPE_SYMBOL, GitHubCopilotAuthorizationViewSchema);
|
|
272
277
|
const GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL = "dsh-github-copilot#GitHubCopilotMigrationStatus";
|
|
@@ -61,7 +61,10 @@ export interface GitHubCopilotAuthorizationView {
|
|
|
61
61
|
readonly route?: GitHubCopilotRouteView;
|
|
62
62
|
readonly accountModels?: GitHubCopilotAccountModelsView;
|
|
63
63
|
readonly error?: string;
|
|
64
|
+
/** Latest fixed interaction milestone observed during a failed or active attempt; never a failure cause. */
|
|
65
|
+
readonly authorizationMilestone?: GitHubCopilotAuthorizationMilestone;
|
|
64
66
|
}
|
|
67
|
+
export type GitHubCopilotAuthorizationMilestone = 'AUTHORIZATION_REQUESTED' | 'INTERACTION_PROMPT_OBSERVED' | 'INTERACTION_NOTICE_OBSERVED';
|
|
65
68
|
/** Read-only legacy configuration planning; not-configured permits managed-only use and never requests creation. */
|
|
66
69
|
export declare function describeGitHubCopilotProviderProfile(ctx: Context): Promise<{
|
|
67
70
|
state: 'ready' | 'needs-repair' | 'not-configured' | 'conflict';
|
|
@@ -80,6 +83,7 @@ export declare class GitHubCopilotAuthorizationController extends TypertRemoteSe
|
|
|
80
83
|
private failure;
|
|
81
84
|
private reconciliationFailed;
|
|
82
85
|
private attempt;
|
|
86
|
+
private authorizationMilestone;
|
|
83
87
|
constructor(ctx: Context);
|
|
84
88
|
/** No-argument Ops evidence; deliberately independent of ordinary account status. */
|
|
85
89
|
migrationStatus(): GitHubCopilotMigrationStatus;
|
package/lib/types/remote.d.ts
CHANGED
|
@@ -89,6 +89,11 @@ export declare const GitHubCopilotAuthorizationViewSchema: z.ZodObject<{
|
|
|
89
89
|
}>>;
|
|
90
90
|
}, z.core.$strict>>;
|
|
91
91
|
error: z.ZodOptional<z.ZodString>;
|
|
92
|
+
authorizationMilestone: z.ZodOptional<z.ZodEnum<{
|
|
93
|
+
AUTHORIZATION_REQUESTED: "AUTHORIZATION_REQUESTED";
|
|
94
|
+
INTERACTION_PROMPT_OBSERVED: "INTERACTION_PROMPT_OBSERVED";
|
|
95
|
+
INTERACTION_NOTICE_OBSERVED: "INTERACTION_NOTICE_OBSERVED";
|
|
96
|
+
}>>;
|
|
92
97
|
}, z.core.$strict>;
|
|
93
98
|
export declare const GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL = "dsh-github-copilot#GitHubCopilotMigrationStatus";
|
|
94
99
|
/** Independent Ops result: strict at every object level; no account or private Session data. */
|
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.45",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -166,6 +166,7 @@
|
|
|
166
166
|
"react-dom": "18.3.1",
|
|
167
167
|
"tsdown": "^0.22.2",
|
|
168
168
|
"typescript": "^5.9.0",
|
|
169
|
+
"unrun": "^0.3.1",
|
|
169
170
|
"vitest": "^3.2.0"
|
|
170
171
|
},
|
|
171
172
|
"main": "lib/index.js",
|