flowforge-client 0.3.2 → 0.3.4
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 +19 -4
- package/dist/index.d.ts +19 -4
- package/dist/index.js +3 -0
- package/dist/index.mjs +3 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -15,7 +15,7 @@ declare class FlowForgeError extends Error {
|
|
|
15
15
|
constructor(message: string, status: number, code?: string | undefined, detail?: unknown | undefined);
|
|
16
16
|
}
|
|
17
17
|
type RunStatus = "pending" | "running" | "completed" | "failed" | "paused" | "cancelled";
|
|
18
|
-
type StepType = "run" | "sleep" | "ai" | "wait_for_event" | "invoke" | "send_event" | "agent";
|
|
18
|
+
type StepType = "run" | "sleep" | "ai" | "wait_for_event" | "invoke" | "send_event" | "agent" | "sub_agent";
|
|
19
19
|
type StepStatus = "pending" | "running" | "completed" | "failed" | "sleeping" | "waiting";
|
|
20
20
|
type TriggerType = "event" | "cron" | "webhook";
|
|
21
21
|
type ApprovalStatus = "pending" | "approved" | "rejected" | "expired";
|
|
@@ -23,6 +23,7 @@ interface Run {
|
|
|
23
23
|
id: string;
|
|
24
24
|
function_id: string;
|
|
25
25
|
event_id: string | null;
|
|
26
|
+
parent_run_id: string | null;
|
|
26
27
|
status: RunStatus;
|
|
27
28
|
trigger_type: string;
|
|
28
29
|
trigger_data: Record<string, unknown>;
|
|
@@ -159,6 +160,20 @@ interface ToolFilters {
|
|
|
159
160
|
interface ApprovalFilters {
|
|
160
161
|
status: ApprovalStatus;
|
|
161
162
|
}
|
|
163
|
+
interface SubAgentConfig {
|
|
164
|
+
system_prompt: string;
|
|
165
|
+
model?: string;
|
|
166
|
+
tools?: string[];
|
|
167
|
+
max_iterations?: number;
|
|
168
|
+
max_tool_calls?: number;
|
|
169
|
+
description?: string;
|
|
170
|
+
}
|
|
171
|
+
interface AgentConfig {
|
|
172
|
+
model?: string;
|
|
173
|
+
max_iterations?: number;
|
|
174
|
+
max_tool_calls?: number;
|
|
175
|
+
sub_agents?: Record<string, SubAgentConfig>;
|
|
176
|
+
}
|
|
162
177
|
interface CreateFunctionInput {
|
|
163
178
|
id: string;
|
|
164
179
|
name: string;
|
|
@@ -169,7 +184,7 @@ interface CreateFunctionInput {
|
|
|
169
184
|
is_inline?: boolean;
|
|
170
185
|
system_prompt?: string;
|
|
171
186
|
tools_config?: string[];
|
|
172
|
-
agent_config?: Record<string, unknown>;
|
|
187
|
+
agent_config?: AgentConfig | Record<string, unknown>;
|
|
173
188
|
config?: Record<string, unknown>;
|
|
174
189
|
is_active?: boolean;
|
|
175
190
|
}
|
|
@@ -294,7 +309,7 @@ interface ApiKeysResponse {
|
|
|
294
309
|
interface ApiKeyFilters {
|
|
295
310
|
include_revoked: boolean;
|
|
296
311
|
}
|
|
297
|
-
type RunEventType = "step_started" | "step_completed" | "step_failed" | "thinking" | "thinking_chunk" | "tool_call_started" | "tool_call_completed" | "approval_required" | "approval_resolved" | "run_started" | "run_paused" | "run_resumed" | "run_completed" | "run_failed";
|
|
312
|
+
type RunEventType = "step_started" | "step_completed" | "step_failed" | "thinking" | "thinking_chunk" | "tool_call_started" | "tool_call_completed" | "approval_required" | "approval_resolved" | "sub_agent_started" | "sub_agent_completed" | "run_started" | "run_paused" | "run_resumed" | "run_completed" | "run_failed";
|
|
298
313
|
interface RunStreamEvent {
|
|
299
314
|
type: RunEventType;
|
|
300
315
|
data: Record<string, unknown>;
|
|
@@ -1082,4 +1097,4 @@ interface FlowForgeClient {
|
|
|
1082
1097
|
*/
|
|
1083
1098
|
declare function createClient(baseUrl: string, options?: ClientOptions): FlowForgeClient;
|
|
1084
1099
|
|
|
1085
|
-
export { type ApiKey, type ApiKeyCreated, type ApiKeyFilters, type ApiKeyType, ApiKeysResource, type ApiKeysResponse, type Approval, type ApprovalFilters, type ApprovalStatus, ApprovalsResource, type ClientOptions, type CreateApiKeyInput, type CreateCredentialInput, type CreateFunctionInput, type CreateToolInput, type CreateUserInput, type Credential, CredentialsResource, type CredentialsResponse, type Event, type EventFilters, EventsResource, type FlowForgeClient, FlowForgeError, type FlowForgeFunction, type FunctionFilters, FunctionsResource, HealthResource, type HealthStatus, type OrderDirection, QueryBuilder, type QueryParams, type Result, type Run, type RunEventType, type RunFilters, type RunStatus, RunStream, type RunStreamEvent, type RunWithSteps, RunsResource, type SendEventInput, type SendEventResponse, type Stats, type Step, type StepStatus, type StepType, type StreamConfig, type StreamOptions, type Tool, type ToolFilters, type ToolType, ToolsResource, type TriggerType, type UpdateCredentialInput, type UpdateFunctionInput, type UpdateToolInput, type UpdateUserInput, type User, type UserRole, UsersResource, type UsersResponse, createClient };
|
|
1100
|
+
export { type AgentConfig, type ApiKey, type ApiKeyCreated, type ApiKeyFilters, type ApiKeyType, ApiKeysResource, type ApiKeysResponse, type Approval, type ApprovalFilters, type ApprovalStatus, ApprovalsResource, type ClientOptions, type CreateApiKeyInput, type CreateCredentialInput, type CreateFunctionInput, type CreateToolInput, type CreateUserInput, type Credential, CredentialsResource, type CredentialsResponse, type Event, type EventFilters, EventsResource, type FlowForgeClient, FlowForgeError, type FlowForgeFunction, type FunctionFilters, FunctionsResource, HealthResource, type HealthStatus, type OrderDirection, QueryBuilder, type QueryParams, type Result, type Run, type RunEventType, type RunFilters, type RunStatus, RunStream, type RunStreamEvent, type RunWithSteps, RunsResource, type SendEventInput, type SendEventResponse, type Stats, type Step, type StepStatus, type StepType, type StreamConfig, type StreamOptions, type SubAgentConfig, type Tool, type ToolFilters, type ToolType, ToolsResource, type TriggerType, type UpdateCredentialInput, type UpdateFunctionInput, type UpdateToolInput, type UpdateUserInput, type User, type UserRole, UsersResource, type UsersResponse, createClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ declare class FlowForgeError extends Error {
|
|
|
15
15
|
constructor(message: string, status: number, code?: string | undefined, detail?: unknown | undefined);
|
|
16
16
|
}
|
|
17
17
|
type RunStatus = "pending" | "running" | "completed" | "failed" | "paused" | "cancelled";
|
|
18
|
-
type StepType = "run" | "sleep" | "ai" | "wait_for_event" | "invoke" | "send_event" | "agent";
|
|
18
|
+
type StepType = "run" | "sleep" | "ai" | "wait_for_event" | "invoke" | "send_event" | "agent" | "sub_agent";
|
|
19
19
|
type StepStatus = "pending" | "running" | "completed" | "failed" | "sleeping" | "waiting";
|
|
20
20
|
type TriggerType = "event" | "cron" | "webhook";
|
|
21
21
|
type ApprovalStatus = "pending" | "approved" | "rejected" | "expired";
|
|
@@ -23,6 +23,7 @@ interface Run {
|
|
|
23
23
|
id: string;
|
|
24
24
|
function_id: string;
|
|
25
25
|
event_id: string | null;
|
|
26
|
+
parent_run_id: string | null;
|
|
26
27
|
status: RunStatus;
|
|
27
28
|
trigger_type: string;
|
|
28
29
|
trigger_data: Record<string, unknown>;
|
|
@@ -159,6 +160,20 @@ interface ToolFilters {
|
|
|
159
160
|
interface ApprovalFilters {
|
|
160
161
|
status: ApprovalStatus;
|
|
161
162
|
}
|
|
163
|
+
interface SubAgentConfig {
|
|
164
|
+
system_prompt: string;
|
|
165
|
+
model?: string;
|
|
166
|
+
tools?: string[];
|
|
167
|
+
max_iterations?: number;
|
|
168
|
+
max_tool_calls?: number;
|
|
169
|
+
description?: string;
|
|
170
|
+
}
|
|
171
|
+
interface AgentConfig {
|
|
172
|
+
model?: string;
|
|
173
|
+
max_iterations?: number;
|
|
174
|
+
max_tool_calls?: number;
|
|
175
|
+
sub_agents?: Record<string, SubAgentConfig>;
|
|
176
|
+
}
|
|
162
177
|
interface CreateFunctionInput {
|
|
163
178
|
id: string;
|
|
164
179
|
name: string;
|
|
@@ -169,7 +184,7 @@ interface CreateFunctionInput {
|
|
|
169
184
|
is_inline?: boolean;
|
|
170
185
|
system_prompt?: string;
|
|
171
186
|
tools_config?: string[];
|
|
172
|
-
agent_config?: Record<string, unknown>;
|
|
187
|
+
agent_config?: AgentConfig | Record<string, unknown>;
|
|
173
188
|
config?: Record<string, unknown>;
|
|
174
189
|
is_active?: boolean;
|
|
175
190
|
}
|
|
@@ -294,7 +309,7 @@ interface ApiKeysResponse {
|
|
|
294
309
|
interface ApiKeyFilters {
|
|
295
310
|
include_revoked: boolean;
|
|
296
311
|
}
|
|
297
|
-
type RunEventType = "step_started" | "step_completed" | "step_failed" | "thinking" | "thinking_chunk" | "tool_call_started" | "tool_call_completed" | "approval_required" | "approval_resolved" | "run_started" | "run_paused" | "run_resumed" | "run_completed" | "run_failed";
|
|
312
|
+
type RunEventType = "step_started" | "step_completed" | "step_failed" | "thinking" | "thinking_chunk" | "tool_call_started" | "tool_call_completed" | "approval_required" | "approval_resolved" | "sub_agent_started" | "sub_agent_completed" | "run_started" | "run_paused" | "run_resumed" | "run_completed" | "run_failed";
|
|
298
313
|
interface RunStreamEvent {
|
|
299
314
|
type: RunEventType;
|
|
300
315
|
data: Record<string, unknown>;
|
|
@@ -1082,4 +1097,4 @@ interface FlowForgeClient {
|
|
|
1082
1097
|
*/
|
|
1083
1098
|
declare function createClient(baseUrl: string, options?: ClientOptions): FlowForgeClient;
|
|
1084
1099
|
|
|
1085
|
-
export { type ApiKey, type ApiKeyCreated, type ApiKeyFilters, type ApiKeyType, ApiKeysResource, type ApiKeysResponse, type Approval, type ApprovalFilters, type ApprovalStatus, ApprovalsResource, type ClientOptions, type CreateApiKeyInput, type CreateCredentialInput, type CreateFunctionInput, type CreateToolInput, type CreateUserInput, type Credential, CredentialsResource, type CredentialsResponse, type Event, type EventFilters, EventsResource, type FlowForgeClient, FlowForgeError, type FlowForgeFunction, type FunctionFilters, FunctionsResource, HealthResource, type HealthStatus, type OrderDirection, QueryBuilder, type QueryParams, type Result, type Run, type RunEventType, type RunFilters, type RunStatus, RunStream, type RunStreamEvent, type RunWithSteps, RunsResource, type SendEventInput, type SendEventResponse, type Stats, type Step, type StepStatus, type StepType, type StreamConfig, type StreamOptions, type Tool, type ToolFilters, type ToolType, ToolsResource, type TriggerType, type UpdateCredentialInput, type UpdateFunctionInput, type UpdateToolInput, type UpdateUserInput, type User, type UserRole, UsersResource, type UsersResponse, createClient };
|
|
1100
|
+
export { type AgentConfig, type ApiKey, type ApiKeyCreated, type ApiKeyFilters, type ApiKeyType, ApiKeysResource, type ApiKeysResponse, type Approval, type ApprovalFilters, type ApprovalStatus, ApprovalsResource, type ClientOptions, type CreateApiKeyInput, type CreateCredentialInput, type CreateFunctionInput, type CreateToolInput, type CreateUserInput, type Credential, CredentialsResource, type CredentialsResponse, type Event, type EventFilters, EventsResource, type FlowForgeClient, FlowForgeError, type FlowForgeFunction, type FunctionFilters, FunctionsResource, HealthResource, type HealthStatus, type OrderDirection, QueryBuilder, type QueryParams, type Result, type Run, type RunEventType, type RunFilters, type RunStatus, RunStream, type RunStreamEvent, type RunWithSteps, RunsResource, type SendEventInput, type SendEventResponse, type Stats, type Step, type StepStatus, type StepType, type StreamConfig, type StreamOptions, type SubAgentConfig, type Tool, type ToolFilters, type ToolType, ToolsResource, type TriggerType, type UpdateCredentialInput, type UpdateFunctionInput, type UpdateToolInput, type UpdateUserInput, type User, type UserRole, UsersResource, type UsersResponse, createClient };
|
package/dist/index.js
CHANGED
|
@@ -1068,6 +1068,9 @@ function createClient(baseUrl, options = {}) {
|
|
|
1068
1068
|
};
|
|
1069
1069
|
return { data: null, error };
|
|
1070
1070
|
}
|
|
1071
|
+
if (response.status === 204) {
|
|
1072
|
+
return { data: { success: true, message: "Deleted" }, error: null };
|
|
1073
|
+
}
|
|
1071
1074
|
const data = await response.json();
|
|
1072
1075
|
return { data, error: null };
|
|
1073
1076
|
} catch (err) {
|
package/dist/index.mjs
CHANGED
|
@@ -1030,6 +1030,9 @@ function createClient(baseUrl, options = {}) {
|
|
|
1030
1030
|
};
|
|
1031
1031
|
return { data: null, error };
|
|
1032
1032
|
}
|
|
1033
|
+
if (response.status === 204) {
|
|
1034
|
+
return { data: { success: true, message: "Deleted" }, error: null };
|
|
1035
|
+
}
|
|
1033
1036
|
const data = await response.json();
|
|
1034
1037
|
return { data, error: null };
|
|
1035
1038
|
} catch (err) {
|