@vivix-labs/studio-chat-mcp 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat-ui/index.html +20 -20
- package/dist/server.js +458 -115
- package/dist/setup.js +4 -3
- package/dist/shared.d.ts +6 -0
- package/docs/mcp-instructions.md +8 -0
- package/package.json +1 -1
package/dist/setup.js
CHANGED
|
@@ -945,8 +945,9 @@ async function enable(id, scope, options = [], additions) {
|
|
|
945
945
|
try {
|
|
946
946
|
activate();
|
|
947
947
|
} catch (error) {
|
|
948
|
-
|
|
949
|
-
|
|
948
|
+
const canRestart = error.code === "USER_SCOPE_IN_USE" && scope === user && !restarted || error.code === "INSTANCE_UNAVAILABLE" && scope !== user;
|
|
949
|
+
if (!canRestart) throw error;
|
|
950
|
+
if (scope === user) restarted = true;
|
|
950
951
|
cliCall("host", "stop");
|
|
951
952
|
for (let i = 0; cliCall("host", "status").pid; i++) {
|
|
952
953
|
if (i === 60) throw Error("Studio Host is still stopping. Rerun setup after it exits.");
|
|
@@ -966,7 +967,7 @@ for (const project of cliCall("project", "list").projects) {
|
|
|
966
967
|
const scope = ["--project", project.id];
|
|
967
968
|
const author = cliCall("plugin", "list", ...scope).instances.find((i) => i.id === "authoring");
|
|
968
969
|
if (author?.package === packages.authoring) {
|
|
969
|
-
await enable("authoring", scope);
|
|
970
|
+
await enable("authoring", scope, ["--allow-access", "events.publish"]);
|
|
970
971
|
await enable("chat-components", scope, [], {
|
|
971
972
|
character: { instanceId: "authoring", operationId: "characters.receiveCard" }
|
|
972
973
|
});
|
package/dist/shared.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export interface ChatView {
|
|
|
25
25
|
scope?: ScopeRef;
|
|
26
26
|
target: OperationTarget;
|
|
27
27
|
component: string;
|
|
28
|
+
cardInstanceId?: string;
|
|
29
|
+
componentId?: string;
|
|
28
30
|
props: Record<string, unknown>;
|
|
29
31
|
mediaOrigins?: readonly string[];
|
|
30
32
|
ui: { format: 'iife'; javascript: string; sha256: string };
|
|
@@ -37,6 +39,7 @@ export interface HostChatResult extends Omit<ChatResult, 'view' | 'bindingContex
|
|
|
37
39
|
export interface ChatRunRequest extends InvokeOptions {
|
|
38
40
|
target: OperationTarget;
|
|
39
41
|
input: unknown;
|
|
42
|
+
fromInteractionId?: string;
|
|
40
43
|
}
|
|
41
44
|
export interface ChatActionRequest extends InvokeOptions {
|
|
42
45
|
/** Host-issued operation binding for this declared action. */
|
|
@@ -45,6 +48,8 @@ export interface ChatActionRequest extends InvokeOptions {
|
|
|
45
48
|
target: OperationTarget;
|
|
46
49
|
action: string;
|
|
47
50
|
input?: Record<string, unknown>;
|
|
51
|
+
cardInstanceId?: string;
|
|
52
|
+
fromInteractionId?: string;
|
|
48
53
|
}
|
|
49
54
|
export interface ChatProjectionContext {
|
|
50
55
|
/** Authenticated context of the original card when projecting an action response. */
|
|
@@ -52,6 +57,7 @@ export interface ChatProjectionContext {
|
|
|
52
57
|
projectId: string;
|
|
53
58
|
target: OperationTarget;
|
|
54
59
|
action?: string;
|
|
60
|
+
interactionId?: string;
|
|
55
61
|
}
|
|
56
62
|
export interface ChatActionContext extends ChatProjectionContext {
|
|
57
63
|
action: string;
|
package/docs/mcp-instructions.md
CHANGED
|
@@ -20,6 +20,14 @@ The adapter projects the installed component through
|
|
|
20
20
|
`studio_card_action` route. The adapter authenticates the original source,
|
|
21
21
|
component, action and target before dispatching a Host operation.
|
|
22
22
|
|
|
23
|
+
When a prompt button prepares a `chat-component-action` follow-up, the adapter
|
|
24
|
+
attaches a server-minted `interactionId` to the returned `data` object. On the
|
|
25
|
+
immediate continuation turn triggered by that callback, pass `data.interactionId`
|
|
26
|
+
verbatim via optional `fromInteractionId` on `run_studio_action` (or
|
|
27
|
+
`--from-interaction` / `VIVIX_INTERACTION_ID` on Studio CLI invocations) so
|
|
28
|
+
downstream operations retain concurrent-safe attribution. Never fabricate an
|
|
29
|
+
`interactionId` or carry it across later turns.
|
|
30
|
+
|
|
23
31
|
## Media transport
|
|
24
32
|
|
|
25
33
|
Query saved media through the discovered `query_studio_media` route and resolve
|