@microverse.ts/host-surface 0.1.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 +53 -22
- 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 +4 -4
- package/dist/application/useCases/compileBridgeDeclarationsFromHostSurfaceSpec.d.ts.map +1 -1
- package/dist/application/useCases/compileHostSurface.d.ts +7 -6
- package/dist/application/useCases/compileHostSurface.d.ts.map +1 -1
- package/dist/domain/componentSlotPrelude.d.ts +11 -0
- package/dist/domain/componentSlotPrelude.d.ts.map +1 -0
- 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 +16 -92
- package/dist/domain/hostSurfaceTypes.d.ts.map +1 -1
- package/dist/domain/luaGlobalHook.d.ts +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/scriptContextSymbol.d.ts +6 -0
- package/dist/domain/scriptContextSymbol.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/scriptPropertyMergeEnv.d.ts +6 -0
- package/dist/domain/scriptPropertyMergeEnv.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 +30 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +846 -258
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/adapters/augmentHostWithCapabilityRegistry.d.ts +1 -1
- package/dist/infrastructure/adapters/augmentHostWithCapabilityRegistry.d.ts.map +1 -1
- package/dist/infrastructure/adapters/augmentHostWithScriptContext.d.ts +4 -0
- package/dist/infrastructure/adapters/augmentHostWithScriptContext.d.ts.map +1 -0
- package/dist/infrastructure/adapters/zodSchemaValidationAdapter.d.ts +1 -1
- package/dist/infrastructure/adapters/zodSchemaValidationAdapter.d.ts.map +1 -1
- package/dist/infrastructure/builders/bridgeMergeEnv.d.ts +6 -8
- package/dist/infrastructure/builders/bridgeMergeEnv.d.ts.map +1 -1
- package/dist/infrastructure/builders/defineHostSurfaceFacade.d.ts +5 -5
- package/dist/infrastructure/builders/defineHostSurfaceFacade.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 +16 -11
- package/dist/infrastructure/builders/surfaceBuilder.d.ts.map +1 -1
- package/dist/infrastructure/components/hostScriptSession.d.ts +42 -72
- package/dist/infrastructure/components/hostScriptSession.d.ts.map +1 -1
- package/package.json +10 -9
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ScriptPropertyBag, ScriptPropertyValue } from '@microverse.ts/runtime-core';
|
|
2
|
+
export declare function scriptPropertyBagToMergeEnv(bag: ScriptPropertyBag): Record<string, unknown>;
|
|
3
|
+
export declare function scriptPropertyValueToPlain(value: ScriptPropertyValue): unknown;
|
|
4
|
+
export declare function mergeEnvSinkToScriptPropertyBag(sink: Record<string, unknown>): ScriptPropertyBag;
|
|
5
|
+
export declare function plainToScriptPropertyValue(value: unknown): ScriptPropertyValue | undefined;
|
|
6
|
+
//# sourceMappingURL=scriptPropertyMergeEnv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scriptPropertyMergeEnv.d.ts","sourceRoot":"","sources":["../../src/domain/scriptPropertyMergeEnv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAE1F,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAM3F;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAa9E;AAED,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,iBAAiB,CASnB;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,GAAG,SAAS,CAgC1F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CapabilityId } from '@microverse.ts/runtime-capabilities';
|
|
2
|
-
import { HostSurfaceMethodEntry, HostSurfaceSpec } from './
|
|
2
|
+
import { HostSurfaceMethodEntry, HostSurfaceSpec } from './hostSurfaceSpecTypes';
|
|
3
3
|
type InferMethodCapability<M> = M extends {
|
|
4
4
|
readonly capability: infer C extends CapabilityId;
|
|
5
5
|
} ? C : never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surfaceCapabilities.d.ts","sourceRoot":"","sources":["../../src/domain/surfaceCapabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,KAAK,EAAwB,sBAAsB,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"surfaceCapabilities.d.ts","sourceRoot":"","sources":["../../src/domain/surfaceCapabilities.ts"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AC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CapabilityId } from '@microverse.ts/runtime-capabilities';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { HostFnContext, HostSurfaceMethodEntry } from './
|
|
3
|
+
import { HostFnContext, HostSurfaceMethodEntry } from './hostSurfaceSpecTypes';
|
|
4
4
|
/**
|
|
5
5
|
* Consumer-facing method definition for the fluent {@link SurfaceBuilder} API.
|
|
6
6
|
* Use `requires: 'domain:action'` for the capability id.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surfaceMethodDef.d.ts","sourceRoot":"","sources":["../../src/domain/surfaceMethodDef.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAC5F,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"surfaceMethodDef.d.ts","sourceRoot":"","sources":["../../src/domain/surfaceMethodDef.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAC5F,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEpF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAC1B,KAAK,EACL,GAAG,EACH,IAAI,EACJ,IAAI,SAAS,GAAG,MAAM,IAAI,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,IACxD;IACF,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,GAAG,CAAC,EAAE;QACb,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;QAClE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACvC,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EACL,GAAG,EACH,IAAI,EACJ,KAAK,CAAC,IAAI,SAAS,GAAG,MAAM,IAAI,MAAM,EAAE,EAExC,GAAG,EAAE,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,GAC5C,sBAAsB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC,CAW/D"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
|
+
|
|
2
3
|
* Declarative **host surface** for Lua sandboxes: Zod-validated bridge methods, capability checks,
|
|
4
|
+
|
|
3
5
|
* `LuaDefManifest` generation for `.d.lua`, and {@link HostScriptSession} helpers.
|
|
6
|
+
|
|
4
7
|
*
|
|
8
|
+
|
|
5
9
|
* @packageDocumentation
|
|
10
|
+
|
|
6
11
|
*/
|
|
7
|
-
export {
|
|
8
|
-
export
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export type {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export type {
|
|
19
|
-
export type
|
|
20
|
-
export {
|
|
12
|
+
export { buildBridgeMergeEnvForProfile, } from './infrastructure/builders/bridgeMergeEnv';
|
|
13
|
+
export type { ComponentTypeDefInput, ComponentTypeDefRegistry, } from './domain/componentTypeSpec';
|
|
14
|
+
export type { ScriptProfileDefRegistry, ResolvedScriptProfile, ResolvedScriptProfileRegistry, } from './domain/scriptProfileSpec';
|
|
15
|
+
export { resolveScriptProfile, buildResolvedScriptProfileRegistry, scriptProfileComponentClassName, scriptProfilePropsAlias, scriptProfileStateAlias, scriptProfileBridgesClassName, } from './domain/scriptProfileSpec';
|
|
16
|
+
export type { ScriptCatalogEntry } from './domain/scriptCatalogManifest';
|
|
17
|
+
export { buildScriptCatalogLuaDefManifest, scriptCatalogComponentAlias } from './domain/scriptCatalogManifest';
|
|
18
|
+
export type { ScriptReferenceResolverPort, ScriptReferenceWrapContext, } from './application/ports/ScriptReferenceResolverPort';
|
|
19
|
+
export { buildComponentTypeSingletonsPreludeLua } from './domain/componentSlotPrelude';
|
|
20
|
+
export { BridgeBuilder, defineHostSurface, defineHostSurfaceFor, SurfaceBuilder, type AnyHostSurfaceMethod, type HostFnContext, type HostSurface, type HostSurfaceCore, type HostSurfaceMethodEntry, type HostSurfaceSpec, type HostSurfaceSpecForHost, type HostComponentHooksSpec, type LuaDefManifestGeneratorOpts, type SurfaceMethodDef, } from './infrastructure/builders/defineHostSurfaceFacade';
|
|
21
|
+
export { compileHostSurface, compileHostSurfaceFor, } from './application/useCases/compileHostSurface';
|
|
22
|
+
export { createBridgeDeclarationsFromHostSurfaceSpec } from './application/useCases/compileBridgeDeclarationsFromHostSurfaceSpec';
|
|
23
|
+
export type { SchemaValidationPort } from './application/ports/SchemaValidationPort';
|
|
24
|
+
export { HostScriptSession, type HostScriptSessionOptions, type ComponentEventHookInvokeArgs, } from './infrastructure/components/hostScriptSession';
|
|
25
|
+
export { luaGlobalHookName, type LuaGlobalHookName } from './domain/luaGlobalHook';
|
|
26
|
+
export { luaType } from './domain/zodLuaType';
|
|
27
|
+
export { zodToLuaTypeRef, type ZodToLuaTypeRefOptions } from './domain/zodToLuaTypeRef';
|
|
28
|
+
export { MICROVERSE_CAPABILITY_REGISTRY, type WithMicroverseCapabilityRegistry } from './domain/capabilityRegistrySymbol';
|
|
29
|
+
export { augmentHostWithCapabilityRegistry } from './infrastructure/adapters/augmentHostWithCapabilityRegistry';
|
|
30
|
+
export { augmentHostWithScriptContext } from './infrastructure/adapters/augmentHostWithScriptContext';
|
|
31
|
+
export { MICROVERSE_LUA_COMPONENT_SLOT_PRELUDE } from './domain/componentSlotPrelude';
|
|
32
|
+
export { mergeEnvSinkToScriptPropertyBag, scriptPropertyBagToMergeEnv, scriptPropertyValueToPlain, } from './domain/scriptPropertyMergeEnv';
|
|
33
|
+
export { MICROVERSE_SCRIPT_CONTEXT, type WithMicroverseScriptContext } from './domain/scriptContextSymbol';
|
|
34
|
+
export type { InferSurfaceCapabilities } from './domain/surfaceCapabilities';
|
|
35
|
+
export type { SurfaceCapabilityString } from './domain/surfaceCapabilityString';
|
|
36
|
+
export { collectCapabilitiesFromHostSurfaceSpec, pickSurfaceCapabilities } from './domain/surfaceCapabilities';
|
|
21
37
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAEL,6BAA6B,GAE9B,MAAM,0CAA0C,CAAC;AAElD,YAAY,EAEV,qBAAqB,EAErB,wBAAwB,GAEzB,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EAEV,wBAAwB,EAExB,qBAAqB,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