chief-clancy 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/bundle/clancy-afk.js +6 -2
- package/dist/bundle/clancy-once.js +49 -48
- package/dist/installer/hook-installer/hook-installer.d.ts +2 -0
- package/dist/installer/hook-installer/hook-installer.d.ts.map +1 -1
- package/dist/installer/hook-installer/hook-installer.js +36 -1
- package/dist/installer/hook-installer/hook-installer.js.map +1 -1
- package/dist/installer/install.js +8 -0
- package/dist/installer/install.js.map +1 -1
- package/hooks/clancy-branch-guard.js +129 -0
- package/hooks/clancy-context-monitor.js +134 -46
- package/hooks/clancy-post-compact.js +53 -0
- package/hooks/package.json +3 -0
- package/package.json +7 -3
- package/src/agents/verification-gate.md +128 -0
- package/src/roles/setup/workflows/init.md +45 -0
- package/src/roles/setup/workflows/scaffold.md +30 -0
- package/src/roles/setup/workflows/settings.md +56 -0
- package/src/templates/.env.example.github +19 -1
- package/src/templates/.env.example.jira +25 -1
- package/src/templates/.env.example.linear +19 -1
- package/dist/schemas/bitbucket-pr.d.ts +0 -137
- package/dist/schemas/bitbucket-pr.d.ts.map +0 -1
- package/dist/schemas/bitbucket-pr.js +0 -75
- package/dist/schemas/bitbucket-pr.js.map +0 -1
- package/dist/schemas/env.d.ts +0 -150
- package/dist/schemas/env.d.ts.map +0 -1
- package/dist/schemas/env.js +0 -63
- package/dist/schemas/env.js.map +0 -1
- package/dist/schemas/github-issues.d.ts +0 -105
- package/dist/schemas/github-issues.d.ts.map +0 -1
- package/dist/schemas/github-issues.js +0 -54
- package/dist/schemas/github-issues.js.map +0 -1
- package/dist/schemas/gitlab-mr.d.ts +0 -73
- package/dist/schemas/gitlab-mr.d.ts.map +0 -1
- package/dist/schemas/gitlab-mr.js +0 -33
- package/dist/schemas/gitlab-mr.js.map +0 -1
- package/dist/schemas/jira.d.ts +0 -59
- package/dist/schemas/jira.d.ts.map +0 -1
- package/dist/schemas/jira.js +0 -56
- package/dist/schemas/jira.js.map +0 -1
- package/dist/schemas/linear.d.ts +0 -108
- package/dist/schemas/linear.d.ts.map +0 -1
- package/dist/schemas/linear.js +0 -84
- package/dist/schemas/linear.js.map +0 -1
- package/dist/scripts/afk/afk.d.ts +0 -21
- package/dist/scripts/afk/afk.d.ts.map +0 -1
- package/dist/scripts/afk/afk.js +0 -118
- package/dist/scripts/afk/afk.js.map +0 -1
- package/dist/scripts/board/github/github.d.ts +0 -104
- package/dist/scripts/board/github/github.d.ts.map +0 -1
- package/dist/scripts/board/github/github.js +0 -291
- package/dist/scripts/board/github/github.js.map +0 -1
- package/dist/scripts/board/jira/jira.d.ts +0 -139
- package/dist/scripts/board/jira/jira.d.ts.map +0 -1
- package/dist/scripts/board/jira/jira.js +0 -378
- package/dist/scripts/board/jira/jira.js.map +0 -1
- package/dist/scripts/board/linear/linear.d.ts +0 -129
- package/dist/scripts/board/linear/linear.d.ts.map +0 -1
- package/dist/scripts/board/linear/linear.js +0 -393
- package/dist/scripts/board/linear/linear.js.map +0 -1
- package/dist/scripts/once/board-ops/board-ops.d.ts +0 -26
- package/dist/scripts/once/board-ops/board-ops.d.ts.map +0 -1
- package/dist/scripts/once/board-ops/board-ops.js +0 -113
- package/dist/scripts/once/board-ops/board-ops.js.map +0 -1
- package/dist/scripts/once/deliver/deliver.d.ts +0 -37
- package/dist/scripts/once/deliver/deliver.d.ts.map +0 -1
- package/dist/scripts/once/deliver/deliver.js +0 -236
- package/dist/scripts/once/deliver/deliver.js.map +0 -1
- package/dist/scripts/once/fetch-ticket/fetch-ticket.d.ts +0 -22
- package/dist/scripts/once/fetch-ticket/fetch-ticket.d.ts.map +0 -1
- package/dist/scripts/once/fetch-ticket/fetch-ticket.js +0 -123
- package/dist/scripts/once/fetch-ticket/fetch-ticket.js.map +0 -1
- package/dist/scripts/once/git-token/git-token.d.ts +0 -13
- package/dist/scripts/once/git-token/git-token.d.ts.map +0 -1
- package/dist/scripts/once/git-token/git-token.js +0 -30
- package/dist/scripts/once/git-token/git-token.js.map +0 -1
- package/dist/scripts/once/once.d.ts +0 -12
- package/dist/scripts/once/once.d.ts.map +0 -1
- package/dist/scripts/once/once.js +0 -356
- package/dist/scripts/once/once.js.map +0 -1
- package/dist/scripts/once/pr-creation/pr-creation.d.ts +0 -11
- package/dist/scripts/once/pr-creation/pr-creation.d.ts.map +0 -1
- package/dist/scripts/once/pr-creation/pr-creation.js +0 -50
- package/dist/scripts/once/pr-creation/pr-creation.js.map +0 -1
- package/dist/scripts/once/rework/rework.d.ts +0 -32
- package/dist/scripts/once/rework/rework.d.ts.map +0 -1
- package/dist/scripts/once/rework/rework.js +0 -208
- package/dist/scripts/once/rework/rework.js.map +0 -1
- package/dist/scripts/once/types/types.d.ts +0 -13
- package/dist/scripts/once/types/types.d.ts.map +0 -1
- package/dist/scripts/once/types/types.js +0 -2
- package/dist/scripts/once/types/types.js.map +0 -1
- package/dist/scripts/shared/branch/branch.d.ts +0 -50
- package/dist/scripts/shared/branch/branch.d.ts.map +0 -1
- package/dist/scripts/shared/branch/branch.js +0 -61
- package/dist/scripts/shared/branch/branch.js.map +0 -1
- package/dist/scripts/shared/claude-cli/claude-cli.d.ts +0 -31
- package/dist/scripts/shared/claude-cli/claude-cli.d.ts.map +0 -1
- package/dist/scripts/shared/claude-cli/claude-cli.js +0 -60
- package/dist/scripts/shared/claude-cli/claude-cli.js.map +0 -1
- package/dist/scripts/shared/env-schema/env-schema.d.ts +0 -27
- package/dist/scripts/shared/env-schema/env-schema.d.ts.map +0 -1
- package/dist/scripts/shared/env-schema/env-schema.js +0 -47
- package/dist/scripts/shared/env-schema/env-schema.js.map +0 -1
- package/dist/scripts/shared/feasibility/feasibility.d.ts +0 -30
- package/dist/scripts/shared/feasibility/feasibility.d.ts.map +0 -1
- package/dist/scripts/shared/feasibility/feasibility.js +0 -68
- package/dist/scripts/shared/feasibility/feasibility.js.map +0 -1
- package/dist/scripts/shared/format/format.d.ts +0 -11
- package/dist/scripts/shared/format/format.d.ts.map +0 -1
- package/dist/scripts/shared/format/format.js +0 -18
- package/dist/scripts/shared/format/format.js.map +0 -1
- package/dist/scripts/shared/git-ops/git-ops.d.ts +0 -90
- package/dist/scripts/shared/git-ops/git-ops.d.ts.map +0 -1
- package/dist/scripts/shared/git-ops/git-ops.js +0 -190
- package/dist/scripts/shared/git-ops/git-ops.js.map +0 -1
- package/dist/scripts/shared/http/http.d.ts +0 -54
- package/dist/scripts/shared/http/http.d.ts.map +0 -1
- package/dist/scripts/shared/http/http.js +0 -76
- package/dist/scripts/shared/http/http.js.map +0 -1
- package/dist/scripts/shared/notify/notify.d.ts +0 -46
- package/dist/scripts/shared/notify/notify.d.ts.map +0 -1
- package/dist/scripts/shared/notify/notify.js +0 -88
- package/dist/scripts/shared/notify/notify.js.map +0 -1
- package/dist/scripts/shared/preflight/preflight.d.ts +0 -40
- package/dist/scripts/shared/preflight/preflight.d.ts.map +0 -1
- package/dist/scripts/shared/preflight/preflight.js +0 -96
- package/dist/scripts/shared/preflight/preflight.js.map +0 -1
- package/dist/scripts/shared/progress/progress.d.ts +0 -75
- package/dist/scripts/shared/progress/progress.d.ts.map +0 -1
- package/dist/scripts/shared/progress/progress.js +0 -210
- package/dist/scripts/shared/progress/progress.js.map +0 -1
- package/dist/scripts/shared/prompt/prompt.d.ts +0 -58
- package/dist/scripts/shared/prompt/prompt.d.ts.map +0 -1
- package/dist/scripts/shared/prompt/prompt.js +0 -123
- package/dist/scripts/shared/prompt/prompt.js.map +0 -1
- package/dist/scripts/shared/pull-request/bitbucket/bitbucket.d.ts +0 -82
- package/dist/scripts/shared/pull-request/bitbucket/bitbucket.d.ts.map +0 -1
- package/dist/scripts/shared/pull-request/bitbucket/bitbucket.js +0 -301
- package/dist/scripts/shared/pull-request/bitbucket/bitbucket.js.map +0 -1
- package/dist/scripts/shared/pull-request/github/github.d.ts +0 -72
- package/dist/scripts/shared/pull-request/github/github.d.ts.map +0 -1
- package/dist/scripts/shared/pull-request/github/github.js +0 -226
- package/dist/scripts/shared/pull-request/github/github.js.map +0 -1
- package/dist/scripts/shared/pull-request/gitlab/gitlab.d.ts +0 -74
- package/dist/scripts/shared/pull-request/gitlab/gitlab.d.ts.map +0 -1
- package/dist/scripts/shared/pull-request/gitlab/gitlab.js +0 -220
- package/dist/scripts/shared/pull-request/gitlab/gitlab.js.map +0 -1
- package/dist/scripts/shared/pull-request/post-pr/post-pr.d.ts +0 -31
- package/dist/scripts/shared/pull-request/post-pr/post-pr.d.ts.map +0 -1
- package/dist/scripts/shared/pull-request/post-pr/post-pr.js +0 -61
- package/dist/scripts/shared/pull-request/post-pr/post-pr.js.map +0 -1
- package/dist/scripts/shared/pull-request/pr-body/pr-body.d.ts +0 -40
- package/dist/scripts/shared/pull-request/pr-body/pr-body.d.ts.map +0 -1
- package/dist/scripts/shared/pull-request/pr-body/pr-body.js +0 -84
- package/dist/scripts/shared/pull-request/pr-body/pr-body.js.map +0 -1
- package/dist/scripts/shared/pull-request/rework-comment/rework-comment.d.ts +0 -23
- package/dist/scripts/shared/pull-request/rework-comment/rework-comment.d.ts.map +0 -1
- package/dist/scripts/shared/pull-request/rework-comment/rework-comment.js +0 -30
- package/dist/scripts/shared/pull-request/rework-comment/rework-comment.js.map +0 -1
- package/dist/scripts/shared/remote/remote.d.ts +0 -41
- package/dist/scripts/shared/remote/remote.d.ts.map +0 -1
- package/dist/scripts/shared/remote/remote.js +0 -227
- package/dist/scripts/shared/remote/remote.js.map +0 -1
- package/dist/types/board.d.ts +0 -13
- package/dist/types/board.d.ts.map +0 -1
- package/dist/types/board.js +0 -5
- package/dist/types/board.js.map +0 -1
- package/dist/types/index.d.ts +0 -4
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/types/remote.d.ts +0 -55
- package/dist/types/remote.d.ts.map +0 -1
- package/dist/types/remote.js +0 -5
- package/dist/types/remote.js.map +0 -1
- package/dist/utils/parse-json/parse-json.d.ts +0 -20
- package/dist/utils/parse-json/parse-json.d.ts.map +0 -1
- package/dist/utils/parse-json/parse-json.js +0 -27
- package/dist/utils/parse-json/parse-json.js.map +0 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Verification Gate Agent
|
|
2
|
+
|
|
3
|
+
You are the verification gate agent for Clancy. You run as a `type: "agent"` Stop hook in Claude Code. Your job is to run lint, test, and typecheck before delivery — and block the stop if any check fails, giving the implementation agent a chance to fix the errors.
|
|
4
|
+
|
|
5
|
+
You have full tool access: Read, Edit, Write, Glob, Grep, Bash. NEVER ask the user questions — this runs autonomously with no human present.
|
|
6
|
+
|
|
7
|
+
## Instructions
|
|
8
|
+
|
|
9
|
+
Work through the following steps in order. Exit early whenever an early-exit condition is met.
|
|
10
|
+
|
|
11
|
+
### Step 1 — Check if in a Clancy run
|
|
12
|
+
|
|
13
|
+
Read `.clancy/lock.json` in the project root. If the file does not exist, this is not a Clancy implementation session. Respond immediately:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{"decision": "allow"}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Step 2 — Check for stop hook recursion
|
|
20
|
+
|
|
21
|
+
Check the hook input for `stop_hook_active: true`. If set, respond immediately to prevent infinite loops:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{"decision": "allow"}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Step 3 — Read retry state
|
|
28
|
+
|
|
29
|
+
Read `.clancy/verify-attempt.txt` from the project root. If the file does not exist, this is attempt 1. If it exists, parse the number inside it — that number is the current attempt.
|
|
30
|
+
|
|
31
|
+
### Step 4 — Check max retries
|
|
32
|
+
|
|
33
|
+
Read the `CLANCY_FIX_RETRIES` environment variable. Default to `2` if not set.
|
|
34
|
+
|
|
35
|
+
**Special case: `CLANCY_FIX_RETRIES=0`** means "verify once but never retry." On attempt 1, run checks normally. If they fail, write `1` to `.clancy/verify-attempt.txt` and respond with `{"decision": "allow"}` — do NOT block. The PR body will include the verification warning. On attempt 2+, allow immediately.
|
|
36
|
+
|
|
37
|
+
**Normal case: `CLANCY_FIX_RETRIES >= 1`** — The first attempt (attempt 1) ALWAYS runs verification. On subsequent attempts, check if retries are exhausted: if the current attempt is greater than `maxRetries + 1`, max retries have been exhausted (attempt 1 = initial check, attempts 2 through maxRetries+1 = fix retries). When exhausted, keep `.clancy/verify-attempt.txt` in place (the delivery flow reads it to add a verification warning to the PR body). Respond immediately:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{"decision": "allow"}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The PR body will include a verification warning — delivery should not be blocked indefinitely.
|
|
44
|
+
|
|
45
|
+
### Step 5 — Detect check commands
|
|
46
|
+
|
|
47
|
+
First check for the `CLANCY_VERIFY_COMMANDS` environment variable. If set, use its value as a comma-separated list of **full shell commands** to run (e.g. `npm run lint,npm test,npm run typecheck`). Execute each command directly via Bash — do NOT wrap in `npm run`. Skip auto-detection.
|
|
48
|
+
|
|
49
|
+
If `CLANCY_VERIFY_COMMANDS` is not set, read `package.json` and inspect the `scripts` object. Auto-detect checks by matching script names:
|
|
50
|
+
|
|
51
|
+
| Script name pattern | Check type |
|
|
52
|
+
|---|---|
|
|
53
|
+
| `lint`, `eslint` | lint |
|
|
54
|
+
| `test`, `vitest`, `jest` | test |
|
|
55
|
+
| `typecheck`, `tsc`, `check-types` | typecheck |
|
|
56
|
+
|
|
57
|
+
Match exact script names only — do not match partial names like `test:e2e` or `lint:fix`. Use the first match per check type.
|
|
58
|
+
|
|
59
|
+
If no check commands are detected at all, respond immediately:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{"decision": "allow"}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Step 6 — Run checks
|
|
66
|
+
|
|
67
|
+
Execute each detected command using Bash: `npm run <script-name>`. Run them sequentially (not in parallel) so output is clear. Capture both stdout and stderr for each command.
|
|
68
|
+
|
|
69
|
+
Truncate each command's output to the last 500 lines. This prevents overwhelming context on large test suites.
|
|
70
|
+
|
|
71
|
+
Track which checks passed and which failed.
|
|
72
|
+
|
|
73
|
+
### Step 7 — All checks passed
|
|
74
|
+
|
|
75
|
+
If every check exits with code 0, delete `.clancy/verify-attempt.txt` if it exists, then respond:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{"decision": "allow"}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Step 8 — One or more checks failed
|
|
82
|
+
|
|
83
|
+
If any check fails:
|
|
84
|
+
|
|
85
|
+
1. Write the next attempt number to `.clancy/verify-attempt.txt` (current attempt + 1).
|
|
86
|
+
2. Build the reason string with the format below.
|
|
87
|
+
3. Respond with a block decision.
|
|
88
|
+
|
|
89
|
+
Read `CLANCY_FIX_RETRIES` (default 2) to determine the max. Use the current attempt number and max to select an escalation hint:
|
|
90
|
+
|
|
91
|
+
- **Attempt 1**: "Fix the specific errors reported above."
|
|
92
|
+
- **Attempt 2**: "If the same errors persist, consider reverting the problematic change and taking a different approach."
|
|
93
|
+
- **Attempt 3+**: "Consider reverting to the last known working state. Focus on delivering working code rather than complete code."
|
|
94
|
+
|
|
95
|
+
Response format:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"decision": "block",
|
|
100
|
+
"reason": "Verification failed (attempt N of M):\n\n[check name]: FAILED\n[truncated output — last 500 lines]\n\n[check name]: PASSED\n\n[escalation hint]"
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Include output only for failed checks. List passed checks on a single line with no output.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Fail-open rule
|
|
109
|
+
|
|
110
|
+
If the agent itself encounters an unexpected error at any point (file read failure, malformed JSON, missing tool, etc.), respond with:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{"decision": "allow"}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Never crash or leave the stop unresolved. The gate is a safety net, not a hard barrier.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Rules
|
|
121
|
+
|
|
122
|
+
- NEVER ask the human questions. This runs autonomously as a stop hook.
|
|
123
|
+
- NEVER modify source code. Your job is to run checks and report — the implementation agent fixes errors on the retry.
|
|
124
|
+
- Always respond with exactly one JSON object: `{"decision": "allow"}` or `{"decision": "block", "reason": "..."}`.
|
|
125
|
+
- No other output format is accepted. Do not wrap the JSON in markdown code fences in your final response.
|
|
126
|
+
- Truncate command output to 500 lines maximum per check. Prefer the tail (last N lines) — error summaries are usually at the end.
|
|
127
|
+
- Sequential execution only — run one check at a time so failures are clearly attributed.
|
|
128
|
+
- Clean up `.clancy/verify-attempt.txt` on success only. On max-retries-exhausted, keep the file so the delivery flow can detect it and add a verification warning to the PR body.
|
|
@@ -452,6 +452,51 @@ If [2]: store `CLANCY_MODE=afk` in `.clancy/.env`.
|
|
|
452
452
|
|
|
453
453
|
---
|
|
454
454
|
|
|
455
|
+
### Q3h (all boards): Reliable autonomous mode
|
|
456
|
+
|
|
457
|
+
Output:
|
|
458
|
+
|
|
459
|
+
```
|
|
460
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
461
|
+
Reliable Autonomous Mode
|
|
462
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
463
|
+
|
|
464
|
+
These settings control self-healing and safety limits for autonomous runs.
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
**Fix retries:**
|
|
468
|
+
|
|
469
|
+
```
|
|
470
|
+
Max self-healing attempts after a verification failure? [2]
|
|
471
|
+
(Range: 0–5. When lint/test/typecheck fails, Clancy retries up to this many times before delivering anyway.)
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
If a number 0–5 is entered: store as `CLANCY_FIX_RETRIES` in `.clancy/.env`.
|
|
475
|
+
If enter is pressed with no value: use default 2 — store `CLANCY_FIX_RETRIES=2` in `.clancy/.env`.
|
|
476
|
+
If the value is outside 0–5: re-prompt.
|
|
477
|
+
|
|
478
|
+
**Time limit:**
|
|
479
|
+
|
|
480
|
+
```
|
|
481
|
+
Per-ticket time limit in minutes? [30]
|
|
482
|
+
(0 to disable. Clancy will stop working on a ticket after this many minutes.)
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
If a non-negative integer is entered: store as `CLANCY_TIME_LIMIT` in `.clancy/.env`.
|
|
486
|
+
If enter is pressed with no value: use default 30 — store `CLANCY_TIME_LIMIT=30` in `.clancy/.env`.
|
|
487
|
+
If the value is negative or not a number: re-prompt.
|
|
488
|
+
|
|
489
|
+
**Branch guard:**
|
|
490
|
+
|
|
491
|
+
```
|
|
492
|
+
Enable branch guard hook? Prevents accidental commits to the base branch. [Y/n]
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
If `y`, `Y`, or enter: store `CLANCY_BRANCH_GUARD=true` in `.clancy/.env`.
|
|
496
|
+
If `n` or `N`: store `CLANCY_BRANCH_GUARD=false` in `.clancy/.env`.
|
|
497
|
+
|
|
498
|
+
---
|
|
499
|
+
|
|
455
500
|
### Q4: Base branch (auto-detect)
|
|
456
501
|
|
|
457
502
|
Silently detect the base branch — do not ask unless detection fails:
|
|
@@ -436,6 +436,16 @@ MAX_ITERATIONS=5
|
|
|
436
436
|
# Set to "false" to disable skip comments
|
|
437
437
|
# CLANCY_SKIP_COMMENTS=true
|
|
438
438
|
|
|
439
|
+
# ─── Optional: Reliable autonomous mode ───────────────────────────────────────
|
|
440
|
+
# Max self-healing attempts after verification failure (default: 2, range 0-5)
|
|
441
|
+
# CLANCY_FIX_RETRIES=2
|
|
442
|
+
|
|
443
|
+
# Per-ticket time limit in minutes (default: 30, 0 to disable)
|
|
444
|
+
# CLANCY_TIME_LIMIT=30
|
|
445
|
+
|
|
446
|
+
# Prevent accidental commits to the base branch (default: true)
|
|
447
|
+
# CLANCY_BRANCH_GUARD=true
|
|
448
|
+
|
|
439
449
|
# ─── Optional: Notifications ──────────────────────────────────────────────────
|
|
440
450
|
# Webhook URL for Slack or Teams notifications on ticket completion
|
|
441
451
|
# CLANCY_NOTIFY_WEBHOOK=https://hooks.slack.com/services/your/webhook/url
|
|
@@ -521,6 +531,16 @@ MAX_ITERATIONS=20
|
|
|
521
531
|
# Set to "false" to disable skip comments
|
|
522
532
|
# CLANCY_SKIP_COMMENTS=true
|
|
523
533
|
|
|
534
|
+
# ─── Optional: Reliable autonomous mode ───────────────────────────────────────
|
|
535
|
+
# Max self-healing attempts after verification failure (default: 2, range 0-5)
|
|
536
|
+
# CLANCY_FIX_RETRIES=2
|
|
537
|
+
|
|
538
|
+
# Per-ticket time limit in minutes (default: 30, 0 to disable)
|
|
539
|
+
# CLANCY_TIME_LIMIT=30
|
|
540
|
+
|
|
541
|
+
# Prevent accidental commits to the base branch (default: true)
|
|
542
|
+
# CLANCY_BRANCH_GUARD=true
|
|
543
|
+
|
|
524
544
|
# ─── Optional: Notifications ──────────────────────────────────────────────────
|
|
525
545
|
# Webhook URL for Slack or Teams notifications on ticket completion
|
|
526
546
|
# CLANCY_NOTIFY_WEBHOOK=https://hooks.slack.com/services/your/webhook/url
|
|
@@ -616,6 +636,16 @@ MAX_ITERATIONS=20
|
|
|
616
636
|
# CLANCY_GIT_PLATFORM=gitlab # override auto-detection (github/gitlab/bitbucket)
|
|
617
637
|
# CLANCY_GIT_API_URL=https://gitlab.example.com/api/v4 # self-hosted git API base URL
|
|
618
638
|
|
|
639
|
+
# ─── Optional: Reliable autonomous mode ───────────────────────────────────────
|
|
640
|
+
# Max self-healing attempts after verification failure (default: 2, range 0-5)
|
|
641
|
+
# CLANCY_FIX_RETRIES=2
|
|
642
|
+
|
|
643
|
+
# Per-ticket time limit in minutes (default: 30, 0 to disable)
|
|
644
|
+
# CLANCY_TIME_LIMIT=30
|
|
645
|
+
|
|
646
|
+
# Prevent accidental commits to the base branch (default: true)
|
|
647
|
+
# CLANCY_BRANCH_GUARD=true
|
|
648
|
+
|
|
619
649
|
# ─── Optional: Skip comments ──────────────────────────────────────────────
|
|
620
650
|
# When Clancy skips a ticket (irrelevant/infeasible), post a comment explaining why
|
|
621
651
|
# Set to "false" to disable skip comments
|
|
@@ -55,6 +55,9 @@ General
|
|
|
55
55
|
[G4] Max rework {CLANCY_MAX_REWORK:-3}
|
|
56
56
|
[G5] TDD mode {on if CLANCY_TDD=true, else off}
|
|
57
57
|
[G6] Grill mode {CLANCY_MODE:-interactive}
|
|
58
|
+
[G7] Fix retries {CLANCY_FIX_RETRIES:-2} self-healing attempts after verification failure
|
|
59
|
+
[G8] Time limit {CLANCY_TIME_LIMIT:-30} per-ticket time limit in minutes (0 = disabled)
|
|
60
|
+
[G9] Branch guard {on if CLANCY_BRANCH_GUARD=true or unset, off if false}
|
|
58
61
|
|
|
59
62
|
{If Jira:}
|
|
60
63
|
Jira
|
|
@@ -214,6 +217,59 @@ If [2]: write `CLANCY_MODE=afk` to `.clancy/.env`.
|
|
|
214
217
|
|
|
215
218
|
---
|
|
216
219
|
|
|
220
|
+
### [G7] Fix retries
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
Fix retries — current: {value or 2}
|
|
224
|
+
Max self-healing attempts after a verification failure (lint/test/typecheck).
|
|
225
|
+
When exhausted, Clancy delivers anyway with a warning in the PR body.
|
|
226
|
+
|
|
227
|
+
[1] 2 (default)
|
|
228
|
+
[2] Enter a different number (0–5)
|
|
229
|
+
[3] Cancel
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Validate the input is an integer between 0 and 5. If invalid, re-prompt.
|
|
233
|
+
|
|
234
|
+
If [1]: remove `CLANCY_FIX_RETRIES` from `.clancy/.env` (uses default).
|
|
235
|
+
If [2]: prompt `How many fix retries?` then write `CLANCY_FIX_RETRIES=<value>` to `.clancy/.env`.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
### [G8] Time limit
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
Time limit — current: {value or 30} minutes
|
|
243
|
+
Per-ticket time limit. Clancy stops working on a ticket after this many minutes.
|
|
244
|
+
Set to 0 to disable.
|
|
245
|
+
|
|
246
|
+
[1] 30 minutes (default)
|
|
247
|
+
[2] Enter a different number
|
|
248
|
+
[3] Cancel
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Validate the input is a non-negative integer. If invalid, re-prompt.
|
|
252
|
+
|
|
253
|
+
If [1]: remove `CLANCY_TIME_LIMIT` from `.clancy/.env` (uses default).
|
|
254
|
+
If [2]: prompt `Time limit in minutes? (0 to disable)` then write `CLANCY_TIME_LIMIT=<value>` to `.clancy/.env`.
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
### [G9] Branch guard
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
Branch guard — current: {on/off}
|
|
262
|
+
Prevents accidental commits to the base branch during autonomous runs.
|
|
263
|
+
|
|
264
|
+
[1] Enable (default)
|
|
265
|
+
[2] Disable
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
If [1]: write `CLANCY_BRANCH_GUARD=true` to `.clancy/.env`.
|
|
269
|
+
If [2]: write `CLANCY_BRANCH_GUARD=false` to `.clancy/.env`.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
217
273
|
### [B1] Jira status filter (Jira only)
|
|
218
274
|
|
|
219
275
|
```
|
|
@@ -19,7 +19,7 @@ CLANCY_BASE_BRANCH=main
|
|
|
19
19
|
# ─── Optional roles ─────────────────────────────────────────────────────────
|
|
20
20
|
# Comma-separated list of optional roles to enable (e.g. planner)
|
|
21
21
|
# Core roles (implementer, reviewer, setup) are always active.
|
|
22
|
-
# CLANCY_ROLES=planner
|
|
22
|
+
# CLANCY_ROLES=planner,strategist
|
|
23
23
|
|
|
24
24
|
# ─── Loop ─────────────────────────────────────────────────────────────────────
|
|
25
25
|
# Max tickets to process per /clancy:run session (default: 20)
|
|
@@ -50,3 +50,21 @@ MAX_ITERATIONS=20
|
|
|
50
50
|
# ─── Optional: Notifications ──────────────────────────────────────────────────
|
|
51
51
|
# Webhook URL for Slack or Teams notifications on ticket completion
|
|
52
52
|
# CLANCY_NOTIFY_WEBHOOK=https://hooks.slack.com/services/your/webhook/url
|
|
53
|
+
|
|
54
|
+
# ─── Optional: Strategist ──────────────────────────────────────────────────
|
|
55
|
+
# Default parent issue for text/file-sourced briefs
|
|
56
|
+
# CLANCY_BRIEF_EPIC=50
|
|
57
|
+
# Auto-set component label on created tickets
|
|
58
|
+
# CLANCY_COMPONENT=api
|
|
59
|
+
# Grill mode: "interactive" (human grill) or "afk" (AI-grill). Default: interactive
|
|
60
|
+
# CLANCY_MODE=interactive
|
|
61
|
+
|
|
62
|
+
# ─── Optional: Reliable autonomous mode ─────────────────────────────────────
|
|
63
|
+
# Max self-healing fix attempts before delivering with warnings (default: 2, 0 to disable)
|
|
64
|
+
# CLANCY_FIX_RETRIES=2
|
|
65
|
+
# Per-ticket time limit in minutes (default: 30, 0 to disable)
|
|
66
|
+
# CLANCY_TIME_LIMIT=30
|
|
67
|
+
# Block force push, protected branch push, destructive resets (default: true)
|
|
68
|
+
# CLANCY_BRANCH_GUARD=true
|
|
69
|
+
# Token estimation rate for cost logging (tokens/min, default: 6600)
|
|
70
|
+
# CLANCY_TOKEN_RATE=6600
|
|
@@ -29,7 +29,7 @@ CLANCY_BASE_BRANCH=main
|
|
|
29
29
|
# ─── Optional roles ─────────────────────────────────────────────────────────
|
|
30
30
|
# Comma-separated list of optional roles to enable (e.g. planner)
|
|
31
31
|
# Core roles (implementer, reviewer, setup) are always active.
|
|
32
|
-
# CLANCY_ROLES=planner
|
|
32
|
+
# CLANCY_ROLES=planner,strategist
|
|
33
33
|
|
|
34
34
|
# ─── Loop ─────────────────────────────────────────────────────────────────────
|
|
35
35
|
# Max tickets to process per /clancy:run session (default: 5)
|
|
@@ -66,3 +66,27 @@ MAX_ITERATIONS=5
|
|
|
66
66
|
# ─── Optional: Notifications ──────────────────────────────────────────────────
|
|
67
67
|
# Webhook URL for Slack or Teams notifications on ticket completion
|
|
68
68
|
# CLANCY_NOTIFY_WEBHOOK=https://hooks.slack.com/services/your/webhook/url
|
|
69
|
+
|
|
70
|
+
# ─── Optional: Strategist ──────────────────────────────────────────────────
|
|
71
|
+
# Issue type for tickets created by /clancy:approve-brief (default: Task)
|
|
72
|
+
# CLANCY_BRIEF_ISSUE_TYPE=Task
|
|
73
|
+
# Default parent epic for text/file-sourced briefs
|
|
74
|
+
# CLANCY_BRIEF_EPIC=PROJ-100
|
|
75
|
+
# Auto-set component on created tickets
|
|
76
|
+
# CLANCY_COMPONENT=api
|
|
77
|
+
# Grill mode: "interactive" (human grill) or "afk" (AI-grill). Default: interactive
|
|
78
|
+
# CLANCY_MODE=interactive
|
|
79
|
+
|
|
80
|
+
# ─── Optional: Reliable autonomous mode ─────────────────────────────────────
|
|
81
|
+
# Max self-healing fix attempts before delivering with warnings (default: 2, 0 to disable)
|
|
82
|
+
# CLANCY_FIX_RETRIES=2
|
|
83
|
+
# Per-ticket time limit in minutes (default: 30, 0 to disable)
|
|
84
|
+
# CLANCY_TIME_LIMIT=30
|
|
85
|
+
# Block force push, protected branch push, destructive resets (default: true)
|
|
86
|
+
# CLANCY_BRANCH_GUARD=true
|
|
87
|
+
# Token estimation rate for cost logging (tokens/min, default: 6600)
|
|
88
|
+
# CLANCY_TOKEN_RATE=6600
|
|
89
|
+
|
|
90
|
+
# ─── Optional: Status transitions (continued) ──────────────────────────────
|
|
91
|
+
# Status for PR review (falls back to CLANCY_STATUS_DONE if not set)
|
|
92
|
+
# CLANCY_STATUS_REVIEW="In Review"
|
|
@@ -19,7 +19,7 @@ CLANCY_BASE_BRANCH=main
|
|
|
19
19
|
# ─── Optional roles ─────────────────────────────────────────────────────────
|
|
20
20
|
# Comma-separated list of optional roles to enable (e.g. planner)
|
|
21
21
|
# Core roles (implementer, reviewer, setup) are always active.
|
|
22
|
-
# CLANCY_ROLES=planner
|
|
22
|
+
# CLANCY_ROLES=planner,strategist
|
|
23
23
|
|
|
24
24
|
# ─── Loop ─────────────────────────────────────────────────────────────────────
|
|
25
25
|
# Max tickets to process per /clancy:run session (default: 20)
|
|
@@ -56,3 +56,21 @@ MAX_ITERATIONS=20
|
|
|
56
56
|
# ─── Optional: Notifications ──────────────────────────────────────────────────
|
|
57
57
|
# Webhook URL for Slack or Teams notifications on ticket completion
|
|
58
58
|
# CLANCY_NOTIFY_WEBHOOK=https://hooks.slack.com/services/your/webhook/url
|
|
59
|
+
|
|
60
|
+
# ─── Optional: Strategist ──────────────────────────────────────────────────
|
|
61
|
+
# Default parent issue for text/file-sourced briefs
|
|
62
|
+
# CLANCY_BRIEF_EPIC=ENG-100
|
|
63
|
+
# Auto-set component label on created tickets
|
|
64
|
+
# CLANCY_COMPONENT=api
|
|
65
|
+
# Grill mode: "interactive" (human grill) or "afk" (AI-grill). Default: interactive
|
|
66
|
+
# CLANCY_MODE=interactive
|
|
67
|
+
|
|
68
|
+
# ─── Optional: Reliable autonomous mode ─────────────────────────────────────
|
|
69
|
+
# Max self-healing fix attempts before delivering with warnings (default: 2, 0 to disable)
|
|
70
|
+
# CLANCY_FIX_RETRIES=2
|
|
71
|
+
# Per-ticket time limit in minutes (default: 30, 0 to disable)
|
|
72
|
+
# CLANCY_TIME_LIMIT=30
|
|
73
|
+
# Block force push, protected branch push, destructive resets (default: true)
|
|
74
|
+
# CLANCY_BRANCH_GUARD=true
|
|
75
|
+
# Token estimation rate for cost logging (tokens/min, default: 6600)
|
|
76
|
+
# CLANCY_TOKEN_RATE=6600
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schemas for Bitbucket PR API responses (Cloud and Server).
|
|
3
|
-
*/
|
|
4
|
-
import * as z from 'zod/mini';
|
|
5
|
-
/** A single PR from the Cloud list endpoint. */
|
|
6
|
-
export declare const bitbucketPrSchema: z.ZodMiniObject<{
|
|
7
|
-
id: z.ZodMiniNumber<number>;
|
|
8
|
-
links: z.ZodMiniObject<{
|
|
9
|
-
html: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
10
|
-
href: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
11
|
-
}, z.core.$strip>>;
|
|
12
|
-
}, z.core.$strip>;
|
|
13
|
-
participants: z.ZodMiniArray<z.ZodMiniObject<{
|
|
14
|
-
state: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
15
|
-
role: z.ZodMiniString<string>;
|
|
16
|
-
}, z.core.$strip>>;
|
|
17
|
-
}, z.core.$strip>;
|
|
18
|
-
/** Response from `GET /repositories/{workspace}/{slug}/pullrequests` (paginated). */
|
|
19
|
-
export declare const bitbucketPrListSchema: z.ZodMiniObject<{
|
|
20
|
-
values: z.ZodMiniArray<z.ZodMiniObject<{
|
|
21
|
-
id: z.ZodMiniNumber<number>;
|
|
22
|
-
links: z.ZodMiniObject<{
|
|
23
|
-
html: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
24
|
-
href: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
25
|
-
}, z.core.$strip>>;
|
|
26
|
-
}, z.core.$strip>;
|
|
27
|
-
participants: z.ZodMiniArray<z.ZodMiniObject<{
|
|
28
|
-
state: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
29
|
-
role: z.ZodMiniString<string>;
|
|
30
|
-
}, z.core.$strip>>;
|
|
31
|
-
}, z.core.$strip>>;
|
|
32
|
-
}, z.core.$strip>;
|
|
33
|
-
/** A single inline comment on a Cloud PR. */
|
|
34
|
-
export declare const bitbucketCommentSchema: z.ZodMiniObject<{
|
|
35
|
-
content: z.ZodMiniObject<{
|
|
36
|
-
raw: z.ZodMiniString<string>;
|
|
37
|
-
}, z.core.$strip>;
|
|
38
|
-
inline: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
39
|
-
path: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
40
|
-
}, z.core.$strip>>;
|
|
41
|
-
created_on: z.ZodMiniString<string>;
|
|
42
|
-
user: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
43
|
-
nickname: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
44
|
-
}, z.core.$strip>>;
|
|
45
|
-
}, z.core.$strip>;
|
|
46
|
-
/** Response from `GET /repositories/{workspace}/{slug}/pullrequests/{id}/comments` (paginated). */
|
|
47
|
-
export declare const bitbucketCommentsSchema: z.ZodMiniObject<{
|
|
48
|
-
values: z.ZodMiniArray<z.ZodMiniObject<{
|
|
49
|
-
content: z.ZodMiniObject<{
|
|
50
|
-
raw: z.ZodMiniString<string>;
|
|
51
|
-
}, z.core.$strip>;
|
|
52
|
-
inline: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
53
|
-
path: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
54
|
-
}, z.core.$strip>>;
|
|
55
|
-
created_on: z.ZodMiniString<string>;
|
|
56
|
-
user: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
57
|
-
nickname: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
58
|
-
}, z.core.$strip>>;
|
|
59
|
-
}, z.core.$strip>>;
|
|
60
|
-
}, z.core.$strip>;
|
|
61
|
-
/** A single PR from the Server list endpoint. */
|
|
62
|
-
export declare const bitbucketServerPrSchema: z.ZodMiniObject<{
|
|
63
|
-
id: z.ZodMiniNumber<number>;
|
|
64
|
-
links: z.ZodMiniObject<{
|
|
65
|
-
self: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
66
|
-
href: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
67
|
-
}, z.core.$strip>>>;
|
|
68
|
-
}, z.core.$strip>;
|
|
69
|
-
reviewers: z.ZodMiniArray<z.ZodMiniObject<{
|
|
70
|
-
status: z.ZodMiniString<string>;
|
|
71
|
-
}, z.core.$strip>>;
|
|
72
|
-
}, z.core.$strip>;
|
|
73
|
-
/** Response from `GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests` (paginated). */
|
|
74
|
-
export declare const bitbucketServerPrListSchema: z.ZodMiniObject<{
|
|
75
|
-
values: z.ZodMiniArray<z.ZodMiniObject<{
|
|
76
|
-
id: z.ZodMiniNumber<number>;
|
|
77
|
-
links: z.ZodMiniObject<{
|
|
78
|
-
self: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
79
|
-
href: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
80
|
-
}, z.core.$strip>>>;
|
|
81
|
-
}, z.core.$strip>;
|
|
82
|
-
reviewers: z.ZodMiniArray<z.ZodMiniObject<{
|
|
83
|
-
status: z.ZodMiniString<string>;
|
|
84
|
-
}, z.core.$strip>>;
|
|
85
|
-
}, z.core.$strip>>;
|
|
86
|
-
}, z.core.$strip>;
|
|
87
|
-
/** A comment object nested inside a Server activity. */
|
|
88
|
-
export declare const bitbucketServerCommentSchema: z.ZodMiniObject<{
|
|
89
|
-
text: z.ZodMiniString<string>;
|
|
90
|
-
anchor: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
91
|
-
path: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
92
|
-
}, z.core.$strip>>;
|
|
93
|
-
createdDate: z.ZodMiniNumber<number>;
|
|
94
|
-
author: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
95
|
-
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
96
|
-
}, z.core.$strip>>;
|
|
97
|
-
}, z.core.$strip>;
|
|
98
|
-
/** A single activity on a Server PR (from /activities endpoint). */
|
|
99
|
-
export declare const bitbucketServerActivitySchema: z.ZodMiniObject<{
|
|
100
|
-
action: z.ZodMiniString<string>;
|
|
101
|
-
comment: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
102
|
-
text: z.ZodMiniString<string>;
|
|
103
|
-
anchor: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
104
|
-
path: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
105
|
-
}, z.core.$strip>>;
|
|
106
|
-
createdDate: z.ZodMiniNumber<number>;
|
|
107
|
-
author: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
108
|
-
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
109
|
-
}, z.core.$strip>>;
|
|
110
|
-
}, z.core.$strip>>;
|
|
111
|
-
}, z.core.$strip>;
|
|
112
|
-
/** Response from `GET /rest/api/latest/.../pull-requests/{id}/activities` (paginated). */
|
|
113
|
-
export declare const bitbucketServerActivitiesSchema: z.ZodMiniObject<{
|
|
114
|
-
values: z.ZodMiniArray<z.ZodMiniObject<{
|
|
115
|
-
action: z.ZodMiniString<string>;
|
|
116
|
-
comment: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
117
|
-
text: z.ZodMiniString<string>;
|
|
118
|
-
anchor: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
119
|
-
path: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
120
|
-
}, z.core.$strip>>;
|
|
121
|
-
createdDate: z.ZodMiniNumber<number>;
|
|
122
|
-
author: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
123
|
-
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
124
|
-
}, z.core.$strip>>;
|
|
125
|
-
}, z.core.$strip>>;
|
|
126
|
-
}, z.core.$strip>>;
|
|
127
|
-
}, z.core.$strip>;
|
|
128
|
-
export type BitbucketPr = z.infer<typeof bitbucketPrSchema>;
|
|
129
|
-
export type BitbucketPrList = z.infer<typeof bitbucketPrListSchema>;
|
|
130
|
-
export type BitbucketComment = z.infer<typeof bitbucketCommentSchema>;
|
|
131
|
-
export type BitbucketComments = z.infer<typeof bitbucketCommentsSchema>;
|
|
132
|
-
export type BitbucketServerPr = z.infer<typeof bitbucketServerPrSchema>;
|
|
133
|
-
export type BitbucketServerPrList = z.infer<typeof bitbucketServerPrListSchema>;
|
|
134
|
-
export type BitbucketServerComment = z.infer<typeof bitbucketServerCommentSchema>;
|
|
135
|
-
export type BitbucketServerActivity = z.infer<typeof bitbucketServerActivitySchema>;
|
|
136
|
-
export type BitbucketServerActivities = z.infer<typeof bitbucketServerActivitiesSchema>;
|
|
137
|
-
//# sourceMappingURL=bitbucket-pr.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bitbucket-pr.d.ts","sourceRoot":"","sources":["../../src/schemas/bitbucket-pr.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAM9B,gDAAgD;AAChD,eAAO,MAAM,iBAAiB;;;;;;;;;;;iBAW5B,CAAC;AAEH,qFAAqF;AACrF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;iBAEhC,CAAC;AAEH,6CAA6C;AAC7C,eAAO,MAAM,sBAAsB;;;;;;;;;;;iBAajC,CAAC;AAEH,mGAAmG;AACnG,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;iBAElC,CAAC;AAMH,iDAAiD;AACjD,eAAO,MAAM,uBAAuB;;;;;;;;;;iBAUlC,CAAC;AAEH,kGAAkG;AAClG,eAAO,MAAM,2BAA2B;;;;;;;;;;;;iBAEtC,CAAC;AAEH,wDAAwD;AACxD,eAAO,MAAM,4BAA4B;;;;;;;;;iBAavC,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;iBAGxC,CAAC;AAEH,0FAA0F;AAC1F,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;iBAE1C,CAAC;AAKH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAKxE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schemas for Bitbucket PR API responses (Cloud and Server).
|
|
3
|
-
*/
|
|
4
|
-
import * as z from 'zod/mini';
|
|
5
|
-
// ---------------------------------------------------------------------------
|
|
6
|
-
// Bitbucket Cloud
|
|
7
|
-
// ---------------------------------------------------------------------------
|
|
8
|
-
/** A single PR from the Cloud list endpoint. */
|
|
9
|
-
export const bitbucketPrSchema = z.object({
|
|
10
|
-
id: z.number(),
|
|
11
|
-
links: z.object({
|
|
12
|
-
html: z.optional(z.object({ href: z.optional(z.string()) })),
|
|
13
|
-
}),
|
|
14
|
-
participants: z.array(z.object({
|
|
15
|
-
state: z.optional(z.string()),
|
|
16
|
-
role: z.string(),
|
|
17
|
-
})),
|
|
18
|
-
});
|
|
19
|
-
/** Response from `GET /repositories/{workspace}/{slug}/pullrequests` (paginated). */
|
|
20
|
-
export const bitbucketPrListSchema = z.object({
|
|
21
|
-
values: z.array(bitbucketPrSchema),
|
|
22
|
-
});
|
|
23
|
-
/** A single inline comment on a Cloud PR. */
|
|
24
|
-
export const bitbucketCommentSchema = z.object({
|
|
25
|
-
content: z.object({ raw: z.string() }),
|
|
26
|
-
inline: z.optional(z.object({
|
|
27
|
-
path: z.optional(z.string()),
|
|
28
|
-
})),
|
|
29
|
-
created_on: z.string(),
|
|
30
|
-
user: z.optional(z.object({
|
|
31
|
-
nickname: z.optional(z.string()),
|
|
32
|
-
})),
|
|
33
|
-
});
|
|
34
|
-
/** Response from `GET /repositories/{workspace}/{slug}/pullrequests/{id}/comments` (paginated). */
|
|
35
|
-
export const bitbucketCommentsSchema = z.object({
|
|
36
|
-
values: z.array(bitbucketCommentSchema),
|
|
37
|
-
});
|
|
38
|
-
// ---------------------------------------------------------------------------
|
|
39
|
-
// Bitbucket Server (Data Center)
|
|
40
|
-
// ---------------------------------------------------------------------------
|
|
41
|
-
/** A single PR from the Server list endpoint. */
|
|
42
|
-
export const bitbucketServerPrSchema = z.object({
|
|
43
|
-
id: z.number(),
|
|
44
|
-
links: z.object({
|
|
45
|
-
self: z.optional(z.array(z.object({ href: z.optional(z.string()) }))),
|
|
46
|
-
}),
|
|
47
|
-
reviewers: z.array(z.object({
|
|
48
|
-
status: z.string(),
|
|
49
|
-
})),
|
|
50
|
-
});
|
|
51
|
-
/** Response from `GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests` (paginated). */
|
|
52
|
-
export const bitbucketServerPrListSchema = z.object({
|
|
53
|
-
values: z.array(bitbucketServerPrSchema),
|
|
54
|
-
});
|
|
55
|
-
/** A comment object nested inside a Server activity. */
|
|
56
|
-
export const bitbucketServerCommentSchema = z.object({
|
|
57
|
-
text: z.string(),
|
|
58
|
-
anchor: z.optional(z.object({
|
|
59
|
-
path: z.optional(z.string()),
|
|
60
|
-
})),
|
|
61
|
-
createdDate: z.number(),
|
|
62
|
-
author: z.optional(z.object({
|
|
63
|
-
slug: z.optional(z.string()),
|
|
64
|
-
})),
|
|
65
|
-
});
|
|
66
|
-
/** A single activity on a Server PR (from /activities endpoint). */
|
|
67
|
-
export const bitbucketServerActivitySchema = z.object({
|
|
68
|
-
action: z.string(),
|
|
69
|
-
comment: z.optional(bitbucketServerCommentSchema),
|
|
70
|
-
});
|
|
71
|
-
/** Response from `GET /rest/api/latest/.../pull-requests/{id}/activities` (paginated). */
|
|
72
|
-
export const bitbucketServerActivitiesSchema = z.object({
|
|
73
|
-
values: z.array(bitbucketServerActivitySchema),
|
|
74
|
-
});
|
|
75
|
-
//# sourceMappingURL=bitbucket-pr.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bitbucket-pr.js","sourceRoot":"","sources":["../../src/schemas/bitbucket-pr.ts"],"names":[],"mappings":"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"}
|