chief-clancy 0.5.2 → 0.5.4

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 (76) hide show
  1. package/README.md +3 -3
  2. package/dist/bundle/clancy-afk.js +2 -2
  3. package/dist/bundle/clancy-once.js +29 -28
  4. package/dist/schemas/env.d.ts +27 -0
  5. package/dist/schemas/env.d.ts.map +1 -1
  6. package/dist/schemas/env.js +8 -0
  7. package/dist/schemas/env.js.map +1 -1
  8. package/dist/scripts/afk/afk.d.ts.map +1 -1
  9. package/dist/scripts/afk/afk.js +1 -8
  10. package/dist/scripts/afk/afk.js.map +1 -1
  11. package/dist/scripts/board/github/github.d.ts +18 -1
  12. package/dist/scripts/board/github/github.d.ts.map +1 -1
  13. package/dist/scripts/board/github/github.js +55 -4
  14. package/dist/scripts/board/github/github.js.map +1 -1
  15. package/dist/scripts/board/linear/linear.d.ts.map +1 -1
  16. package/dist/scripts/board/linear/linear.js +35 -4
  17. package/dist/scripts/board/linear/linear.js.map +1 -1
  18. package/dist/scripts/once/once.d.ts.map +1 -1
  19. package/dist/scripts/once/once.js +208 -37
  20. package/dist/scripts/once/once.js.map +1 -1
  21. package/dist/scripts/shared/env-schema/env-schema.d.ts.map +1 -1
  22. package/dist/scripts/shared/env-schema/env-schema.js +3 -2
  23. package/dist/scripts/shared/env-schema/env-schema.js.map +1 -1
  24. package/dist/scripts/shared/format/format.d.ts +11 -0
  25. package/dist/scripts/shared/format/format.d.ts.map +1 -0
  26. package/dist/scripts/shared/format/format.js +18 -0
  27. package/dist/scripts/shared/format/format.js.map +1 -0
  28. package/dist/scripts/shared/git-ops/git-ops.d.ts +9 -0
  29. package/dist/scripts/shared/git-ops/git-ops.d.ts.map +1 -1
  30. package/dist/scripts/shared/git-ops/git-ops.js +20 -0
  31. package/dist/scripts/shared/git-ops/git-ops.js.map +1 -1
  32. package/dist/scripts/shared/http/http.d.ts +2 -0
  33. package/dist/scripts/shared/http/http.d.ts.map +1 -1
  34. package/dist/scripts/shared/http/http.js +2 -0
  35. package/dist/scripts/shared/http/http.js.map +1 -1
  36. package/dist/scripts/shared/progress/progress.d.ts +3 -2
  37. package/dist/scripts/shared/progress/progress.d.ts.map +1 -1
  38. package/dist/scripts/shared/progress/progress.js +1 -1
  39. package/dist/scripts/shared/progress/progress.js.map +1 -1
  40. package/dist/scripts/shared/pull-request/bitbucket/bitbucket.d.ts +38 -0
  41. package/dist/scripts/shared/pull-request/bitbucket/bitbucket.d.ts.map +1 -0
  42. package/dist/scripts/shared/pull-request/bitbucket/bitbucket.js +69 -0
  43. package/dist/scripts/shared/pull-request/bitbucket/bitbucket.js.map +1 -0
  44. package/dist/scripts/shared/pull-request/github/github.d.ts +15 -0
  45. package/dist/scripts/shared/pull-request/github/github.d.ts.map +1 -0
  46. package/dist/scripts/shared/pull-request/github/github.js +29 -0
  47. package/dist/scripts/shared/pull-request/github/github.js.map +1 -0
  48. package/dist/scripts/shared/pull-request/gitlab/gitlab.d.ts +23 -0
  49. package/dist/scripts/shared/pull-request/gitlab/gitlab.d.ts.map +1 -0
  50. package/dist/scripts/shared/pull-request/gitlab/gitlab.js +27 -0
  51. package/dist/scripts/shared/pull-request/gitlab/gitlab.js.map +1 -0
  52. package/dist/scripts/shared/pull-request/post-pr/post-pr.d.ts +31 -0
  53. package/dist/scripts/shared/pull-request/post-pr/post-pr.d.ts.map +1 -0
  54. package/dist/scripts/shared/pull-request/post-pr/post-pr.js +61 -0
  55. package/dist/scripts/shared/pull-request/post-pr/post-pr.js.map +1 -0
  56. package/dist/scripts/shared/pull-request/pr-body/pr-body.d.ts +19 -0
  57. package/dist/scripts/shared/pull-request/pr-body/pr-body.d.ts.map +1 -0
  58. package/dist/scripts/shared/pull-request/pr-body/pr-body.js +35 -0
  59. package/dist/scripts/shared/pull-request/pr-body/pr-body.js.map +1 -0
  60. package/dist/scripts/shared/remote/remote.d.ts +41 -0
  61. package/dist/scripts/shared/remote/remote.d.ts.map +1 -0
  62. package/dist/scripts/shared/remote/remote.js +227 -0
  63. package/dist/scripts/shared/remote/remote.js.map +1 -0
  64. package/dist/types/index.d.ts +1 -0
  65. package/dist/types/index.d.ts.map +1 -1
  66. package/dist/types/remote.d.ts +44 -0
  67. package/dist/types/remote.d.ts.map +1 -0
  68. package/dist/types/remote.js +5 -0
  69. package/dist/types/remote.js.map +1 -0
  70. package/package.json +1 -1
  71. package/src/roles/planner/workflows/plan.md +7 -1
  72. package/src/roles/reviewer/workflows/review.md +3 -1
  73. package/src/roles/reviewer/workflows/status.md +6 -1
  74. package/src/roles/setup/workflows/init.md +91 -0
  75. package/src/roles/setup/workflows/scaffold.md +27 -0
  76. package/src/roles/setup/workflows/settings.md +62 -0
