@semiont/gateway 0.5.28 → 0.5.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/dist/index.js +275 -61
- package/dist/index.js.map +1 -1
- package/dist/openapi.json +172 -5
- package/package.json +4 -4
package/dist/openapi.json
CHANGED
|
@@ -1930,7 +1930,7 @@
|
|
|
1930
1930
|
},
|
|
1931
1931
|
"token": {
|
|
1932
1932
|
"type": "string",
|
|
1933
|
-
"description": "Short-lived access token
|
|
1933
|
+
"description": "Short-lived access token. Use as Authorization: Bearer header on API calls. The TTL is deliberately NOT restated here — docs/system/administration/AUTHENTICATION.md holds the one table of token lifetimes, and a second copy is how this description came to claim an hour for a ten-minute token. A client must refresh from the refresh token rather than assume any particular window."
|
|
1934
1934
|
},
|
|
1935
1935
|
"refreshToken": {
|
|
1936
1936
|
"type": "string",
|
|
@@ -2951,6 +2951,10 @@
|
|
|
2951
2951
|
"type": "string",
|
|
2952
2952
|
"description": "Optional resource scope for broadcast channels (e.g. resourceId). Publishers only — clients must never set this.",
|
|
2953
2953
|
"minLength": 1
|
|
2954
|
+
},
|
|
2955
|
+
"clientId": {
|
|
2956
|
+
"type": "string",
|
|
2957
|
+
"description": "Routing address for this request's reply (CORRELATED-REPLY-ROUTING D1/D2): the emit doubles as a claim on the correlationId, and delivery matches BOTH this and the emitting principal. Top-level, not inside `payload` — a wire concern like `scope`, so it never enters a channel's domain type. Optional in the schema because a plain broadcast needs no return address; the route requires it when the channel is a registered request channel and the payload carries a correlationId."
|
|
2954
2958
|
}
|
|
2955
2959
|
},
|
|
2956
2960
|
"required": [
|
|
@@ -3005,9 +3009,16 @@
|
|
|
3005
3009
|
}
|
|
3006
3010
|
}
|
|
3007
3011
|
}
|
|
3012
|
+
},
|
|
3013
|
+
"clientId": {
|
|
3014
|
+
"type": "string",
|
|
3015
|
+
"description": "Routing address for correlated replies (CORRELATED-REPLY-ROUTING D1): a UUID minted once per bus-client lifetime — per actor, NOT per connection, so it survives a make-before-break reconnect and both overlap connections share it. Required: a subscriber without one could never receive a correlated frame, and that must fail loudly here rather than silently at delivery. Not authentication — the JWT stays that; this is an unguessable routing address, never echoed into any payload or broadcast frame."
|
|
3008
3016
|
}
|
|
3009
3017
|
},
|
|
3010
|
-
"additionalProperties": false
|
|
3018
|
+
"additionalProperties": false,
|
|
3019
|
+
"required": [
|
|
3020
|
+
"clientId"
|
|
3021
|
+
]
|
|
3011
3022
|
},
|
|
3012
3023
|
"CloneResourceWithTokenResponse": {
|
|
3013
3024
|
"type": "object",
|
|
@@ -3822,6 +3833,10 @@
|
|
|
3822
3833
|
"type": "object",
|
|
3823
3834
|
"description": "Progress payload emitted on the gather:annotation-progress SSE channel during LLM context gathering.",
|
|
3824
3835
|
"properties": {
|
|
3836
|
+
"correlationId": {
|
|
3837
|
+
"type": "string",
|
|
3838
|
+
"description": "The request this progress belongs to (CORRELATED-REPLY-ROUTING D3). Required: `CORRELATED_CHANNELS` derives every operation's progress channel into the delivery filter, so a frame without it cannot be matched to a claim and is silently dropped."
|
|
3839
|
+
},
|
|
3825
3840
|
"message": {
|
|
3826
3841
|
"type": "string"
|
|
3827
3842
|
},
|
|
@@ -3830,7 +3845,10 @@
|
|
|
3830
3845
|
"minimum": 0,
|
|
3831
3846
|
"maximum": 100
|
|
3832
3847
|
}
|
|
3833
|
-
}
|
|
3848
|
+
},
|
|
3849
|
+
"required": [
|
|
3850
|
+
"correlationId"
|
|
3851
|
+
]
|
|
3834
3852
|
},
|
|
3835
3853
|
"GatherResourceComplete": {
|
|
3836
3854
|
"type": "object",
|
|
@@ -4584,21 +4602,58 @@
|
|
|
4584
4602
|
},
|
|
4585
4603
|
"JobCancelRequest": {
|
|
4586
4604
|
"type": "object",
|
|
4587
|
-
"description": "Request to cancel a job",
|
|
4605
|
+
"description": "Request to cancel a job. Target one running or pending job by `jobId` (JOB-RESTART-SAFETY P4), or a whole category of pending jobs by `jobType`. A `jobId`-targeted request that names a RUNNING job is honoured cooperatively by the owning worker, which stops at its next unit boundary and emits JobCancelCommand — the queue is never made to yank a running job out from under a live worker.",
|
|
4588
4606
|
"properties": {
|
|
4589
4607
|
"correlationId": {
|
|
4590
4608
|
"type": "string",
|
|
4591
4609
|
"description": "Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. Absent for the local cancelRequest UI signal."
|
|
4592
4610
|
},
|
|
4611
|
+
"jobId": {
|
|
4612
|
+
"type": "string",
|
|
4613
|
+
"description": "Cancel this one job. A pending job is cancelled immediately by the gateway; a running job is cancelled cooperatively by its worker. Takes precedence over jobType."
|
|
4614
|
+
},
|
|
4593
4615
|
"jobType": {
|
|
4594
4616
|
"type": "string",
|
|
4595
4617
|
"enum": [
|
|
4596
4618
|
"annotation",
|
|
4597
4619
|
"generation"
|
|
4598
|
-
]
|
|
4620
|
+
],
|
|
4621
|
+
"description": "Cancel all PENDING jobs in this category — the bulk UI signal. Ignored when jobId is present."
|
|
4622
|
+
}
|
|
4623
|
+
}
|
|
4624
|
+
},
|
|
4625
|
+
"JobCancelCommand": {
|
|
4626
|
+
"type": "object",
|
|
4627
|
+
"description": "A worker's confirmation that it has cooperatively stopped a running job at a unit boundary (JOB-RESTART-SAFETY P4) — the queue moves the job to cancelled/. Distinct from JobCancelRequest (the client→worker REQUEST to stop): this is the worker announcing it did, so the running job is never yanked to cancelled/ out from under a live worker (the roach-motel race).",
|
|
4628
|
+
"properties": {
|
|
4629
|
+
"_userId": {
|
|
4630
|
+
"type": "string",
|
|
4631
|
+
"description": "Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this."
|
|
4632
|
+
},
|
|
4633
|
+
"resourceId": {
|
|
4634
|
+
"type": "string"
|
|
4635
|
+
},
|
|
4636
|
+
"jobId": {
|
|
4637
|
+
"type": "string"
|
|
4638
|
+
},
|
|
4639
|
+
"jobType": {
|
|
4640
|
+
"$ref": "#/components/schemas/JobType"
|
|
4641
|
+
},
|
|
4642
|
+
"annotationId": {
|
|
4643
|
+
"type": "string",
|
|
4644
|
+
"description": "Annotation this job is attached to, when applicable. Lets the UI route cancellation feedback to a specific annotation."
|
|
4645
|
+
},
|
|
4646
|
+
"completedUnits": {
|
|
4647
|
+
"type": "array",
|
|
4648
|
+
"items": {
|
|
4649
|
+
"type": "string"
|
|
4650
|
+
},
|
|
4651
|
+
"description": "Entity-type units whose annotations were fully emitted before cancellation. Recorded on the cancelled job's metadata so the work already done stays visible."
|
|
4599
4652
|
}
|
|
4600
4653
|
},
|
|
4601
4654
|
"required": [
|
|
4655
|
+
"resourceId",
|
|
4656
|
+
"jobId",
|
|
4602
4657
|
"jobType"
|
|
4603
4658
|
]
|
|
4604
4659
|
},
|
|
@@ -4789,6 +4844,25 @@
|
|
|
4789
4844
|
},
|
|
4790
4845
|
"error": {
|
|
4791
4846
|
"type": "string"
|
|
4847
|
+
},
|
|
4848
|
+
"completedUnits": {
|
|
4849
|
+
"type": "array",
|
|
4850
|
+
"items": {
|
|
4851
|
+
"type": "string"
|
|
4852
|
+
},
|
|
4853
|
+
"description": "Entity-type units whose annotations were fully emitted before this failure (checkpointed resume). The queue records them on the retried job's metadata; a retried claim skips them so completed work is neither redone nor duplicated."
|
|
4854
|
+
},
|
|
4855
|
+
"failureClass": {
|
|
4856
|
+
"type": "string",
|
|
4857
|
+
"enum": [
|
|
4858
|
+
"transient",
|
|
4859
|
+
"deterministic"
|
|
4860
|
+
],
|
|
4861
|
+
"description": "Worker-side classification of the failure, made where the error is still typed. 'deterministic' — the same request cannot succeed on a second attempt — skips the retry budget; absent or 'transient' retries as before. Only KNOWN-deterministic failures carry the class."
|
|
4862
|
+
},
|
|
4863
|
+
"willRetry": {
|
|
4864
|
+
"type": "boolean",
|
|
4865
|
+
"description": "Whether the queue will re-queue this job for another attempt. Computed by the worker from the SAME predicate the queue applies at failJob (one decision site, `willRetryAfter` in @semiont/jobs) using the retry budget carried on the claimed record. FALSE (or absent) means this failure is TERMINAL: a client's job-watch stream ends here. TRUE means the work continues on a fresh attempt — the failure is an event, not the end, and a stream that terminated on it would report a recovering run as a failed one (JOB-RESTART-SAFETY P5)."
|
|
4792
4866
|
}
|
|
4793
4867
|
},
|
|
4794
4868
|
"required": [
|
|
@@ -4798,6 +4872,30 @@
|
|
|
4798
4872
|
"error"
|
|
4799
4873
|
]
|
|
4800
4874
|
},
|
|
4875
|
+
"JobCheckpointCommand": {
|
|
4876
|
+
"type": "object",
|
|
4877
|
+
"description": "Command to persist a running job's completed-unit checkpoint AT unit completion (JOB-RESTART-SAFETY P2). Distinct from JobFailCommand's checkpoint, which lands only on a clean failure: a worker that dies (crash/OOM/kill) never emits job:fail, so this durable, unthrottled write is what lets the janitor's stale-running recovery resume a dead worker's job rather than redo its finished units.",
|
|
4878
|
+
"properties": {
|
|
4879
|
+
"_userId": {
|
|
4880
|
+
"type": "string",
|
|
4881
|
+
"description": "Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this."
|
|
4882
|
+
},
|
|
4883
|
+
"jobId": {
|
|
4884
|
+
"type": "string"
|
|
4885
|
+
},
|
|
4886
|
+
"completedUnits": {
|
|
4887
|
+
"type": "array",
|
|
4888
|
+
"items": {
|
|
4889
|
+
"type": "string"
|
|
4890
|
+
},
|
|
4891
|
+
"description": "Entity-type units whose annotations have been fully emitted so far. Unioned into the running job's metadata checkpoint; a retry after recovery skips them."
|
|
4892
|
+
}
|
|
4893
|
+
},
|
|
4894
|
+
"required": [
|
|
4895
|
+
"jobId",
|
|
4896
|
+
"completedUnits"
|
|
4897
|
+
]
|
|
4898
|
+
},
|
|
4801
4899
|
"JobDeclinedResult": {
|
|
4802
4900
|
"type": "object",
|
|
4803
4901
|
"description": "Result of a job that completed without doing its work because the resource could not be read. Distinct from a failure: nothing went wrong, there was simply no text to work with — an encrypted or damaged PDF, a scan whose text could not be recognized, or a document that yielded nothing. The reasons are the extraction vocabulary the Smelter reports on `smelt:settled`, MINUS `no-extractor`: a media type that can never yield text (a zip, an image) is a bad request rather than a decline, so a worker asked to detect over one throws and the job reports `job:fail`. Everything here is a resource-specific outcome — the same media type would have succeeded on a different document.",
|
|
@@ -4983,6 +5081,10 @@
|
|
|
4983
5081
|
"foundCount": {
|
|
4984
5082
|
"type": "integer",
|
|
4985
5083
|
"description": "Annotations found for it."
|
|
5084
|
+
},
|
|
5085
|
+
"persistedCount": {
|
|
5086
|
+
"type": "integer",
|
|
5087
|
+
"description": "Annotations actually persisted for it — post-dedupe and post-durability-acknowledgement, so it counts what the event log holds, not what the model proposed. Beside foundCount this is the per-unit yield the sizing work is judged by. Present on flows whose units persist as they complete (reference-annotation); the tagging flow reports the same fact as byCategory on its result, because its annotations are built after the per-category loop."
|
|
4986
5088
|
}
|
|
4987
5089
|
},
|
|
4988
5090
|
"required": [
|
|
@@ -5800,6 +5902,71 @@
|
|
|
5800
5902
|
"response"
|
|
5801
5903
|
]
|
|
5802
5904
|
},
|
|
5905
|
+
"MarkCommitCommand": {
|
|
5906
|
+
"type": "object",
|
|
5907
|
+
"description": "Bus command to persist a detection unit's annotations as one acknowledged batch (JOB-RESTART-SAFETY P6). Unlike mark:create, which is fire-and-forget and resolves when the bus accepts it, this command is answered only after every annotation is in the event log — so a worker can gate unit completion on durability rather than on emission. The batch is the unit: a partial commit is reported as a failure, and the worker retries the whole unit, which is safe because annotation ids are deterministic (P3).",
|
|
5908
|
+
"properties": {
|
|
5909
|
+
"_userId": {
|
|
5910
|
+
"type": "string",
|
|
5911
|
+
"description": "Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this."
|
|
5912
|
+
},
|
|
5913
|
+
"correlationId": {
|
|
5914
|
+
"type": "string",
|
|
5915
|
+
"description": "Correlation id set by busRequest so the mark:commit-ok / mark:commit-failed reply routes back to the awaiting worker."
|
|
5916
|
+
},
|
|
5917
|
+
"resourceId": {
|
|
5918
|
+
"type": "string",
|
|
5919
|
+
"description": "Resource every annotation in this batch targets."
|
|
5920
|
+
},
|
|
5921
|
+
"annotations": {
|
|
5922
|
+
"type": "array",
|
|
5923
|
+
"description": "The unit's annotations, already built with deterministic ids. Re-committing an identical batch is a no-op rather than a duplicate.",
|
|
5924
|
+
"items": {
|
|
5925
|
+
"$ref": "#/components/schemas/Annotation"
|
|
5926
|
+
}
|
|
5927
|
+
}
|
|
5928
|
+
},
|
|
5929
|
+
"required": [
|
|
5930
|
+
"correlationId",
|
|
5931
|
+
"resourceId",
|
|
5932
|
+
"annotations"
|
|
5933
|
+
]
|
|
5934
|
+
},
|
|
5935
|
+
"MarkCommitOk": {
|
|
5936
|
+
"type": "object",
|
|
5937
|
+
"description": "Durability acknowledgement for a mark:commit batch: every annotation named by the command is in the event log at the moment this is emitted.",
|
|
5938
|
+
"properties": {
|
|
5939
|
+
"correlationId": {
|
|
5940
|
+
"type": "string",
|
|
5941
|
+
"description": "Correlation id echoed from the mark:commit command so busRequest can match the reply."
|
|
5942
|
+
},
|
|
5943
|
+
"response": {
|
|
5944
|
+
"type": "object",
|
|
5945
|
+
"description": "What the commit persisted.",
|
|
5946
|
+
"properties": {
|
|
5947
|
+
"persisted": {
|
|
5948
|
+
"type": "integer",
|
|
5949
|
+
"description": "Annotations this commit appended to the event log. Equals the batch size on success — a retry re-appends what already landed rather than counting it out, because the annotation fold is idempotent by id and the log is append-only. Not a dedupe count."
|
|
5950
|
+
},
|
|
5951
|
+
"annotationIds": {
|
|
5952
|
+
"type": "array",
|
|
5953
|
+
"description": "Ids the batch covers, whether appended now or already present.",
|
|
5954
|
+
"items": {
|
|
5955
|
+
"type": "string"
|
|
5956
|
+
}
|
|
5957
|
+
}
|
|
5958
|
+
},
|
|
5959
|
+
"required": [
|
|
5960
|
+
"persisted",
|
|
5961
|
+
"annotationIds"
|
|
5962
|
+
]
|
|
5963
|
+
}
|
|
5964
|
+
},
|
|
5965
|
+
"required": [
|
|
5966
|
+
"correlationId",
|
|
5967
|
+
"response"
|
|
5968
|
+
]
|
|
5969
|
+
},
|
|
5803
5970
|
"MarkCreateRequest": {
|
|
5804
5971
|
"type": "object",
|
|
5805
5972
|
"description": "Raw annotation creation intent — bus handler assembles the W3C annotation",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semiont/gateway",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Semiont gateway server - pre-built for npm consumption",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"@hono/swagger-ui": "^0.6.1",
|
|
31
31
|
"@prisma/adapter-pg": "^7.10.0",
|
|
32
32
|
"@prisma/client": "^7.10.0",
|
|
33
|
-
"@semiont/core": "0.5.
|
|
34
|
-
"@semiont/make-meaning": "0.5.
|
|
35
|
-
"@semiont/observability": "0.5.
|
|
33
|
+
"@semiont/core": "0.5.30",
|
|
34
|
+
"@semiont/make-meaning": "0.5.30",
|
|
35
|
+
"@semiont/observability": "0.5.30",
|
|
36
36
|
"ajv": "^8.20.0",
|
|
37
37
|
"ajv-formats": "^3.0.1",
|
|
38
38
|
"argon2": "^0.45.1",
|