@sjawhar/pi-legion-envoy 5.30.7 → 5.30.8

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
@@ -34081,17 +34081,19 @@ async function refuseRemovingOpenDecisionBlocks(client, tool, resolved, ops) {
34081
34081
  ].join(`
34082
34082
  `));
34083
34083
  }
34084
- function refusalWithCode(error48, suffix = "") {
34084
+ function refusalWithCode(error48, ...clauses) {
34085
+ const suffix = clauses.filter((clause) => clause !== "").join("; ");
34086
+ const joined = suffix === "" ? "" : `; ${suffix}`;
34085
34087
  if (error48 instanceof DispatchGatewayError) {
34086
34088
  let told = error48.message;
34087
- if (suffix !== "") {
34088
- told = error48.mayHaveReachedDispatch ? `${error48.answer}${suffix}` : `${error48.answer}, so ${error48.advice}${suffix}`;
34089
+ if (joined !== "") {
34090
+ told = error48.mayHaveReachedDispatch ? `${error48.answer}${joined}` : `${error48.answer}, so ${error48.advice}${joined}`;
34089
34091
  }
34090
34092
  return new DispatchGatewayError(error48.status, error48.answer, error48.advice, `${error48.code}: ${told}`);
34091
34093
  }
34092
34094
  if (!(error48 instanceof DispatchServiceError))
34093
34095
  return error48;
34094
- return new DispatchServiceError(error48.code, error48.status, `${error48.code}: ${error48.message}${suffix}`, error48.candidates, error48.current, error48.mismatches);
34096
+ return new DispatchServiceError(error48.code, error48.status, `${error48.code}: ${error48.message}${joined}`, error48.candidates, error48.current, error48.mismatches);
34095
34097
  }
34096
34098
  function dispatchAnswered(error48, status) {
34097
34099
  return error48 instanceof DispatchServiceError && error48.fromDispatch && error48.status === status;
@@ -34277,7 +34279,7 @@ async function executeDispatchTool(input) {
34277
34279
  } catch (error48) {
34278
34280
  const told = writeMayHaveLanded(error48) ? "the reason may or may not have been posted, and the close was not sent: read the issue's messages before retrying, since retrying this call posts its reason again" : "the reason was not posted, so the close was not sent";
34279
34281
  if (error48 instanceof DispatchServiceError)
34280
- throw refusalWithCode(error48, `; ${told}`);
34282
+ throw refusalWithCode(error48, told);
34281
34283
  throw withAccount(error48, told);
34282
34284
  }
34283
34285
  }
@@ -34297,14 +34299,14 @@ async function executeDispatchTool(input) {
34297
34299
  actor
34298
34300
  });
34299
34301
  } catch (error48) {
34300
- const taken = dispatchAnswered(error48, 500) && newLinks.length > 0 ? `; one of ${newLinks.join(", ")} may already be linked from another issue (a URL links exactly one issue)` : "";
34302
+ const taken = dispatchAnswered(error48, 500) && newLinks.length > 0 ? `one of ${newLinks.join(", ")} may already be linked from another issue (a URL links exactly one issue)` : "";
34301
34303
  if (closingNote === undefined)
34302
34304
  throw refusalWithCode(error48, taken);
34303
34305
  const posted = `the reason already landed as message ${closingNote.id} (${closingNote.ref})`;
34304
34306
  const fix = error48 instanceof DispatchGatewayError && error48.transient ? "" : "fix what refused the close, then ";
34305
34307
  const landed = writeMayHaveLanded(error48) ? `${posted}, and the close may or may not have taken effect. Read the issue's status before retrying: done means it closed; otherwise retry with a reason that points at message ${closingNote.id}, since retrying this call posts its reason again` : `${posted} but the issue did not close. Retrying this call posts its reason again, so ${fix}retry with a reason that points at message ${closingNote.id}`;
34306
34308
  if (error48 instanceof DispatchServiceError)
34307
- throw refusalWithCode(error48, `${taken}; ${landed}`);
34309
+ throw refusalWithCode(error48, taken, landed);
34308
34310
  throw withAccount(error48, landed);
34309
34311
  }
34310
34312
  const linkCount = `(${after.external_links.length} ${after.external_links.length === 1 ? "link" : "links"})`;
