@columenlabs/lumen-ai 0.1.150 → 0.1.151
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/README.md +1 -1
- package/dist/assistant/store.d.ts +6 -1
- package/dist/assistant/store.js +5 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -81,7 +81,7 @@ const assistant = createAssistant({
|
|
|
81
81
|
{ id: 'notes', label: 'Notes', about: 'Read and edit notes', tools: (caller) => mcpServerTools(() => notesServer(caller.id)) },
|
|
82
82
|
],
|
|
83
83
|
web: { fetch: { blockHosts: ['app.example.com'] }, scrapeql: { url: 'https://scrapeql.example.com/mcp' } },
|
|
84
|
-
store: sqlAssistantStore(doSql(ctx.storage.sql)), // or d1Sql(env.DB)
|
|
84
|
+
store: sqlAssistantStore(doSql(ctx.storage.sql)), // or d1Sql(env.DB); { table } names another table
|
|
85
85
|
sealer, // the app's own sealing: keys and chats are stored sealed
|
|
86
86
|
// A provider's key when none is set in Settings.
|
|
87
87
|
appKey: async (provider) => (provider === 'openai' ? env.OPENAI_API_KEY : env.ANTHROPIC_API_KEY),
|
|
@@ -63,7 +63,12 @@ export declare function d1Sql(db: {
|
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
}): SqlRunner;
|
|
66
|
-
export
|
|
66
|
+
export interface SqlAssistantStoreOptions {
|
|
67
|
+
/** The table to keep documents in (default `assistant_docs`): a store that must prefix its tables,
|
|
68
|
+
* such as a module of a person's store (`sage_docs`), names its own. Letters, digits and `_`. */
|
|
69
|
+
table?: string;
|
|
70
|
+
}
|
|
71
|
+
export declare function sqlAssistantStore(sql: SqlRunner, opts?: SqlAssistantStoreOptions): AssistantStore;
|
|
67
72
|
/** JSON documents over a store, sealed when the app gives a sealer. */
|
|
68
73
|
export declare class Docs {
|
|
69
74
|
private readonly store;
|
package/dist/assistant/store.js
CHANGED
|
@@ -34,8 +34,11 @@ export function d1Sql(db) {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
/** The table name, so an app's own tables never clash with it. */
|
|
37
|
-
const
|
|
38
|
-
export function sqlAssistantStore(sql) {
|
|
37
|
+
const DEFAULT_TABLE = 'assistant_docs';
|
|
38
|
+
export function sqlAssistantStore(sql, opts = {}) {
|
|
39
|
+
const TABLE = opts.table ?? DEFAULT_TABLE;
|
|
40
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(TABLE))
|
|
41
|
+
throw new Error(`Not a table name: ${TABLE}`);
|
|
39
42
|
let ready = null;
|
|
40
43
|
const init = () => {
|
|
41
44
|
ready ??= sql.run(`CREATE TABLE IF NOT EXISTS ${TABLE} (scope TEXT NOT NULL, key TEXT NOT NULL, meta TEXT, value TEXT NOT NULL, at INTEGER NOT NULL, PRIMARY KEY (scope, key))`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@columenlabs/lumen-ai",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.151",
|
|
4
4
|
"description": "Lumen's assistant and agent parts: a chat assistant's server (Claude tiers, tools over MCP, the web, hand off, spend caps), serving an MCP server from a Worker, read-only tool sets and metered tool calls.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@anthropic-ai/sdk": "0.133.0",
|
|
44
|
-
"@columenlabs/lumen-ops": "0.1.
|
|
45
|
-
"@columenlabs/lumen-ui-types": "0.1.
|
|
44
|
+
"@columenlabs/lumen-ops": "0.1.151",
|
|
45
|
+
"@columenlabs/lumen-ui-types": "0.1.151",
|
|
46
46
|
"openai": "7.32.0",
|
|
47
47
|
"zod": "^4.3.6"
|
|
48
48
|
},
|