opencode-session-recall 0.2.1 → 0.4.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/LICENSE +19 -0
- package/dist/context.d.ts +2 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/extract.d.ts +1 -1
- package/dist/extract.d.ts.map +1 -1
- package/dist/messages.d.ts +2 -1
- package/dist/messages.d.ts.map +1 -1
- package/dist/{index.d.ts → opencode-session-recall.d.ts} +1 -1
- package/dist/opencode-session-recall.d.ts.map +1 -0
- package/dist/{index.js → opencode-session-recall.js} +50 -30
- package/dist/search.d.ts +2 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/sessions.d.ts +2 -1
- package/dist/sessions.d.ts.map +1 -1
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +17 -8
- package/dist/index.d.ts.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/dist/context.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import type { OpencodeClient } from "@opencode-ai/sdk/v2";
|
|
3
|
-
|
|
3
|
+
import { type Limits } from "./types.js";
|
|
4
|
+
export declare function context(client: OpencodeClient, limits: Limits): ToolDefinition;
|
|
4
5
|
//# sourceMappingURL=context.d.ts.map
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAIL,KAAK,MAAM,EACZ,MAAM,YAAY,CAAC;AAGpB,wBAAgB,OAAO,CACrB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,MAAM,GACb,cAAc,CAuGhB"}
|
package/dist/extract.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Part, Message } from "@opencode-ai/sdk/v2";
|
|
2
|
-
import type
|
|
2
|
+
import { type PartOutput, type MessageItem } from "./types.js";
|
|
3
3
|
export declare function matches(text: string, query: string): boolean;
|
|
4
4
|
export declare function searchable(part: Part): string[];
|
|
5
5
|
export declare function snippet(text: string, query: string, width?: number): string;
|
package/dist/extract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EAEJ,OAAO,EAGR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EAEJ,OAAO,EAGR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAS,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAYtE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,CA4B/C;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,MAAM,CAexE;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAI1C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,UAAU,CA0D7C;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;CACpB,GAAG,WAAW,CAgBd"}
|
package/dist/messages.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import type { OpencodeClient } from "@opencode-ai/sdk/v2";
|
|
3
|
-
|
|
3
|
+
import { type Limits } from "./types.js";
|
|
4
|
+
export declare function messages(client: OpencodeClient, limits: Limits): ToolDefinition;
|
|
4
5
|
//# sourceMappingURL=messages.d.ts.map
|
package/dist/messages.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAQ,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAIL,KAAK,MAAM,EACZ,MAAM,YAAY,CAAC;AAYpB,wBAAgB,QAAQ,CACtB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,MAAM,GACb,cAAc,CA0GhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode-session-recall.d.ts","sourceRoot":"","sources":["../src/opencode-session-recall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;;;;;AAgFlD,wBAGE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/opencode-session-recall.ts
|
|
2
2
|
import { createOpencodeClient } from "@opencode-ai/sdk/v2";
|
|
3
3
|
|
|
4
4
|
// src/sessions.ts
|
|
@@ -7,6 +7,22 @@ import {
|
|
|
7
7
|
} from "@opencode-ai/plugin";
|
|
8
8
|
|
|
9
9
|
// src/types.ts
|
|
10
|
+
var TOOLS = [
|
|
11
|
+
"recall",
|
|
12
|
+
"recall_get",
|
|
13
|
+
"recall_sessions",
|
|
14
|
+
"recall_context",
|
|
15
|
+
"recall_messages"
|
|
16
|
+
];
|
|
17
|
+
var DEFAULTS = {
|
|
18
|
+
concurrency: 3,
|
|
19
|
+
maxSessions: 50,
|
|
20
|
+
maxResults: 50,
|
|
21
|
+
maxSessionList: 100,
|
|
22
|
+
maxMessages: 50,
|
|
23
|
+
maxWindow: 10,
|
|
24
|
+
defaultWidth: 200
|
|
25
|
+
};
|
|
10
26
|
function errmsg(e) {
|
|
11
27
|
if (e instanceof Error) return e.message;
|
|
12
28
|
if (typeof e === "string") return e;
|
|
@@ -22,13 +38,13 @@ function errmsg(e) {
|
|
|
22
38
|
}
|
|
23
39
|
|
|
24
40
|
// src/sessions.ts
|
|
25
|
-
function sessions(client, unscoped, global) {
|
|
41
|
+
function sessions(client, unscoped, global, limits) {
|
|
26
42
|
return tool({
|
|
27
43
|
description: `List sessions from the opencode database. Use this FIRST to discover which sessions exist, then search their content with recall. Returns session titles, directories, and timestamps. For cross-project discovery, use scope "global" (requires plugin option global: true).`,
|
|
28
44
|
args: {
|
|
29
45
|
scope: tool.schema.enum(["project", "global"]).default("project").describe("project = current project, global = all projects"),
|
|
30
46
|
search: tool.schema.string().optional().describe("Filter by session title"),
|
|
31
|
-
limit: tool.schema.number().min(1).max(
|
|
47
|
+
limit: tool.schema.number().min(1).max(limits.maxSessionList).default(Math.min(20, limits.maxSessionList)).describe("Max sessions to return")
|
|
32
48
|
},
|
|
33
49
|
async execute(args, ctx) {
|
|
34
50
|
ctx.metadata({
|
|
@@ -116,6 +132,7 @@ import {
|
|
|
116
132
|
|
|
117
133
|
// src/extract.ts
|
|
118
134
|
var INPUT_SEARCH_LIMIT = 1e4;
|
|
135
|
+
var SELF = new Set(TOOLS);
|
|
119
136
|
function input(val) {
|
|
120
137
|
const raw = JSON.stringify(val);
|
|
121
138
|
return raw.length > INPUT_SEARCH_LIMIT ? raw.slice(0, INPUT_SEARCH_LIMIT) : raw;
|
|
@@ -124,6 +141,7 @@ function matches(text, query) {
|
|
|
124
141
|
return text.toLowerCase().includes(query.toLowerCase());
|
|
125
142
|
}
|
|
126
143
|
function searchable(part) {
|
|
144
|
+
if (part.type === "tool" && SELF.has(part.tool)) return [];
|
|
127
145
|
switch (part.type) {
|
|
128
146
|
case "text":
|
|
129
147
|
case "reasoning":
|
|
@@ -246,7 +264,6 @@ function formatMsg(msg) {
|
|
|
246
264
|
}
|
|
247
265
|
|
|
248
266
|
// src/search.ts
|
|
249
|
-
var CONCURRENCY = 3;
|
|
250
267
|
function meta(s) {
|
|
251
268
|
return { id: s.id, title: s.title, directory: s.directory };
|
|
252
269
|
}
|
|
@@ -289,7 +306,7 @@ function scan(messages2, session, query, type, role, limit, before, after, width
|
|
|
289
306
|
}
|
|
290
307
|
return { results, total };
|
|
291
308
|
}
|
|
292
|
-
function search(client, unscoped, global) {
|
|
309
|
+
function search(client, unscoped, global, limits) {
|
|
293
310
|
return tool2({
|
|
294
311
|
description: `Search your conversation history in the opencode database. Use this to recover context lost to compaction \u2014 original tool outputs, earlier messages, reasoning, and user instructions that were pruned from your context window.
|
|
295
312
|
|
|
@@ -304,12 +321,12 @@ Start with scope "session" (fastest). Widen to "project" if not found. Use sessi
|
|
|
304
321
|
sessionID: tool2.schema.string().optional().describe("Search a specific session (overrides scope)"),
|
|
305
322
|
type: tool2.schema.enum(["text", "tool", "reasoning", "all"]).default("all").describe("Filter by part type"),
|
|
306
323
|
role: tool2.schema.enum(["user", "assistant", "all"]).default("all").describe("Filter by message role"),
|
|
307
|
-
sessions: tool2.schema.number().min(1).max(
|
|
308
|
-
results: tool2.schema.number().min(1).max(
|
|
324
|
+
sessions: tool2.schema.number().min(1).max(limits.maxSessions).default(Math.min(10, limits.maxSessions)).describe("Max sessions to scan"),
|
|
325
|
+
results: tool2.schema.number().min(1).max(limits.maxResults).default(Math.min(10, limits.maxResults)).describe("Max results to return"),
|
|
309
326
|
title: tool2.schema.string().optional().describe("Filter sessions by title"),
|
|
310
327
|
before: tool2.schema.number().optional().describe("Only match messages before this timestamp (ms epoch)"),
|
|
311
328
|
after: tool2.schema.number().optional().describe("Only match messages after this timestamp (ms epoch)"),
|
|
312
|
-
width: tool2.schema.number().min(50).max(1e3).default(
|
|
329
|
+
width: tool2.schema.number().min(50).max(Math.max(limits.defaultWidth, 1e3)).default(limits.defaultWidth).describe("Snippet width in characters")
|
|
313
330
|
},
|
|
314
331
|
async execute(args, ctx) {
|
|
315
332
|
ctx.metadata({ title: `Searching ${args.scope} for "${args.query}"` });
|
|
@@ -379,7 +396,7 @@ Start with scope "session" (fastest). Widen to "project" if not found. Use sessi
|
|
|
379
396
|
let scanned = 0;
|
|
380
397
|
let total = 0;
|
|
381
398
|
let early = false;
|
|
382
|
-
for (let i = 0; i < targets.length; i +=
|
|
399
|
+
for (let i = 0; i < targets.length; i += limits.concurrency) {
|
|
383
400
|
if (ctx.abort.aborted) {
|
|
384
401
|
early = true;
|
|
385
402
|
break;
|
|
@@ -389,7 +406,7 @@ Start with scope "session" (fastest). Widen to "project" if not found. Use sessi
|
|
|
389
406
|
break;
|
|
390
407
|
}
|
|
391
408
|
const remaining = args.results - collected.length;
|
|
392
|
-
const batch = targets.slice(i, i +
|
|
409
|
+
const batch = targets.slice(i, i + limits.concurrency);
|
|
393
410
|
const loaded = await Promise.all(
|
|
394
411
|
batch.map(async (t) => {
|
|
395
412
|
try {
|
|
@@ -499,19 +516,19 @@ function get(client) {
|
|
|
499
516
|
import {
|
|
500
517
|
tool as tool4
|
|
501
518
|
} from "@opencode-ai/plugin";
|
|
502
|
-
function context(client) {
|
|
519
|
+
function context(client, limits) {
|
|
503
520
|
return tool4({
|
|
504
521
|
description: `Get messages surrounding a specific message in a session. Use after recall finds a match and you need conversation context \u2014 what was asked before, what came after. Returns a window of messages centered on the target.`,
|
|
505
522
|
args: {
|
|
506
523
|
sessionID: tool4.schema.string().describe("Session containing the message"),
|
|
507
524
|
messageID: tool4.schema.string().describe("Center message to get context around"),
|
|
508
|
-
window: tool4.schema.number().min(0).max(
|
|
525
|
+
window: tool4.schema.number().min(0).max(limits.maxWindow).default(Math.min(3, limits.maxWindow)).describe(
|
|
509
526
|
"Number of messages to include before AND after the target (symmetric). Overridden by before/after if set."
|
|
510
527
|
),
|
|
511
|
-
before: tool4.schema.number().min(0).max(
|
|
528
|
+
before: tool4.schema.number().min(0).max(limits.maxWindow).optional().describe(
|
|
512
529
|
"Messages to include before the target (overrides window for the before side)"
|
|
513
530
|
),
|
|
514
|
-
after: tool4.schema.number().min(0).max(
|
|
531
|
+
after: tool4.schema.number().min(0).max(limits.maxWindow).optional().describe(
|
|
515
532
|
"Messages to include after the target (overrides window for the after side)"
|
|
516
533
|
)
|
|
517
534
|
},
|
|
@@ -588,7 +605,7 @@ function msgMatches(msg, query) {
|
|
|
588
605
|
}
|
|
589
606
|
return false;
|
|
590
607
|
}
|
|
591
|
-
function messages(client) {
|
|
608
|
+
function messages(client, limits) {
|
|
592
609
|
return tool5({
|
|
593
610
|
description: `Browse messages in a session chronologically with pagination. Use to play back conversation history, see what happened in order, or find the user's original requirements. Use reverse=true to start from the most recent messages (offset 0 = newest). Use offset to paginate through results.`,
|
|
594
611
|
args: {
|
|
@@ -598,7 +615,7 @@ function messages(client) {
|
|
|
598
615
|
offset: tool5.schema.number().min(0).default(0).describe(
|
|
599
616
|
"Skip this many messages from the start (or end if reversed)"
|
|
600
617
|
),
|
|
601
|
-
limit: tool5.schema.number().min(1).max(
|
|
618
|
+
limit: tool5.schema.number().min(1).max(limits.maxMessages).default(Math.min(10, limits.maxMessages)).describe("Max messages to return"),
|
|
602
619
|
role: tool5.schema.enum(["user", "assistant", "all"]).default("all").describe("Filter by message role"),
|
|
603
620
|
reverse: tool5.schema.boolean().default(false).describe("If true, start from most recent messages"),
|
|
604
621
|
query: tool5.schema.string().min(1).optional().describe(
|
|
@@ -666,18 +683,21 @@ function messages(client) {
|
|
|
666
683
|
});
|
|
667
684
|
}
|
|
668
685
|
|
|
669
|
-
// src/
|
|
670
|
-
var TOOLS = [
|
|
671
|
-
"recall",
|
|
672
|
-
"recall_get",
|
|
673
|
-
"recall_sessions",
|
|
674
|
-
"recall_context",
|
|
675
|
-
"recall_messages"
|
|
676
|
-
];
|
|
686
|
+
// src/opencode-session-recall.ts
|
|
677
687
|
var server = async (ctx, options) => {
|
|
678
688
|
const opts = options ?? {};
|
|
679
689
|
const primary = opts.primary !== false;
|
|
680
690
|
const global = opts.global === true;
|
|
691
|
+
const clamp = (val, fallback, min = 1) => Math.max(min, Math.floor(val ?? fallback));
|
|
692
|
+
const limits = {
|
|
693
|
+
concurrency: clamp(opts.concurrency, DEFAULTS.concurrency),
|
|
694
|
+
maxSessions: clamp(opts.maxSessions, DEFAULTS.maxSessions),
|
|
695
|
+
maxResults: clamp(opts.maxResults, DEFAULTS.maxResults),
|
|
696
|
+
maxSessionList: clamp(opts.maxSessionList, DEFAULTS.maxSessionList),
|
|
697
|
+
maxMessages: clamp(opts.maxMessages, DEFAULTS.maxMessages),
|
|
698
|
+
maxWindow: clamp(opts.maxWindow, DEFAULTS.maxWindow),
|
|
699
|
+
defaultWidth: clamp(opts.defaultWidth, DEFAULTS.defaultWidth, 50)
|
|
700
|
+
};
|
|
681
701
|
const inner = ctx.client._client;
|
|
682
702
|
if (!inner?.getConfig)
|
|
683
703
|
throw new Error(
|
|
@@ -700,11 +720,11 @@ var server = async (ctx, options) => {
|
|
|
700
720
|
});
|
|
701
721
|
return {
|
|
702
722
|
tool: {
|
|
703
|
-
recall_sessions: sessions(client, unscoped, global),
|
|
704
|
-
recall: search(client, unscoped, global),
|
|
723
|
+
recall_sessions: sessions(client, unscoped, global, limits),
|
|
724
|
+
recall: search(client, unscoped, global, limits),
|
|
705
725
|
recall_get: get(client),
|
|
706
|
-
recall_context: context(client),
|
|
707
|
-
recall_messages: messages(client)
|
|
726
|
+
recall_context: context(client, limits),
|
|
727
|
+
recall_messages: messages(client, limits)
|
|
708
728
|
},
|
|
709
729
|
...primary && {
|
|
710
730
|
config: async (c) => {
|
|
@@ -717,10 +737,10 @@ var server = async (ctx, options) => {
|
|
|
717
737
|
}
|
|
718
738
|
};
|
|
719
739
|
};
|
|
720
|
-
var
|
|
740
|
+
var opencode_session_recall_default = {
|
|
721
741
|
id: "opencode-session-recall",
|
|
722
742
|
server
|
|
723
743
|
};
|
|
724
744
|
export {
|
|
725
|
-
|
|
745
|
+
opencode_session_recall_default as default
|
|
726
746
|
};
|
package/dist/search.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import type { OpencodeClient } from "@opencode-ai/sdk/v2";
|
|
3
|
-
|
|
3
|
+
import { type Limits } from "./types.js";
|
|
4
|
+
export declare function search(client: OpencodeClient, unscoped: OpencodeClient, global: boolean, limits: Limits): ToolDefinition;
|
|
4
5
|
//# sourceMappingURL=search.d.ts.map
|
package/dist/search.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,YAAY,CAAC;AAqEpB,wBAAgB,MAAM,CACpB,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GACb,cAAc,CA2MhB"}
|
package/dist/sessions.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import type { OpencodeClient } from "@opencode-ai/sdk/v2";
|
|
3
|
-
|
|
3
|
+
import { type Limits } from "./types.js";
|
|
4
|
+
export declare function sessions(client: OpencodeClient, unscoped: OpencodeClient, global: boolean, limits: Limits): ToolDefinition;
|
|
4
5
|
//# sourceMappingURL=sessions.d.ts.map
|
package/dist/sessions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../src/sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../src/sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,YAAY,CAAC;AAEpB,wBAAgB,QAAQ,CACtB,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GACb,cAAc,CA0GhB"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
export declare const TOOLS: readonly ["recall", "recall_get", "recall_sessions", "recall_context", "recall_messages"];
|
|
2
|
+
export type Limits = {
|
|
3
|
+
concurrency: number;
|
|
4
|
+
maxSessions: number;
|
|
5
|
+
maxResults: number;
|
|
6
|
+
maxSessionList: number;
|
|
7
|
+
maxMessages: number;
|
|
8
|
+
maxWindow: number;
|
|
9
|
+
defaultWidth: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const DEFAULTS: Limits;
|
|
1
12
|
export type SearchResult = {
|
|
2
13
|
sessionID: string;
|
|
3
14
|
sessionTitle: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|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AAE,WAAW,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAYzC"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "opencode-session-recall",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Agent memory without a memory system — search and retrieve opencode conversation history that was lost to compaction, across sessions and projects",
|
|
7
|
-
"main": "./dist/
|
|
7
|
+
"main": "./dist/opencode-session-recall.js",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./dist/
|
|
11
|
-
"import": "./dist/
|
|
10
|
+
"types": "./dist/opencode-session-recall.d.ts",
|
|
11
|
+
"import": "./dist/opencode-session-recall.js"
|
|
12
12
|
},
|
|
13
13
|
"./server": {
|
|
14
|
-
"types": "./dist/
|
|
15
|
-
"import": "./dist/
|
|
14
|
+
"types": "./dist/opencode-session-recall.d.ts",
|
|
15
|
+
"import": "./dist/opencode-session-recall.js"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"dev": "opencode plugin dev",
|
|
23
23
|
"typecheck": "tsc --noEmit",
|
|
24
|
-
"compile": "tsup src/
|
|
24
|
+
"compile": "tsup src/opencode-session-recall.ts --format esm && tsc --emitDeclarationOnly --outDir dist",
|
|
25
25
|
"prepublishOnly": "npm run typecheck && npm run compile"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
@@ -37,7 +37,16 @@
|
|
|
37
37
|
],
|
|
38
38
|
"author": "maelos",
|
|
39
39
|
"publishConfig": {
|
|
40
|
-
"access": "public"
|
|
40
|
+
"access": "public",
|
|
41
|
+
"provenance": true
|
|
42
|
+
},
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "git+https://github.com/rmk40/opencode-session-recall.git"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/rmk40/opencode-session-recall#readme",
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://github.com/rmk40/opencode-session-recall/issues"
|
|
41
50
|
},
|
|
42
51
|
"license": "MIT",
|
|
43
52
|
"peerDependencies": {
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;;;;;AAkFlD,wBAGE"}
|