@platforma-sdk/model 1.61.0 → 1.62.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 (74) hide show
  1. package/dist/block_model.cjs +19 -10
  2. package/dist/block_model.cjs.map +1 -1
  3. package/dist/block_model.d.ts +22 -5
  4. package/dist/block_model.js +18 -10
  5. package/dist/block_model.js.map +1 -1
  6. package/dist/columns/column_collection_builder.cjs +26 -14
  7. package/dist/columns/column_collection_builder.cjs.map +1 -1
  8. package/dist/columns/column_collection_builder.d.ts +9 -8
  9. package/dist/columns/column_collection_builder.js +26 -14
  10. package/dist/columns/column_collection_builder.js.map +1 -1
  11. package/dist/columns/ctx_column_sources.cjs.map +1 -1
  12. package/dist/columns/ctx_column_sources.d.ts +1 -1
  13. package/dist/columns/ctx_column_sources.js.map +1 -1
  14. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.cjs +93 -89
  15. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.cjs.map +1 -1
  16. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.d.ts +2 -2
  17. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js +93 -89
  18. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js.map +1 -1
  19. package/dist/components/PlDataTable/createPlDataTable/index.cjs.map +1 -1
  20. package/dist/components/PlDataTable/createPlDataTable/index.d.ts +2 -1
  21. package/dist/components/PlDataTable/createPlDataTable/index.js.map +1 -1
  22. package/dist/index.cjs +7 -0
  23. package/dist/index.d.ts +7 -3
  24. package/dist/index.js +4 -1
  25. package/dist/package.cjs +1 -1
  26. package/dist/package.js +1 -1
  27. package/dist/platforma.d.ts +9 -3
  28. package/dist/plugin_handle.cjs.map +1 -1
  29. package/dist/plugin_handle.d.ts +13 -7
  30. package/dist/plugin_handle.js.map +1 -1
  31. package/dist/plugin_model.cjs +84 -12
  32. package/dist/plugin_model.cjs.map +1 -1
  33. package/dist/plugin_model.d.ts +121 -41
  34. package/dist/plugin_model.js +84 -12
  35. package/dist/plugin_model.js.map +1 -1
  36. package/dist/render/api.cjs +17 -31
  37. package/dist/render/api.cjs.map +1 -1
  38. package/dist/render/api.d.ts +12 -18
  39. package/dist/render/api.js +17 -31
  40. package/dist/render/api.js.map +1 -1
  41. package/dist/render/internal.cjs.map +1 -1
  42. package/dist/render/internal.d.ts +3 -14
  43. package/dist/render/internal.js.map +1 -1
  44. package/dist/services/block_services.cjs +18 -0
  45. package/dist/services/block_services.cjs.map +1 -0
  46. package/dist/services/block_services.d.ts +18 -0
  47. package/dist/services/block_services.js +16 -0
  48. package/dist/services/block_services.js.map +1 -0
  49. package/dist/services/index.cjs +2 -0
  50. package/dist/services/index.d.ts +3 -0
  51. package/dist/services/index.js +2 -0
  52. package/dist/services/service_bridge.cjs +35 -0
  53. package/dist/services/service_bridge.cjs.map +1 -0
  54. package/dist/services/service_bridge.d.ts +18 -0
  55. package/dist/services/service_bridge.js +33 -0
  56. package/dist/services/service_bridge.js.map +1 -0
  57. package/dist/services/service_resolve.d.ts +13 -0
  58. package/package.json +6 -6
  59. package/src/block_model.ts +49 -14
  60. package/src/columns/column_collection_builder.test.ts +23 -2
  61. package/src/columns/column_collection_builder.ts +38 -30
  62. package/src/columns/ctx_column_sources.ts +2 -2
  63. package/src/components/PlDataTable/createPlDataTable/createPlDataTableV3.ts +159 -153
  64. package/src/components/PlDataTable/createPlDataTable/index.ts +5 -4
  65. package/src/index.ts +2 -0
  66. package/src/platforma.ts +14 -2
  67. package/src/plugin_handle.ts +24 -6
  68. package/src/plugin_model.ts +321 -82
  69. package/src/render/api.ts +55 -57
  70. package/src/render/internal.ts +3 -38
  71. package/src/services/block_services.ts +17 -0
  72. package/src/services/index.ts +3 -0
  73. package/src/services/service_bridge.ts +71 -0
  74. package/src/services/service_resolve.ts +71 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/PlDataTable/createPlDataTable/index.ts"],"sourcesContent":["import type { RenderCtxBase } from \"../../../render\";\nimport type { PlDataTableModel } from \"../typesV5\";\nimport { createPlDataTableOptionsV2, createPlDataTableV2 } from \"./createPlDataTableV2\";\nimport { createPlDataTableV3 } from \"./createPlDataTableV3\";\nimport type { createPlDataTableOptionsV3 } from \"./createPlDataTableV3\";\n\nexport function createPlDataTable<A, U>(\n ctx: RenderCtxBase<A, U>,\n options: { version: \"v2\" } & createPlDataTableOptionsV2,\n): ReturnType<typeof createPlDataTableV2>;\nexport function createPlDataTable<A, U>(\n ctx: RenderCtxBase<A, U>,\n options: { version?: \"v3\" } & createPlDataTableOptionsV3,\n): ReturnType<typeof createPlDataTableV3>;\nexport function createPlDataTable<A, U>(\n ctx: RenderCtxBase<A, U>,\n options:\n | ({ version: \"v2\" } & createPlDataTableOptionsV2)\n | ({ version?: \"v3\" } & createPlDataTableOptionsV3),\n): PlDataTableModel | undefined {\n if (options.version === \"v2\") {\n return createPlDataTableV2(ctx, options.columns, options.tableState, options.options);\n } else {\n // default version is last (v3 at the moment)\n return createPlDataTableV3(ctx, options);\n }\n}\n"],"mappings":";;;;AAcA,SAAgB,kBACd,KACA,SAG8B;AAC9B,KAAI,QAAQ,YAAY,KACtB,QAAO,oBAAoB,KAAK,QAAQ,SAAS,QAAQ,YAAY,QAAQ,QAAQ;KAGrF,QAAO,oBAAoB,KAAK,QAAQ"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/PlDataTable/createPlDataTable/index.ts"],"sourcesContent":["import { Services, type RequireServices } from \"@milaboratories/pl-model-common\";\nimport type { RenderCtxBase } from \"../../../render\";\nimport type { PlDataTableModel } from \"../typesV5\";\nimport { createPlDataTableOptionsV2, createPlDataTableV2 } from \"./createPlDataTableV2\";\nimport { createPlDataTableV3 } from \"./createPlDataTableV3\";\nimport type { createPlDataTableOptionsV3 } from \"./createPlDataTableV3\";\n\nexport function createPlDataTable<A, U>(\n ctx: RenderCtxBase<A, U>,\n options: { version: \"v2\" } & createPlDataTableOptionsV2,\n): ReturnType<typeof createPlDataTableV2>;\nexport function createPlDataTable<A, U, S extends RequireServices<typeof Services.PFrameSpec>>(\n ctx: RenderCtxBase<A, U, S>,\n options: { version?: \"v3\" } & createPlDataTableOptionsV3,\n): ReturnType<typeof createPlDataTableV3>;\nexport function createPlDataTable<A, U, S extends RequireServices<typeof Services.PFrameSpec>>(\n ctx: RenderCtxBase<A, U, S>,\n options:\n | ({ version: \"v2\" } & createPlDataTableOptionsV2)\n | ({ version?: \"v3\" } & createPlDataTableOptionsV3),\n): PlDataTableModel | undefined {\n if (options.version === \"v2\") {\n return createPlDataTableV2(ctx, options.columns, options.tableState, options.options);\n } else {\n // default version is last (v3 at the moment)\n return createPlDataTableV3(ctx, options);\n }\n}\n"],"mappings":";;;;AAeA,SAAgB,kBACd,KACA,SAG8B;AAC9B,KAAI,QAAQ,YAAY,KACtB,QAAO,oBAAoB,KAAK,QAAQ,SAAS,QAAQ,YAAY,QAAQ,QAAQ;KAGrF,QAAO,oBAAoB,KAAK,QAAQ"}
package/dist/index.cjs CHANGED
@@ -21,6 +21,7 @@ const require_types = require('./bconfig/types.cjs');
21
21
  const require_normalization = require('./bconfig/normalization.cjs');
22
22
  require('./bconfig/index.cjs');
23
23
  const require_block_model_legacy = require('./block_model_legacy.cjs');
24
+ const require_block_services = require('./services/block_services.cjs');
24
25
  const require_plugin_model = require('./plugin_model.cjs');
25
26
  const require_block_model = require('./block_model.cjs');
26
27
  const require_axes = require('./pframe_utils/axes.cjs');
@@ -53,10 +54,13 @@ const require_raw_globals = require('./raw_globals.cjs');
53
54
  const require_converter = require('./annotations/converter.cjs');
54
55
  require('./annotations/index.cjs');
55
56
  const require_index$9 = require('./pframe_utils/index.cjs');
57
+ const require_service_bridge = require('./services/service_bridge.cjs');
58
+ require('./services/index.cjs');
56
59
  const require_env_value = require('./env_value.cjs');
57
60
 
58
61
  exports.Args = require_actions.Args;
59
62
  exports.ArrayColumnProvider = require_column_snapshot_provider.ArrayColumnProvider;
63
+ exports.BLOCK_SERVICE_FLAGS = require_block_services.BLOCK_SERVICE_FLAGS;
60
64
  exports.BLOCK_STORAGE_FACADE_VERSION = require_block_storage_facade.BLOCK_STORAGE_FACADE_VERSION;
61
65
  exports.BlockModel = require_block_model_legacy.BlockModel;
62
66
  exports.BlockModelV3 = require_block_model.BlockModelV3;
@@ -104,6 +108,8 @@ exports.TreeNodeAccessor = require_accessor.TreeNodeAccessor;
104
108
  exports.UiState = require_actions.UiState;
