@mem9/opencode 0.1.0 → 0.1.1
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/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/server/backend.ts +1 -1
- package/src/server/config.ts +4 -4
- package/src/server/hooks.ts +7 -7
- package/src/server/index.ts +9 -9
- package/src/server/ingest/select.ts +1 -1
- package/src/server/ingest/submit.ts +3 -3
- package/src/server/recall/format.ts +1 -1
- package/src/server/server-backend.ts +3 -3
- package/src/server/session-transcript.ts +1 -1
- package/src/server/setup-flow.ts +1 -1
- package/src/server/tools.ts +2 -2
- package/src/shared/credentials-store.ts +1 -1
- package/src/shared/defaults.ts +1 -1
- package/src/shared/setup-files.ts +4 -4
- package/src/tui/index.ts +3 -3
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from "./server/index.
|
|
1
|
+
export { default } from "./server/index.ts";
|
package/src/server/backend.ts
CHANGED
package/src/server/config.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
3
|
-
import { parseCredentialsFile } from "../shared/credentials-store.
|
|
4
|
-
import { DEFAULT_SCOPE_CONFIG } from "../shared/defaults.
|
|
3
|
+
import { parseCredentialsFile } from "../shared/credentials-store.ts";
|
|
4
|
+
import { DEFAULT_SCOPE_CONFIG } from "../shared/defaults.ts";
|
|
5
5
|
import {
|
|
6
6
|
resolveOpenCodeBasePaths,
|
|
7
7
|
resolveMem9Home,
|
|
8
8
|
resolveMem9Paths,
|
|
9
9
|
type Mem9ResolvedPaths,
|
|
10
|
-
} from "../shared/platform-paths.
|
|
10
|
+
} from "../shared/platform-paths.ts";
|
|
11
11
|
import {
|
|
12
12
|
DEFAULT_API_URL,
|
|
13
13
|
type Mem9ConfigFile,
|
|
14
14
|
type Mem9CredentialsFile,
|
|
15
|
-
} from "../shared/types.
|
|
15
|
+
} from "../shared/types.ts";
|
|
16
16
|
|
|
17
17
|
const EMPTY_CREDENTIALS: Mem9CredentialsFile = {
|
|
18
18
|
schemaVersion: 1,
|
package/src/server/hooks.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Hooks } from "@opencode-ai/plugin";
|
|
2
|
-
import type { IngestMessage, MemoryBackend } from "./backend.
|
|
3
|
-
import type { DebugLogger } from "./debug.
|
|
4
|
-
import { selectMessagesForIngest } from "./ingest/select.
|
|
5
|
-
import { submitMessagesForIngest } from "./ingest/submit.
|
|
6
|
-
import { formatRecallBlock } from "./recall/format.
|
|
7
|
-
import { buildRecallQuery } from "./recall/query.
|
|
8
|
-
import type { SessionTranscriptLoader } from "./session-transcript.
|
|
2
|
+
import type { IngestMessage, MemoryBackend } from "./backend.ts";
|
|
3
|
+
import type { DebugLogger } from "./debug.ts";
|
|
4
|
+
import { selectMessagesForIngest } from "./ingest/select.ts";
|
|
5
|
+
import { submitMessagesForIngest } from "./ingest/submit.ts";
|
|
6
|
+
import { formatRecallBlock } from "./recall/format.ts";
|
|
7
|
+
import { buildRecallQuery } from "./recall/query.ts";
|
|
8
|
+
import type { SessionTranscriptLoader } from "./session-transcript.ts";
|
|
9
9
|
|
|
10
10
|
const MAX_RECALL_RESULTS = 10;
|
|
11
11
|
const MIN_RECALL_QUERY_LEN = 5;
|
package/src/server/index.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { Hooks, Plugin } from "@opencode-ai/plugin";
|
|
2
|
-
import type { MemoryBackend } from "./backend.
|
|
2
|
+
import type { MemoryBackend } from "./backend.ts";
|
|
3
3
|
import {
|
|
4
4
|
resolveEffectiveConfig,
|
|
5
5
|
resolvePluginIdentity,
|
|
6
|
-
} from "./config.
|
|
7
|
-
import { createDebugLogger } from "./debug.
|
|
8
|
-
import { ServerBackend } from "./server-backend.
|
|
9
|
-
import { buildPendingSetupHooks } from "./setup-flow.
|
|
10
|
-
import { buildTools } from "./tools.
|
|
11
|
-
import { buildHooks } from "./hooks.
|
|
12
|
-
import { createSessionTranscriptLoader } from "./session-transcript.
|
|
13
|
-
import { PLUGIN_ID } from "../shared/plugin-meta.
|
|
6
|
+
} from "./config.ts";
|
|
7
|
+
import { createDebugLogger } from "./debug.ts";
|
|
8
|
+
import { ServerBackend } from "./server-backend.ts";
|
|
9
|
+
import { buildPendingSetupHooks } from "./setup-flow.ts";
|
|
10
|
+
import { buildTools } from "./tools.ts";
|
|
11
|
+
import { buildHooks } from "./hooks.ts";
|
|
12
|
+
import { createSessionTranscriptLoader } from "./session-transcript.ts";
|
|
13
|
+
import { PLUGIN_ID } from "../shared/plugin-meta.ts";
|
|
14
14
|
|
|
15
15
|
function buildPluginHooksAndTools(
|
|
16
16
|
backend: MemoryBackend,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { IngestInput, IngestResult, MemoryBackend } from "../backend.
|
|
2
|
-
import type { DebugLogger } from "../debug.
|
|
3
|
-
import { selectMessagesForIngest } from "./select.
|
|
1
|
+
import type { IngestInput, IngestResult, MemoryBackend } from "../backend.ts";
|
|
2
|
+
import type { DebugLogger } from "../debug.ts";
|
|
3
|
+
import { selectMessagesForIngest } from "./select.ts";
|
|
4
4
|
|
|
5
5
|
export interface SubmitIngestOptions {
|
|
6
6
|
backend: MemoryBackend;
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
IngestInput,
|
|
3
3
|
IngestResult,
|
|
4
4
|
MemoryBackend,
|
|
5
|
-
} from "./backend.
|
|
5
|
+
} from "./backend.ts";
|
|
6
6
|
import type {
|
|
7
7
|
Memory,
|
|
8
8
|
StoreResult,
|
|
@@ -10,8 +10,8 @@ import type {
|
|
|
10
10
|
CreateMemoryInput,
|
|
11
11
|
UpdateMemoryInput,
|
|
12
12
|
SearchInput,
|
|
13
|
-
} from "../shared/types.
|
|
14
|
-
import { DEFAULT_SCOPE_CONFIG } from "../shared/defaults.
|
|
13
|
+
} from "../shared/types.ts";
|
|
14
|
+
import { DEFAULT_SCOPE_CONFIG } from "../shared/defaults.ts";
|
|
15
15
|
|
|
16
16
|
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
17
17
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
package/src/server/setup-flow.ts
CHANGED
package/src/server/tools.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { tool } from "@opencode-ai/plugin";
|
|
2
|
-
import type { MemoryBackend } from "./backend.
|
|
2
|
+
import type { MemoryBackend } from "./backend.ts";
|
|
3
3
|
import type {
|
|
4
4
|
CreateMemoryInput,
|
|
5
5
|
UpdateMemoryInput,
|
|
6
6
|
SearchInput,
|
|
7
|
-
} from "../shared/types.
|
|
7
|
+
} from "../shared/types.ts";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Build the 5 memory tools for OpenCode.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Mem9CredentialsFile, Mem9Profile } from "./types.
|
|
1
|
+
import type { Mem9CredentialsFile, Mem9Profile } from "./types.ts";
|
|
2
2
|
|
|
3
3
|
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
4
4
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
package/src/shared/defaults.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import type { Mem9ResolvedPaths } from "./platform-paths.
|
|
4
|
-
import { parseCredentialsFile, stringifyCredentialsFile } from "./credentials-store.
|
|
5
|
-
import { DEFAULT_SCOPE_CONFIG } from "./defaults.
|
|
3
|
+
import type { Mem9ResolvedPaths } from "./platform-paths.ts";
|
|
4
|
+
import { parseCredentialsFile, stringifyCredentialsFile } from "./credentials-store.ts";
|
|
5
|
+
import { DEFAULT_SCOPE_CONFIG } from "./defaults.ts";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_API_URL,
|
|
8
8
|
type Mem9ConfigFile,
|
|
9
9
|
type Mem9CredentialsFile,
|
|
10
10
|
type Mem9Profile,
|
|
11
|
-
} from "./types.
|
|
11
|
+
} from "./types.ts";
|
|
12
12
|
|
|
13
13
|
export type SetupScope = "user" | "project";
|
|
14
14
|
|
package/src/tui/index.ts
CHANGED
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
resolveMem9Home,
|
|
9
9
|
resolveMem9Paths,
|
|
10
10
|
type Mem9ResolvedPaths,
|
|
11
|
-
} from "../shared/platform-paths.
|
|
12
|
-
import { PLUGIN_ID } from "../shared/plugin-meta.
|
|
11
|
+
} from "../shared/platform-paths.ts";
|
|
12
|
+
import { PLUGIN_ID } from "../shared/plugin-meta.ts";
|
|
13
13
|
import {
|
|
14
14
|
loadSetupState,
|
|
15
15
|
provisionApiKey,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
type SetupProfileSummary,
|
|
20
20
|
type SetupScope,
|
|
21
21
|
type SetupState,
|
|
22
|
-
} from "../shared/setup-files.
|
|
22
|
+
} from "../shared/setup-files.ts";
|
|
23
23
|
|
|
24
24
|
type SetupAction =
|
|
25
25
|
| "auto-api-key"
|