@ai-outfitter/outfitter 0.3.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.
Files changed (156) hide show
  1. package/LICENSE.md +58 -0
  2. package/README.md +256 -0
  3. package/dist/agents/AdapterProfileControls.d.ts +20 -0
  4. package/dist/agents/AdapterProfileControls.js +63 -0
  5. package/dist/agents/AdapterProfileControls.js.map +1 -0
  6. package/dist/agents/AdapterStatePaths.d.ts +12 -0
  7. package/dist/agents/AdapterStatePaths.js +44 -0
  8. package/dist/agents/AdapterStatePaths.js.map +1 -0
  9. package/dist/agents/AgentAdapter.d.ts +32 -0
  10. package/dist/agents/AgentAdapter.js +2 -0
  11. package/dist/agents/AgentAdapter.js.map +1 -0
  12. package/dist/agents/AgentRegistry.d.ts +6 -0
  13. package/dist/agents/AgentRegistry.js +17 -0
  14. package/dist/agents/AgentRegistry.js.map +1 -0
  15. package/dist/agents/LaunchResources.d.ts +13 -0
  16. package/dist/agents/LaunchResources.js +35 -0
  17. package/dist/agents/LaunchResources.js.map +1 -0
  18. package/dist/agents/ResourceIdentity.d.ts +2 -0
  19. package/dist/agents/ResourceIdentity.js +51 -0
  20. package/dist/agents/ResourceIdentity.js.map +1 -0
  21. package/dist/agents/claude/ClaudeAdapter.d.ts +2 -0
  22. package/dist/agents/claude/ClaudeAdapter.js +117 -0
  23. package/dist/agents/claude/ClaudeAdapter.js.map +1 -0
  24. package/dist/agents/claude/ClaudeCompositeProfileWriter.d.ts +5 -0
  25. package/dist/agents/claude/ClaudeCompositeProfileWriter.js +7 -0
  26. package/dist/agents/claude/ClaudeCompositeProfileWriter.js.map +1 -0
  27. package/dist/agents/pi/PiAdapter.d.ts +2 -0
  28. package/dist/agents/pi/PiAdapter.js +229 -0
  29. package/dist/agents/pi/PiAdapter.js.map +1 -0
  30. package/dist/agents/pi/PiCompositeProfileWriter.d.ts +5 -0
  31. package/dist/agents/pi/PiCompositeProfileWriter.js +7 -0
  32. package/dist/agents/pi/PiCompositeProfileWriter.js.map +1 -0
  33. package/dist/agents/pi/PiMcpConfig.d.ts +2 -0
  34. package/dist/agents/pi/PiMcpConfig.js +114 -0
  35. package/dist/agents/pi/PiMcpConfig.js.map +1 -0
  36. package/dist/agents/pi/PiSettingsMergePolicy.d.ts +17 -0
  37. package/dist/agents/pi/PiSettingsMergePolicy.js +59 -0
  38. package/dist/agents/pi/PiSettingsMergePolicy.js.map +1 -0
  39. package/dist/cli/OutfitterCli.d.ts +4 -0
  40. package/dist/cli/OutfitterCli.js +32 -0
  41. package/dist/cli/OutfitterCli.js.map +1 -0
  42. package/dist/cli/commands/CommandObject.d.ts +11 -0
  43. package/dist/cli/commands/CommandObject.js +5 -0
  44. package/dist/cli/commands/CommandObject.js.map +1 -0
  45. package/dist/cli/commands/FirstRunWelcomeProfile.d.ts +11 -0
  46. package/dist/cli/commands/FirstRunWelcomeProfile.js +107 -0
  47. package/dist/cli/commands/FirstRunWelcomeProfile.js.map +1 -0
  48. package/dist/cli/commands/PiLoginLaunch.d.ts +10 -0
  49. package/dist/cli/commands/PiLoginLaunch.js +76 -0
  50. package/dist/cli/commands/PiLoginLaunch.js.map +1 -0
  51. package/dist/cli/commands/RunCommand.d.ts +30 -0
  52. package/dist/cli/commands/RunCommand.js +299 -0
  53. package/dist/cli/commands/RunCommand.js.map +1 -0
  54. package/dist/cli/commands/SetupCommand.d.ts +34 -0
  55. package/dist/cli/commands/SetupCommand.js +379 -0
  56. package/dist/cli/commands/SetupCommand.js.map +1 -0
  57. package/dist/cli/commands/SyncCommand.d.ts +28 -0
  58. package/dist/cli/commands/SyncCommand.js +178 -0
  59. package/dist/cli/commands/SyncCommand.js.map +1 -0
  60. package/dist/cli/commands/WelcomeCommand.d.ts +54 -0
  61. package/dist/cli/commands/WelcomeCommand.js +214 -0
  62. package/dist/cli/commands/WelcomeCommand.js.map +1 -0
  63. package/dist/cli/commands/profile/Command.d.ts +6 -0
  64. package/dist/cli/commands/profile/Command.js +21 -0
  65. package/dist/cli/commands/profile/Command.js.map +1 -0
  66. package/dist/cli/commands/profile/CreateCommand.d.ts +19 -0
  67. package/dist/cli/commands/profile/CreateCommand.js +115 -0
  68. package/dist/cli/commands/profile/CreateCommand.js.map +1 -0
  69. package/dist/cli/commands/profile/ListCommand.d.ts +17 -0
  70. package/dist/cli/commands/profile/ListCommand.js +85 -0
  71. package/dist/cli/commands/profile/ListCommand.js.map +1 -0
  72. package/dist/cli/commands/profile/Shared.d.ts +9 -0
  73. package/dist/cli/commands/profile/Shared.js +10 -0
  74. package/dist/cli/commands/profile/Shared.js.map +1 -0
  75. package/dist/cli.d.ts +3 -0
  76. package/dist/cli.js +22 -0
  77. package/dist/cli.js.map +1 -0
  78. package/dist/compositeProfile/CompositeProfile.d.ts +8 -0
  79. package/dist/compositeProfile/CompositeProfile.js +6 -0
  80. package/dist/compositeProfile/CompositeProfile.js.map +1 -0
  81. package/dist/compositeProfile/CompositeProfileAssembler.d.ts +12 -0
  82. package/dist/compositeProfile/CompositeProfileAssembler.js +32 -0
  83. package/dist/compositeProfile/CompositeProfileAssembler.js.map +1 -0
  84. package/dist/compositeProfile/CompositeProfileFile.d.ts +16 -0
  85. package/dist/compositeProfile/CompositeProfileFile.js +16 -0
  86. package/dist/compositeProfile/CompositeProfileFile.js.map +1 -0
  87. package/dist/compositeProfile/CompositeProfileTemplate.d.ts +15 -0
  88. package/dist/compositeProfile/CompositeProfileTemplate.js +65 -0
  89. package/dist/compositeProfile/CompositeProfileTemplate.js.map +1 -0
  90. package/dist/compositeProfile/CompositeProfileWatcher.d.ts +18 -0
  91. package/dist/compositeProfile/CompositeProfileWatcher.js +46 -0
  92. package/dist/compositeProfile/CompositeProfileWatcher.js.map +1 -0
  93. package/dist/compositeProfile/StatePersistence.d.ts +24 -0
  94. package/dist/compositeProfile/StatePersistence.js +224 -0
  95. package/dist/compositeProfile/StatePersistence.js.map +1 -0
  96. package/dist/merge/ArrayMergePolicy.d.ts +8 -0
  97. package/dist/merge/ArrayMergePolicy.js +45 -0
  98. package/dist/merge/ArrayMergePolicy.js.map +1 -0
  99. package/dist/merge/SettingsValueMerger.d.ts +11 -0
  100. package/dist/merge/SettingsValueMerger.js +34 -0
  101. package/dist/merge/SettingsValueMerger.js.map +1 -0
  102. package/dist/profiles/Profile.d.ts +32 -0
  103. package/dist/profiles/Profile.js +7 -0
  104. package/dist/profiles/Profile.js.map +1 -0
  105. package/dist/profiles/ProfileCache.d.ts +8 -0
  106. package/dist/profiles/ProfileCache.js +36 -0
  107. package/dist/profiles/ProfileCache.js.map +1 -0
  108. package/dist/profiles/ProfileLoader.d.ts +24 -0
  109. package/dist/profiles/ProfileLoader.js +169 -0
  110. package/dist/profiles/ProfileLoader.js.map +1 -0
  111. package/dist/profiles/ProfileMerger.d.ts +20 -0
  112. package/dist/profiles/ProfileMerger.js +97 -0
  113. package/dist/profiles/ProfileMerger.js.map +1 -0
  114. package/dist/profiles/ProfileSource.d.ts +35 -0
  115. package/dist/profiles/ProfileSource.js +13 -0
  116. package/dist/profiles/ProfileSource.js.map +1 -0
  117. package/dist/schemas/profile-source.schema.json +29 -0
  118. package/dist/schemas/profile.schema.json +115 -0
  119. package/dist/schemas/settings.schema.json +37 -0
  120. package/dist/settings/Settings.d.ts +17 -0
  121. package/dist/settings/Settings.js +5 -0
  122. package/dist/settings/Settings.js.map +1 -0
  123. package/dist/settings/SettingsLoader.d.ts +33 -0
  124. package/dist/settings/SettingsLoader.js +129 -0
  125. package/dist/settings/SettingsLoader.js.map +1 -0
  126. package/dist/settings/SettingsMerger.d.ts +2 -0
  127. package/dist/settings/SettingsMerger.js +31 -0
  128. package/dist/settings/SettingsMerger.js.map +1 -0
  129. package/dist/validation/SchemaValidator.d.ts +11 -0
  130. package/dist/validation/SchemaValidator.js +36 -0
  131. package/dist/validation/SchemaValidator.js.map +1 -0
  132. package/dist/validation/YamlDocument.d.ts +13 -0
  133. package/dist/validation/YamlDocument.js +11 -0
  134. package/dist/validation/YamlDocument.js.map +1 -0
  135. package/doc/.deepreview +30 -0
  136. package/doc/architecture.md +834 -0
  137. package/doc/controllable-elements.md +162 -0
  138. package/doc/file_structure.md +133 -0
  139. package/doc/integration_test_system.md +214 -0
  140. package/doc/specs/validating_requirements_with_rules.md +55 -0
  141. package/doc/state_writeback_strategy.md +334 -0
  142. package/package.json +73 -0
  143. package/requirements/OFTR-001-project-foundation.md +53 -0
  144. package/requirements/OFTR-002-settings.md +65 -0
  145. package/requirements/OFTR-003-profiles.md +51 -0
  146. package/requirements/OFTR-004-sync-and-setup.md +57 -0
  147. package/requirements/OFTR-005-run-and-composite-profile.md +60 -0
  148. package/requirements/OFTR-006-agent-adapters.md +64 -0
  149. package/requirements/OFTR-007-controllable-elements.md +32 -0
  150. package/requirements/OFTR-008-requirements-governance.md +42 -0
  151. package/requirements/OFTR-009-release-publishing.md +25 -0
  152. package/requirements/OFTR-010-onboarding-welcome.md +38 -0
  153. package/src/schemas/SchemaDocument.ts +20 -0
  154. package/src/schemas/profile-source.schema.json +29 -0
  155. package/src/schemas/profile.schema.json +115 -0
  156. package/src/schemas/settings.schema.json +37 -0
