@sjawhar/opencode-legion-envoy 0.41.0 → 0.41.1

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.
@@ -13603,15 +13603,22 @@ var AskEditedEventPayloadSchema = object({
13603
13603
  edited_by: object({ kind: string2(), id: string2() }).passthrough()
13604
13604
  });
13605
13605
  var CommentEventPayloadSchema = object({
13606
+ id: string2().optional(),
13606
13607
  artifact_name: string2().optional(),
13607
13608
  body: string2().optional(),
13608
13609
  reply_to: string2().nullish(),
13609
13610
  ask_id: string2().nullish(),
13610
13611
  ask_question: string2().optional(),
13611
13612
  anchor: object({ quote: string2().optional() }).nullish(),
13612
- suggestion: object({ replace_with: string2().optional() }).nullish()
13613
+ suggestion: object({ replace_with: string2().optional() }).nullish(),
13614
+ author: object({ kind: string2(), id: string2().optional() }).passthrough().optional(),
13615
+ created_at: string2().optional()
13616
+ });
13617
+ var MessageEventPayloadSchema = object({
13618
+ id: string2().optional(),
13619
+ body: string2().optional(),
13620
+ author: object({ kind: string2(), id: string2().optional() }).passthrough().optional()
13613
13621
  });
13614
- var MessageEventPayloadSchema = object({ body: string2().optional() });
13615
13622
  var ChildStatusEventPayloadSchema = object({
13616
13623
  child_key: string2().optional(),
13617
13624
  from: string2().optional(),
@@ -14901,7 +14908,7 @@ async function resolveOwnerArguments(tool, args, cwd, env, exec) {
14901
14908
  return { args, ref: null, owner: null };
14902
14909
  const refArgument = args.ref;
14903
14910
  const ref = typeof refArgument === "string" ? parseDispatchRef(refArgument) ?? (() => {
14904
- throw new Error("ref must be a valid dispatch:// reference");
14911
+ throw new Error("ref must be a valid dispatch:// reference such as dispatch://KEY-1, " + "dispatch://KEY-1/ask/<uuid>, dispatch://KEY-1/comment/<uuid>, " + "dispatch://KEY-1/artifact/<slug>, or dispatch://PROJECT/artifact/<slug>");
14905
14912
  })() : null;
14906
14913
  const issueArgument = args.issue;
14907
14914
  const projectArgument = args.project;
@@ -14973,13 +14980,23 @@ async function resolveArtifact(client, owner, artifactReference) {
14973
14980
  if (artifactReference === undefined) {
14974
14981
  throw new Error("artifact is required for a project document");
14975
14982
  }
14976
- return {
14977
- owner,
14978
- artifact: await client.getProjectArtifact(owner.project, artifactReference)
14979
- };
14983
+ try {
14984
+ return {
14985
+ owner,
14986
+ artifact: await client.getProjectArtifact(owner.project, artifactReference)
14987
+ };
14988
+ } catch (error) {
14989
+ if (!(error instanceof DispatchServiceError) || error.status !== 404)
14990
+ throw error;
14991
+ const artifacts = await client.listProjectArtifacts(owner.project);
14992
+ const artifact = artifacts.find((candidate) => candidate.name === artifactReference);
14993
+ if (!artifact)
14994
+ throw error;
14995
+ return { owner, artifact };
14996
+ }
14980
14997
  }
14981
14998
  const issue = await client.getIssue(owner.issue);
14982
- const artifact = artifactReference === undefined || artifactReference === "spec" ? issue.artifacts.find((candidate) => candidate.primary || candidate.id === issue.primary_artifact_id) : issue.artifacts.find((candidate) => candidate.id === artifactReference || candidate.slug === artifactReference);
14999
+ const artifact = artifactReference === undefined || artifactReference === "spec" ? issue.artifacts.find((candidate) => candidate.primary || candidate.id === issue.primary_artifact_id) : issue.artifacts.find((candidate) => candidate.id === artifactReference || candidate.slug === artifactReference || candidate.name === artifactReference);
14983
15000
  if (!artifact) {
14984
15001
  throw new Error(`artifact ${artifactReference ?? "spec"} was not found on issue ${issue.key}`);
14985
15002
  }
@@ -15345,8 +15362,9 @@ Open anchored asks/comments: ${marks.join(", ")}`,
15345
15362
  };
15346
15363
  const artifactOwner = documentOwner();
15347
15364
  const result = artifactOwner.kind === "project" ? await client.projectArtifact(artifactOwner.project, artifactInput) : await client.artifact(issue(), artifactInput);
15365
+ const artifactRef = artifactOwner.kind === "project" ? `dispatch://${artifactOwner.project}/artifact/${result.artifact.slug}` : `dispatch://${issue()}/artifact/${result.artifact.slug}`;
15348
15366
  return {
15349
- text: `Uploaded ${result.artifact.name} as version ${result.version.number}`,
15367
+ text: `Uploaded ${result.artifact.name} as version ${result.version.number} (artifact slug ${result.artifact.slug}; ${artifactRef})`,
15350
15368
  details: artifactOwner.kind === "project" ? {
15351
15369
  ...documentResultDetails(result.artifact),
15352
15370
  version: result.version.number
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "0.41.0",
3
+ "version": "0.41.1",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -5,8 +5,8 @@ description: "Use when asking Sami a question, updating the spec, commenting on
5
5
 
6
6
  # Dispatch
7
7
 
8
- Dispatch is your issue's living spec, asks, comments, and artifacts. The transcript is your
9
- scratch pad. Anything meant for a human goes through a `dispatch_*` tool.
8
+ Dispatch is your issue's or project document's living spec, asks, comments, and artifacts. The
9
+ transcript is your scratch pad. Anything meant for a human goes through a `dispatch_*` tool.
10
10
 
11
11
  The server enforces high signal: an ask question is at most 800 characters with at most eight
12
12
  options; comment and message bodies are at most 2,000 characters; an artifact is at most 25 MiB.
@@ -143,6 +143,7 @@ dispatch_doc_read({ issue?, project?, artifact?, version?, ref? })
143
143
  It returns live or versioned markdown with open marks. `issue` with an omitted `artifact`
144
144
  reads the issue specification; a project needs `artifact`; and a
145
145
  `dispatch://PROJECT/artifact/<slug>` ref supplies both. Then write narrative with:
146
+
146
147
  ```ts
147
148
  dispatch_doc_edit({ issue?, project?, artifact, ops, summary? })
148
149
  ```
@@ -162,15 +163,22 @@ type EditOp = {
162
163
  ```
163
164
 
164
165
  Target `replace` and `delete` by the document's plain text: inline-code and link text match
165
- without Markdown syntax, and a table-cell anchor is its cell text. `replace` requires `find` and
166
- `with`; `delete` requires `find`; `insert` requires `markdown` and exactly one of `after` or
167
- `before`. An insert anchor is a quote, `"start"`, `"end"`, or `"heading:Title"`. Every insert
168
- creates a sibling block before or after the quote or heading's enclosing document block; `"start"`
169
- and `"end"` select the document edges. At a table-cell quote, pipe-table body-row fragments extend
170
- that table before or after the matched row; omit table header and delimiter rows, and do not exceed
171
- the table width. Use `replace` for inline continuation. Use zero-based `occurrence` for a repeated
172
- target. When a decision lands, pass `summary` to name the resulting version. Never paste progress
173
- into a message.
166
+ without Markdown syntax, and a table-cell anchor is its cell text. Quote code-block contents
167
+ without their Markdown fences. A quote must stay within one textblock; split changes that
168
+ span separate blocks into separate operations.
169
+
170
+ `replace` requires `find` and `with`; `delete` requires `find`; `insert` requires `markdown`
171
+ and exactly one of `after` or `before`. An insert anchor is a quote, `"start"`, `"end"`, or
172
+ `"heading:Title"`. Ordinary inserts create a sibling block before or after the quote or
173
+ heading's enclosing document block; `"start"` and `"end"` select the document edges.
174
+
175
+ At a table-cell quote, pipe-table body-row fragments extend that table before or after the
176
+ matched row; omit table header and delimiter rows. Short rows are padded to the table width;
177
+ rows wider than the table are rejected.
178
+ Deleting a cell's quoted text removes that text, not the surrounding row or table.
179
+ Use `replace` for inline continuation. Use zero-based `occurrence` for a repeated target;
180
+ re-read a missing or ambiguous target before retrying. Pass `summary` to name the version
181
+ when recording a decision. Never paste progress into a message.
174
182
 
175
183
  ## Comments and suggestions
176
184
 
@@ -185,7 +193,9 @@ It returns issue or project-document owner details plus `comment` and, for write
185
193
  (`reply_to`/`reply_to_ask`) takes no `quote`; it belongs to its parent's anchor. Use `reply_to`
186
194
  to continue a comment thread at its root; a reply to a resolved thread reopens it. Use
187
195
  `reply_to_ask` to reply directly under a question asked with `dispatch_ask`. The two are
188
- mutually exclusive. Comments are edited only by their author from the dashboard.
196
+ mutually exclusive. Comments are edited only by their author from the dashboard. A delivered
197
+ `comment.created` event carries the comment `id`; reply to it with
198
+ `dispatch_comment({ reply_to: <id> })`.
189
199
 
190
200
  Propose an exact replacement instead of describing it:
191
201
 
@@ -222,6 +232,7 @@ document; it must not include `artifact`. Exactly one of `path` and `content` is
222
232
  inline form sends JSON with `Content-Type: application/json`. It returns issue or
223
233
  project-document owner details plus `artifact`, `version`, and its write `topic`. Uploading the
224
234
  same `name` creates its next version. Use `content` when the text is already in the call.
235
+ Address an existing artifact by the slug shown in the upload result or by its filename.
225
236
 
226
237
  ## Messages
227
238
 
@@ -321,8 +332,8 @@ dispatch_doc_edit({
321
332
  ops: [
322
333
  {
323
334
  op: "replace",
324
- find: "## Delivery\n\nRelease pending.",
325
- with: "## Delivery\n\nRelease merged and ready for deployment.",
335
+ find: "Release pending.",
336
+ with: "Release merged and ready for deployment.",
326
337
  },
327
338
  ],
328
339
  summary: "Recorded merged release",