@sjawhar/pi-legion-envoy 0.18.2 → 0.19.0

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
@@ -29713,7 +29713,6 @@ var dispatchToolSpecs = [
29713
29713
  description: z.string().describe("Optional option context.").optional()
29714
29714
  }), { max: 8 }).describe("Optional choices, at most 8.").optional(),
29715
29715
  multiple: z.boolean().describe("Whether multiple choices may be selected.").optional(),
29716
- custom: z.boolean().describe("Whether a free-text answer is allowed.").optional(),
29717
29716
  urgency: z.enum(ASK_URGENCIES).describe("Optional decision urgency.").optional(),
29718
29717
  anchor: z.object({
29719
29718
  artifact: z.string().describe("Artifact slug or id containing the quoted text."),
@@ -31341,14 +31340,18 @@ function askUrgency(args) {
31341
31340
  return ASK_URGENCIES.find((urgency) => urgency === value);
31342
31341
  }
31343
31342
  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\/([^/]+))?$/);
31343
+ 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
31344
  if (!match)
31346
31345
  return null;
31347
- const [, issue, spec, artifact, version, ask, comment] = match;
31346
+ const [, issue, spec, log, children, artifact, version, ask, comment] = match;
31348
31347
  if (!issue || version !== undefined && Number(version) < 1)
31349
31348
  return null;
31350
31349
  if (spec)
31351
31350
  return { issue, kind: "spec", id: spec };
