@modelrelay/sdk 1.10.3 → 1.14.0
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 +69 -74
- package/dist/index.cjs +1144 -4332
- package/dist/index.d.cts +775 -98
- package/dist/index.d.ts +775 -98
- package/dist/index.js +1072 -4275
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1766,25 +1766,25 @@ declare class ResponsesClient {
|
|
|
1766
1766
|
}
|
|
1767
1767
|
|
|
1768
1768
|
declare const runIdBrand: unique symbol;
|
|
1769
|
-
type RunId = string & {
|
|
1769
|
+
type RunId$1 = string & {
|
|
1770
1770
|
readonly [runIdBrand]: true;
|
|
1771
1771
|
};
|
|
1772
1772
|
declare const nodeIdBrand: unique symbol;
|
|
1773
|
-
type NodeId = string & {
|
|
1773
|
+
type NodeId$1 = string & {
|
|
1774
1774
|
readonly [nodeIdBrand]: true;
|
|
1775
1775
|
};
|
|
1776
1776
|
declare const planHashBrand: unique symbol;
|
|
1777
|
-
type PlanHash = string & {
|
|
1777
|
+
type PlanHash$1 = string & {
|
|
1778
1778
|
readonly [planHashBrand]: true;
|
|
1779
1779
|
};
|
|
1780
1780
|
declare const outputNameBrand: unique symbol;
|
|
1781
|
-
type OutputName = string & {
|
|
1781
|
+
type OutputName$1 = string & {
|
|
1782
1782
|
readonly [outputNameBrand]: true;
|
|
1783
1783
|
};
|
|
1784
|
-
declare function parseRunId(raw: string): RunId;
|
|
1785
|
-
declare function parseNodeId(raw: string): NodeId;
|
|
1786
|
-
declare function parsePlanHash(raw: string): PlanHash;
|
|
1787
|
-
declare function parseOutputName(raw: string): OutputName;
|
|
1784
|
+
declare function parseRunId(raw: string): RunId$1;
|
|
1785
|
+
declare function parseNodeId(raw: string): NodeId$1;
|
|
1786
|
+
declare function parsePlanHash(raw: string): PlanHash$1;
|
|
1787
|
+
declare function parseOutputName(raw: string): OutputName$1;
|
|
1788
1788
|
|
|
1789
1789
|
declare const WorkflowKinds: {
|
|
1790
1790
|
readonly WorkflowV0: "workflow.v0";
|
|
@@ -1809,52 +1809,52 @@ type WorkflowSpecV0 = {
|
|
|
1809
1809
|
outputs: ReadonlyArray<WorkflowOutputRefV0>;
|
|
1810
1810
|
};
|
|
1811
1811
|
type WorkflowNodeV0 = {
|
|
1812
|
-
id: NodeId;
|
|
1812
|
+
id: NodeId$1;
|
|
1813
1813
|
type: typeof WorkflowNodeTypes.LLMResponses;
|
|
1814
1814
|
input: {
|
|
1815
1815
|
request: WireResponsesRequest;
|
|
1816
1816
|
stream?: boolean;
|
|
1817
|
-
tool_execution?: ToolExecutionV0;
|
|
1817
|
+
tool_execution?: ToolExecutionV0$1;
|
|
1818
1818
|
tool_limits?: LLMResponsesToolLimitsV0;
|
|
1819
1819
|
bindings?: ReadonlyArray<LLMResponsesBindingV0>;
|
|
1820
1820
|
};
|
|
1821
1821
|
} | {
|
|
1822
|
-
id: NodeId;
|
|
1822
|
+
id: NodeId$1;
|
|
1823
1823
|
type: typeof WorkflowNodeTypes.JoinAll;
|
|
1824
1824
|
input?: Record<string, unknown>;
|
|
1825
1825
|
} | {
|
|
1826
|
-
id: NodeId;
|
|
1826
|
+
id: NodeId$1;
|
|
1827
1827
|
type: typeof WorkflowNodeTypes.TransformJSON;
|
|
1828
1828
|
input: {
|
|
1829
1829
|
object?: Record<string, {
|
|
1830
|
-
from: NodeId;
|
|
1830
|
+
from: NodeId$1;
|
|
1831
1831
|
pointer?: string;
|
|
1832
1832
|
}>;
|
|
1833
1833
|
merge?: Array<{
|
|
1834
|
-
from: NodeId;
|
|
1834
|
+
from: NodeId$1;
|
|
1835
1835
|
pointer?: string;
|
|
1836
1836
|
}>;
|
|
1837
1837
|
};
|
|
1838
1838
|
};
|
|
1839
1839
|
type WorkflowEdgeV0 = {
|
|
1840
|
-
from: NodeId;
|
|
1841
|
-
to: NodeId;
|
|
1840
|
+
from: NodeId$1;
|
|
1841
|
+
to: NodeId$1;
|
|
1842
1842
|
};
|
|
1843
1843
|
type WorkflowOutputRefV0 = {
|
|
1844
|
-
name: OutputName;
|
|
1845
|
-
from: NodeId;
|
|
1844
|
+
name: OutputName$1;
|
|
1845
|
+
from: NodeId$1;
|
|
1846
1846
|
pointer?: string;
|
|
1847
1847
|
};
|
|
1848
1848
|
type LLMResponsesBindingEncodingV0 = "json" | "json_string";
|
|
1849
1849
|
type LLMResponsesBindingV0 = {
|
|
1850
|
-
from: NodeId;
|
|
1850
|
+
from: NodeId$1;
|
|
1851
1851
|
pointer?: string;
|
|
1852
1852
|
to: string;
|
|
1853
1853
|
encoding?: LLMResponsesBindingEncodingV0;
|
|
1854
1854
|
};
|
|
1855
|
-
type ToolExecutionModeV0 = "server" | "client";
|
|
1856
|
-
type ToolExecutionV0 = {
|
|
1857
|
-
mode: ToolExecutionModeV0;
|
|
1855
|
+
type ToolExecutionModeV0$1 = "server" | "client";
|
|
1856
|
+
type ToolExecutionV0$1 = {
|
|
1857
|
+
mode: ToolExecutionModeV0$1;
|
|
1858
1858
|
};
|
|
1859
1859
|
type LLMResponsesToolLimitsV0 = {
|
|
1860
1860
|
max_llm_calls?: number;
|
|
@@ -1862,147 +1862,147 @@ type LLMResponsesToolLimitsV0 = {
|
|
|
1862
1862
|
wait_ttl_ms?: number;
|
|
1863
1863
|
};
|
|
1864
1864
|
type RunStatusV0 = "running" | "waiting" | "succeeded" | "failed" | "canceled";
|
|
1865
|
-
type PayloadInfoV0 = {
|
|
1865
|
+
type PayloadInfoV0$1 = {
|
|
1866
1866
|
bytes: number;
|
|
1867
1867
|
sha256: string;
|
|
1868
1868
|
included: boolean;
|
|
1869
1869
|
};
|
|
1870
1870
|
type RunEventTypeV0 = "run_compiled" | "run_started" | "run_completed" | "run_failed" | "run_canceled" | "node_llm_call" | "node_tool_call" | "node_tool_result" | "node_waiting" | "node_started" | "node_succeeded" | "node_failed" | "node_output_delta" | "node_output";
|
|
1871
|
-
type NodeErrorV0 = {
|
|
1871
|
+
type NodeErrorV0$1 = {
|
|
1872
1872
|
code?: string;
|
|
1873
1873
|
message: string;
|
|
1874
1874
|
};
|
|
1875
1875
|
/**
|
|
1876
1876
|
* Stream event kind from an LLM provider.
|
|
1877
1877
|
*/
|
|
1878
|
-
type StreamEventKind = string;
|
|
1879
|
-
type NodeOutputDeltaV0 = {
|
|
1880
|
-
kind: StreamEventKind;
|
|
1878
|
+
type StreamEventKind$1 = string;
|
|
1879
|
+
type NodeOutputDeltaV0$1 = {
|
|
1880
|
+
kind: StreamEventKind$1;
|
|
1881
1881
|
text_delta?: string;
|
|
1882
1882
|
response_id?: string;
|
|
1883
1883
|
model?: string;
|
|
1884
1884
|
};
|
|
1885
|
-
type TokenUsageV0 = {
|
|
1885
|
+
type TokenUsageV0$1 = {
|
|
1886
1886
|
input_tokens?: number;
|
|
1887
1887
|
output_tokens?: number;
|
|
1888
1888
|
total_tokens?: number;
|
|
1889
1889
|
};
|
|
1890
|
-
type NodeLLMCallV0 = {
|
|
1890
|
+
type NodeLLMCallV0$1 = {
|
|
1891
1891
|
step: number;
|
|
1892
1892
|
request_id: string;
|
|
1893
1893
|
provider?: string;
|
|
1894
1894
|
model?: string;
|
|
1895
1895
|
response_id?: string;
|
|
1896
1896
|
stop_reason?: string;
|
|
1897
|
-
usage?: TokenUsageV0;
|
|
1897
|
+
usage?: TokenUsageV0$1;
|
|
1898
1898
|
};
|
|
1899
|
-
type FunctionToolCallV0 = {
|
|
1899
|
+
type FunctionToolCallV0$1 = {
|
|
1900
1900
|
id: string;
|
|
1901
1901
|
name: string;
|
|
1902
1902
|
arguments: string;
|
|
1903
1903
|
};
|
|
1904
|
-
type NodeToolCallV0 = {
|
|
1904
|
+
type NodeToolCallV0$1 = {
|
|
1905
1905
|
step: number;
|
|
1906
1906
|
request_id: string;
|
|
1907
|
-
tool_call: FunctionToolCallV0;
|
|
1907
|
+
tool_call: FunctionToolCallV0$1;
|
|
1908
1908
|
};
|
|
1909
|
-
type NodeToolResultV0 = {
|
|
1909
|
+
type NodeToolResultV0$1 = {
|
|
1910
1910
|
step: number;
|
|
1911
1911
|
request_id: string;
|
|
1912
1912
|
tool_call_id: string;
|
|
1913
1913
|
name: string;
|
|
1914
1914
|
output: string;
|
|
1915
1915
|
};
|
|
1916
|
-
type PendingToolCallV0 = {
|
|
1916
|
+
type PendingToolCallV0$1 = {
|
|
1917
1917
|
tool_call_id: string;
|
|
1918
1918
|
name: string;
|
|
1919
1919
|
arguments: string;
|
|
1920
1920
|
};
|
|
1921
|
-
type NodeWaitingV0 = {
|
|
1921
|
+
type NodeWaitingV0$1 = {
|
|
1922
1922
|
step: number;
|
|
1923
1923
|
request_id: string;
|
|
1924
|
-
pending_tool_calls: PendingToolCallV0[];
|
|
1924
|
+
pending_tool_calls: PendingToolCallV0$1[];
|
|
1925
1925
|
reason: string;
|
|
1926
1926
|
};
|
|
1927
1927
|
type RunEventBaseV0 = {
|
|
1928
1928
|
envelope_version: "v0";
|
|
1929
|
-
run_id: RunId;
|
|
1929
|
+
run_id: RunId$1;
|
|
1930
1930
|
seq: number;
|
|
1931
1931
|
ts: string;
|
|
1932
1932
|
};
|
|
1933
1933
|
type RunEventRunCompiledV0 = RunEventBaseV0 & {
|
|
1934
1934
|
type: "run_compiled";
|
|
1935
|
-
plan_hash: PlanHash;
|
|
1935
|
+
plan_hash: PlanHash$1;
|
|
1936
1936
|
};
|
|
1937
1937
|
type RunEventRunStartedV0 = RunEventBaseV0 & {
|
|
1938
1938
|
type: "run_started";
|
|
1939
|
-
plan_hash: PlanHash;
|
|
1939
|
+
plan_hash: PlanHash$1;
|
|
1940
1940
|
};
|
|
1941
1941
|
type RunEventRunCompletedV0 = RunEventBaseV0 & {
|
|
1942
1942
|
type: "run_completed";
|
|
1943
|
-
plan_hash: PlanHash;
|
|
1943
|
+
plan_hash: PlanHash$1;
|
|
1944
1944
|
outputs_artifact_key: string;
|
|
1945
|
-
outputs_info: PayloadInfoV0;
|
|
1945
|
+
outputs_info: PayloadInfoV0$1;
|
|
1946
1946
|
};
|
|
1947
1947
|
type RunEventRunFailedV0 = RunEventBaseV0 & {
|
|
1948
1948
|
type: "run_failed";
|
|
1949
|
-
plan_hash: PlanHash;
|
|
1950
|
-
error: NodeErrorV0;
|
|
1949
|
+
plan_hash: PlanHash$1;
|
|
1950
|
+
error: NodeErrorV0$1;
|
|
1951
1951
|
};
|
|
1952
1952
|
type RunEventRunCanceledV0 = RunEventBaseV0 & {
|
|
1953
1953
|
type: "run_canceled";
|
|
1954
|
-
plan_hash: PlanHash;
|
|
1955
|
-
error: NodeErrorV0;
|
|
1954
|
+
plan_hash: PlanHash$1;
|
|
1955
|
+
error: NodeErrorV0$1;
|
|
1956
1956
|
};
|
|
1957
1957
|
type RunEventNodeStartedV0 = RunEventBaseV0 & {
|
|
1958
1958
|
type: "node_started";
|
|
1959
|
-
node_id: NodeId;
|
|
1959
|
+
node_id: NodeId$1;
|
|
1960
1960
|
};
|
|
1961
1961
|
type RunEventNodeSucceededV0 = RunEventBaseV0 & {
|
|
1962
1962
|
type: "node_succeeded";
|
|
1963
|
-
node_id: NodeId;
|
|
1963
|
+
node_id: NodeId$1;
|
|
1964
1964
|
};
|
|
1965
1965
|
type RunEventNodeFailedV0 = RunEventBaseV0 & {
|
|
1966
1966
|
type: "node_failed";
|
|
1967
|
-
node_id: NodeId;
|
|
1968
|
-
error: NodeErrorV0;
|
|
1967
|
+
node_id: NodeId$1;
|
|
1968
|
+
error: NodeErrorV0$1;
|
|
1969
1969
|
};
|
|
1970
1970
|
type RunEventNodeLLMCallV0 = RunEventBaseV0 & {
|
|
1971
1971
|
type: "node_llm_call";
|
|
1972
|
-
node_id: NodeId;
|
|
1973
|
-
llm_call: NodeLLMCallV0;
|
|
1972
|
+
node_id: NodeId$1;
|
|
1973
|
+
llm_call: NodeLLMCallV0$1;
|
|
1974
1974
|
};
|
|
1975
1975
|
type RunEventNodeToolCallV0 = RunEventBaseV0 & {
|
|
1976
1976
|
type: "node_tool_call";
|
|
1977
|
-
node_id: NodeId;
|
|
1978
|
-
tool_call: NodeToolCallV0;
|
|
1977
|
+
node_id: NodeId$1;
|
|
1978
|
+
tool_call: NodeToolCallV0$1;
|
|
1979
1979
|
};
|
|
1980
1980
|
type RunEventNodeToolResultV0 = RunEventBaseV0 & {
|
|
1981
1981
|
type: "node_tool_result";
|
|
1982
|
-
node_id: NodeId;
|
|
1983
|
-
tool_result: NodeToolResultV0;
|
|
1982
|
+
node_id: NodeId$1;
|
|
1983
|
+
tool_result: NodeToolResultV0$1;
|
|
1984
1984
|
};
|
|
1985
1985
|
type RunEventNodeWaitingV0 = RunEventBaseV0 & {
|
|
1986
1986
|
type: "node_waiting";
|
|
1987
|
-
node_id: NodeId;
|
|
1988
|
-
waiting: NodeWaitingV0;
|
|
1987
|
+
node_id: NodeId$1;
|
|
1988
|
+
waiting: NodeWaitingV0$1;
|
|
1989
1989
|
};
|
|
1990
1990
|
type RunEventNodeOutputDeltaV0 = RunEventBaseV0 & {
|
|
1991
1991
|
type: "node_output_delta";
|
|
1992
|
-
node_id: NodeId;
|
|
1993
|
-
delta: NodeOutputDeltaV0;
|
|
1992
|
+
node_id: NodeId$1;
|
|
1993
|
+
delta: NodeOutputDeltaV0$1;
|
|
1994
1994
|
};
|
|
1995
1995
|
type RunEventNodeOutputV0 = RunEventBaseV0 & {
|
|
1996
1996
|
type: "node_output";
|
|
1997
|
-
node_id: NodeId;
|
|
1997
|
+
node_id: NodeId$1;
|
|
1998
1998
|
artifact_key: string;
|
|
1999
|
-
output_info: PayloadInfoV0;
|
|
1999
|
+
output_info: PayloadInfoV0$1;
|
|
2000
2000
|
};
|
|
2001
2001
|
type RunEventV0 = RunEventRunCompiledV0 | RunEventRunStartedV0 | RunEventRunCompletedV0 | RunEventRunFailedV0 | RunEventRunCanceledV0 | RunEventNodeLLMCallV0 | RunEventNodeToolCallV0 | RunEventNodeToolResultV0 | RunEventNodeWaitingV0 | RunEventNodeStartedV0 | RunEventNodeSucceededV0 | RunEventNodeFailedV0 | RunEventNodeOutputDeltaV0 | RunEventNodeOutputV0;
|
|
2002
2002
|
|
|
2003
2003
|
type NodeStatusV0 = "pending" | "running" | "waiting" | "succeeded" | "failed" | "canceled";
|
|
2004
2004
|
type RunsToolResultsRequest = {
|
|
2005
|
-
node_id: NodeId;
|
|
2005
|
+
node_id: NodeId$1;
|
|
2006
2006
|
step: number;
|
|
2007
2007
|
request_id: string;
|
|
2008
2008
|
results: Array<{
|
|
@@ -2016,9 +2016,9 @@ type RunsToolResultsResponse = {
|
|
|
2016
2016
|
status: RunStatusV0;
|
|
2017
2017
|
};
|
|
2018
2018
|
type RunsPendingToolsResponse = {
|
|
2019
|
-
run_id: RunId;
|
|
2019
|
+
run_id: RunId$1;
|
|
2020
2020
|
pending: Array<{
|
|
2021
|
-
node_id: NodeId;
|
|
2021
|
+
node_id: NodeId$1;
|
|
2022
2022
|
step: number;
|
|
2023
2023
|
request_id: string;
|
|
2024
2024
|
tool_calls: Array<{
|
|
@@ -2029,14 +2029,14 @@ type RunsPendingToolsResponse = {
|
|
|
2029
2029
|
}>;
|
|
2030
2030
|
};
|
|
2031
2031
|
type RunsCreateResponse = {
|
|
2032
|
-
run_id: RunId;
|
|
2032
|
+
run_id: RunId$1;
|
|
2033
2033
|
status: RunStatusV0;
|
|
2034
|
-
plan_hash: PlanHash;
|
|
2034
|
+
plan_hash: PlanHash$1;
|
|
2035
2035
|
};
|
|
2036
2036
|
type RunsGetResponse = {
|
|
2037
|
-
run_id: RunId;
|
|
2037
|
+
run_id: RunId$1;
|
|
2038
2038
|
status: RunStatusV0;
|
|
2039
|
-
plan_hash: PlanHash;
|
|
2039
|
+
plan_hash: PlanHash$1;
|
|
2040
2040
|
cost_summary: RunCostSummaryV0;
|
|
2041
2041
|
nodes?: NodeResultV0[];
|
|
2042
2042
|
outputs?: Record<string, unknown>;
|
|
@@ -2054,7 +2054,7 @@ type RunCostLineItemV0 = {
|
|
|
2054
2054
|
usd_cents: number;
|
|
2055
2055
|
};
|
|
2056
2056
|
type NodeResultV0 = {
|
|
2057
|
-
id: NodeId;
|
|
2057
|
+
id: NodeId$1;
|
|
2058
2058
|
type: string;
|
|
2059
2059
|
status: NodeStatusV0;
|
|
2060
2060
|
started_at?: string;
|
|
@@ -2177,11 +2177,11 @@ declare class RunsClient {
|
|
|
2177
2177
|
metrics?: MetricsCallbacks;
|
|
2178
2178
|
trace?: TraceCallbacks;
|
|
2179
2179
|
}): Promise<unknown>;
|
|
2180
|
-
get(runId: RunId, options?: RunsGetOptions): Promise<RunsGetResponse>;
|
|
2181
|
-
events(runId: RunId, options?: RunsEventsOptions): Promise<RunsEventStream>;
|
|
2182
|
-
listEvents(runId: RunId, options?: Omit<RunsEventsOptions, "wait">): Promise<RunEventV0[]>;
|
|
2183
|
-
submitToolResults(runId: RunId, req: RunsToolResultsRequest, options?: RunsToolResultsOptions): Promise<RunsToolResultsResponse>;
|
|
2184
|
-
pendingTools(runId: RunId, options?: RunsPendingToolsOptions): Promise<RunsPendingToolsResponse>;
|
|
2180
|
+
get(runId: RunId$1, options?: RunsGetOptions): Promise<RunsGetResponse>;
|
|
2181
|
+
events(runId: RunId$1, options?: RunsEventsOptions): Promise<RunsEventStream>;
|
|
2182
|
+
listEvents(runId: RunId$1, options?: Omit<RunsEventsOptions, "wait">): Promise<RunEventV0[]>;
|
|
2183
|
+
submitToolResults(runId: RunId$1, req: RunsToolResultsRequest, options?: RunsToolResultsOptions): Promise<RunsToolResultsResponse>;
|
|
2184
|
+
pendingTools(runId: RunId$1, options?: RunsPendingToolsOptions): Promise<RunsPendingToolsResponse>;
|
|
2185
2185
|
}
|
|
2186
2186
|
|
|
2187
2187
|
/**
|
|
@@ -2385,7 +2385,7 @@ type WorkflowsCompileOptions = {
|
|
|
2385
2385
|
};
|
|
2386
2386
|
type WorkflowsCompileResponseV0 = {
|
|
2387
2387
|
plan_json: unknown;
|
|
2388
|
-
plan_hash: PlanHash;
|
|
2388
|
+
plan_hash: PlanHash$1;
|
|
2389
2389
|
};
|
|
2390
2390
|
type WorkflowsCompileV0Result = ({
|
|
2391
2391
|
ok: true;
|
|
@@ -3170,6 +3170,28 @@ interface paths {
|
|
|
3170
3170
|
patch?: never;
|
|
3171
3171
|
trace?: never;
|
|
3172
3172
|
};
|
|
3173
|
+
"/sessions/{session_id}/messages": {
|
|
3174
|
+
parameters: {
|
|
3175
|
+
query?: never;
|
|
3176
|
+
header?: never;
|
|
3177
|
+
path: {
|
|
3178
|
+
session_id: string;
|
|
3179
|
+
};
|
|
3180
|
+
cookie?: never;
|
|
3181
|
+
};
|
|
3182
|
+
get?: never;
|
|
3183
|
+
put?: never;
|
|
3184
|
+
/**
|
|
3185
|
+
* Append a session message
|
|
3186
|
+
* @description Appends a message to an existing session.
|
|
3187
|
+
*/
|
|
3188
|
+
post: operations["addSessionMessage"];
|
|
3189
|
+
delete?: never;
|
|
3190
|
+
options?: never;
|
|
3191
|
+
head?: never;
|
|
3192
|
+
patch?: never;
|
|
3193
|
+
trace?: never;
|
|
3194
|
+
};
|
|
3173
3195
|
}
|
|
3174
3196
|
type webhooks = Record<string, never>;
|
|
3175
3197
|
interface components {
|
|
@@ -4067,6 +4089,11 @@ interface components {
|
|
|
4067
4089
|
model?: string;
|
|
4068
4090
|
/** @description Text description of the image to generate */
|
|
4069
4091
|
prompt: string;
|
|
4092
|
+
/**
|
|
4093
|
+
* @description Number of images to generate (1-10, default 1)
|
|
4094
|
+
* @default 1
|
|
4095
|
+
*/
|
|
4096
|
+
n: number;
|
|
4070
4097
|
response_format?: components["schemas"]["ImageResponseFormat"];
|
|
4071
4098
|
};
|
|
4072
4099
|
/**
|
|
@@ -4192,6 +4219,20 @@ interface components {
|
|
|
4192
4219
|
/** @description Cursor for fetching the next page (if more results exist) */
|
|
4193
4220
|
next_cursor?: string;
|
|
4194
4221
|
};
|
|
4222
|
+
/** @description Request body for appending a message to a session. */
|
|
4223
|
+
SessionMessageCreateRequest: {
|
|
4224
|
+
/** @description Message role (user, assistant, tool) */
|
|
4225
|
+
role: string;
|
|
4226
|
+
/** @description Message content parts */
|
|
4227
|
+
content: {
|
|
4228
|
+
[key: string]: unknown;
|
|
4229
|
+
}[];
|
|
4230
|
+
/**
|
|
4231
|
+
* Format: uuid
|
|
4232
|
+
* @description Run ID that generated this message (for assistant messages)
|
|
4233
|
+
*/
|
|
4234
|
+
run_id?: string;
|
|
4235
|
+
};
|
|
4195
4236
|
};
|
|
4196
4237
|
responses: never;
|
|
4197
4238
|
parameters: {
|
|
@@ -5750,6 +5791,53 @@ interface operations {
|
|
|
5750
5791
|
};
|
|
5751
5792
|
};
|
|
5752
5793
|
};
|
|
5794
|
+
addSessionMessage: {
|
|
5795
|
+
parameters: {
|
|
5796
|
+
query?: never;
|
|
5797
|
+
header?: never;
|
|
5798
|
+
path: {
|
|
5799
|
+
session_id: string;
|
|
5800
|
+
};
|
|
5801
|
+
cookie?: never;
|
|
5802
|
+
};
|
|
5803
|
+
requestBody: {
|
|
5804
|
+
content: {
|
|
5805
|
+
"application/json": components["schemas"]["SessionMessageCreateRequest"];
|
|
5806
|
+
};
|
|
5807
|
+
};
|
|
5808
|
+
responses: {
|
|
5809
|
+
/** @description Message appended */
|
|
5810
|
+
201: {
|
|
5811
|
+
headers: {
|
|
5812
|
+
[name: string]: unknown;
|
|
5813
|
+
};
|
|
5814
|
+
content: {
|
|
5815
|
+
"application/json": components["schemas"]["SessionMessageResponse"];
|
|
5816
|
+
};
|
|
5817
|
+
};
|
|
5818
|
+
/** @description Invalid request */
|
|
5819
|
+
400: {
|
|
5820
|
+
headers: {
|
|
5821
|
+
[name: string]: unknown;
|
|
5822
|
+
};
|
|
5823
|
+
content?: never;
|
|
5824
|
+
};
|
|
5825
|
+
/** @description API key required */
|
|
5826
|
+
401: {
|
|
5827
|
+
headers: {
|
|
5828
|
+
[name: string]: unknown;
|
|
5829
|
+
};
|
|
5830
|
+
content?: never;
|
|
5831
|
+
};
|
|
5832
|
+
/** @description Session not found */
|
|
5833
|
+
404: {
|
|
5834
|
+
headers: {
|
|
5835
|
+
[name: string]: unknown;
|
|
5836
|
+
};
|
|
5837
|
+
content?: never;
|
|
5838
|
+
};
|
|
5839
|
+
};
|
|
5840
|
+
};
|
|
5753
5841
|
}
|
|
5754
5842
|
|
|
5755
5843
|
/**
|
|
@@ -6131,7 +6219,7 @@ interface SessionMessage extends InputItem {
|
|
|
6131
6219
|
/** When this message was added to the session. */
|
|
6132
6220
|
readonly createdAt: Date;
|
|
6133
6221
|
/** The run ID that produced this message (for assistant messages). */
|
|
6134
|
-
readonly runId?: RunId;
|
|
6222
|
+
readonly runId?: RunId$1;
|
|
6135
6223
|
}
|
|
6136
6224
|
/**
|
|
6137
6225
|
* Artifacts produced during a session (files, code, etc.).
|
|
@@ -6189,7 +6277,7 @@ interface SessionRunResult {
|
|
|
6189
6277
|
/** Error message (when status is 'error'). */
|
|
6190
6278
|
readonly error?: string;
|
|
6191
6279
|
/** The run ID from the server. */
|
|
6192
|
-
readonly runId: RunId;
|
|
6280
|
+
readonly runId: RunId$1;
|
|
6193
6281
|
/** Token and call usage. */
|
|
6194
6282
|
readonly usage: SessionUsageSummary;
|
|
6195
6283
|
/** All events from this run. */
|
|
@@ -6477,6 +6565,7 @@ declare class RemoteSession implements Session {
|
|
|
6477
6565
|
private nextSeq;
|
|
6478
6566
|
private createdAt;
|
|
6479
6567
|
private updatedAt;
|
|
6568
|
+
private pendingMessages;
|
|
6480
6569
|
private currentRunId?;
|
|
6481
6570
|
private currentNodeId?;
|
|
6482
6571
|
private currentWaiting?;
|
|
@@ -6551,6 +6640,8 @@ declare class RemoteSession implements Session {
|
|
|
6551
6640
|
private resetRunState;
|
|
6552
6641
|
private processRunEvents;
|
|
6553
6642
|
private executeToolsLocally;
|
|
6643
|
+
private flushPendingMessages;
|
|
6644
|
+
private appendMessageToServer;
|
|
6554
6645
|
}
|
|
6555
6646
|
|
|
6556
6647
|
/**
|
|
@@ -6816,11 +6907,19 @@ declare function runOAuthDeviceFlowForIDToken(cfg: {
|
|
|
6816
6907
|
signal?: AbortSignal;
|
|
6817
6908
|
}): Promise<string>;
|
|
6818
6909
|
|
|
6910
|
+
/**
|
|
6911
|
+
* Semantic JSON pointer constants for LLM responses nodes.
|
|
6912
|
+
* These eliminate magic strings and make bindings self-documenting.
|
|
6913
|
+
*/
|
|
6914
|
+
/** JSON pointer to extract text content from an LLM response output. */
|
|
6915
|
+
declare const LLM_TEXT_OUTPUT$1: "/output/0/content/0/text";
|
|
6916
|
+
/** JSON pointer to inject text into the user message of an LLM request. */
|
|
6917
|
+
declare const LLM_USER_MESSAGE_TEXT$1: "/request/input/1/content/0/text";
|
|
6819
6918
|
type TransformJSONValueV0 = {
|
|
6820
|
-
from: NodeId;
|
|
6919
|
+
from: NodeId$1;
|
|
6821
6920
|
pointer?: string;
|
|
6822
6921
|
};
|
|
6823
|
-
declare function transformJSONValue(from: NodeId, pointer?: string): TransformJSONValueV0;
|
|
6922
|
+
declare function transformJSONValue(from: NodeId$1, pointer?: string): TransformJSONValueV0;
|
|
6824
6923
|
declare function transformJSONObject(object: Record<string, TransformJSONValueV0>): {
|
|
6825
6924
|
object: Record<string, TransformJSONValueV0>;
|
|
6826
6925
|
};
|
|
@@ -6842,21 +6941,180 @@ declare class WorkflowBuilderV0 {
|
|
|
6842
6941
|
name(name: string): WorkflowBuilderV0;
|
|
6843
6942
|
execution(execution: WorkflowSpecV0["execution"]): WorkflowBuilderV0;
|
|
6844
6943
|
node(node: WorkflowNodeV0): WorkflowBuilderV0;
|
|
6845
|
-
llmResponses(id: NodeId, request: WireResponsesRequest | ResponsesRequest, options?: {
|
|
6944
|
+
llmResponses(id: NodeId$1, request: WireResponsesRequest | ResponsesRequest, options?: {
|
|
6846
6945
|
stream?: boolean;
|
|
6847
|
-
toolExecution?: ToolExecutionModeV0;
|
|
6946
|
+
toolExecution?: ToolExecutionModeV0$1;
|
|
6848
6947
|
toolLimits?: LLMResponsesToolLimitsV0;
|
|
6849
6948
|
bindings?: ReadonlyArray<LLMResponsesBindingV0>;
|
|
6850
6949
|
}): WorkflowBuilderV0;
|
|
6851
|
-
joinAll(id: NodeId): WorkflowBuilderV0;
|
|
6852
|
-
transformJSON(id: NodeId, input: Extract<WorkflowNodeV0, {
|
|
6950
|
+
joinAll(id: NodeId$1): WorkflowBuilderV0;
|
|
6951
|
+
transformJSON(id: NodeId$1, input: Extract<WorkflowNodeV0, {
|
|
6853
6952
|
type: typeof WorkflowNodeTypes.TransformJSON;
|
|
6854
6953
|
}>["input"]): WorkflowBuilderV0;
|
|
6855
|
-
edge(from: NodeId, to: NodeId): WorkflowBuilderV0;
|
|
6856
|
-
output(name: OutputName, from: NodeId, pointer?: string): WorkflowBuilderV0;
|
|
6954
|
+
edge(from: NodeId$1, to: NodeId$1): WorkflowBuilderV0;
|
|
6955
|
+
output(name: OutputName$1, from: NodeId$1, pointer?: string): WorkflowBuilderV0;
|
|
6857
6956
|
build(): WorkflowSpecV0;
|
|
6858
6957
|
}
|
|
6859
6958
|
declare function workflowV0(): WorkflowBuilderV0;
|
|
6959
|
+
type PendingLLMNode = {
|
|
6960
|
+
id: NodeId$1;
|
|
6961
|
+
request: WireResponsesRequest;
|
|
6962
|
+
stream?: boolean;
|
|
6963
|
+
bindings: LLMResponsesBindingV0[];
|
|
6964
|
+
toolExecution?: ToolExecutionModeV0$1;
|
|
6965
|
+
toolLimits?: LLMResponsesToolLimitsV0;
|
|
6966
|
+
};
|
|
6967
|
+
/**
|
|
6968
|
+
* Ergonomic workflow builder with auto-edge inference from bindings.
|
|
6969
|
+
*
|
|
6970
|
+
* @example
|
|
6971
|
+
* ```typescript
|
|
6972
|
+
* const spec = newWorkflow("tier_generation")
|
|
6973
|
+
* .addLLMNode("tier_generator", tierReq).stream(true)
|
|
6974
|
+
* .addLLMNode("business_summary", summaryReq)
|
|
6975
|
+
* .bindFrom("tier_generator", "/output/0/content/0/text")
|
|
6976
|
+
* .output("tiers", "tier_generator")
|
|
6977
|
+
* .output("summary", "business_summary")
|
|
6978
|
+
* .build();
|
|
6979
|
+
* ```
|
|
6980
|
+
*/
|
|
6981
|
+
declare class Workflow {
|
|
6982
|
+
private _name?;
|
|
6983
|
+
private _execution?;
|
|
6984
|
+
private readonly _nodes;
|
|
6985
|
+
private readonly _edges;
|
|
6986
|
+
private readonly _outputs;
|
|
6987
|
+
private _pendingNode;
|
|
6988
|
+
private constructor();
|
|
6989
|
+
/**
|
|
6990
|
+
* Create a new workflow builder with the given name.
|
|
6991
|
+
*/
|
|
6992
|
+
static create(name?: string): Workflow;
|
|
6993
|
+
/**
|
|
6994
|
+
* Set the workflow execution configuration.
|
|
6995
|
+
*/
|
|
6996
|
+
execution(exec: WorkflowSpecV0["execution"]): Workflow;
|
|
6997
|
+
/**
|
|
6998
|
+
* Add an LLM responses node and return a node builder for configuration.
|
|
6999
|
+
*/
|
|
7000
|
+
addLLMNode(id: NodeId$1, request: WireResponsesRequest | ResponsesRequest): LLMNodeBuilder;
|
|
7001
|
+
/**
|
|
7002
|
+
* Add a join.all node that waits for all incoming edges.
|
|
7003
|
+
*/
|
|
7004
|
+
addJoinAllNode(id: NodeId$1): Workflow;
|
|
7005
|
+
/**
|
|
7006
|
+
* Add a transform.json node and return a builder for configuration.
|
|
7007
|
+
*/
|
|
7008
|
+
addTransformJSONNode(id: NodeId$1): TransformJSONNodeBuilder;
|
|
7009
|
+
/**
|
|
7010
|
+
* Add an output reference extracting the full node output.
|
|
7011
|
+
*/
|
|
7012
|
+
output(name: OutputName$1, from: NodeId$1, pointer?: string): Workflow;
|
|
7013
|
+
/**
|
|
7014
|
+
* Add an output reference extracting text content from an LLM response.
|
|
7015
|
+
* This is a convenience method that uses the LLM_TEXT_OUTPUT pointer.
|
|
7016
|
+
*/
|
|
7017
|
+
outputText(name: OutputName$1, from: NodeId$1): Workflow;
|
|
7018
|
+
/**
|
|
7019
|
+
* Explicitly add an edge between nodes.
|
|
7020
|
+
* Note: edges are automatically inferred from bindings, so this is rarely needed.
|
|
7021
|
+
*/
|
|
7022
|
+
edge(from: NodeId$1, to: NodeId$1): Workflow;
|
|
7023
|
+
/**
|
|
7024
|
+
* Build the workflow specification.
|
|
7025
|
+
*/
|
|
7026
|
+
build(): WorkflowSpecV0;
|
|
7027
|
+
/** @internal */
|
|
7028
|
+
_getPendingNode(): PendingLLMNode | null;
|
|
7029
|
+
/** @internal */
|
|
7030
|
+
_addEdge(from: NodeId$1, to: NodeId$1): void;
|
|
7031
|
+
/** @internal */
|
|
7032
|
+
_addNode(node: WorkflowNodeV0): void;
|
|
7033
|
+
private flushPendingNode;
|
|
7034
|
+
}
|
|
7035
|
+
/**
|
|
7036
|
+
* Builder for configuring an LLM responses node.
|
|
7037
|
+
*/
|
|
7038
|
+
declare class LLMNodeBuilder {
|
|
7039
|
+
private readonly workflow;
|
|
7040
|
+
constructor(workflow: Workflow);
|
|
7041
|
+
/**
|
|
7042
|
+
* Enable or disable streaming for this node.
|
|
7043
|
+
*/
|
|
7044
|
+
stream(enabled: boolean): LLMNodeBuilder;
|
|
7045
|
+
/**
|
|
7046
|
+
* Add a binding from another LLM node's text output to this node's user message.
|
|
7047
|
+
* This is the most common binding pattern: LLM text → user message with json_string encoding.
|
|
7048
|
+
* The edge from the source node is automatically inferred.
|
|
7049
|
+
*/
|
|
7050
|
+
bindTextFrom(from: NodeId$1): LLMNodeBuilder;
|
|
7051
|
+
/**
|
|
7052
|
+
* Add a binding from another node's output to this node's user message text.
|
|
7053
|
+
* Use bindTextFrom for the common case of binding LLM text output.
|
|
7054
|
+
* The edge from the source node is automatically inferred.
|
|
7055
|
+
*/
|
|
7056
|
+
bindFrom(from: NodeId$1, pointer?: string): LLMNodeBuilder;
|
|
7057
|
+
/**
|
|
7058
|
+
* Add a full binding with explicit source/destination pointers and encoding.
|
|
7059
|
+
* The edge from the source node is automatically inferred.
|
|
7060
|
+
*/
|
|
7061
|
+
bindFromTo(from: NodeId$1, fromPointer: string | undefined, toPointer: string, encoding?: LLMResponsesBindingEncodingV0): LLMNodeBuilder;
|
|
7062
|
+
/**
|
|
7063
|
+
* Set the tool execution mode (server or client).
|
|
7064
|
+
*/
|
|
7065
|
+
toolExecution(mode: ToolExecutionModeV0$1): LLMNodeBuilder;
|
|
7066
|
+
/**
|
|
7067
|
+
* Set the tool execution limits.
|
|
7068
|
+
*/
|
|
7069
|
+
toolLimits(limits: LLMResponsesToolLimitsV0): LLMNodeBuilder;
|
|
7070
|
+
addLLMNode(id: NodeId$1, request: WireResponsesRequest | ResponsesRequest): LLMNodeBuilder;
|
|
7071
|
+
addJoinAllNode(id: NodeId$1): Workflow;
|
|
7072
|
+
addTransformJSONNode(id: NodeId$1): TransformJSONNodeBuilder;
|
|
7073
|
+
edge(from: NodeId$1, to: NodeId$1): Workflow;
|
|
7074
|
+
output(name: OutputName$1, from: NodeId$1, pointer?: string): Workflow;
|
|
7075
|
+
outputText(name: OutputName$1, from: NodeId$1): Workflow;
|
|
7076
|
+
execution(exec: WorkflowSpecV0["execution"]): Workflow;
|
|
7077
|
+
build(): WorkflowSpecV0;
|
|
7078
|
+
}
|
|
7079
|
+
/**
|
|
7080
|
+
* Builder for configuring a transform.json node.
|
|
7081
|
+
*/
|
|
7082
|
+
declare class TransformJSONNodeBuilder {
|
|
7083
|
+
private readonly workflow;
|
|
7084
|
+
private readonly id;
|
|
7085
|
+
private _object?;
|
|
7086
|
+
private _merge?;
|
|
7087
|
+
constructor(workflow: Workflow, id: NodeId$1);
|
|
7088
|
+
/**
|
|
7089
|
+
* Set the object transformation with field mappings.
|
|
7090
|
+
*/
|
|
7091
|
+
object(fields: Record<string, TransformJSONValueV0>): TransformJSONNodeBuilder;
|
|
7092
|
+
/**
|
|
7093
|
+
* Set the merge transformation with source references.
|
|
7094
|
+
*/
|
|
7095
|
+
merge(items: TransformJSONValueV0[]): TransformJSONNodeBuilder;
|
|
7096
|
+
private finalize;
|
|
7097
|
+
addLLMNode(id: NodeId$1, request: WireResponsesRequest | ResponsesRequest): LLMNodeBuilder;
|
|
7098
|
+
addJoinAllNode(id: NodeId$1): Workflow;
|
|
7099
|
+
edge(from: NodeId$1, to: NodeId$1): Workflow;
|
|
7100
|
+
output(name: OutputName$1, from: NodeId$1, pointer?: string): Workflow;
|
|
7101
|
+
execution(exec: WorkflowSpecV0["execution"]): Workflow;
|
|
7102
|
+
build(): WorkflowSpecV0;
|
|
7103
|
+
}
|
|
7104
|
+
/**
|
|
7105
|
+
* Create a new ergonomic workflow builder with the given name.
|
|
7106
|
+
*
|
|
7107
|
+
* @example
|
|
7108
|
+
* ```typescript
|
|
7109
|
+
* const spec = newWorkflow("my_workflow")
|
|
7110
|
+
* .addLLMNode("generator", request).stream(true)
|
|
7111
|
+
* .addLLMNode("summarizer", summaryReq)
|
|
7112
|
+
* .bindFrom("generator", "/output/0/content/0/text")
|
|
7113
|
+
* .output("result", "summarizer")
|
|
7114
|
+
* .build();
|
|
7115
|
+
* ```
|
|
7116
|
+
*/
|
|
7117
|
+
declare function newWorkflow(name?: string): Workflow;
|
|
6860
7118
|
|
|
6861
7119
|
var $id = "https://modelrelay.ai/schemas/workflow_v0.schema.json";
|
|
6862
7120
|
var $schema = "http://json-schema.org/draft-07/schema#";
|
|
@@ -7185,6 +7443,288 @@ var workflow_v0_schema = {
|
|
|
7185
7443
|
declare const WORKFLOWS_COMPILE_PATH = "/workflows/compile";
|
|
7186
7444
|
type WorkflowsCompileRequestV0 = WorkflowSpecV0;
|
|
7187
7445
|
|
|
7446
|
+
/**
|
|
7447
|
+
* High-level workflow pattern helpers for common workflow structures.
|
|
7448
|
+
*
|
|
7449
|
+
* These helpers reduce boilerplate for common patterns like sequential chains,
|
|
7450
|
+
* parallel execution with aggregation, and map-reduce processing.
|
|
7451
|
+
*
|
|
7452
|
+
* All builders are immutable - each method returns a new builder instance.
|
|
7453
|
+
*
|
|
7454
|
+
* @example
|
|
7455
|
+
* ```typescript
|
|
7456
|
+
* import { Chain, Parallel, MapReduce, LLMStep, MapItem } from 'modelrelay';
|
|
7457
|
+
*
|
|
7458
|
+
* // Chain pattern - sequential steps
|
|
7459
|
+
* const chainSpec = Chain('summarize-translate', [
|
|
7460
|
+
* LLMStep('summarize', summarizeReq),
|
|
7461
|
+
* LLMStep('translate', translateReq).withStream(),
|
|
7462
|
+
* ])
|
|
7463
|
+
* .outputLast('result')
|
|
7464
|
+
* .build();
|
|
7465
|
+
*
|
|
7466
|
+
* // Parallel pattern - concurrent steps with aggregation
|
|
7467
|
+
* const parallelSpec = Parallel('multi-model', [
|
|
7468
|
+
* LLMStep('gpt4', gpt4Req),
|
|
7469
|
+
* LLMStep('claude', claudeReq),
|
|
7470
|
+
* ])
|
|
7471
|
+
* .aggregate('synthesize', synthesizeReq)
|
|
7472
|
+
* .output('result', 'synthesize')
|
|
7473
|
+
* .build();
|
|
7474
|
+
*
|
|
7475
|
+
* // MapReduce pattern - parallel mappers with reducer
|
|
7476
|
+
* const mapReduceSpec = MapReduce('process-docs', [
|
|
7477
|
+
* MapItem('doc1', doc1Req),
|
|
7478
|
+
* MapItem('doc2', doc2Req),
|
|
7479
|
+
* ])
|
|
7480
|
+
* .reduce('combine', combineReq)
|
|
7481
|
+
* .output('result', 'combine')
|
|
7482
|
+
* .build();
|
|
7483
|
+
* ```
|
|
7484
|
+
*/
|
|
7485
|
+
|
|
7486
|
+
/**
|
|
7487
|
+
* Configuration for an LLM step in a workflow pattern.
|
|
7488
|
+
*/
|
|
7489
|
+
type LLMStepConfig = {
|
|
7490
|
+
readonly id: NodeId$1;
|
|
7491
|
+
readonly request: WireResponsesRequest;
|
|
7492
|
+
readonly stream: boolean;
|
|
7493
|
+
};
|
|
7494
|
+
/**
|
|
7495
|
+
* Creates an LLM step configuration for use with Chain or Parallel patterns.
|
|
7496
|
+
*
|
|
7497
|
+
* @param id - Unique node identifier
|
|
7498
|
+
* @param request - The LLM request configuration
|
|
7499
|
+
* @returns A step configuration object with fluent methods
|
|
7500
|
+
*
|
|
7501
|
+
* @example
|
|
7502
|
+
* ```typescript
|
|
7503
|
+
* const step = LLMStep('summarize', {
|
|
7504
|
+
* model: 'claude-sonnet-4-20250514',
|
|
7505
|
+
* input: [{ type: 'message', role: 'user', content: [{ type: 'text', text: 'Summarize...' }] }],
|
|
7506
|
+
* });
|
|
7507
|
+
*
|
|
7508
|
+
* // Enable streaming
|
|
7509
|
+
* const streamingStep = step.withStream();
|
|
7510
|
+
* ```
|
|
7511
|
+
*/
|
|
7512
|
+
declare function LLMStep(id: NodeId$1 | string, request: WireResponsesRequest | ResponsesRequest): LLMStepConfig & {
|
|
7513
|
+
withStream(): LLMStepConfig;
|
|
7514
|
+
};
|
|
7515
|
+
/**
|
|
7516
|
+
* Immutable builder for sequential workflow where each step's output feeds into the next.
|
|
7517
|
+
*/
|
|
7518
|
+
declare class ChainBuilder {
|
|
7519
|
+
private readonly state;
|
|
7520
|
+
private constructor();
|
|
7521
|
+
static create(name: string, steps: readonly LLMStepConfig[]): ChainBuilder;
|
|
7522
|
+
private with;
|
|
7523
|
+
/**
|
|
7524
|
+
* Sets the workflow execution configuration.
|
|
7525
|
+
*/
|
|
7526
|
+
execution(exec: WorkflowSpecV0["execution"]): ChainBuilder;
|
|
7527
|
+
/**
|
|
7528
|
+
* Adds an output reference from a specific step.
|
|
7529
|
+
*/
|
|
7530
|
+
output(name: OutputName$1 | string, from: NodeId$1 | string): ChainBuilder;
|
|
7531
|
+
/**
|
|
7532
|
+
* Adds an output reference from the last step.
|
|
7533
|
+
*/
|
|
7534
|
+
outputLast(name: OutputName$1 | string): ChainBuilder;
|
|
7535
|
+
/**
|
|
7536
|
+
* Builds and returns the compiled workflow spec.
|
|
7537
|
+
* @throws Error if no steps are provided
|
|
7538
|
+
*/
|
|
7539
|
+
build(): WorkflowSpecV0;
|
|
7540
|
+
}
|
|
7541
|
+
/**
|
|
7542
|
+
* Creates a workflow builder for sequential LLM steps.
|
|
7543
|
+
* Each step after the first automatically binds its input from the previous step's text output.
|
|
7544
|
+
*
|
|
7545
|
+
* @param name - Workflow name
|
|
7546
|
+
* @param steps - Array of LLMStep configurations
|
|
7547
|
+
* @returns A ChainBuilder for further configuration
|
|
7548
|
+
*
|
|
7549
|
+
* @example
|
|
7550
|
+
* ```typescript
|
|
7551
|
+
* const spec = Chain('summarize-translate', [
|
|
7552
|
+
* LLMStep('summarize', summarizeReq),
|
|
7553
|
+
* LLMStep('translate', translateReq).withStream(),
|
|
7554
|
+
* LLMStep('format', formatReq),
|
|
7555
|
+
* ])
|
|
7556
|
+
* .outputLast('result')
|
|
7557
|
+
* .build();
|
|
7558
|
+
* ```
|
|
7559
|
+
*/
|
|
7560
|
+
declare function Chain(name: string, steps: readonly LLMStepConfig[]): ChainBuilder;
|
|
7561
|
+
/**
|
|
7562
|
+
* Immutable builder for workflow where multiple LLM steps execute in parallel,
|
|
7563
|
+
* with optional aggregation.
|
|
7564
|
+
*/
|
|
7565
|
+
declare class ParallelBuilder {
|
|
7566
|
+
private readonly state;
|
|
7567
|
+
private constructor();
|
|
7568
|
+
static create(name: string, steps: readonly LLMStepConfig[]): ParallelBuilder;
|
|
7569
|
+
private with;
|
|
7570
|
+
/**
|
|
7571
|
+
* Sets the workflow execution configuration.
|
|
7572
|
+
*/
|
|
7573
|
+
execution(exec: WorkflowSpecV0["execution"]): ParallelBuilder;
|
|
7574
|
+
/**
|
|
7575
|
+
* Adds a join node that waits for all parallel steps,
|
|
7576
|
+
* followed by an aggregator LLM node that receives the combined output.
|
|
7577
|
+
* The join node ID is automatically generated as "<id>_join".
|
|
7578
|
+
*/
|
|
7579
|
+
aggregate(id: NodeId$1 | string, request: WireResponsesRequest | ResponsesRequest): ParallelBuilder;
|
|
7580
|
+
/**
|
|
7581
|
+
* Like aggregate() but enables streaming on the aggregator node.
|
|
7582
|
+
*/
|
|
7583
|
+
aggregateWithStream(id: NodeId$1 | string, request: WireResponsesRequest | ResponsesRequest): ParallelBuilder;
|
|
7584
|
+
/**
|
|
7585
|
+
* Adds an output reference from a specific step.
|
|
7586
|
+
*/
|
|
7587
|
+
output(name: OutputName$1 | string, from: NodeId$1 | string): ParallelBuilder;
|
|
7588
|
+
/**
|
|
7589
|
+
* Builds and returns the compiled workflow spec.
|
|
7590
|
+
* @throws Error if no steps are provided
|
|
7591
|
+
*/
|
|
7592
|
+
build(): WorkflowSpecV0;
|
|
7593
|
+
}
|
|
7594
|
+
/**
|
|
7595
|
+
* Creates a workflow builder for parallel LLM steps.
|
|
7596
|
+
* All steps execute concurrently with no dependencies between them.
|
|
7597
|
+
*
|
|
7598
|
+
* @param name - Workflow name
|
|
7599
|
+
* @param steps - Array of LLMStep configurations
|
|
7600
|
+
* @returns A ParallelBuilder for further configuration
|
|
7601
|
+
*
|
|
7602
|
+
* @example
|
|
7603
|
+
* ```typescript
|
|
7604
|
+
* // Without aggregation - just parallel execution
|
|
7605
|
+
* const spec = Parallel('multi-model', [
|
|
7606
|
+
* LLMStep('gpt4', gpt4Req),
|
|
7607
|
+
* LLMStep('claude', claudeReq),
|
|
7608
|
+
* ])
|
|
7609
|
+
* .output('gpt4_result', 'gpt4')
|
|
7610
|
+
* .output('claude_result', 'claude')
|
|
7611
|
+
* .build();
|
|
7612
|
+
*
|
|
7613
|
+
* // With aggregation - parallel then combine
|
|
7614
|
+
* const spec = Parallel('multi-model', [
|
|
7615
|
+
* LLMStep('gpt4', gpt4Req),
|
|
7616
|
+
* LLMStep('claude', claudeReq),
|
|
7617
|
+
* ])
|
|
7618
|
+
* .aggregate('synthesize', synthesizeReq)
|
|
7619
|
+
* .output('result', 'synthesize')
|
|
7620
|
+
* .build();
|
|
7621
|
+
* ```
|
|
7622
|
+
*/
|
|
7623
|
+
declare function Parallel(name: string, steps: readonly LLMStepConfig[]): ParallelBuilder;
|
|
7624
|
+
/**
|
|
7625
|
+
* Configuration for a map item in MapReduce.
|
|
7626
|
+
*/
|
|
7627
|
+
type MapItemConfig = {
|
|
7628
|
+
readonly id: string;
|
|
7629
|
+
readonly request: WireResponsesRequest;
|
|
7630
|
+
readonly stream: boolean;
|
|
7631
|
+
};
|
|
7632
|
+
/**
|
|
7633
|
+
* Creates a map item configuration for use with MapReduce pattern.
|
|
7634
|
+
* Each item becomes a separate mapper node that runs in parallel.
|
|
7635
|
+
*
|
|
7636
|
+
* @param id - Unique identifier for this item (becomes part of node ID: "map_<id>")
|
|
7637
|
+
* @param request - The LLM request for processing this item
|
|
7638
|
+
* @returns A map item configuration object with fluent methods
|
|
7639
|
+
*
|
|
7640
|
+
* @example
|
|
7641
|
+
* ```typescript
|
|
7642
|
+
* const item = MapItem('doc1', {
|
|
7643
|
+
* model: 'claude-sonnet-4-20250514',
|
|
7644
|
+
* input: [{ type: 'message', role: 'user', content: [{ type: 'text', text: 'Summarize doc1...' }] }],
|
|
7645
|
+
* });
|
|
7646
|
+
*
|
|
7647
|
+
* // Enable streaming
|
|
7648
|
+
* const streamingItem = item.withStream();
|
|
7649
|
+
* ```
|
|
7650
|
+
*/
|
|
7651
|
+
declare function MapItem(id: string, request: WireResponsesRequest | ResponsesRequest): MapItemConfig & {
|
|
7652
|
+
withStream(): MapItemConfig;
|
|
7653
|
+
};
|
|
7654
|
+
/**
|
|
7655
|
+
* Immutable builder for workflow where items are processed in parallel by mapper nodes,
|
|
7656
|
+
* then combined by a reducer node.
|
|
7657
|
+
*
|
|
7658
|
+
* The pattern creates:
|
|
7659
|
+
* - N mapper nodes (one per item), running in parallel
|
|
7660
|
+
* - A join.all node to collect all mapper outputs
|
|
7661
|
+
* - A reducer LLM node that receives the combined outputs
|
|
7662
|
+
*
|
|
7663
|
+
* Note: Items must be known at workflow build time. For dynamic array
|
|
7664
|
+
* processing at runtime, server-side support for dynamic node instantiation
|
|
7665
|
+
* would be required.
|
|
7666
|
+
*/
|
|
7667
|
+
declare class MapReduceBuilder {
|
|
7668
|
+
private readonly state;
|
|
7669
|
+
private constructor();
|
|
7670
|
+
static create(name: string, items: readonly MapItemConfig[]): MapReduceBuilder;
|
|
7671
|
+
private with;
|
|
7672
|
+
/**
|
|
7673
|
+
* Adds a mapper item to the workflow.
|
|
7674
|
+
* Each item becomes a separate LLM node that runs in parallel.
|
|
7675
|
+
*/
|
|
7676
|
+
item(id: NodeId$1 | string, request: WireResponsesRequest | ResponsesRequest): MapReduceBuilder;
|
|
7677
|
+
/**
|
|
7678
|
+
* Adds a mapper item with streaming enabled.
|
|
7679
|
+
*/
|
|
7680
|
+
itemWithStream(id: NodeId$1 | string, request: WireResponsesRequest | ResponsesRequest): MapReduceBuilder;
|
|
7681
|
+
/**
|
|
7682
|
+
* Sets the workflow execution configuration.
|
|
7683
|
+
*/
|
|
7684
|
+
execution(exec: WorkflowSpecV0["execution"]): MapReduceBuilder;
|
|
7685
|
+
/**
|
|
7686
|
+
* Adds a reducer node that receives all mapper outputs.
|
|
7687
|
+
* The reducer receives a JSON object mapping each mapper ID to its text output.
|
|
7688
|
+
* The join node ID is automatically generated as "<id>_join".
|
|
7689
|
+
*/
|
|
7690
|
+
reduce(id: NodeId$1 | string, request: WireResponsesRequest | ResponsesRequest): MapReduceBuilder;
|
|
7691
|
+
/**
|
|
7692
|
+
* Like reduce() but enables streaming on the reducer node.
|
|
7693
|
+
*/
|
|
7694
|
+
reduceWithStream(id: NodeId$1 | string, request: WireResponsesRequest | ResponsesRequest): MapReduceBuilder;
|
|
7695
|
+
/**
|
|
7696
|
+
* Adds an output reference from a specific node.
|
|
7697
|
+
* Typically used to output from the reducer node.
|
|
7698
|
+
*/
|
|
7699
|
+
output(name: OutputName$1 | string, from: NodeId$1 | string): MapReduceBuilder;
|
|
7700
|
+
/**
|
|
7701
|
+
* Builds and returns the compiled workflow spec.
|
|
7702
|
+
* @throws Error if no items are provided or no reducer is configured
|
|
7703
|
+
*/
|
|
7704
|
+
build(): WorkflowSpecV0;
|
|
7705
|
+
}
|
|
7706
|
+
/**
|
|
7707
|
+
* Creates a workflow builder for parallel map-reduce processing.
|
|
7708
|
+
* Each item is processed by a separate mapper node, and results are combined
|
|
7709
|
+
* by a reducer node.
|
|
7710
|
+
*
|
|
7711
|
+
* @param name - Workflow name
|
|
7712
|
+
* @param items - Optional array of MapItem configurations (can also use .item() builder)
|
|
7713
|
+
* @returns A MapReduceBuilder for further configuration
|
|
7714
|
+
*
|
|
7715
|
+
* @example
|
|
7716
|
+
* ```typescript
|
|
7717
|
+
* // Fluent builder pattern (preferred)
|
|
7718
|
+
* const spec = mapReduce('summarize-docs')
|
|
7719
|
+
* .item('doc1', doc1Req)
|
|
7720
|
+
* .item('doc2', doc2Req)
|
|
7721
|
+
* .reduce('combine', combineReq)
|
|
7722
|
+
* .output(parseOutputName('result'), 'combine')
|
|
7723
|
+
* .build();
|
|
7724
|
+
* ```
|
|
7725
|
+
*/
|
|
7726
|
+
declare function MapReduce(name: string, items?: readonly MapItemConfig[]): MapReduceBuilder;
|
|
7727
|
+
|
|
7188
7728
|
declare function parseApiKey(raw: string): ApiKey;
|
|
7189
7729
|
declare function parsePublishableKey(raw: string): PublishableKey;
|
|
7190
7730
|
declare function parseSecretKey(raw: string): SecretKey;
|
|
@@ -7554,13 +8094,13 @@ interface ToolRunnerOptions {
|
|
|
7554
8094
|
/** Customer ID for attributed requests (optional). */
|
|
7555
8095
|
customerId?: string;
|
|
7556
8096
|
/** Called before executing each tool call (optional). */
|
|
7557
|
-
onBeforeExecute?: (pending: PendingToolCallV0) => void | Promise<void>;
|
|
8097
|
+
onBeforeExecute?: (pending: PendingToolCallV0$1) => void | Promise<void>;
|
|
7558
8098
|
/** Called after each tool execution (optional). */
|
|
7559
8099
|
onAfterExecute?: (result: ToolExecutionResult) => void | Promise<void>;
|
|
7560
8100
|
/** Called when results are successfully submitted (optional). */
|
|
7561
|
-
onSubmitted?: (runId: RunId, count: number, status: RunStatusV0) => void | Promise<void>;
|
|
8101
|
+
onSubmitted?: (runId: RunId$1, count: number, status: RunStatusV0) => void | Promise<void>;
|
|
7562
8102
|
/** Called when an error occurs during execution (optional). */
|
|
7563
|
-
onError?: (error: Error, pending?: PendingToolCallV0) => void | Promise<void>;
|
|
8103
|
+
onError?: (error: Error, pending?: PendingToolCallV0$1) => void | Promise<void>;
|
|
7564
8104
|
}
|
|
7565
8105
|
/** Response from handling a node_waiting event. */
|
|
7566
8106
|
interface HandleWaitingResult {
|
|
@@ -7628,7 +8168,7 @@ declare class ToolRunner {
|
|
|
7628
8168
|
* }
|
|
7629
8169
|
* ```
|
|
7630
8170
|
*/
|
|
7631
|
-
handleNodeWaiting(runId: RunId, nodeId: NodeId, waiting: NodeWaitingV0): Promise<HandleWaitingResult>;
|
|
8171
|
+
handleNodeWaiting(runId: RunId$1, nodeId: NodeId$1, waiting: NodeWaitingV0$1): Promise<HandleWaitingResult>;
|
|
7632
8172
|
/**
|
|
7633
8173
|
* Processes a stream of run events, automatically handling node_waiting events.
|
|
7634
8174
|
*
|
|
@@ -7659,7 +8199,7 @@ declare class ToolRunner {
|
|
|
7659
8199
|
* }
|
|
7660
8200
|
* ```
|
|
7661
8201
|
*/
|
|
7662
|
-
processEvents(runId: RunId, events: AsyncIterable<RunEventV0>): AsyncGenerator<RunEventV0, void, undefined>;
|
|
8202
|
+
processEvents(runId: RunId$1, events: AsyncIterable<RunEventV0>): AsyncGenerator<RunEventV0, void, undefined>;
|
|
7663
8203
|
/**
|
|
7664
8204
|
* Checks if a run event is a node_waiting event.
|
|
7665
8205
|
* Utility for filtering events when not using processEvents().
|
|
@@ -7686,13 +8226,150 @@ declare class ToolRunner {
|
|
|
7686
8226
|
*/
|
|
7687
8227
|
declare function createToolRunner(options: ToolRunnerOptions): ToolRunner;
|
|
7688
8228
|
|
|
7689
|
-
type
|
|
7690
|
-
type
|
|
7691
|
-
type
|
|
7692
|
-
type
|
|
7693
|
-
type
|
|
8229
|
+
type index$1_$defs = $defs;
|
|
8230
|
+
type index$1_components = components;
|
|
8231
|
+
type index$1_operations = operations;
|
|
8232
|
+
type index$1_paths = paths;
|
|
8233
|
+
type index$1_webhooks = webhooks;
|
|
8234
|
+
declare namespace index$1 {
|
|
8235
|
+
export type { index$1_$defs as $defs, index$1_components as components, index$1_operations as operations, index$1_paths as paths, index$1_webhooks as webhooks };
|
|
8236
|
+
}
|
|
8237
|
+
|
|
8238
|
+
/**
|
|
8239
|
+
* Workflow types with clean naming (no Workflow prefix).
|
|
8240
|
+
*
|
|
8241
|
+
* @example
|
|
8242
|
+
* ```typescript
|
|
8243
|
+
* import { workflow } from "@modelrelay/sdk";
|
|
8244
|
+
*
|
|
8245
|
+
* const spec: workflow.SpecV0 = {
|
|
8246
|
+
* kind: workflow.KindV0,
|
|
8247
|
+
* nodes: [{ id: "my_node", type: workflow.NodeTypes.LLMResponses, input: {...} }],
|
|
8248
|
+
* outputs: [],
|
|
8249
|
+
* };
|
|
8250
|
+
* ```
|
|
8251
|
+
*/
|
|
8252
|
+
|
|
8253
|
+
type NodeId = NodeId$1;
|
|
8254
|
+
type OutputName = OutputName$1;
|
|
8255
|
+
type RunId = RunId$1;
|
|
8256
|
+
type PlanHash = PlanHash$1;
|
|
8257
|
+
|
|
8258
|
+
type Kind = WorkflowKind;
|
|
8259
|
+
type SpecV0 = WorkflowSpecV0;
|
|
8260
|
+
type NodeV0 = WorkflowNodeV0;
|
|
8261
|
+
type EdgeV0 = WorkflowEdgeV0;
|
|
8262
|
+
type OutputRefV0 = WorkflowOutputRefV0;
|
|
8263
|
+
type BindingV0 = LLMResponsesBindingV0;
|
|
8264
|
+
type BindingEncodingV0 = LLMResponsesBindingEncodingV0;
|
|
8265
|
+
type ToolLimitsV0 = LLMResponsesToolLimitsV0;
|
|
8266
|
+
type ToolExecutionV0 = ToolExecutionV0$1;
|
|
8267
|
+
type ToolExecutionModeV0 = ToolExecutionModeV0$1;
|
|
8268
|
+
type StatusV0 = RunStatusV0;
|
|
8269
|
+
type EventTypeV0 = RunEventTypeV0;
|
|
8270
|
+
type EventV0 = RunEventV0;
|
|
8271
|
+
type EventBaseV0 = RunEventBaseV0;
|
|
8272
|
+
type EventRunCompiledV0 = RunEventRunCompiledV0;
|
|
8273
|
+
type EventRunStartedV0 = RunEventRunStartedV0;
|
|
8274
|
+
type EventRunCompletedV0 = RunEventRunCompletedV0;
|
|
8275
|
+
type EventRunFailedV0 = RunEventRunFailedV0;
|
|
8276
|
+
type EventRunCanceledV0 = RunEventRunCanceledV0;
|
|
8277
|
+
type EventNodeStartedV0 = RunEventNodeStartedV0;
|
|
8278
|
+
type EventNodeSucceededV0 = RunEventNodeSucceededV0;
|
|
8279
|
+
type EventNodeFailedV0 = RunEventNodeFailedV0;
|
|
8280
|
+
type EventNodeLLMCallV0 = RunEventNodeLLMCallV0;
|
|
8281
|
+
type EventNodeToolCallV0 = RunEventNodeToolCallV0;
|
|
8282
|
+
type EventNodeToolResultV0 = RunEventNodeToolResultV0;
|
|
8283
|
+
type EventNodeWaitingV0 = RunEventNodeWaitingV0;
|
|
8284
|
+
type EventNodeOutputDeltaV0 = RunEventNodeOutputDeltaV0;
|
|
8285
|
+
type EventNodeOutputV0 = RunEventNodeOutputV0;
|
|
8286
|
+
type NodeErrorV0 = NodeErrorV0$1;
|
|
8287
|
+
type NodeOutputDeltaV0 = NodeOutputDeltaV0$1;
|
|
8288
|
+
type NodeLLMCallV0 = NodeLLMCallV0$1;
|
|
8289
|
+
type NodeToolCallV0 = NodeToolCallV0$1;
|
|
8290
|
+
type NodeToolResultV0 = NodeToolResultV0$1;
|
|
8291
|
+
type NodeWaitingV0 = NodeWaitingV0$1;
|
|
8292
|
+
type PendingToolCallV0 = PendingToolCallV0$1;
|
|
8293
|
+
type FunctionToolCallV0 = FunctionToolCallV0$1;
|
|
8294
|
+
type TokenUsageV0 = TokenUsageV0$1;
|
|
8295
|
+
type PayloadInfoV0 = PayloadInfoV0$1;
|
|
8296
|
+
type StreamEventKind = StreamEventKind$1;
|
|
8297
|
+
declare const KindV0: "workflow.v0";
|
|
8298
|
+
declare const NodeTypes: {
|
|
8299
|
+
readonly LLMResponses: "llm.responses";
|
|
8300
|
+
readonly JoinAll: "join.all";
|
|
8301
|
+
readonly TransformJSON: "transform.json";
|
|
8302
|
+
};
|
|
8303
|
+
type NodeType = (typeof NodeTypes)[keyof typeof NodeTypes];
|
|
8304
|
+
declare const BindingEncodings: {
|
|
8305
|
+
readonly JSON: "json";
|
|
8306
|
+
readonly JSONString: "json_string";
|
|
8307
|
+
};
|
|
8308
|
+
declare const ToolExecutionModes: {
|
|
8309
|
+
readonly Server: "server";
|
|
8310
|
+
readonly Client: "client";
|
|
8311
|
+
};
|
|
8312
|
+
/** JSON pointer to extract text content from an LLM response output. */
|
|
8313
|
+
declare const LLM_TEXT_OUTPUT = "/output/0/content/0/text";
|
|
8314
|
+
/** JSON pointer to inject text into the user message of an LLM request. */
|
|
8315
|
+
declare const LLM_USER_MESSAGE_TEXT = "/request/input/1/content/0/text";
|
|
8316
|
+
|
|
8317
|
+
type index_BindingEncodingV0 = BindingEncodingV0;
|
|
8318
|
+
declare const index_BindingEncodings: typeof BindingEncodings;
|
|
8319
|
+
type index_BindingV0 = BindingV0;
|
|
8320
|
+
type index_EdgeV0 = EdgeV0;
|
|
8321
|
+
type index_EventBaseV0 = EventBaseV0;
|
|
8322
|
+
type index_EventNodeFailedV0 = EventNodeFailedV0;
|
|
8323
|
+
type index_EventNodeLLMCallV0 = EventNodeLLMCallV0;
|
|
8324
|
+
type index_EventNodeOutputDeltaV0 = EventNodeOutputDeltaV0;
|
|
8325
|
+
type index_EventNodeOutputV0 = EventNodeOutputV0;
|
|
8326
|
+
type index_EventNodeStartedV0 = EventNodeStartedV0;
|
|
8327
|
+
type index_EventNodeSucceededV0 = EventNodeSucceededV0;
|
|
8328
|
+
type index_EventNodeToolCallV0 = EventNodeToolCallV0;
|
|
8329
|
+
type index_EventNodeToolResultV0 = EventNodeToolResultV0;
|
|
8330
|
+
type index_EventNodeWaitingV0 = EventNodeWaitingV0;
|
|
8331
|
+
type index_EventRunCanceledV0 = EventRunCanceledV0;
|
|
8332
|
+
type index_EventRunCompiledV0 = EventRunCompiledV0;
|
|
8333
|
+
type index_EventRunCompletedV0 = EventRunCompletedV0;
|
|
8334
|
+
type index_EventRunFailedV0 = EventRunFailedV0;
|
|
8335
|
+
type index_EventRunStartedV0 = EventRunStartedV0;
|
|
8336
|
+
type index_EventTypeV0 = EventTypeV0;
|
|
8337
|
+
type index_EventV0 = EventV0;
|
|
8338
|
+
type index_FunctionToolCallV0 = FunctionToolCallV0;
|
|
8339
|
+
type index_Kind = Kind;
|
|
8340
|
+
declare const index_KindV0: typeof KindV0;
|
|
8341
|
+
declare const index_LLM_TEXT_OUTPUT: typeof LLM_TEXT_OUTPUT;
|
|
8342
|
+
declare const index_LLM_USER_MESSAGE_TEXT: typeof LLM_USER_MESSAGE_TEXT;
|
|
8343
|
+
type index_NodeErrorV0 = NodeErrorV0;
|
|
8344
|
+
type index_NodeId = NodeId;
|
|
8345
|
+
type index_NodeLLMCallV0 = NodeLLMCallV0;
|
|
8346
|
+
type index_NodeOutputDeltaV0 = NodeOutputDeltaV0;
|
|
8347
|
+
type index_NodeToolCallV0 = NodeToolCallV0;
|
|
8348
|
+
type index_NodeToolResultV0 = NodeToolResultV0;
|
|
8349
|
+
type index_NodeType = NodeType;
|
|
8350
|
+
declare const index_NodeTypes: typeof NodeTypes;
|
|
8351
|
+
type index_NodeV0 = NodeV0;
|
|
8352
|
+
type index_NodeWaitingV0 = NodeWaitingV0;
|
|
8353
|
+
type index_OutputName = OutputName;
|
|
8354
|
+
type index_OutputRefV0 = OutputRefV0;
|
|
8355
|
+
type index_PayloadInfoV0 = PayloadInfoV0;
|
|
8356
|
+
type index_PendingToolCallV0 = PendingToolCallV0;
|
|
8357
|
+
type index_PlanHash = PlanHash;
|
|
8358
|
+
type index_RunId = RunId;
|
|
8359
|
+
type index_SpecV0 = SpecV0;
|
|
8360
|
+
type index_StatusV0 = StatusV0;
|
|
8361
|
+
type index_StreamEventKind = StreamEventKind;
|
|
8362
|
+
type index_TokenUsageV0 = TokenUsageV0;
|
|
8363
|
+
type index_ToolExecutionModeV0 = ToolExecutionModeV0;
|
|
8364
|
+
declare const index_ToolExecutionModes: typeof ToolExecutionModes;
|
|
8365
|
+
type index_ToolExecutionV0 = ToolExecutionV0;
|
|
8366
|
+
type index_ToolLimitsV0 = ToolLimitsV0;
|
|
8367
|
+
declare const index_parseNodeId: typeof parseNodeId;
|
|
8368
|
+
declare const index_parseOutputName: typeof parseOutputName;
|
|
8369
|
+
declare const index_parsePlanHash: typeof parsePlanHash;
|
|
8370
|
+
declare const index_parseRunId: typeof parseRunId;
|
|
7694
8371
|
declare namespace index {
|
|
7695
|
-
export type
|
|
8372
|
+
export { type index_BindingEncodingV0 as BindingEncodingV0, index_BindingEncodings as BindingEncodings, type index_BindingV0 as BindingV0, type index_EdgeV0 as EdgeV0, type index_EventBaseV0 as EventBaseV0, type index_EventNodeFailedV0 as EventNodeFailedV0, type index_EventNodeLLMCallV0 as EventNodeLLMCallV0, type index_EventNodeOutputDeltaV0 as EventNodeOutputDeltaV0, type index_EventNodeOutputV0 as EventNodeOutputV0, type index_EventNodeStartedV0 as EventNodeStartedV0, type index_EventNodeSucceededV0 as EventNodeSucceededV0, type index_EventNodeToolCallV0 as EventNodeToolCallV0, type index_EventNodeToolResultV0 as EventNodeToolResultV0, type index_EventNodeWaitingV0 as EventNodeWaitingV0, type index_EventRunCanceledV0 as EventRunCanceledV0, type index_EventRunCompiledV0 as EventRunCompiledV0, type index_EventRunCompletedV0 as EventRunCompletedV0, type index_EventRunFailedV0 as EventRunFailedV0, type index_EventRunStartedV0 as EventRunStartedV0, type index_EventTypeV0 as EventTypeV0, type index_EventV0 as EventV0, type index_FunctionToolCallV0 as FunctionToolCallV0, type index_Kind as Kind, index_KindV0 as KindV0, index_LLM_TEXT_OUTPUT as LLM_TEXT_OUTPUT, index_LLM_USER_MESSAGE_TEXT as LLM_USER_MESSAGE_TEXT, type index_NodeErrorV0 as NodeErrorV0, type index_NodeId as NodeId, type index_NodeLLMCallV0 as NodeLLMCallV0, type index_NodeOutputDeltaV0 as NodeOutputDeltaV0, type index_NodeToolCallV0 as NodeToolCallV0, type index_NodeToolResultV0 as NodeToolResultV0, type index_NodeType as NodeType, index_NodeTypes as NodeTypes, type index_NodeV0 as NodeV0, type index_NodeWaitingV0 as NodeWaitingV0, type index_OutputName as OutputName, type index_OutputRefV0 as OutputRefV0, type index_PayloadInfoV0 as PayloadInfoV0, type index_PendingToolCallV0 as PendingToolCallV0, type index_PlanHash as PlanHash, type index_RunId as RunId, type index_SpecV0 as SpecV0, type index_StatusV0 as StatusV0, type index_StreamEventKind as StreamEventKind, type index_TokenUsageV0 as TokenUsageV0, type index_ToolExecutionModeV0 as ToolExecutionModeV0, index_ToolExecutionModes as ToolExecutionModes, type index_ToolExecutionV0 as ToolExecutionV0, type index_ToolLimitsV0 as ToolLimitsV0, index_parseNodeId as parseNodeId, index_parseOutputName as parseOutputName, index_parsePlanHash as parsePlanHash, index_parseRunId as parseRunId };
|
|
7696
8373
|
}
|
|
7697
8374
|
|
|
7698
8375
|
/**
|
|
@@ -7747,4 +8424,4 @@ declare class ModelRelay {
|
|
|
7747
8424
|
forCustomer(customerId: string): CustomerScopedModelRelay;
|
|
7748
8425
|
}
|
|
7749
8426
|
|
|
7750
|
-
export { type APICheckoutSession, type APICustomerRef, APIError, type APIFrontendToken, type APIKey, type APIResponsesResponse, type APIUsage, type ApiKey, type AttemptRecord, AuthClient, type AuthHeaders, type BillingProvider, BillingProviders, BrowserDefaults, BrowserToolNames, BrowserToolPack, type BrowserToolPackOptions, type CatalogModel, type CheckoutSession, type Citation, type CodeExecConfig, ConfigError, type ContentPart, type ContentPartType, ContentPartTypes, type Customer, type CustomerClaimRequest, type CustomerCreateRequest, type CustomerMetadata, CustomerResponsesClient, CustomerScopedModelRelay, type CustomerSubscribeRequest, type CustomerToken, CustomerTokenProvider, type CustomerTokenRequest, type CustomerUpsertRequest, type CustomerWithSubscription, CustomersClient, DEFAULT_BASE_URL, DEFAULT_CLIENT_HEADER, DEFAULT_CONNECT_TIMEOUT_MS, DEFAULT_IGNORE_DIRS, DEFAULT_REQUEST_TIMEOUT_MS, type DeepPartial, type DeviceStartRequest, type DeviceStartResponse, type DeviceTokenPending, type DeviceTokenResponse, type DeviceTokenResult, type ErrorCategory, type ErrorCode, ErrorCodes, FSDefaults, ToolNames as FSToolNames, type FieldError, type FrontendCustomer, type FrontendToken, type FrontendTokenAutoProvisionRequest, FrontendTokenProvider, type FrontendTokenRequest, type FunctionCall, type FunctionCallDelta, type FunctionTool, type HandleWaitingResult, type HttpRequestMetrics, type ImageData, type ImageRequest, type ImageResponse, type ImageResponseFormat, type ImageUsage, ImagesClient, type InputItem, type InputItemType, InputItemTypes, type JSONSchemaFormat, type JsonSchemaOptions, type KnownStopReason, type ListSessionsOptions, type ListSessionsResponse, LocalFSToolPack, type LocalFSToolPackOptions, LocalSession, type LocalSessionOptions, type LocalSessionPersistence, MemorySessionStore, type MessageDeltaData, type MessageRole, MessageRoles, type MessageStartData, type MessageStopData, type MetricsCallbacks, type ModelCapability, type ModelId, ModelRelay, type ModelRelayBaseOptions, ModelRelayError, type ModelRelayKeyOptions, type ModelRelayOptions, type ModelRelayTokenOptions, type ModelRelayTokenProviderOptions, ModelsClient, type NodeErrorV0, type NodeId, type NonEmptyArray, type OAuthDeviceAuthorization, type OAuthDeviceAuthorizationRequest, type OAuthDeviceToken, type OAuthDeviceTokenPollRequest, type OIDCExchangeRequest, OIDCExchangeTokenProvider, type OutputFormat, type OutputFormatType, OutputFormatTypes, type OutputItem, type OutputItemType, OutputItemTypes, type OutputName, PathEscapeError, type PayloadInfoV0, type PlanHash, type PriceInterval, type Project, type ProviderId, type PublishableKey, type RemoteSessionInfo, type RemoteSessionOptions, type RequestContext, type Response$1 as Response, type ResponseEvent, type ResponseEventType, ResponsesClient, ResponsesStream, type RetryConfig, type RetryHandler, type RetryMetadata, type RetryOptions, type RunEventTypeV0, type RunEventV0, type RunId, type RunStatusV0, RunsClient, RunsEventStream, SDK_VERSION, type Schema, type SecretKey, type Session, type SessionArtifacts, type SessionId, type SessionMessage, type SessionPendingToolCall, type SessionRunOptions, type SessionRunResult, type SessionRunStatus, type SessionState, type SessionStore, type SessionType, type SessionUsageSummary, SessionsClient, type StopReason, StopReasons, type StreamFirstTokenMetrics, StreamProtocolError, StreamTimeoutError, type StreamTimeoutKind, StructuredDecodeError, type StructuredErrorKind, StructuredExhaustedError, type StructuredJSONEvent, type StructuredJSONRecordType, StructuredJSONStream, type StructuredOptions, type StructuredResult, type Subscription, type SubscriptionStatusKind, SubscriptionStatuses, type Tier, type TierCheckoutRequest, type TierCheckoutSession, type TierCode, TiersClient, type TokenProvider, type TokenType, type TokenUsageMetrics, type Tool, ToolArgsError, ToolArgumentError, type ToolCall, ToolCallAccumulator, type ToolCallDelta, type ToolChoice, type ToolChoiceType, ToolChoiceTypes, type ToolExecutionResult, type ToolHandler, ToolRegistry, ToolRunner, type ToolRunnerOptions, type ToolType, ToolTypes, type TraceCallbacks, type TransformJSONValueV0, TransportError, type TransportErrorKind, type Usage, type UsageSummary, type ValidationIssue, WORKFLOWS_COMPILE_PATH, type WebSearchConfig, type WebToolMode, WebToolModes, WorkflowBuilderV0, type WorkflowBuilderV0State, type WorkflowEdgeV0, type WorkflowKind, WorkflowKinds, type WorkflowNodeType, WorkflowNodeTypes, type WorkflowNodeV0, type WorkflowOutputRefV0, type WorkflowSpecV0, WorkflowValidationError, type WorkflowValidationIssue, WorkflowsClient, type WorkflowsCompileOptions, type WorkflowsCompileRequestV0, type WorkflowsCompileResponseV0, type WorkflowsCompileV0Result, type XSearchConfig, type ZodLikeSchema, asModelId, asProviderId, asSessionId, asTierCode, assistantMessageWithToolCalls, createAccessTokenAuth, createApiKeyAuth, createAssistantMessage, createBrowserToolPack, createBrowserTools, createFunctionCall, createFunctionTool, createFunctionToolFromSchema, createLocalFSToolPack, createLocalFSTools, createLocalSession, createMemorySessionStore, createRetryMessages, createSystemMessage, createToolCall, createToolRunner, createUsage, createUserMessage, createWebTool, defaultRetryHandler, executeWithRetry, firstToolCall, formatToolErrorForModel, generateSessionId, index as generated, getRetryableErrors, hasRetryableErrors, hasToolCalls, isAutoProvisionDisabled, isAutoProvisionMisconfigured, isEmailRequired, isIdentityRequired, isProvisioningError, isPublishableKey, isSecretKey, mergeMetrics, mergeTrace, modelToString, normalizeModelId, normalizeStopReason, outputFormatFromZod, parseApiKey, parseErrorResponse, parseNodeId, parseOutputName, parsePlanHash, parsePublishableKey, parseRunId, parseSecretKey, parseToolArgs, parseToolArgsRaw, pollOAuthDeviceToken, respondToToolCall, runOAuthDeviceFlowForIDToken, startOAuthDeviceAuthorization, stopReasonToString, toolChoiceAuto, toolChoiceNone, toolChoiceRequired, toolResultMessage, transformJSONMerge, transformJSONObject, transformJSONValue, tryParseToolArgs, validateWithZod, workflowV0, workflow_v0_schema as workflowV0Schema, zodToJsonSchema };
|
|
8427
|
+
export { type APICheckoutSession, type APICustomerRef, APIError, type APIFrontendToken, type APIKey, type APIResponsesResponse, type APIUsage, type ApiKey, type AttemptRecord, AuthClient, type AuthHeaders, type BillingProvider, BillingProviders, BrowserDefaults, BrowserToolNames, BrowserToolPack, type BrowserToolPackOptions, type CatalogModel, Chain, ChainBuilder, type CheckoutSession, type Citation, type CodeExecConfig, ConfigError, type ContentPart, type ContentPartType, ContentPartTypes, type Customer, type CustomerClaimRequest, type CustomerCreateRequest, type CustomerMetadata, CustomerResponsesClient, CustomerScopedModelRelay, type CustomerSubscribeRequest, type CustomerToken, CustomerTokenProvider, type CustomerTokenRequest, type CustomerUpsertRequest, type CustomerWithSubscription, CustomersClient, DEFAULT_BASE_URL, DEFAULT_CLIENT_HEADER, DEFAULT_CONNECT_TIMEOUT_MS, DEFAULT_IGNORE_DIRS, DEFAULT_REQUEST_TIMEOUT_MS, type DeepPartial, type DeviceStartRequest, type DeviceStartResponse, type DeviceTokenPending, type DeviceTokenResponse, type DeviceTokenResult, type ErrorCategory, type ErrorCode, ErrorCodes, FSDefaults, ToolNames as FSToolNames, type FieldError, type FrontendCustomer, type FrontendToken, type FrontendTokenAutoProvisionRequest, FrontendTokenProvider, type FrontendTokenRequest, type FunctionCall, type FunctionCallDelta, type FunctionTool, type HandleWaitingResult, type HttpRequestMetrics, type ImageData, type ImageRequest, type ImageResponse, type ImageResponseFormat, type ImageUsage, ImagesClient, type InputItem, type InputItemType, InputItemTypes, type JSONSchemaFormat, type JsonSchemaOptions, type KnownStopReason, LLMNodeBuilder, LLMStep, type LLMStepConfig, LLM_TEXT_OUTPUT$1 as LLM_TEXT_OUTPUT, LLM_USER_MESSAGE_TEXT$1 as LLM_USER_MESSAGE_TEXT, type ListSessionsOptions, type ListSessionsResponse, LocalFSToolPack, type LocalFSToolPackOptions, LocalSession, type LocalSessionOptions, type LocalSessionPersistence, MapItem, type MapItemConfig, MapReduce, MapReduceBuilder, MemorySessionStore, type MessageDeltaData, type MessageRole, MessageRoles, type MessageStartData, type MessageStopData, type MetricsCallbacks, type ModelCapability, type ModelId, ModelRelay, type ModelRelayBaseOptions, ModelRelayError, type ModelRelayKeyOptions, type ModelRelayOptions, type ModelRelayTokenOptions, type ModelRelayTokenProviderOptions, ModelsClient, type NodeErrorV0$1 as NodeErrorV0, type NodeId$1 as NodeId, type NonEmptyArray, type OAuthDeviceAuthorization, type OAuthDeviceAuthorizationRequest, type OAuthDeviceToken, type OAuthDeviceTokenPollRequest, type OIDCExchangeRequest, OIDCExchangeTokenProvider, type OutputFormat, type OutputFormatType, OutputFormatTypes, type OutputItem, type OutputItemType, OutputItemTypes, type OutputName$1 as OutputName, Parallel, ParallelBuilder, PathEscapeError, type PayloadInfoV0$1 as PayloadInfoV0, type PlanHash$1 as PlanHash, type PriceInterval, type Project, type ProviderId, type PublishableKey, type RemoteSessionInfo, type RemoteSessionOptions, type RequestContext, type Response$1 as Response, type ResponseEvent, type ResponseEventType, ResponsesClient, ResponsesStream, type RetryConfig, type RetryHandler, type RetryMetadata, type RetryOptions, type RunEventTypeV0, type RunEventV0, type RunId$1 as RunId, type RunStatusV0, RunsClient, RunsEventStream, SDK_VERSION, type Schema, type SecretKey, type Session, type SessionArtifacts, type SessionId, type SessionMessage, type SessionPendingToolCall, type SessionRunOptions, type SessionRunResult, type SessionRunStatus, type SessionState, type SessionStore, type SessionType, type SessionUsageSummary, SessionsClient, type StopReason, StopReasons, type StreamFirstTokenMetrics, StreamProtocolError, StreamTimeoutError, type StreamTimeoutKind, StructuredDecodeError, type StructuredErrorKind, StructuredExhaustedError, type StructuredJSONEvent, type StructuredJSONRecordType, StructuredJSONStream, type StructuredOptions, type StructuredResult, type Subscription, type SubscriptionStatusKind, SubscriptionStatuses, type Tier, type TierCheckoutRequest, type TierCheckoutSession, type TierCode, TiersClient, type TokenProvider, type TokenType, type TokenUsageMetrics, type Tool, ToolArgsError, ToolArgumentError, type ToolCall, ToolCallAccumulator, type ToolCallDelta, type ToolChoice, type ToolChoiceType, ToolChoiceTypes, type ToolExecutionResult, type ToolHandler, ToolRegistry, ToolRunner, type ToolRunnerOptions, type ToolType, ToolTypes, type TraceCallbacks, TransformJSONNodeBuilder, type TransformJSONValueV0, TransportError, type TransportErrorKind, type Usage, type UsageSummary, type ValidationIssue, WORKFLOWS_COMPILE_PATH, type WebSearchConfig, type WebToolMode, WebToolModes, Workflow, WorkflowBuilderV0, type WorkflowBuilderV0State, type WorkflowEdgeV0, type WorkflowKind, WorkflowKinds, type WorkflowNodeType, WorkflowNodeTypes, type WorkflowNodeV0, type WorkflowOutputRefV0, type WorkflowSpecV0, WorkflowValidationError, type WorkflowValidationIssue, WorkflowsClient, type WorkflowsCompileOptions, type WorkflowsCompileRequestV0, type WorkflowsCompileResponseV0, type WorkflowsCompileV0Result, type XSearchConfig, type ZodLikeSchema, asModelId, asProviderId, asSessionId, asTierCode, assistantMessageWithToolCalls, createAccessTokenAuth, createApiKeyAuth, createAssistantMessage, createBrowserToolPack, createBrowserTools, createFunctionCall, createFunctionTool, createFunctionToolFromSchema, createLocalFSToolPack, createLocalFSTools, createLocalSession, createMemorySessionStore, createRetryMessages, createSystemMessage, createToolCall, createToolRunner, createUsage, createUserMessage, createWebTool, defaultRetryHandler, executeWithRetry, firstToolCall, formatToolErrorForModel, generateSessionId, index$1 as generated, getRetryableErrors, hasRetryableErrors, hasToolCalls, isAutoProvisionDisabled, isAutoProvisionMisconfigured, isEmailRequired, isIdentityRequired, isProvisioningError, isPublishableKey, isSecretKey, mergeMetrics, mergeTrace, modelToString, newWorkflow, normalizeModelId, normalizeStopReason, outputFormatFromZod, parseApiKey, parseErrorResponse, parseNodeId, parseOutputName, parsePlanHash, parsePublishableKey, parseRunId, parseSecretKey, parseToolArgs, parseToolArgsRaw, pollOAuthDeviceToken, respondToToolCall, runOAuthDeviceFlowForIDToken, startOAuthDeviceAuthorization, stopReasonToString, toolChoiceAuto, toolChoiceNone, toolChoiceRequired, toolResultMessage, transformJSONMerge, transformJSONObject, transformJSONValue, tryParseToolArgs, validateWithZod, index as workflow, workflowV0, workflow_v0_schema as workflowV0Schema, zodToJsonSchema };
|