@snaptrude/plugin-client 0.2.9 → 0.5.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/AGENTS.md +38 -46
- package/CHANGELOG.md +11 -0
- package/CLAUDE.md +1 -1
- package/dist/api/index.d.ts +12 -16
- package/dist/api/index.d.ts.map +1 -1
- package/dist/index.cjs +23 -655
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -648
- package/dist/index.js.map +1 -1
- package/dist/rpc-proxy.d.ts +28 -0
- package/dist/rpc-proxy.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/api/index.ts +26 -22
- package/src/rpc-proxy.ts +56 -0
- package/dist/api/core/geom/arc.d.ts +0 -5
- package/dist/api/core/geom/arc.d.ts.map +0 -1
- package/dist/api/core/geom/curve.d.ts +0 -5
- package/dist/api/core/geom/curve.d.ts.map +0 -1
- package/dist/api/core/geom/index.d.ts +0 -17
- package/dist/api/core/geom/index.d.ts.map +0 -1
- package/dist/api/core/geom/line.d.ts +0 -5
- package/dist/api/core/geom/line.d.ts.map +0 -1
- package/dist/api/core/geom/profile.d.ts +0 -7
- package/dist/api/core/geom/profile.d.ts.map +0 -1
- package/dist/api/core/index.d.ts +0 -11
- package/dist/api/core/index.d.ts.map +0 -1
- package/dist/api/core/math/index.d.ts +0 -11
- package/dist/api/core/math/index.d.ts.map +0 -1
- package/dist/api/core/math/quat.d.ts +0 -5
- package/dist/api/core/math/quat.d.ts.map +0 -1
- package/dist/api/core/math/vec3.d.ts +0 -5
- package/dist/api/core/math/vec3.d.ts.map +0 -1
- package/dist/api/documentation/aiInspiration.d.ts +0 -24
- package/dist/api/documentation/aiInspiration.d.ts.map +0 -1
- package/dist/api/documentation/index.d.ts +0 -8
- package/dist/api/documentation/index.d.ts.map +0 -1
- package/dist/api/entity/buildableEnvelope.d.ts +0 -7
- package/dist/api/entity/buildableEnvelope.d.ts.map +0 -1
- package/dist/api/entity/department.d.ts +0 -7
- package/dist/api/entity/department.d.ts.map +0 -1
- package/dist/api/entity/index.d.ts +0 -20
- package/dist/api/entity/index.d.ts.map +0 -1
- package/dist/api/entity/referenceLine.d.ts +0 -9
- package/dist/api/entity/referenceLine.d.ts.map +0 -1
- package/dist/api/entity/space.d.ts +0 -15
- package/dist/api/entity/space.d.ts.map +0 -1
- package/dist/api/entity/story.d.ts +0 -9
- package/dist/api/entity/story.d.ts.map +0 -1
- package/dist/api/tools/copy.d.ts +0 -3
- package/dist/api/tools/copy.d.ts.map +0 -1
- package/dist/api/tools/index.d.ts +0 -14
- package/dist/api/tools/index.d.ts.map +0 -1
- package/dist/api/tools/offset.d.ts +0 -3
- package/dist/api/tools/offset.d.ts.map +0 -1
- package/dist/api/tools/selection.d.ts +0 -6
- package/dist/api/tools/selection.d.ts.map +0 -1
- package/dist/api/tools/transform.d.ts +0 -7
- package/dist/api/tools/transform.d.ts.map +0 -1
- package/dist/api/units/index.d.ts +0 -7
- package/dist/api/units/index.d.ts.map +0 -1
- package/src/api/core/geom/arc.ts +0 -7
- package/src/api/core/geom/curve.ts +0 -7
- package/src/api/core/geom/index.ts +0 -25
- package/src/api/core/geom/line.ts +0 -7
- package/src/api/core/geom/profile.ts +0 -17
- package/src/api/core/index.ts +0 -17
- package/src/api/core/math/index.ts +0 -17
- package/src/api/core/math/quat.ts +0 -7
- package/src/api/core/math/vec3.ts +0 -7
- package/src/api/documentation/aiInspiration.ts +0 -193
- package/src/api/documentation/index.ts +0 -13
- package/src/api/entity/buildableEnvelope.ts +0 -34
- package/src/api/entity/department.ts +0 -30
- package/src/api/entity/index.ts +0 -29
- package/src/api/entity/referenceLine.ts +0 -54
- package/src/api/entity/space.ts +0 -160
- package/src/api/entity/story.ts +0 -66
- package/src/api/tools/copy.ts +0 -10
- package/src/api/tools/index.ts +0 -33
- package/src/api/tools/offset.ts +0 -15
- package/src/api/tools/selection.ts +0 -15
- package/src/api/tools/transform.ts +0 -44
- package/src/api/units/index.ts +0 -34
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/api/core/index.ts","../src/api/core/math/index.ts","../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/geom/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/host-api.ts","../src/api/entity/index.ts","../src/api/entity/buildableEnvelope.ts","../src/api/entity/department.ts","../src/api/entity/referenceLine.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/tools/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/copy.ts","../src/api/tools/offset.ts","../src/api/units/index.ts","../src/api/documentation/index.ts","../src/api/documentation/aiInspiration.ts","../src/api/index.ts","../src/plugin-worker.ts"],"sourcesContent":["import { ClientPluginApi } from \"./api\"\n\nexport * from \"./api\"\nexport * from \"./host-api\"\nexport * from \"./plugin-worker\"\n\n/**\n * The Snaptrude plugin client API.\n *\n * The main entry point for plugins to interact with the Snaptrude platform.\n */\nexport const snaptrude = ClientPluginApi.getInstance()\n","import { PluginCoreApi } from \"@snaptrude/plugin-core\"\nimport { ClientMathApi } from \"./math\"\nimport { ClientGeomApi } from \"./geom\"\n\nexport class ClientCoreApi extends PluginCoreApi {\n public math: ClientMathApi\n public geom: ClientGeomApi\n\n constructor() {\n super()\n this.math = new ClientMathApi()\n this.geom = new ClientGeomApi()\n }\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import { PluginMathApi } from \"@snaptrude/plugin-core\"\nimport { ClientVec3Api } from \"./vec3\"\nimport { ClientQuatApi } from \"./quat\"\n\nexport class ClientMathApi extends PluginMathApi {\n public vec3: ClientVec3Api\n public quat: ClientQuatApi\n\n constructor() {\n super()\n this.vec3 = new ClientVec3Api()\n this.quat = new ClientQuatApi()\n }\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import { PluginVec3Api } from \"@snaptrude/plugin-core\"\n\nexport class ClientVec3Api extends PluginVec3Api {\n constructor() {\n super()\n }\n}\n","import { PluginQuatApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientQuatApi extends PluginQuatApi {\n constructor() {\n super()\n }\n}\n","import { PluginGeomApi } from \"@snaptrude/plugin-core\"\nimport { ClientLineApi } from \"./line\"\nimport { ClientArcApi } from \"./arc\"\nimport { ClientCurveApi } from \"./curve\"\nimport { ClientProfileApi } from \"./profile\"\n\nexport class ClientGeomApi extends PluginGeomApi {\n public line: ClientLineApi\n public arc: ClientArcApi\n public curve: ClientCurveApi\n public profile: ClientProfileApi\n\n constructor() {\n super()\n this.line = new ClientLineApi()\n this.arc = new ClientArcApi()\n this.curve = new ClientCurveApi()\n this.profile = new ClientProfileApi()\n }\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginLineApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientLineApi extends PluginLineApi {\n constructor() {\n super()\n }\n}\n","import { PluginArcApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientArcApi extends PluginArcApi {\n constructor() {\n super()\n }\n}\n","import { PluginCurveApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientCurveApi extends PluginCurveApi {\n constructor() {\n super()\n }\n}\n","import { PluginProfileApi } from \"@snaptrude/plugin-core\"\nimport type { PProfile, PluginProfileFromLinePointsArgs } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../../host-api\"\n\nexport class ClientProfileApi extends PluginProfileApi {\n constructor() {\n super()\n }\n\n public async fromLinePoints(args: PluginProfileFromLinePointsArgs): Promise<PProfile> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"core.geom.profile.fromLinePoints\",\n args,\n })\n }\n}\n","import * as Comlink from \"comlink\"\nimport type {\n PluginApiMethod,\n PluginApiCallPayload,\n PluginApiCallWrappedResult,\n PluginApiCallResult,\n} from \"@snaptrude/plugin-core\"\n\nexport interface HostApi {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallWrappedResult<M>>\n}\n\nexport interface HostApiWrapped {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallResult<M>>\n}\n\nexport function createHostApi(endpoint?: Comlink.Endpoint): HostApi {\n return Comlink.wrap<HostApi>(\n endpoint ?? (globalThis as unknown as Comlink.Endpoint)\n ) as unknown as HostApi\n}\n\nlet _instance: HostApi | null = null\n\nexport function getHostApi(): HostApiWrapped {\n if (!_instance) {\n _instance = createHostApi()\n }\n return {\n call: async <M extends PluginApiMethod>(payload: PluginApiCallPayload<M>): Promise<PluginApiCallResult<M>> => {\n if (!_instance) {\n throw new Error(\"Host API not initialized\")\n }\n return _instance.call(payload).then(result => {\n if (result.success) {\n return result.data\n } else {\n throw new Error(result.error)\n }\n })\n }\n }\n}\n","import { PluginEntityApi } from \"@snaptrude/plugin-core\"\nimport { ClientBuildableEnvelopeApi } from \"./buildableEnvelope\"\nimport { ClientDepartmentApi } from \"./department\"\nimport { ClientReferenceLineApi } from \"./referenceLine\"\nimport { ClientSpaceApi } from \"./space\"\nimport { ClientStoryApi } from \"./story\"\n\nexport class ClientEntityApi extends PluginEntityApi {\n public space: ClientSpaceApi\n public story: ClientStoryApi\n public referenceLine: ClientReferenceLineApi\n public department: ClientDepartmentApi\n public buildableEnvelope: ClientBuildableEnvelopeApi\n\n constructor() {\n super()\n this.space = new ClientSpaceApi()\n this.story = new ClientStoryApi()\n this.referenceLine = new ClientReferenceLineApi()\n this.department = new ClientDepartmentApi()\n this.buildableEnvelope = new ClientBuildableEnvelopeApi()\n }\n}\n\nexport * from \"./buildableEnvelope\"\nexport * from \"./department\"\nexport * from \"./referenceLine\"\nexport * from \"./space\"\nexport * from \"./story\"\n","import {\n PluginBuildableEnvelopeCreateArgs,\n PluginBuildableEnvelopeCreateResult,\n PluginBuildableEnvelopeUpdateArgs,\n PluginBuildableEnvelopeUpdateResult,\n PluginBuildableEnvelopeApi,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientBuildableEnvelopeApi extends PluginBuildableEnvelopeApi {\n constructor() {\n super()\n }\n\n public async create(\n args: PluginBuildableEnvelopeCreateArgs\n ): Promise<PluginBuildableEnvelopeCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.buildableEnvelope.create\",\n args,\n })\n }\n\n public async update(\n args: PluginBuildableEnvelopeUpdateArgs\n ): Promise<PluginBuildableEnvelopeUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.buildableEnvelope.update\",\n args,\n })\n }\n}\n","import {\n PluginDepartmentApi,\n PluginDepartmentCreateArgs,\n PluginDepartmentCreateResult,\n PluginDepartmentGetAllResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientDepartmentApi extends PluginDepartmentApi {\n constructor() {\n super()\n }\n\n public async create(\n args: PluginDepartmentCreateArgs\n ): Promise<PluginDepartmentCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.create\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginDepartmentGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.getAll\",\n })\n }\n}\n","import {\n PluginReferenceLineApi,\n PluginReferenceLineCreateMultiArgs,\n PluginReferenceLineCreateMultiResult,\n PluginReferenceLineGetArgs,\n PluginReferenceLineGetResult,\n PluginReferenceLineGetAllResult,\n PluginReferenceLineDeleteArgs,\n PluginReferenceLineDeleteResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientReferenceLineApi extends PluginReferenceLineApi {\n constructor() {\n super()\n }\n\n public async createMulti(\n args: PluginReferenceLineCreateMultiArgs\n ): Promise<PluginReferenceLineCreateMultiResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.createMulti\",\n args,\n })\n }\n\n public async get(\n args: PluginReferenceLineGetArgs\n ): Promise<PluginReferenceLineGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.get\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginReferenceLineGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.getAll\",\n })\n }\n\n public async delete(\n args: PluginReferenceLineDeleteArgs\n ): Promise<PluginReferenceLineDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.delete\",\n args,\n })\n }\n}\n","import {\n PluginSpaceApi,\n PluginSpaceCreateRectangularArgs,\n PluginSpaceCreateRectangularResult,\n PluginSpaceCreateFromProfileArgs,\n PluginSpaceCreateFromProfileResult,\n PluginSpaceDeleteArgs,\n PluginSpaceDeleteResult,\n PluginSpaceGetArgs,\n PluginSpaceGetResult,\n PluginSpaceGetAllResult,\n PluginSpaceUpdateGeometryFromProfileArgs,\n PluginSpaceUpdateGeometryFromProfileResult,\n PluginSpaceUpdateArgs,\n PluginSpaceUpdateResult,\n PluginSpaceBulkCreateArgs,\n PluginSpaceBulkCreateResult,\n PluginSpaceBulkUpdateArgs,\n PluginSpaceBulkUpdateResult,\n PluginSpaceBulkDeleteArgs,\n PluginSpaceBulkDeleteResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSpaceApi extends PluginSpaceApi {\n constructor() {\n super()\n }\n\n public async createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): Promise<PluginSpaceCreateRectangularResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createRectangular\",\n args: {\n position,\n dimensions,\n },\n })\n }\n\n public async createFromProfile({\n profile,\n innerProfiles,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): Promise<PluginSpaceCreateFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createFromProfile\",\n args: {\n profile,\n innerProfiles,\n extrudeHeight,\n position,\n },\n })\n }\n\n public async updateGeometryFromProfile({\n spaceId,\n profile,\n extrudeHeight,\n }: PluginSpaceUpdateGeometryFromProfileArgs): Promise<PluginSpaceUpdateGeometryFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.updateGeometryFromProfile\",\n args: {\n spaceId,\n profile,\n extrudeHeight,\n },\n })\n }\n\n public async get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): Promise<PluginSpaceGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.get\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginSpaceGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.getAll\",\n })\n }\n\n public async delete({\n spaceId,\n }: PluginSpaceDeleteArgs): Promise<PluginSpaceDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.delete\",\n args: {\n spaceId,\n },\n })\n }\n\n public async update({\n spaceId,\n properties,\n }: PluginSpaceUpdateArgs): Promise<PluginSpaceUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.update\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async bulkCreate({\n items,\n }: PluginSpaceBulkCreateArgs): Promise<PluginSpaceBulkCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkCreate\",\n args: {\n items,\n },\n })\n }\n\n public async bulkUpdate({\n items,\n }: PluginSpaceBulkUpdateArgs): Promise<PluginSpaceBulkUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkUpdate\",\n args: {\n items,\n },\n })\n }\n\n public async bulkDelete({\n spaceIds,\n }: PluginSpaceBulkDeleteArgs): Promise<PluginSpaceBulkDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkDelete\",\n args: {\n spaceIds,\n },\n })\n }\n}\n","import {\n PluginStoryApi,\n PluginStoryGetArgs,\n PluginStoryGetResult,\n PluginStoryGetAllResult,\n PluginStoryCreateArgs,\n PluginStoryCreateResult,\n PluginStoryUpdateArgs,\n PluginStoryUpdateResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientStoryApi extends PluginStoryApi {\n constructor() {\n super()\n }\n\n public async get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): Promise<PluginStoryGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.get\",\n args: {\n storyValue,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginStoryGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.getAll\",\n })\n }\n\n public async create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): Promise<PluginStoryCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.create\",\n args: {\n storyValue,\n height,\n },\n })\n }\n\n public async update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): Promise<PluginStoryUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.update\",\n args: {\n storyValue,\n height,\n },\n })\n }\n}\n","import { PluginToolsApi } from \"@snaptrude/plugin-core\"\nimport type {\n PluginCopyArgs,\n PluginCopyResult,\n PluginOffsetArgs,\n PluginOffsetResult,\n} from \"@snaptrude/plugin-core\"\nimport { ClientSelectionApi } from \"./selection\"\nimport { ClientTransformApi } from \"./transform\"\nimport { copy } from \"./copy\"\nimport { offset } from \"./offset\"\n\nexport class ClientToolsApi extends PluginToolsApi {\n public selection: ClientSelectionApi\n public transform: ClientTransformApi\n\n constructor() {\n super()\n this.selection = new ClientSelectionApi()\n this.transform = new ClientTransformApi()\n }\n\n public async copy(args: PluginCopyArgs): Promise<PluginCopyResult> {\n return copy(args)\n }\n\n public async offset(args: PluginOffsetArgs): Promise<PluginOffsetResult> {\n return offset(args)\n }\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import { PluginSelectionApi, PluginSelectionGetResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSelectionApi extends PluginSelectionApi {\n constructor() {\n super()\n }\n\n public async get(): Promise<PluginSelectionGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.selection.get\",\n })\n }\n}\n","import {\n PluginTransformApi,\n PluginMoveArgs,\n PluginRotateArgs,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientTransformApi extends PluginTransformApi {\n constructor() {\n super()\n }\n\n public async move({\n componentIds,\n displacement,\n }: PluginMoveArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.move\",\n args: {\n componentIds,\n displacement,\n },\n })\n }\n\n public async rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.rotate\",\n args: {\n componentIds,\n angle,\n axis,\n pivot,\n },\n })\n }\n}\n","import type { PluginCopyArgs, PluginCopyResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport async function copy(args: PluginCopyArgs): Promise<PluginCopyResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.copy\",\n args,\n })\n}\n","import type {\n PluginOffsetArgs,\n PluginOffsetResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport async function offset(\n args: PluginOffsetArgs,\n): Promise<PluginOffsetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.offset\",\n args,\n })\n}\n","import {\n PluginUnitsApi,\n PluginUnitsConvertFromArgs,\n PluginUnitsConvertFromResult,\n PluginUnitsConvertToArgs,\n PluginUnitsConvertToResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientUnitsApi extends PluginUnitsApi {\n constructor() {\n super()\n }\n\n public async convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): Promise<PluginUnitsConvertFromResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertFrom\",\n args,\n })\n }\n\n public async convertTo(\n args: PluginUnitsConvertToArgs,\n ): Promise<PluginUnitsConvertToResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertTo\",\n args,\n })\n }\n}\n","import { PluginDocumentationApi } from \"@snaptrude/plugin-core\"\nimport { ClientDocumentationAIInspirationApi } from \"./aiInspiration\"\n\nexport class ClientDocumentationApi extends PluginDocumentationApi {\n public aiInspiration: ClientDocumentationAIInspirationApi\n\n constructor() {\n super()\n this.aiInspiration = new ClientDocumentationAIInspirationApi()\n }\n}\n\nexport * from \"./aiInspiration\"\n","import type {\n PluginAIInspirationCancelJobResult,\n PluginAIInspirationDeleteRecipeArgs,\n PluginAIInspirationDeleteRecipeResult,\n PluginAIInspirationExtractRecipeFromShapeArgs,\n PluginAIInspirationExtractionResult,\n PluginAIInspirationGenerateArgs,\n PluginAIInspirationGetJobResult,\n PluginAIInspirationGetModelCapabilitiesArgs,\n PluginAIInspirationGetModelCapabilitiesResult,\n PluginAIInspirationGetSelectionResult,\n PluginAIInspirationGetPresetCatalogResult,\n PluginAIInspirationGetWorkflowForShapeArgs,\n PluginAIInspirationGetWorkflowForShapeResult,\n PluginAIInspirationJobArgs,\n PluginAIInspirationListJobsResult,\n PluginAIInspirationListModelsResult,\n PluginAIInspirationListRecipesResult,\n PluginAIInspirationListSourcesArgs,\n PluginAIInspirationListSourcesResult,\n PluginAIInspirationRefineArgs,\n PluginAIInspirationRerunPlanResult,\n PluginAIInspirationRerunSelectedBranchArgs,\n PluginAIInspirationRunRecipeArgs,\n PluginAIInspirationRunResult,\n PluginAIInspirationSaveRecipeArgs,\n PluginAIInspirationSaveRecipeResult,\n} from \"@snaptrude/plugin-core\"\nimport { PluginDocumentationAIInspirationApi } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientDocumentationAIInspirationApi extends PluginDocumentationAIInspirationApi {\n constructor() {\n super()\n }\n\n public async listModels(): Promise<PluginAIInspirationListModelsResult> {\n const hostApi = getHostApi()\n return hostApi.call({ method: \"documentation.aiInspiration.listModels\" })\n }\n\n public async getModelCapabilities(\n args: PluginAIInspirationGetModelCapabilitiesArgs,\n ): Promise<PluginAIInspirationGetModelCapabilitiesResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getModelCapabilities\",\n args,\n })\n }\n\n public async listSources(\n args: PluginAIInspirationListSourcesArgs,\n ): Promise<PluginAIInspirationListSourcesResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.listSources\",\n args,\n })\n }\n\n public async getSelection(): Promise<PluginAIInspirationGetSelectionResult> {\n const hostApi = getHostApi()\n return hostApi.call({ method: \"documentation.aiInspiration.getSelection\" })\n }\n\n public async getPresetCatalog(): Promise<PluginAIInspirationGetPresetCatalogResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getPresetCatalog\",\n })\n }\n\n public async generate(\n args: PluginAIInspirationGenerateArgs,\n ): Promise<PluginAIInspirationRunResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.generate\",\n args,\n })\n }\n\n public async refine(\n args: PluginAIInspirationRefineArgs,\n ): Promise<PluginAIInspirationRunResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.refine\",\n args,\n })\n }\n\n public async getJob(\n args: PluginAIInspirationJobArgs,\n ): Promise<PluginAIInspirationGetJobResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getJob\",\n args,\n })\n }\n\n public async cancelJob(\n args: PluginAIInspirationJobArgs,\n ): Promise<PluginAIInspirationCancelJobResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.cancelJob\",\n args,\n })\n }\n\n public async listJobs(): Promise<PluginAIInspirationListJobsResult> {\n const hostApi = getHostApi()\n return hostApi.call({ method: \"documentation.aiInspiration.listJobs\" })\n }\n\n public async getWorkflowForShape(\n args: PluginAIInspirationGetWorkflowForShapeArgs,\n ): Promise<PluginAIInspirationGetWorkflowForShapeResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getWorkflowForShape\",\n args,\n })\n }\n\n public async getSelectedBranchRerunPlan(\n args: PluginAIInspirationGetWorkflowForShapeArgs,\n ): Promise<PluginAIInspirationRerunPlanResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getSelectedBranchRerunPlan\",\n args,\n })\n }\n\n public async rerunSelectedBranch(\n args: PluginAIInspirationRerunSelectedBranchArgs,\n ): Promise<PluginAIInspirationRunResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.rerunSelectedBranch\",\n args,\n })\n }\n\n public async extractRecipeFromShape(\n args: PluginAIInspirationExtractRecipeFromShapeArgs,\n ): Promise<PluginAIInspirationExtractionResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.extractRecipeFromShape\",\n args,\n })\n }\n\n public async listRecipes(): Promise<PluginAIInspirationListRecipesResult> {\n const hostApi = getHostApi()\n return hostApi.call({ method: \"documentation.aiInspiration.listRecipes\" })\n }\n\n public async saveRecipe(\n args: PluginAIInspirationSaveRecipeArgs,\n ): Promise<PluginAIInspirationSaveRecipeResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.saveRecipe\",\n args,\n })\n }\n\n public async deleteRecipe(\n args: PluginAIInspirationDeleteRecipeArgs,\n ): Promise<PluginAIInspirationDeleteRecipeResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.deleteRecipe\",\n args,\n })\n }\n\n public async runRecipe(\n args: PluginAIInspirationRunRecipeArgs,\n ): Promise<PluginAIInspirationRunResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.runRecipe\",\n args,\n })\n }\n}\n","import { ClientCoreApi } from \"./core\"\nimport { ClientEntityApi } from \"./entity\"\nimport { ClientToolsApi } from \"./tools\"\nimport { ClientUnitsApi } from \"./units\"\nimport { ClientDocumentationApi } from \"./documentation\"\nimport { PluginApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientPluginApi extends PluginApi {\n private static instance: ClientPluginApi\n\n public core: ClientCoreApi\n public tools: ClientToolsApi\n public entity: ClientEntityApi\n public units: ClientUnitsApi\n public documentation: ClientDocumentationApi\n\n private constructor() {\n super()\n this.core = new ClientCoreApi()\n this.tools = new ClientToolsApi()\n this.entity = new ClientEntityApi()\n this.units = new ClientUnitsApi()\n this.documentation = new ClientDocumentationApi()\n }\n\n static getInstance(): ClientPluginApi {\n if (!ClientPluginApi.instance) {\n ClientPluginApi.instance = new ClientPluginApi()\n }\n return ClientPluginApi.instance\n }\n}\n\nexport * from \"./core\"\nexport * from \"./documentation\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n","import * as Comlink from \"comlink\"\n\nexport interface UIMessage {\n action: string\n payload: unknown\n}\n\ninterface PluginConfig {\n pluginId: string\n}\n\n/**\n * Base class for Snaptrude plugin workers.\n *\n * Handles Comlink wiring, host communication, and the standard lifecycle\n * methods (`init`, `destroy`, `ping`, `onUIMessage`). Subclass this and\n * override only the methods you need — then call `start()` to expose the\n * worker API.\n *\n * The plugin ID is received automatically from the host during\n * initialization — no need to pass it manually.\n *\n * @example\n * ```ts\n * import { PluginWorker } from \"@snaptrude/plugin-client\";\n *\n * class MyPlugin extends PluginWorker {\n * async onUIMessage(message: UIMessage) {\n * // handle messages from the UI panel\n * }\n * }\n *\n * new MyPlugin().start();\n * ```\n */\nexport abstract class PluginWorker {\n protected pluginId!: string\n private hostAPI: Comlink.Remote<Record<string, unknown>>\n\n constructor() {\n this.hostAPI = Comlink.wrap<Record<string, unknown>>(\n self as unknown as Comlink.Endpoint\n )\n }\n\n protected sendToUI(action: string, payload: unknown): void {\n ;(this.hostAPI as Record<string, any>).ui.sendToUI({ action, payload })\n }\n\n /**\n * Signal the host that this plugin has finished its work and should be\n * stopped. Use this in headless (UI-less) plugins that run a task and\n * self-terminate.\n */\n protected complete(): void {\n ;(this.hostAPI as Record<string, any>).lifecycle.complete()\n }\n\n async init(): Promise<void> {\n console.log(this.pluginId, \"init() called\")\n console.log(this.pluginId, \"Initialization complete\")\n }\n\n async destroy(): Promise<void> {\n console.log(this.pluginId, \"destroy() called — cleaning up\")\n }\n\n async ping(): Promise<string> {\n return \"pong\"\n }\n\n async onUIMessage(_message: UIMessage): Promise<void> {\n // Override in subclass to handle UI messages\n }\n\n /**\n * Expose the worker API via Comlink and start listening.\n * Call this once after constructing the plugin instance.\n *\n * The host calls `init(config)` with `{ pluginId }`,\n * which is captured here to set `this.pluginId` before the\n * subclass's `init()` runs.\n */\n start(): void {\n Comlink.expose(\n {\n init: (config: PluginConfig) => {\n this.pluginId = config.pluginId\n return this.init()\n },\n destroy: () => this.destroy(),\n ping: () => this.ping(),\n onUIMessage: (message: UIMessage) => this.onUIMessage(message),\n },\n self as unknown as Comlink.Endpoint\n )\n console.log(\"Worker loaded, API exposed via Comlink\")\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,sBAA8B;;;ACA9B,IAAAC,sBAA8B;;;ACA9B,yBAA8B;AAEvB,IAAM,gBAAN,cAA4B,iCAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,IAAAC,sBAA8B;AAEvB,IAAM,gBAAN,cAA4B,kCAAc;AAAA,E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gB;AAAA,EACzB;AACF;;;AC/BA,IAAAC,WAAyB;AAmClB,IAAe,eAAf,MAA4B;AAAA,EAIjC,cAAc;AACZ,SAAK,UAAkB;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AAAA,EAEU,SAAS,QAAgB,SAAwB;AACzD;AAAC,IAAC,KAAK,QAAgC,GAAG,SAAS,EAAE,QAAQ,QAAQ,CAAC;AAAA,EACxE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOU,WAAiB;AACzB;AAAC,IAAC,KAAK,QAAgC,UAAU,SAAS;AAAA,EAC5D;AAAA,EAEA,MAAM,OAAsB;AAC1B,YAAQ,IAAI,KAAK,UAAU,eAAe;AAC1C,YAAQ,IAAI,KAAK,UAAU,yBAAyB;AAAA,EACtD;AAAA,EAEA,MAAM,UAAyB;AAC7B,YAAQ,IAAI,KAAK,UAAU,qCAAgC;AAAA,EAC7D;AAAA,EAEA,MAAM,OAAwB;AAC5B,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,YAAY,UAAoC;AAAA,EAEtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,QAAc;AACZ,IAAQ;AAAA,MACN;AAAA,QACE,MAAM,CAAC,WAAyB;AAC9B,eAAK,WAAW,OAAO;AACvB,iBAAO,KAAK,KAAK;AAAA,QACnB;AAAA,QACA,SAAS,MAAM,KAAK,QAAQ;AAAA,QAC5B,MAAM,MAAM,KAAK,KAAK;AAAA,QACtB,aAAa,CAAC,YAAuB,KAAK,YAAY,OAAO;AAAA,MAC/D;AAAA,MACA;AAAA,IACF;AACA,YAAQ,IAAI,wCAAwC;AAAA,EACtD;AACF;;;A1BvFO,IAAM,YAAY,gBAAgB,YAAY;","names":["import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","Comlink"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/api/index.ts","../src/host-api.ts","../src/rpc-proxy.ts","../src/plugin-worker.ts"],"sourcesContent":["import { ClientPluginApi } from \"./api\"\n\nexport * from \"./api\"\nexport * from \"./host-api\"\nexport * from \"./plugin-worker\"\n\n/**\n * The Snaptrude plugin client API.\n *\n * The main entry point for plugins to interact with the Snaptrude platform.\n */\nexport const snaptrude = ClientPluginApi.getInstance()\n","import {\n PluginApi,\n PluginCoreApi,\n PluginDesignApi,\n PluginEntityApi,\n PluginProgramApi,\n PluginPresentationApi,\n} from \"@snaptrude/plugin-core\"\nimport { createRpcNamespace } from \"../rpc-proxy\"\n\nexport class ClientPluginApi extends PluginApi {\n private static instance: ClientPluginApi\n\n /**\n * Every namespace is fully remote under the all-handle model: math/geom now\n * cross to the host (values are opaque handles), so there is no in-worker\n * compute left. All dispatch through a single generic RPC Proxy. Units live\n * under `core.units`, so they ride the `core` proxy.\n */\n public core: PluginCoreApi\n public design: PluginDesignApi\n public entity: PluginEntityApi\n public program: PluginProgramApi\n public presentation: PluginPresentationApi\n\n private constructor() {\n super()\n this.core = createRpcNamespace<PluginCoreApi>(\"core\")\n this.design = createRpcNamespace<PluginDesignApi>(\"design\")\n this.entity = createRpcNamespace<PluginEntityApi>(\"entity\")\n this.program = createRpcNamespace<PluginProgramApi>(\"program\")\n this.presentation =\n createRpcNamespace<PluginPresentationApi>(\"presentation\")\n }\n\n static getInstance(): ClientPluginApi {\n if (!ClientPluginApi.instance) {\n ClientPluginApi.instance = new ClientPluginApi()\n }\n return ClientPluginApi.instance\n }\n}\n","import * as Comlink from \"comlink\"\nimport type {\n PluginApiMethod,\n PluginApiCallPayload,\n PluginApiCallWrappedResult,\n PluginApiCallResult,\n} from \"@snaptrude/plugin-core\"\n\nexport interface HostApi {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallWrappedResult<M>>\n}\n\nexport interface HostApiWrapped {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallResult<M>>\n}\n\nexport function createHostApi(endpoint?: Comlink.Endpoint): HostApi {\n return Comlink.wrap<HostApi>(\n endpoint ?? (globalThis as unknown as Comlink.Endpoint)\n ) as unknown as HostApi\n}\n\nlet _instance: HostApi | null = null\n\nexport function getHostApi(): HostApiWrapped {\n if (!_instance) {\n _instance = createHostApi()\n }\n return {\n call: async <M extends PluginApiMethod>(payload: PluginApiCallPayload<M>): Promise<PluginApiCallResult<M>> => {\n if (!_instance) {\n throw new Error(\"Host API not initialized\")\n }\n return _instance.call(payload).then(result => {\n if (result.success) {\n return result.data\n } else {\n throw new Error(result.error)\n }\n })\n }\n }\n}\n","import type {\n PluginApiCallPayload,\n PluginApiMethod,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"./host-api\"\n\n/**\n * Build a namespace object whose nested property access maps to a\n * dot-separated host RPC method path, and whose every call dispatches that\n * path through the host bridge.\n *\n * The host exposes the entire plugin API behind a single generic `call()`\n * (see the host `bridge.ts`), and the method string is exactly the property\n * path — so one Proxy replaces every hand-written per-method RPC wrapper for\n * every namespace (`core.*`, `design.*`, `entity.*`):\n *\n * The POSITIONAL transport forwards the whole argument tuple; the host router\n * spreads it back into the resolved method (`fn(...args)`):\n *\n * ```ts\n * snaptrude.core.math.vec3.new(1, 2, 3)\n * // → getHostApi().call({ method: \"core.math.vec3.new\", args: [1, 2, 3] })\n * ```\n *\n * Typed at the call site, e.g. `createRpcNamespace<PluginEntityApi>(\"entity\")`.\n * The Proxy is structurally cast to the abstract API type — argument and\n * return types are enforced by that type, while dispatch is dynamic.\n *\n * Every namespace uses this — including `core.math.*` and `core.geom.*`: under\n * the all-handle model there is no in-worker compute; math and geometry are\n * host calls like everything else.\n */\nexport function createRpcNamespace<T extends object>(basePath: string): T {\n const build = (path: string): unknown =>\n new Proxy(NOOP, {\n get(_target, prop) {\n // Symbols and `then` must not resolve to a callable proxy, otherwise\n // the namespace would look thenable and break Promise resolution if it\n // ever reached an `await`.\n if (typeof prop !== \"string\" || prop === \"then\") return undefined\n return build(`${path}.${prop}`)\n },\n apply(_target, _thisArg, argArray: unknown[]) {\n const payload = {\n method: path,\n args: argArray,\n } as unknown as PluginApiCallPayload<PluginApiMethod>\n return getHostApi().call(payload)\n },\n })\n\n return build(basePath) as T\n}\n\n/** Proxy target must be callable for the `apply` trap; identity is irrelevant. */\nconst NOOP = (): void => {}\n","import * as Comlink from \"comlink\"\n\nexport interface UIMessage {\n action: string\n payload: unknown\n}\n\ninterface PluginConfig {\n pluginId: string\n}\n\n/**\n * Base class for Snaptrude plugin workers.\n *\n * Handles Comlink wiring, host communication, and the standard lifecycle\n * methods (`init`, `destroy`, `ping`, `onUIMessage`). Subclass this and\n * override only the methods you need — then call `start()` to expose the\n * worker API.\n *\n * The plugin ID is received automatically from the host during\n * initialization — no need to pass it manually.\n *\n * @example\n * ```ts\n * import { PluginWorker } from \"@snaptrude/plugin-client\";\n *\n * class MyPlugin extends PluginWorker {\n * async onUIMessage(message: UIMessage) {\n * // handle messages from the UI panel\n * }\n * }\n *\n * new MyPlugin().start();\n * ```\n */\nexport abstract class PluginWorker {\n protected pluginId!: string\n private hostAPI: Comlink.Remote<Record<string, unknown>>\n\n constructor() {\n this.hostAPI = Comlink.wrap<Record<string, unknown>>(\n self as unknown as Comlink.Endpoint\n )\n }\n\n protected sendToUI(action: string, payload: unknown): void {\n ;(this.hostAPI as Record<string, any>).ui.sendToUI({ action, payload })\n }\n\n /**\n * Signal the host that this plugin has finished its work and should be\n * stopped. Use this in headless (UI-less) plugins that run a task and\n * self-terminate.\n */\n protected complete(): void {\n ;(this.hostAPI as Record<string, any>).lifecycle.complete()\n }\n\n async init(): Promise<void> {\n console.log(this.pluginId, \"init() called\")\n console.log(this.pluginId, \"Initialization complete\")\n }\n\n async destroy(): Promise<void> {\n console.log(this.pluginId, \"destroy() called — cleaning up\")\n }\n\n async ping(): Promise<string> {\n return \"pong\"\n }\n\n async onUIMessage(_message: UIMessage): Promise<void> {\n // Override in subclass to handle UI messages\n }\n\n /**\n * Expose the worker API via Comlink and start listening.\n * Call this once after constructing the plugin instance.\n *\n * The host calls `init(config)` with `{ pluginId }`,\n * which is captured here to set `this.pluginId` before the\n * subclass's `init()` runs.\n */\n start(): void {\n Comlink.expose(\n {\n init: (config: PluginConfig) => {\n this.pluginId = config.pluginId\n return this.init()\n },\n destroy: () => this.destroy(),\n ping: () => this.ping(),\n onUIMessage: (message: UIMessage) => this.onUIMessage(message),\n },\n self as unknown as Comlink.Endpoint\n )\n console.log(\"Worker loaded, API exposed via Comlink\")\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,yBAOO;;;ACPP,cAAyB;AAoBlB,SAAS,cAAc,UAAsC;AAClE,SAAe;AAAA,IACb,YAAa;AAAA,EACf;AACF;AAEA,IAAI,YAA4B;AAEzB,SAAS,aAA6B;AAC3C,MAAI,CAAC,WAAW;AACd,gBAAY,cAAc;AAAA,EAC5B;AACA,SAAO;AAAA,IACL,MAAM,OAAkC,YAAsE;AAC5G,UAAI,CAAC,WAAW;AACd,cAAM,IAAI,MAAM,0BAA0B;AAAA,MAC5C;AACA,aAAO,UAAU,KAAK,OAAO,EAAE,KAAK,YAAU;AAC5C,YAAI,OAAO,SAAS;AAClB,iBAAO,OAAO;AAAA,QAChB,OAAO;AACL,gBAAM,IAAI,MAAM,OAAO,KAAK;AAAA,QAC9B;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;;;ACdO,SAAS,mBAAqC,UAAqB;AACxE,QAAM,QAAQ,CAAC,SACb,IAAI,MAAM,MAAM;AAAA,IACd,IAAI,SAAS,MAAM;AAIjB,UAAI,OAAO,SAAS,YAAY,SAAS,OAAQ,QAAO;AACxD,aAAO,M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