@qelos/aidev 0.9.0 → 0.11.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/.env.aidev.example +17 -2
- package/README.md +2 -1
- package/dist/ai/anthropicSdk.d.ts +35 -0
- package/dist/ai/anthropicSdk.d.ts.map +1 -0
- package/dist/ai/anthropicSdk.js +209 -0
- package/dist/ai/anthropicSdk.js.map +1 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +2 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/commands/accepted.d.ts +7 -0
- package/dist/commands/accepted.d.ts.map +1 -1
- package/dist/commands/accepted.js +18 -0
- package/dist/commands/accepted.js.map +1 -1
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +40 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/run.d.ts +22 -0
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +507 -5
- package/dist/commands/run.js.map +1 -1
- package/dist/config.d.ts +15 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +28 -2
- package/dist/config.js.map +1 -1
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +8 -1
- package/dist/github.js.map +1 -1
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +27 -0
- package/dist/permissions.js.map +1 -1
- package/dist/providers/clickup.d.ts.map +1 -1
- package/dist/providers/clickup.js +2 -0
- package/dist/providers/clickup.js.map +1 -1
- package/dist/providers/jira.d.ts.map +1 -1
- package/dist/providers/jira.js +2 -1
- package/dist/providers/jira.js.map +1 -1
- package/dist/providers/linear.d.ts.map +1 -1
- package/dist/providers/linear.js +2 -1
- package/dist/providers/linear.js.map +1 -1
- package/dist/providers/local.d.ts.map +1 -1
- package/dist/providers/local.js +1 -0
- package/dist/providers/local.js.map +1 -1
- package/dist/providers/monday.d.ts.map +1 -1
- package/dist/providers/monday.js +1 -0
- package/dist/providers/monday.js.map +1 -1
- package/dist/providers/notion.d.ts.map +1 -1
- package/dist/providers/notion.js +1 -0
- package/dist/providers/notion.js.map +1 -1
- package/dist/providers/trello.d.ts.map +1 -1
- package/dist/providers/trello.js +2 -0
- package/dist/providers/trello.js.map +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
package/.env.aidev.example
CHANGED
|
@@ -34,7 +34,7 @@ CLICKUP_IN_REVIEW_STATUS=review
|
|
|
34
34
|
# Backlog | Todo | In Progress | In Review | Done. If your team renamed
|
|
35
35
|
# these (e.g. "Triage" instead of "Backlog"), aidev will also fall back
|
|
36
36
|
# to matching by Linear's underlying state type.
|
|
37
|
-
# LINEAR_PENDING_STATUS=
|
|
37
|
+
# LINEAR_PENDING_STATUS=Pending
|
|
38
38
|
# LINEAR_IN_REVIEW_STATUS=In Review
|
|
39
39
|
|
|
40
40
|
# ── Monday.com (when PROVIDER=monday) ──────────────────────────
|
|
@@ -70,13 +70,28 @@ ASSIGNEE_TAG=
|
|
|
70
70
|
|
|
71
71
|
# THINKING_TAG: tasks with this tag are analyzed and broken into sub-tasks before execution (default: thinking)
|
|
72
72
|
THINKING_TAG=thinking
|
|
73
|
+
|
|
74
|
+
# PLANNING_TAG: tasks with this tag are split into self-contained sub-tickets pushed back to the provider (default: planning)
|
|
75
|
+
PLANNING_TAG=planning
|
|
73
76
|
GIT_REMOTE=origin
|
|
74
77
|
GITHUB_BASE_BRANCH=main
|
|
75
78
|
GITHUB_REPO=
|
|
76
79
|
|
|
77
|
-
# Agents to use, in fallback order (comma-separated: antigravity, claude, codex, cursor, windsurf)
|
|
80
|
+
# Agents to use, in fallback order (comma-separated: antigravity, anthropic-sdk, claude, codex, cursor, windsurf)
|
|
78
81
|
AGENTS=claude,cursor
|
|
79
82
|
|
|
83
|
+
# ── Anthropic Agent SDK (when AGENTS includes anthropic-sdk) ──
|
|
84
|
+
# Drives Claude in-process via @anthropic-ai/claude-agent-sdk instead of the `claude` CLI.
|
|
85
|
+
# ANTHROPIC_API_KEY accepts a single key or a comma-separated pool; the runner
|
|
86
|
+
# rotates round-robin across calls. Leading/trailing whitespace is trimmed and
|
|
87
|
+
# empty entries are ignored.
|
|
88
|
+
# ANTHROPIC_API_KEY=sk-ant-key-1,sk-ant-key-2
|
|
89
|
+
# ANTHROPIC_BASE_URL= # optional override (default: https://api.anthropic.com)
|
|
90
|
+
# CLAUDE_MODEL=claude-opus-4-6 # model id passed to the SDK (default: claude-opus-4-6)
|
|
91
|
+
# Transient SDK errors (e.g. connection drops) are retried with capped
|
|
92
|
+
# exponential backoff. Set to 0 to disable retries. Default: 3.
|
|
93
|
+
# ANTHROPIC_SDK_MAX_RETRIES=3
|
|
94
|
+
|
|
80
95
|
# DEV_NOTES_MODE: smart (only ask when unclear) | always (ask before every task)
|
|
81
96
|
DEV_NOTES_MODE=smart
|
|
82
97
|
|
package/README.md
CHANGED
|
@@ -181,6 +181,7 @@ CLICKUP_TAG=my-project
|
|
|
181
181
|
| `CLICKUP_IN_REVIEW_STATUS` | `review` | Status set after implementation |
|
|
182
182
|
| `ASSIGNEE_TAG` | — | Only process tasks assigned to this user (optional) |
|
|
183
183
|
| `THINKING_TAG` | `thinking` | Tasks with this tag are analyzed and broken into sub-tasks before execution |
|
|
184
|
+
| `PLANNING_TAG` | `planning` | Tasks with this tag are split into self-contained sub-tickets pushed back to the provider |
|
|
184
185
|
| `NON_CODE_TAG` | — | Tasks with this tag run without git branching (optional) |
|
|
185
186
|
| `NON_CODE_CLICKUP_TEAM_ID` | same as `CLICKUP_TEAM_ID` | Different workspace for non-code tasks (optional) |
|
|
186
187
|
|
|
@@ -210,7 +211,7 @@ Linear calls them "labels" — the same concept as `CLICKUP_TAG` / `JIRA_LABEL`.
|
|
|
210
211
|
| `LINEAR_API_KEY` | — | Personal API key from Linear Settings → API |
|
|
211
212
|
| `LINEAR_TEAM_ID` | — | Team UUID from your workspace |
|
|
212
213
|
| `LINEAR_LABEL` | — | Issues with this label will be picked up (set to `*` to match all issues) |
|
|
213
|
-
| `LINEAR_PENDING_STATUS` | `
|
|
214
|
+
| `LINEAR_PENDING_STATUS` | `Pending` | Status name for "waiting for reply" |
|
|
214
215
|
| `LINEAR_IN_REVIEW_STATUS` | `In Review` | Status set after implementation |
|
|
215
216
|
| `NON_CODE_LINEAR_TEAM_ID` | same as `LINEAR_TEAM_ID` | Different team for non-code tasks (optional) |
|
|
216
217
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AIRunner, AIRunResult } from './base';
|
|
2
|
+
/**
|
|
3
|
+
* Reads `ANTHROPIC_SDK_MAX_RETRIES` from the environment, defaulting to 3.
|
|
4
|
+
* Non-numeric or negative values fall back to the default. The count is the
|
|
5
|
+
* number of retries *after* the initial attempt, so total attempts equal
|
|
6
|
+
* `maxRetries + 1`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAnthropicSdkMaxRetries(): number;
|
|
9
|
+
/**
|
|
10
|
+
* Runs Claude in-process via the official `@anthropic-ai/claude-agent-sdk`
|
|
11
|
+
* package rather than shelling out to the `claude` CLI. The SDK is ESM-only,
|
|
12
|
+
* so we load it lazily with a dynamic `import()` from this CJS module.
|
|
13
|
+
*
|
|
14
|
+
* Honors a comma-separated pool of `ANTHROPIC_API_KEY` values via round-robin
|
|
15
|
+
* rotation across `run()` calls — and also across retries, so a flaky token
|
|
16
|
+
* gets swapped out on the next attempt. Forwards `ANTHROPIC_BASE_URL` /
|
|
17
|
+
* `CLAUDE_MODEL` when set. The `claude_code` system prompt preset combined
|
|
18
|
+
* with `cwd: process.cwd()` is what makes the SDK pick up `.claude/skills`,
|
|
19
|
+
* `.claude/commands`, and `.claude/agents` from the project — do not override.
|
|
20
|
+
*
|
|
21
|
+
* Transient SDK errors (connection drops, mid-stream failures) are retried up
|
|
22
|
+
* to `ANTHROPIC_SDK_MAX_RETRIES` times (default 3) with capped exponential
|
|
23
|
+
* backoff. Watchdog timeouts are surfaced immediately — they mean the run
|
|
24
|
+
* already burned its budget, so a retry would only burn another.
|
|
25
|
+
*/
|
|
26
|
+
export declare class AnthropicSdkRunner implements AIRunner {
|
|
27
|
+
readonly name = "anthropic-sdk";
|
|
28
|
+
private tokenCursor;
|
|
29
|
+
isAvailable(): boolean;
|
|
30
|
+
loadSdk(): Promise<unknown>;
|
|
31
|
+
retryDelayMs(attempt: number): number;
|
|
32
|
+
run(prompt: string, notes?: string): Promise<AIRunResult>;
|
|
33
|
+
private runOnce;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=anthropicSdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropicSdk.d.ts","sourceRoot":"","sources":["../../src/ai/anthropicSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAW/C;;;;;GAKG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAMlD;AASD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,kBAAmB,YAAW,QAAQ;IACjD,QAAQ,CAAC,IAAI,mBAAmB;IAEhC,OAAO,CAAC,WAAW,CAAK;IAExB,WAAW,IAAI,OAAO;IAWhB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAKjC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAI/B,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;YAgEjD,OAAO;CAkDtB"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.AnthropicSdkRunner = void 0;
|
|
37
|
+
exports.getAnthropicSdkMaxRetries = getAnthropicSdkMaxRetries;
|
|
38
|
+
const logger_1 = require("../logger");
|
|
39
|
+
const config_1 = require("../config");
|
|
40
|
+
const SDK_PACKAGE = '@anthropic-ai/claude-agent-sdk';
|
|
41
|
+
const RUN_TIMEOUT_MS = 10 * 60 * 1000;
|
|
42
|
+
const DEFAULT_MODEL = 'claude-opus-4-6';
|
|
43
|
+
const DEFAULT_MAX_RETRIES = 3;
|
|
44
|
+
const RETRY_BACKOFF_BASE_MS = 1000;
|
|
45
|
+
const RETRY_BACKOFF_MAX_MS = 10000;
|
|
46
|
+
/**
|
|
47
|
+
* Reads `ANTHROPIC_SDK_MAX_RETRIES` from the environment, defaulting to 3.
|
|
48
|
+
* Non-numeric or negative values fall back to the default. The count is the
|
|
49
|
+
* number of retries *after* the initial attempt, so total attempts equal
|
|
50
|
+
* `maxRetries + 1`.
|
|
51
|
+
*/
|
|
52
|
+
function getAnthropicSdkMaxRetries() {
|
|
53
|
+
const raw = (process.env.ANTHROPIC_SDK_MAX_RETRIES || '').trim();
|
|
54
|
+
if (!raw)
|
|
55
|
+
return DEFAULT_MAX_RETRIES;
|
|
56
|
+
const parsed = Number.parseInt(raw, 10);
|
|
57
|
+
if (!Number.isFinite(parsed) || parsed < 0)
|
|
58
|
+
return DEFAULT_MAX_RETRIES;
|
|
59
|
+
return parsed;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Runs Claude in-process via the official `@anthropic-ai/claude-agent-sdk`
|
|
63
|
+
* package rather than shelling out to the `claude` CLI. The SDK is ESM-only,
|
|
64
|
+
* so we load it lazily with a dynamic `import()` from this CJS module.
|
|
65
|
+
*
|
|
66
|
+
* Honors a comma-separated pool of `ANTHROPIC_API_KEY` values via round-robin
|
|
67
|
+
* rotation across `run()` calls — and also across retries, so a flaky token
|
|
68
|
+
* gets swapped out on the next attempt. Forwards `ANTHROPIC_BASE_URL` /
|
|
69
|
+
* `CLAUDE_MODEL` when set. The `claude_code` system prompt preset combined
|
|
70
|
+
* with `cwd: process.cwd()` is what makes the SDK pick up `.claude/skills`,
|
|
71
|
+
* `.claude/commands`, and `.claude/agents` from the project — do not override.
|
|
72
|
+
*
|
|
73
|
+
* Transient SDK errors (connection drops, mid-stream failures) are retried up
|
|
74
|
+
* to `ANTHROPIC_SDK_MAX_RETRIES` times (default 3) with capped exponential
|
|
75
|
+
* backoff. Watchdog timeouts are surfaced immediately — they mean the run
|
|
76
|
+
* already burned its budget, so a retry would only burn another.
|
|
77
|
+
*/
|
|
78
|
+
class AnthropicSdkRunner {
|
|
79
|
+
constructor() {
|
|
80
|
+
this.name = 'anthropic-sdk';
|
|
81
|
+
this.tokenCursor = 0;
|
|
82
|
+
}
|
|
83
|
+
isAvailable() {
|
|
84
|
+
try {
|
|
85
|
+
require.resolve(SDK_PACKAGE);
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
return (0, config_1.parseAnthropicTokens)(process.env.ANTHROPIC_API_KEY || '').length > 0;
|
|
91
|
+
}
|
|
92
|
+
// Dynamic import — SDK is ESM-only and this module is CJS. Exposed as a
|
|
93
|
+
// method so tests can stub it without touching Node's ESM loader.
|
|
94
|
+
async loadSdk() {
|
|
95
|
+
return Promise.resolve(`${SDK_PACKAGE}`).then(s => __importStar(require(s)));
|
|
96
|
+
}
|
|
97
|
+
// Exposed as a method so tests can stub it to 0 and avoid real waits.
|
|
98
|
+
retryDelayMs(attempt) {
|
|
99
|
+
return Math.min(RETRY_BACKOFF_BASE_MS * 2 ** attempt, RETRY_BACKOFF_MAX_MS);
|
|
100
|
+
}
|
|
101
|
+
async run(prompt, notes) {
|
|
102
|
+
const fullPrompt = notes ? `${prompt}\n\nAdditional context:\n${notes}` : prompt;
|
|
103
|
+
const tokens = (0, config_1.parseAnthropicTokens)(process.env.ANTHROPIC_API_KEY || '');
|
|
104
|
+
if (tokens.length === 0) {
|
|
105
|
+
return { success: false, output: '', error: 'No ANTHROPIC_API_KEY configured' };
|
|
106
|
+
}
|
|
107
|
+
const maxRetries = getAnthropicSdkMaxRetries();
|
|
108
|
+
const prevApiKey = process.env.ANTHROPIC_API_KEY;
|
|
109
|
+
const prevBaseUrl = process.env.ANTHROPIC_BASE_URL;
|
|
110
|
+
const baseUrl = (process.env.ANTHROPIC_BASE_URL || '').trim();
|
|
111
|
+
const model = (process.env.CLAUDE_MODEL || '').trim() || DEFAULT_MODEL;
|
|
112
|
+
let lastError = '';
|
|
113
|
+
let lastOutput = '';
|
|
114
|
+
try {
|
|
115
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
116
|
+
const { token, nextCursor } = (0, config_1.pickNextToken)(tokens, this.tokenCursor);
|
|
117
|
+
this.tokenCursor = nextCursor;
|
|
118
|
+
process.env.ANTHROPIC_API_KEY = token;
|
|
119
|
+
if (baseUrl)
|
|
120
|
+
process.env.ANTHROPIC_BASE_URL = baseUrl;
|
|
121
|
+
if (attempt === 0) {
|
|
122
|
+
logger_1.logger.info('Running Claude via Anthropic Agent SDK...');
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
logger_1.logger.info(`Retrying Anthropic Agent SDK (attempt ${attempt + 1}/${maxRetries + 1})...`);
|
|
126
|
+
}
|
|
127
|
+
logger_1.logger.debug(`Prompt: ${fullPrompt.slice(0, 200)}...`);
|
|
128
|
+
const attemptResult = await this.runOnce(fullPrompt, model);
|
|
129
|
+
if (attemptResult.success) {
|
|
130
|
+
return { success: true, output: attemptResult.output, error: '' };
|
|
131
|
+
}
|
|
132
|
+
lastError = attemptResult.error;
|
|
133
|
+
lastOutput = attemptResult.output;
|
|
134
|
+
if (attemptResult.timedOut) {
|
|
135
|
+
return { success: false, output: lastOutput, error: lastError };
|
|
136
|
+
}
|
|
137
|
+
if (attempt < maxRetries) {
|
|
138
|
+
const delay = this.retryDelayMs(attempt);
|
|
139
|
+
logger_1.logger.warn(`Anthropic SDK attempt ${attempt + 1} failed: ${lastError}. Retrying in ${delay}ms...`);
|
|
140
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return { success: false, output: lastOutput, error: lastError };
|
|
144
|
+
}
|
|
145
|
+
finally {
|
|
146
|
+
if (prevApiKey === undefined)
|
|
147
|
+
delete process.env.ANTHROPIC_API_KEY;
|
|
148
|
+
else
|
|
149
|
+
process.env.ANTHROPIC_API_KEY = prevApiKey;
|
|
150
|
+
if (prevBaseUrl === undefined)
|
|
151
|
+
delete process.env.ANTHROPIC_BASE_URL;
|
|
152
|
+
else
|
|
153
|
+
process.env.ANTHROPIC_BASE_URL = prevBaseUrl;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
async runOnce(fullPrompt, model) {
|
|
157
|
+
let output = '';
|
|
158
|
+
let timedOut = false;
|
|
159
|
+
const watchdog = setTimeout(() => {
|
|
160
|
+
timedOut = true;
|
|
161
|
+
logger_1.logger.warn(`Anthropic SDK run exceeded ${RUN_TIMEOUT_MS / 1000}s — cancelling`);
|
|
162
|
+
}, RUN_TIMEOUT_MS);
|
|
163
|
+
try {
|
|
164
|
+
const sdk = await this.loadSdk();
|
|
165
|
+
const q = sdk.query({
|
|
166
|
+
prompt: fullPrompt,
|
|
167
|
+
options: {
|
|
168
|
+
cwd: process.cwd(),
|
|
169
|
+
allowedTools: ['Read', 'Write', 'Edit', 'Glob', 'Grep', 'Bash'],
|
|
170
|
+
permissionMode: 'acceptEdits',
|
|
171
|
+
systemPrompt: { type: 'preset', preset: 'claude_code' },
|
|
172
|
+
maxTurns: 20,
|
|
173
|
+
model,
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
for await (const msg of q) {
|
|
177
|
+
if (timedOut)
|
|
178
|
+
break;
|
|
179
|
+
if (msg?.type === 'assistant' && msg.message?.content) {
|
|
180
|
+
for (const block of msg.message.content) {
|
|
181
|
+
if (block?.type === 'text' && typeof block.text === 'string') {
|
|
182
|
+
output += block.text;
|
|
183
|
+
logger_1.logger.debug(block.text);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else if (msg?.type === 'result') {
|
|
188
|
+
if (typeof msg.result === 'string' && msg.result.length > 0) {
|
|
189
|
+
output += (output ? '\n' : '') + msg.result;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (timedOut) {
|
|
194
|
+
return { success: false, output, error: 'Anthropic SDK run timed out', timedOut: true };
|
|
195
|
+
}
|
|
196
|
+
return { success: true, output, error: '', timedOut: false };
|
|
197
|
+
}
|
|
198
|
+
catch (err) {
|
|
199
|
+
const error = err?.message || String(err);
|
|
200
|
+
logger_1.logger.warn(`Anthropic SDK run failed: ${error}`);
|
|
201
|
+
return { success: false, output, error, timedOut: false };
|
|
202
|
+
}
|
|
203
|
+
finally {
|
|
204
|
+
clearTimeout(watchdog);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
exports.AnthropicSdkRunner = AnthropicSdkRunner;
|
|
209
|
+
//# sourceMappingURL=anthropicSdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropicSdk.js","sourceRoot":"","sources":["../../src/ai/anthropicSdk.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,8DAMC;AAtBD,sCAAmC;AACnC,sCAAgE;AAEhE,MAAM,WAAW,GAAG,gCAAgC,CAAC;AACrD,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACtC,MAAM,aAAa,GAAG,iBAAiB,CAAC;AACxC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACnC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAEnC;;;;;GAKG;AACH,SAAgB,yBAAyB;IACvC,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACjE,IAAI,CAAC,GAAG;QAAE,OAAO,mBAAmB,CAAC;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACxC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC;QAAE,OAAO,mBAAmB,CAAC;IACvE,OAAO,MAAM,CAA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,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBAC5D,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;oBAC9C,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,QAAQ,EAAE,CAAC;gBACb,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,6BAA6B,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YAC1F,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QAC/D,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,MAAM,KAAK,GAAG,GAAG,EAAE,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;YAC1C,eAAM,CAAC,IAAI,CAAC,6BAA6B,KAAK,EAAE,CAAC,CAAC;YAClD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QAC5D,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;CACF;AA3ID,gDA2IC"}
|
package/dist/ai/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAkBlC,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CAcxD;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/ai/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createRunners = createRunners;
|
|
4
4
|
const antigravity_1 = require("./antigravity");
|
|
5
|
+
const anthropicSdk_1 = require("./anthropicSdk");
|
|
5
6
|
const claude_1 = require("./claude");
|
|
6
7
|
const codex_1 = require("./codex");
|
|
7
8
|
const cursor_1 = require("./cursor");
|
|
@@ -9,6 +10,7 @@ const windsurf_1 = require("./windsurf");
|
|
|
9
10
|
const logger_1 = require("../logger");
|
|
10
11
|
const registry = {
|
|
11
12
|
antigravity: new antigravity_1.AntigravityRunner(),
|
|
13
|
+
'anthropic-sdk': new anthropicSdk_1.AnthropicSdkRunner(),
|
|
12
14
|
claude: new claude_1.ClaudeRunner(),
|
|
13
15
|
codex: new codex_1.CodexRunner(),
|
|
14
16
|
cursor: new cursor_1.CursorRunner(),
|
package/dist/ai/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":";;AAmBA,sCAcC;AA/BD,+CAAkD;AAClD,iDAAoD;AACpD,qCAAwC;AACxC,mCAAsC;AACtC,qCAAwC;AACxC,yCAA4C;AAC5C,sCAAmC;AAEnC,MAAM,QAAQ,GAA6B;IACzC,WAAW,EAAE,IAAI,+BAAiB,EAAE;IACpC,eAAe,EAAE,IAAI,iCAAkB,EAAE;IACzC,MAAM,EAAE,IAAI,qBAAY,EAAE;IAC1B,KAAK,EAAE,IAAI,mBAAW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function buildAcceptedConflictComment(config: Config, branchName: string, baseBranch: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Comment posted when `gh pr merge` fails for a reason other than conflicts
|
|
23
|
+
* (e.g. branch protection, required checks not green, missing approvals, gh
|
|
24
|
+
* not authenticated). Includes the raw gh error so the user can act on it
|
|
25
|
+
* without having to dig through aidev's local logs.
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildAcceptedMergeFailureComment(config: Config, branchName: string, reason: string): string;
|
|
21
28
|
export declare function hasAlreadyNotifiedConflict(comments: Comment[], commentPrefix: string): boolean;
|
|
22
29
|
/**
|
|
23
30
|
* Pick the configured done status, otherwise probe the board for one of the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accepted.d.ts","sourceRoot":"","sources":["../../src/commands/accepted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAa5C;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,kDAAkD,CAAC;AAExF;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,MAAM,CAMR;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,OAAO,EAAE,EACnB,aAAa,EAAE,MAAM,GACpB,OAAO,CAIT;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAoBxB;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"accepted.d.ts","sourceRoot":"","sources":["../../src/commands/accepted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAa5C;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,kDAAkD,CAAC;AAExF;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,MAAM,CAMR;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,MAAM,CAMR;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,OAAO,EAAE,EACnB,aAAa,EAAE,MAAM,GACpB,OAAO,CAIT;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAoBxB;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,IAAI,CAAC,CAkIf"}
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.ACCEPTED_CONFLICT_MARKER = void 0;
|
|
37
37
|
exports.buildAcceptedMergeComment = buildAcceptedMergeComment;
|
|
38
38
|
exports.buildAcceptedConflictComment = buildAcceptedConflictComment;
|
|
39
|
+
exports.buildAcceptedMergeFailureComment = buildAcceptedMergeFailureComment;
|
|
39
40
|
exports.hasAlreadyNotifiedConflict = hasAlreadyNotifiedConflict;
|
|
40
41
|
exports.resolveDoneStatus = resolveDoneStatus;
|
|
41
42
|
exports.acceptedCommand = acceptedCommand;
|
|
@@ -68,6 +69,17 @@ function buildAcceptedConflictComment(config, branchName, baseBranch) {
|
|
|
68
69
|
`the PR ${exports.ACCEPTED_CONFLICT_MARKER} with \`${baseBranch}\`. Resolve the conflicts ` +
|
|
69
70
|
`(or retrigger the task to let aidev attempt resolution) before this can be merged.`);
|
|
70
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Comment posted when `gh pr merge` fails for a reason other than conflicts
|
|
74
|
+
* (e.g. branch protection, required checks not green, missing approvals, gh
|
|
75
|
+
* not authenticated). Includes the raw gh error so the user can act on it
|
|
76
|
+
* without having to dig through aidev's local logs.
|
|
77
|
+
*/
|
|
78
|
+
function buildAcceptedMergeFailureComment(config, branchName, reason) {
|
|
79
|
+
const trimmed = reason.trim() || 'no error message reported by gh';
|
|
80
|
+
return (`${config.commentPrefix} Failed to merge accepted pull request for branch \`${branchName}\`.\n\n` +
|
|
81
|
+
`Reason:\n\`\`\`\n${trimmed}\n\`\`\``);
|
|
82
|
+
}
|
|
71
83
|
function hasAlreadyNotifiedConflict(comments, commentPrefix) {
|
|
72
84
|
return comments.some((c) => c.text.startsWith(commentPrefix) && c.text.includes(exports.ACCEPTED_CONFLICT_MARKER));
|
|
73
85
|
}
|
|
@@ -170,6 +182,12 @@ async function acceptedCommand(config, provider) {
|
|
|
170
182
|
const result = (0, github_1.mergePullRequest)(branchName);
|
|
171
183
|
if (!result.success) {
|
|
172
184
|
logger_1.logger.error(`[${task.id}] Failed to merge PR: ${result.error}`);
|
|
185
|
+
try {
|
|
186
|
+
await provider.postComment(task.id, buildAcceptedMergeFailureComment(config, branchName, result.error));
|
|
187
|
+
}
|
|
188
|
+
catch (err) {
|
|
189
|
+
logger_1.logger.warn(`[${task.id}] Failed to post merge-failure notice: ${err instanceof Error ? err.message : String(err)}`);
|
|
190
|
+
}
|
|
173
191
|
continue;
|
|
174
192
|
}
|
|
175
193
|
logger_1.logger.success(`[${task.id}] PR merged successfully`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accepted.js","sourceRoot":"","sources":["../../src/commands/accepted.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,8DAEC;AAOD,oEAUC;AAED,gEAOC;AAOD,8CAuBC;AAOD,
|
|
1
|
+
{"version":3,"file":"accepted.js","sourceRoot":"","sources":["../../src/commands/accepted.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,8DAEC;AAOD,oEAUC;AAQD,4EAUC;AAED,gEAOC;AAOD,8CAuBC;AAOD,0CAqIC;AAhPD,sCAAmC;AACnC,sCAKmB;AACnB,4CAA8B;AAC9B,+BAA0C;AAE1C,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAE/E;;;;;GAKG;AACU,QAAA,wBAAwB,GAAG,+CAA+C,CAAC;AAExF;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,MAAc,EAAE,UAAkB;IAC1E,OAAO,GAAG,MAAM,CAAC,aAAa,mDAAmD,UAAU,KAAK,CAAC;AACnG,CAAC;AAED;;;;GAIG;AACH,SAAgB,4BAA4B,CAC1C,MAAc,EACd,UAAkB,EAClB,UAAkB;IAElB,OAAO,CACL,GAAG,MAAM,CAAC,aAAa,oDAAoD,UAAU,OAAO;QAC5F,UAAU,gCAAwB,WAAW,UAAU,4BAA4B;QACnF,oFAAoF,CACrF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,gCAAgC,CAC9C,MAAc,EACd,UAAkB,EAClB,MAAc;IAEd,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,IAAI,iCAAiC,CAAC;IACnE,OAAO,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CAAC;AACpE,CAAC"}
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -51,9 +51,13 @@ export interface Answers {
|
|
|
51
51
|
githubBaseBranch: string;
|
|
52
52
|
githubRepo: string;
|
|
53
53
|
agents: string;
|
|
54
|
+
anthropicApiKey: string;
|
|
55
|
+
anthropicBaseUrl: string;
|
|
56
|
+
claudeModel: string;
|
|
54
57
|
devNotesMode: string;
|
|
55
58
|
triggerWord: string;
|
|
56
59
|
thinkingTag: string;
|
|
60
|
+
planningTag: string;
|
|
57
61
|
commentPrefix: string;
|
|
58
62
|
aidevEnvExtend: string;
|
|
59
63
|
acceptedTag: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AA4BA;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;CAAE,GACzE,MAAM,GAAG,IAAI,CAiBf;AAED,wBAAgB,eAAe,CAAC,GAAG,SAAgB,GAAG,IAAI,CAyBzD;AAuCD,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAExE,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAE9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE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AM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAqHD,2EAA2E;AAC3E,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1C;AAMD,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAwH5C;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA4BtD;AA6GD,wBAAgB,sBAAsB,CAAC,GAAG,SAAgB,GAAG,IAAI,CAchE;AAED,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAidjD"}
|
package/dist/commands/init.js
CHANGED
|
@@ -55,7 +55,8 @@ const schedule_1 = require("./schedule");
|
|
|
55
55
|
const github_1 = require("../github");
|
|
56
56
|
const platform_1 = require("../platform");
|
|
57
57
|
const chalk_1 = __importDefault(require("chalk"));
|
|
58
|
-
const VALID_AGENTS = ['antigravity', 'claude', 'codex', 'cursor', 'windsurf'];
|
|
58
|
+
const VALID_AGENTS = ['antigravity', 'anthropic-sdk', 'claude', 'codex', 'cursor', 'windsurf'];
|
|
59
|
+
const DEFAULT_CLAUDE_MODEL = 'claude-opus-4-6';
|
|
59
60
|
// Patterns we want guaranteed in .gitignore.
|
|
60
61
|
// Each entry: [pattern to write, regex that matches equivalent existing lines]
|
|
61
62
|
const GITIGNORE_RULES = [
|
|
@@ -308,9 +309,21 @@ function renderEnv(a) {
|
|
|
308
309
|
`GITHUB_BASE_BRANCH=${envVal(a.githubBaseBranch)}`,
|
|
309
310
|
line('GITHUB_REPO', a.githubRepo),
|
|
310
311
|
``,
|
|
311
|
-
`# Agents to use, in fallback order (comma-separated: antigravity, claude, codex, cursor, windsurf)`,
|
|
312
|
+
`# Agents to use, in fallback order (comma-separated: antigravity, anthropic-sdk, claude, codex, cursor, windsurf)`,
|
|
312
313
|
`AGENTS=${a.agents}`,
|
|
313
314
|
``,
|
|
315
|
+
...(a.agents.split(',').map((s) => s.trim()).includes('anthropic-sdk')
|
|
316
|
+
? [
|
|
317
|
+
`# Anthropic Agent SDK runner — drives Claude in-process via @anthropic-ai/claude-agent-sdk.`,
|
|
318
|
+
`# ANTHROPIC_API_KEY accepts a comma-separated pool of tokens; the runner rotates round-robin.`,
|
|
319
|
+
`ANTHROPIC_API_KEY=${envVal(a.anthropicApiKey)}`,
|
|
320
|
+
a.anthropicBaseUrl
|
|
321
|
+
? `ANTHROPIC_BASE_URL=${envVal(a.anthropicBaseUrl)}`
|
|
322
|
+
: `# ANTHROPIC_BASE_URL=https://api.anthropic.com`,
|
|
323
|
+
`CLAUDE_MODEL=${envVal(a.claudeModel || DEFAULT_CLAUDE_MODEL)}`,
|
|
324
|
+
``,
|
|
325
|
+
]
|
|
326
|
+
: []),
|
|
314
327
|
`# DEV_NOTES_MODE: smart (only ask when unclear) | always (ask before every task)`,
|
|
315
328
|
`DEV_NOTES_MODE=${a.devNotesMode}`,
|
|
316
329
|
``,
|
|
@@ -323,6 +336,9 @@ function renderEnv(a) {
|
|
|
323
336
|
`# THINKING_TAG: tasks with this tag are analyzed and broken into sub-tasks before execution`,
|
|
324
337
|
line('THINKING_TAG', a.thinkingTag),
|
|
325
338
|
``,
|
|
339
|
+
`# PLANNING_TAG: tasks with this tag are split into self-contained sub-tickets pushed back to the provider`,
|
|
340
|
+
line('PLANNING_TAG', a.planningTag),
|
|
341
|
+
``,
|
|
326
342
|
`# NON_CODE_TAG: tasks with this tag run without git branching (no checkout/commit/push)`,
|
|
327
343
|
line('NON_CODE_TAG', a.nonCodeTag),
|
|
328
344
|
line('NON_CODE_CLICKUP_TEAM_ID', a.nonCodeClickupTeamId),
|
|
@@ -571,7 +587,7 @@ async function initCommand() {
|
|
|
571
587
|
linearApiKey = await ask(rl, `API key ${globalEnvHint}`, existing.LINEAR_API_KEY || '', true);
|
|
572
588
|
linearTeamId = await ask(rl, `Team ID ${hint('UUID from Linear workspace settings')}`, existing.LINEAR_TEAM_ID || '', true);
|
|
573
589
|
linearLabel = await ask(rl, `Label to filter issues ${hint('issues with this label will be picked up')}`, existing.LINEAR_LABEL || folderName);
|
|
574
|
-
linearPendingStatus = await ask(rl, 'Pending status name', existing.LINEAR_PENDING_STATUS || '
|
|
590
|
+
linearPendingStatus = await ask(rl, 'Pending status name', existing.LINEAR_PENDING_STATUS || 'Pending');
|
|
575
591
|
linearInReviewStatus = await ask(rl, 'In-review status name', existing.LINEAR_IN_REVIEW_STATUS || 'In Review');
|
|
576
592
|
}
|
|
577
593
|
else if (provider === 'monday') {
|
|
@@ -618,9 +634,22 @@ async function initCommand() {
|
|
|
618
634
|
// ── AI agents ────────────────────────────────────────────
|
|
619
635
|
section('AI agents');
|
|
620
636
|
const agents = await pickAgents(rl, existing.AGENTS || '');
|
|
637
|
+
// ── Anthropic Agent SDK ─────────────────────────────────
|
|
638
|
+
let anthropicApiKey = '';
|
|
639
|
+
let anthropicBaseUrl = '';
|
|
640
|
+
let claudeModel = '';
|
|
641
|
+
const agentList = agents.split(',').map((s) => s.trim());
|
|
642
|
+
if (agentList.includes('anthropic-sdk')) {
|
|
643
|
+
section('Anthropic Agent SDK');
|
|
644
|
+
console.log(chalk_1.default.dim(` Drives Claude in-process via @anthropic-ai/claude-agent-sdk.\n` +
|
|
645
|
+
` ANTHROPIC_API_KEY accepts a single key or a comma-separated pool — the runner rotates round-robin.`));
|
|
646
|
+
anthropicApiKey = await ask(rl, `ANTHROPIC_API_KEY ${hint('comma-separated for multiple keys')}`, existing.ANTHROPIC_API_KEY || '', true);
|
|
647
|
+
anthropicBaseUrl = await ask(rl, `ANTHROPIC_BASE_URL ${hint('optional — leave blank for default')}`, existing.ANTHROPIC_BASE_URL || '');
|
|
648
|
+
claudeModel = await ask(rl, `CLAUDE_MODEL`, existing.CLAUDE_MODEL || DEFAULT_CLAUDE_MODEL);
|
|
649
|
+
}
|
|
621
650
|
// ── Validate agent permissions ──────────────────────────
|
|
622
651
|
section('Agent permissions');
|
|
623
|
-
await (0, permissions_1.validateAgentPermissions)(
|
|
652
|
+
await (0, permissions_1.validateAgentPermissions)(agentList, rl);
|
|
624
653
|
const devNotesMode = await choose(rl, `Dev notes mode ${hint('smart = ask AI if unclear, always = ask before every task')}`, ['smart', 'always'], existing.DEV_NOTES_MODE || 'smart');
|
|
625
654
|
// ── Trigger word ─────────────────────────────────────────
|
|
626
655
|
section('Trigger word');
|
|
@@ -631,6 +660,9 @@ async function initCommand() {
|
|
|
631
660
|
// ── Thinking tag ────────────────────────────────────────
|
|
632
661
|
section('Thinking tasks');
|
|
633
662
|
const thinkingTag = await ask(rl, `Thinking tag ${hint('tasks with this tag are broken into sub-tasks before execution')}`, existing.THINKING_TAG || 'thinking');
|
|
663
|
+
// ── Planning tag ────────────────────────────────────────
|
|
664
|
+
section('Planning tasks');
|
|
665
|
+
const planningTag = await ask(rl, `Planning tag ${hint('tasks with this tag are split into self-contained sub-tickets pushed back to the provider')}`, existing.PLANNING_TAG || 'planning');
|
|
634
666
|
// ── Non-code tasks ──────────────────────────────────────
|
|
635
667
|
section('Non-code tasks');
|
|
636
668
|
console.log(chalk_1.default.dim(` Tasks with the non-code tag are executed without git branching — no checkout,\n` +
|
|
@@ -722,9 +754,13 @@ async function initCommand() {
|
|
|
722
754
|
githubBaseBranch,
|
|
723
755
|
githubRepo,
|
|
724
756
|
agents,
|
|
757
|
+
anthropicApiKey,
|
|
758
|
+
anthropicBaseUrl,
|
|
759
|
+
claudeModel,
|
|
725
760
|
devNotesMode,
|
|
726
761
|
triggerWord,
|
|
727
762
|
thinkingTag,
|
|
763
|
+
planningTag,
|
|
728
764
|
commentPrefix,
|
|
729
765
|
acceptedTag,
|
|
730
766
|
doneStatus,
|