@ai-outfitter/outfitter 0.3.0 → 0.6.1
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/README.md +48 -9
- package/dist/agents/AdapterProfileControls.d.ts +1 -0
- package/dist/agents/AdapterProfileControls.js +6 -0
- package/dist/agents/AdapterProfileControls.js.map +1 -1
- package/dist/agents/claude/ClaudeAdapter.js +2 -2
- package/dist/agents/claude/ClaudeAdapter.js.map +1 -1
- package/dist/agents/pi/PiAdapter.js +21 -13
- package/dist/agents/pi/PiAdapter.js.map +1 -1
- package/dist/cli/OutfitterCli.js +7 -2
- package/dist/cli/OutfitterCli.js.map +1 -1
- package/dist/cli/commands/FirstRunWelcomeProfile.js +8 -5
- package/dist/cli/commands/FirstRunWelcomeProfile.js.map +1 -1
- package/dist/cli/commands/PiLoginLaunch.js +67 -9
- package/dist/cli/commands/PiLoginLaunch.js.map +1 -1
- package/dist/cli/commands/RunCommand.js +4 -1
- package/dist/cli/commands/RunCommand.js.map +1 -1
- package/dist/cli/commands/SetupCommand.d.ts +16 -0
- package/dist/cli/commands/SetupCommand.js +340 -34
- package/dist/cli/commands/SetupCommand.js.map +1 -1
- package/dist/cli/commands/WelcomeCommand.d.ts +3 -1
- package/dist/cli/commands/WelcomeCommand.js +87 -77
- package/dist/cli/commands/WelcomeCommand.js.map +1 -1
- package/dist/cli/commands/profile/ListCommand.d.ts +2 -0
- package/dist/cli/commands/profile/ListCommand.js +9 -3
- package/dist/cli/commands/profile/ListCommand.js.map +1 -1
- package/dist/compositeProfile/StatePersistence.js +3 -0
- package/dist/compositeProfile/StatePersistence.js.map +1 -1
- package/dist/merge/ArrayMergePolicy.d.ts +2 -1
- package/dist/merge/ArrayMergePolicy.js +14 -11
- package/dist/merge/ArrayMergePolicy.js.map +1 -1
- package/dist/merge/SettingsValueMerger.js +27 -2
- package/dist/merge/SettingsValueMerger.js.map +1 -1
- package/dist/profiles/Profile.d.ts +4 -1
- package/dist/profiles/Profile.js.map +1 -1
- package/dist/profiles/ProfileLoader.js +16 -2
- package/dist/profiles/ProfileLoader.js.map +1 -1
- package/dist/profiles/ProfileMerger.d.ts +0 -1
- package/dist/profiles/ProfileMerger.js +20 -9
- package/dist/profiles/ProfileMerger.js.map +1 -1
- package/dist/schemas/profile.schema.json +17 -4
- package/doc/architecture.md +29 -7
- package/doc/file_structure.md +9 -1
- package/doc/state_writeback_strategy.md +8 -0
- package/package.json +16 -1
- package/requirements/OFTR-001-project-foundation.md +1 -1
- package/requirements/OFTR-003-profiles.md +14 -5
- package/requirements/OFTR-004-sync-and-setup.md +11 -1
- package/requirements/OFTR-006-agent-adapters.md +2 -0
- package/requirements/OFTR-009-release-publishing.md +13 -3
- package/requirements/OFTR-010-onboarding-welcome.md +27 -17
- package/skills/outfitter/SKILL.md +68 -0
- package/src/schemas/profile.schema.json +17 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunCommand.js","sourceRoot":"","sources":["../../../src/cli/commands/RunCommand.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,MAAM,aAAa,CAAC;AAGhC,OAAO,EAAE,kBAAkB,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC7G,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,iCAAiC,EACjC,8BAA8B,GAC/B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAIzE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAE,oCAAoC,EAAE,MAAM,kCAAkC,CAAC;AACxF,O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AAEF,MAAM,mBAAmB,GAAG,CAAC,KAI5B,EAAU,EAAE,CAAC,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;AAEjE,MAAM,kBAAkB,GAAG,CAAC,KAA0D,EAAU,EAAE,CAChG,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC"}
|
|
@@ -20,14 +20,30 @@ export interface SetupCommandResult {
|
|
|
20
20
|
export interface SetupSourceSynchronizer {
|
|
21
21
|
sync(uri: string, cachePath: string): void;
|
|
22
22
|
}
|
|
23
|
+
export interface SetupSourceLaunchInput {
|
|
24
|
+
readonly homeDirectory: string;
|
|
25
|
+
readonly projectDirectory: string;
|
|
26
|
+
readonly profileId: string;
|
|
27
|
+
}
|
|
28
|
+
export type SetupSourcePostImportAction = 'start' | 'exit';
|
|
23
29
|
export type SetupCommandDependencies = SyncCommandDependencies & WelcomeCommandDependencies & {
|
|
24
30
|
readonly setupSourceSynchronizer?: SetupSourceSynchronizer;
|
|
25
31
|
readonly selectDefaultProfile?: (profiles: readonly SetupProfileChoice[], currentDefault: string) => Promise<string>;
|
|
32
|
+
readonly selectSetupSourceImportTarget?: (choices: readonly SetupSourceImportTargetChoice[], defaultTarget: SetupSourceImportTarget) => Promise<SetupSourceImportTarget>;
|
|
33
|
+
readonly selectSetupSourceLaunchAction?: (profileId: string) => Promise<SetupSourcePostImportAction>;
|
|
34
|
+
readonly launchSetupSourceProfile?: (input: SetupSourceLaunchInput) => Promise<void>;
|
|
26
35
|
readonly runWelcome?: (input: SetupCommandInput, dependencies: SetupCommandDependencies) => Promise<WelcomeCommandResult | undefined>;
|
|
27
36
|
};
|
|
28
37
|
export interface SetupProfileChoice {
|
|
29
38
|
readonly id: string;
|
|
30
39
|
readonly label?: string;
|
|
40
|
+
readonly description?: string;
|
|
41
|
+
}
|
|
42
|
+
export type SetupSourceImportTarget = 'home' | 'project';
|
|
43
|
+
export interface SetupSourceImportTargetChoice {
|
|
44
|
+
readonly target: SetupSourceImportTarget;
|
|
45
|
+
readonly label: string;
|
|
46
|
+
readonly description: string;
|
|
31
47
|
}
|
|
32
48
|
export declare const executeSetupCommand: (input: SetupCommandInput, dependencies?: SetupCommandDependencies) => Promise<SetupCommandResult>;
|
|
33
49
|
export declare const createSetupCommand: (dependencies?: SetupCommandDependencies) => CommandObject;
|
|
@@ -5,15 +5,36 @@ import { createInterface } from 'node:readline/promises';
|
|
|
5
5
|
import { homedir } from 'node:os';
|
|
6
6
|
import { dirname, join } from 'node:path';
|
|
7
7
|
import spawn from 'cross-spawn';
|
|
8
|
+
import { parse, stringify } from 'yaml';
|
|
8
9
|
import { createProfileSourceCachePath, createRemoteRepositoryCachePath, normalizeGitUri, redactProfileSourceUriCredentials, resolveRemoteRepositorySubpath, } from '../../profiles/ProfileCache.js';
|
|
9
10
|
import { isValidProfileId, loadLocalProfileSource } from '../../profiles/ProfileLoader.js';
|
|
10
11
|
import { createSettingsLoadPlan, discoverSettingsLoadPlan, loadSettings, loadSettingsFiles, loadSettingsWithCachedRemoteSettings, } from '../../settings/SettingsLoader.js';
|
|
11
12
|
import { persistFirstRunWelcomeProfile, updateSettingsDefaultProfile, } from './FirstRunWelcomeProfile.js';
|
|
12
13
|
import { executeSyncCommand } from './SyncCommand.js';
|
|
13
|
-
import { executeWelcomeCommand } from './WelcomeCommand.js';
|
|
14
|
+
import { executeWelcomeCommand, writeWelcomeIntro } from './WelcomeCommand.js';
|
|
15
|
+
const setupSourceImportTargetChoices = [
|
|
16
|
+
{
|
|
17
|
+
target: 'home',
|
|
18
|
+
label: 'User home',
|
|
19
|
+
description: 'install profiles into ~/.outfitter for all repositories on this machine',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
target: 'project',
|
|
23
|
+
label: 'Current project',
|
|
24
|
+
description: 'install profiles into this project .outfitter folder only',
|
|
25
|
+
},
|
|
26
|
+
];
|
|
14
27
|
const builtInSetupProfileChoices = [
|
|
15
|
-
{
|
|
16
|
-
|
|
28
|
+
{
|
|
29
|
+
id: 'engineer',
|
|
30
|
+
label: 'Engineer',
|
|
31
|
+
description: 'Engineering setup for repository navigation, maintainable code changes, tests, and reviews.',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'data_analyst',
|
|
35
|
+
label: 'Data Analyst',
|
|
36
|
+
description: 'Data analysis setup for careful inspection, reproducible methods, assumptions, and summaries.',
|
|
37
|
+
},
|
|
17
38
|
];
|
|
18
39
|
/* eslint-disable complexity -- setup orchestration coordinates settings, sync, prompts, and welcome persistence. */
|
|
19
40
|
export const executeSetupCommand = async (input, dependencies = {}) => {
|
|
@@ -31,6 +52,16 @@ export const executeSetupCommand = async (input, dependencies = {}) => {
|
|
|
31
52
|
? readStarterDefaultProfileId(starterLayout?.settingsPath)
|
|
32
53
|
: readUserDefaultProfileId(loadedSettings.files);
|
|
33
54
|
assertValidDefaultProfileId(defaultProfileId);
|
|
55
|
+
if (input.setupSourceUri !== undefined && dependencies.interactive === true && starterLayout !== undefined) {
|
|
56
|
+
return executeInteractiveSetupSourceCommand({
|
|
57
|
+
input: { ...input, setupSourceUri: input.setupSourceUri },
|
|
58
|
+
dependencies,
|
|
59
|
+
homeSettingsPath: settingsPath,
|
|
60
|
+
initialSettingsMissing,
|
|
61
|
+
starterLayout,
|
|
62
|
+
currentDefaultProfileId: defaultProfileId,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
34
65
|
const createdSettings = createInitialSettingsIfMissing(settingsPath, starterLayout?.settingsPath);
|
|
35
66
|
ensureExistingUserSettingsDefaultProfile(settingsPath, loadedSettings.files, defaultProfileId);
|
|
36
67
|
const copiedStarterProfileFiles = copyStarterProfileFilesIfPresent(starterLayout?.profilesPath, join(input.homeDirectory, '.outfitter', 'profiles'));
|
|
@@ -39,7 +70,7 @@ export const executeSetupCommand = async (input, dependencies = {}) => {
|
|
|
39
70
|
failOnInitialDefaultProfileSyncFailure(initialSettingsMissing, rollbackCreatedSettings, syncResult);
|
|
40
71
|
const selectedDefaultProfileId = shouldSkipInitialDefaultProfilePrompt(initialSettingsMissing, dependencies)
|
|
41
72
|
? defaultProfileId
|
|
42
|
-
: await selectDefaultProfileIfInteractive(input, settingsPath, defaultProfileId, dependencies);
|
|
73
|
+
: await selectDefaultProfileIfInteractive(input, settingsPath, defaultProfileId, dependencies, starterLayout);
|
|
43
74
|
const welcomeResult = await runWelcomeAfterInteractiveSetup(input, dependencies);
|
|
44
75
|
const welcomeProfile = persistWelcomeProfileForSetup(input, settingsPath, welcomeResult);
|
|
45
76
|
const finalDefaultProfile = prepareFinalDefaultProfile(input.homeDirectory, selectedDefaultProfileId, welcomeProfile);
|
|
@@ -62,6 +93,7 @@ export const executeSetupCommand = async (input, dependencies = {}) => {
|
|
|
62
93
|
createdDefaultProfile: finalDefaultProfile.created,
|
|
63
94
|
syncResult,
|
|
64
95
|
welcomeProfileMessages: welcomeProfile?.messages ?? [],
|
|
96
|
+
runExampleMessages: input.setupSourceUri === undefined ? [] : [formatRunProfileExample(finalDefaultProfile.id)],
|
|
65
97
|
}),
|
|
66
98
|
};
|
|
67
99
|
};
|
|
@@ -79,6 +111,42 @@ const failOnInitialDefaultProfileSyncFailure = (initialSettingsMissing, rollback
|
|
|
79
111
|
throw new Error(`Cannot complete first-run setup because the default profiles source failed to sync: ${failedDefaultProfilesSource.message}. ` +
|
|
80
112
|
'Fix the network/git issue and rerun `outfitter setup` once the source is reachable.');
|
|
81
113
|
};
|
|
114
|
+
const executeInteractiveSetupSourceCommand = async ({ input, dependencies, homeSettingsPath, initialSettingsMissing, starterLayout, currentDefaultProfileId, }) => {
|
|
115
|
+
const onboarding = await runSetupSourceOnboarding(input, dependencies, starterLayout, currentDefaultProfileId);
|
|
116
|
+
const appliedImport = applySetupSourceImport(input, starterLayout, onboarding);
|
|
117
|
+
/* v8 ignore next -- setup-source rollback only runs when a home import creates settings and default-profile sync fails. */
|
|
118
|
+
const rollbackCreatedSettings = appliedImport.createdSettings
|
|
119
|
+
? () => rmSync(appliedImport.settingsPath, { force: true })
|
|
120
|
+
: () => undefined;
|
|
121
|
+
const syncResult = executeSyncCommand(input, dependencies);
|
|
122
|
+
failOnInitialDefaultProfileSyncFailure(initialSettingsMissing && appliedImport.settingsPath === homeSettingsPath, rollbackCreatedSettings, syncResult);
|
|
123
|
+
const defaultProfilePath = join(appliedImport.profilesPath, onboarding.selectedProfileId, 'profile.yml');
|
|
124
|
+
const createdDefaultProfile = createDefaultProfileIfMissing(defaultProfilePath, onboarding.selectedProfileId);
|
|
125
|
+
const postImportAction = await runSetupSourcePostImportAction(input, dependencies, onboarding.selectedProfileId);
|
|
126
|
+
return {
|
|
127
|
+
settingsPath: appliedImport.settingsPath,
|
|
128
|
+
defaultProfilePath,
|
|
129
|
+
createdSettings: appliedImport.createdSettings,
|
|
130
|
+
copiedStarterProfileFiles: appliedImport.copiedStarterProfileFiles,
|
|
131
|
+
createdDefaultProfile,
|
|
132
|
+
syncResult,
|
|
133
|
+
messages: buildSetupMessages({
|
|
134
|
+
input,
|
|
135
|
+
starterLayout,
|
|
136
|
+
settingsPath: appliedImport.settingsPath,
|
|
137
|
+
settingsDescription: appliedImport.settingsDescription,
|
|
138
|
+
profileTargetPath: appliedImport.profilesPath,
|
|
139
|
+
createdSettings: appliedImport.createdSettings,
|
|
140
|
+
copiedStarterProfileFiles: appliedImport.copiedStarterProfileFiles,
|
|
141
|
+
defaultProfileId: onboarding.selectedProfileId,
|
|
142
|
+
defaultProfilePath,
|
|
143
|
+
createdDefaultProfile,
|
|
144
|
+
syncResult,
|
|
145
|
+
welcomeProfileMessages: [],
|
|
146
|
+
runExampleMessages: postImportAction === 'exit' ? [formatRunProfileExample(onboarding.selectedProfileId)] : [],
|
|
147
|
+
}),
|
|
148
|
+
};
|
|
149
|
+
};
|
|
82
150
|
const prepareFinalDefaultProfile = (homeDirectory, selectedDefaultProfileId, welcomeProfile) => {
|
|
83
151
|
const finalDefaultProfileId = welcomeProfile?.profileId ?? selectedDefaultProfileId;
|
|
84
152
|
const finalDefaultProfilePath = join(homeDirectory, '.outfitter', 'profiles', finalDefaultProfileId, 'profile.yml');
|
|
@@ -90,17 +158,51 @@ const buildSetupMessages = (input) => {
|
|
|
90
158
|
if (input.input.setupSourceUri !== undefined && input.starterLayout !== undefined) {
|
|
91
159
|
messages.push(`Prepared setup source ${redactProfileSourceUriCredentials(input.input.setupSourceUri)} at ${input.starterLayout.cachePath}.`);
|
|
92
160
|
}
|
|
161
|
+
const settingsDescription = input.settingsDescription ?? 'user';
|
|
162
|
+
const profileTargetPath = input.profileTargetPath ?? join(input.input.homeDirectory, '.outfitter', 'profiles');
|
|
93
163
|
messages.push(input.createdSettings
|
|
94
|
-
? `Created
|
|
95
|
-
:
|
|
164
|
+
? `Created ${settingsDescription} settings at ${input.settingsPath}.`
|
|
165
|
+
: `${capitalize(settingsDescription)} settings already exist at ${input.settingsPath}; left unchanged.`);
|
|
96
166
|
if (input.starterLayout?.profilesPath !== undefined) {
|
|
97
|
-
messages.push(`Copied ${input.copiedStarterProfileFiles} starter profile file(s) into ${
|
|
167
|
+
messages.push(`Copied ${input.copiedStarterProfileFiles} starter profile file(s) into ${profileTargetPath}.`);
|
|
98
168
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
169
|
+
if (shouldReportDefaultProfileStatus(input)) {
|
|
170
|
+
messages.push(input.createdDefaultProfile
|
|
171
|
+
? `Created default user profile at ${input.defaultProfilePath}.`
|
|
172
|
+
: `Default user profile at ${input.defaultProfilePath} already exists; left unchanged.`);
|
|
173
|
+
}
|
|
174
|
+
messages.push(`Selected default profile '${input.defaultProfileId}'.`, ...input.welcomeProfileMessages, ...input.runExampleMessages, ...input.syncResult.messages);
|
|
102
175
|
return messages;
|
|
103
176
|
};
|
|
177
|
+
const shouldReportDefaultProfileStatus = (input) => {
|
|
178
|
+
if (input.createdDefaultProfile) {
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
return input.input.setupSourceUri === undefined || input.starterLayout?.profilesPath === undefined;
|
|
182
|
+
};
|
|
183
|
+
const formatRunProfileExample = (profileId) => `Start the selected default profile either way:\n outfitter\n outfitter --profile ${profileId}`;
|
|
184
|
+
const runSetupSourcePostImportAction = async (input, dependencies, profileId) => {
|
|
185
|
+
if (dependencies.interactive !== true ||
|
|
186
|
+
(dependencies.launchSetupSourceProfile === undefined && dependencies.selectSetupSourceLaunchAction === undefined)) {
|
|
187
|
+
return 'exit';
|
|
188
|
+
}
|
|
189
|
+
const action = await selectSetupSourceLaunchAction(profileId, dependencies);
|
|
190
|
+
if (action === 'start') {
|
|
191
|
+
await dependencies.launchSetupSourceProfile?.({
|
|
192
|
+
homeDirectory: input.homeDirectory,
|
|
193
|
+
projectDirectory: input.projectDirectory,
|
|
194
|
+
profileId,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return action;
|
|
198
|
+
};
|
|
199
|
+
const selectSetupSourceLaunchAction = async (profileId, dependencies) => {
|
|
200
|
+
if (dependencies.selectSetupSourceLaunchAction !== undefined) {
|
|
201
|
+
return dependencies.selectSetupSourceLaunchAction(profileId);
|
|
202
|
+
}
|
|
203
|
+
return promptForSetupSourceLaunchAction(profileId, dependencies);
|
|
204
|
+
};
|
|
205
|
+
const capitalize = (value) => `${value.slice(0, 1).toUpperCase()}${value.slice(1)}`;
|
|
104
206
|
export const createSetupCommand = (dependencies = {}) => {
|
|
105
207
|
const command = {
|
|
106
208
|
name: 'setup',
|
|
@@ -177,6 +279,13 @@ const readStarterDefaultProfileId = (settingsPath) => {
|
|
|
177
279
|
const loaded = loadSettingsFiles(createSettingsLoadPlan([{ scope: 'user', path: settingsPath }]));
|
|
178
280
|
return loaded.files[0]?.settings.defaultProfile ?? 'engineer';
|
|
179
281
|
};
|
|
282
|
+
const readStarterExplicitDefaultProfileId = (settingsPath) => {
|
|
283
|
+
if (settingsPath === undefined) {
|
|
284
|
+
return undefined;
|
|
285
|
+
}
|
|
286
|
+
const loaded = loadSettingsFiles(createSettingsLoadPlan([{ scope: 'user', path: settingsPath }]));
|
|
287
|
+
return loaded.files[0]?.settings.defaultProfile;
|
|
288
|
+
};
|
|
180
289
|
const readUserDefaultProfileId = (files) => files.find((file) => file.location.scope === 'user')?.settings.defaultProfile ?? 'engineer';
|
|
181
290
|
const ensureExistingUserSettingsDefaultProfile = (settingsPath, files, defaultProfileId) => {
|
|
182
291
|
const userSettings = files.find((file) => file.location.scope === 'user');
|
|
@@ -217,6 +326,62 @@ const readStarterSettingsContent = (starterSettingsPath) => {
|
|
|
217
326
|
}
|
|
218
327
|
return `default_profile: engineer\n${content}`;
|
|
219
328
|
};
|
|
329
|
+
const applySetupSourceImport = (input, starterLayout, onboarding) => {
|
|
330
|
+
const target = createSetupSourceImportTargetLayout(input, onboarding.importTarget);
|
|
331
|
+
const createdSettings = createImportSettingsIfMissing(target.settingsPath, starterLayout.settingsPath, onboarding.selectedProfileId);
|
|
332
|
+
ensureLocalProfileSource(target.settingsPath, target.profilesPath);
|
|
333
|
+
updateSettingsDefaultProfile(target.settingsPath, onboarding.selectedProfileId);
|
|
334
|
+
return {
|
|
335
|
+
...target,
|
|
336
|
+
createdSettings,
|
|
337
|
+
copiedStarterProfileFiles: copyStarterProfileFilesIfPresent(starterLayout.profilesPath, target.profilesPath),
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
const createSetupSourceImportTargetLayout = (input, target) => {
|
|
341
|
+
if (target === 'project') {
|
|
342
|
+
return {
|
|
343
|
+
settingsPath: join(input.projectDirectory, '.outfitter', 'settings.yml'),
|
|
344
|
+
settingsDescription: 'project',
|
|
345
|
+
profilesPath: join(input.projectDirectory, '.outfitter', 'profiles'),
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
return {
|
|
349
|
+
settingsPath: join(input.homeDirectory, '.outfitter', 'settings.yml'),
|
|
350
|
+
settingsDescription: 'user',
|
|
351
|
+
profilesPath: join(input.homeDirectory, '.outfitter', 'profiles'),
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
const createImportSettingsIfMissing = (settingsPath, starterSettingsPath, selectedProfileId) => {
|
|
355
|
+
if (existsSync(settingsPath)) {
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
mkdirSync(dirname(settingsPath), { recursive: true });
|
|
359
|
+
writeFileSync(settingsPath,
|
|
360
|
+
/* v8 ignore next -- setup-source tests exercise starter settings; missing starter settings is defensive fallback. */
|
|
361
|
+
starterSettingsPath === undefined
|
|
362
|
+
? createLocalProfileSettingsContent(selectedProfileId)
|
|
363
|
+
: readStarterSettingsContent(starterSettingsPath));
|
|
364
|
+
return true;
|
|
365
|
+
};
|
|
366
|
+
const createLocalProfileSettingsContent = (defaultProfileId) => ['default_profile: ' + defaultProfileId, 'profile_sources:', ' - path: ./profiles', ''].join('\n');
|
|
367
|
+
const ensureLocalProfileSource = (settingsPath, profilesPath) => {
|
|
368
|
+
const loaded = loadSettingsFiles(createSettingsLoadPlan([{ scope: 'user', path: settingsPath }]));
|
|
369
|
+
const sources = loaded.files[0]?.settings.profileSources ?? [];
|
|
370
|
+
if (sources.some((source) => source.path === profilesPath)) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
const document = readYamlRecord(settingsPath);
|
|
374
|
+
/* v8 ignore next -- appending to existing non-local source lists is equivalent to the covered empty-source case. */
|
|
375
|
+
const existingSources = Array.isArray(document.profile_sources) ? document.profile_sources : [];
|
|
376
|
+
writeFileSync(settingsPath, stringify({ ...document, profile_sources: [...existingSources, { path: './profiles' }] }));
|
|
377
|
+
};
|
|
378
|
+
const readYamlRecord = (path) => {
|
|
379
|
+
const parsed = parse(readFileSync(path, 'utf8'));
|
|
380
|
+
/* v8 ignore next -- settings schema validation guarantees object documents before this helper mutates them. */
|
|
381
|
+
return parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed)
|
|
382
|
+
? { ...parsed }
|
|
383
|
+
: {};
|
|
384
|
+
};
|
|
220
385
|
const copyStarterProfileFilesIfPresent = (sourceProfilesPath, targetProfilesPath) => {
|
|
221
386
|
if (sourceProfilesPath === undefined) {
|
|
222
387
|
return 0;
|
|
@@ -293,18 +458,115 @@ const requireInteractiveTerminalIfNeeded = (dependencies) => {
|
|
|
293
458
|
}
|
|
294
459
|
};
|
|
295
460
|
const shouldSkipInitialDefaultProfilePrompt = (initialSettingsMissing, dependencies) => initialSettingsMissing && dependencies.interactive === true;
|
|
296
|
-
|
|
461
|
+
/* v8 ignore next -- default process stdout is direct terminal behavior; tests inject writable streams. */
|
|
462
|
+
const resolveReadlineOutput = (dependencies) => typeof dependencies.output?.write === 'function' ? dependencies.output : process.stdout;
|
|
463
|
+
const resolvePromptOutput = (dependencies) => {
|
|
464
|
+
if (typeof dependencies.output?.write === 'function') {
|
|
465
|
+
return dependencies.output;
|
|
466
|
+
}
|
|
467
|
+
if (dependencies.writeLine !== undefined) {
|
|
468
|
+
return {
|
|
469
|
+
write(message) {
|
|
470
|
+
dependencies.writeLine?.(message.replace(/\n$/u, ''));
|
|
471
|
+
return true;
|
|
472
|
+
},
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
/* v8 ignore next 7 -- defensive non-writable injected output fallback; normal tests inject writeLine or writable output. */
|
|
476
|
+
if (dependencies.output !== undefined) {
|
|
477
|
+
return {
|
|
478
|
+
write() {
|
|
479
|
+
return true;
|
|
480
|
+
},
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
return process.stdout;
|
|
484
|
+
};
|
|
485
|
+
const runSetupSourceOnboarding = async (input, dependencies, starterLayout, currentDefault) => {
|
|
486
|
+
const discoveredProfiles = discoverSetupProfileChoices(input, starterLayout);
|
|
487
|
+
const sourceDefault = discoverSetupSourcePromptDefault(input, starterLayout, discoveredProfiles);
|
|
488
|
+
const promptDefault = sourceDefault ?? currentDefault;
|
|
489
|
+
const profiles = selectSetupPromptProfiles(input, discoveredProfiles, currentDefault, sourceDefault);
|
|
490
|
+
if (dependencies.selectSetupSourceImportTarget === undefined && dependencies.selectDefaultProfile === undefined) {
|
|
491
|
+
return promptForSetupSourceOnboarding(input, profiles, promptDefault, dependencies);
|
|
492
|
+
}
|
|
493
|
+
writeSetupSourceWelcome(input, profiles, resolvePromptOutput(dependencies));
|
|
494
|
+
const importTarget = await selectSetupSourceImportTarget(dependencies);
|
|
495
|
+
const selectedProfileId = await selectSetupProfile(profiles, promptDefault, dependencies);
|
|
496
|
+
assertValidSelectedDefaultProfile(selectedProfileId, profiles);
|
|
497
|
+
return { importTarget, selectedProfileId };
|
|
498
|
+
};
|
|
499
|
+
const promptForSetupSourceOnboarding = async (input, profiles, currentDefault, dependencies) => {
|
|
500
|
+
const output = resolvePromptOutput(dependencies);
|
|
501
|
+
/* v8 ignore next -- default process streams are direct terminal behavior; tests inject streams. */
|
|
502
|
+
const readline = createInterface({
|
|
503
|
+
input: dependencies.input ?? process.stdin,
|
|
504
|
+
output: resolveReadlineOutput(dependencies),
|
|
505
|
+
});
|
|
506
|
+
try {
|
|
507
|
+
writeSetupSourceWelcome(input, profiles, output);
|
|
508
|
+
const importTarget = 'home';
|
|
509
|
+
const selectedProfileId = await promptForSetupProfileWithReadline(readline, output, profiles, currentDefault, 'Choose the default profile from this setup source:');
|
|
510
|
+
assertValidSelectedDefaultProfile(selectedProfileId, profiles);
|
|
511
|
+
return { importTarget, selectedProfileId };
|
|
512
|
+
}
|
|
513
|
+
finally {
|
|
514
|
+
readline.close();
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
const writeSetupSourceWelcome = (input, profiles, output) => {
|
|
518
|
+
writeWelcomeIntro(output);
|
|
519
|
+
output.write(`\nYou're importing Outfitter profiles from ${redactProfileSourceUriCredentials(input.setupSourceUri)}.\n`);
|
|
520
|
+
output.write(`Found ${profiles.length} profile(s)${formatSetupSourceProfileList(profiles)}.\n`);
|
|
521
|
+
};
|
|
522
|
+
const formatSetupSourceProfileList = (profiles) => {
|
|
523
|
+
/* v8 ignore next -- setup-source profile prompts normally require discovered source profiles. */
|
|
524
|
+
if (profiles.length === 0) {
|
|
525
|
+
return '';
|
|
526
|
+
}
|
|
527
|
+
return `: ${profiles.map((profile) => profile.id).join(', ')}`;
|
|
528
|
+
};
|
|
529
|
+
const selectSetupSourceImportTarget = async (dependencies) => {
|
|
530
|
+
/* v8 ignore else -- mixed dependency injection path; the full readline path prompts with one shared readline. */
|
|
531
|
+
if (dependencies.selectSetupSourceImportTarget !== undefined) {
|
|
532
|
+
const selectedTarget = await dependencies.selectSetupSourceImportTarget(setupSourceImportTargetChoices, 'home');
|
|
533
|
+
assertValidSetupSourceImportTarget(selectedTarget);
|
|
534
|
+
return selectedTarget;
|
|
535
|
+
}
|
|
536
|
+
return 'home';
|
|
537
|
+
};
|
|
538
|
+
const assertValidSetupSourceImportTarget = (target) => {
|
|
539
|
+
/* v8 ignore next -- defensive validation for custom dependency injection. */
|
|
540
|
+
if (setupSourceImportTargetChoices.every((choice) => choice.target !== target)) {
|
|
541
|
+
throw new Error(`Selected setup-source import target '${target}' is not available.`);
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
/* v8 ignore next -- covered by interactive CLI smoke tests; unit tests inject the launch choice. */
|
|
545
|
+
const promptForSetupSourceLaunchAction = async (profileId, dependencies) => {
|
|
546
|
+
const readline = createInterface({
|
|
547
|
+
input: dependencies.input ?? process.stdin,
|
|
548
|
+
output: resolveReadlineOutput(dependencies),
|
|
549
|
+
});
|
|
550
|
+
try {
|
|
551
|
+
const answer = await readline.question(`Start Outfitter with profile '${profileId}' now? [Y/n]: `);
|
|
552
|
+
return answer.trim().toLowerCase().startsWith('n') ? 'exit' : 'start';
|
|
553
|
+
}
|
|
554
|
+
finally {
|
|
555
|
+
readline.close();
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
const selectDefaultProfileIfInteractive = async (input, settingsPath, currentDefault, dependencies, starterLayout) => {
|
|
297
559
|
if (dependencies.interactive !== true) {
|
|
298
560
|
return currentDefault;
|
|
299
561
|
}
|
|
300
|
-
const discoveredProfiles = discoverSetupProfileChoices(input);
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
562
|
+
const discoveredProfiles = discoverSetupProfileChoices(input, starterLayout);
|
|
563
|
+
const sourceDefault = discoverSetupSourcePromptDefault(input, starterLayout, discoveredProfiles);
|
|
564
|
+
const promptDefault = sourceDefault ?? currentDefault;
|
|
565
|
+
const profiles = selectSetupPromptProfiles(input, discoveredProfiles, currentDefault, sourceDefault);
|
|
304
566
|
const writer = dependencies.writeLine ?? console.log;
|
|
305
567
|
writer('Welcome to Outfitter. Outfitter is the easiest way to run Pi.');
|
|
306
568
|
writer('Outfitter manages full pi configurations for you, so you can use different profiles in different situations.');
|
|
307
|
-
const selectedProfile = await selectSetupProfile(profiles,
|
|
569
|
+
const selectedProfile = await selectSetupProfile(profiles, promptDefault, dependencies);
|
|
308
570
|
assertValidSelectedDefaultProfile(selectedProfile, profiles);
|
|
309
571
|
updateSettingsDefaultProfile(settingsPath, selectedProfile);
|
|
310
572
|
return selectedProfile;
|
|
@@ -315,7 +577,42 @@ const assertValidSelectedDefaultProfile = (selectedProfile, profiles) => {
|
|
|
315
577
|
throw new Error(`Selected default profile '${selectedProfile}' was not one of the available setup profiles.`);
|
|
316
578
|
}
|
|
317
579
|
};
|
|
318
|
-
const
|
|
580
|
+
const discoverSetupSourcePromptDefault = (input, starterLayout, profiles) => {
|
|
581
|
+
if (input.setupSourceUri === undefined) {
|
|
582
|
+
return undefined;
|
|
583
|
+
}
|
|
584
|
+
const sourceDefault = readStarterExplicitDefaultProfileId(starterLayout?.settingsPath);
|
|
585
|
+
return profiles.some((profile) => profile.id === sourceDefault) ? sourceDefault : undefined;
|
|
586
|
+
};
|
|
587
|
+
const selectSetupPromptProfiles = (input, discoveredProfiles, currentDefault, sourceDefault) => {
|
|
588
|
+
const profiles = discoveredProfiles.length > 0 ||
|
|
589
|
+
input.setupSourceUri !== undefined ||
|
|
590
|
+
builtInSetupProfileChoices.every((profile) => profile.id !== currentDefault)
|
|
591
|
+
? discoveredProfiles
|
|
592
|
+
: builtInSetupProfileChoices;
|
|
593
|
+
return sourceDefault === undefined ? profiles : prioritizeSetupProfileChoice(profiles, sourceDefault);
|
|
594
|
+
};
|
|
595
|
+
const prioritizeSetupProfileChoice = (profiles, profileId) => [
|
|
596
|
+
...profiles.filter((profile) => profile.id === profileId),
|
|
597
|
+
...profiles.filter((profile) => profile.id !== profileId),
|
|
598
|
+
];
|
|
599
|
+
const discoverSetupProfileChoices = (input, starterLayout) => {
|
|
600
|
+
if (input.setupSourceUri !== undefined && starterLayout?.profilesPath !== undefined) {
|
|
601
|
+
return discoverSetupProfileChoicesFromLocalSource(starterLayout.profilesPath);
|
|
602
|
+
}
|
|
603
|
+
return discoverSetupProfileChoicesFromEffectiveSettings(input);
|
|
604
|
+
};
|
|
605
|
+
const discoverSetupProfileChoicesFromLocalSource = (path) => {
|
|
606
|
+
const loadedProfiles = loadLocalProfileSource({ path });
|
|
607
|
+
return loadedProfiles.profiles
|
|
608
|
+
.map((profile) => ({
|
|
609
|
+
id: profile.profile.id,
|
|
610
|
+
label: profile.profile.label,
|
|
611
|
+
description: profile.profile.description,
|
|
612
|
+
}))
|
|
613
|
+
.sort((left, right) => left.id.localeCompare(right.id));
|
|
614
|
+
};
|
|
615
|
+
const discoverSetupProfileChoicesFromEffectiveSettings = (input) => {
|
|
319
616
|
const loadedSettings = loadSettingsWithCachedRemoteSettings(input);
|
|
320
617
|
const choices = new Map();
|
|
321
618
|
for (const source of loadedSettings.settings.profileSources) {
|
|
@@ -326,6 +623,7 @@ const discoverSetupProfileChoices = (input) => {
|
|
|
326
623
|
choices.set(profile.profile.id, {
|
|
327
624
|
id: profile.profile.id,
|
|
328
625
|
label: profile.profile.label ?? existingChoice?.label,
|
|
626
|
+
description: profile.profile.description ?? existingChoice?.description,
|
|
329
627
|
});
|
|
330
628
|
}
|
|
331
629
|
}
|
|
@@ -350,30 +648,38 @@ const selectSetupProfile = async (profiles, currentDefault, dependencies) => {
|
|
|
350
648
|
return promptForSetupProfile(profiles, currentDefault, dependencies);
|
|
351
649
|
};
|
|
352
650
|
const promptForSetupProfile = async (profiles, currentDefault, dependencies) => {
|
|
353
|
-
const
|
|
354
|
-
/* v8 ignore next -- default process streams are direct terminal behavior; tests inject streams. */
|
|
355
|
-
const output = dependencies.output ?? process.stdout;
|
|
651
|
+
const output = resolvePromptOutput(dependencies);
|
|
356
652
|
/* v8 ignore next -- default process streams are direct terminal behavior; tests inject streams. */
|
|
357
|
-
const readline = createInterface({
|
|
653
|
+
const readline = createInterface({
|
|
654
|
+
input: dependencies.input ?? process.stdin,
|
|
655
|
+
output: resolveReadlineOutput(dependencies),
|
|
656
|
+
});
|
|
358
657
|
try {
|
|
359
|
-
output
|
|
360
|
-
candidates.forEach((profile, index) => {
|
|
361
|
-
const label = profile.label === undefined ? '' : ` - ${profile.label}`;
|
|
362
|
-
output.write(`${index + 1}. ${profile.id}${label}\n`);
|
|
363
|
-
});
|
|
364
|
-
const currentIndex = Math.max(candidates.findIndex((profile) => profile.id === currentDefault), 0);
|
|
365
|
-
const answer = await readline.question(`Default profile [${currentIndex + 1}]: `);
|
|
366
|
-
const selectedIndex = Number.parseInt(answer.trim() || String(currentIndex + 1), 10) - 1;
|
|
367
|
-
const selectedProfile = candidates[selectedIndex];
|
|
368
|
-
if (selectedProfile === undefined) {
|
|
369
|
-
throw new Error('Selected default profile number is out of range.');
|
|
370
|
-
}
|
|
371
|
-
return selectedProfile.id;
|
|
658
|
+
return await promptForSetupProfileWithReadline(readline, output, profiles, currentDefault, 'Choose the default profile for your sessions:');
|
|
372
659
|
}
|
|
373
660
|
finally {
|
|
374
661
|
readline.close();
|
|
375
662
|
}
|
|
376
663
|
};
|
|
664
|
+
const promptForSetupProfileWithReadline = async (readline, output, profiles, currentDefault, heading) => {
|
|
665
|
+
const candidates = profiles.length > 0 ? profiles : [{ id: currentDefault }];
|
|
666
|
+
output.write(`\n${heading}\n`);
|
|
667
|
+
candidates.forEach((profile, index) => {
|
|
668
|
+
const label = profile.label === undefined ? '' : ` - ${profile.label}`;
|
|
669
|
+
output.write(`${index + 1}. ${profile.id}${label}\n`);
|
|
670
|
+
if (profile.description !== undefined) {
|
|
671
|
+
output.write(` ${profile.description}\n`);
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
const currentIndex = Math.max(candidates.findIndex((profile) => profile.id === currentDefault), 0);
|
|
675
|
+
const answer = await readline.question(`Default profile [${currentIndex + 1}]: `);
|
|
676
|
+
const selectedIndex = Number.parseInt(answer.trim() || String(currentIndex + 1), 10) - 1;
|
|
677
|
+
const selectedProfile = candidates[selectedIndex];
|
|
678
|
+
if (selectedProfile === undefined) {
|
|
679
|
+
throw new Error('Selected default profile number is out of range.');
|
|
680
|
+
}
|
|
681
|
+
return selectedProfile.id;
|
|
682
|
+
};
|
|
377
683
|
export { updateSettingsDefaultProfile };
|
|
378
684
|
const formatSettingsIssue = (issue) => `${issue.filePath}#${issue.path} ${issue.message}`;
|
|
379
685
|
//# sourceMappingURL=SetupCommand.js.map
|