@ai-outfitter/outfitter 0.8.0 → 0.10.0
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 +86 -0
- package/README.md +10 -0
- package/code/pi-extension/src/outfitter-extension.js +11 -0
- package/dist/agents/AdapterProfileControls.js +2 -2
- package/dist/agents/AdapterProfileControls.js.map +1 -1
- package/dist/agents/AdapterStatePaths.js +3 -1
- package/dist/agents/AdapterStatePaths.js.map +1 -1
- package/dist/agents/AgentAdapter.d.ts +1 -2
- package/dist/agents/LaunchResources.d.ts +4 -0
- package/dist/agents/LaunchResources.js +27 -1
- package/dist/agents/LaunchResources.js.map +1 -1
- package/dist/agents/OutfitterSkill.d.ts +11 -0
- package/dist/agents/OutfitterSkill.js +128 -0
- package/dist/agents/OutfitterSkill.js.map +1 -0
- package/dist/agents/claude/ClaudeAdapter.js +19 -3
- package/dist/agents/claude/ClaudeAdapter.js.map +1 -1
- package/dist/agents/pi/PiAdapter.js +13 -17
- package/dist/agents/pi/PiAdapter.js.map +1 -1
- package/dist/agents/pi/PiArgs.js +1 -1
- package/dist/agents/pi/PiArgs.js.map +1 -1
- package/dist/agents/pi/PiExtensionCache.d.ts +8 -0
- package/dist/agents/pi/PiExtensionCache.js +95 -5
- package/dist/agents/pi/PiExtensionCache.js.map +1 -1
- package/dist/agents/pi/PiSkillSources.js +5 -1
- package/dist/agents/pi/PiSkillSources.js.map +1 -1
- package/dist/cli/OutfitterCli.js +0 -2
- package/dist/cli/OutfitterCli.js.map +1 -1
- package/dist/cli/commands/PiLoginLaunch.d.ts +5 -0
- package/dist/cli/commands/PiLoginLaunch.js +5 -9
- package/dist/cli/commands/PiLoginLaunch.js.map +1 -1
- package/dist/cli/commands/RunCommand.d.ts +2 -2
- package/dist/cli/commands/RunCommand.js +140 -55
- package/dist/cli/commands/RunCommand.js.map +1 -1
- package/dist/cli/commands/SyncCommand.d.ts +1 -1
- package/dist/cli/commands/SyncCommand.js +37 -12
- package/dist/cli/commands/SyncCommand.js.map +1 -1
- package/dist/cli/commands/profile/LintCommand.js +33 -1
- package/dist/cli/commands/profile/LintCommand.js.map +1 -1
- package/dist/cli/commands/run/RunFirstRunOnboarding.d.ts +7 -0
- package/dist/cli/commands/run/RunFirstRunOnboarding.js +52 -0
- package/dist/cli/commands/run/RunFirstRunOnboarding.js.map +1 -0
- package/dist/cli/commands/run/RunProfileResolution.d.ts +2 -0
- package/dist/cli/commands/run/RunProfileResolution.js +14 -1
- package/dist/cli/commands/run/RunProfileResolution.js.map +1 -1
- package/dist/cli/commands/run/RunStateWritePrompt.d.ts +2 -0
- package/dist/cli/commands/run/RunStateWritePrompt.js +29 -0
- package/dist/cli/commands/run/RunStateWritePrompt.js.map +1 -0
- package/dist/compositeProfile/CompositeProfileCleanup.d.ts +9 -0
- package/dist/compositeProfile/CompositeProfileCleanup.js +87 -0
- package/dist/compositeProfile/CompositeProfileCleanup.js.map +1 -0
- package/dist/compositeProfile/StatePersistence.d.ts +16 -1
- package/dist/compositeProfile/StatePersistence.js +27 -5
- package/dist/compositeProfile/StatePersistence.js.map +1 -1
- package/dist/fs/SafeSymlink.d.ts +13 -0
- package/dist/fs/SafeSymlink.js +50 -0
- package/dist/fs/SafeSymlink.js.map +1 -0
- package/dist/profiles/Profile.d.ts +14 -1
- package/dist/profiles/Profile.js.map +1 -1
- package/dist/profiles/ProfileLoader.js +18 -2
- package/dist/profiles/ProfileLoader.js.map +1 -1
- package/dist/profiles/ProfileMerger.js +3 -2
- package/dist/profiles/ProfileMerger.js.map +1 -1
- package/dist/schemas/profile.schema.json +40 -3
- package/dist/settings/SettingsLoader.d.ts +1 -0
- package/dist/settings/SettingsLoader.js +10 -1
- package/dist/settings/SettingsLoader.js.map +1 -1
- package/dist/skills/ProfileSkillResolution.d.ts +21 -0
- package/dist/skills/ProfileSkillResolution.js +88 -0
- package/dist/skills/ProfileSkillResolution.js.map +1 -0
- package/dist/skills/SkillCatalog.d.ts +41 -0
- package/dist/skills/SkillCatalog.js +119 -0
- package/dist/skills/SkillCatalog.js.map +1 -0
- package/dist/skills/SkillDocument.d.ts +21 -0
- package/dist/skills/SkillDocument.js +85 -0
- package/dist/skills/SkillDocument.js.map +1 -0
- package/dist/skills/SkillResolution.d.ts +34 -0
- package/dist/skills/SkillResolution.js +217 -0
- package/dist/skills/SkillResolution.js.map +1 -0
- package/{doc → docs}/documentation/README.md +4 -1
- package/docs/documentation/actions.md +97 -0
- package/docs/documentation/best-practices.md +105 -0
- package/{doc → docs}/documentation/profile-repository.md +74 -6
- package/docs/documentation/skills.md +436 -0
- package/{doc → docs}/documentation/state.md +22 -2
- package/{doc → docs}/documentation/support-matrix.md +4 -1
- package/package.json +4 -8
- package/src/schemas/profile.schema.json +40 -3
- package/dist/agents/OutfitterDocs.d.ts +0 -2
- package/dist/agents/OutfitterDocs.js +0 -38
- package/dist/agents/OutfitterDocs.js.map +0 -1
- package/skills/outfitter/SKILL.md +0 -68
- /package/{doc → docs}/architecture/state_writeback_strategy.md +0 -0
- /package/{doc → docs}/documentation/cli.md +0 -0
- /package/{doc → docs}/documentation/concepts.md +0 -0
- /package/{doc → docs}/documentation/first-time-cli-agent-users.md +0 -0
- /package/{doc → docs}/documentation/getting-started.md +0 -0
- /package/{doc → docs}/documentation/iterating-on-profiles.md +0 -0
- /package/{doc → docs}/documentation/profiles.md +0 -0
- /package/{doc → docs}/documentation/switching-to-outfitter.md +0 -0
- /package/{doc → docs}/documentation/usecases/engineering.md +0 -0
- /package/{doc → docs}/documentation/usecases/organization-profile-catalog.md +0 -0
- /package/{doc → docs}/documentation/usecases/persona-reviews.md +0 -0
- /package/{doc → docs}/philosophy.md +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: outfitter
|
|
3
|
+
description: Explain Outfitter and help users create, inspect, and maintain Outfitter profiles, settings, skills, and setup sources. Use when a user asks about Outfitter itself — profiles, profile.yml files, profile sources and catalogs, skills, state persistence, launch configuration — or asks to set up, change, or debug an Outfitter-managed launch.
|
|
4
|
+
|
|
5
|
+
references:
|
|
6
|
+
- file: docs/documentation/README.md
|
|
7
|
+
- file: docs/documentation/getting-started.md
|
|
8
|
+
- file: docs/documentation/concepts.md
|
|
9
|
+
- file: docs/documentation/cli.md
|
|
10
|
+
- file: docs/documentation/profiles.md
|
|
11
|
+
- file: docs/documentation/profile-repository.md
|
|
12
|
+
- file: docs/documentation/skills.md
|
|
13
|
+
- file: docs/documentation/state.md
|
|
14
|
+
- file: docs/documentation/support-matrix.md
|
|
15
|
+
- file: docs/documentation/best-practices.md
|
|
16
|
+
- file: docs/documentation/actions.md
|
|
17
|
+
- file: docs/documentation/switching-to-outfitter.md
|
|
18
|
+
- file: docs/documentation/first-time-cli-agent-users.md
|
|
19
|
+
- file: docs/documentation/iterating-on-profiles.md
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Outfitter
|
|
23
|
+
|
|
24
|
+
Use this skill to answer questions about Outfitter and to guide changes to
|
|
25
|
+
Outfitter-managed profiles, settings, and launches. Classify the request, read
|
|
26
|
+
only the relevant reference, and follow its cross-references before answering
|
|
27
|
+
or editing configuration.
|
|
28
|
+
|
|
29
|
+
## Routing
|
|
30
|
+
|
|
31
|
+
- New to Outfitter, installing, or first launch: read
|
|
32
|
+
`references/getting-started.md`.
|
|
33
|
+
- How a launch works — settings, profile resolution, layering, composite
|
|
34
|
+
profiles: read `references/concepts.md`.
|
|
35
|
+
- Command flags and syntax for `outfitter run`, `setup`, `sync`, or
|
|
36
|
+
`profile ...`: read `references/cli.md`.
|
|
37
|
+
- Writing or editing profiles, profile layouts, inheritance, prompt includes:
|
|
38
|
+
read `references/profiles.md`.
|
|
39
|
+
- Shared profile catalogs, setup sources, publishing profiles or skills for
|
|
40
|
+
other users: read `references/profile-repository.md`.
|
|
41
|
+
- Authoring or selecting skills, SKILL.md layout, skill references: read
|
|
42
|
+
`references/skills.md`.
|
|
43
|
+
- What persists between runs, state persistence strategies, prompt choices:
|
|
44
|
+
read `references/state.md`.
|
|
45
|
+
- What Outfitter can control per agent CLI (pi, Claude Code): read
|
|
46
|
+
`references/support-matrix.md`.
|
|
47
|
+
- Structuring profiles versus skills, keeping instructions in one place: read
|
|
48
|
+
`references/best-practices.md`.
|
|
49
|
+
- Running profiles headlessly in GitHub Actions: read `references/actions.md`.
|
|
50
|
+
- Migrating from another agent CLI setup: read
|
|
51
|
+
`references/switching-to-outfitter.md`.
|
|
52
|
+
- Never used a CLI coding agent before: read
|
|
53
|
+
`references/first-time-cli-agent-users.md`.
|
|
54
|
+
- Improving the currently active profile, including this launch's own
|
|
55
|
+
configuration: read `references/iterating-on-profiles.md`.
|
|
56
|
+
|
|
57
|
+
`references/README.md` is the documentation index if no entry above fits.
|
|
58
|
+
|
|
59
|
+
## Working on Outfitter configuration
|
|
60
|
+
|
|
61
|
+
1. Inspect the current configuration before editing:
|
|
62
|
+
- `.outfitter/settings.yml` and `.outfitter/local/settings.yml`
|
|
63
|
+
- `.outfitter/profiles/` and `.outfitter/skills/`
|
|
64
|
+
- `~/.outfitter/settings.yml` and `~/.outfitter/profiles/`
|
|
65
|
+
2. Prefer Outfitter commands over manual file edits:
|
|
66
|
+
- `outfitter profile list` to inspect available profiles
|
|
67
|
+
- `outfitter profile create <id> --scope user|project|project-local` to
|
|
68
|
+
scaffold profiles
|
|
69
|
+
- `outfitter profile lint` to validate profiles and skill references
|
|
70
|
+
- `outfitter setup <source>` to import setup sources
|
|
71
|
+
- `outfitter sync` to refresh remote profile sources
|
|
72
|
+
- `outfitter run --profile <id>` to verify launch behavior
|
|
73
|
+
3. Keep each instruction in one place: durable operating context belongs in
|
|
74
|
+
the profile, per-capability procedure belongs in a skill
|
|
75
|
+
(`references/best-practices.md`).
|
|
76
|
+
4. Validate changes with `outfitter profile lint` and, when possible, a smoke
|
|
77
|
+
test such as `outfitter run --profile <id> -- --help`.
|
|
78
|
+
|
|
79
|
+
## Default behavior
|
|
80
|
+
|
|
81
|
+
If the user asks for help with Outfitter without a specific request:
|
|
82
|
+
|
|
83
|
+
1. Run `outfitter profile list` to show available profiles.
|
|
84
|
+
2. Summarize the profiles by name, scope or source, and default status.
|
|
85
|
+
3. Ask whether the user wants to create or change a profile, and read
|
|
86
|
+
`references/profiles.md` before scaffolding one.
|
package/README.md
CHANGED
|
@@ -8,6 +8,14 @@ If you have not tried [Pi](https://pi.dev) yet, Outfitter is the quickest path t
|
|
|
8
8
|
|
|
9
9
|
The first time outfitter runs it will start the setup flow to choose profiles and setup a model if pi is not already configured with one.
|
|
10
10
|
|
|
11
|
+
Run without installing.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx @ai-outfitter/outfitter
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Full install
|
|
18
|
+
|
|
11
19
|
```bash
|
|
12
20
|
npm install -g @ai-outfitter/outfitter
|
|
13
21
|
outfitter
|
|
@@ -43,6 +51,8 @@ controls:
|
|
|
43
51
|
- [Getting started](./docs/documentation/getting-started.md)
|
|
44
52
|
- [What works today: adapter support matrix](./docs/documentation/support-matrix.md)
|
|
45
53
|
- [Profiles](./docs/documentation/profiles.md)
|
|
54
|
+
- [Skills](./docs/documentation/skills.md)
|
|
55
|
+
- [Best practices](./docs/documentation/best-practices.md)
|
|
46
56
|
- [Profile repositories](./docs/documentation/profile-repository.md)
|
|
47
57
|
- [State persistence](./docs/documentation/state.md)
|
|
48
58
|
- [First-time CLI agent users](./docs/documentation/first-time-cli-agent-users.md)
|
|
@@ -11,6 +11,7 @@ const OUTFITTER_PROJECT = "__OUTFITTER_PROJECT__";
|
|
|
11
11
|
const OUTFITTER_DEFAULT_PROFILES_PATH = "__OUTFITTER_DEFAULT_PROFILES_PATH__";
|
|
12
12
|
const OUTFITTER_SETUP_SOURCE_URI = "__OUTFITTER_SETUP_SOURCE_URI__";
|
|
13
13
|
const OUTFITTER_AUTO_OPEN = "__OUTFITTER_AUTO_OPEN__";
|
|
14
|
+
const OUTFITTER_ACTIVE_PROFILE = "__OUTFITTER_ACTIVE_PROFILE__";
|
|
14
15
|
const OUTFITTER_DEFAULT_SETTINGS_TEMPLATE = "__OUTFITTER_DEFAULT_SETTINGS_TEMPLATE__";
|
|
15
16
|
const OUTFITTER_STARTUP_ASCII_ART = "__OUTFITTER_STARTUP_ASCII_ART__";
|
|
16
17
|
const OUTFITTER_ASCII_ART = "__OUTFITTER_ASCII_ART__";
|
|
@@ -28,6 +29,15 @@ export default function outfitter(pi) {
|
|
|
28
29
|
ctx.ui.setStatus("outfitter-mode", ctx.ui.theme.fg(color, "mode: " + mode));
|
|
29
30
|
};
|
|
30
31
|
|
|
32
|
+
const updateProfileStatus = (ctx) => {
|
|
33
|
+
// Stays a string when the placeholder is unstamped (file loaded outside an
|
|
34
|
+
// Outfitter launch) and `undefined` when the launch had no resolved profile.
|
|
35
|
+
if (typeof OUTFITTER_ACTIVE_PROFILE !== "object" || OUTFITTER_ACTIVE_PROFILE === null) return;
|
|
36
|
+
const name = OUTFITTER_ACTIVE_PROFILE.label ?? OUTFITTER_ACTIVE_PROFILE.id;
|
|
37
|
+
if (!name) return;
|
|
38
|
+
ctx.ui.setStatus("outfitter-profile", ctx.ui.theme.fg("muted", "profile: " + name));
|
|
39
|
+
};
|
|
40
|
+
|
|
31
41
|
const enterPlanMode = (ctx) => {
|
|
32
42
|
if (mode !== "plan") {
|
|
33
43
|
buildModeTools = pi.getActiveTools();
|
|
@@ -277,6 +287,7 @@ export default function outfitter(pi) {
|
|
|
277
287
|
};
|
|
278
288
|
});
|
|
279
289
|
updateModeStatus(ctx);
|
|
290
|
+
updateProfileStatus(ctx);
|
|
280
291
|
ctx.ui.onTerminalInput((data) => {
|
|
281
292
|
if (!matchesKey(data, "shift+tab")) return undefined;
|
|
282
293
|
cycleOutfitterMode(ctx);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mergeLaunchResourceSources } from './LaunchResources.js';
|
|
1
|
+
import { mergeLaunchResourceSources, mergeSkillControlSources } from './LaunchResources.js';
|
|
2
2
|
export const genericControlNames = new Set([
|
|
3
3
|
'model',
|
|
4
4
|
'provider',
|
|
@@ -34,7 +34,7 @@ export const mergeAgentSpecificControls = (controls, agentKey) => {
|
|
|
34
34
|
environment: { ...controls.environment, ...agentControls?.environment },
|
|
35
35
|
args: agentControls?.args ?? controls.args,
|
|
36
36
|
extensions: mergeLaunchResourceSources('extension', controls.extensions, agentControls?.extensions),
|
|
37
|
-
skills:
|
|
37
|
+
skills: mergeSkillControlSources(controls.skills, agentControls?.skills),
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
export const flagValue = (flag, value) => value === undefined ? [] : [flag, value];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdapterProfileControls.js","sourceRoot":"","sources":["../../src/agents/AdapterProfileControls.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"AdapterProfileControls.js","sourceRoot":"","sources":["../../src/agents/AdapterProfileControls.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAE5F,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IACzC,OAAO;IACP,UAAU;IACV,UAAU;IACV,aAAa;IACb,MAAM;IACN,kBAAkB;IAClB,mBAAmB;IACnB,YAAY;IACZ,QAAQ;IACR,gBAAgB;IAChB,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,oBAAoB;IACpB,sBAAsB;IACtB,UAAU;IACV,IAAI;IACJ,QAAQ;CACT,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAA6B,EAAqB,EAAE,CACxF,CAAC,GAAG,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,IAA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AAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACxE,CAAC;QAED,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC/B,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,WAAW,CAAC,IAAI,CACd,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,MAAM,CACzB,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,CACxF,CACF,CAAC;IAEF,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,QAA2C,EAA4B,EAAE;IAChG,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC;AAChG,CAAC,CAAC"}
|
|
@@ -10,7 +10,9 @@ export const createDeclaredStatePaths = (input) => {
|
|
|
10
10
|
relativePath,
|
|
11
11
|
strategy,
|
|
12
12
|
directory,
|
|
13
|
-
|
|
13
|
+
// Prompt paths resolve a durable source too, so an interactive "persist" choice
|
|
14
|
+
// after the run has a destination to copy the change to.
|
|
15
|
+
sourcePath: (strategy === 'symlink' || strategy === 'prompt') && relativePath !== 'unknown'
|
|
14
16
|
? input.resolveSourcePath(relativePath, directory)
|
|
15
17
|
: undefined,
|
|
16
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdapterStatePaths.js","sourceRoot":"","sources":["../../src/agents/AdapterStatePaths.ts"],"names":[],"mappings":"AAAA,qEAAqE;A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AK,CAAC,+BAA+B,QAAQ,yBAAyB,YAAY,GAAG,CAAC,CAAC;IACnG,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,cAAiC,EACjC,SAAiB,EACjB,YAAoB,EACpB,SAAkB,EACE,EAAE;IACtB,MAAM,sBAAsB,GAAG,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IAEpF,OAAO,CAAC,GAAG,cAAc,CAAC;SACvB,OAAO,EAAE;SACT,GAAG,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,sBAAsB,CAAC,CAAC;SAC9F,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;AAChD,CAAC,CAAC"}
|
|
@@ -19,8 +19,7 @@ export interface AgentLaunchContext {
|
|
|
19
19
|
readonly profileLayers?: readonly AgentLaunchProfileLayer[];
|
|
20
20
|
readonly projectDirectory?: string;
|
|
21
21
|
readonly cacheDirectory?: string;
|
|
22
|
-
|
|
23
|
-
readonly outfitterDocsDirectory?: string;
|
|
22
|
+
readonly onProgress?: (message: string) => void;
|
|
24
23
|
}
|
|
25
24
|
export interface AgentCompositeProfilePlan {
|
|
26
25
|
readonly compositeProfile: CompositeProfile;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SkillControlEntry } from '../profiles/Profile.js';
|
|
1
2
|
export type LaunchResourceKind = 'extension' | 'skill';
|
|
2
3
|
export type LaunchResourceOrigin = 'generic-controls' | 'agent-controls' | 'profile-controls' | 'settings';
|
|
3
4
|
export interface LaunchResourceEntry {
|
|
@@ -11,3 +12,6 @@ export interface LaunchResourceEntry {
|
|
|
11
12
|
export declare const createLaunchResourceEntries: (kind: LaunchResourceKind, sources: readonly string[] | undefined, origin: LaunchResourceOrigin, precedence: number) => readonly LaunchResourceEntry[];
|
|
12
13
|
export declare const mergeLaunchResourceEntries: (entries: readonly LaunchResourceEntry[]) => readonly LaunchResourceEntry[];
|
|
13
14
|
export declare const mergeLaunchResourceSources: (kind: LaunchResourceKind, lowerPrecedence: readonly string[] | undefined, higherPrecedence: readonly string[] | undefined) => readonly string[] | undefined;
|
|
15
|
+
/** Identity for `controls.skills` entries: bare IDs and `{ id }` objects dedupe together. */
|
|
16
|
+
export declare const skillControlEntryIdentity: (entry: unknown) => string;
|
|
17
|
+
export declare const mergeSkillControlSources: (lowerPrecedence: readonly SkillControlEntry[] | undefined, higherPrecedence: readonly SkillControlEntry[] | undefined) => readonly SkillControlEntry[] | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { isValidSkillId } from '../skills/SkillDocument.js';
|
|
2
2
|
import { normalizeExtensionResourceIdentity, normalizeLaunchResourceIdentity } from './ResourceIdentity.js';
|
|
3
3
|
export const createLaunchResourceEntries = (kind, sources = [], origin, precedence) => sources.map((source) => ({
|
|
4
4
|
kind,
|
|
@@ -32,4 +32,30 @@ const createLaunchResourceIdentity = (kind, source) => {
|
|
|
32
32
|
}
|
|
33
33
|
return normalizeLaunchResourceIdentity(source);
|
|
34
34
|
};
|
|
35
|
+
/** Identity for `controls.skills` entries: bare IDs and `{ id }` objects dedupe together. */
|
|
36
|
+
export const skillControlEntryIdentity = (entry) => {
|
|
37
|
+
if (typeof entry === 'string') {
|
|
38
|
+
const trimmed = entry.trim();
|
|
39
|
+
return isValidSkillId(trimmed) ? `id:${trimmed}` : normalizeLaunchResourceIdentity(trimmed);
|
|
40
|
+
}
|
|
41
|
+
if (entry !== null && typeof entry === 'object' && typeof entry.id === 'string') {
|
|
42
|
+
return `id:${entry.id}`;
|
|
43
|
+
}
|
|
44
|
+
/* v8 ignore next -- schema validation rejects other entry shapes before merging. */
|
|
45
|
+
return normalizeLaunchResourceIdentity(String(entry));
|
|
46
|
+
};
|
|
47
|
+
export const mergeSkillControlSources = (lowerPrecedence, higherPrecedence) => {
|
|
48
|
+
if (lowerPrecedence === undefined && higherPrecedence === undefined) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
const merged = [...(higherPrecedence ?? []), ...(lowerPrecedence ?? [])];
|
|
52
|
+
const winners = new Map();
|
|
53
|
+
for (const entry of merged) {
|
|
54
|
+
const identity = skillControlEntryIdentity(entry);
|
|
55
|
+
if (!winners.has(identity)) {
|
|
56
|
+
winners.set(identity, entry);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return merged.filter((entry) => winners.get(skillControlEntryIdentity(entry)) === entry);
|
|
60
|
+
};
|
|
35
61
|
//# sourceMappingURL=LaunchResources.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LaunchResources.js","sourceRoot":"","sources":["../../src/agents/LaunchResources.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LaunchResources.js","sourceRoot":"","sources":["../../src/agents/LaunchResources.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,kCAAkC,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAc5G,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,IAAwB,EACxB,UAA6B,EAAE,EAC/B,MAA4B,EAC5B,UAAkB,EACc,EAAE,CAClC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvB,IAAI;IACJ,MAAM;IACN,QAAQ,EAAE,4BAA4B,CAAC,IAAI,EAAE,MAAM,CAAC;IACpD,MAAM;IACN,UAAU;CACX,CAAC,CAAC,CAAC;AAEN,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,OAAuC,EAAkC,EAAE;IACpH,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAA+B,C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AE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC;AAC3F,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CompositeProfileFile } from '../compositeProfile/CompositeProfileFile.js';
|
|
2
|
+
export interface OutfitterSkillSource {
|
|
3
|
+
/** Directory containing the authored SKILL.md. */
|
|
4
|
+
readonly skillDirectory: string;
|
|
5
|
+
/** Root that `file:` reference entries resolve from (the repository containing the skill). */
|
|
6
|
+
readonly referenceRootDirectory: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const resolveOutfitterSkillSource: () => OutfitterSkillSource | undefined;
|
|
9
|
+
export declare const outfitterPluginCompositeRelativePath = "outfitter/plugin";
|
|
10
|
+
export declare const outfitterPluginSkillCompositeRelativePath = "outfitter/plugin/skills/outfitter";
|
|
11
|
+
export declare const createOutfitterPluginCompositeFiles: (rootDirectory: string, source?: OutfitterSkillSource | undefined) => readonly CompositeProfileFile[];
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// Materializes Outfitter's own self-documentation skill into composite profiles.
|
|
2
|
+
//
|
|
3
|
+
// The skill is authored as a regular project skill at <repo>/.outfitter/skills/outfitter
|
|
4
|
+
// (see docs/documentation/skills.md) so Outfitter dogfoods the documented skill layout.
|
|
5
|
+
// Outfitter resolves the skill from the repository or packaged npm layout, materializes
|
|
6
|
+
// its declared `file:` references under the generated skill's references/ directory, and
|
|
7
|
+
// publishes the generated skill through each adapter's native skill mechanism. This
|
|
8
|
+
// replaces the earlier append-system-prompt documentation pointer, which only pi
|
|
9
|
+
// launches could read.
|
|
10
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
11
|
+
import { basename, dirname, join } from 'node:path';
|
|
12
|
+
import { fileURLToPath } from 'node:url';
|
|
13
|
+
import { parse } from 'yaml';
|
|
14
|
+
import { createCompositeProfileFile } from '../compositeProfile/CompositeProfileFile.js';
|
|
15
|
+
const packageRootDirectory = join(dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
16
|
+
const skillRelativePath = join('.outfitter', 'skills', 'outfitter');
|
|
17
|
+
// The skill lives at <repo>/.outfitter/skills/outfitter in the repository layout; the
|
|
18
|
+
// packaged npm layout stages the same relative path (with docs/documentation beside it)
|
|
19
|
+
// via scripts/sync-package-assets.mjs.
|
|
20
|
+
export const resolveOutfitterSkillSource = () => {
|
|
21
|
+
const repositoryRoot = join(packageRootDirectory, '..', '..');
|
|
22
|
+
/* v8 ignore else -- packaged npm layout is exercised after pack, not unit tests. */
|
|
23
|
+
if (existsSync(join(repositoryRoot, skillRelativePath, 'SKILL.md'))) {
|
|
24
|
+
return { skillDirectory: join(repositoryRoot, skillRelativePath), referenceRootDirectory: repositoryRoot };
|
|
25
|
+
}
|
|
26
|
+
/* v8 ignore next 6 -- packaged npm layout is exercised after pack, not unit tests. */
|
|
27
|
+
if (existsSync(join(packageRootDirectory, skillRelativePath, 'SKILL.md'))) {
|
|
28
|
+
return {
|
|
29
|
+
skillDirectory: join(packageRootDirectory, skillRelativePath),
|
|
30
|
+
referenceRootDirectory: packageRootDirectory,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/* v8 ignore next -- defensive fallback for installs that exclude the bundled skill. */
|
|
34
|
+
return undefined;
|
|
35
|
+
};
|
|
36
|
+
const createOutfitterSkillCompositeFiles = (rootDirectory, skillCompositeRelativePath, source) => {
|
|
37
|
+
/* v8 ignore next 3 -- defensive fallback for installs that exclude the bundled skill. */
|
|
38
|
+
if (source === undefined) {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
const skillPath = join(source.skillDirectory, 'SKILL.md');
|
|
42
|
+
const skillMarkdown = readFileSync(skillPath, 'utf8');
|
|
43
|
+
return [
|
|
44
|
+
createCompositeProfileFile({
|
|
45
|
+
rootDirectory,
|
|
46
|
+
relativePath: `${skillCompositeRelativePath}/SKILL.md`,
|
|
47
|
+
content: skillMarkdown,
|
|
48
|
+
sourceInputs: [skillPath],
|
|
49
|
+
strategy: 'transform',
|
|
50
|
+
}),
|
|
51
|
+
...createReferenceFiles(rootDirectory, skillCompositeRelativePath, source, skillMarkdown, skillPath),
|
|
52
|
+
];
|
|
53
|
+
};
|
|
54
|
+
// The generated skill lives inside a Claude-plugin-shaped bundle under the composite
|
|
55
|
+
// profile's outfitter/ namespace, so agent writes there are never mistaken for user
|
|
56
|
+
// state and profile-selected skills generated under outfitter/skills/ cannot collide
|
|
57
|
+
// with it. Claude launches load the bundle with --plugin-dir (the skills/ state path
|
|
58
|
+
// stays reserved for user skills); pi launches pass the inner skill directory with
|
|
59
|
+
// --skill.
|
|
60
|
+
export const outfitterPluginCompositeRelativePath = 'outfitter/plugin';
|
|
61
|
+
export const outfitterPluginSkillCompositeRelativePath = `${outfitterPluginCompositeRelativePath}/skills/outfitter`;
|
|
62
|
+
export const createOutfitterPluginCompositeFiles = (rootDirectory, source = resolveOutfitterSkillSource()) => {
|
|
63
|
+
/* v8 ignore next 3 -- defensive fallback for installs that exclude the bundled skill. */
|
|
64
|
+
if (source === undefined) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
return [
|
|
68
|
+
createCompositeProfileFile({
|
|
69
|
+
rootDirectory,
|
|
70
|
+
relativePath: `${outfitterPluginCompositeRelativePath}/.claude-plugin/plugin.json`,
|
|
71
|
+
content: `${JSON.stringify({
|
|
72
|
+
name: 'outfitter',
|
|
73
|
+
description: 'Outfitter self-documentation skill for Outfitter-managed launches.',
|
|
74
|
+
}, null, 2)}\n`,
|
|
75
|
+
sourceInputs: [join(source.skillDirectory, 'SKILL.md')],
|
|
76
|
+
strategy: 'transform',
|
|
77
|
+
}),
|
|
78
|
+
...createOutfitterSkillCompositeFiles(rootDirectory, outfitterPluginSkillCompositeRelativePath, source),
|
|
79
|
+
];
|
|
80
|
+
};
|
|
81
|
+
const createReferenceFiles = (rootDirectory, skillCompositeRelativePath, source, skillMarkdown, skillPath) => {
|
|
82
|
+
const seenBasenames = new Set();
|
|
83
|
+
return parseSkillFileReferences(skillMarkdown, skillPath).map((referencePath) => {
|
|
84
|
+
const sourcePath = join(source.referenceRootDirectory, referencePath);
|
|
85
|
+
const destinationName = basename(referencePath);
|
|
86
|
+
if (seenBasenames.has(destinationName)) {
|
|
87
|
+
throw new Error(`Outfitter skill references collide on basename '${destinationName}' in '${skillPath}'.`);
|
|
88
|
+
}
|
|
89
|
+
seenBasenames.add(destinationName);
|
|
90
|
+
if (!existsSync(sourcePath)) {
|
|
91
|
+
throw new Error(`Outfitter skill reference '${referencePath}' is missing at '${sourcePath}'.`);
|
|
92
|
+
}
|
|
93
|
+
return createCompositeProfileFile({
|
|
94
|
+
rootDirectory,
|
|
95
|
+
relativePath: `${skillCompositeRelativePath}/references/${destinationName}`,
|
|
96
|
+
content: readFileSync(sourcePath, 'utf8'),
|
|
97
|
+
sourceInputs: [sourcePath],
|
|
98
|
+
strategy: 'transform',
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
const parseSkillFileReferences = (skillMarkdown, skillPath) => {
|
|
103
|
+
const frontmatter = extractFrontmatter(skillMarkdown);
|
|
104
|
+
if (frontmatter === undefined) {
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
const parsed = parse(frontmatter);
|
|
108
|
+
const references = parsed !== null && typeof parsed === 'object' && 'references' in parsed ? parsed.references : undefined;
|
|
109
|
+
if (references === undefined) {
|
|
110
|
+
return [];
|
|
111
|
+
}
|
|
112
|
+
if (!Array.isArray(references)) {
|
|
113
|
+
throw new Error(`Outfitter skill frontmatter 'references' must be a list in '${skillPath}'.`);
|
|
114
|
+
}
|
|
115
|
+
const entries = references;
|
|
116
|
+
return entries.map((entry) => {
|
|
117
|
+
const file = entry !== null && typeof entry === 'object' ? entry.file : undefined;
|
|
118
|
+
if (typeof file !== 'string') {
|
|
119
|
+
throw new Error(`Outfitter skill references must be { file: <path> } entries in '${skillPath}'.`);
|
|
120
|
+
}
|
|
121
|
+
return file;
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
const extractFrontmatter = (skillMarkdown) => {
|
|
125
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(skillMarkdown);
|
|
126
|
+
return match?.[1];
|
|
127
|
+
};
|
|
128
|
+
//# sourceMappingURL=OutfitterSkill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutfitterSkill.js","sourceRoot":"","sources":["../../src/agents/OutfitterSkill.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,EAAE;AACF,yFAAyF;AACzF,wFAAwF;AACxF,wFAAwF;AACxF,yFAAyF;AACzF,oFAAoF;AACpF,iFAAiF;AACjF,uBAAuB;AACvB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAG7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAEzF,MAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAEvF,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AASpE,sFAAsF;AACtF,wFAAwF;AACxF,uCAAuC;AACvC,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAqC,EAAE;IAChF,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAE9D,oFAAoF;IACpF,IAAI,UAAU,CAAC,IAAI,CAAC,cAAc,EAAE,iBA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C,CAAE,KAAqC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QAEnH,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,mEAAmE,SAAS,IAAI,CAAC,CAAC;QACpG,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,aAAqB,EAAsB,EAAE;IACvE,MAAM,KAAK,GAAG,wCAAwC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAE3E,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Provides the Claude Code adapter for composite profile generation and native launch plans.
|
|
2
|
+
import { homedir } from 'node:os';
|
|
2
3
|
import { join } from 'node:path';
|
|
3
4
|
import { findUnsupportedControlNames, flagValue, mergeAgentSpecificControls, repeatFlag, repeatFlagValue, supportedControlNames, } from '../AdapterProfileControls.js';
|
|
4
5
|
import { createDeclaredStatePaths, findProfileStateSource } from '../AdapterStatePaths.js';
|
|
6
|
+
import { createOutfitterPluginCompositeFiles, outfitterPluginCompositeRelativePath, resolveOutfitterSkillSource, } from '../OutfitterSkill.js';
|
|
5
7
|
import { resolveAppendSystemPromptControl } from '../../profiles/PromptIncludes.js';
|
|
6
8
|
import { createCompositeProfile } from '../../compositeProfile/CompositeProfile.js';
|
|
7
9
|
import { createCompositeProfileFile } from '../../compositeProfile/CompositeProfileFile.js';
|
|
@@ -56,6 +58,7 @@ export const createClaudeAdapter = () => ({
|
|
|
56
58
|
sourceInputs: input.profilePaths,
|
|
57
59
|
strategy: 'transform',
|
|
58
60
|
}),
|
|
61
|
+
...createOutfitterPluginCompositeFiles(input.rootDirectory),
|
|
59
62
|
], createClaudeStatePaths(profile, input));
|
|
60
63
|
return {
|
|
61
64
|
compositeProfile,
|
|
@@ -80,7 +83,13 @@ export const createClaudeAdapter = () => ({
|
|
|
80
83
|
});
|
|
81
84
|
return {
|
|
82
85
|
command: 'claude',
|
|
83
|
-
args: [
|
|
86
|
+
args: [
|
|
87
|
+
...createClaudeArgs({ ...controls, appendSystemPrompt: appendPrompt.prompts }),
|
|
88
|
+
// Publish the bundled Outfitter self-documentation skill through Claude's
|
|
89
|
+
// plugin channel; the skills/ state path stays reserved for user skills.
|
|
90
|
+
...createOutfitterPluginArgs(compositeProfile.rootDirectory),
|
|
91
|
+
...passThroughArgs,
|
|
92
|
+
],
|
|
84
93
|
env: {
|
|
85
94
|
...controls.environment,
|
|
86
95
|
CLAUDE_CONFIG_DIR: compositeProfile.rootDirectory,
|
|
@@ -110,8 +119,15 @@ const resolveClaudeStateSourcePath = (profileFolders, homeDirectory, relativePat
|
|
|
110
119
|
return profileSource;
|
|
111
120
|
}
|
|
112
121
|
return join(
|
|
113
|
-
/* v8 ignore next -- run command always passes homeDirectory;
|
|
114
|
-
homeDirectory ??
|
|
122
|
+
/* v8 ignore next -- run command always passes homeDirectory; the os fallback is defensive. */
|
|
123
|
+
homeDirectory ?? homedir(), '.claude', normalizedRelativePath);
|
|
124
|
+
};
|
|
125
|
+
const createOutfitterPluginArgs = (rootDirectory) => {
|
|
126
|
+
/* v8 ignore next 3 -- defensive fallback for installs that exclude the bundled skill. */
|
|
127
|
+
if (resolveOutfitterSkillSource() === undefined) {
|
|
128
|
+
return [];
|
|
129
|
+
}
|
|
130
|
+
return ['--plugin-dir', join(rootDirectory, outfitterPluginCompositeRelativePath)];
|
|
115
131
|
};
|
|
116
132
|
const mergeClaudeControls = (controls) => mergeAgentSpecificControls(controls, 'claude');
|
|
117
133
|
const createClaudeArgs = (controls) => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClaudeAdapter.js","sourceRoot":"","sources":["../../../src/agents/claude/ClaudeAdapter.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,OAAO,EAAE,IAAI,EAAE,M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,iBAAiB,EAAE,QAAQ,CAAC,YAAY,CAAC;IACtD,GAAG,eAAe,CAAC,wBAAwB,EAAE,QAAQ,CAAC,kBAAkB,CAAC;IACzE,GAAG,UAAU,CAAC,cAAc,EAAE,QAAQ,CAAC,UAAU,CAAC;IAClD,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAAC,QAAyB,EAAqB,EAAE;IAC/E,MAAM,WAAW,GAAG,2BAA2B,CAAC,QAAQ,EAAE,8BAA8B,CAAC,CAAC;IAE1F,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAClC,WAAW,CAAC,IAAI,CACd,GAAG,2BAA2B,CAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,UAAU,WAAW,EAAE,CAAC,CAClH,CAAC;IACJ,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Provides the pi adapter for composite profile generation and native pi launch plans.
|
|
2
2
|
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
3
4
|
import { delimiter, dirname, isAbsolute, join, relative } from 'node:path';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { genericControlNames, mergeAgentSpecificControls, supportedControlNames } from '../AdapterProfileControls.js';
|
|
6
|
-
import {
|
|
6
|
+
import { createOutfitterPluginCompositeFiles, outfitterPluginSkillCompositeRelativePath } from '../OutfitterSkill.js';
|
|
7
7
|
import { createDeclaredStatePaths, findProfileStateSource } from '../AdapterStatePaths.js';
|
|
8
8
|
import { filterPiSettingsPackagesDuplicatingExtensions } from './PiSettingsMergePolicy.js';
|
|
9
9
|
import { resolveAppendSystemPromptControl } from '../../profiles/PromptIncludes.js';
|
|
@@ -58,6 +58,7 @@ export const createPiAdapter = () => ({
|
|
|
58
58
|
createPiMcpConfigFile(input.rootDirectory, input.profileFolders),
|
|
59
59
|
transformedSettingsFile,
|
|
60
60
|
transformedKeybindingsFile,
|
|
61
|
+
...createOutfitterPluginCompositeFiles(input.rootDirectory),
|
|
61
62
|
].filter((file) => file !== undefined), transformedStatePaths);
|
|
62
63
|
return {
|
|
63
64
|
compositeProfile,
|
|
@@ -78,7 +79,7 @@ export const createPiAdapter = () => ({
|
|
|
78
79
|
const profileFolders = context.profileFolders ?? [];
|
|
79
80
|
const deepWorkJobsFolders = createDeepWorkAdditionalJobsFolders(controls, profileFolders, context.profileLayers ?? []);
|
|
80
81
|
const skillSources = createPiSkillSources({
|
|
81
|
-
builtInOutfitterSkill,
|
|
82
|
+
builtInOutfitterSkill: join(compositeProfile.rootDirectory, outfitterPluginSkillCompositeRelativePath),
|
|
82
83
|
controls,
|
|
83
84
|
profileFolders,
|
|
84
85
|
profileLayers: context.profileLayers ?? [],
|
|
@@ -94,14 +95,12 @@ export const createPiAdapter = () => ({
|
|
|
94
95
|
args: [
|
|
95
96
|
...createPiArgs({
|
|
96
97
|
...controls,
|
|
97
|
-
extensions: materializePiExtensionSources(controls.extensions, {
|
|
98
|
+
extensions: materializePiExtensionSources(controls.extensions, {
|
|
99
|
+
cacheDirectory: context.cacheDirectory,
|
|
100
|
+
onProgress: context.onProgress,
|
|
101
|
+
}),
|
|
98
102
|
skills: skillSources,
|
|
99
|
-
appendSystemPrompt:
|
|
100
|
-
...appendPrompt.prompts,
|
|
101
|
-
// Mirrors pi's own docs section in the default system prompt: point the
|
|
102
|
-
// agent at the bundled Outfitter user documentation by absolute path.
|
|
103
|
-
...toOutfitterDocsPrompts(context.outfitterDocsDirectory),
|
|
104
|
-
],
|
|
103
|
+
appendSystemPrompt: appendPrompt.prompts,
|
|
105
104
|
}),
|
|
106
105
|
...passThroughArgs,
|
|
107
106
|
],
|
|
@@ -273,8 +272,8 @@ const resolvePiStateSourcePath = (profileFolders, homeDirectory, cacheDirectory,
|
|
|
273
272
|
const normalizedRelativePath = directory ? relativePath.slice(0, -1) : relativePath;
|
|
274
273
|
const configuredCacheDirectory = cacheDirectory ??
|
|
275
274
|
join(
|
|
276
|
-
/* v8 ignore next -- run command always passes homeDirectory;
|
|
277
|
-
homeDirectory ??
|
|
275
|
+
/* v8 ignore next -- run command always passes homeDirectory; the os fallback is defensive. */
|
|
276
|
+
homeDirectory ?? homedir(), '.outfitter', 'cache');
|
|
278
277
|
if (relativePath === 'utilities/' || relativePath === 'bin/') {
|
|
279
278
|
return join(configuredCacheDirectory, 'utilities');
|
|
280
279
|
}
|
|
@@ -283,12 +282,10 @@ const resolvePiStateSourcePath = (profileFolders, homeDirectory, cacheDirectory,
|
|
|
283
282
|
return profileSource;
|
|
284
283
|
}
|
|
285
284
|
return join(
|
|
286
|
-
/* v8 ignore next -- run command always passes homeDirectory;
|
|
287
|
-
homeDirectory ??
|
|
285
|
+
/* v8 ignore next -- run command always passes homeDirectory; the os fallback is defensive. */
|
|
286
|
+
homeDirectory ?? homedir(), '.pi', 'agent', normalizedRelativePath);
|
|
288
287
|
};
|
|
289
288
|
const deepWorkAdditionalJobsFoldersEnv = 'DEEPWORK_ADDITIONAL_JOBS_FOLDERS';
|
|
290
|
-
const packageRootDirectory = join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..');
|
|
291
|
-
const builtInOutfitterSkill = join(packageRootDirectory, 'skills', 'outfitter');
|
|
292
289
|
const createDeepWorkAdditionalJobsFolders = (controls, profileFolders, profileLayers) => {
|
|
293
290
|
const profileJobFolders = [
|
|
294
291
|
...new Set(profileFolders.flatMap(deepWorkJobsFoldersForProfile).filter(isExistingDeepWorkJobsFolder)),
|
|
@@ -353,7 +350,6 @@ const isFile = (path) => {
|
|
|
353
350
|
const isMissingPathError = (error) => error !== null && typeof error === 'object' && 'code' in error && error.code === 'ENOENT';
|
|
354
351
|
const formatFilesystemError = (error) => String(error);
|
|
355
352
|
const splitPathList = (value) => value === undefined || value === '' ? [] : value.split(delimiter).filter((entry) => entry !== '');
|
|
356
|
-
const toOutfitterDocsPrompts = (docsDirectory) => docsDirectory === undefined ? [] : [createOutfitterDocsSystemPrompt(docsDirectory)];
|
|
357
353
|
const mergePiControls = (controls) => mergeAgentSpecificControls(controls, 'pi');
|
|
358
354
|
const findUnsupportedControls = (controls) => {
|
|
359
355
|
const unsupported = Object.keys(controls).filter((controlName) => !genericControlNames.has(controlName));
|