@pellux/goodvibes-sdk 1.0.0 → 1.2.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/dist/contracts/artifacts/operator-contract.json +2878 -264
- package/dist/events/communication.d.ts +1 -1
- package/dist/platform/agents/orchestrator-runner.d.ts +5 -5
- package/dist/platform/agents/orchestrator-runner.js +6 -6
- package/dist/platform/agents/orchestrator.d.ts +4 -4
- package/dist/platform/agents/orchestrator.js +2 -2
- package/dist/platform/agents/wrfc-controller.d.ts +1 -1
- package/dist/platform/agents/wrfc-controller.js +3 -3
- package/dist/platform/calendar/index.d.ts +2 -2
- package/dist/platform/calendar/index.js +3 -3
- package/dist/platform/calendar/oauth-providers.d.ts +1 -1
- package/dist/platform/calendar/oauth-providers.js +1 -1
- package/dist/platform/calendar/oauth-types.d.ts +1 -1
- package/dist/platform/calendar/oauth-types.js +1 -1
- package/dist/platform/companion/companion-chat-branching.d.ts +66 -0
- package/dist/platform/companion/companion-chat-branching.d.ts.map +1 -0
- package/dist/platform/companion/companion-chat-branching.js +142 -0
- package/dist/platform/companion/companion-chat-broker-bridge.d.ts +1 -1
- package/dist/platform/companion/companion-chat-broker-bridge.d.ts.map +1 -1
- package/dist/platform/companion/companion-chat-broker-sync.d.ts +2 -2
- package/dist/platform/companion/companion-chat-broker-sync.d.ts.map +1 -1
- package/dist/platform/companion/companion-chat-broker-sync.js +1 -1
- package/dist/platform/companion/companion-chat-manager.d.ts +26 -5
- package/dist/platform/companion/companion-chat-manager.d.ts.map +1 -1
- package/dist/platform/companion/companion-chat-manager.js +67 -81
- package/dist/platform/companion/companion-chat-routes.d.ts.map +1 -1
- package/dist/platform/companion/companion-chat-routes.js +77 -1
- package/dist/platform/companion/companion-chat-turn-execution.d.ts +61 -0
- package/dist/platform/companion/companion-chat-turn-execution.d.ts.map +1 -0
- package/dist/platform/companion/companion-chat-turn-execution.js +107 -0
- package/dist/platform/companion/companion-chat-types.d.ts +67 -0
- package/dist/platform/companion/companion-chat-types.d.ts.map +1 -1
- package/dist/platform/config/credential-status.d.ts +1 -1
- package/dist/platform/config/credential-status.js +1 -1
- package/dist/platform/config/index.d.ts +1 -1
- package/dist/platform/config/index.js +1 -1
- package/dist/platform/config/manager.d.ts +1 -1
- package/dist/platform/config/manager.js +1 -1
- package/dist/platform/config/migrations.d.ts +2 -2
- package/dist/platform/config/migrations.js +2 -2
- package/dist/platform/config/schema-domain-runtime.d.ts +8 -0
- package/dist/platform/config/schema-domain-runtime.d.ts.map +1 -1
- package/dist/platform/config/schema-domain-runtime.js +32 -0
- package/dist/platform/config/schema-types.d.ts +10 -2
- package/dist/platform/config/schema-types.d.ts.map +1 -1
- package/dist/platform/control-plane/gateway-scope-enforcement.js +2 -2
- package/dist/platform/control-plane/index.d.ts +2 -0
- package/dist/platform/control-plane/index.d.ts.map +1 -1
- package/dist/platform/control-plane/index.js +5 -1
- package/dist/platform/control-plane/invoke-input-validation.d.ts +1 -1
- package/dist/platform/control-plane/invoke-input-validation.js +1 -1
- package/dist/platform/control-plane/method-catalog-calendar.d.ts +2 -2
- package/dist/platform/control-plane/method-catalog-calendar.js +2 -2
- package/dist/platform/control-plane/method-catalog-channels.js +3 -3
- package/dist/platform/control-plane/method-catalog-control-automation.js +4 -4
- package/dist/platform/control-plane/method-catalog-control-companion.d.ts +1 -1
- package/dist/platform/control-plane/method-catalog-control-companion.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-control-companion.js +43 -0
- package/dist/platform/control-plane/method-catalog-control-core.js +3 -3
- package/dist/platform/control-plane/method-catalog-email.d.ts +1 -1
- package/dist/platform/control-plane/method-catalog-email.js +1 -1
- package/dist/platform/control-plane/method-catalog-fleet.d.ts +1 -1
- package/dist/platform/control-plane/method-catalog-push.d.ts +30 -0
- package/dist/platform/control-plane/method-catalog-push.d.ts.map +1 -0
- package/dist/platform/control-plane/method-catalog-push.js +80 -0
- package/dist/platform/control-plane/method-catalog-route-reconcile.d.ts +1 -1
- package/dist/platform/control-plane/method-catalog-runtime.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-runtime.js +177 -1
- package/dist/platform/control-plane/method-catalog.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog.js +2 -0
- package/dist/platform/control-plane/operator-contract-schemas-fleet.js +1 -1
- package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts +15 -0
- package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts.map +1 -1
- package/dist/platform/control-plane/operator-contract-schemas-runtime.js +81 -0
- package/dist/platform/control-plane/routes/checkpoints.d.ts +1 -1
- package/dist/platform/control-plane/routes/fleet.d.ts +2 -2
- package/dist/platform/control-plane/routes/fleet.js +1 -1
- package/dist/platform/control-plane/routes/gateway-verb-error.d.ts +1 -1
- package/dist/platform/control-plane/routes/gateway-verb-error.js +1 -1
- package/dist/platform/control-plane/routes/index.js +1 -1
- package/dist/platform/control-plane/routes/invocation-params.d.ts +1 -1
- package/dist/platform/control-plane/routes/push.d.ts +26 -0
- package/dist/platform/control-plane/routes/push.d.ts.map +1 -0
- package/dist/platform/control-plane/routes/push.js +104 -0
- package/dist/platform/control-plane/routes/register-gateway-verb-groups.d.ts +31 -0
- package/dist/platform/control-plane/routes/register-gateway-verb-groups.d.ts.map +1 -0
- package/dist/platform/control-plane/routes/register-gateway-verb-groups.js +16 -0
- package/dist/platform/control-plane/routes/register-w3-s2.d.ts +2 -2
- package/dist/platform/control-plane/routes/session-search.d.ts +4 -4
- package/dist/platform/control-plane/session-broker.d.ts +1 -1
- package/dist/platform/control-plane/session-broker.js +1 -1
- package/dist/platform/control-plane/session-store-importer.d.ts +1 -1
- package/dist/platform/control-plane/session-store-importer.js +1 -1
- package/dist/platform/control-plane/session-types.d.ts +1 -1
- package/dist/platform/core/orchestrator-runtime.d.ts +4 -4
- package/dist/platform/core/orchestrator-tool-runtime.d.ts +1 -1
- package/dist/platform/core/orchestrator-turn-loop.d.ts +6 -6
- package/dist/platform/core/orchestrator-turn-loop.d.ts.map +1 -1
- package/dist/platform/core/orchestrator-turn-loop.js +23 -22
- package/dist/platform/core/orchestrator.d.ts +10 -10
- package/dist/platform/core/orchestrator.d.ts.map +1 -1
- package/dist/platform/core/orchestrator.js +8 -8
- package/dist/platform/daemon/boot.d.ts +6 -0
- package/dist/platform/daemon/boot.d.ts.map +1 -1
- package/dist/platform/daemon/boot.js +1 -0
- package/dist/platform/daemon/control-plane.js +2 -2
- package/dist/platform/daemon/facade.d.ts +4 -7
- package/dist/platform/daemon/facade.d.ts.map +1 -1
- package/dist/platform/daemon/facade.js +5 -7
- package/dist/platform/daemon/http/router-session-broker-adapter.d.ts +1 -1
- package/dist/platform/daemon/http/router.d.ts +1 -0
- package/dist/platform/daemon/http/router.d.ts.map +1 -1
- package/dist/platform/daemon/http/router.js +36 -19
- package/dist/platform/daemon/http/runtime-route-types.d.ts +1 -1
- package/dist/platform/daemon/http/runtime-route-types.d.ts.map +1 -1
- package/dist/platform/daemon/http/webui-serving.d.ts +68 -0
- package/dist/platform/daemon/http/webui-serving.d.ts.map +1 -0
- package/dist/platform/daemon/http/webui-serving.js +230 -0
- package/dist/platform/knowledge/knowledge-api.d.ts +1 -1
- package/dist/platform/orchestration/budget.d.ts +2 -2
- package/dist/platform/orchestration/cancellation.d.ts +2 -2
- package/dist/platform/orchestration/controller-compat.d.ts +2 -3
- package/dist/platform/orchestration/controller-compat.d.ts.map +1 -1
- package/dist/platform/orchestration/dirty-guard.js +1 -1
- package/dist/platform/orchestration/engine.d.ts.map +1 -1
- package/dist/platform/orchestration/engine.js +3 -4
- package/dist/platform/orchestration/persistence.js +2 -2
- package/dist/platform/orchestration/phase-runner.d.ts +4 -4
- package/dist/platform/orchestration/scheduler.d.ts +1 -1
- package/dist/platform/orchestration/types.d.ts +3 -3
- package/dist/platform/presentation/glyphs.d.ts +1 -1
- package/dist/platform/presentation/glyphs.js +1 -1
- package/dist/platform/presentation/index.d.ts +3 -3
- package/dist/platform/presentation/index.js +3 -3
- package/dist/platform/presentation/thinking-phrases.d.ts +1 -1
- package/dist/platform/presentation/thinking-phrases.js +1 -1
- package/dist/platform/presentation/waiting-wording.d.ts +1 -1
- package/dist/platform/presentation/waiting-wording.js +1 -1
- package/dist/platform/push/delivery.d.ts +48 -0
- package/dist/platform/push/delivery.d.ts.map +1 -0
- package/dist/platform/push/delivery.js +117 -0
- package/dist/platform/push/encryption.d.ts +41 -0
- package/dist/platform/push/encryption.d.ts.map +1 -0
- package/dist/platform/push/encryption.js +82 -0
- package/dist/platform/push/index.d.ts +17 -0
- package/dist/platform/push/index.d.ts.map +1 -0
- package/dist/platform/push/index.js +10 -0
- package/dist/platform/push/service.d.ts +75 -0
- package/dist/platform/push/service.d.ts.map +1 -0
- package/dist/platform/push/service.js +95 -0
- package/dist/platform/push/subscription-store.d.ts +50 -0
- package/dist/platform/push/subscription-store.d.ts.map +1 -0
- package/dist/platform/push/subscription-store.js +123 -0
- package/dist/platform/push/types.d.ts +68 -0
- package/dist/platform/push/types.d.ts.map +1 -0
- package/dist/platform/push/types.js +13 -0
- package/dist/platform/push/vapid.d.ts +54 -0
- package/dist/platform/push/vapid.d.ts.map +1 -0
- package/dist/platform/push/vapid.js +113 -0
- package/dist/platform/runtime/feature-flags/flags.js +3 -3
- package/dist/platform/runtime/fleet/adapters/agent.d.ts +2 -2
- package/dist/platform/runtime/fleet/adapters/agent.d.ts.map +1 -1
- package/dist/platform/runtime/fleet/adapters/agent.js +4 -4
- package/dist/platform/runtime/fleet/adapters/automation.d.ts +1 -1
- package/dist/platform/runtime/fleet/adapters/automation.js +1 -1
- package/dist/platform/runtime/fleet/adapters/code-index.d.ts +1 -1
- package/dist/platform/runtime/fleet/adapters/code-index.js +1 -1
- package/dist/platform/runtime/fleet/adapters/orchestration.js +1 -1
- package/dist/platform/runtime/fleet/adapters/schedule.d.ts +4 -4
- package/dist/platform/runtime/fleet/adapters/schedule.js +4 -4
- package/dist/platform/runtime/fleet/adapters/trigger.d.ts +3 -4
- package/dist/platform/runtime/fleet/adapters/trigger.d.ts.map +1 -1
- package/dist/platform/runtime/fleet/adapters/trigger.js +3 -4
- package/dist/platform/runtime/fleet/adapters/wrfc.js +1 -1
- package/dist/platform/runtime/fleet/registry.d.ts +7 -7
- package/dist/platform/runtime/fleet/registry.d.ts.map +1 -1
- package/dist/platform/runtime/fleet/registry.js +3 -3
- package/dist/platform/runtime/fleet/types.d.ts +9 -9
- package/dist/platform/runtime/fleet/types.d.ts.map +1 -1
- package/dist/platform/runtime/memory-spine/client.d.ts +240 -0
- package/dist/platform/runtime/memory-spine/client.d.ts.map +1 -0
- package/dist/platform/runtime/memory-spine/client.js +221 -0
- package/dist/platform/runtime/memory-spine/index.d.ts +17 -0
- package/dist/platform/runtime/memory-spine/index.d.ts.map +1 -0
- package/dist/platform/runtime/memory-spine/index.js +16 -0
- package/dist/platform/runtime/memory-spine/recall-snapshot.d.ts +74 -0
- package/dist/platform/runtime/memory-spine/recall-snapshot.d.ts.map +1 -0
- package/dist/platform/runtime/memory-spine/recall-snapshot.js +74 -0
- package/dist/platform/runtime/operator-client.d.ts +1 -1
- package/dist/platform/runtime/services.d.ts +6 -6
- package/dist/platform/runtime/services.d.ts.map +1 -1
- package/dist/platform/runtime/services.js +9 -9
- package/dist/platform/runtime/session-spine/union-cache.d.ts +1 -1
- package/dist/platform/runtime/session-spine/union-cache.js +1 -1
- package/dist/platform/state/canonical-memory.d.ts +7 -7
- package/dist/platform/state/canonical-memory.js +8 -8
- package/dist/platform/state/code-index-chunking.js +1 -1
- package/dist/platform/state/code-index-db.d.ts +1 -1
- package/dist/platform/state/code-index-store.js +1 -1
- package/dist/platform/state/index.d.ts +2 -2
- package/dist/platform/state/index.d.ts.map +1 -1
- package/dist/platform/state/index.js +1 -1
- package/dist/platform/state/memory-recall-contract.d.ts +59 -4
- package/dist/platform/state/memory-recall-contract.d.ts.map +1 -1
- package/dist/platform/state/memory-recall-contract.js +79 -3
- package/dist/platform/state/memory-registry.d.ts +8 -0
- package/dist/platform/state/memory-registry.d.ts.map +1 -1
- package/dist/platform/state/memory-registry.js +10 -0
- package/dist/platform/state/memory-vector-store.js +1 -1
- package/dist/platform/state/sqlite-vec-loader.d.ts +1 -1
- package/dist/platform/state/sqlite-vec-loader.js +1 -1
- package/dist/platform/state/vibe-projection.d.ts +3 -3
- package/dist/platform/state/vibe-projection.js +3 -3
- package/dist/platform/tools/agent/manager.d.ts +10 -10
- package/dist/platform/tools/agent/manager.js +7 -7
- package/dist/platform/tools/exec/runtime.js +5 -5
- package/dist/platform/tools/exec/schema.d.ts +1 -1
- package/dist/platform/tools/exec/schema.d.ts.map +1 -1
- package/dist/platform/tools/fetch/runtime.d.ts +1 -1
- package/dist/platform/tools/registry.d.ts +1 -1
- package/dist/platform/tools/registry.js +1 -1
- package/dist/platform/types/tools.d.ts +1 -1
- package/dist/platform/utils/request-body.d.ts.map +1 -1
- package/dist/platform/utils/request-body.js +50 -5
- package/dist/platform/version.js +1 -1
- package/dist/platform/voice/index.d.ts +2 -0
- package/dist/platform/voice/index.d.ts.map +1 -1
- package/dist/platform/voice/index.js +3 -0
- package/dist/platform/voice/spoken-turn/audio-sink.d.ts +111 -0
- package/dist/platform/voice/spoken-turn/audio-sink.d.ts.map +1 -0
- package/dist/platform/voice/spoken-turn/audio-sink.js +1 -0
- package/dist/platform/voice/spoken-turn/controller.d.ts +117 -0
- package/dist/platform/voice/spoken-turn/controller.d.ts.map +1 -0
- package/dist/platform/voice/spoken-turn/controller.js +448 -0
- package/dist/platform/voice/spoken-turn/index.d.ts +16 -0
- package/dist/platform/voice/spoken-turn/index.d.ts.map +1 -0
- package/dist/platform/voice/spoken-turn/index.js +12 -0
- package/dist/platform/voice/spoken-turn/text-chunker.d.ts +33 -0
- package/dist/platform/voice/spoken-turn/text-chunker.d.ts.map +1 -0
- package/dist/platform/voice/spoken-turn/text-chunker.js +97 -0
- package/package.json +13 -9
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* recall-snapshot.ts — the sync-recall seam for the memory spine.
|
|
3
|
+
*
|
|
4
|
+
* THE PROBLEM. Per-turn memory recall wants to inject the recall-eligible records
|
|
5
|
+
* into the system prompt. But the prompt builder is SYNCHRONOUS
|
|
6
|
+
* (`Orchestrator.getSystemPrompt()` returns a string, not a promise), while a wire
|
|
7
|
+
* client's memory reads are ASYNCHRONOUS (a fetch to the adopted daemon). A sync
|
|
8
|
+
* function cannot await a wire read, so it cannot pull fresh memory over the wire
|
|
9
|
+
* inline.
|
|
10
|
+
*
|
|
11
|
+
* THE DESIGN (cached snapshot, freshness-stamped, honest staleness note). Rather
|
|
12
|
+
* than make the whole prompt path async (a large, cross-consumer refactor) or open
|
|
13
|
+
* the store file from a wire client (which would break the single-writer invariant),
|
|
14
|
+
* the spine maintains a CACHED recall snapshot:
|
|
15
|
+
*
|
|
16
|
+
* 1. an ASYNC pre-turn hook calls `MemorySpineClient.refreshRecallSnapshot()` —
|
|
17
|
+
* this awaits the wire (or local) honest recall search and stamps the result
|
|
18
|
+
* with a capture time and the access mode it came from;
|
|
19
|
+
* 2. the SYNC prompt builder calls `MemorySpineClient.recallSnapshot()` — this
|
|
20
|
+
* returns the cached records immediately, with a freshly-computed age, a
|
|
21
|
+
* `stale` flag, and a human-readable `note`.
|
|
22
|
+
*
|
|
23
|
+
* HONESTY. The snapshot never lies about its own freshness. If it has never been
|
|
24
|
+
* refreshed, it returns an EMPTY snapshot whose note says exactly that — never a
|
|
25
|
+
* silent empty that a reader would misread as "nothing was ever stored". If the last
|
|
26
|
+
* refresh is older than the staleness window, `stale` is true and the note says so,
|
|
27
|
+
* so an injector can choose to note the staleness in the prompt rather than present
|
|
28
|
+
* possibly-old memory as live. The `mode` records WHERE the snapshot was captured
|
|
29
|
+
* (local host store vs the adopted daemon over the wire), so the note never implies
|
|
30
|
+
* a wire read happened when it did not.
|
|
31
|
+
*/
|
|
32
|
+
/** Default freshness window: a snapshot older than this reports `stale: true`. */
|
|
33
|
+
export const DEFAULT_RECALL_SNAPSHOT_STALE_AFTER_MS = 30_000;
|
|
34
|
+
const EMPTY_SEARCH_RECORDS = Object.freeze([]);
|
|
35
|
+
/** The snapshot returned before any refresh has happened — empty, and it says so. */
|
|
36
|
+
export function emptyRecallSnapshot(mode) {
|
|
37
|
+
return {
|
|
38
|
+
records: EMPTY_SEARCH_RECORDS,
|
|
39
|
+
search: null,
|
|
40
|
+
capturedAt: null,
|
|
41
|
+
ageMs: null,
|
|
42
|
+
stale: true,
|
|
43
|
+
mode,
|
|
44
|
+
note: 'memory recall snapshot not yet captured — no memory injected this turn. '
|
|
45
|
+
+ 'Call refreshRecallSnapshot() in an async pre-turn hook before the synchronous prompt build.',
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Build a snapshot from an honest search envelope captured at `capturedAt`, with age
|
|
50
|
+
* and staleness computed against `now`. The `note` states the source, the age, and
|
|
51
|
+
* — when stale — that the records may be out of date.
|
|
52
|
+
*/
|
|
53
|
+
export function buildRecallSnapshot(search, mode, capturedAt, staleAfterMs, now = Date.now()) {
|
|
54
|
+
const ageMs = Math.max(0, now - capturedAt);
|
|
55
|
+
const stale = ageMs > staleAfterMs;
|
|
56
|
+
const source = mode === 'client' ? 'over the wire from the adopted daemon' : 'from the local store';
|
|
57
|
+
const freshness = stale
|
|
58
|
+
? `STALE — captured ${ageMs}ms ago (older than the ${staleAfterMs}ms freshness window); a refresh is due`
|
|
59
|
+
: `captured ${ageMs}ms ago`;
|
|
60
|
+
const degraded = search.indexUnavailableReason
|
|
61
|
+
? ` Recall degraded to a literal scan: ${search.indexUnavailableReason}.`
|
|
62
|
+
: '';
|
|
63
|
+
const caveat = search.caveat ? ` ${search.caveat}.` : '';
|
|
64
|
+
return {
|
|
65
|
+
records: search.records,
|
|
66
|
+
search,
|
|
67
|
+
capturedAt,
|
|
68
|
+
ageMs,
|
|
69
|
+
stale,
|
|
70
|
+
mode,
|
|
71
|
+
note: `memory recall snapshot ${source}, ${freshness}; ${search.records.length} record(s) recall-eligible.`
|
|
72
|
+
+ degraded + caveat,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -33,7 +33,7 @@ export interface OperatorSessionsClient {
|
|
|
33
33
|
/** Detach a surface's participant/route from a session without closing it
|
|
34
34
|
* (detach != close != kill). Idempotent; see sessions.detach. */
|
|
35
35
|
detach(sessionId: string, surfaceId: string): Promise<SharedSessionRecord | null>;
|
|
36
|
-
/** Permanently remove a session (
|
|
36
|
+
/** Permanently remove a session (delete != close). Requires the
|
|
37
37
|
* session already closed — see sessions.delete. */
|
|
38
38
|
delete(sessionId: string): Promise<'deleted' | 'not-found' | 'active'>;
|
|
39
39
|
bindAgent(sessionId: string, agentId: string): Promise<SharedSessionRecord | null>;
|
|
@@ -81,8 +81,8 @@ export interface RuntimeServicesOptions {
|
|
|
81
81
|
readonly panelManager?: PanelManagerLike | undefined;
|
|
82
82
|
readonly keybindingsManager?: KeybindingsManagerLike | undefined;
|
|
83
83
|
/**
|
|
84
|
-
* Opt-in: kick off the repo source-tree code index's initial build
|
|
85
|
-
*
|
|
84
|
+
* Opt-in: kick off the repo source-tree code index's initial build
|
|
85
|
+
* (Stage A) right after construction. Fire-and-forget — never
|
|
86
86
|
* awaited, never blocks. Defaults off so building RuntimeServices never runs
|
|
87
87
|
* an unrequested source-tree walk. Real interactive entry points pass `true`.
|
|
88
88
|
*/
|
|
@@ -119,7 +119,7 @@ export interface RuntimeServices {
|
|
|
119
119
|
readonly memoryStore: MemoryStore;
|
|
120
120
|
readonly memoryRegistry: MemoryRegistry;
|
|
121
121
|
/**
|
|
122
|
-
* Repo source-tree code index (
|
|
122
|
+
* Repo source-tree code index (Stage A). Constructed and
|
|
123
123
|
* schema-initialized eagerly like memoryStore, but the actual walk/chunk/
|
|
124
124
|
* embed build is NOT auto-triggered here — call `.scheduleBuild()` from an
|
|
125
125
|
* explicit call site (a `/codebase reindex` command, a session-start hook,
|
|
@@ -130,7 +130,7 @@ export interface RuntimeServices {
|
|
|
130
130
|
* surprising for embedders that never asked for it.
|
|
131
131
|
*/
|
|
132
132
|
readonly codeIndexStore: CodeIndexStore;
|
|
133
|
-
/**
|
|
133
|
+
/** Stage B tool-site incremental reindex scheduler (bound to codeIndexStore). */
|
|
134
134
|
readonly codeIndexReindexScheduler: CodeIndexReindexScheduler;
|
|
135
135
|
readonly serviceRegistry: ServiceRegistry;
|
|
136
136
|
readonly secretsManager: SecretsManager;
|
|
@@ -185,7 +185,7 @@ export interface RuntimeServices {
|
|
|
185
185
|
readonly agentOrchestrator: AgentOrchestrator;
|
|
186
186
|
readonly wrfcController: WrfcController;
|
|
187
187
|
/**
|
|
188
|
-
* Orchestration engine
|
|
188
|
+
* Orchestration engine — ships ALONGSIDE wrfcController,
|
|
189
189
|
* stage 1 of the 3-stage migration (see platform/orchestration/
|
|
190
190
|
* controller-compat.ts). WrfcController is unchanged; this is a new,
|
|
191
191
|
* opt-in surface for callers that want the pipeline/capacity-matching
|
|
@@ -196,7 +196,7 @@ export interface RuntimeServices {
|
|
|
196
196
|
readonly orchestrationEngine: OrchestrationEngine;
|
|
197
197
|
readonly processManager: ProcessManager;
|
|
198
198
|
/**
|
|
199
|
-
* Live process registry
|
|
199
|
+
* Live process registry: queryable + subscribable fleet aggregation
|
|
200
200
|
* over agentManager/wrfcController/processManager/watcherRegistry/workflow.
|
|
201
201
|
* LIFECYCLE NOTE: RuntimeServices has no shutdown/dispose seam today, so
|
|
202
202
|
* nothing calls processRegistry.dispose() here — the registry's coalesced
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../src/platform/runtime/services.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE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B,EAAE,kBAAkB,CAAC;IAChD,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAClD,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC;;;;;;;;;OASG;IACH,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,0BAA0B,EAAE,0BAA0B,CAAC;IAChE,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,CAAC;IACtD;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD;AAED,wBAAgB,gCAAgC,CAC9C,YAAY,EAAE,IAAI,CAAC,kBAAkB,EAAE,WAAW,GAAG,WAAW,CAAC,EACjE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,GACvD,MAAM,IAAI,CAOZ;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAkkBtF"}
|
|
@@ -8,7 +8,7 @@ import { SubscriptionManager } from '../config/subscriptions.js';
|
|
|
8
8
|
import { AutomationDeliveryManager, AutomationManager, AutomationRouteStore } from '../automation/index.js';
|
|
9
9
|
import { ChannelPluginRegistry, ChannelPolicyManager, RouteBindingManager, SurfaceRegistry } from '../channels/index.js';
|
|
10
10
|
import { ChannelDeliveryRouter } from '../channels/delivery-router.js';
|
|
11
|
-
import { ApprovalBroker, GatewayMethodCatalog, SharedSessionBroker,
|
|
11
|
+
import { ApprovalBroker, GatewayMethodCatalog, SharedSessionBroker, registerGatewayVerbGroups } from '../control-plane/index.js';
|
|
12
12
|
import { buildSharedSessionAgentSpawnRoutingInput } from '../control-plane/session-intents.js';
|
|
13
13
|
import { WatcherRegistry } from '../watchers/index.js';
|
|
14
14
|
import { ArtifactStore } from '../artifacts/index.js';
|
|
@@ -176,7 +176,7 @@ export function createRuntimeServices(options) {
|
|
|
176
176
|
executor: agentOrchestrator,
|
|
177
177
|
configManager,
|
|
178
178
|
});
|
|
179
|
-
//
|
|
179
|
+
// Conversation-snapshot sink bridge: AgentOrchestrator is constructed before
|
|
180
180
|
// AgentManager exists, so the conversation-snapshot sink is wired here via
|
|
181
181
|
// setConversationSink rather than as a constructor dependency (same
|
|
182
182
|
// ordering constraint as setRuntimeBus above).
|
|
@@ -184,7 +184,7 @@ export function createRuntimeServices(options) {
|
|
|
184
184
|
register: (agentId, source) => agentManager.registerConversationSource(agentId, source),
|
|
185
185
|
release: (agentId) => agentManager.releaseConversationSource(agentId),
|
|
186
186
|
});
|
|
187
|
-
//
|
|
187
|
+
// Cooperative cancellation bridge: same ordering constraint
|
|
188
188
|
// and setter pattern as setConversationSink above — AgentOrchestrator is
|
|
189
189
|
// constructed before AgentManager exists.
|
|
190
190
|
agentOrchestrator.setCancellationSource({
|
|
@@ -230,7 +230,7 @@ export function createRuntimeServices(options) {
|
|
|
230
230
|
embeddingRegistry: memoryEmbeddingRegistry,
|
|
231
231
|
});
|
|
232
232
|
const memoryRegistry = new MemoryRegistry(memoryStore);
|
|
233
|
-
// Repo source-tree code index (
|
|
233
|
+
// Repo source-tree code index (Stage A) — shares
|
|
234
234
|
// memoryEmbeddingRegistry so code + memory embeddings use one provider and
|
|
235
235
|
// one dimensionality. Schema init only; build is not auto-triggered here
|
|
236
236
|
// (see the RuntimeServices.codeIndexStore doc comment).
|
|
@@ -240,7 +240,7 @@ export function createRuntimeServices(options) {
|
|
|
240
240
|
if (options.autoStartCodeIndex) {
|
|
241
241
|
codeIndexStore.scheduleBuild();
|
|
242
242
|
}
|
|
243
|
-
//
|
|
243
|
+
// Stage B: tool-site incremental reindex. Gated on the SDK's autoStartCodeIndex opt-in
|
|
244
244
|
// (this library's storage.codeIndexEnabled analog) AND the built-state check inside the
|
|
245
245
|
// scheduler — an unbuilt index is a no-op either way.
|
|
246
246
|
const codeInjectionSettingEnabled = () => options.autoStartCodeIndex === true;
|
|
@@ -491,7 +491,7 @@ export function createRuntimeServices(options) {
|
|
|
491
491
|
const pricing = providerRegistry.getCostFromCatalog(model);
|
|
492
492
|
return (usage.inputTokens * pricing.input + usage.outputTokens * pricing.output) / 1_000_000;
|
|
493
493
|
};
|
|
494
|
-
// Orchestration engine
|
|
494
|
+
// Orchestration engine — ships alongside wrfcController, untouched by this change. See the RuntimeServices interface comment.
|
|
495
495
|
const orchestrationEngine = createOrchestrationEngine({
|
|
496
496
|
agentManager,
|
|
497
497
|
configManager,
|
|
@@ -499,7 +499,7 @@ export function createRuntimeServices(options) {
|
|
|
499
499
|
projectRoot: workingDirectory,
|
|
500
500
|
priceUsage,
|
|
501
501
|
});
|
|
502
|
-
// Live process registry
|
|
502
|
+
// Live process registry — narrow structural deps only, constructed
|
|
503
503
|
// after every source manager exists. See the RuntimeServices interface
|
|
504
504
|
// comment for the dispose story (no RuntimeServices-wide shutdown seam yet).
|
|
505
505
|
const processRegistry = createProcessRegistry({
|
|
@@ -519,7 +519,7 @@ export function createRuntimeServices(options) {
|
|
|
519
519
|
priceUsage,
|
|
520
520
|
codeIndexService: codeIndexStore,
|
|
521
521
|
});
|
|
522
|
-
|
|
522
|
+
registerGatewayVerbGroups(gatewayMethods, { processRegistry, workspaceCheckpointManager, sessionBroker, secretsManager, approvalBroker, shellPaths }); // see routes/register-gateway-verb-groups.ts
|
|
523
523
|
return {
|
|
524
524
|
workingDirectory,
|
|
525
525
|
homeDirectory,
|
|
@@ -614,7 +614,7 @@ export function createRuntimeServices(options) {
|
|
|
614
614
|
const newMemoryDbPath = join(newWorkingDir, '.goodvibes', surfaceRoot, 'memory.sqlite');
|
|
615
615
|
await memoryStore.reroot(newMemoryDbPath);
|
|
616
616
|
// Step 1b: Re-root the code index alongside memory — otherwise it keeps
|
|
617
|
-
// pointing at the old tree after a workspace swap
|
|
617
|
+
// pointing at the old tree after a workspace swap.
|
|
618
618
|
const newCodeIndexDbPath = join(newWorkingDir, '.goodvibes', surfaceRoot, 'code-index.sqlite');
|
|
619
619
|
await codeIndexStore.reroot(newWorkingDir, newCodeIndexDbPath);
|
|
620
620
|
// Step 2: Re-root ProjectIndex — flush current path, reset, load from new directory.
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* from the render/keystroke hot path — reads are served from the cache
|
|
32
32
|
* synchronously, so the facade adds zero awaits to any interactive path.
|
|
33
33
|
*
|
|
34
|
-
* MOVE NOTE (One-Platform
|
|
34
|
+
* MOVE NOTE (One-Platform): this generalizes cleanly (SDK-clean deps,
|
|
35
35
|
* already parameterized via injected local + wireReader, generation-guarded probes)
|
|
36
36
|
* and serves the union goal, so it now lives in the SDK alongside the spine client.
|
|
37
37
|
* That "generalizes cleanly" is ARCHITECTURAL until a second real consumer imports
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* from the render/keystroke hot path — reads are served from the cache
|
|
32
32
|
* synchronously, so the facade adds zero awaits to any interactive path.
|
|
33
33
|
*
|
|
34
|
-
* MOVE NOTE (One-Platform
|
|
34
|
+
* MOVE NOTE (One-Platform): this generalizes cleanly (SDK-clean deps,
|
|
35
35
|
* already parameterized via injected local + wireReader, generation-guarded probes)
|
|
36
36
|
* and serves the union goal, so it now lives in the SDK alongside the spine client.
|
|
37
37
|
* That "generalizes cleanly" is ARCHITECTURAL until a second real consumer imports
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* canonical-memory.ts — the ONE cross-surface memory identity (
|
|
2
|
+
* canonical-memory.ts — the ONE cross-surface memory identity (see CHANGELOG 1.0.0).
|
|
3
3
|
*
|
|
4
|
-
* BACKGROUND
|
|
4
|
+
* BACKGROUND. The MemoryStore engine (memory-store.ts) is a good
|
|
5
5
|
* single engine, but it is instantiated as disjoint SQLite files per surface:
|
|
6
6
|
* - the SDK daemon runtime → <workingDir>/.goodvibes/<surface>/memory.sqlite
|
|
7
7
|
* - the agent → <userRoot>/goodvibes-agent/memory.sqlite (global)
|
|
8
8
|
* - the TUI → <workingDir>/.goodvibes/tui/memory.sqlite
|
|
9
|
-
* A fact learned in one surface is invisible to the others.
|
|
9
|
+
* A fact learned in one surface is invisible to the others. This module collapses those to
|
|
10
10
|
* ONE canonical store identity.
|
|
11
11
|
*
|
|
12
|
-
* CANONICAL PLACEMENT (ruled in the
|
|
12
|
+
* CANONICAL PLACEMENT (ruled in the memory-unification decision record). The SQLiteStore is
|
|
13
13
|
* backed by sql.js: every open loads the whole database into memory and every
|
|
14
14
|
* save() rewrites the entire file via writeFileSync. There is no row locking and
|
|
15
15
|
* no WAL, so two live processes writing the SAME file would clobber each other on
|
|
16
16
|
* save — a whole-file lost-update that would DELETE memory, the exact honesty
|
|
17
|
-
* violation
|
|
17
|
+
* violation this module must not introduce. Therefore:
|
|
18
18
|
*
|
|
19
19
|
* TARGET (end-state): the daemon owns the single canonical store and surfaces
|
|
20
20
|
* read/write add/search/searchSemantic THROUGH it (one process = one
|
|
21
|
-
* writer). Deferred out of
|
|
21
|
+
* writer). Deferred out of this step because it adds new wire methods that
|
|
22
22
|
* serialize the land and gate the release train, and cannot be proven
|
|
23
23
|
* under the no-real-daemons test rule.
|
|
24
24
|
*
|
|
25
|
-
*
|
|
25
|
+
* THIS STEP (what this module delivers): one canonical PATH resolver so every
|
|
26
26
|
* surface names the same store identity, plus a no-loss FOLD/RECONCILE
|
|
27
27
|
* primitive built on the existing exportBundle/importBundle seam
|
|
28
28
|
* (memory-sync.ts prior art). Access is sequential/owned, never a naive
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* canonical-memory.ts — the ONE cross-surface memory identity (
|
|
2
|
+
* canonical-memory.ts — the ONE cross-surface memory identity (see CHANGELOG 1.0.0).
|
|
3
3
|
*
|
|
4
|
-
* BACKGROUND
|
|
4
|
+
* BACKGROUND. The MemoryStore engine (memory-store.ts) is a good
|
|
5
5
|
* single engine, but it is instantiated as disjoint SQLite files per surface:
|
|
6
6
|
* - the SDK daemon runtime → <workingDir>/.goodvibes/<surface>/memory.sqlite
|
|
7
7
|
* - the agent → <userRoot>/goodvibes-agent/memory.sqlite (global)
|
|
8
8
|
* - the TUI → <workingDir>/.goodvibes/tui/memory.sqlite
|
|
9
|
-
* A fact learned in one surface is invisible to the others.
|
|
9
|
+
* A fact learned in one surface is invisible to the others. This module collapses those to
|
|
10
10
|
* ONE canonical store identity.
|
|
11
11
|
*
|
|
12
|
-
* CANONICAL PLACEMENT (ruled in the
|
|
12
|
+
* CANONICAL PLACEMENT (ruled in the memory-unification decision record). The SQLiteStore is
|
|
13
13
|
* backed by sql.js: every open loads the whole database into memory and every
|
|
14
14
|
* save() rewrites the entire file via writeFileSync. There is no row locking and
|
|
15
15
|
* no WAL, so two live processes writing the SAME file would clobber each other on
|
|
16
16
|
* save — a whole-file lost-update that would DELETE memory, the exact honesty
|
|
17
|
-
* violation
|
|
17
|
+
* violation this module must not introduce. Therefore:
|
|
18
18
|
*
|
|
19
19
|
* TARGET (end-state): the daemon owns the single canonical store and surfaces
|
|
20
20
|
* read/write add/search/searchSemantic THROUGH it (one process = one
|
|
21
|
-
* writer). Deferred out of
|
|
21
|
+
* writer). Deferred out of this step because it adds new wire methods that
|
|
22
22
|
* serialize the land and gate the release train, and cannot be proven
|
|
23
23
|
* under the no-real-daemons test rule.
|
|
24
24
|
*
|
|
25
|
-
*
|
|
25
|
+
* THIS STEP (what this module delivers): one canonical PATH resolver so every
|
|
26
26
|
* surface names the same store identity, plus a no-loss FOLD/RECONCILE
|
|
27
27
|
* primitive built on the existing exportBundle/importBundle seam
|
|
28
28
|
* (memory-sync.ts prior art). Access is sequential/owned, never a naive
|
|
@@ -136,7 +136,7 @@ export async function foldMemoryStores(canonical, sources, options) {
|
|
|
136
136
|
/** Render a human-readable summary of a fold report (for surfacing at boot). */
|
|
137
137
|
export function formatMemoryFoldReport(report) {
|
|
138
138
|
const lines = [
|
|
139
|
-
'Memory unification
|
|
139
|
+
'Memory unification — fold into canonical store',
|
|
140
140
|
` canonical ${report.canonicalPath}`,
|
|
141
141
|
` imported ${report.totalImported} already-present ${report.totalSkipped} links ${report.totalLinks}`,
|
|
142
142
|
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
2
|
/**
|
|
3
3
|
* Code-index chunking — pure content → chunk transformation for CodeIndexStore
|
|
4
|
-
* (
|
|
4
|
+
* (Stage A, see CHANGELOG 0.38.0; extracted from code-index-store.ts to keep that file
|
|
5
5
|
* within the 800-line source discipline).
|
|
6
6
|
*
|
|
7
7
|
* Everything here is side-effect-free with respect to the store: given file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
2
|
/**
|
|
3
3
|
* Code-index SQL layer — schema plus every direct table operation for
|
|
4
|
-
* CodeIndexStore's bun:sqlite database (
|
|
4
|
+
* CodeIndexStore's bun:sqlite database (Stage A, see CHANGELOG 0.38.0; extracted from
|
|
5
5
|
* code-index-store.ts to keep that file within the 800-line source discipline).
|
|
6
6
|
*
|
|
7
7
|
* Three tables:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
2
|
/**
|
|
3
3
|
* CodeIndexStore — an incremental, tree-sitter-chunked, embedding-backed index
|
|
4
|
-
* of a repo's source tree (
|
|
4
|
+
* of a repo's source tree (Stage A; see CHANGELOG 0.38.0).
|
|
5
5
|
*
|
|
6
6
|
* Deliberately MIRRORS MemoryStore + SqliteVecMemoryIndex (state/memory-store.ts,
|
|
7
7
|
* state/memory-vector-store.ts) rather than reusing them: those classes are
|
|
@@ -21,8 +21,8 @@ export type { MemoryBundle, MemoryClass, MemoryRecord, MemoryLink, MemoryAddOpti
|
|
|
21
21
|
export { buildIncidentMemoryAddOptions, buildMcpSecurityMemoryAddOptions, buildPluginSecurityMemoryAddOptions, buildPolicyPreflightMemoryAddOptions, } from './memory-ingest.js';
|
|
22
22
|
export { resolveCanonicalMemoryDbPath, foldMemoryStores, formatMemoryFoldReport, } from './canonical-memory.js';
|
|
23
23
|
export type { LegacyMemorySource, MemoryFoldSourceReport, MemoryFoldReport, FoldMemoryStoresOptions, } from './canonical-memory.js';
|
|
24
|
-
export { MIN_PROMPT_MEMORY_CONFIDENCE, describeMemoryPromptEligibility, isPromptActiveMemory, describeMemoryIndexUnavailable, describeMemoryIndexCaveat, } from './memory-recall-contract.js';
|
|
25
|
-
export type { MemoryPromptEligibility } from './memory-recall-contract.js';
|
|
24
|
+
export { MIN_PROMPT_MEMORY_CONFIDENCE, describeMemoryPromptEligibility, isPromptActiveMemory, describeMemoryIndexUnavailable, describeMemoryIndexCaveat, runHonestMemorySearch, } from './memory-recall-contract.js';
|
|
25
|
+
export type { MemoryPromptEligibility, HonestSearchStore, HonestMemorySearchOptions, HonestMemorySearchResult, } from './memory-recall-contract.js';
|
|
26
26
|
export { VIBE_PERSONA_TAG, VIBE_PROJECTION_HEADING, VIBE_PROJECTION_CAVEAT, selectVibeRecords, renderVibeProjection, vibeBodyToConstraintOptions, } from './vibe-projection.js';
|
|
27
27
|
export type { VibeProjectionOptions, VibeImportOptions } from './vibe-projection.js';
|
|
28
28
|
export { MEMORY_VECTOR_DIMS, embedMemoryText, resolveMemoryVectorDbPath, SqliteVecMemoryIndex, } from './memory-vector-store.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platform/state/index.ts"],"names":[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,eAAe,EACf,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EACL,6BAA6B,EAC7B,gCAAgC,EAChC,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qCAAqC,EAAE,MAAM,4BAA4B,CAAC;AACnF,YAAY,EACV,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,EAC5B,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAC/H,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EACV,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,wBAAwB,EACxB,sBAAsB,EACtB,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC"}
|
|
@@ -13,7 +13,7 @@ export { MemoryStore } from './memory-store.js';
|
|
|
13
13
|
export { MemoryRegistry } from './memory-registry.js';
|
|
14
14
|
export { buildIncidentMemoryAddOptions, buildMcpSecurityMemoryAddOptions, buildPluginSecurityMemoryAddOptions, buildPolicyPreflightMemoryAddOptions, } from './memory-ingest.js';
|
|
15
15
|
export { resolveCanonicalMemoryDbPath, foldMemoryStores, formatMemoryFoldReport, } from './canonical-memory.js';
|
|
16
|
-
export { MIN_PROMPT_MEMORY_CONFIDENCE, describeMemoryPromptEligibility, isPromptActiveMemory, describeMemoryIndexUnavailable, describeMemoryIndexCaveat, } from './memory-recall-contract.js';
|
|
16
|
+
export { MIN_PROMPT_MEMORY_CONFIDENCE, describeMemoryPromptEligibility, isPromptActiveMemory, describeMemoryIndexUnavailable, describeMemoryIndexCaveat, runHonestMemorySearch, } from './memory-recall-contract.js';
|
|
17
17
|
export { VIBE_PERSONA_TAG, VIBE_PROJECTION_HEADING, VIBE_PROJECTION_CAVEAT, selectVibeRecords, renderVibeProjection, vibeBodyToConstraintOptions, } from './vibe-projection.js';
|
|
18
18
|
export { MEMORY_VECTOR_DIMS, embedMemoryText, resolveMemoryVectorDbPath, SqliteVecMemoryIndex, } from './memory-vector-store.js';
|
|
19
19
|
export { DEFAULT_MEMORY_EMBEDDING_DIMS, HASHED_MEMORY_EMBEDDING_PROVIDER, MemoryEmbeddingProviderRegistry, normalizeMemoryEmbeddingVector, } from './memory-embeddings.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* memory-recall-contract.ts — the CROSS-SURFACE recall-honesty contract (
|
|
2
|
+
* memory-recall-contract.ts — the CROSS-SURFACE recall-honesty contract (see CHANGELOG 1.0.0).
|
|
3
3
|
*
|
|
4
|
-
* PROVENANCE. This is the agent's
|
|
4
|
+
* PROVENANCE. This is the agent's memory-honesty discipline, promoted
|
|
5
5
|
* verbatim from a single surface (the agent's memory-prompt.ts) into the SDK so it
|
|
6
6
|
* is ONE shared contract, not a discipline re-derived (and re-weakened) per surface.
|
|
7
|
-
* Under
|
|
7
|
+
* Under memory unification the store is unified and cross-surface, which multiplies the cost of a
|
|
8
8
|
* dishonest recall — so this discipline becomes MORE load-bearing, not less. A
|
|
9
9
|
* unified store must not be able to lie more loudly than the siloed one did.
|
|
10
10
|
*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* reads as "nothing was ever stored." 'no match' and 'index unavailable' are
|
|
24
24
|
* distinct and both said out loud.
|
|
25
25
|
*/
|
|
26
|
-
import type { MemoryRecord } from './memory-store.js';
|
|
26
|
+
import type { MemoryRecord, MemorySearchFilter, MemorySemanticSearchResult } from './memory-store.js';
|
|
27
27
|
import type { MemoryVectorStats } from './memory-vector-store.js';
|
|
28
28
|
/**
|
|
29
29
|
* Recall-prompt confidence floor. Tied to the store's own baseline: MemoryStore.add
|
|
@@ -60,4 +60,59 @@ export declare function describeMemoryIndexUnavailable(stats: MemoryVectorStats)
|
|
|
60
60
|
* presenting it as equivalent. Returns null when a real provider is configured.
|
|
61
61
|
*/
|
|
62
62
|
export declare function describeMemoryIndexCaveat(stats: MemoryVectorStats): string | null;
|
|
63
|
+
/**
|
|
64
|
+
* The minimal read surface a honest search needs. MemoryStore (and MemoryRegistry)
|
|
65
|
+
* satisfy this structurally — the function stays decoupled from either concrete
|
|
66
|
+
* class so it can run over any store that exposes the three read paths.
|
|
67
|
+
*/
|
|
68
|
+
export interface HonestSearchStore {
|
|
69
|
+
search(filter: MemorySearchFilter): MemoryRecord[];
|
|
70
|
+
searchSemantic(filter: MemorySearchFilter): MemorySemanticSearchResult[];
|
|
71
|
+
vectorStats(): MemoryVectorStats;
|
|
72
|
+
}
|
|
73
|
+
export interface HonestMemorySearchOptions {
|
|
74
|
+
/**
|
|
75
|
+
* Apply the recall-INJECTION contract to the result set: exclude flagged
|
|
76
|
+
* (stale/contradicted) records outright and drop records below the confidence
|
|
77
|
+
* floor, counting each exclusion honestly. Off by default — a review/browse
|
|
78
|
+
* caller wants to SEE flagged and low-confidence records; only a prompt-recall
|
|
79
|
+
* caller filters them out.
|
|
80
|
+
*/
|
|
81
|
+
readonly recall?: boolean | undefined;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The honest search envelope. `records` is what a caller should use; the rest is
|
|
85
|
+
* the receipt: which path actually ran, and — when a degraded path was taken —
|
|
86
|
+
* WHY, out loud. A wire client and a local surface serialize the SAME envelope, so
|
|
87
|
+
* the honesty contract cannot be re-weakened per surface.
|
|
88
|
+
*/
|
|
89
|
+
export interface HonestMemorySearchResult {
|
|
90
|
+
readonly records: readonly MemoryRecord[];
|
|
91
|
+
/** The path that actually ran. `'literal'` even when semantic was requested but the index could not be consulted. */
|
|
92
|
+
readonly mode: 'literal' | 'semantic';
|
|
93
|
+
readonly requestedSemantic: boolean;
|
|
94
|
+
/** Non-null ONLY when semantic was requested and the index could not be consulted, forcing the literal fallback. The stated reason — never a silent empty. */
|
|
95
|
+
readonly indexUnavailableReason: string | null;
|
|
96
|
+
/** Soft caveat when the semantic path ran on the hashed-only fallback provider. */
|
|
97
|
+
readonly caveat: string | null;
|
|
98
|
+
/** Whether the recall-injection contract filtered the set (options.recall). */
|
|
99
|
+
readonly recallFiltered: boolean;
|
|
100
|
+
readonly excludedFlaggedCount: number;
|
|
101
|
+
readonly excludedBelowFloorCount: number;
|
|
102
|
+
/** Result count BEFORE any recall-injection filtering — so a caller can tell "index empty" from "everything filtered out". */
|
|
103
|
+
readonly totalBeforeRecallFilter: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Run a search that HONORS the recall-honesty contract end to end:
|
|
107
|
+
* - semantic requested + index consultable → semantic ranking (+ soft caveat when
|
|
108
|
+
* on the hashed fallback provider);
|
|
109
|
+
* - semantic requested + index NOT consultable → literal scan WITH the stated
|
|
110
|
+
* `indexUnavailableReason`, never a silent empty that reads as "nothing stored";
|
|
111
|
+
* - `recall: true` → flagged records excluded outright and sub-floor records
|
|
112
|
+
* dropped, each exclusion counted rather than silently vanished.
|
|
113
|
+
*
|
|
114
|
+
* This is the ONE composition every surface (daemon route, wire client, offline
|
|
115
|
+
* local store) calls, so the contract is applied identically everywhere.
|
|
116
|
+
*/
|
|
117
|
+
export declare function runHonestMemorySearch(store: HonestSearchStore, filter?: MemorySearchFilter, options?: HonestMemorySearchOptions): HonestMemorySearchResult;
|
|
63
118
|
//# sourceMappingURL=memory-recall-contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-recall-contract.d.ts","sourceRoot":"","sources":["../../../src/platform/state/memory-recall-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"memory-recall-contract.d.ts","sourceRoot":"","sources":["../../../src/platform/state/memory-recall-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACtG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAE/C,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,sHAAsH;IACtH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAOD;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,YAAY,GAAG,uBAAuB,CAkB7F;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAKtF;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAKjF;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,EAAE,CAAC;IACnD,cAAc,CAAC,MAAM,EAAE,kBAAkB,GAAG,0BAA0B,EAAE,CAAC;IACzE,WAAW,IAAI,iBAAiB,CAAC;CAClC;AAED,MAAM,WAAW,yBAAyB;IACxC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACvC;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,qHAAqH;IACrH,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAAC;IACtC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,8JAA8J;IAC9J,QAAQ,CAAC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,+EAA+E;IAC/E,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,8HAA8H;IAC9H,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,EACxB,MAAM,GAAE,kBAAuB,EAC/B,OAAO,GAAE,yBAA8B,GACtC,wBAAwB,CA+D1B"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* memory-recall-contract.ts — the CROSS-SURFACE recall-honesty contract (
|
|
2
|
+
* memory-recall-contract.ts — the CROSS-SURFACE recall-honesty contract (see CHANGELOG 1.0.0).
|
|
3
3
|
*
|
|
4
|
-
* PROVENANCE. This is the agent's
|
|
4
|
+
* PROVENANCE. This is the agent's memory-honesty discipline, promoted
|
|
5
5
|
* verbatim from a single surface (the agent's memory-prompt.ts) into the SDK so it
|
|
6
6
|
* is ONE shared contract, not a discipline re-derived (and re-weakened) per surface.
|
|
7
|
-
* Under
|
|
7
|
+
* Under memory unification the store is unified and cross-surface, which multiplies the cost of a
|
|
8
8
|
* dishonest recall — so this discipline becomes MORE load-bearing, not less. A
|
|
9
9
|
* unified store must not be able to lie more loudly than the siloed one did.
|
|
10
10
|
*
|
|
@@ -92,3 +92,79 @@ export function describeMemoryIndexCaveat(stats) {
|
|
|
92
92
|
}
|
|
93
93
|
return null;
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Run a search that HONORS the recall-honesty contract end to end:
|
|
97
|
+
* - semantic requested + index consultable → semantic ranking (+ soft caveat when
|
|
98
|
+
* on the hashed fallback provider);
|
|
99
|
+
* - semantic requested + index NOT consultable → literal scan WITH the stated
|
|
100
|
+
* `indexUnavailableReason`, never a silent empty that reads as "nothing stored";
|
|
101
|
+
* - `recall: true` → flagged records excluded outright and sub-floor records
|
|
102
|
+
* dropped, each exclusion counted rather than silently vanished.
|
|
103
|
+
*
|
|
104
|
+
* This is the ONE composition every surface (daemon route, wire client, offline
|
|
105
|
+
* local store) calls, so the contract is applied identically everywhere.
|
|
106
|
+
*/
|
|
107
|
+
export function runHonestMemorySearch(store, filter = {}, options = {}) {
|
|
108
|
+
const requestedSemantic = filter.semantic === true;
|
|
109
|
+
let mode = 'literal';
|
|
110
|
+
let indexUnavailableReason = null;
|
|
111
|
+
let caveat = null;
|
|
112
|
+
let baseRecords;
|
|
113
|
+
if (requestedSemantic) {
|
|
114
|
+
const stats = store.vectorStats();
|
|
115
|
+
indexUnavailableReason = describeMemoryIndexUnavailable(stats);
|
|
116
|
+
if (indexUnavailableReason !== null) {
|
|
117
|
+
// Honest degrade: the index cannot be consulted, so fall back to a literal
|
|
118
|
+
// scan and SAY SO via indexUnavailableReason.
|
|
119
|
+
baseRecords = store.search({ ...filter, semantic: false });
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
mode = 'semantic';
|
|
123
|
+
caveat = describeMemoryIndexCaveat(stats);
|
|
124
|
+
baseRecords = store.searchSemantic(filter).map((entry) => entry.record);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
baseRecords = store.search(filter);
|
|
129
|
+
}
|
|
130
|
+
const totalBeforeRecallFilter = baseRecords.length;
|
|
131
|
+
if (!options.recall) {
|
|
132
|
+
return {
|
|
133
|
+
records: baseRecords,
|
|
134
|
+
mode,
|
|
135
|
+
requestedSemantic,
|
|
136
|
+
indexUnavailableReason,
|
|
137
|
+
caveat,
|
|
138
|
+
recallFiltered: false,
|
|
139
|
+
excludedFlaggedCount: 0,
|
|
140
|
+
excludedBelowFloorCount: 0,
|
|
141
|
+
totalBeforeRecallFilter,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
const kept = [];
|
|
145
|
+
let excludedFlaggedCount = 0;
|
|
146
|
+
let excludedBelowFloorCount = 0;
|
|
147
|
+
for (const record of baseRecords) {
|
|
148
|
+
if (isPromptActiveMemory(record)) {
|
|
149
|
+
kept.push(record);
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if (record.reviewState === 'stale' || record.reviewState === 'contradicted') {
|
|
153
|
+
excludedFlaggedCount += 1;
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
excludedBelowFloorCount += 1;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
records: kept,
|
|
161
|
+
mode,
|
|
162
|
+
requestedSemantic,
|
|
163
|
+
indexUnavailableReason,
|
|
164
|
+
caveat,
|
|
165
|
+
recallFiltered: true,
|
|
166
|
+
excludedFlaggedCount,
|
|
167
|
+
excludedBelowFloorCount,
|
|
168
|
+
totalBeforeRecallFilter,
|
|
169
|
+
};
|
|
170
|
+
}
|