@qelos/aidev 0.5.3 → 0.6.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 +98 -92
- package/CONTRIBUTING.md +78 -78
- package/LICENSE +21 -21
- package/README.md +753 -735
- package/dist/cli.js +6 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/help.js +80 -80
- package/dist/commands/init.js +105 -105
- package/dist/commands/run.js +146 -146
- package/dist/commands/schedule.d.ts +18 -3
- package/dist/commands/schedule.d.ts.map +1 -1
- package/dist/commands/schedule.js +103 -24
- package/dist/commands/schedule.js.map +1 -1
- package/dist/github.js +27 -27
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +23 -3
- package/dist/logger.js.map +1 -1
- package/dist/providers/linear.d.ts +1 -4
- package/dist/providers/linear.d.ts.map +1 -1
- package/dist/providers/linear.js +77 -141
- package/dist/providers/linear.js.map +1 -1
- package/dist/providers/monday.js +39 -39
- package/package.json +51 -51
- package/scripts/run-tests.cjs +18 -18
- package/.aidev/assets/86c8yjxrr/9ea11c36-311c-4022-889c-1bb0915122dc.jpg-40e6939e3b68e864260f7ae7e85bd623_exif.jpg +0 -0
- package/dist/autoCompress.d.ts +0 -54
- package/dist/autoCompress.d.ts.map +0 -1
- package/dist/autoCompress.js +0 -300
- package/dist/autoCompress.js.map +0 -1
package/dist/providers/linear.js
CHANGED
|
@@ -4,16 +4,10 @@ exports.LinearProvider = void 0;
|
|
|
4
4
|
const logger_1 = require("../logger");
|
|
5
5
|
const LINEAR_GRAPHQL = 'https://api.linear.app/graphql';
|
|
6
6
|
const SKIP_STATE_TYPES = new Set(['completed', 'canceled']);
|
|
7
|
-
const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
8
|
-
function formatLinearError(e) {
|
|
9
|
-
const detail = e.extensions?.userPresentableMessage;
|
|
10
|
-
return detail ? `${e.message} (${detail})` : e.message;
|
|
11
|
-
}
|
|
12
7
|
class LinearProvider {
|
|
13
8
|
constructor(config) {
|
|
14
|
-
this.resolvedTeamId = null;
|
|
15
9
|
this.apiKey = config.linearApiKey;
|
|
16
|
-
this.
|
|
10
|
+
this.teamId = config.linearTeamId;
|
|
17
11
|
this.label = config.linearLabel;
|
|
18
12
|
this.pendingStatus = config.linearPendingStatus || 'Backlog';
|
|
19
13
|
this.inReviewStatus = config.linearInReviewStatus || 'In Review';
|
|
@@ -29,79 +23,30 @@ class LinearProvider {
|
|
|
29
23
|
});
|
|
30
24
|
const raw = (await res.json());
|
|
31
25
|
if (!res.ok) {
|
|
32
|
-
const msg = raw.errors?.map(
|
|
26
|
+
const msg = raw.errors?.map((e) => e.message).join('; ') || res.statusText;
|
|
33
27
|
throw new Error(`Linear API error ${res.status}: ${msg}`);
|
|
34
28
|
}
|
|
35
29
|
if (raw.errors?.length) {
|
|
36
|
-
throw new Error(`Linear GraphQL errors: ${raw.errors.map(
|
|
30
|
+
throw new Error(`Linear GraphQL errors: ${raw.errors.map((e) => e.message).join('; ')}`);
|
|
37
31
|
}
|
|
38
32
|
if (raw.data === undefined) {
|
|
39
33
|
throw new Error('Linear API returned no data');
|
|
40
34
|
}
|
|
41
35
|
return raw.data;
|
|
42
36
|
}
|
|
43
|
-
async resolveTeamId() {
|
|
44
|
-
if (this.resolvedTeamId)
|
|
45
|
-
return this.resolvedTeamId;
|
|
46
|
-
if (!this.teamIdInput) {
|
|
47
|
-
throw new Error('Linear: LINEAR_TEAM_ID is not set');
|
|
48
|
-
}
|
|
49
|
-
if (UUID_REGEX.test(this.teamIdInput)) {
|
|
50
|
-
this.resolvedTeamId = this.teamIdInput;
|
|
51
|
-
return this.resolvedTeamId;
|
|
52
|
-
}
|
|
53
|
-
// Linear's team(id) accepts UUID or team key (e.g. "ENG", "JAC")
|
|
54
|
-
const query = `
|
|
55
|
-
query Team($id: String!) {
|
|
56
|
-
team(id: $id) { id }
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
const data = await this.graphql(query, { id: this.teamIdInput });
|
|
60
|
-
if (!data.team?.id) {
|
|
61
|
-
throw new Error(`Linear: could not resolve LINEAR_TEAM_ID "${this.teamIdInput}". Set it to the team UUID or team key.`);
|
|
62
|
-
}
|
|
63
|
-
this.resolvedTeamId = data.team.id;
|
|
64
|
-
return this.resolvedTeamId;
|
|
65
|
-
}
|
|
66
|
-
async resolveLabelIds(teamId, names) {
|
|
67
|
-
if (!names.length)
|
|
68
|
-
return { ids: [], missing: [] };
|
|
69
|
-
const query = `
|
|
70
|
-
query Labels($filter: IssueLabelFilter) {
|
|
71
|
-
issueLabels(filter: $filter, first: 250) {
|
|
72
|
-
nodes { id name }
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
76
|
-
const data = await this.graphql(query, { filter: { team: { id: { eq: teamId } } } });
|
|
77
|
-
const byName = new Map();
|
|
78
|
-
for (const node of data.issueLabels.nodes)
|
|
79
|
-
byName.set(node.name.toLowerCase(), node.id);
|
|
80
|
-
const ids = [];
|
|
81
|
-
const missing = [];
|
|
82
|
-
for (const name of names) {
|
|
83
|
-
const id = byName.get(name.toLowerCase());
|
|
84
|
-
if (id)
|
|
85
|
-
ids.push(id);
|
|
86
|
-
else
|
|
87
|
-
missing.push(name);
|
|
88
|
-
}
|
|
89
|
-
return { ids, missing };
|
|
90
|
-
}
|
|
91
37
|
async fetchWorkflowStateIds() {
|
|
92
|
-
const query = `
|
|
93
|
-
query WorkflowStates($filter: WorkflowStateFilter) {
|
|
94
|
-
workflowStates(filter: $filter) {
|
|
95
|
-
nodes {
|
|
96
|
-
id
|
|
97
|
-
name
|
|
98
|
-
type
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
38
|
+
const query = `
|
|
39
|
+
query WorkflowStates($filter: WorkflowStateFilter) {
|
|
40
|
+
workflowStates(filter: $filter) {
|
|
41
|
+
nodes {
|
|
42
|
+
id
|
|
43
|
+
name
|
|
44
|
+
type
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
102
48
|
`;
|
|
103
|
-
const
|
|
104
|
-
const data = await this.graphql(query, { filter: { team: { id: { eq: teamId } } } });
|
|
49
|
+
const data = await this.graphql(query, { filter: { team: { id: { eq: this.teamId } } } });
|
|
105
50
|
const byName = new Map();
|
|
106
51
|
for (const node of data.workflowStates.nodes) {
|
|
107
52
|
byName.set(node.name.toLowerCase(), node.id);
|
|
@@ -109,30 +54,29 @@ class LinearProvider {
|
|
|
109
54
|
return byName;
|
|
110
55
|
}
|
|
111
56
|
async fetchTasks() {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
57
|
+
logger_1.logger.debug(`Fetching Linear issues for team ${this.teamId} with label "${this.label}"`);
|
|
58
|
+
const query = `
|
|
59
|
+
query Issues($filter: IssueFilter) {
|
|
60
|
+
issues(filter: $filter, first: 100) {
|
|
61
|
+
nodes {
|
|
62
|
+
id
|
|
63
|
+
identifier
|
|
64
|
+
title
|
|
65
|
+
description
|
|
66
|
+
url
|
|
67
|
+
state { id name type }
|
|
68
|
+
priority
|
|
69
|
+
labels { nodes { name } }
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
129
73
|
`;
|
|
130
74
|
const filter = {
|
|
131
|
-
team: { id: { eq: teamId } },
|
|
75
|
+
team: { id: { eq: this.teamId } },
|
|
132
76
|
state: { type: { nin: ['completed', 'canceled'] } },
|
|
133
77
|
};
|
|
134
78
|
if (this.label && this.label !== '*') {
|
|
135
|
-
filter.labels = {
|
|
79
|
+
filter.labels = { name: { eq: this.label } };
|
|
136
80
|
}
|
|
137
81
|
const data = await this.graphql(query, { filter });
|
|
138
82
|
const skipTypes = new Set(SKIP_STATE_TYPES);
|
|
@@ -156,13 +100,13 @@ class LinearProvider {
|
|
|
156
100
|
async postComment(taskId, text) {
|
|
157
101
|
logger_1.logger.debug(`Posting comment to Linear issue ${taskId}`);
|
|
158
102
|
const issueId = await this.resolveIssueId(taskId);
|
|
159
|
-
const mutation = `
|
|
160
|
-
mutation CreateComment($input: CommentCreateInput!) {
|
|
161
|
-
commentCreate(input: $input) {
|
|
162
|
-
success
|
|
163
|
-
comment { id }
|
|
164
|
-
}
|
|
165
|
-
}
|
|
103
|
+
const mutation = `
|
|
104
|
+
mutation CreateComment($input: CommentCreateInput!) {
|
|
105
|
+
commentCreate(input: $input) {
|
|
106
|
+
success
|
|
107
|
+
comment { id }
|
|
108
|
+
}
|
|
109
|
+
}
|
|
166
110
|
`;
|
|
167
111
|
await this.graphql(mutation, {
|
|
168
112
|
input: { issueId, body: text },
|
|
@@ -171,19 +115,19 @@ class LinearProvider {
|
|
|
171
115
|
async getComments(taskId) {
|
|
172
116
|
logger_1.logger.debug(`Fetching comments for Linear issue ${taskId}`);
|
|
173
117
|
const issueId = await this.resolveIssueId(taskId);
|
|
174
|
-
const query = `
|
|
175
|
-
query IssueComments($id: String!) {
|
|
176
|
-
issue(id: $id) {
|
|
177
|
-
comments {
|
|
178
|
-
nodes {
|
|
179
|
-
id
|
|
180
|
-
body
|
|
181
|
-
user { name id }
|
|
182
|
-
createdAt
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
118
|
+
const query = `
|
|
119
|
+
query IssueComments($id: String!) {
|
|
120
|
+
issue(id: $id) {
|
|
121
|
+
comments {
|
|
122
|
+
nodes {
|
|
123
|
+
id
|
|
124
|
+
body
|
|
125
|
+
user { name id }
|
|
126
|
+
createdAt
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
187
131
|
`;
|
|
188
132
|
const data = await this.graphql(query, { id: issueId });
|
|
189
133
|
const nodes = data.issue?.comments?.nodes ?? [];
|
|
@@ -198,12 +142,12 @@ class LinearProvider {
|
|
|
198
142
|
}
|
|
199
143
|
async resolveIssueId(identifier) {
|
|
200
144
|
if (/^[A-Z]+-\d+$/i.test(identifier)) {
|
|
201
|
-
const query = `
|
|
202
|
-
query IssueByIdentifier($filter: IssueFilter) {
|
|
203
|
-
issues(filter: $filter, first: 1) {
|
|
204
|
-
nodes { id }
|
|
205
|
-
}
|
|
206
|
-
}
|
|
145
|
+
const query = `
|
|
146
|
+
query IssueByIdentifier($filter: IssueFilter) {
|
|
147
|
+
issues(filter: $filter, first: 1) {
|
|
148
|
+
nodes { id }
|
|
149
|
+
}
|
|
150
|
+
}
|
|
207
151
|
`;
|
|
208
152
|
const data = await this.graphql(query, {
|
|
209
153
|
filter: { identifier: { eq: identifier } },
|
|
@@ -212,12 +156,12 @@ class LinearProvider {
|
|
|
212
156
|
if (id)
|
|
213
157
|
return id;
|
|
214
158
|
}
|
|
215
|
-
const byIdQuery = `
|
|
216
|
-
query Issue($id: String!) {
|
|
217
|
-
issue(id: $id) {
|
|
218
|
-
id
|
|
219
|
-
}
|
|
220
|
-
}
|
|
159
|
+
const byIdQuery = `
|
|
160
|
+
query Issue($id: String!) {
|
|
161
|
+
issue(id: $id) {
|
|
162
|
+
id
|
|
163
|
+
}
|
|
164
|
+
}
|
|
221
165
|
`;
|
|
222
166
|
const byId = await this.graphql(byIdQuery, { id: identifier });
|
|
223
167
|
if (byId.issue?.id)
|
|
@@ -234,12 +178,12 @@ class LinearProvider {
|
|
|
234
178
|
throw new Error(`Linear: no workflow state matching "${status}". Available: ${names}`);
|
|
235
179
|
}
|
|
236
180
|
const issueId = await this.resolveIssueId(taskId);
|
|
237
|
-
const mutation = `
|
|
238
|
-
mutation IssueUpdate($id: String!, $input: IssueUpdateInput!) {
|
|
239
|
-
issueUpdate(id: $id, input: $input) {
|
|
240
|
-
success
|
|
241
|
-
}
|
|
242
|
-
}
|
|
181
|
+
const mutation = `
|
|
182
|
+
mutation IssueUpdate($id: String!, $input: IssueUpdateInput!) {
|
|
183
|
+
issueUpdate(id: $id, input: $input) {
|
|
184
|
+
success
|
|
185
|
+
}
|
|
186
|
+
}
|
|
243
187
|
`;
|
|
244
188
|
await this.graphql(mutation, {
|
|
245
189
|
id: issueId,
|
|
@@ -247,30 +191,22 @@ class LinearProvider {
|
|
|
247
191
|
});
|
|
248
192
|
}
|
|
249
193
|
async createTask(params) {
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
194
|
+
const mutation = `
|
|
195
|
+
mutation IssueCreate($input: IssueCreateInput!) {
|
|
196
|
+
issueCreate(input: $input) {
|
|
197
|
+
success
|
|
198
|
+
issue { id identifier url }
|
|
254
199
|
}
|
|
255
|
-
|
|
256
|
-
mutation IssueCreate($input: IssueCreateInput!) {
|
|
257
|
-
issueCreate(input: $input) {
|
|
258
|
-
success
|
|
259
|
-
issue { id identifier url }
|
|
260
|
-
}
|
|
261
|
-
}
|
|
200
|
+
}
|
|
262
201
|
`;
|
|
263
202
|
const input = {
|
|
264
|
-
teamId,
|
|
203
|
+
teamId: this.teamId,
|
|
265
204
|
title: params.title,
|
|
266
205
|
description: params.description || undefined,
|
|
267
206
|
};
|
|
268
207
|
if (params.priority !== undefined) {
|
|
269
208
|
input.priority = params.priority;
|
|
270
209
|
}
|
|
271
|
-
if (labelIds.length) {
|
|
272
|
-
input.labelIds = labelIds;
|
|
273
|
-
}
|
|
274
210
|
const data = await this.graphql(mutation, { input });
|
|
275
211
|
const issue = data.issueCreate?.issue;
|
|
276
212
|
if (!issue) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linear.js","sourceRoot":"","sources":["../../src/providers/linear.ts"],"names":[],"mappings":";;;AAEA,sCAAmC;AAEnC,MAAM,cAAc,GAAG,gCAAgC,CAAC;AACxD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,UAAU,C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AAC,MAAM;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,SAAS;SAC7C,CAAC;QACF,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAClC,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QACnC,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAE5B,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAExB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC;QACtC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;IAClD,CAAC;CACF;AAzQD,wCAyQC"}
|
package/dist/providers/monday.js
CHANGED
|
@@ -53,21 +53,21 @@ class MondayProvider {
|
|
|
53
53
|
}
|
|
54
54
|
async fetchTasks() {
|
|
55
55
|
logger_1.logger.debug(`Fetching items from Monday board ${this.boardId}`);
|
|
56
|
-
const query = `
|
|
57
|
-
query ($boardId: ID!, $limit: Int!) {
|
|
58
|
-
boards(ids: [$boardId]) {
|
|
59
|
-
items_page(limit: $limit) {
|
|
60
|
-
cursor
|
|
61
|
-
items {
|
|
62
|
-
id
|
|
63
|
-
name
|
|
64
|
-
url
|
|
65
|
-
description { description }
|
|
66
|
-
column_values { id value text }
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
56
|
+
const query = `
|
|
57
|
+
query ($boardId: ID!, $limit: Int!) {
|
|
58
|
+
boards(ids: [$boardId]) {
|
|
59
|
+
items_page(limit: $limit) {
|
|
60
|
+
cursor
|
|
61
|
+
items {
|
|
62
|
+
id
|
|
63
|
+
name
|
|
64
|
+
url
|
|
65
|
+
description { description }
|
|
66
|
+
column_values { id value text }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
71
|
`;
|
|
72
72
|
const data = await this.graphql(query, {
|
|
73
73
|
boardId: this.boardId,
|
|
@@ -102,10 +102,10 @@ class MondayProvider {
|
|
|
102
102
|
}
|
|
103
103
|
async postComment(taskId, text) {
|
|
104
104
|
logger_1.logger.debug(`Posting update to Monday item ${taskId}`);
|
|
105
|
-
const mutation = `
|
|
106
|
-
mutation ($itemId: ID!, $body: String!) {
|
|
107
|
-
create_update(item_id: $itemId, body: $body) { id }
|
|
108
|
-
}
|
|
105
|
+
const mutation = `
|
|
106
|
+
mutation ($itemId: ID!, $body: String!) {
|
|
107
|
+
create_update(item_id: $itemId, body: $body) { id }
|
|
108
|
+
}
|
|
109
109
|
`;
|
|
110
110
|
await this.graphql(mutation, {
|
|
111
111
|
itemId: taskId,
|
|
@@ -114,18 +114,18 @@ class MondayProvider {
|
|
|
114
114
|
}
|
|
115
115
|
async getComments(taskId) {
|
|
116
116
|
logger_1.logger.debug(`Fetching updates for Monday item ${taskId}`);
|
|
117
|
-
const query = `
|
|
118
|
-
query ($itemId: ID!) {
|
|
119
|
-
items(ids: [$itemId]) {
|
|
120
|
-
updates(limit: 100) {
|
|
121
|
-
id
|
|
122
|
-
text_body
|
|
123
|
-
body
|
|
124
|
-
created_at
|
|
125
|
-
creator { id name }
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
117
|
+
const query = `
|
|
118
|
+
query ($itemId: ID!) {
|
|
119
|
+
items(ids: [$itemId]) {
|
|
120
|
+
updates(limit: 100) {
|
|
121
|
+
id
|
|
122
|
+
text_body
|
|
123
|
+
body
|
|
124
|
+
created_at
|
|
125
|
+
creator { id name }
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
129
|
`;
|
|
130
130
|
const data = await this.graphql(query, { itemId: taskId });
|
|
131
131
|
const item = data.items?.[0];
|
|
@@ -142,10 +142,10 @@ class MondayProvider {
|
|
|
142
142
|
}
|
|
143
143
|
async updateStatus(taskId, status) {
|
|
144
144
|
logger_1.logger.debug(`Updating Monday item ${taskId} status to "${status}"`);
|
|
145
|
-
const mutation = `
|
|
146
|
-
mutation ($boardId: ID!, $itemId: ID!, $columnId: String!, $value: String!) {
|
|
147
|
-
change_column_value(board_id: $boardId, item_id: $itemId, column_id: $columnId, value: $value) { id }
|
|
148
|
-
}
|
|
145
|
+
const mutation = `
|
|
146
|
+
mutation ($boardId: ID!, $itemId: ID!, $columnId: String!, $value: String!) {
|
|
147
|
+
change_column_value(board_id: $boardId, item_id: $itemId, column_id: $columnId, value: $value) { id }
|
|
148
|
+
}
|
|
149
149
|
`;
|
|
150
150
|
const value = JSON.stringify({ label: status });
|
|
151
151
|
await this.graphql(mutation, {
|
|
@@ -157,10 +157,10 @@ class MondayProvider {
|
|
|
157
157
|
}
|
|
158
158
|
async createTask(params) {
|
|
159
159
|
const groupId = this.groupId || 'topics';
|
|
160
|
-
const mutation = `
|
|
161
|
-
mutation ($boardId: ID!, $groupId: String!, $itemName: String!, $columnValues: JSON) {
|
|
162
|
-
create_item(board_id: $boardId, group_id: $groupId, item_name: $itemName, column_values: $columnValues) { id }
|
|
163
|
-
}
|
|
160
|
+
const mutation = `
|
|
161
|
+
mutation ($boardId: ID!, $groupId: String!, $itemName: String!, $columnValues: JSON) {
|
|
162
|
+
create_item(board_id: $boardId, group_id: $groupId, item_name: $itemName, column_values: $columnValues) { id }
|
|
163
|
+
}
|
|
164
164
|
`;
|
|
165
165
|
const columnValues = {};
|
|
166
166
|
if (this.statusColumnId) {
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@qelos/aidev",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "AI-powered task executor — polls ClickUp (and more) to implement tasks with Claude, Cursor, Windsurf, or Antigravity",
|
|
5
|
-
"type": "commonjs",
|
|
6
|
-
"bin": {
|
|
7
|
-
"aidev": "dist/cli.js"
|
|
8
|
-
},
|
|
9
|
-
"main": "./dist/cli.js",
|
|
10
|
-
"engines": {
|
|
11
|
-
"node": ">=22.0.0"
|
|
12
|
-
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"build": "tsc && node -e \"if(process.platform!=='win32')require('node:fs').chmodSync('dist/cli.js',0o755)\"",
|
|
15
|
-
"dev": "tsx src/cli.ts",
|
|
16
|
-
"test": "node scripts/run-tests.cjs",
|
|
17
|
-
"prepublishOnly": "npm run build"
|
|
18
|
-
},
|
|
19
|
-
"keywords": [
|
|
20
|
-
"ai",
|
|
21
|
-
"cli",
|
|
22
|
-
"clickup",
|
|
23
|
-
"claude",
|
|
24
|
-
"cursor",
|
|
25
|
-
"automation"
|
|
26
|
-
],
|
|
27
|
-
"author": "",
|
|
28
|
-
"license": "MIT",
|
|
29
|
-
"repository": {
|
|
30
|
-
"type": "git",
|
|
31
|
-
"url": "git+https://github.com/qelos-io/aidev.git"
|
|
32
|
-
},
|
|
33
|
-
"bugs": {
|
|
34
|
-
"url": "https://github.com/qelos-io/aidev/issues"
|
|
35
|
-
},
|
|
36
|
-
"homepage": "https://github.com/qelos-io/aidev#readme",
|
|
37
|
-
"publishConfig": {
|
|
38
|
-
"access": "public"
|
|
39
|
-
},
|
|
40
|
-
"dependencies": {
|
|
41
|
-
"chalk": "^4.1.2",
|
|
42
|
-
"commander": "^12.0.0",
|
|
43
|
-
"dotenv": "^16.4.0",
|
|
44
|
-
"jiti": "^2.6.1"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@types/node": "^22.0.0",
|
|
48
|
-
"tsx": "^4.0.0",
|
|
49
|
-
"typescript": "^5.0.0"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@qelos/aidev",
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "AI-powered task executor — polls ClickUp (and more) to implement tasks with Claude, Cursor, Windsurf, or Antigravity",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"bin": {
|
|
7
|
+
"aidev": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/cli.js",
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=22.0.0"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc && node -e \"if(process.platform!=='win32')require('node:fs').chmodSync('dist/cli.js',0o755)\"",
|
|
15
|
+
"dev": "tsx src/cli.ts",
|
|
16
|
+
"test": "node scripts/run-tests.cjs",
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"ai",
|
|
21
|
+
"cli",
|
|
22
|
+
"clickup",
|
|
23
|
+
"claude",
|
|
24
|
+
"cursor",
|
|
25
|
+
"automation"
|
|
26
|
+
],
|
|
27
|
+
"author": "",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/qelos-io/aidev.git"
|
|
32
|
+
},
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/qelos-io/aidev/issues"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/qelos-io/aidev#readme",
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"chalk": "^4.1.2",
|
|
42
|
+
"commander": "^12.0.0",
|
|
43
|
+
"dotenv": "^16.4.0",
|
|
44
|
+
"jiti": "^2.6.1"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/node": "^22.0.0",
|
|
48
|
+
"tsx": "^4.0.0",
|
|
49
|
+
"typescript": "^5.0.0"
|
|
50
|
+
}
|
|
51
|
+
}
|
package/scripts/run-tests.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { spawnSync } = require('node:child_process');
|
|
4
|
-
const { globSync } = require('node:fs');
|
|
5
|
-
const path = require('node:path');
|
|
6
|
-
|
|
7
|
-
const root = path.join(__dirname, '..');
|
|
8
|
-
const files = globSync('src/__tests__/**/*.test.ts', { cwd: root }).sort();
|
|
9
|
-
if (files.length === 0) {
|
|
10
|
-
console.error('No test files found under src/__tests__');
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
|
13
|
-
const abs = files.map((f) => path.join(root, f));
|
|
14
|
-
const r = spawnSync(process.execPath, ['--require', 'tsx/cjs', '--test', ...abs], {
|
|
15
|
-
cwd: root,
|
|
16
|
-
stdio: 'inherit',
|
|
17
|
-
});
|
|
18
|
-
process.exit(r.status === null ? 1 : r.status);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require('node:child_process');
|
|
4
|
+
const { globSync } = require('node:fs');
|
|
5
|
+
const path = require('node:path');
|
|
6
|
+
|
|
7
|
+
const root = path.join(__dirname, '..');
|
|
8
|
+
const files = globSync('src/__tests__/**/*.test.ts', { cwd: root }).sort();
|
|
9
|
+
if (files.length === 0) {
|
|
10
|
+
console.error('No test files found under src/__tests__');
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
const abs = files.map((f) => path.join(root, f));
|
|
14
|
+
const r = spawnSync(process.execPath, ['--require', 'tsx/cjs', '--test', ...abs], {
|
|
15
|
+
cwd: root,
|
|
16
|
+
stdio: 'inherit',
|
|
17
|
+
});
|
|
18
|
+
process.exit(r.status === null ? 1 : r.status);
|
|
Binary file
|
package/dist/autoCompress.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { AIRunner } from './ai/base';
|
|
2
|
-
import { Comment, Config } from './types';
|
|
3
|
-
/** Matches how AIRunner implementations concatenate prompt and notes. */
|
|
4
|
-
export declare function fullPromptCharCount(prompt: string, notes?: string): number;
|
|
5
|
-
export declare function formatConversationBlock(comments: Comment[]): string;
|
|
6
|
-
/** Ticket conversation block plus optional PR review section (same order as run.ts). */
|
|
7
|
-
export declare function buildTaskContextSuffix(humanComments: Comment[], reviewSection: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Measures total prompt size the same way the runner does: `fullPromptCharCount` of the
|
|
10
|
-
* built prompt for a given task-context suffix (task fields live inside `buildPromptFromSuffix`).
|
|
11
|
-
*/
|
|
12
|
-
export declare function measureImplementStylePrompt(buildPromptFromSuffix: (taskContextSuffix: string) => string, humanComments: Comment[], reviewSection: string, notes?: string): number;
|
|
13
|
-
/** Safe filename segment from a task id (allows only alphanumerics, `.`, `_`, `-`). */
|
|
14
|
-
export declare function sanitizeTaskIdForFile(taskId: string): string;
|
|
15
|
-
export declare function getCompressionSessionPath(taskId: string, cwd?: string): string;
|
|
16
|
-
export declare function getSessionsDir(cwd?: string): string;
|
|
17
|
-
/** Stored under `.aidev/sessions/<sanitizedTaskId>.json`. */
|
|
18
|
-
export interface CompressionSessionRecord {
|
|
19
|
-
taskId: string;
|
|
20
|
-
updatedAt: string;
|
|
21
|
-
/** Human comments that were summarized (all but the last in thread order). */
|
|
22
|
-
earlierCommentIds: string[];
|
|
23
|
-
/** Fingerprint of those comments’ content for idempotent reuse. */
|
|
24
|
-
earlierContentHash: string;
|
|
25
|
-
/** Summary text only (no “latest comment” banner). */
|
|
26
|
-
compressedText: string;
|
|
27
|
-
summaryChars: number;
|
|
28
|
-
}
|
|
29
|
-
export declare function hashEarlierCommentsForCompression(older: Comment[]): string;
|
|
30
|
-
export declare function splitHumanCommentsForCompression(comments: Comment[]): {
|
|
31
|
-
older: Comment[];
|
|
32
|
-
last: Comment;
|
|
33
|
-
} | null;
|
|
34
|
-
export declare function getAutoCompressTripwireLimit(config: Config): number;
|
|
35
|
-
export declare function exceedsAutoCompressBudget(measuredLen: number, config: Config): boolean;
|
|
36
|
-
export declare function readCompressionSession(taskId: string, cwd?: string): CompressionSessionRecord | null;
|
|
37
|
-
export declare function writeCompressionSessionRecord(taskId: string, record: Omit<CompressionSessionRecord, 'taskId'> & {
|
|
38
|
-
taskId?: string;
|
|
39
|
-
}, cwd?: string): string;
|
|
40
|
-
/**
|
|
41
|
-
* Loss-aware extractive compression when AI summarization is unavailable.
|
|
42
|
-
* Preserves lines that look like paths, URLs, errors, or explicit bullets; truncates the rest.
|
|
43
|
-
*/
|
|
44
|
-
export declare function compressEarlierThreadDeterministic(older: Comment[]): string;
|
|
45
|
-
/**
|
|
46
|
-
* When the measured total prompt (see `measureWithComments`) exceeds the configured
|
|
47
|
-
* fraction of AUTO_COMPRESS_MAX_CHARS, replaces all but the last human comment
|
|
48
|
-
* with a single compressed summary comment. The summary is written under
|
|
49
|
-
* `.aidev/sessions/<sanitizedTaskId>.json`.
|
|
50
|
-
*/
|
|
51
|
-
export declare function maybeCompressHumanComments(taskId: string, config: Config, humanComments: Comment[], runners: AIRunner[], measureWithComments: (comments: Comment[]) => number, options?: {
|
|
52
|
-
cwd?: string;
|
|
53
|
-
}): Promise<Comment[]>;
|
|
54
|
-
//# sourceMappingURL=autoCompress.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"autoCompress.d.ts","sourceRoot":"","sources":["../src/autoCompress.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAI1C,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAK1E;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAGnE;AAED,wFAAwF;AACxF,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAE9F;AAED;;;GAGG;AACH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