@fitlab-ai/agent-infra 0.11.4 → 0.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/bin/internal-cli.js +0 -5
  2. package/dist/lib/decide.js +4 -41
  3. package/dist/lib/git/branch-worktree.js +45 -0
  4. package/dist/lib/internal/cli-route-inventory.js +0 -3
  5. package/dist/lib/internal/task-activity.js +7 -40
  6. package/dist/lib/internal/task-event.js +4 -37
  7. package/dist/lib/internal/task-finalization.js +9 -2
  8. package/dist/lib/internal/task-ledger.js +5 -43
  9. package/dist/lib/internal/task-lifecycle.js +1 -1
  10. package/dist/lib/internal/task-operation-registry.js +1 -4
  11. package/dist/lib/internal/task-review.js +5 -37
  12. package/dist/lib/internal/task-verify.js +3 -47
  13. package/dist/lib/internal/task-warning.js +4 -40
  14. package/dist/lib/merge.js +62 -10
  15. package/dist/lib/platform/github-provider.js +9 -14
  16. package/dist/lib/platform/github-release-notes.js +80 -11
  17. package/dist/lib/platform/none-provider.js +1 -1
  18. package/dist/lib/platform/pr-summary.js +4 -23
  19. package/dist/lib/platform/provider-contract.d.ts +39 -16
  20. package/dist/lib/platform/provider-contract.js +1 -1
  21. package/dist/lib/platform/provider-validation.js +83 -13
  22. package/dist/lib/platform/release-notes.js +7 -8
  23. package/dist/lib/platform/verification-sync.js +12 -49
  24. package/dist/lib/sandbox/capture.js +1 -1
  25. package/dist/lib/sandbox/commands/create.js +46 -1
  26. package/dist/lib/sandbox/commands/enter.js +1 -1
  27. package/dist/lib/sandbox/commands/start.js +1 -1
  28. package/dist/lib/sandbox/config.js +10 -0
  29. package/dist/lib/sandbox/control/client.js +4 -1
  30. package/dist/lib/sandbox/control/executor.js +12 -4
  31. package/dist/lib/sandbox/control/lifecycle.js +18 -13
  32. package/dist/lib/sandbox/control/protocol.js +2 -1
  33. package/dist/lib/sandbox/removal.js +15 -8
  34. package/dist/lib/sandbox/task-resolver.js +62 -2
  35. package/dist/lib/task/activity-intent.js +1 -2
  36. package/dist/lib/task/artifact-operations.js +36 -2
  37. package/dist/lib/task/artifact-schema.js +7 -7
  38. package/dist/lib/task/control-authority.js +9 -166
  39. package/dist/lib/task/decision-intents.js +2 -4
  40. package/dist/lib/task/events.js +7 -28
  41. package/dist/lib/task/finalization-handoff.js +92 -0
  42. package/dist/lib/task/finalization.js +123 -12
  43. package/dist/lib/task/intermediate-cleanup.js +9 -148
  44. package/dist/lib/task/ledger-intents.js +3 -6
  45. package/dist/lib/task/lifecycle.js +50 -11
  46. package/dist/lib/task/local-artifact-finalization.js +13 -28
  47. package/dist/lib/task/resolve-ref.js +3 -3
  48. package/dist/lib/task/review-command.js +1 -2
  49. package/dist/lib/task/review-finalization.js +1 -2
  50. package/dist/lib/task/snapshot.js +6 -6
  51. package/dist/lib/task/verification-engine.js +16 -11
  52. package/dist/lib/task/verification.js +1 -13
  53. package/dist/lib/task/workflow-warning-intents.js +2 -4
  54. package/dist/lib/task/write.js +122 -3
  55. package/dist/lifecycle-build-manifest.json +3 -3
  56. package/lib/decide.ts +5 -35
  57. package/lib/git/branch-worktree.ts +41 -0
  58. package/lib/internal/cli-route-inventory.ts +0 -2
  59. package/lib/internal/task-activity.ts +6 -34
  60. package/lib/internal/task-event.ts +4 -37
  61. package/lib/internal/task-finalization.ts +9 -2
  62. package/lib/internal/task-ledger.ts +5 -38
  63. package/lib/internal/task-lifecycle.ts +2 -2
  64. package/lib/internal/task-operation-registry.ts +1 -4
  65. package/lib/internal/task-review.ts +5 -31
  66. package/lib/internal/task-verify.ts +3 -39
  67. package/lib/internal/task-warning.ts +3 -32
  68. package/lib/merge.ts +59 -10
  69. package/lib/platform/github-provider.ts +11 -18
  70. package/lib/platform/github-release-notes.ts +89 -14
  71. package/lib/platform/none-provider.ts +1 -1
  72. package/lib/platform/pr-summary.ts +4 -25
  73. package/lib/platform/provider-contract.ts +38 -12
  74. package/lib/platform/provider-validation.ts +83 -12
  75. package/lib/platform/release-notes.ts +11 -12
  76. package/lib/platform/verification-sync.ts +13 -53
  77. package/lib/sandbox/capture.ts +1 -1
  78. package/lib/sandbox/commands/create.ts +52 -1
  79. package/lib/sandbox/commands/enter.ts +1 -1
  80. package/lib/sandbox/commands/start.ts +1 -1
  81. package/lib/sandbox/config.ts +12 -0
  82. package/lib/sandbox/control/client.ts +5 -1
  83. package/lib/sandbox/control/executor.ts +13 -4
  84. package/lib/sandbox/control/lifecycle.ts +22 -13
  85. package/lib/sandbox/control/protocol.ts +3 -2
  86. package/lib/sandbox/removal.ts +23 -7
  87. package/lib/sandbox/task-resolver.ts +51 -2
  88. package/lib/task/activity-intent.ts +1 -2
  89. package/lib/task/artifact-operations.ts +58 -2
  90. package/lib/task/artifact-schema.ts +9 -7
  91. package/lib/task/control-authority.ts +14 -188
  92. package/lib/task/decision-intents.ts +2 -4
  93. package/lib/task/events.ts +8 -27
  94. package/lib/task/finalization-handoff.ts +104 -0
  95. package/lib/task/finalization.ts +120 -12
  96. package/lib/task/intermediate-cleanup.ts +9 -125
  97. package/lib/task/ledger-intents.ts +3 -6
  98. package/lib/task/lifecycle.ts +45 -13
  99. package/lib/task/local-artifact-finalization.ts +16 -35
  100. package/lib/task/resolve-ref.ts +3 -3
  101. package/lib/task/review-command.ts +2 -5
  102. package/lib/task/review-finalization.ts +1 -4
  103. package/lib/task/snapshot.ts +6 -6
  104. package/lib/task/verification-engine.ts +20 -10
  105. package/lib/task/verification.ts +1 -15
  106. package/lib/task/workflow-warning-intents.ts +2 -4
  107. package/lib/task/write.ts +116 -5
  108. package/package.json +1 -1
  109. package/templates/.agents/rules/evidence-reporting.en.md +1 -2
  110. package/templates/.agents/rules/evidence-reporting.zh-CN.md +1 -2
  111. package/templates/.agents/skills/analyze-task/SKILL.en.md +11 -2
  112. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +11 -2
  113. package/templates/.agents/skills/archive-tasks/SKILL.en.md +2 -2
  114. package/templates/.agents/skills/archive-tasks/SKILL.zh-CN.md +2 -2
  115. package/templates/.agents/skills/archive-tasks/scripts/archive-tasks.sh +109 -6
  116. package/templates/.agents/skills/code-task/reference/report-template.en.md +6 -6
  117. package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +6 -6
  118. package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +2 -2
  119. package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +2 -2
  120. package/templates/.agents/skills/complete-manual-validation/reference/report-template.en.md +1 -3
  121. package/templates/.agents/skills/complete-manual-validation/reference/report-template.zh-CN.md +1 -3
  122. package/templates/.agents/skills/complete-task/config/verify.en.json +2 -2
  123. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +2 -2
  124. package/templates/.agents/skills/create-release-note/SKILL.en.md +17 -11
  125. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +17 -11
  126. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +3 -3
  127. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +3 -3
  128. package/templates/.agents/skills/review-code/reference/report-template.en.md +3 -3
  129. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +3 -3
  130. package/templates/.agents/skills/review-plan/reference/report-template.en.md +3 -3
  131. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +3 -3
  132. package/templates/.agents/skills/review-pr/config/verify.en.json +3 -1
  133. package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +3 -1
  134. package/templates/.agents/skills/review-pr/reference/report-template.en.md +3 -3
  135. package/templates/.agents/skills/review-pr/reference/report-template.zh-CN.md +3 -3
  136. package/templates/.agents/skills/run-manual-validation/config/verify.en.json +2 -2
  137. package/templates/.agents/skills/run-manual-validation/config/verify.zh-CN.json +2 -2
  138. package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +2 -2
  139. package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +2 -2
  140. package/dist/lib/internal/task-override.js +0 -138
  141. package/dist/lib/task/artifact-recovery.js +0 -476
  142. package/dist/lib/task/artifact-repair-intent.js +0 -181
  143. package/dist/lib/task/guard-override.js +0 -31
  144. package/dist/lib/task/human-override.js +0 -1259
  145. package/lib/internal/task-override.ts +0 -144
  146. package/lib/task/artifact-recovery.ts +0 -572
  147. package/lib/task/artifact-repair-intent.ts +0 -227
  148. package/lib/task/guard-override.ts +0 -50
  149. package/lib/task/human-override.ts +0 -1522
