@remnic/core 10.0.170 → 10.0.171

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 (41) hide show
  1. package/dist/access-admin-ops-surface.js +1 -1
  2. package/dist/access-cli.js +1 -1
  3. package/dist/access-extraction-force-flush-preempt.js +1 -1
  4. package/dist/access-extraction-force-flush.js +1 -1
  5. package/dist/access-http-briefing.js +1 -1
  6. package/dist/access-http-query.js +1 -1
  7. package/dist/access-http.js +1 -1
  8. package/dist/access-identity-continuity-surface.js +1 -1
  9. package/dist/access-lcm-surface.js +1 -1
  10. package/dist/access-mcp.js +1 -1
  11. package/dist/access-observe-write-surface.js +1 -1
  12. package/dist/access-operations-batch.js +1 -1
  13. package/dist/access-operations.js +1 -1
  14. package/dist/access-recall-concurrency.js +1 -1
  15. package/dist/access-recall-response.js +1 -1
  16. package/dist/access-recall-surface.js +1 -1
  17. package/dist/access-service.js +1 -1
  18. package/dist/chat/chat-engine.d.ts +5 -3
  19. package/dist/chat/chat-engine.d.ts.map +1 -1
  20. package/dist/chat/chat-executor.d.ts +3 -4
  21. package/dist/chat/chat-executor.d.ts.map +1 -1
  22. package/dist/{chunk-QMFHKWHN.js → chunk-SLWD7TB6.js} +2 -2
  23. package/dist/{chunk-5YIOUS5T.js → chunk-T2KCROPA.js} +28 -19
  24. package/dist/chunk-T2KCROPA.js.map +1 -0
  25. package/dist/cli.js +1 -1
  26. package/dist/correction/correction-access-wiring.d.ts +4 -1
  27. package/dist/correction/correction-access-wiring.d.ts.map +1 -1
  28. package/dist/explicit-capture.js +1 -1
  29. package/dist/index.js +1 -1
  30. package/dist/orchestration/backlog-scheduler.js +2 -2
  31. package/dist/orchestration/buffer-drain-runner.js +2 -2
  32. package/dist/orchestrator.js +1 -1
  33. package/dist/recall-navigation.js +1 -1
  34. package/package.json +2 -2
  35. package/src/chat/chat-engine.ts +5 -3
  36. package/src/chat/chat-executor.test.ts +150 -0
  37. package/src/chat/chat-executor.ts +31 -20
  38. package/src/chat/chat-factory.ts +1 -1
  39. package/src/correction/correction-access-wiring.ts +4 -1
  40. package/dist/chunk-5YIOUS5T.js.map +0 -1
  41. /package/dist/{chunk-QMFHKWHN.js.map → chunk-SLWD7TB6.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessAdminOpsSurface
3
- } from "./chunk-5YIOUS5T.js";
3
+ } from "./chunk-T2KCROPA.js";
4
4
  import "./chunk-RK7SE3BL.js";
5
5
  import "./chunk-GOZXQNIM.js";
6
6
  import "./chunk-PQM3B54K.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EngramAccessService,
3
3
  Orchestrator
4
- } from "./chunk-5YIOUS5T.js";
4
+ } from "./chunk-T2KCROPA.js";
5
5
  import "./chunk-RK7SE3BL.js";
6
6
  import "./chunk-GOZXQNIM.js";
7
7
  import "./chunk-PQM3B54K.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  forceFlushPreemptCall,
3
3
  forceFlushPreemptCallback
4
- } from "./chunk-5YIOUS5T.js";
4
+ } from "./chunk-T2KCROPA.js";
5
5
  import "./chunk-RK7SE3BL.js";
6
6
  import "./chunk-GOZXQNIM.js";
7
7
  import "./chunk-PQM3B54K.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  extractionForceFlush
3
- } from "./chunk-5YIOUS5T.js";
3
+ } from "./chunk-T2KCROPA.js";
4
4
  import "./chunk-RK7SE3BL.js";
5
5
  import "./chunk-GOZXQNIM.js";
6
6
  import "./chunk-PQM3B54K.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  respondBriefingHttp
