@mastra/client-js 1.40.1-alpha.7 → 1.41.0-alpha.8

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.js CHANGED
@@ -860,6 +860,15 @@ var Agent = class extends BaseResource {
860
860
  return this.request(`/agents/${this.agentId}${this.getQueryString(requestContext)}`);
861
861
  }
862
862
  /**
863
+ * Reads a markdown plan submitted by this agent through the core submit_plan tool.
864
+ * The server only serves paths under `.mastracode/plans/` and only when the
865
+ * agent exposes that capability.
866
+ */
867
+ readPlan(path, requestContext) {
868
+ const contextQuery = this.getQueryString(requestContext, "&");
869
+ return this.request(`/agents/${this.agentId}/plans/file?path=${encodeURIComponent(path)}${contextQuery}`);
870
+ }
871
+ /**
863
872
  * Probe the agent's browser session state before opening a screencast WebSocket.
864
873
  *
865
874
  * Returns `{ hasSession, screencastAvailable }`. Use this to avoid opening a WS
@@ -5965,8 +5974,9 @@ var AgentControllerSession = class extends BaseResource {
5965
5974
  });
5966
5975
  }
5967
5976
  /** Get the current mode, model, and thread (for initial UI hydration). */
5968
- state() {
5969
- return this.request(this.url(this.base()));
5977
+ state(options) {
5978
+ const path = options?.threadId ? `${this.base()}?threadId=${encodeURIComponent(options.threadId)}` : this.base();
5979
+ return this.request(this.url(path));
5970
5980
  }
5971
5981
  /** Merge key-value pairs into the session state. Existing keys not in the payload are preserved. */
5972
5982
  async setState(updates) {