@fractary/core 0.1.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/LICENSE +21 -0
- package/README.md +169 -0
- package/dist/__tests__/smoke.test.d.ts +7 -0
- package/dist/__tests__/smoke.test.d.ts.map +1 -0
- package/dist/__tests__/smoke.test.js +132 -0
- package/dist/__tests__/smoke.test.js.map +1 -0
- package/dist/common/config.d.ts +30 -0
- package/dist/common/config.d.ts.map +1 -0
- package/dist/common/config.js +120 -0
- package/dist/common/config.js.map +1 -0
- package/dist/common/errors.d.ts +264 -0
- package/dist/common/errors.d.ts.map +1 -0
- package/dist/common/errors.js +491 -0
- package/dist/common/errors.js.map +1 -0
- package/dist/common/index.d.ts +9 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +25 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/types.d.ts +622 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/types.js +8 -0
- package/dist/common/types.js.map +1 -0
- package/dist/docs/index.d.ts +8 -0
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +26 -0
- package/dist/docs/index.js.map +1 -0
- package/dist/docs/manager.d.ts +47 -0
- package/dist/docs/manager.d.ts.map +1 -0
- package/dist/docs/manager.js +250 -0
- package/dist/docs/manager.js.map +1 -0
- package/dist/docs/types.d.ts +113 -0
- package/dist/docs/types.d.ts.map +1 -0
- package/dist/docs/types.js +8 -0
- package/dist/docs/types.js.map +1 -0
- package/dist/file/index.d.ts +9 -0
- package/dist/file/index.d.ts.map +1 -0
- package/dist/file/index.js +28 -0
- package/dist/file/index.js.map +1 -0
- package/dist/file/local.d.ts +42 -0
- package/dist/file/local.d.ts.map +1 -0
- package/dist/file/local.js +137 -0
- package/dist/file/local.js.map +1 -0
- package/dist/file/manager.d.ts +42 -0
- package/dist/file/manager.d.ts.map +1 -0
- package/dist/file/manager.js +68 -0
- package/dist/file/manager.js.map +1 -0
- package/dist/file/types.d.ts +52 -0
- package/dist/file/types.d.ts.map +1 -0
- package/dist/file/types.js +8 -0
- package/dist/file/types.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/logs/index.d.ts +8 -0
- package/dist/logs/index.d.ts.map +1 -0
- package/dist/logs/index.js +26 -0
- package/dist/logs/index.js.map +1 -0
- package/dist/logs/manager.d.ts +97 -0
- package/dist/logs/manager.d.ts.map +1 -0
- package/dist/logs/manager.js +584 -0
- package/dist/logs/manager.js.map +1 -0
- package/dist/logs/types.d.ts +45 -0
- package/dist/logs/types.d.ts.map +1 -0
- package/dist/logs/types.js +8 -0
- package/dist/logs/types.js.map +1 -0
- package/dist/repo/git.d.ts +182 -0
- package/dist/repo/git.d.ts.map +1 -0
- package/dist/repo/git.js +496 -0
- package/dist/repo/git.js.map +1 -0
- package/dist/repo/index.d.ts +10 -0
- package/dist/repo/index.d.ts.map +1 -0
- package/dist/repo/index.js +29 -0
- package/dist/repo/index.js.map +1 -0
- package/dist/repo/manager.d.ts +179 -0
- package/dist/repo/manager.d.ts.map +1 -0
- package/dist/repo/manager.js +433 -0
- package/dist/repo/manager.js.map +1 -0
- package/dist/repo/providers/bitbucket.d.ts +48 -0
- package/dist/repo/providers/bitbucket.d.ts.map +1 -0
- package/dist/repo/providers/bitbucket.js +86 -0
- package/dist/repo/providers/bitbucket.js.map +1 -0
- package/dist/repo/providers/github.d.ts +30 -0
- package/dist/repo/providers/github.d.ts.map +1 -0
- package/dist/repo/providers/github.js +311 -0
- package/dist/repo/providers/github.js.map +1 -0
- package/dist/repo/providers/gitlab.d.ts +47 -0
- package/dist/repo/providers/gitlab.d.ts.map +1 -0
- package/dist/repo/providers/gitlab.js +84 -0
- package/dist/repo/providers/gitlab.js.map +1 -0
- package/dist/repo/providers/index.d.ts +9 -0
- package/dist/repo/providers/index.d.ts.map +1 -0
- package/dist/repo/providers/index.js +15 -0
- package/dist/repo/providers/index.js.map +1 -0
- package/dist/repo/types.d.ts +48 -0
- package/dist/repo/types.d.ts.map +1 -0
- package/dist/repo/types.js +8 -0
- package/dist/repo/types.js.map +1 -0
- package/dist/spec/index.d.ts +9 -0
- package/dist/spec/index.d.ts.map +1 -0
- package/dist/spec/index.js +30 -0
- package/dist/spec/index.js.map +1 -0
- package/dist/spec/manager.d.ts +106 -0
- package/dist/spec/manager.d.ts.map +1 -0
- package/dist/spec/manager.js +672 -0
- package/dist/spec/manager.js.map +1 -0
- package/dist/spec/templates.d.ts +28 -0
- package/dist/spec/templates.d.ts.map +1 -0
- package/dist/spec/templates.js +357 -0
- package/dist/spec/templates.js.map +1 -0
- package/dist/spec/types.d.ts +53 -0
- package/dist/spec/types.d.ts.map +1 -0
- package/dist/spec/types.js +8 -0
- package/dist/spec/types.js.map +1 -0
- package/dist/work/index.d.ts +8 -0
- package/dist/work/index.d.ts.map +1 -0
- package/dist/work/index.js +26 -0
- package/dist/work/index.js.map +1 -0
- package/dist/work/manager.d.ts +112 -0
- package/dist/work/manager.d.ts.map +1 -0
- package/dist/work/manager.js +227 -0
- package/dist/work/manager.js.map +1 -0
- package/dist/work/providers/github.d.ts +40 -0
- package/dist/work/providers/github.d.ts.map +1 -0
- package/dist/work/providers/github.js +299 -0
- package/dist/work/providers/github.js.map +1 -0
- package/dist/work/providers/jira.d.ts +60 -0
- package/dist/work/providers/jira.d.ts.map +1 -0
- package/dist/work/providers/jira.js +109 -0
- package/dist/work/providers/jira.js.map +1 -0
- package/dist/work/providers/linear.d.ts +57 -0
- package/dist/work/providers/linear.d.ts.map +1 -0
- package/dist/work/providers/linear.js +103 -0
- package/dist/work/providers/linear.js.map +1 -0
- package/dist/work/types.d.ts +42 -0
- package/dist/work/types.d.ts.map +1 -0
- package/dist/work/types.js +8 -0
- package/dist/work/types.js.map +1 -0
- package/package.json +102 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Fractary Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# @fractary/core
|
|
2
|
+
|
|
3
|
+
Fractary Core SDK - Primitive operations for work tracking, repository management, specifications, logging, file storage, and documentation.
|
|
4
|
+
|
|
5
|
+
> **⚠️ Alpha Release (v0.1.0)** - This is an early-stage release with limited platform support. Only GitHub is fully implemented. Other providers (Bitbucket, GitLab, Jira, Linear) are included as stubs for future compatibility but will throw errors if used.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
`@fractary/core` provides foundational SDKs for common development operations across multiple platforms and services. This package is designed to be used by higher-level frameworks like `@fractary/faber` and can also be used standalone for building custom workflows.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
### Work Tracking
|
|
14
|
+
Unified interface for work item management:
|
|
15
|
+
- ✅ **GitHub Issues** - Fully implemented
|
|
16
|
+
- ⚠️ **Jira Cloud** - Stub only (not functional)
|
|
17
|
+
- ⚠️ **Linear** - Stub only (not functional)
|
|
18
|
+
|
|
19
|
+
### Repository Management
|
|
20
|
+
Git and repository operations:
|
|
21
|
+
- ✅ **GitHub** - Fully implemented
|
|
22
|
+
- ⚠️ **GitLab** - Stub only (not functional)
|
|
23
|
+
- ⚠️ **Bitbucket** - Stub only (not functional)
|
|
24
|
+
- ✅ **Local Git operations** - Fully implemented
|
|
25
|
+
|
|
26
|
+
### Specification Management
|
|
27
|
+
Create and manage technical specifications with templates and validation.
|
|
28
|
+
|
|
29
|
+
### Logging
|
|
30
|
+
Structured logging and session capture for workflow tracking.
|
|
31
|
+
|
|
32
|
+
### File Storage
|
|
33
|
+
File operations with support for local and cloud storage backends.
|
|
34
|
+
|
|
35
|
+
### Documentation
|
|
36
|
+
Documentation generation and management utilities.
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install @fractary/core
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
### Work Tracking
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { WorkManager } from '@fractary/core/work';
|
|
50
|
+
|
|
51
|
+
const workManager = new WorkManager({
|
|
52
|
+
platform: 'github',
|
|
53
|
+
config: {
|
|
54
|
+
owner: 'myorg',
|
|
55
|
+
repo: 'myrepo',
|
|
56
|
+
token: process.env.GITHUB_TOKEN
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Create an issue
|
|
61
|
+
const issue = await workManager.createIssue({
|
|
62
|
+
title: 'Add new feature',
|
|
63
|
+
description: 'Description of the feature',
|
|
64
|
+
labels: ['enhancement']
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Repository Management
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import { RepoManager } from '@fractary/core/repo';
|
|
72
|
+
|
|
73
|
+
const repoManager = new RepoManager({
|
|
74
|
+
platform: 'github',
|
|
75
|
+
config: {
|
|
76
|
+
owner: 'myorg',
|
|
77
|
+
repo: 'myrepo',
|
|
78
|
+
token: process.env.GITHUB_TOKEN
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Create a branch
|
|
83
|
+
await repoManager.createBranch({
|
|
84
|
+
name: 'feature/new-feature',
|
|
85
|
+
from: 'main'
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// Create a pull request
|
|
89
|
+
const pr = await repoManager.createPullRequest({
|
|
90
|
+
title: 'Add new feature',
|
|
91
|
+
head: 'feature/new-feature',
|
|
92
|
+
base: 'main',
|
|
93
|
+
body: 'PR description'
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Specification Management
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
import { SpecManager } from '@fractary/core/spec';
|
|
101
|
+
|
|
102
|
+
const specManager = new SpecManager({
|
|
103
|
+
rootDir: './specs'
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// Create a new spec
|
|
107
|
+
await specManager.createSpec({
|
|
108
|
+
id: 'SPEC-001',
|
|
109
|
+
title: 'Authentication System',
|
|
110
|
+
template: 'technical'
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Logging
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
import { LogsManager } from '@fractary/core/logs';
|
|
118
|
+
|
|
119
|
+
const logsManager = new LogsManager({
|
|
120
|
+
logDir: './logs'
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
// Start a session
|
|
124
|
+
const sessionId = await logsManager.startSession({
|
|
125
|
+
name: 'deployment',
|
|
126
|
+
metadata: { version: '1.0.0' }
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// Log events
|
|
130
|
+
await logsManager.log(sessionId, {
|
|
131
|
+
level: 'info',
|
|
132
|
+
message: 'Deployment started'
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Module Exports
|
|
137
|
+
|
|
138
|
+
The package provides the following subpath exports:
|
|
139
|
+
|
|
140
|
+
- `@fractary/core` - All primitives
|
|
141
|
+
- `@fractary/core/work` - Work tracking only
|
|
142
|
+
- `@fractary/core/repo` - Repository management only
|
|
143
|
+
- `@fractary/core/spec` - Specification management only
|
|
144
|
+
- `@fractary/core/logs` - Logging only
|
|
145
|
+
- `@fractary/core/file` - File storage only
|
|
146
|
+
- `@fractary/core/docs` - Documentation only
|
|
147
|
+
|
|
148
|
+
## TypeScript Support
|
|
149
|
+
|
|
150
|
+
This package is written in TypeScript and includes type definitions. TypeScript 5.0+ is recommended.
|
|
151
|
+
|
|
152
|
+
## Requirements
|
|
153
|
+
|
|
154
|
+
- Node.js 18.0.0 or higher
|
|
155
|
+
- npm 9.0.0 or higher
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
MIT
|
|
160
|
+
|
|
161
|
+
## Contributing
|
|
162
|
+
|
|
163
|
+
See the [Contributing Guide](../../CONTRIBUTING.md) for details on how to contribute to this project.
|
|
164
|
+
|
|
165
|
+
## Links
|
|
166
|
+
|
|
167
|
+
- [GitHub Repository](https://github.com/fractary/core)
|
|
168
|
+
- [Documentation](https://docs.fractary.com/core)
|
|
169
|
+
- [Issue Tracker](https://github.com/fractary/core/issues)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smoke.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/smoke.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Smoke tests for @fractary/core
|
|
4
|
+
*
|
|
5
|
+
* These tests verify basic functionality and module imports.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
const manager_1 = require("../work/manager");
|
|
9
|
+
const manager_2 = require("../repo/manager");
|
|
10
|
+
const manager_3 = require("../spec/manager");
|
|
11
|
+
const manager_4 = require("../logs/manager");
|
|
12
|
+
const manager_5 = require("../file/manager");
|
|
13
|
+
const manager_6 = require("../docs/manager");
|
|
14
|
+
describe('Fractary Core SDK - Smoke Tests', () => {
|
|
15
|
+
describe('Module Imports', () => {
|
|
16
|
+
it('should import WorkManager', () => {
|
|
17
|
+
expect(manager_1.WorkManager).toBeDefined();
|
|
18
|
+
});
|
|
19
|
+
it('should import RepoManager', () => {
|
|
20
|
+
expect(manager_2.RepoManager).toBeDefined();
|
|
21
|
+
});
|
|
22
|
+
it('should import SpecManager', () => {
|
|
23
|
+
expect(manager_3.SpecManager).toBeDefined();
|
|
24
|
+
});
|
|
25
|
+
it('should import LogManager', () => {
|
|
26
|
+
expect(manager_4.LogManager).toBeDefined();
|
|
27
|
+
});
|
|
28
|
+
it('should import FileManager', () => {
|
|
29
|
+
expect(manager_5.FileManager).toBeDefined();
|
|
30
|
+
});
|
|
31
|
+
it('should import DocsManager', () => {
|
|
32
|
+
expect(manager_6.DocsManager).toBeDefined();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
describe('Manager Instantiation', () => {
|
|
36
|
+
it('should create WorkManager with GitHub config', () => {
|
|
37
|
+
const config = {
|
|
38
|
+
platform: 'github',
|
|
39
|
+
owner: 'test-org',
|
|
40
|
+
repo: 'test-repo',
|
|
41
|
+
token: 'test-token',
|
|
42
|
+
};
|
|
43
|
+
const manager = new manager_1.WorkManager(config);
|
|
44
|
+
expect(manager).toBeInstanceOf(manager_1.WorkManager);
|
|
45
|
+
});
|
|
46
|
+
it('should create RepoManager with GitHub config', () => {
|
|
47
|
+
const config = {
|
|
48
|
+
platform: 'github',
|
|
49
|
+
owner: 'test-org',
|
|
50
|
+
repo: 'test-repo',
|
|
51
|
+
token: 'test-token',
|
|
52
|
+
defaultBranch: 'main',
|
|
53
|
+
};
|
|
54
|
+
const manager = new manager_2.RepoManager(config);
|
|
55
|
+
expect(manager).toBeInstanceOf(manager_2.RepoManager);
|
|
56
|
+
});
|
|
57
|
+
it('should create SpecManager with config', () => {
|
|
58
|
+
const config = { localPath: '.fractary/specs' };
|
|
59
|
+
const manager = new manager_3.SpecManager(config);
|
|
60
|
+
expect(manager).toBeInstanceOf(manager_3.SpecManager);
|
|
61
|
+
});
|
|
62
|
+
it('should create LogManager with config', () => {
|
|
63
|
+
const config = { localPath: '.fractary/logs' };
|
|
64
|
+
const manager = new manager_4.LogManager(config);
|
|
65
|
+
expect(manager).toBeInstanceOf(manager_4.LogManager);
|
|
66
|
+
});
|
|
67
|
+
it('should create FileManager with config', () => {
|
|
68
|
+
const config = { basePath: '.fractary/storage' };
|
|
69
|
+
const manager = new manager_5.FileManager(config);
|
|
70
|
+
expect(manager).toBeInstanceOf(manager_5.FileManager);
|
|
71
|
+
});
|
|
72
|
+
it('should create DocsManager with config', () => {
|
|
73
|
+
const config = { docsDir: '.fractary/docs' };
|
|
74
|
+
const manager = new manager_6.DocsManager(config);
|
|
75
|
+
expect(manager).toBeInstanceOf(manager_6.DocsManager);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
describe('Provider Validation', () => {
|
|
79
|
+
it('should reject unsupported work platform', () => {
|
|
80
|
+
const config = {
|
|
81
|
+
platform: 'unsupported',
|
|
82
|
+
owner: 'test-org',
|
|
83
|
+
repo: 'test-repo',
|
|
84
|
+
};
|
|
85
|
+
expect(() => new manager_1.WorkManager(config)).toThrow();
|
|
86
|
+
});
|
|
87
|
+
it('should reject unsupported repo platform', () => {
|
|
88
|
+
const config = {
|
|
89
|
+
platform: 'unsupported',
|
|
90
|
+
owner: 'test-org',
|
|
91
|
+
repo: 'test-repo',
|
|
92
|
+
};
|
|
93
|
+
expect(() => new manager_2.RepoManager(config)).toThrow();
|
|
94
|
+
});
|
|
95
|
+
it('should throw error for Jira provider (not implemented)', () => {
|
|
96
|
+
const config = {
|
|
97
|
+
platform: 'jira',
|
|
98
|
+
host: 'test.atlassian.net',
|
|
99
|
+
project: 'TEST',
|
|
100
|
+
};
|
|
101
|
+
// Jira provider should throw since it's a stub
|
|
102
|
+
expect(() => new manager_1.WorkManager(config)).toThrow();
|
|
103
|
+
});
|
|
104
|
+
it('should throw error for Linear provider (not implemented)', () => {
|
|
105
|
+
const config = {
|
|
106
|
+
platform: 'linear',
|
|
107
|
+
teamId: 'test-team',
|
|
108
|
+
};
|
|
109
|
+
// Linear provider should throw since it's a stub
|
|
110
|
+
expect(() => new manager_1.WorkManager(config)).toThrow();
|
|
111
|
+
});
|
|
112
|
+
it('should throw error for GitLab provider (not implemented)', () => {
|
|
113
|
+
const config = {
|
|
114
|
+
platform: 'gitlab',
|
|
115
|
+
owner: 'test-org',
|
|
116
|
+
repo: 'test-repo',
|
|
117
|
+
};
|
|
118
|
+
// GitLab provider should throw since it's a stub
|
|
119
|
+
expect(() => new manager_2.RepoManager(config)).toThrow();
|
|
120
|
+
});
|
|
121
|
+
it('should throw error for Bitbucket provider (not implemented)', () => {
|
|
122
|
+
const config = {
|
|
123
|
+
platform: 'bitbucket',
|
|
124
|
+
owner: 'test-workspace',
|
|
125
|
+
repo: 'test-repo',
|
|
126
|
+
};
|
|
127
|
+
// Bitbucket provider should throw since it's a stub
|
|
128
|
+
expect(() => new manager_2.RepoManager(config)).toThrow();
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
//# sourceMappingURL=smoke.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smoke.test.js","sourceRoot":"","sources":["../../src/__tests__/smoke.test.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAEH,6CAA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GAAG,EAAE;YAClE,MAAM,MAAM,GAAG;gBACb,QAAQ,EAAE,QAAiB;gBAC3B,MAAM,EAAE,WAAW;aACpB,CAAC;YACF,iDAAiD;YACjD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,qBAAW,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;YAClE,MAAM,MAAM,GAAG;gBACb,QAAQ,EAAE,QAAiB;gBAC3B,KAAK,EAAE,UAAU;gBACjB,IAAI,EAAE,WAAW;aAClB,CAAC;YACF,iDAAiD;YACjD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,qBAAW,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;YACrE,MAAM,MAAM,GAAG;gBACb,QAAQ,EAAE,WAAoB;gBAC9B,KAAK,EAAE,gBAAgB;gBACvB,IAAI,EAAE,WAAW;aAClB,CAAC;YACF,oDAAoD;YACpD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,qBAAW,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fractary/core - Configuration Utilities
|
|
3
|
+
*
|
|
4
|
+
* Utilities for finding project roots and loading configuration.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Find the project root directory by looking for common markers
|
|
8
|
+
*/
|
|
9
|
+
export declare function findProjectRoot(startDir?: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Check if a directory is a git repository
|
|
12
|
+
*/
|
|
13
|
+
export declare function isGitRepository(dir?: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Get the .fractary directory path
|
|
16
|
+
*/
|
|
17
|
+
export declare function getFractaryDir(projectRoot?: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Ensure a directory exists
|
|
20
|
+
*/
|
|
21
|
+
export declare function ensureDir(dirPath: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Stub config loaders - these return null to indicate no config found
|
|
24
|
+
* Individual SDKs will use sensible defaults
|
|
25
|
+
*/
|
|
26
|
+
export declare function loadWorkConfig(..._args: unknown[]): null;
|
|
27
|
+
export declare function loadRepoConfig(..._args: unknown[]): null;
|
|
28
|
+
export declare function loadSpecConfig(..._args: unknown[]): null;
|
|
29
|
+
export declare function loadLogConfig(..._args: unknown[]): null;
|
|
30
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/common/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,CA2BxE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAGpE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI/C;AAED;;;GAGG;AAGH,wBAAgB,cAAc,CAAC,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,CAExD;AAGD,wBAAgB,cAAc,CAAC,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,CAExD;AAGD,wBAAgB,cAAc,CAAC,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,CAExD;AAGD,wBAAgB,aAAa,CAAC,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,CAEvD"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fractary/core - Configuration Utilities
|
|
4
|
+
*
|
|
5
|
+
* Utilities for finding project roots and loading configuration.
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
+
}) : function(o, v) {
|
|
21
|
+
o["default"] = v;
|
|
22
|
+
});
|
|
23
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
+
var ownKeys = function(o) {
|
|
25
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
+
var ar = [];
|
|
27
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
|
+
return ownKeys(o);
|
|
31
|
+
};
|
|
32
|
+
return function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.findProjectRoot = findProjectRoot;
|
|
42
|
+
exports.isGitRepository = isGitRepository;
|
|
43
|
+
exports.getFractaryDir = getFractaryDir;
|
|
44
|
+
exports.ensureDir = ensureDir;
|
|
45
|
+
exports.loadWorkConfig = loadWorkConfig;
|
|
46
|
+
exports.loadRepoConfig = loadRepoConfig;
|
|
47
|
+
exports.loadSpecConfig = loadSpecConfig;
|
|
48
|
+
exports.loadLogConfig = loadLogConfig;
|
|
49
|
+
const fs = __importStar(require("fs"));
|
|
50
|
+
const path = __importStar(require("path"));
|
|
51
|
+
/**
|
|
52
|
+
* Find the project root directory by looking for common markers
|
|
53
|
+
*/
|
|
54
|
+
function findProjectRoot(startDir = process.cwd()) {
|
|
55
|
+
let currentDir = startDir;
|
|
56
|
+
// Common project root markers
|
|
57
|
+
const markers = [
|
|
58
|
+
'package.json',
|
|
59
|
+
'.git',
|
|
60
|
+
'tsconfig.json',
|
|
61
|
+
'pyproject.toml',
|
|
62
|
+
'setup.py',
|
|
63
|
+
];
|
|
64
|
+
while (currentDir !== path.parse(currentDir).root) {
|
|
65
|
+
// Check if any marker exists in current directory
|
|
66
|
+
for (const marker of markers) {
|
|
67
|
+
const markerPath = path.join(currentDir, marker);
|
|
68
|
+
if (fs.existsSync(markerPath)) {
|
|
69
|
+
return currentDir;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Move up one directory
|
|
73
|
+
currentDir = path.dirname(currentDir);
|
|
74
|
+
}
|
|
75
|
+
// If no marker found, return the starting directory
|
|
76
|
+
return startDir;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Check if a directory is a git repository
|
|
80
|
+
*/
|
|
81
|
+
function isGitRepository(dir = process.cwd()) {
|
|
82
|
+
const gitDir = path.join(dir, '.git');
|
|
83
|
+
return fs.existsSync(gitDir);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get the .fractary directory path
|
|
87
|
+
*/
|
|
88
|
+
function getFractaryDir(projectRoot) {
|
|
89
|
+
const root = projectRoot || findProjectRoot();
|
|
90
|
+
return path.join(root, '.fractary');
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Ensure a directory exists
|
|
94
|
+
*/
|
|
95
|
+
function ensureDir(dirPath) {
|
|
96
|
+
if (!fs.existsSync(dirPath)) {
|
|
97
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Stub config loaders - these return null to indicate no config found
|
|
102
|
+
* Individual SDKs will use sensible defaults
|
|
103
|
+
*/
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
105
|
+
function loadWorkConfig(..._args) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
109
|
+
function loadRepoConfig(..._args) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
113
|
+
function loadSpecConfig(..._args) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
117
|
+
function loadLogConfig(..._args) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/common/config.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQH,0CA2BC;AAKD,0CAGC;AAKD,wCAGC;AAKD,8BAIC;AAQD,wCAEC;AAGD,wCAEC;AAGD,wCAEC;AAGD,sCAEC;AAnFD,uCAAyB;AACzB,2CAA6B;AAE7B;;GAEG;AACH,SAAgB,eAAe,CAAC,WAAmB,OAAO,CAAC,GAAG,EAAE;IAC9D,IAAI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