@fractary/faber 0.1.1 → 1.0.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 (261) hide show
  1. package/README.md +366 -76
  2. package/dist/cli/commands/logs.d.ts +6 -0
  3. package/dist/cli/commands/logs.d.ts.map +1 -0
  4. package/dist/cli/commands/logs.js +215 -0
  5. package/dist/cli/commands/logs.js.map +1 -0
  6. package/dist/cli/commands/repo.d.ts +6 -0
  7. package/dist/cli/commands/repo.d.ts.map +1 -0
  8. package/dist/cli/commands/repo.js +260 -0
  9. package/dist/cli/commands/repo.js.map +1 -0
  10. package/dist/cli/commands/spec.d.ts +6 -0
  11. package/dist/cli/commands/spec.d.ts.map +1 -0
  12. package/dist/cli/commands/spec.js +184 -0
  13. package/dist/cli/commands/spec.js.map +1 -0
  14. package/dist/cli/commands/work.d.ts +6 -0
  15. package/dist/cli/commands/work.d.ts.map +1 -0
  16. package/dist/cli/commands/work.js +113 -0
  17. package/dist/cli/commands/work.js.map +1 -0
  18. package/dist/cli/commands/workflow.d.ts +6 -0
  19. package/dist/cli/commands/workflow.d.ts.map +1 -0
  20. package/dist/cli/commands/workflow.js +214 -0
  21. package/dist/cli/commands/workflow.js.map +1 -0
  22. package/dist/cli/index.d.ts +8 -0
  23. package/dist/cli/index.d.ts.map +1 -0
  24. package/dist/cli/index.js +27 -0
  25. package/dist/cli/index.js.map +1 -0
  26. package/dist/config.d.ts +814 -0
  27. package/dist/config.d.ts.map +1 -0
  28. package/dist/config.js +438 -0
  29. package/dist/config.js.map +1 -0
  30. package/dist/errors.d.ts +264 -0
  31. package/dist/errors.d.ts.map +1 -0
  32. package/dist/errors.js +491 -0
  33. package/dist/errors.js.map +1 -0
  34. package/dist/index.d.ts +21 -16
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +23 -36
  37. package/dist/index.js.map +1 -1
  38. package/dist/logs/index.d.ts +8 -0
  39. package/dist/logs/index.d.ts.map +1 -0
  40. package/dist/{types → logs}/index.js +7 -11
  41. package/dist/logs/index.js.map +1 -0
  42. package/dist/logs/manager.d.ts +97 -0
  43. package/dist/logs/manager.d.ts.map +1 -0
  44. package/dist/logs/manager.js +581 -0
  45. package/dist/logs/manager.js.map +1 -0
  46. package/dist/logs/types.d.ts +45 -0
  47. package/dist/logs/types.d.ts.map +1 -0
  48. package/dist/logs/types.js +8 -0
  49. package/dist/logs/types.js.map +1 -0
  50. package/dist/repo/git.d.ts +182 -0
  51. package/dist/repo/git.d.ts.map +1 -0
  52. package/dist/repo/git.js +496 -0
  53. package/dist/repo/git.js.map +1 -0
  54. package/dist/repo/index.d.ts +10 -0
  55. package/dist/repo/index.d.ts.map +1 -0
  56. package/dist/repo/index.js +29 -0
  57. package/dist/repo/index.js.map +1 -0
  58. package/dist/repo/manager.d.ts +179 -0
  59. package/dist/repo/manager.d.ts.map +1 -0
  60. package/dist/repo/manager.js +433 -0
  61. package/dist/repo/manager.js.map +1 -0
  62. package/dist/repo/providers/bitbucket.d.ts +38 -0
  63. package/dist/repo/providers/bitbucket.d.ts.map +1 -0
  64. package/dist/repo/providers/bitbucket.js +76 -0
  65. package/dist/repo/providers/bitbucket.js.map +1 -0
  66. package/dist/repo/providers/github.d.ts +30 -0
  67. package/dist/repo/providers/github.d.ts.map +1 -0
  68. package/dist/repo/providers/github.js +311 -0
  69. package/dist/repo/providers/github.js.map +1 -0
  70. package/dist/repo/providers/gitlab.d.ts +37 -0
  71. package/dist/repo/providers/gitlab.d.ts.map +1 -0
  72. package/dist/repo/providers/gitlab.js +74 -0
  73. package/dist/repo/providers/gitlab.js.map +1 -0
  74. package/dist/repo/providers/index.d.ts +9 -0
  75. package/dist/repo/providers/index.d.ts.map +1 -0
  76. package/dist/repo/providers/index.js +15 -0
  77. package/dist/repo/providers/index.js.map +1 -0
  78. package/dist/repo/types.d.ts +47 -0
  79. package/dist/repo/types.d.ts.map +1 -0
  80. package/dist/repo/types.js +8 -0
  81. package/dist/repo/types.js.map +1 -0
  82. package/dist/spec/index.d.ts +9 -0
  83. package/dist/spec/index.d.ts.map +1 -0
  84. package/dist/spec/index.js +30 -0
  85. package/dist/spec/index.js.map +1 -0
  86. package/dist/spec/manager.d.ts +98 -0
  87. package/dist/spec/manager.d.ts.map +1 -0
  88. package/dist/spec/manager.js +650 -0
  89. package/dist/spec/manager.js.map +1 -0
  90. package/dist/spec/templates.d.ts +28 -0
  91. package/dist/spec/templates.d.ts.map +1 -0
  92. package/dist/spec/templates.js +357 -0
  93. package/dist/spec/templates.js.map +1 -0
  94. package/dist/spec/types.d.ts +53 -0
  95. package/dist/spec/types.d.ts.map +1 -0
  96. package/dist/spec/types.js +8 -0
  97. package/dist/spec/types.js.map +1 -0
  98. package/dist/state/index.d.ts +8 -0
  99. package/dist/state/index.d.ts.map +1 -0
  100. package/dist/state/index.js +26 -0
  101. package/dist/state/index.js.map +1 -0
  102. package/dist/state/manager.d.ts +132 -0
  103. package/dist/state/manager.d.ts.map +1 -0
  104. package/dist/state/manager.js +517 -0
  105. package/dist/state/manager.js.map +1 -0
  106. package/dist/state/types.d.ts +46 -0
  107. package/dist/state/types.d.ts.map +1 -0
  108. package/dist/state/types.js +8 -0
  109. package/dist/state/types.js.map +1 -0
  110. package/dist/storage/codex-adapter.d.ts +62 -0
  111. package/dist/storage/codex-adapter.d.ts.map +1 -0
  112. package/dist/storage/codex-adapter.js +177 -0
  113. package/dist/storage/codex-adapter.js.map +1 -0
  114. package/dist/storage/index.d.ts +9 -0
  115. package/dist/storage/index.d.ts.map +1 -0
  116. package/dist/storage/index.js +15 -0
  117. package/dist/storage/index.js.map +1 -0
  118. package/dist/storage/local.d.ts +42 -0
  119. package/dist/storage/local.d.ts.map +1 -0
  120. package/dist/storage/local.js +137 -0
  121. package/dist/storage/local.js.map +1 -0
  122. package/dist/types.d.ts +603 -0
  123. package/dist/types.d.ts.map +1 -0
  124. package/dist/types.js +8 -0
  125. package/dist/types.js.map +1 -0
  126. package/dist/work/index.d.ts +8 -0
  127. package/dist/work/index.d.ts.map +1 -0
  128. package/dist/work/index.js +26 -0
  129. package/dist/work/index.js.map +1 -0
  130. package/dist/work/manager.d.ts +112 -0
  131. package/dist/work/manager.d.ts.map +1 -0
  132. package/dist/work/manager.js +227 -0
  133. package/dist/work/manager.js.map +1 -0
  134. package/dist/work/providers/github.d.ts +40 -0
  135. package/dist/work/providers/github.d.ts.map +1 -0
  136. package/dist/work/providers/github.js +299 -0
  137. package/dist/work/providers/github.js.map +1 -0
  138. package/dist/work/providers/jira.d.ts +50 -0
  139. package/dist/work/providers/jira.d.ts.map +1 -0
  140. package/dist/work/providers/jira.js +99 -0
  141. package/dist/work/providers/jira.js.map +1 -0
  142. package/dist/work/providers/linear.d.ts +47 -0
  143. package/dist/work/providers/linear.d.ts.map +1 -0
  144. package/dist/work/providers/linear.js +93 -0
  145. package/dist/work/providers/linear.js.map +1 -0
  146. package/dist/work/types.d.ts +41 -0
  147. package/dist/work/types.d.ts.map +1 -0
  148. package/dist/work/types.js +8 -0
  149. package/dist/work/types.js.map +1 -0
  150. package/dist/workflow/faber.d.ts +107 -0
  151. package/dist/workflow/faber.d.ts.map +1 -0
  152. package/dist/workflow/faber.js +606 -0
  153. package/dist/workflow/faber.js.map +1 -0
  154. package/dist/workflow/index.d.ts +8 -0
  155. package/dist/workflow/index.d.ts.map +1 -0
  156. package/dist/workflow/index.js +26 -0
  157. package/dist/workflow/index.js.map +1 -0
  158. package/dist/workflow/types.d.ts +54 -0
  159. package/dist/workflow/types.d.ts.map +1 -0
  160. package/dist/workflow/types.js +8 -0
  161. package/dist/workflow/types.js.map +1 -0
  162. package/package.json +42 -28
  163. package/dist/api.d.ts +0 -81
  164. package/dist/api.d.ts.map +0 -1
  165. package/dist/api.js +0 -261
  166. package/dist/api.js.map +0 -1
  167. package/dist/bindings/claude-code/transformer.d.ts +0 -55
  168. package/dist/bindings/claude-code/transformer.d.ts.map +0 -1
  169. package/dist/bindings/claude-code/transformer.js +0 -271
  170. package/dist/bindings/claude-code/transformer.js.map +0 -1
  171. package/dist/bindings/index.d.ts +0 -21
  172. package/dist/bindings/index.d.ts.map +0 -1
  173. package/dist/bindings/index.js +0 -43
  174. package/dist/bindings/index.js.map +0 -1
  175. package/dist/core/concepts/base.d.ts +0 -89
  176. package/dist/core/concepts/base.d.ts.map +0 -1
  177. package/dist/core/concepts/base.js +0 -230
  178. package/dist/core/concepts/base.js.map +0 -1
  179. package/dist/core/concepts/eval.d.ts +0 -90
  180. package/dist/core/concepts/eval.d.ts.map +0 -1
  181. package/dist/core/concepts/eval.js +0 -118
  182. package/dist/core/concepts/eval.js.map +0 -1
  183. package/dist/core/concepts/index.d.ts +0 -9
  184. package/dist/core/concepts/index.d.ts.map +0 -1
  185. package/dist/core/concepts/index.js +0 -36
  186. package/dist/core/concepts/index.js.map +0 -1
  187. package/dist/core/concepts/role.d.ts +0 -19
  188. package/dist/core/concepts/role.d.ts.map +0 -1
  189. package/dist/core/concepts/role.js +0 -227
  190. package/dist/core/concepts/role.js.map +0 -1
  191. package/dist/core/concepts/team.d.ts +0 -57
  192. package/dist/core/concepts/team.d.ts.map +0 -1
  193. package/dist/core/concepts/team.js +0 -106
  194. package/dist/core/concepts/team.js.map +0 -1
  195. package/dist/core/concepts/tool.d.ts +0 -43
  196. package/dist/core/concepts/tool.d.ts.map +0 -1
  197. package/dist/core/concepts/tool.js +0 -104
  198. package/dist/core/concepts/tool.js.map +0 -1
  199. package/dist/core/concepts/workflow.d.ts +0 -87
  200. package/dist/core/concepts/workflow.d.ts.map +0 -1
  201. package/dist/core/concepts/workflow.js +0 -114
  202. package/dist/core/concepts/workflow.js.map +0 -1
  203. package/dist/core/config/index.d.ts +0 -34
  204. package/dist/core/config/index.d.ts.map +0 -1
  205. package/dist/core/config/index.js +0 -80
  206. package/dist/core/config/index.js.map +0 -1
  207. package/dist/core/config/loader.d.ts +0 -53
  208. package/dist/core/config/loader.d.ts.map +0 -1
  209. package/dist/core/config/loader.js +0 -234
  210. package/dist/core/config/loader.js.map +0 -1
  211. package/dist/core/contexts/index.d.ts +0 -36
  212. package/dist/core/contexts/index.d.ts.map +0 -1
  213. package/dist/core/contexts/index.js +0 -75
  214. package/dist/core/contexts/index.js.map +0 -1
  215. package/dist/core/contexts/loader.d.ts +0 -66
  216. package/dist/core/contexts/loader.d.ts.map +0 -1
  217. package/dist/core/contexts/loader.js +0 -261
  218. package/dist/core/contexts/loader.js.map +0 -1
  219. package/dist/core/overlays/index.d.ts +0 -31
  220. package/dist/core/overlays/index.d.ts.map +0 -1
  221. package/dist/core/overlays/index.js +0 -82
  222. package/dist/core/overlays/index.js.map +0 -1
  223. package/dist/core/overlays/resolver.d.ts +0 -65
  224. package/dist/core/overlays/resolver.d.ts.map +0 -1
  225. package/dist/core/overlays/resolver.js +0 -249
  226. package/dist/core/overlays/resolver.js.map +0 -1
  227. package/dist/types/bindings.d.ts +0 -59
  228. package/dist/types/bindings.d.ts.map +0 -1
  229. package/dist/types/bindings.js +0 -6
  230. package/dist/types/bindings.js.map +0 -1
  231. package/dist/types/concepts.d.ts +0 -131
  232. package/dist/types/concepts.d.ts.map +0 -1
  233. package/dist/types/concepts.js +0 -29
  234. package/dist/types/concepts.js.map +0 -1
  235. package/dist/types/config.d.ts +0 -42
  236. package/dist/types/config.d.ts.map +0 -1
  237. package/dist/types/config.js +0 -6
  238. package/dist/types/config.js.map +0 -1
  239. package/dist/types/contexts.d.ts +0 -59
  240. package/dist/types/contexts.d.ts.map +0 -1
  241. package/dist/types/contexts.js +0 -17
  242. package/dist/types/contexts.js.map +0 -1
  243. package/dist/types/index.d.ts +0 -17
  244. package/dist/types/index.d.ts.map +0 -1
  245. package/dist/types/index.js.map +0 -1
  246. package/dist/types/overlays.d.ts +0 -28
  247. package/dist/types/overlays.d.ts.map +0 -1
  248. package/dist/types/overlays.js +0 -15
  249. package/dist/types/overlays.js.map +0 -1
  250. package/dist/utils/file-system.d.ts +0 -40
  251. package/dist/utils/file-system.d.ts.map +0 -1
  252. package/dist/utils/file-system.js +0 -105
  253. package/dist/utils/file-system.js.map +0 -1
  254. package/dist/utils/template.d.ts +0 -28
  255. package/dist/utils/template.d.ts.map +0 -1
  256. package/dist/utils/template.js +0 -107
  257. package/dist/utils/template.js.map +0 -1
  258. package/dist/utils/validation.d.ts +0 -42
  259. package/dist/utils/validation.d.ts.map +0 -1
  260. package/dist/utils/validation.js +0 -94
  261. package/dist/utils/validation.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Faber
