@fluidframework/devtools-core 2.70.0-361092 → 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 (53) 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/data-visualization/SharedTreeVisualizer.d.ts +1 -1
  22. package/dist/data-visualization/SharedTreeVisualizer.js +2 -2
  23. package/dist/data-visualization/SharedTreeVisualizer.js.map +1 -1
  24. package/dist/packageVersion.d.ts +1 -1
  25. package/dist/packageVersion.js +1 -1
  26. package/dist/packageVersion.js.map +1 -1
  27. package/lib/ContainerDevtools.d.ts +5 -3
  28. package/lib/ContainerDevtools.d.ts.map +1 -1
  29. package/lib/ContainerDevtools.js.map +1 -1
  30. package/lib/ContainerRuntimeDevtools.d.ts +3 -2
  31. package/lib/ContainerRuntimeDevtools.d.ts.map +1 -1
  32. package/lib/ContainerRuntimeDevtools.js.map +1 -1
  33. package/lib/FluidDevtools.d.ts +7 -5
  34. package/lib/FluidDevtools.d.ts.map +1 -1
  35. package/lib/FluidDevtools.js +2 -2
  36. package/lib/FluidDevtools.js.map +1 -1
  37. package/lib/IFluidDevtools.d.ts +1 -1
  38. package/lib/IFluidDevtools.js.map +1 -1
  39. package/lib/alpha.d.ts +4 -7
  40. package/lib/beta.d.ts +42 -0
  41. package/lib/data-visualization/SharedTreeVisualizer.d.ts +1 -1
  42. package/lib/data-visualization/SharedTreeVisualizer.js +2 -2
  43. package/lib/data-visualization/SharedTreeVisualizer.js.map +1 -1
  44. package/lib/packageVersion.d.ts +1 -1
  45. package/lib/packageVersion.js +1 -1
  46. package/lib/packageVersion.js.map +1 -1
  47. package/package.json +35 -23
  48. package/src/ContainerDevtools.ts +5 -3
  49. package/src/ContainerRuntimeDevtools.ts +3 -2
  50. package/src/FluidDevtools.ts +7 -5
  51. package/src/IFluidDevtools.ts +1 -1
  52. package/src/data-visualization/SharedTreeVisualizer.ts +2 -2
  53. package/src/packageVersion.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SharedTreeVisualizer.js","sourceRoot":"","sources":["../../src/data-visualization/SharedTreeVisualizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAAiD;AASjD,4DAA8E;AAI9E,yEAAsE;AACtE,mDAOyB;AAEzB;;GAEG;AACH,SAAgB,iBAAiB,CAAC,QAAwB;IACzD,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,8BAAc,CAAC,QAAQ,CAAC;QAC7B,KAAK,8BAAc,CAAC,eAAe,CAAC,CAAC,CAAC;YACrC,OAAO,8BAAc,CAAC,aAAa,CAAC;QACrC,CAAC;QACD,KAAK,8BAAc,CAAC,SAAS,CAAC,CAAC,CAAC;YAC/B,OAAO,8BAAc,CAAC,cAAc,CAAC;QACtC,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,OAAO,8BAAc,CAAC,sBAAsB,CAAC;QAC9C,CAAC;IACF,CAAC;AACF,CAAC;AAbD,8CAaC;AAED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MAAM,kBAAkB,CAAC,IAAI,CAAC;YACrC,IAAI,EAAE,mDAAwB,CAAC,QAAQ;SACvC;QACF,CAAC,CAAC,qBAAqB,CACrB,IAAI,EACJ,eAAe,EACf,EAAE,YAAY,EAAE,UAAU,EAAE,EAC5B,kBAAkB,CAClB,CAAC;AACL,CAAC;AAtBD,kEAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FieldKind } from \"@fluidframework/tree\";\nimport type {\n\tSimpleArrayNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleNodeSchema,\n\tSimpleObjectNodeSchema,\n\tVerboseTree,\n\tVerboseTreeNode,\n} from \"@fluidframework/tree/internal\";\nimport { NodeKind, SchemaFactory, Tree } from \"@fluidframework/tree/internal\";\n\nimport type { VisualizeChildData } from \"./DataVisualization.js\";\nimport type { VisualSharedTreeNode, SharedTreeSchemaNode } from \"./VisualSharedTreeTypes.js\";\nimport { VisualSharedTreeNodeKind } from \"./VisualSharedTreeTypes.js\";\nimport {\n\ttype VisualChildNode,\n\tVisualNodeKind,\n\ttype VisualValueNode,\n\ttype VisualTreeNode,\n\ttype FluidHandleNode,\n\ttype UnknownObjectNode,\n} from \"./VisualTree.js\";\n\n/**\n * Returns VisualNodeKind that is compatible to {@link FluidObjectNode} based on the `visualTree`'s node kind.\n */\nexport function determineNodeKind(nodeKind: VisualNodeKind): VisualNodeKind {\n\tswitch (nodeKind) {\n\t\tcase VisualNodeKind.TreeNode:\n\t\tcase VisualNodeKind.FluidHandleNode: {\n\t\t\treturn VisualNodeKind.FluidTreeNode;\n\t\t}\n\t\tcase VisualNodeKind.ValueNode: {\n\t\t\treturn VisualNodeKind.FluidValueNode;\n\t\t}\n\t\tdefault: {\n\t\t\treturn VisualNodeKind.FluidUnknownObjectNode;\n\t\t}\n\t}\n}\n\n/**\n * Returns allowed types of the non-leaf nodes in the tree.\n * @param allowedTypes - a string if array node, `Record<string, string>` for non-array nodes.\n * @returns - a VisualChildNode with the allowed type.\n */\nfunction createAllowedTypesVisualTree(\n\tallowedTypes: string | Record<string, string>,\n): VisualChildNode {\n\tif (typeof allowedTypes === \"string\") {\n\t\treturn {\n\t\t\tvalue: allowedTypes,\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t};\n\t}\n\n\tconst result: Record<string, VisualValueNode> = {};\n\tfor (const [allowedTypeKey, allowedType] of Object.entries(allowedTypes)) {\n\t\tresult[allowedTypeKey] = {\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\tvalue: allowedType,\n\t\t};\n\t}\n\n\treturn {\n\t\tchildren: result,\n\t\tnodeKind: VisualNodeKind.TreeNode,\n\t};\n}\n\n/**\n * Creates a visual representation of the schema of the tree in {@link VisualTreeNode} format.\n */\nfunction createToolTipContents(schema: SharedTreeSchemaNode): VisualTreeNode {\n\tconst children: Record<string, VisualChildNode> = {\n\t\tname: {\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\tvalue: schema.schemaName,\n\t\t},\n\t};\n\tif (schema.allowedTypes !== undefined) {\n\t\tchildren.allowedTypes = createAllowedTypesVisualTree(schema.allowedTypes);\n\t}\n\tif (schema.isRequired !== undefined) {\n\t\tchildren.isRequired = {\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\tvalue: schema.isRequired,\n\t\t};\n\t}\n\treturn {\n\t\tnodeKind: VisualNodeKind.TreeNode,\n\t\tchildren,\n\t};\n}\n\n/**\n * Converts the visual representation from {@link visualizeNodeBySchema} to a visual tree compatible with the devtools-view.\n * @param tree - the visual representation of the SharedTree.\n * @returns - the visual representation of type {@link VisualChildNode}\n */\nexport function toVisualTree(tree: VisualSharedTreeNode): VisualChildNode {\n\tif (tree.kind === VisualSharedTreeNodeKind.LeafNode) {\n\t\tswitch (tree.value.nodeKind) {\n\t\t\tcase VisualNodeKind.ValueNode: {\n\t\t\t\tconst result: VisualValueNode = {\n\t\t\t\t\tvalue: tree.value.value,\n\t\t\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\t\t\ttooltipContents: {\n\t\t\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tcase VisualNodeKind.FluidHandleNode: {\n\t\t\t\tconst result: FluidHandleNode = {\n\t\t\t\t\tfluidObjectId: tree.value.fluidObjectId,\n\t\t\t\t\tnodeKind: VisualNodeKind.FluidHandleNode,\n\t\t\t\t\ttooltipContents: {\n\t\t\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tconsole.error(`Unknown node kind: ${tree.value.nodeKind}`);\n\t\t\t\tconst result: UnknownObjectNode = {\n\t\t\t\t\tnodeKind: VisualNodeKind.UnknownObjectNode,\n\t\t\t\t\ttooltipContents: {\n\t\t\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconst children: Record<string, VisualChildNode> = {};\n\n\t\tfor (const [key, value] of Object.entries(tree.fields)) {\n\t\t\tconst child = toVisualTree(value);\n\t\t\tchildren[key] = child;\n\t\t}\n\n\t\treturn {\n\t\t\tchildren,\n\t\t\tnodeKind: VisualNodeKind.TreeNode,\n\t\t\ttooltipContents: {\n\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t},\n\t\t};\n\t}\n}\n\n/**\n * Concatenate allowed types for `ObjectNodeStoredSchema` and `MapNodeStoredSchema`.\n */\nexport function concatenateTypes(fieldTypes: ReadonlySet<string>): string {\n\treturn [...fieldTypes].join(\" | \");\n}\n\n/**\n * Properties that describe schema constraints for a field in the tree\n */\ninterface FieldSchemaProperties {\n\tallowedTypes: ReadonlySet<string> | undefined;\n\n\t/**\n\t * Whether the field is required (true) or optional (false).\n\t *\n\t * `undefined` indicates that the field is implicitly required.\n\t * In this case, no requirement information will be displayed by the devtools.\n\t */\n\tisRequired: boolean | undefined;\n}\n\n/**\n * Processes and visualizes the fields of a verbose tree node.\n *\n * @param treeFields - The fields of the tree node to visualize. Can be either an array of VerboseTree (for array nodes) or a Record of field names to VerboseTree (for object/map nodes).\n * @param treeDefinitions - Map containing all schema definitions for the entire tree structure. Each definition describes the shape and constraints of a particular node type.\n * @param fieldSchemaProperties - Record mapping field names to their schema properties, including allowed types and whether they are required.\n * @param visualizeChildData - Callback function to visualize child node data.\n *\n * @returns A record mapping field names/indices to their visual tree representations.\n */\nasync function visualizeVerboseNodeFields(\n\ttreeFields: readonly VerboseTree[] | Record<string, VerboseTree>,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\tfieldSchemaProperties: Record<string, FieldSchemaProperties>,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<Record<string, VisualSharedTreeNode>> {\n\tconst fields: Record<string | number, VisualSharedTreeNode> = {};\n\n\tfor (const [fieldKey, childField] of Object.entries(treeFields)) {\n\t\tfields[fieldKey] = await visualizeSharedTreeBySchema(\n\t\t\tchildField,\n\t\t\ttreeDefinitions,\n\t\t\t{\n\t\t\t\tallowedTypes: fieldSchemaProperties[fieldKey]?.allowedTypes,\n\t\t\t\tisRequired: fieldSchemaProperties[fieldKey]?.isRequired,\n\t\t\t},\n\t\t\tvisualizeChildData,\n\t\t);\n\t}\n\n\treturn fields;\n}\n\n/**\n * Returns the schema & fields of the node with type {@link ObjectNodeStoredSchema}.\n */\nasync function visualizeObjectNode(\n\ttree: VerboseTreeNode,\n\tschema: SimpleObjectNodeSchema,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst objectNodeSchemaProperties: Record<string, FieldSchemaProperties> = {};\n\tfor (const [fieldKey, treeFieldSimpleSchema] of schema.fields) {\n\t\tobjectNodeSchemaProperties[fieldKey] = {\n\t\t\tallowedTypes: treeFieldSimpleSchema.allowedTypesIdentifiers,\n\t\t\tisRequired: treeFieldSimpleSchema.kind === FieldKind.Required ? true : false,\n\t\t};\n\t}\n\n\treturn {\n\t\tschema: {\n\t\t\tschemaName: tree.type,\n\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\tisRequired: isRequired?.toString(),\n\t\t},\n\t\tfields: await visualizeVerboseNodeFields(\n\t\t\ttree.fields,\n\t\t\ttreeDefinitions,\n\t\t\tobjectNodeSchemaProperties,\n\t\t\tvisualizeChildData,\n\t\t),\n\t\tkind: VisualSharedTreeNodeKind.InternalNode,\n\t};\n}\n\n/**\n * Returns the schema & fields of the node with type {@link MapNodeStoredSchema}.\n */\nasync function visualizeMapNode(\n\ttree: VerboseTreeNode,\n\tschema: SimpleMapNodeSchema,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst mapNodeSchemaProperties: Record<string, FieldSchemaProperties> = {};\n\tfor (const key of Object.keys(tree.fields)) {\n\t\tmapNodeSchemaProperties[key] = {\n\t\t\tallowedTypes: schema.allowedTypesIdentifiers,\n\t\t\t// Map values are always required. Don't display field requirement information, since that information is redundant.\n\t\t\tisRequired: undefined,\n\t\t};\n\t}\n\n\treturn {\n\t\tschema: {\n\t\t\tschemaName: tree.type,\n\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\tisRequired: isRequired?.toString(),\n\t\t},\n\t\tfields: await visualizeVerboseNodeFields(\n\t\t\ttree.fields,\n\t\t\ttreeDefinitions,\n\t\t\tmapNodeSchemaProperties,\n\t\t\tvisualizeChildData,\n\t\t),\n\t\tkind: VisualSharedTreeNodeKind.InternalNode,\n\t};\n}\n\n/**\n * Returns the schema & fields of the node with type {@link ArrayNodeStoredSchema}.\n */\nasync function visualizeArrayNode(\n\ttree: VerboseTreeNode,\n\tschema: SimpleArrayNodeSchema,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst children = tree.fields;\n\tif (!Array.isArray(children)) {\n\t\tthrow new TypeError(\"Invalid array\");\n\t}\n\n\tconst arrayNodeSchemaProperties: Record<string, FieldSchemaProperties> = {};\n\tfor (const [i] of children.entries()) {\n\t\tarrayNodeSchemaProperties[i] = {\n\t\t\tallowedTypes: schema.allowedTypesIdentifiers,\n\t\t\t// Array values are always required. Don't display field requirement information, since that information is redundant.\n\t\t\tisRequired: undefined,\n\t\t};\n\t}\n\n\treturn {\n\t\tschema: {\n\t\t\tschemaName: tree.type,\n\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\tisRequired: isRequired?.toString(),\n\t\t},\n\t\tfields: await visualizeVerboseNodeFields(\n\t\t\ttree.fields,\n\t\t\ttreeDefinitions,\n\t\t\tarrayNodeSchemaProperties,\n\t\t\tvisualizeChildData,\n\t\t),\n\t\tkind: VisualSharedTreeNodeKind.InternalNode,\n\t};\n}\n\n/**\n * Creates the visual representation of non-leaf SharedTree nodes.\n *\n * @remarks\n * Processes internal tree nodes based on their schema type (e.g., ObjectNodeStoredSchema, MapNodeStoredSchema, ArrayNodeStoredSchema),\n * producing the visual representation for each type.\n *\n * @see {@link https://fluidframework.com/docs/data-structures/tree/} for more information on the SharedTree schema.\n *\n * @remarks\n */\nasync function visualizeNodeBySchema(\n\ttree: VerboseTreeNode,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst schema = treeDefinitions.get(tree.type);\n\n\tif (schema === undefined) {\n\t\tthrow new TypeError(\"Unrecognized schema type.\");\n\t}\n\n\tswitch (schema.kind) {\n\t\tcase NodeKind.Object: {\n\t\t\tconst objectVisualized = visualizeObjectNode(\n\t\t\t\ttree,\n\t\t\t\tschema,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n\t\t\treturn objectVisualized;\n\t\t}\n\t\tcase NodeKind.Map: {\n\t\t\tconst mapVisualized = visualizeMapNode(\n\t\t\t\ttree,\n\t\t\t\tschema,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n\t\t\treturn mapVisualized;\n\t\t}\n\t\tcase NodeKind.Array: {\n\t\t\treturn visualizeArrayNode(\n\t\t\t\ttree,\n\t\t\t\tschema,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n\t\t}\n\t\tdefault: {\n\t\t\tthrow new TypeError(\"Unrecognized schema type.\");\n\t\t}\n\t}\n}\n\n/**\n * Creates a visual representation of a SharedTree based on its schema.\n * @param tree - The {@link VerboseTree} to visualize\n * @param treeDefinitions - Map containing all schema definitions for the entire tree structure. Each definition\n * describes the shape and constraints of a particular node type.\n * @param fieldSchemaProperties - Properties describing schema constraints for this field:\n * - `allowedTypes`: Set of type names that are valid for this specific node position in the tree.\n * This is a subset of the types defined in treeDefinitions.\n * - `isRequired`: Whether this field is required in its parent object schema.\n * Only meaningful for direct children of object nodes.\n * Undefined for array/map elements since they are always required within their parent.\n * @param visualizeChildData - Callback function to visualize child node data\n * @returns A visual representation of the tree that includes schema information and node values\n *\n * @remarks\n * This function handles both leaf nodes (primitive values, handles) and internal nodes (objects, maps, arrays).\n * For leaf nodes, it creates a visual representation with the node's schema and value.\n * For internal nodes, it recursively processes the node's fields using {@link visualizeNodeBySchema}.\n */\nexport async function visualizeSharedTreeBySchema(\n\ttree: VerboseTree,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\treturn Tree.is(tree, SchemaFactory.leaves)\n\t\t? {\n\t\t\t\tschema: {\n\t\t\t\t\tschemaName: Tree.schema(tree).identifier,\n\t\t\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\t\t\tisRequired: isRequired?.toString(),\n\t\t\t\t},\n\t\t\t\tvalue: await visualizeChildData(tree),\n\t\t\t\tkind: VisualSharedTreeNodeKind.LeafNode,\n\t\t\t}\n\t\t: visualizeNodeBySchema(\n\t\t\t\ttree,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n}\n"]}
