@jungjaehoon/mama-core 1.6.0 → 1.8.1
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/db/migrations/037-create-context-packets.sql +32 -0
- package/db/migrations/038-create-vnext-operator-contracts.sql +57 -0
- package/db/migrations/039-add-connector-event-operator-ingest-seq.sql +96 -0
- package/db/migrations/040-create-operator-memory-commit-intents.sql +19 -0
- package/db/migrations/041-enforce-operator-memory-commit-claim-invariant.sql +74 -0
- package/db/migrations/042-embedding-prefix-scheme.sql +46 -0
- package/dist/cases/wiki-page-index.js +6 -2
- package/dist/context-compile/boundary-defaults.d.ts +12 -0
- package/dist/context-compile/boundary-defaults.js +105 -0
- package/dist/context-compile/compiler-policy.d.ts +39 -0
- package/dist/context-compile/compiler-policy.js +147 -0
- package/dist/context-compile/compiler.d.ts +18 -0
- package/dist/context-compile/compiler.js +401 -0
- package/dist/context-compile/index.d.ts +9 -0
- package/dist/context-compile/index.js +25 -0
- package/dist/context-compile/packet-store.d.ts +9 -0
- package/dist/context-compile/packet-store.js +255 -0
- package/dist/context-compile/ref.d.ts +7 -0
- package/dist/context-compile/ref.js +102 -0
- package/dist/context-compile/source-readers.d.ts +69 -0
- package/dist/context-compile/source-readers.js +707 -0
- package/dist/context-compile/types.d.ts +138 -0
- package/dist/context-compile/types.js +11 -0
- package/dist/context-compile/visibility.d.ts +21 -0
- package/dist/context-compile/visibility.js +200 -0
- package/dist/db-adapter/node-sqlite-adapter.d.ts +17 -1
- package/dist/db-adapter/node-sqlite-adapter.js +399 -6
- package/dist/db-manager.d.ts +9 -10
- package/dist/db-manager.js +59 -4
- package/dist/edges/ref-validation.js +55 -16
- package/dist/edges/types.d.ts +2 -0
- package/dist/embedding-client.d.ts +3 -1
- package/dist/embedding-client.js +3 -2
- package/dist/embedding-server/index.d.ts +2 -0
- package/dist/embedding-server/index.js +10 -2
- package/dist/embeddings.d.ts +8 -3
- package/dist/embeddings.js +48 -15
- package/dist/entities/store.d.ts +4 -1
- package/dist/entities/store.js +206 -78
- package/dist/entities/types.d.ts +5 -1
- package/dist/entities/types.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +8 -4
- package/dist/mama-api.js +1 -1
- package/dist/memory/api.d.ts +6 -1
- package/dist/memory/api.js +223 -29
- package/dist/memory/provenance.d.ts +1 -0
- package/dist/memory/provenance.js +2 -0
- package/dist/memory/types.d.ts +1 -0
- package/dist/memory-inject.js +1 -1
- package/dist/provenance/source-ref.d.ts +29 -0
- package/dist/provenance/source-ref.js +204 -0
- package/package.json +4 -2
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { MemoryScopeRef } from '../memory/types.js';
|
|
2
|
+
export declare const CONTEXT_REF_KINDS: readonly ["memory", "raw", "entity", "case"];
|
|
3
|
+
export type ContextRefKind = (typeof CONTEXT_REF_KINDS)[number];
|
|
4
|
+
export declare const UNSUPPORTED_CONTEXT_REF_KINDS: readonly ["decision", "wiki_page", "context_packet", "report"];
|
|
5
|
+
export type UnsupportedContextRefKind = (typeof UNSUPPORTED_CONTEXT_REF_KINDS)[number];
|
|
6
|
+
export type ContextRef = {
|
|
7
|
+
kind: 'memory';
|
|
8
|
+
id: string;
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'raw';
|
|
11
|
+
raw_id: string;
|
|
12
|
+
connector: string;
|
|
13
|
+
source_id?: string;
|
|
14
|
+
channel_id?: string | null;
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'entity';
|
|
17
|
+
id: string;
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'case';
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
export interface ContextRange {
|
|
23
|
+
start_ms?: number;
|
|
24
|
+
end_ms?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ContextProjectRef {
|
|
27
|
+
kind: 'project';
|
|
28
|
+
id: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ContextCompileInput {
|
|
31
|
+
task: string;
|
|
32
|
+
scopes?: MemoryScopeRef[];
|
|
33
|
+
seed_refs?: ContextRef[];
|
|
34
|
+
connectors?: string[];
|
|
35
|
+
project_refs?: ContextProjectRef[];
|
|
36
|
+
tenant_id?: string | null;
|
|
37
|
+
range?: ContextRange;
|
|
38
|
+
as_of?: string | number | null;
|
|
39
|
+
limit?: number;
|
|
40
|
+
max_tool_calls?: number;
|
|
41
|
+
max_ms?: number;
|
|
42
|
+
max_tokens?: number;
|
|
43
|
+
strictness?: 'recall' | 'balanced' | 'strict' | 'low' | 'medium' | 'high';
|
|
44
|
+
}
|
|
45
|
+
export interface ContextBoundary {
|
|
46
|
+
scopes?: MemoryScopeRef[];
|
|
47
|
+
connectors?: string[];
|
|
48
|
+
project_refs?: ContextProjectRef[];
|
|
49
|
+
tenant_id?: string | null;
|
|
50
|
+
as_of?: string | number | null;
|
|
51
|
+
range?: ContextRange;
|
|
52
|
+
}
|
|
53
|
+
export interface CanonicalContextScopes {
|
|
54
|
+
scopes: MemoryScopeRef[];
|
|
55
|
+
scopeJson: string;
|
|
56
|
+
scopeHash: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ContextVisibility {
|
|
59
|
+
scopes: MemoryScopeRef[];
|
|
60
|
+
scope_json: string;
|
|
61
|
+
scope_hash: string;
|
|
62
|
+
connectors: string[];
|
|
63
|
+
project_refs: ContextProjectRef[];
|
|
64
|
+
tenant_id: string | null;
|
|
65
|
+
as_of: string | number | null;
|
|
66
|
+
range: ContextRange | null;
|
|
67
|
+
}
|
|
68
|
+
export interface ContextEvidence {
|
|
69
|
+
ref: ContextRef;
|
|
70
|
+
title?: string;
|
|
71
|
+
excerpt?: string;
|
|
72
|
+
score?: number;
|
|
73
|
+
reasons?: string[];
|
|
74
|
+
retrieval_diagnostics?: unknown;
|
|
75
|
+
}
|
|
76
|
+
export interface ContextPacket {
|
|
77
|
+
packet_id: string;
|
|
78
|
+
mode: 'general';
|
|
79
|
+
task: string;
|
|
80
|
+
scopes: MemoryScopeRef[];
|
|
81
|
+
scope_hash: string;
|
|
82
|
+
generated_at: string;
|
|
83
|
+
range: ContextRange | null;
|
|
84
|
+
as_of: string | number | null;
|
|
85
|
+
compiler_version: string;
|
|
86
|
+
source_refs: ContextRef[];
|
|
87
|
+
selected_evidence: ContextEvidence[];
|
|
88
|
+
evidence_clusters: unknown[];
|
|
89
|
+
related_decisions: unknown[];
|
|
90
|
+
rejected_refs: ContextRef[];
|
|
91
|
+
rejected_refs_truncated: boolean;
|
|
92
|
+
rejected_summary: string[];
|
|
93
|
+
missing_context: string[];
|
|
94
|
+
caveats: string[];
|
|
95
|
+
expansion_trace: unknown[];
|
|
96
|
+
retrieval_diagnostics: unknown;
|
|
97
|
+
budget: {
|
|
98
|
+
max_tool_calls?: number;
|
|
99
|
+
used_tool_calls: number;
|
|
100
|
+
max_ms?: number;
|
|
101
|
+
elapsed_ms: number;
|
|
102
|
+
max_tokens?: number;
|
|
103
|
+
estimated_tokens: number;
|
|
104
|
+
budget_exhausted: boolean;
|
|
105
|
+
};
|
|
106
|
+
budget_manifest: {
|
|
107
|
+
budget_exhausted: boolean;
|
|
108
|
+
skipped_operators: string[];
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export interface ContextPacketRecord {
|
|
112
|
+
packet_id: string;
|
|
113
|
+
task: string;
|
|
114
|
+
packet_json: string;
|
|
115
|
+
packet: ContextPacket;
|
|
116
|
+
scope_json: string;
|
|
117
|
+
scopes: MemoryScopeRef[];
|
|
118
|
+
scope_hash: string;
|
|
119
|
+
envelope_hash: string;
|
|
120
|
+
model_run_id: string;
|
|
121
|
+
agent_id: string;
|
|
122
|
+
input_snapshot_ref: string;
|
|
123
|
+
source_refs_json: string;
|
|
124
|
+
source_refs: ContextRef[];
|
|
125
|
+
tenant_id: string;
|
|
126
|
+
project_id: string;
|
|
127
|
+
memory_scope_kind: MemoryScopeRef['kind'];
|
|
128
|
+
memory_scope_id: string;
|
|
129
|
+
created_at: number;
|
|
130
|
+
}
|
|
131
|
+
export interface TrustedContextPacketLookupInput {
|
|
132
|
+
packetId: string;
|
|
133
|
+
envelopeHash: string;
|
|
134
|
+
modelRunId?: string;
|
|
135
|
+
callerModelRunId?: string;
|
|
136
|
+
includeFailed?: boolean;
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNSUPPORTED_CONTEXT_REF_KINDS = exports.CONTEXT_REF_KINDS = void 0;
|
|
4
|
+
exports.CONTEXT_REF_KINDS = ['memory', 'raw', 'entity', 'case'];
|
|
5
|
+
exports.UNSUPPORTED_CONTEXT_REF_KINDS = [
|
|
6
|
+
'decision',
|
|
7
|
+
'wiki_page',
|
|
8
|
+
'context_packet',
|
|
9
|
+
'report',
|
|
10
|
+
];
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type MemoryScopeRef } from '../memory/types.js';
|
|
2
|
+
import type { ContextBoundary, ContextProjectRef, ContextRef } from './types.js';
|
|
3
|
+
type BoundaryCheckInput = {
|
|
4
|
+
boundary: ContextBoundary;
|
|
5
|
+
requestedScopes?: readonly MemoryScopeRef[];
|
|
6
|
+
requestedConnectors?: readonly string[];
|
|
7
|
+
requestedProjectRefs?: readonly ContextProjectRef[];
|
|
8
|
+
requestedTenantId?: string | null;
|
|
9
|
+
seedRefs?: readonly unknown[];
|
|
10
|
+
};
|
|
11
|
+
export declare function canonicalizeContextScopes(scopes: readonly MemoryScopeRef[] | undefined): {
|
|
12
|
+
scopes: MemoryScopeRef[];
|
|
13
|
+
scopeJson: string;
|
|
14
|
+
scopeHash: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function derivePrimaryContextScope(scopes: readonly MemoryScopeRef[]): MemoryScopeRef;
|
|
17
|
+
export declare function assertContextBoundaryAllowsInput(input: BoundaryCheckInput): void;
|
|
18
|
+
export declare function sanitizeContextPacketForVisibility<T>(packet: T): T;
|
|
19
|
+
export declare function normalizeSeedRefs(seedRefs: readonly unknown[] | undefined): ContextRef[];
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=visibility.d.ts.map
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.canonicalizeContextScopes = canonicalizeContextScopes;
|
|
4
|
+
exports.derivePrimaryContextScope = derivePrimaryContextScope;
|
|
5
|
+
exports.assertContextBoundaryAllowsInput = assertContextBoundaryAllowsInput;
|
|
6
|
+
exports.sanitizeContextPacketForVisibility = sanitizeContextPacketForVisibility;
|
|
7
|
+
exports.normalizeSeedRefs = normalizeSeedRefs;
|
|
8
|
+
const node_crypto_1 = require("node:crypto");
|
|
9
|
+
const types_js_1 = require("../memory/types.js");
|
|
10
|
+
const ref_js_1 = require("./ref.js");
|
|
11
|
+
const SCOPE_ORDER = {
|
|
12
|
+
project: 0,
|
|
13
|
+
channel: 1,
|
|
14
|
+
user: 2,
|
|
15
|
+
global: 3,
|
|
16
|
+
};
|
|
17
|
+
function assertScope(scope) {
|
|
18
|
+
if (!types_js_1.MEMORY_SCOPE_KINDS.includes(scope.kind)) {
|
|
19
|
+
throw new Error(`Unsupported memory scope kind: ${scope.kind}`);
|
|
20
|
+
}
|
|
21
|
+
const id = scope.id.trim();
|
|
22
|
+
if (id.length === 0) {
|
|
23
|
+
throw new Error('Memory scope id must not be empty');
|
|
24
|
+
}
|
|
25
|
+
return { kind: scope.kind, id };
|
|
26
|
+
}
|
|
27
|
+
function scopeKey(scope) {
|
|
28
|
+
return `${scope.kind}\0${scope.id}`;
|
|
29
|
+
}
|
|
30
|
+
function connectorKey(connector) {
|
|
31
|
+
const trimmed = connector.trim();
|
|
32
|
+
if (trimmed.length === 0) {
|
|
33
|
+
throw new Error('Connector must not be empty');
|
|
34
|
+
}
|
|
35
|
+
return trimmed;
|
|
36
|
+
}
|
|
37
|
+
function projectKey(project) {
|
|
38
|
+
const kind = project.kind.trim();
|
|
39
|
+
const id = project.id.trim();
|
|
40
|
+
if (kind.length === 0 || id.length === 0) {
|
|
41
|
+
throw new Error('Project ref kind and id must not be empty');
|
|
42
|
+
}
|
|
43
|
+
return `${kind}\0${id}`;
|
|
44
|
+
}
|
|
45
|
+
function sortScopes(scopes) {
|
|
46
|
+
return [...scopes].sort((left, right) => {
|
|
47
|
+
const orderDiff = SCOPE_ORDER[left.kind] - SCOPE_ORDER[right.kind];
|
|
48
|
+
if (orderDiff !== 0) {
|
|
49
|
+
return orderDiff;
|
|
50
|
+
}
|
|
51
|
+
return left.id.localeCompare(right.id);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function canonicalizeContextScopes(scopes) {
|
|
55
|
+
const unique = new Map();
|
|
56
|
+
for (const scope of scopes ?? []) {
|
|
57
|
+
const normalized = assertScope(scope);
|
|
58
|
+
unique.set(scopeKey(normalized), normalized);
|
|
59
|
+
}
|
|
60
|
+
const canonicalScopes = sortScopes([...unique.values()]);
|
|
61
|
+
const scopeJson = JSON.stringify(canonicalScopes);
|
|
62
|
+
const scopeHash = (0, node_crypto_1.createHash)('sha256').update(scopeJson).digest('hex');
|
|
63
|
+
return {
|
|
64
|
+
scopes: canonicalScopes,
|
|
65
|
+
scopeJson,
|
|
66
|
+
scopeHash,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function derivePrimaryContextScope(scopes) {
|
|
70
|
+
const canonical = canonicalizeContextScopes(scopes).scopes;
|
|
71
|
+
const primary = canonical.find((scope) => scope.kind === 'project') ?? canonical[0];
|
|
72
|
+
return primary ?? { kind: 'global', id: 'default' };
|
|
73
|
+
}
|
|
74
|
+
function assertContextBoundaryAllowsInput(input) {
|
|
75
|
+
const hasScopeBoundary = Array.isArray(input.boundary.scopes);
|
|
76
|
+
const boundaryScopes = canonicalizeContextScopes(input.boundary.scopes).scopes;
|
|
77
|
+
const requestedScopes = canonicalizeContextScopes(input.requestedScopes).scopes;
|
|
78
|
+
if (hasScopeBoundary && requestedScopes.length > 0) {
|
|
79
|
+
const allowed = new Set(boundaryScopes.map(scopeKey));
|
|
80
|
+
const disallowed = requestedScopes.find((scope) => !allowed.has(scopeKey(scope)));
|
|
81
|
+
if (disallowed) {
|
|
82
|
+
throw new Error(`Requested scope is outside the context boundary: ${disallowed.kind}:${disallowed.id}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const hasConnectorBoundary = Array.isArray(input.boundary.connectors);
|
|
86
|
+
const boundaryConnectors = new Set((input.boundary.connectors ?? []).map(connectorKey));
|
|
87
|
+
const requestedConnectors = (input.requestedConnectors ?? []).map(connectorKey);
|
|
88
|
+
if (hasConnectorBoundary) {
|
|
89
|
+
const disallowedConnector = requestedConnectors.find((connector) => !boundaryConnectors.has(connector));
|
|
90
|
+
if (disallowedConnector) {
|
|
91
|
+
throw new Error(`Requested connector is outside the context boundary: ${disallowedConnector}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const hasProjectBoundary = Array.isArray(input.boundary.project_refs);
|
|
95
|
+
const boundaryProjects = new Set((input.boundary.project_refs ?? []).map(projectKey));
|
|
96
|
+
const requestedProjects = (input.requestedProjectRefs ?? []).map(projectKey);
|
|
97
|
+
if (hasProjectBoundary && requestedProjects.length > 0) {
|
|
98
|
+
const disallowedProject = requestedProjects.find((project) => !boundaryProjects.has(project));
|
|
99
|
+
if (disallowedProject) {
|
|
100
|
+
const [kind, id] = disallowedProject.split('\0');
|
|
101
|
+
throw new Error(`Requested project ref is outside the context boundary: ${kind}:${id}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const boundaryTenantId = input.boundary.tenant_id;
|
|
105
|
+
if (typeof boundaryTenantId === 'string' &&
|
|
106
|
+
boundaryTenantId.length > 0 &&
|
|
107
|
+
input.requestedTenantId !== undefined &&
|
|
108
|
+
input.requestedTenantId !== null &&
|
|
109
|
+
input.requestedTenantId !== boundaryTenantId) {
|
|
110
|
+
throw new Error('Requested tenant is outside the context boundary');
|
|
111
|
+
}
|
|
112
|
+
const seedRefs = (0, ref_js_1.normalizeContextRefs)(input.seedRefs);
|
|
113
|
+
assertSeedRefsAllowed(seedRefs, boundaryConnectors, hasConnectorBoundary);
|
|
114
|
+
}
|
|
115
|
+
function assertSeedRefsAllowed(seedRefs, boundaryConnectors, hasConnectorBoundary) {
|
|
116
|
+
for (const ref of seedRefs) {
|
|
117
|
+
if (ref.kind === 'raw' && hasConnectorBoundary && !boundaryConnectors.has(ref.connector)) {
|
|
118
|
+
throw new Error(`Seed raw ref connector is outside the context boundary: ${ref.connector}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function isRecord(value) {
|
|
123
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
124
|
+
}
|
|
125
|
+
function collectHiddenIdentifiers(value, hidden) {
|
|
126
|
+
if (Array.isArray(value)) {
|
|
127
|
+
for (const item of value) {
|
|
128
|
+
collectHiddenIdentifiers(item, hidden);
|
|
129
|
+
}
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (!isRecord(value)) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const maybeHidden = value;
|
|
136
|
+
if (maybeHidden.visible === false) {
|
|
137
|
+
for (const field of ['id', 'raw_id', 'source_id', 'channel_id']) {
|
|
138
|
+
const fieldValue = value[field];
|
|
139
|
+
if (typeof fieldValue === 'string' && fieldValue.length > 0) {
|
|
140
|
+
hidden.add(fieldValue);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
for (const child of Object.values(value)) {
|
|
145
|
+
collectHiddenIdentifiers(child, hidden);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function isIdentifierBoundary(character) {
|
|
149
|
+
return character === undefined || !/[A-Za-z0-9_]/.test(character);
|
|
150
|
+
}
|
|
151
|
+
function containsHiddenIdentifier(value, identifier) {
|
|
152
|
+
if (identifier.length === 0) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
let index = value.indexOf(identifier);
|
|
156
|
+
while (index !== -1) {
|
|
157
|
+
const before = value[index - 1];
|
|
158
|
+
const after = value[index + identifier.length];
|
|
159
|
+
if (isIdentifierBoundary(before) && isIdentifierBoundary(after)) {
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
index = value.indexOf(identifier, index + 1);
|
|
163
|
+
}
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
function sanitizeValue(value, hidden) {
|
|
167
|
+
if (typeof value === 'string') {
|
|
168
|
+
return [...hidden].some((identifier) => containsHiddenIdentifier(value, identifier))
|
|
169
|
+
? undefined
|
|
170
|
+
: value;
|
|
171
|
+
}
|
|
172
|
+
if (Array.isArray(value)) {
|
|
173
|
+
return value
|
|
174
|
+
.map((item) => sanitizeValue(item, hidden))
|
|
175
|
+
.filter((item) => item !== undefined);
|
|
176
|
+
}
|
|
177
|
+
if (!isRecord(value)) {
|
|
178
|
+
return value;
|
|
179
|
+
}
|
|
180
|
+
if (value.visible === false) {
|
|
181
|
+
return undefined;
|
|
182
|
+
}
|
|
183
|
+
const sanitized = {};
|
|
184
|
+
for (const [key, child] of Object.entries(value)) {
|
|
185
|
+
const next = sanitizeValue(child, hidden);
|
|
186
|
+
if (next !== undefined) {
|
|
187
|
+
sanitized[key] = next;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return sanitized;
|
|
191
|
+
}
|
|
192
|
+
function sanitizeContextPacketForVisibility(packet) {
|
|
193
|
+
const hidden = new Set();
|
|
194
|
+
collectHiddenIdentifiers(packet, hidden);
|
|
195
|
+
return sanitizeValue(packet, hidden);
|
|
196
|
+
}
|
|
197
|
+
function normalizeSeedRefs(seedRefs) {
|
|
198
|
+
return (0, ref_js_1.normalizeContextRefs)(seedRefs).map((ref) => (0, ref_js_1.normalizeContextRef)(ref));
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=visibility.js.map
|
|
@@ -40,27 +40,43 @@ export declare class NodeSQLiteAdapter extends DatabaseAdapter {
|
|
|
40
40
|
private _vectorSearchEnabled;
|
|
41
41
|
private vectorCache;
|
|
42
42
|
private topicCache;
|
|
43
|
+
private statusCache;
|
|
44
|
+
private decisionsHasStatusColumns;
|
|
45
|
+
private decisionsColumnInfoChecked;
|
|
43
46
|
constructor(config?: SQLiteAdapterConfig);
|
|
44
47
|
get vectorSearchEnabled(): boolean;
|
|
45
48
|
getDbPath(): string;
|
|
46
49
|
connect(): NodeSQLiteConnection;
|
|
47
50
|
reloadVectorCache(): void;
|
|
51
|
+
refreshDecisionStatusCache(rowid: number): void;
|
|
52
|
+
private refreshDecisionColumnInfo;
|
|
48
53
|
private loadVectorCache;
|
|
49
54
|
disconnect(): void;
|
|
50
55
|
isConnected(): boolean;
|
|
51
56
|
prepare(sql: string): Statement;
|
|
52
57
|
exec(sql: string): void;
|
|
53
58
|
transaction<T>(fn: () => T): T;
|
|
54
|
-
vectorSearch(embedding: Float32Array | number[], limit?: number, topicPrefix?: string): VectorSearchResult[] | null;
|
|
59
|
+
vectorSearch(embedding: Float32Array | number[], limit?: number, topicPrefix?: string, excludeStatuses?: readonly string[]): VectorSearchResult[] | null;
|
|
55
60
|
insertEmbedding(rowid: number, embedding: Float32Array | number[]): RunResult | null;
|
|
56
61
|
getLastInsertRowid(): number;
|
|
57
62
|
runMigrations(migrationsDir: string): void;
|
|
63
|
+
private repairSkippedFeatureMigrations;
|
|
64
|
+
private applyRepairMigration;
|
|
65
|
+
private operatorMemoryCommitIntentTableSql;
|
|
66
|
+
private hasOperatorMemoryCommitIntentClaimInvariant;
|
|
67
|
+
private assertMigration040BaseComplete;
|
|
68
|
+
private assertMigration041Complete;
|
|
58
69
|
private recoverMemoryProvenanceMigration032;
|
|
59
70
|
private assertMigration032Complete;
|
|
60
71
|
private recoverConnectorEventScopeMigration034;
|
|
61
72
|
private assertMigration034Complete;
|
|
73
|
+
private recoverConnectorEventOperatorSeqMigration039;
|
|
74
|
+
private assertMigration039Complete;
|
|
62
75
|
private tableColumns;
|
|
76
|
+
private tableExists;
|
|
63
77
|
private indexExists;
|
|
78
|
+
private triggerExists;
|
|
79
|
+
private schemaVersionExists;
|
|
64
80
|
private migrateFromVssMemories;
|
|
65
81
|
}
|
|
66
82
|
export default NodeSQLiteAdapter;
|