@odla-ai/cli 0.30.1 → 0.30.3

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/bin.js CHANGED
@@ -174,7 +174,7 @@ function absoluteEntryPath(entryPath) {
174
174
 
175
175
  // src/bin.ts
176
176
  var argv = process.argv.slice(2);
177
- requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-SZUWA6EF.js")).runCli()).catch((err) => {
177
+ requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-BGSX5Z4C.js")).runCli()).catch((err) => {
178
178
  console.error(redactSecrets(`odla-ai: ${err instanceof Error ? err.message : String(err)}`));
179
179
  process.exitCode = exitCodeFor(err);
180
180
  });
@@ -8789,6 +8789,7 @@ Usage:
8789
8789
  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]
8790
8790
  odla-ai bug report --app <id> --title <t> (--description <text>|--body <text>) [--severity <s>] [--json]
8791
8791
  odla-ai pm <goal|task|decision|bug> get <id> [--json]
8792
+ odla-ai pm <goal|task|decision|bug> link <id> [--json]
8792
8793
  odla-ai pm <goal|task|decision|bug> ref <id> [--json]
8793
8794
  odla-ai pm goal set <id> [--title <t>|--status <s>|--proof <text>|--no-proof|--target <pct>|--no-target] [--mutation-id <id>] [--json]
8794
8795
  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]
@@ -9654,9 +9655,25 @@ function referenceMarkup(entity, record10) {
9654
9655
  const label = (record10.title?.trim() || `${entity} ${record10.id}`).replaceAll("]", ")");
9655
9656
  return `@[${label}](pm:${entity}/${record10.id})`;
9656
9657
  }
9658
+ var STUDIO_SECTION = {
9659
+ goal: "goals",
9660
+ task: "board",
9661
+ decision: "decisions",
9662
+ bug: "bugs"
9663
+ };
9664
+ function studioRecordUrl(ctx, entity, id) {
9665
+ return new URL(
9666
+ `/studio/pm/${STUDIO_SECTION[entity]}/${encodeURIComponent(id)}`,
9667
+ ctx.platformUrl
9668
+ ).href;
9669
+ }
9670
+ function studioRecordLink(ctx, entity, record10) {
9671
+ const label = (record10.title?.trim() || `${entity} ${record10.id}`).replaceAll("]", ")");
9672
+ return `[${label}](${studioRecordUrl(ctx, entity, record10.id)})`;
9673
+ }
9657
9674
  function printRecord(ctx, entity, record10) {
9658
9675
  ctx.out.log(
9659
- `${record10.id} [${statusCol(entity, record10)}] ${record10.appId} ${record10.title ?? ""}`
9676
+ `${record10.id} [${statusCol(entity, record10)}] ${record10.appId} ${studioRecordLink(ctx, entity, record10)}`
9660
9677
  );
9661
9678
  }
9662
9679
  function emit2(ctx, value2, human) {
@@ -9706,7 +9723,8 @@ async function pmAdd(ctx, entity, parsed) {
9706
9723
  input,
9707
9724
  mutationId: writeMutationId2(parsed)
9708
9725
  });
9709
- emit2(ctx, res, () => ctx.out.log(`created ${entity} ${res.id}`));
9726
+ const record10 = { id: res.id, appId, title: String(input.title) };
9727
+ emit2(ctx, res, () => ctx.out.log(`created ${entity}: ${studioRecordLink(ctx, entity, record10)}`));
9710
9728
  }
9711
9729
  async function pmGet(ctx, entity, id) {
9712
9730
  const { record: record10 } = await pmRequest(ctx, "GET", `/${entity}/${encodeURIComponent(id)}`);
@@ -9731,7 +9749,10 @@ async function pmSet(ctx, entity, id, parsed) {
9731
9749
  patch: patch2,
9732
9750
  mutationId: writeMutationId2(parsed)
9733
9751
  });
9734
- emit2(ctx, res, () => ctx.out.log(res.record ? `${res.record.id} [${statusCol(entity, res.record)}] ${res.record.appId} ${res.record.title ?? ""}` : `updated ${entity} ${id}`));
9752
+ emit2(ctx, res, () => {
9753
+ if (!res.record) return ctx.out.log(`updated ${entity} ${id}`);
9754
+ ctx.out.log(`${entity}: ${studioRecordLink(ctx, entity, res.record)} \u2192 ${statusCol(entity, res.record)}`);
9755
+ });
9735
9756
  }
9736
9757
  async function pmDone(ctx, entity, id, parsed) {
9737
9758
  const decisionId = stringOpt(parsed.options.decision);
@@ -9741,7 +9762,11 @@ async function pmDone(ctx, entity, id, parsed) {
9741
9762
  patch: patch2,
9742
9763
  mutationId: writeMutationId2(parsed)
9743
9764
  });
