@syntrologie/adapt-chatbot 2.1.0 → 2.2.0-canary.2

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.
@@ -4,7 +4,7 @@
4
4
  * Main React component for the AI chat assistant widget.
5
5
  * Renders a message list with auto-scroll, loading indicator, and input form.
6
6
  */
7
- import type { ChatbotWidgetRuntime, ChatbotConfig } from './types';
7
+ import type { ChatbotConfig, ChatbotWidgetRuntime } from './types';
8
8
  export interface ChatAssistantProps {
9
9
  config: ChatbotConfig;
10
10
  runtime: ChatbotWidgetRuntime;
@@ -1 +1 @@
1
- {"version":3,"file":"ChatAssistant.d.ts","sourceRoot":"","sources":["../src/ChatAssistant.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAe,oBAAoB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA8GhF,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,kBAAkB,2CAwE5E;AAMD,eAAO,MAAM,4BAA4B;qBACtB,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CA6CpE,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"ChatAssistant.d.ts","sourceRoot":"","sources":["../src/ChatAssistant.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAe,MAAM,SAAS,CAAC;AA8GhF,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,kBAAkB,2CAwE5E;AAMD,eAAO,MAAM,4BAA4B;qBACtB,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CA6CpE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -5,8 +5,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  * Main React component for the AI chat assistant widget.
6
6
  * Renders a message list with auto-scroll, loading indicator, and input form.
7
7
  */
8
- import { base, slateGrey, purple, red } from '@syntro/design-system/tokens';
9
- import React, { useRef, useEffect } from 'react';
8
+ import { base, purple, red, slateGrey } from '@syntro/design-system/tokens';
9
+ import React, { useEffect, useRef } from 'react';
10
10
  import { createRoot } from 'react-dom/client';
11
11
  import { useChat } from './useChat';
12
12
  // ============================================================================
@@ -123,7 +123,7 @@ export function ChatAssistant({ config, runtime, tileId }) {
123
123
  if (messageListRef.current) {
124
124
  messageListRef.current.scrollTop = messageListRef.current.scrollHeight;
125
125
  }
126
- }, [messages, isLoading]);
126
+ }, []);
127
127
  const handleSubmit = (e) => {
128
128
  e.preventDefault();
129
129
  const input = inputRef.current;
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,SAAS,CAAC;AAM/D,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,gBAAgB,2CAoF3E;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;;;;CAIvB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH,OAAO,KAAK,EAAiB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAM/D,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,gBAAgB,2CAoF3E;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;;;;CAIvB,CAAC;AAEF,eAAe,aAAa,CAAC"}
package/dist/editor.js CHANGED
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  *
5
5
  * Visual editor panel for configuring chatbot tile props.
6
6
  */
7
- import { EditorLayout, EditorHeader, EditorBody, EditorFooter, EditorInput, EditorTextarea, } from '@syntrologie/shared-editor-ui';
7
+ import { EditorBody, EditorFooter, EditorHeader, EditorInput, EditorLayout, EditorTextarea, } from '@syntrologie/shared-editor-ui';
8
8
  import { useEffect, useRef } from 'react';
9
9
  // ============================================================================
10
10
  // ChatbotEditor Component
package/dist/schema.d.ts CHANGED
@@ -36,4 +36,33 @@ export declare function validateChatbotConfig(data: unknown): z.SafeParseReturnT
36
36
  maxHistory: number;
37
37
  mlflowRunId?: string | undefined;
38
38
  }>;
