chief-clancy 0.6.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 (181) hide show
  1. package/README.md +3 -2
  2. package/dist/bundle/clancy-afk.js +6 -2
  3. package/dist/bundle/clancy-once.js +49 -48
  4. package/dist/installer/hook-installer/hook-installer.d.ts +2 -0
  5. package/dist/installer/hook-installer/hook-installer.d.ts.map +1 -1
  6. package/dist/installer/hook-installer/hook-installer.js +36 -1
  7. package/dist/installer/hook-installer/hook-installer.js.map +1 -1
  8. package/dist/installer/install.js +8 -0
  9. package/dist/installer/install.js.map +1 -1
  10. package/hooks/clancy-branch-guard.js +129 -0
  11. package/hooks/clancy-context-monitor.js +134 -46
  12. package/hooks/clancy-post-compact.js +53 -0
  13. package/hooks/package.json +3 -0
  14. package/package.json +7 -3
  15. package/src/agents/verification-gate.md +128 -0
  16. package/src/roles/setup/workflows/init.md +45 -0
  17. package/src/roles/setup/workflows/scaffold.md +30 -0
  18. package/src/roles/setup/workflows/settings.md +56 -0
  19. package/src/templates/.env.example.github +19 -1
  20. package/src/templates/.env.example.jira +25 -1
  21. package/src/templates/.env.example.linear +19 -1
  22. package/dist/schemas/bitbucket-pr.d.ts +0 -137
  23. package/dist/schemas/bitbucket-pr.d.ts.map +0 -1
  24. package/dist/schemas/bitbucket-pr.js +0 -75
  25. package/dist/schemas/bitbucket-pr.js.map +0 -1
  26. package/dist/schemas/env.d.ts +0 -150
  27. package/dist/schemas/env.d.ts.map +0 -1
  28. package/dist/schemas/env.js +0 -63
  29. package/dist/schemas/env.js.map +0 -1
  30. package/dist/schemas/github-issues.d.ts +0 -105
  31. package/dist/schemas/github-issues.d.ts.map +0 -1
  32. package/dist/schemas/github-issues.js +0 -54
  33. package/dist/schemas/github-issues.js.map +0 -1
  34. package/dist/schemas/gitlab-mr.d.ts +0 -73
  35. package/dist/schemas/gitlab-mr.d.ts.map +0 -1
  36. package/dist/schemas/gitlab-mr.js +0 -33
  37. package/dist/schemas/gitlab-mr.js.map +0 -1
  38. package/dist/schemas/jira.d.ts +0 -59
  39. package/dist/schemas/jira.d.ts.map +0 -1
  40. package/dist/schemas/jira.js +0 -56
  41. package/dist/schemas/jira.js.map +0 -1
  42. package/dist/schemas/linear.d.ts +0 -108
  43. package/dist/schemas/linear.d.ts.map +0 -1
  44. package/dist/schemas/linear.js +0 -84
  45. package/dist/schemas/linear.js.map +0 -1
  46. package/dist/scripts/afk/afk.d.ts +0 -21
  47. package/dist/scripts/afk/afk.d.ts.map +0 -1
  48. package/dist/scripts/afk/afk.js +0 -118
  49. package/dist/scripts/afk/afk.js.map +0 -1
  50. package/dist/scripts/board/github/github.d.ts +0 -104
  51. package/dist/scripts/board/github/github.d.ts.map +0 -1
  52. package/dist/scripts/board/github/github.js +0 -291
  53. package/dist/scripts/board/github/github.js.map +0 -1
  54. package/dist/scripts/board/jira/jira.d.ts +0 -139
  55. package/dist/scripts/board/jira/jira.d.ts.map +0 -1
  56. package/dist/scripts/board/jira/jira.js +0 -378
  57. package/dist/scripts/board/jira/jira.js.map +0 -1
  58. package/dist/scripts/board/linear/linear.d.ts +0 -129
  59. package/dist/scripts/board/linear/linear.d.ts.map +0 -1
  60. package/dist/scripts/board/linear/linear.js +0 -393
  61. package/dist/scripts/board/linear/linear.js.map +0 -1
  62. package/dist/scripts/once/board-ops/board-ops.d.ts +0 -26
  63. package/dist/scripts/once/board-ops/board-ops.d.ts.map +0 -1
  64. package/dist/scripts/once/board-ops/board-ops.js +0 -113
  65. package/dist/scripts/once/board-ops/board-ops.js.map +0 -1
  66. package/dist/scripts/once/deliver/deliver.d.ts +0 -37
  67. package/dist/scripts/once/deliver/deliver.d.ts.map +0 -1
  68. package/dist/scripts/once/deliver/deliver.js +0 -236
  69. package/dist/scripts/once/deliver/deliver.js.map +0 -1
  70. package/dist/scripts/once/fetch-ticket/fetch-ticket.d.ts +0 -22
  71. package/dist/scripts/once/fetch-ticket/fetch-ticket.d.ts.map +0 -1
  72. package/dist/scripts/once/fetch-ticket/fetch-ticket.js +0 -123
  73. package/dist/scripts/once/fetch-ticket/fetch-ticket.js.map +0 -1
  74. package/dist/scripts/once/git-token/git-token.d.ts +0 -13
  75. package/dist/scripts/once/git-token/git-token.d.ts.map +0 -1
  76. package/dist/scripts/once/git-token/git-token.js +0 -30
  77. package/dist/scripts/once/git-token/git-token.js.map +0 -1
  78. package/dist/scripts/once/once.d.ts +0 -12
  79. package/dist/scripts/once/once.d.ts.map +0 -1
  80. package/dist/scripts/once/once.js +0 -356
  81. package/dist/scripts/once/once.js.map +0 -1
  82. package/dist/scripts/once/pr-creation/pr-creation.d.ts +0 -11
  83. package/dist/scripts/once/pr-creation/pr-creation.d.ts.map +0 -1
  84. package/dist/scripts/once/pr-creation/pr-creation.js +0 -50
  85. package/dist/scripts/once/pr-creation/pr-creation.js.map +0 -1
  86. package/dist/scripts/once/rework/rework.d.ts +0 -32
  87. package/dist/scripts/once/rework/rework.d.ts.map +0 -1
  88. package/dist/scripts/once/rework/rework.js +0 -208
  89. package/dist/scripts/once/rework/rework.js.map +0 -1
  90. package/dist/scripts/once/types/types.d.ts +0 -13
  91. package/dist/scripts/once/types/types.d.ts.map +0 -1
  92. package/dist/scripts/once/types/types.js +0 -2
  93. package/dist/scripts/once/types/types.js.map +0 -1
  94. package/dist/scripts/shared/branch/branch.d.ts +0 -50
  95. package/dist/scripts/shared/branch/branch.d.ts.map +0 -1
  96. package/dist/scripts/shared/branch/branch.js +0 -61
  97. package/dist/scripts/shared/branch/branch.js.map +0 -1
  98. package/dist/scripts/shared/claude-cli/claude-cli.d.ts +0 -31
  99. package/dist/scripts/shared/claude-cli/claude-cli.d.ts.map +0 -1
  100. package/dist/scripts/shared/claude-cli/claude-cli.js +0 -60
  101. package/dist/scripts/shared/claude-cli/claude-cli.js.map +0 -1
  102. package/dist/scripts/shared/env-schema/env-schema.d.ts +0 -27
  103. package/dist/scripts/shared/env-schema/env-schema.d.ts.map +0 -1
  104. package/dist/scripts/shared/env-schema/env-schema.js +0 -47
  105. package/dist/scripts/shared/env-schema/env-schema.js.map +0 -1
  106. package/dist/scripts/shared/feasibility/feasibility.d.ts +0 -30
  107. package/dist/scripts/shared/feasibility/feasibility.d.ts.map +0 -1
  108. package/dist/scripts/shared/feasibility/feasibility.js +0 -68
  109. package/dist/scripts/shared/feasibility/feasibility.js.map +0 -1
  110. package/dist/scripts/shared/format/format.d.ts +0 -11
  111. package/dist/scripts/shared/format/format.d.ts.map +0 -1
  112. package/dist/scripts/shared/format/format.js +0 -18
  113. package/dist/scripts/shared/format/format.js.map +0 -1
  114. package/dist/scripts/shared/git-ops/git-ops.d.ts +0 -90
  115. package/dist/scripts/shared/git-ops/git-ops.d.ts.map +0 -1
  116. package/dist/scripts/shared/git-ops/git-ops.js +0 -190
  117. package/dist/scripts/shared/git-ops/git-ops.js.map +0 -1
  118. package/dist/scripts/shared/http/http.d.ts +0 -54
  119. package/dist/scripts/shared/http/http.d.ts.map +0 -1
  120. package/dist/scripts/shared/http/http.js +0 -76
  121. package/dist/scripts/shared/http/http.js.map +0 -1
  122. package/dist/scripts/shared/notify/notify.d.ts +0 -46
  123. package/dist/scripts/shared/notify/notify.d.ts.map +0 -1
  124. package/dist/scripts/shared/notify/notify.js +0 -88
  125. package/dist/scripts/shared/notify/notify.js.map +0 -1
  126. package/dist/scripts/shared/preflight/preflight.d.ts +0 -40
  127. package/dist/scripts/shared/preflight/preflight.d.ts.map +0 -1
  128. package/dist/scripts/shared/preflight/preflight.js +0 -96
  129. package/dist/scripts/shared/preflight/preflight.js.map +0 -1
  130. package/dist/scripts/shared/progress/progress.d.ts +0 -75
  131. package/dist/scripts/shared/progress/progress.d.ts.map +0 -1
  132. package/dist/scripts/shared/progress/progress.js +0 -210
  133. package/dist/scripts/shared/progress/progress.js.map +0 -1
  134. package/dist/scripts/shared/prompt/prompt.d.ts +0 -58
  135. package/dist/scripts/shared/prompt/prompt.d.ts.map +0 -1
  136. package/dist/scripts/shared/prompt/prompt.js +0 -123
  137. package/dist/scripts/shared/prompt/prompt.js.map +0 -1
  138. package/dist/scripts/shared/pull-request/bitbucket/bitbucket.d.ts +0 -82
  139. package/dist/scripts/shared/pull-request/bitbucket/bitbucket.d.ts.map +0 -1
  140. package/dist/scripts/shared/pull-request/bitbucket/bitbucket.js +0 -301
  141. package/dist/scripts/shared/pull-request/bitbucket/bitbucket.js.map +0 -1
  142. package/dist/scripts/shared/pull-request/github/github.d.ts +0 -72
  143. package/dist/scripts/shared/pull-request/github/github.d.ts.map +0 -1
  144. package/dist/scripts/shared/pull-request/github/github.js +0 -226
  145. package/dist/scripts/shared/pull-request/github/github.js.map +0 -1
  146. package/dist/scripts/shared/pull-request/gitlab/gitlab.d.ts +0 -74
  147. package/dist/scripts/shared/pull-request/gitlab/gitlab.d.ts.map +0 -1
  148. package/dist/scripts/shared/pull-request/gitlab/gitlab.js +0 -220
  149. package/dist/scripts/shared/pull-request/gitlab/gitlab.js.map +0 -1
  150. package/dist/scripts/shared/pull-request/post-pr/post-pr.d.ts +0 -31
  151. package/dist/scripts/shared/pull-request/post-pr/post-pr.d.ts.map +0 -1
  152. package/dist/scripts/shared/pull-request/post-pr/post-pr.js +0 -61
  153. package/dist/scripts/shared/pull-request/post-pr/post-pr.js.map +0 -1
  154. package/dist/scripts/shared/pull-request/pr-body/pr-body.d.ts +0 -40
  155. package/dist/scripts/shared/pull-request/pr-body/pr-body.d.ts.map +0 -1
  156. package/dist/scripts/shared/pull-request/pr-body/pr-body.js +0 -84
  157. package/dist/scripts/shared/pull-request/pr-body/pr-body.js.map +0 -1
  158. package/dist/scripts/shared/pull-request/rework-comment/rework-comment.d.ts +0 -23
  159. package/dist/scripts/shared/pull-request/rework-comment/rework-comment.d.ts.map +0 -1
  160. package/dist/scripts/shared/pull-request/rework-comment/rework-comment.js +0 -30
  161. package/dist/scripts/shared/pull-request/rework-comment/rework-comment.js.map +0 -1
  162. package/dist/scripts/shared/remote/remote.d.ts +0 -41
  163. package/dist/scripts/shared/remote/remote.d.ts.map +0 -1
  164. package/dist/scripts/shared/remote/remote.js +0 -227
  165. package/dist/scripts/shared/remote/remote.js.map +0 -1
  166. package/dist/types/board.d.ts +0 -13
  167. package/dist/types/board.d.ts.map +0 -1
  168. package/dist/types/board.js +0 -5
  169. package/dist/types/board.js.map +0 -1
  170. package/dist/types/index.d.ts +0 -4
  171. package/dist/types/index.d.ts.map +0 -1
  172. package/dist/types/index.js +0 -2
  173. package/dist/types/index.js.map +0 -1
  174. package/dist/types/remote.d.ts +0 -55
  175. package/dist/types/remote.d.ts.map +0 -1
  176. package/dist/types/remote.js +0 -5
  177. package/dist/types/remote.js.map +0 -1
  178. package/dist/utils/parse-json/parse-json.d.ts +0 -20
  179. package/dist/utils/parse-json/parse-json.d.ts.map +0 -1
  180. package/dist/utils/parse-json/parse-json.js +0 -27
  181. package/dist/utils/parse-json/parse-json.js.map +0 -1
