@volter/editor-sdk 0.5.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +19 -0
- package/package.json +90 -0
- package/src/account.ts +210 -0
- package/src/chrome.ts +83 -0
- package/src/client.ts +1547 -0
- package/src/commands.ts +66 -0
- package/src/contributions.ts +985 -0
- package/src/document-probe.ts +237 -0
- package/src/editor-view.ts +220 -0
- package/src/extension.ts +40 -0
- package/src/generations.ts +178 -0
- package/src/host.ts +1167 -0
- package/src/http-transport.browser.ts +14 -0
- package/src/http-transport.node.ts +19 -0
- package/src/index.ts +128 -0
- package/src/layout-arrangements.ts +5 -0
- package/src/layouts.tsx +108 -0
- package/src/looks.ts +14 -0
- package/src/project/output-roots.ts +73 -0
- package/src/project/tab-census.ts +149 -0
- package/src/project-tool-catalog.ts +96 -0
- package/src/selection.tsx +108 -0
- package/src/services.ts +18 -0
- package/src/session/build-report.ts +19 -0
- package/src/session/collaboration-types.ts +262 -0
- package/src/session/command-table.ts +333 -0
- package/src/session/discovery.ts +90 -0
- package/src/session/editor-brand.ts +73 -0
- package/src/session/editor-compatibility.ts +248 -0
- package/src/session/editor-control-lifecycle.ts +68 -0
- package/src/session/editor-control-protocol.ts +5 -0
- package/src/session/entrypoint-selection-readers.ts +66 -0
- package/src/session/entrypoint-selection-source.ts +120 -0
- package/src/session/game-css-scope.ts +30 -0
- package/src/session/product-create.ts +24 -0
- package/src/session/product-locator.ts +389 -0
- package/src/session/project-module-url.ts +245 -0
- package/src/session/registry-format.ts +203 -0
- package/src/session/relative-path-guard.ts +56 -0
- package/src/session/source-glob.ts +15 -0
- package/src/session/tool-contribution-convention.ts +116 -0
- package/src/session/workbench-locator.ts +650 -0
- package/src/session.ts +41 -0
- package/src/share.ts +160 -0
- package/src/tools/errors.ts +91 -0
- package/src/tools/provider-execution.ts +70 -0
- package/src/tools/registry.ts +341 -0
- package/src/tools/types.ts +159 -0
- package/src/transport.ts +97 -0
- package/src/types.ts +1581 -0
- package/src/views.ts +164 -0
- package/src/widgets/design-system.ts +93 -0
- package/src/widgets/editor-appearance.ts +149 -0
- package/src/widgets/editor-material.ts +83 -0
- package/src/widgets/icon-set-registry.ts +105 -0
- package/src/widgets/index.ts +71 -0
- package/src/widgets/inspector-widgets/AlignmentGrid.tsx +182 -0
- package/src/widgets/inspector-widgets/AssetSlotPicker.tsx +123 -0
- package/src/widgets/inspector-widgets/BorderEditor.tsx +309 -0
- package/src/widgets/inspector-widgets/ColorPicker.tsx +549 -0
- package/src/widgets/inspector-widgets/CurveEditor.tsx +359 -0
- package/src/widgets/inspector-widgets/FilterEditor.tsx +108 -0
- package/src/widgets/inspector-widgets/FontPicker.tsx +191 -0
- package/src/widgets/inspector-widgets/GradientEditor.tsx +623 -0
- package/src/widgets/inspector-widgets/ScrubbableInput.tsx +180 -0
- package/src/widgets/inspector-widgets/ShadowEditor.tsx +319 -0
- package/src/widgets/inspector-widgets/color-utils.ts +201 -0
- package/src/widgets/inspector-widgets/curve-utils.ts +212 -0
- package/src/widgets/inspector-widgets/index.ts +24 -0
- package/src/widgets/inspector-widgets/shared.tsx +140 -0
- package/src/widgets/interactive-edit-scope.ts +33 -0
- package/src/widgets/patterns/Dialog.tsx +129 -0
- package/src/widgets/patterns/Fields.tsx +44 -0
- package/src/widgets/patterns/List.tsx +25 -0
- package/src/widgets/patterns/StateSurface.tsx +40 -0
- package/src/widgets/patterns/Surfaces.tsx +122 -0
- package/src/widgets/patterns/Tabs.tsx +80 -0
- package/src/widgets/patterns/Toolbar.tsx +72 -0
- package/src/widgets/patterns/Tree.tsx +72 -0
- package/src/widgets/primitives/AnchoredMenu.tsx +260 -0
- package/src/widgets/primitives/Button.tsx +62 -0
- package/src/widgets/primitives/ColorInput.tsx +78 -0
- package/src/widgets/primitives/DraftTextInput.tsx +63 -0
- package/src/widgets/primitives/EditorIcon.tsx +157 -0
- package/src/widgets/primitives/FormControls.tsx +88 -0
- package/src/widgets/primitives/HoverPreview.tsx +96 -0
- package/src/widgets/primitives/JsonInput.tsx +113 -0
- package/src/widgets/primitives/Layout.tsx +100 -0
- package/src/widgets/primitives/Menu.tsx +140 -0
- package/src/widgets/primitives/NumberInput.tsx +169 -0
- package/src/widgets/primitives/Panel.tsx +80 -0
- package/src/widgets/primitives/SectionHeader.tsx +77 -0
- package/src/widgets/primitives/Text.tsx +54 -0
- package/src/widgets/primitives/ThemeRootPortal.tsx +52 -0
- package/src/widgets/primitives/Tooltip.tsx +204 -0
- package/src/widgets/primitives/Vec3Input.tsx +70 -0
- package/src/widgets/primitives/banner-tones.ts +32 -0
- package/src/widgets/primitives/clamp-to-viewport.ts +44 -0
- package/src/widgets/primitives/editor-icons.ts +245 -0
- package/src/widgets/primitives/panel-header-styles.ts +42 -0
- package/src/widgets/theme.ts +2633 -0
- package/src/widgets/z-index.ts +25 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 Volter AI, Inc.
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Copyright 2026 Volter AI, Inc.
|
|
2
|
+
|
|
3
|
+
Project tool registry, provider execution and related types were transferred
|
|
4
|
+
from the Apache-2.0 @vgai/sdk package. Original source hashes and revision are
|
|
5
|
+
recorded in provenance/editor-server.json.
|
|
6
|
+
|
|
7
|
+
The project output-root policy is Apache-2.0, transferred from the original
|
|
8
|
+
SDK; its exact source is recorded in provenance/editor-server.json.
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Editor SDK
|
|
2
|
+
|
|
3
|
+
Extension, contribution and editor-session APIs for Volter Editor. This package
|
|
4
|
+
depends on the project contracts, not the editor implementation or game runtime.
|
|
5
|
+
|
|
6
|
+
The viewport presentation contract accepts a root identity and native mounted
|
|
7
|
+
adapter surface. It does not require a game's input system, loop or execution
|
|
8
|
+
API. Richer product-owned roots can satisfy that interface directly.
|
|
9
|
+
|
|
10
|
+
Account/generation projections, project-tool declarations and tab observations
|
|
11
|
+
used by this SDK live here, transferred from the former general SDK. They are
|
|
12
|
+
data contracts, not provider integrations. The rest of that old SDK is not
|
|
13
|
+
included by default. Editor appearance data types have one owner in the project
|
|
14
|
+
contract and are exposed through the SDK's contribution-facing entry points.
|
|
15
|
+
|
|
16
|
+
Run `npm run typecheck -w @volter/editor-sdk` through the active World. This
|
|
17
|
+
package is private during migration. Existing session wire names remain intact
|
|
18
|
+
until their host and Code-OSS consumers move together; package renaming alone
|
|
19
|
+
does not complete product branding or consumer cutover.
|
package/package.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@volter/editor-sdk",
|
|
3
|
+
"author": "Volter AI, Inc.",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"version": "0.5.57",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"description": "Extension, contribution and session APIs for Volter Editor.",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/volter-ai/editor.git",
|
|
14
|
+
"directory": "packages/editor-sdk"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"src",
|
|
18
|
+
"NOTICE"
|
|
19
|
+
],
|
|
20
|
+
"exports": {
|
|
21
|
+
".": "./src/index.ts",
|
|
22
|
+
"./contributions": "./src/contributions.ts",
|
|
23
|
+
"./document-probe": "./src/document-probe.ts",
|
|
24
|
+
"./extension": "./src/extension.ts",
|
|
25
|
+
"./share": "./src/share.ts",
|
|
26
|
+
"./session": "./src/session.ts",
|
|
27
|
+
"./session/*": "./src/session/*.ts",
|
|
28
|
+
"./layouts": "./src/layouts.tsx",
|
|
29
|
+
"./layout-arrangements": "./src/layout-arrangements.ts",
|
|
30
|
+
"./host": "./src/host.ts",
|
|
31
|
+
"./looks": "./src/looks.ts",
|
|
32
|
+
"./widgets": "./src/widgets/index.ts",
|
|
33
|
+
"./commands": "./src/commands.ts",
|
|
34
|
+
"./chrome": "./src/chrome.ts",
|
|
35
|
+
"./views": "./src/views.ts",
|
|
36
|
+
"./services": "./src/services.ts",
|
|
37
|
+
"./account": "./src/account.ts",
|
|
38
|
+
"./generations": "./src/generations.ts",
|
|
39
|
+
"./project-tool-catalog": "./src/project-tool-catalog.ts",
|
|
40
|
+
"./tab-census": "./src/project/tab-census.ts",
|
|
41
|
+
"./selection": "./src/selection.tsx",
|
|
42
|
+
"./client": "./src/client.ts",
|
|
43
|
+
"./session/product-locator": "./src/session/product-locator.ts",
|
|
44
|
+
"./session/editor-compatibility": "./src/session/editor-compatibility.ts",
|
|
45
|
+
"./session/relative-path-guard": "./src/session/relative-path-guard.ts",
|
|
46
|
+
"./session/workbench-locator": "./src/session/workbench-locator.ts",
|
|
47
|
+
"./session/tool-contribution-convention": "./src/session/tool-contribution-convention.ts",
|
|
48
|
+
"./session/command-table": "./src/session/command-table.ts",
|
|
49
|
+
"./session/collaboration-types": "./src/session/collaboration-types.ts",
|
|
50
|
+
"./tools/provider-execution": "./src/tools/provider-execution.ts",
|
|
51
|
+
"./index": "./src/index.ts",
|
|
52
|
+
"./session/build-report": "./src/session/build-report.ts",
|
|
53
|
+
"./session/editor-control-lifecycle": "./src/session/editor-control-lifecycle.ts",
|
|
54
|
+
"./session/editor-control-protocol": "./src/session/editor-control-protocol.ts",
|
|
55
|
+
"./session/source-glob": "./src/session/source-glob.ts",
|
|
56
|
+
"./project/tab-census": "./src/project/tab-census.ts",
|
|
57
|
+
"./tools/registry": "./src/tools/registry.ts",
|
|
58
|
+
"./session/game-css-scope": "./src/session/game-css-scope.ts",
|
|
59
|
+
"./session/entrypoint-selection-source": "./src/session/entrypoint-selection-source.ts",
|
|
60
|
+
"./tools/types": "./src/tools/types.ts",
|
|
61
|
+
"./session/editor-brand": "./src/session/editor-brand.ts",
|
|
62
|
+
"./tools/errors": "./src/tools/errors.ts",
|
|
63
|
+
"./project/output-roots": "./src/project/output-roots.ts"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
67
|
+
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
|
68
|
+
"@fortawesome/react-fontawesome": "^3.2.0",
|
|
69
|
+
"@types/three": "^0.180.0",
|
|
70
|
+
"typescript": "^5.6.0",
|
|
71
|
+
"undici": "^7.28.0",
|
|
72
|
+
"zod": "^4.3.6",
|
|
73
|
+
"@volter/editor-project": "0.5.57",
|
|
74
|
+
"@types/node": "^22.0.0"
|
|
75
|
+
},
|
|
76
|
+
"peerDependencies": {
|
|
77
|
+
"react": "^19.0.0",
|
|
78
|
+
"react-dom": "^19.0.0",
|
|
79
|
+
"three": "^0.180.0"
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"typecheck": "tsc -p tsconfig.json"
|
|
83
|
+
},
|
|
84
|
+
"imports": {
|
|
85
|
+
"#http-transport": {
|
|
86
|
+
"browser": "./src/http-transport.browser.ts",
|
|
87
|
+
"default": "./src/http-transport.node.ts"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
package/src/account.ts
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// Account identity and billing preference are host configuration, never generation-call inputs.
|
|
4
|
+
export const AccountBackendSchema = z.enum(['mock', 'live']);
|
|
5
|
+
export const AccountPlanSchema = z.object({
|
|
6
|
+
id: z.string().min(1),
|
|
7
|
+
name: z.string().min(1),
|
|
8
|
+
status: z.enum(['free', 'trialing', 'active', 'past_due', 'cancelling']),
|
|
9
|
+
interval: z.enum(['month', 'year']).optional(),
|
|
10
|
+
renewsAt: z.string().datetime().optional(),
|
|
11
|
+
endsAt: z.string().datetime().optional(),
|
|
12
|
+
});
|
|
13
|
+
export const AccountCreditsSchema = z.object({
|
|
14
|
+
included: z.number().nonnegative(),
|
|
15
|
+
purchased: z.number().nonnegative(),
|
|
16
|
+
used: z.number().nonnegative(),
|
|
17
|
+
reserved: z.number().nonnegative(),
|
|
18
|
+
remaining: z.number().nonnegative(),
|
|
19
|
+
resetsAt: z.string().datetime().optional(),
|
|
20
|
+
purchasedExpiresAt: z.string().datetime().optional(),
|
|
21
|
+
});
|
|
22
|
+
export const AccountSpendPolicySchema = z.object({
|
|
23
|
+
overageEnabled: z.boolean(),
|
|
24
|
+
monthlyLimitCredits: z.number().nonnegative(),
|
|
25
|
+
alertThresholds: z.array(z.number().min(1).max(100)).max(8),
|
|
26
|
+
autoReload: z
|
|
27
|
+
.object({
|
|
28
|
+
enabled: z.boolean(),
|
|
29
|
+
whenRemainingBelow: z.number().nonnegative(),
|
|
30
|
+
reloadTo: z.number().positive(),
|
|
31
|
+
monthlyLimitCredits: z.number().nonnegative(),
|
|
32
|
+
})
|
|
33
|
+
.optional(),
|
|
34
|
+
});
|
|
35
|
+
export const AccountAlertSchema = z.object({
|
|
36
|
+
id: z.string().min(1),
|
|
37
|
+
kind: z.enum(['threshold', 'auto_reload_succeeded', 'auto_reload_failed']),
|
|
38
|
+
message: z.string().min(1),
|
|
39
|
+
createdAt: z.string().datetime(),
|
|
40
|
+
readAt: z.string().datetime().optional(),
|
|
41
|
+
});
|
|
42
|
+
export const AccountUserSchema = z.object({
|
|
43
|
+
id: z.string().min(1),
|
|
44
|
+
email: z.string().email(),
|
|
45
|
+
name: z.string().min(1).optional(),
|
|
46
|
+
});
|
|
47
|
+
export const AccountOrganizationDomainSchema = z.object({
|
|
48
|
+
name: z.string().min(1),
|
|
49
|
+
verified: z.boolean(),
|
|
50
|
+
enrollmentMode: z.enum([
|
|
51
|
+
'manual_invitation',
|
|
52
|
+
'automatic_invitation',
|
|
53
|
+
'automatic_suggestion',
|
|
54
|
+
'enterprise_sso',
|
|
55
|
+
]),
|
|
56
|
+
});
|
|
57
|
+
export const AccountOrganizationSchema = z.object({
|
|
58
|
+
id: z.string().min(1),
|
|
59
|
+
name: z.string().min(1),
|
|
60
|
+
slug: z.string().min(1).optional(),
|
|
61
|
+
role: z.string().min(1),
|
|
62
|
+
domains: z.array(AccountOrganizationDomainSchema).max(50),
|
|
63
|
+
});
|
|
64
|
+
export const AccountUsageEntrySchema = z.object({
|
|
65
|
+
id: z.string().min(1),
|
|
66
|
+
occurredAt: z.string().datetime(),
|
|
67
|
+
kind: z.enum(['inference', 'generation', 'workspace', 'storage', 'relay', 'deployment']),
|
|
68
|
+
provider: z.string().min(1),
|
|
69
|
+
operation: z.string().optional(),
|
|
70
|
+
credits: z.number().nonnegative(),
|
|
71
|
+
state: z.enum(['reserved', 'settled', 'released']),
|
|
72
|
+
externalId: z.string().optional(),
|
|
73
|
+
});
|
|
74
|
+
export const AccountPlanIdSchema = z.enum(['free', 'creator', 'max', 'ultra']);
|
|
75
|
+
export const AccountCatalogSchema = z.object({
|
|
76
|
+
plans: z.object({
|
|
77
|
+
free: z.object({
|
|
78
|
+
name: z.string().min(1),
|
|
79
|
+
includedCredits: z.number().int().nonnegative(),
|
|
80
|
+
monthlyPriceUsd: z.number().nonnegative().optional(),
|
|
81
|
+
}),
|
|
82
|
+
creator: z.object({
|
|
83
|
+
name: z.string().min(1),
|
|
84
|
+
includedCredits: z.number().int().nonnegative(),
|
|
85
|
+
monthlyPriceUsd: z.number().nonnegative().optional(),
|
|
86
|
+
}),
|
|
87
|
+
max: z.object({
|
|
88
|
+
name: z.string().min(1),
|
|
89
|
+
includedCredits: z.number().int().nonnegative(),
|
|
90
|
+
monthlyPriceUsd: z.number().nonnegative().optional(),
|
|
91
|
+
}),
|
|
92
|
+
ultra: z.object({
|
|
93
|
+
name: z.string().min(1),
|
|
94
|
+
includedCredits: z.number().int().nonnegative(),
|
|
95
|
+
monthlyPriceUsd: z.number().nonnegative().optional(),
|
|
96
|
+
}),
|
|
97
|
+
}),
|
|
98
|
+
creditPacks: z.record(
|
|
99
|
+
z.string().min(1),
|
|
100
|
+
z.object({
|
|
101
|
+
name: z.string().min(1),
|
|
102
|
+
credits: z.number().int().positive(),
|
|
103
|
+
expiresInDays: z.number().int().positive().optional(),
|
|
104
|
+
}),
|
|
105
|
+
),
|
|
106
|
+
});
|
|
107
|
+
export const AccountSnapshotSchema = z.discriminatedUnion('authenticated', [
|
|
108
|
+
z.object({ authenticated: z.literal(false), backend: AccountBackendSchema }),
|
|
109
|
+
z.object({
|
|
110
|
+
authenticated: z.literal(true),
|
|
111
|
+
backend: AccountBackendSchema,
|
|
112
|
+
user: AccountUserSchema,
|
|
113
|
+
organizations: z.array(AccountOrganizationSchema).max(100).optional(),
|
|
114
|
+
plan: AccountPlanSchema,
|
|
115
|
+
credits: AccountCreditsSchema,
|
|
116
|
+
spendPolicy: AccountSpendPolicySchema,
|
|
117
|
+
alerts: z.array(AccountAlertSchema).max(100).optional(),
|
|
118
|
+
entitlements: z.object({
|
|
119
|
+
generation: z.boolean(),
|
|
120
|
+
dailyJobs: z.number().int().positive().optional(),
|
|
121
|
+
}),
|
|
122
|
+
}),
|
|
123
|
+
]);
|
|
124
|
+
/** Product-facing routes. Provider tools may translate BYOK to their native
|
|
125
|
+
* transport name (`direct`) internally. */
|
|
126
|
+
export const GenerationExecutionRouteSchema = z.enum(['auto', 'mock', 'managed', 'byok']);
|
|
127
|
+
export const ProviderCredentialIdSchema = z.enum(['fal', 'tripo', 'worldlabs', 'openrouter']);
|
|
128
|
+
export const CodingInferenceSettingsSchema = z.object({
|
|
129
|
+
enabled: z.boolean(),
|
|
130
|
+
provider: z.literal('openrouter'),
|
|
131
|
+
model: z.string().trim().min(1).max(256),
|
|
132
|
+
});
|
|
133
|
+
export const ProviderCredentialSourceSchema = z.enum(['environment', 'system', 'session', 'none']);
|
|
134
|
+
export const ProviderCredentialStatusSchema = z.object({
|
|
135
|
+
provider: ProviderCredentialIdSchema,
|
|
136
|
+
label: z.string().min(1),
|
|
137
|
+
environmentVariable: z.string().min(1),
|
|
138
|
+
configured: z.boolean(),
|
|
139
|
+
source: ProviderCredentialSourceSchema,
|
|
140
|
+
editable: z.boolean(),
|
|
141
|
+
persistence: z.enum(['system', 'session']),
|
|
142
|
+
maskedKey: z.string().min(1).optional(),
|
|
143
|
+
problem: z.string().min(1).optional(),
|
|
144
|
+
});
|
|
145
|
+
export const ProviderCredentialTestResultSchema = z.object({
|
|
146
|
+
provider: ProviderCredentialIdSchema,
|
|
147
|
+
ok: z.literal(true),
|
|
148
|
+
testedAt: z.string().datetime(),
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
export type AccountBackend = z.infer<typeof AccountBackendSchema>;
|
|
152
|
+
export type AccountPlan = z.infer<typeof AccountPlanSchema>;
|
|
153
|
+
export type AccountCredits = z.infer<typeof AccountCreditsSchema>;
|
|
154
|
+
export type AccountSpendPolicy = z.infer<typeof AccountSpendPolicySchema>;
|
|
155
|
+
export type AccountAlert = z.infer<typeof AccountAlertSchema>;
|
|
156
|
+
export type AccountUser = z.infer<typeof AccountUserSchema>;
|
|
157
|
+
export type AccountOrganization = z.infer<typeof AccountOrganizationSchema>;
|
|
158
|
+
export type AccountOrganizationDomain = z.infer<typeof AccountOrganizationDomainSchema>;
|
|
159
|
+
export type AccountUsageEntry = z.infer<typeof AccountUsageEntrySchema>;
|
|
160
|
+
export type AccountPlanId = z.infer<typeof AccountPlanIdSchema>;
|
|
161
|
+
export type AccountCatalog = z.infer<typeof AccountCatalogSchema>;
|
|
162
|
+
export type AccountSnapshot = z.infer<typeof AccountSnapshotSchema>;
|
|
163
|
+
export type GenerationExecutionRoute = z.infer<typeof GenerationExecutionRouteSchema>;
|
|
164
|
+
export type CodingInferenceSettings = z.infer<typeof CodingInferenceSettingsSchema>;
|
|
165
|
+
export type ProviderCredentialId = z.infer<typeof ProviderCredentialIdSchema>;
|
|
166
|
+
export type ProviderCredentialSource = z.infer<typeof ProviderCredentialSourceSchema>;
|
|
167
|
+
export type ProviderCredentialStatus = z.infer<typeof ProviderCredentialStatusSchema>;
|
|
168
|
+
export type ProviderCredentialTestResult = z.infer<typeof ProviderCredentialTestResultSchema>;
|
|
169
|
+
export type EditorAccountSnapshot = AccountSnapshot & {
|
|
170
|
+
/** Which identity/payment surface backs this editor session. The in-process
|
|
171
|
+
* mock value exists only for isolated unit tests. */
|
|
172
|
+
accountEnvironment: 'test-mock' | 'development-twin' | 'production';
|
|
173
|
+
routes: { mock: true; managed: boolean; byok: boolean; byokProviders: string[] };
|
|
174
|
+
preferredRoute: GenerationExecutionRoute;
|
|
175
|
+
/** Editor-only metadata. Credential values never cross the server boundary. */
|
|
176
|
+
providerCredentials: ProviderCredentialStatus[];
|
|
177
|
+
codingInference: CodingInferenceSettings;
|
|
178
|
+
};
|
|
179
|
+
export interface GenerationAccountProjection {
|
|
180
|
+
routes: EditorAccountSnapshot['routes'];
|
|
181
|
+
preferredRoute: GenerationExecutionRoute;
|
|
182
|
+
}
|
|
183
|
+
export function generationAccountProjection(
|
|
184
|
+
account: EditorAccountSnapshot,
|
|
185
|
+
): GenerationAccountProjection {
|
|
186
|
+
return {
|
|
187
|
+
routes: {
|
|
188
|
+
mock: true,
|
|
189
|
+
managed: account.routes.managed,
|
|
190
|
+
byok: account.routes.byok,
|
|
191
|
+
byokProviders: [...account.routes.byokProviders],
|
|
192
|
+
},
|
|
193
|
+
preferredRoute: account.preferredRoute,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
export const EditorAccountSnapshotSchema: z.ZodType<EditorAccountSnapshot> = z.intersection(
|
|
197
|
+
AccountSnapshotSchema,
|
|
198
|
+
z.object({
|
|
199
|
+
accountEnvironment: z.enum(['test-mock', 'development-twin', 'production']),
|
|
200
|
+
routes: z.object({
|
|
201
|
+
mock: z.literal(true),
|
|
202
|
+
managed: z.boolean(),
|
|
203
|
+
byok: z.boolean(),
|
|
204
|
+
byokProviders: z.array(z.string().min(1)),
|
|
205
|
+
}),
|
|
206
|
+
preferredRoute: GenerationExecutionRouteSchema,
|
|
207
|
+
providerCredentials: z.array(ProviderCredentialStatusSchema),
|
|
208
|
+
codingInference: CodingInferenceSettingsSchema,
|
|
209
|
+
}),
|
|
210
|
+
);
|
package/src/chrome.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE CHROME POINTS — palette actions and menu items a package contributes
|
|
3
|
+
* (WORKBENCH.md §Contribution points). Both are data: an id, a label and what
|
|
4
|
+
* happens on choose. The host renders them where its own live: a contributed
|
|
5
|
+
* action in the command palette beside the editor's, a contributed item at the
|
|
6
|
+
* end of the named application menu.
|
|
7
|
+
*
|
|
8
|
+
* `profiler.action.ts` export const point = 'workspace.action'; export const actions: ActionContribution['actions']
|
|
9
|
+
* `navmesh.menu.ts` export const point = 'workspace.menu'; export const menu: MenuContribution
|
|
10
|
+
*
|
|
11
|
+
* A contribution's id is namespaced by the host under `tool:` like a
|
|
12
|
+
* utility's, so it can never collide with an editor action. `disabled` is
|
|
13
|
+
* asked at render, so an item may follow session state (a bake that has no
|
|
14
|
+
* navigation adapter to run on).
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export interface ContributedAction {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly label: string;
|
|
20
|
+
readonly execute: () => void | Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ActionContribution {
|
|
24
|
+
/**
|
|
25
|
+
* The palette actions — a fixed list, or a function for a LIVE set (one
|
|
26
|
+
* action per running XState actor): the host asks it when the palette
|
|
27
|
+
* opens and again whenever `subscribe` fires, the way a menu item's
|
|
28
|
+
* `disabled` is asked at render.
|
|
29
|
+
*/
|
|
30
|
+
readonly actions: readonly ContributedAction[] | (() => readonly ContributedAction[]);
|
|
31
|
+
/** Fires when a live `actions` set moved. Returns the unsubscribe. */
|
|
32
|
+
readonly subscribe?: (listener: () => void) => () => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** The application menus a package may append to (`edit` is the host's
|
|
36
|
+
* own — its verbs are the history's and the selection's), and `asset`: the
|
|
37
|
+
* Asset Browser's context menu on one asset, whose items receive the asset. */
|
|
38
|
+
export type ContributableMenu = 'view' | 'window' | 'debug' | 'tools' | 'help' | 'asset';
|
|
39
|
+
|
|
40
|
+
/** What a context menu's item is invoked ON. Empty for the application menus. */
|
|
41
|
+
export interface MenuSubject {
|
|
42
|
+
/** The project-relative path of the asset the `asset` menu opened on. */
|
|
43
|
+
readonly assetPath?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface ContributedMenuItem {
|
|
47
|
+
readonly id: string;
|
|
48
|
+
readonly label: string | (() => string);
|
|
49
|
+
readonly execute: (subject: MenuSubject) => void | Promise<void>;
|
|
50
|
+
readonly disabled?: (subject: MenuSubject) => boolean;
|
|
51
|
+
/** A `data-testid` for the item, when a driver needs to find it. */
|
|
52
|
+
readonly testId?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface MenuContribution {
|
|
56
|
+
readonly menu: ContributableMenu;
|
|
57
|
+
readonly items: readonly ContributedMenuItem[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* A HEADER item (`.header.tsx`, `point = 'workspace.header'`): a component
|
|
62
|
+
* the host renders in the project header's transport cluster, in `order`.
|
|
63
|
+
* The Play transport is the worked case — a package that plays a game puts
|
|
64
|
+
* its play/pause/stop there; a project that declares nothing to run has an
|
|
65
|
+
* empty cluster.
|
|
66
|
+
*/
|
|
67
|
+
export interface HeaderContribution {
|
|
68
|
+
readonly order?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Where the item renders: the project header's transport cluster (the
|
|
71
|
+
* default), or the 3D document's toolbar (`object3d-document`), where the
|
|
72
|
+
* component receives the open document's id and resolves its subject through
|
|
73
|
+
* its own integration. A runtime debug toggle on a mounted model lives there.
|
|
74
|
+
*/
|
|
75
|
+
readonly placement?: HeaderPlacement;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type HeaderPlacement = 'transport' | 'object3d-document';
|
|
79
|
+
|
|
80
|
+
/** What a `object3d-document` header item is rendered with. */
|
|
81
|
+
export interface DocumentHeaderItemProps {
|
|
82
|
+
readonly documentId: string;
|
|
83
|
+
}
|