local-context-manager 0.3.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 +53 -0
- package/LICENSE +21 -0
- package/README.md +45 -0
- package/examples/local-context-manager.json +13 -0
- package/package.json +45 -0
- package/src/checkpoint-reset.ts +757 -0
- package/src/config.ts +235 -0
- package/src/continuation.ts +116 -0
- package/src/handoff.ts +171 -0
- package/src/index.ts +941 -0
- package/src/policy.ts +81 -0
- package/src/telemetry.ts +211 -0
- package/src/tool-output.ts +403 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `local-context-manager` are documented here. Version numbers also mark the project milestones represented by the merged pull requests.
|
|
4
|
+
|
|
5
|
+
## [0.3.0] - 2026-09-04
|
|
6
|
+
|
|
7
|
+
This release completes the public, npm-distributed extension workflow.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Beginner-first documentation portal published through GitHub Pages, covering the context problem, its impact on local-LLM workflows, installation, commands, configuration, privacy, and recovery.
|
|
12
|
+
- Repeatable GitHub Pages deployment workflow for the `docs/` site.
|
|
13
|
+
- npm package metadata for `local-context-manager`, including repository, homepage, issue tracker, public publish configuration, and a publish-time validation hook.
|
|
14
|
+
- CI checks for typechecking, tests, builds, and npm package inspection.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Set the package and lockfile version to `0.3.0`.
|
|
19
|
+
- Reduced the root README to a short installation and orientation page, with the GitHub Pages portal as the canonical beginner guide.
|
|
20
|
+
|
|
21
|
+
## [0.2.0] - 2026-09-04
|
|
22
|
+
|
|
23
|
+
Milestone delivered by [PR #2](https://github.com/SaehwanPark/local-context-manager/pull/2).
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- Reviewed `/checkpoint-reset [reason]` workflow for completed semantic episodes.
|
|
28
|
+
- Durable local checkpoint archives and minimal continuation capsules with parent-session linkage.
|
|
29
|
+
- `request_context_reset` recommendation tool and `/context-checkpoints` listing command.
|
|
30
|
+
- Lineage telemetry, checkpoint storage configuration, atomic persistence, and focused tests.
|
|
31
|
+
|
|
32
|
+
### Safety
|
|
33
|
+
|
|
34
|
+
- A model-facing reset request only recommends the reviewed command; it never writes a checkpoint or changes sessions by itself.
|
|
35
|
+
- Generation, editing, approval, storage, and fresh-session failures preserve the active session.
|
|
36
|
+
|
|
37
|
+
## [0.1.0] - 2026-09-04
|
|
38
|
+
|
|
39
|
+
Initial extension milestone delivered by [PR #1](https://github.com/SaehwanPark/local-context-manager/pull/1).
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- Layered global/project JSON configuration with validation, trust gating, and safe defaults.
|
|
44
|
+
- Context telemetry and `/context-stats` reporting.
|
|
45
|
+
- Guarded proactive native compaction with hysteresis, in-flight protection, cooldown, and Pi emergency-compaction fallback.
|
|
46
|
+
- Conservative reduction of newly arriving oversized build, failure, search, diff, and generic tool results, with recoverable full-output paths.
|
|
47
|
+
- Optional semantic compaction through `request_context_compaction` and `/compact-phase`.
|
|
48
|
+
- Reviewed `/handoff <objective>` continuation prompts and fresh-session initialization.
|
|
49
|
+
- Package metadata, examples, tests, and build/typecheck configuration.
|
|
50
|
+
|
|
51
|
+
[0.3.0]: https://github.com/SaehwanPark/local-context-manager/releases/tag/v0.3.0
|
|
52
|
+
[0.2.0]: https://github.com/SaehwanPark/local-context-manager/pull/2
|
|
53
|
+
[0.1.0]: https://github.com/SaehwanPark/local-context-manager/pull/1
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sae-Hwan Park
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# local-context-manager
|
|
2
|
+
|
|
3
|
+
`local-context-manager` is a [Pi](https://github.com/earendil-works/pi) extension for long-running sessions, especially workflows using local models where large prompts can make prefill slower and context overflow more disruptive.
|
|
4
|
+
|
|
5
|
+
## Start here
|
|
6
|
+
|
|
7
|
+
The **[beginner documentation portal](https://saehwanpark.github.io/local-context-manager/)** explains the problem, why it matters, installation, first use, commands, configuration, privacy, and recovery. The portal is the canonical user guide; this README stays short so the same instructions work on GitHub and npm.
|
|
8
|
+
|
|
9
|
+
## Install in Pi
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pi install npm:local-context-manager
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Start (or reload) Pi in your project, then try:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
/context-stats
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The extension works with Pi's existing models and configuration. It does not install a model or change Pi's emergency compaction authority. To pin this release, use `npm:local-context-manager@0.3.0`.
|
|
22
|
+
|
|
23
|
+
## What it adds
|
|
24
|
+
|
|
25
|
+
- telemetry for context size, compaction, and reduced tool output;
|
|
26
|
+
- guarded proactive compaction at safe idle boundaries;
|
|
27
|
+
- conservative reduction of only new oversized tool results, with a recovery path;
|
|
28
|
+
- intentional phase compaction with `/compact-phase`;
|
|
29
|
+
- reviewed `/handoff` and `/checkpoint-reset` workflows for starting a fresh session without silently discarding important work.
|
|
30
|
+
|
|
31
|
+
All session-changing workflows are reviewable. The extension does not automatically reset sessions or inject archived checkpoints into later prompts.
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install
|
|
37
|
+
npm run check
|
|
38
|
+
npm run build
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
See the [source repository](https://github.com/SaehwanPark/local-context-manager) and the [full changelog](CHANGELOG.md) for project history.
|
|
42
|
+
|
|
43
|
+
## License
|
|
44
|
+
|
|
45
|
+
MIT
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"enabled": true,
|
|
3
|
+
"softWarningTokens": 24000,
|
|
4
|
+
"compactThresholdTokens": 32000,
|
|
5
|
+
"hardCeilingTokens": 48000,
|
|
6
|
+
"keepRecentTokens": 10000,
|
|
7
|
+
"toolOutputReduction": true,
|
|
8
|
+
"semanticCompaction": true,
|
|
9
|
+
"handoff": true,
|
|
10
|
+
"checkpointReset": true,
|
|
11
|
+
"checkpointDirectory": null,
|
|
12
|
+
"debug": false
|
|
13
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "local-context-manager",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "A Pi extension for cache-friendly context control in long-running local-LLM workflows",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"keywords": ["pi-package", "pi-extension", "local-llm", "context-management"],
|
|
7
|
+
"author": "Sae-Hwan Park",
|
|
8
|
+
"homepage": "https://saehwanpark.github.io/local-context-manager/",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/SaehwanPark/local-context-manager.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/SaehwanPark/local-context-manager/issues"
|
|
15
|
+
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"files": ["src", "examples", "README.md", "CHANGELOG.md"],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"pi": {
|
|
22
|
+
"extensions": [
|
|
23
|
+
"./src/index.ts"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc -p tsconfig.build.json",
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"check": "npm run typecheck && npm test",
|
|
31
|
+
"prepublishOnly": "npm run check"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@earendil-works/pi-coding-agent": ">=0.84.4 <1"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"typebox": "^1.3.7"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@earendil-works/pi-coding-agent": "0.84.4",
|
|
41
|
+
"@types/node": "^22.19.19",
|
|
42
|
+
"typescript": "^5.9.3",
|
|
43
|
+
"vitest": "^4.1.9"
|
|
44
|
+
}
|
|
45
|
+
}
|