@@ -157,16 +157,16 @@ Use this template when writing `review-plan.md` or `review-plan-r{N}.md`.
157
157
 
158
158
  ## State Check
159
159
 
160
- > Record the state-check command, review scope, key result, and uncovered parts; each command starts with `$ `.
160
+ > Record the state-check command, review scope, key result, and uncovered parts.
161
161
  > Follow `.agents/rules/evidence-reporting.md`: record review scope, key result, and uncovered parts; do not paste complete successful stdout.
162
162
 
163
163
  ## Raw Evidence
164
164
 
165
- > Follow `.agents/rules/evidence-reporting.md`: pair each claim with a `$ ` command and proportionate result summary; Blockers, failures, blocking conditions, or disputes require a reproducible command, exact location, and decisive excerpt; a judgment that cannot be reproduced must be downgraded or moved to Self-Doubt.
165
+ > Follow `.agents/rules/evidence-reporting.md`: pair each claim with an executable command and proportionate result summary; Blockers, failures, blocking conditions, or disputes require a reproducible command, exact location, and decisive excerpt; a judgment that cannot be reproduced must be downgraded or moved to Self-Doubt.
166
166
 
167
167
  - Claim: {verified claim}
168
168
  ```text
169
- $ {command}
169
+ {command}
170
170
  {result summary or decisive excerpt}
171
171
  ```
