@sjawhar/opencode-legion-envoy 3.1.5 → 3.2.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.
package/dist/src/server.js
CHANGED
|
@@ -14142,7 +14142,7 @@ var dispatchToolSpecs = [
|
|
|
14142
14142
|
ops: [{ op: "delete_column", block: "table-123", index: 1 }],
|
|
14143
14143
|
precondition: { blocks: [{ id: "table-123", token: "sha256:current-table-token" }] }
|
|
14144
14144
|
},
|
|
14145
|
-
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, delete or move a whole block by its id, or delete a table row or column in place. " + "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 and must be balanced; a leading '# ' matches a heading at any level. replace is inline: with is the new text of the matched span, so a marker of a different kind from the block's own stays literal text ('4. Design' written into a heading). A with that opens with a marker of the same kind as the matched block's own would write it twice and is INVALID_OP - including prose that merely looks like one ('1999. was a year' into an ordered item), which you write as text by escaping it ('1999\\. was a year'). The exception is a heading rename whose find carried a heading marker: replace(find="## Old", with="## New") gives '## New', and a different level applies only when find named the heading's actual level (find "## Old" with "### New" makes it an h3), since '# ' selects a heading without naming its level. Any non-empty with that renders to no text - a line indented four spaces or a tab, which markdown reads as a code block, or whitespace alone - is INVALID_OP rather than a silent deletion; pass an empty with to delete the matched text on purpose. ` + "with cannot open a new block: after a hard line break inside with (two trailing spaces, or a backslash, before the newline) a heading, bullet, '1.'/'1)' ordered, or '>' blockquote marker is INVALID_OP too, since that line would stay escaped text inside the matched block - use insert, plus delete for what it replaces, to add the block. " + "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. delete_row and delete_column take a table block and a zero-based index, preserving the table block id and refusing to remove cells with open asks or unresolved comments. " + 'Insert and move anchors also accept "start", "end", "heading:<exact heading text>", and "block:<id>"; block ids and their tokens come from GET /api/v1/artifacts/{artifact UUID}/blocks (the route takes the artifact UUID, not its slug). ' + "Optionally require the state just read: precondition selects exactly one of a document token from dispatch_doc_read, or block {id, token} values from /blocks. A block guard must include every block the batch changes; Dispatch resolves quote targets and rejects an uncovered batch rather than applying it. Use a document token for insert or move, which depend on document order. Prefer block tokens when the covered content blocks are independent sections. Tokens include inline marks, so a fresh human comment also makes a stale edit fail. PRECONDITION_FAILED means re-read; EDIT_QUEUE_FULL means back off before retrying. " + "A batch that leaves the document exactly as it was mints no version, named or not, and the result says nothing changed and names each operation that did nothing. " + `The spec (or any document) holds requirements, design, and decisions - never progress, status, or timestamps. ${OWNER_REFERENCE} ${SPEC_WRITING_GUIDANCE}`,
|
|
14145
|
+
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, delete or move a whole block by its id, or delete a table row or column in place. " + "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 and must be balanced; a leading '# ' matches a heading at any level. replace is inline: with is the new text of the matched span, so a marker of a different kind from the block's own stays literal text ('4. Design' written into a heading). A with that opens with a marker of the same kind as the matched block's own would write it twice and is INVALID_OP - including prose that merely looks like one ('1999. was a year' into an ordered item), which you write as text by escaping it ('1999\\. was a year'). The exception is a heading rename whose find carried a heading marker: replace(find="## Old", with="## New") gives '## New', and a different level applies only when find named the heading's actual level (find "## Old" with "### New" makes it an h3), since '# ' selects a heading without naming its level. Any non-empty with that renders to no text - a line indented four spaces or a tab, which markdown reads as a code block, or whitespace alone - is INVALID_OP rather than a silent deletion; pass an empty with to delete the matched text on purpose. ` + "with cannot open a new block: after a hard line break inside with (two trailing spaces, or a backslash, before the newline) a heading, bullet, '1.'/'1)' ordered, or '>' blockquote marker is INVALID_OP too, since that line would stay escaped text inside the matched block - use insert, plus delete for what it replaces, to add the block. " + "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. delete_row and delete_column take a table block and a zero-based index, preserving the table block id and refusing to remove cells with open asks or unresolved comments. " + 'Insert and move anchors also accept "start", "end", "heading:<exact heading text>", and "block:<id>"; block ids and their tokens come from GET /api/v1/artifacts/{artifact UUID}/blocks (the route takes the artifact UUID, not its slug). ' + "Optionally require the state just read: precondition selects exactly one of a document token from dispatch_doc_read, or block {id, token} values from /blocks. A block guard must include every block the batch changes; Dispatch resolves quote targets and rejects an uncovered batch rather than applying it. Use a document token for insert or move, which depend on document order. Prefer block tokens when the covered content blocks are independent sections. Tokens include inline marks, so a fresh human comment also makes a stale edit fail. PRECONDITION_FAILED means re-read; EDIT_QUEUE_FULL means back off before retrying. " + "The result carries the document token this edit produced, so a chain of guarded edits passes each result's token as the next edit's precondition with no dispatch_doc_read between them. " + "A batch that leaves the document exactly as it was mints no version, named or not, and the result says nothing changed and names each operation that did nothing. " + `The spec (or any document) holds requirements, design, and decisions - never progress, status, or timestamps. ${OWNER_REFERENCE} ${SPEC_WRITING_GUIDANCE}`,
|
|
14146
14146
|
arguments: (z2) => ({
|
|
14147
14147
|
issue: z2.string().describe(ISSUE_REFERENCE).optional(),
|
|
14148
14148
|
project: z2.string().describe("Project key owning the document.").optional(),
|
|
@@ -16944,13 +16944,19 @@ ${followsAsk(askOwner)}`,
|
|
|
16944
16944
|
const unchangedText = unchangedOps.length === 0 ? "" : `; ${unchangedOps.length === 1 ? "operation" : "operations"} ${unchangedOps.join(", ")} changed nothing`;
|
|
16945
16945
|
const applied = `${head}${unchangedText}`;
|
|
16946
16946
|
const adviceLines = renderAdvice(input.tool, resolvedTopic(resolved).label, edited.advice, {});
|
|
16947
|
+
const tokenTrailer = edited.token === undefined ? [] : [`Document token: ${edited.token}`];
|
|
16947
16948
|
return {
|
|
16948
|
-
text: [
|
|
16949
|
+
text: [
|
|
16950
|
+
`${applied} ${notSubscribed(resolvedTopic(resolved))}`,
|
|
16951
|
+
...tokenTrailer,
|
|
16952
|
+
...adviceLines
|
|
16953
|
+
].join(`
|
|
16949
16954
|
`),
|
|
16950
16955
|
details: writeResultDetails(resolved, {
|
|
16951
16956
|
applied: edited.applied,
|
|
16952
16957
|
...edited.version === null ? {} : { version: edited.version.number },
|
|
16953
16958
|
...nothingChanged ? { changed: false } : {},
|
|
16959
|
+
...edited.token === undefined ? {} : { token: edited.token },
|
|
16954
16960
|
...edited.advice === undefined ? {} : { advice: edited.advice }
|
|
16955
16961
|
})
|
|
16956
16962
|
};
|
package/package.json
CHANGED
|
@@ -8,8 +8,9 @@ reject a stale edit.
|
|
|
8
8
|
```ts
|
|
9
9
|
dispatch_doc_edit({ issue?, project?, artifact, ops, precondition?, summary? })
|
|
10
10
|
```
|
|
11
|
-
It returns issue or project-document owner details plus `applied`, optional `version`, `changed`,
|
|
12
|
-
`unchanged_ops
|
|
11
|
+
It returns issue or project-document owner details plus `applied`, optional `version`, `changed`,
|
|
12
|
+
`unchanged_ops`, and the document token this edit produced, rendered as a `Document token: <token>`
|
|
13
|
+
line. `ops` is an array of this exact `EditOp` shape:
|
|
13
14
|
|
|
14
15
|
```ts
|
|
15
16
|
type EditOp = {
|
|
@@ -127,8 +128,11 @@ whose anchor lies inside the moved block, or a delete that would leave a typed b
|
|
|
127
128
|
|
|
128
129
|
`GET /api/v1/artifacts/<artifact UUID>/blocks` includes a full-state `token` on every block, including
|
|
129
130
|
inline marks. To reject a stale edit, pass `precondition` with exactly one of
|
|
130
|
-
`{ document: "<token
|
|
131
|
-
`{ blocks: [{ id: "<block id>", token: "<block token>" }] }`.
|
|
131
|
+
`{ document: "<document token>" }` or
|
|
132
|
+
`{ blocks: [{ id: "<block id>", token: "<block token>" }] }`. A document token comes from
|
|
133
|
+
`dispatch_doc_read` or from the previous `dispatch_doc_edit`, whose result carries the token its
|
|
134
|
+
own edit produced: a run of guarded edits passes each result's token to the next one and reads the
|
|
135
|
+
document once, not once per edit. The server resolves the whole batch before
|
|
132
136
|
mutation: a block guard must cover every content block it changes, or Dispatch returns
|
|
133
137
|
`400 INVALID_PRECONDITION` without applying anything. Use a document token for insert and move because they
|
|
134
138
|
depend on document order. A block token lets other sections change concurrently; a new anchored ask or comment
|