@sjawhar/pi-legion-envoy 0.42.0 → 0.43.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
@@ -29782,15 +29782,17 @@ function dispatchToolSchema(spec, z, opts) {
29782
29782
  }
29783
29783
  var ISSUE_REFERENCE = "An issue is a native KEY or external owner/repo#n reference; an external reference creates its native issue in the repository's dashboard-configured project or, failing that, the default project (DISPATCH_DEFAULT_PROJECT).";
29784
29784
  var OWNER_REFERENCE = "Exactly one of issue and project is required. An issue is a native KEY or external owner/repo#n reference; a project is a project key such as CORE and addresses an unlinked project document named by artifact.";
29785
- function documentOwnerValidation(requireArtifact) {
29785
+ function documentOwnerValidation(requireArtifact, alwaysRequireArtifact = false) {
29786
29786
  return {
29787
29787
  check: (value) => {
29788
29788
  const input = value;
29789
29789
  const hasIssue = typeof input.issue === "string";
29790
29790
  const hasProject = typeof input.project === "string";
29791
- return (hasIssue !== hasProject || !hasIssue && !hasProject && typeof input.ref === "string") && (!hasProject || !requireArtifact || typeof input.artifact === "string");
29791
+ const hasArtifact = typeof input.artifact === "string";
29792
+ const hasRef = typeof input.ref === "string";
29793
+ return (hasIssue !== hasProject || !hasIssue && !hasProject && hasRef) && (!hasProject || !requireArtifact || hasArtifact) && (!alwaysRequireArtifact || hasArtifact || hasRef);
29792
29794
  },
29793
- message: "Exactly one of issue and project is required; with project, artifact names the document."
29795
+ message: alwaysRequireArtifact ? "Exactly one of issue and project is required; artifact or ref must name the document." : "Exactly one of issue and project is required; with project, artifact names the document."
29794
29796
  };
29795
29797
  }
29796
29798
  var SPEC_SECTIONS = [
@@ -29825,6 +29827,7 @@ var dispatchToolSpecs = [
29825
29827
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
29826
29828
  project: z.string().describe("Project key owning the document.").optional(),
29827
29829
  artifact: z.string().describe("Project document slug or id.").optional(),
29830
+ ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
29828
29831
  question: z.string({ max: 800 }).describe("Decision question, at most 800 characters."),
29829
29832
  options: z.array(z.object({
29830
29833
  label: z.string().describe("Selectable option label."),
@@ -29877,6 +29880,7 @@ var dispatchToolSpecs = [
29877
29880
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
29878
29881
  project: z.string().describe("Project key owning the document.").optional(),
29879
29882
  artifact: z.string().describe("Artifact slug or id required when quote is given.").optional(),
29883
+ ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
29880
29884
  quote: z.string().describe("Optional exact quoted document text.").optional(),
29881
29885
  occurrence: z.number({ int: true, min: 0 }).describe("Optional zero-based occurrence of quote.").optional(),
29882
29886
  body: z.string({ max: 2000 }).describe("Review comment, at most 2,000 characters."),
@@ -29891,13 +29895,14 @@ var dispatchToolSpecs = [
29891
29895
  arguments: (z) => ({
29892
29896
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
29893
29897
  project: z.string().describe("Project key owning the document.").optional(),
29894
- artifact: z.string().describe("Artifact slug or id containing the quoted text."),
29898
+ artifact: z.string().describe("Artifact slug or id containing the quoted text; optional when ref names it.").optional(),
29899
+ ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
29895
29900
  quote: z.string().describe("Exact document text to replace."),
29896
29901
  replace_with: z.string().describe("Replacement text."),
29897
29902
  body: z.string({ max: 2000 }).describe("Optional rationale, at most 2,000 characters.").optional(),
29898
29903
  occurrence: z.number({ int: true, min: 0 }).describe("Optional zero-based occurrence of quote.").optional()
29899
29904
  }),
29900
- validation: documentOwnerValidation(true)
29905
+ validation: documentOwnerValidation(true, true)
29901
29906
  },
29902
29907
  {
29903
29908
  name: "dispatch_message",
@@ -29914,7 +29919,8 @@ var dispatchToolSpecs = [
29914
29919
  arguments: (z) => ({
29915
29920
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
29916
29921
  project: z.string().describe("Project key owning the document.").optional(),
29917
- artifact: z.string().describe("Artifact slug or id for the document."),
29922
+ artifact: z.string().describe("Artifact slug or id for the document; optional when ref names it.").optional(),
29923
+ ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
29918
29924
  ops: z.array(z.object({
29919
29925
  op: z.enum(DOC_EDIT_OPS).describe("Edit operation."),
29920
29926
  find: z.string().describe("Text to find for replace or delete.").optional(),
@@ -29926,7 +29932,7 @@ var dispatchToolSpecs = [
29926
29932
  })).describe("Flat tagged edits; the server validates fields required for each operation."),
29927
29933
  summary: z.string().describe("Optional named-version summary.").optional()
29928
29934
  }),
29929
- validation: documentOwnerValidation(true)
29935
+ validation: documentOwnerValidation(true, true)
29930
29936
  },
29931
29937
  {
29932
29938
  name: "dispatch_doc_read",
package/dist/legion.js CHANGED
@@ -29781,15 +29781,17 @@ function dispatchToolSchema(spec, z, opts) {
29781
29781
  }
29782
29782
  var ISSUE_REFERENCE = "An issue is a native KEY or external owner/repo#n reference; an external reference creates its native issue in the repository's dashboard-configured project or, failing that, the default project (DISPATCH_DEFAULT_PROJECT).";
29783
29783
  var OWNER_REFERENCE = "Exactly one of issue and project is required. An issue is a native KEY or external owner/repo#n reference; a project is a project key such as CORE and addresses an unlinked project document named by artifact.";
29784
- function documentOwnerValidation(requireArtifact) {
29784
+ function documentOwnerValidation(requireArtifact, alwaysRequireArtifact = false) {
29785
29785
  return {
29786
29786
  check: (value) => {
29787
29787
  const input = value;
29788
29788
  const hasIssue = typeof input.issue === "string";
29789
29789
  const hasProject = typeof input.project === "string";
29790
- return (hasIssue !== hasProject || !hasIssue && !hasProject && typeof input.ref === "string") && (!hasProject || !requireArtifact || typeof input.artifact === "string");
29790
+ const hasArtifact = typeof input.artifact === "string";
29791
+ const hasRef = typeof input.ref === "string";
29792
+ return (hasIssue !== hasProject || !hasIssue && !hasProject && hasRef) && (!hasProject || !requireArtifact || hasArtifact) && (!alwaysRequireArtifact || hasArtifact || hasRef);
29791
29793
  },
29792
- message: "Exactly one of issue and project is required; with project, artifact names the document."
29794
+ message: alwaysRequireArtifact ? "Exactly one of issue and project is required; artifact or ref must name the document." : "Exactly one of issue and project is required; with project, artifact names the document."
29793
29795
  };
29794
29796
  }
29795
29797
  var SPEC_SECTIONS = [
@@ -29824,6 +29826,7 @@ var dispatchToolSpecs = [
29824
29826
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
29825
29827
  project: z.string().describe("Project key owning the document.").optional(),
29826
29828
  artifact: z.string().describe("Project document slug or id.").optional(),
29829
+ ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
29827
29830
  question: z.string({ max: 800 }).describe("Decision question, at most 800 characters."),
29828
29831
  options: z.array(z.object({
29829
29832
  label: z.string().describe("Selectable option label."),
@@ -29876,6 +29879,7 @@ var dispatchToolSpecs = [
29876
29879
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
29877
29880
  project: z.string().describe("Project key owning the document.").optional(),
29878
29881
  artifact: z.string().describe("Artifact slug or id required when quote is given.").optional(),
29882
+ ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
29879
29883
  quote: z.string().describe("Optional exact quoted document text.").optional(),
29880
29884
  occurrence: z.number({ int: true, min: 0 }).describe("Optional zero-based occurrence of quote.").optional(),
29881
29885
  body: z.string({ max: 2000 }).describe("Review comment, at most 2,000 characters."),
@@ -29890,13 +29894,14 @@ var dispatchToolSpecs = [
29890
29894
  arguments: (z) => ({
29891
29895
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
29892
29896
  project: z.string().describe("Project key owning the document.").optional(),
29893
- artifact: z.string().describe("Artifact slug or id containing the quoted text."),
29897
+ artifact: z.string().describe("Artifact slug or id containing the quoted text; optional when ref names it.").optional(),
29898
+ ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
29894
29899
  quote: z.string().describe("Exact document text to replace."),
29895
29900
  replace_with: z.string().describe("Replacement text."),
29896
29901
  body: z.string({ max: 2000 }).describe("Optional rationale, at most 2,000 characters.").optional(),
29897
29902
  occurrence: z.number({ int: true, min: 0 }).describe("Optional zero-based occurrence of quote.").optional()
29898
29903
  }),
29899
- validation: documentOwnerValidation(true)
29904
+ validation: documentOwnerValidation(true, true)
29900
29905
  },
29901
29906
  {
29902
29907
  name: "dispatch_message",
@@ -29913,7 +29918,8 @@ var dispatchToolSpecs = [
29913
29918
  arguments: (z) => ({
29914
29919
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
29915
29920
  project: z.string().describe("Project key owning the document.").optional(),
29916
- artifact: z.string().describe("Artifact slug or id for the document."),
29921
+ artifact: z.string().describe("Artifact slug or id for the document; optional when ref names it.").optional(),
29922
+ ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
29917
29923
  ops: z.array(z.object({
29918
29924
  op: z.enum(DOC_EDIT_OPS).describe("Edit operation."),
29919
29925
  find: z.string().describe("Text to find for replace or delete.").optional(),
@@ -29925,7 +29931,7 @@ var dispatchToolSpecs = [
29925
29931
  })).describe("Flat tagged edits; the server validates fields required for each operation."),
29926
29932
  summary: z.string().describe("Optional named-version summary.").optional()
29927
29933
  }),
29928
- validation: documentOwnerValidation(true)
29934
+ validation: documentOwnerValidation(true, true)
29929
29935
  },
29930
29936
  {
29931
29937
  name: "dispatch_doc_read",
@@ -169,19 +169,22 @@ retrying. Pass `summary` to name the version when recording a decision.
169
169
  Add feedback with:
170
170
 
171
171
  ```ts
172
- dispatch_comment({ issue?, project?, artifact?, quote?, occurrence?, body, reply_to?, reply_to_ask? })
172
+ dispatch_comment({ issue?, project?, artifact?, ref?, quote?, occurrence?, body, reply_to?, reply_to_ask? })
173
173
  ```
174
174
 
175
- It returns issue or project-document owner details plus `comment` and, for writes, `topic`. `quote` requires `artifact`; omit both for a
176
- floating issue comment. A reply (`reply_to`/`reply_to_ask`) takes no `quote`; it belongs to its parent's anchor. Use `reply_to` to
177
- continue a comment thread at its root; a reply to a resolved thread reopens it. Use `reply_to_ask` to reply directly under a question
178
- asked with `dispatch_ask`. Comments are edited only by their author from the dashboard. A delivered `comment.created` event carries the
179
- comment `id`; reply to it with `dispatch_comment({ reply_to: <id> })`.
175
+ It returns issue or project-document owner details plus `comment` and, for writes, `topic`.
176
+ `ref` names the owner (an issue or project-document reference) in place of `issue`/`project`.
177
+ `quote` requires `artifact`; omit both for a floating issue comment. A reply (`reply_to`/`reply_to_ask`)
178
+ takes no `quote`; it belongs to its parent's anchor. Use `reply_to` to continue a comment thread at
179
+ its root; a reply to a resolved thread reopens it. Use `reply_to_ask` to reply directly under a
180
+ question asked with `dispatch_ask`. Comments are edited only by their author from the dashboard. A
181
+ delivered `comment.created` event carries the comment `id`; reply to it with
182
+ `dispatch_comment({ reply_to: <id> })`.
180
183
 
181
184
  Propose an exact replacement instead of describing it:
182
185
 
183
186
  ```ts
184
- dispatch_suggest({ issue?, project?, artifact, quote, replace_with, body?, occurrence? })
187
+ dispatch_suggest({ issue?, project?, artifact, ref?, quote, replace_with, body?, occurrence? })
185
188
  ```
186
189
 
187
190
  It returns issue or project-document owner details plus `comment` and its write `topic`. A human accepts or rejects a suggestion.
@@ -238,7 +241,12 @@ message ref, it returns that message and its reply chain. Reads do not subscribe
238
241
 
239
242
  ## References
240
243
 
241
- Use these in document, ask, comment, and message bodies; Dispatch unfurls them:
244
+ Use these in document, ask, comment, and message bodies. In the dashboard, a reference renders
245
+ as an inline link whose text is the target's title (an issue's title, an ask's question, a
246
+ comment's first line, a document's name) once it resolves; a body that is only a bare reference
247
+ still gets an unfurl card instead. Every `ref` argument below (and `issue`/`project`) accepts
248
+ either form — an issue key or a project key is never ambiguous, since a project key never
249
+ contains a dash:
242
250
 
243
251
  ```text
244
252
  dispatch://KEY
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion-envoy",
3
- "version": "0.42.0",
3
+ "version": "0.43.0",
4
4
  "type": "module",
5
5
  "omp": {
6
6
  "extensions": [