@gh-symphony/cli 0.0.22 → 0.1.2
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 +72 -77
- package/dist/{chunk-IWFX2FMA.js → chunk-6I753NYO.js} +4 -1
- package/dist/{workflow-L3KT6HB7.js → chunk-B4ZJMAZL.js} +27 -19
- package/dist/{chunk-2TSM3INR.js → chunk-DLZAJXZL.js} +575 -12
- package/dist/chunk-GHVDABFO.js +235 -0
- package/dist/{chunk-EEQQWTXS.js → chunk-GPRCOJDJ.js} +158 -75
- package/dist/{chunk-36KYEDEO.js → chunk-MVRF7BES.js} +1 -10
- package/dist/{chunk-2UW7NQLX.js → chunk-VFHMHHZW.js} +1 -1
- package/dist/{chunk-HMLBBZNY.js → chunk-WM2B6BJ7.js} +16 -71
- package/dist/{chunk-QIRE2VXS.js → chunk-WOVNN5NW.js} +16 -17
- package/dist/{chunk-C67H3OUL.js → chunk-Z3NZOPLZ.js} +0 -81
- package/dist/{config-cmd-Z3A7V6NC.js → config-cmd-2ADPUYWA.js} +1 -1
- package/dist/{doctor-EJUMPBMW.js → doctor-EEPNFCGF.js} +464 -40
- package/dist/index.js +340 -294
- package/dist/{chunk-PUDXVBSN.js → repo-RX4OK7XH.js} +5944 -3001
- package/dist/{setup-TZJSM3QV.js → setup-XNHHRBGU.js} +57 -92
- package/dist/{upgrade-O33S2SJK.js → upgrade-NS53EO2B.js} +2 -2
- package/dist/{version-CW54Q7BK.js → version-2RHFZ5CI.js} +1 -1
- package/dist/worker-entry.js +10 -5
- package/dist/workflow-26QNZZWH.js +22 -0
- package/package.json +4 -4
- package/dist/chunk-DDL4BWSL.js +0 -146
- package/dist/chunk-DFLXHNYQ.js +0 -482
- package/dist/chunk-E7HYEEZD.js +0 -1318
- package/dist/chunk-GDE6FYN4.js +0 -26
- package/dist/chunk-GSX2FV3M.js +0 -103
- package/dist/chunk-ZHOKYUO3.js +0 -1047
- package/dist/init-54HMKNYI.js +0 -38
- package/dist/logs-GTZ4U5JE.js +0 -188
- package/dist/project-RMYMZSFV.js +0 -25
- package/dist/recover-LTLKMTRX.js +0 -133
- package/dist/repo-WI7GF6XQ.js +0 -749
- package/dist/run-IHN3ZL35.js +0 -122
- package/dist/start-RTAHQMR2.js +0 -19
- package/dist/status-F4D52OVK.js +0 -12
- package/dist/stop-MDKMJPVR.js +0 -10
package/README.md
CHANGED
|
@@ -36,6 +36,7 @@ Validate the machine and repo prerequisites before first use:
|
|
|
36
36
|
gh-symphony doctor
|
|
37
37
|
gh-symphony doctor --fix
|
|
38
38
|
gh-symphony doctor --json
|
|
39
|
+
gh-symphony doctor --smoke
|
|
39
40
|
GITHUB_GRAPHQL_TOKEN=ghp_your_classic_token gh-symphony doctor --json
|
|
40
41
|
```
|
|
41
42
|
|
|
@@ -62,6 +63,7 @@ gh-symphony workflow init
|
|
|
62
63
|
gh-symphony workflow init --dry-run
|
|
63
64
|
gh-symphony workflow validate
|
|
64
65
|
gh-symphony workflow preview --issue owner/repo#123
|
|
66
|
+
gh-symphony doctor --smoke --issue owner/repo#123
|
|
65
67
|
```
|
|
66
68
|
|
|
67
69
|
The interactive wizard will:
|
|
@@ -105,16 +107,16 @@ You can further customize the agent's behavior by editing `WORKFLOW.md` — this
|
|
|
105
107
|
|
|
106
108
|
> Currently supported runtimes: **Codex**, **Claude Code**
|
|
107
109
|
|
|
108
|
-
###
|
|
110
|
+
### Repository `.env` Mapping
|
|
109
111
|
|
|
110
|
-
If your hooks or worker runs need staging hosts, database URLs, Playwright base URLs, or other runtime-only values, store them in the
|
|
112
|
+
If your hooks or worker runs need staging hosts, database URLs, Playwright base URLs, or other runtime-only values, store them in the repository runtime directory instead of hardcoding them in `WORKFLOW.md`.
|
|
111
113
|
|
|
112
|
-
1.
|
|
114
|
+
1. Initialize the repository runtime with `gh-symphony repo init`.
|
|
113
115
|
2. Create the runtime env file:
|
|
114
116
|
|
|
115
117
|
```bash
|
|
116
|
-
mkdir -p
|
|
117
|
-
cat >
|
|
118
|
+
mkdir -p .runtime/orchestrator
|
|
119
|
+
cat > .runtime/orchestrator/.env <<'EOF'
|
|
118
120
|
STAGING_API_HOST=https://staging.example.com
|
|
119
121
|
DATABASE_URL=postgres://user:pass@staging-db:5432/app
|
|
120
122
|
PLAYWRIGHT_BASE_URL=http://localhost:3000
|
|
@@ -135,14 +137,14 @@ Env precedence during hook execution and worker spawn is:
|
|
|
135
137
|
- system env as the override layer
|
|
136
138
|
- Symphony context vars such as `SYMPHONY_*` as the highest-priority layer
|
|
137
139
|
|
|
138
|
-
|
|
140
|
+
The repository runtime always lives under `.runtime/orchestrator/`.
|
|
139
141
|
|
|
140
|
-
## 3. Set Orchestrator Runner (
|
|
142
|
+
## 3. Set Orchestrator Runner (Repository)
|
|
141
143
|
|
|
142
|
-
|
|
144
|
+
From inside the cloned repository that should run orchestration, initialize the workflow and repository runtime:
|
|
143
145
|
|
|
144
146
|
```bash
|
|
145
|
-
gh-symphony
|
|
147
|
+
gh-symphony setup
|
|
146
148
|
```
|
|
147
149
|
|
|
148
150
|
The interactive wizard will:
|
|
@@ -150,8 +152,7 @@ The interactive wizard will:
|
|
|
150
152
|
1. Authenticate via `GITHUB_GRAPHQL_TOKEN` or fall back to `gh` CLI
|
|
151
153
|
2. Let you select a **GitHub Project**
|
|
152
154
|
3. Optionally limit processing to issues assigned to the authenticated user
|
|
153
|
-
4.
|
|
154
|
-
5. Write project configuration to `~/.gh-symphony/`
|
|
155
|
+
4. Write `WORKFLOW.md`, support files, and `.runtime/orchestrator/` in the repository
|
|
155
156
|
|
|
156
157
|
This wizard uses the same pagination-aware discovery path as `workflow init`, so it can enumerate large personal and organization-backed GitHub accounts more reliably. If the CLI stops at a safety limit, it warns that the visible project list may be incomplete.
|
|
157
158
|
|
|
@@ -162,55 +163,40 @@ GITHUB_GRAPHQL_TOKEN=ghp_your_classic_token \
|
|
|
162
163
|
gh-symphony workflow init --non-interactive --project PVT_xxx --output WORKFLOW.md
|
|
163
164
|
|
|
164
165
|
GITHUB_GRAPHQL_TOKEN=ghp_your_classic_token \
|
|
165
|
-
gh-symphony
|
|
166
|
+
gh-symphony repo init
|
|
166
167
|
```
|
|
167
168
|
|
|
168
|
-
Token-only
|
|
169
|
+
Token-only setup is also supported when exactly one GitHub Project is visible to the token:
|
|
169
170
|
|
|
170
171
|
```bash
|
|
171
172
|
export GITHUB_GRAPHQL_TOKEN=ghp_your_classic_token
|
|
172
|
-
gh-symphony
|
|
173
|
+
gh-symphony setup
|
|
173
174
|
```
|
|
174
175
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
### Project Management
|
|
176
|
+
### Repository Management
|
|
178
177
|
|
|
179
178
|
```bash
|
|
180
179
|
gh-symphony doctor # Validate local prerequisites, auth, config, WORKFLOW.md, and runtime command
|
|
181
180
|
gh-symphony doctor --fix # Apply safe fixes and guide/launch follow-up recovery commands
|
|
182
|
-
gh-symphony
|
|
183
|
-
gh-symphony
|
|
184
|
-
gh-symphony
|
|
185
|
-
gh-symphony repo
|
|
186
|
-
gh-symphony repo
|
|
187
|
-
gh-symphony repo
|
|
188
|
-
gh-symphony repo sync --prune # Remove local repositories no longer linked
|
|
181
|
+
gh-symphony doctor --smoke # Final preflight: validate a live issue without dispatching work
|
|
182
|
+
gh-symphony repo init # Bind .runtime/orchestrator to the cwd repository
|
|
183
|
+
gh-symphony repo status # Show current repository orchestration status
|
|
184
|
+
gh-symphony repo explain owner/repo#123 # Explain why one issue is not dispatching
|
|
185
|
+
gh-symphony repo start # Start this repository
|
|
186
|
+
gh-symphony repo stop # Stop this repository
|
|
189
187
|
```
|
|
190
188
|
|
|
191
|
-
|
|
192
|
-
project starts empty or when you want to register a repository before it is
|
|
193
|
-
linked on the GitHub Project board. Successful validation stores the canonical
|
|
194
|
-
clone URL from the GitHub API. If auth is unavailable or the API is offline,
|
|
195
|
-
the CLI still saves the repo with the fallback HTTPS clone URL and prints a
|
|
196
|
-
warning that validation was skipped.
|
|
197
|
-
|
|
198
|
-
Use `gh-symphony repo sync` when the GitHub Project board has gained or lost
|
|
199
|
-
linked repositories since the project was first added locally. Default sync is
|
|
200
|
-
additive; `--prune` switches to strict alignment, and `--json` prints the added,
|
|
201
|
-
removed, unchanged, and final repository sets.
|
|
202
|
-
|
|
203
|
-
For empty projects, use `gh-symphony repo add owner/name` after setup to seed the local repository list without re-running the whole wizard.
|
|
189
|
+
`gh-symphony repo init` reads `WORKFLOW.md`, infers `owner/name` from the Git remote, and writes per-repo runtime state under `.runtime/orchestrator/`.
|
|
204
190
|
|
|
205
191
|
### Why Is My Issue Not Running?
|
|
206
192
|
|
|
207
|
-
Use `gh-symphony
|
|
193
|
+
Use `gh-symphony repo explain <owner/repo#number>` before digging through
|
|
208
194
|
logs manually:
|
|
209
195
|
|
|
210
196
|
```bash
|
|
211
|
-
gh-symphony
|
|
212
|
-
gh-symphony
|
|
213
|
-
gh-symphony
|
|
197
|
+
gh-symphony repo explain owner/repo#123
|
|
198
|
+
gh-symphony repo explain owner/repo#123 --json
|
|
199
|
+
gh-symphony repo explain owner/repo#123 --workflow ./WORKFLOW.md
|
|
214
200
|
```
|
|
215
201
|
|
|
216
202
|
The command checks project repository linkage, GitHub Project item presence,
|
|
@@ -235,57 +221,67 @@ Checks:
|
|
|
235
221
|
```
|
|
236
222
|
|
|
237
223
|
The remediation hints point to existing commands such as `workflow preview`,
|
|
238
|
-
`doctor`, `
|
|
224
|
+
`doctor`, `repo status`, and `repo logs --issue`.
|
|
239
225
|
|
|
240
226
|
## 4. Run the Orchestrator
|
|
241
227
|
|
|
242
228
|
### Foreground
|
|
243
229
|
|
|
244
230
|
```bash
|
|
245
|
-
gh-symphony start
|
|
246
|
-
gh-symphony start --once # Run startup cleanup + one orchestration tick, then exit
|
|
247
|
-
gh-symphony project start --once # Same one-shot flow for an explicit project
|
|
231
|
+
gh-symphony repo start
|
|
232
|
+
gh-symphony repo start --once # Run startup cleanup + one orchestration tick, then exit
|
|
248
233
|
```
|
|
249
234
|
|
|
250
235
|
### Background (daemon)
|
|
251
236
|
|
|
252
237
|
```bash
|
|
253
|
-
gh-symphony start --daemon # Start in background
|
|
254
|
-
gh-symphony stop # Stop the daemon
|
|
238
|
+
gh-symphony repo start --daemon # Start in background
|
|
239
|
+
gh-symphony repo stop # Stop the daemon
|
|
255
240
|
```
|
|
256
241
|
|
|
257
|
-
Use `start --once` for the first real managed-project run or a CI smoke check. It reuses the configured GitHub Project binding and `WORKFLOW.md` and performs exactly one poll/reconcile/dispatch cycle instead of entering the long-running orchestration loop. `--daemon --once` is rejected because the modes conflict. If you add `--http`, the dashboard/API remains available after that one-shot tick completes, and the process stays up until you interrupt it with `Ctrl+C`.
|
|
242
|
+
Run `doctor --smoke` before the first `start --once` when you want a safe pre-dispatch readiness check. Use `start --once` for the first real managed-project run or a CI smoke check. It reuses the configured GitHub Project binding and `WORKFLOW.md` and performs exactly one poll/reconcile/dispatch cycle instead of entering the long-running orchestration loop. `--daemon --once` is rejected because the modes conflict. If you add `--http`, the dashboard/API remains available after that one-shot tick completes, and the process stays up until you interrupt it with `Ctrl+C`.
|
|
258
243
|
|
|
259
244
|
### Monitor
|
|
260
245
|
|
|
261
246
|
```bash
|
|
262
|
-
gh-symphony status # Show current status
|
|
263
|
-
gh-symphony status --watch # Live dashboard
|
|
264
|
-
gh-symphony logs # View event logs
|
|
265
|
-
gh-symphony logs --follow # Stream logs in real-time
|
|
247
|
+
gh-symphony repo status # Show current status
|
|
248
|
+
gh-symphony repo status --watch # Live dashboard
|
|
249
|
+
gh-symphony repo logs # View event logs
|
|
250
|
+
gh-symphony repo logs --follow # Stream logs in real-time
|
|
266
251
|
```
|
|
267
252
|
|
|
268
253
|
### Dispatch a Single Issue
|
|
269
254
|
|
|
270
255
|
```bash
|
|
271
|
-
gh-symphony run org/repo#123
|
|
256
|
+
gh-symphony repo run org/repo#123
|
|
272
257
|
```
|
|
273
258
|
|
|
274
259
|
### Recover Stalled Runs
|
|
275
260
|
|
|
276
261
|
```bash
|
|
277
|
-
gh-symphony recover # Recover stalled runs
|
|
278
|
-
gh-symphony recover --dry-run # Preview what would be recovered
|
|
262
|
+
gh-symphony repo recover # Recover stalled runs
|
|
263
|
+
gh-symphony repo recover --dry-run # Preview what would be recovered
|
|
279
264
|
```
|
|
280
265
|
|
|
281
266
|
## Diagnostics
|
|
282
267
|
|
|
283
|
-
`gh-symphony doctor` validates the most common first-run prerequisites in one pass. `gh-symphony doctor --
|
|
268
|
+
`gh-symphony doctor` validates the most common first-run prerequisites in one pass. `gh-symphony doctor --smoke` is the recommended final preflight before `gh-symphony repo start --once`: it resolves the active managed project, checks the GitHub Project binding, confirms the repository and target issue are readable through the project, renders `WORKFLOW.md` for that issue, verifies the runtime command, workspace root, and configured hook paths, and exits without dispatching a worker.
|
|
269
|
+
|
|
270
|
+
Use an explicit issue when you want a deterministic check:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
gh-symphony doctor --smoke --issue owner/repo#123
|
|
274
|
+
gh-symphony doctor --smoke --issue owner/repo#123 --json
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Without `--issue`, doctor auto-selects one active live issue from the managed project. If none is suitable, the report explains which active states it expected and suggests re-running with `--issue`.
|
|
278
|
+
|
|
279
|
+
`gh-symphony doctor --fix` extends the regular diagnostic flow with safe remediation and guided follow-up:
|
|
284
280
|
|
|
285
281
|
- creates missing config/runtime/workspace directories
|
|
286
282
|
- launches `gh auth login` or `gh auth refresh` when a TTY is available, otherwise prints the exact command to run
|
|
287
|
-
- launches `gh-symphony init` when `WORKFLOW.md` is missing or invalid
|
|
288
|
-
- launches `gh-symphony
|
|
283
|
+
- launches `gh-symphony workflow init` when `WORKFLOW.md` is missing or invalid
|
|
284
|
+
- launches `gh-symphony setup` when repository runtime setup or GitHub Project binding must be repaired
|
|
289
285
|
- prints concrete runtime install guidance when the configured command is missing on `PATH`
|
|
290
286
|
|
|
291
287
|
The diagnostic checks cover:
|
|
@@ -294,17 +290,19 @@ The diagnostic checks cover:
|
|
|
294
290
|
- Node.js runtime version against the documented minimum (`v24+`) and the current `process.version`
|
|
295
291
|
- Git installation availability on `PATH`, including `git --version` when available
|
|
296
292
|
- GitHub authentication via `GITHUB_GRAPHQL_TOKEN` or `gh`, including required scopes
|
|
297
|
-
-
|
|
298
|
-
-
|
|
293
|
+
- repository runtime selection plus GitHub Project binding resolution
|
|
294
|
+
- runtime/workspace path writability
|
|
299
295
|
- repository `WORKFLOW.md` presence and parse validity
|
|
300
296
|
- runtime command availability on `PATH`
|
|
297
|
+
- with `--smoke`: linked repository readiness, live issue readability, strict prompt rendering, and hook path resolution
|
|
301
298
|
|
|
302
299
|
Use JSON output for scripts and CI smoke checks. `--fix --json` includes a remediation section where each step is reported as `applied`, `skipped`, or `manual`.
|
|
303
300
|
|
|
304
301
|
```bash
|
|
305
302
|
gh-symphony doctor --json
|
|
306
303
|
gh-symphony doctor --fix --json
|
|
307
|
-
gh-symphony
|
|
304
|
+
gh-symphony doctor --smoke --json
|
|
305
|
+
gh-symphony repo start --once
|
|
308
306
|
```
|
|
309
307
|
|
|
310
308
|
JSON output includes the resolved auth source as `env` or `gh`.
|
|
@@ -313,33 +311,30 @@ JSON output includes the resolved auth source as `env` or `gh`.
|
|
|
313
311
|
|
|
314
312
|
```
|
|
315
313
|
Setup:
|
|
314
|
+
setup Generate WORKFLOW.md and initialize the cwd repository runtime
|
|
316
315
|
workflow init Interactive repository setup wizard
|
|
317
316
|
workflow validate Parse and strictly validate WORKFLOW.md
|
|
318
317
|
workflow preview Render the final worker prompt from a sample or live issue
|
|
319
|
-
doctor Run diagnostics and optional
|
|
318
|
+
doctor Run diagnostics, smoke checks, and optional remediation
|
|
320
319
|
config show Show current configuration
|
|
321
320
|
config set Set a configuration value
|
|
322
321
|
config edit Open config in $EDITOR
|
|
323
322
|
|
|
324
323
|
Orchestration:
|
|
325
|
-
|
|
326
|
-
start
|
|
327
|
-
start --
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
324
|
+
repo init Bind .runtime/orchestrator to the cwd repository
|
|
325
|
+
repo start Start the orchestrator (foreground)
|
|
326
|
+
repo start --once Run a single orchestration tick and exit
|
|
327
|
+
repo start --daemon Start the orchestrator (background)
|
|
328
|
+
repo stop Stop the background orchestrator
|
|
329
|
+
repo status Show orchestrator status
|
|
330
|
+
repo run <issue> Dispatch a single issue
|
|
331
|
+
repo recover Recover stalled runs
|
|
332
|
+
repo logs View orchestrator logs
|
|
333
|
+
repo explain Explain why an issue is not dispatching
|
|
333
334
|
completion <shell> Print shell completion for bash/zsh/fish
|
|
334
335
|
|
|
335
|
-
Project Management:
|
|
336
|
-
project add Add a new project (interactive wizard)
|
|
337
|
-
project list List all configured projects
|
|
338
|
-
project remove Remove a project
|
|
339
|
-
repo sync Refresh repositories from the linked GitHub Project
|
|
340
|
-
|
|
341
336
|
Global Options:
|
|
342
|
-
--config <dir> Config directory (default: ~/.gh-symphony)
|
|
337
|
+
--config <dir> Config directory (default: initialized cwd runtime, then ~/.gh-symphony)
|
|
343
338
|
--verbose Enable verbose output
|
|
344
339
|
--json Output in JSON format
|
|
345
340
|
--no-color Disable color output
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
REPO_RUNTIME_DIR
|
|
4
|
+
} from "./chunk-WOVNN5NW.js";
|
|
2
5
|
|
|
3
6
|
// src/orchestrator-runtime.ts
|
|
4
7
|
import { resolve } from "path";
|
|
@@ -6,7 +9,7 @@ function resolveRuntimeRoot(configDir) {
|
|
|
6
9
|
return resolve(configDir);
|
|
7
10
|
}
|
|
8
11
|
function resolveRepoRuntimeRoot(repoDir = process.cwd()) {
|
|
9
|
-
return resolve(repoDir,
|
|
12
|
+
return resolve(repoDir, REPO_RUNTIME_DIR);
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
export {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
workflow_init_default
|
|
4
|
+
} from "./chunk-WM2B6BJ7.js";
|
|
5
5
|
import {
|
|
6
|
-
fetchGithubProjectIssueByRepositoryAndNumber
|
|
7
|
-
|
|
6
|
+
fetchGithubProjectIssueByRepositoryAndNumber,
|
|
7
|
+
inspectManagedProjectSelection
|
|
8
|
+
} from "./chunk-DLZAJXZL.js";
|
|
8
9
|
import {
|
|
9
10
|
GitHubApiError,
|
|
10
11
|
createClient,
|
|
@@ -12,16 +13,12 @@ import {
|
|
|
12
13
|
getGhTokenWithSource,
|
|
13
14
|
getProjectDetail,
|
|
14
15
|
validateGitHubToken
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-Z3NZOPLZ.js";
|
|
16
17
|
import {
|
|
17
18
|
buildPromptVariables,
|
|
18
19
|
parseWorkflowMarkdown,
|
|
19
20
|
renderPrompt
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import {
|
|
22
|
-
inspectManagedProjectSelection
|
|
23
|
-
} from "./chunk-DDL4BWSL.js";
|
|
24
|
-
import "./chunk-QIRE2VXS.js";
|
|
21
|
+
} from "./chunk-GPRCOJDJ.js";
|
|
25
22
|
|
|
26
23
|
// src/commands/workflow.ts
|
|
27
24
|
import { readFile } from "fs/promises";
|
|
@@ -391,6 +388,14 @@ function readGitHubProjectBinding(projectConfig) {
|
|
|
391
388
|
const settingsProjectId = projectConfig.tracker.settings?.projectId;
|
|
392
389
|
return typeof settingsProjectId === "string" && settingsProjectId.trim().length > 0 ? settingsProjectId.trim() : null;
|
|
393
390
|
}
|
|
391
|
+
function renderIssueWorkflowPreview(input) {
|
|
392
|
+
const variables = buildPromptVariables(input.issue, {
|
|
393
|
+
attempt: input.attempt
|
|
394
|
+
});
|
|
395
|
+
return renderPrompt(input.workflow.promptTemplate, variables, {
|
|
396
|
+
strict: true
|
|
397
|
+
});
|
|
398
|
+
}
|
|
394
399
|
function formatAuthError(error) {
|
|
395
400
|
return `GitHub authentication is required for live issue preview. ${error.message}`;
|
|
396
401
|
}
|
|
@@ -406,7 +411,7 @@ async function loadLiveIssue(issueReference, projectId, options) {
|
|
|
406
411
|
const githubProjectId = readGitHubProjectBinding(selection.projectConfig);
|
|
407
412
|
if (!githubProjectId) {
|
|
408
413
|
throw new Error(
|
|
409
|
-
`Managed project "${selection.projectId}" is not bound to a GitHub Project.
|
|
414
|
+
`Managed project "${selection.projectId}" is not bound to a GitHub Project. Run 'gh-symphony workflow init' to select a valid GitHub Project binding, then run 'gh-symphony repo init'.`
|
|
410
415
|
);
|
|
411
416
|
}
|
|
412
417
|
let auth;
|
|
@@ -439,7 +444,7 @@ async function loadLiveIssue(issueReference, projectId, options) {
|
|
|
439
444
|
}
|
|
440
445
|
if (!findLinkedRepository(detail, issue.owner, issue.name)) {
|
|
441
446
|
throw new Error(
|
|
442
|
-
`Repository ${issue.owner}/${issue.name} is not linked to the configured GitHub Project "${detail.title}". Run 'gh-symphony
|
|
447
|
+
`Repository ${issue.owner}/${issue.name} is not linked to the configured GitHub Project "${detail.title}". Run 'gh-symphony setup' from inside the target repository, or run 'gh-symphony workflow init' followed by 'gh-symphony repo init'.`
|
|
443
448
|
);
|
|
444
449
|
}
|
|
445
450
|
const trackedIssue = await workflowCommandDependencies.fetchLiveIssue(
|
|
@@ -587,12 +592,11 @@ async function runPreview(args, options) {
|
|
|
587
592
|
);
|
|
588
593
|
}
|
|
589
594
|
const { issue, sampleSource } = flags.issue ? await loadLiveIssue(flags.issue, flags.projectId, options) : await loadSampleIssue(flags.sample);
|
|
590
|
-
const
|
|
595
|
+
const renderedPrompt = renderIssueWorkflowPreview({
|
|
596
|
+
workflow,
|
|
597
|
+
issue,
|
|
591
598
|
attempt: flags.attempt
|
|
592
599
|
});
|
|
593
|
-
const renderedPrompt = renderPrompt(workflow.promptTemplate, variables, {
|
|
594
|
-
strict: true
|
|
595
|
-
});
|
|
596
600
|
if (options.json) {
|
|
597
601
|
process.stdout.write(
|
|
598
602
|
`${JSON.stringify(
|
|
@@ -639,7 +643,7 @@ var handler = async (args, options) => {
|
|
|
639
643
|
try {
|
|
640
644
|
switch (parsed.subcommand) {
|
|
641
645
|
case "init":
|
|
642
|
-
await
|
|
646
|
+
await workflow_init_default(parsed.args, options);
|
|
643
647
|
return;
|
|
644
648
|
case "validate":
|
|
645
649
|
await runValidate(parsed.args, options);
|
|
@@ -656,8 +660,12 @@ var handler = async (args, options) => {
|
|
|
656
660
|
}
|
|
657
661
|
};
|
|
658
662
|
var workflow_default = handler;
|
|
663
|
+
|
|
659
664
|
export {
|
|
660
|
-
|
|
665
|
+
setWorkflowCommandDependenciesForTest,
|
|
661
666
|
resetWorkflowCommandDependenciesForTest,
|
|
662
|
-
|
|
667
|
+
parseIssueReference,
|
|
668
|
+
readGitHubProjectBinding,
|
|
669
|
+
renderIssueWorkflowPreview,
|
|
670
|
+
workflow_default
|
|
663
671
|
};
|