9744
- emit2(ctx, res, () => ctx.out.log(`${entity} ${id} \u2192 done`));
9765
+ emit2(ctx, res, () => {
9766
+ const label = res.record ? studioRecordLink(ctx, entity, res.record) : id;
9767
+ const state2 = res.record ? statusCol(entity, res.record) : "done";
9768
+ ctx.out.log(`${entity}: ${label} \u2192 ${state2}`);
9769
+ });
9745
9770
  }
9746
9771
  async function pmTaskLifecycle(ctx, id, action2, parsed) {
9747
9772
  const rawRevision = stringOpt(parsed.options["expected-revision"]);
@@ -9770,7 +9795,8 @@ async function pmTaskLifecycle(ctx, id, action2, parsed) {
9770
9795
  );
9771
9796
  emit2(ctx, res, () => {
9772
9797
  const state2 = res.record ? statusCol("task", res.record) : action2;
9773
- ctx.out.log(`task ${id} \u2192 ${state2}`);
9798
+ const label = res.record ? studioRecordLink(ctx, "task", res.record) : id;
9799
+ ctx.out.log(`task: ${label} \u2192 ${state2}`);
9774
9800
  });
9775
9801
  }
9776
9802
  async function allRecords(ctx, entity, appId) {
@@ -9867,6 +9893,20 @@ async function pmRemove(ctx, entity, id) {
9867
9893
  ctx.out.log(`deleted ${entity} ${id}`);
9868
9894
  }
9869
9895
 
9896
+ // src/pm-links.ts
9897
+ async function pmLink(ctx, entity, id) {
9898
+ const { record: record10 } = await pmRequest(
9899
+ ctx,
9900
+ "GET",
9901
+ `/${entity}/${encodeURIComponent(id)}`
9902
+ );
9903
+ const url = studioRecordUrl(ctx, entity, record10.id);
9904
+ const markdown = studioRecordLink(ctx, entity, record10);
9905
+ emit2(ctx, { kind: entity, id: record10.id, label: record10.title ?? "", url, markdown }, () => {
9906
+ ctx.out.log(markdown);
9907
+ });
9908
+ }
9909
+
9870
9910
  // src/pm-comments.ts
9871
9911
  async function pmComment(ctx, entity, id, parsed) {
9872
9912
  const body = stringOpt(parsed.options.body);
@@ -10114,6 +10154,7 @@ var ACTION_OPTIONS = {
10114
10154
  ready: ["goal", "alignment-decision", "execution", "description", "desc", "body", "acceptance", "expected-revision", "mutation-id"],
10115
10155
  claim: ["expected-revision", "mutation-id"],
10116
10156
  release: ["expected-revision", "mutation-id"],
10157
+ link: [],
10117
10158
  ref: []
10118
10159
  };
10119
10160
  var ENTITY_OPTIONS = {
@@ -10218,7 +10259,7 @@ async function pmCommand(parsed, deps = {}) {
10218
10259
  if (!entity) throw new Error(`unknown pm entity "${word}". Try "odla-ai pm bug list" (goal|task|decision|bug).`);
10219
10260
  const requestedAction = parsed.positionals[2] ?? "list";
10220
10261
  const action2 = canonicalAction(requestedAction);
10221
- if (!action2) throw new Error(`unknown pm action "${requestedAction}". Try list|add|get|set|done|comment|comments|rm.`);
10262
+ if (!action2) throw new Error(`unknown pm action "${requestedAction}". Try list|add|get|set|done|link|ref|comment|comments|rm.`);
10222
10263
  assertArgs(parsed, allowedOptions(entity, action2), 4);
10223
10264
  if ((action2 === "ready" || action2 === "claim" || action2 === "release") && entity !== "task") {
10224
10265
  throw new Error(`pm ${action2} is only valid for tasks`);
@@ -10242,6 +10283,8 @@ async function pmCommand(parsed, deps = {}) {
10242
10283
  return pmComments(ctx, entity, requireId2(id, action2));
10243
10284
  case "rm":
10244
10285
  return pmRemove(ctx, entity, requireId2(id, action2));
10286
+ case "link":
10287
+ return pmLink(ctx, entity, requireId2(id, action2));
10245
10288
  case "ref":
10246
10289
  return pmReference(ctx, entity, requireId2(id, action2));
10247
10290
  case "ready":
@@ -13194,4 +13237,4 @@ export {
13194
13237
  isTerminalHostedSecurityStatus,
13195
13238
  runCli
13196
13239
  };
13197
- //# sourceMappingURL=chunk-7V7WVTDT.js.map
13240
+ //# sourceMappingURL=chunk-3HFNKDZV.js.map