@hongmaple0820/scale-engine 0.15.1 → 0.16.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/dist/agents/LeadershipPresets.d.ts +16 -0
- package/dist/agents/LeadershipPresets.js +152 -0
- package/dist/agents/LeadershipPresets.js.map +1 -0
- package/dist/api/cli.js +494 -6
- package/dist/api/cli.js.map +1 -1
- package/dist/artifact/types.d.ts +4 -0
- package/dist/artifact/types.js.map +1 -1
- package/dist/cli/phaseCommands.d.ts +14 -0
- package/dist/cli/phaseCommands.js +153 -2
- package/dist/cli/phaseCommands.js.map +1 -1
- package/dist/cli/vibeCommands.d.ts +20 -0
- package/dist/cli/vibeCommands.js +150 -173
- package/dist/cli/vibeCommands.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/prompts/VibeTemplateGallery.d.ts +25 -0
- package/dist/prompts/VibeTemplateGallery.js +295 -0
- package/dist/prompts/VibeTemplateGallery.js.map +1 -0
- package/dist/skills/SkillRepository.d.ts +63 -0
- package/dist/skills/SkillRepository.js +365 -0
- package/dist/skills/SkillRepository.js.map +1 -0
- package/dist/tools/ToolCapabilityRegistry.d.ts +46 -0
- package/dist/tools/ToolCapabilityRegistry.js +223 -0
- package/dist/tools/ToolCapabilityRegistry.js.map +1 -0
- package/dist/tools/ToolEvidenceGate.d.ts +39 -0
- package/dist/tools/ToolEvidenceGate.js +117 -0
- package/dist/tools/ToolEvidenceGate.js.map +1 -0
- package/dist/tools/ToolEvidenceStore.d.ts +58 -0
- package/dist/tools/ToolEvidenceStore.js +129 -0
- package/dist/tools/ToolEvidenceStore.js.map +1 -0
- package/dist/tools/ToolOrchestrator.d.ts +67 -0
- package/dist/tools/ToolOrchestrator.js +193 -0
- package/dist/tools/ToolOrchestrator.js.map +1 -0
- package/dist/tools/ToolPolicy.d.ts +33 -0
- package/dist/tools/ToolPolicy.js +157 -0
- package/dist/tools/ToolPolicy.js.map +1 -0
- package/dist/tools/index.d.ts +5 -0
- package/dist/tools/index.js +6 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/workflow/EngineeringStandards.d.ts +69 -0
- package/dist/workflow/EngineeringStandards.js +348 -6
- package/dist/workflow/EngineeringStandards.js.map +1 -1
- package/dist/workflow/GovernanceTemplatePacks.js +11 -9
- package/dist/workflow/GovernanceTemplatePacks.js.map +1 -1
- package/dist/workflow/GovernanceTemplates.js +15 -4
- package/dist/workflow/GovernanceTemplates.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type ToolOrchestrationMode = 'off' | 'advisory' | 'evidence-required' | 'block';
|
|
2
|
+
export type ToolDestructiveActionPolicy = 'allow' | 'confirm' | 'block';
|
|
3
|
+
export interface ToolPolicyToolConfig {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
requiredFor: string[];
|
|
6
|
+
recommendedFor?: string[];
|
|
7
|
+
allowedDomains?: string[];
|
|
8
|
+
destructiveActions?: ToolDestructiveActionPolicy;
|
|
9
|
+
command?: string;
|
|
10
|
+
mcpToolName?: string;
|
|
11
|
+
evidenceRequired?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ToolPolicyFile {
|
|
14
|
+
version?: number;
|
|
15
|
+
mode?: ToolOrchestrationMode;
|
|
16
|
+
tools?: Record<string, Partial<ToolPolicyToolConfig>>;
|
|
17
|
+
}
|
|
18
|
+
export interface ResolvedToolPolicy {
|
|
19
|
+
version: number;
|
|
20
|
+
mode: ToolOrchestrationMode;
|
|
21
|
+
tools: Record<string, ToolPolicyToolConfig>;
|
|
22
|
+
warnings: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface RequiredTool {
|
|
25
|
+
id: string;
|
|
26
|
+
config: ToolPolicyToolConfig;
|
|
27
|
+
}
|
|
28
|
+
export declare const DEFAULT_TOOL_POLICY: ResolvedToolPolicy;
|
|
29
|
+
export declare function toolPolicyPath(projectDir?: string, scaleDir?: string): string;
|
|
30
|
+
export declare function loadToolPolicy(projectDir?: string, scaleDir?: string): ResolvedToolPolicy;
|
|
31
|
+
export declare function resolveToolPolicy(input: ToolPolicyFile | null | undefined): ResolvedToolPolicy;
|
|
32
|
+
export declare function requiredToolsForDomains(policy: ResolvedToolPolicy, domains: string[]): RequiredTool[];
|
|
33
|
+
export declare function toolPolicyTemplate(mode?: ToolOrchestrationMode): string;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { isAbsolute, join, resolve } from 'node:path';
|
|
3
|
+
export const DEFAULT_TOOL_POLICY = {
|
|
4
|
+
version: 1,
|
|
5
|
+
mode: 'evidence-required',
|
|
6
|
+
warnings: [],
|
|
7
|
+
tools: {
|
|
8
|
+
'web-access': {
|
|
9
|
+
enabled: true,
|
|
10
|
+
requiredFor: ['webResearch'],
|
|
11
|
+
recommendedFor: ['browserAutomation'],
|
|
12
|
+
destructiveActions: 'block',
|
|
13
|
+
evidenceRequired: true,
|
|
14
|
+
},
|
|
15
|
+
'frontend-design': {
|
|
16
|
+
enabled: true,
|
|
17
|
+
requiredFor: ['ui'],
|
|
18
|
+
destructiveActions: 'block',
|
|
19
|
+
evidenceRequired: true,
|
|
20
|
+
},
|
|
21
|
+
'ui-ux-pro-max': {
|
|
22
|
+
enabled: true,
|
|
23
|
+
requiredFor: ['ui'],
|
|
24
|
+
destructiveActions: 'block',
|
|
25
|
+
evidenceRequired: true,
|
|
26
|
+
},
|
|
27
|
+
'agent-browser': {
|
|
28
|
+
enabled: true,
|
|
29
|
+
requiredFor: ['browserAutomation'],
|
|
30
|
+
recommendedFor: ['ui', 'e2e'],
|
|
31
|
+
allowedDomains: ['localhost', '127.0.0.1'],
|
|
32
|
+
destructiveActions: 'confirm',
|
|
33
|
+
command: 'agent-browser',
|
|
34
|
+
evidenceRequired: true,
|
|
35
|
+
},
|
|
36
|
+
playwright: {
|
|
37
|
+
enabled: true,
|
|
38
|
+
requiredFor: ['e2e'],
|
|
39
|
+
recommendedFor: ['browserAutomation', 'ui'],
|
|
40
|
+
destructiveActions: 'confirm',
|
|
41
|
+
command: 'npx playwright',
|
|
42
|
+
evidenceRequired: true,
|
|
43
|
+
},
|
|
44
|
+
'mcp-chrome-devtools': {
|
|
45
|
+
enabled: true,
|
|
46
|
+
requiredFor: ['browserAutomation'],
|
|
47
|
+
recommendedFor: ['ui', 'e2e'],
|
|
48
|
+
destructiveActions: 'confirm',
|
|
49
|
+
mcpToolName: 'chrome-devtools',
|
|
50
|
+
evidenceRequired: true,
|
|
51
|
+
},
|
|
52
|
+
'desktop-cua': {
|
|
53
|
+
enabled: false,
|
|
54
|
+
requiredFor: ['desktopAutomation'],
|
|
55
|
+
destructiveActions: 'block',
|
|
56
|
+
command: 'cua',
|
|
57
|
+
evidenceRequired: true,
|
|
58
|
+
},
|
|
59
|
+
'codex-cli': {
|
|
60
|
+
enabled: false,
|
|
61
|
+
requiredFor: [],
|
|
62
|
+
recommendedFor: ['externalCli', 'review'],
|
|
63
|
+
destructiveActions: 'block',
|
|
64
|
+
command: 'codex',
|
|
65
|
+
evidenceRequired: true,
|
|
66
|
+
},
|
|
67
|
+
'gemini-cli': {
|
|
68
|
+
enabled: false,
|
|
69
|
+
requiredFor: [],
|
|
70
|
+
recommendedFor: ['externalCli', 'review'],
|
|
71
|
+
destructiveActions: 'block',
|
|
72
|
+
command: 'gemini',
|
|
73
|
+
evidenceRequired: true,
|
|
74
|
+
},
|
|
75
|
+
'opencode-cli': {
|
|
76
|
+
enabled: false,
|
|
77
|
+
requiredFor: [],
|
|
78
|
+
recommendedFor: ['externalCli', 'review'],
|
|
79
|
+
destructiveActions: 'block',
|
|
80
|
+
command: 'opencode',
|
|
81
|
+
evidenceRequired: true,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
export function toolPolicyPath(projectDir = process.cwd(), scaleDir = '.scale') {
|
|
86
|
+
const root = isAbsolute(scaleDir) ? scaleDir : join(resolve(projectDir), scaleDir);
|
|
87
|
+
return join(root, 'tools.json');
|
|
88
|
+
}
|
|
89
|
+
export function loadToolPolicy(projectDir = process.cwd(), scaleDir = '.scale') {
|
|
90
|
+
const path = toolPolicyPath(projectDir, scaleDir);
|
|
91
|
+
if (!existsSync(path)) {
|
|
92
|
+
return {
|
|
93
|
+
...DEFAULT_TOOL_POLICY,
|
|
94
|
+
warnings: [`No tool policy found at ${path}; using built-in defaults.`],
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
const parsed = JSON.parse(readFileSync(path, 'utf-8'));
|
|
99
|
+
return resolveToolPolicy(parsed);
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
return {
|
|
103
|
+
...DEFAULT_TOOL_POLICY,
|
|
104
|
+
warnings: [`Failed to read ${path}: ${error.message}; using built-in defaults.`],
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
export function resolveToolPolicy(input) {
|
|
109
|
+
const warnings = [];
|
|
110
|
+
const mode = normalizeMode(input?.mode);
|
|
111
|
+
if (input?.mode && !mode) {
|
|
112
|
+
warnings.push(`Invalid tool policy mode "${String(input.mode)}"; using ${DEFAULT_TOOL_POLICY.mode}.`);
|
|
113
|
+
}
|
|
114
|
+
const tools = {};
|
|
115
|
+
const ids = new Set([...Object.keys(DEFAULT_TOOL_POLICY.tools), ...Object.keys(input?.tools ?? {})]);
|
|
116
|
+
for (const id of ids) {
|
|
117
|
+
const base = DEFAULT_TOOL_POLICY.tools[id] ?? {
|
|
118
|
+
enabled: true,
|
|
119
|
+
requiredFor: [],
|
|
120
|
+
destructiveActions: 'confirm',
|
|
121
|
+
evidenceRequired: true,
|
|
122
|
+
};
|
|
123
|
+
const override = input?.tools?.[id] ?? {};
|
|
124
|
+
tools[id] = {
|
|
125
|
+
...base,
|
|
126
|
+
...override,
|
|
127
|
+
requiredFor: override.requiredFor ?? base.requiredFor ?? [],
|
|
128
|
+
recommendedFor: override.recommendedFor ?? base.recommendedFor,
|
|
129
|
+
allowedDomains: override.allowedDomains ?? base.allowedDomains,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
version: typeof input?.version === 'number' ? input.version : DEFAULT_TOOL_POLICY.version,
|
|
134
|
+
mode: mode ?? DEFAULT_TOOL_POLICY.mode,
|
|
135
|
+
tools,
|
|
136
|
+
warnings,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
export function requiredToolsForDomains(policy, domains) {
|
|
140
|
+
const domainSet = new Set(domains);
|
|
141
|
+
return Object.entries(policy.tools)
|
|
142
|
+
.filter(([, config]) => config.enabled && config.requiredFor.some(domain => domainSet.has(domain)))
|
|
143
|
+
.map(([id, config]) => ({ id, config }));
|
|
144
|
+
}
|
|
145
|
+
export function toolPolicyTemplate(mode = 'evidence-required') {
|
|
146
|
+
return JSON.stringify({
|
|
147
|
+
version: 1,
|
|
148
|
+
mode,
|
|
149
|
+
tools: DEFAULT_TOOL_POLICY.tools,
|
|
150
|
+
}, null, 2) + '\n';
|
|
151
|
+
}
|
|
152
|
+
function normalizeMode(value) {
|
|
153
|
+
if (value === 'off' || value === 'advisory' || value === 'evidence-required' || value === 'block')
|
|
154
|
+
return value;
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=ToolPolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolPolicy.js","sourceRoot":"","sources":["../../src/tools/ToolPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAkCrD,MAAM,CAAC,MAAM,mBAAmB,GAAuB;IACrD,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,mBAAmB;IACzB,QAAQ,EAAE,EAAE;I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,IAAI;QACJ,KAAK,EAAE,mBAAmB,CAAC,KAAK;KACjC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAA;AACpB,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,UAAU,IAAI,KAAK,KAAK,mBAAmB,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,KAAK,CAAA;IAC/G,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type EngineeringStandardCategory = 'logging' | 'security' | 'database' | 'architecture' | 'code-quality' | 'framework' | 'testing' | 'uiux';
|
|
2
2
|
export type EngineeringStandardSeverity = 'info' | 'warn' | 'fail';
|
|
3
|
+
export type EngineeringStandardsDebtScope = 'production' | 'test' | 'generated';
|
|
3
4
|
export interface EngineeringStandardFinding {
|
|
4
5
|
severity: EngineeringStandardSeverity;
|
|
5
6
|
category: EngineeringStandardCategory;
|
|
@@ -40,6 +41,15 @@ export interface EngineeringStandardsPolicyFile {
|
|
|
40
41
|
reason?: string;
|
|
41
42
|
}>;
|
|
42
43
|
}
|
|
44
|
+
export interface EngineeringStandardsBaselineFile {
|
|
45
|
+
version?: number;
|
|
46
|
+
findings?: Array<{
|
|
47
|
+
ruleId: string;
|
|
48
|
+
path: string;
|
|
49
|
+
line?: number;
|
|
50
|
+
reason?: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
43
53
|
export interface ResolvedEngineeringStandardsPolicy {
|
|
44
54
|
version: number;
|
|
45
55
|
mode: 'warn' | 'block';
|
|
@@ -98,6 +108,8 @@ export interface EngineeringStandardsScanOptions {
|
|
|
98
108
|
projectDir?: string;
|
|
99
109
|
scaleDir?: string;
|
|
100
110
|
now?: Date;
|
|
111
|
+
changedFiles?: string[];
|
|
112
|
+
includeBaselineFindings?: boolean;
|
|
101
113
|
}
|
|
102
114
|
export interface EngineeringStandardsSummary {
|
|
103
115
|
filesScanned: number;
|
|
@@ -109,6 +121,7 @@ export interface EngineeringStandardsSummary {
|
|
|
109
121
|
export interface EngineeringStandardsScanReport {
|
|
110
122
|
projectDir: string;
|
|
111
123
|
policyPath: string;
|
|
124
|
+
baselinePath: string;
|
|
112
125
|
frameworksPath: string;
|
|
113
126
|
policy: ResolvedEngineeringStandardsPolicy;
|
|
114
127
|
frameworks: ResolvedFrameworksCatalog;
|
|
@@ -126,18 +139,74 @@ export interface EngineeringStandardsSettleOptions extends EngineeringStandardsS
|
|
|
126
139
|
taskId?: string;
|
|
127
140
|
artifactsDir?: string;
|
|
128
141
|
}
|
|
142
|
+
export interface EngineeringStandardsBaselineOptions extends EngineeringStandardsScanOptions {
|
|
143
|
+
taskId?: string;
|
|
144
|
+
artifactsDir?: string;
|
|
145
|
+
writeBaseline?: boolean;
|
|
146
|
+
reason?: string;
|
|
147
|
+
maxFindingsInReport?: number;
|
|
148
|
+
}
|
|
129
149
|
export interface EngineeringStandardsSettleReport {
|
|
130
150
|
ok: boolean;
|
|
131
151
|
taskId?: string;
|
|
132
152
|
standardsImpactPath?: string;
|
|
133
153
|
doctor: EngineeringStandardsDoctorReport;
|
|
134
154
|
}
|
|
155
|
+
export interface EngineeringStandardsBaselineEntry {
|
|
156
|
+
ruleId: string;
|
|
157
|
+
path: string;
|
|
158
|
+
line?: number;
|
|
159
|
+
reason: string;
|
|
160
|
+
severity: EngineeringStandardSeverity;
|
|
161
|
+
category: EngineeringStandardCategory;
|
|
162
|
+
message: string;
|
|
163
|
+
}
|
|
164
|
+
export interface EngineeringStandardsDebtGroup {
|
|
165
|
+
total: number;
|
|
166
|
+
blocking: number;
|
|
167
|
+
warn: number;
|
|
168
|
+
info: number;
|
|
169
|
+
}
|
|
170
|
+
export interface EngineeringStandardsDebtRuleGroup extends EngineeringStandardsDebtGroup {
|
|
171
|
+
category: EngineeringStandardCategory;
|
|
172
|
+
}
|
|
173
|
+
export interface EngineeringStandardsDebtFileGroup extends EngineeringStandardsDebtGroup {
|
|
174
|
+
path: string;
|
|
175
|
+
}
|
|
176
|
+
export interface EngineeringStandardsDebtSummary {
|
|
177
|
+
filesScanned: number;
|
|
178
|
+
totalFindings: number;
|
|
179
|
+
blockingFindings: number;
|
|
180
|
+
bySeverity: Record<EngineeringStandardSeverity, number>;
|
|
181
|
+
byScope: Record<EngineeringStandardsDebtScope, EngineeringStandardsDebtGroup>;
|
|
182
|
+
byCategory: Record<EngineeringStandardCategory, EngineeringStandardsDebtGroup>;
|
|
183
|
+
byRule: Record<string, EngineeringStandardsDebtRuleGroup>;
|
|
184
|
+
topFiles: EngineeringStandardsDebtFileGroup[];
|
|
185
|
+
}
|
|
186
|
+
export interface EngineeringStandardsBaselineReport {
|
|
187
|
+
ok: boolean;
|
|
188
|
+
projectDir: string;
|
|
189
|
+
baselinePath: string;
|
|
190
|
+
legacyDebtPath?: string;
|
|
191
|
+
wroteBaseline: boolean;
|
|
192
|
+
baselineEntries: EngineeringStandardsBaselineEntry[];
|
|
193
|
+
debt: EngineeringStandardsDebtSummary;
|
|
194
|
+
scan: EngineeringStandardsScanReport;
|
|
195
|
+
warnings: string[];
|
|
196
|
+
}
|
|
135
197
|
export declare function engineeringStandardsPolicyPath(projectDir?: string, scaleDir?: string): string;
|
|
136
198
|
export declare function frameworksCatalogPath(projectDir?: string, scaleDir?: string): string;
|
|
199
|
+
export declare function engineeringStandardsBaselinePath(projectDir?: string, scaleDir?: string): string;
|
|
137
200
|
export declare function engineeringStandardsPolicyTemplate(): string;
|
|
201
|
+
export declare function engineeringStandardsBaselineTemplate(): string;
|
|
138
202
|
export declare function frameworksCatalogTemplate(): string;
|
|
139
203
|
export declare function loadEngineeringStandardsPolicy(projectDir?: string, scaleDir?: string): ResolvedEngineeringStandardsPolicy;
|
|
204
|
+
export declare function loadEngineeringStandardsBaseline(projectDir?: string, scaleDir?: string): {
|
|
205
|
+
findings: ResolvedEngineeringStandardsPolicy['baselineFindings'];
|
|
206
|
+
warnings: string[];
|
|
207
|
+
};
|
|
140
208
|
export declare function loadFrameworksCatalog(projectDir?: string, scaleDir?: string, now?: Date): ResolvedFrameworksCatalog;
|
|
141
209
|
export declare function scanEngineeringStandards(options?: EngineeringStandardsScanOptions): EngineeringStandardsScanReport;
|
|
142
210
|
export declare function doctorEngineeringStandards(options?: EngineeringStandardsScanOptions): EngineeringStandardsDoctorReport;
|
|
143
211
|
export declare function settleEngineeringStandards(options?: EngineeringStandardsSettleOptions): EngineeringStandardsSettleReport;
|
|
212
|
+
export declare function baselineEngineeringStandards(options?: EngineeringStandardsBaselineOptions): EngineeringStandardsBaselineReport;
|