172
172
 
@@ -157,16 +157,16 @@
157
157
 
158
158
  ## 状态核对
159
159
 
160
- > 记录状态核对命令、审查范围、关键结果和未覆盖部分;每条命令以 `$ ` 开头。
160
+ > 记录状态核对命令、审查范围、关键结果和未覆盖部分。
161
161
  > 按 `.agents/rules/evidence-reporting.md` 同时记录审查范围、关键结果和未覆盖部分;正常成功不粘贴完整 stdout。
162
162
 
163
163
  ## 证据原文
164
164
 
165
- > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对 `$ ` 命令和相称结果摘要;Blocker、失败、阻塞或争议必须保留可复现命令、准确位置和决定性摘录;无法复现的判断须降级或移入「自我质疑」。
165
+ > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对可执行命令和相称结果摘要;Blocker、失败、阻塞或争议必须保留可复现命令、准确位置和决定性摘录;无法复现的判断须降级或移入「自我质疑」。
166
166
 
167
167
  - 断言:{verified claim}
168
168
  ```text
169
- $ {command}
169
+ {command}
170
170
  {result summary or decisive excerpt}
171
171
  ```
172
172
 
@@ -12,8 +12,10 @@
12
12
  "State Check",
13
13
  "Evidence"
14
14
  ],
15
+ "state_check_patterns": [
16
+ "agent-infra-internal[ \\t]+task-snapshot\\b"
17
+ ],
15
18
  "required_patterns": [
16
- "^\\$ ",
17
19
  "^- \\*\\*Reviewed Head SHA\\*\\*[::]\\s*[0-9a-f]{40}\\s*$",
18
20
  "^- \\*\\*Review Mode\\*\\*[::]\\s*(?:verify|audit|reconstruct)\\s*$",
19
21
  "^- \\*\\*Evidence Scenario\\*\\*[::]\\s*S[123]\\s*$",
@@ -12,8 +12,10 @@
12
12
  "状态核对",
13
13
  "证据原文"
14
14
  ],
