@gemies/sdk 0.0.0-stage → 1.1.0
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/CHANGELOG.md +1678 -0
- package/LICENSE +202 -0
- package/NOTICE +15 -0
- package/README.md +516 -2
- package/package.json +105 -4
- package/src/accounts.ts +29 -0
- package/src/animations.ts +5 -0
- package/src/ask-eager.ts +8 -0
- package/src/ask-text.ts +11 -0
- package/src/ask.ts +12 -0
- package/src/avatar.ts +13 -0
- package/src/character.ts +1 -0
- package/src/components/AmbientField.tsx +580 -0
- package/src/components/ComposerDropZone.tsx +235 -0
- package/src/components/ComposerSuggestions.tsx +45 -0
- package/src/components/GemieAccounts.tsx +433 -0
- package/src/components/GemieAskCore.tsx +184 -0
- package/src/components/GemieAskProvider.tsx +18 -0
- package/src/components/GemieAskProviderLazy.tsx +27 -0
- package/src/components/GemieAskProviderText.tsx +25 -0
- package/src/components/GemieAskSheet.tsx +51 -0
- package/src/components/GemieAskSheetWithVoice.tsx +10 -0
- package/src/components/GemieAvatar.tsx +57 -0
- package/src/components/GemieAvatarIcon.tsx +35 -0
- package/src/components/GemieChatContent.tsx +900 -0
- package/src/components/GemieChatHeader.tsx +123 -0
- package/src/components/GemieChatScreen.tsx +170 -0
- package/src/components/GemieChatSheet.tsx +368 -0
- package/src/components/GemieChatWithVoice.tsx +13 -0
- package/src/components/GemieComposer.tsx +388 -0
- package/src/components/GemieGroupWelcome.tsx +37 -0
- package/src/components/GemieParticipants.tsx +133 -0
- package/src/components/GemieParticipantsHeader.tsx +27 -0
- package/src/components/GemieRecentConversations.tsx +65 -0
- package/src/components/GemieSharedConversation.tsx +87 -0
- package/src/components/GemieWelcomeMessage.tsx +58 -0
- package/src/components/IdentityMark.tsx +225 -0
- package/src/components/Image.tsx +12 -0
- package/src/components/InertWhen.tsx +48 -0
- package/src/components/PlanPreviewCard.tsx +53 -0
- package/src/components/QuestionCard.tsx +64 -0
- package/src/components/ReplyMarkdown.tsx +373 -0
- package/src/components/RichBlocks.tsx +195 -0
- package/src/components/VoiceModeIcon.tsx +18 -0
- package/src/components/canvas/CanvasComponent.tsx +65 -0
- package/src/components/canvas/ChartRenderer.tsx +73 -0
- package/src/components/canvas/CodeRenderer.tsx +20 -0
- package/src/components/canvas/DashboardRenderer.tsx +70 -0
- package/src/components/canvas/DeckRenderer.tsx +43 -0
- package/src/components/canvas/FormRenderer.tsx +101 -0
- package/src/components/canvas/MarkdownRenderer.tsx +14 -0
- package/src/components/canvas/TableRenderer.tsx +47 -0
- package/src/components/icons/RiEmojiPicker.tsx +39 -0
- package/src/components/icons/RiMoreDots.tsx +32 -0
- package/src/components/icons/RiReplyLine.tsx +25 -0
- package/src/components/thought/FilesAndSources.tsx +120 -0
- package/src/components/thought/ThoughtPanel.tsx +426 -0
- package/src/components/thought/ToolStep.tsx +134 -0
- package/src/components/thread/AgentExchangeView.tsx +112 -0
- package/src/components/thread/AgentResultCard.tsx +125 -0
- package/src/components/thread/AgentTaskCard.tsx +127 -0
- package/src/components/thread/ChatBubble.tsx +256 -0
- package/src/components/thread/GemieThread.tsx +455 -0
- package/src/components/thread/MessageBlockBoundary.tsx +78 -0
- package/src/components/thread/NewConversationOffer.tsx +54 -0
- package/src/components/thread/ThreadRow.tsx +598 -0
- package/src/components/thread/ThreadSearch.tsx +130 -0
- package/src/components/thread/ThreadSkeleton.tsx +30 -0
- package/src/components/thread/ToolResultCard.tsx +254 -0
- package/src/components/thread/TurnMenu.tsx +54 -0
- package/src/components/thread/TurnStatusLine.tsx +34 -0
- package/src/components/voice/GemieVoiceCall.tsx +21 -0
- package/src/components/voice/GemieVoiceCall.web.tsx +17 -0
- package/src/components/voice/VoiceCallContext.ts +13 -0
- package/src/components/voice/VoiceControls.tsx +106 -0
- package/src/components/voice/VoiceSession.tsx +120 -0
- package/src/components/voice/withVoiceCall.tsx +25 -0
- package/src/csp.ts +50 -0
- package/src/dictation.ts +40 -0
- package/src/hooks/useAmbientWave.ts +184 -0
- package/src/hooks/useAtBottom.ts +51 -0
- package/src/hooks/useAttachMenu.ts +93 -0
- package/src/hooks/useAttachmentIntake.ts +401 -0
- package/src/hooks/useAudioLevelMonitor.ts +46 -0
- package/src/hooks/useAudioLevels.ts +51 -0
- package/src/hooks/useChatComposer.ts +309 -0
- package/src/hooks/useChatVoice.ts +129 -0
- package/src/hooks/useComposerSuggestions.ts +84 -0
- package/src/hooks/useDictation.ts +292 -0
- package/src/hooks/useDocumentPicker.ts +11 -0
- package/src/hooks/useFailedTurnToast.ts +43 -0
- package/src/hooks/useFocusWhenPresented.ts +41 -0
- package/src/hooks/useGemieActivity.ts +31 -0
- package/src/hooks/useImagePicker.ts +38 -0
- package/src/hooks/useMessageReactions.ts +119 -0
- package/src/hooks/useMessageVote.ts +50 -0
- package/src/hooks/useOpenThought.ts +79 -0
- package/src/hooks/usePendingQuestions.ts +19 -0
- package/src/hooks/useReadAloud.ts +92 -0
- package/src/hooks/useShareHandler.ts +24 -0
- package/src/hooks/useSoundEffects.ts +137 -0
- package/src/hooks/useTTS.ts +303 -0
- package/src/hooks/useThoughtScope.ts +59 -0
- package/src/hooks/useThreadRows.ts +157 -0
- package/src/hooks/useThreadView.ts +67 -0
- package/src/hooks/useTimelineWindow.ts +256 -0
- package/src/hooks/useVoiceLauncher.ts +180 -0
- package/src/hooks/useVoiceRoom.ts +212 -0
- package/src/index.ts +141 -0
- package/src/lib/activity-socket.ts +102 -0
- package/src/lib/activity-store.ts +53 -0
- package/src/lib/add-menu.ts +7 -0
- package/src/lib/agent-character.ts +28 -0
- package/src/lib/alia-character.ts +14 -0
- package/src/lib/alia-gemie.ts +6 -0
- package/src/lib/attachment-intake.ts +154 -0
- package/src/lib/attachment-tiles.ts +74 -0
- package/src/lib/audio-level.ts +130 -0
- package/src/lib/audio-request-auth.ts +4 -0
- package/src/lib/audio-session-binding.ts +27 -0
- package/src/lib/bubbles.tsx +16 -0
- package/src/lib/call-thread.ts +33 -0
- package/src/lib/canvas-result.ts +21 -0
- package/src/lib/catalogue-tool.ts +22 -0
- package/src/lib/citations.ts +192 -0
- package/src/lib/clipboard.ts +23 -0
- package/src/lib/content-utils.ts +46 -0
- package/src/lib/copy-en.ts +333 -0
- package/src/lib/copy-es.ts +330 -0
- package/src/lib/copy.ts +38 -0
- package/src/lib/deferred/document-picker.ts +2 -0
- package/src/lib/deferred/document-picker.web.ts +12 -0
- package/src/lib/deferred/expo-audio.ts +2 -0
- package/src/lib/deferred/expo-audio.web.ts +12 -0
- package/src/lib/deferred/image-data-url.ts +5 -0
- package/src/lib/deferred/image-data-url.web.ts +12 -0
- package/src/lib/dictation-protocol.ts +142 -0
- package/src/lib/dictation-recorder-types.ts +37 -0
- package/src/lib/dictation-recorder.native.ts +90 -0
- package/src/lib/dictation-recorder.ts +131 -0
- package/src/lib/dictation-stream.ts +238 -0
- package/src/lib/dictation.ts +216 -0
- package/src/lib/document-picker.ts +31 -0
- package/src/lib/domain.ts +12 -0
- package/src/lib/flights.ts +33 -0
- package/src/lib/focus-return.ts +66 -0
- package/src/lib/greeting.ts +15 -0
- package/src/lib/image-data-url.ts +35 -0
- package/src/lib/keyboard.native.tsx +25 -0
- package/src/lib/keyboard.tsx +55 -0
- package/src/lib/labels-es.ts +113 -0
- package/src/lib/labels.tsx +207 -0
- package/src/lib/origins.ts +28 -0
- package/src/lib/participants.ts +97 -0
- package/src/lib/pcm.ts +57 -0
- package/src/lib/power-level-options.ts +66 -0
- package/src/lib/questions.ts +92 -0
- package/src/lib/speech-language.ts +20 -0
- package/src/lib/speech-messages.ts +54 -0
- package/src/lib/speech-synthesis.ts +156 -0
- package/src/lib/suggestions.ts +53 -0
- package/src/lib/task-labels.ts +35 -0
- package/src/lib/text-input.ts +10 -0
- package/src/lib/tool-call-status.ts +28 -0
- package/src/lib/tool-icons.ts +36 -0
- package/src/lib/tool-registry.ts +71 -0
- package/src/lib/tool-renderers.tsx +32 -0
- package/src/lib/turn-state.ts +15 -0
- package/src/lib/utils.ts +35 -0
- package/src/lib/voice-audio-engine-types.ts +59 -0
- package/src/lib/voice-audio-engine.native.ts +232 -0
- package/src/lib/voice-audio-engine.ts +206 -0
- package/src/lib/voice-call-request.ts +49 -0
- package/src/lib/voice-call.ts +627 -0
- package/src/lib/voice-controls-labels.ts +31 -0
- package/src/lib/voice-levels.ts +64 -0
- package/src/lib/voice-protocol.ts +328 -0
- package/src/lib/voice-worklets.ts +19 -0
- package/src/lib/work-log.ts +370 -0
- package/src/metro/chart-importers.json +18 -0
- package/src/metro/granular-charts.js +3 -0
- package/src/metro/index.cjs +227 -0
- package/src/metro/index.d.cts +5 -0
- package/src/runtime/agents.ts +151 -0
- package/src/runtime/api.ts +144 -0
- package/src/runtime/app-assertion.ts +51 -0
- package/src/runtime/attachment-utils.ts +97 -0
- package/src/runtime/chat-turn-control.ts +74 -0
- package/src/runtime/composer-draft-store.ts +270 -0
- package/src/runtime/config.tsx +222 -0
- package/src/runtime/conversation-dates.ts +31 -0
- package/src/runtime/conversation-store.ts +49 -0
- package/src/runtime/conversations.ts +633 -0
- package/src/runtime/error-utils.ts +144 -0
- package/src/runtime/gemie-accounts.ts +182 -0
- package/src/runtime/host-tools.ts +290 -0
- package/src/runtime/index.ts +137 -0
- package/src/runtime/message-history.ts +124 -0
- package/src/runtime/message-reactions.ts +214 -0
- package/src/runtime/model.ts +39 -0
- package/src/runtime/oxy-files.ts +37 -0
- package/src/runtime/power-levels.ts +66 -0
- package/src/runtime/query-keys.ts +60 -0
- package/src/runtime/random-uuid.ts +25 -0
- package/src/runtime/reaction-cache.ts +45 -0
- package/src/runtime/room-events.ts +333 -0
- package/src/runtime/routes.ts +85 -0
- package/src/runtime/sharing.ts +217 -0
- package/src/runtime/sse-frame-reader.ts +88 -0
- package/src/runtime/stream-events.ts +154 -0
- package/src/runtime/stream-outcome.ts +21 -0
- package/src/runtime/thought-store.ts +103 -0
- package/src/runtime/thread/agent-activity.ts +261 -0
- package/src/runtime/thread/agent-exchange.ts +94 -0
- package/src/runtime/thread/automation-labels.ts +79 -0
- package/src/runtime/thread/conversation-export.ts +135 -0
- package/src/runtime/thread/message-days.ts +120 -0
- package/src/runtime/thread/message-processor.ts +93 -0
- package/src/runtime/thread/speaker-changes.ts +66 -0
- package/src/runtime/thread/task-utils.ts +11 -0
- package/src/runtime/thread/thought-utils.ts +750 -0
- package/src/runtime/thread/thread-history.ts +139 -0
- package/src/runtime/thread/timeline.ts +202 -0
- package/src/runtime/thread/title-tags.ts +8 -0
- package/src/runtime/thread/tool-cards.ts +387 -0
- package/src/runtime/turn-failure.ts +108 -0
- package/src/runtime/turn-preparation.ts +21 -0
- package/src/runtime/types.ts +172 -0
- package/src/runtime/usage-limit-error.ts +44 -0
- package/src/runtime/use-agent-activity.ts +80 -0
- package/src/runtime/use-conversation-stream.ts +1669 -0
- package/src/runtime/use-conversation-thread.ts +590 -0
- package/src/runtime/use-gemie-thread.ts +54 -0
- package/src/runtime/use-room-events.ts +75 -0
- package/src/runtime/use-start-conversation.ts +107 -0
- package/src/runtime/use-thread-history.ts +73 -0
- package/src/runtime/use-thread-search.ts +100 -0
- package/src/runtime/use-turn-edit.ts +99 -0
- package/src/text.ts +19 -0
- package/src/theme.ts +16 -0
- package/src/tools.ts +27 -0
- package/src/types.ts +161 -0
- package/src/voice-messages.ts +2 -0
- package/src/voice.ts +67 -0
- package/tsconfig.json +17 -0
- package/worklets/voice-processors.js +152 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message Processor - Platform-specific message processing
|
|
3
|
+
*
|
|
4
|
+
* This module handles platform-specific processing of AI responses.
|
|
5
|
+
* Different platforms (Web/Mobile App vs Telegram) have different capabilities,
|
|
6
|
+
* so we process messages differently for each.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { TITLE_STRIP_RE } from './title-tags';
|
|
10
|
+
|
|
11
|
+
export type Platform = 'app' | 'telegram';
|
|
12
|
+
|
|
13
|
+
export interface ProcessedMessage {
|
|
14
|
+
text: string;
|
|
15
|
+
components?: any[]; // Visual components for the app (COMPACTLIST, BANNER, etc.)
|
|
16
|
+
metadata?: Record<string, any>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Process a message for the Web/Mobile App
|
|
21
|
+
* - Removes Telegram-specific tags ([REACT], [TGIMAGE], [TGLINKS], [TGDOC])
|
|
22
|
+
* - Preserves app-specific components ([COMPACTLIST], [BANNER], [COMPARISON], etc.)
|
|
23
|
+
*/
|
|
24
|
+
function processForApp(content: string): ProcessedMessage {
|
|
25
|
+
// Remove Telegram-specific tags and title tags
|
|
26
|
+
const cleanedText = content
|
|
27
|
+
.replace(/\[(?:ALIA_)?REACT:[^\]]+\]\s*/g, '')
|
|
28
|
+
.replace(/\[(?:ALIA_)?TGIMAGE[^\]]*\]\s*/g, '')
|
|
29
|
+
.replace(/\[(?:ALIA_)?TGLINKS[^\]]*\][\s\S]*?\[\/(?:ALIA_)?TGLINKS\]\s*/g, '')
|
|
30
|
+
.replace(/\[(?:ALIA_)?TGDOC[^\]]*\]\s*/g, '')
|
|
31
|
+
.replace(TITLE_STRIP_RE, '')
|
|
32
|
+
.trim();
|
|
33
|
+
|
|
34
|
+
// App-specific components like [COMPACTLIST], [BANNER], etc. are kept
|
|
35
|
+
// They will be rendered by the Markdown component
|
|
36
|
+
return {
|
|
37
|
+
text: cleanedText,
|
|
38
|
+
components: [], // Could extract components here if needed
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Process a message for Telegram
|
|
44
|
+
* - Removes app-specific components ([COMPACTLIST], [BANNER], etc.)
|
|
45
|
+
* - Preserves Telegram-specific tags for bot processing
|
|
46
|
+
*/
|
|
47
|
+
function processForTelegram(content: string): ProcessedMessage {
|
|
48
|
+
// Remove app-specific visual components (not supported in Telegram)
|
|
49
|
+
const cleanedText = content
|
|
50
|
+
.replace(/\[(?:ALIA_)?COMPACTLIST[^\]]*\][\s\S]*?\[\/(?:ALIA_)?COMPACTLIST\]\s*/g, '')
|
|
51
|
+
.replace(/\[(?:ALIA_)?BANNER[^\]]*\][\s\S]*?\[\/(?:ALIA_)?BANNER\]\s*/g, '')
|
|
52
|
+
.replace(/\[(?:ALIA_)?COMPARISON[^\]]*\][\s\S]*?\[\/(?:ALIA_)?COMPARISON\]\s*/g, '')
|
|
53
|
+
.replace(/\[(?:ALIA_)?TIMELINE[^\]]*\][\s\S]*?\[\/(?:ALIA_)?TIMELINE\]\s*/g, '')
|
|
54
|
+
.replace(/\[(?:ALIA_)?IMAGE[^\]]*\]/g, '')
|
|
55
|
+
.replace(/\[(?:ALIA_)?CREDIBILITY[^\]]*\]/g, '')
|
|
56
|
+
.replace(TITLE_STRIP_RE, '')
|
|
57
|
+
.trim();
|
|
58
|
+
|
|
59
|
+
// Telegram tags like [REACT], [TGIMAGE], etc. are kept
|
|
60
|
+
// They will be processed by the Telegram bot
|
|
61
|
+
return {
|
|
62
|
+
text: cleanedText,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Main message processor - Routes to platform-specific processor
|
|
68
|
+
*/
|
|
69
|
+
export function processMessage(content: string, platform: Platform): ProcessedMessage {
|
|
70
|
+
switch (platform) {
|
|
71
|
+
case 'app':
|
|
72
|
+
return processForApp(content);
|
|
73
|
+
case 'telegram':
|
|
74
|
+
return processForTelegram(content);
|
|
75
|
+
default:
|
|
76
|
+
// Fallback: remove all special tags
|
|
77
|
+
return {
|
|
78
|
+
text: content
|
|
79
|
+
.replace(/\[(?:ALIA_)?REACT:[^\]]+\]\s*/g, '')
|
|
80
|
+
.replace(/\[(?:ALIA_)?TGIMAGE[^\]]*\]\s*/g, '')
|
|
81
|
+
.replace(/\[(?:ALIA_)?TGLINKS[^\]]*\][\s\S]*?\[\/(?:ALIA_)?TGLINKS\]\s*/g, '')
|
|
82
|
+
.replace(/\[(?:ALIA_)?TGDOC[^\]]*\]\s*/g, '')
|
|
83
|
+
.replace(/\[(?:ALIA_)?COMPACTLIST[^\]]*\][\s\S]*?\[\/(?:ALIA_)?COMPACTLIST\]\s*/g, '')
|
|
84
|
+
.replace(/\[(?:ALIA_)?BANNER[^\]]*\][\s\S]*?\[\/(?:ALIA_)?BANNER\]\s*/g, '')
|
|
85
|
+
.replace(/\[(?:ALIA_)?COMPARISON[^\]]*\][\s\S]*?\[\/(?:ALIA_)?COMPARISON\]\s*/g, '')
|
|
86
|
+
.replace(/\[(?:ALIA_)?TIMELINE[^\]]*\][\s\S]*?\[\/(?:ALIA_)?TIMELINE\]\s*/g, '')
|
|
87
|
+
.replace(/\[(?:ALIA_)?IMAGE[^\]]*\]/g, '')
|
|
88
|
+
.replace(/\[(?:ALIA_)?CREDIBILITY[^\]]*\]/g, '')
|
|
89
|
+
.replace(TITLE_STRIP_RE, '')
|
|
90
|
+
.trim(),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The turns where another agent comes into the conversation.
|
|
3
|
+
*
|
|
4
|
+
* Agent-authored replies carry `agentInfo`, including the lead's scheduled or proactive replies.
|
|
5
|
+
* The conversation's members (the direct agent or the group's roster) distinguish those from
|
|
6
|
+
* consultations with an outside agent. The thread marks the turn where a consulted agent starts
|
|
7
|
+
* speaking, or starts again after the lead has spoken in between, with a line saying whom the person is now
|
|
8
|
+
* chatting with. Consecutive replies of one agent get the line once; the lead resuming gets none
|
|
9
|
+
* (it is the conversation's own voice) but does reset the run, so the same agent coming back is
|
|
10
|
+
* announced again.
|
|
11
|
+
*
|
|
12
|
+
* Only an agent from OUTSIDE the conversation is announced. The members of a group chat are in
|
|
13
|
+
* it: each speaks as itself, with its own name on its message, as in any group chat, and a line
|
|
14
|
+
* saying whom the person is "now chatting with" at each change of speaker would be wrong.
|
|
15
|
+
*
|
|
16
|
+
* What a consulted agent said is not part of the person's conversation: the lead already answers
|
|
17
|
+
* with it. The thread shows the line and nothing under it, and the line opens the exchange.
|
|
18
|
+
*/
|
|
19
|
+
export interface SpeakerChange {
|
|
20
|
+
/** The agent that starts speaking here. */
|
|
21
|
+
readonly agentName: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function speakerChanges(
|
|
25
|
+
rows: readonly {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly role: string;
|
|
28
|
+
readonly agentInfo?: { readonly id: string; readonly name: string } | null;
|
|
29
|
+
}[],
|
|
30
|
+
/** The direct agent or group members: never announced. */
|
|
31
|
+
members?: ReadonlySet<string>,
|
|
32
|
+
): Map<string, SpeakerChange> {
|
|
33
|
+
const changes = new Map<string, SpeakerChange>();
|
|
34
|
+
let current: string | null = null;
|
|
35
|
+
for (const row of rows) {
|
|
36
|
+
if (row.role !== 'assistant') continue;
|
|
37
|
+
const speaker = row.agentInfo?.id ?? null;
|
|
38
|
+
if (speaker !== null && speaker !== current && row.agentInfo && !members?.has(speaker)) {
|
|
39
|
+
changes.set(row.id, { agentName: row.agentInfo.name });
|
|
40
|
+
}
|
|
41
|
+
current = speaker;
|
|
42
|
+
}
|
|
43
|
+
return changes;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The replies of agents from OUTSIDE the conversation, every one of them: what a consulted agent
|
|
48
|
+
* said, which the thread leaves out under the line that announces it (the exchange it opens has
|
|
49
|
+
* it). A group's members and the lead are never in it.
|
|
50
|
+
*/
|
|
51
|
+
export function consultedReplies(
|
|
52
|
+
rows: readonly {
|
|
53
|
+
readonly id: string;
|
|
54
|
+
readonly role: string;
|
|
55
|
+
readonly agentInfo?: { readonly id: string; readonly name: string } | null;
|
|
56
|
+
}[],
|
|
57
|
+
members?: ReadonlySet<string>,
|
|
58
|
+
): Set<string> {
|
|
59
|
+
const ids = new Set<string>();
|
|
60
|
+
for (const row of rows) {
|
|
61
|
+
if (row.role === 'assistant' && row.agentInfo && !members?.has(row.agentInfo.id)) {
|
|
62
|
+
ids.add(row.id);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return ids;
|
|
66
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function formatDuration(ms: number): string {
|
|
2
|
+
const seconds = Math.floor(ms / 1000);
|
|
3
|
+
if (seconds < 60) return `${seconds}s`;
|
|
4
|
+
const minutes = Math.floor(seconds / 60);
|
|
5
|
+
if (minutes < 60) return `${minutes}m ${seconds % 60}s`;
|
|
6
|
+
const hours = Math.floor(minutes / 60);
|
|
7
|
+
return `${hours}h ${minutes % 60}m`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// The words for a tool — one definition, the SDK's, so its chat and this app name a call alike.
|
|
11
|
+
export { getToolDoneLabel, getToolPillLabel } from '../../tools';
|