@blocksdiy/react-common 1.63.1 → 1.65.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.
@@ -5,10 +5,12 @@ import { type ApprovalCardView, type ApprovalDecision } from "../utils/agui-inte
5
5
  import { type RenderProp } from "../utils/compose-render.js";
6
6
  import { type ComposerMessageMeta } from "../utils/composer-message.js";
7
7
  import { type MessageRunIds, type RunStartedAt } from "../utils/message-run-ids.js";
8
+ import { type ScheduledTrigger } from "../utils/scheduled-trigger.js";
8
9
  export { useTextGrowthAnimating } from "../hooks/text-growth-animation.js";
9
10
  export { type ComposerMessageMeta, FEEDBACK_MESSAGE_NAME, type FeedbackDraft, type FeedbackRate, feedbackComposerMeta, feedbackDraftOf, feedbackMessage, feedbackThreadId, isFeedbackMessage, isFeedbackTag, parseFeedbackContent, parseFeedbackTag, type ParsedFeedback, } from "../utils/composer-message.js";
10
11
  export { MESSAGE_RUN_IDS_EVENT_NAME, messageIdsOfRun, type MessageRunIds, type RunStartedAt, } from "../utils/message-run-ids.js";
11
12
  export { type ApprovalCardView, type ApprovalDecision, toolStepVisibleBelowCards } from "../utils/agui-interrupts.js";
13
+ export { type ScheduledTrigger } from "../utils/scheduled-trigger.js";
12
14
  export { type Message, type AssistantMessage, type UserMessage } from "@ag-ui/client";
13
15
  export { useRenderTool, useDefaultRenderTool, useHumanInTheLoop, useFrontendTool, ToolCallStatus, } from "@copilotkit/react-core/v2";