1
+ {"version":3,"file":"SharedTreeVisualizer.js","sourceRoot":"","sources":["../../src/data-visualization/SharedTreeVisualizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAAiD;AASjD,4DAA8E;AAI9E,yEAAsE;AACtE,mDAOyB;AAEzB;;GAEG;AACH,SAAgB,iBAAiB,CAAC,QAAwB;IACzD,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,8BAAc,CAAC,QAAQ,CAAC;QAC7B,KAAK,8BAAc,CAAC,eAAe,CAAC,CAAC,CAAC;YACrC,OAAO,8BAAc,CAAC,aAAa,CAAC;QACrC,CAAC;QACD,KAAK,8BAAc,CAAC,SAAS,CAAC,CAAC,CAAC;YAC/B,OAAO,8BAAc,CAAC,cAAc,CAAC;QACtC,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,OAAO,8BAAc,CAAC,sBAAsB,CAAC;QAC9C,CAAC;IACF,CAAC;AACF,CAAC;AAbD,8CAaC;AAED;;;;GAIG;AACH,SAAS,4BAA4B,CACpC,YAA6C;IAE7C,IAAI,OAAO,YAA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AAQ;SACvC;QACF,CAAC,CAAC,qBAAqB,CACrB,IAAI,EACJ,eAAe,EACf,EAAE,YAAY,EAAE,UAAU,EAAE,EAC5B,kBAAkB,CAClB,CAAC;AACL,CAAC;AAtBD,kEAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FieldKind } from \"@fluidframework/tree\";\nimport type {\n\tSimpleArrayNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleNodeSchema,\n\tSimpleObjectNodeSchema,\n\tVerboseTree,\n\tVerboseTreeNode,\n} from \"@fluidframework/tree/internal\";\nimport { NodeKind, SchemaFactory, Tree } from \"@fluidframework/tree/internal\";\n\nimport type { VisualizeChildData } from \"./DataVisualization.js\";\nimport type { VisualSharedTreeNode, SharedTreeSchemaNode } from \"./VisualSharedTreeTypes.js\";\nimport { VisualSharedTreeNodeKind } from \"./VisualSharedTreeTypes.js\";\nimport {\n\ttype VisualChildNode,\n\tVisualNodeKind,\n\ttype VisualValueNode,\n\ttype VisualTreeNode,\n\ttype FluidHandleNode,\n\ttype UnknownObjectNode,\n} from \"./VisualTree.js\";\n\n/**\n * Returns VisualNodeKind that is compatible to {@link FluidObjectNode} based on the `visualTree`'s node kind.\n */\nexport function determineNodeKind(nodeKind: VisualNodeKind): VisualNodeKind {\n\tswitch (nodeKind) {\n\t\tcase VisualNodeKind.TreeNode:\n\t\tcase VisualNodeKind.FluidHandleNode: {\n\t\t\treturn VisualNodeKind.FluidTreeNode;\n\t\t}\n\t\tcase VisualNodeKind.ValueNode: {\n\t\t\treturn VisualNodeKind.FluidValueNode;\n\t\t}\n\t\tdefault: {\n\t\t\treturn VisualNodeKind.FluidUnknownObjectNode;\n\t\t}\n\t}\n}\n\n/**\n * Returns allowed types of the non-leaf nodes in the tree.\n * @param allowedTypes - a string if array node, `Record<string, string>` for non-array nodes.\n * @returns a VisualChildNode with the allowed type.\n */\nfunction createAllowedTypesVisualTree(\n\tallowedTypes: string | Record<string, string>,\n): VisualChildNode {\n\tif (typeof allowedTypes === \"string\") {\n\t\treturn {\n\t\t\tvalue: allowedTypes,\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t};\n\t}\n\n\tconst result: Record<string, VisualValueNode> = {};\n\tfor (const [allowedTypeKey, allowedType] of Object.entries(allowedTypes)) {\n\t\tresult[allowedTypeKey] = {\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\tvalue: allowedType,\n\t\t};\n\t}\n\n\treturn {\n\t\tchildren: result,\n\t\tnodeKind: VisualNodeKind.TreeNode,\n\t};\n}\n\n/**\n * Creates a visual representation of the schema of the tree in {@link VisualTreeNode} format.\n */\nfunction createToolTipContents(schema: SharedTreeSchemaNode): VisualTreeNode {\n\tconst children: Record<string, VisualChildNode> = {\n\t\tname: {\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\tvalue: schema.schemaName,\n\t\t},\n\t};\n\tif (schema.allowedTypes !== undefined) {\n\t\tchildren.allowedTypes = createAllowedTypesVisualTree(schema.allowedTypes);\n\t}\n\tif (schema.isRequired !== undefined) {\n\t\tchildren.isRequired = {\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\tvalue: schema.isRequired,\n\t\t};\n\t}\n\treturn {\n\t\tnodeKind: VisualNodeKind.TreeNode,\n\t\tchildren,\n\t};\n}\n\n/**\n * Converts the visual representation from {@link visualizeNodeBySchema} to a visual tree compatible with the devtools-view.\n * @param tree - the visual representation of the SharedTree.\n * @returns the visual representation of type {@link VisualChildNode}\n */\nexport function toVisualTree(tree: VisualSharedTreeNode): VisualChildNode {\n\tif (tree.kind === VisualSharedTreeNodeKind.LeafNode) {\n\t\tswitch (tree.value.nodeKind) {\n\t\t\tcase VisualNodeKind.ValueNode: {\n\t\t\t\tconst result: VisualValueNode = {\n\t\t\t\t\tvalue: tree.value.value,\n\t\t\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\t\t\ttooltipContents: {\n\t\t\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tcase VisualNodeKind.FluidHandleNode: {\n\t\t\t\tconst result: FluidHandleNode = {\n\t\t\t\t\tfluidObjectId: tree.value.fluidObjectId,\n\t\t\t\t\tnodeKind: VisualNodeKind.FluidHandleNode,\n\t\t\t\t\ttooltipContents: {\n\t\t\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tconsole.error(`Unknown node kind: ${tree.value.nodeKind}`);\n\t\t\t\tconst result: UnknownObjectNode = {\n\t\t\t\t\tnodeKind: VisualNodeKind.UnknownObjectNode,\n\t\t\t\t\ttooltipContents: {\n\t\t\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconst children: Record<string, VisualChildNode> = {};\n\n\t\tfor (const [key, value] of Object.entries(tree.fields)) {\n\t\t\tconst child = toVisualTree(value);\n\t\t\tchildren[key] = child;\n\t\t}\n\n\t\treturn {\n\t\t\tchildren,\n\t\t\tnodeKind: VisualNodeKind.TreeNode,\n\t\t\ttooltipContents: {\n\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t},\n\t\t};\n\t}\n}\n\n/**\n * Concatenate allowed types for `ObjectNodeStoredSchema` and `MapNodeStoredSchema`.\n */\nexport function concatenateTypes(fieldTypes: ReadonlySet<string>): string {\n\treturn [...fieldTypes].join(\" | \");\n}\n\n/**\n * Properties that describe schema constraints for a field in the tree\n */\ninterface FieldSchemaProperties {\n\tallowedTypes: ReadonlySet<string> | undefined;\n\n\t/**\n\t * Whether the field is required (true) or optional (false).\n\t *\n\t * `undefined` indicates that the field is implicitly required.\n\t * In this case, no requirement information will be displayed by the devtools.\n\t */\n\tisRequired: boolean | undefined;\n}\n\n/**\n * Processes and visualizes the fields of a verbose tree node.\n *\n * @param treeFields - The fields of the tree node to visualize. Can be either an array of VerboseTree (for array nodes) or a Record of field names to VerboseTree (for object/map nodes).\n * @param treeDefinitions - Map containing all schema definitions for the entire tree structure. Each definition describes the shape and constraints of a particular node type.\n * @param fieldSchemaProperties - Record mapping field names to their schema properties, including allowed types and whether they are required.\n * @param visualizeChildData - Callback function to visualize child node data.\n *\n * @returns A record mapping field names/indices to their visual tree representations.\n */\nasync function visualizeVerboseNodeFields(\n\ttreeFields: readonly VerboseTree[] | Record<string, VerboseTree>,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\tfieldSchemaProperties: Record<string, FieldSchemaProperties>,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<Record<string, VisualSharedTreeNode>> {\n\tconst fields: Record<string | number, VisualSharedTreeNode> = {};\n\n\tfor (const [fieldKey, childField] of Object.entries(treeFields)) {\n\t\tfields[fieldKey] = await visualizeSharedTreeBySchema(\n\t\t\tchildField,\n\t\t\ttreeDefinitions,\n\t\t\t{\n\t\t\t\tallowedTypes: fieldSchemaProperties[fieldKey]?.allowedTypes,\n\t\t\t\tisRequired: fieldSchemaProperties[fieldKey]?.isRequired,\n\t\t\t},\n\t\t\tvisualizeChildData,\n\t\t);\n\t}\n\n\treturn fields;\n}\n\n/**\n * Returns the schema & fields of the node with type {@link ObjectNodeStoredSchema}.\n */\nasync function visualizeObjectNode(\n\ttree: VerboseTreeNode,\n\tschema: SimpleObjectNodeSchema,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst objectNodeSchemaProperties: Record<string, FieldSchemaProperties> = {};\n\tfor (const [fieldKey, treeFieldSimpleSchema] of schema.fields) {\n\t\tobjectNodeSchemaProperties[fieldKey] = {\n\t\t\tallowedTypes: treeFieldSimpleSchema.allowedTypesIdentifiers,\n\t\t\tisRequired: treeFieldSimpleSchema.kind === FieldKind.Required ? true : false,\n\t\t};\n\t}\n\n\treturn {\n\t\tschema: {\n\t\t\tschemaName: tree.type,\n\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\tisRequired: isRequired?.toString(),\n\t\t},\n\t\tfields: await visualizeVerboseNodeFields(\n\t\t\ttree.fields,\n\t\t\ttreeDefinitions,\n\t\t\tobjectNodeSchemaProperties,\n\t\t\tvisualizeChildData,\n\t\t),\n\t\tkind: VisualSharedTreeNodeKind.InternalNode,\n\t};\n}\n\n/**\n * Returns the schema & fields of the node with type {@link MapNodeStoredSchema}.\n */\nasync function visualizeMapNode(\n\ttree: VerboseTreeNode,\n\tschema: SimpleMapNodeSchema,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst mapNodeSchemaProperties: Record<string, FieldSchemaProperties> = {};\n\tfor (const key of Object.keys(tree.fields)) {\n\t\tmapNodeSchemaProperties[key] = {\n\t\t\tallowedTypes: schema.allowedTypesIdentifiers,\n\t\t\t// Map values are always required. Don't display field requirement information, since that information is redundant.\n\t\t\tisRequired: undefined,\n\t\t};\n\t}\n\n\treturn {\n\t\tschema: {\n\t\t\tschemaName: tree.type,\n\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\tisRequired: isRequired?.toString(),\n\t\t},\n\t\tfields: await visualizeVerboseNodeFields(\n\t\t\ttree.fields,\n\t\t\ttreeDefinitions,\n\t\t\tmapNodeSchemaProperties,\n\t\t\tvisualizeChildData,\n\t\t),\n\t\tkind: VisualSharedTreeNodeKind.InternalNode,\n\t};\n}\n\n/**\n * Returns the schema & fields of the node with type {@link ArrayNodeStoredSchema}.\n */\nasync function visualizeArrayNode(\n\ttree: VerboseTreeNode,\n\tschema: SimpleArrayNodeSchema,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst children = tree.fields;\n\tif (!Array.isArray(children)) {\n\t\tthrow new TypeError(\"Invalid array\");\n\t}\n\n\tconst arrayNodeSchemaProperties: Record<string, FieldSchemaProperties> = {};\n\tfor (const [i] of children.entries()) {\n\t\tarrayNodeSchemaProperties[i] = {\n\t\t\tallowedTypes: schema.allowedTypesIdentifiers,\n\t\t\t// Array values are always required. Don't display field requirement information, since that information is redundant.\n\t\t\tisRequired: undefined,\n\t\t};\n\t}\n\n\treturn {\n\t\tschema: {\n\t\t\tschemaName: tree.type,\n\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\tisRequired: isRequired?.toString(),\n\t\t},\n\t\tfields: await visualizeVerboseNodeFields(\n\t\t\ttree.fields,\n\t\t\ttreeDefinitions,\n\t\t\tarrayNodeSchemaProperties,\n\t\t\tvisualizeChildData,\n\t\t),\n\t\tkind: VisualSharedTreeNodeKind.InternalNode,\n\t};\n}\n\n/**\n * Creates the visual representation of non-leaf SharedTree nodes.\n *\n * @remarks\n * Processes internal tree nodes based on their schema type (e.g., ObjectNodeStoredSchema, MapNodeStoredSchema, ArrayNodeStoredSchema),\n * producing the visual representation for each type.\n *\n * @see {@link https://fluidframework.com/docs/data-structures/tree/} for more information on the SharedTree schema.\n *\n * @remarks\n */\nasync function visualizeNodeBySchema(\n\ttree: VerboseTreeNode,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst schema = treeDefinitions.get(tree.type);\n\n\tif (schema === undefined) {\n\t\tthrow new TypeError(\"Unrecognized schema type.\");\n\t}\n\n\tswitch (schema.kind) {\n\t\tcase NodeKind.Object: {\n\t\t\tconst objectVisualized = visualizeObjectNode(\n\t\t\t\ttree,\n\t\t\t\tschema,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n\t\t\treturn objectVisualized;\n\t\t}\n\t\tcase NodeKind.Map: {\n\t\t\tconst mapVisualized = visualizeMapNode(\n\t\t\t\ttree,\n\t\t\t\tschema,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n\t\t\treturn mapVisualized;\n\t\t}\n\t\tcase NodeKind.Array: {\n\t\t\treturn visualizeArrayNode(\n\t\t\t\ttree,\n\t\t\t\tschema,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n\t\t}\n\t\tdefault: {\n\t\t\tthrow new TypeError(\"Unrecognized schema type.\");\n\t\t}\n\t}\n}\n\n/**\n * Creates a visual representation of a SharedTree based on its schema.\n * @param tree - The {@link VerboseTree} to visualize\n * @param treeDefinitions - Map containing all schema definitions for the entire tree structure. Each definition\n * describes the shape and constraints of a particular node type.\n * @param fieldSchemaProperties - Properties describing schema constraints for this field:\n * - `allowedTypes`: Set of type names that are valid for this specific node position in the tree.\n * This is a subset of the types defined in treeDefinitions.\n * - `isRequired`: Whether this field is required in its parent object schema.\n * Only meaningful for direct children of object nodes.\n * Undefined for array/map elements since they are always required within their parent.\n * @param visualizeChildData - Callback function to visualize child node data\n * @returns A visual representation of the tree that includes schema information and node values\n *\n * @remarks\n * This function handles both leaf nodes (primitive values, handles) and internal nodes (objects, maps, arrays).\n * For leaf nodes, it creates a visual representation with the node's schema and value.\n * For internal nodes, it recursively processes the node's fields using {@link visualizeNodeBySchema}.\n */\nexport async function visualizeSharedTreeBySchema(\n\ttree: VerboseTree,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\treturn Tree.is(tree, SchemaFactory.leaves)\n\t\t? {\n\t\t\t\tschema: {\n\t\t\t\t\tschemaName: Tree.schema(tree).identifier,\n\t\t\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\t\t\tisRequired: isRequired?.toString(),\n\t\t\t\t},\n\t\t\t\tvalue: await visualizeChildData(tree),\n\t\t\t\tkind: VisualSharedTreeNodeKind.LeafNode,\n\t\t\t}\n\t\t: visualizeNodeBySchema(\n\t\t\t\ttree,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n}\n"]}
@@ -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-361092";
8
+ export declare const pkgVersion = "2.70.0-361788";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/devtools-core";
11
- exports.pkgVersion = "2.70.0-361092";
11
+ exports.pkgVersion = "2.70.0-361788";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,+BAA+B,CAAC;AAC1C,QAAA,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-361092\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,+BAA+B,CAAC;AAC1C,QAAA,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"]}
@@ -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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AM,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 * @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,iBAA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CACL,IAAI,CAAC,OAAO,YAAY,gBAAgB,EACxC,KAAK,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 * @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":["../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AmH;IAC3I,CAAC;IAED,IAAW,YAAY;QACtB,sGAAsG;QACtG,MAAM,CACL,IAAI,CAAC,OAAO,YAAY,gBAAgB,EACxC,KAAK,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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IAAI,IAAI;IA2BtB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAQ5B;;;OAGG;IACH,OAAO,CAAC,eAAe;IAkBvB;;OAEG;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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iBAAiB,KAAK,SAAS,EAAE,CAAC;YACrC,OAAO,CAAC,IAAI,CAAC,6CAA6C,YAAY,cAAc,CAAC,CAAC;YACtF,OAAO;QACR,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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,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 * @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";
@@ -13,7 +13,7 @@ export declare function determineNodeKind(nodeKind: VisualNodeKind): VisualNodeK
13
13
  /**
14
14
  * Converts the visual representation from {@link visualizeNodeBySchema} to a visual tree compatible with the devtools-view.
15
15
  * @param tree - the visual representation of the SharedTree.
16
- * @returns - the visual representation of type {@link VisualChildNode}
16
+ * @returns the visual representation of type {@link VisualChildNode}
17
17
  */
18
18
  export declare function toVisualTree(tree: VisualSharedTreeNode): VisualChildNode;
19
19
  /**
@@ -26,7 +26,7 @@ export function determineNodeKind(nodeKind) {
26
26
  /**
27
27
  * Returns allowed types of the non-leaf nodes in the tree.
28
28
  * @param allowedTypes - a string if array node, `Record<string, string>` for non-array nodes.
29
- * @returns - a VisualChildNode with the allowed type.
29
+ * @returns a VisualChildNode with the allowed type.
30
30
  */
31
31
  function createAllowedTypesVisualTree(allowedTypes) {
32
32
  if (typeof allowedTypes === "string") {
@@ -74,7 +74,7 @@ function createToolTipContents(schema) {
74
74
  /**
75
75
  * Converts the visual representation from {@link visualizeNodeBySchema} to a visual tree compatible with the devtools-view.
76
76
  * @param tree - the visual representation of the SharedTree.
77
- * @returns - the visual representation of type {@link VisualChildNode}
77
+ * @returns the visual representation of type {@link VisualChildNode}
78
78
  */
79
79
  export function toVisualTree(tree) {
80
80
  if (tree.kind === VisualSharedTreeNodeKind.LeafNode) {