om-memory-system 5.10.1 → 6.1.0-next.237
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 +1 -1
- package/dist/adapters/opencode/auto-capture-host.d.ts +2 -2
- package/dist/adapters/opencode/auto-capture-host.js +5 -15
- package/dist/adapters/opencode/auto-capture-summary.js +9 -6
- package/dist/adapters/opencode/backfill-models.js +1 -1
- package/dist/adapters/opencode/backfill-startup.js +5 -4
- package/dist/adapters/opencode/conversation.d.ts +5 -1
- package/dist/adapters/opencode/conversation.js +23 -23
- package/dist/adapters/opencode/import-command.d.ts +0 -12
- package/dist/adapters/opencode/import-command.js +1 -17
- package/dist/adapters/opencode/internal-capture-sessions.d.ts +0 -3
- package/dist/adapters/opencode/internal-capture-sessions.js +0 -26
- package/dist/adapters/opencode/memory-tool.d.ts +3 -4
- package/dist/adapters/opencode/memory-tool.js +8 -50
- package/dist/adapters/opencode/opencode-host.d.ts +27 -0
- package/dist/adapters/opencode/opencode-host.js +30 -0
- package/dist/adapters/opencode/opencode-import-models.d.ts +2 -2
- package/dist/adapters/opencode/opencode-import-models.js +8 -10
- package/dist/adapters/opencode/opencode-provider.d.ts +23 -62
- package/dist/adapters/opencode/opencode-provider.js +75 -378
- package/dist/adapters/opencode/package-skills.d.ts +1 -6
- package/dist/adapters/opencode/package-skills.js +2 -17
- package/dist/adapters/opencode/profile-learning.d.ts +1 -2
- package/dist/adapters/opencode/profile-learning.js +15 -19
- package/dist/adapters/opencode/profile-llm-client.d.ts +3 -2
- package/dist/adapters/opencode/profile-llm-client.js +8 -17
- package/dist/adapters/opencode/profile-model.d.ts +2 -18
- package/dist/adapters/opencode/profile-model.js +18 -69
- package/dist/adapters/opencode/prompt-model.d.ts +9 -0
- package/dist/adapters/opencode/prompt-model.js +21 -0
- package/dist/adapters/opencode/skills-tool.d.ts +3 -3
- package/dist/adapters/opencode/skills-tool.js +4 -30
- package/dist/adapters/opencode/toast.d.ts +11 -0
- package/dist/adapters/opencode/toast.js +11 -0
- package/dist/adapters/opencode/user-prompt.d.ts +2 -2
- package/dist/adapters/opencode/user-prompt.js +4 -5
- package/dist/config-template.d.ts +1 -1
- package/dist/config-template.js +2 -6
- package/dist/config.d.ts +0 -9
- package/dist/config.js +0 -9
- package/dist/core/retrieval.d.ts +0 -21
- package/dist/core/retrieval.js +0 -29
- package/dist/importer/handled-lookup.d.ts +17 -0
- package/dist/importer/handled-lookup.js +13 -0
- package/dist/importer/importer.js +3 -3
- package/dist/importer/ledger.d.ts +9 -0
- package/dist/importer/ledger.js +21 -0
- package/dist/importer/opencode-reader.d.ts +1 -1
- package/dist/importer/opencode-reader.js +88 -34
- package/dist/importer/opencode-v2-units.d.ts +16 -0
- package/dist/importer/opencode-v2-units.js +93 -0
- package/dist/importer/settings-models.d.ts +11 -6
- package/dist/importer/settings-models.js +15 -11
- package/dist/plugin.d.ts +0 -3
- package/dist/plugin.js +1 -7
- package/dist/services/global-config-writer.js +2 -3
- package/dist/services/settings-snapshot.js +6 -6
- package/dist/services/turso/vector-search.js +4 -2
- package/dist/shared/api/schemas.d.ts +1 -1
- package/dist/utils/memory-limits.d.ts +0 -1
- package/dist/utils/memory-limits.js +0 -1
- package/dist/v2/adapter.d.ts +16 -84
- package/dist/v2/adapter.js +17 -88
- package/dist/v2/memory-bridge.js +1 -1
- package/dist/v2/plugin.js +27 -16
- package/dist/v2/session-events.d.ts +30 -0
- package/dist/v2/session-events.js +130 -0
- package/dist/v2/startup.d.ts +14 -0
- package/dist/v2/startup.js +210 -0
- package/dist/v2/tools.d.ts +106 -0
- package/dist/v2/tools.js +89 -0
- package/dist/web/assets/index-DBSeQOs6.js +171 -0
- package/dist/web/index.html +1 -1
- package/package.json +2 -14
- package/dist/adapters/opencode/in-process-client.d.ts +0 -2
- package/dist/adapters/opencode/in-process-client.js +0 -16
- package/dist/adapters/opencode/opencode-diagnostics.d.ts +0 -7
- package/dist/adapters/opencode/opencode-diagnostics.js +0 -37
- package/dist/adapters/opencode/opencode-host-config.d.ts +0 -13
- package/dist/adapters/opencode/opencode-host-config.js +0 -53
- package/dist/adapters/opencode/opencode-sdk-client.d.ts +0 -6
- package/dist/adapters/opencode/opencode-sdk-client.js +0 -38
- package/dist/index.d.ts +0 -28
- package/dist/index.js +0 -620
- package/dist/v2/legacy-client.d.ts +0 -15
- package/dist/v2/legacy-client.js +0 -275
- package/dist/web/assets/index-DQgI670D.js +0 -171
package/dist/web/index.html
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<link rel="icon" type="image/svg+xml" href="/omms-icon.svg" />
|
|
34
34
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
35
35
|
<title>OMMS Memory Explorer</title>
|
|
36
|
-
<script type="module" crossorigin src="/assets/index-
|
|
36
|
+
<script type="module" crossorigin src="/assets/index-DBSeQOs6.js"></script>
|
|
37
37
|
<link rel="stylesheet" crossorigin href="/assets/index-CoYuPYCS.css">
|
|
38
38
|
</head>
|
|
39
39
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "om-memory-system",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0-next.237",
|
|
4
4
|
"description": "Opinionated modular memory system for coding agents (OpenCode + Pi)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/plugin.js",
|
|
@@ -14,11 +14,6 @@
|
|
|
14
14
|
"import": "./dist/plugin.js",
|
|
15
15
|
"default": "./dist/plugin.js"
|
|
16
16
|
},
|
|
17
|
-
"./server": {
|
|
18
|
-
"types": "./dist/plugin.d.ts",
|
|
19
|
-
"import": "./dist/plugin.js",
|
|
20
|
-
"default": "./dist/plugin.js"
|
|
21
|
-
},
|
|
22
17
|
"./v2": {
|
|
23
18
|
"types": "./dist/v2/plugin.d.ts",
|
|
24
19
|
"import": "./dist/v2/plugin.js",
|
|
@@ -80,8 +75,6 @@
|
|
|
80
75
|
"dependencies": {
|
|
81
76
|
"@huggingface/transformers": "^4.2.0",
|
|
82
77
|
"@libsql/client": "^0.17.4",
|
|
83
|
-
"@opencode-ai/plugin": "^1.18.15",
|
|
84
|
-
"@opencode-ai/sdk": "^1.18.15",
|
|
85
78
|
"franc-min": "^6.2.0",
|
|
86
79
|
"hono": "^4.12.32",
|
|
87
80
|
"iso-639-3": "^3.0.1",
|
|
@@ -130,12 +123,7 @@
|
|
|
130
123
|
"typescript-eslint": "^8.70.0"
|
|
131
124
|
},
|
|
132
125
|
"opencode": {
|
|
133
|
-
"type": "plugin"
|
|
134
|
-
"hooks": [
|
|
135
|
-
"chat.message",
|
|
136
|
-
"chat.params",
|
|
137
|
-
"event"
|
|
138
|
-
]
|
|
126
|
+
"type": "plugin"
|
|
139
127
|
},
|
|
140
128
|
"pi": {
|
|
141
129
|
"extensions": [
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Marks a host client that talks to OpenCode in-process. The V2 legacy client
|
|
3
|
-
* is one: it calls the plugin context directly, so it has no HTTP transport
|
|
4
|
-
* and no fetch to borrow. The transport setup skips its "no host fetch"
|
|
5
|
-
* warning for it.
|
|
6
|
-
*/
|
|
7
|
-
const IN_PROCESS_CLIENT = Symbol.for("omms.opencode.inProcessClient");
|
|
8
|
-
export function markInProcessClient(client) {
|
|
9
|
-
Object.defineProperty(client, IN_PROCESS_CLIENT, { value: true });
|
|
10
|
-
return client;
|
|
11
|
-
}
|
|
12
|
-
export function isInProcessClient(client) {
|
|
13
|
-
return (typeof client === "object" &&
|
|
14
|
-
client !== null &&
|
|
15
|
-
client[IN_PROCESS_CLIENT] === true);
|
|
16
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface FetchEndpoint {
|
|
2
|
-
readonly label: string;
|
|
3
|
-
readonly url: string;
|
|
4
|
-
}
|
|
5
|
-
export declare function diagnosticUrl(url: string): string;
|
|
6
|
-
export declare function responseStatus(res: Response): string;
|
|
7
|
-
export declare function readJson<T>(res: Response, endpoint: FetchEndpoint): Promise<T>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { httpStatusError, parseRetryAfter } from "../../core/capture-retry-policy.js";
|
|
2
|
-
export function diagnosticUrl(url) {
|
|
3
|
-
try {
|
|
4
|
-
const parsed = new URL(url);
|
|
5
|
-
parsed.search = "";
|
|
6
|
-
return parsed.toString();
|
|
7
|
-
}
|
|
8
|
-
catch {
|
|
9
|
-
return url.split("?")[0] ?? url;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export function responseStatus(res) {
|
|
13
|
-
const statusTextByCode = {
|
|
14
|
-
500: "Internal Server Error",
|
|
15
|
-
502: "Bad Gateway",
|
|
16
|
-
};
|
|
17
|
-
return `${res.status} ${res.statusText || statusTextByCode[res.status] || "Unknown Status"}`;
|
|
18
|
-
}
|
|
19
|
-
function redactedBody(text) {
|
|
20
|
-
return text ? "<redacted response body>" : "<empty body>";
|
|
21
|
-
}
|
|
22
|
-
export async function readJson(res, endpoint) {
|
|
23
|
-
const text = await res.text();
|
|
24
|
-
const url = diagnosticUrl(endpoint.url);
|
|
25
|
-
if (!res.ok) {
|
|
26
|
-
throw httpStatusError(`omms: opencode ${endpoint.label} failed at ${url} (${responseStatus(res)}): ${redactedBody(text)}`, res.status, parseRetryAfter(res.headers?.get?.("retry-after")));
|
|
27
|
-
}
|
|
28
|
-
if (!text) {
|
|
29
|
-
throw new Error(`omms: opencode ${endpoint.label} at ${url} returned an empty response body`);
|
|
30
|
-
}
|
|
31
|
-
try {
|
|
32
|
-
return JSON.parse(text);
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
throw new Error(`omms: opencode ${endpoint.label} at ${url} returned non-JSON body: ${redactedBody(text)}`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type HostClientConfig = {
|
|
2
|
-
readonly baseUrl: string | undefined;
|
|
3
|
-
readonly fetch: typeof fetch | undefined;
|
|
4
|
-
readonly headers?: RequestInit["headers"];
|
|
5
|
-
/** Present when the host client runs in-process (OpenCode v2): no HTTP
|
|
6
|
-
* transport, so a missing fetch is expected and not worth a warning. */
|
|
7
|
-
readonly inProcess?: true;
|
|
8
|
-
readonly clientKeys: readonly string[];
|
|
9
|
-
readonly sdkConfigCount: number;
|
|
10
|
-
};
|
|
11
|
-
export declare function getHostClientConfig(ctx: {
|
|
12
|
-
readonly client: unknown;
|
|
13
|
-
}): HostClientConfig;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { isInProcessClient } from "./in-process-client.js";
|
|
2
|
-
export function getHostClientConfig(ctx) {
|
|
3
|
-
const client = toRecord(ctx.client);
|
|
4
|
-
if (!client) {
|
|
5
|
-
return { baseUrl: undefined, fetch: undefined, clientKeys: [], sdkConfigCount: 0 };
|
|
6
|
-
}
|
|
7
|
-
const configs = sdkConfigs(client);
|
|
8
|
-
const baseUrl = configs.find((config) => typeof config["baseUrl"] === "string")?.["baseUrl"];
|
|
9
|
-
const customFetch = configs.find((config) => isFetch(config["fetch"]))?.["fetch"];
|
|
10
|
-
const headers = configs.find((config) => isHeadersInit(config["headers"]))?.["headers"];
|
|
11
|
-
return {
|
|
12
|
-
baseUrl: typeof baseUrl === "string" ? baseUrl : undefined,
|
|
13
|
-
fetch: isFetch(customFetch) ? customFetch : undefined,
|
|
14
|
-
...(isHeadersInit(headers) ? { headers } : {}),
|
|
15
|
-
...(isInProcessClient(client) ? { inProcess: true } : {}),
|
|
16
|
-
clientKeys: Object.keys(client),
|
|
17
|
-
sdkConfigCount: configs.length,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function sdkConfigs(client) {
|
|
21
|
-
const configs = [];
|
|
22
|
-
const nestedClients = Object.values(client).flatMap((value) => {
|
|
23
|
-
const record = toRecord(value);
|
|
24
|
-
return record ? [record] : [];
|
|
25
|
-
});
|
|
26
|
-
const candidates = [client, ...nestedClients];
|
|
27
|
-
for (const candidate of candidates) {
|
|
28
|
-
const sdkClient = toRecord(candidate["_client"]);
|
|
29
|
-
const getConfig = sdkClient?.["getConfig"];
|
|
30
|
-
if (!isConfigGetter(getConfig))
|
|
31
|
-
continue;
|
|
32
|
-
const config = toRecord(getConfig.call(sdkClient));
|
|
33
|
-
if (config)
|
|
34
|
-
configs.push(config);
|
|
35
|
-
}
|
|
36
|
-
return configs;
|
|
37
|
-
}
|
|
38
|
-
function toRecord(value) {
|
|
39
|
-
if (typeof value !== "object" || value === null)
|
|
40
|
-
return undefined;
|
|
41
|
-
return value;
|
|
42
|
-
}
|
|
43
|
-
function isConfigGetter(value) {
|
|
44
|
-
return typeof value === "function";
|
|
45
|
-
}
|
|
46
|
-
function isFetch(value) {
|
|
47
|
-
return typeof value === "function";
|
|
48
|
-
}
|
|
49
|
-
function isHeadersInit(value) {
|
|
50
|
-
return (value instanceof Headers ||
|
|
51
|
-
Array.isArray(value) ||
|
|
52
|
-
(typeof value === "object" && value !== null));
|
|
53
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { OpencodeClient } from "@opencode-ai/sdk/v2/client";
|
|
2
|
-
export type HostTransport = {
|
|
3
|
-
readonly fetch?: typeof fetch;
|
|
4
|
-
readonly headers?: RequestInit["headers"];
|
|
5
|
-
};
|
|
6
|
-
export declare function createLazyV2Client(baseUrl: string, transport?: HostTransport): OpencodeClient;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
function getOpencodeSdkClientSpecifier() {
|
|
2
|
-
return ["@opencode-ai/sdk", "/v2/client"].join("");
|
|
3
|
-
}
|
|
4
|
-
async function createSdkClient(baseUrl, transport) {
|
|
5
|
-
const sdk = (await import(getOpencodeSdkClientSpecifier()));
|
|
6
|
-
return sdk.createOpencodeClient({
|
|
7
|
-
baseUrl,
|
|
8
|
-
...(transport?.fetch ? { fetch: transport.fetch } : {}),
|
|
9
|
-
...(transport?.headers ? { headers: transport.headers } : {}),
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
export function createLazyV2Client(baseUrl, transport) {
|
|
13
|
-
let sdkClientPromise;
|
|
14
|
-
const getSdkClient = () => {
|
|
15
|
-
sdkClientPromise ??= createSdkClient(baseUrl, transport);
|
|
16
|
-
return sdkClientPromise;
|
|
17
|
-
};
|
|
18
|
-
return {
|
|
19
|
-
session: {
|
|
20
|
-
create: async (...args) => {
|
|
21
|
-
const client = await getSdkClient();
|
|
22
|
-
return client.session.create(...args);
|
|
23
|
-
},
|
|
24
|
-
prompt: async (...args) => {
|
|
25
|
-
const client = await getSdkClient();
|
|
26
|
-
return client.session.prompt(...args);
|
|
27
|
-
},
|
|
28
|
-
delete: async (...args) => {
|
|
29
|
-
const client = await getSdkClient();
|
|
30
|
-
return client.session.delete(...args);
|
|
31
|
-
},
|
|
32
|
-
abort: async (...args) => {
|
|
33
|
-
const client = await getSdkClient();
|
|
34
|
-
return client.session.abort(...args);
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from "@opencode-ai/plugin";
|
|
2
|
-
import { isStructuredSummaryPromptMessage } from "./adapters/opencode/user-prompt.js";
|
|
3
|
-
import { INTERNAL_CAPTURE_SESSION_TITLE, isInternalCaptureSessionTitle } from "./adapters/opencode/internal-capture-sessions.js";
|
|
4
|
-
export { INTERNAL_CAPTURE_SESSION_TITLE, isInternalCaptureSessionTitle };
|
|
5
|
-
export { isStructuredSummaryPromptMessage };
|
|
6
|
-
/**
|
|
7
|
-
* Resolve the session's active agent so compaction memory injection does not
|
|
8
|
-
* reset OpenCode to the stock "general-purpose" fallback (issue #236).
|
|
9
|
-
*
|
|
10
|
-
* Preference order:
|
|
11
|
-
* 1. session.get().agent (v2 hosts)
|
|
12
|
-
* 2. Latest non-compaction user message agent
|
|
13
|
-
* 3. Latest non-compaction / non-summary assistant mode (v1) or agent (v2)
|
|
14
|
-
*/
|
|
15
|
-
export declare function resolveSessionAgent(client: unknown, sessionID: string): Promise<string | undefined>;
|
|
16
|
-
/** Register `/memory-import-opencode-history`; its work happens in command.execute.before. */
|
|
17
|
-
export declare function applyHistoryImportCommandConfig(cfg: {
|
|
18
|
-
command?: Record<string, unknown>;
|
|
19
|
-
}): void;
|
|
20
|
-
/** Least-privilege agent used only by internal structured-output sessions (issue #189). */
|
|
21
|
-
export declare function applyStructuredOutputAgentConfig(cfg: {
|
|
22
|
-
agent?: Record<string, unknown>;
|
|
23
|
-
}): void;
|
|
24
|
-
export declare function configureOpencodeHostTransport(ctx: {
|
|
25
|
-
readonly client: unknown;
|
|
26
|
-
readonly serverUrl?: string | URL;
|
|
27
|
-
}): Promise<void>;
|
|
28
|
-
export declare const OmmsPlugin: Plugin;
|