@volter/twin-temporal 0.1.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/LICENSE +202 -0
- package/README.md +104 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +36 -0
- package/dist/src/generated/hpack.json +1 -0
- package/dist/src/generated/temporal-api.json +1 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/index.js +70 -0
- package/dist/src/temporal-budget.d.ts +31 -0
- package/dist/src/temporal-budget.js +50 -0
- package/dist/src/temporal-capabilities.d.ts +7 -0
- package/dist/src/temporal-capabilities.js +650 -0
- package/dist/src/temporal-conformance.d.ts +8 -0
- package/dist/src/temporal-conformance.js +54 -0
- package/dist/src/temporal-connector.d.ts +32 -0
- package/dist/src/temporal-connector.js +121 -0
- package/dist/src/temporal-engine.d.ts +274 -0
- package/dist/src/temporal-engine.js +2132 -0
- package/dist/src/temporal-grpc.d.ts +51 -0
- package/dist/src/temporal-grpc.js +124 -0
- package/dist/src/temporal-h2.d.ts +40 -0
- package/dist/src/temporal-h2.js +644 -0
- package/dist/src/temporal-history.d.ts +27 -0
- package/dist/src/temporal-history.js +85 -0
- package/dist/src/temporal-http.d.ts +17 -0
- package/dist/src/temporal-http.js +160 -0
- package/dist/src/temporal-json.d.ts +7 -0
- package/dist/src/temporal-json.js +68 -0
- package/dist/src/temporal-proto.d.ts +17 -0
- package/dist/src/temporal-proto.js +46 -0
- package/dist/src/temporal-server.d.ts +25 -0
- package/dist/src/temporal-server.js +56 -0
- package/dist/src/temporal-twin.d.ts +25 -0
- package/dist/src/temporal-twin.js +100 -0
- package/dist/src/temporal-visibility.d.ts +49 -0
- package/dist/src/temporal-visibility.js +293 -0
- package/package.json +59 -0
- package/src/cli.ts +36 -0
- package/src/generated/hpack.json +1 -0
- package/src/generated/temporal-api.json +1 -0
- package/src/index.ts +81 -0
- package/src/temporal-budget.ts +75 -0
- package/src/temporal-capabilities.ts +679 -0
- package/src/temporal-conformance.ts +52 -0
- package/src/temporal-connector.ts +118 -0
- package/src/temporal-engine.ts +2176 -0
- package/src/temporal-grpc.ts +139 -0
- package/src/temporal-h2.ts +614 -0
- package/src/temporal-history.ts +99 -0
- package/src/temporal-http.ts +146 -0
- package/src/temporal-json.ts +77 -0
- package/src/temporal-proto.ts +53 -0
- package/src/temporal-server.ts +67 -0
- package/src/temporal-twin.ts +102 -0
- package/src/temporal-visibility.ts +245 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# @volter/twin-temporal
|
|
2
|
+
|
|
3
|
+
Temporal — the workflow engine — served from a World with nothing installed: the frontend's gRPC API
|
|
4
|
+
(`temporal.api.workflowservice.v1.WorkflowService`, `temporal.api.operatorservice.v1.OperatorService`,
|
|
5
|
+
`grpc.health.v1.Health`) on one loopback port. An unmodified app on the Temporal SDKs
|
|
6
|
+
(`@temporalio/client`, `@temporalio/worker`) starts, runs, signals, queries and reads workflows against
|
|
7
|
+
it; the worker runs the app's own workflow and activity code exactly as it would against a cluster.
|
|
8
|
+
|
|
9
|
+
It stands where Temporal's local setups stand: `temporal server start-dev` (the Temporal CLI's
|
|
10
|
+
single-binary dev server with SQLite) or a docker-compose stack (`temporalio/auto-setup` with
|
|
11
|
+
PostgreSQL and Elasticsearch — Postiz's own `docker-compose.dev.yaml` runs four containers for it).
|
|
12
|
+
Neither is installed or run; this twin is that frontend, containerless, with its state in the World.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
world-temporal serve --port 7233 --root .volter/world
|
|
16
|
+
# app: TEMPORAL_ADDRESS=127.0.0.1:7233 (namespace `default` exists)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
| command | what it does |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `world-temporal serve [--port N] [--root DIR] [--read-only]` | the frontend on loopback: gRPC (HTTP/2, h2c) for the SDKs; HTTP/1 on the same port for the World's doors and the HTTP API |
|
|
22
|
+
| `world-temporal conformance [--root DIR]` | probe the wire over a real socket; non-zero on any failure |
|
|
23
|
+
|
|
24
|
+
## Wiring
|
|
25
|
+
|
|
26
|
+
The SDKs dial the address they are configured with (`Connection.connect({ address })`,
|
|
27
|
+
`NativeConnection.connect({ address })`), conventionally `TEMPORAL_ADDRESS`. A World injects
|
|
28
|
+
`TEMPORAL_ADDRESS=<host>:<port>` at this twin (`APP_READ_ENDPOINT_ENV` in
|
|
29
|
+
`packages/world-runtime/src/init.ts`); there is no injector host, because gRPC never passes the
|
|
30
|
+
http/fetch injector. `TEMPORAL_API_KEY` must stay unset: the SDKs turn TLS on when a key is given, and
|
|
31
|
+
this loopback frontend speaks h2c only.
|
|
32
|
+
|
|
33
|
+
## How it is built
|
|
34
|
+
|
|
35
|
+
- **The wire** is this pack's own HTTP/2 (`temporal-h2.ts`: framing, both directions of flow control,
|
|
36
|
+
HPACK with the tables derived from the vendored RFC 7541) under gRPC framing (`temporal-grpc.ts`).
|
|
37
|
+
Bun 1.3's `node:http2` server fails nghttp2 clients at the connection preface (a node client gets
|
|
38
|
+
`ERR_HTTP2_ERROR` before the first SETTINGS; Bun 1.3.11, Node 22.23.2, 2026-09-27), and the
|
|
39
|
+
repository runs under Bun; a socket works under both runtimes. The first bytes of a connection
|
|
40
|
+
decide HTTP/2 or HTTP/1.
|
|
41
|
+
- **The RPC table** (`temporal-twin.ts` `SERVED`) routes each served method to the engine; every other
|
|
42
|
+
method the vendored services declare answers gRPC `UNIMPLEMENTED` naming it.
|
|
43
|
+
- **The engine** (`temporal-engine.ts`) is the history service: task queues with long polls, workflow
|
|
44
|
+
tasks and the commands they return, activities with retry policies, heartbeats and timeouts,
|
|
45
|
+
timers, signals, queries, children with parent-close policy, continue-as-new, workflow retry,
|
|
46
|
+
markers, search attributes and memo, cancellation and termination, buffered events (a completion
|
|
47
|
+
that would close over events that arrived during its task fails `UNHANDLED_COMMAND`, as the server
|
|
48
|
+
does). Time is the World clock (`worldNow()`): a pinned clock holds every timer, and
|
|
49
|
+
`volter-world clock advance` fires what falls due.
|
|
50
|
+
- **State** is the World's. A run is a `workflow-execution` subject in its WorkflowExecutionInfo shape
|
|
51
|
+
(plus the server's `_state`); a namespace is a `namespace` subject with its custom search
|
|
52
|
+
attributes. A run's history is the engine slot (`temporal-history.ts`): content-addressed event
|
|
53
|
+
chunks in the World's blob store, named in order by the run's subject, so a branch replays exactly
|
|
54
|
+
the history its tree names.
|
|
55
|
+
- **Visibility** reads Temporal's list filter language (`temporal-visibility.ts`) over the runs'
|
|
56
|
+
system and custom search attributes.
|
|
57
|
+
- **The HTTP API** (`temporal-http.ts`) routes the protos' `google.api.http` annotations to the same
|
|
58
|
+
table with proto3 JSON; it is also the pack's fetch (`createTemporalTwinFetch`) for the World's
|
|
59
|
+
doors (`GET /twin`, `GET /twin/store/workflows`).
|
|
60
|
+
|
|
61
|
+
The spec is the vendored `spec/proto` (temporalio/api as `@temporalio/core-bridge@1.15.0` ships it);
|
|
62
|
+
`derive.ts` compiles it to `src/generated/temporal-api.json` and `derive.ts --check` re-derives it.
|
|
63
|
+
|
|
64
|
+
## Coverage
|
|
65
|
+
|
|
66
|
+
The denominator is every method of the three services and every `CommandType`
|
|
67
|
+
(`src/temporal-capabilities.ts`); a served method is `done` with a verify, every other is `todo`.
|
|
68
|
+
Served: GetSystemInfo, DescribeNamespace, ListNamespaces, RegisterNamespace, StartWorkflowExecution,
|
|
69
|
+
SignalWithStartWorkflowExecution, SignalWorkflowExecution, RequestCancelWorkflowExecution,
|
|
70
|
+
TerminateWorkflowExecution, GetWorkflowExecutionHistory, DescribeWorkflowExecution,
|
|
71
|
+
ListWorkflowExecutions, CountWorkflowExecutions, PollWorkflowTaskQueue, RespondWorkflowTaskCompleted,
|
|
72
|
+
RespondWorkflowTaskFailed, PollActivityTaskQueue, RespondActivityTask{Completed,Failed,Canceled}[ById],
|
|
73
|
+
RecordActivityTaskHeartbeat[ById], QueryWorkflow, RespondQueryTaskCompleted, ResetStickyTaskQueue,
|
|
74
|
+
ShutdownWorker; OperatorService List/Add/RemoveSearchAttributes; Health Check.
|
|
75
|
+
|
|
76
|
+
Not served (UNIMPLEMENTED, filed `todo`): schedules, workflow updates, batch operations, reset,
|
|
77
|
+
worker deployments and versioning, Nexus, standalone activities, task-queue description and
|
|
78
|
+
reachability, archival, the rest of OperatorService. Narrower than the server, and filed:
|
|
79
|
+
sticky queues (every task goes to the normal queue with its full history, which the SDKs accept),
|
|
80
|
+
cron schedules (refused by name), eager start, completion callbacks, Text attributes matched by
|
|
81
|
+
equality rather than tokenized search, TLS, message compression, `grpc-status-details-bin`, and the
|
|
82
|
+
HTTP API's payload shorthand, transient workflow-task attempts (every failed attempt is written),
|
|
83
|
+
namespace retention (closed runs are kept), and search-attribute value types (only names are checked).
|
|
84
|
+
|
|
85
|
+
No mirror: someone doing Temporal's core job writes workflow code and runs workers; Temporal's Web UI
|
|
86
|
+
is an observer over the frontend API. Several of the reads it makes (reverse history, task-queue
|
|
87
|
+
description, schedules, counts grouped by status) are among the unserved RPCs above.
|
|
88
|
+
|
|
89
|
+
## Proofs
|
|
90
|
+
|
|
91
|
+
- `src/temporal-sdk.integration.test.ts` runs the real `@temporalio/client` and `@temporalio/worker`
|
|
92
|
+
1.15.0 under Node against the twin: an activity retried to success, a timer, a query, a signal,
|
|
93
|
+
exhausted retries, a failing workflow, children (awaited and abandoned), continue-as-new,
|
|
94
|
+
`patched()`, a search-attribute upsert and a list query, a conflicting start, terminate, and an
|
|
95
|
+
UNIMPLEMENTED method (`test-fixtures/sdk/`); then Postiz's own client calls and workflow shapes on a
|
|
96
|
+
World clock the test advances (`test-fixtures/postiz/`).
|
|
97
|
+
- `src/temporal-h2.test.ts` decodes every RFC 7541 Appendix C example.
|
|
98
|
+
|
|
99
|
+
## Connector
|
|
100
|
+
|
|
101
|
+
`syncTemporalFromReal` pulls a real frontend's namespaces and their custom search attributes over an
|
|
102
|
+
injected unary call (`liveTemporalExecute`: gRPC over `node:http2`, behind the rate budget in
|
|
103
|
+
`temporal-budget.ts`). Runs are not pulled — a run is its history, advanced only by the workers that
|
|
104
|
+
execute it — and a real head refuses every entry by name (`performTemporalAction`).
|
package/dist/src/cli.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// world-temporal: serve Temporal's frontend (gRPC) on loopback, or run the conformance probes.
|
|
3
|
+
import { keepProcessAlive } from '@volter/world-core/lifecycle';
|
|
4
|
+
import { hasFlag, optionValue } from '@volter/world-core/args';
|
|
5
|
+
import { createTemporalTwinServer, TEMPORAL_LOOPBACK_HOST } from "./temporal-server.js";
|
|
6
|
+
const [cmd, ...rest] = process.argv.slice(2);
|
|
7
|
+
/** A malformed port fails rather than silently binding an ephemeral one (the smtp CLI's rule). */
|
|
8
|
+
function portOption(flag) {
|
|
9
|
+
const raw = optionValue(rest, flag);
|
|
10
|
+
if (raw === undefined || raw === '')
|
|
11
|
+
return undefined;
|
|
12
|
+
const value = Number(raw);
|
|
13
|
+
if (!Number.isInteger(value) || value < 0 || value > 65535) {
|
|
14
|
+
process.stderr.write(`world-temporal: ${flag} must be an integer 0-65535 (got ${JSON.stringify(raw)})\n`);
|
|
15
|
+
process.exit(2);
|
|
16
|
+
}
|
|
17
|
+
return value === 0 ? undefined : value;
|
|
18
|
+
}
|
|
19
|
+
const root = optionValue(rest, '--root') || process.env.VOLTER_STATE_DIR || undefined;
|
|
20
|
+
if (cmd === 'serve') {
|
|
21
|
+
const port = portOption('--port');
|
|
22
|
+
const server = await createTemporalTwinServer({ ...(port ? { port } : {}), ...(root ? { root } : {}), readOnly: hasFlag(rest, '--read-only') });
|
|
23
|
+
process.stdout.write(`temporal twin listening on ${TEMPORAL_LOOPBACK_HOST}:${server.port} (TEMPORAL_ADDRESS=${TEMPORAL_LOOPBACK_HOST}:${server.port}, namespace default)\n`);
|
|
24
|
+
await keepProcessAlive();
|
|
25
|
+
}
|
|
26
|
+
else if (cmd === 'conformance') {
|
|
27
|
+
// lazy — the conformance module is dev-only and must not be reachable from the runtime entrypoints
|
|
28
|
+
const { checkTemporalConformance } = await import("./temporal-conformance.js");
|
|
29
|
+
const report = await checkTemporalConformance(root ? { root } : {});
|
|
30
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
31
|
+
if (!report.ok)
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
process.stdout.write('Usage: world-temporal serve [--port N] [--root DIR] [--read-only] | conformance [--root DIR]\n');
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"source":"RFC 7541 Appendix A and B","staticTable":[[":authority",""],[":method","GET"],[":method","POST"],[":path","/"],[":path","/index.html"],[":scheme","http"],[":scheme","https"],[":status","200"],[":status","204"],[":status","206"],[":status","304"],[":status","400"],[":status","404"],[":status","500"],["accept-charset",""],["accept-encoding","gzip, deflate"],["accept-language",""],["accept-ranges",""],["accept",""],["access-control-allow-origin",""],["age",""],["allow",""],["authorization",""],["cache-control",""],["content-disposition",""],["content-encoding",""],["content-language",""],["content-length",""],["content-location",""],["content-range",""],["content-type",""],["cookie",""],["date",""],["etag",""],["expect",""],["expires",""],["from",""],["host",""],["if-match",""],["if-modified-since",""],["if-none-match",""],["if-range",""],["if-unmodified-since",""],["last-modified",""],["link",""],["location",""],["max-forwards",""],["proxy-authenticate",""],["proxy-authorization",""],["range",""],["referer",""],["refresh",""],["retry-after",""],["server",""],["set-cookie",""],["strict-transport-security",""],["transfer-encoding",""],["user-agent",""],["vary",""],["via",""],["www-authenticate",""]],"huffman":[[8184,13],[8388568,23],[268435426,28],[268435427,28],[268435428,28],[268435429,28],[268435430,28],[268435431,28],[268435432,28],[16777194,24],[1073741820,30],[268435433,28],[268435434,28],[1073741821,30],[268435435,28],[268435436,28],[268435437,28],[268435438,28],[268435439,28],[268435440,28],[268435441,28],[268435442,28],[1073741822,30],[268435443,28],[268435444,28],[268435445,28],[268435446,28],[268435447,28],[268435448,28],[268435449,28],[268435450,28],[268435451,28],[20,6],[1016,10],[1017,10],[4090,12],[8185,13],[21,6],[248,8],[2042,11],[1018,10],[1019,10],[249,8],[2043,11],[250,8],[22,6],[23,6],[24,6],[0,5],[1,5],[2,5],[25,6],[26,6],[27,6],[28,6],[29,6],[30,6],[31,6],[92,7],[251,8],[32764,15],[32,6],[4091,12],[1020,10],[8186,13],[33,6],[93,7],[94,7],[95,7],[96,7],[97,7],[98,7],[99,7],[100,7],[101,7],[102,7],[103,7],[104,7],[105,7],[106,7],[107,7],[108,7],[109,7],[110,7],[111,7],[112,7],[113,7],[114,7],[252,8],[115,7],[253,8],[8187,13],[524272,19],[8188,13],[16380,14],[34,6],[32765,15],[3,5],[35,6],[4,5],[36,6],[5,5],[37,6],[38,6],[39,6],[6,5],[116,7],[117,7],[40,6],[41,6],[42,6],[7,5],[43,6],[118,7],[44,6],[8,5],[9,5],[45,6],[119,7],[120,7],[121,7],[122,7],[123,7],[32766,15],[2044,11],[16381,14],[8189,13],[268435452,28],[1048550,20],[4194258,22],[1048551,20],[1048552,20],[4194259,22],[4194260,22],[4194261,22],[8388569,23],[4194262,22],[8388570,23],[8388571,23],[8388572,23],[8388573,23],[8388574,23],[16777195,24],[8388575,23],[16777196,24],[16777197,24],[4194263,22],[8388576,23],[16777198,24],[8388577,23],[8388578,23],[8388579,23],[8388580,23],[2097116,21],[4194264,22],[8388581,23],[4194265,22],[8388582,23],[8388583,23],[16777199,24],[4194266,22],[2097117,21],[1048553,20],[4194267,22],[4194268,22],[8388584,23],[8388585,23],[2097118,21],[8388586,23],[4194269,22],[4194270,22],[16777200,24],[2097119,21],[4194271,22],[8388587,23],[8388588,23],[2097120,21],[2097121,21],[4194272,22],[2097122,21],[8388589,23],[4194273,22],[8388590,23],[8388591,23],[1048554,20],[4194274,22],[4194275,22],[4194276,22],[8388592,23],[4194277,22],[4194278,22],[8388593,23],[67108832,26],[67108833,26],[1048555,20],[524273,19],[4194279,22],[8388594,23],[4194280,22],[33554412,25],[67108834,26],[67108835,26],[67108836,26],[134217694,27],[134217695,27],[67108837,26],[16777201,24],[33554413,25],[524274,19],[2097123,21],[67108838,26],[134217696,27],[134217697,27],[67108839,26],[134217698,27],[16777202,24],[2097124,21],[2097125,21],[67108840,26],[67108841,26],[268435453,28],[134217699,27],[134217700,27],[134217701,27],[1048556,20],[16777203,24],[1048557,20],[2097126,21],[4194281,22],[2097127,21],[2097128,21],[8388595,23],[4194282,22],[4194283,22],[33554414,25],[33554415,25],[16777204,24],[16777205,24],[67108842,26],[8388596,23],[67108843,26],[134217702,27],[67108844,26],[67108845,26],[134217703,27],[134217704,27],[134217705,27],[134217706,27],[134217707,27],[268435454,28],[134217708,27],[134217709,27],[134217710,27],[134217711,27],[134217712,27],[67108846,26],[1073741823,30]]}
|