@remnic/core 9.3.648 → 9.3.650

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.
Files changed (54) hide show
  1. package/dist/access-cli.js +4 -4
  2. package/dist/access-http.d.ts +2 -2
  3. package/dist/access-http.js +4 -4
  4. package/dist/access-mcp.d.ts +2 -2
  5. package/dist/access-mcp.js +3 -3
  6. package/dist/{access-service-DFXIlGvZ.d.ts → access-service-DIZRHQ7Q.d.ts} +255 -2
  7. package/dist/access-service.d.ts +2 -2
  8. package/dist/access-service.js +2 -2
  9. package/dist/bootstrap.d.ts +1 -1
  10. package/dist/{chunk-TWVRDGTX.js → chunk-23RYLGYA.js} +185 -55
  11. package/dist/chunk-23RYLGYA.js.map +1 -0
  12. package/dist/{chunk-CNRZ6WJU.js → chunk-3IJEQWQX.js} +4 -4
  13. package/dist/{chunk-XUGQQPGO.js → chunk-AGRPGAKR.js} +12 -1
  14. package/dist/chunk-AGRPGAKR.js.map +1 -0
  15. package/dist/{chunk-6GIKAUTN.js → chunk-MMJANTJX.js} +33 -2
  16. package/dist/{chunk-6GIKAUTN.js.map → chunk-MMJANTJX.js.map} +1 -1
  17. package/dist/{chunk-6BNFVP7Y.js → chunk-RZOBQ23O.js} +2 -2
  18. package/dist/{chunk-AEIZEAP7.js → chunk-TUMH6EDV.js} +12 -15
  19. package/dist/chunk-TUMH6EDV.js.map +1 -0
  20. package/dist/{chunk-FUXV6HSO.js → chunk-TVOPSKOK.js} +3 -3
  21. package/dist/{chunk-5ETA6OAS.js → chunk-YAFSTKTH.js} +608 -80
  22. package/dist/chunk-YAFSTKTH.js.map +1 -0
  23. package/dist/{cli-DrL2Nv4j.d.ts → cli-BG4ybtJr.d.ts} +2 -2
  24. package/dist/cli.d.ts +3 -3
  25. package/dist/cli.js +7 -7
  26. package/dist/explicit-capture.d.ts +1 -1
  27. package/dist/index.d.ts +4 -4
  28. package/dist/index.js +8 -8
  29. package/dist/mcp-memory-inspector-app.d.ts +2 -2
  30. package/dist/{orchestrator-DEQW9j0Z.d.ts → orchestrator-CX-oqwJq.d.ts} +58 -0
  31. package/dist/orchestrator.d.ts +1 -1
  32. package/dist/orchestrator.js +3 -3
  33. package/dist/resume-bundles.js +2 -2
  34. package/dist/transcript.d.ts +18 -1
  35. package/dist/transcript.js +5 -3
  36. package/package.json +1 -1
  37. package/src/access-service-lcm-forgery.test.ts +410 -0
  38. package/src/access-service-observe-lcm-parity.test.ts +1397 -0
  39. package/src/access-service-observe-scope.test.ts +599 -0
  40. package/src/access-service-raw-excerpt-read-gate.test.ts +443 -0
  41. package/src/access-service.ts +1270 -113
  42. package/src/cli.ts +10 -12
  43. package/src/coding/coding-namespace.test.ts +44 -0
  44. package/src/coding/coding-namespace.ts +163 -0
  45. package/src/orchestrator.ts +335 -77
  46. package/src/transcript-day-range.test.ts +101 -0
  47. package/src/transcript.ts +26 -0
  48. package/dist/chunk-5ETA6OAS.js.map +0 -1
  49. package/dist/chunk-AEIZEAP7.js.map +0 -1
  50. package/dist/chunk-TWVRDGTX.js.map +0 -1
  51. package/dist/chunk-XUGQQPGO.js.map +0 -1
  52. /package/dist/{chunk-CNRZ6WJU.js.map → chunk-3IJEQWQX.js.map} +0 -0
  53. /package/dist/{chunk-6BNFVP7Y.js.map → chunk-RZOBQ23O.js.map} +0 -0
  54. /package/dist/{chunk-FUXV6HSO.js.map → chunk-TVOPSKOK.js.map} +0 -0
@@ -231,7 +231,7 @@ import {
231
231
  } from "./chunk-ZRWB5D4H.js";
