@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/src/commands.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE COMMAND POINT — a package contributes session commands (WORKBENCH.md
|
|
3
|
+
* §Contribution points, `command`): the verbs `vgai eval` / `vgai <verb>` and
|
|
4
|
+
* every agent ride through the editor's ONE relay (`POST /__editor/command`),
|
|
5
|
+
* answered in the page by the editor's own switch for the host's vocabulary
|
|
6
|
+
* and by a contributed handler for a package's.
|
|
7
|
+
*
|
|
8
|
+
* A contribution module declares the point and exports one table:
|
|
9
|
+
*
|
|
10
|
+
* `instances.command.ts`
|
|
11
|
+
* export const point = 'workspace.command';
|
|
12
|
+
* export const commands: CommandContribution['commands'] = {
|
|
13
|
+
* 'list-instances': { derivedRefresh: 'if-content-changed', handle: () => … },
|
|
14
|
+
* };
|
|
15
|
+
*
|
|
16
|
+
* Each row carries what the host's own table carries per verb — the budget
|
|
17
|
+
* the relay waits for the WORK (`timeoutMs`, 5 s when omitted) and whether a
|
|
18
|
+
* completed command owes a tree-scale status derivation (`derivedRefresh`) —
|
|
19
|
+
* because the server sizes its wait from the same row: the page reports the
|
|
20
|
+
* rows it registered, and a contributed verb never falls to the generic
|
|
21
|
+
* budget by accident (the failure `command-table.ts` records).
|
|
22
|
+
*
|
|
23
|
+
* A type already in the host's table, or claimed by another contribution,
|
|
24
|
+
* refuses at registration by name.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export interface EditorCommandMessage {
|
|
28
|
+
readonly type: string;
|
|
29
|
+
readonly _requestId?: string;
|
|
30
|
+
readonly [key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The relay's answer shape (`command-table.ts`'s `CommandResult`): `ok`, an
|
|
34
|
+
* `error` sentence on failure, and `data` for verbs that answer with a
|
|
35
|
+
* payload — structured markers (`{ code: … }`) the SDK matches on, never
|
|
36
|
+
* message prose. */
|
|
37
|
+
export interface EditorCommandResult {
|
|
38
|
+
readonly ok: boolean;
|
|
39
|
+
readonly error?: string;
|
|
40
|
+
readonly data?: Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Whether a completed command owes a status derivation: none, only when
|
|
44
|
+
* the tree's content changed, or always. */
|
|
45
|
+
export type CommandDerivedRefresh = 'none' | 'if-content-changed' | 'always';
|
|
46
|
+
|
|
47
|
+
export interface CommandSpec {
|
|
48
|
+
/** How long the relay waits for this verb's WORK; the host default when omitted. */
|
|
49
|
+
readonly timeoutMs?: number;
|
|
50
|
+
/** Default `'always'`, the host's own default for an unknown verb. */
|
|
51
|
+
readonly derivedRefresh?: CommandDerivedRefresh;
|
|
52
|
+
readonly handle: (
|
|
53
|
+
command: EditorCommandMessage,
|
|
54
|
+
) => EditorCommandResult | Promise<EditorCommandResult>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface CommandContribution {
|
|
58
|
+
readonly commands: Readonly<Record<string, CommandSpec>>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** One registered row as the page reports it to the server. */
|
|
62
|
+
export interface ContributedCommandRow {
|
|
63
|
+
readonly type: string;
|
|
64
|
+
readonly timeoutMs: number;
|
|
65
|
+
readonly derivedRefresh: CommandDerivedRefresh;
|
|
66
|
+
}
|