@diyor28/context 1.0.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/README.md +270 -0
- package/dist/__tests__/attachment-selector.test.d.ts +11 -0
- package/dist/__tests__/attachment-selector.test.d.ts.map +1 -0
- package/dist/__tests__/attachment-selector.test.js +449 -0
- package/dist/__tests__/attachment-selector.test.js.map +1 -0
- package/dist/__tests__/cache-breakpoints.test.d.ts +11 -0
- package/dist/__tests__/cache-breakpoints.test.d.ts.map +1 -0
- package/dist/__tests__/cache-breakpoints.test.js +398 -0
- package/dist/__tests__/cache-breakpoints.test.js.map +1 -0
- package/dist/__tests__/codecs.test.d.ts +7 -0
- package/dist/__tests__/codecs.test.d.ts.map +1 -0
- package/dist/__tests__/codecs.test.js +331 -0
- package/dist/__tests__/codecs.test.js.map +1 -0
- package/dist/__tests__/compactor.test.d.ts +11 -0
- package/dist/__tests__/compactor.test.d.ts.map +1 -0
- package/dist/__tests__/compactor.test.js +519 -0
- package/dist/__tests__/compactor.test.js.map +1 -0
- package/dist/__tests__/context-graph.test.d.ts +7 -0
- package/dist/__tests__/context-graph.test.d.ts.map +1 -0
- package/dist/__tests__/context-graph.test.js +262 -0
- package/dist/__tests__/context-graph.test.js.map +1 -0
- package/dist/__tests__/hash.test.d.ts +7 -0
- package/dist/__tests__/hash.test.d.ts.map +1 -0
- package/dist/__tests__/hash.test.js +228 -0
- package/dist/__tests__/hash.test.js.map +1 -0
- package/dist/__tests__/integration.test.d.ts +15 -0
- package/dist/__tests__/integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration.test.js +728 -0
- package/dist/__tests__/integration.test.js.map +1 -0
- package/dist/__tests__/kind-order.test.d.ts +7 -0
- package/dist/__tests__/kind-order.test.d.ts.map +1 -0
- package/dist/__tests__/kind-order.test.js +243 -0
- package/dist/__tests__/kind-order.test.js.map +1 -0
- package/dist/__tests__/phase2-integration.test.d.ts +5 -0
- package/dist/__tests__/phase2-integration.test.d.ts.map +1 -0
- package/dist/__tests__/phase2-integration.test.js +222 -0
- package/dist/__tests__/phase2-integration.test.js.map +1 -0
- package/dist/__tests__/queries.test.d.ts +7 -0
- package/dist/__tests__/queries.test.d.ts.map +1 -0
- package/dist/__tests__/queries.test.js +254 -0
- package/dist/__tests__/queries.test.js.map +1 -0
- package/dist/__tests__/token-estimator.test.d.ts +7 -0
- package/dist/__tests__/token-estimator.test.d.ts.map +1 -0
- package/dist/__tests__/token-estimator.test.js +267 -0
- package/dist/__tests__/token-estimator.test.js.map +1 -0
- package/dist/adapters/anthropic-estimator.d.ts +38 -0
- package/dist/adapters/anthropic-estimator.d.ts.map +1 -0
- package/dist/adapters/anthropic-estimator.js +108 -0
- package/dist/adapters/anthropic-estimator.js.map +1 -0
- package/dist/adapters/attachment-resolver.d.ts +96 -0
- package/dist/adapters/attachment-resolver.d.ts.map +1 -0
- package/dist/adapters/attachment-resolver.js +176 -0
- package/dist/adapters/attachment-resolver.js.map +1 -0
- package/dist/adapters/attachment-selector.d.ts +59 -0
- package/dist/adapters/attachment-selector.d.ts.map +1 -0
- package/dist/adapters/attachment-selector.js +163 -0
- package/dist/adapters/attachment-selector.js.map +1 -0
- package/dist/adapters/gemini-estimator.d.ts +27 -0
- package/dist/adapters/gemini-estimator.d.ts.map +1 -0
- package/dist/adapters/gemini-estimator.js +80 -0
- package/dist/adapters/gemini-estimator.js.map +1 -0
- package/dist/adapters/index.d.ts +12 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +28 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/memory-store.d.ts +139 -0
- package/dist/adapters/memory-store.d.ts.map +1 -0
- package/dist/adapters/memory-store.js +187 -0
- package/dist/adapters/memory-store.js.map +1 -0
- package/dist/adapters/openai-estimator.d.ts +35 -0
- package/dist/adapters/openai-estimator.d.ts.map +1 -0
- package/dist/adapters/openai-estimator.js +89 -0
- package/dist/adapters/openai-estimator.js.map +1 -0
- package/dist/adapters/summarizer.d.ts +121 -0
- package/dist/adapters/summarizer.d.ts.map +1 -0
- package/dist/adapters/summarizer.js +121 -0
- package/dist/adapters/summarizer.js.map +1 -0
- package/dist/adapters/token-estimator.d.ts +63 -0
- package/dist/adapters/token-estimator.d.ts.map +1 -0
- package/dist/adapters/token-estimator.js +37 -0
- package/dist/adapters/token-estimator.js.map +1 -0
- package/dist/builder/context-builder.d.ts +186 -0
- package/dist/builder/context-builder.d.ts.map +1 -0
- package/dist/builder/context-builder.js +305 -0
- package/dist/builder/context-builder.js.map +1 -0
- package/dist/builder/context-fork.d.ts +166 -0
- package/dist/builder/context-fork.d.ts.map +1 -0
- package/dist/builder/context-fork.js +282 -0
- package/dist/builder/context-fork.js.map +1 -0
- package/dist/builder/index.d.ts +6 -0
- package/dist/builder/index.d.ts.map +1 -0
- package/dist/builder/index.js +22 -0
- package/dist/builder/index.js.map +1 -0
- package/dist/codecs/base.d.ts +18 -0
- package/dist/codecs/base.d.ts.map +1 -0
- package/dist/codecs/base.js +39 -0
- package/dist/codecs/base.js.map +1 -0
- package/dist/codecs/conversation-history.codec.d.ts +81 -0
- package/dist/codecs/conversation-history.codec.d.ts.map +1 -0
- package/dist/codecs/conversation-history.codec.js +89 -0
- package/dist/codecs/conversation-history.codec.js.map +1 -0
- package/dist/codecs/index.d.ts +31 -0
- package/dist/codecs/index.d.ts.map +1 -0
- package/dist/codecs/index.js +71 -0
- package/dist/codecs/index.js.map +1 -0
- package/dist/codecs/redacted-stub.codec.d.ts +32 -0
- package/dist/codecs/redacted-stub.codec.d.ts.map +1 -0
- package/dist/codecs/redacted-stub.codec.js +64 -0
- package/dist/codecs/redacted-stub.codec.js.map +1 -0
- package/dist/codecs/structured-reference.codec.d.ts +40 -0
- package/dist/codecs/structured-reference.codec.d.ts.map +1 -0
- package/dist/codecs/structured-reference.codec.js +81 -0
- package/dist/codecs/structured-reference.codec.js.map +1 -0
- package/dist/codecs/system-rules.codec.d.ts +32 -0
- package/dist/codecs/system-rules.codec.d.ts.map +1 -0
- package/dist/codecs/system-rules.codec.js +62 -0
- package/dist/codecs/system-rules.codec.js.map +1 -0
- package/dist/codecs/tool-output.codec.d.ts +66 -0
- package/dist/codecs/tool-output.codec.d.ts.map +1 -0
- package/dist/codecs/tool-output.codec.js +95 -0
- package/dist/codecs/tool-output.codec.js.map +1 -0
- package/dist/codecs/tool-schema.codec.d.ts +36 -0
- package/dist/codecs/tool-schema.codec.d.ts.map +1 -0
- package/dist/codecs/tool-schema.codec.js +74 -0
- package/dist/codecs/tool-schema.codec.js.map +1 -0
- package/dist/codecs/unsafe-text.codec.d.ts +28 -0
- package/dist/codecs/unsafe-text.codec.d.ts.map +1 -0
- package/dist/codecs/unsafe-text.codec.js +63 -0
- package/dist/codecs/unsafe-text.codec.js.map +1 -0
- package/dist/graph/context-graph.d.ts +121 -0
- package/dist/graph/context-graph.d.ts.map +1 -0
- package/dist/graph/context-graph.js +166 -0
- package/dist/graph/context-graph.js.map +1 -0
- package/dist/graph/index.d.ts +8 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +24 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/kind-order.d.ts +60 -0
- package/dist/graph/kind-order.d.ts.map +1 -0
- package/dist/graph/kind-order.js +113 -0
- package/dist/graph/kind-order.js.map +1 -0
- package/dist/graph/queries.d.ts +68 -0
- package/dist/graph/queries.d.ts.map +1 -0
- package/dist/graph/queries.js +240 -0
- package/dist/graph/queries.js.map +1 -0
- package/dist/graph/views.d.ts +90 -0
- package/dist/graph/views.d.ts.map +1 -0
- package/dist/graph/views.js +173 -0
- package/dist/graph/views.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/pipeline/compactor.d.ts +128 -0
- package/dist/pipeline/compactor.d.ts.map +1 -0
- package/dist/pipeline/compactor.js +346 -0
- package/dist/pipeline/compactor.js.map +1 -0
- package/dist/pipeline/index.d.ts +6 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +22 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/summarizer.d.ts +18 -0
- package/dist/pipeline/summarizer.d.ts.map +1 -0
- package/dist/pipeline/summarizer.js +68 -0
- package/dist/pipeline/summarizer.js.map +1 -0
- package/dist/policies/default-policy.d.ts +29 -0
- package/dist/policies/default-policy.d.ts.map +1 -0
- package/dist/policies/default-policy.js +58 -0
- package/dist/policies/default-policy.js.map +1 -0
- package/dist/policies/index.d.ts +5 -0
- package/dist/policies/index.d.ts.map +1 -0
- package/dist/policies/index.js +21 -0
- package/dist/policies/index.js.map +1 -0
- package/dist/providers/anthropic-compiler.d.ts +58 -0
- package/dist/providers/anthropic-compiler.d.ts.map +1 -0
- package/dist/providers/anthropic-compiler.js +182 -0
- package/dist/providers/anthropic-compiler.js.map +1 -0
- package/dist/providers/capabilities.d.ts +54 -0
- package/dist/providers/capabilities.d.ts.map +1 -0
- package/dist/providers/capabilities.js +87 -0
- package/dist/providers/capabilities.js.map +1 -0
- package/dist/providers/gemini-compiler.d.ts +51 -0
- package/dist/providers/gemini-compiler.d.ts.map +1 -0
- package/dist/providers/gemini-compiler.js +206 -0
- package/dist/providers/gemini-compiler.js.map +1 -0
- package/dist/providers/index.d.ts +8 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +24 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/openai-compiler.d.ts +46 -0
- package/dist/providers/openai-compiler.d.ts.map +1 -0
- package/dist/providers/openai-compiler.js +149 -0
- package/dist/providers/openai-compiler.js.map +1 -0
- package/dist/types/attachment.d.ts +62 -0
- package/dist/types/attachment.d.ts.map +1 -0
- package/dist/types/attachment.js +6 -0
- package/dist/types/attachment.js.map +1 -0
- package/dist/types/block.d.ts +61 -0
- package/dist/types/block.d.ts.map +1 -0
- package/dist/types/block.js +8 -0
- package/dist/types/block.js.map +1 -0
- package/dist/types/codec.d.ts +58 -0
- package/dist/types/codec.d.ts.map +1 -0
- package/dist/types/codec.js +6 -0
- package/dist/types/codec.js.map +1 -0
- package/dist/types/compiled.d.ts +91 -0
- package/dist/types/compiled.d.ts.map +1 -0
- package/dist/types/compiled.js +6 -0
- package/dist/types/compiled.js.map +1 -0
- package/dist/types/hash.d.ts +24 -0
- package/dist/types/hash.d.ts.map +1 -0
- package/dist/types/hash.js +49 -0
- package/dist/types/hash.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +26 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/policy.d.ts +128 -0
- package/dist/types/policy.d.ts.map +1 -0
- package/dist/types/policy.js +55 -0
- package/dist/types/policy.js.map +1 -0
- package/package.json +55 -0
- package/postcss.config.js +4 -0
- package/src/__tests__/attachment-selector.test.ts +559 -0
- package/src/__tests__/cache-breakpoints.test.ts +566 -0
- package/src/__tests__/codecs.test.ts +417 -0
- package/src/__tests__/compactor.test.ts +608 -0
- package/src/__tests__/context-graph.test.ts +383 -0
- package/src/__tests__/hash.test.ts +274 -0
- package/src/__tests__/integration.test.ts +866 -0
- package/src/__tests__/kind-order.test.ts +312 -0
- package/src/__tests__/phase2-integration.test.ts +253 -0
- package/src/__tests__/queries.test.ts +387 -0
- package/src/__tests__/token-estimator.test.ts +326 -0
- package/src/adapters/anthropic-estimator.ts +125 -0
- package/src/adapters/attachment-resolver.ts +295 -0
- package/src/adapters/attachment-selector.ts +218 -0
- package/src/adapters/gemini-estimator.ts +93 -0
- package/src/adapters/index.ts +12 -0
- package/src/adapters/memory-store.ts +299 -0
- package/src/adapters/openai-estimator.ts +105 -0
- package/src/adapters/summarizer.ts +250 -0
- package/src/adapters/token-estimator.ts +74 -0
- package/src/builder/context-builder.ts +467 -0
- package/src/builder/context-fork.ts +471 -0
- package/src/builder/index.ts +6 -0
- package/src/codecs/base.ts +36 -0
- package/src/codecs/conversation-history.codec.ts +108 -0
- package/src/codecs/index.ts +57 -0
- package/src/codecs/redacted-stub.codec.ts +76 -0
- package/src/codecs/structured-reference.codec.ts +96 -0
- package/src/codecs/system-rules.codec.ts +74 -0
- package/src/codecs/tool-output.codec.ts +109 -0
- package/src/codecs/tool-schema.codec.ts +87 -0
- package/src/codecs/unsafe-text.codec.ts +74 -0
- package/src/graph/context-graph.ts +205 -0
- package/src/graph/index.ts +8 -0
- package/src/graph/kind-order.ts +125 -0
- package/src/graph/queries.ts +306 -0
- package/src/graph/views.ts +255 -0
- package/src/index.ts +31 -0
- package/src/pipeline/compactor.ts +563 -0
- package/src/pipeline/index.ts +6 -0
- package/src/pipeline/summarizer.ts +76 -0
- package/src/policies/default-policy.ts +69 -0
- package/src/policies/index.ts +5 -0
- package/src/providers/anthropic-compiler.ts +294 -0
- package/src/providers/capabilities.ts +144 -0
- package/src/providers/gemini-compiler.ts +272 -0
- package/src/providers/index.ts +8 -0
- package/src/providers/openai-compiler.ts +191 -0
- package/src/types/attachment.ts +86 -0
- package/src/types/block.ts +84 -0
- package/src/types/codec.ts +68 -0
- package/src/types/compiled.ts +109 -0
- package/src/types/hash.ts +58 -0
- package/src/types/index.ts +10 -0
- package/src/types/policy.ts +194 -0
- package/tsconfig.json +21 -0
- package/vitest.config.ts +21 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ContextView: Immutable, deterministically-ordered snapshot of context blocks.
|
|
4
|
+
*
|
|
5
|
+
* Views provide stable ordering (KIND_ORDER + lexicographic) and token estimation.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.sortBlocksDeterministic = sortBlocksDeterministic;
|
|
9
|
+
exports.computeStablePrefixHash = computeStablePrefixHash;
|
|
10
|
+
exports.createContextView = createContextView;
|
|
11
|
+
exports.viewsEqual = viewsEqual;
|
|
12
|
+
exports.mergeViews = mergeViews;
|
|
13
|
+
const crypto_1 = require("crypto");
|
|
14
|
+
const kind_order_js_1 = require("./kind-order.js");
|
|
15
|
+
/**
|
|
16
|
+
* Sort blocks deterministically by KIND_ORDER + lexicographic.
|
|
17
|
+
*
|
|
18
|
+
* @param blocks - Blocks to sort
|
|
19
|
+
* @returns Sorted blocks (new array)
|
|
20
|
+
*/
|
|
21
|
+
function sortBlocksDeterministic(blocks) {
|
|
22
|
+
return [...blocks].sort((a, b) => {
|
|
23
|
+
// Primary: KIND_ORDER
|
|
24
|
+
const kindCmp = (0, kind_order_js_1.compareKinds)(a.meta.kind, b.meta.kind);
|
|
25
|
+
if (kindCmp !== 0) {
|
|
26
|
+
return kindCmp;
|
|
27
|
+
}
|
|
28
|
+
// Secondary: Lexicographic by blockHash
|
|
29
|
+
return a.blockHash.localeCompare(b.blockHash);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Compute stable prefix hash from ordered block hashes.
|
|
34
|
+
*
|
|
35
|
+
* @param blocks - Ordered blocks
|
|
36
|
+
* @returns Hex-encoded SHA-256 hash
|
|
37
|
+
*/
|
|
38
|
+
function computeStablePrefixHash(blocks) {
|
|
39
|
+
// Concatenate block hashes in order
|
|
40
|
+
const concatenated = blocks.map((b) => b.blockHash).join('|');
|
|
41
|
+
// Compute SHA-256 hash
|
|
42
|
+
const hash = (0, crypto_1.createHash)('sha256')
|
|
43
|
+
.update(concatenated)
|
|
44
|
+
.digest('hex');
|
|
45
|
+
return hash;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Apply token budget to blocks (truncate if needed).
|
|
49
|
+
* Returns blocks that fit within budget + estimation metadata.
|
|
50
|
+
*
|
|
51
|
+
* @param blocks - Ordered blocks
|
|
52
|
+
* @param estimator - Token estimator
|
|
53
|
+
* @param maxTokens - Maximum token budget
|
|
54
|
+
* @returns Truncated blocks + estimation result
|
|
55
|
+
*/
|
|
56
|
+
async function applyTokenBudget(blocks, estimator, maxTokens) {
|
|
57
|
+
let totalTokens = 0;
|
|
58
|
+
let lowestConfidence = 'exact';
|
|
59
|
+
const includedBlocks = [];
|
|
60
|
+
for (const block of blocks) {
|
|
61
|
+
// Estimate tokens for this block
|
|
62
|
+
const blockEstimate = await estimator.estimateBlock(block);
|
|
63
|
+
const projectedTotal = totalTokens + blockEstimate.tokens;
|
|
64
|
+
// Check if adding this block would exceed budget
|
|
65
|
+
if (projectedTotal > maxTokens) {
|
|
66
|
+
// Budget exceeded - stop here
|
|
67
|
+
return {
|
|
68
|
+
blocks: includedBlocks,
|
|
69
|
+
estimate: {
|
|
70
|
+
tokens: totalTokens,
|
|
71
|
+
confidence: lowestConfidence,
|
|
72
|
+
truncated: true,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
// Include block
|
|
77
|
+
includedBlocks.push(block);
|
|
78
|
+
totalTokens += blockEstimate.tokens;
|
|
79
|
+
// Track lowest confidence
|
|
80
|
+
if (blockEstimate.confidence === 'low') {
|
|
81
|
+
lowestConfidence = 'low';
|
|
82
|
+
}
|
|
83
|
+
else if (blockEstimate.confidence === 'high' && lowestConfidence === 'exact') {
|
|
84
|
+
lowestConfidence = 'high';
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
// All blocks fit within budget
|
|
88
|
+
return {
|
|
89
|
+
blocks: includedBlocks,
|
|
90
|
+
estimate: {
|
|
91
|
+
tokens: totalTokens,
|
|
92
|
+
confidence: lowestConfidence,
|
|
93
|
+
truncated: false,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Create a ContextView from a graph and options.
|
|
99
|
+
*
|
|
100
|
+
* @param graph - Context graph
|
|
101
|
+
* @param options - View options
|
|
102
|
+
* @returns ContextView
|
|
103
|
+
*/
|
|
104
|
+
async function createContextView(graph, options) {
|
|
105
|
+
// Select blocks matching query
|
|
106
|
+
const query = options.query ?? {};
|
|
107
|
+
let selectedBlocks = graph.select(query);
|
|
108
|
+
// Sort blocks deterministically
|
|
109
|
+
selectedBlocks = sortBlocksDeterministic(selectedBlocks);
|
|
110
|
+
// Apply token budget if provided
|
|
111
|
+
let tokenEstimate;
|
|
112
|
+
if (options.tokenEstimator && options.maxTokens !== undefined) {
|
|
113
|
+
const result = await applyTokenBudget(selectedBlocks, options.tokenEstimator, options.maxTokens);
|
|
114
|
+
selectedBlocks = result.blocks;
|
|
115
|
+
tokenEstimate = result.estimate;
|
|
116
|
+
}
|
|
117
|
+
else if (options.tokenEstimator) {
|
|
118
|
+
// Estimate without budget enforcement
|
|
119
|
+
const estimate = await options.tokenEstimator.estimate(selectedBlocks);
|
|
120
|
+
tokenEstimate = {
|
|
121
|
+
tokens: estimate.tokens,
|
|
122
|
+
confidence: estimate.confidence,
|
|
123
|
+
truncated: false,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
// Compute stable prefix hash
|
|
127
|
+
const stablePrefixHash = computeStablePrefixHash(selectedBlocks);
|
|
128
|
+
return {
|
|
129
|
+
blocks: selectedBlocks,
|
|
130
|
+
tokenEstimate,
|
|
131
|
+
stablePrefixHash,
|
|
132
|
+
createdAt: Math.floor(Date.now() / 1000),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Check if two views have identical content (same blocks in same order).
|
|
137
|
+
*
|
|
138
|
+
* @param a - First view
|
|
139
|
+
* @param b - Second view
|
|
140
|
+
* @returns True if views have identical content
|
|
141
|
+
*/
|
|
142
|
+
function viewsEqual(a, b) {
|
|
143
|
+
return a.stablePrefixHash === b.stablePrefixHash;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Merge multiple views into a single view (preserves ordering).
|
|
147
|
+
* Deduplicates blocks by hash.
|
|
148
|
+
*
|
|
149
|
+
* @param views - Views to merge
|
|
150
|
+
* @returns Merged view
|
|
151
|
+
*/
|
|
152
|
+
function mergeViews(...views) {
|
|
153
|
+
const seenHashes = new Set();
|
|
154
|
+
const mergedBlocks = [];
|
|
155
|
+
for (const view of views) {
|
|
156
|
+
for (const block of view.blocks) {
|
|
157
|
+
if (!seenHashes.has(block.blockHash)) {
|
|
158
|
+
seenHashes.add(block.blockHash);
|
|
159
|
+
mergedBlocks.push(block);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// Re-sort merged blocks
|
|
164
|
+
const sortedBlocks = sortBlocksDeterministic(mergedBlocks);
|
|
165
|
+
// Compute new prefix hash
|
|
166
|
+
const stablePrefixHash = computeStablePrefixHash(sortedBlocks);
|
|
167
|
+
return {
|
|
168
|
+
blocks: sortedBlocks,
|
|
169
|
+
stablePrefixHash,
|
|
170
|
+
createdAt: Math.floor(Date.now() / 1000),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.js","sourceRoot":"","sources":["../../src/graph/views.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAmEH,0DAaC;AAQD,0DAUC;AAoED,8CAwCC;AASD,gCAEC;AASD,gCAwBC;AAxPD,mCAAoC;AAKpC,mDAA+C;AAsD/C;;;;;GAKG;AACH,SAAgB,uBAAuB,CACrC,MAA+B;IAE/B,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC/B,sBAAsB;QACtB,MAAM,OAAO,GAAG,IAAA,4BAAY,EAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvD,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;YAClB,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,wCAAwC;QACxC,OAAO,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAgB,uBAAuB,CA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& Codecs
|
|
5
|
+
* Phase 2: Context Graph & Token Estimation
|
|
6
|
+
* Phase 3: Builder & Compilation Pipeline
|
|
7
|
+
*/
|
|
8
|
+
export * from './types/index.js';
|
|
9
|
+
export * from './graph/index.js';
|
|
10
|
+
export * from './codecs/index.js';
|
|
11
|
+
export * from './adapters/index.js';
|
|
12
|
+
export * from './builder/index.js';
|
|
13
|
+
export * from './pipeline/index.js';
|
|
14
|
+
export * from './providers/index.js';
|
|
15
|
+
export * from './policies/index.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @foundry/context - Context management library for LLM conversations
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: Core Types & Codecs
|
|
6
|
+
* Phase 2: Context Graph & Token Estimation
|
|
7
|
+
* Phase 3: Builder & Compilation Pipeline
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
// Core types
|
|
25
|
+
__exportStar(require("./types/index.js"), exports);
|
|
26
|
+
// Graph utilities (KIND_ORDER, ContextGraph, queries, views)
|
|
27
|
+
__exportStar(require("./graph/index.js"), exports);
|
|
28
|
+
// Built-in codecs
|
|
29
|
+
__exportStar(require("./codecs/index.js"), exports);
|
|
30
|
+
// Token estimators
|
|
31
|
+
__exportStar(require("./adapters/index.js"), exports);
|
|
32
|
+
// Context builder (Phase 3)
|
|
33
|
+
__exportStar(require("./builder/index.js"), exports);
|
|
34
|
+
// Pipeline utilities (compaction, fork)
|
|
35
|
+
__exportStar(require("./pipeline/index.js"), exports);
|
|
36
|
+
// Provider compilers
|
|
37
|
+
__exportStar(require("./providers/index.js"), exports);
|
|
38
|
+
// Policy configurations
|
|
39
|
+
__exportStar(require("./policies/index.js"), exports);
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;AAEH,aAAa;AACb,mDAAiC;AAEjC,6DAA6D;AAC7D,mDAAiC;AAEjC,kBAAkB;AAClB,oDAAkC;AAElC,mBAAmB;AACnB,sDAAoC;AAEpC,4BAA4B;AAC5B,qDAAmC;AAEnC,wCAAwC;AACxC,sDAAoC;AAEpC,qBAAqB;AACrB,uDAAqC;AAErC,wBAAwB;AACxB,sDAAoC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compactor: View-based context compaction with provenance tracking.
|
|
3
|
+
*
|
|
4
|
+
* Responsibilities:
|
|
5
|
+
* - Prune tool outputs (keep errors, truncate large outputs)
|
|
6
|
+
* - Deduplicate identical blocks
|
|
7
|
+
* - Trim conversation history (keep recent + errors)
|
|
8
|
+
* - Summarize history (optional, needs Summarizer)
|
|
9
|
+
*
|
|
10
|
+
* IMPORTANT: View-based compaction never mutates the input graph.
|
|
11
|
+
* Creates replacement blocks with full provenance (derivedFrom, method, version).
|
|
12
|
+
*/
|
|
13
|
+
import type { ContextBlock } from '../types/block.js';
|
|
14
|
+
import type { ContextView } from '../graph/views.js';
|
|
15
|
+
import type { TokenEstimator } from '../adapters/token-estimator.js';
|
|
16
|
+
/**
|
|
17
|
+
* Compaction step identifier.
|
|
18
|
+
*/
|
|
19
|
+
export type CompactionStep = 'dedupe' | 'tool_output_prune' | 'history_trim' | 'summarize_history';
|
|
20
|
+
/**
|
|
21
|
+
* History compaction summarizer interface.
|
|
22
|
+
* Implementations use LLM to condense old conversation history.
|
|
23
|
+
*
|
|
24
|
+
* Note: This is different from the structured Summarizer in adapters/summarizer.ts
|
|
25
|
+
* which is designed for schema-validated outputs with provenance tracking.
|
|
26
|
+
*/
|
|
27
|
+
export interface HistorySummarizer {
|
|
28
|
+
/**
|
|
29
|
+
* Summarize a list of history blocks into a single summary block.
|
|
30
|
+
*
|
|
31
|
+
* @param blocks - History blocks to summarize
|
|
32
|
+
* @param targetTokens - Target token count for summary
|
|
33
|
+
* @returns Summary block replacing the input blocks
|
|
34
|
+
*/
|
|
35
|
+
summarize(blocks: ContextBlock[], targetTokens: number): Promise<ContextBlock>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Tool output pruning configuration.
|
|
39
|
+
*/
|
|
40
|
+
export interface ToolOutputPruningConfig {
|
|
41
|
+
/** Maximum raw tail characters to keep (default: 500) */
|
|
42
|
+
maxRawTailChars: number;
|
|
43
|
+
/** Preserve error tail even if large (default: true) */
|
|
44
|
+
preserveErrorTail: boolean;
|
|
45
|
+
/** Maximum outputs per tool type (default: 3) */
|
|
46
|
+
maxOutputsPerTool: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Compaction configuration for the pipeline.
|
|
50
|
+
*/
|
|
51
|
+
export interface PipelineCompactionConfig {
|
|
52
|
+
/** Compaction steps to apply (in order) */
|
|
53
|
+
steps: CompactionStep[];
|
|
54
|
+
/** Tool output pruning config */
|
|
55
|
+
toolOutputPruning?: ToolOutputPruningConfig;
|
|
56
|
+
/** History trim config */
|
|
57
|
+
historyTrim?: {
|
|
58
|
+
/** Keep most recent N messages */
|
|
59
|
+
keepRecentMessages: number;
|
|
60
|
+
/** Always keep messages with errors */
|
|
61
|
+
keepErrorMessages: boolean;
|
|
62
|
+
};
|
|
63
|
+
/** Summarization config (optional, requires HistorySummarizer) */
|
|
64
|
+
summarization?: {
|
|
65
|
+
/** Minimum messages to trigger summarization */
|
|
66
|
+
minMessages: number;
|
|
67
|
+
/** Summarizer to use for history compaction */
|
|
68
|
+
summarizer?: HistorySummarizer;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Compaction result.
|
|
73
|
+
*/
|
|
74
|
+
export interface CompactionResult {
|
|
75
|
+
/** Compacted blocks (includes replacements) */
|
|
76
|
+
blocks: ContextBlock[];
|
|
77
|
+
/** Blocks that were removed */
|
|
78
|
+
removedBlocks: ContextBlock[];
|
|
79
|
+
/** Compaction report */
|
|
80
|
+
report: CompactionReport;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Compaction report with token savings and lossiness flags.
|
|
84
|
+
*/
|
|
85
|
+
export interface CompactionReport {
|
|
86
|
+
/** Tokens before compaction */
|
|
87
|
+
beforeTokens: number;
|
|
88
|
+
/** Tokens after compaction */
|
|
89
|
+
afterTokens: number;
|
|
90
|
+
/** Token savings */
|
|
91
|
+
savedTokens: number;
|
|
92
|
+
/** Compaction steps applied */
|
|
93
|
+
stepsApplied: CompactionStep[];
|
|
94
|
+
/** Step-specific reports */
|
|
95
|
+
stepReports: StepReport[];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Per-step compaction report.
|
|
99
|
+
*/
|
|
100
|
+
export interface StepReport {
|
|
101
|
+
/** Step identifier */
|
|
102
|
+
step: CompactionStep;
|
|
103
|
+
/** Blocks removed */
|
|
104
|
+
blocksRemoved: number;
|
|
105
|
+
/** Blocks replaced */
|
|
106
|
+
blocksReplaced: number;
|
|
107
|
+
/** Tokens saved */
|
|
108
|
+
tokensSaved: number;
|
|
109
|
+
/** Lossy compaction (information lost) */
|
|
110
|
+
lossy: boolean;
|
|
111
|
+
/** Human-readable description */
|
|
112
|
+
description: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Default tool output pruning configuration.
|
|
116
|
+
*/
|
|
117
|
+
export declare const DEFAULT_TOOL_OUTPUT_PRUNING: ToolOutputPruningConfig;
|
|
118
|
+
/**
|
|
119
|
+
* Compact a context view.
|
|
120
|
+
* Returns a new set of blocks with replacements tracked via provenance.
|
|
121
|
+
*
|
|
122
|
+
* @param view - Context view to compact
|
|
123
|
+
* @param config - Compaction configuration
|
|
124
|
+
* @param estimator - Token estimator for calculating savings
|
|
125
|
+
* @returns Compaction result
|
|
126
|
+
*/
|
|
127
|
+
export declare function compactView(view: ContextView, config: PipelineCompactionConfig, estimator: TokenEstimator): Promise<CompactionResult>;
|
|
128
|
+
//# sourceMappingURL=compactor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compactor.d.ts","sourceRoot":"","sources":["../../src/pipeline/compactor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,MAA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