@@ -0,0 +1,69 @@
1
+ import { basicAuth, postPullRequest } from '../post-pr/post-pr.js';
2
+ /**
3
+ * Create a pull request on Bitbucket Cloud.
4
+ *
5
+ * @param username - The Bitbucket username.
6
+ * @param token - The Bitbucket API token (or app password).
7
+ * @param workspace - The Bitbucket workspace slug.
8
+ * @param repoSlug - The repository slug.
9
+ * @param sourceBranch - The source branch name.
10
+ * @param targetBranch - The target branch name.
11
+ * @param title - The PR title.
12
+ * @param description - The PR body (markdown).
13
+ * @returns A result with the PR URL and ID on success, or an error message.
14
+ */
15
+ export async function createPullRequest(username, token, workspace, repoSlug, sourceBranch, targetBranch, title, description) {
16
+ return postPullRequest(`https://api.bitbucket.org/2.0/repositories/${workspace}/${repoSlug}/pullrequests`, { Authorization: basicAuth(username, token) }, {
17
+ title,
18
+ description,
19
+ source: { branch: { name: sourceBranch } },
20
+ destination: { branch: { name: targetBranch } },
21
+ close_source_branch: true,
22
+ }, (json) => {
23
+ const data = json;
24
+ return {
25
+ url: data.links?.html?.href ?? '',
26
+ number: data.id ?? 0,
27
+ };
28
+ }, (status, text) => status === 409 && text.includes('already exists'));
29
+ }
30
+ /**
31
+ * Create a pull request on Bitbucket Server / Data Center.
32
+ *
33
+ * @param token - The Bitbucket Server personal access token.
34
+ * @param apiBase - The API base URL (e.g. `https://bitbucket.acme.com/rest/api/1.0`).
35
+ * @param projectKey - The Bitbucket Server project key.
36
+ * @param repoSlug - The repository slug.
37
+ * @param sourceBranch - The source branch name.
38
+ * @param targetBranch - The target branch name.
39
+ * @param title - The PR title.
40
+ * @param description - The PR body.
41
+ * @returns A result with the PR URL and ID on success, or an error message.
42
+ */
43
+ export async function createServerPullRequest(token, apiBase, projectKey, repoSlug, sourceBranch, targetBranch, title, description) {
44
+ return postPullRequest(`${apiBase}/projects/${projectKey}/repos/${repoSlug}/pull-requests`, { Authorization: `Bearer ${token}` }, {
45
+ title,
46
+ description,
47
+ fromRef: {
48
+ id: `refs/heads/${sourceBranch}`,
49
+ repository: {
50
+ slug: repoSlug,
51
+ project: { key: projectKey },
52
+ },
53
+ },
54
+ toRef: {
55
+ id: `refs/heads/${targetBranch}`,
56
+ repository: {
57
+ slug: repoSlug,
58
+ project: { key: projectKey },
59
+ },
60
+ },
61
+ }, (json) => {
62
+ const data = json;
63
+ return {
64
+ url: data.links?.self?.[0]?.href ?? '',
65
+ number: data.id ?? 0,
66
+ };
67
+ }, (status, text) => status === 409 && text.includes('already exists'));
68
+ }
69
+ //# sourceMappingURL=bitbucket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bitbucket.js","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/bitbucket/bitbucket.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAAgB,EAChB,KAAa,EACb,SAAiB,EACjB,QAAgB,EAChB,YAAoB,EACpB,YAAoB,EACpB,KAAa,EACb,WAAmB;IAEnB,OAAO,eAAe,CACpB,8CAA8C,SAAS,IAAI,QAAQ,eAAe,EAClF,EAAE,aAAa,EAAE,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAC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,IAGZ,CAAC;QACF,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,EAAE;YACtC,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;SACrB,CAAC;IACJ,CAAC,EACD,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CACpE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { PrCreationResult } from '../../../../types/index.js';
2
+ /**
3
+ * Create a pull request on GitHub.
4
+ *
5
+ * @param token - The GitHub personal access token.
6
+ * @param repo - The repository in `owner/repo` format.
7
+ * @param head - The source branch name.
8
+ * @param base - The target branch name.
9
+ * @param title - The PR title.
10
+ * @param body - The PR body (markdown).
11
+ * @param apiBase - The API base URL (defaults to `https://api.github.com`).
12
+ * @returns A result with the PR URL and number on success, or an error message.
13
+ */
14
+ export declare function createPullRequest(token: string, repo: string, head: string, base: string, title: string, body: string, apiBase?: string): Promise<PrCreationResult>;
15
+ //# sourceMappingURL=github.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/github/github.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIzD;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,SAAa,GACnB,OAAO,CAAC,gBAAgB,CAAC,CAW3B"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * GitHub pull request creation.
3
+ *
4
+ * Uses the GitHub REST API to create pull requests.
5
+ * Supports both github.com and GitHub Enterprise (GHE).
6
+ *
7
+ * Auth: `Authorization: Bearer` header (personal access token with `repo` scope).
8
+ */
9
+ import { GITHUB_API, githubHeaders } from '../../../../scripts/shared/http/http.js';
10
+ import { postPullRequest } from '../post-pr/post-pr.js';
11
+ /**
12
+ * Create a pull request on GitHub.
13
+ *
14
+ * @param token - The GitHub personal access token.
15
+ * @param repo - The repository in `owner/repo` format.
16
+ * @param head - The source branch name.
17
+ * @param base - The target branch name.
18
+ * @param title - The PR title.
19
+ * @param body - The PR body (markdown).
20
+ * @param apiBase - The API base URL (defaults to `https://api.github.com`).
21
+ * @returns A result with the PR URL and number on success, or an error message.
22
+ */
23
+ export async function createPullRequest(token, repo, head, base, title, body, apiBase = GITHUB_API) {
24
+ return postPullRequest(`${apiBase}/repos/${repo}/pulls`, githubHeaders(token), { title, head, base, body }, (json) => {
25
+ const data = json;
26
+ return { url: data.html_url ?? '', number: data.number ?? 0 };
27
+ }, (status, text) => status === 422 && text.includes('already exists'));
28
+ }
29
+ //# sourceMappingURL=github.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github.js","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/github/github.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG1E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,KAAa,EACb,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,KAAa,EACb,IAAY,EACZ,OAAO,GAAG,UAAU;IAEpB,OAAO,eAAe,CACpB,GAAG,OAAO,UAAU,IAAI,QAAQ,EAChC,aAAa,CAAC,KAAK,CAAC,EACpB,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAC3B,CAAC,IAAI,EAAE,EAAE;QACP,MAAM,IAAI,GAAG,IAA8C,CAAC;QAC5D,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;IAChE,CAAC,EACD,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CACpE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * GitLab merge request creation.
3
+ *
4
+ * Uses the GitLab REST API v4 to create merge requests.
5
+ * Supports both gitlab.com and self-hosted instances.
6
+ *
7
+ * Auth: `PRIVATE-TOKEN` header (personal access token with `api` scope).
8
+ */
9
+ import type { PrCreationResult } from '../../../../types/index.js';
10
+ /**
11
+ * Create a merge request on GitLab.
12
+ *
13
+ * @param token - The GitLab personal access token.
14
+ * @param apiBase - The API base URL (e.g. `https://gitlab.com/api/v4`).
15
+ * @param projectPath - The raw project path (e.g. `group/subgroup/project`). URL-encoded internally.
16
+ * @param sourceBranch - The source branch name.
17
+ * @param targetBranch - The target branch name.
18
+ * @param title - The MR title.
19
+ * @param description - The MR body (markdown).
20
+ * @returns A result with the MR URL and IID on success, or an error message.
21
+ */
22
+ export declare function createMergeRequest(token: string, apiBase: string, projectPath: string, sourceBranch: string, targetBranch: string, title: string, description: string): Promise<PrCreationResult>;
23
+ //# sourceMappingURL=gitlab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitlab.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/gitlab/gitlab.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIzD;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,gBAAgB,CAAC,CAmB3B"}
@@ -0,0 +1,27 @@
1
+ import { postPullRequest } from '../post-pr/post-pr.js';
2
+ /**
3
+ * Create a merge request on GitLab.
4
+ *
5
+ * @param token - The GitLab personal access token.
6
+ * @param apiBase - The API base URL (e.g. `https://gitlab.com/api/v4`).
7
+ * @param projectPath - The raw project path (e.g. `group/subgroup/project`). URL-encoded internally.
8
+ * @param sourceBranch - The source branch name.
9
+ * @param targetBranch - The target branch name.
10
+ * @param title - The MR title.
11
+ * @param description - The MR body (markdown).
12
+ * @returns A result with the MR URL and IID on success, or an error message.
13
+ */
14
+ export async function createMergeRequest(token, apiBase, projectPath, sourceBranch, targetBranch, title, description) {
15
+ const encodedPath = encodeURIComponent(projectPath);
16
+ return postPullRequest(`${apiBase}/projects/${encodedPath}/merge_requests`, { 'PRIVATE-TOKEN': token }, {
17
+ source_branch: sourceBranch,
18
+ target_branch: targetBranch,
19
+ title,
20
+ description,
21
+ remove_source_branch: true,
22
+ }, (json) => {
23
+ const data = json;
24
+ return { url: data.web_url ?? '', number: data.iid ?? 0 };
25
+ }, (status, text) => status === 409 && text.includes('already exists'));
26
+ }
27
+ //# sourceMappingURL=gitlab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitlab.js","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/gitlab/gitlab.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,KAAa,EACb,OAAe,EACf,WAAmB,EACnB,YAAoB,EACpB,YAAoB,EACpB,KAAa,EACb,WAAmB;IAEnB,MAAM,WAAW,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAEpD,OAAO,eAAe,CACpB,GAAG,OAAO,aAAa,WAAW,iBAAiB,EACnD,EAAE,eAAe,EAAE,KAAK,EAAE,EAC1B;QACE,aAAa,EAAE,YAAY;QAC3B,aAAa,EAAE,YAAY;QAC3B,KAAK;QACL,WAAW;QACX,oBAAoB,EAAE,IAAI;KAC3B,EACD,CAAC,IAAI,EAAE,EAAE;QACP,MAAM,IAAI,GAAG,IAA0C,CAAC;QACxD,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;IAC5D,CAAC,EACD,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CACpE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Shared pull request creation utility.
3
+ *
4
+ * Wraps the common POST + error-handling pattern used by all three
5
+ * git host PR creation functions (GitHub, GitLab, Bitbucket).
6
+ */
7
+ import type { PrCreationResult } from '../../../../types/index.js';
8
+ /**
9
+ * POST a pull request / merge request and return a typed result.
10
+ *
11
+ * Handles the common try/catch, response parsing, error formatting,
12
+ * and "already exists" detection shared by all git host implementations.
13
+ *
14
+ * @param url - The API endpoint to POST to.
15
+ * @param headers - HTTP headers (including auth).
16
+ * @param body - The request body (JSON-serialised).
17
+ * @param parseSuccess - Extract `{ url, number }` from the success response JSON.
18
+ * @param isAlreadyExists - Optional check for duplicate PR detection.
19
+ * @returns A typed `PrCreationResult`.
20
+ */
21
+ export declare function postPullRequest(url: string, headers: Record<string, string>, body: Record<string, unknown>, parseSuccess: (json: unknown) => {
22
+ url: string;
23
+ number: number;
24
+ }, isAlreadyExists?: (status: number, text: string) => boolean): Promise<PrCreationResult>;
25
+ /**
26
+ * Build a Basic Auth header value from username and token.
27
+ *
28
+ * Used by Bitbucket Cloud which requires HTTP Basic Auth.
29
+ */
30
+ export declare function basicAuth(username: string, token: string): string;
31
+ //# sourceMappingURL=post-pr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post-pr.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/post-pr/post-pr.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAChE,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,GAC1D,OAAO,CAAC,gBAAgB,CAAC,CA0C3B;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjE"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * POST a pull request / merge request and return a typed result.
3
+ *
4
+ * Handles the common try/catch, response parsing, error formatting,
5
+ * and "already exists" detection shared by all git host implementations.
6
+ *
7
+ * @param url - The API endpoint to POST to.
8
+ * @param headers - HTTP headers (including auth).
9
+ * @param body - The request body (JSON-serialised).
10
+ * @param parseSuccess - Extract `{ url, number }` from the success response JSON.
11
+ * @param isAlreadyExists - Optional check for duplicate PR detection.
12
+ * @returns A typed `PrCreationResult`.
13
+ */
14
+ export async function postPullRequest(url, headers, body, parseSuccess, isAlreadyExists) {
15
+ const controller = new AbortController();
16
+ const timeout = setTimeout(() => controller.abort(), 30_000);
17
+ try {
18
+ const response = await fetch(url, {
19
+ method: 'POST',
20
+ headers: { ...headers, 'Content-Type': 'application/json' },
21
+ body: JSON.stringify(body),
22
+ signal: controller.signal,
23
+ });
24
+ if (!response.ok) {
25
+ const text = await response.text().catch(() => '');
26
+ const alreadyExists = isAlreadyExists?.(response.status, text) ?? false;
27
+ return {
28
+ ok: false,
29
+ error: `HTTP ${response.status}${text ? `: ${text.slice(0, 200)}` : ''}`,
30
+ alreadyExists,
31
+ };
32
+ }
33
+ const json = await response.json();
34
+ const parsed = parseSuccess(json);
35
+ if (!parsed.url && !parsed.number) {
36
+ return {
37
+ ok: false,
38
+ error: 'PR created but response missing URL and number',
39
+ };
40
+ }
41
+ return { ok: true, url: parsed.url, number: parsed.number };
42
+ }
43
+ catch (err) {
44
+ return {
45
+ ok: false,
46
+ error: err instanceof Error ? err.message : String(err),
47
+ };
48
+ }
49
+ finally {
50
+ clearTimeout(timeout);
51
+ }
52
+ }
53
+ /**
54
+ * Build a Basic Auth header value from username and token.
55
+ *
56
+ * Used by Bitbucket Cloud which requires HTTP Basic Auth.
57
+ */
58
+ export function basicAuth(username, token) {
59
+ return `Basic ${Buffer.from(`${username}:${token}`).toString('base64')}`;
60
+ }
61
+ //# sourceMappingURL=post-pr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post-pr.js","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/post-pr/post-pr.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,GAAW,EACX,OAA+B,EAC/B,IAA6B,EAC7B,YAAgE,EAChE,eAA2D;IAE3D,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC;IAE7D,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM;YACd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C,MAAM,CAAC,GAAG,CAAC;SACxD,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,QAAgB,EAAE,KAAa;IACvD,OAAO,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;AAC3E,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * PR/MR body builder.
3
+ *
4
+ * Constructs the pull request description with a link back to the
5
+ * board ticket and a Clancy footer.
6
+ */
7
+ import type { BoardConfig, Ticket } from '../../../../types/index.js';
8
+ /**
9
+ * Build the PR/MR body for a ticket.
10
+ *
11
+ * Includes a link back to the board ticket (auto-close for GitHub Issues)
12
+ * and a Clancy attribution footer.
13
+ *
14
+ * @param config - The board configuration.
15
+ * @param ticket - The ticket being implemented.
16
+ * @returns The PR body as a markdown string.
17
+ */
18
+ export declare function buildPrBody(config: BoardConfig, ticket: Ticket): string;
19
+ //# sourceMappingURL=pr-body.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pr-body.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/pr-body/pr-body.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CA8BvE"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Build the PR/MR body for a ticket.
3
+ *
4
+ * Includes a link back to the board ticket (auto-close for GitHub Issues)
5
+ * and a Clancy attribution footer.
6
+ *
7
+ * @param config - The board configuration.
8
+ * @param ticket - The ticket being implemented.
9
+ * @returns The PR body as a markdown string.
10
+ */
11
+ export function buildPrBody(config, ticket) {
12
+ const lines = [];
13
+ switch (config.provider) {
14
+ case 'github':
15
+ lines.push(`Closes ${ticket.key}`);
16
+ break;
17
+ case 'jira':
18
+ lines.push(`**Jira:** [${ticket.key}](${config.env.JIRA_BASE_URL}/browse/${ticket.key})`);
19
+ break;
20
+ case 'linear':
21
+ lines.push(`**Linear:** ${ticket.key}`);
22
+ break;
23
+ }
24
+ lines.push('');
25
+ if (ticket.description) {
26
+ lines.push('## Description');
27
+ lines.push('');
28
+ lines.push(ticket.description);
29
+ lines.push('');
30
+ }
31
+ lines.push('---');
32
+ lines.push('*Created by [Clancy](https://github.com/Pushedskydiver/clancy)*');
33
+ return lines.join('\n');
34
+ }
35
+ //# sourceMappingURL=pr-body.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pr-body.js","sourceRoot":"","sources":["../../../../../src/scripts/shared/pull-request/pr-body/pr-body.ts"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,MAAmB,EAAE,MAAc;IAC7D,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,QAAQ,MAAM,CAAC,QAAQ,EAAE,CAAC;QACxB,KAAK,QAAQ;YACX,KAAK,CAAC,IAAI,CAAC,UAAU,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;YACnC,MAAM;QACR,KAAK,MAAM;YACT,KAAK,CAAC,IAAI,CACR,cAAc,MAAM,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,aAAa,WAAW,MAAM,CAAC,GAAG,GAAG,CAC9E,CAAC;YACF,MAAM;QACR,KAAK,QAAQ;YACX,KAAK,CAAC,IAAI,CAAC,eAAe,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;YACxC,MAAM;IACV,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IAE9E,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,41 @@
1
+ import type { GitPlatform, RemoteInfo } from '../../../types/index.js';
2
+ /**
3
+ * Parse a git remote URL into platform-specific info.
4
+ *
5
+ * Supports HTTPS, SSH, and SSH-URL formats for GitHub, GitLab, Bitbucket
6
+ * (Cloud and Server), Azure DevOps, and self-hosted instances.
7
+ *
8
+ * @param rawUrl - The raw git remote URL.
9
+ * @returns Parsed remote info with platform and path details.
10
+ */
11
+ export declare function parseRemote(rawUrl: string): RemoteInfo;
12
+ /**
13
+ * Detect the git hosting platform from a hostname.
14
+ *
15
+ * Uses known domain patterns. Self-hosted instances with custom domains
16
+ * (e.g. `git.acme.com`) fall through to 'unknown' — use `CLANCY_GIT_PLATFORM`
17
+ * env var to override.
18
+ *
19
+ * @param hostname - The hostname from the remote URL.
20
+ * @returns The detected platform.
21
+ */
22
+ export declare function detectPlatformFromHostname(hostname: string): GitPlatform;
23
+ /**
24
+ * Detect the remote origin info from the current git repository.
25
+ *
26
+ * Falls back to `{ host: 'none' }` if no remote is configured or
27
+ * if the command fails.
28
+ *
29
+ * @param platformOverride - Override platform detection (from `CLANCY_GIT_PLATFORM` env var).
30
+ * @returns Parsed remote info.
31
+ */
32
+ export declare function detectRemote(platformOverride?: string): RemoteInfo;
33
+ /**
34
+ * Build the API base URL for a given remote.
35
+ *
36
+ * @param remote - The parsed remote info.
37
+ * @param apiUrlOverride - Override from `CLANCY_GIT_API_URL` env var.
38
+ * @returns The API base URL, or undefined if not applicable.
39
+ */
40
+ export declare function buildApiBaseUrl(remote: RemoteInfo, apiUrlOverride?: string): string | undefined;
41
+ //# sourceMappingURL=remote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../../../src/scripts/shared/remote/remote.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAgChE;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAgEtD;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAWxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,UAAU,CAmBlE;AAgED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,UAAU,EAClB,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,GAAG,SAAS,CAiBpB"}
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Remote git host detection.
3
+ *
4
+ * Parses `git remote get-url origin` to detect the hosting platform
5
+ * (GitHub, GitLab, Bitbucket, etc.) and extract owner/repo/project info.
6
+ */
7
+ import { execFileSync } from 'node:child_process';
8
+ /**
9
+ * Extract hostname and path from a raw git remote URL.
10
+ *
11
+ * Strips `.git` suffix, then tries SSH (`git@host:path`) and
12
+ * HTTPS/SSH-URL (`https://host/path`, `ssh://git@host/path`) formats.
13
+ *
14
+ * @param rawUrl - The raw git remote URL.
15
+ * @returns The extracted hostname and path, or `undefined` if unparseable.
16
+ */
17
+ function extractHostAndPath(rawUrl) {
18
+ const url = rawUrl.trim().replace(/\.git$/, '');
19
+ // SSH format: git@<host>:<path>
20
+ const sshMatch = url.match(/^git@([^:]+):(.+)$/);
21
+ // HTTPS or SSH-URL format: https://<host>/<path> or ssh://git@<host>/<path>
22
+ const httpsMatch = url.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/:]+)(?::\d+)?\/(.+)$/);
23
+ const hostname = sshMatch?.[1] ?? httpsMatch?.[1];
24
+ const path = sshMatch?.[2] ?? httpsMatch?.[2];
25
+ if (!hostname || !path)
26
+ return undefined;
27
+ return { hostname, path };
28
+ }
29
+ /**
30
+ * Parse a git remote URL into platform-specific info.
31
+ *
32
+ * Supports HTTPS, SSH, and SSH-URL formats for GitHub, GitLab, Bitbucket
33
+ * (Cloud and Server), Azure DevOps, and self-hosted instances.
34
+ *
35
+ * @param rawUrl - The raw git remote URL.
36
+ * @returns Parsed remote info with platform and path details.
37
+ */
38
+ export function parseRemote(rawUrl) {
39
+ const extracted = extractHostAndPath(rawUrl);
40
+ if (!extracted) {
41
+ return { host: 'unknown', url: rawUrl };
42
+ }
43
+ const { hostname, path } = extracted;
44
+ const platform = detectPlatformFromHostname(hostname);
45
+ switch (platform) {
46
+ case 'github': {
47
+ const parts = path.split('/');
48
+ if (parts.length >= 2) {
49
+ return {
50
+ host: 'github',
51
+ owner: parts[0],
52
+ repo: parts[1],
53
+ hostname,
54
+ };
55
+ }
56
+ return { host: 'unknown', url: rawUrl };
57
+ }
58
+ case 'gitlab': {
59
+ return {
60
+ host: 'gitlab',
61
+ projectPath: path,
62
+ hostname,
63
+ };
64
+ }
65
+ case 'bitbucket': {
66
+ // Bitbucket Server uses /scm/<projectKey>/<repo> format
67
+ const scmMatch = path.match(/^scm\/([^/]+)\/(.+)$/);
68
+ if (scmMatch) {
69
+ return {
70
+ host: 'bitbucket-server',
71
+ projectKey: scmMatch[1],
72
+ repoSlug: scmMatch[2],
73
+ hostname,
74
+ };
75
+ }
76
+ // Bitbucket Cloud: <workspace>/<repo>
77
+ const parts = path.split('/');
78
+ if (parts.length >= 2) {
79
+ return {
80
+ host: 'bitbucket',
81
+ workspace: parts[0],
82
+ repoSlug: parts[1],
83
+ hostname,
84
+ };
85
+ }
86
+ return { host: 'unknown', url: rawUrl };
87
+ }
88
+ case 'azure':
89
+ return { host: 'azure', url: rawUrl };
90
+ default:
91
+ return { host: 'unknown', url: rawUrl };
92
+ }
93
+ }
94
+ /**
95
+ * Detect the git hosting platform from a hostname.
96
+ *
97
+ * Uses known domain patterns. Self-hosted instances with custom domains
98
+ * (e.g. `git.acme.com`) fall through to 'unknown' — use `CLANCY_GIT_PLATFORM`
99
+ * env var to override.
100
+ *
101
+ * @param hostname - The hostname from the remote URL.
102
+ * @returns The detected platform.
103
+ */
104
+ export function detectPlatformFromHostname(hostname) {
105
+ const lower = hostname.toLowerCase();
106
+ if (lower === 'github.com' || lower.includes('github'))
107
+ return 'github';
108
+ if (lower === 'gitlab.com' || lower.includes('gitlab'))
109
+ return 'gitlab';
110
+ if (lower === 'bitbucket.org' || lower.includes('bitbucket'))
111
+ return 'bitbucket';
112
+ if (lower.includes('dev.azure') || lower.includes('visualstudio'))
113
+ return 'azure';
114
+ return 'unknown';
115
+ }
116
+ /**
117
+ * Detect the remote origin info from the current git repository.
118
+ *
119
+ * Falls back to `{ host: 'none' }` if no remote is configured or
120
+ * if the command fails.
121
+ *
122
+ * @param platformOverride - Override platform detection (from `CLANCY_GIT_PLATFORM` env var).
123
+ * @returns Parsed remote info.
124
+ */
125
+ export function detectRemote(platformOverride) {
126
+ let rawUrl;
127
+ try {
128
+ rawUrl = execFileSync('git', ['remote', 'get-url', 'origin'], {
129
+ encoding: 'utf8',
130
+ }).trim();
131
+ }
132
+ catch {
133
+ return { host: 'none' };
134
+ }
135
+ if (!rawUrl)
136
+ return { host: 'none' };
137
+ // If user explicitly overrides the platform, always use it — they know better
138
+ if (platformOverride) {
139
+ return overrideRemotePlatform(rawUrl, platformOverride);
140
+ }
141
+ return parseRemote(rawUrl);
142
+ }
143
+ /**
144
+ * Re-parse a remote URL with a known platform override.
145
+ *
146
+ * Used when auto-detection fails (self-hosted with custom domain)
147
+ * and the user sets `CLANCY_GIT_PLATFORM`.
148
+ */
149
+ function overrideRemotePlatform(rawUrl, platform) {
150
+ const extracted = extractHostAndPath(rawUrl);
151
+ if (!extracted)
152
+ return { host: 'unknown', url: rawUrl };
153
+ const { hostname, path } = extracted;
154
+ switch (platform.toLowerCase()) {
155
+ case 'github': {
156
+ const parts = path.split('/');
157
+ if (parts.length >= 2) {
158
+ return { host: 'github', owner: parts[0], repo: parts[1], hostname };
159
+ }
160
+ return { host: 'unknown', url: rawUrl };
161
+ }
162
+ case 'gitlab':
163
+ return { host: 'gitlab', projectPath: path, hostname };
164
+ case 'bitbucket': {
165
+ const parts = path.split('/');
166
+ if (parts.length >= 2) {
167
+ return {
168
+ host: 'bitbucket',
169
+ workspace: parts[0],
170
+ repoSlug: parts[1],
171
+ hostname,
172
+ };
173
+ }
174
+ return { host: 'unknown', url: rawUrl };
175
+ }
176
+ case 'bitbucket-server': {
177
+ // Strip leading scm/ prefix used in Bitbucket Server URLs
178
+ const scmMatch = path.match(/^scm\/([^/]+)\/(.+)$/);
179
+ if (scmMatch) {
180
+ return {
181
+ host: 'bitbucket-server',
182
+ projectKey: scmMatch[1],
183
+ repoSlug: scmMatch[2],
184
+ hostname,
185
+ };
186
+ }
187
+ const parts = path.split('/');
188
+ if (parts.length >= 2) {
189
+ return {
190
+ host: 'bitbucket-server',
191
+ projectKey: parts[0],
192
+ repoSlug: parts[1],
193
+ hostname,
194
+ };
195
+ }
196
+ return { host: 'unknown', url: rawUrl };
197
+ }
198
+ default:
199
+ return { host: 'unknown', url: rawUrl };
200
+ }
201
+ }
202
+ /**
203
+ * Build the API base URL for a given remote.
204
+ *
205
+ * @param remote - The parsed remote info.
206
+ * @param apiUrlOverride - Override from `CLANCY_GIT_API_URL` env var.
207
+ * @returns The API base URL, or undefined if not applicable.
208
+ */
209
+ export function buildApiBaseUrl(remote, apiUrlOverride) {
210
+ if (apiUrlOverride)
211
+ return apiUrlOverride.replace(/\/$/, '');
212
+ switch (remote.host) {
213
+ case 'github':
214
+ return remote.hostname === 'github.com'
215
+ ? 'https://api.github.com'
216
+ : `https://${remote.hostname}/api/v3`;
217
+ case 'gitlab':
218
+ return `https://${remote.hostname}/api/v4`;
219
+ case 'bitbucket':
220
+ return 'https://api.bitbucket.org/2.0';
221
+ case 'bitbucket-server':
222
+ return `https://${remote.hostname}/rest/api/1.0`;
223
+ default:
224
+ return undefined;
225
+ }
226
+ }
227
+ //# sourceMappingURL=remote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote.js","sourceRoot":"","sources":["../../../../src/scripts/shared/remote/remote.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD;;;;;;;;GAQG;AACH,SAAS,kBAAkB,CACzB,MAAc;IAEd,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAEhD,gCAAgC;IAChC,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAEjD,4EAA4E;IAC5E,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAC1B,yDAAyD,CAC1D,CAAC;IAEF,MAAM,QAAQ,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;IAE9C,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAEzC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAE7C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,EA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OAAO,cAAc,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAE7D,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,QAAQ,KAAK,YAAY;gBACrC,CAAC,CAAC,wBAAwB;gBAC1B,CAAC,CAAC,WAAW,MAAM,CAAC,QAAQ,SAAS,CAAC;QAC1C,KAAK,QAAQ;YACX,OAAO,WAAW,MAAM,CAAC,QAAQ,SAAS,CAAC;QAC7C,KAAK,WAAW;YACd,OAAO,+BAA+B,CAAC;QACzC,KAAK,kBAAkB;YACrB,OAAO,WAAW,MAAM,CAAC,QAAQ,eAAe,CAAC;QACnD;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export type { BoardProvider, Ticket } from './board.js';
2
+ export type { GitPlatform, PrCreationResult, ProgressStatus, RemoteInfo, } from './remote.js';
2
3
  export type { BoardConfig, GitHubEnv, JiraEnv, LinearEnv, SharedEnv, } from '../schemas/env.js';
3
4
  //# sourceMappingURL=index.d.ts.map