rafcode 3.2.1 → 3.8.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/.claude/settings.local.json +3 -1
- package/CLAUDE.md +0 -1
- package/RAF/41-echo-chamber/decisions.md +13 -0
- package/RAF/41-echo-chamber/input.md +4 -0
- package/RAF/41-echo-chamber/outcomes/1-update-codex-model-defaults.md +24 -0
- package/RAF/41-echo-chamber/outcomes/2-e2e-test-codex-provider.md +74 -0
- package/RAF/41-echo-chamber/plans/1-update-codex-model-defaults.md +28 -0
- package/RAF/41-echo-chamber/plans/2-e2e-test-codex-provider.md +103 -0
- package/RAF/42-patch-parade/decisions.md +29 -0
- package/RAF/42-patch-parade/input.md +9 -0
- package/RAF/42-patch-parade/outcomes/1-fix-codex-model-resolution.md +36 -0
- package/RAF/42-patch-parade/outcomes/2-fix-provider-aware-name-generation.md +31 -0
- package/RAF/42-patch-parade/outcomes/3-fix-codex-error-event-rendering.md +32 -0
- package/RAF/42-patch-parade/outcomes/4-update-cli-help-docs.md +28 -0
- package/RAF/42-patch-parade/outcomes/5-update-default-codex-models-to-gpt-5-4.md +33 -0
- package/RAF/42-patch-parade/outcomes/6-unify-model-config-schema.md +89 -0
- package/RAF/42-patch-parade/plans/1-fix-codex-model-resolution.md +35 -0
- package/RAF/42-patch-parade/plans/2-fix-provider-aware-name-generation.md +38 -0
- package/RAF/42-patch-parade/plans/3-fix-codex-error-event-rendering.md +32 -0
- package/RAF/42-patch-parade/plans/4-update-cli-help-docs.md +31 -0
- package/RAF/42-patch-parade/plans/5-update-default-codex-models-to-gpt-5-4.md +35 -0
- package/RAF/42-patch-parade/plans/6-unify-model-config-schema.md +46 -0
- package/RAF/43-swiss-army/decisions.md +34 -0
- package/RAF/43-swiss-army/input.md +7 -0
- package/RAF/43-swiss-army/outcomes/1-fix-model-validation.md +21 -0
- package/RAF/43-swiss-army/outcomes/2-update-commit-format.md +31 -0
- package/RAF/43-swiss-army/outcomes/3-wire-reasoning-effort.md +28 -0
- package/RAF/43-swiss-army/outcomes/4-remove-provider-flag.md +27 -0
- package/RAF/43-swiss-army/outcomes/5-config-wizard-validation.md +23 -0
- package/RAF/43-swiss-army/outcomes/6-add-fast-mode.md +32 -0
- package/RAF/43-swiss-army/outcomes/7-config-preset.md +31 -0
- package/RAF/43-swiss-army/plans/1-fix-model-validation.md +38 -0
- package/RAF/43-swiss-army/plans/2-update-commit-format.md +46 -0
- package/RAF/43-swiss-army/plans/3-wire-reasoning-effort.md +39 -0
- package/RAF/43-swiss-army/plans/4-remove-provider-flag.md +43 -0
- package/RAF/43-swiss-army/plans/5-config-wizard-validation.md +42 -0
- package/RAF/43-swiss-army/plans/6-add-fast-mode.md +46 -0
- package/RAF/43-swiss-army/plans/7-config-preset.md +51 -0
- package/RAF/44-config-api-change/decisions.md +22 -0
- package/RAF/44-config-api-change/input.md +5 -0
- package/RAF/44-config-api-change/outcomes/1-restructure-config-subcommands.md +19 -0
- package/RAF/44-config-api-change/outcomes/2-move-preset-under-config.md +17 -0
- package/RAF/44-config-api-change/outcomes/3-update-existing-tests-for-config-api.md +14 -0
- package/RAF/44-config-api-change/outcomes/4-update-config-command-docs.md +11 -0
- package/RAF/44-config-api-change/outcomes/5-fix-codex-name-generation.md +18 -0
- package/RAF/44-config-api-change/plans/1-restructure-config-subcommands.md +37 -0
- package/RAF/44-config-api-change/plans/2-move-preset-under-config.md +38 -0
- package/RAF/44-config-api-change/plans/3-update-existing-tests-for-config-api.md +38 -0
- package/RAF/44-config-api-change/plans/4-update-config-command-docs.md +36 -0
- package/RAF/44-config-api-change/plans/5-fix-codex-name-generation.md +49 -0
- package/RAF/45-signal-cairn/decisions.md +7 -0
- package/RAF/45-signal-cairn/input.md +2 -0
- package/RAF/45-signal-cairn/outcomes/1-rename-provider-to-harness.md +19 -0
- package/RAF/45-signal-cairn/outcomes/2-normalize-model-display-names.md +18 -0
- package/RAF/45-signal-cairn/plans/1-rename-provider-to-harness.md +40 -0
- package/RAF/45-signal-cairn/plans/2-normalize-model-display-names.md +41 -0
- package/RAF/45-signal-lantern/decisions.md +10 -0
- package/RAF/45-signal-lantern/input.md +2 -0
- package/RAF/45-signal-lantern/outcomes/1-add-effort-and-fast-to-do-model-display.md +15 -0
- package/RAF/45-signal-lantern/outcomes/2-capture-codex-post-run-token-usage.md +15 -0
- package/RAF/45-signal-lantern/outcomes/3-show-codex-token-summaries-without-fake-cost.md +14 -0
- package/RAF/45-signal-lantern/plans/1-add-effort-and-fast-to-do-model-display.md +38 -0
- package/RAF/45-signal-lantern/plans/2-capture-codex-post-run-token-usage.md +37 -0
- package/RAF/45-signal-lantern/plans/3-show-codex-token-summaries-without-fake-cost.md +40 -0
- package/RAF/46-lantern-arc/decisions.md +19 -0
- package/RAF/46-lantern-arc/input.md +6 -0
- package/RAF/46-lantern-arc/outcomes/1-remove-spark-alias.md +16 -0
- package/RAF/46-lantern-arc/outcomes/2-clean-up-worktree-plan-command.md +30 -0
- package/RAF/46-lantern-arc/outcomes/3-fix-token-usage-accumulation.md +32 -0
- package/RAF/46-lantern-arc/outcomes/4-display-effort-in-compact-mode.md +22 -0
- package/RAF/46-lantern-arc/outcomes/5-codex-fast-mode-research.md +38 -0
- package/RAF/46-lantern-arc/outcomes/6-optimize-llm-prompts.md +39 -0
- package/RAF/46-lantern-arc/plans/1-remove-spark-alias.md +38 -0
- package/RAF/46-lantern-arc/plans/2-clean-up-worktree-plan-command.md +33 -0
- package/RAF/46-lantern-arc/plans/3-fix-token-usage-accumulation.md +33 -0
- package/RAF/46-lantern-arc/plans/4-display-effort-in-compact-mode.md +28 -0
- package/RAF/46-lantern-arc/plans/5-codex-fast-mode-research.md +34 -0
- package/RAF/46-lantern-arc/plans/6-optimize-llm-prompts.md +48 -0
- package/RAF/47-signal-trim/decisions.md +13 -0
- package/RAF/47-signal-trim/input.md +2 -0
- package/RAF/47-signal-trim/plans/1-remove-cache-from-status.md +73 -0
- package/README.md +47 -57
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +47 -49
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/do.d.ts +2 -0
- package/dist/commands/do.d.ts.map +1 -1
- package/dist/commands/do.js +57 -44
- package/dist/commands/do.js.map +1 -1
- package/dist/commands/plan.d.ts.map +1 -1
- package/dist/commands/plan.js +36 -153
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/preset.d.ts +3 -0
- package/dist/commands/preset.d.ts.map +1 -0
- package/dist/commands/preset.js +158 -0
- package/dist/commands/preset.js.map +1 -0
- package/dist/core/claude-runner.d.ts +2 -0
- package/dist/core/claude-runner.d.ts.map +1 -1
- package/dist/core/claude-runner.js +36 -12
- package/dist/core/claude-runner.js.map +1 -1
- package/dist/core/codex-runner.d.ts +1 -0
- package/dist/core/codex-runner.d.ts.map +1 -1
- package/dist/core/codex-runner.js +26 -7
- package/dist/core/codex-runner.js.map +1 -1
- package/dist/core/failure-analyzer.js +2 -1
- package/dist/core/failure-analyzer.js.map +1 -1
- package/dist/core/git.d.ts +2 -2
- package/dist/core/git.d.ts.map +1 -1
- package/dist/core/git.js +53 -3
- package/dist/core/git.js.map +1 -1
- package/dist/core/pull-request.js +3 -3
- package/dist/core/pull-request.js.map +1 -1
- package/dist/core/runner-factory.d.ts +4 -4
- package/dist/core/runner-factory.d.ts.map +1 -1
- package/dist/core/runner-factory.js +8 -8
- package/dist/core/runner-factory.js.map +1 -1
- package/dist/core/runner-interface.d.ts +1 -1
- package/dist/core/runner-types.d.ts +17 -4
- package/dist/core/runner-types.d.ts.map +1 -1
- package/dist/parsers/codex-stream-renderer.d.ts +7 -0
- package/dist/parsers/codex-stream-renderer.d.ts.map +1 -1
- package/dist/parsers/codex-stream-renderer.js +37 -4
- package/dist/parsers/codex-stream-renderer.js.map +1 -1
- package/dist/prompts/amend.d.ts.map +1 -1
- package/dist/prompts/amend.js +29 -101
- package/dist/prompts/amend.js.map +1 -1
- package/dist/prompts/execution.d.ts.map +1 -1
- package/dist/prompts/execution.js +17 -34
- package/dist/prompts/execution.js.map +1 -1
- package/dist/prompts/planning.d.ts.map +1 -1
- package/dist/prompts/planning.js +21 -120
- package/dist/prompts/planning.js.map +1 -1
- package/dist/types/config.d.ts +33 -31
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +14 -28
- package/dist/types/config.js.map +1 -1
- package/dist/utils/config.d.ts +36 -16
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +209 -104
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/name-generator.d.ts.map +1 -1
- package/dist/utils/name-generator.js +25 -12
- package/dist/utils/name-generator.js.map +1 -1
- package/dist/utils/terminal-symbols.d.ts +15 -2
- package/dist/utils/terminal-symbols.d.ts.map +1 -1
- package/dist/utils/terminal-symbols.js +36 -4
- package/dist/utils/terminal-symbols.js.map +1 -1
- package/dist/utils/token-tracker.d.ts +6 -1
- package/dist/utils/token-tracker.d.ts.map +1 -1
- package/dist/utils/token-tracker.js +84 -51
- package/dist/utils/token-tracker.js.map +1 -1
- package/dist/utils/validation.d.ts +1 -2
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +4 -25
- package/dist/utils/validation.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/config.ts +60 -63
- package/src/commands/do.ts +63 -51
- package/src/commands/plan.ts +34 -165
- package/src/commands/preset.ts +186 -0
- package/src/core/claude-runner.ts +45 -5
- package/src/core/codex-runner.ts +32 -7
- package/src/core/failure-analyzer.ts +2 -1
- package/src/core/git.ts +57 -3
- package/src/core/pull-request.ts +3 -3
- package/src/core/runner-factory.ts +9 -9
- package/src/core/runner-interface.ts +1 -1
- package/src/core/runner-types.ts +17 -4
- package/src/parsers/codex-stream-renderer.ts +47 -4
- package/src/prompts/amend.ts +29 -101
- package/src/prompts/config-docs.md +206 -62
- package/src/prompts/execution.ts +17 -34
- package/src/prompts/planning.ts +21 -120
- package/src/types/config.ts +47 -58
- package/src/utils/config.ts +248 -115
- package/src/utils/name-generator.ts +29 -13
- package/src/utils/terminal-symbols.ts +46 -6
- package/src/utils/token-tracker.ts +96 -57
- package/src/utils/validation.ts +5 -30
- package/tests/unit/amend-prompt.test.ts +3 -2
- package/tests/unit/claude-runner-interactive.test.ts +21 -3
- package/tests/unit/claude-runner.test.ts +39 -0
- package/tests/unit/codex-runner.test.ts +163 -0
- package/tests/unit/codex-stream-renderer.test.ts +127 -0
- package/tests/unit/command-output.test.ts +57 -0
- package/tests/unit/commit-planning-artifacts-worktree.test.ts +24 -7
- package/tests/unit/commit-planning-artifacts.test.ts +26 -4
- package/tests/unit/config-command.test.ts +215 -303
- package/tests/unit/config.test.ts +319 -235
- package/tests/unit/dependency-integration.test.ts +27 -1
- package/tests/unit/do-model-display.test.ts +35 -0
- package/tests/unit/execution-prompt.test.ts +49 -19
- package/tests/unit/name-generator.test.ts +82 -12
- package/tests/unit/plan-command-auto-flag.test.ts +7 -10
- package/tests/unit/plan-command.test.ts +14 -17
- package/tests/unit/planning-prompt.test.ts +9 -8
- package/tests/unit/terminal-symbols.test.ts +94 -3
- package/tests/unit/token-tracker.test.ts +180 -1
- package/tests/unit/validation.test.ts +9 -41
- package/tests/unit/worktree-flag-override.test.ts +0 -186
package/dist/prompts/planning.js
CHANGED
|
@@ -5,13 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export function getPlanningPrompt(params) {
|
|
7
7
|
const { projectPath } = params;
|
|
8
|
-
const systemPrompt = `You are a project planning assistant for RAF (Ralph's Automation Framework).
|
|
9
|
-
|
|
10
|
-
## Your Goals
|
|
11
|
-
|
|
12
|
-
1. **Analyze the input** and identify distinct, actionable tasks
|
|
13
|
-
2. **Interview the user** about EACH task to gather specific requirements
|
|
14
|
-
3. **Create plan files** for each task with clear instructions
|
|
8
|
+
const systemPrompt = `You are a project planning assistant for RAF (Ralph's Automation Framework). Analyze the user's project description, interview them, and create detailed task plans.
|
|
15
9
|
|
|
16
10
|
## Project Location
|
|
17
11
|
|
|
@@ -21,53 +15,25 @@ Project folder: ${projectPath}
|
|
|
21
15
|
|
|
22
16
|
### Step 1: Identify and Order Tasks
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
- Be independently completable
|
|
26
|
-
- Have a clear outcome
|
|
27
|
-
- Take roughly 10-30 minutes of work
|
|
18
|
+
Identify distinct tasks from the project description. Each task should be independently completable, have a clear outcome, and take roughly 10-30 minutes.
|
|
28
19
|
|
|
29
|
-
**
|
|
30
|
-
- Setup/foundation tasks come first (e.g., defining schemas, creating interfaces)
|
|
31
|
-
- Core implementation tasks come next
|
|
32
|
-
- Integration and extension tasks come later
|
|
33
|
-
- Testing and validation tasks typically come last
|
|
20
|
+
**Order tasks by logical execution order:** setup/foundation → core implementation → integration/extension → testing/validation.
|
|
34
21
|
|
|
35
22
|
### Step 2: Interview the User
|
|
36
23
|
|
|
37
|
-
For EACH task
|
|
38
|
-
- Specific requirements and constraints
|
|
39
|
-
- Technology preferences
|
|
40
|
-
- Any existing code or patterns to follow
|
|
41
|
-
- Edge cases to handle
|
|
42
|
-
|
|
43
|
-
DO NOT skip the interview step. The quality of your plans depends on understanding the user's exact needs.
|
|
44
|
-
|
|
45
|
-
### Step 2.5: Record Decisions
|
|
24
|
+
For EACH task, use the AskUserQuestion tool to gather specific requirements, technology preferences, existing patterns to follow, and edge cases. Do not skip this step.
|
|
46
25
|
|
|
47
|
-
After EACH
|
|
48
|
-
- ${projectPath}/decisions.md
|
|
49
|
-
|
|
50
|
-
Use this format:
|
|
26
|
+
After EACH answer, append the Q&A pair to \`${projectPath}/decisions.md\`:
|
|
51
27
|
\`\`\`markdown
|
|
52
|
-
# Project Decisions
|
|
53
|
-
|
|
54
|
-
## [Question asked]
|
|
55
|
-
[User's answer]
|
|
56
|
-
|
|
57
28
|
## [Question asked]
|
|
58
29
|
[User's answer]
|
|
59
30
|
\`\`\`
|
|
60
31
|
|
|
61
|
-
This file serves as documentation of design choices made during planning. Append each new Q&A pair as you conduct the interview.
|
|
62
|
-
|
|
63
32
|
### Step 3: Create Plan Files
|
|
64
33
|
|
|
65
|
-
|
|
66
|
-
- ${projectPath}/plans/1-task-name.md
|
|
67
|
-
- ${projectPath}/plans/2-task-name.md
|
|
68
|
-
- etc.
|
|
34
|
+
Create plan files in \`${projectPath}/plans/\` numbered in execution order (e.g., \`1-task-name.md\`, \`2-task-name.md\`). Use kebab-case names.
|
|
69
35
|
|
|
70
|
-
Each plan file MUST have
|
|
36
|
+
Each plan file MUST have this structure:
|
|
71
37
|
|
|
72
38
|
\`\`\`markdown
|
|
73
39
|
---
|
|
@@ -76,90 +42,39 @@ effort: medium
|
|
|
76
42
|
# Task: [Task Name]
|
|
77
43
|
|
|
78
44
|
## Objective
|
|
79
|
-
[Clear, one-sentence description
|
|
45
|
+
[Clear, one-sentence description]
|
|
80
46
|
|
|
81
47
|
## Context
|
|
82
48
|
[Why this task is needed, how it fits into the larger project]
|
|
83
49
|
|
|
84
50
|
## Dependencies
|
|
85
|
-
[Optional
|
|
86
|
-
[Comma-separated list of task IDs this task depends on, e.g., "1, 2"]
|
|
87
|
-
[If a dependency fails, this task will be automatically blocked]
|
|
51
|
+
[Optional — omit if none. Comma-separated task IDs, e.g., "1, 2"]
|
|
88
52
|
|
|
89
53
|
## Requirements
|
|
90
|
-
[Specific requirements gathered from the user interview]
|
|
91
54
|
- Requirement 1
|
|
92
55
|
- Requirement 2
|
|
93
|
-
- ...
|
|
94
56
|
|
|
95
57
|
## Implementation Steps
|
|
96
58
|
1. [Step 1]
|
|
97
59
|
2. [Step 2]
|
|
98
|
-
3. [Step 3]
|
|
99
|
-
...
|
|
100
60
|
|
|
101
61
|
## Acceptance Criteria
|
|
102
62
|
- [ ] Criterion 1
|
|
103
63
|
- [ ] Criterion 2
|
|
104
|
-
- [ ] All tests pass
|
|
105
64
|
|
|
106
65
|
## Notes
|
|
107
|
-
[
|
|
66
|
+
[Additional context, warnings, or considerations]
|
|
108
67
|
\`\`\`
|
|
109
68
|
|
|
110
|
-
|
|
69
|
+
**Frontmatter fields:**
|
|
70
|
+
- \`effort\` (REQUIRED): \`low\` (trivial/mechanical), \`medium\` (well-scoped feature work), \`high\` (architectural/complex)
|
|
71
|
+
- \`model\` (optional): Override effort-based model selection. Rarely needed — prefer \`effort\` so the user's config controls the model.
|
|
111
72
|
|
|
112
|
-
|
|
113
|
-
- \`effort: low\` — Trivial/mechanical changes, simple one-file edits, config changes
|
|
114
|
-
- \`effort: medium\` — Well-scoped feature work, bug fixes with clear plans, multi-file changes following existing patterns
|
|
115
|
-
- \`effort: high\` — Architectural changes, complex logic, tasks requiring deep codebase understanding
|
|
73
|
+
**Dependencies:** Infer automatically from task relationships (don't ask the user). Only reference lower-numbered tasks. Only direct dependencies, not transitive ones. Omit section if no prerequisites.
|
|
116
74
|
|
|
117
|
-
|
|
118
|
-
\`\`\`markdown
|
|
119
|
-
---
|
|
120
|
-
effort: medium
|
|
121
|
-
model: opus
|
|
122
|
-
---
|
|
123
|
-
# Task: ...
|
|
124
|
-
\`\`\`
|
|
75
|
+
### Step 4: Confirm Completion
|
|
125
76
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
### Step 4: Infer Task Dependencies
|
|
129
|
-
|
|
130
|
-
For each task, analyze which other tasks must complete successfully before it can begin. Add a \`## Dependencies\` section to plan files that have prerequisites.
|
|
131
|
-
|
|
132
|
-
**How to identify dependencies:**
|
|
133
|
-
- If task B uses output/artifacts from task A → B depends on A
|
|
134
|
-
- If task B modifies code created by task A → B depends on A
|
|
135
|
-
- If task B tests functionality from task A → B depends on A
|
|
136
|
-
- If task B extends or builds upon task A → B depends on A
|
|
137
|
-
|
|
138
|
-
**Dependency format examples:**
|
|
139
|
-
\`\`\`markdown
|
|
140
|
-
## Dependencies
|
|
141
|
-
1
|
|
142
|
-
\`\`\`
|
|
143
|
-
or for multiple dependencies:
|
|
144
|
-
\`\`\`markdown
|
|
145
|
-
## Dependencies
|
|
146
|
-
1, 2
|
|
147
|
-
\`\`\`
|
|
148
|
-
|
|
149
|
-
**Rules for dependencies:**
|
|
150
|
-
- Only reference lower-numbered tasks (tasks are ordered by execution order)
|
|
151
|
-
- Omit the Dependencies section entirely if a task has no prerequisites
|
|
152
|
-
- Keep dependency lists minimal - only direct dependencies, not transitive ones
|
|
153
|
-
- Never create circular dependencies (impossible if you only reference lower-numbered tasks)
|
|
154
|
-
|
|
155
|
-
### Step 5: Confirm Completion
|
|
156
|
-
|
|
157
|
-
After creating all plan files:
|
|
158
|
-
1. Provide a summary of the tasks you've created, including the effort level for each task. Example:
|
|
159
|
-
- Task 1: setup-database (effort: low)
|
|
160
|
-
- Task 2: implement-auth (effort: medium)
|
|
161
|
-
- Task 3: refactor-api (effort: high)
|
|
162
|
-
2. Display this exit message to the user:
|
|
77
|
+
Provide a summary with effort levels (e.g., "Task 1: setup-database (effort: low)"), then display:
|
|
163
78
|
|
|
164
79
|
\`\`\`
|
|
165
80
|
Planning complete! To exit this session and run your tasks:
|
|
@@ -167,25 +82,11 @@ Planning complete! To exit this session and run your tasks:
|
|
|
167
82
|
2. Then run: raf do <project>
|
|
168
83
|
\`\`\`
|
|
169
84
|
|
|
170
|
-
##
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
4. Each plan should be self-contained with all context needed
|
|
176
|
-
5. Infer dependencies automatically - analyze task relationships, don't ask the user about dependencies
|
|
177
|
-
6. Only add Dependencies section when a task genuinely requires another to complete first
|
|
178
|
-
7. Dependencies must only reference lower-numbered tasks to prevent circular dependencies
|
|
179
|
-
8. Be specific - vague plans lead to poor execution
|
|
180
|
-
9. ALWAYS include the \`effort\` frontmatter field in every plan file — assess each task's complexity
|
|
181
|
-
|
|
182
|
-
## Plan Output Style
|
|
183
|
-
|
|
184
|
-
Plans can include whatever level of detail you deem helpful for the executing agent. Use your judgment:
|
|
185
|
-
- Include implementation details when they clarify the approach
|
|
186
|
-
- Code snippets are acceptable when they help illustrate a specific pattern
|
|
187
|
-
- File paths are helpful when referencing existing project files, patterns, or directories
|
|
188
|
-
- Focus on clarity — the goal is for the executing agent to understand what needs to be done`;
|
|
85
|
+
## Rules
|
|
86
|
+
|
|
87
|
+
- Each plan must be self-contained with all context needed for execution
|
|
88
|
+
- Be specific — vague plans lead to poor execution
|
|
89
|
+
- Include implementation details, code snippets, and file paths when they clarify the approach`;
|
|
189
90
|
const userMessage = `Here is my project description:
|
|
190
91
|
|
|
191
92
|
${params.inputContent}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planning.js","sourceRoot":"","sources":["../../src/prompts/planning.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAA4B;IAC5D,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;IAC/B,MAAM,YAAY,GAAG
|
|
1
|
+
{"version":3,"file":"planning.js","sourceRoot":"","sources":["../../src/prompts/planning.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAA4B;IAC5D,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;IAC/B,MAAM,YAAY,GAAG;;;;kBAIL,WAAW;;;;;;;;;;;;;;8CAciB,WAAW;;;;;;;;yBAQhC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+FAuD2D,CAAC;IAE9F,MAAM,WAAW,GAAG;;EAEpB,MAAM,CAAC,YAAY;;sDAEiC,CAAC;IAErD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AACvC,CAAC"}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/** CLI harness
|
|
2
|
-
export type
|
|
1
|
+
/** CLI harness name */
|
|
2
|
+
export type HarnessName = 'claude' | 'codex';
|
|
3
3
|
/** Short alias for a Claude model family */
|
|
4
4
|
export type ClaudeModelAlias = 'sonnet' | 'haiku' | 'opus';
|
|
5
5
|
/** Short alias for a Codex model family */
|
|
6
|
-
export type CodexModelAlias = '
|
|
7
|
-
/**
|
|
6
|
+
export type CodexModelAlias = 'codex' | 'gpt54';
|
|
7
|
+
/** Harness-agnostic model alias (union of all harness aliases) */
|
|
8
8
|
export type ModelAlias = ClaudeModelAlias | CodexModelAlias;
|
|
9
9
|
/**
|
|
10
10
|
* Accepts short aliases (`sonnet`, `haiku`, `opus`) or full model IDs
|
|
@@ -14,7 +14,7 @@ export type ModelAlias = ClaudeModelAlias | CodexModelAlias;
|
|
|
14
14
|
export type ClaudeModelName = ClaudeModelAlias | (string & {
|
|
15
15
|
__brand?: 'FullModelId';
|
|
16
16
|
});
|
|
17
|
-
/**
|
|
17
|
+
/** Harness-agnostic model name — accepts any alias, full ID, or harness-prefixed format */
|
|
18
18
|
export type ModelName = string & {
|
|
19
19
|
__brand?: 'ModelName';
|
|
20
20
|
};
|
|
@@ -22,22 +22,36 @@ export type ModelName = string & {
|
|
|
22
22
|
export type TaskEffortLevel = 'low' | 'medium' | 'high';
|
|
23
23
|
export type ModelScenario = 'plan' | 'execute' | 'nameGeneration' | 'failureAnalysis' | 'prGeneration' | 'config';
|
|
24
24
|
export type CommitFormatType = 'task' | 'plan' | 'amend';
|
|
25
|
+
/**
|
|
26
|
+
* A harness-aware model configuration entry.
|
|
27
|
+
* Stores model, harness, and optional reasoning effort together.
|
|
28
|
+
*/
|
|
29
|
+
export interface ModelEntry {
|
|
30
|
+
/** Model name: short alias (opus, sonnet, gpt-5.4) or full ID */
|
|
31
|
+
model: string;
|
|
32
|
+
/** Which CLI harness to use for this entry */
|
|
33
|
+
harness: HarnessName;
|
|
34
|
+
/** Optional reasoning effort hint. Codex accepts: "none", "minimal", "low", "medium", "high", "xhigh" */
|
|
35
|
+
reasoningEffort?: string;
|
|
36
|
+
/** Enable fast mode for faster output (Claude only). Default: false/omitted. */
|
|
37
|
+
fast?: boolean;
|
|
38
|
+
}
|
|
25
39
|
export interface ModelsConfig {
|
|
26
|
-
plan:
|
|
27
|
-
execute:
|
|
28
|
-
nameGeneration:
|
|
29
|
-
failureAnalysis:
|
|
30
|
-
prGeneration:
|
|
31
|
-
config:
|
|
40
|
+
plan: ModelEntry;
|
|
41
|
+
execute: ModelEntry;
|
|
42
|
+
nameGeneration: ModelEntry;
|
|
43
|
+
failureAnalysis: ModelEntry;
|
|
44
|
+
prGeneration: ModelEntry;
|
|
45
|
+
config: ModelEntry;
|
|
32
46
|
}
|
|
33
47
|
/**
|
|
34
|
-
* Maps task complexity labels to model
|
|
48
|
+
* Maps task complexity labels to harness-aware model entries.
|
|
35
49
|
* Used to resolve per-task effort frontmatter to a model.
|
|
36
50
|
*/
|
|
37
51
|
export interface EffortMappingConfig {
|
|
38
|
-
low:
|
|
39
|
-
medium:
|
|
40
|
-
high:
|
|
52
|
+
low: ModelEntry;
|
|
53
|
+
medium: ModelEntry;
|
|
54
|
+
high: ModelEntry;
|
|
41
55
|
}
|
|
42
56
|
export interface CommitFormatConfig {
|
|
43
57
|
task: string;
|
|
@@ -51,15 +65,9 @@ export interface DisplayConfig {
|
|
|
51
65
|
showCacheTokens: boolean;
|
|
52
66
|
}
|
|
53
67
|
export interface RafConfig {
|
|
54
|
-
/** CLI harness provider. Default: 'claude' */
|
|
55
|
-
provider: HarnessProvider;
|
|
56
68
|
models: ModelsConfig;
|
|
57
|
-
/** Maps task complexity labels (low/medium/high) to
|
|
69
|
+
/** Maps task complexity labels (low/medium/high) to model entries. Used for per-task effort frontmatter. */
|
|
58
70
|
effortMapping: EffortMappingConfig;
|
|
59
|
-
/** Codex model assignments per scenario */
|
|
60
|
-
codexModels: ModelsConfig;
|
|
61
|
-
/** Maps task complexity labels to Codex models */
|
|
62
|
-
codexEffortMapping: EffortMappingConfig;
|
|
63
71
|
timeout: number;
|
|
64
72
|
maxRetries: number;
|
|
65
73
|
autoCommit: boolean;
|
|
@@ -77,7 +85,7 @@ export type DeepPartial<T> = {
|
|
|
77
85
|
export type UserConfig = DeepPartial<RafConfig>;
|
|
78
86
|
export declare const VALID_MODEL_ALIASES: readonly ClaudeModelAlias[];
|
|
79
87
|
export declare const VALID_CODEX_MODEL_ALIASES: readonly CodexModelAlias[];
|
|
80
|
-
export declare const
|
|
88
|
+
export declare const VALID_HARNESSES: readonly HarnessName[];
|
|
81
89
|
/**
|
|
82
90
|
* Regex for full Claude model IDs (e.g., `claude-sonnet-4-5-20250929`, `claude-opus-4-5-20251101`).
|
|
83
91
|
* Pattern: claude-{family}-{major}(-{minor})?(-{date})?
|
|
@@ -95,18 +103,12 @@ export declare const DEFAULT_RAF_CONFIG: {
|
|
|
95
103
|
};
|
|
96
104
|
export interface PlanCommandOptions {
|
|
97
105
|
projectName?: string;
|
|
98
|
-
model?: ClaudeModelName;
|
|
99
|
-
sonnet?: boolean;
|
|
100
|
-
provider?: HarnessProvider;
|
|
101
106
|
}
|
|
102
107
|
export interface DoCommandOptions {
|
|
103
108
|
timeout?: number;
|
|
104
109
|
verbose?: boolean;
|
|
105
110
|
debug?: boolean;
|
|
106
111
|
force?: boolean;
|
|
107
|
-
model?: ClaudeModelName;
|
|
108
|
-
sonnet?: boolean;
|
|
109
|
-
provider?: HarnessProvider;
|
|
110
112
|
}
|
|
111
113
|
export interface StatusCommandOptions {
|
|
112
114
|
json?: boolean;
|
|
@@ -118,7 +120,7 @@ export interface ModelTokenUsage {
|
|
|
118
120
|
cacheReadInputTokens: number;
|
|
119
121
|
cacheCreationInputTokens: number;
|
|
120
122
|
/** Cost in USD for this model's usage (provided by Claude CLI). */
|
|
121
|
-
costUsd
|
|
123
|
+
costUsd?: number | null;
|
|
122
124
|
}
|
|
123
125
|
/** Token usage data extracted from Claude CLI stream-json result event. */
|
|
124
126
|
export interface UsageData {
|
|
@@ -130,6 +132,6 @@ export interface UsageData {
|
|
|
130
132
|
/** Per-model breakdown (e.g., { "claude-opus-4-6": { ... } }). */
|
|
131
133
|
modelUsage: Record<string, ModelTokenUsage>;
|
|
132
134
|
/** Total cost in USD for this usage (provided by Claude CLI). */
|
|
133
|
-
totalCostUsd: number;
|
|
135
|
+
totalCostUsd: number | null;
|
|
134
136
|
}
|
|
135
137
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7C,4CAA4C;AAC5C,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3D,2CAA2C;AAC3C,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhD,kEAAkE;AAClE,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,CAAC,MAAM,GAAG;IAAE,OAAO,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC;AAExF,2FAA2F;AAC3F,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAE3D,+FAA+F;AAC/F,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAExD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,cAAc,GAAG,QAAQ,CAAC;AAClH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,OAAO,EAAE,WAAW,CAAC;IACrB,yGAAyG;IACzG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,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;IAClE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC5C,iEAAiE;IACjE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B"}
|
package/dist/types/config.js
CHANGED
|
@@ -1,30 +1,16 @@
|
|
|
1
1
|
export const DEFAULT_CONFIG = {
|
|
2
|
-
provider: 'claude',
|
|
3
2
|
models: {
|
|
4
|
-
plan: 'opus',
|
|
5
|
-
execute: 'opus',
|
|
6
|
-
nameGeneration: 'sonnet',
|
|
7
|
-
failureAnalysis: 'haiku',
|
|
8
|
-
prGeneration: 'sonnet',
|
|
9
|
-
config: 'sonnet',
|
|
3
|
+
plan: { model: 'opus', harness: 'claude' },
|
|
4
|
+
execute: { model: 'opus', harness: 'claude' },
|
|
5
|
+
nameGeneration: { model: 'sonnet', harness: 'claude' },
|
|
6
|
+
failureAnalysis: { model: 'haiku', harness: 'claude' },
|
|
7
|
+
prGeneration: { model: 'sonnet', harness: 'claude' },
|
|
8
|
+
config: { model: 'sonnet', harness: 'claude' },
|
|
10
9
|
},
|
|
11
10
|
effortMapping: {
|
|
12
|
-
low: 'sonnet',
|
|
13
|
-
medium: 'opus',
|
|
14
|
-
high: 'opus',
|
|
15
|
-
},
|
|
16
|
-
codexModels: {
|
|
17
|
-
plan: 'gpt-5.3-codex',
|
|
18
|
-
execute: 'gpt-5.4',
|
|
19
|
-
nameGeneration: 'gpt-5.3-codex-spark',
|
|
20
|
-
failureAnalysis: 'gpt-5.3-codex-spark',
|
|
21
|
-
prGeneration: 'gpt-5.3-codex',
|
|
22
|
-
config: 'gpt-5.3-codex',
|
|
23
|
-
},
|
|
24
|
-
codexEffortMapping: {
|
|
25
|
-
low: 'gpt-5.3-codex-spark',
|
|
26
|
-
medium: 'gpt-5.3-codex',
|
|
27
|
-
high: 'gpt-5.4',
|
|
11
|
+
low: { model: 'sonnet', harness: 'claude' },
|
|
12
|
+
medium: { model: 'opus', harness: 'claude' },
|
|
13
|
+
high: { model: 'opus', harness: 'claude' },
|
|
28
14
|
},
|
|
29
15
|
timeout: 60,
|
|
30
16
|
maxRetries: 3,
|
|
@@ -32,9 +18,9 @@ export const DEFAULT_CONFIG = {
|
|
|
32
18
|
worktree: false,
|
|
33
19
|
syncMainBranch: true,
|
|
34
20
|
commitFormat: {
|
|
35
|
-
task: '{prefix}[{
|
|
36
|
-
plan: '{prefix}[{
|
|
37
|
-
amend: '{prefix}[{
|
|
21
|
+
task: '{prefix}[{projectName}:{taskId}] {description}',
|
|
22
|
+
plan: '{prefix}[{projectName}] Plan: {description}',
|
|
23
|
+
amend: '{prefix}[{projectName}] Amend: {description}',
|
|
38
24
|
prefix: 'RAF',
|
|
39
25
|
},
|
|
40
26
|
display: {
|
|
@@ -42,8 +28,8 @@ export const DEFAULT_CONFIG = {
|
|
|
42
28
|
},
|
|
43
29
|
};
|
|
44
30
|
export const VALID_MODEL_ALIASES = ['sonnet', 'haiku', 'opus'];
|
|
45
|
-
export const VALID_CODEX_MODEL_ALIASES = ['
|
|
46
|
-
export const
|
|
31
|
+
export const VALID_CODEX_MODEL_ALIASES = ['codex', 'gpt54'];
|
|
32
|
+
export const VALID_HARNESSES = ['claude', 'codex'];
|
|
47
33
|
/**
|
|
48
34
|
* Regex for full Claude model IDs (e.g., `claude-sonnet-4-5-20250929`, `claude-opus-4-5-20251101`).
|
|
49
35
|
* Pattern: claude-{family}-{major}(-{minor})?(-{date})?
|
package/dist/types/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAyFA,MAAM,CAAC,MAAM,cAAc,GAAc;IACvC,MAAM,EAAE;QACN,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC1C,OAAO,EAAE,EAAE,KAAK,E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,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAEhD,qDAAqD;AACrD,MAAM,CAAC,MAAM,kBAAkB,GAA+B,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAExF,qDAAqD;AACrD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,cAAc,EAAE,cAAc,CAAC,OAAO;IACtC,iBAAiB,EAAE,cAAc,CAAC,UAAU;IAC5C,UAAU,EAAE,cAAc,CAAC,UAAU;CACtC,CAAC"}
|
package/dist/utils/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RafConfig, UserConfig,
|
|
1
|
+
import { RafConfig, UserConfig, TaskEffortLevel, ModelScenario, ModelEntry, CommitFormatType, DisplayConfig, EffortMappingConfig, HarnessName } from '../types/config.js';
|
|
2
2
|
export declare function getConfigPath(): string;
|
|
3
3
|
/**
|
|
4
4
|
* Get the path to Claude CLI settings file.
|
|
@@ -12,22 +12,23 @@ export declare class ConfigValidationError extends Error {
|
|
|
12
12
|
* Accepts:
|
|
13
13
|
* - Claude short aliases: sonnet, haiku, opus
|
|
14
14
|
* - Claude full IDs: claude-opus-4-6
|
|
15
|
-
* - Codex short aliases:
|
|
16
|
-
* - Raw Codex model IDs: gpt-5.4, gpt-5.3-codex
|
|
15
|
+
* - Codex short aliases: codex, gpt54
|
|
16
|
+
* - Raw Codex model IDs: gpt-5.4, gpt-5.3-codex
|
|
17
17
|
* - Harness-prefixed format: claude/opus, codex/gpt-5.4
|
|
18
18
|
*/
|
|
19
19
|
export declare function isValidModelName(value: string): boolean;
|
|
20
20
|
/**
|
|
21
|
-
* Parse a model spec string into its
|
|
22
|
-
* - `codex/gpt-5.4` -> {
|
|
23
|
-
* - `claude/opus` -> {
|
|
24
|
-
* - `opus` -> {
|
|
25
|
-
* - `gpt-5.4` -> {
|
|
21
|
+
* Parse a model spec string into its harness and model components.
|
|
22
|
+
* - `codex/gpt-5.4` -> { harness: 'codex', model: 'gpt-5.4' }
|
|
23
|
+
* - `claude/opus` -> { harness: 'claude', model: 'opus' }
|
|
24
|
+
* - `opus` -> { harness: 'claude', model: 'opus' } (defaults to claude)
|
|
25
|
+
* - `gpt-5.4` -> { harness: 'codex', model: 'gpt-5.4' } (inferred from model format)
|
|
26
26
|
*/
|
|
27
27
|
export declare function parseModelSpec(modelSpec: string): {
|
|
28
|
-
|
|
28
|
+
harness: HarnessName;
|
|
29
29
|
model: string;
|
|
30
30
|
};
|
|
31
|
+
export declare function collectConfigValidationWarnings(config: UserConfig): string[];
|
|
31
32
|
export declare function validateConfig(config: unknown): UserConfig;
|
|
32
33
|
/**
|
|
33
34
|
* Resolve the final config by loading from ~/.raf/raf.config.json and merging with defaults.
|
|
@@ -49,15 +50,18 @@ export declare function saveConfig(configPath: string, config: UserConfig): void
|
|
|
49
50
|
*/
|
|
50
51
|
export declare function getResolvedConfig(): RafConfig;
|
|
51
52
|
export declare function resetConfigCache(): void;
|
|
52
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Get the model entry for a scenario.
|
|
55
|
+
*/
|
|
56
|
+
export declare function getModel(scenario: ModelScenario): ModelEntry;
|
|
53
57
|
/**
|
|
54
58
|
* Get the full effort mapping config.
|
|
55
59
|
*/
|
|
56
|
-
export declare function getEffortMapping(
|
|
60
|
+
export declare function getEffortMapping(): EffortMappingConfig;
|
|
57
61
|
/**
|
|
58
|
-
* Resolve a task effort level to a model
|
|
62
|
+
* Resolve a task effort level to a model entry using the effort mapping config.
|
|
59
63
|
*/
|
|
60
|
-
export declare function resolveEffortToModel(effort: TaskEffortLevel
|
|
64
|
+
export declare function resolveEffortToModel(effort: TaskEffortLevel): ModelEntry;
|
|
61
65
|
/**
|
|
62
66
|
* Get the numeric tier of a model for comparison.
|
|
63
67
|
* Extracts family from full model IDs (e.g., 'claude-opus-4-6' -> 3).
|
|
@@ -65,10 +69,11 @@ export declare function resolveEffortToModel(effort: TaskEffortLevel, provider?:
|
|
|
65
69
|
*/
|
|
66
70
|
export declare function getModelTier(modelName: string): number;
|
|
67
71
|
/**
|
|
68
|
-
* Apply ceiling to a model based on the configured models.execute ceiling.
|
|
69
|
-
* Returns the lower-tier
|
|
72
|
+
* Apply ceiling to a model entry based on the configured models.execute ceiling.
|
|
73
|
+
* Returns the lower-tier entry between the input and the ceiling.
|
|
74
|
+
* When the input exceeds the ceiling, the ceiling entry is returned (including its harness).
|
|
70
75
|
*/
|
|
71
|
-
export declare function applyModelCeiling(
|
|
76
|
+
export declare function applyModelCeiling(resolved: ModelEntry, ceiling?: ModelEntry): ModelEntry;
|
|
72
77
|
export declare function getCommitFormat(type: CommitFormatType): string;
|
|
73
78
|
export declare function getCommitPrefix(): string;
|
|
74
79
|
export declare function getTimeout(): number;
|
|
@@ -82,6 +87,20 @@ export declare function getSyncMainBranch(): boolean;
|
|
|
82
87
|
* Returns the original string if no known alias can be extracted.
|
|
83
88
|
*/
|
|
84
89
|
export declare function getModelShortName(modelId: string): string;
|
|
90
|
+
/**
|
|
91
|
+
* Get the centralized user-facing display label for a model.
|
|
92
|
+
* Keeps concise Claude labels, while normalizing compact aliases like gpt54 -> gpt-5.4.
|
|
93
|
+
*/
|
|
94
|
+
export declare function getModelDisplayName(modelId: string): string;
|
|
95
|
+
interface ModelDisplayOptions {
|
|
96
|
+
includeHarness?: boolean;
|
|
97
|
+
fullId?: boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Format a model label for user-facing logs.
|
|
101
|
+
* Defaults to the centralized display policy, or can opt into explicit full-ID display.
|
|
102
|
+
*/
|
|
103
|
+
export declare function formatModelDisplay(model: string, harness?: HarnessName, options?: ModelDisplayOptions): string;
|
|
85
104
|
/**
|
|
86
105
|
* Resolve a model name to its full model ID.
|
|
87
106
|
* If already a full model ID, returns as-is.
|
|
@@ -115,4 +134,5 @@ export declare function getConfig(): {
|
|
|
115
134
|
maxRetries: number;
|
|
116
135
|
autoCommit: boolean;
|
|
117
136
|
};
|
|
137
|
+
export {};
|
|
118
138
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,SAAS,EAGT,UAAU,EAKV,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,SAAS,EAGT,UAAU,EAKV,eAAe,EACf,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAM5B,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AA+BD,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM;CAI5B;AAaD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAwBvD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAazF;AAwDD,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,EAAE,CAgB5E;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,UAAU,CAwG1D;AAyED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CA+B5D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAEtH;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,M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