@creature-ai/sdk 0.1.4 → 0.1.5
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/core/index.d.ts +6 -0
- package/dist/core/index.js +16 -0
- package/dist/core/index.js.map +1 -1
- package/dist/react/index.d.ts +1 -10
- package/dist/react/index.js +24 -42
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/index.d.ts
CHANGED
|
@@ -303,8 +303,14 @@ declare class McpAppHostClient extends Subscribable implements HostClient {
|
|
|
303
303
|
private initiateConnection;
|
|
304
304
|
/**
|
|
305
305
|
* Apply theme, styles, and fonts from host context.
|
|
306
|
+
* Also applies Creature-specific extension styles if present.
|
|
306
307
|
*/
|
|
307
308
|
private applyHostContext;
|
|
309
|
+
/**
|
|
310
|
+
* Apply Creature-specific CSS variables to the document root.
|
|
311
|
+
* These are host extensions sent outside the spec-validated styles.variables path.
|
|
312
|
+
*/
|
|
313
|
+
private applyCreatureStyles;
|
|
308
314
|
/**
|
|
309
315
|
* Extract text content from SDK result content array.
|
|
310
316
|
* Filters to only include text items since our ToolResult type expects text.
|
package/dist/core/index.js
CHANGED
|
@@ -9559,6 +9559,7 @@ var McpAppHostClient = class extends Subscribable {
|
|
|
9559
9559
|
}
|
|
9560
9560
|
/**
|
|
9561
9561
|
* Apply theme, styles, and fonts from host context.
|
|
9562
|
+
* Also applies Creature-specific extension styles if present.
|
|
9562
9563
|
*/
|
|
9563
9564
|
applyHostContext(context) {
|
|
9564
9565
|
if (context.theme) {
|
|
@@ -9571,6 +9572,21 @@ var McpAppHostClient = class extends Subscribable {
|
|
|
9571
9572
|
if (context.styles?.css?.fonts) {
|
|
9572
9573
|
qU(context.styles.css.fonts);
|
|
9573
9574
|
}
|
|
9575
|
+
if (context.creatureStyles) {
|
|
9576
|
+
this.applyCreatureStyles(context.creatureStyles);
|
|
9577
|
+
}
|
|
9578
|
+
}
|
|
9579
|
+
/**
|
|
9580
|
+
* Apply Creature-specific CSS variables to the document root.
|
|
9581
|
+
* These are host extensions sent outside the spec-validated styles.variables path.
|
|
9582
|
+
*/
|
|
9583
|
+
applyCreatureStyles(styles) {
|
|
9584
|
+
const root = document.documentElement;
|
|
9585
|
+
for (const [key, value] of Object.entries(styles)) {
|
|
9586
|
+
if (value !== void 0) {
|
|
9587
|
+
root.style.setProperty(key, value);
|
|
9588
|
+
}
|
|
9589
|
+
}
|
|
9574
9590
|
}
|
|
9575
9591
|
/**
|
|
9576
9592
|
* Extract text content from SDK result content array.
|