agents 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +1 -1
- package/dist/experimental/forever.d.ts +1 -1
- package/dist/{index-BXYKcQZg.d.ts → index-DE7ndldW.d.ts} +2 -14
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -52
- package/dist/index.js.map +1 -1
- package/dist/mcp/client.d.ts +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/package.json +8 -8
package/dist/client.d.ts
CHANGED
|
@@ -706,7 +706,7 @@ declare class MCPClientConnection {
|
|
|
706
706
|
*/
|
|
707
707
|
getTransport(
|
|
708
708
|
transportType: BaseTransportType
|
|
709
|
-
):
|
|
709
|
+
): RPCClientTransport | SSEClientTransport | StreamableHTTPClientTransport;
|
|
710
710
|
private tryConnect;
|
|
711
711
|
private _capabilityErrorHandler;
|
|
712
712
|
}
|
|
@@ -2322,9 +2322,6 @@ declare class Agent<
|
|
|
2322
2322
|
* @throws Error if workflow binding not found in environment
|
|
2323
2323
|
* @throws Error if workflow is already completed/errored/terminated (from Cloudflare)
|
|
2324
2324
|
*
|
|
2325
|
-
* @note `terminate()` is not yet supported in local development (wrangler dev).
|
|
2326
|
-
* It will throw an error locally but works when deployed to Cloudflare.
|
|
2327
|
-
*
|
|
2328
2325
|
* @example
|
|
2329
2326
|
* ```typescript
|
|
2330
2327
|
* await this.terminateWorkflow(workflowId);
|
|
@@ -2340,9 +2337,6 @@ declare class Agent<
|
|
|
2340
2337
|
* @throws Error if workflow binding not found in environment
|
|
2341
2338
|
* @throws Error if workflow is not running (from Cloudflare)
|
|
2342
2339
|
*
|
|
2343
|
-
* @note `pause()` is not yet supported in local development (wrangler dev).
|
|
2344
|
-
* It will throw an error locally but works when deployed to Cloudflare.
|
|
2345
|
-
*
|
|
2346
2340
|
* @example
|
|
2347
2341
|
* ```typescript
|
|
2348
2342
|
* await this.pauseWorkflow(workflowId);
|
|
@@ -2357,9 +2351,6 @@ declare class Agent<
|
|
|
2357
2351
|
* @throws Error if workflow binding not found in environment
|
|
2358
2352
|
* @throws Error if workflow is not paused (from Cloudflare)
|
|
2359
2353
|
*
|
|
2360
|
-
* @note `resume()` is not yet supported in local development (wrangler dev).
|
|
2361
|
-
* It will throw an error locally but works when deployed to Cloudflare.
|
|
2362
|
-
*
|
|
2363
2354
|
* @example
|
|
2364
2355
|
* ```typescript
|
|
2365
2356
|
* await this.resumeWorkflow(workflowId);
|
|
@@ -2377,9 +2368,6 @@ declare class Agent<
|
|
|
2377
2368
|
* @throws Error if workflow not found in tracking table
|
|
2378
2369
|
* @throws Error if workflow binding not found in environment
|
|
2379
2370
|
*
|
|
2380
|
-
* @note `restart()` is not yet supported in local development (wrangler dev).
|
|
2381
|
-
* It will throw an error locally but works when deployed to Cloudflare.
|
|
2382
|
-
*
|
|
2383
2371
|
* @example
|
|
2384
2372
|
* ```typescript
|
|
2385
2373
|
* // Reset tracking (default)
|
|
@@ -2863,4 +2851,4 @@ export {
|
|
|
2863
2851
|
Schedule as y,
|
|
2864
2852
|
MCPServerOptions as z
|
|
2865
2853
|
};
|
|
2866
|
-
//# sourceMappingURL=index-
|
|
2854
|
+
//# sourceMappingURL=index-DE7ndldW.d.ts.map
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -2067,9 +2067,6 @@ var Agent = class Agent extends Server {
|
|
|
2067
2067
|
* @throws Error if workflow binding not found in environment
|
|
2068
2068
|
* @throws Error if workflow is already completed/errored/terminated (from Cloudflare)
|
|
2069
2069
|
*
|
|
2070
|
-
* @note `terminate()` is not yet supported in local development (wrangler dev).
|
|
2071
|
-
* It will throw an error locally but works when deployed to Cloudflare.
|
|
2072
|
-
*
|
|
2073
2070
|
* @example
|
|
2074
2071
|
* ```typescript
|
|
2075
2072
|
* await this.terminateWorkflow(workflowId);
|
|
@@ -2081,16 +2078,11 @@ var Agent = class Agent extends Server {
|
|
|
2081
2078
|
const workflow = this._findWorkflowBindingByName(workflowInfo.workflowName);
|
|
2082
2079
|
if (!workflow) throw new Error(`Workflow binding '${workflowInfo.workflowName}' not found in environment`);
|
|
2083
2080
|
const instance = await workflow.get(workflowId);
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
});
|
|
2090
|
-
} catch (err) {
|
|
2091
|
-
if (err instanceof Error && err.message.includes("Not implemented")) throw new Error("terminateWorkflow() is not supported in local development. Deploy to Cloudflare to use this feature. Follow https://github.com/cloudflare/agents/issues/823 for details and updates.");
|
|
2092
|
-
throw err;
|
|
2093
|
-
}
|
|
2081
|
+
await tryN(3, async () => instance.terminate(), {
|
|
2082
|
+
shouldRetry: isErrorRetryable,
|
|
2083
|
+
baseDelayMs: 200,
|
|
2084
|
+
maxDelayMs: 3e3
|
|
2085
|
+
});
|
|
2094
2086
|
const status = await instance.status();
|
|
2095
2087
|
this._updateWorkflowTracking(workflowId, status);
|
|
2096
2088
|
this._emit("workflow:terminated", {
|
|
@@ -2107,9 +2099,6 @@ var Agent = class Agent extends Server {
|
|
|
2107
2099
|
* @throws Error if workflow binding not found in environment
|
|
2108
2100
|
* @throws Error if workflow is not running (from Cloudflare)
|
|
2109
2101
|
*
|
|
2110
|
-
* @note `pause()` is not yet supported in local development (wrangler dev).
|
|
2111
|
-
* It will throw an error locally but works when deployed to Cloudflare.
|
|
2112
|
-
*
|
|
2113
2102
|
* @example
|
|
2114
2103
|
* ```typescript
|
|
2115
2104
|
* await this.pauseWorkflow(workflowId);
|
|
@@ -2121,16 +2110,11 @@ var Agent = class Agent extends Server {
|
|
|
2121
2110
|
const workflow = this._findWorkflowBindingByName(workflowInfo.workflowName);
|
|
2122
2111
|
if (!workflow) throw new Error(`Workflow binding '${workflowInfo.workflowName}' not found in environment`);
|
|
2123
2112
|
const instance = await workflow.get(workflowId);
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
});
|
|
2130
|
-
} catch (err) {
|
|
2131
|
-
if (err instanceof Error && err.message.includes("Not implemented")) throw new Error("pauseWorkflow() is not supported in local development. Deploy to Cloudflare to use this feature. Follow https://github.com/cloudflare/agents/issues/823 for details and updates.");
|
|
2132
|
-
throw err;
|
|
2133
|
-
}
|
|
2113
|
+
await tryN(3, async () => instance.pause(), {
|
|
2114
|
+
shouldRetry: isErrorRetryable,
|
|
2115
|
+
baseDelayMs: 200,
|
|
2116
|
+
maxDelayMs: 3e3
|
|
2117
|
+
});
|
|
2134
2118
|
const status = await instance.status();
|
|
2135
2119
|
this._updateWorkflowTracking(workflowId, status);
|
|
2136
2120
|
this._emit("workflow:paused", {
|
|
@@ -2146,9 +2130,6 @@ var Agent = class Agent extends Server {
|
|
|
2146
2130
|
* @throws Error if workflow binding not found in environment
|
|
2147
2131
|
* @throws Error if workflow is not paused (from Cloudflare)
|
|
2148
2132
|
*
|
|
2149
|
-
* @note `resume()` is not yet supported in local development (wrangler dev).
|
|
2150
|
-
* It will throw an error locally but works when deployed to Cloudflare.
|
|
2151
|
-
*
|
|
2152
2133
|
* @example
|
|
2153
2134
|
* ```typescript
|
|
2154
2135
|
* await this.resumeWorkflow(workflowId);
|
|
@@ -2160,16 +2141,11 @@ var Agent = class Agent extends Server {
|
|
|
2160
2141
|
const workflow = this._findWorkflowBindingByName(workflowInfo.workflowName);
|
|
2161
2142
|
if (!workflow) throw new Error(`Workflow binding '${workflowInfo.workflowName}' not found in environment`);
|
|
2162
2143
|
const instance = await workflow.get(workflowId);
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
});
|
|
2169
|
-
} catch (err) {
|
|
2170
|
-
if (err instanceof Error && err.message.includes("Not implemented")) throw new Error("resumeWorkflow() is not supported in local development. Deploy to Cloudflare to use this feature. Follow https://github.com/cloudflare/agents/issues/823 for details and updates.");
|
|
2171
|
-
throw err;
|
|
2172
|
-
}
|
|
2144
|
+
await tryN(3, async () => instance.resume(), {
|
|
2145
|
+
shouldRetry: isErrorRetryable,
|
|
2146
|
+
baseDelayMs: 200,
|
|
2147
|
+
maxDelayMs: 3e3
|
|
2148
|
+
});
|
|
2173
2149
|
const status = await instance.status();
|
|
2174
2150
|
this._updateWorkflowTracking(workflowId, status);
|
|
2175
2151
|
this._emit("workflow:resumed", {
|
|
@@ -2188,9 +2164,6 @@ var Agent = class Agent extends Server {
|
|
|
2188
2164
|
* @throws Error if workflow not found in tracking table
|
|
2189
2165
|
* @throws Error if workflow binding not found in environment
|
|
2190
2166
|
*
|
|
2191
|
-
* @note `restart()` is not yet supported in local development (wrangler dev).
|
|
2192
|
-
* It will throw an error locally but works when deployed to Cloudflare.
|
|
2193
|
-
*
|
|
2194
2167
|
* @example
|
|
2195
2168
|
* ```typescript
|
|
2196
2169
|
* // Reset tracking (default)
|
|
@@ -2207,16 +2180,11 @@ var Agent = class Agent extends Server {
|
|
|
2207
2180
|
const workflow = this._findWorkflowBindingByName(workflowInfo.workflowName);
|
|
2208
2181
|
if (!workflow) throw new Error(`Workflow binding '${workflowInfo.workflowName}' not found in environment`);
|
|
2209
2182
|
const instance = await workflow.get(workflowId);
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
});
|
|
2216
|
-
} catch (err) {
|
|
2217
|
-
if (err instanceof Error && err.message.includes("Not implemented")) throw new Error("restartWorkflow() is not supported in local development. Deploy to Cloudflare to use this feature. Follow https://github.com/cloudflare/agents/issues/823 for details and updates.");
|
|
2218
|
-
throw err;
|
|
2219
|
-
}
|
|
2183
|
+
await tryN(3, async () => instance.restart(), {
|
|
2184
|
+
shouldRetry: isErrorRetryable,
|
|
2185
|
+
baseDelayMs: 200,
|
|
2186
|
+
maxDelayMs: 3e3
|
|
2187
|
+
});
|
|
2220
2188
|
if (resetTracking) {
|
|
2221
2189
|
const now = Math.floor(Date.now() / 1e3);
|
|
2222
2190
|
this.sql`
|