@runtypelabs/sdk 2.2.0 → 4.0.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/dist/index.cjs +266 -35
- package/dist/index.d.cts +41052 -418
- package/dist/index.d.ts +41052 -418
- package/dist/index.mjs +264 -35
- package/package.json +6 -3
package/dist/index.cjs
CHANGED
|
@@ -23,9 +23,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
23
23
|
// src/stream-utils.ts
|
|
24
24
|
var stream_utils_exports = {};
|
|
25
25
|
__export(stream_utils_exports, {
|
|
26
|
+
flowErrorMessage: () => flowErrorMessage,
|
|
26
27
|
parseFinalBuffer: () => parseFinalBuffer,
|
|
27
28
|
parseSSEChunk: () => parseSSEChunk,
|
|
28
29
|
processStream: () => processStream,
|
|
30
|
+
stepDeltaText: () => stepDeltaText,
|
|
31
|
+
stepDisplayName: () => stepDisplayName,
|
|
29
32
|
streamEvents: () => streamEvents
|
|
30
33
|
});
|
|
31
34
|
function parseSSEChunk(chunk, buffer) {
|
|
@@ -146,7 +149,7 @@ async function processStream(response, callbacks = {}) {
|
|
|
146
149
|
try {
|
|
147
150
|
const event = JSON.parse(eventStr);
|
|
148
151
|
handleEvent(event, callbacks, results, flowSummary);
|
|
149
|
-
} catch
|
|
152
|
+
} catch {
|
|
150
153
|
console.warn("Failed to parse SSE event:", eventStr);
|
|
151
154
|
}
|
|
152
155
|
}
|
|
@@ -156,7 +159,7 @@ async function processStream(response, callbacks = {}) {
|
|
|
156
159
|
try {
|
|
157
160
|
const event = JSON.parse(finalEvent);
|
|
158
161
|
handleEvent(event, callbacks, results, flowSummary);
|
|
159
|
-
} catch
|
|
162
|
+
} catch {
|
|
160
163
|
}
|
|
161
164
|
}
|
|
162
165
|
} catch (error) {
|
|
@@ -178,6 +181,15 @@ async function processStream(response, callbacks = {}) {
|
|
|
178
181
|
success: flowSummary.success ?? true
|
|
179
182
|
};
|
|
180
183
|
}
|
|
184
|
+
function stepDeltaText(event) {
|
|
185
|
+
return event.text ?? event.delta ?? "";
|
|
186
|
+
}
|
|
187
|
+
function stepDisplayName(event) {
|
|
188
|
+
return event.name ?? event.stepName ?? "";
|
|
189
|
+
}
|
|
190
|
+
function flowErrorMessage(event) {
|
|
191
|
+
return typeof event.error === "string" ? event.error : JSON.stringify(event.error);
|
|
192
|
+
}
|
|
181
193
|
function handleEvent(event, callbacks, results, summary) {
|
|
182
194
|
switch (event.type) {
|
|
183
195
|
case "flow_start":
|
|
@@ -190,24 +202,26 @@ function handleEvent(event, callbacks, results, summary) {
|
|
|
190
202
|
callbacks.onStepStart?.(event);
|
|
191
203
|
break;
|
|
192
204
|
case "step_delta":
|
|
193
|
-
callbacks.onStepDelta?.(event
|
|
205
|
+
callbacks.onStepDelta?.(stepDeltaText(event), event);
|
|
194
206
|
break;
|
|
195
|
-
case "step_complete":
|
|
196
|
-
results.set(event
|
|
207
|
+
case "step_complete": {
|
|
208
|
+
results.set(stepDisplayName(event), event.result);
|
|
197
209
|
callbacks.onStepComplete?.(event.result, event);
|
|
198
210
|
break;
|
|
211
|
+
}
|
|
199
212
|
case "flow_complete":
|
|
200
213
|
summary.totalSteps = event.totalSteps;
|
|
201
214
|
summary.successfulSteps = event.successfulSteps;
|
|
202
215
|
summary.failedSteps = event.failedSteps;
|
|
203
216
|
summary.executionTime = event.executionTime;
|
|
204
|
-
summary.success = event.failedSteps === 0;
|
|
217
|
+
summary.success = event.success ?? (event.failedSteps ?? 0) === 0;
|
|
205
218
|
callbacks.onFlowComplete?.(event);
|
|
206
219
|
break;
|
|
207
|
-
case "flow_error":
|
|
220
|
+
case "flow_error": {
|
|
208
221
|
summary.success = false;
|
|
209
|
-
callbacks.onError?.(new Error(event
|
|
222
|
+
callbacks.onError?.(new Error(flowErrorMessage(event)));
|
|
210
223
|
break;
|
|
224
|
+
}
|
|
211
225
|
case "flow_await":
|
|
212
226
|
break;
|
|
213
227
|
case "step_await":
|
|
@@ -315,6 +329,8 @@ __export(index_exports, {
|
|
|
315
329
|
STEP_TYPE_TO_METHOD: () => STEP_TYPE_TO_METHOD,
|
|
316
330
|
SchedulesEndpoint: () => SchedulesEndpoint,
|
|
317
331
|
SecretsEndpoint: () => SecretsEndpoint,
|
|
332
|
+
SkillProposalsNamespace: () => SkillProposalsNamespace,
|
|
333
|
+
SkillsNamespace: () => SkillsNamespace,
|
|
318
334
|
SurfacesEndpoint: () => SurfacesEndpoint,
|
|
319
335
|
ToolsEndpoint: () => ToolsEndpoint,
|
|
320
336
|
UsersEndpoint: () => UsersEndpoint,
|
|
@@ -1034,22 +1050,24 @@ var RuntypeFlowBuilder = class {
|
|
|
1034
1050
|
onFlowComplete: (event) => callbacks?.onFlowComplete?.(event),
|
|
1035
1051
|
onError: (error) => callbacks?.onError?.(error)
|
|
1036
1052
|
};
|
|
1037
|
-
const { streamEvents: streamEvents2 } = await Promise.resolve().then(() => (init_stream_utils(), stream_utils_exports));
|
|
1053
|
+
const { streamEvents: streamEvents2, stepDeltaText: stepDeltaText2, stepDisplayName: stepDisplayName2, flowErrorMessage: flowErrorMessage2 } = await Promise.resolve().then(() => (init_stream_utils(), stream_utils_exports));
|
|
1038
1054
|
try {
|
|
1039
1055
|
for await (const event of streamEvents2(response)) {
|
|
1040
1056
|
const awaitEvent = event;
|
|
1041
1057
|
if (awaitEvent.type === "flow_await") {
|
|
1058
|
+
const prev = pausedState;
|
|
1042
1059
|
pausedState = {
|
|
1043
|
-
toolName: awaitEvent.toolName || "",
|
|
1044
|
-
parameters: awaitEvent.parameters,
|
|
1045
|
-
executionId: awaitEvent.executionId || ""
|
|
1060
|
+
toolName: awaitEvent.toolName || prev?.toolName || "",
|
|
1061
|
+
parameters: awaitEvent.parameters ?? prev?.parameters,
|
|
1062
|
+
executionId: awaitEvent.executionId || prev?.executionId || ""
|
|
1046
1063
|
};
|
|
1047
1064
|
}
|
|
1048
1065
|
if (awaitEvent.type === "step_await") {
|
|
1066
|
+
const prev = pausedState;
|
|
1049
1067
|
pausedState = {
|
|
1050
|
-
toolName: awaitEvent.toolName || "",
|
|
1051
|
-
parameters: awaitEvent.parameters,
|
|
1052
|
-
executionId: awaitEvent.executionId || ""
|
|
1068
|
+
toolName: awaitEvent.toolName || prev?.toolName || "",
|
|
1069
|
+
parameters: awaitEvent.parameters ?? prev?.parameters,
|
|
1070
|
+
executionId: awaitEvent.executionId || prev?.executionId || ""
|
|
1053
1071
|
};
|
|
1054
1072
|
}
|
|
1055
1073
|
switch (event.type) {
|
|
@@ -1060,10 +1078,10 @@ var RuntypeFlowBuilder = class {
|
|
|
1060
1078
|
wrappedCallbacks.onStepStart?.(event);
|
|
1061
1079
|
break;
|
|
1062
1080
|
case "step_delta":
|
|
1063
|
-
wrappedCallbacks.onStepDelta?.(event
|
|
1081
|
+
wrappedCallbacks.onStepDelta?.(stepDeltaText2(event), event);
|
|
1064
1082
|
break;
|
|
1065
1083
|
case "step_complete": {
|
|
1066
|
-
accumulatedSummary.results?.set(event
|
|
1084
|
+
accumulatedSummary.results?.set(stepDisplayName2(event), event.result);
|
|
1067
1085
|
wrappedCallbacks.onStepComplete?.(event.result, event);
|
|
1068
1086
|
break;
|
|
1069
1087
|
}
|
|
@@ -1071,7 +1089,7 @@ var RuntypeFlowBuilder = class {
|
|
|
1071
1089
|
wrappedCallbacks.onFlowComplete?.(event);
|
|
1072
1090
|
break;
|
|
1073
1091
|
case "flow_error":
|
|
1074
|
-
wrappedCallbacks.onError?.(new Error(event
|
|
1092
|
+
wrappedCallbacks.onError?.(new Error(flowErrorMessage2(event)));
|
|
1075
1093
|
break;
|
|
1076
1094
|
}
|
|
1077
1095
|
}
|
|
@@ -1733,6 +1751,175 @@ var PromptsNamespace = class {
|
|
|
1733
1751
|
}
|
|
1734
1752
|
};
|
|
1735
1753
|
|
|
1754
|
+
// src/skills-namespace.ts
|
|
1755
|
+
var SkillProposalsNamespace = class {
|
|
1756
|
+
constructor(getClient) {
|
|
1757
|
+
this.getClient = getClient;
|
|
1758
|
+
}
|
|
1759
|
+
/**
|
|
1760
|
+
* List pending skill proposals for the authenticated owner.
|
|
1761
|
+
*
|
|
1762
|
+
* @example
|
|
1763
|
+
* ```typescript
|
|
1764
|
+
* const pending = await Runtype.skills.proposals.list()
|
|
1765
|
+
* ```
|
|
1766
|
+
*/
|
|
1767
|
+
async list() {
|
|
1768
|
+
const client = this.getClient();
|
|
1769
|
+
const res = await client.get("/skill-proposals");
|
|
1770
|
+
return res.data;
|
|
1771
|
+
}
|
|
1772
|
+
/**
|
|
1773
|
+
* Approve a pending proposal — publishes the proposed skill version.
|
|
1774
|
+
*
|
|
1775
|
+
* @example
|
|
1776
|
+
* ```typescript
|
|
1777
|
+
* const proposal = await Runtype.skills.proposals.approve('skprop_123')
|
|
1778
|
+
* ```
|
|
1779
|
+
*/
|
|
1780
|
+
async approve(proposalId) {
|
|
1781
|
+
const client = this.getClient();
|
|
1782
|
+
const res = await client.post(
|
|
1783
|
+
`/skill-proposals/${proposalId}/approve`
|
|
1784
|
+
);
|
|
1785
|
+
return res.proposal;
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* Reject a pending proposal with an optional reason.
|
|
1789
|
+
*
|
|
1790
|
+
* @example
|
|
1791
|
+
* ```typescript
|
|
1792
|
+
* await Runtype.skills.proposals.reject('skprop_123', 'Capabilities too broad')
|
|
1793
|
+
* ```
|
|
1794
|
+
*/
|
|
1795
|
+
async reject(proposalId, reason) {
|
|
1796
|
+
const client = this.getClient();
|
|
1797
|
+
const res = await client.post(
|
|
1798
|
+
`/skill-proposals/${proposalId}/reject`,
|
|
1799
|
+
reason !== void 0 ? { reason } : {}
|
|
1800
|
+
);
|
|
1801
|
+
return res.proposal;
|
|
1802
|
+
}
|
|
1803
|
+
};
|
|
1804
|
+
var SkillsNamespace = class {
|
|
1805
|
+
constructor(getClient) {
|
|
1806
|
+
this.getClient = getClient;
|
|
1807
|
+
this.proposals = new SkillProposalsNamespace(getClient);
|
|
1808
|
+
}
|
|
1809
|
+
/**
|
|
1810
|
+
* Create a skill from a SKILL.md string (`markdown`) or a structured manifest
|
|
1811
|
+
* (`frontmatter` + `body`). Pass `publish: true` to publish the first version
|
|
1812
|
+
* immediately; otherwise it lands as a draft.
|
|
1813
|
+
*/
|
|
1814
|
+
async create(input) {
|
|
1815
|
+
const client = this.getClient();
|
|
1816
|
+
return client.post("/skills", input);
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* List skills for the authenticated owner, optionally filtered by status.
|
|
1820
|
+
*
|
|
1821
|
+
* @example
|
|
1822
|
+
* ```typescript
|
|
1823
|
+
* const active = await Runtype.skills.list({ status: 'active' })
|
|
1824
|
+
* ```
|
|
1825
|
+
*/
|
|
1826
|
+
async list(params) {
|
|
1827
|
+
const client = this.getClient();
|
|
1828
|
+
const res = await client.get("/skills", params);
|
|
1829
|
+
return res.data;
|
|
1830
|
+
}
|
|
1831
|
+
/**
|
|
1832
|
+
* Get a skill and its full version history.
|
|
1833
|
+
*
|
|
1834
|
+
* @example
|
|
1835
|
+
* ```typescript
|
|
1836
|
+
* const { skill, versions } = await Runtype.skills.get('skill_123')
|
|
1837
|
+
* ```
|
|
1838
|
+
*/
|
|
1839
|
+
async get(skillId) {
|
|
1840
|
+
const client = this.getClient();
|
|
1841
|
+
return client.get(`/skills/${skillId}`);
|
|
1842
|
+
}
|
|
1843
|
+
/**
|
|
1844
|
+
* Append a new version to an existing skill from an updated manifest. Pass
|
|
1845
|
+
* `publish: true` to publish the new version immediately.
|
|
1846
|
+
*/
|
|
1847
|
+
async update(skillId, input) {
|
|
1848
|
+
const client = this.getClient();
|
|
1849
|
+
const res = await client.put(`/skills/${skillId}`, input);
|
|
1850
|
+
return res.version;
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Delete a skill (and its versions + bindings, via cascade).
|
|
1854
|
+
*/
|
|
1855
|
+
async delete(skillId) {
|
|
1856
|
+
const client = this.getClient();
|
|
1857
|
+
await client.delete(`/skills/${skillId}`);
|
|
1858
|
+
}
|
|
1859
|
+
/**
|
|
1860
|
+
* List a skill's versions, newest first.
|
|
1861
|
+
*/
|
|
1862
|
+
async listVersions(skillId) {
|
|
1863
|
+
const client = this.getClient();
|
|
1864
|
+
const res = await client.get(`/skills/${skillId}/versions`);
|
|
1865
|
+
return res.data;
|
|
1866
|
+
}
|
|
1867
|
+
/**
|
|
1868
|
+
* Publish a specific version of a skill.
|
|
1869
|
+
*
|
|
1870
|
+
* @example
|
|
1871
|
+
* ```typescript
|
|
1872
|
+
* await Runtype.skills.publishVersion('skill_123', 'skillver_456')
|
|
1873
|
+
* ```
|
|
1874
|
+
*/
|
|
1875
|
+
async publishVersion(skillId, versionId) {
|
|
1876
|
+
const client = this.getClient();
|
|
1877
|
+
await client.post(`/skills/${skillId}/versions/${versionId}/publish`);
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* Import a single SKILL.md document. The imported skill lands with
|
|
1881
|
+
* `trustLevel: 'imported'` and a draft version.
|
|
1882
|
+
*
|
|
1883
|
+
* @example
|
|
1884
|
+
* ```typescript
|
|
1885
|
+
* const { skill } = await Runtype.skills.import(skillMarkdown)
|
|
1886
|
+
* ```
|
|
1887
|
+
*/
|
|
1888
|
+
async import(markdown) {
|
|
1889
|
+
const client = this.getClient();
|
|
1890
|
+
return client.post("/skills/import", { markdown });
|
|
1891
|
+
}
|
|
1892
|
+
/**
|
|
1893
|
+
* Bind a skill to an agent. Both the agent and the skill must be owned by the
|
|
1894
|
+
* caller.
|
|
1895
|
+
*/
|
|
1896
|
+
async bind(input) {
|
|
1897
|
+
const client = this.getClient();
|
|
1898
|
+
const res = await client.post("/skills/bind", input);
|
|
1899
|
+
return res.binding;
|
|
1900
|
+
}
|
|
1901
|
+
/**
|
|
1902
|
+
* Remove a skill binding by its binding id.
|
|
1903
|
+
*/
|
|
1904
|
+
async unbind(bindingId) {
|
|
1905
|
+
const client = this.getClient();
|
|
1906
|
+
await client.delete(`/skills/bindings/${bindingId}`);
|
|
1907
|
+
}
|
|
1908
|
+
/**
|
|
1909
|
+
* List an agent's skill bindings.
|
|
1910
|
+
*
|
|
1911
|
+
* @example
|
|
1912
|
+
* ```typescript
|
|
1913
|
+
* const bindings = await Runtype.skills.listBindings('agent_123')
|
|
1914
|
+
* ```
|
|
1915
|
+
*/
|
|
1916
|
+
async listBindings(agentId) {
|
|
1917
|
+
const client = this.getClient();
|
|
1918
|
+
const res = await client.get("/skills/bindings", { agentId });
|
|
1919
|
+
return res.data;
|
|
1920
|
+
}
|
|
1921
|
+
};
|
|
1922
|
+
|
|
1736
1923
|
// src/transform.ts
|
|
1737
1924
|
function transformResponse(data) {
|
|
1738
1925
|
return data;
|
|
@@ -1780,6 +1967,7 @@ var RuntypeClient = class {
|
|
|
1780
1967
|
/**
|
|
1781
1968
|
* Generic GET request
|
|
1782
1969
|
*/
|
|
1970
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- accepts typed list-param interfaces (no index signature); `unknown` would reject them
|
|
1783
1971
|
async get(path, params) {
|
|
1784
1972
|
const url = this.buildUrl(path, params);
|
|
1785
1973
|
const response = await this.makeRequest(url, {
|
|
@@ -1800,6 +1988,29 @@ var RuntypeClient = class {
|
|
|
1800
1988
|
});
|
|
1801
1989
|
return this.transformResponse(response);
|
|
1802
1990
|
}
|
|
1991
|
+
/**
|
|
1992
|
+
* Generic PUT request
|
|
1993
|
+
*/
|
|
1994
|
+
async put(path, data) {
|
|
1995
|
+
const url = this.buildUrl(path);
|
|
1996
|
+
const response = await this.makeRequest(url, {
|
|
1997
|
+
method: "PUT",
|
|
1998
|
+
headers: this.headers,
|
|
1999
|
+
body: data ? JSON.stringify(data) : void 0
|
|
2000
|
+
});
|
|
2001
|
+
return this.transformResponse(response);
|
|
2002
|
+
}
|
|
2003
|
+
/**
|
|
2004
|
+
* Generic DELETE request
|
|
2005
|
+
*/
|
|
2006
|
+
async delete(path) {
|
|
2007
|
+
const url = this.buildUrl(path);
|
|
2008
|
+
const response = await this.makeRequest(url, {
|
|
2009
|
+
method: "DELETE",
|
|
2010
|
+
headers: this.headers
|
|
2011
|
+
});
|
|
2012
|
+
return this.transformResponse(response);
|
|
2013
|
+
}
|
|
1803
2014
|
/**
|
|
1804
2015
|
* Generic request that returns raw Response for streaming
|
|
1805
2016
|
*/
|
|
@@ -1826,6 +2037,7 @@ var RuntypeClient = class {
|
|
|
1826
2037
|
/**
|
|
1827
2038
|
* Build full URL with query parameters
|
|
1828
2039
|
*/
|
|
2040
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- mirrors get()'s permissive params type
|
|
1829
2041
|
buildUrl(path, params) {
|
|
1830
2042
|
const base = this.baseUrl.endsWith("/") ? this.baseUrl : `${this.baseUrl}/`;
|
|
1831
2043
|
const relPath = path.startsWith("/") ? path.slice(1) : path;
|
|
@@ -2051,6 +2263,25 @@ var Runtype = class {
|
|
|
2051
2263
|
static get prompts() {
|
|
2052
2264
|
return new PromptsNamespace(() => this.getClient());
|
|
2053
2265
|
}
|
|
2266
|
+
/**
|
|
2267
|
+
* Skills namespace - Manage Agent Skills (admin/control plane)
|
|
2268
|
+
*
|
|
2269
|
+
* @example
|
|
2270
|
+
* ```typescript
|
|
2271
|
+
* // Create a published skill from a SKILL.md document
|
|
2272
|
+
* const { skill } = await Runtype.skills.create({ markdown: skillMd, publish: true })
|
|
2273
|
+
*
|
|
2274
|
+
* // Bind it to an agent
|
|
2275
|
+
* await Runtype.skills.bind({ agentId: 'agent_123', skillId: skill.id })
|
|
2276
|
+
*
|
|
2277
|
+
* // Review agent-authored proposals
|
|
2278
|
+
* const pending = await Runtype.skills.proposals.list()
|
|
2279
|
+
* await Runtype.skills.proposals.approve(pending[0].id)
|
|
2280
|
+
* ```
|
|
2281
|
+
*/
|
|
2282
|
+
static get skills() {
|
|
2283
|
+
return new SkillsNamespace(() => this.getClient());
|
|
2284
|
+
}
|
|
2054
2285
|
};
|
|
2055
2286
|
|
|
2056
2287
|
// src/generated-tool-gate.ts
|
|
@@ -4243,12 +4474,6 @@ var ToolsEndpoint = class {
|
|
|
4243
4474
|
async test(id, data) {
|
|
4244
4475
|
return this.client.post(`/tools/${id}/test`, data);
|
|
4245
4476
|
}
|
|
4246
|
-
/**
|
|
4247
|
-
* Get tool executions for a specific tool
|
|
4248
|
-
*/
|
|
4249
|
-
async getExecutions(toolId, params) {
|
|
4250
|
-
return this.client.get(`/tools/${toolId}/executions`, params);
|
|
4251
|
-
}
|
|
4252
4477
|
/**
|
|
4253
4478
|
* Get AI SDK compatible tool schemas
|
|
4254
4479
|
*/
|
|
@@ -8292,7 +8517,7 @@ var RuntypeClient2 = class {
|
|
|
8292
8517
|
onFlowComplete: (event) => callbacks?.onFlowComplete?.(event),
|
|
8293
8518
|
onError: (error) => callbacks?.onError?.(error)
|
|
8294
8519
|
};
|
|
8295
|
-
const { streamEvents: streamEvents2 } = await Promise.resolve().then(() => (init_stream_utils(), stream_utils_exports));
|
|
8520
|
+
const { streamEvents: streamEvents2, stepDeltaText: stepDeltaText2, stepDisplayName: stepDisplayName2, flowErrorMessage: flowErrorMessage2 } = await Promise.resolve().then(() => (init_stream_utils(), stream_utils_exports));
|
|
8296
8521
|
const summary = {
|
|
8297
8522
|
results: /* @__PURE__ */ new Map(),
|
|
8298
8523
|
success: true
|
|
@@ -8301,19 +8526,23 @@ var RuntypeClient2 = class {
|
|
|
8301
8526
|
for await (const event of streamEvents2(response)) {
|
|
8302
8527
|
if (event.type === "flow_await") {
|
|
8303
8528
|
const pausedEvent = event;
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
toolName: pausedEvent.toolName,
|
|
8307
|
-
executionId: pausedEvent.executionId
|
|
8529
|
+
const prev = pausedState;
|
|
8530
|
+
const next = {
|
|
8531
|
+
toolName: pausedEvent.toolName ?? prev?.toolName ?? "",
|
|
8532
|
+
executionId: pausedEvent.executionId ?? prev?.executionId ?? "",
|
|
8533
|
+
parameters: prev?.parameters
|
|
8308
8534
|
};
|
|
8535
|
+
pausedState = next;
|
|
8309
8536
|
}
|
|
8310
8537
|
if (event.type === "step_await") {
|
|
8311
8538
|
const pausedEvent = event;
|
|
8312
|
-
|
|
8313
|
-
|
|
8539
|
+
const prev = pausedState;
|
|
8540
|
+
const next = {
|
|
8541
|
+
toolName: typeof pausedEvent.toolName === "string" ? pausedEvent.toolName : prev?.toolName ?? "",
|
|
8314
8542
|
parameters: pausedEvent.parameters,
|
|
8315
|
-
executionId: pausedEvent.executionId
|
|
8543
|
+
executionId: typeof pausedEvent.executionId === "string" ? pausedEvent.executionId : prev?.executionId ?? ""
|
|
8316
8544
|
};
|
|
8545
|
+
pausedState = next;
|
|
8317
8546
|
}
|
|
8318
8547
|
switch (event.type) {
|
|
8319
8548
|
case "flow_start":
|
|
@@ -8323,10 +8552,10 @@ var RuntypeClient2 = class {
|
|
|
8323
8552
|
wrappedCallbacks.onStepStart?.(event);
|
|
8324
8553
|
break;
|
|
8325
8554
|
case "step_delta":
|
|
8326
|
-
wrappedCallbacks.onStepDelta?.(event
|
|
8555
|
+
wrappedCallbacks.onStepDelta?.(stepDeltaText2(event), event);
|
|
8327
8556
|
break;
|
|
8328
8557
|
case "step_complete": {
|
|
8329
|
-
summary.results?.set(event
|
|
8558
|
+
summary.results?.set(stepDisplayName2(event), event.result);
|
|
8330
8559
|
wrappedCallbacks.onStepComplete?.(event.result, event);
|
|
8331
8560
|
break;
|
|
8332
8561
|
}
|
|
@@ -8334,7 +8563,7 @@ var RuntypeClient2 = class {
|
|
|
8334
8563
|
wrappedCallbacks.onFlowComplete?.(event);
|
|
8335
8564
|
break;
|
|
8336
8565
|
case "flow_error":
|
|
8337
|
-
wrappedCallbacks.onError?.(new Error(event
|
|
8566
|
+
wrappedCallbacks.onError?.(new Error(flowErrorMessage2(event)));
|
|
8338
8567
|
break;
|
|
8339
8568
|
}
|
|
8340
8569
|
}
|
|
@@ -9194,6 +9423,8 @@ var STEP_TYPE_TO_METHOD = {
|
|
|
9194
9423
|
STEP_TYPE_TO_METHOD,
|
|
9195
9424
|
SchedulesEndpoint,
|
|
9196
9425
|
SecretsEndpoint,
|
|
9426
|
+
SkillProposalsNamespace,
|
|
9427
|
+
SkillsNamespace,
|
|
9197
9428
|
SurfacesEndpoint,
|
|
9198
9429
|
ToolsEndpoint,
|
|
9199
9430
|
UsersEndpoint,
|