@syllm/brickly-test-host 0.11.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.
- package/README.md +74 -0
- package/dist/host.cjs +40816 -0
- package/dist/index.cjs +40848 -0
- package/dist/sources.lst +233 -0
- package/index.d.ts +93 -0
- package/package.json +31 -0
package/dist/sources.lst
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\create.js
|
|
2
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\descriptors.js
|
|
3
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\from-binary.js
|
|
4
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\is-message.js
|
|
5
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\proto-int64.js
|
|
6
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\reflect\error.js
|
|
7
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\reflect\guard.js
|
|
8
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\reflect\message.js
|
|
9
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\reflect\scalar.js
|
|
10
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\reflect\unsafe.js
|
|
11
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\to-binary.js
|
|
12
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\wire\base64-encoding.js
|
|
13
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\wire\binary-encoding.js
|
|
14
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\wire\index.js
|
|
15
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\wire\size-delimited.js
|
|
16
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\wire\text-encoding.js
|
|
17
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\wire\text-format.js
|
|
18
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\wire\varint.js
|
|
19
|
+
..\..\node_modules\@bufbuild\protobuf\dist\commonjs\wkt\wrappers.js
|
|
20
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\create.js
|
|
21
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\descriptors.js
|
|
22
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\from-binary.js
|
|
23
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\is-message.js
|
|
24
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\proto-int64.js
|
|
25
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\reflect\error.js
|
|
26
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\reflect\guard.js
|
|
27
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\reflect\message.js
|
|
28
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\reflect\scalar.js
|
|
29
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\reflect\unsafe.js
|
|
30
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\to-binary.js
|
|
31
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\wire\base64-encoding.js
|
|
32
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\wire\binary-encoding.js
|
|
33
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\wire\index.js
|
|
34
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\wire\size-delimited.js
|
|
35
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\wire\text-encoding.js
|
|
36
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\wire\text-format.js
|
|
37
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\wire\varint.js
|
|
38
|
+
..\..\node_modules\@bufbuild\protobuf\dist\esm\wkt\wrappers.js
|
|
39
|
+
..\..\node_modules\@grpc\grpc-js\build\src\admin.js
|
|
40
|
+
..\..\node_modules\@grpc\grpc-js\build\src\backoff-timeout.js
|
|
41
|
+
..\..\node_modules\@grpc\grpc-js\build\src\call-credentials.js
|
|
42
|
+
..\..\node_modules\@grpc\grpc-js\build\src\call-interface.js
|
|
43
|
+
..\..\node_modules\@grpc\grpc-js\build\src\call-number.js
|
|
44
|
+
..\..\node_modules\@grpc\grpc-js\build\src\call.js
|
|
45
|
+
..\..\node_modules\@grpc\grpc-js\build\src\certificate-provider.js
|
|
46
|
+
..\..\node_modules\@grpc\grpc-js\build\src\channel-credentials.js
|
|
47
|
+
..\..\node_modules\@grpc\grpc-js\build\src\channel-options.js
|
|
48
|
+
..\..\node_modules\@grpc\grpc-js\build\src\channel.js
|
|
49
|
+
..\..\node_modules\@grpc\grpc-js\build\src\channelz.js
|
|
50
|
+
..\..\node_modules\@grpc\grpc-js\build\src\client-interceptors.js
|
|
51
|
+
..\..\node_modules\@grpc\grpc-js\build\src\client.js
|
|
52
|
+
..\..\node_modules\@grpc\grpc-js\build\src\compression-algorithms.js
|
|
53
|
+
..\..\node_modules\@grpc\grpc-js\build\src\compression-filter.js
|
|
54
|
+
..\..\node_modules\@grpc\grpc-js\build\src\connectivity-state.js
|
|
55
|
+
..\..\node_modules\@grpc\grpc-js\build\src\constants.js
|
|
56
|
+
..\..\node_modules\@grpc\grpc-js\build\src\control-plane-status.js
|
|
57
|
+
..\..\node_modules\@grpc\grpc-js\build\src\deadline.js
|
|
58
|
+
..\..\node_modules\@grpc\grpc-js\build\src\duration.js
|
|
59
|
+
..\..\node_modules\@grpc\grpc-js\build\src\environment.js
|
|
60
|
+
..\..\node_modules\@grpc\grpc-js\build\src\error.js
|
|
61
|
+
..\..\node_modules\@grpc\grpc-js\build\src\experimental.js
|
|
62
|
+
..\..\node_modules\@grpc\grpc-js\build\src\filter-stack.js
|
|
63
|
+
..\..\node_modules\@grpc\grpc-js\build\src\filter.js
|
|
64
|
+
..\..\node_modules\@grpc\grpc-js\build\src\http_proxy.js
|
|
65
|
+
..\..\node_modules\@grpc\grpc-js\build\src\index.js
|
|
66
|
+
..\..\node_modules\@grpc\grpc-js\build\src\internal-channel.js
|
|
67
|
+
..\..\node_modules\@grpc\grpc-js\build\src\load-balancer-child-handler.js
|
|
68
|
+
..\..\node_modules\@grpc\grpc-js\build\src\load-balancer-outlier-detection.js
|
|
69
|
+
..\..\node_modules\@grpc\grpc-js\build\src\load-balancer-pick-first.js
|
|
70
|
+
..\..\node_modules\@grpc\grpc-js\build\src\load-balancer-round-robin.js
|
|
71
|
+
..\..\node_modules\@grpc\grpc-js\build\src\load-balancer-weighted-round-robin.js
|
|
72
|
+
..\..\node_modules\@grpc\grpc-js\build\src\load-balancer.js
|
|
73
|
+
..\..\node_modules\@grpc\grpc-js\build\src\load-balancing-call.js
|
|
74
|
+
..\..\node_modules\@grpc\grpc-js\build\src\logging.js
|
|
75
|
+
..\..\node_modules\@grpc\grpc-js\build\src\make-client.js
|
|
76
|
+
..\..\node_modules\@grpc\grpc-js\build\src\metadata.js
|
|
77
|
+
..\..\node_modules\@grpc\grpc-js\build\src\orca.js
|
|
78
|
+
..\..\node_modules\@grpc\grpc-js\build\src\picker.js
|
|
79
|
+
..\..\node_modules\@grpc\grpc-js\build\src\priority-queue.js
|
|
80
|
+
..\..\node_modules\@grpc\grpc-js\build\src\resolver-dns.js
|
|
81
|
+
..\..\node_modules\@grpc\grpc-js\build\src\resolver-ip.js
|
|
82
|
+
..\..\node_modules\@grpc\grpc-js\build\src\resolver-uds.js
|
|
83
|
+
..\..\node_modules\@grpc\grpc-js\build\src\resolver.js
|
|
84
|
+
..\..\node_modules\@grpc\grpc-js\build\src\resolving-call.js
|
|
85
|
+
..\..\node_modules\@grpc\grpc-js\build\src\resolving-load-balancer.js
|
|
86
|
+
..\..\node_modules\@grpc\grpc-js\build\src\retrying-call.js
|
|
87
|
+
..\..\node_modules\@grpc\grpc-js\build\src\server-call.js
|
|
88
|
+
..\..\node_modules\@grpc\grpc-js\build\src\server-credentials.js
|
|
89
|
+
..\..\node_modules\@grpc\grpc-js\build\src\server-interceptors.js
|
|
90
|
+
..\..\node_modules\@grpc\grpc-js\build\src\server.js
|
|
91
|
+
..\..\node_modules\@grpc\grpc-js\build\src\service-config.js
|
|
92
|
+
..\..\node_modules\@grpc\grpc-js\build\src\single-subchannel-channel.js
|
|
93
|
+
..\..\node_modules\@grpc\grpc-js\build\src\status-builder.js
|
|
94
|
+
..\..\node_modules\@grpc\grpc-js\build\src\stream-decoder.js
|
|
95
|
+
..\..\node_modules\@grpc\grpc-js\build\src\subchannel-address.js
|
|
96
|
+
..\..\node_modules\@grpc\grpc-js\build\src\subchannel-call.js
|
|
97
|
+
..\..\node_modules\@grpc\grpc-js\build\src\subchannel-interface.js
|
|
98
|
+
..\..\node_modules\@grpc\grpc-js\build\src\subchannel-pool.js
|
|
99
|
+
..\..\node_modules\@grpc\grpc-js\build\src\subchannel.js
|
|
100
|
+
..\..\node_modules\@grpc\grpc-js\build\src\tls-helpers.js
|
|
101
|
+
..\..\node_modules\@grpc\grpc-js\build\src\transport.js
|
|
102
|
+
..\..\node_modules\@grpc\grpc-js\build\src\uri-parser.js
|
|
103
|
+
..\..\node_modules\@grpc\grpc-js\package.json
|
|
104
|
+
..\..\node_modules\@grpc\proto-loader\build\src\index.js
|
|
105
|
+
..\..\node_modules\@grpc\proto-loader\build\src\util.js
|
|
106
|
+
..\..\node_modules\@js-sdsl\ordered-map\dist\cjs\index.js
|
|
107
|
+
..\..\node_modules\@protobufjs\aspromise\index.js
|
|
108
|
+
..\..\node_modules\@protobufjs\base64\index.js
|
|
109
|
+
..\..\node_modules\@protobufjs\codegen\index.js
|
|
110
|
+
..\..\node_modules\@protobufjs\eventemitter\index.js
|
|
111
|
+
..\..\node_modules\@protobufjs\fetch\index.js
|
|
112
|
+
..\..\node_modules\@protobufjs\fetch\util\fs.js
|
|
113
|
+
..\..\node_modules\@protobufjs\float\index.js
|
|
114
|
+
..\..\node_modules\@protobufjs\path\index.js
|
|
115
|
+
..\..\node_modules\@protobufjs\pool\index.js
|
|
116
|
+
..\..\node_modules\@protobufjs\utf8\index.js
|
|
117
|
+
..\..\node_modules\electron\index.js
|
|
118
|
+
..\..\node_modules\lodash.camelcase\index.js
|
|
119
|
+
..\..\node_modules\long\umd\index.js
|
|
120
|
+
..\..\node_modules\protobufjs\ext\descriptor\index.js
|
|
121
|
+
..\..\node_modules\protobufjs\google\protobuf\api.json
|
|
122
|
+
..\..\node_modules\protobufjs\google\protobuf\descriptor.json
|
|
123
|
+
..\..\node_modules\protobufjs\google\protobuf\source_context.json
|
|
124
|
+
..\..\node_modules\protobufjs\google\protobuf\type.json
|
|
125
|
+
..\..\node_modules\protobufjs\index.js
|
|
126
|
+
..\..\node_modules\protobufjs\src\common.js
|
|
127
|
+
..\..\node_modules\protobufjs\src\converter.js
|
|
128
|
+
..\..\node_modules\protobufjs\src\decoder.js
|
|
129
|
+
..\..\node_modules\protobufjs\src\encoder.js
|
|
130
|
+
..\..\node_modules\protobufjs\src\enum.js
|
|
131
|
+
..\..\node_modules\protobufjs\src\field.js
|
|
132
|
+
..\..\node_modules\protobufjs\src\index-light.js
|
|
133
|
+
..\..\node_modules\protobufjs\src\index-minimal.js
|
|
134
|
+
..\..\node_modules\protobufjs\src\index.js
|
|
135
|
+
..\..\node_modules\protobufjs\src\mapfield.js
|
|
136
|
+
..\..\node_modules\protobufjs\src\message.js
|
|
137
|
+
..\..\node_modules\protobufjs\src\method.js
|
|
138
|
+
..\..\node_modules\protobufjs\src\namespace.js
|
|
139
|
+
..\..\node_modules\protobufjs\src\object.js
|
|
140
|
+
..\..\node_modules\protobufjs\src\oneof.js
|
|
141
|
+
..\..\node_modules\protobufjs\src\parse.js
|
|
142
|
+
..\..\node_modules\protobufjs\src\reader.js
|
|
143
|
+
..\..\node_modules\protobufjs\src\reader_buffer.js
|
|
144
|
+
..\..\node_modules\protobufjs\src\root.js
|
|
145
|
+
..\..\node_modules\protobufjs\src\roots.js
|
|
146
|
+
..\..\node_modules\protobufjs\src\rpc.js
|
|
147
|
+
..\..\node_modules\protobufjs\src\rpc\service.js
|
|
148
|
+
..\..\node_modules\protobufjs\src\service.js
|
|
149
|
+
..\..\node_modules\protobufjs\src\tokenize.js
|
|
150
|
+
..\..\node_modules\protobufjs\src\type.js
|
|
151
|
+
..\..\node_modules\protobufjs\src\types.js
|
|
152
|
+
..\..\node_modules\protobufjs\src\util.js
|
|
153
|
+
..\..\node_modules\protobufjs\src\util\fs.js
|
|
154
|
+
..\..\node_modules\protobufjs\src\util\longbits.js
|
|
155
|
+
..\..\node_modules\protobufjs\src\util\minimal.js
|
|
156
|
+
..\..\node_modules\protobufjs\src\util\patterns.js
|
|
157
|
+
..\..\node_modules\protobufjs\src\verifier.js
|
|
158
|
+
..\..\node_modules\protobufjs\src\wrappers.js
|
|
159
|
+
..\..\node_modules\protobufjs\src\writer.js
|
|
160
|
+
..\..\node_modules\protobufjs\src\writer_buffer.js
|
|
161
|
+
..\..\src\main\brick-storage\application\brick-storage-service.ts
|
|
162
|
+
..\..\src\main\brick-storage\application\watch-hub.ts
|
|
163
|
+
..\..\src\main\brick-storage\domain\errors.ts
|
|
164
|
+
..\..\src\main\brick-storage\domain\keys.ts
|
|
165
|
+
..\..\src\main\brick-storage\domain\quota.ts
|
|
166
|
+
..\..\src\main\brick-storage\domain\types.ts
|
|
167
|
+
..\..\src\main\brick-storage\domain\value.ts
|
|
168
|
+
..\..\src\main\brick-storage\infrastructure\memory-brick-store.ts
|
|
169
|
+
..\..\src\main\brick-storage\infrastructure\secret-codec.ts
|
|
170
|
+
..\..\src\main\brick-storage\infrastructure\store-registry.ts
|
|
171
|
+
..\..\src\main\brick-storage\memory-service.ts
|
|
172
|
+
..\..\src\main\bridge\ipc-runtime.ts
|
|
173
|
+
..\..\src\main\invocation\app\connector-application-service.ts
|
|
174
|
+
..\..\src\main\invocation\call-ownership-sink.ts
|
|
175
|
+
..\..\src\main\invocation\domain\types.ts
|
|
176
|
+
..\..\src\main\invocation\invocation-resource-delivery.ts
|
|
177
|
+
..\..\src\main\invocation\lifetime\types.ts
|
|
178
|
+
..\..\src\main\invocation\policies\dependency-policy.ts
|
|
179
|
+
..\..\src\main\invocation\policies\recursion-policy.ts
|
|
180
|
+
..\..\src\main\platform\host-cache-layout.ts
|
|
181
|
+
..\..\src\main\protocol\errors.ts
|
|
182
|
+
..\..\src\main\protocol\resource-contract.ts
|
|
183
|
+
..\..\src\main\resources\application\helper-resource-access.ts
|
|
184
|
+
..\..\src\main\resources\application\resource-facade.ts
|
|
185
|
+
..\..\src\main\resources\application\resource-invocation-binder.ts
|
|
186
|
+
..\..\src\main\resources\domain\resource-quota-manager.ts
|
|
187
|
+
..\..\src\main\resources\domain\resource-registry.ts
|
|
188
|
+
..\..\src\main\resources\infrastructure\filesystem-blob-store.ts
|
|
189
|
+
..\..\src\main\resources\infrastructure\resource-store.ts
|
|
190
|
+
..\..\src\main\resources\resource-refs.ts
|
|
191
|
+
..\..\src\main\runtime\boundary-call-policy.ts
|
|
192
|
+
..\..\src\main\runtime\boundary-call-recorder.ts
|
|
193
|
+
..\..\src\main\runtime\boundary-call-title.ts
|
|
194
|
+
..\..\src\main\runtime\transport\brick-value.ts
|
|
195
|
+
..\..\src\main\runtime\transport\connector-interact-relay.ts
|
|
196
|
+
..\..\src\main\runtime\transport\grpc-brick-storage-service.ts
|
|
197
|
+
..\..\src\main\runtime\transport\grpc-connector-service.ts
|
|
198
|
+
..\..\src\main\runtime\transport\grpc-host-services.ts
|
|
199
|
+
..\..\src\main\runtime\transport\grpc-platform-service.ts
|
|
200
|
+
..\..\src\main\runtime\transport\grpc-resource-service.ts
|
|
201
|
+
..\..\src\main\runtime\transport\grpc-runtime-hub.ts
|
|
202
|
+
..\..\src\main\runtime\transport\health.ts
|
|
203
|
+
..\..\src\main\runtime\transport\helper-principal-guard.ts
|
|
204
|
+
..\..\src\main\runtime\transport\host-grpc-server.ts
|
|
205
|
+
..\..\src\main\runtime\transport\interact-session.ts
|
|
206
|
+
..\..\src\main\runtime\transport\metadata.ts
|
|
207
|
+
..\..\src\main\runtime\transport\runtime-channel.ts
|
|
208
|
+
..\..\src\main\runtime\transport\spawn-registry.ts
|
|
209
|
+
..\..\src\main\runtime\transport\test-host\control.ts
|
|
210
|
+
..\..\src\main\runtime\transport\test-host\main.ts
|
|
211
|
+
..\..\src\main\runtime\transport\test-host\start.ts
|
|
212
|
+
..\..\src\main\runtime\transport\tokens.ts
|
|
213
|
+
..\..\src\main\window\window-binding.ts
|
|
214
|
+
..\..\src\shared\brick-ref.ts
|
|
215
|
+
..\..\src\shared\contracts\identity.ts
|
|
216
|
+
..\..\src\shared\inline-message.ts
|
|
217
|
+
..\..\src\shared\ipc\channels.ts
|
|
218
|
+
..\brickly-sdk-node\src\internal\grpc\brick-error-status.ts
|
|
219
|
+
..\runtime-protocol\dist\brick_storage.js
|
|
220
|
+
..\runtime-protocol\dist\command.js
|
|
221
|
+
..\runtime-protocol\dist\common.js
|
|
222
|
+
..\runtime-protocol\dist\connector.js
|
|
223
|
+
..\runtime-protocol\dist\error.js
|
|
224
|
+
..\runtime-protocol\dist\event.js
|
|
225
|
+
..\runtime-protocol\dist\google\protobuf\any.js
|
|
226
|
+
..\runtime-protocol\dist\google\protobuf\empty.js
|
|
227
|
+
..\runtime-protocol\dist\google\protobuf\timestamp.js
|
|
228
|
+
..\runtime-protocol\dist\platform.js
|
|
229
|
+
..\runtime-protocol\dist\registry.js
|
|
230
|
+
..\runtime-protocol\dist\resource.js
|
|
231
|
+
..\runtime-protocol\dist\storage.js
|
|
232
|
+
..\runtime-protocol\dist\system.js
|
|
233
|
+
..\runtime-protocol\dist\window.js
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @syllm/brickly-test-host 对外类型面(手写维护,与 dist/index.cjs 对齐)。
|
|
3
|
+
* 内部实现类型不外露;host 字段为不透明引用。
|
|
4
|
+
*/
|
|
5
|
+
import type { ChildProcess } from 'node:child_process'
|
|
6
|
+
|
|
7
|
+
export interface SpawnCredentials {
|
|
8
|
+
spawnId: string
|
|
9
|
+
bootstrapToken: string
|
|
10
|
+
runtimeToHostToken: string
|
|
11
|
+
hostToRuntimeToken: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface SetFaultInput {
|
|
15
|
+
/** 完整 gRPC 方法路径,如 /brickly.runtime.v1.BrickStorageService/KvGet */
|
|
16
|
+
path: string
|
|
17
|
+
/** Brick 错误码,如 BRICK_STORAGE_NOT_FOUND */
|
|
18
|
+
brickCode: string
|
|
19
|
+
message?: string
|
|
20
|
+
/** 命中次数,默认 1 */
|
|
21
|
+
count?: number
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type SetFaultRequest = SetFaultInput
|
|
25
|
+
|
|
26
|
+
export interface FaultRule {
|
|
27
|
+
path: string
|
|
28
|
+
brickCode: string
|
|
29
|
+
message: string
|
|
30
|
+
remaining: number
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface RecordedCall {
|
|
34
|
+
path: string
|
|
35
|
+
at: number
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export declare class HostTestControl {
|
|
39
|
+
readonly interceptor: unknown
|
|
40
|
+
setFault(input: SetFaultInput): void
|
|
41
|
+
clearFaults(): void
|
|
42
|
+
recordedCalls(): RecordedCall[]
|
|
43
|
+
/** 清空故障规则与录制(不清 storage 数据) */
|
|
44
|
+
reset(): void
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface StartTestHostOptions {
|
|
48
|
+
brickId?: string
|
|
49
|
+
/** 自定义 storage 实现;默认内存版 */
|
|
50
|
+
storage?: unknown
|
|
51
|
+
/** 内存 storage 生效配额(MB),默认 50 */
|
|
52
|
+
quotaMB?: number
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface TestHost {
|
|
56
|
+
/** 真宿主 gRPC 服务实例(内部类型;跨进程消费者用 spawnTestHost) */
|
|
57
|
+
readonly host: unknown
|
|
58
|
+
readonly control: HostTestControl
|
|
59
|
+
readonly endpoint: string
|
|
60
|
+
readonly spawnCredentials: SpawnCredentials
|
|
61
|
+
close(): Promise<void>
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** 进程内装配真宿主 + 控制面(Node 测试用)。 */
|
|
65
|
+
export declare function startTestHost(options?: StartTestHostOptions): Promise<TestHost>
|
|
66
|
+
|
|
67
|
+
/** 宿主进程 stdout 首行就绪 JSON(spawn 协议契约)。 */
|
|
68
|
+
export interface SpawnedHostInfo {
|
|
69
|
+
/** gRPC 数据面地址,如 127.0.0.1:50051 */
|
|
70
|
+
dataEndpoint: string
|
|
71
|
+
/** 控制面 HTTP 地址,如 127.0.0.1:50052 */
|
|
72
|
+
controlEndpoint: string
|
|
73
|
+
runtimeToHostToken: string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface SpawnTestHostOptions {
|
|
77
|
+
/** 宿主 bundle 路径,默认包内 dist/host.cjs */
|
|
78
|
+
hostBundlePath?: string
|
|
79
|
+
nodeExecutable?: string
|
|
80
|
+
readyTimeoutMs?: number
|
|
81
|
+
exitTimeoutMs?: number
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface SpawnedTestHost extends SpawnedHostInfo {
|
|
85
|
+
readonly process: ChildProcess
|
|
86
|
+
setFault(input: SetFaultRequest): Promise<void>
|
|
87
|
+
reset(): Promise<void>
|
|
88
|
+
recordedCalls(): Promise<RecordedCall[]>
|
|
89
|
+
close(): Promise<void>
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** 拉起 dist/host.cjs 子进程并提供控制面客户端。 */
|
|
93
|
+
export declare function spawnTestHost(options?: SpawnTestHostOptions): Promise<SpawnedTestHost>
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@syllm/brickly-test-host",
|
|
3
|
+
"version": "0.11.0",
|
|
4
|
+
"description": "Brickly 真宿主测试工件:HostGrpcServer + 控制面(故障注入/请求录制),供各端 SDK 契约测试使用",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"main": "dist/index.cjs",
|
|
8
|
+
"types": "index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"brickly-test-host": "dist/host.cjs"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"index.d.ts",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18.0.0"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "node build.mjs",
|
|
22
|
+
"prepack": "npm run build",
|
|
23
|
+
"check": "node check/check.mjs"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"esbuild": "^0.25.12"
|
|
30
|
+
}
|
|
31
|
+
}
|