@fractary/codex-mcp 0.7.1 → 0.9.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 +63 -0
- package/dist/cli.cjs +638 -9
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +131 -2
- package/dist/index.cjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -64,23 +64,86 @@ The server exposes an SSE (Server-Sent Events) endpoint for HTTP clients.
|
|
|
64
64
|
Create a `.fractary/codex/config.yaml` configuration file:
|
|
65
65
|
|
|
66
66
|
```yaml
|
|
67
|
+
# Organization configuration
|
|
68
|
+
organizationSlug: fractary
|
|
69
|
+
|
|
70
|
+
# Cache configuration
|
|
67
71
|
cache:
|
|
68
72
|
dir: .fractary/codex/cache
|
|
69
73
|
maxMemorySize: 104857600 # 100 MB
|
|
70
74
|
defaultTtl: 3600 # 1 hour
|
|
71
75
|
|
|
76
|
+
# Storage providers
|
|
72
77
|
storage:
|
|
73
78
|
providers:
|
|
74
79
|
- type: local
|
|
75
80
|
basePath: ./knowledge
|
|
76
81
|
- type: github
|
|
77
82
|
token: ${GITHUB_TOKEN}
|
|
83
|
+
|
|
84
|
+
# Archive configuration (optional)
|
|
85
|
+
# Enables transparent access to archived documents in S3/R2/GCS
|
|
86
|
+
archive:
|
|
87
|
+
projects:
|
|
88
|
+
fractary/auth-service:
|
|
89
|
+
enabled: true
|
|
90
|
+
handler: s3 # s3, r2, gcs, or local
|
|
91
|
+
bucket: fractary-archives
|
|
92
|
+
patterns: # Optional: limit to specific patterns
|
|
93
|
+
- specs/**
|
|
94
|
+
- docs/**
|
|
95
|
+
fractary/api-gateway:
|
|
96
|
+
enabled: true
|
|
97
|
+
handler: r2
|
|
98
|
+
bucket: api-archives
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Archive Configuration
|
|
102
|
+
|
|
103
|
+
The archive feature enables transparent access to archived documents stored in cloud storage (S3, R2, GCS). When enabled, Codex automatically falls back to the archive when documents are not found locally or in GitHub.
|
|
104
|
+
|
|
105
|
+
**Key Features:**
|
|
106
|
+
- **Transparent URIs**: Same `codex://org/project/path` URI works for both active and archived documents
|
|
107
|
+
- **Storage Priority**: Local → Archive → GitHub → HTTP (automatic fallback)
|
|
108
|
+
- **Per-Project Config**: Different projects can use different storage backends and buckets
|
|
109
|
+
- **Pattern Matching**: Optional patterns limit which files are archived
|
|
110
|
+
|
|
111
|
+
**Configuration Fields:**
|
|
112
|
+
- `enabled`: Boolean - Whether archive is active for this project
|
|
113
|
+
- `handler`: String - Storage backend: `s3`, `r2`, `gcs`, or `local`
|
|
114
|
+
- `bucket`: String (optional) - Cloud storage bucket name
|
|
115
|
+
- `prefix`: String (optional) - Path prefix in bucket (default: `archive/`)
|
|
116
|
+
- `patterns`: Array (optional) - Glob patterns to match (e.g., `specs/**`, `*.md`)
|
|
117
|
+
|
|
118
|
+
**Archive Path Structure:**
|
|
119
|
+
```
|
|
120
|
+
archive/{type}/{org}/{project}/{original-path}
|
|
121
|
+
|
|
122
|
+
Examples:
|
|
123
|
+
specs/WORK-123.md → archive/specs/fractary/auth-service/specs/WORK-123.md
|
|
124
|
+
docs/api.md → archive/docs/fractary/auth-service/docs/api.md
|
|
78
125
|
```
|
|
79
126
|
|
|
127
|
+
**Example Usage:**
|
|
128
|
+
```typescript
|
|
129
|
+
// Reference archived spec (same URI as before archiving)
|
|
130
|
+
const result = await fetch('codex://fractary/auth-service/specs/WORK-123.md')
|
|
131
|
+
// Codex checks: local → S3 archive → GitHub → HTTP
|
|
132
|
+
// Returns content from archive if not found locally
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Requirements:**
|
|
136
|
+
- [fractary CLI](https://github.com/fractary/cli) installed and configured
|
|
137
|
+
- Cloud storage credentials (AWS credentials for S3, Cloudflare for R2, etc.)
|
|
138
|
+
- Archive structure must mirror project structure
|
|
139
|
+
|
|
80
140
|
### Environment Variables
|
|
81
141
|
|
|
82
142
|
- `FRACTARY_CONFIG`: Path to configuration file (default: `.fractary/codex/config.yaml`)
|
|
83
143
|
- `GITHUB_TOKEN`: GitHub personal access token for GitHub storage provider
|
|
144
|
+
- `FRACTARY_CLI`: Path to fractary CLI executable (default: `fractary`)
|
|
145
|
+
- `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`: AWS credentials for S3
|
|
146
|
+
- `CLOUDFLARE_ACCOUNT_ID`, `CLOUDFLARE_API_TOKEN`: Cloudflare credentials for R2
|
|
84
147
|
|
|
85
148
|
## Available Tools
|
|
86
149
|
|