@remnic/core 9.3.654 → 9.3.656
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/access-cli.js +29 -29
- package/dist/access-http.d.ts +4 -4
- package/dist/access-http.js +17 -17
- package/dist/access-mcp.d.ts +4 -4
- package/dist/access-mcp.js +16 -16
- package/dist/access-schema.d.ts +10 -10
- package/dist/{access-service-C8A5hoXJ.d.ts → access-service-D_nbpexW.d.ts} +33 -2
- package/dist/access-service.d.ts +4 -4
- package/dist/access-service.js +15 -15
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +3 -3
- package/dist/briefing.d.ts +1 -1
- package/dist/briefing.js +3 -3
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer.d.ts +1 -1
- package/dist/calibration.d.ts +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +4 -4
- package/dist/{chunk-JMQSYGXS.js → chunk-2BD7DG37.js} +2 -2
- package/dist/{chunk-FVRBLJP6.js → chunk-2MXEVL75.js} +2 -2
- package/dist/{chunk-LJCEWTG3.js → chunk-4UL7VPTD.js} +277 -58
- package/dist/chunk-4UL7VPTD.js.map +1 -0
- package/dist/{chunk-JYN7QNTA.js → chunk-54XF2FY7.js} +17 -17
- package/dist/{chunk-7WEB3FLJ.js → chunk-5PLUC5OB.js} +2 -2
- package/dist/{chunk-JX2RINDR.js → chunk-6G5JEN55.js} +2 -2
- package/dist/{chunk-ZCORQM74.js → chunk-AGJKWOKV.js} +2 -2
- package/dist/{chunk-NE2JBMLN.js → chunk-AZBV4RRY.js} +1 -1
- package/dist/chunk-AZBV4RRY.js.map +1 -0
- package/dist/{chunk-YLZLPVKK.js → chunk-CTAV55JM.js} +344 -1
- package/dist/chunk-CTAV55JM.js.map +1 -0
- package/dist/{chunk-2DSTAWNZ.js → chunk-DIBWFCLA.js} +3 -3
- package/dist/{chunk-NAZWHTYV.js → chunk-DR67OK4E.js} +5 -5
- package/dist/{chunk-XBIACVCO.js → chunk-EC2AYKRX.js} +2 -2
- package/dist/{chunk-JVRPJ7D4.js → chunk-EKQMQQ3U.js} +48 -12
- package/dist/chunk-EKQMQQ3U.js.map +1 -0
- package/dist/{chunk-RGPUQ66K.js → chunk-GCYFUTUC.js} +2 -2
- package/dist/{chunk-JBHXMCYN.js → chunk-GRYAECRV.js} +2 -2
- package/dist/{chunk-BJA6DQOC.js → chunk-GSHW5VVD.js} +5 -5
- package/dist/chunk-GYSYLGNE.js +650 -0
- package/dist/chunk-GYSYLGNE.js.map +1 -0
- package/dist/{chunk-NCGWXCSW.js → chunk-IOZ5WBWD.js} +2 -2
- package/dist/{chunk-QKK64Z6M.js → chunk-JSVFEHLL.js} +7 -5
- package/dist/chunk-JSVFEHLL.js.map +1 -0
- package/dist/{chunk-7LWRCOP7.js → chunk-LZTFCAKE.js} +2 -2
- package/dist/{chunk-2DGQLOOM.js → chunk-M3VYPE2H.js} +1 -1
- package/dist/{chunk-2DGQLOOM.js.map → chunk-M3VYPE2H.js.map} +1 -1
- package/dist/{chunk-6CVI6BP6.js → chunk-NXCK7DO7.js} +2 -2
- package/dist/{chunk-Z5MQI7K2.js → chunk-PEPHBH2W.js} +2 -2
- package/dist/{chunk-PYWNNF2I.js → chunk-QRSKPI62.js} +99 -66
- package/dist/chunk-QRSKPI62.js.map +1 -0
- package/dist/{chunk-XWQ6ERUG.js → chunk-QZRKNA5F.js} +2 -2
- package/dist/{chunk-PS3SYNHP.js → chunk-R5DB26G6.js} +2 -2
- package/dist/{chunk-OL2364SB.js → chunk-RDW5G6DO.js} +1502 -335
- package/dist/chunk-RDW5G6DO.js.map +1 -0
- package/dist/{chunk-YM3LR4LS.js → chunk-SSSXWIBP.js} +5 -5
- package/dist/{chunk-T2C6QJG2.js → chunk-SWDHVH2P.js} +2 -2
- package/dist/{chunk-DBM2BD22.js → chunk-SXYCVRLK.js} +3 -3
- package/dist/{chunk-K6X553JB.js → chunk-TFFZUFEP.js} +7 -5
- package/dist/chunk-TFFZUFEP.js.map +1 -0
- package/dist/{chunk-ENV6RDTD.js → chunk-TIJYQXDI.js} +2 -2
- package/dist/{chunk-BP2EV6W5.js → chunk-VAEAGTEQ.js} +4 -4
- package/dist/{chunk-3RACUBII.js → chunk-WIKMCJUR.js} +2 -2
- package/dist/{chunk-QW6JZO5P.js → chunk-WWMHAMAY.js} +2 -2
- package/dist/{chunk-GPW2E4LN.js → chunk-YEZHZCUO.js} +4 -4
- package/dist/{chunk-5FOCXX5E.js → chunk-YVVQUAOO.js} +3 -3
- package/dist/{chunk-5FOCXX5E.js.map → chunk-YVVQUAOO.js.map} +1 -1
- package/dist/{chunk-3XGWCZ63.js → chunk-YXLT4EMM.js} +2 -2
- package/dist/{chunk-Y2RIIF6H.js → chunk-Z6UDTNY6.js} +2 -2
- package/dist/{cli-uQgvDFNE.d.ts → cli-aYxSuPvP.d.ts} +3 -3
- package/dist/cli.d.ts +5 -5
- package/dist/cli.js +29 -29
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +3 -3
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +3 -3
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +3 -3
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/contradiction/index.d.ts +1 -1
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +1 -1
- package/dist/entity-retrieval.js +3 -3
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +3 -3
- package/dist/explicit-cue-recall.js +2 -2
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction.d.ts +1 -1
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/focused-list-recall.js +2 -2
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index.d.ts +121 -121
- package/dist/index.js +39 -39
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lcm-fallback-read.js +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/local-llm.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +3 -3
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
- package/dist/maintenance/rebuild-memory-projection.js +4 -4
- package/dist/mcp-memory-inspector-app.d.ts +4 -4
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-worth-outcomes.d.ts +1 -1
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +1 -1
- package/dist/namespaces/migrate.js +11 -11
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +15 -4
- package/dist/namespaces/search.js +7 -7
- package/dist/namespaces/storage.d.ts +1 -1
- package/dist/namespaces/storage.js +3 -3
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +14 -14
- package/dist/{orchestrator-B4Y4sWQH.d.ts → orchestrator-D1wcmPNj.d.ts} +17 -14
- package/dist/orchestrator.d.ts +3 -3
- package/dist/orchestrator.js +25 -25
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +5 -1
- package/dist/qmd.js +2 -2
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/response-guidance-recall.js +2 -2
- package/dist/resume-bundles.js +2 -2
- package/dist/retrieval-agents.d.ts +1 -1
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/schemas.d.ts +22 -22
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +6 -6
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +6 -6
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +17 -1
- package/dist/search/port.js +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-BKd0Pype.d.ts → semantic-consolidation-MWOdNtSE.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +4 -4
- package/dist/semantic-rule-promotion.js +3 -3
- package/dist/semantic-rule-verifier.d.ts +3 -2
- package/dist/semantic-rule-verifier.js +5 -3
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +2 -2
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/targeted-fact-recall.js +2 -2
- package/dist/temporal-supersession.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +1 -1
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/types.d.ts +12 -12
- package/dist/{types-BgChEr0M.d.ts → types-CgcCpUrf.d.ts} +51 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.d.ts +2 -1
- package/dist/verified-recall.js +5 -3
- package/package.json +1 -1
- package/src/access-service-observe-lcm-parity.test.ts +86 -1
- package/src/access-service-observe-scope.test.ts +283 -1
- package/src/access-service-raw-excerpt-read-gate.test.ts +53 -0
- package/src/access-service.ts +391 -93
- package/src/coding/coding-namespace.ts +0 -3
- package/src/config.test.ts +69 -0
- package/src/config.ts +417 -0
- package/src/lcm-fallback-read.ts +2 -6
- package/src/maintenance/namespace-planner.test.ts +1120 -0
- package/src/maintenance/namespace-planner.ts +893 -0
- package/src/namespaces/scope-profiles.test.ts +1074 -0
- package/src/namespaces/scope-profiles.ts +456 -0
- package/src/namespaces/search.test.ts +130 -2
- package/src/namespaces/search.ts +71 -10
- package/src/orchestrator-flush.test.ts +606 -44
- package/src/orchestrator-source-attribution.test.ts +73 -0
- package/src/orchestrator.ts +932 -229
- package/src/qmd-client.test.ts +59 -0
- package/src/qmd.ts +124 -84
- package/src/search/port.ts +16 -0
- package/src/semantic-rule-verifier.ts +13 -6
- package/src/types.ts +64 -0
- package/src/verified-recall.ts +10 -6
- package/dist/chunk-JVRPJ7D4.js.map +0 -1
- package/dist/chunk-K6X553JB.js.map +0 -1
- package/dist/chunk-LJCEWTG3.js.map +0 -1
- package/dist/chunk-MMJANTJX.js +0 -339
- package/dist/chunk-MMJANTJX.js.map +0 -1
- package/dist/chunk-NE2JBMLN.js.map +0 -1
- package/dist/chunk-OL2364SB.js.map +0 -1
- package/dist/chunk-PYWNNF2I.js.map +0 -1
- package/dist/chunk-QKK64Z6M.js.map +0 -1
- package/dist/chunk-YLZLPVKK.js.map +0 -1
- /package/dist/{chunk-JMQSYGXS.js.map → chunk-2BD7DG37.js.map} +0 -0
- /package/dist/{chunk-FVRBLJP6.js.map → chunk-2MXEVL75.js.map} +0 -0
- /package/dist/{chunk-JYN7QNTA.js.map → chunk-54XF2FY7.js.map} +0 -0
- /package/dist/{chunk-7WEB3FLJ.js.map → chunk-5PLUC5OB.js.map} +0 -0
- /package/dist/{chunk-JX2RINDR.js.map → chunk-6G5JEN55.js.map} +0 -0
- /package/dist/{chunk-ZCORQM74.js.map → chunk-AGJKWOKV.js.map} +0 -0
- /package/dist/{chunk-2DSTAWNZ.js.map → chunk-DIBWFCLA.js.map} +0 -0
- /package/dist/{chunk-NAZWHTYV.js.map → chunk-DR67OK4E.js.map} +0 -0
- /package/dist/{chunk-XBIACVCO.js.map → chunk-EC2AYKRX.js.map} +0 -0
- /package/dist/{chunk-RGPUQ66K.js.map → chunk-GCYFUTUC.js.map} +0 -0
- /package/dist/{chunk-JBHXMCYN.js.map → chunk-GRYAECRV.js.map} +0 -0
- /package/dist/{chunk-BJA6DQOC.js.map → chunk-GSHW5VVD.js.map} +0 -0
- /package/dist/{chunk-NCGWXCSW.js.map → chunk-IOZ5WBWD.js.map} +0 -0
- /package/dist/{chunk-7LWRCOP7.js.map → chunk-LZTFCAKE.js.map} +0 -0
- /package/dist/{chunk-6CVI6BP6.js.map → chunk-NXCK7DO7.js.map} +0 -0
- /package/dist/{chunk-Z5MQI7K2.js.map → chunk-PEPHBH2W.js.map} +0 -0
- /package/dist/{chunk-XWQ6ERUG.js.map → chunk-QZRKNA5F.js.map} +0 -0
- /package/dist/{chunk-PS3SYNHP.js.map → chunk-R5DB26G6.js.map} +0 -0
- /package/dist/{chunk-YM3LR4LS.js.map → chunk-SSSXWIBP.js.map} +0 -0
- /package/dist/{chunk-T2C6QJG2.js.map → chunk-SWDHVH2P.js.map} +0 -0
- /package/dist/{chunk-DBM2BD22.js.map → chunk-SXYCVRLK.js.map} +0 -0
- /package/dist/{chunk-ENV6RDTD.js.map → chunk-TIJYQXDI.js.map} +0 -0
- /package/dist/{chunk-BP2EV6W5.js.map → chunk-VAEAGTEQ.js.map} +0 -0
- /package/dist/{chunk-3RACUBII.js.map → chunk-WIKMCJUR.js.map} +0 -0
- /package/dist/{chunk-QW6JZO5P.js.map → chunk-WWMHAMAY.js.map} +0 -0
- /package/dist/{chunk-GPW2E4LN.js.map → chunk-YEZHZCUO.js.map} +0 -0
- /package/dist/{chunk-3XGWCZ63.js.map → chunk-YXLT4EMM.js.map} +0 -0
- /package/dist/{chunk-Y2RIIF6H.js.map → chunk-Z6UDTNY6.js.map} +0 -0
package/src/config.test.ts
CHANGED
|
@@ -1331,3 +1331,72 @@ test("parseConfig namespaceCatalogEnabled present-but-unrecognized → throws (r
|
|
|
1331
1331
|
assert.throws(() => parseConfig({ namespaceCatalogEnabled: "flase" }), /boolean-like value/);
|
|
1332
1332
|
assert.throws(() => parseConfig({ namespaceCatalogEnabled: 2 }), /boolean-like value/);
|
|
1333
1333
|
});
|
|
1334
|
+
|
|
1335
|
+
test("parseConfig maintenance namespace fanout defaults match hosted-safe policy", () => {
|
|
1336
|
+
const cfg = parseConfig({});
|
|
1337
|
+
assert.equal(cfg.maintenanceNamespaceFanoutEnabled, true);
|
|
1338
|
+
assert.equal(cfg.maintenanceMaxNamespacesPerCycle, 20);
|
|
1339
|
+
assert.equal(cfg.maintenanceIncludeProjectNamespaces, true);
|
|
1340
|
+
assert.equal(cfg.maintenanceIncludeBranchNamespaces, false);
|
|
1341
|
+
assert.equal(cfg.maintenanceIncludeTeamProjectNamespaces, true);
|
|
1342
|
+
assert.equal(cfg.maintenanceNamespaceLockStaleMs, 10 * 60_000);
|
|
1343
|
+
});
|
|
1344
|
+
|
|
1345
|
+
test("parseConfig accepts nested maintenance namespace fanout config", () => {
|
|
1346
|
+
const cfg = parseConfig({
|
|
1347
|
+
maintenance: {
|
|
1348
|
+
namespaceFanoutEnabled: "false",
|
|
1349
|
+
maxNamespacesPerCycle: "7",
|
|
1350
|
+
includeProjectNamespaces: "off",
|
|
1351
|
+
includeBranchNamespaces: "on",
|
|
1352
|
+
includeTeamProjectNamespaces: "0",
|
|
1353
|
+
namespaceLockStaleMs: "120000",
|
|
1354
|
+
},
|
|
1355
|
+
});
|
|
1356
|
+
assert.equal(cfg.maintenanceNamespaceFanoutEnabled, false);
|
|
1357
|
+
assert.equal(cfg.maintenanceMaxNamespacesPerCycle, 7);
|
|
1358
|
+
assert.equal(cfg.maintenanceIncludeProjectNamespaces, false);
|
|
1359
|
+
assert.equal(cfg.maintenanceIncludeBranchNamespaces, true);
|
|
1360
|
+
assert.equal(cfg.maintenanceIncludeTeamProjectNamespaces, false);
|
|
1361
|
+
assert.equal(cfg.maintenanceNamespaceLockStaleMs, 120_000);
|
|
1362
|
+
});
|
|
1363
|
+
|
|
1364
|
+
test("parseConfig flat maintenance namespace fanout fields override nested config", () => {
|
|
1365
|
+
const cfg = parseConfig({
|
|
1366
|
+
maintenance: {
|
|
1367
|
+
namespaceFanoutEnabled: false,
|
|
1368
|
+
maxNamespacesPerCycle: 5,
|
|
1369
|
+
},
|
|
1370
|
+
maintenanceNamespaceFanoutEnabled: true,
|
|
1371
|
+
maintenanceMaxNamespacesPerCycle: 8,
|
|
1372
|
+
});
|
|
1373
|
+
assert.equal(cfg.maintenanceNamespaceFanoutEnabled, true);
|
|
1374
|
+
assert.equal(cfg.maintenanceMaxNamespacesPerCycle, 8);
|
|
1375
|
+
});
|
|
1376
|
+
|
|
1377
|
+
test("parseConfig rejects invalid maintenance namespace fanout values", () => {
|
|
1378
|
+
assert.throws(
|
|
1379
|
+
() => parseConfig({ maintenance: [] }),
|
|
1380
|
+
/maintenance must be a plain object/,
|
|
1381
|
+
);
|
|
1382
|
+
assert.throws(
|
|
1383
|
+
() => parseConfig({ maintenance: "off" }),
|
|
1384
|
+
/maintenance must be a plain object/,
|
|
1385
|
+
);
|
|
1386
|
+
assert.throws(
|
|
1387
|
+
() => parseConfig({ maintenance: [], maintenanceNamespaceFanoutEnabled: false }),
|
|
1388
|
+
/maintenance must be a plain object/,
|
|
1389
|
+
);
|
|
1390
|
+
assert.throws(
|
|
1391
|
+
() => parseConfig({ maintenance: { namespaceFanoutEnabled: "flase" } }),
|
|
1392
|
+
/maintenance\.namespaceFanoutEnabled must be a boolean-like value/,
|
|
1393
|
+
);
|
|
1394
|
+
assert.throws(
|
|
1395
|
+
() => parseConfig({ maintenance: { maxNamespacesPerCycle: 0 } }),
|
|
1396
|
+
/maintenance\.maxNamespacesPerCycle must be a positive integer/,
|
|
1397
|
+
);
|
|
1398
|
+
assert.throws(
|
|
1399
|
+
() => parseConfig({ maintenance: { namespaceLockStaleMs: 1.5 } }),
|
|
1400
|
+
/maintenance\.namespaceLockStaleMs must be a positive integer/,
|
|
1401
|
+
);
|
|
1402
|
+
});
|
package/src/config.ts
CHANGED
|
@@ -19,6 +19,10 @@ import type {
|
|
|
19
19
|
RecallPipelineConfig,
|
|
20
20
|
RecallSectionConfig,
|
|
21
21
|
ReasoningEffort,
|
|
22
|
+
ScopeProfileConfig,
|
|
23
|
+
ScopeProfileLayerId,
|
|
24
|
+
ScopeProfilePromotionTarget,
|
|
25
|
+
ScopeTeamConfig,
|
|
22
26
|
SemanticChunkingConfigShape,
|
|
23
27
|
SessionObserverBandConfig,
|
|
24
28
|
SlotBehaviorConfig,
|
|
@@ -59,6 +63,263 @@ const LEGACY_ACTIVE_RECALL_CUSTOM_FIELD = [
|
|
|
59
63
|
"Prompt",
|
|
60
64
|
"Override",
|
|
61
65
|
].join("") as "activeRecallPromptOverride";
|
|
66
|
+
const SCOPE_PROFILE_LAYER_IDS = [
|
|
67
|
+
"userProject",
|
|
68
|
+
"teamProject",
|
|
69
|
+
"userGlobal",
|
|
70
|
+
"serverShared",
|
|
71
|
+
] as const satisfies readonly ScopeProfileLayerId[];
|
|
72
|
+
const SCOPE_PROFILE_PROMOTION_TARGETS = [
|
|
73
|
+
...SCOPE_PROFILE_LAYER_IDS,
|
|
74
|
+
] as const satisfies readonly ScopeProfilePromotionTarget[];
|
|
75
|
+
const SCOPE_PROFILE_AUTO_PROMOTE_CATEGORIES = [
|
|
76
|
+
"fact",
|
|
77
|
+
"correction",
|
|
78
|
+
"decision",
|
|
79
|
+
"preference",
|
|
80
|
+
"rule",
|
|
81
|
+
"procedure",
|
|
82
|
+
] as const;
|
|
83
|
+
const CONFIDENCE_TIERS = [
|
|
84
|
+
"explicit",
|
|
85
|
+
"implied",
|
|
86
|
+
"inferred",
|
|
87
|
+
"speculative",
|
|
88
|
+
] as const;
|
|
89
|
+
|
|
90
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
91
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function parseStringList(value: unknown, keyName: string): string[] {
|
|
95
|
+
if (value === undefined || value === null) return [];
|
|
96
|
+
if (!Array.isArray(value)) {
|
|
97
|
+
throw new Error(keyName + " must be an array");
|
|
98
|
+
}
|
|
99
|
+
const out: string[] = [];
|
|
100
|
+
for (const entry of value) {
|
|
101
|
+
if (typeof entry !== "string" || entry.length === 0) {
|
|
102
|
+
throw new Error(keyName + " must contain only non-empty strings");
|
|
103
|
+
}
|
|
104
|
+
out.push(entry);
|
|
105
|
+
}
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function parseScopeProfileLayerList(
|
|
110
|
+
value: unknown,
|
|
111
|
+
keyName: string,
|
|
112
|
+
fallback: ScopeProfileLayerId[],
|
|
113
|
+
): ScopeProfileLayerId[] {
|
|
114
|
+
if (value === undefined || value === null) return [...fallback];
|
|
115
|
+
if (!Array.isArray(value)) {
|
|
116
|
+
throw new Error(`${keyName} must be an array`);
|
|
117
|
+
}
|
|
118
|
+
const out: ScopeProfileLayerId[] = [];
|
|
119
|
+
for (const entry of value) {
|
|
120
|
+
if (!SCOPE_PROFILE_LAYER_IDS.includes(entry as ScopeProfileLayerId)) {
|
|
121
|
+
throw new Error(`${keyName} contains unsupported layer: ${String(entry)}`);
|
|
122
|
+
}
|
|
123
|
+
if (!out.includes(entry as ScopeProfileLayerId)) {
|
|
124
|
+
out.push(entry as ScopeProfileLayerId);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return out;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function parseScopeProfilePromotionTargets(
|
|
131
|
+
value: unknown,
|
|
132
|
+
keyName: string,
|
|
133
|
+
): ScopeProfilePromotionTarget[] {
|
|
134
|
+
if (value === undefined || value === null) return [];
|
|
135
|
+
if (!Array.isArray(value)) {
|
|
136
|
+
throw new Error(`${keyName} must be an array`);
|
|
137
|
+
}
|
|
138
|
+
const out: ScopeProfilePromotionTarget[] = [];
|
|
139
|
+
for (const entry of value) {
|
|
140
|
+
if (!SCOPE_PROFILE_PROMOTION_TARGETS.includes(entry as ScopeProfilePromotionTarget)) {
|
|
141
|
+
throw new Error(`${keyName} contains unsupported target: ${String(entry)}`);
|
|
142
|
+
}
|
|
143
|
+
if (!out.includes(entry as ScopeProfilePromotionTarget)) {
|
|
144
|
+
out.push(entry as ScopeProfilePromotionTarget);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return out;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function parseScopeProfiles(value: unknown): Record<string, ScopeProfileConfig> {
|
|
151
|
+
if (value === undefined || value === null) return {};
|
|
152
|
+
if (!isRecord(value)) {
|
|
153
|
+
throw new Error("scopeProfiles must be an object");
|
|
154
|
+
}
|
|
155
|
+
const profiles: Record<string, ScopeProfileConfig> = {};
|
|
156
|
+
for (const [profileId, rawProfile] of Object.entries(value)) {
|
|
157
|
+
if (profileId.trim().length === 0) {
|
|
158
|
+
throw new Error("scopeProfiles keys must not be empty");
|
|
159
|
+
}
|
|
160
|
+
if (!isRecord(rawProfile)) {
|
|
161
|
+
throw new Error(`scopeProfiles.${profileId} must be an object`);
|
|
162
|
+
}
|
|
163
|
+
const readOrder = parseScopeProfileLayerList(
|
|
164
|
+
rawProfile.readOrder,
|
|
165
|
+
`scopeProfiles.${profileId}.readOrder`,
|
|
166
|
+
["userProject", "userGlobal", "serverShared"],
|
|
167
|
+
);
|
|
168
|
+
const writeDefault =
|
|
169
|
+
rawProfile.writeDefault === undefined || rawProfile.writeDefault === null
|
|
170
|
+
? "userProject"
|
|
171
|
+
: rawProfile.writeDefault;
|
|
172
|
+
if (!SCOPE_PROFILE_LAYER_IDS.includes(writeDefault as ScopeProfileLayerId)) {
|
|
173
|
+
throw new Error(`scopeProfiles.${profileId}.writeDefault contains unsupported layer: ${String(writeDefault)}`);
|
|
174
|
+
}
|
|
175
|
+
if (
|
|
176
|
+
rawProfile.teamProject !== undefined &&
|
|
177
|
+
rawProfile.teamProject !== null &&
|
|
178
|
+
!isRecord(rawProfile.teamProject)
|
|
179
|
+
) {
|
|
180
|
+
throw new Error("scopeProfiles." + profileId + ".teamProject must be an object");
|
|
181
|
+
}
|
|
182
|
+
const teamProject = (() => {
|
|
183
|
+
if (!isRecord(rawProfile.teamProject)) return undefined;
|
|
184
|
+
const out: NonNullable<ScopeProfileConfig["teamProject"]> = {};
|
|
185
|
+
if (rawProfile.teamProject.namespaceTemplate !== undefined) {
|
|
186
|
+
if (
|
|
187
|
+
typeof rawProfile.teamProject.namespaceTemplate !== "string" ||
|
|
188
|
+
rawProfile.teamProject.namespaceTemplate.length === 0
|
|
189
|
+
) {
|
|
190
|
+
throw new Error(
|
|
191
|
+
`scopeProfiles.${profileId}.teamProject.namespaceTemplate must be a non-empty string`,
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
out.namespaceTemplate = rawProfile.teamProject.namespaceTemplate;
|
|
195
|
+
}
|
|
196
|
+
if (rawProfile.teamProject.teamId !== undefined) {
|
|
197
|
+
if (
|
|
198
|
+
typeof rawProfile.teamProject.teamId !== "string" ||
|
|
199
|
+
rawProfile.teamProject.teamId.length === 0
|
|
200
|
+
) {
|
|
201
|
+
throw new Error(
|
|
202
|
+
`scopeProfiles.${profileId}.teamProject.teamId must be a non-empty string`,
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
out.teamId = rawProfile.teamProject.teamId;
|
|
206
|
+
}
|
|
207
|
+
return out;
|
|
208
|
+
})();
|
|
209
|
+
if (
|
|
210
|
+
rawProfile.autoPromote !== undefined &&
|
|
211
|
+
rawProfile.autoPromote !== null &&
|
|
212
|
+
!isRecord(rawProfile.autoPromote)
|
|
213
|
+
) {
|
|
214
|
+
throw new Error(`scopeProfiles.${profileId}.autoPromote must be an object`);
|
|
215
|
+
}
|
|
216
|
+
const rawAutoPromote = isRecord(rawProfile.autoPromote) ? rawProfile.autoPromote : {};
|
|
217
|
+
const hasAutoPromoteEnabled = Object.prototype.hasOwnProperty.call(
|
|
218
|
+
rawAutoPromote,
|
|
219
|
+
"enabled",
|
|
220
|
+
);
|
|
221
|
+
const autoPromoteEnabled = coerceBool(rawAutoPromote.enabled);
|
|
222
|
+
if (hasAutoPromoteEnabled && autoPromoteEnabled === undefined) {
|
|
223
|
+
throw new Error(
|
|
224
|
+
`scopeProfiles.${profileId}.autoPromote.enabled must be a boolean or boolean-like string`,
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
const minConfidenceTier = (() => {
|
|
228
|
+
const rawTier = rawAutoPromote.minConfidenceTier;
|
|
229
|
+
if (rawTier === undefined || rawTier === null) return "explicit";
|
|
230
|
+
if (typeof rawTier !== "string" || !CONFIDENCE_TIERS.includes(rawTier as any)) {
|
|
231
|
+
throw new Error(
|
|
232
|
+
`scopeProfiles.${profileId}.autoPromote.minConfidenceTier must be one of: ${CONFIDENCE_TIERS.join(", ")}`,
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
return rawTier as typeof CONFIDENCE_TIERS[number];
|
|
236
|
+
})();
|
|
237
|
+
const autoPromoteCategories: Array<typeof SCOPE_PROFILE_AUTO_PROMOTE_CATEGORIES[number]> = (() => {
|
|
238
|
+
if (rawAutoPromote.categories === undefined || rawAutoPromote.categories === null) {
|
|
239
|
+
return ["fact", "correction", "decision", "preference"];
|
|
240
|
+
}
|
|
241
|
+
if (!Array.isArray(rawAutoPromote.categories)) {
|
|
242
|
+
throw new Error(
|
|
243
|
+
`scopeProfiles.${profileId}.autoPromote.categories must be an array`,
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
const categories: Array<typeof SCOPE_PROFILE_AUTO_PROMOTE_CATEGORIES[number]> = [];
|
|
247
|
+
for (const entry of rawAutoPromote.categories) {
|
|
248
|
+
if (typeof entry !== "string" || !SCOPE_PROFILE_AUTO_PROMOTE_CATEGORIES.includes(entry as any)) {
|
|
249
|
+
throw new Error(
|
|
250
|
+
"scopeProfiles." + profileId + ".autoPromote.categories must contain only: " +
|
|
251
|
+
SCOPE_PROFILE_AUTO_PROMOTE_CATEGORIES.join(", "),
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
categories.push(entry as typeof SCOPE_PROFILE_AUTO_PROMOTE_CATEGORIES[number]);
|
|
255
|
+
}
|
|
256
|
+
return categories;
|
|
257
|
+
})();
|
|
258
|
+
profiles[profileId] = {
|
|
259
|
+
readOrder,
|
|
260
|
+
writeDefault: writeDefault as ScopeProfileLayerId,
|
|
261
|
+
promotionTargets: parseScopeProfilePromotionTargets(
|
|
262
|
+
rawProfile.promotionTargets,
|
|
263
|
+
`scopeProfiles.${profileId}.promotionTargets`,
|
|
264
|
+
),
|
|
265
|
+
...(teamProject && Object.keys(teamProject).length > 0 ? { teamProject } : {}),
|
|
266
|
+
autoPromote: {
|
|
267
|
+
enabled: autoPromoteEnabled === true,
|
|
268
|
+
targets: parseScopeProfilePromotionTargets(
|
|
269
|
+
rawAutoPromote.targets,
|
|
270
|
+
`scopeProfiles.${profileId}.autoPromote.targets`,
|
|
271
|
+
),
|
|
272
|
+
categories: autoPromoteCategories,
|
|
273
|
+
minConfidenceTier,
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
return profiles;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function parseScopeTeams(value: unknown): Record<string, ScopeTeamConfig> {
|
|
281
|
+
if (value === undefined || value === null) return {};
|
|
282
|
+
if (!isRecord(value)) {
|
|
283
|
+
throw new Error("teams must be an object");
|
|
284
|
+
}
|
|
285
|
+
const teams: Record<string, ScopeTeamConfig> = {};
|
|
286
|
+
for (const [teamId, rawTeam] of Object.entries(value)) {
|
|
287
|
+
if (teamId.trim().length === 0) {
|
|
288
|
+
throw new Error("teams keys must not be empty");
|
|
289
|
+
}
|
|
290
|
+
if (!isRecord(rawTeam)) {
|
|
291
|
+
throw new Error(`teams.${teamId} must be an object`);
|
|
292
|
+
}
|
|
293
|
+
const projectNamespaceTemplate = rawTeam.projectNamespaceTemplate;
|
|
294
|
+
if (projectNamespaceTemplate !== undefined) {
|
|
295
|
+
if (typeof projectNamespaceTemplate !== "string" || projectNamespaceTemplate.length === 0) {
|
|
296
|
+
throw new Error(`teams.${teamId}.projectNamespaceTemplate must be a non-empty string`);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
teams[teamId] = {
|
|
300
|
+
principals: parseStringList(rawTeam.principals, `teams.${teamId}.principals`),
|
|
301
|
+
...(projectNamespaceTemplate !== undefined ? { projectNamespaceTemplate } : {}),
|
|
302
|
+
read: parseStringList(rawTeam.read, `teams.${teamId}.read`),
|
|
303
|
+
write: parseStringList(rawTeam.write, `teams.${teamId}.write`),
|
|
304
|
+
promote: parseStringList(rawTeam.promote, `teams.${teamId}.promote`),
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
return teams;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function validateScopeProfileTeamReferences(
|
|
311
|
+
profiles: Record<string, ScopeProfileConfig>,
|
|
312
|
+
teams: Record<string, ScopeTeamConfig>,
|
|
313
|
+
): void {
|
|
314
|
+
for (const [profileId, profile] of Object.entries(profiles)) {
|
|
315
|
+
const teamId = profile.teamProject?.teamId;
|
|
316
|
+
if (teamId && !Object.prototype.hasOwnProperty.call(teams, teamId)) {
|
|
317
|
+
throw new Error(
|
|
318
|
+
`scopeProfiles.${profileId}.teamProject.teamId references unknown team: ${teamId}`,
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
62
323
|
|
|
63
324
|
function parseBoundedIntegerMs(
|
|
64
325
|
value: unknown,
|
|
@@ -405,6 +666,74 @@ function resolveNamespaceCatalogEnabled(configValue: unknown): boolean {
|
|
|
405
666
|
return true;
|
|
406
667
|
}
|
|
407
668
|
|
|
669
|
+
function readNestedConfig(
|
|
670
|
+
cfg: Record<string, unknown>,
|
|
671
|
+
blockName: string,
|
|
672
|
+
key: string,
|
|
673
|
+
): unknown {
|
|
674
|
+
const block = validateNestedConfigBlock(cfg, blockName);
|
|
675
|
+
if (!block) return undefined;
|
|
676
|
+
return block[key];
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
function validateNestedConfigBlock(
|
|
680
|
+
cfg: Record<string, unknown>,
|
|
681
|
+
blockName: string,
|
|
682
|
+
): Record<string, unknown> | undefined {
|
|
683
|
+
const block = cfg[blockName];
|
|
684
|
+
if (block === undefined || block === null) return undefined;
|
|
685
|
+
if (typeof block !== "object" || Array.isArray(block)) {
|
|
686
|
+
throw new Error(`${blockName} must be a plain object`);
|
|
687
|
+
}
|
|
688
|
+
return block as Record<string, unknown>;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
function readFlatOrNestedConfig(
|
|
692
|
+
cfg: Record<string, unknown>,
|
|
693
|
+
flatKey: string,
|
|
694
|
+
blockName: string,
|
|
695
|
+
nestedKey: string,
|
|
696
|
+
): unknown {
|
|
697
|
+
return cfg[flatKey] !== undefined
|
|
698
|
+
? cfg[flatKey]
|
|
699
|
+
: readNestedConfig(cfg, blockName, nestedKey);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
function resolveBooleanConfig(
|
|
703
|
+
value: unknown,
|
|
704
|
+
defaultValue: boolean,
|
|
705
|
+
keyName: string,
|
|
706
|
+
): boolean {
|
|
707
|
+
if (value === undefined || value === null) return defaultValue;
|
|
708
|
+
const coerced = coerceBool(value);
|
|
709
|
+
if (coerced === undefined) {
|
|
710
|
+
throw new Error(
|
|
711
|
+
`${keyName} must be a boolean-like value (true/false/1/0/yes/no/on/off); got ${JSON.stringify(value)}`,
|
|
712
|
+
);
|
|
713
|
+
}
|
|
714
|
+
return coerced;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
function resolvePositiveIntegerConfig(
|
|
718
|
+
value: unknown,
|
|
719
|
+
defaultValue: number,
|
|
720
|
+
keyName: string,
|
|
721
|
+
): number {
|
|
722
|
+
if (value === undefined || value === null) return defaultValue;
|
|
723
|
+
const coerced = coerceNumber(value);
|
|
724
|
+
if (
|
|
725
|
+
coerced === undefined ||
|
|
726
|
+
!Number.isFinite(coerced) ||
|
|
727
|
+
!Number.isInteger(coerced) ||
|
|
728
|
+
coerced < 1
|
|
729
|
+
) {
|
|
730
|
+
throw new Error(
|
|
731
|
+
`${keyName} must be a positive integer; got ${JSON.stringify(value)}`,
|
|
732
|
+
);
|
|
733
|
+
}
|
|
734
|
+
return coerced;
|
|
735
|
+
}
|
|
736
|
+
|
|
408
737
|
export function isOpenaiApiKeyDisabled(value: unknown): boolean {
|
|
409
738
|
return value === false || (typeof value === "string" && value.trim().toLowerCase() === "false");
|
|
410
739
|
}
|
|
@@ -768,6 +1097,7 @@ export function parseConfig(raw: unknown): PluginConfig {
|
|
|
768
1097
|
} else {
|
|
769
1098
|
cfg = baseCfg;
|
|
770
1099
|
}
|
|
1100
|
+
validateNestedConfigBlock(cfg, "maintenance");
|
|
771
1101
|
|
|
772
1102
|
const modelSource =
|
|
773
1103
|
cfg.modelSource === "gateway" ? "gateway" : "plugin";
|
|
@@ -1212,6 +1542,24 @@ export function parseConfig(raw: unknown): PluginConfig {
|
|
|
1212
1542
|
typeof cfg.memoryDir === "string" && cfg.memoryDir.length > 0
|
|
1213
1543
|
? expandTildePath(cfg.memoryDir)
|
|
1214
1544
|
: DEFAULT_MEMORY_DIR;
|
|
1545
|
+
const scopeProfiles = parseScopeProfiles(cfg.scopeProfiles);
|
|
1546
|
+
const teams = parseScopeTeams(cfg.teams);
|
|
1547
|
+
validateScopeProfileTeamReferences(scopeProfiles, teams);
|
|
1548
|
+
const defaultScopeProfile = (() => {
|
|
1549
|
+
if (cfg.defaultScopeProfile === undefined || cfg.defaultScopeProfile === null) {
|
|
1550
|
+
return undefined;
|
|
1551
|
+
}
|
|
1552
|
+
if (typeof cfg.defaultScopeProfile !== "string" || cfg.defaultScopeProfile.trim().length === 0) {
|
|
1553
|
+
throw new Error("defaultScopeProfile must be a non-empty string");
|
|
1554
|
+
}
|
|
1555
|
+
return cfg.defaultScopeProfile.trim();
|
|
1556
|
+
})();
|
|
1557
|
+
if (
|
|
1558
|
+
defaultScopeProfile !== undefined &&
|
|
1559
|
+
scopeProfiles[defaultScopeProfile] === undefined
|
|
1560
|
+
) {
|
|
1561
|
+
throw new Error(`defaultScopeProfile references unknown scope profile: ${defaultScopeProfile}`);
|
|
1562
|
+
}
|
|
1215
1563
|
const rawIdentityInjectionMode = cfg.identityInjectionMode as string | undefined;
|
|
1216
1564
|
const identityInjectionMode: IdentityInjectionMode =
|
|
1217
1565
|
rawIdentityInjectionMode
|
|
@@ -1482,6 +1830,66 @@ export function parseConfig(raw: unknown): PluginConfig {
|
|
|
1482
1830
|
? Math.max(1, Math.floor(cfg.crossSignalsSemanticTimeoutMs))
|
|
1483
1831
|
: 4000;
|
|
1484
1832
|
const recallPipelineConfig = buildRecallPipelineConfig(cfg);
|
|
1833
|
+
const maintenanceNamespaceFanoutEnabled = resolveBooleanConfig(
|
|
1834
|
+
readFlatOrNestedConfig(
|
|
1835
|
+
cfg,
|
|
1836
|
+
"maintenanceNamespaceFanoutEnabled",
|
|
1837
|
+
"maintenance",
|
|
1838
|
+
"namespaceFanoutEnabled",
|
|
1839
|
+
),
|
|
1840
|
+
true,
|
|
1841
|
+
"maintenance.namespaceFanoutEnabled",
|
|
1842
|
+
);
|
|
1843
|
+
const maintenanceMaxNamespacesPerCycle = resolvePositiveIntegerConfig(
|
|
1844
|
+
readFlatOrNestedConfig(
|
|
1845
|
+
cfg,
|
|
1846
|
+
"maintenanceMaxNamespacesPerCycle",
|
|
1847
|
+
"maintenance",
|
|
1848
|
+
"maxNamespacesPerCycle",
|
|
1849
|
+
),
|
|
1850
|
+
20,
|
|
1851
|
+
"maintenance.maxNamespacesPerCycle",
|
|
1852
|
+
);
|
|
1853
|
+
const maintenanceIncludeProjectNamespaces = resolveBooleanConfig(
|
|
1854
|
+
readFlatOrNestedConfig(
|
|
1855
|
+
cfg,
|
|
1856
|
+
"maintenanceIncludeProjectNamespaces",
|
|
1857
|
+
"maintenance",
|
|
1858
|
+
"includeProjectNamespaces",
|
|
1859
|
+
),
|
|
1860
|
+
true,
|
|
1861
|
+
"maintenance.includeProjectNamespaces",
|
|
1862
|
+
);
|
|
1863
|
+
const maintenanceIncludeBranchNamespaces = resolveBooleanConfig(
|
|
1864
|
+
readFlatOrNestedConfig(
|
|
1865
|
+
cfg,
|
|
1866
|
+
"maintenanceIncludeBranchNamespaces",
|
|
1867
|
+
"maintenance",
|
|
1868
|
+
"includeBranchNamespaces",
|
|
1869
|
+
),
|
|
1870
|
+
false,
|
|
1871
|
+
"maintenance.includeBranchNamespaces",
|
|
1872
|
+
);
|
|
1873
|
+
const maintenanceIncludeTeamProjectNamespaces = resolveBooleanConfig(
|
|
1874
|
+
readFlatOrNestedConfig(
|
|
1875
|
+
cfg,
|
|
1876
|
+
"maintenanceIncludeTeamProjectNamespaces",
|
|
1877
|
+
"maintenance",
|
|
1878
|
+
"includeTeamProjectNamespaces",
|
|
1879
|
+
),
|
|
1880
|
+
true,
|
|
1881
|
+
"maintenance.includeTeamProjectNamespaces",
|
|
1882
|
+
);
|
|
1883
|
+
const maintenanceNamespaceLockStaleMs = resolvePositiveIntegerConfig(
|
|
1884
|
+
readFlatOrNestedConfig(
|
|
1885
|
+
cfg,
|
|
1886
|
+
"maintenanceNamespaceLockStaleMs",
|
|
1887
|
+
"maintenance",
|
|
1888
|
+
"namespaceLockStaleMs",
|
|
1889
|
+
),
|
|
1890
|
+
10 * 60_000,
|
|
1891
|
+
"maintenance.namespaceLockStaleMs",
|
|
1892
|
+
);
|
|
1485
1893
|
|
|
1486
1894
|
return {
|
|
1487
1895
|
openaiApiKey: apiKey,
|
|
@@ -2546,6 +2954,12 @@ export function parseConfig(raw: unknown): PluginConfig {
|
|
|
2546
2954
|
qmdMaintenanceEnabled: cfg.qmdMaintenanceEnabled !== false,
|
|
2547
2955
|
qmdMaintenanceDebounceMs:
|
|
2548
2956
|
typeof cfg.qmdMaintenanceDebounceMs === "number" ? cfg.qmdMaintenanceDebounceMs : 30_000,
|
|
2957
|
+
maintenanceNamespaceFanoutEnabled,
|
|
2958
|
+
maintenanceMaxNamespacesPerCycle,
|
|
2959
|
+
maintenanceIncludeProjectNamespaces,
|
|
2960
|
+
maintenanceIncludeBranchNamespaces,
|
|
2961
|
+
maintenanceIncludeTeamProjectNamespaces,
|
|
2962
|
+
maintenanceNamespaceLockStaleMs,
|
|
2549
2963
|
qmdAutoEmbedEnabled: cfg.qmdAutoEmbedEnabled === true,
|
|
2550
2964
|
qmdEmbedMinIntervalMs:
|
|
2551
2965
|
typeof cfg.qmdEmbedMinIntervalMs === "number" ? cfg.qmdEmbedMinIntervalMs : 60 * 60_000,
|
|
@@ -2642,6 +3056,9 @@ export function parseConfig(raw: unknown): PluginConfig {
|
|
|
2642
3056
|
})).filter((p) => p.name.length > 0)
|
|
2643
3057
|
: [],
|
|
2644
3058
|
defaultRecallNamespaces: Array.isArray(cfg.defaultRecallNamespaces) ? ["self", "shared"].filter((x) => (cfg.defaultRecallNamespaces as any[]).includes(x)) as any : ["self", "shared"],
|
|
3059
|
+
scopeProfiles,
|
|
3060
|
+
defaultScopeProfile,
|
|
3061
|
+
teams,
|
|
2645
3062
|
cronRecallMode:
|
|
2646
3063
|
cfg.cronRecallMode === "none"
|
|
2647
3064
|
? "none"
|
package/src/lcm-fallback-read.ts
CHANGED
|
@@ -57,10 +57,7 @@ const UNDEFINED_SESSION_SENTINEL = " <lcm-sessionless>";
|
|
|
57
57
|
export function resolveLcmReadSessionIds(
|
|
58
58
|
target: LcmReadSessionTarget,
|
|
59
59
|
): Array<string | undefined> {
|
|
60
|
-
const source =
|
|
61
|
-
target.sessionIds && target.sessionIds.length > 0
|
|
62
|
-
? target.sessionIds
|
|
63
|
-
: [target.sessionId];
|
|
60
|
+
const source = target.sessionIds !== undefined ? target.sessionIds : [target.sessionId];
|
|
64
61
|
const seen = new Set<string>();
|
|
65
62
|
const out: Array<string | undefined> = [];
|
|
66
63
|
for (const sessionId of source) {
|
|
@@ -69,8 +66,7 @@ export function resolveLcmReadSessionIds(
|
|
|
69
66
|
seen.add(key);
|
|
70
67
|
out.push(sessionId);
|
|
71
68
|
}
|
|
72
|
-
|
|
73
|
-
return out.length > 0 ? out : [target.sessionId];
|
|
69
|
+
return out;
|
|
74
70
|
}
|
|
75
71
|
|
|
76
72
|
/**
|