@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.
- package/README.md +366 -76
- package/dist/cli/commands/logs.d.ts +6 -0
- package/dist/cli/commands/logs.d.ts.map +1 -0
- package/dist/cli/commands/logs.js +215 -0
- package/dist/cli/commands/logs.js.map +1 -0
- package/dist/cli/commands/repo.d.ts +6 -0
- package/dist/cli/commands/repo.d.ts.map +1 -0
- package/dist/cli/commands/repo.js +260 -0
- package/dist/cli/commands/repo.js.map +1 -0
- package/dist/cli/commands/spec.d.ts +6 -0
- package/dist/cli/commands/spec.d.ts.map +1 -0
- package/dist/cli/commands/spec.js +184 -0
- package/dist/cli/commands/spec.js.map +1 -0
- package/dist/cli/commands/work.d.ts +6 -0
- package/dist/cli/commands/work.d.ts.map +1 -0
- package/dist/cli/commands/work.js +113 -0
- package/dist/cli/commands/work.js.map +1 -0
- package/dist/cli/commands/workflow.d.ts +6 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +214 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +27 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config.d.ts +814 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +438 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +264 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +491 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +21 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -36
- package/dist/index.js.map +1 -1
- package/dist/logs/index.d.ts +8 -0
- package/dist/logs/index.d.ts.map +1 -0
- package/dist/{types → logs}/index.js +7 -11
- 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 +581 -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 +38 -0
- package/dist/repo/providers/bitbucket.d.ts.map +1 -0
- package/dist/repo/providers/bitbucket.js +76 -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 +37 -0
- package/dist/repo/providers/gitlab.d.ts.map +1 -0
- package/dist/repo/providers/gitlab.js +74 -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 +47 -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 +98 -0
- package/dist/spec/manager.d.ts.map +1 -0
- package/dist/spec/manager.js +650 -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/state/index.d.ts +8 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +26 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/manager.d.ts +132 -0
- package/dist/state/manager.d.ts.map +1 -0
- package/dist/state/manager.js +517 -0
- package/dist/state/manager.js.map +1 -0
- package/dist/state/types.d.ts +46 -0
- package/dist/state/types.d.ts.map +1 -0
- package/dist/state/types.js +8 -0
- package/dist/state/types.js.map +1 -0
- package/dist/storage/codex-adapter.d.ts +62 -0
- package/dist/storage/codex-adapter.d.ts.map +1 -0
- package/dist/storage/codex-adapter.js +177 -0
- package/dist/storage/codex-adapter.js.map +1 -0
- package/dist/storage/index.d.ts +9 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +15 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/local.d.ts +42 -0
- package/dist/storage/local.d.ts.map +1 -0
- package/dist/storage/local.js +137 -0
- package/dist/storage/local.js.map +1 -0
- package/dist/types.d.ts +603 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/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 +50 -0
- package/dist/work/providers/jira.d.ts.map +1 -0
- package/dist/work/providers/jira.js +99 -0
- package/dist/work/providers/jira.js.map +1 -0
- package/dist/work/providers/linear.d.ts +47 -0
- package/dist/work/providers/linear.d.ts.map +1 -0
- package/dist/work/providers/linear.js +93 -0
- package/dist/work/providers/linear.js.map +1 -0
- package/dist/work/types.d.ts +41 -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/dist/workflow/faber.d.ts +107 -0
- package/dist/workflow/faber.d.ts.map +1 -0
- package/dist/workflow/faber.js +606 -0
- package/dist/workflow/faber.js.map +1 -0
- package/dist/workflow/index.d.ts +8 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +26 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/types.d.ts +54 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow/types.js +8 -0
- package/dist/workflow/types.js.map +1 -0
- package/package.json +42 -28
- package/dist/api.d.ts +0 -81
- package/dist/api.d.ts.map +0 -1
- package/dist/api.js +0 -261
- package/dist/api.js.map +0 -1
- package/dist/bindings/claude-code/transformer.d.ts +0 -55
- package/dist/bindings/claude-code/transformer.d.ts.map +0 -1
- package/dist/bindings/claude-code/transformer.js +0 -271
- package/dist/bindings/claude-code/transformer.js.map +0 -1
- package/dist/bindings/index.d.ts +0 -21
- package/dist/bindings/index.d.ts.map +0 -1
- package/dist/bindings/index.js +0 -43
- package/dist/bindings/index.js.map +0 -1
- package/dist/core/concepts/base.d.ts +0 -89
- package/dist/core/concepts/base.d.ts.map +0 -1
- package/dist/core/concepts/base.js +0 -230
- package/dist/core/concepts/base.js.map +0 -1
- package/dist/core/concepts/eval.d.ts +0 -90
- package/dist/core/concepts/eval.d.ts.map +0 -1
- package/dist/core/concepts/eval.js +0 -118
- package/dist/core/concepts/eval.js.map +0 -1
- package/dist/core/concepts/index.d.ts +0 -9
- package/dist/core/concepts/index.d.ts.map +0 -1
- package/dist/core/concepts/index.js +0 -36
- package/dist/core/concepts/index.js.map +0 -1
- package/dist/core/concepts/role.d.ts +0 -19
- package/dist/core/concepts/role.d.ts.map +0 -1
- package/dist/core/concepts/role.js +0 -227
- package/dist/core/concepts/role.js.map +0 -1
- package/dist/core/concepts/team.d.ts +0 -57
- package/dist/core/concepts/team.d.ts.map +0 -1
- package/dist/core/concepts/team.js +0 -106
- package/dist/core/concepts/team.js.map +0 -1
- package/dist/core/concepts/tool.d.ts +0 -43
- package/dist/core/concepts/tool.d.ts.map +0 -1
- package/dist/core/concepts/tool.js +0 -104
- package/dist/core/concepts/tool.js.map +0 -1
- package/dist/core/concepts/workflow.d.ts +0 -87
- package/dist/core/concepts/workflow.d.ts.map +0 -1
- package/dist/core/concepts/workflow.js +0 -114
- package/dist/core/concepts/workflow.js.map +0 -1
- package/dist/core/config/index.d.ts +0 -34
- package/dist/core/config/index.d.ts.map +0 -1
- package/dist/core/config/index.js +0 -80
- package/dist/core/config/index.js.map +0 -1
- package/dist/core/config/loader.d.ts +0 -53
- package/dist/core/config/loader.d.ts.map +0 -1
- package/dist/core/config/loader.js +0 -234
- package/dist/core/config/loader.js.map +0 -1
- package/dist/core/contexts/index.d.ts +0 -36
- package/dist/core/contexts/index.d.ts.map +0 -1
- package/dist/core/contexts/index.js +0 -75
- package/dist/core/contexts/index.js.map +0 -1
- package/dist/core/contexts/loader.d.ts +0 -66
- package/dist/core/contexts/loader.d.ts.map +0 -1
- package/dist/core/contexts/loader.js +0 -261
- package/dist/core/contexts/loader.js.map +0 -1
- package/dist/core/overlays/index.d.ts +0 -31
- package/dist/core/overlays/index.d.ts.map +0 -1
- package/dist/core/overlays/index.js +0 -82
- package/dist/core/overlays/index.js.map +0 -1
- package/dist/core/overlays/resolver.d.ts +0 -65
- package/dist/core/overlays/resolver.d.ts.map +0 -1
- package/dist/core/overlays/resolver.js +0 -249
- package/dist/core/overlays/resolver.js.map +0 -1
- package/dist/types/bindings.d.ts +0 -59
- package/dist/types/bindings.d.ts.map +0 -1
- package/dist/types/bindings.js +0 -6
- package/dist/types/bindings.js.map +0 -1
- package/dist/types/concepts.d.ts +0 -131
- package/dist/types/concepts.d.ts.map +0 -1
- package/dist/types/concepts.js +0 -29
- package/dist/types/concepts.js.map +0 -1
- package/dist/types/config.d.ts +0 -42
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/config.js +0 -6
- package/dist/types/config.js.map +0 -1
- package/dist/types/contexts.d.ts +0 -59
- package/dist/types/contexts.d.ts.map +0 -1
- package/dist/types/contexts.js +0 -17
- package/dist/types/contexts.js.map +0 -1
- package/dist/types/index.d.ts +0 -17
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/overlays.d.ts +0 -28
- package/dist/types/overlays.d.ts.map +0 -1
- package/dist/types/overlays.js +0 -15
- package/dist/types/overlays.js.map +0 -1
- package/dist/utils/file-system.d.ts +0 -40
- package/dist/utils/file-system.d.ts.map +0 -1
- package/dist/utils/file-system.js +0 -105
- package/dist/utils/file-system.js.map +0 -1
- package/dist/utils/template.d.ts +0 -28
- package/dist/utils/template.d.ts.map +0 -1
- package/dist/utils/template.js +0 -107
- package/dist/utils/template.js.map +0 -1
- package/dist/utils/validation.d.ts +0 -42
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js +0 -94
- package/dist/utils/validation.js.map +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fractary/faber - Spec Templates
|
|
3
|
+
*
|
|
4
|
+
* Built-in specification templates for different work types.
|
|
5
|
+
*/
|
|
6
|
+
import { SpecTemplate, SpecTemplateType } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* All built-in templates
|
|
9
|
+
*/
|
|
10
|
+
export declare const templates: Record<SpecTemplateType, SpecTemplate>;
|
|
11
|
+
/**
|
|
12
|
+
* Get a template by type
|
|
13
|
+
*/
|
|
14
|
+
export declare function getTemplate(type: SpecTemplateType): SpecTemplate;
|
|
15
|
+
/**
|
|
16
|
+
* List all available templates
|
|
17
|
+
*/
|
|
18
|
+
export declare function listTemplates(): SpecTemplate[];
|
|
19
|
+
/**
|
|
20
|
+
* Generate spec content from a template
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateSpecContent(template: SpecTemplate, options: {
|
|
23
|
+
title: string;
|
|
24
|
+
workId?: string;
|
|
25
|
+
workType: string;
|
|
26
|
+
context?: string;
|
|
27
|
+
}): string;
|
|
28
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/spec/templates.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAyRzD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAE,YAAY,CAM5D,CAAC;AAEF;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAEhE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,YAAY,EAAE,CAE9C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE;IACP,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA,MAAM,CA0CR"}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fractary/faber - Spec Templates
|
|
4
|
+
*
|
|
5
|
+
* Built-in specification templates for different work types.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.templates = void 0;
|
|
9
|
+
exports.getTemplate = getTemplate;
|
|
10
|
+
exports.listTemplates = listTemplates;
|
|
11
|
+
exports.generateSpecContent = generateSpecContent;
|
|
12
|
+
/**
|
|
13
|
+
* Basic template - minimal structure for simple tasks
|
|
14
|
+
*/
|
|
15
|
+
const basicTemplate = {
|
|
16
|
+
id: 'basic',
|
|
17
|
+
name: 'Basic',
|
|
18
|
+
description: 'Minimal template for simple tasks and quick changes',
|
|
19
|
+
sections: [
|
|
20
|
+
{
|
|
21
|
+
id: 'objective',
|
|
22
|
+
title: 'Objective',
|
|
23
|
+
required: true,
|
|
24
|
+
description: 'What needs to be accomplished',
|
|
25
|
+
defaultContent: '<!-- Describe the main goal -->',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'requirements',
|
|
29
|
+
title: 'Requirements',
|
|
30
|
+
required: true,
|
|
31
|
+
description: 'List of specific requirements',
|
|
32
|
+
defaultContent: '- [ ] Requirement 1\n- [ ] Requirement 2',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 'acceptance-criteria',
|
|
36
|
+
title: 'Acceptance Criteria',
|
|
37
|
+
required: true,
|
|
38
|
+
description: 'How to verify the work is complete',
|
|
39
|
+
defaultContent: '- [ ] Criterion 1\n- [ ] Criterion 2',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Feature template - comprehensive structure for new features
|
|
45
|
+
*/
|
|
46
|
+
const featureTemplate = {
|
|
47
|
+
id: 'feature',
|
|
48
|
+
name: 'Feature',
|
|
49
|
+
description: 'Comprehensive template for new feature development',
|
|
50
|
+
sections: [
|
|
51
|
+
{
|
|
52
|
+
id: 'overview',
|
|
53
|
+
title: 'Overview',
|
|
54
|
+
required: true,
|
|
55
|
+
description: 'High-level description of the feature',
|
|
56
|
+
defaultContent: '<!-- Describe the feature and its value -->',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 'user-stories',
|
|
60
|
+
title: 'User Stories',
|
|
61
|
+
required: true,
|
|
62
|
+
description: 'User stories or use cases',
|
|
63
|
+
defaultContent: '- As a [user type], I want [goal] so that [benefit]',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'requirements',
|
|
67
|
+
title: 'Requirements',
|
|
68
|
+
required: true,
|
|
69
|
+
description: 'Functional and non-functional requirements',
|
|
70
|
+
defaultContent: '### Functional\n- [ ] Requirement 1\n\n### Non-Functional\n- [ ] Requirement 1',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'technical-design',
|
|
74
|
+
title: 'Technical Design',
|
|
75
|
+
required: false,
|
|
76
|
+
description: 'Technical approach and architecture decisions',
|
|
77
|
+
defaultContent: '<!-- Describe the technical approach -->',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'api-changes',
|
|
81
|
+
title: 'API Changes',
|
|
82
|
+
required: false,
|
|
83
|
+
description: 'Any API changes or additions',
|
|
84
|
+
defaultContent: '<!-- Document any API changes -->',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 'data-model',
|
|
88
|
+
title: 'Data Model',
|
|
89
|
+
required: false,
|
|
90
|
+
description: 'Database or data structure changes',
|
|
91
|
+
defaultContent: '<!-- Document data model changes -->',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: 'acceptance-criteria',
|
|
95
|
+
title: 'Acceptance Criteria',
|
|
96
|
+
required: true,
|
|
97
|
+
description: 'How to verify the feature is complete',
|
|
98
|
+
defaultContent: '- [ ] Criterion 1\n- [ ] Criterion 2',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: 'testing',
|
|
102
|
+
title: 'Testing Strategy',
|
|
103
|
+
required: true,
|
|
104
|
+
description: 'How the feature will be tested',
|
|
105
|
+
defaultContent: '### Unit Tests\n- [ ] Test 1\n\n### Integration Tests\n- [ ] Test 1',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: 'rollout',
|
|
109
|
+
title: 'Rollout Plan',
|
|
110
|
+
required: false,
|
|
111
|
+
description: 'How the feature will be deployed',
|
|
112
|
+
defaultContent: '<!-- Describe rollout strategy -->',
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Bug template - structure for bug fixes
|
|
118
|
+
*/
|
|
119
|
+
const bugTemplate = {
|
|
120
|
+
id: 'bug',
|
|
121
|
+
name: 'Bug Fix',
|
|
122
|
+
description: 'Template for bug investigation and fixes',
|
|
123
|
+
sections: [
|
|
124
|
+
{
|
|
125
|
+
id: 'description',
|
|
126
|
+
title: 'Bug Description',
|
|
127
|
+
required: true,
|
|
128
|
+
description: 'Description of the bug and its impact',
|
|
129
|
+
defaultContent: '<!-- Describe the bug -->',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: 'reproduction',
|
|
133
|
+
title: 'Steps to Reproduce',
|
|
134
|
+
required: true,
|
|
135
|
+
description: 'How to reproduce the bug',
|
|
136
|
+
defaultContent: '1. Step 1\n2. Step 2\n3. Expected: ...\n4. Actual: ...',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: 'root-cause',
|
|
140
|
+
title: 'Root Cause Analysis',
|
|
141
|
+
required: false,
|
|
142
|
+
description: 'Investigation findings',
|
|
143
|
+
defaultContent: '<!-- Document root cause -->',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: 'solution',
|
|
147
|
+
title: 'Proposed Solution',
|
|
148
|
+
required: true,
|
|
149
|
+
description: 'How the bug will be fixed',
|
|
150
|
+
defaultContent: '<!-- Describe the fix -->',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: 'affected-areas',
|
|
154
|
+
title: 'Affected Areas',
|
|
155
|
+
required: true,
|
|
156
|
+
description: 'What parts of the system are affected',
|
|
157
|
+
defaultContent: '- [ ] Component 1\n- [ ] Component 2',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: 'testing',
|
|
161
|
+
title: 'Testing',
|
|
162
|
+
required: true,
|
|
163
|
+
description: 'How to verify the fix',
|
|
164
|
+
defaultContent: '- [ ] Regression test\n- [ ] Edge case tests',
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Infrastructure template - for infrastructure and DevOps work
|
|
170
|
+
*/
|
|
171
|
+
const infrastructureTemplate = {
|
|
172
|
+
id: 'infrastructure',
|
|
173
|
+
name: 'Infrastructure',
|
|
174
|
+
description: 'Template for infrastructure and DevOps changes',
|
|
175
|
+
sections: [
|
|
176
|
+
{
|
|
177
|
+
id: 'objective',
|
|
178
|
+
title: 'Objective',
|
|
179
|
+
required: true,
|
|
180
|
+
description: 'What infrastructure change is needed',
|
|
181
|
+
defaultContent: '<!-- Describe the objective -->',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: 'current-state',
|
|
185
|
+
title: 'Current State',
|
|
186
|
+
required: true,
|
|
187
|
+
description: 'Current infrastructure configuration',
|
|
188
|
+
defaultContent: '<!-- Describe current state -->',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
id: 'proposed-changes',
|
|
192
|
+
title: 'Proposed Changes',
|
|
193
|
+
required: true,
|
|
194
|
+
description: 'What changes will be made',
|
|
195
|
+
defaultContent: '- [ ] Change 1\n- [ ] Change 2',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
id: 'security',
|
|
199
|
+
title: 'Security Considerations',
|
|
200
|
+
required: true,
|
|
201
|
+
description: 'Security implications and mitigations',
|
|
202
|
+
defaultContent: '<!-- Document security considerations -->',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: 'rollback',
|
|
206
|
+
title: 'Rollback Plan',
|
|
207
|
+
required: true,
|
|
208
|
+
description: 'How to rollback if something goes wrong',
|
|
209
|
+
defaultContent: '<!-- Document rollback procedure -->',
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
id: 'monitoring',
|
|
213
|
+
title: 'Monitoring & Alerts',
|
|
214
|
+
required: false,
|
|
215
|
+
description: 'What monitoring will be added',
|
|
216
|
+
defaultContent: '<!-- Document monitoring changes -->',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
id: 'verification',
|
|
220
|
+
title: 'Verification',
|
|
221
|
+
required: true,
|
|
222
|
+
description: 'How to verify the changes are working',
|
|
223
|
+
defaultContent: '- [ ] Verification step 1\n- [ ] Verification step 2',
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* API template - for API design and implementation
|
|
229
|
+
*/
|
|
230
|
+
const apiTemplate = {
|
|
231
|
+
id: 'api',
|
|
232
|
+
name: 'API',
|
|
233
|
+
description: 'Template for API design and implementation',
|
|
234
|
+
sections: [
|
|
235
|
+
{
|
|
236
|
+
id: 'overview',
|
|
237
|
+
title: 'Overview',
|
|
238
|
+
required: true,
|
|
239
|
+
description: 'High-level description of the API',
|
|
240
|
+
defaultContent: '<!-- Describe the API purpose -->',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
id: 'endpoints',
|
|
244
|
+
title: 'Endpoints',
|
|
245
|
+
required: true,
|
|
246
|
+
description: 'API endpoint specifications',
|
|
247
|
+
defaultContent: '### `GET /api/v1/resource`\n\n**Description:** ...\n\n**Parameters:**\n- `param1` (string, required): ...\n\n**Response:**\n```json\n{\n "data": []\n}\n```',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
id: 'authentication',
|
|
251
|
+
title: 'Authentication',
|
|
252
|
+
required: true,
|
|
253
|
+
description: 'How the API is authenticated',
|
|
254
|
+
defaultContent: '<!-- Document auth requirements -->',
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
id: 'error-handling',
|
|
258
|
+
title: 'Error Handling',
|
|
259
|
+
required: true,
|
|
260
|
+
description: 'Error codes and responses',
|
|
261
|
+
defaultContent: '| Code | Message | Description |\n|------|---------|-------------|\n| 400 | Bad Request | ... |',
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
id: 'rate-limiting',
|
|
265
|
+
title: 'Rate Limiting',
|
|
266
|
+
required: false,
|
|
267
|
+
description: 'Rate limiting configuration',
|
|
268
|
+
defaultContent: '<!-- Document rate limits -->',
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
id: 'versioning',
|
|
272
|
+
title: 'Versioning',
|
|
273
|
+
required: false,
|
|
274
|
+
description: 'API versioning strategy',
|
|
275
|
+
defaultContent: '<!-- Document versioning approach -->',
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
id: 'testing',
|
|
279
|
+
title: 'Testing',
|
|
280
|
+
required: true,
|
|
281
|
+
description: 'API testing strategy',
|
|
282
|
+
defaultContent: '- [ ] Unit tests\n- [ ] Integration tests\n- [ ] Contract tests',
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* All built-in templates
|
|
288
|
+
*/
|
|
289
|
+
exports.templates = {
|
|
290
|
+
basic: basicTemplate,
|
|
291
|
+
feature: featureTemplate,
|
|
292
|
+
bug: bugTemplate,
|
|
293
|
+
infrastructure: infrastructureTemplate,
|
|
294
|
+
api: apiTemplate,
|
|
295
|
+
};
|
|
296
|
+
/**
|
|
297
|
+
* Get a template by type
|
|
298
|
+
*/
|
|
299
|
+
function getTemplate(type) {
|
|
300
|
+
return exports.templates[type] || exports.templates.basic;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* List all available templates
|
|
304
|
+
*/
|
|
305
|
+
function listTemplates() {
|
|
306
|
+
return Object.values(exports.templates);
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Generate spec content from a template
|
|
310
|
+
*/
|
|
311
|
+
function generateSpecContent(template, options) {
|
|
312
|
+
const lines = [];
|
|
313
|
+
// Frontmatter
|
|
314
|
+
lines.push('---');
|
|
315
|
+
lines.push(`id: ${generateSpecId()}`);
|
|
316
|
+
lines.push(`title: "${options.title}"`);
|
|
317
|
+
if (options.workId) {
|
|
318
|
+
lines.push(`work_id: "${options.workId}"`);
|
|
319
|
+
}
|
|
320
|
+
lines.push(`work_type: ${options.workType}`);
|
|
321
|
+
lines.push(`template: ${template.id}`);
|
|
322
|
+
lines.push(`created_at: ${new Date().toISOString()}`);
|
|
323
|
+
lines.push(`updated_at: ${new Date().toISOString()}`);
|
|
324
|
+
lines.push(`validation_status: not_validated`);
|
|
325
|
+
lines.push(`source: conversation`);
|
|
326
|
+
lines.push('---');
|
|
327
|
+
lines.push('');
|
|
328
|
+
// Title
|
|
329
|
+
lines.push(`# ${options.title}`);
|
|
330
|
+
lines.push('');
|
|
331
|
+
// Context if provided
|
|
332
|
+
if (options.context) {
|
|
333
|
+
lines.push('## Context');
|
|
334
|
+
lines.push('');
|
|
335
|
+
lines.push(options.context);
|
|
336
|
+
lines.push('');
|
|
337
|
+
}
|
|
338
|
+
// Template sections
|
|
339
|
+
for (const section of template.sections) {
|
|
340
|
+
lines.push(`## ${section.title}`);
|
|
341
|
+
lines.push('');
|
|
342
|
+
if (section.defaultContent) {
|
|
343
|
+
lines.push(section.defaultContent);
|
|
344
|
+
}
|
|
345
|
+
lines.push('');
|
|
346
|
+
}
|
|
347
|
+
return lines.join('\n');
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Generate a unique spec ID
|
|
351
|
+
*/
|
|
352
|
+
function generateSpecId() {
|
|
353
|
+
const timestamp = Date.now().toString(36);
|
|
354
|
+
const random = Math.random().toString(36).substring(2, 6);
|
|
355
|
+
return `SPEC-${timestamp}-${random}`.toUpperCase();
|
|
356
|
+
}
|
|
357
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/spec/templates.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAySH,kCAEC;AAKD,sCAEC;AAKD,kDAkDC;AArWD;;GAEG;AACH,MAAM,aAAa,GAAiB;IAClC,EAAE,EAAE,OAAO;IACX,I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CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1D,OAAO,QAAQ,SAAS,IAAI,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fractary/faber - Spec Module Types
|
|
3
|
+
*
|
|
4
|
+
* Re-exports from main types + spec-specific interfaces.
|
|
5
|
+
*/
|
|
6
|
+
import type { SpecTemplateType } from '../types';
|
|
7
|
+
export type { SpecConfig, SpecTemplateType, Specification, SpecMetadata, SpecPhase, SpecTask, SpecCreateOptions, SpecListOptions, SpecValidateResult, SpecRefineResult, RefinementQuestion, WorkType, } from '../types';
|
|
8
|
+
/**
|
|
9
|
+
* Template definition
|
|
10
|
+
*/
|
|
11
|
+
export interface SpecTemplate {
|
|
12
|
+
id: SpecTemplateType;
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
sections: TemplateSection[];
|
|
16
|
+
}
|
|
17
|
+
export interface TemplateSection {
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
required: boolean;
|
|
21
|
+
description: string;
|
|
22
|
+
defaultContent?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Spec file frontmatter
|
|
26
|
+
*/
|
|
27
|
+
export interface SpecFrontmatter {
|
|
28
|
+
id: string;
|
|
29
|
+
title: string;
|
|
30
|
+
work_id?: string;
|
|
31
|
+
work_type: string;
|
|
32
|
+
template: string;
|
|
33
|
+
created_at: string;
|
|
34
|
+
updated_at: string;
|
|
35
|
+
validation_status?: string;
|
|
36
|
+
source: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Phase update options
|
|
40
|
+
*/
|
|
41
|
+
export interface PhaseUpdateOptions {
|
|
42
|
+
status?: 'not_started' | 'in_progress' | 'complete';
|
|
43
|
+
objective?: string;
|
|
44
|
+
notes?: string[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Task update options
|
|
48
|
+
*/
|
|
49
|
+
export interface TaskUpdateOptions {
|
|
50
|
+
text?: string;
|
|
51
|
+
completed?: boolean;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/spec/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjD,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,QAAQ,GACT,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,gBAAgB,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,aAAa,GAAG,aAAa,GAAG,UAAU,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/spec/types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fractary/faber - State Module
|
|
4
|
+
*
|
|
5
|
+
* Workflow state persistence and recovery.
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.StateManager = void 0;
|
|
23
|
+
var manager_1 = require("./manager");
|
|
24
|
+
Object.defineProperty(exports, "StateManager", { enumerable: true, get: function () { return manager_1.StateManager; } });
|
|
25
|
+
__exportStar(require("./types"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;AAEH,qCAAyC;AAAhC,uGAAA,YAAY,OAAA;AACrB,0CAAwB"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fractary/faber - State Manager
|
|
3
|
+
*
|
|
4
|
+
* Workflow state persistence and recovery.
|
|
5
|
+
*/
|
|
6
|
+
import { StateConfig, FaberPhase, WorkflowState, PhaseState, RunManifest, PhaseManifest, ArtifactManifest, Checkpoint, StateUpdateOptions, StateQueryOptions, RecoveryOptions } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* State Manager
|
|
9
|
+
*
|
|
10
|
+
* Handles workflow state persistence, checkpoints, and recovery.
|
|
11
|
+
*/
|
|
12
|
+
export declare class StateManager {
|
|
13
|
+
private config;
|
|
14
|
+
private stateDir;
|
|
15
|
+
constructor(config?: StateConfig);
|
|
16
|
+
/**
|
|
17
|
+
* Ensure state directory exists
|
|
18
|
+
*/
|
|
19
|
+
private ensureStateDir;
|
|
20
|
+
/**
|
|
21
|
+
* Get path for a state file
|
|
22
|
+
*/
|
|
23
|
+
private getStatePath;
|
|
24
|
+
/**
|
|
25
|
+
* Create a new workflow state
|
|
26
|
+
*/
|
|
27
|
+
createWorkflow(workId: string): WorkflowState;
|
|
28
|
+
/**
|
|
29
|
+
* Save workflow state
|
|
30
|
+
*/
|
|
31
|
+
saveWorkflow(state: WorkflowState): void;
|
|
32
|
+
/**
|
|
33
|
+
* Get workflow state by ID
|
|
34
|
+
*/
|
|
35
|
+
getWorkflow(workflowId: string): WorkflowState | null;
|
|
36
|
+
/**
|
|
37
|
+
* Get active workflow for a work item
|
|
38
|
+
*/
|
|
39
|
+
getActiveWorkflow(workId: string): WorkflowState | null;
|
|
40
|
+
/**
|
|
41
|
+
* List all workflows
|
|
42
|
+
*/
|
|
43
|
+
listWorkflows(options?: StateQueryOptions): WorkflowState[];
|
|
44
|
+
/**
|
|
45
|
+
* Update workflow phase
|
|
46
|
+
*/
|
|
47
|
+
updatePhase(workflowId: string, phase: FaberPhase, updates: Partial<PhaseState>, options?: StateUpdateOptions): WorkflowState;
|
|
48
|
+
/**
|
|
49
|
+
* Start a phase
|
|
50
|
+
*/
|
|
51
|
+
startPhase(workflowId: string, phase: FaberPhase): WorkflowState;
|
|
52
|
+
/**
|
|
53
|
+
* Complete a phase
|
|
54
|
+
*/
|
|
55
|
+
completePhase(workflowId: string, phase: FaberPhase, outputs?: Record<string, unknown>): WorkflowState;
|
|
56
|
+
/**
|
|
57
|
+
* Fail a phase
|
|
58
|
+
*/
|
|
59
|
+
failPhase(workflowId: string, phase: FaberPhase, error: string): WorkflowState;
|
|
60
|
+
/**
|
|
61
|
+
* Skip a phase
|
|
62
|
+
*/
|
|
63
|
+
skipPhase(workflowId: string, phase: FaberPhase, reason?: string): WorkflowState;
|
|
64
|
+
/**
|
|
65
|
+
* Pause workflow
|
|
66
|
+
*/
|
|
67
|
+
pauseWorkflow(workflowId: string): WorkflowState;
|
|
68
|
+
/**
|
|
69
|
+
* Resume workflow
|
|
70
|
+
*/
|
|
71
|
+
resumeWorkflow(workflowId: string): WorkflowState;
|
|
72
|
+
/**
|
|
73
|
+
* Create a checkpoint
|
|
74
|
+
*/
|
|
75
|
+
createCheckpoint(workflowId: string, phase: string, step: string, data: Record<string, unknown>): Checkpoint;
|
|
76
|
+
/**
|
|
77
|
+
* Get checkpoint by ID
|
|
78
|
+
*/
|
|
79
|
+
getCheckpoint(checkpointId: string): Checkpoint | null;
|
|
80
|
+
/**
|
|
81
|
+
* List checkpoints for a workflow
|
|
82
|
+
*/
|
|
83
|
+
listCheckpoints(workflowId: string): Checkpoint[];
|
|
84
|
+
/**
|
|
85
|
+
* Get latest checkpoint for a workflow
|
|
86
|
+
*/
|
|
87
|
+
getLatestCheckpoint(workflowId: string): Checkpoint | null;
|
|
88
|
+
/**
|
|
89
|
+
* Create a run manifest
|
|
90
|
+
*/
|
|
91
|
+
createManifest(workflowId: string, workId: string): RunManifest;
|
|
92
|
+
/**
|
|
93
|
+
* Save run manifest
|
|
94
|
+
*/
|
|
95
|
+
saveManifest(manifest: RunManifest): void;
|
|
96
|
+
/**
|
|
97
|
+
* Get run manifest
|
|
98
|
+
*/
|
|
99
|
+
getManifest(manifestId: string): RunManifest | null;
|
|
100
|
+
/**
|
|
101
|
+
* Add phase to manifest
|
|
102
|
+
*/
|
|
103
|
+
addPhaseToManifest(manifestId: string, phaseManifest: PhaseManifest): void;
|
|
104
|
+
/**
|
|
105
|
+
* Add artifact to manifest
|
|
106
|
+
*/
|
|
107
|
+
addArtifactToManifest(manifestId: string, artifact: ArtifactManifest): void;
|
|
108
|
+
/**
|
|
109
|
+
* Complete manifest
|
|
110
|
+
*/
|
|
111
|
+
completeManifest(manifestId: string, status: 'completed' | 'failed'): RunManifest;
|
|
112
|
+
/**
|
|
113
|
+
* Recover a workflow from a checkpoint or phase
|
|
114
|
+
*/
|
|
115
|
+
recoverWorkflow(workflowId: string, options?: RecoveryOptions): WorkflowState;
|
|
116
|
+
/**
|
|
117
|
+
* Delete workflow state
|
|
118
|
+
*/
|
|
119
|
+
deleteWorkflow(workflowId: string): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Clean up old workflows and checkpoints
|
|
122
|
+
*/
|
|
123
|
+
cleanup(maxAgeDays?: number): {
|
|
124
|
+
deleted: number;
|
|
125
|
+
errors: string[];
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Get state directory path
|
|
129
|
+
*/
|
|
130
|
+
getStateDir(): string;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/state/manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EACL,WAAW,EACX,UAAU,EACV,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EAChB,MAAM,SAAS,CAAC;AAyCjB;;;;GAIG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,QAAQ,CAAS;gBAEb,MAAM,CAAC,EAAE,WAAW;IAMhC;;OAEG;IACH,OAAO,CAAC,cAAc;IAQtB;;OAEG;IACH,OAAO,CAAC,YAAY;IAQpB;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa;IAwB7C;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAUxC;;OAEG;IACH,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAQrD;;OAEG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAUvD;;OAEG;IACH,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,aAAa,EAAE;IA2B3D;;OAEG;IACH,WAAW,CACT,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,EAC5B,OAAO,CAAC,EAAE,kBAAkB,GAC3B,aAAa;IAsChB;;OAEG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,aAAa;IAQhE;;OAE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