@sjawhar/pi-legion-envoy 0.18.2 → 0.18.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/envoy.js CHANGED
@@ -31341,14 +31341,18 @@ function askUrgency(args) {
31341
31341
  return ASK_URGENCIES.find((urgency) => urgency === value);
31342
31342
  }
31343
31343
  function parseDispatchRef(ref) {
31344
- const match = ref.match(/^dispatch:\/\/([A-Z][A-Z0-9]{1,9}-[1-9][0-9]*)(?:\/(spec)|\/artifact\/([^/@]+)(?:@v(\d+))?|\/ask\/([^/]+)|\/comment\/([^/]+))?$/);
31344
+ const match = ref.match(/^dispatch:\/\/([A-Z][A-Z0-9]{1,9}-[1-9][0-9]*)(?:\/(spec)|\/(log)|\/(children)|\/artifact\/([^/@]+)(?:@v(\d+))?|\/ask\/([^/]+)|\/comment\/([^/]+))?$/);
31345
31345
  if (!match)
31346
31346
  return null;
31347
- const [, issue, spec, artifact, version, ask, comment] = match;
31347
+ const [, issue, spec, log, children, artifact, version, ask, comment] = match;
31348
31348
  if (!issue || version !== undefined && Number(version) < 1)
31349
31349
  return null;
31350
31350
  if (spec)
31351
31351
  return { issue, kind: "spec", id: spec };
31352
+ if (log)
31353
+ return { issue, kind: "log", id: log };
31354
+ if (children)
31355
+ return { issue, kind: "children", id: children };
31352
31356
  if (artifact) {
31353
31357
  return {
31354
31358
  issue,
@@ -31444,6 +31448,22 @@ function issueSummary(issue, events) {
31444
31448
  ].join(`
31445
31449
  `);
31446
31450
  }
31451
+ function logSummary(issue, events) {
31452
+ return [
31453
+ `Key: ${issue.key}`,
31454
+ "Events:",
31455
+ ...events.length === 0 ? ["- none"] : events.map((event) => `- #${event.seq} ${event.type} \xB7 ${event.actor.kind} ${event.actor.id} \xB7 ${event.created_at}`)
31456
+ ].join(`
31457
+ `);
31458
+ }
31459
+ function childrenSummary(issue) {
31460
+ return [
31461
+ `Key: ${issue.key}`,
31462
+ "Children:",
31463
+ ...issue.children.length === 0 ? ["- none"] : issue.children.map((child) => `- ${child.key}: ${child.title} (${child.status})`)
31464
+ ].join(`
31465
+ `);
31466
+ }
31447
31467
  function askSummary(ask) {
31448
31468
  const answer = ask.answer;
31449
31469
  return [
@@ -31671,6 +31691,18 @@ Open anchored asks/comments: ${marks.join(", ")}`,
31671
31691
  };
31672
31692
  }
31673
31693
  const read = await client.read(issue());
31694
+ if (issueArguments.ref?.kind === "log") {
31695
+ return {
31696
+ text: logSummary(read.issue, read.events),
31697
+ details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
31698
+ };
31699
+ }
31700
+ if (issueArguments.ref?.kind === "children") {
31701
+ return {
31702
+ text: childrenSummary(read.issue),
31703
+ details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
31704
+ };
31705
+ }
31674
31706
  return {
31675
31707
  text: issueSummary(read.issue, read.events),
31676
31708
  details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
package/dist/legion.js CHANGED
@@ -31826,14 +31826,18 @@ function askUrgency(args) {
31826
31826
  return ASK_URGENCIES.find((urgency) => urgency === value);
31827
31827
  }
31828
31828
  function parseDispatchRef(ref) {
31829
- const match = ref.match(/^dispatch:\/\/([A-Z][A-Z0-9]{1,9}-[1-9][0-9]*)(?:\/(spec)|\/artifact\/([^/@]+)(?:@v(\d+))?|\/ask\/([^/]+)|\/comment\/([^/]+))?$/);
31829
+ const match = ref.match(/^dispatch:\/\/([A-Z][A-Z0-9]{1,9}-[1-9][0-9]*)(?:\/(spec)|\/(log)|\/(children)|\/artifact\/([^/@]+)(?:@v(\d+))?|\/ask\/([^/]+)|\/comment\/([^/]+))?$/);
31830
31830
  if (!match)
31831
31831
  return null;
31832
- const [, issue, spec, artifact, version, ask, comment] = match;
31832
+ const [, issue, spec, log, children, artifact, version, ask, comment] = match;
31833
31833
  if (!issue || version !== undefined && Number(version) < 1)
31834
31834
  return null;
31835
31835
  if (spec)
31836
31836
  return { issue, kind: "spec", id: spec };
31837
+ if (log)
31838
+ return { issue, kind: "log", id: log };
31839
+ if (children)
31840
+ return { issue, kind: "children", id: children };
31837
31841
  if (artifact) {
31838
31842
  return {
31839
31843
  issue,
@@ -31929,6 +31933,22 @@ function issueSummary(issue, events) {
31929
31933
  ].join(`
31930
31934
  `);
31931
31935
  }
31936
+ function logSummary(issue, events) {
31937
+ return [
31938
+ `Key: ${issue.key}`,
31939
+ "Events:",
31940
+ ...events.length === 0 ? ["- none"] : events.map((event) => `- #${event.seq} ${event.type} \xB7 ${event.actor.kind} ${event.actor.id} \xB7 ${event.created_at}`)
31941
+ ].join(`
31942
+ `);
31943
+ }
31944
+ function childrenSummary(issue) {
31945
+ return [
31946
+ `Key: ${issue.key}`,
31947
+ "Children:",
31948
+ ...issue.children.length === 0 ? ["- none"] : issue.children.map((child) => `- ${child.key}: ${child.title} (${child.status})`)
31949
+ ].join(`
31950
+ `);
31951
+ }
31932
31952
  function askSummary(ask) {
31933
31953
  const answer = ask.answer;
31934
31954
  return [
@@ -32156,6 +32176,18 @@ Open anchored asks/comments: ${marks.join(", ")}`,
32156
32176
  };
32157
32177
  }
32158
32178
  const read = await client.read(issue());
32179
+ if (issueArguments.ref?.kind === "log") {
32180
+ return {
32181
+ text: logSummary(read.issue, read.events),
32182
+ details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
32183
+ };
32184
+ }
32185
+ if (issueArguments.ref?.kind === "children") {
32186
+ return {
32187
+ text: childrenSummary(read.issue),
32188
+ details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
32189
+ };
32190
+ }
32159
32191
  return {
32160
32192
  text: issueSummary(read.issue, read.events),
32161
32193
  details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion-envoy",
3
- "version": "0.18.2",
3
+ "version": "0.18.3",
4
4
  "type": "module",
5
5
  "omp": {
6
6
  "extensions": [