49
}
50
}
52
>
/**
53
>
* Ordered step IDs for the onboarding flow.
54
>
*/
55
>
export const ONBOARDING_STEPS: readonly OnboardingStepId[] = [
56
>
OnboardingStepId.SignIn,
57
>
OnboardingStepId.Personalize,
58
>
OnboardingStepId.AgentSessions,
59
>
];
60
>
61
>
/**
62
>
* Theme option for the onboarding personalization step.
63
>
* Sourced from product.json via `onboardingThemes`.
64
>
*/
65
>
export type IOnboardingThemeOption = IProductOnboardingTheme;
66
>
67
>
/**
68
>
* AI collaboration preference for the AI style step.
69
>
*/
70
>
export const enum AiCollaborationMode {
71
>
CodeFirst = 'code-first',
72
>
Balanced = 'balanced',
73
>
AgentForward = 'agent-forward',
74
>
}
75
>
76
>
/**
77
>
* AI collaboration preference option.
78
>
*/
79
>
export interface IAiPreferenceOption {
80
>
readonly id: AiCollaborationMode;
81
>
readonly label: string;
82
>
readonly description: string;
83
>
readonly icon: string;
84
>
}
85
>
86
>
/**
87
>
* AI collaboration preference options shown in the AI style step.
88
>
*/
89
>
export const ONBOARDING_AI_PREFERENCE_OPTIONS: readonly IAiPreferenceOption[] = [
90
>
{
91
>
id: AiCollaborationMode.CodeFirst,
92
>
label: localize('onboarding.aiPref.codeFirst', "I Write the Code"),
93
>
description: localize('onboarding.aiPref.codeFirst.desc', "AI assists with suggestions and answers questions when you ask. You stay in control of every edit."),
94
>
icon: 'edit',
95
>
},
96
>
{
97
>
id: AiCollaborationMode.Balanced,
98
>
label: localize('onboarding.aiPref.balanced', "Side by Side"),
99
>
description: localize('onboarding.aiPref.balanced.desc', "Inline suggestions plus a chat panel for deeper collaboration. A balance of writing and delegating."),
100
>
icon: 'layoutSidebarRight',
101
>
},
102
>
{
103
>
id: AiCollaborationMode.AgentForward,
104
>
label: localize('onboarding.aiPref.agentForward', "AI Takes the Lead"),
105
>
description: localize('onboarding.aiPref.agentForward.desc', "Let the agent drive — describe what you want and review the result. Great for scaffolding and exploration."),
106
>
icon: 'copilot',
107
>
},
108
>
];
109
>
110
>
/**
111
>
* Storage key for persisting onboarding completion state.
112
>
*/
113
>
export const ONBOARDING_STORAGE_KEY = 'welcomeOnboarding.state';
114
>
115
>
/**
116
>
* Regex matching a single-word GHE instance slug (e.g. "octocat").
117
>
* Only allows characters valid in DNS hostnames (letters, digits, hyphens).
118
>
*/
119
>
export const GHE_DOMAIN_REGEX = /^[a-zA-Z0-9-]+$/;
120
>
121
>
/**
122
>
* Regex matching a full GHE instance URI (e.g. "https://octocat.ghe.com").
123
>
*/
124
>
export const GHE_FULL_URI_REGEX = /^(https:\/\/)?([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.ghe\.com\/?$/;
125
>
126
>
export const enum GheParseResultKind {
127
>
Empty = 'empty',
128
>
SingleWord = 'singleWord',
129
>
FullUri = 'fullUri',
130
>
Invalid = 'invalid',
131
>
}
132
>
133
>
export type GheParseResult =
134
>
| { readonly kind: GheParseResultKind.Empty }
135
>
| { readonly kind: GheParseResultKind.SingleWord; readonly resolvedUri: string }
136
>
| { readonly kind: GheParseResultKind.FullUri; readonly resolvedUri: string }
137
>
| { readonly kind: GheParseResultKind.Invalid };
138
>
139
>
/**
140
>
* Parses a GHE instance input value and returns the result kind and resolved URI.
141
>
*/
142
>
export function parseGheInstanceInput(value: string): GheParseResult {
143
>
const trimmed = value.trim();
144
>
if (!trimmed) {
145
return { kind: GheParseResultKind.Empty };
146
}