@agimon-ai/po-autocompact 0.0.0-alpha.0 → 0.0.0-stage
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 +2 -113
- package/package.json +3 -108
- package/LICENSE +0 -21
- package/dist/apiContracts.cjs +0 -17
- package/dist/apiContracts.cjs.map +0 -1
- package/dist/apiContracts.d.mts +0 -53
- package/dist/apiContracts.d.mts.map +0 -1
- package/dist/apiContracts.mjs +0 -13
- package/dist/apiContracts.mjs.map +0 -1
- package/dist/compactionPolicy-BIJJHcBP.cjs +0 -459
- package/dist/compactionPolicy-BIJJHcBP.cjs.map +0 -1
- package/dist/compactionPolicy-CDCYTj2b.mjs +0 -328
- package/dist/compactionPolicy-CDCYTj2b.mjs.map +0 -1
- package/dist/extensions/server.cjs +0 -855
- package/dist/extensions/server.cjs.map +0 -1
- package/dist/extensions/server.d.mts +0 -5
- package/dist/extensions/server.d.mts.map +0 -1
- package/dist/extensions/server.mjs +0 -850
- package/dist/extensions/server.mjs.map +0 -1
- package/dist/extensions/web.mjs +0 -161
- package/dist/extensions/web.mjs.map +0 -1
- package/dist/index.cjs +0 -3
- package/dist/index.d.mts +0 -11
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -2
package/README.md
CHANGED
|
@@ -1,114 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Temporary Holding Version
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Part of the [Po distribution](https://www.npmjs.com/package/@agimon-ai/po).
|
|
6
|
-
|
|
7
|
-
Instead of waiting for one final summary near the context limit, Autocompact creates up to three
|
|
8
|
-
asynchronous checkpoints and combines each checkpoint with subsequent messages.
|
|
9
|
-
|
|
10
|
-
> **Alpha:** thresholds and compaction steering may change between releases.
|
|
11
|
-
|
|
12
|
-
## Requirements
|
|
13
|
-
|
|
14
|
-
- Node.js 24 or newer
|
|
15
|
-
- Po headless/server host
|
|
16
|
-
- Authentication for the model selected for summarization
|
|
17
|
-
|
|
18
|
-
## Install
|
|
19
|
-
|
|
20
|
-
`po init` and `dpi init` include Autocompact in `default.packages` in `.po/modes.yaml`.
|
|
21
|
-
Remove it or move it to a named layer to change which major modes load it.
|
|
22
|
-
The native session facet is `@agimon-ai/po-autocompact/extensions/server`.
|
|
23
|
-
This package does not provide a Pi extension or terminal UI.
|
|
24
|
-
|
|
25
|
-
## Checkpoint ladder
|
|
26
|
-
|
|
27
|
-
The native owner uses thresholds around 50%, 75%, and 95% of the usable context window,
|
|
28
|
-
subject to token caps and the host's native-compaction clamp:
|
|
29
|
-
|
|
30
|
-
1. create an initial compact summary;
|
|
31
|
-
2. combine it with later messages and allow the model to decide whether compaction is ready;
|
|
32
|
-
3. combine again and force compaction on the final pass.
|
|
33
|
-
|
|
34
|
-
## Per-model token checkpoints
|
|
35
|
-
|
|
36
|
-
Ratios scale with the window, which is usually what you want. On a very large window they can
|
|
37
|
-
also mean the first checkpoint waits far longer than you would like: half of a one-million-token
|
|
38
|
-
window is 500,000 tokens. `modes.autocompact.overrides` pins individual passes to an absolute
|
|
39
|
-
token count for the models you name, and leaves every other model on the ratio ladder.
|
|
40
|
-
|
|
41
|
-
```yaml
|
|
42
|
-
modes:
|
|
43
|
-
autocompact:
|
|
44
|
-
overrides:
|
|
45
|
-
- model: 'claude-opus-4-[6-9]'
|
|
46
|
-
tokens:
|
|
47
|
-
pass1: 75000
|
|
48
|
-
pass2: 150000
|
|
49
|
-
pass3: 200000
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
- Entries are tried in file order and the first match wins. A model matching nothing behaves
|
|
53
|
-
exactly as it does without this key.
|
|
54
|
-
- `model` is a glob supporting `*` and character classes such as `[6-9]`. A pattern containing
|
|
55
|
-
`/` is matched against `provider/id`, anything else against the bare model id, because the
|
|
56
|
-
wildcard does not cross the separator. Matching ignores case.
|
|
57
|
-
- The lower of the ratio and the token count wins, so an override can only bring a checkpoint
|
|
58
|
-
forward, never push one past the native compaction boundary.
|
|
59
|
-
- Counts are compared against total context usage, not against growth since the last compaction.
|
|
60
|
-
- A count at or below the current cycle's baseline is ignored and the pass falls back to its
|
|
61
|
-
ratio. Without that, a compaction landing above the count would satisfy the pass as soon as
|
|
62
|
-
the next cycle opened and re-fire it every turn.
|
|
63
|
-
- A pass never fires before the one before it. A list that puts a later pass lower is raised to
|
|
64
|
-
match, the same way a ratio below the previous pass is.
|
|
65
|
-
- A repository config replaces the global list whole rather than merging entry by entry.
|
|
66
|
-
- These keys are not on the cockpit settings page; edit `.po/config.yaml` directly.
|
|
67
|
-
Summarization runs asynchronously in the background, on the session's own provider, so a model
|
|
68
|
-
registered by a Pi provider extension summarizes through that extension. Checkpoints are
|
|
69
|
-
persisted as hidden session entries and used for later steering.
|
|
70
|
-
|
|
71
|
-
Po uses autocompact's configured model and thinking level, then planning subagent
|
|
72
|
-
configuration, then the active session model. Each checkpoint can make another provider request,
|
|
73
|
-
consume quota, and require credentials. Provider errors or missing authentication affect checkpoint
|
|
74
|
-
generation rather than granting a free local summary.
|
|
75
|
-
|
|
76
|
-
## Coordination state
|
|
77
|
-
|
|
78
|
-
Autocompact does not own `@agimon-ai/po-task` or `@agimon-ai/po-team` persistence. The
|
|
79
|
-
native owner reads registered context-contribution snapshots from those packages when available, while Task's
|
|
80
|
-
`tasks.json` and Team's run and intercom state remain owned by their respective packages. Missing
|
|
81
|
-
snapshot data is reported as unavailable and must not be inferred from an Autocompact summary.
|
|
82
|
-
|
|
83
|
-
## Public API
|
|
84
|
-
|
|
85
|
-
```ts
|
|
86
|
-
import { thresholdTokens } from '@agimon-ai/po-autocompact';
|
|
87
|
-
import type { AutocompactPass } from '@agimon-ai/po-autocompact';
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
The server host mounts the native facet and owns its lifecycle. `thresholdTokens` exposes
|
|
91
|
-
the threshold policy for hosts that need to preview or test checkpoint boundaries.
|
|
92
|
-
|
|
93
|
-
## Development
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
pnpm build
|
|
97
|
-
pnpm typecheck
|
|
98
|
-
pnpm test
|
|
99
|
-
pnpm lint
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Maintained by [Agimon](https://agimon.ai/about).
|
|
103
|
-
|
|
104
|
-
## License
|
|
105
|
-
|
|
106
|
-
MIT
|
|
107
|
-
|
|
108
|
-
## Extension lifecycle and source layout
|
|
109
|
-
|
|
110
|
-
The session root constructs one native owner. Routed server hooks drive checkpoints, context
|
|
111
|
-
projection, compaction observation, and navigation invalidation. Shutdown disposes the checkpoint
|
|
112
|
-
boundary, cancels summarization, and drains pending work before releasing telemetry.
|
|
113
|
-
|
|
114
|
-
The web entry declares settings sections. Public exports contain reusable policy capabilities.
|
|
3
|
+
This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
|
package/package.json
CHANGED
|
@@ -1,111 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-autocompact",
|
|
3
|
-
"version": "0.0.0-
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"ai",
|
|
7
|
-
"coding-agent",
|
|
8
|
-
"context-compaction",
|
|
9
|
-
"context-window",
|
|
10
|
-
"developer-tools",
|
|
11
|
-
"pi-coding-agent",
|
|
12
|
-
"po",
|
|
13
|
-
"summarization"
|
|
14
|
-
],
|
|
15
|
-
"homepage": "https://agimon.ai",
|
|
16
|
-
"bugs": {
|
|
17
|
-
"url": "https://github.com/AgiFlow/po/issues"
|
|
18
|
-
},
|
|
19
|
-
"license": "MIT",
|
|
20
|
-
"author": "Vuong Ngo",
|
|
21
|
-
"repository": {
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "git+https://github.com/AgiFlow/po.git",
|
|
24
|
-
"directory": "packages/default/po-autocompact"
|
|
25
|
-
},
|
|
26
|
-
"files": [
|
|
27
|
-
"dist"
|
|
28
|
-
],
|
|
29
|
-
"type": "module",
|
|
30
|
-
"main": "./dist/index.cjs",
|
|
31
|
-
"module": "./dist/index.mjs",
|
|
32
|
-
"types": "./dist/index.d.mts",
|
|
33
|
-
"jsnext:main": "./dist/index.mjs",
|
|
34
|
-
"exports": {
|
|
35
|
-
".": {
|
|
36
|
-
"types": "./dist/index.d.mts",
|
|
37
|
-
"import": "./dist/index.mjs",
|
|
38
|
-
"require": "./dist/index.cjs"
|
|
39
|
-
},
|
|
40
|
-
"./apiContracts": {
|
|
41
|
-
"types": "./dist/apiContracts.d.mts",
|
|
42
|
-
"import": "./dist/apiContracts.mjs",
|
|
43
|
-
"require": "./dist/apiContracts.cjs"
|
|
44
|
-
},
|
|
45
|
-
"./extensions/server": {
|
|
46
|
-
"types": "./dist/extensions/server.d.mts",
|
|
47
|
-
"import": "./dist/extensions/server.mjs",
|
|
48
|
-
"require": "./dist/extensions/server.cjs"
|
|
49
|
-
},
|
|
50
|
-
"./extensions/web": {
|
|
51
|
-
"import": "./dist/extensions/web.mjs"
|
|
52
|
-
},
|
|
53
|
-
"./package.json": "./package.json"
|
|
54
|
-
},
|
|
55
|
-
"publishConfig": {
|
|
56
|
-
"access": "public"
|
|
57
|
-
},
|
|
58
|
-
"dependencies": {
|
|
59
|
-
"@agimon-ai/po-config": "0.0.0-alpha.0",
|
|
60
|
-
"@agimon-ai/po-core": "0.0.0-alpha.0",
|
|
61
|
-
"@agimon-ai/po-telemetry": "0.0.0-alpha.0",
|
|
62
|
-
"@deepseek-ai/cordis": "4.0.4",
|
|
63
|
-
"minimatch": "10.2.6"
|
|
64
|
-
},
|
|
65
|
-
"devDependencies": {
|
|
66
|
-
"@agimon-ai/po-build": "0.0.0-alpha.0",
|
|
67
|
-
"@earendil-works/pi-coding-agent": "1.0.2",
|
|
68
|
-
"@types/node": "26.6.4",
|
|
69
|
-
"@vitest/coverage-v8": "5.0.3",
|
|
70
|
-
"typescript": "7.0.2",
|
|
71
|
-
"vitest": "5.0.3"
|
|
72
|
-
},
|
|
73
|
-
"peerDependencies": {
|
|
74
|
-
"@earendil-works/pi-coding-agent": "1.0.2"
|
|
75
|
-
},
|
|
76
|
-
"peerDependenciesMeta": {
|
|
77
|
-
"@earendil-works/pi-coding-agent": {
|
|
78
|
-
"optional": true
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"engines": {
|
|
82
|
-
"node": ">=24"
|
|
83
|
-
},
|
|
84
|
-
"poServer": {
|
|
85
|
-
"entry": "./generated/server.ts",
|
|
86
|
-
"dist": "./dist/extensions/server.mjs",
|
|
87
|
-
"scopes": [
|
|
88
|
-
"session"
|
|
89
|
-
],
|
|
90
|
-
"contracts": {
|
|
91
|
-
"entry": "./src/exports/apiContracts.ts",
|
|
92
|
-
"dist": "./dist/apiContracts.mjs"
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
"poWeb": {
|
|
96
|
-
"pluginId": "autocompact",
|
|
97
|
-
"channels": [],
|
|
98
|
-
"client": "./dist/extensions/web.mjs",
|
|
99
|
-
"scopes": [
|
|
100
|
-
"global",
|
|
101
|
-
"workspace"
|
|
102
|
-
]
|
|
103
|
-
},
|
|
104
|
-
"scripts": {
|
|
105
|
-
"build": "tsdown",
|
|
106
|
-
"test": "vitest --run",
|
|
107
|
-
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.web.json",
|
|
108
|
-
"lint": "oxlint . && oxfmt . --check",
|
|
109
|
-
"fixcode": "oxlint . --fix && oxfmt ."
|
|
110
|
-
}
|
|
3
|
+
"version": "0.0.0-stage",
|
|
4
|
+
"stub": true,
|
|
5
|
+
"description": "Temporary package placeholder for staged publishing"
|
|
111
6
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Vuong Ngo
|
|
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/dist/apiContracts.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
Object.defineProperties(exports, {
|
|
2
|
-
__esModule: { value: true },
|
|
3
|
-
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
-
});
|
|
5
|
-
//#region src/schemas/apiContracts.ts
|
|
6
|
-
/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
|
|
7
|
-
const apiContracts = (0, require("@agimon-ai/po-core/apiContracts").defineApiContract)({
|
|
8
|
-
version: 1,
|
|
9
|
-
http: [],
|
|
10
|
-
sockets: [],
|
|
11
|
-
dynamic: []
|
|
12
|
-
});
|
|
13
|
-
//#endregion
|
|
14
|
-
exports.apiContracts = apiContracts;
|
|
15
|
-
exports.default = apiContracts;
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=apiContracts.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;;;;AAGA,MAAa,gBAAA,4CAAeA,CAAAA,CAAAA,kBAAAA,CAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
|
package/dist/apiContracts.d.mts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
//#region src/schemas/apiContracts.d.ts
|
|
2
|
-
/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
|
|
3
|
-
export declare const apiContracts: {
|
|
4
|
-
version: 1;
|
|
5
|
-
protocols?: Record<string, string> | undefined;
|
|
6
|
-
schemas?: Record<string, boolean | object> | undefined;
|
|
7
|
-
http: {
|
|
8
|
-
id: string;
|
|
9
|
-
scope: "global" | "session" | "workspace";
|
|
10
|
-
basePath?: string | undefined;
|
|
11
|
-
path: string;
|
|
12
|
-
method: "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT";
|
|
13
|
-
description: string;
|
|
14
|
-
availability?: string | undefined;
|
|
15
|
-
authentication: "device" | "none" | "owner";
|
|
16
|
-
parameters?: {
|
|
17
|
-
name: string;
|
|
18
|
-
in: "header" | "path" | "query";
|
|
19
|
-
required: boolean;
|
|
20
|
-
schema: boolean | object;
|
|
21
|
-
}[] | undefined;
|
|
22
|
-
body?: {
|
|
23
|
-
contentType: string;
|
|
24
|
-
contentTypes?: string[] | undefined;
|
|
25
|
-
required: boolean;
|
|
26
|
-
schema: boolean | object;
|
|
27
|
-
} | undefined;
|
|
28
|
-
responses: Record<string, {
|
|
29
|
-
description: string;
|
|
30
|
-
contentType?: string | undefined;
|
|
31
|
-
schema?: boolean | object | undefined;
|
|
32
|
-
events?: Record<string, boolean | object> | undefined;
|
|
33
|
-
}>;
|
|
34
|
-
}[];
|
|
35
|
-
sockets: {
|
|
36
|
-
id: string;
|
|
37
|
-
scope: "global" | "session" | "workspace";
|
|
38
|
-
description: string;
|
|
39
|
-
availability?: string | undefined;
|
|
40
|
-
service: string;
|
|
41
|
-
member: string;
|
|
42
|
-
direction: "client-to-server" | "server-to-client";
|
|
43
|
-
kind: "channel" | "method" | "state";
|
|
44
|
-
input: boolean | object;
|
|
45
|
-
output?: boolean | object | undefined;
|
|
46
|
-
errors?: boolean | object | undefined;
|
|
47
|
-
}[];
|
|
48
|
-
dynamic: string[];
|
|
49
|
-
gaps?: string[] | undefined;
|
|
50
|
-
};
|
|
51
|
-
//#endregion
|
|
52
|
-
export { apiContracts as default };
|
|
53
|
-
//# sourceMappingURL=apiContracts.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAGa"}
|
package/dist/apiContracts.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineApiContract } from "@agimon-ai/po-core/apiContracts";
|
|
2
|
-
//#region src/schemas/apiContracts.ts
|
|
3
|
-
/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
|
|
4
|
-
const apiContracts = defineApiContract({
|
|
5
|
-
version: 1,
|
|
6
|
-
http: [],
|
|
7
|
-
sockets: [],
|
|
8
|
-
dynamic: []
|
|
9
|
-
});
|
|
10
|
-
//#endregion
|
|
11
|
-
export { apiContracts, apiContracts as default };
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=apiContracts.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAa,eAAe,kBAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
|