105
109
  exports.allPColumnsReady = require_pcolumn_data.allPColumnsReady;
106
110
  exports.and = require_actions.and;
111
+ exports.blockServiceNames = require_block_services.blockServiceNames;
112
+ exports.buildServices = require_service_bridge.buildServices;
107
113
  exports.collectCtxColumnSnapshotProviders = require_ctx_column_sources.collectCtxColumnSnapshotProviders;
108
114
  exports.columnSelectorsToPredicate = require_column_selector.columnSelectorsToPredicate;
109
115
  exports.compileAnnotationScript = require_filters_ui.compileAnnotationScript;
@@ -116,6 +122,7 @@ exports.convertOrParsePColumnData = require_pcolumn_data.convertOrParsePColumnDa
116
122
  exports.createBlockStorage = require_block_storage.createBlockStorage;
117
123
  exports.createColumnSnapshot = require_column_snapshot.createColumnSnapshot;
118
124
  exports.createDefaultPTableParams = require_state_migration.createDefaultPTableParams;
125
+ exports.createNodeServiceProxy = require_service_bridge.createNodeServiceProxy;
119
126
  exports.createPFrameForGraphs = require_PFrameForGraphs.createPFrameForGraphs;
120
127
  exports.createPlDataTable = require_index$5.createPlDataTable;
121
128
  exports.createPlDataTableSheet = require_createPlDataTableSheet.createPlDataTableSheet;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { BlockStatePatch, Patch, Unionize } from "./block_state_patch.js";
2
2
  import { OutputError, readOutput, wrapOutputs } from "./block_state_util.js";
3
- import { InferFactoryData, InferFactoryOutputs, InferFactoryParams, InferPluginHandle, PluginFactoryLike, PluginHandle, isPluginOutputKey, pluginOutputKey, pluginOutputPrefix } from "./plugin_handle.js";
3
+ import { InferFactoryData, InferFactoryModelServices, InferFactoryOutputs, InferFactoryParams, InferFactoryUiServices, InferPluginHandle, PluginFactoryLike, PluginHandle, isPluginOutputKey, pluginOutputKey, pluginOutputPrefix } from "./plugin_handle.js";
4
4
  import { DataModel, DataModelBuilder } from "./block_migrations.js";
5
5
  import { BlockStorage, BlockStorageSchemaVersion, MigrateBlockStorageConfig, MigrationFailure, MigrationResult, MigrationSuccess, MutateStoragePayload, PluginName, PluginRegistry, VersionedData, createBlockStorage, deriveDataFromStorage, getPluginData, getStorageData, isBlockStorage, migrateBlockStorage, normalizeBlockStorage, updateStorageData } from "./block_storage.js";
6
6
  import { Cfg, CfgAnd, CfgBlobContent, CfgBlobContentAsJson, CfgBlobContentAsString, CfgDownloadedBlobContent, CfgExtractArchiveAndGetURL, CfgFlatten, CfgGetFromCtx, CfgGetJsonField, CfgGetResourceField, CfgImmediate, CfgImportProgress, CfgIsEmpty, CfgIsolate, CfgLastLogs, CfgLogHandle, CfgMakeArray, CfgMakeObject, CfgMapArrayValues, CfgMapRecordValues, CfgMapResourceFields, CfgNot, CfgOnDemandBlobContent, CfgOr, CfgProgressLog, CfgProgressLogWithInfo, CfgResourceValueAsJson } from "./config/model.js";
