@fluidframework/devtools-core 2.70.0-361248 → 2.70.0-361788

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 (46) hide show
  1. package/README.md +2 -0
  2. package/api-extractor/api-extractor-lint-beta.cjs.json +5 -0
  3. package/api-extractor/api-extractor-lint-beta.esm.json +5 -0
  4. package/api-report/devtools-core.alpha.api.md +11 -11
  5. package/api-report/devtools-core.beta.api.md +31 -0
  6. package/beta.d.ts +11 -0
  7. package/dist/ContainerDevtools.d.ts +5 -3
  8. package/dist/ContainerDevtools.d.ts.map +1 -1
  9. package/dist/ContainerDevtools.js.map +1 -1
  10. package/dist/ContainerRuntimeDevtools.d.ts +3 -2
  11. package/dist/ContainerRuntimeDevtools.d.ts.map +1 -1
  12. package/dist/ContainerRuntimeDevtools.js.map +1 -1
  13. package/dist/FluidDevtools.d.ts +7 -5
  14. package/dist/FluidDevtools.d.ts.map +1 -1
  15. package/dist/FluidDevtools.js +2 -2
  16. package/dist/FluidDevtools.js.map +1 -1
  17. package/dist/IFluidDevtools.d.ts +1 -1
  18. package/dist/IFluidDevtools.js.map +1 -1
  19. package/dist/alpha.d.ts +4 -7
  20. package/dist/beta.d.ts +42 -0
  21. package/dist/packageVersion.d.ts +1 -1
  22. package/dist/packageVersion.js +1 -1
  23. package/dist/packageVersion.js.map +1 -1
  24. package/lib/ContainerDevtools.d.ts +5 -3
  25. package/lib/ContainerDevtools.d.ts.map +1 -1
  26. package/lib/ContainerDevtools.js.map +1 -1
  27. package/lib/ContainerRuntimeDevtools.d.ts +3 -2
  28. package/lib/ContainerRuntimeDevtools.d.ts.map +1 -1
  29. package/lib/ContainerRuntimeDevtools.js.map +1 -1
  30. package/lib/FluidDevtools.d.ts +7 -5
  31. package/lib/FluidDevtools.d.ts.map +1 -1
  32. package/lib/FluidDevtools.js +2 -2
  33. package/lib/FluidDevtools.js.map +1 -1
  34. package/lib/IFluidDevtools.d.ts +1 -1
  35. package/lib/IFluidDevtools.js.map +1 -1
  36. package/lib/alpha.d.ts +4 -7
  37. package/lib/beta.d.ts +42 -0
  38. package/lib/packageVersion.d.ts +1 -1
  39. package/lib/packageVersion.js +1 -1
  40. package/lib/packageVersion.js.map +1 -1
  41. package/package.json +35 -23
  42. package/src/ContainerDevtools.ts +5 -3
  43. package/src/ContainerRuntimeDevtools.ts +3 -2
  44. package/src/FluidDevtools.ts +7 -5
  45. package/src/IFluidDevtools.ts +1 -1
  46. package/src/packageVersion.ts +1 -1
@@ -9,13 +9,15 @@ import type { HasContainerKey } from "./CommonInterfaces.js";
9
9
  import type { ContainerDevtoolsFeatureFlags } from "./Features.js";
10
10
  /**
11
11
  * Properties for registering a {@link @fluidframework/container-definitions#IContainer} with the Devtools.
12
- * @alpha
12
+ * @beta
13
+ * @input
14
+ * @sealed
13
15
  */
14
16
  export interface ContainerDevtoolsProps extends HasContainerKey {
15
17
  /**
16
18
  * The Container to register with the Devtools.
17
19
  */
18
- container: IContainer;
20
+ readonly container: IContainer;
19
21
  /**
20
22
  * (optional) Distributed Data Structures (DDSs) associated with the
21
23
  * {@link ContainerDevtoolsProps.container | Container}.
@@ -29,7 +31,7 @@ export interface ContainerDevtoolsProps extends HasContainerKey {
29
31
  *
30
32
  * @privateRemarks TODO: rename this to make it more clear that this data does not *belong* to the Container.
31
33
  */
32
- containerData?: Record<string, IFluidLoadable>;
34
+ readonly containerData?: Record<string, IFluidLoadable>;
33
35
  }
