@platforma-sdk/workflow-tengo 6.0.0 → 6.2.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.
Files changed (49) hide show
  1. package/dist/tengo/lib/assets.lib.tengo +3 -1
  2. package/dist/tengo/lib/assets.wasm.lib.tengo +113 -0
  3. package/dist/tengo/tpl/annotations.compute.plj.gz +0 -0
  4. package/dist/tengo/tpl/anonymize.deanonymize.plj.gz +0 -0
  5. package/dist/tengo/tpl/anonymize.impl.plj.gz +0 -0
  6. package/dist/tengo/tpl/check_network.create_workdir_from_storage.plj.gz +0 -0
  7. package/dist/tengo/tpl/check_network.download_blob.plj.gz +0 -0
  8. package/dist/tengo/tpl/check_network.run_hello_world.plj.gz +0 -0
  9. package/dist/tengo/tpl/check_network.run_hello_world_py.plj.gz +0 -0
  10. package/dist/tengo/tpl/check_network.upload_blob.plj.gz +0 -0
  11. package/dist/tengo/tpl/check_network.upload_template.plj.gz +0 -0
  12. package/dist/tengo/tpl/check_network.workdir_type_name_extractor.plj.gz +0 -0
  13. package/dist/tengo/tpl/exec.conda.create-env.plj.gz +0 -0
  14. package/dist/tengo/tpl/exec.delayed-compute-allocation.impl.plj.gz +0 -0
  15. package/dist/tengo/tpl/exec.exec-impl.plj.gz +0 -0
  16. package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
  17. package/dist/tengo/tpl/exec.load-software.impl.plj.gz +0 -0
  18. package/dist/tengo/tpl/exec.monetization_info.plj.gz +0 -0
  19. package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
  20. package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
  21. package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
  22. package/dist/tengo/tpl/exec.python.venv-bin-path.plj.gz +0 -0
  23. package/dist/tengo/tpl/ll.get-field.plj.gz +0 -0
  24. package/dist/tengo/tpl/pframes.build-table.plj.gz +0 -0
  25. package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
  26. package/dist/tengo/tpl/pframes.export-parquet-pcolumn-chunk.plj.gz +0 -0
  27. package/dist/tengo/tpl/pframes.export-pframe-for-ui.plj.gz +0 -0
  28. package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
  29. package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
  30. package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
  31. package/dist/tengo/tpl/pframes.merge-resource-maps.plj.gz +0 -0
  32. package/dist/tengo/tpl/pframes.parse-to-json.plj.gz +0 -0
  33. package/dist/tengo/tpl/pframes.process-pcolumn-batch-split.plj.gz +0 -0
  34. package/dist/tengo/tpl/pframes.process-pcolumn-batch.plj.gz +0 -0
  35. package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
  36. package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
  37. package/dist/tengo/tpl/pframes.slice-data.plj.gz +0 -0
  38. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  39. package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
  40. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  41. package/dist/tengo/tpl/pt.import-dir.plj.gz +0 -0
  42. package/dist/tengo/tpl/pt.workflow-run.plj.gz +0 -0
  43. package/dist/tengo/tpl/waiter.waiter.plj.gz +0 -0
  44. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  45. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  46. package/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
  47. package/dist/tengo/tpl/workflow.query-context-filter.plj.gz +0 -0
  48. package/package.json +5 -5
  49. package/dist/tengo/lib/pframes-rs.lib.tengo +0 -223
@@ -5,6 +5,7 @@ json := import("json")
5
5
  ll := import("@platforma-sdk/workflow-tengo:ll")
6
6
  smart := import("@platforma-sdk/workflow-tengo:smart")
7
7
  swinfo := import("@platforma-sdk/workflow-tengo:assets.swinfo")
8
+ wasm := import("@platforma-sdk/workflow-tengo:assets.wasm")
8
9
  maps := import("@platforma-sdk/workflow-tengo:maps")
9
10
 
10
11
 
@@ -69,5 +70,6 @@ export ll.toStrict({
69
70
  importSoftware : swinfo.importSoftware,
70
71
  isSoftwareInfo : swinfo.isSoftwareInfo,
71
72
  importAsset : importAsset,
72
- isAssetInfo : isAssetInfo
73
+ isAssetInfo : isAssetInfo,
74
+ importWasm : wasm.importWasm
73
75
  })
