@odla-ai/cli 0.30.1 → 0.30.2

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "./chunk-7V7WVTDT.js";
4
+ } from "./chunk-3HFNKDZV.js";
5
5
  import {
6
6
  exitCodeFor
7
7
  } from "./chunk-UKLSRQ5J.js";
@@ -9,4 +9,4 @@ export {
9
9
  exitCodeFor,
10
10
  runCli
11
11
  };
12
- //# sourceMappingURL=cli-SZUWA6EF.js.map
12
+ //# sourceMappingURL=cli-BGSX5Z4C.js.map
package/dist/index.cjs CHANGED
@@ -8919,6 +8919,7 @@ Usage:
8919
8919
  odla-ai pm bug add --app <id> --title <t> (--description <text>|--body <text>) [--status <s>] [--severity <s>] [--goal <id>] [--assignee <id>] [--decision <id>] [--mutation-id <id>] [--json]
8920
8920
  odla-ai bug report --app <id> --title <t> (--description <text>|--body <text>) [--severity <s>] [--json]
8921
8921
  odla-ai pm <goal|task|decision|bug> get <id> [--json]
8922
+ odla-ai pm <goal|task|decision|bug> link <id> [--json]
8922
8923
  odla-ai pm <goal|task|decision|bug> ref <id> [--json]
8923
8924
  odla-ai pm goal set <id> [--title <t>|--status <s>|--proof <text>|--no-proof|--target <pct>|--no-target] [--mutation-id <id>] [--json]
8924
8925
  odla-ai pm task set <id> [--title <t>|--column <backlog|ready|doing|review|done>|--rank <n>|--goal <id>|--no-goal|--alignment-decision <id>|--no-alignment-decision|--execution <human|agent|either>|--assignee <id>|--no-assignee|--description <text>|--body <text>|--acceptance <text>|--no-acceptance|--due <epoch-ms>|--no-due|--expected-revision <n>] [--mutation-id <id>] [--json]
@@ -9784,9 +9785,25 @@ function referenceMarkup(entity, record10) {
9784
9785
  const label = (record10.title?.trim() || `${entity} ${record10.id}`).replaceAll("]", ")");
9785
9786
  return `@[${label}](pm:${entity}/${record10.id})`;
9786
9787
  }
9788
+ var STUDIO_SECTION = {
9789
+ goal: "goals",
9790
+ task: "board",
9791
+ decision: "decisions",
9792
+ bug: "bugs"
9793
+ };
9794
+ function studioRecordUrl(ctx, entity, id) {
9795
+ return new URL(
9796
+ `/studio/pm/${STUDIO_SECTION[entity]}/${encodeURIComponent(id)}`,
9797
+ ctx.platformUrl
9798
+ ).href;
9799
+ }
9800
+ function studioRecordLink(ctx, entity, record10) {
9801
+ const label = (record10.title?.trim() || `${entity} ${record10.id}`).replaceAll("]", ")");
9802
+ return `[${label}](${studioRecordUrl(ctx, entity, record10.id)})`;
9803
+ }
9787
9804
  function printRecord(ctx, entity, record10) {
9788
9805
  ctx.out.log(
9789
- `${record10.id} [${statusCol(entity, record10)}] ${record10.appId} ${record10.title ?? ""}`
9806
+ `${record10.id} [${statusCol(entity, record10)}] ${record10.appId} ${studioRecordLink(ctx, entity, record10)}`
9790
9807
  );
9791
9808
  }
9792
9809
  function emit2(ctx, value2, human) {
@@ -9836,7 +9853,8 @@ async function pmAdd(ctx, entity, parsed) {
9836
9853
  input,
9837
9854
  mutationId: writeMutationId2(parsed)
9838
9855
  });
9839
- emit2(ctx, res, () => ctx.out.log(`created ${entity} ${res.id}`));
9856
+ const record10 = { id: res.id, appId, title: String(input.title) };
9857
+ emit2(ctx, res, () => ctx.out.log(`created ${entity}: ${studioRecordLink(ctx, entity, record10)}`));
9840
9858
  }
9841
9859
  async function pmGet(ctx, entity, id) {
9842
9860
  const { record: record10 } = await pmRequest(ctx, "GET", `/${entity}/${encodeURIComponent(id)}`);
@@ -9861,7 +9879,10 @@ async function pmSet(ctx, entity, id, parsed) {
9861
9879
  patch: patch2,
9862
9880
  mutationId: writeMutationId2(parsed)
9863
9881
  });
9864
- emit2(ctx, res, () => ctx.out.log(res.record ? `${res.record.id} [${statusCol(entity, res.record)}] ${res.record.appId} ${res.record.title ?? ""}` : `updated ${entity} ${id}`));
9882
+ emit2(ctx, res, () => {
9883
+ if (!res.record) return ctx.out.log(`updated ${entity} ${id}`);
9884
+ ctx.out.log(`${entity}: ${studioRecordLink(ctx, entity, res.record)} \u2192 ${statusCol(entity, res.record)}`);
9885
+ });
9865
9886
  }
