@powerhousedao/switchboard 4.0.4 → 4.1.0-dev.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/CHANGELOG.md CHANGED
@@ -1,16 +1,18 @@
1
- ## 4.0.4 (2025-07-31)
1
+ ## 4.1.0-dev.10 (2025-08-07)
2
2
 
3
- This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
3
+ ### 🚀 Features
4
4
 
5
- ## 4.0.3 (2025-07-31)
5
+ - **builder-tools,codegen,design-system,reactor-api:** updated document-engineering version ([e74068b43](https://github.com/powerhouse-inc/powerhouse/commit/e74068b43))
6
6
 
7
- This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
7
+ ### ❤️ Thank You
8
8
 
9
- ## 4.0.2 (2025-07-31)
9
+ - acaldas @acaldas
10
+
11
+ ## 4.1.0-dev.9 (2025-08-07)
10
12
 
11
13
  This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
12
14
 
13
- ## 4.0.1 (2025-07-25)
15
+ ## 4.1.0-dev.8 (2025-08-06)
14
16
 
15
17
  ### 🚀 Features
16
18
 
@@ -20,15 +22,152 @@ This was a version bump only for @powerhousedao/switchboard to align it with oth
20
22
 
21
23
  - acaldas @acaldas
22
24
 
23
- # 4.0.0 (2025-07-24)
25
+ ## 4.1.0-dev.7 (2025-08-06)
26
+
27
+ ### 🚀 Features
28
+
29
+ - **switchboard:** added readme ([fbadfca11](https://github.com/powerhouse-inc/powerhouse/commit/fbadfca11))
30
+
31
+ ### ❤️ Thank You
32
+
33
+ - Frank
34
+
35
+ ## 4.1.0-dev.6 (2025-08-06)
36
+
37
+ ### 🚀 Features
38
+
39
+ - **reactor-mcp:** load local document models and reload when they change ([0408a017c](https://github.com/powerhouse-inc/powerhouse/commit/0408a017c))
40
+ - **reactor-local,reactor-api,document-drive:** reload local document models when they change ([5d9af3951](https://github.com/powerhouse-inc/powerhouse/commit/5d9af3951))
41
+
42
+ ### ❤️ Thank You
43
+
44
+ - acaldas @acaldas
45
+
46
+ ## 4.1.0-dev.5 (2025-08-05)
47
+
48
+ This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
49
+
50
+ ## 4.1.0-dev.4 (2025-08-02)
51
+
52
+ ### 🚀 Features
53
+
54
+ - ts morph integration ([#1729](https://github.com/powerhouse-inc/powerhouse/pull/1729))
55
+
56
+ ### ❤️ Thank You
57
+
58
+ - Guillermo Puente Sandoval @gpuente
59
+
60
+ ## 4.1.0-dev.3 (2025-08-01)
61
+
62
+ ### 🚀 Features
63
+
64
+ - **reactor-mcp:** setup of modular reactor tools ([ceab98b08](https://github.com/powerhouse-inc/powerhouse/commit/ceab98b08))
65
+
66
+ ### ❤️ Thank You
67
+
68
+ - acaldas @acaldas
69
+
70
+ ## 4.1.0-dev.2 (2025-07-31)
71
+
72
+ ### 🚀 Features
73
+
74
+ - **reactor-mcp,document/model:** initial implementation of reactor mcp ([4eaab9ab0](https://github.com/powerhouse-inc/powerhouse/commit/4eaab9ab0))
75
+
76
+ ### 🩹 Fixes
77
+
78
+ - linter issues ([e55a16456](https://github.com/powerhouse-inc/powerhouse/commit/e55a16456))
79
+
80
+ ### ❤️ Thank You
81
+
82
+ - acaldas @acaldas
83
+ - Benjamin Jordan (@thegoldenmule)
84
+
85
+ ## 4.1.0-dev.1 (2025-07-29)
86
+
87
+ ### 🚀 Features
88
+
89
+ - added vetra command and vetra project ([#1713](https://github.com/powerhouse-inc/powerhouse/pull/1713))
90
+
91
+ ### ❤️ Thank You
92
+
93
+ - Guillermo Puente Sandoval @gpuente
94
+
95
+ ## 4.0.0-staging.8 (2025-07-29)
24
96
 
25
97
  This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
26
98
 
27
- ## 4.0.0-staging.5 (2025-07-23)
99
+ ## 4.0.0-staging.7 (2025-07-26)
100
+
101
+ ### 🚀 Features
102
+
103
+ - **state:** make all atom states derivative ([68a4bfece](https://github.com/powerhouse-inc/powerhouse/commit/68a4bfece))
104
+
105
+ ### 🩹 Fixes
106
+
107
+ - **switchboard:** remove auth from switchboard config ([ff3410afc](https://github.com/powerhouse-inc/powerhouse/commit/ff3410afc))
108
+
109
+ ### ❤️ Thank You
110
+
111
+ - Frank
112
+ - ryanwolhuter @ryanwolhuter
113
+
114
+ ## 4.0.0-staging.6 (2025-07-25)
115
+
116
+ ### 🚀 Features
117
+
118
+ - **connect:** remove unused dep ([00d3f68c0](https://github.com/powerhouse-inc/powerhouse/commit/00d3f68c0))
119
+ - **state:** use reactor on window object ([40321826e](https://github.com/powerhouse-inc/powerhouse/commit/40321826e))
120
+ - **state:** add state package reference to monorepo tsconfig ([93de86073](https://github.com/powerhouse-inc/powerhouse/commit/93de86073))
121
+ - **state:** remove unused deps ([d681fff7a](https://github.com/powerhouse-inc/powerhouse/commit/d681fff7a))
122
+ - **state:** remove jotai optics dep ([dfc955a82](https://github.com/powerhouse-inc/powerhouse/commit/dfc955a82))
123
+ - **common:** add storybook react dev dep ([61404f414](https://github.com/powerhouse-inc/powerhouse/commit/61404f414))
124
+ - **common:** install storybook types ([c4d45bb7c](https://github.com/powerhouse-inc/powerhouse/commit/c4d45bb7c))
125
+ - **connect:** use new hooks ([93a9eccfa](https://github.com/powerhouse-inc/powerhouse/commit/93a9eccfa))
126
+ - **state:** move state code to own package ([605bd5d75](https://github.com/powerhouse-inc/powerhouse/commit/605bd5d75))
127
+ - support initial strand without operations ([46698d2ff](https://github.com/powerhouse-inc/powerhouse/commit/46698d2ff))
128
+ - **document-drive:** removed drive id where possible ([adcedc4f0](https://github.com/powerhouse-inc/powerhouse/commit/adcedc4f0))
129
+
130
+ ### 🩹 Fixes
131
+
132
+ - **document-drive:** added deprecation warnings and release notes ([dbc86d172](https://github.com/powerhouse-inc/powerhouse/commit/dbc86d172))
133
+ - **common:** update storybook story type ([a84550281](https://github.com/powerhouse-inc/powerhouse/commit/a84550281))
134
+
135
+ ### ❤️ Thank You
136
+
137
+ - acaldas @acaldas
138
+ - ryanwolhuter @ryanwolhuter
139
+
140
+ ## 3.3.0-dev.19 (2025-07-25)
141
+
142
+ ### 🚀 Features
143
+
144
+ - **connect:** remove unused dep ([00d3f68c0](https://github.com/powerhouse-inc/powerhouse/commit/00d3f68c0))
145
+ - **state:** use reactor on window object ([40321826e](https://github.com/powerhouse-inc/powerhouse/commit/40321826e))
146
+ - **state:** add state package reference to monorepo tsconfig ([93de86073](https://github.com/powerhouse-inc/powerhouse/commit/93de86073))
147
+ - **state:** remove unused deps ([d681fff7a](https://github.com/powerhouse-inc/powerhouse/commit/d681fff7a))
148
+ - **state:** remove jotai optics dep ([dfc955a82](https://github.com/powerhouse-inc/powerhouse/commit/dfc955a82))
149
+ - **common:** add storybook react dev dep ([61404f414](https://github.com/powerhouse-inc/powerhouse/commit/61404f414))
150
+ - **common:** install storybook types ([c4d45bb7c](https://github.com/powerhouse-inc/powerhouse/commit/c4d45bb7c))
151
+ - **connect:** use new hooks ([93a9eccfa](https://github.com/powerhouse-inc/powerhouse/commit/93a9eccfa))
152
+ - **state:** move state code to own package ([605bd5d75](https://github.com/powerhouse-inc/powerhouse/commit/605bd5d75))
153
+ - support initial strand without operations ([46698d2ff](https://github.com/powerhouse-inc/powerhouse/commit/46698d2ff))
154
+ - **document-drive:** removed drive id where possible ([adcedc4f0](https://github.com/powerhouse-inc/powerhouse/commit/adcedc4f0))
155
+
156
+ ### 🩹 Fixes
157
+
158
+ - **document-drive:** added deprecation warnings and release notes ([dbc86d172](https://github.com/powerhouse-inc/powerhouse/commit/dbc86d172))
159
+ - **common:** update storybook story type ([a84550281](https://github.com/powerhouse-inc/powerhouse/commit/a84550281))
160
+
161
+ ### ❤️ Thank You
162
+
163
+ - acaldas @acaldas
164
+ - ryanwolhuter @ryanwolhuter
165
+
166
+ ## 3.3.0-dev.18 (2025-07-24)
28
167
 
29
168
  This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
30
169
 
31
- ## 4.0.0-staging.4 (2025-07-22)
170
+ ## 3.3.0-dev.17 (2025-07-23)
32
171
 
33
172
  ### 🩹 Fixes
34
173
 
@@ -39,11 +178,11 @@ This was a version bump only for @powerhousedao/switchboard to align it with oth
39
178
 
40
179
  - Callme-T
41
180
 
42
- ## 4.0.0-staging.3 (2025-07-17)
181
+ ## 3.3.0-dev.16 (2025-07-22)
43
182
 
44
183
  This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
45
184
 
46
- ## 4.0.0-staging.2 (2025-07-17)
185
+ ## 3.3.0-dev.15 (2025-07-17)
47
186
 
48
187
  ### 🩹 Fixes
49
188
 
@@ -51,11 +190,7 @@ This was a version bump only for @powerhousedao/switchboard to align it with oth
51
190
 
52
191
  ### ❤️ Thank You
53
192
 
54
- - acaldas @acaldas
55
-
56
- ## 4.0.0-staging.1 (2025-07-17)
57
-
58
- This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
193
+ - acaldas
59
194
 
60
195
  ## 3.3.0-dev.14 (2025-07-17)
61
196
 
package/README.md ADDED
@@ -0,0 +1,218 @@
1
+ # Switchboard
2
+
3
+ A powerful document-driven server that provides a unified API for managing and serving document models, drives, and reactors in the Powerhouse ecosystem.
4
+
5
+ ## 🚀 Features
6
+
7
+ - **Document Model Management**: Serve and manage document models with GraphQL API
8
+ - **Document Drive Support**: Handle document drives with filesystem and PostgreSQL storage
9
+ - **Reactor Integration**: Built-in support for Powerhouse reactors
10
+ - **Flexible Storage**: Support for filesystem, PostgreSQL, and Redis caching
11
+ - **Docker Ready**: Containerized deployment with comprehensive environment configuration
12
+ - **Authentication**: Configurable authentication with guest, user, and admin roles
13
+ - **HTTPS Support**: Built-in HTTPS server with custom certificates
14
+ - **Profiling**: Integration with Pyroscope for performance monitoring
15
+ - **Error Tracking**: Sentry integration for error monitoring and reporting
16
+
17
+ ## 📦 Installation
18
+
19
+ ### Prerequisites
20
+
21
+ - Node.js 22+
22
+ - pnpm (recommended) or npm
23
+ - Redis (optional, for caching)
24
+ - PostgreSQL (optional, for persistent storage)
25
+
26
+ ### Local Development
27
+
28
+ ```bash
29
+ # Clone the repository
30
+ git clone https://github.com/powerhouse-inc/powerhouse.git
31
+ cd powerhouse
32
+
33
+ # Install dependencies
34
+ pnpm install
35
+
36
+ # Build the switchboard
37
+ pnpm --filter @powerhousedao/switchboard build
38
+
39
+ # Start in development mode
40
+ pnpm --filter @powerhousedao/switchboard dev
41
+ ```
42
+
43
+ ### Global Installation
44
+
45
+ ```bash
46
+ # Install globally
47
+ npm install -g @powerhousedao/switchboard
48
+
49
+ # Or using pnpm
50
+ pnpm add -g @powerhousedao/switchboard
51
+ ```
52
+
53
+ ## 🏃‍♂️ Quick Start
54
+
55
+ ## ⚙️ Configuration
56
+
57
+ ### Environment Variables
58
+
59
+ | Variable | Description | Default |
60
+ |----------|-------------|---------|
61
+ | `PORT` | Server port | `4001` |
62
+ | `DATABASE_URL` | Database connection string | `./.ph/drive-storage` |
63
+ | `REDIS_URL` | Redis connection URL | - |
64
+ | `REDIS_TLS_URL` | Redis TLS connection URL | - |
65
+ | `SENTRY_DSN` | Sentry DSN for error tracking | - |
66
+ | `SENTRY_ENV` | Sentry environment | - |
67
+ | `PYROSCOPE_SERVER_ADDRESS` | Pyroscope server address | - |
68
+
69
+ ### Authentication Configuration
70
+
71
+ ```typescript
72
+ const options = {
73
+ auth: {
74
+ enabled: true,
75
+ guests: ['0x123', '0x456'],
76
+ users: ['0x789', '0xabc'],
77
+ admins: ['0xdef', '0xghi']
78
+ }
79
+ };
80
+ ```
81
+
82
+ ### Storage Options
83
+
84
+ Switchboard supports multiple storage backends:
85
+
86
+ - **Filesystem**: Local file-based storage (default)
87
+ - **PostgreSQL**: Persistent database storage
88
+ - **Redis**: Caching layer (optional)
89
+
90
+ ## 🐳 Docker Deployment
91
+
92
+ ### Using Docker Compose
93
+
94
+ ```yaml
95
+ version: '3.8'
96
+ services:
97
+ switchboard:
98
+ image: powerhouse/switchboard:latest
99
+ ports:
100
+ - "4001:4001"
101
+ environment:
102
+ - PORT=4001
103
+ - DATABASE_URL=postgresql://user:pass@db:5432/switchboard
104
+ - REDIS_URL=redis://redis:6379
105
+ depends_on:
106
+ - db
107
+ - redis
108
+
109
+ db:
110
+ image: postgres:15
111
+ environment:
112
+ POSTGRES_DB: switchboard
113
+ POSTGRES_USER: user
114
+ POSTGRES_PASSWORD: pass
115
+
116
+ redis:
117
+ image: redis:7-alpine
118
+ ```
119
+
120
+ ### Environment Variables for Docker
121
+
122
+ ```bash
123
+ # Database
124
+ PH_SWITCHBOARD_DATABASE_URL="postgresql://user:pass@db:5432/switchboard"
125
+ PH_SWITCHBOARD_REDIS_URL="redis://redis:6379"
126
+
127
+ # Authentication
128
+ PH_SWITCHBOARD_AUTH_ENABLED=true
129
+ PH_SWITCHBOARD_ADMINS_LIST="0x123,0x456"
130
+ PH_SWITCHBOARD_USERS_LIST="0x789,0xabc"
131
+ PH_SWITCHBOARD_GUESTS_LIST="0xdef,0xghi"
132
+
133
+ # Packages
134
+ PH_PACKAGES="package1,package2,package3"
135
+ ```
136
+
137
+ ## 🔧 Development
138
+
139
+ ### Project Structure
140
+
141
+ ```
142
+ src/
143
+ ├── index.ts # Main entry point
144
+ ├── server.ts # Server implementation
145
+ ├── config.ts # Configuration management
146
+ ├── types.ts # TypeScript type definitions
147
+ ├── utils.ts # Utility functions
148
+ ├── profiler.ts # Profiling integration
149
+ ├── install-packages.ts # Package installation
150
+ └── clients/ # External client integrations
151
+ └── redis.ts # Redis client
152
+ ```
153
+
154
+ ### Available Scripts
155
+
156
+ ```bash
157
+ # Build the project
158
+ pnpm build
159
+
160
+ # Start in development mode
161
+ pnpm dev
162
+
163
+ # Start production server
164
+ pnpm start
165
+
166
+ # Lint code
167
+ pnpm lint
168
+
169
+ # Clean build artifacts
170
+ pnpm clean
171
+ ```
172
+
173
+ ### Adding New Features
174
+
175
+ 1. **Document Models**: Add new document model modules to the reactor builder
176
+ 2. **Storage Backends**: Implement new storage adapters
177
+ 3. **Authentication**: Extend authentication logic
178
+ 4. **API Endpoints**: Add new GraphQL resolvers
179
+
180
+ ## 📚 API Reference
181
+
182
+ ### GraphQL Endpoints
183
+
184
+ Switchboard exposes a GraphQL API for document operations:
185
+
186
+ - **Document Models**: Query and mutate document models
187
+ - **Document Drives**: Manage document drives
188
+ - **Reactor Operations**: Execute reactor operations
189
+
190
+ ### REST Endpoints
191
+
192
+ - `GET /health` - Health check endpoint
193
+ - `POST /graphql` - GraphQL endpoint
194
+ - `GET /graphql` - GraphQL playground (development)
195
+
196
+ ## 🤝 Contributing
197
+
198
+ 1. Fork the repository
199
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
200
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
201
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
202
+ 5. Open a Pull Request
203
+
204
+ ## 📄 License
205
+
206
+ This project is licensed under the ISC License - see the [LICENSE](LICENSE) file for details.
207
+
208
+ ## 🆘 Support
209
+
210
+ - **Documentation**: [Powerhouse Docs](https://docs.powerhouse.com)
211
+ - **Issues**: [GitHub Issues](https://github.com/powerhouse-inc/powerhouse/issues)
212
+ - **Discussions**: [GitHub Discussions](https://github.com/powerhouse-inc/powerhouse/discussions)
213
+
214
+ ## 🔗 Related Projects
215
+
216
+ - [@powerhousedao/reactor-api](https://github.com/powerhouse-inc/powerhouse/tree/main/packages/reactor-api) - Reactor API package
217
+ - [@powerhousedao/document-drive](https://github.com/powerhouse-inc/powerhouse/tree/main/packages/document-drive) - Document drive management
218
+ - [@powerhousedao/document-model](https://github.com/powerhouse-inc/powerhouse/tree/main/packages/document-model) - Document model system