@ateam-ai-mobile/core 0.1.13 → 0.1.15

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.mjs CHANGED
@@ -206,12 +206,23 @@ function devModeFromCatalog(catalog) {
206
206
  // src/devMode.ts
207
207
  var SOLUTION_DEV_MODE = "SOLUTION_DEV_MODE";
208
208
  var NORMAL_USER_MODE = "NORMAL_USER_MODE";
209
+ function feApi(method, params) {
210
+ return apiFetch("/mcp", {
211
+ method: "POST",
212
+ body: JSON.stringify({
213
+ jsonrpc: "2.0",
214
+ id: Date.now(),
215
+ method: "tools/call",
216
+ params: { name: "cp.fe_api", arguments: { method, params } }
217
+ })
218
+ });
219
+ }
209
220
  async function readDevMode() {
210
- const resp = await mcpToolCall("cp.fe_api", { method: "listCommands", params: {} });
221
+ const resp = await feApi("listCommands", {});
211
222
  return devModeFromCatalog(unwrapMcpResult(resp?.result));
212
223
  }
213
224
  async function setDevMode(on) {
214
- const resp = await mcpToolCall("cp.fe_api", { method: "setMode", params: { mode: on ? SOLUTION_DEV_MODE : NORMAL_USER_MODE } });
225
+ const resp = await feApi("setMode", { mode: on ? SOLUTION_DEV_MODE : NORMAL_USER_MODE });
215
226
  const out = unwrapMcpResult(resp?.result);
216
227
  if (out?.ok === false) throw new Error(out.error || "Could not change the mode");
217
228
  if (resp?.error) throw new Error(resp.error.message || "Could not change the mode");