@fractary/faber 1.0.0 → 1.0.2

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 CHANGED
@@ -1,207 +1,160 @@
1
1
  # @fractary/faber
2
2
 
3
- > FABER SDK - Development toolkit for AI-assisted workflows
3
+ > AI-native workflow automation that runs in production
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)
7
7
  [![TypeScript](https://img.shields.io/badge/typescript-5.3.3-blue)](https://www.typescriptlang.org/)
8
8
 
9
- ## Overview
9
+ ## What is FABER?
10
10
 
11
- Faber is a development toolkit that powers the FABER workflow methodology:
12
- **Frame → Architect → Build → Evaluate → Release**
11
+ **FABER enables AI agents to do meaningful work autonomously while knowing exactly when to involve humans.**
13
12
 
14
- This SDK provides the core modules for work tracking, repository operations, specifications, logging, state management, and workflow orchestration across multiple platforms.
13
+ Unlike simple automation tools that chain API calls, FABER orchestrates AI agents that actually reason about your work. Unlike raw AI frameworks, FABER provides the guardrails enterprises need to deploy with confidence.
15
14
 
16
- ## Installation
17
-
18
- ```bash
19
- npm install @fractary/faber
15
+ ```
16
+ From issue to PR, autonomously.
20
17
  ```
21
18
 
22
- ## Quick Start
19
+ ### The Problem
23
20
 
24
- ```typescript
25
- import { WorkManager, RepoManager, FaberWorkflow } from '@fractary/faber';
21
+ | Approach | What Happens |
22
+ |----------|--------------|
23
+ | **Deterministic Automation** (Zapier, Make) | Works for simple tasks, breaks when reasoning is required |
24
+ | **Raw AI Agents** (LangGraph, AutoGen) | Powerful but unpredictable—enterprises won't adopt |
25
+ | **AI + Approve Everything** | Human becomes the bottleneck, defeats the purpose |
26
26
 
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' });
27
+ ### The FABER Solution
36
28
 
37
- // Full FABER workflow
38
- const workflow = new FaberWorkflow();
39
- const result = await workflow.run({ workId: '123', autonomy: 'assisted' });
40
- ```
29
+ FABER takes a different approach: **AI operates autonomously within defined boundaries, escalates intelligently when boundaries are approached.**
41
30
 
42
- ## Modules
31
+ - **Structural Guardrails**: The FABER methodology (Frame → Architect → Build → Evaluate → Release) prevents chaos through process
32
+ - **Boundary Guardrails**: Hard limits the AI cannot cross (production deploys, cost thresholds)
33
+ - **Intelligent Guardrails**: AI reasons about its own confidence and risk, deciding when to proceed vs. escalate
43
34
 
44
- ### Work Module (`@fractary/faber/work`)
35
+ The result: 90% autonomous operation, 10% human involvement—focused on decisions that actually matter.
45
36
 
46
- Multi-platform work tracking for GitHub Issues, Jira, and Linear.
37
+ ## Who is FABER For?
47
38
 
48
- ```typescript
49
- import { WorkManager } from '@fractary/faber/work';
39
+ ### Development Teams
40
+ Automate complex development tasks—from understanding an issue to shipping a PR. Focus on interesting problems while AI handles the routine work.
50
41
 
51
- const work = new WorkManager();
42
+ ### Technical Operations
43
+ Automated incident response, deployment pipelines, and infrastructure changes with human oversight on critical decisions.
52
44
 
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);
45
+ ### Platform Engineers
46
+ Build AI-powered workflows that your entire organization can use, with the safety and observability enterprises require.
57
47
 
58
- // Comments
59
- await work.createComment(123, 'Progress update');
60
- const comments = await work.listComments(123);
48
+ ## Key Concepts
61
49
 
62
- // Labels
63
- await work.addLabels(123, ['bug', 'priority:high']);
64
- await work.setLabels(123, ['enhancement']);
50
+ ### The FABER Methodology
65
51
 
66
- // Milestones
67
- await work.setMilestone(123, 'v1.0');
52
+ Every workflow follows five phases:
68
53
 
69
- // Classification
70
- const workType = await work.classifyWorkType(issue); // 'feature' | 'bug' | 'chore' | etc.
71
- ```
54
+ | Phase | Purpose |
55
+ |-------|---------|
56
+ | **Frame** | Understand the problem before acting |
57
+ | **Architect** | Plan the approach before building |
58
+ | **Build** | Implement to specification |
59
+ | **Evaluate** | Validate before shipping |
60
+ | **Release** | Controlled delivery |
72
61
 
73
- ### Repo Module (`@fractary/faber/repo`)
62
+ ### Earned Autonomy
74
63
 
75
- Git and repository operations for GitHub, GitLab, and Bitbucket.
64
+ Trust is earned, not assumed:
76
65
 
77
- ```typescript
78
- import { RepoManager } from '@fractary/faber/repo';
66
+ 1. **Day 1**: Conservative—more human checkpoints
67
+ 2. **Week 4**: Established patterns—less intervention needed
68
+ 3. **Month 6**: Mature—90% autonomous, 10% escalation
79
69
 
80
- const repo = new RepoManager();
70
+ ### Autonomy Levels
81
71
 
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',
93
- });
94
- await repo.mergePR(pr.number, { strategy: 'squash' });
72
+ | Level | Description |
73
+ |-------|-------------|
74
+ | `dry-run` | Preview changes without executing |
75
+ | `assisted` | Pause for user confirmation at each step |
76
+ | `guarded` | Confirm destructive operations only |
77
+ | `autonomous` | Execute within established boundaries |
95
78
 
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 });
79
+ ## Installation
100
80
 
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'
81
+ ```bash
82
+ npm install @fractary/faber
107
83
  ```
