@agimon-ai/po 0.0.0-alpha.21 → 0.0.0-alpha.23
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/LICENSE +149 -21
- package/README.md +1 -1
- package/dist/builders/cli/extensionAssembler/index.cjs +3 -2
- package/dist/builders/cli/extensionAssembler/index.cjs.map +1 -1
- package/dist/builders/cli/extensionAssembler/index.d.mts.map +1 -1
- package/dist/builders/cli/extensionAssembler/index.mjs +4 -3
- package/dist/builders/cli/extensionAssembler/index.mjs.map +1 -1
- package/dist/catalog/index.json +60 -53
- package/dist/src/builders/server/runtime.cjs +15 -1
- package/dist/src/builders/server/runtime.cjs.map +1 -1
- package/dist/src/builders/server/runtime.mjs +15 -1
- package/dist/src/builders/server/runtime.mjs.map +1 -1
- package/dist/src/cli/commands/compat/providers/shared.cjs +8 -5
- package/dist/src/cli/commands/compat/providers/shared.cjs.map +1 -1
- package/dist/src/cli/commands/compat/providers/shared.d.mts +5 -5
- package/dist/src/cli/commands/compat/providers/shared.d.mts.map +1 -1
- package/dist/src/cli/commands/compat/providers/shared.mjs +6 -5
- package/dist/src/cli/commands/compat/providers/shared.mjs.map +1 -1
- package/docs/server/index.md +1 -1
- package/package.json +22 -21
|
@@ -33,6 +33,7 @@ import { loadServerPackages, selectedServerProviderOverrides } from "@agimon-ai/
|
|
|
33
33
|
import crypto from "node:crypto";
|
|
34
34
|
import { createOpenSessionRegistry, createRequestReceipts, createWorkspaceRegistry, identifyWorkspace, listSavedSessionRecords, listSavedSessions, readSqliteTranscript, readWorkspaceMarker, writeWorkspaceMarker } from "@agimon-ai/po-core/history";
|
|
35
35
|
import { createNodePlatform } from "@agimon-ai/po-core/nodePlatform";
|
|
36
|
+
import { readSessionFileDirectories, removeSessionFiles } from "@agimon-ai/po-core/platform";
|
|
36
37
|
import { readPoBackgroundWorkService } from "@agimon-ai/po-core/backgroundWork";
|
|
37
38
|
import { createHeadlessHub } from "@agimon-ai/po-core/headlessHub";
|
|
38
39
|
import { serveHeadlessServer } from "@agimon-ai/po-core/headlessServer";
|
|
@@ -77,6 +78,7 @@ async function runServerRuntime(options, runtime) {
|
|
|
77
78
|
const serverDirectory = path.join(piAgentDirectory(baseEnvironment), "server");
|
|
78
79
|
const platform = createNodePlatform({
|
|
79
80
|
homeDirectory,
|
|
81
|
+
temporaryDirectory: path.resolve(baseEnvironment.TMPDIR || baseEnvironment.TMP || baseEnvironment.TEMP || os.tmpdir()),
|
|
80
82
|
sessionsRoot: path.join(serverDirectory, "sessions")
|
|
81
83
|
});
|
|
82
84
|
/** Called on a watched change; assigned once every scope can be checked. */
|
|
@@ -206,6 +208,17 @@ async function runServerRuntime(options, runtime) {
|
|
|
206
208
|
* it exists to survive.
|
|
207
209
|
*/
|
|
208
210
|
let shuttingDown = false;
|
|
211
|
+
const removeSessionOutputs = async (sessionId) => {
|
|
212
|
+
const directories = await readSessionFileDirectories(platform.sessions, sessionId);
|
|
213
|
+
await removeSessionFiles({
|
|
214
|
+
platform,
|
|
215
|
+
sessionId,
|
|
216
|
+
environment: baseEnvironment,
|
|
217
|
+
artifactDirectory: path.join(directories?.agentDirectory ?? piAgentDirectory(baseEnvironment, homeDirectory), "po-artifacts", sessionId),
|
|
218
|
+
...directories === void 0 ? {} : { directories }
|
|
219
|
+
});
|
|
220
|
+
openSessions.remove(sessionId);
|
|
221
|
+
};
|
|
209
222
|
const closeManagedSession = async (sessionId, options) => {
|
|
210
223
|
if (!shuttingDown && options?.keepDormant !== true) openSessions.remove(sessionId);
|
|
211
224
|
const artifacts = sessionArtifacts.get(sessionId);
|
|
@@ -1298,7 +1311,8 @@ async function runServerRuntime(options, runtime) {
|
|
|
1298
1311
|
return target.summary.id;
|
|
1299
1312
|
},
|
|
1300
1313
|
dormantSessions: () => openSessions.list(),
|
|
1301
|
-
removeDormantSession: (record) =>
|
|
1314
|
+
removeDormantSession: (record) => removeSessionOutputs(record.sessionId),
|
|
1315
|
+
removeSessionFiles: removeSessionOutputs,
|
|
1302
1316
|
setDormantGroups: (record, groups) => {
|
|
1303
1317
|
if (!openSessions.add({
|
|
1304
1318
|
...record,
|