@caupulican/pi-adaptative 0.80.29 → 0.80.31
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 +13 -0
- package/dist/core/agent-session.d.ts +3 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +4 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/context-gc.d.ts.map +1 -1
- package/dist/core/context-gc.js +93 -60
- package/dist/core/context-gc.js.map +1 -1
- package/dist/core/improvement-loop.d.ts +296 -0
- package/dist/core/improvement-loop.d.ts.map +1 -0
- package/dist/core/improvement-loop.js +906 -0
- package/dist/core/improvement-loop.js.map +1 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +1 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -0
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
16
16
|
import { basename, dirname, join } from "node:path";
|
|
17
17
|
import { clampThinkingLevel, cleanupSessionResources, getSupportedThinkingLevels, isContextOverflow, modelsAreEqual, resetApiProviders, streamSimple, } from "@caupulican/pi-ai";
|
|
18
|
+
import { getAgentDir } from "../config.js";
|
|
18
19
|
import { theme } from "../modes/interactive/theme/theme.js";
|
|
19
20
|
import { stripFrontmatter } from "../utils/frontmatter.js";
|
|
20
21
|
import { resolvePath } from "../utils/paths.js";
|
|
@@ -100,6 +101,7 @@ export class AgentSession {
|
|
|
100
101
|
_customTools;
|
|
101
102
|
_baseToolDefinitions = new Map();
|
|
102
103
|
_cwd;
|
|
104
|
+
_agentDir;
|
|
103
105
|
_extensionRunnerRef;
|
|
104
106
|
_initialActiveToolNames;
|
|
105
107
|
_allowedToolNames;
|
|
@@ -132,6 +134,7 @@ export class AgentSession {
|
|
|
132
134
|
this._resourceLoader = config.resourceLoader;
|
|
133
135
|
this._customTools = config.customTools ?? [];
|
|
134
136
|
this._cwd = config.cwd;
|
|
137
|
+
this._agentDir = config.agentDir ?? getAgentDir();
|
|
135
138
|
this._modelRegistry = config.modelRegistry;
|
|
136
139
|
this._extensionRunnerRef = config.extensionRunnerRef;
|
|
137
140
|
this._initialActiveToolNames = config.initialActiveToolNames;
|
|
@@ -247,7 +250,7 @@ export class AgentSession {
|
|
|
247
250
|
};
|
|
248
251
|
}
|
|
249
252
|
_contextGcStorageDir() {
|
|
250
|
-
return join(this.
|
|
253
|
+
return join(this._agentDir, "context-gc", this.sessionManager.getSessionId());
|
|
251
254
|
}
|
|
252
255
|
_applyContextGc(messages, writePayloads) {
|
|
253
256
|
try {
|