@@ -35997,6 +35999,12 @@ async function copySessionID(copyToClipboard2, sessionID) {
35997
35999
  var codec2 = import_nats2.StringCodec();
35998
36000
  var NATS_RETRY_INTERVAL_MS = 15000;
35999
36001
  var CAPABILITIES_WITHOUT_BTW = DELIVERY_CAPABILITIES.filter((capability) => capability !== "btw");
36002
+ var ClaimIdentitySchema = DedupeIdentitySchema.extend({
36003
+ event_id: DedupeIdentitySchema.shape.event_id.catch(undefined),
36004
+ dedupe_key: DedupeIdentitySchema.shape.dedupe_key.catch(undefined),
36005
+ source: DedupeIdentitySchema.shape.source.catch(undefined),
36006
+ source_event_id: DedupeIdentitySchema.shape.source_event_id.catch(undefined)
36007
+ });
36000
36008
  var ROLE_CLAIM_ENTRY = "envoy-role-claim";
36001
36009
  var OPEN_ASKS_TIMEOUT_MS = 3000;
36002
36010
  var USER_TURN_ACCEPT_TIMEOUT_MS = 1e4;
@@ -36252,7 +36260,8 @@ function envoyExtension(pi) {
36252
36260
  }
36253
36261
  for (const topic of subscriptionRemovedTopics(raw, sessionID) ?? [])
36254
36262
  closeIntentionally(topic);
36255
- const claim2 = rendered.skip ? undefined : delivered.claim(rendered.envelope);
36263
+ const dedupeIdentity = ClaimIdentitySchema.safeParse(rendered.envelope);
36264
+ const claim2 = rendered.skip ? undefined : delivered.claim(dedupeIdentity.success ? dedupeIdentity.data : undefined);
36256
36265
  if (claim2 !== undefined) {
36257
36266
  const envelope2 = rendered.envelope;
36258
36267
  if (envelope2 !== undefined) {
package/dist/legion.js CHANGED
@@ -32949,17 +32949,19 @@ async function refuseRemovingOpenDecisionBlocks(client, tool, resolved, ops) {
32949
32949
  ].join(`
32950
32950
  `));
32951
32951
  }
32952
- function refusalWithCode(error48, suffix = "") {
32952
+ function refusalWithCode(error48, ...clauses) {
32953
+ const suffix = clauses.filter((clause) => clause !== "").join("; ");
32954
+ const joined = suffix === "" ? "" : `; ${suffix}`;
32953
32955
  if (error48 instanceof DispatchGatewayError) {
32954
32956
  let told = error48.message;
32955
- if (suffix !== "") {
32956
- told = error48.mayHaveReachedDispatch ? `${error48.answer}${suffix}` : `${error48.answer}, so ${error48.advice}${suffix}`;
32957
+ if (joined !== "") {
32958
+ told = error48.mayHaveReachedDispatch ? `${error48.answer}${joined}` : `${error48.answer}, so ${error48.advice}${joined}`;
32957
32959
  }
32958
32960
  return new DispatchGatewayError(error48.status, error48.answer, error48.advice, `${error48.code}: ${told}`);
32959
32961
  }
32960
32962
  if (!(error48 instanceof DispatchServiceError))
32961
32963
  return error48;
32962
- return new DispatchServiceError(error48.code, error48.status, `${error48.code}: ${error48.message}${suffix}`, error48.candidates, error48.current, error48.mismatches);
32964
+ return new DispatchServiceError(error48.code, error48.status, `${error48.code}: ${error48.message}${joined}`, error48.candidates, error48.current, error48.mismatches);
32963
32965
  }
32964
32966
  function dispatchAnswered(error48, status) {
32965
32967
  return error48 instanceof DispatchServiceError && error48.fromDispatch && error48.status === status;
@@ -33145,7 +33147,7 @@ async function executeDispatchTool(input) {
33145
33147
  } catch (error48) {
33146
33148
  const told = writeMayHaveLanded(error48) ? "the reason may or may not have been posted, and the close was not sent: read the issue's messages before retrying, since retrying this call posts its reason again" : "the reason was not posted, so the close was not sent";
33147
33149
  if (error48 instanceof DispatchServiceError)
33148
- throw refusalWithCode(error48, `; ${told}`);
33150
+ throw refusalWithCode(error48, told);
33149
33151
  throw withAccount(error48, told);
33150
33152
  }
33151
33153
  }
@@ -33165,14 +33167,14 @@ async function executeDispatchTool(input) {
33165
33167
  actor
33166
33168
  });
33167
33169
  } catch (error48) {
33168
- const taken = dispatchAnswered(error48, 500) && newLinks.length > 0 ? `; one of ${newLinks.join(", ")} may already be linked from another issue (a URL links exactly one issue)` : "";
33170
+ const taken = dispatchAnswered(error48, 500) && newLinks.length > 0 ? `one of ${newLinks.join(", ")} may already be linked from another issue (a URL links exactly one issue)` : "";
33169
33171
  if (closingNote === undefined)
33170
33172
  throw refusalWithCode(error48, taken);
33171
33173
  const posted = `the reason already landed as message ${closingNote.id} (${closingNote.ref})`;
33172
33174
  const fix = error48 instanceof DispatchGatewayError && error48.transient ? "" : "fix what refused the close, then ";
33173
33175
  const landed = writeMayHaveLanded(error48) ? `${posted}, and the close may or may not have taken effect. Read the issue's status before retrying: done means it closed; otherwise retry with a reason that points at message ${closingNote.id}, since retrying this call posts its reason again` : `${posted} but the issue did not close. Retrying this call posts its reason again, so ${fix}retry with a reason that points at message ${closingNote.id}`;
33174
33176
  if (error48 instanceof DispatchServiceError)
33175
- throw refusalWithCode(error48, `${taken}; ${landed}`);
33177
+ throw refusalWithCode(error48, taken, landed);
33176
33178
  throw withAccount(error48, landed);
33177
33179
  }
33178
33180
  const linkCount = `(${after.external_links.length} ${after.external_links.length === 1 ? "link" : "links"})`;
@@ -33826,7 +33828,7 @@ import { logger } from "@oh-my-pi/pi-utils";
33826
33828
  // package.json
33827
33829
  var package_default = {
33828
33830
  name: "@sjawhar/pi-legion-envoy",
33829
- version: "5.30.7",
33831
+ version: "5.30.8",
33830
33832
  type: "module",
33831
33833
  omp: {
33832
33834
  extensions: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion-envoy",
3
- "version": "5.30.7",
3
+ "version": "5.30.8",
4
4
  "type": "module",
5
5
  "omp": {
6
6
  "extensions": [