@@ -0,0 +1,115 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://outfitter.dev/schemas/profile.schema.json",
4
+ "title": "Outfitter profile",
5
+ "type": "object",
6
+ "properties": {
7
+ "id": {
8
+ "type": "string",
9
+ "pattern": "^[a-z0-9][a-z0-9._-]*[a-z0-9]$|^[a-z0-9]$"
10
+ },
11
+ "label": { "type": "string" },
12
+ "inherits": {
13
+ "type": "array",
14
+ "items": {
15
+ "type": "string",
16
+ "pattern": "^[a-z0-9][a-z0-9._-]*[a-z0-9]$|^[a-z0-9]$"
17
+ }
18
+ },
19
+ "state_persistence": {
20
+ "type": "object",
21
+ "additionalProperties": {
22
+ "enum": ["symlink", "discard", "warn", "error", "prompt"]
23
+ }
24
+ },
25
+ "controls": {
26
+ "type": "object",
27
+ "properties": {
28
+ "model": { "type": "string" },
29
+ "provider": { "type": "string" },
30
+ "thinking": { "type": "string" },
31
+ "args": {
32
+ "type": "array",
33
+ "items": { "type": "string" }
34
+ },
35
+ "session_directory": { "type": "string" },
36
+ "extensions": {
37
+ "type": "array",
38
+ "items": { "type": "string" }
39
+ },
40
+ "skills": {
41
+ "type": "array",
42
+ "items": { "type": "string" }
43
+ },
44
+ "prompt_template": { "type": "string" },
45
+ "system_prompt": { "type": "string" },
46
+ "append_system_prompt": { "type": "string" },
47
+ "environment": {
48
+ "type": "object",
49
+ "additionalProperties": { "type": "string" }
50
+ },
51
+ "pi": {
52
+ "type": "object",
53
+ "properties": {
54
+ "model": { "type": "string" },
55
+ "provider": { "type": "string" },
56
+ "thinking": { "type": "string" },
57
+ "args": {
58
+ "type": "array",
59
+ "items": { "type": "string" }
60
+ },
61
+ "session_directory": { "type": "string" },
62
+ "extensions": {
63
+ "type": "array",
64
+ "items": { "type": "string" }
65
+ },
66
+ "skills": {
67
+ "type": "array",
68
+ "items": { "type": "string" }
69
+ },
70
+ "prompt_template": { "type": "string" },
71
+ "system_prompt": { "type": "string" },
72
+ "append_system_prompt": { "type": "string" },
73
+ "allow_external_deepwork_jobs": { "type": "boolean" },
74
+ "environment": {
75
+ "type": "object",
76
+ "additionalProperties": { "type": "string" }
77
+ }
78
+ },
79
+ "additionalProperties": true
80
+ },
81
+ "claude": {
82
+ "type": "object",
83
+ "properties": {
84
+ "model": { "type": "string" },
85
+ "provider": { "type": "string" },
86
+ "thinking": { "type": "string" },
87
+ "args": {
88
+ "type": "array",
89
+ "items": { "type": "string" }
90
+ },
91
+ "session_directory": { "type": "string" },
92
+ "extensions": {
93
+ "type": "array",
94
+ "items": { "type": "string" }
95
+ },
96
+ "skills": {
97
+ "type": "array",
98
+ "items": { "type": "string" }
99
+ },
100
+ "prompt_template": { "type": "string" },
101
+ "system_prompt": { "type": "string" },
102
+ "append_system_prompt": { "type": "string" },
103
+ "environment": {
104
+ "type": "object",
105
+ "additionalProperties": { "type": "string" }
106
+ }
107
+ },
108
+ "additionalProperties": true
109
+ }
110
+ },
111
+ "additionalProperties": true
112
+ }
113
+ },
114
+ "additionalProperties": true
115
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://outfitter.dev/schemas/settings.schema.json",
4
+ "title": "Outfitter settings",
5
+ "type": "object",
6
+ "properties": {
7
+ "default_profile": { "type": "string", "minLength": 1 },
8
+ "default_agent": { "enum": ["pi", "claude"] },
9
+ "cache_directory": { "type": "string", "minLength": 1 },
10
+ "profile_sources": {
11
+ "type": "array",
12
+ "items": { "$ref": "profile-source.schema.json" }
13
+ },
14
+ "remote_settings": {
15
+ "type": "array",
16
+ "items": {
17
+ "type": "object",
18
+ "oneOf": [
19
+ { "required": ["uri", "path"], "not": { "required": ["github"] } },
20
+ { "required": ["github", "path"], "not": { "required": ["uri"] } }
21
+ ],
22
+ "properties": {
23
+ "path": { "type": "string", "minLength": 1 },
24
+ "uri": { "type": "string", "minLength": 1 },
25
+ "github": { "type": "string", "pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$" },
26
+ "ref": { "type": "string", "minLength": 1 }
27
+ },
28
+ "additionalProperties": false
29
+ }
30
+ },
31
+ "custom_settings": {
32
+ "type": "object",
33
+ "description": "Arbitrary YAML-compatible values exposed to Outfitter compositeProfile templates as outfitter.custom_settings."
34
+ }
35
+ },
36
+ "additionalProperties": true
37
+ }
@@ -0,0 +1,17 @@
1
+ import type { ProfileSourceReference, RemoteSourceReference } from '../profiles/ProfileSource.js';
2
+ export type RemoteSettingsReference = RemoteSourceReference & {
3
+ readonly path: string;
4
+ };
5
+ export type SettingsValue = string | number | boolean | null | readonly SettingsValue[] | {
6
+ readonly [key: string]: SettingsValue;
7
+ };
8
+ export type CustomSettings = Readonly<Record<string, SettingsValue>>;
9
+ export interface Settings {
10
+ readonly defaultProfile?: string;
11
+ readonly defaultAgent?: string;
12
+ readonly profileSources?: readonly ProfileSourceReference[];
13
+ readonly remoteSettings?: readonly RemoteSettingsReference[];
14
+ readonly cacheDirectory?: string;
15
+ readonly customSettings?: CustomSettings;
16
+ }
17
+ export declare const emptySettings: () => Settings;
@@ -0,0 +1,5 @@
1
+ export const emptySettings = () => ({
2
+ profileSources: [],
3
+ remoteSettings: [],
4
+ });
5
+ //# sourceMappingURL=Settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../src/settings/Settings.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,MAAM,aAAa,GAAG,GAAa,EAAE,CAAC,CAAC;IAC5C,cAAc,EAAE,EAAE;IAClB,cAAc,EAAE,EAAE;CACnB,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { ValidationIssue } from '../validation/SchemaValidator.js';
2
+ import type { RemoteSettingsReference, Settings } from './Settings.js';
3
+ export interface SettingsLocation {
4
+ readonly scope: 'user' | 'project' | 'project-local' | 'remote';
5
+ readonly path: string;
6
+ }
7
+ export interface SettingsLoadPlan {
8
+ readonly locations: readonly SettingsLocation[];
9
+ }
10
+ export interface LoadedSettingsFile {
11
+ readonly location: SettingsLocation;
12
+ readonly settings: Settings;
13
+ }
14
+ export interface SettingsLoadResult {
15
+ readonly files: readonly LoadedSettingsFile[];
16
+ readonly issues: readonly SettingsLoadIssue[];
17
+ }
18
+ export interface LoadedSettings extends SettingsLoadResult {
19
+ readonly settings: Settings;
20
+ }
21
+ export interface SettingsLoadIssue extends ValidationIssue {
22
+ readonly filePath: string;
23
+ }
24
+ export interface SettingsDiscoveryInput {
25
+ readonly homeDirectory: string;
26
+ readonly projectDirectory: string;
27
+ }
28
+ export declare const createSettingsLoadPlan: (locations: readonly SettingsLocation[]) => SettingsLoadPlan;
29
+ export declare const discoverSettingsLoadPlan: (input: SettingsDiscoveryInput) => SettingsLoadPlan;
30
+ export declare const discoverRemoteSettingsLoadPlan: (homeDirectory: string, remoteSettings: readonly RemoteSettingsReference[]) => SettingsLoadPlan;
31
+ export declare const loadSettingsFiles: (plan: SettingsLoadPlan) => SettingsLoadResult;
32
+ export declare const loadSettings: (plan: SettingsLoadPlan) => LoadedSettings;
33
+ export declare const loadSettingsWithCachedRemoteSettings: (input: SettingsDiscoveryInput, remoteSettingsReferencesOverride?: readonly RemoteSettingsReference[]) => LoadedSettings;
@@ -0,0 +1,129 @@
1
+ // Discovers, parses, validates, and converts Outfitter settings.yml files.
2
+ import { existsSync, readFileSync } from 'node:fs';
3
+ import { dirname, isAbsolute, join, resolve } from 'node:path';
4
+ import { createRemoteRepositoryCachePath, resolveRemoteRepositorySubpath } from '../profiles/ProfileCache.js';
5
+ import { validateSchema } from '../validation/SchemaValidator.js';
6
+ import { parseYamlDocument } from '../validation/YamlDocument.js';
7
+ import { mergeSettingsStack } from './SettingsMerger.js';
8
+ export const createSettingsLoadPlan = (locations) => ({
9
+ locations,
10
+ });
11
+ export const discoverSettingsLoadPlan = (input) => createSettingsLoadPlan([
12
+ { scope: 'user', path: join(input.homeDirectory, '.outfitter', 'settings.yml') },
13
+ { scope: 'project', path: join(input.projectDirectory, '.outfitter', 'settings.yml') },
14
+ { scope: 'project-local', path: join(input.projectDirectory, '.outfitter', 'local', 'settings.yml') },
15
+ ]);
16
+ export const discoverRemoteSettingsLoadPlan = (homeDirectory, remoteSettings) => discoverRemoteSettingsLocations(homeDirectory, remoteSettings).plan;
17
+ export const loadSettingsFiles = (plan) => {
18
+ const files = [];
19
+ const issues = [];
20
+ for (const location of plan.locations) {
21
+ if (existsSync(location.path)) {
22
+ addSettingsFile(location, files, issues);
23
+ }
24
+ }
25
+ return { files, issues };
26
+ };
27
+ export const loadSettings = (plan) => {
28
+ const result = loadSettingsFiles(plan);
29
+ return {
30
+ ...result,
31
+ settings: mergeSettingsStack(result.files.map((file) => file.settings)),
32
+ };
33
+ };
34
+ export const loadSettingsWithCachedRemoteSettings = (input, remoteSettingsReferencesOverride) => {
35
+ const localSettings = loadSettings(discoverSettingsLoadPlan(input));
36
+ const remoteSettingsReferences = remoteSettingsReferencesOverride ?? localSettings.settings.remoteSettings;
37
+ if (localSettings.issues.length > 0 || remoteSettingsReferences.length === 0) {
38
+ return localSettings;
39
+ }
40
+ const remoteSettingsLocations = discoverRemoteSettingsLocations(input.homeDirectory, remoteSettingsReferences);
41
+ const remoteSettings = loadSettings(remoteSettingsLocations.plan);
42
+ const files = [...remoteSettings.files, ...localSettings.files];
43
+ const issues = [...remoteSettingsLocations.issues, ...remoteSettings.issues, ...localSettings.issues];
44
+ return {
45
+ files,
46
+ issues,
47
+ settings: mergeSettingsStack(files.map((file) => file.settings)),
48
+ };
49
+ };
50
+ const discoverRemoteSettingsLocations = (homeDirectory, remoteSettings) => {
51
+ const locations = [];
52
+ const issues = [];
53
+ for (const [index, source] of remoteSettings.entries()) {
54
+ try {
55
+ locations.push({
56
+ scope: 'remote',
57
+ path: resolveRemoteRepositorySubpath(createRemoteRepositoryCachePath(homeDirectory, source), source.path),
58
+ });
59
+ }
60
+ catch (error) {
61
+ issues.push({
62
+ filePath: `remote_settings[${index}]`,
63
+ path: `/remote_settings/${index}/path`,
64
+ message: formatRemoteSettingsPathError(error),
65
+ });
66
+ }
67
+ }
68
+ return { plan: createSettingsLoadPlan(locations), issues };
69
+ };
70
+ const formatRemoteSettingsPathError = (error) => {
71
+ /* v8 ignore next -- repository subpath validation throws Error instances. */
72
+ if (!(error instanceof Error)) {
73
+ return String(error);
74
+ }
75
+ return error.message;
76
+ };
77
+ const addSettingsFile = (location, files, issues) => {
78
+ const parsed = parseYamlDocument(readFileSync(location.path, 'utf8'), location.path);
79
+ if (!parsed.ok) {
80
+ issues.push({ filePath: location.path, path: parsed.issue.path, message: parsed.issue.message });
81
+ return;
82
+ }
83
+ const validation = validateSchema('settings', parsed.document);
84
+ if (!validation.valid) {
85
+ issues.push(...validation.issues.map((issue) => ({ filePath: location.path, ...issue })));
86
+ return;
87
+ }
88
+ files.push({
89
+ location,
90
+ settings: convertSettingsDocument(parsed.document, dirname(location.path)),
91
+ });
92
+ };
93
+ const convertSettingsDocument = (document, settingsDirectory) => ({
94
+ defaultProfile: document.default_profile,
95
+ defaultAgent: document.default_agent,
96
+ profileSources: document.profile_sources?.map((source) => convertProfileSource(source, settingsDirectory)),
97
+ remoteSettings: document.remote_settings?.map(convertRemoteSettingsSource),
98
+ cacheDirectory: document.cache_directory === undefined
99
+ ? undefined
100
+ : resolveConfigDirectory(document.cache_directory, settingsDirectory),
101
+ customSettings: document.custom_settings,
102
+ });
103
+ const convertRemoteSettingsSource = (source) => {
104
+ if (source.uri !== undefined) {
105
+ return { uri: source.uri, ref: source.ref, path: source.path };
106
+ }
107
+ return { github: source.github, ref: source.ref, path: source.path };
108
+ };
109
+ const convertProfileSource = (source, settingsDirectory) => {
110
+ const filters = {
111
+ only: source.only,
112
+ except: source.except,
113
+ };
114
+ if (source.uri !== undefined) {
115
+ return { ...filters, uri: source.uri, ref: source.ref, path: source.path };
116
+ }
117
+ if (source.github !== undefined) {
118
+ return { ...filters, github: source.github, ref: source.ref, path: source.path };
119
+ }
120
+ return { ...filters, path: resolveProfileSourcePath(source.path, settingsDirectory) };
121
+ };
122
+ const resolveProfileSourcePath = (sourcePath, settingsDirectory) => resolveConfigDirectory(sourcePath, settingsDirectory);
123
+ const resolveConfigDirectory = (configuredPath, settingsDirectory) => {
124
+ if (isAbsolute(configuredPath)) {
125
+ return configuredPath;
126
+ }
127
+ return resolve(settingsDirectory, configuredPath);
128
+ };
129
+ //# sourceMappingURL=SettingsLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsLoader.js","sourceRoot":"","sources":["../../src/settings/SettingsLoader.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,+BAA+B,EAAE,8BAA8B,E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CAAC,MAAM,CAAC,IAAK,EAAE,iBAAiB,CAAC,EAAE,CAAC;AACzF,CAAC,CAAC;AAEF,MAAM,wBAAwB,GAAG,CAAC,UAAkB,EAAE,iBAAyB,EAAU,EAAE,CACzF,sBAAsB,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAExD,MAAM,sBAAsB,GAAG,CAAC,cAAsB,EAAE,iBAAyB,EAAU,EAAE;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"}
@@ -0,0 +1,2 @@
1
+ import type { Settings } from './Settings.js';
2
+ export declare const mergeSettingsStack: (settingsStack: readonly Settings[]) => Settings;
@@ -0,0 +1,31 @@
1
+ // Provides deterministic Settings merge scaffolding.
2
+ import { mergeObjectsWithPolicy } from '../merge/SettingsValueMerger.js';
3
+ import { emptySettings } from './Settings.js';
4
+ export const mergeSettingsStack = (settingsStack) => {
5
+ let defaultProfile;
6
+ let defaultAgent;
7
+ let profileSources;
8
+ let remoteSettings;
9
+ let cacheDirectory;
10
+ let customSettings;
11
+ for (const settings of settingsStack) {
12
+ defaultProfile = settings.defaultProfile ?? defaultProfile;
13
+ defaultAgent = settings.defaultAgent ?? defaultAgent;
14
+ profileSources = settings.profileSources ?? profileSources;
15
+ remoteSettings = settings.remoteSettings ?? remoteSettings;
16
+ cacheDirectory = settings.cacheDirectory ?? cacheDirectory;
17
+ customSettings = mergeOptionalCustomSettings(customSettings, settings.customSettings);
18
+ }
19
+ return {
20
+ ...emptySettings(),
21
+ defaultProfile,
22
+ defaultAgent,
23
+ profileSources: profileSources ?? [],
24
+ remoteSettings: remoteSettings ?? [],
25
+ cacheDirectory,
26
+ customSettings: customSettings ?? {},
27
+ };
28
+ };
29
+ const mergeOptionalCustomSettings = (lowerPrecedence, higherPrecedence) => higherPrecedence === undefined ? lowerPrecedence : mergeCustomSettings(lowerPrecedence, higherPrecedence);
30
+ const mergeCustomSettings = (lowerPrecedence, higherPrecedence) => mergeObjectsWithPolicy(lowerPrecedence, higherPrecedence);
31
+ //# sourceMappingURL=SettingsMerger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsMerger.js","sourceRoot":"","sources":["../../src/settings/SettingsMerger.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,aAAkC,EAAY,EAAE;IACjF,IAAI,cAAkC,CAAC;IACvC,IAAI,YAAgC,CAAC;IACrC,IAAI,cAA0C,CAAC;IAC/C,IAAI,cAA0C,CAAC;IAC/C,IAAI,cAAkC,CAAC;IACvC,IAAI,cAA0C,CAAC;IAE/C,KAAK,MAAM,QAAQ,IAAI,aAAa,EAAE,CAAC;QACrC,cAAc,GAAG,QAAQ,CAAC,cAAc,IAAI,cAAc,CAAC;QAC3D,YAAY,GAAG,QAAQ,CAAC,YAAY,IAAI,YAAY,CAAC;QAErD,cAAc,GAAG,QAAQ,CAAC,cAAc,IAAI,cAAc,CAAC;QAC3D,cAAc,GAAG,QAAQ,CAAC,cAAc,IAAI,cAAc,CAAC;QAC3D,cAAc,GAAG,QAAQ,CAAC,cAAc,IAAI,cAAc,CAAC;QAC3D,cAAc,GAAG,2BAA2B,CAAC,cAAc,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IACxF,CAAC;IAED,OAAO;QACL,GAAG,aAAa,EAAE;QAClB,cAAc;QACd,YAAY;QACZ,cAAc,EAAE,cAAc,IAAI,EAAE;QACpC,cAAc,EAAE,cAAc,IAAI,EAAE;QACpC,cAAc;QACd,cAAc,EAAE,cAAc,IAAI,EAAE;KACrC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAClC,eAA2C,EAC3C,gBAA4C,EAChB,EAAE,CAC9B,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,mBAAmB,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;AAE5G,MAAM,mBAAmB,GAAG,CAC1B,eAA2C,EAC3C,gBAAgC,EAChB,EAAE,CAAC,sBAAsB,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export type SchemaName = 'settings' | 'profile' | 'profile-source';
2
+ export interface ValidationIssue {
3
+ readonly path: string;
4
+ readonly message: string;
5
+ }
6
+ export interface ValidationResult {
7
+ readonly valid: boolean;
8
+ readonly issues: readonly ValidationIssue[];
9
+ }
10
+ export declare const createValidationResult: (issues: readonly ValidationIssue[]) => ValidationResult;
11
+ export declare const validateSchema: (schemaName: SchemaName, document: unknown) => ValidationResult;
@@ -0,0 +1,36 @@
1
+ // Validates parsed Outfitter YAML documents against bundled JSON Schemas.
2
+ import { readFileSync } from 'node:fs';
3
+ import { Ajv2020 } from 'ajv/dist/2020.js';
4
+ const readSchema = (schemaFileName) => JSON.parse(readFileSync(new URL(`../schemas/${schemaFileName}`, import.meta.url), 'utf8'));
5
+ const settingsSchema = readSchema('settings.schema.json');
6
+ const profileSchema = readSchema('profile.schema.json');
7
+ const profileSourceSchema = readSchema('profile-source.schema.json');
8
+ const createAjv = () => {
9
+ const ajv = new Ajv2020({ allErrors: true });
10
+ ajv.addSchema(profileSourceSchema, 'profile-source.schema.json');
11
+ ajv.addSchema(profileSchema, 'profile.schema.json');
12
+ ajv.addSchema(settingsSchema, 'settings.schema.json');
13
+ return ajv;
14
+ };
15
+ const ajv = createAjv();
16
+ const validators = {
17
+ settings: ajv.compile(settingsSchema),
18
+ profile: ajv.compile(profileSchema),
19
+ 'profile-source': ajv.compile(profileSourceSchema),
20
+ };
21
+ export const createValidationResult = (issues) => ({
22
+ valid: issues.length === 0,
23
+ issues,
24
+ });
25
+ export const validateSchema = (schemaName, document) => {
26
+ const validate = validators[schemaName];
27
+ if (validate(document)) {
28
+ return createValidationResult([]);
29
+ }
30
+ return createValidationResult(validate.errors.map(formatAjvError));
31
+ };
32
+ const formatAjvError = (error) => ({
33
+ path: error.instancePath === '' ? '/' : error.instancePath,
34
+ message: String(error.message),
35
+ });
36
+ //# sourceMappingURL=SchemaValidator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaValidator.js","sourceRoot":"","sources":["../../src/validation/SchemaValidator.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAc3C,MAAM,UAAU,GAAG,CAAC,cAAsB,EAAW,EAAE,CACrD,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,cAAc,cAAc,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAE7F,MAAM,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAC1D,MAAM,aAAa,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;AACxD,MAAM,mBAAmB,GAAG,UAAU,CAAC,4BAA4B,CAAC,CAAC;AAErE,MAAM,SAAS,GAAG,GAAY,EAAE;IAC9B,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,GAAG,CAAC,SAAS,CAAC,mBAAgC,EAAE,4BAA4B,CAAC,CAAC;IAC9E,GAAG,CAAC,SAAS,CAAC,aAA0B,EAAE,qBAAqB,CAAC,CAAC;IACjE,GAAG,CAAC,SAAS,CAAC,cAA2B,EAAE,sBAAsB,CAAC,CAAC;IACnE,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;AAExB,MAAM,UAAU,GAAyC;IACvD,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,cAA2B,CAAC;IAClD,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,aAA0B,CAAC;IAChD,gBAAgB,EAAE,GAAG,CAAC,OAAO,CAAC,mBAAgC,CAAC;CAChE,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,MAAkC,EAAoB,EAAE,CAAC,CAAC;IAC/F,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;IAC1B,MAAM;CACP,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAsB,EAAE,QAAiB,EAAoB,EAAE;IAC5F,MAAM,QAAQ,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IAExC,IAAI,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvB,OAAO,sBAAsB,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,sBAAsB,CAAE,QAAQ,CAAC,MAAiC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;AACjG,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,KAAkB,EAAmB,EAAE,CAAC,CAAC;IAC/D,IAAI,EAAE,KAAK,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY;IAC1D,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;CAC/B,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ export interface ParsedYamlDocument {
2
+ readonly ok: true;
3
+ readonly document: unknown;
4
+ }
5
+ export interface YamlParseFailure {
6
+ readonly ok: false;
7
+ readonly issue: {
8
+ readonly path: string;
9
+ readonly message: string;
10
+ };
11
+ }
12
+ export type YamlParseResult = ParsedYamlDocument | YamlParseFailure;
13
+ export declare const parseYamlDocument: (content: string, issuePath: string) => YamlParseResult;
@@ -0,0 +1,11 @@
1
+ // Parses YAML text into Outfitter validation-friendly document results.
2
+ import { parse } from 'yaml';
3
+ export const parseYamlDocument = (content, issuePath) => {
4
+ try {
5
+ return { ok: true, document: parse(content) };
6
+ }
7
+ catch (error) {
8
+ return { ok: false, issue: { path: issuePath, message: String(error) } };
9
+ }
10
+ };
11
+ //# sourceMappingURL=YamlDocument.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YamlDocument.js","sourceRoot":"","sources":["../../src/validation/YamlDocument.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAiB7B,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAE,SAAiB,EAAmB,EAAE;IACvF,IAAI,CAAC;QACH,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;IAC3E,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ controllable_elements_matrix:
2
+ description: "Review controllable element mappings and support-status claims for judgment-based accuracy."
3
+ match:
4
+ include:
5
+ - "controllable-elements.md"
6
+ review:
7
+ strategy: individual
8
+ instructions: |
9
+ Review doc/controllable-elements.md for judgment-based mapping accuracy.
10
+ This rule provides judgment-based review coverage for OFTR-007.1,
11
+ OFTR-007.2, and OFTR-007.3 concerns that cannot be validated
12
+ deterministically by the controllable_elements_matrix DeepSchema.
13
+
14
+ Deterministic facts such as table shape, one row per defined term, allowed
15
+ status values, and status definition presence are handled by the
16
+ controllable_elements_matrix DeepSchema. Do not duplicate those exact
17
+ checks here.
18
+
19
+ Check the following judgment-based concerns:
20
+ 1. Pi mechanism descriptions accurately reflect pi terminology and native
21
+ behavior.
22
+ 2. Non-pi mappings are clearly framed as roadmap/experimental unless a
23
+ supported adapter exists.
24
+ 3. Support status claims do not overstate tested Outfitter behavior.
25
+ 4. Defined controllable elements are meaningful product-boundary concepts,
26
+ not implementation-only details.
27
+
28
+ Output Format:
29
+ - PASS: Mappings and support-status claims are accurate and appropriately qualified.
30
+ - FAIL: Issues found. List each inaccurate or overstated mapping/status claim with a line reference.