streamby-core 0.39.0 → 0.40.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/CHANGELOG.md +52 -0
- package/LICENSE +661 -661
- package/README.md +680 -573
- package/dist/adapters/database/connectionManager.js +179 -124
- package/dist/adapters/database/sql.js +1 -1
- package/dist/mcp/tools.js +41 -0
- package/dist/middleware/createRouter.js +11 -1
- package/dist/middleware/routes/ai.js +3 -3
- package/dist/middleware/routes/deliverable.d.ts +4 -2
- package/dist/middleware/routes/deliverable.js +16 -7
- package/dist/middleware/routes/media.js +7 -6
- package/dist/middleware/routes/project.js +5 -1
- package/dist/middleware/routes/renderFarm.js +4 -77
- package/dist/middleware/routes/storage.js +13 -27
- package/dist/middleware/routes/worker.d.ts +7 -0
- package/dist/middleware/routes/worker.js +125 -0
- package/dist/middleware/routes/workerCallback.d.ts +5 -0
- package/dist/middleware/routes/workerCallback.js +31 -0
- package/dist/models/Model.js +9 -9
- package/dist/services/aiProcessor.js +11 -11
- package/dist/services/apiTokenPermissions.js +6 -5
- package/dist/services/executor.js +10 -10
- package/dist/services/jobQueue.d.ts +6 -4
- package/dist/services/jobQueue.js +28 -16
- package/dist/services/jobStore.d.ts +27 -0
- package/dist/services/jobStore.js +177 -0
- package/dist/services/mediaProcessor.js +16 -16
- package/dist/services/vfxProcessor.js +12 -12
- package/dist/services/workerJobs.d.ts +73 -0
- package/dist/services/workerJobs.js +459 -0
- package/dist/services/workers.d.ts +78 -0
- package/dist/services/workers.js +179 -0
- package/dist/types/index.d.ts +52 -2
- package/dist/utils/assetCategories.d.ts +4 -0
- package/dist/utils/assetCategories.js +21 -0
- package/dist/utils/builtinAccess.d.ts +1 -1
- package/dist/utils/builtinAccess.js +4 -3
- package/dist/utils/privateAddress.d.ts +10 -0
- package/dist/utils/privateAddress.js +85 -0
- package/package.json +1 -1
- package/dist/middleware/routes/apiConnection.d.ts +0 -3
- package/dist/middleware/routes/apiConnection.js +0 -100
- package/dist/middleware/routes/credential.d.ts +0 -3
- package/dist/middleware/routes/credential.js +0 -80
- package/dist/services/apiConnection.d.ts +0 -18
- package/dist/services/apiConnection.js +0 -65
- package/dist/services/credential.d.ts +0 -8
- package/dist/services/credential.js +0 -70
- package/dist/services/pipeline.d.ts +0 -2
- package/dist/services/pipeline.js +0 -292
- package/dist/utils/crypto.d.ts +0 -3
- package/dist/utils/crypto.js +0 -32
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.40.0
|
|
4
|
+
|
|
5
|
+
### ⚠️ Breaking changes
|
|
6
|
+
|
|
7
|
+
- **A project's render farm connections are its workers.** `GET`, `POST` and
|
|
8
|
+
`DELETE /projects/:projectId/render-farm-connections` are now
|
|
9
|
+
`/projects/:projectId/workers`, which takes `{ name, provider?, endpoint, credential?, kinds,
|
|
10
|
+
categories, autoKind?, timeoutSeconds?, description? }`. They're still kept in the project's
|
|
11
|
+
`renderFarmConnections` list.
|
|
12
|
+
- **Jobs are kept in the main database** (a new `jobs` table, created at startup, or collection),
|
|
13
|
+
not in memory: they survive restarts and every instance sees them. `GET /jobs/:jobId` answers
|
|
14
|
+
from there.
|
|
15
|
+
- `canUseBuiltin` may be called with kind `'worker'`.
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- **Processing workers**: StreamBy sends jobs to external workers (the host's, in the router
|
|
20
|
+
config's `workers`; or a project's own) and keeps what they make, as a new asset derived from
|
|
21
|
+
the original or as the asset's new version, with the worker's report. The README documents the
|
|
22
|
+
contract a worker follows.
|
|
23
|
+
- `POST /projects/:projectId/jobs/process` asks for one; `GET /projects/:projectId/jobs` lists
|
|
24
|
+
a project's jobs; `POST /projects/:projectId/jobs/:jobId/retry` sends a failed one again.
|
|
25
|
+
- Workers call back to `/worker-jobs/:jobId/{progress,upload-url,complete,fail}` with a token
|
|
26
|
+
of that job's attempt alone.
|
|
27
|
+
- A job not taken, or not finished in time, is sent again (up to `workerOptions.maxAttempts`);
|
|
28
|
+
every instance looks for them (`workerOptions.sweepIntervalMs`), and only one sends each.
|
|
29
|
+
- A worker with an `autoKind` runs by itself on an asset of its categories marked as a
|
|
30
|
+
deliverable, unless it's marked with an API token without `jobs:run`.
|
|
31
|
+
- **Behind a proxy that ends TLS, set `workerOptions.callbackBaseUrl`** to the router's public
|
|
32
|
+
https URL: without it, the callback URL is made from the request (`req.protocol`), and comes
|
|
33
|
+
out as `http://`.
|
|
34
|
+
- A project's worker is reached only over https and never at a local, private, shared,
|
|
35
|
+
benchmarking, multicast or reserved address: neither as its endpoint is written nor as its
|
|
36
|
+
name resolves, checked when it's connected and again right before each job is sent. A job
|
|
37
|
+
for one that resolves to such an address fails for good. `workerOptions.allowLocalEndpoints`
|
|
38
|
+
lifts that, for development. Its credential is used only while whoever connected it is
|
|
39
|
+
still in the project.
|
|
40
|
+
- A worker's answer to a job it doesn't take is logged, not shown: the job says "The worker
|
|
41
|
+
refused the job".
|
|
42
|
+
- A job is sent as whoever asked for it, with the platform role they had then (a host's
|
|
43
|
+
`canUseBuiltin` decides on sending it as on asking for it).
|
|
44
|
+
- MCP tools `list_workers`, `process_asset`, `list_jobs` and `retry_job`.
|
|
45
|
+
- Deleting a project deletes its jobs.
|
|
46
|
+
- Job events (`jobEvent`) carry the job's `projectId` and `status`.
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
|
|
50
|
+
- **Instances starting together don't deadlock on StreamBy's tables.** The statements that make
|
|
51
|
+
them (or bring them up to date) at startup run one instance at a time, in a transaction that
|
|
52
|
+
holds a transaction-level advisory lock (so it works behind a pooler in transaction mode, such
|
|
53
|
+
as Supabase's).
|
|
54
|
+
|
|
3
55
|
## 0.39.0
|
|
4
56
|
|
|
5
57
|
### Added
|