@sjawhar/opencode-legion-envoy 0.37.0 → 0.38.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.
@@ -13553,7 +13553,9 @@ function date4(params) {
13553
13553
  config(en_default());
13554
13554
  // ../contracts/src/dispatch-api.ts
13555
13555
  var DispatchEventSchema = object({
13556
- issue_key: string2(),
13556
+ issue_key: string2().nullable(),
13557
+ artifact_id: string2().nullish(),
13558
+ project: string2().optional(),
13557
13559
  type: string2(),
13558
13560
  actor: object({ kind: string2(), id: string2().optional() }).passthrough(),
13559
13561
  payload: object({}).passthrough()
@@ -13571,7 +13573,7 @@ var ArtifactVersionEventPayloadSchema = object({
13571
13573
  version: object({ number: number2().optional(), summary: string2().nullish() }).optional(),
13572
13574
  diff: string2().optional()
13573
13575
  });
13574
- var AskEventPayloadSchema = object({
13576
+ var askEventPayloadFields = {
13575
13577
  opened_event_id: number2().int().positive(),
13576
13578
  question: string2().optional(),
13577
13579
  options: array(object({ label: string2().optional() })).nullish(),
@@ -13582,6 +13584,23 @@ var AskEventPayloadSchema = object({
13582
13584
  actor: object({ kind: string2().optional(), id: string2().optional() }).passthrough().optional(),
13583
13585
  at: string2().optional()
13584
13586
  }).nullish()
13587
+ };
13588
+ var AskEventPayloadSchema = intersection(object(askEventPayloadFields), object({
13589
+ previous: never().optional(),
13590
+ edited_by: never().optional()
13591
+ }));
13592
+ var AskEditedEventPayloadSchema = object({
13593
+ ...askEventPayloadFields,
13594
+ multiple: boolean2(),
13595
+ urgency: string2(),
13596
+ edited_at: string2().nullish(),
13597
+ previous: object({
13598
+ question: string2(),
13599
+ options: array(object({ label: string2().optional() })),
13600
+ multiple: boolean2(),
13601
+ urgency: string2()
13602
+ }),
13603
+ edited_by: object({ kind: string2(), id: string2() }).passthrough()
13585
13604
  });
13586
13605
  var CommentEventPayloadSchema = object({
13587
13606
  artifact_name: string2().optional(),
@@ -14620,6 +14639,23 @@ var nativeIssueKeyPattern = /^[A-Z][A-Z0-9]{1,9}-[0-9]+$/;
14620
14639
  var externalIssueRefPattern = /^([^/\s]+)\/([^/\s#]+)#([1-9][0-9]*)$/;
14621
14640
  var bareIssueNumberPattern = /^[1-9][0-9]*$/;
14622
14641
  var issueFreeTools = new Set(["dispatch_issue", "dispatch_resolve_ask", "dispatch_search"]);
14642
+ async function askResultDetails(client, ask) {
14643
+ if (ask.issue_key !== null) {
14644
+ return {
14645
+ issue: ask.issue_key,
14646
+ topic: dispatchIssueSubject(ask.issue_key, ">"),
14647
+ ask: ask.id
14648
+ };
14649
+ }
14650
+ if (ask.artifact_id === undefined || ask.artifact_id === null) {
14651
+ throw new Error("document ask is missing its artifact ID");
14652
+ }
14653
+ const artifact = await client.getArtifact(ask.artifact_id);
14654
+ return {
14655
+ topic: `notifications.dispatch.document.${artifact.project}.${artifact.slug}.>`,
14656
+ ask: ask.id
14657
+ };
14658
+ }
14623
14659
  function canonicalExternalIssueRef(value) {
14624
14660
  const match = value.trim().match(externalIssueRefPattern);
14625
14661
  return match ? `${canonicalRepo(match[1] ?? "", match[2] ?? "")}#${match[3]}` : value;
@@ -14935,11 +14971,7 @@ async function executeDispatchTool(input) {
14935
14971
  throw new Error("resolved ask is missing its resolution");
14936
14972
  return {
14937
14973
  text: `${kind === "retracted" ? "Retracted" : "Resolved"} ask ${ask.id}: ${ask.resolution.reason}`,
14938
- details: {
14939
- issue: ask.issue_key,
14940
- topic: dispatchIssueSubject(ask.issue_key, ">"),
14941
- ask: ask.id
14942
- }
14974
+ details: await askResultDetails(client, ask)
14943
14975
  };
14944
14976
  }
14945
14977
  case "dispatch_ask": {
@@ -14959,11 +14991,7 @@ async function executeDispatchTool(input) {
14959
14991
  });
14960
14992
  return {
14961
14993
  text: `Opened ask ${ask.id}: ${ask.question}`,
14962
- details: {
14963
- issue: ask.issue_key,
14964
- topic: dispatchIssueSubject(ask.issue_key, ">"),
14965
- ask: ask.id
14966
- }
14994
+ details: await askResultDetails(client, ask)
14967
14995
  };
14968
14996
  }
14969
14997
  case "dispatch_comment": {
@@ -15088,7 +15116,7 @@ Open anchored asks/comments: ${marks.join(", ")}`,
15088
15116
  const askRead = await client.getAsk(issueArguments.ref.id);
15089
15117
  return {
15090
15118
  text: askSummary(askRead),
15091
- details: { issue: askRead.ask.issue_key }
15119
+ details: { issue: issueArguments.ref.issue }
15092
15120
  };
15093
15121
  }
15094
15122
  if (issueArguments.ref?.kind === "comment") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "0.37.0",
3
+ "version": "0.38.0",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -141,11 +141,16 @@ type EditOp = {
141
141
  };
142
142
  ```
143
143
 
144
- Target edits by quote: `replace` requires `find` and `with`; `delete` requires `find`; `insert`
145
- requires `markdown` and exactly one of `after` or `before`. An insert anchor is a quote,
146
- `"start"`, `"end"`, or `"heading:Title"`. Use zero-based `occurrence` for a repeated `find`.
147
- When a decision lands, pass `summary` to name the resulting version. Never paste progress into a
148
- message.
144
+ Target `replace` and `delete` by the document's plain text: inline-code and link text match
145
+ without Markdown syntax, and a table-cell anchor is its cell text. `replace` requires `find` and
146
+ `with`; `delete` requires `find`; `insert` requires `markdown` and exactly one of `after` or
147
+ `before`. An insert anchor is a quote, `"start"`, `"end"`, or `"heading:Title"`. Every insert
148
+ creates a sibling block before or after the quote or heading's enclosing document block; `"start"`
149
+ and `"end"` select the document edges. At a table-cell quote, pipe-table body-row fragments extend
150
+ that table before or after the matched row; omit table header and delimiter rows, and do not exceed
151
+ the table width. Use `replace` for inline continuation. Use zero-based `occurrence` for a repeated
152
+ target. When a decision lands, pass `summary` to name the resulting version. Never paste progress
153
+ into a message.
149
154
 
150
155
  ## Comments and suggestions
151
156