@vivix-labs/studio-chat-mcp 0.1.12 → 0.1.13

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/README.md CHANGED
@@ -47,6 +47,8 @@ Pass the returned route to `describe_chat_capability({scope,target,componentId?}
47
47
 
48
48
  `query_studio_media({scope,target,input})` invokes only a discovered media query with read effects and no confirmation. Read its input schema first. Returned records, task output refs and file selections provide the immutable `ref: {storeId,objectId,versionId}` for `resolve_chat_media({scope,ref,fileId?})`.
49
49
 
50
+ `run_studio_action`, `studio_card_action` and `query_studio_media` treat `input` as a JSON object. A JSON-encoded object string from an MCP client is parsed once and normalized; arrays, scalars, `null` and strings that do not encode an object are rejected before any Host operation runs. Every discovered operation currently declares an object input schema, so this is the adapter contract rather than a per-operation setting.
51
+
50
52
  The resolver delegates `{ref,fileId?,access:"https"}` to the existing backend file-access operation. The file service checks the selected bytes, follows a matching saved origin, reuses a usable stored HTTPS URL, or asks the original API provider for a fresh read ticket by its persisted remote ID and original task identity. Ordinary local reads keep their existing behavior. An unmatched local file is an explicit error; resolving never uploads, generates or substitutes another version. The MCP response contains the fixed ref, file ID, MIME type, HTTPS URL and optional expiry, without the Host path.
51
53
 
52
54
  Tool `content` is a short readable receipt. `structuredContent` contains model-readable creative data and routing. Signed action bindings, the script digest and prepared messages travel in `_meta` for the App. The page reads the current registered renderer for the original versioned component ID through a read-only MCP resource, then verifies the response's component ID and script digest before mounting. Historical props use the current compatible appearance. The saved digest remains available for legacy clients. The page also accepts legacy replies whose public data contains bindings. A tool return proves neither that a client displayed the card nor that a click delivered a continuation; those require separate UI evidence.
package/dist/server.js CHANGED
@@ -29429,7 +29429,7 @@ data:
29429
29429
  // package.json
29430
29430
  var package_default = {
29431
29431
  name: "@vivix-labs/studio-chat-mcp",
29432
- version: "0.1.12",
29432
+ version: "0.1.13",
29433
29433
  type: "module",
29434
29434
  engines: {
29435
29435
  node: ">=22.12.0"
@@ -37794,12 +37794,24 @@ var options = {
37794
37794
  requestKey: external_exports.string().min(1).max(200).refine((value) => Boolean(value.trim())).optional(),
37795
37795
  approval: external_exports.string().min(1).optional()
37796
37796
  };
37797
- var chatRunSchema = external_exports.object({ target: targetSchema, input: external_exports.unknown(), ...options }).strict();
37797
+ var jsonObjectInput = external_exports.preprocess(
37798
+ (value) => {
37799
+ if (typeof value !== "string") return value;
37800
+ try {
37801
+ const parsed = JSON.parse(value);
37802
+ return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : value;
37803
+ } catch {
37804
+ return value;
37805
+ }
37806
+ },
37807
+ external_exports.record(external_exports.string(), external_exports.unknown())
37808
+ );
37809
+ var chatRunSchema = external_exports.object({ target: targetSchema, input: jsonObjectInput, ...options }).strict();
37798
37810
  var chatActionSchema = external_exports.object({
37799
37811
  target: targetSchema,
37800
37812
  binding: external_exports.string().min(1).max(65536),
37801
37813
  action: operationId,
37802
- input: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
37814
+ input: jsonObjectInput.optional(),
37803
37815
  ...options
37804
37816
  }).strict();
37805
37817
  var projectionSchema = external_exports.object({
@@ -38496,12 +38508,12 @@ var routing = (value, context) => {
38496
38508
  message: "Use either scope or legacy projectId, not both."
38497
38509
  });
38498
38510
  };
38499
- var runInput = external_exports.object({ ...common, input: external_exports.unknown() }).strict().superRefine(routing);
38511
+ var runInput = external_exports.object({ ...common, input: jsonObjectInput }).strict().superRefine(routing);
38500
38512
  var actionInput = external_exports.object({
38501
38513
  ...common,
38502
38514
  binding: external_exports.string().min(1).max(65536),
38503
38515
  action: identifier,
38504
- input: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
38516
+ input: jsonObjectInput.optional()
38505
38517
  }).strict().superRefine(routing);
38506
38518
  function mapChatResult(result) {
38507
38519
  const { bindings: _bindings, ...structuredContent } = result.structuredContent;
@@ -38655,8 +38667,8 @@ function createChatServer(options2) {
38655
38667
  "query_studio_media",
38656
38668
  {
38657
38669
  title: "Read Studio media records",
38658
- description: "Run a discovered, read-only media query on this same Host. Read its input schema first. Use the actual returned fixed refs when selecting historical files; this never invokes a write or generation.",
38659
- inputSchema: external_exports.object({ scope: scopeSchema.default(userScope), target, input: external_exports.unknown() }).strict()
38670
+ description: "Run a discovered, read-only media query on this same Host. Read its input schema first. `input` is a JSON object; a JSON-encoded object string is accepted and normalized. Use the actual returned fixed refs when selecting historical files; this never invokes a write or generation.",
38671
+ inputSchema: external_exports.object({ scope: scopeSchema.default(userScope), target, input: jsonObjectInput }).strict()
38660
38672
  },
38661
38673
  ({ scope, target: selected, input: input2 }) => readResult("Media records read.", () => queryStudioMedia(host, scope, selected, input2))
38662
38674
  );
@@ -38677,7 +38689,7 @@ function createChatServer(options2) {
38677
38689
  "run_studio_action",
38678
38690
  {
38679
38691
  title: "Run Studio action",
38680
- description: "Open a component or declared project card using the scope, target and contract returned by this connection discovery tools. Default interface headings, field labels, group headings and buttons to English unless the user requests another interface language. Preserve story names, story text and user input in their original language. User-scope components work without a business project. Project business operations require the selected project scope. Legacy projectId calls remain supported. Preserve requestKey and original input for uncertain recovery.",
38692
+ description: "Open a component or declared project card using the scope, target and contract returned by this connection discovery tools. `input` is a JSON object; a JSON-encoded object string is accepted and normalized. Default interface headings, field labels, group headings and buttons to English unless the user requests another interface language. Preserve story names, story text and user input in their original language. User-scope components work without a business project. Project business operations require the selected project scope. Legacy projectId calls remain supported. Preserve requestKey and original input for uncertain recovery.",
38681
38693
  inputSchema: runInput,
38682
38694
  _meta: { ui: { resourceUri: chatResourceUri } }
38683
38695
  },
@@ -38687,7 +38699,7 @@ function createChatServer(options2) {
38687
38699
  "studio_card_action",
38688
38700
  {
38689
38701
  title: "Studio card action",
38690
- description: "Call an action declared by the operation that opened this card. Keep its original projectId, source target and Host binding. The adapter resolves the destination. The Host validates input, enforces permissions and confirmation, and preserves the request key. Business parameters belong in input.",
38702
+ description: "Call an action declared by the operation that opened this card. Keep its original projectId, source target and Host binding. The adapter resolves the destination. The Host validates input, enforces permissions and confirmation, and preserves the request key. Business parameters belong in input, which is a JSON object; a JSON-encoded object string is accepted and normalized.",
38691
38703
  inputSchema: actionInput,
38692
38704
  _meta: { ui: { visibility: ["app"] } }
38693
38705
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vivix-labs/studio-chat-mcp",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22.12.0"