15
+ "state_check_patterns": [
16
+ "agent-infra-internal[ \\t]+task-snapshot\\b"
17
+ ],
15
18
  "required_patterns": [
16
- "^\\$ ",
17
19
  "^- \\*\\*被审 head SHA\\*\\*[::]\\s*[0-9a-f]{40}\\s*$",
18
20
  "^- \\*\\*审查模式\\*\\*[::]\\s*(?:verify|audit|reconstruct)\\s*$",
19
21
  "^- \\*\\*证据场景\\*\\*[::]\\s*S[123]\\s*$",
@@ -11,7 +11,7 @@ Use the following structure when creating `pr-review.md` or `pr-review-r{N}.md`.
11
11
 
12
12
  ## State Check
13
13
 
14
- > Record the state-check command, PR/head, review scope, key result, and uncovered parts; each command starts with `$ `.
14
+ > Record the state-check command, PR/head, review scope, key result, and uncovered parts.
15
15
  > Follow `.agents/rules/evidence-reporting.md`: record PR, head, review scope, key result, and uncovered parts; do not paste complete successful stdout.
16
16
 
17
17
  ## Identity
@@ -77,10 +77,10 @@ Land the following in order before the line-level findings, without impersonatin
77
77
 
78
78
  ## Evidence
79
79
 
80
- > Follow `.agents/rules/evidence-reporting.md`: pair every assertion with a `$ ` command and proportionate result summary; formal Review, failures, blocking conditions, or disputes retain exact identity and decisive excerpts.
80
+ > Follow `.agents/rules/evidence-reporting.md`: pair every assertion with an executable command and proportionate result summary; formal Review, failures, blocking conditions, or disputes retain exact identity and decisive excerpts.
81
81
 
82
82
  - Assertion: {verified claim}
83
83
  ```text
84
- $ {command}
84
+ {command}
85
85
  {result summary or decisive excerpt}
86
86
  ```
@@ -11,7 +11,7 @@
11
11
 
12
12
  ## 状态核对
13
13
 
14
- > 记录状态核对命令、PR/head、审查范围、关键结果和未覆盖部分;每条命令以 `$ ` 开头。
14
+ > 记录状态核对命令、PR/head、审查范围、关键结果和未覆盖部分。
15
15
  > 按 `.agents/rules/evidence-reporting.md` 同时记录 PR、head、审查范围、关键结果和未覆盖部分;正常成功不粘贴完整 stdout。
16
16
 
17
17
  ## 身份信息
@@ -77,10 +77,10 @@
77
77
 
78
78
  ## 证据原文
79
79
 
80
- > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对 `$ ` 命令和相称结果摘要;正式 Review、失败、阻塞或争议保留准确身份和决定性摘录。
80
+ > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对可执行命令和相称结果摘要;正式 Review、失败、阻塞或争议保留准确身份和决定性摘录。
81
81
 
82
82
  - 断言:{verified claim}
83
83
  ```text
84
- $ {command}
84
+ {command}
85
85
  {result summary or decisive excerpt}
86
86
  ```
@@ -29,8 +29,8 @@
29
29
  "Remaining Coverage",
30
30
  "Raw Evidence"
31
31
  ],
32
- "required_patterns": [
33
- "^\\$ "
32
+ "state_check_patterns": [
33
+ "agent-infra-internal[ \\t]+task-snapshot\\b"
34
34
  ]
35
35
  },
36
36
  "activity-log": {
@@ -29,8 +29,8 @@
29
29
  "尚未覆盖",
30
30
  "证据原文"
31
31
  ],
32
- "required_patterns": [
33
- "^\\$ "
32
+ "state_check_patterns": [
33
+ "agent-infra-internal[ \\t]+task-snapshot\\b"
34
34
  ]
35
35
  },
