@m8tes/sdk 0.1.0-alpha.6 → 0.1.0-alpha.7

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 CHANGED
@@ -1275,7 +1275,9 @@ function createHttp(options = {}) {
1275
1275
  return send(method, path, opts);
1276
1276
  },
1277
1277
  async *stream(method, path, opts = {}) {
1278
- const res = await send(method, path, opts, { conflictIsNotStreaming: true });
1278
+ const res = await send(method, path, opts, {
1279
+ conflictIsNotStreaming: method === "GET"
1280
+ });
1279
1281
  if (opts.onReplay && res.headers.get(REPLAY_HEADER)) {
1280
1282
  const run = await res.json();
1281
1283
  yield* opts.onReplay(run);
@@ -2067,6 +2069,10 @@ function withRunId(err, runId) {
2067
2069
  }
2068
2070
  return err;
2069
2071
  }
2072
+ function replyBody(message, options) {
2073
+ const { raiseOnError: _raiseOnError, idempotencyKey: _idempotencyKey, ...overrides } = options ?? {};
2074
+ return toBody({ ...overrides, message, stream: true });
2075
+ }
2070
2076
  function items(payload) {
2071
2077
  return Array.isArray(payload) ? payload : payload?.data ?? [];
2072
2078
  }
@@ -2170,7 +2176,7 @@ function createRunsResource(http) {
2170
2176
  reply(runId, message, options) {
2171
2177
  return new RunStream(
2172
2178
  http.stream("POST", `/runs/${seg(runId)}/reply`, {
2173
- body: { message },
2179
+ body: replyBody(message, options),
2174
2180
  headers: idempotencyHeaders(options?.idempotencyKey),
2175
2181
  onReplay: replayJoin(http)
2176
2182
  }),
@@ -2409,7 +2415,7 @@ function createWebhooksResource(http) {
2409
2415
  }
2410
2416
 
2411
2417
  // src/index.ts
2412
- var M8TES_SDK_VERSION = "0.1.0-alpha.6";
2418
+ var M8TES_SDK_VERSION = "0.1.0-alpha.7";
2413
2419
  var M8tes = class {
2414
2420
  runs;
2415
2421
  agents;