@floh-solutions/pharos-cli 0.23.0 → 0.25.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.
Files changed (49) hide show
  1. package/README.md +409 -5
  2. package/dist/capabilities.d.ts.map +1 -1
  3. package/dist/capabilities.js +23 -0
  4. package/dist/capabilities.js.map +1 -1
  5. package/dist/cli.d.ts +4 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +362 -36
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/comment-github.d.ts +138 -0
  10. package/dist/commands/comment-github.d.ts.map +1 -0
  11. package/dist/commands/comment-github.js +427 -0
  12. package/dist/commands/comment-github.js.map +1 -0
  13. package/dist/commands/comment.d.ts.map +1 -1
  14. package/dist/commands/comment.js +114 -19
  15. package/dist/commands/comment.js.map +1 -1
  16. package/dist/commands/doctor.d.ts +71 -2
  17. package/dist/commands/doctor.d.ts.map +1 -1
  18. package/dist/commands/doctor.js +414 -8
  19. package/dist/commands/doctor.js.map +1 -1
  20. package/dist/commands/issue.d.ts +75 -0
  21. package/dist/commands/issue.d.ts.map +1 -0
  22. package/dist/commands/issue.js +2466 -0
  23. package/dist/commands/issue.js.map +1 -0
  24. package/dist/commands/setup.d.ts +6 -0
  25. package/dist/commands/setup.d.ts.map +1 -1
  26. package/dist/commands/setup.js +114 -0
  27. package/dist/commands/setup.js.map +1 -1
  28. package/dist/half-link.d.ts +157 -0
  29. package/dist/half-link.d.ts.map +1 -0
  30. package/dist/half-link.js +257 -0
  31. package/dist/half-link.js.map +1 -0
  32. package/dist/issue-scan.d.ts +383 -0
  33. package/dist/issue-scan.d.ts.map +1 -0
  34. package/dist/issue-scan.js +455 -0
  35. package/dist/issue-scan.js.map +1 -0
  36. package/dist/output.d.ts +18 -1
  37. package/dist/output.d.ts.map +1 -1
  38. package/dist/output.js +293 -0
  39. package/dist/output.js.map +1 -1
  40. package/dist/session.d.ts +101 -2
  41. package/dist/session.d.ts.map +1 -1
  42. package/dist/session.js +132 -11
  43. package/dist/session.js.map +1 -1
  44. package/dist/target.d.ts +40 -4
  45. package/dist/target.d.ts.map +1 -1
  46. package/dist/target.js +14 -3
  47. package/dist/target.js.map +1 -1
  48. package/package.json +3 -2
  49. package/skill/SKILL.md +422 -11
