@graphorin/memory 0.5.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/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +401 -0
- package/dist/conflict/index.d.ts +3 -0
- package/dist/conflict/index.js +7 -0
- package/dist/conflict/locale-packs/en.js +262 -0
- package/dist/conflict/locale-packs/en.js.map +1 -0
- package/dist/conflict/locale-packs/index.js +4 -0
- package/dist/conflict/locale-packs/types.d.ts +103 -0
- package/dist/conflict/locale-packs/types.d.ts.map +1 -0
- package/dist/conflict/locale-packs/types.js +55 -0
- package/dist/conflict/locale-packs/types.js.map +1 -0
- package/dist/conflict/pipeline.d.ts +35 -0
- package/dist/conflict/pipeline.d.ts.map +1 -0
- package/dist/conflict/pipeline.js +257 -0
- package/dist/conflict/pipeline.js.map +1 -0
- package/dist/conflict/stages/helpers.js +66 -0
- package/dist/conflict/stages/helpers.js.map +1 -0
- package/dist/conflict/stages/stage1-exact-dedup.js +21 -0
- package/dist/conflict/stages/stage1-exact-dedup.js.map +1 -0
- package/dist/conflict/stages/stage2-embedding-three-zone.js +37 -0
- package/dist/conflict/stages/stage2-embedding-three-zone.js.map +1 -0
- package/dist/conflict/stages/stage3-heuristic-regex.js +45 -0
- package/dist/conflict/stages/stage3-heuristic-regex.js.map +1 -0
- package/dist/conflict/stages/stage4-subject-predicate.js +31 -0
- package/dist/conflict/stages/stage4-subject-predicate.js.map +1 -0
- package/dist/conflict/stages/stage5-defer-to-deep.js +22 -0
- package/dist/conflict/stages/stage5-defer-to-deep.js.map +1 -0
- package/dist/conflict/types.d.ts +222 -0
- package/dist/conflict/types.d.ts.map +1 -0
- package/dist/conflict/types.js +50 -0
- package/dist/conflict/types.js.map +1 -0
- package/dist/consolidator/budget.d.ts +1 -0
- package/dist/consolidator/budget.js +214 -0
- package/dist/consolidator/budget.js.map +1 -0
- package/dist/consolidator/decay.d.ts +35 -0
- package/dist/consolidator/decay.d.ts.map +1 -0
- package/dist/consolidator/decay.js +91 -0
- package/dist/consolidator/decay.js.map +1 -0
- package/dist/consolidator/dlq.js +58 -0
- package/dist/consolidator/dlq.js.map +1 -0
- package/dist/consolidator/errors.d.ts +54 -0
- package/dist/consolidator/errors.d.ts.map +1 -0
- package/dist/consolidator/errors.js +67 -0
- package/dist/consolidator/errors.js.map +1 -0
- package/dist/consolidator/idempotency.d.ts +1 -0
- package/dist/consolidator/idempotency.js +22 -0
- package/dist/consolidator/idempotency.js.map +1 -0
- package/dist/consolidator/index.d.ts +34 -0
- package/dist/consolidator/index.d.ts.map +1 -0
- package/dist/consolidator/index.js +163 -0
- package/dist/consolidator/index.js.map +1 -0
- package/dist/consolidator/lock.d.ts +2 -0
- package/dist/consolidator/lock.js +89 -0
- package/dist/consolidator/lock.js.map +1 -0
- package/dist/consolidator/noise-filter.d.ts +2 -0
- package/dist/consolidator/noise-filter.js +173 -0
- package/dist/consolidator/noise-filter.js.map +1 -0
- package/dist/consolidator/phases/deep.d.ts +4 -0
- package/dist/consolidator/phases/deep.js +198 -0
- package/dist/consolidator/phases/deep.js.map +1 -0
- package/dist/consolidator/phases/induce.d.ts +154 -0
- package/dist/consolidator/phases/induce.d.ts.map +1 -0
- package/dist/consolidator/phases/induce.js +253 -0
- package/dist/consolidator/phases/induce.js.map +1 -0
- package/dist/consolidator/phases/light.d.ts +4 -0
- package/dist/consolidator/phases/light.js +99 -0
- package/dist/consolidator/phases/light.js.map +1 -0
- package/dist/consolidator/phases/reflect.js +287 -0
- package/dist/consolidator/phases/reflect.js.map +1 -0
- package/dist/consolidator/phases/standard.d.ts +8 -0
- package/dist/consolidator/phases/standard.js +499 -0
- package/dist/consolidator/phases/standard.js.map +1 -0
- package/dist/consolidator/reconcile.js +192 -0
- package/dist/consolidator/reconcile.js.map +1 -0
- package/dist/consolidator/runtime.d.ts +62 -0
- package/dist/consolidator/runtime.d.ts.map +1 -0
- package/dist/consolidator/runtime.js +580 -0
- package/dist/consolidator/runtime.js.map +1 -0
- package/dist/consolidator/scheduler.d.ts +111 -0
- package/dist/consolidator/scheduler.d.ts.map +1 -0
- package/dist/consolidator/scheduler.js +71 -0
- package/dist/consolidator/scheduler.js.map +1 -0
- package/dist/consolidator/triggers.d.ts +40 -0
- package/dist/consolidator/triggers.d.ts.map +1 -0
- package/dist/consolidator/triggers.js +94 -0
- package/dist/consolidator/triggers.js.map +1 -0
- package/dist/consolidator/types.d.ts +397 -0
- package/dist/consolidator/types.d.ts.map +1 -0
- package/dist/consolidator/types.js +117 -0
- package/dist/consolidator/types.js.map +1 -0
- package/dist/context-engine/annotations.d.ts +118 -0
- package/dist/context-engine/annotations.d.ts.map +1 -0
- package/dist/context-engine/annotations.js +102 -0
- package/dist/context-engine/annotations.js.map +1 -0
- package/dist/context-engine/auto-recall.d.ts +52 -0
- package/dist/context-engine/auto-recall.d.ts.map +1 -0
- package/dist/context-engine/auto-recall.js +41 -0
- package/dist/context-engine/auto-recall.js.map +1 -0
- package/dist/context-engine/compaction/clear-tool-results.d.ts +55 -0
- package/dist/context-engine/compaction/clear-tool-results.d.ts.map +1 -0
- package/dist/context-engine/compaction/clear-tool-results.js +97 -0
- package/dist/context-engine/compaction/clear-tool-results.js.map +1 -0
- package/dist/context-engine/compaction/compactor.d.ts +52 -0
- package/dist/context-engine/compaction/compactor.d.ts.map +1 -0
- package/dist/context-engine/compaction/compactor.js +196 -0
- package/dist/context-engine/compaction/compactor.js.map +1 -0
- package/dist/context-engine/compaction/hooks/reanchor-persona-block.d.ts +15 -0
- package/dist/context-engine/compaction/hooks/reanchor-persona-block.d.ts.map +1 -0
- package/dist/context-engine/compaction/hooks/reanchor-persona-block.js +27 -0
- package/dist/context-engine/compaction/hooks/reanchor-persona-block.js.map +1 -0
- package/dist/context-engine/compaction/hooks/reanchor-pinned-facts.d.ts +18 -0
- package/dist/context-engine/compaction/hooks/reanchor-pinned-facts.d.ts.map +1 -0
- package/dist/context-engine/compaction/hooks/reanchor-pinned-facts.js +47 -0
- package/dist/context-engine/compaction/hooks/reanchor-pinned-facts.js.map +1 -0
- package/dist/context-engine/compaction/hooks/reanchor-project-rules.d.ts +15 -0
- package/dist/context-engine/compaction/hooks/reanchor-project-rules.d.ts.map +1 -0
- package/dist/context-engine/compaction/hooks/reanchor-project-rules.js +32 -0
- package/dist/context-engine/compaction/hooks/reanchor-project-rules.js.map +1 -0
- package/dist/context-engine/compaction/hooks/types.d.ts +42 -0
- package/dist/context-engine/compaction/hooks/types.d.ts.map +1 -0
- package/dist/context-engine/compaction/index.d.ts +9 -0
- package/dist/context-engine/compaction/index.js +9 -0
- package/dist/context-engine/compaction/templates/summary-9-section.d.ts +84 -0
- package/dist/context-engine/compaction/templates/summary-9-section.d.ts.map +1 -0
- package/dist/context-engine/compaction/templates/summary-9-section.js +84 -0
- package/dist/context-engine/compaction/templates/summary-9-section.js.map +1 -0
- package/dist/context-engine/compaction/thresholds.d.ts +68 -0
- package/dist/context-engine/compaction/thresholds.d.ts.map +1 -0
- package/dist/context-engine/compaction/thresholds.js +63 -0
- package/dist/context-engine/compaction/thresholds.js.map +1 -0
- package/dist/context-engine/compaction/types.d.ts +202 -0
- package/dist/context-engine/compaction/types.d.ts.map +1 -0
- package/dist/context-engine/engine.d.ts +258 -0
- package/dist/context-engine/engine.d.ts.map +1 -0
- package/dist/context-engine/engine.js +424 -0
- package/dist/context-engine/engine.js.map +1 -0
- package/dist/context-engine/index.d.ts +68 -0
- package/dist/context-engine/index.d.ts.map +1 -0
- package/dist/context-engine/index.js +24 -0
- package/dist/context-engine/locale-packs/en.d.ts +14 -0
- package/dist/context-engine/locale-packs/en.d.ts.map +1 -0
- package/dist/context-engine/locale-packs/en.js +87 -0
- package/dist/context-engine/locale-packs/en.js.map +1 -0
- package/dist/context-engine/locale-packs/index.js +4 -0
- package/dist/context-engine/locale-packs/resolver.d.ts +41 -0
- package/dist/context-engine/locale-packs/resolver.d.ts.map +1 -0
- package/dist/context-engine/locale-packs/resolver.js +119 -0
- package/dist/context-engine/locale-packs/resolver.js.map +1 -0
- package/dist/context-engine/locale-packs/types.d.ts +119 -0
- package/dist/context-engine/locale-packs/types.d.ts.map +1 -0
- package/dist/context-engine/locale-packs/types.js +24 -0
- package/dist/context-engine/locale-packs/types.js.map +1 -0
- package/dist/context-engine/metadata.d.ts +40 -0
- package/dist/context-engine/metadata.d.ts.map +1 -0
- package/dist/context-engine/metadata.js +66 -0
- package/dist/context-engine/metadata.js.map +1 -0
- package/dist/context-engine/preambles/inbound-en.d.ts +20 -0
- package/dist/context-engine/preambles/inbound-en.d.ts.map +1 -0
- package/dist/context-engine/preambles/inbound-en.js +23 -0
- package/dist/context-engine/preambles/inbound-en.js.map +1 -0
- package/dist/context-engine/privacy-filter.d.ts +108 -0
- package/dist/context-engine/privacy-filter.d.ts.map +1 -0
- package/dist/context-engine/privacy-filter.js +113 -0
- package/dist/context-engine/privacy-filter.js.map +1 -0
- package/dist/context-engine/templates/base-en.d.ts +19 -0
- package/dist/context-engine/templates/base-en.d.ts.map +1 -0
- package/dist/context-engine/templates/base-en.js +22 -0
- package/dist/context-engine/templates/base-en.js.map +1 -0
- package/dist/context-engine/templates/composer.d.ts +55 -0
- package/dist/context-engine/templates/composer.d.ts.map +1 -0
- package/dist/context-engine/templates/composer.js +51 -0
- package/dist/context-engine/templates/composer.js.map +1 -0
- package/dist/context-engine/token-budget.d.ts +99 -0
- package/dist/context-engine/token-budget.d.ts.map +1 -0
- package/dist/context-engine/token-budget.js +211 -0
- package/dist/context-engine/token-budget.js.map +1 -0
- package/dist/context-engine/token-counter.d.ts +54 -0
- package/dist/context-engine/token-counter.d.ts.map +1 -0
- package/dist/context-engine/token-counter.js +81 -0
- package/dist/context-engine/token-counter.js.map +1 -0
- package/dist/errors/index.d.ts +171 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +206 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/facade.d.ts +278 -0
- package/dist/facade.d.ts.map +1 -0
- package/dist/facade.js +265 -0
- package/dist/facade.js.map +1 -0
- package/dist/graph/entity-resolver.d.ts +135 -0
- package/dist/graph/entity-resolver.d.ts.map +1 -0
- package/dist/graph/entity-resolver.js +202 -0
- package/dist/graph/entity-resolver.js.map +1 -0
- package/dist/graph/index.d.ts +1 -0
- package/dist/index.d.ts +103 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/contextualize.d.ts +14 -0
- package/dist/internal/contextualize.d.ts.map +1 -0
- package/dist/internal/contextualize.js +110 -0
- package/dist/internal/contextualize.js.map +1 -0
- package/dist/internal/embedder-binding.js +50 -0
- package/dist/internal/embedder-binding.js.map +1 -0
- package/dist/internal/id.js +24 -0
- package/dist/internal/id.js.map +1 -0
- package/dist/internal/injection-heuristics.js +64 -0
- package/dist/internal/injection-heuristics.js.map +1 -0
- package/dist/internal/spans.js +35 -0
- package/dist/internal/spans.js.map +1 -0
- package/dist/internal/storage-adapter.d.ts +742 -0
- package/dist/internal/storage-adapter.d.ts.map +1 -0
- package/dist/migration/embedder-migration.d.ts +124 -0
- package/dist/migration/embedder-migration.d.ts.map +1 -0
- package/dist/migration/embedder-migration.js +109 -0
- package/dist/migration/embedder-migration.js.map +1 -0
- package/dist/migration/index.d.ts +2 -0
- package/dist/migration/index.js +3 -0
- package/dist/search/explain.d.ts +74 -0
- package/dist/search/explain.d.ts.map +1 -0
- package/dist/search/explain.js +50 -0
- package/dist/search/explain.js.map +1 -0
- package/dist/search/index.d.ts +6 -0
- package/dist/search/index.js +6 -0
- package/dist/search/iterative.d.ts +223 -0
- package/dist/search/iterative.d.ts.map +1 -0
- package/dist/search/iterative.js +330 -0
- package/dist/search/iterative.js.map +1 -0
- package/dist/search/query-transform.d.ts +112 -0
- package/dist/search/query-transform.d.ts.map +1 -0
- package/dist/search/query-transform.js +184 -0
- package/dist/search/query-transform.js.map +1 -0
- package/dist/search/rrf.d.ts +95 -0
- package/dist/search/rrf.d.ts.map +1 -0
- package/dist/search/rrf.js +166 -0
- package/dist/search/rrf.js.map +1 -0
- package/dist/search/types.d.ts +50 -0
- package/dist/search/types.d.ts.map +1 -0
- package/dist/tiers/episodic-memory.d.ts +142 -0
- package/dist/tiers/episodic-memory.d.ts.map +1 -0
- package/dist/tiers/episodic-memory.js +254 -0
- package/dist/tiers/episodic-memory.js.map +1 -0
- package/dist/tiers/index.d.ts +8 -0
- package/dist/tiers/index.js +9 -0
- package/dist/tiers/insight-memory.d.ts +71 -0
- package/dist/tiers/insight-memory.d.ts.map +1 -0
- package/dist/tiers/insight-memory.js +133 -0
- package/dist/tiers/insight-memory.js.map +1 -0
- package/dist/tiers/procedural-memory.d.ts +147 -0
- package/dist/tiers/procedural-memory.d.ts.map +1 -0
- package/dist/tiers/procedural-memory.js +267 -0
- package/dist/tiers/procedural-memory.js.map +1 -0
- package/dist/tiers/semantic-memory.d.ts +461 -0
- package/dist/tiers/semantic-memory.d.ts.map +1 -0
- package/dist/tiers/semantic-memory.js +631 -0
- package/dist/tiers/semantic-memory.js.map +1 -0
- package/dist/tiers/session-memory.d.ts +117 -0
- package/dist/tiers/session-memory.d.ts.map +1 -0
- package/dist/tiers/session-memory.js +163 -0
- package/dist/tiers/session-memory.js.map +1 -0
- package/dist/tiers/shared-memory.d.ts +29 -0
- package/dist/tiers/shared-memory.d.ts.map +1 -0
- package/dist/tiers/shared-memory.js +58 -0
- package/dist/tiers/shared-memory.js.map +1 -0
- package/dist/tiers/working-memory.d.ts +129 -0
- package/dist/tiers/working-memory.d.ts.map +1 -0
- package/dist/tiers/working-memory.js +229 -0
- package/dist/tiers/working-memory.js.map +1 -0
- package/dist/tools/block-tools.d.ts +98 -0
- package/dist/tools/block-tools.d.ts.map +1 -0
- package/dist/tools/block-tools.js +114 -0
- package/dist/tools/block-tools.js.map +1 -0
- package/dist/tools/fact-tools.d.ts +294 -0
- package/dist/tools/fact-tools.d.ts.map +1 -0
- package/dist/tools/fact-tools.js +293 -0
- package/dist/tools/fact-tools.js.map +1 -0
- package/dist/tools/index.d.ts +35 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +36 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/recall-tools.d.ts +209 -0
- package/dist/tools/recall-tools.d.ts.map +1 -0
- package/dist/tools/recall-tools.js +170 -0
- package/dist/tools/recall-tools.js.map +1 -0
- package/dist/tools/types.d.ts +40 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/package.json +119 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
//#region src/errors/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Typed error classes raised by `@graphorin/memory`. Every memory
|
|
4
|
+
* subsystem throws one of these instead of plain `Error` so consumers
|
|
5
|
+
* can pattern-match on `kind` and `name` without parsing the message.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Base class for every error raised by `@graphorin/memory`. Carries a
|
|
11
|
+
* stable lowercase `kind` discriminator and an optional `hint`
|
|
12
|
+
* surfaced to operators (CLI command / docs link to fix the issue).
|
|
13
|
+
*
|
|
14
|
+
* @stable
|
|
15
|
+
*/
|
|
16
|
+
declare abstract class GraphorinMemoryError extends Error {
|
|
17
|
+
/** Stable lowercase discriminator. */
|
|
18
|
+
abstract readonly kind: string;
|
|
19
|
+
/** Optional actionable hint surfaced to operators. */
|
|
20
|
+
readonly hint?: string;
|
|
21
|
+
constructor(message: string, options?: {
|
|
22
|
+
cause?: unknown;
|
|
23
|
+
hint?: string;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Raised when a memory write would reference an embedder that is not
|
|
28
|
+
* registered in the storage layer's `embedding_meta` registry.
|
|
29
|
+
*
|
|
30
|
+
* @stable
|
|
31
|
+
*/
|
|
32
|
+
declare class EmbedderRegistrationError extends GraphorinMemoryError {
|
|
33
|
+
readonly name = "EmbedderRegistrationError";
|
|
34
|
+
readonly kind: "embedder-registration";
|
|
35
|
+
readonly embedderId: string;
|
|
36
|
+
constructor(embedderId: string, options?: {
|
|
37
|
+
cause?: unknown;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Raised when a memory tool is invoked outside the per-tool ACL or the
|
|
42
|
+
* memory-modification guard tier rejects the call.
|
|
43
|
+
*
|
|
44
|
+
* @stable
|
|
45
|
+
*/
|
|
46
|
+
declare class MemoryToolDeniedError extends GraphorinMemoryError {
|
|
47
|
+
readonly name = "MemoryToolDeniedError";
|
|
48
|
+
readonly kind: "memory-tool-denied";
|
|
49
|
+
readonly toolName: string;
|
|
50
|
+
readonly reason: string;
|
|
51
|
+
constructor(toolName: string, reason: string);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Raised by `WorkingMemory` when a write would exceed the declared
|
|
55
|
+
* `charLimit` and the overflow policy is `'reject'`.
|
|
56
|
+
*
|
|
57
|
+
* @stable
|
|
58
|
+
*/
|
|
59
|
+
declare class WorkingBlockOverflowError extends GraphorinMemoryError {
|
|
60
|
+
readonly name = "WorkingBlockOverflowError";
|
|
61
|
+
readonly kind: "working-block-overflow";
|
|
62
|
+
readonly label: string;
|
|
63
|
+
readonly attempted: number;
|
|
64
|
+
readonly charLimit: number;
|
|
65
|
+
constructor(label: string, attempted: number, charLimit: number);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Raised by `WorkingMemory.replace(...)` when the supplied unique
|
|
69
|
+
* substring is not present (or appears more than once) in the block
|
|
70
|
+
* value.
|
|
71
|
+
*
|
|
72
|
+
* @stable
|
|
73
|
+
*/
|
|
74
|
+
declare class WorkingBlockReplaceMismatchError extends GraphorinMemoryError {
|
|
75
|
+
readonly name = "WorkingBlockReplaceMismatchError";
|
|
76
|
+
readonly kind: "working-block-replace-mismatch";
|
|
77
|
+
readonly label: string;
|
|
78
|
+
readonly occurrences: number;
|
|
79
|
+
constructor(label: string, occurrences: number);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Thrown when any mutation targets a block defined with
|
|
83
|
+
* `readOnly: true` (MRET-14). Previously this guard threw
|
|
84
|
+
* `WorkingBlockReplaceMismatchError(label, 0)` — semantically "your
|
|
85
|
+
* unique substring matched 0 times", which misled callers that retry
|
|
86
|
+
* replace operations on mismatch.
|
|
87
|
+
*
|
|
88
|
+
* @stable
|
|
89
|
+
*/
|
|
90
|
+
declare class WorkingBlockReadOnlyError extends GraphorinMemoryError {
|
|
91
|
+
readonly name = "WorkingBlockReadOnlyError";
|
|
92
|
+
readonly kind: "working-block-read-only";
|
|
93
|
+
readonly label: string;
|
|
94
|
+
constructor(label: string);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Raised by the embedder migration runner when the operator attempts a
|
|
98
|
+
* silent embedder swap under the `lock-on-first` policy.
|
|
99
|
+
*
|
|
100
|
+
* @stable
|
|
101
|
+
*/
|
|
102
|
+
declare class EmbedderMigrationLockedError extends GraphorinMemoryError {
|
|
103
|
+
readonly name = "EmbedderMigrationLockedError";
|
|
104
|
+
readonly kind: "embedder-migration-locked";
|
|
105
|
+
readonly source: string;
|
|
106
|
+
readonly target: string;
|
|
107
|
+
constructor(source: string, target: string);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Raised by `migrateEmbedder(...)` when the runner is interrupted via
|
|
111
|
+
* `AbortSignal`. The surrounding `for-await` loop receives this error so
|
|
112
|
+
* the operator can re-run the migration. MST-12: there is no persisted
|
|
113
|
+
* cursor today, so a re-run restarts from the beginning.
|
|
114
|
+
*
|
|
115
|
+
* @stable
|
|
116
|
+
*/
|
|
117
|
+
declare class EmbedderMigrationAbortedError extends GraphorinMemoryError {
|
|
118
|
+
readonly name = "EmbedderMigrationAbortedError";
|
|
119
|
+
readonly kind: "embedder-migration-aborted";
|
|
120
|
+
readonly migrationId: string;
|
|
121
|
+
constructor(migrationId: string);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Raised by the migration runner when the migration references embedders
|
|
125
|
+
* that are no longer registered (e.g. the operator removed the underlying
|
|
126
|
+
* tables manually).
|
|
127
|
+
*
|
|
128
|
+
* @stable
|
|
129
|
+
*/
|
|
130
|
+
declare class EmbedderMigrationStateError extends GraphorinMemoryError {
|
|
131
|
+
readonly name = "EmbedderMigrationStateError";
|
|
132
|
+
readonly kind: "embedder-migration-state";
|
|
133
|
+
constructor(message: string);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Raised by {@link SemanticMemory.validate} (P1-4 / MRET-3) when a caller
|
|
137
|
+
* tries to promote a fact whose quarantine was triggered by the offline
|
|
138
|
+
* injection heuristics. Such a fact is a memory-poisoning candidate: the
|
|
139
|
+
* agent's own `fact_validate` tool must never be able to admit it into
|
|
140
|
+
* action-driving recall, so promotion is refused unless an operator
|
|
141
|
+
* passes the explicit `force` flag through the programmatic API.
|
|
142
|
+
*
|
|
143
|
+
* @stable
|
|
144
|
+
*/
|
|
145
|
+
declare class QuarantinePromotionRefusedError extends GraphorinMemoryError {
|
|
146
|
+
readonly name = "QuarantinePromotionRefusedError";
|
|
147
|
+
readonly kind: "quarantine-promotion-refused";
|
|
148
|
+
readonly factId: string;
|
|
149
|
+
/** Injection-rule labels that tripped on the fact's text. */
|
|
150
|
+
readonly markers: ReadonlyArray<string>;
|
|
151
|
+
constructor(factId: string, markers: ReadonlyArray<string>);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Raised when {@link ProceduralMemory.induce} (P2-2) is called but no
|
|
155
|
+
* workflow inducer was configured. Induction abstracts concrete values into
|
|
156
|
+
* variables, which needs a provider — so the capability is opt-in and the
|
|
157
|
+
* default (offline) procedural tier never silently no-ops a requested
|
|
158
|
+
* induction.
|
|
159
|
+
*
|
|
160
|
+
* @stable
|
|
161
|
+
*/
|
|
162
|
+
declare class ProcedureInductionNotConfiguredError extends GraphorinMemoryError {
|
|
163
|
+
readonly name = "ProcedureInductionNotConfiguredError";
|
|
164
|
+
readonly kind: "procedure-induction-not-configured";
|
|
165
|
+
constructor(options?: {
|
|
166
|
+
cause?: unknown;
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
export { EmbedderMigrationAbortedError, EmbedderMigrationLockedError, EmbedderMigrationStateError, EmbedderRegistrationError, GraphorinMemoryError, MemoryToolDeniedError, ProcedureInductionNotConfiguredError, QuarantinePromotionRefusedError, WorkingBlockOverflowError, WorkingBlockReadOnlyError, WorkingBlockReplaceMismatchError };
|
|
171
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/errors/index.ts"],"sourcesContent":[],"mappings":";;AAeA;AAoBA;AAyBA;AAqBA;AA2BA;AA2BA;AAmBA;AA2BA;AAwBA;AAqBA;;;;AAAyE,uBAnNnD,oBAAA,SAA6B,KAAA,CAmNsB;EA+B5D;;;;;;;;;;;;;;;cA9NA,yBAAA,SAAkC,oBAAA;;;;;;;;;;;;;;cAyBlC,qBAAA,SAA8B,oBAAA;;;;;;;;;;;;;cAqB9B,yBAAA,SAAkC,oBAAA;;;;;;;;;;;;;;;cA2BlC,gCAAA,SAAyC,oBAAA;;;;;;;;;;;;;;;;cA2BzC,yBAAA,SAAkC,oBAAA;;;;;;;;;;;;cAmBlC,4BAAA,SAAqC,oBAAA;;;;;;;;;;;;;;;cA2BrC,6BAAA,SAAsC,oBAAA;;;;;;;;;;;;;cAwBtC,2BAAA,SAAoC,oBAAA;;;;;;;;;;;;;;;cAqBpC,+BAAA,SAAwC,oBAAA;;;;;oBAKjC;uCAEmB;;;;;;;;;;;cAwB1B,oCAAA,SAA6C,oBAAA"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
//#region src/errors/index.ts
|
|
2
|
+
/**
|
|
3
|
+
* Typed error classes raised by `@graphorin/memory`. Every memory
|
|
4
|
+
* subsystem throws one of these instead of plain `Error` so consumers
|
|
5
|
+
* can pattern-match on `kind` and `name` without parsing the message.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Base class for every error raised by `@graphorin/memory`. Carries a
|
|
11
|
+
* stable lowercase `kind` discriminator and an optional `hint`
|
|
12
|
+
* surfaced to operators (CLI command / docs link to fix the issue).
|
|
13
|
+
*
|
|
14
|
+
* @stable
|
|
15
|
+
*/
|
|
16
|
+
var GraphorinMemoryError = class extends Error {
|
|
17
|
+
/** Optional actionable hint surfaced to operators. */
|
|
18
|
+
hint;
|
|
19
|
+
constructor(message, options) {
|
|
20
|
+
super(message, options !== void 0 && "cause" in options ? { cause: options.cause } : {});
|
|
21
|
+
if (options?.hint !== void 0) this.hint = options.hint;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Raised when a memory write would reference an embedder that is not
|
|
26
|
+
* registered in the storage layer's `embedding_meta` registry.
|
|
27
|
+
*
|
|
28
|
+
* @stable
|
|
29
|
+
*/
|
|
30
|
+
var EmbedderRegistrationError = class extends GraphorinMemoryError {
|
|
31
|
+
name = "EmbedderRegistrationError";
|
|
32
|
+
kind = "embedder-registration";
|
|
33
|
+
embedderId;
|
|
34
|
+
constructor(embedderId, options) {
|
|
35
|
+
super(`[graphorin/memory] embedder '${embedderId}' is not registered. createMemory({ embedder, ... }) registers the configured embedder; manual writes must reference an already-registered embedder_id.`, {
|
|
36
|
+
...options?.cause !== void 0 ? { cause: options.cause } : {},
|
|
37
|
+
hint: "Pass `embedder` to createMemory(...) so the registration runs at startup."
|
|
38
|
+
});
|
|
39
|
+
this.embedderId = embedderId;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Raised when a memory tool is invoked outside the per-tool ACL or the
|
|
44
|
+
* memory-modification guard tier rejects the call.
|
|
45
|
+
*
|
|
46
|
+
* @stable
|
|
47
|
+
*/
|
|
48
|
+
var MemoryToolDeniedError = class extends GraphorinMemoryError {
|
|
49
|
+
name = "MemoryToolDeniedError";
|
|
50
|
+
kind = "memory-tool-denied";
|
|
51
|
+
toolName;
|
|
52
|
+
reason;
|
|
53
|
+
constructor(toolName, reason) {
|
|
54
|
+
super(`[graphorin/memory] memory tool '${toolName}' was denied: ${reason}`, { hint: "Check the tool authorisation matrix and the memory-modification guard tier policy." });
|
|
55
|
+
this.toolName = toolName;
|
|
56
|
+
this.reason = reason;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Raised by `WorkingMemory` when a write would exceed the declared
|
|
61
|
+
* `charLimit` and the overflow policy is `'reject'`.
|
|
62
|
+
*
|
|
63
|
+
* @stable
|
|
64
|
+
*/
|
|
65
|
+
var WorkingBlockOverflowError = class extends GraphorinMemoryError {
|
|
66
|
+
name = "WorkingBlockOverflowError";
|
|
67
|
+
kind = "working-block-overflow";
|
|
68
|
+
label;
|
|
69
|
+
attempted;
|
|
70
|
+
charLimit;
|
|
71
|
+
constructor(label, attempted, charLimit) {
|
|
72
|
+
super(`[graphorin/memory] working block '${label}' overflow: attempted ${attempted} chars, limit is ${charLimit}.`, { hint: "Switch the block's overflow policy to 'truncate' or shorten the input." });
|
|
73
|
+
this.label = label;
|
|
74
|
+
this.attempted = attempted;
|
|
75
|
+
this.charLimit = charLimit;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Raised by `WorkingMemory.replace(...)` when the supplied unique
|
|
80
|
+
* substring is not present (or appears more than once) in the block
|
|
81
|
+
* value.
|
|
82
|
+
*
|
|
83
|
+
* @stable
|
|
84
|
+
*/
|
|
85
|
+
var WorkingBlockReplaceMismatchError = class extends GraphorinMemoryError {
|
|
86
|
+
name = "WorkingBlockReplaceMismatchError";
|
|
87
|
+
kind = "working-block-replace-mismatch";
|
|
88
|
+
label;
|
|
89
|
+
occurrences;
|
|
90
|
+
constructor(label, occurrences) {
|
|
91
|
+
super(`[graphorin/memory] block_replace on '${label}' expected exactly one occurrence of the unique substring, found ${occurrences}.`, { hint: "Pass a longer unique substring or use block_rethink to replace the entire value." });
|
|
92
|
+
this.label = label;
|
|
93
|
+
this.occurrences = occurrences;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Thrown when any mutation targets a block defined with
|
|
98
|
+
* `readOnly: true` (MRET-14). Previously this guard threw
|
|
99
|
+
* `WorkingBlockReplaceMismatchError(label, 0)` — semantically "your
|
|
100
|
+
* unique substring matched 0 times", which misled callers that retry
|
|
101
|
+
* replace operations on mismatch.
|
|
102
|
+
*
|
|
103
|
+
* @stable
|
|
104
|
+
*/
|
|
105
|
+
var WorkingBlockReadOnlyError = class extends GraphorinMemoryError {
|
|
106
|
+
name = "WorkingBlockReadOnlyError";
|
|
107
|
+
kind = "working-block-read-only";
|
|
108
|
+
label;
|
|
109
|
+
constructor(label) {
|
|
110
|
+
super(`[graphorin/memory] block '${label}' is read-only — mutations are not allowed.`, { hint: "Define the block without readOnly, or write through an operator path that redefines it." });
|
|
111
|
+
this.label = label;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Raised by the embedder migration runner when the operator attempts a
|
|
116
|
+
* silent embedder swap under the `lock-on-first` policy.
|
|
117
|
+
*
|
|
118
|
+
* @stable
|
|
119
|
+
*/
|
|
120
|
+
var EmbedderMigrationLockedError = class extends GraphorinMemoryError {
|
|
121
|
+
name = "EmbedderMigrationLockedError";
|
|
122
|
+
kind = "embedder-migration-locked";
|
|
123
|
+
source;
|
|
124
|
+
target;
|
|
125
|
+
constructor(source, target) {
|
|
126
|
+
super(`[graphorin/memory] cannot swap embedder from '${source}' to '${target}' under the 'lock-on-first' policy. Run \`graphorin memory migrate\` (Phase 15) or pass \`policy: "auto-migrate"\` / "multi-active".`, { hint: "Plan an explicit migration before swapping the active embedder." });
|
|
127
|
+
this.source = source;
|
|
128
|
+
this.target = target;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Raised by `migrateEmbedder(...)` when the runner is interrupted via
|
|
133
|
+
* `AbortSignal`. The surrounding `for-await` loop receives this error so
|
|
134
|
+
* the operator can re-run the migration. MST-12: there is no persisted
|
|
135
|
+
* cursor today, so a re-run restarts from the beginning.
|
|
136
|
+
*
|
|
137
|
+
* @stable
|
|
138
|
+
*/
|
|
139
|
+
var EmbedderMigrationAbortedError = class extends GraphorinMemoryError {
|
|
140
|
+
name = "EmbedderMigrationAbortedError";
|
|
141
|
+
kind = "embedder-migration-aborted";
|
|
142
|
+
migrationId;
|
|
143
|
+
constructor(migrationId) {
|
|
144
|
+
super(`[graphorin/memory] embedder migration '${migrationId}' aborted before completion. Re-run \`migrateEmbedder(...)\` to restart (there is no persisted cursor yet, so it begins again).`, { hint: "Re-invoke migrateEmbedder(...) to restart the migration." });
|
|
145
|
+
this.migrationId = migrationId;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Raised by the migration runner when the migration references embedders
|
|
150
|
+
* that are no longer registered (e.g. the operator removed the underlying
|
|
151
|
+
* tables manually).
|
|
152
|
+
*
|
|
153
|
+
* @stable
|
|
154
|
+
*/
|
|
155
|
+
var EmbedderMigrationStateError = class extends GraphorinMemoryError {
|
|
156
|
+
name = "EmbedderMigrationStateError";
|
|
157
|
+
kind = "embedder-migration-state";
|
|
158
|
+
constructor(message) {
|
|
159
|
+
super(`[graphorin/memory] ${message}`, { hint: "Re-register the source/target embedders (or re-run with the current ones) before retrying." });
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Raised by {@link SemanticMemory.validate} (P1-4 / MRET-3) when a caller
|
|
164
|
+
* tries to promote a fact whose quarantine was triggered by the offline
|
|
165
|
+
* injection heuristics. Such a fact is a memory-poisoning candidate: the
|
|
166
|
+
* agent's own `fact_validate` tool must never be able to admit it into
|
|
167
|
+
* action-driving recall, so promotion is refused unless an operator
|
|
168
|
+
* passes the explicit `force` flag through the programmatic API.
|
|
169
|
+
*
|
|
170
|
+
* @stable
|
|
171
|
+
*/
|
|
172
|
+
var QuarantinePromotionRefusedError = class extends GraphorinMemoryError {
|
|
173
|
+
name = "QuarantinePromotionRefusedError";
|
|
174
|
+
kind = "quarantine-promotion-refused";
|
|
175
|
+
factId;
|
|
176
|
+
/** Injection-rule labels that tripped on the fact's text. */
|
|
177
|
+
markers;
|
|
178
|
+
constructor(factId, markers) {
|
|
179
|
+
super(`[graphorin/memory] refusing to promote fact '${factId}' out of quarantine: its text trips the injection heuristics (${markers.join(", ")}). Promotion of an injection-flagged memory is an operator action — pass \`{ force: true }\` to validate(...) from a trusted (non-agent) caller after review.`, { hint: "Review the quarantined fact, then promote it with validate(scope, id, reason, { force: true }) from an operator context." });
|
|
180
|
+
this.factId = factId;
|
|
181
|
+
this.markers = Object.freeze([...markers]);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Raised when {@link ProceduralMemory.induce} (P2-2) is called but no
|
|
186
|
+
* workflow inducer was configured. Induction abstracts concrete values into
|
|
187
|
+
* variables, which needs a provider — so the capability is opt-in and the
|
|
188
|
+
* default (offline) procedural tier never silently no-ops a requested
|
|
189
|
+
* induction.
|
|
190
|
+
*
|
|
191
|
+
* @stable
|
|
192
|
+
*/
|
|
193
|
+
var ProcedureInductionNotConfiguredError = class extends GraphorinMemoryError {
|
|
194
|
+
name = "ProcedureInductionNotConfiguredError";
|
|
195
|
+
kind = "procedure-induction-not-configured";
|
|
196
|
+
constructor(options) {
|
|
197
|
+
super("[graphorin/memory] procedure induction requires a provider. ProceduralMemory.induce(...) needs an inducer to abstract values into variables; enable it with createMemory({ procedureInduction: { provider } }).", {
|
|
198
|
+
...options?.cause !== void 0 ? { cause: options.cause } : {},
|
|
199
|
+
hint: "Pass `procedureInduction: { provider }` to createMemory(...)."
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
//#endregion
|
|
205
|
+
export { EmbedderMigrationAbortedError, EmbedderMigrationLockedError, EmbedderMigrationStateError, EmbedderRegistrationError, GraphorinMemoryError, MemoryToolDeniedError, ProcedureInductionNotConfiguredError, QuarantinePromotionRefusedError, WorkingBlockOverflowError, WorkingBlockReadOnlyError, WorkingBlockReplaceMismatchError };
|
|
206
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/errors/index.ts"],"sourcesContent":["/**\n * Typed error classes raised by `@graphorin/memory`. Every memory\n * subsystem throws one of these instead of plain `Error` so consumers\n * can pattern-match on `kind` and `name` without parsing the message.\n *\n * @packageDocumentation\n */\n\n/**\n * Base class for every error raised by `@graphorin/memory`. Carries a\n * stable lowercase `kind` discriminator and an optional `hint`\n * surfaced to operators (CLI command / docs link to fix the issue).\n *\n * @stable\n */\nexport abstract class GraphorinMemoryError extends Error {\n /** Stable lowercase discriminator. */\n abstract readonly kind: string;\n /** Optional actionable hint surfaced to operators. */\n readonly hint?: string;\n\n constructor(message: string, options?: { cause?: unknown; hint?: string }) {\n super(message, options !== undefined && 'cause' in options ? { cause: options.cause } : {});\n if (options?.hint !== undefined) {\n this.hint = options.hint;\n }\n }\n}\n\n/**\n * Raised when a memory write would reference an embedder that is not\n * registered in the storage layer's `embedding_meta` registry.\n *\n * @stable\n */\nexport class EmbedderRegistrationError extends GraphorinMemoryError {\n override readonly name = 'EmbedderRegistrationError';\n readonly kind = 'embedder-registration' as const;\n readonly embedderId: string;\n\n constructor(embedderId: string, options?: { cause?: unknown }) {\n super(\n `[graphorin/memory] embedder '${embedderId}' is not registered. ` +\n 'createMemory({ embedder, ... }) registers the configured embedder; ' +\n 'manual writes must reference an already-registered embedder_id.',\n {\n ...(options?.cause !== undefined ? { cause: options.cause } : {}),\n hint: 'Pass `embedder` to createMemory(...) so the registration runs at startup.',\n },\n );\n this.embedderId = embedderId;\n }\n}\n\n/**\n * Raised when a memory tool is invoked outside the per-tool ACL or the\n * memory-modification guard tier rejects the call.\n *\n * @stable\n */\nexport class MemoryToolDeniedError extends GraphorinMemoryError {\n override readonly name = 'MemoryToolDeniedError';\n readonly kind = 'memory-tool-denied' as const;\n readonly toolName: string;\n readonly reason: string;\n\n constructor(toolName: string, reason: string) {\n super(`[graphorin/memory] memory tool '${toolName}' was denied: ${reason}`, {\n hint: 'Check the tool authorisation matrix and the memory-modification guard tier policy.',\n });\n this.toolName = toolName;\n this.reason = reason;\n }\n}\n\n/**\n * Raised by `WorkingMemory` when a write would exceed the declared\n * `charLimit` and the overflow policy is `'reject'`.\n *\n * @stable\n */\nexport class WorkingBlockOverflowError extends GraphorinMemoryError {\n override readonly name = 'WorkingBlockOverflowError';\n readonly kind = 'working-block-overflow' as const;\n readonly label: string;\n readonly attempted: number;\n readonly charLimit: number;\n\n constructor(label: string, attempted: number, charLimit: number) {\n super(\n `[graphorin/memory] working block '${label}' overflow: attempted ${attempted} chars, limit is ${charLimit}.`,\n {\n hint: \"Switch the block's overflow policy to 'truncate' or shorten the input.\",\n },\n );\n this.label = label;\n this.attempted = attempted;\n this.charLimit = charLimit;\n }\n}\n\n/**\n * Raised by `WorkingMemory.replace(...)` when the supplied unique\n * substring is not present (or appears more than once) in the block\n * value.\n *\n * @stable\n */\nexport class WorkingBlockReplaceMismatchError extends GraphorinMemoryError {\n override readonly name = 'WorkingBlockReplaceMismatchError';\n readonly kind = 'working-block-replace-mismatch' as const;\n readonly label: string;\n readonly occurrences: number;\n\n constructor(label: string, occurrences: number) {\n super(\n `[graphorin/memory] block_replace on '${label}' expected exactly one occurrence of the unique substring, found ${occurrences}.`,\n {\n hint: 'Pass a longer unique substring or use block_rethink to replace the entire value.',\n },\n );\n this.label = label;\n this.occurrences = occurrences;\n }\n}\n\n/**\n * Thrown when any mutation targets a block defined with\n * `readOnly: true` (MRET-14). Previously this guard threw\n * `WorkingBlockReplaceMismatchError(label, 0)` — semantically \"your\n * unique substring matched 0 times\", which misled callers that retry\n * replace operations on mismatch.\n *\n * @stable\n */\nexport class WorkingBlockReadOnlyError extends GraphorinMemoryError {\n override readonly name = 'WorkingBlockReadOnlyError';\n readonly kind = 'working-block-read-only' as const;\n readonly label: string;\n\n constructor(label: string) {\n super(`[graphorin/memory] block '${label}' is read-only — mutations are not allowed.`, {\n hint: 'Define the block without readOnly, or write through an operator path that redefines it.',\n });\n this.label = label;\n }\n}\n\n/**\n * Raised by the embedder migration runner when the operator attempts a\n * silent embedder swap under the `lock-on-first` policy.\n *\n * @stable\n */\nexport class EmbedderMigrationLockedError extends GraphorinMemoryError {\n override readonly name = 'EmbedderMigrationLockedError';\n readonly kind = 'embedder-migration-locked' as const;\n readonly source: string;\n readonly target: string;\n\n constructor(source: string, target: string) {\n super(\n `[graphorin/memory] cannot swap embedder from '${source}' to '${target}' under the 'lock-on-first' policy. ` +\n 'Run `graphorin memory migrate` (Phase 15) or pass `policy: \"auto-migrate\"` / \"multi-active\".',\n {\n hint: 'Plan an explicit migration before swapping the active embedder.',\n },\n );\n this.source = source;\n this.target = target;\n }\n}\n\n/**\n * Raised by `migrateEmbedder(...)` when the runner is interrupted via\n * `AbortSignal`. The surrounding `for-await` loop receives this error so\n * the operator can re-run the migration. MST-12: there is no persisted\n * cursor today, so a re-run restarts from the beginning.\n *\n * @stable\n */\nexport class EmbedderMigrationAbortedError extends GraphorinMemoryError {\n override readonly name = 'EmbedderMigrationAbortedError';\n readonly kind = 'embedder-migration-aborted' as const;\n readonly migrationId: string;\n\n constructor(migrationId: string) {\n super(\n `[graphorin/memory] embedder migration '${migrationId}' aborted before completion. ` +\n 'Re-run `migrateEmbedder(...)` to restart (there is no persisted cursor yet, so it begins again).',\n {\n hint: 'Re-invoke migrateEmbedder(...) to restart the migration.',\n },\n );\n this.migrationId = migrationId;\n }\n}\n\n/**\n * Raised by the migration runner when the migration references embedders\n * that are no longer registered (e.g. the operator removed the underlying\n * tables manually).\n *\n * @stable\n */\nexport class EmbedderMigrationStateError extends GraphorinMemoryError {\n override readonly name = 'EmbedderMigrationStateError';\n readonly kind = 'embedder-migration-state' as const;\n\n constructor(message: string) {\n super(`[graphorin/memory] ${message}`, {\n hint: 'Re-register the source/target embedders (or re-run with the current ones) before retrying.',\n });\n }\n}\n\n/**\n * Raised by {@link SemanticMemory.validate} (P1-4 / MRET-3) when a caller\n * tries to promote a fact whose quarantine was triggered by the offline\n * injection heuristics. Such a fact is a memory-poisoning candidate: the\n * agent's own `fact_validate` tool must never be able to admit it into\n * action-driving recall, so promotion is refused unless an operator\n * passes the explicit `force` flag through the programmatic API.\n *\n * @stable\n */\nexport class QuarantinePromotionRefusedError extends GraphorinMemoryError {\n override readonly name = 'QuarantinePromotionRefusedError';\n readonly kind = 'quarantine-promotion-refused' as const;\n readonly factId: string;\n /** Injection-rule labels that tripped on the fact's text. */\n readonly markers: ReadonlyArray<string>;\n\n constructor(factId: string, markers: ReadonlyArray<string>) {\n super(\n `[graphorin/memory] refusing to promote fact '${factId}' out of quarantine: ` +\n `its text trips the injection heuristics (${markers.join(', ')}). ` +\n 'Promotion of an injection-flagged memory is an operator action — ' +\n 'pass `{ force: true }` to validate(...) from a trusted (non-agent) caller after review.',\n {\n hint: 'Review the quarantined fact, then promote it with validate(scope, id, reason, { force: true }) from an operator context.',\n },\n );\n this.factId = factId;\n this.markers = Object.freeze([...markers]);\n }\n}\n\n/**\n * Raised when {@link ProceduralMemory.induce} (P2-2) is called but no\n * workflow inducer was configured. Induction abstracts concrete values into\n * variables, which needs a provider — so the capability is opt-in and the\n * default (offline) procedural tier never silently no-ops a requested\n * induction.\n *\n * @stable\n */\nexport class ProcedureInductionNotConfiguredError extends GraphorinMemoryError {\n override readonly name = 'ProcedureInductionNotConfiguredError';\n readonly kind = 'procedure-induction-not-configured' as const;\n\n constructor(options?: { cause?: unknown }) {\n super(\n '[graphorin/memory] procedure induction requires a provider. ' +\n 'ProceduralMemory.induce(...) needs an inducer to abstract values into ' +\n 'variables; enable it with createMemory({ procedureInduction: { provider } }).',\n {\n ...(options?.cause !== undefined ? { cause: options.cause } : {}),\n hint: 'Pass `procedureInduction: { provider }` to createMemory(...).',\n },\n );\n }\n}\n"],"mappings":"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"}
|