@prometheus-ai/snapcompact 0.5.8
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 +50 -0
- package/README.md +70 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/snapcompact.d.ts +523 -0
- package/package.json +64 -0
- package/src/index.ts +1 -0
- package/src/prompts/file-operations.md +5 -0
- package/src/prompts/snapcompact-summary.md +24 -0
- package/src/snapcompact.ts +1290 -0
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "module",
|
|
3
|
+
"name": "@prometheus-ai/snapcompact",
|
|
4
|
+
"version": "0.5.8",
|
|
5
|
+
"description": "Bitmap-frame context compression for vision-capable LLMs",
|
|
6
|
+
"homepage": "https://prometheus.trivlab.com",
|
|
7
|
+
"author": "Uttam Trivedi",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/uttamtrivedi/Prometheus.git",
|
|
12
|
+
"directory": "packages/snapcompact"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/uttamtrivedi/Prometheus/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"context-compression",
|
|
19
|
+
"vision",
|
|
20
|
+
"compaction",
|
|
21
|
+
"llm"
|
|
22
|
+
],
|
|
23
|
+
"main": "./src/index.ts",
|
|
24
|
+
"types": "./dist/types/index.d.ts",
|
|
25
|
+
"scripts": {
|
|
26
|
+
"check": "biome check . && bun run check:types",
|
|
27
|
+
"check:types": "tsgo -p tsconfig.json --noEmit",
|
|
28
|
+
"lint": "biome lint .",
|
|
29
|
+
"test": "bun test --parallel",
|
|
30
|
+
"fix": "biome check --write --unsafe .",
|
|
31
|
+
"fmt": "biome format --write ."
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@prometheus-ai/ai": "0.5.8",
|
|
35
|
+
"@prometheus-ai/natives": "0.5.8",
|
|
36
|
+
"@prometheus-ai/utils": "0.5.8"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/bun": "^1.3.14"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"bun": ">=1.3.14"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"src",
|
|
46
|
+
"README.md",
|
|
47
|
+
"CHANGELOG.md",
|
|
48
|
+
"dist/types"
|
|
49
|
+
],
|
|
50
|
+
"exports": {
|
|
51
|
+
".": {
|
|
52
|
+
"types": "./dist/types/index.d.ts",
|
|
53
|
+
"import": "./src/index.ts"
|
|
54
|
+
},
|
|
55
|
+
"./snapcompact": {
|
|
56
|
+
"types": "./dist/types/snapcompact.d.ts",
|
|
57
|
+
"import": "./src/snapcompact.ts"
|
|
58
|
+
},
|
|
59
|
+
"./*": {
|
|
60
|
+
"types": "./dist/types/*.d.ts",
|
|
61
|
+
"import": "./src/*.ts"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./snapcompact";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Prior conversation history has been archived verbatim onto {{frameCount}} snapcompact frame{{#if multipleFrames}}s{{/if}} — the bitmap image{{#if multipleFrames}}s{{/if}} attached below{{#if multipleFrames}}, ordered oldest to newest{{/if}}.
|
|
2
|
+
|
|
3
|
+
Reading a frame: monospace {{fontCell}} pixel font on a white background, {{#if docColumns}}typeset as two word-wrapped newspaper columns of {{cols}} characters by {{rows}} lines each — read the left column top to bottom, then the right column{{else}}{{cols}} characters per row, {{rows}} text rows per frame; read left to right, top to bottom. Text flows continuously with no word wrap, so words may break across row ends{{/if}}. Horizontal whitespace runs were collapsed to single spaces; line breaks print as a solid black cell (one character wide) — treat each as a newline. {{#if sentenceInk}}Ink color cycles through six colors, advancing at sentence boundaries — a color change marks a new sentence.{{else}}Glyphs are plain black ink.{{/if}}{{#if stopwordDimmed}} Common function words (the, of, and, …) are printed in dim gray; content words carry the full ink.{{/if}}{{#if dimmedToolResults}} Tool output is printed in dim gray ink — gray text is archived tool output, not conversation.{{/if}}{{#if lineRepeated}} Every text line is printed twice in a row — first on the white background, then repeated on a pale yellow band. The copies are identical: read each line once and use the duplicate only to double-check hard glyphs.{{/if}} Roles are tagged inline as [User]:, [Assistant]:, [Assistant thinking]:, [Assistant tool calls]:, and [Tool result]:.
|
|
4
|
+
{{#if mixedShapes}}
|
|
5
|
+
|
|
6
|
+
Older frames may use a different font, grid, or ink coloring than described above; the reading order is always the same (left to right, top to bottom, oldest frame first).
|
|
7
|
+
{{/if}}
|
|
8
|
+
{{#if includedPreviousSummary}}
|
|
9
|
+
|
|
10
|
+
The earliest frame begins with "[Summary of earlier history]" — a condensed digest of context that predates the archived conversation.
|
|
11
|
+
{{/if}}
|
|
12
|
+
{{#if truncatedChars}}
|
|
13
|
+
|
|
14
|
+
{{truncatedChars}} characters of older history were dropped to respect the frame budget. The first frame (session start) is always kept, so the missing span sits between the first frame and the next.
|
|
15
|
+
{{/if}}
|
|
16
|
+
|
|
17
|
+
Total archived: {{totalChars}} characters. Consult the frames whenever you need exact earlier details (user wording, decisions, file paths, tool output). If a region is hard to read, re-derive the fact from the workspace (re-read files, re-run commands) rather than guessing.
|
|
18
|
+
{{#if textTail}}
|
|
19
|
+
|
|
20
|
+
The frame budget ran out before the newest part of the archive. That remainder continues below as plain text — it is newer than every frame and ends where the live conversation resumes.
|
|
21
|
+
|
|
22
|
+
[Archived history, continued as text]
|
|
23
|
+
{{textTail}}
|
|
24
|
+
{{/if}}
|