@flue/sdk 0.3.11 → 0.4.1
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 +14 -23
- package/dist/abort-Bg3qsAkU.mjs +43 -0
- package/dist/app.d.mts +106 -0
- package/dist/app.mjs +4 -0
- package/dist/client.d.mts +9 -3
- package/dist/client.mjs +10 -24
- package/dist/cloudflare/index.d.mts +10 -6
- package/dist/cloudflare/index.mjs +388 -26
- package/dist/cloudflare-model-BeiZ1pLz.d.mts +6 -0
- package/dist/config.d.mts +133 -0
- package/dist/config.mjs +195 -0
- package/dist/flue-app-CG8i4wNG.d.mts +184 -0
- package/dist/flue-app-DeTOZjPs.mjs +730 -0
- package/dist/index.d.mts +41 -19
- package/dist/index.mjs +434 -594
- package/dist/internal.d.mts +9 -272
- package/dist/internal.mjs +16 -430
- package/dist/{mcp-CcRxAwXW.d.mts → mcp-C3UBXVkR.d.mts} +1 -1
- package/dist/{mcp-DmDTeVXW.mjs → mcp-DM6yv_Qc.mjs} +19 -33
- package/dist/node/index.d.mts +8 -12
- package/dist/node/index.mjs +94 -64
- package/dist/providers-DeFRIwp0.mjs +158 -0
- package/dist/result-K1IRhWKM.mjs +685 -0
- package/dist/sandbox.d.mts +25 -4
- package/dist/sandbox.mjs +44 -62
- package/dist/{session-DlwIt7wq.mjs → session-CFOByKnM.mjs} +488 -263
- package/dist/types-BAmV4f3Q.d.mts +727 -0
- package/package.json +12 -1
- package/dist/agent-Cahthgu3.mjs +0 -453
- package/dist/command-helpers-eVG1-Iru.d.mts +0 -21
- package/dist/command-helpers-hTZKWK13.mjs +0 -37
- package/dist/types-DGpyKMFm.d.mts +0 -508
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as SessionStore, C as PromptUsage, D as SessionData, E as SandboxFactory, F as TaskOptions, I as ThinkingLevel, L as ToolDef, M as ShellResult, N as Skill, O as SessionEnv, P as SkillOptions, R as ToolParameters, S as PromptResultResponse, T as Role, _ as FlueSessions, a as BashLike, b as PromptOptions, c as BuildPlugin, d as FlueAgent, f as FlueContext, g as FlueSession, h as FlueFs, i as BashFactory, j as ShellOptions, k as SessionOptions, l as CallHandle, m as FlueEventCallback, n as AgentInfo, o as BuildContext, p as FlueEvent, r as AgentInit, s as BuildOptions, t as AgentConfig, u as FileStat, v as ModelConfig, x as PromptResponse, y as PromptModel } from "./types-BAmV4f3Q.mjs";
|
|
2
2
|
import { AgentTool, AgentToolResult } from "@mariozechner/pi-agent-core";
|
|
3
3
|
|
|
4
4
|
//#region src/build.d.ts
|
|
@@ -11,35 +11,45 @@ interface BuildResult {
|
|
|
11
11
|
changed: boolean;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Build a
|
|
14
|
+
* Build a project into a deployable artifact.
|
|
15
15
|
*
|
|
16
|
-
* `options.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* `options.root` is the project root — typically the user's cwd. Source files
|
|
17
|
+
* (agents, roles) are discovered from one of two locations inside the root,
|
|
18
|
+
* with the same precedence rule the CLI uses:
|
|
19
|
+
*
|
|
20
|
+
* - If `<root>/.flue/` exists, it is the source root. Look for
|
|
21
|
+
* `.flue/agents/` and `.flue/roles/`. The bare `<root>/agents/` and
|
|
22
|
+
* `<root>/roles/` are ignored entirely (no mixing).
|
|
23
|
+
* - Otherwise, look at `<root>/agents/` and `<root>/roles/`.
|
|
24
|
+
*
|
|
25
|
+
* Build output lands in `options.output` (defaults to `<root>/dist`).
|
|
20
26
|
*
|
|
21
27
|
* AGENTS.md and .agents/skills/ are NOT bundled — discovered at runtime from session cwd.
|
|
22
28
|
*/
|
|
23
29
|
declare function build(options: BuildOptions): Promise<BuildResult>;
|
|
24
30
|
/**
|
|
25
|
-
* Resolve
|
|
26
|
-
*
|
|
27
|
-
* not provided — callers that pass an explicit workspace path should skip this
|
|
28
|
-
* and pass the path straight to `build()`.
|
|
31
|
+
* Resolve the source root for a project, using the `.flue/`-as-src
|
|
32
|
+
* convention (analogous to Next.js's `src/` folder).
|
|
29
33
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
34
|
+
* If `<root>/.flue/` exists, it is the source root. Otherwise the source root
|
|
35
|
+
* is the project root itself. The two layouts never mix — if `.flue/` exists,
|
|
36
|
+
* the bare layout is ignored entirely (even if a `<root>/agents/` directory
|
|
37
|
+
* also happens to be present).
|
|
33
38
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
39
|
+
* The project root (cwd) stays the same in both cases — `.flue/` only shifts
|
|
40
|
+
* where source files are discovered from. The build output directory is
|
|
41
|
+
* independent (defaults to `<root>/dist`, override with `output`).
|
|
36
42
|
*/
|
|
37
|
-
declare function
|
|
43
|
+
declare function resolveSourceRoot(root: string): string;
|
|
38
44
|
//#endregion
|
|
39
45
|
//#region src/dev.d.ts
|
|
40
46
|
interface DevOptions {
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
root: string;
|
|
48
|
+
/**
|
|
49
|
+
* Where the build artifacts are written. Defaults to `<root>/dist`.
|
|
50
|
+
* See {@link BuildOptions.output} for details.
|
|
51
|
+
*/
|
|
52
|
+
output?: string;
|
|
43
53
|
target: 'node' | 'cloudflare';
|
|
44
54
|
/** Defaults to 3583 ("FLUE" on a phone keypad). */
|
|
45
55
|
port?: number;
|
|
@@ -113,4 +123,16 @@ interface CreateToolsOptions {
|
|
|
113
123
|
}
|
|
114
124
|
declare function createTools(env: SessionEnv, options?: CreateToolsOptions): AgentTool<any>[];
|
|
115
125
|
//#endregion
|
|
116
|
-
|
|
126
|
+
//#region src/result.d.ts
|
|
127
|
+
/**
|
|
128
|
+
* Thrown when the LLM calls the `give_up` tool, indicating it cannot produce a
|
|
129
|
+
* result that conforms to the required schema. Carries the LLM-supplied
|
|
130
|
+
* `reason` and the assistant transcript leading up to the give-up.
|
|
131
|
+
*/
|
|
132
|
+
declare class ResultUnavailableError extends Error {
|
|
133
|
+
readonly reason: string;
|
|
134
|
+
readonly assistantText: string;
|
|
135
|
+
constructor(reason: string, assistantText: string);
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
export { type AgentConfig, type AgentInfo, type AgentInit, BUILTIN_TOOL_NAMES, type BashFactory, type BashLike, type BuildContext, type BuildOptions, type BuildPlugin, type CallHandle, DEFAULT_DEV_PORT, type DevOptions, type FileStat, type FlueAgent, type FlueContext, type FlueEvent, type FlueEventCallback, type FlueFs, type FlueSession, type FlueSessions, type ModelConfig, type PromptModel, type PromptOptions, type PromptResponse, type PromptResultResponse, type PromptUsage, ResultUnavailableError, type Role, type SandboxFactory, type SessionData, type SessionEnv, type SessionOptions, type SessionStore, type ShellOptions, type ShellResult, type Skill, type SkillOptions, type TaskOptions, type ThinkingLevel, type ToolDef, type ToolParameters, build, createTools, dev, parseEnvFiles, resolveEnvFiles, resolveSourceRoot };
|