108
84
 
109
- ### Spec Module (`@fractary/faber/spec`)
110
-
111
- Specification management with templates, validation, and refinement.
85
+ ## Quick Start
112
86
 
113
87
  ```typescript
114
- import { SpecManager } from '@fractary/faber/spec';
115
-
116
- const spec = new SpecManager();
88
+ import { FaberWorkflow } from '@fractary/faber';
117
89
 
118
- // Create from template
119
- const newSpec = spec.createSpec('Add user authentication', {
120
- template: 'feature',
90
+ // Run a complete FABER workflow
91
+ const workflow = new FaberWorkflow();
92
+ const result = await workflow.run({
121
93
  workId: '123',
94
+ autonomy: 'assisted'
122
95
  });
96
+ ```
123
97
 
124
- // List and search
125
- const specs = spec.listSpecs({ status: 'draft' });
126
- const found = spec.searchSpecs('authentication');
98
+ Or use the CLI:
127
99
 
128
- // Validation
129
- const validation = spec.validateSpec('SPEC-001');
130
- // { status: 'warn', completeness: 0.75, suggestions: [...] }
100
+ ```bash
101
+ # Run workflow for issue #123
102
+ faber run 123 --autonomy assisted
131
103
 
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
- });
104
+ # Check status
105
+ faber status <workflow-id>
138
106
  ```
139
107
 
140
- ### Logs Module (`@fractary/faber/logs`)
108
+ ## SDK Modules
141
109
 
142
- Session capture and log management with sensitive data redaction.
110
+ The FABER SDK provides modular primitives for building AI-powered workflows:
143
111
 
