tines 0.0.290 → 0.0.291

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4202,7 +4202,8 @@ function createApiClient(options) {
4202
4202
  archiveProject: (id2) => request("POST", `/api/v1/projects/${id2}/archive`),
4203
4203
  unarchiveProject: (id2) => request("POST", `/api/v1/projects/${id2}/unarchive`),
4204
4204
  // Workflows
4205
- listWorkflows: (page = {}) => get(`/api/v1/workflows${query(page)}`),
4205
+ /** `project` narrows to the workflows an issue in that project can use. */
4206
+ listWorkflows: (params = {}) => get(`/api/v1/workflows${query(params)}`),
4206
4207
  createWorkflow: (body) => request("POST", "/api/v1/workflows", body),
4207
4208
  getWorkflow: (id2) => get(`/api/v1/workflows/${id2}`),
4208
4209
  updateWorkflow: (id2, body) => request("PATCH", `/api/v1/workflows/${id2}`, body),
@@ -6422,8 +6423,11 @@ async function resolveProject(api, ref) {
6422
6423
  const have = items.map((p) => p.archived_at ? `${p.name} (archived)` : p.name).join(", ");
6423
6424
  die(`no project named "${ref}" (have: ${have || "none"})`);
6424
6425
  }
6425
- async function resolveWorkflow(api, ref) {
6426
- return pickWorkflow((await api.listWorkflows()).items, ref);
6426
+ async function resolveWorkflow(api, ref, projectId) {
6427
+ return pickWorkflow(
6428
+ (await api.listWorkflows(projectId ? { project: projectId } : {})).items,
6429
+ ref
6430
+ );
6427
6431
  }
6428
6432
  function pickWorkflow(items, ref) {
6429
6433
  const found = items.find((w) => w.id === ref) ?? (items.filter((w) => w.name === ref).length === 1 ? items.find((w) => w.name === ref) : void 0);
@@ -7648,7 +7652,7 @@ ${comment.body}`
7648
7652
  );
7649
7653
  }
7650
7654
  console.log(
7651
- "\nMembers may comment and take a current awaiting-human transition. Personal permission is chosen in the browser; member execution is unavailable."
7655
+ "\nMembers work on shared issues as the owner does, except adding or removing people. Personal permission is chosen in the browser; member execution is unavailable."
7652
7656
  );
7653
7657
  return;
7654
7658
  }
@@ -7886,7 +7890,7 @@ function register3(program3) {
7886
7890
  const description = opts.description !== void 0 ? readBodyValue(opts.description) : void 0;
7887
7891
  const api = client(opts);
7888
7892
  const project = await resolveProject(api, projectRef2);
7889
- const workflowId = opts.workflow ? (await resolveWorkflow(api, opts.workflow)).id : void 0;
7893
+ const workflowId = opts.workflow ? (await resolveWorkflow(api, opts.workflow, project.id)).id : void 0;
7890
7894
  const recurrence2 = buildRecurrence(opts);
7891
7895
  if (!recurrence2 && (opts.ifClosed !== void 0 || opts.scheduleName !== void 0)) {
7892
7896
  die('--if-closed/--schedule-name need a recurrence: add --every \u2026 or --cron "<expr>"');
@@ -7948,7 +7952,7 @@ function register3(program3) {
7948
7952
  if (description !== void 0) body.description = description;
7949
7953
  if (opts.state !== void 0) body.state = opts.state;
7950
7954
  if (opts.workflow !== void 0)
7951
- body.workflow_id = (await resolveWorkflow(api, opts.workflow)).id;
7955
+ body.workflow_id = (await resolveWorkflow(api, opts.workflow, issue.project_id)).id;
7952
7956
  if (Object.keys(body).length === 0) {
7953
7957
  die("nothing to update: pass --title, --description, --state, and/or --workflow");
7954
7958
  }
@@ -7966,7 +7970,7 @@ function register3(program3) {
7966
7970
  }
7967
7971
  );
7968
7972
  withCommon(
7969
- issues.command("move <ref> <action>").description("Take a current transition (members: awaiting-human only; no permission change)")
7973
+ issues.command("move <ref> <action>").description("Take a current transition (members: no permission change)")
7970
7974
  ).action(async (ref, action2, opts) => {
7971
7975
  const api = client(opts);
7972
7976
  const issue = await resolveIssue(api, ref);
@@ -9285,7 +9289,7 @@ default workflow: ${defaultWorkflow}`);
9285
9289
  if (opts.description !== void 0) body.description = opts.description;
9286
9290
  if (opts.defaultWorkflow === false) body.default_workflow_id = null;
9287
9291
  else if (opts.defaultWorkflow !== void 0) {
9288
- body.default_workflow_id = (await resolveWorkflow(api, opts.defaultWorkflow)).id;
9292
+ body.default_workflow_id = (await resolveWorkflow(api, opts.defaultWorkflow, project.id)).id;
9289
9293
  }
9290
9294
  if (Object.keys(body).length === 0) {
9291
9295
  die("nothing to update: pass --name, --description, or --[no-]default-workflow");
@@ -13031,7 +13035,9 @@ title template: ${shared.title_template}`);
13031
13035
  if (shared.description_template)
13032
13036
  console.log(`description template:
13033
13037
  ${shared.description_template}`);
13034
- console.log("\nThis shared schedule is read only in the current release.");
13038
+ console.log(
13039
+ "\nMembers edit, pause, run and delete shared schedules with `tines schedules` as the owner does."
13040
+ );
13035
13041
  return;
13036
13042
  }
13037
13043
  console.log(`${scheduleRef(s)} [${s.id}]${s.enabled ? "" : " (paused)"}`);
@@ -13143,7 +13149,7 @@ recent instances:`);
13143
13149
  if (opts.title !== void 0) body.title_template = opts.title;
13144
13150
  if (descriptionTemplate !== void 0) body.description_template = descriptionTemplate;
13145
13151
  if (opts.workflow !== void 0)
13146
- body.workflow_id = (await resolveWorkflow(api, opts.workflow)).id;
13152
+ body.workflow_id = (await resolveWorkflow(api, opts.workflow, schedule2.project_id)).id;
13147
13153
  if (opts.state !== void 0) body.state = opts.state;
13148
13154
  const recurrence2 = buildRecurrence(opts);
13149
13155
  if (recurrence2?.preset) body.preset = recurrence2.preset;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tines",
3
- "version": "0.0.290",
3
+ "version": "0.0.291",
4
4
  "description": "CLI for Tines, an orchestration layer for AI agents",
5
5
  "repository": {
6
6
  "type": "git",