@@ -0,0 +1,138 @@
1
+ import { type GitHubHideReason, type IssueCoordinate } from "@floh-solutions/gh-core";
2
+ import { type CliError, type ExitCode, type Io } from "../output.js";
3
+ import { type Session } from "../session.js";
4
+ import { type AdoTarget } from "../target.js";
5
+ /**
6
+ * `pharos comment …` on a GitHub issue — the half `gh-core` grew for #827.
7
+ *
8
+ * A sibling of the two Azure DevOps arms in `comment.ts`, not a second command:
9
+ * the verbs, the target grammar and the output shape are that file's, and this
10
+ * is the branch that knows what they mean on GitHub. Read its header first.
11
+ *
12
+ * ## What each verb costs, because an agent should be able to predict it
13
+ *
14
+ * | verb | requests | door |
15
+ * |---|---|---|
16
+ * | `list` | 1 per 100 comments | GraphQL |
17
+ * | `edit` | 2 — the read the marker guard needs, then the PATCH | REST |
18
+ * | `delete` | 2 — read to name the consequence, then the DELETE | REST |
19
+ * | `react` | 1 | REST |
20
+ * | `unreact` | 2 — `DELETE` names the reaction ROW id, so it lists first | REST |
21
+ * | `reactors` | 1 | REST |
22
+ * | `hide` / `unhide` / `pin` / `unpin` | 1, or 2 given a numeric id | GraphQL |
23
+ *
24
+ * The second request on `hide` and friends is the node-id lookup, and it
25
+ * disappears when the node id from `list` is passed back — see `handle()` in
26
+ * `comment.ts`.
27
+ *
28
+ * ## The account is never guessed
29
+ *
30
+ * Every call resolves its binding from `repos.json` through
31
+ * `GitHubClient.binding`, which throws naming the file when a repo is unbound.
32
+ * Plan §2: with more than one `gh` account signed in, letting anything else
33
+ * choose returns a perfectly good 200 from the wrong repository.
34
+ */
35
+ /** A comment named by either of its two ids. See `handle()` in `comment.ts`. */
36
+ export type GitHubCommentHandle = {
37
+ kind: "rest";
38
+ id: number;
39
+ } | {
40
+ kind: "node";
41
+ nodeId: string;
42
+ };
43
+ /**
44
+ * Every comment on an issue, with the state and the permissions REST cannot
45
+ * report.
46
+ *
47
+ * **This verb is why the rest of them are usable at all.** Before it, nothing
48
+ * in this CLI could tell an agent a GitHub comment id: `pharos issue say`
49
+ * returns the id of the comment it just posted and that was the entire surface.
50
+ * The app never needed a list because it has a window. An agent has this.
51
+ *
52
+ * The `viewerCan…` flags are the part worth having. For a window they grey out
53
+ * a menu item; for an agent they turn a write that would 403 into a fact known
54
+ * before the write, which is the difference between a failed run and a run that
55
+ * reports what it may do.
56
+ */
57
+ export declare function githubList(io: Io, session: Session, issue: IssueCoordinate): Promise<ExitCode>;
58
+ /**
59
+ * There is no `pharos comment add` on a GitHub issue, and there should not be.
60
+ *
61
+ * Plan §8 — do not rebuild `gh`. Two verbs already cover posting, and they
62
+ * cover different jobs: `gh issue comment` writes to GitHub, and
63
+ * `pharos issue say` writes the same message to GitHub *and* a summary to the
64
+ * work item, which is the whole reason the edge exists. A third door here would
65
+ * post to an adopted issue without the board ever hearing, which is exactly the
66
+ * asymmetry `say` was built to prevent — and it would do it under a verb whose
67
+ * Azure DevOps spelling *does* reach the board.
68
+ *
69
+ * Refused rather than silently absent: an agent that tries this has a real
70
+ * intention, and the useful answer names which of the two it wanted.
71
+ */
72
+ export declare function githubRefuseAdd(issue: IssueCoordinate): never;
73
+ /**
74
+ * Edit a comment, behind `gh-core`'s marker guard.
75
+ *
76
+ * The guard is in the package rather than here on purpose — it is a rule about
77
+ * the link record, not about this command, and the macOS app writes through the
78
+ * same rule when it edits. What this arm adds is the reporting: a restored
79
+ * trailer is stated in the output rather than happening quietly.
80
+ */
81
+ export declare function githubEdit(io: Io, session: Session, issue: IssueCoordinate, handle: GitHubCommentHandle, text: string): Promise<ExitCode>;
82
+ /**
83
+ * Delete a comment — and name what that costs before doing it.
84
+ *
85
+ * `approve()` already gates every destructive verb behind `--yes`. What is
86
+ * added here is that the preview knows whether this particular comment is the
87
+ * one carrying the `pharos:v1` trailer, because deleting **that** comment
88
+ * destroys the GitHub half of the link: `linksFromComments` reads it, so after
89
+ * this the pair is one-sided and `pharos issue drift` reports it — correctly,
90
+ * and after the fact.
91
+ *
92
+ * So the comment is read *before* the gate, including under `--dry-run`. A
93
+ * preview that could not say which of the two deletes this is would be a
94
+ * preview of the wrong thing.
95
+ *
96
+ * It is not refused outright. `--yes` is the caller's decision and there are
97
+ * good reasons to remove a link comment — a mis-adoption, a wrong repository.
98
+ * The repair is named instead.
99
+ */
100
+ export declare function githubRemove(io: Io, session: Session, issue: IssueCoordinate, handle: GitHubCommentHandle): Promise<ExitCode>;
101
+ export declare function githubReact(io: Io, session: Session, issue: IssueCoordinate, handle: GitHubCommentHandle, rawReaction: string | undefined, engaged: boolean): Promise<ExitCode>;
102
+ /** A count is not a name — "three people reacted" needs this second call. */
103
+ export declare function githubReactors(io: Io, session: Session, issue: IssueCoordinate, handle: GitHubCommentHandle, rawReaction: string | undefined): Promise<ExitCode>;
104
+ /**
105
+ * Hide or unhide, over GraphQL. There is no REST route — `POST …/minimize`
106
+ * answers 404.
107
+ *
108
+ * The reason is read back and reported as GitHub spells it, which is **not**
109
+ * how it was sent: `OFF_TOPIC` goes out and `off-topic` comes back. The CLI
110
+ * takes the display spelling for exactly that reason — ask for `off-topic`,
111
+ * read `off-topic`, and nothing has to know about the asymmetry.
112
+ */
113
+ export declare function githubHide(io: Io, session: Session, issue: IssueCoordinate, handle: GitHubCommentHandle, reason: GitHubHideReason | undefined): Promise<ExitCode>;
114
+ /**
115
+ * Pin or unpin, over GraphQL. No REST route exists at all.
116
+ *
117
+ * The input field is `issueCommentId`, not `subjectId` as minimize takes —
118
+ * handled in `gh-core`, noted here because the two mutations sit beside each
119
+ * other in GitHub's schema and the wrong one is an HTTP 200 that does nothing.
120
+ */
121
+ export declare function githubPin(io: Io, session: Session, issue: IssueCoordinate, handle: GitHubCommentHandle, pinned: boolean): Promise<ExitCode>;
122
+ /**
123
+ * Azure DevOps has no hide and no pin — not "not implemented here", **no such
124
+ * concept in the API**.
125
+ *
126
+ * Said plainly rather than reported as an unknown verb, because those are
127
+ * different facts: an unknown verb reads as a gap this CLI could close, and
128
+ * somebody would then go looking for the endpoint.
129
+ *
130
+ * **Returns the error rather than throwing it**, so the call site reads
131
+ * `if (target.kind !== "githubIssue") throw noSuchThingOnAzureDevOps(…)` and the
132
+ * compiler narrows the target on the next line. A function that threw would
133
+ * leave every GitHub-only arm needing a second refusal for a case that cannot
134
+ * happen — which is how an impossible branch acquires code nobody tests.
135
+ */
136
+ export declare function noSuchThingOnAzureDevOps(target: AdoTarget, verb: string): CliError;
137
+ export declare function hideReasonArgument(raw: string | undefined): GitHubHideReason;
138
+ //# sourceMappingURL=comment-github.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-github.d.ts","sourceRoot":"","sources":["../../src/commands/comment-github.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EAErB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAA6B,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,EAAE,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,gFAAgF;AAChF,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAIrC;;;;;;;;;;;;;GAaG;AACH,wBAAsB,UAAU,CAC9B,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,QAAQ,CAA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AE,eAAe,EACtB,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,QAAQ,CAAC,CAYnB;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAOlF;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,CAe5E"}
@@ -0,0 +1,427 @@
1
+ import { GITHUB_HIDE_REASONS, GITHUB_REACTIONS, GitHubNotFoundError, MarkerGuardError, findMarker, formatIssueCoordinate, isPharosAuthored, parseHideReason, parseReaction, } from "@floh-solutions/gh-core";
2
+ import { emit, refusal, usageError } from "../output.js";
3
+ import { approve } from "../session.js";
4
+ import { describeTarget } from "../target.js";
5
+ // MARK: - list
6
+ /**
7
+ * Every comment on an issue, with the state and the permissions REST cannot
8
+ * report.
9
+ *
10
+ * **This verb is why the rest of them are usable at all.** Before it, nothing
11
+ * in this CLI could tell an agent a GitHub comment id: `pharos issue say`
12
+ * returns the id of the comment it just posted and that was the entire surface.
13
+ * The app never needed a list because it has a window. An agent has this.
14
+ *
15
+ * The `viewerCan…` flags are the part worth having. For a window they grey out
16
+ * a menu item; for an agent they turn a write that would 403 into a fact known
17
+ * before the write, which is the difference between a failed run and a run that
18
+ * reports what it may do.
19
+ */
20
+ export async function githubList(io, session, issue) {
21
+ const { github, ref } = await resolve(session, issue);
22
+ const sweep = await github.comments.details(ref);
23
+ if (sweep.issueMissing) {
24
+ // GraphQL answers a null `repository` with NO errors entry for an issue
25
+ // that was deleted, transferred or is not visible to this account. Without
26
+ // this the caller cannot tell that from a discussion with no comments.
27
+ throw refusal(`${formatIssueCoordinate(issue)} could not be read as ${ref.account}. GitHub answered with `
28
+ + "no issue rather than an error, which is what it does for an issue that was deleted or "
29
+ + "transferred — or that this account cannot see.", { issue, account: ref.account });
30
+ }
31
+ return emit(io, {
32
+ target: formatIssueCoordinate(issue),
33
+ account: ref.account,
34
+ truncated: sweep.truncated,
35
+ comments: sweep.comments.map((comment) => ({
36
+ id: comment.id,
37
+ // Printed beside the number precisely so `hide` and `pin` need no lookup.
38
+ nodeId: comment.nodeId,
39
+ author: comment.author ?? null,
40
+ body: comment.body,
41
+ createdAt: comment.createdAt,
42
+ // Not `createdAt !== updatedAt`: a reaction moves updatedAt, so that
43
+ // comparison labels a comment edited because somebody gave it a 👍.
44
+ lastEditedAt: comment.lastEditedAt ?? null,
45
+ url: comment.htmlUrl ?? null,
46
+ hidden: comment.isMinimized,
47
+ hiddenReason: comment.minimizedReason ?? null,
48
+ pinned: comment.isPinned,
49
+ /** True when this comment carries the link record. */
50
+ pharosAuthored: isPharosAuthored(comment.body),
51
+ workItemId: findMarker(comment.body)?.adoId ?? null,
52
+ reactions: comment.reactions.map((group) => ({
53
+ type: group.reaction.cli,
54
+ emoji: group.reaction.emoji,
55
+ count: group.count,
56
+ mine: group.viewerHasReacted,
57
+ })),
58
+ may: {
59
+ edit: comment.viewerCanUpdate,
60
+ delete: comment.viewerCanDelete,
61
+ hide: comment.viewerCanMinimize,
62
+ unhide: comment.viewerCanUnminimize,
63
+ pin: comment.viewerCanPin,
64
+ unpin: comment.viewerCanUnpin,
65
+ react: comment.viewerCanReact,
66
+ },
67
+ })),
68
+ });
69
+ }
70
+ // MARK: - add, which is refused
71
+ /**
72
+ * There is no `pharos comment add` on a GitHub issue, and there should not be.
73
+ *
74
+ * Plan §8 — do not rebuild `gh`. Two verbs already cover posting, and they
75
+ * cover different jobs: `gh issue comment` writes to GitHub, and
76
+ * `pharos issue say` writes the same message to GitHub *and* a summary to the
77
+ * work item, which is the whole reason the edge exists. A third door here would
78
+ * post to an adopted issue without the board ever hearing, which is exactly the
79
+ * asymmetry `say` was built to prevent — and it would do it under a verb whose
80
+ * Azure DevOps spelling *does* reach the board.
81
+ *
82
+ * Refused rather than silently absent: an agent that tries this has a real
83
+ * intention, and the useful answer names which of the two it wanted.
84
+ */
85
+ export function githubRefuseAdd(issue) {
86
+ const coordinate = formatIssueCoordinate(issue);
87
+ throw usageError(`\`pharos comment add\` does not post to a GitHub issue. Two verbs already do, and which you `
88
+ + `want depends on whether the board should hear about it:\n`
89
+ + ` pharos issue say ${coordinate} "…" the reporter AND the linked work item\n`
90
+ + ` gh issue comment ${issue.number} -R ${issue.repo} … GitHub only\n`
91
+ + "This CLI owns the edge, not the nodes — and a comment posted here that the work item "
92
+ + "never heard about is the asymmetry `say` exists to prevent.", { issue, use: ["pharos issue say", "gh issue comment"] });
93
+ }
94
+ // MARK: - edit
95
+ /**
96
+ * Edit a comment, behind `gh-core`'s marker guard.
97
+ *
98
+ * The guard is in the package rather than here on purpose — it is a rule about
99
+ * the link record, not about this command, and the macOS app writes through the
100
+ * same rule when it edits. What this arm adds is the reporting: a restored
101
+ * trailer is stated in the output rather than happening quietly.
102
+ */
103
+ export async function githubEdit(io, session, issue, handle, text) {
104
+ const { github, ref } = await resolve(session, issue);
105
+ const id = await restId(session, ref, handle);
106
+ try {
107
+ const result = await github.comments.edit(ref, id, text);
108
+ return emit(io, {
109
+ applied: true,
110
+ target: formatIssueCoordinate(issue),
111
+ commentId: result.comment.id,
112
+ url: result.comment.htmlUrl ?? null,
113
+ /**
114
+ * The caller stripped the `pharos:v1` trailer and it was put back. Said
115
+ * out loud because the alternative — restoring it in silence — makes a
116
+ * body that differs from what was handed over, and an agent comparing
117
+ * what it sent with what is there would find a difference it cannot
118
+ * explain.
119
+ */
120
+ markerPreserved: result.markerPreserved,
121
+ workItemId: result.marker === undefined ? null : (findMarker(result.marker)?.adoId ?? null),
122
+ });
123
+ }
124
+ catch (error) {
125
+ if (error instanceof MarkerGuardError) {
126
+ // Reported as a refusal (exit 3), not a failure: nothing went wrong, the
127
+ // edit was declined for a reason the caller can act on.
128
+ throw refusal(error.message, {
129
+ issue,
130
+ commentId: id,
131
+ reason: error.reason,
132
+ trailers: error.detail,
133
+ });
134
+ }
135
+ throw error;
136
+ }
137
+ }
138
+ // MARK: - delete
139
+ /**
140
+ * Delete a comment — and name what that costs before doing it.
141
+ *
142
+ * `approve()` already gates every destructive verb behind `--yes`. What is
143
+ * added here is that the preview knows whether this particular comment is the
144
+ * one carrying the `pharos:v1` trailer, because deleting **that** comment
145
+ * destroys the GitHub half of the link: `linksFromComments` reads it, so after
146
+ * this the pair is one-sided and `pharos issue drift` reports it — correctly,
147
+ * and after the fact.
148
+ *
149
+ * So the comment is read *before* the gate, including under `--dry-run`. A
150
+ * preview that could not say which of the two deletes this is would be a
151
+ * preview of the wrong thing.
152
+ *
153
+ * It is not refused outright. `--yes` is the caller's decision and there are
154
+ * good reasons to remove a link comment — a mis-adoption, a wrong repository.
155
+ * The repair is named instead.
156
+ */
157
+ export async function githubRemove(io, session, issue, handle) {
158
+ const { github, ref } = await resolve(session, issue);
159
+ const id = await restId(session, ref, handle);
160
+ let existing;
161
+ try {
162
+ existing = await github.comments.get(ref, id);
163
+ }
164
+ catch (error) {
165
+ if (!(error instanceof GitHubNotFoundError))
166
+ throw error;
167
+ /**
168
+ * **Already gone, and that is success.**
169
+ *
170
+ * This read exists so the preview can say whether the comment carries the
171
+ * link — but adding it would otherwise have broken the one property
172
+ * `CommentsApi.remove` is careful to provide: a delete whose reply was lost
173
+ * and is retried gets a 404, and that 404 means the caller got what it
174
+ * asked for. Without this arm the retry failed on the *read* before ever
175
+ * reaching the idempotent DELETE, which is the exact "sends somebody
176
+ * looking for a comment that is already gone" failure the rule is about.
177
+ * Found by running it against real GitHub rather than by a test (#827).
178
+ *
179
+ * The `--yes` gate is skipped deliberately: there is nothing left to
180
+ * destroy, and demanding confirmation for a no-op is how a safe retry
181
+ * becomes a manual step.
182
+ */
183
+ return emit(io, {
184
+ applied: true,
185
+ action: "deleted",
186
+ target: formatIssueCoordinate(issue),
187
+ commentId: id,
188
+ alreadyGone: true,
189
+ // Not knowable now — the comment is gone and so is its body.
190
+ carriesLinkMarker: null,
191
+ workItemId: null,
192
+ // The ambiguity stated rather than hidden: this is the same status code
193
+ // GitHub gives for a comment that exists and is not visible to this
194
+ // account, so "already gone" is the likely reading and not the only one.
195
+ note: `Nothing to delete: comment ${String(id)} is not there. On GitHub a 404 is also how `
196
+ + `"not visible to this account" is spelled, so if you did not expect this, check that `
197
+ + `${ref.account} is the right account for ${issue.repo} in repos.json.`,
198
+ });
199
+ }
200
+ const marker = findMarker(existing.body);
201
+ const carriesLink = isPharosAuthored(existing.body);
202
+ const stop = approve(io, session, {
203
+ what: carriesLink
204
+ ? `delete comment ${id} on ${formatIssueCoordinate(issue)} — THE COMMENT CARRYING THE LINK`
205
+ : `delete comment ${id} on ${formatIssueCoordinate(issue)}`,
206
+ would: {
207
+ action: "deleteComment",
208
+ target: formatIssueCoordinate(issue),
209
+ commentId: id,
210
+ author: existing.author ?? null,
211
+ /**
212
+ * The consequence, structured, so a caller reading JSON sees it too.
213
+ * "A caveat in a reply is a gap somebody closes the todo over."
214
+ */
215
+ carriesLinkMarker: carriesLink,
216
+ workItemId: marker?.adoId ?? null,
217
+ ...(carriesLink
218
+ ? {
219
+ consequence: "This is the comment that records the link to Azure DevOps. Deleting it leaves the "
220
+ + "pair one-sided: `pharos issue trail` will stop resolving it from the GitHub end "
221
+ + "and `pharos issue drift` will report it.",
222
+ repair: marker === undefined
223
+ ? `pharos issue link ${formatIssueCoordinate(issue)} <work-item-id> --yes`
224
+ : `pharos issue link ${formatIssueCoordinate(issue)} ${marker.adoId} --yes`,
225
+ }
226
+ : {}),
227
+ },
228
+ // The one destructive verb in this CLI that writes to GitHub and to nothing
229
+ // else, so the gate must not resolve an Azure DevOps credential on its way
230
+ // past. Everything above this line already ran without one (#839).
231
+ platform: "github",
232
+ });
233
+ if (stop !== undefined)
234
+ return stop;
235
+ const { existed } = await github.comments.remove(ref, id);
236
+ return emit(io, {
237
+ applied: true,
238
+ action: "deleted",
239
+ target: formatIssueCoordinate(issue),
240
+ commentId: id,
241
+ // A 404 on delete is success — a retry after a lost reply gets one, and it
242
+ // means the caller got what it asked for. Reported, never failed over.
243
+ alreadyGone: !existed,
244
+ carriesLinkMarker: carriesLink,
245
+ workItemId: marker?.adoId ?? null,
246
+ });
247
+ }
248
+ // MARK: - reactions
249
+ export async function githubReact(io, session, issue, handle, rawReaction, engaged) {
250
+ const reaction = reactionArgument(rawReaction);
251
+ const { github, ref } = await resolve(session, issue);
252
+ const id = await restId(session, ref, handle);
253
+ const { changed } = await github.comments.setReaction(ref, id, reaction, engaged);
254
+ return emit(io, {
255
+ applied: true,
256
+ target: formatIssueCoordinate(issue),
257
+ commentId: id,
258
+ type: reaction.cli,
259
+ emoji: reaction.emoji,
260
+ engaged,
261
+ /**
262
+ * False when the end state was already true — un-reacting something you
263
+ * never reacted to. A desired end state rather than a toggle is what makes
264
+ * the verb safe to repeat, and this is how a repeat reports itself.
265
+ */
266
+ changed,
267
+ });
268
+ }
269
+ /** A count is not a name — "three people reacted" needs this second call. */
270
+ export async function githubReactors(io, session, issue, handle, rawReaction) {
271
+ const reaction = reactionArgument(rawReaction);
272
+ const { github, ref } = await resolve(session, issue);
273
+ const id = await restId(session, ref, handle);
274
+ const { owner, name } = splitRepo(ref.repo);
275
+ const rows = await github.http.request({
276
+ account: ref.account,
277
+ method: "GET",
278
+ path: `repos/${owner}/${name}/issues/comments/${id}/reactions`,
279
+ query: { content: reaction.rest, per_page: 100 },
280
+ idempotent: true,
281
+ });
282
+ const logins = (Array.isArray(rows) ? rows : [])
283
+ .map((row) => row.user?.login)
284
+ .filter((login) => typeof login === "string");
285
+ return emit(io, {
286
+ target: formatIssueCoordinate(issue),
287
+ commentId: id,
288
+ type: reaction.cli,
289
+ emoji: reaction.emoji,
290
+ count: logins.length,
291
+ logins,
292
+ });
293
+ }
294
+ // MARK: - hide and pin
295
+ /**
296
+ * Hide or unhide, over GraphQL. There is no REST route — `POST …/minimize`
297
+ * answers 404.
298
+ *
299
+ * The reason is read back and reported as GitHub spells it, which is **not**
300
+ * how it was sent: `OFF_TOPIC` goes out and `off-topic` comes back. The CLI
301
+ * takes the display spelling for exactly that reason — ask for `off-topic`,
302
+ * read `off-topic`, and nothing has to know about the asymmetry.
303
+ */
304
+ export async function githubHide(io, session, issue, handle, reason) {
305
+ const { github, ref } = await resolve(session, issue);
306
+ const nodeId = await nodeIdOf(session, ref, handle);
307
+ const state = await github.comments.setHidden(ref, nodeId, reason);
308
+ return emit(io, {
309
+ applied: true,
310
+ target: formatIssueCoordinate(issue),
311
+ nodeId,
312
+ hidden: state.isMinimized,
313
+ // GitHub's own words, from the mutation's own payload — not an echo of what
314
+ // was asked for. If those two ever disagree, this is the one that is true.
315
+ hiddenReason: state.minimizedReason ?? null,
316
+ ...(reason === undefined ? {} : { requested: reason.display, sent: reason.wire }),
317
+ });
318
+ }
319
+ /**
320
+ * Pin or unpin, over GraphQL. No REST route exists at all.
321
+ *
322
+ * The input field is `issueCommentId`, not `subjectId` as minimize takes —
323
+ * handled in `gh-core`, noted here because the two mutations sit beside each
324
+ * other in GitHub's schema and the wrong one is an HTTP 200 that does nothing.
325
+ */
326
+ export async function githubPin(io, session, issue, handle, pinned) {
327
+ const { github, ref } = await resolve(session, issue);
328
+ const nodeId = await nodeIdOf(session, ref, handle);
329
+ const now = await github.comments.setPinned(ref, nodeId, pinned);
330
+ return emit(io, {
331
+ applied: true,
332
+ target: formatIssueCoordinate(issue),
333
+ nodeId,
334
+ pinned: now,
335
+ });
336
+ }
337
+ // MARK: - arguments
338
+ /**
339
+ * Azure DevOps has no hide and no pin — not "not implemented here", **no such
340
+ * concept in the API**.
341
+ *
342
+ * Said plainly rather than reported as an unknown verb, because those are
343
+ * different facts: an unknown verb reads as a gap this CLI could close, and
344
+ * somebody would then go looking for the endpoint.
345
+ *
346
+ * **Returns the error rather than throwing it**, so the call site reads
347
+ * `if (target.kind !== "githubIssue") throw noSuchThingOnAzureDevOps(…)` and the
348
+ * compiler narrows the target on the next line. A function that threw would
349
+ * leave every GitHub-only arm needing a second refusal for a case that cannot
350
+ * happen — which is how an impossible branch acquires code nobody tests.
351
+ */
352
+ export function noSuchThingOnAzureDevOps(target, verb) {
353
+ return usageError(`\`comment ${verb}\` is a GitHub thing, and ${describeTarget(target)} is on Azure DevOps, `
354
+ + "which has neither hidden nor pinned comments — there is no field to set and no endpoint "
355
+ + "to call. Name a GitHub issue (contoso/widgets#45).", { verb, target: describeTarget(target) });
356
+ }
357
+ export function hideReasonArgument(raw) {
358
+ const reasons = GITHUB_HIDE_REASONS.map((reason) => reason.display);
359
+ if (raw === undefined) {
360
+ throw usageError(`Hide it as what? \`pharos comment hide <owner/name#n> <comment> <reason>\` — one of: `
361
+ + `${reasons.join(", ")}. GitHub requires a classifier and shows it beside the hidden `
362
+ + "comment, so there is no neutral default to pick.", { reasons });
363
+ }
364
+ const reason = parseHideReason(raw);
365
+ if (reason === undefined) {
366
+ throw usageError(`"${raw}" is not a hide reason. One of: ${reasons.join(", ")}.`, { reasons });
367
+ }
368
+ return reason;
369
+ }
370
+ function reactionArgument(raw) {
371
+ const names = GITHUB_REACTIONS.map((reaction) => reaction.cli);
372
+ if (raw === undefined) {
373
+ throw usageError(`Which reaction? One of: ${names.join(", ")}.`, { reactions: names });
374
+ }
375
+ const reaction = parseReaction(raw);
376
+ if (reaction === undefined) {
377
+ throw usageError(`"${raw}" is not a GitHub reaction. One of: ${names.join(", ")}. Azure DevOps's names `
378
+ + "(like, dislike, smile) are a different vocabulary and are not accepted here.", { reactions: names });
379
+ }
380
+ return reaction;
381
+ }
382
+ // MARK: - resolving
383
+ async function resolve(session, issue) {
384
+ const github = await session.github();
385
+ // Throws a GitHubConfigError naming the repo and repos.json when unbound —
386
+ // reported as kind "config", exit 2, because no retry can fix it.
387
+ const binding = github.binding(issue.repo);
388
+ return { github, ref: { ...binding, number: issue.number } };
389
+ }
390
+ /** The REST id, looked up from the node id only when that is what was given. */
391
+ async function restId(session, ref, handle) {
392
+ if (handle.kind === "rest")
393
+ return handle.id;
394
+ // The node id addresses nothing over REST, and there is no single-node REST
395
+ // route to resolve it — so this is the discussion read, and it is the one
396
+ // direction of the lookup that costs a page walk. Passing the number instead
397
+ // (which `list` prints beside the node id) avoids it entirely.
398
+ const github = await session.github();
399
+ const sweep = await github.comments.details(ref);
400
+ const found = sweep.comments.find((comment) => comment.nodeId === handle.nodeId);
401
+ if (found === undefined) {
402
+ throw usageError(`No comment with node id ${handle.nodeId} on ${formatIssueCoordinate(ref)}. `
403
+ + "`pharos comment list` prints both ids for every comment.", { nodeId: handle.nodeId });
404
+ }
405
+ return found.id;
406
+ }
407
+ /** The node id, looked up from the REST id only when that is what was given. */
408
+ async function nodeIdOf(session, ref, handle) {
409
+ if (handle.kind === "node")
410
+ return handle.nodeId;
411
+ // One cheap REST read — the single-comment route carries `node_id`. This is
412
+ // the direction that does NOT need a page walk, which is why `hide` given a
413
+ // number costs two requests and given a node id costs one.
414
+ const github = await session.github();
415
+ const comment = await github.comments.get(ref, handle.id);
416
+ const nodeId = comment.nodeId;
417
+ if (nodeId === undefined || nodeId === "") {
418
+ throw usageError(`Comment ${handle.id} on ${formatIssueCoordinate(ref)} reported no node id, so it cannot be `
419
+ + "hidden or pinned — both are GraphQL mutations and the node id is what they address.", { commentId: handle.id });
420
+ }
421
+ return nodeId;
422
+ }
423
+ function splitRepo(repo) {
424
+ const slash = repo.indexOf("/");
425
+ return { owner: repo.slice(0, slash), name: repo.slice(slash + 1) };
426
+ }
427
+ //# sourceMappingURL=comment-github.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-github.js","sourceRoot":"","sources":["../../src/commands/comment-github.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,aAAa,GAId,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAyC,MAAM,cAAc,CAAC;AAChG,OAAO,EAAE,OAAO,EAAgB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mappings":"AAEA,OAAO,EAAoB,KAAK,QAAQ,EAAE,KAAK,EAAE,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAoCtD,wBAAsB,UAAU,CAC9B,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,KAAK,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GACnC,OAAO,CAAC,QAAQ,CAAC,CAoCnB"}
1
+ {"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../src/commands/comment.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,QAAQ,EAAE,KAAK,EAAE,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAuFtD,wBAAsB,UAAU,CAC9B,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,KAAK,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GACnC,OAAO,CAAC,QAAQ,CAAC,CAoEnB"}