pi-roundtable-sandbox 0.23.2 → 0.24.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/worker/memory.ts CHANGED
@@ -8,51 +8,60 @@ import {
8
8
  import { join } from "node:path";
9
9
  import { isRecord, type ToolSpec } from "../src/protocol.ts";
10
10
 
11
- export const MEMORY_TOOLS: ToolSpec[] = [
12
- {
13
- name: "memory_set",
14
- description:
15
- "Remember a speaker fact or a channel note. Speaker entries belong to the current speaker.",
16
- parameters: {
17
- type: "object",
18
- properties: {
19
- scope: { type: "string", enum: ["speaker", "channel"] },
20
- key: { type: "string" },
21
- text: { type: "string" },
11
+ /** What the shared notes are called to the model; a server workspace shares them wider. */
12
+ function notesOf(server: boolean): string {
13
+ return server
14
+ ? "server note (shared by every channel of the server)"
15
+ : "channel note";
16
+ }
17
+
18
+ /** The memory tools; `server` says the notes belong to the whole server, not one channel. */
19
+ export function memoryTools(server: boolean): ToolSpec[] {
20
+ const notes = notesOf(server);
21
+ return [
22
+ {
23
+ name: "memory_set",
24
+ description: `Remember a speaker fact or a ${notes}. Speaker entries belong to the current speaker.`,
25
+ parameters: {
26
+ type: "object",
27
+ properties: {
28
+ scope: { type: "string", enum: ["speaker", "channel"] },
29
+ key: { type: "string" },
30
+ text: { type: "string" },
31
+ },
32
+ required: ["scope", "key", "text"],
33
+ additionalProperties: false,
22
34
  },
23
- required: ["scope", "key", "text"],
24
- additionalProperties: false,
25
35
  },
26
- },
27
- {
28
- name: "memory_get",
29
- description:
30
- "Read or search current-speaker facts or shared channel notes. Omit key to list entries.",
31
- parameters: {
32
- type: "object",
33
- properties: {
34
- scope: { type: "string", enum: ["speaker", "channel"] },
35
- key: { type: "string" },
36
- query: { type: "string" },
36
+ {
37
+ name: "memory_get",
38
+ description: `Read or search current-speaker facts or shared ${server ? "server notes (shared by every channel of the server)" : "channel notes"}. Omit key to list entries.`,
39
+ parameters: {
40
+ type: "object",
41
+ properties: {
42
+ scope: { type: "string", enum: ["speaker", "channel"] },
43
+ key: { type: "string" },
44
+ query: { type: "string" },
45
+ },
46
+ required: ["scope"],
47
+ additionalProperties: false,
37
48
  },
38
- required: ["scope"],
39
- additionalProperties: false,
40
49
  },
41
- },
42
- {
43
- name: "memory_remove",
44
- description: "Forget one current-speaker fact or shared channel note.",
45
- parameters: {
46
- type: "object",
47
- properties: {
48
- scope: { type: "string", enum: ["speaker", "channel"] },
49
- key: { type: "string" },
50
+ {
51
+ name: "memory_remove",
52
+ description: `Forget one current-speaker fact or shared ${notes}.`,
53
+ parameters: {
54
+ type: "object",
55
+ properties: {
56
+ scope: { type: "string", enum: ["speaker", "channel"] },
57
+ key: { type: "string" },
58
+ },
59
+ required: ["scope", "key"],
60
+ additionalProperties: false,
50
61
  },
51
- required: ["scope", "key"],
52
- additionalProperties: false,
53
62
  },
54
- },
55
- ];
63
+ ];
64
+ }
56
65
  interface Entry {
57
66
  scope: string;
58
67
  key: string;