@mastra/client-js 1.51.0-alpha.6 → 1.51.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.
@@ -3,7 +3,7 @@ name: mastra-client-js
3
3
  description: Documentation for @mastra/client-js. Use when working with @mastra/client-js APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/client-js"
6
- version: "1.51.0-alpha.6"
6
+ version: "1.51.0-alpha.7"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.51.0-alpha.6",
2
+ "version": "1.51.0-alpha.7",
3
3
  "package": "@mastra/client-js",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -270,7 +270,7 @@ session.subscribe(event => {
270
270
  })
271
271
  ```
272
272
 
273
- The `always_allow_category` decision grants the tool category for the rest of the live Session. Session grants aren't durable process-level permissions.
273
+ The `always_allow_category` decision grants the tool category for the gate's thread. Grants aren't durable process-level permissions.
274
274
 
275
275
  Interactive tools such as [`ask_user`](https://mastra.ai/reference/tools/ask-user-tool) and [`submit_plan`](https://mastra.ai/reference/tools/submit-plan-tool) use resumable tool suspensions instead. Resume them with [`session.respondToToolSuspension()`](https://mastra.ai/reference/agent-controller/session):
276
276
 
package/dist/index.cjs CHANGED
@@ -3249,7 +3249,7 @@ var Run = class extends BaseResource {
3249
3249
  * @deprecated Use `cancel()` instead
3250
3250
  */
3251
3251
  cancelRun() {
3252
- return this.request(`/workflows/${this.workflowId}/runs/${this.runId}/cancel`, { method: "POST" });
3252
+ return this.request(`/workflows/${this.workflowId}/runs/${encodeURIComponent(this.runId)}/cancel`, { method: "POST" });
3253
3253
  }
3254
3254
  /**
3255
3255
  * Cancels a workflow run.
@@ -3313,7 +3313,7 @@ var Run = class extends BaseResource {
3313
3313
  * ```
3314
3314
  */
3315
3315
  cancel() {
3316
- return this.request(`/workflows/${this.workflowId}/runs/${this.runId}/cancel`, { method: "POST" });
3316
+ return this.request(`/workflows/${this.workflowId}/runs/${encodeURIComponent(this.runId)}/cancel`, { method: "POST" });
3317
3317
  }
3318
3318
  /**
3319
3319
  * Starts a workflow run synchronously without waiting for the workflow to complete
@@ -3322,7 +3322,7 @@ var Run = class extends BaseResource {
3322
3322
  */
