@sjawhar/pi-legion-envoy 1.4.2 → 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.
package/dist/envoy.js CHANGED
@@ -29649,6 +29649,9 @@ function date4(params) {
29649
29649
  // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/external.js
29650
29650
  config(en_default());
29651
29651
  // ../contracts/src/dispatch-api.ts
29652
+ function searchOwnerOf(result) {
29653
+ return result.owner ?? { kind: "issue", key: result.issue.key };
29654
+ }
29652
29655
  var DispatchEventSchema = object({
29653
29656
  issue_key: string2().nullable(),
29654
29657
  artifact_id: string2().nullish(),
@@ -31776,9 +31779,14 @@ function duplicateCandidates(error) {
31776
31779
  return error.candidates;
31777
31780
  }
31778
31781
  function searchResultLine(result, baseUrl) {
31782
+ const href = new URL(result.href, baseUrl).toString();
31783
+ const owner = searchOwnerOf(result);
31784
+ if (owner.kind === "document") {
31785
+ const reference = `dispatch://${owner.project}/artifact/${owner.slug}`;
31786
+ return `${reference} [document] ${owner.name} - ${result.kind}: ${snippetText(result.snippet)} -> ${href}`;
31787
+ }
31779
31788
  const artifactName = result.artifact ? ` ${result.artifact.name}` : "";
31780
31789
  const label = `${result.issue.key} [${result.issue.status}] ${result.issue.title} - ${result.kind}${artifactName}`;
31781
- const href = new URL(result.href, baseUrl).toString();
31782
31790
  return `${label}: ${snippetText(result.snippet)} -> ${href}`;
31783
31791
  }
31784
31792
  function askUrgency(args) {
package/dist/legion.js CHANGED
@@ -29648,6 +29648,9 @@ function date4(params) {
29648
29648
  // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/external.js
29649
29649
  config(en_default());
29650
29650
  // ../contracts/src/dispatch-api.ts
29651
+ function searchOwnerOf(result) {
29652
+ return result.owner ?? { kind: "issue", key: result.issue.key };
29653
+ }
29651
29654
  var DispatchEventSchema = object({
29652
29655
  issue_key: string2().nullable(),
29653
29656
  artifact_id: string2().nullish(),
@@ -32202,9 +32205,14 @@ function duplicateCandidates(error) {
32202
32205
  return error.candidates;
32203
32206
  }
32204
32207
  function searchResultLine(result, baseUrl) {
32208
+ const href = new URL(result.href, baseUrl).toString();
32209
+ const owner = searchOwnerOf(result);
32210
+ if (owner.kind === "document") {
32211
+ const reference = `dispatch://${owner.project}/artifact/${owner.slug}`;
32212
+ return `${reference} [document] ${owner.name} - ${result.kind}: ${snippetText(result.snippet)} -> ${href}`;
32213
+ }
32205
32214
  const artifactName = result.artifact ? ` ${result.artifact.name}` : "";
32206
32215
  const label = `${result.issue.key} [${result.issue.status}] ${result.issue.title} - ${result.kind}${artifactName}`;
32207
- const href = new URL(result.href, baseUrl).toString();
32208
32216
  return `${label}: ${snippetText(result.snippet)} -> ${href}`;
32209
32217
  }
32210
32218
  function askUrgency(args) {
@@ -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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion-envoy",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "omp": {
6
6
  "extensions": [