14
16
  export interface Attachment {
@@ -73,6 +75,12 @@ export interface AgentChatContextValue {
73
75
  role: "assistant" | "user";
74
76
  }[];
75
77
  messageById: Map<string, Message>;
78
+ /**
79
+ * The reminder or schedule that started a turn, keyed by the turn's first message id. A
80
+ * message group starts at each one, so a group whose first message is here draws the line.
81
+ * Optional: a context a host builds by hand may omit it.
82
+ */
83
+ scheduledTriggerByMessageId?: ReadonlyMap<string, ScheduledTrigger>;
76
84
  runIdByMessageId?: MessageRunIds;
77
85
  runStartedAt?: RunStartedAt;
78
86
  toolMessages: ToolMessage[];
@@ -1 +1 @@
1
- {"version":3,"file":"new-agent-chat.d.ts","sourceRoot":"","sources":["../../src/components/new-agent-chat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,OAAO,EAAoB,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAI9G,OAAO,EAAiB,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAEL,SAAS,EACT,cAAc,EAQf,MAAM,OAAO,CAAC;AAMf,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAqBtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAA4B,KAAK,mBAAmB,EAAqB,MAAM,2BAA2B,CAAC;AAElH,OAAO,EAQL,KAAK,aAAa,EAGlB,KAAK,YAAY,EAClB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EACL,KAAK,mBAAmB,EACxB,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,cAAc,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAEnH,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,iBAAiB,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EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,8BAA8B,+BAgBjE"}
@@ -13,6 +13,7 @@ import { ComposeRender } from "../utils/compose-render.js";
13
13
  import { buildArmedMessageContent, userTextOfContent } from "../utils/composer-message.js";
14
14
  import { forwardedLegacyChatId, pinnedLegacyChatThreadId } from "../utils/legacy-chat-thread-id.js";
15
15
  import { claimRunInput, EMPTY_MESSAGE_RUN_IDS, EMPTY_RUN_STARTED_AT, findMessageGroupElement, mergeEntries, MESSAGE_IDS_ATTRIBUTE, messageIdsOfRun, readMessageRunIdsEvent, readRunStartedAtEvent, } from "../utils/message-run-ids.js";
16
+ import { scheduledTriggersByMessageId } from "../utils/scheduled-trigger.js";
16
17
  export { useTextGrowthAnimating } from "../hooks/text-growth-animation.js";
17
18
  export { FEEDBACK_MESSAGE_NAME, feedbackComposerMeta, feedbackDraftOf, feedbackMessage, feedbackThreadId, isFeedbackMessage, isFeedbackTag, parseFeedbackContent, parseFeedbackTag, } from "../utils/composer-message.js";
18
19
  export { MESSAGE_RUN_IDS_EVENT_NAME, messageIdsOfRun, } from "../utils/message-run-ids.js";
@@ -277,6 +278,7 @@ const ChatInitializer = ({ agentBlock, agentChatBlock, token, appId, components,
277
278
  const toolMessages = useMemo(() => {
278
279
  return copilotMessages.filter((message) => message.role === "tool");
279
280
  }, [copilotMessages]);
281
+ const scheduledTriggerByMessageId = useMemo(() => scheduledTriggersByMessageId(copilotMessages), [copilotMessages]);
280
282
  const messageGroups = useMemo(() => {
281
283
  const groups = [];
282
284
  copilotMessages.forEach((message) => {
@@ -284,7 +286,9 @@ const ChatInitializer = ({ agentBlock, agentChatBlock, token, appId, components,
284
286
  return;
285
287
  }
286
288
  const lastGroup = groups[groups.length - 1];
287
- if (!lastGroup || lastGroup.role !== message.role) {
289
+ // A reminder's reply starts its own group even right after the agent's last message, so
290
+ // its trigger line sits above it and not inside the earlier reply.
291
+ if (!lastGroup || lastGroup.role !== message.role || scheduledTriggerByMessageId.has(message.id)) {
288
292
  groups.push({ role: message.role, messageIds: [message.id] });
289
293
  }
290
294
  else {
@@ -292,7 +296,7 @@ const ChatInitializer = ({ agentBlock, agentChatBlock, token, appId, components,
292
296
  }
293
297
  });
294
298
  return groups;
295
- }, [copilotMessages]);
299
+ }, [copilotMessages, scheduledTriggerByMessageId]);
296
300
  const [runIdByMessageId, setRunIdByMessageId] = useState(EMPTY_MESSAGE_RUN_IDS);
297
301
  const [runStartedAt, setRunStartedAt] = useState(EMPTY_RUN_STARTED_AT);
298
302
  const liveRunRef = useRef(null);
@@ -925,6 +929,7 @@ const ChatInitializer = ({ agentBlock, agentChatBlock, token, appId, components,
925
929
  messageGroups,
926
930
  renderToolCall,
927
931
  messageById,
932
+ scheduledTriggerByMessageId,
928
933
  runIdByMessageId,
929
934
  runStartedAt,
930
935
  toolMessages,
@@ -1,6 +1,6 @@
1
1
  declare const THREAD_STATUSES: readonly ["idle", "interrupted", "waiting_on_agent", "busy", "error"];
2
2
  export type AgentThreadStatus = (typeof THREAD_STATUSES)[number];
3
- declare const THREAD_SOURCES: readonly ["direct_chat", "send_message", "feedback", "self_config_resume", "unknown"];
3
+ declare const THREAD_SOURCES: readonly ["direct_chat", "send_message", "feedback", "self_config_resume", "scheduled_reminder", "unknown"];
4
4
  export type AgentThreadSource = (typeof THREAD_SOURCES)[number] | "agent_call";
5
5
  export interface AgentThreadItem {
6
6
  agentId: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"agent-thread-live-update.d.ts","sourceRoot":"","sources":["../../src/hooks/agent-thread-live-update.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,eAAe,uEAAwE,CAAC;AAC9F,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,QAAA,MAAM,cAAc,uFAAwF,CAAC;AAE7G,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,GAAG,YAAY,CA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AO,MAAM,mBAAmB,6CAA8C,CAAC;AAC/E,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAWpE,wGAAwG;AACxG,eAAO,MAAM,gBAAgB,GAAI,QAAQ,iBAAiB,KAAG,gBAAsD,CAAC;AAEpH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,eAAe,EAAE,CAAC;CACzB;AAED,qFAAqF;AACrF,eAAO,MAAM,iBAAiB,GAAI,SAAS,SAAS,eAAe,EAAE,KAAG,oBAAoB,EAM3F,CAAC;AAEF,gHAAgH;AAChH,eAAO,MAAM,gBAAgB,GAAI,KAAK,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,QAAQ,CAAC,KAAG,OAC3B,CAAC;AAEvD,uGAAuG;AACvG,eAAO,MAAM,oBAAoB,GAC/B,KAAK,eAAe,EACpB,SAAS,SAAS,eAAe,EAAE,KAClC,eAAe,GAAG,SAGN,CAAC"}
@@ -1,6 +1,14 @@
1
1
  // Wire types and pure merge logic for the agent-threads index; dependency-free for tests.
2
2
  const THREAD_STATUSES = ["idle", "interrupted", "waiting_on_agent", "busy", "error"];
3
- const THREAD_SOURCES = ["direct_chat", "send_message", "feedback", "self_config_resume", "unknown"];
3
+ const THREAD_SOURCES = [
4
+ "direct_chat",
5
+ "send_message",
6
+ "feedback",
7
+ "self_config_resume",
8
+ // A thread a fired reminder or schedule started (wf-actions-py scheduled_reminder_runner.py).
9
+ "scheduled_reminder",
10
+ "unknown",
11
+ ];
4
12
  /** A thread's identity within its agent: the thread id alone. */
5
13
  export const agentThreadKey = (thread) => thread.chatThreadId;
6
14
  export const isAgentThreadItem = (value) => {
@@ -134,6 +142,7 @@ export const AGENT_THREAD_GROUPS = ["chats", "workflows", "feedback"];
134
142
  const GROUP_OF_SOURCE = {
135
143
  direct_chat: "chats",
136
144
  self_config_resume: "chats",
145
+ scheduled_reminder: "chats",
137
146
  unknown: "chats",
138
147
  send_message: "workflows",
139
148
  feedback: "feedback",
@@ -10,8 +10,10 @@ export interface FloatingAgentChatHandle {
10
10
  /** What to open: a conversation (`{ chatThreadId }`; a deprecated `chatId` on it is ignored), or the new chat. */
11
11
  export type FloatingAgentChatTarget = AgentConversationRef | "new";
12
12
  /**
13
- * How the open session shows: the floating prompt — the new chat as a one-line composer, until
14
- * its first send — or the panel with the conversation. One engine underneath either way.
13
+ * How the open session shows: the panel with the conversation. `prompt` — the new chat as a
14
+ * one-line composer until its first send — is retired: the controller never opens it. The type
15
+ * keeps it for the registry item's faces and the reducers until the item drops the prompt parts
16
+ * (the agent-chat item's RETIRED-PROMPT note says when).
15
17
  */
16
18
  export type FloatingAgentChatFace = "prompt" | "panel";
17
19
  /**
@@ -33,7 +35,7 @@ export interface FloatingAgentChatOpenOptions<Handle extends FloatingAgentChatHa
33
35
  newChatHref?: string;
34
36
  /** Extra context handed to the agent on every turn (like `AgentChat`'s `chatContext`). */
35
37
  chatContext?: unknown;
36
- /** The face to open with — the panel by default; the prompt always opens the new chat. */
38
+ /** Ignored: the controller opens the panel. `prompt` is retired. */
37
39
  face?: FloatingAgentChatFace;
38
40
  }
39
41
  /** The open options with the ids resolved from the handle. */
@@ -1 +1 @@
1
- {"version":3,"file":"floating-agent-chat.d.ts","sourceRoot":"","sources":["../../src/hooks/floating-agent-chat.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,8FAA8F;AAC9F,MAAM,WAAW,uBAAuB;IACtC,0BAA0B,IAAI;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC1F;AAED,kHAAkH;AAClH,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GAAG,KAAK,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,qBAAqB,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U,CAAC,EAAE,2BAA2B,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,4DAA4D;AAC5D,eAAO,MAAM,wBAAwB,GAAI,OAAO,sBAAsB,KAAG,OACI,CAAC;AAE9E;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GAAI,MAAM,SAAS,uBAAuB,EAC/E,MAAM,sBAAsB,CAAC,MAAM,CAAC,GAAG,IAAI,EAC3C,SAAS,4BAA4B,CAAC,MAAM,CAAC,EAC7C,cAAc,MAAM,MAAM,KACzB,sBAAsB,CAAC,MAAM,CA0B/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,+BAA+B,GAAI,MAAM,SAAS,uBAAuB,EACpF,MAAM,sBAAsB,CAAC,MAAM,CAAC,GAAG,IAAI,KAC1C,sBAAsB,CAAC,MAAM,CAAC,GAAG,IACyD,CAAC;AAE9F,MAAM,WAAW,oCAAoC,CACnD,MAAM,SAAS,uBAAuB,GAAG,uBAAuB;IAEhE,0DAA0D;IAC1D,KAAK,EAAE,sBAAsB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC7C,MAAM,EAAE,OAAO,CAAC;IAChB,uGAAuG;IACvG,IAAI,EAAE,CAAC,OAAO,EAAE,4BAA4B,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAC9D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;;OAGG;IACH,aAAa,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,6FAA6F;IAC7F,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,GACzC,MAAM,SAAS,uBAAuB,GAAG,uBAAuB,OAC7D,oCAAoC,CAAC,MAAM,CAwD/C,CAAC"}
@@ -1,10 +1,10 @@
1
1
  // The floating agent chat's state, headless: what the open session shows (which agent, which
2
- // conversation), the face it wears (the floating prompt until a new chat's first send, the panel
3
- // after), the draft the new chat is until that send, and the opener that gets focus back on
4
- // close. The agent-chat registry item renders it. Mirrors the conversation selection rules of
5
- // useAgentConversationSelection: a new chat is a draft minted here and listed nowhere until the
6
- // first send; "New chat" on an untouched draft keeps it; a thread opened beside it leaves it
7
- // standing by. The reducers are pure and tested; the hook is the thin React shell.
2
+ // conversation), the face it wears (the panel; see FloatingAgentChatFace), the draft the new
3
+ // chat is until that send, and the opener that gets focus back on close. The agent-chat registry
4
+ // item renders it. Mirrors the conversation selection rules of useAgentConversationSelection: a
5
+ // new chat is a draft minted here and listed nowhere until the first send; "New chat" on an
6
+ // untouched draft keeps it; a thread opened beside it leaves it standing by. The reducers are
7
+ // pure and tested; the hook is the thin React shell.
8
8
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
9
9
  /** The panel shows the new chat, nothing sent on it yet. */
10
10
  export const isFloatingAgentChatDraft = (state) => state.conversation.chatThreadId === state.draftThreadId && !state.draftSent;
@@ -82,7 +82,7 @@ export const useFloatingAgentChatController = () => {
82
82
  agentChat: options.agentChat,
83
83
  agentChatId,
84
84
  target: options.target ?? "new",
85
- face: options.face ?? "panel",
85
+ face: "panel",
86
86
  expandHref: options.expandHref,
87
87
  newChatHref: options.newChatHref,
88
88
  chatContext: options.chatContext,
@@ -1,10 +1,10 @@
1
- // The platform's door to an app's floating agent prompt. The platform asks through the iframe
2
- // bridge; app-render, which answers the bridge, posts the request here; the app's
3
- // FloatingAgentChatProvider, which renders the prompt, subscribes. Both run in the iframe on
4
- // this one module (`@blocksdiy/react-common/agent-threads` is a UMD external the bundle takes
5
- // from app-render), so no window global is needed. A request posted before the provider mounts
6
- // (the bundle is still loading) waits for it; one nothing claims in time is dropped and the
7
- // platform told — an app built without the prompt.
1
+ // The platform's door to an app's floating agent chat: a new chat with one of its agents, in
2
+ // the panel. The platform asks through the iframe bridge; app-render, which answers the bridge,
3
+ // posts the request here; the app's FloatingAgentChatProvider, which renders the chat,
4
+ // subscribes. Both run in the iframe on this one module (`@blocksdiy/react-common/agent-threads`
5
+ // is a UMD external the bundle takes from app-render), so no window global is needed. A request
6
+ // posted before the provider mounts (the bundle is still loading) waits for it; one nothing
7
+ // claims in time is dropped and the platform told — an app built without the floating chat.
8
8
  /** How long a request waits for a subscriber before it is withdrawn. */
9
9
  export const FLOATING_AGENT_PROMPT_CLAIM_TIMEOUT_MS = 5000;
10
10
  // Read at call time, so a test's fake timers apply.
@@ -1,17 +1,26 @@
1
- import type { FloatingAgentChatExpandHref, FloatingAgentChatHandle, UseFloatingAgentChatControllerResult } from "./floating-agent-chat.js";
1
+ import type { FloatingAgentChatExpandHref, FloatingAgentChatHandle, FloatingAgentChatOpenOptions, UseFloatingAgentChatControllerResult } from "./floating-agent-chat.js";
2
2
  /**
3
- * One agent the prompt can open, as the app resolved it: its id (the agent block's name — what
4
- * the platform asks for), the agent's own chat the session opens, and where the panel's expand
5
- * goes for a conversation started here.
3
+ * One agent on offer, as the app resolved it: its id (the agent block's name — what the
4
+ * platform asks for), the agent's own chat the session opens, and where the panel's expand
5
+ * goes for a conversation started here — and for the new chat, nothing sent on it yet.
6
6
  */
7
7
  export interface FloatingAgentPromptAgentEntry<Handle extends FloatingAgentChatHandle = FloatingAgentChatHandle> {
8
8
  id: string;
9
9
  agentChatId: string;
10
10
  handle: Handle;
11
11
  expandHref?: FloatingAgentChatExpandHref;
12
+ /** The agent's full-page new chat (its mini-app's `/new`); without it the new chat has no expand. */
13
+ newChatHref?: string;
12
14
  }
13
15
  /** The entry for an id, or the first entry when none is named; null for an id not on offer, or without entries. */
14
16
  export declare const resolveFloatingAgentPromptAgent: <Handle extends FloatingAgentChatHandle>(agents: readonly FloatingAgentPromptAgentEntry<Handle>[], agentId?: string) => FloatingAgentPromptAgentEntry<Handle> | null;
17
+ /**
18
+ * The open for one of the agents on offer: a new chat with it, which expands to the agent's
19
+ * new-chat page, and to the thread's page once sent. Null when there is nothing to open — no
20
+ * agents, the agent asked for not among them, an anonymous visitor — so the platform falls back
21
+ * to the agent's own new-chat page.
22
+ */
23
+ export declare const floatingAgentPromptOpen: <Handle extends FloatingAgentChatHandle>(agents: readonly FloatingAgentPromptAgentEntry<Handle>[], agentId: string | undefined, canOpen: boolean, chatContext?: unknown) => FloatingAgentChatOpenOptions<Handle> | null;
15
24
  /** What the open agent's chat lends the prompt, which renders outside it (it shows while the chat loads). */
16
25
  export interface FloatingAgentPromptChat {
17
26
  canSend: boolean;
@@ -24,34 +33,33 @@ export interface FloatingAgentPromptOpenOptions {
24
33
  chatContext?: unknown;
25
34
  }
26
35
  export interface UseFloatingAgentPromptControllerOptions<Handle extends FloatingAgentChatHandle = FloatingAgentChatHandle> {
27
- /** The session the prompt opens: one controller per app. */
36
+ /** The session the doors open: one controller per app. */
28
37
  session: UseFloatingAgentChatControllerResult<Handle>;
29
38
  agents: readonly FloatingAgentPromptAgentEntry<Handle>[];
30
39
  /** False for an anonymous visitor: nothing opens, and the platform's requests go unclaimed. */
31
40
  canOpen: boolean;
32
41
  }
33
42
  export interface UseFloatingAgentPromptControllerResult {
34
- /** The session wears the prompt face. */
43
+ /** The session wears the prompt face: never. */
35
44
  isOpen: boolean;
36
45
  /** The open session's agent, as an entry id; null while nothing is open or for an agent not on offer. */
37
46
  agentId: string | null;
38
- /** True once the prompt opened; false without agents, for an agent not on offer, or for an anonymous visitor. */
47
+ /**
48
+ * Opens a new chat with the agent in the floating chat panel ({@link floatingAgentPromptOpen}).
49
+ * True once it opened; false without agents, for an agent not on offer, or for an anonymous visitor.
50
+ */
39
51
  openPrompt: (options?: FloatingAgentPromptOpenOptions) => boolean;
52
+ /** The prompt's text: always empty. */
40
53
  text: string;
41
54
  setText: (text: string) => void;
42
- /** Counts the opens, re-points included — the message takes focus on each. */
55
+ /** The prompt's opens: always zero. */
43
56
  openCount: number;
44
- /** The open agent's chat is up and free. */
57
+ /** The prompt can send: never. */
45
58
  canSend: boolean;
46
- /** Sends through the open agent's chat; its first send turns the prompt into the panel. */
59
+ /** No-op, like `setText` and `setChat`. */
47
60
  send: (content: string) => void;
48
- /** The open agent's chat lends itself here once it is up, and takes itself back when it goes. */
49
61
  setChat: (chat: FloatingAgentPromptChat | null) => void;
50
62
  }
51
- /**
52
- * The prompt's state and transitions, for the one provider at the app's root. A fresh prompt
53
- * starts empty; re-pointing it at another agent keeps the text; a sent message is the chat's
54
- * (the pill is gone), a refused one stays where it was.
55
- */
63
+ /** The doors, for the one provider at the app's root, with the prompt's fixed state. */
56
64
  export declare const useFloatingAgentPromptController: <Handle extends FloatingAgentChatHandle = FloatingAgentChatHandle>({ session, agents, canOpen, }: UseFloatingAgentPromptControllerOptions<Handle>) => UseFloatingAgentPromptControllerResult;
57
65
  //# sourceMappingURL=floating-agent-prompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"floating-agent-prompt.d.ts","sourceRoot":"","sources":["../../src/hooks/floating-agent-prompt.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,2BAA2B,EAC3B,uBAAuB,EACvB,oCAAoC,EACrC,MAAM,uBAAuB,CAAC;AAG/B;;;;GAIG;AACH,MAAM,WAAW,6BAA6B,CAAC,MAAM,SAAS,uBAAuB,GAAG,uBAAuB;IAC7G,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,2BAA2B,CAAC;CAC1C;AAED,mHAAmH;AACnH,eAAO,MAAM,+BAA+B,GAAI,MAAM,SAAS,uBAAuB,EACpF,QAAQ,SAAS,6BAA6B,CAAC,MAAM,CAAC,EAAE,EACxD,UAAU,MAAM,KACf,6BAA6B,CAAC,MAAM,CAAC,GAAG,IACiD,CAAC;AAE7F,6GAA6G;AAC7G,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,8BAA8B;IAC7C,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ED,MAAM,WAAW,sCAAsC;IACrD,gDAAgD;IAChD,MAAM,EAAE,OAAO,CAAC;IAChB,yGAAyG;IACzG,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;OAGG;IACH,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,8BAA8B,KAAK,OAAO,CAAC;IAClE,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,2CAA2C;IAC3C,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,CAAC,IAAI,EAAE,uBAAuB,GAAG,IAAI,KAAK,IAAI,CAAC;CACzD;AAID,wFAAwF;AACxF,eAAO,MAAM,gCAAgC,GAAI,MAAM,SAAS,uBAAuB,GAAG,uBAAuB,EAAE,+BAIhH,uCAAuC,CAAC,MAAM,CAAC,KAAG,sCAqDpD,CAAC"}
@@ -1,42 +1,42 @@
1
- // The floating agent prompt's state, headless: which of the app's agents it is for, the text
2
- // typed, the opens (the message takes focus on each), what the open agent's chat lends it (can it
3
- // send, the send), and the platform's requests for it (the rail's chat bubble, through
4
- // app-render's mailbox). The session it opens is useFloatingAgentChatController's; the
5
- // agent-chat registry item resolves the agents and renders the prompt.
6
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
1
+ // The floating agent chat's doors for the app's agents, headless: a page's `openPrompt` and the
2
+ // platform's requests for one of the agents (the rail's chat bubble, through app-render's
3
+ // mailbox) open a new chat with the agent in the floating chat panel. The one-line prompt face
4
+ // is retired — the session never wears it — so its state below is fixed; it stays for the
5
+ // agent-chat registry item's prompt parts. The session is useFloatingAgentChatController's; the
6
+ // registry item resolves the agents.
7
+ import { useCallback, useEffect, useMemo, useRef } from "react";
7
8
  import { subscribeFloatingAgentPromptRequests } from "./floating-agent-prompt-requests.js";
8
9
  /** The entry for an id, or the first entry when none is named; null for an id not on offer, or without entries. */
9
10
  export const resolveFloatingAgentPromptAgent = (agents, agentId) => (agentId === undefined ? agents[0] : agents.find((entry) => entry.id === agentId)) ?? null;
10
11
  /**
11
- * The prompt's state and transitions, for the one provider at the app's root. A fresh prompt
12
- * starts empty; re-pointing it at another agent keeps the text; a sent message is the chat's
13
- * (the pill is gone), a refused one stays where it was.
12
+ * The open for one of the agents on offer: a new chat with it, which expands to the agent's
13
+ * new-chat page, and to the thread's page once sent. Null when there is nothing to open — no
14
+ * agents, the agent asked for not among them, an anonymous visitor — so the platform falls back
15
+ * to the agent's own new-chat page.
14
16
  */
17
+ export const floatingAgentPromptOpen = (agents, agentId, canOpen, chatContext) => {
18
+ const entry = resolveFloatingAgentPromptAgent(agents, agentId);
19
+ if (!entry || !canOpen) {
20
+ return null;
21
+ }
22
+ return { agentChat: entry.handle, expandHref: entry.expandHref, newChatHref: entry.newChatHref, chatContext };
23
+ };
24
+ const noop = () => { };
25
+ /** The doors, for the one provider at the app's root, with the prompt's fixed state. */
15
26
  export const useFloatingAgentPromptController = ({ session, agents, canOpen, }) => {
16
27
  const { state, open } = session;
17
- const isOpen = state !== null && state.face === "prompt";
18
- const [text, setText] = useState("");
19
- const [openCount, setOpenCount] = useState(0);
20
- const [chat, setChat] = useState(null);
21
- // Opens the prompt for an agent; false when there is nothing to open — no agents, the agent
22
- // asked for not among them, an anonymous visitor.
28
+ // Opens the agent's new chat; false when there is nothing to open.
23
29
  const openFor = useCallback((agentId, chatContext) => {
24
- const entry = resolveFloatingAgentPromptAgent(agents, agentId);
25
- if (!entry || !canOpen) {
26
- return false;
27
- }
28
- if (!isOpen) {
29
- setText("");
30
+ const openOptions = floatingAgentPromptOpen(agents, agentId, canOpen, chatContext);
31
+ if (openOptions) {
32
+ open(openOptions);
30
33
  }
31
- setOpenCount((count) => count + 1);
32
- // No `newChatHref`: the prompt has no header, and its first send makes the new chat a thread.
33
- open({ agentChat: entry.handle, face: "prompt", expandHref: entry.expandHref, chatContext });
34
- return true;
35
- }, [agents, canOpen, isOpen, open]);
34
+ return openOptions !== null;
35
+ }, [agents, canOpen, open]);
36
36
  const openPrompt = useCallback((options) => {
37
37
  const opened = openFor(options?.agent, options?.chatContext);
38
38
  if (!opened) {
39
- console.warn("Floating agent prompt: nothing to open — it needs agents on offer (the one asked for among them) and a signed-in user.");
39
+ console.warn("Floating agent chat: nothing to open — it needs agents on offer (the one asked for among them) and a signed-in user.");
40
40
  }
41
41
  return opened;
42
42
  }, [openFor]);
@@ -50,7 +50,15 @@ export const useFloatingAgentPromptController = ({ session, agents, canOpen, })
50
50
  }, [openFor]);
51
51
  useEffect(() => subscribeFloatingAgentPromptRequests((request) => openForRef.current(request.agent)), []);
52
52
  const agentId = state === null ? null : (agents.find((entry) => entry.agentChatId === state.agentChatId)?.id ?? null);
53
- const canSend = chat?.canSend ?? false;
54
- const send = useCallback((content) => chat?.send(content), [chat]);
55
- return useMemo(() => ({ isOpen, agentId, openPrompt, text, setText, openCount, canSend, send, setChat }), [isOpen, agentId, openPrompt, text, openCount, canSend, send]);
53
+ return useMemo(() => ({
54
+ isOpen: false,
55
+ agentId,
56
+ openPrompt,
57
+ text: "",
58
+ setText: noop,
59
+ openCount: 0,
60
+ canSend: false,
61
+ send: noop,
62
+ setChat: noop,
63
+ }), [agentId, openPrompt]);
56
64
  };
@@ -120,9 +120,9 @@ export interface IframeApi extends Methods {
120
120
  */
121
121
  onLockChatComponentFocus: (isLocked: boolean) => Promise<void>;
122
122
  /**
123
- * Opens the app's floating agent prompt for one of its agents (`agent` is the agent's block
124
- * name). Resolves `false` when nothing in the app took the request — an app built without the
125
- * prompt — so the platform can fall back to the agent's own new-chat page.
123
+ * Opens a new chat with one of the app's agents in its floating agent chat panel (`agent` is
124
+ * the agent's block name). Resolves `false` when nothing in the app took the request — an app
125
+ * built without the floating chat — so the platform can fall back to the agent's own new-chat page.
126
126
  */
127
127
  onOpenAgentPrompt: (args: {
128
128
  agent: string;
@@ -0,0 +1,18 @@
1
+ export interface ScheduledTrigger {
2
+ /** "reminder": one the agent set in chat. "schedule": one the app's builder created. */
3
+ kind: "reminder" | "schedule";
4
+ /** Absent on a fire from before the line existed. */
5
+ title?: string;
6
+ recurring?: boolean;
7
+ }
8
+ interface MessageLike {
9
+ id?: string;
10
+ role?: string;
11
+ metadata?: unknown;
12
+ }
13
+ /** The trigger stamped on a message, or null when it carries none. */
14
+ export declare function scheduledTriggerOf(message: MessageLike): ScheduledTrigger | null;
15
+ /** Each stamped message's trigger, by message id: a message group starting there draws the line. */
16
+ export declare function scheduledTriggersByMessageId(messages: readonly MessageLike[]): ReadonlyMap<string, ScheduledTrigger>;
17
+ export {};
18
+ //# sourceMappingURL=scheduled-trigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduled-trigger.d.ts","sourceRoot":"","sources":["../../src/utils/scheduled-trigger.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,gBAAgB;IAC/B,wFAAwF;IACxF,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAC9B,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,WAAW;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAKD,sEAAsE;AACtE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,gBAAgB,GAAG,IAAI,CAgBhF;AAED,oGAAoG;AACpG,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CASpH"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The line a chat draws above a turn a fired reminder (or app schedule) started.
3
+ *
4
+ * The run's prompt is hidden, so the agent's reply would read as if the agent spoke on its own.
5
+ * Chat load stamps the fire's details on that reply, `metadata["blocks.scheduledTrigger"]` on the
6
+ * agent's first message of the turn (wf-actions-py `scheduled_trigger.py`); this reads it. Never
7
+ * parse the prompt's text: it is for the model, not data.
8
+ */
9
+ const SCHEDULED_TRIGGER_METADATA_KEY = "blocks.scheduledTrigger";
10
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
11
+ /** The trigger stamped on a message, or null when it carries none. */
12
+ export function scheduledTriggerOf(message) {
13
+ if (message.role !== "assistant" || !isRecord(message.metadata)) {
14
+ return null;
15
+ }
16
+ const stamp = message.metadata[SCHEDULED_TRIGGER_METADATA_KEY];
17
+ if (!isRecord(stamp)) {
18
+ return null;
19
+ }
20
+ const trigger = { kind: stamp.kind === "schedule" ? "schedule" : "reminder" };
21
+ if (typeof stamp.title === "string" && stamp.title) {
22
+ trigger.title = stamp.title;
23
+ }
24
+ if (typeof stamp.recurring === "boolean") {
25
+ trigger.recurring = stamp.recurring;
26
+ }
27
+ return trigger;
28
+ }
29
+ /** Each stamped message's trigger, by message id: a message group starting there draws the line. */
30
+ export function scheduledTriggersByMessageId(messages) {
31
+ const byMessageId = new Map();
32
+ for (const message of messages) {
33
+ const trigger = message.id ? scheduledTriggerOf(message) : null;
34
+ if (trigger && message.id) {
35
+ byMessageId.set(message.id, trigger);
36
+ }
37
+ }
38
+ return byMessageId;
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocksdiy/react-common",
3
- "version": "1.63.1",
3
+ "version": "1.65.0",
4
4
  "type": "module",
5
5
  "description": "React common",
6
6
  "keywords": [],