ralphctl 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -16
- package/dist/absolute-path-WUTZQ37D.mjs +8 -0
- package/dist/chunk-6RDMCLWU.mjs +108 -0
- package/dist/chunk-HIU74KTO.mjs +1046 -0
- package/dist/chunk-S3PTDH57.mjs +78 -0
- package/dist/chunk-WV4D2CPG.mjs +26 -0
- package/dist/cli.mjs +22413 -717
- package/dist/manifest.json +24 -0
- package/dist/prompt-adapter-JQICGVX7.mjs +7 -0
- package/dist/prompts/ideate.md +3 -1
- package/dist/prompts/plan-auto.md +23 -8
- package/dist/prompts/plan-common-examples.md +3 -3
- package/dist/prompts/plan-common.md +6 -5
- package/dist/prompts/plan-interactive.md +30 -7
- package/dist/prompts/repo-onboard.md +154 -64
- package/dist/prompts/signals-task.md +3 -0
- package/dist/prompts/sprint-feedback.md +3 -0
- package/dist/prompts/task-evaluation.md +74 -53
- package/dist/prompts/task-execution.md +65 -21
- package/dist/prompts/ticket-refine.md +11 -8
- package/dist/prompts/validation-checklist.md +3 -2
- package/dist/skills/default/abstraction-first/SKILL.md +45 -0
- package/dist/skills/default/alignment/SKILL.md +46 -0
- package/dist/skills/default/iterative-review/SKILL.md +48 -0
- package/dist/skills/exec/.gitkeep +0 -0
- package/dist/skills/plan/.gitkeep +0 -0
- package/dist/skills/refine/.gitkeep +0 -0
- package/dist/storage-paths-IPNZZM5D.mjs +15 -0
- package/dist/validation-error-QT6Q7FYU.mjs +7 -0
- package/package.json +9 -4
- package/dist/add-67UFUI54.mjs +0 -17
- package/dist/add-DVPVHENV.mjs +0 -18
- package/dist/bootstrap-FMHG6DRY.mjs +0 -11
- package/dist/chunk-62HYDA7L.mjs +0 -1128
- package/dist/chunk-747KW2RW.mjs +0 -24
- package/dist/chunk-BSB4EDGR.mjs +0 -260
- package/dist/chunk-BT5FKIZX.mjs +0 -787
- package/dist/chunk-CBMFRQ4Y.mjs +0 -441
- package/dist/chunk-CFUVE2BP.mjs +0 -16
- package/dist/chunk-D6QZNEYN.mjs +0 -5520
- package/dist/chunk-FNAAA32W.mjs +0 -103
- package/dist/chunk-GQ2WFKBN.mjs +0 -269
- package/dist/chunk-IWXBJD2D.mjs +0 -27
- package/dist/chunk-OGEXYSFS.mjs +0 -228
- package/dist/chunk-VAZ3LJBI.mjs +0 -179
- package/dist/chunk-WDMLPXOD.mjs +0 -363
- package/dist/chunk-XN2UIHBY.mjs +0 -589
- package/dist/chunk-ZE2BRQA2.mjs +0 -5542
- package/dist/create-Z635FQKO.mjs +0 -15
- package/dist/handle-23EFF3BE.mjs +0 -22
- package/dist/mount-NCYR22SN.mjs +0 -7434
- package/dist/project-DQHF4ISP.mjs +0 -34
- package/dist/prompts/check-script-discover.md +0 -69
- package/dist/prompts/ideate-auto.md +0 -195
- package/dist/prompts/task-evaluation-resume.md +0 -41
- package/dist/resolver-OVPYVW6Q.mjs +0 -163
- package/dist/sprint-4E26AB5F.mjs +0 -38
- package/dist/start-T34NI3LF.mjs +0 -19
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
addProjectRepo,
|
|
4
|
-
createProject,
|
|
5
|
-
getProject,
|
|
6
|
-
getProjectById,
|
|
7
|
-
getRepoById,
|
|
8
|
-
listProjects,
|
|
9
|
-
projectExists,
|
|
10
|
-
removeProject,
|
|
11
|
-
removeProjectRepo,
|
|
12
|
-
resolveRepoPath,
|
|
13
|
-
updateProject
|
|
14
|
-
} from "./chunk-BSB4EDGR.mjs";
|
|
15
|
-
import "./chunk-WDMLPXOD.mjs";
|
|
16
|
-
import {
|
|
17
|
-
ProjectExistsError,
|
|
18
|
-
ProjectNotFoundError
|
|
19
|
-
} from "./chunk-VAZ3LJBI.mjs";
|
|
20
|
-
export {
|
|
21
|
-
ProjectExistsError,
|
|
22
|
-
ProjectNotFoundError,
|
|
23
|
-
addProjectRepo,
|
|
24
|
-
createProject,
|
|
25
|
-
getProject,
|
|
26
|
-
getProjectById,
|
|
27
|
-
getRepoById,
|
|
28
|
-
listProjects,
|
|
29
|
-
projectExists,
|
|
30
|
-
removeProject,
|
|
31
|
-
removeProjectRepo,
|
|
32
|
-
resolveRepoPath,
|
|
33
|
-
updateProject
|
|
34
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Check-Script Discovery Protocol
|
|
2
|
-
|
|
3
|
-
You are a build-system analyst. Inspect the repository at the path below and propose a single shell command that the
|
|
4
|
-
harness can run after every AI task to verify the working tree still passes the project's own quality gates (typecheck
|
|
5
|
-
/ lint / tests / build — whatever the project considers "green"). Static ecosystem detection has already returned
|
|
6
|
-
nothing useful, which usually means the project is polyglot, custom, or uses an uncommon build tool.
|
|
7
|
-
|
|
8
|
-
<harness-context>
|
|
9
|
-
This invocation is read-only — do not modify the working tree, do not create files, do not run network calls, do not
|
|
10
|
-
execute the candidate command. The harness owns execution; your only job is to read configuration files and produce a
|
|
11
|
-
recommendation. The user will see your suggestion as an editable default and can accept, modify, or discard it.
|
|
12
|
-
</harness-context>
|
|
13
|
-
|
|
14
|
-
<context>
|
|
15
|
-
|
|
16
|
-
**Repository path:** `{{REPO_PATH}}`
|
|
17
|
-
|
|
18
|
-
</context>
|
|
19
|
-
|
|
20
|
-
<constraints>
|
|
21
|
-
|
|
22
|
-
- Inspect only the files explicitly listed below — do not crawl the entire tree, do not open source files, do not read
|
|
23
|
-
vendored or generated directories
|
|
24
|
-
- Prefer commands that exit non-zero on failure and zero on success — that is the contract the harness relies on to
|
|
25
|
-
decide whether a task passes the post-task gate
|
|
26
|
-
- Combine multiple gates with `&&` so the first failure aborts the chain — example shape: `<install> && <typecheck> &&
|
|
27
|
-
<lint> && <test>` (substitute the project's actual tools)
|
|
28
|
-
- If you find a single canonical entry point — a `Makefile` target like `make check`, a `mise` task, or a top-level
|
|
29
|
-
script in `scripts/` — prefer that over reconstructing the chain by hand
|
|
30
|
-
- Never embed credentials, environment-specific paths, or commands that touch remote services
|
|
31
|
-
- Output exactly one `<check-script>` block, on its own line, containing the bare command (no markdown fences, no
|
|
32
|
-
surrounding prose)
|
|
33
|
-
- If the repo contains nothing actionable, emit `<check-script></check-script>` with empty content — the harness will
|
|
34
|
-
treat that as "no check script" and fall through to manual entry
|
|
35
|
-
|
|
36
|
-
</constraints>
|
|
37
|
-
|
|
38
|
-
<examples>
|
|
39
|
-
|
|
40
|
-
- Polyglot Node + Python:
|
|
41
|
-
`<check-script>pnpm install && pnpm typecheck && pnpm test && uv run pytest</check-script>`
|
|
42
|
-
- Makefile-driven:
|
|
43
|
-
`<check-script>make check</check-script>`
|
|
44
|
-
- mise tasks:
|
|
45
|
-
`<check-script>mise run ci</check-script>`
|
|
46
|
-
- Bare scripts directory:
|
|
47
|
-
`<check-script>./scripts/verify.sh</check-script>`
|
|
48
|
-
|
|
49
|
-
</examples>
|
|
50
|
-
|
|
51
|
-
## Files to Inspect
|
|
52
|
-
|
|
53
|
-
Read whichever of these exist; ignore the rest:
|
|
54
|
-
|
|
55
|
-
- `package.json` — `scripts` block (look for `test`, `typecheck`, `lint`, `check`, `ci`, `verify`)
|
|
56
|
-
- `pyproject.toml` — `[tool.poetry.scripts]`, `[tool.uv]`, `[tool.hatch]`, `[project.scripts]`
|
|
57
|
-
- `Makefile` — top-level targets (`check`, `test`, `ci`, `verify`, `all`)
|
|
58
|
-
- `mise.toml` / `.mise.toml` — `[tasks]` block
|
|
59
|
-
- `.tool-versions` — runtime hints only; combine with the above
|
|
60
|
-
- `.github/workflows/*.yml` — CI definitions are the most authoritative source of "what passes"
|
|
61
|
-
- `README.md` — explicit "running tests" / "development" sections, if present
|
|
62
|
-
- `flake.nix` — `apps`, `checks`, `devShells.default.shellHook`
|
|
63
|
-
- `WORKSPACE` / `BUILD` — Bazel target conventions (`bazel test //...`)
|
|
64
|
-
- `scripts/` — top-level entries only (do not recurse); look for `check`, `verify`, `ci`, `test`
|
|
65
|
-
|
|
66
|
-
## Output Contract
|
|
67
|
-
|
|
68
|
-
After your inspection, emit a single `<check-script>…</check-script>` element on its own line. Nothing else — no
|
|
69
|
-
preamble, no explanation, no markdown. The harness parses the first match with a strict regex.
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
# Autonomous Ideation to Implementation
|
|
2
|
-
|
|
3
|
-
You are a combined requirements analyst and task planner working autonomously. Turn a rough idea into refined
|
|
4
|
-
requirements and a dependency-ordered set of implementation tasks. Think carefully and step-by-step: resolve ambiguity
|
|
5
|
-
from the idea description and the codebase before writing tasks — there is no user to interact with, so your own
|
|
6
|
-
analysis is the only source of clarity.
|
|
7
|
-
|
|
8
|
-
{{HARNESS_CONTEXT}}
|
|
9
|
-
|
|
10
|
-
When finished, emit a signal from the `<signals>` block below.
|
|
11
|
-
|
|
12
|
-
## Two-Phase Protocol
|
|
13
|
-
|
|
14
|
-
### Phase 0: Think Before Writing
|
|
15
|
-
|
|
16
|
-
Before emitting any JSON, write your reasoning in a `<thinking>…</thinking>` block. Use it to interrogate the idea —
|
|
17
|
-
surface hidden assumptions, identify the real user problem, sketch requirements, and reason about which repositories
|
|
18
|
-
and dependencies the work touches. Explicit reasoning produces sharper output than jumping straight to JSON.
|
|
19
|
-
|
|
20
|
-
The harness's JSON extractor skips everything before the first `{`, so the `<thinking>` block is stripped
|
|
21
|
-
automatically — but the JSON object itself must still be emitted without markdown fences or commentary after it.
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
<thinking>
|
|
25
|
-
The idea says "webhook notifications" but doesn't say which events. Reviewing the API, the natural candidates are
|
|
26
|
-
task-status transitions. Scope = status-change webhooks only; other event types are out of scope.
|
|
27
|
-
Acceptance: POST to configured URL with JSON payload on task status change; retries on 5xx.
|
|
28
|
-
…
|
|
29
|
-
</thinking>
|
|
30
|
-
{
|
|
31
|
-
… JSON object …
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Phase 1: Refine Requirements (WHAT)
|
|
36
|
-
|
|
37
|
-
Analyze the idea and produce complete, implementation-agnostic requirements:
|
|
38
|
-
|
|
39
|
-
- **Problem statement** — What problem are we solving and for whom?
|
|
40
|
-
- **Functional requirements** — What should the system do? (behavior, not implementation)
|
|
41
|
-
- **Acceptance criteria** — Testable conditions (Given/When/Then format preferred)
|
|
42
|
-
- **Scope boundaries** — What's in vs out of scope
|
|
43
|
-
- **Constraints** — Performance, compatibility, business rules if applicable
|
|
44
|
-
|
|
45
|
-
**Output format:**
|
|
46
|
-
|
|
47
|
-
```markdown
|
|
48
|
-
## Problem
|
|
49
|
-
|
|
50
|
-
[Clear problem statement]
|
|
51
|
-
|
|
52
|
-
## Requirements
|
|
53
|
-
|
|
54
|
-
- [Functional requirement 1]
|
|
55
|
-
- [Functional requirement 2]
|
|
56
|
-
|
|
57
|
-
## Acceptance Criteria
|
|
58
|
-
|
|
59
|
-
- Given [precondition], When [action], Then [expected result]
|
|
60
|
-
- [Additional criteria...]
|
|
61
|
-
|
|
62
|
-
## Scope
|
|
63
|
-
|
|
64
|
-
**In scope:**
|
|
65
|
-
|
|
66
|
-
- [What's included]
|
|
67
|
-
|
|
68
|
-
**Out of scope:**
|
|
69
|
-
|
|
70
|
-
- [What's explicitly excluded or deferred]
|
|
71
|
-
|
|
72
|
-
## Constraints
|
|
73
|
-
|
|
74
|
-
- [Business/technical constraints if any]
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Phase 2: Plan Implementation (HOW)
|
|
78
|
-
|
|
79
|
-
Phase 2 begins with reconnaissance — orient yourself in the codebase before generating tasks. Skip exploration and your
|
|
80
|
-
plan will be guesswork.
|
|
81
|
-
|
|
82
|
-
#### Step 0: Explore the Project
|
|
83
|
-
|
|
84
|
-
Scope exploration to what will change the plan — read instruction files first, then only the specific files you need
|
|
85
|
-
for patterns and verification commands:
|
|
86
|
-
|
|
87
|
-
1. **Read project instructions first** — start with `CLAUDE.md` (or `AGENTS.md`) if it exists, then check
|
|
88
|
-
`.github/copilot-instructions.md` when present. Follow any links to other documentation. See the "Project Resources"
|
|
89
|
-
section in the Planning Common Context below for the full list of resources under `.claude/` and at the repo root.
|
|
90
|
-
2. **Read manifest files** — `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `pom.xml`, etc. for dependencies
|
|
91
|
-
and scripts
|
|
92
|
-
3. **Read README** — project overview, setup, and architecture
|
|
93
|
-
4. **Scan directory structure** — understand the layout before diving into files
|
|
94
|
-
5. **Find similar implementations** — look for existing features similar to what the requirements call for; follow
|
|
95
|
-
their patterns
|
|
96
|
-
6. **Extract verification commands** — find the exact build, test, lint, and typecheck commands from the repository
|
|
97
|
-
instruction files or project config
|
|
98
|
-
|
|
99
|
-
#### Step 1: Generate the Plan
|
|
100
|
-
|
|
101
|
-
1. **Map requirements to implementation** — Determine which parts of the approved requirements map to which repository
|
|
102
|
-
2. **Create tasks** — Following the Planning Common Context guidelines below
|
|
103
|
-
3. **Validate** — Ensure tasks are non-overlapping, properly ordered, and completable
|
|
104
|
-
|
|
105
|
-
### Blocker Handling
|
|
106
|
-
|
|
107
|
-
If you cannot produce a valid plan, signal the issue instead of outputting incomplete JSON:
|
|
108
|
-
|
|
109
|
-
- `<planning-blocked>reason</planning-blocked>`
|
|
110
|
-
|
|
111
|
-
<context>
|
|
112
|
-
|
|
113
|
-
## Idea to Implement
|
|
114
|
-
|
|
115
|
-
**Title:** {{IDEA_TITLE}}
|
|
116
|
-
|
|
117
|
-
**Project:** {{PROJECT_NAME}}
|
|
118
|
-
|
|
119
|
-
**Description:**
|
|
120
|
-
|
|
121
|
-
{{IDEA_DESCRIPTION}}
|
|
122
|
-
|
|
123
|
-
## Selected Repositories
|
|
124
|
-
|
|
125
|
-
You have access to these repositories:
|
|
126
|
-
|
|
127
|
-
{{REPOSITORIES}}
|
|
128
|
-
|
|
129
|
-
## Planning Common Context
|
|
130
|
-
|
|
131
|
-
{{COMMON}}
|
|
132
|
-
|
|
133
|
-
</context>
|
|
134
|
-
|
|
135
|
-
{{VALIDATION}}
|
|
136
|
-
|
|
137
|
-
## Output Format
|
|
138
|
-
|
|
139
|
-
Output a single JSON object with both requirements and tasks.
|
|
140
|
-
If you cannot produce a valid plan, output `<planning-blocked>reason</planning-blocked>` instead of JSON.
|
|
141
|
-
|
|
142
|
-
```json
|
|
143
|
-
{{SCHEMA}}
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
**Requirements:**
|
|
147
|
-
|
|
148
|
-
- Complete markdown string with the structure shown in Phase 1
|
|
149
|
-
- Implementation-agnostic (WHAT, not HOW)
|
|
150
|
-
- Clear acceptance criteria
|
|
151
|
-
|
|
152
|
-
**Tasks:**
|
|
153
|
-
|
|
154
|
-
- Each task has `id`, `name`, `projectPath`, `steps`, and optional `blockedBy`
|
|
155
|
-
- `projectPath` must be one of the Selected Repositories paths
|
|
156
|
-
- Steps reference actual files discovered during exploration
|
|
157
|
-
- Verification steps use commands from the repository instruction files if available
|
|
158
|
-
- Tasks properly ordered by dependencies
|
|
159
|
-
|
|
160
|
-
**Example:**
|
|
161
|
-
|
|
162
|
-
```json
|
|
163
|
-
{
|
|
164
|
-
"requirements": "## Problem\n\nUsers cannot filter exports by date range...\n\n## Requirements\n\n- Support optional start/end date query parameters...\n\n## Acceptance Criteria\n\n- Given valid ISO dates, When GET /exports?startDate=...&endDate=..., Then only matching exports returned\n\n## Scope\n\n**In scope:** Date filtering on export endpoint\n**Out of scope:** Date filtering on other endpoints\n\n## Constraints\n\n- Must use ISO8601 date format",
|
|
165
|
-
"tasks": [
|
|
166
|
-
{
|
|
167
|
-
"id": "1",
|
|
168
|
-
"name": "Add date range validation schema and export filter",
|
|
169
|
-
"projectPath": "/Users/dev/my-app",
|
|
170
|
-
"steps": [
|
|
171
|
-
"Create src/schemas/date-range.ts with DateRangeSchema using Zod — validate ISO8601 format, ensure startDate <= endDate",
|
|
172
|
-
"Modify src/controllers/export.ts to accept optional startDate/endDate query params using DateRangeSchema",
|
|
173
|
-
"Update src/repositories/export.ts findExports() to add WHERE clause for date filtering",
|
|
174
|
-
"Add unit tests in src/schemas/__tests__/date-range.test.ts covering valid ranges, invalid formats, and reversed dates",
|
|
175
|
-
"Add integration test in src/controllers/__tests__/export.test.ts for filtered and unfiltered queries",
|
|
176
|
-
"{{CHECK_GATE_EXAMPLE}}"
|
|
177
|
-
],
|
|
178
|
-
"verificationCriteria": [
|
|
179
|
-
"TypeScript compiles with no errors",
|
|
180
|
-
"All existing tests pass plus new tests for date range filtering",
|
|
181
|
-
"GET /exports?startDate=invalid returns 400 with validation error",
|
|
182
|
-
"Filtered query returns only records within the specified date range"
|
|
183
|
-
],
|
|
184
|
-
"blockedBy": []
|
|
185
|
-
}
|
|
186
|
-
]
|
|
187
|
-
}
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
{{SIGNALS}}
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
Proceed autonomously: refine the idea into clear requirements, explore the codebase, then generate tasks. Output only
|
|
195
|
-
the final JSON when complete.
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Evaluator Feedback — Fix and Re-verify
|
|
2
|
-
|
|
3
|
-
You are a task implementer responding to a code review. The independent reviewer's findings are authoritative. For each
|
|
4
|
-
issue, think through what is broken and what the minimal safe fix is — then apply, re-verify, and signal completion.
|
|
5
|
-
|
|
6
|
-
{{HARNESS_CONTEXT}}
|
|
7
|
-
|
|
8
|
-
When finished, emit a signal from the `<signals>` block below.
|
|
9
|
-
|
|
10
|
-
<constraints>
|
|
11
|
-
|
|
12
|
-
- **Stay within scope** — fix only what the critique flags; keep edits local to the files and lines the critique
|
|
13
|
-
calls out. Do not expand the task or refactor neighboring code.
|
|
14
|
-
- **Default to minimal fix** — make targeted changes; preserve the existing implementation structure where possible.
|
|
15
|
-
- **Pivot when the critique is structural, not local** — if the findings point at a fundamentally wrong approach
|
|
16
|
-
(wrong abstraction, wrong data flow, wrong contract) rather than localized bugs, a patch over the existing
|
|
17
|
-
implementation will likely fail re-evaluation on related grounds. In that case, replace the affected section
|
|
18
|
-
with a correct approach instead of repeatedly patching it. Use this judgement sparingly — most critiques are
|
|
19
|
-
genuinely local.
|
|
20
|
-
- **Treat reviewer findings as authoritative** — apply the fix they describe rather than rewriting the approach. If a
|
|
21
|
-
finding is genuinely wrong, signal `<task-blocked>` so a human can decide; do not silently ignore it.
|
|
22
|
-
|
|
23
|
-
</constraints>
|
|
24
|
-
|
|
25
|
-
## Critique
|
|
26
|
-
|
|
27
|
-
{{CRITIQUE}}
|
|
28
|
-
|
|
29
|
-
## Fix Protocol
|
|
30
|
-
|
|
31
|
-
1. **Address each issue** — Reference the file:line locations the reviewer cited. If a citation is
|
|
32
|
-
wrong, find the actually-affected location and fix that.
|
|
33
|
-
2. **Re-run verification** — Run the project's check script (or the equivalent verification
|
|
34
|
-
commands) and confirm they pass.{{COMMIT_INSTRUCTION}}
|
|
35
|
-
3. **Output verification results** — Wrap output in `<task-verified>...</task-verified>`.
|
|
36
|
-
4. **Signal completion** — Output `<task-complete>` ONLY after all steps above pass.
|
|
37
|
-
|
|
38
|
-
If an issue is unfixable (contradicts the spec, or requires changes outside your scope), signal
|
|
39
|
-
`<task-blocked>reason</task-blocked>` instead of completing.
|
|
40
|
-
|
|
41
|
-
{{SIGNALS}}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
wrapAsync
|
|
4
|
-
} from "./chunk-IWXBJD2D.mjs";
|
|
5
|
-
import {
|
|
6
|
-
IOError
|
|
7
|
-
} from "./chunk-VAZ3LJBI.mjs";
|
|
8
|
-
|
|
9
|
-
// src/integration/cli/completion/resolver.ts
|
|
10
|
-
var dynamicResolvers = {
|
|
11
|
-
"--project": async () => {
|
|
12
|
-
const result = await wrapAsync(
|
|
13
|
-
async () => {
|
|
14
|
-
const { listProjects } = await import("./project-DQHF4ISP.mjs");
|
|
15
|
-
return listProjects();
|
|
16
|
-
},
|
|
17
|
-
(err) => new IOError("Failed to load projects for completion", err instanceof Error ? err : void 0)
|
|
18
|
-
);
|
|
19
|
-
if (!result.ok) return [];
|
|
20
|
-
return result.value.map((p) => ({ name: p.name, description: p.displayName }));
|
|
21
|
-
},
|
|
22
|
-
"--status": () => {
|
|
23
|
-
return Promise.resolve([
|
|
24
|
-
{ name: "draft", description: "Draft sprints" },
|
|
25
|
-
{ name: "active", description: "Active sprints" },
|
|
26
|
-
{ name: "closed", description: "Closed sprints" },
|
|
27
|
-
{ name: "todo", description: "Todo tasks" },
|
|
28
|
-
{ name: "in_progress", description: "In-progress tasks" },
|
|
29
|
-
{ name: "done", description: "Done tasks" },
|
|
30
|
-
{ name: "pending", description: "Pending requirements" },
|
|
31
|
-
{ name: "approved", description: "Approved requirements" }
|
|
32
|
-
]);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
var configKeyCompletions = [
|
|
36
|
-
{ name: "provider", description: "AI provider (claude or copilot)" },
|
|
37
|
-
{ name: "editor", description: "External editor for multiline input" }
|
|
38
|
-
];
|
|
39
|
-
var configValueCompletions = {
|
|
40
|
-
provider: [
|
|
41
|
-
{ name: "claude", description: "Claude Code CLI" },
|
|
42
|
-
{ name: "copilot", description: "GitHub Copilot CLI" }
|
|
43
|
-
]
|
|
44
|
-
};
|
|
45
|
-
async function getSprintCompletions() {
|
|
46
|
-
const result = await wrapAsync(
|
|
47
|
-
async () => {
|
|
48
|
-
const { listSprints } = await import("./sprint-4E26AB5F.mjs");
|
|
49
|
-
return listSprints();
|
|
50
|
-
},
|
|
51
|
-
(err) => new IOError("Failed to load sprints for completion", err instanceof Error ? err : void 0)
|
|
52
|
-
);
|
|
53
|
-
if (!result.ok) return [];
|
|
54
|
-
return result.value.map((s) => ({
|
|
55
|
-
name: s.id,
|
|
56
|
-
description: `${s.name} (${s.status})`
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
function getSubcommands(cmd) {
|
|
60
|
-
return cmd.commands.map((sub) => ({
|
|
61
|
-
name: sub.name(),
|
|
62
|
-
description: sub.description()
|
|
63
|
-
}));
|
|
64
|
-
}
|
|
65
|
-
function getOptions(cmd) {
|
|
66
|
-
const items = [];
|
|
67
|
-
for (const opt of cmd.options) {
|
|
68
|
-
const flag = opt.long ?? opt.short;
|
|
69
|
-
if (flag) {
|
|
70
|
-
items.push({ name: flag, description: opt.description });
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return items;
|
|
74
|
-
}
|
|
75
|
-
function findSubcommand(cmd, name) {
|
|
76
|
-
return cmd.commands.find((sub) => sub.name() === name);
|
|
77
|
-
}
|
|
78
|
-
function optionExpectsValue(cmd, flag) {
|
|
79
|
-
const opt = cmd.options.find((o) => o.long === flag || o.short === flag);
|
|
80
|
-
if (!opt) return false;
|
|
81
|
-
return opt.required || opt.optional;
|
|
82
|
-
}
|
|
83
|
-
function parseWords(line) {
|
|
84
|
-
return line.trim().split(/\s+/).slice(1);
|
|
85
|
-
}
|
|
86
|
-
async function resolveCompletions(program, ctx) {
|
|
87
|
-
const words = parseWords(ctx.line);
|
|
88
|
-
let currentCmd = program;
|
|
89
|
-
let wordIndex = 0;
|
|
90
|
-
while (wordIndex < words.length) {
|
|
91
|
-
const word = words[wordIndex];
|
|
92
|
-
if (!word) break;
|
|
93
|
-
if (word.startsWith("-")) {
|
|
94
|
-
wordIndex++;
|
|
95
|
-
if (optionExpectsValue(currentCmd, word) && wordIndex < words.length) {
|
|
96
|
-
wordIndex++;
|
|
97
|
-
}
|
|
98
|
-
continue;
|
|
99
|
-
}
|
|
100
|
-
const sub = findSubcommand(currentCmd, word);
|
|
101
|
-
if (sub) {
|
|
102
|
-
currentCmd = sub;
|
|
103
|
-
wordIndex++;
|
|
104
|
-
} else {
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
const cmdPath = getCommandPath(currentCmd);
|
|
109
|
-
if (cmdPath === "config set") {
|
|
110
|
-
return resolveConfigSetCompletions(words, ctx);
|
|
111
|
-
}
|
|
112
|
-
if (ctx.prev.startsWith("-")) {
|
|
113
|
-
const resolver = dynamicResolvers[ctx.prev];
|
|
114
|
-
if (resolver) {
|
|
115
|
-
return resolver();
|
|
116
|
-
}
|
|
117
|
-
if (optionExpectsValue(currentCmd, ctx.prev)) {
|
|
118
|
-
return [];
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
if (ctx.last.startsWith("-")) {
|
|
122
|
-
return getOptions(currentCmd);
|
|
123
|
-
}
|
|
124
|
-
const subs = getSubcommands(currentCmd);
|
|
125
|
-
if (subs.length > 0) {
|
|
126
|
-
return subs;
|
|
127
|
-
}
|
|
128
|
-
if (cmdPath.startsWith("sprint ") && acceptsPositionalArg(currentCmd)) {
|
|
129
|
-
return getSprintCompletions();
|
|
130
|
-
}
|
|
131
|
-
return [];
|
|
132
|
-
}
|
|
133
|
-
function getCommandPath(cmd) {
|
|
134
|
-
const parts = [];
|
|
135
|
-
let current = cmd;
|
|
136
|
-
while (current.parent) {
|
|
137
|
-
parts.unshift(current.name());
|
|
138
|
-
current = current.parent;
|
|
139
|
-
}
|
|
140
|
-
return parts.join(" ");
|
|
141
|
-
}
|
|
142
|
-
function acceptsPositionalArg(cmd) {
|
|
143
|
-
return cmd.registeredArguments.length > 0;
|
|
144
|
-
}
|
|
145
|
-
function resolveConfigSetCompletions(words, ctx) {
|
|
146
|
-
const setIndex = words.indexOf("set");
|
|
147
|
-
if (setIndex === -1) {
|
|
148
|
-
return Promise.resolve(configKeyCompletions);
|
|
149
|
-
}
|
|
150
|
-
const argsAfterSet = words.slice(setIndex + 1).filter((w) => !w.startsWith("-"));
|
|
151
|
-
if (argsAfterSet.length === 0) {
|
|
152
|
-
return Promise.resolve(configKeyCompletions);
|
|
153
|
-
}
|
|
154
|
-
if (argsAfterSet.length === 1 && ctx.last !== "") {
|
|
155
|
-
return Promise.resolve(configKeyCompletions);
|
|
156
|
-
}
|
|
157
|
-
const key = argsAfterSet[0];
|
|
158
|
-
const values = key ? configValueCompletions[key] : void 0;
|
|
159
|
-
return Promise.resolve(values ?? []);
|
|
160
|
-
}
|
|
161
|
-
export {
|
|
162
|
-
resolveCompletions
|
|
163
|
-
};
|
package/dist/sprint-4E26AB5F.mjs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
activateSprint,
|
|
4
|
-
assertSprintStatus,
|
|
5
|
-
closeSprint,
|
|
6
|
-
createSprint,
|
|
7
|
-
deleteSprint,
|
|
8
|
-
getCurrentSprintOrThrow,
|
|
9
|
-
getSprint,
|
|
10
|
-
listSprints,
|
|
11
|
-
logSprintBaselines,
|
|
12
|
-
resolveSprintId,
|
|
13
|
-
saveSprint
|
|
14
|
-
} from "./chunk-CBMFRQ4Y.mjs";
|
|
15
|
-
import "./chunk-XN2UIHBY.mjs";
|
|
16
|
-
import "./chunk-IWXBJD2D.mjs";
|
|
17
|
-
import "./chunk-WDMLPXOD.mjs";
|
|
18
|
-
import {
|
|
19
|
-
NoCurrentSprintError,
|
|
20
|
-
SprintNotFoundError,
|
|
21
|
-
SprintStatusError
|
|
22
|
-
} from "./chunk-VAZ3LJBI.mjs";
|
|
23
|
-
export {
|
|
24
|
-
NoCurrentSprintError,
|
|
25
|
-
SprintNotFoundError,
|
|
26
|
-
SprintStatusError,
|
|
27
|
-
activateSprint,
|
|
28
|
-
assertSprintStatus,
|
|
29
|
-
closeSprint,
|
|
30
|
-
createSprint,
|
|
31
|
-
deleteSprint,
|
|
32
|
-
getCurrentSprintOrThrow,
|
|
33
|
-
getSprint,
|
|
34
|
-
listSprints,
|
|
35
|
-
logSprintBaselines,
|
|
36
|
-
resolveSprintId,
|
|
37
|
-
saveSprint
|
|
38
|
-
};
|
package/dist/start-T34NI3LF.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
parseSprintStartArgs,
|
|
4
|
-
sprintStartCommand
|
|
5
|
-
} from "./chunk-D6QZNEYN.mjs";
|
|
6
|
-
import "./chunk-62HYDA7L.mjs";
|
|
7
|
-
import "./chunk-GQ2WFKBN.mjs";
|
|
8
|
-
import "./chunk-CFUVE2BP.mjs";
|
|
9
|
-
import "./chunk-747KW2RW.mjs";
|
|
10
|
-
import "./chunk-BSB4EDGR.mjs";
|
|
11
|
-
import "./chunk-CBMFRQ4Y.mjs";
|
|
12
|
-
import "./chunk-XN2UIHBY.mjs";
|
|
13
|
-
import "./chunk-IWXBJD2D.mjs";
|
|
14
|
-
import "./chunk-WDMLPXOD.mjs";
|
|
15
|
-
import "./chunk-VAZ3LJBI.mjs";
|
|
16
|
-
export {
|
|
17
|
-
parseSprintStartArgs,
|
|
18
|
-
sprintStartCommand
|
|
19
|
-
};
|