@brad-frost-web/eddie-brain 0.32.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 +109 -0
- package/dist/analyze/drift-detector.d.ts +30 -0
- package/dist/analyze/drift-detector.d.ts.map +1 -0
- package/dist/analyze/drift-detector.js +310 -0
- package/dist/analyze/drift-detector.js.map +1 -0
- package/dist/analyze/health-scorer.d.ts +71 -0
- package/dist/analyze/health-scorer.d.ts.map +1 -0
- package/dist/analyze/health-scorer.js +420 -0
- package/dist/analyze/health-scorer.js.map +1 -0
- package/dist/analyze/index.d.ts +11 -0
- package/dist/analyze/index.d.ts.map +1 -0
- package/dist/analyze/index.js +11 -0
- package/dist/analyze/index.js.map +1 -0
- package/dist/analyze/naming-validator.d.ts +99 -0
- package/dist/analyze/naming-validator.d.ts.map +1 -0
- package/dist/analyze/naming-validator.js +430 -0
- package/dist/analyze/naming-validator.js.map +1 -0
- package/dist/analyze/slot-contract-validator.d.ts +68 -0
- package/dist/analyze/slot-contract-validator.d.ts.map +1 -0
- package/dist/analyze/slot-contract-validator.js +232 -0
- package/dist/analyze/slot-contract-validator.js.map +1 -0
- package/dist/analyze/token-validator.d.ts +62 -0
- package/dist/analyze/token-validator.d.ts.map +1 -0
- package/dist/analyze/token-validator.js +348 -0
- package/dist/analyze/token-validator.js.map +1 -0
- package/dist/cli/brain.d.ts +12 -0
- package/dist/cli/brain.d.ts.map +1 -0
- package/dist/cli/brain.js +641 -0
- package/dist/cli/brain.js.map +1 -0
- package/dist/cli/formatters/json.d.ts +15 -0
- package/dist/cli/formatters/json.d.ts.map +1 -0
- package/dist/cli/formatters/json.js +18 -0
- package/dist/cli/formatters/json.js.map +1 -0
- package/dist/cli/formatters/terminal.d.ts +19 -0
- package/dist/cli/formatters/terminal.d.ts.map +1 -0
- package/dist/cli/formatters/terminal.js +125 -0
- package/dist/cli/formatters/terminal.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +7 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/data/governance-rules.json +94 -0
- package/dist/governance/audit-log.d.ts +17 -0
- package/dist/governance/audit-log.d.ts.map +1 -0
- package/dist/governance/audit-log.js +44 -0
- package/dist/governance/audit-log.js.map +1 -0
- package/dist/governance/index.d.ts +8 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +8 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/governance/permissions.d.ts +26 -0
- package/dist/governance/permissions.d.ts.map +1 -0
- package/dist/governance/permissions.js +75 -0
- package/dist/governance/permissions.js.map +1 -0
- package/dist/governance/rules-engine.d.ts +24 -0
- package/dist/governance/rules-engine.d.ts.map +1 -0
- package/dist/governance/rules-engine.js +111 -0
- package/dist/governance/rules-engine.js.map +1 -0
- package/dist/governance/trust-manager.d.ts +34 -0
- package/dist/governance/trust-manager.d.ts.map +1 -0
- package/dist/governance/trust-manager.js +148 -0
- package/dist/governance/trust-manager.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/knowledge-graph/component-index.d.ts +320 -0
- package/dist/knowledge-graph/component-index.d.ts.map +1 -0
- package/dist/knowledge-graph/component-index.js +1033 -0
- package/dist/knowledge-graph/component-index.js.map +1 -0
- package/dist/knowledge-graph/index.d.ts +134 -0
- package/dist/knowledge-graph/index.d.ts.map +1 -0
- package/dist/knowledge-graph/index.js +249 -0
- package/dist/knowledge-graph/index.js.map +1 -0
- package/dist/knowledge-graph/learning-history.d.ts +77 -0
- package/dist/knowledge-graph/learning-history.d.ts.map +1 -0
- package/dist/knowledge-graph/learning-history.js +187 -0
- package/dist/knowledge-graph/learning-history.js.map +1 -0
- package/dist/knowledge-graph/relationship-map.d.ts +55 -0
- package/dist/knowledge-graph/relationship-map.d.ts.map +1 -0
- package/dist/knowledge-graph/relationship-map.js +238 -0
- package/dist/knowledge-graph/relationship-map.js.map +1 -0
- package/dist/knowledge-graph/token-taxonomy.d.ts +127 -0
- package/dist/knowledge-graph/token-taxonomy.d.ts.map +1 -0
- package/dist/knowledge-graph/token-taxonomy.js +357 -0
- package/dist/knowledge-graph/token-taxonomy.js.map +1 -0
- package/dist/loop/fix-agent.d.ts +55 -0
- package/dist/loop/fix-agent.d.ts.map +1 -0
- package/dist/loop/fix-agent.js +344 -0
- package/dist/loop/fix-agent.js.map +1 -0
- package/dist/loop/index.d.ts +8 -0
- package/dist/loop/index.d.ts.map +1 -0
- package/dist/loop/index.js +8 -0
- package/dist/loop/index.js.map +1 -0
- package/dist/loop/issue-fetcher.d.ts +51 -0
- package/dist/loop/issue-fetcher.d.ts.map +1 -0
- package/dist/loop/issue-fetcher.js +188 -0
- package/dist/loop/issue-fetcher.js.map +1 -0
- package/dist/loop/observer.d.ts +42 -0
- package/dist/loop/observer.d.ts.map +1 -0
- package/dist/loop/observer.js +220 -0
- package/dist/loop/observer.js.map +1 -0
- package/dist/loop/pacer.d.ts +44 -0
- package/dist/loop/pacer.d.ts.map +1 -0
- package/dist/loop/pacer.js +90 -0
- package/dist/loop/pacer.js.map +1 -0
- package/dist/loop/reporter.d.ts +9 -0
- package/dist/loop/reporter.d.ts.map +1 -0
- package/dist/loop/reporter.js +119 -0
- package/dist/loop/reporter.js.map +1 -0
- package/dist/loop/runner.d.ts +57 -0
- package/dist/loop/runner.d.ts.map +1 -0
- package/dist/loop/runner.js +390 -0
- package/dist/loop/runner.js.map +1 -0
- package/dist/loop/types.d.ts +151 -0
- package/dist/loop/types.d.ts.map +1 -0
- package/dist/loop/types.js +22 -0
- package/dist/loop/types.js.map +1 -0
- package/dist/mcp/index.d.ts +7 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +7 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +12 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +618 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/pipeline/agent-runner.d.ts +34 -0
- package/dist/pipeline/agent-runner.d.ts.map +1 -0
- package/dist/pipeline/agent-runner.js +323 -0
- package/dist/pipeline/agent-runner.js.map +1 -0
- package/dist/pipeline/agents/accessibility-auditor.d.ts +10 -0
- package/dist/pipeline/agents/accessibility-auditor.d.ts.map +1 -0
- package/dist/pipeline/agents/accessibility-auditor.js +69 -0
- package/dist/pipeline/agents/accessibility-auditor.js.map +1 -0
- package/dist/pipeline/agents/code-reviewer.d.ts +10 -0
- package/dist/pipeline/agents/code-reviewer.d.ts.map +1 -0
- package/dist/pipeline/agents/code-reviewer.js +75 -0
- package/dist/pipeline/agents/code-reviewer.js.map +1 -0
- package/dist/pipeline/agents/code-writer.d.ts +10 -0
- package/dist/pipeline/agents/code-writer.d.ts.map +1 -0
- package/dist/pipeline/agents/code-writer.js +103 -0
- package/dist/pipeline/agents/code-writer.js.map +1 -0
- package/dist/pipeline/agents/component-architect.d.ts +13 -0
- package/dist/pipeline/agents/component-architect.d.ts.map +1 -0
- package/dist/pipeline/agents/component-architect.js +81 -0
- package/dist/pipeline/agents/component-architect.js.map +1 -0
- package/dist/pipeline/agents/index.d.ts +16 -0
- package/dist/pipeline/agents/index.d.ts.map +1 -0
- package/dist/pipeline/agents/index.js +24 -0
- package/dist/pipeline/agents/index.js.map +1 -0
- package/dist/pipeline/agents/library-researcher.d.ts +12 -0
- package/dist/pipeline/agents/library-researcher.d.ts.map +1 -0
- package/dist/pipeline/agents/library-researcher.js +85 -0
- package/dist/pipeline/agents/library-researcher.js.map +1 -0
- package/dist/pipeline/agents/quality-gate.d.ts +9 -0
- package/dist/pipeline/agents/quality-gate.d.ts.map +1 -0
- package/dist/pipeline/agents/quality-gate.js +71 -0
- package/dist/pipeline/agents/quality-gate.js.map +1 -0
- package/dist/pipeline/agents/spec-analyst.d.ts +10 -0
- package/dist/pipeline/agents/spec-analyst.d.ts.map +1 -0
- package/dist/pipeline/agents/spec-analyst.js +72 -0
- package/dist/pipeline/agents/spec-analyst.js.map +1 -0
- package/dist/pipeline/agents/story-author.d.ts +9 -0
- package/dist/pipeline/agents/story-author.d.ts.map +1 -0
- package/dist/pipeline/agents/story-author.js +65 -0
- package/dist/pipeline/agents/story-author.js.map +1 -0
- package/dist/pipeline/artifact-store.d.ts +27 -0
- package/dist/pipeline/artifact-store.d.ts.map +1 -0
- package/dist/pipeline/artifact-store.js +77 -0
- package/dist/pipeline/artifact-store.js.map +1 -0
- package/dist/pipeline/conversational-gate.d.ts +26 -0
- package/dist/pipeline/conversational-gate.d.ts.map +1 -0
- package/dist/pipeline/conversational-gate.js +122 -0
- package/dist/pipeline/conversational-gate.js.map +1 -0
- package/dist/pipeline/index.d.ts +14 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +17 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/iteration-tracker.d.ts +29 -0
- package/dist/pipeline/iteration-tracker.d.ts.map +1 -0
- package/dist/pipeline/iteration-tracker.js +102 -0
- package/dist/pipeline/iteration-tracker.js.map +1 -0
- package/dist/pipeline/learning-bridge.d.ts +37 -0
- package/dist/pipeline/learning-bridge.d.ts.map +1 -0
- package/dist/pipeline/learning-bridge.js +118 -0
- package/dist/pipeline/learning-bridge.js.map +1 -0
- package/dist/pipeline/orchestrator.d.ts +45 -0
- package/dist/pipeline/orchestrator.d.ts.map +1 -0
- package/dist/pipeline/orchestrator.js +473 -0
- package/dist/pipeline/orchestrator.js.map +1 -0
- package/dist/pipeline/templates/architecture.d.ts +27 -0
- package/dist/pipeline/templates/architecture.d.ts.map +1 -0
- package/dist/pipeline/templates/architecture.js +111 -0
- package/dist/pipeline/templates/architecture.js.map +1 -0
- package/dist/pipeline/templates/brief.d.ts +22 -0
- package/dist/pipeline/templates/brief.d.ts.map +1 -0
- package/dist/pipeline/templates/brief.js +121 -0
- package/dist/pipeline/templates/brief.js.map +1 -0
- package/dist/pipeline/templates/component-rules.d.ts +25 -0
- package/dist/pipeline/templates/component-rules.d.ts.map +1 -0
- package/dist/pipeline/templates/component-rules.js +93 -0
- package/dist/pipeline/templates/component-rules.js.map +1 -0
- package/dist/pipeline/templates/index.d.ts +9 -0
- package/dist/pipeline/templates/index.d.ts.map +1 -0
- package/dist/pipeline/templates/index.js +7 -0
- package/dist/pipeline/templates/index.js.map +1 -0
- package/dist/pipeline/tool-handler.d.ts +25 -0
- package/dist/pipeline/tool-handler.d.ts.map +1 -0
- package/dist/pipeline/tool-handler.js +392 -0
- package/dist/pipeline/tool-handler.js.map +1 -0
- package/dist/pipeline/types.d.ts +146 -0
- package/dist/pipeline/types.d.ts.map +1 -0
- package/dist/pipeline/types.js +27 -0
- package/dist/pipeline/types.js.map +1 -0
- package/dist/plan/action-types.d.ts +31 -0
- package/dist/plan/action-types.d.ts.map +1 -0
- package/dist/plan/action-types.js +83 -0
- package/dist/plan/action-types.js.map +1 -0
- package/dist/plan/decision-engine.d.ts +57 -0
- package/dist/plan/decision-engine.d.ts.map +1 -0
- package/dist/plan/decision-engine.js +162 -0
- package/dist/plan/decision-engine.js.map +1 -0
- package/dist/plan/index.d.ts +6 -0
- package/dist/plan/index.d.ts.map +1 -0
- package/dist/plan/index.js +6 -0
- package/dist/plan/index.js.map +1 -0
- package/dist/types.d.ts +351 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +26 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/anthropic.d.ts +15 -0
- package/dist/utils/anthropic.d.ts.map +1 -0
- package/dist/utils/anthropic.js +40 -0
- package/dist/utils/anthropic.js.map +1 -0
- package/dist/utils/id.d.ts +8 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/id.js +14 -0
- package/dist/utils/id.js.map +1 -0
- package/package.json +80 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Eddie's Brain — Core Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* The type system for the agentic intelligence layer of the Eddie Design System.
|
|
5
|
+
*/
|
|
6
|
+
/** Atomic design classification */
|
|
7
|
+
export type AtomicLevel = 'atom' | 'molecule' | 'organism' | 'recipe' | 'page';
|
|
8
|
+
/** Which Eddie package a component belongs to */
|
|
9
|
+
export type EddiePackage = 'eddie-web-components' | 'eddie-recipes' | 'eddie-icons' | 'eddie-pages' | 'eddie-charts';
|
|
10
|
+
/** A component property definition */
|
|
11
|
+
export interface PropertyEntry {
|
|
12
|
+
name: string;
|
|
13
|
+
type: string;
|
|
14
|
+
default?: string;
|
|
15
|
+
description: string;
|
|
16
|
+
/** Allowed values for enum-like props */
|
|
17
|
+
options?: string[];
|
|
18
|
+
required: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** A component slot definition */
|
|
21
|
+
export interface SlotEntry {
|
|
22
|
+
name: string;
|
|
23
|
+
description: string;
|
|
24
|
+
}
|
|
25
|
+
/** A component event definition */
|
|
26
|
+
export interface EventEntry {
|
|
27
|
+
name: string;
|
|
28
|
+
detail?: string;
|
|
29
|
+
description: string;
|
|
30
|
+
}
|
|
31
|
+
/** Full component registry entry */
|
|
32
|
+
export interface ComponentEntry {
|
|
33
|
+
/** Tag name, e.g. "ed-button" */
|
|
34
|
+
tagName: string;
|
|
35
|
+
/** Human-readable name, e.g. "Button" */
|
|
36
|
+
displayName: string;
|
|
37
|
+
/** CSS class name, e.g. "ed-c-button" */
|
|
38
|
+
cssClassName: string;
|
|
39
|
+
/** Atomic design level */
|
|
40
|
+
atomicLevel: AtomicLevel;
|
|
41
|
+
/** Package it belongs to */
|
|
42
|
+
package: EddiePackage;
|
|
43
|
+
/** What this component is FOR (intent, not just what it looks like) */
|
|
44
|
+
intent: string;
|
|
45
|
+
/** Base class: EdElement or EdFormElement */
|
|
46
|
+
baseClass: 'EdElement' | 'EdFormElement';
|
|
47
|
+
/** All public properties */
|
|
48
|
+
properties: PropertyEntry[];
|
|
49
|
+
/** Named slots */
|
|
50
|
+
slots: SlotEntry[];
|
|
51
|
+
/** CSS custom properties it exposes */
|
|
52
|
+
cssCustomProperties: string[];
|
|
53
|
+
/** Events it dispatches */
|
|
54
|
+
events: EventEntry[];
|
|
55
|
+
/** Components it commonly composes with */
|
|
56
|
+
composesWith: string[];
|
|
57
|
+
/** Parent compound component (if child) */
|
|
58
|
+
parentComponent?: string;
|
|
59
|
+
/** Child compound components */
|
|
60
|
+
childComponents?: string[];
|
|
61
|
+
/** Usage guidelines */
|
|
62
|
+
guidelines: {
|
|
63
|
+
use: string[];
|
|
64
|
+
dontUse: string[];
|
|
65
|
+
accessibility: string[];
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Override points intended for consumer customization.
|
|
69
|
+
*
|
|
70
|
+
* Distinct from `properties` (which lists everything the class declares)
|
|
71
|
+
* and `slots` (which lists every slot that exists). This field is the
|
|
72
|
+
* structured answer to "how do I customize this component?" — populated
|
|
73
|
+
* from `@overridableSlot` and `@overridableProp` JSDoc tags on the
|
|
74
|
+
* component's class-level comment.
|
|
75
|
+
*/
|
|
76
|
+
overridableSurface?: {
|
|
77
|
+
slots: Array<{
|
|
78
|
+
name: string;
|
|
79
|
+
purpose: string;
|
|
80
|
+
exampleMarkup?: string;
|
|
81
|
+
}>;
|
|
82
|
+
props: Array<{
|
|
83
|
+
name: string;
|
|
84
|
+
purpose: string;
|
|
85
|
+
values?: string[];
|
|
86
|
+
}>;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Canonical invocation shape. `default` is the minimal markup a consumer
|
|
90
|
+
* should paste to "get the default" — extracted from the component's
|
|
91
|
+
* `Default` Storybook story template. `note` is optional prose from a
|
|
92
|
+
* `@canonicalUsage` JSDoc tag on the class.
|
|
93
|
+
*/
|
|
94
|
+
canonicalUsage?: {
|
|
95
|
+
default?: string;
|
|
96
|
+
note?: string;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Structural answer to "where does this component's content come from?".
|
|
100
|
+
* Surfaces the prop-vs-slot path so consumers (human or AI) don't reach for
|
|
101
|
+
* HTML muscle memory and silently drop content. Populated from a
|
|
102
|
+
* `@contentApi { ... }` JSDoc tag on the class. See #627.
|
|
103
|
+
*
|
|
104
|
+
* contentVia — how the user supplies the component's primary content
|
|
105
|
+
* labelVia — how the user supplies the field label (form components)
|
|
106
|
+
* labelVisibility — whether that label renders visibly or is a11y-only
|
|
107
|
+
*/
|
|
108
|
+
contentApi?: {
|
|
109
|
+
contentVia?: string;
|
|
110
|
+
labelVia?: 'prop' | 'slot' | 'none';
|
|
111
|
+
labelVisibility?: 'visible' | 'hidden' | 'accessible-only';
|
|
112
|
+
};
|
|
113
|
+
/** File paths relative to package root */
|
|
114
|
+
paths: {
|
|
115
|
+
component: string;
|
|
116
|
+
styles?: string;
|
|
117
|
+
stories?: string;
|
|
118
|
+
test?: string;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/** Token tier in the 3-tier architecture */
|
|
122
|
+
export type TokenTier = 'definition' | 'usage' | 'component';
|
|
123
|
+
/** Token category */
|
|
124
|
+
export type TokenCategory = 'color' | 'spacing' | 'typography' | 'border' | 'shadow' | 'motion' | 'breakpoint' | 'z-index' | 'opacity';
|
|
125
|
+
/** A design token entry */
|
|
126
|
+
export interface TokenEntry {
|
|
127
|
+
/** Full token name, e.g. "--ed-theme-color-background-default" */
|
|
128
|
+
name: string;
|
|
129
|
+
/** Tier */
|
|
130
|
+
tier: TokenTier;
|
|
131
|
+
/** Category */
|
|
132
|
+
category: TokenCategory;
|
|
133
|
+
/** Raw value */
|
|
134
|
+
value: string;
|
|
135
|
+
/** Token it references (for tier 2/3) */
|
|
136
|
+
references?: string;
|
|
137
|
+
/** What this token is for */
|
|
138
|
+
intent: string;
|
|
139
|
+
/** Which components use it */
|
|
140
|
+
usedBy: string[];
|
|
141
|
+
/** Theme this token belongs to */
|
|
142
|
+
theme: string;
|
|
143
|
+
/** Whether this token is deprecated */
|
|
144
|
+
deprecated: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* For color tokens: the subcategory that determines which CSS properties
|
|
147
|
+
* the token may be applied to. One of "background", "content", "border",
|
|
148
|
+
* or undefined for non-color tokens. Derived from the token name segment
|
|
149
|
+
* immediately after `color-` (e.g., `--ed-theme-color-background-default`
|
|
150
|
+
* → "background"). See #631.
|
|
151
|
+
*/
|
|
152
|
+
subcategory?: 'background' | 'content' | 'border';
|
|
153
|
+
/**
|
|
154
|
+
* CSS properties this token is valid to apply to, derived from
|
|
155
|
+
* category/subcategory. For color tokens only:
|
|
156
|
+
* background → ["background", "background-color"]
|
|
157
|
+
* content → ["color", "fill"]
|
|
158
|
+
* border → ["border-color"] (matches the whole border-*-color family)
|
|
159
|
+
* Crossing the boundary (e.g., `background: var(--ed-theme-color-content-*)`)
|
|
160
|
+
* is a `token-category-mismatch` violation in eddie_validate_file. See #631.
|
|
161
|
+
*/
|
|
162
|
+
validProperties?: string[];
|
|
163
|
+
}
|
|
164
|
+
/** A component's role in a composition recipe */
|
|
165
|
+
export interface RecipeComponent {
|
|
166
|
+
tagName: string;
|
|
167
|
+
role: string;
|
|
168
|
+
variant?: string;
|
|
169
|
+
required: boolean;
|
|
170
|
+
slotTarget?: string;
|
|
171
|
+
}
|
|
172
|
+
/** A canonical composition recipe */
|
|
173
|
+
export interface CompositionRecipe {
|
|
174
|
+
/** Recipe name, e.g. "destructive-confirmation" */
|
|
175
|
+
name: string;
|
|
176
|
+
/** What this recipe accomplishes */
|
|
177
|
+
intent: string;
|
|
178
|
+
/** Components involved */
|
|
179
|
+
components: RecipeComponent[];
|
|
180
|
+
/** Design token mappings */
|
|
181
|
+
tokens: Record<string, string>;
|
|
182
|
+
/** Rules that must hold */
|
|
183
|
+
rules: string[];
|
|
184
|
+
/** Match confidence when detected in the wild (0-1) */
|
|
185
|
+
confidence?: number;
|
|
186
|
+
/** Whether this recipe is approved as canonical */
|
|
187
|
+
status: 'candidate' | 'canonical' | 'deprecated';
|
|
188
|
+
}
|
|
189
|
+
/** Source of a signal */
|
|
190
|
+
export type SignalSource = 'figma' | 'git' | 'storybook' | 'ci' | 'usage' | 'manual';
|
|
191
|
+
/** Signal severity */
|
|
192
|
+
export type SignalSeverity = 'info' | 'warning' | 'error' | 'critical';
|
|
193
|
+
/** A signal from any monitored source */
|
|
194
|
+
export interface Signal {
|
|
195
|
+
id: string;
|
|
196
|
+
timestamp: string;
|
|
197
|
+
source: SignalSource;
|
|
198
|
+
severity: SignalSeverity;
|
|
199
|
+
/** What kind of signal */
|
|
200
|
+
type: string;
|
|
201
|
+
/** Human-readable description */
|
|
202
|
+
message: string;
|
|
203
|
+
/** Affected component/token/file */
|
|
204
|
+
target?: string;
|
|
205
|
+
/** Raw data from the source */
|
|
206
|
+
payload?: Record<string, unknown>;
|
|
207
|
+
}
|
|
208
|
+
/** Health score category */
|
|
209
|
+
export type HealthCategory = 'tokens' | 'naming' | 'coverage' | 'documentation' | 'accessibility' | 'consistency';
|
|
210
|
+
/** A single health score */
|
|
211
|
+
export interface HealthScore {
|
|
212
|
+
category: HealthCategory;
|
|
213
|
+
score: number;
|
|
214
|
+
issues: HealthIssue[];
|
|
215
|
+
}
|
|
216
|
+
/** A specific health issue found */
|
|
217
|
+
export interface HealthIssue {
|
|
218
|
+
id: string;
|
|
219
|
+
category: HealthCategory;
|
|
220
|
+
severity: SignalSeverity;
|
|
221
|
+
message: string;
|
|
222
|
+
/** File path where the issue was found */
|
|
223
|
+
file: string;
|
|
224
|
+
/** Line number */
|
|
225
|
+
line?: number;
|
|
226
|
+
/** Column */
|
|
227
|
+
column?: number;
|
|
228
|
+
/** The problematic value */
|
|
229
|
+
actual?: string;
|
|
230
|
+
/** What it should be */
|
|
231
|
+
expected?: string;
|
|
232
|
+
/** Can this be auto-fixed? */
|
|
233
|
+
autoFixable: boolean;
|
|
234
|
+
/** Suggested fix */
|
|
235
|
+
suggestion?: string;
|
|
236
|
+
}
|
|
237
|
+
/** Full health report */
|
|
238
|
+
export interface HealthReport {
|
|
239
|
+
timestamp: string;
|
|
240
|
+
/** Overall score (weighted average) */
|
|
241
|
+
overall: number;
|
|
242
|
+
/** Scores by category */
|
|
243
|
+
categories: HealthScore[];
|
|
244
|
+
/** Total issue count */
|
|
245
|
+
totalIssues: number;
|
|
246
|
+
/** Breakdown by severity */
|
|
247
|
+
issueCounts: Record<SignalSeverity, number>;
|
|
248
|
+
}
|
|
249
|
+
/** Trust level (L1 = lowest, L5 = highest) */
|
|
250
|
+
export type TrustLevel = 'L1_INTERN' | 'L2_JUNIOR' | 'L3_MID' | 'L4_SENIOR' | 'L5_PRINCIPAL';
|
|
251
|
+
/** What kind of action the agent can take */
|
|
252
|
+
export type ActionType = 'suggest' | 'draft_pr' | 'create_pr' | 'auto_fix' | 'auto_merge' | 'update_docs' | 'notify' | 'escalate';
|
|
253
|
+
/** Risk level of a proposed action */
|
|
254
|
+
export type RiskLevel = 'low' | 'medium' | 'high' | 'critical';
|
|
255
|
+
/** A planned action */
|
|
256
|
+
export interface PlannedAction {
|
|
257
|
+
id: string;
|
|
258
|
+
timestamp: string;
|
|
259
|
+
/** What triggered this action */
|
|
260
|
+
signal: Signal;
|
|
261
|
+
/** What the agent wants to do */
|
|
262
|
+
actionType: ActionType;
|
|
263
|
+
/** Risk assessment */
|
|
264
|
+
risk: RiskLevel;
|
|
265
|
+
/** Confidence score (0-1) */
|
|
266
|
+
confidence: number;
|
|
267
|
+
/** Current trust level */
|
|
268
|
+
trustLevel: TrustLevel;
|
|
269
|
+
/** Whether this action is permitted at the current trust level */
|
|
270
|
+
permitted: boolean;
|
|
271
|
+
/** Human-readable description of the planned action */
|
|
272
|
+
description: string;
|
|
273
|
+
/** The actual changes to make */
|
|
274
|
+
changes: PlannedChange[];
|
|
275
|
+
/** Status */
|
|
276
|
+
status: 'pending' | 'approved' | 'rejected' | 'executed' | 'failed';
|
|
277
|
+
}
|
|
278
|
+
/** A specific file change */
|
|
279
|
+
export interface PlannedChange {
|
|
280
|
+
file: string;
|
|
281
|
+
type: 'create' | 'modify' | 'delete';
|
|
282
|
+
description: string;
|
|
283
|
+
/** For modify: the diff */
|
|
284
|
+
diff?: string;
|
|
285
|
+
}
|
|
286
|
+
/** Audit log entry */
|
|
287
|
+
export interface AuditEntry {
|
|
288
|
+
id: string;
|
|
289
|
+
timestamp: string;
|
|
290
|
+
action: PlannedAction;
|
|
291
|
+
/** Who approved (or 'auto' if within trust level) */
|
|
292
|
+
approvedBy: string;
|
|
293
|
+
/** Outcome */
|
|
294
|
+
outcome: 'success' | 'failure' | 'partial';
|
|
295
|
+
/** Any error messages */
|
|
296
|
+
errors?: string[];
|
|
297
|
+
}
|
|
298
|
+
/** A learning entry from human feedback */
|
|
299
|
+
export interface LearningEntry {
|
|
300
|
+
id: string;
|
|
301
|
+
timestamp: string;
|
|
302
|
+
/** What the agent suggested */
|
|
303
|
+
suggestion: {
|
|
304
|
+
type: string;
|
|
305
|
+
target: string;
|
|
306
|
+
proposed: string;
|
|
307
|
+
};
|
|
308
|
+
/** What the human decided */
|
|
309
|
+
decision: 'accepted' | 'rejected' | 'modified';
|
|
310
|
+
/** If modified, what they changed it to */
|
|
311
|
+
modification?: string;
|
|
312
|
+
/** Why (if provided) */
|
|
313
|
+
reason?: string;
|
|
314
|
+
/** Tags for categorization */
|
|
315
|
+
tags: string[];
|
|
316
|
+
}
|
|
317
|
+
/** Trust promotion requirements */
|
|
318
|
+
export interface TrustPromotion {
|
|
319
|
+
from: TrustLevel;
|
|
320
|
+
to: TrustLevel;
|
|
321
|
+
requirements: {
|
|
322
|
+
minCompletions: number;
|
|
323
|
+
maxRejectionRate: number;
|
|
324
|
+
minDaysAtLevel: number;
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
/** Eddie Brain configuration */
|
|
328
|
+
export interface BrainConfig {
|
|
329
|
+
/** Path to the Eddie monorepo root */
|
|
330
|
+
rootDir: string;
|
|
331
|
+
/** Current trust level */
|
|
332
|
+
trustLevel: TrustLevel;
|
|
333
|
+
/** Which watchers to enable */
|
|
334
|
+
watchers: {
|
|
335
|
+
figma: boolean;
|
|
336
|
+
git: boolean;
|
|
337
|
+
storybook: boolean;
|
|
338
|
+
usage: boolean;
|
|
339
|
+
};
|
|
340
|
+
/** Health score weights (must sum to 1) */
|
|
341
|
+
healthWeights: Record<HealthCategory, number>;
|
|
342
|
+
/** Governance rules file path */
|
|
343
|
+
governanceRulesPath?: string;
|
|
344
|
+
/** MCP server port */
|
|
345
|
+
mcpPort?: number;
|
|
346
|
+
/** Whether to auto-fix within trust level */
|
|
347
|
+
autoFix: boolean;
|
|
348
|
+
}
|
|
349
|
+
/** Default configuration */
|
|
350
|
+
export declare const DEFAULT_CONFIG: BrainConfig;
|
|
351
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,mCAAmC;AACnC,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/E,iDAAiD;AACjD,MAAM,MAAM,YAAY,GACpB,sBAAsB,GACtB,eAAe,GACf,aAAa,GACb,aAAa,GACb,cAAc,CAAC;AAEnB,sCAAsC;AACtC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,kCAAkC;AAClC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,mCAAmC;AACnC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB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ACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,4BAA4B;AAC5B,eAAO,MAAM,cAAc,EAAE,WAkB5B,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Eddie's Brain — Core Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* The type system for the agentic intelligence layer of the Eddie Design System.
|
|
5
|
+
*/
|
|
6
|
+
/** Default configuration */
|
|
7
|
+
export const DEFAULT_CONFIG = {
|
|
8
|
+
rootDir: '.',
|
|
9
|
+
trustLevel: 'L1_INTERN',
|
|
10
|
+
watchers: {
|
|
11
|
+
figma: false,
|
|
12
|
+
git: true,
|
|
13
|
+
storybook: false,
|
|
14
|
+
usage: false,
|
|
15
|
+
},
|
|
16
|
+
healthWeights: {
|
|
17
|
+
tokens: 0.25,
|
|
18
|
+
naming: 0.20,
|
|
19
|
+
coverage: 0.15,
|
|
20
|
+
documentation: 0.15,
|
|
21
|
+
accessibility: 0.15,
|
|
22
|
+
consistency: 0.10,
|
|
23
|
+
},
|
|
24
|
+
autoFix: false,
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwaH,4BAA4B;AAC5B,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,OAAO,EAAE,GAAG;IACZ,UAAU,EAAE,WAAW;IACvB,QAAQ,EAAE;QACR,KAAK,EAAE,KAAK;QACZ,GAAG,EAAE,IAAI;QACT,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,KAAK;KACb;IACD,aAAa,EAAE;QACb,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,IAAI;QACnB,aAAa,EAAE,IAAI;QACnB,WAAW,EAAE,IAAI;KAClB;IACD,OAAO,EAAE,KAAK;CACf,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Anthropic API utilities — rate-limit retry, sleep, etc.
|
|
3
|
+
* Used by both the pipeline agent-runner and the loop fix-agent.
|
|
4
|
+
*/
|
|
5
|
+
import Anthropic from '@anthropic-ai/sdk';
|
|
6
|
+
/**
|
|
7
|
+
* Sleep for a given number of milliseconds.
|
|
8
|
+
*/
|
|
9
|
+
export declare function sleep(ms: number): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Call the Anthropic API with retry/backoff for rate limit (429) errors.
|
|
12
|
+
* Retries up to MAX_RATE_LIMIT_RETRIES times with exponential backoff.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createWithRetry(client: Anthropic, params: Anthropic.MessageCreateParamsNonStreaming, callerName: string): Promise<Anthropic.Message>;
|
|
15
|
+
//# sourceMappingURL=anthropic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../src/utils/anthropic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAS1C;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,SAAS,CAAC,+BAA+B,EACjD,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAuB5B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Anthropic API utilities — rate-limit retry, sleep, etc.
|
|
3
|
+
* Used by both the pipeline agent-runner and the loop fix-agent.
|
|
4
|
+
*/
|
|
5
|
+
import Anthropic from '@anthropic-ai/sdk';
|
|
6
|
+
import chalk from 'chalk';
|
|
7
|
+
/** Maximum retries for rate limit (429) errors */
|
|
8
|
+
const MAX_RATE_LIMIT_RETRIES = 3;
|
|
9
|
+
/** Base delay in ms for exponential backoff on rate limits */
|
|
10
|
+
const RATE_LIMIT_BASE_DELAY_MS = 30_000;
|
|
11
|
+
/**
|
|
12
|
+
* Sleep for a given number of milliseconds.
|
|
13
|
+
*/
|
|
14
|
+
export function sleep(ms) {
|
|
15
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Call the Anthropic API with retry/backoff for rate limit (429) errors.
|
|
19
|
+
* Retries up to MAX_RATE_LIMIT_RETRIES times with exponential backoff.
|
|
20
|
+
*/
|
|
21
|
+
export async function createWithRetry(client, params, callerName) {
|
|
22
|
+
for (let attempt = 0; attempt <= MAX_RATE_LIMIT_RETRIES; attempt++) {
|
|
23
|
+
try {
|
|
24
|
+
return await client.messages.create(params);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
const isRateLimit = err instanceof Anthropic.RateLimitError ||
|
|
28
|
+
(err instanceof Error && err.message.includes('rate_limit'));
|
|
29
|
+
if (!isRateLimit || attempt === MAX_RATE_LIMIT_RETRIES) {
|
|
30
|
+
throw err;
|
|
31
|
+
}
|
|
32
|
+
const delayMs = RATE_LIMIT_BASE_DELAY_MS * Math.pow(2, attempt);
|
|
33
|
+
const delaySec = Math.round(delayMs / 1000);
|
|
34
|
+
console.log(chalk.yellow(` [${callerName}] Rate limited (attempt ${attempt + 1}/${MAX_RATE_LIMIT_RETRIES}). Retrying in ${delaySec}s...`));
|
|
35
|
+
await sleep(delayMs);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
throw new Error('Rate limit retries exhausted');
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=anthropic.js.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CACT,KAAK,CAAC,MAAM,CAAC,MAAM,UAAU,2BAA2B,OAAO,GAAG,CAAC,IAAI,sBAAsB,kBAAkB,QAAQ,MAAM,CAAC,CAC/H,CAAC;YACF,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src/utils/id.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAMnC"}
|
package/dist/utils/id.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ID generation utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Generate a unique ID (UUID v4 format)
|
|
6
|
+
*/
|
|
7
|
+
export function generateId() {
|
|
8
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
9
|
+
const r = (Math.random() * 16) | 0;
|
|
10
|
+
const v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
11
|
+
return v.toString(16);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.js","sourceRoot":"","sources":["../../src/utils/id.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC;QACxE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;QAC1C,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@brad-frost-web/eddie-brain",
|
|
3
|
+
"version": "0.32.0",
|
|
4
|
+
"description": "The agentic intelligence layer for the Eddie Design System — monitors, validates, and evolves your design system with AI-powered automation and human oversight.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"eddie-brain": "dist/cli/brain.js"
|
|
17
|
+
},
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./mcp": {
|
|
24
|
+
"import": "./dist/mcp/index.js",
|
|
25
|
+
"types": "./dist/mcp/index.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"./cli": {
|
|
28
|
+
"import": "./dist/cli/index.js",
|
|
29
|
+
"types": "./dist/cli/index.d.ts"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc && node scripts/copy-data.js",
|
|
34
|
+
"dev": "tsc --watch",
|
|
35
|
+
"test": "vitest run",
|
|
36
|
+
"test:watch": "vitest",
|
|
37
|
+
"init": "node dist/cli/brain.js init",
|
|
38
|
+
"scan": "node dist/cli/brain.js scan",
|
|
39
|
+
"health": "node dist/cli/brain.js health",
|
|
40
|
+
"validate": "node dist/cli/brain.js validate",
|
|
41
|
+
"mcp": "node dist/mcp/server.js",
|
|
42
|
+
"pipeline": "node dist/cli/brain.js --root ../.. pipeline run"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"design-system",
|
|
46
|
+
"agentic",
|
|
47
|
+
"mcp",
|
|
48
|
+
"design-tokens",
|
|
49
|
+
"lint",
|
|
50
|
+
"validation"
|
|
51
|
+
],
|
|
52
|
+
"author": "Brad Frost and Ian Frost",
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@anthropic-ai/sdk": "^0.80.0",
|
|
56
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
57
|
+
"chalk": "^5.4.0",
|
|
58
|
+
"chokidar": "^4.0.0",
|
|
59
|
+
"commander": "^13.1.0",
|
|
60
|
+
"fast-glob": "^3.3.0",
|
|
61
|
+
"postcss": "^8.5.0",
|
|
62
|
+
"postcss-scss": "^4.0.0"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"typescript": "^5.9.3",
|
|
66
|
+
"vitest": "^3.2.0"
|
|
67
|
+
},
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"@brad-frost-web/eddie-design-tokens": ">=0.19.0",
|
|
70
|
+
"@brad-frost-web/eddie-web-components": ">=0.19.0"
|
|
71
|
+
},
|
|
72
|
+
"peerDependenciesMeta": {
|
|
73
|
+
"@brad-frost-web/eddie-web-components": {
|
|
74
|
+
"optional": true
|
|
75
|
+
},
|
|
76
|
+
"@brad-frost-web/eddie-design-tokens": {
|
|
77
|
+
"optional": true
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|