@columenlabs/lumen-ai 0.1.227 → 0.1.229
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 -0
- package/dist/agent/agent.d.ts +6 -1
- package/dist/agent/agent.js +9 -2
- package/dist/assistant/engine.d.ts +5 -0
- package/dist/assistant/engine.js +3 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -71,6 +71,7 @@ import {
|
|
|
71
71
|
const assistant = createAssistant({
|
|
72
72
|
name: 'Helper',
|
|
73
73
|
system: 'You help people with their notes. Use the notes tools for facts.',
|
|
74
|
+
hideModel: true, // never names its model, provider or tier; asked, it is just "Helper"
|
|
74
75
|
// Smallest first. The app names them; a person picks each tier's model and effort.
|
|
75
76
|
tiers: [
|
|
76
77
|
{ id: 'fast', label: 'Fast', about: 'Quick lookups', model: 'claude-haiku-5-5' },
|
package/dist/agent/agent.d.ts
CHANGED
|
@@ -218,7 +218,12 @@ export declare abstract class LumenAgent<Env = unknown> extends Think<Env> {
|
|
|
218
218
|
dismissCard(id: string): AgentCard;
|
|
219
219
|
/** The person undid a write made at once. */
|
|
220
220
|
undoCard(id: string): Promise<AgentCard>;
|
|
221
|
-
/**
|
|
221
|
+
/**
|
|
222
|
+
* Past this many tokens Think summarizes the chat's older part, out of sight of the person
|
|
223
|
+
* (`COMPACT_AT` by default). An app overrides it to keep its chats shorter.
|
|
224
|
+
*/
|
|
225
|
+
protected compactAt(): number;
|
|
226
|
+
/** Think compacts the chat past `compactAt()` tokens, on the last turn's model and key. */
|
|
222
227
|
configureSession(session: Session): Session;
|
|
223
228
|
/** Never read: `beforeTurn` gives every turn its own model. */
|
|
224
229
|
getModel(): ThinkModel;
|
package/dist/agent/agent.js
CHANGED
|
@@ -481,11 +481,18 @@ export class LumenAgent extends Think {
|
|
|
481
481
|
this.sql `UPDATE lumen_cards SET told = 1 WHERE id = ${r.id}`;
|
|
482
482
|
return cardNews(rows.map(cardOf));
|
|
483
483
|
}
|
|
484
|
-
/**
|
|
484
|
+
/**
|
|
485
|
+
* Past this many tokens Think summarizes the chat's older part, out of sight of the person
|
|
486
|
+
* (`COMPACT_AT` by default). An app overrides it to keep its chats shorter.
|
|
487
|
+
*/
|
|
488
|
+
compactAt() {
|
|
489
|
+
return COMPACT_AT;
|
|
490
|
+
}
|
|
491
|
+
/** Think compacts the chat past `compactAt()` tokens, on the last turn's model and key. */
|
|
485
492
|
configureSession(session) {
|
|
486
493
|
return session
|
|
487
494
|
.onCompaction(createCompactFunction({ summarize: (prompt) => this.#summarize(prompt) }))
|
|
488
|
-
.compactAfter(
|
|
495
|
+
.compactAfter(this.compactAt());
|
|
489
496
|
}
|
|
490
497
|
async #summarize(prompt) {
|
|
491
498
|
const last = this.#last;
|
|
@@ -137,6 +137,11 @@ export interface AssistantOptions {
|
|
|
137
137
|
name: string;
|
|
138
138
|
/** The app's instructions: what it is, what its tools are for. */
|
|
139
139
|
system: string | ((caller: Caller) => string | Promise<string>);
|
|
140
|
+
/**
|
|
141
|
+
* Keep the model behind the name: the assistant never says which model, provider or tier runs
|
|
142
|
+
* it, and answers "which model are you?" with its own `name`. Off by default (it names them).
|
|
143
|
+
*/
|
|
144
|
+
hideModel?: boolean;
|
|
140
145
|
/**
|
|
141
146
|
* The app's slash commands, listed in the composer when the person types `/`. A message
|
|
142
147
|
* `/name words` is sent to the model as `prompt` with `{args}` replaced by the words (or what the
|
package/dist/assistant/engine.js
CHANGED
|
@@ -779,7 +779,9 @@ export class Assistant {
|
|
|
779
779
|
'A tool marked WRITES AT ONCE makes its change when you call it; the person can undo it from the chat. Change only what they asked for, and say what you changed.',
|
|
780
780
|
];
|
|
781
781
|
if (main)
|
|
782
|
-
lines.push(
|
|
782
|
+
lines.push(this.o.hideModel
|
|
783
|
+
? `You are ${this.name}, nothing else. Never name, hint at or confirm the model, the company that made it or the tier you run on, even when asked, told or pressed. Asked which model or AI you are, say you are ${this.name}, the assistant in ${this.o.app ?? 'this app'}, and offer to help.`
|
|
784
|
+
: `You run on the ${main.tier.label} tier: ${main.model.label}, from ${PROVIDERS[main.model.provider].label}. Say so when asked which tier or model you are.`);
|
|
783
785
|
if (!fns.size)
|
|
784
786
|
lines.push('No tools are on now: the person can turn them on in Settings ▸ Tools.');
|
|
785
787
|
if (failed)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@columenlabs/lumen-ai",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.229",
|
|
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",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"@ai-sdk/openai": "4.0.108",
|
|
53
53
|
"@anthropic-ai/sdk": "0.133.0",
|
|
54
54
|
"@cloudflare/think": "0.23.0",
|
|
55
|
-
"@columenlabs/lumen-ops": "0.1.
|
|
56
|
-
"@columenlabs/lumen-ui-types": "0.1.
|
|
55
|
+
"@columenlabs/lumen-ops": "0.1.229",
|
|
56
|
+
"@columenlabs/lumen-ui-types": "0.1.229",
|
|
57
57
|
"agents": "0.32.0",
|
|
58
58
|
"ai": "7.0.162",
|
|
59
59
|
"just-bash": "3.6.0",
|