@plitzi/sdk-shared 0.32.25 → 0.33.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/CHANGELOG.md +6 -0
- package/dist/auth/authFailureLink.d.ts +9 -0
- package/dist/auth/authFailureLink.mjs +20 -0
- package/dist/auth/failureChannel.d.ts +31 -0
- package/dist/auth/failureChannel.mjs +26 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.mjs +3 -0
- package/dist/connectors/constants.d.ts +28 -0
- package/dist/connectors/constants.mjs +29 -0
- package/dist/connectors/index.d.ts +7 -0
- package/dist/connectors/index.mjs +5 -0
- package/dist/connectors/manifestTokens.d.ts +17 -0
- package/dist/connectors/manifestTokens.mjs +70 -0
- package/dist/connectors/presets.d.ts +22 -0
- package/dist/connectors/presets.mjs +220 -0
- package/dist/connectors/validateManifest.d.ts +28 -0
- package/dist/connectors/validateManifest.mjs +183 -0
- package/dist/dataSource/getBindingsDetails.mjs +1 -1
- package/dist/hooks/useNetwork.mjs +32 -26
- package/dist/hooks/usePlitziServiceContext.d.ts +1 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +47 -40
- package/dist/navigation/index.d.ts +4 -0
- package/dist/navigation/index.mjs +3 -0
- package/dist/navigation/matchPath.d.ts +12 -0
- package/dist/navigation/matchPath.mjs +42 -0
- package/dist/navigation/routes.d.ts +28 -0
- package/dist/navigation/routes.mjs +124 -0
- package/dist/network/NetworkContext.d.ts +5 -3
- package/dist/network/NetworkInternalContext.d.ts +1 -2
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceAddConnectorMutation.d.ts +8 -0
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceAddConnectorMutation.mjs +16 -0
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceRemoveConnectorMutation.d.ts +8 -0
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceRemoveConnectorMutation.mjs +12 -0
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceUpdateConnectorMutation.d.ts +8 -0
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceUpdateConnectorMutation.mjs +16 -0
- package/dist/network/graphql/builder/Mutations/index.d.ts +9 -18
- package/dist/network/graphql/builder/Mutations/index.mjs +150 -156
- package/dist/network/graphql/builder/Queries/InitQuery.d.ts +1 -4
- package/dist/network/graphql/builder/Queries/InitQuery.mjs +2 -33
- package/dist/network/graphql/builder/Queries/Space/SpaceConnectorsQuery.d.ts +9 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceConnectorsQuery.mjs +25 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.mjs +1 -0
- package/dist/network/graphql/builder/Queries/index.d.ts +3 -12
- package/dist/network/graphql/builder/Queries/index.mjs +22 -28
- package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.d.ts +19 -0
- package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.mjs +12 -0
- package/dist/network/graphql/builder/Subscriptions/index.d.ts +4 -163
- package/dist/network/graphql/builder/Subscriptions/index.mjs +3 -109
- package/dist/network/graphql/builder/index.d.ts +2 -2
- package/dist/network/graphql/builder/index.mjs +1 -1
- package/dist/network/graphql/index.mjs +1 -1
- package/dist/network/graphql/sdk/Mutations/index.d.ts +2 -13
- package/dist/network/graphql/sdk/Mutations/index.mjs +2 -9
- package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +1 -4
- package/dist/network/graphql/sdk/Queries/InitQuery.mjs +1 -13
- package/dist/network/graphql/sdk/Queries/index.d.ts +0 -12
- package/dist/network/graphql/sdk/Queries/index.mjs +8 -16
- package/dist/network/index.d.ts +3 -1
- package/dist/network/index.mjs +7 -6
- package/dist/network/spaceEvents.d.ts +405 -0
- package/dist/network/spaceEvents.mjs +244 -0
- package/dist/server/index.d.ts +5 -5
- package/dist/server/index.mjs +4 -3
- package/dist/server/rsc/refreshRsc.d.ts +16 -0
- package/dist/server/rsc/refreshRsc.mjs +16 -0
- package/dist/server/rsc/useRscRefresh.d.ts +2 -0
- package/dist/server/rsc/useRscRefresh.mjs +10 -0
- package/dist/server/rsc/useRscSync.d.ts +11 -0
- package/dist/server/rsc/useRscSync.mjs +20 -0
- package/dist/store/index.d.ts +54 -53
- package/dist/store/index.mjs +4 -3
- package/dist/store/renderSettings.d.ts +26 -0
- package/dist/store/renderSettings.mjs +39 -0
- package/dist/types/AuthTypes.d.ts +33 -3
- package/dist/types/BuilderTypes.d.ts +15 -0
- package/dist/types/CollectionTypes.d.ts +3 -49
- package/dist/types/CommonTypes.d.ts +17 -2
- package/dist/types/ConnectorTypes.d.ts +147 -0
- package/dist/types/ConnectorTypes.mjs +0 -0
- package/dist/types/DevToolsTypes.d.ts +18 -3
- package/dist/types/InteractionTypes.d.ts +1 -1
- package/dist/types/McpTypes/index.d.ts +0 -4
- package/dist/types/NavigationTypes.d.ts +0 -10
- package/dist/types/SchemaTypes.d.ts +27 -5
- package/dist/types/SdkTypes.d.ts +19 -2
- package/dist/types/ServerTypes.d.ts +296 -103
- package/dist/types/SpaceTypes.d.ts +17 -1
- package/dist/types/StoreTypes.d.ts +36 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/websockets/RTCodec.d.ts +6 -0
- package/package.json +108 -309
- package/vite.config.ts +21 -1
- package/dist/collections/CollectionContext.d.ts +0 -2
- package/dist/collections/CollectionContext.mjs +0 -5
- package/dist/collections/index.d.ts +0 -3
- package/dist/collections/index.mjs +0 -2
- package/dist/network/graphql/builder/Mutations/Collection/CollectionAddMutation.d.ts +0 -4
- package/dist/network/graphql/builder/Mutations/Collection/CollectionAddMutation.mjs +0 -24
- package/dist/network/graphql/builder/Mutations/Collection/CollectionAddRecordMutation.d.ts +0 -4
- package/dist/network/graphql/builder/Mutations/Collection/CollectionAddRecordMutation.mjs +0 -16
- package/dist/network/graphql/builder/Mutations/Collection/CollectionRemoveMutation.d.ts +0 -4
- package/dist/network/graphql/builder/Mutations/Collection/CollectionRemoveMutation.mjs +0 -17
- package/dist/network/graphql/builder/Mutations/Collection/CollectionRemoveRecordMutation.d.ts +0 -4
- package/dist/network/graphql/builder/Mutations/Collection/CollectionRemoveRecordMutation.mjs +0 -14
- package/dist/network/graphql/builder/Mutations/Collection/CollectionUpdateMutation.d.ts +0 -4
- package/dist/network/graphql/builder/Mutations/Collection/CollectionUpdateMutation.mjs +0 -32
- package/dist/network/graphql/builder/Mutations/Collection/CollectionUpdateRecordMutation.d.ts +0 -4
- package/dist/network/graphql/builder/Mutations/Collection/CollectionUpdateRecordMutation.mjs +0 -16
- package/dist/network/graphql/builder/Queries/Collection/CollectionQuery.d.ts +0 -6
- package/dist/network/graphql/builder/Queries/Collection/CollectionQuery.mjs +0 -35
- package/dist/network/graphql/builder/Queries/Collection/CollectionRecordQuery.d.ts +0 -6
- package/dist/network/graphql/builder/Queries/Collection/CollectionRecordQuery.mjs +0 -16
- package/dist/network/graphql/builder/Queries/Collection/CollectionRecordsQuery.d.ts +0 -9
- package/dist/network/graphql/builder/Queries/Collection/CollectionRecordsQuery.mjs +0 -27
- package/dist/network/graphql/builder/Queries/Collection/CollectionsQuery.d.ts +0 -9
- package/dist/network/graphql/builder/Queries/Collection/CollectionsQuery.mjs +0 -37
- package/dist/network/graphql/builder/Subscriptions/Collaborator/CollaboratorConnectedSubscription.d.ts +0 -11
- package/dist/network/graphql/builder/Subscriptions/Collaborator/CollaboratorConnectedSubscription.mjs +0 -17
- package/dist/network/graphql/builder/Subscriptions/Collaborator/CollaboratorDisconnectedSubscription.d.ts +0 -11
- package/dist/network/graphql/builder/Subscriptions/Collaborator/CollaboratorDisconnectedSubscription.mjs +0 -17
- package/dist/network/graphql/builder/Subscriptions/Segment/SegmentAddTemplateSubscription.d.ts +0 -2
- package/dist/network/graphql/builder/Subscriptions/Segment/SegmentAddTemplateSubscription.mjs +0 -41
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentAddElementSubscription.d.ts +0 -11
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentAddElementSubscription.mjs +0 -40
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentCloneElementSubscription.d.ts +0 -10
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentCloneElementSubscription.mjs +0 -30
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentMoveElementSubscription.d.ts +0 -10
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentMoveElementSubscription.mjs +0 -15
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentRemoveElementSubscription.d.ts +0 -6
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentRemoveElementSubscription.mjs +0 -12
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentUpdateElementSubscription.d.ts +0 -11
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentUpdateElementSubscription.mjs +0 -27
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentUpdateElementsSubscription.d.ts +0 -7
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentUpdateElementsSubscription.mjs +0 -27
- package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceAddVariableSubscription.d.ts +0 -7
- package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceAddVariableSubscription.mjs +0 -21
- package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceRemoveVariableSubscription.d.ts +0 -7
- package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceRemoveVariableSubscription.mjs +0 -14
- package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceUpdateVariableSubscription.d.ts +0 -7
- package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceUpdateVariableSubscription.mjs +0 -21
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableSubscription.d.ts +0 -11
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableSubscription.mjs +0 -16
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableSubscription.d.ts +0 -10
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableSubscription.mjs +0 -15
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableSubscription.d.ts +0 -11
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableSubscription.mjs +0 -16
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleAddSelectorSubscription.d.ts +0 -17
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleAddSelectorSubscription.mjs +0 -17
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleRemoveSelectorSubscription.d.ts +0 -8
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleRemoveSelectorSubscription.mjs +0 -13
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleRemoveSelectorsSubscription.d.ts +0 -8
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleRemoveSelectorsSubscription.mjs +0 -13
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleUpdateSelectorSubscription.d.ts +0 -16
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleUpdateSelectorSubscription.mjs +0 -17
- package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleAddVariableSubscription.d.ts +0 -9
- package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleAddVariableSubscription.mjs +0 -14
- package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleRemoveVariableSubscription.d.ts +0 -8
- package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleRemoveVariableSubscription.mjs +0 -13
- package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleUpdateVariableSubscription.d.ts +0 -9
- package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleUpdateVariableSubscription.mjs +0 -14
- package/dist/network/graphql/builder/Subscriptions/Space/SpaceAddTemplateSubscription.d.ts +0 -11
- package/dist/network/graphql/builder/Subscriptions/Space/SpaceAddTemplateSubscription.mjs +0 -40
- package/dist/network/graphql/builder/Subscriptions/Space/SpaceUpdateSettingsSubscription.d.ts +0 -6
- package/dist/network/graphql/builder/Subscriptions/Space/SpaceUpdateSettingsSubscription.mjs +0 -12
- package/dist/network/graphql/builder/Subscriptions/Space/SpaceUpdatedSubscription.d.ts +0 -6
- package/dist/network/graphql/builder/Subscriptions/Space/SpaceUpdatedSubscription.mjs +0 -29
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceAddElementSubscription.d.ts +0 -10
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceAddElementSubscription.mjs +0 -39
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceCloneElementSubscription.d.ts +0 -9
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceCloneElementSubscription.mjs +0 -29
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceMoveElementSubscription.d.ts +0 -9
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceMoveElementSubscription.mjs +0 -14
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceRemoveElementSubscription.d.ts +0 -5
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceRemoveElementSubscription.mjs +0 -11
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceUpdateElementSubscription.d.ts +0 -6
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceUpdateElementSubscription.mjs +0 -26
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceUpdateElementsSubscription.d.ts +0 -6
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceUpdateElementsSubscription.mjs +0 -26
- package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceAddPageFolderSubscription.d.ts +0 -6
- package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceAddPageFolderSubscription.mjs +0 -16
- package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceRemovePageFolderSubscription.d.ts +0 -5
- package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceRemovePageFolderSubscription.mjs +0 -11
- package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceUpdatePageFolderSubscription.d.ts +0 -6
- package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceUpdatePageFolderSubscription.mjs +0 -16
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceAddPageSubscription.d.ts +0 -6
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceAddPageSubscription.mjs +0 -26
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceHomePageSubscription.d.ts +0 -6
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceHomePageSubscription.mjs +0 -26
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceRemovePageSubscription.d.ts +0 -5
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceRemovePageSubscription.mjs +0 -11
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceUpdatePageSubscription.d.ts +0 -6
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceUpdatePageSubscription.mjs +0 -26
- package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceAddVariableSubscription.d.ts +0 -6
- package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceAddVariableSubscription.mjs +0 -20
- package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceRemoveVariableSubscription.d.ts +0 -5
- package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceRemoveVariableSubscription.mjs +0 -11
- package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceUpdateVariableSubscription.d.ts +0 -6
- package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceUpdateVariableSubscription.mjs +0 -20
- package/dist/network/graphql/builder/Subscriptions/Style/StyleUpdateSettingsSubscription.d.ts +0 -6
- package/dist/network/graphql/builder/Subscriptions/Style/StyleUpdateSettingsSubscription.mjs +0 -12
- package/dist/network/graphql/builder/Subscriptions/Style/StyleUpdatedSubscription.d.ts +0 -4
- package/dist/network/graphql/builder/Subscriptions/Style/StyleUpdatedSubscription.mjs +0 -13
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleAddSelectorSubscription.d.ts +0 -16
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleAddSelectorSubscription.mjs +0 -16
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleRemoveSelectorSubscription.d.ts +0 -7
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleRemoveSelectorSubscription.mjs +0 -12
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleRemoveSelectorsSubscription.d.ts +0 -7
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleRemoveSelectorsSubscription.mjs +0 -12
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleUpdateSelectorSubscription.d.ts +0 -15
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleUpdateSelectorSubscription.mjs +0 -16
- package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleAddSelectorVariableSubscription.d.ts +0 -10
- package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleAddSelectorVariableSubscription.mjs +0 -15
- package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleRemoveSelectorVariableSubscription.d.ts +0 -9
- package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleRemoveSelectorVariableSubscription.mjs +0 -14
- package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleUpdateSelectorVariableSubscription.d.ts +0 -10
- package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleUpdateSelectorVariableSubscription.mjs +0 -15
- package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleAddVariableSubscription.d.ts +0 -8
- package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleAddVariableSubscription.mjs +0 -13
- package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleRemoveVariableSubscription.d.ts +0 -7
- package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleRemoveVariableSubscription.mjs +0 -12
- package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleUpdateVariableSubscription.d.ts +0 -8
- package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleUpdateVariableSubscription.mjs +0 -13
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionAddMutation.d.ts +0 -2
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionAddRecordMutation.d.ts +0 -4
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionAddRecordMutation.mjs +0 -16
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionRemoveMutation.d.ts +0 -2
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionRemoveRecordMutation.d.ts +0 -4
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionRemoveRecordMutation.mjs +0 -14
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionUpdateMutation.d.ts +0 -2
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionUpdateRecordMutation.d.ts +0 -4
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionUpdateRecordMutation.mjs +0 -16
- package/dist/network/graphql/sdk/Queries/Collection/CollectionQuery.d.ts +0 -6
- package/dist/network/graphql/sdk/Queries/Collection/CollectionQuery.mjs +0 -32
- package/dist/network/graphql/sdk/Queries/Collection/CollectionRecordQuery.d.ts +0 -6
- package/dist/network/graphql/sdk/Queries/Collection/CollectionRecordQuery.mjs +0 -14
- package/dist/network/graphql/sdk/Queries/Collection/CollectionRecordsQuery.d.ts +0 -9
- package/dist/network/graphql/sdk/Queries/Collection/CollectionRecordsQuery.mjs +0 -25
- package/dist/network/graphql/sdk/Queries/Collection/CollectionsQuery.d.ts +0 -9
- package/dist/network/graphql/sdk/Queries/Collection/CollectionsQuery.mjs +0 -25
- package/dist/server/rsc/RscContext.d.ts +0 -13
- package/dist/server/rsc/RscContext.mjs +0 -5
- package/dist/server/rsc/RscProvider.d.ts +0 -13
- package/dist/server/rsc/RscProvider.mjs +0 -42
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Environment } from './CommonTypes';
|
|
2
|
-
import {
|
|
2
|
+
import { ConnectorEntry } from './ConnectorTypes';
|
|
3
3
|
import { Schema } from './SchemaTypes';
|
|
4
|
-
import { OfflineDataRaw } from './SdkTypes';
|
|
4
|
+
import { AnalyticsConfig, OfflineDataRaw } from './SdkTypes';
|
|
5
5
|
import { Style } from './StyleTypes';
|
|
6
6
|
import { IncomingHttpHeaders } from 'node:http';
|
|
7
7
|
import { FC } from 'react';
|
|
@@ -27,8 +27,11 @@ export type SSRRequest = {
|
|
|
27
27
|
};
|
|
28
28
|
export type SSRResponseHelpers = {
|
|
29
29
|
status: number;
|
|
30
|
-
headers
|
|
31
|
-
|
|
30
|
+
/** Multi-valued for the headers that genuinely are, `Set-Cookie` above all — see `setHeader`. */
|
|
31
|
+
headers: Record<string, string | string[]>;
|
|
32
|
+
/** An array sets the header once per entry, which `Set-Cookie` needs: a response that grants a session writes
|
|
33
|
+
* several, and collapsing them into one string would produce a single malformed cookie. */
|
|
34
|
+
setHeader: (name: string, value: string | string[]) => void;
|
|
32
35
|
setStatus: (code: number) => void;
|
|
33
36
|
send: (body: string) => void;
|
|
34
37
|
write: (chunk: string | Buffer) => void;
|
|
@@ -92,8 +95,50 @@ export type SSRPlugin = {
|
|
|
92
95
|
component: FC;
|
|
93
96
|
props: Record<string, unknown>;
|
|
94
97
|
};
|
|
98
|
+
/** What a space token is worth. `render` is the public credential every published site embeds — it is readable
|
|
99
|
+
* by anyone who views the page, so it may only read. `agent` is the delegated grant an MCP connector receives
|
|
100
|
+
* after a member consents, and is the only bearer that may write without a session behind it. */
|
|
101
|
+
export type SpaceScope = 'render' | 'agent';
|
|
102
|
+
/** A resolved space token: which space, what the bearer may do, and (for `agent`) the member who consented.
|
|
103
|
+
* `canWrite` is computed by the consumer from its own authorization model — the MCP never derives it. */
|
|
104
|
+
export type SSRGrant = {
|
|
105
|
+
spaceId: number;
|
|
106
|
+
scope: SpaceScope;
|
|
107
|
+
userId?: number;
|
|
108
|
+
canWrite: boolean;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* A session, as the thing that issued it describes it. Deliberately free of transport: whoever mints one says what
|
|
112
|
+
* the credentials are and when they die, and the server decides how they are carried — which is what lets a
|
|
113
|
+
* deployment bring its own identity source without also reimplementing cookies.
|
|
114
|
+
*/
|
|
115
|
+
export type SSRSession = {
|
|
116
|
+
token: string;
|
|
117
|
+
/** Unix seconds. */
|
|
118
|
+
expiresAt: number;
|
|
119
|
+
refreshToken?: string;
|
|
120
|
+
refreshExpiresAt?: number;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* How this deployment's session cookies are named and scoped. Every field has a working default derived from the
|
|
124
|
+
* request host, so a server that says nothing still gets a correct cookie; the function forms exist for deployments
|
|
125
|
+
* whose naming varies by environment or host, which is a policy only they know.
|
|
126
|
+
*/
|
|
127
|
+
export type SSRAuthCookie = {
|
|
128
|
+
name?: string | ((hostname: string) => string);
|
|
129
|
+
/** Return undefined for a host-only cookie. Defaults to the registrable domain, so sibling sub-domains share it. */
|
|
130
|
+
domain?: string | ((hostname: string) => string | undefined);
|
|
131
|
+
sameSite?: 'lax' | 'none';
|
|
132
|
+
secure?: boolean;
|
|
133
|
+
/** Path the refresh credential is confined to, so it never rides along on ordinary traffic. Defaults to `/auth`. */
|
|
134
|
+
refreshPath?: string;
|
|
135
|
+
/** Suffix of the readable companion cookie that carries only expiries. Defaults to `_hint`. */
|
|
136
|
+
hintSuffix?: string;
|
|
137
|
+
};
|
|
95
138
|
export type SSRUser = {
|
|
96
139
|
token: string;
|
|
140
|
+
/** Unix seconds the token dies at, so the rendered page can renew ahead of it rather than on a refusal. */
|
|
141
|
+
expiresAt?: number;
|
|
97
142
|
id: number;
|
|
98
143
|
username: string;
|
|
99
144
|
email: string;
|
|
@@ -102,10 +147,25 @@ export type SSRUser = {
|
|
|
102
147
|
roles: string[];
|
|
103
148
|
};
|
|
104
149
|
export type SSRSpaceDeployment = {
|
|
150
|
+
/** Who may put this space in an iframe, as CSP `frame-ancestors` sources (e.g. `'self'`, `https://acme.com`,
|
|
151
|
+
* or `*`). Resolved per space by the consumer, because only it knows the domains that space declares — a
|
|
152
|
+
* published space must not be framable from a site its owner never allowed. Omitted → the server's own
|
|
153
|
+
* `frameOptions` default stands. */
|
|
154
|
+
frameAncestors?: string[];
|
|
105
155
|
environment?: Environment;
|
|
106
156
|
credential?: SSRCredential;
|
|
107
157
|
spaceId?: number | null;
|
|
108
158
|
revision?: number;
|
|
159
|
+
/**
|
|
160
|
+
* This render is an author looking at their own work — the builder's preview — rather than a visitor being
|
|
161
|
+
* served. Metering skips it: nobody should be billed for editing.
|
|
162
|
+
*
|
|
163
|
+
* It is a property of HOW the request resolved, not of the environment it renders. Those two look the same
|
|
164
|
+
* from the render's side and are not: a space's free preview sub-domain serves the live editing environment
|
|
165
|
+
* to the public, so "which environment" cannot tell an author apart from a visitor. Only the resolver knows,
|
|
166
|
+
* which is why it says so here.
|
|
167
|
+
*/
|
|
168
|
+
authoring?: boolean;
|
|
109
169
|
templateProps?: SSRTemplateProps;
|
|
110
170
|
pluginNames?: string[];
|
|
111
171
|
pluginSources?: Record<string, PluginSource>;
|
|
@@ -153,16 +213,23 @@ export type ComponentCatalogEntry = {
|
|
|
153
213
|
* space, so the MCP can validate types/attributes dynamically per space instead of against a hand-mirror. */
|
|
154
214
|
export type ComponentCatalog = Record<string, ComponentCatalogEntry>;
|
|
155
215
|
export type SSRAdapters = {
|
|
156
|
-
|
|
157
|
-
|
|
216
|
+
/** The space's render payload. Optional HERE and required by a page server (see {@link SSRPageAdapters}): a
|
|
217
|
+
* dedicated MCP server renders nothing, reads schema and style through its own adapters, and had to hand this
|
|
218
|
+
* one over anyway for the type to be satisfied — an adapter it never called. */
|
|
219
|
+
getOfflineData?: (spaceId: number, environment: string, revision?: number) => Promise<OfflineDataRaw | undefined>;
|
|
220
|
+
/** Which space, environment and revision a request resolves to. Optional here for the same reason as
|
|
221
|
+
* `getOfflineData`: MCP resolves its space from the request token (`getGrant`), never from the host. */
|
|
222
|
+
getSpaceDeployment?: (req: SSRRequest) => Promise<SSRSpaceDeployment>;
|
|
158
223
|
/** Persist a space mutated by the mcp-ai `apply` tool. Implementations must recompute derived caches
|
|
159
224
|
* (notably `style.cache`) before storing. When omitted, mcp-ai runs read/preview/validate only and
|
|
160
225
|
* `apply` reports `persisted: false`. */
|
|
161
226
|
saveOfflineData?: (spaceId: number, environment: string, data: OfflineDataRaw) => Promise<void>;
|
|
162
|
-
/** Resolve the
|
|
163
|
-
* owns the JWT secret, so it
|
|
164
|
-
* token is missing or invalid. Required for the `mcp` service to serve any
|
|
165
|
-
|
|
227
|
+
/** Resolve the grant the MCP request operates under, from the verified `Authorization` bearer. The consumer
|
|
228
|
+
* owns the JWT secret and the authorization model, so it decides here; the MCP service stays stateless.
|
|
229
|
+
* Returns undefined when the token is missing or invalid. Required for the `mcp` service to serve any
|
|
230
|
+
* request. `canWrite` is what separates a read-only bearer from one that may change the space — the MCP
|
|
231
|
+
* refuses every write tool without it, and never infers the answer from the token itself. */
|
|
232
|
+
getGrant?: (req: SSRRequest) => Promise<SSRGrant | undefined>;
|
|
166
233
|
/** Read the element schema for the MCP tools. Separate from `getOfflineData` (which is SSR/RSC shaped and
|
|
167
234
|
* strips `style.platform`); the MCP style resource needs the full documents, so schema and style split. */
|
|
168
235
|
getSchema?: (spaceId: number, environment: Environment) => Promise<Schema | undefined>;
|
|
@@ -172,18 +239,173 @@ export type SSRAdapters = {
|
|
|
172
239
|
* each installed plugin's manifest — so the MCP `plitzi://types` resource can explain what custom elements do.
|
|
173
240
|
* The MCP already knows the built-in types. When omitted, custom types surface with their observed label only. */
|
|
174
241
|
getComponentCatalog?: (spaceId: number, environment: Environment) => Promise<ComponentCatalog | undefined>;
|
|
242
|
+
/** Read every connector configured for the space, so the MCP can list them and author provider elements against
|
|
243
|
+
* them. Connectors are space-level (not per environment) server-side state: the manifests name endpoints and an
|
|
244
|
+
* auth scheme, so this must never feed a browser payload. When omitted, the MCP's connector resource is empty
|
|
245
|
+
* and a provider element cannot be checked against the connector it names. */
|
|
246
|
+
getConnectors?: (spaceId: number) => Promise<ConnectorEntry[] | undefined>;
|
|
247
|
+
/** Create or replace one connector, keyed by `entry.id`. When omitted, connector ops apply in memory only and
|
|
248
|
+
* `apply` reports `persisted: false`. */
|
|
249
|
+
saveConnector?: (spaceId: number, entry: ConnectorEntry) => Promise<void>;
|
|
250
|
+
/** Remove one connector by its identifier. Omitted alongside `saveConnector` for a read-only deployment. */
|
|
251
|
+
deleteConnector?: (spaceId: number, connectorId: string) => Promise<void>;
|
|
175
252
|
/** Persist the element schema mutated by the MCP `apply` tool. When omitted, `apply` reports `persisted: false`. */
|
|
176
253
|
saveSchema?: (spaceId: number, environment: Environment, schema: Schema) => Promise<void>;
|
|
177
254
|
/** Persist the style document mutated by the MCP `apply` tool. Implementations must recompute `style.cache`
|
|
178
255
|
* before storing. When omitted, `apply` reports `persisted: false`. */
|
|
179
256
|
saveStyle?: (spaceId: number, environment: Environment, style: Style) => Promise<void>;
|
|
257
|
+
/** Who this request carries, if anyone. The adapter reads the credential and resolves it; the cookie it arrived
|
|
258
|
+
* in was written by the server, from {@link SSRAuthCookie}. */
|
|
180
259
|
getUser?: (req: SSRRequest) => Promise<SSRUser | undefined>;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
|
|
260
|
+
/**
|
|
261
|
+
* Verify credentials and mint a session — identity, and nothing else. The server writes the cookies, clears them,
|
|
262
|
+
* and keeps the readable hint in step, because those are properties of how sessions travel rather than of who
|
|
263
|
+
* anyone is. A deployment bringing its own user database implements this and gets the rest for free.
|
|
264
|
+
*
|
|
265
|
+
* Return undefined to refuse. Never throw for a wrong password.
|
|
266
|
+
*/
|
|
267
|
+
authenticate?: (credentials: Record<string, string>, req: SSRRequest) => Promise<SSRSession | undefined>;
|
|
268
|
+
/** Revoke whatever session this request carries, at the source. The cookies are the server's to clear. */
|
|
269
|
+
endSession?: (req: SSRRequest) => Promise<void>;
|
|
270
|
+
/**
|
|
271
|
+
* Turn a credential the browser obtained from an identity provider into a session here — see the exchange stage.
|
|
272
|
+
* Everything that decides whether it is any good lives in this adapter, because only the deployment knows:
|
|
273
|
+
*
|
|
274
|
+
* - which providers it trusts, and which one the space in question actually signs people in with;
|
|
275
|
+
* - that the token was minted for **this** application. Anyone who has signed into any other site with the same
|
|
276
|
+
* provider holds a valid token for that user, so accepting one merely because the provider recognises it lets
|
|
277
|
+
* that site sign in here as them. A provider that cannot prove it must be refused outright.
|
|
278
|
+
*/
|
|
279
|
+
exchangeCredential?: (provider: string, token: string, req: SSRRequest) => Promise<{
|
|
280
|
+
ok: true;
|
|
281
|
+
session: SSRSession;
|
|
282
|
+
user?: SSRUser;
|
|
283
|
+
} | {
|
|
284
|
+
ok: false;
|
|
285
|
+
error: string;
|
|
286
|
+
status?: number;
|
|
287
|
+
reason?: string;
|
|
288
|
+
}>;
|
|
289
|
+
/** Called by the RSC endpoint, and once per page render, to fetch server-side data for server components.
|
|
290
|
+
* See {@link SSRRscContext} for what it is given. */
|
|
291
|
+
getRscData?: (context: SSRRscContext) => Promise<SSRRscData>;
|
|
292
|
+
/**
|
|
293
|
+
* One billable server request. This is where a deployment meters usage, because these are the moments it
|
|
294
|
+
* actually spends bandwidth on a visitor and the ones a visitor cannot reach around: the browser is told
|
|
295
|
+
* what happened, never asked. Each runs before its cache is consulted, so a cached response still counts.
|
|
296
|
+
*
|
|
297
|
+
* What comes back shapes the response — degrade the free tier, hand the browser its reporting channel — and
|
|
298
|
+
* a deployment that meters nothing simply omits the adapter. Never throw from here: a metering outage must
|
|
299
|
+
* not take a site down, so failures should degrade to "served, uncounted".
|
|
300
|
+
*/
|
|
301
|
+
meter?: (event: SSRMeterEvent) => Promise<SSRMeterDecision | undefined>;
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* Which area of server work is being metered. One name per area, because that is the unit a deployment prices
|
|
305
|
+
* — a full page render does not cost what a partial data refresh costs, and both are cheaper when a cache
|
|
306
|
+
* answered them than when the origin did.
|
|
307
|
+
*/
|
|
308
|
+
export type MeteredKind = 'page_view' | 'rsc_query'
|
|
309
|
+
/** Reserved: nothing emits this yet. Server actions are not implemented — the area exists so wiring them
|
|
310
|
+
* later is a call site, not a schema change. */
|
|
311
|
+
| 'server_action';
|
|
312
|
+
/** The request being metered, for {@link SSRAdapters.meter}. */
|
|
313
|
+
export interface SSRMeterEvent {
|
|
314
|
+
kind: MeteredKind;
|
|
315
|
+
/**
|
|
316
|
+
* Whether a cache answered this instead of the origin. Reported rather than inferred: only the handler knows,
|
|
317
|
+
* it is the same fact the response puts on the wire as `X-Cache: HIT`, and what it is worth is the
|
|
318
|
+
* deployment's to decide — an area may price a hit lower, or not distinguish one at all.
|
|
319
|
+
*/
|
|
320
|
+
cached: boolean;
|
|
321
|
+
req: SSRRequest;
|
|
322
|
+
spaceId: number;
|
|
323
|
+
environment: Environment;
|
|
324
|
+
revision: number;
|
|
325
|
+
}
|
|
326
|
+
/** What the deployment decided about this request. */
|
|
327
|
+
export type SSRMeterDecision = {
|
|
328
|
+
/** This space is over the quota its plan allows and the render should say so — the "Made with Plitzi" badge
|
|
329
|
+
* on the free tier. Paid plans accrue overage instead and never set this. */
|
|
330
|
+
degrade?: boolean;
|
|
331
|
+
/** Client reporting channel, injected into the page bootstrap. Omitted → the page reports nothing. Only a
|
|
332
|
+
* page render has anywhere to put it; the other kinds answer data, not a document. */
|
|
333
|
+
analytics?: AnalyticsConfig;
|
|
334
|
+
};
|
|
335
|
+
/** What a server that RENDERS PAGES must answer: the two adapters every page request goes through, on top of the
|
|
336
|
+
* optional rest. Stated as its own type rather than by making them required for everyone, because "required" is
|
|
337
|
+
* a property of the surface being served and not of the adapter set — a dedicated MCP server has no page request
|
|
338
|
+
* to resolve, and the old shape made it hand over two adapters nothing would ever call. */
|
|
339
|
+
export type SSRPageAdapters = SSRAdapters & Required<Pick<SSRAdapters, 'getOfflineData' | 'getSpaceDeployment'>>;
|
|
340
|
+
/**
|
|
341
|
+
* Everything an RSC read is given: which space and revision, who is asking, and which elements want data.
|
|
342
|
+
*
|
|
343
|
+
* One object rather than six positional parameters, because the reason to add to it is exactly the reason the
|
|
344
|
+
* positional form failed — `loadOfflineData` is a seventh thing to know, and nobody should have to count commas to
|
|
345
|
+
* reach it, nor rewrite their adapter when an eighth arrives.
|
|
346
|
+
*/
|
|
347
|
+
export interface SSRRscContext {
|
|
348
|
+
req: SSRRequest;
|
|
349
|
+
spaceId: number;
|
|
350
|
+
environment: Environment;
|
|
351
|
+
revision: number;
|
|
352
|
+
/** Whoever the request carries, already resolved. */
|
|
353
|
+
user?: SSRUser;
|
|
354
|
+
/** On a partial refresh, the only element ids that want data. Absent means every one — the initial render. */
|
|
355
|
+
ids?: string[];
|
|
356
|
+
/**
|
|
357
|
+
* The space itself, read at most once per request however many times this is called.
|
|
358
|
+
*
|
|
359
|
+
* It is here because an adapter almost always needs the schema (to know which elements are server-rendered, or
|
|
360
|
+
* whether RSC is on at all) and the server is already loading it for the page — in parallel with this very call.
|
|
361
|
+
* Without a shared handle every deployment fetched it a second time, or wrote its own in-flight dedup to avoid
|
|
362
|
+
* doing so. Awaiting this joins the read already under way; it never starts a second one.
|
|
363
|
+
*/
|
|
364
|
+
loadOfflineData: () => Promise<OfflineDataRaw | undefined>;
|
|
365
|
+
}
|
|
366
|
+
export type SSRActionConfig = {
|
|
367
|
+
/** URL path for the write endpoint. Defaults to '/_action'. */
|
|
368
|
+
path?: string;
|
|
369
|
+
/** Connector manifest and credential lookups. Without them the endpoint stays inert: a write can only be
|
|
370
|
+
* authorized against a manifest, and there is nothing to authorize against. Shaped as `ConnectorLookups`
|
|
371
|
+
* in `@plitzi/sdk-server`; typed loosely here so the shared types stay free of the server's internals. */
|
|
372
|
+
lookups?: {
|
|
373
|
+
getConnector: (spaceId: number, connectorId: string) => Promise<unknown>;
|
|
374
|
+
getCredential?: (spaceId: number, identifier: string) => Promise<Record<string, string> | undefined>;
|
|
375
|
+
fetchImpl?: typeof fetch;
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
export type SSRHealthConfig = {
|
|
379
|
+
path?: string;
|
|
380
|
+
/** Replaces the identity payload entirely. `check` still merges over it. */
|
|
381
|
+
payload?: Record<string, unknown>;
|
|
382
|
+
name?: string;
|
|
383
|
+
version?: string;
|
|
384
|
+
role?: string;
|
|
385
|
+
/**
|
|
386
|
+
* Live state, read on every probe and merged over the payload — the stores this process depends on, a queue
|
|
387
|
+
* depth, whatever only this deployment can know. Returning `healthy: false` answers **503**, which is what turns
|
|
388
|
+
* the endpoint from a liveness check into a readiness one: an orchestrator stops routing to a replica whose
|
|
389
|
+
* database has gone, instead of sending it traffic it can only fail.
|
|
390
|
+
*
|
|
391
|
+
* A check that throws is itself an unhealthy answer, and is reported as one rather than as a 500.
|
|
392
|
+
*/
|
|
393
|
+
check?: () => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
394
|
+
};
|
|
395
|
+
/** Response compression. Every field has a default; supply only what this deployment wants different. */
|
|
396
|
+
export type SSRCompressionConfig = {
|
|
397
|
+
/**
|
|
398
|
+
* Which encodings this server will use, most preferred first — the first one the client accepts wins. Default
|
|
399
|
+
* `['br', 'gzip']`. `['gzip']` for a client or proxy that mishandles Brotli; `[]` disables compression, same as
|
|
400
|
+
* `compression: false`.
|
|
401
|
+
*/
|
|
402
|
+
encodings?: ('br' | 'gzip')[];
|
|
403
|
+
/** Responses smaller than this many bytes go out uncompressed. Default 1024. */
|
|
404
|
+
threshold?: number;
|
|
405
|
+
/** Brotli quality, 0–11. Default 4 — past that the CPU cost outgrows the bytes saved on HTML. */
|
|
406
|
+
brotliQuality?: number;
|
|
407
|
+
/** Gzip level, 0–9. Default 6. */
|
|
408
|
+
gzipLevel?: number;
|
|
187
409
|
};
|
|
188
410
|
export type SSRRscConfig = {
|
|
189
411
|
/** Whether the RSC endpoint is active. Defaults to true when adapters.getRscData is provided. */
|
|
@@ -261,10 +483,19 @@ export type SSRServerConfig = {
|
|
|
261
483
|
publicDir?: string;
|
|
262
484
|
static?: Record<string, string>;
|
|
263
485
|
devMode?: boolean;
|
|
486
|
+
/** Authorizes debugging on the pages this server renders. An SSR page loads the very same SDK, so this is the
|
|
487
|
+
* server-side face of the SDK's `debugMode` prop: the page decides, and the visitor's 'plitzi_debug' cookie can
|
|
488
|
+
* only narrow it. Defaults to `devMode`, so a development server debugs without being told to. */
|
|
489
|
+
debugMode?: boolean;
|
|
264
490
|
cacheTtlMs?: number;
|
|
265
491
|
loginPath?: string | false;
|
|
266
492
|
middlewares?: SSRMiddleware[];
|
|
267
493
|
logoutPath?: string | false;
|
|
494
|
+
/** Where a browser-obtained credential is handed over. Defaults to `/auth/exchange`; served only when the
|
|
495
|
+
* `exchangeCredential` adapter is supplied. */
|
|
496
|
+
exchangePath?: string | false;
|
|
497
|
+
/** Naming and scope of the session cookies this server writes. See {@link SSRAuthCookie}. */
|
|
498
|
+
authCookie?: SSRAuthCookie;
|
|
268
499
|
templateFn?: SSRTemplateFn;
|
|
269
500
|
plugins?: Record<string, PluginSource>;
|
|
270
501
|
pluginsCacheDir?: string;
|
|
@@ -283,105 +514,64 @@ export type SSRServerConfig = {
|
|
|
283
514
|
frameOptions?: 'DENY' | 'SAMEORIGIN' | string[] | false;
|
|
284
515
|
/** RSC (React Server Components) endpoint configuration. */
|
|
285
516
|
rsc?: SSRRscConfig;
|
|
286
|
-
/**
|
|
287
|
-
|
|
288
|
-
/** AI-native MCP server — replaces the standard MCP with a zero-hallucination batch protocol. `path` is where
|
|
289
|
-
* it answers inside a server that also serves pages (default /mcp); a dedicated MCP server (createMCPServer)
|
|
290
|
-
* owns its whole origin and ignores it. Note that createSSRServer mounts no MCP whatever this says — a
|
|
291
|
-
* process that serves both surfaces is built with createServer. */
|
|
292
|
-
mcpAi?: {
|
|
293
|
-
enabled?: boolean;
|
|
294
|
-
path?: string;
|
|
295
|
-
/** Whether the plitzi_render view may paint from the tool arguments while the host is still STREAMING them:
|
|
296
|
-
* a placeholder that grows with the widget being authored, instead of the static "Rendering…" held for as
|
|
297
|
-
* long as the model takes to write the batch. Defaults to true; hosts that stream nothing are unaffected
|
|
298
|
-
* either way. Set false to keep every view blank until the finished widget arrives. */
|
|
299
|
-
renderStreaming?: boolean;
|
|
300
|
-
/** How a rendered widget reaches ANYTHING outside its sandbox — images, media, fonts, and the endpoints an
|
|
301
|
-
* apiContainer fetches. A widget runs in an iframe under a CSP the host builds from the origins this server
|
|
302
|
-
* declares on its `ui://` resource, which is read before any widget exists (and the spec allows no per-call
|
|
303
|
-
* CSP), so the origins an agent is about to author can never be declared. With a `secret` set, every external
|
|
304
|
-
* URL a render authored is rewritten to this server's own endpoint — which IS declared — and fetched here,
|
|
305
|
-
* which also settles the redirects, hotlink rules and missing CORS headers a null-origin sandbox cannot. The
|
|
306
|
-
* agent never sees this: it authors the real URL. Without a secret there is no endpoint and the URLs travel
|
|
307
|
-
* as authored, loading only where the host allows their origin. */
|
|
308
|
-
proxy?: {
|
|
309
|
-
/** Set false to serve no endpoint even with a secret configured. */
|
|
310
|
-
enabled?: boolean;
|
|
311
|
-
/** Where the endpoint answers. Default `/__proxy`. */
|
|
312
|
-
path?: string;
|
|
313
|
-
/** Signs each grant (target + kind + expiry + the connection that minted it), so the endpoint is not an open
|
|
314
|
-
* proxy. Required to enable it; any value stable across replicas works. */
|
|
315
|
-
secret?: string;
|
|
316
|
-
/** Absolute base for the URLs handed to widgets (`https://mcp.example.com`). Default: the origin each MCP
|
|
317
|
-
* request arrived on — right whenever the MCP server owns its sub-domain. */
|
|
318
|
-
baseUrl?: string;
|
|
319
|
-
/** Largest response the endpoint will pass through, in bytes. Default 8 MiB. */
|
|
320
|
-
maxBytes?: number;
|
|
321
|
-
/** How long a minted URL keeps working, in seconds. Default 7 days: a widget outlives the call that made it
|
|
322
|
-
* (it stays in the conversation), but a leaked URL should not work forever. */
|
|
323
|
-
ttl?: number;
|
|
324
|
-
/** Which MCP tools may be handed the endpoint at all. Defaults to `['plitzi_render']`, and that default is
|
|
325
|
-
* a guard rather than a convenience: a render is a throwaway widget, so a rewritten URL lives exactly as
|
|
326
|
-
* long as it does, while a tool that WRITES a space (plitzi_apply) would persist proxied URLs into content
|
|
327
|
-
* the user owns — their space would then depend on this server to show its own images, and those URLs
|
|
328
|
-
* expire. Listing a tool only makes the endpoint reachable from it; rewriting is something the tool has to
|
|
329
|
-
* implement, and today plitzi_render is the only one that does. */
|
|
330
|
-
tools?: string[];
|
|
331
|
-
};
|
|
332
|
-
};
|
|
517
|
+
/** Write endpoint for server-driven providers. Absent means the server serves reads only. */
|
|
518
|
+
action?: SSRActionConfig;
|
|
333
519
|
/** Receives a {@link ServerLogEvent} for every HTTP request this server answers — whatever stage answered it
|
|
334
520
|
* and whatever the outcome — plus every MCP tool call and resource read inside those requests. Without it the
|
|
335
521
|
* server reports nothing per request (the MCP events still reach the console when `MCP_DEBUG=1`). */
|
|
336
522
|
logger?: ServerLogger;
|
|
523
|
+
/**
|
|
524
|
+
* How responses are compressed. Omit for Brotli where the client takes it and gzip otherwise; `false` never
|
|
525
|
+
* compresses, which is what to use when a proxy or CDN in front already does it.
|
|
526
|
+
*/
|
|
527
|
+
compression?: SSRCompressionConfig | false;
|
|
528
|
+
/**
|
|
529
|
+
* What to do when the server cannot take its port. Without it the server prints what went wrong, what to do about
|
|
530
|
+
* it, and exits non-zero — because a process whose server never bound is not running, and the alternative is a raw
|
|
531
|
+
* `EADDRINUSE` stack that says nothing about which port or which server.
|
|
532
|
+
*
|
|
533
|
+
* Supply this to keep the process alive and decide for yourself: an embedder that starts several servers, a
|
|
534
|
+
* supervisor that retries, a test that asserts the failure. Handling it here replaces the exit entirely.
|
|
535
|
+
*/
|
|
536
|
+
onListenError?: (error: NodeJS.ErrnoException, context: {
|
|
537
|
+
port: number;
|
|
538
|
+
host: string;
|
|
539
|
+
label: string;
|
|
540
|
+
}) => void;
|
|
337
541
|
adapters: SSRAdapters;
|
|
338
|
-
/**
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
*
|
|
342
|
-
* absent → those tools report PREVIEW_UNAVAILABLE. */
|
|
343
|
-
previewClient?: {
|
|
344
|
-
url: string;
|
|
345
|
-
secret?: string;
|
|
346
|
-
};
|
|
347
|
-
/** Dedicated headless-browser service for plitzi_screenshot (off unless set). `serviceUrl` is the browser
|
|
348
|
-
* service that turns a URL into PNG(s); `renderBaseUrl` is the SSR base the browser navigates to (a page
|
|
349
|
-
* path + the one-shot `__pt` token are appended). When absent, plitzi_screenshot is not registered and only
|
|
350
|
-
* the HTML plitzi_preview is available; when the service is unreachable at call time the tool degrades to
|
|
351
|
-
* returning the HTML preview with a warning. */
|
|
352
|
-
screenshot?: {
|
|
353
|
-
serviceUrl: string;
|
|
354
|
-
renderBaseUrl: string;
|
|
355
|
-
};
|
|
356
|
-
/** Backing store for draft-preview tokens. Defaults to an in-memory store (single replica); inject a shared
|
|
357
|
-
* store (e.g. Redis) for multi-replica correctness. */
|
|
358
|
-
draftStore?: DraftStore;
|
|
359
|
-
/** Which request-handling services this server mounts. Each maps to an internal `create<Name>Server` unit,
|
|
360
|
-
* so new services scale without rewriting the dispatcher. Omitted flags fall back to sensible defaults:
|
|
361
|
-
* ssr on, rsc when `adapters.getRscData` exists, mcp from `mcpAi.enabled`. `ai` is a reserved slot (not
|
|
362
|
-
* wired yet). Only createServer reads these as written — the surface factories pin what their name promises
|
|
363
|
-
* (createSSRServer: no mcp; createMCPServer: mcp alone). */
|
|
542
|
+
/** Which request-handling services this server mounts: `ssr` on by default, `rsc` whenever
|
|
543
|
+
* `adapters.getRscData` exists. Stages a companion package contributes are deliberately NOT flags here —
|
|
544
|
+
* handing them over is the decision. Only createServer reads these as written; the surface factories pin what
|
|
545
|
+
* their name promises (a page server serves pages; a dedicated MCP server serves MCP alone). */
|
|
364
546
|
services?: ServerServices;
|
|
365
547
|
/** Liveness/readiness endpoint for standalone servers (k8s probes). A stage always answers `path`
|
|
366
|
-
* (default /health) with
|
|
367
|
-
* ({ Server, Version, role }); pass an explicit `payload` to override it entirely
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
payload?: Record<string, unknown>;
|
|
371
|
-
name?: string;
|
|
372
|
-
version?: string;
|
|
373
|
-
role?: string;
|
|
374
|
-
};
|
|
548
|
+
* (default /health) with the generic identity payload built from `name`/`version`/`role`
|
|
549
|
+
* ({ Server, Version, role }); pass an explicit `payload` to override it entirely, or `check` to add what can
|
|
550
|
+
* only be known per request. See {@link SSRHealthConfig}. */
|
|
551
|
+
health?: SSRHealthConfig;
|
|
375
552
|
/** Cache-buster appended as ?v=<assetVersion> to all default SDK asset URLs (jsPath, cssPath, react vendor). Compute from file mtime or package version at startup. */
|
|
376
553
|
assetVersion?: string;
|
|
377
|
-
/**
|
|
378
|
-
|
|
554
|
+
/** The draft-preview endpoint, and the store behind it. The draft is WRITTEN by an MCP tool and RENDERED here,
|
|
555
|
+
* so this is the one piece of that feature the page server owns: `@plitzi/sdk-mcp` carries everything else in
|
|
556
|
+
* its own options, and a deployment that never installs it leaves both unset.
|
|
557
|
+
*
|
|
558
|
+
* `preview` mounts the endpoint (off unless `enabled`); `draftStore` backs the tokens and defaults to an
|
|
559
|
+
* in-memory store — inject a shared one (e.g. Redis) for multi-replica correctness. */
|
|
560
|
+
preview?: SSRPreviewConfig;
|
|
561
|
+
draftStore?: DraftStore;
|
|
562
|
+
};
|
|
563
|
+
/** The same config as seen by a server that serves PAGES: its adapters answer for a page request. This is what
|
|
564
|
+
* `createServer` from `@plitzi/sdk-server` takes and what the SSR stages are handed, so a page stage reaches
|
|
565
|
+
* `getOfflineData` without asking whether it is there — while a stage typed to the bare context (anything from
|
|
566
|
+
* `@plitzi/sdk-mcp`, which also runs in servers that have neither) still has to check. */
|
|
567
|
+
export type SSRPageServerConfig = SSRServerConfig & {
|
|
568
|
+
adapters: SSRPageAdapters;
|
|
379
569
|
};
|
|
570
|
+
/** Which surfaces a page server mounts. Only what the page pipeline itself owns: the MCP endpoint and
|
|
571
|
+
* draft-preview are stages a companion package hands in, so they are not flags here. */
|
|
380
572
|
export type ServerServices = {
|
|
381
573
|
ssr?: boolean;
|
|
382
574
|
rsc?: boolean;
|
|
383
|
-
mcp?: boolean;
|
|
384
|
-
ai?: boolean;
|
|
385
575
|
};
|
|
386
576
|
export type PluginRegistry = {
|
|
387
577
|
register: (name: string, source: PluginSource) => void;
|
|
@@ -402,6 +592,9 @@ export type SSRMiddleware = (req: SSRRequest, res: SSRResponseHelpers, next: SSR
|
|
|
402
592
|
export type SSRContext = {
|
|
403
593
|
spaceDeployment?: SSRSpaceDeployment;
|
|
404
594
|
user?: SSRUser;
|
|
595
|
+
/** What {@link SSRAdapters.meter} answered for this request, so the render reads the decision instead of
|
|
596
|
+
* asking for it a second time. */
|
|
597
|
+
meter?: SSRMeterDecision;
|
|
405
598
|
};
|
|
406
599
|
export type SSRServer = {
|
|
407
600
|
listen: (port: number, host?: string) => void;
|
|
@@ -435,7 +628,7 @@ export type OAuthGrantTarget = {
|
|
|
435
628
|
};
|
|
436
629
|
/** What the OAuth layer cannot resolve on its own: who the user is, what they may grant, and the bearer to mint
|
|
437
630
|
* for them. The SDK owns the protocol (discovery, registration, PKCE, code exchange); the consumer owns identity
|
|
438
|
-
* and issues a token its own `adapters.
|
|
631
|
+
* and issues a token its own `adapters.getGrant` will accept back. */
|
|
439
632
|
export type OAuthAdapters = {
|
|
440
633
|
/** Verify the credentials typed into the consent screen. Return undefined to re-show the form with an error —
|
|
441
634
|
* never throw for a wrong password. */
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { Environment } from './CommonTypes';
|
|
2
|
-
|
|
2
|
+
import { ConnectorManifestDraft } from './ConnectorTypes';
|
|
3
|
+
export type SpaceCredentialProvider = 's3' | 'r2' | 'ssr' | 'custom';
|
|
4
|
+
/**
|
|
5
|
+
* A connector manifest as the builder sees it.
|
|
6
|
+
*
|
|
7
|
+
* The manifest is server-side state — it names endpoints and an auth scheme — so this shape exists for the editor
|
|
8
|
+
* and for the API that maintains it, never for a published page. What reaches a visitor is the connector's
|
|
9
|
+
* identifier and nothing else.
|
|
10
|
+
*/
|
|
11
|
+
export type SpaceConnector = {
|
|
12
|
+
id: number;
|
|
13
|
+
identifier: string;
|
|
14
|
+
name: string;
|
|
15
|
+
manifest: ConnectorManifestDraft;
|
|
16
|
+
createdAt: number;
|
|
17
|
+
updatedAt: number;
|
|
18
|
+
};
|
|
3
19
|
export type SpaceCredential = {
|
|
4
20
|
identifier: string;
|
|
5
21
|
name: string;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { SubscriptionCollaborator, SubscriptionCollaboratorPointer } from './BuilderTypes';
|
|
2
|
+
import { Environment, RenderMode } from './CommonTypes';
|
|
1
3
|
import { Source } from './DataSourceTypes';
|
|
4
|
+
import { QueryParams, RouteParams } from './NavigationTypes';
|
|
2
5
|
import { Schema, Element } from './SchemaTypes';
|
|
3
6
|
import { Segment } from './SegmentTypes';
|
|
7
|
+
import { SpaceConnector } from './SpaceTypes';
|
|
4
8
|
import { DisplayMode, Style, StyleState } from './StyleTypes';
|
|
5
9
|
export type RuntimeSourceValues = {
|
|
6
10
|
variables?: Record<string, unknown>;
|
|
@@ -26,8 +30,40 @@ export type CommonState = {
|
|
|
26
30
|
elements?: Record<string, unknown>;
|
|
27
31
|
};
|
|
28
32
|
sources?: Record<string, Source>;
|
|
33
|
+
rsc?: RscState;
|
|
34
|
+
render?: RenderSettings;
|
|
35
|
+
navigation: {
|
|
36
|
+
urlSearchParams?: URLSearchParams;
|
|
37
|
+
routeParams: RouteParams;
|
|
38
|
+
queryParams: QueryParams;
|
|
39
|
+
hostname: string;
|
|
40
|
+
currentPageId: string;
|
|
41
|
+
navigate: (url: string, isExternal?: boolean) => void;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/** Not document state and not server data: the surface the schema is being rendered on. `previewMode` and
|
|
45
|
+
* `debugMode` change at runtime (the builder's preview toggle, shift+F12), so reads of these are reactive; the rest
|
|
46
|
+
* are fixed for the life of the render. */
|
|
47
|
+
export type RenderSettings = {
|
|
48
|
+
previewMode?: boolean;
|
|
49
|
+
debugMode?: boolean;
|
|
50
|
+
renderMode?: RenderMode;
|
|
51
|
+
environment?: Environment;
|
|
52
|
+
isHydrating?: boolean;
|
|
53
|
+
};
|
|
54
|
+
export type RscState = {
|
|
55
|
+
enabled?: boolean;
|
|
56
|
+
endpoint?: string;
|
|
57
|
+
loaded?: boolean;
|
|
58
|
+
data?: Record<string, unknown>;
|
|
29
59
|
};
|
|
30
60
|
export type BuilderState = CommonState & {
|
|
61
|
+
collaboration: {
|
|
62
|
+
collaborators: SubscriptionCollaborator[];
|
|
63
|
+
pointers?: Record<string, SubscriptionCollaboratorPointer>;
|
|
64
|
+
};
|
|
65
|
+
connectors: Record<string, SpaceConnector>;
|
|
66
|
+
hasServerRendering: boolean;
|
|
31
67
|
displayMode: DisplayMode;
|
|
32
68
|
selector?: string;
|
|
33
69
|
styleSelector?: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './SegmentTypes';
|
|
|
9
9
|
export * from './BuilderTypes';
|
|
10
10
|
export * from './NavigationTypes';
|
|
11
11
|
export * from './CollectionTypes';
|
|
12
|
+
export * from './ConnectorTypes';
|
|
12
13
|
export * from './ComponentTypes';
|
|
13
14
|
export * from './StateTypes';
|
|
14
15
|
export * from './CommonTypes';
|
|
@@ -36,8 +36,11 @@ export type RTMessageManagedClient = {
|
|
|
36
36
|
action: 'mouseMove';
|
|
37
37
|
x: number;
|
|
38
38
|
y: number;
|
|
39
|
+
dx: number;
|
|
40
|
+
dy: number;
|
|
39
41
|
zoom: number;
|
|
40
42
|
rootId: string;
|
|
43
|
+
anchorId?: string;
|
|
41
44
|
};
|
|
42
45
|
} | {
|
|
43
46
|
type: RTEvent.ELEMENT;
|
|
@@ -81,9 +84,12 @@ export type RTMessageManagedServer = {
|
|
|
81
84
|
action: 'mouseMove';
|
|
82
85
|
x: number;
|
|
83
86
|
y: number;
|
|
87
|
+
dx: number;
|
|
88
|
+
dy: number;
|
|
84
89
|
zoom: number;
|
|
85
90
|
rootId: string;
|
|
86
91
|
instanceId: string;
|
|
92
|
+
anchorId?: string;
|
|
87
93
|
};
|
|
88
94
|
} | {
|
|
89
95
|
type: RTEvent.ELEMENT;
|