@sjawhar/opencode-legion-envoy 0.22.1 → 0.23.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.
@@ -13832,6 +13832,10 @@ var handoffMessageSchema = object({
13832
13832
  });
13833
13833
  // ../contracts/src/subject.ts
13834
13834
  var AGENT_TOPIC_PREFIX = "notifications.agent.";
13835
+ var DISPATCH_ISSUE_TOPIC_PREFIX = "notifications.dispatch.issue.";
13836
+ function dispatchIssueSubject(issueKey, type) {
13837
+ return `${DISPATCH_ISSUE_TOPIC_PREFIX}${issueKey}.${type}`;
13838
+ }
13835
13839
  function agentSubject(session) {
13836
13840
  return `${AGENT_TOPIC_PREFIX}${session}`;
13837
13841
  }
@@ -14510,9 +14514,6 @@ class DispatchClient {
14510
14514
  var nativeIssueKeyPattern = /^[A-Z][A-Z0-9]{1,9}-[0-9]+$/;
14511
14515
  var externalIssueRefPattern = /^([^/\s]+)\/([^/\s#]+)#([1-9][0-9]*)$/;
14512
14516
  var bareIssueNumberPattern = /^[1-9][0-9]*$/;
14513
- function dispatchTopic(issue) {
14514
- return `notifications.dispatch.issue.${issue}.>`;
14515
- }
14516
14517
  function stringArg(args, name) {
14517
14518
  const value = args[name];
14518
14519
  if (typeof value !== "string")
@@ -14735,7 +14736,7 @@ async function executeDispatchTool(input) {
14735
14736
  });
14736
14737
  return {
14737
14738
  text: `Created ${created.key}: ${created.title}`,
14738
- details: { issue: created.key, topic: dispatchTopic(created.key) }
14739
+ details: { issue: created.key, topic: dispatchIssueSubject(created.key, ">") }
14739
14740
  };
14740
14741
  }
14741
14742
  case "dispatch_ask": {
@@ -14755,7 +14756,11 @@ async function executeDispatchTool(input) {
14755
14756
  });
14756
14757
  return {
14757
14758
  text: `Opened ask ${ask.id}: ${ask.question}`,
14758
- details: { issue: ask.issue_key, topic: dispatchTopic(ask.issue_key), ask: ask.id }
14759
+ details: {
14760
+ issue: ask.issue_key,
14761
+ topic: dispatchIssueSubject(ask.issue_key, ">"),
14762
+ ask: ask.id
14763
+ }
14759
14764
  };
14760
14765
  }
14761
14766
  case "dispatch_comment": {
@@ -14776,7 +14781,7 @@ async function executeDispatchTool(input) {
14776
14781
  text: `Posted comment ${comment.id}`,
14777
14782
  details: {
14778
14783
  issue: comment.issue_key,
14779
- topic: dispatchTopic(comment.issue_key),
14784
+ topic: dispatchIssueSubject(comment.issue_key, ">"),
14780
14785
  comment: comment.id
14781
14786
  }
14782
14787
  };
@@ -14797,7 +14802,7 @@ async function executeDispatchTool(input) {
14797
14802
  text: `Posted suggestion ${comment.id}`,
14798
14803
  details: {
14799
14804
  issue: comment.issue_key,
14800
- topic: dispatchTopic(comment.issue_key),
14805
+ topic: dispatchIssueSubject(comment.issue_key, ">"),
14801
14806
  comment: comment.id
14802
14807
  }
14803
14808
  };
@@ -14808,7 +14813,7 @@ async function executeDispatchTool(input) {
14808
14813
  text: `Posted message ${message.id}`,
14809
14814
  details: {
14810
14815
  issue: message.issue_key,
14811
- topic: dispatchTopic(message.issue_key),
14816
+ topic: dispatchIssueSubject(message.issue_key, ">"),
14812
14817
  message: message.id
14813
14818
  }
14814
14819
  };
@@ -14826,7 +14831,7 @@ async function executeDispatchTool(input) {
14826
14831
  text: edited.version === null ? `Applied ${edited.applied} ops (no new version)` : `Applied ${edited.applied} ops (version ${edited.version.number})`,
14827
14832
  details: {
14828
14833
  issue: resolved.issue.key,
14829
- topic: dispatchTopic(resolved.issue.key),
14834
+ topic: dispatchIssueSubject(resolved.issue.key, ">"),
14830
14835
  applied: edited.applied,
14831
14836
  ...edited.version === null ? {} : { version: edited.version.number }
14832
14837
  }
@@ -14842,7 +14847,10 @@ async function executeDispatchTool(input) {
14842
14847
  text: marks.length === 0 ? document.markdown : `${document.markdown}
14843
14848
 
14844
14849
  Open anchored asks/comments: ${marks.join(", ")}`,
14845
- details: { issue: resolved.issue.key, topic: dispatchTopic(resolved.issue.key) }
14850
+ details: {
14851
+ issue: resolved.issue.key,
14852
+ topic: dispatchIssueSubject(resolved.issue.key, ">")
14853
+ }
14846
14854
  };
14847
14855
  }
14848
14856
  case "dispatch_artifact": {
@@ -14867,7 +14875,7 @@ Open anchored asks/comments: ${marks.join(", ")}`,
14867
14875
  text: `Uploaded ${result.artifact.name} as version ${result.version.number}`,
14868
14876
  details: {
14869
14877
  issue: result.artifact.issue_key,
14870
- topic: dispatchTopic(result.artifact.issue_key),
14878
+ topic: dispatchIssueSubject(result.artifact.issue_key, ">"),
14871
14879
  artifact: result.artifact.id,
14872
14880
  version: result.version.number
14873
14881
  }
@@ -14878,7 +14886,7 @@ Open anchored asks/comments: ${marks.join(", ")}`,
14878
14886
  const ask = await client.getAsk(issueArguments.ref.id);
14879
14887
  return {
14880
14888
  text: askSummary(ask),
14881
- details: { issue: ask.issue_key, topic: dispatchTopic(ask.issue_key) }
14889
+ details: { issue: ask.issue_key, topic: dispatchIssueSubject(ask.issue_key, ">") }
14882
14890
  };
14883
14891
  }
14884
14892
  if (issueArguments.ref?.kind === "comment") {
@@ -14887,7 +14895,7 @@ Open anchored asks/comments: ${marks.join(", ")}`,
14887
14895
  text: commentSummary(comment),
14888
14896
  details: {
14889
14897
  issue: comment.comment.issue_key,
14890
- topic: dispatchTopic(comment.comment.issue_key)
14898
+ topic: dispatchIssueSubject(comment.comment.issue_key, ">")
14891
14899
  }
14892
14900
  };
14893
14901
  }
@@ -14895,18 +14903,18 @@ Open anchored asks/comments: ${marks.join(", ")}`,
14895
14903
  if (issueArguments.ref?.kind === "log") {
14896
14904
  return {
14897
14905
  text: logSummary(read.issue, read.events),
14898
- details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
14906
+ details: { issue: read.issue.key, topic: dispatchIssueSubject(read.issue.key, ">") }
14899
14907
  };
14900
14908
  }
14901
14909
  if (issueArguments.ref?.kind === "children") {
14902
14910
  return {
14903
14911
  text: childrenSummary(read.issue),
14904
- details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
14912
+ details: { issue: read.issue.key, topic: dispatchIssueSubject(read.issue.key, ">") }
14905
14913
  };
14906
14914
  }
14907
14915
  return {
14908
14916
  text: issueSummary(read.issue, read.events),
14909
- details: { issue: read.issue.key, topic: dispatchTopic(read.issue.key) }
14917
+ details: { issue: read.issue.key, topic: dispatchIssueSubject(read.issue.key, ">") }
14910
14918
  };
14911
14919
  }
14912
14920
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "0.22.1",
3
+ "version": "0.23.0",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -141,8 +141,8 @@ A write result's `details.topic` subscribes the host to the issue. Events render
141
141
  dispatch <KEY> · <type> · by <actor>
142
142
  ```
143
143
 
144
- Human-authored events reach you, except an unnamed artifact version; child-status events also
145
- reach you. Session-authored events never wake sessions. After a restart, catch up with:
144
+ The issue topic carries every Dispatch event; `notify` only controls agent wake and routed delivery.
145
+ After a restart, catch up with:
146
146
 
147
147
  ```ts
148
148
  dispatch_read({ issue?, ref? })