tines 0.0.85 → 0.0.87
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/index.js +168 -66
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3417,7 +3417,7 @@ var AGENT_GUIDELINES_NAME = "agent-guidelines";
|
|
|
3417
3417
|
var JOURNAL_NAME = "journal";
|
|
3418
3418
|
var AGENT_GUIDELINES_BODY = `You are an agent working on a Tines issue over its HTTP API / CLI. Beyond doing the work, leave the workspace smarter than you found it. Four places to write, chosen by who should inherit what you learned:
|
|
3419
3419
|
|
|
3420
|
-
- **Issue comments** \u2014 all prose about this issue: progress, findings, dead ends, questions, and instructions for whoever picks it up next. Pass the body on stdin with a quoted heredoc, so backticks, $VARS, quotes and apostrophes reach the thread untouched by the shell (
|
|
3420
|
+
- **Issue comments** \u2014 all prose about this issue: progress, findings, dead ends, questions, and instructions for whoever picks it up next. Pass the body on stdin with a quoted heredoc, so backticks, $VARS, quotes and apostrophes reach the thread untouched by the shell (\`tines issues comment-edit <ref> <comment-id>\` and \`comment-delete\` repair your own mis-posts, but a clean first post is cheaper):
|
|
3421
3421
|
|
|
3422
3422
|
\`\`\`
|
|
3423
3423
|
tines issues comment <project>/<number> - <<'EOF'
|
|
@@ -3572,6 +3572,8 @@ var DESCRIBERS = {
|
|
|
3572
3572
|
return segs;
|
|
3573
3573
|
},
|
|
3574
3574
|
"issue.commented": () => [text("commented on"), selfRef()],
|
|
3575
|
+
"issue.comment_edited": () => [text("edited a comment on"), selfRef()],
|
|
3576
|
+
"issue.comment_deleted": () => [text("deleted a comment on"), selfRef()],
|
|
3575
3577
|
"issue.link_added": linkSegments,
|
|
3576
3578
|
"issue.link_removed": linkSegments,
|
|
3577
3579
|
"issue.parked": (_ev, p) => [
|
|
@@ -3765,6 +3767,8 @@ function createApiClient(options) {
|
|
|
3765
3767
|
// Comments
|
|
3766
3768
|
listComments: (issueId, page = {}) => get(`/api/v1/issues/${issueId}/comments${query(page)}`),
|
|
3767
3769
|
createComment: (issueId, body) => request("POST", `/api/v1/issues/${issueId}/comments`, body),
|
|
3770
|
+
updateComment: (issueId, commentId, body) => request("PATCH", `/api/v1/issues/${issueId}/comments/${commentId}`, body),
|
|
3771
|
+
deleteComment: (issueId, commentId) => request("DELETE", `/api/v1/issues/${issueId}/comments/${commentId}`),
|
|
3768
3772
|
// Scheduled tasks
|
|
3769
3773
|
listSchedules: (filters = {}) => get(`/api/v1/schedules${query(filters)}`),
|
|
3770
3774
|
listProjectSchedules: (projectId, page = {}) => get(`/api/v1/projects/${projectId}/schedules${query(page)}`),
|
|
@@ -3924,6 +3928,39 @@ var PLACEHOLDER_DESCRIPTIONS = {
|
|
|
3924
3928
|
};
|
|
3925
3929
|
var TEMPLATE_PLACEHOLDERS = Object.keys(PLACEHOLDER_DESCRIPTIONS).map((key) => ({ key, description: PLACEHOLDER_DESCRIPTIONS[key] }));
|
|
3926
3930
|
|
|
3931
|
+
// ../shared/src/paginate.ts
|
|
3932
|
+
var MAX_PAGE_SIZE = 100;
|
|
3933
|
+
var MAX_ALL_PAGES_ITEMS = 1e4;
|
|
3934
|
+
async function* listPages(fetchPage, opts = {}) {
|
|
3935
|
+
const pageSize = opts.pageSize ?? MAX_PAGE_SIZE;
|
|
3936
|
+
const maxItems = opts.maxItems ?? MAX_ALL_PAGES_ITEMS;
|
|
3937
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3938
|
+
const seenCursors = /* @__PURE__ */ new Set();
|
|
3939
|
+
let cursor;
|
|
3940
|
+
for (; ; ) {
|
|
3941
|
+
const res = await fetchPage({ limit: pageSize, cursor });
|
|
3942
|
+
const fresh = res.items.filter((item) => !seen.has(item.id));
|
|
3943
|
+
for (const item of fresh) seen.add(item.id);
|
|
3944
|
+
if (seen.size > maxItems) {
|
|
3945
|
+
throw new Error(
|
|
3946
|
+
`list has more than ${maxItems} items \u2014 narrow it with filters, or page manually with --cursor`
|
|
3947
|
+
);
|
|
3948
|
+
}
|
|
3949
|
+
yield fresh;
|
|
3950
|
+
if (res.next_cursor === null) return;
|
|
3951
|
+
if (seenCursors.has(res.next_cursor)) {
|
|
3952
|
+
throw new Error(`pagination cursor did not advance past "${cursor}" (server bug?)`);
|
|
3953
|
+
}
|
|
3954
|
+
seenCursors.add(res.next_cursor);
|
|
3955
|
+
cursor = res.next_cursor;
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
async function listAll(fetchPage, opts = {}) {
|
|
3959
|
+
const items = [];
|
|
3960
|
+
for await (const page of listPages(fetchPage, opts)) items.push(...page);
|
|
3961
|
+
return items;
|
|
3962
|
+
}
|
|
3963
|
+
|
|
3927
3964
|
// src/format.ts
|
|
3928
3965
|
function timestamp(ms) {
|
|
3929
3966
|
return new Date(ms).toISOString().replace("T", " ").slice(0, 19);
|
|
@@ -4018,6 +4055,10 @@ function quotaLabel(quota, stateName) {
|
|
|
4018
4055
|
);
|
|
4019
4056
|
return `state roster: default ${quota.default_limit} per state${overrides.length > 0 ? `, overrides: ${overrides.join(", ")}` : ""}`;
|
|
4020
4057
|
}
|
|
4058
|
+
function commentLines(comment) {
|
|
4059
|
+
const header = ` [${timestamp(comment.created_at)}] ${actorLabel(comment.actor)} (${comment.id})${comment.updated_at ? " (edited)" : ""}:`;
|
|
4060
|
+
return ["", header, ...comment.body.split("\n").map((line) => ` ${line}`)];
|
|
4061
|
+
}
|
|
4021
4062
|
function runRow(run) {
|
|
4022
4063
|
return [
|
|
4023
4064
|
run.id,
|
|
@@ -4120,7 +4161,16 @@ function withCommon(cmd, { baseUrlFlag = true } = {}) {
|
|
|
4120
4161
|
}
|
|
4121
4162
|
function withList(cmd) {
|
|
4122
4163
|
return withCommon(
|
|
4123
|
-
cmd.option(
|
|
4164
|
+
cmd.option(
|
|
4165
|
+
"--limit <n>",
|
|
4166
|
+
"maximum items to return (page size under --all-pages)",
|
|
4167
|
+
(v) => Number.parseInt(v, 10)
|
|
4168
|
+
).option("--cursor <cursor>", "resume from the next_cursor of a previous page").addOption(
|
|
4169
|
+
new Option(
|
|
4170
|
+
"--all-pages",
|
|
4171
|
+
"fetch every page, not just the first (slower on large lists)"
|
|
4172
|
+
).conflicts("cursor")
|
|
4173
|
+
)
|
|
4124
4174
|
);
|
|
4125
4175
|
}
|
|
4126
4176
|
function resolveUrl(opts) {
|
|
@@ -4169,8 +4219,24 @@ function printJson(value) {
|
|
|
4169
4219
|
function printList(res, opts, render) {
|
|
4170
4220
|
if (opts.json) return printJson(res);
|
|
4171
4221
|
render(res.items);
|
|
4172
|
-
if (res.next_cursor)
|
|
4173
|
-
|
|
4222
|
+
if (res.next_cursor) {
|
|
4223
|
+
console.log(
|
|
4224
|
+
`
|
|
4225
|
+
more results: rerun with --all-pages, or resume with --cursor ${res.next_cursor}`
|
|
4226
|
+
);
|
|
4227
|
+
}
|
|
4228
|
+
}
|
|
4229
|
+
async function fetchList(opts, fetchPage) {
|
|
4230
|
+
if (opts.allPages) {
|
|
4231
|
+
return { items: await listAll(fetchPage, { pageSize: opts.limit }), next_cursor: null };
|
|
4232
|
+
}
|
|
4233
|
+
const res = await fetchPage({ limit: opts.limit, cursor: opts.cursor });
|
|
4234
|
+
if (res.next_cursor && opts.json && !opts.cursor) {
|
|
4235
|
+
console.error(
|
|
4236
|
+
"warning: more items exist beyond this page \u2014 rerun with --all-pages for all of them"
|
|
4237
|
+
);
|
|
4238
|
+
}
|
|
4239
|
+
return res;
|
|
4174
4240
|
}
|
|
4175
4241
|
function table(rows) {
|
|
4176
4242
|
if (rows.length === 0) return;
|
|
@@ -4281,16 +4347,18 @@ function register(program3) {
|
|
|
4281
4347
|
).action(async (opts) => {
|
|
4282
4348
|
const api = client(opts);
|
|
4283
4349
|
const scope = await resolveScopeFlags(api, opts);
|
|
4284
|
-
const res = await
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4350
|
+
const res = await fetchList(
|
|
4351
|
+
opts,
|
|
4352
|
+
(page) => api.listContext({
|
|
4353
|
+
kind: opts.kind,
|
|
4354
|
+
project: scope.project_id ?? void 0,
|
|
4355
|
+
state: scope.workflow_state_id ?? void 0,
|
|
4356
|
+
issue: scope.issue_id ?? void 0,
|
|
4357
|
+
q: opts.search,
|
|
4358
|
+
exact: opts.exact ? true : void 0,
|
|
4359
|
+
...page
|
|
4360
|
+
})
|
|
4361
|
+
);
|
|
4294
4362
|
printList(res, opts, (items) => {
|
|
4295
4363
|
if (items.length === 0) return console.log("no context items");
|
|
4296
4364
|
table([
|
|
@@ -4405,7 +4473,7 @@ function register(program3) {
|
|
|
4405
4473
|
context.command("init").description('Seed the global "agent-guidelines" prompt (a no-op if it already exists)')
|
|
4406
4474
|
).action(async (opts) => {
|
|
4407
4475
|
const api = client(opts);
|
|
4408
|
-
const
|
|
4476
|
+
const items = await listAll((page) => api.listContext({ kind: "prompt", exact: true, ...page }));
|
|
4409
4477
|
const existing = items.find((i) => i.name === AGENT_GUIDELINES_NAME);
|
|
4410
4478
|
if (existing) {
|
|
4411
4479
|
if (opts.json) return printJson(existing);
|
|
@@ -4543,9 +4611,7 @@ allowed actions: ${allowed.length ? allowed.join(", ") : "none (terminal state)"
|
|
|
4543
4611
|
console.log(`
|
|
4544
4612
|
comments (${issue.comments.length}):`);
|
|
4545
4613
|
for (const c of issue.comments) {
|
|
4546
|
-
console.log(
|
|
4547
|
-
[${timestamp(c.created_at)}] ${actorLabel(c.actor)}:`);
|
|
4548
|
-
for (const line of c.body.split("\n")) console.log(` ${line}`);
|
|
4614
|
+
for (const line of commentLines(c)) console.log(line);
|
|
4549
4615
|
}
|
|
4550
4616
|
}
|
|
4551
4617
|
}
|
|
@@ -4610,17 +4676,20 @@ function register2(program3) {
|
|
|
4610
4676
|
issues.command("list").description("List issues across projects (hides done issues unless --all)").option("-p, --project <name>", "filter by project name or id").option("-s, --state <name>", "filter by state name or id").option("-c, --category <cat>", "filter by state category").option("-w, --workflow <id-or-name>", "filter by workflow").option("-a, --all", "include issues in done states").option("--ready", "only issues that are actionable now (not done, not a duplicate, no open blockers)").option("-q, --search <text>", "search titles and descriptions")
|
|
4611
4677
|
).action(
|
|
4612
4678
|
async (opts) => {
|
|
4613
|
-
const
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4679
|
+
const api = client(opts);
|
|
4680
|
+
const res = await fetchList(
|
|
4681
|
+
opts,
|
|
4682
|
+
(page) => api.listIssues({
|
|
4683
|
+
project: opts.project,
|
|
4684
|
+
state: opts.state,
|
|
4685
|
+
category: opts.category,
|
|
4686
|
+
workflow: opts.workflow,
|
|
4687
|
+
hide_done: !opts.all,
|
|
4688
|
+
ready: opts.ready,
|
|
4689
|
+
q: opts.search,
|
|
4690
|
+
...page
|
|
4691
|
+
})
|
|
4692
|
+
);
|
|
4624
4693
|
printList(res, opts, (items) => {
|
|
4625
4694
|
if (items.length === 0) return console.log(opts.ready ? "no ready issues" : "no issues");
|
|
4626
4695
|
table([
|
|
@@ -4732,7 +4801,29 @@ function register2(program3) {
|
|
|
4732
4801
|
const issue = await resolveIssue(api, ref);
|
|
4733
4802
|
const comment = await api.createComment(issue.id, { body });
|
|
4734
4803
|
if (opts.json) return printJson(comment);
|
|
4735
|
-
console.log(
|
|
4804
|
+
console.log(
|
|
4805
|
+
`commented on ${issue.project_name}/#${issue.number} as ${actorLabel(comment.actor)} (id ${comment.id})`
|
|
4806
|
+
);
|
|
4807
|
+
});
|
|
4808
|
+
withCommon(
|
|
4809
|
+
issues.command("comment-edit <ref> <comment-id> <markdown>").description(`Replace the body of your own comment \u2014 Markdown body: ${BODY_VALUE_HELP}`).passThroughOptions()
|
|
4810
|
+
).action(async (ref, commentId, markdown, opts, command) => {
|
|
4811
|
+
if (helpGuard(command, markdown)) return;
|
|
4812
|
+
const body = readBodyValue(markdown);
|
|
4813
|
+
const api = client(opts);
|
|
4814
|
+
const issue = await resolveIssue(api, ref);
|
|
4815
|
+
const comment = await api.updateComment(issue.id, commentId, { body });
|
|
4816
|
+
if (opts.json) return printJson(comment);
|
|
4817
|
+
console.log(`edited comment ${comment.id} on ${issue.project_name}/#${issue.number}`);
|
|
4818
|
+
});
|
|
4819
|
+
withCommon(
|
|
4820
|
+
issues.command("comment-delete <ref> <comment-id>").description("Delete your own comment (the event keeps the record of the deletion)")
|
|
4821
|
+
).action(async (ref, commentId, opts) => {
|
|
4822
|
+
const api = client(opts);
|
|
4823
|
+
const issue = await resolveIssue(api, ref);
|
|
4824
|
+
await api.deleteComment(issue.id, commentId);
|
|
4825
|
+
if (opts.json) return printJson({ id: commentId, deleted: true });
|
|
4826
|
+
console.log(`deleted comment ${commentId} from ${issue.project_name}/#${issue.number}`);
|
|
4736
4827
|
});
|
|
4737
4828
|
withCommon(
|
|
4738
4829
|
issues.command("block <blocker> <blocked>").description("Record that <blocker> blocks <blocked> (advisory: transitions stay allowed)")
|
|
@@ -5101,13 +5192,15 @@ files (v${artifact.current_version.version}):`);
|
|
|
5101
5192
|
// src/commands/journal.ts
|
|
5102
5193
|
var STATE_FLAG_HELP = "target this state's journal instead of your run's launch stage (options go BEFORE <ref>)";
|
|
5103
5194
|
async function journalItemAt(api, scope) {
|
|
5104
|
-
const
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5195
|
+
const items = await listAll(
|
|
5196
|
+
(page) => api.listContext({
|
|
5197
|
+
kind: "prompt",
|
|
5198
|
+
project: scope.project_id ?? void 0,
|
|
5199
|
+
state: scope.workflow_state_id ?? void 0,
|
|
5200
|
+
exact: true,
|
|
5201
|
+
...page
|
|
5202
|
+
})
|
|
5203
|
+
);
|
|
5111
5204
|
return items.find((i) => i.name === JOURNAL_NAME) ?? null;
|
|
5112
5205
|
}
|
|
5113
5206
|
function stateScope(issue, state, workflow) {
|
|
@@ -5233,13 +5326,15 @@ function registerEvents(program3) {
|
|
|
5233
5326
|
).action(async (opts) => {
|
|
5234
5327
|
const api = client(opts);
|
|
5235
5328
|
const issueId = opts.issue ? (await resolveIssue(api, opts.issue)).id : void 0;
|
|
5236
|
-
const res = await
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5329
|
+
const res = await fetchList(
|
|
5330
|
+
opts,
|
|
5331
|
+
(page) => api.listEvents({
|
|
5332
|
+
issue: issueId,
|
|
5333
|
+
project: opts.project,
|
|
5334
|
+
type: opts.type,
|
|
5335
|
+
...page
|
|
5336
|
+
})
|
|
5337
|
+
);
|
|
5243
5338
|
printList(res, opts, (items) => {
|
|
5244
5339
|
if (items.length === 0) return console.log("no events");
|
|
5245
5340
|
table([
|
|
@@ -5254,7 +5349,8 @@ function registerEvents(program3) {
|
|
|
5254
5349
|
function register4(program3) {
|
|
5255
5350
|
const projects = program3.command("projects").description("Manage projects");
|
|
5256
5351
|
withList(projects.command("list").description("List projects")).action(async (opts) => {
|
|
5257
|
-
const
|
|
5352
|
+
const api = client(opts);
|
|
5353
|
+
const res = await fetchList(opts, (page) => api.listProjects(page));
|
|
5258
5354
|
printList(res, opts, (items) => {
|
|
5259
5355
|
if (items.length === 0) return console.log("no projects");
|
|
5260
5356
|
table([
|
|
@@ -6456,13 +6552,15 @@ function register6(program3) {
|
|
|
6456
6552
|
const api = client(opts);
|
|
6457
6553
|
const issueId = opts.issue ? (await resolveIssue(api, opts.issue)).id : void 0;
|
|
6458
6554
|
const runnerId = opts.runner ? (await resolveRunner(api, opts.runner)).id : void 0;
|
|
6459
|
-
const res = await
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6555
|
+
const res = await fetchList(
|
|
6556
|
+
opts,
|
|
6557
|
+
(page) => api.listRuns({
|
|
6558
|
+
issue: issueId,
|
|
6559
|
+
runner: runnerId,
|
|
6560
|
+
active: opts.active ? true : void 0,
|
|
6561
|
+
...page
|
|
6562
|
+
})
|
|
6563
|
+
);
|
|
6466
6564
|
printList(res, opts, (items) => {
|
|
6467
6565
|
if (items.length === 0) return console.log(opts.active ? "no active runs" : "no runs");
|
|
6468
6566
|
table([["ID", "ISSUE", "RUNNER", "TIER", "STATUS", "DURATION", "COST", "CREATED"], ...items.map(runRow)]);
|
|
@@ -6537,7 +6635,7 @@ import { createInterface } from "node:readline/promises";
|
|
|
6537
6635
|
async function resolveSchedule(api, ref) {
|
|
6538
6636
|
const { project, name: name2 } = parseScheduleRef(ref);
|
|
6539
6637
|
const proj = await resolveProject(api, project);
|
|
6540
|
-
const
|
|
6638
|
+
const items = await listAll((page) => api.listProjectSchedules(proj.id, page));
|
|
6541
6639
|
const found = items.find((s) => s.name === name2) ?? items.find((s) => s.id === name2);
|
|
6542
6640
|
if (!found) {
|
|
6543
6641
|
die(
|
|
@@ -6567,12 +6665,15 @@ function register7(program3) {
|
|
|
6567
6665
|
withList(
|
|
6568
6666
|
schedules.command("list").description("List scheduled tasks (hides paused schedules unless --all)").option("-p, --project <name>", "filter by project name or id").option("-a, --all", "include paused schedules")
|
|
6569
6667
|
).action(async (opts) => {
|
|
6570
|
-
const
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6668
|
+
const api = client(opts);
|
|
6669
|
+
const res = await fetchList(
|
|
6670
|
+
opts,
|
|
6671
|
+
(page) => api.listSchedules({
|
|
6672
|
+
project: opts.project,
|
|
6673
|
+
enabled: opts.all ? void 0 : true,
|
|
6674
|
+
...page
|
|
6675
|
+
})
|
|
6676
|
+
);
|
|
6576
6677
|
printList(res, opts, (items) => {
|
|
6577
6678
|
if (items.length === 0) return console.log("no schedules");
|
|
6578
6679
|
table([
|
|
@@ -6701,14 +6802,14 @@ function register8(program3) {
|
|
|
6701
6802
|
withCommon(supervisor.command("status").description("One-screen overview: kill switch, quota, utilization, runners")).action(
|
|
6702
6803
|
async (opts) => {
|
|
6703
6804
|
const api = client(opts);
|
|
6704
|
-
const [settings, runnersRes, workflows,
|
|
6805
|
+
const [settings, runnersRes, workflows, activeRunItems] = await Promise.all([
|
|
6705
6806
|
api.getSupervisorSettings(),
|
|
6706
6807
|
api.listRunners(),
|
|
6707
|
-
api.listWorkflows(
|
|
6708
|
-
api.listRuns({ active: true,
|
|
6808
|
+
api.listWorkflows(),
|
|
6809
|
+
listAll((page) => api.listRuns({ active: true, ...page }))
|
|
6709
6810
|
]);
|
|
6710
6811
|
if (opts.json) {
|
|
6711
|
-
return printJson({ settings, runners: runnersRes.items, active_runs:
|
|
6812
|
+
return printJson({ settings, runners: runnersRes.items, active_runs: activeRunItems });
|
|
6712
6813
|
}
|
|
6713
6814
|
const stateNames = /* @__PURE__ */ new Map();
|
|
6714
6815
|
for (const wf of workflows.items) {
|
|
@@ -6716,7 +6817,7 @@ function register8(program3) {
|
|
|
6716
6817
|
}
|
|
6717
6818
|
console.log(`automation: ${settings.enabled ? "ON" : "OFF (kill switch \u2014 nothing dispatches)"}`);
|
|
6718
6819
|
console.log(quotaLabel(settings.quota, (id) => stateNames.get(id) ?? id));
|
|
6719
|
-
console.log(`utilization: ${utilizationLabel(settings.quota,
|
|
6820
|
+
console.log(`utilization: ${utilizationLabel(settings.quota, activeRunItems, (id) => stateNames.get(id) ?? id)}`);
|
|
6720
6821
|
console.log(`attempt limit: ${settings.attempt_limit} strikes, then the issue parks`);
|
|
6721
6822
|
if (runnersRes.items.length === 0) {
|
|
6722
6823
|
console.log("runners: none");
|
|
@@ -6781,7 +6882,7 @@ function register8(program3) {
|
|
|
6781
6882
|
quota: { type: "state_roster", default_limit: opts.default, overrides }
|
|
6782
6883
|
});
|
|
6783
6884
|
if (opts.json) return printJson(settings);
|
|
6784
|
-
const workflows = await api.listWorkflows(
|
|
6885
|
+
const workflows = await api.listWorkflows();
|
|
6785
6886
|
const stateNames = /* @__PURE__ */ new Map();
|
|
6786
6887
|
for (const wf of workflows.items) {
|
|
6787
6888
|
for (const s of wf.states) stateNames.set(s.id, `${wf.name}/${s.name}`);
|
|
@@ -6887,7 +6988,8 @@ function register9(program3) {
|
|
|
6887
6988
|
const workflows = program3.command("workflows").description("Manage the workflow library");
|
|
6888
6989
|
withList(workflows.command("list").description("List the workflow library")).action(
|
|
6889
6990
|
async (opts) => {
|
|
6890
|
-
const
|
|
6991
|
+
const api = client(opts);
|
|
6992
|
+
const res = await fetchList(opts, (page) => api.listWorkflows(page));
|
|
6891
6993
|
printList(res, opts, (items) => {
|
|
6892
6994
|
if (items.length === 0) return console.log("no workflows");
|
|
6893
6995
|
table([
|