144
- ```typescript
145
- import { LogManager } from '@fractary/faber/logs';
146
-
147
- const logs = new LogManager();
112
+ | Module | Purpose | Import |
113
+ |--------|---------|--------|
114
+ | **Work** | Issue tracking (GitHub, Jira, Linear) | `@fractary/faber/work` |
115
+ | **Repo** | Git & PRs (GitHub, GitLab, Bitbucket) | `@fractary/faber/repo` |
116
+ | **Spec** | Specification management | `@fractary/faber/spec` |
117
+ | **State** | Workflow persistence & checkpoints | `@fractary/faber/state` |
118
+ | **Logs** | Session capture & audit trails | `@fractary/faber/logs` |
119
+ | **Storage** | Artifact storage with Codex integration | `@fractary/faber/storage` |
120
+ | **Workflow** | Full FABER orchestration | `@fractary/faber/workflow` |
148
121
 
149
- // Session capture
150
- logs.startCapture({ issueNumber: 123 });
151
- // ... work happens ...
152
- const session = logs.stopCapture();
122
+ ### Work Module
153
123
 
154
- // Log management
155
- const entries = logs.listLogs({ type: 'session' });
156
- const log = logs.getLog('session-2024-01-15.json');
124
+ ```typescript
125
+ import { WorkManager } from '@fractary/faber/work';
157
126
 
158
- // Export
159
- logs.exportLog('session-123', './exports/session.md', 'markdown');
127
+ const work = new WorkManager();
128
+ const issue = await work.fetchIssue(123);
129
+ await work.createComment(123, 'Starting implementation');
130
+ const workType = await work.classifyWorkType(issue); // 'feature' | 'bug' | 'chore'
160
131
  ```
161
132
 
162
- ### State Module (`@fractary/faber/state`)
163
-
164
- Workflow state persistence with checkpoints and recovery.
133
+ ### Repo Module
165
134
 
166
135
  ```typescript
167
- import { StateManager } from '@fractary/faber/state';
168
-
169
- const state = new StateManager();
170
-
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);
136
+ import { RepoManager } from '@fractary/faber/repo';
183
137
 
184
- // Manifests
185
- const manifest = state.createManifest(workflow.workflow_id, '123');
186
- state.addArtifactToManifest(manifest.manifest_id, { type: 'spec', path: '...' });
138
+ const repo = new RepoManager();
139
+ await repo.createBranch('feature/add-export', { base: 'main' });
140
+ await repo.createPR({ title: 'Add export feature', head: 'feature/add-export' });
141
+ await repo.commit({ message: 'Add feature', type: 'feat' });
187
142
  ```
188
143
 
189
- ### Workflow Module (`@fractary/faber/workflow`)
190
-
191
- Full FABER workflow orchestration.
144
+ ### Workflow Module
192
145
 
193
146
  ```typescript
194
147
  import { FaberWorkflow } from '@fractary/faber/workflow';
195
148
 
196
149
  const faber = new FaberWorkflow({
197
150
  config: {
198
- autonomy: 'assisted',
151
+ autonomy: 'guarded',
199
152
  phases: {
200
153
  frame: { enabled: true },
201
154
  architect: { enabled: true, refineSpec: true },
202
155
  build: { enabled: true },
203
156
  evaluate: { enabled: true, maxRetries: 3 },
204
- release: { enabled: true, requestReviews: true, reviewers: ['@team'] },
157
+ release: { enabled: true, requestReviews: true },
205
158
  },
206
159
  },
207
160
  });
@@ -211,75 +164,47 @@ faber.addEventListener((event, data) => {
211
164
  console.log(`${event}:`, data);
212
165
  });
213
166
 
214
- // User input callback for interactive mode
215
- faber.setUserInputCallback(async (request) => {
216
- // Prompt user and return response
217
- return 'yes';
218
- });
219
-
220
167
  // Run workflow
221
- const result = await faber.run({
222
- workId: '123',
223
- autonomy: 'assisted', // 'dry-run' | 'assisted' | 'guarded' | 'autonomous'
224
- });
225
-
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);
168
+ const result = await faber.run({ workId: '123' });
232
169
  ```
233
170
 
234
- ### Storage Module (`@fractary/faber/storage`)
235
-
236
- Artifact storage with optional Codex integration.
237
-
238
- ```typescript
239
- import { StorageManager } from '@fractary/faber/storage';
171
+ ## CLI Commands
240
172
 
