@blogic-cz/agent-tools 1.16.2 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -286,6 +286,12 @@ approval permits exact nonsensitive reads, not script execution or environment f
286
286
 
287
287
  All tools support `--help` for full usage documentation. Legacy `agent-tools-*` binary names (e.g. `agent-tools-gh`) still work for backwards compatibility.
288
288
 
289
+ ### GitHub issue subscriptions
290
+
291
+ `gh-tool issue list --format json` returns `author.login` for each issue. Use `gh-tool viewer --format json` to read the authenticated login.
292
+
293
+ To unsubscribe from an issue, run `gh-tool issue unsubscribe --issue 123 --repo owner/name --format json`. The command uses GitHub GraphQL and fails if GitHub cannot complete the mutation.
294
+
289
295
  ### Kubernetes command safety
290
296
 
291
297
  `k8s-tool` parses generic kubectl commands into arguments and invokes `kubectl` directly. Shell pipelines, chaining, substitution, user overrides of the configured cluster or credentials, mutating `config`/`auth` subcommands, and `cluster-info dump` are rejected. Direct Secret reads, raw kubeconfig output, filename/kustomize reads, and `kubectl diff` are also blocked.
@@ -38,6 +38,11 @@ export declare const issueReopenCommand: Command.Command<"reopen", {
38
38
  readonly issue: number;
39
39
  readonly repo: Option.Option<string>;
40
40
  }, {}, import("#gh/read/transport").GhError, GitHubService>;
41
+ export declare const issueUnsubscribeCommand: Command.Command<"unsubscribe", {
42
+ readonly format: "json" | "toon";
43
+ readonly issue: number;
44
+ readonly repo: Option.Option<string>;
45
+ }, {}, import("#gh/read/transport").GhError, GitHubService>;
41
46
  export declare const issueCreateCommand: Command.Command<"create", {
42
47
  readonly assignee: Option.Option<string>;
43
48
  readonly body: Option.Option<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/issue/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAmBxC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAanD,eAAO,MAAM,gBAAgB;;;;;;;;2DAwCwD,CAAC;AAEtF,eAAO,MAAM,gBAAgB;;;;2DAmB5B,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;2DAgCiC,CAAC;AAEnE,eAAO,MAAM,iBAAiB;;;;;;;2DAwCoD,CAAC;AAEnF,eAAO,MAAM,kBAAkB;;;;;;2DAmCyB,CAAC;AAEzD,eAAO,MAAM,kBAAkB;;;;;;;;;2DAiDsB,CAAC;AAEtD,eAAO,MAAM,mBAAmB;;;;;;2DA6B6B,CAAC;AAE9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;2DAiEkD,CAAC"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/issue/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAoBxC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAanD,eAAO,MAAM,gBAAgB;;;;;;;;2DAwCwD,CAAC;AAEtF,eAAO,MAAM,gBAAgB;;;;2DAmB5B,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;2DAgCiC,CAAC;AAEnE,eAAO,MAAM,iBAAiB;;;;;;;2DAwCoD,CAAC;AAEnF,eAAO,MAAM,kBAAkB;;;;;;2DAmCyB,CAAC;AAEzD,eAAO,MAAM,uBAAuB;;;;2DAe+C,CAAC;AAEpF,eAAO,MAAM,kBAAkB;;;;;;;;;2DAiDsB,CAAC;AAEtD,eAAO,MAAM,mBAAmB;;;;;;2DA6B6B,CAAC;AAE9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;2DAiEkD,CAAC"}
@@ -29,8 +29,16 @@ export type IssueListItem = {
29
29
  assignees: Array<{
30
30
  login: string;
31
31
  }>;
32
+ author: {
33
+ login: string;
34
+ } | null;
32
35
  createdAt: string;
33
36
  };