@@ -0,0 +1,113 @@
1
+
2
+
3
+
4
+
5
+ plapi := import("plapi")
6
+ ll := import("@platforma-sdk/workflow-tengo:ll")
7
+ maps := import("@platforma-sdk/workflow-tengo:maps")
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+ importWasm := func(wasmName, ...rest) {
79
+ ll.assert(
80
+ len(rest) <= 1,
81
+ "assets.importWasm: too many arguments (want 1 or 2, got %d)",
82
+ 1 + len(rest)
83
+ )
84
+ if len(rest) == 0 {
85
+ return plapi.loadWasm(wasmName)
86
+ }
87
+ opts := rest[0]
88
+ ll.assert(ll.isMap(opts), "assets.importWasm: opts must be a map, got %v", opts)
89
+
90
+
91
+
92
+ for k, _ in opts {
93
+ ll.assert(
94
+ k == "memoryLimit",
95
+ "assets.importWasm: unknown opts key %q (recognised: \"memoryLimit\")",
96
+ k
97
+ )
98
+ }
99
+ if !maps.containsKey(opts, "memoryLimit") {
100
+ return plapi.loadWasm(wasmName)
101
+ }
102
+ limit := opts.memoryLimit
103
+ ll.assert(
104
+ is_int(limit) || is_string(limit),
105
+ "assets.importWasm: opts.memoryLimit must be int (bytes) or string (e.g. \"50MiB\"), got %v",
106
+ limit
107
+ )
108
+ return plapi.loadWasm(wasmName, limit)
109
+ }
110
+
111
+ export ll.toStrict({
112
+ importWasm: importWasm
113
+ })
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/workflow-tengo",
3
- "version": "6.0.0",
3
+ "version": "6.2.0",
4
4
  "description": "Tengo SDK library",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -16,14 +16,14 @@
16
16
  "./dist/**/*"
17
17
  ],
18
18
  "dependencies": {
19
- "@milaboratories/pframes-rs-wasip2": "1.1.37",
19
+ "@milaboratories/pframes-rs-wasip2": "1.1.38",
20
20
  "@milaboratories/software-pframes-conv": "2.2.9",
21
21
  "@platforma-open/milaboratories.software-small-binaries": "^2.0.3",
22
- "@platforma-open/milaboratories.software-ptabler": "2.0.0",
23
- "@platforma-open/milaboratories.software-ptexter": "1.2.2"
22
+ "@platforma-open/milaboratories.software-ptexter": "1.2.2",
23
+ "@platforma-open/milaboratories.software-ptabler": "2.0.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@platforma-sdk/tengo-builder": "3.0.5"
26
+ "@platforma-sdk/tengo-builder": "4.0.2"
27
27
  },
