@columenlabs/lumen-ai 0.1.273 → 0.1.274

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.
@@ -23,6 +23,11 @@ import { UsageMeter } from './usage.js';
23
23
  /** What a plan's extra tools get: the open tools, a meter of their own and the cap. */
24
24
  export interface TurnTools {
25
25
  opened: OpenedTools;
26
+ /**
27
+ * The agent's own file tools over its workspace (read, list, find, grep and the rest, as Think
28
+ * gives the main model), so a hand-off reads the same files the app wrote for this turn.
29
+ */
30
+ files: ToolSet;
26
31
  /** A new part of this answer's usage (a hand off), counted against the cap. */
27
32
  meter(model: ModelDef, label: string, free?: boolean): UsageMeter;
28
33
  /** Spent this answer reached what the payer has left. */
@@ -12,6 +12,7 @@
12
12
  * An `Assistant` gives both: `assistant.agentTurn(caller, input)` returns a plan and its settle.
13
13
  */
14
14
  import { anthropic } from '@ai-sdk/anthropic';
15
+ import { createAITools } from '@cloudflare/computer/tools/ai-sdk';
15
16
  import { Think, } from '@cloudflare/think';
16
17
  import { ASSISTANT_IMAGES_MAX, ASSISTANT_IMAGE_CHARS, ASSISTANT_IMAGE_TYPES, ASSISTANT_QUOTE_MAX, } from '@columenlabs/lumen-ui-types/assistant';
17
18
  import { createCompactFunction } from 'agents/sessions';
@@ -706,6 +707,7 @@ export class LumenAgent extends Think {
706
707
  };
707
708
  const more = plan.more?.({
708
709
  opened,
710
+ files: createAITools({ workspace: this.workspace }),
709
711
  over: () => plan.left !== undefined && this.#spent() >= plan.left,
710
712
  meter: (model, label, f = free) => {
711
713
  const m = new UsageMeter(model, label, f);
@@ -645,7 +645,7 @@ export class Assistant {
645
645
  }),
646
646
  instructions: c.system(tt.opened),
647
647
  prompt: `${c.message}\n\n${this.name} handed you this task (${WHY_TEXT[shown]}): ${task}\n\nWork it out with the tools, then end with a memo for ${this.name} of at most 200 words: the answer and the facts it rests on. ${this.name} answers the person.`,
648
- tools: tt.opened.tools,
648
+ tools: { ...tt.files, ...tt.opened.tools },
649
649
  stopWhen: stepCountIs(MAX_ROUNDS),
650
650
  prepareStep: () => (tt.over() ? { activeTools: [] } : undefined),
651
651
  onStepFinish: (s) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@columenlabs/lumen-ai",
3
- "version": "0.1.273",
3
+ "version": "0.1.274",
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",
@@ -55,9 +55,10 @@
55
55
  "@ai-sdk/anthropic": "4.0.96",
56
56
  "@ai-sdk/openai": "4.0.108",
57
57
  "@anthropic-ai/sdk": "0.133.0",
58
+ "@cloudflare/computer": "0.8.0",
58
59
  "@cloudflare/think": "0.23.0",
59
- "@columenlabs/lumen-ops": "0.1.273",
60
- "@columenlabs/lumen-ui-types": "0.1.273",
60
+ "@columenlabs/lumen-ops": "0.1.274",
61
+ "@columenlabs/lumen-ui-types": "0.1.274",
61
62
  "agents": "0.32.0",
62
63
  "ai": "7.0.162",
63
64
  "just-bash": "3.6.0",