@dxos/compute 0.8.4-main.fd6878d → 0.9.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 +102 -5
- package/README.md +36 -1
- package/dist/lib/neutral/StorageService.mjs +22 -0
- package/dist/lib/neutral/chunk-2B2KSJT6.mjs +17 -0
- package/dist/lib/neutral/chunk-2B2KSJT6.mjs.map +7 -0
- package/dist/lib/neutral/chunk-AFBNVFAY.mjs +25 -0
- package/dist/lib/neutral/chunk-AFBNVFAY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-JAU4E4EK.mjs +53 -0
- package/dist/lib/neutral/chunk-JAU4E4EK.mjs.map +7 -0
- package/dist/lib/neutral/chunk-MEPE4HHX.mjs +21 -0
- package/dist/lib/neutral/chunk-MEPE4HHX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QZS4G6PE.mjs +240 -0
- package/dist/lib/neutral/chunk-QZS4G6PE.mjs.map +7 -0
- package/dist/lib/neutral/chunk-XEVFBI6S.mjs +62 -0
- package/dist/lib/neutral/chunk-XEVFBI6S.mjs.map +7 -0
- package/dist/lib/neutral/chunk-Z3Y7FQGN.mjs +174 -0
- package/dist/lib/neutral/chunk-Z3Y7FQGN.mjs.map +7 -0
- package/dist/lib/neutral/fib-HBDUGQW7.mjs +10 -0
- package/dist/lib/neutral/fib-HBDUGQW7.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +1183 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/reply-RJIAJ6FV.mjs +10 -0
- package/dist/lib/neutral/reply-RJIAJ6FV.mjs.map +7 -0
- package/dist/lib/neutral/sleep-3T2CZ7RE.mjs +10 -0
- package/dist/lib/neutral/sleep-3T2CZ7RE.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +32 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/types/src/Blueprint.d.ts +182 -0
- package/dist/types/src/Blueprint.d.ts.map +1 -0
- package/dist/types/src/Credential.d.ts +27 -0
- package/dist/types/src/Credential.d.ts.map +1 -0
- package/dist/types/src/Header.d.ts +9 -0
- package/dist/types/src/Header.d.ts.map +1 -0
- package/dist/types/src/Header.test.d.ts +2 -0
- package/dist/types/src/Header.test.d.ts.map +1 -0
- package/dist/types/src/LayerSpec.d.ts +56 -0
- package/dist/types/src/LayerSpec.d.ts.map +1 -0
- package/dist/types/src/McpServer.d.ts +26 -0
- package/dist/types/src/McpServer.d.ts.map +1 -0
- package/dist/types/src/Operation.d.ts +385 -0
- package/dist/types/src/Operation.d.ts.map +1 -0
- package/dist/types/src/OperationHandlerSet.d.ts +69 -0
- package/dist/types/src/OperationHandlerSet.d.ts.map +1 -0
- package/dist/types/src/OperationHandlerSet.test.d.ts +2 -0
- package/dist/types/src/OperationHandlerSet.test.d.ts.map +1 -0
- package/dist/types/src/OperationRegistry.d.ts +23 -0
- package/dist/types/src/OperationRegistry.d.ts.map +1 -0
- package/dist/types/src/Process.d.ts +255 -0
- package/dist/types/src/Process.d.ts.map +1 -0
- package/dist/types/src/Routine.d.ts +54 -0
- package/dist/types/src/Routine.d.ts.map +1 -0
- package/dist/types/src/Script.d.ts +21 -0
- package/dist/types/src/Script.d.ts.map +1 -0
- package/dist/types/src/ServiceResolver.d.ts +92 -0
- package/dist/types/src/ServiceResolver.d.ts.map +1 -0
- package/dist/types/src/StorageService.d.ts +58 -0
- package/dist/types/src/StorageService.d.ts.map +1 -0
- package/dist/types/src/Template.d.ts +61 -0
- package/dist/types/src/Template.d.ts.map +1 -0
- package/dist/types/src/Template.test.d.ts +2 -0
- package/dist/types/src/Template.test.d.ts.map +1 -0
- package/dist/types/src/Trace.d.ts +266 -0
- package/dist/types/src/Trace.d.ts.map +1 -0
- package/dist/types/src/Trigger.d.ts +192 -0
- package/dist/types/src/Trigger.d.ts.map +1 -0
- package/dist/types/src/TriggerEvent.d.ts +83 -0
- package/dist/types/src/TriggerEvent.d.ts.map +1 -0
- package/dist/types/src/errors.d.ts +308 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +18 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/testing/definitions.d.ts +11 -0
- package/dist/types/src/testing/definitions.d.ts.map +1 -0
- package/dist/types/src/testing/fib.d.ts +8 -0
- package/dist/types/src/testing/fib.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +6 -3
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/reply.d.ts +4 -0
- package/dist/types/src/testing/reply.d.ts.map +1 -0
- package/dist/types/src/testing/sleep.d.ts +6 -0
- package/dist/types/src/testing/sleep.d.ts.map +1 -0
- package/dist/types/src/umbrella.test.d.ts +2 -0
- package/dist/types/src/umbrella.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -47
- package/src/Blueprint.ts +224 -0
- package/src/Credential.ts +53 -0
- package/src/Header.test.ts +132 -0
- package/src/Header.ts +38 -0
- package/src/LayerSpec.ts +91 -0
- package/src/McpServer.ts +44 -0
- package/src/Operation.ts +646 -0
- package/src/OperationHandlerSet.test.ts +97 -0
- package/src/OperationHandlerSet.ts +181 -0
- package/src/OperationRegistry.ts +50 -0
- package/src/Process.ts +541 -0
- package/src/Routine.ts +68 -0
- package/src/Script.ts +33 -0
- package/src/ServiceResolver.ts +200 -0
- package/src/StorageService.ts +101 -0
- package/src/Template.test.ts +164 -0
- package/src/Template.ts +125 -0
- package/src/Trace.ts +363 -0
- package/src/Trigger.ts +196 -0
- package/src/TriggerEvent.ts +64 -0
- package/src/errors.ts +71 -0
- package/src/index.ts +19 -32
- package/src/testing/definitions.ts +51 -0
- package/src/testing/fib.ts +22 -0
- package/src/testing/index.ts +13 -4
- package/src/testing/reply.ts +18 -0
- package/src/testing/sleep.ts +16 -0
- package/src/umbrella.test.ts +51 -0
- package/dist/lib/browser/chunk-X2FWMHD4.mjs +0 -3107
- package/dist/lib/browser/chunk-X2FWMHD4.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -55
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/testing/index.mjs +0 -176
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RP7HSSCA.mjs +0 -3109
- package/dist/lib/node-esm/chunk-RP7HSSCA.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -56
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/testing/index.mjs +0 -177
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/types/src/compute-graph-registry.d.ts +0 -34
- package/dist/types/src/compute-graph-registry.d.ts.map +0 -1
- package/dist/types/src/compute-graph.d.ts +0 -64
- package/dist/types/src/compute-graph.d.ts.map +0 -1
- package/dist/types/src/compute-graph.test.d.ts +0 -2
- package/dist/types/src/compute-graph.test.d.ts.map +0 -1
- package/dist/types/src/compute-node.d.ts +0 -25
- package/dist/types/src/compute-node.d.ts.map +0 -1
- package/dist/types/src/functions/async-function.d.ts +0 -66
- package/dist/types/src/functions/async-function.d.ts.map +0 -1
- package/dist/types/src/functions/edge-function.d.ts +0 -20
- package/dist/types/src/functions/edge-function.d.ts.map +0 -1
- package/dist/types/src/functions/function-defs.d.ts +0 -11
- package/dist/types/src/functions/function-defs.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/hyperformula.test.d.ts +0 -2
- package/dist/types/src/hyperformula.test.d.ts.map +0 -1
- package/dist/types/src/testing/test-builder.d.ts +0 -15
- package/dist/types/src/testing/test-builder.d.ts.map +0 -1
- package/dist/types/src/testing/test-plugin.d.ts +0 -36
- package/dist/types/src/testing/test-plugin.d.ts.map +0 -1
- package/dist/types/src/testing/util.d.ts +0 -2
- package/dist/types/src/testing/util.d.ts.map +0 -1
- package/dist/types/src/types/hyperformula.d.ts +0 -11
- package/dist/types/src/types/hyperformula.d.ts.map +0 -1
- package/dist/types/src/types/index.d.ts +0 -3
- package/dist/types/src/types/index.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -20
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/dist/types/src/types/types.test.d.ts +0 -2
- package/dist/types/src/types/types.test.d.ts.map +0 -1
- package/dist/types/src/util.d.ts +0 -2
- package/dist/types/src/util.d.ts.map +0 -1
- package/dist/vendor/hyperformula.mjs +0 -36400
- package/src/compute-graph-registry.ts +0 -91
- package/src/compute-graph.test.ts +0 -89
- package/src/compute-graph.ts +0 -260
- package/src/compute-node.ts +0 -62
- package/src/functions/async-function.ts +0 -179
- package/src/functions/edge-function.ts +0 -112
- package/src/functions/function-defs.ts +0 -2427
- package/src/functions/index.ts +0 -7
- package/src/hyperformula.test.ts +0 -14
- package/src/testing/test-builder.ts +0 -54
- package/src/testing/test-plugin.ts +0 -101
- package/src/testing/util.ts +0 -9
- package/src/types/hyperformula.ts +0 -19
- package/src/types/index.ts +0 -6
- package/src/types/types.test.ts +0 -91
- package/src/types/types.ts +0 -80
- package/src/util.ts +0 -8
- /package/dist/lib/{browser/index.mjs.map → neutral/StorageService.mjs.map} +0 -0
- /package/dist/lib/{node-esm/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2022 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 DXOS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
1
|
# @dxos/compute
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Umbrella package for AI-aware DXOS compute primitives.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Importing from `@dxos/compute` is equivalent to importing from the underlying
|
|
8
|
+
source packages. Namespaces preserve their nesting — there is no extra wrapping
|
|
9
|
+
or unwrapping:
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { Blueprint, Operation, Routine, Process, Script, Trace, Trigger } from '@dxos/compute';
|
|
13
|
+
|
|
14
|
+
Blueprint.make({ /* ... */ });
|
|
15
|
+
Operation.lazy(() => /* ... */);
|
|
16
|
+
Trace.write(Trace.OperationStart, { /* ... */ });
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This single surface subsumes:
|
|
20
|
+
|
|
21
|
+
| Re-exported from | Includes |
|
|
22
|
+
| ------------------ | --------------------------------------------------------------- |
|
|
23
|
+
| `@dxos/operation` | `Operation`, `OperationInvoker`, `OperationHandlerSet`, `OperationRegistry`, errors |
|
|
24
|
+
| `@dxos/blueprints` | `Blueprint`, `Routine`, `Template` |
|
|
25
|
+
| `@dxos/functions` | `Process`, `Trigger`, `TriggerEvent`, `Script`, `Trace`, `ServiceResolver`, `StorageService`, `CredentialsService`, `ExampleHandlers`, services, errors, sdk |
|
|
26
|
+
|
|
27
|
+
The HyperFormula-based compute graph that previously lived here moved to
|
|
28
|
+
[`@dxos/compute-hyperformula`](../compute-hyperformula).
|
|
29
|
+
|
|
30
|
+
## Roadmap
|
|
31
|
+
|
|
32
|
+
- Stage 1 (current): re-exports — consumers depend only on `@dxos/compute`
|
|
33
|
+
while the source packages stay in place.
|
|
34
|
+
- Stage 2: migrate source into `@dxos/compute` and remove
|
|
35
|
+
`@dxos/operation`, `@dxos/blueprints`, and `@dxos/functions`.
|
|
36
|
+
- A companion `@dxos/compute-runtime-local` package will host the local
|
|
37
|
+
implementations of the services defined here (currently in
|
|
38
|
+
`@dxos/functions-runtime`).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StorageService,
|
|
3
|
+
clear,
|
|
4
|
+
deleteKey,
|
|
5
|
+
get,
|
|
6
|
+
key,
|
|
7
|
+
list,
|
|
8
|
+
set,
|
|
9
|
+
withDefault
|
|
10
|
+
} from "./chunk-XEVFBI6S.mjs";
|
|
11
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
12
|
+
export {
|
|
13
|
+
StorageService,
|
|
14
|
+
clear,
|
|
15
|
+
deleteKey,
|
|
16
|
+
get,
|
|
17
|
+
key,
|
|
18
|
+
list,
|
|
19
|
+
set,
|
|
20
|
+
withDefault
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=StorageService.mjs.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Sleep
|
|
3
|
+
} from "./chunk-JAU4E4EK.mjs";
|
|
4
|
+
import {
|
|
5
|
+
withHandler
|
|
6
|
+
} from "./chunk-QZS4G6PE.mjs";
|
|
7
|
+
|
|
8
|
+
// src/testing/sleep.ts
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
|
+
var sleep_default = Sleep.pipe(withHandler(Effect.fn(function* ({ duration = 1e5 }) {
|
|
11
|
+
yield* Effect.sleep(duration);
|
|
12
|
+
})));
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
sleep_default
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-2B2KSJT6.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/testing/sleep.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Operation from '../Operation';\nimport { Sleep } from './definitions';\n\nexport default Sleep.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ duration = 100_000 }) {\n yield* Effect.sleep(duration);\n }),\n ),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAKxB,IAAA,gBAAeC,MAAMC,KACTC,YACDC,UAAG,WAAW,EAAEC,WAAW,IAAO,GAAE;AACzC,SAAcC,aAAMD,QAAAA;AACtB,CAAA,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Sleep", "pipe", "withHandler", "fn", "duration", "sleep"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Fibonacci
|
|
3
|
+
} from "./chunk-JAU4E4EK.mjs";
|
|
4
|
+
import {
|
|
5
|
+
withHandler
|
|
6
|
+
} from "./chunk-QZS4G6PE.mjs";
|
|
7
|
+
|
|
8
|
+
// src/testing/fib.ts
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
|
+
var fib_default = Fibonacci.pipe(withHandler(Effect.fn(function* ({ iterations = 1e5 }) {
|
|
11
|
+
let a = 0n;
|
|
12
|
+
let b = 1n;
|
|
13
|
+
for (let i = 0; i < iterations; i++) {
|
|
14
|
+
a += b;
|
|
15
|
+
b = a - b;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
result: a.toString()
|
|
19
|
+
};
|
|
20
|
+
})));
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
fib_default
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=chunk-AFBNVFAY.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/testing/fib.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Operation from '../Operation';\nimport { Fibonacci } from './definitions';\n\nexport default Fibonacci.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ iterations = 100_000 }) {\n let a = 0n;\n let b = 1n;\n for (let i = 0; i < iterations; i++) {\n a += b;\n b = a - b;\n }\n return { result: a.toString() };\n }),\n ),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAKxB,IAAA,cAAeC,UAAUC,KACbC,YACDC,UAAG,WAAW,EAAEC,aAAa,IAAO,GAAE;AAC3C,MAAIC,IAAI;AACR,MAAIC,IAAI;AACR,WAASC,IAAI,GAAGA,IAAIH,YAAYG,KAAK;AACnCF,SAAKC;AACLA,QAAID,IAAIC;EACV;AACA,SAAO;IAAEE,QAAQH,EAAEI,SAAQ;EAAG;AAChC,CAAA,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Fibonacci", "pipe", "withHandler", "fn", "iterations", "a", "b", "i", "result", "toString"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
make
|
|
3
|
+
} from "./chunk-QZS4G6PE.mjs";
|
|
4
|
+
|
|
5
|
+
// src/testing/definitions.ts
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import { DXN } from "@dxos/keys";
|
|
8
|
+
var Fibonacci = make({
|
|
9
|
+
meta: {
|
|
10
|
+
key: DXN.make("org.example.function.fib"),
|
|
11
|
+
name: "Fibonacci",
|
|
12
|
+
description: "Function that calculates a Fibonacci number"
|
|
13
|
+
},
|
|
14
|
+
input: Schema.Struct({
|
|
15
|
+
iterations: Schema.optional(Schema.Number).annotations({
|
|
16
|
+
description: "Number of iterations",
|
|
17
|
+
default: 1e5
|
|
18
|
+
})
|
|
19
|
+
}),
|
|
20
|
+
output: Schema.Struct({
|
|
21
|
+
result: Schema.String
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
var Reply = make({
|
|
25
|
+
meta: {
|
|
26
|
+
key: DXN.make("org.example.function.reply"),
|
|
27
|
+
name: "Reply",
|
|
28
|
+
description: "Function that echoes the input"
|
|
29
|
+
},
|
|
30
|
+
input: Schema.Any,
|
|
31
|
+
output: Schema.Any
|
|
32
|
+
});
|
|
33
|
+
var Sleep = make({
|
|
34
|
+
meta: {
|
|
35
|
+
key: DXN.make("org.example.function.sleep"),
|
|
36
|
+
name: "Sleep",
|
|
37
|
+
description: "Function that sleeps for a given amount of time"
|
|
38
|
+
},
|
|
39
|
+
input: Schema.Struct({
|
|
40
|
+
duration: Schema.optional(Schema.Number).annotations({
|
|
41
|
+
description: "Milliseconds to sleep",
|
|
42
|
+
default: 1e5
|
|
43
|
+
})
|
|
44
|
+
}),
|
|
45
|
+
output: Schema.Void
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
Fibonacci,
|
|
50
|
+
Reply,
|
|
51
|
+
Sleep
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=chunk-JAU4E4EK.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/testing/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { DXN } from '@dxos/keys';\n\nimport * as Operation from '../Operation';\n\nexport const Fibonacci = Operation.make({\n meta: {\n key: DXN.make('org.example.function.fib'),\n name: 'Fibonacci',\n description: 'Function that calculates a Fibonacci number',\n },\n input: Schema.Struct({\n iterations: Schema.optional(Schema.Number).annotations({\n description: 'Number of iterations',\n default: 100_000,\n }),\n }),\n output: Schema.Struct({\n result: Schema.String,\n }),\n});\n\nexport const Reply = Operation.make({\n meta: {\n key: DXN.make('org.example.function.reply'),\n name: 'Reply',\n description: 'Function that echoes the input',\n },\n input: Schema.Any,\n output: Schema.Any,\n});\n\nexport const Sleep = Operation.make({\n meta: {\n key: DXN.make('org.example.function.sleep'),\n name: 'Sleep',\n description: 'Function that sleeps for a given amount of time',\n },\n input: Schema.Struct({\n duration: Schema.optional(Schema.Number).annotations({\n description: 'Milliseconds to sleep',\n default: 100_000,\n }),\n }),\n output: Schema.Void,\n});\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,WAAW;AAIb,IAAMC,YAAsBC,KAAK;EACtCC,MAAM;IACJC,KAAKC,IAAIH,KAAK,0BAAA;IACdI,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBC,YAAmBC,gBAAgBC,aAAM,EAAEC,YAAY;MACrDN,aAAa;MACbO,SAAS;IACX,CAAA;EACF,CAAA;EACAC,QAAeN,cAAO;IACpBO,QAAeC;EACjB,CAAA;AACF,CAAA;AAEO,IAAMC,QAAkBhB,KAAK;EAClCC,MAAM;IACJC,KAAKC,IAAIH,KAAK,4BAAA;IACdI,MAAM;IACNC,aAAa;EACf;EACAC,OAAcW;EACdJ,QAAeI;AACjB,CAAA;AAEO,IAAMC,QAAkBlB,KAAK;EAClCC,MAAM;IACJC,KAAKC,IAAIH,KAAK,4BAAA;IACdI,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBY,UAAiBV,gBAAgBC,aAAM,EAAEC,YAAY;MACnDN,aAAa;MACbO,SAAS;IACX,CAAA;EACF,CAAA;EACAC,QAAeO;AACjB,CAAA;",
|
|
6
|
+
"names": ["Schema", "DXN", "Fibonacci", "make", "meta", "key", "DXN", "name", "description", "input", "Struct", "iterations", "optional", "Number", "annotations", "default", "output", "result", "String", "Reply", "Any", "Sleep", "duration", "Void"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Reply
|
|
3
|
+
} from "./chunk-JAU4E4EK.mjs";
|
|
4
|
+
import {
|
|
5
|
+
withHandler
|
|
6
|
+
} from "./chunk-QZS4G6PE.mjs";
|
|
7
|
+
|
|
8
|
+
// src/testing/reply.ts
|
|
9
|
+
import * as Console from "effect/Console";
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
var reply_default = Reply.pipe(withHandler(Effect.fn(function* (input) {
|
|
12
|
+
yield* Console.log("reply", {
|
|
13
|
+
input
|
|
14
|
+
});
|
|
15
|
+
return input;
|
|
16
|
+
})));
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
reply_default
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=chunk-MEPE4HHX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/testing/reply.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport * as Operation from '../Operation';\nimport { Reply } from './definitions';\n\nexport default Reply.pipe(\n Operation.withHandler(\n Effect.fn(function* (input) {\n yield* Console.log('reply', { input });\n return input;\n }),\n ),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,YAAYA,aAAa;AACzB,YAAYC,YAAY;AAKxB,IAAA,gBAAeC,MAAMC,KACTC,YACDC,UAAG,WAAWC,OAAK;AACxB,SAAeC,YAAI,SAAS;IAAED;EAAM,CAAA;AACpC,SAAOA;AACT,CAAA,CAAA,CAAA;",
|
|
6
|
+
"names": ["Console", "Effect", "Reply", "pipe", "withHandler", "fn", "input", "log"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
4
|
+
|
|
5
|
+
// src/Operation.ts
|
|
6
|
+
var Operation_exports = {};
|
|
7
|
+
__export(Operation_exports, {
|
|
8
|
+
DefinitionTypeId: () => DefinitionTypeId,
|
|
9
|
+
IdempotentAnnotation: () => IdempotentAnnotation,
|
|
10
|
+
PersistentOperation: () => PersistentOperation,
|
|
11
|
+
PersistentOperation_v0_1_0: () => PersistentOperation_v0_1_0,
|
|
12
|
+
Service: () => Service,
|
|
13
|
+
deserialize: () => deserialize,
|
|
14
|
+
getKey: () => getKey,
|
|
15
|
+
getVersion: () => getVersion,
|
|
16
|
+
invoke: () => invoke,
|
|
17
|
+
isIdempotent: () => isIdempotent,
|
|
18
|
+
isOperationDefinition: () => isOperationDefinition,
|
|
19
|
+
isOperationWithHandler: () => isOperationWithHandler,
|
|
20
|
+
make: () => make,
|
|
21
|
+
migrations: () => migrations,
|
|
22
|
+
opaqueHandler: () => opaqueHandler,
|
|
23
|
+
schedule: () => schedule,
|
|
24
|
+
serialize: () => serialize,
|
|
25
|
+
setFrom: () => setFrom,
|
|
26
|
+
withHandler: () => withHandler,
|
|
27
|
+
withInvocationOptions: () => withInvocationOptions
|
|
28
|
+
});
|
|
29
|
+
import * as Context from "effect/Context";
|
|
30
|
+
import * as Effect from "effect/Effect";
|
|
31
|
+
import * as Layer from "effect/Layer";
|
|
32
|
+
import * as Option from "effect/Option";
|
|
33
|
+
import * as Pipeable from "effect/Pipeable";
|
|
34
|
+
import * as Schema$ from "effect/Schema";
|
|
35
|
+
import { DXN, Annotation, JsonSchema, Migration, Obj, Ref, Type } from "@dxos/echo";
|
|
36
|
+
var DefinitionTypeId = "~@dxos/operation/OperationDefinition";
|
|
37
|
+
var isOperationDefinition = (value) => {
|
|
38
|
+
return typeof value === "object" && value !== null && DefinitionTypeId in value;
|
|
39
|
+
};
|
|
40
|
+
var isOperationWithHandler = (value) => {
|
|
41
|
+
return isOperationDefinition(value) && "handler" in value;
|
|
42
|
+
};
|
|
43
|
+
var make = (props) => {
|
|
44
|
+
return {
|
|
45
|
+
[DefinitionTypeId]: {},
|
|
46
|
+
...props,
|
|
47
|
+
executionMode: props.executionMode ?? "async",
|
|
48
|
+
types: props.types ?? [],
|
|
49
|
+
services: props.services ?? [],
|
|
50
|
+
pipe() {
|
|
51
|
+
return Pipeable.pipeArguments(this, arguments);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
var withHandler = (opOrHandler, handler) => {
|
|
56
|
+
if (handler === void 0) {
|
|
57
|
+
const handlerFn = opOrHandler;
|
|
58
|
+
return (op2) => ({
|
|
59
|
+
...op2,
|
|
60
|
+
handler: handlerFn
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
const op = opOrHandler;
|
|
64
|
+
return {
|
|
65
|
+
...op,
|
|
66
|
+
handler
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
var opaqueHandler = (handler) => handler;
|
|
70
|
+
var PersistentOperation = Schema$.Struct({
|
|
71
|
+
name: Schema$.NonEmptyString,
|
|
72
|
+
description: Schema$.optional(Schema$.String),
|
|
73
|
+
/**
|
|
74
|
+
* ISO date string of the last deployment.
|
|
75
|
+
*/
|
|
76
|
+
updated: Schema$.optional(Schema$.String),
|
|
77
|
+
// Reference to a source script if it exists within ECHO.
|
|
78
|
+
// TODO(burdon): Don't ref ScriptType directly (core).
|
|
79
|
+
source: Schema$.optional(Ref.Ref(Obj.Unknown)),
|
|
80
|
+
inputSchema: Schema$.optional(JsonSchema.JsonSchema),
|
|
81
|
+
outputSchema: Schema$.optional(JsonSchema.JsonSchema),
|
|
82
|
+
/**
|
|
83
|
+
* List of required services.
|
|
84
|
+
* Match the Context.Tag keys of the FunctionServices variants.
|
|
85
|
+
*/
|
|
86
|
+
services: Schema$.optional(Schema$.Array(Schema$.String)),
|
|
87
|
+
// Local binding to a function name.
|
|
88
|
+
// TODO(dmaretskyi): Add this field to Operation.Definition.
|
|
89
|
+
binding: Schema$.optional(Schema$.String),
|
|
90
|
+
/**
|
|
91
|
+
* Phosphor icon identifier in `ph--<name>--<variant>` format (e.g. `ph--file-text--regular`).
|
|
92
|
+
*/
|
|
93
|
+
icon: Schema$.optional(Schema$.String)
|
|
94
|
+
}).pipe(
|
|
95
|
+
Annotation.LabelAnnotation.set([
|
|
96
|
+
"name"
|
|
97
|
+
]),
|
|
98
|
+
Annotation.IconAnnotation.set({
|
|
99
|
+
icon: "ph--function--regular",
|
|
100
|
+
hue: "blue"
|
|
101
|
+
}),
|
|
102
|
+
Annotation.HiddenAnnotation.set(true),
|
|
103
|
+
// TODO(dmaretskyi): Keep typename as 'org.dxos.type.function' (not 'operation') to maintain
|
|
104
|
+
// backward compatibility with existing data and avoid requiring data migration.
|
|
105
|
+
Type.makeObject(DXN.make("org.dxos.type.function", "0.2.0"))
|
|
106
|
+
);
|
|
107
|
+
var FUNCTION_META_KEY = "org.dxos.service.function";
|
|
108
|
+
var getKey = (record) => Obj.getMeta(record).key;
|
|
109
|
+
var getVersion = (record) => Obj.getMeta(record).version;
|
|
110
|
+
var serialize = (operation) => {
|
|
111
|
+
return Obj.make(PersistentOperation, {
|
|
112
|
+
[Obj.Meta]: {
|
|
113
|
+
key: operation.meta.key,
|
|
114
|
+
version: operation.meta.version ?? "0.0.0",
|
|
115
|
+
keys: operation.meta.deployedId ? [
|
|
116
|
+
{
|
|
117
|
+
source: FUNCTION_META_KEY,
|
|
118
|
+
id: operation.meta.deployedId
|
|
119
|
+
}
|
|
120
|
+
] : [],
|
|
121
|
+
annotations: operation.meta.annotations
|
|
122
|
+
},
|
|
123
|
+
name: operation.meta.name ?? "",
|
|
124
|
+
description: operation.meta.description,
|
|
125
|
+
icon: operation.meta.icon,
|
|
126
|
+
updated: void 0,
|
|
127
|
+
source: void 0,
|
|
128
|
+
inputSchema: JsonSchema.toJsonSchema(operation.input),
|
|
129
|
+
outputSchema: JsonSchema.toJsonSchema(operation.output),
|
|
130
|
+
services: operation.services.map((service) => service.key)
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
var deserialize = (record) => {
|
|
134
|
+
const meta = Obj.getMeta(record);
|
|
135
|
+
const deployedId = meta.keys.find((key) => key.source === FUNCTION_META_KEY)?.id;
|
|
136
|
+
return make({
|
|
137
|
+
input: record.inputSchema ? JsonSchema.toEffectSchema(record.inputSchema) : Schema$.Unknown,
|
|
138
|
+
output: record.outputSchema ? JsonSchema.toEffectSchema(record.outputSchema) : Schema$.Unknown,
|
|
139
|
+
services: record.services?.map((service) => Context.GenericTag(service)) ?? [],
|
|
140
|
+
executionMode: "async",
|
|
141
|
+
types: [],
|
|
142
|
+
meta: {
|
|
143
|
+
key: DXN.tryMake(meta.key ?? record.name) ?? DXN.make(meta.key ?? record.name),
|
|
144
|
+
name: record.name,
|
|
145
|
+
version: meta.version ?? "0.0.0",
|
|
146
|
+
description: record.description,
|
|
147
|
+
icon: record.icon,
|
|
148
|
+
deployedId,
|
|
149
|
+
annotations: meta.annotations ?? {}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
var setFrom = (target, source) => {
|
|
154
|
+
Obj.update(target, (target2) => {
|
|
155
|
+
target2.name = source.name ?? target2.name;
|
|
156
|
+
target2.description = source.description;
|
|
157
|
+
target2.icon = source.icon;
|
|
158
|
+
target2.updated = source.updated;
|
|
159
|
+
target2.inputSchema = source.inputSchema ? JSON.parse(JSON.stringify(source.inputSchema)) : void 0;
|
|
160
|
+
target2.outputSchema = source.outputSchema ? JSON.parse(JSON.stringify(source.outputSchema)) : void 0;
|
|
161
|
+
const sourceMeta = Obj.getMeta(source);
|
|
162
|
+
const targetMeta = Obj.getMeta(target2);
|
|
163
|
+
targetMeta.key = sourceMeta.key ?? targetMeta.key;
|
|
164
|
+
targetMeta.version = sourceMeta.version;
|
|
165
|
+
if (sourceMeta.keys.length > 0) {
|
|
166
|
+
targetMeta.keys = JSON.parse(JSON.stringify(sourceMeta.keys));
|
|
167
|
+
}
|
|
168
|
+
targetMeta.annotations = sourceMeta.annotations ?? targetMeta.annotations;
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
var IdempotentAnnotation = Annotation.make({
|
|
172
|
+
id: "org.dxos.operation.idempotent",
|
|
173
|
+
schema: Schema$.Boolean
|
|
174
|
+
});
|
|
175
|
+
var isIdempotent = (op) => op.meta.annotations ? Option.getOrElse(Annotation.getDictionary(op.meta.annotations, IdempotentAnnotation), () => false) : false;
|
|
176
|
+
var Service = class extends Context.Tag("@dxos/operation/Service")() {
|
|
177
|
+
};
|
|
178
|
+
var invoke = (op, ...args) => Effect.flatMap(Service, (ops) => ops.invoke(op, ...args)).pipe(Effect.withSpan("Operation.invoke"));
|
|
179
|
+
var schedule = (op, ...args) => Effect.flatMap(Service, (ops) => ops.schedule(op, ...args)).pipe(Effect.withSpan("Operation.schedule"));
|
|
180
|
+
var withInvocationOptions = (options) => Layer.effect(Service, Effect.gen(function* () {
|
|
181
|
+
const service = yield* Service;
|
|
182
|
+
return Service.of({
|
|
183
|
+
invoke: (op, input, invocationOptions) => service.invoke(op, input, {
|
|
184
|
+
...options,
|
|
185
|
+
...invocationOptions
|
|
186
|
+
}),
|
|
187
|
+
invokePromise: (op, input, invocationOptions) => service.invokePromise(op, input, {
|
|
188
|
+
...options,
|
|
189
|
+
...invocationOptions
|
|
190
|
+
}),
|
|
191
|
+
schedule: (op, input, invocationOptions) => service.schedule(op, input, {
|
|
192
|
+
...options,
|
|
193
|
+
...invocationOptions
|
|
194
|
+
})
|
|
195
|
+
});
|
|
196
|
+
}));
|
|
197
|
+
var PersistentOperation_v0_1_0 = Schema$.Struct({
|
|
198
|
+
key: Schema$.optional(Schema$.String),
|
|
199
|
+
name: Schema$.NonEmptyString,
|
|
200
|
+
version: Schema$.String,
|
|
201
|
+
description: Schema$.optional(Schema$.String),
|
|
202
|
+
updated: Schema$.optional(Schema$.String),
|
|
203
|
+
source: Schema$.optional(Ref.Ref(Obj.Unknown)),
|
|
204
|
+
inputSchema: Schema$.optional(JsonSchema.JsonSchema),
|
|
205
|
+
outputSchema: Schema$.optional(JsonSchema.JsonSchema),
|
|
206
|
+
services: Schema$.optional(Schema$.Array(Schema$.String)),
|
|
207
|
+
binding: Schema$.optional(Schema$.String)
|
|
208
|
+
}).pipe(Type.makeObject(DXN.make("org.dxos.type.function", "0.1.0")));
|
|
209
|
+
var _migration = Migration.define({
|
|
210
|
+
from: PersistentOperation_v0_1_0,
|
|
211
|
+
to: PersistentOperation,
|
|
212
|
+
transform: async (from) => ({
|
|
213
|
+
[Obj.Meta]: {
|
|
214
|
+
key: from.key,
|
|
215
|
+
version: from.version
|
|
216
|
+
},
|
|
217
|
+
name: from.name,
|
|
218
|
+
description: from.description,
|
|
219
|
+
updated: from.updated,
|
|
220
|
+
source: from.source,
|
|
221
|
+
inputSchema: from.inputSchema,
|
|
222
|
+
outputSchema: from.outputSchema,
|
|
223
|
+
services: from.services,
|
|
224
|
+
binding: from.binding
|
|
225
|
+
})
|
|
226
|
+
});
|
|
227
|
+
var migrations = [
|
|
228
|
+
_migration
|
|
229
|
+
];
|
|
230
|
+
|
|
231
|
+
export {
|
|
232
|
+
make,
|
|
233
|
+
withHandler,
|
|
234
|
+
PersistentOperation,
|
|
235
|
+
deserialize,
|
|
236
|
+
isIdempotent,
|
|
237
|
+
invoke,
|
|
238
|
+
Operation_exports
|
|
239
|
+
};
|
|
240
|
+
//# sourceMappingURL=chunk-QZS4G6PE.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/Operation.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\nimport * as Pipeable from 'effect/Pipeable';\nimport * as Schema$ from 'effect/Schema';\nimport type * as Types from 'effect/Types';\n\nimport { DXN, Annotation, JsonSchema, Migration, Obj, Ref, Type, type Key } from '@dxos/echo';\nimport type { URI } from '@dxos/keys';\n\nimport type { NoHandlerError } from './errors';\nimport type { Operation } from './index';\n\n/**\n * Schema type that accepts any Encoded form but requires no Context.\n * This allows ECHO object schemas where Type !== Encoded due to [KindId] symbol.\n */\ntype Schema<T> = Schema$.Schema<T, any, never>;\n\nexport const DefinitionTypeId = '~@dxos/operation/OperationDefinition' as const;\nexport type DefinitionTypeId = typeof DefinitionTypeId;\n\n/**\n * Serializable definition of an Operation.\n * Contains schema and metadata, but no runtime logic.\n */\nexport interface Definition<I, O, S = any> extends Pipeable.Pipeable, Definition.Variance<I, O, S> {\n /**\n * Input schema for the operation.\n */\n readonly input: Schema<I>;\n /**\n * Output schema for the operation.\n */\n readonly output: Schema<O>;\n\n readonly meta: {\n readonly key: DXN.DXN;\n readonly name?: string;\n readonly version?: string;\n readonly description?: string;\n /**\n * Phosphor icon identifier in `ph--<name>--<variant>` format (e.g. `ph--file-text--regular`).\n */\n readonly icon?: string;\n /**\n * Deployment ID for remote invocation.\n * Assigned by the EDGE function service when deployed.\n */\n readonly deployedId?: string;\n\n /**\n * Dictionary of annotations for the operation.\n */\n // TODO(dmaretskyi): Make required, but this complicates `make` to fill in defaults.\n readonly annotations?: Annotation.Dictionary;\n\n /**\n * When true, this operation is not serialized into the hypergraph registry.\n * Use for UI-only operations that should not be discoverable by the AI agent.\n */\n readonly skipRegistry?: boolean;\n };\n\n /**\n * Execution mode for the operation.\n * - 'sync': Operation completes synchronously (fast, UI-blocking acceptable).\n * - 'async': Operation may take time (should not block UI).\n */\n readonly executionMode: 'sync' | 'async';\n\n /**\n * ECHO types the operation uses.\n * Ensures types are available when the operation is executed remotely.\n */\n readonly types: readonly Type.AnyEntity[];\n\n /**\n * Effect services required by this operation.\n * These services will be automatically provided to the handler at invocation time.\n */\n readonly services: readonly Context.Tag<any, any>[];\n}\n\n/**\n * Namespace for OperationDefinition helper types.\n */\nexport declare namespace Definition {\n export interface Variance<I, O, S> {\n [DefinitionTypeId]: {\n readonly _Input: Types.Contravariant<I>;\n readonly _Output: Types.Covariant<O>;\n readonly _Services: Types.Covariant<S>;\n };\n }\n\n /**\n * Any operation definition, regardless of input/output types.\n */\n export type Any = Definition<any, any, any>;\n\n /**\n * Extract the input type from an operation definition.\n */\n export type Input<T extends Any> = T extends Variance<infer I, infer _O, infer _S> ? I : never;\n\n /**\n * Extract the output type from an operation definition.\n */\n export type Output<T extends Any> = T extends Variance<infer _I, infer O, infer _S> ? O : never;\n\n /**\n * Extract the service identifier types from an operation's services array.\n * Returns `never` if the operation has no services declared.\n */\n export type Services<T extends Any> = T extends Variance<infer _I, infer _O, infer S> ? S : never;\n\n export type HandlerType<T extends Any> =\n T extends Variance<infer I, infer O, infer S> ? Handler<I, O, any, S> : never;\n}\n\n/**\n * Runtime handler for an Operation.\n */\nexport type Handler<I, O, E = Error, R = never> = (input: I) => Effect.Effect<O, E, R>;\n\nexport type WithHandler<T extends Definition.Any> = T & {\n handler: Definition.HandlerType<T>;\n};\n\n/**\n * Checks if a value is an operation definition.\n */\nexport const isOperationDefinition = (value: unknown): value is Definition.Any => {\n return typeof value === 'object' && value !== null && DefinitionTypeId in value;\n};\n\n/**\n * Checks if a value is an operation with a handler.\n */\nexport const isOperationWithHandler = (value: unknown): value is WithHandler<Definition.Any> => {\n return isOperationDefinition(value) && 'handler' in value;\n};\n\n/**\n * Props for creating an Operation definition.\n * Derived from OperationDefinition with executionMode made optional (defaults to 'async').\n */\nexport type Props<I, O> = Omit<Definition<I, O>, DefinitionTypeId | 'pipe' | 'executionMode' | 'types' | 'services'> & {\n readonly executionMode?: 'sync' | 'async';\n readonly types?: Definition<I, O>['types'];\n readonly services?: Definition<I, O>['services'];\n};\n\n/**\n * Creates a new Operation definition.\n * Applies default executionMode of 'async' if not specified.\n * The returned type preserves the literal types of props (including services).\n */\nexport const make = <const P extends Types.NoExcessProperties<Props<any, any>, P>>(\n props: P,\n): Definition<\n Schema$.Schema.Type<P['input']>,\n Schema$.Schema.Type<P['output']>,\n Context.Tag.Identifier<NonNullable<P['services']>[number]>\n> => {\n return {\n [DefinitionTypeId]: {},\n ...props,\n executionMode: props.executionMode ?? 'async',\n types: props.types ?? [],\n services: props.services ?? [],\n pipe() {\n // eslint-disable-next-line prefer-rest-params\n return Pipeable.pipeArguments(this, arguments);\n },\n } as any;\n};\n\n/**\n * Attaches a handler to an Operation definition.\n * The handler may use any services declared in the operation, plus Operation.Service (always available).\n * Dual API: can be called directly or used in a pipe.\n *\n * @example\n * ```ts\n * const MyOp = Operation.make({\n * input: Schema.Void,\n * output: Schema.Void,\n * meta: { key: 'my-op' },\n * services: [DatabaseService],\n * });\n *\n * // Direct call - handler can use DatabaseService\n * const op = Operation.withHandler(MyOp, (input) =>\n * Effect.gen(function* () {\n * const db = yield* DatabaseService;\n * return {};\n * }),\n * );\n *\n * // Piped call\n * const op = MyOp.pipe(Operation.withHandler((input) => Effect.succeed({})));\n * ```\n */\nexport const withHandler: {\n <Def extends Definition<any, any>, E = never>(\n handler: Handler<Definition.Input<Def>, Definition.Output<Def>, E, Definition.Services<Def> | Service>,\n ): (op: Def) => WithHandler<Def>;\n <Def extends Definition<any, any>, E = never>(\n op: Def,\n handler: Handler<Definition.Input<Def>, Definition.Output<Def>, E, Definition.Services<Def> | Service>,\n ): WithHandler<Def>;\n} = <Def extends Definition<any, any>, E = never>(\n opOrHandler: Def | Handler<Definition.Input<Def>, Definition.Output<Def>, E, Definition.Services<Def> | Service>,\n handler?: Handler<Definition.Input<Def>, Definition.Output<Def>, E, Definition.Services<Def> | Service>,\n): WithHandler<Def> => {\n // If called with just handler (piped usage).\n if (handler === undefined) {\n const handlerFn = opOrHandler as Handler<\n Definition.Input<Def>,\n Definition.Output<Def>,\n E,\n Definition.Services<Def> | Service\n >;\n return ((op: Def) => ({\n ...op,\n handler: handlerFn,\n })) as any;\n }\n\n // If called with both op and handler (direct usage).\n const op = opOrHandler as Def;\n return {\n ...op,\n handler,\n } as any;\n};\n\n/**\n * Helper to make the handler type opaque.\n * Workaround for TypeScript's inability to infer the handler type from the operation definition:\n * ```\n * error TS2742: The inferred type of 'default' cannot be named without a reference.\n * ```\n *\n * Most of the time the exact handler type is not needed.\n *\n * @example\n * ```ts\n * const MyOp = Operation.make({\n * input: Schema.Void,\n * output: Schema.Void,\n * meta: { key: 'my-op' },\n * services: [DatabaseService],\n * });\n *\n * export default MyOp.pipe(\n * Operation.withHandler(\n * Effect.fn(function* (input) {\n * return { result: 'ok' };\n * }),\n * ),\n * Operation.opaqueHandler,\n * );\n * ```\n */\nexport const opaqueHandler = <T extends Operation.Definition.Any>(\n handler: Operation.WithHandler<T>,\n): Operation.WithHandler<Operation.Definition.Any> => handler;\n\n//\n// Invocation Interfaces\n//\n\n/**\n * Local invocation of an operation.\n */\nexport type Invoke = <I, O, E>(op: Definition<I, O>, input: I) => Effect.Effect<O, E>;\n\n/**\n * Remote invocation of an operation.\n */\nexport type InvokeRemote = <I, O, E>(\n op: Definition<I, O>,\n input: I,\n options?: { timeout?: number },\n) => Effect.Effect<O, E>;\n\n/**\n * Database record of an operation.\n * The registry `key` and `version` live in the object meta — access via\n * `Obj.getMeta(record).key` and `Obj.getMeta(record).version`.\n */\nexport const PersistentOperation = Schema$.Struct({\n name: Schema$.NonEmptyString,\n\n description: Schema$.optional(Schema$.String),\n\n /**\n * ISO date string of the last deployment.\n */\n updated: Schema$.optional(Schema$.String),\n\n // Reference to a source script if it exists within ECHO.\n // TODO(burdon): Don't ref ScriptType directly (core).\n source: Schema$.optional(Ref.Ref(Obj.Unknown)),\n\n inputSchema: Schema$.optional(JsonSchema.JsonSchema),\n outputSchema: Schema$.optional(JsonSchema.JsonSchema),\n\n /**\n * List of required services.\n * Match the Context.Tag keys of the FunctionServices variants.\n */\n services: Schema$.optional(Schema$.Array(Schema$.String)),\n\n // Local binding to a function name.\n // TODO(dmaretskyi): Add this field to Operation.Definition.\n binding: Schema$.optional(Schema$.String),\n\n /**\n * Phosphor icon identifier in `ph--<name>--<variant>` format (e.g. `ph--file-text--regular`).\n */\n icon: Schema$.optional(Schema$.String),\n}).pipe(\n Annotation.LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({ icon: 'ph--function--regular', hue: 'blue' }),\n Annotation.HiddenAnnotation.set(true),\n // TODO(dmaretskyi): Keep typename as 'org.dxos.type.function' (not 'operation') to maintain\n // backward compatibility with existing data and avoid requiring data migration.\n Type.makeObject(DXN.make('org.dxos.type.function', '0.2.0')),\n);\nexport type PersistentOperation = Type.InstanceType<typeof PersistentOperation>;\n\nconst FUNCTION_META_KEY = 'org.dxos.service.function';\n\n/**\n * Get the registry key for a persistent operation record (from the object meta).\n */\nexport const getKey = (record: PersistentOperation): string | undefined => Obj.getMeta(record).key;\n\n/**\n * Get the registry version for a persistent operation record (from the object meta).\n */\nexport const getVersion = (record: PersistentOperation): string | undefined => Obj.getMeta(record).version;\n\n/**\n * Serialize an operation definition to a persistent operation record.\n */\nexport const serialize = (operation: Definition.Any): PersistentOperation => {\n return Obj.make(PersistentOperation, {\n [Obj.Meta]: {\n key: operation.meta.key,\n version: operation.meta.version ?? '0.0.0',\n keys: operation.meta.deployedId ? [{ source: FUNCTION_META_KEY, id: operation.meta.deployedId }] : [],\n annotations: operation.meta.annotations,\n },\n name: operation.meta.name ?? '',\n description: operation.meta.description,\n icon: operation.meta.icon,\n updated: undefined,\n source: undefined,\n inputSchema: JsonSchema.toJsonSchema(operation.input),\n outputSchema: JsonSchema.toJsonSchema(operation.output),\n services: operation.services.map((service) => service.key),\n });\n};\n\n/**\n * Deserialize a persistent operation record to an operation definition.\n */\nexport const deserialize = (record: PersistentOperation): Definition.Any => {\n const meta = Obj.getMeta(record);\n // Extract deployed function ID from ECHO meta keys (matches FUNCTIONS_META_KEY in @dxos/functions).\n const deployedId = meta.keys.find((key) => key.source === FUNCTION_META_KEY)?.id;\n return make({\n input: record.inputSchema ? JsonSchema.toEffectSchema(record.inputSchema) : Schema$.Unknown,\n output: record.outputSchema ? JsonSchema.toEffectSchema(record.outputSchema) : Schema$.Unknown,\n services: record.services?.map((service) => Context.GenericTag(service)) ?? [],\n executionMode: 'async',\n types: [],\n meta: {\n key: DXN.tryMake(meta.key ?? record.name) ?? DXN.make(meta.key ?? record.name),\n name: record.name,\n version: meta.version ?? '0.0.0',\n description: record.description,\n icon: record.icon,\n deployedId,\n annotations: meta.annotations ?? {},\n },\n });\n};\n\n/**\n * Update properties on the target operation record from the source operation record.\n */\nexport const setFrom = (target: PersistentOperation, source: PersistentOperation) => {\n Obj.update(target, (target) => {\n target.name = source.name ?? target.name;\n target.description = source.description;\n target.icon = source.icon;\n target.updated = source.updated;\n // TODO(dmaretskyi): A workaround for an ECHO bug.\n target.inputSchema = source.inputSchema ? JSON.parse(JSON.stringify(source.inputSchema)) : undefined;\n target.outputSchema = source.outputSchema ? JSON.parse(JSON.stringify(source.outputSchema)) : undefined;\n const sourceMeta = Obj.getMeta(source);\n const targetMeta = Obj.getMeta(target);\n targetMeta.key = sourceMeta.key ?? targetMeta.key;\n targetMeta.version = sourceMeta.version;\n // Only overwrite foreign keys when the source actually carries them; otherwise we'd wipe\n // bindings (e.g. the deployedId set by `deserialize`) on records produced by `serialize`.\n if (sourceMeta.keys.length > 0) {\n targetMeta.keys = JSON.parse(JSON.stringify(sourceMeta.keys));\n }\n targetMeta.annotations = sourceMeta.annotations ?? targetMeta.annotations;\n });\n};\n\n/**\n * Translatable label — a plain string or an i18next-style `[key, options]` tuple.\n * Defined locally to avoid a core dependency on UI translation packages; structurally compatible with\n * the app-level `Label` type so values flow into UI toasts unchanged.\n */\nexport type Label = string | [string, { ns: string | readonly string[]; count?: number; defaultValue?: string }];\n\n/**\n * Per-phase user notification messages for an invocation.\n * A phase is notified to the user iff its message is provided; messages are translatable {@link Label}s.\n */\nexport interface NotifyOptions {\n /** Shown when the invocation starts. */\n start?: Label;\n /** Shown when the invocation succeeds. */\n success?: Label;\n /** Shown when the invocation fails. */\n error?: Label;\n}\n\n/**\n * Options for operation invocation.\n */\nexport interface InvokeOptions {\n /**\n * Space ID to provide database context for the handler.\n */\n spaceId?: Key.SpaceId;\n /**\n * Request user-facing notifications at the given invocation phases.\n */\n notify?: NotifyOptions;\n /**\n * URI of the conversation feed (queue) — today always an EID, but typed as\n * `URI.URI` to accommodate future entity-kind extensions. Narrow with `EID.parse`\n * at the point of use.\n * Passed to the process environment so nested operations can resolve AiContext.Service and related services.\n */\n conversation?: URI.URI;\n /**\n * Optional process-runtime tracing metadata (consumed by `@dxos/functions-runtime` when wired).\n */\n tracing?: unknown;\n}\n\n/**\n * Annotation that marks an operation as idempotent — safe to retry even if a previous execution\n * was interrupted mid-handler. When absent the operation is treated as non-idempotent, and the\n * process runtime will fail (rather than re-run) any handler that was interrupted.\n */\nexport const IdempotentAnnotation = Annotation.make({\n id: 'org.dxos.operation.idempotent',\n schema: Schema$.Boolean,\n});\n\n/**\n * Returns true when the operation is explicitly annotated as idempotent.\n */\nexport const isIdempotent = (op: Definition.Any): boolean =>\n op.meta.annotations\n ? Option.getOrElse(Annotation.getDictionary(op.meta.annotations, IdempotentAnnotation), () => false)\n : false;\n\n/**\n * Operation service interface - provides unified access to operation invocation and scheduling.\n * This service is automatically provided to operation handlers.\n */\nexport interface OperationService {\n /**\n * Invoke an operation as an Effect.\n * Returns an Effect that resolves to the operation output.\n */\n invoke: <I, O>(\n op: Operation.Definition<I, O>,\n ...args: void extends I ? [input?: I, options?: InvokeOptions] : [input: I, options?: InvokeOptions]\n ) => Effect.Effect<O, NoHandlerError>;\n\n /**\n * Schedule an operation to run as a followup.\n * The followup is tracked and won't be cancelled when the parent operation completes.\n * Returns an Effect that completes immediately after scheduling.\n */\n schedule: <I, O>(\n op: Operation.Definition<I, O>,\n ...args: void extends I ? [input?: I, options?: InvokeOptions] : [input: I, options?: InvokeOptions]\n ) => Effect.Effect<void>;\n\n /**\n * Invoke an operation and return a Promise.\n * Useful for async contexts where Effect is not available.\n */\n invokePromise: <I, O>(\n op: Operation.Definition<I, O>,\n ...args: void extends I ? [input?: I, options?: InvokeOptions] : [input: I, options?: InvokeOptions]\n ) => Promise<{ data?: O; error?: Error }>;\n}\n\n/**\n * Context tag for the Operation service.\n * Operation handlers can yield this to invoke other operations or schedule followups.\n *\n * @example\n * ```ts\n * const handler = (input) => Effect.gen(function* () {\n * // Schedule a followup (fire and forget)\n * yield* Operation.schedule(AnalyticsOperation, { event: 'completed' });\n *\n * // Invoke another operation\n * return yield* Operation.invoke(OtherOperation, { data: input.data });\n * });\n * ```\n */\n// TODO(dmaretskyi): Rename Operation.Invoker\nexport class Service extends Context.Tag('@dxos/operation/Service')<Service, OperationService>() {}\n\n//\n// Namespace functions - ergonomic access to Operation.Service methods.\n//\n\n/**\n * Invoke an operation as an Effect.\n * Yields the Operation.Service internally.\n *\n * @example\n * ```ts\n * yield* Operation.invoke(MyOperation, { data: 'test' });\n * ```\n */\nexport const invoke = <I, O>(\n op: Operation.Definition<I, O>,\n ...args: void extends I ? [input?: I, options?: InvokeOptions] : [input: I, options?: InvokeOptions]\n): Effect.Effect<O, NoHandlerError, Service> =>\n Effect.flatMap(Service, (ops) => ops.invoke(op, ...(args as [I, InvokeOptions?]))).pipe(\n Effect.withSpan('Operation.invoke'),\n );\n\n/**\n * Schedule an operation to run as a followup.\n * Yields the Operation.Service internally.\n *\n * @example\n * ```ts\n * yield* Operation.schedule(AnalyticsOperation, { event: 'completed' });\n * yield* Operation.schedule(VoidOperation); // input optional when void\n * ```\n */\nexport const schedule = <I, O>(\n op: Operation.Definition<I, O>,\n ...args: void extends I ? [input?: I, options?: InvokeOptions] : [input: I, options?: InvokeOptions]\n): Effect.Effect<void, never, Service> =>\n Effect.flatMap(Service, (ops) => ops.schedule(op, ...(args as [I, InvokeOptions?]))).pipe(\n Effect.withSpan('Operation.schedule'),\n );\n\n/**\n * Provides additional invocation options to all invocations.\n */\nexport const withInvocationOptions = (options: InvokeOptions): Layer.Layer<Service, never, Service> =>\n Layer.effect(\n Service,\n Effect.gen(function* () {\n const service = yield* Service;\n return Service.of({\n invoke: ((op: Operation.Definition.Any, input: any, invocationOptions: InvokeOptions) =>\n service.invoke(op, input, { ...options, ...invocationOptions })) as any,\n invokePromise: ((op: Operation.Definition.Any, input: any, invocationOptions: InvokeOptions) =>\n service.invokePromise(op, input, { ...options, ...invocationOptions })) as any,\n schedule: ((op: Operation.Definition.Any, input: any, invocationOptions: InvokeOptions) =>\n service.schedule(op, input, { ...options, ...invocationOptions })) as any,\n });\n }),\n );\n\n//\n// Legacy schemas and migrations.\n//\n\n/**\n * Persistent operation schema v0.1.0 — `key` and `version` are stored as data properties.\n * @deprecated Use {@link PersistentOperation} (v0.2.0) instead; the `key` and `version` now live in the object meta.\n */\nexport const PersistentOperation_v0_1_0 = Schema$.Struct({\n key: Schema$.optional(Schema$.String),\n name: Schema$.NonEmptyString,\n version: Schema$.String,\n description: Schema$.optional(Schema$.String),\n updated: Schema$.optional(Schema$.String),\n source: Schema$.optional(Ref.Ref(Obj.Unknown)),\n inputSchema: Schema$.optional(JsonSchema.JsonSchema),\n outputSchema: Schema$.optional(JsonSchema.JsonSchema),\n services: Schema$.optional(Schema$.Array(Schema$.String)),\n binding: Schema$.optional(Schema$.String),\n}).pipe(Type.makeObject(DXN.make('org.dxos.type.function', '0.1.0')));\nexport type PersistentOperation_v0_1_0 = Type.InstanceType<typeof PersistentOperation_v0_1_0>;\n\n/**\n * Migration from {@link PersistentOperation_v0_1_0} (v0.1.0) to {@link PersistentOperation} (v0.2.0).\n * Moves `key` and `version` from the data section into the object meta.\n */\nconst _migration = Migration.define({\n from: PersistentOperation_v0_1_0,\n to: PersistentOperation,\n transform: async (from) => ({\n [Obj.Meta]: { key: from.key, version: from.version },\n name: from.name,\n description: from.description,\n updated: from.updated,\n source: from.source as any,\n inputSchema: from.inputSchema,\n outputSchema: from.outputSchema,\n services: from.services,\n binding: from.binding,\n }),\n});\n\n/**\n * Schema migrations exported by this module.\n * Exported as an array for extensibility — append future versions here.\n */\nexport const migrations = [_migration];\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;AAMA,YAAYA,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,cAAc;AAC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dwB,SAAiBrB;EACjBF,aAAqBC,iBAAiBC,cAAM;EAC5CC,SAAiBF,iBAAiBC,cAAM;EACxCE,QAAgBH,iBAAS1B,IAAIA,IAAID,IAAI+B,OAAO,CAAA;EAC5CC,aAAqBL,iBAAS7B,WAAWA,UAAU;EACnDmC,cAAsBN,iBAAS7B,WAAWA,UAAU;EACpDa,UAAkBgB,iBAAiBO,cAAcN,cAAM,CAAA;EACvDO,SAAiBR,iBAAiBC,cAAM;AAC1C,CAAA,EAAGhB,KAAKV,KAAKwC,WAAW9C,IAAIW,KAAK,0BAA0B,OAAA,CAAA,CAAA;AAO3D,IAAM4F,aAAapG,UAAUqG,OAAO;EAClCC,MAAMH;EACNI,IAAIhF;EACJiF,WAAW,OAAOF,UAAU;IAC1B,CAACrG,IAAIoD,IAAI,GAAG;MAAEL,KAAKsD,KAAKtD;MAAKE,SAASoD,KAAKpD;IAAQ;IACnDzB,MAAM6E,KAAK7E;IACXE,aAAa2E,KAAK3E;IAClBG,SAASwE,KAAKxE;IACdC,QAAQuE,KAAKvE;IACbE,aAAaqE,KAAKrE;IAClBC,cAAcoE,KAAKpE;IACnBtB,UAAU0F,KAAK1F;IACfwB,SAASkE,KAAKlE;EAChB;AACF,CAAA;AAMO,IAAMqE,aAAa;EAACL;;",
|
|
6
|
+
"names": ["Context", "Effect", "Layer", "Option", "Pipeable", "Schema$", "DXN", "Annotation", "JsonSchema", "Migration", "Obj", "Ref", "Type", "DefinitionTypeId", "isOperationDefinition", "value", "isOperationWithHandler", "make", "props", "executionMode", "types", "services", "pipe", "pipeArguments", "arguments", "withHandler", "opOrHandler", "handler", "undefined", "handlerFn", "op", "opaqueHandler", "PersistentOperation", "Struct", "name", "NonEmptyString", "description", "optional", "String", "updated", "source", "Unknown", "inputSchema", "outputSchema", "Array", "binding", "icon", "LabelAnnotation", "set", "IconAnnotation", "hue", "HiddenAnnotation", "makeObject", "FUNCTION_META_KEY", "getKey", "record", "getMeta", "key", "getVersion", "version", "serialize", "operation", "Meta", "meta", "keys", "deployedId", "id", "annotations", "toJsonSchema", "input", "output", "map", "service", "deserialize", "find", "toEffectSchema", "GenericTag", "tryMake", "setFrom", "target", "update", "JSON", "parse", "stringify", "sourceMeta", "targetMeta", "length", "IdempotentAnnotation", "schema", "Boolean", "isIdempotent", "getOrElse", "getDictionary", "Service", "Tag", "invoke", "args", "flatMap", "ops", "withSpan", "schedule", "withInvocationOptions", "options", "effect", "gen", "of", "invocationOptions", "invokePromise", "PersistentOperation_v0_1_0", "_migration", "define", "from", "to", "transform", "migrations"]
|
|
7
|
+
}
|