36
36
  "activity-log": {
@@ -10,7 +10,7 @@
10
10
  ## State Check
11
11
 
12
12
  ```text
13
- $ agent-infra-internal task-snapshot {task-id} --format text
13
+ agent-infra-internal task-snapshot {task-id} --format text
14
14
  {command-summary-and-key-result}
15
15
  ```
16
16
  > Follow `.agents/rules/evidence-reporting.md`: record command name, target scope, exit status, sanitized result, and coverage gap; do not paste complete argv or sensitive transcripts.
@@ -67,7 +67,7 @@ $ agent-infra-internal task-snapshot {task-id} --format text
67
67
  ## Raw Evidence
68
68
 
69
69
  ```text
70
- $ agent-infra-internal task-validate {task-ref} --scope {scope} --format json -- {redacted-command}
70
+ agent-infra-internal task-validate {task-ref} --scope {scope} --format json -- {redacted-command}
71
71
  {sanitized-result}
72
72
  ```
73
73
  > Keep only the allowed public command and sanitized structured result; complete successful stdout is not default report content.
@@ -10,7 +10,7 @@
10
10
  ## 状态核对
11
11
 
12
12
  ```text
13
- $ agent-infra-internal task-snapshot {task-id} --format text
13
+ agent-infra-internal task-snapshot {task-id} --format text
14
14
  {command-summary-and-key-result}
15
15
  ```
16
16
  > 按 `.agents/rules/evidence-reporting.md` 记录命令名称、目标范围、退出状态、sanitized result 和覆盖缺口;不得粘贴完整 argv 或敏感 transcript。
@@ -67,7 +67,7 @@ $ agent-infra-internal task-snapshot {task-id} --format text
67
67
  ## 证据原文
68
68
 
69
69
  ```text
70
- $ agent-infra-internal task-validate {task-ref} --scope {scope} --format json -- {redacted-command}
70
+ agent-infra-internal task-validate {task-ref} --scope {scope} --format json -- {redacted-command}
71
71
  {sanitized-result}
72
72
  ```
73
73
  > 仅保留允许公开的命令与脱敏结构化结果;完整成功 stdout 不属于默认报告内容。
@@ -1,138 +0,0 @@
1
- import { consumeHumanOverride, diagnoseHumanOverrideForTask, issueHumanOverride } from '../task/human-override.js';
2
- import { resolveTaskRef } from '../task/resolve-ref.js';
3
- import { TaskExecutionLockError, withTaskExecutionLock } from '../task/task-execution-lock.js';
4
- import { ensureInternalHandlerRoute, internalHandlerRoute } from './cli-route-inventory.js';
5
- const USAGE = `Usage: agent-infra-internal task-override <task-ref> <diagnose|issue|consume> [options]
6
-
7
- Options: --failure-id <id> --target <target> --operator <operator> --reason <reason> --scope <scope>
8
- --intent <lifecycle-intent> --alert-number <N> --issue-number <N> --staging-dir <path>
9
- --expires-at <timestamp> --ticket <ticket-id> --pr-number <N>
10
- `;
11
- const FLAGS = {
12
- '--failure-id': 'failureId',
13
- '--target': 'target',
14
- '--operator': 'operator',
15
- '--reason': 'reason',
16
- '--scope': 'scope',
17
- '--intent': 'intent',
18
- '--failure-digest': 'failureDigest',
19
- '--expires-at': 'expiresAt',
20
- '--ticket': 'ticketId',
21
- '--facts': 'observedFacts',
22
- '--alert-number': 'alertNumber',
23
- '--issue-number': 'issueNumber',
24
- '--pr-number': 'pullRequestNumber',
25
- '--staging-dir': 'stagingDir'
26
- };
27
- function usageFailure(message) {
28
- process.stdout.write(`${JSON.stringify({ status: 'failed', changed: false, error: { code: 'OVERRIDE_PAYLOAD_INVALID', message } })}\n`);
29
- process.stderr.write(USAGE);
30
- process.exitCode = 1;
31
- }
32
- async function taskOverride(args = []) {
33
- if (!ensureInternalHandlerRoute('task-override', args))
34
- return;
35
- if (args[0] === '--help' || args[0] === '-h') {
36
- process.stdout.write(USAGE);
37
- return;
38
- }
39
- const [taskRef, operation] = args;
40
- if (!taskRef || !operation || ![
41
- internalHandlerRoute('task-override', 'diagnose', operation ?? ''),
42
- internalHandlerRoute('task-override', 'issue', operation ?? ''),
43
- internalHandlerRoute('task-override', 'consume', operation ?? '')
44
- ].some(Boolean)) {
45
- usageFailure('task ref and a valid operation are required');
46
- return;
47
- }
48
- const values = { taskRef };
49
- const seen = new Set();
50
- for (let index = 2; index < args.length; index += 1) {
51
- const flag = args[index];
52
- const key = FLAGS[flag];
53
- if (!key) {
54
- usageFailure(`unknown option '${flag}'`);
55
- return;
56
- }
57
- if (seen.has(flag)) {
58
- usageFailure(`duplicate option '${flag}'`);
59
- return;
60
- }
61
- const value = args[++index];
62
- if (value === undefined || value.startsWith('--')) {
63
- usageFailure(`option '${flag}' requires a value`);
64
- return;
65
- }
66
- seen.add(flag);
67
- values[key] = key === 'observedFacts' ? value.split(',').map((fact) => fact.trim()).filter(Boolean)
68
- : key === 'alertNumber' || key === 'issueNumber' || key === 'pullRequestNumber' ? Number(value) : value;
69
- }
70
- const required = {
71
- diagnose: [],
72
- issue: ['failureId', 'target', 'operator', 'reason', 'scope', 'expiresAt'],
73
- consume: ['failureId', 'target', 'scope', 'ticketId']
74
- };
75
- const missing = required[operation].find((key) => values[key] === undefined);
76
- if (missing) {
77
- usageFailure(`${operation} requires '--${missing.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}'`);
78
- return;
79
- }
80
- const resolved = resolveTaskRef(taskRef);
81
- if (!resolved.ok) {
82
- process.stdout.write(`${JSON.stringify({ status: 'failed', changed: false, error: { code: resolved.code, message: resolved.message } })}\n`);
83
- process.exitCode = 1;
84
- return;
85
- }
86
- let result;
87
- try {
88
- if (internalHandlerRoute('task-override', 'diagnose', operation)) {
89
- result = await diagnoseHumanOverrideForTask(taskRef, values.failureId ? String(values.failureId) : undefined, values.target ? String(values.target) : undefined);
90
- }
91
- else if (internalHandlerRoute('task-override', 'issue', operation)) {
92
- result = await withTaskExecutionLock(resolved.repoRoot, resolved.taskId, 'task-override.issue', async () => issueHumanOverride({
93
- taskRef,
94
- failureId: String(values.failureId),
95
- target: String(values.target),
96
- operator: String(values.operator),
97
- reason: String(values.reason),
98
- scope: String(values.scope),
99
- expiresAt: String(values.expiresAt),
100
- ...(values.intent ? { intent: String(values.intent) } : {}),
101
- ...(values.alertNumber !== undefined ? { alertNumber: Number(values.alertNumber) } : {}),
102
- ...(values.issueNumber !== undefined ? { issueNumber: Number(values.issueNumber) } : {}),
103
- ...(values.pullRequestNumber !== undefined ? { pullRequestNumber: Number(values.pullRequestNumber) } : {}),
104
- ...(values.stagingDir ? { stagingDir: String(values.stagingDir) } : {}),
105
- ...(values.failureDigest ? { failureDigest: String(values.failureDigest) } : {})
106
- }));
107
- }
108
- else {
109
- result = await withTaskExecutionLock(resolved.repoRoot, resolved.taskId, 'task-override.consume', async () => consumeHumanOverride({
110
- taskRef,
111
- ticketId: String(values.ticketId),
112
- failureId: String(values.failureId),
113
- target: String(values.target),
114
- scope: String(values.scope),
115
- ...(values.intent ? { intent: String(values.intent) } : {}),
116
- ...(values.alertNumber !== undefined ? { alertNumber: Number(values.alertNumber) } : {}),
117
- ...(values.issueNumber !== undefined ? { issueNumber: Number(values.issueNumber) } : {}),
118
- ...(values.pullRequestNumber !== undefined ? { pullRequestNumber: Number(values.pullRequestNumber) } : {}),
119
- ...(values.stagingDir ? { stagingDir: String(values.stagingDir) } : {}),
120
- ...(values.failureDigest ? { failureDigest: String(values.failureDigest) } : {}),
121
- ...(values.observedFacts ? { observedFacts: values.observedFacts } : {})
122
- }));
123
- }
124
- }
125
- catch (cause) {
126
- if (cause instanceof TaskExecutionLockError) {
127
- process.stdout.write(`${JSON.stringify({ status: 'failed', changed: false, error: { code: cause.code, message: cause.message } })}\n`);
128
- process.exitCode = 1;
129
- return;
130
- }
131
- throw cause;
132
- }
133
- process.stdout.write(`${JSON.stringify(result)}\n`);
134
- if (result.status === 'failed')
135
- process.exitCode = 1;
136
- }
137
- export { taskOverride };
138
- //# sourceMappingURL=task-override.js.map