@microverse.ts/host-surface 0.2.0 → 0.3.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.
- package/README.md +45 -15
- package/dist/application/ports/ScriptReferenceResolverPort.d.ts +13 -0
- package/dist/application/ports/ScriptReferenceResolverPort.d.ts.map +1 -0
- package/dist/application/useCases/compileBridgeDeclarationsFromHostSurfaceSpec.d.ts +3 -3
- package/dist/application/useCases/compileBridgeDeclarationsFromHostSurfaceSpec.d.ts.map +1 -1
- package/dist/application/useCases/compileHostSurface.d.ts +4 -3
- package/dist/application/useCases/compileHostSurface.d.ts.map +1 -1
- package/dist/domain/componentSlotPrelude.d.ts +8 -0
- package/dist/domain/componentSlotPrelude.d.ts.map +1 -1
- package/dist/domain/componentTypeSpec.d.ts +12 -0
- package/dist/domain/componentTypeSpec.d.ts.map +1 -0
- package/dist/domain/hostSurfaceManifest.d.ts +3 -2
- package/dist/domain/hostSurfaceManifest.d.ts.map +1 -1
- package/dist/domain/hostSurfaceSpecTypes.d.ts +89 -0
- package/dist/domain/hostSurfaceSpecTypes.d.ts.map +1 -0
- package/dist/domain/hostSurfaceTypes.d.ts +11 -90
- package/dist/domain/hostSurfaceTypes.d.ts.map +1 -1
- package/dist/domain/safeObjectKey.d.ts +1 -1
- package/dist/domain/safeObjectKey.d.ts.map +1 -1
- package/dist/domain/scriptCatalogManifest.d.ts +14 -0
- package/dist/domain/scriptCatalogManifest.d.ts.map +1 -0
- package/dist/domain/scriptProfileSpec.d.ts +31 -0
- package/dist/domain/scriptProfileSpec.d.ts.map +1 -0
- package/dist/domain/surfaceCapabilities.d.ts +1 -1
- package/dist/domain/surfaceCapabilities.d.ts.map +1 -1
- package/dist/domain/surfaceMethodDef.d.ts +1 -1
- package/dist/domain/surfaceMethodDef.d.ts.map +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +616 -296
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/builders/bridgeMergeEnv.d.ts +5 -10
- package/dist/infrastructure/builders/bridgeMergeEnv.d.ts.map +1 -1
- package/dist/infrastructure/builders/filterBridgeDeclarations.d.ts +11 -0
- package/dist/infrastructure/builders/filterBridgeDeclarations.d.ts.map +1 -0
- package/dist/infrastructure/builders/surfaceBuilder.d.ts +7 -2
- package/dist/infrastructure/builders/surfaceBuilder.d.ts.map +1 -1
- package/dist/infrastructure/components/hostScriptSession.d.ts +20 -5
- package/dist/infrastructure/components/hostScriptSession.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { CapabilityId, InMemoryCapabilityRegistry } from '@microverse.ts/runtime-capabilities';
|
|
2
1
|
import { Result } from '@microverse.ts/shared';
|
|
3
2
|
import { z } from 'zod';
|
|
4
3
|
import { ExecutionFailure, RunScriptResult, MicroverseId, MicroverseRuntime, ScriptAuditEvent, ScriptInstanceContext, ScriptPropertyBag, ScriptPropertyValue, TimeoutPolicy } from '@microverse.ts/runtime-core';
|
|
4
|
+
import { SchemaValidationPort } from '../../application/ports/SchemaValidationPort';
|
|
5
|
+
import { ScriptReferenceResolverPort } from '../../application/ports/ScriptReferenceResolverPort';
|
|
6
|
+
import { ResolvedScriptProfile } from '../../domain/scriptProfileSpec';
|
|
5
7
|
import { HostSurface, HostComponentHooksSpec } from '../../domain/hostSurfaceTypes';
|
|
6
8
|
import { LuaGlobalHookName } from '../../domain/luaGlobalHook';
|
|
7
9
|
export type ComponentEventHookInvokeArgs<TH extends HostComponentHooksSpec> = {
|
|
@@ -13,25 +15,37 @@ export type HostScriptSessionOptions<THost, THooks extends HostComponentHooksSpe
|
|
|
13
15
|
readonly surface: HostSurface<THooks>;
|
|
14
16
|
readonly host: THost;
|
|
15
17
|
readonly slotKey: MicroverseId;
|
|
16
|
-
readonly allowedCapabilities: readonly CapabilityId[];
|
|
17
18
|
readonly defaultTimeout?: TimeoutPolicy | undefined;
|
|
18
19
|
readonly script: ScriptInstanceContext;
|
|
20
|
+
/** Host-selected script profile (surface component type name). Applied at openSession before the main chunk. */
|
|
21
|
+
readonly profileId?: string | undefined;
|
|
22
|
+
/** When set, used instead of {@link HostSurfaceCore.getComponentType} (inline catalog profiles). */
|
|
23
|
+
readonly resolvedProfile?: ResolvedScriptProfile | undefined;
|
|
24
|
+
/** Lua singleton global for `Type:extend()` (e.g. `SortingAlgorithm`). Defaults to `profileId`. */
|
|
25
|
+
readonly profileSingleton?: string | undefined;
|
|
19
26
|
readonly enableComponentRuntime?: boolean | undefined;
|
|
20
|
-
readonly
|
|
27
|
+
readonly schemaValidation?: SchemaValidationPort | undefined;
|
|
28
|
+
readonly referenceResolver?: ScriptReferenceResolverPort | undefined;
|
|
21
29
|
readonly onScriptAudit?: ((event: ScriptAuditEvent) => void) | undefined;
|
|
22
30
|
};
|
|
23
31
|
export declare class HostScriptSession<THost, THooks extends HostComponentHooksSpec | undefined = undefined> {
|
|
24
32
|
private readonly opts;
|
|
25
33
|
private sandbox;
|
|
26
34
|
private readonly hostProps;
|
|
27
|
-
private readonly
|
|
35
|
+
private readonly schemaValidation;
|
|
36
|
+
private activeComponentType;
|
|
37
|
+
private hostProfileApplied;
|
|
28
38
|
readonly context: ScriptInstanceContext;
|
|
29
39
|
constructor(opts: HostScriptSessionOptions<THost, THooks>);
|
|
30
40
|
readonly openSession: () => Promise<void>;
|
|
31
|
-
readonly getCapabilityRegistry: () => InMemoryCapabilityRegistry;
|
|
32
41
|
private requireMicroverseSlot;
|
|
33
42
|
private mergeEnv;
|
|
43
|
+
private wrapReference;
|
|
34
44
|
private emitAudit;
|
|
45
|
+
private getActiveProfileName;
|
|
46
|
+
private profileSingletonName;
|
|
47
|
+
private singletonTypeNames;
|
|
48
|
+
private tryGetActiveProfile;
|
|
35
49
|
private validatePropsBag;
|
|
36
50
|
readonly getProps: () => Readonly<ScriptPropertyBag>;
|
|
37
51
|
readonly setProps: (bag: ScriptPropertyBag) => Promise<void>;
|
|
@@ -44,6 +58,7 @@ export declare class HostScriptSession<THost, THooks extends HostComponentHooksS
|
|
|
44
58
|
readonly dispose: () => Promise<void>;
|
|
45
59
|
/** Seeds host props bag without Lua sync (call before setProps after mount). */
|
|
46
60
|
readonly seedHostProps: (bag: ScriptPropertyBag) => void;
|
|
61
|
+
readonly getHostProfileApplied: () => boolean;
|
|
47
62
|
}
|
|
48
63
|
export {};
|
|
49
64
|
//# sourceMappingURL=hostScriptSession.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hostScriptSession.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/components/hostScriptSession.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"hostScriptSession.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/components/hostScriptSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAML,KAAK,gBAAgB,EACrB,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAE1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAGzF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qDAAqD,CAAC;AAQvG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAO5E,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAKpE,MAAM,MAAM,4BAA4B,CAAC,EAAE,SAAS,sBAAsB,IAAI;KAC3E,CAAC,IAAI,MAA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AAQ,CAAC,UAAU,GAAU,SAAS,iBAAiB,KAAG,OAAO,CAAC,IAAI,CAAC,CAErE;IAEF,QAAQ,CAAC,eAAe,QAAa,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CA+BpE;IAEF,QAAQ,CAAC,QAAQ,GAAU,QAAQ,MAAM,wDAOvC;IAEF,QAAQ,CAAC,mBAAmB,GAC1B,UAAU,MAAM,EAChB,GAAG,MAAM,CAAC,MAAM,GAAG,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,KAC9F,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC,CAwBnD;IAEF,QAAQ,CAAC,wBAAwB,EAM3B,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAEzC,QAAQ,CAAC,IAAI,GAAU,WAAW,MAAM,EAAE,YAAY,MAAM,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,wDAiB5F;IAEF,QAAQ,CAAC,OAAO,QAAa,OAAO,CAAC,IAAI,CAAC,CAQxC;IAEF,gFAAgF;IAChF,QAAQ,CAAC,aAAa,GAAI,KAAK,iBAAiB,KAAG,IAAI,CAMrD;IAEF,QAAQ,CAAC,qBAAqB,QAAO,OAAO,CAA4B;CACzE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microverse.ts/host-surface",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"zod": "^3.24.0",
|
|
30
|
-
"@microverse.ts/lua-defs": "0.
|
|
31
|
-
"@microverse.ts/runtime-bridge": "0.
|
|
32
|
-
"@microverse.ts/runtime-capabilities": "0.
|
|
33
|
-
"@microverse.ts/runtime-core": "0.
|
|
34
|
-
"@microverse.ts/runtime-zod": "0.
|
|
35
|
-
"@microverse.ts/shared": "0.
|
|
30
|
+
"@microverse.ts/lua-defs": "0.3.0",
|
|
31
|
+
"@microverse.ts/runtime-bridge": "0.3.0",
|
|
32
|
+
"@microverse.ts/runtime-capabilities": "0.3.0",
|
|
33
|
+
"@microverse.ts/runtime-core": "0.3.0",
|
|
34
|
+
"@microverse.ts/runtime-zod": "0.3.0",
|
|
35
|
+
"@microverse.ts/shared": "0.3.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"typescript": "^5.8.3",
|
|
39
39
|
"vite": "^8.0.0",
|
|
40
40
|
"vite-plugin-dts": "^4.5.4",
|
|
41
41
|
"vitest": "^3.1.4",
|
|
42
|
-
"@microverse.ts/runtime-wasm": "0.
|
|
42
|
+
"@microverse.ts/runtime-wasm": "0.3.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "vite build",
|