3
- } from "./chunk-5YIOUS5T.js";
3
+ } from "./chunk-T2KCROPA.js";
4
4
  import "./chunk-RK7SE3BL.js";
5
5
  import "./chunk-GOZXQNIM.js";
6
6
  import "./chunk-PQM3B54K.js";
@@ -3,7 +3,7 @@ import {
3
3
  optionalNamespaceKindQueryParam,
4
4
  optionalQueryString,
5
5
  positiveIntQueryParam
6
- } from "./chunk-5YIOUS5T.js";
6
+ } from "./chunk-T2KCROPA.js";
7
7
  import "./chunk-RK7SE3BL.js";
8
8
  import "./chunk-GOZXQNIM.js";
9
9
  import "./chunk-PQM3B54K.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EngramAccessHttpServer,
3
3
  resolveDefaultAdminConsolePublicDir
4
- } from "./chunk-5YIOUS5T.js";
4
+ } from "./chunk-T2KCROPA.js";
5
5
  import "./chunk-RK7SE3BL.js";
6
6
  import "./chunk-GOZXQNIM.js";
7
7
  import "./chunk-PQM3B54K.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessIdentityContinuitySurface
3
- } from "./chunk-5YIOUS5T.js";
3
+ } from "./chunk-T2KCROPA.js";
4
4
  import "./chunk-RK7SE3BL.js";
5
5
  import "./chunk-GOZXQNIM.js";
6
6
  import "./chunk-PQM3B54K.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessLcmSurface
3
- } from "./chunk-5YIOUS5T.js";
3
+ } from "./chunk-T2KCROPA.js";
4
4
  import "./chunk-RK7SE3BL.js";
5
5
  import "./chunk-GOZXQNIM.js";
6
6
  import "./chunk-PQM3B54K.js";
@@ -2,7 +2,7 @@ import {
2
2
  EngramMcpServer,
3
3
  MCP_MIGRATED_OPERATIONS,
4
4
  MCP_SUPPORTED_PROTOCOL_VERSIONS
5
- } from "./chunk-5YIOUS5T.js";
5
+ } from "./chunk-T2KCROPA.js";
6
6
  import "./chunk-RK7SE3BL.js";
7
7
  import "./chunk-GOZXQNIM.js";
8
8
  import "./chunk-PQM3B54K.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessObserveWriteSurface
3
- } from "./chunk-5YIOUS5T.js";
3
+ } from "./chunk-T2KCROPA.js";
4
4
  import "./chunk-RK7SE3BL.js";
5
5
  import "./chunk-GOZXQNIM.js";
6
6
  import "./chunk-PQM3B54K.js";
@@ -1,4 +1,4 @@
1
- import "./chunk-5YIOUS5T.js";
1
+ import "./chunk-T2KCROPA.js";
2
2
  import "./chunk-RK7SE3BL.js";
3
3
  import "./chunk-GOZXQNIM.js";
4
4
  import "./chunk-PQM3B54K.js";
@@ -22,7 +22,7 @@ import {
22
22
  memoryGetOperation,
23
23
  memorySearchOperation,
24
24
  memoryStoreOperation
25
- } from "./chunk-5YIOUS5T.js";
25
+ } from "./chunk-T2KCROPA.js";
26
26
  import "./chunk-RK7SE3BL.js";
27
27
  import "./chunk-GOZXQNIM.js";
28
28
  import "./chunk-PQM3B54K.js";
@@ -4,7 +4,7 @@ import {
4
4
  createAndStartFlight,
5
5
  leadRecallFlight,
6
6
  withRecallConcurrency
7
- } from "./chunk-5YIOUS5T.js";
7
+ } from "./chunk-T2KCROPA.js";
8
8
  import "./chunk-RK7SE3BL.js";
9
9
  import "./chunk-GOZXQNIM.js";
10
10
  import "./chunk-PQM3B54K.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  assembleRecallResponse
3
- } from "./chunk-5YIOUS5T.js";
3
+ } from "./chunk-T2KCROPA.js";
4
4
  import "./chunk-RK7SE3BL.js";
5
5
  import "./chunk-GOZXQNIM.js";
6
6
  import "./chunk-PQM3B54K.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessRecallSurface
