@ai-outfitter/outfitter 1.0.2 → 1.1.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/README.md +33 -23
- package/code/enterprise/cli/privateCatalogGate.cjs +3 -3
- package/code/pi-extension/src/outfitter-runtime-extension.js +45 -6
- package/dist/cli/OutfitterCli.js +4 -7
- package/dist/cli/OutfitterCli.js.map +1 -1
- package/dist/cli/commands/DumpCommand.js +8 -3
- package/dist/cli/commands/DumpCommand.js.map +1 -1
- package/dist/cli/commands/ListCommand.js +4 -3
- package/dist/cli/commands/ListCommand.js.map +1 -1
- package/dist/cli/commands/PiRuntimeLaunch.d.ts +14 -4
- package/dist/cli/commands/PiRuntimeLaunch.js +23 -27
- package/dist/cli/commands/PiRuntimeLaunch.js.map +1 -1
- package/dist/cli/commands/RunAgentCommand.js +8 -3
- package/dist/cli/commands/RunAgentCommand.js.map +1 -1
- package/dist/cli/commands/SetupCommand.d.ts +1 -1
- package/dist/cli/commands/SetupCommand.js +6 -13
- package/dist/cli/commands/SetupCommand.js.map +1 -1
- package/dist/cli/commands/SyncCommand.d.ts +31 -0
- package/dist/cli/commands/SyncCommand.js +162 -0
- package/dist/cli/commands/SyncCommand.js.map +1 -0
- package/dist/cli/commands/ValidateCommand.js +4 -2
- package/dist/cli/commands/ValidateCommand.js.map +1 -1
- package/dist/composer/Composer.js +1 -0
- package/dist/composer/Composer.js.map +1 -1
- package/dist/composer/Composition.d.ts +2 -0
- package/dist/paths/RepositoryAssets.d.ts +4 -0
- package/dist/paths/RepositoryAssets.js +26 -0
- package/dist/paths/RepositoryAssets.js.map +1 -0
- package/dist/resolver/AgentDefinition.d.ts +2 -0
- package/dist/resolver/AgentDefinition.js +2 -0
- package/dist/resolver/AgentDefinition.js.map +1 -1
- package/dist/resolver/Layer.d.ts +17 -1
- package/dist/resolver/Layer.js +23 -15
- package/dist/resolver/Layer.js.map +1 -1
- package/dist/resolver/ResolverContext.d.ts +2 -0
- package/dist/resolver/ResolverContext.js +7 -2
- package/dist/resolver/ResolverContext.js.map +1 -1
- package/dist/schemas/agent.schema.json +1 -0
- package/dist/settings/SettingsLoader.d.ts +12 -3
- package/dist/settings/SettingsLoader.js +25 -11
- package/dist/settings/SettingsLoader.js.map +1 -1
- package/dist/setup/DefaultCatalog.d.ts +2 -1
- package/dist/setup/DefaultCatalog.js +25 -50
- package/dist/setup/DefaultCatalog.js.map +1 -1
- package/dist/sources/GitRepository.d.ts +28 -0
- package/dist/sources/GitRepository.js +139 -0
- package/dist/sources/GitRepository.js.map +1 -0
- package/dist/sources/PrivateCatalogGate.d.ts +27 -0
- package/dist/sources/PrivateCatalogGate.js +23 -0
- package/dist/sources/PrivateCatalogGate.js.map +1 -0
- package/dist/sources/SourceCache.d.ts +11 -1
- package/dist/sources/SourceCache.js +11 -2
- package/dist/sources/SourceCache.js.map +1 -1
- package/dist/version/OutfitterVersion.d.ts +1 -0
- package/dist/version/OutfitterVersion.js +8 -0
- package/dist/version/OutfitterVersion.js.map +1 -0
- package/docs/documentation/README.md +46 -31
- package/docs/documentation/actions.md +3 -1
- package/docs/documentation/agents.md +5 -0
- package/docs/documentation/catalogs.md +10 -2
- package/docs/documentation/cli.md +11 -3
- package/docs/documentation/concepts.md +6 -6
- package/docs/documentation/conventions.md +55 -0
- package/docs/documentation/in-cluster.md +35 -0
- package/docs/documentation/recurring-runs.md +27 -0
- package/docs/documentation/settings.md +4 -2
- package/docs/documentation/subagents.md +16 -5
- package/docs/documentation/usecases/flaky-test-postmortems.md +20 -0
- package/docs/documentation/usecases/grafana-alert-investigator.md +18 -0
- package/docs/documentation/usecases/resident-agents.md +36 -0
- package/docs/documentation/usecases/self-improving-skills.md +19 -0
- package/docs/documentation/usecases/shared-conventions.md +47 -0
- package/package.json +1 -1
- package/src/schemas/agent.schema.json +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsLoader.js","sourceRoot":"","sources":["../../src/settings/SettingsLoader.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E;IAC3F,IAAI,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QAC/B,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,OAAO,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;AACpD,CAAC,CAAC"}
|
|
@@ -5,6 +5,7 @@ export declare const defaultCatalogSource: {
|
|
|
5
5
|
};
|
|
6
6
|
export interface PinnedCatalogBootstrapInput {
|
|
7
7
|
readonly homeDirectory: string;
|
|
8
|
+
readonly cacheDirectory?: string;
|
|
8
9
|
readonly source: RemoteSourceReference & {
|
|
9
10
|
readonly ref: string;
|
|
10
11
|
};
|
|
@@ -17,4 +18,4 @@ export interface PinnedCatalogBootstrapResult {
|
|
|
17
18
|
}
|
|
18
19
|
/** Fetches one immutable catalog revision into the same cache path used by normal source resolution. */
|
|
19
20
|
export declare const bootstrapPinnedCatalog: (input: PinnedCatalogBootstrapInput) => PinnedCatalogBootstrapResult;
|
|
20
|
-
export declare const bootstrapDefaultCatalog: (homeDirectory: string) => PinnedCatalogBootstrapResult;
|
|
21
|
+
export declare const bootstrapDefaultCatalog: (homeDirectory: string, cacheDirectory?: string) => PinnedCatalogBootstrapResult;
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
// Bootstraps the one canonical default catalog at the immutable revision shipped by Outfitter.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { createRemoteRepositoryCachePath,
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { runGit, syncRemoteRepositoryAtomically, tryReadCleanHead } from '../sources/GitRepository.js';
|
|
5
|
+
import { createRemoteRepositoryCachePath, redactEmbeddedSourceCredentials } from '../sources/SourceCache.js';
|
|
6
6
|
export const defaultCatalogSource = {
|
|
7
7
|
github: 'ai-outfitter/default-profiles',
|
|
8
8
|
// TODO(release-automation): when default-profiles publishes a new Release Please tag, open a
|
|
9
9
|
// conventional dependency-bump commit in Outfitter so its next Release Please release ships it.
|
|
10
10
|
ref: 'v1.0.0',
|
|
11
11
|
};
|
|
12
|
-
const runGit = (arguments_) => {
|
|
13
|
-
try {
|
|
14
|
-
return execFileSync('git', [...arguments_], {
|
|
15
|
-
encoding: 'utf8',
|
|
16
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
17
|
-
}).trim();
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
throw new Error(`git ${arguments_.join(' ')} failed: ${String(error)}`, { cause: error });
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
12
|
const fullCommitPattern = /^[a-f0-9]{40}$/u;
|
|
24
13
|
const versionTagPattern = /^v\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u;
|
|
25
14
|
const assertImmutableRef = (ref) => {
|
|
@@ -32,8 +21,7 @@ const isPinnedCatalogCheckout = (root, ref) => {
|
|
|
32
21
|
if (!existsSync(join(root, 'agents')))
|
|
33
22
|
return false;
|
|
34
23
|
try {
|
|
35
|
-
return (
|
|
36
|
-
runGit(['-C', root, 'status', '--porcelain']) === '');
|
|
24
|
+
return tryReadCleanHead(root) === resolveExpectedCommit(root, ref);
|
|
37
25
|
}
|
|
38
26
|
catch {
|
|
39
27
|
return false;
|
|
@@ -42,48 +30,35 @@ const isPinnedCatalogCheckout = (root, ref) => {
|
|
|
42
30
|
/** Fetches one immutable catalog revision into the same cache path used by normal source resolution. */
|
|
43
31
|
export const bootstrapPinnedCatalog = (input) => {
|
|
44
32
|
assertImmutableRef(input.source.ref);
|
|
45
|
-
const root = createRemoteRepositoryCachePath(input.homeDirectory, input.source);
|
|
33
|
+
const root = createRemoteRepositoryCachePath(input.homeDirectory, input.source, input.cacheDirectory);
|
|
46
34
|
if (isPinnedCatalogCheckout(root, input.source.ref))
|
|
47
35
|
return { root, source: input.source };
|
|
48
|
-
mkdirSync(dirname(root), { recursive: true });
|
|
49
|
-
const nonce = `${process.pid}-${Math.random().toString(16).slice(2)}`;
|
|
50
|
-
const temporaryRoot = `${root}.outfitter-${nonce}.tmp`;
|
|
51
|
-
const staleRoot = `${root}.outfitter-${nonce}.stale`;
|
|
52
|
-
const remote = normalizeGitUri(normalizeRemoteSourceUri(input.source));
|
|
53
|
-
let movedStaleCache = false;
|
|
54
36
|
try {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
37
|
+
syncRemoteRepositoryAtomically({
|
|
38
|
+
cachePath: root,
|
|
39
|
+
fetchRef: versionTagPattern.test(input.source.ref)
|
|
40
|
+
? `refs/tags/${input.source.ref}:refs/tags/${input.source.ref}`
|
|
41
|
+
: input.source.ref,
|
|
42
|
+
source: input.source,
|
|
43
|
+
// Validated with the same predicate the read path uses. A fresh checkout is not clean by
|
|
44
|
+
// construction — autocrlf, an LFS smudge, or a fileMode difference can leave it dirty — and
|
|
45
|
+
// accepting a dirty tree here would cache one that `tryReadCleanHead` rejects on every
|
|
46
|
+
// subsequent read, re-fetching forever.
|
|
47
|
+
validate: (temporaryRoot) => {
|
|
48
|
+
if (!isPinnedCatalogCheckout(temporaryRoot, input.source.ref)) {
|
|
49
|
+
throw new Error(`Fetched default catalog did not resolve to ${input.source.ref}.`);
|
|
50
|
+
}
|
|
51
|
+
return 0;
|
|
52
|
+
},
|
|
53
|
+
});
|
|
72
54
|
return { root, source: input.source };
|
|
73
55
|
}
|
|
74
56
|
catch (error) {
|
|
75
|
-
|
|
76
|
-
if (movedStaleCache && !existsSync(root) && existsSync(staleRoot))
|
|
77
|
-
renameSync(staleRoot, root);
|
|
78
|
-
const detail = String(error);
|
|
57
|
+
const detail = redactEmbeddedSourceCredentials(String(error));
|
|
79
58
|
throw new Error(`Could not fetch the default Outfitter catalog at pinned revision ${input.source.ref}. ${detail}`, {
|
|
80
59
|
cause: error,
|
|
81
60
|
});
|
|
82
61
|
}
|
|
83
|
-
finally {
|
|
84
|
-
rmSync(temporaryRoot, { recursive: true, force: true });
|
|
85
|
-
rmSync(staleRoot, { recursive: true, force: true });
|
|
86
|
-
}
|
|
87
62
|
};
|
|
88
|
-
export const bootstrapDefaultCatalog = (homeDirectory) => bootstrapPinnedCatalog({ homeDirectory, source: defaultCatalogSource });
|
|
63
|
+
export const bootstrapDefaultCatalog = (homeDirectory, cacheDirectory) => bootstrapPinnedCatalog({ homeDirectory, cacheDirectory, source: defaultCatalogSource });
|
|
89
64
|
//# sourceMappingURL=DefaultCatalog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultCatalog.js","sourceRoot":"","sources":["../../src/setup/DefaultCatalog.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"DefaultCatalog.js","sourceRoot":"","sources":["../../src/setup/DefaultCatalog.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,8BAA8B,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACvG,OAAO,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAG7G,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM,EAAE,+BAA+B;IACvC,6FAA6F;IAC7F,gGAAgG;IAChG,GAAG,EAAE,QAAQ;CAC2B,CAAC;AAa3C,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAC5C,MAAM,iBAAiB,GAAG,uCAAuC,CAAC;AAElE,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAQ,EAAE;IAC/C,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAA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|
+
readonly cachePath: string;
|
|
4
|
+
/** Optional fetch refspec used when verification needs a local ref (for example an immutable tag). */
|
|
5
|
+
readonly fetchRef?: string;
|
|
6
|
+
readonly source: RemoteSourceReference;
|
|
7
|
+
/**
|
|
8
|
+
* Inspects the fetched checkout before it is swapped in; throwing rejects the fetch. Returns the
|
|
9
|
+
* number of non-fatal warnings the checkout produced.
|
|
10
|
+
*/
|
|
11
|
+
readonly validate?: (repositoryPath: string, commit: string) => number;
|
|
12
|
+
}
|
|
13
|
+
export interface AtomicRepositorySyncResult {
|
|
14
|
+
readonly commit: string;
|
|
15
|
+
readonly status: 'updated' | 'unchanged';
|
|
16
|
+
readonly warnings: number;
|
|
17
|
+
}
|
|
18
|
+
/** Guards against a `ref` that git would parse as an option (`--upload-pack=…` is code execution). */
|
|
19
|
+
export declare const assertFetchableRef: (ref: string) => void;
|
|
20
|
+
/** Runs one git invocation, raising captured stderr as a credential-redacted Error. */
|
|
21
|
+
export declare const runGit: (arguments_: readonly string[]) => string;
|
|
22
|
+
/** Reads the HEAD commit of a checkout, or undefined when it is missing, dirty, or unreadable. */
|
|
23
|
+
export declare const tryReadCleanHead: (root: string) => string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Fetches into a temporary sibling and swaps only a validated checkout into place. A failed fetch,
|
|
26
|
+
* checkout, validation, or rename leaves an existing cache intact.
|
|
27
|
+
*/
|
|
28
|
+
export declare const syncRemoteRepositoryAtomically: (input: AtomicRepositorySyncInput) => AtomicRepositorySyncResult;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// Atomically fetches Git repositories while preserving the last known-good cache on failure.
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { existsSync, mkdirSync, renameSync, rmSync } from 'node:fs';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { normalizeGitUri, normalizeRemoteSourceUri, redactEmbeddedSourceCredentials } from './SourceCache.js';
|
|
6
|
+
// Repository-context variables must never leak in: with GIT_DIR/GIT_WORK_TREE exported (a git hook,
|
|
7
|
+
// `rebase --exec`, `bisect run`), `git -C <temporaryRoot> …` would operate on the *outer*
|
|
8
|
+
// repository, adding remotes to it and detaching its HEAD. Transport variables are left alone so a
|
|
9
|
+
// user's custom GIT_SSH_COMMAND still applies.
|
|
10
|
+
const repositoryContextVariables = new Set([
|
|
11
|
+
'GIT_DIR',
|
|
12
|
+
'GIT_WORK_TREE',
|
|
13
|
+
'GIT_INDEX_FILE',
|
|
14
|
+
'GIT_OBJECT_DIRECTORY',
|
|
15
|
+
'GIT_ALTERNATE_OBJECT_DIRECTORIES',
|
|
16
|
+
'GIT_COMMON_DIR',
|
|
17
|
+
'GIT_NAMESPACE',
|
|
18
|
+
'GIT_CEILING_DIRECTORIES',
|
|
19
|
+
]);
|
|
20
|
+
const gitEnvironment = () => {
|
|
21
|
+
const environment = {};
|
|
22
|
+
for (const [key, value] of Object.entries(process.env)) {
|
|
23
|
+
if (!repositoryContextVariables.has(key))
|
|
24
|
+
environment[key] = value;
|
|
25
|
+
}
|
|
26
|
+
// Git reads interactive credential prompts from /dev/tty, so piping stdio does not suppress them:
|
|
27
|
+
// an auth-required or unknown-host remote would hang the CLI forever without these.
|
|
28
|
+
environment.GIT_TERMINAL_PROMPT = '0';
|
|
29
|
+
environment.GIT_SSH_COMMAND = process.env.GIT_SSH_COMMAND ?? 'ssh -o BatchMode=yes';
|
|
30
|
+
return environment;
|
|
31
|
+
};
|
|
32
|
+
/** Guards against a `ref` that git would parse as an option (`--upload-pack=…` is code execution). */
|
|
33
|
+
export const assertFetchableRef = (ref) => {
|
|
34
|
+
if (!/^[A-Za-z0-9_.][A-Za-z0-9_./-]*$/u.test(ref) || ref.includes('..')) {
|
|
35
|
+
throw new Error(`Source ref '${ref}' is not a valid git ref.`);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
/** Runs one git invocation, raising captured stderr as a credential-redacted Error. */
|
|
39
|
+
export const runGit = (arguments_) => {
|
|
40
|
+
const result = spawnSync('git', [...arguments_], {
|
|
41
|
+
encoding: 'utf8',
|
|
42
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
43
|
+
env: gitEnvironment(),
|
|
44
|
+
timeout: 300_000,
|
|
45
|
+
});
|
|
46
|
+
if (result.error === undefined && result.status === 0) {
|
|
47
|
+
return result.stdout.trim();
|
|
48
|
+
}
|
|
49
|
+
const detail = [result.error?.message, result.stderr, result.stdout]
|
|
50
|
+
.filter((value) => value !== undefined && value.trim() !== '')
|
|
51
|
+
.join('\n');
|
|
52
|
+
const command = `git ${arguments_.join(' ')}`;
|
|
53
|
+
let suffix = `: ${detail.trim()}`;
|
|
54
|
+
/* v8 ignore else -- spawn failures always provide an Error or captured process output. */
|
|
55
|
+
if (detail === '')
|
|
56
|
+
suffix = '';
|
|
57
|
+
throw new Error(redactEmbeddedSourceCredentials(`${command} failed${suffix}`));
|
|
58
|
+
};
|
|
59
|
+
/** Reads the HEAD commit of a checkout, or undefined when it is missing, dirty, or unreadable. */
|
|
60
|
+
export const tryReadCleanHead = (root) => {
|
|
61
|
+
if (!existsSync(join(root, '.git')))
|
|
62
|
+
return undefined;
|
|
63
|
+
try {
|
|
64
|
+
if (runGit(['-C', root, 'status', '--porcelain']) !== '')
|
|
65
|
+
return undefined;
|
|
66
|
+
return runGit(['-C', root, 'rev-parse', 'HEAD']);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Rejects a remote or ref that git would parse as an option. Runs before any filesystem work so a
|
|
74
|
+
* hostile ref always reports as an invalid ref, rather than as whatever incidental error the cache
|
|
75
|
+
* path happens to raise first (a long encoded name exceeds the macOS filename limit, for example).
|
|
76
|
+
*/
|
|
77
|
+
const assertFetchableSource = (source, fetchRef) => {
|
|
78
|
+
// Both the remote and the ref are positional arguments to `git fetch`; either one starting with
|
|
79
|
+
// `-` is parsed as an option, and `--upload-pack=<cmd>` is arbitrary command execution.
|
|
80
|
+
const remote = normalizeGitUri(normalizeRemoteSourceUri(source));
|
|
81
|
+
if (remote.startsWith('-'))
|
|
82
|
+
throw new Error(`Source URI '${remote}' must not begin with '-'.`);
|
|
83
|
+
// A refspec (`refs/tags/x:refs/tags/x`) is two refs; validate each side.
|
|
84
|
+
const ref = fetchRef ?? source.ref;
|
|
85
|
+
if (ref !== undefined)
|
|
86
|
+
for (const part of ref.split(':'))
|
|
87
|
+
assertFetchableRef(part);
|
|
88
|
+
};
|
|
89
|
+
const fetchSource = (temporaryRoot, source, fetchRef) => {
|
|
90
|
+
const remote = normalizeGitUri(normalizeRemoteSourceUri(source));
|
|
91
|
+
const ref = fetchRef ?? source.ref;
|
|
92
|
+
runGit(['init', '--quiet', temporaryRoot]);
|
|
93
|
+
// Fetch by URL rather than `remote add origin <url>`: a credential-bearing URL written into
|
|
94
|
+
// .git/config would be renamed into the long-lived cache and persist there in plaintext.
|
|
95
|
+
// An omitted ref must resolve the remote's default branch — with no refspec at all, FETCH_HEAD
|
|
96
|
+
// holds every branch tip and `rev-parse FETCH_HEAD` would take whichever sorts first.
|
|
97
|
+
runGit(['-C', temporaryRoot, 'fetch', '--quiet', '--depth=1', remote, ref ?? 'HEAD']);
|
|
98
|
+
runGit(['-C', temporaryRoot, 'checkout', '--quiet', '--detach', 'FETCH_HEAD']);
|
|
99
|
+
return runGit(['-C', temporaryRoot, 'rev-parse', 'HEAD']);
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Fetches into a temporary sibling and swaps only a validated checkout into place. A failed fetch,
|
|
103
|
+
* checkout, validation, or rename leaves an existing cache intact.
|
|
104
|
+
*/
|
|
105
|
+
export const syncRemoteRepositoryAtomically = (input) => {
|
|
106
|
+
assertFetchableSource(input.source, input.fetchRef);
|
|
107
|
+
mkdirSync(dirname(input.cachePath), { recursive: true });
|
|
108
|
+
const nonce = `${process.pid}-${Math.random().toString(16).slice(2)}`;
|
|
109
|
+
const temporaryRoot = `${input.cachePath}.outfitter-${nonce}.tmp`;
|
|
110
|
+
const staleRoot = `${input.cachePath}.outfitter-${nonce}.stale`;
|
|
111
|
+
let movedStaleCache = false;
|
|
112
|
+
try {
|
|
113
|
+
const commit = fetchSource(temporaryRoot, input.source, input.fetchRef);
|
|
114
|
+
const warnings = input.validate?.(temporaryRoot, commit) ?? 0;
|
|
115
|
+
if (tryReadCleanHead(input.cachePath) === commit) {
|
|
116
|
+
return { commit, status: 'unchanged', warnings };
|
|
117
|
+
}
|
|
118
|
+
if (existsSync(input.cachePath)) {
|
|
119
|
+
renameSync(input.cachePath, staleRoot);
|
|
120
|
+
movedStaleCache = true;
|
|
121
|
+
}
|
|
122
|
+
renameSync(temporaryRoot, input.cachePath);
|
|
123
|
+
if (movedStaleCache)
|
|
124
|
+
rmSync(staleRoot, { recursive: true, force: true });
|
|
125
|
+
return { commit, status: 'updated', warnings };
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
/* v8 ignore next -- only an OS-level failure during the atomic rename needs restoration. */
|
|
129
|
+
if (movedStaleCache && !existsSync(input.cachePath) && existsSync(staleRoot)) {
|
|
130
|
+
renameSync(staleRoot, input.cachePath);
|
|
131
|
+
}
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
finally {
|
|
135
|
+
rmSync(temporaryRoot, { recursive: true, force: true });
|
|
136
|
+
rmSync(staleRoot, { recursive: true, force: true });
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=GitRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GitRepository.js","sourceRoot":"","sources":["../../src/sources/GitRepository.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,OAAO,E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C,EAAE,CAAC;YAChC,UAAU,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YACvC,eAAe,GAAG,IAAI,CAAC;QACzB,CAAC;QACD,UAAU,CAAC,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;QAC3C,IAAI,eAAe;YAAE,MAAM,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACzE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,4FAA4F;QAC5F,IAAI,eAAe,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7E,UAAU,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;QACzC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACxD,MAAM,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RemoteSourceReference } from './SourceCache.js';
|
|
2
|
+
export interface GitHubRepositoryVisibilityClassifier {
|
|
3
|
+
classify(repository: string): 'private' | 'public' | 'unknown';
|
|
4
|
+
}
|
|
5
|
+
export interface PrivateCatalogPrompt {
|
|
6
|
+
readonly interactive: boolean;
|
|
7
|
+
confirm(repository: string): boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PrivateCatalogSkippedResult {
|
|
10
|
+
readonly uri: string;
|
|
11
|
+
readonly cachePath: string;
|
|
12
|
+
readonly status: 'skipped';
|
|
13
|
+
readonly message: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PrivateCatalogGateResult<T extends RemoteSourceReference> {
|
|
16
|
+
readonly allowedSources: readonly T[];
|
|
17
|
+
readonly skippedResults: readonly PrivateCatalogSkippedResult[];
|
|
18
|
+
readonly messages: readonly string[];
|
|
19
|
+
}
|
|
20
|
+
export interface PrivateCatalogSourceGate {
|
|
21
|
+
filter<T extends RemoteSourceReference>(sources: readonly T[], cacheDirectory?: string): PrivateCatalogGateResult<T>;
|
|
22
|
+
}
|
|
23
|
+
export declare const createEnterprisePrivateCatalogGate: (input: {
|
|
24
|
+
readonly homeDirectory: string;
|
|
25
|
+
readonly classifier?: GitHubRepositoryVisibilityClassifier;
|
|
26
|
+
readonly prompt?: PrivateCatalogPrompt;
|
|
27
|
+
}) => PrivateCatalogSourceGate;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Loads the enterprise-licensed private-catalog policy boundary for CLI source synchronization.
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { resolveRepositoryCodeAsset } from '../paths/RepositoryAssets.js';
|
|
4
|
+
import { createRemoteRepositoryCachePath, formatRemoteSourceDisplay } from './SourceCache.js';
|
|
5
|
+
const loadEnterpriseGateModule = () => createRequire(import.meta.url)(resolveRepositoryCodeAsset('enterprise/cli/privateCatalogGate.cjs'));
|
|
6
|
+
export const createEnterprisePrivateCatalogGate = (input) => {
|
|
7
|
+
const enterprise = loadEnterpriseGateModule();
|
|
8
|
+
const { homeDirectory } = input;
|
|
9
|
+
const gate = enterprise.createPrivateCatalogGate({
|
|
10
|
+
homeDirectory,
|
|
11
|
+
classifier: input.classifier ?? enterprise.createGitHubRepositoryVisibilityClassifier(),
|
|
12
|
+
prompt: input.prompt,
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
filter(sources, cacheDirectory) {
|
|
16
|
+
return enterprise.gatePrivateCatalogSources(sources, gate, {
|
|
17
|
+
formatDisplayUri: formatRemoteSourceDisplay,
|
|
18
|
+
resolveCachePath: (source) => createRemoteRepositoryCachePath(homeDirectory, source, cacheDirectory),
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=PrivateCatalogGate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrivateCatalogGate.js","sourceRoot":"","sources":["../../src/sources/PrivateCatalogGate.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,OAAO,EAAE,+BAA+B,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AA6C9F,MAAM,wBAAwB,GAAG,GAAyB,EAAE,CAC1D,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAC5B,0BAA0B,CAAC,uCAAuC,CAAC,CAC5C,CAAC;AAE5B,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,KAIlD,EAA4B,EAAE;IAC7B,MAAM,UAAU,GAAG,wBAAwB,EAAE,CAAC;IAC9C,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAChC,MAAM,IAAI,GAAG,UAAU,CAAC,wBAAwB,CAAC;QAC/C,aAAa;QACb,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,UAAU,CAAC,0CAA0C,EAAE;QACvF,MAAM,EAAE,KAAK,CAAC,MAAM;KACrB,CAAC,CAAC;IAEH,OAAO;QACL,MAAM,CACJ,OAAqB,EACrB,cAAuB;YAEvB,OAAO,UAAU,CAAC,yBAAyB,CAAC,OAAO,EAAE,IAAI,EAAE;gBACzD,gBAAgB,EAAE,yBAAyB;gBAC3C,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,+BAA+B,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,CAAC;aACrG,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -10,10 +10,20 @@ export type RemoteSourceReference = {
|
|
|
10
10
|
readonly ref?: string;
|
|
11
11
|
readonly path?: string;
|
|
12
12
|
};
|
|
13
|
+
/** Distinguishes remote (`uri`/`github`) sources from local `path` sources. */
|
|
14
|
+
export declare const isRemoteSource: <T extends {
|
|
15
|
+
readonly uri?: string;
|
|
16
|
+
readonly github?: string;
|
|
17
|
+
}>(source: T) => source is T & RemoteSourceReference;
|
|
13
18
|
export declare const normalizeGitUri: (uri: string) => string;
|
|
14
19
|
export declare const normalizeRemoteSourceUri: (source: RemoteSourceReference) => string;
|
|
20
|
+
export declare const formatRemoteSourceDisplay: (source: RemoteSourceReference) => string;
|
|
15
21
|
export declare const redactSourceUriCredentials: (uri: string) => string;
|
|
22
|
+
/** Redacts credentials from every URI embedded in arbitrary command or stderr text. */
|
|
23
|
+
export declare const redactEmbeddedSourceCredentials: (value: string) => string;
|
|
16
24
|
export declare const encodeSourceUri: (uri: string) => string;
|
|
17
25
|
export declare const encodeRemoteSource: (source: RemoteSourceReference) => string;
|
|
18
|
-
|
|
26
|
+
/** Resolves the one cache root used by sync, settings, layer discovery, and setup bootstrap. */
|
|
27
|
+
export declare const resolveRemoteRepositoryCacheRoot: (homeDirectory: string, cacheDirectory?: string) => string;
|
|
28
|
+
export declare const createRemoteRepositoryCachePath: (homeDirectory: string, source: RemoteSourceReference, cacheDirectory?: string) => string;
|
|
19
29
|
export declare const resolveRemoteRepositorySubpath: (repositoryPath: string, subpath?: string) => string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Encodes remote `.agents` source cache paths and normalizes remote source references.
|
|
2
2
|
import { isAbsolute, join, relative, resolve } from 'node:path';
|
|
3
|
+
/** Distinguishes remote (`uri`/`github`) sources from local `path` sources. */
|
|
4
|
+
export const isRemoteSource = (source) => source.uri !== undefined || source.github !== undefined;
|
|
3
5
|
export const normalizeGitUri = (uri) => (uri.startsWith('git+') ? uri.slice('git+'.length) : uri);
|
|
4
6
|
export const normalizeRemoteSourceUri = (source) => {
|
|
5
7
|
if (source.uri !== undefined) {
|
|
@@ -7,6 +9,9 @@ export const normalizeRemoteSourceUri = (source) => {
|
|
|
7
9
|
}
|
|
8
10
|
return `git+https://github.com/${source.github}.git`;
|
|
9
11
|
};
|
|
12
|
+
export const formatRemoteSourceDisplay = (source) => source.github === undefined
|
|
13
|
+
? redactSourceUriCredentials(source.uri)
|
|
14
|
+
: `github:${source.github}${source.ref === undefined ? '' : `#${source.ref}`}`;
|
|
10
15
|
export const redactSourceUriCredentials = (uri) => {
|
|
11
16
|
const prefix = uri.startsWith('git+') ? 'git+' : '';
|
|
12
17
|
const normalizedUri = normalizeGitUri(uri);
|
|
@@ -20,12 +25,16 @@ export const redactSourceUriCredentials = (uri) => {
|
|
|
20
25
|
return `${prefix}${parsedUri.toString()}`;
|
|
21
26
|
}
|
|
22
27
|
catch {
|
|
23
|
-
return uri.replace(/\/\/[^/@\s]+@/
|
|
28
|
+
return uri.replace(/\/\/[^/@\s]+@/gu, '//REDACTED@');
|
|
24
29
|
}
|
|
25
30
|
};
|
|
31
|
+
/** Redacts credentials from every URI embedded in arbitrary command or stderr text. */
|
|
32
|
+
export const redactEmbeddedSourceCredentials = (value) => value.replace(/((?:git\+)?[A-Za-z][A-Za-z0-9+.-]*:\/\/)[^/@\s]+@/gu, '$1REDACTED@');
|
|
26
33
|
export const encodeSourceUri = (uri) => Buffer.from(redactSourceUriCredentials(uri), 'utf8').toString('base64url');
|
|
27
34
|
export const encodeRemoteSource = (source) => encodeSourceUri(`${normalizeRemoteSourceUri(source)}#${source.ref ?? ''}`);
|
|
28
|
-
|
|
35
|
+
/** Resolves the one cache root used by sync, settings, layer discovery, and setup bootstrap. */
|
|
36
|
+
export const resolveRemoteRepositoryCacheRoot = (homeDirectory, cacheDirectory) => cacheDirectory ?? join(homeDirectory, '.agents', 'cache');
|
|
37
|
+
export const createRemoteRepositoryCachePath = (homeDirectory, source, cacheDirectory) => join(resolveRemoteRepositoryCacheRoot(homeDirectory, cacheDirectory), 'repos', encodeRemoteSource(source));
|
|
29
38
|
export const resolveRemoteRepositorySubpath = (repositoryPath, subpath = '') => {
|
|
30
39
|
if (isAbsolute(subpath)) {
|
|
31
40
|
throw new Error(`Remote repository path '${subpath}' must be relative.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceCache.js","sourceRoot":"","sources":["../../src/sources/SourceCache.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOhE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAElH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAA6B,EAAU,EAAE;IAChF,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,MAAM,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,OAAO,0BAA0B,MAAM,CAAC,MAAM,MAAM,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,GAAW,EAAU,EAAE;IAChE,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACpD,MAAM,aAAa,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IAE3C,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;QAEzC,IAAI,SAAS,CAAC,QAAQ,KAAK,E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runtime branding.
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
export const readOutfitterVersion = () => {
|
|
4
|
+
const packageJsonPath = new URL('../../package.json', import.meta.url);
|
|
5
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
|
|
6
|
+
return packageJson.version;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=OutfitterVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutfitterVersion.js","sourceRoot":"","sources":["../../src/version/OutfitterVersion.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAW,EAAE;IAC/C,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAiC,CAAC;IAEtG,OAAO,WAAW,CAAC,OAAO,CAAC;AAC7B,CAAC,CAAC"}
|
|
@@ -1,45 +1,60 @@
|
|
|
1
1
|
# Outfitter documentation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Outfitter lays out conventions for iterating on and sharing agent configuration — agent profiles, skills, and loadouts. The docs follow that arc: **set up** your own, **understand** the pieces, **share** them across projects and your org, **automate** them on more surfaces, then contribute back. Each page keeps to one concept and links onward when you need the next one, so nothing here has to be read up front.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Start (you)
|
|
6
6
|
|
|
7
|
-
- [Getting started](./getting-started.md)
|
|
8
|
-
- [
|
|
9
|
-
- [
|
|
10
|
-
- [
|
|
7
|
+
- [Getting started](./getting-started.md) — install, first run, default agent.
|
|
8
|
+
- [First-time CLI agent users](./first-time-cli-agent-users.md) — new to agent CLIs entirely.
|
|
9
|
+
- [Switching to Outfitter](./switching-to-outfitter.md) — adopt from an existing agent-CLI setup.
|
|
10
|
+
- [Porting a Claude Code setup](./porting-claude.md) — `~/.claude` into `~/.agents/` with symlinks back.
|
|
11
|
+
|
|
12
|
+
## Understand (the model)
|
|
13
|
+
|
|
14
|
+
- [Concepts](./concepts.md) — resolve → compose → adapt; layers and precedence.
|
|
15
|
+
- [Agents](./agents.md) — the `agents/<id>/agent.md` resource and its loadout — what you run.
|
|
16
|
+
- [Agent profiles](./profiles.md) — why an agent and its loadout _is_ the profile.
|
|
17
|
+
- [Skills](./skills.md) — capability packages with progressive disclosure, references, and routing.
|
|
18
|
+
- [Personas](./personas.md) — the base-agent-plus-persona-documents review convention.
|
|
19
|
+
- [Subagents and delegation](./subagents.md) — the four delegation boundaries, from in-session helpers to Kubernetes Jobs.
|
|
20
|
+
- [Settings](./settings.md) — scopes, schema, and the flat `settings.local.yml` override file.
|
|
21
|
+
- [Tasks](./tasks.md) — placeholder for a separate upcoming RFC.
|
|
22
|
+
|
|
23
|
+
## Share (project → org → community)
|
|
11
24
|
|
|
12
|
-
|
|
25
|
+
- [Catalogs](./catalogs.md) — publish and consume shareable `.agents` payloads; standalone and colocated layouts.
|
|
26
|
+
- [Conventions](./conventions.md) — place a resource once, specialize downward, never copy.
|
|
27
|
+
- [Local dotagents development](./local-development.md) — a personal standalone `.agents` repo that trickles upstream.
|
|
28
|
+
- [Iterating on an agent](./iterating-on-profiles.md) — the edit-run-inspect loop.
|
|
29
|
+
- [Best practices](./best-practices.md) — few agents, many skills.
|
|
13
30
|
|
|
14
|
-
|
|
15
|
-
- [Agents](./agents.md) — The `agents/<id>/agent.md` resource and its loadout — what you run.
|
|
16
|
-
- [Agent profiles](./profiles.md) — Why an agent and its loadout _is_ the profile.
|
|
17
|
-
- [Personas](./personas.md) — The base-agent-plus-persona-documents review convention.
|
|
18
|
-
- [Subagents](./subagents.md) — Agents projected as harness delegates; leader-agent delegation.
|
|
19
|
-
- [Skills](./skills.md) — Capability packages with progressive disclosure, references, and routing.
|
|
20
|
-
- [Tasks](./tasks.md) — Placeholder for a separate upcoming RFC.
|
|
31
|
+
## Automate (surfaces)
|
|
21
32
|
|
|
22
|
-
|
|
33
|
+
The same composition runs on every surface; only the trigger changes.
|
|
23
34
|
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [
|
|
27
|
-
- [Hooks](./hooks.md) —
|
|
35
|
+
- [Running an agent in GitHub Actions](./actions.md) — headless runs on any workflow trigger.
|
|
36
|
+
- [Recurring runs](./recurring-runs.md) — loops three ways: the local loop extension, Actions cron, cluster schedules.
|
|
37
|
+
- [In-cluster agents](./in-cluster.md) — resident agents, CronJobs, and subagent Jobs via Link Operator.
|
|
38
|
+
- [Hooks](./hooks.md) — harness hook wiring and the protocol gap.
|
|
39
|
+
- [Dump](./dump-and-bake.md) — deterministic, self-contained `.agents/` dumps.
|
|
28
40
|
- [State persistence](./state.md)
|
|
29
41
|
- [Adapter support matrix](./support-matrix.md)
|
|
30
42
|
|
|
31
|
-
##
|
|
43
|
+
## Use cases (stories)
|
|
32
44
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- [
|
|
36
|
-
- [
|
|
37
|
-
- [
|
|
38
|
-
- [
|
|
39
|
-
- [
|
|
45
|
+
Each use case is a worked story — a problem, the composition that answers it, and the payoff — with links back to the concepts it uses.
|
|
46
|
+
|
|
47
|
+
- [Shared conventions without duplication](./usecases/shared-conventions.md) — one conventional-commits rule for every user, org, and project; zero copies.
|
|
48
|
+
- [Flaky-test post-mortems in CI](./usecases/flaky-test-postmortems.md) — an on-failure step that classifies flake vs. regression and comments with evidence.
|
|
49
|
+
- [Grafana alert investigations in-cluster](./usecases/grafana-alert-investigator.md) — a webhook turns each firing alert into one bounded investigation Job.
|
|
50
|
+
- [Self-improving skills](./usecases/self-improving-skills.md) — a weekly loop that proposes skill edits and ships only measured improvements.
|
|
51
|
+
- [Resident agents: a researcher wiki](./usecases/resident-agents.md) — a long-lived agent that turns an email inbox into a compounding, reviewable knowledge base.
|
|
52
|
+
- [Persona reviews](./usecases/persona-reviews.md) — a base review agent plus customer-persona documents for feedback on ideas, docs, and designs.
|
|
53
|
+
- [Organization catalog](./usecases/organization-profile-catalog.md) — publish shared org resources and defaults through an `owner/.outfitter` control repository.
|
|
54
|
+
- [Engineering catalog](./usecases/engineering.md) — package engineering agents and skills for repeatable workflows.
|
|
40
55
|
|
|
41
|
-
##
|
|
56
|
+
## Reference
|
|
42
57
|
|
|
43
|
-
- [
|
|
44
|
-
- [
|
|
45
|
-
- [
|
|
58
|
+
- [CLI reference](./cli.md)
|
|
59
|
+
- [Migration from legacy profiles](./migration.md)
|
|
60
|
+
- [Philosophy](../philosophy.md) — why Outfitter exists.
|