agent-lattice 0.9.12 → 0.9.13
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 +34 -10
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,6 +31,25 @@ for await (const message of agent.query("Say hello")) {
|
|
|
31
31
|
}
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
`createAgent()` includes a private workspace and the built-in file/shell tools
|
|
35
|
+
by default. Use `createBareAgent()` when your host wants to provide every prompt
|
|
36
|
+
and tool explicitly:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { createBareAgent, createBuiltinTools } from "agent-lattice";
|
|
40
|
+
|
|
41
|
+
const agent = createBareAgent({
|
|
42
|
+
apiKey: process.env.DEEPSEEK_API_KEY,
|
|
43
|
+
baseURL: "https://api.deepseek.com/anthropic",
|
|
44
|
+
model: "deepseek-v4-flash",
|
|
45
|
+
systemPrompt: "You are a concise engineering assistant.",
|
|
46
|
+
tools: createBuiltinTools({
|
|
47
|
+
cwd: process.cwd(),
|
|
48
|
+
allowedDirectories: [process.cwd()],
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
34
53
|
Pass `{ stream: false }` to disable model streaming for a query:
|
|
35
54
|
|
|
36
55
|
```ts
|
|
@@ -596,7 +615,8 @@ sends a diagnostic follow-up to the upstream mailbox.
|
|
|
596
615
|
|
|
597
616
|
## Agent Workspace Tools
|
|
598
617
|
|
|
599
|
-
|
|
618
|
+
`createAgent()` includes a private workspace and these built-in tools by
|
|
619
|
+
default:
|
|
600
620
|
|
|
601
621
|
- `Read`
|
|
602
622
|
- `Write`
|
|
@@ -606,14 +626,18 @@ AgentLattice includes an opt-in set of workspace tools:
|
|
|
606
626
|
- `Grep`
|
|
607
627
|
- `Bash`
|
|
608
628
|
|
|
629
|
+
Use `createBuiltinTools()` or `createAgentWorkspaceTools()` when you want to
|
|
630
|
+
assemble the tool list yourself, especially with `createBareAgent()`:
|
|
631
|
+
|
|
609
632
|
```ts
|
|
610
|
-
import {
|
|
633
|
+
import { createBareAgent, createBuiltinTools } from "agent-lattice";
|
|
611
634
|
|
|
612
|
-
const agent =
|
|
635
|
+
const agent = createBareAgent({
|
|
613
636
|
apiKey: process.env.DEEPSEEK_API_KEY,
|
|
614
637
|
baseURL: "https://api.deepseek.com/anthropic",
|
|
615
638
|
model: "deepseek-v4-flash",
|
|
616
|
-
|
|
639
|
+
systemPrompt: "Use the configured project directory for file work.",
|
|
640
|
+
tools: createBuiltinTools({
|
|
617
641
|
cwd: process.cwd(),
|
|
618
642
|
allowedDirectories: [process.cwd()],
|
|
619
643
|
}),
|
|
@@ -626,12 +650,12 @@ const agent = createAgent({
|
|
|
626
650
|
});
|
|
627
651
|
```
|
|
628
652
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
653
|
+
`Read`, `LS`, `Glob`, and `Grep` are read-only observation tools and are not
|
|
654
|
+
gated by workspace grants. `Write`, `Edit`, and obvious Bash writes are gated to
|
|
655
|
+
the configured workspace roots and task-scoped shared workspace grants, so
|
|
656
|
+
production hosts should pair write and shell access with a permission callback.
|
|
657
|
+
Shell redirects to `/dev/null` are treated as discard targets, not workspace
|
|
658
|
+
writes.
|
|
635
659
|
|
|
636
660
|
## Multi-turn Session
|
|
637
661
|
|
package/dist/index.d.ts
CHANGED
|
@@ -365,6 +365,7 @@ export type AgentOptions = {
|
|
|
365
365
|
modelClient?: ModelClient;
|
|
366
366
|
tracer?: ContextTracer;
|
|
367
367
|
};
|
|
368
|
+
export type BareAgentOptions = Omit<AgentOptions, "workspace">;
|
|
368
369
|
export type AgentWorkspaceToolsOptions = {
|
|
369
370
|
cwd?: string;
|
|
370
371
|
allowedDirectories?: string[];
|
|
@@ -488,6 +489,8 @@ export declare function delegateTool(name: string, description: string, agent: A
|
|
|
488
489
|
task: string;
|
|
489
490
|
}>;
|
|
490
491
|
export declare function createAgent(options: AgentOptions): Agent;
|
|
492
|
+
export declare function createBareAgent(options: BareAgentOptions): Agent;
|
|
493
|
+
export declare function createBuiltinTools(options?: AgentWorkspaceToolsOptions): Array<ToolDefinition<any>>;
|
|
491
494
|
export declare function createJsonlContextTracer(options: JsonlContextTracerOptions): ContextTracer;
|
|
492
495
|
export declare function createCompositeContextTracer(tracers: Array<ContextTracer | undefined | null>): ContextTracer;
|
|
493
496
|
export declare function createLangSmithContextTracer(options: LangSmithContextTracerOptions): ContextTracer;
|