9866
9887
  async function pmDone(ctx, entity, id, parsed) {
9867
9888
  const decisionId = stringOpt(parsed.options.decision);
@@ -9871,7 +9892,11 @@ async function pmDone(ctx, entity, id, parsed) {
9871
9892
  patch: patch2,
9872
9893
  mutationId: writeMutationId2(parsed)
9873
9894
  });
9874
- emit2(ctx, res, () => ctx.out.log(`${entity} ${id} \u2192 done`));
9895
+ emit2(ctx, res, () => {
9896
+ const label = res.record ? studioRecordLink(ctx, entity, res.record) : id;
9897
+ const state2 = res.record ? statusCol(entity, res.record) : "done";
9898
+ ctx.out.log(`${entity}: ${label} \u2192 ${state2}`);
9899
+ });
9875
9900
  }
9876
9901
  async function pmTaskLifecycle(ctx, id, action2, parsed) {
9877
9902
  const rawRevision = stringOpt(parsed.options["expected-revision"]);
@@ -9900,7 +9925,8 @@ async function pmTaskLifecycle(ctx, id, action2, parsed) {
9900
9925
  );
9901
9926
  emit2(ctx, res, () => {
9902
9927
  const state2 = res.record ? statusCol("task", res.record) : action2;
9903
- ctx.out.log(`task ${id} \u2192 ${state2}`);
9928
+ const label = res.record ? studioRecordLink(ctx, "task", res.record) : id;
9929
+ ctx.out.log(`task: ${label} \u2192 ${state2}`);
9904
9930
  });
9905
9931
  }
9906
9932
  async function allRecords(ctx, entity, appId) {
@@ -9997,6 +10023,20 @@ async function pmRemove(ctx, entity, id) {
9997
10023
  ctx.out.log(`deleted ${entity} ${id}`);
9998
10024
  }
9999
10025
 
10026
+ // src/pm-links.ts
10027
+ async function pmLink(ctx, entity, id) {
10028
+ const { record: record10 } = await pmRequest(
10029
+ ctx,
10030
+ "GET",
10031
+ `/${entity}/${encodeURIComponent(id)}`
10032
+ );
10033
+ const url = studioRecordUrl(ctx, entity, record10.id);
10034
+ const markdown = studioRecordLink(ctx, entity, record10);
10035
+ emit2(ctx, { kind: entity, id: record10.id, label: record10.title ?? "", url, markdown }, () => {
10036
+ ctx.out.log(markdown);
10037
+ });
10038
+ }
10039
+
10000
10040
  // src/pm-comments.ts
10001
10041
  async function pmComment(ctx, entity, id, parsed) {
10002
10042
  const body = stringOpt(parsed.options.body);
@@ -10244,6 +10284,7 @@ var ACTION_OPTIONS = {
10244
10284
  ready: ["goal", "alignment-decision", "execution", "description", "desc", "body", "acceptance", "expected-revision", "mutation-id"],
10245
10285
  claim: ["expected-revision", "mutation-id"],
10246
10286
  release: ["expected-revision", "mutation-id"],
10287
+ link: [],
10247
10288
  ref: []
10248
10289
  };
10249
10290
  var ENTITY_OPTIONS = {
@@ -10348,7 +10389,7 @@ async function pmCommand(parsed, deps = {}) {
10348
10389
  if (!entity) throw new Error(`unknown pm entity "${word}". Try "odla-ai pm bug list" (goal|task|decision|bug).`);
10349
10390
  const requestedAction = parsed.positionals[2] ?? "list";
10350
10391
  const action2 = canonicalAction(requestedAction);
10351
- if (!action2) throw new Error(`unknown pm action "${requestedAction}". Try list|add|get|set|done|comment|comments|rm.`);
10392
+ if (!action2) throw new Error(`unknown pm action "${requestedAction}". Try list|add|get|set|done|link|ref|comment|comments|rm.`);
10352
10393
  assertArgs(parsed, allowedOptions(entity, action2), 4);
10353
10394
  if ((action2 === "ready" || action2 === "claim" || action2 === "release") && entity !== "task") {
10354
10395
  throw new Error(`pm ${action2} is only valid for tasks`);
@@ -10372,6 +10413,8 @@ async function pmCommand(parsed, deps = {}) {
10372
10413
  return pmComments(ctx, entity, requireId2(id, action2));
10373
10414
  case "rm":
10374
10415
  return pmRemove(ctx, entity, requireId2(id, action2));
10416
+ case "link":
10417
+ return pmLink(ctx, entity, requireId2(id, action2));
10375
10418
  case "ref":
10376
10419
  return pmReference(ctx, entity, requireId2(id, action2));
10377
10420
  case "ready":