@chief-clancy/core 0.1.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/LICENSE +21 -0
- package/README.md +50 -0
- package/dist/board/azdo/api/api.d.ts +95 -0
- package/dist/board/azdo/api/api.d.ts.map +1 -0
- package/dist/board/azdo/api/api.js +173 -0
- package/dist/board/azdo/api/api.js.map +1 -0
- package/dist/board/azdo/api/helpers.d.ts +89 -0
- package/dist/board/azdo/api/helpers.d.ts.map +1 -0
- package/dist/board/azdo/api/helpers.js +133 -0
- package/dist/board/azdo/api/helpers.js.map +1 -0
- package/dist/board/azdo/api/index.d.ts +5 -0
- package/dist/board/azdo/api/index.d.ts.map +1 -0
- package/dist/board/azdo/api/index.js +3 -0
- package/dist/board/azdo/api/index.js.map +1 -0
- package/dist/board/azdo/azdo-board.d.ts +12 -0
- package/dist/board/azdo/azdo-board.d.ts.map +1 -0
- package/dist/board/azdo/azdo-board.js +104 -0
- package/dist/board/azdo/azdo-board.js.map +1 -0
- package/dist/board/azdo/index.d.ts +3 -0
- package/dist/board/azdo/index.d.ts.map +1 -0
- package/dist/board/azdo/index.js +3 -0
- package/dist/board/azdo/index.js.map +1 -0
- package/dist/board/azdo/labels/index.d.ts +2 -0
- package/dist/board/azdo/labels/index.d.ts.map +1 -0
- package/dist/board/azdo/labels/index.js +2 -0
- package/dist/board/azdo/labels/index.js.map +1 -0
- package/dist/board/azdo/labels/labels.d.ts +27 -0
- package/dist/board/azdo/labels/labels.d.ts.map +1 -0
- package/dist/board/azdo/labels/labels.js +64 -0
- package/dist/board/azdo/labels/labels.js.map +1 -0
- package/dist/board/azdo/relations/index.d.ts +2 -0
- package/dist/board/azdo/relations/index.d.ts.map +1 -0
- package/dist/board/azdo/relations/index.js +2 -0
- package/dist/board/azdo/relations/index.js.map +1 -0
- package/dist/board/azdo/relations/relations.d.ts +37 -0
- package/dist/board/azdo/relations/relations.d.ts.map +1 -0
- package/dist/board/azdo/relations/relations.js +109 -0
- package/dist/board/azdo/relations/relations.js.map +1 -0
- package/dist/board/detect-board.d.ts +28 -0
- package/dist/board/detect-board.d.ts.map +1 -0
- package/dist/board/detect-board.js +80 -0
- package/dist/board/detect-board.js.map +1 -0
- package/dist/board/factory/factory.d.ts +18 -0
- package/dist/board/factory/factory.d.ts.map +1 -0
- package/dist/board/factory/factory.js +34 -0
- package/dist/board/factory/factory.js.map +1 -0
- package/dist/board/factory/index.d.ts +2 -0
- package/dist/board/factory/index.d.ts.map +1 -0
- package/dist/board/factory/index.js +2 -0
- package/dist/board/factory/index.js.map +1 -0
- package/dist/board/github/api/api.d.ts +86 -0
- package/dist/board/github/api/api.d.ts.map +1 -0
- package/dist/board/github/api/api.js +161 -0
- package/dist/board/github/api/api.js.map +1 -0
- package/dist/board/github/api/index.d.ts +3 -0
- package/dist/board/github/api/index.d.ts.map +1 -0
- package/dist/board/github/api/index.js +2 -0
- package/dist/board/github/api/index.js.map +1 -0
- package/dist/board/github/github-board.d.ts +19 -0
- package/dist/board/github/github-board.d.ts.map +1 -0
- package/dist/board/github/github-board.js +104 -0
- package/dist/board/github/github-board.js.map +1 -0
- package/dist/board/github/index.d.ts +3 -0
- package/dist/board/github/index.d.ts.map +1 -0
- package/dist/board/github/index.js +3 -0
- package/dist/board/github/index.js.map +1 -0
- package/dist/board/github/labels/index.d.ts +2 -0
- package/dist/board/github/labels/index.d.ts.map +1 -0
- package/dist/board/github/labels/index.js +2 -0
- package/dist/board/github/labels/index.js.map +1 -0
- package/dist/board/github/labels/labels.d.ts +42 -0
- package/dist/board/github/labels/labels.d.ts.map +1 -0
- package/dist/board/github/labels/labels.js +93 -0
- package/dist/board/github/labels/labels.js.map +1 -0
- package/dist/board/github/relations/index.d.ts +2 -0
- package/dist/board/github/relations/index.d.ts.map +1 -0
- package/dist/board/github/relations/index.js +2 -0
- package/dist/board/github/relations/index.js.map +1 -0
- package/dist/board/github/relations/relations.d.ts +54 -0
- package/dist/board/github/relations/relations.d.ts.map +1 -0
- package/dist/board/github/relations/relations.js +152 -0
- package/dist/board/github/relations/relations.js.map +1 -0
- package/dist/board/index.d.ts +2 -0
- package/dist/board/index.d.ts.map +1 -0
- package/dist/board/index.js +2 -0
- package/dist/board/index.js.map +1 -0
- package/dist/board/jira/api/api.d.ts +129 -0
- package/dist/board/jira/api/api.d.ts.map +1 -0
- package/dist/board/jira/api/api.js +207 -0
- package/dist/board/jira/api/api.js.map +1 -0
- package/dist/board/jira/api/index.d.ts +3 -0
- package/dist/board/jira/api/index.d.ts.map +1 -0
- package/dist/board/jira/api/index.js +2 -0
- package/dist/board/jira/api/index.js.map +1 -0
- package/dist/board/jira/index.d.ts +3 -0
- package/dist/board/jira/index.d.ts.map +1 -0
- package/dist/board/jira/index.js +3 -0
- package/dist/board/jira/index.js.map +1 -0
- package/dist/board/jira/jira-board.d.ts +12 -0
- package/dist/board/jira/jira-board.d.ts.map +1 -0
- package/dist/board/jira/jira-board.js +112 -0
- package/dist/board/jira/jira-board.js.map +1 -0
- package/dist/board/jira/labels/index.d.ts +2 -0
- package/dist/board/jira/labels/index.d.ts.map +1 -0
- package/dist/board/jira/labels/index.js +2 -0
- package/dist/board/jira/labels/index.js.map +1 -0
- package/dist/board/jira/labels/labels.d.ts +34 -0
- package/dist/board/jira/labels/labels.d.ts.map +1 -0
- package/dist/board/jira/labels/labels.js +69 -0
- package/dist/board/jira/labels/labels.js.map +1 -0
- package/dist/board/jira/relations/index.d.ts +2 -0
- package/dist/board/jira/relations/index.d.ts.map +1 -0
- package/dist/board/jira/relations/index.js +2 -0
- package/dist/board/jira/relations/index.js.map +1 -0
- package/dist/board/jira/relations/relations.d.ts +44 -0
- package/dist/board/jira/relations/relations.d.ts.map +1 -0
- package/dist/board/jira/relations/relations.js +111 -0
- package/dist/board/jira/relations/relations.js.map +1 -0
- package/dist/board/linear/api/api.d.ts +68 -0
- package/dist/board/linear/api/api.d.ts.map +1 -0
- package/dist/board/linear/api/api.js +179 -0
- package/dist/board/linear/api/api.js.map +1 -0
- package/dist/board/linear/api/index.d.ts +2 -0
- package/dist/board/linear/api/index.d.ts.map +1 -0
- package/dist/board/linear/api/index.js +2 -0
- package/dist/board/linear/api/index.js.map +1 -0
- package/dist/board/linear/index.d.ts +3 -0
- package/dist/board/linear/index.d.ts.map +1 -0
- package/dist/board/linear/index.js +3 -0
- package/dist/board/linear/index.js.map +1 -0
- package/dist/board/linear/labels/index.d.ts +2 -0
- package/dist/board/linear/labels/index.d.ts.map +1 -0
- package/dist/board/linear/labels/index.js +2 -0
- package/dist/board/linear/labels/index.js.map +1 -0
- package/dist/board/linear/labels/labels.d.ts +63 -0
- package/dist/board/linear/labels/labels.d.ts.map +1 -0
- package/dist/board/linear/labels/labels.js +204 -0
- package/dist/board/linear/labels/labels.js.map +1 -0
- package/dist/board/linear/linear-board.d.ts +18 -0
- package/dist/board/linear/linear-board.d.ts.map +1 -0
- package/dist/board/linear/linear-board.js +115 -0
- package/dist/board/linear/linear-board.js.map +1 -0
- package/dist/board/linear/relations/index.d.ts +2 -0
- package/dist/board/linear/relations/index.d.ts.map +1 -0
- package/dist/board/linear/relations/index.js +2 -0
- package/dist/board/linear/relations/index.js.map +1 -0
- package/dist/board/linear/relations/relations.d.ts +67 -0
- package/dist/board/linear/relations/relations.d.ts.map +1 -0
- package/dist/board/linear/relations/relations.js +195 -0
- package/dist/board/linear/relations/relations.js.map +1 -0
- package/dist/board/notion/api/api.d.ts +83 -0
- package/dist/board/notion/api/api.d.ts.map +1 -0
- package/dist/board/notion/api/api.js +124 -0
- package/dist/board/notion/api/api.js.map +1 -0
- package/dist/board/notion/api/helpers.d.ts +105 -0
- package/dist/board/notion/api/helpers.d.ts.map +1 -0
- package/dist/board/notion/api/helpers.js +175 -0
- package/dist/board/notion/api/helpers.js.map +1 -0
- package/dist/board/notion/api/index.d.ts +4 -0
- package/dist/board/notion/api/index.d.ts.map +1 -0
- package/dist/board/notion/api/index.js +3 -0
- package/dist/board/notion/api/index.js.map +1 -0
- package/dist/board/notion/index.d.ts +3 -0
- package/dist/board/notion/index.d.ts.map +1 -0
- package/dist/board/notion/index.js +3 -0
- package/dist/board/notion/index.js.map +1 -0
- package/dist/board/notion/labels/index.d.ts +2 -0
- package/dist/board/notion/labels/index.d.ts.map +1 -0
- package/dist/board/notion/labels/index.js +2 -0
- package/dist/board/notion/labels/index.js.map +1 -0
- package/dist/board/notion/labels/labels.d.ts +30 -0
- package/dist/board/notion/labels/labels.d.ts.map +1 -0
- package/dist/board/notion/labels/labels.js +56 -0
- package/dist/board/notion/labels/labels.js.map +1 -0
- package/dist/board/notion/notion-board.d.ts +12 -0
- package/dist/board/notion/notion-board.d.ts.map +1 -0
- package/dist/board/notion/notion-board.js +156 -0
- package/dist/board/notion/notion-board.js.map +1 -0
- package/dist/board/notion/relations/index.d.ts +2 -0
- package/dist/board/notion/relations/index.d.ts.map +1 -0
- package/dist/board/notion/relations/index.js +2 -0
- package/dist/board/notion/relations/index.js.map +1 -0
- package/dist/board/notion/relations/relations.d.ts +43 -0
- package/dist/board/notion/relations/relations.d.ts.map +1 -0
- package/dist/board/notion/relations/relations.js +127 -0
- package/dist/board/notion/relations/relations.js.map +1 -0
- package/dist/board/shortcut/api/api.d.ts +110 -0
- package/dist/board/shortcut/api/api.d.ts.map +1 -0
- package/dist/board/shortcut/api/api.js +227 -0
- package/dist/board/shortcut/api/api.js.map +1 -0
- package/dist/board/shortcut/api/index.d.ts +2 -0
- package/dist/board/shortcut/api/index.d.ts.map +1 -0
- package/dist/board/shortcut/api/index.js +2 -0
- package/dist/board/shortcut/api/index.js.map +1 -0
- package/dist/board/shortcut/index.d.ts +3 -0
- package/dist/board/shortcut/index.d.ts.map +1 -0
- package/dist/board/shortcut/index.js +3 -0
- package/dist/board/shortcut/index.js.map +1 -0
- package/dist/board/shortcut/labels/index.d.ts +2 -0
- package/dist/board/shortcut/labels/index.d.ts.map +1 -0
- package/dist/board/shortcut/labels/index.js +2 -0
- package/dist/board/shortcut/labels/index.js.map +1 -0
- package/dist/board/shortcut/labels/labels.d.ts +95 -0
- package/dist/board/shortcut/labels/labels.d.ts.map +1 -0
- package/dist/board/shortcut/labels/labels.js +154 -0
- package/dist/board/shortcut/labels/labels.js.map +1 -0
- package/dist/board/shortcut/relations/index.d.ts +2 -0
- package/dist/board/shortcut/relations/index.d.ts.map +1 -0
- package/dist/board/shortcut/relations/index.js +2 -0
- package/dist/board/shortcut/relations/index.js.map +1 -0
- package/dist/board/shortcut/relations/relations.d.ts +44 -0
- package/dist/board/shortcut/relations/relations.d.ts.map +1 -0
- package/dist/board/shortcut/relations/relations.js +118 -0
- package/dist/board/shortcut/relations/relations.js.map +1 -0
- package/dist/board/shortcut/shortcut-board.d.ts +18 -0
- package/dist/board/shortcut/shortcut-board.d.ts.map +1 -0
- package/dist/board/shortcut/shortcut-board.js +143 -0
- package/dist/board/shortcut/shortcut-board.js.map +1 -0
- package/dist/dev/lifecycle/branch/branch.d.ts +35 -0
- package/dist/dev/lifecycle/branch/branch.d.ts.map +1 -0
- package/dist/dev/lifecycle/branch/branch.js +48 -0
- package/dist/dev/lifecycle/branch/branch.js.map +1 -0
- package/dist/dev/lifecycle/branch/index.d.ts +2 -0
- package/dist/dev/lifecycle/branch/index.d.ts.map +1 -0
- package/dist/dev/lifecycle/branch/index.js +2 -0
- package/dist/dev/lifecycle/branch/index.js.map +1 -0
- package/dist/dev/lifecycle/commit-type/commit-type.d.ts +22 -0
- package/dist/dev/lifecycle/commit-type/commit-type.d.ts.map +1 -0
- package/dist/dev/lifecycle/commit-type/commit-type.js +50 -0
- package/dist/dev/lifecycle/commit-type/commit-type.js.map +1 -0
- package/dist/dev/lifecycle/commit-type/index.d.ts +2 -0
- package/dist/dev/lifecycle/commit-type/index.d.ts.map +1 -0
- package/dist/dev/lifecycle/commit-type/index.js +2 -0
- package/dist/dev/lifecycle/commit-type/index.js.map +1 -0
- package/dist/dev/lifecycle/cost/cost.d.ts +28 -0
- package/dist/dev/lifecycle/cost/cost.d.ts.map +1 -0
- package/dist/dev/lifecycle/cost/cost.js +36 -0
- package/dist/dev/lifecycle/cost/cost.js.map +1 -0
- package/dist/dev/lifecycle/deliver-epic/deliver-epic.d.ts +44 -0
- package/dist/dev/lifecycle/deliver-epic/deliver-epic.d.ts.map +1 -0
- package/dist/dev/lifecycle/deliver-epic/deliver-epic.js +75 -0
- package/dist/dev/lifecycle/deliver-epic/deliver-epic.js.map +1 -0
- package/dist/dev/lifecycle/deliver-ticket/deliver-ticket.d.ts +51 -0
- package/dist/dev/lifecycle/deliver-ticket/deliver-ticket.d.ts.map +1 -0
- package/dist/dev/lifecycle/deliver-ticket/deliver-ticket.js +132 -0
- package/dist/dev/lifecycle/deliver-ticket/deliver-ticket.js.map +1 -0
- package/dist/dev/lifecycle/epic/epic.d.ts +66 -0
- package/dist/dev/lifecycle/epic/epic.d.ts.map +1 -0
- package/dist/dev/lifecycle/epic/epic.js +91 -0
- package/dist/dev/lifecycle/epic/epic.js.map +1 -0
- package/dist/dev/lifecycle/epic/index.d.ts +2 -0
- package/dist/dev/lifecycle/epic/index.d.ts.map +1 -0
- package/dist/dev/lifecycle/epic/index.js +2 -0
- package/dist/dev/lifecycle/epic/index.js.map +1 -0
- package/dist/dev/lifecycle/feasibility/feasibility.d.ts +55 -0
- package/dist/dev/lifecycle/feasibility/feasibility.d.ts.map +1 -0
- package/dist/dev/lifecycle/feasibility/feasibility.js +75 -0
- package/dist/dev/lifecycle/feasibility/feasibility.js.map +1 -0
- package/dist/dev/lifecycle/fetch-ticket/fetch-ticket.d.ts +49 -0
- package/dist/dev/lifecycle/fetch-ticket/fetch-ticket.d.ts.map +1 -0
- package/dist/dev/lifecycle/fetch-ticket/fetch-ticket.js +81 -0
- package/dist/dev/lifecycle/fetch-ticket/fetch-ticket.js.map +1 -0
- package/dist/dev/lifecycle/format/format.d.ts +11 -0
- package/dist/dev/lifecycle/format/format.d.ts.map +1 -0
- package/dist/dev/lifecycle/format/format.js +23 -0
- package/dist/dev/lifecycle/format/format.js.map +1 -0
- package/dist/dev/lifecycle/lock/index.d.ts +3 -0
- package/dist/dev/lifecycle/lock/index.d.ts.map +1 -0
- package/dist/dev/lifecycle/lock/index.js +2 -0
- package/dist/dev/lifecycle/lock/index.js.map +1 -0
- package/dist/dev/lifecycle/lock/lock.d.ts +68 -0
- package/dist/dev/lifecycle/lock/lock.d.ts.map +1 -0
- package/dist/dev/lifecycle/lock/lock.js +125 -0
- package/dist/dev/lifecycle/lock/lock.js.map +1 -0
- package/dist/dev/lifecycle/outcome/index.d.ts +2 -0
- package/dist/dev/lifecycle/outcome/index.d.ts.map +1 -0
- package/dist/dev/lifecycle/outcome/index.js +2 -0
- package/dist/dev/lifecycle/outcome/index.js.map +1 -0
- package/dist/dev/lifecycle/outcome/outcome.d.ts +65 -0
- package/dist/dev/lifecycle/outcome/outcome.d.ts.map +1 -0
- package/dist/dev/lifecycle/outcome/outcome.js +61 -0
- package/dist/dev/lifecycle/outcome/outcome.js.map +1 -0
- package/dist/dev/lifecycle/pr-creation/index.d.ts +3 -0
- package/dist/dev/lifecycle/pr-creation/index.d.ts.map +1 -0
- package/dist/dev/lifecycle/pr-creation/index.js +2 -0
- package/dist/dev/lifecycle/pr-creation/index.js.map +1 -0
- package/dist/dev/lifecycle/pr-creation/pr-creation.d.ts +47 -0
- package/dist/dev/lifecycle/pr-creation/pr-creation.d.ts.map +1 -0
- package/dist/dev/lifecycle/pr-creation/pr-creation.js +143 -0
- package/dist/dev/lifecycle/pr-creation/pr-creation.js.map +1 -0
- package/dist/dev/lifecycle/preflight/preflight.d.ts +42 -0
- package/dist/dev/lifecycle/preflight/preflight.d.ts.map +1 -0
- package/dist/dev/lifecycle/preflight/preflight.js +101 -0
- package/dist/dev/lifecycle/preflight/preflight.js.map +1 -0
- package/dist/dev/lifecycle/progress/index.d.ts +3 -0
- package/dist/dev/lifecycle/progress/index.d.ts.map +1 -0
- package/dist/dev/lifecycle/progress/index.js +2 -0
- package/dist/dev/lifecycle/progress/index.js.map +1 -0
- package/dist/dev/lifecycle/progress/progress.d.ts +98 -0
- package/dist/dev/lifecycle/progress/progress.d.ts.map +1 -0
- package/dist/dev/lifecycle/progress/progress.js +212 -0
- package/dist/dev/lifecycle/progress/progress.js.map +1 -0
- package/dist/dev/lifecycle/pull-request/azdo/azdo.d.ts +86 -0
- package/dist/dev/lifecycle/pull-request/azdo/azdo.d.ts.map +1 -0
- package/dist/dev/lifecycle/pull-request/azdo/azdo.js +198 -0
- package/dist/dev/lifecycle/pull-request/azdo/azdo.js.map +1 -0
- package/dist/dev/lifecycle/pull-request/azdo/index.d.ts +2 -0
- package/dist/dev/lifecycle/pull-request/azdo/index.d.ts.map +1 -0
- package/dist/dev/lifecycle/pull-request/azdo/index.js +2 -0
- package/dist/dev/lifecycle/pull-request/azdo/index.js.map +1 -0
- package/dist/dev/lifecycle/pull-request/bitbucket/cloud.d.ts +85 -0
- package/dist/dev/lifecycle/pull-request/bitbucket/cloud.d.ts.map +1 -0
- package/dist/dev/lifecycle/pull-request/bitbucket/cloud.js +158 -0
- package/dist/dev/lifecycle/pull-request/bitbucket/cloud.js.map +1 -0
- package/dist/dev/lifecycle/pull-request/bitbucket/index.d.ts +3 -0
- package/dist/dev/lifecycle/pull-request/bitbucket/index.d.ts.map +1 -0
- package/dist/dev/lifecycle/pull-request/bitbucket/index.js +3 -0
- package/dist/dev/lifecycle/pull-request/bitbucket/index.js.map +1 -0
- package/dist/dev/lifecycle/pull-request/bitbucket/server.d.ts +85 -0
- package/dist/dev/lifecycle/pull-request/bitbucket/server.d.ts.map +1 -0
- package/dist/dev/lifecycle/pull-request/bitbucket/server.js +168 -0
- package/dist/dev/lifecycle/pull-request/bitbucket/server.js.map +1 -0
- package/dist/dev/lifecycle/pull-request/github/github.d.ts +107 -0
- package/dist/dev/lifecycle/pull-request/github/github.d.ts.map +1 -0
- package/dist/dev/lifecycle/pull-request/github/github.js +225 -0
- package/dist/dev/lifecycle/pull-request/github/github.js.map +1 -0
- package/dist/dev/lifecycle/pull-request/github/index.d.ts +2 -0
- package/dist/dev/lifecycle/pull-request/github/index.d.ts.map +1 -0
- package/dist/dev/lifecycle/pull-request/github/index.js +2 -0
- package/dist/dev/lifecycle/pull-request/github/index.js.map +1 -0
- package/dist/dev/lifecycle/pull-request/gitlab/gitlab.d.ts +103 -0
- package/dist/dev/lifecycle/pull-request/gitlab/gitlab.d.ts.map +1 -0
- package/dist/dev/lifecycle/pull-request/gitlab/gitlab.js +215 -0
- package/dist/dev/lifecycle/pull-request/gitlab/gitlab.js.map +1 -0
- package/dist/dev/lifecycle/pull-request/gitlab/index.d.ts +2 -0
- package/dist/dev/lifecycle/pull-request/gitlab/index.d.ts.map +1 -0
- package/dist/dev/lifecycle/pull-request/gitlab/index.js +2 -0
- package/dist/dev/lifecycle/pull-request/gitlab/index.js.map +1 -0
- package/dist/dev/lifecycle/pull-request/post-pr/post-pr.d.ts +44 -0
- package/dist/dev/lifecycle/pull-request/post-pr/post-pr.d.ts.map +1 -0
- package/dist/dev/lifecycle/pull-request/post-pr/post-pr.js +64 -0
- package/dist/dev/lifecycle/pull-request/post-pr/post-pr.js.map +1 -0
- package/dist/dev/lifecycle/pull-request/pr-body/index.d.ts +3 -0
- package/dist/dev/lifecycle/pull-request/pr-body/index.d.ts.map +1 -0
- package/dist/dev/lifecycle/pull-request/pr-body/index.js +2 -0
- package/dist/dev/lifecycle/pull-request/pr-body/index.js.map +1 -0
- package/dist/dev/lifecycle/pull-request/pr-body/pr-body.d.ts +65 -0
- package/dist/dev/lifecycle/pull-request/pr-body/pr-body.d.ts.map +1 -0
- package/dist/dev/lifecycle/pull-request/pr-body/pr-body.js +144 -0
- package/dist/dev/lifecycle/pull-request/pr-body/pr-body.js.map +1 -0
- package/dist/dev/lifecycle/pull-request/rework-comment/rework-comment.d.ts +30 -0
- package/dist/dev/lifecycle/pull-request/rework-comment/rework-comment.d.ts.map +1 -0
- package/dist/dev/lifecycle/pull-request/rework-comment/rework-comment.js +39 -0
- package/dist/dev/lifecycle/pull-request/rework-comment/rework-comment.js.map +1 -0
- package/dist/dev/lifecycle/quality/quality.d.ts +99 -0
- package/dist/dev/lifecycle/quality/quality.d.ts.map +1 -0
- package/dist/dev/lifecycle/quality/quality.js +213 -0
- package/dist/dev/lifecycle/quality/quality.js.map +1 -0
- package/dist/dev/lifecycle/resume/resume.d.ts +64 -0
- package/dist/dev/lifecycle/resume/resume.d.ts.map +1 -0
- package/dist/dev/lifecycle/resume/resume.js +171 -0
- package/dist/dev/lifecycle/resume/resume.js.map +1 -0
- package/dist/dev/lifecycle/rework/rework-builders.d.ts +20 -0
- package/dist/dev/lifecycle/rework/rework-builders.d.ts.map +1 -0
- package/dist/dev/lifecycle/rework/rework-builders.js +203 -0
- package/dist/dev/lifecycle/rework/rework-builders.js.map +1 -0
- package/dist/dev/lifecycle/rework/rework-handlers.d.ts +50 -0
- package/dist/dev/lifecycle/rework/rework-handlers.d.ts.map +1 -0
- package/dist/dev/lifecycle/rework/rework-handlers.js +41 -0
- package/dist/dev/lifecycle/rework/rework-handlers.js.map +1 -0
- package/dist/dev/lifecycle/rework/rework.d.ts +63 -0
- package/dist/dev/lifecycle/rework/rework.d.ts.map +1 -0
- package/dist/dev/lifecycle/rework/rework.js +141 -0
- package/dist/dev/lifecycle/rework/rework.js.map +1 -0
- package/dist/dev/pipeline/context.d.ts +105 -0
- package/dist/dev/pipeline/context.d.ts.map +1 -0
- package/dist/dev/pipeline/context.js +107 -0
- package/dist/dev/pipeline/context.js.map +1 -0
- package/dist/dev/pipeline/index.d.ts +6 -0
- package/dist/dev/pipeline/index.d.ts.map +1 -0
- package/dist/dev/pipeline/index.js +5 -0
- package/dist/dev/pipeline/index.js.map +1 -0
- package/dist/dev/pipeline/phases/branch-setup/branch-setup.d.ts +62 -0
- package/dist/dev/pipeline/phases/branch-setup/branch-setup.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/branch-setup/branch-setup.js +128 -0
- package/dist/dev/pipeline/phases/branch-setup/branch-setup.js.map +1 -0
- package/dist/dev/pipeline/phases/branch-setup/index.d.ts +3 -0
- package/dist/dev/pipeline/phases/branch-setup/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/branch-setup/index.js +2 -0
- package/dist/dev/pipeline/phases/branch-setup/index.js.map +1 -0
- package/dist/dev/pipeline/phases/cleanup-phase/cleanup-phase.d.ts +32 -0
- package/dist/dev/pipeline/phases/cleanup-phase/cleanup-phase.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/cleanup-phase/cleanup-phase.js +32 -0
- package/dist/dev/pipeline/phases/cleanup-phase/cleanup-phase.js.map +1 -0
- package/dist/dev/pipeline/phases/cleanup-phase/index.d.ts +3 -0
- package/dist/dev/pipeline/phases/cleanup-phase/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/cleanup-phase/index.js +2 -0
- package/dist/dev/pipeline/phases/cleanup-phase/index.js.map +1 -0
- package/dist/dev/pipeline/phases/cost-phase/cost-phase.d.ts +40 -0
- package/dist/dev/pipeline/phases/cost-phase/cost-phase.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/cost-phase/cost-phase.js +43 -0
- package/dist/dev/pipeline/phases/cost-phase/cost-phase.js.map +1 -0
- package/dist/dev/pipeline/phases/cost-phase/index.d.ts +3 -0
- package/dist/dev/pipeline/phases/cost-phase/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/cost-phase/index.js +2 -0
- package/dist/dev/pipeline/phases/cost-phase/index.js.map +1 -0
- package/dist/dev/pipeline/phases/deliver-phase/deliver-phase.d.ts +68 -0
- package/dist/dev/pipeline/phases/deliver-phase/deliver-phase.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/deliver-phase/deliver-phase.js +125 -0
- package/dist/dev/pipeline/phases/deliver-phase/deliver-phase.js.map +1 -0
- package/dist/dev/pipeline/phases/deliver-phase/index.d.ts +3 -0
- package/dist/dev/pipeline/phases/deliver-phase/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/deliver-phase/index.js +2 -0
- package/dist/dev/pipeline/phases/deliver-phase/index.js.map +1 -0
- package/dist/dev/pipeline/phases/dry-run/dry-run.d.ts +38 -0
- package/dist/dev/pipeline/phases/dry-run/dry-run.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/dry-run/dry-run.js +33 -0
- package/dist/dev/pipeline/phases/dry-run/dry-run.js.map +1 -0
- package/dist/dev/pipeline/phases/dry-run/index.d.ts +2 -0
- package/dist/dev/pipeline/phases/dry-run/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/dry-run/index.js +2 -0
- package/dist/dev/pipeline/phases/dry-run/index.js.map +1 -0
- package/dist/dev/pipeline/phases/epic-completion/epic-completion.d.ts +48 -0
- package/dist/dev/pipeline/phases/epic-completion/epic-completion.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/epic-completion/epic-completion.js +42 -0
- package/dist/dev/pipeline/phases/epic-completion/epic-completion.js.map +1 -0
- package/dist/dev/pipeline/phases/epic-completion/index.d.ts +3 -0
- package/dist/dev/pipeline/phases/epic-completion/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/epic-completion/index.js +2 -0
- package/dist/dev/pipeline/phases/epic-completion/index.js.map +1 -0
- package/dist/dev/pipeline/phases/feasibility/feasibility.d.ts +52 -0
- package/dist/dev/pipeline/phases/feasibility/feasibility.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/feasibility/feasibility.js +34 -0
- package/dist/dev/pipeline/phases/feasibility/feasibility.js.map +1 -0
- package/dist/dev/pipeline/phases/feasibility/index.d.ts +3 -0
- package/dist/dev/pipeline/phases/feasibility/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/feasibility/index.js +2 -0
- package/dist/dev/pipeline/phases/feasibility/index.js.map +1 -0
- package/dist/dev/pipeline/phases/index.d.ts +26 -0
- package/dist/dev/pipeline/phases/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/index.js +14 -0
- package/dist/dev/pipeline/phases/index.js.map +1 -0
- package/dist/dev/pipeline/phases/lock-check/index.d.ts +3 -0
- package/dist/dev/pipeline/phases/lock-check/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/lock-check/index.js +2 -0
- package/dist/dev/pipeline/phases/lock-check/index.js.map +1 -0
- package/dist/dev/pipeline/phases/lock-check/lock-check.d.ts +55 -0
- package/dist/dev/pipeline/phases/lock-check/lock-check.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/lock-check/lock-check.js +60 -0
- package/dist/dev/pipeline/phases/lock-check/lock-check.js.map +1 -0
- package/dist/dev/pipeline/phases/pr-retry/index.d.ts +3 -0
- package/dist/dev/pipeline/phases/pr-retry/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/pr-retry/index.js +2 -0
- package/dist/dev/pipeline/phases/pr-retry/index.js.map +1 -0
- package/dist/dev/pipeline/phases/pr-retry/pr-retry.d.ts +58 -0
- package/dist/dev/pipeline/phases/pr-retry/pr-retry.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/pr-retry/pr-retry.js +82 -0
- package/dist/dev/pipeline/phases/pr-retry/pr-retry.js.map +1 -0
- package/dist/dev/pipeline/phases/preflight-phase/index.d.ts +3 -0
- package/dist/dev/pipeline/phases/preflight-phase/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/preflight-phase/index.js +2 -0
- package/dist/dev/pipeline/phases/preflight-phase/index.js.map +1 -0
- package/dist/dev/pipeline/phases/preflight-phase/preflight-phase.d.ts +42 -0
- package/dist/dev/pipeline/phases/preflight-phase/preflight-phase.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/preflight-phase/preflight-phase.js +41 -0
- package/dist/dev/pipeline/phases/preflight-phase/preflight-phase.js.map +1 -0
- package/dist/dev/pipeline/phases/rework-detection/index.d.ts +3 -0
- package/dist/dev/pipeline/phases/rework-detection/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/rework-detection/index.js +2 -0
- package/dist/dev/pipeline/phases/rework-detection/index.js.map +1 -0
- package/dist/dev/pipeline/phases/rework-detection/rework-detection.d.ts +40 -0
- package/dist/dev/pipeline/phases/rework-detection/rework-detection.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/rework-detection/rework-detection.js +38 -0
- package/dist/dev/pipeline/phases/rework-detection/rework-detection.js.map +1 -0
- package/dist/dev/pipeline/phases/ticket-fetch/index.d.ts +3 -0
- package/dist/dev/pipeline/phases/ticket-fetch/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/ticket-fetch/index.js +2 -0
- package/dist/dev/pipeline/phases/ticket-fetch/index.js.map +1 -0
- package/dist/dev/pipeline/phases/ticket-fetch/ticket-fetch.d.ts +46 -0
- package/dist/dev/pipeline/phases/ticket-fetch/ticket-fetch.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/ticket-fetch/ticket-fetch.js +64 -0
- package/dist/dev/pipeline/phases/ticket-fetch/ticket-fetch.js.map +1 -0
- package/dist/dev/pipeline/phases/transition/index.d.ts +3 -0
- package/dist/dev/pipeline/phases/transition/index.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/transition/index.js +2 -0
- package/dist/dev/pipeline/phases/transition/index.js.map +1 -0
- package/dist/dev/pipeline/phases/transition/transition.d.ts +30 -0
- package/dist/dev/pipeline/phases/transition/transition.d.ts.map +1 -0
- package/dist/dev/pipeline/phases/transition/transition.js +27 -0
- package/dist/dev/pipeline/phases/transition/transition.js.map +1 -0
- package/dist/dev/pipeline/run-pipeline.d.ts +98 -0
- package/dist/dev/pipeline/run-pipeline.d.ts.map +1 -0
- package/dist/dev/pipeline/run-pipeline.js +106 -0
- package/dist/dev/pipeline/run-pipeline.js.map +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/azdo/azdo-pr.d.ts +58 -0
- package/dist/schemas/azdo/azdo-pr.d.ts.map +1 -0
- package/dist/schemas/azdo/azdo-pr.js +48 -0
- package/dist/schemas/azdo/azdo-pr.js.map +1 -0
- package/dist/schemas/azdo/azdo.d.ts +88 -0
- package/dist/schemas/azdo/azdo.d.ts.map +1 -0
- package/dist/schemas/azdo/azdo.js +60 -0
- package/dist/schemas/azdo/azdo.js.map +1 -0
- package/dist/schemas/bitbucket/bitbucket.d.ts +112 -0
- package/dist/schemas/bitbucket/bitbucket.d.ts.map +1 -0
- package/dist/schemas/bitbucket/bitbucket.js +73 -0
- package/dist/schemas/bitbucket/bitbucket.js.map +1 -0
- package/dist/schemas/env/env.d.ts +336 -0
- package/dist/schemas/env/env.d.ts.map +1 -0
- package/dist/schemas/env/env.js +94 -0
- package/dist/schemas/env/env.js.map +1 -0
- package/dist/schemas/github/github.d.ts +128 -0
- package/dist/schemas/github/github.d.ts.map +1 -0
- package/dist/schemas/github/github.js +65 -0
- package/dist/schemas/github/github.js.map +1 -0
- package/dist/schemas/gitlab/gitlab.d.ts +72 -0
- package/dist/schemas/gitlab/gitlab.d.ts.map +1 -0
- package/dist/schemas/gitlab/gitlab.js +38 -0
- package/dist/schemas/gitlab/gitlab.js.map +1 -0
- package/dist/schemas/index.d.ts +15 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +8 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/jira/jira.d.ts +79 -0
- package/dist/schemas/jira/jira.d.ts.map +1 -0
- package/dist/schemas/jira/jira.js +69 -0
- package/dist/schemas/jira/jira.js.map +1 -0
- package/dist/schemas/linear/linear.d.ts +178 -0
- package/dist/schemas/linear/linear.d.ts.map +1 -0
- package/dist/schemas/linear/linear.js +136 -0
- package/dist/schemas/linear/linear.js.map +1 -0
- package/dist/schemas/notion/notion.d.ts +131 -0
- package/dist/schemas/notion/notion.d.ts.map +1 -0
- package/dist/schemas/notion/notion.js +102 -0
- package/dist/schemas/notion/notion.js.map +1 -0
- package/dist/schemas/shortcut/shortcut.d.ts +149 -0
- package/dist/schemas/shortcut/shortcut.d.ts.map +1 -0
- package/dist/schemas/shortcut/shortcut.js +68 -0
- package/dist/schemas/shortcut/shortcut.js.map +1 -0
- package/dist/shared/cache/cache.d.ts +14 -0
- package/dist/shared/cache/cache.d.ts.map +1 -0
- package/dist/shared/cache/cache.js +25 -0
- package/dist/shared/cache/cache.js.map +1 -0
- package/dist/shared/cache/index.d.ts +2 -0
- package/dist/shared/cache/index.d.ts.map +1 -0
- package/dist/shared/cache/index.js +2 -0
- package/dist/shared/cache/index.js.map +1 -0
- package/dist/shared/env-parser/env-parser.d.ts +42 -0
- package/dist/shared/env-parser/env-parser.d.ts.map +1 -0
- package/dist/shared/env-parser/env-parser.js +97 -0
- package/dist/shared/env-parser/env-parser.js.map +1 -0
- package/dist/shared/env-parser/index.d.ts +3 -0
- package/dist/shared/env-parser/index.d.ts.map +1 -0
- package/dist/shared/env-parser/index.js +2 -0
- package/dist/shared/env-parser/index.js.map +1 -0
- package/dist/shared/git-ops/git-ops.d.ts +127 -0
- package/dist/shared/git-ops/git-ops.d.ts.map +1 -0
- package/dist/shared/git-ops/git-ops.js +225 -0
- package/dist/shared/git-ops/git-ops.js.map +1 -0
- package/dist/shared/git-ops/index.d.ts +3 -0
- package/dist/shared/git-ops/index.d.ts.map +1 -0
- package/dist/shared/git-ops/index.js +2 -0
- package/dist/shared/git-ops/index.js.map +1 -0
- package/dist/shared/git-token/git-token.d.ts +18 -0
- package/dist/shared/git-token/git-token.d.ts.map +1 -0
- package/dist/shared/git-token/git-token.js +28 -0
- package/dist/shared/git-token/git-token.js.map +1 -0
- package/dist/shared/git-token/index.d.ts +2 -0
- package/dist/shared/git-token/index.d.ts.map +1 -0
- package/dist/shared/git-token/index.js +2 -0
- package/dist/shared/git-token/index.js.map +1 -0
- package/dist/shared/http/fetch-and-parse/fetch-and-parse.d.ts +32 -0
- package/dist/shared/http/fetch-and-parse/fetch-and-parse.d.ts.map +1 -0
- package/dist/shared/http/fetch-and-parse/fetch-and-parse.js +53 -0
- package/dist/shared/http/fetch-and-parse/fetch-and-parse.js.map +1 -0
- package/dist/shared/http/fetch-and-parse/index.d.ts +3 -0
- package/dist/shared/http/fetch-and-parse/index.d.ts.map +1 -0
- package/dist/shared/http/fetch-and-parse/index.js +2 -0
- package/dist/shared/http/fetch-and-parse/index.js.map +1 -0
- package/dist/shared/http/index.d.ts +7 -0
- package/dist/shared/http/index.d.ts.map +1 -0
- package/dist/shared/http/index.js +4 -0
- package/dist/shared/http/index.js.map +1 -0
- package/dist/shared/http/ping-endpoint/index.d.ts +3 -0
- package/dist/shared/http/ping-endpoint/index.d.ts.map +1 -0
- package/dist/shared/http/ping-endpoint/index.js +2 -0
- package/dist/shared/http/ping-endpoint/index.js.map +1 -0
- package/dist/shared/http/ping-endpoint/ping-endpoint.d.ts +29 -0
- package/dist/shared/http/ping-endpoint/ping-endpoint.d.ts.map +1 -0
- package/dist/shared/http/ping-endpoint/ping-endpoint.js +31 -0
- package/dist/shared/http/ping-endpoint/ping-endpoint.js.map +1 -0
- package/dist/shared/http/retry-fetch/index.d.ts +3 -0
- package/dist/shared/http/retry-fetch/index.d.ts.map +1 -0
- package/dist/shared/http/retry-fetch/index.js +2 -0
- package/dist/shared/http/retry-fetch/index.js.map +1 -0
- package/dist/shared/http/retry-fetch/retry-fetch.d.ts +33 -0
- package/dist/shared/http/retry-fetch/retry-fetch.d.ts.map +1 -0
- package/dist/shared/http/retry-fetch/retry-fetch.js +94 -0
- package/dist/shared/http/retry-fetch/retry-fetch.js.map +1 -0
- package/dist/shared/label-helpers/index.d.ts +3 -0
- package/dist/shared/label-helpers/index.d.ts.map +1 -0
- package/dist/shared/label-helpers/index.js +2 -0
- package/dist/shared/label-helpers/index.js.map +1 -0
- package/dist/shared/label-helpers/label-helpers.d.ts +41 -0
- package/dist/shared/label-helpers/label-helpers.d.ts.map +1 -0
- package/dist/shared/label-helpers/label-helpers.js +51 -0
- package/dist/shared/label-helpers/label-helpers.js.map +1 -0
- package/dist/shared/remote/index.d.ts +2 -0
- package/dist/shared/remote/index.d.ts.map +1 -0
- package/dist/shared/remote/index.js +2 -0
- package/dist/shared/remote/index.js.map +1 -0
- package/dist/shared/remote/remote.d.ts +39 -0
- package/dist/shared/remote/remote.d.ts.map +1 -0
- package/dist/shared/remote/remote.js +180 -0
- package/dist/shared/remote/remote.js.map +1 -0
- package/dist/types/board.d.ts +62 -0
- package/dist/types/board.d.ts.map +1 -0
- package/dist/types/board.js +5 -0
- package/dist/types/board.js.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/progress.d.ts +21 -0
- package/dist/types/progress.d.ts.map +1 -0
- package/dist/types/progress.js +34 -0
- package/dist/types/progress.js.map +1 -0
- package/dist/types/remote.d.ts +77 -0
- package/dist/types/remote.d.ts.map +1 -0
- package/dist/types/remote.js +5 -0
- package/dist/types/remote.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progress logger for completed tickets.
|
|
3
|
+
*
|
|
4
|
+
* Reads and writes `.clancy/progress.txt` entries with timestamps,
|
|
5
|
+
* ticket keys, summaries, and statuses. Filesystem access is
|
|
6
|
+
* dependency-injected for testability.
|
|
7
|
+
*/
|
|
8
|
+
import type { ProgressStatus } from '../../../types/index.js';
|
|
9
|
+
/** Injected filesystem operations for progress file I/O. */
|
|
10
|
+
export type ProgressFs = {
|
|
11
|
+
/** Read a file as UTF-8, throwing if missing. */
|
|
12
|
+
readonly readFile: (path: string) => string;
|
|
13
|
+
/** Append UTF-8 content to a file (creates if missing). */
|
|
14
|
+
readonly appendFile: (path: string, content: string) => void;
|
|
15
|
+
/** Create directory recursively. */
|
|
16
|
+
readonly mkdir: (path: string) => void;
|
|
17
|
+
};
|
|
18
|
+
/** Options for {@link appendProgress}. */
|
|
19
|
+
type AppendProgressOpts = {
|
|
20
|
+
readonly key: string;
|
|
21
|
+
readonly summary: string;
|
|
22
|
+
readonly status: ProgressStatus;
|
|
23
|
+
readonly prNumber?: number;
|
|
24
|
+
readonly parent?: string;
|
|
25
|
+
readonly ticketType?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Format a date as `YYYY-MM-DD HH:MM` in UTC.
|
|
29
|
+
*
|
|
30
|
+
* @param date - The date to format.
|
|
31
|
+
* @returns The formatted timestamp string.
|
|
32
|
+
*/
|
|
33
|
+
export declare function formatTimestamp(date: Date): string;
|
|
34
|
+
/**
|
|
35
|
+
* Append a progress entry to `.clancy/progress.txt`.
|
|
36
|
+
*
|
|
37
|
+
* Creates the directory if it doesn't exist. Uses slug-based format
|
|
38
|
+
* for BRIEF/APPROVE_BRIEF statuses, standard format for all others.
|
|
39
|
+
*
|
|
40
|
+
* @param fs - Injected filesystem operations.
|
|
41
|
+
* @param projectRoot - The root directory of the project.
|
|
42
|
+
* @param opts - Entry details (key, summary, status, optional prNumber/parent).
|
|
43
|
+
*/
|
|
44
|
+
export declare function appendProgress(fs: ProgressFs, projectRoot: string, opts: AppendProgressOpts): void;
|
|
45
|
+
/** A single parsed entry from the progress log. */
|
|
46
|
+
export type ProgressEntry = {
|
|
47
|
+
readonly timestamp: string;
|
|
48
|
+
readonly key: string;
|
|
49
|
+
readonly summary: string;
|
|
50
|
+
readonly status: ProgressStatus;
|
|
51
|
+
readonly prNumber?: number;
|
|
52
|
+
readonly parent?: string;
|
|
53
|
+
readonly ticketType?: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Parse a progress file into an array of entries.
|
|
57
|
+
*
|
|
58
|
+
* Supports both standard (`timestamp | key | summary | STATUS`) and
|
|
59
|
+
* slug-based (`timestamp | STATUS | slug | detail`) formats.
|
|
60
|
+
* Lines that don't match the minimum format are silently skipped.
|
|
61
|
+
*
|
|
62
|
+
* @param fs - Injected filesystem operations.
|
|
63
|
+
* @param projectRoot - The root directory of the project.
|
|
64
|
+
* @returns Array of parsed progress entries.
|
|
65
|
+
*/
|
|
66
|
+
export declare function parseProgressFile(fs: ProgressFs, projectRoot: string): readonly ProgressEntry[];
|
|
67
|
+
/**
|
|
68
|
+
* Find the last progress entry for a given ticket key.
|
|
69
|
+
*
|
|
70
|
+
* @param fs - Injected filesystem operations.
|
|
71
|
+
* @param projectRoot - The root directory of the project.
|
|
72
|
+
* @param key - The ticket key to search for (case-insensitive).
|
|
73
|
+
* @returns The last matching entry, or `undefined` if not found.
|
|
74
|
+
*/
|
|
75
|
+
export declare function findLastEntry(fs: ProgressFs, projectRoot: string, key: string): ProgressEntry | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Count how many times a ticket has been sent back for rework.
|
|
78
|
+
*
|
|
79
|
+
* @param fs - Injected filesystem operations.
|
|
80
|
+
* @param projectRoot - The root directory of the project.
|
|
81
|
+
* @param key - The ticket key to search for (case-insensitive).
|
|
82
|
+
* @returns The number of `REWORK` entries for the given key.
|
|
83
|
+
*/
|
|
84
|
+
export declare function countReworkCycles(fs: ProgressFs, projectRoot: string, key: string): number;
|
|
85
|
+
/**
|
|
86
|
+
* Find all ticket keys whose most recent entry has the given status.
|
|
87
|
+
*
|
|
88
|
+
* Scans progress.txt and returns the latest entry per ticket key,
|
|
89
|
+
* filtered to only those with the specified status.
|
|
90
|
+
*
|
|
91
|
+
* @param fs - Injected filesystem operations.
|
|
92
|
+
* @param projectRoot - The project root directory.
|
|
93
|
+
* @param status - The status to filter by (e.g. `'PR_CREATED'`).
|
|
94
|
+
* @returns Array of progress entries (latest per key) with the given status.
|
|
95
|
+
*/
|
|
96
|
+
export declare function findEntriesWithStatus(fs: ProgressFs, projectRoot: string, status: ProgressStatus): readonly ProgressEntry[];
|
|
97
|
+
export {};
|
|
98
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../../src/dev/lifecycle/progress/progress.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIzD,4DAA4D;AAC5D,MAAM,MAAM,UA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C;CAC9B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,UAAU,EACd,WAAW,EAAE,MAAM,GAClB,SAAS,aAAa,EAAE,CAS1B;AAmHD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,UAAU,EACd,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,GACV,aAAa,GAAG,SAAS,CAO3B;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,UAAU,EACd,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,GACV,MAAM,CAOR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,UAAU,EACd,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,cAAc,GACrB,SAAS,aAAa,EAAE,CAK1B"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
/**
|
|
3
|
+
* Format a date as `YYYY-MM-DD HH:MM` in UTC.
|
|
4
|
+
*
|
|
5
|
+
* @param date - The date to format.
|
|
6
|
+
* @returns The formatted timestamp string.
|
|
7
|
+
*/
|
|
8
|
+
export function formatTimestamp(date) {
|
|
9
|
+
const y = date.getUTCFullYear();
|
|
10
|
+
const mo = String(date.getUTCMonth() + 1).padStart(2, '0');
|
|
11
|
+
const d = String(date.getUTCDate()).padStart(2, '0');
|
|
12
|
+
const h = String(date.getUTCHours()).padStart(2, '0');
|
|
13
|
+
const mi = String(date.getUTCMinutes()).padStart(2, '0');
|
|
14
|
+
return `${y}-${mo}-${d} ${h}:${mi}`;
|
|
15
|
+
}
|
|
16
|
+
/** Relative path to the progress file within a project. */
|
|
17
|
+
const PROGRESS_PATH = '.clancy/progress.txt';
|
|
18
|
+
/** Brief-style statuses that use slug-based format. */
|
|
19
|
+
const SLUG_STATUSES = new Set(['BRIEF', 'APPROVE_BRIEF']);
|
|
20
|
+
/** All valid progress statuses — used to validate parsed segments. Includes legacy 'APPROVE'. */
|
|
21
|
+
const VALID_STATUSES = new Set([
|
|
22
|
+
'DONE',
|
|
23
|
+
'SKIPPED',
|
|
24
|
+
'PR_CREATED',
|
|
25
|
+
'PUSHED',
|
|
26
|
+
'PUSH_FAILED',
|
|
27
|
+
'LOCAL',
|
|
28
|
+
'PLAN',
|
|
29
|
+
'APPROVE_PLAN',
|
|
30
|
+
'APPROVE',
|
|
31
|
+
'REWORK',
|
|
32
|
+
'EPIC_PR_CREATED',
|
|
33
|
+
'BRIEF',
|
|
34
|
+
'APPROVE_BRIEF',
|
|
35
|
+
'TIME_LIMIT',
|
|
36
|
+
'RESUMED',
|
|
37
|
+
]);
|
|
38
|
+
/**
|
|
39
|
+
* Append a progress entry to `.clancy/progress.txt`.
|
|
40
|
+
*
|
|
41
|
+
* Creates the directory if it doesn't exist. Uses slug-based format
|
|
42
|
+
* for BRIEF/APPROVE_BRIEF statuses, standard format for all others.
|
|
43
|
+
*
|
|
44
|
+
* @param fs - Injected filesystem operations.
|
|
45
|
+
* @param projectRoot - The root directory of the project.
|
|
46
|
+
* @param opts - Entry details (key, summary, status, optional prNumber/parent).
|
|
47
|
+
*/
|
|
48
|
+
export function appendProgress(fs, projectRoot, opts) {
|
|
49
|
+
const filePath = join(projectRoot, PROGRESS_PATH);
|
|
50
|
+
fs.mkdir(join(projectRoot, '.clancy'));
|
|
51
|
+
const timestamp = formatTimestamp(new Date());
|
|
52
|
+
const line = SLUG_STATUSES.has(opts.status)
|
|
53
|
+
? formatSlugLine(timestamp, opts)
|
|
54
|
+
: formatStandardLine(timestamp, opts);
|
|
55
|
+
fs.appendFile(filePath, line);
|
|
56
|
+
}
|
|
57
|
+
/** Format a slug-based line: `timestamp | STATUS | slug | detail`. */
|
|
58
|
+
function formatSlugLine(ts, opts) {
|
|
59
|
+
return `${ts} | ${opts.status} | ${opts.key} | ${opts.summary}\n`;
|
|
60
|
+
}
|
|
61
|
+
/** Format a standard line: `timestamp | key | summary | STATUS [| pr:N] [| parent:KEY] [| type:VALUE]`. */
|
|
62
|
+
function formatStandardLine(ts, opts) {
|
|
63
|
+
const prSuffix = opts.prNumber != null ? ` | pr:${opts.prNumber}` : '';
|
|
64
|
+
const parentSuffix = opts.parent ? ` | parent:${opts.parent}` : '';
|
|
65
|
+
const typeSuffix = opts.ticketType ? ` | type:${opts.ticketType}` : '';
|
|
66
|
+
return `${ts} | ${opts.key} | ${opts.summary} | ${opts.status}${prSuffix}${parentSuffix}${typeSuffix}\n`;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Parse a progress file into an array of entries.
|
|
70
|
+
*
|
|
71
|
+
* Supports both standard (`timestamp | key | summary | STATUS`) and
|
|
72
|
+
* slug-based (`timestamp | STATUS | slug | detail`) formats.
|
|
73
|
+
* Lines that don't match the minimum format are silently skipped.
|
|
74
|
+
*
|
|
75
|
+
* @param fs - Injected filesystem operations.
|
|
76
|
+
* @param projectRoot - The root directory of the project.
|
|
77
|
+
* @returns Array of parsed progress entries.
|
|
78
|
+
*/
|
|
79
|
+
export function parseProgressFile(fs, projectRoot) {
|
|
80
|
+
const content = safeReadFile(fs, join(projectRoot, PROGRESS_PATH));
|
|
81
|
+
if (!content)
|
|
82
|
+
return [];
|
|
83
|
+
return content
|
|
84
|
+
.split(/\r?\n/)
|
|
85
|
+
.filter((line) => line.trim().length > 0)
|
|
86
|
+
.map((line) => parseLine(line.trim()))
|
|
87
|
+
.filter((entry) => entry !== undefined);
|
|
88
|
+
}
|
|
89
|
+
/** Read a file, returning `undefined` on any error. */
|
|
90
|
+
function safeReadFile(fs, path) {
|
|
91
|
+
try {
|
|
92
|
+
return fs.readFile(path);
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** Parse a single progress line into an entry, or `undefined` if malformed. */
|
|
99
|
+
function parseLine(line) {
|
|
100
|
+
const parts = line.split(' | ');
|
|
101
|
+
if (parts.length < 4)
|
|
102
|
+
return undefined;
|
|
103
|
+
const timestamp = parts[0];
|
|
104
|
+
// Safe cast: SLUG_STATUSES.has() returns false for non-matching strings
|
|
105
|
+
const isSlugEntry = SLUG_STATUSES.has(parts[1]);
|
|
106
|
+
if (isSlugEntry)
|
|
107
|
+
return parseSlugEntry(timestamp, parts);
|
|
108
|
+
return parseStandardEntry(timestamp, parts);
|
|
109
|
+
}
|
|
110
|
+
/** Parse a slug-based entry: `timestamp | STATUS | slug | detail`. */
|
|
111
|
+
function parseSlugEntry(timestamp, parts) {
|
|
112
|
+
return {
|
|
113
|
+
timestamp,
|
|
114
|
+
key: parts[2],
|
|
115
|
+
summary: parts.slice(3).join(' | '),
|
|
116
|
+
// Safe cast: caller already verified parts[1] is in SLUG_STATUSES
|
|
117
|
+
status: parts[1],
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/** Parse a standard entry: `timestamp | key | summary | STATUS [| pr:N] [| parent:KEY] [| type:VALUE]`. */
|
|
121
|
+
function parseStandardEntry(timestamp, parts) {
|
|
122
|
+
const key = parts[1];
|
|
123
|
+
const tail = parts.slice(2);
|
|
124
|
+
const { status, summary, prNumber, parent, ticketType } = extractTailFields(tail);
|
|
125
|
+
if (!status)
|
|
126
|
+
return undefined;
|
|
127
|
+
const resolvedStatus = status === 'APPROVE' ? 'APPROVE_PLAN' : status;
|
|
128
|
+
return {
|
|
129
|
+
timestamp,
|
|
130
|
+
key,
|
|
131
|
+
summary,
|
|
132
|
+
status: resolvedStatus,
|
|
133
|
+
...(prNumber != null && { prNumber }),
|
|
134
|
+
...(parent != null && { parent }),
|
|
135
|
+
...(ticketType != null && { ticketType }),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/** Extract status, summary, prNumber, parent, and ticketType from tail segments. */
|
|
139
|
+
function extractTailFields(tail) {
|
|
140
|
+
const prSegment = tail.find((s) => /^pr:\d+$/.test(s));
|
|
141
|
+
const parentSegment = tail.find((s) => s.startsWith('parent:'));
|
|
142
|
+
const typeSegment = tail.find((s) => s.startsWith('type:'));
|
|
143
|
+
const statusSegment = tail.find((s, i) => i >= 1 &&
|
|
144
|
+
isStatusSegment(s) &&
|
|
145
|
+
s !== prSegment &&
|
|
146
|
+
s !== parentSegment &&
|
|
147
|
+
s !== typeSegment);
|
|
148
|
+
const prNumber = prSegment ? parseInt(prSegment.slice(3), 10) : undefined;
|
|
149
|
+
const parent = parentSegment ? parentSegment.slice(7) : undefined;
|
|
150
|
+
const ticketType = typeSegment ? typeSegment.slice(5) : undefined;
|
|
151
|
+
const summaryParts = tail.filter((s) => s !== prSegment &&
|
|
152
|
+
s !== parentSegment &&
|
|
153
|
+
s !== typeSegment &&
|
|
154
|
+
s !== statusSegment);
|
|
155
|
+
return {
|
|
156
|
+
// Safe cast: isStatusSegment validates against VALID_STATUSES set
|
|
157
|
+
status: statusSegment,
|
|
158
|
+
summary: summaryParts.join(' | '),
|
|
159
|
+
prNumber,
|
|
160
|
+
parent,
|
|
161
|
+
ticketType,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
/** Check if a segment is a known progress status. */
|
|
165
|
+
function isStatusSegment(segment) {
|
|
166
|
+
return VALID_STATUSES.has(segment);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Find the last progress entry for a given ticket key.
|
|
170
|
+
*
|
|
171
|
+
* @param fs - Injected filesystem operations.
|
|
172
|
+
* @param projectRoot - The root directory of the project.
|
|
173
|
+
* @param key - The ticket key to search for (case-insensitive).
|
|
174
|
+
* @returns The last matching entry, or `undefined` if not found.
|
|
175
|
+
*/
|
|
176
|
+
export function findLastEntry(fs, projectRoot, key) {
|
|
177
|
+
const entries = parseProgressFile(fs, projectRoot);
|
|
178
|
+
const needle = key.toLowerCase();
|
|
179
|
+
return [...entries]
|
|
180
|
+
.reverse()
|
|
181
|
+
.find((entry) => entry.key.toLowerCase() === needle);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Count how many times a ticket has been sent back for rework.
|
|
185
|
+
*
|
|
186
|
+
* @param fs - Injected filesystem operations.
|
|
187
|
+
* @param projectRoot - The root directory of the project.
|
|
188
|
+
* @param key - The ticket key to search for (case-insensitive).
|
|
189
|
+
* @returns The number of `REWORK` entries for the given key.
|
|
190
|
+
*/
|
|
191
|
+
export function countReworkCycles(fs, projectRoot, key) {
|
|
192
|
+
const entries = parseProgressFile(fs, projectRoot);
|
|
193
|
+
const needle = key.toLowerCase();
|
|
194
|
+
return entries.filter((entry) => entry.key.toLowerCase() === needle && entry.status === 'REWORK').length;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Find all ticket keys whose most recent entry has the given status.
|
|
198
|
+
*
|
|
199
|
+
* Scans progress.txt and returns the latest entry per ticket key,
|
|
200
|
+
* filtered to only those with the specified status.
|
|
201
|
+
*
|
|
202
|
+
* @param fs - Injected filesystem operations.
|
|
203
|
+
* @param projectRoot - The project root directory.
|
|
204
|
+
* @param status - The status to filter by (e.g. `'PR_CREATED'`).
|
|
205
|
+
* @returns Array of progress entries (latest per key) with the given status.
|
|
206
|
+
*/
|
|
207
|
+
export function findEntriesWithStatus(fs, projectRoot, status) {
|
|
208
|
+
const entries = parseProgressFile(fs, projectRoot);
|
|
209
|
+
const latestByKey = new Map(entries.map((entry) => [entry.key, entry]));
|
|
210
|
+
return [...latestByKey.values()].filter((entry) => entry.status === status);
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../../src/dev/lifecycle/progress/progress.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAsBjC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,MAAM,CAAC,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;IAChC,MAAM,EAAE,GAAG,MAAM,CAAC,I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C;IACnD,MAAM,MAAM,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;IAEjC,OAAO,CAAC,GAAG,OAAO,CAAC;SAChB,OAAO,EAAE;SACT,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,EAAc,EACd,WAAmB,EACnB,GAAW;IAEX,MAAM,OAAO,GAAG,iBAAiB,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;IAEjC,OAAO,OAAO,CAAC,MAAM,CACnB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,MAAM,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,CAC3E,CAAC,MAAM,CAAC;AACX,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CACnC,EAAc,EACd,WAAmB,EACnB,MAAsB;IAEtB,MAAM,OAAO,GAAG,iBAAiB,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;IACnD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAExE,OAAO,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { PrCreationResult, PrReviewState } from '../../../../types/index.js';
|
|
2
|
+
/** Minimal fetch signature for Azure DevOps API calls. */
|
|
3
|
+
type AzdoFetch = (url: string, init: RequestInit) => Promise<Response>;
|
|
4
|
+
/** Options for {@link createPullRequest}. */
|
|
5
|
+
type CreatePrOpts = {
|
|
6
|
+
readonly fetchFn: AzdoFetch;
|
|
7
|
+
readonly org: string;
|
|
8
|
+
readonly project: string;
|
|
9
|
+
readonly repo: string;
|
|
10
|
+
readonly pat: string;
|
|
11
|
+
readonly sourceBranch: string;
|
|
12
|
+
readonly targetBranch: string;
|
|
13
|
+
readonly title: string;
|
|
14
|
+
readonly description: string;
|
|
15
|
+
};
|
|
16
|
+
/** Options for {@link postPrComment}. */
|
|
17
|
+
type PostCommentOpts = {
|
|
18
|
+
readonly fetchFn: AzdoFetch;
|
|
19
|
+
readonly org: string;
|
|
20
|
+
readonly project: string;
|
|
21
|
+
readonly repo: string;
|
|
22
|
+
readonly pat: string;
|
|
23
|
+
readonly prId: number;
|
|
24
|
+
readonly body: string;
|
|
25
|
+
};
|
|
26
|
+
/** Options for {@link checkPrReviewState}. */
|
|
27
|
+
type CheckReviewOpts = {
|
|
28
|
+
readonly fetchFn: AzdoFetch;
|
|
29
|
+
readonly org: string;
|
|
30
|
+
readonly project: string;
|
|
31
|
+
readonly repo: string;
|
|
32
|
+
readonly pat: string;
|
|
33
|
+
readonly branch: string;
|
|
34
|
+
readonly since?: string;
|
|
35
|
+
};
|
|
36
|
+
/** Options for {@link fetchPrReviewComments}. */
|
|
37
|
+
type FetchCommentsOpts = {
|
|
38
|
+
readonly fetchFn: AzdoFetch;
|
|
39
|
+
readonly org: string;
|
|
40
|
+
readonly project: string;
|
|
41
|
+
readonly repo: string;
|
|
42
|
+
readonly pat: string;
|
|
43
|
+
readonly prId: number;
|
|
44
|
+
readonly since?: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Create a pull request on Azure DevOps.
|
|
48
|
+
*
|
|
49
|
+
* @param opts - AzDO PR creation options.
|
|
50
|
+
* @returns A result with the PR URL and ID on success, or an error.
|
|
51
|
+
*/
|
|
52
|
+
export declare function createPullRequest(opts: CreatePrOpts): Promise<PrCreationResult>;
|
|
53
|
+
/**
|
|
54
|
+
* Post a comment thread on an Azure DevOps pull request.
|
|
55
|
+
*
|
|
56
|
+
* Best-effort — never throws.
|
|
57
|
+
*
|
|
58
|
+
* @param opts - AzDO comment options.
|
|
59
|
+
* @returns `true` on success, `false` on error.
|
|
60
|
+
*/
|
|
61
|
+
export declare function postPrComment(opts: PostCommentOpts): Promise<boolean>;
|
|
62
|
+
/**
|
|
63
|
+
* Check the review state of an open PR on Azure DevOps.
|
|
64
|
+
*
|
|
65
|
+
* Inline threads (with `threadContext`) always trigger rework.
|
|
66
|
+
* General threads only trigger when the first comment is prefixed with `Rework:`.
|
|
67
|
+
* System threads and deleted threads are excluded. Does not check reviewer
|
|
68
|
+
* vote state — only GitHub checks formal reviews (CHANGES_REQUESTED).
|
|
69
|
+
*
|
|
70
|
+
* @param opts - AzDO review state options.
|
|
71
|
+
* @returns The review state, or `undefined` if no open PR or on error.
|
|
72
|
+
*/
|
|
73
|
+
export declare function checkPrReviewState(opts: CheckReviewOpts): Promise<PrReviewState | undefined>;
|
|
74
|
+
/**
|
|
75
|
+
* Fetch feedback comments from an Azure DevOps PR.
|
|
76
|
+
*
|
|
77
|
+
* Inline threads are always included (prefixed with `[filePath]`).
|
|
78
|
+
* General threads only when the first comment is prefixed with `Rework:` (prefix stripped).
|
|
79
|
+
* System threads and deleted threads are excluded.
|
|
80
|
+
*
|
|
81
|
+
* @param opts - AzDO comment fetch options.
|
|
82
|
+
* @returns Array of feedback strings, or `[]` on error.
|
|
83
|
+
*/
|
|
84
|
+
export declare function fetchPrReviewComments(opts: FetchCommentsOpts): Promise<readonly string[]>;
|
|
85
|
+
export {};
|
|
86
|
+
//# sourceMappingURL=azdo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azdo.d.ts","sourceRoot":"","sources":["../../../../../src/dev/lifecycle/pull-request/azdo/azdo.ts"],"names":[],"mappings":"AAMA,OAA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AE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,iDAAiD;AACjD,KAAK,iBAAiB,GAAG;IACvB,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,gBAAgB,CAAC,CA6B3B;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAoB3E;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CA2CpC;AAED;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAqB5B"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { azdoPrCreatedSchema, azdoPrListSchema, azdoThreadListSchema, } from '../../../../schemas/azdo/azdo-pr.js';
|
|
2
|
+
import { basicAuth, postPullRequest } from '../post-pr/post-pr.js';
|
|
3
|
+
import { extractReworkContent, isClancyComment, isReworkComment, } from '../rework-comment/rework-comment.js';
|
|
4
|
+
/** API version query parameter appended to all requests. */
|
|
5
|
+
const API_VERSION = 'api-version=7.1';
|
|
6
|
+
/** Azure DevOps API base URL. */
|
|
7
|
+
const AZDO_API = 'https://dev.azure.com';
|
|
8
|
+
/**
|
|
9
|
+
* Create a pull request on Azure DevOps.
|
|
10
|
+
*
|
|
11
|
+
* @param opts - AzDO PR creation options.
|
|
12
|
+
* @returns A result with the PR URL and ID on success, or an error.
|
|
13
|
+
*/
|
|
14
|
+
export async function createPullRequest(opts) {
|
|
15
|
+
const { fetchFn, org, project, repo, pat } = opts;
|
|
16
|
+
const { sourceBranch, targetBranch, title, description } = opts;
|
|
17
|
+
const o = encodeURIComponent(org);
|
|
18
|
+
const p = encodeURIComponent(project);
|
|
19
|
+
const r = encodeURIComponent(repo);
|
|
20
|
+
return postPullRequest({
|
|
21
|
+
fetchFn,
|
|
22
|
+
url: `${AZDO_API}/${o}/${p}/_apis/git/repositories/${r}/pullrequests?${API_VERSION}`,
|
|
23
|
+
headers: { Authorization: basicAuth('', pat) },
|
|
24
|
+
body: {
|
|
25
|
+
sourceRefName: `refs/heads/${sourceBranch}`,
|
|
26
|
+
targetRefName: `refs/heads/${targetBranch}`,
|
|
27
|
+
title,
|
|
28
|
+
description,
|
|
29
|
+
},
|
|
30
|
+
parseSuccess: (json) => {
|
|
31
|
+
const data = azdoPrCreatedSchema.parse(json);
|
|
32
|
+
const prId = data.pullRequestId ?? 0;
|
|
33
|
+
return {
|
|
34
|
+
url: `${AZDO_API}/${o}/${p}/_git/${r}/pullrequest/${prId}`,
|
|
35
|
+
number: prId,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
isAlreadyExists: (status, text) => status === 409 ||
|
|
39
|
+
(status === 400 && text.includes('already has an active pull request')),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Post a comment thread on an Azure DevOps pull request.
|
|
44
|
+
*
|
|
45
|
+
* Best-effort — never throws.
|
|
46
|
+
*
|
|
47
|
+
* @param opts - AzDO comment options.
|
|
48
|
+
* @returns `true` on success, `false` on error.
|
|
49
|
+
*/
|
|
50
|
+
export async function postPrComment(opts) {
|
|
51
|
+
const { fetchFn, org, project, repo, pat, prId, body } = opts;
|
|
52
|
+
try {
|
|
53
|
+
const base = prBaseUrl(org, project, repo);
|
|
54
|
+
const res = await fetchFn(`${base}/${prId}/threads?${API_VERSION}`, {
|
|
55
|
+
method: 'POST',
|
|
56
|
+
headers: {
|
|
57
|
+
Authorization: basicAuth('', pat),
|
|
58
|
+
'Content-Type': 'application/json',
|
|
59
|
+
},
|
|
60
|
+
body: JSON.stringify({
|
|
61
|
+
comments: [{ parentCommentId: 0, content: body, commentType: 1 }],
|
|
62
|
+
status: 1,
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
65
|
+
return res.ok;
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Check the review state of an open PR on Azure DevOps.
|
|
73
|
+
*
|
|
74
|
+
* Inline threads (with `threadContext`) always trigger rework.
|
|
75
|
+
* General threads only trigger when the first comment is prefixed with `Rework:`.
|
|
76
|
+
* System threads and deleted threads are excluded. Does not check reviewer
|
|
77
|
+
* vote state — only GitHub checks formal reviews (CHANGES_REQUESTED).
|
|
78
|
+
*
|
|
79
|
+
* @param opts - AzDO review state options.
|
|
80
|
+
* @returns The review state, or `undefined` if no open PR or on error.
|
|
81
|
+
*/
|
|
82
|
+
export async function checkPrReviewState(opts) {
|
|
83
|
+
const { fetchFn, org, project, repo, pat, branch, since } = opts;
|
|
84
|
+
const auth = basicAuth('', pat);
|
|
85
|
+
try {
|
|
86
|
+
const base = prBaseUrl(org, project, repo);
|
|
87
|
+
const prRes = await fetchFn(`${base}?searchCriteria.sourceRefName=${encodeURIComponent(`refs/heads/${branch}`)}&searchCriteria.status=active&${API_VERSION}`, { headers: { Authorization: auth } });
|
|
88
|
+
if (!prRes.ok)
|
|
89
|
+
return undefined;
|
|
90
|
+
const parsed = azdoPrListSchema.parse(await prRes.json());
|
|
91
|
+
if (parsed.value.length === 0)
|
|
92
|
+
return undefined;
|
|
93
|
+
const pr = parsed.value[0];
|
|
94
|
+
const threads = await fetchThreads({
|
|
95
|
+
fetchFn,
|
|
96
|
+
auth,
|
|
97
|
+
org,
|
|
98
|
+
project,
|
|
99
|
+
repo,
|
|
100
|
+
prId: pr.pullRequestId,
|
|
101
|
+
});
|
|
102
|
+
if (!threads)
|
|
103
|
+
return undefined;
|
|
104
|
+
const relevant = filterBySince(activeThreads(threads), since);
|
|
105
|
+
const hasInline = relevant.some((t) => t.threadContext != null);
|
|
106
|
+
const hasReworkConvo = relevant.some((t) => t.threadContext == null &&
|
|
107
|
+
t.comments.length > 0 &&
|
|
108
|
+
isReworkComment(t.comments[0].content ?? ''));
|
|
109
|
+
return {
|
|
110
|
+
changesRequested: hasInline || hasReworkConvo,
|
|
111
|
+
prNumber: pr.pullRequestId,
|
|
112
|
+
prUrl: `${AZDO_API}/${encodeURIComponent(org)}/${encodeURIComponent(project)}/_git/${encodeURIComponent(repo)}/pullrequest/${pr.pullRequestId}`,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Fetch feedback comments from an Azure DevOps PR.
|
|
121
|
+
*
|
|
122
|
+
* Inline threads are always included (prefixed with `[filePath]`).
|
|
123
|
+
* General threads only when the first comment is prefixed with `Rework:` (prefix stripped).
|
|
124
|
+
* System threads and deleted threads are excluded.
|
|
125
|
+
*
|
|
126
|
+
* @param opts - AzDO comment fetch options.
|
|
127
|
+
* @returns Array of feedback strings, or `[]` on error.
|
|
128
|
+
*/
|
|
129
|
+
export async function fetchPrReviewComments(opts) {
|
|
130
|
+
const { fetchFn, org, project, repo, pat, prId, since } = opts;
|
|
131
|
+
const auth = basicAuth('', pat);
|
|
132
|
+
try {
|
|
133
|
+
const threads = await fetchThreads({
|
|
134
|
+
fetchFn,
|
|
135
|
+
auth,
|
|
136
|
+
org,
|
|
137
|
+
project,
|
|
138
|
+
repo,
|
|
139
|
+
prId,
|
|
140
|
+
});
|
|
141
|
+
if (!threads)
|
|
142
|
+
return [];
|
|
143
|
+
return filterBySince(activeThreads(threads), since).flatMap((t) => formatThread(t));
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
return [];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// ─── private helpers ────────────────────────────────────────────────────────
|
|
150
|
+
/** Build the pull requests API base URL. */
|
|
151
|
+
function prBaseUrl(org, project, repo) {
|
|
152
|
+
const o = encodeURIComponent(org);
|
|
153
|
+
const p = encodeURIComponent(project);
|
|
154
|
+
const r = encodeURIComponent(repo);
|
|
155
|
+
return `${AZDO_API}/${o}/${p}/_apis/git/repositories/${r}/pullrequests`;
|
|
156
|
+
}
|
|
157
|
+
/** Fetch PR threads. Returns `undefined` on error. */
|
|
158
|
+
async function fetchThreads(opts) {
|
|
159
|
+
const { fetchFn, auth, org, project, repo, prId } = opts;
|
|
160
|
+
const base = prBaseUrl(org, project, repo);
|
|
161
|
+
const res = await fetchFn(`${base}/${prId}/threads?${API_VERSION}`, {
|
|
162
|
+
headers: { Authorization: auth },
|
|
163
|
+
});
|
|
164
|
+
if (!res.ok)
|
|
165
|
+
return undefined;
|
|
166
|
+
const parsed = azdoThreadListSchema.parse(await res.json());
|
|
167
|
+
return parsed.value;
|
|
168
|
+
}
|
|
169
|
+
/** Filter out deleted threads, system comments, and Clancy automation comments. */
|
|
170
|
+
function activeThreads(threads) {
|
|
171
|
+
return threads.filter((t) => t.isDeleted !== true &&
|
|
172
|
+
t.comments.length > 0 &&
|
|
173
|
+
t.comments[0].commentType !== 'system' &&
|
|
174
|
+
!isClancyComment(t.comments[0].content ?? ''));
|
|
175
|
+
}
|
|
176
|
+
/** Filter threads by since timestamp (ISO 8601 string comparison). */
|
|
177
|
+
function filterBySince(threads, since) {
|
|
178
|
+
if (!since)
|
|
179
|
+
return threads;
|
|
180
|
+
return threads.filter((t) => (t.publishedDate ?? '') > since);
|
|
181
|
+
}
|
|
182
|
+
/** Format a thread into a feedback string, or empty if not actionable. */
|
|
183
|
+
function formatThread(t) {
|
|
184
|
+
const content = t.comments[0]?.content ?? '';
|
|
185
|
+
if (!content)
|
|
186
|
+
return [];
|
|
187
|
+
if (t.threadContext != null) {
|
|
188
|
+
const prefix = t.threadContext.filePath
|
|
189
|
+
? `[${t.threadContext.filePath}] `
|
|
190
|
+
: '';
|
|
191
|
+
return [`${prefix}${content}`];
|
|
192
|
+
}
|
|
193
|
+
if (isReworkComment(content)) {
|
|
194
|
+
return [extractReworkContent(content)];
|
|
195
|
+
}
|
|
196
|
+
return [];
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=azdo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azdo.js","sourceRoot":"","sources":["../../../../../src/dev/lifecycle/pull-request/azdo/azdo.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAK7C,4DAA4D;AAC5D,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAEtC,iCAAiC;AACjC,MAAM,QAAQ,GAAG,uBAAuB,CAAC;AAgDzC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,IAAkB;IAElB,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAClD,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAChE,MAAM,CAAC,GAAG,kBAAkB,CAAC,GAAG,CAAC,CA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AAQ;YACrC,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,QAAQ,IAAI;YAClC,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,CAAC,GAAG,MAAM,GAAG,OAAO,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/dev/lifecycle/pull-request/azdo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,GACd,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/dev/lifecycle/pull-request/azdo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,GACd,MAAM,WAAW,CAAC"}
|