@dxos/compute 0.8.4-main.5ad4a44 → 0.8.4-main.60689f5b1c
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-AKVCVI6N.mjs +25 -0
- package/dist/lib/neutral/chunk-AKVCVI6N.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-LF2ANNYW.mjs +171 -0
- package/dist/lib/neutral/chunk-LF2ANNYW.mjs.map +7 -0
- package/dist/lib/neutral/chunk-LRCABAWU.mjs +17 -0
- package/dist/lib/neutral/chunk-LRCABAWU.mjs.map +7 -0
- package/dist/lib/neutral/chunk-RCLYF66G.mjs +21 -0
- package/dist/lib/neutral/chunk-RCLYF66G.mjs.map +7 -0
- package/dist/lib/neutral/chunk-SEBWOTOU.mjs +235 -0
- package/dist/lib/neutral/chunk-SEBWOTOU.mjs.map +7 -0
- package/dist/lib/neutral/chunk-VSICPGGY.mjs +53 -0
- package/dist/lib/neutral/chunk-VSICPGGY.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/fib-ZSJYREBW.mjs +10 -0
- package/dist/lib/neutral/fib-ZSJYREBW.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +1225 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/reply-YH3BVOUT.mjs +10 -0
- package/dist/lib/neutral/reply-YH3BVOUT.mjs.map +7 -0
- package/dist/lib/neutral/sleep-TSPIQ5EY.mjs +10 -0
- package/dist/lib/neutral/sleep-TSPIQ5EY.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 +192 -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/LayerSpec.d.ts +56 -0
- package/dist/types/src/LayerSpec.d.ts.map +1 -0
- package/dist/types/src/McpServer.d.ts +27 -0
- package/dist/types/src/McpServer.d.ts.map +1 -0
- package/dist/types/src/Operation.d.ts +340 -0
- package/dist/types/src/Operation.d.ts.map +1 -0
- package/dist/types/src/OperationHandlerSet.d.ts +67 -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 +247 -0
- package/dist/types/src/Process.d.ts.map +1 -0
- package/dist/types/src/Routine.d.ts +63 -0
- package/dist/types/src/Routine.d.ts.map +1 -0
- package/dist/types/src/Script.d.ts +22 -0
- package/dist/types/src/Script.d.ts.map +1 -0
- package/dist/types/src/ServiceResolver.d.ts +89 -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 +62 -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 +268 -0
- package/dist/types/src/Trace.d.ts.map +1 -0
- package/dist/types/src/Trigger.d.ts +150 -0
- package/dist/types/src/Trigger.d.ts.map +1 -0
- package/dist/types/src/TriggerEvent.d.ts +75 -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 +17 -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 -4
- 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 +29 -40
- package/src/Blueprint.ts +303 -0
- package/src/Credential.ts +53 -0
- package/src/LayerSpec.ts +91 -0
- package/src/McpServer.ts +44 -0
- package/src/Operation.ts +593 -0
- package/src/OperationHandlerSet.test.ts +92 -0
- package/src/OperationHandlerSet.ts +174 -0
- package/src/OperationRegistry.ts +50 -0
- package/src/Process.ts +504 -0
- package/src/Routine.ts +75 -0
- package/src/Script.ts +40 -0
- package/src/ServiceResolver.ts +194 -0
- package/src/StorageService.ts +101 -0
- package/src/Template.test.ts +151 -0
- package/src/Template.ts +122 -0
- package/src/Trace.ts +368 -0
- package/src/Trigger.ts +209 -0
- package/src/TriggerEvent.ts +64 -0
- package/src/errors.ts +71 -0
- package/src/index.ts +18 -32
- package/src/testing/definitions.ts +49 -0
- package/src/testing/fib.ts +22 -0
- package/src/testing/index.ts +13 -5
- 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-C7KLV2IU.mjs +0 -3144
- package/dist/lib/browser/chunk-C7KLV2IU.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 -206
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K37OSZ5O.mjs +0 -3146
- package/dist/lib/node-esm/chunk-K37OSZ5O.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 -207
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/types/src/compute-graph-registry.d.ts +0 -37
- package/dist/types/src/compute-graph-registry.d.ts.map +0 -1
- package/dist/types/src/compute-graph-registry.test.d.ts +0 -2
- package/dist/types/src/compute-graph-registry.test.d.ts.map +0 -1
- package/dist/types/src/compute-graph.d.ts +0 -67
- 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 -24
- package/dist/types/src/compute-node.d.ts.map +0 -1
- package/dist/types/src/functions/async-function.d.ts +0 -68
- 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 -35
- package/dist/types/src/testing/test-plugin.d.ts.map +0 -1
- package/dist/types/src/testing/test-runtime.d.ts +0 -10
- package/dist/types/src/testing/test-runtime.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 -8
- 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/src/compute-graph-registry.test.ts +0 -138
- package/src/compute-graph-registry.ts +0 -97
- package/src/compute-graph.test.ts +0 -88
- package/src/compute-graph.ts +0 -261
- package/src/compute-node.ts +0 -59
- package/src/functions/async-function.ts +0 -184
- package/src/functions/edge-function.ts +0 -114
- 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 -60
- package/src/testing/test-plugin.ts +0 -98
- package/src/testing/test-runtime.ts +0 -38
- 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,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Fibonacci
|
|
3
|
+
} from "./chunk-VSICPGGY.mjs";
|
|
4
|
+
import {
|
|
5
|
+
withHandler
|
|
6
|
+
} from "./chunk-SEBWOTOU.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-AKVCVI6N.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,171 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
4
|
+
|
|
5
|
+
// src/errors.ts
|
|
6
|
+
import { BaseError } from "@dxos/errors";
|
|
7
|
+
var InvokerNotInitializedError = class extends BaseError.extend("InvokerNotInitializedError", "Invoker not initialized") {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var NoHandlerError = class extends BaseError.extend("NoHandlerError", "No handler found for operation. ") {
|
|
13
|
+
constructor(operationKey) {
|
|
14
|
+
super({
|
|
15
|
+
context: {
|
|
16
|
+
operationKey
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var ServiceNotAvailableError = class extends BaseError.extend("ServiceNotAvailable", "Service not available") {
|
|
22
|
+
constructor(service, options) {
|
|
23
|
+
super({
|
|
24
|
+
context: {
|
|
25
|
+
service
|
|
26
|
+
},
|
|
27
|
+
...options,
|
|
28
|
+
message: `Service not available: ${service}`
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var FunctionNotFoundError = class extends BaseError.extend("FunctionNotFound", "Function not found") {
|
|
33
|
+
constructor(functionKey, options) {
|
|
34
|
+
super({
|
|
35
|
+
context: {
|
|
36
|
+
function: functionKey
|
|
37
|
+
},
|
|
38
|
+
...options
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var FunctionError = class extends BaseError.extend("FunctionError", "Function invocation error") {
|
|
43
|
+
};
|
|
44
|
+
var InvalidOperationInputError = class extends BaseError.extend("InvalidOperationInput", "Operation input did not match schema") {
|
|
45
|
+
};
|
|
46
|
+
var InvalidOperationOutputError = class extends BaseError.extend("InvalidOperationOutput", "Operation output did not match schema") {
|
|
47
|
+
};
|
|
48
|
+
var TriggerStateNotFoundError = class extends BaseError.extend("TriggerStateNotFound", "Trigger state not found") {
|
|
49
|
+
};
|
|
50
|
+
var FunctionsAiUpstreamError = class extends BaseError.extend("FunctionsAiUpstreamError", "Upstream AI service returned an error") {
|
|
51
|
+
};
|
|
52
|
+
var FunctionsAiMemoizationMissError = class extends BaseError.extend("FunctionsAiMemoizationMissError", "No memoized AI conversation found for the given cache key") {
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// src/OperationHandlerSet.ts
|
|
56
|
+
var OperationHandlerSet_exports = {};
|
|
57
|
+
__export(OperationHandlerSet_exports, {
|
|
58
|
+
OperationHandlerProvider: () => OperationHandlerProvider,
|
|
59
|
+
TypeId: () => TypeId,
|
|
60
|
+
async: () => async,
|
|
61
|
+
empty: () => empty,
|
|
62
|
+
getHandler: () => getHandler,
|
|
63
|
+
getHandlerByKey: () => getHandlerByKey,
|
|
64
|
+
isOperationHandlerSet: () => isOperationHandlerSet,
|
|
65
|
+
lazy: () => lazy,
|
|
66
|
+
make: () => make,
|
|
67
|
+
merge: () => merge,
|
|
68
|
+
provide: () => provide,
|
|
69
|
+
reactive: () => reactive
|
|
70
|
+
});
|
|
71
|
+
import * as Context from "effect/Context";
|
|
72
|
+
import * as Effect from "effect/Effect";
|
|
73
|
+
import { pipe } from "effect/Function";
|
|
74
|
+
import * as Layer from "effect/Layer";
|
|
75
|
+
import { runAndForwardErrors } from "@dxos/effect";
|
|
76
|
+
import { assertArgument } from "@dxos/invariant";
|
|
77
|
+
var TypeId = "~@dxos/operation/OperationHandlerSet";
|
|
78
|
+
var isOperationHandlerSet = (value) => {
|
|
79
|
+
return typeof value === "object" && value !== null && TypeId in value;
|
|
80
|
+
};
|
|
81
|
+
var empty = {
|
|
82
|
+
[TypeId]: TypeId,
|
|
83
|
+
handlers: Effect.succeed([]),
|
|
84
|
+
getHandlers: () => Promise.resolve([])
|
|
85
|
+
};
|
|
86
|
+
var make = (...handlers) => {
|
|
87
|
+
return async(() => Promise.resolve(handlers));
|
|
88
|
+
};
|
|
89
|
+
var async = (getHandlers) => {
|
|
90
|
+
let promise2 = null;
|
|
91
|
+
const getHandlersCached = () => {
|
|
92
|
+
if (!promise2) {
|
|
93
|
+
promise2 = getHandlers();
|
|
94
|
+
}
|
|
95
|
+
return promise2;
|
|
96
|
+
};
|
|
97
|
+
return {
|
|
98
|
+
[TypeId]: TypeId,
|
|
99
|
+
getHandlers,
|
|
100
|
+
handlers: Effect.promise(getHandlersCached)
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
var reactive = (registry, atom) => {
|
|
104
|
+
let cached = null;
|
|
105
|
+
registry.subscribe(atom, () => {
|
|
106
|
+
cached = null;
|
|
107
|
+
});
|
|
108
|
+
const compute = Effect.suspend(() => pipe(
|
|
109
|
+
registry.get(atom),
|
|
110
|
+
Effect.forEach((set) => set.handlers, {
|
|
111
|
+
concurrency: "unbounded"
|
|
112
|
+
}),
|
|
113
|
+
Effect.map((groups) => groups.flat()),
|
|
114
|
+
// Reset cached on failure so a transient error doesn't permanently
|
|
115
|
+
// poison subsequent calls.
|
|
116
|
+
Effect.tapErrorCause(() => Effect.sync(() => {
|
|
117
|
+
cached = null;
|
|
118
|
+
}))
|
|
119
|
+
));
|
|
120
|
+
const getHandlers = () => cached ??= runAndForwardErrors(compute);
|
|
121
|
+
return {
|
|
122
|
+
[TypeId]: TypeId,
|
|
123
|
+
getHandlers,
|
|
124
|
+
handlers: Effect.promise(getHandlers)
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
var merge = (...sets) => {
|
|
128
|
+
assertArgument(sets.every(isOperationHandlerSet), "sets", "sets must be an array of OperationHandlerSet");
|
|
129
|
+
return async(() => Promise.all(sets.map((set) => set.getHandlers())).then((handlers) => handlers.flat()));
|
|
130
|
+
};
|
|
131
|
+
var lazy = (...modules) => {
|
|
132
|
+
return async(() => Promise.all(modules.map((module) => module().then(({ default: handler }) => handler))));
|
|
133
|
+
};
|
|
134
|
+
var getHandler = (set, definition) => Effect.gen(function* () {
|
|
135
|
+
const handlers = yield* set.handlers;
|
|
136
|
+
const handler = handlers.find((handler2) => handler2.meta.key === definition.meta.key);
|
|
137
|
+
if (!handler) {
|
|
138
|
+
return yield* Effect.fail(new NoHandlerError(definition.meta.key));
|
|
139
|
+
}
|
|
140
|
+
return handler;
|
|
141
|
+
});
|
|
142
|
+
var getHandlerByKey = (set, key) => Effect.gen(function* () {
|
|
143
|
+
const handlers = yield* set.handlers;
|
|
144
|
+
const handler = handlers.find((handler2) => handler2.meta.key === key);
|
|
145
|
+
if (!handler) {
|
|
146
|
+
return yield* Effect.fail(new NoHandlerError(key));
|
|
147
|
+
}
|
|
148
|
+
return handler;
|
|
149
|
+
});
|
|
150
|
+
var OperationHandlerProvider = class extends Context.Tag("@dxos/operation/OperationHandlerProvider")() {
|
|
151
|
+
};
|
|
152
|
+
var provide = (handlers) => Layer.succeed(OperationHandlerProvider, handlers);
|
|
153
|
+
|
|
154
|
+
export {
|
|
155
|
+
InvokerNotInitializedError,
|
|
156
|
+
NoHandlerError,
|
|
157
|
+
ServiceNotAvailableError,
|
|
158
|
+
FunctionNotFoundError,
|
|
159
|
+
FunctionError,
|
|
160
|
+
InvalidOperationInputError,
|
|
161
|
+
InvalidOperationOutputError,
|
|
162
|
+
TriggerStateNotFoundError,
|
|
163
|
+
FunctionsAiUpstreamError,
|
|
164
|
+
FunctionsAiMemoizationMissError,
|
|
165
|
+
lazy,
|
|
166
|
+
getHandler,
|
|
167
|
+
getHandlerByKey,
|
|
168
|
+
OperationHandlerProvider,
|
|
169
|
+
OperationHandlerSet_exports
|
|
170
|
+
};
|
|
171
|
+
//# sourceMappingURL=chunk-LF2ANNYW.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/errors.ts", "../../../src/OperationHandlerSet.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { BaseError, type BaseErrorOptions } from '@dxos/errors';\n\n// Errors from @dxos/operation.\n\nexport class InvokerNotInitializedError extends BaseError.extend(\n 'InvokerNotInitializedError',\n 'Invoker not initialized',\n) {\n constructor() {\n super();\n }\n}\n\nexport class NoHandlerError extends BaseError.extend('NoHandlerError', 'No handler found for operation. ') {\n constructor(operationKey: string) {\n super({ context: { operationKey } });\n }\n}\n\n// Errors from @dxos/functions.\n\nexport class ServiceNotAvailableError extends BaseError.extend('ServiceNotAvailable', 'Service not available') {\n constructor(service: string, options?: Omit<BaseErrorOptions, 'context'>) {\n super({ context: { service }, ...options, message: `Service not available: ${service}` });\n }\n}\n\nexport class FunctionNotFoundError extends BaseError.extend('FunctionNotFound', 'Function not found') {\n constructor(functionKey: string, options?: Omit<BaseErrorOptions, 'context'>) {\n super({ context: { function: functionKey }, ...options });\n }\n}\n\nexport class FunctionError extends BaseError.extend('FunctionError', 'Function invocation error') {}\n\nexport class InvalidOperationInputError extends BaseError.extend(\n 'InvalidOperationInput',\n 'Operation input did not match schema',\n) {}\n\nexport class InvalidOperationOutputError extends BaseError.extend(\n 'InvalidOperationOutput',\n 'Operation output did not match schema',\n) {}\n\nexport class TriggerStateNotFoundError extends BaseError.extend('TriggerStateNotFound', 'Trigger state not found') {}\n\n/**\n * Raised when the upstream AI gateway responds with a structured JSON error envelope\n * (`{ \"type\": \"error\", \"error\": { \"type\": ..., \"message\": ... } }`). Surfaces as a typed\n * defect from `FunctionsAiHttpClient`, bypassing `@effect/ai`'s generic `HttpResponseError`\n * wrapping so callers can match on the error class directly.\n */\nexport class FunctionsAiUpstreamError extends BaseError.extend(\n 'FunctionsAiUpstreamError',\n 'Upstream AI service returned an error',\n) {}\n\n/**\n * Specialized `FunctionsAiUpstreamError` for the memoization layer: the recorded fixture for a\n * given cache key was not found and `ALLOW_LLM_GENERATION` is unset. The `cacheKey` is exposed\n * via `context.cacheKey` to make regeneration straightforward.\n */\nexport class FunctionsAiMemoizationMissError extends BaseError.extend(\n 'FunctionsAiMemoizationMissError',\n 'No memoized AI conversation found for the given cache key',\n) {}\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { type Atom, type Registry } from '@effect-atom/atom';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport { pipe } from 'effect/Function';\nimport * as Layer from 'effect/Layer';\n\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { assertArgument } from '@dxos/invariant';\n\nimport { NoHandlerError } from './errors';\nimport type * as Operation from './Operation';\n\nexport const TypeId = '~@dxos/operation/OperationHandlerSet' as const;\nexport type TypeId = typeof TypeId;\n\nexport interface OperationHandlerSet {\n [TypeId]: TypeId;\n\n readonly handlers: Effect.Effect<Operation.WithHandler<Operation.Definition.Any>[]>;\n\n getHandlers(): Promise<Operation.WithHandler<Operation.Definition.Any>[]>;\n}\n\nexport const isOperationHandlerSet = (value: unknown): value is OperationHandlerSet => {\n return typeof value === 'object' && value !== null && TypeId in value;\n};\n\nexport const empty: OperationHandlerSet = {\n [TypeId]: TypeId,\n handlers: Effect.succeed([]),\n getHandlers: () => Promise.resolve([]),\n};\n\n/**\n * Creates a new operation handler set from a list of handlers.\n *\n * @example\n * ```ts\n * const set = OperationHandlerSet.make(\n * Operation.withHandler(Operation.make({ input: Schema.Void, output: Schema.Void }), (input) => Effect.succeed({})),\n * Operation.withHandler(Operation.make({ input: Schema.Void, output: Schema.Void }), (input) => Effect.succeed({})),\n * );\n * ```\n */\nexport const make = (...handlers: Operation.WithHandler<Operation.Definition.Any>[]): OperationHandlerSet => {\n return async(() => Promise.resolve(handlers));\n};\n\nexport const async = (\n getHandlers: () => Promise<Operation.WithHandler<Operation.Definition.Any>[]>,\n): OperationHandlerSet => {\n // NOTE: Re-runing async module imports has a big performance penalty in Chrome.\n let promise: Promise<Operation.WithHandler<Operation.Definition.Any>[]> | null = null;\n const getHandlersCached = () => {\n if (!promise) {\n promise = getHandlers();\n }\n return promise;\n };\n return {\n [TypeId]: TypeId,\n getHandlers,\n handlers: Effect.promise(getHandlersCached),\n };\n};\n\n/**\n * Builds a set backed by an atom of contributed sets. The merged result is\n * cached and invalidated whenever the atom changes, so most accesses are\n * cheap but newly registered handlers are picked up.\n */\nexport const reactive = (\n registry: Registry.Registry,\n atom: Atom.Atom<readonly OperationHandlerSet[]>,\n): OperationHandlerSet => {\n let cached: Promise<Operation.WithHandler<Operation.Definition.Any>[]> | null = null;\n registry.subscribe(atom, () => {\n cached = null;\n });\n // `suspend` defers `registry.get(atom)` until each run, so re-evaluations\n // after cache invalidation see the current contributed sets.\n const compute = Effect.suspend(() =>\n pipe(\n registry.get(atom),\n Effect.forEach((set) => set.handlers, { concurrency: 'unbounded' }),\n Effect.map((groups) => groups.flat()),\n // Reset cached on failure so a transient error doesn't permanently\n // poison subsequent calls.\n Effect.tapErrorCause(() =>\n Effect.sync(() => {\n cached = null;\n }),\n ),\n ),\n );\n const getHandlers = () => (cached ??= runAndForwardErrors(compute));\n return {\n [TypeId]: TypeId,\n getHandlers,\n handlers: Effect.promise(getHandlers),\n };\n};\n\n/**\n * Merges multiple operation handler sets into a single set.\n *\n */\nexport const merge = (...sets: OperationHandlerSet[]): OperationHandlerSet => {\n assertArgument(sets.every(isOperationHandlerSet), 'sets', 'sets must be an array of OperationHandlerSet');\n return async(() => Promise.all(sets.map((set) => set.getHandlers())).then((handlers) => handlers.flat()));\n};\n\n/**\n * Creates a new operation handler set from a list of lazy-loaded modules.\n *\n * @example\n * ```ts\n * const set = OperationHandlerSet.lazy(\n * () => import('./my-handler'),\n * () => import('./my-other-handler'),\n * );\n * ```\n */\nexport const lazy = (\n ...modules: (() => Promise<{ default: Operation.WithHandler<Operation.Definition.Any> }>)[]\n): OperationHandlerSet => {\n return async(() => Promise.all(modules.map((module) => module().then(({ default: handler }) => handler))));\n};\n\n/**\n * Gets a handler for an operation by definition.\n */\nexport const getHandler = <const Op extends Operation.Definition.Any>(\n set: OperationHandlerSet,\n definition: Op,\n): Effect.Effect<Operation.WithHandler<Op>, NoHandlerError> =>\n Effect.gen(function* () {\n const handlers = yield* set.handlers;\n const handler = handlers.find((handler) => handler.meta.key === definition.meta.key);\n if (!handler) {\n return yield* Effect.fail(new NoHandlerError(definition.meta.key));\n }\n return handler as any;\n });\n\n/**\n * Gets a handler for an operation by key.\n */\nexport const getHandlerByKey = (\n set: OperationHandlerSet,\n key: string,\n): Effect.Effect<Operation.WithHandler<Operation.Definition.Any>, NoHandlerError> =>\n Effect.gen(function* () {\n const handlers = yield* set.handlers;\n const handler = handlers.find((handler) => handler.meta.key === key);\n if (!handler) {\n return yield* Effect.fail(new NoHandlerError(key));\n }\n return handler as any;\n });\n\nexport class OperationHandlerProvider extends Context.Tag('@dxos/operation/OperationHandlerProvider')<\n OperationHandlerProvider,\n OperationHandlerSet\n>() {}\n\nexport const provide = (handlers: OperationHandlerSet): Layer.Layer<OperationHandlerProvider, never, never> =>\n Layer.succeed(OperationHandlerProvider, handlers);\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["BaseError", "InvokerNotInitializedError", "extend", "NoHandlerError", "operationKey", "context", "ServiceNotAvailableError", "service", "options", "message", "FunctionNotFoundError", "functionKey", "function", "FunctionError", "InvalidOperationInputError", "InvalidOperationOutputError", "TriggerStateNotFoundError", "FunctionsAiUpstreamError", "FunctionsAiMemoizationMissError", "Context", "Effect", "pipe", "Layer", "runAndForwardErrors", "assertArgument", "TypeId", "isOperationHandlerSet", "value", "empty", "handlers", "succeed", "getHandlers", "Promise", "resolve", "make", "async", "promise", "getHandlersCached", "reactive", "registry", "atom", "cached", "subscribe", "compute", "suspend", "pipe", "get", "forEach", "set", "concurrency", "map", "groups", "flat", "tapErrorCause", "sync", "runAndForwardErrors", "merge", "sets", "assertArgument", "every", "all", "then", "lazy", "modules", "module", "default", "handler", "getHandler", "definition", "gen", "find", "meta", "key", "fail", "NoHandlerError", "getHandlerByKey", "OperationHandlerProvider", "Tag", "provide"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Sleep
|
|
3
|
+
} from "./chunk-VSICPGGY.mjs";
|
|
4
|
+
import {
|
|
5
|
+
withHandler
|
|
6
|
+
} from "./chunk-SEBWOTOU.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-LRCABAWU.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,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Reply
|
|
3
|
+
} from "./chunk-VSICPGGY.mjs";
|
|
4
|
+
import {
|
|
5
|
+
withHandler
|
|
6
|
+
} from "./chunk-SEBWOTOU.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-RCLYF66G.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
|
+
}
|