om-memory-system 5.4.1 → 5.5.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/README.md +18 -13
- package/dist/adapters/pi/extension.js +3 -0
- package/dist/cli/index.js +5 -0
- package/dist/cli/memory-command.js +22 -1
- package/dist/cli/space-command.d.ts +14 -0
- package/dist/cli/space-command.js +48 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.js +16 -19
- package/dist/core/memory-operations.d.ts +5 -1
- package/dist/core/memory-operations.js +9 -0
- package/dist/core/space-tool.d.ts +6 -0
- package/dist/core/space-tool.js +14 -0
- package/dist/services/ai/session/ai-session-manager.js +2 -2
- package/dist/services/context.js +9 -3
- package/dist/services/embedding.js +2 -1
- package/dist/services/host-appearance.d.ts +18 -7
- package/dist/services/host-appearance.js +44 -34
- package/dist/services/legacy-migration.d.ts +3 -1
- package/dist/services/legacy-migration.js +1 -1
- package/dist/services/memory-host-routes.d.ts +1 -0
- package/dist/services/memory-host-routes.js +4 -2
- package/dist/services/space-routes.d.ts +16 -0
- package/dist/services/space-routes.js +222 -0
- package/dist/services/spaces/active-space.d.ts +16 -0
- package/dist/services/spaces/active-space.js +32 -0
- package/dist/services/spaces/backup.d.ts +52 -0
- package/dist/services/spaces/backup.js +125 -0
- package/dist/services/spaces/context-line.d.ts +10 -0
- package/dist/services/spaces/context-line.js +13 -0
- package/dist/services/spaces/delete.d.ts +22 -0
- package/dist/services/spaces/delete.js +40 -0
- package/dist/services/spaces/folder-size.d.ts +2 -0
- package/dist/services/spaces/folder-size.js +9 -0
- package/dist/services/spaces/operations.d.ts +26 -0
- package/dist/services/spaces/operations.js +82 -0
- package/dist/services/spaces/registry-store.d.ts +32 -0
- package/dist/services/spaces/registry-store.js +134 -0
- package/dist/services/spaces/registry.d.ts +70 -0
- package/dist/services/spaces/registry.js +227 -0
- package/dist/services/spaces/restore.d.ts +20 -0
- package/dist/services/spaces/restore.js +80 -0
- package/dist/services/spaces/storage-resolution.d.ts +17 -0
- package/dist/services/spaces/storage-resolution.js +29 -0
- package/dist/services/spaces/store-handles.d.ts +23 -0
- package/dist/services/spaces/store-handles.js +40 -0
- package/dist/services/tag-prefix-migration.js +3 -3
- package/dist/services/turso/connection-manager.d.ts +2 -0
- package/dist/services/turso/connection-manager.js +3 -1
- package/dist/services/turso/ready.js +2 -0
- package/dist/services/turso/shard-manager.js +2 -2
- package/dist/services/user-profile/user-profile-manager.js +7 -7
- package/dist/services/user-prompt/user-prompt-manager.js +2 -2
- package/dist/services/web-route-modules.d.ts +1 -0
- package/dist/services/web-route-modules.js +5 -0
- package/dist/services/web-server.js +2 -1
- package/dist/v2/adapter.d.ts +56 -0
- package/dist/v2/adapter.js +4 -1
- package/dist/web/assets/index-Dcvz3EXt.js +170 -0
- package/dist/web/assets/index-b8k5Tuei.css +2 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/skills/omms-memory/SKILL.md +14 -12
- package/dist/web/assets/index-7p-aYnWZ.css +0 -2
- package/dist/web/assets/index-CaFFlcl1.js +0 -170
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { homedir } from "node:os";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { resolveDefaultStoragePath } from "../legacy-migration.js";
|
|
4
|
+
/** The OMMS folder, normally `~/.omms`. It holds `spaces.json`, `spaces/` and `backups/`. */
|
|
5
|
+
export function ommsHomeDir() {
|
|
6
|
+
return join(homedir(), ".omms");
|
|
7
|
+
}
|
|
8
|
+
/** Expands a leading `~` to the home folder. */
|
|
9
|
+
export function expandPath(path) {
|
|
10
|
+
if (path.startsWith("~/")) {
|
|
11
|
+
return join(homedir(), path.slice(2));
|
|
12
|
+
}
|
|
13
|
+
if (path === "~") {
|
|
14
|
+
return homedir();
|
|
15
|
+
}
|
|
16
|
+
return path;
|
|
17
|
+
}
|
|
18
|
+
/** The global store folder: the config's `storagePath`, or the default `~/.omms/data`. */
|
|
19
|
+
export function storagePathFrom(fileConfig) {
|
|
20
|
+
return fileConfig.storagePath ? expandPath(fileConfig.storagePath) : resolveDefaultStoragePath();
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Keeps skills.db and the embedding model cache in the global storage path when a
|
|
24
|
+
* project config or the active space moves `storagePath` (ADR-036, ADR-041).
|
|
25
|
+
*/
|
|
26
|
+
export function withSkillStorage(config, global) {
|
|
27
|
+
const path = storagePathFrom(global);
|
|
28
|
+
return { ...config, skillStoragePath: path === config.storagePath ? undefined : path };
|
|
29
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store handles that must be reset when the storage folder changes (ADR-041, design D4).
|
|
3
|
+
*
|
|
4
|
+
* A long-lived store object (a connection pool, a manager that caches its database path)
|
|
5
|
+
* registers here once, on the line that creates it. `config.ts` calls `resetStoreHandles()`
|
|
6
|
+
* when a config reload changes `storagePath`, which happens when the active memory space
|
|
7
|
+
* changes. This module imports nothing, so config can use it without an import cycle.
|
|
8
|
+
*/
|
|
9
|
+
type ResetResult = void | Promise<unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* Registers `target` for a reset on a storage change and returns it, so the call can wrap
|
|
12
|
+
* the line that creates a singleton. `reset` defaults to `target.reset()`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resettable<T>(name: string, target: T, reset?: (target: T) => ResetResult): T;
|
|
15
|
+
/** The names of the registered store handles. A test uses it to see that none is missing. */
|
|
16
|
+
export declare function registeredStoreResets(): string[];
|
|
17
|
+
/**
|
|
18
|
+
* Resets every registered handle. The synchronous part of each reset runs before this returns,
|
|
19
|
+
* so a store call made right after sees a fresh handle. The promise ends when every connection
|
|
20
|
+
* to the old folder is closed. A new connection waits for the close (see TursoConnectionManager).
|
|
21
|
+
*/
|
|
22
|
+
export declare function resetStoreHandles(): Promise<void>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store handles that must be reset when the storage folder changes (ADR-041, design D4).
|
|
3
|
+
*
|
|
4
|
+
* A long-lived store object (a connection pool, a manager that caches its database path)
|
|
5
|
+
* registers here once, on the line that creates it. `config.ts` calls `resetStoreHandles()`
|
|
6
|
+
* when a config reload changes `storagePath`, which happens when the active memory space
|
|
7
|
+
* changes. This module imports nothing, so config can use it without an import cycle.
|
|
8
|
+
*/
|
|
9
|
+
const resets = new Map();
|
|
10
|
+
/**
|
|
11
|
+
* Registers `target` for a reset on a storage change and returns it, so the call can wrap
|
|
12
|
+
* the line that creates a singleton. `reset` defaults to `target.reset()`.
|
|
13
|
+
*/
|
|
14
|
+
export function resettable(name, target, reset = (item) => item.reset()) {
|
|
15
|
+
resets.set(name, () => reset(target));
|
|
16
|
+
return target;
|
|
17
|
+
}
|
|
18
|
+
/** The names of the registered store handles. A test uses it to see that none is missing. */
|
|
19
|
+
export function registeredStoreResets() {
|
|
20
|
+
return [...resets.keys()];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Resets every registered handle. The synchronous part of each reset runs before this returns,
|
|
24
|
+
* so a store call made right after sees a fresh handle. The promise ends when every connection
|
|
25
|
+
* to the old folder is closed. A new connection waits for the close (see TursoConnectionManager).
|
|
26
|
+
*/
|
|
27
|
+
export function resetStoreHandles() {
|
|
28
|
+
const pending = [];
|
|
29
|
+
for (const reset of resets.values()) {
|
|
30
|
+
try {
|
|
31
|
+
const result = reset();
|
|
32
|
+
if (result)
|
|
33
|
+
pending.push(result);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
pending.push(Promise.reject(error));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return Promise.allSettled(pending).then(() => undefined);
|
|
40
|
+
}
|
|
@@ -2,6 +2,7 @@ import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "
|
|
|
2
2
|
import { basename, dirname, isAbsolute, join, relative } from "node:path";
|
|
3
3
|
import { CONFIG, getExplicitContainerTagPrefix } from "../config.js";
|
|
4
4
|
import { log } from "./logger.js";
|
|
5
|
+
import { writeBackupManifest } from "./spaces/backup.js";
|
|
5
6
|
import { copyFilesWithVerification, timestampSlug, walkTree, } from "./legacy-migration.js";
|
|
6
7
|
import { countOpencodePrefixedRows, enumerateShardTargets, FROM_PREFIX_WITH_SEP, } from "./tag-prefix-scan.js";
|
|
7
8
|
import { withCrossProcessWriteLock } from "./turso/cross-process-write-lock.js";
|
|
@@ -35,7 +36,6 @@ const FROM_PREFIX = "opencode";
|
|
|
35
36
|
const TO_PREFIX = "omms";
|
|
36
37
|
const TO_PREFIX_WITH_SEP = "omms_";
|
|
37
38
|
const METADATA_DB_NAME = "metadata.db";
|
|
38
|
-
const MANIFEST_FILE = "manifest.json";
|
|
39
39
|
const COMPLETION_TABLE = "tag_prefix_migration";
|
|
40
40
|
const SHARD_MARKER_TABLE = "shard_metadata";
|
|
41
41
|
const BACKUPS_DIR_NAME = "backups";
|
|
@@ -310,13 +310,13 @@ async function createVerifiedBackup(storePath, targets) {
|
|
|
310
310
|
manifest.push(...copied);
|
|
311
311
|
}
|
|
312
312
|
manifest.push(...copyFilesWithVerification(storePath, backupRoot, remaining));
|
|
313
|
-
|
|
313
|
+
writeBackupManifest(backupRoot, {
|
|
314
314
|
createdAt: new Date().toISOString(),
|
|
315
315
|
kind: "tag-prefix-migration",
|
|
316
316
|
source: storePath,
|
|
317
317
|
fileCount: manifest.length,
|
|
318
318
|
files: manifest,
|
|
319
|
-
}
|
|
319
|
+
});
|
|
320
320
|
return backupRoot;
|
|
321
321
|
}
|
|
322
322
|
/**
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { createClient } from "@libsql/client";
|
|
2
2
|
import { TursoDb } from "./turso-db.js";
|
|
3
|
+
import { resettable } from "../spaces/store-handles.js";
|
|
4
|
+
export { resettable };
|
|
3
5
|
export declare class TursoConnectionManager {
|
|
4
6
|
private readonly clientFactory;
|
|
5
7
|
private readonly connections;
|
|
@@ -5,6 +5,8 @@ import { CONFIG } from "../../config.js";
|
|
|
5
5
|
import { log } from "../logger.js";
|
|
6
6
|
import { collectReleasedSqliteHandles } from "./sqlite-handle-release.js";
|
|
7
7
|
import { TursoDb } from "./turso-db.js";
|
|
8
|
+
import { resettable } from "../spaces/store-handles.js";
|
|
9
|
+
export { resettable };
|
|
8
10
|
function toFileUrl(dbPath) {
|
|
9
11
|
return dbPath.startsWith("file:") ? dbPath : `file:${dbPath}`;
|
|
10
12
|
}
|
|
@@ -164,4 +166,4 @@ export class TursoConnectionManager {
|
|
|
164
166
|
this.pending.clear();
|
|
165
167
|
}
|
|
166
168
|
}
|
|
167
|
-
export const tursoConnectionManager = new TursoConnectionManager();
|
|
169
|
+
export const tursoConnectionManager = resettable("connections", new TursoConnectionManager(), (m) => m.closeAll());
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { runLegacyTursoMigration } from "./legacy-migrator.js";
|
|
2
2
|
import { runStartupTagPrefixGate } from "../tag-prefix-migration.js";
|
|
3
3
|
import { tursoShardManager } from "./shard-manager.js";
|
|
4
|
+
import { resettable } from "./connection-manager.js";
|
|
4
5
|
import { log } from "../logger.js";
|
|
5
6
|
let initPromise = null;
|
|
6
7
|
let isReady = false;
|
|
@@ -34,3 +35,4 @@ export function resetTursoReady() {
|
|
|
34
35
|
isReady = false;
|
|
35
36
|
initPromise = null;
|
|
36
37
|
}
|
|
38
|
+
resettable("turso-ready", null, resetTursoReady);
|
|
@@ -2,7 +2,7 @@ import { join, basename, resolve, relative } from "node:path";
|
|
|
2
2
|
import { existsSync, renameSync, unlinkSync } from "node:fs";
|
|
3
3
|
import { CONFIG } from "../../config.js";
|
|
4
4
|
import { assertSafeScopeHash } from "../memory-scope.js";
|
|
5
|
-
import { tursoConnectionManager } from "./connection-manager.js";
|
|
5
|
+
import { resettable, tursoConnectionManager } from "./connection-manager.js";
|
|
6
6
|
import { log } from "../logger.js";
|
|
7
7
|
import { assertNoTursoMigrationInProgress } from "./operation-lock.js";
|
|
8
8
|
import { withCrossProcessWriteLock } from "./cross-process-write-lock.js";
|
|
@@ -493,4 +493,4 @@ export class TursoShardManager {
|
|
|
493
493
|
return this.rowToShardInfo(updated);
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
export const tursoShardManager = new TursoShardManager();
|
|
496
|
+
export const tursoShardManager = resettable("shards", new TursoShardManager());
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { tursoConnectionManager } from "../turso/connection-manager.js";
|
|
3
|
+
import { resettable, tursoConnectionManager } from "../turso/connection-manager.js";
|
|
4
4
|
import { CONFIG } from "../../config.js";
|
|
5
5
|
import { hasEnoughWorkflowSteps } from "../../core/extraction.js";
|
|
6
6
|
import { completeStructured, resolveHostProfileModel } from "./profile-model.js";
|
|
@@ -70,24 +70,24 @@ export const USER_PROFILES_DB_NAME = "user-profiles.db";
|
|
|
70
70
|
const COLD_BUFFER_DEFAULT_KEY = "__unattributed__";
|
|
71
71
|
export class UserProfileManager {
|
|
72
72
|
db = null;
|
|
73
|
-
dbPath;
|
|
73
|
+
dbPath = "";
|
|
74
74
|
initPromise = null;
|
|
75
75
|
// Cold-start buffers are keyed by profileId so items observed for one user never
|
|
76
76
|
// drain into another user's merge (cross-user contamination). The unattributed bucket
|
|
77
77
|
// (COLD_BUFFER_DEFAULT_KEY) only holds items from merges that ran without a profileId.
|
|
78
78
|
coldBuffers;
|
|
79
|
-
coldBufferPath;
|
|
79
|
+
coldBufferPath = "";
|
|
80
80
|
dedupCheckedCache = new Set();
|
|
81
81
|
constructor() {
|
|
82
|
-
this.
|
|
83
|
-
this.coldBufferPath = join(CONFIG.storagePath || "", "cold-buffer.json");
|
|
84
|
-
this.coldBuffers = this.loadColdBuffers();
|
|
82
|
+
this.reset();
|
|
85
83
|
}
|
|
86
84
|
reset() {
|
|
87
85
|
this.db = null;
|
|
88
86
|
this.initPromise = null;
|
|
87
|
+
this.dedupCheckedCache.clear();
|
|
89
88
|
this.dbPath = join(CONFIG.storagePath || "", USER_PROFILES_DB_NAME);
|
|
90
89
|
this.coldBufferPath = join(CONFIG.storagePath || "", "cold-buffer.json");
|
|
90
|
+
this.coldBuffers = this.loadColdBuffers();
|
|
91
91
|
}
|
|
92
92
|
async initialize() {
|
|
93
93
|
if (this.initPromise) {
|
|
@@ -1602,4 +1602,4 @@ Generate a concise, abstract description of the user's general behavioral tenden
|
|
|
1602
1602
|
return parsed.description || null;
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
1605
|
-
export const userProfileManager = new UserProfileManager();
|
|
1605
|
+
export const userProfileManager = resettable("user-profiles", new UserProfileManager());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
import { tursoConnectionManager } from "../turso/connection-manager.js";
|
|
2
|
+
import { resettable, tursoConnectionManager } from "../turso/connection-manager.js";
|
|
3
3
|
import { CONFIG } from "../../config.js";
|
|
4
4
|
import { isTrivialPrompt } from "../../core/trivial-prompt.js";
|
|
5
5
|
const RECENT_LEARNING_WINDOW_MS = 7 * 86_400_000;
|
|
@@ -340,4 +340,4 @@ export class UserPromptManager {
|
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
export const userPromptManager = new UserPromptManager();
|
|
343
|
+
export const userPromptManager = resettable("user-prompts", new UserPromptManager());
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type RouteResult } from "./chat/chat-routes.js";
|
|
2
2
|
import type { SkillRouteContext } from "./skill-routes.js";
|
|
3
|
+
export { spaceStatus } from "./space-routes.js";
|
|
3
4
|
/**
|
|
4
5
|
* Route modules that live outside web-server.ts, which sits at its size
|
|
5
6
|
* ceiling. Each returns undefined for paths it does not own. The request body
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { routeChat } from "./chat/chat-routes.js";
|
|
2
2
|
import { routeMemoryHosts } from "./memory-host-routes.js";
|
|
3
3
|
import { routeProfileCleanup } from "./profile-cleanup-routes.js";
|
|
4
|
+
import { routeSpaces } from "./space-routes.js";
|
|
5
|
+
export { spaceStatus } from "./space-routes.js";
|
|
4
6
|
/**
|
|
5
7
|
* Route modules that live outside web-server.ts, which sits at its size
|
|
6
8
|
* ceiling. Each returns undefined for paths it does not own. The request body
|
|
@@ -20,5 +22,8 @@ export async function routeModules(path, method, url, req, ctx) {
|
|
|
20
22
|
const { routeSkills } = await import("./skill-routes.js");
|
|
21
23
|
return routeSkills(path, method, url, readBody, ctx);
|
|
22
24
|
}
|
|
25
|
+
const spaces = await routeSpaces(path, method, readBody, ctx.cwd);
|
|
26
|
+
if (spaces !== undefined)
|
|
27
|
+
return spaces;
|
|
23
28
|
return routeChat(path, method, readBody, config);
|
|
24
29
|
}
|
|
@@ -15,7 +15,7 @@ import { NODE_HTTP_IDLE_TIMEOUT_MS } from "./request-timeouts.js";
|
|
|
15
15
|
import { testReranker } from "./reranker-test.js";
|
|
16
16
|
import { setSingleFlightInterval } from "./single-flight.js";
|
|
17
17
|
import { handleListTags, handleListKeywords, handleListMemories, handleAddMemory, handleDeleteMemory, handleBulkDelete, handleUpdateMemory, handleSearch, handleStats, handlePinMemory, handleUnpinMemory, handleRunCleanup, handleRunDeduplication, handleDetectMigration, handleRunMigration, handleDetectTagMigration, handleRunTagMigrationBatch, handleGetTagMigrationProgress, handleDeletePrompt, handleBulkDeletePrompts, handleGetUserProfile, handleGetProfileChangelog, handleGetProfileSnapshot, handleRefreshProfile, handleUpdateProfileItem, } from "./api-handlers.js";
|
|
18
|
-
import { routeModules } from "./web-route-modules.js";
|
|
18
|
+
import { routeModules, spaceStatus } from "./web-route-modules.js";
|
|
19
19
|
const isBun = typeof globalThis.Bun !== "undefined";
|
|
20
20
|
const MIN_FAILED_TAKEOVERS = 3;
|
|
21
21
|
/** A busy owner can answer late. Two seconds was short enough to call a live owner dead. */
|
|
@@ -931,6 +931,7 @@ export class WebServer {
|
|
|
931
931
|
isLocal: isLoopbackAddress(remoteAddress),
|
|
932
932
|
instance: PROCESS_INSTANCE,
|
|
933
933
|
update: this.webUpdate?.status() ?? NO_UPDATE,
|
|
934
|
+
activeSpace: spaceStatus(this.config.directory ?? process.cwd()),
|
|
934
935
|
});
|
|
935
936
|
}
|
|
936
937
|
if ((path === "/api/web/stop" || path === "/api/web/restart") && method === "POST") {
|
package/dist/v2/adapter.d.ts
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
import type { Context } from "@opencode/plugin/promise/plugin";
|
|
2
2
|
import type { V2MemoryBridge } from "./memory-bridge.js";
|
|
3
|
+
export declare const memoryInput: {
|
|
4
|
+
readonly type: "object";
|
|
5
|
+
readonly properties: {
|
|
6
|
+
readonly mode: {
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
readonly enum: readonly ["add", "search", "profile", "list", "forget", "help", "migrate", "list-shards", "export", "import", "space"];
|
|
9
|
+
};
|
|
10
|
+
readonly content: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
};
|
|
13
|
+
readonly query: {
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
};
|
|
16
|
+
readonly tags: {
|
|
17
|
+
readonly type: "string";
|
|
18
|
+
};
|
|
19
|
+
readonly type: {
|
|
20
|
+
readonly type: "string";
|
|
21
|
+
};
|
|
22
|
+
readonly memoryId: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
};
|
|
25
|
+
readonly limit: {
|
|
26
|
+
readonly type: "number";
|
|
27
|
+
};
|
|
28
|
+
readonly scope: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly enum: readonly ["project", "all-projects"];
|
|
31
|
+
};
|
|
32
|
+
readonly fromPath: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
};
|
|
35
|
+
readonly fromHash: {
|
|
36
|
+
readonly type: "string";
|
|
37
|
+
};
|
|
38
|
+
readonly outputPath: {
|
|
39
|
+
readonly type: "string";
|
|
40
|
+
};
|
|
41
|
+
readonly inputPath: {
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
};
|
|
44
|
+
readonly dryRun: {
|
|
45
|
+
readonly type: "boolean";
|
|
46
|
+
};
|
|
47
|
+
readonly allowLinkedSource: {
|
|
48
|
+
readonly type: "boolean";
|
|
49
|
+
};
|
|
50
|
+
readonly spaceAction: {
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
};
|
|
53
|
+
readonly spaceName: {
|
|
54
|
+
readonly type: "string";
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
readonly additionalProperties: false;
|
|
58
|
+
};
|
|
3
59
|
/** Per-session state is bounded so long-running servers cannot grow it without limit. */
|
|
4
60
|
export declare const MAX_TRACKED_SESSIONS = 256;
|
|
5
61
|
/** Session ids remembered as already seen by this process, for the first-prompt rule. */
|
package/dist/v2/adapter.js
CHANGED
|
@@ -6,7 +6,7 @@ import { utf8ByteLength } from "../utils/context-limit.js";
|
|
|
6
6
|
import { eventBelongsToLocation, legacyToolResult, toLegacyEvent } from "./legacy-client.js";
|
|
7
7
|
import { createRecallReporter } from "./recall-reporter.js";
|
|
8
8
|
import { createSessionParents } from "./session-parent.js";
|
|
9
|
-
const memoryInput = {
|
|
9
|
+
export const memoryInput = {
|
|
10
10
|
type: "object",
|
|
11
11
|
properties: {
|
|
12
12
|
mode: {
|
|
@@ -22,6 +22,7 @@ const memoryInput = {
|
|
|
22
22
|
"list-shards",
|
|
23
23
|
"export",
|
|
24
24
|
"import",
|
|
25
|
+
"space",
|
|
25
26
|
],
|
|
26
27
|
},
|
|
27
28
|
content: { type: "string" },
|
|
@@ -37,6 +38,8 @@ const memoryInput = {
|
|
|
37
38
|
inputPath: { type: "string" },
|
|
38
39
|
dryRun: { type: "boolean" },
|
|
39
40
|
allowLinkedSource: { type: "boolean" },
|
|
41
|
+
spaceAction: { type: "string" },
|
|
42
|
+
spaceName: { type: "string" },
|
|
40
43
|
},
|
|
41
44
|
additionalProperties: false,
|
|
42
45
|
};
|