@ai-matrx/chat 0.3.31 → 0.3.33
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 +15 -0
- package/dist/agents/components/chat/ChatConversationRoom.d.ts +7 -1
- package/dist/agents/components/chat/ChatConversationRoom.js +8 -2
- package/dist/agents/redux/execution-system/thunks/launch-agent-execution.thunk.js +10 -2
- package/dist/agents/redux/execution-system/utils/required-organization.d.ts +14 -0
- package/dist/agents/redux/execution-system/utils/required-organization.js +4 -0
- package/dist/host/db-types.d.ts +86 -17
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @ai-matrx/chat
|
|
2
2
|
|
|
3
|
+
## 0.3.33
|
|
4
|
+
|
|
5
|
+
- **Opening a chat never asks for an organization.** `launchAgentExecution` asks before opening only
|
|
6
|
+
when the run starts now or a window/gate opens (`launchAsksForOrganizationBeforeOpen`); an inline
|
|
7
|
+
composer (`/chat/new`) asks at the first send through the same hold-and-set gate.
|
|
8
|
+
- **Reading your own agent-less chat never waits on the active workspace.** `ChatConversationRoom`
|
|
9
|
+
takes `organizationId` (the row's own) and resolves its mandate there.
|
|
10
|
+
Consumer action: pass the conversation row's `organization_id` to `ChatConversationRoom`.
|
|
11
|
+
|
|
12
|
+
## 0.3.32
|
|
13
|
+
|
|
14
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
15
|
+
`git diff npm/chat/v0.3.31..npm/chat/v0.3.32 -- apps/shared/chat`).
|
|
16
|
+
No source changes intended and no consumer action required.
|
|
17
|
+
|
|
3
18
|
## 0.3.31
|
|
4
19
|
|
|
5
20
|
The route map follows the Applet rename: `/applets/**` (the list, `/applets/build`, `/applets/manage/<id>/**`) resolves to `matrx-user/agent-apps` and `/administration/applets/**` to `matrx-admin/agent-apps`. The stale `/agent-apps` prefixes matched nothing, so every Applet page fell through to the generic surface (the Agents menu said "Canvas" on `/applets/build`).
|
|
@@ -19,8 +19,14 @@ import type { ComposerMode } from "../inputs/smart-input/composer/composer-types
|
|
|
19
19
|
* `mandateKey` rides along so the next turn is answered by whoever the
|
|
20
20
|
* org/user binding says, not by a frozen display identity.
|
|
21
21
|
*/
|
|
22
|
-
export declare function ChatConversationRoom({ conversationId, agentId, ownedByMandate, sandboxBinding, composer, }: {
|
|
22
|
+
export declare function ChatConversationRoom({ conversationId, agentId, ownedByMandate, sandboxBinding, composer, organizationId, }: {
|
|
23
23
|
conversationId: string;
|
|
24
|
+
/**
|
|
25
|
+
* The conversation ROW's own organization. An agent-less room resolves its
|
|
26
|
+
* mandate in THAT organization, so reading your own chat never waits on, or
|
|
27
|
+
* asks for, the active workspace (Arman, 2026-10-07).
|
|
28
|
+
*/
|
|
29
|
+
organizationId?: string | null;
|
|
24
30
|
/** The conversation's own agent, or the SSR-resolved mandate agent, or null. */
|
|
25
31
|
agentId: string | null;
|
|
26
32
|
/** True when `agentId` is the mandate's display identity, not the row's. */
|
|
@@ -10,7 +10,8 @@ function ChatConversationRoom({
|
|
|
10
10
|
agentId,
|
|
11
11
|
ownedByMandate,
|
|
12
12
|
sandboxBinding = null,
|
|
13
|
-
composer
|
|
13
|
+
composer,
|
|
14
|
+
organizationId = null
|
|
14
15
|
}) {
|
|
15
16
|
if (agentId && !ownedByMandate) {
|
|
16
17
|
return /* @__PURE__ */ jsx(
|
|
@@ -39,6 +40,7 @@ function ChatConversationRoom({
|
|
|
39
40
|
ChatConversationRoomResolved,
|
|
40
41
|
{
|
|
41
42
|
conversationId,
|
|
43
|
+
organizationId,
|
|
42
44
|
sandboxBinding,
|
|
43
45
|
composer
|
|
44
46
|
}
|
|
@@ -46,10 +48,14 @@ function ChatConversationRoom({
|
|
|
46
48
|
}
|
|
47
49
|
function ChatConversationRoomResolved({
|
|
48
50
|
conversationId,
|
|
51
|
+
organizationId,
|
|
49
52
|
sandboxBinding,
|
|
50
53
|
composer
|
|
51
54
|
}) {
|
|
52
|
-
const { mandate, loading, error, organizationPending } = useMandate(
|
|
55
|
+
const { mandate, loading, error, organizationPending } = useMandate(
|
|
56
|
+
DEFAULT_NEW_CHAT_MANDATE_KEY,
|
|
57
|
+
organizationId ? { organizationId } : {}
|
|
58
|
+
);
|
|
53
59
|
if (loading) return /* @__PURE__ */ jsx(ChatNewLandingSkeleton, {});
|
|
54
60
|
if (organizationPending) {
|
|
55
61
|
return /* @__PURE__ */ jsx(WorkspaceGate, { blocked: true, sentence: "This chat needs a workspace to open.", children: /* @__PURE__ */ jsx(ChatNewLandingSkeleton, {}) });
|
|
@@ -41,7 +41,10 @@ import {
|
|
|
41
41
|
createManualInstanceNoAgent
|
|
42
42
|
} from "./create-instance.thunk.js";
|
|
43
43
|
import { executeInstance } from "./execute-instance.thunk.js";
|
|
44
|
-
import {
|
|
44
|
+
import {
|
|
45
|
+
ensureExecutionOrganization,
|
|
46
|
+
launchAsksForOrganizationBeforeOpen
|
|
47
|
+
} from "../utils/required-organization.js";
|
|
45
48
|
import {
|
|
46
49
|
replaceSurfaceVariableValues,
|
|
47
50
|
setHostVariableValues
|
|
@@ -690,7 +693,12 @@ const launchAgentExecution = createAsyncThunk("instances/launch", async (options
|
|
|
690
693
|
if (bindingAutoRun !== null && autoRun === void 0) {
|
|
691
694
|
dispatch(setAutoRun({ conversationId, value: effectiveAutoRun }));
|
|
692
695
|
}
|
|
693
|
-
|
|
696
|
+
if (launchAsksForOrganizationBeforeOpen({
|
|
697
|
+
runsNow: effectiveAutoRun,
|
|
698
|
+
opensWindow: effectiveShowPreExecutionGate || Boolean(DISPLAY_MODE_TO_OVERLAY_ID[resolvedDisplayMode])
|
|
699
|
+
})) {
|
|
700
|
+
await ensureExecutionOrganization(getState(), conversationId);
|
|
701
|
+
}
|
|
694
702
|
if (effectiveShowPreExecutionGate) {
|
|
695
703
|
const downstreamOverlayId = DISPLAY_MODE_TO_OVERLAY_ID[resolvedDisplayMode];
|
|
696
704
|
dispatch(
|
|
@@ -55,5 +55,19 @@ export declare function executionOrganizationForRequest(state: ChatRootState, co
|
|
|
55
55
|
* Throws ONLY `OrganizationSelectionCancelled`, when the person actively
|
|
56
56
|
* declines. Callers must treat that as "nothing happened".
|
|
57
57
|
*/
|
|
58
|
+
/**
|
|
59
|
+
* Does a LAUNCH ask for the organization before it opens anything?
|
|
60
|
+
*
|
|
61
|
+
* Only when something is about to happen that a later cancel would strand: the
|
|
62
|
+
* run starts now (auto-run), or a window / pre-run gate opens. A launch that
|
|
63
|
+
* only mounts an inline composer — `/chat/new`, a room — asks nothing: opening
|
|
64
|
+
* a chat is never blocked (Arman, 2026-10-07). Its first SEND asks through the
|
|
65
|
+
* same hold-and-set gate (`execute-instance` / `smart-execute` call
|
|
66
|
+
* `ensureExecutionOrganization`), and the turn continues in the chosen one.
|
|
67
|
+
*/
|
|
68
|
+
export declare function launchAsksForOrganizationBeforeOpen(launch: {
|
|
69
|
+
runsNow: boolean;
|
|
70
|
+
opensWindow: boolean;
|
|
71
|
+
}): boolean;
|
|
58
72
|
export declare function ensureExecutionOrganization(state: ChatRootState, conversationId: string): Promise<string | null>;
|
|
59
73
|
export declare function requireExecutionOrganizationId(state: ChatRootState, conversationId: string): string;
|
|
@@ -8,6 +8,9 @@ function executionOrganizationForRequest(state, conversationId) {
|
|
|
8
8
|
if (isFingerprintGuestExecution(state)) return void 0;
|
|
9
9
|
return requireExecutionOrganizationId(state, conversationId);
|
|
10
10
|
}
|
|
11
|
+
function launchAsksForOrganizationBeforeOpen(launch) {
|
|
12
|
+
return launch.runsNow || launch.opensWindow;
|
|
13
|
+
}
|
|
11
14
|
async function ensureExecutionOrganization(state, conversationId) {
|
|
12
15
|
if (isFingerprintGuestExecution(state)) return null;
|
|
13
16
|
const instance = state.conversations.byConversationId[conversationId];
|
|
@@ -49,5 +52,6 @@ export {
|
|
|
49
52
|
ensureExecutionOrganization,
|
|
50
53
|
executionOrganizationForRequest,
|
|
51
54
|
isFingerprintGuestExecution,
|
|
55
|
+
launchAsksForOrganizationBeforeOpen,
|
|
52
56
|
requireExecutionOrganizationId
|
|
53
57
|
};
|
package/dist/host/db-types.d.ts
CHANGED
|
@@ -7951,6 +7951,12 @@ export type ChatDatabase = {
|
|
|
7951
7951
|
template_version: number;
|
|
7952
7952
|
}[];
|
|
7953
7953
|
};
|
|
7954
|
+
coding_projects_of: {
|
|
7955
|
+
Args: {
|
|
7956
|
+
p_user: string;
|
|
7957
|
+
};
|
|
7958
|
+
Returns: Json;
|
|
7959
|
+
};
|
|
7954
7960
|
conversation_lane: {
|
|
7955
7961
|
Args: {
|
|
7956
7962
|
conversation_type: string;
|
|
@@ -7999,6 +8005,14 @@ export type ChatDatabase = {
|
|
|
7999
8005
|
};
|
|
8000
8006
|
Returns: unknown;
|
|
8001
8007
|
};
|
|
8008
|
+
move_coding_conversations_to_organization: {
|
|
8009
|
+
Args: {
|
|
8010
|
+
p_conversation_ids: Json;
|
|
8011
|
+
p_target: string;
|
|
8012
|
+
p_user: string;
|
|
8013
|
+
};
|
|
8014
|
+
Returns: Json;
|
|
8015
|
+
};
|
|
8002
8016
|
recompute_user_request_totals: {
|
|
8003
8017
|
Args: {
|
|
8004
8018
|
p_id?: string;
|
|
@@ -8661,6 +8675,15 @@ export type ChatDatabase = {
|
|
|
8661
8675
|
title: string;
|
|
8662
8676
|
}[];
|
|
8663
8677
|
};
|
|
8678
|
+
space_button_notify: {
|
|
8679
|
+
Args: {
|
|
8680
|
+
p_block_id: string;
|
|
8681
|
+
p_document_id: string;
|
|
8682
|
+
p_recipients: string[];
|
|
8683
|
+
p_text: string;
|
|
8684
|
+
};
|
|
8685
|
+
Returns: Json;
|
|
8686
|
+
};
|
|
8664
8687
|
space_children: {
|
|
8665
8688
|
Args: {
|
|
8666
8689
|
p_parent_id: string;
|
|
@@ -35803,15 +35826,6 @@ export type ChatDatabase = {
|
|
|
35803
35826
|
};
|
|
35804
35827
|
Returns: undefined;
|
|
35805
35828
|
};
|
|
35806
|
-
agx_duplicate_agent: {
|
|
35807
|
-
Args: {
|
|
35808
|
-
p_agent_id: string;
|
|
35809
|
-
p_as_system?: boolean;
|
|
35810
|
-
p_follows_source?: boolean;
|
|
35811
|
-
p_organization_id?: string;
|
|
35812
|
-
};
|
|
35813
|
-
Returns: string;
|
|
35814
|
-
};
|
|
35815
35829
|
agx_duplicate_shortcut: {
|
|
35816
35830
|
Args: {
|
|
35817
35831
|
p_organization_id?: string;
|
|
@@ -35826,14 +35840,6 @@ export type ChatDatabase = {
|
|
|
35826
35840
|
};
|
|
35827
35841
|
Returns: string;
|
|
35828
35842
|
};
|
|
35829
|
-
agx_duplicate_version: {
|
|
35830
|
-
Args: {
|
|
35831
|
-
p_as_system?: boolean;
|
|
35832
|
-
p_organization_id?: string;
|
|
35833
|
-
p_version_id: string;
|
|
35834
|
-
};
|
|
35835
|
-
Returns: string;
|
|
35836
|
-
};
|
|
35837
35843
|
agx_escape_regex: {
|
|
35838
35844
|
Args: {
|
|
35839
35845
|
p: string;
|
|
@@ -48057,6 +48063,69 @@ export type ChatDatabase = {
|
|
|
48057
48063
|
};
|
|
48058
48064
|
ui: {
|
|
48059
48065
|
Tables: {
|
|
48066
|
+
decision_pick: {
|
|
48067
|
+
Row: {
|
|
48068
|
+
created_at: string;
|
|
48069
|
+
created_by: string | null;
|
|
48070
|
+
custom_fields: Json;
|
|
48071
|
+
decision_id: string | null;
|
|
48072
|
+
deleted_at: string | null;
|
|
48073
|
+
id: string;
|
|
48074
|
+
metadata: Json;
|
|
48075
|
+
note: string | null;
|
|
48076
|
+
organization_id: string;
|
|
48077
|
+
published_to_web: boolean;
|
|
48078
|
+
published_to_web_at: string | null;
|
|
48079
|
+
published_to_web_by: string | null;
|
|
48080
|
+
shown_to: Database["platform"]["Enums"]["shown_to"];
|
|
48081
|
+
updated_at: string;
|
|
48082
|
+
updated_by: string | null;
|
|
48083
|
+
version: number;
|
|
48084
|
+
visibility: Database["platform"]["Enums"]["visibility"];
|
|
48085
|
+
winner: string | null;
|
|
48086
|
+
};
|
|
48087
|
+
Insert: {
|
|
48088
|
+
created_at?: string;
|
|
48089
|
+
created_by?: string | null;
|
|
48090
|
+
custom_fields?: Json;
|
|
48091
|
+
decision_id?: string | null;
|
|
48092
|
+
deleted_at?: string | null;
|
|
48093
|
+
id?: string;
|
|
48094
|
+
metadata?: Json;
|
|
48095
|
+
note?: string | null;
|
|
48096
|
+
organization_id: string;
|
|
48097
|
+
published_to_web?: boolean;
|
|
48098
|
+
published_to_web_at?: string | null;
|
|
48099
|
+
published_to_web_by?: string | null;
|
|
48100
|
+
shown_to?: Database["platform"]["Enums"]["shown_to"];
|
|
48101
|
+
updated_at?: string;
|
|
48102
|
+
updated_by?: string | null;
|
|
48103
|
+
version?: number;
|
|
48104
|
+
visibility?: Database["platform"]["Enums"]["visibility"];
|
|
48105
|
+
winner?: string | null;
|
|
48106
|
+
};
|
|
48107
|
+
Update: {
|
|
48108
|
+
created_at?: string;
|
|
48109
|
+
created_by?: string | null;
|
|
48110
|
+
custom_fields?: Json;
|
|
48111
|
+
decision_id?: string | null;
|
|
48112
|
+
deleted_at?: string | null;
|
|
48113
|
+
id?: string;
|
|
48114
|
+
metadata?: Json;
|
|
48115
|
+
note?: string | null;
|
|
48116
|
+
organization_id?: string;
|
|
48117
|
+
published_to_web?: boolean;
|
|
48118
|
+
published_to_web_at?: string | null;
|
|
48119
|
+
published_to_web_by?: string | null;
|
|
48120
|
+
shown_to?: Database["platform"]["Enums"]["shown_to"];
|
|
48121
|
+
updated_at?: string;
|
|
48122
|
+
updated_by?: string | null;
|
|
48123
|
+
version?: number;
|
|
48124
|
+
visibility?: Database["platform"]["Enums"]["visibility"];
|
|
48125
|
+
winner?: string | null;
|
|
48126
|
+
};
|
|
48127
|
+
Relationships: [];
|
|
48128
|
+
};
|
|
48060
48129
|
ui_client: {
|
|
48061
48130
|
Row: {
|
|
48062
48131
|
created_at: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/chat",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.33",
|
|
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 per-module subpaths @ai-matrx/chat/<domain>/<module> over a host contract (/host, /host/react) whose only required value is a db; plus the kernel compatibility entries (., /external-store, /matrx, /react, /tools, styles.css, tokens.css) until P28.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -226,12 +226,12 @@
|
|
|
226
226
|
"server-only": "^0.0.1",
|
|
227
227
|
"uuid": "^14.0.2",
|
|
228
228
|
"zod": "^4.6.5",
|
|
229
|
-
"@ai-matrx/agents": "latest",
|
|
230
|
-
"@ai-matrx/alchemy": "latest",
|
|
231
|
-
"@ai-matrx/associations": "latest",
|
|
232
229
|
"@ai-matrx/browser-audio": "latest",
|
|
233
230
|
"@ai-matrx/canvas": "latest",
|
|
234
231
|
"@ai-matrx/content-ir": "latest",
|
|
232
|
+
"@ai-matrx/alchemy": "latest",
|
|
233
|
+
"@ai-matrx/agents": "latest",
|
|
234
|
+
"@ai-matrx/associations": "latest",
|
|
235
235
|
"@ai-matrx/content-ir-react": "latest",
|
|
236
236
|
"@ai-matrx/data": "latest",
|
|
237
237
|
"@ai-matrx/design-system": "latest",
|