@pymthouse/builder-sdk 0.3.1 → 0.4.1-rc.2

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.
Files changed (103) hide show
  1. package/README.md +54 -28
  2. package/dist/{client-BHfjDvIe.d.ts → client-CauCfGa7.d.ts} +1 -1
  3. package/dist/{client-CvhJEhjV.d.cts → client-D1Xz-xlx.d.cts} +1 -1
  4. package/dist/config.cjs +0 -21
  5. package/dist/config.cjs.map +1 -1
  6. package/dist/config.d.cts +1 -5
  7. package/dist/config.d.ts +1 -5
  8. package/dist/config.js +1 -20
  9. package/dist/config.js.map +1 -1
  10. package/dist/device-initiate.cjs.map +1 -1
  11. package/dist/device-initiate.js.map +1 -1
  12. package/dist/device.cjs.map +1 -1
  13. package/dist/device.d.cts +1 -1
  14. package/dist/device.d.ts +1 -1
  15. package/dist/device.js.map +1 -1
  16. package/dist/env.cjs +13 -4
  17. package/dist/env.cjs.map +1 -1
  18. package/dist/env.d.cts +2 -2
  19. package/dist/env.d.ts +2 -2
  20. package/dist/env.js +13 -4
  21. package/dist/env.js.map +1 -1
  22. package/dist/index-B0ryx942.d.cts +66 -0
  23. package/dist/index-CvV5syf_.d.ts +66 -0
  24. package/dist/index.cjs +13 -4
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +29 -5
  27. package/dist/index.d.ts +29 -5
  28. package/dist/index.js +13 -4
  29. package/dist/index.js.map +1 -1
  30. package/dist/{ingest-DoKJTWU9.d.ts → proxy-JrT6raU_.d.cts} +5 -42
  31. package/dist/{ingest-B3Yi8Tb1.d.cts → proxy-U32DFNuj.d.ts} +5 -42
  32. package/dist/signer/server.cjs +799 -895
  33. package/dist/signer/server.cjs.map +1 -1
  34. package/dist/signer/server.d.cts +11 -15
  35. package/dist/signer/server.d.ts +11 -15
  36. package/dist/signer/server.js +799 -893
  37. package/dist/signer/server.js.map +1 -1
  38. package/dist/signer/webhook/adapters/api-key.cjs +82 -0
  39. package/dist/signer/webhook/adapters/api-key.cjs.map +1 -0
  40. package/dist/signer/webhook/adapters/api-key.d.cts +18 -0
  41. package/dist/signer/webhook/adapters/api-key.d.ts +18 -0
  42. package/dist/signer/webhook/adapters/api-key.js +80 -0
  43. package/dist/signer/webhook/adapters/api-key.js.map +1 -0
  44. package/dist/signer/webhook/adapters/composite.cjs +60 -0
  45. package/dist/signer/webhook/adapters/composite.cjs.map +1 -0
  46. package/dist/signer/webhook/adapters/composite.d.cts +5 -0
  47. package/dist/signer/webhook/adapters/composite.d.ts +5 -0
  48. package/dist/signer/webhook/adapters/composite.js +58 -0
  49. package/dist/signer/webhook/adapters/composite.js.map +1 -0
  50. package/dist/signer/webhook/adapters/oauth1.cjs +18 -0
  51. package/dist/signer/webhook/adapters/oauth1.cjs.map +1 -0
  52. package/dist/signer/webhook/adapters/oauth1.d.cts +19 -0
  53. package/dist/signer/webhook/adapters/oauth1.d.ts +19 -0
  54. package/dist/signer/webhook/adapters/oauth1.js +16 -0
  55. package/dist/signer/webhook/adapters/oauth1.js.map +1 -0
  56. package/dist/signer/webhook/adapters/oidc.cjs +533 -0
  57. package/dist/signer/webhook/adapters/oidc.cjs.map +1 -0
  58. package/dist/signer/webhook/adapters/oidc.d.cts +4 -0
  59. package/dist/signer/webhook/adapters/oidc.d.ts +4 -0
  60. package/dist/signer/webhook/adapters/oidc.js +526 -0
  61. package/dist/signer/webhook/adapters/oidc.js.map +1 -0
  62. package/dist/signer/webhook/adapters/trusted-headers.cjs +110 -0
  63. package/dist/signer/webhook/adapters/trusted-headers.cjs.map +1 -0
  64. package/dist/signer/webhook/adapters/trusted-headers.d.cts +18 -0
  65. package/dist/signer/webhook/adapters/trusted-headers.d.ts +18 -0
  66. package/dist/signer/webhook/adapters/trusted-headers.js +106 -0
  67. package/dist/signer/webhook/adapters/trusted-headers.js.map +1 -0
  68. package/dist/signer/webhook.cjs +759 -0
  69. package/dist/signer/webhook.cjs.map +1 -0
  70. package/dist/signer/webhook.d.cts +26 -0
  71. package/dist/signer/webhook.d.ts +26 -0
  72. package/dist/signer/webhook.js +732 -0
  73. package/dist/signer/webhook.js.map +1 -0
  74. package/dist/tokens.d.cts +1 -1
  75. package/dist/tokens.d.ts +1 -1
  76. package/dist/{types-_R1AwEZp.d.cts → types-BORaHW_x.d.cts} +5 -5
  77. package/dist/{types-_R1AwEZp.d.ts → types-BORaHW_x.d.ts} +5 -5
  78. package/dist/verifier-B-WFDMz6.d.cts +48 -0
  79. package/dist/verifier-B-WFDMz6.d.ts +48 -0
  80. package/dist/verify.cjs.map +1 -1
  81. package/dist/verify.d.cts +1 -1
  82. package/dist/verify.d.ts +1 -1
  83. package/dist/verify.js.map +1 -1
  84. package/package.json +30 -30
  85. package/dist/gateway/client/index.cjs +0 -492
  86. package/dist/gateway/client/index.cjs.map +0 -1
  87. package/dist/gateway/client/index.d.cts +0 -63
  88. package/dist/gateway/client/index.d.ts +0 -63
  89. package/dist/gateway/client/index.js +0 -489
  90. package/dist/gateway/client/index.js.map +0 -1
  91. package/dist/gateway/index.cjs +0 -16
  92. package/dist/gateway/index.cjs.map +0 -1
  93. package/dist/gateway/index.d.cts +0 -52
  94. package/dist/gateway/index.d.ts +0 -52
  95. package/dist/gateway/index.js +0 -10
  96. package/dist/gateway/index.js.map +0 -1
  97. package/dist/gateway/server/index.cjs +0 -1248
  98. package/dist/gateway/server/index.cjs.map +0 -1
  99. package/dist/gateway/server/index.d.cts +0 -31
  100. package/dist/gateway/server/index.d.ts +0 -31
  101. package/dist/gateway/server/index.js +0 -1233
  102. package/dist/gateway/server/index.js.map +0 -1
  103. package/gateway/proto/lp_rpc.proto +0 -542
