@powerhousedao/switchboard 6.0.0-dev.3 → 6.0.0-dev.30

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,3 +1,283 @@
1
+ ## 6.0.0-dev.30 (2026-02-03)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **releases:** remove problematic publish dry run ([8b9b065b9](https://github.com/powerhouse-inc/powerhouse/commit/8b9b065b9))
6
+ - **releases:** include git side effects check in all booleans ([19c44503d](https://github.com/powerhouse-inc/powerhouse/commit/19c44503d))
7
+
8
+ ### ❤️ Thank You
9
+
10
+ - ryanwolhuter @ryanwolhuter
11
+
12
+ ## 6.0.0-dev.29 (2026-02-03)
13
+
14
+ ### 🚀 Features
15
+
16
+ - **release:** add doc comments ([3ab9879d4](https://github.com/powerhouse-inc/powerhouse/commit/3ab9879d4))
17
+ - **monorepo:** simplified release workflow ([#2276](https://github.com/powerhouse-inc/powerhouse/pull/2276))
18
+
19
+ ### 🩹 Fixes
20
+
21
+ - package.json onlyBuilt ([3b6165267](https://github.com/powerhouse-inc/powerhouse/commit/3b6165267))
22
+ - **release:** move checkout action ([4ed305d57](https://github.com/powerhouse-inc/powerhouse/commit/4ed305d57))
23
+
24
+ ### ❤️ Thank You
25
+
26
+ - Benjamin Jordan (@thegoldenmule)
27
+ - Ryan Wolhuter @ryanwolhuter
28
+ - ryanwolhuter @ryanwolhuter
29
+
30
+ ## 6.0.0-dev.28 (2026-01-31)
31
+
32
+ ### 🚀 Features
33
+
34
+ - add e2e tests to simulate ([6ba43d19b](https://github.com/powerhouse-inc/powerhouse/commit/6ba43d19b))
35
+ - adding signal handlers and removing old feature flags ([f08253a2d](https://github.com/powerhouse-inc/powerhouse/commit/f08253a2d))
36
+
37
+ ### ❤️ Thank You
38
+
39
+ - Benjamin Jordan (@thegoldenmule)
40
+
41
+ ## 6.0.0-dev.27 (2026-01-30)
42
+
43
+ ### 🚀 Features
44
+
45
+ - renown sdk improvements ([bc1099d94](https://github.com/powerhouse-inc/powerhouse/commit/bc1099d94))
46
+ - **ph-cmd:** fix forwarding and versioning bug ([#2272](https://github.com/powerhouse-inc/powerhouse/pull/2272))
47
+
48
+ ### ❤️ Thank You
49
+
50
+ - acaldas
51
+ - Ryan Wolhuter @ryanwolhuter
52
+
53
+ ## 6.0.0-dev.26 (2026-01-29)
54
+
55
+ ### 🚀 Features
56
+
57
+ - update minimum node version to 24 ([7a71107c5](https://github.com/powerhouse-inc/powerhouse/commit/7a71107c5))
58
+
59
+ ### 🩹 Fixes
60
+
61
+ - undo my changes to the tsc script ([0a36d0a49](https://github.com/powerhouse-inc/powerhouse/commit/0a36d0a49))
62
+
63
+ ### ❤️ Thank You
64
+
65
+ - acaldas @acaldas
66
+ - Benjamin Jordan (@thegoldenmule)
67
+
68
+ ## 6.0.0-dev.25 (2026-01-28)
69
+
70
+ This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
71
+
72
+ ## 6.0.0-dev.24 (2026-01-27)
73
+
74
+ ### 🚀 Features
75
+
76
+ - **switchboard:** enhance pyroscope profiler with wall and heap support ([254c0cea9](https://github.com/powerhouse-inc/powerhouse/commit/254c0cea9))
77
+ - **monorepo:** ensure the same typescript version is used everywhere ([#2258](https://github.com/powerhouse-inc/powerhouse/pull/2258))
78
+
79
+ ### 🩹 Fixes
80
+
81
+ - **vetra,switchboard:** fix TypeScript errors in permission tests and profiler ([7726f95a3](https://github.com/powerhouse-inc/powerhouse/commit/7726f95a3))
82
+
83
+ ### ❤️ Thank You
84
+
85
+ - Frank
86
+ - Ryan Wolhuter @ryanwolhuter
87
+
88
+ ## 6.0.0-dev.23 (2026-01-27)
89
+
90
+ ### 🚀 Features
91
+
92
+ - **monorepo:** add diff filter to exclude deleted files in changed files action ([e86961e79](https://github.com/powerhouse-inc/powerhouse/commit/e86961e79))
93
+ - **academy:** added release slides to academy project ([eab5e56fe](https://github.com/powerhouse-inc/powerhouse/commit/eab5e56fe))
94
+
95
+ ### ❤️ Thank You
96
+
97
+ - acaldas @acaldas
98
+ - ryanwolhuter @ryanwolhuter
99
+
100
+ ## 6.0.0-dev.22 (2026-01-27)
101
+
102
+ ### 🩹 Fixes
103
+
104
+ - **monorepo:** inefficient workflows ([#2250](https://github.com/powerhouse-inc/powerhouse/pull/2250))
105
+
106
+ ### ❤️ Thank You
107
+
108
+ - Ryan Wolhuter @ryanwolhuter
109
+
110
+ ## 6.0.0-dev.21 (2026-01-27)
111
+
112
+ This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
113
+
114
+ ## 6.0.0-dev.20 (2026-01-26)
115
+
116
+ This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
117
+
118
+ ## 6.0.0-dev.19 (2026-01-26)
119
+
120
+ ### 🩹 Fixes
121
+
122
+ - **docker:** add ph-cli to global install for switchboard ([6cea7f52e](https://github.com/powerhouse-inc/powerhouse/commit/6cea7f52e))
123
+
124
+ ### ❤️ Thank You
125
+
126
+ - Frank
127
+
128
+ ## 6.0.0-dev.18 (2026-01-26)
129
+
130
+ ### 🚀 Features
131
+
132
+ - **ph-cli, ph-cmd:** use cmd ts for remaining ph cmd commands ([#2209](https://github.com/powerhouse-inc/powerhouse/pull/2209))
133
+
134
+ ### 🩹 Fixes
135
+
136
+ - trailing newline in publish-docker-images workflow ([7d2e30db4](https://github.com/powerhouse-inc/powerhouse/commit/7d2e30db4))
137
+ - **ci:** remove deploy-k8s from publish-docker-images workflow ([c5869e82f](https://github.com/powerhouse-inc/powerhouse/commit/c5869e82f))
138
+
139
+ ### ❤️ Thank You
140
+
141
+ - Frank
142
+ - Ryan Wolhuter @ryanwolhuter
143
+
144
+ ## 6.0.0-dev.17 (2026-01-26)
145
+
146
+ This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
147
+
148
+ ## 6.0.0-dev.16 (2026-01-24)
149
+
150
+ This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
151
+
152
+ ## 6.0.0-dev.15 (2026-01-23)
153
+
154
+ This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
155
+
156
+ ## 6.0.0-dev.14 (2026-01-22)
157
+
158
+ ### 🩹 Fixes
159
+
160
+ - pnpm filtering ([3875e271c](https://github.com/powerhouse-inc/powerhouse/commit/3875e271c))
161
+ - do not run profiling tests by default ([a196a19da](https://github.com/powerhouse-inc/powerhouse/commit/a196a19da))
162
+ - **profiling:** add TypeScript configuration for profiling scripts ([d0ee094c7](https://github.com/powerhouse-inc/powerhouse/commit/d0ee094c7))
163
+ - **design-system:** declare document-drive and reactor-browser as runtime dependencies ([3db4afa38](https://github.com/powerhouse-inc/powerhouse/commit/3db4afa38))
164
+
165
+ ### ❤️ Thank You
166
+
167
+ - acaldas @acaldas
168
+ - Benjamin Jordan (@thegoldenmule)
169
+ - Samuel Hawksby-Robinson @Samyoul
170
+
171
+ ## 6.0.0-dev.13 (2026-01-21)
172
+
173
+ ### 🚀 Features
174
+
175
+ - add workflow to trigger downstream package updates ([e8c6cce75](https://github.com/powerhouse-inc/powerhouse/commit/e8c6cce75))
176
+
177
+ ### ❤️ Thank You
178
+
179
+ - Frank
180
+
181
+ ## 6.0.0-dev.12 (2026-01-20)
182
+
183
+ ### 🩹 Fixes
184
+
185
+ - **docker:** install prettier globally for ph init project ([7817c65ba](https://github.com/powerhouse-inc/powerhouse/commit/7817c65ba))
186
+
187
+ ### ❤️ Thank You
188
+
189
+ - Frank
190
+
191
+ ## 6.0.0-dev.11 (2026-01-20)
192
+
193
+ ### 🩹 Fixes
194
+
195
+ - **monorepo:** exclude root package from recursive build to prevent infinite loop ([099139393](https://github.com/powerhouse-inc/powerhouse/commit/099139393))
196
+ - **codegen:** fix failing codegen tests ([#2227](https://github.com/powerhouse-inc/powerhouse/pull/2227))
197
+
198
+ ### ❤️ Thank You
199
+
200
+ - Frank
201
+ - Ryan Wolhuter @ryanwolhuter
202
+
203
+ ## 6.0.0-dev.10 (2026-01-19)
204
+
205
+ ### 🚀 Features
206
+
207
+ - **ph-cmd:** move dependencies to dev dependencies ([8aa16c346](https://github.com/powerhouse-inc/powerhouse/commit/8aa16c346))
208
+
209
+ ### ❤️ Thank You
210
+
211
+ - ryanwolhuter @ryanwolhuter
212
+
213
+ ## 6.0.0-dev.9 (2026-01-19)
214
+
215
+ ### 🚀 Features
216
+
217
+ - **ph-cmd:** test build with bun ([#2225](https://github.com/powerhouse-inc/powerhouse/pull/2225))
218
+
219
+ ### ❤️ Thank You
220
+
221
+ - Ryan Wolhuter @ryanwolhuter
222
+
223
+ ## 6.0.0-dev.8 (2026-01-17)
224
+
225
+ ### 🚀 Features
226
+
227
+ - **design-system:** default styles tweaks and DocumentStateViewer ([c0a66720c](https://github.com/powerhouse-inc/powerhouse/commit/c0a66720c))
228
+ - **ci:** deploy staging tenant from release/staging/* branches ([8761579e7](https://github.com/powerhouse-inc/powerhouse/commit/8761579e7))
229
+ - **ci:** add Harbor registry to docker image publishing ([f3a2fab69](https://github.com/powerhouse-inc/powerhouse/commit/f3a2fab69))
230
+
231
+ ### 🩹 Fixes
232
+
233
+ - **switchboard:** keep prisma db push before running migrations ([e666de869](https://github.com/powerhouse-inc/powerhouse/commit/e666de869))
234
+ - **switchboard:** use ph switchboard --migrate for database migrations ([d4ee55a23](https://github.com/powerhouse-inc/powerhouse/commit/d4ee55a23))
235
+
236
+ ### ❤️ Thank You
237
+
238
+ - acaldas @acaldas
239
+ - Frank
240
+
241
+ ## 6.0.0-dev.7 (2026-01-16)
242
+
243
+ ### 🩹 Fixes
244
+
245
+ - **ph-cmd:** do not publish dependencies in cli ([0f5296d02](https://github.com/powerhouse-inc/powerhouse/commit/0f5296d02))
246
+
247
+ ### ❤️ Thank You
248
+
249
+ - ryanwolhuter @ryanwolhuter
250
+
251
+ ## 6.0.0-dev.6 (2026-01-16)
252
+
253
+ ### 🩹 Fixes
254
+
255
+ - **ph-cmd:** move .npmrc to codegen package dir ([35ef27743](https://github.com/powerhouse-inc/powerhouse/commit/35ef27743))
256
+
257
+ ### ❤️ Thank You
258
+
259
+ - ryanwolhuter @ryanwolhuter
260
+
261
+ ## 6.0.0-dev.5 (2026-01-16)
262
+
263
+ ### 🩹 Fixes
264
+
265
+ - **switchboard:** regenerate Prisma client for Alpine Linux ([4bc96c72d](https://github.com/powerhouse-inc/powerhouse/commit/4bc96c72d))
266
+
267
+ ### ❤️ Thank You
268
+
269
+ - Frank
270
+
271
+ ## 6.0.0-dev.4 (2026-01-16)
272
+
273
+ ### 🩹 Fixes
274
+
275
+ - **switchboard:** add openssl for Prisma compatibility ([fe7235609](https://github.com/powerhouse-inc/powerhouse/commit/fe7235609))
276
+
277
+ ### ❤️ Thank You
278
+
279
+ - Frank
280
+
1
281
  ## 6.0.0-dev.3 (2026-01-16)
2
282
 
3
283
  ### 🚀 Features
package/Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
1
  # Build stage
2
- FROM node:22-alpine AS build
2
+ FROM node:24-alpine AS build
3
3
 
4
4
  WORKDIR /app
5
5
 
@@ -19,8 +19,8 @@ RUN pnpm config set @jsr:registry https://npm.jsr.io
19
19
  ARG TAG=latest
20
20
  ARG PH_PACKAGES=""
21
21
 
22
- # Install ph-cmd and prisma
23
- RUN pnpm add -g ph-cmd@$TAG prisma@5.17.0
22
+ # Install ph-cmd, prisma, and prettier
23
+ RUN pnpm add -g ph-cmd@$TAG prisma@5.17.0 prettier
24
24
 
25
25
  # Initialize project based on tag
26
26
  RUN case "$TAG" in \
@@ -39,13 +39,17 @@ RUN if [ -n "$PH_PACKAGES" ]; then \
39
39
  done; \
40
40
  fi
41
41
 
42
+ # Regenerate Prisma client for Alpine Linux (linux-musl-openssl-3.0.x)
43
+ # The document-drive package ships with darwin-arm64 binaries, we need to regenerate
44
+ RUN prisma generate --schema node_modules/document-drive/dist/prisma/schema.prisma
45
+
42
46
  # Final stage - slim node image
43
- FROM node:22-alpine
47
+ FROM node:24-alpine
44
48
 
45
49
  WORKDIR /app
46
50
 
47
- # Install runtime dependencies only
48
- RUN apk add --no-cache curl
51
+ # Install runtime dependencies (curl for health checks, openssl for Prisma)
52
+ RUN apk add --no-cache curl openssl
49
53
 
50
54
  # Setup pnpm
51
55
  ENV PNPM_HOME="/pnpm"
package/dist/src/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { config } from "./config.js";
3
3
  import { startSwitchboard } from "./server.js";
4
- function ensureNodeVersion(minVersion = "22") {
4
+ function ensureNodeVersion(minVersion = "24") {
5
5
  const version = process.versions.node;
6
6
  if (!version) {
7
7
  return;
@@ -12,7 +12,7 @@ function ensureNodeVersion(minVersion = "22") {
12
12
  }
13
13
  }
14
14
  // Ensure minimum Node.js version
15
- ensureNodeVersion("22");
15
+ ensureNodeVersion("24");
16
16
  process.on("SIGINT", () => {
17
17
  console.log("\nShutting down...");
18
18
  process.exit(0);
@@ -1,4 +1,9 @@
1
1
  import type { PyroscopeConfig } from "@pyroscope/nodejs";
2
2
  export declare function initProfilerFromEnv(env: typeof process.env): Promise<void>;
3
- export declare function initProfiler(options?: PyroscopeConfig): Promise<void>;
3
+ interface ProfilerFlags {
4
+ wallEnabled?: boolean;
5
+ heapEnabled?: boolean;
6
+ }
7
+ export declare function initProfiler(options?: PyroscopeConfig, flags?: ProfilerFlags): Promise<void>;
8
+ export {};
4
9
  //# sourceMappingURL=profiler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,OAAO,OAAO,CAAC,GAAG,iBAehE;AAED,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE,eAAe,iBAK3D"}
1
+ {"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,OAAO,OAAO,CAAC,GAAG,iBAgChE;AAED,UAAU,aAAa;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAsB,YAAY,CAChC,OAAO,CAAC,EAAE,eAAe,EACzB,KAAK,GAAE,aAAyD,iBAqBjE"}
@@ -1,17 +1,43 @@
1
1
  export async function initProfilerFromEnv(env) {
2
- const { PYROSCOPE_SERVER_ADDRESS: serverAddress, PYROSCOPE_APPLICATION_NAME: appName, PYROSCOPE_USER: basicAuthUser, PYROSCOPE_PASSWORD: basicAuthPassword, } = env;
2
+ const { PYROSCOPE_SERVER_ADDRESS: serverAddress, PYROSCOPE_APPLICATION_NAME: appName, PYROSCOPE_USER: basicAuthUser, PYROSCOPE_PASSWORD: basicAuthPassword, PYROSCOPE_WALL_ENABLED: wallEnabled, PYROSCOPE_HEAP_ENABLED: heapEnabled, } = env;
3
3
  const options = {
4
4
  serverAddress,
5
5
  appName,
6
6
  basicAuthUser,
7
7
  basicAuthPassword,
8
+ // Wall profiling captures wall-clock time (includes async I/O waits)
9
+ // This shows GraphQL resolvers even when waiting for database
10
+ wall: {
11
+ samplingDurationMs: 10000, // 10 second sampling windows
12
+ samplingIntervalMicros: 10000, // 10ms sampling interval (100 samples/sec)
13
+ collectCpuTime: true, // Also collect CPU time alongside wall time
14
+ },
15
+ // Heap profiling for memory allocation tracking
16
+ heap: {
17
+ samplingIntervalBytes: 512 * 1024, // Sample every 512KB allocated
18
+ stackDepth: 64, // Capture deeper stacks for better context
19
+ },
8
20
  };
9
- return initProfiler(options);
21
+ return initProfiler(options, {
22
+ wallEnabled: wallEnabled !== "false",
23
+ heapEnabled: heapEnabled === "true",
24
+ });
10
25
  }
11
- export async function initProfiler(options) {
26
+ export async function initProfiler(options, flags = { wallEnabled: true, heapEnabled: false }) {
12
27
  console.log("Initializing Pyroscope profiler at:", options?.serverAddress);
13
- const Pyroscope = await import("@pyroscope/nodejs");
28
+ console.log(" Wall profiling:", flags.wallEnabled ? "enabled" : "disabled");
29
+ console.log(" Heap profiling:", flags.heapEnabled ? "enabled" : "disabled");
30
+ const { default: Pyroscope } = await import("@pyroscope/nodejs");
14
31
  Pyroscope.init(options);
15
- Pyroscope.start();
32
+ // Start wall profiling (captures async I/O time - shows resolvers)
33
+ if (flags.wallEnabled) {
34
+ Pyroscope.startWallProfiling();
35
+ }
36
+ // Start CPU profiling (captures CPU-bound work)
37
+ Pyroscope.startCpuProfiling();
38
+ // Optionally start heap profiling (memory allocations)
39
+ if (flags.heapEnabled) {
40
+ Pyroscope.startHeapProfiling();
41
+ }
16
42
  }
17
43
  //# sourceMappingURL=profiler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profiler.js","sourceRoot":"","sources":["../../src/profiler.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,GAAuB;IAC/D,MAAM,EACJ,wBAAwB,EAAE,aAAa,EACvC,0BAA0B,EAAE,OAAO,EACnC,cAAc,EAAE,aAAa,EAC7B,kBAAkB,EAAE,iBAAiB,GACtC,GAAG,GAAG,CAAC;IAER,MAAM,OAAO,GAAoB;QAC/B,aAAa;QACb,OAAO;QACP,aAAa;QACb,iBAAiB;KAClB,CAAC;IACF,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAyB;IAC1D,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;IAC3E,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;IACpD,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxB,SAAS,CAAC,KAAK,EAAE,CAAC;AACpB,CAAC"}
1
+ {"version":3,"file":"profiler.js","sourceRoot":"","sources":["../../src/profiler.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,GAAuB;IAC/D,MAAM,EACJ,wBAAwB,EAAE,aAAa,EACvC,0BAA0B,EAAE,OAAO,EACnC,cAAc,EAAE,aAAa,EAC7B,kBAAkB,EAAE,iBAAiB,EACrC,sBAAsB,EAAE,WAAW,EACnC,sBAAsB,EAAE,WAAW,GACpC,GAAG,GAAG,CAAC;IAER,MAAM,OAAO,GAAoB;QAC/B,aAAa;QACb,OAAO;QACP,aAAa;QACb,iBAAiB;QACjB,qEAAqE;QACrE,8DAA8D;QAC9D,IAAI,EAAE;YACJ,kBAAkB,EAAE,KAAK,EAAE,6BAA6B;YACxD,sBAAsB,EAAE,KAAK,EAAE,2CAA2C;YAC1E,cAAc,EAAE,IAAI,EAAE,4CAA4C;SACnE;QACD,gDAAgD;QAChD,IAAI,EAAE;YACJ,qBAAqB,EAAE,GAAG,GAAG,IAAI,EAAE,+BAA+B;YAClE,UAAU,EAAE,EAAE,EAAE,2CAA2C;SAC5D;KACF,CAAC;IACF,OAAO,YAAY,CAAC,OAAO,EAAE;QAC3B,WAAW,EAAE,WAAW,KAAK,OAAO;QACpC,WAAW,EAAE,WAAW,KAAK,MAAM;KACpC,CAAC,CAAC;AACL,CAAC;AAOD,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAAyB,EACzB,QAAuB,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE;IAEhE,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;IAC3E,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAE7E,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;IACjE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAExB,mEAAmE;IACnE,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;QACtB,SAAS,CAAC,kBAAkB,EAAE,CAAC;IACjC,CAAC;IAED,gDAAgD;IAChD,SAAS,CAAC,iBAAiB,EAAE,CAAC;IAE9B,uDAAuD;IACvD,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;QACtB,SAAS,CAAC,kBAAkB,EAAE,CAAC;IACjC,CAAC;AACH,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type IRenown } from "@renown/sdk/node";
2
+ export interface RenownOptions {
3
+ /** Path to the keypair file. Defaults to .ph/.keypair.json in cwd */
4
+ keypairPath?: string;
5
+ /** If true, won't generate a new keypair if none exists */
6
+ requireExisting?: boolean;
7
+ /** Base url of the Renown instance to use */
8
+ baseUrl?: string;
9
+ }
10
+ /**
11
+ * Initialize Renown for the Switchboard instance.
12
+ * This allows Switchboard to authenticate with remote services
13
+ * using the same identity established during `ph login`.
14
+ */
15
+ export declare function initRenown(options?: RenownOptions): Promise<IRenown | null>;
16
+ //# sourceMappingURL=renown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renown.d.ts","sourceRoot":"","sources":["../../src/renown.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,OAAO,EACb,MAAM,kBAAkB,CAAC;AAI1B,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAC9B,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAqCzB"}
@@ -0,0 +1,33 @@
1
+ import { childLogger } from "document-drive";
2
+ import { DEFAULT_RENOWN_URL, NodeKeyStorage, RenownBuilder, RenownCryptoBuilder, } from "@renown/sdk/node";
3
+ const logger = childLogger(["switchboard", "renown"]);
4
+ /**
5
+ * Initialize Renown for the Switchboard instance.
6
+ * This allows Switchboard to authenticate with remote services
7
+ * using the same identity established during `ph login`.
8
+ */
9
+ export async function initRenown(options = {}) {
10
+ const { keypairPath, requireExisting = false, baseUrl = DEFAULT_RENOWN_URL, } = options;
11
+ const keyStorage = new NodeKeyStorage(keypairPath, {
12
+ logger,
13
+ });
14
+ // Check if we have an existing keypair
15
+ const existingKeyPair = await keyStorage.loadKeyPair();
16
+ if (!existingKeyPair && requireExisting) {
17
+ throw new Error("No existing keypair found and requireExisting is true. " +
18
+ 'Run "ph login" to create one.');
19
+ }
20
+ if (!existingKeyPair) {
21
+ logger.info("No existing keypair found. A new one will be generated.");
22
+ }
23
+ const renownCrypto = await new RenownCryptoBuilder()
24
+ .withKeyPairStorage(keyStorage)
25
+ .build();
26
+ const renown = await new RenownBuilder("switchboard", {})
27
+ .withCrypto(renownCrypto)
28
+ .withBaseUrl(baseUrl)
29
+ .build();
30
+ logger.info("Switchboard identity initialized: @did", renownCrypto.did);
31
+ return renown;
32
+ }
33
+ //# sourceMappingURL=renown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renown.js","sourceRoot":"","sources":["../../src/renown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,mBAAmB,GAEpB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;AAWtD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,UAAyB,EAAE;IAE3B,MAAM,EACJ,WAAW,EACX,eAAe,GAAG,KAAK,EACvB,OAAO,GAAG,kBAAkB,GAC7B,GAAG,OAAO,CAAC;IAEZ,MAAM,UAAU,GAAG,IAAI,cAAc,CAAC,WAAW,EAAE;QACjD,MAAM;KACP,CAAC,CAAC;IAEH,uCAAuC;IACvC,MAAM,eAAe,GAAG,MAAM,UAAU,CAAC,WAAW,EAAE,CAAC;IAEvD,IAAI,CAAC,eAAe,IAAI,eAAe,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CACb,yDAAyD;YACvD,+BAA+B,CAClC,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,IAAI,mBAAmB,EAAE;SACjD,kBAAkB,CAAC,UAAU,CAAC;SAC9B,KAAK,EAAE,CAAC;IAEX,MAAM,MAAM,GAAG,MAAM,IAAI,aAAa,CAAC,aAAa,EAAE,EAAE,CAAC;SACtD,UAAU,CAAC,YAAY,CAAC;SACxB,WAAW,CAAC,OAAO,CAAC;SACpB,KAAK,EAAE,CAAC;IAEX,MAAM,CAAC,IAAI,CAAC,wCAAwC,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IAExE,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  import type { StartServerOptions, SwitchboardReactor } from "./types.js";
3
3
  export declare const startSwitchboard: (options?: StartServerOptions) => Promise<SwitchboardReactor>;
4
- export { getBearerToken, getConnectCrypto, getConnectDid, } from "./connect-crypto.js";
5
4
  export * from "./types.js";
6
5
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":";AA2CA,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAiSzE,eAAO,MAAM,gBAAgB,GAC3B,UAAS,kBAAuB,KAC/B,OAAO,CAAC,kBAAkB,CAiE5B,CAAC;AAEF,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":";AA6CA,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAkTzE,eAAO,MAAM,gBAAgB,GAC3B,UAAS,kBAAuB,KAC/B,OAAO,CAAC,kBAAkB,CAiE5B,CAAC;AAEF,cAAc,YAAY,CAAC"}