@jmanuelcorral/openteam 0.2.2 → 0.9.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/.opencode/command/openteam.md +2 -1
- package/.opencode/openteam.example.json +27 -8
- package/AGENTS.md +5 -2
- package/README.es.md +155 -59
- package/README.md +418 -62
- package/dist/capabilities/types.d.ts +3 -3
- package/dist/capabilities/types.d.ts.map +1 -1
- package/dist/classifier/localClassifier.d.ts +0 -2
- package/dist/classifier/localClassifier.d.ts.map +1 -1
- package/dist/cli/consoleServe.d.ts +21 -1
- package/dist/cli/consoleServe.d.ts.map +1 -1
- package/dist/cli/graphOperator.d.ts +22 -0
- package/dist/cli/graphOperator.d.ts.map +1 -0
- package/dist/cli/graphStatusSnapshot.d.ts +16 -0
- package/dist/cli/graphStatusSnapshot.d.ts.map +1 -0
- package/dist/cli/migrateAdapter.d.ts +12 -0
- package/dist/cli/migrateAdapter.d.ts.map +1 -0
- package/dist/cli/purgeAdapter.d.ts +10 -0
- package/dist/cli/purgeAdapter.d.ts.map +1 -0
- package/dist/cli/setupAdapters.d.ts.map +1 -1
- package/dist/cli.js +13394 -6121
- package/dist/commands/agents.d.ts +102 -2
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/baseline.d.ts.map +1 -1
- package/dist/commands/clearCache.d.ts +23 -0
- package/dist/commands/clearCache.d.ts.map +1 -0
- package/dist/commands/dispatch.d.ts +196 -4
- package/dist/commands/dispatch.d.ts.map +1 -1
- package/dist/commands/doctor.d.ts +40 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/frontierCatalog.d.ts +8 -14
- package/dist/commands/frontierCatalog.d.ts.map +1 -1
- package/dist/commands/graph.d.ts +0 -27
- package/dist/commands/graph.d.ts.map +1 -1
- package/dist/commands/local.d.ts.map +1 -1
- package/dist/commands/migrate.d.ts +11 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/purge.d.ts +132 -0
- package/dist/commands/purge.d.ts.map +1 -0
- package/dist/commands/report.d.ts +1 -0
- package/dist/commands/report.d.ts.map +1 -1
- package/dist/commands/setup.d.ts +62 -5
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/config/errors.d.ts +10 -0
- package/dist/config/errors.d.ts.map +1 -0
- package/dist/config/legacyMigration.d.ts +82 -0
- package/dist/config/legacyMigration.d.ts.map +1 -0
- package/dist/config/legacyPaths.d.ts +105 -0
- package/dist/config/legacyPaths.d.ts.map +1 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/opencode.d.ts +63 -0
- package/dist/config/opencode.d.ts.map +1 -0
- package/dist/config/persist.d.ts +8 -0
- package/dist/config/persist.d.ts.map +1 -1
- package/dist/config/resolve.d.ts +1 -1
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/runtime.d.ts +62 -0
- package/dist/config/runtime.d.ts.map +1 -0
- package/dist/config/schema.d.ts +142 -79
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/console/assets.d.ts +2 -2
- package/dist/console/assets.d.ts.map +1 -1
- package/dist/console/configView.d.ts +74 -0
- package/dist/console/configView.d.ts.map +1 -0
- package/dist/console/opencodeClient.d.ts +8 -6
- package/dist/console/opencodeClient.d.ts.map +1 -1
- package/dist/console/protocol.d.ts +30 -6
- package/dist/console/protocol.d.ts.map +1 -1
- package/dist/console/render.d.ts +30 -1
- package/dist/console/render.d.ts.map +1 -1
- package/dist/console/types.d.ts +1 -1
- package/dist/console/types.d.ts.map +1 -1
- package/dist/context/redaction.d.ts +19 -19
- package/dist/context/redaction.d.ts.map +1 -1
- package/dist/context/schema.d.ts +26 -26
- package/dist/context/schema.d.ts.map +1 -1
- package/dist/context/types.d.ts +3 -3
- package/dist/contract/opencode.d.ts +39 -23
- package/dist/contract/opencode.d.ts.map +1 -1
- package/dist/graph/certificate.d.ts +37 -16
- package/dist/graph/certificate.d.ts.map +1 -1
- package/dist/graph/langgraph/adapter.d.ts +56 -0
- package/dist/graph/langgraph/adapter.d.ts.map +1 -0
- package/dist/graph/langgraph/certification.d.ts +64 -0
- package/dist/graph/langgraph/certification.d.ts.map +1 -0
- package/dist/graph/langgraph/checkpointReplay.d.ts +49 -0
- package/dist/graph/langgraph/checkpointReplay.d.ts.map +1 -0
- package/dist/graph/langgraph/checkpointer.d.ts +49 -0
- package/dist/graph/langgraph/checkpointer.d.ts.map +1 -0
- package/dist/graph/langgraph/engine.d.ts +34 -0
- package/dist/graph/langgraph/engine.d.ts.map +1 -0
- package/dist/graph/langgraph/graphModel.d.ts +37 -0
- package/dist/graph/langgraph/graphModel.d.ts.map +1 -0
- package/dist/graph/langgraph/reducer.d.ts +18 -0
- package/dist/graph/langgraph/reducer.d.ts.map +1 -0
- package/dist/graph/langgraph/retirement.d.ts +59 -0
- package/dist/graph/langgraph/retirement.d.ts.map +1 -0
- package/dist/graph/langgraph/types.d.ts +65 -0
- package/dist/graph/langgraph/types.d.ts.map +1 -0
- package/dist/graph/privacyPolicy.d.ts +7 -0
- package/dist/graph/privacyPolicy.d.ts.map +1 -1
- package/dist/graph/soakLedger.d.ts.map +1 -1
- package/dist/graph/types.d.ts +0 -2
- package/dist/graph/types.d.ts.map +1 -1
- package/dist/index.d.ts +46 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11083 -5009
- package/dist/local/cacheAdapter.d.ts +7 -0
- package/dist/local/cacheAdapter.d.ts.map +1 -0
- package/dist/local/concurrency.d.ts +52 -0
- package/dist/local/concurrency.d.ts.map +1 -0
- package/dist/local/embeddings.d.ts +10 -10
- package/dist/local/embeddings.d.ts.map +1 -1
- package/dist/local/extractClient.d.ts +13 -10
- package/dist/local/extractClient.d.ts.map +1 -1
- package/dist/local/lemonade.d.ts +4 -0
- package/dist/local/lemonade.d.ts.map +1 -0
- package/dist/local/registry.d.ts +16 -0
- package/dist/local/registry.d.ts.map +1 -1
- package/dist/local/types.d.ts +1 -1
- package/dist/local/types.d.ts.map +1 -1
- package/dist/mcp/semanticRecall.d.ts +18 -1
- package/dist/mcp/semanticRecall.d.ts.map +1 -1
- package/dist/mcp/server.d.ts +41 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/memory/embedText.d.ts +4 -0
- package/dist/memory/embedText.d.ts.map +1 -0
- package/dist/memory/extract.d.ts +33 -18
- package/dist/memory/extract.d.ts.map +1 -1
- package/dist/memory/fold.d.ts +3 -2
- package/dist/memory/fold.d.ts.map +1 -1
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/inject.d.ts.map +1 -1
- package/dist/memory/log.d.ts +15 -4
- package/dist/memory/log.d.ts.map +1 -1
- package/dist/memory/merge.d.ts +18 -1
- package/dist/memory/merge.d.ts.map +1 -1
- package/dist/memory/traverse.d.ts +80 -0
- package/dist/memory/traverse.d.ts.map +1 -0
- package/dist/memory/types.d.ts +53 -7
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/messages/commands.d.ts +84 -0
- package/dist/messages/commands.d.ts.map +1 -0
- package/dist/messages/index.d.ts +46 -0
- package/dist/messages/index.d.ts.map +1 -0
- package/dist/opencodeArtifacts/index.d.ts +33 -0
- package/dist/opencodeArtifacts/index.d.ts.map +1 -0
- package/dist/opencodeArtifacts/orchestratorAgent.d.ts +29 -0
- package/dist/opencodeArtifacts/orchestratorAgent.d.ts.map +1 -0
- package/dist/opencodeArtifacts/slashCommand.d.ts +31 -0
- package/dist/opencodeArtifacts/slashCommand.d.ts.map +1 -0
- package/dist/orchestrator/coordinator.d.ts +152 -1
- package/dist/orchestrator/coordinator.d.ts.map +1 -1
- package/dist/orchestrator/graphCancellation.d.ts +40 -37
- package/dist/orchestrator/graphCancellation.d.ts.map +1 -1
- package/dist/orchestrator/graphEffects.d.ts +24 -24
- package/dist/orchestrator/graphEffects.d.ts.map +1 -1
- package/dist/orchestrator/graphFacade.d.ts +16 -16
- package/dist/orchestrator/graphFacade.d.ts.map +1 -1
- package/dist/orchestrator/graphIngress.d.ts +49 -45
- package/dist/orchestrator/graphIngress.d.ts.map +1 -1
- package/dist/orchestrator/graphReview.d.ts +24 -23
- package/dist/orchestrator/graphReview.d.ts.map +1 -1
- package/dist/orchestrator/graphRuntime.d.ts +27 -26
- package/dist/orchestrator/graphRuntime.d.ts.map +1 -1
- package/dist/orchestrator/graphShadow.d.ts +70 -69
- package/dist/orchestrator/graphShadow.d.ts.map +1 -1
- package/dist/orchestrator/opencodeSessionAdapter.d.ts +25 -25
- package/dist/orchestrator/opencodeSessionAdapter.d.ts.map +1 -1
- package/dist/orchestrator/permissions.d.ts.map +1 -1
- package/dist/orchestrator/ralphLoop.d.ts +57 -0
- package/dist/orchestrator/ralphLoop.d.ts.map +1 -0
- package/dist/orchestrator/roles.d.ts +50 -8
- package/dist/orchestrator/roles.d.ts.map +1 -1
- package/dist/orchestrator/roster.d.ts +103 -0
- package/dist/orchestrator/roster.d.ts.map +1 -0
- package/dist/orchestrator/rosterPersistence.d.ts +22 -0
- package/dist/orchestrator/rosterPersistence.d.ts.map +1 -0
- package/dist/orchestrator/runtimeSelection.d.ts +46 -0
- package/dist/orchestrator/runtimeSelection.d.ts.map +1 -0
- package/dist/orchestrator/sddCompiler.d.ts +34 -34
- package/dist/orchestrator/sddCompiler.d.ts.map +1 -1
- package/dist/orchestrator/sessionReconciler.d.ts +31 -29
- package/dist/orchestrator/sessionReconciler.d.ts.map +1 -1
- package/dist/orchestrator/shadowComparator.d.ts +23 -23
- package/dist/orchestrator/shadowComparator.d.ts.map +1 -1
- package/dist/orchestrator/subsessions.d.ts.map +1 -1
- package/dist/orchestrator/worktreeAdapter.d.ts +12 -12
- package/dist/orchestrator/worktreeAdapter.d.ts.map +1 -1
- package/dist/orchestrator/worktreeDispatch.d.ts +34 -34
- package/dist/orchestrator/worktreeDispatch.d.ts.map +1 -1
- package/dist/orchestrator/worktreeReconciler.d.ts +37 -36
- package/dist/orchestrator/worktreeReconciler.d.ts.map +1 -1
- package/dist/plugin/availability.d.ts.map +1 -1
- package/dist/plugin/capture.d.ts +12 -12
- package/dist/plugin/capture.d.ts.map +1 -1
- package/dist/plugin/commandTool.d.ts +1 -1
- package/dist/plugin/commandTool.d.ts.map +1 -1
- package/dist/plugin/graphShadowIngress.d.ts +50 -48
- package/dist/plugin/graphShadowIngress.d.ts.map +1 -1
- package/dist/plugin/graphTool.d.ts +25 -23
- package/dist/plugin/graphTool.d.ts.map +1 -1
- package/dist/plugin/hooks.d.ts +10 -10
- package/dist/plugin/hooks.d.ts.map +1 -1
- package/dist/plugin/legacyRunProducer.d.ts +22 -22
- package/dist/plugin/legacyRunProducer.d.ts.map +1 -1
- package/dist/plugin/memoryInject.d.ts +6 -6
- package/dist/plugin/memoryInject.d.ts.map +1 -1
- package/dist/plugin/memoryTool.d.ts +36 -0
- package/dist/plugin/memoryTool.d.ts.map +1 -0
- package/dist/plugin/orchestrateTool.d.ts +35 -2
- package/dist/plugin/orchestrateTool.d.ts.map +1 -1
- package/dist/plugin/reportRunSchema.d.ts +8 -8
- package/dist/plugin/reportRunSchema.d.ts.map +1 -1
- package/dist/plugin/sessionTracker.d.ts +15 -15
- package/dist/plugin/sessionTracker.d.ts.map +1 -1
- package/dist/plugin/shadowPipeline.d.ts +2 -1
- package/dist/plugin/shadowPipeline.d.ts.map +1 -1
- package/dist/plugin/soakObserver.d.ts +18 -11
- package/dist/plugin/soakObserver.d.ts.map +1 -1
- package/dist/plugin/toolcalls.d.ts +3 -3
- package/dist/router/chooseModel.d.ts.map +1 -1
- package/dist/router/frontierBaseline.d.ts +3 -3
- package/dist/router/modelSelection.d.ts +12 -4
- package/dist/router/modelSelection.d.ts.map +1 -1
- package/dist/router/types.d.ts +6 -1
- package/dist/router/types.d.ts.map +1 -1
- package/dist/storage/graph/snapshot.d.ts.map +1 -1
- package/dist/storage/graph/soakRecorder.d.ts +14 -1
- package/dist/storage/graph/soakRecorder.d.ts.map +1 -1
- package/dist/storage/graph/workspaceLease.d.ts +1 -1
- package/dist/storage/graph/workspaceLease.d.ts.map +1 -1
- package/dist/storage/graph/worktreeRegistry.d.ts +1 -1
- package/dist/storage/graph/worktreeRegistry.d.ts.map +1 -1
- package/dist/storage/httpStorageProvider.d.ts +2 -2
- package/dist/storage/index/bunSqlite.d.ts +1 -0
- package/dist/storage/index/bunSqlite.d.ts.map +1 -1
- package/dist/storage/index/memoryConsolidate.d.ts +2 -0
- package/dist/storage/index/memoryConsolidate.d.ts.map +1 -1
- package/dist/storage/index/memoryEmbeddings.d.ts +51 -0
- package/dist/storage/index/memoryEmbeddings.d.ts.map +1 -0
- package/dist/storage/index/memoryIndex.d.ts +36 -4
- package/dist/storage/index/memoryIndex.d.ts.map +1 -1
- package/dist/storage/index/memoryRecall.d.ts +1 -1
- package/dist/storage/index/memoryRecall.d.ts.map +1 -1
- package/dist/storage/index/memoryRuntime.d.ts +2 -0
- package/dist/storage/index/memoryRuntime.d.ts.map +1 -1
- package/dist/storage/index/sqliteIndex.d.ts +18 -1
- package/dist/storage/index/sqliteIndex.d.ts.map +1 -1
- package/dist/storage/path.d.ts.map +1 -1
- package/dist/telemetry/aggregate.d.ts +12 -12
- package/dist/telemetry/aggregate.d.ts.map +1 -1
- package/dist/telemetry/cost.d.ts.map +1 -1
- package/dist/telemetry/decisions.d.ts +11 -11
- package/dist/telemetry/decisions.d.ts.map +1 -1
- package/dist/telemetry/eventLog.d.ts +41 -25
- package/dist/telemetry/eventLog.d.ts.map +1 -1
- package/dist/telemetry/events.d.ts +44 -36
- package/dist/telemetry/events.d.ts.map +1 -1
- package/dist/telemetry/fanout.d.ts +18 -0
- package/dist/telemetry/fanout.d.ts.map +1 -0
- package/dist/telemetry/graphProjection.d.ts +12 -12
- package/dist/telemetry/graphProjection.d.ts.map +1 -1
- package/dist/telemetry/graphRuntimeHealth.d.ts +26 -26
- package/dist/telemetry/graphRuntimeHealth.d.ts.map +1 -1
- package/dist/telemetry/graphView.d.ts +20 -20
- package/dist/telemetry/graphView.d.ts.map +1 -1
- package/dist/telemetry/otel.d.ts +86 -0
- package/dist/telemetry/otel.d.ts.map +1 -0
- package/dist/telemetry/otelConfig.d.ts +128 -0
- package/dist/telemetry/otelConfig.d.ts.map +1 -0
- package/dist/telemetry/otelExporter.d.ts +7 -0
- package/dist/telemetry/otelExporter.d.ts.map +1 -0
- package/dist/telemetry/read.d.ts +18 -4
- package/dist/telemetry/read.d.ts.map +1 -1
- package/dist/telemetry/types.d.ts +3 -2
- package/dist/telemetry/types.d.ts.map +1 -1
- package/dist/web/configApi.d.ts +154 -0
- package/dist/web/configApi.d.ts.map +1 -0
- package/dist/web/configRoute.d.ts +57 -0
- package/dist/web/configRoute.d.ts.map +1 -0
- package/dist/web/console.d.ts +8 -0
- package/dist/web/console.d.ts.map +1 -1
- package/dist/web/paths.d.ts +4 -3
- package/dist/web/paths.d.ts.map +1 -1
- package/dist/web/server.d.ts +30 -1
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/start.d.ts +15 -0
- package/dist/web/start.d.ts.map +1 -1
- package/dist/web/storageRoute.d.ts +2 -2
- package/package.json +13 -7
- package/dist/cli/tunnel.d.ts +0 -89
- package/dist/cli/tunnel.d.ts.map +0 -1
- package/dist/commands/orchestratorAgent.d.ts +0 -30
- package/dist/commands/orchestratorAgent.d.ts.map +0 -1
- package/dist/commands/slashCommand.d.ts +0 -39
- package/dist/commands/slashCommand.d.ts.map +0 -1
- package/dist/orchestrator/ledger.d.ts +0 -28
- package/dist/orchestrator/ledger.d.ts.map +0 -1
- package/dist/storage/graph/importLegacy.d.ts +0 -62
- package/dist/storage/graph/importLegacy.d.ts.map +0 -1
- package/dist/storage/graph/migration.d.ts +0 -91
- package/dist/storage/graph/migration.d.ts.map +0 -1
- package/dist/storage/graph/projections.d.ts +0 -31
- package/dist/storage/graph/projections.d.ts.map +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CachePort } from "../commands/clearCache";
|
|
2
|
+
/**
|
|
3
|
+
* Real `CachePort` implementation that uses the local filesystem and OS.
|
|
4
|
+
* All I/O in this adapter; none in src/commands/clearCache.ts.
|
|
5
|
+
*/
|
|
6
|
+
export declare const realCacheAdapter: CachePort;
|
|
7
|
+
//# sourceMappingURL=cacheAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacheAdapter.d.ts","sourceRoot":"","sources":["../../src/local/cacheAdapter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAqMpE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAK9B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { LocalRuntimeId } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Releases a previously acquired runtime slot. Idempotent: calling it more than
|
|
4
|
+
* once has no additional effect, so a task's `finally` can release safely even
|
|
5
|
+
* on error paths.
|
|
6
|
+
*/
|
|
7
|
+
export type RuntimeSlotRelease = () => void;
|
|
8
|
+
/**
|
|
9
|
+
* Per-runtime concurrency limiter with FIFO queuing (#144).
|
|
10
|
+
*
|
|
11
|
+
* A runtime has a fixed number of slots (its configured `maxConcurrency`). The
|
|
12
|
+
* limiter caps concurrent generations to that number and QUEUES excess work
|
|
13
|
+
* rather than dropping it or spilling it to a different runtime — the exact
|
|
14
|
+
* behaviour the live overload incident demanded (seven requests against a
|
|
15
|
+
* four-slot runtime). Selection of WHICH runtime is a separate concern; the
|
|
16
|
+
* limiter never changes the runtime a task was assigned, so a task stays pinned
|
|
17
|
+
* to its runtime for its whole duration even while it waits in the queue.
|
|
18
|
+
*
|
|
19
|
+
* `tryAcquire` is deliberately synchronous: on the happy path (a free slot) it
|
|
20
|
+
* returns a release with no `await`, so dispatch adds no extra microtask and the
|
|
21
|
+
* concurrent-telemetry emission order of a wave is unperturbed. Only when a
|
|
22
|
+
* runtime is saturated does `acquire` return a promise that settles when a slot
|
|
23
|
+
* frees.
|
|
24
|
+
*/
|
|
25
|
+
export type RuntimeConcurrencyLimiter = {
|
|
26
|
+
/**
|
|
27
|
+
* Attempts to take a slot for `runtimeId` synchronously. Returns a release
|
|
28
|
+
* when a slot was free, or `undefined` when the runtime is at its cap.
|
|
29
|
+
*/
|
|
30
|
+
tryAcquire(runtimeId: LocalRuntimeId): RuntimeSlotRelease | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Takes a slot for `runtimeId`, queuing FIFO when the runtime is saturated.
|
|
33
|
+
* Resolves with a release once a slot is available. Prefer `tryAcquire` first
|
|
34
|
+
* and only `await acquire` when it returns `undefined`, so the common free
|
|
35
|
+
* path stays synchronous.
|
|
36
|
+
*/
|
|
37
|
+
acquire(runtimeId: LocalRuntimeId): Promise<RuntimeSlotRelease>;
|
|
38
|
+
/** Current in-flight count for a runtime. Exposed for tests and diagnostics. */
|
|
39
|
+
activeCount(runtimeId: LocalRuntimeId): number;
|
|
40
|
+
/** Current queued (waiting) count for a runtime. Exposed for tests. */
|
|
41
|
+
queuedCount(runtimeId: LocalRuntimeId): number;
|
|
42
|
+
};
|
|
43
|
+
export type RuntimeConcurrencyLimiterOptions = {
|
|
44
|
+
/**
|
|
45
|
+
* Resolves the slot count for a runtime. Injected so the limiter carries no
|
|
46
|
+
* config coupling; callers apply `DEFAULT_LOCAL_MAX_CONCURRENCY` when a
|
|
47
|
+
* runtime does not declare a cap. Must return a positive integer.
|
|
48
|
+
*/
|
|
49
|
+
capacityFor: (runtimeId: LocalRuntimeId) => number;
|
|
50
|
+
};
|
|
51
|
+
export declare function createRuntimeConcurrencyLimiter(options: RuntimeConcurrencyLimiterOptions): RuntimeConcurrencyLimiter;
|
|
52
|
+
//# sourceMappingURL=concurrency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concurrency.d.ts","sourceRoot":"","sources":["../../src/local/concurrency.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;OAGG;IACH,UAAU,CAAC,SAAS,EAAE,cAAc,GAAG,kBAAkB,GAAG,SAAS,CAAC;IACtE;;;;;OAKG;IACH,OAAO,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAChE,gFAAgF;IAChF,WAAW,CAAC,SAAS,EAAE,cAAc,GAAG,MAAM,CAAC;IAC/C,uEAAuE;IACvE,WAAW,CAAC,SAAS,EAAE,cAAc,GAAG,MAAM,CAAC;CAChD,CAAC;AAOF,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;;;OAIG;IACH,WAAW,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,MAAM,CAAC;CACpD,CAAC;AAEF,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,gCAAgC,GACxC,yBAAyB,CA4D3B"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Embedding } from "../memory/types";
|
|
2
2
|
import type { FetchLike } from "./types";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* OpenAI-compatible `/embeddings`
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* **Local-first** embeddings adapter. I/O lives here: it calls the local
|
|
5
|
+
* runtime's OpenAI-compatible `/embeddings` endpoint. Vectors are computed on
|
|
6
|
+
* the machine (never sent to frontier if `forceLocalOnSensitive`) and are not
|
|
7
|
+
* readable text, so they may be persisted even with `storeContent=false`.
|
|
8
8
|
*/
|
|
9
|
-
/**
|
|
9
|
+
/** Injectable embedding function: maps texts to vectors in the same order. */
|
|
10
10
|
export type Embedder = (texts: readonly string[]) => Promise<Embedding[]>;
|
|
11
11
|
export type EmbedRequest = {
|
|
12
12
|
baseURL: string;
|
|
@@ -16,14 +16,14 @@ export type EmbedRequest = {
|
|
|
16
16
|
export type EmbedDeps = {
|
|
17
17
|
fetch: FetchLike;
|
|
18
18
|
};
|
|
19
|
-
/**
|
|
19
|
+
/** Parses the OpenAI-compatible `/embeddings` response into ordered vectors. */
|
|
20
20
|
export declare function parseEmbeddingsResponse(payload: unknown): Embedding[];
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* Runs embedding against the local runtime. Returns one vector per text, in
|
|
23
|
+
* the same order. Throws if the request or response fails (unlike extraction,
|
|
24
|
+
* here a failure is relevant for recall).
|
|
25
25
|
*/
|
|
26
26
|
export declare function embedTexts(request: EmbedRequest, deps: EmbedDeps): Promise<Embedding[]>;
|
|
27
|
-
/**
|
|
27
|
+
/** Builds an `Embedder` that uses the local runtime via `embedTexts`. */
|
|
28
28
|
export declare function createLocalEmbedder(request: Omit<EmbedRequest, "texts">, deps: EmbedDeps): Embedder;
|
|
29
29
|
//# sourceMappingURL=embeddings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embeddings.d.ts","sourceRoot":"","sources":["../../src/local/embeddings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;GAKG;AAEH,
|
|
1
|
+
{"version":3,"file":"embeddings.d.ts","sourceRoot":"","sources":["../../src/local/embeddings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;GAKG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;AAE1E,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,gFAAgF;AAChF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,CAwBrE;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,SAAS,EAAE,CAAC,CAyCtB;AAED,yEAAyE;AACzE,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,EACpC,IAAI,EAAE,SAAS,GACd,QAAQ,CAEV"}
|
|
@@ -2,30 +2,33 @@ import { type ExtractionContext, type ExtractionMessage } from "../memory/extrac
|
|
|
2
2
|
import type { MemoryRecord } from "../memory/types";
|
|
3
3
|
import type { FetchLike } from "./types";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* **Local-first** memory extraction adapter. This is where the I/O lives: it
|
|
6
|
+
* calls the local OpenAI-compatible runtime (`/chat/completions`) and delegates
|
|
7
|
+
* parsing/redaction to `parseExtraction` (pure). The `router/`/`memory/` core
|
|
8
|
+
* stays deterministic.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
10
|
+
* Marginal cost ~0 and data never leaves the machine. Frontier is only an
|
|
11
|
+
* opt-in fallback (outside this adapter, respecting `forceLocalOnSensitive`).
|
|
11
12
|
*/
|
|
12
13
|
export type ExtractRequest = {
|
|
13
14
|
baseURL: string;
|
|
14
15
|
modelID: string;
|
|
15
16
|
messages: readonly ExtractionMessage[];
|
|
16
17
|
context: ExtractionContext;
|
|
17
|
-
/**
|
|
18
|
+
/** Temperature; 0 by default to maximize extractor determinism. */
|
|
18
19
|
temperature?: number;
|
|
19
20
|
};
|
|
20
21
|
export type ExtractDeps = {
|
|
21
22
|
fetch: FetchLike;
|
|
23
|
+
warn?: (message?: unknown) => void;
|
|
22
24
|
};
|
|
23
|
-
/**
|
|
25
|
+
/** Extracts the text of the first choice from an OpenAI-compatible response. */
|
|
24
26
|
export declare function readChatContent(payload: unknown): string;
|
|
25
27
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
28
|
+
* Runs extraction against the local runtime. Returns `MemoryRecord[]` already
|
|
29
|
+
* redacted per `context.storeContent`. Never throws on empty or malformed
|
|
30
|
+
* responses: in that case it warns and returns `[]` (tolerant, like the rest of
|
|
31
|
+
* the pipeline).
|
|
29
32
|
*/
|
|
30
33
|
export declare function extractMemory(request: ExtractRequest, deps: ExtractDeps): Promise<MemoryRecord[]>;
|
|
31
34
|
//# sourceMappingURL=extractClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractClient.d.ts","sourceRoot":"","sources":["../../src/local/extractClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"extractClient.d.ts","sourceRoot":"","sources":["../../src/local/extractClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAGvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;;;GAQG;AAEH,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACvC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAmBxD;AA0BD;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,WAAW,GAChB,OAAO,CAAC,YAAY,EAAE,CAAC,CAwCzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lemonade.d.ts","sourceRoot":"","sources":["../../src/local/lemonade.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,cAAc,EAGf,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,yBAAyB,iCAAiC,CAAC;AAExE,wBAAgB,qBAAqB,IAAI,cAAc,CAmBtD"}
|
package/dist/local/registry.d.ts
CHANGED
|
@@ -17,4 +17,20 @@ export declare class RuntimeRegistry {
|
|
|
17
17
|
private createProbeOptions;
|
|
18
18
|
}
|
|
19
19
|
export declare function flattenLocalModelSelections(snapshots: readonly LocalRuntimeSnapshot[]): ModelSelection[];
|
|
20
|
+
/**
|
|
21
|
+
* Returns true when at least one probed local runtime is reachable. A runtime
|
|
22
|
+
* that was configured but is not reachable (e.g. its daemon is not running)
|
|
23
|
+
* yields `reachable === false`, so this treats it as absent — the signal the
|
|
24
|
+
* orchestrator's mandatory-local gate consumes (#143). Pure over probe results;
|
|
25
|
+
* reachability I/O lives in `RuntimeRegistry.probe`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function anyRuntimeReachable(snapshots: readonly LocalRuntimeSnapshot[]): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Collects the ids of the reachable runtimes from probe results (#144). This is
|
|
30
|
+
* the per-runtime signal the orchestrator consumes to fail over between the
|
|
31
|
+
* runtimes a role lists: an unreachable runtime (its daemon is not running) is
|
|
32
|
+
* absent from the set, so the dispatcher skips it and picks the next reachable
|
|
33
|
+
* one. Pure over probe results; reachability I/O lives in `RuntimeRegistry.probe`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function reachableRuntimeIds(snapshots: readonly LocalRuntimeSnapshot[]): Set<LocalRuntimeId>;
|
|
20
36
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/local/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/local/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMtD,OAAO,KAAK,EACV,KAAK,EACL,SAAS,EACT,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC;CAC5D,CAAC;AAEF,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyC;IAClE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAY;IAClC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA+B;IAEhE,YAAY,OAAO,EAAE,sBAAsB,EAW1C;IAEK,KAAK,CACT,QAAQ,EAAE,SAAS,YAAY,EAAE,GAChC,OAAO,CAAC,oBAAoB,EAAE,CAAC,CA2BjC;IAED,OAAO,CAAC,kBAAkB;CAuB3B;AAED,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,SAAS,oBAAoB,EAAE,GACzC,cAAc,EAAE,CAWlB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,SAAS,oBAAoB,EAAE,GACzC,OAAO,CAET;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,SAAS,oBAAoB,EAAE,GACzC,GAAG,CAAC,cAAc,CAAC,CAQrB"}
|
package/dist/local/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/local/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/local/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,UAAU,GACV,eAAe,GACf,UAAU,CAAC;AAEf,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,cAAc,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,KAAK,CAAC;AAErC,MAAM,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC;AAEjC,MAAM,MAAM,sBAAsB,GAC9B,MAAM,GACN;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAErE,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,wBAAwB,GAAG;IAC3D,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,cAAc,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IACzE,KAAK,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACpE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Embedder } from "../local/embeddings";
|
|
2
2
|
import type { RankSignals } from "../memory/rank";
|
|
3
3
|
import type { MemoryIndex } from "../storage/index/memoryIndex";
|
|
4
|
-
import type { SemanticRecall } from "./server";
|
|
4
|
+
import type { GraphRecall, RelationTraversal, SemanticRecall } from "./server";
|
|
5
5
|
/**
|
|
6
6
|
* Compone un `SemanticRecall` (para el servidor MCP) a partir del índice de
|
|
7
7
|
* memoria, un `Embedder` local y la política de scope/temporal. Aísla el wiring
|
|
@@ -22,4 +22,21 @@ export type SemanticRecallDeps = {
|
|
|
22
22
|
signals?: Omit<RankSignals, "now">;
|
|
23
23
|
};
|
|
24
24
|
export declare function buildSemanticRecall(deps: SemanticRecallDeps, policy: SemanticRecallPolicy): SemanticRecall;
|
|
25
|
+
/**
|
|
26
|
+
* Composes a `RelationTraversal` (for the MCP server) over the same index and
|
|
27
|
+
* scope policy as semantic recall. The traversal is pure (`traverseRelations`);
|
|
28
|
+
* here we only inject the clock (`asOf` = "now") and the policy's
|
|
29
|
+
* `ownerKey`/`includeShared`, guaranteeing the walk never crosses owners and
|
|
30
|
+
* respects bitemporal validity.
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildRelationTraversal(deps: SemanticRecallDeps, policy: SemanticRecallPolicy): RelationTraversal;
|
|
33
|
+
/**
|
|
34
|
+
* Composes a `GraphRecall` (for the MCP server): the query-first wrapper of
|
|
35
|
+
* W5-S02 (#182). It embeds the query once, runs the unchanged vector recall to
|
|
36
|
+
* pick seed records, then walks the relation graph from each entity seed via the
|
|
37
|
+
* pure `recallGraph`. Scope (`ownerKey`/`includeShared`) and the injected clock
|
|
38
|
+
* keep the walk owner-safe and bitemporal; the `recall` payload is byte-identical
|
|
39
|
+
* to `buildSemanticRecall`, so the traversal is a strictly additive layer.
|
|
40
|
+
*/
|
|
41
|
+
export declare function buildGraphRecall(deps: SemanticRecallDeps, policy: SemanticRecallPolicy): GraphRecall;
|
|
25
42
|
//# sourceMappingURL=semanticRecall.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semanticRecall.d.ts","sourceRoot":"","sources":["../../src/mcp/semanticRecall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"semanticRecall.d.ts","sourceRoot":"","sources":["../../src/mcp/semanticRecall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/E;;;;;GAKG;AAEH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,yDAAyD;IACzD,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;CACpC,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,oBAAoB,GAC3B,cAAc,CAqBhB;AAID;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,oBAAoB,GAC3B,iBAAiB,CAWnB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,oBAAoB,GAC3B,WAAW,CAiCb"}
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GraphRecallResult, TraversalResult } from "../memory/traverse";
|
|
1
2
|
import type { MemoryKind, RecallResult } from "../memory/types";
|
|
2
3
|
import { type TeamMemory } from "./teamMemory";
|
|
3
4
|
/**
|
|
@@ -46,11 +47,37 @@ export type SemanticRecall = (input: {
|
|
|
46
47
|
kinds: MemoryKind[];
|
|
47
48
|
limit: number;
|
|
48
49
|
}) => Promise<RecallResult[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Injected relation-edge traversal (W5). Walks the relation graph from a seed
|
|
52
|
+
* entity up to `maxDepth` hops, owner-scoped and bitemporal via the wiring.
|
|
53
|
+
* Returns references only (endpoints + predicate + depth): never free text, so
|
|
54
|
+
* it cannot leak a raw prompt.
|
|
55
|
+
*/
|
|
56
|
+
export type RelationTraversal = (input: {
|
|
57
|
+
seed: string;
|
|
58
|
+
maxDepth?: number;
|
|
59
|
+
}) => Promise<TraversalResult>;
|
|
60
|
+
/**
|
|
61
|
+
* Injected query-first multi-hop recall (W5-S02, #182). Recalls seed records for
|
|
62
|
+
* `queryText` via the unchanged vector pipeline, then returns the relation
|
|
63
|
+
* sub-graph reachable from each entity seed up to `maxDepth` hops. The
|
|
64
|
+
* projection is reference-only (endpoints + predicate + depth): never free text
|
|
65
|
+
* or a raw prompt.
|
|
66
|
+
*/
|
|
67
|
+
export type GraphRecall = (input: {
|
|
68
|
+
queryText: string;
|
|
69
|
+
limit: number;
|
|
70
|
+
maxDepth?: number;
|
|
71
|
+
}) => Promise<GraphRecallResult>;
|
|
49
72
|
export type McpServerDeps = {
|
|
50
73
|
/** Lee la memoria del equipo bajo demanda (I/O inyectado). */
|
|
51
74
|
readMemory: () => Promise<TeamMemory>;
|
|
52
75
|
/** Recall semántico opt-in; si está ausente, las tools de memoria no se exponen. */
|
|
53
76
|
recallSemantic?: SemanticRecall;
|
|
77
|
+
/** Opt-in relation traversal (W5-S03, #183); advertised as recall_relations if and only if this dep is present. */
|
|
78
|
+
recallRelations?: RelationTraversal;
|
|
79
|
+
/** Opt-in query-first multi-hop recall (W5-S02, #182); exposed as recall_graph. */
|
|
80
|
+
recallGraph?: GraphRecall;
|
|
54
81
|
serverInfo?: McpServerInfo;
|
|
55
82
|
};
|
|
56
83
|
type ToolDef = {
|
|
@@ -61,7 +88,20 @@ type ToolDef = {
|
|
|
61
88
|
export declare const MCP_TOOLS: ToolDef[];
|
|
62
89
|
/** Tools de memoria semántica (M4). Solo se exponen si hay `recallSemantic`. */
|
|
63
90
|
export declare const MEMORY_TOOLS: ToolDef[];
|
|
64
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* Relation-graph tools (W5-S03, #183). Only exposed when its own dep is wired.
|
|
93
|
+
* Multi-hop, read-only, and with a **reference-only** projection (endpoints +
|
|
94
|
+
* predicate): they never return the free-text annotation or prompt text.
|
|
95
|
+
*/
|
|
96
|
+
export declare const RELATION_TOOLS: ToolDef[];
|
|
97
|
+
/**
|
|
98
|
+
* Query-first graph-recall tool (W5-S02, #182). Only exposed when its own dep is
|
|
99
|
+
* wired. Reference-only: it composes the redacted recall projection with the
|
|
100
|
+
* reference-only sub-graph projection, so no free text ever crosses MCP.
|
|
101
|
+
*/
|
|
102
|
+
export declare const GRAPH_TOOLS: ToolDef[];
|
|
103
|
+
/** Tools available per deps: each opt-in group is advertised only if its own
|
|
104
|
+
* dep is wired, so advertisement and capability cannot diverge. */
|
|
65
105
|
export declare function availableTools(deps: McpServerDeps): ToolDef[];
|
|
66
106
|
/**
|
|
67
107
|
* Procesa un mensaje JSON-RPC del cliente MCP. Devuelve la respuesta, o `null`
|
package/dist/mcp/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAE/C,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC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ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAoB5C,mEAAmE;AACnE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAyBhE"}
|
package/dist/memory/extract.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { MemoryRecord } from "./types";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
8
|
-
* local vive en `src/local/`).
|
|
4
|
+
* Pure, deterministic memory extraction. This module builds the extraction prompt
|
|
5
|
+
* and parses model JSON into `MemoryRecord[]`, applying ADR-5 redaction. It does
|
|
6
|
+
* no I/O, network, clock, or random work: callers inject `now`, `ownerKey`,
|
|
7
|
+
* `sourceHash`, and `idPrefix`.
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* canonicalName) se redacta; la trazabilidad queda en `sourceHash`.
|
|
9
|
+
* Privacy (ADR-5): with `storeContent=false` (the default), free-text values are
|
|
10
|
+
* redacted while structure is preserved; provenance remains in `sourceHash`.
|
|
13
11
|
*/
|
|
14
12
|
export declare const REDACTED: "[redacted]";
|
|
15
13
|
export type ExtractionRole = "system" | "user" | "assistant";
|
|
@@ -19,15 +17,24 @@ export type ExtractionMessage = {
|
|
|
19
17
|
};
|
|
20
18
|
export type ExtractionContext = {
|
|
21
19
|
ownerKey: string;
|
|
22
|
-
/** Epoch ms;
|
|
20
|
+
/** Epoch ms; used as `validFrom` and `createdAt` of each record. */
|
|
23
21
|
now: number;
|
|
24
|
-
/** Hash
|
|
22
|
+
/** Hash of the source messages (provenance). Never the raw prompt. */
|
|
25
23
|
sourceHash: string;
|
|
26
|
-
/**
|
|
24
|
+
/** If false (default), redacts the free-text value of each record. */
|
|
27
25
|
storeContent: boolean;
|
|
28
|
-
/**
|
|
26
|
+
/** Deterministic prefix for generated ids. */
|
|
29
27
|
idPrefix: string;
|
|
30
28
|
};
|
|
29
|
+
export type ExtractionOutcome = {
|
|
30
|
+
kind: "ok";
|
|
31
|
+
records: MemoryRecord[];
|
|
32
|
+
} | {
|
|
33
|
+
kind: "no-json";
|
|
34
|
+
} | {
|
|
35
|
+
kind: "schema-rejected";
|
|
36
|
+
issues: string[];
|
|
37
|
+
};
|
|
31
38
|
export declare const RawExtractionSchema: z.ZodObject<{
|
|
32
39
|
facts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
33
40
|
subject: z.ZodString;
|
|
@@ -48,21 +55,29 @@ export declare const RawExtractionSchema: z.ZodObject<{
|
|
|
48
55
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
56
|
confidence: z.ZodOptional<z.ZodNumber>;
|
|
50
57
|
}, z.core.$strip>>>;
|
|
58
|
+
relations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
59
|
+
from: z.ZodString;
|
|
60
|
+
to: z.ZodString;
|
|
61
|
+
predicate: z.ZodString;
|
|
62
|
+
annotation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
}, z.core.$strict>>>;
|
|
51
65
|
}, z.core.$strip>;
|
|
52
66
|
export type RawExtraction = z.infer<typeof RawExtractionSchema>;
|
|
53
|
-
/**
|
|
67
|
+
/** Builds the extraction prompt (deterministic). */
|
|
54
68
|
export declare function buildExtractionPrompt(messages: readonly ExtractionMessage[]): {
|
|
55
69
|
system: string;
|
|
56
70
|
user: string;
|
|
57
71
|
};
|
|
58
72
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
73
|
+
* Extracts the first balanced JSON object from the text (tolerates ```json
|
|
74
|
+
* fences and surrounding prose). Returns `undefined` if there is none.
|
|
61
75
|
*/
|
|
62
76
|
export declare function extractJsonObject(text: string): unknown;
|
|
63
77
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
78
|
+
* Parses raw model output into memory records, applying redaction. Invalid model
|
|
79
|
+
* output is surfaced as a discriminated outcome so callers can warn without
|
|
80
|
+
* logging raw model text or extracted memory content.
|
|
66
81
|
*/
|
|
67
|
-
export declare function parseExtraction(rawText: string, ctx: ExtractionContext):
|
|
82
|
+
export declare function parseExtraction(rawText: string, ctx: ExtractionContext): ExtractionOutcome;
|
|
68
83
|
//# sourceMappingURL=extract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/memory/extract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAgB,YAAY,
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/memory/extract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAgB,YAAY,EAAwB,MAAM,SAAS,CAAC;AAEhF;;;;;;;;GAQG;AAEH,eAAO,MAAM,QAAQ,EAAG,YAAqB,CAAC;AAE9C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,YAAY,EAAE,OAAO,CAAC;IACtB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,YAAY,EAAE,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAmClD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAiBhE,oDAAoD;AACpD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,GAAG;IAC7E,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAMA;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAqCvD;AAkGD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,iBAAiB,GACrB,iBAAiB,CA0BnB"}
|
package/dist/memory/fold.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Entity, Fact, MemoryRecord, Preference } from "./types";
|
|
1
|
+
import type { Entity, Fact, MemoryRecord, Preference, Relation } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Repliegue **puro** del log de aserciones al estado de memoria vigente. Reproduce
|
|
4
4
|
* la reconciliación (merge + supersesión no destructiva) en orden, usando el
|
|
@@ -15,10 +15,11 @@ export type MemoryState = {
|
|
|
15
15
|
facts: Fact[];
|
|
16
16
|
preferences: Preference[];
|
|
17
17
|
entities: Entity[];
|
|
18
|
+
relations: Relation[];
|
|
18
19
|
};
|
|
19
20
|
export declare function emptyState(): MemoryState;
|
|
20
21
|
/** Repliega las aserciones (en orden) al estado vigente + histórico. */
|
|
21
22
|
export declare function foldAssertions(assertions: readonly MemoryRecord[]): MemoryState;
|
|
22
|
-
/** Aplana un estado a la lista de todos sus records (facts + prefs + entities). */
|
|
23
|
+
/** Aplana un estado a la lista de todos sus records (facts + prefs + entities + relations). */
|
|
23
24
|
export declare function allRecords(state: MemoryState): MemoryRecord[];
|
|
24
25
|
//# sourceMappingURL=fold.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fold.d.ts","sourceRoot":"","sources":["../../src/memory/fold.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fold.d.ts","sourceRoot":"","sources":["../../src/memory/fold.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEhF;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC;AAEF,wBAAgB,UAAU,IAAI,WAAW,CAExC;AAyBD,wEAAwE;AACxE,wBAAgB,cAAc,CAC5B,UAAU,EAAE,SAAS,YAAY,EAAE,GAClC,WAAW,CAkCb;AAED,+FAA+F;AAC/F,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,EAAE,CAO7D"}
|
package/dist/memory/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/memory/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/memory/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../../src/memory/inject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE1D;;;;;;;;GAQG;AAEH,MAAM,MAAM,qBAAqB,GAAG;IAClC,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,qBAItC,CAAC;AAEF,uEAAuE;AACvE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../../src/memory/inject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE1D;;;;;;;;GAQG;AAEH,MAAM,MAAM,qBAAqB,GAAG;IAClC,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,qBAItC,CAAC;AAEF,uEAAuE;AACvE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAgB7D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,MAAM,GAAE,qBAAgD,GACvD,MAAM,GAAG,IAAI,CAsBf"}
|
package/dist/memory/log.d.ts
CHANGED
|
@@ -7,10 +7,21 @@ import { type MemoryRecord } from "./types";
|
|
|
7
7
|
*/
|
|
8
8
|
/** Serializa una aserción a su línea JSONL canónica. */
|
|
9
9
|
export declare function serializeAssertion(record: MemoryRecord): string;
|
|
10
|
+
/** Rejection detail for a single line in a memory log. */
|
|
11
|
+
export type MemoryLogLineRejection = {
|
|
12
|
+
readonly lineNumber: number;
|
|
13
|
+
readonly detail: string;
|
|
14
|
+
};
|
|
15
|
+
/** Result of parsing a memory log JSONL, including rejection counts. */
|
|
16
|
+
export type ParseMemoryLogResult = {
|
|
17
|
+
readonly records: MemoryRecord[];
|
|
18
|
+
readonly rejectedLines: number;
|
|
19
|
+
readonly rejections: readonly MemoryLogLineRejection[];
|
|
20
|
+
};
|
|
10
21
|
/**
|
|
11
|
-
* Parsea un log JSONL de aserciones.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
22
|
+
* Parsea un log JSONL de aserciones. Surfaces rejected line counts so callers
|
|
23
|
+
* can warn or fail instead of silently losing data. Blank lines are skipped
|
|
24
|
+
* without counting as rejections.
|
|
14
25
|
*/
|
|
15
|
-
export declare function parseMemoryLog(text: string):
|
|
26
|
+
export declare function parseMemoryLog(text: string): ParseMemoryLogResult;
|
|
16
27
|
//# sourceMappingURL=log.d.ts.map
|
package/dist/memory/log.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/memory/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,SAAS,CAAC;AAEhE;;;;;GAKG;AAEH,wDAAwD;AACxD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAE/D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/memory/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,SAAS,CAAC;AAEhE;;;;;GAKG;AAEH,wDAAwD;AACxD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAE/D;AAED,0DAA0D;AAC1D,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,wEAAwE;AACxE,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC;IACjC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,SAAS,sBAAsB,EAAE,CAAC;CACxD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CA6BjE"}
|
package/dist/memory/merge.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Entity, Fact, Preference } from "./types";
|
|
1
|
+
import type { Entity, Fact, Preference, Relation } from "./types";
|
|
2
2
|
/** Slot de un hecho: `{subject, predicate, ownerKey}`. Solo un valor activo por slot. */
|
|
3
3
|
export declare function factSlotKey(fact: Fact): string;
|
|
4
4
|
/** Triple exacto: slot + `object`. Idempotente (MERGE key dueño-scoped). */
|
|
@@ -9,6 +9,15 @@ export declare function preferenceSlotKey(preference: Preference): string;
|
|
|
9
9
|
export declare function preferenceValueKey(preference: Preference): string;
|
|
10
10
|
/** Slot de una entidad: `{canonicalName, type, ownerKey}`. */
|
|
11
11
|
export declare function entitySlotKey(entity: Entity): string;
|
|
12
|
+
/**
|
|
13
|
+
* Slot of a relation: `{from, predicate, ownerKey}`. Since a typed edge is the
|
|
14
|
+
* analogue of a fact (subject-predicate-object), it shares its slot semantics:
|
|
15
|
+
* a single active `to` target per slot. A new `to` in the same slot supersedes
|
|
16
|
+
* the previous one (non-destructive).
|
|
17
|
+
*/
|
|
18
|
+
export declare function relationSlotKey(relation: Relation): string;
|
|
19
|
+
/** Exact edge: slot + `to`. Idempotent (owner-scoped MERGE key). */
|
|
20
|
+
export declare function relationValueKey(relation: Relation): string;
|
|
12
21
|
export type MergeResult<T> = {
|
|
13
22
|
/** Estado resultante (incluye históricos invalidados). */
|
|
14
23
|
records: T[];
|
|
@@ -35,4 +44,12 @@ export declare function applyPreference(state: readonly Preference[], incoming:
|
|
|
35
44
|
* no supersede (las entidades no se contradicen, se enriquecen).
|
|
36
45
|
*/
|
|
37
46
|
export declare function applyEntity(state: readonly Entity[], incoming: Entity, now: number): MergeResult<Entity>;
|
|
47
|
+
/**
|
|
48
|
+
* Applies a typed edge with the same non-destructive supersession semantics as
|
|
49
|
+
* a fact: the slot `{from, predicate, ownerKey}` admits a single active `to`.
|
|
50
|
+
* Re-asserting the same edge merges the validity window and raises confidence;
|
|
51
|
+
* a different `to` in the same slot marks the previous one
|
|
52
|
+
* `invalidatedAt`/`supersededBy`; inactive history is preserved.
|
|
53
|
+
*/
|
|
54
|
+
export declare function applyRelation(state: readonly Relation[], incoming: Relation, now: number): MergeResult<Relation>;
|
|
38
55
|
//# sourceMappingURL=merge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/memory/merge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,IA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