@sjawhar/opencode-legion-envoy 2.0.1 → 2.0.3

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.
@@ -13561,6 +13561,7 @@ function serviceSubjectLabel(subject) {
13561
13561
  }
13562
13562
  var ASK_TURNS = ["human", "agent"];
13563
13563
  var DELIVERY_CAPABILITIES = ["aside", "btw", "steer"];
13564
+ var DELIVERY_DUPLICATE_WINDOW_MS = 72 * 60 * 60 * 1000;
13564
13565
  var DispatchEventSchema = exports_external.object({
13565
13566
  issue_key: exports_external.string().nullable(),
13566
13567
  artifact_id: exports_external.string().nullish(),
@@ -13648,6 +13649,7 @@ var CommentDeliverySchema = exports_external.object({
13648
13649
  delivery: exports_external.enum(DELIVERY_CAPABILITIES),
13649
13650
  session_id: exports_external.string().nullable(),
13650
13651
  envelope_id: exports_external.string().nullable(),
13652
+ duplicate: exports_external.boolean().optional(),
13651
13653
  state: exports_external.enum(["pending", "sent", "failed"]),
13652
13654
  error: exports_external.string().nullable(),
13653
13655
  resolve_error: exports_external.string().nullable(),
@@ -13733,6 +13735,7 @@ var MessageDeliveryEventPayloadSchema = exports_external.object({
13733
13735
  target: exports_external.string().optional(),
13734
13736
  title: exports_external.string().optional(),
13735
13737
  state: exports_external.enum(["sent", "failed"]).optional(),
13738
+ duplicate: exports_external.boolean().optional(),
13736
13739
  error: exports_external.string().optional()
13737
13740
  });
13738
13741
  var ChildStatusEventPayloadSchema = exports_external.object({
@@ -14022,7 +14025,7 @@ var dispatchToolSpecs = [
14022
14025
  ask: "01234567-0000-4000-8000-000000000001",
14023
14026
  question: "Ship the revised plan?"
14024
14027
  },
14025
- description: "Edit an open question in place. Use it to correct or refine the same decision; retract the " + "old ask and open a new one when the decision itself changes. Previous text remains in the " + "event log. Only the asking session can edit it; answered or resolved asks cannot be edited.",
14028
+ description: "Edit an open question in place. Use it to correct or refine the same decision; retract the " + "old ask and open a new one when the decision itself changes. Previous text remains in the " + "event log. Only the asking session can edit it; answered or resolved asks cannot be edited. " + "An ask that lives as an `ask` block in a document is written in the document too, changing " + "only the fields you name - pass urgency alone and the question's wording, formatting, links " + "and comment anchors are untouched - so the edit writes a document version and closes a " + "spec's design gate until that version is " + 'approved; an option label containing ": " and a question with a line beginning ":::" are ' + "refused, naming the field, because the block cannot carry them unchanged.",
14026
14029
  arguments: (z2) => ({
14027
14030
  ask: z2.string().describe("Ask id (uuid); an 8+ hex prefix unique among this session's own open asks works too."),
14028
14031
  question: z2.string({ max: ASK_QUESTION_MAX }).describe(`Replacement decision question, at most ${ASK_QUESTION_MAX} characters.`).optional(),
@@ -14048,7 +14051,7 @@ var dispatchToolSpecs = [
14048
14051
  kind: "retracted",
14049
14052
  reason: "A newer question supersedes this one."
14050
14053
  },
14051
- description: "Retract an open question that is moot or resolve one after finding the answer. This closes the question without answering it.",
14054
+ description: "Retract an open question that is moot or resolve one after finding the answer. This closes " + "the question without answering it. An ask that lives as an `ask` block in a document is " + 'closed in the document too. A reason beginning "removed from the document in version" is ' + "refused: that marks a retraction the document's own settlement wrote.",
14052
14055
  arguments: (z2) => ({
14053
14056
  ask: z2.string().describe("Ask id (uuid) to close; an 8+ hex prefix unique among this session's own open asks " + "works too."),
14054
14057
  kind: z2.enum(["retracted", "resolved"]).describe("Whether the ask is retracted or self-resolved."),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -417,10 +417,16 @@ At least one field besides `ask` is required. Use this only while the same decis
417
417
  log and invalidates any answer draft against the prior `edited_at` revision, so the human sees the new wording and explicitly reconfirms.
418
418
  An answered or resolved ask cannot be edited. If the decision is moot or superseded, retract the old ask and open a new one.
419
419
 
420
- An ask that lives as an `ask` block in a document takes its question and options from the document, so edit those with
421
- `dispatch_doc_edit` (`replace` on the block's text, or `delete`/`insert` on its option items), never with `dispatch_edit_ask`: the
422
- next document save reasserts the block's text over whatever `dispatch_edit_ask` wrote, and that reversal is logged as an edit by
423
- the document's saver. `dispatch_edit_ask` is for asks opened with `dispatch_ask` that have no block.
420
+ An ask that lives as an `ask` block in a document keeps its question and options in the block, and `dispatch_edit_ask` writes the
421
+ block along with the row, so the edit stands and the document reads the same. It changes only the fields you name: pass `urgency`
422
+ alone and the question's own wording, formatting, links and comment anchors are untouched. Pass `question` or `options` and that part
423
+ is rewritten, so anchors inside the text you replaced move as they would for any document edit. Either way it is a document edit: it
424
+ writes a new version, which on a spec awaiting approval closes the design gate until the new version is approved. Editing the block
425
+ with `dispatch_doc_edit` works too and is the way to change anything else about it, including adding formatting to a question.
426
+ Re-sending a field unchanged rewrites nothing, so retrying the whole ask is safe.
427
+ Two shapes the block cannot carry are refused outright, naming the field and writing nothing: an option label containing `": "`,
428
+ which is what separates a label from its description, and a question with a line beginning `:::`. Blank lines separate paragraphs;
429
+ a single newline is kept as a line break.
424
430
 
425
431
  An ask stays open until a human answers, unless its question no longer needs that answer. Retract a moot or superseded question, or
426
432
  self-resolve one after finding the answer:
@@ -432,7 +438,10 @@ dispatch_resolve_ask({
432
438
  })
433
439
  ```
434
440
  Use `retracted` when the question is obsolete and `resolved` when you found the answer. Include the reason because the question remains
435
- in its Conversation card and reply thread. Resolution is not an answer: it never records a human decision, and an answered ask cannot be
441
+ in its Conversation card and reply thread; a reason beginning `removed from the document in version` is refused, because that is how a
442
+ retraction the document's own settlement wrote is recognised. Resolving a block ask records it in the block too, so it stays resolved
443
+ however the document moves afterwards — while deleting the block from the document is the other way to close one, and putting the block
444
+ back reopens it. Resolution is not an answer: it never records a human decision, and an answered ask cannot be
436
445
  resolved. A human may reply to an open or answered ask; so may you, e.g. after finding the answer — use `reply_to_ask` on
437
446
  `dispatch_comment` (mutually exclusive with `reply_to`).
438
447
  A review comment you opened has its own closer, `dispatch_resolve_comment` — see