@ai-outfitter/outfitter 0.11.0 → 1.0.2
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/.outfitter/skills/outfitter/SKILL.md +67 -37
- package/README.md +63 -35
- package/code/enterprise/cli/privateCatalogSettings.cjs +2 -2
- package/code/enterprise/pi-extension/privateCatalogOnboarding.js +5 -8
- package/code/enterprise/shared/privateCatalogPolicy.cjs +5 -5
- package/code/pi-extension/src/outfitter-extension.js +353 -553
- package/code/pi-extension/src/outfitter-runtime-extension.js +160 -0
- package/dist/agents/AgentLaunch.d.ts +9 -1
- package/dist/agents/AgentLaunch.js +19 -0
- package/dist/agents/AgentLaunch.js.map +1 -1
- package/dist/agents/PiCredentialPersistence.d.ts +6 -0
- package/dist/agents/PiCredentialPersistence.js +33 -0
- package/dist/agents/PiCredentialPersistence.js.map +1 -0
- package/dist/cli/OutfitterCli.js +10 -18
- package/dist/cli/OutfitterCli.js.map +1 -1
- package/dist/cli/commands/CommandObject.d.ts +0 -5
- package/dist/cli/commands/CommandObject.js +1 -4
- package/dist/cli/commands/CommandObject.js.map +1 -1
- package/dist/cli/commands/DumpCommand.d.ts +19 -0
- package/dist/cli/commands/DumpCommand.js +54 -0
- package/dist/cli/commands/DumpCommand.js.map +1 -0
- package/dist/cli/commands/ListCommand.d.ts +17 -0
- package/dist/cli/commands/ListCommand.js +77 -0
- package/dist/cli/commands/ListCommand.js.map +1 -0
- package/dist/cli/commands/PiRuntimeLaunch.d.ts +8 -0
- package/dist/cli/commands/PiRuntimeLaunch.js +47 -0
- package/dist/cli/commands/PiRuntimeLaunch.js.map +1 -0
- package/dist/cli/commands/ProcessDefaults.d.ts +2 -0
- package/dist/cli/commands/ProcessDefaults.js +5 -0
- package/dist/cli/commands/ProcessDefaults.js.map +1 -0
- package/dist/cli/commands/RunAgentCommand.d.ts +46 -0
- package/dist/cli/commands/RunAgentCommand.js +176 -0
- package/dist/cli/commands/RunAgentCommand.js.map +1 -0
- package/dist/cli/commands/SetupCommand.d.ts +38 -6
- package/dist/cli/commands/SetupCommand.js +194 -232
- package/dist/cli/commands/SetupCommand.js.map +1 -1
- package/dist/cli/commands/ValidateCommand.d.ts +20 -0
- package/dist/cli/commands/ValidateCommand.js +54 -0
- package/dist/cli/commands/ValidateCommand.js.map +1 -0
- package/dist/composer/Composer.d.ts +11 -0
- package/dist/composer/Composer.js +72 -0
- package/dist/composer/Composer.js.map +1 -0
- package/dist/composer/Composition.d.ts +33 -0
- package/dist/composer/Composition.js +2 -0
- package/dist/composer/Composition.js.map +1 -0
- package/dist/dump/Containment.d.ts +8 -0
- package/dist/dump/Containment.js +22 -0
- package/dist/dump/Containment.js.map +1 -0
- package/dist/dump/Dump.d.ts +8 -0
- package/dist/dump/Dump.js +182 -0
- package/dist/dump/Dump.js.map +1 -0
- package/dist/extensions/PiExtensionCache.d.ts +30 -0
- package/dist/extensions/PiExtensionCache.js +92 -0
- package/dist/extensions/PiExtensionCache.js.map +1 -0
- package/dist/fs/TypeConflict.d.ts +6 -0
- package/dist/fs/TypeConflict.js +21 -0
- package/dist/fs/TypeConflict.js.map +1 -0
- package/dist/paths/OutfitterCache.d.ts +6 -0
- package/dist/paths/OutfitterCache.js +17 -0
- package/dist/paths/OutfitterCache.js.map +1 -0
- package/dist/projection/Materialize.d.ts +24 -0
- package/dist/projection/Materialize.js +83 -0
- package/dist/projection/Materialize.js.map +1 -0
- package/dist/projection/ProjectHarness.d.ts +5 -0
- package/dist/projection/ProjectHarness.js +77 -0
- package/dist/projection/ProjectHarness.js.map +1 -0
- package/dist/projection/Projection.d.ts +23 -0
- package/dist/projection/Projection.js +2 -0
- package/dist/projection/Projection.js.map +1 -0
- package/dist/resolver/AgentDefinition.d.ts +30 -0
- package/dist/resolver/AgentDefinition.js +123 -0
- package/dist/resolver/AgentDefinition.js.map +1 -0
- package/dist/resolver/Layer.d.ts +12 -0
- package/dist/resolver/Layer.js +30 -0
- package/dist/resolver/Layer.js.map +1 -0
- package/dist/resolver/Resolver.d.ts +3 -0
- package/dist/resolver/Resolver.js +163 -0
- package/dist/resolver/Resolver.js.map +1 -0
- package/dist/resolver/ResolverContext.d.ts +15 -0
- package/dist/resolver/ResolverContext.js +11 -0
- package/dist/resolver/ResolverContext.js.map +1 -0
- package/dist/resolver/ResolverValidation.d.ts +11 -0
- package/dist/resolver/ResolverValidation.js +112 -0
- package/dist/resolver/ResolverValidation.js.map +1 -0
- package/dist/resolver/Resource.d.ts +88 -0
- package/dist/resolver/Resource.js +34 -0
- package/dist/resolver/Resource.js.map +1 -0
- package/dist/schemas/agent.schema.json +48 -0
- package/dist/schemas/settings.schema.json +32 -9
- package/dist/settings/Settings.d.ts +34 -5
- package/dist/settings/Settings.js +3 -1
- package/dist/settings/Settings.js.map +1 -1
- package/dist/settings/SettingsLoader.d.ts +1 -1
- package/dist/settings/SettingsLoader.js +23 -22
- package/dist/settings/SettingsLoader.js.map +1 -1
- package/dist/settings/SettingsMerger.js +12 -10
- package/dist/settings/SettingsMerger.js.map +1 -1
- package/dist/setup/DefaultCatalog.d.ts +20 -0
- package/dist/setup/DefaultCatalog.js +89 -0
- package/dist/setup/DefaultCatalog.js.map +1 -0
- package/dist/setup/Setup.d.ts +43 -0
- package/dist/setup/Setup.js +261 -0
- package/dist/setup/Setup.js.map +1 -0
- package/dist/skills/SkillDocument.d.ts +6 -1
- package/dist/skills/SkillDocument.js.map +1 -1
- package/dist/sources/SourceCache.d.ts +19 -0
- package/dist/{profiles/ProfileCache.js → sources/SourceCache.js} +22 -18
- package/dist/sources/SourceCache.js.map +1 -0
- package/dist/validation/SchemaValidator.d.ts +1 -1
- package/dist/validation/SchemaValidator.js +4 -13
- package/dist/validation/SchemaValidator.js.map +1 -1
- package/docs/architecture/state_writeback_strategy.md +54 -122
- package/docs/documentation/README.md +33 -12
- package/docs/documentation/actions.md +35 -52
- package/docs/documentation/agents.md +109 -0
- package/docs/documentation/best-practices.md +25 -63
- package/docs/documentation/catalogs.md +126 -0
- package/docs/documentation/cli.md +39 -41
- package/docs/documentation/concepts.md +66 -23
- package/docs/documentation/dump-and-bake.md +30 -0
- package/docs/documentation/first-time-cli-agent-users.md +8 -8
- package/docs/documentation/getting-started.md +28 -8
- package/docs/documentation/hooks.md +20 -0
- package/docs/documentation/iterating-on-profiles.md +56 -70
- package/docs/documentation/local-development.md +84 -0
- package/docs/documentation/migration.md +39 -0
- package/docs/documentation/personas.md +41 -0
- package/docs/documentation/porting-claude.md +54 -0
- package/docs/documentation/profiles.md +16 -169
- package/docs/documentation/settings.md +61 -0
- package/docs/documentation/skills.md +93 -334
- package/docs/documentation/state.md +24 -62
- package/docs/documentation/subagents.md +37 -0
- package/docs/documentation/support-matrix.md +40 -35
- package/docs/documentation/switching-to-outfitter.md +75 -81
- package/docs/documentation/tasks.md +13 -0
- package/docs/documentation/usecases/engineering.md +67 -84
- package/docs/documentation/usecases/organization-profile-catalog.md +83 -111
- package/docs/documentation/usecases/persona-reviews.md +133 -139
- package/docs/philosophy.md +2 -2
- package/package.json +3 -3
- package/src/schemas/agent.schema.json +48 -0
- package/src/schemas/settings.schema.json +32 -9
- package/dist/agents/AdapterProfileControls.d.ts +0 -21
- package/dist/agents/AdapterProfileControls.js +0 -76
- package/dist/agents/AdapterProfileControls.js.map +0 -1
- package/dist/agents/AdapterStatePaths.d.ts +0 -12
- package/dist/agents/AdapterStatePaths.js +0 -46
- package/dist/agents/AdapterStatePaths.js.map +0 -1
- package/dist/agents/AgentAdapter.d.ts +0 -44
- package/dist/agents/AgentAdapter.js +0 -2
- package/dist/agents/AgentAdapter.js.map +0 -1
- package/dist/agents/AgentRegistry.d.ts +0 -6
- package/dist/agents/AgentRegistry.js +0 -17
- package/dist/agents/AgentRegistry.js.map +0 -1
- package/dist/agents/LaunchResources.d.ts +0 -17
- package/dist/agents/LaunchResources.js +0 -61
- package/dist/agents/LaunchResources.js.map +0 -1
- package/dist/agents/OutfitterSkill.d.ts +0 -11
- package/dist/agents/OutfitterSkill.js +0 -128
- package/dist/agents/OutfitterSkill.js.map +0 -1
- package/dist/agents/ResourceIdentity.d.ts +0 -2
- package/dist/agents/ResourceIdentity.js +0 -51
- package/dist/agents/ResourceIdentity.js.map +0 -1
- package/dist/agents/claude/ClaudeAdapter.d.ts +0 -2
- package/dist/agents/claude/ClaudeAdapter.js +0 -148
- package/dist/agents/claude/ClaudeAdapter.js.map +0 -1
- package/dist/agents/claude/ClaudeCompositeProfileWriter.d.ts +0 -5
- package/dist/agents/claude/ClaudeCompositeProfileWriter.js +0 -7
- package/dist/agents/claude/ClaudeCompositeProfileWriter.js.map +0 -1
- package/dist/agents/pi/PiAdapter.d.ts +0 -2
- package/dist/agents/pi/PiAdapter.js +0 -363
- package/dist/agents/pi/PiAdapter.js.map +0 -1
- package/dist/agents/pi/PiArgs.d.ts +0 -2
- package/dist/agents/pi/PiArgs.js +0 -15
- package/dist/agents/pi/PiArgs.js.map +0 -1
- package/dist/agents/pi/PiCompositeProfileWriter.d.ts +0 -5
- package/dist/agents/pi/PiCompositeProfileWriter.js +0 -7
- package/dist/agents/pi/PiCompositeProfileWriter.js.map +0 -1
- package/dist/agents/pi/PiExtensionCache.d.ts +0 -12
- package/dist/agents/pi/PiExtensionCache.js +0 -195
- package/dist/agents/pi/PiExtensionCache.js.map +0 -1
- package/dist/agents/pi/PiMcpConfig.d.ts +0 -2
- package/dist/agents/pi/PiMcpConfig.js +0 -114
- package/dist/agents/pi/PiMcpConfig.js.map +0 -1
- package/dist/agents/pi/PiSettingsMergePolicy.d.ts +0 -17
- package/dist/agents/pi/PiSettingsMergePolicy.js +0 -59
- package/dist/agents/pi/PiSettingsMergePolicy.js.map +0 -1
- package/dist/agents/pi/PiSkillSources.d.ts +0 -8
- package/dist/agents/pi/PiSkillSources.js +0 -73
- package/dist/agents/pi/PiSkillSources.js.map +0 -1
- package/dist/cli/commands/FirstRunWelcomeProfile.d.ts +0 -11
- package/dist/cli/commands/FirstRunWelcomeProfile.js +0 -110
- package/dist/cli/commands/FirstRunWelcomeProfile.js.map +0 -1
- package/dist/cli/commands/PiLoginLaunch.d.ts +0 -22
- package/dist/cli/commands/PiLoginLaunch.js +0 -170
- package/dist/cli/commands/PiLoginLaunch.js.map +0 -1
- package/dist/cli/commands/RunCommand.d.ts +0 -36
- package/dist/cli/commands/RunCommand.js +0 -345
- package/dist/cli/commands/RunCommand.js.map +0 -1
- package/dist/cli/commands/SyncCommand.d.ts +0 -46
- package/dist/cli/commands/SyncCommand.js +0 -244
- package/dist/cli/commands/SyncCommand.js.map +0 -1
- package/dist/cli/commands/WelcomeCommand.d.ts +0 -56
- package/dist/cli/commands/WelcomeCommand.js +0 -224
- package/dist/cli/commands/WelcomeCommand.js.map +0 -1
- package/dist/cli/commands/assets/outfitter-ascii.txt +0 -5
- package/dist/cli/commands/profile/Command.d.ts +0 -7
- package/dist/cli/commands/profile/Command.js +0 -24
- package/dist/cli/commands/profile/Command.js.map +0 -1
- package/dist/cli/commands/profile/CreateCommand.d.ts +0 -19
- package/dist/cli/commands/profile/CreateCommand.js +0 -115
- package/dist/cli/commands/profile/CreateCommand.js.map +0 -1
- package/dist/cli/commands/profile/LintCommand.d.ts +0 -19
- package/dist/cli/commands/profile/LintCommand.js +0 -155
- package/dist/cli/commands/profile/LintCommand.js.map +0 -1
- package/dist/cli/commands/profile/ListCommand.d.ts +0 -19
- package/dist/cli/commands/profile/ListCommand.js +0 -91
- package/dist/cli/commands/profile/ListCommand.js.map +0 -1
- package/dist/cli/commands/profile/Shared.d.ts +0 -9
- package/dist/cli/commands/profile/Shared.js +0 -10
- package/dist/cli/commands/profile/Shared.js.map +0 -1
- package/dist/cli/commands/run/RunFirstRunOnboarding.d.ts +0 -7
- package/dist/cli/commands/run/RunFirstRunOnboarding.js +0 -52
- package/dist/cli/commands/run/RunFirstRunOnboarding.js.map +0 -1
- package/dist/cli/commands/run/RunLaunchSummary.d.ts +0 -2
- package/dist/cli/commands/run/RunLaunchSummary.js +0 -35
- package/dist/cli/commands/run/RunLaunchSummary.js.map +0 -1
- package/dist/cli/commands/run/RunProfileResolution.d.ts +0 -39
- package/dist/cli/commands/run/RunProfileResolution.js +0 -128
- package/dist/cli/commands/run/RunProfileResolution.js.map +0 -1
- package/dist/cli/commands/run/RunStateWritePrompt.d.ts +0 -2
- package/dist/cli/commands/run/RunStateWritePrompt.js +0 -29
- package/dist/cli/commands/run/RunStateWritePrompt.js.map +0 -1
- package/dist/cli/commands/setup/SetupPrompts.d.ts +0 -14
- package/dist/cli/commands/setup/SetupPrompts.js +0 -296
- package/dist/cli/commands/setup/SetupPrompts.js.map +0 -1
- package/dist/cli/commands/setup/SetupSourceImport.d.ts +0 -5
- package/dist/cli/commands/setup/SetupSourceImport.js +0 -177
- package/dist/cli/commands/setup/SetupSourceImport.js.map +0 -1
- package/dist/cli/commands/setup/SetupSourceLaunch.d.ts +0 -4
- package/dist/cli/commands/setup/SetupSourceLaunch.js +0 -65
- package/dist/cli/commands/setup/SetupSourceLaunch.js.map +0 -1
- package/dist/cli/commands/setup/SetupStarterSource.d.ts +0 -21
- package/dist/cli/commands/setup/SetupStarterSource.js +0 -133
- package/dist/cli/commands/setup/SetupStarterSource.js.map +0 -1
- package/dist/cli/commands/setup/SetupTypes.d.ts +0 -91
- package/dist/cli/commands/setup/SetupTypes.js +0 -26
- package/dist/cli/commands/setup/SetupTypes.js.map +0 -1
- package/dist/compositeProfile/CompositeProfile.d.ts +0 -8
- package/dist/compositeProfile/CompositeProfile.js +0 -6
- package/dist/compositeProfile/CompositeProfile.js.map +0 -1
- package/dist/compositeProfile/CompositeProfileAssembler.d.ts +0 -12
- package/dist/compositeProfile/CompositeProfileAssembler.js +0 -32
- package/dist/compositeProfile/CompositeProfileAssembler.js.map +0 -1
- package/dist/compositeProfile/CompositeProfileCleanup.d.ts +0 -9
- package/dist/compositeProfile/CompositeProfileCleanup.js +0 -87
- package/dist/compositeProfile/CompositeProfileCleanup.js.map +0 -1
- package/dist/compositeProfile/CompositeProfileFile.d.ts +0 -16
- package/dist/compositeProfile/CompositeProfileFile.js +0 -16
- package/dist/compositeProfile/CompositeProfileFile.js.map +0 -1
- package/dist/compositeProfile/CompositeProfileTemplate.d.ts +0 -15
- package/dist/compositeProfile/CompositeProfileTemplate.js +0 -65
- package/dist/compositeProfile/CompositeProfileTemplate.js.map +0 -1
- package/dist/compositeProfile/CompositeProfileWatcher.d.ts +0 -18
- package/dist/compositeProfile/CompositeProfileWatcher.js +0 -46
- package/dist/compositeProfile/CompositeProfileWatcher.js.map +0 -1
- package/dist/compositeProfile/StatePersistence.d.ts +0 -39
- package/dist/compositeProfile/StatePersistence.js +0 -249
- package/dist/compositeProfile/StatePersistence.js.map +0 -1
- package/dist/fs/SafeSymlink.d.ts +0 -13
- package/dist/fs/SafeSymlink.js +0 -50
- package/dist/fs/SafeSymlink.js.map +0 -1
- package/dist/profiles/Profile.d.ts +0 -60
- package/dist/profiles/Profile.js +0 -7
- package/dist/profiles/Profile.js.map +0 -1
- package/dist/profiles/ProfileCache.d.ts +0 -8
- package/dist/profiles/ProfileCache.js.map +0 -1
- package/dist/profiles/ProfileLoader.d.ts +0 -28
- package/dist/profiles/ProfileLoader.js +0 -299
- package/dist/profiles/ProfileLoader.js.map +0 -1
- package/dist/profiles/ProfileMerger.d.ts +0 -19
- package/dist/profiles/ProfileMerger.js +0 -112
- package/dist/profiles/ProfileMerger.js.map +0 -1
- package/dist/profiles/ProfileSource.d.ts +0 -35
- package/dist/profiles/ProfileSource.js +0 -13
- package/dist/profiles/ProfileSource.js.map +0 -1
- package/dist/profiles/PromptIncludes.d.ts +0 -32
- package/dist/profiles/PromptIncludes.js +0 -147
- package/dist/profiles/PromptIncludes.js.map +0 -1
- package/dist/prompts/SystemPromptExport.d.ts +0 -16
- package/dist/prompts/SystemPromptExport.js +0 -81
- package/dist/prompts/SystemPromptExport.js.map +0 -1
- package/dist/schemas/profile-source.schema.json +0 -29
- package/dist/schemas/profile.schema.json +0 -200
- package/dist/skills/ProfileSkillResolution.d.ts +0 -21
- package/dist/skills/ProfileSkillResolution.js +0 -88
- package/dist/skills/ProfileSkillResolution.js.map +0 -1
- package/dist/skills/SkillCatalog.d.ts +0 -41
- package/dist/skills/SkillCatalog.js +0 -119
- package/dist/skills/SkillCatalog.js.map +0 -1
- package/dist/skills/SkillResolution.d.ts +0 -34
- package/dist/skills/SkillResolution.js +0 -369
- package/dist/skills/SkillResolution.js.map +0 -1
- package/docs/documentation/profile-repository.md +0 -179
- package/src/schemas/SchemaDocument.ts +0 -20
- package/src/schemas/profile-source.schema.json +0 -29
- package/src/schemas/profile.schema.json +0 -200
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { PiInstallSpawner } from '../../extensions/PiExtensionCache.js';
|
|
2
|
+
import type { AgentLaunchPlan } from '../../projection/Projection.js';
|
|
3
|
+
import type { SetupResult } from '../../setup/Setup.js';
|
|
4
|
+
import type { CommandObject } from './CommandObject.js';
|
|
5
|
+
export type AgentProcessLauncher = (plan: AgentLaunchPlan) => Promise<number>;
|
|
6
|
+
/**
|
|
7
|
+
* Runs first-run onboarding when `run` finds nothing configured. Returns the setup result, or
|
|
8
|
+
* `undefined` when setup was not performed (e.g. non-interactive), so the caller falls back to the
|
|
9
|
+
* normal "no agent selected" error.
|
|
10
|
+
*/
|
|
11
|
+
export type SetupRunner = (input: {
|
|
12
|
+
homeDirectory: string;
|
|
13
|
+
projectDirectory: string;
|
|
14
|
+
}) => Promise<SetupResult | undefined>;
|
|
15
|
+
export interface RunAgentInput {
|
|
16
|
+
readonly homeDirectory: string;
|
|
17
|
+
readonly projectDirectory: string;
|
|
18
|
+
readonly agent?: string;
|
|
19
|
+
readonly harness?: string;
|
|
20
|
+
readonly strict?: boolean;
|
|
21
|
+
readonly passThroughArgs?: readonly string[];
|
|
22
|
+
readonly launcher: AgentProcessLauncher;
|
|
23
|
+
/** Onboarding to run once when no agent is selected and settings define no `default_agent`. */
|
|
24
|
+
readonly setup?: SetupRunner;
|
|
25
|
+
/** Keep the runtime projection directory after the run (debugging). */
|
|
26
|
+
readonly retainProjection?: boolean;
|
|
27
|
+
/** Sink for setup notices and warnings; emitted before launch so they precede the pi session. */
|
|
28
|
+
readonly writeLine?: (message: string) => void;
|
|
29
|
+
/** Test seam for the `pi install` boundary used to cache pi extensions. */
|
|
30
|
+
readonly extensionInstallSpawner?: PiInstallSpawner;
|
|
31
|
+
}
|
|
32
|
+
export interface RunAgentResult {
|
|
33
|
+
readonly launchPlan?: AgentLaunchPlan;
|
|
34
|
+
readonly exitCode: number;
|
|
35
|
+
readonly messages: readonly string[];
|
|
36
|
+
}
|
|
37
|
+
export interface RunAgentDependencies {
|
|
38
|
+
readonly homeDirectory?: string;
|
|
39
|
+
readonly projectDirectory?: string;
|
|
40
|
+
readonly launcher?: AgentProcessLauncher;
|
|
41
|
+
readonly setup?: SetupRunner;
|
|
42
|
+
readonly writeLine?: (message: string) => void;
|
|
43
|
+
}
|
|
44
|
+
export declare const executeRunAgentCommand: (input: RunAgentInput) => Promise<RunAgentResult>;
|
|
45
|
+
export { launchThroughSpawn } from '../../agents/AgentLaunch.js';
|
|
46
|
+
export declare const createRunAgentCommand: (dependencies?: RunAgentDependencies) => CommandObject;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// `outfitter run [agent]` — resolve → compose → project → launch on the .agents model.
|
|
2
|
+
import { mkdtempSync, rmSync } from 'node:fs';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { Option } from 'commander';
|
|
6
|
+
import { launchThroughSpawn, spawnLauncher } from '../../agents/AgentLaunch.js';
|
|
7
|
+
import { persistPiCredentials, resolvePiUserAgentDirectory, seedPiCredentials, } from '../../agents/PiCredentialPersistence.js';
|
|
8
|
+
import { compose } from '../../composer/Composer.js';
|
|
9
|
+
import { ensurePiExtensions } from '../../extensions/PiExtensionCache.js';
|
|
10
|
+
import { resolveOutfitterCacheDir } from '../../paths/OutfitterCache.js';
|
|
11
|
+
import { projectComposition } from '../../projection/ProjectHarness.js';
|
|
12
|
+
import { findResource } from '../../resolver/Resource.js';
|
|
13
|
+
import { resolveEffectiveSet } from '../../resolver/ResolverContext.js';
|
|
14
|
+
import { HARNESSES } from '../../settings/Settings.js';
|
|
15
|
+
import { attachPiRuntimeExtension } from './PiRuntimeLaunch.js';
|
|
16
|
+
import { resolveHomeDirectory, resolveProjectDirectory } from './ProcessDefaults.js';
|
|
17
|
+
import { runSetup } from './SetupCommand.js';
|
|
18
|
+
/* v8 ignore start -- real-TTY onboarding wiring; the setup state machine is tested via an injected runner. */
|
|
19
|
+
// Onboard only when attached to a real terminal; scripted/CI runs get the normal "no agent" error.
|
|
20
|
+
const interactiveSetupRunner = async ({ homeDirectory, projectDirectory }) => runSetup({ homeDirectory, projectDirectory });
|
|
21
|
+
/* v8 ignore stop */
|
|
22
|
+
const resolveAgentSlug = (settingsDefault, requested) => {
|
|
23
|
+
const slug = requested ?? settingsDefault;
|
|
24
|
+
if (slug === undefined) {
|
|
25
|
+
throw new Error("No agent selected and no 'default_agent' in settings. Pass an agent: outfitter run <agent>.");
|
|
26
|
+
}
|
|
27
|
+
return slug;
|
|
28
|
+
};
|
|
29
|
+
const resolveHarness = (settingsDefault, requested) => {
|
|
30
|
+
const harness = requested ?? settingsDefault ?? 'pi';
|
|
31
|
+
if (!HARNESSES.includes(harness)) {
|
|
32
|
+
throw new Error(`Unknown harness '${harness}'. Use --harness pi or --harness claude.`);
|
|
33
|
+
}
|
|
34
|
+
return harness;
|
|
35
|
+
};
|
|
36
|
+
const assertNoSettingsIssues = (issues) => {
|
|
37
|
+
if (issues.length > 0) {
|
|
38
|
+
throw new Error(`Cannot run with invalid settings: ${issues.map((issue) => issue.message).join('; ')}`);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
// pi stores credentials under PI_CODING_AGENT_DIR (the ephemeral projection root), so seed them from
|
|
42
|
+
// pi's durable agent dir before launch and copy any /login changes back afterward. Non-pi harnesses
|
|
43
|
+
// launch unchanged.
|
|
44
|
+
const launchWithCredentialPersistence = async (input, harness, rootDirectory, launch) => {
|
|
45
|
+
const piUserAgentDirectory = harness === 'pi' ? resolvePiUserAgentDirectory(input.homeDirectory) : undefined;
|
|
46
|
+
if (piUserAgentDirectory !== undefined)
|
|
47
|
+
seedPiCredentials(rootDirectory, piUserAgentDirectory);
|
|
48
|
+
const exitCode = await input.launcher(launch);
|
|
49
|
+
if (piUserAgentDirectory !== undefined)
|
|
50
|
+
persistPiCredentials(rootDirectory, piUserAgentDirectory);
|
|
51
|
+
return exitCode;
|
|
52
|
+
};
|
|
53
|
+
// Installs/caches the pi extensions for the composed agent (pi only) so they load at launch.
|
|
54
|
+
const resolvePiExtensions = async (input, harness, extensionSpecs) => {
|
|
55
|
+
if (harness !== 'pi')
|
|
56
|
+
return { loadDirs: [], warnings: [] };
|
|
57
|
+
return ensurePiExtensions(extensionSpecs, {
|
|
58
|
+
cacheAgentDir: join(resolveOutfitterCacheDir(process.env, input.homeDirectory), 'pi-extensions'),
|
|
59
|
+
offline: process.env.PI_OFFLINE === '1' || process.env.PI_OFFLINE === 'true',
|
|
60
|
+
spawn: input.extensionInstallSpawner,
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
export const executeRunAgentCommand = async (input) => {
|
|
64
|
+
// Flush messages to the terminal (before launch); they are also returned so callers can inspect them.
|
|
65
|
+
const emit = (messages) => {
|
|
66
|
+
for (const message of messages)
|
|
67
|
+
input.writeLine?.(message);
|
|
68
|
+
};
|
|
69
|
+
let resolved = resolveEffectiveSet(input);
|
|
70
|
+
assertNoSettingsIssues(resolved.settingsIssues);
|
|
71
|
+
// First run: nothing selected and no default configured — onboard, then resolve again.
|
|
72
|
+
const setupMessages = [];
|
|
73
|
+
if (input.agent === undefined && resolved.settings.defaultAgent === undefined && input.setup !== undefined) {
|
|
74
|
+
const setupResult = await input.setup({
|
|
75
|
+
homeDirectory: input.homeDirectory,
|
|
76
|
+
projectDirectory: input.projectDirectory,
|
|
77
|
+
});
|
|
78
|
+
if (setupResult !== undefined) {
|
|
79
|
+
setupMessages.push(...setupResult.messages);
|
|
80
|
+
resolved = resolveEffectiveSet(input);
|
|
81
|
+
assertNoSettingsIssues(resolved.settingsIssues);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const { set, settings } = resolved;
|
|
85
|
+
const agentSlug = resolveAgentSlug(settings.defaultAgent, input.agent);
|
|
86
|
+
const harness = resolveHarness(settings.defaultHarness, input.harness);
|
|
87
|
+
const composed = compose(set, agentSlug);
|
|
88
|
+
if (composed.plan === undefined) {
|
|
89
|
+
const messages = [...setupMessages, ...composed.errors];
|
|
90
|
+
emit(messages);
|
|
91
|
+
return { exitCode: 1, messages };
|
|
92
|
+
}
|
|
93
|
+
// Install/cache the pi extensions into a shared XDG cache and load them at launch (pi only).
|
|
94
|
+
const extensions = await resolvePiExtensions(input, harness, composed.plan.loadout.extensions);
|
|
95
|
+
const selectedAgent = findResource(set, 'agent', agentSlug);
|
|
96
|
+
const rootDirectory = mkdtempSync(join(tmpdir(), `outfitter-${agentSlug}-${harness}-`));
|
|
97
|
+
try {
|
|
98
|
+
const projection = projectComposition(composed.plan, {
|
|
99
|
+
harness,
|
|
100
|
+
rootDirectory,
|
|
101
|
+
homeDirectory: input.homeDirectory,
|
|
102
|
+
passThroughArgs: input.passThroughArgs,
|
|
103
|
+
extensionLoadDirs: harness === 'pi' ? extensions.loadDirs : undefined,
|
|
104
|
+
// ProjectHarness only overlays these for the pi harness, so pass them through unconditionally.
|
|
105
|
+
configurationOverlayDirectories: selectedAgent.piConfigDirectories,
|
|
106
|
+
});
|
|
107
|
+
// Composition warnings, unsupported harness elements, and extension-install failures are all
|
|
108
|
+
// advisory; --strict makes the combined set fatal before launch.
|
|
109
|
+
const warnings = [
|
|
110
|
+
...composed.plan.warnings,
|
|
111
|
+
...projection.unsupported.map((element) => `harness '${harness}' cannot project loadout element '${element}'.`),
|
|
112
|
+
...extensions.warnings,
|
|
113
|
+
];
|
|
114
|
+
if (input.strict === true && warnings.length > 0) {
|
|
115
|
+
const messages = [
|
|
116
|
+
...setupMessages,
|
|
117
|
+
...warnings,
|
|
118
|
+
'Strict mode: composition warnings and unsupported elements are fatal.',
|
|
119
|
+
];
|
|
120
|
+
emit(messages);
|
|
121
|
+
return { exitCode: 1, messages };
|
|
122
|
+
}
|
|
123
|
+
// Emit setup notices and warnings before launch so they precede the pi session on the terminal.
|
|
124
|
+
const messages = [...setupMessages, ...warnings];
|
|
125
|
+
emit(messages);
|
|
126
|
+
// Attach the Outfitter runtime extension so interactive pi sessions restore the "connect a
|
|
127
|
+
// model provider" sign-in prompt when no models are available, instead of pi's raw warning.
|
|
128
|
+
const launch = attachPiRuntimeExtension(projection.launch);
|
|
129
|
+
const exitCode = await launchWithCredentialPersistence(input, harness, rootDirectory, launch);
|
|
130
|
+
return { launchPlan: launch, exitCode, messages };
|
|
131
|
+
}
|
|
132
|
+
finally {
|
|
133
|
+
if (input.retainProjection !== true) {
|
|
134
|
+
rmSync(rootDirectory, { recursive: true, force: true });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
// Re-exported for tests and sibling commands; the shared launcher lives in AgentLaunch.
|
|
139
|
+
export { launchThroughSpawn } from '../../agents/AgentLaunch.js';
|
|
140
|
+
/* v8 ignore next -- wiring to the real spawn boundary; launchThroughSpawn itself is unit-tested. */
|
|
141
|
+
const defaultLauncher = (plan) => launchThroughSpawn(spawnLauncher, plan);
|
|
142
|
+
export const createRunAgentCommand = (dependencies = {}) => ({
|
|
143
|
+
name: 'run',
|
|
144
|
+
description: 'Resolve, compose, and launch an agent in the selected harness.',
|
|
145
|
+
register(program) {
|
|
146
|
+
program
|
|
147
|
+
.command('run', { isDefault: true })
|
|
148
|
+
.description('Resolve, compose, and launch an agent in the selected harness.')
|
|
149
|
+
.argument('[agent]', 'Agent slug to run (default: settings default_agent).')
|
|
150
|
+
.argument('[args...]', 'Arguments passed through to the harness after --.')
|
|
151
|
+
.addOption(new Option('--harness <harness>', 'Harness to launch.').choices([...HARNESSES]))
|
|
152
|
+
.option('--strict', 'Treat composition warnings and unsupported loadout elements as fatal.')
|
|
153
|
+
.allowUnknownOption(true)
|
|
154
|
+
.action(async (agent, passThroughArgs, options) => {
|
|
155
|
+
/* v8 ignore next 3 -- process/launcher defaults are exercised by the CLI entrypoint, not unit tests. */
|
|
156
|
+
const homeDirectory = resolveHomeDirectory(dependencies.homeDirectory);
|
|
157
|
+
const projectDirectory = resolveProjectDirectory(dependencies.projectDirectory);
|
|
158
|
+
const launcher = dependencies.launcher ?? defaultLauncher;
|
|
159
|
+
const result = await executeRunAgentCommand({
|
|
160
|
+
homeDirectory,
|
|
161
|
+
projectDirectory,
|
|
162
|
+
agent,
|
|
163
|
+
harness: options.harness,
|
|
164
|
+
strict: options.strict,
|
|
165
|
+
passThroughArgs,
|
|
166
|
+
launcher,
|
|
167
|
+
setup: dependencies.setup ?? interactiveSetupRunner,
|
|
168
|
+
// executeRunAgentCommand emits messages (before launch) through this sink.
|
|
169
|
+
/* v8 ignore next -- console.error fallback is direct CLI behavior; tests inject a writer. */
|
|
170
|
+
writeLine: dependencies.writeLine ?? console.error,
|
|
171
|
+
});
|
|
172
|
+
process.exitCode = result.exitCode;
|
|
173
|
+
});
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
//# sourceMappingURL=RunAgentCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RunAgentCommand.js","sourceRoot":"","sources":["../../../src/cli/commands/RunAgentCommand.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE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BACf,QAAQ;gBACR,KAAK,EAAE,YAAY,CAAC,KAAK,IAAI,sBAAsB;gBACnD,2EAA2E;gBAC3E,6FAA6F;gBAC7F,SAAS,EAAE,YAAY,CAAC,SAAS,IAAI,OAAO,CAAC,KAAK;aACnD,CAAC,CAAC;YAEH,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QACrC,CAAC,CACF,CAAC;IACN,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,8 +1,40 @@
|
|
|
1
|
+
import type { AgentLaunchPlan } from '../../projection/Projection.js';
|
|
2
|
+
import type { SetupAgentChoice, SetupResult } from '../../setup/Setup.js';
|
|
1
3
|
import type { CommandObject } from './CommandObject.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export type SetupProcessLauncher = (plan: AgentLaunchPlan) => Promise<number>;
|
|
5
|
+
export interface SetupCommandDependencies {
|
|
6
|
+
readonly homeDirectory?: string;
|
|
7
|
+
readonly projectDirectory?: string;
|
|
8
|
+
readonly defaultCatalogBootstrap?: (homeDirectory: string) => string;
|
|
9
|
+
readonly setupSourceUri?: string;
|
|
10
|
+
readonly interactive?: boolean;
|
|
11
|
+
readonly launcher?: SetupProcessLauncher;
|
|
12
|
+
/** Launcher for the profile pi started after setup; defaults to the real spawn boundary. */
|
|
13
|
+
readonly runLauncher?: SetupProcessLauncher;
|
|
14
|
+
readonly writeLine?: (message: string) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface PiSetupLaunch {
|
|
17
|
+
readonly plan: AgentLaunchPlan;
|
|
18
|
+
readonly resultPath: string;
|
|
19
|
+
}
|
|
20
|
+
interface PreparePiSetupLaunchInput {
|
|
21
|
+
readonly homeDirectory: string;
|
|
22
|
+
readonly projectDirectory: string;
|
|
23
|
+
readonly setupDirectory: string;
|
|
24
|
+
readonly availableAgents: readonly SetupAgentChoice[];
|
|
25
|
+
readonly setupSourceUri?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const createPiSetupExtensionContent: (input: {
|
|
28
|
+
readonly homeDirectory: string;
|
|
29
|
+
readonly projectDirectory: string;
|
|
30
|
+
readonly resultPath: string;
|
|
31
|
+
readonly availableAgents: readonly SetupAgentChoice[];
|
|
32
|
+
readonly currentDefault?: string;
|
|
33
|
+
readonly setupSourceUri?: string;
|
|
34
|
+
}) => string;
|
|
35
|
+
/** Creates an isolated, model-free Pi setup launch using the bundled extension. */
|
|
36
|
+
export declare const preparePiSetupLaunch: (input: PreparePiSetupLaunchInput) => PiSetupLaunch;
|
|
37
|
+
/** Launches the walkthrough, then applies its result through the shared setup state machine. */
|
|
38
|
+
export declare const runSetup: (dependencies?: SetupCommandDependencies) => Promise<SetupResult | undefined>;
|
|
8
39
|
export declare const createSetupCommand: (dependencies?: SetupCommandDependencies) => CommandObject;
|
|
40
|
+
export {};
|