31351
+ if (log)
31352
+ return { issue, kind: "log", id: log };
31353
+ if (children)
31354
+ return { issue, kind: "children", id: children };
31352
31355
  if (artifact) {
31353
31356
  return {
31354
31357
  issue,
@@ -31444,6 +31447,22 @@ function issueSummary(issue, events) {
31444
31447
  ].join(`
31445
31448
  `);
31446
31449
  }
31450
+ function logSummary(issue, events) {
31451
+ return [
31452
+ `Key: ${issue.key}`,
31453
+ "Events:",
31454
+ ...events.length === 0 ? ["- none"] : events.map((event) => `- #${event.seq} ${event.type} \xB7 ${event.actor.kind} ${event.actor.id} \xB7 ${event.created_at}`)
31455
+ ].join(`
31456
+ `);
31457
+ }
31458
+ function childrenSummary(issue) {
31459
+ return [
31460
+ `Key: ${issue.key}`,
31461
+ "Children:",
31462
+ ...issue.children.length === 0 ? ["- none"] : issue.children.map((child) => `- ${child.key}: ${child.title} (${child.status})`)
31463
+ ].join(`
31464
+ `);
31465
+ }
31447
31466
  function askSummary(ask) {
31448
31467
  const answer = ask.answer;
31449
31468
  return [
@@ -31528,14 +31547,12 @@ async function executeDispatchTool(input) {
31528
31547
  const resolved = anchorArgs ? await resolveArtifact(client, issue(), stringArg(anchorArgs, "artifact")) : undefined;
31529
31548
  const options = args.options;
31530
31549
  const multiple = optionalBoolean(args, "multiple");
31531
- const custom = optionalBoolean(args, "custom");
31532
31550
  const urgency = askUrgency(args);
31533
31551
  const anchored = anchorArgs && resolved ? anchor(resolved.artifact, anchorArgs) : undefined;
31534
31552
  const ask = await client.ask(issue(), {
31535
31553
  question: stringArg(args, "question"),
31536
31554
  ...Array.isArray(options) ? { options } : {},
31537
31555
  ...multiple === undefined ? {} : { multiple },
31538
- ...custom === undefined ? {} : { custom },
31539
31556
  ...urgency === undefined ? {} : { urgency },
31540
31557
  ...anchored === undefined ? {} : { anchor: anchored },
31541
31558
  actor
@@ -31671,6 +31688,18 @@ Open anchored asks/comments: ${marks.join(", ")}`,
31671
31688
  };
31672
31689
  }
31673
31690
  const read = await client.read(issue());
31691
+ if (issueArguments.ref?.kind === "log") {
31692
+ return {
31693
+ text: logSummary(read.issue, read.events),
31694
+ details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
31695
+ };
31696
+ }
31697
+ if (issueArguments.ref?.kind === "children") {
31698
+ return {
31699
+ text: childrenSummary(read.issue),
31700
+ details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
31701
+ };
31702
+ }
31674
31703
  return {
31675
31704
  text: issueSummary(read.issue, read.events),
31676
31705
  details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
package/dist/legion.js CHANGED
@@ -29711,7 +29711,6 @@ var dispatchToolSpecs = [
29711
29711
  description: z.string().describe("Optional option context.").optional()
29712
29712
  }), { max: 8 }).describe("Optional choices, at most 8.").optional(),
29713
29713
  multiple: z.boolean().describe("Whether multiple choices may be selected.").optional(),
29714
- custom: z.boolean().describe("Whether a free-text answer is allowed.").optional(),
29715
29714
  urgency: z.enum(ASK_URGENCIES).describe("Optional decision urgency.").optional(),
29716
29715
  anchor: z.object({
29717
29716
  artifact: z.string().describe("Artifact slug or id containing the quoted text."),
@@ -31826,14 +31825,18 @@ function askUrgency(args) {
31826
31825
  return ASK_URGENCIES.find((urgency) => urgency === value);
31827
31826
  }
31828
31827
  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\/([^/]+))?$/);
31828
+ 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
31829
  if (!match)
31831
31830
  return null;
31832
- const [, issue, spec, artifact, version, ask, comment] = match;
31831
+ const [, issue, spec, log, children, artifact, version, ask, comment] = match;
31833
31832
  if (!issue || version !== undefined && Number(version) < 1)
31834
31833
  return null;
31835
31834
  if (spec)
31836
31835
  return { issue, kind: "spec", id: spec };
31836
+ if (log)
31837
+ return { issue, kind: "log", id: log };
31838
+ if (children)
31839
+ return { issue, kind: "children", id: children };
31837
31840
  if (artifact) {
31838
31841
  return {
31839
31842
  issue,
@@ -31929,6 +31932,22 @@ function issueSummary(issue, events) {
31929
31932
  ].join(`
31930
31933
  `);
31931
31934
  }
31935
+ function logSummary(issue, events) {
31936
+ return [
31937
+ `Key: ${issue.key}`,
31938
+ "Events:",
31939
+ ...events.length === 0 ? ["- none"] : events.map((event) => `- #${event.seq} ${event.type} \xB7 ${event.actor.kind} ${event.actor.id} \xB7 ${event.created_at}`)
31940
+ ].join(`
31941
+ `);
31942
+ }
31943
+ function childrenSummary(issue) {
31944
+ return [
31945
+ `Key: ${issue.key}`,
31946
+ "Children:",
31947
+ ...issue.children.length === 0 ? ["- none"] : issue.children.map((child) => `- ${child.key}: ${child.title} (${child.status})`)
31948
+ ].join(`
31949
+ `);
31950
+ }
31932
31951
  function askSummary(ask) {
31933
31952
  const answer = ask.answer;
31934
31953
  return [
@@ -32013,14 +32032,12 @@ async function executeDispatchTool(input) {
32013
32032
  const resolved = anchorArgs ? await resolveArtifact(client, issue(), stringArg(anchorArgs, "artifact")) : undefined;
32014
32033
  const options = args.options;
32015
32034
  const multiple = optionalBoolean(args, "multiple");
32016
- const custom = optionalBoolean(args, "custom");
32017
32035
  const urgency = askUrgency(args);
32018
32036
  const anchored = anchorArgs && resolved ? anchor(resolved.artifact, anchorArgs) : undefined;
32019
32037
  const ask = await client.ask(issue(), {
32020
32038
  question: stringArg(args, "question"),
32021
32039
  ...Array.isArray(options) ? { options } : {},
32022
32040
  ...multiple === undefined ? {} : { multiple },
32023
- ...custom === undefined ? {} : { custom },
32024
32041
  ...urgency === undefined ? {} : { urgency },
32025
32042
  ...anchored === undefined ? {} : { anchor: anchored },
32026
32043
  actor
@@ -32156,6 +32173,18 @@ Open anchored asks/comments: ${marks.join(", ")}`,
32156
32173
  };
32157
32174
  }
32158
32175
  const read = await client.read(issue());
32176
+ if (issueArguments.ref?.kind === "log") {
32177
+ return {
32178
+ text: logSummary(read.issue, read.events),
32179
+ details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
32180
+ };
32181
+ }
32182
+ if (issueArguments.ref?.kind === "children") {
32183
+ return {
32184
+ text: childrenSummary(read.issue),
32185
+ details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
32186
+ };
32187
+ }
32159
32188
  return {
32160
32189
  text: issueSummary(read.issue, read.events),
32161
32190
  details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
@@ -36,7 +36,6 @@ dispatch_ask({
36
36
  question,
37
37
  options?: { label, description? }[],
38
38
  multiple?,
39
- custom?,
40
39
  urgency?,
41
40
  anchor?: { artifact, quote, occurrence? },
42
41
  })
@@ -191,7 +190,6 @@ dispatch_ask({
191
190
  description: "Narrows the release but requires another deployment test.",
192
191
  },
193
192
  ],
194
- custom: false,
195
193
  urgency: "high",
196
194
  anchor: {
197
195
  artifact: "spec",
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.19.0",
4
4
  "type": "module",
5
5
  "omp": {
6
6
  "extensions": [