241
- const storage = new StorageManager();
242
-
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
- }
173
+ ```bash
174
+ # Workflow
175
+ faber run <issue> [--autonomy <level>]
176
+ faber status <workflow-id>
177
+ faber resume <workflow-id>
178
+
179
+ # Work tracking
180
+ faber work fetch <issue>
181
+ faber work create --title "Feature" --type feature
182
+ faber work comment <issue> --body "Update"
183
+
184
+ # Repository
185
+ faber repo branch create <name>
186
+ faber repo pr create --title "Title" --head <branch>
187
+ faber repo commit --message "Message" --type feat
188
+
189
+ # Specifications
190
+ faber spec create "Title" --template feature
191
+ faber spec validate <spec-id>
192
+ faber spec refine <spec-id>
261
193
  ```
262
194
 
263
195
  ## Configuration
264
196
 
265
- Configuration files are stored at `.fractary/plugins/{module}/config.json`:
197
+ Configuration is stored in `.fractary/plugins/{module}/config.json`:
266
198
 
267
199
  ```
268
200
  .fractary/
269
201
  └── 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
202
+ ├── work/config.json
203
+ ├── repo/config.json
204
+ └── ...
280
205
  ```
281
206
 
282
- ### Work Config
207
+ Example work configuration:
283
208
 
284
209
  ```json
285
210
  {
@@ -289,102 +214,25 @@ Configuration files are stored at `.fractary/plugins/{module}/config.json`:
289
214
  }
290
215
  ```
291
216
 
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/"
304
- }
305
- }
306
- ```
307
-
308
- ## Autonomy Levels
309
-
310
- The SDK supports four autonomy levels:
311
-
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 |
318
-
319
- ## CLI Usage
320
-
321
- The SDK includes a CLI for direct usage:
322
-
323
- ```bash
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
344
- ```
345
-
346
217
  ## Platform Support
347
218
 
348
- ### Fully Implemented
349
- - **GitHub** - Issues, PRs, Git operations
219
+ | Platform | Work Tracking | Repository |
220
+ |----------|--------------|------------|
221
+ | GitHub | Full | Full |
222
+ | Jira | Planned | - |
223
+ | Linear | Planned | - |
224
+ | GitLab | - | Planned |
225
+ | Bitbucket | - | Planned |
350
226
 
351
- ### Stub (Interface Only)
352
- - **Jira** - Work tracking
353
- - **Linear** - Work tracking
354
- - **GitLab** - Repository operations
355
- - **Bitbucket** - Repository operations
227
+ ## Documentation
356
228
 
357
- ## Integration Example
358
-
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
- ```
229
+ | Document | Description |
230
+ |----------|-------------|
231
+ | [Vision](docs/vision/FABER-VISION.md) | Mission, philosophy, and strategic positioning |
232
+ | [SDK Architecture](specs/SPEC-00016-sdk-architecture.md) | Technical architecture overview |
233
+ | [LangGraph Integration](specs/SPEC-00025-langgraph-integration.md) | Graph-based workflow orchestration |
234
+ | [Intelligent Guardrails](specs/SPEC-00028-intelligent-guardrails.md) | Confidence-based autonomy system |
235
+ | [Multi-Workflow Orchestration](specs/SPEC-00027-multi-workflow-orchestration.md) | DAC foundation |
388
236
 
389
237
  ## Type Exports
390
238
 
@@ -392,45 +240,24 @@ All types are exported for TypeScript consumers:
392
240
 
393
241
  ```typescript
394
242
  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,
243
+ // Workflow
244
+ WorkflowConfig, WorkflowResult, PhaseResult, FaberPhase, AutonomyLevel,
245
+
246
+ // Work
247
+ Issue, IssueCreateOptions, Comment, Label, WorkType,
248
+
249
+ // Repo
250
+ PullRequest, PRCreateOptions, Branch, BranchCreateOptions,
251
+
252
+ // Spec
253
+ Specification, SpecTemplate, ValidationResult,
427
254
  } from '@fractary/faber';
428
255
  ```