34
36
  /**
35
37
  * {@link IContainerDevtools} implementation for real containers.
@@ -1 +1 @@
1
- {"version":3,"file":"ContainerDevtools.d.ts","sourceRoot":"","sources":["../src/ContainerDevtools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO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;oBACtD,KAAK,CAAC,SAAS,CAAC,UAAU;oBACzB,6DAA6D;qBAC7D,CAAC;oBACF,OAAO,IAAI,CAAC;gBACb,CAAC;gBACD,OAAO,KAAK,CAAC;YACd,CAAC;YACD,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;gBACtD,MAAM,OAAO,GAAG,cAAwC,CAAC;gBACzD,IAAI,OAAO,CAAC,IAAI,CAAC,YAAY,KAAK,KAAK,CAAC,YAAY,EAAE,CAAC;oBACtD,KAAK,CAAC,SAAS,CAAC,KAAK,EAAC,6DAA6D,CAAC,CAAC;oBACrF,OAAO,IAAI,CAAC;gBACb,CAAC;gBACD,OAAO,KAAK,CAAC;YACd,CAAC;SACD,CAAC;QAEF,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;QAEjE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC;QAElC,4DAA4D;QAC5D,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC3B,CAAC;IAEkB,oBAAoB;QACtC,OAAO;YACN,0BAA0B,EAAE,IAAI,CAAC,aAAa,KAAK,SAAS;YAC5D,uBAAuB,EAAE,IAAI;SAC7B,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainer } from \"@fluidframework/container-definitions/internal\";\nimport type { IFluidLoadable } from \"@fluidframework/core-interfaces\";\n\nimport { BaseDevtools } from \"./BaseDevtools.js\";\nimport type { HasContainerKey } from \"./CommonInterfaces.js\";\nimport type { ContainerDevtoolsFeatureFlags } from \"./Features.js\";\nimport {\n\tCloseContainer,\n\tConnectContainer,\n\tDisconnectContainer,\n\ttype InboundHandlers,\n} from \"./messaging/index.js\";\n\n/**\n * Properties for registering a {@link @fluidframework/container-definitions#IContainer} with the Devtools.\n * @alpha\n */\nexport interface ContainerDevtoolsProps extends HasContainerKey {\n\t/**\n\t * The Container to register with the Devtools.\n\t */\n\tcontainer: IContainer;\n\n\t/**\n\t * (optional) Distributed Data Structures (DDSs) associated with the\n\t * {@link ContainerDevtoolsProps.container | Container}.\n\t *\n\t * @remarks\n\t *\n\t * Providing this data will enable associated tooling to visualize the Fluid data reachable from the provided\n\t * objects.\n\t *\n\t * Fluid DevTools will not mutate this data.\n\t *\n\t * @privateRemarks TODO: rename this to make it more clear that this data does not *belong* to the Container.\n\t */\n\tcontainerData?: Record<string, IFluidLoadable>;\n\n\t// TODO: Add ability for customers to specify custom visualizer overrides\n}\n\n/**\n * {@link IContainerDevtools} implementation for real containers.\n *\n * @remarks\n *\n * This class listens to incoming messages from the window (globalThis), and posts messages to it upon relevant\n * state changes and when requested.\n *\n * **Messages it listens for (if the {@link HasContainerKey.containerKey} matches):**\n *\n * - {@link GetContainerDevtoolsFeatures.Message}: When received, {@link ContainerDevtoolsFeatures.Message} will be\n * posted in response.\n *\n * - {@link GetContainerState.Message}: When received, {@link ContainerStateChange.Message} will be posted in response.\n *\n * - {@link ConnectContainer.Message}: When received, {@link @fluidframework/container-definitions#IContainer.connect}\n * will be called on the {@link ContainerDevtools.container} (if it is disconnected).\n *\n * - {@link DisconnectContainer.Message}: When received, {@link @fluidframework/container-definitions#IContainer.disconnect}\n * will be called on the {@link ContainerDevtools.container} (if it is connected).\n *\n * - {@link CloseContainer.Message}: When received, {@link @fluidframework/container-definitions#IContainer.close}\n * will be called on the {@link ContainerDevtools.container}.\n *\n * - {@link GetAudienceSummary.Message}: When received, {@link AudienceSummary.Message} will be posted in response.\n *\n * - {@link GetRootDataVisualizations.Message}: When received, {@link RootDataVisualizations.Message} will be posted\n * in response.\n *\n * - {@link GetDataVisualization.Message}: When received, {@link DataVisualization.Message} will be posted in response.\n *\n * **Messages it posts:**\n *\n * - {@link ContainerDevtoolsFeatures.Message}: Posted only when requested via {@link GetContainerDevtoolsFeatures.Message}.\n *\n * - {@link AudienceSummary.Message}: Posted any time the Container's Audience state changes, or when requested\n * (via {@link GetAudienceSummary.Message}).\n *\n * - {@link ContainerStateChange.Message}: Posted any time relevant Container state changes,\n * or when requested (via {@link GetContainerState.Message}).\n *\n * - {@link RootDataVisualizations.Message}: Posted when requested via {@link GetRootDataVisualizations.Message}.\n *\n * - {@link DataVisualization.Message}: Posted when requested via {@link GetDataVisualization.Message}, or when\n * a change has occurred on the associated DDS, reachable from the visualization graph.\n *\n * @sealed\n */\nexport class ContainerDevtools extends BaseDevtools<IContainer> {\n\t/**\n\t * The registered Container.\n\t */\n\tprotected override get container(): IContainer {\n\t\treturn this._container;\n\t}\n\n\tprivate readonly _container: IContainer;\n\n\tpublic constructor(props: ContainerDevtoolsProps) {\n\t\t// Create specific message handlers for container operations\n\t\tconst specificHandlers: InboundHandlers = {\n\t\t\t[ConnectContainer.MessageType]: async (untypedMessage) => {\n\t\t\t\tconst message = untypedMessage as ConnectContainer.Message;\n\t\t\t\tif (message.data.containerKey === props.containerKey) {\n\t\t\t\t\tprops.container.connect();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\t[DisconnectContainer.MessageType]: async (untypedMessage) => {\n\t\t\t\tconst message = untypedMessage as DisconnectContainer.Message;\n\t\t\t\tif (message.data.containerKey === props.containerKey) {\n\t\t\t\t\tprops.container.disconnect(\n\t\t\t\t\t\t/* TODO: Specify devtools reason here once it is supported */\n\t\t\t\t\t);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\t[CloseContainer.MessageType]: async (untypedMessage) => {\n\t\t\t\tconst message = untypedMessage as CloseContainer.Message;\n\t\t\t\tif (message.data.containerKey === props.containerKey) {\n\t\t\t\t\tprops.container.close(/* TODO: Specify devtools reason here once it is supported */);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t};\n\n\t\tsuper(props.containerKey, specificHandlers, props.containerData);\n\n\t\tthis._container = props.container;\n\n\t\t// Bind container and audience events after container is set\n\t\tthis.bindContainerEvents();\n\t\tthis.bindAudienceEvents();\n\t}\n\n\tprotected override getSupportedFeatures(): ContainerDevtoolsFeatureFlags {\n\t\treturn {\n\t\t\tcontainerDataVisualization: this.containerData !== undefined,\n\t\t\tcanModifyContainerState: true,\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"ContainerDevtools.js","sourceRoot":"","sources":["../src/ContainerDevtools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,mBAAmB,GAEnB,MAAM,sBAAsB,CAAC;AAgC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,OAAO,iBAAkB,SAAQ,YAAwB;IAC9D;;OAEG;IACH,IAAuB,SAAS;QAC/B,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAID,YAAmB,KAA6B;QAC/C,4DAA4D;QAC5D,MAAM,gBAAgB,GAAoB;YACzC,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;gBACxD,MAAM,OAAO,GAAG,cAA0C,CAAC;gBAC3D,IAAI,OAAO,CAAC,IAAI,CAAC,YAAY,KAAK,KAAK,CAAC,YAAY,EAAE,CAAC;oBACtD,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;oBAC1B,OAAO,IAAI,CAAC;gBACb,CAAC;gBACD,OAAO,KAAK,CAAC;YACd,CAAC;YACD,CAAC,mBAAmB,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;gBAC3D,MAAM,OAAO,GAAG,cAA6C,CAAC;gBAC9D,IAAI,OAAO,CAAC,IAAI,CAAC,YAAY,KAAK,KAAK,CAAC,YAAY,EAAE,CAAC;oBACtD,KAAK,CAAC,SAAS,CAAC,UAAU;oBACzB,6DAA6D;qBAC7D,CAAC;oBACF,OAAO,IAAI,CAAC;gBACb,CAAC;gBACD,OAAO,KAAK,CAAC;YACd,CAAC;YACD,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;gBACtD,MAAM,OAAO,GAAG,cAAwC,CAAC;gBACzD,IAAI,OAAO,CAAC,IAAI,CAAC,YAAY,KAAK,KAAK,CAAC,YAAY,EAAE,CAAC;oBACtD,KAAK,CAAC,SAAS,CAAC,KAAK,EAAC,6DAA6D,CAAC,CAAC;oBACrF,OAAO,IAAI,CAAC;gBACb,CAAC;gBACD,OAAO,KAAK,CAAC;YACd,CAAC;SACD,CAAC;QAEF,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;QAEjE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC;QAElC,4DAA4D;QAC5D,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC3B,CAAC;IAEkB,oBAAoB;QACtC,OAAO;YACN,0BAA0B,EAAE,IAAI,CAAC,aAAa,KAAK,SAAS;YAC5D,uBAAuB,EAAE,IAAI;SAC7B,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainer } from \"@fluidframework/container-definitions/internal\";\nimport type { IFluidLoadable } from \"@fluidframework/core-interfaces\";\n\nimport { BaseDevtools } from \"./BaseDevtools.js\";\nimport type { HasContainerKey } from \"./CommonInterfaces.js\";\nimport type { ContainerDevtoolsFeatureFlags } from \"./Features.js\";\nimport {\n\tCloseContainer,\n\tConnectContainer,\n\tDisconnectContainer,\n\ttype InboundHandlers,\n} from \"./messaging/index.js\";\n\n/**\n * Properties for registering a {@link @fluidframework/container-definitions#IContainer} with the Devtools.\n * @beta\n * @input\n * @sealed\n */\nexport interface ContainerDevtoolsProps extends HasContainerKey {\n\t/**\n\t * The Container to register with the Devtools.\n\t */\n\treadonly container: IContainer;\n\n\t/**\n\t * (optional) Distributed Data Structures (DDSs) associated with the\n\t * {@link ContainerDevtoolsProps.container | Container}.\n\t *\n\t * @remarks\n\t *\n\t * Providing this data will enable associated tooling to visualize the Fluid data reachable from the provided\n\t * objects.\n\t *\n\t * Fluid DevTools will not mutate this data.\n\t *\n\t * @privateRemarks TODO: rename this to make it more clear that this data does not *belong* to the Container.\n\t */\n\treadonly containerData?: Record<string, IFluidLoadable>;\n\n\t// TODO: Add ability for customers to specify custom visualizer overrides\n}\n\n/**\n * {@link IContainerDevtools} implementation for real containers.\n *\n * @remarks\n *\n * This class listens to incoming messages from the window (globalThis), and posts messages to it upon relevant\n * state changes and when requested.\n *\n * **Messages it listens for (if the {@link HasContainerKey.containerKey} matches):**\n *\n * - {@link GetContainerDevtoolsFeatures.Message}: When received, {@link ContainerDevtoolsFeatures.Message} will be\n * posted in response.\n *\n * - {@link GetContainerState.Message}: When received, {@link ContainerStateChange.Message} will be posted in response.\n *\n * - {@link ConnectContainer.Message}: When received, {@link @fluidframework/container-definitions#IContainer.connect}\n * will be called on the {@link ContainerDevtools.container} (if it is disconnected).\n *\n * - {@link DisconnectContainer.Message}: When received, {@link @fluidframework/container-definitions#IContainer.disconnect}\n * will be called on the {@link ContainerDevtools.container} (if it is connected).\n *\n * - {@link CloseContainer.Message}: When received, {@link @fluidframework/container-definitions#IContainer.close}\n * will be called on the {@link ContainerDevtools.container}.\n *\n * - {@link GetAudienceSummary.Message}: When received, {@link AudienceSummary.Message} will be posted in response.\n *\n * - {@link GetRootDataVisualizations.Message}: When received, {@link RootDataVisualizations.Message} will be posted\n * in response.\n *\n * - {@link GetDataVisualization.Message}: When received, {@link DataVisualization.Message} will be posted in response.\n *\n * **Messages it posts:**\n *\n * - {@link ContainerDevtoolsFeatures.Message}: Posted only when requested via {@link GetContainerDevtoolsFeatures.Message}.\n *\n * - {@link AudienceSummary.Message}: Posted any time the Container's Audience state changes, or when requested\n * (via {@link GetAudienceSummary.Message}).\n *\n * - {@link ContainerStateChange.Message}: Posted any time relevant Container state changes,\n * or when requested (via {@link GetContainerState.Message}).\n *\n * - {@link RootDataVisualizations.Message}: Posted when requested via {@link GetRootDataVisualizations.Message}.\n *\n * - {@link DataVisualization.Message}: Posted when requested via {@link GetDataVisualization.Message}, or when\n * a change has occurred on the associated DDS, reachable from the visualization graph.\n *\n * @sealed\n */\nexport class ContainerDevtools extends BaseDevtools<IContainer> {\n\t/**\n\t * The registered Container.\n\t */\n\tprotected override get container(): IContainer {\n\t\treturn this._container;\n\t}\n\n\tprivate readonly _container: IContainer;\n\n\tpublic constructor(props: ContainerDevtoolsProps) {\n\t\t// Create specific message handlers for container operations\n\t\tconst specificHandlers: InboundHandlers = {\n\t\t\t[ConnectContainer.MessageType]: async (untypedMessage) => {\n\t\t\t\tconst message = untypedMessage as ConnectContainer.Message;\n\t\t\t\tif (message.data.containerKey === props.containerKey) {\n\t\t\t\t\tprops.container.connect();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\t[DisconnectContainer.MessageType]: async (untypedMessage) => {\n\t\t\t\tconst message = untypedMessage as DisconnectContainer.Message;\n\t\t\t\tif (message.data.containerKey === props.containerKey) {\n\t\t\t\t\tprops.container.disconnect(\n\t\t\t\t\t\t/* TODO: Specify devtools reason here once it is supported */\n\t\t\t\t\t);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\t[CloseContainer.MessageType]: async (untypedMessage) => {\n\t\t\t\tconst message = untypedMessage as CloseContainer.Message;\n\t\t\t\tif (message.data.containerKey === props.containerKey) {\n\t\t\t\t\tprops.container.close(/* TODO: Specify devtools reason here once it is supported */);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t};\n\n\t\tsuper(props.containerKey, specificHandlers, props.containerData);\n\n\t\tthis._container = props.container;\n\n\t\t// Bind container and audience events after container is set\n\t\tthis.bindContainerEvents();\n\t\tthis.bindAudienceEvents();\n\t}\n\n\tprotected override getSupportedFeatures(): ContainerDevtoolsFeatureFlags {\n\t\treturn {\n\t\t\tcontainerDataVisualization: this.containerData !== undefined,\n\t\t\tcanModifyContainerState: true,\n\t\t};\n\t}\n}\n"]}
@@ -13,7 +13,8 @@ import type { DecomposedContainer } from "./DecomposedContainer.js";
13
13
  import type { ContainerDevtoolsFeatureFlags } from "./Features.js";
14
14
  /**
15
15
  * Properties for registering a container runtime with the Devtools.
16
- * @alpha
16
+ * @beta
17
+ * @sealed
17
18
  * @input
18
19
  */
19
20
  export interface ContainerRuntimeProps {
@@ -24,7 +25,7 @@ export interface ContainerRuntimeProps {
24
25
  /**
25
26
  * Optional label for the container runtime replacing the guid generated by {@link @fluidframework/container-runtime#IContainerRuntime.generateDocumentUniqueId}.
26
27
  */
27
- label?: string;
28
+ readonly label?: string;
28
29
  }
29
30
  /**
30
31
  * Properties for constructing a {@link ContainerRuntimeDevtools} instance.
@@ -1 +1 @@
1
- {"version":3,"file":"ContainerRuntimeDevtools.d.ts","sourceRoot":"","sources":["../src/ContainerRuntimeDevtools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,EAAE,YA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AAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;IAChD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type {\n\tAttachState,\n\tIAudience,\n\tIContainerEvents,\n} from \"@fluidframework/container-definitions/internal\";\nimport { ConnectionState } from \"@fluidframework/container-loader\";\nimport { ContainerRuntime } from \"@fluidframework/container-runtime/internal\";\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { BaseDevtools } from \"./BaseDevtools.js\";\nimport type { ContainerKey } from \"./CommonInterfaces.js\";\nimport type { DecomposedContainer } from \"./DecomposedContainer.js\";\nimport type { ContainerDevtoolsFeatureFlags } from \"./Features.js\";\nimport type { InboundHandlers } from \"./messaging/index.js\";\n\n/**\n * Properties for registering a container runtime with the Devtools.\n * @alpha\n * @input\n */\nexport interface ContainerRuntimeProps {\n\t/**\n\t * The container runtime to register with the Devtools.\n\t */\n\treadonly runtime: IContainerRuntime;\n\n\t/**\n\t * Optional label for the container runtime replacing the guid generated by {@link @fluidframework/container-runtime#IContainerRuntime.generateDocumentUniqueId}.\n\t */\n\tlabel?: string;\n}\n\n/**\n * Properties for constructing a {@link ContainerRuntimeDevtools} instance.\n */\nexport interface ContainerRuntimeDevtoolsConstructorProps {\n\t/**\n\t * The container key to use for this container runtime.\n\t */\n\tcontainerKey: ContainerKey;\n\n\t/**\n\t * The decomposed container wrapping the container runtime.\n\t */\n\tcontainer: DecomposedContainer;\n\n\t/**\n\t * (optional) Data associated with the container runtime.\n\t */\n\tcontainerData?: Record<string, IFluidLoadable>;\n}\n\n/**\n * {@link IContainerDevtools} implementation for container runtimes.\n *\n * @remarks\n *\n * This class provides devtools functionality for container runtimes that don't support\n * container-level operations like connect/disconnect/close. Container runtimes represent\n * the internal runtime state and don't emit \"closed\" events like IContainer does.\n *\n * @sealed\n */\nexport class ContainerRuntimeDevtools extends BaseDevtools<DecomposedContainer> {\n\t/**\n\t * The registered container runtime's decomposed container.\n\t */\n\tprotected override get container(): DecomposedContainer {\n\t\treturn this._container;\n\t}\n\n\tprivate readonly _container: DecomposedContainer;\n\n\tpublic constructor(props: ContainerRuntimeDevtoolsConstructorProps) {\n\t\t// Container runtimes don't support connection operations, so pass empty handlers\n\t\tconst specificHandlers: InboundHandlers = {};\n\n\t\tsuper(props.containerKey, specificHandlers, props.containerData);\n\n\t\tthis._container = props.container;\n\n\t\t// Bind container and audience events after container is set\n\t\tthis.bindContainerEvents();\n\t\tthis.bindAudienceEvents();\n\t}\n\n\tprotected override getSupportedFeatures(): ContainerDevtoolsFeatureFlags {\n\t\treturn {\n\t\t\tcontainerDataVisualization: this.containerData !== undefined,\n\t\t\t// Container runtimes do not have direct control over container lifecycle\n\t\t\tcanModifyContainerState: false,\n\t\t};\n\t}\n\n\t/**\n\t * {@inheritDoc IContainerDevtools.isClosed}\n\t */\n\tpublic isClosed(): boolean {\n\t\t// Container runtimes cannot be closed directly\n\t\treturn false;\n\t}\n}\n\n/**\n * Implementation of {@link DecomposedContainer} that wraps an {@link @fluidframework/container-runtime-definitions/internal#IContainerRuntime}.\n * @remarks\n * This class provides a bridge between {@link @fluidframework/container-runtime-definitions/internal#IContainerRuntime} and the devtools system by exposing runtime properties and events.\n */\nexport class DecomposedContainerForContainerRuntime\n\textends TypedEventEmitter<IContainerEvents>\n\timplements DecomposedContainer\n{\n\tprivate _disposed = false; // Track actual disposed state\n\n\tpublic constructor(runtime: IContainerRuntime) {\n\t\tsuper();\n\t\tthis.runtime = runtime;\n\t\t// Note: IContainerRuntime doesn't emit \"closed\" events like IContainer does\n\t\t// Only bind to events that IContainerRuntime actually supports\n\t\truntime.on(\"attached\", this.attachedHandler);\n\t\truntime.on(\"connected\", this.connectedHandler);\n\t\truntime.on(\"disconnected\", this.disconnectedHandler);\n\t\truntime.on(\"dispose\", this.disposedHandler);\n\t}\n\n\tprivate readonly attachedHandler = (): boolean => this.emit(\"attached\");\n\tprivate readonly connectedHandler = (clientId: string): boolean =>\n\t\tthis.emit(\"connected\", clientId);\n\tprivate readonly disconnectedHandler = (): boolean => this.emit(\"disconnected\");\n\tprivate readonly disposedHandler = (): boolean => {\n\t\t// IContainerRuntime emits \"dispose\" (no error) but we emit \"disposed\" to match IContainerEvents\n\t\t// Since IContainerRuntime doesn't provide error info, we emit without error parameter\n\t\tthis._disposed = true; // Mark as disposed when dispose event occurs\n\t\treturn this.emit(\"disposed\");\n\t};\n\n\tprivate readonly runtime: IContainerRuntime;\n\n\tpublic get audience(): IAudience {\n\t\treturn this.runtime.getAudience();\n\t}\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this.runtime.clientId;\n\t}\n\n\tpublic get attachState(): AttachState {\n\t\treturn this.runtime.attachState;\n\t}\n\n\tpublic get connectionState(): ConnectionState {\n\t\t// Normal connection state logic - readonly state is handled separately via readOnlyInfo\n\t\treturn this.runtime.connected ? ConnectionState.Connected : ConnectionState.Disconnected;\n\t}\n\n\tpublic get closed(): boolean {\n\t\treturn this._disposed; // IContainerRuntime doesn't have a \"closed\" state - only \"disconnected\" (reconnectable) and \"disposed\" (permanent)\n\t}\n\n\tpublic get readOnlyInfo(): { readonly readonly?: boolean } {\n\t\t// IContainerRuntime doesn't expose readonly in its interface, but the implementation has isReadOnly()\n\t\tassert(\n\t\t\tthis.runtime instanceof ContainerRuntime,\n\t\t\t0xc2e /* DecomposedContainerForContainerRuntime is not a ContainerRuntime */,\n\t\t);\n\t\treturn { readonly: this.runtime.isReadOnly() };\n\t}\n}\n"]}
1
+ {"version":3,"file":"ContainerRuntimeDevtools.js","sourceRoot":"","sources":["../src/ContainerRuntimeDevtools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAM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K,CAAC,sEAAsE,CAC5E,CAAC;QACF,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;IAChD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type {\n\tAttachState,\n\tIAudience,\n\tIContainerEvents,\n} from \"@fluidframework/container-definitions/internal\";\nimport { ConnectionState } from \"@fluidframework/container-loader\";\nimport { ContainerRuntime } from \"@fluidframework/container-runtime/internal\";\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { BaseDevtools } from \"./BaseDevtools.js\";\nimport type { ContainerKey } from \"./CommonInterfaces.js\";\nimport type { DecomposedContainer } from \"./DecomposedContainer.js\";\nimport type { ContainerDevtoolsFeatureFlags } from \"./Features.js\";\nimport type { InboundHandlers } from \"./messaging/index.js\";\n\n/**\n * Properties for registering a container runtime with the Devtools.\n * @beta\n * @sealed\n * @input\n */\nexport interface ContainerRuntimeProps {\n\t/**\n\t * The container runtime to register with the Devtools.\n\t */\n\treadonly runtime: IContainerRuntime;\n\n\t/**\n\t * Optional label for the container runtime replacing the guid generated by {@link @fluidframework/container-runtime#IContainerRuntime.generateDocumentUniqueId}.\n\t */\n\treadonly label?: string;\n}\n\n/**\n * Properties for constructing a {@link ContainerRuntimeDevtools} instance.\n */\nexport interface ContainerRuntimeDevtoolsConstructorProps {\n\t/**\n\t * The container key to use for this container runtime.\n\t */\n\tcontainerKey: ContainerKey;\n\n\t/**\n\t * The decomposed container wrapping the container runtime.\n\t */\n\tcontainer: DecomposedContainer;\n\n\t/**\n\t * (optional) Data associated with the container runtime.\n\t */\n\tcontainerData?: Record<string, IFluidLoadable>;\n}\n\n/**\n * {@link IContainerDevtools} implementation for container runtimes.\n *\n * @remarks\n *\n * This class provides devtools functionality for container runtimes that don't support\n * container-level operations like connect/disconnect/close. Container runtimes represent\n * the internal runtime state and don't emit \"closed\" events like IContainer does.\n *\n * @sealed\n */\nexport class ContainerRuntimeDevtools extends BaseDevtools<DecomposedContainer> {\n\t/**\n\t * The registered container runtime's decomposed container.\n\t */\n\tprotected override get container(): DecomposedContainer {\n\t\treturn this._container;\n\t}\n\n\tprivate readonly _container: DecomposedContainer;\n\n\tpublic constructor(props: ContainerRuntimeDevtoolsConstructorProps) {\n\t\t// Container runtimes don't support connection operations, so pass empty handlers\n\t\tconst specificHandlers: InboundHandlers = {};\n\n\t\tsuper(props.containerKey, specificHandlers, props.containerData);\n\n\t\tthis._container = props.container;\n\n\t\t// Bind container and audience events after container is set\n\t\tthis.bindContainerEvents();\n\t\tthis.bindAudienceEvents();\n\t}\n\n\tprotected override getSupportedFeatures(): ContainerDevtoolsFeatureFlags {\n\t\treturn {\n\t\t\tcontainerDataVisualization: this.containerData !== undefined,\n\t\t\t// Container runtimes do not have direct control over container lifecycle\n\t\t\tcanModifyContainerState: false,\n\t\t};\n\t}\n\n\t/**\n\t * {@inheritDoc IContainerDevtools.isClosed}\n\t */\n\tpublic isClosed(): boolean {\n\t\t// Container runtimes cannot be closed directly\n\t\treturn false;\n\t}\n}\n\n/**\n * Implementation of {@link DecomposedContainer} that wraps an {@link @fluidframework/container-runtime-definitions/internal#IContainerRuntime}.\n * @remarks\n * This class provides a bridge between {@link @fluidframework/container-runtime-definitions/internal#IContainerRuntime} and the devtools system by exposing runtime properties and events.\n */\nexport class DecomposedContainerForContainerRuntime\n\textends TypedEventEmitter<IContainerEvents>\n\timplements DecomposedContainer\n{\n\tprivate _disposed = false; // Track actual disposed state\n\n\tpublic constructor(runtime: IContainerRuntime) {\n\t\tsuper();\n\t\tthis.runtime = runtime;\n\t\t// Note: IContainerRuntime doesn't emit \"closed\" events like IContainer does\n\t\t// Only bind to events that IContainerRuntime actually supports\n\t\truntime.on(\"attached\", this.attachedHandler);\n\t\truntime.on(\"connected\", this.connectedHandler);\n\t\truntime.on(\"disconnected\", this.disconnectedHandler);\n\t\truntime.on(\"dispose\", this.disposedHandler);\n\t}\n\n\tprivate readonly attachedHandler = (): boolean => this.emit(\"attached\");\n\tprivate readonly connectedHandler = (clientId: string): boolean =>\n\t\tthis.emit(\"connected\", clientId);\n\tprivate readonly disconnectedHandler = (): boolean => this.emit(\"disconnected\");\n\tprivate readonly disposedHandler = (): boolean => {\n\t\t// IContainerRuntime emits \"dispose\" (no error) but we emit \"disposed\" to match IContainerEvents\n\t\t// Since IContainerRuntime doesn't provide error info, we emit without error parameter\n\t\tthis._disposed = true; // Mark as disposed when dispose event occurs\n\t\treturn this.emit(\"disposed\");\n\t};\n\n\tprivate readonly runtime: IContainerRuntime;\n\n\tpublic get audience(): IAudience {\n\t\treturn this.runtime.getAudience();\n\t}\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this.runtime.clientId;\n\t}\n\n\tpublic get attachState(): AttachState {\n\t\treturn this.runtime.attachState;\n\t}\n\n\tpublic get connectionState(): ConnectionState {\n\t\t// Normal connection state logic - readonly state is handled separately via readOnlyInfo\n\t\treturn this.runtime.connected ? ConnectionState.Connected : ConnectionState.Disconnected;\n\t}\n\n\tpublic get closed(): boolean {\n\t\treturn this._disposed; // IContainerRuntime doesn't have a \"closed\" state - only \"disconnected\" (reconnectable) and \"disposed\" (permanent)\n\t}\n\n\tpublic get readOnlyInfo(): { readonly readonly?: boolean } {\n\t\t// IContainerRuntime doesn't expose readonly in its interface, but the implementation has isReadOnly()\n\t\tassert(\n\t\t\tthis.runtime instanceof ContainerRuntime,\n\t\t\t0xc2e /* DecomposedContainerForContainerRuntime is not a ContainerRuntime */,\n\t\t);\n\t\treturn { readonly: this.runtime.isReadOnly() };\n\t}\n}\n"]}
@@ -33,7 +33,9 @@ export declare const accessBeforeInitializeErrorText = "Devtools have not yet be
33
33
  export declare function getContainerAlreadyRegisteredErrorText(containerKey: ContainerKey): string;
34
34
  /**
35
35
  * Properties for configuring the Devtools.
36
- * @alpha
36
+ * @beta
37
+ * @input
38
+ * @sealed
37
39
  */
38
40
  export interface FluidDevtoolsProps {
39
41
  /**
@@ -46,13 +48,13 @@ export interface FluidDevtoolsProps {
46
48
  * This is provided to the Devtools instance strictly to enable communicating supported / desired functionality with
47
49
  * external listeners.
48
50
  */
49
- logger?: IDevtoolsLogger;
51
+ readonly logger?: IDevtoolsLogger;
50
52
  /**
51
53
  * (optional) List of Containers to initialize the devtools with.
52
54
  *
53
55
  * @remarks Additional Containers can be registered with the Devtools via {@link IFluidDevtools.registerContainerDevtools}.
54
56
  */
55
- initialContainers?: ContainerDevtoolsProps[];
57
+ readonly initialContainers?: ContainerDevtoolsProps[];
56
58
  }
57
59
  /**
58
60
  * {@link IFluidDevtools} implementation.
@@ -205,12 +207,12 @@ export declare class FluidDevtools implements IFluidDevtools {
205
207
  *
206
208
  * It is automatically disposed on webpage unload, but it can be closed earlier by calling `dispose`
207
209
  * on the returned handle.
208
- * @alpha
210
+ * @beta
209
211
  */
210
212
  export declare function initializeDevtools(props?: FluidDevtoolsProps): IFluidDevtools;
211
213
  /**
212
214
  * Gets the Devtools singleton if it has been {@link initializeDevtools | initialized}, otherwise returns `undefined`.
213
- * @alpha
215
+ * @beta
214
216
  */
215
217
  export declare function tryGetFluidDevtools(): IFluidDevtools | undefined;
216
218
  //# sourceMappingURL=FluidDevtools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FluidDevtools.d.ts","sourceRoot":"","sources":["../src/FluidDevtools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB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IACH,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAA6B;IAE7E;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;CAO3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,kBAAkB,GAAG,cAAc,CAE7E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,cAAc,GAAG,SAAS,CAEhE"}
@@ -352,14 +352,14 @@ export class FluidDevtools {
352
352
  *
353
353
  * It is automatically disposed on webpage unload, but it can be closed earlier by calling `dispose`
354
354
  * on the returned handle.
355
- * @alpha
355
+ * @beta
356
356
  */
357
357
  export function initializeDevtools(props) {
358
358
  return FluidDevtools.initialize(props);
359
359
  }
360
360
  /**
361
361
  * Gets the Devtools singleton if it has been {@link initializeDevtools | initialized}, otherwise returns `undefined`.
362
- * @alpha
362
+ * @beta
363
363
  */
364
364
  export function tryGetFluidDevtools() {
365
365
  return FluidDevtools.tryGet();
@@ -1 +1 @@
1
- {"version":3,"file":"FluidDevtools.js","sourceRoot":"","sources":["../src/FluidDevtools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAItE,OAAO,EAAE,iBAAiB,EAA+B,MAAM,wBAAwB,CAAC;AACxF,OAAO,EACN,wBAAwB,EAExB,sCAAsC,GACtC,MAAM,+BAA+B,CAAC;AAMvC,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EAIrB,2BAA2B,EAC3B,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEpE;;GAEG;AACH,MAAM,6BAA6B,GAA0B;IAC5D,OAAO,EAAE,gBAAgB;CACzB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GACpC,0EAA0E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ACR,CAAC;QAED,iBAAiB,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAErC,yCAAyC;QACzC,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC1B,CAAC;IAOD;;;;;OAKG;IACK,mBAAmB,CAAC,OAAe;QAC1C,wCAAwC;QACxC,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,+BAA+B,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAChF,IAAI,CAAC,+BAA+B,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAE9D,OAAO,GAAG,OAAO,IAAI,UAAU,EAAE,CAAC;IACnC,CAAC;CACD;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAA0B;IAC5D,OAAO,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IAClC,OAAO,aAAa,CAAC,MAAM,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { BaseDevtools } from \"./BaseDevtools.js\";\nimport type { ContainerKey } from \"./CommonInterfaces.js\";\nimport { ContainerDevtools, type ContainerDevtoolsProps } from \"./ContainerDevtools.js\";\nimport {\n\tContainerRuntimeDevtools,\n\ttype ContainerRuntimeProps,\n\tDecomposedContainerForContainerRuntime,\n} from \"./ContainerRuntimeDevtools.js\";\nimport type { DecomposedContainer } from \"./DecomposedContainer.js\";\nimport type { IDevtoolsLogger } from \"./DevtoolsLogger.js\";\nimport type { DevtoolsFeatureFlags } from \"./Features.js\";\nimport type { IContainerDevtools } from \"./IContainerDevtools.js\";\nimport type { IFluidDevtools } from \"./IFluidDevtools.js\";\nimport {\n\tContainerList,\n\tDevtoolsDisposed,\n\tDevtoolsFeatures,\n\tGetContainerList,\n\tGetDevtoolsFeatures,\n\tSetUnsampledTelemetry,\n\ttype ISourcedDevtoolsMessage,\n\ttype InboundHandlers,\n\ttype MessageLoggingOptions,\n\thandleIncomingWindowMessage,\n\tpostMessagesToWindow,\n} from \"./messaging/index.js\";\nimport { pkgVersion as devtoolsVersion } from \"./packageVersion.js\";\n\n/**\n * Message logging options used by the root devtools.\n */\nconst devtoolsMessageLoggingOptions: MessageLoggingOptions = {\n\tcontext: \"Fluid Devtools\",\n};\n\n/**\n * Error text thrown when {@link FluidDevtools} operations are used after it has been disposed.\n *\n * @privateRemarks Exported for test purposes only.\n */\nexport const useAfterDisposeErrorText =\n\t\"The devtools instance has been disposed. Further operations are invalid.\";\n\n/**\n * Error text thrown when {@link FluidDevtools.getOrThrow} is called before the Devtools have been initialized.\n *\n * @privateRemarks Exported for test purposes only.\n */\nexport const accessBeforeInitializeErrorText = \"Devtools have not yet been initialized.\";\n\n/**\n * Key for sessionStorage that's used to toggle unsampled telemetry.\n */\nconst unsampledTelemetryKey = \"Fluid.Telemetry.DisableSampling\";\n\n/**\n * Error text thrown when a user attempts to register a {@link IContainerDevtools} instance for an ID that is already\n * registered with the {@link IFluidDevtools}.\n *\n * @privateRemarks Exported for test purposes only.\n */\nexport function getContainerAlreadyRegisteredErrorText(containerKey: ContainerKey): string {\n\treturn (\n\t\t`A ContainerDevtools instance has already been registered for specified key: \"${containerKey}\".` +\n\t\t\"Existing instance must be closed before a replacement may be registered.\"\n\t);\n}\n\n/**\n * Properties for configuring the Devtools.\n * @alpha\n */\nexport interface FluidDevtoolsProps {\n\t/**\n\t * (optional) telemetry logger associated with the Fluid runtime.\n\t *\n\t * @remarks\n\t *\n\t * Note: {@link IFluidDevtools} does not register this logger with the Fluid runtime; that must be done separately.\n\t *\n\t * This is provided to the Devtools instance strictly to enable communicating supported / desired functionality with\n\t * external listeners.\n\t */\n\tlogger?: IDevtoolsLogger;\n\n\t/**\n\t * (optional) List of Containers to initialize the devtools with.\n\t *\n\t * @remarks Additional Containers can be registered with the Devtools via {@link IFluidDevtools.registerContainerDevtools}.\n\t */\n\tinitialContainers?: ContainerDevtoolsProps[];\n\n\t// TODO: Add ability for customers to specify custom data visualizer overrides\n}\n\n/**\n * {@link IFluidDevtools} implementation.\n *\n * @remarks\n *\n * This class listens for incoming messages from the window (globalThis), and posts messages to it upon relevant\n * state changes and when requested.\n *\n * **Messages it listens for:**\n *\n * - {@link GetDevtoolsFeatures.Message}: When received, {@link DevtoolsFeatures.Message} will be posted in response.\n *\n * - {@link GetContainerList.Message}: When received, {@link ContainerList.Message} will be posted in response.\n *\n * -{@link SetUnsampledTelemetry.Message}: When received, the unsampled telemetry flag will be toggled.\n *\n * TODO: Document others as they are added.\n *\n * **Messages it posts:**\n *\n * - {@link DevtoolsFeatures.Message}: Posted only when requested via {@link GetDevtoolsFeatures.Message}.\n *\n * - {@link ContainerList.Message}: Posted whenever the list of registered Containers changes, or when requested\n * (via {@link GetContainerList.Message}).\n *\n * TODO: Document others as they are added.\n *\n * @sealed\n */\nexport class FluidDevtools implements IFluidDevtools {\n\t/**\n\t * (optional) Telemetry logger associated with the Fluid runtime.\n\t */\n\tpublic readonly logger: IDevtoolsLogger | undefined;\n\n\t/**\n\t * Stores Container-level devtools instances registered with this object.\n\t * Maps from a {@link ContainerKey} to the corresponding {@link ContainerDevtools} instance.\n\t */\n\tprivate readonly containers: Map<ContainerKey, BaseDevtools<DecomposedContainer>>;\n\n\t/**\n\t * Private {@link FluidDevtools.disposed} tracking.\n\t */\n\tprivate _disposed: boolean;\n\n\t// #region Event handlers\n\n\t/**\n\t * Handlers for inbound messages specific to FluidDevTools.\n\t */\n\tprivate readonly inboundMessageHandlers: InboundHandlers = {\n\t\t[GetDevtoolsFeatures.MessageType]: async () => {\n\t\t\tthis.postSupportedFeatures();\n\t\t\treturn true;\n\t\t},\n\t\t[GetContainerList.MessageType]: async () => {\n\t\t\tthis.postContainerList();\n\t\t\treturn true;\n\t\t},\n\t\t[SetUnsampledTelemetry.MessageType]: async (message) => {\n\t\t\tconst newValue = (message as SetUnsampledTelemetry.Message).data.unsampledTelemetry;\n\t\t\tglobalThis.sessionStorage?.setItem(unsampledTelemetryKey, String(newValue));\n\t\t\tthis.postSupportedFeatures();\n\t\t\twindow.location.reload();\n\t\t\treturn true;\n\t\t},\n\t};\n\n\t/**\n\t * Event handler for messages coming from the window (globalThis).\n\t */\n\tprivate readonly windowMessageHandler = (\n\t\tevent: MessageEvent<Partial<ISourcedDevtoolsMessage>>,\n\t): void => {\n\t\thandleIncomingWindowMessage(\n\t\t\tevent,\n\t\t\tthis.inboundMessageHandlers,\n\t\t\tdevtoolsMessageLoggingOptions,\n\t\t);\n\t};\n\n\t/**\n\t * Event handler for the window (globalThis) `beforeUnload` event.\n\t * Disposes of the Devtools instance (which also clears the global singleton).\n\t */\n\tprivate readonly windowBeforeUnloadHandler = (): void => {\n\t\tthis.dispose();\n\t};\n\n\t/**\n\t * Posts {@link DevtoolsFeatures.Message} to the window (globalThis) with the set of features supported by\n\t * this instance.\n\t */\n\tprivate readonly postSupportedFeatures = (): void => {\n\t\tconst supportedFeatures = this.getSupportedFeatures();\n\t\tconst unsampledTelemetry =\n\t\t\tglobalThis.sessionStorage?.getItem(unsampledTelemetryKey) === \"true\";\n\t\tpostMessagesToWindow(\n\t\t\tdevtoolsMessageLoggingOptions,\n\t\t\tDevtoolsFeatures.createMessage({\n\t\t\t\tfeatures: supportedFeatures,\n\t\t\t\tdevtoolsVersion,\n\t\t\t\tunsampledTelemetry,\n\t\t\t}),\n\t\t);\n\t};\n\n\t/**\n\t * Posts a {@link ContainerList.Message} to the window (globalThis).\n\t */\n\tprivate readonly postContainerList = (): void => {\n\t\tconst containers: ContainerKey[] = this.getAllContainers().map(\n\t\t\t(container) => container.containerKey,\n\t\t);\n\n\t\tpostMessagesToWindow(\n\t\t\tdevtoolsMessageLoggingOptions,\n\t\t\tContainerList.createMessage({\n\t\t\t\tcontainers,\n\t\t\t}),\n\t\t);\n\t};\n\n\t// #endregion\n\n\t/**\n\t * Singleton instance.\n\t */\n\tprivate static I: FluidDevtools | undefined;\n\n\tprivate constructor(props?: FluidDevtoolsProps) {\n\t\t// Populate initial Container-level devtools\n\t\tthis.containers = new Map<ContainerKey, BaseDevtools<DecomposedContainer>>();\n\t\tif (props?.initialContainers !== undefined) {\n\t\t\tfor (const containerConfig of props.initialContainers) {\n\t\t\t\tthis.containers.set(\n\t\t\t\t\tcontainerConfig.containerKey,\n\t\t\t\t\tnew ContainerDevtools(containerConfig),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis.logger = props?.logger;\n\n\t\t// Register listener for inbound messages from the Window (globalThis)\n\t\tglobalThis.addEventListener?.(\"message\", this.windowMessageHandler);\n\n\t\t// Register the devtools instance to be disposed on Window unload\n\t\tglobalThis.addEventListener?.(\"beforeunload\", this.windowBeforeUnloadHandler);\n\n\t\t// Post message for supported features\n\t\tthis.postSupportedFeatures();\n\n\t\tthis._disposed = false;\n\t}\n\n\t/**\n\t * Creates and returns the FluidDevtools singleton.\n\t *\n\t * @remarks\n\t *\n\t * If the singleton has already been initialized, a warning will be logged and the existing instance will\n\t * be returned.\n\t */\n\tpublic static initialize(props?: FluidDevtoolsProps): FluidDevtools {\n\t\tif (FluidDevtools.I === undefined) {\n\t\t\tFluidDevtools.I = new FluidDevtools(props);\n\t\t} else {\n\t\t\tconsole.warn(\n\t\t\t\t\"Devtools have already been initialized. \" +\n\t\t\t\t\t\"Existing Devtools instance must be disposed before new ones may be initialized. \" +\n\t\t\t\t\t\"Returning existing Devtools instance.\",\n\t\t\t);\n\t\t}\n\n\t\treturn FluidDevtools.I;\n\t}\n\n\t/**\n\t * Gets the Devtools singleton if it has been initialized, otherwise throws.\n\t */\n\tpublic static getOrThrow(): FluidDevtools {\n\t\tif (FluidDevtools.I === undefined) {\n\t\t\tthrow new UsageError(accessBeforeInitializeErrorText);\n\t\t}\n\t\treturn FluidDevtools.I;\n\t}\n\n\t/**\n\t * Gets the Devtools singleton if it has been initialized, otherwise returns `undefined`.\n\t */\n\tpublic static tryGet(): FluidDevtools | undefined {\n\t\treturn FluidDevtools.I;\n\t}\n\n\t/**\n\t * {@inheritDoc IFluidDevtools.registerContainerDevtools}\n\t */\n\tpublic registerContainerDevtools(props: ContainerDevtoolsProps): void {\n\t\tif (this.disposed) {\n\t\t\tthrow new UsageError(useAfterDisposeErrorText);\n\t\t}\n\n\t\tconst { containerKey } = props;\n\n\t\tif (this.containers.has(containerKey)) {\n\t\t\tthrow new UsageError(getContainerAlreadyRegisteredErrorText(containerKey));\n\t\t}\n\n\t\tconst containerDevtools = new ContainerDevtools(props);\n\t\tthis.containers.set(containerKey, containerDevtools);\n\n\t\t// Post message for container list change\n\t\tthis.postContainerList();\n\t}\n\n\tpublic async registerContainerRuntime(props: ContainerRuntimeProps): Promise<void> {\n\t\tconst { runtime, label } = props;\n\n\t\tconst containerRuntimeKey = this.generateReadableKey(label ?? \"Container-Runtime\");\n\t\tconst extractedContainerRuntimeData =\n\t\t\tawait FluidDevtools.extractContainerDataFromRuntime(runtime);\n\n\t\tconst decomposedContainer = new DecomposedContainerForContainerRuntime(runtime);\n\n\t\t// Check if the container runtime is already registered.\n\t\tif (this.containers.has(containerRuntimeKey)) {\n\t\t\tthrow new UsageError(getContainerAlreadyRegisteredErrorText(containerRuntimeKey));\n\t\t}\n\n\t\tconst containerRuntimeDevtools = new ContainerRuntimeDevtools({\n\t\t\tcontainerKey: containerRuntimeKey,\n\t\t\tcontainer: decomposedContainer,\n\t\t\tcontainerData: extractedContainerRuntimeData,\n\t\t});\n\t\tthis.containers.set(containerRuntimeKey, containerRuntimeDevtools);\n\n\t\tthis.postContainerList();\n\t}\n\n\t/**\n\t * Helper method to extract container data from IContainerRuntime for visualization.\n\t * This method attempts to access the entry point data store from the runtime.\n\t *\n\t * @param containerRuntime - The container runtime to extract data from\n\t * @returns A record of data store names to IFluidLoadable objects, or undefined if no data can be extracted\n\t */\n\tpublic static async extractContainerDataFromRuntime(\n\t\tcontainerRuntime: IContainerRuntime,\n\t): Promise<Record<string, IFluidLoadable> | undefined> {\n\t\ttry {\n\t\t\t// Get the entry point from the container runtime\n\t\t\t// Cast to access getEntryPoint method which exists on the concrete implementation\n\t\t\tconst runtimeWithEntryPoint = containerRuntime as IContainerRuntime & {\n\t\t\t\tgetEntryPoint(): Promise<IFluidLoadable>;\n\t\t\t};\n\n\t\t\tif (\n\t\t\t\ttypeof runtimeWithEntryPoint.scope === \"object\" &&\n\t\t\t\ttypeof runtimeWithEntryPoint.getEntryPoint === \"function\"\n\t\t\t) {\n\t\t\t\tconst entryPoint = await runtimeWithEntryPoint.getEntryPoint();\n\t\t\t\tif (entryPoint !== undefined) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tentryPoint,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.warn(\"Could not extract container data from runtime:\", error);\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * {@inheritDoc IFluidDevtools.closeContainerDevtools}\n\t */\n\tpublic closeContainerDevtools(containerKey: ContainerKey): void {\n\t\tif (this.disposed) {\n\t\t\tthrow new UsageError(useAfterDisposeErrorText);\n\t\t}\n\n\t\tif (this.containers.has(containerKey)) {\n\t\t\tthis.removeContainer(containerKey);\n\t\t} else {\n\t\t\tconsole.warn(\n\t\t\t\t`No ContainerDevtools or ContainerRuntimeDevtools associated with key \"${containerKey}\" was found.`,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Gets the registered Container Devtools or Container Runtime Devtools associated with the provided {@link ContainerKey}, if one exists.\n\t * Otherwise returns `undefined`.\n\t */\n\tpublic getContainerDevtools(containerKey: ContainerKey): IContainerDevtools | undefined {\n\t\tif (this.disposed) {\n\t\t\tthrow new UsageError(useAfterDisposeErrorText);\n\t\t}\n\n\t\treturn this.containers.get(containerKey);\n\t}\n\n\t/**\n\t * Gets all container devtools instances (not data objects).\n\t */\n\tpublic getAllContainers(): readonly BaseDevtools<DecomposedContainer>[] {\n\t\tif (this.disposed) {\n\t\t\tthrow new UsageError(useAfterDisposeErrorText);\n\t\t}\n\n\t\treturn [...this.containers.values()];\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IDisposable.disposed}\n\t */\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IDisposable.dispose}\n\t */\n\tpublic dispose(): void {\n\t\tif (this.disposed) {\n\t\t\tthrow new UsageError(useAfterDisposeErrorText);\n\t\t}\n\n\t\t// Send close devtool message\n\t\tpostMessagesToWindow(devtoolsMessageLoggingOptions, DevtoolsDisposed.createMessage());\n\n\t\t// Dispose of container-level devtools\n\t\tfor (const [, containerDevtools] of this.containers) {\n\t\t\tcontainerDevtools.dispose();\n\t\t}\n\t\tthis.containers.clear();\n\n\t\t// Notify listeners that the list of Containers changed.\n\t\tthis.postContainerList();\n\n\t\t// Clear the singleton so a new one may be initialized.\n\t\tFluidDevtools.I = undefined;\n\n\t\t// Clean up event listeners\n\t\tglobalThis.removeEventListener?.(\"message\", this.windowMessageHandler);\n\t\tglobalThis.removeEventListener?.(\"beforeunload\", this.windowBeforeUnloadHandler);\n\n\t\tthis._disposed = true;\n\t}\n\n\t/**\n\t * Gets the set of features supported by this instance.\n\t */\n\tprivate getSupportedFeatures(): DevtoolsFeatureFlags {\n\t\treturn {\n\t\t\ttelemetry: this.logger !== undefined,\n\t\t\t// Most work completed, but not ready to completely enable.\n\t\t\topLatencyTelemetry: true,\n\t\t};\n\t}\n\n\t/**\n\t * Removes a container devtools instance from the devtools instance.\n\t * @param containerKey - The key of the container to remove.\n\t */\n\tprivate removeContainer(containerKey: ContainerKey): void {\n\t\tif (this.disposed) {\n\t\t\tthrow new UsageError(useAfterDisposeErrorText);\n\t\t}\n\n\t\tconst containerDevtools = this.containers.get(containerKey);\n\t\tif (containerDevtools === undefined) {\n\t\t\tconsole.warn(`No ContainerDevtools associated with key \"${containerKey}\" was found.`);\n\t\t\treturn;\n\t\t}\n\n\t\tcontainerDevtools.dispose();\n\t\tthis.containers.delete(containerKey);\n\n\t\t// Post message for container list change\n\t\tthis.postContainerList();\n\t}\n\n\t/**\n\t * Tracks the number of {@link ContainerRuntimeDevtools} instances created for each base key.\n\t */\n\tprivate readonly containerRuntimesInstanceCounts = new Map<string, number>();\n\n\t/**\n\t * Generates a readable key for a container runtime using package path and sequential numbering.\n\t *\n\t * @privateRemarks\n\t * TODO: Once we enable automatic extraction of ContainerData for IContainer instance, extend the usage of assigning readable key.\n\t */\n\tprivate generateReadableKey(baseKey: string): string {\n\t\t// Get the next number for this base key\n\t\tconst nextNumber = (this.containerRuntimesInstanceCounts.get(baseKey) ?? 0) + 1;\n\t\tthis.containerRuntimesInstanceCounts.set(baseKey, nextNumber);\n\n\t\treturn `${baseKey}-${nextNumber}`;\n\t}\n}\n\n/**\n * Initializes the Devtools singleton and returns a handle to it.\n *\n * @remarks\n *\n * The instance is tracked as a static singleton.\n *\n * It is automatically disposed on webpage unload, but it can be closed earlier by calling `dispose`\n * on the returned handle.\n * @alpha\n */\nexport function initializeDevtools(props?: FluidDevtoolsProps): IFluidDevtools {\n\treturn FluidDevtools.initialize(props);\n}\n\n/**\n * Gets the Devtools singleton if it has been {@link initializeDevtools | initialized}, otherwise returns `undefined`.\n * @alpha\n */\nexport function tryGetFluidDevtools(): IFluidDevtools | undefined {\n\treturn FluidDevtools.tryGet();\n}\n"]}
1
+ {"version":3,"file":"FluidDevtools.js","sourceRoot":"","sources":["../src/FluidDevtools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAItE,OAAO,EA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ed under the MIT License.\n */\n\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { BaseDevtools } from \"./BaseDevtools.js\";\nimport type { ContainerKey } from \"./CommonInterfaces.js\";\nimport { ContainerDevtools, type ContainerDevtoolsProps } from \"./ContainerDevtools.js\";\nimport {\n\tContainerRuntimeDevtools,\n\ttype ContainerRuntimeProps,\n\tDecomposedContainerForContainerRuntime,\n} from \"./ContainerRuntimeDevtools.js\";\nimport type { DecomposedContainer } from \"./DecomposedContainer.js\";\nimport type { IDevtoolsLogger } from \"./DevtoolsLogger.js\";\nimport type { DevtoolsFeatureFlags } from \"./Features.js\";\nimport type { IContainerDevtools } from \"./IContainerDevtools.js\";\nimport type { IFluidDevtools } from \"./IFluidDevtools.js\";\nimport {\n\tContainerList,\n\tDevtoolsDisposed,\n\tDevtoolsFeatures,\n\tGetContainerList,\n\tGetDevtoolsFeatures,\n\tSetUnsampledTelemetry,\n\ttype ISourcedDevtoolsMessage,\n\ttype InboundHandlers,\n\ttype MessageLoggingOptions,\n\thandleIncomingWindowMessage,\n\tpostMessagesToWindow,\n} from \"./messaging/index.js\";\nimport { pkgVersion as devtoolsVersion } from \"./packageVersion.js\";\n\n/**\n * Message logging options used by the root devtools.\n */\nconst devtoolsMessageLoggingOptions: MessageLoggingOptions = {\n\tcontext: \"Fluid Devtools\",\n};\n\n/**\n * Error text thrown when {@link FluidDevtools} operations are used after it has been disposed.\n *\n * @privateRemarks Exported for test purposes only.\n */\nexport const useAfterDisposeErrorText =\n\t\"The devtools instance has been disposed. Further operations are invalid.\";\n\n/**\n * Error text thrown when {@link FluidDevtools.getOrThrow} is called before the Devtools have been initialized.\n *\n * @privateRemarks Exported for test purposes only.\n */\nexport const accessBeforeInitializeErrorText = \"Devtools have not yet been initialized.\";\n\n/**\n * Key for sessionStorage that's used to toggle unsampled telemetry.\n */\nconst unsampledTelemetryKey = \"Fluid.Telemetry.DisableSampling\";\n\n/**\n * Error text thrown when a user attempts to register a {@link IContainerDevtools} instance for an ID that is already\n * registered with the {@link IFluidDevtools}.\n *\n * @privateRemarks Exported for test purposes only.\n */\nexport function getContainerAlreadyRegisteredErrorText(containerKey: ContainerKey): string {\n\treturn (\n\t\t`A ContainerDevtools instance has already been registered for specified key: \"${containerKey}\".` +\n\t\t\"Existing instance must be closed before a replacement may be registered.\"\n\t);\n}\n\n/**\n * Properties for configuring the Devtools.\n * @beta\n * @input\n * @sealed\n */\nexport interface FluidDevtoolsProps {\n\t/**\n\t * (optional) telemetry logger associated with the Fluid runtime.\n\t *\n\t * @remarks\n\t *\n\t * Note: {@link IFluidDevtools} does not register this logger with the Fluid runtime; that must be done separately.\n\t *\n\t * This is provided to the Devtools instance strictly to enable communicating supported / desired functionality with\n\t * external listeners.\n\t */\n\treadonly logger?: IDevtoolsLogger;\n\n\t/**\n\t * (optional) List of Containers to initialize the devtools with.\n\t *\n\t * @remarks Additional Containers can be registered with the Devtools via {@link IFluidDevtools.registerContainerDevtools}.\n\t */\n\treadonly initialContainers?: ContainerDevtoolsProps[];\n\n\t// TODO: Add ability for customers to specify custom data visualizer overrides\n}\n\n/**\n * {@link IFluidDevtools} implementation.\n *\n * @remarks\n *\n * This class listens for incoming messages from the window (globalThis), and posts messages to it upon relevant\n * state changes and when requested.\n *\n * **Messages it listens for:**\n *\n * - {@link GetDevtoolsFeatures.Message}: When received, {@link DevtoolsFeatures.Message} will be posted in response.\n *\n * - {@link GetContainerList.Message}: When received, {@link ContainerList.Message} will be posted in response.\n *\n * -{@link SetUnsampledTelemetry.Message}: When received, the unsampled telemetry flag will be toggled.\n *\n * TODO: Document others as they are added.\n *\n * **Messages it posts:**\n *\n * - {@link DevtoolsFeatures.Message}: Posted only when requested via {@link GetDevtoolsFeatures.Message}.\n *\n * - {@link ContainerList.Message}: Posted whenever the list of registered Containers changes, or when requested\n * (via {@link GetContainerList.Message}).\n *\n * TODO: Document others as they are added.\n *\n * @sealed\n */\nexport class FluidDevtools implements IFluidDevtools {\n\t/**\n\t * (optional) Telemetry logger associated with the Fluid runtime.\n\t */\n\tpublic readonly logger: IDevtoolsLogger | undefined;\n\n\t/**\n\t * Stores Container-level devtools instances registered with this object.\n\t * Maps from a {@link ContainerKey} to the corresponding {@link ContainerDevtools} instance.\n\t */\n\tprivate readonly containers: Map<ContainerKey, BaseDevtools<DecomposedContainer>>;\n\n\t/**\n\t * Private {@link FluidDevtools.disposed} tracking.\n\t */\n\tprivate _disposed: boolean;\n\n\t// #region Event handlers\n\n\t/**\n\t * Handlers for inbound messages specific to FluidDevTools.\n\t */\n\tprivate readonly inboundMessageHandlers: InboundHandlers = {\n\t\t[GetDevtoolsFeatures.MessageType]: async () => {\n\t\t\tthis.postSupportedFeatures();\n\t\t\treturn true;\n\t\t},\n\t\t[GetContainerList.MessageType]: async () => {\n\t\t\tthis.postContainerList();\n\t\t\treturn true;\n\t\t},\n\t\t[SetUnsampledTelemetry.MessageType]: async (message) => {\n\t\t\tconst newValue = (message as SetUnsampledTelemetry.Message).data.unsampledTelemetry;\n\t\t\tglobalThis.sessionStorage?.setItem(unsampledTelemetryKey, String(newValue));\n\t\t\tthis.postSupportedFeatures();\n\t\t\twindow.location.reload();\n\t\t\treturn true;\n\t\t},\n\t};\n\n\t/**\n\t * Event handler for messages coming from the window (globalThis).\n\t */\n\tprivate readonly windowMessageHandler = (\n\t\tevent: MessageEvent<Partial<ISourcedDevtoolsMessage>>,\n\t): void => {\n\t\thandleIncomingWindowMessage(\n\t\t\tevent,\n\t\t\tthis.inboundMessageHandlers,\n\t\t\tdevtoolsMessageLoggingOptions,\n\t\t);\n\t};\n\n\t/**\n\t * Event handler for the window (globalThis) `beforeUnload` event.\n\t * Disposes of the Devtools instance (which also clears the global singleton).\n\t */\n\tprivate readonly windowBeforeUnloadHandler = (): void => {\n\t\tthis.dispose();\n\t};\n\n\t/**\n\t * Posts {@link DevtoolsFeatures.Message} to the window (globalThis) with the set of features supported by\n\t * this instance.\n\t */\n\tprivate readonly postSupportedFeatures = (): void => {\n\t\tconst supportedFeatures = this.getSupportedFeatures();\n\t\tconst unsampledTelemetry =\n\t\t\tglobalThis.sessionStorage?.getItem(unsampledTelemetryKey) === \"true\";\n\t\tpostMessagesToWindow(\n\t\t\tdevtoolsMessageLoggingOptions,\n\t\t\tDevtoolsFeatures.createMessage({\n\t\t\t\tfeatures: supportedFeatures,\n\t\t\t\tdevtoolsVersion,\n\t\t\t\tunsampledTelemetry,\n\t\t\t}),\n\t\t);\n\t};\n\n\t/**\n\t * Posts a {@link ContainerList.Message} to the window (globalThis).\n\t */\n\tprivate readonly postContainerList = (): void => {\n\t\tconst containers: ContainerKey[] = this.getAllContainers().map(\n\t\t\t(container) => container.containerKey,\n\t\t);\n\n\t\tpostMessagesToWindow(\n\t\t\tdevtoolsMessageLoggingOptions,\n\t\t\tContainerList.createMessage({\n\t\t\t\tcontainers,\n\t\t\t}),\n\t\t);\n\t};\n\n\t// #endregion\n\n\t/**\n\t * Singleton instance.\n\t */\n\tprivate static I: FluidDevtools | undefined;\n\n\tprivate constructor(props?: FluidDevtoolsProps) {\n\t\t// Populate initial Container-level devtools\n\t\tthis.containers = new Map<ContainerKey, BaseDevtools<DecomposedContainer>>();\n\t\tif (props?.initialContainers !== undefined) {\n\t\t\tfor (const containerConfig of props.initialContainers) {\n\t\t\t\tthis.containers.set(\n\t\t\t\t\tcontainerConfig.containerKey,\n\t\t\t\t\tnew ContainerDevtools(containerConfig),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis.logger = props?.logger;\n\n\t\t// Register listener for inbound messages from the Window (globalThis)\n\t\tglobalThis.addEventListener?.(\"message\", this.windowMessageHandler);\n\n\t\t// Register the devtools instance to be disposed on Window unload\n\t\tglobalThis.addEventListener?.(\"beforeunload\", this.windowBeforeUnloadHandler);\n\n\t\t// Post message for supported features\n\t\tthis.postSupportedFeatures();\n\n\t\tthis._disposed = false;\n\t}\n\n\t/**\n\t * Creates and returns the FluidDevtools singleton.\n\t *\n\t * @remarks\n\t *\n\t * If the singleton has already been initialized, a warning will be logged and the existing instance will\n\t * be returned.\n\t */\n\tpublic static initialize(props?: FluidDevtoolsProps): FluidDevtools {\n\t\tif (FluidDevtools.I === undefined) {\n\t\t\tFluidDevtools.I = new FluidDevtools(props);\n\t\t} else {\n\t\t\tconsole.warn(\n\t\t\t\t\"Devtools have already been initialized. \" +\n\t\t\t\t\t\"Existing Devtools instance must be disposed before new ones may be initialized. \" +\n\t\t\t\t\t\"Returning existing Devtools instance.\",\n\t\t\t);\n\t\t}\n\n\t\treturn FluidDevtools.I;\n\t}\n\n\t/**\n\t * Gets the Devtools singleton if it has been initialized, otherwise throws.\n\t */\n\tpublic static getOrThrow(): FluidDevtools {\n\t\tif (FluidDevtools.I === undefined) {\n\t\t\tthrow new UsageError(accessBeforeInitializeErrorText);\n\t\t}\n\t\treturn FluidDevtools.I;\n\t}\n\n\t/**\n\t * Gets the Devtools singleton if it has been initialized, otherwise returns `undefined`.\n\t */\n\tpublic static tryGet(): FluidDevtools | undefined {\n\t\treturn FluidDevtools.I;\n\t}\n\n\t/**\n\t * {@inheritDoc IFluidDevtools.registerContainerDevtools}\n\t */\n\tpublic registerContainerDevtools(props: ContainerDevtoolsProps): void {\n\t\tif (this.disposed) {\n\t\t\tthrow new UsageError(useAfterDisposeErrorText);\n\t\t}\n\n\t\tconst { containerKey } = props;\n\n\t\tif (this.containers.has(containerKey)) {\n\t\t\tthrow new UsageError(getContainerAlreadyRegisteredErrorText(containerKey));\n\t\t}\n\n\t\tconst containerDevtools = new ContainerDevtools(props);\n\t\tthis.containers.set(containerKey, containerDevtools);\n\n\t\t// Post message for container list change\n\t\tthis.postContainerList();\n\t}\n\n\tpublic async registerContainerRuntime(props: ContainerRuntimeProps): Promise<void> {\n\t\tconst { runtime, label } = props;\n\n\t\tconst containerRuntimeKey = this.generateReadableKey(label ?? \"Container-Runtime\");\n\t\tconst extractedContainerRuntimeData =\n\t\t\tawait FluidDevtools.extractContainerDataFromRuntime(runtime);\n\n\t\tconst decomposedContainer = new DecomposedContainerForContainerRuntime(runtime);\n\n\t\t// Check if the container runtime is already registered.\n\t\tif (this.containers.has(containerRuntimeKey)) {\n\t\t\tthrow new UsageError(getContainerAlreadyRegisteredErrorText(containerRuntimeKey));\n\t\t}\n\n\t\tconst containerRuntimeDevtools = new ContainerRuntimeDevtools({\n\t\t\tcontainerKey: containerRuntimeKey,\n\t\t\tcontainer: decomposedContainer,\n\t\t\tcontainerData: extractedContainerRuntimeData,\n\t\t});\n\t\tthis.containers.set(containerRuntimeKey, containerRuntimeDevtools);\n\n\t\tthis.postContainerList();\n\t}\n\n\t/**\n\t * Helper method to extract container data from IContainerRuntime for visualization.\n\t * This method attempts to access the entry point data store from the runtime.\n\t *\n\t * @param containerRuntime - The container runtime to extract data from\n\t * @returns A record of data store names to IFluidLoadable objects, or undefined if no data can be extracted\n\t */\n\tpublic static async extractContainerDataFromRuntime(\n\t\tcontainerRuntime: IContainerRuntime,\n\t): Promise<Record<string, IFluidLoadable> | undefined> {\n\t\ttry {\n\t\t\t// Get the entry point from the container runtime\n\t\t\t// Cast to access getEntryPoint method which exists on the concrete implementation\n\t\t\tconst runtimeWithEntryPoint = containerRuntime as IContainerRuntime & {\n\t\t\t\tgetEntryPoint(): Promise<IFluidLoadable>;\n\t\t\t};\n\n\t\t\tif (\n\t\t\t\ttypeof runtimeWithEntryPoint.scope === \"object\" &&\n\t\t\t\ttypeof runtimeWithEntryPoint.getEntryPoint === \"function\"\n\t\t\t) {\n\t\t\t\tconst entryPoint = await runtimeWithEntryPoint.getEntryPoint();\n\t\t\t\tif (entryPoint !== undefined) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tentryPoint,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.warn(\"Could not extract container data from runtime:\", error);\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * {@inheritDoc IFluidDevtools.closeContainerDevtools}\n\t */\n\tpublic closeContainerDevtools(containerKey: ContainerKey): void {\n\t\tif (this.disposed) {\n\t\t\tthrow new UsageError(useAfterDisposeErrorText);\n\t\t}\n\n\t\tif (this.containers.has(containerKey)) {\n\t\t\tthis.removeContainer(containerKey);\n\t\t} else {\n\t\t\tconsole.warn(\n\t\t\t\t`No ContainerDevtools or ContainerRuntimeDevtools associated with key \"${containerKey}\" was found.`,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Gets the registered Container Devtools or Container Runtime Devtools associated with the provided {@link ContainerKey}, if one exists.\n\t * Otherwise returns `undefined`.\n\t */\n\tpublic getContainerDevtools(containerKey: ContainerKey): IContainerDevtools | undefined {\n\t\tif (this.disposed) {\n\t\t\tthrow new UsageError(useAfterDisposeErrorText);\n\t\t}\n\n\t\treturn this.containers.get(containerKey);\n\t}\n\n\t/**\n\t * Gets all container devtools instances (not data objects).\n\t */\n\tpublic getAllContainers(): readonly BaseDevtools<DecomposedContainer>[] {\n\t\tif (this.disposed) {\n\t\t\tthrow new UsageError(useAfterDisposeErrorText);\n\t\t}\n\n\t\treturn [...this.containers.values()];\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IDisposable.disposed}\n\t */\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IDisposable.dispose}\n\t */\n\tpublic dispose(): void {\n\t\tif (this.disposed) {\n\t\t\tthrow new UsageError(useAfterDisposeErrorText);\n\t\t}\n\n\t\t// Send close devtool message\n\t\tpostMessagesToWindow(devtoolsMessageLoggingOptions, DevtoolsDisposed.createMessage());\n\n\t\t// Dispose of container-level devtools\n\t\tfor (const [, containerDevtools] of this.containers) {\n\t\t\tcontainerDevtools.dispose();\n\t\t}\n\t\tthis.containers.clear();\n\n\t\t// Notify listeners that the list of Containers changed.\n\t\tthis.postContainerList();\n\n\t\t// Clear the singleton so a new one may be initialized.\n\t\tFluidDevtools.I = undefined;\n\n\t\t// Clean up event listeners\n\t\tglobalThis.removeEventListener?.(\"message\", this.windowMessageHandler);\n\t\tglobalThis.removeEventListener?.(\"beforeunload\", this.windowBeforeUnloadHandler);\n\n\t\tthis._disposed = true;\n\t}\n\n\t/**\n\t * Gets the set of features supported by this instance.\n\t */\n\tprivate getSupportedFeatures(): DevtoolsFeatureFlags {\n\t\treturn {\n\t\t\ttelemetry: this.logger !== undefined,\n\t\t\t// Most work completed, but not ready to completely enable.\n\t\t\topLatencyTelemetry: true,\n\t\t};\n\t}\n\n\t/**\n\t * Removes a container devtools instance from the devtools instance.\n\t * @param containerKey - The key of the container to remove.\n\t */\n\tprivate removeContainer(containerKey: ContainerKey): void {\n\t\tif (this.disposed) {\n\t\t\tthrow new UsageError(useAfterDisposeErrorText);\n\t\t}\n\n\t\tconst containerDevtools = this.containers.get(containerKey);\n\t\tif (containerDevtools === undefined) {\n\t\t\tconsole.warn(`No ContainerDevtools associated with key \"${containerKey}\" was found.`);\n\t\t\treturn;\n\t\t}\n\n\t\tcontainerDevtools.dispose();\n\t\tthis.containers.delete(containerKey);\n\n\t\t// Post message for container list change\n\t\tthis.postContainerList();\n\t}\n\n\t/**\n\t * Tracks the number of {@link ContainerRuntimeDevtools} instances created for each base key.\n\t */\n\tprivate readonly containerRuntimesInstanceCounts = new Map<string, number>();\n\n\t/**\n\t * Generates a readable key for a container runtime using package path and sequential numbering.\n\t *\n\t * @privateRemarks\n\t * TODO: Once we enable automatic extraction of ContainerData for IContainer instance, extend the usage of assigning readable key.\n\t */\n\tprivate generateReadableKey(baseKey: string): string {\n\t\t// Get the next number for this base key\n\t\tconst nextNumber = (this.containerRuntimesInstanceCounts.get(baseKey) ?? 0) + 1;\n\t\tthis.containerRuntimesInstanceCounts.set(baseKey, nextNumber);\n\n\t\treturn `${baseKey}-${nextNumber}`;\n\t}\n}\n\n/**\n * Initializes the Devtools singleton and returns a handle to it.\n *\n * @remarks\n *\n * The instance is tracked as a static singleton.\n *\n * It is automatically disposed on webpage unload, but it can be closed earlier by calling `dispose`\n * on the returned handle.\n * @beta\n */\nexport function initializeDevtools(props?: FluidDevtoolsProps): IFluidDevtools {\n\treturn FluidDevtools.initialize(props);\n}\n\n/**\n * Gets the Devtools singleton if it has been {@link initializeDevtools | initialized}, otherwise returns `undefined`.\n * @beta\n */\nexport function tryGetFluidDevtools(): IFluidDevtools | undefined {\n\treturn FluidDevtools.tryGet();\n}\n"]}
@@ -18,7 +18,7 @@ import type { ContainerRuntimeProps } from "./ContainerRuntimeDevtools.js";
18
18
  * The lifetime of the associated singleton is bound by that of the Window (globalThis), and it will be automatically
19
19
  * disposed of on Window unload.
20
20
  * If you wish to dispose of it earlier, you may call its {@link @fluidframework/core-interfaces#IDisposable.dispose} method.
21
- * @alpha
21
+ * @beta
22
22
  * @sealed
23
23
  */
24
24
  export interface IFluidDevtools extends IDisposable {
@@ -1 +1 @@
1
- {"version":3,"file":"IFluidDevtools.js","sourceRoot":"","sources":["../src/IFluidDevtools.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IDisposable } from \"@fluidframework/core-interfaces\";\n\nimport type { ContainerKey } from \"./CommonInterfaces.js\";\nimport type { ContainerDevtoolsProps } from \"./ContainerDevtools.js\";\nimport type { ContainerRuntimeProps } from \"./ContainerRuntimeDevtools.js\";\n\n/**\n * Fluid Devtools. A single, global instance is used to generate and communicate stats associated with the general Fluid\n * runtime (i.e., it is not associated with any single Framework entity).\n *\n * @remarks\n *\n * Supports registering {@link @fluidframework/container-definitions#IContainer}s for Container-level stats\n * (via {@link IFluidDevtools.registerContainerDevtools}).\n *\n * The lifetime of the associated singleton is bound by that of the Window (globalThis), and it will be automatically\n * disposed of on Window unload.\n * If you wish to dispose of it earlier, you may call its {@link @fluidframework/core-interfaces#IDisposable.dispose} method.\n * @alpha\n * @sealed\n */\nexport interface IFluidDevtools extends IDisposable {\n\t/**\n\t * Registers the provided {@link @fluidframework/container-definitions#IContainer} with the Devtools to begin\n\t * generating stats for it.\n\t *\n\t * @remarks To remove the Container from the Devtools, call {@link IFluidDevtools.closeContainerDevtools}.\n\t *\n\t * @throws Will throw if devtools have already been registered for the specified {@link ContainerKey}.\n\t */\n\tregisterContainerDevtools(props: ContainerDevtoolsProps): void;\n\n\t/**\n\t * Registers a container runtime with the devtools.\n\t *\n\t * @remarks To remove the Container Runtime from the Devtools, call {@link IFluidDevtools.closeContainerDevtools}.\n\t *\n\t * @throws Will throw if devtools have already been registered for the specified {@link ContainerKey}.\n\t */\n\tregisterContainerRuntime(props: ContainerRuntimeProps): Promise<void>;\n\n\t/**\n\t * Removes the Container with the specified {@link ContainerKey} from the Devtools.\n\t *\n\t * @remarks Will no-op if no such Container is registered.\n\t */\n\tcloseContainerDevtools(containerKey: ContainerKey): void;\n}\n"]}
1
+ {"version":3,"file":"IFluidDevtools.js","sourceRoot":"","sources":["../src/IFluidDevtools.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IDisposable } from \"@fluidframework/core-interfaces\";\n\nimport type { ContainerKey } from \"./CommonInterfaces.js\";\nimport type { ContainerDevtoolsProps } from \"./ContainerDevtools.js\";\nimport type { ContainerRuntimeProps } from \"./ContainerRuntimeDevtools.js\";\n\n/**\n * Fluid Devtools. A single, global instance is used to generate and communicate stats associated with the general Fluid\n * runtime (i.e., it is not associated with any single Framework entity).\n *\n * @remarks\n *\n * Supports registering {@link @fluidframework/container-definitions#IContainer}s for Container-level stats\n * (via {@link IFluidDevtools.registerContainerDevtools}).\n *\n * The lifetime of the associated singleton is bound by that of the Window (globalThis), and it will be automatically\n * disposed of on Window unload.\n * If you wish to dispose of it earlier, you may call its {@link @fluidframework/core-interfaces#IDisposable.dispose} method.\n * @beta\n * @sealed\n */\nexport interface IFluidDevtools extends IDisposable {\n\t/**\n\t * Registers the provided {@link @fluidframework/container-definitions#IContainer} with the Devtools to begin\n\t * generating stats for it.\n\t *\n\t * @remarks To remove the Container from the Devtools, call {@link IFluidDevtools.closeContainerDevtools}.\n\t *\n\t * @throws Will throw if devtools have already been registered for the specified {@link ContainerKey}.\n\t */\n\tregisterContainerDevtools(props: ContainerDevtoolsProps): void;\n\n\t/**\n\t * Registers a container runtime with the devtools.\n\t *\n\t * @remarks To remove the Container Runtime from the Devtools, call {@link IFluidDevtools.closeContainerDevtools}.\n\t *\n\t * @throws Will throw if devtools have already been registered for the specified {@link ContainerKey}.\n\t */\n\tregisterContainerRuntime(props: ContainerRuntimeProps): Promise<void>;\n\n\t/**\n\t * Removes the Container with the specified {@link ContainerKey} from the Devtools.\n\t *\n\t * @remarks Will no-op if no such Container is registered.\n\t */\n\tcloseContainerDevtools(containerKey: ContainerKey): void;\n}\n"]}
package/lib/alpha.d.ts CHANGED
@@ -28,17 +28,14 @@
28
28
 
29
29
  export {
30
30
  // #region @beta APIs
31
- ContainerKey,
32
- HasContainerKey,
33
- IDevtoolsLogger,
34
- createDevtoolsLogger,
35
- // #endregion
36
-
37
- // #region @alpha APIs
38
31
  ContainerDevtoolsProps,
32
+ ContainerKey,
39
33
  ContainerRuntimeProps,
40
34
  FluidDevtoolsProps,
35
+ HasContainerKey,
36
+ IDevtoolsLogger,
41
37
  IFluidDevtools,
38
+ createDevtoolsLogger,
42
39
  initializeDevtools,
43
40
  tryGetFluidDevtools
44
41
  // #endregion
package/lib/beta.d.ts ADDED
@@ -0,0 +1,42 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
9
+ */
10
+
11
+ /**
12
+ * Contains an API for initializing developer tooling alongside the Fluid Framework.
13
+ *
14
+ * This tooling is built for use alongside our Chromium browser extension.
15
+ * It listens for incoming messages from the corresponding extension, and posts direct responses as well as automatic
16
+ * updates for Fluid state changes.
17
+ *
18
+ * Individual {@link @fluidframework/container-definitions#IContainer | Fluid Containers} can be registered to generate
19
+ * Container-level stats.
20
+ *
21
+ * Visualization of telemetry logs can be enabled by creating a {@link DevtoolsLogger} and providing it to Devtools
22
+ * initialization.
23
+ *
24
+ * See the package README for more details.
25
+ *
26
+ * @packageDocumentation
27
+ */
28
+
29
+ export {
30
+ // #region @beta APIs
31
+ ContainerDevtoolsProps,
32
+ ContainerKey,
33
+ ContainerRuntimeProps,
34
+ FluidDevtoolsProps,
35
+ HasContainerKey,
36
+ IDevtoolsLogger,
37
+ IFluidDevtools,
38
+ createDevtoolsLogger,
39
+ initializeDevtools,
40
+ tryGetFluidDevtools
41
+ // #endregion
42
+ } from "./index.js";
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/devtools-core";
8
- export declare const pkgVersion = "2.70.0-361248";
8
+ export declare const pkgVersion = "2.70.0-361788";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/devtools-core";
8
- export const pkgVersion = "2.70.0-361248";
8
+ export const pkgVersion = "2.70.0-361788";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,+BAA+B,CAAC;AACvD,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/devtools-core\";\nexport const pkgVersion = \"2.70.0-361248\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,+BAA+B,CAAC;AACvD,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/devtools-core\";\nexport const pkgVersion = \"2.70.0-361788\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/devtools-core",
3
- "version": "2.70.0-361248",
3
+ "version": "2.70.0-361788",
4
4
  "description": "Fluid Framework developer tools core functionality",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -33,6 +33,16 @@
33
33
  "default": "./dist/index.js"
34
34
  }
35
35
  },
36
+ "./beta": {
37
+ "import": {
38
+ "types": "./lib/beta.d.ts",
39
+ "default": "./lib/index.js"
40
+ },
41
+ "require": {
42
+ "types": "./dist/beta.d.ts",
43
+ "default": "./dist/index.js"
44
+ }
45
+ },
36
46
  "./internal": {
37
47
  "import": {
38
48
  "types": "./lib/index.d.ts",
@@ -67,37 +77,37 @@
67
77
  "temp-directory": "nyc/.nyc_output"
68
78
  },
69
79
  "dependencies": {
70
- "@fluid-internal/client-utils": "2.70.0-361248",
71
- "@fluidframework/aqueduct": "2.70.0-361248",
72
- "@fluidframework/cell": "2.70.0-361248",
73
- "@fluidframework/container-definitions": "2.70.0-361248",
74
- "@fluidframework/container-loader": "2.70.0-361248",
75
- "@fluidframework/container-runtime": "2.70.0-361248",
76
- "@fluidframework/container-runtime-definitions": "2.70.0-361248",
77
- "@fluidframework/core-interfaces": "2.70.0-361248",
78
- "@fluidframework/core-utils": "2.70.0-361248",
79
- "@fluidframework/counter": "2.70.0-361248",
80
- "@fluidframework/datastore-definitions": "2.70.0-361248",
81
- "@fluidframework/driver-definitions": "2.70.0-361248",
82
- "@fluidframework/map": "2.70.0-361248",
83
- "@fluidframework/matrix": "2.70.0-361248",
84
- "@fluidframework/runtime-definitions": "2.70.0-361248",
85
- "@fluidframework/sequence": "2.70.0-361248",
86
- "@fluidframework/shared-object-base": "2.70.0-361248",
87
- "@fluidframework/telemetry-utils": "2.70.0-361248",
88
- "@fluidframework/tree": "2.70.0-361248"
80
+ "@fluid-internal/client-utils": "2.70.0-361788",
81
+ "@fluidframework/aqueduct": "2.70.0-361788",
82
+ "@fluidframework/cell": "2.70.0-361788",
83
+ "@fluidframework/container-definitions": "2.70.0-361788",
84
+ "@fluidframework/container-loader": "2.70.0-361788",
85
+ "@fluidframework/container-runtime": "2.70.0-361788",
86
+ "@fluidframework/container-runtime-definitions": "2.70.0-361788",
87
+ "@fluidframework/core-interfaces": "2.70.0-361788",
88
+ "@fluidframework/core-utils": "2.70.0-361788",
89
+ "@fluidframework/counter": "2.70.0-361788",
90
+ "@fluidframework/datastore-definitions": "2.70.0-361788",
91
+ "@fluidframework/driver-definitions": "2.70.0-361788",
92
+ "@fluidframework/map": "2.70.0-361788",
93
+ "@fluidframework/matrix": "2.70.0-361788",
94
+ "@fluidframework/runtime-definitions": "2.70.0-361788",
95
+ "@fluidframework/sequence": "2.70.0-361788",
96
+ "@fluidframework/shared-object-base": "2.70.0-361788",
97
+ "@fluidframework/telemetry-utils": "2.70.0-361788",
98
+ "@fluidframework/tree": "2.70.0-361788"
89
99
  },
90
100
  "devDependencies": {
91
101
  "@arethetypeswrong/cli": "^0.17.1",
92
102
  "@biomejs/biome": "~1.9.3",
93
- "@fluid-internal/mocha-test-setup": "2.70.0-361248",
103
+ "@fluid-internal/mocha-test-setup": "2.70.0-361788",
94
104
  "@fluid-tools/build-cli": "^0.58.3",
95
105
  "@fluidframework/build-common": "^2.0.3",
96
106
  "@fluidframework/build-tools": "^0.58.3",
97
107
  "@fluidframework/devtools-core-previous": "npm:@fluidframework/devtools-core@2.63.0",
98
108
  "@fluidframework/eslint-config-fluid": "^6.1.0",
99
- "@fluidframework/id-compressor": "2.70.0-361248",
100
- "@fluidframework/test-runtime-utils": "2.70.0-361248",
109
+ "@fluidframework/id-compressor": "2.70.0-361788",
110
+ "@fluidframework/test-runtime-utils": "2.70.0-361788",
101
111
  "@microsoft/api-extractor": "7.52.11",
102
112
  "@types/chai": "^4.0.0",
103
113
  "@types/mocha": "^10.0.10",
@@ -136,8 +146,10 @@
136
146
  "check:exports": "concurrently \"npm:check:exports:*\"",
137
147
  "check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
138
148
  "check:exports:cjs:alpha": "api-extractor run --config api-extractor/api-extractor-lint-alpha.cjs.json",
149
+ "check:exports:cjs:beta": "api-extractor run --config api-extractor/api-extractor-lint-beta.cjs.json",
139
150
  "check:exports:cjs:public": "api-extractor run --config api-extractor/api-extractor-lint-public.cjs.json",
140
151
  "check:exports:esm:alpha": "api-extractor run --config api-extractor/api-extractor-lint-alpha.esm.json",
152
+ "check:exports:esm:beta": "api-extractor run --config api-extractor/api-extractor-lint-beta.esm.json",
141
153
  "check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
142
154
  "check:format": "npm run check:biome",
143
155
  "ci:build:docs": "api-extractor run",
@@ -18,13 +18,15 @@ import {
18
18
 
19
19
  /**
20
20
  * Properties for registering a {@link @fluidframework/container-definitions#IContainer} with the Devtools.
21
- * @alpha
21
+ * @beta
22
+ * @input
23
+ * @sealed
22
24
  */
23
25
  export interface ContainerDevtoolsProps extends HasContainerKey {
24
26
  /**
25
27
  * The Container to register with the Devtools.
26
28
  */
27
- container: IContainer;
29
+ readonly container: IContainer;
28
30
 
29
31
  /**
30
32
  * (optional) Distributed Data Structures (DDSs) associated with the
@@ -39,7 +41,7 @@ export interface ContainerDevtoolsProps extends HasContainerKey {
39
41
  *
40
42
  * @privateRemarks TODO: rename this to make it more clear that this data does not *belong* to the Container.
41
43
  */
42
- containerData?: Record<string, IFluidLoadable>;
44
+ readonly containerData?: Record<string, IFluidLoadable>;
43
45
 
44
46
  // TODO: Add ability for customers to specify custom visualizer overrides
45
47
  }
@@ -23,7 +23,8 @@ import type { InboundHandlers } from "./messaging/index.js";
23
23
 
24
24
  /**
25
25
  * Properties for registering a container runtime with the Devtools.
26
- * @alpha
26
+ * @beta
27
+ * @sealed
27
28
  * @input
28
29
  */
29
30
  export interface ContainerRuntimeProps {
@@ -35,7 +36,7 @@ export interface ContainerRuntimeProps {
35
36
  /**
36
37
  * Optional label for the container runtime replacing the guid generated by {@link @fluidframework/container-runtime#IContainerRuntime.generateDocumentUniqueId}.
37
38
  */
38
- label?: string;
39
+ readonly label?: string;
39
40
  }
40
41
 
41
42
  /**