Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/hindsight-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ describe("hindsight client wrapper", () => {
options: {
documentId: "session-1",
metadata: { agent: "build" },
async: true,
updateMode: "replace",
},
},
Expand Down
8 changes: 7 additions & 1 deletion src/hindsight-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ export interface HindsightSdkClient {
retain(
bankId: string,
content: string,
options?: { documentId?: string; metadata?: Record<string, string>; updateMode?: "replace" | "append" }
options?: {
documentId?: string;
metadata?: Record<string, string>;
updateMode?: "replace" | "append";
async?: boolean;
}
): Promise<unknown>;
recall(bankId: string, query: string): Promise<RecallResponse>;
reflect(bankId: string, query: string, options?: { context?: string }): Promise<ReflectResponse>;
Expand Down Expand Up @@ -66,6 +71,7 @@ class SafeHindsightClientWrapper implements HindsightClientWrapper {
await this.client.retain(options.bankId, options.content, {
documentId: options.documentId,
metadata: options.metadata,
async: true,
updateMode: "replace",
});

Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ export const server: Plugin = async (_input: PluginInput, options?: PluginOption
return createStubHooks(_input, client, logger);
};

const pluginModule: PluginModule = { server };
export const id = "@toady00/opencode-hindsight";

const pluginModule: PluginModule & { id: string } = { id, server };

export default pluginModule;
export {
Expand Down