@ephemushroom/opencode-claude-mem 0.6.2 → 0.7.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 +127 -594
- package/dist/cli.js +217 -342
- package/dist/sidebar-model.d.ts +29 -4
- package/dist/tui.js +127 -341
- package/dist/worker-client.d.ts +24 -89
- package/package.json +8 -25
- package/dist/file-context.d.ts +0 -17
- package/dist/index.d.ts +0 -20
- package/dist/index.js +0 -13844
- package/dist/memory-options.d.ts +0 -12
- package/dist/memory-session.d.ts +0 -22
- package/dist/memory-turn.d.ts +0 -10
- package/dist/memory-worker.d.ts +0 -21
- package/dist/package-server.d.ts +0 -7
- package/dist/package-server.js +0 -10
- package/dist/shared.d.ts +0 -14
- package/dist/tui-registration.d.ts +0 -16
- package/dist/v2.d.ts +0 -22
- package/dist/v2.js +0 -5133
package/dist/memory-options.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface InjectionOptions {
|
|
2
|
-
readonly enabled: boolean;
|
|
3
|
-
readonly limit: number;
|
|
4
|
-
readonly maxChars: number;
|
|
5
|
-
readonly timeoutMs: number;
|
|
6
|
-
}
|
|
7
|
-
export interface MemoryOptions {
|
|
8
|
-
readonly semanticInjection: InjectionOptions;
|
|
9
|
-
readonly fileContext: InjectionOptions;
|
|
10
|
-
}
|
|
11
|
-
export declare function parseMemoryOptions(options: unknown, env: Readonly<Record<string, string | undefined>>, settings: unknown): MemoryOptions;
|
|
12
|
-
export declare function resolveMemoryOptions(options: unknown): MemoryOptions;
|
package/dist/memory-session.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { MemoryOptions } from './memory-options';
|
|
2
|
-
import type { MemoryTurn } from './memory-turn';
|
|
3
|
-
import { MemoryWorker } from './memory-worker';
|
|
4
|
-
export declare class MemorySessions {
|
|
5
|
-
private readonly sessions;
|
|
6
|
-
private readonly deleted;
|
|
7
|
-
private readonly options;
|
|
8
|
-
private readonly worker;
|
|
9
|
-
constructor(options: MemoryOptions, worker?: typeof MemoryWorker);
|
|
10
|
-
private state;
|
|
11
|
-
select(session: string, turn: MemoryTurn): boolean;
|
|
12
|
-
hasTurn(session: string): boolean;
|
|
13
|
-
hasMessage(session: string, id: string): boolean;
|
|
14
|
-
isDeleted(session: string): boolean;
|
|
15
|
-
canCapture(session: string): boolean;
|
|
16
|
-
register(session: string, project: string): Promise<boolean>;
|
|
17
|
-
semantic(session: string, project: string): Promise<string>;
|
|
18
|
-
context(session: string, project: string): Promise<string | null>;
|
|
19
|
-
invalidate(session: string): void;
|
|
20
|
-
delete(session: string): void;
|
|
21
|
-
clear(): void;
|
|
22
|
-
}
|
package/dist/memory-turn.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface MemoryTurn {
|
|
2
|
-
readonly id: string;
|
|
3
|
-
readonly text: string;
|
|
4
|
-
readonly capture: boolean;
|
|
5
|
-
readonly semantic: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function memoryTurn(id: string, text: string, media?: boolean): MemoryTurn;
|
|
8
|
-
/** Only consumed session context, never the admission/inbox list. */
|
|
9
|
-
export declare function deliveredTurn(messages: readonly unknown[]): MemoryTurn | undefined;
|
|
10
|
-
export declare function resumedV1Turn(messages: unknown): MemoryTurn | undefined;
|
package/dist/memory-worker.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { InjectionOptions } from './memory-options';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
declare const fileResponse: z.ZodObject<{
|
|
4
|
-
observations: z.ZodArray<z.ZodObject<{
|
|
5
|
-
id: z.ZodNumber;
|
|
6
|
-
title: z.ZodNullable<z.ZodString>;
|
|
7
|
-
type: z.ZodString;
|
|
8
|
-
created_at_epoch: z.ZodNumber;
|
|
9
|
-
memory_session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
-
}, z.core.$strip>>;
|
|
11
|
-
count: z.ZodNumber;
|
|
12
|
-
}, z.core.$strip>;
|
|
13
|
-
export type FileObservation = z.infer<typeof fileResponse>['observations'][number];
|
|
14
|
-
export declare class MemoryWorker {
|
|
15
|
-
private static readonly baseUrl;
|
|
16
|
-
private static json;
|
|
17
|
-
static save(input: unknown, project: string): Promise<string>;
|
|
18
|
-
static semantic(prompt: string, project: string, options: InjectionOptions): Promise<string>;
|
|
19
|
-
static byFile(paths: readonly string[], project: string, options: InjectionOptions): Promise<readonly FileObservation[]>;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
package/dist/package-server.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { ClaudeMemPlugin } from './index';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
id: string;
|
|
4
|
-
server: import("@opencode-ai/plugin").Plugin;
|
|
5
|
-
setup: (context: import("@opencode-ai/plugin-v2/promise/plugin").Context) => Promise<import("@opencode-ai/plugin-v2/promise/plugin").Cleanup | void> | import("@opencode-ai/plugin-v2/promise/plugin").Cleanup | void;
|
|
6
|
-
};
|
|
7
|
-
export default _default;
|
package/dist/package-server.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// src/package-server.ts
|
|
3
|
-
import v1 from "./index";
|
|
4
|
-
import v2 from "./v2";
|
|
5
|
-
import { ClaudeMemPlugin } from "./index";
|
|
6
|
-
var package_server_default = { id: v2.id, server: v1.server, setup: v2.setup };
|
|
7
|
-
export {
|
|
8
|
-
ClaudeMemPlugin,
|
|
9
|
-
package_server_default as default
|
|
10
|
-
};
|
package/dist/shared.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const MAX_OBSERVATION_BYTES: number;
|
|
2
|
-
export declare const MAX_TAG_REPLACEMENTS = 100;
|
|
3
|
-
export declare const META_TOOLS: Set<string>;
|
|
4
|
-
export declare function stripTaggedContent(text: string): string;
|
|
5
|
-
export declare function sanitizeObservationValue(value: unknown): unknown;
|
|
6
|
-
export declare function truncateUtf8Bytes(text: string, maxBytes: number): string;
|
|
7
|
-
export declare function shouldSkipObservationTool(toolName: string): boolean;
|
|
8
|
-
export declare function normalizeToolOutput(output: unknown): string;
|
|
9
|
-
/**
|
|
10
|
-
* Extract text content from message parts.
|
|
11
|
-
* Parts can be TextPart, ToolCallPart, etc. We only want text.
|
|
12
|
-
* Skips synthetic/ignored parts to match what is shown to the user.
|
|
13
|
-
*/
|
|
14
|
-
export declare function extractTextFromParts(parts: any[]): string;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type TuiRegistrationResult = 'added' | 'already-present' | 'no-server-entry' | 'malformed' | 'failed';
|
|
2
|
-
/**
|
|
3
|
-
* Self-heal ~/.config/opencode/tui.json: if this plugin is registered as an
|
|
4
|
-
* OpenCode server plugin but missing from the TUI plugin list, append it so
|
|
5
|
-
* the Memory sidebar loads without manual config. Uses writeFileSync (not
|
|
6
|
-
* atomic rename) so a symlinked tui.json keeps pointing at its dotfiles
|
|
7
|
-
* target instead of being replaced by a regular file.
|
|
8
|
-
*/
|
|
9
|
-
export declare function ensureTuiPluginEntry(): TuiRegistrationResult;
|
|
10
|
-
/**
|
|
11
|
-
* V2 self-heal: register the V2 CLI entry in `~/.config/opencode/cli.json`
|
|
12
|
-
* (the V2 CLI/TUI config file) so the Memory sidebar loads in the V2 TUI
|
|
13
|
-
* without manual configuration. The CLI writes strict JSON (2-space indent),
|
|
14
|
-
* so a comment-bearing file is left untouched ('malformed').
|
|
15
|
-
*/
|
|
16
|
-
export declare function ensureCliPluginEntry(): TuiRegistrationResult;
|
package/dist/v2.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenCode V2 plugin for Claude-Mem.
|
|
3
|
-
*
|
|
4
|
-
* V2 is a breaking API change from V1 — plugins are `Plugin.define({ id,
|
|
5
|
-
* setup })` modules with a server-like context instead of a `{ server }`
|
|
6
|
-
* module of hook handlers. This entrypoint is published under the package's
|
|
7
|
-
* `./v2` export; V1 users keep loading the default export (see src/index.ts).
|
|
8
|
-
* Both entrypoints are thin adapters over the same WorkerClient + shared
|
|
9
|
-
* helpers, so V1 and V2 can coexist and talk to the same Claude-Mem worker.
|
|
10
|
-
*
|
|
11
|
-
* V2 API mapping (vs V1):
|
|
12
|
-
* - `experimental.chat.system.transform` → `ctx.session.hook('context')` (push
|
|
13
|
-
* a SystemPart into `event.system`)
|
|
14
|
-
* - `tool.execute.after` → `ctx.tool.hook('execute.after')`
|
|
15
|
-
* - `tool` definitions → `ctx.tool.transform((tools) => tools.add(...))`
|
|
16
|
-
* - `event` lifecycle → `ctx.event.subscribe()` stream
|
|
17
|
-
* - Assistant text capture uses `session.text.ended` events (the event carries
|
|
18
|
-
* the complete text — no debounced re-fetch needed like V1's message.updated)
|
|
19
|
-
* - Summarization fires on `session.execution.succeeded` (V1's session.idle)
|
|
20
|
-
*/
|
|
21
|
-
declare const _default: import("@opencode-ai/plugin-v2/promise/plugin").Plugin;
|
|
22
|
-
export default _default;
|