@sjawhar/opencode-legion-envoy 0.36.2 → 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,8 @@ 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 = {
13577
+ opened_event_id: number2().int().positive(),
13575
13578
  question: string2().optional(),
13576
13579
  options: array(object({ label: string2().optional() })).nullish(),
13577
13580
  answer: object({ selected: array(string2()).nullish(), text: string2().nullish() }).nullish(),
@@ -13581,6 +13584,23 @@ var AskEventPayloadSchema = object({
13581
13584
  actor: object({ kind: string2().optional(), id: string2().optional() }).passthrough().optional(),
13582
13585
  at: string2().optional()
13583
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()
13584
13604
  });
13585
13605
  var CommentEventPayloadSchema = object({
13586
13606
  artifact_name: string2().optional(),
@@ -14619,6 +14639,23 @@ var nativeIssueKeyPattern = /^[A-Z][A-Z0-9]{1,9}-[0-9]+$/;
14619
14639
  var externalIssueRefPattern = /^([^/\s]+)\/([^/\s#]+)#([1-9][0-9]*)$/;
14620
14640
  var bareIssueNumberPattern = /^[1-9][0-9]*$/;
14621
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
+ }
14622
14659
  function canonicalExternalIssueRef(value) {
14623
14660
  const match = value.trim().match(externalIssueRefPattern);
14624
14661
  return match ? `${canonicalRepo(match[1] ?? "", match[2] ?? "")}#${match[3]}` : value;
@@ -14934,11 +14971,7 @@ async function executeDispatchTool(input) {
14934
14971
  throw new Error("resolved ask is missing its resolution");
14935
14972
  return {
14936
14973
  text: `${kind === "retracted" ? "Retracted" : "Resolved"} ask ${ask.id}: ${ask.resolution.reason}`,
14937
- details: {
14938
- issue: ask.issue_key,
14939
- topic: dispatchIssueSubject(ask.issue_key, ">"),
14940
- ask: ask.id
14941
- }
14974
+ details: await askResultDetails(client, ask)
14942
14975
  };
14943
14976
  }
14944
14977
  case "dispatch_ask": {
@@ -14958,11 +14991,7 @@ async function executeDispatchTool(input) {
14958
14991
  });
14959
14992
  return {
14960
14993
  text: `Opened ask ${ask.id}: ${ask.question}`,
14961
- details: {
14962
- issue: ask.issue_key,
14963
- topic: dispatchIssueSubject(ask.issue_key, ">"),
14964
- ask: ask.id
14965
- }
14994
+ details: await askResultDetails(client, ask)
14966
14995
  };
14967
14996
  }
14968
14997
  case "dispatch_comment": {
@@ -15087,7 +15116,7 @@ Open anchored asks/comments: ${marks.join(", ")}`,
15087
15116
  const askRead = await client.getAsk(issueArguments.ref.id);
15088
15117
  return {
15089
15118
  text: askSummary(askRead),
15090
- details: { issue: askRead.ask.issue_key }
15119
+ details: { issue: issueArguments.ref.issue }
15091
15120
  };
15092
15121
  }
15093
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.36.2",
3
+ "version": "0.38.0",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -104,8 +104,8 @@ dispatch_resolve_ask({
104
104
  })
105
105
  ```
106
106
  Use `retracted` when the question is obsolete and `resolved` when you found the answer. Include the
107
- reason because the question remains in its issue log and reply thread. Resolution is not an answer:
108
- it never records a human decision, and an answered ask cannot be resolved.
107
+ reason because the question remains in its Conversation card and reply thread. Resolution is not an
108
+ answer: it never records a human decision, and an answered ask cannot be resolved.
109
109
 
110
110
  An ask is a thread, not a dead end: a human can reply to it before or after answering, and you
111
111
  (the asker) can reply too — e.g. acknowledging a clarifying question, or following up after the
@@ -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