429
256
 
430
257
  ## License
431
258
 
432
- MIT - see [LICENSE](LICENSE) file for details.
259
+ MIT - see [LICENSE](LICENSE) for details.
433
260
 
434
261
  ---
435
262
 
436
- **Part of the Fractary Ecosystem**
263
+ **Part of the [Fractary](https://fractary.dev) Ecosystem**
@@ -5,24 +5,51 @@
5
5
  * Uses runtime detection - no compile-time dependency on Codex.
6
6
  */
7
7
  import { Storage, FaberConfig } from '../types';
8
+ interface CodexConfig {
9
+ organization?: string;
10
+ directories?: {
11
+ specs?: string;
12
+ docs?: string;
13
+ logs?: string;
14
+ };
15
+ }
8
16
  /**
9
17
  * Adapter for @fractary/codex integration
10
18
  */
11
19
  export declare class CodexAdapter {
12
20
  private codex;
21
+ private cacheManager;
22
+ private storageManager;
23
+ private config;
13
24
  constructor();
14
25
  /**
15
26
  * Try to load @fractary/codex at runtime
16
27
  */
17
28
  private tryLoadCodex;
29
+ /**
30
+ * Initialize codex managers (lazy initialization)
31
+ */
32
+ private ensureInitialized;
18
33
  /**
19
34
  * Check if Codex is available
20
35
  */
21
36
  isAvailable(): boolean;
37
+ /**
38
+ * Get loaded config
39
+ */
40
+ getConfig(): Promise<CodexConfig>;
22
41
  /**
23
42
  * Check if Codex is enabled for a specific artifact type
24
43
  */
25
44
  isEnabledFor(artifactType: string): boolean;
45
+ /**
46
+ * Build a codex URI for an artifact
47
+ */
48
+ buildUri(type: string, id: string): string;
49
+ /**
50
+ * Detect current project name
51
+ */
52
+ private detectProject;
26
53
  /**
27
54
  * Store content via Codex
28
55
  */
@@ -37,8 +64,10 @@ export declare class CodexAdapter {
37
64
  exists(type: string, id: string): Promise<boolean>;
38
65
  /**
39
66
  * List content via Codex
67
+ * Note: Codex doesn't have a native list operation, so this returns empty
68
+ * In practice, listing should use local storage
40
69
  */
41
- list(type: string): Promise<string[]>;
70
+ list(_type: string): Promise<string[]>;
42
71
  /**
43
72
  * Delete content via Codex
44
73
  */
@@ -59,4 +88,5 @@ export declare class CodexAdapter {
59
88
  * Otherwise falls back to local storage.
60
89
  */
61
90
  export declare function createStorage(artifactType: 'specs' | 'logs' | 'state', config?: FaberConfig): Storage;
91
+ export {};
62
92
  //# sourceMappingURL=codex-adapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex-adapter.d.ts","sourceRoot":"","sources":["../../src/storage/codex-adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,C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;CAG/C;AA+CD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,YAAY,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,EACxC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAyBT"}
@@ -16,6 +16,9 @@ const config_1 = require("../config");
16
16
  */
17
17
  class CodexAdapter {
18
18
  codex = null;
19
+ cacheManager = null;
20
+ storageManager = null;
21
+ config = null;
19
22
  constructor() {
20
23
  this.codex = this.tryLoadCodex();
21
24
  }
@@ -27,77 +30,164 @@ class CodexAdapter {
27
30
  // Dynamic require - no compile-time dependency
28
31
  // eslint-disable-next-line @typescript-eslint/no-require-imports
29
32
  const codexModule = require('@fractary/codex');
30
- return new codexModule.Codex();
33
+ return codexModule;
31
34
  }
32
35
  catch {
33
36
  // Codex not installed - this is fine
34
37
  return null;
35
38
  }
36
39
  }
40
+ /**
41
+ * Initialize codex managers (lazy initialization)
42
+ */
43
+ async ensureInitialized() {
44
+ if (!this.codex) {
45
+ throw new errors_1.FaberError('Codex not available', 'CODEX_NOT_AVAILABLE', {});
46
+ }
47
+ if (!this.cacheManager) {
48
+ this.storageManager = this.codex.createStorageManager({
49
+ github: { token: process.env.GITHUB_TOKEN },
50
+ });
51
+ this.cacheManager = this.codex.createCacheManager({
52
+ cacheDir: '.fractary/plugins/faber/cache',
53
+ defaultTtl: 3600,
54
+ enablePersistence: true,
55
+ });
56
+ this.cacheManager.setStorageManager(this.storageManager);
57
+ }
58
+ if (!this.config) {
59
+ try {
60
+ this.config = await this.codex.loadConfig();
61
+ }
62
+ catch {
63
+ this.config = {};
64
+ }
65
+ }
66
+ }
37
67
  /**
38
68
  * Check if Codex is available
39
69
  */
40
70
  isAvailable() {
41
71
  return this.codex !== null;
42
72
  }
73
+ /**
74
+ * Get loaded config
75
+ */
76
+ async getConfig() {
77
+ await this.ensureInitialized();
78
+ return this.config || {};
79
+ }
43
80
  /**
44
81
  * Check if Codex is enabled for a specific artifact type
45
82
  */
46
83
  isEnabledFor(artifactType) {
47
84
  if (!this.codex)
48
85
  return false;
86
+ // Check if codex has directories configured for this type
87
+ const typeDirectoryMap = {
88
+ specs: 'specs',
89
+ logs: 'logs',
90
+ state: 'state',
91
+ };
92
+ return typeDirectoryMap[artifactType] !== undefined;
93
+ }
94
+ /**
95
+ * Build a codex URI for an artifact
96
+ */
97
+ buildUri(type, id) {
98
+ if (!this.codex) {
99
+ throw new errors_1.FaberError('Codex not available', 'CODEX_NOT_AVAILABLE', {});
100
+ }
101
+ // Get org from config or use 'local'
102
+ const org = this.config?.organization || 'local';
103
+ const project = this.detectProject();
104
+ const path = `${type}/${id}`;
105
+ return this.codex.buildUri(org, project, path);
106
+ }
107
+ /**
108
+ * Detect current project name
109
+ */
110
+ detectProject() {
49
111
  try {
50
- const config = this.codex.getConfig();
51
- return config.types?.[artifactType]?.enabled === true;
112
+ const root = (0, config_1.findProjectRoot)();
113
+ const parts = root.split('/');
114
+ return parts[parts.length - 1] || 'unknown';
52
115
  }
53
116
  catch {
54
- return false;
117
+ return 'unknown';
55
118
  }
56
119
  }
57
120
  /**
58
121
  * Store content via Codex
59
122
  */
60
123
  async store(type, id, content) {
61
- if (!this.codex) {
62
- throw new errors_1.FaberError('Codex not available', 'CODEX_NOT_AVAILABLE', {});
124
+ await this.ensureInitialized();
125
+ if (!this.cacheManager || !this.codex) {
126
+ throw new errors_1.FaberError('Codex not initialized', 'CODEX_NOT_AVAILABLE', {});
63
127
  }
64
- return this.codex.store(type, id, content);
128
+ const uri = this.buildUri(type, id);
129
+ // Create a FetchResult-like object for caching
130
+ const result = {
131
+ content: Buffer.from(content, 'utf-8'),
132
+ contentType: 'text/plain',
133
+ size: Buffer.byteLength(content, 'utf-8'),
134
+ source: 'faber',
135
+ };
136
+ await this.cacheManager.set(uri, result);
137
+ return uri;
65
138
  }
66
139
  /**
67
140
  * Retrieve content via Codex
68
141
  */
69
142
  async retrieve(type, id) {
70
- if (!this.codex) {
71
- throw new errors_1.FaberError('Codex not available', 'CODEX_NOT_AVAILABLE', {});
143
+ await this.ensureInitialized();
144
+ if (!this.cacheManager || !this.codex) {
145
+ throw new errors_1.FaberError('Codex not initialized', 'CODEX_NOT_AVAILABLE', {});
146
+ }
147
+ const uri = this.buildUri(type, id);
148
+ const reference = this.codex.resolveReference(uri);
149
+ if (!reference) {
150
+ return null;
151
+ }
152
+ try {
153
+ const result = await this.cacheManager.get(reference);
154
+ return result.content.toString('utf-8');
155
+ }
156
+ catch {
157
+ return null;
72
158
  }
73
- return this.codex.get(type, id);
74
159
  }
75
160
  /**
76
161
  * Check if content exists via Codex
77
162
  */
78
163
  async exists(type, id) {
79
- if (!this.codex) {
80
- throw new errors_1.FaberError('Codex not available', 'CODEX_NOT_AVAILABLE', {});
164
+ await this.ensureInitialized();
165
+ if (!this.cacheManager || !this.codex) {
166
+ throw new errors_1.FaberError('Codex not initialized', 'CODEX_NOT_AVAILABLE', {});
81
167
  }
82
- return this.codex.exists(type, id);
168
+ const uri = this.buildUri(type, id);
169
+ return this.cacheManager.has(uri);
83
170
  }
84
171
  /**
85
172
  * List content via Codex
173
+ * Note: Codex doesn't have a native list operation, so this returns empty
174
+ * In practice, listing should use local storage
86
175
  */
87
- async list(type) {
88
- if (!this.codex) {
89
- throw new errors_1.FaberError('Codex not available', 'CODEX_NOT_AVAILABLE', {});
90
- }
91
- return this.codex.list(type);
176
+ async list(_type) {
177
+ // Codex cache doesn't support listing by type
178
+ // This would require filesystem operations on the cache directory
179
+ return [];
92
180
  }
93
181
  /**
94
182
  * Delete content via Codex
95
183
  */
96
184
  async delete(type, id) {
97
- if (!this.codex) {
98
- throw new errors_1.FaberError('Codex not available', 'CODEX_NOT_AVAILABLE', {});
185
+ await this.ensureInitialized();
186
+ if (!this.cacheManager || !this.codex) {
187
+ throw new errors_1.FaberError('Codex not initialized', 'CODEX_NOT_AVAILABLE', {});
99
188
  }
100
- return this.codex.delete(type, id);
189
+ const uri = this.buildUri(type, id);
190
+ await this.cacheManager.invalidate(uri);
101
191
  }
102
192
  /**
103
193
  * Get a Codex reference URI
@@ -1 +1 @@
1
- {"version":3,"file":"codex-adapter.js","sourceRoot":"","sources":["../../src/storage/codex-adapter.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAoLH,sCA4BC;AA7MD,sCAAuC;AACvC,mCAAuC;AACvC,sCAA4C;AAgB5C;;GAEG;AACH,MAAa,YAAY;IACf,KAAK,GAAyB,IAAI,CAAC;IAE3C;QACE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IACnC,CAAC;IAED;;OAEG;IACK,YAAY;QAClB,IAAI,CAAC;YACH,+CAA+C;YAC/C,iEAAiE;YACjE,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAgB,CAAC;YAC9D,OAAO,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;QACjC,CAAC;QAAC,MAAM,CAAC;YACP,qCAAqC;YACrC,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED;;OAEG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,YAAoB;QAC/B,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAE9B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YACtC,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;QACxD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,IAAY,EAAE,EAAU,EAAE,OAAe;QACnD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,mBAAU,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,EAAE,CAAC,CAAC;Q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
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "FABER SDK - Development toolkit for AI-assisted workflows",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",