opencode-codex-memory 0.10.1 → 0.10.3

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.
Files changed (47) hide show
  1. package/README.md +10 -12
  2. package/dist/src/agent-health.js +10 -7
  3. package/dist/src/capture.js +7 -7
  4. package/dist/src/citation.js +12 -3
  5. package/dist/src/claude-import.js +1 -3
  6. package/dist/src/codex-interop.js +20 -5
  7. package/dist/src/db.d.ts +0 -2
  8. package/dist/src/db.js +0 -4
  9. package/dist/src/git-baseline.d.ts +4 -6
  10. package/dist/src/git-baseline.js +45 -68
  11. package/dist/src/host-client.d.ts +5 -0
  12. package/dist/src/host-client.js +24 -0
  13. package/dist/src/index.d.ts +4 -145
  14. package/dist/src/index.js +56 -99
  15. package/dist/src/llm.d.ts +4 -1
  16. package/dist/src/llm.js +41 -13
  17. package/dist/src/options.d.ts +7 -0
  18. package/dist/src/options.js +20 -2
  19. package/dist/src/paths.d.ts +1 -0
  20. package/dist/src/paths.js +5 -2
  21. package/dist/src/phase1.js +12 -21
  22. package/dist/src/phase2.js +3 -3
  23. package/dist/src/reasoning-variant.d.ts +7 -0
  24. package/dist/src/reasoning-variant.js +11 -2
  25. package/dist/src/rollout-input.js +3 -5
  26. package/dist/src/session-version.js +4 -5
  27. package/dist/src/source.js +6 -2
  28. package/dist/src/store.d.ts +3 -2
  29. package/dist/src/store.js +72 -47
  30. package/dist/src/v2/agents.js +11 -14
  31. package/dist/src/v2/model-readiness.js +9 -1
  32. package/dist/src/v2/plugin.js +81 -109
  33. package/dist/src/v2/search-sandbox.js +1 -1
  34. package/dist/src/v2/service.js +5 -0
  35. package/dist/src/v2/shim.d.ts +3 -0
  36. package/dist/src/v2/shim.js +144 -90
  37. package/dist/src/v2/status-rpc.js +40 -14
  38. package/dist/src/v2/status.js +4 -7
  39. package/dist/src/v2/tools.d.ts +20 -14
  40. package/dist/src/v2/tools.js +14 -14
  41. package/dist/src/v2/tui.js +14 -4
  42. package/dist/src/workspace.js +13 -4
  43. package/dist/tools/control.d.ts +4 -33
  44. package/dist/tools/control.js +29 -28
  45. package/dist/tools/memory.d.ts +5 -70
  46. package/dist/tools/memory.js +164 -89
  47. package/package.json +32 -20
@@ -3,17 +3,29 @@
3
3
  *
4
4
  * The memory tools' logic lives in tools/*.ts (V1 tool() definitions) and is
5
5
  * reused verbatim: each V1 definition already bundles {description, args
6
- * (zod raw shape), execute}. V2 accepts any StandardSchema as input, which
7
- * zod v4 satisfies natively, so the adapter just re-wraps the same validate
8
- * + execute path and maps the result shape:
6
+ * (Zod raw shape), execute}. Wrap that shape using the SDK's own tool.schema:
7
+ * its Zod objects implement StandardSchema, which V2 accepts directly.
8
+ * Keep version ownership in the SDK, then map only the result shape:
9
9
  * V1 string | {output, metadata} → V2 {content, metadata}
10
10
  * Inspect additionally reports the V2 host discovery scope and fallback reason.
11
11
  */
