@sjawhar/opencode-legion-envoy 0.20.1 → 0.21.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.
@@ -13616,7 +13616,6 @@ var dispatchToolSpecs = [
13616
13616
  description: z.string().describe("Optional option context.").optional()
13617
13617
  }), { max: 8 }).describe("Optional choices, at most 8.").optional(),
13618
13618
  multiple: z.boolean().describe("Whether multiple choices may be selected.").optional(),
13619
- custom: z.boolean().describe("Whether a free-text answer is allowed.").optional(),
13620
13619
  urgency: z.enum(ASK_URGENCIES).describe("Optional decision urgency.").optional(),
13621
13620
  anchor: z.object({
13622
13621
  artifact: z.string().describe("Artifact slug or id containing the quoted text."),
@@ -14515,14 +14514,18 @@ function askUrgency(args) {
14515
14514
  return ASK_URGENCIES.find((urgency) => urgency === value);
14516
14515
  }
14517
14516
  function parseDispatchRef(ref) {
14518
- const match = ref.match(/^dispatch:\/\/([A-Z][A-Z0-9]{1,9}-[1-9][0-9]*)(?:\/(spec)|\/artifact\/([^/@]+)(?:@v(\d+))?|\/ask\/([^/]+)|\/comment\/([^/]+))?$/);
14517
+ const match = ref.match(/^dispatch:\/\/([A-Z][A-Z0-9]{1,9}-[1-9][0-9]*)(?:\/(spec)|\/(log)|\/(children)|\/artifact\/([^/@]+)(?:@v(\d+))?|\/ask\/([^/]+)|\/comment\/([^/]+))?$/);
14519
14518
  if (!match)
14520
14519
  return null;
14521
- const [, issue, spec, artifact, version, ask, comment] = match;
14520
+ const [, issue, spec, log, children, artifact, version, ask, comment] = match;
14522
14521
  if (!issue || version !== undefined && Number(version) < 1)
14523
14522
  return null;
14524
14523
  if (spec)
14525
14524
  return { issue, kind: "spec", id: spec };
14525
+ if (log)
14526
+ return { issue, kind: "log", id: log };
14527
+ if (children)
14528
+ return { issue, kind: "children", id: children };
14526
14529
  if (artifact) {
14527
14530
  return {
14528
14531
  issue,
@@ -14618,6 +14621,22 @@ function issueSummary(issue, events) {
14618
14621
  ].join(`
14619
14622
  `);
14620
14623
  }
14624
+ function logSummary(issue, events) {
14625
+ return [
14626
+ `Key: ${issue.key}`,
14627
+ "Events:",
14628
+ ...events.length === 0 ? ["- none"] : events.map((event) => `- #${event.seq} ${event.type} \xB7 ${event.actor.kind} ${event.actor.id} \xB7 ${event.created_at}`)
14629
+ ].join(`
14630
+ `);
14631
+ }
14632
+ function childrenSummary(issue) {
14633
+ return [
14634
+ `Key: ${issue.key}`,
14635
+ "Children:",
14636
+ ...issue.children.length === 0 ? ["- none"] : issue.children.map((child) => `- ${child.key}: ${child.title} (${child.status})`)
14637
+ ].join(`
14638
+ `);
14639
+ }
14621
14640
  function askSummary(ask) {
14622
14641
  const answer = ask.answer;
14623
14642
  return [
@@ -14702,14 +14721,12 @@ async function executeDispatchTool(input) {
14702
14721
  const resolved = anchorArgs ? await resolveArtifact(client, issue(), stringArg(anchorArgs, "artifact")) : undefined;
14703
14722
  const options = args.options;
14704
14723
  const multiple = optionalBoolean(args, "multiple");
14705
- const custom = optionalBoolean(args, "custom");
14706
14724
  const urgency = askUrgency(args);
14707
14725
  const anchored = anchorArgs && resolved ? anchor(resolved.artifact, anchorArgs) : undefined;
14708
14726
  const ask = await client.ask(issue(), {
14709
14727
  question: stringArg(args, "question"),
14710
14728
  ...Array.isArray(options) ? { options } : {},
14711
14729
  ...multiple === undefined ? {} : { multiple },
14712
- ...custom === undefined ? {} : { custom },
14713
14730
  ...urgency === undefined ? {} : { urgency },
14714
14731
  ...anchored === undefined ? {} : { anchor: anchored },
14715
14732
  actor
@@ -14845,6 +14862,18 @@ Open anchored asks/comments: ${marks.join(", ")}`,
14845
14862
  };
14846
14863
  }
14847
14864
  const read = await client.read(issue());
14865
+ if (issueArguments.ref?.kind === "log") {
14866
+ return {
14867
+ text: logSummary(read.issue, read.events),
14868
+ details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
14869
+ };
14870
+ }
14871
+ if (issueArguments.ref?.kind === "children") {
14872
+ return {
14873
+ text: childrenSummary(read.issue),
14874
+ details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
14875
+ };
14876
+ }
14848
14877
  return {
14849
14878
  text: issueSummary(read.issue, read.events),
14850
14879
  details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "0.20.1",
3
+ "version": "0.21.0",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -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",