37
+ export type IssueSubscription = {
38
+ number: number;
39
+ url?: string;
40
+ viewerSubscription: string;
41
+ };
34
42
  export type RawIssueComment = {
35
43
  id: number;
36
44
  user: {
@@ -57,6 +65,9 @@ export declare const listIssues: (opts: {
57
65
  readonly assignees: {
58
66
  readonly login: string;
59
67
  }[];
68
+ readonly author: {
69
+ readonly login: string;
70
+ } | null;
60
71
  readonly createdAt: string;
61
72
  readonly body: string;
62
73
  } | {
@@ -71,6 +82,9 @@ export declare const listIssues: (opts: {
71
82
  readonly assignees: {
72
83
  readonly login: string;
73
84
  }[];
85
+ readonly author: {
86
+ readonly login: string;
87
+ } | null;
74
88
  readonly createdAt: string;
75
89
  })[], import("#gh/read/transport").GhError, GitHubService>;
76
90
  export declare const viewIssue: (issueNumber: number) => Effect.Effect<Pick<{
@@ -135,6 +149,11 @@ export declare const reopenIssue: (opts: {
135
149
  readonly body: string;
136
150
  readonly closedAt: string | null;
137
151
  }, "assignees" | "author" | "closedAt" | "createdAt" | "labels" | "number" | "state" | "title" | "url">, import("#gh/read/transport").GhError, GitHubService>;
152
+ export declare const unsubscribeIssue: (issue: number) => Effect.Effect<{
153
+ number: number;
154
+ url?: string | undefined;
155
+ viewerSubscription: string;
156
+ }, import("#gh/read/transport").GhError, GitHubService>;
138
157
  export declare const commentOnIssue: (opts: {
139
158
  issue: number;
140
159
  body: string;
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/issue/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAAyB,YAAY,EAAgC,MAAM,WAAW,CAAC;AAGnG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAMnD,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,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,gBAAgB;;;;uDAmC3B,CAAC;AAEH,eAAO,MAAM,cAAc;WAClB,MAAM;UACP,MAAM;;;;;;;uDAiDZ,CAAC;AAEH,eAAO,MAAM,WAAW;WACf,MAAM;UACP,MAAM;cACF,MAAM,GAAG,IAAI;YACf,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;6JA2BrB,CAAC;AAEH,eAAO,MAAM,SAAS;WACb,MAAM;WACN,MAAM,GAAG,IAAI;UACd,MAAM,GAAG,IAAI;eACR,MAAM,GAAG,IAAI;kBACV,MAAM,GAAG,IAAI;iBACd,MAAM,GAAG,IAAI;oBACV,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;6JA+B7B,CAAC"}
@@ -1,3 +1,3 @@
1
- export { issueCloseCommand, issueCommentCommand, issueCommentsCommand, issueCreateCommand, issueEditCommand, issueListCommand, issueReopenCommand, issueViewCommand, } from "./commands";
1
+ export { issueCloseCommand, issueCommentCommand, issueCommentsCommand, issueCreateCommand, issueEditCommand, issueListCommand, issueReopenCommand, issueViewCommand, issueUnsubscribeCommand, } from "./commands";
2
2
  export { issueSnapshotBatchCommand, issueTriageCommand } from "./triage";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/issue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/issue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/gh-tool/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAmFrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA6IjD,eAAO,MAAM,WAAW,gIAiDvB,CAAC;AAoCF,eAAO,MAAM,OAAO,YAGhB,CAAC"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/gh-tool/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAqFrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA8IjD,eAAO,MAAM,WAAW,gIAkDvB,CAAC;AAoCF,eAAO,MAAM,OAAO,YAGhB,CAAC"}
@@ -26,7 +26,7 @@ export type IssueListFilter = {
26
26
  limit: number;
27
27
  includeBody?: boolean;
28
28
  };
29
- export declare const ISSUE_LIST_FIELDS = "number,title,state,url,labels,assignees,createdAt";
29
+ export declare const ISSUE_LIST_FIELDS = "number,title,state,url,labels,assignees,author,createdAt";
30
30
  export declare const ISSUE_VIEW_FIELDS = "number,title,state,url,labels,assignees,author,body,createdAt,closedAt";
31
31
  export declare const issueView: (repo: RepoRef, issue: number, consistency?: "cached" | "origin" | undefined) => Effect.Effect<{
32
32
  readonly number: number;
@@ -46,6 +46,10 @@ export declare const issueView: (repo: RepoRef, issue: number, consistency?: "ca
46
46
  readonly body: string;
47
47
  readonly closedAt: string | null;
48
48
  }, import("#gh/read/transport").GhError, GitHubService>;
49
+ export declare const issueNode: (repo: RepoRef, issue: number) => Effect.Effect<{
50
+ readonly id: string;
51
+ readonly url?: string | undefined;
52
+ } | null, import("#gh/read/transport").GhError, GitHubService>;
49
53
  export declare const issueList: (repo: RepoRef, filter: IssueListFilter, consistency?: "cached" | "origin" | undefined) => Effect.Effect<({
50
54
  readonly number: number;
51
55
  readonly title: string;
@@ -57,6 +61,9 @@ export declare const issueList: (repo: RepoRef, filter: IssueListFilter, consist
57
61
  readonly assignees: {
58
62
  readonly login: string;
59
63
  }[];
64
+ readonly author: {
65
+ readonly login: string;
66
+ } | null;
60
67
  readonly createdAt: string;
61
68
  readonly body: string;
62
69
  } | {
@@ -71,6 +78,9 @@ export declare const issueList: (repo: RepoRef, filter: IssueListFilter, consist
71
78
  readonly assignees: {
72
79
  readonly login: string;
73
80
  }[];
81
+ readonly author: {
82
+ readonly login: string;
83
+ } | null;
74
84
  readonly createdAt: string;
75
85
  })[], import("#gh/read/transport").GhError, GitHubService>;
76
86
  export declare const issueComments: (repo: RepoRef, issue: number) => Effect.Effect<{
@@ -1 +1 @@
1
- {"version":3,"file":"issues.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/read/issues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAetC,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;EAKb,CAAC;AAQH,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAC;AAC9C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AACF,eAAO,MAAM,iBAAiB,sDAAsD,CAAC;AACrF,eAAO,MAAM,iBAAiB,2EAC4C,CAAC;AAE3E,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;uDAwBpB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;0DAsCpB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;yDAYxB,CAAC"}
1
+ {"version":3,"file":"issues.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/read/issues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAgBtC,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;EAKb,CAAC;AAoBH,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAC;AAC9C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AACF,eAAO,MAAM,iBAAiB,6DAA6D,CAAC;AAC5F,eAAO,MAAM,iBAAiB,2EAC4C,CAAC;AAE3E,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;uDAwBpB,CAAC;AAEH,eAAO,MAAM,SAAS;;;8DAOpB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAsCpB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;yDAYxB,CAAC"}
@@ -32,6 +32,9 @@ export declare const getPRStatusRateLimit: () => Effect.Effect<{
32
32
  core: RateLimitResource;
33
33
  graphql: RateLimitResource;
34
34
  }, never, GitHubService>;
35
+ export declare const viewerLogin: () => Effect.Effect<{
36
+ readonly login: string;
37
+ }, import("#gh/read/transport").GhError, GitHubService>;
35
38
  export declare const resolveRepo: (repo: string | null) => Effect.Effect<RepoRef, import("#gh/read/transport").GhError, GitHubService>;
36
39
  export declare const rawJobLog: (path: string) => Effect.Effect<import("#gh/read/transport").GhResult, import("#gh/read/transport").GhError, GitHubService>;
37
40
  export declare const reads: {
@@ -261,6 +264,9 @@ export declare const reads: {
261
264
  readonly assignees: {
262
265
  readonly login: string;
263
266
  }[];
267
+ readonly author: {
268
+ readonly login: string;
269
+ } | null;
264
270
  readonly createdAt: string;
265
271
  readonly body: string;
266
272
  } | {
@@ -275,6 +281,9 @@ export declare const reads: {
275
281
  readonly assignees: {
276
282
  readonly login: string;
277
283
  }[];
284
+ readonly author: {
285
+ readonly login: string;
286
+ } | null;
278
287
  readonly createdAt: string;
279
288
  })[], import("#gh/read/transport").GhError, GitHubService>;
280
289
  issueComments: (repo: RepoRef, issue: number) => Effect.Effect<{
@@ -286,5 +295,12 @@ export declare const reads: {
286
295
  readonly created_at: string;
287
296
  readonly html_url: string;
288
297
  }[], import("#gh/read/transport").GhError, GitHubService>;
298
+ issueNode: (repo: RepoRef, issue: number) => Effect.Effect<{
299
+ readonly id: string;
300
+ readonly url?: string | undefined;
301
+ } | null, import("#gh/read/transport").GhError, GitHubService>;
302
+ viewerLogin: () => Effect.Effect<{
303
+ readonly login: string;
304
+ }, import("#gh/read/transport").GhError, GitHubService>;
289
305
  };
290
306
  //# sourceMappingURL=reads.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reads.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/read/reads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAkB,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAkBhD,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAUjD,MAAM,MAAM,MAAM,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;I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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BjB,CAAC"}
@@ -10,6 +10,9 @@ export declare const repoInfoCommand: Command.Command<"info", {
10
10
  readonly format: "json" | "toon";
11
11
  readonly repo: Option.Option<string>;
12
12
  }, {}, import("./read/transport").GhError, GitHubService>;
13
+ export declare const viewerCommand: Command.Command<"viewer", {
14
+ readonly format: "json" | "toon";
15
+ }, {}, import("./read/transport").GhError, GitHubService>;
13
16
  export declare const repoListCommand: Command.Command<"list", {
14
17
  readonly format: "json" | "toon";
15
18
  readonly limit: number;
@@ -1 +1 @@
1
- {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/gh-tool/repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIxC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAoBjD,eAAO,MAAM,uBAAuB;;;;yDAiB6D,CAAC;AAElG,eAAO,MAAM,eAAe;;;yDAcqE,CAAC;AAElG,eAAO,MAAM,eAAe;;;;;yDAyB3B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;yDAoB6C,CAAC"}
1
+ {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/gh-tool/repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIxC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAoBjD,eAAO,MAAM,uBAAuB;;;;yDAiB6D,CAAC;AAElG,eAAO,MAAM,eAAe;;;yDAcqE,CAAC;AAElG,eAAO,MAAM,aAAa;;yDAImD,CAAC;AAE9E,eAAO,MAAM,eAAe;;;;;yDAyB3B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;yDAoB6C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blogic-cz/agent-tools",
3
- "version": "1.16.2",
3
+ "version": "1.17.0",
4
4
  "description": "CLI tools for AI coding agent workflows — GitHub, database, Kubernetes, Azure platform, Azure DevOps, logs, sessions, and audit",
5
5
  "keywords": [
6
6
  "agent",
@@ -16,6 +16,7 @@ import {
16
16
  fetchIssueComments,
17
17
  listIssues,
18
18
  reopenIssue,
19
+ unsubscribeIssue,
19
20
  viewIssue,
20
21
  } from "./core";
21
22
  import { GitHubService } from "#gh/read/transport";
@@ -207,6 +208,23 @@ export const issueReopenCommand = Command.make(
207
208
  ),
208
209
  ).pipe(Command.withDescription("Reopen a closed issue"));
209
210
 
211
+ export const issueUnsubscribeCommand = Command.make(
212
+ "unsubscribe",
213
+ {
214
+ format: formatOption,
215
+ issue: Flag.Int("issue").pipe(Flag.withDescription("Issue number to unsubscribe from")),
216
+ repo: repoOption,
217
+ },
218
+ ({ format, issue, repo }) =>
219
+ withRepo(
220
+ repo,
221
+ Effect.gen(function* () {
222
+ const result = yield* unsubscribeIssue(issue);
223
+ yield* logFormatted(result, format);
224
+ }),
225
+ ),
226
+ ).pipe(Command.withDescription("Unsubscribe the authenticated user from an issue"));
227
+
210
228
  export const issueCreateCommand = Command.make(
211
229
  "create",
212
230
  {
@@ -2,7 +2,7 @@ import { Effect } from "effect";
2
2
 
3
3
  import type { GitHubIssueCommentUrl, IssueComment, IssueCommentId, IsoTimestamp } from "#gh/types";
4
4
 
5
- import { GitHubCommandError } from "#gh/errors";
5
+ import { GitHubCommandError, GitHubNotFoundError } from "#gh/errors";
6
6
  import { GitHubService } from "#gh/read/transport";
7
7
  import { reads, resolveRepo } from "#gh/read/reads";
8
8
  import { writes } from "#gh/read/writes";
@@ -28,9 +28,16 @@ export type IssueListItem = {
28
28
  url: string;
29
29
  labels: Array<{ name: string }>;
30
30
  assignees: Array<{ login: string }>;
31
+ author: { login: string } | null;
31
32
  createdAt: string;
32
33
  };
33
34
 
35
+ export type IssueSubscription = {
36
+ number: number;
37
+ url?: string;
38
+ viewerSubscription: string;
39
+ };
40
+
34
41
  export type RawIssueComment = {
35
42
  id: number;
36
43
  user: { login: string };
@@ -144,6 +151,43 @@ export const reopenIssue = Effect.fn("issue.reopenIssue")(function* (opts: {
144
151
  return yield* viewIssue(opts.issue);
145
152
  });
146
153
 
154
+ export const unsubscribeIssue = Effect.fn("issue.unsubscribeIssue")(function* (issue: number) {
155
+ const repo = yield* resolveRepo(null);
156
+ const issueNode = yield* reads.issueNode(repo, issue);
157
+
158
+ if (issueNode === null) {
159
+ return yield* new GitHubNotFoundError({
160
+ message: `Issue #${issue} was not found in ${repoSlug(repo)}`,
161
+ resource: "issue",
162
+ identifier: `${repoSlug(repo)}#${issue}`,
163
+ });
164
+ }
165
+
166
+ const subscription = (yield* writes.graphql(
167
+ "mutation($id: ID!) { updateSubscription(input: {subscribableId: $id, state: UNSUBSCRIBED}) { subscribable { viewerSubscription } } }",
168
+ { id: issueNode.id },
169
+ [`issue:${repoSlug(repo)}#${issue}`, `issues:${repoSlug(repo)}`],
170
+ )) as {
171
+ updateSubscription: { subscribable: { viewerSubscription: string } | null } | null;
172
+ } | null;
173
+ const viewerSubscription = subscription?.updateSubscription?.subscribable?.viewerSubscription;
174
+
175
+ if (viewerSubscription === undefined || viewerSubscription === null) {
176
+ return yield* new GitHubCommandError({
177
+ command: "gh-tool issue unsubscribe",
178
+ exitCode: 1,
179
+ message: `GitHub did not return the subscription state for issue #${issue}`,
180
+ stderr: "The unsubscribe mutation returned no subscription state.",
181
+ });
182
+ }
183
+
184
+ return {
185
+ number: issue,
186
+ ...(issueNode.url === undefined ? {} : { url: issueNode.url }),
187
+ viewerSubscription,
188
+ } satisfies IssueSubscription;
189
+ });
190
+
147
191
  export const commentOnIssue = Effect.fn("issue.commentOnIssue")(function* (opts: {
148
192
  issue: number;
149
193
  body: string;
@@ -7,5 +7,6 @@ export {
7
7
  issueListCommand,
8
8
  issueReopenCommand,
9
9
  issueViewCommand,
10
+ issueUnsubscribeCommand,
10
11
  } from "./commands";
11
12
  export { issueSnapshotBatchCommand, issueTriageCommand } from "./triage";
@@ -19,6 +19,7 @@ import {
19
19
  issueReopenCommand,
20
20
  issueSnapshotBatchCommand,
21
21
  issueTriageCommand,
22
+ issueUnsubscribeCommand,
22
23
  issueViewCommand,
23
24
  } from "./issue";
24
25
  import {
@@ -80,6 +81,7 @@ import {
80
81
  repoInfoCommand,
81
82
  repoListCommand,
82
83
  repoSearchCodeCommand,
84
+ viewerCommand,
83
85
  } from "./repo";
84
86
  import { labelCreateCommand } from "./label";
85
87
  import { GitHubService } from "./read/transport";
@@ -144,7 +146,7 @@ const prCommand = Command.make("pr", {}).pipe(
144
146
 
145
147
  const issueCommand = Command.make("issue", {}).pipe(
146
148
  Command.withDescription(
147
- "Issue operations (list, view, comments, triage, snapshot-batch, create, close, reopen, comment, edit)",
149
+ "Issue operations (list, view, comments, triage, snapshot-batch, create, close, reopen, unsubscribe, comment, edit)",
148
150
  ),
149
151
  Command.withSubcommands([
150
152
  issueListCommand,
@@ -155,6 +157,7 @@ const issueCommand = Command.make("issue", {}).pipe(
155
157
  issueCreateCommand,
156
158
  issueCloseCommand,
157
159
  issueReopenCommand,
160
+ issueUnsubscribeCommand,
158
161
  issueCommentCommand,
159
162
  issueEditCommand,
160
163
  ]),
@@ -264,6 +267,7 @@ WORKFLOW FOR AI AGENTS:
264
267
  prCommand,
265
268
  issueCommand,
266
269
  repoCommand,
270
+ viewerCommand,
267
271
  labelCommand,
268
272
  branchCommand,
269
273
  workflowCommand,
@@ -17,6 +17,7 @@ const IssueListItem = Schema.Struct({
17
17
  url: Schema.String,
18
18
  labels: Schema.mutable(Schema.Array(Label)),
19
19
  assignees: Schema.mutable(Schema.Array(Login)),
20
+ author: Schema.NullOr(Login),
20
21
  createdAt: Schema.String,
21
22
  });
22
23
  const IssueView = Schema.Struct({
@@ -25,6 +26,18 @@ const IssueView = Schema.Struct({
25
26
  body: Schema.String,
26
27
  closedAt: Schema.NullOr(Schema.String),
27
28
  });
29
+ const IssueNodeLookup = Schema.Struct({
30
+ repository: Schema.NullOr(
31
+ Schema.Struct({
32
+ issue: Schema.NullOr(
33
+ Schema.Struct({
34
+ id: Schema.String,
35
+ url: Schema.optional(Schema.String),
36
+ }),
37
+ ),
38
+ }),
39
+ ),
40
+ });
28
41
  const IssueComment = Schema.Struct({
29
42
  id: Schema.Number,
30
43
  user: Login,
@@ -39,7 +52,7 @@ export type IssueListFilter = {
39
52
  limit: number;
40
53
  includeBody?: boolean;
41
54
  };
42
- export const ISSUE_LIST_FIELDS = "number,title,state,url,labels,assignees,createdAt";
55
+ export const ISSUE_LIST_FIELDS = "number,title,state,url,labels,assignees,author,createdAt";
43
56
  export const ISSUE_VIEW_FIELDS =
44
57
  "number,title,state,url,labels,assignees,author,body,createdAt,closedAt";
45
58
 
@@ -69,6 +82,15 @@ export const issueView = Effect.fn("reads.issueView")(function* (
69
82
  });
70
83
  });
71
84
 
85
+ export const issueNode = Effect.fn("reads.issueNode")(function* (repo: RepoRef, issue: number) {
86
+ const gh = yield* GitHubService;
87
+ const response = yield* gh.runGraphQL(
88
+ "query($owner: String!, $name: String!, $number: Int!) { repository(owner: $owner, name: $name) { issue(number: $number) { id url } } }",
89
+ { owner: repo.owner, name: repo.name, number: issue },
90
+ );
91
+ return parsePreserving(IssueNodeLookup)(response).repository?.issue ?? null;
92
+ });
93
+
72
94
  export const issueList = Effect.fn("reads.issueList")(function* (
73
95
  repo: RepoRef,
74
96
  filter: IssueListFilter,
@@ -5,7 +5,7 @@ import type { CheckRunAnnotation } from "#gh/types";
5
5
  import { cachedRead, ReadCache } from "./cache";
6
6
  import { OPS } from "./classes";
7
7
  import { repoSlug } from "./keys";
8
- import { issueView, issueList, issueComments } from "./issues";
8
+ import { issueView, issueList, issueComments, issueNode } from "./issues";
9
9
  import {
10
10
  prView,
11
11
  prList,
@@ -41,6 +41,7 @@ const RateLimitResponse = Schema.Struct({
41
41
  }),
42
42
  ),
43
43
  });
44
+ const ViewerLogin = Schema.Struct({ viewer: Schema.Struct({ login: Schema.String }) });
44
45
 
45
46
  export type RateLimitResource = {
46
47
  readonly limit: number;
@@ -111,6 +112,12 @@ export const getPRStatusRateLimit = Effect.fn("reads.getPRStatusRateLimit")(func
111
112
  return { core, graphql } satisfies PRStatusRateLimit;
112
113
  });
113
114
 
115
+ export const viewerLogin = Effect.fn("reads.viewerLogin")(function* () {
116
+ const gh = yield* GitHubService;
117
+ const response = yield* gh.runGraphQL("query { viewer { login } }", {});
118
+ return parsePreserving(ViewerLogin)(response).viewer;
119
+ });
120
+
114
121
  const completedAttemptJobs = Effect.fn("reads.completedAttemptJobs")(function* (
115
122
  repo: RepoRef,
116
123
  runId: number,
@@ -398,4 +405,6 @@ export const reads = {
398
405
  issueView,
399
406
  issueList,
400
407
  issueComments,
408
+ issueNode,
409
+ viewerLogin,
401
410
  };
@@ -5,7 +5,7 @@ import { formatOption, logFormatted } from "#shared";
5
5
  import { passthrough } from "./read/catalog";
6
6
  import { GitHubService } from "./read/transport";
7
7
  import { commitAuthor } from "./read/commits";
8
- import { resolveRepo } from "./read/reads";
8
+ import { reads, resolveRepo } from "./read/reads";
9
9
 
10
10
  // ---------------------------------------------------------------------------
11
11
  // Types
@@ -58,6 +58,12 @@ export const repoInfoCommand = Command.make(
58
58
  }),
59
59
  ).pipe(Command.withDescription("Show repository information (owner, name, default branch, URL)"));
60
60
 
61
+ export const viewerCommand = Command.make("viewer", { format: formatOption }, ({ format }) =>
62
+ Effect.gen(function* () {
63
+ yield* logFormatted(yield* reads.viewerLogin(), format);
64
+ }),
65
+ ).pipe(Command.withDescription("Show the authenticated GitHub user's login"));
66
+
61
67
  export const repoListCommand = Command.make(
62
68
  "list",
63
69
  {