chief-clancy 0.7.0 → 0.7.1

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.
Files changed (182) hide show
  1. package/README.md +1 -1
  2. package/dist/bundle/clancy-once.js +50 -50
  3. package/package.json +5 -2
  4. package/src/templates/.env.example.github +19 -1
  5. package/src/templates/.env.example.jira +25 -1
  6. package/src/templates/.env.example.linear +19 -1
  7. package/dist/schemas/bitbucket-pr.d.ts +0 -137
  8. package/dist/schemas/bitbucket-pr.d.ts.map +0 -1
  9. package/dist/schemas/bitbucket-pr.js +0 -75
  10. package/dist/schemas/bitbucket-pr.js.map +0 -1
  11. package/dist/schemas/env.d.ts +0 -170
  12. package/dist/schemas/env.d.ts.map +0 -1
  13. package/dist/schemas/env.js +0 -69
  14. package/dist/schemas/env.js.map +0 -1
  15. package/dist/schemas/github-issues.d.ts +0 -105
  16. package/dist/schemas/github-issues.d.ts.map +0 -1
  17. package/dist/schemas/github-issues.js +0 -54
  18. package/dist/schemas/github-issues.js.map +0 -1
  19. package/dist/schemas/gitlab-mr.d.ts +0 -73
  20. package/dist/schemas/gitlab-mr.d.ts.map +0 -1
  21. package/dist/schemas/gitlab-mr.js +0 -33
  22. package/dist/schemas/gitlab-mr.js.map +0 -1
  23. package/dist/schemas/jira.d.ts +0 -59
  24. package/dist/schemas/jira.d.ts.map +0 -1
  25. package/dist/schemas/jira.js +0 -56
  26. package/dist/schemas/jira.js.map +0 -1
  27. package/dist/schemas/linear.d.ts +0 -108
  28. package/dist/schemas/linear.d.ts.map +0 -1
  29. package/dist/schemas/linear.js +0 -84
  30. package/dist/schemas/linear.js.map +0 -1
  31. package/dist/scripts/afk/afk.d.ts +0 -21
  32. package/dist/scripts/afk/afk.d.ts.map +0 -1
  33. package/dist/scripts/afk/afk.js +0 -145
  34. package/dist/scripts/afk/afk.js.map +0 -1
  35. package/dist/scripts/afk/report/report.d.ts +0 -47
  36. package/dist/scripts/afk/report/report.d.ts.map +0 -1
  37. package/dist/scripts/afk/report/report.js +0 -194
  38. package/dist/scripts/afk/report/report.js.map +0 -1
  39. package/dist/scripts/board/github/github.d.ts +0 -104
  40. package/dist/scripts/board/github/github.d.ts.map +0 -1
  41. package/dist/scripts/board/github/github.js +0 -291
  42. package/dist/scripts/board/github/github.js.map +0 -1
  43. package/dist/scripts/board/jira/jira.d.ts +0 -139
  44. package/dist/scripts/board/jira/jira.d.ts.map +0 -1
  45. package/dist/scripts/board/jira/jira.js +0 -378
  46. package/dist/scripts/board/jira/jira.js.map +0 -1
  47. package/dist/scripts/board/linear/linear.d.ts +0 -129
  48. package/dist/scripts/board/linear/linear.d.ts.map +0 -1
  49. package/dist/scripts/board/linear/linear.js +0 -393
  50. package/dist/scripts/board/linear/linear.js.map +0 -1
  51. package/dist/scripts/once/board-ops/board-ops.d.ts +0 -26
  52. package/dist/scripts/once/board-ops/board-ops.d.ts.map +0 -1
  53. package/dist/scripts/once/board-ops/board-ops.js +0 -113
  54. package/dist/scripts/once/board-ops/board-ops.js.map +0 -1
  55. package/dist/scripts/once/cost/cost.d.ts +0 -10
  56. package/dist/scripts/once/cost/cost.d.ts.map +0 -1
  57. package/dist/scripts/once/cost/cost.js +0 -23
  58. package/dist/scripts/once/cost/cost.js.map +0 -1
  59. package/dist/scripts/once/deliver/deliver.d.ts +0 -37
  60. package/dist/scripts/once/deliver/deliver.d.ts.map +0 -1
  61. package/dist/scripts/once/deliver/deliver.js +0 -253
  62. package/dist/scripts/once/deliver/deliver.js.map +0 -1
  63. package/dist/scripts/once/fetch-ticket/fetch-ticket.d.ts +0 -22
  64. package/dist/scripts/once/fetch-ticket/fetch-ticket.d.ts.map +0 -1
  65. package/dist/scripts/once/fetch-ticket/fetch-ticket.js +0 -123
  66. package/dist/scripts/once/fetch-ticket/fetch-ticket.js.map +0 -1
  67. package/dist/scripts/once/git-token/git-token.d.ts +0 -13
  68. package/dist/scripts/once/git-token/git-token.d.ts.map +0 -1
  69. package/dist/scripts/once/git-token/git-token.js +0 -30
  70. package/dist/scripts/once/git-token/git-token.js.map +0 -1
  71. package/dist/scripts/once/lock/lock.d.ts +0 -17
  72. package/dist/scripts/once/lock/lock.d.ts.map +0 -1
  73. package/dist/scripts/once/lock/lock.js +0 -70
  74. package/dist/scripts/once/lock/lock.js.map +0 -1
  75. package/dist/scripts/once/once.d.ts +0 -12
  76. package/dist/scripts/once/once.d.ts.map +0 -1
  77. package/dist/scripts/once/once.js +0 -452
  78. package/dist/scripts/once/once.js.map +0 -1
  79. package/dist/scripts/once/pr-creation/pr-creation.d.ts +0 -11
  80. package/dist/scripts/once/pr-creation/pr-creation.d.ts.map +0 -1
  81. package/dist/scripts/once/pr-creation/pr-creation.js +0 -50
  82. package/dist/scripts/once/pr-creation/pr-creation.js.map +0 -1
  83. package/dist/scripts/once/resume/resume.d.ts +0 -24
  84. package/dist/scripts/once/resume/resume.d.ts.map +0 -1
  85. package/dist/scripts/once/resume/resume.js +0 -159
  86. package/dist/scripts/once/resume/resume.js.map +0 -1
  87. package/dist/scripts/once/rework/rework.d.ts +0 -32
  88. package/dist/scripts/once/rework/rework.d.ts.map +0 -1
  89. package/dist/scripts/once/rework/rework.js +0 -208
  90. package/dist/scripts/once/rework/rework.js.map +0 -1
  91. package/dist/scripts/once/types/types.d.ts +0 -13
  92. package/dist/scripts/once/types/types.d.ts.map +0 -1
  93. package/dist/scripts/once/types/types.js +0 -2
  94. package/dist/scripts/once/types/types.js.map +0 -1
  95. package/dist/scripts/shared/branch/branch.d.ts +0 -50
  96. package/dist/scripts/shared/branch/branch.d.ts.map +0 -1
  97. package/dist/scripts/shared/branch/branch.js +0 -61
  98. package/dist/scripts/shared/branch/branch.js.map +0 -1
  99. package/dist/scripts/shared/claude-cli/claude-cli.d.ts +0 -31
  100. package/dist/scripts/shared/claude-cli/claude-cli.d.ts.map +0 -1
  101. package/dist/scripts/shared/claude-cli/claude-cli.js +0 -60
  102. package/dist/scripts/shared/claude-cli/claude-cli.js.map +0 -1
  103. package/dist/scripts/shared/env-schema/env-schema.d.ts +0 -27
  104. package/dist/scripts/shared/env-schema/env-schema.d.ts.map +0 -1
  105. package/dist/scripts/shared/env-schema/env-schema.js +0 -47
  106. package/dist/scripts/shared/env-schema/env-schema.js.map +0 -1
  107. package/dist/scripts/shared/feasibility/feasibility.d.ts +0 -30
  108. package/dist/scripts/shared/feasibility/feasibility.d.ts.map +0 -1
  109. package/dist/scripts/shared/feasibility/feasibility.js +0 -68
  110. package/dist/scripts/shared/feasibility/feasibility.js.map +0 -1
  111. package/dist/scripts/shared/format/format.d.ts +0 -11
  112. package/dist/scripts/shared/format/format.d.ts.map +0 -1
  113. package/dist/scripts/shared/format/format.js +0 -23
  114. package/dist/scripts/shared/format/format.js.map +0 -1
  115. package/dist/scripts/shared/git-ops/git-ops.d.ts +0 -90
  116. package/dist/scripts/shared/git-ops/git-ops.d.ts.map +0 -1
  117. package/dist/scripts/shared/git-ops/git-ops.js +0 -190
  118. package/dist/scripts/shared/git-ops/git-ops.js.map +0 -1
  119. package/dist/scripts/shared/http/http.d.ts +0 -54
  120. package/dist/scripts/shared/http/http.d.ts.map +0 -1
  121. package/dist/scripts/shared/http/http.js +0 -76
  122. package/dist/scripts/shared/http/http.js.map +0 -1
  123. package/dist/scripts/shared/notify/notify.d.ts +0 -46
  124. package/dist/scripts/shared/notify/notify.d.ts.map +0 -1
  125. package/dist/scripts/shared/notify/notify.js +0 -88
  126. package/dist/scripts/shared/notify/notify.js.map +0 -1
  127. package/dist/scripts/shared/preflight/preflight.d.ts +0 -40
  128. package/dist/scripts/shared/preflight/preflight.d.ts.map +0 -1
  129. package/dist/scripts/shared/preflight/preflight.js +0 -96
  130. package/dist/scripts/shared/preflight/preflight.js.map +0 -1
  131. package/dist/scripts/shared/progress/progress.d.ts +0 -88
  132. package/dist/scripts/shared/progress/progress.d.ts.map +0 -1
  133. package/dist/scripts/shared/progress/progress.js +0 -210
  134. package/dist/scripts/shared/progress/progress.js.map +0 -1
  135. package/dist/scripts/shared/prompt/prompt.d.ts +0 -58
  136. package/dist/scripts/shared/prompt/prompt.d.ts.map +0 -1
  137. package/dist/scripts/shared/prompt/prompt.js +0 -123
  138. package/dist/scripts/shared/prompt/prompt.js.map +0 -1
  139. package/dist/scripts/shared/pull-request/bitbucket/bitbucket.d.ts +0 -82
  140. package/dist/scripts/shared/pull-request/bitbucket/bitbucket.d.ts.map +0 -1
  141. package/dist/scripts/shared/pull-request/bitbucket/bitbucket.js +0 -301
  142. package/dist/scripts/shared/pull-request/bitbucket/bitbucket.js.map +0 -1
  143. package/dist/scripts/shared/pull-request/github/github.d.ts +0 -72
  144. package/dist/scripts/shared/pull-request/github/github.d.ts.map +0 -1
  145. package/dist/scripts/shared/pull-request/github/github.js +0 -226
  146. package/dist/scripts/shared/pull-request/github/github.js.map +0 -1
  147. package/dist/scripts/shared/pull-request/gitlab/gitlab.d.ts +0 -74
  148. package/dist/scripts/shared/pull-request/gitlab/gitlab.d.ts.map +0 -1
  149. package/dist/scripts/shared/pull-request/gitlab/gitlab.js +0 -220
  150. package/dist/scripts/shared/pull-request/gitlab/gitlab.js.map +0 -1
  151. package/dist/scripts/shared/pull-request/post-pr/post-pr.d.ts +0 -31
  152. package/dist/scripts/shared/pull-request/post-pr/post-pr.d.ts.map +0 -1
  153. package/dist/scripts/shared/pull-request/post-pr/post-pr.js +0 -61
  154. package/dist/scripts/shared/pull-request/post-pr/post-pr.js.map +0 -1
  155. package/dist/scripts/shared/pull-request/pr-body/pr-body.d.ts +0 -41
  156. package/dist/scripts/shared/pull-request/pr-body/pr-body.d.ts.map +0 -1
  157. package/dist/scripts/shared/pull-request/pr-body/pr-body.js +0 -93
  158. package/dist/scripts/shared/pull-request/pr-body/pr-body.js.map +0 -1
  159. package/dist/scripts/shared/pull-request/rework-comment/rework-comment.d.ts +0 -23
  160. package/dist/scripts/shared/pull-request/rework-comment/rework-comment.d.ts.map +0 -1
  161. package/dist/scripts/shared/pull-request/rework-comment/rework-comment.js +0 -30
  162. package/dist/scripts/shared/pull-request/rework-comment/rework-comment.js.map +0 -1
  163. package/dist/scripts/shared/remote/remote.d.ts +0 -41
  164. package/dist/scripts/shared/remote/remote.d.ts.map +0 -1
  165. package/dist/scripts/shared/remote/remote.js +0 -227
  166. package/dist/scripts/shared/remote/remote.js.map +0 -1
  167. package/dist/types/board.d.ts +0 -13
  168. package/dist/types/board.d.ts.map +0 -1
  169. package/dist/types/board.js +0 -5
  170. package/dist/types/board.js.map +0 -1
  171. package/dist/types/index.d.ts +0 -4
  172. package/dist/types/index.d.ts.map +0 -1
  173. package/dist/types/index.js +0 -2
  174. package/dist/types/index.js.map +0 -1
  175. package/dist/types/remote.d.ts +0 -55
  176. package/dist/types/remote.d.ts.map +0 -1
  177. package/dist/types/remote.js +0 -5
  178. package/dist/types/remote.js.map +0 -1
  179. package/dist/utils/parse-json/parse-json.d.ts +0 -20
  180. package/dist/utils/parse-json/parse-json.d.ts.map +0 -1
  181. package/dist/utils/parse-json/parse-json.js +0 -27
  182. package/dist/utils/parse-json/parse-json.js.map +0 -1