@@ -1,542 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package net;
4
- option go_package = "./net";
5
-
6
- // RPC calls implemented by the orchestrator
7
- service Orchestrator {
8
-
9
- // Called by the broadcaster to request transcoder info from an orchestrator.
10
- rpc GetOrchestrator(OrchestratorRequest) returns (OrchestratorInfo);
11
- rpc EndTranscodingSession(EndTranscodingSessionRequest)
12
- returns (EndTranscodingSessionResponse);
13
- rpc Ping(PingPong) returns (PingPong);
14
- }
15
-
16
- service AIWorker {
17
-
18
- // Called by the aiworker to register to an orchestrator. The orchestrator
19
- // notifies registered aiworkers of jobs as they come in.
20
- rpc RegisterAIWorker(RegisterAIWorkerRequest) returns (stream NotifyAIJob);
21
- }
22
-
23
- service Transcoder {
24
-
25
- // Called by the transcoder to register to an orchestrator. The orchestrator
26
- // notifies registered transcoders of segments as they come in.
27
- rpc RegisterTranscoder(RegisterRequest) returns (stream NotifySegment);
28
- }
29
-
30
- message PingPong {
31
- // Implementation defined
32
- bytes value = 1;
33
- }
34
-
35
- // sent by Broadcaster to Orchestrator to terminate the transcoding session and
36
- // free resources (used for verification sessions)
37
- message EndTranscodingSessionRequest {
38
- // Data for transcoding authentication
39
- AuthToken auth_token = 1;
40
- }
41
-
42
- message EndTranscodingSessionResponse {}
43
-
44
- // This request is sent by the broadcaster in `GetTranscoder` to request
45
- // information on which transcoder to use.
46
- message OrchestratorRequest {
47
-
48
- // Ethereum address of the broadcaster
49
- bytes address = 1;
50
-
51
- // Broadcaster's signature over its address
52
- bytes sig = 2;
53
-
54
- // Features and constraints required by the broadcaster
55
- Capabilities capabilities = 3;
56
-
57
- // Don't throw error in case of missing capacity, used for refreshing session
58
- // when we don't need to check capacity
59
- bool ignoreCapacityCheck = 4;
60
- }
61
-
62
- /*
63
- OSInfo needed to negotiate storages that will be used.
64
- It carries info needed to write to the storage.
65
- */
66
- message OSInfo {
67
-
68
- enum StorageType {
69
- DIRECT = 0;
70
- S3 = 1;
71
- GOOGLE = 2;
72
- }
73
-
74
- // Storage type: direct, s3, ipfs.
75
- StorageType storageType = 1;
76
-
77
- S3OSInfo s3info = 16;
78
- }
79
-
80
- message S3OSInfo {
81
-
82
- // Host to use to connect to S3
83
- string host = 1;
84
-
85
- // Key (prefix) to use when uploading the object.
86
- string key = 2;
87
-
88
- // POST policy that S3 owner node creates to give write access to other node.
89
- string policy = 3;
90
-
91
- // Signature for POST policy.
92
- string signature = 4;
93
-
94
- // Needed for POST policy.
95
- string credential = 5;
96
-
97
- // Needed for POST policy.
98
- string xAmzDate = 6;
99
- }
100
-
101
- // PriceInfo conveys pricing info for transcoding services
102
- message PriceInfo {
103
- // price in wei
104
- int64 pricePerUnit = 1;
105
-
106
- // Pixels covered in the price
107
- // Set price to 1 wei and pixelsPerUnit > 1 to have a smaller price
108
- // granularity per pixel than 1 wei
109
- int64 pixelsPerUnit = 2;
110
-
111
- // Capability price is for
112
- uint32 capability = 3;
113
-
114
- // constraint price is for
115
- string constraint = 4;
116
- }
117
-
118
- message Capabilities {
119
-
120
- // Bit string of supported features - one bit per feature
121
- repeated uint64 bitstring = 1;
122
-
123
- // Bit string of features that are required to be supported
124
- repeated uint64 mandatories = 2;
125
-
126
- // Capacity corresponding to each capability
127
- map<uint32, uint32> capacities = 3;
128
-
129
- string version = 4;
130
-
131
- Constraints constraints = 5;
132
-
133
- // Non-binary constraints.
134
- message Constraints {
135
- string minVersion = 1;
136
- map<uint32, CapabilityConstraints> PerCapability = 2;
137
- }
138
-
139
- // Non-binary capability constraints, such as supported ranges.
140
- message CapabilityConstraints {
141
- message ModelConstraint {
142
- bool warm = 1;
143
- uint32 capacity = 2;
144
- string runnerVersion = 3;
145
- uint32 capacityInUse = 4;
146
- }
147
-
148
- map<string, ModelConstraint> models = 1;
149
- }
150
- }
151
-
152
- // The orchestrator sends this in response to `GetOrchestrator`, containing
153
- // miscellaneous data related to the job.
154
- message OrchestratorInfo {
155
-
156
- // URI of the transcoder to use for submitting segments.
157
- string transcoder = 1;
158
-
159
- // Parameters for probabilistic micropayment tickets
160
- TicketParams ticket_params = 2;
161
-
162
- // Price Info containing the price per pixel to transcode
163
- PriceInfo price_info = 3;
164
-
165
- // ETH address that should sign transcoded results
166
- bytes address = 4;
167
-
168
- // Features and constraints supported by the orchestrator
169
- Capabilities capabilities = 5;
170
-
171
- // Data for transcoding authentication
172
- AuthToken auth_token = 6;
173
-
174
- // Information on Orchestrator hardware
175
- repeated HardwareInformation hardware = 7;
176
-
177
- // Orchestrator returns info about own input object storage, if it wants it to
178
- // be used.
179
- repeated OSInfo storage = 32;
180
-
181
- // prices for capabilities
182
- repeated PriceInfo capabilities_prices = 33;
183
-
184
- // List of other node URIs belonging to this orchestrator.
185
- repeated string nodes = 34;
186
- }
187
-
188
- // Data for transcoding authentication that is included in the OrchestratorInfo
189
- // message during discovery
190
- message AuthToken {
191
- // Record used to authenticate for a transcode session
192
- // Opaque to the receiver
193
- bytes token = 1;
194
-
195
- // ID of the transcode session that the token is authenticating for
196
- string session_id = 2;
197
-
198
- // Timestamp when the token expires
199
- int64 expiration = 3;
200
- }
201
-
202
- // Data included by the broadcaster when submitting a segment for transcoding.
203
- message SegData {
204
-
205
- // Manifest ID this segment belongs to
206
- bytes manifestId = 1;
207
-
208
- // Sequence number of the segment to be transcoded
209
- int64 seq = 2;
210
-
211
- // Hash of the segment data to be transcoded
212
- bytes hash = 3;
213
-
214
- // Transcoding profiles to use
215
- bytes profiles = 4;
216
-
217
- // Broadcaster signature for the segment. Corresponds to:
218
- // broadcaster.sign(manifestId | seqNo | dataHash | profiles)
219
- bytes sig = 5;
220
-
221
- // Duration of the segment to be transcoded, in milliseconds
222
- int32 duration = 6;
223
-
224
- // Capabilities used by this segment.
225
- Capabilities capabilities = 7;
226
-
227
- // Data for transcoding authentication
228
- AuthToken auth_token = 8;
229
-
230
- // Calculate perceptual hash for this segment
231
- bool calc_perceptual_hash = 10;
232
-
233
- // Broadcaster's preferred storage medium(s)
234
- // XXX should we include this in a sig somewhere until certs are
235
- // authenticated?
236
- repeated OSInfo storage = 32;
237
-
238
- // Transcoding profiles to use. Supersedes `profiles` field
239
- // Deprecated by `fullProfiles2` but may still be used for mpegts formats
240
- repeated VideoProfile fullProfiles = 33;
241
-
242
- // Transcoding profiles to use. Supersedes `fullProfiles` field
243
- // Deprecated by `fullProfiles3` but may still be used for integer FPS
244
- repeated VideoProfile fullProfiles2 = 34;
245
-
246
- // Transcoding profiles to use. Supersedes `fullProfiles2` field
247
- repeated VideoProfile fullProfiles3 = 35;
248
-
249
- // Transcoding parameters specific to this segment
250
- SegParameters segment_parameters = 37;
251
-
252
- // Force HW Session Reinit
253
- bool ForceSessionReinit = 38;
254
- }
255
-
256
- message SegParameters {
257
- // Start timestamp from which to start encoding
258
- // Milliseconds, from start of the file
259
- uint64 from = 1;
260
- // Skip all frames after that timestamp
261
- // Milliseconds, from start of the file
262
- uint64 to = 2;
263
- }
264
-
265
- message VideoProfile {
266
- // Name of VideoProfile
267
- string name = 16;
268
-
269
- // Width of VideoProfile
270
- int32 width = 17;
271
-
272
- // Height of VideoProfile
273
- int32 height = 18;
274
-
275
- // Bitrate of VideoProfile
276
- int32 bitrate = 19;
277
-
278
- // FPS of VideoProfile
279
- uint32 fps = 20;
280
-
281
- // Desired output format
282
- enum Format {
283
- MPEGTS = 0;
284
- MP4 = 1;
285
- }
286
- Format format = 21;
287
-
288
- // FPS Denominator of VideoProfile
289
- uint32 fpsDen = 22;
290
-
291
- enum Profile {
292
- ENCODER_DEFAULT = 0;
293
- H264_BASELINE = 1;
294
- H264_MAIN = 2;
295
- H264_HIGH = 3;
296
- H264_CONSTRAINED_HIGH = 4;
297
- }
298
- // Desired codec profile
299
- Profile profile = 23;
300
-
301
- // GOP interval
302
- int32 gop = 24;
303
-
304
- enum VideoCodec {
305
- H264 = 0;
306
- H265 = 1;
307
- VP8 = 2;
308
- VP9 = 3;
309
- }
310
-
311
- // Encoder (video codec)
312
- VideoCodec encoder = 25;
313
-
314
- int32 colorDepth = 26;
315
-
316
- enum ChromaSubsampling {
317
- CHROMA_420 = 0;
318
- CHROMA_422 = 1;
319
- CHROMA_444 = 2;
320
- }
321
- ChromaSubsampling chromaFormat = 27;
322
- uint32 quality = 28;
323
- }
324
-
325
- // Individual transcoded segment data.
326
- message TranscodedSegmentData {
327
-
328
- // URL where the transcoded data can be downloaded from.
329
- string url = 1;
330
-
331
- // Amount of pixels processed (output pixels)
332
- int64 pixels = 2;
333
-
334
- // URL where the perceptual hash data can be downloaded from (can be empty)
335
- string perceptual_hash_url = 3;
336
- }
337
-
338
- // A set of transcoded segments following the profiles specified in the job.
339
- message TranscodeData {
340
-
341
- // Transcoded data, in the order specified in the job options
342
- repeated TranscodedSegmentData segments = 1;
343
-
344
- // Signature of the hash of the concatenated hashes
345
- bytes sig = 2;
346
- }
347
-
348
- // Response that a transcoder sends after transcoding a segment.
349
- message TranscodeResult {
350
-
351
- // Sequence number of the transcoded results.
352
- int64 seq = 1;
353
-
354
- // Result of transcoding can be an error, or successful with more info
355
- oneof result {
356
- string error = 2;
357
- TranscodeData data = 3;
358
- }
359
-
360
- // Used to notify a broadcaster of updated orchestrator information
361
- OrchestratorInfo info = 16;
362
- }
363
-
364
- // Response that an orchestrator sends after processing a payment.
365
- message PaymentResult {
366
- // Used to notify a broadcaster of updated orchestrator information
367
- OrchestratorInfo info = 16;
368
- }
369
-
370
- // Sent by the transcoder to register itself to the orchestrator.
371
- message RegisterRequest {
372
-
373
- // Shared secret for auth
374
- string secret = 1;
375
-
376
- // Transcoder capacity
377
- int64 capacity = 2;
378
-
379
- // Transcoder capabilities
380
- Capabilities capabilities = 3;
381
- }
382
-
383
- // Sent by the orchestrator to the transcoder
384
- message NotifySegment {
385
-
386
- // URL of the segment to transcode.
387
- string url = 1;
388
-
389
- // Configuration for the transcoding job
390
- SegData segData = 3;
391
-
392
- // ID for this particular transcoding task.
393
- int64 taskId = 16;
394
-
395
- // Orchestrator identifier for segment metadata
396
- string orchId = 18;
397
-
398
- // All fields below are deprecated. May still be populated if necessary
399
-
400
- // Deprecated by segData. Job the segment belongs to.
401
- reserved 2; // Formerly "string job"
402
-
403
- // Deprecated by fullProfiles. Set of presets to transcode into.
404
- // Should be set to an invalid value to induce failures
405
- bytes profiles = 17;
406
-
407
- // Deprecated by segData. Transcoding configuration to use.
408
- reserved 33; // Formerly "repeated VideoProfile fullProfiles"
409
- }
410
-
411
- // Sent by the aiworker to register itself to the orchestrator.
412
- message RegisterAIWorkerRequest {
413
-
414
- // Shared secret for auth
415
- string secret = 1;
416
-
417
- // AIWorker capabilities
418
- Capabilities capabilities = 2;
419
-
420
- // AIWorker hardware info
421
- repeated HardwareInformation hardware = 3;
422
- }
423
-
424
- // Data included by the gateway when submitting a AI job.
425
- message AIJobData {
426
- // pipeline to use for the job
427
- string pipeline = 1;
428
-
429
- // AI job request data
430
- bytes requestData = 2;
431
- }
432
-
433
- // Sent by the orchestrator to the aiworker
434
- message NotifyAIJob {
435
- // Configuration for the AI job
436
- AIJobData AIJobData = 1;
437
-
438
- // ID for this particular AI task.
439
- int64 taskId = 2;
440
- }
441
-
442
- // Required parameters for probabilistic micropayment tickets
443
- message TicketParams {
444
- // ETH address of the recipient
445
- bytes recipient = 1;
446
-
447
- // Pay out (in Wei) to the recipient if the ticket wins
448
- bytes face_value = 2;
449
-
450
- // Probability that the ticket wins
451
- bytes win_prob = 3;
452
-
453
- // 32 byte keccak-256 hash commitment to a random number provided
454
- // by the recipient
455
- bytes recipient_rand_hash = 4;
456
-
457
- // Value generated by recipient that the recipient can use
458
- // to derive the random number corresponding to the recipient's hash
459
- // commitment
460
- bytes seed = 5;
461
-
462
- // Block number at which the current set of advertised TicketParams is no
463
- // longer valid
464
- bytes expiration_block = 6;
465
-
466
- // Expected ticket expiration params
467
- TicketExpirationParams expiration_params = 7;
468
- }
469
-
470
- // Sender Params (nonces and signatures)
471
- message TicketSenderParams {
472
- // Monotonically increasing counter that makes the ticket
473
- // unique relative to a particular hash commitment to a recipient's random
474
- // number
475
- uint32 sender_nonce = 1;
476
-
477
- // Sender signature over the ticket
478
- bytes sig = 2;
479
- }
480
-
481
- // Ticket params for expiration related validation
482
- message TicketExpirationParams {
483
- // Round during which tickets are created
484
- int64 creation_round = 1;
485
-
486
- // Block hash associated with creation_round
487
- bytes creation_round_block_hash = 2;
488
- }
489
-
490
- // Payment for transcoding video segments
491
- // A payment can constitute of multiple tickets
492
- // A broadcaster might need to send multiple tickets to top up his credit with
493
- // an Orchestrator
494
- message Payment {
495
- // Probabilistic micropayment ticket parameters
496
- // These remain the same even when sending multiple tickets
497
- TicketParams ticket_params = 1;
498
-
499
- // ETH address of the sender
500
- bytes sender = 2;
501
-
502
- // Ticket params for expiration related validation
503
- TicketExpirationParams expiration_params = 3;
504
-
505
- repeated TicketSenderParams ticket_sender_params = 4;
506
-
507
- // O's last known price
508
- PriceInfo expected_price = 5;
509
- }
510
-
511
- // GPU information used by worker on network
512
- message GPUComputeInfo {
513
- // unique id
514
- string id = 1;
515
-
516
- // gpu name
517
- string name = 2;
518
-
519
- // compute version supported - major
520
- uint32 major = 4;
521
-
522
- // compute version supported - minor
523
- uint32 minor = 5;
524
-
525
- // GPU memory free
526
- int64 memory_free = 6;
527
-
528
- // GPU memory total
529
- int64 memory_total = 7;
530
- }
531
-
532
- // Hardware information for worker on network
533
- message HardwareInformation {
534
- // pipeline hardware supports
535
- string pipeline = 1;
536
-
537
- // model_id hardware supports
538
- string model_id = 2;
539
-
540
- // hardware for pipeline and model_id
541
- map<string, GPUComputeInfo> gpu_info = 3;
542
- }