39
+ /**
40
+ * Tile widget definitions for unified JSON Schema generation.
41
+ * Maps widget IDs to their props validation schema so the build script
42
+ * can inject if/then constraints on tile.props.
43
+ */
44
+ export declare const tileWidgets: {
45
+ widget: string;
46
+ defName: string;
47
+ propsSchema: z.ZodObject<{
48
+ /** Backend URL for the chat API endpoint */
49
+ backendUrl: z.ZodString;
50
+ /** MLflow run ID for experiment tracking */
51
+ mlflowRunId: z.ZodOptional<z.ZodString>;
52
+ /** Greeting message shown when the chat opens */
53
+ greeting: z.ZodDefault<z.ZodString>;
54
+ /** Maximum number of history messages sent to the backend */
55
+ maxHistory: z.ZodDefault<z.ZodNumber>;
56
+ }, "strip", z.ZodTypeAny, {
57
+ backendUrl: string;
58
+ greeting: string;
59
+ maxHistory: number;
60
+ mlflowRunId?: string | undefined;
61
+ }, {
62
+ backendUrl: string;
63
+ greeting?: string | undefined;
64
+ maxHistory?: number | undefined;
65
+ mlflowRunId?: string | undefined;
66
+ }>;
67
+ }[];
39
68
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY;IACvB,4CAA4C;;IAE5C,4CAA4C;;IAE5C,iDAAiD;;IAEjD,6DAA6D;;;;;;;;;;;;EAE7D,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAE/D,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO;;;;;;;;;;GAElD"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY;IACvB,4CAA4C;;IAE5C,4CAA4C;;IAE5C,iDAAiD;;IAEjD,6DAA6D;;;;;;;;;;;;EAE7D,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAE/D,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO;;;;;;;;;;GAElD;AAMD;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;QAzBtB,4CAA4C;;QAE5C,4CAA4C;;QAE5C,iDAAiD;;QAEjD,6DAA6D;;;;;;;;;;;;;GAyB9D,CAAC"}
package/dist/schema.js CHANGED
@@ -17,3 +17,18 @@ export const configSchema = z.object({
17
17
  export function validateChatbotConfig(data) {
18
18
  return configSchema.safeParse(data);
19
19
  }
20
+ // ============================================================================
21
+ // Tile Widget Props Export
22
+ // ============================================================================
23
+ /**
24
+ * Tile widget definitions for unified JSON Schema generation.
25
+ * Maps widget IDs to their props validation schema so the build script
26
+ * can inject if/then constraints on tile.props.
27
+ */
28
+ export const tileWidgets = [
29
+ {
30
+ widget: 'adaptive-chatbot:assistant',
31
+ defName: 'chatbotAssistantProps',
32
+ propsSchema: configSchema,
33
+ },
34
+ ];
package/dist/useChat.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * React hook managing chat message state, API communication,
5
5
  * history management, and action execution via the runtime ActionEngine.
6
6
  */
7
- import type { ChatMessage, ChatbotWidgetRuntime } from './types';
7
+ import type { ChatbotWidgetRuntime, ChatMessage } from './types';
8
8
  export interface UseChatOptions {
9
9
  backendUrl: string;
10
10
  tileId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../src/useChat.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAqB,MAAM,SAAS,CAAC;AAEpF,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,oBAAoB,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B;AAOD,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,aAAa,CA4G9D"}
1
+ {"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../src/useChat.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAqB,oBAAoB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpF,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,oBAAoB,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B;AAOD,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,aAAa,CA4G9D"}
package/dist/useChat.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * React hook managing chat message state, API communication,
5
5
  * history management, and action execution via the runtime ActionEngine.
6
6
  */
7
- import { useState, useCallback, useRef } from 'react';
7
+ import { useCallback, useRef, useState } from 'react';
8
8
  import { parseActions } from './actionParser';
9
9
  import { sendMessage } from './apiClient';
10
10
  let nextId = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syntrologie/adapt-chatbot",
3
- "version": "2.1.0",
3
+ "version": "2.2.0-canary.2",
4
4
  "description": "Adaptive Chatbot - AI chat assistant widget with action execution",
5
5
  "license": "Proprietary",
6
6
  "private": false,
@@ -8,7 +8,7 @@
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/SyntropyForge/amazing-demos.git",
11
- "directory": "tech-core/sdks/adaptives/adaptive-chatbot"
11
+ "directory": "packages/adaptives/adaptive-chatbot"
12
12
  },
13
13
  "publishConfig": {
14
14
  "access": "public"
@@ -31,7 +31,12 @@
31
31
  "files": [
32
32
  "dist"
33
33
  ],
34
+ "bundledDependencies": [
35
+ "@syntro/design-system",
36
+ "@syntrologie/shared-editor-ui"
37
+ ],
34
38
  "scripts": {
39
+ "prepack": "node ../../../scripts/prepare-bundled-deps.mjs",
35
40
  "build": "tsc",
36
41
  "typecheck": "tsc --noEmit",
37
42
  "clean": "rm -rf dist",
@@ -40,23 +45,24 @@
40
45
  },
41
46
  "dependencies": {
42
47
  "@syntrologie/shared-editor-ui": "*",
43
- "@syntro/design-system": "^1.0.0"
48
+ "@syntro/design-system": "*"
44
49
  },
45
50
  "peerDependencies": {
46
- "@syntrologie/runtime-sdk": "^2.0.0",
47
51
  "react": ">=18.0.0",
48
52
  "react-dom": ">=18.0.0",
49
53
  "zod": "^3.0.0"
50
54
  },
51
55
  "devDependencies": {
56
+ "@syntro/design-system": "^1.0.0",
57
+ "@syntrologie/shared-editor-ui": "*",
52
58
  "@testing-library/react": "^16.3.2",
53
- "@types/react": "^19.1.0",
54
- "@types/react-dom": "^19.2.3",
55
- "jsdom": "^25.0.1",
56
- "react": "^19.2.4",
57
- "react-dom": "^19.2.4",
58
- "typescript": "^5.7.3",
59
- "vitest": "^2.1.9",
59
+ "@types/react": "^19.2.0",
60
+ "@types/react-dom": "^19.2.0",
61
+ "jsdom": "^26.1.0",
62
+ "react": "^19.2.0",
63
+ "react-dom": "^19.2.0",
64
+ "typescript": "^5.9.3",
65
+ "vitest": "^4.0.18",
60
66
  "zod": "^3.25.76"
61
67
  }
62
68
  }