@satori-sh/cli 0.0.4 → 0.0.5

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 (57) hide show
  1. package/dist/index.js +0 -0
  2. package/package.json +1 -1
  3. package/tsup.config.js +2 -2
  4. package/dist/add.d.ts +0 -2
  5. package/dist/add.d.ts.map +0 -1
  6. package/dist/add.js +0 -27
  7. package/dist/add.js.map +0 -1
  8. package/dist/config.d.ts +0 -3
  9. package/dist/config.d.ts.map +0 -1
  10. package/dist/config.js +0 -15
  11. package/dist/config.js.map +0 -1
  12. package/dist/index.d.ts.map +0 -1
  13. package/dist/index.js.map +0 -1
  14. package/dist/memory.d.ts +0 -12
  15. package/dist/memory.d.ts.map +0 -1
  16. package/dist/memory.js +0 -42
  17. package/dist/memory.js.map +0 -1
  18. package/dist/search.d.ts +0 -2
  19. package/dist/search.d.ts.map +0 -1
  20. package/dist/search.js +0 -27
  21. package/dist/search.js.map +0 -1
  22. package/dist/src/add.d.ts +0 -23
  23. package/dist/src/add.d.ts.map +0 -1
  24. package/dist/src/add.js +0 -46
  25. package/dist/src/add.js.map +0 -1
  26. package/dist/src/config.d.ts +0 -39
  27. package/dist/src/config.d.ts.map +0 -1
  28. package/dist/src/config.js +0 -165
  29. package/dist/src/config.js.map +0 -1
  30. package/dist/src/index.d.ts +0 -15
  31. package/dist/src/index.d.ts.map +0 -1
  32. package/dist/src/index.js +0 -142
  33. package/dist/src/index.js.map +0 -1
  34. package/dist/src/memory.d.ts +0 -52
  35. package/dist/src/memory.d.ts.map +0 -1
  36. package/dist/src/memory.js +0 -98
  37. package/dist/src/memory.js.map +0 -1
  38. package/dist/src/providers.d.ts +0 -34
  39. package/dist/src/providers.d.ts.map +0 -1
  40. package/dist/src/providers.js +0 -107
  41. package/dist/src/providers.js.map +0 -1
  42. package/dist/src/search.d.ts +0 -14
  43. package/dist/src/search.d.ts.map +0 -1
  44. package/dist/src/search.js +0 -39
  45. package/dist/src/search.js.map +0 -1
  46. package/dist/src/types.d.ts +0 -51
  47. package/dist/src/types.d.ts.map +0 -1
  48. package/dist/src/types.js +0 -2
  49. package/dist/src/types.js.map +0 -1
  50. package/dist/tests/index.test.d.ts +0 -2
  51. package/dist/tests/index.test.d.ts.map +0 -1
  52. package/dist/tests/index.test.js +0 -257
  53. package/dist/tests/index.test.js.map +0 -1
  54. package/dist/types.d.ts +0 -19
  55. package/dist/types.d.ts.map +0 -1
  56. package/dist/types.js +0 -2
  57. package/dist/types.js.map +0 -1
