@ai-outfitter/outfitter 0.9.0 → 0.11.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 +2 -0
- package/code/pi-extension/src/outfitter-extension.js +48 -19
- package/dist/agents/AdapterProfileControls.js +2 -2
- package/dist/agents/AdapterProfileControls.js.map +1 -1
- package/dist/agents/AgentAdapter.d.ts +0 -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 +16 -1
- package/dist/agents/claude/ClaudeAdapter.js.map +1 -1
- package/dist/agents/pi/PiAdapter.js +4 -12
- 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/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 +2 -0
- package/dist/cli/commands/PiLoginLaunch.js.map +1 -1
- package/dist/cli/commands/RunCommand.d.ts +0 -2
- package/dist/cli/commands/RunCommand.js +29 -9
- package/dist/cli/commands/RunCommand.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/RunProfileResolution.d.ts +2 -0
- package/dist/cli/commands/run/RunProfileResolution.js +4 -0
- package/dist/cli/commands/run/RunProfileResolution.js.map +1 -1
- 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/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 +369 -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 +485 -0
- 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/state.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
|
@@ -51,6 +51,8 @@ controls:
|
|
|
51
51
|
- [Getting started](./docs/documentation/getting-started.md)
|
|
52
52
|
- [What works today: adapter support matrix](./docs/documentation/support-matrix.md)
|
|
53
53
|
- [Profiles](./docs/documentation/profiles.md)
|
|
54
|
+
- [Skills](./docs/documentation/skills.md)
|
|
55
|
+
- [Best practices](./docs/documentation/best-practices.md)
|
|
54
56
|
- [Profile repositories](./docs/documentation/profile-repository.md)
|
|
55
57
|
- [State persistence](./docs/documentation/state.md)
|
|
56
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();
|
|
@@ -270,13 +280,28 @@ export default function outfitter(pi) {
|
|
|
270
280
|
await exportRuntimeSystemPrompt(ctx);
|
|
271
281
|
if (ctx.mode !== "tui") return;
|
|
272
282
|
ctx.ui.setHeader((_tui, theme) => {
|
|
273
|
-
const
|
|
283
|
+
const firstRun = event.reason === "startup" && OUTFITTER_AUTO_OPEN;
|
|
284
|
+
let cachedWidth;
|
|
285
|
+
let cachedLines;
|
|
274
286
|
return {
|
|
275
|
-
render
|
|
276
|
-
|
|
287
|
+
// Pi-tui rejects render output wider than the terminal, so the header
|
|
288
|
+
// re-fits its lines to every width pi hands it instead of rendering once.
|
|
289
|
+
render: (width) => {
|
|
290
|
+
const maxWidth = typeof width === "number" && width > 0 ? width : 120;
|
|
291
|
+
if (cachedLines === undefined || cachedWidth !== maxWidth) {
|
|
292
|
+
cachedLines = createStartupHeaderLines(theme, firstRun, maxWidth);
|
|
293
|
+
cachedWidth = maxWidth;
|
|
294
|
+
}
|
|
295
|
+
return cachedLines;
|
|
296
|
+
},
|
|
297
|
+
invalidate: () => {
|
|
298
|
+
cachedWidth = undefined;
|
|
299
|
+
cachedLines = undefined;
|
|
300
|
+
},
|
|
277
301
|
};
|
|
278
302
|
});
|
|
279
303
|
updateModeStatus(ctx);
|
|
304
|
+
updateProfileStatus(ctx);
|
|
280
305
|
ctx.ui.onTerminalInput((data) => {
|
|
281
306
|
if (!matchesKey(data, "shift+tab")) return undefined;
|
|
282
307
|
cycleOutfitterMode(ctx);
|
|
@@ -323,33 +348,37 @@ export default function outfitter(pi) {
|
|
|
323
348
|
});
|
|
324
349
|
}
|
|
325
350
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
351
|
+
// Every emitted line must fit maxWidth: pi-tui throws on over-wide render output,
|
|
352
|
+
// which crashed startup in narrow (e.g. 80x24 tmux) terminals. Prose wraps so no
|
|
353
|
+
// words are lost; ASCII art and the brand line truncate because wrapping them is noise.
|
|
354
|
+
const createStartupHeaderLines = (theme, firstRun, maxWidth) => {
|
|
329
355
|
const lines = [];
|
|
356
|
+
const addTruncated = (line) => lines.push(visibleWidth(line) > maxWidth ? truncateToWidth(line, maxWidth) : line);
|
|
357
|
+
const addWrapped = (line) => {
|
|
358
|
+
for (const wrappedLine of wrapTextWithAnsi(line, Math.max(1, maxWidth))) addTruncated(wrappedLine);
|
|
359
|
+
};
|
|
330
360
|
|
|
331
361
|
if (OUTFITTER_STARTUP_ASCII_ART) {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
"",
|
|
362
|
+
OUTFITTER_ASCII_ART.split("\n").forEach((line, index) =>
|
|
363
|
+
addTruncated(theme.fg(OUTFITTER_ASCII_GRADIENT[index] ?? "accent", line)),
|
|
335
364
|
);
|
|
365
|
+
lines.push("");
|
|
336
366
|
}
|
|
337
367
|
|
|
338
|
-
|
|
368
|
+
addTruncated(theme.bold(theme.fg("accent", "Outfitter")) + theme.fg("dim", " + pi"));
|
|
369
|
+
addWrapped(theme.fg("muted", "/ commands · ! bash · shift+tab mode · ctrl+shift+t thinking · ctrl+o more"));
|
|
339
370
|
|
|
340
371
|
if (firstRun) {
|
|
341
|
-
lines.push(
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
theme.fg("dim", "• catalogs let teams share setups through GitHub"),
|
|
347
|
-
);
|
|
372
|
+
lines.push("");
|
|
373
|
+
addWrapped(theme.fg("dim", "Outfitter turns Pi into a configured working environment:"));
|
|
374
|
+
addWrapped(theme.fg("dim", "• profiles define model, tools, prompts, skills, and extensions"));
|
|
375
|
+
addWrapped(theme.fg("dim", "• settings can live in your home folder or this project"));
|
|
376
|
+
addWrapped(theme.fg("dim", "• catalogs let teams share setups through GitHub"));
|
|
348
377
|
return lines;
|
|
349
378
|
}
|
|
350
379
|
|
|
351
|
-
lines.push(
|
|
352
|
-
|
|
380
|
+
lines.push("");
|
|
381
|
+
addWrapped(
|
|
353
382
|
theme.fg(
|
|
354
383
|
"dim",
|
|
355
384
|
"Outfitter + Pi can explain its own features and look up its docs. Ask it how to use or extend Pi or outfitter profiles.",
|
|
@@ -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,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,QAAQ,CAAC,CAAC;AAExH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,EAAE,SAAS,EAAE,kBAAkB,EAAE,SAAS,EAAE,mBAAmB,EAAE;IACjE,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,EAAE;IAC7D,EAAE,SAAS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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"}
|
|
@@ -19,8 +19,6 @@ export interface AgentLaunchContext {
|
|
|
19
19
|
readonly profileLayers?: readonly AgentLaunchProfileLayer[];
|
|
20
20
|
readonly projectDirectory?: string;
|
|
21
21
|
readonly cacheDirectory?: string;
|
|
22
|
-
/** Directory of bundled user-facing Outfitter documentation the launched agent may read. */
|
|
23
|
-
readonly outfitterDocsDirectory?: string;
|
|
24
22
|
readonly onProgress?: (message: string) => void;
|
|
25
23
|
}
|
|
26
24
|
export interface AgentCompositeProfilePlan {
|
|
@@ -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,CAAC;IAEjE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,iBAAiB,CA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AAC;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,iBAAiB,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC;QACpE,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EA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AQ,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"}
|
|
@@ -3,6 +3,7 @@ import { homedir } from 'node:os';
|
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { findUnsupportedControlNames, flagValue, mergeAgentSpecificControls, repeatFlag, repeatFlagValue, supportedControlNames, } from '../AdapterProfileControls.js';
|
|
5
5
|
import { createDeclaredStatePaths, findProfileStateSource } from '../AdapterStatePaths.js';
|
|
6
|
+
import { createOutfitterPluginCompositeFiles, outfitterPluginCompositeRelativePath, resolveOutfitterSkillSource, } from '../OutfitterSkill.js';
|
|
6
7
|
import { resolveAppendSystemPromptControl } from '../../profiles/PromptIncludes.js';
|
|
7
8
|
import { createCompositeProfile } from '../../compositeProfile/CompositeProfile.js';
|
|
8
9
|
import { createCompositeProfileFile } from '../../compositeProfile/CompositeProfileFile.js';
|
|
@@ -57,6 +58,7 @@ export const createClaudeAdapter = () => ({
|
|
|
57
58
|
sourceInputs: input.profilePaths,
|
|
58
59
|
strategy: 'transform',
|
|
59
60
|
}),
|
|
61
|
+
...createOutfitterPluginCompositeFiles(input.rootDirectory),
|
|
60
62
|
], createClaudeStatePaths(profile, input));
|
|
61
63
|
return {
|
|
62
64
|
compositeProfile,
|
|
@@ -81,7 +83,13 @@ export const createClaudeAdapter = () => ({
|
|
|
81
83
|
});
|
|
82
84
|
return {
|
|
83
85
|
command: 'claude',
|
|
84
|
-
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
|
+
],
|
|
85
93
|
env: {
|
|
86
94
|
...controls.environment,
|
|
87
95
|
CLAUDE_CONFIG_DIR: compositeProfile.rootDirectory,
|
|
@@ -114,6 +122,13 @@ const resolveClaudeStateSourcePath = (profileFolders, homeDirectory, relativePat
|
|
|
114
122
|
/* v8 ignore next -- run command always passes homeDirectory; the os fallback is defensive. */
|
|
115
123
|
homeDirectory ?? homedir(), '.claude', normalizedRelativePath);
|
|
116
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)];
|
|
131
|
+
};
|
|
117
132
|
const mergeClaudeControls = (controls) => mergeAgentSpecificControls(controls, 'claude');
|
|
118
133
|
const createClaudeArgs = (controls) => [
|
|
119
134
|
...flagValue('--model', controls.model),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClaudeAdapter.js","sourceRoot":"","sources":["../../../src/agents/claude/ClaudeAdapter.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EACL,2BAA2B,EAC3B,SAAS,EACT,0BAA0B,EAC1B,UAAU,EACV,eAAe,EACf,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,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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"}
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
3
3
|
import { homedir } from 'node:os';
|
|
4
4
|
import { delimiter, dirname, isAbsolute, join, relative } from 'node:path';
|
|
5
|
-
import { fileURLToPath } from 'node:url';
|
|
6
5
|
import { genericControlNames, mergeAgentSpecificControls, supportedControlNames } from '../AdapterProfileControls.js';
|
|
7
|
-
import {
|
|
6
|
+
import { createOutfitterPluginCompositeFiles, outfitterPluginSkillCompositeRelativePath } from '../OutfitterSkill.js';
|
|
8
7
|
import { createDeclaredStatePaths, findProfileStateSource } from '../AdapterStatePaths.js';
|
|
9
8
|
import { filterPiSettingsPackagesDuplicatingExtensions } from './PiSettingsMergePolicy.js';
|
|
10
9
|
import { resolveAppendSystemPromptControl } from '../../profiles/PromptIncludes.js';
|
|
@@ -59,6 +58,7 @@ export const createPiAdapter = () => ({
|
|
|
59
58
|
createPiMcpConfigFile(input.rootDirectory, input.profileFolders),
|
|
60
59
|
transformedSettingsFile,
|
|
61
60
|
transformedKeybindingsFile,
|
|
61
|
+
...createOutfitterPluginCompositeFiles(input.rootDirectory),
|
|
62
62
|
].filter((file) => file !== undefined), transformedStatePaths);
|
|
63
63
|
return {
|
|
64
64
|
compositeProfile,
|
|
@@ -79,7 +79,7 @@ export const createPiAdapter = () => ({
|
|
|
79
79
|
const profileFolders = context.profileFolders ?? [];
|
|
80
80
|
const deepWorkJobsFolders = createDeepWorkAdditionalJobsFolders(controls, profileFolders, context.profileLayers ?? []);
|
|
81
81
|
const skillSources = createPiSkillSources({
|
|
82
|
-
builtInOutfitterSkill,
|
|
82
|
+
builtInOutfitterSkill: join(compositeProfile.rootDirectory, outfitterPluginSkillCompositeRelativePath),
|
|
83
83
|
controls,
|
|
84
84
|
profileFolders,
|
|
85
85
|
profileLayers: context.profileLayers ?? [],
|
|
@@ -100,12 +100,7 @@ export const createPiAdapter = () => ({
|
|
|
100
100
|
onProgress: context.onProgress,
|
|
101
101
|
}),
|
|
102
102
|
skills: skillSources,
|
|
103
|
-
appendSystemPrompt:
|
|
104
|
-
...appendPrompt.prompts,
|
|
105
|
-
// Mirrors pi's own docs section in the default system prompt: point the
|
|
106
|
-
// agent at the bundled Outfitter user documentation by absolute path.
|
|
107
|
-
...toOutfitterDocsPrompts(context.outfitterDocsDirectory),
|
|
108
|
-
],
|
|
103
|
+
appendSystemPrompt: appendPrompt.prompts,
|
|
109
104
|
}),
|
|
110
105
|
...passThroughArgs,
|
|
111
106
|
],
|
|
@@ -291,8 +286,6 @@ const resolvePiStateSourcePath = (profileFolders, homeDirectory, cacheDirectory,
|
|
|
291
286
|
homeDirectory ?? homedir(), '.pi', 'agent', normalizedRelativePath);
|
|
292
287
|
};
|
|
293
288
|
const deepWorkAdditionalJobsFoldersEnv = 'DEEPWORK_ADDITIONAL_JOBS_FOLDERS';
|
|
294
|
-
const packageRootDirectory = join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..');
|
|
295
|
-
const builtInOutfitterSkill = join(packageRootDirectory, 'skills', 'outfitter');
|
|
296
289
|
const createDeepWorkAdditionalJobsFolders = (controls, profileFolders, profileLayers) => {
|
|
297
290
|
const profileJobFolders = [
|
|
298
291
|
...new Set(profileFolders.flatMap(deepWorkJobsFoldersForProfile).filter(isExistingDeepWorkJobsFolder)),
|
|
@@ -357,7 +350,6 @@ const isFile = (path) => {
|
|
|
357
350
|
const isMissingPathError = (error) => error !== null && typeof error === 'object' && 'code' in error && error.code === 'ENOENT';
|
|
358
351
|
const formatFilesystemError = (error) => String(error);
|
|
359
352
|
const splitPathList = (value) => value === undefined || value === '' ? [] : value.split(delimiter).filter((entry) => entry !== '');
|
|
360
|
-
const toOutfitterDocsPrompts = (docsDirectory) => docsDirectory === undefined ? [] : [createOutfitterDocsSystemPrompt(docsDirectory)];
|
|
361
353
|
const mergePiControls = (controls) => mergeAgentSpecificControls(controls, 'pi');
|
|
362
354
|
const findUnsupportedControls = (controls) => {
|
|
363
355
|
const unsupported = Object.keys(controls).filter((controlName) => !genericControlNames.has(controlName));
|