@sjawhar/opencode-legion-envoy 1.27.3 → 1.27.5

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.
@@ -13779,7 +13779,7 @@ var SPEC_SECTIONS = [
13779
13779
  ];
13780
13780
  var SPEC_WRITING_GUIDANCE = `When writing a spec, use these sections in order: ${SPEC_SECTIONS.join(", ")}. ` + "Write for a reader who has not seen the code: plain sentences, every identifier expanded on " + "first use, no coined shorthand; see skills/dispatch Writing for the human and Writing a spec.";
13781
13781
  var ASK_URGENCIES = ["low", "med", "high", "blocking"];
13782
- var DOC_EDIT_OPS = ["replace", "delete", "insert", "retype"];
13782
+ var DOC_EDIT_OPS = ["replace", "delete", "insert", "retype", "move"];
13783
13783
  var dispatchToolSpecs = [
13784
13784
  {
13785
13785
  name: "dispatch_issue",
@@ -13901,7 +13901,7 @@ var dispatchToolSpecs = [
13901
13901
  },
13902
13902
  {
13903
13903
  name: "dispatch_doc_edit",
13904
- description: "Apply deterministic document edits, including retyping an identified paragraph into a schema-declared typed block. " + "Do not use it for review feedback or for reading; use dispatch_comment, dispatch_suggest, or dispatch_doc_read instead. " + 'For replace, delete, and quote insert anchors, find text as rendered: inline Markdown (**bold**, `code`) is tolerated; a leading \'# \' matches a heading. Insert anchors also accept "start", "end", and "heading:<exact heading text>". ' + `The spec (or any document) holds requirements, design, and decisions - never progress, status, or timestamps. ${OWNER_REFERENCE} ${SPEC_WRITING_GUIDANCE}`,
13904
+ description: "Apply deterministic document edits: replace or delete quoted text, insert markdown at an anchor, retype an identified paragraph or typed block into a schema-declared typed block, and delete or move a whole block by its id. " + "Do not use it for review feedback or for reading; use dispatch_comment, dispatch_suggest, or dispatch_doc_read instead. " + "For replace, delete, and quote anchors, find text as rendered: inline Markdown (**bold**, `code`) is tolerated; a leading '# ' matches a heading. replace is inline: with is the new text of the matched span, so a leading list or heading marker stays literal text. " + "A delete whose find is a block's entire text removes the block (a list emptied of its items goes too); delete with block removes any block by id, and move with block relocates one. " + 'Insert and move anchors also accept "start", "end", "heading:<exact heading text>", and "block:<id>"; block ids are the #id of a typed block or a row of GET /api/v1/artifacts/{id}/blocks. ' + `The spec (or any document) holds requirements, design, and decisions - never progress, status, or timestamps. ${OWNER_REFERENCE} ${SPEC_WRITING_GUIDANCE}`,
13905
13905
  arguments: (z) => ({
13906
13906
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
13907
13907
  project: z.string().describe("Project key owning the document.").optional(),
@@ -13909,13 +13909,13 @@ var dispatchToolSpecs = [
13909
13909
  ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
13910
13910
  ops: z.array(z.object({
13911
13911
  op: z.enum(DOC_EDIT_OPS).describe("Edit operation."),
13912
- find: z.string().describe("Text of the target block as rendered, for replace or delete; inline markdown (**bold**, `code`) is tolerated; a leading '# ' matches a heading.").optional(),
13913
- with: z.string().describe("Replacement text for replace.").optional(),
13912
+ find: z.string().describe("Text of the target as rendered, for replace or delete; inline markdown (**bold**, `code`) is tolerated; a leading '# ' matches a heading. A delete of a block's entire text removes the block.").optional(),
13913
+ with: z.string().describe("Replacement text for replace, parsed as inline markdown within the matched block; a leading list or heading marker is literal text.").optional(),
13914
13914
  occurrence: z.number({ int: true, min: 0 }).describe("Optional zero-based match occurrence.").optional(),
13915
13915
  markdown: z.string().describe("Markdown to insert.").optional(),
13916
- after: z.string().describe(`Insert after this anchor: a quote of the neighbouring block's text, or one of "start", "end", "heading:<exact heading text>".`).optional(),
13917
- before: z.string().describe(`Insert before this anchor: a quote of the neighbouring block's text, or one of "start", "end", "heading:<exact heading text>".`).optional(),
13918
- block: z.string().describe("Block id to retype.").optional(),
13916
+ after: z.string().describe(`Insert or move after this anchor: a quote of the neighbouring block's text, or one of "start", "end", "heading:<exact heading text>", "block:<id>".`).optional(),
13917
+ before: z.string().describe(`Insert or move before this anchor: a quote of the neighbouring block's text, or one of "start", "end", "heading:<exact heading text>", "block:<id>".`).optional(),
13918
+ block: z.string().describe("Block id for retype, delete, or move: the #id of a typed block, or an id from GET /api/v1/artifacts/{id}/blocks.").optional(),
13919
13919
  type: z.string().describe("Typed block name for retype.").optional(),
13920
13920
  attributes: z.unknown().describe("Typed block attributes for retype.").optional()
13921
13921
  })).describe("Flat tagged edits; the server validates fields required for each operation."),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "1.27.3",
3
+ "version": "1.27.5",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -253,7 +253,7 @@ exact `EditOp` shape:
253
253
 
254
254
  ```ts
255
255
  type EditOp = {
256
- op: "replace" | "delete" | "insert" | "retype";
256
+ op: "replace" | "delete" | "insert" | "retype" | "move";
257
257
  find?: string;
258
258
  with?: string;
259
259
  occurrence?: number;
@@ -271,18 +271,34 @@ code without backticks, bold without asterisks, and link text without link synta
271
271
  anchor is its cell text. Quote code-block contents without their Markdown fences. A quote must stay
272
272
  within one textblock; split changes that span separate blocks into separate operations.
273
273
 
274
- `replace` requires `find` and `with`; `delete` requires `find`; `insert` requires `markdown` and exactly one of `after` or `before`. An
275
- insert anchor is a quote, `"start"`, `"end"`, or `"heading:Title"`. Ordinary inserts create a sibling block before or after the quote or
276
- heading's enclosing document block; `"start"` and `"end"` select the document edges. At a table-cell quote, a body-row fragment (no
277
- header or delimiter rows) extends that table before or after the matched row instead; short rows are padded, wider rows are rejected,
278
- and deleting a cell's quoted text removes only that text. A `find` or quote anchor tolerates inline Markdown (`**bold**`, `` `code` ``)
279
- and a leading `# ` selects a heading by its text; a miss names the three nearest blocks so the next quote lands.
280
-
281
- Use `replace` for inline continuation. Use zero-based `occurrence` for a repeated target; re-read a missing or ambiguous target before
282
- retrying. Pass `summary` to name the version when recording a decision.
283
- `retype` turns the paragraph with `block` into the named typed `type` in place. It keeps the
284
- block id and uses `attributes` for client-owned typed attributes. Use it when an existing
285
- paragraph is the question that should become a decision.
274
+ `replace` requires `find` and `with`; `delete` requires `find` or `block`; `insert` requires `markdown` and exactly one of `after` or
275
+ `before`; `move` requires `block` and exactly one of `after` or `before`. An insert or move anchor is a quote, `"start"`, `"end"`,
276
+ `"heading:Title"`, or `"block:<id>"`. Ordinary inserts create a sibling block before or after the quote, heading, or block's enclosing
277
+ document block, and a move lands the block at that same boundary; `"start"` and `"end"` select the document edges. At a table-cell
278
+ quote, a body-row fragment (no header or delimiter rows) extends that table before or after the matched row instead; short rows are
279
+ padded, wider rows are rejected, and deleting a cell's quoted text removes only that text. A `find` or quote anchor tolerates inline
280
+ Markdown (`**bold**`, `` `code` ``) and a leading `# ` selects a heading by its text; a miss names the three nearest blocks so the next
281
+ quote lands.
282
+
283
+ `replace` is inline: `with` is the new text of the matched span inside its block, so a leading list or heading marker (`4. Design`,
284
+ `# Title`) stays literal text and never turns the block into a list or heading; `with` that forms more than one paragraph is rejected
285
+ (`INVALID_OP` on `with`) — delete the block and insert new blocks instead. Use zero-based `occurrence` for a repeated target; re-read a
286
+ missing or ambiguous target before retrying. Pass `summary` to name the version when recording a decision.
287
+
288
+ A `delete` whose `find` is a block's entire text removes the block itself — the bullet, paragraph, or heading, not just its words — and
289
+ a list emptied of every item disappears with it; a partial match keeps the block with its remaining text. Deleting the text of a bullet
290
+ that holds a nested list hoists that list's items into the bullet's place (as an outliner does); a bullet with any other content
291
+ (paragraphs, code, tables) is refused with `INVALID_OP` naming `delete {block:"<item id>"}`, which removes the item with its content.
292
+ `delete` with `block` removes any block by id (paragraph, heading, list, list item, table, or typed block; deleting an open `ask` block
293
+ retracts its ask, while an answered one keeps its answer as the record), and `move` with `block` relocates one, keeping its id and
294
+ attributes — a moved `ask` keeps its ask and answer. Block ids are the `#id` a typed block renders (`:::ask{#5467e5ce-…}`) and, for
295
+ every block including untyped ones, the `id` rows of `GET /api/v1/artifacts/{id}/blocks` (or `/api/v1/issues/{key}/artifacts/{slug}/blocks`),
296
+ each with its `type` and byte range in the canonical markdown. A move whose anchor lies inside the moved block, or a delete that would
297
+ leave a typed block without the body its content rule requires, is `INVALID_OP` naming the field and the rule.
298
+
299
+ `retype` turns the paragraph or typed block with `block` into the named typed `type` in place. It keeps the
300
+ block id, keeps a typed block's body, and uses `attributes` for client-owned typed attributes. Use it when
301
+ an existing paragraph is the question that should become a decision.
286
302
 
287
303
  ## Typed blocks
288
304