@ateam-ai-mobile/core 0.1.28 → 0.1.30
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 +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +23 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/chat/store.ts +2 -1
- package/src/index.ts +1 -0
- package/src/utils/hostIntents.ts +27 -0
package/dist/index.d.mts
CHANGED
|
@@ -859,6 +859,10 @@ declare class PluginCommandEmitter {
|
|
|
859
859
|
/** App-wide bus for plugin commands arriving over the chat stream. */
|
|
860
860
|
declare const pluginCommandEmitter: PluginCommandEmitter;
|
|
861
861
|
|
|
862
|
+
type Intent = (props: any) => void;
|
|
863
|
+
declare function registerHostIntent(pluginId: string, fn: Intent): void;
|
|
864
|
+
declare function focusPlugin(pluginId: string, props?: any): void;
|
|
865
|
+
|
|
862
866
|
declare const colors: {
|
|
863
867
|
readonly dark: {
|
|
864
868
|
readonly bgPrimary: "#0a0e14";
|
|
@@ -1263,4 +1267,4 @@ interface AcsKvStorage {
|
|
|
1263
1267
|
}
|
|
1264
1268
|
declare function setAcsCacheStorage(kv: AcsKvStorage | null): void;
|
|
1265
1269
|
|
|
1266
|
-
export { type AcsArtifact, type AcsDeleteReason, type AcsEvent, type AcsKvStorage, type AcsPatchReason, type AcsReachabilityReporter, type AcsSurface, type AdasConfig, type AdasGateFlags, type AdasPhase, type AdasSession, type AdasUser, type AttachmentCache, type AttachmentPreview, type AuthSession, type AuthSessionDeps, type AuthSessionState, type BufferedCommand, type ChannelPrefs, type ConsumerCapabilityConfig, type ConsumerProviderConfig, type ConsumerSignInResult, type DeleteResult, type DevModeState, type DevicePlatform, type DispatchRow, type HandoffExchangeResult, type HomeAction, type HomeActionLeaf, type HomeActionReason, type InvitePreview, type JobProgress, type Message, type MessageAttachment, type NotifChannel, type NotifPrefs, type OtpStartResult, type OutgoingAttachment, type PatchResult, PluginCommandEmitter, type PushBackend, type PushRegistration, type QuietHoursPrefs, type RefreshOutcome, type RegisterDeviceResponse, type Session, type SessionEnv, type SessionPersistence, type SessionStatus, type SessionUser, TABLE_BLOCK_CLOSE, TABLE_BLOCK_OPEN, type TelegramBotInfo, type TenantMembership, type TokenProvider, type ToolCall, type UIAction, type WorkspaceCapabilities, type WorkspaceSnapshot, type WorkspaceState, ada, apiFetch, apiFetchRaw, blocksToText, borderRadius, capabilityEnabled, closeChatStream, colors, connectAcsWs, connectorCall, createAuthSession, createPushRegistration, deleteArtifact, devModeFromCatalog, disconnectAcsWs, exchangeHandoff, fetchConsumerConfig, fontSize, getConfig, getConsumerAuthApiUrl, getCoreApiUrl, getCoreWsUrl, getPrefs as getNotifPrefs, getTelegramBotInfo as getNotifTelegramBotInfo, getSession, getTenant, getToken, getUser, getVoiceApiUrl, initAdas, isAdasInitialized, isDevHost, joinWithApple, joinWithGoogle, linkChannelStart, linkChannelVerify, linkTelegram as linkNotifTelegram, listHomeActions, listMadeForYou, listMyTenants, listSurface, mcpFetch, mcpToolCall, notifyAcsWsForeground, notifyAppForeground, onAppForeground, openJoinWithApple, openJoinWithGoogle, parseDeepLinkParam, parseHandoffCode, parseInviteCode, patchArtifact, patchHomeAction, pluginCommandEmitter, postCommandResult, previewInvite, readDevMode, recentDispatches as recentNotifDispatches, recordEvent, refreshToken, registerDevice as registerPushDevice, resolveAdasPhase, setAcsCacheStorage, setAcsReachabilityReporter, setClientDeclarationProvider, setDevMode, setHomeActionOrder, setPrefs as setNotifPrefs, setOrder, signInWithApple, signInWithGoogle, spacing, switchTenant, tenantFromToken, unlinkChannel as unlinkNotifChannel, unregisterDevice as unregisterPushDevice, unwrapMcpResult, useCapability, useChatStore, useHomeActionsStore, useWidgetsStore, useWorkspaceStore, userFromJwt };
|
|
1270
|
+
export { type AcsArtifact, type AcsDeleteReason, type AcsEvent, type AcsKvStorage, type AcsPatchReason, type AcsReachabilityReporter, type AcsSurface, type AdasConfig, type AdasGateFlags, type AdasPhase, type AdasSession, type AdasUser, type AttachmentCache, type AttachmentPreview, type AuthSession, type AuthSessionDeps, type AuthSessionState, type BufferedCommand, type ChannelPrefs, type ConsumerCapabilityConfig, type ConsumerProviderConfig, type ConsumerSignInResult, type DeleteResult, type DevModeState, type DevicePlatform, type DispatchRow, type HandoffExchangeResult, type HomeAction, type HomeActionLeaf, type HomeActionReason, type InvitePreview, type JobProgress, type Message, type MessageAttachment, type NotifChannel, type NotifPrefs, type OtpStartResult, type OutgoingAttachment, type PatchResult, PluginCommandEmitter, type PushBackend, type PushRegistration, type QuietHoursPrefs, type RefreshOutcome, type RegisterDeviceResponse, type Session, type SessionEnv, type SessionPersistence, type SessionStatus, type SessionUser, TABLE_BLOCK_CLOSE, TABLE_BLOCK_OPEN, type TelegramBotInfo, type TenantMembership, type TokenProvider, type ToolCall, type UIAction, type WorkspaceCapabilities, type WorkspaceSnapshot, type WorkspaceState, ada, apiFetch, apiFetchRaw, blocksToText, borderRadius, capabilityEnabled, closeChatStream, colors, connectAcsWs, connectorCall, createAuthSession, createPushRegistration, deleteArtifact, devModeFromCatalog, disconnectAcsWs, exchangeHandoff, fetchConsumerConfig, focusPlugin, fontSize, getConfig, getConsumerAuthApiUrl, getCoreApiUrl, getCoreWsUrl, getPrefs as getNotifPrefs, getTelegramBotInfo as getNotifTelegramBotInfo, getSession, getTenant, getToken, getUser, getVoiceApiUrl, initAdas, isAdasInitialized, isDevHost, joinWithApple, joinWithGoogle, linkChannelStart, linkChannelVerify, linkTelegram as linkNotifTelegram, listHomeActions, listMadeForYou, listMyTenants, listSurface, mcpFetch, mcpToolCall, notifyAcsWsForeground, notifyAppForeground, onAppForeground, openJoinWithApple, openJoinWithGoogle, parseDeepLinkParam, parseHandoffCode, parseInviteCode, patchArtifact, patchHomeAction, pluginCommandEmitter, postCommandResult, previewInvite, readDevMode, recentDispatches as recentNotifDispatches, recordEvent, refreshToken, registerHostIntent, registerDevice as registerPushDevice, resolveAdasPhase, setAcsCacheStorage, setAcsReachabilityReporter, setClientDeclarationProvider, setDevMode, setHomeActionOrder, setPrefs as setNotifPrefs, setOrder, signInWithApple, signInWithGoogle, spacing, switchTenant, tenantFromToken, unlinkChannel as unlinkNotifChannel, unregisterDevice as unregisterPushDevice, unwrapMcpResult, useCapability, useChatStore, useHomeActionsStore, useWidgetsStore, useWorkspaceStore, userFromJwt };
|
package/dist/index.d.ts
CHANGED
|
@@ -859,6 +859,10 @@ declare class PluginCommandEmitter {
|
|
|
859
859
|
/** App-wide bus for plugin commands arriving over the chat stream. */
|
|
860
860
|
declare const pluginCommandEmitter: PluginCommandEmitter;
|
|
861
861
|
|
|
862
|
+
type Intent = (props: any) => void;
|
|
863
|
+
declare function registerHostIntent(pluginId: string, fn: Intent): void;
|
|
864
|
+
declare function focusPlugin(pluginId: string, props?: any): void;
|
|
865
|
+
|
|
862
866
|
declare const colors: {
|
|
863
867
|
readonly dark: {
|
|
864
868
|
readonly bgPrimary: "#0a0e14";
|
|
@@ -1263,4 +1267,4 @@ interface AcsKvStorage {
|
|
|
1263
1267
|
}
|
|
1264
1268
|
declare function setAcsCacheStorage(kv: AcsKvStorage | null): void;
|
|
1265
1269
|
|
|
1266
|
-
export { type AcsArtifact, type AcsDeleteReason, type AcsEvent, type AcsKvStorage, type AcsPatchReason, type AcsReachabilityReporter, type AcsSurface, type AdasConfig, type AdasGateFlags, type AdasPhase, type AdasSession, type AdasUser, type AttachmentCache, type AttachmentPreview, type AuthSession, type AuthSessionDeps, type AuthSessionState, type BufferedCommand, type ChannelPrefs, type ConsumerCapabilityConfig, type ConsumerProviderConfig, type ConsumerSignInResult, type DeleteResult, type DevModeState, type DevicePlatform, type DispatchRow, type HandoffExchangeResult, type HomeAction, type HomeActionLeaf, type HomeActionReason, type InvitePreview, type JobProgress, type Message, type MessageAttachment, type NotifChannel, type NotifPrefs, type OtpStartResult, type OutgoingAttachment, type PatchResult, PluginCommandEmitter, type PushBackend, type PushRegistration, type QuietHoursPrefs, type RefreshOutcome, type RegisterDeviceResponse, type Session, type SessionEnv, type SessionPersistence, type SessionStatus, type SessionUser, TABLE_BLOCK_CLOSE, TABLE_BLOCK_OPEN, type TelegramBotInfo, type TenantMembership, type TokenProvider, type ToolCall, type UIAction, type WorkspaceCapabilities, type WorkspaceSnapshot, type WorkspaceState, ada, apiFetch, apiFetchRaw, blocksToText, borderRadius, capabilityEnabled, closeChatStream, colors, connectAcsWs, connectorCall, createAuthSession, createPushRegistration, deleteArtifact, devModeFromCatalog, disconnectAcsWs, exchangeHandoff, fetchConsumerConfig, fontSize, getConfig, getConsumerAuthApiUrl, getCoreApiUrl, getCoreWsUrl, getPrefs as getNotifPrefs, getTelegramBotInfo as getNotifTelegramBotInfo, getSession, getTenant, getToken, getUser, getVoiceApiUrl, initAdas, isAdasInitialized, isDevHost, joinWithApple, joinWithGoogle, linkChannelStart, linkChannelVerify, linkTelegram as linkNotifTelegram, listHomeActions, listMadeForYou, listMyTenants, listSurface, mcpFetch, mcpToolCall, notifyAcsWsForeground, notifyAppForeground, onAppForeground, openJoinWithApple, openJoinWithGoogle, parseDeepLinkParam, parseHandoffCode, parseInviteCode, patchArtifact, patchHomeAction, pluginCommandEmitter, postCommandResult, previewInvite, readDevMode, recentDispatches as recentNotifDispatches, recordEvent, refreshToken, registerDevice as registerPushDevice, resolveAdasPhase, setAcsCacheStorage, setAcsReachabilityReporter, setClientDeclarationProvider, setDevMode, setHomeActionOrder, setPrefs as setNotifPrefs, setOrder, signInWithApple, signInWithGoogle, spacing, switchTenant, tenantFromToken, unlinkChannel as unlinkNotifChannel, unregisterDevice as unregisterPushDevice, unwrapMcpResult, useCapability, useChatStore, useHomeActionsStore, useWidgetsStore, useWorkspaceStore, userFromJwt };
|
|
1270
|
+
export { type AcsArtifact, type AcsDeleteReason, type AcsEvent, type AcsKvStorage, type AcsPatchReason, type AcsReachabilityReporter, type AcsSurface, type AdasConfig, type AdasGateFlags, type AdasPhase, type AdasSession, type AdasUser, type AttachmentCache, type AttachmentPreview, type AuthSession, type AuthSessionDeps, type AuthSessionState, type BufferedCommand, type ChannelPrefs, type ConsumerCapabilityConfig, type ConsumerProviderConfig, type ConsumerSignInResult, type DeleteResult, type DevModeState, type DevicePlatform, type DispatchRow, type HandoffExchangeResult, type HomeAction, type HomeActionLeaf, type HomeActionReason, type InvitePreview, type JobProgress, type Message, type MessageAttachment, type NotifChannel, type NotifPrefs, type OtpStartResult, type OutgoingAttachment, type PatchResult, PluginCommandEmitter, type PushBackend, type PushRegistration, type QuietHoursPrefs, type RefreshOutcome, type RegisterDeviceResponse, type Session, type SessionEnv, type SessionPersistence, type SessionStatus, type SessionUser, TABLE_BLOCK_CLOSE, TABLE_BLOCK_OPEN, type TelegramBotInfo, type TenantMembership, type TokenProvider, type ToolCall, type UIAction, type WorkspaceCapabilities, type WorkspaceSnapshot, type WorkspaceState, ada, apiFetch, apiFetchRaw, blocksToText, borderRadius, capabilityEnabled, closeChatStream, colors, connectAcsWs, connectorCall, createAuthSession, createPushRegistration, deleteArtifact, devModeFromCatalog, disconnectAcsWs, exchangeHandoff, fetchConsumerConfig, focusPlugin, fontSize, getConfig, getConsumerAuthApiUrl, getCoreApiUrl, getCoreWsUrl, getPrefs as getNotifPrefs, getTelegramBotInfo as getNotifTelegramBotInfo, getSession, getTenant, getToken, getUser, getVoiceApiUrl, initAdas, isAdasInitialized, isDevHost, joinWithApple, joinWithGoogle, linkChannelStart, linkChannelVerify, linkTelegram as linkNotifTelegram, listHomeActions, listMadeForYou, listMyTenants, listSurface, mcpFetch, mcpToolCall, notifyAcsWsForeground, notifyAppForeground, onAppForeground, openJoinWithApple, openJoinWithGoogle, parseDeepLinkParam, parseHandoffCode, parseInviteCode, patchArtifact, patchHomeAction, pluginCommandEmitter, postCommandResult, previewInvite, readDevMode, recentDispatches as recentNotifDispatches, recordEvent, refreshToken, registerHostIntent, registerDevice as registerPushDevice, resolveAdasPhase, setAcsCacheStorage, setAcsReachabilityReporter, setClientDeclarationProvider, setDevMode, setHomeActionOrder, setPrefs as setNotifPrefs, setOrder, signInWithApple, signInWithGoogle, spacing, switchTenant, tenantFromToken, unlinkChannel as unlinkNotifChannel, unregisterDevice as unregisterPushDevice, unwrapMcpResult, useCapability, useChatStore, useHomeActionsStore, useWidgetsStore, useWorkspaceStore, userFromJwt };
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,7 @@ __export(index_exports, {
|
|
|
40
40
|
disconnectAcsWs: () => disconnectAcsWs,
|
|
41
41
|
exchangeHandoff: () => exchangeHandoff,
|
|
42
42
|
fetchConsumerConfig: () => fetchConsumerConfig,
|
|
43
|
+
focusPlugin: () => focusPlugin,
|
|
43
44
|
fontSize: () => fontSize,
|
|
44
45
|
getConfig: () => getConfig,
|
|
45
46
|
getConsumerAuthApiUrl: () => getConsumerAuthApiUrl,
|
|
@@ -83,6 +84,7 @@ __export(index_exports, {
|
|
|
83
84
|
recentNotifDispatches: () => recentDispatches,
|
|
84
85
|
recordEvent: () => recordEvent,
|
|
85
86
|
refreshToken: () => refreshToken,
|
|
87
|
+
registerHostIntent: () => registerHostIntent,
|
|
86
88
|
registerPushDevice: () => registerDevice,
|
|
87
89
|
resolveAdasPhase: () => resolveAdasPhase,
|
|
88
90
|
setAcsCacheStorage: () => setAcsCacheStorage,
|
|
@@ -1440,6 +1442,24 @@ var PluginCommandEmitter = class {
|
|
|
1440
1442
|
};
|
|
1441
1443
|
var pluginCommandEmitter = new PluginCommandEmitter();
|
|
1442
1444
|
|
|
1445
|
+
// src/utils/hostIntents.ts
|
|
1446
|
+
var intents = /* @__PURE__ */ new Map();
|
|
1447
|
+
function registerHostIntent(pluginId, fn) {
|
|
1448
|
+
intents.set(pluginId, fn);
|
|
1449
|
+
}
|
|
1450
|
+
function focusPlugin(pluginId, props) {
|
|
1451
|
+
const intent = intents.get(pluginId);
|
|
1452
|
+
if (intent) {
|
|
1453
|
+
try {
|
|
1454
|
+
intent(props && typeof props === "object" ? props : {});
|
|
1455
|
+
} catch (e) {
|
|
1456
|
+
console.warn(`[hostIntent] ${pluginId} failed:`, e?.message || e);
|
|
1457
|
+
}
|
|
1458
|
+
return;
|
|
1459
|
+
}
|
|
1460
|
+
pluginCommandEmitter.emit("focus-plugin", { pluginId, props });
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1443
1463
|
// src/chat/store.ts
|
|
1444
1464
|
function coreHeaders() {
|
|
1445
1465
|
const token = getToken();
|
|
@@ -1943,7 +1963,7 @@ function dispatchPluginCommands(cmds) {
|
|
|
1943
1963
|
const pluginId = cmd?.pluginId || cmd?.plugin_id || cmd?.args?.plugin_id;
|
|
1944
1964
|
if (pluginId) {
|
|
1945
1965
|
const props = cmd?.props ?? cmd?.args?.props ?? void 0;
|
|
1946
|
-
|
|
1966
|
+
focusPlugin(pluginId, props);
|
|
1947
1967
|
}
|
|
1948
1968
|
}
|
|
1949
1969
|
}
|
|
@@ -2318,6 +2338,7 @@ var borderRadius = {
|
|
|
2318
2338
|
disconnectAcsWs,
|
|
2319
2339
|
exchangeHandoff,
|
|
2320
2340
|
fetchConsumerConfig,
|
|
2341
|
+
focusPlugin,
|
|
2321
2342
|
fontSize,
|
|
2322
2343
|
getConfig,
|
|
2323
2344
|
getConsumerAuthApiUrl,
|
|
@@ -2361,6 +2382,7 @@ var borderRadius = {
|
|
|
2361
2382
|
recentNotifDispatches,
|
|
2362
2383
|
recordEvent,
|
|
2363
2384
|
refreshToken,
|
|
2385
|
+
registerHostIntent,
|
|
2364
2386
|
registerPushDevice,
|
|
2365
2387
|
resolveAdasPhase,
|
|
2366
2388
|
setAcsCacheStorage,
|