@fractary/faber 0.1.1
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/LICENSE +21 -0
- package/README.md +146 -0
- package/dist/api.d.ts +81 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +261 -0
- package/dist/api.js.map +1 -0
- package/dist/bindings/claude-code/transformer.d.ts +55 -0
- package/dist/bindings/claude-code/transformer.d.ts.map +1 -0
- package/dist/bindings/claude-code/transformer.js +271 -0
- package/dist/bindings/claude-code/transformer.js.map +1 -0
- package/dist/bindings/index.d.ts +21 -0
- package/dist/bindings/index.d.ts.map +1 -0
- package/dist/bindings/index.js +43 -0
- package/dist/bindings/index.js.map +1 -0
- package/dist/core/concepts/base.d.ts +89 -0
- package/dist/core/concepts/base.d.ts.map +1 -0
- package/dist/core/concepts/base.js +230 -0
- package/dist/core/concepts/base.js.map +1 -0
- package/dist/core/concepts/eval.d.ts +90 -0
- package/dist/core/concepts/eval.d.ts.map +1 -0
- package/dist/core/concepts/eval.js +118 -0
- package/dist/core/concepts/eval.js.map +1 -0
- package/dist/core/concepts/index.d.ts +9 -0
- package/dist/core/concepts/index.d.ts.map +1 -0
- package/dist/core/concepts/index.js +36 -0
- package/dist/core/concepts/index.js.map +1 -0
- package/dist/core/concepts/role.d.ts +19 -0
- package/dist/core/concepts/role.d.ts.map +1 -0
- package/dist/core/concepts/role.js +227 -0
- package/dist/core/concepts/role.js.map +1 -0
- package/dist/core/concepts/team.d.ts +57 -0
- package/dist/core/concepts/team.d.ts.map +1 -0
- package/dist/core/concepts/team.js +106 -0
- package/dist/core/concepts/team.js.map +1 -0
- package/dist/core/concepts/tool.d.ts +43 -0
- package/dist/core/concepts/tool.d.ts.map +1 -0
- package/dist/core/concepts/tool.js +104 -0
- package/dist/core/concepts/tool.js.map +1 -0
- package/dist/core/concepts/workflow.d.ts +87 -0
- package/dist/core/concepts/workflow.d.ts.map +1 -0
- package/dist/core/concepts/workflow.js +114 -0
- package/dist/core/concepts/workflow.js.map +1 -0
- package/dist/core/config/index.d.ts +34 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/index.js +80 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/config/loader.d.ts +53 -0
- package/dist/core/config/loader.d.ts.map +1 -0
- package/dist/core/config/loader.js +234 -0
- package/dist/core/config/loader.js.map +1 -0
- package/dist/core/contexts/index.d.ts +36 -0
- package/dist/core/contexts/index.d.ts.map +1 -0
- package/dist/core/contexts/index.js +75 -0
- package/dist/core/contexts/index.js.map +1 -0
- package/dist/core/contexts/loader.d.ts +66 -0
- package/dist/core/contexts/loader.d.ts.map +1 -0
- package/dist/core/contexts/loader.js +261 -0
- package/dist/core/contexts/loader.js.map +1 -0
- package/dist/core/overlays/index.d.ts +31 -0
- package/dist/core/overlays/index.d.ts.map +1 -0
- package/dist/core/overlays/index.js +82 -0
- package/dist/core/overlays/index.js.map +1 -0
- package/dist/core/overlays/resolver.d.ts +65 -0
- package/dist/core/overlays/resolver.d.ts.map +1 -0
- package/dist/core/overlays/resolver.js +249 -0
- package/dist/core/overlays/resolver.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/dist/types/bindings.d.ts +59 -0
- package/dist/types/bindings.d.ts.map +1 -0
- package/dist/types/bindings.js +6 -0
- package/dist/types/bindings.js.map +1 -0
- package/dist/types/concepts.d.ts +131 -0
- package/dist/types/concepts.d.ts.map +1 -0
- package/dist/types/concepts.js +29 -0
- package/dist/types/concepts.js.map +1 -0
- package/dist/types/config.d.ts +42 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +6 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/contexts.d.ts +59 -0
- package/dist/types/contexts.d.ts.map +1 -0
- package/dist/types/contexts.js +17 -0
- package/dist/types/contexts.js.map +1 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +30 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/overlays.d.ts +28 -0
- package/dist/types/overlays.d.ts.map +1 -0
- package/dist/types/overlays.js +15 -0
- package/dist/types/overlays.js.map +1 -0
- package/dist/utils/file-system.d.ts +40 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +105 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils/template.d.ts +28 -0
- package/dist/utils/template.d.ts.map +1 -0
- package/dist/utils/template.js +107 -0
- package/dist/utils/template.js.map +1 -0
- package/dist/utils/validation.d.ts +42 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +94 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context loader and resolver
|
|
3
|
+
*/
|
|
4
|
+
import { Context, ContextCategory, Role, Config } from '../../types';
|
|
5
|
+
export declare class ContextLoader {
|
|
6
|
+
/**
|
|
7
|
+
* Load a single context file
|
|
8
|
+
*/
|
|
9
|
+
loadContext(filePath: string, category: ContextCategory): Promise<Context>;
|
|
10
|
+
/**
|
|
11
|
+
* Load all contexts in a category
|
|
12
|
+
*/
|
|
13
|
+
loadCategoryContexts(categoryPath: string, category: ContextCategory): Promise<Context[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Load all contexts for a role
|
|
16
|
+
*/
|
|
17
|
+
loadRoleContexts(rolePath: string): Promise<Map<string, Context>>;
|
|
18
|
+
/**
|
|
19
|
+
* Load platform context for a role
|
|
20
|
+
*/
|
|
21
|
+
loadPlatformContext(role: Role, platform: string): Promise<Context | null>;
|
|
22
|
+
/**
|
|
23
|
+
* Load specialist context on demand
|
|
24
|
+
*/
|
|
25
|
+
loadSpecialistContext(role: Role, specialistName: string): Promise<Context | null>;
|
|
26
|
+
/**
|
|
27
|
+
* Parse frontmatter from markdown content
|
|
28
|
+
*/
|
|
29
|
+
private parseFrontmatter;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Context resolver for determining which contexts to load
|
|
33
|
+
*/
|
|
34
|
+
export declare class ContextResolver {
|
|
35
|
+
private loader;
|
|
36
|
+
constructor();
|
|
37
|
+
/**
|
|
38
|
+
* Resolve all contexts for a role (base + overlays)
|
|
39
|
+
*/
|
|
40
|
+
resolveContexts(role: Role, config: Config, overlayPath?: string): Promise<Context[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Detect platform from config
|
|
43
|
+
*/
|
|
44
|
+
private detectPlatform;
|
|
45
|
+
/**
|
|
46
|
+
* Load contexts from a category
|
|
47
|
+
*/
|
|
48
|
+
private loadCategoryContexts;
|
|
49
|
+
/**
|
|
50
|
+
* Load organization-level overlay contexts
|
|
51
|
+
*/
|
|
52
|
+
private loadOrganizationOverlays;
|
|
53
|
+
/**
|
|
54
|
+
* Load platform-specific overlay contexts
|
|
55
|
+
*/
|
|
56
|
+
private loadPlatformOverlays;
|
|
57
|
+
/**
|
|
58
|
+
* Load role-specific overlay contexts
|
|
59
|
+
*/
|
|
60
|
+
private loadRoleOverlays;
|
|
61
|
+
/**
|
|
62
|
+
* Analyze user request to determine specialist contexts needed
|
|
63
|
+
*/
|
|
64
|
+
analyzeRequestForSpecialists(request: string): string[];
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/core/contexts/loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EACL,OAAO,EACP,eAAe,EACf,IAAI,EACJ,MAAM,EACP,MAAM,aAAa,CAAC;AAErB,qBAAa,aAAa;IACxB;;OAEG;IACG,WAAW,CACf,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,OAAO,CAAC;IAcnB;;OAEG;IACG,oBAAoB,CACxB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,OAAO,EAAE,CAAC;IAmBrB;;OAEG;IACG,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAkBvE;;OAEG;IACG,mBAAmB,CACvB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAK1B;;OAEG;IACG,qBAAqB,CACzB,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAK1B;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAkBzB;AAED;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAgB;;IAM9B;;OAEG;IACG,eAAe,CACnB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,EAAE,CAAC;IAqCrB;;OAEG;IACH,OAAO,CAAC,cAAc;IAUtB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;OAEG;YACW,wBAAwB;IAuBtC;;OAEG;YACW,oBAAoB;IAmBlC;;OAEG;YACW,gBAAgB;IAmB9B;;OAEG;IACH,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE;CAwBxD"}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Context loader and resolver
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ContextResolver = exports.ContextLoader = void 0;
|
|
40
|
+
const fs = __importStar(require("fs/promises"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const yaml = __importStar(require("js-yaml"));
|
|
43
|
+
const types_1 = require("../../types");
|
|
44
|
+
class ContextLoader {
|
|
45
|
+
/**
|
|
46
|
+
* Load a single context file
|
|
47
|
+
*/
|
|
48
|
+
async loadContext(filePath, category) {
|
|
49
|
+
const content = await fs.readFile(filePath, 'utf-8');
|
|
50
|
+
const name = path.basename(filePath, '.md');
|
|
51
|
+
const { metadata, body } = this.parseFrontmatter(content);
|
|
52
|
+
return {
|
|
53
|
+
category,
|
|
54
|
+
name,
|
|
55
|
+
content: body,
|
|
56
|
+
metadata: metadata,
|
|
57
|
+
path: filePath
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Load all contexts in a category
|
|
62
|
+
*/
|
|
63
|
+
async loadCategoryContexts(categoryPath, category) {
|
|
64
|
+
const contexts = [];
|
|
65
|
+
try {
|
|
66
|
+
const files = await fs.readdir(categoryPath);
|
|
67
|
+
const mdFiles = files.filter(f => f.endsWith('.md'));
|
|
68
|
+
for (const file of mdFiles) {
|
|
69
|
+
const filePath = path.join(categoryPath, file);
|
|
70
|
+
const context = await this.loadContext(filePath, category);
|
|
71
|
+
contexts.push(context);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
// Category directory doesn't exist
|
|
76
|
+
}
|
|
77
|
+
return contexts;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Load all contexts for a role
|
|
81
|
+
*/
|
|
82
|
+
async loadRoleContexts(rolePath) {
|
|
83
|
+
const contexts = new Map();
|
|
84
|
+
const contextsDir = path.join(rolePath, 'contexts');
|
|
85
|
+
const categories = Object.values(types_1.ContextCategory);
|
|
86
|
+
for (const category of categories) {
|
|
87
|
+
const categoryPath = path.join(contextsDir, category);
|
|
88
|
+
const categoryContexts = await this.loadCategoryContexts(categoryPath, category);
|
|
89
|
+
for (const context of categoryContexts) {
|
|
90
|
+
const key = `${category}/${context.name}`;
|
|
91
|
+
contexts.set(key, context);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return contexts;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Load platform context for a role
|
|
98
|
+
*/
|
|
99
|
+
async loadPlatformContext(role, platform) {
|
|
100
|
+
const platformKey = `${types_1.ContextCategory.PLATFORM}/platform-${platform}`;
|
|
101
|
+
return role.contexts.get(platformKey) || null;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Load specialist context on demand
|
|
105
|
+
*/
|
|
106
|
+
async loadSpecialistContext(role, specialistName) {
|
|
107
|
+
const specialistKey = `${types_1.ContextCategory.SPECIALIST}/specialist-${specialistName}`;
|
|
108
|
+
return role.contexts.get(specialistKey) || null;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Parse frontmatter from markdown content
|
|
112
|
+
*/
|
|
113
|
+
parseFrontmatter(content) {
|
|
114
|
+
const frontmatterRegex = /^---\n([\s\S]*?)\n---\n([\s\S]*)$/;
|
|
115
|
+
const match = content.match(frontmatterRegex);
|
|
116
|
+
if (match) {
|
|
117
|
+
try {
|
|
118
|
+
const metadata = yaml.load(match[1]);
|
|
119
|
+
return { metadata, body: match[2] };
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return { body: content };
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return { body: content };
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
exports.ContextLoader = ContextLoader;
|
|
129
|
+
/**
|
|
130
|
+
* Context resolver for determining which contexts to load
|
|
131
|
+
*/
|
|
132
|
+
class ContextResolver {
|
|
133
|
+
constructor() {
|
|
134
|
+
this.loader = new ContextLoader();
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Resolve all contexts for a role (base + overlays)
|
|
138
|
+
*/
|
|
139
|
+
async resolveContexts(role, config, overlayPath) {
|
|
140
|
+
const contexts = [];
|
|
141
|
+
// 1. Load platform context based on config
|
|
142
|
+
const platform = this.detectPlatform(role, config);
|
|
143
|
+
if (platform) {
|
|
144
|
+
const platformContext = await this.loader.loadPlatformContext(role, platform);
|
|
145
|
+
if (platformContext) {
|
|
146
|
+
contexts.push(platformContext);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// 2. Load organization overlays (if overlay path provided)
|
|
150
|
+
if (overlayPath) {
|
|
151
|
+
const orgContexts = await this.loadOrganizationOverlays(overlayPath);
|
|
152
|
+
contexts.push(...orgContexts);
|
|
153
|
+
}
|
|
154
|
+
// 3. Load platform overlays
|
|
155
|
+
if (overlayPath && platform) {
|
|
156
|
+
const platformOverlays = await this.loadPlatformOverlays(overlayPath, platform);
|
|
157
|
+
contexts.push(...platformOverlays);
|
|
158
|
+
}
|
|
159
|
+
// 4. Load base standards
|
|
160
|
+
const standards = this.loadCategoryContexts(role, types_1.ContextCategory.STANDARD);
|
|
161
|
+
contexts.push(...standards);
|
|
162
|
+
// 5. Load role overlays
|
|
163
|
+
if (overlayPath) {
|
|
164
|
+
const roleOverlays = await this.loadRoleOverlays(overlayPath, role.metadata.name);
|
|
165
|
+
contexts.push(...roleOverlays);
|
|
166
|
+
}
|
|
167
|
+
return contexts;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Detect platform from config
|
|
171
|
+
*/
|
|
172
|
+
detectPlatform(role, config) {
|
|
173
|
+
// Check config for role-specific platform
|
|
174
|
+
if (config.platforms && role.metadata.platform_config_key) {
|
|
175
|
+
return config.platforms[role.metadata.platform_config_key] || null;
|
|
176
|
+
}
|
|
177
|
+
// Fall back to default platform
|
|
178
|
+
return role.metadata.default_platform || null;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Load contexts from a category
|
|
182
|
+
*/
|
|
183
|
+
loadCategoryContexts(role, category) {
|
|
184
|
+
const contexts = [];
|
|
185
|
+
const prefix = `${category}/`;
|
|
186
|
+
for (const [key, context] of role.contexts) {
|
|
187
|
+
if (key.startsWith(prefix)) {
|
|
188
|
+
contexts.push(context);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return contexts;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Load organization-level overlay contexts
|
|
195
|
+
*/
|
|
196
|
+
async loadOrganizationOverlays(overlayPath) {
|
|
197
|
+
const orgPath = path.join(overlayPath, 'organization', 'contexts');
|
|
198
|
+
const contexts = [];
|
|
199
|
+
// Load standards
|
|
200
|
+
const standardsPath = path.join(orgPath, 'standards');
|
|
201
|
+
const standards = await this.loader.loadCategoryContexts(standardsPath, types_1.ContextCategory.STANDARD);
|
|
202
|
+
contexts.push(...standards);
|
|
203
|
+
// Load references
|
|
204
|
+
const referencesPath = path.join(orgPath, 'references');
|
|
205
|
+
const references = await this.loader.loadCategoryContexts(referencesPath, types_1.ContextCategory.REFERENCE);
|
|
206
|
+
contexts.push(...references);
|
|
207
|
+
return contexts;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Load platform-specific overlay contexts
|
|
211
|
+
*/
|
|
212
|
+
async loadPlatformOverlays(overlayPath, platform) {
|
|
213
|
+
const platformPath = path.join(overlayPath, 'platforms', platform, 'contexts');
|
|
214
|
+
const contexts = [];
|
|
215
|
+
for (const category of Object.values(types_1.ContextCategory)) {
|
|
216
|
+
const categoryPath = path.join(platformPath, category);
|
|
217
|
+
const categoryContexts = await this.loader.loadCategoryContexts(categoryPath, category);
|
|
218
|
+
contexts.push(...categoryContexts);
|
|
219
|
+
}
|
|
220
|
+
return contexts;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Load role-specific overlay contexts
|
|
224
|
+
*/
|
|
225
|
+
async loadRoleOverlays(overlayPath, roleName) {
|
|
226
|
+
const rolePath = path.join(overlayPath, 'roles', roleName, 'contexts');
|
|
227
|
+
const contexts = [];
|
|
228
|
+
for (const category of Object.values(types_1.ContextCategory)) {
|
|
229
|
+
const categoryPath = path.join(rolePath, category);
|
|
230
|
+
const categoryContexts = await this.loader.loadCategoryContexts(categoryPath, category);
|
|
231
|
+
contexts.push(...categoryContexts);
|
|
232
|
+
}
|
|
233
|
+
return contexts;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Analyze user request to determine specialist contexts needed
|
|
237
|
+
*/
|
|
238
|
+
analyzeRequestForSpecialists(request) {
|
|
239
|
+
const specialists = [];
|
|
240
|
+
const keywords = request.toLowerCase();
|
|
241
|
+
// Define keyword mappings to specialists
|
|
242
|
+
const specialistMappings = [
|
|
243
|
+
{ keywords: ['sprint', 'iteration', 'planning'], specialist: 'sprint-planning' },
|
|
244
|
+
{ keywords: ['security', 'vulnerability', 'audit'], specialist: 'security' },
|
|
245
|
+
{ keywords: ['performance', 'optimization', 'latency'], specialist: 'performance' },
|
|
246
|
+
{ keywords: ['monorepo', 'multi-package'], specialist: 'monorepo' },
|
|
247
|
+
{ keywords: ['microservice', 'micro-service'], specialist: 'microservices' },
|
|
248
|
+
{ keywords: ['docker', 'container', 'kubernetes'], specialist: 'containers' },
|
|
249
|
+
{ keywords: ['ci', 'cd', 'pipeline', 'deployment'], specialist: 'cicd' },
|
|
250
|
+
{ keywords: ['test', 'testing', 'tdd', 'bdd'], specialist: 'testing' }
|
|
251
|
+
];
|
|
252
|
+
for (const mapping of specialistMappings) {
|
|
253
|
+
if (mapping.keywords.some(keyword => keywords.includes(keyword))) {
|
|
254
|
+
specialists.push(mapping.specialist);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return [...new Set(specialists)]; // Remove duplicates
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
exports.ContextResolver = ContextResolver;
|
|
261
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../src/core/contexts/loader.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAkC;AAClC,2CAA6B;AAC7B,8CAAgC;AAChC,uCAKqB;AAErB,MAAa,aAAa;IACxB;;OAEG;IACH,KAAK,CAAC,WAAW,CACf,QAAgB,EAChB,QAAyB;QAEzB,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,QA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E,YAAY,EAAE;YAC7E,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE;YACxE,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE;SACvE,CAAC;QAEF,KAAK,MAAM,OAAO,IAAI,kBAAkB,EAAE,CAAC;YACzC,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;gBACjE,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,oBAAoB;IACxD,CAAC;CACF;AAjLD,0CAiLC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overlay system exports
|
|
3
|
+
*/
|
|
4
|
+
export { OverlayResolver, Overlays, OverlayContent } from './resolver';
|
|
5
|
+
import { Context } from '../../types';
|
|
6
|
+
import { Overlays } from './resolver';
|
|
7
|
+
/**
|
|
8
|
+
* Overlay utilities
|
|
9
|
+
*/
|
|
10
|
+
export declare class OverlayUtils {
|
|
11
|
+
/**
|
|
12
|
+
* Check if overlays are enabled
|
|
13
|
+
*/
|
|
14
|
+
static hasOverlays(overlays: Overlays): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Count total overlay contexts
|
|
17
|
+
*/
|
|
18
|
+
static countContexts(overlays: Overlays): number;
|
|
19
|
+
/**
|
|
20
|
+
* Find conflicts between base and overlay contexts
|
|
21
|
+
*/
|
|
22
|
+
static findConflicts(baseContexts: Context[], overlayContexts: Context[]): Array<{
|
|
23
|
+
base: Context;
|
|
24
|
+
overlay: Context;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Apply merge strategy to conflicting contexts
|
|
28
|
+
*/
|
|
29
|
+
static mergeConflicts(base: Context, overlay: Context, strategy?: 'override' | 'merge' | 'append'): Context;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/overlays/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEvE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,qBAAa,YAAY;IACvB;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;IAU/C;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM;IAsBhD;;OAEG;IACH,MAAM,CAAC,aAAa,CAClB,YAAY,EAAE,OAAO,EAAE,EACvB,eAAe,EAAE,OAAO,EAAE,GACzB,KAAK,CAAC;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAgB7C;;OAEG;IACH,MAAM,CAAC,cAAc,CACnB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,OAAO,EAChB,QAAQ,GAAE,UAAU,GAAG,OAAO,GAAG,QAAqB,GACrD,OAAO;CAyBX"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Overlay system exports
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.OverlayUtils = exports.OverlayResolver = void 0;
|
|
7
|
+
var resolver_1 = require("./resolver");
|
|
8
|
+
Object.defineProperty(exports, "OverlayResolver", { enumerable: true, get: function () { return resolver_1.OverlayResolver; } });
|
|
9
|
+
/**
|
|
10
|
+
* Overlay utilities
|
|
11
|
+
*/
|
|
12
|
+
class OverlayUtils {
|
|
13
|
+
/**
|
|
14
|
+
* Check if overlays are enabled
|
|
15
|
+
*/
|
|
16
|
+
static hasOverlays(overlays) {
|
|
17
|
+
return (overlays.organization.contexts.length > 0 ||
|
|
18
|
+
Object.keys(overlays.platforms).length > 0 ||
|
|
19
|
+
Object.keys(overlays.roles).length > 0 ||
|
|
20
|
+
Object.keys(overlays.teams).length > 0 ||
|
|
21
|
+
Object.keys(overlays.workflows).length > 0);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Count total overlay contexts
|
|
25
|
+
*/
|
|
26
|
+
static countContexts(overlays) {
|
|
27
|
+
let count = overlays.organization.contexts.length;
|
|
28
|
+
for (const platform of Object.values(overlays.platforms)) {
|
|
29
|
+
count += platform.contexts.length;
|
|
30
|
+
}
|
|
31
|
+
for (const role of Object.values(overlays.roles)) {
|
|
32
|
+
count += role.contexts.length;
|
|
33
|
+
}
|
|
34
|
+
for (const team of Object.values(overlays.teams)) {
|
|
35
|
+
count += team.contexts.length;
|
|
36
|
+
}
|
|
37
|
+
for (const workflow of Object.values(overlays.workflows)) {
|
|
38
|
+
count += workflow.contexts.length;
|
|
39
|
+
}
|
|
40
|
+
return count;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Find conflicts between base and overlay contexts
|
|
44
|
+
*/
|
|
45
|
+
static findConflicts(baseContexts, overlayContexts) {
|
|
46
|
+
const conflicts = [];
|
|
47
|
+
for (const overlay of overlayContexts) {
|
|
48
|
+
const base = baseContexts.find(b => b.category === overlay.category && b.name === overlay.name);
|
|
49
|
+
if (base) {
|
|
50
|
+
conflicts.push({ base, overlay });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return conflicts;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Apply merge strategy to conflicting contexts
|
|
57
|
+
*/
|
|
58
|
+
static mergeConflicts(base, overlay, strategy = 'override') {
|
|
59
|
+
switch (strategy) {
|
|
60
|
+
case 'override':
|
|
61
|
+
// Overlay completely replaces base
|
|
62
|
+
return overlay;
|
|
63
|
+
case 'merge':
|
|
64
|
+
// Merge contents (overlay adds to base)
|
|
65
|
+
return {
|
|
66
|
+
...base,
|
|
67
|
+
content: `${base.content}\n\n## Overlay Additions\n\n${overlay.content}`,
|
|
68
|
+
metadata: { ...base.metadata, ...overlay.metadata }
|
|
69
|
+
};
|
|
70
|
+
case 'append':
|
|
71
|
+
// Append overlay requirements to base
|
|
72
|
+
return {
|
|
73
|
+
...base,
|
|
74
|
+
content: `${base.content}\n\n## Additional Requirements (from overlay)\n\n${overlay.content}`
|
|
75
|
+
};
|
|
76
|
+
default:
|
|
77
|
+
return overlay;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.OverlayUtils = OverlayUtils;
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/overlays/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uCAAuE;AAA9D,2GAAA,eAAe,OAAA;AAKxB;;GAEG;AACH,MAAa,YAAY;IACvB;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,QAAkB;QACnC,OAAO,CACL,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;YACzC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC;YAC1C,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CA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F,IAAI,IAAI,EAAE,CAAC;gBACT,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,cAAc,CACnB,IAAa,EACb,OAAgB,EAChB,WAA4C,UAAU;QAEtD,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,UAAU;gBACb,mCAAmC;gBACnC,OAAO,OAAO,CAAC;YAEjB,KAAK,OAAO;gBACV,wCAAwC;gBACxC,OAAO;oBACL,GAAG,IAAI;oBACP,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,+BAA+B,OAAO,CAAC,OAAO,EAAE;oBACxE,QAAQ,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE;iBACpD,CAAC;YAEJ,KAAK,QAAQ;gBACX,sCAAsC;gBACtC,OAAO;oBACL,GAAG,IAAI;oBACP,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,oDAAoD,OAAO,CAAC,OAAO,EAAE;iBAC9F,CAAC;YAEJ;gBACE,OAAO,OAAO,CAAC;QACnB,CAAC;IACH,CAAC;CACF;AA7FD,oCA6FC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overlay system for customization without forking
|
|
3
|
+
*/
|
|
4
|
+
import { Context } from '../../types';
|
|
5
|
+
export interface Overlays {
|
|
6
|
+
organization: OverlayContent;
|
|
7
|
+
platforms: Record<string, OverlayContent>;
|
|
8
|
+
roles: Record<string, OverlayContent>;
|
|
9
|
+
teams: Record<string, OverlayContent>;
|
|
10
|
+
workflows: Record<string, OverlayContent>;
|
|
11
|
+
}
|
|
12
|
+
export interface OverlayContent {
|
|
13
|
+
contexts: Context[];
|
|
14
|
+
config?: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export declare class OverlayResolver {
|
|
17
|
+
private contextLoader;
|
|
18
|
+
private overlayPath;
|
|
19
|
+
constructor(overlayPath?: string);
|
|
20
|
+
/**
|
|
21
|
+
* Resolve all overlays for a concept
|
|
22
|
+
*/
|
|
23
|
+
resolveOverlays(conceptType: string, conceptName: string, platform?: string): Promise<Overlays>;
|
|
24
|
+
/**
|
|
25
|
+
* Load organization-level overlays
|
|
26
|
+
*/
|
|
27
|
+
private loadOrganizationOverlays;
|
|
28
|
+
/**
|
|
29
|
+
* Load platform-specific overlays
|
|
30
|
+
*/
|
|
31
|
+
private loadPlatformOverlays;
|
|
32
|
+
/**
|
|
33
|
+
* Load role-specific overlays
|
|
34
|
+
*/
|
|
35
|
+
private loadRoleOverlays;
|
|
36
|
+
/**
|
|
37
|
+
* Load team-specific overlays
|
|
38
|
+
*/
|
|
39
|
+
private loadTeamOverlays;
|
|
40
|
+
/**
|
|
41
|
+
* Load workflow-specific overlays
|
|
42
|
+
*/
|
|
43
|
+
private loadWorkflowOverlays;
|
|
44
|
+
/**
|
|
45
|
+
* Load overlay content from a directory
|
|
46
|
+
*/
|
|
47
|
+
private loadOverlayContent;
|
|
48
|
+
/**
|
|
49
|
+
* Load all contexts from overlay directory
|
|
50
|
+
*/
|
|
51
|
+
private loadOverlayContexts;
|
|
52
|
+
/**
|
|
53
|
+
* Merge overlay configurations with precedence
|
|
54
|
+
*/
|
|
55
|
+
mergeConfigurations(base: Record<string, unknown>, overlays: Overlays): Record<string, unknown>;
|
|
56
|
+
/**
|
|
57
|
+
* Deep merge two objects
|
|
58
|
+
*/
|
|
59
|
+
private deepMerge;
|
|
60
|
+
/**
|
|
61
|
+
* Collect all contexts from overlays in precedence order
|
|
62
|
+
*/
|
|
63
|
+
collectContexts(overlays: Overlays): Context[];
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../src/core/overlays/resolver.ts"],"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