12
- import { z } from "zod";
12
+ import { tool } from "@opencode-ai/plugin";
13
+ type CallContext = {
14
+ sessionID: string;
15
+ messageID: string;
16
+ agent: string;
17
+ id?: string;
18
+ signal?: AbortSignal;
19
+ abort?: AbortSignal;
20
+ };
21
+ type Ask = (ctx: CallContext, request: {
22
+ patterns: string[];
23
+ metadata: unknown;
24
+ }) => Promise<void>;
13
25
  interface V2ToolDefinition {
14
26
  name: string;
15
27
  description: string;
16
- input: z.ZodTypeAny;
28
+ input: ReturnType<typeof tool.schema.object>;
17
29
  /**
18
30
  * OpenCode 2 defaults plugin tools into Code Mode (`execute`). The read-path
19
31
  * prompt tells the model to call these by name. Leaving the default hides
@@ -23,12 +35,7 @@ interface V2ToolDefinition {
23
35
  options: {
24
36
  codemode: false;
25
37
  };
26
- execute: (input: any, ctx: {
27
- sessionID: string;
28
- messageID: string;
29
- agent: string;
30
- abort?: AbortSignal;
31
- }) => Promise<{
38
+ execute: (input: any, ctx: CallContext) => Promise<{
32
39
  content: string | unknown[];
33
40
  metadata?: unknown;
34
41
  }>;
@@ -36,8 +43,7 @@ interface V2ToolDefinition {
36
43
  /**
37
44
  * Same gating as the V1 entry: the read/search/list/add-note tools require
38
45
  * BOTH use_memories and dedicated_tools (codex MemoriesExtension); the
39
- * control tools are always available. memory_reset needs user approval,
40
- * which V2 plugin tools cannot request: reset lives in the memory panel.
46
+ * control tools are always available. Destructive reset lives in the panel.
41
47
  */
42
- export declare function buildV2Tools(): V2ToolDefinition[];
48
+ export declare function buildV2Tools(ask?: Ask): V2ToolDefinition[];
43
49
  export {};
@@ -3,22 +3,22 @@
3
3
  *
4
4
  * The memory tools' logic lives in tools/*.ts (V1 tool() definitions) and is
5
5
  * reused verbatim: each V1 definition already bundles {description, args
6
- * (zod raw shape), execute}. V2 accepts any StandardSchema as input, which
7
- * zod v4 satisfies natively, so the adapter just re-wraps the same validate
8
- * + execute path and maps the result shape:
6
+ * (Zod raw shape), execute}. Wrap that shape using the SDK's own tool.schema:
7
+ * its Zod objects implement StandardSchema, which V2 accepts directly.
8
+ * Keep version ownership in the SDK, then map only the result shape:
9
9
  * V1 string | {output, metadata} → V2 {content, metadata}
10
10
  * Inspect additionally reports the V2 host discovery scope and fallback reason.
11
11
  */
12
- import { z } from "zod";
12
+ import { tool } from "@opencode-ai/plugin";
13
13
  import { memory_read, memory_search, memory_list, memory_add_note } from "../../tools/memory.js";
14
14
  import { memory_inspect, memory_mode } from "../../tools/control.js";
15
15
  import { pluginOptions } from "../options.js";
16
16
  import { getV2DiscoveryStatus } from "./shim.js";
