@ai-matrx/chat 0.7.30 → 0.7.32

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ai-matrx/chat
2
2
 
3
+ ## 0.7.32
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/chat/v0.7.31..npm/chat/v0.7.32 -- apps/shared/chat`).
7
+ No source changes intended and no consumer action required.
8
+
9
+ ## 0.7.31
10
+
11
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
12
+ `git diff npm/chat/v0.7.30..npm/chat/v0.7.31 -- apps/shared/chat`).
13
+ No source changes intended and no consumer action required.
14
+
3
15
  ## 0.7.30
4
16
 
5
17
  Automatic changed-only republish (docs/metadata drift since the last tag — see
@@ -20,7 +20,7 @@ export declare function surfaceNameForKind(kind: WorkingDocumentKind): string;
20
20
  export declare function sourceFeatureForKind(kind: WorkingDocumentKind): SourceFeature;
21
21
  /** `UnifiedAgentContextMenu` prop bundle for a document kind. */
22
22
  export declare function workingDocumentContextMenuProps(kind: WorkingDocumentKind): {
23
- sourceFeature: "action_request_continuation" | "action_request_credential" | "action_request_one_time_code" | "action_request_park" | "action_request_resolve" | "admin" | "agent" | "agent-app" | "agent-builder" | "agent-comparison" | "agent-factory" | "agent-generator" | "agent-runner" | "agent-service" | "agent-studio" | "agent_blocks" | "agent_call" | "agent_factory.copy_probe" | "agent_factory.tool_probe" | "agent_flow_v1" | "agent_foundry_v1" | "agent_run" | "agent_structure_builder" | "agent_tool" | "agent_usage_sync" | "agents-other" | "ai-results" | "ai_judge" | "analysis-studio" | "auto_ingest" | "auto_ingest_ner" | "background_agent" | "billing" | "browser_handoff_delegate" | "browser_handoff_resolve" | "browser_session_health" | "builtin_agent" | "builtin_categorize" | "canvas" | "chat" | "chat-canary" | "claude-code" | "clean_pdf_extracted_content" | "client-unmapped" | "cloud_browser.local_login_learning" | "cms" | "code-editor" | "codex" | "coding_session_bridge.backfill" | "coding_session_native" | "coding_session_reply" | "communications.sms" | "conductor" | "content-extractor" | "content_plan_acceptance" | "content_plan_cms_fill" | "content_plan_cms_fill_preview" | "content_plan_deepen" | "content_plan_generate" | "content_processing" | "content_processing.research_landing" | "content_processing.transcript_landing" | "content_processing_upload_hook" | "context-parity" | "context_compare_answer" | "context_follow_listener" | "context_summary" | "conversation" | "conversation_context" | "conversation_crash_recovery" | "conversation_fork" | "conversation_resume" | "coverage" | "crawl_run" | "crm" | "crm.media_list_refresh" | "crm.media_list_research" | "crm.party_kind" | "crm.personalization" | "cursor" | "deep_research_v1" | "deferred_claim_recovery" | "dictionary" | "distillation_coherence" | "doc_verify" | "documents" | "education-analytics" | "education-assessment" | "education-fastfire" | "education-flashcards" | "education-ingest" | "education-media-reconcile" | "education-mindmap" | "education-planner" | "education-tutor" | "education_card_image_generator" | "education_card_image_prompt_writer" | "education_card_image_qc_judge" | "education_card_image_rot" | "education_card_image_web_source" | "education_card_images" | "education_study_pack" | "education_study_pack_v2" | "endpoint_family_sweep" | "external_url_change" | "files" | "fork_and_run" | "google_workspace.approval_replay" | "group_chat_cadence" | "hindsight" | "hindsight/crystallization" | "hindsight/wire_replay" | "hindsight_replay" | "hindsight_replay_worker" | "hindsight_shadow_recompilation" | "hr" | "human_decisions" | "image-studio" | "incident-assurance" | "internal" | "judge" | "kg_clustering_namer" | "legal" | "local_proxy" | "mandate_candidate_review" | "mandates.batch_lane" | "manual" | "marketing" | "masterwork" | "masterwork_audition_elicitation_vanilla" | "masterwork_audition_outcome_vanilla" | "masterwork_audition_unfolding_vanilla" | "masterwork_audition_vanilla" | "masterwork_bench_a2" | "masterwork_bench_extract" | "masterwork_bench_judge" | "masterwork_bench_panel" | "masterwork_build" | "masterwork_recovery" | "media_catalog" | "media_heal" | "meet:after_meeting_workflow" | "mermaid-workbench" | "messages" | "ner" | "news_monitor" | "notes" | "notify_listener" | "outcome_attribution" | "outreach" | "page_extraction" | "page_extraction_retry" | "pdf-cleaner" | "pdf-extractor" | "pdf-widgets" | "personal-staff" | "personal_staff_workspace_listener" | "platform_checks" | "platform_checks_drain" | "podcasts" | "print" | "product_capture_intake" | "product_capture_research" | "projects" | "prompt" | "proof_run:content_plan_family_grounding" | "proof_run:news_self_validating" | "provenance" | "provider_outage" | "rag" | "rag-search" | "rag.page_clean" | "rag_chunk_contextualizer" | "rag_hyde_generator" | "rag_pdf_page_cleaner" | "rag_query_expander" | "reachability" | "realtime" | "realtime_tool" | "registry_ingestion.pass" | "request_snapshot_blob" | "reroute" | "research" | "research_condenser_1" | "research_condenser_2" | "research_refresh_dispatch" | "row_history" | "scanner" | "scheduled" | "schema_coerce" | "scraper" | "scratchpad" | "screen_tool_run" | "seo" | "seo.engine_schedule_dispatcher" | "seo.keyword_place_backfill" | "seo.page_analysis" | "seo.rank_schedule" | "seo_analysis_sweep" | "seo_keyword_research" | "server-door" | "server-run" | "sharing" | "sms-assistant" | "sms-outbound" | "socket_compat" | "source_intelligence" | "staff-inbox-driver" | "suggestion_sweep" | "summarize_content" | "sweep_listener" | "system" | "tasks" | "test.agent_factory.intake" | "tool-call-visualization" | "tool-testing" | "transcription" | "udt" | "vision_interview" | "vision_interview_tracker" | "voice-agent" | "vscode" | "web-capture" | "web_crawl_crash_resume" | "web_crawl_schedule_dispatch" | "web_research" | "web_url_announce" | "whole_value_follower" | "workflow_decision_fallback" | "workflow_extract_sweep" | "workflow_holder_proof" | "workflow_node_test" | "workflow_plan_assist" | "workflow_recovery_advisor" | "workflow_recovery_push" | "workflow_recovery_resolve" | "workflow_run" | "workflow_run_assists" | "workflow_worker" | "working-document" | "youtube_research_processing" | "youtube_transcription";
23
+ sourceFeature: "action_request_continuation" | "action_request_credential" | "action_request_one_time_code" | "action_request_park" | "action_request_resolve" | "admin" | "agent" | "agent-app" | "agent-builder" | "agent-comparison" | "agent-factory" | "agent-generator" | "agent-mail" | "agent-runner" | "agent-service" | "agent-studio" | "agent_blocks" | "agent_call" | "agent_factory.copy_probe" | "agent_factory.tool_probe" | "agent_flow_v1" | "agent_foundry_v1" | "agent_run" | "agent_structure_builder" | "agent_tool" | "agent_usage_sync" | "agents-other" | "ai-results" | "ai_judge" | "analysis-studio" | "auto_ingest" | "auto_ingest_ner" | "background_agent" | "billing" | "browser_handoff_delegate" | "browser_handoff_resolve" | "browser_session_health" | "builtin_agent" | "builtin_categorize" | "canvas" | "chat" | "chat-canary" | "claude-code" | "clean_pdf_extracted_content" | "client-unmapped" | "cloud_browser.local_login_learning" | "cms" | "code-editor" | "codex" | "coding_session_bridge.backfill" | "coding_session_native" | "coding_session_reply" | "communications.sms" | "conductor" | "content-extractor" | "content_plan_acceptance" | "content_plan_cms_fill" | "content_plan_cms_fill_preview" | "content_plan_deepen" | "content_plan_generate" | "content_processing" | "content_processing.research_landing" | "content_processing.transcript_landing" | "content_processing_upload_hook" | "context-parity" | "context_compare_answer" | "context_follow_listener" | "context_summary" | "conversation" | "conversation_context" | "conversation_crash_recovery" | "conversation_fork" | "conversation_resume" | "coverage" | "crawl_run" | "crm" | "crm.media_list_refresh" | "crm.media_list_research" | "crm.party_kind" | "crm.personalization" | "cursor" | "deep_research_v1" | "deferred_claim_recovery" | "dictionary" | "distillation_coherence" | "doc_verify" | "documents" | "education-analytics" | "education-assessment" | "education-fastfire" | "education-flashcards" | "education-ingest" | "education-kit-outline" | "education-media-reconcile" | "education-mindmap" | "education-planner" | "education-tutor" | "education_card_image_generator" | "education_card_image_prompt_writer" | "education_card_image_qc_judge" | "education_card_image_rot" | "education_card_image_web_source" | "education_card_images" | "education_study_pack" | "education_study_pack_v2" | "endpoint_family_sweep" | "external_url_change" | "files" | "fork_and_run" | "google_workspace.approval_replay" | "group_chat_cadence" | "hindsight" | "hindsight/crystallization" | "hindsight/wire_replay" | "hindsight_replay" | "hindsight_replay_worker" | "hindsight_shadow_recompilation" | "hr" | "human_decisions" | "image-studio" | "incident-assurance" | "internal" | "judge" | "kg_clustering_namer" | "legal" | "local_proxy" | "mandate_candidate_review" | "mandates.batch_lane" | "manual" | "marketing" | "masterwork" | "masterwork_audition_elicitation_vanilla" | "masterwork_audition_outcome_vanilla" | "masterwork_audition_unfolding_vanilla" | "masterwork_audition_vanilla" | "masterwork_bench_a2" | "masterwork_bench_extract" | "masterwork_bench_judge" | "masterwork_bench_panel" | "masterwork_build" | "masterwork_recovery" | "media_catalog" | "media_heal" | "meet:after_meeting_workflow" | "mermaid-workbench" | "messages" | "ner" | "news_monitor" | "notes" | "notify_listener" | "outcome_attribution" | "outreach" | "page_extraction" | "page_extraction_retry" | "pdf-cleaner" | "pdf-extractor" | "pdf-widgets" | "personal-staff" | "personal_staff_workspace_listener" | "platform_checks" | "platform_checks_drain" | "podcasts" | "print" | "product_capture_intake" | "product_capture_research" | "projects" | "prompt" | "proof_run:content_plan_family_grounding" | "proof_run:news_self_validating" | "provenance" | "provider_outage" | "rag" | "rag-search" | "rag.page_clean" | "rag_chunk_contextualizer" | "rag_hyde_generator" | "rag_pdf_page_cleaner" | "rag_query_expander" | "reachability" | "realtime" | "realtime_tool" | "registry_ingestion.pass" | "request_snapshot_blob" | "reroute" | "research" | "research_condenser_1" | "research_condenser_2" | "research_refresh_dispatch" | "row_history" | "scanner" | "scheduled" | "schema_coerce" | "scraper" | "scratchpad" | "screen_tool_run" | "seo" | "seo.engine_schedule_dispatcher" | "seo.keyword_place_backfill" | "seo.page_analysis" | "seo.rank_schedule" | "seo_analysis_sweep" | "seo_keyword_research" | "server-door" | "server-run" | "sharing" | "sms-assistant" | "sms-outbound" | "socket_compat" | "source_intelligence" | "staff-inbox-driver" | "suggestion_sweep" | "summarize_content" | "sweep_listener" | "system" | "tasks" | "test.agent_factory.intake" | "tool-call-visualization" | "tool-testing" | "transcription" | "udt" | "vision_interview" | "vision_interview_tracker" | "voice-agent" | "vscode" | "web-capture" | "web_crawl_crash_resume" | "web_crawl_schedule_dispatch" | "web_research" | "web_url_announce" | "whole_value_follower" | "workflow_decision_fallback" | "workflow_extract_sweep" | "workflow_holder_proof" | "workflow_node_test" | "workflow_plan_assist" | "workflow_recovery_advisor" | "workflow_recovery_push" | "workflow_recovery_resolve" | "workflow_run" | "workflow_run_assists" | "workflow_worker" | "working-document" | "youtube_research_processing" | "youtube_transcription";
24
24
  surfaceName: string;
25
25
  isEditable: true;
26
26
  enabledPlacements: ("ai-action" | "content-block" | "quick-action")[];
@@ -0,0 +1,20 @@
1
+ import { type HeadlessAgentJsonResult } from "../redux/execution-system/thunks/run-headless-agent-json.js";
2
+ export interface ComposerStructuredRunOptions<T> {
3
+ /** The conversation the page launched and the composer sends. */
4
+ conversationId: string | null | undefined;
5
+ /** Stable surface key (telemetry, the same key the launcher used). */
6
+ surfaceKey: string;
7
+ /** Variables the page supplies whole — hidden from the form, still sent. */
8
+ pageOwnedVariables?: readonly string[];
9
+ /** Narrow the extracted value; throw for an unusable answer. */
10
+ coerce: (value: unknown, result: HeadlessAgentJsonResult) => T;
11
+ /** The answer, once a sent run finishes and extracts. */
12
+ onResult: (answer: T, requestId: string) => void;
13
+ /** The run failed or its answer could not be used. */
14
+ onError: (message: string, requestId: string) => void;
15
+ /** A run the composer just sent (the page shows its own progress). */
16
+ onStart?: (requestId: string) => void;
17
+ }
18
+ export declare function useComposerStructuredRun<T>({ conversationId, surfaceKey, pageOwnedVariables, coerce, onResult, onError, onStart, }: ComposerStructuredRunOptions<T>): {
19
+ running: boolean;
20
+ };
@@ -0,0 +1,75 @@
1
+ "use client";
2
+ import { useEffect, useRef, useState } from "react";
3
+ import { useAppDispatch, useAppSelector, useAppStore } from "../../store/hooks.js";
4
+ import { selectLatestRequestId } from "../redux/execution-system/selectors/aggregate.selectors.js";
5
+ import { setPageOwnedVariableNames } from "../redux/execution-system/instance-variable-values/instance-variable-values.slice.js";
6
+ import {
7
+ adoptHeadlessAgentJson
8
+ } from "../redux/execution-system/thunks/run-headless-agent-json.js";
9
+ function useComposerStructuredRun({
10
+ conversationId,
11
+ surfaceKey,
12
+ pageOwnedVariables,
13
+ coerce,
14
+ onResult,
15
+ onError,
16
+ onStart
17
+ }) {
18
+ const dispatch = useAppDispatch();
19
+ const store = useAppStore();
20
+ const [running, setRunning] = useState(false);
21
+ const latest = useAppSelector(
22
+ (state) => conversationId ? selectLatestRequestId(conversationId)(state) : void 0
23
+ );
24
+ const seen = useRef({
25
+ conversationId: null,
26
+ ids: /* @__PURE__ */ new Set()
27
+ });
28
+ const callbacks = useRef({ coerce, onResult, onError, onStart });
29
+ useEffect(() => {
30
+ callbacks.current = { coerce, onResult, onError, onStart };
31
+ });
32
+ const ownedKey = (pageOwnedVariables ?? []).join("\0");
33
+ useEffect(() => {
34
+ if (!conversationId || !ownedKey) return;
35
+ dispatch(setPageOwnedVariableNames({ conversationId, names: ownedKey.split("\0") }));
36
+ }, [dispatch, conversationId, ownedKey]);
37
+ useEffect(() => {
38
+ if (!conversationId) return;
39
+ if (seen.current.conversationId !== conversationId) {
40
+ seen.current = { conversationId, ids: new Set(latest ? [latest] : []) };
41
+ return;
42
+ }
43
+ if (!latest || seen.current.ids.has(latest)) return;
44
+ seen.current.ids.add(latest);
45
+ const requestId = latest;
46
+ setRunning(true);
47
+ callbacks.current.onStart?.(requestId);
48
+ void adoptHeadlessAgentJson(dispatch, store.getState, {
49
+ requestId,
50
+ conversationId,
51
+ surfaceKey,
52
+ expect: "json",
53
+ keepInstance: true
54
+ }).then((result) => {
55
+ if (!result.success) {
56
+ callbacks.current.onError(
57
+ [result.error, result.errorDetail].filter(Boolean).join(" \u2014 ") || "The run returned no answer.",
58
+ requestId
59
+ );
60
+ return;
61
+ }
62
+ try {
63
+ callbacks.current.onResult(callbacks.current.coerce(result.data, result), requestId);
64
+ } catch (err) {
65
+ callbacks.current.onError(err instanceof Error ? err.message : String(err), requestId);
66
+ }
67
+ }).catch((err) => {
68
+ callbacks.current.onError(err instanceof Error ? err.message : String(err), requestId);
69
+ }).finally(() => setRunning(false));
70
+ }, [dispatch, store, conversationId, latest, surfaceKey]);
71
+ return { running };
72
+ }
73
+ export {
74
+ useComposerStructuredRun
75
+ };
@@ -53,7 +53,9 @@ const selectVisibleInputDefinitions = (conversationId) => {
53
53
  (entry, items) => {
54
54
  if (!entry || entry.definitions.length === 0) return EMPTY_DEFS;
55
55
  const effective = applyInheritedComponents(entry.definitions, items);
56
+ const pageOwned = entry.pageOwnedNames ?? [];
56
57
  const visible = effective.filter((d) => {
58
+ if (pageOwned.includes(d.name)) return false;
57
59
  if (isCustomDataBinding(d.binding)) return false;
58
60
  if (!isBound(d)) return true;
59
61
  return isEmptyVal(entry.scopeValues[d.name]);
@@ -62,6 +62,14 @@ export interface InstanceVariableValuesEntry {
62
62
  * the name leaves this list: it is now genuinely hers.
63
63
  */
64
64
  hostValueNames: string[];
65
+ /**
66
+ * Variables the PAGE supplies whole and the person never edits (an
67
+ * organization's facts, the tables a builder may reuse, today's date): they
68
+ * ship with the run like any value, but the variable form never draws them
69
+ * as fields — only the variables the person fills appear (Arman, 2026-10-09:
70
+ * "variables are the stars of the show"). Absent = none.
71
+ */
72
+ pageOwnedNames?: string[];
65
73
  /** Immutable payload rendered only with the first submitted user turn. */
66
74
  submittedFirstTurnValues: Record<string, unknown> | null;
67
75
  submittedFirstTurnHostValueNames: string[];
@@ -86,7 +94,10 @@ export declare const initInstanceVariables: import("@reduxjs/toolkit").ActionCre
86
94
  }, "instanceVariableValues/setUserVariableValues">, setHostVariableValues: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
87
95
  conversationId: string;
88
96
  values: Record<string, unknown>;
89
- }, "instanceVariableValues/setHostVariableValues">, restoreVariableValues: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
97
+ }, "instanceVariableValues/setHostVariableValues">, setPageOwnedVariableNames: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
98
+ conversationId: string;
99
+ names: string[];
100
+ }, "instanceVariableValues/setPageOwnedVariableNames">, restoreVariableValues: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
90
101
  conversationId: string;
91
102
  values: Record<string, unknown>;
92
103
  /** The subset of `values` the host wired. Omitted = all of it is hers. */
@@ -78,6 +78,15 @@ const instanceVariableValuesSlice = createSlice({
78
78
  }
79
79
  entry.hostValueNames = names;
80
80
  },
81
+ /**
82
+ * Name the variables this page supplies whole (see `pageOwnedNames`): the
83
+ * form hides them; their values still ship.
84
+ */
85
+ setPageOwnedVariableNames(state, action) {
86
+ const entry = state.byConversationId[action.payload.conversationId];
87
+ if (!entry) return;
88
+ entry.pageOwnedNames = [...new Set(action.payload.names)];
89
+ },
81
90
  /**
82
91
  * Put back a set of ALREADY-RESOLVED values TOGETHER WITH THEIR AUTHORSHIP.
83
92
  *
@@ -259,6 +268,7 @@ const {
259
268
  setUserVariableValue,
260
269
  setUserVariableValues,
261
270
  setHostVariableValues,
271
+ setPageOwnedVariableNames,
262
272
  restoreVariableValues,
263
273
  stampSubmittedFirstTurnValues,
264
274
  clearSubmittedFirstTurnValues,
@@ -287,6 +297,7 @@ export {
287
297
  resetUserVariableValues,
288
298
  restoreVariableValues,
289
299
  setHostVariableValues,
300
+ setPageOwnedVariableNames,
290
301
  setRuntimeVariableResourcePolicy,
291
302
  setScopeVariableValues,
292
303
  setUserVariableValue,
@@ -117,6 +117,7 @@ function serviceProxy(key) {
117
117
  {},
118
118
  {
119
119
  get: (_t, prop) => {
120
+ if (typeof prop === "symbol" || prop === "$$typeof" || prop === "__esModule" || prop === "then") return void 0;
120
121
  const service = source.get(key);
121
122
  const member = service?.[prop];
122
123
  return typeof member === "function" ? member.bind(service) : member;
@@ -139,7 +139,7 @@ function MessengerRail({
139
139
  "data-collapsed": collapsed ? "true" : "false",
140
140
  className: cn(
141
141
  "flex h-full shrink-0 flex-col border-r border-border bg-muted/40 py-2 transition-[width] duration-150",
142
- collapsed ? "w-16 px-2" : "w-36 px-2",
142
+ collapsed ? "w-16 px-2" : "w-40 px-2",
143
143
  className
144
144
  ),
145
145
  children: [
@@ -6,6 +6,7 @@ import { TextInputDialog } from "@ai-matrx/design-system";
6
6
  import { useAppDispatch, useAppSelector } from "../../store/hooks.js";
7
7
  import { useMandateSet } from "../../mandates/useMandateSet.js";
8
8
  import { fetchConversationHistory } from "../../agents/redux/conversation-history/thunks.js";
9
+ import { setScopeLanes } from "../../agents/redux/conversation-history/slice.js";
9
10
  import { renameConversation } from "../../agents/redux/conversation-list/conversation-row-actions.thunks.js";
10
11
  import { ChatRoomClient } from "../../agents/components/chat/ChatRoomClient.js";
11
12
  import { ChatRoomSkeleton } from "../../agents/components/chat/ChatRoomSkeleton.js";
@@ -35,6 +36,7 @@ const SPACE_ALL = "all";
35
36
  const SPACE_PINNED = "pinned";
36
37
  const SPACE_MANAGE = "manage";
37
38
  const STARTER_LABEL = "Starter";
39
+ const THREAD_LANES = ["chat"];
38
40
  const DEFAULT_HREFS = {
39
41
  agent: (id) => `/agents/${id}`,
40
42
  editAgent: (id) => `/agents/${id}/build`,
@@ -157,7 +159,10 @@ function useAgentsMessengerSource(options = {}) {
157
159
  return [...ids];
158
160
  }, [roster.agents, person.threads]);
159
161
  const loadThreads = useCallback(
160
- (agentId, replace = true) => dispatch(fetchConversationHistory({ scopeId: scopeIdOf(agentId), agentIds: [agentId], pageSize: PAGE_SIZE, replace })),
162
+ (agentId, replace = true) => {
163
+ dispatch(setScopeLanes({ scopeId: scopeIdOf(agentId), lanes: [...THREAD_LANES] }));
164
+ return dispatch(fetchConversationHistory({ scopeId: scopeIdOf(agentId), agentIds: [agentId], pageSize: PAGE_SIZE, replace }));
165
+ },
161
166
  [dispatch]
162
167
  );
163
168
  const threadKey = threadAgentIds.join(",");
@@ -187,17 +192,17 @@ function useAgentsMessengerSource(options = {}) {
187
192
  const [space, setSpace] = useState(SPACE_ALL);
188
193
  const [manageOpen, setManageOpen] = useState(false);
189
194
  const [renaming, setRenaming] = useState(null);
195
+ const pinnedThreadIds = useMemo(() => new Set(person.threads.keys()), [person.threads]);
190
196
  const currentThreadOf = useCallback(
191
197
  (agentId) => {
192
198
  const choice = choices[agentId];
193
199
  if (choice) return choice.conversationId;
194
200
  const scope = scopes[scopeIdOf(agentId)];
195
201
  if (!scope || scope.status === "idle" || scope.status === "loading" && scope.items.length === 0) return void 0;
196
- return scope.items[0]?.conversationId ?? null;
202
+ return scope.items.find((t) => !pinnedThreadIds.has(t.conversationId))?.conversationId ?? null;
197
203
  },
198
- [choices, scopes]
204
+ [choices, scopes, pinnedThreadIds]
199
205
  );
200
- const pinnedThreadIds = useMemo(() => new Set(person.threads.keys()), [person.threads]);
201
206
  const openAgentThread = useCallback(
202
207
  (agentId, conversationId) => {
203
208
  setManageOpen(false);
@@ -307,7 +312,7 @@ function useAgentsMessengerSource(options = {}) {
307
312
  id: agentRowId(row.agentId),
308
313
  name: nameOf(row.agentId),
309
314
  avatar: { kind: "monogram" },
310
- preview: row.latest ? threadTitle(row.latest) : seatOf(row.agentId) ? STARTER_LABEL : void 0,
315
+ preview: row.latest ? threadTitle(row.latest) : void 0,
311
316
  time: relativeDate(row.latest?.updatedAt),
312
317
  pinned: row.pinned,
313
318
  searchText: info.get(row.agentId)?.description ?? void 0
@@ -91,7 +91,8 @@ function orderRows({ roster, threadsByAgent, pinnedThreads }) {
91
91
  row: {
92
92
  kind: "agent",
93
93
  agentId: agent.agentId,
94
- latest: threadsByAgent.get(agent.agentId)?.[0] ?? null,
94
+ // A pinned thread has its own row, so the agent row previews its latest OTHER thread.
95
+ latest: threadsByAgent.get(agent.agentId)?.find((t) => !pinnedThreads.has(t.conversationId)) ?? null,
95
96
  pinned: agent.pinned
96
97
  }
97
98
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/chat",
3
- "version": "0.7.30",
3
+ "version": "0.7.32",
4
4
  "description": "THE one AI Matrx person-to-agent chat system: the full chat (running agents, conversations, tool calls, streaming, context, surfaces, voice) as explicit per-module subpaths @ai-matrx/chat/<domain>/<module> (no wildcards: scripts/public-modules.json) over a host contract (/host, /host/react) whose only required value is a db. One chat, one renderer: the old kernel entries (., /external-store, /matrx, /react, /tools, styles.css, tokens.css) are retired.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -4716,26 +4716,26 @@
4716
4716
  "server-only": "^0.0.1",
4717
4717
  "uuid": "^14.0.2",
4718
4718
  "zod": "^4.6.5",
4719
+ "@ai-matrx/agents": "latest",
4719
4720
  "@ai-matrx/alchemy": "latest",
4720
4721
  "@ai-matrx/associations": "latest",
4721
4722
  "@ai-matrx/browser-audio": "latest",
4722
- "@ai-matrx/agents": "latest",
4723
- "@ai-matrx/canvas": "latest",
4724
4723
  "@ai-matrx/content-ir": "latest",
4725
4724
  "@ai-matrx/content-ir-react": "latest",
4726
4725
  "@ai-matrx/data": "latest",
4727
4726
  "@ai-matrx/design-system": "latest",
4727
+ "@ai-matrx/diff": "latest",
4728
4728
  "@ai-matrx/icons": "latest",
4729
4729
  "@ai-matrx/kit": "latest",
4730
4730
  "@ai-matrx/media": "latest",
4731
4731
  "@ai-matrx/messaging": "latest",
4732
4732
  "@ai-matrx/print": "latest",
4733
4733
  "@ai-matrx/realtime": "latest",
4734
- "@ai-matrx/diff": "latest",
4735
4734
  "@ai-matrx/records": "latest",
4736
4735
  "@ai-matrx/records-ui": "latest",
4737
4736
  "@ai-matrx/rich-content": "latest",
4738
- "@ai-matrx/rich-editor": "latest"
4737
+ "@ai-matrx/rich-editor": "latest",
4738
+ "@ai-matrx/canvas": "latest"
4739
4739
  },
4740
4740
  "devDependencies": {
4741
4741
  "@arethetypeswrong/cli": "^0.18.5",
@@ -4854,5 +4854,5 @@
4854
4854
  "check:side-effects": "node ../scripts/check-side-effects-listed.mjs . && node ../scripts/check-side-effects-listed.mjs --self-test",
4855
4855
  "check:public-surface": "node ./scripts/sync-public-surface.mjs --check && node ./scripts/sync-public-surface.mjs --self-test"
4856
4856
  },
4857
- "gitHead": "95a5e215a7437a241b5588b14653a183c82c240c"
4857
+ "gitHead": "c7124c3f07049b86a193524040ff19d1aef7b9a4"
4858
4858
  }