@elyracode/felagi 0.9.56 → 0.9.58
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/CHANGELOG.md +8 -0
- package/extensions/index.ts +95 -64
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.9.58] - 2026-11-18
|
|
4
|
+
|
|
5
|
+
## [0.9.57] - 2026-11-10
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Tool failures were returned as normal results (`isError` on the return value is ignored) and the model saw them as successes; they now throw so the result is marked as an error
|
|
10
|
+
|
|
3
11
|
## [0.9.56] - 2026-11-01
|
|
4
12
|
|
|
5
13
|
## [0.9.55] - 2026-10-21
|
package/extensions/index.ts
CHANGED
|
@@ -70,7 +70,12 @@ interface FelagiResponse {
|
|
|
70
70
|
retryAfter?: string;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
async function felagiFetch(
|
|
73
|
+
async function felagiFetch(
|
|
74
|
+
config: FelagiConfig,
|
|
75
|
+
method: string,
|
|
76
|
+
path: string,
|
|
77
|
+
body?: unknown,
|
|
78
|
+
): Promise<FelagiResponse> {
|
|
74
79
|
const url = `${config.baseUrl}/api/v1${path}`;
|
|
75
80
|
const headers: Record<string, string> = {
|
|
76
81
|
Authorization: `Bearer ${config.token}`,
|
|
@@ -103,41 +108,39 @@ function ok(text: string) {
|
|
|
103
108
|
return { content: [{ type: "text" as const, text }], details: {} };
|
|
104
109
|
}
|
|
105
110
|
|
|
106
|
-
function
|
|
107
|
-
return
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function noConfig() {
|
|
111
|
-
return err(
|
|
111
|
+
function noConfig(): Error {
|
|
112
|
+
return new Error(
|
|
112
113
|
"F\u00e9lagi is not configured. Set FELAGI_URL and FELAGI_TOKEN in the environment or the project's .env file. " +
|
|
113
114
|
"Create a token under Settings \u2192 API tokens in F\u00e9lagi.",
|
|
114
115
|
);
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
/** Map the documented error statuses to actionable messages. */
|
|
118
|
-
function apiError(response: FelagiResponse):
|
|
119
|
+
function apiError(response: FelagiResponse): Error {
|
|
119
120
|
const message =
|
|
120
121
|
typeof response.data === "object" && response.data !== null && "message" in response.data
|
|
121
122
|
? String((response.data as { message: unknown }).message)
|
|
122
123
|
: String(response.data ?? "");
|
|
123
124
|
switch (response.status) {
|
|
124
125
|
case 401:
|
|
125
|
-
return
|
|
126
|
+
return new Error(`401: the token is wrong, revoked, expired, or its owner left the workspace. ${message}`);
|
|
126
127
|
case 403:
|
|
127
|
-
return
|
|
128
|
+
return new Error(`403: this token is read-only and the request was a write. ${message}`);
|
|
128
129
|
case 404:
|
|
129
|
-
return
|
|
130
|
+
return new Error(
|
|
131
|
+
"404: no such record, or it belongs to another workspace (F\u00e9lagi deliberately answers both the same).",
|
|
132
|
+
);
|
|
130
133
|
case 422: {
|
|
131
134
|
const errors =
|
|
132
135
|
typeof response.data === "object" && response.data !== null && "errors" in response.data
|
|
133
136
|
? JSON.stringify((response.data as { errors: unknown }).errors)
|
|
134
137
|
: "";
|
|
135
|
-
return
|
|
138
|
+
return new Error(`422 validation error: ${message} ${errors}`);
|
|
136
139
|
}
|
|
137
140
|
case 429:
|
|
138
|
-
return
|
|
141
|
+
return new Error(`429 rate limited. Retry after ${response.retryAfter ?? "?"} seconds.`);
|
|
139
142
|
default:
|
|
140
|
-
return
|
|
143
|
+
return new Error(`HTTP ${response.status}: ${message}`);
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
|
|
@@ -204,7 +207,8 @@ function formatIssueFull(issue: Issue): string {
|
|
|
204
207
|
if (issue.project?.name) lines.push(`Project: ${issue.project.name} (id ${issue.project.id})`);
|
|
205
208
|
if (issue.epic?.title) lines.push(`Epic: ${issue.epic.id} ${issue.epic.title}`);
|
|
206
209
|
lines.push(`Assignee: ${formatActor(issue.assignee)} | Creator: ${formatActor(issue.creator)}`);
|
|
207
|
-
if (issue.start_date || issue.due_date)
|
|
210
|
+
if (issue.start_date || issue.due_date)
|
|
211
|
+
lines.push(`Dates: ${issue.start_date ?? "\u2014"} \u2192 ${issue.due_date ?? "\u2014"}`);
|
|
208
212
|
const estimate = issue.estimate_minutes != null ? `${issue.estimate_minutes}m estimated` : "no estimate";
|
|
209
213
|
lines.push(`Time: ${issue.spent_minutes ?? 0}m spent (includes agent run time), ${estimate}`);
|
|
210
214
|
if (issue.labels && issue.labels.length > 0) lines.push(`Labels: ${issue.labels.join(", ")}`);
|
|
@@ -257,9 +261,9 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
257
261
|
parameters: Type.Object({}),
|
|
258
262
|
execute: async (_id, _params, _signal, _onUpdate, ctx) => {
|
|
259
263
|
const config = getConfig(ctx.cwd);
|
|
260
|
-
if (!config)
|
|
264
|
+
if (!config) throw noConfig();
|
|
261
265
|
const response = await felagiFetch(config, "GET", "/me");
|
|
262
|
-
if (!response.ok)
|
|
266
|
+
if (!response.ok) throw apiError(response);
|
|
263
267
|
const me = record(response.data) as {
|
|
264
268
|
user?: { name?: string; email?: string };
|
|
265
269
|
workspace?: { name?: string; issue_prefix?: string };
|
|
@@ -303,7 +307,7 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
303
307
|
}),
|
|
304
308
|
execute: async (_id, params, _signal, _onUpdate, ctx) => {
|
|
305
309
|
const config = getConfig(ctx.cwd);
|
|
306
|
-
if (!config)
|
|
310
|
+
if (!config) throw noConfig();
|
|
307
311
|
const query = new URLSearchParams();
|
|
308
312
|
if (params.q) query.set("q", params.q);
|
|
309
313
|
if (params.status) query.set("status", params.status);
|
|
@@ -318,7 +322,7 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
318
322
|
if (params.per_page != null) query.set("per_page", String(params.per_page));
|
|
319
323
|
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
320
324
|
const response = await felagiFetch(config, "GET", `/issues${suffix}`);
|
|
321
|
-
if (!response.ok)
|
|
325
|
+
if (!response.ok) throw apiError(response);
|
|
322
326
|
const issues = rows(response.data) as Issue[];
|
|
323
327
|
if (issues.length === 0) return ok("No issues match.");
|
|
324
328
|
return ok(issues.map((i) => `- ${formatIssueLine(i)}`).join("\n") + collectionFooter(response.data));
|
|
@@ -339,10 +343,10 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
339
343
|
}),
|
|
340
344
|
execute: async (_id, params, _signal, _onUpdate, ctx) => {
|
|
341
345
|
const config = getConfig(ctx.cwd);
|
|
342
|
-
if (!config)
|
|
346
|
+
if (!config) throw noConfig();
|
|
343
347
|
const issueRef = encodeURIComponent(params.issue);
|
|
344
348
|
const response = await felagiFetch(config, "GET", `/issues/${issueRef}`);
|
|
345
|
-
if (!response.ok)
|
|
349
|
+
if (!response.ok) throw apiError(response);
|
|
346
350
|
const parts = [formatIssueFull(record(response.data) as Issue)];
|
|
347
351
|
|
|
348
352
|
if (params.include_comments) {
|
|
@@ -358,7 +362,9 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
358
362
|
if (list.length === 0) parts.push("(none)");
|
|
359
363
|
for (const c of list) {
|
|
360
364
|
const runNote = c.from_run ? " [agent run report]" : "";
|
|
361
|
-
parts.push(
|
|
365
|
+
parts.push(
|
|
366
|
+
`- ${formatActor(c.author)}${runNote} (${c.created_at ?? "?"}):\n ${stripHtml(c.body ?? "").replace(/\n/g, "\n ")}`,
|
|
367
|
+
);
|
|
362
368
|
}
|
|
363
369
|
}
|
|
364
370
|
}
|
|
@@ -401,9 +407,9 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
401
407
|
}),
|
|
402
408
|
execute: async (_id, params, _signal, _onUpdate, ctx) => {
|
|
403
409
|
const config = getConfig(ctx.cwd);
|
|
404
|
-
if (!config)
|
|
410
|
+
if (!config) throw noConfig();
|
|
405
411
|
const response = await felagiFetch(config, "POST", "/issues", params);
|
|
406
|
-
if (!response.ok)
|
|
412
|
+
if (!response.ok) throw apiError(response);
|
|
407
413
|
const issue = record(response.data) as Issue;
|
|
408
414
|
return ok(`Created ${issue.id}: ${issue.title}`);
|
|
409
415
|
},
|
|
@@ -420,7 +426,9 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
420
426
|
issue: Type.String({ description: "Issue identifier (e.g. ACM-231) or numeric id" }),
|
|
421
427
|
title: Type.Optional(Type.String()),
|
|
422
428
|
description: Type.Optional(Type.String()),
|
|
423
|
-
status: Type.Optional(
|
|
429
|
+
status: Type.Optional(
|
|
430
|
+
Type.String({ description: "backlog/todo/in_progress/in_review/on_hold/done/canceled" }),
|
|
431
|
+
),
|
|
424
432
|
priority: Type.Optional(Type.String()),
|
|
425
433
|
type: Type.Optional(Type.String()),
|
|
426
434
|
assignee_type: Type.Optional(Type.String({ description: "'user' or 'agent' \u2014 agent queues a run" })),
|
|
@@ -431,10 +439,10 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
431
439
|
}),
|
|
432
440
|
execute: async (_id, params, _signal, _onUpdate, ctx) => {
|
|
433
441
|
const config = getConfig(ctx.cwd);
|
|
434
|
-
if (!config)
|
|
442
|
+
if (!config) throw noConfig();
|
|
435
443
|
const { issue, ...fields } = params;
|
|
436
444
|
const response = await felagiFetch(config, "PATCH", `/issues/${encodeURIComponent(issue)}`, fields);
|
|
437
|
-
if (!response.ok)
|
|
445
|
+
if (!response.ok) throw apiError(response);
|
|
438
446
|
const updated = record(response.data) as Issue;
|
|
439
447
|
return ok(`Updated ${updated.id}: ${formatIssueLine(updated)}`);
|
|
440
448
|
},
|
|
@@ -453,11 +461,11 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
453
461
|
}),
|
|
454
462
|
execute: async (_id, params, _signal, _onUpdate, ctx) => {
|
|
455
463
|
const config = getConfig(ctx.cwd);
|
|
456
|
-
if (!config)
|
|
464
|
+
if (!config) throw noConfig();
|
|
457
465
|
const response = await felagiFetch(config, "POST", `/issues/${encodeURIComponent(params.issue)}/comments`, {
|
|
458
466
|
body: params.body,
|
|
459
467
|
});
|
|
460
|
-
if (!response.ok)
|
|
468
|
+
if (!response.ok) throw apiError(response);
|
|
461
469
|
return ok(`Comment posted on ${params.issue}.`);
|
|
462
470
|
},
|
|
463
471
|
});
|
|
@@ -479,13 +487,13 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
479
487
|
}),
|
|
480
488
|
execute: async (_id, params, _signal, _onUpdate, ctx) => {
|
|
481
489
|
const config = getConfig(ctx.cwd);
|
|
482
|
-
if (!config)
|
|
490
|
+
if (!config) throw noConfig();
|
|
483
491
|
if (!params.duration && params.minutes == null) {
|
|
484
|
-
|
|
492
|
+
throw new Error("Provide duration ('2h 30m') or minutes.");
|
|
485
493
|
}
|
|
486
494
|
const { issue, ...body } = params;
|
|
487
495
|
const response = await felagiFetch(config, "POST", `/issues/${encodeURIComponent(issue)}/time`, body);
|
|
488
|
-
if (!response.ok)
|
|
496
|
+
if (!response.ok) throw apiError(response);
|
|
489
497
|
const entry = record(response.data) as { minutes?: number; spent_on?: string };
|
|
490
498
|
return ok(`Logged ${entry.minutes ?? "?"}m on ${issue} (${entry.spent_on ?? "today"}).`);
|
|
491
499
|
},
|
|
@@ -508,7 +516,7 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
508
516
|
}),
|
|
509
517
|
execute: async (_id, params, _signal, _onUpdate, ctx) => {
|
|
510
518
|
const config = getConfig(ctx.cwd);
|
|
511
|
-
if (!config)
|
|
519
|
+
if (!config) throw noConfig();
|
|
512
520
|
const query = new URLSearchParams();
|
|
513
521
|
if (params.mine) query.set("mine", "1");
|
|
514
522
|
if (params.from) query.set("from", params.from);
|
|
@@ -517,7 +525,7 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
517
525
|
if (params.source) query.set("source", params.source);
|
|
518
526
|
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
519
527
|
const response = await felagiFetch(config, "GET", `/time-entries${suffix}`);
|
|
520
|
-
if (!response.ok)
|
|
528
|
+
if (!response.ok) throw apiError(response);
|
|
521
529
|
const entries = rows(response.data) as Array<{
|
|
522
530
|
id?: number;
|
|
523
531
|
issue?: string;
|
|
@@ -534,7 +542,9 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
534
542
|
const note = e.note ? ` \u2014 ${e.note}` : "";
|
|
535
543
|
return `- ${e.spent_on} ${e.issue}: ${e.minutes}m [${e.source}] ${formatActor(e.actor)}${note}`;
|
|
536
544
|
});
|
|
537
|
-
lines.push(
|
|
545
|
+
lines.push(
|
|
546
|
+
`\nSum of listed entries: ${Math.floor(total / 60)}h ${total % 60}m (mixes sources unless filtered)`,
|
|
547
|
+
);
|
|
538
548
|
return ok(lines.join("\n") + collectionFooter(response.data));
|
|
539
549
|
},
|
|
540
550
|
});
|
|
@@ -549,49 +559,59 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
549
559
|
"(stops and writes the hours down), 'discard' (stops recording nothing). A forgotten timer is capped at " +
|
|
550
560
|
"8 hours server-side.",
|
|
551
561
|
parameters: Type.Object({
|
|
552
|
-
action: Type.Union([
|
|
562
|
+
action: Type.Union([
|
|
563
|
+
Type.Literal("status"),
|
|
564
|
+
Type.Literal("start"),
|
|
565
|
+
Type.Literal("stop"),
|
|
566
|
+
Type.Literal("discard"),
|
|
567
|
+
]),
|
|
553
568
|
issue: Type.Optional(Type.String({ description: "Required for 'start': issue identifier or numeric id" })),
|
|
554
569
|
note: Type.Optional(Type.String({ description: "Optional note for 'start'" })),
|
|
555
570
|
}),
|
|
556
571
|
execute: async (_id, params, _signal, _onUpdate, ctx) => {
|
|
557
572
|
const config = getConfig(ctx.cwd);
|
|
558
|
-
if (!config)
|
|
573
|
+
if (!config) throw noConfig();
|
|
559
574
|
|
|
560
575
|
if (params.action === "status") {
|
|
561
576
|
const response = await felagiFetch(config, "GET", "/timer");
|
|
562
|
-
if (!response.ok)
|
|
563
|
-
const timer = (
|
|
564
|
-
|
|
577
|
+
if (!response.ok) throw apiError(response);
|
|
578
|
+
const timer = (
|
|
579
|
+
response.data as { data?: { issue?: string; started_at?: string; note?: string | null } | null }
|
|
580
|
+
)?.data;
|
|
565
581
|
if (!timer) return ok("No timer is running.");
|
|
566
|
-
return ok(
|
|
582
|
+
return ok(
|
|
583
|
+
`Timer running on ${timer.issue} since ${timer.started_at}${timer.note ? ` \u2014 ${timer.note}` : ""}`,
|
|
584
|
+
);
|
|
567
585
|
}
|
|
568
586
|
|
|
569
587
|
if (params.action === "start") {
|
|
570
|
-
if (!params.issue)
|
|
588
|
+
if (!params.issue) throw new Error("'start' needs an issue.");
|
|
571
589
|
const response = await felagiFetch(config, "POST", `/issues/${encodeURIComponent(params.issue)}/timer`, {
|
|
572
590
|
note: params.note,
|
|
573
591
|
});
|
|
574
|
-
if (!response.ok)
|
|
592
|
+
if (!response.ok) throw apiError(response);
|
|
575
593
|
const payload = response.data as {
|
|
576
594
|
data?: { issue?: string; started_at?: string };
|
|
577
595
|
stopped?: { issue?: string; minutes?: number } | null;
|
|
578
596
|
};
|
|
579
597
|
const started = `Timer started on ${payload.data?.issue ?? params.issue}.`;
|
|
580
598
|
if (payload.stopped) {
|
|
581
|
-
return ok(
|
|
599
|
+
return ok(
|
|
600
|
+
`${started} Stopped and logged the previous one: ${payload.stopped.minutes}m on ${payload.stopped.issue}.`,
|
|
601
|
+
);
|
|
582
602
|
}
|
|
583
603
|
return ok(started);
|
|
584
604
|
}
|
|
585
605
|
|
|
586
606
|
if (params.action === "stop") {
|
|
587
607
|
const response = await felagiFetch(config, "POST", "/timer/stop");
|
|
588
|
-
if (!response.ok)
|
|
608
|
+
if (!response.ok) throw apiError(response);
|
|
589
609
|
const entry = record(response.data) as { issue?: string; minutes?: number };
|
|
590
610
|
return ok(`Timer stopped: logged ${entry.minutes ?? "?"}m on ${entry.issue ?? "?"}.`);
|
|
591
611
|
}
|
|
592
612
|
|
|
593
613
|
const response = await felagiFetch(config, "DELETE", "/timer");
|
|
594
|
-
if (!response.ok && response.status !== 204)
|
|
614
|
+
if (!response.ok && response.status !== 204) throw apiError(response);
|
|
595
615
|
return ok("Timer discarded; nothing was recorded.");
|
|
596
616
|
},
|
|
597
617
|
});
|
|
@@ -610,11 +630,11 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
610
630
|
}),
|
|
611
631
|
execute: async (_id, params, _signal, _onUpdate, ctx) => {
|
|
612
632
|
const config = getConfig(ctx.cwd);
|
|
613
|
-
if (!config)
|
|
633
|
+
if (!config) throw noConfig();
|
|
614
634
|
|
|
615
635
|
if (params.article_id) {
|
|
616
636
|
const response = await felagiFetch(config, "GET", `/articles/${encodeURIComponent(params.article_id)}`);
|
|
617
|
-
if (!response.ok)
|
|
637
|
+
if (!response.ok) throw apiError(response);
|
|
618
638
|
const article = record(response.data) as { title?: string; body?: string; updated_at?: string };
|
|
619
639
|
return ok(`# ${article.title}\n(updated ${article.updated_at})\n\n${stripHtml(article.body ?? "")}`);
|
|
620
640
|
}
|
|
@@ -623,7 +643,7 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
623
643
|
if (params.q) query.set("q", params.q);
|
|
624
644
|
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
625
645
|
const response = await felagiFetch(config, "GET", `/articles${suffix}`);
|
|
626
|
-
if (!response.ok)
|
|
646
|
+
if (!response.ok) throw apiError(response);
|
|
627
647
|
const articles = rows(response.data) as Array<{
|
|
628
648
|
id?: string;
|
|
629
649
|
title?: string;
|
|
@@ -645,9 +665,9 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
645
665
|
parameters: Type.Object({}),
|
|
646
666
|
execute: async (_id, _params, _signal, _onUpdate, ctx) => {
|
|
647
667
|
const config = getConfig(ctx.cwd);
|
|
648
|
-
if (!config)
|
|
668
|
+
if (!config) throw noConfig();
|
|
649
669
|
const response = await felagiFetch(config, "GET", "/projects");
|
|
650
|
-
if (!response.ok)
|
|
670
|
+
if (!response.ok) throw apiError(response);
|
|
651
671
|
const projects = rows(response.data) as Array<{
|
|
652
672
|
id?: number;
|
|
653
673
|
name?: string;
|
|
@@ -679,9 +699,9 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
679
699
|
parameters: Type.Object({}),
|
|
680
700
|
execute: async (_id, _params, _signal, _onUpdate, ctx) => {
|
|
681
701
|
const config = getConfig(ctx.cwd);
|
|
682
|
-
if (!config)
|
|
702
|
+
if (!config) throw noConfig();
|
|
683
703
|
const response = await felagiFetch(config, "GET", "/agents");
|
|
684
|
-
if (!response.ok)
|
|
704
|
+
if (!response.ok) throw apiError(response);
|
|
685
705
|
const agents = rows(response.data) as Array<{
|
|
686
706
|
id?: number;
|
|
687
707
|
name?: string;
|
|
@@ -715,25 +735,27 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
715
735
|
issue: Type.Optional(Type.String({ description: "For 'queue': issue identifier or numeric id" })),
|
|
716
736
|
agent_id: Type.Optional(Type.Number({ description: "For 'queue' (required) and 'list' (filter)" })),
|
|
717
737
|
run_id: Type.Optional(Type.String({ description: "For 'get': the run's ULID" })),
|
|
718
|
-
status: Type.Optional(
|
|
738
|
+
status: Type.Optional(
|
|
739
|
+
Type.String({ description: "For 'list': queued/dispatched/running/completed/failed/canceled" }),
|
|
740
|
+
),
|
|
719
741
|
}),
|
|
720
742
|
execute: async (_id, params, _signal, _onUpdate, ctx) => {
|
|
721
743
|
const config = getConfig(ctx.cwd);
|
|
722
|
-
if (!config)
|
|
744
|
+
if (!config) throw noConfig();
|
|
723
745
|
|
|
724
746
|
if (params.action === "queue") {
|
|
725
|
-
if (!params.issue || params.agent_id == null)
|
|
747
|
+
if (!params.issue || params.agent_id == null) throw new Error("'queue' needs issue and agent_id.");
|
|
726
748
|
const response = await felagiFetch(config, "POST", `/issues/${encodeURIComponent(params.issue)}/runs`, {
|
|
727
749
|
agent_id: params.agent_id,
|
|
728
750
|
});
|
|
729
|
-
if (!response.ok)
|
|
751
|
+
if (!response.ok) throw apiError(response);
|
|
730
752
|
return ok(`Run queued on ${params.issue} (202: whether a machine picks it up depends on the daemon).`);
|
|
731
753
|
}
|
|
732
754
|
|
|
733
755
|
if (params.action === "get") {
|
|
734
|
-
if (!params.run_id)
|
|
756
|
+
if (!params.run_id) throw new Error("'get' needs run_id.");
|
|
735
757
|
const response = await felagiFetch(config, "GET", `/runs/${encodeURIComponent(params.run_id)}`);
|
|
736
|
-
if (!response.ok)
|
|
758
|
+
if (!response.ok) throw apiError(response);
|
|
737
759
|
const run = record(response.data) as {
|
|
738
760
|
id?: string;
|
|
739
761
|
status?: string;
|
|
@@ -760,7 +782,7 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
760
782
|
if (params.agent_id != null) query.set("agent_id", String(params.agent_id));
|
|
761
783
|
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
762
784
|
const response = await felagiFetch(config, "GET", `/runs${suffix}`);
|
|
763
|
-
if (!response.ok)
|
|
785
|
+
if (!response.ok) throw apiError(response);
|
|
764
786
|
const runs = rows(response.data) as Array<{
|
|
765
787
|
id?: string;
|
|
766
788
|
status?: string;
|
|
@@ -794,7 +816,9 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
794
816
|
handler: async (args, _ctx) => {
|
|
795
817
|
const trimmed = args.trim();
|
|
796
818
|
if (!trimmed || trimmed === "status") {
|
|
797
|
-
elyra.sendUserMessage(
|
|
819
|
+
elyra.sendUserMessage(
|
|
820
|
+
"Check the F\u00e9lagi timer status (felagi_timer action=status) and tell me what is running.",
|
|
821
|
+
);
|
|
798
822
|
return;
|
|
799
823
|
}
|
|
800
824
|
if (trimmed === "stop") {
|
|
@@ -802,7 +826,9 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
802
826
|
return;
|
|
803
827
|
}
|
|
804
828
|
if (trimmed === "discard") {
|
|
805
|
-
elyra.sendUserMessage(
|
|
829
|
+
elyra.sendUserMessage(
|
|
830
|
+
"Discard the F\u00e9lagi timer (felagi_timer action=discard) without recording anything.",
|
|
831
|
+
);
|
|
806
832
|
return;
|
|
807
833
|
}
|
|
808
834
|
if (trimmed.startsWith("start ")) {
|
|
@@ -810,7 +836,9 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
810
836
|
elyra.sendUserMessage(`Start the F\u00e9lagi timer on issue ${issue} (felagi_timer action=start).`);
|
|
811
837
|
return;
|
|
812
838
|
}
|
|
813
|
-
elyra.sendUserMessage(
|
|
839
|
+
elyra.sendUserMessage(
|
|
840
|
+
`Interpret this as a F\u00e9lagi timer request and use the felagi_timer tool: ${trimmed}`,
|
|
841
|
+
);
|
|
814
842
|
},
|
|
815
843
|
});
|
|
816
844
|
|
|
@@ -819,7 +847,10 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
819
847
|
handler: async (args, ctx) => {
|
|
820
848
|
const match = args.trim().match(/^(\S+)\s+(\S+(?:\s+\d+m)?)\s*(.*)$/);
|
|
821
849
|
if (!match) {
|
|
822
|
-
ctx.ui.notify(
|
|
850
|
+
ctx.ui.notify(
|
|
851
|
+
"Usage: /felagi-log <issue> <duration> [note] \u2014 e.g. /felagi-log ACM-231 2h30m traced the loop",
|
|
852
|
+
"error",
|
|
853
|
+
);
|
|
823
854
|
return;
|
|
824
855
|
}
|
|
825
856
|
const [, issue, duration, note] = match;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elyracode/felagi",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.58",
|
|
4
4
|
"description": "Elyra Félagi integration — issues, comments, time tracking, the stopwatch, knowledge base, projects, and agent runs from your Elyra session",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|