@@ -1,108 +0,0 @@
1
- /**
2
- * Zod schemas for Linear GraphQL API responses.
3
- */
4
- import { z } from 'zod/mini';
5
- /** A single Linear issue node from the assignedIssues query. */
6
- declare const linearIssueNodeSchema: z.ZodMiniObject<{
7
- id: z.ZodMiniString<string>;
8
- identifier: z.ZodMiniString<string>;
9
- title: z.ZodMiniString<string>;
10
- description: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
11
- parent: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
12
- identifier: z.ZodMiniString<string>;
13
- title: z.ZodMiniOptional<z.ZodMiniString<string>>;
14
- }, z.core.$strip>>>;
15
- labels: z.ZodMiniOptional<z.ZodMiniObject<{
16
- nodes: z.ZodMiniArray<z.ZodMiniObject<{
17
- name: z.ZodMiniString<string>;
18
- }, z.core.$strip>>;
19
- }, z.core.$strip>>;
20
- }, z.core.$strip>;
21
- /** Response from the `viewer.assignedIssues` GraphQL query. */
22
- export declare const linearIssuesResponseSchema: z.ZodMiniObject<{
23
- data: z.ZodMiniOptional<z.ZodMiniObject<{
24
- viewer: z.ZodMiniOptional<z.ZodMiniObject<{
25
- assignedIssues: z.ZodMiniOptional<z.ZodMiniObject<{
26
- nodes: z.ZodMiniArray<z.ZodMiniObject<{
27
- id: z.ZodMiniString<string>;
28
- identifier: z.ZodMiniString<string>;
29
- title: z.ZodMiniString<string>;
30
- description: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
31
- parent: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
32
- identifier: z.ZodMiniString<string>;
33
- title: z.ZodMiniOptional<z.ZodMiniString<string>>;
34
- }, z.core.$strip>>>;
35
- labels: z.ZodMiniOptional<z.ZodMiniObject<{
36
- nodes: z.ZodMiniArray<z.ZodMiniObject<{
37
- name: z.ZodMiniString<string>;
38
- }, z.core.$strip>>;
39
- }, z.core.$strip>>;
40
- }, z.core.$strip>>;
41
- }, z.core.$strip>>;
42
- }, z.core.$strip>>;
43
- }, z.core.$strip>>;
44
- }, z.core.$strip>;
45
- /** Response from the `viewer` ping query. */
46
- export declare const linearViewerResponseSchema: z.ZodMiniObject<{
47
- data: z.ZodMiniOptional<z.ZodMiniObject<{
48
- viewer: z.ZodMiniOptional<z.ZodMiniObject<{
49
- id: z.ZodMiniOptional<z.ZodMiniString<string>>;
50
- }, z.core.$strip>>;
51
- }, z.core.$strip>>;
52
- }, z.core.$strip>;
53
- /** Response from the `workflowStates` query. */
54
- export declare const linearWorkflowStatesResponseSchema: z.ZodMiniObject<{
55
- data: z.ZodMiniOptional<z.ZodMiniObject<{
56
- workflowStates: z.ZodMiniOptional<z.ZodMiniObject<{
57
- nodes: z.ZodMiniArray<z.ZodMiniObject<{
58
- id: z.ZodMiniString<string>;
59
- }, z.core.$strip>>;
60
- }, z.core.$strip>>;
61
- }, z.core.$strip>>;
62
- }, z.core.$strip>;
63
- /** Response from the `issueUpdate` mutation. */
64
- export declare const linearIssueUpdateResponseSchema: z.ZodMiniObject<{
65
- data: z.ZodMiniOptional<z.ZodMiniObject<{
66
- issueUpdate: z.ZodMiniOptional<z.ZodMiniObject<{
67
- success: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
68
- }, z.core.$strip>>;
69
- }, z.core.$strip>>;
70
- }, z.core.$strip>;
71
- /** Response from the `issue(id) { relations { ... } }` query. */
72
- export declare const linearIssueRelationsResponseSchema: z.ZodMiniObject<{
73
- data: z.ZodMiniOptional<z.ZodMiniObject<{
74
- issue: z.ZodMiniOptional<z.ZodMiniObject<{
75
- relations: z.ZodMiniOptional<z.ZodMiniObject<{
76
- nodes: z.ZodMiniArray<z.ZodMiniObject<{
77
- type: z.ZodMiniString<string>;
78
- relatedIssue: z.ZodMiniOptional<z.ZodMiniObject<{
79
- state: z.ZodMiniOptional<z.ZodMiniObject<{
80
- type: z.ZodMiniOptional<z.ZodMiniString<string>>;
81
- }, z.core.$strip>>;
82
- }, z.core.$strip>>;
83
- }, z.core.$strip>>;
84
- }, z.core.$strip>>;
85
- }, z.core.$strip>>;
86
- }, z.core.$strip>>;
87
- }, z.core.$strip>;
88
- /** Response from the `issueSearch` query. */
89
- export declare const linearIssueSearchResponseSchema: z.ZodMiniObject<{
90
- data: z.ZodMiniOptional<z.ZodMiniObject<{
91
- issueSearch: z.ZodMiniOptional<z.ZodMiniObject<{
92
- nodes: z.ZodMiniArray<z.ZodMiniObject<{
93
- state: z.ZodMiniOptional<z.ZodMiniObject<{
94
- type: z.ZodMiniOptional<z.ZodMiniString<string>>;
95
- }, z.core.$strip>>;
96
- }, z.core.$strip>>;
97
- }, z.core.$strip>>;
98
- }, z.core.$strip>>;
99
- }, z.core.$strip>;
100
- export type LinearIssueNode = z.infer<typeof linearIssueNodeSchema>;
101
- export type LinearIssuesResponse = z.infer<typeof linearIssuesResponseSchema>;
102
- export type LinearViewerResponse = z.infer<typeof linearViewerResponseSchema>;
103
- export type LinearWorkflowStatesResponse = z.infer<typeof linearWorkflowStatesResponseSchema>;
104
- export type LinearIssueUpdateResponse = z.infer<typeof linearIssueUpdateResponseSchema>;
105
- export type LinearIssueRelationsResponse = z.infer<typeof linearIssueRelationsResponseSchema>;
106
- export type LinearIssueSearchResponse = z.infer<typeof linearIssueSearchResponseSchema>;
107
- export {};
108
- //# sourceMappingURL=linear.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"linear.d.ts","sourceRoot":"","sources":["../../src/schemas/linear.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAE7B,gEAAgE;AAChE,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;iBAsBzB,CAAC;AAEH,+DAA+D;AAC/D,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;iBAcrC,CAAC;AAEH,6CAA6C;AAC7C,eAAO,MAAM,0BAA0B;;;;;;iBAUrC,CAAC;AAEH,gDAAgD;AAChD,eAAO,MAAM,kCAAkC;;;;;;;;iBAU7C,CAAC;AAEH,gDAAgD;AAChD,eAAO,MAAM,+BAA+B;;;;;;iBAU1C,CAAC;AAYH,iEAAiE;AACjE,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;iBAc7C,CAAC;AAOH,6CAA6C;AAC7C,eAAO,MAAM,+BAA+B;;;;;;;;;;iBAU1C,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC"}
@@ -1,84 +0,0 @@
1
- /**
2
- * Zod schemas for Linear GraphQL API responses.
3
- */
4
- import { z } from 'zod/mini';
5
- /** A single Linear issue node from the assignedIssues query. */
6
- const linearIssueNodeSchema = z.object({
7
- id: z.string(),
8
- identifier: z.string(),
9
- title: z.string(),
10
- description: z.optional(z.nullable(z.string())),
11
- parent: z.optional(z.nullable(z.object({
12
- identifier: z.string(),
13
- title: z.optional(z.string()),
14
- }))),
15
- labels: z.optional(z.object({
16
- nodes: z.array(z.object({
17
- name: z.string(),
18
- })),
19
- })),
20
- });
21
- /** Response from the `viewer.assignedIssues` GraphQL query. */
22
- export const linearIssuesResponseSchema = z.object({
23
- data: z.optional(z.object({
24
- viewer: z.optional(z.object({
25
- assignedIssues: z.optional(z.object({
26
- nodes: z.array(linearIssueNodeSchema),
27
- })),
28
- })),
29
- })),
30
- });
31
- /** Response from the `viewer` ping query. */
32
- export const linearViewerResponseSchema = z.object({
33
- data: z.optional(z.object({
34
- viewer: z.optional(z.object({
35
- id: z.optional(z.string()),
36
- })),
37
- })),
38
- });
39
- /** Response from the `workflowStates` query. */
40
- export const linearWorkflowStatesResponseSchema = z.object({
41
- data: z.optional(z.object({
42
- workflowStates: z.optional(z.object({
43
- nodes: z.array(z.object({ id: z.string() })),
44
- })),
45
- })),
46
- });
47
- /** Response from the `issueUpdate` mutation. */
48
- export const linearIssueUpdateResponseSchema = z.object({
49
- data: z.optional(z.object({
50
- issueUpdate: z.optional(z.object({
51
- success: z.optional(z.boolean()),
52
- })),
53
- })),
54
- });
55
- /** A single relation node from the `issue.relations` query. */
56
- const linearRelationNodeSchema = z.object({
57
- type: z.string(),
58
- relatedIssue: z.optional(z.object({
59
- state: z.optional(z.object({ type: z.optional(z.string()) })),
60
- })),
61
- });
62
- /** Response from the `issue(id) { relations { ... } }` query. */
63
- export const linearIssueRelationsResponseSchema = z.object({
64
- data: z.optional(z.object({
65
- issue: z.optional(z.object({
66
- relations: z.optional(z.object({
67
- nodes: z.array(linearRelationNodeSchema),
68
- })),
69
- })),
70
- })),
71
- });
72
- /** A single search result node with state info. */
73
- const linearSearchNodeSchema = z.object({
74
- state: z.optional(z.object({ type: z.optional(z.string()) })),
75
- });
76
- /** Response from the `issueSearch` query. */
77
- export const linearIssueSearchResponseSchema = z.object({
78
- data: z.optional(z.object({
79
- issueSearch: z.optional(z.object({
80
- nodes: z.array(linearSearchNodeSchema),
81
- })),
82
- })),
83
- });
84
- //# sourceMappingURL=linear.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"linear.js","sourceRoot":"","sources":["../../src/schemas/linear.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAE7B,gEAAgE;AAChE,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/C,MAAM,EAAE,CAAC,CAAC,QAAQ,CAChB,CAAC,CAAC,QAAQ,CACR,CAAC,CAAC,MAAM,CAAC;QACP,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KAC9B,CAAC,CACH,CACF;IACD,MAAM,EAAE,CAAC,CAAC,QAAQ,CAChB,CAAC,CAAC,MAAM,CAAC;QACP,KAAK,EAAE,CAAC,CAAC,KAAK,CACZ,CAAC,CAAC,MAAM,CAAC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,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;CAC9D,CAAC,CAAC;AAEH,6CAA6C;AAC7C,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,IAAI,EAAE,CAAC,CAAC,QAAQ,CACd,CAAC,CAAC,MAAM,CAAC;QACP,WAAW,EAAE,CAAC,CAAC,QAAQ,CACrB,CAAC,CAAC,MAAM,CAAC;YACP,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC;SACvC,CAAC,CACH;KACF,CAAC,CACH;CACF,CAAC,CAAC"}
@@ -1,21 +0,0 @@
1
- /**
2
- * Check whether the script output contains a stop condition.
3
- *
4
- * @param output - The captured stdout from a `clancy-once` run.
5
- * @returns An object with `stop` flag and optional `reason`.
6
- */
7
- export declare function checkStopCondition(output: string): {
8
- stop: boolean;
9
- reason?: string;
10
- };
11
- /**
12
- * Run the AFK loop.
13
- *
14
- * Executes the `clancy-once` script repeatedly up to `maxIterations` times,
15
- * checking for stop conditions after each run.
16
- *
17
- * @param scriptDir - The directory containing `clancy-once.js`.
18
- * @param maxIterations - Maximum number of iterations (default: 5).
19
- */
20
- export declare function runAfkLoop(scriptDir: string, maxIterations?: number): Promise<void>;
21
- //# sourceMappingURL=afk.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"afk.d.ts","sourceRoot":"","sources":["../../../src/scripts/afk/afk.ts"],"names":[],"mappings":"AAuBA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG;IAClD,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAiBA;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,EACjB,aAAa,SAAI,GAChB,OAAO,CAAC,IAAI,CAAC,CAuFf"}
@@ -1,118 +0,0 @@
1
- /**
2
- * Clancy AFK runner — loop mode.
3
- *
4
- * Runs the board-specific `clancy-once` script up to `MAX_ITERATIONS` times.
5
- * Detects stop conditions by parsing the script's stdout output.
6
- * Does NOT know about boards — board logic lives entirely in the once script.
7
- */
8
- import { spawnSync } from 'node:child_process';
9
- import { existsSync } from 'node:fs';
10
- import { dirname, join, resolve } from 'node:path';
11
- import { setTimeout as sleep } from 'node:timers/promises';
12
- import { fileURLToPath } from 'node:url';
13
- import { formatDuration } from '../../scripts/shared/format/format.js';
14
- import { bold, dim, green, red } from '../../utils/ansi/ansi.js';
15
- /** Stop condition patterns matched against script output. */
16
- const STOP_PATTERNS = {
17
- noTickets: /No tickets found|No issues found|All done/,
18
- skipped: /Ticket skipped/,
19
- preflightFail: /^✗ /m,
20
- };
21
- /**
22
- * Check whether the script output contains a stop condition.
23
- *
24
- * @param output - The captured stdout from a `clancy-once` run.
25
- * @returns An object with `stop` flag and optional `reason`.
26
- */
27
- export function checkStopCondition(output) {
28
- if (STOP_PATTERNS.noTickets.test(output)) {
29
- return { stop: true, reason: 'No more tickets — all done' };
30
- }
31
- if (STOP_PATTERNS.skipped.test(output)) {
32
- return {
33
- stop: true,
34
- reason: 'Ticket was skipped — update the ticket and re-run',
35
- };
36
- }
37
- if (STOP_PATTERNS.preflightFail.test(output)) {
38
- return { stop: true, reason: 'Preflight check failed' };
39
- }
40
- return { stop: false };
41
- }
42
- /**
43
- * Run the AFK loop.
44
- *
45
- * Executes the `clancy-once` script repeatedly up to `maxIterations` times,
46
- * checking for stop conditions after each run.
47
- *
48
- * @param scriptDir - The directory containing `clancy-once.js`.
49
- * @param maxIterations - Maximum number of iterations (default: 5).
50
- */
51
- export async function runAfkLoop(scriptDir, maxIterations = 5) {
52
- const onceScript = join(scriptDir, 'clancy-once.js');
53
- if (!existsSync(onceScript)) {
54
- console.error(red('✗ clancy-once.js not found in'), scriptDir);
55
- return;
56
- }
57
- console.log(dim('┌──────────────────────────────────────────────────────────┐'));
58
- console.log(dim('│') +
59
- bold(' 🤖 Clancy — AFK mode ') +
60
- dim('│'));
61
- console.log(dim('│') +
62
- dim(' "I\'m on it. Proceed to the abandoned warehouse." ') +
63
- dim('│'));
64
- console.log(dim('└──────────────────────────────────────────────────────────┘'));
65
- const loopStart = Date.now();
66
- for (let i = 1; i <= maxIterations; i++) {
67
- const iterStart = Date.now();
68
- console.log('');
69
- console.log(bold(`🔁 Iteration ${i}/${maxIterations}`));
70
- // stderr is inherited so errors are visible to the user in real time.
71
- // Exit codes are not checked — once.ts always exits 0 by design so that
72
- // a transient failure in one iteration does not halt the entire AFK run.
73
- // Stop conditions are explicit board-level signals parsed from stdout.
74
- const result = spawnSync('node', [onceScript], {
75
- encoding: 'utf8',
76
- stdio: ['inherit', 'pipe', 'inherit'],
77
- cwd: process.cwd(),
78
- env: { ...process.env, CLANCY_AFK_MODE: '1' },
79
- });
80
- const output = result.stdout ?? '';
81
- if (output) {
82
- process.stdout.write(output);
83
- }
84
- const iterElapsed = formatDuration(Date.now() - iterStart);
85
- if (result.error) {
86
- console.error(red(`✗ Failed to run clancy-once: ${result.error.message}`));
87
- return;
88
- }
89
- const condition = checkStopCondition(output);
90
- if (condition.stop) {
91
- const totalElapsed = formatDuration(Date.now() - loopStart);
92
- console.log('');
93
- console.log(dim(` Iteration ${i} took ${iterElapsed}`));
94
- console.log(`\n${condition.reason}`);
95
- console.log(dim(` Total: ${i} iteration${i > 1 ? 's' : ''} in ${totalElapsed}`));
96
- return;
97
- }
98
- console.log(dim(` Iteration ${i} took ${iterElapsed}`));
99
- // Brief pause between iterations
100
- if (i < maxIterations) {
101
- await sleep(2000);
102
- }
103
- }
104
- const totalElapsed = formatDuration(Date.now() - loopStart);
105
- console.log('');
106
- console.log(green(`🏁 Completed ${maxIterations} iterations`) +
107
- dim(` (${totalElapsed})`));
108
- console.log(dim(' "That\'s some good police work."'));
109
- console.log(dim(' Run clancy-afk again to continue.'));
110
- }
111
- // Main guard — self-execute when run directly (e.g. node .clancy/clancy-afk.js)
112
- if (process.argv[1] &&
113
- fileURLToPath(import.meta.url) === resolve(process.argv[1])) {
114
- const scriptDir = dirname(fileURLToPath(import.meta.url));
115
- const maxIterations = parseInt(process.env.MAX_ITERATIONS ?? '5', 10) || 5;
116
- runAfkLoop(scriptDir, maxIterations);
117
- }
118
- //# sourceMappingURL=afk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"afk.js","sourceRoot":"","sources":["../../../src/scripts/afk/afk.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAE7D,6DAA6D;AAC7D,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,2CAA2C;IACtD,OAAO,EAAE,gBAAgB;IACzB,aAAa,EAAE,MAAM;CACtB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAI/C,IAAI,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,4BAA4B,EAAE,CAAC;IAC9D,CAAC;IAED,IAAI,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACvC,OAAO;YACL,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,mDAAmD;SAC5D,CAAC;IACJ,CAAC;IAED,IAAI,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 @@
1
- import type { PingResult } from '../../../scripts/shared/http/http.js';
2
- import type { Ticket } from '../../../types/index.js';
3
- /** Reset the cached username. Exported for testing only. */
4
- export declare function resetUsernameCache(): void;
5
- /**
6
- * Validate that a GitHub repo string is in `owner/repo` format.
7
- *
8
- * @param repo - The repository string to validate.
9
- * @returns `true` if the string matches `owner/repo` with safe characters.
10
- */
11
- export declare function isValidRepo(repo: string): boolean;
12
- /**
13
- * Ping the GitHub API to verify connectivity and credentials.
14
- *
15
- * @param token - The GitHub personal access token.
16
- * @param repo - The repository in `owner/repo` format.
17
- * @returns An object with `ok` and optional `error` message.
18
- */
19
- export declare function pingGitHub(token: string, repo: string): Promise<PingResult>;
20
- /**
21
- * Resolve the authenticated GitHub username from the token.
22
- *
23
- * Uses `GET /user` and caches the result for the lifetime of the process.
24
- * Falls back to `@me` if the API call fails (classic PATs support `@me`).
25
- *
26
- * Fine-grained PATs do NOT resolve `@me` in the Issues API `assignee` param,
27
- * so this function ensures we always have the real username.
28
- *
29
- * @param token - The GitHub personal access token.
30
- * @returns The GitHub username, or `@me` as a fallback.
31
- */
32
- export declare function resolveUsername(token: string, apiBase?: string): Promise<string>;
33
- /**
34
- * Fetch the next available issue from GitHub Issues.
35
- *
36
- * Requests extra results to account for PR pollution (GitHub Issues endpoint
37
- * returns PRs too), then filters to real issues only.
38
- *
39
- * @param token - The GitHub personal access token.
40
- * @param repo - The repository in `owner/repo` format.
41
- * @param label - Optional label to filter issues.
42
- * @param username - The GitHub username for assignee filtering (resolved via {@link resolveUsername}).
43
- * @returns The fetched ticket with optional milestone, or `undefined` if none available.
44
- */
45
- export declare function fetchIssue(token: string, repo: string, label?: string, username?: string): Promise<(Ticket & {
46
- milestone?: string;
47
- }) | undefined>;
48
- /** GitHub issue with optional milestone. */
49
- export type GitHubTicket = Ticket & {
50
- milestone?: string;
51
- };
52
- /**
53
- * Fetch multiple candidate issues from GitHub Issues.
54
- *
55
- * @param token - The GitHub personal access token.
56
- * @param repo - The repository in `owner/repo` format.
57
- * @param label - Optional label to filter issues.
58
- * @param username - The GitHub username for assignee filtering.
59
- * @param excludeHitl - If `true`, excludes issues with the `clancy:hitl` label (client-side).
60
- * @param limit - Maximum number of results to return (default: 5).
61
- * @returns Array of fetched tickets (may be empty).
62
- */
63
- export declare function fetchIssues(token: string, repo: string, label?: string, username?: string, excludeHitl?: boolean, limit?: number): Promise<GitHubTicket[]>;
64
- /**
65
- * Check whether a GitHub issue is blocked by unresolved blockers.
66
- *
67
- * Parses the issue body for `Blocked by #N` lines and checks if any
68
- * of those issues are still open.
69
- *
70
- * @param token - The GitHub personal access token.
71
- * @param repo - The repository in `owner/repo` format.
72
- * @param issueNumber - The issue number to check.
73
- * @param body - The issue body text.
74
- * @returns `true` if any blocker is unresolved, `false` otherwise.
75
- */
76
- export declare function fetchBlockerStatus(token: string, repo: string, issueNumber: number, body: string): Promise<boolean>;
77
- /** Result of checking children status for an epic/milestone. */
78
- export type ChildrenStatus = {
79
- total: number;
80
- incomplete: number;
81
- };
82
- /**
83
- * Fetch the children status of a GitHub parent issue (dual-mode).
84
- *
85
- * Tries the `Epic: #{parentNumber}` text convention first. If no results,
86
- * falls back to the native `Parent: #{parentNumber}` convention for
87
- * backward compatibility with pre-v0.6.0 children.
88
- *
89
- * @param token - The GitHub personal access token.
90
- * @param repo - The repository in `owner/repo` format.
91
- * @param parentNumber - The parent issue number.
92
- * @returns The children status, or `undefined` on failure.
93
- */
94
- export declare function fetchChildrenStatus(token: string, repo: string, parentNumber: number): Promise<ChildrenStatus | undefined>;
95
- /**
96
- * Close a GitHub issue.
97
- *
98
- * @param token - The GitHub personal access token.
99
- * @param repo - The repository in `owner/repo` format.
100
- * @param issueNumber - The issue number to close.
101
- * @returns `true` if the issue was closed successfully.
102
- */
103
- export declare function closeIssue(token: string, repo: string, issueNumber: number): Promise<boolean>;
104
- //# sourceMappingURL=github.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../src/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