@fluid-internal/presence-runtime 2.117.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/runtime/extension/containerPresence.d.ts +1 -1
- package/lib/runtime/extension/containerPresence.d.ts.map +1 -1
- package/lib/runtime/extension/containerPresence.js +5 -3
- package/lib/runtime/extension/containerPresence.js.map +1 -1
- package/lib/runtime/presenceDatastoreManager.js +71 -37
- package/lib/runtime/presenceDatastoreManager.js.map +1 -1
- package/lib/runtime/presenceManager.js +13 -8
- package/lib/runtime/presenceManager.js.map +1 -1
- package/lib/runtime/systemWorkspace.js +20 -13
- package/lib/runtime/systemWorkspace.js.map +1 -1
- package/lib/states/latestMapValueManager.d.ts.map +1 -1
- package/lib/states/latestMapValueManager.js +12 -1
- package/lib/states/latestMapValueManager.js.map +1 -1
- package/lib/states/latestValueManager.js +6 -1
- package/lib/states/latestValueManager.js.map +1 -1
- package/lib/states/notificationsManager.js +34 -32
- package/lib/states/notificationsManager.js.map +1 -1
- package/lib/utils/broadcastControls.js +4 -0
- package/lib/utils/broadcastControls.js.map +1 -1
- package/lib/utils/internalUtils.d.ts.map +1 -1
- package/lib/utils/timerManager.js +4 -5
- package/lib/utils/timerManager.js.map +1 -1
- package/lib/workspace/presenceStates.js +6 -0
- package/lib/workspace/presenceStates.js.map +1 -1
- package/package.json +28 -60
- package/dist/package.json +0 -4
- package/dist/packageVersion.d.ts +0 -9
- package/dist/packageVersion.d.ts.map +0 -1
- package/dist/packageVersion.js +0 -12
- package/dist/packageVersion.js.map +0 -1
- package/dist/runtime/extension/containerPresence.d.ts +0 -53
- package/dist/runtime/extension/containerPresence.d.ts.map +0 -1
- package/dist/runtime/extension/containerPresence.js +0 -90
- package/dist/runtime/extension/containerPresence.js.map +0 -1
- package/dist/runtime/extension/index.d.ts +0 -6
- package/dist/runtime/extension/index.d.ts.map +0 -1
- package/dist/runtime/extension/index.js +0 -11
- package/dist/runtime/extension/index.js.map +0 -1
- package/dist/runtime/presenceDatastoreManager.d.ts +0 -146
- package/dist/runtime/presenceDatastoreManager.d.ts.map +0 -1
- package/dist/runtime/presenceDatastoreManager.js +0 -666
- package/dist/runtime/presenceDatastoreManager.js.map +0 -1
- package/dist/runtime/presenceManager.d.ts +0 -16
- package/dist/runtime/presenceManager.d.ts.map +0 -1
- package/dist/runtime/presenceManager.js +0 -140
- package/dist/runtime/presenceManager.js.map +0 -1
- package/dist/runtime/protocol.d.ts +0 -126
- package/dist/runtime/protocol.d.ts.map +0 -1
- package/dist/runtime/protocol.js +0 -20
- package/dist/runtime/protocol.js.map +0 -1
- package/dist/runtime/runtimeTypes.d.ts +0 -26
- package/dist/runtime/runtimeTypes.d.ts.map +0 -1
- package/dist/runtime/runtimeTypes.js +0 -7
- package/dist/runtime/runtimeTypes.js.map +0 -1
- package/dist/runtime/systemWorkspace.d.ts +0 -39
- package/dist/runtime/systemWorkspace.d.ts.map +0 -1
- package/dist/runtime/systemWorkspace.js +0 -264
- package/dist/runtime/systemWorkspace.js.map +0 -1
- package/dist/runtime/test.d.ts +0 -12
- package/dist/runtime/test.d.ts.map +0 -1
- package/dist/runtime/test.js +0 -15
- package/dist/runtime/test.js.map +0 -1
- package/dist/states/index.d.ts +0 -7
- package/dist/states/index.d.ts.map +0 -1
- package/dist/states/index.js +0 -12
- package/dist/states/index.js.map +0 -1
- package/dist/states/latestMapValueManager.d.ts +0 -10
- package/dist/states/latestMapValueManager.d.ts.map +0 -1
- package/dist/states/latestMapValueManager.js +0 -248
- package/dist/states/latestMapValueManager.js.map +0 -1
- package/dist/states/latestValueManager.d.ts +0 -10
- package/dist/states/latestValueManager.d.ts.map +0 -1
- package/dist/states/latestValueManager.js +0 -115
- package/dist/states/latestValueManager.js.map +0 -1
- package/dist/states/notificationsManager.d.ts +0 -26
- package/dist/states/notificationsManager.d.ts.map +0 -1
- package/dist/states/notificationsManager.js +0 -97
- package/dist/states/notificationsManager.js.map +0 -1
- package/dist/states/presence.d.ts +0 -11
- package/dist/states/presence.d.ts.map +0 -1
- package/dist/states/presence.js +0 -7
- package/dist/states/presence.js.map +0 -1
- package/dist/states/stateFactory.d.ts +0 -23
- package/dist/states/stateFactory.d.ts.map +0 -1
- package/dist/states/stateFactory.js +0 -27
- package/dist/states/stateFactory.js.map +0 -1
- package/dist/states/validatedGetter.d.ts +0 -18
- package/dist/states/validatedGetter.d.ts.map +0 -1
- package/dist/states/validatedGetter.js +0 -43
- package/dist/states/validatedGetter.js.map +0 -1
- package/dist/utils/broadcastControls.d.ts +0 -37
- package/dist/utils/broadcastControls.d.ts.map +0 -1
- package/dist/utils/broadcastControls.js +0 -60
- package/dist/utils/broadcastControls.js.map +0 -1
- package/dist/utils/index.d.ts +0 -9
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -26
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/internalUtils.d.ts +0 -125
- package/dist/utils/internalUtils.d.ts.map +0 -1
- package/dist/utils/internalUtils.js +0 -99
- package/dist/utils/internalUtils.js.map +0 -1
- package/dist/utils/timerManager.d.ts +0 -37
- package/dist/utils/timerManager.d.ts.map +0 -1
- package/dist/utils/timerManager.js +0 -65
- package/dist/utils/timerManager.js.map +0 -1
- package/dist/utils/valueManager.d.ts +0 -14
- package/dist/utils/valueManager.d.ts.map +0 -1
- package/dist/utils/valueManager.js +0 -22
- package/dist/utils/valueManager.js.map +0 -1
- package/dist/workspace/index.d.ts +0 -7
- package/dist/workspace/index.d.ts.map +0 -1
- package/dist/workspace/index.js +0 -14
- package/dist/workspace/index.js.map +0 -1
- package/dist/workspace/presenceStates.d.ts +0 -61
- package/dist/workspace/presenceStates.d.ts.map +0 -1
- package/dist/workspace/presenceStates.js +0 -235
- package/dist/workspace/presenceStates.js.map +0 -1
- package/dist/workspace/stateDatastore.d.ts +0 -17
- package/dist/workspace/stateDatastore.d.ts.map +0 -1
- package/dist/workspace/stateDatastore.js +0 -24
- package/dist/workspace/stateDatastore.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timerManager.js","sourceRoot":"","sources":["../../src/utils/timerManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,OAAO,YAAY;
|
|
1
|
+
{"version":3,"file":"timerManager.js","sourceRoot":"","sources":["../../src/utils/timerManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,OAAO,YAAY;IAChB,UAAU,CAAqB;IAC/B,UAAU,GAAG,CAAC,CAAC;IAEvB,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAEO,MAAM,GAAW,CAAC,CAAC;IAE3B,IAAW,KAAK;QACf,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAEO,QAAQ,GAAY,IAAI,CAAC;IAEjC;;;;OAIG;IACI,UAAU;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED;;;;;OAKG;IACI,UAAU,CAAC,QAAoB,EAAE,KAAa;QACpD,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,6BAA6B;QAClD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,GAAG,EAAE;YACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,QAAQ,EAAE,CAAC;QACZ,CAAC,EAAE,KAAK,CAAC,CAAC;IACX,CAAC;IAED;;OAEG;IACI,YAAY;QAClB,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACnC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC9B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;YAC5B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACtB,CAAC;IACF,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC;IAC5D,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Wrapper around setTimeout to track whether the timeout has expired or not.\n */\nexport class TimerManager {\n\tprivate _timeoutId: number | undefined;\n\tprivate _startTime = 0;\n\n\tpublic get startTime(): number {\n\t\treturn this._startTime;\n\t}\n\n\tprivate _delay: number = 0;\n\n\tpublic get delay(): number {\n\t\treturn this._delay;\n\t}\n\n\tprivate _expired: boolean = true;\n\n\t/**\n\t * Whether the timer has expired or not.\n\t *\n\t * @returns True if the timer has expired; false otherwise.\n\t */\n\tpublic hasExpired(): boolean {\n\t\treturn this._expired;\n\t}\n\n\t/**\n\t * Schedules a callback to be triggered after a delay.\n\t *\n\t * @param callback - A callback to execute after a delay.\n\t * @param delay - The time to wait before executing the callback, in milliseconds.\n\t */\n\tpublic setTimeout(callback: () => void, delay: number): void {\n\t\tthis.clearTimeout(); // Clear any existing timeout\n\t\tthis._startTime = Date.now();\n\t\tthis._delay = delay;\n\t\tthis._expired = false;\n\t\tthis._timeoutId = setTimeout(() => {\n\t\t\tthis._expired = true;\n\t\t\tcallback();\n\t\t}, delay);\n\t}\n\n\t/**\n\t * Clear any pending timer. Also marks the timer as expired.\n\t */\n\tpublic clearTimeout(): void {\n\t\tif (this._timeoutId !== undefined) {\n\t\t\tclearTimeout(this._timeoutId);\n\t\t\tthis._timeoutId = undefined;\n\t\t\tthis._expired = true;\n\t\t}\n\t}\n\n\t/**\n\t * The time when this timer will expire/trigger. If the timer has expired, returns 0.\n\t */\n\tpublic get expireTime(): number {\n\t\treturn this.hasExpired() ? 0 : this.startTime + this.delay;\n\t}\n}\n"]}
|
|
@@ -85,6 +85,12 @@ function castUnknownRecordToSchemaRecord(record) {
|
|
|
85
85
|
return record;
|
|
86
86
|
}
|
|
87
87
|
class PresenceStatesImpl {
|
|
88
|
+
runtime;
|
|
89
|
+
datastore;
|
|
90
|
+
nodes;
|
|
91
|
+
states;
|
|
92
|
+
notifications;
|
|
93
|
+
controls;
|
|
88
94
|
constructor(runtime, datastore, initialContent, controlsSettings) {
|
|
89
95
|
this.runtime = runtime;
|
|
90
96
|
this.datastore = datastore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presenceStates.js","sourceRoot":"","sources":["../../src/workspace/presenceStates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA+BH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAG7D,OAAO,EACN,iBAAiB,EACjB,aAAa,EACb,wBAAwB,EACxB,UAAU,GACV,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAyC1D,SAAS,gBAAgB,CAMxB,KAAoD;IAEpD,OAAO,OAAO,IAAI,KAAK,CAAC;AACzB,CAAC;AA+CD;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAMlC,IAA+D,EAC/D,MAAqD,EACrD,SAAiB;IAEjB,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/B,IAAI,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACjD,OAAO,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS,EAAE,CAAC;QAC/D,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,SAA0C,CAAC;IAC/C,IAA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AAC,eAAe,CAAC,EAAE,CAAC;YAC1E,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACnC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;gBAC9B,mFAAmF;gBACnF,uBAAuB,CAAC,GAAG,EAAE,mBAAmB,EAAE,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;YACjF,CAAC;iBAAM,CAAC;gBACP,MAAM,IAAI,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;gBACpC,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,aAAa,CAAC,mBAAmB,CAAC,EAAE,CAAC;oBACtE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;oBACvE,iBAAiB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;gBACjE,CAAC;YACF,CAAC;QACF,CAAC;QACD,OAAO,iBAAiB,CAAC;IAC1B,CAAC;CACD;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CACnC,OAAwB,EACxB,SAAiD,EACjD,cAAuB,EACvB,QAA8C;IAE9C,MAAM,IAAI,GAAG,IAAI,kBAAkB,CAAU,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;IAE3F,OAAO;QACN,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,IAAI;KACd,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tAttendeeId,\n\tBroadcastControlSettings,\n\tPresenceWithNotifications as Presence,\n\tStatesWorkspace,\n\tStatesWorkspaceSchema,\n} from \"@fluid-internal/presence-definitions\";\nimport type {\n\tAnyWorkspace,\n\tInternalTypes,\n\tPostUpdateAction,\n\tValidatableOptionalState,\n\tValidatableRequiredState,\n\tValidatableValueDirectory,\n\tValidatableValueDirectoryOrState,\n\tValidatableValueStructure,\n} from \"@fluid-internal/presence-definitions/internal\";\nimport type { ClientRecord } from \"@fluid-internal/presence-definitions/internal/workspace\";\nimport type {\n\tClientUpdateEntry,\n\tPresenceStatesInternal,\n\tRuntimeLocalUpdateOptions,\n\tValueElementMap,\n\tValueUpdateRecord,\n} from \"@fluid-internal/presence-definitions/internal/workspace-runtime\";\nimport type {\n\tLocalStateUpdateOptions,\n\tStateDatastore,\n} from \"@fluid-internal/presence-definitions/internal/workspace-states\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { RecordEntryTypes } from \"@fluid-internal/presence-runtime/utils\";\nimport {\n\tgetOrCreateRecord,\n\tobjectEntries,\n\tRequiredBroadcastControl,\n\tunbrandIVM,\n} from \"@fluid-internal/presence-runtime/utils\";\n\nimport { handleFromDatastore } from \"./stateDatastore.js\";\n\n/**\n * Extracts `Part` from {@link InternalTypes.ManagerFactory} return type\n * matching the {@link StatesWorkspaceSchema} `Keys` given.\n *\n * @remarks\n * If the `Part` is an optional property, undefined will be included in the\n * result. Applying `Required` to the return type prior to extracting `Part`\n * does not work as expected. Exclude\\<, undefined\\> can be used as needed.\n */\ntype MapSchemaElement<\n\tTSchema extends StatesWorkspaceSchema,\n\tPart extends keyof ReturnType<TSchema[keyof TSchema]>,\n\tKeys extends keyof TSchema = keyof TSchema,\n> = ReturnType<TSchema[Keys]>[Part];\n\n/**\n * Contract for `PresenceDatastoreManager` as required by States Workspaces ({@link PresenceStatesImpl}).\n */\ninterface PresenceRuntime {\n\treadonly presence: Presence;\n\treadonly attendeeId: AttendeeId;\n\tlocalUpdate(\n\t\tstates: { [key: string]: ClientUpdateEntry },\n\t\toptions: RuntimeLocalUpdateOptions,\n\t): void;\n}\n\ntype PresenceSubSchemaFromWorkspaceSchema<\n\tTSchema extends StatesWorkspaceSchema,\n\tPart extends keyof ReturnType<TSchema[keyof TSchema]>,\n> = {\n\t[Key in keyof TSchema]: MapSchemaElement<TSchema, Part, Key>;\n};\n\ntype MapEntries<TSchema extends StatesWorkspaceSchema> = PresenceSubSchemaFromWorkspaceSchema<\n\tTSchema,\n\t\"manager\"\n>;\n\nfunction isValueDirectory<\n\tT,\n\tTValueState extends\n\t\t| InternalTypes.ValueRequiredState<T>\n\t\t| InternalTypes.ValueOptionalState<T>,\n>(\n\tvalue: InternalTypes.ValueDirectory<T> | TValueState,\n): value is InternalTypes.ValueDirectory<T> {\n\treturn \"items\" in value;\n}\n\n// function overloads\n/**\n * Non-validatable types\n *\n * @internal\n */\nexport function mergeValueDirectory<\n\tT,\n\tTValueState extends\n\t\t| InternalTypes.ValueRequiredState<T>\n\t\t| InternalTypes.ValueOptionalState<T>,\n>(\n\tbase: TValueState | InternalTypes.ValueDirectory<T> | undefined,\n\tupdate: TValueState | InternalTypes.ValueDirectory<T>,\n\ttimeDelta: number,\n): TValueState | InternalTypes.ValueDirectory<T>;\n/**\n * Validatable base type with non-validatable update types\n *\n * @internal\n */\nexport function mergeValueDirectory<\n\tT,\n\tTBaseState extends ValidatableRequiredState<T> | ValidatableOptionalState<T>,\n\tTUpdateState extends\n\t\t| InternalTypes.ValueRequiredState<T>\n\t\t| InternalTypes.ValueOptionalState<T>,\n>(\n\tbase: TBaseState | ValidatableValueDirectory<T> | undefined,\n\tupdate: TUpdateState | InternalTypes.ValueDirectory<T>,\n\ttimeDelta: number,\n): TBaseState | ValidatableValueDirectory<T>;\n/**\n * Fully validatable types\n *\n * @internal\n */\nexport function mergeValueDirectory<\n\tT,\n\tTValueState extends ValidatableRequiredState<T> | ValidatableOptionalState<T>,\n>(\n\tbase: TValueState | ValidatableValueDirectory<T> | undefined,\n\tupdate: TValueState | ValidatableValueDirectory<T>,\n\ttimeDelta: number,\n): TValueState | ValidatableValueDirectory<T>;\n/**\n * Merge a value directory.\n *\n * @privateRemarks\n * This implementation uses the InternalTypes set of Value types but it is\n * agnostic so long as the validatable versions don't start requiring\n * properties.\n *\n * @internal\n */\nexport function mergeValueDirectory<\n\tT,\n\tTValueState extends\n\t\t| InternalTypes.ValueRequiredState<T>\n\t\t| InternalTypes.ValueOptionalState<T>,\n>(\n\tbase: TValueState | InternalTypes.ValueDirectory<T> | undefined,\n\tupdate: TValueState | InternalTypes.ValueDirectory<T>,\n\ttimeDelta: number,\n): TValueState | InternalTypes.ValueDirectory<T> {\n\tif (!isValueDirectory(update)) {\n\t\tif (base === undefined || update.rev > base.rev) {\n\t\t\treturn { ...update, timestamp: update.timestamp + timeDelta };\n\t\t}\n\t\treturn base;\n\t}\n\n\tlet mergeBase: InternalTypes.ValueDirectory<T>;\n\tif (base === undefined) {\n\t\tmergeBase = { rev: update.rev, items: {} };\n\t} else {\n\t\tconst baseIsDirectory = isValueDirectory(base);\n\t\tif (base.rev >= update.rev) {\n\t\t\tif (!baseIsDirectory) {\n\t\t\t\t// base is leaf value that is more recent - nothing to do\n\t\t\t\treturn base;\n\t\t\t}\n\t\t\t// While base has more advanced revision, assume mis-ordering or\n\t\t\t// missed and catchup update needs merged in.\n\t\t\tmergeBase = base;\n\t\t} else {\n\t\t\tmergeBase = { rev: update.rev, items: baseIsDirectory ? base.items : {} };\n\t\t}\n\t}\n\tfor (const [key, value] of Object.entries(update.items)) {\n\t\tconst baseElement = mergeBase.items[key];\n\t\tmergeBase.items[key] = mergeValueDirectory(baseElement, value, timeDelta);\n\t}\n\treturn mergeBase;\n}\n\n/**\n * Updates remote state into the local [untracked] datastore.\n *\n * @param key - The key of the datastore to merge the untracked data into.\n * @param remoteAllKnownState - The remote state to merge into the datastore.\n * @param datastore - The datastore to merge the untracked data into.\n *\n * @remarks\n * In the case of ignored unmonitored data, the client entries are not stored,\n * though the value keys will be populated and often remain empty.\n *\n * @internal\n */\nexport function mergeUntrackedDatastore(\n\tkey: string,\n\tremoteAllKnownState: ValueUpdateRecord[string],\n\tdatastore: ValueElementMap<StatesWorkspaceSchema>,\n\ttimeModifier: number,\n): void {\n\tconst localAllKnownState = getOrCreateRecord(\n\t\tdatastore,\n\t\tkey,\n\t\t(): RecordEntryTypes<typeof datastore> => ({}),\n\t);\n\tfor (const [attendeeId, value] of objectEntries(remoteAllKnownState)) {\n\t\tif (!(\"ignoreUnmonitored\" in value)) {\n\t\t\tlocalAllKnownState[attendeeId] = mergeValueDirectory(\n\t\t\t\tlocalAllKnownState[attendeeId],\n\t\t\t\tvalue,\n\t\t\t\ttimeModifier,\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * The default allowable update latency for StatesWorkspace in milliseconds.\n */\nconst defaultAllowableUpdateLatencyMs = 60;\n\n/**\n * Produces the value type of a schema element or set of elements.\n */\ntype SchemaElementValueType<\n\tTSchema extends StatesWorkspaceSchema,\n\tKeys extends keyof TSchema,\n> = Exclude<MapSchemaElement<TSchema, \"initialData\", Keys>, undefined>[\"value\"];\n\n/**\n * No-runtime-effect helper to protect cast from unknown datastore to specific\n * schema record type. (It is up to consumer to check that record conforms to\n * expectations.)\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction castUnknownRecordToSchemaRecord<\n\tTSchema extends StatesWorkspaceSchema,\n\tKey extends keyof TSchema & string,\n>(record: ClientRecord<ValidatableValueDirectoryOrState<unknown>>) {\n\treturn record as ClientRecord<\n\t\tValidatableValueStructure<SchemaElementValueType<TSchema, Key>>\n\t>;\n}\n\nclass PresenceStatesImpl<TSchema extends StatesWorkspaceSchema>\n\timplements\n\t\tPresenceStatesInternal,\n\t\tAnyWorkspace<TSchema>,\n\t\tStateDatastore<\n\t\t\tkeyof TSchema & string,\n\t\t\tSchemaElementValueType<TSchema, keyof TSchema & string>\n\t\t>\n{\n\tprivate readonly nodes: MapEntries<TSchema>;\n\tpublic readonly states: StatesWorkspace<TSchema>[\"states\"];\n\tpublic readonly notifications: AnyWorkspace<TSchema>[\"notifications\"];\n\n\tpublic readonly controls: RequiredBroadcastControl;\n\n\tpublic constructor(\n\t\tprivate readonly runtime: PresenceRuntime,\n\t\tprivate readonly datastore: ValueElementMap<TSchema>,\n\t\tinitialContent: TSchema,\n\t\tcontrolsSettings: BroadcastControlSettings | undefined,\n\t) {\n\t\tthis.controls = new RequiredBroadcastControl(defaultAllowableUpdateLatencyMs);\n\t\tif (controlsSettings?.allowableUpdateLatencyMs !== undefined) {\n\t\t\tthis.controls.allowableUpdateLatencyMs = controlsSettings.allowableUpdateLatencyMs;\n\t\t}\n\n\t\t// Prepare initial map content from initial state\n\t\t{\n\t\t\tconst attendeeId = this.runtime.attendeeId;\n\t\t\t// Empty record does not satisfy the type, but nodes will post loop.\n\t\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t\tconst nodes = {} as MapEntries<TSchema>;\n\t\t\tlet anyInitialValues = false;\n\t\t\tconst newValues: { [key: string]: InternalTypes.ValueDirectoryOrState<unknown> } = {};\n\t\t\tlet cumulativeAllowableUpdateLatencyMs: number | undefined;\n\t\t\tfor (const [key, nodeFactory] of Object.entries(initialContent)) {\n\t\t\t\tconst newNodeData = nodeFactory(key, handleFromDatastore(this));\n\t\t\t\tnodes[key as keyof TSchema] = newNodeData.manager;\n\t\t\t\tif (\"initialData\" in newNodeData) {\n\t\t\t\t\tconst { value, allowableUpdateLatencyMs } = newNodeData.initialData;\n\t\t\t\t\t(datastore[key] ??= {})[attendeeId] = value;\n\t\t\t\t\tnewValues[key] = value;\n\t\t\t\t\tif (allowableUpdateLatencyMs !== undefined) {\n\t\t\t\t\t\tcumulativeAllowableUpdateLatencyMs =\n\t\t\t\t\t\t\tcumulativeAllowableUpdateLatencyMs === undefined\n\t\t\t\t\t\t\t\t? allowableUpdateLatencyMs\n\t\t\t\t\t\t\t\t: Math.min(cumulativeAllowableUpdateLatencyMs, allowableUpdateLatencyMs);\n\t\t\t\t\t}\n\t\t\t\t\tanyInitialValues = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.nodes = nodes;\n\t\t\t// states and notifications are the public view of nodes that limits the entries\n\t\t\t// types to the public interface of State objects with an additional type\n\t\t\t// filter that beguiles the type system. So just reinterpret cast.\n\t\t\tconst properties = nodes as unknown as AnyWorkspace<TSchema>[\"states\"];\n\t\t\t// `AnyWorkspace` support comes from defining both `states` for\n\t\t\t// `StatesWorkspace` and `notifications` for `NotificationsWorkspace`.\n\t\t\t// `notifications` is always a subset of what `states` can be; so the same.\n\t\t\tthis.notifications = this.states = properties;\n\n\t\t\tif (anyInitialValues) {\n\t\t\t\tthis.runtime.localUpdate(newValues, {\n\t\t\t\t\tallowableUpdateLatencyMs:\n\t\t\t\t\t\tcumulativeAllowableUpdateLatencyMs ?? this.controls.allowableUpdateLatencyMs,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get presence(): Presence {\n\t\treturn this.runtime.presence;\n\t}\n\n\tpublic knownValues<Key extends keyof TSchema & string>(\n\t\tkey: Key,\n\t): {\n\t\tself: AttendeeId | undefined;\n\t\tstates: ClientRecord<ValidatableValueStructure<SchemaElementValueType<TSchema, Key>>>;\n\t} {\n\t\treturn {\n\t\t\tself: this.runtime.attendeeId,\n\t\t\t// Caller must only use `key`s that are part of `this.datastore`.\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tstates: castUnknownRecordToSchemaRecord(this.datastore[key]!),\n\t\t};\n\t}\n\n\tpublic localUpdate<Key extends keyof TSchema & string>(\n\t\tkey: Key,\n\t\tvalue: SchemaElementValueType<TSchema, Key> & ClientUpdateEntry,\n\t\toptions: LocalStateUpdateOptions,\n\t): void {\n\t\tthis.runtime.localUpdate(\n\t\t\t{ [key]: value },\n\t\t\t{\n\t\t\t\t...options,\n\t\t\t\tallowableUpdateLatencyMs:\n\t\t\t\t\toptions.allowableUpdateLatencyMs ?? this.controls.allowableUpdateLatencyMs,\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic update<Key extends keyof TSchema & string>(\n\t\tkey: Key,\n\t\tclientId: AttendeeId,\n\t\tvalue: ValidatableValueDirectoryOrState<unknown>,\n\t): void {\n\t\t// Callers my only use `key`s that are part of `this.datastore`.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tconst allKnownState = this.datastore[key]!;\n\t\tallKnownState[clientId] = mergeValueDirectory<unknown, ValidatableRequiredState<unknown>>(\n\t\t\tallKnownState[clientId],\n\t\t\tvalue,\n\t\t\t0,\n\t\t);\n\t}\n\n\tpublic add<\n\t\tTKey extends string,\n\t\tTValue extends InternalTypes.ValueDirectoryOrState<unknown>,\n\t\tTValueManager,\n\t>(\n\t\tkey: TKey,\n\t\tnodeFactory: InternalTypes.ManagerFactory<TKey, TValue, TValueManager>,\n\t): asserts this is StatesWorkspace<\n\t\tTSchema & Record<TKey, InternalTypes.ManagerFactory<TKey, TValue, TValueManager>>\n\t> {\n\t\tassert(!(key in this.nodes), 0xa3c /* Already have entry for key in map */);\n\t\tconst nodeData = nodeFactory(key, handleFromDatastore(this));\n\t\tthis.nodes[key] = nodeData.manager;\n\t\tif (\"initialData\" in nodeData) {\n\t\t\tconst { value, allowableUpdateLatencyMs } = nodeData.initialData;\n\t\t\tlet datastoreValue = this.datastore[key];\n\t\t\tif (datastoreValue === undefined) {\n\t\t\t\tdatastoreValue = this.datastore[key] = {};\n\t\t\t} else {\n\t\t\t\t// Already have received state from other clients. Kept in `all`.\n\t\t\t\t// TODO: Send current `all` state to state manager.\n\t\t\t}\n\t\t\tdatastoreValue[this.runtime.attendeeId] = value;\n\t\t\tthis.runtime.localUpdate(\n\t\t\t\t{ [key]: value },\n\t\t\t\t{\n\t\t\t\t\tallowableUpdateLatencyMs:\n\t\t\t\t\t\tallowableUpdateLatencyMs ?? this.controls.allowableUpdateLatencyMs,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic ensureContent<TSchemaAdditional extends StatesWorkspaceSchema>(\n\t\tcontent: TSchemaAdditional,\n\t\tcontrols: BroadcastControlSettings | undefined,\n\t): AnyWorkspace<TSchema & TSchemaAdditional> {\n\t\tif (controls?.allowableUpdateLatencyMs !== undefined) {\n\t\t\tthis.controls.allowableUpdateLatencyMs = controls.allowableUpdateLatencyMs;\n\t\t}\n\t\tfor (const [key, nodeFactory] of Object.entries(content)) {\n\t\t\tconst brandedIVM = this.nodes[key];\n\t\t\tif (brandedIVM === undefined) {\n\t\t\t\tthis.add(key, nodeFactory);\n\t\t\t} else {\n\t\t\t\tconst node = unbrandIVM(brandedIVM);\n\t\t\t\tif (!(node instanceof nodeFactory.instanceBase)) {\n\t\t\t\t\tthrow new TypeError(`State \"${key}\" previously created by different State object.`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this as AnyWorkspace<TSchema & TSchemaAdditional>;\n\t}\n\n\tpublic processUpdate(\n\t\treceived: number,\n\t\ttimeModifier: number,\n\t\tremoteDatastore: ValueUpdateRecord,\n\t): PostUpdateAction[] {\n\t\tconst postUpdateActions: PostUpdateAction[] = [];\n\t\tfor (const [key, remoteAllKnownState] of Object.entries(remoteDatastore)) {\n\t\t\tconst brandedIVM = this.nodes[key];\n\t\t\tif (brandedIVM === undefined) {\n\t\t\t\t// Assume all broadcast state is meant to be kept even if not currently registered.\n\t\t\t\tmergeUntrackedDatastore(key, remoteAllKnownState, this.datastore, timeModifier);\n\t\t\t} else {\n\t\t\t\tconst node = unbrandIVM(brandedIVM);\n\t\t\t\tfor (const [attendeeId, value] of objectEntries(remoteAllKnownState)) {\n\t\t\t\t\tconst client = this.runtime.presence.attendees.getAttendee(attendeeId);\n\t\t\t\t\tpostUpdateActions.push(...node.update(client, received, value));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn postUpdateActions;\n\t}\n}\n\n/**\n * Create a new Workspace using the DataStoreRuntime provided.\n * @param initialContent - The initial State objects to register.\n *\n * @internal\n */\nexport function createPresenceStates<TSchema extends StatesWorkspaceSchema>(\n\truntime: PresenceRuntime,\n\tdatastore: ValueElementMap<StatesWorkspaceSchema>,\n\tinitialContent: TSchema,\n\tcontrols: BroadcastControlSettings | undefined,\n): { public: AnyWorkspace<TSchema>; internal: PresenceStatesInternal } {\n\tconst impl = new PresenceStatesImpl<TSchema>(runtime, datastore, initialContent, controls);\n\n\treturn {\n\t\tpublic: impl,\n\t\tinternal: impl,\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"presenceStates.js","sourceRoot":"","sources":["../../src/workspace/presenceStates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA+BH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAG7D,OAAO,EACN,iBAAiB,EACjB,aAAa,EACb,wBAAwB,EACxB,UAAU,GACV,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAyC1D,SAAS,gBAAgB,CAMxB,KAAoD;IAEpD,OAAO,OAAO,IAAI,KAAK,CAAC;AACzB,CAAC;AA+CD;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAMlC,IAA+D,EAC/D,MAAqD,EACrD,SAAiB;IAEjB,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/B,IAAI,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACjD,OAAO,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS,EAAE,CAAC;QAC/D,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,SAA0C,CAAC;IAC/C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,SAAS,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAC5C,CAAC;SAAM,CAAC;QACP,MAAM,eAAe,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,IAAI,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC;YAC5B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EAAE,mBAAmB,EAAE,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;YACjF,CAAC;iBAAM,CAAC;gBACP,MAAM,IAAI,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;gBACpC,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,aAAa,CAAC,mBAAmB,CAAC,EAAE,CAAC;oBACtE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;oBACvE,iBAAiB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;gBACjE,CAAC;YACF,CAAC;QACF,CAAC;QACD,OAAO,iBAAiB,CAAC;IAC1B,CAAC;CACD;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CACnC,OAAwB,EACxB,SAAiD,EACjD,cAAuB,EACvB,QAA8C;IAE9C,MAAM,IAAI,GAAG,IAAI,kBAAkB,CAAU,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;IAE3F,OAAO;QACN,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,IAAI;KACd,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tAttendeeId,\n\tBroadcastControlSettings,\n\tPresenceWithNotifications as Presence,\n\tStatesWorkspace,\n\tStatesWorkspaceSchema,\n} from \"@fluid-internal/presence-definitions\";\nimport type {\n\tAnyWorkspace,\n\tInternalTypes,\n\tPostUpdateAction,\n\tValidatableOptionalState,\n\tValidatableRequiredState,\n\tValidatableValueDirectory,\n\tValidatableValueDirectoryOrState,\n\tValidatableValueStructure,\n} from \"@fluid-internal/presence-definitions/internal\";\nimport type { ClientRecord } from \"@fluid-internal/presence-definitions/internal/workspace\";\nimport type {\n\tClientUpdateEntry,\n\tPresenceStatesInternal,\n\tRuntimeLocalUpdateOptions,\n\tValueElementMap,\n\tValueUpdateRecord,\n} from \"@fluid-internal/presence-definitions/internal/workspace-runtime\";\nimport type {\n\tLocalStateUpdateOptions,\n\tStateDatastore,\n} from \"@fluid-internal/presence-definitions/internal/workspace-states\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { RecordEntryTypes } from \"@fluid-internal/presence-runtime/utils\";\nimport {\n\tgetOrCreateRecord,\n\tobjectEntries,\n\tRequiredBroadcastControl,\n\tunbrandIVM,\n} from \"@fluid-internal/presence-runtime/utils\";\n\nimport { handleFromDatastore } from \"./stateDatastore.js\";\n\n/**\n * Extracts `Part` from {@link InternalTypes.ManagerFactory} return type\n * matching the {@link StatesWorkspaceSchema} `Keys` given.\n *\n * @remarks\n * If the `Part` is an optional property, undefined will be included in the\n * result. Applying `Required` to the return type prior to extracting `Part`\n * does not work as expected. Exclude\\<, undefined\\> can be used as needed.\n */\ntype MapSchemaElement<\n\tTSchema extends StatesWorkspaceSchema,\n\tPart extends keyof ReturnType<TSchema[keyof TSchema]>,\n\tKeys extends keyof TSchema = keyof TSchema,\n> = ReturnType<TSchema[Keys]>[Part];\n\n/**\n * Contract for `PresenceDatastoreManager` as required by States Workspaces ({@link PresenceStatesImpl}).\n */\ninterface PresenceRuntime {\n\treadonly presence: Presence;\n\treadonly attendeeId: AttendeeId;\n\tlocalUpdate(\n\t\tstates: { [key: string]: ClientUpdateEntry },\n\t\toptions: RuntimeLocalUpdateOptions,\n\t): void;\n}\n\ntype PresenceSubSchemaFromWorkspaceSchema<\n\tTSchema extends StatesWorkspaceSchema,\n\tPart extends keyof ReturnType<TSchema[keyof TSchema]>,\n> = {\n\t[Key in keyof TSchema]: MapSchemaElement<TSchema, Part, Key>;\n};\n\ntype MapEntries<TSchema extends StatesWorkspaceSchema> = PresenceSubSchemaFromWorkspaceSchema<\n\tTSchema,\n\t\"manager\"\n>;\n\nfunction isValueDirectory<\n\tT,\n\tTValueState extends\n\t\t| InternalTypes.ValueRequiredState<T>\n\t\t| InternalTypes.ValueOptionalState<T>,\n>(\n\tvalue: InternalTypes.ValueDirectory<T> | TValueState,\n): value is InternalTypes.ValueDirectory<T> {\n\treturn \"items\" in value;\n}\n\n// function overloads\n/**\n * Non-validatable types\n *\n * @internal\n */\nexport function mergeValueDirectory<\n\tT,\n\tTValueState extends\n\t\t| InternalTypes.ValueRequiredState<T>\n\t\t| InternalTypes.ValueOptionalState<T>,\n>(\n\tbase: TValueState | InternalTypes.ValueDirectory<T> | undefined,\n\tupdate: TValueState | InternalTypes.ValueDirectory<T>,\n\ttimeDelta: number,\n): TValueState | InternalTypes.ValueDirectory<T>;\n/**\n * Validatable base type with non-validatable update types\n *\n * @internal\n */\nexport function mergeValueDirectory<\n\tT,\n\tTBaseState extends ValidatableRequiredState<T> | ValidatableOptionalState<T>,\n\tTUpdateState extends\n\t\t| InternalTypes.ValueRequiredState<T>\n\t\t| InternalTypes.ValueOptionalState<T>,\n>(\n\tbase: TBaseState | ValidatableValueDirectory<T> | undefined,\n\tupdate: TUpdateState | InternalTypes.ValueDirectory<T>,\n\ttimeDelta: number,\n): TBaseState | ValidatableValueDirectory<T>;\n/**\n * Fully validatable types\n *\n * @internal\n */\nexport function mergeValueDirectory<\n\tT,\n\tTValueState extends ValidatableRequiredState<T> | ValidatableOptionalState<T>,\n>(\n\tbase: TValueState | ValidatableValueDirectory<T> | undefined,\n\tupdate: TValueState | ValidatableValueDirectory<T>,\n\ttimeDelta: number,\n): TValueState | ValidatableValueDirectory<T>;\n/**\n * Merge a value directory.\n *\n * @privateRemarks\n * This implementation uses the InternalTypes set of Value types but it is\n * agnostic so long as the validatable versions don't start requiring\n * properties.\n *\n * @internal\n */\nexport function mergeValueDirectory<\n\tT,\n\tTValueState extends\n\t\t| InternalTypes.ValueRequiredState<T>\n\t\t| InternalTypes.ValueOptionalState<T>,\n>(\n\tbase: TValueState | InternalTypes.ValueDirectory<T> | undefined,\n\tupdate: TValueState | InternalTypes.ValueDirectory<T>,\n\ttimeDelta: number,\n): TValueState | InternalTypes.ValueDirectory<T> {\n\tif (!isValueDirectory(update)) {\n\t\tif (base === undefined || update.rev > base.rev) {\n\t\t\treturn { ...update, timestamp: update.timestamp + timeDelta };\n\t\t}\n\t\treturn base;\n\t}\n\n\tlet mergeBase: InternalTypes.ValueDirectory<T>;\n\tif (base === undefined) {\n\t\tmergeBase = { rev: update.rev, items: {} };\n\t} else {\n\t\tconst baseIsDirectory = isValueDirectory(base);\n\t\tif (base.rev >= update.rev) {\n\t\t\tif (!baseIsDirectory) {\n\t\t\t\t// base is leaf value that is more recent - nothing to do\n\t\t\t\treturn base;\n\t\t\t}\n\t\t\t// While base has more advanced revision, assume mis-ordering or\n\t\t\t// missed and catchup update needs merged in.\n\t\t\tmergeBase = base;\n\t\t} else {\n\t\t\tmergeBase = { rev: update.rev, items: baseIsDirectory ? base.items : {} };\n\t\t}\n\t}\n\tfor (const [key, value] of Object.entries(update.items)) {\n\t\tconst baseElement = mergeBase.items[key];\n\t\tmergeBase.items[key] = mergeValueDirectory(baseElement, value, timeDelta);\n\t}\n\treturn mergeBase;\n}\n\n/**\n * Updates remote state into the local [untracked] datastore.\n *\n * @param key - The key of the datastore to merge the untracked data into.\n * @param remoteAllKnownState - The remote state to merge into the datastore.\n * @param datastore - The datastore to merge the untracked data into.\n *\n * @remarks\n * In the case of ignored unmonitored data, the client entries are not stored,\n * though the value keys will be populated and often remain empty.\n *\n * @internal\n */\nexport function mergeUntrackedDatastore(\n\tkey: string,\n\tremoteAllKnownState: ValueUpdateRecord[string],\n\tdatastore: ValueElementMap<StatesWorkspaceSchema>,\n\ttimeModifier: number,\n): void {\n\tconst localAllKnownState = getOrCreateRecord(\n\t\tdatastore,\n\t\tkey,\n\t\t(): RecordEntryTypes<typeof datastore> => ({}),\n\t);\n\tfor (const [attendeeId, value] of objectEntries(remoteAllKnownState)) {\n\t\tif (!(\"ignoreUnmonitored\" in value)) {\n\t\t\tlocalAllKnownState[attendeeId] = mergeValueDirectory(\n\t\t\t\tlocalAllKnownState[attendeeId],\n\t\t\t\tvalue,\n\t\t\t\ttimeModifier,\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * The default allowable update latency for StatesWorkspace in milliseconds.\n */\nconst defaultAllowableUpdateLatencyMs = 60;\n\n/**\n * Produces the value type of a schema element or set of elements.\n */\ntype SchemaElementValueType<\n\tTSchema extends StatesWorkspaceSchema,\n\tKeys extends keyof TSchema,\n> = Exclude<MapSchemaElement<TSchema, \"initialData\", Keys>, undefined>[\"value\"];\n\n/**\n * No-runtime-effect helper to protect cast from unknown datastore to specific\n * schema record type. (It is up to consumer to check that record conforms to\n * expectations.)\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction castUnknownRecordToSchemaRecord<\n\tTSchema extends StatesWorkspaceSchema,\n\tKey extends keyof TSchema & string,\n>(record: ClientRecord<ValidatableValueDirectoryOrState<unknown>>) {\n\treturn record as ClientRecord<\n\t\tValidatableValueStructure<SchemaElementValueType<TSchema, Key>>\n\t>;\n}\n\nclass PresenceStatesImpl<TSchema extends StatesWorkspaceSchema>\n\timplements\n\t\tPresenceStatesInternal,\n\t\tAnyWorkspace<TSchema>,\n\t\tStateDatastore<\n\t\t\tkeyof TSchema & string,\n\t\t\tSchemaElementValueType<TSchema, keyof TSchema & string>\n\t\t>\n{\n\tprivate readonly nodes: MapEntries<TSchema>;\n\tpublic readonly states: StatesWorkspace<TSchema>[\"states\"];\n\tpublic readonly notifications: AnyWorkspace<TSchema>[\"notifications\"];\n\n\tpublic readonly controls: RequiredBroadcastControl;\n\n\tpublic constructor(\n\t\tprivate readonly runtime: PresenceRuntime,\n\t\tprivate readonly datastore: ValueElementMap<TSchema>,\n\t\tinitialContent: TSchema,\n\t\tcontrolsSettings: BroadcastControlSettings | undefined,\n\t) {\n\t\tthis.controls = new RequiredBroadcastControl(defaultAllowableUpdateLatencyMs);\n\t\tif (controlsSettings?.allowableUpdateLatencyMs !== undefined) {\n\t\t\tthis.controls.allowableUpdateLatencyMs = controlsSettings.allowableUpdateLatencyMs;\n\t\t}\n\n\t\t// Prepare initial map content from initial state\n\t\t{\n\t\t\tconst attendeeId = this.runtime.attendeeId;\n\t\t\t// Empty record does not satisfy the type, but nodes will post loop.\n\t\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t\tconst nodes = {} as MapEntries<TSchema>;\n\t\t\tlet anyInitialValues = false;\n\t\t\tconst newValues: { [key: string]: InternalTypes.ValueDirectoryOrState<unknown> } = {};\n\t\t\tlet cumulativeAllowableUpdateLatencyMs: number | undefined;\n\t\t\tfor (const [key, nodeFactory] of Object.entries(initialContent)) {\n\t\t\t\tconst newNodeData = nodeFactory(key, handleFromDatastore(this));\n\t\t\t\tnodes[key as keyof TSchema] = newNodeData.manager;\n\t\t\t\tif (\"initialData\" in newNodeData) {\n\t\t\t\t\tconst { value, allowableUpdateLatencyMs } = newNodeData.initialData;\n\t\t\t\t\t(datastore[key] ??= {})[attendeeId] = value;\n\t\t\t\t\tnewValues[key] = value;\n\t\t\t\t\tif (allowableUpdateLatencyMs !== undefined) {\n\t\t\t\t\t\tcumulativeAllowableUpdateLatencyMs =\n\t\t\t\t\t\t\tcumulativeAllowableUpdateLatencyMs === undefined\n\t\t\t\t\t\t\t\t? allowableUpdateLatencyMs\n\t\t\t\t\t\t\t\t: Math.min(cumulativeAllowableUpdateLatencyMs, allowableUpdateLatencyMs);\n\t\t\t\t\t}\n\t\t\t\t\tanyInitialValues = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.nodes = nodes;\n\t\t\t// states and notifications are the public view of nodes that limits the entries\n\t\t\t// types to the public interface of State objects with an additional type\n\t\t\t// filter that beguiles the type system. So just reinterpret cast.\n\t\t\tconst properties = nodes as unknown as AnyWorkspace<TSchema>[\"states\"];\n\t\t\t// `AnyWorkspace` support comes from defining both `states` for\n\t\t\t// `StatesWorkspace` and `notifications` for `NotificationsWorkspace`.\n\t\t\t// `notifications` is always a subset of what `states` can be; so the same.\n\t\t\tthis.notifications = this.states = properties;\n\n\t\t\tif (anyInitialValues) {\n\t\t\t\tthis.runtime.localUpdate(newValues, {\n\t\t\t\t\tallowableUpdateLatencyMs:\n\t\t\t\t\t\tcumulativeAllowableUpdateLatencyMs ?? this.controls.allowableUpdateLatencyMs,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get presence(): Presence {\n\t\treturn this.runtime.presence;\n\t}\n\n\tpublic knownValues<Key extends keyof TSchema & string>(\n\t\tkey: Key,\n\t): {\n\t\tself: AttendeeId | undefined;\n\t\tstates: ClientRecord<ValidatableValueStructure<SchemaElementValueType<TSchema, Key>>>;\n\t} {\n\t\treturn {\n\t\t\tself: this.runtime.attendeeId,\n\t\t\t// Caller must only use `key`s that are part of `this.datastore`.\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tstates: castUnknownRecordToSchemaRecord(this.datastore[key]!),\n\t\t};\n\t}\n\n\tpublic localUpdate<Key extends keyof TSchema & string>(\n\t\tkey: Key,\n\t\tvalue: SchemaElementValueType<TSchema, Key> & ClientUpdateEntry,\n\t\toptions: LocalStateUpdateOptions,\n\t): void {\n\t\tthis.runtime.localUpdate(\n\t\t\t{ [key]: value },\n\t\t\t{\n\t\t\t\t...options,\n\t\t\t\tallowableUpdateLatencyMs:\n\t\t\t\t\toptions.allowableUpdateLatencyMs ?? this.controls.allowableUpdateLatencyMs,\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic update<Key extends keyof TSchema & string>(\n\t\tkey: Key,\n\t\tclientId: AttendeeId,\n\t\tvalue: ValidatableValueDirectoryOrState<unknown>,\n\t): void {\n\t\t// Callers my only use `key`s that are part of `this.datastore`.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tconst allKnownState = this.datastore[key]!;\n\t\tallKnownState[clientId] = mergeValueDirectory<unknown, ValidatableRequiredState<unknown>>(\n\t\t\tallKnownState[clientId],\n\t\t\tvalue,\n\t\t\t0,\n\t\t);\n\t}\n\n\tpublic add<\n\t\tTKey extends string,\n\t\tTValue extends InternalTypes.ValueDirectoryOrState<unknown>,\n\t\tTValueManager,\n\t>(\n\t\tkey: TKey,\n\t\tnodeFactory: InternalTypes.ManagerFactory<TKey, TValue, TValueManager>,\n\t): asserts this is StatesWorkspace<\n\t\tTSchema & Record<TKey, InternalTypes.ManagerFactory<TKey, TValue, TValueManager>>\n\t> {\n\t\tassert(!(key in this.nodes), 0xa3c /* Already have entry for key in map */);\n\t\tconst nodeData = nodeFactory(key, handleFromDatastore(this));\n\t\tthis.nodes[key] = nodeData.manager;\n\t\tif (\"initialData\" in nodeData) {\n\t\t\tconst { value, allowableUpdateLatencyMs } = nodeData.initialData;\n\t\t\tlet datastoreValue = this.datastore[key];\n\t\t\tif (datastoreValue === undefined) {\n\t\t\t\tdatastoreValue = this.datastore[key] = {};\n\t\t\t} else {\n\t\t\t\t// Already have received state from other clients. Kept in `all`.\n\t\t\t\t// TODO: Send current `all` state to state manager.\n\t\t\t}\n\t\t\tdatastoreValue[this.runtime.attendeeId] = value;\n\t\t\tthis.runtime.localUpdate(\n\t\t\t\t{ [key]: value },\n\t\t\t\t{\n\t\t\t\t\tallowableUpdateLatencyMs:\n\t\t\t\t\t\tallowableUpdateLatencyMs ?? this.controls.allowableUpdateLatencyMs,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic ensureContent<TSchemaAdditional extends StatesWorkspaceSchema>(\n\t\tcontent: TSchemaAdditional,\n\t\tcontrols: BroadcastControlSettings | undefined,\n\t): AnyWorkspace<TSchema & TSchemaAdditional> {\n\t\tif (controls?.allowableUpdateLatencyMs !== undefined) {\n\t\t\tthis.controls.allowableUpdateLatencyMs = controls.allowableUpdateLatencyMs;\n\t\t}\n\t\tfor (const [key, nodeFactory] of Object.entries(content)) {\n\t\t\tconst brandedIVM = this.nodes[key];\n\t\t\tif (brandedIVM === undefined) {\n\t\t\t\tthis.add(key, nodeFactory);\n\t\t\t} else {\n\t\t\t\tconst node = unbrandIVM(brandedIVM);\n\t\t\t\tif (!(node instanceof nodeFactory.instanceBase)) {\n\t\t\t\t\tthrow new TypeError(`State \"${key}\" previously created by different State object.`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this as AnyWorkspace<TSchema & TSchemaAdditional>;\n\t}\n\n\tpublic processUpdate(\n\t\treceived: number,\n\t\ttimeModifier: number,\n\t\tremoteDatastore: ValueUpdateRecord,\n\t): PostUpdateAction[] {\n\t\tconst postUpdateActions: PostUpdateAction[] = [];\n\t\tfor (const [key, remoteAllKnownState] of Object.entries(remoteDatastore)) {\n\t\t\tconst brandedIVM = this.nodes[key];\n\t\t\tif (brandedIVM === undefined) {\n\t\t\t\t// Assume all broadcast state is meant to be kept even if not currently registered.\n\t\t\t\tmergeUntrackedDatastore(key, remoteAllKnownState, this.datastore, timeModifier);\n\t\t\t} else {\n\t\t\t\tconst node = unbrandIVM(brandedIVM);\n\t\t\t\tfor (const [attendeeId, value] of objectEntries(remoteAllKnownState)) {\n\t\t\t\t\tconst client = this.runtime.presence.attendees.getAttendee(attendeeId);\n\t\t\t\t\tpostUpdateActions.push(...node.update(client, received, value));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn postUpdateActions;\n\t}\n}\n\n/**\n * Create a new Workspace using the DataStoreRuntime provided.\n * @param initialContent - The initial State objects to register.\n *\n * @internal\n */\nexport function createPresenceStates<TSchema extends StatesWorkspaceSchema>(\n\truntime: PresenceRuntime,\n\tdatastore: ValueElementMap<StatesWorkspaceSchema>,\n\tinitialContent: TSchema,\n\tcontrols: BroadcastControlSettings | undefined,\n): { public: AnyWorkspace<TSchema>; internal: PresenceStatesInternal } {\n\tconst impl = new PresenceStatesImpl<TSchema>(runtime, datastore, initialContent, controls);\n\n\treturn {\n\t\tpublic: impl,\n\t\tinternal: impl,\n\t};\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-internal/presence-runtime",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Core runtime implementation for Fluid Framework presence",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -14,50 +14,25 @@
|
|
|
14
14
|
"type": "module",
|
|
15
15
|
"exports": {
|
|
16
16
|
"./states": {
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
"default": "./lib/states/index.js"
|
|
20
|
-
},
|
|
21
|
-
"require": {
|
|
22
|
-
"types": "./dist/states/index.d.ts",
|
|
23
|
-
"default": "./dist/states/index.js"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"./extension": {
|
|
27
|
-
"import": "./lib/runtime/extension/index.js",
|
|
28
|
-
"require": "./dist/runtime/extension/index.js"
|
|
29
|
-
},
|
|
30
|
-
"./utils": {
|
|
31
|
-
"import": "./lib/utils/index.js",
|
|
32
|
-
"require": "./dist/utils/index.js"
|
|
33
|
-
},
|
|
34
|
-
"./workspace": {
|
|
35
|
-
"import": "./lib/workspace/index.js",
|
|
36
|
-
"require": "./dist/workspace/index.js"
|
|
17
|
+
"types": "./lib/states/index.d.ts",
|
|
18
|
+
"default": "./lib/states/index.js"
|
|
37
19
|
},
|
|
20
|
+
"./extension": "./lib/runtime/extension/index.js",
|
|
21
|
+
"./utils": "./lib/utils/index.js",
|
|
22
|
+
"./workspace": "./lib/workspace/index.js",
|
|
38
23
|
"./internal/protocol": {
|
|
39
24
|
"allow-ff-test-exports": {
|
|
40
|
-
"types":
|
|
41
|
-
"import": "./lib/runtime/protocol.d.ts",
|
|
42
|
-
"require": "./dist/runtime/protocol.d.ts"
|
|
43
|
-
}
|
|
25
|
+
"types": "./lib/runtime/protocol.d.ts"
|
|
44
26
|
}
|
|
45
27
|
},
|
|
46
28
|
"./internal/test": {
|
|
47
|
-
"allow-ff-test-exports":
|
|
48
|
-
"import": "./lib/runtime/test.js",
|
|
49
|
-
"require": "./dist/runtime/test.js"
|
|
50
|
-
}
|
|
29
|
+
"allow-ff-test-exports": "./lib/runtime/test.js"
|
|
51
30
|
},
|
|
52
31
|
"./internal/test-utils": {
|
|
53
|
-
"allow-ff-test-exports":
|
|
54
|
-
"import": "./lib/test/utils/index.js",
|
|
55
|
-
"require": "./dist/test/utils/index.js"
|
|
56
|
-
}
|
|
32
|
+
"allow-ff-test-exports": "./lib/test/utils/index.js"
|
|
57
33
|
}
|
|
58
34
|
},
|
|
59
35
|
"files": [
|
|
60
|
-
"dist/**/*",
|
|
61
36
|
"lib/**/*",
|
|
62
37
|
"!**/test/**/*"
|
|
63
38
|
],
|
|
@@ -66,13 +41,11 @@
|
|
|
66
41
|
"cache-dir": "nyc/.cache",
|
|
67
42
|
"exclude": [
|
|
68
43
|
"src/**/test/**/*.*ts",
|
|
69
|
-
"dist/**/test/**/*.*js",
|
|
70
44
|
"lib/**/test/**/*.*js"
|
|
71
45
|
],
|
|
72
46
|
"exclude-after-remap": false,
|
|
73
47
|
"include": [
|
|
74
48
|
"src/**/*.*ts",
|
|
75
|
-
"dist/**/*.*js",
|
|
76
49
|
"lib/**/*.*js"
|
|
77
50
|
],
|
|
78
51
|
"report-dir": "nyc/report",
|
|
@@ -84,27 +57,27 @@
|
|
|
84
57
|
"temp-directory": "nyc/.nyc_output"
|
|
85
58
|
},
|
|
86
59
|
"dependencies": {
|
|
87
|
-
"@fluid-internal/client-utils": "~
|
|
88
|
-
"@fluid-internal/presence-definitions": "~
|
|
89
|
-
"@fluidframework/container-definitions": "~
|
|
90
|
-
"@fluidframework/container-runtime-definitions": "~
|
|
91
|
-
"@fluidframework/core-interfaces": "~
|
|
92
|
-
"@fluidframework/core-utils": "~
|
|
93
|
-
"@fluidframework/id-compressor": "~
|
|
94
|
-
"@fluidframework/runtime-definitions": "~
|
|
95
|
-
"@fluidframework/telemetry-utils": "~
|
|
60
|
+
"@fluid-internal/client-utils": "~3.0.0",
|
|
61
|
+
"@fluid-internal/presence-definitions": "~3.0.0",
|
|
62
|
+
"@fluidframework/container-definitions": "~3.0.0",
|
|
63
|
+
"@fluidframework/container-runtime-definitions": "~3.0.0",
|
|
64
|
+
"@fluidframework/core-interfaces": "~3.0.0",
|
|
65
|
+
"@fluidframework/core-utils": "~3.0.0",
|
|
66
|
+
"@fluidframework/id-compressor": "~3.0.0",
|
|
67
|
+
"@fluidframework/runtime-definitions": "~3.0.0",
|
|
68
|
+
"@fluidframework/telemetry-utils": "~3.0.0"
|
|
96
69
|
},
|
|
97
70
|
"devDependencies": {
|
|
98
71
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
99
72
|
"@biomejs/biome": "~2.4.5",
|
|
100
|
-
"@fluid-internal/mocha-test-setup": "~
|
|
73
|
+
"@fluid-internal/mocha-test-setup": "~3.0.0",
|
|
101
74
|
"@fluid-tools/build-cli": "^0.67.0",
|
|
102
75
|
"@fluidframework/build-common": "^2.0.3",
|
|
103
76
|
"@fluidframework/build-tools": "^0.67.0",
|
|
104
|
-
"@fluidframework/driver-definitions": "~
|
|
77
|
+
"@fluidframework/driver-definitions": "~3.0.0",
|
|
105
78
|
"@fluidframework/eslint-config-fluid": "^14.0.0",
|
|
106
|
-
"@fluidframework/test-runtime-utils": "~
|
|
107
|
-
"@fluidframework/test-utils": "~
|
|
79
|
+
"@fluidframework/test-runtime-utils": "~3.0.0",
|
|
80
|
+
"@fluidframework/test-utils": "~3.0.0",
|
|
108
81
|
"@microsoft/api-extractor": "7.58.1",
|
|
109
82
|
"@types/mocha": "^10.0.10",
|
|
110
83
|
"@types/node": "~22.19.17",
|
|
@@ -119,7 +92,7 @@
|
|
|
119
92
|
"mocha-multi-reporters": "^1.5.1",
|
|
120
93
|
"rimraf": "^6.1.3",
|
|
121
94
|
"sinon": "^18.0.1",
|
|
122
|
-
"typescript": "~
|
|
95
|
+
"typescript": "~6.0.3"
|
|
123
96
|
},
|
|
124
97
|
"comments": [
|
|
125
98
|
"The internal/test-utils package export is generated by the Presence Runtime test builds. eslint depends on build:test:esm so tests can resolve self-imports through that export."
|
|
@@ -137,18 +110,15 @@
|
|
|
137
110
|
},
|
|
138
111
|
"scripts": {
|
|
139
112
|
"build": "fluid-build . --task build",
|
|
140
|
-
"build:commonjs": "fluid-build . --task commonjs",
|
|
141
113
|
"build:compile": "fluid-build . --task compile",
|
|
142
|
-
"build:
|
|
114
|
+
"build:esm": "tsc --project ./tsconfig.esm.json",
|
|
143
115
|
"build:genver": "gen-version",
|
|
144
|
-
"build:test": "
|
|
145
|
-
"build:test:cjs": "fluid-tsc commonjs --project ./tsconfig.test.cjs.json",
|
|
116
|
+
"build:test": "npm run build:test:esm",
|
|
146
117
|
"build:test:esm": "tsc --project ./tsconfig.test.esm.json",
|
|
147
|
-
"check:are-the-types-wrong": "attw --pack . --profile
|
|
118
|
+
"check:are-the-types-wrong": "attw --pack . --profile esm-only --exclude-entrypoints ./internal/protocol ./internal/test ./internal/test-utils",
|
|
148
119
|
"check:biome": "biome check .",
|
|
149
120
|
"check:exports": "concurrently \"npm:check:exports:*\"",
|
|
150
121
|
"check:exports:states:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-states-bundle.json",
|
|
151
|
-
"check:exports:states:cjs": "api-extractor run --config api-extractor/api-extractor-lint-states.cjs.json",
|
|
152
122
|
"check:exports:states:esm": "api-extractor run --config api-extractor/api-extractor-lint-states.esm.json",
|
|
153
123
|
"check:format": "npm run check:biome",
|
|
154
124
|
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
@@ -160,10 +130,8 @@
|
|
|
160
130
|
"lint:fix": "fluid-build . --task eslint:fix --task format",
|
|
161
131
|
"test": "npm run test:mocha",
|
|
162
132
|
"test:coverage": "c8 npm test",
|
|
163
|
-
"test:mocha": "npm run test:mocha:esm
|
|
164
|
-
"test:mocha:cjs": "cross-env FLUID_TEST_MODULE_SYSTEM=CJS \"MOCHA_SPEC=dist/**/*.spec.*js\" mocha",
|
|
133
|
+
"test:mocha": "npm run test:mocha:esm",
|
|
165
134
|
"test:mocha:esm": "cross-env \"MOCHA_SPEC=lib/**/*.spec.*js\" mocha",
|
|
166
|
-
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha"
|
|
167
|
-
"tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist"
|
|
135
|
+
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha"
|
|
168
136
|
}
|
|
169
137
|
}
|
package/dist/package.json
DELETED
package/dist/packageVersion.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*
|
|
5
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
|
-
*/
|
|
7
|
-
export declare const pkgName = "@fluid-internal/presence-runtime";
|
|
8
|
-
export declare const pkgVersion = "2.117.0";
|
|
9
|
-
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,YAAY,CAAC"}
|
package/dist/packageVersion.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*
|
|
6
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
|
-
exports.pkgName = "@fluid-internal/presence-runtime";
|
|
11
|
-
exports.pkgVersion = "2.117.0";
|
|
12
|
-
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,SAAS,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 = \"@fluid-internal/presence-runtime\";\nexport const pkgVersion = \"2.117.0\";\n"]}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import type { PresenceWithNotifications } from "@fluid-internal/presence-definitions";
|
|
6
|
-
import type { ContainerExtension, ContainerExtensionFactory, ExtensionInstantiationResult, ExtensionRuntimeProperties as GenericExtensionRuntimeProperties, InboundExtensionMessage } from "@fluidframework/container-runtime-definitions/internal";
|
|
7
|
-
import type { ExtensionCompatibilityDetails } from "@fluidframework/runtime-definitions/internal";
|
|
8
|
-
import type { SignalMessages } from "../protocol.js";
|
|
9
|
-
import type { ExtensionHost, ExtensionRuntimeProperties } from "../runtimeTypes.js";
|
|
10
|
-
/**
|
|
11
|
-
* Common Presence manager for a container
|
|
12
|
-
*/
|
|
13
|
-
declare class ContainerPresenceManager implements ContainerExtension<ExtensionRuntimeProperties>, ReturnType<ContainerExtensionFactory<PresenceWithNotifications, ExtensionRuntimeProperties>["instantiateExtension"]> {
|
|
14
|
-
readonly compatibility: {
|
|
15
|
-
readonly generation: 1;
|
|
16
|
-
readonly version: "2.117.0";
|
|
17
|
-
readonly capabilities: Set<never>;
|
|
18
|
-
};
|
|
19
|
-
readonly interface: PresenceWithNotifications;
|
|
20
|
-
readonly extension: this;
|
|
21
|
-
private readonly manager;
|
|
22
|
-
constructor(host: ExtensionHost);
|
|
23
|
-
handleVersionOrCapabilitiesMismatch<_TRequestedInterface>(ourExistingInstantiation: Readonly<ExtensionInstantiationResult<PresenceWithNotifications, ExtensionRuntimeProperties, []>>, newCompatibilityRequest: ExtensionCompatibilityDetails): never;
|
|
24
|
-
onNewUse(): void;
|
|
25
|
-
processSignal(addressChain: string[], message: InboundExtensionMessage<SignalMessages>, local: boolean): void;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* {@link ContainerExtensionId} for Presence
|
|
29
|
-
*
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
export declare const extensionId = "dis:bb89f4c0-80fd-4f0c-8469-4f2848ee7f4a";
|
|
33
|
-
/**
|
|
34
|
-
* {@link ContainerExtensionFactory|Factory} for Presence as {@link ContainerExtension}
|
|
35
|
-
*
|
|
36
|
-
* @internal
|
|
37
|
-
*/
|
|
38
|
-
export declare const ContainerPresenceFactory: {
|
|
39
|
-
readonly hostRequirements: {
|
|
40
|
-
readonly minSupportedGeneration: 1;
|
|
41
|
-
readonly requiredFeatures: readonly [];
|
|
42
|
-
};
|
|
43
|
-
readonly instanceExpectations: {
|
|
44
|
-
readonly version: "2.71.0";
|
|
45
|
-
readonly generation: 1;
|
|
46
|
-
readonly capabilities: Set<never>;
|
|
47
|
-
};
|
|
48
|
-
readonly resolvePriorInstantiation: (existingInstantiation: ExtensionInstantiationResult<unknown, GenericExtensionRuntimeProperties, unknown[]>) => never;
|
|
49
|
-
readonly instantiateExtension: (host: ExtensionHost) => ContainerPresenceManager;
|
|
50
|
-
readonly [Symbol.hasInstance]: (instance: unknown) => instance is ContainerPresenceManager;
|
|
51
|
-
};
|
|
52
|
-
export {};
|
|
53
|
-
//# sourceMappingURL=containerPresence.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"containerPresence.d.ts","sourceRoot":"","sources":["../../../src/runtime/extension/containerPresence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,KAAK,EACX,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,EAC5B,0BAA0B,IAAI,iCAAiC,EAC/D,uBAAuB,EACvB,MAAM,wDAAwD,CAAC;AAEhE,OAAO,KAAK,EAEX,6BAA6B,EAC7B,MAAM,8CAA8C,CAAC;AAItD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAoCpF;;GAEG;AACH,cAAM,wBACL,YACC,kBAAkB,CAAC,0BAA0B,CAAC,EAC9C,UAAU,CACT,yBAAyB,CACxB,yBAAyB,EACzB,0BAA0B,CAC1B,CAAC,sBAAsB,CAAC,CACzB;IAGF,SAAgB,aAAa;;;;MAAyB;IACtD,SAAgB,SAAS,EAAE,yBAAyB,CAAC;IACrD,SAAgB,SAAS,OAAQ;IAEjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;gBAElC,IAAI,EAAE,aAAa;IAS/B,mCAAmC,CAAC,oBAAoB,EAC9D,wBAAwB,EAAE,QAAQ,CACjC,4BAA4B,CAAC,yBAAyB,EAAE,0BAA0B,EAAE,EAAE,CAAC,CACvF,EACD,uBAAuB,EAAE,6BAA6B,GACpD,KAAK;IAWD,QAAQ,IAAI,IAAI;IAIhB,aAAa,CACnB,YAAY,EAAE,MAAM,EAAE,EACtB,OAAO,EAAE,uBAAuB,CAAC,cAAc,CAAC,EAChD,KAAK,EAAE,OAAO,GACZ,IAAI;CAGP;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,6CACkD,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;gEASZ,6BACtB,OAAO,EACP,iCAAiC,EACjC,OAAO,EAAE,CACT,KACC,KAAK;4DAQmC,wBAAwB;8CAIlC,OAAO;CAMxC,CAAC"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ContainerPresenceFactory = exports.extensionId = void 0;
|
|
8
|
-
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
|
-
const packageVersion_js_1 = require("../../packageVersion.js");
|
|
10
|
-
const presenceManager_js_1 = require("../presenceManager.js");
|
|
11
|
-
const presenceCompatibility = {
|
|
12
|
-
generation: 1,
|
|
13
|
-
version: packageVersion_js_1.pkgVersion,
|
|
14
|
-
capabilities: new Set([]),
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Minimal compatible package version.
|
|
18
|
-
* If an existing presence extension is registered with this version or higher,
|
|
19
|
-
* it can be used instead of instantiating new instance from this version of
|
|
20
|
-
* the package (assuming also capabilities are compatible).
|
|
21
|
-
*/
|
|
22
|
-
const minimalCompatiblePackageVersion = "2.71.0";
|
|
23
|
-
function assertCompatibilityInvariants(compatibility) {
|
|
24
|
-
(0, internal_1.assert)(compatibility.generation === presenceCompatibility.generation, 0xc97 /* Presence compatibility generation mismatch. */);
|
|
25
|
-
(0, internal_1.assert)(compatibility.version.startsWith("2."), 0xc98 /* Registered version is not major version 2. */);
|
|
26
|
-
(0, internal_1.assert)(Number.parseFloat(compatibility.version.slice(2)) <
|
|
27
|
-
Number.parseFloat(presenceCompatibility.version.slice(2)), 0xc99 /* Registered version is not less than the current version. */);
|
|
28
|
-
(0, internal_1.assert)(presenceCompatibility.capabilities.size === 0, 0xc9a /* Presence capabilities should be empty. */);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Common Presence manager for a container
|
|
32
|
-
*/
|
|
33
|
-
class ContainerPresenceManager {
|
|
34
|
-
constructor(host) {
|
|
35
|
-
// ContainerExtensionFactory return elements
|
|
36
|
-
this.compatibility = presenceCompatibility;
|
|
37
|
-
this.extension = this;
|
|
38
|
-
this.interface = this.manager = (0, presenceManager_js_1.createPresenceManager)({
|
|
39
|
-
...host,
|
|
40
|
-
submitSignal: (message) => {
|
|
41
|
-
host.submitAddressedSignal([], message);
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
handleVersionOrCapabilitiesMismatch(ourExistingInstantiation, newCompatibilityRequest) {
|
|
46
|
-
(0, internal_1.assert)(ourExistingInstantiation.compatibility === presenceCompatibility, 0xc9b /* Presence extension called without own compatibility details */);
|
|
47
|
-
assertCompatibilityInvariants(newCompatibilityRequest);
|
|
48
|
-
// There have not yet been any changes that would require action to upgrade.
|
|
49
|
-
// But also mixed runtime versions are not yet expected.
|
|
50
|
-
(0, internal_1.fail)(0xcb1 /* Presence is only expected to be accessed with a single version. */);
|
|
51
|
-
}
|
|
52
|
-
onNewUse() {
|
|
53
|
-
// No-op
|
|
54
|
-
}
|
|
55
|
-
processSignal(addressChain, message, local) {
|
|
56
|
-
this.manager.processSignal(addressChain, message, local);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* {@link ContainerExtensionId} for Presence
|
|
61
|
-
*
|
|
62
|
-
* @internal
|
|
63
|
-
*/
|
|
64
|
-
exports.extensionId = "dis:bb89f4c0-80fd-4f0c-8469-4f2848ee7f4a";
|
|
65
|
-
/**
|
|
66
|
-
* {@link ContainerExtensionFactory|Factory} for Presence as {@link ContainerExtension}
|
|
67
|
-
*
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
exports.ContainerPresenceFactory = {
|
|
71
|
-
hostRequirements: {
|
|
72
|
-
minSupportedGeneration: 1,
|
|
73
|
-
requiredFeatures: [],
|
|
74
|
-
},
|
|
75
|
-
instanceExpectations: { ...presenceCompatibility, version: minimalCompatiblePackageVersion },
|
|
76
|
-
resolvePriorInstantiation(existingInstantiation) {
|
|
77
|
-
// Validate assumptions about existing instance
|
|
78
|
-
assertCompatibilityInvariants(existingInstantiation.compatibility);
|
|
79
|
-
// There have not yet been any changes that would require action to upgrade.
|
|
80
|
-
// But also mixed runtime versions are not yet expected.
|
|
81
|
-
(0, internal_1.fail)(0xcb2 /* Presence is only expected to be accessed with a single version. */);
|
|
82
|
-
},
|
|
83
|
-
instantiateExtension(host) {
|
|
84
|
-
return new ContainerPresenceManager(host);
|
|
85
|
-
},
|
|
86
|
-
[Symbol.hasInstance]: (instance) => {
|
|
87
|
-
return instance instanceof ContainerPresenceManager;
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
//# sourceMappingURL=containerPresence.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"containerPresence.js","sourceRoot":"","sources":["../../../src/runtime/extension/containerPresence.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,kEAAmE;AAMnE,+DAAqD;AACrD,8DAA+F;AAI/F,MAAM,qBAAqB,GAAG;IAC7B,UAAU,EAAE,CAAC;IACb,OAAO,EAAE,8BAAU;IACnB,YAAY,EAAE,IAAI,GAAG,CAAC,EAAE,CAAC;CACwB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,+BAA+B,GAAG,QAAQ,CAAC;AAEjD,SAAS,6BAA6B,CAAC,aAA4C;IAClF,IAAA,iBAAM,EACL,aAAa,CAAC,UAAU,KAAK,qBAAqB,CAAC,UAAU,EAC7D,KAAK,CAAC,iDAAiD,CACvD,CAAC;IACF,IAAA,iBAAM,EACL,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,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;;GAIG;AACU,QAAA,WAAW,GACvB,0CAAyE,CAAC;AAE3E;;;;GAIG;AACU,QAAA,wBAAwB,GAAG;IACvC,gBAAgB,EAAE;QACjB,sBAAsB,EAAE,CAAC;QACzB,gBAAgB,EAAE,EAAE;KAC+B;IAEpD,oBAAoB,EAAE,EAAE,GAAG,qBAAqB,EAAE,OAAO,EAAE,+BAA+B,EAAE;IAE5F,yBAAyB,CACxB,qBAIC;QAED,+CAA+C;QAC/C,6BAA6B,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;QACnE,4EAA4E;QAC5E,wDAAwD;QACxD,IAAA,eAAI,EAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;IACnF,CAAC;IAED,oBAAoB,CAAC,IAAmB;QACvC,OAAO,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,QAAiB,EAAwC,EAAE;QACjF,OAAO,QAAQ,YAAY,wBAAwB,CAAC;IACrD,CAAC;CAID,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ILayerCompatSupportRequirements } from \"@fluid-internal/client-utils\";\nimport type { PresenceWithNotifications } from \"@fluid-internal/presence-definitions\";\nimport type {\n\tContainerExtension,\n\tContainerExtensionFactory,\n\tExtensionInstantiationResult,\n\tExtensionRuntimeProperties as GenericExtensionRuntimeProperties,\n\tInboundExtensionMessage,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tContainerExtensionId,\n\tExtensionCompatibilityDetails,\n} from \"@fluidframework/runtime-definitions/internal\";\n\nimport { pkgVersion } from \"../../packageVersion.js\";\nimport { createPresenceManager, type PresenceExtensionInterface } from \"../presenceManager.js\";\nimport type { SignalMessages } from \"../protocol.js\";\nimport type { ExtensionHost, ExtensionRuntimeProperties } from \"../runtimeTypes.js\";\n\nconst presenceCompatibility = {\n\tgeneration: 1,\n\tversion: pkgVersion,\n\tcapabilities: new Set([]),\n} as const satisfies ExtensionCompatibilityDetails;\n\n/**\n * Minimal compatible package version.\n * If an existing presence extension is registered with this version or higher,\n * it can be used instead of instantiating new instance from this version of\n * the package (assuming also capabilities are compatible).\n */\nconst minimalCompatiblePackageVersion = \"2.71.0\";\n\nfunction assertCompatibilityInvariants(compatibility: ExtensionCompatibilityDetails): void {\n\tassert(\n\t\tcompatibility.generation === presenceCompatibility.generation,\n\t\t0xc97 /* Presence compatibility generation mismatch. */,\n\t);\n\tassert(\n\t\tcompatibility.version.startsWith(\"2.\"),\n\t\t0xc98 /* Registered version is not major version 2. */,\n\t);\n\tassert(\n\t\tNumber.parseFloat(compatibility.version.slice(2)) <\n\t\t\tNumber.parseFloat(presenceCompatibility.version.slice(2)),\n\t\t0xc99 /* Registered version is not less than the current version. */,\n\t);\n\tassert(\n\t\tpresenceCompatibility.capabilities.size === 0,\n\t\t0xc9a /* Presence capabilities should be empty. */,\n\t);\n}\n\n/**\n * Common Presence manager for a container\n */\nclass ContainerPresenceManager\n\timplements\n\t\tContainerExtension<ExtensionRuntimeProperties>,\n\t\tReturnType<\n\t\t\tContainerExtensionFactory<\n\t\t\t\tPresenceWithNotifications,\n\t\t\t\tExtensionRuntimeProperties\n\t\t\t>[\"instantiateExtension\"]\n\t\t>\n{\n\t// ContainerExtensionFactory return elements\n\tpublic readonly compatibility = presenceCompatibility;\n\tpublic readonly interface: PresenceWithNotifications;\n\tpublic readonly extension = this;\n\n\tprivate readonly manager: PresenceExtensionInterface;\n\n\tpublic constructor(host: ExtensionHost) {\n\t\tthis.interface = this.manager = createPresenceManager({\n\t\t\t...host,\n\t\t\tsubmitSignal: (message) => {\n\t\t\t\thost.submitAddressedSignal([], message);\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic handleVersionOrCapabilitiesMismatch<_TRequestedInterface>(\n\t\tourExistingInstantiation: Readonly<\n\t\t\tExtensionInstantiationResult<PresenceWithNotifications, ExtensionRuntimeProperties, []>\n\t\t>,\n\t\tnewCompatibilityRequest: ExtensionCompatibilityDetails,\n\t): never {\n\t\tassert(\n\t\t\tourExistingInstantiation.compatibility === presenceCompatibility,\n\t\t\t0xc9b /* Presence extension called without own compatibility details */,\n\t\t);\n\t\tassertCompatibilityInvariants(newCompatibilityRequest);\n\t\t// There have not yet been any changes that would require action to upgrade.\n\t\t// But also mixed runtime versions are not yet expected.\n\t\tfail(0xcb1 /* Presence is only expected to be accessed with a single version. */);\n\t}\n\n\tpublic onNewUse(): void {\n\t\t// No-op\n\t}\n\n\tpublic processSignal(\n\t\taddressChain: string[],\n\t\tmessage: InboundExtensionMessage<SignalMessages>,\n\t\tlocal: boolean,\n\t): void {\n\t\tthis.manager.processSignal(addressChain, message, local);\n\t}\n}\n\n/**\n * {@link ContainerExtensionId} for Presence\n *\n * @internal\n */\nexport const extensionId =\n\t\"dis:bb89f4c0-80fd-4f0c-8469-4f2848ee7f4a\" satisfies ContainerExtensionId;\n\n/**\n * {@link ContainerExtensionFactory|Factory} for Presence as {@link ContainerExtension}\n *\n * @internal\n */\nexport const ContainerPresenceFactory = {\n\thostRequirements: {\n\t\tminSupportedGeneration: 1,\n\t\trequiredFeatures: [],\n\t} as const satisfies ILayerCompatSupportRequirements,\n\n\tinstanceExpectations: { ...presenceCompatibility, version: minimalCompatiblePackageVersion },\n\n\tresolvePriorInstantiation(\n\t\texistingInstantiation: ExtensionInstantiationResult<\n\t\t\tunknown,\n\t\t\tGenericExtensionRuntimeProperties,\n\t\t\tunknown[]\n\t\t>,\n\t): never {\n\t\t// Validate assumptions about existing instance\n\t\tassertCompatibilityInvariants(existingInstantiation.compatibility);\n\t\t// There have not yet been any changes that would require action to upgrade.\n\t\t// But also mixed runtime versions are not yet expected.\n\t\tfail(0xcb2 /* Presence is only expected to be accessed with a single version. */);\n\t},\n\n\tinstantiateExtension(host: ExtensionHost): ContainerPresenceManager {\n\t\treturn new ContainerPresenceManager(host);\n\t},\n\n\t[Symbol.hasInstance]: (instance: unknown): instance is ContainerPresenceManager => {\n\t\treturn instance instanceof ContainerPresenceManager;\n\t},\n} as const satisfies ContainerExtensionFactory<\n\tPresenceWithNotifications,\n\tExtensionRuntimeProperties\n>;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/extension/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.extensionId = exports.ContainerPresenceFactory = void 0;
|
|
8
|
-
var containerPresence_js_1 = require("./containerPresence.js");
|
|
9
|
-
Object.defineProperty(exports, "ContainerPresenceFactory", { enumerable: true, get: function () { return containerPresence_js_1.ContainerPresenceFactory; } });
|
|
10
|
-
Object.defineProperty(exports, "extensionId", { enumerable: true, get: function () { return containerPresence_js_1.extensionId; } });
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/extension/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA+E;AAAtE,gIAAA,wBAAwB,OAAA;AAAE,mHAAA,WAAW,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ContainerPresenceFactory, extensionId } from \"./containerPresence.js\";\n"]}
|