@ateam-ai-mobile/core 0.1.11 → 0.1.13
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.mts +31 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/devMode.ts +25 -0
- package/src/devModeState.ts +32 -0
- package/src/index.ts +5 -0
package/dist/index.mjs
CHANGED
|
@@ -191,6 +191,33 @@ function unwrapMcpResult(result) {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
+
// src/devModeState.ts
|
|
195
|
+
function devModeFromCatalog(catalog) {
|
|
196
|
+
const entry = Array.isArray(catalog?.commands) ? catalog.commands.find((c) => c?.command === "mode") : null;
|
|
197
|
+
if (!entry) return null;
|
|
198
|
+
const active = entry.state?.active === true;
|
|
199
|
+
return {
|
|
200
|
+
available: entry.available !== false,
|
|
201
|
+
active,
|
|
202
|
+
expiresAt: active && typeof entry.state?.expires_at === "string" ? entry.state.expires_at : null
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// src/devMode.ts
|
|
207
|
+
var SOLUTION_DEV_MODE = "SOLUTION_DEV_MODE";
|
|
208
|
+
var NORMAL_USER_MODE = "NORMAL_USER_MODE";
|
|
209
|
+
async function readDevMode() {
|
|
210
|
+
const resp = await mcpToolCall("cp.fe_api", { method: "listCommands", params: {} });
|
|
211
|
+
return devModeFromCatalog(unwrapMcpResult(resp?.result));
|
|
212
|
+
}
|
|
213
|
+
async function setDevMode(on) {
|
|
214
|
+
const resp = await mcpToolCall("cp.fe_api", { method: "setMode", params: { mode: on ? SOLUTION_DEV_MODE : NORMAL_USER_MODE } });
|
|
215
|
+
const out = unwrapMcpResult(resp?.result);
|
|
216
|
+
if (out?.ok === false) throw new Error(out.error || "Could not change the mode");
|
|
217
|
+
if (resp?.error) throw new Error(resp.error.message || "Could not change the mode");
|
|
218
|
+
return devModeFromCatalog(out);
|
|
219
|
+
}
|
|
220
|
+
|
|
194
221
|
// src/session.ts
|
|
195
222
|
function hostOf(u) {
|
|
196
223
|
if (!u) return "";
|
|
@@ -2100,6 +2127,7 @@ export {
|
|
|
2100
2127
|
createAuthSession,
|
|
2101
2128
|
createPushRegistration,
|
|
2102
2129
|
deleteArtifact,
|
|
2130
|
+
devModeFromCatalog,
|
|
2103
2131
|
disconnectAcsWs,
|
|
2104
2132
|
exchangeHandoff,
|
|
2105
2133
|
fetchConsumerConfig,
|
|
@@ -2139,12 +2167,14 @@ export {
|
|
|
2139
2167
|
pluginCommandEmitter,
|
|
2140
2168
|
postCommandResult,
|
|
2141
2169
|
previewInvite,
|
|
2170
|
+
readDevMode,
|
|
2142
2171
|
recordEvent,
|
|
2143
2172
|
refreshToken,
|
|
2144
2173
|
resolveAdasPhase,
|
|
2145
2174
|
setAcsCacheStorage,
|
|
2146
2175
|
setAcsReachabilityReporter,
|
|
2147
2176
|
setClientDeclarationProvider,
|
|
2177
|
+
setDevMode,
|
|
2148
2178
|
setHomeActionOrder,
|
|
2149
2179
|
setOrder,
|
|
2150
2180
|
signInWithApple,
|