@mastra/client-js 1.16.1-alpha.0 → 1.17.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4,4 +4,5 @@ export * from './tools.js';
4
4
  export type { ChannelPlatformInfo, ChannelInstallationInfo, ChannelConnectOAuth, ChannelConnectDeepLink, ChannelConnectImmediate, ChannelConnectResult, } from './resources/channels.js';
5
5
  export { RequestContext } from '@mastra/core/request-context';
6
6
  export type { UIMessageWithMetadata } from '@mastra/core/agent';
7
+ export type { Body, Client, ClientMethod, ClientPath, ClientRequest, ClientResponse, ClientResponseKind, ClientRoute, PathParams, QueryParams, RouteKey, RouteRequest, RouteResponse, RouteResponseType, RouteTypes, } from './route-types.generated.js';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,YAAY,EACV,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,UAAU,GACX,MAAM,4BAA4B,CAAC"}
package/dist/index.js CHANGED
@@ -1187,15 +1187,15 @@ var Agent = class extends BaseResource {
1187
1187
  }
1188
1188
  case "step-finish": {
1189
1189
  step += 1;
1190
- currentTextPart = chunk.payload.stepResult.isContinued ? currentTextPart : void 0;
1190
+ currentTextPart = chunk.payload?.stepResult?.isContinued ? currentTextPart : void 0;
1191
1191
  currentReasoningPart = void 0;
1192
1192
  currentReasoningTextDetail = void 0;
1193
1193
  execUpdate();
1194
1194
  break;
1195
1195
  }
1196
1196
  case "finish": {
1197
- finishReason = chunk.payload.stepResult.reason;
1198
- if (chunk.payload.usage != null) {
1197
+ finishReason = chunk.payload?.stepResult?.reason ?? finishReason;
1198
+ if (chunk.payload?.usage != null) {
1199
1199
  usage = chunk.payload.usage;
1200
1200
  }
1201
1201
  break;
@@ -2007,7 +2007,7 @@ var Vector = class extends BaseResource {
2007
2007
  /**
2008
2008
  * Upserts vectors into an index
2009
2009
  * @param params - Parameters containing vectors, metadata, and optional IDs
2010
- * @returns Promise containing array of vector IDs
2010
+ * @returns Promise containing the inserted vector IDs
2011
2011
  */
2012
2012
  upsert(params) {
2013
2013
  return this.request(`/vector/${encodeURIComponent(this.vectorName)}/upsert`, {
@@ -6206,6 +6206,49 @@ var MastraClient = class extends BaseResource {
6206
6206
  })
6207
6207
  );
6208
6208
  }
6209
+ /**
6210
+ * Lists workflow schedules with optional filtering by workflowId or status.
6211
+ */
6212
+ listSchedules(params = {}) {
6213
+ const searchParams = new URLSearchParams();
6214
+ if (params.workflowId) searchParams.set("workflowId", params.workflowId);
6215
+ if (params.status) searchParams.set("status", params.status);
6216
+ const qs = searchParams.toString();
6217
+ return this.request(`/schedules${qs ? `?${qs}` : ""}`);
6218
+ }
6219
+ /**
6220
+ * Gets a single schedule by ID.
6221
+ */
6222
+ getSchedule(scheduleId) {
6223
+ return this.request(`/schedules/${encodeURIComponent(scheduleId)}`);
6224
+ }
6225
+ /**
6226
+ * Lists trigger history for a schedule, ordered by actualFireAt descending.
6227
+ */
6228
+ listScheduleTriggers(scheduleId, params = {}) {
6229
+ const searchParams = new URLSearchParams();
6230
+ if (params.limit !== void 0) searchParams.set("limit", String(params.limit));
6231
+ if (params.fromActualFireAt !== void 0) searchParams.set("fromActualFireAt", String(params.fromActualFireAt));
6232
+ if (params.toActualFireAt !== void 0) searchParams.set("toActualFireAt", String(params.toActualFireAt));
6233
+ const qs = searchParams.toString();
6234
+ return this.request(`/schedules/${encodeURIComponent(scheduleId)}/triggers${qs ? `?${qs}` : ""}`);
6235
+ }
6236
+ /**
6237
+ * Pauses a schedule. The scheduler tick loop will skip paused schedules.
6238
+ * Idempotent — pausing an already-paused schedule returns the current state unchanged.
6239
+ * Pause status survives redeploys.
6240
+ */
6241
+ pauseSchedule(scheduleId) {
6242
+ return this.request(`/schedules/${encodeURIComponent(scheduleId)}/pause`, { method: "POST" });
6243
+ }
6244
+ /**
6245
+ * Resumes a paused schedule. Recomputes nextFireAt from "now" so a long-paused schedule
6246
+ * does not fire a backlog. Idempotent — resuming an already-active schedule returns
6247
+ * the current state unchanged.
6248
+ */
6249
+ resumeSchedule(scheduleId) {
6250
+ return this.request(`/schedules/${encodeURIComponent(scheduleId)}/resume`, { method: "POST" });
6251
+ }
6209
6252
  };
6210
6253
 
6211
6254
  // src/tools.ts