@letta-ai/letta-code 0.32.14 → 0.32.15
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/app-server-client.cjs +2 -2
- package/dist/app-server-client.cjs.map +3 -3
- package/dist/app-server-client.js +2 -2
- package/dist/app-server-client.js.map +3 -3
- package/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/types/agent/message.d.ts +3 -0
- package/dist/types/agent/message.d.ts.map +1 -1
- package/dist/types/cli/helpers/tool-name-mapping.d.ts +4 -0
- package/dist/types/cli/helpers/tool-name-mapping.d.ts.map +1 -1
- package/dist/types/tools/impl/kill-bash.d.ts.map +1 -1
- package/dist/types/tools/impl/process_manager.d.ts +2 -1
- package/dist/types/tools/impl/process_manager.d.ts.map +1 -1
- package/dist/types/tools/impl/workflow.d.ts +55 -0
- package/dist/types/tools/impl/workflow.d.ts.map +1 -0
- package/dist/types/tools/manager.d.ts +2 -7
- package/dist/types/tools/manager.d.ts.map +1 -1
- package/dist/types/tools/tool-definitions.d.ts +1 -0
- package/dist/types/tools/tool-definitions.d.ts.map +1 -1
- package/dist/types/tools/tool-permissions.d.ts.map +1 -1
- package/dist/types/tools/toolset-catalog.d.ts +1 -1
- package/dist/types/tools/toolset-catalog.d.ts.map +1 -1
- package/dist/types/tools/workflow/execution-registry.d.ts +58 -0
- package/dist/types/tools/workflow/execution-registry.d.ts.map +1 -0
- package/dist/types/tools/workflow/format-stats.d.ts +23 -0
- package/dist/types/tools/workflow/format-stats.d.ts.map +1 -0
- package/dist/types/tools/workflow/journal.d.ts +25 -0
- package/dist/types/tools/workflow/journal.d.ts.map +1 -0
- package/dist/types/tools/workflow/meta.d.ts +14 -0
- package/dist/types/tools/workflow/meta.d.ts.map +1 -0
- package/dist/types/tools/workflow/sdk-loader.d.ts +33 -0
- package/dist/types/tools/workflow/sdk-loader.d.ts.map +1 -0
- package/dist/types/tools/workflow/sdk-spawner.d.ts +33 -0
- package/dist/types/tools/workflow/sdk-spawner.d.ts.map +1 -0
- package/dist/types/tools/workflow/types.d.ts +148 -0
- package/dist/types/tools/workflow/types.d.ts.map +1 -0
- package/dist/types/tools/workflow/workflow-engine.d.ts +20 -0
- package/dist/types/tools/workflow/workflow-engine.d.ts.map +1 -0
- package/dist/types/types/app-server-info.d.ts +1 -0
- package/dist/types/types/app-server-info.d.ts.map +1 -1
- package/dist/types/types/protocol_v2.d.ts +2 -5
- package/dist/types/types/protocol_v2.d.ts.map +1 -1
- package/dist/types/websocket/listener/types.d.ts +1 -0
- package/dist/types/websocket/listener/types.d.ts.map +1 -1
- package/letta.js +2 -2
- package/package.json +2 -1
- package/scripts/source-file-size-baseline.json +2 -2
- package/skills/workflow-authoring/SKILL.md +217 -0
|
@@ -38,6 +38,8 @@ export type SendMessageStreamOptions = {
|
|
|
38
38
|
* does not mutate agent/conversation persisted model configuration.
|
|
39
39
|
*/
|
|
40
40
|
overrideModel?: string;
|
|
41
|
+
/** Request-scoped Messages API response format. */
|
|
42
|
+
responseFormat?: Record<string, unknown>;
|
|
41
43
|
/** Explicit turn-scoped tool snapshot. When present, bypasses the global registry. */
|
|
42
44
|
preparedToolContext?: PreparedToolExecutionContext;
|
|
43
45
|
/**
|
|
@@ -73,6 +75,7 @@ export type SendMessageStreamRequestOptions = {
|
|
|
73
75
|
};
|
|
74
76
|
export declare function buildConversationMessagesCreateRequestBody(conversationId: string, messages: Array<MessageCreate | ApprovalCreate>, opts: SendMessageStreamOptions | undefined, clientTools: ClientTool[], clientSkills?: NonNullable<ConversationMessageCreateParams["client_skills"]>): {
|
|
75
77
|
agent_id?: string | undefined;
|
|
78
|
+
response_format?: Record<string, unknown> | undefined;
|
|
76
79
|
override_model?: string | undefined;
|
|
77
80
|
messages: (MessageCreate | ApprovalCreate)[];
|
|
78
81
|
streaming: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/agent/message.ts"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O,EAChB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,KAAK,CAAC,aAAa,GAAG,cAAc,CAAC,EAC/C,IAAI,GAAE,wBAAmE,EACzE,cAAc,GAAE,+BAEf,GACA,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAgRzC"}
|
|
@@ -13,6 +13,10 @@ export declare function getDisplayToolName(rawName: string): string;
|
|
|
13
13
|
* Checks if a tool name represents a Task/subagent tool
|
|
14
14
|
*/
|
|
15
15
|
export declare function isTaskTool(name: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Checks if a tool name represents the background Workflow orchestration tool
|
|
18
|
+
*/
|
|
19
|
+
export declare function isWorkflowTool(name: string): boolean;
|
|
16
20
|
/**
|
|
17
21
|
* Checks if a tool name represents a TODO/planning tool
|
|
18
22
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-name-mapping.d.ts","sourceRoot":"","sources":["../../../../src/cli/helpers/tool-name-mapping.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA8C1D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIhD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAMzE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAOvD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAEzE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUnD;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAA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AY;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,UAAU,cAAc;IACtB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAG3E;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"kill-bash.d.ts","sourceRoot":"","sources":["../../../../src/tools/impl/kill-bash.ts"],"names":[],"mappings":"AAQA,UAAU,YAAY;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,UAAU,cAAc;IACtB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAG3E;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CA+B/D"}
|
|
@@ -23,7 +23,7 @@ export interface BackgroundProcess {
|
|
|
23
23
|
totalStderrLines?: number;
|
|
24
24
|
cleanupTimer?: TimerHandle;
|
|
25
25
|
runtimeScope?: BackgroundRuntimeScope;
|
|
26
|
-
kind?: "monitor";
|
|
26
|
+
kind?: "monitor" | "workflow";
|
|
27
27
|
description?: string;
|
|
28
28
|
monitorSource?: "command" | "websocket";
|
|
29
29
|
persistent?: boolean;
|
|
@@ -60,6 +60,7 @@ export declare function subscribeToBackgroundProcessState(listener: BackgroundPr
|
|
|
60
60
|
export declare function notifyBackgroundProcessStateChanged(scope?: BackgroundRuntimeScope): void;
|
|
61
61
|
export declare function getNextBashId(): string;
|
|
62
62
|
export declare function getNextMonitorId(): string;
|
|
63
|
+
export declare function getNextWorkflowId(): string;
|
|
63
64
|
export declare function getNextExecSessionId(): string;
|
|
64
65
|
export declare function getNextTaskId(): string;
|
|
65
66
|
export declare function getNextDownloadId(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process_manager.d.ts","sourceRoot":"","sources":["../../../../src/tools/impl/process_manager.ts"],"names":[],"mappings":"AAYA,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAEjD,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CACzC;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,uBAAuB,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC3C,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,aAAa,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAClD,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,IAAI,CAAC,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"process_manager.d.ts","sourceRoot":"","sources":["../../../../src/tools/impl/process_manager.ts"],"names":[],"mappings":"AAYA,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAEjD,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CACzC;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,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AAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAK9D;AAED,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAK3D;AAcD,wBAAgB,gCAAgC,IAAI,MAAM,CAEzD;AAED,wBAAgB,+BAA+B,IAAI,IAAI,CAOtD;AAED,wBAAgB,4BAA4B,IAAI,IAAI,CAOnD;AAED,wBAAgB,gCAAgC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAEjE;AAED,wBAAgB,6BAA6B,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAE9D;AAED,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,iBAAiB,EAC/B,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAC3B,IAAI,EAAE,MAAM,GACX,IAAI,CAoBN;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,MAAM,GACb,IAAI,CAEN;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAY/C;AAED,wBAAgB,kCAAkC,IAAI,IAAI,CAEzD;AAUD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAS7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAO7E;AAED,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,iBAAiB,GAC9B,OAAO,CAaT"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow tool: launches a workflow script that orchestrates multiple
|
|
3
|
+
* subagents deterministically. The engine lives in @/tools/workflow; each
|
|
4
|
+
* agent() call in the script runs in an agent-free ephemeral conversation via
|
|
5
|
+
* @letta-ai/letta-agent-sdk (loaded lazily — see @/tools/workflow/sdk-loader).
|
|
6
|
+
*
|
|
7
|
+
* The run happens in the background: the tool validates the script, registers
|
|
8
|
+
* a background task, and returns at once with the task id. Progress lines go
|
|
9
|
+
* to the task's output file (for TaskOutput). Completion queues a task
|
|
10
|
+
* notification through the message-queue bridge, exactly like background
|
|
11
|
+
* Bash, Monitor, and background subagents, so all three host paths (TUI,
|
|
12
|
+
* headless, listener) wake the model the same way.
|
|
13
|
+
*
|
|
14
|
+
* Listed in STREAMING_SHELL_TOOLS, so `signal`, `onOutput`, and `parentScope`
|
|
15
|
+
* are injected into args (not part of the model-facing JSON schema).
|
|
16
|
+
*/
|
|
17
|
+
import type { SubagentSpawner, WorkflowProgressEvent } from "../workflow/types";
|
|
18
|
+
interface WorkflowArgs {
|
|
19
|
+
script?: string;
|
|
20
|
+
scriptPath?: string;
|
|
21
|
+
args?: unknown;
|
|
22
|
+
maxConcurrent?: number;
|
|
23
|
+
model?: string;
|
|
24
|
+
allowedTools?: string[];
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
onOutput?: (chunk: string, stream: "stdout" | "stderr") => void;
|
|
27
|
+
parentScope?: {
|
|
28
|
+
agentId: string;
|
|
29
|
+
conversationId: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
interface WorkflowResult {
|
|
33
|
+
toolReturn: string;
|
|
34
|
+
status: "success" | "error";
|
|
35
|
+
}
|
|
36
|
+
/** What the tool needs from a subagent backend; the SDK spawner in production. */
|
|
37
|
+
export interface WorkflowSpawnerHandle {
|
|
38
|
+
spawner: SubagentSpawner;
|
|
39
|
+
cleanup(): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
type SpawnerFactory = (args: WorkflowArgs) => Promise<WorkflowSpawnerHandle>;
|
|
42
|
+
export declare function createSdkSpawnerHandle(args: WorkflowArgs): Promise<WorkflowSpawnerHandle>;
|
|
43
|
+
/** Swap the subagent backend (tests inject a fake spawner). */
|
|
44
|
+
export declare function __setWorkflowSpawnerFactoryForTests(factory: SpawnerFactory | null): void;
|
|
45
|
+
export declare function formatWorkflowProgressLine(event: WorkflowProgressEvent): string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Models routinely pass `args` as a JSON-encoded string despite the schema
|
|
48
|
+
* asking for a real value, and the script then dies on `args.files.length`.
|
|
49
|
+
* A string that is itself a JSON object or array is unambiguous: decode it.
|
|
50
|
+
* Any other string stays a string.
|
|
51
|
+
*/
|
|
52
|
+
export declare function normalizeWorkflowArgs(value: unknown): unknown;
|
|
53
|
+
export declare function workflow(args: WorkflowArgs): Promise<WorkflowResult>;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../../src/tools/impl/workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA8BH,OAAO,KAAK,EACV,eAAe,EAGf,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAsBhC,UAAU,YAAY;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,QAAQ,KAAK,IAAI,CAAC;IAChE,WAAW,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3D;AAED,UAAU,cAAc;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;CAC7B;AAED,kFAAkF;AAClF,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,KAAK,cAAc,GAAG,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;AA2B7E,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,qBAAqB,CAAC,CAwChC;AAID,+DAA+D;AAC/D,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,cAAc,GAAG,IAAI,GAC7B,IAAI,CAEN;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,qBAAqB,GAC3B,MAAM,GAAG,IAAI,CAef;AASD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAS7D;AAmCD,wBAAsB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAmM1E"}
|
|
@@ -8,14 +8,9 @@ import { type JsonSchema, type ModelFacingToolForm } from "./model-facing-tool";
|
|
|
8
8
|
import { type PermissionModeState } from "./permission-mode-state";
|
|
9
9
|
import { type ToolName } from "./tool-definitions";
|
|
10
10
|
export declare const TOOL_NAMES: ToolName[];
|
|
11
|
-
/**
|
|
12
|
-
* Get the server-facing name for a tool (maps internal names to what the model sees)
|
|
13
|
-
*/
|
|
11
|
+
/** Get the server-facing name for a tool (maps internal names to what the model sees). */
|
|
14
12
|
export declare function getServerToolName(internalName: string): string;
|
|
15
|
-
/**
|
|
16
|
-
* Get the internal tool name from a server-facing name
|
|
17
|
-
* Used when the server sends back tool calls/approvals with server names
|
|
18
|
-
*/
|
|
13
|
+
/** Get the internal tool name from a server-facing name (tool calls/approvals arrive with server names). */
|
|
19
14
|
export declare function getInternalToolName(serverName: string): string;
|
|
20
15
|
import type { ToolsetName } from "./toolset-types";
|
|
21
16
|
type ToolArgs = Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/tools/manager.ts"],"names":[],"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oB,IAAI,MAAM,EAAE,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,UAAU,EAAE,CAY7C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAC5B,UAAU,GAAG,SAAS,CA2BxB;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAEjC"}
|
|
@@ -107,6 +107,7 @@ declare const toolDefinitions: {
|
|
|
107
107
|
readonly TaskList: ToolAssets;
|
|
108
108
|
readonly TaskUpdate: ToolAssets;
|
|
109
109
|
readonly TodoWrite: ToolAssets;
|
|
110
|
+
readonly Workflow: ToolAssets;
|
|
110
111
|
readonly Write: ToolAssets;
|
|
111
112
|
readonly write_artifact_file: ToolAssets;
|
|
112
113
|
readonly shell_command: ToolAssets;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-definitions.d.ts","sourceRoot":"","sources":["../../../src/tools/tool-definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-definitions.d.ts","sourceRoot":"","sources":["../../../src/tools/tool-definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AA0I5D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS1B,CAAC;AAEX,wBAAgB,+BAA+B,CAC7C,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,MAAM,CAKR;AASD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyO0B,CAAC;AAEhD,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,eAAe,CAAC;AAEpD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-permissions.d.ts","sourceRoot":"","sources":["../../../src/tools/tool-permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGnD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,QAAQ,EACR;IAAE,gBAAgB,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,kBAAkB,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"tool-permissions.d.ts","sourceRoot":"","sources":["../../../src/tools/tool-permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGnD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,QAAQ,EACR;IAAE,gBAAgB,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAiDnE,CAAC"}
|
|
@@ -3,7 +3,7 @@ import type { ToolsetName, ToolsetOption, ToolsetPreference } from "./toolset-ty
|
|
|
3
3
|
interface ToolsetDefinition extends Omit<ToolsetOption, "id"> {
|
|
4
4
|
tools: readonly ToolName[];
|
|
5
5
|
}
|
|
6
|
-
export declare const WORKTREE_TOOL_NAMES: Set<"memory" | "Write" | "Edit" | "MultiEdit" | "ApplyPatch" | "memory_apply_patch" | "Bash" | "shell" | "AskUserQuestion" | "BashOutput" | "EnterWorktree" | "ExitWorktree" | "Glob" | "Grep" | "KillBash" | "TaskOutput" | "TaskStop" | "LS" | "Monitor" | "Read" | "read_artifact_file" | "ViewImage" | "ReadLSP" | "SendAgentMessage" | "SetWorkingDirectory" | "Skill" | "Task" | "TaskCreate" | "TaskGet" | "TaskList" | "TaskUpdate" | "TodoWrite" | "write_artifact_file" | "shell_command" | "exec_command" | "write_stdin" | "read_file" | "list_dir" | "grep_files" | "ShellCommand" | "Shell" | "ReadFile" | "ListDir" | "GrepFiles" | "UpdatePlan">;
|
|
6
|
+
export declare const WORKTREE_TOOL_NAMES: Set<"memory" | "Write" | "Edit" | "MultiEdit" | "ApplyPatch" | "memory_apply_patch" | "Bash" | "shell" | "AskUserQuestion" | "BashOutput" | "EnterWorktree" | "ExitWorktree" | "Glob" | "Grep" | "KillBash" | "TaskOutput" | "TaskStop" | "LS" | "Monitor" | "Read" | "read_artifact_file" | "ViewImage" | "ReadLSP" | "SendAgentMessage" | "SetWorkingDirectory" | "Skill" | "Task" | "TaskCreate" | "TaskGet" | "TaskList" | "TaskUpdate" | "TodoWrite" | "Workflow" | "write_artifact_file" | "shell_command" | "exec_command" | "write_stdin" | "read_file" | "list_dir" | "grep_files" | "ShellCommand" | "Shell" | "ReadFile" | "ListDir" | "GrepFiles" | "UpdatePlan">;
|
|
7
7
|
/** Presets in picker order. Availability filters and explicit allowlists apply afterward. */
|
|
8
8
|
export declare const TOOLSET_CATALOG: Readonly<Record<ToolsetName, ToolsetDefinition>>;
|
|
9
9
|
/** Auto selects a preset; client-facing options omit the internal tool lists. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolset-catalog.d.ts","sourceRoot":"","sources":["../../../src/tools/toolset-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAEzB,UAAU,iBAAkB,SAAQ,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC;IAC3D,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;CAC5B;AAED,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"toolset-catalog.d.ts","sourceRoot":"","sources":["../../../src/tools/toolset-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAEzB,UAAU,iBAAkB,SAAQ,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC;IAC3D,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;CAC5B;AAED,eAAO,MAAM,mBAAmB,+oBAG9B,CAAC;AAEH,6FAA6F;AAC7F,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,iBAAiB,CAAC,CA0F1E,CAAC;AAEJ,iFAAiF;AACjF,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAYnD,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,iBAAiB,CAE5B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-process registry of Workflow tool runs, kept for status reporting.
|
|
3
|
+
*
|
|
4
|
+
* The Workflow tool launches a run in the background and returns at once; the
|
|
5
|
+
* run then reports progress here. The /workflows command and the completion
|
|
6
|
+
* summary read from it. Entries for finished runs are retained for a short
|
|
7
|
+
* while so the final numbers stay visible.
|
|
8
|
+
*/
|
|
9
|
+
import type { WorkflowMeta, WorkflowProgressEvent } from "./types.ts";
|
|
10
|
+
export type WorkflowExecutionStatus = "running" | "completed" | "failed";
|
|
11
|
+
export interface WorkflowAgentRecord {
|
|
12
|
+
callIndex: number;
|
|
13
|
+
label: string;
|
|
14
|
+
phase: string | null;
|
|
15
|
+
status: "queued" | "running" | "done" | "error";
|
|
16
|
+
detail?: string;
|
|
17
|
+
durationMs?: number;
|
|
18
|
+
totalTokens?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface WorkflowExecutionSnapshot {
|
|
21
|
+
taskId: string;
|
|
22
|
+
executionDir: string;
|
|
23
|
+
outputFile: string;
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
status: WorkflowExecutionStatus;
|
|
27
|
+
error?: string;
|
|
28
|
+
/** Wall-clock so far (running) or total (finished). */
|
|
29
|
+
durationMs: number;
|
|
30
|
+
agentsTotal: number;
|
|
31
|
+
agentsDone: number;
|
|
32
|
+
agentsFailed: number;
|
|
33
|
+
agentsRunning: number;
|
|
34
|
+
totalTokens: number;
|
|
35
|
+
phases: Array<{
|
|
36
|
+
title: string;
|
|
37
|
+
agents: WorkflowAgentRecord[];
|
|
38
|
+
}>;
|
|
39
|
+
logs: string[];
|
|
40
|
+
}
|
|
41
|
+
export declare function registerWorkflowExecution(params: {
|
|
42
|
+
taskId: string;
|
|
43
|
+
executionDir: string;
|
|
44
|
+
outputFile: string;
|
|
45
|
+
meta: WorkflowMeta;
|
|
46
|
+
startedAt?: number;
|
|
47
|
+
}): void;
|
|
48
|
+
/** Apply one engine progress event to a run. */
|
|
49
|
+
export declare function recordWorkflowProgress(taskId: string, event: WorkflowProgressEvent): void;
|
|
50
|
+
export declare function finishWorkflowExecution(taskId: string, outcome: {
|
|
51
|
+
status: "completed" | "failed";
|
|
52
|
+
error?: string;
|
|
53
|
+
}): void;
|
|
54
|
+
export declare function getWorkflowExecution(taskId: string): WorkflowExecutionSnapshot | null;
|
|
55
|
+
/** All retained runs, oldest first. */
|
|
56
|
+
export declare function listWorkflowExecutions(): WorkflowExecutionSnapshot[];
|
|
57
|
+
export declare function __resetWorkflowExecutionsForTests(): void;
|
|
58
|
+
//# sourceMappingURL=execution-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-registry.d.ts","sourceRoot":"","sources":["../../../../src/tools/workflow/execution-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EA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D;AAChD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,qBAAqB,GAC3B,IAAI,CA8BN;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1D,IAAI,CAmBN;AAyCD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,GACb,yBAAyB,GAAG,IAAI,CAGlC;AAED,uCAAuC;AACvC,wBAAgB,sBAAsB,IAAI,yBAAyB,EAAE,CAKpE;AAED,wBAAgB,iCAAiC,IAAI,IAAI,CAIxD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared formatting for workflow execution statistics. Lives in the tools
|
|
3
|
+
* layer so both the tool (completion notification summary) and the CLI
|
|
4
|
+
* (/workflows) print identical numbers.
|
|
5
|
+
*/
|
|
6
|
+
/** 500 → "500", 5200 → "5.2k", 167200 → "167.2k", 2_400_000 → "2.4M". */
|
|
7
|
+
export declare function formatCompactTokens(n: number): string;
|
|
8
|
+
/** 9_400 → "9s", 65_000 → "1m 05s", 3_725_000 → "1h 02m". */
|
|
9
|
+
export declare function formatWorkflowDuration(ms: number): string;
|
|
10
|
+
export interface WorkflowStatsInput {
|
|
11
|
+
durationMs: number;
|
|
12
|
+
agentsDone: number;
|
|
13
|
+
agentsTotal: number;
|
|
14
|
+
totalTokens: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Progress fragment for a live run: "2/3 agents done · 9s · 133.6k tokens".
|
|
18
|
+
* Tokens are omitted while none have been reported.
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatWorkflowProgress(stats: WorkflowStatsInput): string;
|
|
21
|
+
/** Summary fragment for a finished run: "36s · 4 agents · 167.2k tokens". */
|
|
22
|
+
export declare function formatWorkflowSummary(stats: WorkflowStatsInput): string;
|
|
23
|
+
//# sourceMappingURL=format-stats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-stats.d.ts","sourceRoot":"","sources":["../../../../src/tools/workflow/format-stats.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAOrD;AAED,6DAA6D;AAC7D,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAQzD;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CASxE;AAED,6EAA6E;AAC7E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAOvE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run persistence: every workflow run gets a directory holding the script it
|
|
3
|
+
* ran, its args, and a JSONL journal with one line per completed subagent
|
|
4
|
+
* call. The journal is a debugging record (what each agent actually
|
|
5
|
+
* returned); nothing replays from it.
|
|
6
|
+
*
|
|
7
|
+
* Everything here holds prompts, responses, and script source, so files are
|
|
8
|
+
* created owner-only regardless of the process umask.
|
|
9
|
+
*/
|
|
10
|
+
import type { SubagentOutcome } from "./types.ts";
|
|
11
|
+
export interface JournalEntry {
|
|
12
|
+
callIndex: number;
|
|
13
|
+
label: string;
|
|
14
|
+
prompt: string;
|
|
15
|
+
outcome: SubagentOutcome;
|
|
16
|
+
}
|
|
17
|
+
export declare function defaultExecutionsDir(): string;
|
|
18
|
+
export declare function newExecutionId(): string;
|
|
19
|
+
export declare function createExecutionDir(executionsDir: string, executionId: string, script: string, args: unknown): {
|
|
20
|
+
executionDir: string;
|
|
21
|
+
scriptPath: string;
|
|
22
|
+
journalPath: string;
|
|
23
|
+
};
|
|
24
|
+
export declare function appendJournalEntry(journalPath: string, entry: JournalEntry): void;
|
|
25
|
+
//# sourceMappingURL=journal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal.d.ts","sourceRoot":"","sources":["../../../../src/tools/workflow/journal.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,cAAc,IAAI,MAAM,CAOvC;AAMD,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,GACZ;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAiBnE;AAED,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,YAAY,GAClB,IAAI,CAIN"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extraction and validation of the `export const meta = {...}` literal that
|
|
3
|
+
* must open every workflow script.
|
|
4
|
+
*
|
|
5
|
+
* The literal is evaluated in an empty vm context, so any identifier
|
|
6
|
+
* reference, function call, or interpolation inside it throws — this is what
|
|
7
|
+
* enforces the "pure literal" rule.
|
|
8
|
+
*/
|
|
9
|
+
import type { WorkflowMeta } from "./types.ts";
|
|
10
|
+
/** Parse and validate the meta block. Throws with a precise message. */
|
|
11
|
+
export declare function parseWorkflowMeta(script: string): WorkflowMeta;
|
|
12
|
+
/** Rewrite `export const meta` so the body can run inside a vm script. */
|
|
13
|
+
export declare function stripMetaExport(script: string): string;
|
|
14
|
+
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../src/tools/workflow/meta.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAyD/C,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAyC9D;AAED,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy loader for @letta-ai/letta-agent-sdk.
|
|
3
|
+
*
|
|
4
|
+
* The SDK is a runtime dependency of letta-code, but it is imported lazily by
|
|
5
|
+
* a computed specifier rather than statically: the SDK itself depends on a
|
|
6
|
+
* published @letta-ai/letta-code (the Workflow tool accepts that its
|
|
7
|
+
* subagents may run a version behind), and bundling that nested copy into
|
|
8
|
+
* letta.js would be circular and heavy. Resolution order:
|
|
9
|
+
*
|
|
10
|
+
* 1. LETTA_AGENT_SDK_PATH env var (installed copy or checkout; overrides)
|
|
11
|
+
* 2. letta-code's own dependency (resolved from this module)
|
|
12
|
+
* 3. Normal module resolution from the working directory
|
|
13
|
+
* 4. A direct probe of node_modules/@letta-ai/letta-agent-sdk walking up
|
|
14
|
+
* from this module and from the working directory
|
|
15
|
+
*
|
|
16
|
+
* Step 4 exists because the runtime caches a failed resolution for the life
|
|
17
|
+
* of the process: a CLI started before `bun install` added the SDK keeps
|
|
18
|
+
* failing steps 2-3 after the install, while a file URL it has never tried
|
|
19
|
+
* still loads. When the package is on disk and nothing loads, the error says
|
|
20
|
+
* to restart rather than to install.
|
|
21
|
+
*/
|
|
22
|
+
import type { SdkClient } from "./types.ts";
|
|
23
|
+
export interface LoadedSdk {
|
|
24
|
+
/** A local client whose subagents run on this computer against the API backend. */
|
|
25
|
+
createLocalClient(): SdkClient;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Installed copies found by walking up from each start directory, nearest
|
|
29
|
+
* first. Bypasses the module resolver entirely.
|
|
30
|
+
*/
|
|
31
|
+
export declare function probeInstalledSdkDirs(startDirs: string[]): string[];
|
|
32
|
+
export declare function loadAgentSdk(): Promise<LoadedSdk>;
|
|
33
|
+
//# sourceMappingURL=sdk-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-loader.d.ts","sourceRoot":"","sources":["../../../../src/tools/workflow/sdk-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAK5C,MAAM,WAAW,SAAS;IACxB,mFAAmF;IACnF,iBAAiB,IAAI,SAAS,CAAC;CAChC;AAsCD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAkBnE;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC,SAAS,CAAC,CAuFvD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK-backed subagent execution: one agent() call is one Agent SDK query()
|
|
3
|
+
* in its own agent-free ephemeral conversation, linked to the invoking parent
|
|
4
|
+
* agent. The model is installed when that conversation is created, so
|
|
5
|
+
* concurrent calls with different models never touch a shared agent.
|
|
6
|
+
*/
|
|
7
|
+
import type { SdkClient, SubagentSpawner } from "./types.ts";
|
|
8
|
+
export interface SdkSpawnerConfig {
|
|
9
|
+
/** Invoking agent supplies permissions/resources, never child history ownership. */
|
|
10
|
+
parentAgentId: string;
|
|
11
|
+
/** Default model handle for subagents. */
|
|
12
|
+
model: string;
|
|
13
|
+
/** Resolves a handle or alias from agent() opts; null when unknown. */
|
|
14
|
+
resolveModel?: (identifier: string) => string | null;
|
|
15
|
+
/** Default tool allowlist for subagents. Keep it read-only by default. */
|
|
16
|
+
allowedTools?: string[];
|
|
17
|
+
/** Working directory for subagent sessions. */
|
|
18
|
+
cwd?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const DEFAULT_ALLOWED_TOOLS: string[];
|
|
21
|
+
/**
|
|
22
|
+
* Runaway guards. Live runs showed models re-issuing the identical tool call
|
|
23
|
+
* dozens of times and never ending the turn; every repeat re-sends the whole
|
|
24
|
+
* context. A stopped call resolves to a failed outcome whose error names the
|
|
25
|
+
* guard, so the journal explains the null.
|
|
26
|
+
*/
|
|
27
|
+
export declare const DEFAULT_SUBAGENT_TIMEOUT_MS: number;
|
|
28
|
+
export declare const DEFAULT_MAX_SUBAGENT_TOOL_CALLS = 1000;
|
|
29
|
+
export declare const MAX_IDENTICAL_TOOL_CALLS = 3;
|
|
30
|
+
/** Parse a JSON reply, tolerating a ``` fence the model added anyway. */
|
|
31
|
+
export declare function parseJsonReply(text: string): unknown;
|
|
32
|
+
export declare function createSdkSpawner(client: SdkClient, config: SdkSpawnerConfig): SubagentSpawner;
|
|
33
|
+
//# sourceMappingURL=sdk-spawner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-spawner.d.ts","sourceRoot":"","sources":["../../../../src/tools/workflow/sdk-spawner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAEV,SAAS,EAIT,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,aAAa,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACrD,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,qBAAqB,UAA2B,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAAiB,CAAC;AAC1D,eAAO,MAAM,+BAA+B,OAAO,CAAC;AACpD,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAS1C,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIpD;AAiPD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,gBAAgB,GACvB,eAAe,CA8GjB"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for the workflow engine.
|
|
3
|
+
*
|
|
4
|
+
* A workflow is a plain-JavaScript orchestration script that begins with an
|
|
5
|
+
* `export const meta = {...}` pure literal and then drives subagents through
|
|
6
|
+
* the injected hooks: agent(), parallel(), pipeline(), phase(), log().
|
|
7
|
+
*
|
|
8
|
+
* The Letta Agent SDK surface used here is described structurally; the real
|
|
9
|
+
* SDK is loaded lazily at runtime by sdk-loader.ts (see its header for why
|
|
10
|
+
* the import is dynamic).
|
|
11
|
+
*/
|
|
12
|
+
/** One phase entry in the workflow meta block. */
|
|
13
|
+
export interface WorkflowPhaseMeta {
|
|
14
|
+
title: string;
|
|
15
|
+
detail?: string;
|
|
16
|
+
}
|
|
17
|
+
/** The `export const meta = {...}` literal at the top of every script. */
|
|
18
|
+
export interface WorkflowMeta {
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
phases?: WorkflowPhaseMeta[];
|
|
22
|
+
}
|
|
23
|
+
/** Options accepted by the in-script agent() hook. */
|
|
24
|
+
export interface AgentCallOptions {
|
|
25
|
+
/** Display label for progress output (defaults to a prompt excerpt). */
|
|
26
|
+
label?: string;
|
|
27
|
+
/** Progress group; overrides the current phase() for this call. */
|
|
28
|
+
phase?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Ask the subagent for a JSON value and resolve to the parsed result. No
|
|
31
|
+
* schema is enforced; a reply that is not valid JSON resolves to null.
|
|
32
|
+
*/
|
|
33
|
+
json?: boolean;
|
|
34
|
+
/** Model handle or alias for this subagent (defaults to the workflow default). */
|
|
35
|
+
model?: string;
|
|
36
|
+
/** Reasoning effort override ("low" | "medium" | "high" | ...). */
|
|
37
|
+
effort?: string;
|
|
38
|
+
/** Tool allowlist override for this subagent session. */
|
|
39
|
+
allowedTools?: string[];
|
|
40
|
+
/** Extra system prompt appended for this subagent. */
|
|
41
|
+
systemPrompt?: string;
|
|
42
|
+
/** Per-call timeout in milliseconds. */
|
|
43
|
+
timeoutMs?: number;
|
|
44
|
+
/** Maximum unique tool calls for this subagent. Default 1000. */
|
|
45
|
+
maxToolCalls?: number;
|
|
46
|
+
}
|
|
47
|
+
/** A single request to run one subagent, produced by the agent() hook. */
|
|
48
|
+
export interface SubagentRequest {
|
|
49
|
+
prompt: string;
|
|
50
|
+
options: AgentCallOptions;
|
|
51
|
+
/** Sequential id assigned in call order. */
|
|
52
|
+
callIndex: number;
|
|
53
|
+
}
|
|
54
|
+
/** Outcome of one subagent run. */
|
|
55
|
+
export interface SubagentOutcome {
|
|
56
|
+
/** Persisted ephemeral conversation, when one was created. */
|
|
57
|
+
conversationId?: string;
|
|
58
|
+
/** Final text, or the parsed value when `json` was requested. */
|
|
59
|
+
value: unknown;
|
|
60
|
+
/** True when the subagent failed terminally (value is null). */
|
|
61
|
+
failed: boolean;
|
|
62
|
+
/** Optional failure detail for the journal / progress display. */
|
|
63
|
+
error?: string;
|
|
64
|
+
durationMs?: number;
|
|
65
|
+
/** Total tokens consumed by the subagent session (prompt + completion). */
|
|
66
|
+
totalTokens?: number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Runs one subagent. The SDK-backed implementation lives in sdk-spawner.ts;
|
|
70
|
+
* tests inject fakes.
|
|
71
|
+
*/
|
|
72
|
+
export type SubagentSpawner = (request: SubagentRequest, signal: AbortSignal) => Promise<SubagentOutcome>;
|
|
73
|
+
/** Progress events emitted while a workflow runs. */
|
|
74
|
+
export type WorkflowProgressEvent = {
|
|
75
|
+
kind: "phase";
|
|
76
|
+
title: string;
|
|
77
|
+
} | {
|
|
78
|
+
kind: "log";
|
|
79
|
+
message: string;
|
|
80
|
+
} | {
|
|
81
|
+
kind: "agent";
|
|
82
|
+
callIndex: number;
|
|
83
|
+
label: string;
|
|
84
|
+
phase: string | null;
|
|
85
|
+
status: "queued" | "running" | "done" | "error";
|
|
86
|
+
detail?: string;
|
|
87
|
+
durationMs?: number;
|
|
88
|
+
totalTokens?: number;
|
|
89
|
+
};
|
|
90
|
+
export interface RunWorkflowOptions {
|
|
91
|
+
/** The workflow script source (plain JS, starting with the meta literal). */
|
|
92
|
+
script: string;
|
|
93
|
+
/** Value exposed to the script as the `args` global. */
|
|
94
|
+
args?: unknown;
|
|
95
|
+
/** Max concurrently running subagents. Default 16. */
|
|
96
|
+
maxConcurrent?: number;
|
|
97
|
+
/** Lifetime subagent cap (runaway-loop backstop). Default 1000. */
|
|
98
|
+
maxTotalAgents?: number;
|
|
99
|
+
/** JSONL file that receives one line per completed subagent call. */
|
|
100
|
+
journalPath?: string;
|
|
101
|
+
/** Abort signal for the whole run. */
|
|
102
|
+
signal?: AbortSignal;
|
|
103
|
+
/** Progress callback. */
|
|
104
|
+
onProgress?: (event: WorkflowProgressEvent) => void;
|
|
105
|
+
}
|
|
106
|
+
export interface WorkflowExecutionResult {
|
|
107
|
+
meta: WorkflowMeta;
|
|
108
|
+
/** The script's return value. */
|
|
109
|
+
result: unknown;
|
|
110
|
+
agentsSpawned: number;
|
|
111
|
+
/** Sum of subagent token usage across the run. */
|
|
112
|
+
totalTokens: number;
|
|
113
|
+
}
|
|
114
|
+
export interface SdkStreamMessage {
|
|
115
|
+
type: string;
|
|
116
|
+
content?: string;
|
|
117
|
+
success?: boolean;
|
|
118
|
+
result?: string;
|
|
119
|
+
error?: string;
|
|
120
|
+
errorCode?: string;
|
|
121
|
+
durationMs?: number;
|
|
122
|
+
/** Raw Letta stream payload for `type: "stream_event"` messages. */
|
|
123
|
+
event?: Record<string, unknown>;
|
|
124
|
+
/** Tool call details for `type: "tool_call"` / `"tool_result"` messages. */
|
|
125
|
+
toolCallId?: string;
|
|
126
|
+
toolName?: string;
|
|
127
|
+
toolInput?: Record<string, unknown>;
|
|
128
|
+
/**
|
|
129
|
+
* Raw, possibly-partial argument fragment from the wire. The SDK emits one
|
|
130
|
+
* `tool_call` message per argument delta; concatenating the fragments for a
|
|
131
|
+
* `toolCallId` yields the complete argument JSON.
|
|
132
|
+
*/
|
|
133
|
+
rawArguments?: string;
|
|
134
|
+
}
|
|
135
|
+
export interface SdkQuery extends AsyncIterable<SdkStreamMessage> {
|
|
136
|
+
readonly agentId?: string | null;
|
|
137
|
+
readonly conversationId?: string | null;
|
|
138
|
+
interrupt(): Promise<void>;
|
|
139
|
+
close(): void;
|
|
140
|
+
}
|
|
141
|
+
export interface SdkClient {
|
|
142
|
+
query(params: {
|
|
143
|
+
prompt: string;
|
|
144
|
+
options: Record<string, unknown>;
|
|
145
|
+
}): SdkQuery;
|
|
146
|
+
[Symbol.asyncDispose]?(): Promise<void>;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=types.d.ts.map
|