3323
3323
  start(params) {
3324
3324
  const requestContext = parseClientRequestContext(params.requestContext);
3325
- return this.request(`/workflows/${this.workflowId}/start?runId=${this.runId}`, {
3325
+ return this.request(`/workflows/${this.workflowId}/start?runId=${encodeURIComponent(this.runId)}`, {
3326
3326
  method: "POST",
3327
3327
  body: {
3328
3328
  inputData: params?.inputData,
@@ -3340,7 +3340,7 @@ var Run = class extends BaseResource {
3340
3340
  */
3341
3341
  resume({ step, resumeData, tracingOptions, perStep, forEachIndex, ...rest }) {
3342
3342
  const requestContext = parseClientRequestContext(rest.requestContext);
3343
- return this.request(`/workflows/${this.workflowId}/resume?runId=${this.runId}`, {
3343
+ return this.request(`/workflows/${this.workflowId}/resume?runId=${encodeURIComponent(this.runId)}`, {
3344
3344
  method: "POST",
3345
3345
  body: {
3346
3346
  step,
@@ -3443,7 +3443,7 @@ var Run = class extends BaseResource {
3443
3443
  */
3444
3444
  resumeAsync(params) {
3445
3445
  const requestContext = parseClientRequestContext(params.requestContext);
3446
- return this.request(`/workflows/${this.workflowId}/resume-async?runId=${this.runId}`, {
3446
+ return this.request(`/workflows/${this.workflowId}/resume-async?runId=${encodeURIComponent(this.runId)}`, {
3447
3447
  method: "POST",
3448
3448
  body: {
3449
3449
  step: params.step,
@@ -3472,7 +3472,7 @@ var Run = class extends BaseResource {
3472
3472
  */
3473
3473
  resumeNoWait(params) {
3474
3474
  const requestContext = parseClientRequestContext(params.requestContext);
3475
- return this.request(`/workflows/${this.workflowId}/resume-no-wait?runId=${this.runId}`, {
3475
+ return this.request(`/workflows/${this.workflowId}/resume-no-wait?runId=${encodeURIComponent(this.runId)}`, {
3476
3476
  method: "POST",
3477
3477
  body: {
3478
3478
  step: params.step,
@@ -3516,7 +3516,7 @@ var Run = class extends BaseResource {
3516
3516
  */
3517
3517
  restart(params) {
3518
3518
  const requestContext = parseClientRequestContext(params.requestContext);
3519
- return this.request(`/workflows/${this.workflowId}/restart?runId=${this.runId}`, {
3519
+ return this.request(`/workflows/${this.workflowId}/restart?runId=${encodeURIComponent(this.runId)}`, {
3520
3520
  method: "POST",
3521
3521
  body: {
3522
3522
  requestContext,
@@ -3531,7 +3531,7 @@ var Run = class extends BaseResource {
3531
3531
  */
3532
3532
  restartAsync(params) {
3533
3533
  const requestContext = parseClientRequestContext(params?.requestContext);
3534
- return this.request(`/workflows/${this.workflowId}/restart-async?runId=${this.runId}`, {
3534
+ return this.request(`/workflows/${this.workflowId}/restart-async?runId=${encodeURIComponent(this.runId)}`, {
3535
3535
  method: "POST",
3536
3536
  body: {
3537
3537
  requestContext,
@@ -3546,7 +3546,7 @@ var Run = class extends BaseResource {
3546
3546
  */
3547
3547
  timeTravel({ requestContext: paramsRequestContext, ...params }) {
3548
3548
  const requestContext = parseClientRequestContext(paramsRequestContext);
3549
- return this.request(`/workflows/${this.workflowId}/time-travel?runId=${this.runId}`, {
3549
+ return this.request(`/workflows/${this.workflowId}/time-travel?runId=${encodeURIComponent(this.runId)}`, {
3550
3550
  method: "POST",
3551
3551
  body: {
3552
3552
  ...params,
@@ -3561,7 +3561,7 @@ var Run = class extends BaseResource {
3561
3561
  */
3562
3562
  timeTravelAsync({ requestContext: paramsRequestContext, ...params }) {
3563
3563
  const requestContext = parseClientRequestContext(paramsRequestContext);
3564
- return this.request(`/workflows/${this.workflowId}/time-travel-async?runId=${this.runId}`, {
3564
+ return this.request(`/workflows/${this.workflowId}/time-travel-async?runId=${encodeURIComponent(this.runId)}`, {
3565
3565
  method: "POST",
3566
3566
  body: {
3567
3567
  ...params,
@@ -3576,7 +3576,7 @@ var Run = class extends BaseResource {
3576
3576
  */
3577
3577
  async timeTravelStream({ requestContext: paramsRequestContext, ...params }) {
3578
3578
  const requestContext = parseClientRequestContext(paramsRequestContext);
3579
- const response = await this.request(`/workflows/${this.workflowId}/time-travel-stream?runId=${this.runId}`, {
3579
+ const response = await this.request(`/workflows/${this.workflowId}/time-travel-stream?runId=${encodeURIComponent(this.runId)}`, {
3580
3580
  method: "POST",
3581
3581
  body: {
3582
3582
  ...params,
@@ -3647,7 +3647,7 @@ var Workflow = class extends BaseResource {
3647
3647
  const requestContextParam = base64RequestContext(parseClientRequestContext(options?.requestContext));
3648
3648
  if (requestContextParam) searchParams.set("requestContext", requestContextParam);
3649
3649
  const queryString = searchParams.size > 0 ? `?${searchParams.toString()}` : "";
3650
- return this.request(`/workflows/${this.workflowId}/runs/${runId}${queryString}`);
3650
+ return this.request(`/workflows/${this.workflowId}/runs/${encodeURIComponent(runId)}${queryString}`);
3651
3651
  }
3652
3652
  /**
3653
3653
  * Deletes a specific workflow run by its ID
@@ -3655,7 +3655,7 @@ var Workflow = class extends BaseResource {
3655
3655
  * @returns Promise containing a success message
3656
3656
  */
3657
3657
  deleteRunById(runId) {
3658
- return this.request(`/workflows/${this.workflowId}/runs/${runId}`, { method: "DELETE" });
3658
+ return this.request(`/workflows/${this.workflowId}/runs/${encodeURIComponent(runId)}`, { method: "DELETE" });
3659
3659
  }
3660
3660
  /**
3661
3661
  * Retrieves the input/output schema for the workflow