3
- } from "./chunk-5YIOUS5T.js";
3
+ } from "./chunk-T2KCROPA.js";
4
4
  import "./chunk-RK7SE3BL.js";
5
5
  import "./chunk-GOZXQNIM.js";
6
6
  import "./chunk-PQM3B54K.js";
@@ -4,7 +4,7 @@ import {
4
4
  buildProjectedGovernanceProposedActions,
5
5
  hasGroupedGovernanceActions,
6
6
  shapeMemorySummary
7
- } from "./chunk-5YIOUS5T.js";
7
+ } from "./chunk-T2KCROPA.js";
8
8
  import "./chunk-RK7SE3BL.js";
9
9
  import "./chunk-GOZXQNIM.js";
10
10
  import "./chunk-PQM3B54K.js";
@@ -31,15 +31,17 @@ export interface ChatToolExecutor {
31
31
  scopeInspect(): Promise<string>;
32
32
  /**
33
33
  * Generate a correction plan. Returns a JSON string with a planId and
34
- * a diff preview. When the Correction Contract (#1580) is not merged,
35
- * this is a stub that returns a not-available marker.
34
+ * a diff preview, backed by the Correction Contract (#1580) pipeline.
36
35
  */
37
36
  correctionPlan(request: string): Promise<{
38
37
  planId: string;
39
38
  preview: string;
40
39
  }>;
41
40
  /**
42
- * Apply a correction plan. Returns a JSON result string.
41
+ * Apply a correction plan. Returns a JSON result string. Implementations
42
+ * pass `confirm: true` to the service; the engine's preview-confirm
43
+ * protocol is the consent that satisfies the apply gate, so this method
44
+ * must stay reachable only through the engine's confirmation flow.
43
45
  */
44
46
  correctionApply(planId: string): Promise<string>;
45
47
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"chat-engine.d.ts","sourceRoot":"","sources":["../../src/chat/chat-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EACV,cAAc,EAEd,gBAAgB,EAGhB,cAAc,EACf,MAAM,iBAAiB,CAAC;AAYzB;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7C,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9C,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACzB,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,YAAY,IA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AM,WAAW,iBAAiB;IAChC,GAAG,EAAE,cAAc,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,mBAAmB,EAAE,OAAO,CAAC;IAC7B,uDAAuD;IACvD,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAmBD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D;AAMD,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAiB;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;IAC7C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAU;IAC9C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAU;IAChD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;IAC/C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAc;gBAEnC,IAAI,EAAE,iBAAiB;IAmBnC;;;OAGG;IACG,cAAc,CAClB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,cAAc,CAAC;IA0R1B;;OAEG;YACW,WAAW;CAuD1B"}
@@ -6,10 +6,9 @@
6
6
  * session's principal/namespace/sessionKey so every tool call flows through
7
7
  * access-service with the caller's identity (rule 42).
8
8
  *
9
- * Correction tools (correction_plan / correction_apply / memory_promote) are
10
- * stubbed behind the same interface until the Correction Contract (#1580)
11
- * merges. The stub returns a clear not-available marker so the engine and
12
- * surfaces degrade gracefully.
9
+ * Correction tools (correction_plan / correction_apply / memory_promote)
10
+ * delegate to the Correction Contract (#1580) plan/apply pipeline through
11
+ * the access-service.
13
12
  */
14
13
  import type { EngramAccessService } from "../access-service.js";
15
14
  import type { ChatToolExecutor } from "./chat-engine.js";
@@ -1 +1 @@
1
- {"version":3,"file":"chat-executor.d.ts","sourceRoot":"","sources":["../../src/chat/chat-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,gBAAgB,CAyGnF"}
1
+ {"version":3,"file":"chat-executor.d.ts","sourceRoot":"","sources":["../../src/chat/chat-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,gBAAgB,CAqHnF"}
@@ -2,7 +2,7 @@ import {
2
2
  ExtractionDrain,
3
3
  TurnIngestionCoordinator,
4
4
  shouldSkipImplicitExtraction
5
- } from "./chunk-5YIOUS5T.js";
5
+ } from "./chunk-T2KCROPA.js";
6
6
  import {
7
7
  headerConnector,
8
8
  renderExtractionConversation,
@@ -447,4 +447,4 @@ export {
447
447
  ClaimBufferStorage,
448
448
  BufferDrainRunner
449
449
  };
450
- //# sourceMappingURL=chunk-QMFHKWHN.js.map
450
+ //# sourceMappingURL=chunk-SLWD7TB6.js.map
@@ -34648,6 +34648,10 @@ function stripToolCallJson(content, toolCalls) {
34648
34648
  // src/chat/chat-executor.ts
34649
34649
  function createChatExecutor(bindings) {
34650
34650
  const { service, principal, namespace, sessionKey } = bindings;
34651
+ const correctionScope = {};
34652
+ if (namespace) correctionScope.namespace = namespace;
34653
+ if (sessionKey) correctionScope.sessionKey = sessionKey;
34654
+ if (principal) correctionScope.principal = principal;
34651
34655
  return {
34652
34656
  async memorySearch(query, maxResults) {
34653
34657
  const result = await service.memorySearch({
@@ -34698,27 +34702,32 @@ function createChatExecutor(bindings) {
34698
34702
  sessionKey: sessionKey ?? void 0
34699
34703
  });
34700
34704
  },
34701
- // ── Correction tools — stubbed until #1580 merges ──────────────────
34702
- // When the Correction Contract lands, replace these stubs with calls to
34703
- // the correction module's plan/apply interface. The engine, CLI, and
34704
- // MCP tool all consume this interface, so the stub-to-real swap is a
34705
- // single-file change here.
34705
+ // ── Correction tools — Correction Contract (#1580) ─────────────────
34706
+ // Thin adapters over the service's plan/apply pipeline. The engine's
34707
+ // confirmation interception asks for a pending plan's preview via the
34708
+ // "retrieve plan <id>" sentinel; that is a lookup, not a new plan.
34706
34709
  async correctionPlan(request) {
34707
- return {
34708
- planId: `stub-${Date.now()}`,
34709
- preview: `[Correction Contract (#1580) not yet available]
34710
-
34711
- Requested correction: "${request}"
34712
-
34713
- The plan/apply pipeline is pending. Inspection tools are fully functional.`
34714
- };
34710
+ const retrieve = /^retrieve plan (\S+)$/i.exec(request.trim());
34711
+ if (retrieve) {
34712
+ const pending = await service.correctionListPending(correctionScope);
34713
+ const plan2 = pending.find((p) => p.planId === retrieve[1]);
34714
+ if (!plan2) {
34715
+ throw new Error(`Correction plan ${retrieve[1]} not found or expired.`);
34716
+ }
34717
+ return { planId: plan2.planId, preview: plan2.diff };
34718
+ }
34719
+ const plan = await service.correctionPlan({
34720
+ text: request,
34721
+ ...correctionScope
34722
+ });
34723
+ return { planId: plan.planId, preview: plan.diff };
34715
34724
  },
34716
34725
  async correctionApply(planId) {
34717
- return JSON.stringify({
34718
- applied: false,
34719
- planId,
34720
- reason: "Correction Contract (#1580) not yet available. No mutation was applied."
34726
+ const outcome = await service.correctionApply(planId, {
34727
+ confirm: true,
34728
+ ...correctionScope
34721
34729
  });
34730
+ return JSON.stringify(outcome);
34722
34731
  },
34723
34732
  async memoryPromote(memoryId) {
34724
34733
  try {
@@ -35006,7 +35015,7 @@ function createChatEngine(opts) {
35006
35015
  executor,
35007
35016
  maxToolCallsPerTurn: opts.config.maxToolCallsPerTurn,
35008
35017
  ...opts.config.model ? { model: opts.config.model } : {},
35009
- correctionAvailable: false,
35018
+ correctionAvailable: opts.service.correctionSurfaceVisible,
35010
35019
  scopeInspectAvailable: false
35011
35020
  });
35012
35021
  }
@@ -67944,4 +67953,4 @@ export {
67944
67953
  EngramAccessService,
67945
67954
  AccessAdminOpsSurface
67946
67955
  };
67947
- //# sourceMappingURL=chunk-5YIOUS5T.js.map
67956
+ //# sourceMappingURL=chunk-T2KCROPA.js.map