1
+ # @fractary/faber
2
2
 
3
- > Universal AI Agent Orchestration Framework - Core SDK
3
+ > FABER SDK - Development toolkit for AI-assisted workflows
4
4
 
5
5
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
6
  [![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](package.json)
@@ -8,9 +8,10 @@
8
8
 
9
9
  ## Overview
10
10
 
11
- Faber is the core SDK for building universal AI agents that can be deployed across multiple AI frameworks (Claude Code, LangGraph, CrewAI, etc.) and adapted to different platforms and organizational contexts.
11
+ Faber is a development toolkit that powers the FABER workflow methodology:
12
+ **Frame → Architect → Build → Evaluate → Release**
12
13
 
13
- This is the **core framework package**. For the CLI tool, see [@fractary/faber-cli](https://www.npmjs.com/package/@fractary/faber-cli).
14
+ This SDK provides the core modules for work tracking, repository operations, specifications, logging, state management, and workflow orchestration across multiple platforms.
14
15
 
15
16
  ## Installation
16
17
 
@@ -18,122 +19,413 @@ This is the **core framework package**. For the CLI tool, see [@fractary/faber-c
18
19
  npm install @fractary/faber
19
20
  ```
20
21
 
21
- ## Programmatic Usage
22
+ ## Quick Start
22
23
 
23
24
  ```typescript
24
- import { FaberAPI, RoleLoader } from '@fractary/faber';
25
+ import { WorkManager, RepoManager, FaberWorkflow } from '@fractary/faber';
25
26
 
26
- // Initialize API
27
- const api = new FaberAPI({
28
- projectPath: './my-agents'
27
+ // Work tracking
28
+ const work = new WorkManager();
29
+ const issue = await work.fetchIssue(123);
30
+ await work.createComment(123, 'Starting implementation');
31
+
32
+ // Repository operations
33
+ const repo = new RepoManager();
34
+ await repo.createBranch('feature/add-export');
35
+ await repo.createPR({ title: 'Add export feature', head: 'feature/add-export' });
36
+
37
+ // Full FABER workflow
38
+ const workflow = new FaberWorkflow();
39
+ const result = await workflow.run({ workId: '123', autonomy: 'assisted' });
40
+ ```
41
+
42
+ ## Modules
43
+
44
+ ### Work Module (`@fractary/faber/work`)
45
+
46
+ Multi-platform work tracking for GitHub Issues, Jira, and Linear.
47
+
48
+ ```typescript
49
+ import { WorkManager } from '@fractary/faber/work';
50
+
51
+ const work = new WorkManager();
52
+
53
+ // Issues
54
+ const issue = await work.createIssue({ title: 'New feature', body: 'Description' });
55
+ const fetched = await work.fetchIssue(123);
56
+ await work.closeIssue(123);
57
+
58
+ // Comments
59
+ await work.createComment(123, 'Progress update');
60
+ const comments = await work.listComments(123);
61
+
62
+ // Labels
63
+ await work.addLabels(123, ['bug', 'priority:high']);
64
+ await work.setLabels(123, ['enhancement']);
65
+
66
+ // Milestones
67
+ await work.setMilestone(123, 'v1.0');
68
+
69
+ // Classification
70
+ const workType = await work.classifyWorkType(issue); // 'feature' | 'bug' | 'chore' | etc.
71
+ ```
72
+
73
+ ### Repo Module (`@fractary/faber/repo`)
74
+
75
+ Git and repository operations for GitHub, GitLab, and Bitbucket.
76
+
77
+ ```typescript
78
+ import { RepoManager } from '@fractary/faber/repo';
79
+
80
+ const repo = new RepoManager();
81
+
82
+ // Branches
83
+ await repo.createBranch('feature/new-feature', { base: 'main' });
84
+ await repo.deleteBranch('feature/old-feature');
85
+ const branches = await repo.listBranches({ merged: true });
86
+
87
+ // Pull Requests
88
+ const pr = await repo.createPR({
89
+ title: 'Add new feature',
90
+ body: 'Description',
91
+ head: 'feature/new-feature',
92
+ base: 'main',
29
93
  });
94
+ await repo.mergePR(pr.number, { strategy: 'squash' });
95
+
96
+ // Git Operations
97
+ repo.commit({ message: 'Add feature', type: 'feat' });
98
+ repo.push({ branch: 'feature/new-feature', setUpstream: true });
99
+ repo.pull({ rebase: true });
100
+
101
+ // Branch naming
102
+ const name = repo.generateBranchName({
103
+ type: 'feature',
104
+ description: 'Add CSV export',
105
+ workId: '123',
106
+ }); // 'feature/123-add-csv-export'
107
+ ```
108
+
109
+ ### Spec Module (`@fractary/faber/spec`)
30
110
 
31
- // Load and build an agent
32
- const result = await api.build('claude', 'role', 'issue-manager', {
33
- output: './deployments/claude',
34
- platform: 'github-issues'
111
+ Specification management with templates, validation, and refinement.
112
+
113
+ ```typescript
114
+ import { SpecManager } from '@fractary/faber/spec';
115
+
116
+ const spec = new SpecManager();
117
+
118
+ // Create from template
119
+ const newSpec = spec.createSpec('Add user authentication', {
120
+ template: 'feature',
121
+ workId: '123',
35
122
  });
36
123
 
37
- console.log('Built agent:', result.files);
124
+ // List and search
125
+ const specs = spec.listSpecs({ status: 'draft' });
126
+ const found = spec.searchSpecs('authentication');
127
+
128
+ // Validation
129
+ const validation = spec.validateSpec('SPEC-001');
130
+ // { status: 'warn', completeness: 0.75, suggestions: [...] }
131
+
132
+ // Refinement
133
+ const questions = spec.generateRefinementQuestions('SPEC-001');
134
+ const result = spec.applyRefinements('SPEC-001', {
135
+ 'q1': 'OAuth 2.0 with PKCE',
136
+ 'q2': 'JWT tokens with 1-hour expiry',
137
+ });
38
138
  ```
39
139
 
40
- ## Core Features
140
+ ### Logs Module (`@fractary/faber/logs`)
41
141
 
42
- - **Concept System** - Roles, Teams, Tools, Workflows, Evals
43
- - **Context System** - 7 categories of dynamic knowledge loading
44
- - **Overlay System** - Customization without forking
45
- - **Binding Framework** - Transform to any AI framework
46
- - **Configuration Management** - Flexible config system
47
- - **TypeScript First** - Full type safety
142
+ Session capture and log management with sensitive data redaction.
48
143
 
49
- ## API Reference
144
+ ```typescript
145
+ import { LogManager } from '@fractary/faber/logs';
50
146
 
51
- ### FaberAPI
147
+ const logs = new LogManager();
52
148
 
53
- Main programmatic interface:
149
+ // Session capture
150
+ logs.startCapture({ issueNumber: 123 });
151
+ // ... work happens ...
152
+ const session = logs.stopCapture();
54
153
 
55
- ```typescript
56
- class FaberAPI {
57
- // Initialize a new Faber project
58
- async init(options: InitOptions): Promise<void>
154
+ // Log management
155
+ const entries = logs.listLogs({ type: 'session' });
156
+ const log = logs.getLog('session-2024-01-15.json');
59
157
 
60
- // Create new concepts
61
- async create(type: ConceptType, name: string, options: CreateOptions): Promise<void>
158
+ // Export
159
+ logs.exportLog('session-123', './exports/session.md', 'markdown');
160
+ ```
62
161
 
63
- // List available concepts
64
- async list(type?: ConceptType, filter?: ListFilter): Promise<ConceptInfo[]>
162
+ ### State Module (`@fractary/faber/state`)
65
163
 
66
- // Validate a concept
67
- async validate(type: ConceptType, name: string): Promise<ValidationResult>
164
+ Workflow state persistence with checkpoints and recovery.
68
165
 
69
- // Build/transform for a framework
70
- async build(binding: string, type: ConceptType, name: string, options: BuildOptions): Promise<DeploymentArtifact>
166
+ ```typescript
167
+ import { StateManager } from '@fractary/faber/state';
71
168
 
72
- // Load configuration
73
- async loadConfig(): Promise<Config>
169
+ const state = new StateManager();
74
170
 
75
- // Apply overlays
76
- async applyOverlays(concept: Concept, overlays: Overlays): Promise<Concept>
77
- }
171
+ // Workflows
172
+ const workflow = state.createWorkflow('123');
173
+ state.startPhase(workflow.workflow_id, 'frame');
174
+ state.completePhase(workflow.workflow_id, 'frame', { requirements: [...] });
175
+
176
+ // Checkpoints
177
+ state.createCheckpoint(workflow.workflow_id, 'before-build');
178
+ state.restoreFromCheckpoint(workflow.workflow_id, 'before-build');
179
+
180
+ // Recovery
181
+ const active = state.getActiveWorkflow('123');
182
+ state.resumeWorkflow(workflow.workflow_id);
183
+
184
+ // Manifests
185
+ const manifest = state.createManifest(workflow.workflow_id, '123');
186
+ state.addArtifactToManifest(manifest.manifest_id, { type: 'spec', path: '...' });
78
187
  ```
79
188
 
80
- ### Concept Loaders
189
+ ### Workflow Module (`@fractary/faber/workflow`)
81
190
 
82
- Direct access to loaders:
191
+ Full FABER workflow orchestration.
83
192
 
84
193
  ```typescript
85
- import { RoleLoader, TeamLoader, ToolLoader } from '@fractary/faber/loaders';
194
+ import { FaberWorkflow } from '@fractary/faber/workflow';
195
+
196
+ const faber = new FaberWorkflow({
197
+ config: {
198
+ autonomy: 'assisted',
199
+ phases: {
200
+ frame: { enabled: true },
201
+ architect: { enabled: true, refineSpec: true },
202
+ build: { enabled: true },
203
+ evaluate: { enabled: true, maxRetries: 3 },
204
+ release: { enabled: true, requestReviews: true, reviewers: ['@team'] },
205
+ },
206
+ },
207
+ });
208
+
209
+ // Event handling
210
+ faber.addEventListener((event, data) => {
211
+ console.log(`${event}:`, data);
212
+ });
213
+
214
+ // User input callback for interactive mode
215
+ faber.setUserInputCallback(async (request) => {
216
+ // Prompt user and return response
217
+ return 'yes';
218
+ });
219
+
220
+ // Run workflow
221
+ const result = await faber.run({
222
+ workId: '123',
223
+ autonomy: 'assisted', // 'dry-run' | 'assisted' | 'guarded' | 'autonomous'
224
+ });
86
225
 
87
- const loader = new RoleLoader();
88
- const role = await loader.load('./roles/my-agent');
89
- const validation = await loader.validate(role);
226
+ // Check status
227
+ const status = faber.getStatus(result.workflow_id);
228
+ // { state: {...}, currentPhase: 'build', progress: 60 }
229
+
230
+ // Resume paused workflow
231
+ await faber.resume(result.workflow_id);
90
232
  ```
91
233
 
92
- ### Bindings
234
+ ### Storage Module (`@fractary/faber/storage`)
93
235
 
94
- Create custom framework bindings:
236
+ Artifact storage with optional Codex integration.
95
237
 
96
238
  ```typescript
97
- import { BindingTransformer, DeploymentArtifact } from '@fractary/faber/bindings';
239
+ import { StorageManager } from '@fractary/faber/storage';
98
240
 
99
- class MyCustomBinding implements BindingTransformer {
100
- async transform(concept: Concept, config: Config, overlays?: Overlays): Promise<DeploymentArtifact> {
101
- // Custom transformation logic
102
- }
241
+ const storage = new StorageManager();
103
242
 
104
- async validate(concept: Concept): Promise<ValidationResult> {
105
- // Validation logic
106
- }
243
+ // Store artifacts
244
+ await storage.store('specs/SPEC-001.md', specContent);
245
+ await storage.store('logs/session-123.json', logContent);
246
+
247
+ // Retrieve
248
+ const content = await storage.retrieve('specs/SPEC-001.md');
249
+ const exists = await storage.exists('specs/SPEC-001.md');
250
+
251
+ // List
252
+ const artifacts = await storage.list('specs/');
253
+
254
+ // Delete
255
+ await storage.delete('logs/old-session.json');
256
+
257
+ // Codex integration (if available)
258
+ if (storage.hasCodexIntegration()) {
259
+ await storage.syncToCodex('specs/');
260
+ }
261
+ ```
262
+
263
+ ## Configuration
264
+
265
+ Configuration files are stored at `.fractary/plugins/{module}/config.json`:
107
266
 
108
- getRequirements(): BindingRequirements {
109
- return {
110
- supportedConcepts: [ConceptType.ROLE, ConceptType.TEAM]
111
- };
267
+ ```
268
+ .fractary/
269
+ └── plugins/
270
+ ├── work/
271
+ │ └── config.json
272
+ ├── repo/
273
+ │ └── config.json
274
+ ├── spec/
275
+ │ └── config.json
276
+ ├── logs/
277
+ │ └── config.json
278
+ └── state/
279
+ └── config.json
280
+ ```
281
+
282
+ ### Work Config
283
+
284
+ ```json
285
+ {
286
+ "platform": "github",
287
+ "owner": "your-org",
288
+ "repo": "your-repo"
289
+ }
290
+ ```
291
+
292
+ ### Repo Config
293
+
294
+ ```json
295
+ {
296
+ "platform": "github",
297
+ "owner": "your-org",
298
+ "repo": "your-repo",
299
+ "defaultBranch": "main",
300
+ "branchPrefixes": {
301
+ "feature": "feature/",
302
+ "fix": "fix/",
303
+ "chore": "chore/"
112
304
  }
113
305
  }
114
306
  ```
115
307
 
116
- ## Documentation
308
+ ## Autonomy Levels
309
+
310
+ The SDK supports four autonomy levels:
117
311
 
118
- - [Core Concepts](https://github.com/fractary/faber-cli/blob/main/docs/concepts.md)
119
- - [Context System](https://github.com/fractary/faber-cli/blob/main/docs/contexts.md)
120
- - [Overlay System](https://github.com/fractary/faber-cli/blob/main/docs/overlays.md)
121
- - [Binding System](https://github.com/fractary/faber-cli/blob/main/docs/bindings.md)
122
- - [API Reference](https://github.com/fractary/faber-cli/blob/main/docs/api.md)
312
+ | Level | Description |
313
+ |-------|-------------|
314
+ | `dry-run` | Preview changes without executing |
315
+ | `assisted` | Pause for user confirmation at each step |
316
+ | `guarded` | Confirm destructive operations only |
317
+ | `autonomous` | Execute without confirmation |
123
318
 
124
- ## CLI Tool
319
+ ## CLI Usage
125
320
 
126
- For command-line usage, install the CLI package:
321
+ The SDK includes a CLI for direct usage:
127
322
 
128
323
  ```bash
129
- npm install -g @fractary/faber-cli
324
+ # Work commands
325
+ fractary work fetch 123
326
+ fractary work create --title "New feature" --type feature
327
+ fractary work comment 123 --body "Progress update"
328
+ fractary work classify 123
329
+
330
+ # Repo commands
331
+ fractary repo branch create feature/new-feature
332
+ fractary repo pr create --title "Add feature" --head feature/new-feature
333
+ fractary repo commit --message "Add feature" --type feat
334
+
335
+ # Spec commands
336
+ fractary spec create "Add authentication" --template feature
337
+ fractary spec validate SPEC-001
338
+ fractary spec refine SPEC-001
339
+
340
+ # Workflow commands
341
+ fractary workflow run 123 --autonomy assisted
342
+ fractary workflow status workflow-id
343
+ fractary workflow resume workflow-id
130
344
  ```
131
345
 
132
- See [@fractary/faber-cli](https://www.npmjs.com/package/@fractary/faber-cli) for CLI documentation.
346
+ ## Platform Support
347
+
348
+ ### Fully Implemented
349
+ - **GitHub** - Issues, PRs, Git operations
350
+
351
+ ### Stub (Interface Only)
352
+ - **Jira** - Work tracking
353
+ - **Linear** - Work tracking
354
+ - **GitLab** - Repository operations
355
+ - **Bitbucket** - Repository operations
133
356
 
134
- ## Contributing
357
+ ## Integration Example
135
358
 
136
- See [Contributing Guide](https://github.com/fractary/faber-cli/blob/main/docs/contributing.md).
359
+ For CLI projects consuming this SDK:
360
+
361
+ ```typescript
362
+ // cli/src/commands/work.ts
363
+ import { WorkManager } from '@fractary/faber/work';
364
+ import { Command } from 'commander';
365
+
366
+ export function registerWorkCommands(program: Command) {
367
+ const work = program.command('work');
368
+
369
+ work
370
+ .command('fetch <issue>')
371
+ .action(async (issue) => {
372
+ const manager = new WorkManager();
373
+ const result = await manager.fetchIssue(issue);
374
+ console.log(JSON.stringify(result, null, 2));
375
+ });
376
+
377
+ work
378
+ .command('create')
379
+ .requiredOption('-t, --title <title>')
380
+ .option('-b, --body <body>')
381
+ .action(async (options) => {
382
+ const manager = new WorkManager();
383
+ const result = await manager.createIssue(options);
384
+ console.log('Created:', result.number);
385
+ });
386
+ }
387
+ ```
388
+
389
+ ## Type Exports
390
+
391
+ All types are exported for TypeScript consumers:
392
+
393
+ ```typescript
394
+ import type {
395
+ // Work types
396
+ Issue,
397
+ IssueCreateOptions,
398
+ IssueUpdateOptions,
399
+ IssueFilters,
400
+ Comment,
401
+ Label,
402
+ Milestone,
403
+ WorkType,
404
+
405
+ // Repo types
406
+ PullRequest,
407
+ PRCreateOptions,
408
+ Branch,
409
+ BranchCreateOptions,
410
+
411
+ // Spec types
412
+ Specification,
413
+ SpecTemplate,
414
+ ValidationResult,
415
+
416
+ // Workflow types
417
+ WorkflowConfig,
418
+ WorkflowResult,
419
+ PhaseResult,
420
+ FaberPhase,
421
+ AutonomyLevel,
422
+
423
+ // Config types
424
+ WorkConfig,
425
+ RepoConfig,
426
+ SpecConfig,
427
+ } from '@fractary/faber';
428
+ ```
137
429
 
138
430
  ## License
139
431
 
@@ -141,6 +433,4 @@ MIT - see [LICENSE](LICENSE) file for details.
141
433
 
142
434
  ---
143
435
 
144
- **Part of the Faber Ecosystem**
145
- - [@fractary/faber](https://www.npmjs.com/package/@fractary/faber) - Core SDK (this package)
146
- - [@fractary/faber-cli](https://www.npmjs.com/package/@fractary/faber-cli) - CLI tool
436
+ **Part of the Fractary Ecosystem**
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @fractary/faber CLI - Logs Commands
3
+ */
4
+ import { Command } from 'commander';
5
+ export declare const logsCommand: Command;
6
+ //# sourceMappingURL=logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/logs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,WAAW,SAC4B,CAAC"}