ralph-teams 1.0.7 → 1.0.8
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/agents/builder.md +8 -9
- package/.codex/agents/builder.toml +1 -2
- package/.codex/agents/validator.toml +1 -1
- package/.github/agents/builder.agent.md +8 -9
- package/README.md +7 -5
- package/dist/discuss.d.ts +0 -7
- package/dist/discuss.d.ts.map +1 -1
- package/dist/discuss.js +8 -75
- package/dist/discuss.js.map +1 -1
- package/dist/runtime-paths.d.ts +0 -1
- package/dist/runtime-paths.d.ts.map +1 -1
- package/dist/runtime-paths.js +0 -4
- package/dist/runtime-paths.js.map +1 -1
- package/package.json +1 -1
- package/prompts/team-lead-policy.md +0 -1
- package/ralph.sh +2 -4
- package/dist/guidance.d.ts +0 -59
- package/dist/guidance.d.ts.map +0 -1
- package/dist/guidance.js +0 -153
- package/dist/guidance.js.map +0 -1
|
@@ -15,15 +15,14 @@ You are the hands. You implement. You do NOT plan the epic, choose what to work
|
|
|
15
15
|
## Workflow
|
|
16
16
|
|
|
17
17
|
1. **Read the Team Lead's assignment** — The Team Lead will message you directly with the story details, acceptance criteria, relevant plan section, and any retry feedback.
|
|
18
|
-
2. **
|
|
19
|
-
3. **
|
|
20
|
-
4. **
|
|
21
|
-
5. **
|
|
22
|
-
6. **
|
|
23
|
-
7. **
|
|
24
|
-
8. **
|
|
25
|
-
9. **
|
|
26
|
-
10. **Report back** — Send a message to the Team Lead confirming completion. **Always include the full commit SHA** so the Validator can inspect exactly what changed.
|
|
18
|
+
2. **Read the implementation plan** — Check `.ralph-teams/plans/plan-{epic-id}.md` for the Planner's approach and test design for this story
|
|
19
|
+
3. **Understand the task** — Read the story details, acceptance criteria, plan section, and any feedback from previous attempts
|
|
20
|
+
4. **Create or update the story tests first** — If the plan includes tests to add or update, implement those tests. If no Planner/test design exists, work TDD-style: define the story's automated tests yourself, confirm they fail on the current code, then proceed.
|
|
21
|
+
5. **Implement** — Write clean, minimal code that satisfies the acceptance criteria and makes the story tests pass
|
|
22
|
+
6. **Quality checks** — Run whatever the project uses (typecheck, lint, test), including the story-specific verification commands. Fix issues before committing.
|
|
23
|
+
7. **Commit** — Use conventional commit format: `feat: [Story ID] - [Story Title]`
|
|
24
|
+
8. **Get the commit SHA** — After committing, run `git rev-parse HEAD` to get the full commit SHA
|
|
25
|
+
9. **Report back** — Send a message to the Team Lead confirming completion. **Always include the full commit SHA** so the Validator can inspect exactly what changed.
|
|
27
26
|
|
|
28
27
|
Message format:
|
|
29
28
|
```
|
|
@@ -7,11 +7,10 @@ Your job is to implement the assigned story, create or update the story's automa
|
|
|
7
7
|
|
|
8
8
|
Rules:
|
|
9
9
|
- Only work on the story assigned in the prompt.
|
|
10
|
-
- Before implementing, check if a guidance file exists at `guidance/guidance-{story-id}.md`. If it exists, read it and follow it.
|
|
11
10
|
- Read the implementation plan at `.ralph-teams/plans/plan-<epic-id>.md` before implementing, and follow the relevant section for the assigned story.
|
|
12
11
|
- If the plan includes a test design for the story, implement those tests and make them pass.
|
|
13
12
|
- If no planner was used or no story test design is available, work in TDD order yourself: define or update the story's automated tests first, make sure they fail against the current code, then implement until they pass.
|
|
14
|
-
- Follow the implementation plan
|
|
13
|
+
- Follow the implementation plan and existing code patterns.
|
|
15
14
|
- Run the relevant quality checks before finishing.
|
|
16
15
|
- Commit using a conventional message that includes the story ID.
|
|
17
16
|
- Report back with:
|
|
@@ -7,7 +7,7 @@ Your job is to independently verify whether the assigned story satisfies its acc
|
|
|
7
7
|
|
|
8
8
|
Rules:
|
|
9
9
|
- Inspect the exact commit with `git diff <sha>~1 <sha>`.
|
|
10
|
-
- Verify against the story acceptance criteria provided by the Team Lead. If plan
|
|
10
|
+
- Verify against the story acceptance criteria provided by the Team Lead. If plan context is provided, use it as supporting context, but acceptance criteria remain the source of truth.
|
|
11
11
|
- Run the relevant tests or verification commands yourself.
|
|
12
12
|
- If the story affects UI behavior and local verification is possible, use browser tooling when available.
|
|
13
13
|
- Report in this structure:
|
|
@@ -14,15 +14,14 @@ You are the hands. You implement. You do NOT plan the epic, choose what to work
|
|
|
14
14
|
|
|
15
15
|
## Workflow
|
|
16
16
|
|
|
17
|
-
1. **
|
|
18
|
-
2. **
|
|
19
|
-
3. **
|
|
20
|
-
4. **
|
|
21
|
-
5. **
|
|
22
|
-
6. **
|
|
23
|
-
7. **
|
|
24
|
-
8. **
|
|
25
|
-
9. **Report back** — Return the commit SHA and a brief summary of what was implemented
|
|
17
|
+
1. **Read the implementation plan** — Check `.ralph-teams/plans/plan-{epic-id}.md` for the Planner's approach and test design for this story
|
|
18
|
+
2. **Understand the task** — Read the story details, acceptance criteria, plan section, and any feedback from previous attempts
|
|
19
|
+
3. **Create or update the story tests first** — If the plan includes tests to add or update, implement those tests. If no Planner/test design exists, work TDD-style: define the story's automated tests yourself, confirm they fail on the current code, then proceed.
|
|
20
|
+
4. **Implement** — Write clean, minimal code that satisfies the acceptance criteria and makes the story tests pass
|
|
21
|
+
5. **Quality checks** — Run whatever the project uses (typecheck, lint, test), including the story-specific verification commands. Fix issues before committing.
|
|
22
|
+
6. **Commit** — Use conventional commit format: `feat: [Story ID] - [Story Title]`
|
|
23
|
+
7. **Get commit SHA** — Run `git rev-parse HEAD` to get the commit SHA
|
|
24
|
+
8. **Report back** — Return the commit SHA and a brief summary of what was implemented
|
|
26
25
|
|
|
27
26
|
## Report Format
|
|
28
27
|
|
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ The system has two layers:
|
|
|
55
55
|
- `builder` makes changes and runs tests
|
|
56
56
|
- `validator` verifies the result independently
|
|
57
57
|
|
|
58
|
-
Across all backends, `builder` and `validator` are one-shot story-scoped workers. The Team Lead must spawn a fresh Builder for each story attempt, spawn a fresh Validator when verification needs an independent agent, and never treat idle/task-lifecycle output as completion. A build attempt only counts when the Builder returns a concrete commit SHA and the Team Lead persists the story result to
|
|
58
|
+
Across all backends, `builder` and `validator` are one-shot story-scoped workers. The Team Lead must spawn a fresh Builder for each story attempt, spawn a fresh Validator when verification needs an independent agent, and never treat idle/task-lifecycle output as completion. A build attempt only counts when the Builder returns a concrete commit SHA and the Team Lead persists the story result to the epic state file at `.ralph-teams/state/{epic-id}.json`.
|
|
59
59
|
|
|
60
60
|
Default Team Lead policy by backend:
|
|
61
61
|
- Claude: keep `team-lead` on `opus`; for spawned work use `haiku` for easy tasks, `sonnet` for medium tasks, `opus` for difficult tasks
|
|
@@ -74,7 +74,8 @@ Current backends:
|
|
|
74
74
|
|
|
75
75
|
The runtime is file-based. During a run, Ralph treats these files as the working state of the system:
|
|
76
76
|
|
|
77
|
-
- `prd.json`: source of truth for epic and
|
|
77
|
+
- `prd.json`: source of truth for epic dependencies and status
|
|
78
|
+
- `.ralph-teams/state/`: per-epic story pass/fail state files
|
|
78
79
|
- `.ralph-teams/plans/`: implementation plans for epics that were explicitly planned
|
|
79
80
|
- `.ralph-teams/progress.txt`: narrative progress log
|
|
80
81
|
- `.ralph-teams/logs/`: raw backend logs
|
|
@@ -457,12 +458,13 @@ The `init` command uses `prd.json.example` as schema and style guidance when gen
|
|
|
457
458
|
During a run, Ralph writes:
|
|
458
459
|
|
|
459
460
|
- `.ralph-teams/progress.txt`: high-level run log
|
|
461
|
+
- `.ralph-teams/state/EPIC-xxx.json`: per-epic story pass/fail state (Team Lead reads/writes)
|
|
460
462
|
- `.ralph-teams/plans/plan-EPIC-xxx.md`: planner output for an epic
|
|
461
463
|
- planned epics are expected to use these files as their implementation contract
|
|
462
464
|
- `.ralph-teams/logs/epic-EPIC-xxx-<timestamp>.log`: raw backend session log
|
|
463
465
|
- `.ralph-teams/ralph-state.json`: saved interrupt/resume state
|
|
464
466
|
|
|
465
|
-
Ralph also updates the original `prd.json` in place as
|
|
467
|
+
Ralph also updates the original `prd.json` in place as epic status changes.
|
|
466
468
|
|
|
467
469
|
The team lead agent log for each epic is written to `.ralph-teams/logs/` regardless of backend.
|
|
468
470
|
|
|
@@ -485,8 +487,8 @@ The current execution contract is:
|
|
|
485
487
|
- Builder and Validator are one-shot story-scoped workers, never long-lived mailboxes shared across stories
|
|
486
488
|
- a Builder attempt only counts when the Team Lead receives a concrete commit SHA for that story attempt
|
|
487
489
|
- the validator checks output independently from the builder's reasoning
|
|
488
|
-
- `DONE: X/Y stories passed` is a required session footer, but the durable completion signal is the
|
|
489
|
-
- after updating
|
|
490
|
+
- `DONE: X/Y stories passed` is a required session footer, but the durable completion signal is the epic state file updated by the Team Lead
|
|
491
|
+
- after updating the epic state file for all attempted stories, the team lead must print `DONE: X/Y stories passed` and exit the session immediately
|
|
490
492
|
- pressing `Ctrl-C` writes `.ralph-teams/ralph-state.json` so the run can be resumed later with `ralph-teams resume`
|
|
491
493
|
|
|
492
494
|
## Troubleshooting
|
package/dist/discuss.d.ts
CHANGED
|
@@ -30,7 +30,6 @@ export interface FailedStoryContext extends DiscussContext {
|
|
|
30
30
|
storyTitle: string;
|
|
31
31
|
epicTitle: string;
|
|
32
32
|
failureReason: string | null;
|
|
33
|
-
guidancePath: string;
|
|
34
33
|
}
|
|
35
34
|
export interface DiscussResult {
|
|
36
35
|
/** The story ID that was discussed */
|
|
@@ -54,12 +53,6 @@ export interface DiscussSessionOptions {
|
|
|
54
53
|
spawnAgent?: AgentSpawner;
|
|
55
54
|
/** Backend to launch for the guided session. Defaults to 'claude'. */
|
|
56
55
|
backend?: 'claude' | 'copilot' | 'codex';
|
|
57
|
-
/**
|
|
58
|
-
* Directory in which to persist the guidance file after the session ends.
|
|
59
|
-
* When provided, the guidance is saved to `<guidanceDir>/guidance-<storyId>.md`.
|
|
60
|
-
* Defaults to 'guidance' if not specified.
|
|
61
|
-
*/
|
|
62
|
-
guidanceDir?: string;
|
|
63
56
|
}
|
|
64
57
|
export interface FailedStoriesDiscussOptions {
|
|
65
58
|
spawnAgent?: AgentSpawner;
|
package/dist/discuss.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discuss.d.ts","sourceRoot":"","sources":["../src/discuss.ts"],"names":[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,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAyC5F;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAsDxE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAsBzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,cAAc,CAOhB;AAMD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CA0BlE;AAaD,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,MAAM,CA6BtF;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,GAAE,QAAQ,GAAG,SAAS,GAAG,OAAkB,GACjD,YAAY,CA4Cd;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,aAAa,CAAC,CAyBxB;AAED,wBAAsB,8BAA8B,CAClD,QAAQ,EAAE,kBAAkB,EAAE,EAC9B,OAAO,CAAC,EAAE,2BAA2B,GACpC,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
package/dist/discuss.js
CHANGED
|
@@ -62,7 +62,6 @@ exports.runFailedStoriesDiscussSession = runFailedStoriesDiscussSession;
|
|
|
62
62
|
const fs = __importStar(require("fs"));
|
|
63
63
|
const path = __importStar(require("path"));
|
|
64
64
|
const child_process_1 = require("child_process");
|
|
65
|
-
const guidance_1 = require("./guidance");
|
|
66
65
|
// ---------------------------------------------------------------------------
|
|
67
66
|
// Context gathering
|
|
68
67
|
// ---------------------------------------------------------------------------
|
|
@@ -280,28 +279,14 @@ function buildContextPrompt(context) {
|
|
|
280
279
|
sep,
|
|
281
280
|
].join('\n');
|
|
282
281
|
}
|
|
283
|
-
function buildGuidedDiscussPrompt(context
|
|
282
|
+
function buildGuidedDiscussPrompt(context) {
|
|
284
283
|
return [
|
|
285
284
|
buildContextPrompt(context),
|
|
286
285
|
'',
|
|
287
286
|
'You are running a guided retry discussion with the user.',
|
|
288
287
|
'Behave like an interactive product/engineering interview session.',
|
|
289
288
|
'Ask focused follow-up questions, help the user reason about the failure, and converge on concrete retry guidance.',
|
|
290
|
-
'',
|
|
291
|
-
'Before ending the session, you MUST write the final guidance file yourself.',
|
|
292
|
-
`Write it to this exact path: ${guidancePath}`,
|
|
293
|
-
'',
|
|
294
|
-
'The guidance file must be Markdown and include these sections:',
|
|
295
|
-
'# Story Guidance',
|
|
296
|
-
'## Failure Context',
|
|
297
|
-
'## User Instructions',
|
|
298
|
-
'## Agreed Approach',
|
|
299
|
-
'',
|
|
300
|
-
'Rules:',
|
|
301
|
-
'- Create the parent directory if it does not exist.',
|
|
302
|
-
'- Summarize the final guidance in the file, not just in chat.',
|
|
303
|
-
'- Do not ask the user to create or save the file manually.',
|
|
304
|
-
'- After writing the file, tell the user where you saved it and exit.',
|
|
289
|
+
'Before exiting, summarize the agreed next steps clearly in chat.',
|
|
305
290
|
].join('\n');
|
|
306
291
|
}
|
|
307
292
|
function buildFailedStoriesDiscussPrompt(contexts) {
|
|
@@ -311,7 +296,6 @@ function buildFailedStoriesDiscussPrompt(contexts) {
|
|
|
311
296
|
`${context.storyId} — ${context.storyTitle}`,
|
|
312
297
|
`Epic: ${context.epicId} — ${context.epicTitle}`,
|
|
313
298
|
`Failure reason: ${context.failureReason ?? '(not recorded)'}`,
|
|
314
|
-
`Guidance file: ${context.guidancePath}`,
|
|
315
299
|
'',
|
|
316
300
|
'[Failure Report]',
|
|
317
301
|
context.failureReport,
|
|
@@ -328,21 +312,7 @@ function buildFailedStoriesDiscussPrompt(contexts) {
|
|
|
328
312
|
'',
|
|
329
313
|
'Start by summarizing the failed stories and asking the user which one to discuss first.',
|
|
330
314
|
'Guide the conversation story by story. Ask focused follow-up questions and converge on concrete retry instructions.',
|
|
331
|
-
'',
|
|
332
|
-
'When the user finishes discussing a story, you MUST write that story guidance file yourself to the exact path listed for that story.',
|
|
333
|
-
'You may write multiple guidance files in this session if the user discusses multiple failed stories.',
|
|
334
|
-
'',
|
|
335
|
-
'Each guidance file must be Markdown and include exactly these sections:',
|
|
336
|
-
'# Story Guidance',
|
|
337
|
-
'## Failure Context',
|
|
338
|
-
'## User Instructions',
|
|
339
|
-
'## Agreed Approach',
|
|
340
|
-
'',
|
|
341
|
-
'Rules:',
|
|
342
|
-
'- Create parent directories if they do not exist.',
|
|
343
|
-
'- Do not ask the user to create or save files manually.',
|
|
344
|
-
'- Keep guidance scoped to the story being discussed.',
|
|
345
|
-
'- When the user says they are done, summarize which guidance files were written and exit.',
|
|
315
|
+
'When the user says they are done, summarize the agreed retry steps and exit.',
|
|
346
316
|
'',
|
|
347
317
|
...storyBlocks,
|
|
348
318
|
sep,
|
|
@@ -370,7 +340,7 @@ function createDefaultSpawner(backend = 'claude') {
|
|
|
370
340
|
const sep = '─'.repeat(72);
|
|
371
341
|
process.stdout.write('\n');
|
|
372
342
|
process.stdout.write(`${sep}\n`);
|
|
373
|
-
process.stdout.write('Discuss session starting — the agent will guide the conversation
|
|
343
|
+
process.stdout.write('Discuss session starting — the agent will guide the conversation.\n');
|
|
374
344
|
process.stdout.write(`${sep}\n\n`);
|
|
375
345
|
let command;
|
|
376
346
|
let args;
|
|
@@ -430,13 +400,7 @@ function createDefaultSpawner(backend = 'claude') {
|
|
|
430
400
|
* @returns The collected guidance from the session
|
|
431
401
|
*/
|
|
432
402
|
async function runDiscussSession(context, options) {
|
|
433
|
-
const
|
|
434
|
-
const guidanceDir = options?.guidanceDir ?? 'guidance';
|
|
435
|
-
const guidancePath = path.resolve((0, guidance_1.getGuidancePath)(context.storyId, guidanceDir));
|
|
436
|
-
if (shouldPersistGuidance) {
|
|
437
|
-
fs.mkdirSync(path.dirname(guidancePath), { recursive: true });
|
|
438
|
-
}
|
|
439
|
-
const contextPrompt = buildGuidedDiscussPrompt(context, guidancePath);
|
|
403
|
+
const contextPrompt = buildGuidedDiscussPrompt(context);
|
|
440
404
|
const spawner = options?.spawnAgent ?? createDefaultSpawner(options?.backend ?? 'claude');
|
|
441
405
|
let guidance = '';
|
|
442
406
|
try {
|
|
@@ -446,42 +410,22 @@ async function runDiscussSession(context, options) {
|
|
|
446
410
|
// Spawner errors are non-fatal — session ends with empty guidance
|
|
447
411
|
guidance = '';
|
|
448
412
|
}
|
|
449
|
-
const
|
|
450
|
-
let finalGuidance = trimmedGuidance;
|
|
451
|
-
if (!finalGuidance && options?.spawnAgent === undefined) {
|
|
452
|
-
const savedGuidance = (0, guidance_1.loadGuidance)(context.storyId, guidanceDir);
|
|
453
|
-
if (savedGuidance !== null) {
|
|
454
|
-
finalGuidance = savedGuidance.trim();
|
|
455
|
-
}
|
|
456
|
-
}
|
|
413
|
+
const finalGuidance = guidance.trim();
|
|
457
414
|
process.stdout.write('\n');
|
|
458
415
|
if (finalGuidance) {
|
|
459
|
-
process.stdout.write('[
|
|
416
|
+
process.stdout.write('[Discussion summary]\n');
|
|
460
417
|
process.stdout.write(`${finalGuidance}\n`);
|
|
461
418
|
}
|
|
462
419
|
else {
|
|
463
420
|
process.stdout.write('[Discuss session ended]\n');
|
|
464
421
|
}
|
|
465
422
|
process.stdout.write('\n');
|
|
466
|
-
if (trimmedGuidance && shouldPersistGuidance) {
|
|
467
|
-
(0, guidance_1.saveGuidance)(context.storyId, {
|
|
468
|
-
failureContext: context.failureReport,
|
|
469
|
-
userInstructions: trimmedGuidance,
|
|
470
|
-
approach: '',
|
|
471
|
-
}, guidanceDir);
|
|
472
|
-
}
|
|
473
|
-
if (shouldPersistGuidance && fs.existsSync(guidancePath)) {
|
|
474
|
-
process.stdout.write(`[Guidance saved to ${guidancePath}]\n`);
|
|
475
|
-
}
|
|
476
423
|
return { storyId: context.storyId, guidance: finalGuidance };
|
|
477
424
|
}
|
|
478
425
|
async function runFailedStoriesDiscussSession(contexts, options) {
|
|
479
426
|
if (contexts.length === 0) {
|
|
480
427
|
return;
|
|
481
428
|
}
|
|
482
|
-
for (const context of contexts) {
|
|
483
|
-
fs.mkdirSync(path.dirname(context.guidancePath), { recursive: true });
|
|
484
|
-
}
|
|
485
429
|
const contextPrompt = buildFailedStoriesDiscussPrompt(contexts);
|
|
486
430
|
const spawner = options?.spawnAgent ?? createDefaultSpawner(options?.backend ?? 'claude');
|
|
487
431
|
try {
|
|
@@ -491,18 +435,7 @@ async function runFailedStoriesDiscussSession(contexts, options) {
|
|
|
491
435
|
// Non-fatal: the user may have exited the interactive backend early.
|
|
492
436
|
}
|
|
493
437
|
process.stdout.write('\n');
|
|
494
|
-
|
|
495
|
-
.map(context => context.guidancePath)
|
|
496
|
-
.filter(filePath => fs.existsSync(filePath));
|
|
497
|
-
if (savedPaths.length > 0) {
|
|
498
|
-
process.stdout.write('[Guidance saved]\n');
|
|
499
|
-
for (const filePath of savedPaths) {
|
|
500
|
-
process.stdout.write(`${filePath}\n`);
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
else {
|
|
504
|
-
process.stdout.write('[Discuss session ended]\n');
|
|
505
|
-
}
|
|
438
|
+
process.stdout.write('[Discuss session ended]\n');
|
|
506
439
|
process.stdout.write('\n');
|
|
507
440
|
}
|
|
508
441
|
//# sourceMappingURL=discuss.js.map
|
package/dist/discuss.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discuss.js","sourceRoot":"","sources":["../src/discuss.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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+3,6 @@ export declare function getRalphRuntimeDir(projectRoot: string): string;
|
|
|
3
3
|
export declare function getRalphProgressPath(projectRoot: string): string;
|
|
4
4
|
export declare function getRalphPlansDir(projectRoot: string): string;
|
|
5
5
|
export declare function getRalphLogsDir(projectRoot: string): string;
|
|
6
|
-
export declare function getRalphGuidanceDir(projectRoot: string): string;
|
|
7
6
|
export declare function getRalphWorktreesDir(projectRoot: string): string;
|
|
8
7
|
export declare function getRalphStatePath(projectRoot: string): string;
|
|
9
8
|
//# sourceMappingURL=runtime-paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-paths.d.ts","sourceRoot":"","sources":["../src/runtime-paths.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AAEpD,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"runtime-paths.d.ts","sourceRoot":"","sources":["../src/runtime-paths.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AAEpD,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE7D"}
|
package/dist/runtime-paths.js
CHANGED
|
@@ -38,7 +38,6 @@ exports.getRalphRuntimeDir = getRalphRuntimeDir;
|
|
|
38
38
|
exports.getRalphProgressPath = getRalphProgressPath;
|
|
39
39
|
exports.getRalphPlansDir = getRalphPlansDir;
|
|
40
40
|
exports.getRalphLogsDir = getRalphLogsDir;
|
|
41
|
-
exports.getRalphGuidanceDir = getRalphGuidanceDir;
|
|
42
41
|
exports.getRalphWorktreesDir = getRalphWorktreesDir;
|
|
43
42
|
exports.getRalphStatePath = getRalphStatePath;
|
|
44
43
|
const path = __importStar(require("path"));
|
|
@@ -55,9 +54,6 @@ function getRalphPlansDir(projectRoot) {
|
|
|
55
54
|
function getRalphLogsDir(projectRoot) {
|
|
56
55
|
return path.join(getRalphRuntimeDir(projectRoot), 'logs');
|
|
57
56
|
}
|
|
58
|
-
function getRalphGuidanceDir(projectRoot) {
|
|
59
|
-
return path.join(getRalphRuntimeDir(projectRoot), 'guidance');
|
|
60
|
-
}
|
|
61
57
|
function getRalphWorktreesDir(projectRoot) {
|
|
62
58
|
return path.join(getRalphRuntimeDir(projectRoot), '.worktrees');
|
|
63
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-paths.js","sourceRoot":"","sources":["../src/runtime-paths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,gDAEC;AAED,oDAEC;AAED,4CAEC;AAED,0CAEC;AAED,
|
|
1
|
+
{"version":3,"file":"runtime-paths.js","sourceRoot":"","sources":["../src/runtime-paths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,gDAEC;AAED,oDAEC;AAED,4CAEC;AAED,0CAEC;AAED,oDAEC;AAED,8CAEC;AA1BD,2CAA6B;AAEhB,QAAA,qBAAqB,GAAG,cAAc,CAAC;AAEpD,SAAgB,kBAAkB,CAAC,WAAmB;IACpD,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,6BAAqB,CAAC,CAAC;AACvD,CAAC;AAED,SAAgB,oBAAoB,CAAC,WAAmB;IACtD,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,cAAc,CAAC,CAAC;AACpE,CAAC;AAED,SAAgB,gBAAgB,CAAC,WAAmB;IAClD,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;AAC7D,CAAC;AAED,SAAgB,eAAe,CAAC,WAAmB;IACjD,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;AAC5D,CAAC;AAED,SAAgB,oBAAoB,CAAC,WAAmB;IACtD,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC,CAAC;AAClE,CAAC;AAED,SAAgB,iBAAiB,CAAC,WAAmB;IACnD,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC,CAAC;AACxE,CAAC"}
|
package/package.json
CHANGED
|
@@ -27,7 +27,6 @@ You coordinate epic execution. Do not write implementation code yourself.
|
|
|
27
27
|
## Per Story Workflow
|
|
28
28
|
|
|
29
29
|
- Before starting a story, check the epic state file. If the story has `passes: true`, skip it.
|
|
30
|
-
- Before assigning the story, check whether `.ralph-teams/guidance/guidance-{story-id}.md` exists. If it does, explicitly tell the Builder: `Guidance file for this story: .ralph-teams/guidance/guidance-{story-id}.md — read it before implementing and follow the instructions in it.`
|
|
31
30
|
- If a Planner was used or a canonical plan already exists, give the Builder the story, acceptance criteria, relevant plan section, and especially the story's planned test design.
|
|
32
31
|
- Require the Builder to add or update automated tests for the story and make them pass before the story can count as complete.
|
|
33
32
|
- If no Planner is spawned for the epic, explicitly instruct the Builder to work in TDD order for the story: define the story's automated tests first, make them fail against the current code, then implement until those tests and the relevant quality checks pass.
|
package/ralph.sh
CHANGED
|
@@ -217,10 +217,9 @@ RALPH_RUNTIME_DIR="${ROOT_DIR}/${RALPH_RUNTIME_DIRNAME}"
|
|
|
217
217
|
PROGRESS_FILE="${RALPH_RUNTIME_DIR}/progress.txt"
|
|
218
218
|
PLANS_DIR="${RALPH_RUNTIME_DIR}/plans"
|
|
219
219
|
LOGS_DIR="${RALPH_RUNTIME_DIR}/logs"
|
|
220
|
-
GUIDANCE_DIR="${RALPH_RUNTIME_DIR}/guidance"
|
|
221
220
|
STATE_DIR="${RALPH_RUNTIME_DIR}/state"
|
|
222
221
|
WORKTREES_DIR="${RALPH_RUNTIME_DIR}/.worktrees"
|
|
223
|
-
mkdir -p "$RALPH_RUNTIME_DIR" "$PLANS_DIR" "$LOGS_DIR" "$
|
|
222
|
+
mkdir -p "$RALPH_RUNTIME_DIR" "$PLANS_DIR" "$LOGS_DIR" "$STATE_DIR" "$WORKTREES_DIR"
|
|
224
223
|
|
|
225
224
|
# --- Validate PRD structure ---
|
|
226
225
|
echo "Validating PRD structure..."
|
|
@@ -448,7 +447,7 @@ prompt_to_remove_stale_worktree_dir() {
|
|
|
448
447
|
# --- Ensure loop branch exists and is checked out ---
|
|
449
448
|
ensure_runtime_gitignore_entries
|
|
450
449
|
|
|
451
|
-
mkdir -p "$RALPH_RUNTIME_DIR" "$PLANS_DIR" "$LOGS_DIR" "$
|
|
450
|
+
mkdir -p "$RALPH_RUNTIME_DIR" "$PLANS_DIR" "$LOGS_DIR" "$STATE_DIR" "$WORKTREES_DIR"
|
|
452
451
|
|
|
453
452
|
if [ "$CURRENT_BRANCH" != "$LOOP_BRANCH" ]; then
|
|
454
453
|
if ! git diff --quiet 2>/dev/null || ! git diff --cached --quiet 2>/dev/null; then
|
|
@@ -1071,7 +1070,6 @@ $TEAM_LEAD_POLICY
|
|
|
1071
1070
|
|
|
1072
1071
|
## Runtime-Specific Notes
|
|
1073
1072
|
- Use the exact plan path shown above when the policy refers to the canonical epic plan file.
|
|
1074
|
-
- When the policy refers to guidance files, use this runtime path pattern: ${GUIDANCE_DIR}/guidance-{story-id}.md
|
|
1075
1073
|
- Use the exact epic state file path shown above for every story update. The PRD path is read-only context.
|
|
1076
1074
|
- If your runtime supports named sub-agents, use the dedicated planner, builder, and validator roles and choose their models using the policy above.
|
|
1077
1075
|
- If a story fails validation and still has retries left, spawn a new Builder for the retry instead of reusing the previous Builder run.
|
package/dist/guidance.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* guidance.ts — Standalone module for persisting and loading story guidance.
|
|
3
|
-
*
|
|
4
|
-
* When a user discusses a failed story with the discuss agent, their guidance
|
|
5
|
-
* is saved to a file so the Builder agent can incorporate it on the next run.
|
|
6
|
-
*
|
|
7
|
-
* Guidance files are written to:
|
|
8
|
-
* <guidanceDir>/guidance-<storyId>.md (default guidanceDir: '.ralph-teams/guidance')
|
|
9
|
-
* e.g.
|
|
10
|
-
* .ralph-teams/guidance/guidance-US-003.md
|
|
11
|
-
*
|
|
12
|
-
* Pure I/O module with no terminal UI dependencies.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Returns the canonical file path for a story's guidance file.
|
|
16
|
-
*
|
|
17
|
-
* @param storyId - Story ID, e.g. 'US-003'
|
|
18
|
-
* @param guidanceDir - Directory in which guidance files are stored (default: 'guidance')
|
|
19
|
-
* @returns Path: `<guidanceDir>/guidance-<storyId>.md`
|
|
20
|
-
*/
|
|
21
|
-
export declare function getGuidancePath(storyId: string, guidanceDir?: string): string;
|
|
22
|
-
/**
|
|
23
|
-
* Formats guidance context into a human-readable Markdown string.
|
|
24
|
-
*
|
|
25
|
-
* The Builder agent reads this file directly, so the format is intentionally
|
|
26
|
-
* simple and readable without special parsing.
|
|
27
|
-
*
|
|
28
|
-
* @param context - Guidance context with failure details and user instructions
|
|
29
|
-
* @returns Formatted markdown string
|
|
30
|
-
*/
|
|
31
|
-
export declare function formatGuidanceContent(context: {
|
|
32
|
-
failureContext: string;
|
|
33
|
-
userInstructions: string;
|
|
34
|
-
approach: string;
|
|
35
|
-
}): string;
|
|
36
|
-
/**
|
|
37
|
-
* Persists guidance to disk as a Markdown file.
|
|
38
|
-
*
|
|
39
|
-
* Creates the guidance directory automatically if it does not exist.
|
|
40
|
-
*
|
|
41
|
-
* @param storyId - Story ID, e.g. 'US-003'
|
|
42
|
-
* @param context - Guidance context (failure, instructions, approach)
|
|
43
|
-
* @param guidanceDir - Directory in which to write guidance files (default: 'guidance')
|
|
44
|
-
* @returns The file path where the guidance was written
|
|
45
|
-
*/
|
|
46
|
-
export declare function saveGuidance(storyId: string, context: {
|
|
47
|
-
failureContext: string;
|
|
48
|
-
userInstructions: string;
|
|
49
|
-
approach: string;
|
|
50
|
-
}, guidanceDir?: string): string;
|
|
51
|
-
/**
|
|
52
|
-
* Reads the guidance file for a story, or returns null if it does not exist.
|
|
53
|
-
*
|
|
54
|
-
* @param storyId - Story ID, e.g. 'US-003'
|
|
55
|
-
* @param guidanceDir - Directory in which guidance files are stored (default: 'guidance')
|
|
56
|
-
* @returns The guidance file contents, or null if the file does not exist
|
|
57
|
-
*/
|
|
58
|
-
export declare function loadGuidance(storyId: string, guidanceDir?: string): string | null;
|
|
59
|
-
//# sourceMappingURL=guidance.d.ts.map
|
package/dist/guidance.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guidance.d.ts","sourceRoot":"","sources":["../src/guidance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAaH;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,GAAE,MAA6B,GAAG,MAAM,CAEnG;AAUD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAC7C,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAkBT;AAMD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EAC/E,WAAW,GAAE,MAA6B,GACzC,MAAM,CAQR;AAMD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,GAAE,MAA6B,GAAG,MAAM,GAAG,IAAI,CAiBvG"}
|
package/dist/guidance.js
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* guidance.ts — Standalone module for persisting and loading story guidance.
|
|
4
|
-
*
|
|
5
|
-
* When a user discusses a failed story with the discuss agent, their guidance
|
|
6
|
-
* is saved to a file so the Builder agent can incorporate it on the next run.
|
|
7
|
-
*
|
|
8
|
-
* Guidance files are written to:
|
|
9
|
-
* <guidanceDir>/guidance-<storyId>.md (default guidanceDir: '.ralph-teams/guidance')
|
|
10
|
-
* e.g.
|
|
11
|
-
* .ralph-teams/guidance/guidance-US-003.md
|
|
12
|
-
*
|
|
13
|
-
* Pure I/O module with no terminal UI dependencies.
|
|
14
|
-
*/
|
|
15
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
-
}
|
|
21
|
-
Object.defineProperty(o, k2, desc);
|
|
22
|
-
}) : (function(o, m, k, k2) {
|
|
23
|
-
if (k2 === undefined) k2 = k;
|
|
24
|
-
o[k2] = m[k];
|
|
25
|
-
}));
|
|
26
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
-
}) : function(o, v) {
|
|
29
|
-
o["default"] = v;
|
|
30
|
-
});
|
|
31
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
-
var ownKeys = function(o) {
|
|
33
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
-
var ar = [];
|
|
35
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
-
return ar;
|
|
37
|
-
};
|
|
38
|
-
return ownKeys(o);
|
|
39
|
-
};
|
|
40
|
-
return function (mod) {
|
|
41
|
-
if (mod && mod.__esModule) return mod;
|
|
42
|
-
var result = {};
|
|
43
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
-
__setModuleDefault(result, mod);
|
|
45
|
-
return result;
|
|
46
|
-
};
|
|
47
|
-
})();
|
|
48
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
-
exports.getGuidancePath = getGuidancePath;
|
|
50
|
-
exports.formatGuidanceContent = formatGuidanceContent;
|
|
51
|
-
exports.saveGuidance = saveGuidance;
|
|
52
|
-
exports.loadGuidance = loadGuidance;
|
|
53
|
-
const fs = __importStar(require("fs"));
|
|
54
|
-
const path = __importStar(require("path"));
|
|
55
|
-
const runtime_paths_1 = require("./runtime-paths");
|
|
56
|
-
/** Default directory for guidance files, relative to project root. */
|
|
57
|
-
const DEFAULT_GUIDANCE_DIR = path.join(runtime_paths_1.RALPH_RUNTIME_DIRNAME, 'guidance');
|
|
58
|
-
// ---------------------------------------------------------------------------
|
|
59
|
-
// Path helpers
|
|
60
|
-
// ---------------------------------------------------------------------------
|
|
61
|
-
/**
|
|
62
|
-
* Returns the canonical file path for a story's guidance file.
|
|
63
|
-
*
|
|
64
|
-
* @param storyId - Story ID, e.g. 'US-003'
|
|
65
|
-
* @param guidanceDir - Directory in which guidance files are stored (default: 'guidance')
|
|
66
|
-
* @returns Path: `<guidanceDir>/guidance-<storyId>.md`
|
|
67
|
-
*/
|
|
68
|
-
function getGuidancePath(storyId, guidanceDir = DEFAULT_GUIDANCE_DIR) {
|
|
69
|
-
return path.join(guidanceDir, `guidance-${storyId}.md`);
|
|
70
|
-
}
|
|
71
|
-
function getLegacyGuidancePath(storyId, guidanceDir = DEFAULT_GUIDANCE_DIR) {
|
|
72
|
-
return path.join(guidanceDir, `${storyId}.md`);
|
|
73
|
-
}
|
|
74
|
-
// ---------------------------------------------------------------------------
|
|
75
|
-
// Content formatter
|
|
76
|
-
// ---------------------------------------------------------------------------
|
|
77
|
-
/**
|
|
78
|
-
* Formats guidance context into a human-readable Markdown string.
|
|
79
|
-
*
|
|
80
|
-
* The Builder agent reads this file directly, so the format is intentionally
|
|
81
|
-
* simple and readable without special parsing.
|
|
82
|
-
*
|
|
83
|
-
* @param context - Guidance context with failure details and user instructions
|
|
84
|
-
* @returns Formatted markdown string
|
|
85
|
-
*/
|
|
86
|
-
function formatGuidanceContent(context) {
|
|
87
|
-
const lines = [
|
|
88
|
-
'# Story Guidance',
|
|
89
|
-
'',
|
|
90
|
-
'## Failure Context',
|
|
91
|
-
'',
|
|
92
|
-
context.failureContext.trim() || '(no failure context recorded)',
|
|
93
|
-
'',
|
|
94
|
-
'## User Instructions',
|
|
95
|
-
'',
|
|
96
|
-
context.userInstructions.trim() || '(no explicit instructions provided)',
|
|
97
|
-
'',
|
|
98
|
-
'## Agreed Approach',
|
|
99
|
-
'',
|
|
100
|
-
context.approach.trim() || '(no specific approach agreed upon)',
|
|
101
|
-
'',
|
|
102
|
-
];
|
|
103
|
-
return lines.join('\n');
|
|
104
|
-
}
|
|
105
|
-
// ---------------------------------------------------------------------------
|
|
106
|
-
// Writer
|
|
107
|
-
// ---------------------------------------------------------------------------
|
|
108
|
-
/**
|
|
109
|
-
* Persists guidance to disk as a Markdown file.
|
|
110
|
-
*
|
|
111
|
-
* Creates the guidance directory automatically if it does not exist.
|
|
112
|
-
*
|
|
113
|
-
* @param storyId - Story ID, e.g. 'US-003'
|
|
114
|
-
* @param context - Guidance context (failure, instructions, approach)
|
|
115
|
-
* @param guidanceDir - Directory in which to write guidance files (default: 'guidance')
|
|
116
|
-
* @returns The file path where the guidance was written
|
|
117
|
-
*/
|
|
118
|
-
function saveGuidance(storyId, context, guidanceDir = DEFAULT_GUIDANCE_DIR) {
|
|
119
|
-
// Ensure the guidance directory exists
|
|
120
|
-
fs.mkdirSync(guidanceDir, { recursive: true });
|
|
121
|
-
const filePath = getGuidancePath(storyId, guidanceDir);
|
|
122
|
-
const content = formatGuidanceContent(context);
|
|
123
|
-
fs.writeFileSync(filePath, content, 'utf-8');
|
|
124
|
-
return filePath;
|
|
125
|
-
}
|
|
126
|
-
// ---------------------------------------------------------------------------
|
|
127
|
-
// Reader
|
|
128
|
-
// ---------------------------------------------------------------------------
|
|
129
|
-
/**
|
|
130
|
-
* Reads the guidance file for a story, or returns null if it does not exist.
|
|
131
|
-
*
|
|
132
|
-
* @param storyId - Story ID, e.g. 'US-003'
|
|
133
|
-
* @param guidanceDir - Directory in which guidance files are stored (default: 'guidance')
|
|
134
|
-
* @returns The guidance file contents, or null if the file does not exist
|
|
135
|
-
*/
|
|
136
|
-
function loadGuidance(storyId, guidanceDir = DEFAULT_GUIDANCE_DIR) {
|
|
137
|
-
try {
|
|
138
|
-
const candidatePaths = [
|
|
139
|
-
getGuidancePath(storyId, guidanceDir),
|
|
140
|
-
getLegacyGuidancePath(storyId, guidanceDir),
|
|
141
|
-
];
|
|
142
|
-
for (const filePath of candidatePaths) {
|
|
143
|
-
if (fs.existsSync(filePath)) {
|
|
144
|
-
return fs.readFileSync(filePath, 'utf-8');
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
catch {
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
//# sourceMappingURL=guidance.js.map
|
package/dist/guidance.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guidance.js","sourceRoot":"","sources":["../src/guidance.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBH,0CAEC;AAmBD,sDAsBC;AAgBD,oCAYC;AAaD,oCAiBC;AAvHD,uCAAyB;AACzB,2CAA6B;AAC7B,mDAAwD;AAExD,sEAAsE;AACtE,MAAM,oBAAoB,GAAG,IAAI,CAAC,IAAI,CAAC,qCAAqB,EAAE,UAAU,CAAC,CAAC;AAE1E,8EAA8E;AAC9E,eAAe;AACf,8EAA8E;AAE9E;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,OAAe,EAAE,cAAsB,oBAAoB;IACzF,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,OAAO,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,qBAAqB,CAAC,OAAe,EAAE,cAAsB,oBAAoB;IACxF,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,OAAO,KAAK,CAAC,CAAC;AACjD,CAAC;AAED,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CAAC,OAIrC;IACC,MAAM,KAAK,GAAa;QACtB,kBAAkB;QAClB,EAAE;QACF,oBAAoB;QACpB,EAAE;QACF,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,+BAA+B;QAChE,EAAE;QACF,sBAAsB;QACtB,EAAE;QACF,OAAO,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,qCAAqC;QACxE,EAAE;QACF,oBAAoB;QACpB,EAAE;QACF,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,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