@bastani/atomic 0.5.12-5 → 0.5.13-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/dist/lib/path-root-guard.d.ts +4 -0
- package/dist/lib/path-root-guard.d.ts.map +1 -0
- package/dist/sdk/components/color-utils.d.ts +4 -0
- package/dist/sdk/components/color-utils.d.ts.map +1 -0
- package/dist/sdk/components/compact-switcher.d.ts +10 -0
- package/dist/sdk/components/compact-switcher.d.ts.map +1 -0
- package/dist/sdk/components/connectors.d.ts +15 -0
- package/dist/sdk/components/connectors.d.ts.map +1 -0
- package/dist/sdk/components/edge.d.ts +4 -0
- package/dist/sdk/components/edge.d.ts.map +1 -0
- package/dist/sdk/components/error-boundary.d.ts +23 -0
- package/dist/sdk/components/error-boundary.d.ts.map +1 -0
- package/dist/sdk/components/graph-theme.d.ts +17 -0
- package/dist/sdk/components/graph-theme.d.ts.map +1 -0
- package/dist/sdk/components/header.d.ts +3 -0
- package/dist/sdk/components/header.d.ts.map +1 -0
- package/dist/sdk/components/hooks.d.ts +15 -0
- package/dist/sdk/components/hooks.d.ts.map +1 -0
- package/dist/sdk/components/layout.d.ts +27 -0
- package/dist/sdk/components/layout.d.ts.map +1 -0
- package/dist/sdk/components/node-card.d.ts +10 -0
- package/dist/sdk/components/node-card.d.ts.map +1 -0
- package/dist/sdk/components/orchestrator-panel-contexts.d.ts +16 -0
- package/dist/sdk/components/orchestrator-panel-contexts.d.ts.map +1 -0
- package/dist/sdk/components/orchestrator-panel-store.d.ts +50 -0
- package/dist/sdk/components/orchestrator-panel-store.d.ts.map +1 -0
- package/dist/sdk/components/orchestrator-panel-types.d.ts +18 -0
- package/dist/sdk/components/orchestrator-panel-types.d.ts.map +1 -0
- package/dist/sdk/components/orchestrator-panel.d.ts +56 -0
- package/dist/sdk/components/orchestrator-panel.d.ts.map +1 -0
- package/dist/sdk/components/session-graph-panel.d.ts +7 -0
- package/dist/sdk/components/session-graph-panel.d.ts.map +1 -0
- package/dist/sdk/components/status-helpers.d.ts +6 -0
- package/dist/sdk/components/status-helpers.d.ts.map +1 -0
- package/dist/sdk/components/statusline.d.ts +7 -0
- package/dist/sdk/components/statusline.d.ts.map +1 -0
- package/dist/sdk/components/workflow-picker-panel.d.ts +128 -0
- package/dist/sdk/components/workflow-picker-panel.d.ts.map +1 -0
- package/dist/sdk/define-workflow.d.ts +91 -0
- package/dist/sdk/define-workflow.d.ts.map +1 -0
- package/dist/sdk/errors.d.ts +24 -0
- package/dist/sdk/errors.d.ts.map +1 -0
- package/dist/sdk/index.d.ts +13 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/providers/claude.d.ts +187 -0
- package/dist/sdk/providers/claude.d.ts.map +1 -0
- package/dist/sdk/providers/copilot.d.ts +11 -0
- package/dist/sdk/providers/copilot.d.ts.map +1 -0
- package/dist/sdk/providers/opencode.d.ts +11 -0
- package/dist/sdk/providers/opencode.d.ts.map +1 -0
- package/dist/sdk/runtime/discovery.d.ts +86 -0
- package/dist/sdk/runtime/discovery.d.ts.map +1 -0
- package/dist/sdk/runtime/executor-entry.d.ts +11 -0
- package/dist/sdk/runtime/executor-entry.d.ts.map +1 -0
- package/dist/sdk/runtime/executor.d.ts +72 -0
- package/dist/sdk/runtime/executor.d.ts.map +1 -0
- package/dist/sdk/runtime/graph-inference.d.ts +35 -0
- package/dist/sdk/runtime/graph-inference.d.ts.map +1 -0
- package/dist/sdk/runtime/loader.d.ts +70 -0
- package/dist/sdk/runtime/loader.d.ts.map +1 -0
- package/dist/sdk/runtime/panel.d.ts +9 -0
- package/dist/sdk/runtime/panel.d.ts.map +1 -0
- package/dist/sdk/runtime/theme.d.ts +28 -0
- package/dist/sdk/runtime/theme.d.ts.map +1 -0
- package/dist/sdk/runtime/tmux.d.ts +297 -0
- package/dist/sdk/runtime/tmux.d.ts.map +1 -0
- package/dist/sdk/types.d.ts +309 -0
- package/dist/sdk/types.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts +62 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts +46 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts +26 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts +92 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts +57 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts +49 -0
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts +18 -0
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts +19 -0
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts +69 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts +240 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts +20 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts.map +1 -0
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts +18 -0
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts.map +1 -0
- package/dist/sdk/workflows/index.d.ts +24 -0
- package/dist/sdk/workflows/index.d.ts.map +1 -0
- package/dist/services/config/definitions.d.ts +85 -0
- package/dist/services/config/definitions.d.ts.map +1 -0
- package/dist/services/system/copy.d.ts +77 -0
- package/dist/services/system/copy.d.ts.map +1 -0
- package/dist/services/system/detect.d.ts +75 -0
- package/dist/services/system/detect.d.ts.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ralph Prompt Utilities
|
|
3
|
+
*
|
|
4
|
+
* Prompts used by the Ralph plan → orchestrate → review → debug loop:
|
|
5
|
+
* - buildPlannerPrompt: initial planning OR re-planning from a debugger report
|
|
6
|
+
* - buildOrchestratorPrompt: spawn workers to execute the task list
|
|
7
|
+
* - buildInfraDiscoveryPrompts: prompts for parallel sub-agent infrastructure discovery
|
|
8
|
+
* - buildReviewPrompt: structured code review with injected changeset + discovery context
|
|
9
|
+
* - buildDebuggerReportPrompt: diagnose review findings, produce a re-plan brief
|
|
10
|
+
*
|
|
11
|
+
* Plus Zod schemas for structured output, parsing helpers for the reviewer
|
|
12
|
+
* JSON output, and the debugger markdown report.
|
|
13
|
+
*/
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
/** Zod schema for a single review finding. */
|
|
16
|
+
export declare const ReviewFindingSchema: z.ZodObject<{
|
|
17
|
+
title: z.ZodString;
|
|
18
|
+
body: z.ZodString;
|
|
19
|
+
confidence_score: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
code_location: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
absolute_file_path: z.ZodString;
|
|
23
|
+
line_range: z.ZodObject<{
|
|
24
|
+
start: z.ZodNumber;
|
|
25
|
+
end: z.ZodNumber;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
/** Zod schema for the full structured review output. */
|
|
30
|
+
export declare const ReviewResultSchema: z.ZodObject<{
|
|
31
|
+
findings: z.ZodArray<z.ZodObject<{
|
|
32
|
+
title: z.ZodString;
|
|
33
|
+
body: z.ZodString;
|
|
34
|
+
confidence_score: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
code_location: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
absolute_file_path: z.ZodString;
|
|
38
|
+
line_range: z.ZodObject<{
|
|
39
|
+
start: z.ZodNumber;
|
|
40
|
+
end: z.ZodNumber;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
}, z.core.$strip>>;
|
|
44
|
+
overall_correctness: z.ZodString;
|
|
45
|
+
overall_explanation: z.ZodString;
|
|
46
|
+
overall_confidence_score: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
/** JSON Schema derived from the Zod schema — used by Claude and OpenCode SDKs. */
|
|
49
|
+
export declare const REVIEW_RESULT_JSON_SCHEMA: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
50
|
+
findings: z.ZodArray<z.ZodObject<{
|
|
51
|
+
title: z.ZodString;
|
|
52
|
+
body: z.ZodString;
|
|
53
|
+
confidence_score: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
code_location: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
absolute_file_path: z.ZodString;
|
|
57
|
+
line_range: z.ZodObject<{
|
|
58
|
+
start: z.ZodNumber;
|
|
59
|
+
end: z.ZodNumber;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
overall_correctness: z.ZodString;
|
|
64
|
+
overall_explanation: z.ZodString;
|
|
65
|
+
overall_confidence_score: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
/** Result from a reviewer stage with structured output support. */
|
|
68
|
+
export interface StructuredReviewResult {
|
|
69
|
+
/** Parsed and filtered review from SDK structured output, or null if unavailable */
|
|
70
|
+
structured: ReviewResult | null;
|
|
71
|
+
/** Raw text output for fallback parsing and debugger input */
|
|
72
|
+
raw: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Merge two parallel reviewer results into one.
|
|
76
|
+
*
|
|
77
|
+
* Two independent reviewers run the same prompt simultaneously. This function
|
|
78
|
+
* unions their findings and picks the more conservative overall_correctness.
|
|
79
|
+
* When either reviewer's structured output is unavailable, it falls back to
|
|
80
|
+
* text parsing ({@link parseReviewResult}) before merging.
|
|
81
|
+
*/
|
|
82
|
+
export declare function mergeReviewResults(a: StructuredReviewResult, b: StructuredReviewResult): StructuredReviewResult;
|
|
83
|
+
export interface PlannerContext {
|
|
84
|
+
/** 1-indexed loop iteration. Iteration 1 = initial plan; >1 = re-plan. */
|
|
85
|
+
iteration: number;
|
|
86
|
+
/** Markdown report from the previous iteration's debugger sub-agent. */
|
|
87
|
+
debuggerReport?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Build the planner prompt. The first iteration decomposes the original spec;
|
|
91
|
+
* subsequent iterations decompose the work needed to resolve the debugger
|
|
92
|
+
* report from the previous loop iteration.
|
|
93
|
+
*/
|
|
94
|
+
export declare function buildPlannerPrompt(spec: string, context?: PlannerContext): string;
|
|
95
|
+
export interface OrchestratorContext {
|
|
96
|
+
/**
|
|
97
|
+
* Trailing commentary from the planner's last assistant message, if any.
|
|
98
|
+
* The Copilot and OpenCode workflows create a fresh session for each
|
|
99
|
+
* sub-agent, so the planner's in-session output is NOT automatically
|
|
100
|
+
* visible to the orchestrator — only what the planner persisted via
|
|
101
|
+
* `TaskCreate`. Forward the planner's final text here so the orchestrator
|
|
102
|
+
* sees any caveats, risks, or execution hints that didn't fit into task
|
|
103
|
+
* bodies.
|
|
104
|
+
*/
|
|
105
|
+
plannerNotes?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Build the orchestrator prompt. The orchestrator retrieves the planner's
|
|
109
|
+
* task list, validates the dependency graph, and spawns parallel workers.
|
|
110
|
+
*
|
|
111
|
+
* @param spec - The original user specification. Required because the
|
|
112
|
+
* orchestrator runs in a fresh session on Copilot/OpenCode and needs the
|
|
113
|
+
* end-user goal to resolve ambiguous tasks.
|
|
114
|
+
* @param context - Optional planner handoff context (trailing commentary).
|
|
115
|
+
*/
|
|
116
|
+
export declare function buildOrchestratorPrompt(spec: string, context?: OrchestratorContext): string;
|
|
117
|
+
/** Prompts for the three parallel infrastructure-discovery sub-agents. */
|
|
118
|
+
export interface InfraDiscoveryPrompts {
|
|
119
|
+
/** Prompt for the codebase-locator sub-agent. */
|
|
120
|
+
locator: string;
|
|
121
|
+
/** Prompt for the codebase-analyzer sub-agent. */
|
|
122
|
+
analyzer: string;
|
|
123
|
+
/** Prompt for the codebase-pattern-finder sub-agent. */
|
|
124
|
+
patternFinder: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Build prompts for three parallel sub-agent stages that discover the
|
|
128
|
+
* repository's build, test, lint, and CI infrastructure. Each sub-agent
|
|
129
|
+
* explores the codebase dynamically — no hard-coded file lists or patterns.
|
|
130
|
+
*
|
|
131
|
+
* Inspired by the deep-research-codebase workflow which dispatches
|
|
132
|
+
* codebase-locator, codebase-analyzer, and codebase-pattern-finder
|
|
133
|
+
* sub-agents in parallel for exploratory research.
|
|
134
|
+
*/
|
|
135
|
+
export declare function buildInfraDiscoveryPrompts(): InfraDiscoveryPrompts;
|
|
136
|
+
/** A single finding from the reviewer sub-agent. */
|
|
137
|
+
export interface ReviewFinding {
|
|
138
|
+
title: string;
|
|
139
|
+
body: string;
|
|
140
|
+
confidence_score?: number;
|
|
141
|
+
priority?: number;
|
|
142
|
+
code_location?: {
|
|
143
|
+
absolute_file_path: string;
|
|
144
|
+
line_range: {
|
|
145
|
+
start: number;
|
|
146
|
+
end: number;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/** Parsed reviewer JSON output. */
|
|
151
|
+
export interface ReviewResult {
|
|
152
|
+
findings: ReviewFinding[];
|
|
153
|
+
overall_correctness: string;
|
|
154
|
+
overall_explanation: string;
|
|
155
|
+
overall_confidence_score?: number;
|
|
156
|
+
}
|
|
157
|
+
export interface ReviewContext {
|
|
158
|
+
/**
|
|
159
|
+
* Full branch changeset captured by {@link captureBranchChangeset}.
|
|
160
|
+
* Contains diff stat, name-status, and uncommitted changes relative to
|
|
161
|
+
* the parent branch — giving the reviewer complete visibility into every
|
|
162
|
+
* change this branch introduces.
|
|
163
|
+
*/
|
|
164
|
+
changeset: {
|
|
165
|
+
baseBranch: string;
|
|
166
|
+
diffStat: string;
|
|
167
|
+
uncommitted: string;
|
|
168
|
+
nameStatus: string;
|
|
169
|
+
errors: string[];
|
|
170
|
+
};
|
|
171
|
+
/** 1-indexed loop iteration, used in the prompt header. */
|
|
172
|
+
iteration?: number;
|
|
173
|
+
/**
|
|
174
|
+
* When true, instructs the reviewer to call the `submit_review` tool
|
|
175
|
+
* instead of outputting JSON directly. Used by the Copilot SDK which
|
|
176
|
+
* achieves structured output through tool definitions.
|
|
177
|
+
*/
|
|
178
|
+
useSubmitTool?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Raw output from the parallel infrastructure-discovery sub-agents
|
|
181
|
+
* (codebase-locator, codebase-analyzer, codebase-pattern-finder).
|
|
182
|
+
* When present, the reviewer uses this to identify and run the
|
|
183
|
+
* repository's build/test/lint commands as part of verification.
|
|
184
|
+
*/
|
|
185
|
+
discoveryContext?: string;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Build the reviewer prompt. Injects a deterministic branch-relative
|
|
189
|
+
* changeset so the reviewer sees every file this branch has touched —
|
|
190
|
+
* both committed and uncommitted — without expensive tool calls.
|
|
191
|
+
*/
|
|
192
|
+
export declare function buildReviewPrompt(spec: string, context: ReviewContext): string;
|
|
193
|
+
export interface DebuggerContext {
|
|
194
|
+
/** 1-indexed loop iteration the debugger is investigating. */
|
|
195
|
+
iteration: number;
|
|
196
|
+
/**
|
|
197
|
+
* Branch changeset captured immediately before the review. Provides the
|
|
198
|
+
* debugger with the same file-level context as the reviewer.
|
|
199
|
+
*/
|
|
200
|
+
changeset: {
|
|
201
|
+
baseBranch: string;
|
|
202
|
+
diffStat: string;
|
|
203
|
+
uncommitted: string;
|
|
204
|
+
nameStatus: string;
|
|
205
|
+
errors: string[];
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Build a prompt asking the debugger sub-agent to investigate a set of review
|
|
210
|
+
* findings and produce a structured report. The debugger MUST NOT apply
|
|
211
|
+
* fixes — its only deliverable is the report, which the next iteration's
|
|
212
|
+
* planner consumes.
|
|
213
|
+
*/
|
|
214
|
+
export declare function buildDebuggerReportPrompt(review: ReviewResult | null, rawReview: string, context: DebuggerContext): string;
|
|
215
|
+
/**
|
|
216
|
+
* Parse the reviewer's JSON output. Tries, in order:
|
|
217
|
+
* 1. Direct JSON.parse on the entire content.
|
|
218
|
+
* 2. The LAST fenced ```json (or unlabelled) code block.
|
|
219
|
+
* 3. The LAST balanced object containing a "findings" key in surrounding prose.
|
|
220
|
+
*
|
|
221
|
+
* Filters out P3 (minor/style) findings — only P0/P1/P2 count as actionable.
|
|
222
|
+
* Returns null when no parse strategy succeeds.
|
|
223
|
+
*/
|
|
224
|
+
export declare function parseReviewResult(content: string): ReviewResult | null;
|
|
225
|
+
export declare function filterActionable(parsed: {
|
|
226
|
+
findings: ReviewFinding[];
|
|
227
|
+
overall_correctness: string;
|
|
228
|
+
overall_explanation?: string;
|
|
229
|
+
overall_confidence_score?: number;
|
|
230
|
+
}): ReviewResult;
|
|
231
|
+
/**
|
|
232
|
+
* Extract the LAST fenced ```markdown block from a piece of text. Used for
|
|
233
|
+
* parsing the debugger's structured report out of a long Claude pane
|
|
234
|
+
* scrollback or any other output that may include extra prose.
|
|
235
|
+
*
|
|
236
|
+
* Falls back to the trimmed full input when no fenced block is present, so
|
|
237
|
+
* the planner still receives the debugger's content even if formatting drifts.
|
|
238
|
+
*/
|
|
239
|
+
export declare function extractMarkdownBlock(content: string): string;
|
|
240
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/ralph/helpers/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,8CAA8C;AAC9C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;iBAY9B,CAAC;AAEH,wDAAwD;AACxD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;iBAK7B,CAAC;AAEH,kFAAkF;AAClF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;kBAAqC,CAAC;AAE5E,mEAAmE;AACnE,MAAM,WAAW,sBAAsB;IACrC,oFAAoF;IACpF,UAAU,EAAE,YAAY,GAAG,IAAI,CAAC;IAChC,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,sBAAsB,EACzB,CAAC,EAAE,sBAAsB,GACxB,sBAAsB,CAwCxB;AAMD,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,cAAiC,GACzC,MAAM,CAwER;AAMD,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;GAQG;A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E,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,GACrB,MAAM,CA0MR;AAMD,MAAM,WAAW,eAAe;IAC9B,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,EAAE;QACT,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;CACH;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,GAAG,IAAI,EAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,eAAe,GACvB,MAAM,CA0GR;AAMD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAgDtE;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,GAAG,YAAY,CAUf;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAS5D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Review analysis helpers for the Ralph workflow.
|
|
3
|
+
*
|
|
4
|
+
* Simplified versions of the internal conductor-based helpers,
|
|
5
|
+
* operating on direct values instead of StageOutput maps.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReviewResult } from "./prompts.ts";
|
|
8
|
+
/**
|
|
9
|
+
* Check whether the reviewer produced actionable findings.
|
|
10
|
+
*
|
|
11
|
+
* Returns true when:
|
|
12
|
+
* 1. The parsed ReviewResult has one or more findings, OR
|
|
13
|
+
* 2. The review could not be parsed (null) but the raw response
|
|
14
|
+
* text is non-empty (treat unparseable output as actionable).
|
|
15
|
+
*
|
|
16
|
+
* @param review - Parsed ReviewResult, or null if parsing failed.
|
|
17
|
+
* @param rawText - The raw reviewer response text.
|
|
18
|
+
*/
|
|
19
|
+
export declare function hasActionableFindings(review: ReviewResult | null, rawText: string): boolean;
|
|
20
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/ralph/helpers/review.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,GAAG,IAAI,EAC3B,OAAO,EAAE,MAAM,GACd,OAAO,CAQT"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ralph workflow for OpenCode — plan → orchestrate → review → debug loop.
|
|
3
|
+
*
|
|
4
|
+
* Each sub-agent invocation spawns its own visible session in the graph,
|
|
5
|
+
* so users can see each iteration's progress in real time. The loop
|
|
6
|
+
* terminates when:
|
|
7
|
+
* - {@link MAX_LOOPS} iterations have completed, OR
|
|
8
|
+
* - Two parallel reviewer passes both return zero findings.
|
|
9
|
+
*
|
|
10
|
+
* The reviewer stages use the OpenCode SDK's structured output
|
|
11
|
+
* (`format: { type: "json_schema" }`) to guarantee the review result
|
|
12
|
+
* matches the {@link ReviewResultSchema}.
|
|
13
|
+
*
|
|
14
|
+
* Run: atomic workflow -n ralph -a opencode "<your spec>"
|
|
15
|
+
*/
|
|
16
|
+
declare const _default: import("../../../index.ts").WorkflowDefinition<"opencode", "prompt">;
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/ralph/opencode/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAqDH,wBA4La"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* atomic/workflows
|
|
3
|
+
*
|
|
4
|
+
* Workflow SDK for defining dynamic agent workflows.
|
|
5
|
+
* Workflows use defineWorkflow().run().compile() with ctx.stage()
|
|
6
|
+
* for spawning agent sessions using native TypeScript control flow.
|
|
7
|
+
*/
|
|
8
|
+
export { defineWorkflow, WorkflowBuilder } from "../define-workflow.ts";
|
|
9
|
+
export type { AgentType, ValidationWarning, Transcript, SavedMessage, SaveTranscript, SessionContext, SessionRef, SessionHandle, SessionRunOptions, WorkflowContext, WorkflowOptions, WorkflowDefinition, WorkflowInput, WorkflowInputType, StageClientOptions, StageSessionOptions, ProviderClient, ProviderSession, CopilotClient, CopilotClientOptions, CopilotSession, CopilotSessionConfig, OpencodeClient, OpencodeSession, ClaudeClientWrapper, ClaudeSessionWrapper, ClaudeQueryDefaults, } from "../types.ts";
|
|
10
|
+
export type { SessionEvent as CopilotSessionEvent } from "@github/copilot-sdk";
|
|
11
|
+
export type { SessionPromptResponse as OpenCodePromptResponse } from "@opencode-ai/sdk/v2";
|
|
12
|
+
export type { SessionMessage as ClaudeSessionMessage } from "@anthropic-ai/claude-agent-sdk";
|
|
13
|
+
export { createClaudeSession, claudeQuery, clearClaudeSession, extractAssistantText, validateClaudeWorkflow } from "../providers/claude.ts";
|
|
14
|
+
export type { ClaudeSessionOptions, ClaudeQueryOptions } from "../providers/claude.ts";
|
|
15
|
+
export { validateCopilotWorkflow } from "../providers/copilot.ts";
|
|
16
|
+
export { validateOpenCodeWorkflow } from "../providers/opencode.ts";
|
|
17
|
+
export type { TmuxResult, TmuxSession, SessionType } from "../runtime/tmux.ts";
|
|
18
|
+
export { SOCKET_NAME, isTmuxInstalled, getMuxBinary, resetMuxBinaryCache, isInsideTmux, isInsideAtomicSocket, createSession, createWindow, createPane, sendLiteralText, sendSpecialKey, sendKeysAndSubmit, capturePane, capturePaneVisible, capturePaneScrollback, killSession, killWindow, sessionExists, listSessions, attachSession, spawnMuxAttach, switchClient, getCurrentSession, attachOrSwitch, detachAndAttachAtomic, selectWindow, setSessionEnv, getSessionEnv, parseSessionName, waitForOutput, tmuxRun, normalizeTmuxCapture, normalizeTmuxLines, paneLooksReady, paneHasActiveTask, paneIsIdle, waitForPaneReady, attemptSubmitRounds, } from "../runtime/tmux.ts";
|
|
19
|
+
export { AGENTS, discoverWorkflows, findWorkflow, loadWorkflowsMetadata, WORKFLOWS_GITIGNORE, } from "../runtime/discovery.ts";
|
|
20
|
+
export type { DiscoveredWorkflow, WorkflowWithMetadata, } from "../runtime/discovery.ts";
|
|
21
|
+
export { WorkflowLoader } from "../runtime/loader.ts";
|
|
22
|
+
export { executeWorkflow } from "../runtime/executor.ts";
|
|
23
|
+
export type { WorkflowRunOptions } from "../runtime/executor.ts";
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/workflows/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExE,YAAY,EACV,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,cAAc,EACd,cAAc,EACd,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf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;AACjC,YAAY,EACV,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent configuration definitions for atomic CLI
|
|
3
|
+
*/
|
|
4
|
+
export interface AgentConfig {
|
|
5
|
+
/** Display name for the agent */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Command to execute the agent */
|
|
8
|
+
cmd: string;
|
|
9
|
+
/** Flags used when spawning the agent in interactive chat mode */
|
|
10
|
+
chat_flags: string[];
|
|
11
|
+
/** Environment variables to set when spawning the agent (merged with process env) */
|
|
12
|
+
env_vars: Record<string, string>;
|
|
13
|
+
/** Config folder relative to repo root */
|
|
14
|
+
folder: string;
|
|
15
|
+
/** URL for installation instructions */
|
|
16
|
+
install_url: string;
|
|
17
|
+
/** Paths to exclude when copying (relative to folder) */
|
|
18
|
+
exclude: string[];
|
|
19
|
+
/** Project files managed by `atomic init` for provider onboarding */
|
|
20
|
+
onboarding_files: Array<{
|
|
21
|
+
source: string;
|
|
22
|
+
destination: string;
|
|
23
|
+
merge: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
26
|
+
declare const AGENT_KEYS: readonly ["claude", "opencode", "copilot"];
|
|
27
|
+
export type AgentKey = (typeof AGENT_KEYS)[number];
|
|
28
|
+
export declare const AGENT_CONFIG: Record<AgentKey, AgentConfig>;
|
|
29
|
+
export declare function isValidAgent(key: string): key is AgentKey;
|
|
30
|
+
export declare function getAgentConfig(key: AgentKey): AgentConfig;
|
|
31
|
+
export declare function getAgentKeys(): AgentKey[];
|
|
32
|
+
/**
|
|
33
|
+
* Source Control Management (SCM) configuration definitions
|
|
34
|
+
*/
|
|
35
|
+
/** SCM keys for iteration */
|
|
36
|
+
declare const SCM_KEYS: readonly ["github", "sapling"];
|
|
37
|
+
/** Supported source control types — derived from SCM_KEYS tuple. */
|
|
38
|
+
export type SourceControlType = (typeof SCM_KEYS)[number];
|
|
39
|
+
export interface ScmConfig {
|
|
40
|
+
/** Internal identifier */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Display name for prompts */
|
|
43
|
+
displayName: string;
|
|
44
|
+
/** Primary CLI tool (git or sl) */
|
|
45
|
+
cliTool: string;
|
|
46
|
+
/** Code review tool (gh, jf submit, arc diff, etc.) */
|
|
47
|
+
reviewTool: string;
|
|
48
|
+
/** Code review system (github, phabricator) */
|
|
49
|
+
reviewSystem: string;
|
|
50
|
+
/** Directory marker for potential future auto-detection */
|
|
51
|
+
detectDir: string;
|
|
52
|
+
/** Code review command file name */
|
|
53
|
+
reviewCommandFile: string;
|
|
54
|
+
/** Required configuration files */
|
|
55
|
+
requiredConfigFiles?: string[];
|
|
56
|
+
}
|
|
57
|
+
export declare const SCM_CONFIG: Record<SourceControlType, ScmConfig>;
|
|
58
|
+
/** Commands that have SCM-specific variants */
|
|
59
|
+
export declare const SCM_SPECIFIC_COMMANDS: string[];
|
|
60
|
+
/**
|
|
61
|
+
* SCM-variant skill names, grouped by source control type.
|
|
62
|
+
*
|
|
63
|
+
* These are the skills that `installGlobalSkills` removes from the global
|
|
64
|
+
* scope after the initial install, and that `installLocalScmSkills`
|
|
65
|
+
* re-installs per-project based on the user's selected SCM. Passed to
|
|
66
|
+
* `npx skills add --skill <name>` as explicit names (the skills CLI does
|
|
67
|
+
* not support glob patterns like `gh-*`).
|
|
68
|
+
*/
|
|
69
|
+
export declare const SCM_SKILLS_BY_TYPE: Record<SourceControlType, readonly string[]>;
|
|
70
|
+
/** Flat list of every SCM-variant skill across all source control types. */
|
|
71
|
+
export declare const ALL_SCM_SKILLS: readonly string[];
|
|
72
|
+
/**
|
|
73
|
+
* Get all SCM keys for iteration
|
|
74
|
+
*/
|
|
75
|
+
export declare function getScmKeys(): SourceControlType[];
|
|
76
|
+
/**
|
|
77
|
+
* Check if a string is a valid SCM type
|
|
78
|
+
*/
|
|
79
|
+
export declare function isValidScm(key: string): key is SourceControlType;
|
|
80
|
+
/**
|
|
81
|
+
* Get the configuration for a specific SCM type
|
|
82
|
+
*/
|
|
83
|
+
export declare function getScmConfig(key: SourceControlType): ScmConfig;
|
|
84
|
+
export {};
|
|
85
|
+
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/services/config/definitions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,WAAW;IAC1B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,qFAAqF;IACrF,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,qEAAqE;IACrE,gBAAgB,EAAE,KAAK,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC,CAAC;CACJ;AAED,QAAA,MAAM,UAAU,4CAA6C,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAyEtD,CAAC;AAEF,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,QAAQ,CAEzD;AAED,wBA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1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for copying directories and files with exclusions
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Safely create a directory (and parents) without throwing on EEXIST.
|
|
6
|
+
*
|
|
7
|
+
* `mkdir` with `{ recursive: true }` is supposed to be idempotent, but
|
|
8
|
+
* cloud-sync tools like OneDrive can create the directory between the
|
|
9
|
+
* internal existence check and the actual syscall, causing a spurious
|
|
10
|
+
* EEXIST error on Windows. This wrapper absorbs that race.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ensureDir(path: string): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Synchronous version of {@link ensureDir}.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ensureDirSync(path: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Normalize a path for cross-platform comparison.
|
|
19
|
+
* Converts Windows backslashes to forward slashes so that exclusion
|
|
20
|
+
* patterns work consistently on both Windows and Unix systems.
|
|
21
|
+
*
|
|
22
|
+
* @param p - The path to normalize
|
|
23
|
+
* @returns The path with all backslashes converted to forward slashes
|
|
24
|
+
*/
|
|
25
|
+
export declare function normalizePath(p: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Check if a target path is safe (doesn't escape the base directory)
|
|
28
|
+
* Protects against path traversal attacks
|
|
29
|
+
*/
|
|
30
|
+
export declare function isPathSafe(basePath: string, targetPath: string): boolean;
|
|
31
|
+
interface CopyOptions {
|
|
32
|
+
/** Paths to exclude (relative to source root or base names) */
|
|
33
|
+
exclude?: string[];
|
|
34
|
+
/** Whether to skip scripts for the opposite platform */
|
|
35
|
+
skipOppositeScripts?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Copy a single file using Bun's file API
|
|
39
|
+
* @throws Error if the copy operation fails
|
|
40
|
+
*/
|
|
41
|
+
export declare function copyFile(src: string, dest: string): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Check if a path should be excluded based on exclusion rules.
|
|
44
|
+
* Uses normalized paths (forward slashes) to ensure consistent matching
|
|
45
|
+
* on both Windows and Unix systems.
|
|
46
|
+
*/
|
|
47
|
+
export declare function shouldExclude(relativePath: string, name: string, exclude: string[]): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Recursively copy a directory, overwriting existing destination files.
|
|
50
|
+
*/
|
|
51
|
+
export declare function copyDir(src: string, dest: string, options?: CopyOptions, rootSrc?: string, rootDest?: string): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Recursively copy a directory without overwriting existing destination files.
|
|
54
|
+
*/
|
|
55
|
+
export declare function copyDirNonDestructive(src: string, dest: string, options?: CopyOptions, rootSrc?: string, rootDest?: string): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Check if a path exists
|
|
58
|
+
*/
|
|
59
|
+
export declare function pathExists(path: string): Promise<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* Check if a path is a directory
|
|
62
|
+
*/
|
|
63
|
+
export declare function isDirectory(path: string): Promise<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
* Check if a file is empty or contains only whitespace.
|
|
66
|
+
*
|
|
67
|
+
* A file is considered empty if:
|
|
68
|
+
* - It does not exist (returns true to allow overwrite)
|
|
69
|
+
* - It has 0 bytes
|
|
70
|
+
* - It contains only whitespace characters (for files under 1KB)
|
|
71
|
+
*
|
|
72
|
+
* @param path - The path to the file to check
|
|
73
|
+
* @returns true if the file is empty or whitespace-only, false otherwise
|
|
74
|
+
*/
|
|
75
|
+
export declare function isFileEmpty(path: string): Promise<boolean>;
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=copy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../src/services/system/copy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAa3D;A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hE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAqBhE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for command and platform detection
|
|
3
|
+
*/
|
|
4
|
+
export declare const WSL_INSTALL_URL = "https://learn.microsoft.com/en-us/windows/wsl/install";
|
|
5
|
+
/**
|
|
6
|
+
* Check if a command is installed and available in PATH
|
|
7
|
+
*/
|
|
8
|
+
export declare function isCommandInstalled(cmd: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Get the resolved absolute path to a command executable.
|
|
11
|
+
*
|
|
12
|
+
* On Windows, this properly resolves .cmd, .bat, .exe and other executable
|
|
13
|
+
* extensions through Bun.which(), which handles the PATHEXT environment
|
|
14
|
+
* variable. This is essential for spawning commands correctly on Windows
|
|
15
|
+
* where 'opencode' might actually be 'opencode.cmd'.
|
|
16
|
+
*
|
|
17
|
+
* @param cmd - The command name to resolve (e.g., 'opencode', 'claude')
|
|
18
|
+
* @returns The absolute path to the command, or null if not found
|
|
19
|
+
*/
|
|
20
|
+
export declare function getCommandPath(cmd: string): string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Get the version string of a command
|
|
23
|
+
* Returns null if command is not installed or version check fails
|
|
24
|
+
*/
|
|
25
|
+
export declare function getCommandVersion(cmd: string): string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Check if running on Windows
|
|
28
|
+
*/
|
|
29
|
+
export declare function isWindows(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Check if running on macOS
|
|
32
|
+
*/
|
|
33
|
+
export declare function isMacOS(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Check if running on Linux
|
|
36
|
+
*/
|
|
37
|
+
export declare function isLinux(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Get the appropriate script extension for the current platform
|
|
40
|
+
* Returns ".ps1" on Windows, ".sh" on Unix-like systems
|
|
41
|
+
*/
|
|
42
|
+
export declare function getScriptExtension(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Get the opposite script extension (for filtering)
|
|
45
|
+
* Returns ".sh" on Windows, ".ps1" on Unix-like systems
|
|
46
|
+
*/
|
|
47
|
+
export declare function getOppositeScriptExtension(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Check if WSL is installed on Windows
|
|
50
|
+
* Returns false on non-Windows platforms
|
|
51
|
+
*/
|
|
52
|
+
export declare function isWslInstalled(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Check if colors are enabled (respects NO_COLOR standard)
|
|
55
|
+
* See: https://no-color.org/
|
|
56
|
+
*/
|
|
57
|
+
export declare function supportsColor(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Check if the terminal supports true color (24-bit).
|
|
60
|
+
*
|
|
61
|
+
* Checks COLORTERM, TERM, and TERM_PROGRAM environment variables.
|
|
62
|
+
* macOS Terminal.app (Apple_Terminal) does NOT support truecolor and
|
|
63
|
+
* will degrade hex colors to washed-out 256-color approximations.
|
|
64
|
+
*/
|
|
65
|
+
export declare function supportsTrueColor(): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Check if the terminal supports 256 colors
|
|
68
|
+
*
|
|
69
|
+
* Note: This returns true when supportsTrueColor() returns true.
|
|
70
|
+
* Since supportsTrueColor() defaults to true for modern terminals,
|
|
71
|
+
* this function will also return true in most cases. This is intentional -
|
|
72
|
+
* most modern terminals support at least 256 colors.
|
|
73
|
+
*/
|
|
74
|
+
export declare function supports256Color(): boolean;
|
|
75
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../../src/services/system/detect.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,eAAe,0DAC6B,CAAC;AAE1D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEzD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAc5D;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED;;GAEG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAEjC;AAED;;GAEG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAEjC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAIxC;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAMvC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAgC3C;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAG1C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13-0",
|
|
4
4
|
"description": "Configuration management CLI and SDK for coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
43
|
"src",
|
|
44
|
+
"dist",
|
|
44
45
|
"assets/settings.schema.json",
|
|
45
46
|
".agents/skills",
|
|
46
47
|
".claude/agents",
|