@ai-matrx/messaging 0.0.0 → 0.1.0

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.
@@ -0,0 +1,119 @@
1
+ /**
2
+ * DEFAULT TOKEN VALUES (C26).
3
+ *
4
+ * The package is fully opinionated that these tokens MUST exist, and ships this
5
+ * sheet so it renders correctly UNTHEMED in a fresh app — that is what makes
6
+ * the drop-in test pass in under an hour. A host then sets its brand by
7
+ * overriding the same names; it never forks a component to change a color.
8
+ *
9
+ * Import order matters: `tokens.css` first, then your brand overrides, then
10
+ * `styles.css`. Hardcoded colors inside package components are banned, so every
11
+ * color the UI can draw is named here.
12
+ */
13
+
14
+ :root {
15
+ /* Surfaces */
16
+ --mx-msg-bg: #ffffff;
17
+ --mx-msg-bg-subtle: #f6f7f9;
18
+ --mx-msg-bg-raised: #ffffff;
19
+ --mx-msg-bg-hover: rgba(0, 0, 0, 0.04);
20
+ --mx-msg-bg-active: rgba(0, 0, 0, 0.07);
21
+ --mx-msg-border: rgba(0, 0, 0, 0.09);
22
+ --mx-msg-border-strong: rgba(0, 0, 0, 0.16);
23
+
24
+ /* Text */
25
+ --mx-msg-text: #0b0d12;
26
+ --mx-msg-text-muted: #5c6270;
27
+ --mx-msg-text-faint: #8b909c;
28
+ --mx-msg-text-on-accent: #ffffff;
29
+
30
+ /* Accent + state */
31
+ --mx-msg-accent: #2f6bff;
32
+ --mx-msg-accent-hover: #2559e0;
33
+ --mx-msg-accent-subtle: rgba(47, 107, 255, 0.12);
34
+ --mx-msg-danger: #d7263d;
35
+ --mx-msg-success: #17864a;
36
+ --mx-msg-warning: #b26a00;
37
+ --mx-msg-focus-ring: rgba(47, 107, 255, 0.45);
38
+
39
+ /* Bubbles */
40
+ --mx-msg-bubble-mine-bg: var(--mx-msg-accent);
41
+ --mx-msg-bubble-mine-text: var(--mx-msg-text-on-accent);
42
+ --mx-msg-bubble-theirs-bg: #eef0f4;
43
+ --mx-msg-bubble-theirs-text: var(--mx-msg-text);
44
+ --mx-msg-bubble-radius: 18px;
45
+ --mx-msg-bubble-radius-tight: 6px;
46
+
47
+ /* Avatar palette — deterministic per person, never random per render. */
48
+ --mx-msg-avatar-0: #5b8def;
49
+ --mx-msg-avatar-1: #4aa96c;
50
+ --mx-msg-avatar-2: #d98324;
51
+ --mx-msg-avatar-3: #b45bd1;
52
+ --mx-msg-avatar-4: #d15b6f;
53
+ --mx-msg-avatar-5: #2fa3a3;
54
+ --mx-msg-avatar-6: #8a7fdb;
55
+ --mx-msg-avatar-7: #c2913a;
56
+
57
+ /* Geometry + motion */
58
+ --mx-msg-radius: 12px;
59
+ --mx-msg-radius-sm: 8px;
60
+ --mx-msg-space: 12px;
61
+ --mx-msg-font: inherit;
62
+ --mx-msg-font-size: 15px;
63
+ --mx-msg-font-size-sm: 13px;
64
+ --mx-msg-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.07);
65
+ --mx-msg-motion-fast: 120ms;
66
+ --mx-msg-motion: 220ms;
67
+ --mx-msg-ease: cubic-bezier(0.32, 0.72, 0, 1);
68
+ /* iOS: 44pt minimum touch target. Not negotiable on a phone. */
69
+ --mx-msg-touch-target: 44px;
70
+ }
71
+
72
+ /**
73
+ * Dark values are defined for BOTH the system preference and an explicit
74
+ * `[data-theme="dark"]`, so a host toggle wins in either direction and a page
75
+ * never borrows the wrong ground.
76
+ */
77
+ @media (prefers-color-scheme: dark) {
78
+ :root:not([data-theme="light"]) {
79
+ --mx-msg-bg: #0d1015;
80
+ --mx-msg-bg-subtle: #12161d;
81
+ --mx-msg-bg-raised: #171c24;
82
+ --mx-msg-bg-hover: rgba(255, 255, 255, 0.06);
83
+ --mx-msg-bg-active: rgba(255, 255, 255, 0.1);
84
+ --mx-msg-border: rgba(255, 255, 255, 0.1);
85
+ --mx-msg-border-strong: rgba(255, 255, 255, 0.2);
86
+ --mx-msg-text: #eef1f6;
87
+ --mx-msg-text-muted: #a2a9b8;
88
+ --mx-msg-text-faint: #767d8c;
89
+ --mx-msg-accent: #4b83ff;
90
+ --mx-msg-accent-hover: #6a99ff;
91
+ --mx-msg-accent-subtle: rgba(75, 131, 255, 0.18);
92
+ --mx-msg-danger: #ff6b7d;
93
+ --mx-msg-success: #45c98a;
94
+ --mx-msg-warning: #e2a33a;
95
+ --mx-msg-bubble-theirs-bg: #222833;
96
+ --mx-msg-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.45);
97
+ }
98
+ }
99
+
100
+ :root[data-theme="dark"] {
101
+ --mx-msg-bg: #0d1015;
102
+ --mx-msg-bg-subtle: #12161d;
103
+ --mx-msg-bg-raised: #171c24;
104
+ --mx-msg-bg-hover: rgba(255, 255, 255, 0.06);
105
+ --mx-msg-bg-active: rgba(255, 255, 255, 0.1);
106
+ --mx-msg-border: rgba(255, 255, 255, 0.1);
107
+ --mx-msg-border-strong: rgba(255, 255, 255, 0.2);
108
+ --mx-msg-text: #eef1f6;
109
+ --mx-msg-text-muted: #a2a9b8;
110
+ --mx-msg-text-faint: #767d8c;
111
+ --mx-msg-accent: #4b83ff;
112
+ --mx-msg-accent-hover: #6a99ff;
113
+ --mx-msg-accent-subtle: rgba(75, 131, 255, 0.18);
114
+ --mx-msg-danger: #ff6b7d;
115
+ --mx-msg-success: #45c98a;
116
+ --mx-msg-warning: #e2a33a;
117
+ --mx-msg-bubble-theirs-bg: #222833;
118
+ --mx-msg-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.45);
119
+ }
package/package.json CHANGED
@@ -1,15 +1,108 @@
1
1
  {
2
2
  "name": "@ai-matrx/messaging",
3
- "version": "0.0.0",
4
- "description": "Reserved for the AI Matrx real-time direct and group messaging package.",
3
+ "version": "0.1.0",
4
+ "description": "Enterprise, AI-native in-app messaging for Matrx clients: direct/group/org conversations with atomic direct creation, an outbox that never loses a typed message, optimistic send with echo-safe reconciliation, Matrx entity references, actionable messages with idempotent receipts, agents as participants, and a drop-in polished React UI — all realtime on @ai-matrx/realtime.",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
5
9
  "license": "MIT",
6
- "sideEffects": false,
10
+ "keywords": [
11
+ "messaging",
12
+ "chat",
13
+ "direct-messages",
14
+ "supabase",
15
+ "realtime",
16
+ "presence",
17
+ "typing-indicator",
18
+ "ai-matrx",
19
+ "agents",
20
+ "react"
21
+ ],
7
22
  "repository": {
8
23
  "type": "git",
9
24
  "url": "git+https://github.com/AI-Matrix-Engine/aidream.git",
10
25
  "directory": "apps/shared/messaging"
11
26
  },
12
- "homepage": "https://github.com/AI-Matrix-Engine/aidream",
13
- "files": ["README.md"],
14
- "publishConfig": { "access": "public" }
15
- }
27
+ "homepage": "https://github.com/AI-Matrix-Engine/aidream/tree/main/apps/shared/messaging#readme",
28
+ "bugs": {
29
+ "url": "https://github.com/AI-Matrix-Engine/aidream/issues"
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "README.md",
34
+ "LICENSE",
35
+ "CHANGELOG.md"
36
+ ],
37
+ "exports": {
38
+ ".": {
39
+ "import": {
40
+ "types": "./dist/index.d.ts",
41
+ "default": "./dist/index.js"
42
+ },
43
+ "require": {
44
+ "types": "./dist/index.d.cts",
45
+ "default": "./dist/index.cjs"
46
+ }
47
+ },
48
+ "./react": {
49
+ "import": {
50
+ "types": "./dist/react.d.ts",
51
+ "default": "./dist/react.js"
52
+ },
53
+ "require": {
54
+ "types": "./dist/react.d.cts",
55
+ "default": "./dist/react.cjs"
56
+ }
57
+ },
58
+ "./styles.css": "./dist/styles.css",
59
+ "./tokens.css": "./dist/tokens.css",
60
+ "./package.json": "./package.json"
61
+ },
62
+ "dependencies": {
63
+ "@ai-matrx/agents": "latest",
64
+ "@ai-matrx/realtime": "latest"
65
+ },
66
+ "devDependencies": {
67
+ "@arethetypeswrong/cli": "^0.18.5",
68
+ "@supabase/supabase-js": "^2.108.2",
69
+ "@testing-library/react": "^16.3.0",
70
+ "@types/node": "^22.20.0",
71
+ "@types/react": "^19.1.0",
72
+ "@types/react-dom": "^19.2.3",
73
+ "jsdom": "^25.0.1",
74
+ "publint": "^0.3.24",
75
+ "react": "^19.1.0",
76
+ "react-dom": "^19.2.0",
77
+ "tsup": "^8.5.1",
78
+ "typescript": "^5.9.3",
79
+ "vitest": "^4.1.6"
80
+ },
81
+ "publishConfig": {
82
+ "access": "public",
83
+ "registry": "https://registry.npmjs.org/"
84
+ },
85
+ "engines": {
86
+ "node": ">=20"
87
+ },
88
+ "sideEffects": [
89
+ "*.css"
90
+ ],
91
+ "peerDependencies": {
92
+ "react": ">=18.0.0"
93
+ },
94
+ "peerDependenciesMeta": {
95
+ "react": {
96
+ "optional": true
97
+ }
98
+ },
99
+ "scripts": {
100
+ "build": "pnpm clean && tsup && node ./scripts/copy-css.mjs",
101
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
102
+ "check:package": "pnpm build && publint && pnpm verify:tarball",
103
+ "typecheck": "tsc -p tsconfig.json --noEmit",
104
+ "test": "vitest run",
105
+ "test:watch": "vitest",
106
+ "verify:tarball": "node ./scripts/verify-tarball.mjs"
107
+ }
108
+ }