28
28
  "scripts": {
29
29
  "type-check": "pl-tengo check",
@@ -1,223 +0,0 @@
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
- ll := import("@platforma-sdk/workflow-tengo:ll")
40
- assets := import("@platforma-sdk/workflow-tengo:assets")
41
- json := import("json")
42
-
43
- WASM_NAME := "@milaboratories/pframes-rs-wasip2:main"
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
- _bundleTag := func() {
53
- if false {
54
- return assets.importWasm("@milaboratories/pframes-rs-wasip2:main")
55
- }
56
- return undefined
57
- }
58
-
59
- _runtimeUnavailable := func() {
60
- return error("pframes-rs wasm runtime not yet wired (see plan/tengo-wasm-call); the wasm bytes are bundled but cannot be invoked from Tengo today")
61
- }
62
-
63
-
64
-
65
-
66
-
67
- _load := func(limit) {
68
- return undefined
69
- }
70
-
71
-
72
-
73
- _resolve := func(handle, path) {
74
- node := handle
75
- for name in path {
76
- if is_undefined(node) {
77
- return undefined
78
- }
79
- node = node[name]
80
- }
81
- return node
82
- }
83
-
84
-
85
-
86
-
87
- _staticCall := func(path) {
88
- return func(request) {
89
- h := _load(undefined)
90
- if is_undefined(h) {
91
- return _runtimeUnavailable()
92
- }
93
- fn := _resolve(h, path)
94
- if is_undefined(fn) {
95
- return error("pframes-rs wasm export missing: " + string(path))
96
- }
97
- requestJson := ""
98
- if !is_undefined(request) {
99
- requestJson = json.encode(request)
100
- }
101
- responseJson := fn(requestJson)
102
- if is_error(responseJson) {
103
- return responseJson
104
- }
105
- return json.decode(responseJson)
106
- }
107
- }
108
-
109
-
110
-
111
-
112
-
113
- _instanceMethod := func(hostHandle, methodName, takesArgs) {
114
- return func(args) {
115
- method := hostHandle[methodName]
116
- if is_undefined(method) {
117
- return error("pframes-rs handle method missing: " + methodName)
118
- }
119
- responseJson := undefined
120
- if takesArgs {
121
- requestJson := ""
122
- if !is_undefined(args) {
123
- requestJson = json.encode(args)
124
- }
125
- responseJson = method(requestJson)
126
- } else {
127
- responseJson = method()
128
- }
129
- if is_error(responseJson) {
130
- return responseJson
131
- }
132
- return json.decode(responseJson)
133
- }
134
- }
135
-
136
-
137
-
138
- _wrapFrame := func(hostFrame) {
139
- if is_error(hostFrame) {
140
- return hostFrame
141
- }
142
- return ll.toStrict({
143
- listColumns: _instanceMethod(hostFrame, "listColumns", false),
144
- discoverColumns: _instanceMethod(hostFrame, "discoverColumns", true),
145
- findColumns: _instanceMethod(hostFrame, "findColumns", true),
146
- evaluateQuery: _instanceMethod(hostFrame, "evaluateQuery", true),
147
- rewriteLegacyQuery: _instanceMethod(hostFrame, "rewriteLegacyQuery", true)
148
- })
149
- }
150
-
151
- frameFromJson := func(spec) {
152
- h := _load(undefined)
153
- if is_undefined(h) {
154
- return _runtimeUnavailable()
155
- }
156
- specJson := json.encode(spec)
157
- hostFrame := h.frame.fromJson(specJson)
158
- return _wrapFrame(hostFrame)
159
- }
160
-
161
- frameNS := ll.toStrict({
162
- fromJson: frameFromJson,
163
- deleteColumns: _staticCall(["frame", "deleteColumns"]),
164
- buildQuery: _staticCall(["frame", "buildQuery"])
165
- })
166
-
167
-
168
-
169
- _wrapTable := func(hostTable) {
170
- if is_error(hostTable) {
171
- return hostTable
172
- }
173
- return ll.toStrict({
174
- findColumn: _instanceMethod(hostTable, "findColumn", true)
175
- })
176
- }
177
-
178
- tableFromJson := func(spec) {
179
- h := _load(undefined)
180
- if is_undefined(h) {
181
- return _runtimeUnavailable()
182
- }
183
- specJson := json.encode(spec)
184
- hostTable := h.table.fromJson(specJson)
185
- return _wrapTable(hostTable)
186
- }
187
-
188
- tableNS := ll.toStrict({
189
- fromJson: tableFromJson
190
- })
191
-
192
-
193
-
194
- _wrapAxes := func(hostAxes) {
195
- if is_error(hostAxes) {
196
- return hostAxes
197
- }
198
- return ll.toStrict({
199
- expand: _instanceMethod(hostAxes, "expand", false),
200
- find: _instanceMethod(hostAxes, "find", true)
201
- })
202
- }
203
-
204
- axesFromJson := func(spec) {
205
- h := _load(undefined)
206
- if is_undefined(h) {
207
- return _runtimeUnavailable()
208
- }
209
- specJson := json.encode(spec)
210
- hostAxes := h.axes.fromJson(specJson)
211
- return _wrapAxes(hostAxes)
212
- }
213
-
214
- axesNS := ll.toStrict({
215
- fromJson: axesFromJson,
216
- collapse: _staticCall(["axes", "collapse"])
217
- })
218
-
219
- export ll.toStrict({
220
- frame: frameNS,
221
- table: tableNS,
222
- axes: axesNS
223
- })