@marketrix.ai/widget 3.8.3 → 3.8.10
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 +42 -33
- package/dist/src/context/sseReducer.d.ts +1 -1
- package/dist/src/context/sseReducer.d.ts.map +1 -1
- package/dist/src/sdk/contract.d.ts +806 -0
- package/dist/src/sdk/contract.d.ts.map +1 -0
- package/dist/src/sdk/contracts/activityLog.d.ts +420 -0
- package/dist/src/sdk/contracts/activityLog.d.ts.map +1 -0
- package/dist/src/sdk/contracts/agent.d.ts +3243 -0
- package/dist/src/sdk/contracts/agent.d.ts.map +1 -0
- package/dist/src/sdk/contracts/application.d.ts +525 -0
- package/dist/src/sdk/contracts/application.d.ts.map +1 -0
- package/dist/src/sdk/contracts/chat.d.ts +6 -0
- package/dist/src/sdk/contracts/chat.d.ts.map +1 -0
- package/dist/src/sdk/contracts/common.d.ts +168 -0
- package/dist/src/sdk/contracts/common.d.ts.map +1 -0
- package/dist/src/sdk/contracts/entities.d.ts +935 -0
- package/dist/src/sdk/contracts/entities.d.ts.map +1 -0
- package/dist/src/sdk/contracts/widget.d.ts +2426 -0
- package/dist/src/sdk/contracts/widget.d.ts.map +1 -0
- package/dist/src/sdk/index.d.ts +411 -7498
- package/dist/src/sdk/index.d.ts.map +1 -1
- package/dist/src/services/ApiService.d.ts.map +1 -1
- package/dist/src/services/StreamClient.d.ts +1 -1
- package/dist/src/services/StreamClient.d.ts.map +1 -1
- package/dist/widget.mjs +65 -65
- package/dist/widget.mjs.map +1 -1
- package/package.json +2 -1
- package/dist/src/sdk/routes.d.ts +0 -7901
- package/dist/src/sdk/routes.d.ts.map +0 -1
- package/dist/src/sdk/schema.d.ts +0 -6584
- package/dist/src/sdk/schema.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -152,14 +152,7 @@ interface MarketrixConfig {
|
|
|
152
152
|
|
|
153
153
|
### Prerequisites
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
| -------------- | -------------------------------- | ------------------------------------------------------------------- |
|
|
157
|
-
| `validate.yml` | Push / PR to `dev`, `main` | Type check, lint, format, tests, build, visual, a11y, bundle checks |
|
|
158
|
-
| `build.yml` | Tag push (`v*`) or push to `dev` | Build Docker image, push to ACR; publish to npm on tag |
|
|
159
|
-
|
|
160
|
-
Image builds produce `marketrix.azurecr.io/widget:{version}`. Tag pushes also publish `@marketrix.ai/widget` to npm. Deployment to dev/prod is handled by the centralized deploy workflow (e.g. `deploy.yml` in infra). Dev branch pushes do not build images.
|
|
161
|
-
|
|
162
|
-
- Node.js 18+
|
|
155
|
+
- Node.js 24 (CI pins `node-version: 24`)
|
|
163
156
|
- npm
|
|
164
157
|
|
|
165
158
|
### Setup
|
|
@@ -168,8 +161,8 @@ Image builds produce `marketrix.azurecr.io/widget:{version}`. Tag pushes also pu
|
|
|
168
161
|
git clone <repository-url>
|
|
169
162
|
cd widget
|
|
170
163
|
npm install
|
|
171
|
-
npm start # dev server on port
|
|
172
|
-
npm run build # production build
|
|
164
|
+
npm start # dev server on port 9001 (widget.marketrix.localhost)
|
|
165
|
+
npm run build # production build → dist/widget.mjs
|
|
173
166
|
```
|
|
174
167
|
|
|
175
168
|
### Project Structure
|
|
@@ -177,15 +170,18 @@ npm run build # production build
|
|
|
177
170
|
```
|
|
178
171
|
widget/
|
|
179
172
|
├── src/
|
|
180
|
-
│ ├── components/ # React components (chat,
|
|
173
|
+
│ ├── components/ # React components (base, blocks, chat, navigation, ui, views)
|
|
174
|
+
│ ├── design-system/ # design tokens + primitives
|
|
181
175
|
│ ├── context/ # WidgetContext provider
|
|
182
176
|
│ ├── hooks/ # Custom React hooks
|
|
183
|
-
│ ├── services/ # Core services (
|
|
184
|
-
│ ├── sdk/ # oRPC client + contract
|
|
177
|
+
│ ├── services/ # Core services (StreamClient, ChatService, SessionRecorder, ToolService, …)
|
|
178
|
+
│ ├── sdk/ # oRPC client + scoped contract mirror (contract.ts + contracts/*)
|
|
185
179
|
│ ├── types/ # TypeScript types
|
|
186
|
-
│ ├── utils/ # Utility functions
|
|
187
|
-
│ ├── constants/ # Config constants
|
|
188
|
-
│
|
|
180
|
+
│ ├── utils/ # Utility functions (incl. bootstrap.tsx — closed Shadow DOM mount)
|
|
181
|
+
│ ├── constants/ # Config constants
|
|
182
|
+
│ ├── lib/ # shared helpers
|
|
183
|
+
│ └── index.tsx # Main entry point (public API)
|
|
184
|
+
├── public/loader.js # classic script-tag loader
|
|
189
185
|
├── vite.config.ts
|
|
190
186
|
├── tsconfig.json
|
|
191
187
|
└── package.json
|
|
@@ -202,31 +198,44 @@ Output files:
|
|
|
202
198
|
|
|
203
199
|
## CI/CD
|
|
204
200
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
|
208
|
-
|
|
|
201
|
+
Single workflow `ci.yml` with three jobs:
|
|
202
|
+
|
|
203
|
+
| Job | Trigger | Action |
|
|
204
|
+
| --------- | -------------------- | ------------------------------------------------------------------------------- |
|
|
205
|
+
| `validate` | Push / PR to `dev` | type-check, lint, build, format:check, test:run, visual/a11y/bundle checks |
|
|
206
|
+
| `build` | Tag push (`v*`) | Build Docker image → `marketrix.azurecr.io/widget:{version}` (v-prefix stripped) |
|
|
207
|
+
| `publish` | Tag push (`v*`) | `npm publish @marketrix.ai/widget` (skipped if version already on registry) |
|
|
208
|
+
|
|
209
|
+
`contract-drift.yml` fails PRs whose `src/sdk/` mirror has drifted from `Marketrix-ai/api` (needs the `CONTRACTS_READ_TOKEN` secret). Dev branch pushes do not build images. Deployment to dev/prod is handled by the centralized `deploy.yml` in `infra`.
|
|
210
|
+
|
|
211
|
+
### Release
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
npm run tag <version> # bumps package.json, refreshes lockfile, builds, commits, tags vX
|
|
215
|
+
git push origin HEAD && git push origin v<version>
|
|
216
|
+
```
|
|
209
217
|
|
|
210
218
|
## Dependencies
|
|
211
219
|
|
|
212
|
-
### Production
|
|
220
|
+
### Production (peer + runtime)
|
|
213
221
|
|
|
214
|
-
- `react` / `react-dom`
|
|
215
|
-
- `@rrweb/record`
|
|
216
|
-
- `@orpc/client` / `@orpc/contract`
|
|
217
|
-
-
|
|
218
|
-
- `zod`
|
|
222
|
+
- `react` / `react-dom` ^19 — peer dependency
|
|
223
|
+
- `@rrweb/record` — session recording
|
|
224
|
+
- `@orpc/client` / `@orpc/contract` ^1 — type-safe API client (oRPC)
|
|
225
|
+
- `@base-ui/react` — UI primitives
|
|
226
|
+
- `zod` ^4 — schema validation
|
|
227
|
+
- `tailwind-merge` — class merging
|
|
219
228
|
|
|
220
229
|
### Development
|
|
221
230
|
|
|
222
|
-
- Vite
|
|
223
|
-
- Tailwind CSS
|
|
224
|
-
- TypeScript
|
|
225
|
-
- Vitest + Testing Library (unit
|
|
226
|
-
- ESLint + Prettier
|
|
231
|
+
- Vite 8
|
|
232
|
+
- Tailwind CSS 4 (via `@tailwindcss/vite` plugin)
|
|
233
|
+
- TypeScript 6
|
|
234
|
+
- Vitest + Testing Library + axe (unit, integration, a11y)
|
|
235
|
+
- ESLint 10 + Prettier
|
|
227
236
|
- Terser for production minification
|
|
228
237
|
|
|
229
|
-
**Quality gates (run before PR):** `npm run type-check
|
|
238
|
+
**Quality gates (run before PR):** `npm run code:check` (type-check + lint + format), `npm run test:run`, `npm run build`, then `npm run visual:check`, `npm run a11y:check`, `npm run bundle:check`.
|
|
230
239
|
|
|
231
240
|
## License
|
|
232
241
|
|
|
@@ -237,4 +246,4 @@ Apache License 2.0 - see LICENSE file for details.
|
|
|
237
246
|
For support and questions, please contact the Marketrix team or create an issue
|
|
238
247
|
in the repository.
|
|
239
248
|
|
|
240
|
-
[Back to top](#marketrix-
|
|
249
|
+
[Back to top](#marketrix-widget)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Keeping this pure makes the previously-untestable ~180-line SSE handler unit
|
|
9
9
|
* testable and removes the nested setState-within-setState that hid bugs.
|
|
10
10
|
*/
|
|
11
|
-
import type { WidgetEvent } from '../sdk
|
|
11
|
+
import type { WidgetEvent } from '../sdk';
|
|
12
12
|
import type { ChatMessage, InstructionType } from '../types';
|
|
13
13
|
export interface SseTaskState {
|
|
14
14
|
activeTaskId: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sseReducer.d.ts","sourceRoot":"","sources":["../../../src/context/sseReducer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sseReducer.d.ts","sourceRoot":"","sources":["../../../src/context/sseReducer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAW7D,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,6EAA6E;AAC7E,MAAM,MAAM,SAAS,GACjB;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,IAAI,EAAE,eAAe,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,GACD;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,SAAS,EAAE,CAAC;CACtB;AAID,KAAK,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ,CAAC;AAuD7D,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,eAAe,EAC5B,KAAK,CAAC,EAAE,MAAM,GACb,QAAQ,CAaV;AAED,gGAAgG;AAChG,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,GAAG,QAAQ,CAetF;AAED,wFAAwF;AACxF,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,GAAG,QAAQ,CAYlF;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,GAAG,YAAY,CAwGzG"}
|