232
232
  import {
233
233
  TranscriptManager
234
- } from "./chunk-XUGQQPGO.js";
234
+ } from "./chunk-AGRPGAKR.js";
235
235
  import {
236
236
  NamespaceStorageRouter
237
237
  } from "./chunk-D6WVJIS3.js";
@@ -303,8 +303,9 @@ import {
303
303
  import {
304
304
  clusterByKey,
305
305
  combineNamespaces,
306
+ lcmReadSessionIdsForNamespaces,
306
307
  resolveCodingNamespaceOverlay
307
- } from "./chunk-6GIKAUTN.js";
308
+ } from "./chunk-MMJANTJX.js";
308
309
  import {
309
310
  listTrustZoneRecords,
310
311
  searchTrustZoneRecords
@@ -2512,6 +2513,52 @@ var Orchestrator = class _Orchestrator {
2512
2513
  );
2513
2514
  return this.applyCodingNamespaceOverlay(sessionKey, base);
2514
2515
  }
2516
+ /**
2517
+ * Effective namespace a same-session LCM/structured-history READER must use
2518
+ * to find what the access `observe` surface WROTE (#1495 thread 2).
2519
+ *
2520
+ * This MUST mirror the `observe` scope plan's write-namespace resolution, NOT
2521
+ * `resolveSelfNamespace`: when no coding overlay applies, `observe` archives
2522
+ * under `config.defaultNamespace` (an unqualified observed turn is NOT moved
2523
+ * to the principal self namespace — identical to
2524
+ * `resolveCodingScopedWriteNamespace`/`memory_store`, rule 39). Only when a
2525
+ * coding overlay actually changes the namespace does the writer (and so the
2526
+ * reader) use the overlaid `project-*` namespace. Returning the self base for
2527
+ * the no-overlay case would prefix the read key with a namespace the writer
2528
+ * never used, so the reader would miss its own evidence.
2529
+ *
2530
+ * Honours the access-surface `principalOverride` (#1505 thread 2, codex): when
2531
+ * a recall supplies an authenticated principal NOT encoded in the raw
2532
+ * `sessionKey`, `observe` archived LCM under THAT principal's base namespace.
2533
+ * Deriving the base from `resolvePrincipal(sessionKey)` alone could fall back
2534
+ * to `default`, so principal `alice` observing `sess-1` would write under
2535
+ * `alice` but READ under `default`. Threading the override here keeps the read
2536
+ * base identical to the write base.
2537
+ *
2538
+ * READ-AUTHORIZATION gate (#1505 round 3, codex P2 "Gate LCM recall keys by
2539
+ * readable namespaces"): the overlay LCM read key is a `<principal>-project-*`
2540
+ * sub-namespace of the principal SELF base. The normal recall namespace set
2541
+ * below only substitutes the coding overlay when the principal SELF base is
2542
+ * actually in the readable recall set (`recallNamespacesForPrincipal` — gated
2543
+ * by `defaultRecallNamespaces.includes("self")` AND `canReadNamespace`). If a
2544
+ * principal can WRITE but not READ its self namespace (or `defaultRecall-
2545
+ * Namespaces` omits `self`), QMD/file recall never touches those overlay rows,
2546
+ * so neither may the LCM read key. When the self base is NOT readable, fall
2547
+ * back to the default store — exactly what an unqualified, unauthorized recall
2548
+ * resolves to — rather than injecting overlay rows the rest of recall excludes
2549
+ * (rule 42 read/write parity; rule 48 least-privilege).
2550
+ */
2551
+ lcmReadNamespaceForSession(sessionKey, principalOverride) {
2552
+ const principal = typeof principalOverride === "string" && principalOverride.length > 0 ? principalOverride : this.resolvePrincipal(sessionKey);
2553
+ const base = defaultNamespaceForPrincipal(principal, this.config);
2554
+ const overlaid = this.applyCodingNamespaceOverlay(sessionKey, base);
2555
+ if (overlaid === base) return this.config.defaultNamespace;
2556
+ const selfReadableInRecall = recallNamespacesForPrincipal(
2557
+ principal,
2558
+ this.config
2559
+ ).includes(base);
2560
+ return selfReadableInRecall ? overlaid : this.config.defaultNamespace;
2561
+ }
2515
2562
  /**
2516
2563
  * Attach a coding-agent context to a session (issue #569). Called by the
2517
2564
  * Claude Code / Codex / Cursor connectors at session start after
@@ -6142,6 +6189,30 @@ ${r.snippet.trim()}
6142
6189
  } else {
6143
6190
  recallNamespaces = readableRecallNamespaces;
6144
6191
  }
6192
+ const codingOverlaySelfReadable = codingOverlay !== null && readableRecallNamespaces.includes(principalSelfNamespace);
6193
+ let lcmReadNamespaces;
6194
+ if (namespaceOverride) {
6195
+ lcmReadNamespaces = [namespaceOverride];
6196
+ } else if (codingOverlay && codingSelfNamespace && codingOverlaySelfReadable) {
6197
+ const fallbackNs = codingOverlay.readFallbacks.map(
6198
+ (fallback) => combineNamespaces(principalSelfNamespace, fallback)
6199
+ );
6200
+ lcmReadNamespaces = [codingSelfNamespace, ...fallbackNs];
6201
+ } else {
6202
+ lcmReadNamespaces = [this.config.defaultNamespace];
6203
+ }
6204
+ const lcmReadSessionIds = lcmReadSessionIdsForNamespaces(
6205
+ lcmReadNamespaces,
6206
+ sessionKey,
6207
+ this.config.defaultNamespace
6208
+ );
6209
+ const firstNonEmptyLcmRead = async (read, isEmpty, empty) => {
6210
+ for (const lcmSessionId of lcmReadSessionIds) {
6211
+ const value = await read(lcmSessionId);
6212
+ if (!isEmpty(value)) return value;
6213
+ }
6214
+ return empty;
6215
+ };
6145
6216
  const qmdAvailable = this.qmd.isAvailable();
6146
6217
  let graphDecisionStatus = recallDecision.plannedMode === "graph_mode" ? "skipped" : "not_requested";
6147
6218
  let graphDecisionReason = recallDecision.graphReason;
@@ -7933,13 +8004,21 @@ ${formatted}`;
7933
8004
  const explicitCueMaxChars = this.getRecallSectionMaxChars("explicit-cue") ?? this.config.explicitCueRecallMaxChars;
7934
8005
  if (this.config.explicitCueRecallEnabled && this.isRecallSectionEnabled("explicit-cue") && explicitCueMaxChars !== 0 && this.lcmEngine?.enabled && recallMode !== "no_recall") {
7935
8006
  try {
7936
- const explicitCueSection = await buildExplicitCueRecallSection({
7937
- engine: this.lcmEngine,
7938
- sessionId: sessionKey,
7939
- query: retrievalQuery,
7940
- maxChars: explicitCueMaxChars,
7941
- maxReferences: this.getRecallSectionNumber("explicit-cue", "maxResults") ?? this.config.explicitCueRecallMaxReferences
7942
- });
8007
+ const explicitCueSection = await firstNonEmptyLcmRead(
8008
+ (lcmSessionId) => buildExplicitCueRecallSection({
8009
+ engine: this.lcmEngine,
8010
+ // #1495 thread 3 + #1505 fallback unification: read across the
8011
+ // ordered LCM read key set (primary overlay → coding fallbacks)
8012
+ // so a branch-scoped session finds its own explicit-cue evidence
8013
+ // even when archived at project/root scope (rule 39).
8014
+ sessionId: lcmSessionId,
8015
+ query: retrievalQuery,
8016
+ maxChars: explicitCueMaxChars,
8017
+ maxReferences: this.getRecallSectionNumber("explicit-cue", "maxResults") ?? this.config.explicitCueRecallMaxReferences
8018
+ }),
8019
+ (s) => !s,
8020
+ ""
8021
+ );
7943
8022
  if (explicitCueSection) {
7944
8023
  this.appendRecallSection(
7945
8024
  sectionBuckets,
@@ -7957,15 +8036,22 @@ ${formatted}`;
7957
8036
  this.config.targetedFactRecallEnabled
7958
8037
  ) && targetedFactMaxChars !== 0 && this.lcmEngine?.enabled && recallMode !== "no_recall" && shouldRecallTargetedFactEvidence(retrievalQuery)) {
7959
8038
  try {
7960
- const targetedFactSection = await buildTargetedFactRecallSection({
7961
- engine: this.lcmEngine,
7962
- sessionId: sessionKey,
7963
- query: retrievalQuery,
7964
- maxChars: targetedFactMaxChars,
7965
- maxSearchResults: this.getRecallSectionNumber("targeted-facts", "maxResults") ?? this.config.targetedFactRecallMaxResults,
7966
- maxScanWindowTurns: this.getRecallSectionNumber("targeted-facts", "maxTurns") ?? this.config.targetedFactRecallScanWindowTurns,
7967
- maxScanWindowTokens: this.getRecallSectionNumber("targeted-facts", "maxTokens") ?? this.config.targetedFactRecallScanWindowTokens
7968
- });
8039
+ const targetedFactSection = await firstNonEmptyLcmRead(
8040
+ (lcmSessionId) => buildTargetedFactRecallSection({
8041
+ engine: this.lcmEngine,
8042
+ // #1495 + #1505 fallback unification: read across the ordered LCM
8043
+ // read key set so a branch-scoped session finds its own
8044
+ // targeted-fact evidence even when archived at project/root scope.
8045
+ sessionId: lcmSessionId,
8046
+ query: retrievalQuery,
8047
+ maxChars: targetedFactMaxChars,
8048
+ maxSearchResults: this.getRecallSectionNumber("targeted-facts", "maxResults") ?? this.config.targetedFactRecallMaxResults,
8049
+ maxScanWindowTurns: this.getRecallSectionNumber("targeted-facts", "maxTurns") ?? this.config.targetedFactRecallScanWindowTurns,
8050
+ maxScanWindowTokens: this.getRecallSectionNumber("targeted-facts", "maxTokens") ?? this.config.targetedFactRecallScanWindowTokens
8051
+ }),
8052
+ (s) => !s,
8053
+ ""
8054
+ );
7969
8055
  if (targetedFactSection) {
7970
8056
  this.appendRecallSection(
7971
8057
  sectionBuckets,
@@ -7983,15 +8069,22 @@ ${formatted}`;
7983
8069
  this.config.focusedListRecallEnabled
7984
8070
  ) && focusedListMaxChars !== 0 && this.lcmEngine?.enabled && recallMode !== "no_recall" && shouldRecallFocusedListEvidence(retrievalQuery)) {
7985
8071
  try {
7986
- const focusedListSection = await buildFocusedListRecallSection({
7987
- engine: this.lcmEngine,
7988
- sessionId: sessionKey,
7989
- query: retrievalQuery,
7990
- maxChars: focusedListMaxChars,
7991
- maxSearchResults: this.getRecallSectionNumber("focused-list", "maxResults") ?? this.config.focusedListRecallMaxResults,
7992
- maxScanWindowTurns: this.getRecallSectionNumber("focused-list", "maxTurns") ?? this.config.focusedListRecallScanWindowTurns,
7993
- maxScanWindowTokens: this.getRecallSectionNumber("focused-list", "maxTokens") ?? this.config.focusedListRecallScanWindowTokens
7994
- });
8072
+ const focusedListSection = await firstNonEmptyLcmRead(
8073
+ (lcmSessionId) => buildFocusedListRecallSection({
8074
+ engine: this.lcmEngine,
8075
+ // #1495 thread 3 + #1505 fallback unification: read across the
8076
+ // ordered LCM read key set so a branch-scoped session reads its own
8077
+ // focused-list/count evidence even at project/root scope (rule 39).
8078
+ sessionId: lcmSessionId,
8079
+ query: retrievalQuery,
8080
+ maxChars: focusedListMaxChars,
8081
+ maxSearchResults: this.getRecallSectionNumber("focused-list", "maxResults") ?? this.config.focusedListRecallMaxResults,
8082
+ maxScanWindowTurns: this.getRecallSectionNumber("focused-list", "maxTurns") ?? this.config.focusedListRecallScanWindowTurns,
8083
+ maxScanWindowTokens: this.getRecallSectionNumber("focused-list", "maxTokens") ?? this.config.focusedListRecallScanWindowTokens
8084
+ }),
8085
+ (s) => !s,
8086
+ ""
8087
+ );
7995
8088
  if (focusedListSection) {
7996
8089
  this.appendRecallSection(
7997
8090
  sectionBuckets,
@@ -8012,16 +8105,23 @@ ${formatted}`;
8012
8105
  this.config.responseGuidanceRecallEnabled
8013
8106
  ) && responseGuidanceMaxChars !== 0 && this.lcmEngine?.enabled && recallMode !== "no_recall" && (responseGuidanceMatchesQuery || responseGuidanceForcedByPipeline)) {
8014
8107
  try {
8015
- const responseGuidanceSection = await buildResponseGuidanceRecallSection({
8016
- engine: this.lcmEngine,
8017
- sessionId: sessionKey,
8018
- query: retrievalQuery,
8019
- maxChars: responseGuidanceMaxChars,
8020
- maxSearchResults: this.getRecallSectionNumber("response-guidance", "maxResults") ?? this.config.responseGuidanceRecallMaxResults,
8021
- maxScanWindowTurns: this.getRecallSectionNumber("response-guidance", "maxTurns") ?? this.config.responseGuidanceRecallScanWindowTurns,
8022
- maxScanWindowTokens: this.getRecallSectionNumber("response-guidance", "maxTokens") ?? this.config.responseGuidanceRecallScanWindowTokens,
8023
- forceGeneric: responseGuidanceForcedByPipeline
8024
- });
8108
+ const responseGuidanceSection = await firstNonEmptyLcmRead(
8109
+ (lcmSessionId) => buildResponseGuidanceRecallSection({
8110
+ engine: this.lcmEngine,
8111
+ // #1495 thread 3 + #1505 fallback unification: read across the
8112
+ // ordered LCM read key set so a branch-scoped session reads its own
8113
+ // response-guidance evidence even at project/root scope (rule 39).
8114
+ sessionId: lcmSessionId,
8115
+ query: retrievalQuery,
8116
+ maxChars: responseGuidanceMaxChars,
8117
+ maxSearchResults: this.getRecallSectionNumber("response-guidance", "maxResults") ?? this.config.responseGuidanceRecallMaxResults,
8118
+ maxScanWindowTurns: this.getRecallSectionNumber("response-guidance", "maxTurns") ?? this.config.responseGuidanceRecallScanWindowTurns,
8119
+ maxScanWindowTokens: this.getRecallSectionNumber("response-guidance", "maxTokens") ?? this.config.responseGuidanceRecallScanWindowTokens,
8120
+ forceGeneric: responseGuidanceForcedByPipeline
8121
+ }),
8122
+ (s) => !s,
8123
+ ""
8124
+ );
8025
8125
  if (responseGuidanceSection) {
8026
8126
  this.appendRecallSection(
8027
8127
  sectionBuckets,
@@ -8039,15 +8139,22 @@ ${formatted}`;
8039
8139
  this.config.eventOrderRecallEnabled
8040
8140
  ) && eventOrderMaxChars !== 0 && this.lcmEngine?.enabled && recallMode !== "no_recall" && shouldRecallEventOrderEvidence(retrievalQuery)) {
8041
8141
  try {
8042
- const eventOrderSection = await buildEventOrderRecallSection({
8043
- engine: this.lcmEngine,
8044
- sessionId: sessionKey,
8045
- query: retrievalQuery,
8046
- maxChars: eventOrderMaxChars,
8047
- maxItems: this.getRecallSectionNumber("event-order", "maxResults") ?? this.config.eventOrderRecallMaxResults,
8048
- maxScanWindowTurns: this.getRecallSectionNumber("event-order", "maxTurns") ?? this.config.eventOrderRecallScanWindowTurns,
8049
- maxScanWindowTokens: this.getRecallSectionNumber("event-order", "maxTokens") ?? this.config.eventOrderRecallScanWindowTokens
8050
- });
8142
+ const eventOrderSection = await firstNonEmptyLcmRead(
8143
+ (lcmSessionId) => buildEventOrderRecallSection({
8144
+ engine: this.lcmEngine,
8145
+ // #1495 thread 3 + #1505 fallback unification: read across the
8146
+ // ordered LCM read key set so a branch-scoped session reads its own
8147
+ // chronological event-order evidence even at project/root scope.
8148
+ sessionId: lcmSessionId,
8149
+ query: retrievalQuery,
8150
+ maxChars: eventOrderMaxChars,
8151
+ maxItems: this.getRecallSectionNumber("event-order", "maxResults") ?? this.config.eventOrderRecallMaxResults,
8152
+ maxScanWindowTurns: this.getRecallSectionNumber("event-order", "maxTurns") ?? this.config.eventOrderRecallScanWindowTurns,
8153
+ maxScanWindowTokens: this.getRecallSectionNumber("event-order", "maxTokens") ?? this.config.eventOrderRecallScanWindowTokens
8154
+ }),
8155
+ (s) => !s,
8156
+ ""
8157
+ );
8051
8158
  if (eventOrderSection) {
8052
8159
  this.appendRecallSection(
8053
8160
  sectionBuckets,
@@ -8182,9 +8289,19 @@ ${tmtNode.summary}`
8182
8289
  }
8183
8290
  if (this.lcmEngine?.enabled && recallMode !== "minimal" && recallMode !== "no_recall") {
8184
8291
  try {
8185
- const structuredMatches = await this.lcmEngine.searchStructuredParts(
8186
- sessionKey ?? "default",
8187
- retrievalQuery
8292
+ const structuredMatches = await firstNonEmptyLcmRead(
8293
+ (lcmSessionId) => this.lcmEngine.searchStructuredParts(
8294
+ // #1495 + #1505 fallback unification: read across the ordered LCM
8295
+ // read key set so a branch-scoped session reads its own structured
8296
+ // message-part evidence even when archived at project/root scope.
8297
+ // Structured parts are inherently per-session (the DAG is keyed by
8298
+ // session_id), so a SESSIONLESS read (`undefined`) normalizes to
8299
+ // empty → no section, the correct pre-#1505 behavior (codex P2).
8300
+ lcmSessionId ?? "",
8301
+ retrievalQuery
8302
+ ),
8303
+ (matches) => matches.length === 0,
8304
+ []
8188
8305
  );
8189
8306
  const structuredSection = this.lcmEngine.formatStructuredRecall(
8190
8307
  structuredMatches,
@@ -8208,9 +8325,19 @@ ${tmtNode.summary}`
8208
8325
  }
8209
8326
  }
8210
8327
  }
8211
- const lcmSection = await this.lcmEngine.assembleRecall(
8212
- sessionKey ?? "default",
8213
- this.config.recallBudgetChars
8328
+ const lcmSection = await firstNonEmptyLcmRead(
8329
+ (lcmSessionId) => this.lcmEngine.assembleRecall(
8330
+ // #1495 + #1505 fallback unification: read across the ordered LCM
8331
+ // read key set so a branch-scoped session reads its own
8332
+ // compressed-history evidence even at project/root scope.
8333
+ // Compressed history is inherently per-session (a per-session DAG),
8334
+ // so a SESSIONLESS read (`undefined`) normalizes to empty → no
8335
+ // section, the correct pre-#1505 behavior (codex P2).
8336
+ lcmSessionId ?? "",
8337
+ this.config.recallBudgetChars
8338
+ ),
8339
+ (s) => !s,
8340
+ ""
8214
8341
  );
8215
8342
  if (lcmSection) {
8216
8343
  this.appendRecallSection(
@@ -9425,6 +9552,8 @@ _Context: ${topQuestion.context}_`
9425
9552
  bufferKey,
9426
9553
  extractionDeadlineMs: options.deadlineMs,
9427
9554
  abortSignal: options.abortSignal,
9555
+ writeNamespaceOverride: options.writeNamespaceOverride,
9556
+ principalOverride: options.principalOverride,
9428
9557
  onTaskSettled: (err) => err ? reject(err) : resolve()
9429
9558
  }).catch(reject);
9430
9559
  })
@@ -9786,7 +9915,8 @@ _Context: ${topQuestion.context}_`
9786
9915
  bufferKey,
9787
9916
  abortSignal: options.abortSignal,
9788
9917
  failOnExtractionFailure: options.failOnExtractionFailure === true,
9789
- writeNamespaceOverride: options.writeNamespaceOverride
9918
+ writeNamespaceOverride: options.writeNamespaceOverride,
9919
+ principalOverride: options.principalOverride
9790
9920
  });
9791
9921
  settleTask(void 0, result);
9792
9922
  } catch (err) {
@@ -9963,7 +10093,7 @@ ${normalized}`).digest("hex");
9963
10093
  durableOutputCount: 0
9964
10094
  };
9965
10095
  }
9966
- const principal = resolvePrincipal(sessionKey, this.config);
10096
+ const principal = typeof options.principalOverride === "string" && options.principalOverride.length > 0 ? options.principalOverride : resolvePrincipal(sessionKey, this.config);
9967
10097
  const selfNamespace = typeof options.writeNamespaceOverride === "string" && options.writeNamespaceOverride.length > 0 ? options.writeNamespaceOverride : this.applyCodingNamespaceOverlay(
9968
10098
  sessionKey,
9969
10099
  defaultNamespaceForPrincipal(principal, this.config)
@@ -14302,4 +14432,4 @@ export {
14302
14432
  resolvePersistedMemoryRelativePath,
14303
14433
  Orchestrator
14304
14434
  };
14305
- //# sourceMappingURL=chunk-TWVRDGTX.js.map
14435
+ //# sourceMappingURL=chunk-23RYLGYA.js.map