@sideboard-ai/core 0.1.280 → 0.1.282
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-VCVPSLSU.js → abletime-WLDBJJUI.js} +3 -3
- package/dist/{abletime-VRATUMDO.js → abletime-X64E3GUJ.js} +3 -3
- package/dist/{abletime-oauth-4K7MICAD.js → abletime-oauth-AXR676W5.js} +2 -2
- package/dist/{abletime-oauth-4C4G2J3R.js → abletime-oauth-UWOCEICP.js} +2 -2
- package/dist/{abletime-rest-PIBCNHF3.js → abletime-rest-LPUDJUEP.js} +2 -2
- package/dist/{abletime-rest-6N63ZVQ3.js → abletime-rest-S4XWEXV2.js} +2 -2
- package/dist/{agents-DYCFLDNL.js → agents-2IE4HKHA.js} +5 -5
- package/dist/{agents-RXP5NZBC.js → agents-XA2E64AW.js} +5 -5
- package/dist/{chunk-DK4DKQ2H.js → chunk-2KNO2GJQ.js} +722 -139
- package/dist/{chunk-TZ5JHIYK.js → chunk-2SJXQ4UX.js} +68 -21
- package/dist/{chunk-K7MWJLR7.js → chunk-5MGLNVNK.js} +6 -906
- package/dist/{chunk-RK5PIWCW.js → chunk-ADXVTKLC.js} +12 -4
- package/dist/{chunk-Y7JPL4WA.js → chunk-BDAUPNHL.js} +3 -4
- package/dist/{chunk-R7HLXD4I.js → chunk-BS3QLVPL.js} +93 -57
- package/dist/{chunk-2P75E243.js → chunk-BYZ7F2BQ.js} +707 -128
- package/dist/{chunk-2J34G3WJ.js → chunk-DGPROCE5.js} +93 -57
- package/dist/{chunk-HQXBBUQX.js → chunk-DQZPF6WL.js} +12 -11
- package/dist/{chunk-YDXNCBA2.js → chunk-EIEAR62M.js} +12 -11
- package/dist/{chunk-XKZAVGTT.js → chunk-I6HSGKMZ.js} +1 -1
- package/dist/chunk-JPH7PYSK.js +1241 -0
- package/dist/{chunk-IPPY3FG5.js → chunk-K5XSTHHP.js} +6 -906
- package/dist/chunk-N5UGX3JL.js +1239 -0
- package/dist/{chunk-HNNS25SG.js → chunk-OCUIZD4Y.js} +14 -4
- package/dist/{chunk-IJDQKC5A.js → chunk-PY4UCMRI.js} +4 -4
- package/dist/{chunk-NQ7JMVSU.js → chunk-U7HAVAGJ.js} +1 -1
- package/dist/{chunk-PZURG3XN.js → chunk-VA55JG2I.js} +4 -4
- package/dist/{chunk-CPA43FBK.js → chunk-W7HIK2A6.js} +3 -4
- package/dist/{chunk-SKSOCIJT.js → chunk-WY2IAB7J.js} +68 -21
- package/dist/{chunk-QINJKNLR.js → chunk-XTPQEZZA.js} +2 -2
- package/dist/{conductor-J6WDOXWM.js → conductor-CNSCOC54.js} +5 -5
- package/dist/{conductor-OW6NAK3N.js → conductor-U776JSXQ.js} +5 -5
- package/dist/{coordinator-prompt-Z2D32HWK.js → coordinator-prompt-4DJIHSE6.js} +3 -3
- package/dist/{coordinator-prompt-ERTHREGJ.js → coordinator-prompt-SVVGU6AZ.js} +3 -3
- package/dist/{global-workspace-5PJXO45Z.js → global-workspace-UPUDWIS6.js} +3 -3
- package/dist/{global-workspace-AK5PSPQ2.js → global-workspace-XON4YZXE.js} +3 -3
- package/dist/index.cjs +3690 -2912
- package/dist/index.d.cts +101 -28
- package/dist/index.d.ts +101 -28
- package/dist/index.js +1013 -1001
- package/dist/mcp/run-stdio.cjs +1975 -1259
- package/dist/mcp/run-stdio.js +743 -785
- package/dist/{orchestrator-XEKODYDQ.js → orchestrator-FPGVKEID.js} +7 -7
- package/dist/{orchestrator-K66OMTQO.js → orchestrator-HWJHK5NL.js} +7 -7
- package/dist/{thread-store-B3ZM4QEZ.js → thread-store-7XBOUQ5K.js} +1 -1
- package/dist/{thread-store-SHCUBWB3.js → thread-store-ZQZDREVH.js} +1 -1
- package/dist/{workspaces-UP6DQ3WL.js → workspaces-7AJ5RZ3P.js} +7 -3
- package/dist/{workspaces-WU2RNLDV.js → workspaces-F76BWCSI.js} +7 -3
- package/dist/{worktree-L57T3KH7.js → worktree-NKLNVNXX.js} +20 -15
- package/dist/{worktree-Q6UJHG25.js → worktree-YTZC3UQN.js} +14 -9
- package/package.json +1 -1
- package/dist/chunk-FWNL62VA.js +0 -308
- package/dist/chunk-JANCPF7Z.js +0 -310
|
@@ -21,16 +21,16 @@ import {
|
|
|
21
21
|
looksLikeSkillBody,
|
|
22
22
|
skillCommandFromBody,
|
|
23
23
|
withEventParentId
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-W7HIK2A6.js";
|
|
25
25
|
import {
|
|
26
26
|
isOrchestratorThread
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-2SJXQ4UX.js";
|
|
28
28
|
import {
|
|
29
29
|
codexUnattendedGitConfigArgs,
|
|
30
30
|
mergeAgentGitAuthEnv,
|
|
31
31
|
resolveAgentGitAuthEnv,
|
|
32
32
|
resolveCodexGitWritableRoots
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-5MGLNVNK.js";
|
|
34
34
|
import {
|
|
35
35
|
enrichPathWithNpmGlobalBin,
|
|
36
36
|
isConductorBundledCli,
|
|
@@ -559,8 +559,12 @@ var WORKTREE_MCP_TOOLS = [
|
|
|
559
559
|
"stop_dev_script",
|
|
560
560
|
"get_run_log",
|
|
561
561
|
"notify_orchestrator",
|
|
562
|
+
"set_workspace_tags",
|
|
562
563
|
"get_viewer_context",
|
|
563
564
|
"update_viewer_context",
|
|
565
|
+
"list_env",
|
|
566
|
+
"set_env",
|
|
567
|
+
"delete_env",
|
|
564
568
|
"list_schedules",
|
|
565
569
|
"create_schedule",
|
|
566
570
|
"update_schedule",
|
|
@@ -959,8 +963,12 @@ var SIDEBOARD_ARTIFACT_MCP_ALLOWED_TOOLS = [
|
|
|
959
963
|
"mcp__sideboard__stop_dev_script",
|
|
960
964
|
"mcp__sideboard__get_run_log",
|
|
961
965
|
"mcp__sideboard__notify_orchestrator",
|
|
966
|
+
"mcp__sideboard__set_workspace_tags",
|
|
962
967
|
"mcp__sideboard__get_viewer_context",
|
|
963
968
|
"mcp__sideboard__update_viewer_context",
|
|
969
|
+
"mcp__sideboard__list_env",
|
|
970
|
+
"mcp__sideboard__set_env",
|
|
971
|
+
"mcp__sideboard__delete_env",
|
|
964
972
|
"mcp__sideboard__list_schedules",
|
|
965
973
|
"mcp__sideboard__create_schedule",
|
|
966
974
|
"mcp__sideboard__update_schedule",
|
|
@@ -2010,7 +2018,7 @@ var claudeAdapter = {
|
|
|
2010
2018
|
);
|
|
2011
2019
|
}
|
|
2012
2020
|
const mode = permissionMode(thread);
|
|
2013
|
-
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-
|
|
2021
|
+
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-UPUDWIS6.js");
|
|
2014
2022
|
const isOrchestrator = isOrchestratorThread2(thread);
|
|
2015
2023
|
const rpc = worktreeAgentRpc(isOrchestrator);
|
|
2016
2024
|
const injectedServers = await buildInjectedMcpServers({
|
|
@@ -210,6 +210,8 @@ function toolDescription(name, input) {
|
|
|
210
210
|
return str(input?.name) ? `Read ${str(input?.name)} log` : "Read Dev log";
|
|
211
211
|
}
|
|
212
212
|
if (/notify_orchestrator$/i.test(name)) return "Notify orchestrator";
|
|
213
|
+
else if (/set_workspace_tags$/i.test(name)) return "Set workspace tags";
|
|
214
|
+
if (/(?:list|set|delete)_env$/i.test(name)) return /list_env$/i.test(name) ? "List env vars" : /set_env$/i.test(name) ? "Set env var" : "Delete env var";
|
|
213
215
|
if (/list_schedules$/i.test(name)) return "List schedules";
|
|
214
216
|
if (/create_schedule$/i.test(name)) {
|
|
215
217
|
return str(input?.name) ? `Schedule ${str(input?.name)}` : "Create schedule";
|
|
@@ -223,10 +225,7 @@ function toolDescription(name, input) {
|
|
|
223
225
|
}
|
|
224
226
|
if (isCompactToolName(name)) {
|
|
225
227
|
const trigger = str(input?.trigger);
|
|
226
|
-
|
|
227
|
-
return `Summarized conversation (${trigger})`;
|
|
228
|
-
}
|
|
229
|
-
return "Summarized conversation";
|
|
228
|
+
return trigger && !/^auto$/i.test(trigger) && trigger !== "injected" ? `Summarized conversation (${trigger})` : "Summarized conversation";
|
|
230
229
|
}
|
|
231
230
|
if (isSubagentToolName(name)) {
|
|
232
231
|
const desc = str(input?.description);
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import {
|
|
4
4
|
abletimeRestUrl,
|
|
5
5
|
textFromAbleTimeDoc
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-I6HSGKMZ.js";
|
|
7
7
|
import {
|
|
8
8
|
assertAbleTimeCredential,
|
|
9
9
|
callAbleTimeTool,
|
|
10
10
|
normalizeAbleTimeHost,
|
|
11
11
|
rewriteAbleTimeError
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PY4UCMRI.js";
|
|
13
13
|
import {
|
|
14
14
|
httpFetch
|
|
15
15
|
} from "./chunk-VKQGAWHY.js";
|
|
@@ -362,15 +362,66 @@ async function downloadAbleTimeAttachment(input, opts) {
|
|
|
362
362
|
});
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
+
// src/integrations/abletime-projects.ts
|
|
366
|
+
function asRecord2(value) {
|
|
367
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
368
|
+
}
|
|
369
|
+
function firstString2(record, keys) {
|
|
370
|
+
if (!record) return "";
|
|
371
|
+
for (const key of keys) {
|
|
372
|
+
const value = record[key];
|
|
373
|
+
if (typeof value === "string" && value.trim()) return value.trim();
|
|
374
|
+
}
|
|
375
|
+
return "";
|
|
376
|
+
}
|
|
377
|
+
function asList2(value) {
|
|
378
|
+
if (Array.isArray(value)) return value;
|
|
379
|
+
const record = asRecord2(value);
|
|
380
|
+
if (!record) return [];
|
|
381
|
+
for (const key of ["data", "tasks", "projects", "items", "results", "nodes"]) {
|
|
382
|
+
if (Array.isArray(record[key])) return record[key];
|
|
383
|
+
}
|
|
384
|
+
return [];
|
|
385
|
+
}
|
|
386
|
+
function ableTimeProjectFields(nested) {
|
|
387
|
+
const projectRecord = asRecord2(nested.project);
|
|
388
|
+
const projectId = firstString2(nested, ["project_id", "projectId"]) || firstString2(projectRecord, ["id"]) || void 0;
|
|
389
|
+
const projectName = firstString2(nested, ["project_name", "projectName"]) || firstString2(projectRecord, ["name", "title"]) || void 0;
|
|
390
|
+
if (!projectId && !projectName) return {};
|
|
391
|
+
return {
|
|
392
|
+
...projectId ? { projectId } : {},
|
|
393
|
+
project: {
|
|
394
|
+
...projectId ? { id: projectId } : {},
|
|
395
|
+
...projectName ? { name: projectName } : {}
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
function mapAbleTimeProject(raw) {
|
|
400
|
+
const record = asRecord2(raw);
|
|
401
|
+
if (!record) return null;
|
|
402
|
+
const id = firstString2(record, ["id", "project_id", "projectId"]);
|
|
403
|
+
const name = firstString2(record, ["name", "title", "projectName"]);
|
|
404
|
+
if (!id && !name) return null;
|
|
405
|
+
const categories = asList2(record.categories ?? record.category).map((item) => {
|
|
406
|
+
const rec = asRecord2(item);
|
|
407
|
+
if (!rec) return null;
|
|
408
|
+
const categoryId = firstString2(rec, ["id", "category_id", "projectCategoryId", "categoryId"]);
|
|
409
|
+
const categoryName = firstString2(rec, ["name", "title", "categoryName"]);
|
|
410
|
+
if (!categoryId && !categoryName) return null;
|
|
411
|
+
return { id: categoryId || categoryName, name: categoryName || categoryId };
|
|
412
|
+
}).filter((item) => Boolean(item));
|
|
413
|
+
return { id: id || name, name: name || id, categories };
|
|
414
|
+
}
|
|
415
|
+
|
|
365
416
|
// src/integrations/abletime.ts
|
|
366
417
|
var CLOSED_STATES = /* @__PURE__ */ new Set(["done", "completed", "canceled", "cancelled", "archived", "closed"]);
|
|
367
|
-
function
|
|
418
|
+
function asRecord3(value) {
|
|
368
419
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
369
420
|
}
|
|
370
421
|
function asString2(value) {
|
|
371
422
|
return typeof value === "string" ? value.trim() : "";
|
|
372
423
|
}
|
|
373
|
-
function
|
|
424
|
+
function firstString3(record, keys) {
|
|
374
425
|
if (!record) return "";
|
|
375
426
|
for (const key of keys) {
|
|
376
427
|
const value = asString2(record[key]);
|
|
@@ -381,14 +432,14 @@ function firstString2(record, keys) {
|
|
|
381
432
|
function firstRecord(record, keys) {
|
|
382
433
|
if (!record) return null;
|
|
383
434
|
for (const key of keys) {
|
|
384
|
-
const value =
|
|
435
|
+
const value = asRecord3(record[key]);
|
|
385
436
|
if (value) return value;
|
|
386
437
|
}
|
|
387
438
|
return null;
|
|
388
439
|
}
|
|
389
|
-
function
|
|
440
|
+
function asList3(value) {
|
|
390
441
|
if (Array.isArray(value)) return value;
|
|
391
|
-
const record =
|
|
442
|
+
const record = asRecord3(value);
|
|
392
443
|
if (!record) return [];
|
|
393
444
|
for (const key of ["data", "tasks", "projects", "items", "results", "nodes"]) {
|
|
394
445
|
if (Array.isArray(record[key])) return record[key];
|
|
@@ -400,21 +451,21 @@ function labelsOf(record) {
|
|
|
400
451
|
if (!Array.isArray(raw)) return [];
|
|
401
452
|
return raw.map((item) => {
|
|
402
453
|
if (typeof item === "string") return item.trim();
|
|
403
|
-
const rec =
|
|
404
|
-
return rec ?
|
|
454
|
+
const rec = asRecord3(item);
|
|
455
|
+
return rec ? firstString3(rec, ["name", "title", "label"]) : "";
|
|
405
456
|
}).filter(Boolean);
|
|
406
457
|
}
|
|
407
458
|
function commentsOf(record) {
|
|
408
459
|
const out = [];
|
|
409
|
-
for (const item of
|
|
410
|
-
const rec =
|
|
460
|
+
for (const item of asList3(record.comments ?? record.notes ?? record.discussion)) {
|
|
461
|
+
const rec = asRecord3(item);
|
|
411
462
|
if (!rec) continue;
|
|
412
|
-
const body =
|
|
463
|
+
const body = firstString3(rec, ["body", "text", "comment", "message", "contentSanitized"]) || textFromAbleTimeDoc(rec.content);
|
|
413
464
|
if (!body) continue;
|
|
414
|
-
const user =
|
|
415
|
-
const id =
|
|
416
|
-
const url =
|
|
417
|
-
const createdAt =
|
|
465
|
+
const user = firstString3(asRecord3(rec.user) ?? asRecord3(rec.author), ["name", "display_name", "username"]) || firstString3(rec, ["user_name", "author", "username"]);
|
|
466
|
+
const id = firstString3(rec, ["id", "comment_id", "commentId"]);
|
|
467
|
+
const url = firstString3(rec, ["url", "permalink"]);
|
|
468
|
+
const createdAt = firstString3(rec, ["created_at", "createdAt", "created"]);
|
|
418
469
|
out.push({
|
|
419
470
|
body,
|
|
420
471
|
...id ? { id } : {},
|
|
@@ -427,9 +478,9 @@ function commentsOf(record) {
|
|
|
427
478
|
}
|
|
428
479
|
function assigneeOf(record) {
|
|
429
480
|
const nested = firstRecord(record, ["assignee", "assigned_to", "user", "owner"]);
|
|
430
|
-
const name =
|
|
481
|
+
const name = firstString3(nested, ["name", "display_name", "full_name", "email"]) || firstString3(record, ["assignee_name", "assigneeName"]);
|
|
431
482
|
if (!name) return void 0;
|
|
432
|
-
const id =
|
|
483
|
+
const id = firstString3(nested, ["id", "user_id"]);
|
|
433
484
|
return { id: id || void 0, name };
|
|
434
485
|
}
|
|
435
486
|
function taskUrl(task, host) {
|
|
@@ -438,31 +489,31 @@ function taskUrl(task, host) {
|
|
|
438
489
|
return `${base}/tasks/${slug}`;
|
|
439
490
|
}
|
|
440
491
|
function mapAbleTimeTask(raw, host) {
|
|
441
|
-
const record =
|
|
492
|
+
const record = asRecord3(raw);
|
|
442
493
|
if (!record) return null;
|
|
443
494
|
const nested = firstRecord(record, ["task", "data"]) ?? record;
|
|
444
|
-
const id =
|
|
445
|
-
const identifier =
|
|
446
|
-
const title =
|
|
495
|
+
const id = firstString3(nested, ["id", "task_id", "taskId", "timeflowTaskId"]);
|
|
496
|
+
const identifier = firstString3(nested, ["reference", "ref", "identifier", "key", "code", "number", "taskRef"]) || id;
|
|
497
|
+
const title = firstString3(nested, ["title", "name"]);
|
|
447
498
|
if (!id && !identifier && !title) return null;
|
|
448
499
|
const resolvedId = id || identifier;
|
|
449
500
|
const resolvedIdentifier = identifier || id;
|
|
450
|
-
const url =
|
|
501
|
+
const url = firstString3(nested, ["url", "permalink", "html_url"]) || taskUrl({ id: resolvedId, identifier: resolvedIdentifier }, host);
|
|
451
502
|
return {
|
|
452
503
|
id: resolvedId,
|
|
453
504
|
identifier: resolvedIdentifier,
|
|
454
505
|
title: title || resolvedIdentifier,
|
|
455
506
|
url,
|
|
456
|
-
description:
|
|
457
|
-
state:
|
|
458
|
-
|
|
459
|
-
categoryId:
|
|
507
|
+
description: firstString3(nested, ["description", "body", "details", "descriptionSanitized"]) || textFromAbleTimeDoc(nested.description) || void 0,
|
|
508
|
+
state: firstString3(nested, ["state", "board_state", "boardState", "status", "taskState"]) || void 0,
|
|
509
|
+
...ableTimeProjectFields(nested),
|
|
510
|
+
categoryId: firstString3(nested, ["category_id", "categoryId", "projectCategoryId"]) || firstString3(asRecord3(nested.category), ["id"]) || void 0,
|
|
460
511
|
assignee: assigneeOf(nested),
|
|
461
512
|
labels: labelsOf(nested),
|
|
462
513
|
comments: commentsOf(nested),
|
|
463
514
|
attachments: mapAbleTimeAttachments(nested),
|
|
464
|
-
createdAt:
|
|
465
|
-
updatedAt:
|
|
515
|
+
createdAt: firstString3(nested, ["created_at", "createdAt", "created", "dateCreated"]) || void 0,
|
|
516
|
+
updatedAt: firstString3(nested, [
|
|
466
517
|
"updated_at",
|
|
467
518
|
"updatedAt",
|
|
468
519
|
"modified_at",
|
|
@@ -483,6 +534,7 @@ function toAbleTimeIssueInfo(task) {
|
|
|
483
534
|
provider: "abletime",
|
|
484
535
|
assignee: task.assignee?.name,
|
|
485
536
|
assignees: task.assignee?.name ? [task.assignee.name] : void 0,
|
|
537
|
+
...task.project || task.projectId ? { projects: [task.project ?? { id: task.projectId }] } : {},
|
|
486
538
|
...task.createdAt ? { createdAt: task.createdAt } : {},
|
|
487
539
|
...task.updatedAt ? { updatedAt: task.updatedAt } : {}
|
|
488
540
|
};
|
|
@@ -499,43 +551,27 @@ function issueAttachmentForAbleTimeTask(task) {
|
|
|
499
551
|
].filter(Boolean).join("\n")
|
|
500
552
|
};
|
|
501
553
|
}
|
|
502
|
-
function mapProject(raw) {
|
|
503
|
-
const record = asRecord2(raw);
|
|
504
|
-
if (!record) return null;
|
|
505
|
-
const id = firstString2(record, ["id", "project_id", "projectId"]);
|
|
506
|
-
const name = firstString2(record, ["name", "title", "projectName"]);
|
|
507
|
-
if (!id && !name) return null;
|
|
508
|
-
const categories = asList2(record.categories ?? record.category).map((item) => {
|
|
509
|
-
const rec = asRecord2(item);
|
|
510
|
-
if (!rec) return null;
|
|
511
|
-
const categoryId = firstString2(rec, ["id", "category_id", "projectCategoryId", "categoryId"]);
|
|
512
|
-
const categoryName = firstString2(rec, ["name", "title", "categoryName"]);
|
|
513
|
-
if (!categoryId && !categoryName) return null;
|
|
514
|
-
return { id: categoryId || categoryName, name: categoryName || categoryId };
|
|
515
|
-
}).filter((item) => Boolean(item));
|
|
516
|
-
return { id: id || name, name: name || id, categories };
|
|
517
|
-
}
|
|
518
554
|
function isOpenTask(task) {
|
|
519
555
|
const state = (task.state ?? "").toLowerCase();
|
|
520
556
|
return !state || !CLOSED_STATES.has(state);
|
|
521
557
|
}
|
|
522
558
|
async function getAbleTimeOrientation(opts) {
|
|
523
559
|
const raw = await callAbleTimeTool("orientation", {}, opts);
|
|
524
|
-
const record =
|
|
560
|
+
const record = asRecord3(raw);
|
|
525
561
|
const viewerRec = firstRecord(record, ["viewer", "principal", "user", "actor", "me", "person"]) ?? record;
|
|
526
562
|
const viewer = {
|
|
527
|
-
id:
|
|
528
|
-
name:
|
|
563
|
+
id: firstString3(viewerRec, ["id", "user_id"]) || void 0,
|
|
564
|
+
name: firstString3(viewerRec, ["name", "display_name", "full_name"]) || firstString3(record, ["name"]) || void 0
|
|
529
565
|
};
|
|
530
|
-
const projects =
|
|
566
|
+
const projects = asList3(
|
|
531
567
|
record?.projects ?? record?.current_projects ?? record?.currentProjects
|
|
532
|
-
).map(
|
|
533
|
-
const tasks =
|
|
568
|
+
).map(mapAbleTimeProject).filter((item) => Boolean(item));
|
|
569
|
+
const tasks = asList3(record?.tasks ?? record?.active_tasks ?? record?.activeTasks).map((item) => mapAbleTimeTask(item, opts?.host)).filter((item) => Boolean(item));
|
|
534
570
|
return { viewer, projects, tasks, raw };
|
|
535
571
|
}
|
|
536
572
|
async function listAbleTimeProjects(opts) {
|
|
537
573
|
const raw = await callAbleTimeTool("list_projects", { include_categories: true }, opts);
|
|
538
|
-
return
|
|
574
|
+
return asList3(raw).map(mapAbleTimeProject).filter((item) => Boolean(item));
|
|
539
575
|
}
|
|
540
576
|
async function listAbleTimeTasks(opts) {
|
|
541
577
|
const args = {};
|
|
@@ -545,14 +581,14 @@ async function listAbleTimeTasks(opts) {
|
|
|
545
581
|
}
|
|
546
582
|
if (opts?.query) args.query = opts.query;
|
|
547
583
|
const raw = await callAbleTimeTool("list_tasks", args, opts);
|
|
548
|
-
const tasks =
|
|
584
|
+
const tasks = asList3(raw).map((item) => mapAbleTimeTask(item, opts?.host)).filter((item) => Boolean(item));
|
|
549
585
|
return opts?.includeClosed ? tasks : tasks.filter(isOpenTask);
|
|
550
586
|
}
|
|
551
587
|
async function searchAbleTimeTasks(query, opts) {
|
|
552
588
|
const q = query.trim();
|
|
553
589
|
if (!q) return [];
|
|
554
590
|
const raw = await callAbleTimeTool("search_tasks", { query: q, q }, opts);
|
|
555
|
-
return
|
|
591
|
+
return asList3(raw).map((item) => mapAbleTimeTask(item, opts?.host)).filter((item) => Boolean(item)).filter(isOpenTask);
|
|
556
592
|
}
|
|
557
593
|
async function getAbleTimeTask(id, opts) {
|
|
558
594
|
const raw = await callAbleTimeTool("get_task", { id, task_id: id }, opts);
|
|
@@ -600,10 +636,10 @@ async function commentAbleTimeTask(input, opts) {
|
|
|
600
636
|
{ id, task_id: id, task: id, body, comment: body, text: body },
|
|
601
637
|
opts
|
|
602
638
|
);
|
|
603
|
-
const rec =
|
|
639
|
+
const rec = asRecord3(raw);
|
|
604
640
|
return {
|
|
605
|
-
id: rec ?
|
|
606
|
-
body: rec ?
|
|
641
|
+
id: rec ? firstString3(rec, ["id", "comment_id"]) || void 0 : void 0,
|
|
642
|
+
body: rec ? firstString3(rec, ["body", "text", "comment"]) || body : body
|
|
607
643
|
};
|
|
608
644
|
}
|
|
609
645
|
function isAbleTimeNoneToken(value) {
|