@sjawhar/opencode-legion-envoy 1.4.1 → 1.5.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.
@@ -13552,6 +13552,9 @@ function date4(params) {
13552
13552
  // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/external.js
13553
13553
  config(en_default());
13554
13554
  // ../contracts/src/dispatch-api.ts
13555
+ function searchOwnerOf(result) {
13556
+ return result.owner ?? { kind: "issue", key: result.issue.key };
13557
+ }
13555
13558
  var DispatchEventSchema = object({
13556
13559
  issue_key: string2().nullable(),
13557
13560
  artifact_id: string2().nullish(),
@@ -14898,9 +14901,14 @@ function duplicateCandidates(error) {
14898
14901
  return error.candidates;
14899
14902
  }
14900
14903
  function searchResultLine(result, baseUrl) {
14904
+ const href = new URL(result.href, baseUrl).toString();
14905
+ const owner = searchOwnerOf(result);
14906
+ if (owner.kind === "document") {
14907
+ const reference = `dispatch://${owner.project}/artifact/${owner.slug}`;
14908
+ return `${reference} [document] ${owner.name} - ${result.kind}: ${snippetText(result.snippet)} -> ${href}`;
14909
+ }
14901
14910
  const artifactName = result.artifact ? ` ${result.artifact.name}` : "";
14902
14911
  const label = `${result.issue.key} [${result.issue.status}] ${result.issue.title} - ${result.kind}${artifactName}`;
14903
- const href = new URL(result.href, baseUrl).toString();
14904
14912
  return `${label}: ${snippetText(result.snippet)} -> ${href}`;
14905
14913
  }
14906
14914
  function askUrgency(args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -29,6 +29,13 @@ vocabulary, and is often on a phone. Write for that person.
29
29
  - Before posting, test it: could Sami, reading only this text on his phone, know what he is being
30
30
  told or asked? If not, rewrite it. Length is not the problem; density is.
31
31
 
32
+ ## Agent authentication
33
+
34
+ Use a personal Dispatch token: a human mints it in Dispatch **Settings → Agent tokens** and supplies
35
+ it to the agent through `dispatch.token` in `~/.config/opencode/envoy.json` or `DISPATCH_TOKEN`.
36
+ The server records the minting human as the owner of that session's writes. `DISPATCH_AGENT_TOKEN`
37
+ is the shared devbox fallback; do not configure it for an individual agent.
38
+
32
39
  ## Writing a spec
33
40
 
34
41
  A spec has two readers: the human who decides reads the top; the implementer who builds reads the
@@ -78,9 +85,11 @@ Before you create an issue or start a design document, search:
78
85
  ```ts
79
86
  dispatch_search({ query, project?, limit? })
80
87
  ```
81
- It returns every issue, document, comment, ask, and message that contains the words, with the issue key and a link. Cite the hit you
82
- build on (`dispatch://KEY` or the document reference), or state "no prior issue" in the spec. Websearch syntax applies: `"merge queue"`,
83
- `-daemon`, `OR`.
88
+ It returns every issue, document, comment, ask, and message that contains the words. Issue-owned hit lines
89
+ start with the issue key; standalone project-document hit lines start with
90
+ `dispatch://PROJECT/artifact/<slug>`, followed by the absolute link. Cite the hit you build on
91
+ (`dispatch://KEY` or the document reference), or state "no prior issue" in the spec. Websearch syntax applies:
92
+ `"merge queue"`, `-daemon`, `OR`.
84
93
 
85
94
  `dispatch_issue` refuses a title that near-duplicates an issue in the same project and returns the candidates (`POSSIBLE_DUPLICATE`).
86
95
  Read them; reference the existing issue, or repeat the call with `force: true` when it is genuinely new work.