@sideboard-ai/core 0.1.201 → 0.1.203
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/dist/{abletime-KGPD3UUJ.js → abletime-JFGZBDHH.js} +4 -2
- package/dist/{abletime-345SE3B4.js → abletime-SISJEPJ3.js} +4 -2
- package/dist/abletime-oauth-7TD5Z2QV.js +265 -0
- package/dist/abletime-oauth-OSQYFB3E.js +40 -0
- package/dist/abletime-rest-QPJTDLKX.js +25 -0
- package/dist/abletime-rest-ZJGWYALM.js +24 -0
- package/dist/{agents-KFAGRM46.js → agents-3755WYQM.js} +4 -4
- package/dist/{agents-HB6N3XJL.js → agents-ZMWL43SP.js} +4 -4
- package/dist/{app-settings-V6IHESEQ.js → app-settings-LGHMNHSP.js} +1 -1
- package/dist/{app-settings-AXCURTZJ.js → app-settings-YEPF46IJ.js} +1 -1
- package/dist/{chunk-AHPIU2VP.js → chunk-2DVCCLII.js} +97 -64
- package/dist/chunk-3PYH2RLA.js +388 -0
- package/dist/{chunk-RV3ZKE4Y.js → chunk-5IXJTUST.js} +5 -5
- package/dist/chunk-6VEIKW5C.js +390 -0
- package/dist/chunk-BFEBFGCS.js +250 -0
- package/dist/{chunk-STPZQR5B.js → chunk-CMGRV36E.js} +1 -1
- package/dist/{chunk-PGQGP4FD.js → chunk-FZ6IBUKY.js} +36 -218
- package/dist/{chunk-7AHAABKN.js → chunk-FZYYEMET.js} +36 -228
- package/dist/{chunk-54RSAMBH.js → chunk-LCU6GBZP.js} +2 -2
- package/dist/chunk-MHPINQKY.js +260 -0
- package/dist/chunk-PJHFNFXA.js +243 -0
- package/dist/{chunk-CXFW5LIH.js → chunk-QFBBUFD4.js} +38 -3
- package/dist/{chunk-RPX6VDW7.js → chunk-QSEF2YVQ.js} +1 -1
- package/dist/{chunk-LJHC62LZ.js → chunk-TNDUTGDV.js} +2 -2
- package/dist/{chunk-EXZMNINM.js → chunk-TZNJKZ2A.js} +101 -68
- package/dist/{chunk-3TOGAUQT.js → chunk-X2TFUFIS.js} +5 -5
- package/dist/{chunk-ISV5IFH3.js → chunk-X743YN5Y.js} +38 -3
- package/dist/{coordinator-prompt-TY5FHAXC.js → coordinator-prompt-2B2JA2IE.js} +3 -3
- package/dist/{coordinator-prompt-BH4EHFOO.js → coordinator-prompt-U4PEZDAW.js} +3 -3
- package/dist/{global-workspace-NLLAPQJI.js → global-workspace-JPJ3FKKY.js} +3 -3
- package/dist/{global-workspace-5AZEEQRU.js → global-workspace-PU7ZS3LS.js} +3 -3
- package/dist/index.cjs +932 -145
- package/dist/index.d.cts +61 -9
- package/dist/index.d.ts +61 -9
- package/dist/index.js +63 -18
- package/dist/mcp/run-stdio.cjs +863 -117
- package/dist/mcp/run-stdio.js +22 -20
- package/dist/{orchestrator-SWWQQFFD.js → orchestrator-3A6KUTNI.js} +5 -5
- package/dist/{orchestrator-47JZUHRC.js → orchestrator-Q33M24ZJ.js} +6 -6
- package/dist/{workspaces-RP76JH3J.js → workspaces-IMG7ZRUQ.js} +3 -3
- package/dist/{workspaces-PEWYWVHZ.js → workspaces-U6P6DB44.js} +3 -3
- package/dist/{worktree-ZQEUKSNE.js → worktree-FL3UIUKQ.js} +2 -2
- package/dist/{worktree-72TZWUSH.js → worktree-JSCDJPBU.js} +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_ABLETIME_HOST,
|
|
3
|
+
ableTimeCredentialKind,
|
|
4
|
+
normalizeAbleTimeCredential,
|
|
5
|
+
normalizeAbleTimeHost,
|
|
6
|
+
rewriteAbleTimeError
|
|
7
|
+
} from "./chunk-BFEBFGCS.js";
|
|
8
|
+
import {
|
|
9
|
+
httpFetch
|
|
10
|
+
} from "./chunk-N7WZ6NIN.js";
|
|
11
|
+
import {
|
|
12
|
+
getAbleTimeAccessToken,
|
|
13
|
+
getAbleTimeHost
|
|
14
|
+
} from "./chunk-QFBBUFD4.js";
|
|
15
|
+
|
|
16
|
+
// src/integrations/abletime-rest.ts
|
|
17
|
+
var ABLETIME_REST_PREFIX = "/api/public/v2";
|
|
18
|
+
var ULID_RE = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
|
|
19
|
+
function asRecord(value) {
|
|
20
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
21
|
+
}
|
|
22
|
+
function asString(value) {
|
|
23
|
+
return typeof value === "string" ? value.trim() : "";
|
|
24
|
+
}
|
|
25
|
+
function asList(value) {
|
|
26
|
+
if (Array.isArray(value)) return value;
|
|
27
|
+
const record = asRecord(value);
|
|
28
|
+
if (!record) return [];
|
|
29
|
+
for (const key of ["data", "tasks", "projects", "users", "items", "results"]) {
|
|
30
|
+
if (Array.isArray(record[key])) return record[key];
|
|
31
|
+
}
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
function ableTimeDocFromText(text) {
|
|
35
|
+
const trimmed = text.trim();
|
|
36
|
+
if (!trimmed) return { type: "doc", content: [] };
|
|
37
|
+
return {
|
|
38
|
+
type: "doc",
|
|
39
|
+
content: [{ type: "paragraph", content: [{ type: "text", text: trimmed }] }]
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function textFromAbleTimeDoc(value) {
|
|
43
|
+
if (typeof value === "string") return value.trim();
|
|
44
|
+
const record = asRecord(value);
|
|
45
|
+
if (!record) return "";
|
|
46
|
+
if (typeof record.text === "string" && record.text.trim()) return record.text.trim();
|
|
47
|
+
const chunks = [];
|
|
48
|
+
const walk = (node) => {
|
|
49
|
+
const rec = asRecord(node);
|
|
50
|
+
if (!rec) return;
|
|
51
|
+
if (typeof rec.text === "string" && rec.text) chunks.push(rec.text);
|
|
52
|
+
if (Array.isArray(rec.content)) rec.content.forEach(walk);
|
|
53
|
+
};
|
|
54
|
+
walk(record);
|
|
55
|
+
return chunks.join("").trim();
|
|
56
|
+
}
|
|
57
|
+
function abletimeRestUrl(path, host, query) {
|
|
58
|
+
const base = `${normalizeAbleTimeHost(host)}${ABLETIME_REST_PREFIX}`;
|
|
59
|
+
const suffix = path.startsWith("/") ? path : `/${path}`;
|
|
60
|
+
const url = new URL(`${base}${suffix}`);
|
|
61
|
+
for (const [key, value] of Object.entries(query ?? {})) {
|
|
62
|
+
if (value) url.searchParams.set(key, value);
|
|
63
|
+
}
|
|
64
|
+
return url.href;
|
|
65
|
+
}
|
|
66
|
+
function looksLikeAbleTimeUlid(id) {
|
|
67
|
+
return ULID_RE.test(id.trim());
|
|
68
|
+
}
|
|
69
|
+
async function abletimeRestRequest(path, opts = {}) {
|
|
70
|
+
const raw = opts.token ?? getAbleTimeAccessToken();
|
|
71
|
+
const token = normalizeAbleTimeCredential(raw ?? "");
|
|
72
|
+
if (!token) {
|
|
73
|
+
throw new Error("AbleTime is not connected \u2014 paste an API key or personal access token in Account settings");
|
|
74
|
+
}
|
|
75
|
+
const host = opts.host ?? (opts.token ? DEFAULT_ABLETIME_HOST : getAbleTimeHost());
|
|
76
|
+
const url = abletimeRestUrl(path, host, opts.query);
|
|
77
|
+
const method = (opts.method ?? "GET").toUpperCase();
|
|
78
|
+
const res = await httpFetch(url, {
|
|
79
|
+
method,
|
|
80
|
+
headers: {
|
|
81
|
+
Accept: "application/json",
|
|
82
|
+
Authorization: `Bearer ${token}`,
|
|
83
|
+
...opts.body !== void 0 ? { "Content-Type": "application/json" } : {}
|
|
84
|
+
},
|
|
85
|
+
...opts.body !== void 0 ? { body: JSON.stringify(opts.body) } : {}
|
|
86
|
+
});
|
|
87
|
+
const text = await res.text().catch(() => "");
|
|
88
|
+
if (!res.ok) {
|
|
89
|
+
throw new Error(
|
|
90
|
+
rewriteAbleTimeError(
|
|
91
|
+
`AbleTime API error ${res.status}${text ? `: ${text.slice(0, 240)}` : ""}`
|
|
92
|
+
)
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
if (!text.trim()) return null;
|
|
96
|
+
try {
|
|
97
|
+
return JSON.parse(text);
|
|
98
|
+
} catch {
|
|
99
|
+
throw new Error(`AbleTime API returned a non-JSON response: ${text.slice(0, 200)}`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
async function restPages(path, opts, maxPages = 20) {
|
|
103
|
+
const items = [];
|
|
104
|
+
let cursor;
|
|
105
|
+
for (let i = 0; i < maxPages; i += 1) {
|
|
106
|
+
const raw = await abletimeRestRequest(path, {
|
|
107
|
+
...opts,
|
|
108
|
+
query: { ...opts.query, ...cursor ? { cursor } : {} }
|
|
109
|
+
});
|
|
110
|
+
items.push(...asList(raw));
|
|
111
|
+
const page = asRecord(asRecord(raw)?.page);
|
|
112
|
+
const next = page ? asString(page.nextCursor) : "";
|
|
113
|
+
if (!next) break;
|
|
114
|
+
cursor = next;
|
|
115
|
+
}
|
|
116
|
+
return items;
|
|
117
|
+
}
|
|
118
|
+
function userDisplayName(raw) {
|
|
119
|
+
const rec = asRecord(raw);
|
|
120
|
+
if (!rec) return null;
|
|
121
|
+
const id = asString(rec.userId) || asString(rec.id);
|
|
122
|
+
const name = [asString(rec.firstName), asString(rec.lastName)].filter(Boolean).join(" ") || asString(rec.username) || asString(rec.email) || asString(rec.name);
|
|
123
|
+
if (!name) return null;
|
|
124
|
+
return { id: id || void 0, name };
|
|
125
|
+
}
|
|
126
|
+
function restTaskToRaw(raw, users) {
|
|
127
|
+
const rec = asRecord(raw);
|
|
128
|
+
if (!rec) return null;
|
|
129
|
+
const id = asString(rec.timeflowTaskId) || asString(rec.taskId) || asString(rec.id);
|
|
130
|
+
const identifier = asString(rec.taskRef) || asString(rec.reference) || id;
|
|
131
|
+
const title = asString(rec.title);
|
|
132
|
+
if (!id && !identifier && !title) return null;
|
|
133
|
+
const assigned = asString(rec.assignedUserId);
|
|
134
|
+
const assignee = assigned ? users.get(assigned) : void 0;
|
|
135
|
+
const comments = asList(rec.comments).map((item) => {
|
|
136
|
+
const comment = asRecord(item) ?? {};
|
|
137
|
+
const user = userDisplayName(comment);
|
|
138
|
+
return {
|
|
139
|
+
id: asString(comment.commentId) || asString(comment.id),
|
|
140
|
+
body: textFromAbleTimeDoc(comment.content) || asString(comment.contentSanitized) || asString(comment.body),
|
|
141
|
+
createdAt: asString(comment.createdAt) || asString(comment.lastUpdate),
|
|
142
|
+
user: user?.name || asString(comment.username)
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
id,
|
|
147
|
+
taskId: id,
|
|
148
|
+
timeflowTaskId: id,
|
|
149
|
+
reference: identifier,
|
|
150
|
+
taskRef: identifier,
|
|
151
|
+
title: title || identifier,
|
|
152
|
+
state: asString(rec.taskState) || asString(rec.state),
|
|
153
|
+
description: textFromAbleTimeDoc(rec.description) || asString(rec.descriptionSanitized),
|
|
154
|
+
projectId: asString(rec.projectId),
|
|
155
|
+
categoryId: asString(rec.projectCategoryId) || asString(rec.categoryId),
|
|
156
|
+
tags: rec.tags,
|
|
157
|
+
comments,
|
|
158
|
+
createdAt: asString(rec.dateCreated) || asString(rec.createdAt),
|
|
159
|
+
updatedAt: asString(rec.lastUpdate) || asString(rec.updatedAt),
|
|
160
|
+
...assignee ? { assignee } : {}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function restProjectToRaw(raw) {
|
|
164
|
+
const rec = asRecord(raw);
|
|
165
|
+
if (!rec) return null;
|
|
166
|
+
const id = asString(rec.projectId) || asString(rec.id);
|
|
167
|
+
const name = asString(rec.projectName) || asString(rec.name);
|
|
168
|
+
if (!id && !name) return null;
|
|
169
|
+
const categories = asList(rec.categories).map((item) => {
|
|
170
|
+
const cat = asRecord(item) ?? {};
|
|
171
|
+
return {
|
|
172
|
+
id: asString(cat.projectCategoryId) || asString(cat.categoryId) || asString(cat.id),
|
|
173
|
+
name: asString(cat.categoryName) || asString(cat.name)
|
|
174
|
+
};
|
|
175
|
+
});
|
|
176
|
+
return { id, name, projectId: id, projectName: name, categories };
|
|
177
|
+
}
|
|
178
|
+
async function listUsers(opts) {
|
|
179
|
+
const users = /* @__PURE__ */ new Map();
|
|
180
|
+
for (const item of await restPages("/users", opts).catch(() => [])) {
|
|
181
|
+
const user = userDisplayName(item);
|
|
182
|
+
const rec = asRecord(item);
|
|
183
|
+
const id = user?.id || (rec ? asString(rec.userId) : "");
|
|
184
|
+
if (user && id) users.set(id, user);
|
|
185
|
+
}
|
|
186
|
+
return users;
|
|
187
|
+
}
|
|
188
|
+
async function listProjectsRaw(opts) {
|
|
189
|
+
const items = await restPages("/projects", { ...opts, query: { expand: "categories" } });
|
|
190
|
+
return items.map(restProjectToRaw).filter((item) => Boolean(item));
|
|
191
|
+
}
|
|
192
|
+
async function listTasksRaw(opts) {
|
|
193
|
+
const [users, items] = await Promise.all([
|
|
194
|
+
listUsers(opts),
|
|
195
|
+
restPages("/tasks", {
|
|
196
|
+
...opts,
|
|
197
|
+
query: {
|
|
198
|
+
...opts.projectId ? { projectId: opts.projectId } : {}
|
|
199
|
+
}
|
|
200
|
+
})
|
|
201
|
+
]);
|
|
202
|
+
let tasks = items.map((item) => restTaskToRaw(item, users)).filter((item) => Boolean(item));
|
|
203
|
+
const needle = opts.query?.trim().toLowerCase();
|
|
204
|
+
if (needle) {
|
|
205
|
+
tasks = tasks.filter((task) => {
|
|
206
|
+
const hay = [task.title, task.reference, task.taskRef, task.id].map((value) => String(value ?? "").toLowerCase()).join(" ");
|
|
207
|
+
const tags = Array.isArray(task.tags) ? task.tags.join(" ").toLowerCase() : "";
|
|
208
|
+
return hay.includes(needle) || tags.includes(needle);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
return tasks;
|
|
212
|
+
}
|
|
213
|
+
async function resolveTaskId(id, opts) {
|
|
214
|
+
const wanted = id.trim();
|
|
215
|
+
if (!wanted) throw new Error("AbleTime task id is required");
|
|
216
|
+
if (looksLikeAbleTimeUlid(wanted)) return wanted;
|
|
217
|
+
const tasks = await listTasksRaw(opts);
|
|
218
|
+
const match = tasks.find((task) => {
|
|
219
|
+
const ref = String(task.reference ?? task.taskRef ?? "").toLowerCase();
|
|
220
|
+
const taskId = String(task.id ?? "").toLowerCase();
|
|
221
|
+
return ref === wanted.toLowerCase() || taskId === wanted.toLowerCase();
|
|
222
|
+
});
|
|
223
|
+
if (!match?.id) throw new Error(`AbleTime task not found: ${id}`);
|
|
224
|
+
return String(match.id);
|
|
225
|
+
}
|
|
226
|
+
async function getTaskRaw(id, opts) {
|
|
227
|
+
const taskId = await resolveTaskId(id, opts);
|
|
228
|
+
const [users, raw] = await Promise.all([
|
|
229
|
+
listUsers(opts),
|
|
230
|
+
abletimeRestRequest(`/tasks/${encodeURIComponent(taskId)}`, {
|
|
231
|
+
...opts,
|
|
232
|
+
query: { expand: "comments" }
|
|
233
|
+
})
|
|
234
|
+
]);
|
|
235
|
+
const task = restTaskToRaw(raw, users);
|
|
236
|
+
if (!task) throw new Error(`AbleTime task not found: ${id}`);
|
|
237
|
+
return task;
|
|
238
|
+
}
|
|
239
|
+
function firstStringArg(args, keys) {
|
|
240
|
+
for (const key of keys) {
|
|
241
|
+
const value = asString(args[key]);
|
|
242
|
+
if (value) return value;
|
|
243
|
+
}
|
|
244
|
+
return "";
|
|
245
|
+
}
|
|
246
|
+
async function callAbleTimeRestTool(name, args = {}, opts) {
|
|
247
|
+
const token = normalizeAbleTimeCredential(opts?.token ?? getAbleTimeAccessToken() ?? "");
|
|
248
|
+
if (ableTimeCredentialKind(token) !== "org") {
|
|
249
|
+
throw new Error("AbleTime REST transport is for organization API keys (atk_\u2026)");
|
|
250
|
+
}
|
|
251
|
+
const requestOpts = { ...opts, token };
|
|
252
|
+
switch (name) {
|
|
253
|
+
case "orientation": {
|
|
254
|
+
const [users, projects, tasks] = await Promise.all([
|
|
255
|
+
listUsers(requestOpts),
|
|
256
|
+
listProjectsRaw(requestOpts),
|
|
257
|
+
listTasksRaw(requestOpts)
|
|
258
|
+
]);
|
|
259
|
+
const viewer = [...users.values()].find((user) => user.name) ?? [...users.values()][0] ?? { name: "AbleTime" };
|
|
260
|
+
return { viewer, projects, tasks };
|
|
261
|
+
}
|
|
262
|
+
case "list_projects":
|
|
263
|
+
return { data: await listProjectsRaw(requestOpts) };
|
|
264
|
+
case "list_users":
|
|
265
|
+
return { data: [...(await listUsers(requestOpts)).values()] };
|
|
266
|
+
case "list_tasks":
|
|
267
|
+
return {
|
|
268
|
+
data: await listTasksRaw({
|
|
269
|
+
...requestOpts,
|
|
270
|
+
projectId: firstStringArg(args, ["project_id", "projectId", "project"])
|
|
271
|
+
})
|
|
272
|
+
};
|
|
273
|
+
case "search_tasks":
|
|
274
|
+
return {
|
|
275
|
+
data: await listTasksRaw({
|
|
276
|
+
...requestOpts,
|
|
277
|
+
query: firstStringArg(args, ["query", "q"])
|
|
278
|
+
})
|
|
279
|
+
};
|
|
280
|
+
case "get_task":
|
|
281
|
+
return await getTaskRaw(firstStringArg(args, ["id", "task_id", "task"]), requestOpts);
|
|
282
|
+
case "create_task": {
|
|
283
|
+
const title = firstStringArg(args, ["title"]);
|
|
284
|
+
if (!title) throw new Error("AbleTime task title is required");
|
|
285
|
+
const projectId = firstStringArg(args, ["project_id", "projectId", "project"]);
|
|
286
|
+
if (!projectId) throw new Error("AbleTime project is required");
|
|
287
|
+
const projects = await listProjectsRaw(requestOpts);
|
|
288
|
+
const project = projects.find(
|
|
289
|
+
(item) => String(item.id).toLowerCase() === projectId.toLowerCase() || String(item.name).toLowerCase() === projectId.toLowerCase()
|
|
290
|
+
) ?? projects[0];
|
|
291
|
+
if (!project) throw new Error("AbleTime has no projects to create a task in");
|
|
292
|
+
const categories = asList(project.categories);
|
|
293
|
+
const wantedCategory = firstStringArg(args, ["category_id", "categoryId", "category"]);
|
|
294
|
+
const category = categories.map((item) => asRecord(item)).find((item) => {
|
|
295
|
+
if (!item || !wantedCategory) return false;
|
|
296
|
+
return asString(item.id).toLowerCase() === wantedCategory.toLowerCase() || asString(item.name).toLowerCase() === wantedCategory.toLowerCase();
|
|
297
|
+
}) ?? asRecord(categories[0]);
|
|
298
|
+
const created = await abletimeRestRequest("/tasks", {
|
|
299
|
+
...requestOpts,
|
|
300
|
+
method: "POST",
|
|
301
|
+
body: {
|
|
302
|
+
projectId: project.id,
|
|
303
|
+
projectCategoryId: category ? asString(category.id) : void 0,
|
|
304
|
+
title
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
const state = firstStringArg(args, ["state"]);
|
|
308
|
+
const createdId = asString(asRecord(created)?.timeflowTaskId);
|
|
309
|
+
const description = asString(args.description);
|
|
310
|
+
if (createdId && description) {
|
|
311
|
+
await abletimeRestRequest(`/tasks/${encodeURIComponent(createdId)}`, {
|
|
312
|
+
...requestOpts,
|
|
313
|
+
method: "PATCH",
|
|
314
|
+
body: { description: ableTimeDocFromText(description) }
|
|
315
|
+
}).catch(() => void 0);
|
|
316
|
+
}
|
|
317
|
+
if (createdId && state && state !== "todo") {
|
|
318
|
+
await abletimeRestRequest(`/tasks/${encodeURIComponent(createdId)}/state`, {
|
|
319
|
+
...requestOpts,
|
|
320
|
+
method: "POST",
|
|
321
|
+
body: { taskState: state }
|
|
322
|
+
}).catch(() => void 0);
|
|
323
|
+
}
|
|
324
|
+
return createdId ? await getTaskRaw(createdId, requestOpts) : restTaskToRaw(created, await listUsers(requestOpts));
|
|
325
|
+
}
|
|
326
|
+
case "update_task": {
|
|
327
|
+
const id = await resolveTaskId(firstStringArg(args, ["id", "task_id", "task"]), requestOpts);
|
|
328
|
+
const patch = {};
|
|
329
|
+
const title = firstStringArg(args, ["title"]);
|
|
330
|
+
if (title) patch.title = title;
|
|
331
|
+
if (args.description !== void 0) {
|
|
332
|
+
patch.description = args.description == null || args.description === "" ? null : ableTimeDocFromText(String(args.description));
|
|
333
|
+
}
|
|
334
|
+
if (args.tags !== void 0 || args.labels !== void 0) {
|
|
335
|
+
patch.tags = args.tags ?? args.labels ?? args.tag_names;
|
|
336
|
+
}
|
|
337
|
+
if (Object.keys(patch).length > 0) {
|
|
338
|
+
await abletimeRestRequest(`/tasks/${encodeURIComponent(id)}`, {
|
|
339
|
+
...requestOpts,
|
|
340
|
+
method: "PATCH",
|
|
341
|
+
body: patch
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
return await getTaskRaw(id, requestOpts);
|
|
345
|
+
}
|
|
346
|
+
case "set_task_state": {
|
|
347
|
+
const id = await resolveTaskId(firstStringArg(args, ["id", "task_id", "task"]), requestOpts);
|
|
348
|
+
const state = firstStringArg(args, ["state", "taskState"]);
|
|
349
|
+
if (!state) throw new Error("AbleTime task state is required");
|
|
350
|
+
await abletimeRestRequest(`/tasks/${encodeURIComponent(id)}/state`, {
|
|
351
|
+
...requestOpts,
|
|
352
|
+
method: "POST",
|
|
353
|
+
body: { taskState: state }
|
|
354
|
+
});
|
|
355
|
+
return await getTaskRaw(id, requestOpts);
|
|
356
|
+
}
|
|
357
|
+
case "create_comment": {
|
|
358
|
+
const id = await resolveTaskId(firstStringArg(args, ["id", "task_id", "task"]), requestOpts);
|
|
359
|
+
const body = firstStringArg(args, ["body", "comment", "text"]);
|
|
360
|
+
if (!body) throw new Error("AbleTime comment body is required");
|
|
361
|
+
const created = await abletimeRestRequest(`/tasks/${encodeURIComponent(id)}/comments`, {
|
|
362
|
+
...requestOpts,
|
|
363
|
+
method: "POST",
|
|
364
|
+
body: { content: ableTimeDocFromText(body) }
|
|
365
|
+
});
|
|
366
|
+
const rec = asRecord(created) ?? {};
|
|
367
|
+
return {
|
|
368
|
+
id: asString(rec.commentId) || void 0,
|
|
369
|
+
body: textFromAbleTimeDoc(rec.content) || body
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
case "set_task_dependency":
|
|
373
|
+
throw new Error(
|
|
374
|
+
"AbleTime organization API keys cannot set task dependencies on REST yet \u2014 use a personal access token (apt_\u2026) for MCP project-management tools."
|
|
375
|
+
);
|
|
376
|
+
default:
|
|
377
|
+
throw new Error(`AbleTime organization API keys do not support ${name} on REST`);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export {
|
|
382
|
+
ABLETIME_REST_PREFIX,
|
|
383
|
+
ableTimeDocFromText,
|
|
384
|
+
textFromAbleTimeDoc,
|
|
385
|
+
abletimeRestUrl,
|
|
386
|
+
looksLikeAbleTimeUlid,
|
|
387
|
+
callAbleTimeRestTool
|
|
388
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isOrchestratorThread
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TNDUTGDV.js";
|
|
4
4
|
import {
|
|
5
5
|
codexUnattendedGitConfigArgs,
|
|
6
6
|
mergeAgentGitAuthEnv,
|
|
7
7
|
resolveAgentGitAuthEnv,
|
|
8
8
|
resolveCodexGitWritableRoots
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CMGRV36E.js";
|
|
10
10
|
import {
|
|
11
11
|
applyConnectedTeamToCli,
|
|
12
12
|
brightsyMcpServerName,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
loadAppSettings,
|
|
42
42
|
resolveAgentExecutable,
|
|
43
43
|
resolveClaudeExecutable
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-QFBBUFD4.js";
|
|
45
45
|
import {
|
|
46
46
|
isElectronLikeCommand,
|
|
47
47
|
unwrapStrippedElectronLaunch
|
|
@@ -1036,7 +1036,7 @@ function applyAgentEvent(parts, event) {
|
|
|
1036
1036
|
next.push(
|
|
1037
1037
|
withPartTimes({
|
|
1038
1038
|
type: "thinking",
|
|
1039
|
-
text: data,
|
|
1039
|
+
text: clipThinkingForStore(data),
|
|
1040
1040
|
...event.parentId ? { parentId: event.parentId } : {}
|
|
1041
1041
|
})
|
|
1042
1042
|
);
|
|
@@ -1937,7 +1937,7 @@ var claudeAdapter = {
|
|
|
1937
1937
|
);
|
|
1938
1938
|
}
|
|
1939
1939
|
const mode = permissionMode(thread);
|
|
1940
|
-
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-
|
|
1940
|
+
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-PU7ZS3LS.js");
|
|
1941
1941
|
const isOrchestrator = isOrchestratorThread2(thread);
|
|
1942
1942
|
const injectedServers = await buildInjectedMcpServers({
|
|
1943
1943
|
includeSideboard: true,
|