@dbx-tools/ui-mastra 0.3.36 → 0.3.39

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/package.json CHANGED
@@ -25,26 +25,28 @@
25
25
  "shiki": "^3.0.0",
26
26
  "sql-formatter": "^15.6.9",
27
27
  "streamdown": "^2.5.0",
28
- "@dbx-tools/shared-mastra": "0.3.36",
29
- "@dbx-tools/shared-genie": "0.3.36",
30
- "@dbx-tools/shared-model": "0.3.36",
31
- "@dbx-tools/shared-core": "0.3.36",
32
- "@dbx-tools/ui-appkit": "0.3.36",
33
- "@dbx-tools/ui-branding": "0.3.36"
28
+ "@dbx-tools/shared-core": "0.3.39",
29
+ "@dbx-tools/shared-mastra": "0.3.39",
30
+ "@dbx-tools/shared-genie": "0.3.39",
31
+ "@dbx-tools/shared-model": "0.3.39",
32
+ "@dbx-tools/ui-appkit": "0.3.39",
33
+ "@dbx-tools/ui-branding": "0.3.39"
34
34
  },
35
- "main": "index.ts",
36
35
  "license": "UNLICENSED",
37
36
  "publishConfig": {
38
37
  "access": "public"
39
38
  },
40
- "version": "0.3.36",
41
- "types": "index.ts",
39
+ "version": "0.3.39",
42
40
  "type": "module",
43
41
  "exports": {
44
42
  "./react": "./src/react/index.ts",
45
43
  "./styles.css": "./src/styles.css",
46
44
  "./package.json": "./package.json"
47
45
  },
46
+ "files": [
47
+ "index.ts",
48
+ "src"
49
+ ],
48
50
  "dbxToolsConfig": {
49
51
  "tags": [
50
52
  "ui"
@@ -1,101 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { describe, it } from "node:test";
3
- import type { QueuedSteer, ToolEvent } from "../src/react/types";
4
- import {
5
- enqueueSteer,
6
- removeSteer,
7
- reorderSteers,
8
- terminateRunningToolEvents,
9
- } from "../src/support/thread-sessions";
10
-
11
- const event = (id: string, status: ToolEvent["status"]): ToolEvent => ({
12
- id,
13
- toolName: "ask_genie",
14
- status,
15
- });
16
-
17
- describe("terminateRunningToolEvents", () => {
18
- it("settles running pills to done", () => {
19
- const next = terminateRunningToolEvents({
20
- msg1: [event("a", "running"), event("b", "done")],
21
- msg2: [event("c", "running")],
22
- });
23
- assert.deepEqual(
24
- next.msg1!.map((e) => e.status),
25
- ["done", "done"],
26
- );
27
- assert.deepEqual(
28
- next.msg2!.map((e) => e.status),
29
- ["done"],
30
- );
31
- });
32
-
33
- it("leaves already-terminal pills untouched and returns the same ref when nothing ran", () => {
34
- const input = {
35
- msg1: [event("a", "done"), event("b", "error")],
36
- };
37
- const next = terminateRunningToolEvents(input);
38
- // No running pills, so the map is returned unchanged (identity) to let
39
- // callers skip a needless state update.
40
- assert.equal(next, input);
41
- });
42
-
43
- it("handles an empty map", () => {
44
- const input = {};
45
- assert.equal(terminateRunningToolEvents(input), input);
46
- });
47
- });
48
-
49
- describe("steer queue", () => {
50
- const steer = (id: string, text: string): QueuedSteer => ({ id, text });
51
-
52
- it("enqueues oldest-first without mutating the input", () => {
53
- const q0: QueuedSteer[] = [];
54
- const q1 = enqueueSteer(q0, steer("a", "first"));
55
- const q2 = enqueueSteer(q1, steer("b", "second"));
56
- assert.deepEqual(
57
- q2.map((s) => s.id),
58
- ["a", "b"],
59
- );
60
- assert.equal(q0.length, 0);
61
- assert.equal(q1.length, 1);
62
- });
63
-
64
- it("removes by id and leaves the rest in order", () => {
65
- const q = [steer("a", "1"), steer("b", "2"), steer("c", "3")];
66
- assert.deepEqual(
67
- removeSteer(q, "b").map((s) => s.id),
68
- ["a", "c"],
69
- );
70
- });
71
-
72
- it("removing an unknown id is a no-op copy", () => {
73
- const q = [steer("a", "1")];
74
- assert.deepEqual(removeSteer(q, "zzz"), q);
75
- });
76
-
77
- it("reorders to match the given id order", () => {
78
- const q = [steer("a", "1"), steer("b", "2"), steer("c", "3")];
79
- assert.deepEqual(
80
- reorderSteers(q, ["c", "a", "b"]).map((s) => s.id),
81
- ["c", "a", "b"],
82
- );
83
- });
84
-
85
- it("appends any current steer missing from the order, and ignores unknown ids", () => {
86
- const q = [steer("a", "1"), steer("b", "2"), steer("c", "3")];
87
- // "b" omitted + a stale "zzz" present: zzz ignored, b appended after the rest.
88
- assert.deepEqual(
89
- reorderSteers(q, ["c", "zzz", "a"]).map((s) => s.id),
90
- ["c", "a", "b"],
91
- );
92
- });
93
-
94
- it("never duplicates when the order repeats an id", () => {
95
- const q = [steer("a", "1"), steer("b", "2")];
96
- assert.deepEqual(
97
- reorderSteers(q, ["a", "a", "b"]).map((s) => s.id),
98
- ["a", "b"],
99
- );
100
- });
101
- });
@@ -1,14 +0,0 @@
1
- // ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen".
2
- {
3
- "extends": "../tsconfig.json",
4
- "compilerOptions": {
5
- "noEmit": true,
6
- "rootDir": ".."
7
- },
8
- "include": [
9
- "**/*.ts"
10
- ],
11
- "exclude": [
12
- "node_modules"
13
- ]
14
- }
package/tsconfig.json DELETED
@@ -1,43 +0,0 @@
1
- // ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen".
2
- {
3
- "compilerOptions": {
4
- "rootDir": "src",
5
- "outDir": "lib",
6
- "alwaysStrict": true,
7
- "declaration": true,
8
- "esModuleInterop": true,
9
- "experimentalDecorators": true,
10
- "inlineSourceMap": true,
11
- "inlineSources": true,
12
- "lib": [
13
- "ES2022",
14
- "DOM",
15
- "DOM.Iterable"
16
- ],
17
- "module": "ESNext",
18
- "noEmitOnError": false,
19
- "noFallthroughCasesInSwitch": true,
20
- "noImplicitAny": true,
21
- "noImplicitReturns": true,
22
- "noImplicitThis": true,
23
- "noUnusedLocals": true,
24
- "noUnusedParameters": true,
25
- "resolveJsonModule": true,
26
- "strict": true,
27
- "strictNullChecks": true,
28
- "strictPropertyInitialization": true,
29
- "stripInternal": true,
30
- "target": "ES2022",
31
- "types": [],
32
- "moduleResolution": "bundler",
33
- "skipLibCheck": true,
34
- "jsx": "react-jsx"
35
- },
36
- "include": [
37
- "src/**/*.ts",
38
- "src/**/*.tsx"
39
- ],
40
- "exclude": [
41
- "node_modules"
42
- ]
43
- }