-
Notifications
You must be signed in to change notification settings - Fork 39.3k
Expand file tree
/
Copy pathdefaultAccount.ts
More file actions
92 lines (84 loc) · 3.12 KB
/
defaultAccount.ts
File metadata and controls
92 lines (84 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export interface IQuotaSnapshotData {
readonly entitlement: number;
readonly overage_count: number;
readonly overage_permitted: boolean;
readonly percent_remaining: number;
readonly remaining: number;
readonly unlimited: boolean;
}
export interface ILegacyQuotaSnapshotData {
readonly limited_user_quotas?: {
readonly chat: number;
readonly completions: number;
};
readonly monthly_quotas?: {
readonly chat: number;
readonly completions: number;
};
}
export interface IEntitlementsData extends ILegacyQuotaSnapshotData {
readonly access_type_sku: string;
readonly chat_enabled: boolean;
readonly assigned_date: string;
readonly can_signup_for_limited: boolean;
readonly copilot_plan: string;
readonly organization_login_list: string[];
readonly analytics_tracking_id: string;
readonly limited_user_reset_date?: string; // for Copilot Free
readonly quota_reset_date?: string; // for all other Copilot SKUs
readonly quota_reset_date_utc?: string; // for all other Copilot SKUs (includes time)
readonly quota_snapshots?: {
chat?: IQuotaSnapshotData;
completions?: IQuotaSnapshotData;
premium_interactions?: IQuotaSnapshotData;
};
}
/**
* An enterprise MCP registry entry from the `copilot/mcp_registry` response
* that signals GitHub-native enterprise allowlist enforcement.
*/
export interface IMcpAllowlistEntry {
/** The enterprise registry base URL (e.g., "https://registry.github.com/mcp") */
readonly registryUrl: string;
/** The registry access level */
readonly registryAccess: 'allow_all' | 'registry_only';
/** The owner (org or enterprise) login */
readonly ownerLogin: string;
/** The owner (org or enterprise) numeric ID */
readonly ownerId: number;
/** The owner type (e.g., "Organization") */
readonly ownerType: string;
/** Parent enterprise login, if the owner is an org under an enterprise */
readonly parentLogin: string | null;
/** Priority for evaluation ordering */
readonly priority: number;
}
export interface IPolicyData {
readonly mcp?: boolean;
readonly chat_preview_features_enabled?: boolean;
readonly chat_agent_enabled?: boolean;
readonly mcpRegistryUrl?: string;
readonly mcpAccess?: 'allow_all' | 'registry_only';
/** Enterprise MCP allowlist entries discovered from `copilot/mcp_registry`. */
readonly mcpAllowlistEntries?: readonly IMcpAllowlistEntry[];
}
export interface ICopilotTokenInfo {
readonly sn?: string;
readonly fcv1?: string;
}
export interface IDefaultAccountAuthenticationProvider {
readonly id: string;
readonly name: string;
readonly enterprise: boolean;
}
export interface IDefaultAccount {
readonly authenticationProvider: IDefaultAccountAuthenticationProvider;
readonly accountName: string;
readonly sessionId: string;
readonly enterprise: boolean;
readonly entitlementsData?: IEntitlementsData | null;
}