@@ -20,6 +20,8 @@ import { BLOCK_STORAGE_FACADE_VERSION, BlockStorageFacade, BlockStorageFacadeCal
20
20
  import { BlockApiV1, CancelSubscription } from "./block_api_v1.js";
21
21
  import { BlockApiV2 } from "./block_api_v2.js";
22
22
  import { CurrentSdkInfo, PlatformaSDKVersion, SdkInfo } from "./version.js";
23
+ import { BLOCK_SERVICE_FLAGS, BlockServiceFlags, blockServiceNames } from "./services/block_services.js";
24
+ import { BlockDefaultModelServices, BlockDefaultUiServices, ModelServices, ResolveModelServices, ResolveUiServices, UiServices } from "./services/service_resolve.js";
23
25
  import { CommonFieldTraverseOps, CommonTraversalOps, FieldTraversalStep, FieldType, GetFieldStep, ResourceTraversalOps, ResourceType } from "./render/traversal_ops.js";
24
26
  import { PColumnDataUniversal, internal_d_exports } from "./render/internal.js";
25
27
  import { ExtractFutureRefType, FutureRef } from "./render/future.js";
@@ -31,7 +33,7 @@ import { BlockRenderCtx, InferRenderFunctionReturn, PluginRenderCtx, RenderCtx,
31
33
  import { PColumnKeyList, PColumnResourceMapData, PColumnResourceMapEntry, RT_BINARY_PARTITIONED, RT_BINARY_SUPER_PARTITIONED, RT_JSON_PARTITIONED, RT_JSON_SUPER_PARTITIONED, RT_PARQUET_PARTITIONED, RT_PARQUET_SUPER_PARTITIONED, RT_RESOURCE_MAP, RT_RESOURCE_MAP_PARTITIONED, allPColumnsReady, convertOrParsePColumnData, getPartitionKeysList, getUniquePartitionKeys, isPColumnReady, parsePColumnData, parseResourceMap } from "./render/util/pcolumn_data.js";
32
34
  import { filterDataInfoEntries } from "./render/util/axis_filtering.js";
33
35
  import "./render/index.js";
34
- import { PluginConfig, PluginData, PluginDataModel, PluginDataModelBuilder, PluginFactory, PluginInstance, PluginModel, PluginOutputs, PluginParams } from "./plugin_model.js";
36
+ import { PluginConfig, PluginData, PluginDataModel, PluginDataModelBuilder, PluginDataModelVersions, PluginFactory, PluginInstance, PluginModel, PluginOutputs, PluginParams } from "./plugin_model.js";
35
37
  import { BlockModelV3, ParamsInput, PluginRecord } from "./block_model.js";
36
38
  import { BlockModelInfo, InferArgsType, InferBlockState, InferBlockStatePatch, InferDataType, InferHrefType, InferOutputsType, InferPluginData, InferPluginHandles, InferPluginNames, InferUiState, Platforma, PlatformaApiVersion, PlatformaExtended, PlatformaFactory, PlatformaV1, PlatformaV2, PlatformaV3 } from "./platforma.js";
37
39
  import { BlockModel } from "./block_model_legacy.js";
@@ -69,7 +71,9 @@ import { fromPlOption, fromPlRef } from "./ref_util.js";
69
71
  import { getPlatformaApiVersion, getRawPlatformaInstance } from "./raw_globals.js";
70
72
  import { getAllRelatedColumns, getRelatedColumns } from "./pframe_utils/columns.js";
71
73
  import { getAxisUniqueValues, getColumnOrAxisValueLabelsId, getColumnSpecById, getColumnUniqueValues, getColumnsFull, getRequestColumnsFromSelectedSources, getSingleColumnData, getUniqueSourceValuesWithLabels } from "./pframe_utils/index.js";
74
+ import { NodeServiceProxy, buildServices, createNodeServiceProxy } from "./services/service_bridge.js";
75
+ import "./services/index.js";
72
76
  import { getEnvironmentValue } from "./env_value.js";
73
77
  export * from "@milaboratories/pl-model-common";
74
78
  export * from "@milaboratories/pl-error-like";
75
- export { ActAnd, ActExtractArchiveAndGetURL, ActFlatten, ActGetBlobContent, ActGetBlobContentAsJson, ActGetBlobContentAsString, ActGetDownloadedBlobContent, ActGetField, ActGetFromCtx, ActGetImmediate, ActGetLastLogs, ActGetLogHandle, ActGetOnDemandBlobContent, ActGetProgressLog, ActGetProgressLogWithInfo, ActGetResourceField, ActGetResourceValueAsJson, ActImportProgress, ActIsEmpty, ActIsolate, ActMakeArray, ActMakeObject, ActMapArrayValues, ActMapRecordValues, ActMapResourceFields, ActNot, ActOr, ActionResult, AnchoredBuildOptions, AnchoredColumnCollection, AnchoredFindColumnsOptions, AndFilter, AnnotationFilter, AnnotationMode, AnnotationScript, AnnotationScript2, AnnotationScriptUi, AnnotationSpec, AnnotationSpecUi, AnnotationStep, AnnotationStepUi, AnyForm, Args, ArrayColumnProvider, AxesVault, AxisLabelProvider, BLOCK_STORAGE_FACADE_VERSION, BlockApiV1, BlockApiV2, BlockConfig, BlockConfigV3, BlockConfigV4, BlockModel, BlockModelInfo, BlockModelV3, BlockRenderCtx, BlockStatePatch, type BlockStorage, BlockStorageFacade, BlockStorageFacadeCallbacks, BlockStorageFacadeHandles, type BlockStorageSchemaVersion, BuildOptions, CancelSubscription, Cfg, CfgAnd, CfgBlobContent, CfgBlobContentAsJson, CfgBlobContentAsString, CfgDownloadedBlobContent, CfgExtractArchiveAndGetURL, CfgFlatten, CfgGetFromCtx, CfgGetJsonField, CfgGetResourceField, CfgImmediate, CfgImportProgress, CfgIsEmpty, CfgIsolate, CfgLastLogs, CfgLogHandle, CfgMakeArray, CfgMakeObject, CfgMapArrayValues, CfgMapRecordValues, CfgMapResourceFields, CfgNot, CfgOnDemandBlobContent, CfgOr, CfgProgressLog, CfgProgressLogWithInfo, CfgRenderingMode, CfgResourceValueAsJson, Checked, ColumnCollection, ColumnCollectionBuilder, ColumnData, ColumnDataStatus, ColumnMatch, ColumnProvider, ColumnSelectorInput, ColumnSnapshot, ColumnSnapshotProvider, ColumnSource, CommonFieldTraverseOps, CommonTraversalOps, ConfAction, ConfigRenderLambda, ConfigRenderLambdaFlags, ConfigResult, CurrentSdkInfo, DataModel, DataModelBuilder, DeriveHref, DeriveLabelsOptions, Entry, ExpressionSpec, ExtractAction, ExtractFunctionHandleReturn, ExtractFutureRefType, FieldTraversalStep, FieldType, FilterSpec, FilterSpecLeaf, FilterSpecNode, FilterSpecOfType, FilterSpecType, FilterSpecUi, FilterUi, FilterUiOfType, FilterUiType, FindColumnsOptions, FormField, FutureRef, GetFieldStep, InferArgsType, InferBlockState, InferBlockStatePatch, InferDataType, InferFactoryData, InferFactoryOutputs, InferFactoryParams, InferHrefType, InferOutputType, InferOutputsFromConfigs, InferOutputsFromLambdas, InferOutputsType, InferPluginData, InferPluginHandle, InferPluginHandles, InferPluginNames, InferRenderFunctionReturn, InferUiState, InferVarTypeSafe, IsNA, It, internal_d_exports as JsRenderInternal, DeriveLabelsOptions as LabelDerivationOps, Log10, MainOutputs, MatchQualifications, MatchVariant, MatchingMode, type MigrateBlockStorageConfig, type MigrationFailure, type MigrationResult, type MigrationSuccess, type MutateStoragePayload, NotFilter, NumericalComparisonFilter, OptionalPlResourceEntry, OrFilter, OutputColumnProvider, OutputColumnProviderOpts, OutputError, PColumnCollection, PColumnDataUniversal, PColumnEntryUniversal, PColumnEntryWithLabel, PColumnKeyList, PColumnLazyUniversal, PColumnLazyWithLabel, PColumnPredicate, PColumnResourceMapData, PColumnResourceMapEntry, PFrameImpl, POCExtractAction, PTableKey, PTableParamsV2, type ParamsInput, Patch, PatternFilter, PatternPredicate, PatternPredicateContainSubsequence, PatternPredicateEquals, PlDataTableFilters, PlDataTableFiltersWithMeta, PlDataTableGridStateCore, PlDataTableModel, PlDataTableSheet, PlDataTableSheetState, PlDataTableStateV2, PlDataTableStateV2CacheEntry, PlDataTableStateV2Normalized, PlMultiSequenceAlignmentColorSchemeOption, PlMultiSequenceAlignmentModel, PlMultiSequenceAlignmentSettings, PlMultiSequenceAlignmentWidget, PlResourceEntry, PlSelectionModel, PlTableColumnId, PlTableColumnIdJson, Platforma, PlatformaApiVersion, PlatformaExtended, PlatformaFactory, PlatformaSDKVersion, PlatformaV1, PlatformaV2, PlatformaV3, type PluginConfig, type PluginData, PluginDataModel, PluginDataModelBuilder, type PluginFactory, PluginFactoryLike, PluginHandle, PluginInstance, PluginModel, type PluginName, type PluginOutputs, type PluginParams, type PluginRecord, type PluginRegistry, PluginRenderCtx, PrimitiveOrConfig, PrimitiveToCfg, RT_BINARY_PARTITIONED, RT_BINARY_SUPER_PARTITIONED, RT_JSON_PARTITIONED, RT_JSON_SUPER_PARTITIONED, RT_PARQUET_PARTITIONED, RT_PARQUET_SUPER_PARTITIONED, RT_RESOURCE_MAP, RT_RESOURCE_MAP_PARTITIONED, RelaxedAxisSelector, RelaxedColumnSelector, RelaxedRecord, RelaxedStringMatchers, RenderCtx, RenderCtxBase, RenderCtxLegacy, RenderFunction, RenderFunctionLegacy, ResolveCfgType, ResourceTraversalOps, ResourceType, ResultPool, ResultPoolColumnSnapshotProvider, SdkInfo, SimplifiedPColumnSpec, SimplifiedUniversalPColumnEntry, SnapshotColumnProvider, SortedCumulativeSum, Entry as SpecExtractorResult, StagingOutputs, StdCtx, StdCtxArgsOnly, StringMatcher, Trace, TransformedColumn, TreeNodeAccessor, TypeField, TypeFieldRecord, TypeForm, TypeToLiteral, TypedConfig, TypedConfigOrConfigLambda, TypedConfigOrString, UiState, Unionize, UniversalColumnOption, UnwrapFutureRef, ValueRank, type VersionedData, WithLabel, allPColumnsReady, and, collectCtxColumnSnapshotProviders, columnSelectorsToPredicate, compileAnnotationScript, compileFilter, compileFilters, convertFilterSpecsToExpressionSpecs, convertFilterUiToExpressionImpl, convertFilterUiToExpressions, convertOrParsePColumnData, createBlockStorage, createColumnSnapshot, createDefaultPTableParams, createPFrameForGraphs, createPlDataTable, createPlDataTableSheet, createPlDataTableStateV2, createPlDataTableV2, createPlDataTableV3, createPlSelectionModel, createReadyColumnData, createRowSelectionColumn, deriveDataFromStorage, deriveDistinctLabels, deriveLabels, distillFilterSpec, downgradeCfgOrLambda, enrichCompatible, extractArchiveAndGetURL, extractConfig, filterDataInfoEntries, filterSpecToSpecQueryExpr, flatten, fromPlOption, fromPlRef, getAllRelatedColumns, getAvailableWithLinkersAxes, getAxisUniqueValues, getBlobContent, getBlobContentAsJson, getBlobContentAsString, getColumnOrAxisValueLabelsId, getColumnSpecById, getColumnUniqueValues, getColumnsFull, getDownloadedBlobContent, getEnvironmentValue, getFromCfg, getImmediate, getImportProgress, getJsonField, getLastLogs, getLogHandle, getOnDemandBlobContent, getPartitionKeysList, getPlatformaApiVersion, getPluginData, getProgressLog, getProgressLogWithInfo, getRawPlatformaInstance, getRelatedColumns, getRequestColumnsFromSelectedSources, getResourceField, getResourceValueAsJson, getSingleColumnData, getStorageData, getUniquePartitionKeys, getUniqueSourceValuesWithLabels, ifDef, isBlockStorage, isColumnHidden, isColumnOptional, isColumnSnapshotProvider, isConfigLambda, isEmpty, isHiddenFromGraphColumn, isHiddenFromUIColumn, isPColumnReady, isPluginOutputKey, isolate, makeArray, makeObject, mapArrayValues, mapRecordValues, mapResourceFields, matchColumn, matchColumnSelectors, migrateBlockStorage, normalizeBlockStorage, normalizeSelectors, not, or, parsePColumnData, parseResourceMap, pluginOutputKey, pluginOutputPrefix, readOutput, registerFacadeCallbacks, toColumnSnapshotProvider, unreachable, updateStorageData, upgradePlDataTableStateV2, wrapOutputs, writeLabelsToSpecs };
79
+ export { ActAnd, ActExtractArchiveAndGetURL, ActFlatten, ActGetBlobContent, ActGetBlobContentAsJson, ActGetBlobContentAsString, ActGetDownloadedBlobContent, ActGetField, ActGetFromCtx, ActGetImmediate, ActGetLastLogs, ActGetLogHandle, ActGetOnDemandBlobContent, ActGetProgressLog, ActGetProgressLogWithInfo, ActGetResourceField, ActGetResourceValueAsJson, ActImportProgress, ActIsEmpty, ActIsolate, ActMakeArray, ActMakeObject, ActMapArrayValues, ActMapRecordValues, ActMapResourceFields, ActNot, ActOr, ActionResult, AnchoredBuildOptions, AnchoredColumnCollection, AnchoredFindColumnsOptions, AndFilter, AnnotationFilter, AnnotationMode, AnnotationScript, AnnotationScript2, AnnotationScriptUi, AnnotationSpec, AnnotationSpecUi, AnnotationStep, AnnotationStepUi, AnyForm, Args, ArrayColumnProvider, AxesVault, AxisLabelProvider, BLOCK_SERVICE_FLAGS, BLOCK_STORAGE_FACADE_VERSION, BlockApiV1, BlockApiV2, BlockConfig, BlockConfigV3, BlockConfigV4, BlockDefaultModelServices, BlockDefaultUiServices, BlockModel, BlockModelInfo, BlockModelV3, BlockRenderCtx, BlockServiceFlags, BlockStatePatch, type BlockStorage, BlockStorageFacade, BlockStorageFacadeCallbacks, BlockStorageFacadeHandles, type BlockStorageSchemaVersion, BuildOptions, CancelSubscription, Cfg, CfgAnd, CfgBlobContent, CfgBlobContentAsJson, CfgBlobContentAsString, CfgDownloadedBlobContent, CfgExtractArchiveAndGetURL, CfgFlatten, CfgGetFromCtx, CfgGetJsonField, CfgGetResourceField, CfgImmediate, CfgImportProgress, CfgIsEmpty, CfgIsolate, CfgLastLogs, CfgLogHandle, CfgMakeArray, CfgMakeObject, CfgMapArrayValues, CfgMapRecordValues, CfgMapResourceFields, CfgNot, CfgOnDemandBlobContent, CfgOr, CfgProgressLog, CfgProgressLogWithInfo, CfgRenderingMode, CfgResourceValueAsJson, Checked, ColumnCollection, ColumnCollectionBuilder, ColumnData, ColumnDataStatus, ColumnMatch, ColumnProvider, ColumnSelectorInput, ColumnSnapshot, ColumnSnapshotProvider, ColumnSource, CommonFieldTraverseOps, CommonTraversalOps, ConfAction, ConfigRenderLambda, ConfigRenderLambdaFlags, ConfigResult, CurrentSdkInfo, DataModel, DataModelBuilder, DeriveHref, DeriveLabelsOptions, Entry, ExpressionSpec, ExtractAction, ExtractFunctionHandleReturn, ExtractFutureRefType, FieldTraversalStep, FieldType, FilterSpec, FilterSpecLeaf, FilterSpecNode, FilterSpecOfType, FilterSpecType, FilterSpecUi, FilterUi, FilterUiOfType, FilterUiType, FindColumnsOptions, FormField, FutureRef, GetFieldStep, InferArgsType, InferBlockState, InferBlockStatePatch, InferDataType, InferFactoryData, InferFactoryModelServices, InferFactoryOutputs, InferFactoryParams, InferFactoryUiServices, InferHrefType, InferOutputType, InferOutputsFromConfigs, InferOutputsFromLambdas, InferOutputsType, InferPluginData, InferPluginHandle, InferPluginHandles, InferPluginNames, InferRenderFunctionReturn, InferUiState, InferVarTypeSafe, IsNA, It, internal_d_exports as JsRenderInternal, DeriveLabelsOptions as LabelDerivationOps, Log10, MainOutputs, MatchQualifications, MatchVariant, MatchingMode, type MigrateBlockStorageConfig, type MigrationFailure, type MigrationResult, type MigrationSuccess, ModelServices, type MutateStoragePayload, NodeServiceProxy, NotFilter, NumericalComparisonFilter, OptionalPlResourceEntry, OrFilter, OutputColumnProvider, OutputColumnProviderOpts, OutputError, PColumnCollection, PColumnDataUniversal, PColumnEntryUniversal, PColumnEntryWithLabel, PColumnKeyList, PColumnLazyUniversal, PColumnLazyWithLabel, PColumnPredicate, PColumnResourceMapData, PColumnResourceMapEntry, PFrameImpl, POCExtractAction, PTableKey, PTableParamsV2, type ParamsInput, Patch, PatternFilter, PatternPredicate, PatternPredicateContainSubsequence, PatternPredicateEquals, PlDataTableFilters, PlDataTableFiltersWithMeta, PlDataTableGridStateCore, PlDataTableModel, PlDataTableSheet, PlDataTableSheetState, PlDataTableStateV2, PlDataTableStateV2CacheEntry, PlDataTableStateV2Normalized, PlMultiSequenceAlignmentColorSchemeOption, PlMultiSequenceAlignmentModel, PlMultiSequenceAlignmentSettings, PlMultiSequenceAlignmentWidget, PlResourceEntry, PlSelectionModel, PlTableColumnId, PlTableColumnIdJson, Platforma, PlatformaApiVersion, PlatformaExtended, PlatformaFactory, PlatformaSDKVersion, PlatformaV1, PlatformaV2, PlatformaV3, type PluginConfig, type PluginData, PluginDataModel, PluginDataModelBuilder, type PluginDataModelVersions, type PluginFactory, PluginFactoryLike, PluginHandle, PluginInstance, PluginModel, type PluginName, type PluginOutputs, type PluginParams, type PluginRecord, type PluginRegistry, PluginRenderCtx, PrimitiveOrConfig, PrimitiveToCfg, RT_BINARY_PARTITIONED, RT_BINARY_SUPER_PARTITIONED, RT_JSON_PARTITIONED, RT_JSON_SUPER_PARTITIONED, RT_PARQUET_PARTITIONED, RT_PARQUET_SUPER_PARTITIONED, RT_RESOURCE_MAP, RT_RESOURCE_MAP_PARTITIONED, RelaxedAxisSelector, RelaxedColumnSelector, RelaxedRecord, RelaxedStringMatchers, RenderCtx, RenderCtxBase, RenderCtxLegacy, RenderFunction, RenderFunctionLegacy, ResolveCfgType, ResolveModelServices, ResolveUiServices, ResourceTraversalOps, ResourceType, ResultPool, ResultPoolColumnSnapshotProvider, SdkInfo, SimplifiedPColumnSpec, SimplifiedUniversalPColumnEntry, SnapshotColumnProvider, SortedCumulativeSum, Entry as SpecExtractorResult, StagingOutputs, StdCtx, StdCtxArgsOnly, StringMatcher, Trace, TransformedColumn, TreeNodeAccessor, TypeField, TypeFieldRecord, TypeForm, TypeToLiteral, TypedConfig, TypedConfigOrConfigLambda, TypedConfigOrString, UiServices, UiState, Unionize, UniversalColumnOption, UnwrapFutureRef, ValueRank, type VersionedData, WithLabel, allPColumnsReady, and, blockServiceNames, buildServices, collectCtxColumnSnapshotProviders, columnSelectorsToPredicate, compileAnnotationScript, compileFilter, compileFilters, convertFilterSpecsToExpressionSpecs, convertFilterUiToExpressionImpl, convertFilterUiToExpressions, convertOrParsePColumnData, createBlockStorage, createColumnSnapshot, createDefaultPTableParams, createNodeServiceProxy, createPFrameForGraphs, createPlDataTable, createPlDataTableSheet, createPlDataTableStateV2, createPlDataTableV2, createPlDataTableV3, createPlSelectionModel, createReadyColumnData, createRowSelectionColumn, deriveDataFromStorage, deriveDistinctLabels, deriveLabels, distillFilterSpec, downgradeCfgOrLambda, enrichCompatible, extractArchiveAndGetURL, extractConfig, filterDataInfoEntries, filterSpecToSpecQueryExpr, flatten, fromPlOption, fromPlRef, getAllRelatedColumns, getAvailableWithLinkersAxes, getAxisUniqueValues, getBlobContent, getBlobContentAsJson, getBlobContentAsString, getColumnOrAxisValueLabelsId, getColumnSpecById, getColumnUniqueValues, getColumnsFull, getDownloadedBlobContent, getEnvironmentValue, getFromCfg, getImmediate, getImportProgress, getJsonField, getLastLogs, getLogHandle, getOnDemandBlobContent, getPartitionKeysList, getPlatformaApiVersion, getPluginData, getProgressLog, getProgressLogWithInfo, getRawPlatformaInstance, getRelatedColumns, getRequestColumnsFromSelectedSources, getResourceField, getResourceValueAsJson, getSingleColumnData, getStorageData, getUniquePartitionKeys, getUniqueSourceValuesWithLabels, ifDef, isBlockStorage, isColumnHidden, isColumnOptional, isColumnSnapshotProvider, isConfigLambda, isEmpty, isHiddenFromGraphColumn, isHiddenFromUIColumn, isPColumnReady, isPluginOutputKey, isolate, makeArray, makeObject, mapArrayValues, mapRecordValues, mapResourceFields, matchColumn, matchColumnSelectors, migrateBlockStorage, normalizeBlockStorage, normalizeSelectors, not, or, parsePColumnData, parseResourceMap, pluginOutputKey, pluginOutputPrefix, readOutput, registerFacadeCallbacks, toColumnSnapshotProvider, unreachable, updateStorageData, upgradePlDataTableStateV2, wrapOutputs, writeLabelsToSpecs };
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ import { isConfigLambda } from "./bconfig/types.js";
20
20
  import { downgradeCfgOrLambda, extractConfig } from "./bconfig/normalization.js";
21
21
  import "./bconfig/index.js";
22
22
  import { BlockModel } from "./block_model_legacy.js";
23
+ import { BLOCK_SERVICE_FLAGS, blockServiceNames } from "./services/block_services.js";
23
24
  import { PluginDataModel, PluginDataModelBuilder, PluginInstance, PluginModel } from "./plugin_model.js";
24
25
  import { BlockModelV3 } from "./block_model.js";
25
26
  import { enrichCompatible, getAvailableWithLinkersAxes } from "./pframe_utils/axes.js";
@@ -52,10 +53,12 @@ import { getPlatformaApiVersion, getRawPlatformaInstance } from "./raw_globals.j
52
53
  import { convertFilterSpecsToExpressionSpecs } from "./annotations/converter.js";
53
54
  import "./annotations/index.js";
54
55
  import { getAxisUniqueValues, getColumnOrAxisValueLabelsId, getColumnSpecById, getColumnUniqueValues, getColumnsFull, getRequestColumnsFromSelectedSources, getSingleColumnData, getUniqueSourceValuesWithLabels } from "./pframe_utils/index.js";
56
+ import { buildServices, createNodeServiceProxy } from "./services/service_bridge.js";
57
+ import "./services/index.js";
55
58
  import { getEnvironmentValue } from "./env_value.js";
56
59
 
57
60
  export * from "@milaboratories/pl-model-common"
58
61
 
59
62
  export * from "@milaboratories/pl-error-like"
60
63
 
61
- export { Args, ArrayColumnProvider, BLOCK_STORAGE_FACADE_VERSION, BlockModel, BlockModelV3, BlockRenderCtx, BlockStorageFacadeCallbacks, BlockStorageFacadeHandles, ColumnCollectionBuilder, CurrentSdkInfo, DataModel, DataModelBuilder, FutureRef, It, internal_exports as JsRenderInternal, MainOutputs, OutputColumnProvider, OutputError, PColumnCollection, PFrameImpl, PlatformaSDKVersion, PluginDataModel, PluginDataModelBuilder, PluginInstance, PluginModel, PluginRenderCtx, RT_BINARY_PARTITIONED, RT_BINARY_SUPER_PARTITIONED, RT_JSON_PARTITIONED, RT_JSON_SUPER_PARTITIONED, RT_PARQUET_PARTITIONED, RT_PARQUET_SUPER_PARTITIONED, RT_RESOURCE_MAP, RT_RESOURCE_MAP_PARTITIONED, RenderCtxBase, RenderCtxLegacy, ResultPool, ResultPoolColumnSnapshotProvider, SnapshotColumnProvider, StagingOutputs, TreeNodeAccessor, UiState, allPColumnsReady, and, collectCtxColumnSnapshotProviders, columnSelectorsToPredicate, compileAnnotationScript, compileFilter, compileFilters, convertFilterSpecsToExpressionSpecs, convertFilterUiToExpressionImpl, convertFilterUiToExpressions, convertOrParsePColumnData, createBlockStorage, createColumnSnapshot, createDefaultPTableParams, createPFrameForGraphs, createPlDataTable, createPlDataTableSheet, createPlDataTableStateV2, createPlDataTableV2, createPlDataTableV3, createPlSelectionModel, createReadyColumnData, createRowSelectionColumn, deriveDataFromStorage, deriveDistinctLabels, deriveLabels, distillFilterSpec, downgradeCfgOrLambda, enrichCompatible, extractArchiveAndGetURL, extractConfig, filterDataInfoEntries, filterSpecToSpecQueryExpr, flatten, fromPlOption, fromPlRef, getAllRelatedColumns, getAvailableWithLinkersAxes, getAxisUniqueValues, getBlobContent, getBlobContentAsJson, getBlobContentAsString, getColumnOrAxisValueLabelsId, getColumnSpecById, getColumnUniqueValues, getColumnsFull, getDownloadedBlobContent, getEnvironmentValue, getFromCfg, getImmediate, getImportProgress, getJsonField, getLastLogs, getLogHandle, getOnDemandBlobContent, getPartitionKeysList, getPlatformaApiVersion, getPluginData, getProgressLog, getProgressLogWithInfo, getRawPlatformaInstance, getRelatedColumns, getRequestColumnsFromSelectedSources, getResourceField, getResourceValueAsJson, getSingleColumnData, getStorageData, getUniquePartitionKeys, getUniqueSourceValuesWithLabels, ifDef, isBlockStorage, isColumnHidden, isColumnOptional, isColumnSnapshotProvider, isConfigLambda, isEmpty, isHiddenFromGraphColumn, isHiddenFromUIColumn, isPColumnReady, isPluginOutputKey, isolate, makeArray, makeObject, mapArrayValues, mapRecordValues, mapResourceFields, matchColumn, matchColumnSelectors, migrateBlockStorage, normalizeBlockStorage, normalizeSelectors, not, or, parsePColumnData, parseResourceMap, pluginOutputKey, pluginOutputPrefix, readOutput, registerFacadeCallbacks, toColumnSnapshotProvider, unreachable, updateStorageData, upgradePlDataTableStateV2, wrapOutputs, writeLabelsToSpecs };
64
+ export { Args, ArrayColumnProvider, BLOCK_SERVICE_FLAGS, BLOCK_STORAGE_FACADE_VERSION, BlockModel, BlockModelV3, BlockRenderCtx, BlockStorageFacadeCallbacks, BlockStorageFacadeHandles, ColumnCollectionBuilder, CurrentSdkInfo, DataModel, DataModelBuilder, FutureRef, It, internal_exports as JsRenderInternal, MainOutputs, OutputColumnProvider, OutputError, PColumnCollection, PFrameImpl, PlatformaSDKVersion, PluginDataModel, PluginDataModelBuilder, PluginInstance, PluginModel, PluginRenderCtx, RT_BINARY_PARTITIONED, RT_BINARY_SUPER_PARTITIONED, RT_JSON_PARTITIONED, RT_JSON_SUPER_PARTITIONED, RT_PARQUET_PARTITIONED, RT_PARQUET_SUPER_PARTITIONED, RT_RESOURCE_MAP, RT_RESOURCE_MAP_PARTITIONED, RenderCtxBase, RenderCtxLegacy, ResultPool, ResultPoolColumnSnapshotProvider, SnapshotColumnProvider, StagingOutputs, TreeNodeAccessor, UiState, allPColumnsReady, and, blockServiceNames, buildServices, collectCtxColumnSnapshotProviders, columnSelectorsToPredicate, compileAnnotationScript, compileFilter, compileFilters, convertFilterSpecsToExpressionSpecs, convertFilterUiToExpressionImpl, convertFilterUiToExpressions, convertOrParsePColumnData, createBlockStorage, createColumnSnapshot, createDefaultPTableParams, createNodeServiceProxy, createPFrameForGraphs, createPlDataTable, createPlDataTableSheet, createPlDataTableStateV2, createPlDataTableV2, createPlDataTableV3, createPlSelectionModel, createReadyColumnData, createRowSelectionColumn, deriveDataFromStorage, deriveDistinctLabels, deriveLabels, distillFilterSpec, downgradeCfgOrLambda, enrichCompatible, extractArchiveAndGetURL, extractConfig, filterDataInfoEntries, filterSpecToSpecQueryExpr, flatten, fromPlOption, fromPlRef, getAllRelatedColumns, getAvailableWithLinkersAxes, getAxisUniqueValues, getBlobContent, getBlobContentAsJson, getBlobContentAsString, getColumnOrAxisValueLabelsId, getColumnSpecById, getColumnUniqueValues, getColumnsFull, getDownloadedBlobContent, getEnvironmentValue, getFromCfg, getImmediate, getImportProgress, getJsonField, getLastLogs, getLogHandle, getOnDemandBlobContent, getPartitionKeysList, getPlatformaApiVersion, getPluginData, getProgressLog, getProgressLogWithInfo, getRawPlatformaInstance, getRelatedColumns, getRequestColumnsFromSelectedSources, getResourceField, getResourceValueAsJson, getSingleColumnData, getStorageData, getUniquePartitionKeys, getUniqueSourceValuesWithLabels, ifDef, isBlockStorage, isColumnHidden, isColumnOptional, isColumnSnapshotProvider, isConfigLambda, isEmpty, isHiddenFromGraphColumn, isHiddenFromUIColumn, isPColumnReady, isPluginOutputKey, isolate, makeArray, makeObject, mapArrayValues, mapRecordValues, mapResourceFields, matchColumn, matchColumnSelectors, migrateBlockStorage, normalizeBlockStorage, normalizeSelectors, not, or, parsePColumnData, parseResourceMap, pluginOutputKey, pluginOutputPrefix, readOutput, registerFacadeCallbacks, toColumnSnapshotProvider, unreachable, updateStorageData, upgradePlDataTableStateV2, wrapOutputs, writeLabelsToSpecs };
package/dist/package.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  //#region package.json
3
- var version = "1.61.0";
3
+ var version = "1.62.0";
4
4
 
5
5
  //#endregion
6
6
  Object.defineProperty(exports, 'version', {
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "1.61.0";
2
+ var version = "1.62.0";
3
3
 
4
4
  //#endregion
5
5
  export { version };
@@ -5,7 +5,7 @@ import { BlockApiV2 } from "./block_api_v2.js";
5
5
  import { BlockApiV3 } from "./block_api_v3.js";
6
6
  import { SdkInfo } from "./version.js";
7
7
  import { PluginRecord } from "./block_model.js";
8
- import { BlockCodeKnownFeatureFlags, BlockOutputsBase, BlockStateV3, DriverKit, OutputWithStatus } from "@milaboratories/pl-model-common";
8
+ import { BlockCodeKnownFeatureFlags, BlockOutputsBase, BlockStateV3, DriverKit, OutputWithStatus, ServiceDispatch, UiServices as UiServices$1 } from "@milaboratories/pl-model-common";
9
9
 
10
10
  //#region src/platforma.d.ts
11
11
  /** Defines all methods to interact with the platform environment from within a block UI. @deprecated */
@@ -20,12 +20,16 @@ interface PlatformaV2<Args = unknown, Outputs extends Record<string, OutputWithS
20
20
  readonly sdkInfo: SdkInfo;
21
21
  readonly apiVersion: 2;
22
22
  }
23
- interface PlatformaV3<Data = unknown, Args = unknown, Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>, Href extends `/${string}` = `/${string}`, Plugins extends Record<string, unknown> = Record<string, unknown>> extends BlockApiV3<Data, Args, Outputs, Href>, DriverKit {
23
+ interface PlatformaV3<Data = unknown, Args = unknown, Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>, Href extends `/${string}` = `/${string}`, Plugins extends Record<string, unknown> = Record<string, unknown>, UiServices extends Partial<UiServices$1> = Partial<UiServices$1>> extends BlockApiV3<Data, Args, Outputs, Href>, DriverKit {
24
24
  /** Information about SDK version current platforma environment was compiled with. */
25
25
  readonly sdkInfo: SdkInfo;
26
26
  readonly apiVersion: 3;
27
+ /** Service dispatch — lists available services, their methods, and invokes them. */
28
+ readonly serviceDispatch: ServiceDispatch;
27
29
  /** @internal Type brand for plugin type inference. Not used at runtime. */
28
30
  readonly __pluginsBrand?: Plugins;
31
+ /** @internal Type brand for UI service type inference. Not used at runtime. */
32
+ readonly __uiServicesBrand?: UiServices;
29
33
  }
30
34
  type Platforma<Args = unknown, Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>, UiStateOrData = unknown, Href extends `/${string}` = `/${string}`> = PlatformaV1<Args, Outputs, UiStateOrData, Href> | PlatformaV2<Args, Outputs, UiStateOrData, Href> | PlatformaV3<UiStateOrData, Args, Outputs, Href>;
31
35
  type PlatformaExtended<Pl extends Platforma = Platforma> = Pl & {
@@ -58,7 +62,9 @@ type InferPluginData<Pl, PluginId extends string> = Pl extends PlatformaV3<unkno
58
62
  * Uses the same brand structure as InferPluginHandle — only data/params/outputs, no config —
59
63
  * because PluginRecord doesn't carry Config (lost after factory.create()).
60
64
  */
61
- type InferPluginHandles<T extends Record<string, unknown>> = { readonly [K in keyof T]: T[K] extends PluginRecord<infer Data, infer Params, infer Outputs> ? PluginHandle<PluginFactoryLike<Data, Params, Outputs>> : never };
65
+ type InferPluginHandles<T extends Record<string, unknown>> = { readonly [K in keyof T]: T[K] extends PluginRecord<infer Data, infer Params, infer Outputs, infer ModelServices, infer UiServices> ? {
66
+ handle: PluginHandle<PluginFactoryLike<Data, Params, Outputs, ModelServices, UiServices>>;
67
+ } : never };
62
68
  //#endregion
63
69
  export { BlockModelInfo, InferArgsType, InferBlockState, InferBlockStatePatch, InferDataType, InferHrefType, InferOutputsType, InferPluginData, InferPluginHandles, InferPluginNames, InferUiState, Platforma, PlatformaApiVersion, PlatformaExtended, PlatformaFactory, PlatformaV1, PlatformaV2, PlatformaV3 };
64
70
  //# sourceMappingURL=platforma.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin_handle.cjs","names":[],"sources":["../src/plugin_handle.ts"],"sourcesContent":["/**\n * PluginHandle — Opaque branded handle and output key utilities for plugin instances.\n *\n * Extracted into its own module to break circular dependencies:\n * both block_storage.ts and plugin_model.ts can import from here\n * without depending on each other.\n *\n * @module plugin_handle\n */\n\nimport type { Branded } from \"@milaboratories/helpers\";\n\n/**\n * Phantom-only base type for constraining PluginHandle's type parameter.\n *\n * PluginFactory has create() → PluginInstance with function properties, making it invariant\n * under strictFunctionTypes. PluginFactoryLike exposes only the covariant `__types` phantom,\n * avoiding the contravariance chain. Handles only need `__types` for type extraction.\n *\n * PluginFactory extends PluginFactoryLike, so every concrete factory satisfies this constraint.\n */\nexport interface PluginFactoryLike<\n Data extends Record<string, unknown> = Record<string, unknown>,\n Params extends undefined | Record<string, unknown> = undefined | Record<string, unknown>,\n Outputs extends Record<string, unknown> = Record<string, unknown>,\n> {\n readonly __types?: {\n data: Data;\n params: Params;\n outputs: Outputs;\n };\n}\n\n/** Extract the Data type from a PluginFactoryLike phantom. */\nexport type InferFactoryData<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<infer D, any, any> ? D : Record<string, unknown>\n>;\n\n/** Extract the Params type from a PluginFactoryLike phantom. */\nexport type InferFactoryParams<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<any, infer P, any> ? P : undefined\n>;\n\n/** Extract the Outputs type from a PluginFactoryLike phantom. */\nexport type InferFactoryOutputs<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<any, any, infer O> ? O : Record<string, unknown>\n>;\n\n/**\n * Derive a typed PluginHandle from a PluginFactory type.\n * Normalizes the brand to only data/params/outputs (strips config) so handles\n * from InferPluginHandles match handles from InferPluginHandle.\n */\nexport type InferPluginHandle<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<infer Data, infer Params, infer Outputs>\n ? PluginHandle<PluginFactoryLike<Data, Params, Outputs>>\n : PluginHandle\n>;\n\n/**\n * Opaque handle for a plugin instance. Runtime value is the plugin instance ID string.\n * Branded with factory phantom `F` for type-safe data/outputs extraction.\n * Constrained with PluginFactoryLike (not PluginFactory) to avoid variance issues.\n */\nexport type PluginHandle<F extends PluginFactoryLike = PluginFactoryLike> = Branded<string, F>;\n\nconst PLUGIN_OUTPUT_PREFIX = \"plugin-output#\";\n\n/** Construct the output key for a plugin output in the block outputs map. */\nexport function pluginOutputKey<F extends PluginFactoryLike>(\n handle: PluginHandle<F>,\n outputKey: string,\n): string {\n return `${PLUGIN_OUTPUT_PREFIX}${handle}#${outputKey}`;\n}\n\n/** Check whether an output key belongs to a plugin (vs block-level output). */\nexport function isPluginOutputKey(key: string): boolean {\n return key.startsWith(PLUGIN_OUTPUT_PREFIX);\n}\n\n/** Get the prefix used for all outputs of a specific plugin instance. */\nexport function pluginOutputPrefix<F extends PluginFactoryLike>(handle: PluginHandle<F>): string {\n return pluginOutputKey(handle, \"\");\n}\n"],"mappings":";;AAkEA,MAAM,uBAAuB;;AAG7B,SAAgB,gBACd,QACA,WACQ;AACR,QAAO,GAAG,uBAAuB,OAAO,GAAG;;;AAI7C,SAAgB,kBAAkB,KAAsB;AACtD,QAAO,IAAI,WAAW,qBAAqB;;;AAI7C,SAAgB,mBAAgD,QAAiC;AAC/F,QAAO,gBAAgB,QAAQ,GAAG"}
1
+ {"version":3,"file":"plugin_handle.cjs","names":[],"sources":["../src/plugin_handle.ts"],"sourcesContent":["/**\n * PluginHandle — Opaque branded handle and output key utilities for plugin instances.\n *\n * Extracted into its own module to break circular dependencies:\n * both block_storage.ts and plugin_model.ts can import from here\n * without depending on each other.\n *\n * @module plugin_handle\n */\n\nimport type { Branded } from \"@milaboratories/helpers\";\n\n/**\n * Phantom-only base type for constraining PluginHandle's type parameter.\n *\n * PluginFactory has create() → PluginInstance with function properties, making it invariant\n * under strictFunctionTypes. PluginFactoryLike exposes only the covariant `__types` phantom,\n * avoiding the contravariance chain. Handles only need `__types` for type extraction.\n *\n * PluginFactory extends PluginFactoryLike, so every concrete factory satisfies this constraint.\n */\nexport interface PluginFactoryLike<\n Data extends Record<string, unknown> = Record<string, unknown>,\n Params extends undefined | Record<string, unknown> = undefined | Record<string, unknown>,\n Outputs extends Record<string, unknown> = Record<string, unknown>,\n ModelServices = unknown,\n UiServices = unknown,\n> {\n readonly __types?: {\n data: Data;\n params: Params;\n outputs: Outputs;\n modelServices: ModelServices;\n uiServices: UiServices;\n };\n}\n\n/** Extract the Data type from a PluginFactoryLike phantom. */\nexport type InferFactoryData<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<infer D, any, any, any, any> ? D : Record<string, unknown>\n>;\n\n/** Extract the Params type from a PluginFactoryLike phantom. */\nexport type InferFactoryParams<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<any, infer P, any, any, any> ? P : undefined\n>;\n\n/** Extract the Outputs type from a PluginFactoryLike phantom. */\nexport type InferFactoryOutputs<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<any, any, infer O, any, any> ? O : Record<string, unknown>\n>;\n\n/** Extract the pre-resolved model services type from a PluginFactoryLike phantom. */\nexport type InferFactoryModelServices<F extends PluginFactoryLike> =\n F extends PluginFactoryLike<any, any, any, infer ModelServices, any> ? ModelServices : {};\n\n/** Extract the pre-resolved UI services type from a PluginFactoryLike phantom. */\nexport type InferFactoryUiServices<F extends PluginFactoryLike> =\n F extends PluginFactoryLike<any, any, any, any, infer UiServices> ? UiServices : {};\n\n/**\n * Derive a typed PluginHandle from a PluginFactory type.\n * Normalizes the brand to data/params/outputs/services (strips config) so handles\n * from InferPluginHandles match handles from InferPluginHandle.\n */\nexport type InferPluginHandle<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<\n infer Data,\n infer Params,\n infer Outputs,\n infer ModelServices,\n infer UiServices\n >\n ? PluginHandle<PluginFactoryLike<Data, Params, Outputs, ModelServices, UiServices>>\n : PluginHandle\n>;\n\n/**\n * Opaque handle for a plugin instance. Runtime value is the plugin instance ID string.\n * Branded with factory phantom `F` for type-safe data/outputs extraction.\n * Constrained with PluginFactoryLike (not PluginFactory) to avoid variance issues.\n */\nexport type PluginHandle<F extends PluginFactoryLike = PluginFactoryLike> = Branded<string, F>;\n\nconst PLUGIN_OUTPUT_PREFIX = \"plugin-output#\";\n\n/** Construct the output key for a plugin output in the block outputs map. */\nexport function pluginOutputKey<F extends PluginFactoryLike>(\n handle: PluginHandle<F>,\n outputKey: string,\n): string {\n return `${PLUGIN_OUTPUT_PREFIX}${handle}#${outputKey}`;\n}\n\n/** Check whether an output key belongs to a plugin (vs block-level output). */\nexport function isPluginOutputKey(key: string): boolean {\n return key.startsWith(PLUGIN_OUTPUT_PREFIX);\n}\n\n/** Get the prefix used for all outputs of a specific plugin instance. */\nexport function pluginOutputPrefix<F extends PluginFactoryLike>(handle: PluginHandle<F>): string {\n return pluginOutputKey(handle, \"\");\n}\n"],"mappings":";;AAoFA,MAAM,uBAAuB;;AAG7B,SAAgB,gBACd,QACA,WACQ;AACR,QAAO,GAAG,uBAAuB,OAAO,GAAG;;;AAI7C,SAAgB,kBAAkB,KAAsB;AACtD,QAAO,IAAI,WAAW,qBAAqB;;;AAI7C,SAAgB,mBAAgD,QAAiC;AAC/F,QAAO,gBAAgB,QAAQ,GAAG"}
@@ -10,25 +10,31 @@ import { Branded } from "@milaboratories/helpers";
10
10
  *
11
11
  * PluginFactory extends PluginFactoryLike, so every concrete factory satisfies this constraint.
12
12
  */
13
- interface PluginFactoryLike<Data extends Record<string, unknown> = Record<string, unknown>, Params extends undefined | Record<string, unknown> = undefined | Record<string, unknown>, Outputs extends Record<string, unknown> = Record<string, unknown>> {
13
+ interface PluginFactoryLike<Data extends Record<string, unknown> = Record<string, unknown>, Params extends undefined | Record<string, unknown> = undefined | Record<string, unknown>, Outputs extends Record<string, unknown> = Record<string, unknown>, ModelServices = unknown, UiServices = unknown> {
14
14
  readonly __types?: {
15
15
  data: Data;
16
16
  params: Params;
17
17
  outputs: Outputs;
18
+ modelServices: ModelServices;
19
+ uiServices: UiServices;
18
20
  };
19
21
  }
20
22
  /** Extract the Data type from a PluginFactoryLike phantom. */
21
- type InferFactoryData<F extends PluginFactoryLike> = NonNullable<F extends PluginFactoryLike<infer D, any, any> ? D : Record<string, unknown>>;
23
+ type InferFactoryData<F extends PluginFactoryLike> = NonNullable<F extends PluginFactoryLike<infer D, any, any, any, any> ? D : Record<string, unknown>>;
22
24
  /** Extract the Params type from a PluginFactoryLike phantom. */
23
- type InferFactoryParams<F extends PluginFactoryLike> = NonNullable<F extends PluginFactoryLike<any, infer P, any> ? P : undefined>;
25
+ type InferFactoryParams<F extends PluginFactoryLike> = NonNullable<F extends PluginFactoryLike<any, infer P, any, any, any> ? P : undefined>;
24
26
  /** Extract the Outputs type from a PluginFactoryLike phantom. */
25
- type InferFactoryOutputs<F extends PluginFactoryLike> = NonNullable<F extends PluginFactoryLike<any, any, infer O> ? O : Record<string, unknown>>;
27
+ type InferFactoryOutputs<F extends PluginFactoryLike> = NonNullable<F extends PluginFactoryLike<any, any, infer O, any, any> ? O : Record<string, unknown>>;
28
+ /** Extract the pre-resolved model services type from a PluginFactoryLike phantom. */
29
+ type InferFactoryModelServices<F extends PluginFactoryLike> = F extends PluginFactoryLike<any, any, any, infer ModelServices, any> ? ModelServices : {};
30
+ /** Extract the pre-resolved UI services type from a PluginFactoryLike phantom. */
31
+ type InferFactoryUiServices<F extends PluginFactoryLike> = F extends PluginFactoryLike<any, any, any, any, infer UiServices> ? UiServices : {};
26
32
  /**
27
33
  * Derive a typed PluginHandle from a PluginFactory type.
28
- * Normalizes the brand to only data/params/outputs (strips config) so handles
34
+ * Normalizes the brand to data/params/outputs/services (strips config) so handles
29
35
  * from InferPluginHandles match handles from InferPluginHandle.
30
36
  */
31
- type InferPluginHandle<F extends PluginFactoryLike> = NonNullable<F extends PluginFactoryLike<infer Data, infer Params, infer Outputs> ? PluginHandle<PluginFactoryLike<Data, Params, Outputs>> : PluginHandle>;
37
+ type InferPluginHandle<F extends PluginFactoryLike> = NonNullable<F extends PluginFactoryLike<infer Data, infer Params, infer Outputs, infer ModelServices, infer UiServices> ? PluginHandle<PluginFactoryLike<Data, Params, Outputs, ModelServices, UiServices>> : PluginHandle>;
32
38
  /**
33
39
  * Opaque handle for a plugin instance. Runtime value is the plugin instance ID string.
34
40
  * Branded with factory phantom `F` for type-safe data/outputs extraction.
@@ -42,5 +48,5 @@ declare function isPluginOutputKey(key: string): boolean;
42
48
  /** Get the prefix used for all outputs of a specific plugin instance. */
43
49
  declare function pluginOutputPrefix<F extends PluginFactoryLike>(handle: PluginHandle<F>): string;
44
50
  //#endregion
45
- export { InferFactoryData, InferFactoryOutputs, InferFactoryParams, InferPluginHandle, PluginFactoryLike, PluginHandle, isPluginOutputKey, pluginOutputKey, pluginOutputPrefix };
51
+ export { InferFactoryData, InferFactoryModelServices, InferFactoryOutputs, InferFactoryParams, InferFactoryUiServices, InferPluginHandle, PluginFactoryLike, PluginHandle, isPluginOutputKey, pluginOutputKey, pluginOutputPrefix };
46
52
  //# sourceMappingURL=plugin_handle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin_handle.js","names":[],"sources":["../src/plugin_handle.ts"],"sourcesContent":["/**\n * PluginHandle — Opaque branded handle and output key utilities for plugin instances.\n *\n * Extracted into its own module to break circular dependencies:\n * both block_storage.ts and plugin_model.ts can import from here\n * without depending on each other.\n *\n * @module plugin_handle\n */\n\nimport type { Branded } from \"@milaboratories/helpers\";\n\n/**\n * Phantom-only base type for constraining PluginHandle's type parameter.\n *\n * PluginFactory has create() → PluginInstance with function properties, making it invariant\n * under strictFunctionTypes. PluginFactoryLike exposes only the covariant `__types` phantom,\n * avoiding the contravariance chain. Handles only need `__types` for type extraction.\n *\n * PluginFactory extends PluginFactoryLike, so every concrete factory satisfies this constraint.\n */\nexport interface PluginFactoryLike<\n Data extends Record<string, unknown> = Record<string, unknown>,\n Params extends undefined | Record<string, unknown> = undefined | Record<string, unknown>,\n Outputs extends Record<string, unknown> = Record<string, unknown>,\n> {\n readonly __types?: {\n data: Data;\n params: Params;\n outputs: Outputs;\n };\n}\n\n/** Extract the Data type from a PluginFactoryLike phantom. */\nexport type InferFactoryData<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<infer D, any, any> ? D : Record<string, unknown>\n>;\n\n/** Extract the Params type from a PluginFactoryLike phantom. */\nexport type InferFactoryParams<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<any, infer P, any> ? P : undefined\n>;\n\n/** Extract the Outputs type from a PluginFactoryLike phantom. */\nexport type InferFactoryOutputs<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<any, any, infer O> ? O : Record<string, unknown>\n>;\n\n/**\n * Derive a typed PluginHandle from a PluginFactory type.\n * Normalizes the brand to only data/params/outputs (strips config) so handles\n * from InferPluginHandles match handles from InferPluginHandle.\n */\nexport type InferPluginHandle<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<infer Data, infer Params, infer Outputs>\n ? PluginHandle<PluginFactoryLike<Data, Params, Outputs>>\n : PluginHandle\n>;\n\n/**\n * Opaque handle for a plugin instance. Runtime value is the plugin instance ID string.\n * Branded with factory phantom `F` for type-safe data/outputs extraction.\n * Constrained with PluginFactoryLike (not PluginFactory) to avoid variance issues.\n */\nexport type PluginHandle<F extends PluginFactoryLike = PluginFactoryLike> = Branded<string, F>;\n\nconst PLUGIN_OUTPUT_PREFIX = \"plugin-output#\";\n\n/** Construct the output key for a plugin output in the block outputs map. */\nexport function pluginOutputKey<F extends PluginFactoryLike>(\n handle: PluginHandle<F>,\n outputKey: string,\n): string {\n return `${PLUGIN_OUTPUT_PREFIX}${handle}#${outputKey}`;\n}\n\n/** Check whether an output key belongs to a plugin (vs block-level output). */\nexport function isPluginOutputKey(key: string): boolean {\n return key.startsWith(PLUGIN_OUTPUT_PREFIX);\n}\n\n/** Get the prefix used for all outputs of a specific plugin instance. */\nexport function pluginOutputPrefix<F extends PluginFactoryLike>(handle: PluginHandle<F>): string {\n return pluginOutputKey(handle, \"\");\n}\n"],"mappings":";AAkEA,MAAM,uBAAuB;;AAG7B,SAAgB,gBACd,QACA,WACQ;AACR,QAAO,GAAG,uBAAuB,OAAO,GAAG;;;AAI7C,SAAgB,kBAAkB,KAAsB;AACtD,QAAO,IAAI,WAAW,qBAAqB;;;AAI7C,SAAgB,mBAAgD,QAAiC;AAC/F,QAAO,gBAAgB,QAAQ,GAAG"}
1
+ {"version":3,"file":"plugin_handle.js","names":[],"sources":["../src/plugin_handle.ts"],"sourcesContent":["/**\n * PluginHandle — Opaque branded handle and output key utilities for plugin instances.\n *\n * Extracted into its own module to break circular dependencies:\n * both block_storage.ts and plugin_model.ts can import from here\n * without depending on each other.\n *\n * @module plugin_handle\n */\n\nimport type { Branded } from \"@milaboratories/helpers\";\n\n/**\n * Phantom-only base type for constraining PluginHandle's type parameter.\n *\n * PluginFactory has create() → PluginInstance with function properties, making it invariant\n * under strictFunctionTypes. PluginFactoryLike exposes only the covariant `__types` phantom,\n * avoiding the contravariance chain. Handles only need `__types` for type extraction.\n *\n * PluginFactory extends PluginFactoryLike, so every concrete factory satisfies this constraint.\n */\nexport interface PluginFactoryLike<\n Data extends Record<string, unknown> = Record<string, unknown>,\n Params extends undefined | Record<string, unknown> = undefined | Record<string, unknown>,\n Outputs extends Record<string, unknown> = Record<string, unknown>,\n ModelServices = unknown,\n UiServices = unknown,\n> {\n readonly __types?: {\n data: Data;\n params: Params;\n outputs: Outputs;\n modelServices: ModelServices;\n uiServices: UiServices;\n };\n}\n\n/** Extract the Data type from a PluginFactoryLike phantom. */\nexport type InferFactoryData<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<infer D, any, any, any, any> ? D : Record<string, unknown>\n>;\n\n/** Extract the Params type from a PluginFactoryLike phantom. */\nexport type InferFactoryParams<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<any, infer P, any, any, any> ? P : undefined\n>;\n\n/** Extract the Outputs type from a PluginFactoryLike phantom. */\nexport type InferFactoryOutputs<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<any, any, infer O, any, any> ? O : Record<string, unknown>\n>;\n\n/** Extract the pre-resolved model services type from a PluginFactoryLike phantom. */\nexport type InferFactoryModelServices<F extends PluginFactoryLike> =\n F extends PluginFactoryLike<any, any, any, infer ModelServices, any> ? ModelServices : {};\n\n/** Extract the pre-resolved UI services type from a PluginFactoryLike phantom. */\nexport type InferFactoryUiServices<F extends PluginFactoryLike> =\n F extends PluginFactoryLike<any, any, any, any, infer UiServices> ? UiServices : {};\n\n/**\n * Derive a typed PluginHandle from a PluginFactory type.\n * Normalizes the brand to data/params/outputs/services (strips config) so handles\n * from InferPluginHandles match handles from InferPluginHandle.\n */\nexport type InferPluginHandle<F extends PluginFactoryLike> = NonNullable<\n F extends PluginFactoryLike<\n infer Data,\n infer Params,\n infer Outputs,\n infer ModelServices,\n infer UiServices\n >\n ? PluginHandle<PluginFactoryLike<Data, Params, Outputs, ModelServices, UiServices>>\n : PluginHandle\n>;\n\n/**\n * Opaque handle for a plugin instance. Runtime value is the plugin instance ID string.\n * Branded with factory phantom `F` for type-safe data/outputs extraction.\n * Constrained with PluginFactoryLike (not PluginFactory) to avoid variance issues.\n */\nexport type PluginHandle<F extends PluginFactoryLike = PluginFactoryLike> = Branded<string, F>;\n\nconst PLUGIN_OUTPUT_PREFIX = \"plugin-output#\";\n\n/** Construct the output key for a plugin output in the block outputs map. */\nexport function pluginOutputKey<F extends PluginFactoryLike>(\n handle: PluginHandle<F>,\n outputKey: string,\n): string {\n return `${PLUGIN_OUTPUT_PREFIX}${handle}#${outputKey}`;\n}\n\n/** Check whether an output key belongs to a plugin (vs block-level output). */\nexport function isPluginOutputKey(key: string): boolean {\n return key.startsWith(PLUGIN_OUTPUT_PREFIX);\n}\n\n/** Get the prefix used for all outputs of a specific plugin instance. */\nexport function pluginOutputPrefix<F extends PluginFactoryLike>(handle: PluginHandle<F>): string {\n return pluginOutputKey(handle, \"\");\n}\n"],"mappings":";AAoFA,MAAM,uBAAuB;;AAG7B,SAAgB,gBACd,QACA,WACQ;AACR,QAAO,GAAG,uBAAuB,OAAO,GAAG;;;AAI7C,SAAgB,kBAAkB,KAAsB;AACtD,QAAO,IAAI,WAAW,qBAAqB;;;AAI7C,SAAgB,mBAAgD,QAAiC;AAC/F,QAAO,gBAAgB,QAAQ,GAAG"}
@@ -180,23 +180,22 @@ function buildPluginDataModel(state, configInitFn) {
180
180
  var PluginInstance = class PluginInstance {
181
181
  id;
182
182
  transferVersion;
183
- /** @internal */
184
- __transferBrand;
185
- factory;
186
- config;
187
- constructor(id, factory, transferVersion, config) {
183
+ /** @internal Phantom for type inference; never set at runtime. */
184
+ __instanceTypes;
185
+ /** Bound closure that creates the PluginModel. Config is captured at factory.create() time. */
186
+ createPluginModel;
187
+ constructor(id, createPluginModel, transferVersion) {
188
188
  this.id = id;
189
- this.factory = factory;
189
+ this.createPluginModel = createPluginModel;
190
190
  this.transferVersion = transferVersion;
191
- this.config = config;
192
191
  }
193
- /** @internal */
192
+ /** @internal Accepts concrete Config — binds it into a closure, avoiding Config variance issues. */
194
193
  static [FROM_BUILDER](id, factory, transferVersion, config) {
195
- return new PluginInstance(id, factory, transferVersion, config);
194
+ return new PluginInstance(id, () => factory[CREATE_PLUGIN_MODEL](config), transferVersion);
196
195
  }
197
196
  /** @internal Create a PluginModel from this instance. Used by BlockModelV3.plugin(). */
198
197
  [CREATE_PLUGIN_MODEL]() {
199
- return this.factory[CREATE_PLUGIN_MODEL](this.config);
198
+ return this.createPluginModel();
200
199
  }
201
200
  };
202
201
  /**
@@ -210,6 +209,8 @@ var PluginModel = class PluginModel {
210
209
  dataModel;
211
210
  /** Output definitions - functions that compute outputs from plugin context */
212
211
  outputs;
212
+ /** Per-output flags (e.g. withStatus) */
213
+ outputFlags;
213
214
  /** Feature flags declared by this plugin */
214
215
  featureFlags;
215
216
  /** Create fresh default data. Config (if any) is captured at creation time. */
@@ -218,6 +219,7 @@ var PluginModel = class PluginModel {
218
219
  this.name = options.name;
219
220
  this.dataModel = options.dataModel;
220
221
  this.outputs = options.outputs;
222
+ this.outputFlags = options.outputFlags;
221
223
  this.featureFlags = options.featureFlags;
222
224
  this.getDefaultData = options.getDefaultData;
223
225
  }
@@ -232,14 +234,14 @@ var PluginModel = class PluginModel {
232
234
  static define(options) {
233
235
  if (options.data instanceof PluginDataModel) {
234
236
  const pdm = options.data;
235
- return PluginModelBuilder[FROM_BUILDER]({
237
+ return PluginModelInitialBuilder.create({
236
238
  name: options.name,
237
239
  dataFn: () => pdm.dataModel,
238
240
  getDefaultDataFn: (config) => pdm.getDefaultData(config),
239
241
  featureFlags: options.featureFlags
240
242
  });
241
243
  }
242
- return PluginModelBuilder[FROM_BUILDER]({
244
+ return PluginModelInitialBuilder.create({
243
245
  name: options.name,
244
246
  dataFn: options.data,
245
247
  featureFlags: options.featureFlags
@@ -251,12 +253,14 @@ var PluginModelFactory = class PluginModelFactory {
251
253
  dataFn;
252
254
  getDefaultDataFn;
253
255
  outputs;
256
+ outputFlags;
254
257
  featureFlags;
255
258
  constructor(options) {
256
259
  this.name = options.name;
257
260
  this.dataFn = options.dataFn;
258
261
  this.getDefaultDataFn = options.getDefaultDataFn;
259
262
  this.outputs = options.outputs;
263
+ this.outputFlags = options.outputFlags;
260
264
  this.featureFlags = options.featureFlags;
261
265
  }
262
266
  /** @internal */
@@ -275,6 +279,7 @@ var PluginModelFactory = class PluginModelFactory {
275
279
  name: this.name,
276
280
  dataModel,
277
281
  outputs: this.outputs,
282
+ outputFlags: this.outputFlags,
278
283
  featureFlags: this.featureFlags,
279
284
  getDefaultData: getDefaultDataFn ? () => getDefaultDataFn(config) : () => dataModel.getDefaultData()
280
285
  });
@@ -304,12 +309,14 @@ var PluginModelBuilder = class PluginModelBuilder {
304
309
  dataFn;
305
310
  getDefaultDataFn;
306
311
  outputs;
312
+ outputFlags;
307
313
  featureFlags;
308
314
  constructor(options) {
309
315
  this.name = options.name;
310
316
  this.dataFn = options.dataFn;
311
317
  this.getDefaultDataFn = options.getDefaultDataFn;
312
318
  this.outputs = options.outputs ?? {};
319
+ this.outputFlags = options.outputFlags ?? {};
313
320
  this.featureFlags = options.featureFlags;
314
321
  }
315
322
  /** @internal */
@@ -336,6 +343,43 @@ var PluginModelBuilder = class PluginModelBuilder {
336
343
  outputs: {
337
344
  ...this.outputs,
338
345
  [key]: fn
346
+ },
347
+ outputFlags: {
348
+ ...this.outputFlags,
349
+ [key]: { withStatus: false }
350
+ }
351
+ });
352
+ }
353
+ /**
354
+ * Adds an output wrapped with status information to the plugin.
355
+ *
356
+ * The UI receives the full {@link OutputWithStatus} object instead of an unwrapped value,
357
+ * allowing it to distinguish between pending, success, and error states.
358
+ *
359
+ * @param key - Output name
360
+ * @param fn - Function that computes the output value from plugin context
361
+ * @returns PluginModel with the new status-wrapped output added
362
+ *
363
+ * @example
364
+ * .outputWithStatus('table', (ctx) => {
365
+ * const pCols = ctx.params.pFrame?.getPColumns();
366
+ * if (pCols === undefined) return undefined;
367
+ * return createPlDataTableV2(ctx, pCols, ctx.data.tableState);
368
+ * })
369
+ */
370
+ outputWithStatus(key, fn) {
371
+ return new PluginModelBuilder({
372
+ name: this.name,
373
+ dataFn: this.dataFn,
374
+ getDefaultDataFn: this.getDefaultDataFn,
375
+ featureFlags: this.featureFlags,
376
+ outputs: {
377
+ ...this.outputs,
378
+ [key]: fn
379
+ },
380
+ outputFlags: {
381
+ ...this.outputFlags,
382
+ [key]: { withStatus: true }
339
383
  }
340
384
  });
341
385
  }
@@ -358,6 +402,34 @@ var PluginModelBuilder = class PluginModelBuilder {
358
402
  dataFn: this.dataFn,
359
403
  getDefaultDataFn: this.getDefaultDataFn,
360
404
  outputs: this.outputs,
405
+ outputFlags: this.outputFlags,
406
+ featureFlags: this.featureFlags
407
+ });
408
+ }
409
+ };
410
+ /**
411
+ * Initial builder returned by PluginModel.define(). Extends PluginModelBuilder with .params().
412
+ * Once .params() or .output() is called, transitions to PluginModelBuilder (no second .params()).
413
+ */
414
+ var PluginModelInitialBuilder = class PluginModelInitialBuilder extends PluginModelBuilder {
415
+ /** @internal */
416
+ static create(options) {
417
+ return new PluginModelInitialBuilder(options);
418
+ }
419
+ /**
420
+ * Sets the Params type for this plugin — the shape of data derived from the block's
421
+ * render context and passed into plugin output functions via `ctx.params`.
422
+ * Must be called before .output(). Available only on the initial builder.
423
+ *
424
+ * @example
425
+ * .params<{ title: string }>()
426
+ * .output('displayText', (ctx) => ctx.params.title)
427
+ */
428
+ params() {
429
+ return PluginModelBuilder[FROM_BUILDER]({
430
+ name: this.name,
431
+ dataFn: this.dataFn,
432
+ getDefaultDataFn: this.getDefaultDataFn,
361
433
  featureFlags: this.featureFlags
362
434
  });
363
435
  }