package/dist/src/index.js DELETED
@@ -1,142 +0,0 @@
1
- #! /usr/bin/env node
2
- import { Command } from 'commander';
3
- import { readFileSync } from 'node:fs';
4
- import chalk from 'chalk';
5
- import { getConfig } from './config.js';
6
- import { searchMemories } from './search.js';
7
- import { addMemories } from './add.js';
8
- import { buildMemoryContext, enhanceMessagesWithMemory } from './memory.js';
9
- import { _callProviderAPI } from './providers.js';
10
- // Re-export for external use
11
- export { searchMemories } from './search.js';
12
- export { addMemories } from './add.js';
13
- export { enhanceMessagesWithMemory } from './memory.js';
14
- /**
15
- * Main entry point for the Satori CLI application.
16
- *
17
- * Parses command-line arguments and executes the appropriate command.
18
- * Sets up the CLI with available commands: search, add, and chat.
19
- *
20
- * @returns {Promise<void>}
21
- * @throws {Error} If configuration validation fails
22
- */
23
- export async function main() {
24
- try {
25
- await getConfig(); // Validate early
26
- }
27
- catch (error) {
28
- console.error(error instanceof Error ? error.message : 'Configuration error');
29
- process.exit(1);
30
- }
31
- // Display Satori logo
32
- console.log(chalk.cyan(readFileSync('./logo.txt', 'utf8')));
33
- const program = new Command();
34
- program
35
- .name('satori')
36
- .description('CLI tool for Satori memory server')
37
- .version('0.0.1');
38
- program
39
- .option('--provider <provider>', 'Provider to use (openai or anthropic)', 'openai')
40
- .option('--model <model>', 'Model to use', 'gpt-4o')
41
- .option('--memory-id <id>', 'Memory ID for scoping');
42
- // Helper function to process user input
43
- const processUserInput = async (input, options, isInteractive = false) => {
44
- let memoryContext;
45
- try {
46
- memoryContext = await buildMemoryContext(input, { memoryId: options.memoryId });
47
- }
48
- catch (memoryError) {
49
- memoryContext = { results: [], memoryId: options.memoryId, instruction: undefined };
50
- }
51
- const userMessage = { role: 'user', content: input };
52
- const enhancedMessages = enhanceMessagesWithMemory([userMessage], { results: memoryContext.results });
53
- const response = await _callProviderAPI(enhancedMessages, {
54
- temperature: 0.7,
55
- maxTokens: 1000
56
- }, options.provider);
57
- if (isInteractive) {
58
- console.log(`Assistant: ${response}`);
59
- }
60
- else {
61
- console.log(response);
62
- }
63
- if (memoryContext.instruction) {
64
- console.log(`\n${memoryContext.instruction}`);
65
- }
66
- addMemories(input, { memoryId: memoryContext.memoryId }).catch(err => {
67
- console.error('Failed to save memory:', err);
68
- });
69
- return { response, instruction: memoryContext.instruction, memoryId: memoryContext.memoryId };
70
- };
71
- program
72
- .argument('[prompt]', 'initial prompt for chat session (optional)')
73
- .action(async (initialPrompt, options) => {
74
- try {
75
- let memoryId = options.memoryId;
76
- // If not interactive (e.g., piped input), process initial prompt if provided and exit
77
- if (!process.stdin.isTTY) {
78
- if (initialPrompt) {
79
- await processUserInput(initialPrompt, options, false);
80
- }
81
- return;
82
- }
83
- // Interactive mode
84
- if (initialPrompt) {
85
- const result = await processUserInput(initialPrompt, options, true);
86
- memoryId = result.memoryId;
87
- }
88
- // Enter interactive mode
89
- const { createInterface } = await import('node:readline');
90
- const rl = createInterface({
91
- input: process.stdin,
92
- output: process.stdout
93
- });
94
- const chatLoop = async () => {
95
- rl.question(chalk.cyan('> '), async (input) => {
96
- if (input.toLowerCase() === 'exit' || input.toLowerCase() === 'quit') {
97
- console.log('Goodbye!');
98
- rl.close();
99
- return;
100
- }
101
- if (!input.trim()) {
102
- chatLoop();
103
- return;
104
- }
105
- try {
106
- const result = await processUserInput(input, { ...options, memoryId }, true);
107
- memoryId = result.memoryId;
108
- }
109
- catch (error) {
110
- console.error('Chat error:', error instanceof Error ? error.message : error);
111
- }
112
- chatLoop();
113
- });
114
- };
115
- console.log('\nEntering interactive mode. Type "exit" or "quit" to end the session.\n');
116
- chatLoop();
117
- }
118
- catch (error) {
119
- console.error('Chat error:', error instanceof Error ? error.message : error);
120
- process.exit(1);
121
- }
122
- });
123
- program
124
- .command('add')
125
- .description('add a new memory')
126
- .argument('<text>', 'text to add as memory')
127
- .action(async (text) => {
128
- await addMemories(text);
129
- });
130
- program
131
- .command('search')
132
- .description('search memories')
133
- .argument('<query>', 'search query for memories')
134
- .action(async (query) => {
135
- await searchMemories(query);
136
- });
137
- program.parse();
138
- }
139
- if (import.meta.main) {
140
- main();
141
- }
142
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,6BAA6B;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAGxD;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,IAAI,CAAC;QACH,MAAM,SAAS,EAAE,CAAC,CAAC,iBAAiB;IACtC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KA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QAAQ,EAAE,CAAC;gBACb,CAAC,CAAC,CAAC;YACL,CAAC,CAAC;YAEF,OAAO,CAAC,GAAG,CAAC,0EAA0E,CAAC,CAAC;YACxF,QAAQ,EAAE,CAAC;QAEb,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEN,OAAO;SACJ,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,kBAAkB,CAAC;SAC/B,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC;SAC3C,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE;QAC7B,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEL,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,iBAAiB,CAAC;SAC9B,QAAQ,CAAC,SAAS,EAAE,2BAA2B,CAAC;SAChD,MAAM,CAAC,KAAK,EAAE,KAAa,EAAE,EAAE;QAC9B,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEL,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC;AAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,IAAI,EAAE,CAAC;AACT,CAAC"}
@@ -1,52 +0,0 @@
1
- import { SearchResponse, Message } from './types.js';
2
- /**
3
- * Options for memory context building.
4
- */
5
- interface MemoryOptions {
6
- /** Existing memory ID to use for the search */
7
- memoryId?: string;
8
- /** Number of top memories to retrieve */
9
- topK?: number;
10
- }
11
- /**
12
- * Builds memory context by searching for relevant memories and generating a memory ID if needed.
13
- *
14
- * @param {string} prompt - The user's prompt to search memories for
15
- * @param {MemoryOptions} [options] - Search options
16
- * @returns {Promise<{results: SearchResponse['results'], memoryId: string, instruction?: string}>}
17
- * Object containing search results, the memory ID used/generated, and setup instructions if generated
18
- *
19
- * @example
20
- * ```typescript
21
- * const context = await buildMemoryContext("What's my favorite food?", { topK: 3 });
22
- * console.log(`Found ${context.results.length} relevant memories`);
23
- * if (context.instruction) console.log(context.instruction);
24
- * ```
25
- */
26
- export declare function buildMemoryContext(prompt: string, options?: MemoryOptions): Promise<{
27
- results: SearchResponse['results'];
28
- memoryId: string;
29
- instruction?: string;
30
- }>;
31
- /**
32
- * Enhances a message array by prepending relevant memory context as a system message.
33
- *
34
- * @param {Message[]} messages - The original message array
35
- * @param {object} memoryContext - The memory context object
36
- * @param {SearchResponse['results']} memoryContext.results - Array of memory results
37
- * @returns {Message[]} The enhanced message array with memory context prepended
38
- *
39
- * @example
40
- * ```typescript
41
- * const messages = [{ role: 'user', content: 'Hello' }];
42
- * const context = { results: [{ id: '1', memory: 'User likes pizza' }] };
43
- * const enhanced = enhanceMessagesWithMemory(messages, context);
44
- * // enhanced[0] is system message with memory context
45
- * // enhanced[1] is the original user message
46
- * ```
47
- */
48
- export declare function enhanceMessagesWithMemory(messages: Message[], memoryContext: {
49
- results: SearchResponse['results'];
50
- }): Message[];
51
- export {};
52
- //# sourceMappingURL=memory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/memory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrD;;GAEG;AACH,UAAU,aAAa;IACrB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAuD7K;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE;IAAE,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;CAAE,GAAG,OAAO,EAAE,CAc/H"}
@@ -1,98 +0,0 @@
1
- import { getConfig, saveMemoryId } from './config.js';
2
- import { generate } from 'random-words';
3
- /**
4
- * Builds memory context by searching for relevant memories and generating a memory ID if needed.
5
- *
6
- * @param {string} prompt - The user's prompt to search memories for
7
- * @param {MemoryOptions} [options] - Search options
8
- * @returns {Promise<{results: SearchResponse['results'], memoryId: string, instruction?: string}>}
9
- * Object containing search results, the memory ID used/generated, and setup instructions if generated
10
- *
11
- * @example
12
- * ```typescript
13
- * const context = await buildMemoryContext("What's my favorite food?", { topK: 3 });
14
- * console.log(`Found ${context.results.length} relevant memories`);
15
- * if (context.instruction) console.log(context.instruction);
16
- * ```
17
- */
18
- export async function buildMemoryContext(prompt, options = {}) {
19
- const config = await getConfig();
20
- let memoryId;
21
- let generated = false;
22
- if (options.memoryId) {
23
- memoryId = options.memoryId;
24
- }
25
- else if (process.env.SATORI_MEMORY_ID) {
26
- memoryId = process.env.SATORI_MEMORY_ID;
27
- }
28
- else if (config.memoryId) {
29
- memoryId = config.memoryId;
30
- }
31
- else {
32
- const words = generate({ exactly: 3 });
33
- memoryId = words.join('-');
34
- generated = true;
35
- }
36
- const topK = options.topK || 5;
37
- const url = `${config.baseUrl}/search`;
38
- const headers = {
39
- 'Content-Type': 'application/json',
40
- 'Authorization': `Bearer ${config.apiKey}`
41
- };
42
- const body = JSON.stringify({
43
- query: prompt,
44
- memory_id: memoryId,
45
- top_k: topK
46
- });
47
- const response = await fetch(url, {
48
- method: 'POST',
49
- headers,
50
- body
51
- });
52
- if (!response.ok) {
53
- throw new Error(`HTTP error: ${response.status} ${response.statusText}`);
54
- }
55
- const data = await response.json();
56
- const instruction = generated ? `Memory session id: ${memoryId}.` : undefined;
57
- // Save memory ID to config if generated
58
- if (generated) {
59
- saveMemoryId(memoryId).catch(err => {
60
- console.error('Failed to save memory ID:', err);
61
- });
62
- }
63
- return {
64
- results: data.results,
65
- memoryId,
66
- instruction
67
- };
68
- }
69
- /**
70
- * Enhances a message array by prepending relevant memory context as a system message.
71
- *
72
- * @param {Message[]} messages - The original message array
73
- * @param {object} memoryContext - The memory context object
74
- * @param {SearchResponse['results']} memoryContext.results - Array of memory results
75
- * @returns {Message[]} The enhanced message array with memory context prepended
76
- *
77
- * @example
78
- * ```typescript
79
- * const messages = [{ role: 'user', content: 'Hello' }];
80
- * const context = { results: [{ id: '1', memory: 'User likes pizza' }] };
81
- * const enhanced = enhanceMessagesWithMemory(messages, context);
82
- * // enhanced[0] is system message with memory context
83
- * // enhanced[1] is the original user message
84
- * ```
85
- */
86
- export function enhanceMessagesWithMemory(messages, memoryContext) {
87
- const validResults = memoryContext.results.filter(r => r.memory && r.memory.trim() !== '' && r.memory !== 'undefined');
88
- if (validResults.length === 0) {
89
- return messages;
90
- }
91
- const memoryText = validResults.map(r => r.memory).join('\n');
92
- const systemMessage = {
93
- role: 'system',
94
- content: `Relevant context from memory:\n${memoryText}`,
95
- };
96
- return [systemMessage, ...messages];
97
- }
98
- //# sourceMappingURL=memory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAYxC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAAc,EA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 @@
1
- import { Message } from './types.js';
2
- /**
3
- * Options for LLM provider API calls.
4
- */
5
- type ProviderOptions = {
6
- /** Temperature for response randomness (0.0 to 1.0) */
7
- temperature?: number;
8
- /** Maximum tokens in the response */
9
- maxTokens?: number;
10
- /** Whether to enable streaming responses */
11
- stream?: boolean;
12
- };
13
- /**
14
- * Calls the specified LLM provider API with the given messages and options.
15
- *
16
- * @param {Message[]} messages - Array of messages for the conversation
17
- * @param {ProviderOptions} options - API call options
18
- * @param {'openai' | 'anthropic'} provider - The LLM provider to use
19
- * @returns {Promise<string>} The assistant's response text
20
- * @throws {Error} If the provider is unsupported or API keys are missing
21
- *
22
- * @example
23
- * ```typescript
24
- * const response = await _callProviderAPI(
25
- * [{ role: 'user', content: 'Hello!' }],
26
- * { temperature: 0.7, maxTokens: 100 },
27
- * 'openai'
28
- * );
29
- * console.log(response);
30
- * ```
31
- */
32
- export declare function _callProviderAPI(messages: Message[], options: ProviderOptions, provider: 'openai' | 'anthropic'): Promise<string>;
33
- export {};
34
- //# sourceMappingURL=providers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/providers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;GAEG;AACH,KAAK,eAAe,GAAG;IACrB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AA4FF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAQvI"}
@@ -1,107 +0,0 @@
1
- import { getConfig } from './config.js';
2
- /**
3
- * Calls the OpenAI Chat Completions API.
4
- *
5
- * @private
6
- * @param {Message[]} messages - Array of messages for the conversation
7
- * @param {ProviderOptions} options - API call options
8
- * @returns {Promise<string>} The assistant's response text
9
- */
10
- async function _callOpenAI(messages, options) {
11
- const config = await getConfig();
12
- const apiKey = config.openaiKey;
13
- if (!apiKey) {
14
- throw new Error('Missing API key for OPENAI_API_KEY');
15
- }
16
- const url = 'https://api.openai.com/v1/chat/completions';
17
- const body = {
18
- model: config.model,
19
- messages,
20
- temperature: options.temperature ?? 0.7,
21
- max_tokens: options.maxTokens ?? 1000,
22
- stream: options.stream ?? false,
23
- };
24
- const headers = {
25
- 'Content-Type': 'application/json',
26
- 'Authorization': `Bearer ${apiKey}`,
27
- };
28
- const response = await fetch(url, {
29
- method: 'POST',
30
- headers,
31
- body: JSON.stringify(body),
32
- });
33
- if (!response.ok) {
34
- throw new Error(`OpenAI API error: ${response.status} ${response.statusText}`);
35
- }
36
- const data = await response.json();
37
- return data.choices[0].message.content;
38
- }
39
- /**
40
- * Calls the Anthropic Messages API.
41
- *
42
- * @private
43
- * @param {Message[]} messages - Array of messages for the conversation
44
- * @param {ProviderOptions} options - API call options
45
- * @returns {Promise<string>} The assistant's response text
46
- */
47
- async function _callAnthropic(messages, options) {
48
- const config = await getConfig();
49
- const apiKey = config.anthropicKey;
50
- if (!apiKey) {
51
- throw new Error('Missing API key for ANTHROPIC_API_KEY');
52
- }
53
- const url = 'https://api.anthropic.com/v1/messages';
54
- const body = {
55
- model: config.model,
56
- messages,
57
- temperature: options.temperature ?? 0.7,
58
- max_tokens: options.maxTokens ?? 1000,
59
- stream: options.stream ?? false,
60
- };
61
- const headers = {
62
- 'Content-Type': 'application/json',
63
- 'Authorization': `Bearer ${apiKey}`,
64
- 'anthropic-version': '2023-06-01',
65
- };
66
- const response = await fetch(url, {
67
- method: 'POST',
68
- headers,
69
- body: JSON.stringify(body),
70
- });
71
- if (!response.ok) {
72
- throw new Error(`Anthropic API error: ${response.status} ${response.statusText}`);
73
- }
74
- const data = await response.json();
75
- return data.content[0].text;
76
- }
77
- /**
78
- * Calls the specified LLM provider API with the given messages and options.
79
- *
80
- * @param {Message[]} messages - Array of messages for the conversation
81
- * @param {ProviderOptions} options - API call options
82
- * @param {'openai' | 'anthropic'} provider - The LLM provider to use
83
- * @returns {Promise<string>} The assistant's response text
84
- * @throws {Error} If the provider is unsupported or API keys are missing
85
- *
86
- * @example
87
- * ```typescript
88
- * const response = await _callProviderAPI(
89
- * [{ role: 'user', content: 'Hello!' }],
90
- * { temperature: 0.7, maxTokens: 100 },
91
- * 'openai'
92
- * );
93
- * console.log(response);
94
- * ```
95
- */
96
- export async function _callProviderAPI(messages, options, provider) {
97
- if (provider === 'openai') {
98
- return _callOpenAI(messages, options);
99
- }
100
- else if (provider === 'anthropic') {
101
- return _callAnthropic(messages, options);
102
- }
103
- else {
104
- throw new Error(`Unsupported provider: ${provider}`);
105
- }
106
- }
107
- //# sourceMappingURL=providers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"providers.js","sourceRoot":"","sources":["../../src/providers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAexC;;;;;;;GAOG;AACH,KAAK,UAAU,WAAW,CAAC,QAAmB,EAAE,OAAwB;IACtE,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;IAEjC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;IAChC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,GAAG,GAAG,4CAA4C,CAAC;IACzD,MAAM,IAAI,GAAG;QACX,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,QAAQ;QACR,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,GAAG;QACvC,UAAU,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI;QACrC,MAAM,EAAE,OAAO,CAAC,M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AAmB,EAAE,YAAY;KAClC,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAChC,MAAM,EAAE,MAAM;QACd,OAAO;QACP,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,wBAAwB,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IACpF,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAS,CAAC;IAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,QAAmB,EAAE,OAAwB,EAAE,QAAgC;IACpH,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;SAAM,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;QACpC,OAAO,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Searches for memories matching the given query.
3
- *
4
- * @param {string} query - The search query for memories
5
- * @returns {Promise<void>} Logs the search results to console
6
- * @throws {Error} If the query is empty or API call fails
7
- *
8
- * @example
9
- * ```bash
10
- * satori "what is my favorite food?"
11
- * ```
12
- */
13
- export declare function searchMemories(query: string): Promise<void>;
14
- //# sourceMappingURL=search.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/search.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BjE"}
@@ -1,39 +0,0 @@
1
- import { getConfig } from './config.js';
2
- /**
3
- * Searches for memories matching the given query.
4
- *
5
- * @param {string} query - The search query for memories
6
- * @returns {Promise<void>} Logs the search results to console
7
- * @throws {Error} If the query is empty or API call fails
8
- *
9
- * @example
10
- * ```bash
11
- * satori "what is my favorite food?"
12
- * ```
13
- */
14
- export async function searchMemories(query) {
15
- if (!query || !query.trim()) {
16
- console.error('Query cannot be empty');
17
- return;
18
- }
19
- try {
20
- const config = await getConfig();
21
- const response = await fetch(`${config.baseUrl}/search`, {
22
- method: 'POST',
23
- headers: {
24
- 'Content-Type': 'application/json',
25
- 'Authorization': `Bearer ${config.apiKey}`
26
- },
27
- body: JSON.stringify({ query })
28
- });
29
- if (!response.ok) {
30
- console.error(`HTTP error: ${response.status} ${response.statusText}`);
31
- return;
32
- }
33
- await response.json();
34
- }
35
- catch (error) {
36
- console.error(`Error searching memories: ${error instanceof Error ? error.message : error}`);
37
- }
38
- }
39
- //# sourceMappingURL=search.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,KAAa;IAChD,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QAC5B,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,CAAC,OAAO,SAAS,EAAE;YACvD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,eAAe,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE;aAC3C;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC;SAChC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,OAAO,CAAC,KAAK,CAAC,eAAe,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;YACvE,OAAO;QACT,CAAC;QAED,MAAM,QAAQ,CAAC,IAAI,EAAoB,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,OAAO,CAAC,KAAK,CAAC,6BAA6B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;IAC/F,CAAC;AACH,CAAC"}
@@ -1,51 +0,0 @@
1
- /**
2
- * Configuration object for the Satori CLI.
3
- */
4
- export interface Config {
5
- /** API key for Satori authentication */
6
- apiKey: string | null;
7
- /** Base URL for the Satori memory server */
8
- baseUrl: string;
9
- /** Default LLM provider ('openai' or 'anthropic') */
10
- provider: string;
11
- /** Default LLM model name */
12
- model: string;
13
- /** OpenAI API key (required if using OpenAI provider) */
14
- openaiKey?: string;
15
- /** Anthropic API key (required if using Anthropic provider) */
16
- anthropicKey?: string;
17
- /** Memory ID for scoping conversations */
18
- memoryId?: string;
19
- }
20
- /**
21
- * Response from the memory search API.
22
- */
23
- export interface SearchResponse {
24
- /** Array of search results */
25
- results: Array<{
26
- id: string;
27
- memory: string;
28
- score?: number;
29
- }>;
30
- }
31
- /**
32
- * Response from the memory add API.
33
- */
34
- export interface AddResponse {
35
- /** Array of add operation results */
36
- results: Array<{
37
- id: string;
38
- memory: string;
39
- event: string;
40
- }>;
41
- }
42
- /**
43
- * Message format for LLM API calls.
44
- */
45
- export type Message = {
46
- /** Role of the message sender */
47
- role: 'user' | 'assistant' | 'system';
48
- /** Content of the message */
49
- content: string;
50
- };
51
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,MAAM;IACpB,wCAAwC;IACxC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChE;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,qCAAqC;IACrC,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/D;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,iCAAiC;IACjC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IACtC,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
package/dist/src/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../tests/index.test.ts"],"names":[],"mappings":""}