@ateam-ai-mobile/core 0.1.40 → 0.1.42
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 +25 -1
- package/dist/index.d.ts +25 -1
- package/dist/index.js +43 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/chat/liveGoals.ts +39 -0
- package/src/chat/sideChat.ts +9 -2
- package/src/chat/store.ts +10 -2
- package/src/chat/types.ts +5 -1
- package/src/index.ts +2 -0
package/dist/index.d.mts
CHANGED
|
@@ -767,6 +767,25 @@ declare function listMyTenants(): Promise<TenantMembership[]>;
|
|
|
767
767
|
*/
|
|
768
768
|
declare function switchTenant(targetTenantId: string): Promise<AdasSession>;
|
|
769
769
|
|
|
770
|
+
type GoalWire = {
|
|
771
|
+
l: [string, string, string][];
|
|
772
|
+
c?: string | null;
|
|
773
|
+
};
|
|
774
|
+
type JobGoals = {
|
|
775
|
+
l: [string, string, string][];
|
|
776
|
+
c: string | null;
|
|
777
|
+
tools: Record<string, string[]>;
|
|
778
|
+
lastKey?: string;
|
|
779
|
+
ids?: string;
|
|
780
|
+
};
|
|
781
|
+
type GoalRow = {
|
|
782
|
+
id: string;
|
|
783
|
+
title: string;
|
|
784
|
+
state: 'done' | 'current' | 'todo';
|
|
785
|
+
tools: string[];
|
|
786
|
+
};
|
|
787
|
+
declare function goalRows(goals: JobGoals | undefined): GoalRow[];
|
|
788
|
+
|
|
770
789
|
interface ToolCall {
|
|
771
790
|
name: string;
|
|
772
791
|
args: Record<string, unknown>;
|
|
@@ -795,6 +814,7 @@ interface JobProgress {
|
|
|
795
814
|
message: string;
|
|
796
815
|
step?: number;
|
|
797
816
|
total?: number;
|
|
817
|
+
seq?: number;
|
|
798
818
|
};
|
|
799
819
|
/** One warm, present-tense, localized line describing the current action
|
|
800
820
|
* (backend statusI18n). Absent when disabled / not yet cached → fall back
|
|
@@ -802,6 +822,10 @@ interface JobProgress {
|
|
|
802
822
|
humanStatus?: string;
|
|
803
823
|
/** Lookup { rawToken → friendly phrase } for tokens in this snapshot. */
|
|
804
824
|
humanLabels?: Record<string, string>;
|
|
825
|
+
/** The job's goal checklist, built from the goals Core streams on the job message plus the live `→ tool` line (chat/liveGoals.ts). */
|
|
826
|
+
goals?: JobGoals;
|
|
827
|
+
/** The raw `goals` of ONE job message, in transit from snapshotToProgress to updateJobProgress (which folds it into `goals` and drops it). */
|
|
828
|
+
goalsWire?: GoalWire;
|
|
805
829
|
pendingQuestion?: {
|
|
806
830
|
inputId: string;
|
|
807
831
|
question: string;
|
|
@@ -1615,4 +1639,4 @@ interface AcsKvStorage {
|
|
|
1615
1639
|
}
|
|
1616
1640
|
declare function setAcsCacheStorage(kv: AcsKvStorage | null): void;
|
|
1617
1641
|
|
|
1618
|
-
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 BlockSegment, type BufferedCommand, CHART_BLOCK_CLOSE, CHART_BLOCK_OPEN, COMPARISON_BLOCK_CLOSE, COMPARISON_BLOCK_OPEN, type ChannelPrefs, type ChartSeries, type ChartView, type ComparisonOption, type ComparisonRow, type ComparisonView, type ConsumerCapabilityConfig, type ConsumerProviderConfig, type ConsumerSignInResult, type ConversationBlock, DETAILS_BLOCK_CLOSE, DETAILS_BLOCK_OPEN, DIAGRAM_BLOCK_CLOSE, DIAGRAM_BLOCK_OPEN, DIAGRAM_STATUSES, type DeleteResult, type DevModeState, type DevicePlatform, type DiagramFlow, type DiagramStatus, type DiagramStep, type DiagramView, type DispatchRow, type FileUploadRequest, type FileUploader, type HandoffExchangeResult, type HomeAction, type HomeActionLeaf, type HomeActionReason, type InvitePreview, type JobProgress, type LauncherPlace, type LauncherPlaces, MAX_ATTACHMENT_BYTES, MAX_INLINE_ATTACHMENT_BYTES, 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, SIDE_CHAT_LIMITS, type Session, type SessionEnv, type SessionPersistence, type SessionStatus, type SessionUser, type SideChatOptions, type SideChatState, TABLE_BLOCK_CLOSE, TABLE_BLOCK_OPEN, TIMELINE_BLOCK_CLOSE, TIMELINE_BLOCK_OPEN, type TelegramBotInfo, type TenantMembership, type TenantRow, type TimelineDay, type TimelineEvent, type TimelineView, type TokenProvider, type ToolCall, type UIAction, type UploadedArtifact, VISUALS, type VisualKind, type WireAttachment, type WorkspaceCapabilities, type WorkspaceSnapshot, type WorkspaceState, ada, apiFetch, apiFetchRaw, blocksToText, borderRadius, capabilityEnabled, chartAsText, chartScale, chartView, clearSideChats, closeChatStream, colors, comparisonAsText, comparisonView, connectAcsWs, connectorCall, createAuthSession, createPushRegistration, deleteArtifact, devModeFromCatalog, diagramAsText, diagramFlow, diagramView, disconnectAcsWs, exchangeHandoff, fetchConsumerConfig, fetchLauncherPlaces, focusPlugin, fontSize, getConfig, getConsumerAuthApiUrl, getCoreApiUrl, getCoreWsUrl, getPrefs as getNotifPrefs, getTelegramBotInfo as getNotifTelegramBotInfo, getSession, getSideChatStore, getTenant, getToken, getUser, getVoiceApiUrl, initAdas, isAdasInitialized, isDevHost, isVisualKind, joinWithApple, joinWithGoogle, linkChannelStart, linkChannelVerify, linkTelegram as linkNotifTelegram, listHomeActions, listMadeForYou, listMyTenants, listSurface, mcpFetch, mcpToolCall, mergeSideChatHistory, nestByMaster, notifyAcsWsForeground, notifyAppForeground, numText, onAppForeground, openJoinWithApple, openJoinWithGoogle, parseDeepLinkParam, parseHandoffCode, parseInviteCode, patchArtifact, patchHomeAction, plainTextOf, pluginCommandEmitter, postCommandResult, prepareAttachments, previewInvite, readDevMode, recentDispatches as recentNotifDispatches, recordEvent, recordWidgetOpen, refreshToken, registerHostIntent, registerDevice as registerPushDevice, resolveAdasPhase, setAcsCacheStorage, setAcsReachabilityReporter, setClientDeclarationProvider, setDevMode, setHomeActionOrder, setPrefs as setNotifPrefs, setOrder, sideChatOptions, signInWithApple, signInWithGoogle, spacing, splitBlockSegments, switchTenant, tenantFromToken, timelineAsText, timelineView, topicLabel, unlinkChannel as unlinkNotifChannel, unregisterDevice as unregisterPushDevice, unwrapMcpResult, useCapability, useChatStore, useHomeActionsStore, useWidgetsStore, useWorkspaceStore, userFromJwt, visualViewOf };
|
|
1642
|
+
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 BlockSegment, type BufferedCommand, CHART_BLOCK_CLOSE, CHART_BLOCK_OPEN, COMPARISON_BLOCK_CLOSE, COMPARISON_BLOCK_OPEN, type ChannelPrefs, type ChartSeries, type ChartView, type ComparisonOption, type ComparisonRow, type ComparisonView, type ConsumerCapabilityConfig, type ConsumerProviderConfig, type ConsumerSignInResult, type ConversationBlock, DETAILS_BLOCK_CLOSE, DETAILS_BLOCK_OPEN, DIAGRAM_BLOCK_CLOSE, DIAGRAM_BLOCK_OPEN, DIAGRAM_STATUSES, type DeleteResult, type DevModeState, type DevicePlatform, type DiagramFlow, type DiagramStatus, type DiagramStep, type DiagramView, type DispatchRow, type FileUploadRequest, type FileUploader, type GoalRow, type HandoffExchangeResult, type HomeAction, type HomeActionLeaf, type HomeActionReason, type InvitePreview, type JobGoals, type JobProgress, type LauncherPlace, type LauncherPlaces, MAX_ATTACHMENT_BYTES, MAX_INLINE_ATTACHMENT_BYTES, 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, SIDE_CHAT_LIMITS, type Session, type SessionEnv, type SessionPersistence, type SessionStatus, type SessionUser, type SideChatOptions, type SideChatState, TABLE_BLOCK_CLOSE, TABLE_BLOCK_OPEN, TIMELINE_BLOCK_CLOSE, TIMELINE_BLOCK_OPEN, type TelegramBotInfo, type TenantMembership, type TenantRow, type TimelineDay, type TimelineEvent, type TimelineView, type TokenProvider, type ToolCall, type UIAction, type UploadedArtifact, VISUALS, type VisualKind, type WireAttachment, type WorkspaceCapabilities, type WorkspaceSnapshot, type WorkspaceState, ada, apiFetch, apiFetchRaw, blocksToText, borderRadius, capabilityEnabled, chartAsText, chartScale, chartView, clearSideChats, closeChatStream, colors, comparisonAsText, comparisonView, connectAcsWs, connectorCall, createAuthSession, createPushRegistration, deleteArtifact, devModeFromCatalog, diagramAsText, diagramFlow, diagramView, disconnectAcsWs, exchangeHandoff, fetchConsumerConfig, fetchLauncherPlaces, focusPlugin, fontSize, getConfig, getConsumerAuthApiUrl, getCoreApiUrl, getCoreWsUrl, getPrefs as getNotifPrefs, getTelegramBotInfo as getNotifTelegramBotInfo, getSession, getSideChatStore, getTenant, getToken, getUser, getVoiceApiUrl, goalRows, initAdas, isAdasInitialized, isDevHost, isVisualKind, joinWithApple, joinWithGoogle, linkChannelStart, linkChannelVerify, linkTelegram as linkNotifTelegram, listHomeActions, listMadeForYou, listMyTenants, listSurface, mcpFetch, mcpToolCall, mergeSideChatHistory, nestByMaster, notifyAcsWsForeground, notifyAppForeground, numText, onAppForeground, openJoinWithApple, openJoinWithGoogle, parseDeepLinkParam, parseHandoffCode, parseInviteCode, patchArtifact, patchHomeAction, plainTextOf, pluginCommandEmitter, postCommandResult, prepareAttachments, previewInvite, readDevMode, recentDispatches as recentNotifDispatches, recordEvent, recordWidgetOpen, refreshToken, registerHostIntent, registerDevice as registerPushDevice, resolveAdasPhase, setAcsCacheStorage, setAcsReachabilityReporter, setClientDeclarationProvider, setDevMode, setHomeActionOrder, setPrefs as setNotifPrefs, setOrder, sideChatOptions, signInWithApple, signInWithGoogle, spacing, splitBlockSegments, switchTenant, tenantFromToken, timelineAsText, timelineView, topicLabel, unlinkChannel as unlinkNotifChannel, unregisterDevice as unregisterPushDevice, unwrapMcpResult, useCapability, useChatStore, useHomeActionsStore, useWidgetsStore, useWorkspaceStore, userFromJwt, visualViewOf };
|
package/dist/index.d.ts
CHANGED
|
@@ -767,6 +767,25 @@ declare function listMyTenants(): Promise<TenantMembership[]>;
|
|
|
767
767
|
*/
|
|
768
768
|
declare function switchTenant(targetTenantId: string): Promise<AdasSession>;
|
|
769
769
|
|
|
770
|
+
type GoalWire = {
|
|
771
|
+
l: [string, string, string][];
|
|
772
|
+
c?: string | null;
|
|
773
|
+
};
|
|
774
|
+
type JobGoals = {
|
|
775
|
+
l: [string, string, string][];
|
|
776
|
+
c: string | null;
|
|
777
|
+
tools: Record<string, string[]>;
|
|
778
|
+
lastKey?: string;
|
|
779
|
+
ids?: string;
|
|
780
|
+
};
|
|
781
|
+
type GoalRow = {
|
|
782
|
+
id: string;
|
|
783
|
+
title: string;
|
|
784
|
+
state: 'done' | 'current' | 'todo';
|
|
785
|
+
tools: string[];
|
|
786
|
+
};
|
|
787
|
+
declare function goalRows(goals: JobGoals | undefined): GoalRow[];
|
|
788
|
+
|
|
770
789
|
interface ToolCall {
|
|
771
790
|
name: string;
|
|
772
791
|
args: Record<string, unknown>;
|
|
@@ -795,6 +814,7 @@ interface JobProgress {
|
|
|
795
814
|
message: string;
|
|
796
815
|
step?: number;
|
|
797
816
|
total?: number;
|
|
817
|
+
seq?: number;
|
|
798
818
|
};
|
|
799
819
|
/** One warm, present-tense, localized line describing the current action
|
|
800
820
|
* (backend statusI18n). Absent when disabled / not yet cached → fall back
|
|
@@ -802,6 +822,10 @@ interface JobProgress {
|
|
|
802
822
|
humanStatus?: string;
|
|
803
823
|
/** Lookup { rawToken → friendly phrase } for tokens in this snapshot. */
|
|
804
824
|
humanLabels?: Record<string, string>;
|
|
825
|
+
/** The job's goal checklist, built from the goals Core streams on the job message plus the live `→ tool` line (chat/liveGoals.ts). */
|
|
826
|
+
goals?: JobGoals;
|
|
827
|
+
/** The raw `goals` of ONE job message, in transit from snapshotToProgress to updateJobProgress (which folds it into `goals` and drops it). */
|
|
828
|
+
goalsWire?: GoalWire;
|
|
805
829
|
pendingQuestion?: {
|
|
806
830
|
inputId: string;
|
|
807
831
|
question: string;
|
|
@@ -1615,4 +1639,4 @@ interface AcsKvStorage {
|
|
|
1615
1639
|
}
|
|
1616
1640
|
declare function setAcsCacheStorage(kv: AcsKvStorage | null): void;
|
|
1617
1641
|
|
|
1618
|
-
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 BlockSegment, type BufferedCommand, CHART_BLOCK_CLOSE, CHART_BLOCK_OPEN, COMPARISON_BLOCK_CLOSE, COMPARISON_BLOCK_OPEN, type ChannelPrefs, type ChartSeries, type ChartView, type ComparisonOption, type ComparisonRow, type ComparisonView, type ConsumerCapabilityConfig, type ConsumerProviderConfig, type ConsumerSignInResult, type ConversationBlock, DETAILS_BLOCK_CLOSE, DETAILS_BLOCK_OPEN, DIAGRAM_BLOCK_CLOSE, DIAGRAM_BLOCK_OPEN, DIAGRAM_STATUSES, type DeleteResult, type DevModeState, type DevicePlatform, type DiagramFlow, type DiagramStatus, type DiagramStep, type DiagramView, type DispatchRow, type FileUploadRequest, type FileUploader, type HandoffExchangeResult, type HomeAction, type HomeActionLeaf, type HomeActionReason, type InvitePreview, type JobProgress, type LauncherPlace, type LauncherPlaces, MAX_ATTACHMENT_BYTES, MAX_INLINE_ATTACHMENT_BYTES, 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, SIDE_CHAT_LIMITS, type Session, type SessionEnv, type SessionPersistence, type SessionStatus, type SessionUser, type SideChatOptions, type SideChatState, TABLE_BLOCK_CLOSE, TABLE_BLOCK_OPEN, TIMELINE_BLOCK_CLOSE, TIMELINE_BLOCK_OPEN, type TelegramBotInfo, type TenantMembership, type TenantRow, type TimelineDay, type TimelineEvent, type TimelineView, type TokenProvider, type ToolCall, type UIAction, type UploadedArtifact, VISUALS, type VisualKind, type WireAttachment, type WorkspaceCapabilities, type WorkspaceSnapshot, type WorkspaceState, ada, apiFetch, apiFetchRaw, blocksToText, borderRadius, capabilityEnabled, chartAsText, chartScale, chartView, clearSideChats, closeChatStream, colors, comparisonAsText, comparisonView, connectAcsWs, connectorCall, createAuthSession, createPushRegistration, deleteArtifact, devModeFromCatalog, diagramAsText, diagramFlow, diagramView, disconnectAcsWs, exchangeHandoff, fetchConsumerConfig, fetchLauncherPlaces, focusPlugin, fontSize, getConfig, getConsumerAuthApiUrl, getCoreApiUrl, getCoreWsUrl, getPrefs as getNotifPrefs, getTelegramBotInfo as getNotifTelegramBotInfo, getSession, getSideChatStore, getTenant, getToken, getUser, getVoiceApiUrl, initAdas, isAdasInitialized, isDevHost, isVisualKind, joinWithApple, joinWithGoogle, linkChannelStart, linkChannelVerify, linkTelegram as linkNotifTelegram, listHomeActions, listMadeForYou, listMyTenants, listSurface, mcpFetch, mcpToolCall, mergeSideChatHistory, nestByMaster, notifyAcsWsForeground, notifyAppForeground, numText, onAppForeground, openJoinWithApple, openJoinWithGoogle, parseDeepLinkParam, parseHandoffCode, parseInviteCode, patchArtifact, patchHomeAction, plainTextOf, pluginCommandEmitter, postCommandResult, prepareAttachments, previewInvite, readDevMode, recentDispatches as recentNotifDispatches, recordEvent, recordWidgetOpen, refreshToken, registerHostIntent, registerDevice as registerPushDevice, resolveAdasPhase, setAcsCacheStorage, setAcsReachabilityReporter, setClientDeclarationProvider, setDevMode, setHomeActionOrder, setPrefs as setNotifPrefs, setOrder, sideChatOptions, signInWithApple, signInWithGoogle, spacing, splitBlockSegments, switchTenant, tenantFromToken, timelineAsText, timelineView, topicLabel, unlinkChannel as unlinkNotifChannel, unregisterDevice as unregisterPushDevice, unwrapMcpResult, useCapability, useChatStore, useHomeActionsStore, useWidgetsStore, useWorkspaceStore, userFromJwt, visualViewOf };
|
|
1642
|
+
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 BlockSegment, type BufferedCommand, CHART_BLOCK_CLOSE, CHART_BLOCK_OPEN, COMPARISON_BLOCK_CLOSE, COMPARISON_BLOCK_OPEN, type ChannelPrefs, type ChartSeries, type ChartView, type ComparisonOption, type ComparisonRow, type ComparisonView, type ConsumerCapabilityConfig, type ConsumerProviderConfig, type ConsumerSignInResult, type ConversationBlock, DETAILS_BLOCK_CLOSE, DETAILS_BLOCK_OPEN, DIAGRAM_BLOCK_CLOSE, DIAGRAM_BLOCK_OPEN, DIAGRAM_STATUSES, type DeleteResult, type DevModeState, type DevicePlatform, type DiagramFlow, type DiagramStatus, type DiagramStep, type DiagramView, type DispatchRow, type FileUploadRequest, type FileUploader, type GoalRow, type HandoffExchangeResult, type HomeAction, type HomeActionLeaf, type HomeActionReason, type InvitePreview, type JobGoals, type JobProgress, type LauncherPlace, type LauncherPlaces, MAX_ATTACHMENT_BYTES, MAX_INLINE_ATTACHMENT_BYTES, 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, SIDE_CHAT_LIMITS, type Session, type SessionEnv, type SessionPersistence, type SessionStatus, type SessionUser, type SideChatOptions, type SideChatState, TABLE_BLOCK_CLOSE, TABLE_BLOCK_OPEN, TIMELINE_BLOCK_CLOSE, TIMELINE_BLOCK_OPEN, type TelegramBotInfo, type TenantMembership, type TenantRow, type TimelineDay, type TimelineEvent, type TimelineView, type TokenProvider, type ToolCall, type UIAction, type UploadedArtifact, VISUALS, type VisualKind, type WireAttachment, type WorkspaceCapabilities, type WorkspaceSnapshot, type WorkspaceState, ada, apiFetch, apiFetchRaw, blocksToText, borderRadius, capabilityEnabled, chartAsText, chartScale, chartView, clearSideChats, closeChatStream, colors, comparisonAsText, comparisonView, connectAcsWs, connectorCall, createAuthSession, createPushRegistration, deleteArtifact, devModeFromCatalog, diagramAsText, diagramFlow, diagramView, disconnectAcsWs, exchangeHandoff, fetchConsumerConfig, fetchLauncherPlaces, focusPlugin, fontSize, getConfig, getConsumerAuthApiUrl, getCoreApiUrl, getCoreWsUrl, getPrefs as getNotifPrefs, getTelegramBotInfo as getNotifTelegramBotInfo, getSession, getSideChatStore, getTenant, getToken, getUser, getVoiceApiUrl, goalRows, initAdas, isAdasInitialized, isDevHost, isVisualKind, joinWithApple, joinWithGoogle, linkChannelStart, linkChannelVerify, linkTelegram as linkNotifTelegram, listHomeActions, listMadeForYou, listMyTenants, listSurface, mcpFetch, mcpToolCall, mergeSideChatHistory, nestByMaster, notifyAcsWsForeground, notifyAppForeground, numText, onAppForeground, openJoinWithApple, openJoinWithGoogle, parseDeepLinkParam, parseHandoffCode, parseInviteCode, patchArtifact, patchHomeAction, plainTextOf, pluginCommandEmitter, postCommandResult, prepareAttachments, previewInvite, readDevMode, recentDispatches as recentNotifDispatches, recordEvent, recordWidgetOpen, refreshToken, registerHostIntent, registerDevice as registerPushDevice, resolveAdasPhase, setAcsCacheStorage, setAcsReachabilityReporter, setClientDeclarationProvider, setDevMode, setHomeActionOrder, setPrefs as setNotifPrefs, setOrder, sideChatOptions, signInWithApple, signInWithGoogle, spacing, splitBlockSegments, switchTenant, tenantFromToken, timelineAsText, timelineView, topicLabel, unlinkChannel as unlinkNotifChannel, unregisterDevice as unregisterPushDevice, unwrapMcpResult, useCapability, useChatStore, useHomeActionsStore, useWidgetsStore, useWorkspaceStore, userFromJwt, visualViewOf };
|
package/dist/index.js
CHANGED
|
@@ -79,6 +79,7 @@ __export(index_exports, {
|
|
|
79
79
|
getToken: () => getToken,
|
|
80
80
|
getUser: () => getUser,
|
|
81
81
|
getVoiceApiUrl: () => getVoiceApiUrl,
|
|
82
|
+
goalRows: () => goalRows,
|
|
82
83
|
initAdas: () => initAdas,
|
|
83
84
|
isAdasInitialized: () => isAdasInitialized,
|
|
84
85
|
isDevHost: () => isDevHost,
|
|
@@ -1904,6 +1905,32 @@ function plainTextOf(content) {
|
|
|
1904
1905
|
}).join("");
|
|
1905
1906
|
}
|
|
1906
1907
|
|
|
1908
|
+
// src/chat/liveGoals.ts
|
|
1909
|
+
var MAX_TOOLS = 4;
|
|
1910
|
+
function foldGoals(prev, wire, liveMessage, liveSeq) {
|
|
1911
|
+
const g = wire && Array.isArray(wire.l) ? wire : null;
|
|
1912
|
+
if (g && g.l.length === 0) return void 0;
|
|
1913
|
+
const goals = g ? { l: g.l, c: g.c ?? null } : prev ? { l: prev.l, c: prev.c } : null;
|
|
1914
|
+
if (!goals) return void 0;
|
|
1915
|
+
const ids = goals.l.map((x) => x[0]).join("|");
|
|
1916
|
+
const tools = ids === prev?.ids ? { ...prev?.tools || {} } : {};
|
|
1917
|
+
const key = liveSeq != null ? `s${liveSeq}` : `m${liveMessage ?? ""}`;
|
|
1918
|
+
const fresh = key !== prev?.lastKey;
|
|
1919
|
+
if (fresh && goals.c && liveMessage && liveMessage.startsWith("\u2192 ")) {
|
|
1920
|
+
const tool = liveMessage.slice(2).trim();
|
|
1921
|
+
const list2 = tools[goals.c] || [];
|
|
1922
|
+
if (tool && list2[list2.length - 1] !== tool) tools[goals.c] = [...list2, tool].slice(-MAX_TOOLS);
|
|
1923
|
+
}
|
|
1924
|
+
return { ...goals, tools, lastKey: key, ids };
|
|
1925
|
+
}
|
|
1926
|
+
function goalRows(goals) {
|
|
1927
|
+
if (!goals?.l?.length) return [];
|
|
1928
|
+
return goals.l.map(([id, title, s]) => {
|
|
1929
|
+
const state = s === "d" ? "done" : id === goals.c ? "current" : "todo";
|
|
1930
|
+
return { id, title, state, tools: state === "current" ? goals.tools?.[id] || [] : [] };
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1907
1934
|
// src/chat/store.ts
|
|
1908
1935
|
function coreHeaders() {
|
|
1909
1936
|
const token = getToken();
|
|
@@ -1939,7 +1966,8 @@ function extractLiveProgress(snap) {
|
|
|
1939
1966
|
return {
|
|
1940
1967
|
message: String(latest.message || ""),
|
|
1941
1968
|
...latest.step != null ? { step: latest.step } : {},
|
|
1942
|
-
...latest.total != null ? { total: latest.total } : {}
|
|
1969
|
+
...latest.total != null ? { total: latest.total } : {},
|
|
1970
|
+
...latest.seq != null ? { seq: latest.seq } : {}
|
|
1943
1971
|
};
|
|
1944
1972
|
}
|
|
1945
1973
|
function extractCurrentTool(state) {
|
|
@@ -1968,6 +1996,7 @@ function snapshotToProgress(snap, rootJobId) {
|
|
|
1968
1996
|
if (liveProgress) progress.liveProgress = liveProgress;
|
|
1969
1997
|
if (typeof snap?.humanStatus === "string" && snap.humanStatus) progress.humanStatus = snap.humanStatus;
|
|
1970
1998
|
if (snap?.humanLabels && typeof snap.humanLabels === "object") progress.humanLabels = snap.humanLabels;
|
|
1999
|
+
if (snap?.goals && Array.isArray(snap.goals.l)) progress.goalsWire = snap.goals;
|
|
1971
2000
|
if (pq) {
|
|
1972
2001
|
progress.pendingQuestion = {
|
|
1973
2002
|
inputId: pq.correlation_id || pq.correlationId || pq.inputId || "",
|
|
@@ -2122,12 +2151,14 @@ var useChatStore = (0, import_zustand4.create)((set, get) => ({
|
|
|
2122
2151
|
);
|
|
2123
2152
|
const chainCreatedAt = typeof slim.createdAt === "number" ? slim.createdAt : typeof slim.lastUpdate === "number" ? slim.lastUpdate : Date.now();
|
|
2124
2153
|
const chainLastUpdate = typeof slim.lastUpdate === "number" ? slim.lastUpdate : chainCreatedAt;
|
|
2154
|
+
const { goalsWire, ...progressRest } = progress;
|
|
2125
2155
|
const jobProgress = {
|
|
2126
2156
|
jobId: chainId,
|
|
2127
2157
|
actorId: extractActorId(slim),
|
|
2128
2158
|
status: "running",
|
|
2129
2159
|
chainStartedAt: chainCreatedAt,
|
|
2130
|
-
...
|
|
2160
|
+
...progressRest,
|
|
2161
|
+
goals: foldGoals(void 0, goalsWire, progress.liveProgress?.message, progress.liveProgress?.seq)
|
|
2131
2162
|
};
|
|
2132
2163
|
const goal = typeof slim.goal === "string" ? slim.goal : "";
|
|
2133
2164
|
const userExists = finalMessages.some(
|
|
@@ -2327,7 +2358,9 @@ var useChatStore = (0, import_zustand4.create)((set, get) => ({
|
|
|
2327
2358
|
set((s) => ({
|
|
2328
2359
|
messages: s.messages.map((m) => {
|
|
2329
2360
|
if (m.jobProgress?.jobId === jobId) {
|
|
2330
|
-
const
|
|
2361
|
+
const { goalsWire, ...rest } = progress;
|
|
2362
|
+
const updated = { ...m.jobProgress, ...rest };
|
|
2363
|
+
updated.goals = foldGoals(m.jobProgress.goals, goalsWire, progress.liveProgress?.message, progress.liveProgress?.seq);
|
|
2331
2364
|
if (progress.status && progress.status !== "paused") {
|
|
2332
2365
|
updated.pendingQuestion = void 0;
|
|
2333
2366
|
}
|
|
@@ -2646,7 +2679,12 @@ function turnToMessages(turn) {
|
|
|
2646
2679
|
function createSideChatStore(pageId) {
|
|
2647
2680
|
return (0, import_zustand5.create)((set, get) => {
|
|
2648
2681
|
const local = (m) => ({ ...m, local: true });
|
|
2649
|
-
const patchJob = (jobId, p) =>
|
|
2682
|
+
const patchJob = (jobId, p) => {
|
|
2683
|
+
const { goalsWire, ...rest } = p;
|
|
2684
|
+
set((s) => ({
|
|
2685
|
+
messages: s.messages.map((m) => m.jobProgress?.jobId === jobId ? { ...m, jobProgress: { ...m.jobProgress, ...rest, goals: foldGoals(m.jobProgress.goals, goalsWire, p.liveProgress?.message, p.liveProgress?.seq) } } : m)
|
|
2686
|
+
}));
|
|
2687
|
+
};
|
|
2650
2688
|
async function follow(jobId, chainId) {
|
|
2651
2689
|
let ended = null;
|
|
2652
2690
|
for (let i = 0; !ended; i++) {
|
|
@@ -2985,6 +3023,7 @@ var borderRadius = {
|
|
|
2985
3023
|
getToken,
|
|
2986
3024
|
getUser,
|
|
2987
3025
|
getVoiceApiUrl,
|
|
3026
|
+
goalRows,
|
|
2988
3027
|
initAdas,
|
|
2989
3028
|
isAdasInitialized,
|
|
2990
3029
|
isDevHost,
|