@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/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as ShellResult, C as Role, D as SessionOptions, E as SessionEnv, F as ToolParameters, M as SkillOptions, N as TaskOptions, O as SessionStore, P as ToolDef, T as SessionData, _ as FlueSessions, a as BashLike, b as PromptResponse, c as BuildPlugin, d as FileStat, f as FlueAgent, g as FlueSession, h as FlueEventCallback, i as BashFactory, j as Skill, k as ShellOptions, l as Command, m as FlueEvent, n as AgentInfo, o as BuildContext, p as FlueContext, r as AgentInit, s as BuildOptions, t as AgentConfig, u as CommandDef, v as ModelConfig, w as SandboxFactory, y as PromptOptions } from "./types-DGpyKMFm.mjs";
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 workspace into a deployable artifact.
14
+ * Build a project into a deployable artifact.
15
15
  *
16
- * `options.workspaceDir` is treated as an explicit workspace root — the directory
17
- * directly containing agents/ and roles/. No .flue/ waterfall is performed here;
18
- * callers that want waterfall behavior (e.g. the CLI when --workspace is omitted)
19
- * should use `resolveWorkspaceFromCwd` first.
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 a Flue workspace directory from the current working directory,
26
- * using the two-layout convention. Intended for the CLI when `--workspace` is
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
- * Two supported layouts, checked in order:
31
- * 1. `<cwd>/.flue/` use this when Flue is embedded in an existing project.
32
- * 2. `<cwd>/` use this when the project itself is the Flue workspace.
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
- * If `.flue/` exists, it wins unconditionally no mixing with the bare layout.
35
- * Returns null if neither is present so the caller can produce a helpful error.
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 resolveWorkspaceFromCwd(cwd: string): string | null;
43
+ declare function resolveSourceRoot(root: string): string;
38
44
  //#endregion
39
45
  //#region src/dev.d.ts
40
46
  interface DevOptions {
41
- workspaceDir: string;
42
- outputDir: string;
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
- export { type AgentConfig, type AgentInfo, type AgentInit, BUILTIN_TOOL_NAMES, type BashFactory, type BashLike, type BuildContext, type BuildOptions, type BuildPlugin, type Command, type CommandDef, DEFAULT_DEV_PORT, type DevOptions, type FileStat, type FlueAgent, type FlueContext, type FlueEvent, type FlueEventCallback, type FlueSession, type FlueSessions, type ModelConfig, type PromptOptions, type PromptResponse, type Role, type SandboxFactory, type SessionData, type SessionEnv, type SessionOptions, type SessionStore, type ShellOptions, type ShellResult, type Skill, type SkillOptions, type TaskOptions, type ToolDef, type ToolParameters, build, createTools, dev, parseEnvFiles, resolveEnvFiles, resolveWorkspaceFromCwd };
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 };