@sjawhar/pi-legion-envoy 7.9.2 → 7.10.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
@@ -29659,6 +29659,7 @@ var DEFAULT_ISSUE_PAGE_LIMIT = 50;
29659
29659
  var ASK_TURNS = ["human", "agent"];
29660
29660
  var DELIVERY_CAPABILITIES = ["aside", "btw", "steer"];
29661
29661
  var DELIVERY_DUPLICATE_WINDOW_MS = 72 * 60 * 60 * 1000;
29662
+ var SEARCH_DEGRADED_EMBEDDER_UNAVAILABLE = "embedder_unavailable";
29662
29663
  var DispatchEventSchema = exports_external.object({
29663
29664
  issue_key: exports_external.string().nullable(),
29664
29665
  artifact_id: exports_external.string().nullish(),
@@ -33088,14 +33089,20 @@ function searchAnswer(search, query, offset, configUrl) {
33088
33089
  const lines = results.map((result) => searchResultLine(result, configUrl));
33089
33090
  const noun = count === 1 ? "result" : "results";
33090
33091
  const noResults = `No results for "${query}".`;
33092
+ const degraded = search.degraded === SEARCH_DEGRADED_EMBEDDER_UNAVAILABLE ? "Searched by keyword only: meaning search was unavailable for this request." : undefined;
33091
33093
  if (typeof search.total !== "number") {
33092
33094
  if (offset !== undefined && offset > 0) {
33093
33095
  throw new Error(`Dispatch answered without a total: it predates search paging and ignored offset ${offset}, so this would be its first page again.`);
33094
33096
  }
33095
33097
  return {
33096
- text: count === 0 ? noResults : [`${count} ${noun} for "${query}" (${search.took_ms} ms)`, ...lines].join(`
33098
+ text: count === 0 ? [noResults, ...degraded === undefined ? [] : [degraded]].join(`
33099
+ `) : [
33100
+ `${count} ${noun} for "${query}" (${search.took_ms} ms)`,
33101
+ ...degraded === undefined ? [] : [degraded],
33102
+ ...lines
33103
+ ].join(`
33097
33104
  `),
33098
- details: { query, results }
33105
+ details: { query, results, ...degraded === undefined ? {} : { degraded: search.degraded } }
33099
33106
  };
33100
33107
  }
33101
33108
  const { total, reachable, offset: pageOffset } = search;
@@ -33107,12 +33114,15 @@ function searchAnswer(search, query, offset, configUrl) {
33107
33114
  total,
33108
33115
  reachable,
33109
33116
  offset: pageOffset,
33110
- limit: search.limit
33117
+ limit: search.limit,
33118
+ ...degraded === undefined ? {} : { degraded: search.degraded }
33111
33119
  };
33112
33120
  if (count === 0) {
33113
33121
  return {
33114
- text: total === 0 ? noResults : [
33122
+ text: total === 0 ? [noResults, ...degraded === undefined ? [] : [degraded]].join(`
33123
+ `) : [
33115
33124
  `No results for "${query}" at offset ${pageOffset}: it matches ${total}, and the pages reach the first ${reachable}.`,
33125
+ ...degraded === undefined ? [] : [degraded],
33116
33126
  ...cut === undefined ? [] : [cut]
33117
33127
  ].join(`
33118
33128
  `),
@@ -33123,6 +33133,7 @@ function searchAnswer(search, query, offset, configUrl) {
33123
33133
  return {
33124
33134
  text: [
33125
33135
  `${count} ${noun} for "${query}" (${showing}${search.took_ms} ms)`,
33136
+ ...degraded === undefined ? [] : [degraded],
33126
33137
  ...cut === undefined ? [] : [cut],
33127
33138
  ...lines,
33128
33139
  ...end < reachable ? [`Next page: offset ${end}.`] : []
package/dist/legion.js CHANGED
@@ -13746,6 +13746,7 @@ var DEFAULT_ISSUE_PAGE_LIMIT = 50;
13746
13746
  var ASK_TURNS = ["human", "agent"];
13747
13747
  var DELIVERY_CAPABILITIES = ["aside", "btw", "steer"];
13748
13748
  var DELIVERY_DUPLICATE_WINDOW_MS = 72 * 60 * 60 * 1000;
13749
+ var SEARCH_DEGRADED_EMBEDDER_UNAVAILABLE = "embedder_unavailable";
13749
13750
  var DispatchEventSchema = exports_external.object({
13750
13751
  issue_key: exports_external.string().nullable(),
13751
13752
  artifact_id: exports_external.string().nullish(),
@@ -15843,14 +15844,20 @@ function searchAnswer(search, query, offset, configUrl) {
15843
15844
  const lines = results.map((result) => searchResultLine(result, configUrl));
15844
15845
  const noun = count === 1 ? "result" : "results";
15845
15846
  const noResults = `No results for "${query}".`;
15847
+ const degraded = search.degraded === SEARCH_DEGRADED_EMBEDDER_UNAVAILABLE ? "Searched by keyword only: meaning search was unavailable for this request." : undefined;
15846
15848
  if (typeof search.total !== "number") {
15847
15849
  if (offset !== undefined && offset > 0) {
15848
15850
  throw new Error(`Dispatch answered without a total: it predates search paging and ignored offset ${offset}, so this would be its first page again.`);
15849
15851
  }
15850
15852
  return {
15851
- text: count === 0 ? noResults : [`${count} ${noun} for "${query}" (${search.took_ms} ms)`, ...lines].join(`
15853
+ text: count === 0 ? [noResults, ...degraded === undefined ? [] : [degraded]].join(`
15854
+ `) : [
15855
+ `${count} ${noun} for "${query}" (${search.took_ms} ms)`,
15856
+ ...degraded === undefined ? [] : [degraded],
15857
+ ...lines
15858
+ ].join(`
15852
15859
  `),
15853
- details: { query, results }
15860
+ details: { query, results, ...degraded === undefined ? {} : { degraded: search.degraded } }
15854
15861
  };
15855
15862
  }
15856
15863
  const { total, reachable, offset: pageOffset } = search;
@@ -15862,12 +15869,15 @@ function searchAnswer(search, query, offset, configUrl) {
15862
15869
  total,
15863
15870
  reachable,
15864
15871
  offset: pageOffset,
15865
- limit: search.limit
15872
+ limit: search.limit,
15873
+ ...degraded === undefined ? {} : { degraded: search.degraded }
15866
15874
  };
15867
15875
  if (count === 0) {
15868
15876
  return {
15869
- text: total === 0 ? noResults : [
15877
+ text: total === 0 ? [noResults, ...degraded === undefined ? [] : [degraded]].join(`
15878
+ `) : [
15870
15879
  `No results for "${query}" at offset ${pageOffset}: it matches ${total}, and the pages reach the first ${reachable}.`,
15880
+ ...degraded === undefined ? [] : [degraded],
15871
15881
  ...cut === undefined ? [] : [cut]
15872
15882
  ].join(`
15873
15883
  `),
@@ -15878,6 +15888,7 @@ function searchAnswer(search, query, offset, configUrl) {
15878
15888
  return {
15879
15889
  text: [
15880
15890
  `${count} ${noun} for "${query}" (${showing}${search.took_ms} ms)`,
15891
+ ...degraded === undefined ? [] : [degraded],
15881
15892
  ...cut === undefined ? [] : [cut],
15882
15893
  ...lines,
15883
15894
  ...end < reachable ? [`Next page: offset ${end}.`] : []
@@ -18031,7 +18042,7 @@ function endInjectedUserTurns(sessionID) {
18031
18042
  // package.json
18032
18043
  var package_default = {
18033
18044
  name: "@sjawhar/pi-legion-envoy",
18034
- version: "7.9.2",
18045
+ version: "7.10.0",
18035
18046
  license: "Apache-2.0",
18036
18047
  type: "module",
18037
18048
  omp: {
@@ -164,14 +164,14 @@ do with each hit. What it leaves out:
164
164
  dispatch_search({ query, project?, limit?, offset? })
165
165
  ```
166
166
  Websearch syntax applies: `"merge queue"`, `-daemon`, `OR`. Issues, documents, asks, comments, and messages rank separately; the
167
- merged page orders each kind's best in turn — issue, document, ask, comment, message — and a bare issue key ranks first. A page
168
- holds `limit` hits (20 default, 50 max); the first line gives the total (`showing 1-20 of 312`); see
169
- [Search paging](skill://dispatch/references/issues.md#search-paging) for more. Queries over 1,000 characters are refused: use the
170
- few words `skill://dispatch-first` names, never a pasted passage. Issue hits start with the issue key; document hits start with
171
- `dispatch://PROJECT/artifact/<slug>`, then the link. Cite the hit (`dispatch://KEY` or the doc ref) or say "no prior issue".
172
-
173
- `dispatch_issue` refuses a title that near-duplicates an issue in the same project and returns the candidates (`POSSIBLE_DUPLICATE`).
174
- Read them; reference the existing issue, or repeat the call with `force: true` when it is genuinely new work.
167
+ merged page orders each kind's best in turn — issue, document, ask, comment, message — and a bare issue key ranks first. Each
168
+ kind's list also merges a query embedding's meaning match with keyword hits (LEGION-549): a paraphrase with no shared word can
169
+ still match; without an embedder, it says so and ranks by keyword alone. A page holds `limit` hits (20 default, 50 max); the first
170
+ line gives the total (`showing 1-20 of 312`); see [Search paging](skill://dispatch/references/issues.md#search-paging) for more.
171
+ Queries over 1,000 characters are refused: use the few words `skill://dispatch-first` names, never a pasted passage. Issue hits
172
+ start with the issue key; document hits start with `dispatch://PROJECT/artifact/<slug>`, then the link. Cite the hit (`dispatch://KEY` or the doc ref) or say "no prior issue".
173
+
174
+ `dispatch_issue` refuses a title that near-duplicates an issue in the same project and returns the candidates (`POSSIBLE_DUPLICATE`). Read them; reference the existing issue, or repeat the call with `force: true` when it is genuinely new work.
175
175
  The check compares title words only (shared stemmed terms), never meaning: "four tests that fail a
176
176
  merge" pairs with "four CI gates that cannot fail a merge". So when you force past a candidate, give
177
177
  the new issue a title that names what differs where you can, and open its spec with the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion-envoy",
3
- "version": "7.9.2",
3
+ "version": "7.10.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "omp": {