17
- function adaptTool(name, v1) {
17
+ function adaptTool(name, v1, ask) {
18
18
  return {
19
19
  name,
20
20
  description: v1.description,
21
- input: z.object(v1.args),
21
+ input: tool.schema.object(v1.args),
22
22
  options: { codemode: false },
23
23
  async execute(input, tctx) {
24
24
  const v1ctx = {
@@ -27,11 +27,12 @@ function adaptTool(name, v1) {
27
27
  agent: tctx.agent,
28
28
  directory: "",
29
29
  worktree: "",
30
- abort: tctx.abort instanceof AbortSignal ? tctx.abort : new AbortController().signal,
30
+ abort: tctx.signal ?? tctx.abort ?? new AbortController().signal,
31
31
  metadata: () => { },
32
- // OpenCode 2 gives plugin tools no approval request; fail closed.
33
- ask: async () => {
34
- throw new Error("User approval is unavailable to plugin tools on OpenCode 2. Use /memory-inspect → Controls instead.");
32
+ ask: async (request) => {
33
+ if (ask)
34
+ return ask(tctx, request);
35
+ throw new Error("User approval is unavailable to plugin tools on this host. Use /memory-inspect → Controls instead.");
35
36
  },
36
37
  };
37
38
  const res = await v1.execute(input, v1ctx);
@@ -71,10 +72,9 @@ const CONTROL_ONLY = new Set(["memory_inspect", "memory_mode"]);
71
72
  /**
72
73
  * Same gating as the V1 entry: the read/search/list/add-note tools require
73
74
  * BOTH use_memories and dedicated_tools (codex MemoriesExtension); the
74
- * control tools are always available. memory_reset needs user approval,
75
- * which V2 plugin tools cannot request: reset lives in the memory panel.
75
+ * control tools are always available. Destructive reset lives in the panel.
76
76
  */
77
- export function buildV2Tools() {
77
+ export function buildV2Tools(ask) {
78
78
  const full = pluginOptions.use_memories && pluginOptions.dedicated_tools;
79
- return ALL_MEMORY_TOOLS.filter(([name]) => full || CONTROL_ONLY.has(name)).map(([name, v1]) => adaptTool(name, v1));
79
+ return ALL_MEMORY_TOOLS.filter(([name]) => full || CONTROL_ONLY.has(name)).map(([name, v1]) => adaptTool(name, v1, ask));
80
80
  }
@@ -124,7 +124,12 @@ var MemoryStatusRpc = {
124
124
  required: ["key", "value"],
125
125
  additionalProperties: false
126
126
  },
127
- output: { type: "object", properties: { ok: { type: "boolean" } }, required: ["ok"], additionalProperties: false }
127
+ output: {
128
+ type: "object",
129
+ properties: { ok: { type: "boolean" } },
130
+ required: ["ok"],
131
+ additionalProperties: false
132
+ }
128
133
  },
129
134
  setSessionMode: {
130
135
  input: {
@@ -136,7 +141,12 @@ var MemoryStatusRpc = {
136
141
  required: ["sessionID", "mode"],
137
142
  additionalProperties: false
138
143
  },
139
- output: { type: "object", properties: { ok: { type: "boolean" } }, required: ["ok"], additionalProperties: false }
144
+ output: {
145
+ type: "object",
146
+ properties: { ok: { type: "boolean" } },
147
+ required: ["ok"],
148
+ additionalProperties: false
149
+ }
140
150
  },
141
151
  consolidateNow: {
142
152
  input: { type: "object", properties: {}, additionalProperties: false },
@@ -1021,9 +1031,9 @@ function MemoryDialog(context, sessionID) {
1021
1031
  _$insert(_el$19, () => tab() === "Controls" ? "select" : "scroll", null);
1022
1032
  _$insert(_el$21, () => tab() === "Controls" ? "Enter/Space change" : "PgUp/PgDn page \xB7 Home/End ends");
1023
1033
  _$effect((_p$) => {
1024
- var _v$5 = Math.min(tab() === "Overview" ? 34 : sessionID ? 25 : 22, Math.max(8, dimensions().height - 2)), _v$6 = color.text, _v$7 = color.muted, _v$8 = click(() => {
1034
+ var _v$5 = Math.min(tab() === "Overview" ? 34 : sessionID ? 25 : 22, Math.max(8, dimensions().height - 2)), { text: _v$6, muted: _v$7 } = color, _v$8 = click(() => {
1025
1035
  refresh();
1026
- }), _v$9 = color.muted, _v$0 = click(() => context.ui.dialog.clear()), _v$1 = color.muted, _v$10 = color.muted;
1036
+ }), _v$9 = color.muted, _v$0 = click(() => context.ui.dialog.clear()), { muted: _v$1, muted: _v$10 } = color;
1027
1037
  _v$5 !== _p$.e && (_p$.e = _$setProp(_el$9, "height", _v$5, _p$.e));
1028
1038
  _v$6 !== _p$.t && (_p$.t = _$setProp(_el$1, "fg", _v$6, _p$.t));
1029
1039
  _v$7 !== _p$.a && (_p$.a = _$setProp(_el$13, "fg", _v$7, _p$.a));
@@ -75,7 +75,9 @@ export function ensureLayout() {
75
75
  removeMemorySymlinks(root);
76
76
  const v1 = currentMemoryVersion() === "v1";
77
77
  // Codex V2 consolidates into memory_summary.md only; it has no skills/.
78
- for (const dir of v1 ? [ROLLOUT_DIR, SKILLS_DIR, EXTENSIONS_DIR, ADHOC_NOTES_DIR] : [ROLLOUT_DIR, EXTENSIONS_DIR, ADHOC_NOTES_DIR]) {
78
+ for (const dir of v1
79
+ ? [ROLLOUT_DIR, SKILLS_DIR, EXTENSIONS_DIR, ADHOC_NOTES_DIR]
80
+ : [ROLLOUT_DIR, EXTENSIONS_DIR, ADHOC_NOTES_DIR]) {
79
81
  fs.mkdirSync(safeResolveMemoryPath(dir), { recursive: true });
80
82
  }
81
83
  if (!v1) {
@@ -103,7 +105,12 @@ export function ensureLayout() {
103
105
  * a regular file and memory_summary.md must start with the exact line `v1`.
104
106
  * Invalid artifacts force a consolidator re-run and block baseline reset.
105
107
  */
106
- const V2_SUMMARY_HEADINGS = ["## User Profile", "## User preferences", "## General Tips", "## What's in Memory"];
108
+ const V2_SUMMARY_HEADINGS = [
109
+ "## User Profile",
110
+ "## User preferences",
111
+ "## General Tips",
112
+ "## What's in Memory",
113
+ ];
107
114
  /** Codex format checks with content-free diagnostics; V2 size is bounded at injection. */
108
115
  export function validateV2Summary(summary) {
109
116
  const bytes = Buffer.byteLength(summary, "utf8");
@@ -312,8 +319,10 @@ export function writeWorkspaceDiff(diff) {
312
319
  // multibyte content. Cut on the byte buffer and drop a split trailing char.
313
320
  if (Buffer.byteLength(body, "utf8") > WORKSPACE_DIFF_MAX_BYTES) {
314
321
  body =
315
- Buffer.from(body, "utf8").subarray(0, WORKSPACE_DIFF_MAX_BYTES).toString("utf8").replace(/\uFFFD+$/, "") +
316
- `\n[workspace diff truncated at ${WORKSPACE_DIFF_MAX_BYTES} bytes]\n`;
322
+ Buffer.from(body, "utf8")
323
+ .subarray(0, WORKSPACE_DIFF_MAX_BYTES)
324
+ .toString("utf8")
325
+ .replace(/\uFFFD+$/, "") + `\n[workspace diff truncated at ${WORKSPACE_DIFF_MAX_BYTES} bytes]\n`;
317
326
  }
318
327
  rendered += "\n## Diff\n\n```diff\n" + body + (body.endsWith("\n") ? "" : "\n") + "```\n";
319
328
  }
@@ -1,3 +1,4 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin";
1
2
  /**
2
3
  * Shared by the memory_reset tool (after user approval) and the OpenCode 2
3
4
  * memory panel (whose confirmation is the approval).
@@ -6,36 +7,6 @@ export declare function performMemoryReset(): {
6
7
  ok: boolean;
7
8
  message: string;
8
9
  };
9
- export declare const memory_reset: {
10
- description: string;
11
- args: {
12
- confirm: import("zod").ZodBoolean;
13
- };
14
- execute(args: {
15
- confirm: boolean;
16
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
17
- };
18
- export declare const memory_inspect: {
19
- description: string;
20
- args: {
21
- min_consolidated_threads: import("zod").ZodOptional<import("zod").ZodNumber>;
22
- };
23
- execute(args: {
24
- min_consolidated_threads?: number | undefined;
25
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
26
- };
27
- export declare const memory_mode: {
28
- description: string;
29
- args: {
30
- mode: import("zod").ZodEnum<{
31
- enabled: "enabled";
32
- disabled: "disabled";
33
- polluted: "polluted";
34
- }>;
35
- sessionId: import("zod").ZodOptional<import("zod").ZodString>;
36
- };
37
- execute(args: {
38
- mode: "enabled" | "disabled" | "polluted";
39
- sessionId?: string | undefined;
40
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
41
- };
10
+ export declare const memory_reset: ToolDefinition;
11
+ export declare const memory_inspect: ToolDefinition;
12
+ export declare const memory_mode: ToolDefinition;
@@ -1,7 +1,7 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
3
  import { tool } from "@opencode-ai/plugin";
4
- import { allMemoryRoots, memoryDbPath, memoryRoot, memorySummaryPath, sessionMetaDbPath, dataRoot, memoryHomeSource } from "../src/paths.js";
4
+ import { allMemoryRoots, memoryDbPath, memoryRoot, memorySummaryPath, sessionMetaDbPath, dataRoot, memoryHomeSource, } from "../src/paths.js";
5
5
  import { clearAllVersionMemoryData, MemoryStore, PHASE2_COOLDOWN_MS } from "../src/store.js";
6
6
  import { invalidateCache } from "../src/source.js";
7
7
  import { estimateTokens } from "../src/token.js";
@@ -10,7 +10,7 @@ import { isPhase2InFlight } from "../src/phase2.js";
10
10
  import { pluginOptions, getConfigWarnings } from "../src/options.js";
11
11
  import { codexInteropBlockReason, codexInteropMtimes, resolveCodexInterop } from "../src/codex-interop.js";
12
12
  import { claudeImportStatus, resolveClaudeHome } from "../src/claude-import.js";
13
- import { formatDiagnosticLine, getDiscoveryStatus, getRecentDiagnostics, } from "../src/diagnostics.js";
13
+ import { formatDiagnosticLine, getDiscoveryStatus, getRecentDiagnostics } from "../src/diagnostics.js";
14
14
  import { isPluginShuttingDown } from "../src/lifecycle.js";
15
15
  import { getAgentHealth } from "../src/agent-health.js";
16
16
  import { activeProviderCapacityBackoffs } from "../src/ratelimit.js";
@@ -185,14 +185,7 @@ function renderAgentHealth() {
185
185
  function resetBlockedReason() {
186
186
  if (isSymlinkedRoot())
187
187
  return "Reset refused: memory root is a symlink. Remove it manually to be safe.";
188
- // A consolidation running in THIS process would recreate files right
189
- // after the wipe (the sub-agent edits live artifacts and resets the git
190
- // baseline). Refuse instead of racing it. clearMemoryData also leaves a
191
- // phase-2 cooldown marker so the next idle/chat hook cannot first-run-claim
192
- // phase 2 and re-seed the root via ensureLayout. Cross-process consolidators
193
- // already in flight remain ownership-guarded (their final mark becomes a
194
- // no-op once the row is replaced) but may leave stray files — same window
195
- // codex has between CLI clear and a running daemon.
188
+ // Cheap preflight. The DB barrier checks both writers again after approval.
196
189
  if (isPhase2InFlight())
197
190
  return "Reset refused: memory consolidation is currently running. Try again in a few minutes.";
198
191
  return null;
@@ -206,12 +199,14 @@ export function performMemoryReset() {
206
199
  if (blocked)
207
200
  return { ok: false, message: blocked };
208
201
  try {
209
- clearAllVersionMemoryData();
210
- wipeMemoriesDir();
202
+ clearAllVersionMemoryData(wipeMemoriesDir);
211
203
  // codex keeps its state DB pool open across resets (clear_memory_roots_contents
212
204
  // only wipes directories); closing here would strand cached handles elsewhere.
213
205
  invalidateCache();
214
- return { ok: true, message: "Memory reset complete. Extracted memories and jobs cleared, memories directory (incl. git history) wiped, cache invalidated. Per-session memory modes were preserved." };
206
+ return {
207
+ ok: true,
208
+ message: "Memory reset complete. Extracted memories and jobs cleared, memories directory (incl. git history) wiped, cache invalidated. Per-session memory modes were preserved.",
209
+ };
215
210
  }
216
211
  catch (err) {
217
212
  return { ok: false, message: `memory_reset error: ${err.message}` };
@@ -278,7 +273,12 @@ export const memory_inspect = tool({
278
273
  "effective plugin options, and any configuration warnings. Use it to verify " +
279
274
  "configuration and debug why memory is not building. Read-only.",
280
275
  args: {
281
- min_consolidated_threads: tool.schema.number().int().min(1).max(4096).optional()
276
+ min_consolidated_threads: tool.schema
277
+ .number()
278
+ .int()
279
+ .min(1)
280
+ .max(4096)
281
+ .optional()
282
282
  .describe("V2 readiness threshold: distinct sessions in a successful consolidation (default 20)."),
283
283
  },
284
284
  async execute(args, ctx) {
@@ -342,9 +342,7 @@ function inspect(args, ctx) {
342
342
  `stage1_jobs: ${stage1StatusParts.length > 0 ? stage1StatusParts.join(" ") : "none"}`,
343
343
  `stage1_failures: ${failureParts.length > 0 ? failureParts.join(" ") : "none"}`,
344
344
  ...(stage1Jobs.stale_exhausted > 0
345
- ? [
346
- `stage1_stale_exhausted: ${stage1Jobs.stale_exhausted} (older than max_rollout_age_days, will not retry)`,
347
- ]
345
+ ? [`stage1_stale_exhausted: ${stage1Jobs.stale_exhausted} (older than max_rollout_age_days, will not retry)`]
348
346
  : []),
349
347
  ...stage1Jobs.recent_errors.map((e) => {
350
348
  const klass = e.failure_class ? `, ${e.failure_class}` : "";
@@ -360,10 +358,7 @@ function inspect(args, ctx) {
360
358
  const eligibilityHint = `eligibility: sessions must be idle ≥ ${idleHours}h and younger than ${pluginOptions.max_rollout_age_days}d ` +
361
359
  `(generate_memories=${pluginOptions.generate_memories}). ` +
362
360
  `For faster local testing, set min_rollout_idle_hours to 1 (clamp floor).`;
363
- const processLines = [
364
- `phase2_in_flight: ${isPhase2InFlight()}`,
365
- `plugin_shutting_down: ${isPluginShuttingDown()}`,
366
- ];
361
+ const processLines = [`phase2_in_flight: ${isPhase2InFlight()}`, `plugin_shutting_down: ${isPluginShuttingDown()}`];
367
362
  const capacityBackoffs = activeProviderCapacityBackoffs();
368
363
  const capacityLines = capacityBackoffs.length > 0
369
364
  ? capacityBackoffs.map((b) => `provider_capacity_backoff ${b.scope}: retry_at=${fmtUnixSec(b.retry_at)}`)
@@ -436,9 +431,7 @@ function inspect(args, ctx) {
436
431
  codex_interop: { ...pluginOptions.codex_interop },
437
432
  claude_import: {
438
433
  ...pluginOptions.claude_import,
439
- ...(pluginOptions.claude_import.projects
440
- ? { projects: [...pluginOptions.claude_import.projects] }
441
- : {}),
434
+ ...(pluginOptions.claude_import.projects ? { projects: [...pluginOptions.claude_import.projects] } : {}),
442
435
  },
443
436
  },
444
437
  config_warnings: [...getConfigWarnings()],
@@ -465,7 +458,7 @@ export const memory_mode = tool({
465
458
  let polluted;
466
459
  try {
467
460
  store = new MemoryStore();
468
- polluted = store.getMemoryMode(sid) === "polluted";
461
+ polluted = store.isPolluted(sid);
469
462
  }
470
463
  catch (err) {
471
464
  return { output: `memory_mode error: ${err.message}` };
@@ -474,11 +467,19 @@ export const memory_mode = tool({
474
467
  // that read that content must not lift it on its own. A rejection
475
468
  // propagates to the host as usual.
476
469
  if (args.mode === "enabled" && polluted) {
477
- await ctx.ask({ permission: "memory_mode", patterns: [sid], always: [], metadata: { sessionId: sid, from: "polluted", to: "enabled" } });
470
+ await ctx.ask({
471
+ permission: "memory_mode",
472
+ patterns: [sid],
473
+ always: [],
474
+ metadata: { sessionId: sid, from: "polluted", to: "enabled" },
475
+ });
478
476
  }
479
477
  try {
480
- store.setMemoryMode(sid, args.mode);
481
- return { output: `Memory mode for session ${sid} set to '${args.mode}'.`, metadata: { sessionId: sid, mode: args.mode } };
478
+ store.setMemoryMode(sid, args.mode, args.mode === "enabled" && polluted);
479
+ return {
480
+ output: `Memory mode for session ${sid} set to '${args.mode}'.`,
481
+ metadata: { sessionId: sid, mode: args.mode },
482
+ };
482
483
  }
483
484
  catch (err) {
484
485
  return { output: `memory_mode error: ${err.message}` };
@@ -1,70 +1,5 @@
1
- export declare const memory_read: {
2
- description: string;
3
- args: {
4
- path: import("zod").ZodString;
5
- line_offset: import("zod").ZodOptional<import("zod").ZodNumber>;
6
- max_lines: import("zod").ZodOptional<import("zod").ZodNumber>;
7
- };
8
- execute(args: {
9
- path: string;
10
- line_offset?: number | undefined;
11
- max_lines?: number | undefined;
12
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
13
- };
14
- export declare const memory_list: {
15
- description: string;
16
- args: {
17
- path: import("zod").ZodDefault<import("zod").ZodString>;
18
- cursor: import("zod").ZodOptional<import("zod").ZodString>;
19
- max_results: import("zod").ZodDefault<import("zod").ZodNumber>;
20
- };
21
- execute(args: {
22
- path: string;
23
- max_results: number;
24
- cursor?: string | undefined;
25
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
26
- };
27
- export declare const memory_search: {
28
- description: string;
29
- args: {
30
- queries: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
31
- match_mode: import("zod").ZodDefault<import("zod").ZodEnum<{
32
- any: "any";
33
- all_on_same_line: "all_on_same_line";
34
- all_within_lines: "all_within_lines";
35
- }>>;
36
- line_count: import("zod").ZodOptional<import("zod").ZodNumber>;
37
- path: import("zod").ZodOptional<import("zod").ZodString>;
38
- cursor: import("zod").ZodOptional<import("zod").ZodString>;
39
- context_lines: import("zod").ZodDefault<import("zod").ZodNumber>;
40
- case_sensitive: import("zod").ZodDefault<import("zod").ZodBoolean>;
41
- normalized: import("zod").ZodDefault<import("zod").ZodBoolean>;
42
- since: import("zod").ZodOptional<import("zod").ZodString>;
43
- until: import("zod").ZodOptional<import("zod").ZodString>;
44
- max_results: import("zod").ZodDefault<import("zod").ZodNumber>;
45
- };
46
- execute(args: {
47
- match_mode: "any" | "all_on_same_line" | "all_within_lines";
48
- context_lines: number;
49
- case_sensitive: boolean;
50
- normalized: boolean;
51
- max_results: number;
52
- queries?: string[] | undefined;
53
- line_count?: number | undefined;
54
- path?: string | undefined;
55
- cursor?: string | undefined;
56
- since?: string | undefined;
57
- until?: string | undefined;
58
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
59
- };
60
- export declare const memory_add_note: {
61
- description: string;
62
- args: {
63
- note: import("zod").ZodString;
64
- title: import("zod").ZodOptional<import("zod").ZodString>;
65
- };
66
- execute(args: {
67
- note: string;
68
- title?: string | undefined;
69
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
70
- };
1
+ import { type ToolDefinition } from "@opencode-ai/plugin";
2
+ export declare const memory_read: ToolDefinition;
3
+ export declare const memory_list: ToolDefinition;
4
+ export declare const memory_search: ToolDefinition;
5
+ export declare const memory_add_note: ToolDefinition;