@@ -1,253 +0,0 @@
1
- import { execFileSync } from 'node:child_process';
2
- import { readFileSync } from 'node:fs';
3
- import { join } from 'node:path';
4
- import { formatDuration } from '../../../scripts/shared/format/format.js';
5
- import { branchExists, checkout, fetchRemoteBranch, pushBranch, remoteBranchExists, } from '../../../scripts/shared/git-ops/git-ops.js';
6
- import { appendProgress, findEntriesWithStatus, } from '../../../scripts/shared/progress/progress.js';
7
- import { buildEpicPrBody, buildPrBody, } from '../../../scripts/shared/pull-request/pr-body/pr-body.js';
8
- import { detectRemote } from '../../../scripts/shared/remote/remote.js';
9
- import { dim, green, red, yellow } from '../../../utils/ansi/ansi.js';
10
- import { sharedEnv, transitionToStatus } from '../board-ops/board-ops.js';
11
- import { attemptPrCreation, buildManualPrUrl, } from '../pr-creation/pr-creation.js';
12
- // ─── Epic branch management ─────────────────────────────────────────────────
13
- /**
14
- * Ensure the epic branch exists locally and on the remote.
15
- *
16
- * - If it exists on the remote, fetches it locally.
17
- * - If it only exists locally but not on the remote, refuses to overwrite
18
- * and prints migration instructions (safety guard for mid-upgrade users).
19
- * - If it doesn't exist at all, creates from `origin/{baseBranch}` and pushes.
20
- *
21
- * @param epicBranch - The epic branch name (e.g., `'epic/proj-100'`).
22
- * @param baseBranch - The base branch name (e.g., `'main'`).
23
- * @returns `true` if the branch is ready, `false` if creation was blocked.
24
- */
25
- export function ensureEpicBranch(epicBranch, baseBranch) {
26
- const existsOnRemote = remoteBranchExists(epicBranch);
27
- const existsLocally = branchExists(epicBranch);
28
- if (existsOnRemote) {
29
- const fetched = fetchRemoteBranch(epicBranch);
30
- if (!fetched) {
31
- console.log(yellow(`⚠ Epic branch ${epicBranch} exists on remote but could not be fetched.`));
32
- return false;
33
- }
34
- return true;
35
- }
36
- if (existsLocally) {
37
- // Local branch exists but not on remote — may have unpushed squash merges
38
- // from the old deliverViaEpicMerge flow. Refuse to overwrite.
39
- console.log(red(`✗ Epic branch ${epicBranch} exists locally but not on remote.`));
40
- console.log(yellow(' This may contain work from a previous Clancy version that squash-merged locally.'));
41
- console.log(dim(' To preserve this work, push it manually:'));
42
- console.log(dim(` git push -u origin ${epicBranch}`));
43
- console.log(dim(' Then re-run /clancy:once to continue.'));
44
- return false;
45
- }
46
- // Create fresh epic branch from latest remote base
47
- try {
48
- execFileSync('git', ['fetch', 'origin', baseBranch], {
49
- encoding: 'utf8',
50
- stdio: ['pipe', 'pipe', 'pipe'],
51
- timeout: 15_000,
52
- });
53
- execFileSync('git', ['checkout', '-b', epicBranch, `origin/${baseBranch}`], { encoding: 'utf8' });
54
- const pushed = pushBranch(epicBranch);
55
- if (!pushed) {
56
- console.log(yellow(`⚠ Created ${epicBranch} locally but could not push to origin.`));
57
- return false;
58
- }
59
- else {
60
- console.log(green(` ✓ Created epic branch ${epicBranch}`));
61
- }
62
- return true;
63
- }
64
- catch (err) {
65
- console.log(red(`✗ Could not create epic branch: ${err instanceof Error ? err.message : String(err)}`));
66
- return false;
67
- }
68
- }
69
- // ─── Delivery paths ──────────────────────────────────────────────────────────
70
- /**
71
- * PR flow: push branch to remote, create PR/MR, transition to In Review.
72
- *
73
- * @param parent - Optional parent key for progress logging (epic branch flow).
74
- * @returns `false` if the push failed (caller should handle early return).
75
- */
76
- export async function deliverViaPullRequest(config, ticket, ticketBranch, targetBranch, startTime, skipLog = false, parent) {
77
- const pushed = pushBranch(ticketBranch);
78
- if (!pushed) {
79
- console.log(yellow(`⚠ Could not push ${ticketBranch} to origin.`));
80
- console.log(dim(' The branch is still available locally. Push manually:'));
81
- console.log(dim(` git push -u origin ${ticketBranch}`));
82
- if (!skipLog)
83
- appendProgress(process.cwd(), ticket.key, ticket.title, 'PUSH_FAILED', undefined, parent);
84
- checkout(targetBranch);
85
- const elapsed = formatDuration(Date.now() - startTime);
86
- console.log('');
87
- console.log(yellow(`⚠ ${ticket.key} implemented but push failed`) +
88
- dim(` (${elapsed})`));
89
- return false;
90
- }
91
- console.log(green(` ✓ Pushed ${ticketBranch}`));
92
- // Check for verification warnings (file exists when verification didn't fully pass)
93
- let verificationWarning;
94
- try {
95
- const attemptPath = join(process.cwd(), '.clancy', 'verify-attempt.txt');
96
- const attempt = readFileSync(attemptPath, 'utf8').trim();
97
- const attemptNum = parseInt(attempt, 10);
98
- if (attemptNum > 0) {
99
- // The file exists = verification didn't fully pass. The number is
100
- // the attempt counter (1 = ran once and failed, 2 = ran twice, etc.)
101
- verificationWarning = `Verification checks did not fully pass (${attemptNum} attempt(s)). Review carefully.`;
102
- }
103
- }
104
- catch {
105
- // No verify-attempt file — verification passed or wasn't run
106
- }
107
- // Attempt PR/MR creation
108
- const platformOverride = sharedEnv(config).CLANCY_GIT_PLATFORM;
109
- const remote = detectRemote(platformOverride);
110
- const prTitle = `feat(${ticket.key}): ${ticket.title}`;
111
- const prBody = buildPrBody(config, {
112
- key: ticket.key,
113
- title: ticket.title,
114
- description: ticket.description,
115
- provider: config.provider,
116
- }, targetBranch, verificationWarning);
117
- if (remote.host !== 'none' &&
118
- remote.host !== 'unknown' &&
119
- remote.host !== 'azure') {
120
- const pr = await attemptPrCreation(config, remote, ticketBranch, targetBranch, prTitle, prBody);
121
- if (pr?.ok) {
122
- console.log(green(` ✓ PR created: ${pr.url}`));
123
- if (!skipLog)
124
- appendProgress(process.cwd(), ticket.key, ticket.title, 'PR_CREATED', pr.number, parent);
125
- }
126
- else if (pr && !pr.ok && pr.alreadyExists) {
127
- console.log(yellow(` ⚠ A PR/MR already exists for ${ticketBranch}. Branch pushed.`));
128
- if (!skipLog)
129
- appendProgress(process.cwd(), ticket.key, ticket.title, 'PUSHED', undefined, parent);
130
- }
131
- else if (pr && !pr.ok) {
132
- console.log(yellow(` ⚠ PR/MR creation failed: ${pr.error}`));
133
- const manualUrl = buildManualPrUrl(remote, ticketBranch, targetBranch);
134
- if (manualUrl) {
135
- console.log(dim(` Create one manually: ${manualUrl}`));
136
- }
137
- else {
138
- console.log(dim(' Branch pushed — create a PR/MR manually.'));
139
- }
140
- if (!skipLog)
141
- appendProgress(process.cwd(), ticket.key, ticket.title, 'PUSHED', undefined, parent);
142
- }
143
- else {
144
- // No token available for this platform
145
- const manualUrl = buildManualPrUrl(remote, ticketBranch, targetBranch);
146
- if (manualUrl) {
147
- console.log(dim(` Create a PR: ${manualUrl}`));
148
- }
149
- else {
150
- console.log(dim(' Branch pushed to remote. Create a PR/MR manually.'));
151
- }
152
- if (!skipLog)
153
- appendProgress(process.cwd(), ticket.key, ticket.title, 'PUSHED', undefined, parent);
154
- }
155
- }
156
- else if (remote.host === 'none') {
157
- console.log(yellow(`⚠ No git remote configured. Branch available locally: ${ticketBranch}`));
158
- if (!skipLog)
159
- appendProgress(process.cwd(), ticket.key, ticket.title, 'LOCAL', undefined, parent);
160
- }
161
- else {
162
- // Unknown or Azure remote — just note the push
163
- console.log(dim(' Branch pushed to remote. Create a PR/MR manually.'));
164
- if (!skipLog)
165
- appendProgress(process.cwd(), ticket.key, ticket.title, 'PUSHED', undefined, parent);
166
- }
167
- // Transition to In Review (not Done — PR hasn't been merged yet)
168
- // For GitHub Issues: do NOT close — PR body has "Closes #N" (or "Part of") for auto-close on merge
169
- if (config.provider !== 'github') {
170
- const statusReview = config.env.CLANCY_STATUS_REVIEW ?? config.env.CLANCY_STATUS_DONE;
171
- if (statusReview) {
172
- await transitionToStatus(config, ticket, statusReview);
173
- }
174
- }
175
- // Switch back to target branch
176
- checkout(targetBranch);
177
- return true;
178
- }
179
- // ─── Epic completion ──────────────────────────────────────────────────────────
180
- /**
181
- * Create the final PR from the epic branch to the base branch.
182
- *
183
- * Called when all children of an epic are done. Builds a PR body listing
184
- * all child tickets, creates the PR, and logs EPIC_PR_CREATED.
185
- *
186
- * @param config - The board configuration.
187
- * @param epicKey - The epic ticket key (e.g., `'PROJ-100'`).
188
- * @param epicTitle - The epic ticket title.
189
- * @param epicBranch - The epic branch name (e.g., `'epic/proj-100'`).
190
- * @param baseBranch - The base branch name (e.g., `'main'`).
191
- * @returns `true` if the PR was created successfully.
192
- */
193
- export async function deliverEpicToBase(config, epicKey, epicTitle, epicBranch, baseBranch) {
194
- console.log('');
195
- console.log(green(`🎉 All children of ${epicKey} are done!`));
196
- console.log(dim(` Creating epic PR: ${epicBranch} → ${baseBranch}`));
197
- // Gather child entries from progress.txt
198
- const allPrCreated = findEntriesWithStatus(process.cwd(), 'PR_CREATED');
199
- const allDone = findEntriesWithStatus(process.cwd(), 'DONE');
200
- const allReworked = findEntriesWithStatus(process.cwd(), 'REWORK');
201
- const allPushed = findEntriesWithStatus(process.cwd(), 'PUSHED');
202
- const childEntries = [
203
- ...allPrCreated,
204
- ...allDone,
205
- ...allReworked,
206
- ...allPushed,
207
- ].filter((e) => e.parent === epicKey);
208
- const platformOverride = sharedEnv(config).CLANCY_GIT_PLATFORM;
209
- const remote = detectRemote(platformOverride);
210
- const prTitle = `feat(${epicKey}): ${epicTitle}`;
211
- const prBody = buildEpicPrBody(epicKey, epicTitle, childEntries);
212
- if (remote.host === 'none' ||
213
- remote.host === 'unknown' ||
214
- remote.host === 'azure') {
215
- console.log(yellow(`⚠ Cannot create epic PR — no supported git remote detected.`));
216
- console.log(dim(` Push manually: git push origin ${epicBranch}`));
217
- console.log(dim(` Then create a PR targeting ${baseBranch}`));
218
- return false;
219
- }
220
- const pr = await attemptPrCreation(config, remote, epicBranch, baseBranch, prTitle, prBody);
221
- if (pr?.ok) {
222
- console.log(green(` ✓ Epic PR created: ${pr.url}`));
223
- appendProgress(process.cwd(), epicKey, epicTitle, 'EPIC_PR_CREATED', pr.number);
224
- // Transition epic ticket to Review
225
- if (config.provider !== 'github') {
226
- const statusReview = config.env.CLANCY_STATUS_REVIEW ?? config.env.CLANCY_STATUS_DONE;
227
- if (statusReview) {
228
- await transitionToStatus(config, {
229
- key: epicKey,
230
- title: epicTitle,
231
- description: '',
232
- parentInfo: 'none',
233
- blockers: 'None',
234
- }, statusReview);
235
- }
236
- }
237
- return true;
238
- }
239
- if (pr && !pr.ok && pr.alreadyExists) {
240
- console.log(yellow(` ⚠ An epic PR already exists for ${epicBranch}.`));
241
- appendProgress(process.cwd(), epicKey, epicTitle, 'EPIC_PR_CREATED');
242
- return true;
243
- }
244
- console.log(yellow(`⚠ Epic PR creation failed: ${pr?.error ?? 'unknown error'}`));
245
- console.log(dim(` Create it manually:`));
246
- console.log(dim(` Branch: ${epicBranch} → ${baseBranch}`));
247
- const manualUrl = buildManualPrUrl(remote, epicBranch, baseBranch);
248
- if (manualUrl) {
249
- console.log(dim(` ${manualUrl}`));
250
- }
251
- return false;
252
- }
253
- //# sourceMappingURL=deliver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deliver.js","sourceRoot":"","sources":["../../../../src/scripts/once/deliver/deliver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO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AE,IAAI,EAAE,CAAC,aAAa,EAAE,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,qCAAqC,UAAU,GAAG,CAAC,CAAC,CAAC;QACxE,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAC;QACrE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,GAAG,CACT,MAAM,CAAC,8BAA8B,EAAE,EAAE,KAAK,IAAI,eAAe,EAAE,CAAC,CACrE,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,eAAe,UAAU,MAAM,UAAU,EAAE,CAAC,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IACnE,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,SAAS,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,22 +0,0 @@
1
- import type { BoardConfig } from '../../../scripts/shared/env-schema/env-schema.js';
2
- import type { FetchedTicket } from '../types/types.js';
3
- /** Options for ticket fetching behaviour. */
4
- export type FetchTicketOptions = {
5
- /** If `true`, excludes tickets with the `clancy:hitl` label. */
6
- isAfk?: boolean;
7
- };
8
- /**
9
- * Fetch the next available unblocked ticket from the board.
10
- *
11
- * Fetches up to 5 candidate tickets and returns the first one that is not
12
- * blocked. If all candidates are blocked, returns `undefined`.
13
- *
14
- * In AFK mode (`CLANCY_AFK_MODE=1` or `opts.isAfk`), tickets with the
15
- * `clancy:hitl` label are excluded from the candidate pool.
16
- *
17
- * @param config - The board configuration.
18
- * @param opts - Optional fetch behaviour overrides.
19
- * @returns The first unblocked ticket, or `undefined` if none available.
20
- */
21
- export declare function fetchTicket(config: BoardConfig, opts?: FetchTicketOptions): Promise<FetchedTicket | undefined>;
22
- //# sourceMappingURL=fetch-ticket.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch-ticket.d.ts","sourceRoot":"","sources":["../../../../src/scripts/once/fetch-ticket/fetch-ticket.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAE7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,6CAA6C;AAC7C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAuIF;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,WAAW,EACnB,IAAI,CAAC,EAAE,kBAAkB,GACxB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAYpC"}
@@ -1,123 +0,0 @@
1
- import { fetchBlockerStatus as fetchGitHubBlockerStatus, fetchIssues as fetchGitHubIssues, resolveUsername, } from '../../../scripts/board/github/github.js';
2
- import { buildAuthHeader, fetchBlockerStatus as fetchJiraBlockerStatus, fetchTickets as fetchJiraTickets, } from '../../../scripts/board/jira/jira.js';
3
- import { fetchBlockerStatus as fetchLinearBlockerStatus, fetchIssues as fetchLinearIssues, } from '../../../scripts/board/linear/linear.js';
4
- /** Whether the current run is in AFK mode (set by the AFK runner). */
5
- function detectAfkMode(opts) {
6
- return opts?.isAfk ?? process.env.CLANCY_AFK_MODE === '1';
7
- }
8
- // ─── Board-specific candidate fetch ──────────────────────────────────────────
9
- /**
10
- * Fetch candidate tickets from the board.
11
- *
12
- * @param config - The board configuration.
13
- * @param excludeHitl - Whether to exclude `clancy:hitl` labelled tickets.
14
- * @returns Array of normalised candidate tickets.
15
- */
16
- async function fetchCandidates(config, excludeHitl) {
17
- switch (config.provider) {
18
- case 'jira': {
19
- const { env } = config;
20
- const auth = buildAuthHeader(env.JIRA_USER, env.JIRA_API_TOKEN);
21
- const tickets = await fetchJiraTickets(env.JIRA_BASE_URL, auth, env.JIRA_PROJECT_KEY, env.CLANCY_JQL_STATUS ?? 'To Do', env.CLANCY_JQL_SPRINT, env.CLANCY_LABEL, excludeHitl);
22
- return tickets.map((ticket) => {
23
- const blockerStr = ticket.blockers.length
24
- ? `Blocked by: ${ticket.blockers.join(', ')}`
25
- : 'None';
26
- return {
27
- key: ticket.key,
28
- title: ticket.title,
29
- description: ticket.description,
30
- parentInfo: ticket.epicKey ?? 'none',
31
- blockers: blockerStr,
32
- };
33
- });
34
- }
35
- case 'github': {
36
- const { env } = config;
37
- const username = await resolveUsername(env.GITHUB_TOKEN);
38
- const tickets = await fetchGitHubIssues(env.GITHUB_TOKEN, env.GITHUB_REPO, env.CLANCY_LABEL, username, excludeHitl);
39
- return tickets.map((ticket) => ({
40
- key: ticket.key,
41
- title: ticket.title,
42
- description: ticket.description,
43
- parentInfo: ticket.milestone ?? 'none',
44
- blockers: 'None',
45
- }));
46
- }
47
- case 'linear': {
48
- const { env } = config;
49
- const tickets = await fetchLinearIssues({
50
- LINEAR_API_KEY: env.LINEAR_API_KEY,
51
- LINEAR_TEAM_ID: env.LINEAR_TEAM_ID,
52
- CLANCY_LABEL: env.CLANCY_LABEL,
53
- }, excludeHitl);
54
- return tickets.map((ticket) => ({
55
- key: ticket.key,
56
- title: ticket.title,
57
- description: ticket.description,
58
- parentInfo: ticket.parentIdentifier ?? 'none',
59
- blockers: 'None',
60
- linearIssueId: ticket.issueId,
61
- issueId: ticket.issueId,
62
- }));
63
- }
64
- }
65
- }
66
- // ─── Blocker check ───────────────────────────────────────────────────────────
67
- /**
68
- * Check whether a ticket is blocked on the board.
69
- *
70
- * @param config - The board configuration.
71
- * @param ticket - The candidate ticket.
72
- * @returns `true` if the ticket is blocked.
73
- */
74
- async function isBlocked(config, ticket) {
75
- switch (config.provider) {
76
- case 'jira': {
77
- const { env } = config;
78
- const auth = buildAuthHeader(env.JIRA_USER, env.JIRA_API_TOKEN);
79
- return fetchJiraBlockerStatus(env.JIRA_BASE_URL, auth, ticket.key);
80
- }
81
- case 'github': {
82
- const { env } = config;
83
- const issueNumber = parseInt(ticket.key.replace('#', ''), 10);
84
- if (Number.isNaN(issueNumber))
85
- return false;
86
- return fetchGitHubBlockerStatus(env.GITHUB_TOKEN, env.GITHUB_REPO, issueNumber, ticket.description);
87
- }
88
- case 'linear': {
89
- const { env } = config;
90
- if (!ticket.issueId)
91
- return false;
92
- return fetchLinearBlockerStatus(env.LINEAR_API_KEY, ticket.issueId);
93
- }
94
- }
95
- }
96
- // ─── Board-specific fetch (blocker-aware) ────────────────────────────────────
97
- /**
98
- * Fetch the next available unblocked ticket from the board.
99
- *
100
- * Fetches up to 5 candidate tickets and returns the first one that is not
101
- * blocked. If all candidates are blocked, returns `undefined`.
102
- *
103
- * In AFK mode (`CLANCY_AFK_MODE=1` or `opts.isAfk`), tickets with the
104
- * `clancy:hitl` label are excluded from the candidate pool.
105
- *
106
- * @param config - The board configuration.
107
- * @param opts - Optional fetch behaviour overrides.
108
- * @returns The first unblocked ticket, or `undefined` if none available.
109
- */
110
- export async function fetchTicket(config, opts) {
111
- const excludeHitl = detectAfkMode(opts);
112
- const candidates = await fetchCandidates(config, excludeHitl);
113
- if (!candidates.length)
114
- return undefined;
115
- for (const candidate of candidates) {
116
- const blocked = await isBlocked(config, candidate);
117
- if (!blocked)
118
- return candidate;
119
- console.log(`Skipping ${candidate.key} — blocked`);
120
- }
121
- return undefined;
122
- }
123
- //# sourceMappingURL=fetch-ticket.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch-ticket.js","sourceRoot":"","sources":["../../../../src/scripts/once/fetch-ticket/fetch-ticket.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,IAAI,wBAAwB,EAC9C,WAAW,IAAI,iBAAiB,EAChC,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAC1C,OA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;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAmB,EACnB,IAAyB;IAEzB,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC9D,IAAI,CAAC,UAAU,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAEzC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QACnD,IAAI,CAAC,OAAO;YAAE,OAAO,SAAS,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,YAAY,SAAS,CAAC,GAAG,YAAY,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,13 +0,0 @@
1
- import type { BoardConfig } from '../../../scripts/shared/env-schema/env-schema.js';
2
- import type { RemoteInfo } from '../../../types/index.js';
3
- /**
4
- * Resolve a git host token from the board config's env.
5
- *
6
- * For GitHub boards, `GITHUB_TOKEN` is always present.
7
- * For Jira/Linear boards, check the shared optional vars.
8
- */
9
- export declare function resolveGitToken(config: BoardConfig, remote: RemoteInfo): {
10
- token: string;
11
- username?: string;
12
- } | undefined;
13
- //# sourceMappingURL=git-token.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-token.d.ts","sourceRoot":"","sources":["../../../../src/scripts/once/git-token/git-token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAInD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,UAAU,GACjB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAmBlD"}
@@ -1,30 +0,0 @@
1
- import { sharedEnv } from '../board-ops/board-ops.js';
2
- /**
3
- * Resolve a git host token from the board config's env.
4
- *
5
- * For GitHub boards, `GITHUB_TOKEN` is always present.
6
- * For Jira/Linear boards, check the shared optional vars.
7
- */
8
- export function resolveGitToken(config, remote) {
9
- const env = sharedEnv(config);
10
- switch (remote.host) {
11
- case 'github':
12
- if (env.GITHUB_TOKEN)
13
- return { token: env.GITHUB_TOKEN };
14
- break;
15
- case 'gitlab':
16
- if (env.GITLAB_TOKEN)
17
- return { token: env.GITLAB_TOKEN };
18
- break;
19
- case 'bitbucket':
20
- if (env.BITBUCKET_USER && env.BITBUCKET_TOKEN)
21
- return { token: env.BITBUCKET_TOKEN, username: env.BITBUCKET_USER };
22
- break;
23
- case 'bitbucket-server':
24
- if (env.BITBUCKET_TOKEN)
25
- return { token: env.BITBUCKET_TOKEN };
26
- break;
27
- }
28
- return undefined;
29
- }
30
- //# sourceMappingURL=git-token.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-token.js","sourceRoot":"","sources":["../../../../src/scripts/once/git-token/git-token.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAmB,EACnB,MAAkB;IAElB,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAE9B,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,QAAQ;YACX,IAAI,GAAG,CAAC,YAAY;gBAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,YAAY,EAAE,CAAC;YACzD,MAAM;QACR,KAAK,QAAQ;YACX,IAAI,GAAG,CAAC,YAAY;gBAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,YAAY,EAAE,CAAC;YACzD,MAAM;QACR,KAAK,WAAW;YACd,IAAI,GAAG,CAAC,cAAc,IAAI,GAAG,CAAC,eAAe;gBAC3C,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,eAAe,EAAE,QAAQ,EAAE,GAAG,CAAC,cAAc,EAAE,CAAC;YACtE,MAAM;QACR,KAAK,kBAAkB;YACrB,IAAI,GAAG,CAAC,eAAe;gBAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,eAAe,EAAE,CAAC;YAC/D,MAAM;IACV,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,17 +0,0 @@
1
- export type LockData = {
2
- pid: number;
3
- ticketKey: string;
4
- ticketTitle: string;
5
- ticketBranch: string;
6
- targetBranch: string;
7
- parentKey: string;
8
- description?: string;
9
- startedAt: string;
10
- };
11
- export declare function writeLock(projectRoot: string, data: LockData): void;
12
- export declare function readLock(projectRoot: string): LockData | undefined;
13
- export declare function deleteLock(projectRoot: string): void;
14
- export declare function deleteVerifyAttempt(projectRoot: string): void;
15
- export declare function isPidAlive(pid: number): boolean;
16
- export declare function isLockStale(lock: LockData): boolean;
17
- //# sourceMappingURL=lock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../../src/scripts/once/lock/lock.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,QAAQ,GAAG;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAInE;AAED,wBAAgB,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAQlE;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAOpD;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAO7D;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAU/C;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAenD"}
@@ -1,70 +0,0 @@
1
- /**
2
- * Lock file management for `.clancy/lock.json`.
3
- *
4
- * Prevents double-runs and provides context for hooks
5
- * (PostCompact, time guard, cost tracker).
6
- */
7
- import { mkdirSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs';
8
- import { dirname, join } from 'node:path';
9
- export function writeLock(projectRoot, data) {
10
- const filePath = join(projectRoot, '.clancy', 'lock.json');
11
- mkdirSync(dirname(filePath), { recursive: true });
12
- writeFileSync(filePath, JSON.stringify(data, null, 2), 'utf8');
13
- }
14
- export function readLock(projectRoot) {
15
- const filePath = join(projectRoot, '.clancy', 'lock.json');
16
- try {
17
- const content = readFileSync(filePath, 'utf8');
18
- return JSON.parse(content);
19
- }
20
- catch {
21
- return undefined;
22
- }
23
- }
24
- export function deleteLock(projectRoot) {
25
- const filePath = join(projectRoot, '.clancy', 'lock.json');
26
- try {
27
- unlinkSync(filePath);
28
- }
29
- catch {
30
- // File may not exist — that's fine
31
- }
32
- }
33
- export function deleteVerifyAttempt(projectRoot) {
34
- const filePath = join(projectRoot, '.clancy', 'verify-attempt.txt');
35
- try {
36
- unlinkSync(filePath);
37
- }
38
- catch {
39
- // File may not exist — that's fine
40
- }
41
- }
42
- export function isPidAlive(pid) {
43
- try {
44
- process.kill(pid, 0); // Signal 0 = no-op, just checks if process exists
45
- return true;
46
- }
47
- catch (err) {
48
- // EPERM means the process exists but we lack permission to signal it — still alive
49
- if (err instanceof Error && 'code' in err && err.code === 'EPERM')
50
- return true;
51
- return false;
52
- }
53
- }
54
- export function isLockStale(lock) {
55
- // If PID is dead, lock is stale
56
- if (!isPidAlive(lock.pid))
57
- return true;
58
- // If PID is alive but lock is older than 24 hours, treat as PID reuse.
59
- // Note: PID reuse can happen faster on busy systems, but 24h is a practical
60
- // threshold — Clancy sessions never run that long. A false negative here means
61
- // the user sees "another session is running" and must manually delete lock.json.
62
- const lockAge = Date.now() - new Date(lock.startedAt).getTime();
63
- if (Number.isNaN(lockAge))
64
- return true; // Invalid timestamp — can't trust it
65
- const twentyFourHours = 24 * 60 * 60 * 1000;
66
- if (lockAge > twentyFourHours)
67
- return true;
68
- return false;
69
- }
70
- //# sourceMappingURL=lock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lock.js","sourceRoot":"","sources":["../../../../src/scripts/once/lock/lock.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAa1C,MAAM,UAAU,SAAS,CAAC,WAAmB,EAAE,IAAc;IAC3D,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IAC3D,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,WAAmB;IAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IAC3D,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,OAA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EAAE,CAAC;IAChE,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC,CAAC,qCAAqC;IAE7E,MAAM,eAAe,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC5C,IAAI,OAAO,GAAG,eAAe;QAAE,OAAO,IAAI,CAAC;IAE3C,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Run the once orchestrator — full ticket lifecycle.
3
- *
4
- * @param argv - Process arguments (supports `--dry-run` flag).
5
- *
6
- * @example
7
- * ```ts
8
- * await run(process.argv);
9
- * ```
10
- */
11
- export declare function run(argv: string[]): Promise<void>;
12
- //# sourceMappingURL=once.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"once.d.ts","sourceRoot":"","sources":["../../../src/scripts/once/once.ts"],"names":[],"mappings":"AAqEA;;;;;;;;;GASG;AACH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAkjBvD"}