@unibridge/sdk 0.5.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +67 -0
  3. package/dist/client.d.ts +6 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +59 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/commands/component/contract.d.ts +174 -0
  8. package/dist/commands/component/contract.d.ts.map +1 -0
  9. package/dist/commands/component/contract.js +142 -0
  10. package/dist/commands/component/contract.js.map +1 -0
  11. package/dist/commands/contracts.d.ts +9 -0
  12. package/dist/commands/contracts.d.ts.map +1 -0
  13. package/dist/commands/contracts.js +2 -0
  14. package/dist/commands/contracts.js.map +1 -0
  15. package/dist/commands/define.d.ts +19 -0
  16. package/dist/commands/define.d.ts.map +1 -0
  17. package/dist/commands/define.js +20 -0
  18. package/dist/commands/define.js.map +1 -0
  19. package/dist/commands/domain/contract.d.ts +10 -0
  20. package/dist/commands/domain/contract.d.ts.map +1 -0
  21. package/dist/commands/domain/contract.js +12 -0
  22. package/dist/commands/domain/contract.js.map +1 -0
  23. package/dist/commands/execute/contract.d.ts +4 -0
  24. package/dist/commands/execute/contract.d.ts.map +1 -0
  25. package/dist/commands/execute/contract.js +10 -0
  26. package/dist/commands/execute/contract.js.map +1 -0
  27. package/dist/commands/gameobject/contract.d.ts +320 -0
  28. package/dist/commands/gameobject/contract.d.ts.map +1 -0
  29. package/dist/commands/gameobject/contract.js +154 -0
  30. package/dist/commands/gameobject/contract.js.map +1 -0
  31. package/dist/commands/log/contract.d.ts +46 -0
  32. package/dist/commands/log/contract.d.ts.map +1 -0
  33. package/dist/commands/log/contract.js +31 -0
  34. package/dist/commands/log/contract.js.map +1 -0
  35. package/dist/commands/registry.d.ts +303 -0
  36. package/dist/commands/registry.d.ts.map +1 -0
  37. package/dist/commands/registry.js +10 -0
  38. package/dist/commands/registry.js.map +1 -0
  39. package/dist/commands/runtime.d.ts +7 -0
  40. package/dist/commands/runtime.d.ts.map +1 -0
  41. package/dist/commands/runtime.js +2 -0
  42. package/dist/commands/runtime.js.map +1 -0
  43. package/dist/commands/scene/contract.d.ts +127 -0
  44. package/dist/commands/scene/contract.d.ts.map +1 -0
  45. package/dist/commands/scene/contract.js +79 -0
  46. package/dist/commands/scene/contract.js.map +1 -0
  47. package/dist/commands/status/contract.d.ts +18 -0
  48. package/dist/commands/status/contract.d.ts.map +1 -0
  49. package/dist/commands/status/contract.js +16 -0
  50. package/dist/commands/status/contract.js.map +1 -0
  51. package/dist/commands/test/contract.d.ts +111 -0
  52. package/dist/commands/test/contract.d.ts.map +1 -0
  53. package/dist/commands/test/contract.js +71 -0
  54. package/dist/commands/test/contract.js.map +1 -0
  55. package/dist/connection.d.ts +37 -0
  56. package/dist/connection.d.ts.map +1 -0
  57. package/dist/connection.js +311 -0
  58. package/dist/connection.js.map +1 -0
  59. package/dist/hash.d.ts +4 -0
  60. package/dist/hash.d.ts.map +1 -0
  61. package/dist/hash.js +41 -0
  62. package/dist/hash.js.map +1 -0
  63. package/dist/index.d.ts +5 -0
  64. package/dist/index.d.ts.map +1 -0
  65. package/dist/index.js +3 -0
  66. package/dist/index.js.map +1 -0
  67. package/dist/project.d.ts +6 -0
  68. package/dist/project.d.ts.map +1 -0
  69. package/dist/project.js +71 -0
  70. package/dist/project.js.map +1 -0
  71. package/dist/types.d.ts +55 -0
  72. package/dist/types.d.ts.map +1 -0
  73. package/dist/types.js +2 -0
  74. package/dist/types.js.map +1 -0
  75. package/package.json +31 -5
  76. package/src/client.ts +0 -76
  77. package/src/commands/contracts.ts +0 -4
  78. package/src/commands/define.ts +0 -56
  79. package/src/commands/domain/contract.ts +0 -15
  80. package/src/commands/execute/contract.ts +0 -12
  81. package/src/commands/registry.ts +0 -6
  82. package/src/commands/runtime.ts +0 -7
  83. package/src/commands/scene/contract.ts +0 -46
  84. package/src/commands/status/contract.ts +0 -19
  85. package/src/connection.test.ts +0 -330
  86. package/src/connection.ts +0 -382
  87. package/src/hash.test.ts +0 -48
  88. package/src/hash.ts +0 -50
  89. package/src/index.ts +0 -10
  90. package/src/project.test.ts +0 -93
  91. package/src/project.ts +0 -99
  92. package/src/types.ts +0 -64
  93. package/tsconfig.json +0 -16
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Marcus Sanatan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # @unibridge/sdk
2
+
3
+ TypeScript SDK for interacting with Unity Editor.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @unibridge/sdk
9
+ ```
10
+
11
+ ## Requirements
12
+
13
+ - Node.js `>=22.18.0`
14
+ - A Unity project
15
+ - UniBridge Unity plugin installed in that project
16
+
17
+ You can install the plugin with the CLI, or by adding this to your Unity `Packages/manifest.json`:
18
+
19
+ ```json
20
+ {
21
+ "dependencies": {
22
+ "com.msanatan.unibridge": "https://github.com/msanatan/unibridge.git?path=unity"
23
+ }
24
+ }
25
+ ```
26
+
27
+ ## Quick Start
28
+
29
+ ```ts
30
+ import { createClient } from '@unibridge/sdk'
31
+
32
+ const client = createClient({ projectPath: '/path/to/UnityProject' })
33
+
34
+ const status = await client.status()
35
+ console.log(status)
36
+
37
+ const logs = await client.logs({ severity: 'warn', limit: 50, offset: 0 })
38
+ console.log(logs)
39
+
40
+ const created = await client.gameObjectCreate({
41
+ name: 'Player',
42
+ dimension: '2d',
43
+ transform: { space: 'local', position: { x: 0, y: 1, z: 0 } },
44
+ })
45
+ console.log(created)
46
+
47
+ const tests = await client.testList({ mode: 'edit', limit: 50, offset: 0 })
48
+ console.log(tests)
49
+
50
+ const hierarchy = await client.sceneHierarchy({ limit: 200, offset: 0 })
51
+ console.log(hierarchy)
52
+
53
+ const run = await client.testRun({ mode: 'edit', filter: 'DomainReloadCommandHandlerTests' })
54
+ console.log(run)
55
+
56
+ client.close()
57
+ ```
58
+
59
+ ## Install Plugin Programmatically
60
+
61
+ ```ts
62
+ import { init } from '@unibridge/sdk'
63
+
64
+ await init({
65
+ projectPath: '/path/to/UnityProject',
66
+ })
67
+ ```
@@ -0,0 +1,6 @@
1
+ import type { ClientOptions, UniBridgeClient } from './types.ts';
2
+ export declare class UniBridgeError extends Error {
3
+ constructor(message: string);
4
+ }
5
+ export declare function createClient(options?: ClientOptions): UniBridgeClient;
6
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAmB,eAAe,EAAE,MAAM,YAAY,CAAA;AAKjF,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAI5B;AAqBD,wBAAgB,YAAY,CAAC,OAAO,GAAE,aAAkB,GAAG,eAAe,CAuCzE"}
package/dist/client.js ADDED
@@ -0,0 +1,59 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import { PipeConnection } from "./connection.js";
3
+ import { pipePath } from "./hash.js";
4
+ import { findUnityProject } from "./project.js";
5
+ import { buildClientMethods } from "./commands/define.js";
6
+ import { allCommands } from "./commands/registry.js";
7
+ export class UniBridgeError extends Error {
8
+ constructor(message) {
9
+ super(message);
10
+ this.name = 'UniBridgeError';
11
+ }
12
+ }
13
+ function unwrap(response) {
14
+ if (!response.success) {
15
+ throw new UniBridgeError(response.error ?? 'Command failed');
16
+ }
17
+ return response.result;
18
+ }
19
+ function createRuntime(sendCommand, ensureExecuteEnabled) {
20
+ return {
21
+ async send(command, params) {
22
+ return unwrap(await sendCommand(command, params));
23
+ },
24
+ ensureExecuteEnabled,
25
+ };
26
+ }
27
+ export function createClient(options = {}) {
28
+ const projectPath = options.projectPath ?? findUnityProject();
29
+ const connection = new PipeConnection({
30
+ projectPath,
31
+ connectTimeout: options.connectTimeout,
32
+ commandTimeout: options.commandTimeout,
33
+ reconnectTimeout: options.reconnectTimeout,
34
+ });
35
+ const callerExecuteEnabled = options.enableExecute ?? true;
36
+ async function sendCommand(command, params) {
37
+ await connection.connect(pipePath(projectPath));
38
+ return connection.send({ id: randomUUID(), command, params });
39
+ }
40
+ function ensureExecuteEnabled() {
41
+ if (!callerExecuteEnabled) {
42
+ throw new UniBridgeError('Execute is disabled by client or plugin configuration.');
43
+ }
44
+ const metadata = connection.serverMetadata();
45
+ const serverExecuteEnabled = metadata?.capabilities?.executeEnabled ?? true;
46
+ if (!serverExecuteEnabled) {
47
+ throw new UniBridgeError('Execute is disabled by client or plugin configuration.');
48
+ }
49
+ }
50
+ const runtime = createRuntime(sendCommand, ensureExecuteEnabled);
51
+ return {
52
+ projectPath,
53
+ ...buildClientMethods(runtime, allCommands),
54
+ close() {
55
+ connection.disconnect();
56
+ },
57
+ };
58
+ }
59
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version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BAAgB;KAC3C,CAAC,CAAA;IACF,MAAM,oBAAoB,GAAG,OAAO,CAAC,aAAa,IAAI,IAAI,CAAA;IAE1D,KAAK,UAAU,WAAW,CACxB,OAAe,EACf,MAA+B;QAE/B,MAAM,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAA;QAC/C,OAAO,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAA;IAC/D,CAAC;IAED,SAAS,oBAAoB;QAC3B,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC1B,MAAM,IAAI,cAAc,CAAC,wDAAwD,CAAC,CAAA;QACpF,CAAC;QAED,MAAM,QAAQ,GAAG,UAAU,CAAC,cAAc,EAAE,CAAA;QAC5C,MAAM,oBAAoB,GAAG,QAAQ,EAAE,YAAY,EAAE,cAAc,IAAI,IAAI,CAAA;QAC3E,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC1B,MAAM,IAAI,cAAc,CAAC,wDAAwD,CAAC,CAAA;QACpF,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAG,aAAa,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAA;IAEhE,OAAO;QACL,WAAW;QACX,GAAG,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC;QAC3C,KAAK;YACH,UAAU,CAAC,UAAU,EAAE,CAAA;QACzB,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,174 @@
1
+ import * as v from 'valibot';
2
+ import { type InferResult } from '../define.ts';
3
+ export declare const ComponentsListQuerySchema: v.ObjectSchema<{
4
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
5
+ readonly instanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
6
+ readonly type: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
7
+ readonly limit: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
8
+ readonly offset: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
9
+ }, undefined>;
10
+ export declare const ComponentsAddInputSchema: v.ObjectSchema<{
11
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
12
+ readonly instanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
13
+ readonly type: v.StringSchema<undefined>;
14
+ readonly initialValues: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
15
+ readonly strict: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
16
+ }, undefined>;
17
+ export declare const ComponentsGetQuerySchema: v.ObjectSchema<{
18
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
19
+ readonly instanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
20
+ readonly componentInstanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
21
+ readonly index: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
22
+ readonly type: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
23
+ }, undefined>;
24
+ export declare const ComponentsRemoveInputSchema: v.ObjectSchema<{
25
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
26
+ readonly instanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
27
+ readonly componentInstanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
28
+ readonly index: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
29
+ readonly type: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
30
+ }, undefined>;
31
+ export declare const ComponentsUpdateInputSchema: v.ObjectSchema<{
32
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
33
+ readonly instanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
34
+ readonly componentInstanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
35
+ readonly index: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
36
+ readonly type: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
37
+ readonly values: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
38
+ readonly strict: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
39
+ }, undefined>;
40
+ declare const ComponentListItemSchema: v.ObjectSchema<{
41
+ readonly instanceId: v.NumberSchema<undefined>;
42
+ readonly type: v.StringSchema<undefined>;
43
+ readonly index: v.NumberSchema<undefined>;
44
+ readonly enabled: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
45
+ }, undefined>;
46
+ export declare const ComponentsListResultSchema: v.ObjectSchema<{
47
+ readonly components: v.ArraySchema<v.ObjectSchema<{
48
+ readonly instanceId: v.NumberSchema<undefined>;
49
+ readonly type: v.StringSchema<undefined>;
50
+ readonly index: v.NumberSchema<undefined>;
51
+ readonly enabled: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
52
+ }, undefined>, undefined>;
53
+ readonly total: v.NumberSchema<undefined>;
54
+ readonly limit: v.NumberSchema<undefined>;
55
+ readonly offset: v.NumberSchema<undefined>;
56
+ }, undefined>;
57
+ export declare const ComponentsAddResultSchema: v.ObjectSchema<{
58
+ readonly instanceId: v.NumberSchema<undefined>;
59
+ readonly type: v.StringSchema<undefined>;
60
+ readonly appliedFields: v.ArraySchema<v.StringSchema<undefined>, undefined>;
61
+ readonly ignoredFields: v.ArraySchema<v.StringSchema<undefined>, undefined>;
62
+ }, undefined>;
63
+ export declare const ComponentsGetResultSchema: v.ObjectSchema<{
64
+ readonly component: v.ObjectSchema<{
65
+ readonly instanceId: v.NumberSchema<undefined>;
66
+ readonly type: v.StringSchema<undefined>;
67
+ readonly index: v.NumberSchema<undefined>;
68
+ readonly enabled: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
69
+ readonly serialized: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
70
+ }, undefined>;
71
+ }, undefined>;
72
+ export declare const ComponentsRemoveResultSchema: v.ObjectSchema<{
73
+ readonly removed: v.BooleanSchema<undefined>;
74
+ readonly instanceId: v.NumberSchema<undefined>;
75
+ readonly type: v.StringSchema<undefined>;
76
+ readonly index: v.NumberSchema<undefined>;
77
+ }, undefined>;
78
+ export declare const ComponentsUpdateResultSchema: v.ObjectSchema<{
79
+ readonly instanceId: v.NumberSchema<undefined>;
80
+ readonly type: v.StringSchema<undefined>;
81
+ readonly index: v.NumberSchema<undefined>;
82
+ readonly appliedFields: v.ArraySchema<v.StringSchema<undefined>, undefined>;
83
+ readonly ignoredFields: v.ArraySchema<v.StringSchema<undefined>, undefined>;
84
+ }, undefined>;
85
+ export declare const componentsListCommand: import("../define.ts").CommandDef<"componentsList", [query: {
86
+ path?: string | undefined;
87
+ instanceId?: number | undefined;
88
+ type?: string | undefined;
89
+ limit?: number | undefined;
90
+ offset?: number | undefined;
91
+ }], {
92
+ components: {
93
+ instanceId: number;
94
+ type: string;
95
+ index: number;
96
+ enabled?: boolean | null | undefined;
97
+ }[];
98
+ total: number;
99
+ limit: number;
100
+ offset: number;
101
+ }>;
102
+ export declare const componentsAddCommand: import("../define.ts").CommandDef<"componentsAdd", [input: {
103
+ path?: string | undefined;
104
+ instanceId?: number | undefined;
105
+ type: string;
106
+ initialValues?: {
107
+ [x: string]: unknown;
108
+ } | undefined;
109
+ strict?: boolean | undefined;
110
+ }], {
111
+ instanceId: number;
112
+ type: string;
113
+ appliedFields: string[];
114
+ ignoredFields: string[];
115
+ }>;
116
+ export declare const componentsGetCommand: import("../define.ts").CommandDef<"componentsGet", [query: {
117
+ path?: string | undefined;
118
+ instanceId?: number | undefined;
119
+ componentInstanceId?: number | undefined;
120
+ index?: number | undefined;
121
+ type?: string | undefined;
122
+ }], {
123
+ component: {
124
+ instanceId: number;
125
+ type: string;
126
+ index: number;
127
+ enabled?: boolean | null | undefined;
128
+ serialized: {
129
+ [x: string]: unknown;
130
+ };
131
+ };
132
+ }>;
133
+ export declare const componentsRemoveCommand: import("../define.ts").CommandDef<"componentsRemove", [input: {
134
+ path?: string | undefined;
135
+ instanceId?: number | undefined;
136
+ componentInstanceId?: number | undefined;
137
+ index?: number | undefined;
138
+ type?: string | undefined;
139
+ }], {
140
+ removed: boolean;
141
+ instanceId: number;
142
+ type: string;
143
+ index: number;
144
+ }>;
145
+ export declare const componentsUpdateCommand: import("../define.ts").CommandDef<"componentsUpdate", [input: {
146
+ path?: string | undefined;
147
+ instanceId?: number | undefined;
148
+ componentInstanceId?: number | undefined;
149
+ index?: number | undefined;
150
+ type?: string | undefined;
151
+ values: {
152
+ [x: string]: unknown;
153
+ };
154
+ strict?: boolean | undefined;
155
+ }], {
156
+ instanceId: number;
157
+ type: string;
158
+ index: number;
159
+ appliedFields: string[];
160
+ ignoredFields: string[];
161
+ }>;
162
+ export type ComponentsListQuery = v.InferOutput<typeof ComponentsListQuerySchema>;
163
+ export type ComponentsAddInput = v.InferOutput<typeof ComponentsAddInputSchema>;
164
+ export type ComponentsGetQuery = v.InferOutput<typeof ComponentsGetQuerySchema>;
165
+ export type ComponentsRemoveInput = v.InferOutput<typeof ComponentsRemoveInputSchema>;
166
+ export type ComponentsUpdateInput = v.InferOutput<typeof ComponentsUpdateInputSchema>;
167
+ export type ComponentListItem = v.InferOutput<typeof ComponentListItemSchema>;
168
+ export type ComponentsListResult = InferResult<typeof componentsListCommand>;
169
+ export type ComponentsAddResult = InferResult<typeof componentsAddCommand>;
170
+ export type ComponentsGetResult = InferResult<typeof componentsGetCommand>;
171
+ export type ComponentsRemoveResult = InferResult<typeof componentsRemoveCommand>;
172
+ export type ComponentsUpdateResult = InferResult<typeof componentsUpdateCommand>;
173
+ export {};
174
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/commands/component/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAiB,KAAK,WAAW,EAAE,M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M,MAAM,iBAAiB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAC7E,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAC5E,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAC1E,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAC1E,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAChF,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
@@ -0,0 +1,142 @@
1
+ import * as v from 'valibot';
2
+ import { defineCommand } from "../define.js";
3
+ export const ComponentsListQuerySchema = v.object({
4
+ path: v.optional(v.string()),
5
+ instanceId: v.optional(v.number()),
6
+ type: v.optional(v.string()),
7
+ limit: v.optional(v.number()),
8
+ offset: v.optional(v.number()),
9
+ });
10
+ export const ComponentsAddInputSchema = v.object({
11
+ path: v.optional(v.string()),
12
+ instanceId: v.optional(v.number()),
13
+ type: v.string(),
14
+ initialValues: v.optional(v.record(v.string(), v.unknown())),
15
+ strict: v.optional(v.boolean()),
16
+ });
17
+ export const ComponentsGetQuerySchema = v.object({
18
+ path: v.optional(v.string()),
19
+ instanceId: v.optional(v.number()),
20
+ componentInstanceId: v.optional(v.number()),
21
+ index: v.optional(v.number()),
22
+ type: v.optional(v.string()),
23
+ });
24
+ export const ComponentsRemoveInputSchema = v.object({
25
+ path: v.optional(v.string()),
26
+ instanceId: v.optional(v.number()),
27
+ componentInstanceId: v.optional(v.number()),
28
+ index: v.optional(v.number()),
29
+ type: v.optional(v.string()),
30
+ });
31
+ export const ComponentsUpdateInputSchema = v.object({
32
+ path: v.optional(v.string()),
33
+ instanceId: v.optional(v.number()),
34
+ componentInstanceId: v.optional(v.number()),
35
+ index: v.optional(v.number()),
36
+ type: v.optional(v.string()),
37
+ values: v.record(v.string(), v.unknown()),
38
+ strict: v.optional(v.boolean()),
39
+ });
40
+ const ComponentListItemSchema = v.object({
41
+ instanceId: v.number(),
42
+ type: v.string(),
43
+ index: v.number(),
44
+ enabled: v.optional(v.nullable(v.boolean())),
45
+ });
46
+ export const ComponentsListResultSchema = v.object({
47
+ components: v.array(ComponentListItemSchema),
48
+ total: v.number(),
49
+ limit: v.number(),
50
+ offset: v.number(),
51
+ });
52
+ export const ComponentsAddResultSchema = v.object({
53
+ instanceId: v.number(),
54
+ type: v.string(),
55
+ appliedFields: v.array(v.string()),
56
+ ignoredFields: v.array(v.string()),
57
+ });
58
+ export const ComponentsGetResultSchema = v.object({
59
+ component: v.object({
60
+ instanceId: v.number(),
61
+ type: v.string(),
62
+ index: v.number(),
63
+ enabled: v.optional(v.nullable(v.boolean())),
64
+ serialized: v.record(v.string(), v.unknown()),
65
+ }),
66
+ });
67
+ export const ComponentsRemoveResultSchema = v.object({
68
+ removed: v.boolean(),
69
+ instanceId: v.number(),
70
+ type: v.string(),
71
+ index: v.number(),
72
+ });
73
+ export const ComponentsUpdateResultSchema = v.object({
74
+ instanceId: v.number(),
75
+ type: v.string(),
76
+ index: v.number(),
77
+ appliedFields: v.array(v.string()),
78
+ ignoredFields: v.array(v.string()),
79
+ });
80
+ export const componentsListCommand = defineCommand({
81
+ method: 'componentsList',
82
+ wire: 'components.list',
83
+ params: (query) => ({
84
+ path: query.path,
85
+ instanceId: query.instanceId,
86
+ type: query.type,
87
+ limit: query.limit,
88
+ offset: query.offset,
89
+ }),
90
+ result: ComponentsListResultSchema,
91
+ });
92
+ export const componentsAddCommand = defineCommand({
93
+ method: 'componentsAdd',
94
+ wire: 'components.add',
95
+ params: (input) => ({
96
+ path: input.path,
97
+ instanceId: input.instanceId,
98
+ type: input.type,
99
+ initialValues: input.initialValues,
100
+ strict: input.strict,
101
+ }),
102
+ result: ComponentsAddResultSchema,
103
+ });
104
+ export const componentsGetCommand = defineCommand({
105
+ method: 'componentsGet',
106
+ wire: 'components.get',
107
+ params: (query) => ({
108
+ path: query.path,
109
+ instanceId: query.instanceId,
110
+ componentInstanceId: query.componentInstanceId,
111
+ index: query.index,
112
+ type: query.type,
113
+ }),
114
+ result: ComponentsGetResultSchema,
115
+ });
116
+ export const componentsRemoveCommand = defineCommand({
117
+ method: 'componentsRemove',
118
+ wire: 'components.remove',
119
+ params: (input) => ({
120
+ path: input.path,
121
+ instanceId: input.instanceId,
122
+ componentInstanceId: input.componentInstanceId,
123
+ index: input.index,
124
+ type: input.type,
125
+ }),
126
+ result: ComponentsRemoveResultSchema,
127
+ });
128
+ export const componentsUpdateCommand = defineCommand({
129
+ method: 'componentsUpdate',
130
+ wire: 'components.update',
131
+ params: (input) => ({
132
+ path: input.path,
133
+ instanceId: input.instanceId,
134
+ componentInstanceId: input.componentInstanceId,
135
+ index: input.index,
136
+ type: input.type,
137
+ values: input.values,
138
+ strict: input.strict,
139
+ }),
140
+ result: ComponentsUpdateResultSchema,
141
+ });
142
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../../src/commands/component/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAoB,MAAM,cAAc,CAAA;AAE9D,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC5B,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC5B,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,MAAM,EAAE,CAAC,CAAC,Q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, ComponentsGetResult, ComponentsRemoveInput, ComponentsRemoveResult, ComponentsUpdateInput, ComponentsUpdateResult, ComponentListItem, ComponentsListQuery, ComponentsListResult, } from './component/contract.ts';
2
+ export type { DomainReloadResult } from './domain/contract.ts';
3
+ export type { ExecuteResult } from './execute/contract.ts';
4
+ export type { CreateTransform, GameObjectCreateInput, GameObjectCreateResult, GameObjectDestroyInput, GameObjectDestroyResult, GameObjectGetInput, GameObjectGetResult, GameObjectReparentInput, GameObjectReparentResult, GameObjectUpdateInput, GameObjectUpdateResult, GameObjectDimension, PrimitiveTypeName, TransformSpace, Vector3Value, } from './gameobject/contract.ts';
5
+ export type { LogEntry, LogsQuery, LogsResult, LogsSeverity } from './log/contract.ts';
6
+ export type { SceneActiveResult, SceneCreateResult, SceneHierarchyNode, SceneHierarchyQuery, SceneHierarchyResult, SceneInfo, SceneListItem, SceneListQuery, SceneListResult, SceneOpenResult, } from './scene/contract.ts';
7
+ export type { StatusResult } from './status/contract.ts';
8
+ export type { TestListItem, TestListQuery, TestListResult, TestMode, TestRunItem, TestRunQuery, TestRunResult, TestStatus, } from './test/contract.ts';
9
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/commands/contracts.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,yBAAyB,CAAA;AAChC,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,YAAY,GACb,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACtF,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,aAAa,EACb,UAAU,GACX,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/commands/contracts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import * as v from 'valibot';
2
+ import type { CommandRuntime, ExecuteGuard } from './runtime.ts';
3
+ export interface CommandDef<TMethod extends string, TArgs extends unknown[], TResult> {
4
+ readonly method: TMethod;
5
+ readonly wire: string;
6
+ readonly params: (...args: TArgs) => Record<string, unknown>;
7
+ readonly result: v.GenericSchema<unknown, TResult>;
8
+ readonly guard?: 'execute';
9
+ }
10
+ export declare function defineCommand<TMethod extends string, TArgs extends unknown[], TResult>(def: CommandDef<TMethod, TArgs, TResult>): CommandDef<TMethod, TArgs, TResult>;
11
+ export type InferResult<T> = T extends CommandDef<string, any[], infer R> ? R : never;
12
+ type CommandMethod<T> = T extends CommandDef<string, infer TArgs, infer TResult> ? (...args: TArgs) => Promise<TResult> : never;
13
+ export type CommandMethods<T extends readonly CommandDef<string, any[], any>[]> = {
14
+ [K in T[number] as K['method']]: CommandMethod<K>;
15
+ };
16
+ export declare function invokeCommand<TArgs extends unknown[], TResult>(def: CommandDef<string, TArgs, TResult>, runtime: CommandRuntime & ExecuteGuard, ...args: TArgs): Promise<TResult>;
17
+ export declare function buildClientMethods<const T extends readonly CommandDef<string, any[], any>[]>(runtime: CommandRuntime & ExecuteGuard, defs: T): CommandMethods<T>;
18
+ export {};
19
+ //# sourceMappingURL=define.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../src/commands/define.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhE,MAAM,WAAW,UAAU,CACzB,OAAO,SAAS,MAAM,EACtB,KAAK,SAAS,OAAO,EAAE,EACvB,OAAO;IAEP,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5D,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAC3B;AAED,wBAAgB,aAAa,CAC3B,OAAO,SAAS,MAAM,EACtB,KAAK,SAAS,OAAO,EAAE,EACvB,OAAO,EACP,GAAG,EAAE,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAE/E;AAGD,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAErF,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,MAAM,EAAE,MAAM,KAAK,EAAE,MAAM,OAAO,CAAC,GAC5E,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,GACpC,KAAK,CAAA;AAET,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,SAAS,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC,EAAE,IAAI;KAC/E,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;CAClD,CAAA;AAED,wBAAsB,aAAa,CAAC,KAAK,SAAS,OAAO,EAAE,EAAE,OAAO,EAClE,GAAG,EAAE,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EACvC,OAAO,EAAE,cAAc,GAAG,YAAY,EACtC,GAAG,IAAI,EAAE,KAAK,GACb,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED,wBAAgB,kBAAkB,CAChC,KAAK,CAAC,CAAC,SAAS,SAAS,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC,EAAE,EACzD,OAAO,EAAE,cAAc,GAAG,YAAY,EAAE,IAAI,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAMpE"}
@@ -0,0 +1,20 @@
1
+ import * as v from 'valibot';
2
+ export function defineCommand(def) {
3
+ return def;
4
+ }
5
+ export async function invokeCommand(def, runtime, ...args) {
6
+ if (def.guard === 'execute') {
7
+ runtime.ensureExecuteEnabled();
8
+ }
9
+ const params = def.params(...args);
10
+ const raw = await runtime.send(def.wire, params);
11
+ return v.parse(def.result, raw);
12
+ }
13
+ export function buildClientMethods(runtime, defs) {
14
+ const methods = {};
15
+ for (const def of defs) {
16
+ methods[def.method] = (...args) => invokeCommand(def, runtime, ...args);
17
+ }
18
+ return methods;
19
+ }
20
+ //# sourceMappingURL=define.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/commands/define.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAe5B,MAAM,UAAU,aAAa,CAI3B,GAAwC;IACxC,OAAO,GAAG,CAAA;AACZ,CAAC;AAaD,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAuC,EACvC,OAAsC,EACtC,GAAG,IAAW;IAEd,IAAI,GAAG,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,CAAC,oBAAoB,EAAE,CAAA;IAChC,CAAC;IACD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAA;IAClC,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAChD,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACjC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAEhC,OAAsC,EAAE,IAAO;IAC/C,MAAM,OAAO,GAA6D,EAAE,CAAA;IAC5E,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAA;IACpF,CAAC;IACD,OAAO,OAA4B,CAAA;AACrC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import * as v from 'valibot';
2
+ import { type InferResult } from '../define.ts';
3
+ export declare const DomainReloadResultSchema: v.ObjectSchema<{
4
+ readonly triggered: v.BooleanSchema<undefined>;
5
+ }, undefined>;
6
+ export declare const domainReloadCommand: import("../define.ts").CommandDef<"domainReload", [], {
7
+ triggered: boolean;
8
+ }>;
9
+ export type DomainReloadResult = InferResult<typeof domainReloadCommand>;
10
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/commands/domain/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAE9D,eAAO,MAAM,wBAAwB;;aAEnC,CAAA;AAEF,eAAO,MAAM,mBAAmB;;EAK9B,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
@@ -0,0 +1,12 @@
1
+ import * as v from 'valibot';
2
+ import { defineCommand } from "../define.js";
3
+ export const DomainReloadResultSchema = v.object({
4
+ triggered: v.boolean(),
5
+ });
6
+ export const domainReloadCommand = defineCommand({
7
+ method: 'domainReload',
8
+ wire: 'domain.reload',
9
+ params: () => ({}),
10
+ result: DomainReloadResultSchema,
11
+ });
12
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../../src/commands/domain/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAoB,MAAM,cAAc,CAAA;AAE9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;CACvB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC;IAC/C,MAAM,EAAE,cAAc;IACtB,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IAClB,MAAM,EAAE,wBAAwB;CACjC,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { type InferResult } from '../define.ts';
2
+ export declare const executeCommand: import("../define.ts").CommandDef<"execute", [code: string], unknown>;
3
+ export type ExecuteResult = InferResult<typeof executeCommand>;
4
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/commands/execute/contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAE9D,eAAO,MAAM,cAAc,uEAMzB,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,cAAc,CAAC,CAAA"}
@@ -0,0 +1,10 @@
1
+ import * as v from 'valibot';
2
+ import { defineCommand } from "../define.js";
3
+ export const executeCommand = defineCommand({
4
+ method: 'execute',
5
+ wire: 'execute',
6
+ params: (code) => ({ code }),
7
+ result: v.unknown(),
8
+ guard: 'execute',
9
+ });
10
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../../src/commands/execute/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAoB,MAAM,cAAc,CAAA;AAE9D,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;IAC1C,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IACpC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,KAAK,EAAE,SAAS;CACjB,CAAC,CAAA"}