@burdenoff/microfe-vibecontrols 2026.602.2 → 2026.602.3
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/dist/components/sessions/SessionShareDialog.js +24 -462
- package/dist/components/sessions/SessionShareDialog.js.map +1 -1
- package/dist/components/sharing/entityShareOps.js +106 -0
- package/dist/components/sharing/entityShareOps.js.map +1 -1
- package/dist/components/sharing/shareRegistry.js +3 -3
- package/dist/components/sharing/shareRegistry.js.map +1 -1
- package/dist/components/vibedeck/VibeDeckShareDialog.js +19 -335
- package/dist/components/vibedeck/VibeDeckShareDialog.js.map +1 -1
- package/dist/constants/permissions.js +1 -0
- package/dist/constants/permissions.js.map +1 -1
- package/dist/generated/wspace-types.js +9 -11
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/pages/SessionsPage.js +1011 -1007
- package/dist/pages/SessionsPage.js.map +1 -1
- package/dist/pages/VibeDeckPage.js +40 -41
- package/dist/pages/VibeDeckPage.js.map +1 -1
- package/package.json +1 -1
- package/dist/utils/shareUrl.js +0 -41
- package/dist/utils/shareUrl.js.map +0 -1
|
@@ -594,6 +594,112 @@ var n = {
|
|
|
594
594
|
id
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
|
+
`
|
|
598
|
+
},
|
|
599
|
+
session: {
|
|
600
|
+
readField: "session",
|
|
601
|
+
createLinkField: "createSessionGrantShareLink",
|
|
602
|
+
sharesQuery: t`
|
|
603
|
+
query SessionShares($id: ID!) {
|
|
604
|
+
session(id: $id) {
|
|
605
|
+
id
|
|
606
|
+
name
|
|
607
|
+
vibeId
|
|
608
|
+
myRole: myGrantRole
|
|
609
|
+
shares: shareGrants {
|
|
610
|
+
${e}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
`,
|
|
615
|
+
share: t`
|
|
616
|
+
mutation ShareSessionGrant($input: ShareEntityInput!) {
|
|
617
|
+
shareSessionGrant(input: $input) {
|
|
618
|
+
${e}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
`,
|
|
622
|
+
revokeShare: t`
|
|
623
|
+
mutation RevokeSessionGrantShare($input: RevokeShareInput!) {
|
|
624
|
+
revokeSessionGrantShare(input: $input) {
|
|
625
|
+
id
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
`,
|
|
629
|
+
updateShareRole: t`
|
|
630
|
+
mutation UpdateSessionGrantShareRole($input: UpdateShareRoleInput!) {
|
|
631
|
+
updateSessionGrantShareRole(input: $input) {
|
|
632
|
+
id
|
|
633
|
+
role
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
`,
|
|
637
|
+
createShareLink: t`
|
|
638
|
+
mutation CreateSessionGrantShareLink($input: CreateShareGrantLinkInput!) {
|
|
639
|
+
createSessionGrantShareLink(input: $input) {
|
|
640
|
+
${e}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
`,
|
|
644
|
+
revokeShareLink: t`
|
|
645
|
+
mutation RevokeSessionGrantShareLink($input: RevokeShareInput!) {
|
|
646
|
+
revokeSessionGrantShareLink(input: $input) {
|
|
647
|
+
id
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
`
|
|
651
|
+
},
|
|
652
|
+
vibedeck: {
|
|
653
|
+
readField: "vibeDeck",
|
|
654
|
+
createLinkField: "createVibeDeckGrantShareLink",
|
|
655
|
+
sharesQuery: t`
|
|
656
|
+
query VibeDeckShares($id: ID!) {
|
|
657
|
+
vibeDeck(id: $id) {
|
|
658
|
+
id
|
|
659
|
+
name
|
|
660
|
+
vibeId
|
|
661
|
+
myRole: myGrantRole
|
|
662
|
+
shares: shareGrants {
|
|
663
|
+
${e}
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
`,
|
|
668
|
+
share: t`
|
|
669
|
+
mutation ShareVibeDeckGrant($input: ShareEntityInput!) {
|
|
670
|
+
shareVibeDeckGrant(input: $input) {
|
|
671
|
+
${e}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
`,
|
|
675
|
+
revokeShare: t`
|
|
676
|
+
mutation RevokeVibeDeckGrantShare($input: RevokeShareInput!) {
|
|
677
|
+
revokeVibeDeckGrantShare(input: $input) {
|
|
678
|
+
id
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
`,
|
|
682
|
+
updateShareRole: t`
|
|
683
|
+
mutation UpdateVibeDeckGrantShareRole($input: UpdateShareRoleInput!) {
|
|
684
|
+
updateVibeDeckGrantShareRole(input: $input) {
|
|
685
|
+
id
|
|
686
|
+
role
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
`,
|
|
690
|
+
createShareLink: t`
|
|
691
|
+
mutation CreateVibeDeckGrantShareLink($input: CreateShareGrantLinkInput!) {
|
|
692
|
+
createVibeDeckGrantShareLink(input: $input) {
|
|
693
|
+
${e}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
`,
|
|
697
|
+
revokeShareLink: t`
|
|
698
|
+
mutation RevokeVibeDeckGrantShareLink($input: RevokeShareInput!) {
|
|
699
|
+
revokeVibeDeckGrantShareLink(input: $input) {
|
|
700
|
+
id
|
|
701
|
+
}
|
|
702
|
+
}
|
|
597
703
|
`
|
|
598
704
|
}
|
|
599
705
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityShareOps.js","names":[],"sources":["../../../src/components/sharing/entityShareOps.ts"],"sourcesContent":["/**\n * Per-entity GraphQL document set for the generic-sharing controllers\n * (`useEntityShareController`).\n *\n * The generic-sharing operations (`shareAiPrompt`, `aiPrompt.shares`, `myRole`,\n * …) are NOT in the committed `graphql/wspace.graphql` snapshot the codegen\n * reads, so — exactly like `useVibeShareController` / `useNoteShareController` —\n * we hand-write the documents with inline `gql` against the MFE's Apollo client.\n *\n * Each {@link EntityShareOps} bundles the five mutations + the read query for a\n * single entity. The read query projects the resource's `shares`/`myRole` (and,\n * where the backend exposes it, `hasShares`) onto the fe-libs `ShareController`\n * contract. The mutation/read-field names below were verified 1:1 against the\n * deployed `wspace-vibecontrols-svc/.hive-schema.graphql`.\n *\n * Notable per-entity shape differences captured here:\n * - `aiPrompt` has NO `hasShares` field — its read query omits it.\n * - `agentInstructionFile` has NO `name`; it exposes `effectiveFilename`\n * (non-null) + `customName`, so its read query selects those instead.\n * - `vibecontrolsScorecard` and `vibecontrolsDocsSite` have NO read-by-`id`\n * query — the only reads are `(ownerId, ownerType)`. Their `sharesQuery`\n * therefore takes `($ownerId, $ownerType)` and the entity declares\n * `readVariables` to map the controller's `{ id, owner }` onto those args.\n * `scorecard` additionally has NO display-name field, so the call site uses\n * the resource `id` as the dialog title.\n */\n\nimport { gql, type DocumentNode } from '@apollo/client';\n\nimport { SHARE_GRANT_FIELDS } from './shareControllerTypes';\n\n/**\n * Identity the generic controller resolves a resource by. Most entities read by\n * `id`; the two owner-keyed entities (scorecard, docs) additionally carry the\n * `(ownerId, ownerType)` pair their read query requires.\n */\nexport interface EntityShareIdentity {\n /** Stable resource id (always present once the surface has loaded the row). */\n id: string;\n /** `(ownerId, ownerType)` for entities read by owner instead of by id. */\n owner?: { ownerId: string; ownerType: string } | null;\n}\n\n/** The five share mutation documents + read query for one entity. */\nexport interface EntityShareOps {\n /** Reads the resource's `shares` / `myRole` (+ display name + optional `vibeId`). */\n sharesQuery: DocumentNode;\n /** `share<Entity>(input: ShareEntityInput!)`. */\n share: DocumentNode;\n /** `revoke<Entity>Share(input: RevokeShareInput!)`. */\n revokeShare: DocumentNode;\n /** `update<Entity>ShareRole(input: UpdateShareRoleInput!)`. */\n updateShareRole: DocumentNode;\n /** `create<Entity>ShareLink(input: CreateShareGrantLinkInput!)`. */\n createShareLink: DocumentNode;\n /** `revoke<Entity>ShareLink(input: RevokeShareInput!)`. */\n revokeShareLink: DocumentNode;\n /** Top-level read field name (`aiPrompt`, `action`, …) used to read the response. */\n readField: string;\n /** Mutation field name that returns the created link grant (for `shareUrl`). */\n createLinkField: string;\n /**\n * Maps the resource identity onto the variables {@link sharesQuery} expects.\n * Defaults to `{ id }` for the standard `($id: ID!)` read. Entities read by\n * owner (scorecard, docs) override this to emit `{ ownerId, ownerType }`.\n */\n readVariables?: (identity: EntityShareIdentity) => Record<string, unknown>;\n}\n\n// ── aiprompt ────────────────────────────────────────────────────────────────\n// AiPrompt has NO `hasShares` field — read query omits it.\nconst aiPromptOps: EntityShareOps = {\n readField: 'aiPrompt',\n createLinkField: 'createAiPromptShareLink',\n sharesQuery: gql`\n query AiPromptShares($id: ID!) {\n aiPrompt(id: $id) {\n id\n name\n vibeId\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareAiPrompt($input: ShareEntityInput!) {\n shareAiPrompt(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeAiPromptShare($input: RevokeShareInput!) {\n revokeAiPromptShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateAiPromptShareRole($input: UpdateShareRoleInput!) {\n updateAiPromptShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateAiPromptShareLink($input: CreateShareGrantLinkInput!) {\n createAiPromptShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeAiPromptShareLink($input: RevokeShareInput!) {\n revokeAiPromptShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── action ──────────────────────────────────────────────────────────────────\nconst actionOps: EntityShareOps = {\n readField: 'action',\n createLinkField: 'createActionShareLink',\n sharesQuery: gql`\n query ActionShares($id: ID!) {\n action(id: $id) {\n id\n name\n vibeId\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareAction($input: ShareEntityInput!) {\n shareAction(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeActionShare($input: RevokeShareInput!) {\n revokeActionShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateActionShareRole($input: UpdateShareRoleInput!) {\n updateActionShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateActionShareLink($input: CreateShareGrantLinkInput!) {\n createActionShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeActionShareLink($input: RevokeShareInput!) {\n revokeActionShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── aicontext ─────────────────────────────────────────────────────────────────\nconst aiContextOps: EntityShareOps = {\n readField: 'aiContext',\n createLinkField: 'createAiContextShareLink',\n sharesQuery: gql`\n query AiContextShares($id: ID!) {\n aiContext(id: $id) {\n id\n name\n vibeId\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareAiContext($input: ShareEntityInput!) {\n shareAiContext(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeAiContextShare($input: RevokeShareInput!) {\n revokeAiContextShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateAiContextShareRole($input: UpdateShareRoleInput!) {\n updateAiContextShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateAiContextShareLink($input: CreateShareGrantLinkInput!) {\n createAiContextShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeAiContextShareLink($input: RevokeShareInput!) {\n revokeAiContextShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── instructionfile ───────────────────────────────────────────────────────────\n// AgentInstructionFile has NO `name`; the display name is `effectiveFilename`.\nconst instructionFileOps: EntityShareOps = {\n readField: 'agentInstructionFile',\n createLinkField: 'createAgentInstructionFileShareLink',\n sharesQuery: gql`\n query AgentInstructionFileShares($id: ID!) {\n agentInstructionFile(id: $id) {\n id\n effectiveFilename\n vibeId\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareAgentInstructionFile($input: ShareEntityInput!) {\n shareAgentInstructionFile(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeAgentInstructionFileShare($input: RevokeShareInput!) {\n revokeAgentInstructionFileShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateAgentInstructionFileShareRole($input: UpdateShareRoleInput!) {\n updateAgentInstructionFileShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateAgentInstructionFileShareLink($input: CreateShareGrantLinkInput!) {\n createAgentInstructionFileShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeAgentInstructionFileShareLink($input: RevokeShareInput!) {\n revokeAgentInstructionFileShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── tunnel ────────────────────────────────────────────────────────────────────\nconst tunnelOps: EntityShareOps = {\n readField: 'tunnel',\n createLinkField: 'createTunnelShareLink',\n sharesQuery: gql`\n query TunnelShares($id: ID!) {\n tunnel(id: $id) {\n id\n name\n vibeId\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareTunnel($input: ShareEntityInput!) {\n shareTunnel(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeTunnelShare($input: RevokeShareInput!) {\n revokeTunnelShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateTunnelShareRole($input: UpdateShareRoleInput!) {\n updateTunnelShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateTunnelShareLink($input: CreateShareGrantLinkInput!) {\n createTunnelShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeTunnelShareLink($input: RevokeShareInput!) {\n revokeTunnelShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── catalog ─────────────────────────────────────────────────────────────────\n// VibecontrolsCatalog has `name`, `hasShares`, `myRole`; NO `vibeId`.\nconst catalogOps: EntityShareOps = {\n readField: 'vibecontrolsCatalog',\n createLinkField: 'createCatalogShareLink',\n sharesQuery: gql`\n query CatalogShares($id: ID!) {\n vibecontrolsCatalog(id: $id) {\n id\n name\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareCatalog($input: ShareEntityInput!) {\n shareCatalog(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeCatalogShare($input: RevokeShareInput!) {\n revokeCatalogShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateCatalogShareRole($input: UpdateShareRoleInput!) {\n updateCatalogShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateCatalogShareLink($input: CreateShareGrantLinkInput!) {\n createCatalogShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeCatalogShareLink($input: RevokeShareInput!) {\n revokeCatalogShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── component ───────────────────────────────────────────────────────────────\n// VibecontrolsComponent has `name`, `hasShares`, `myRole`; NO `vibeId`.\nconst componentOps: EntityShareOps = {\n readField: 'vibecontrolsComponent',\n createLinkField: 'createComponentShareLink',\n sharesQuery: gql`\n query ComponentShares($id: ID!) {\n vibecontrolsComponent(id: $id) {\n id\n name\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareComponent($input: ShareEntityInput!) {\n shareComponent(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeComponentShare($input: RevokeShareInput!) {\n revokeComponentShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateComponentShareRole($input: UpdateShareRoleInput!) {\n updateComponentShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateComponentShareLink($input: CreateShareGrantLinkInput!) {\n createComponentShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeComponentShareLink($input: RevokeShareInput!) {\n revokeComponentShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── template ────────────────────────────────────────────────────────────────\n// VibecontrolsTemplate has `name`, `hasShares`, `myRole`; NO `vibeId`.\nconst templateOps: EntityShareOps = {\n readField: 'vibecontrolsTemplate',\n createLinkField: 'createTemplateShareLink',\n sharesQuery: gql`\n query TemplateShares($id: ID!) {\n vibecontrolsTemplate(id: $id) {\n id\n name\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareTemplate($input: ShareEntityInput!) {\n shareTemplate(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeTemplateShare($input: RevokeShareInput!) {\n revokeTemplateShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateTemplateShareRole($input: UpdateShareRoleInput!) {\n updateTemplateShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateTemplateShareLink($input: CreateShareGrantLinkInput!) {\n createTemplateShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeTemplateShareLink($input: RevokeShareInput!) {\n revokeTemplateShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── scorecard ───────────────────────────────────────────────────────────────\n// VibecontrolsScorecard has NO `name` and NO read-by-`id` query — only\n// `vibecontrolsScorecard(ownerId, ownerType)`. The read takes `($ownerId,\n// $ownerType)` and `readVariables` maps the identity's owner pair onto them.\n// The call site uses the resource `id` as the dialog title (no name field).\nconst scorecardOps: EntityShareOps = {\n readField: 'vibecontrolsScorecard',\n createLinkField: 'createScorecardShareLink',\n readVariables: ({ owner }) => ({\n ownerId: owner?.ownerId ?? '',\n ownerType: owner?.ownerType ?? '',\n }),\n sharesQuery: gql`\n query ScorecardShares($ownerId: ID!, $ownerType: ScorecardOwnerType!) {\n vibecontrolsScorecard(ownerId: $ownerId, ownerType: $ownerType) {\n id\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareScorecard($input: ShareEntityInput!) {\n shareScorecard(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeScorecardShare($input: RevokeShareInput!) {\n revokeScorecardShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateScorecardShareRole($input: UpdateShareRoleInput!) {\n updateScorecardShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateScorecardShareLink($input: CreateShareGrantLinkInput!) {\n createScorecardShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeScorecardShareLink($input: RevokeShareInput!) {\n revokeScorecardShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── target ──────────────────────────────────────────────────────────────────\n// Target (bare type) has `name`, `hasShares`, `myRole`; NO `vibeId`.\nconst targetOps: EntityShareOps = {\n readField: 'target',\n createLinkField: 'createTargetShareLink',\n sharesQuery: gql`\n query TargetShares($id: ID!) {\n target(id: $id) {\n id\n name\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareTarget($input: ShareEntityInput!) {\n shareTarget(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeTargetShare($input: RevokeShareInput!) {\n revokeTargetShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateTargetShareRole($input: UpdateShareRoleInput!) {\n updateTargetShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateTargetShareLink($input: CreateShareGrantLinkInput!) {\n createTargetShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeTargetShareLink($input: RevokeShareInput!) {\n revokeTargetShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── docs ────────────────────────────────────────────────────────────────────\n// VibecontrolsDocsSite has `name`, `hasShares`, `myRole`, AND `vibeId`, but NO\n// read-by-`id` query — only `vibecontrolsDocsSiteByOwner(ownerId, ownerType)`.\n// The read takes `($ownerId, $ownerType)` and `readVariables` maps the owner\n// pair onto them; `vibeId` still flows through for \"Everyone with Vibe\" mode.\nconst docsOps: EntityShareOps = {\n readField: 'vibecontrolsDocsSiteByOwner',\n createLinkField: 'createDocsShareLink',\n readVariables: ({ owner }) => ({\n ownerId: owner?.ownerId ?? '',\n ownerType: owner?.ownerType ?? '',\n }),\n sharesQuery: gql`\n query DocsSiteShares($ownerId: ID!, $ownerType: VibecontrolsDocsSiteOwnerType!) {\n vibecontrolsDocsSiteByOwner(ownerId: $ownerId, ownerType: $ownerType) {\n id\n name\n vibeId\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareDocs($input: ShareEntityInput!) {\n shareDocs(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeDocsShare($input: RevokeShareInput!) {\n revokeDocsShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateDocsShareRole($input: UpdateShareRoleInput!) {\n updateDocsShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateDocsShareLink($input: CreateShareGrantLinkInput!) {\n createDocsShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeDocsShareLink($input: RevokeShareInput!) {\n revokeDocsShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n/** Entity types served by the generic {@link useEntityShareController}. */\nexport type GenericShareEntity =\n | 'aiprompt'\n | 'action'\n | 'aicontext'\n | 'instructionfile'\n | 'tunnel'\n | 'catalog'\n | 'component'\n | 'template'\n | 'scorecard'\n | 'target'\n | 'docs';\n\n/** Resolve the inline-`gql` document set for a generic-sharing entity. */\nexport const ENTITY_SHARE_OPS: Record<GenericShareEntity, EntityShareOps> = {\n aiprompt: aiPromptOps,\n action: actionOps,\n aicontext: aiContextOps,\n instructionfile: instructionFileOps,\n tunnel: tunnelOps,\n catalog: catalogOps,\n component: componentOps,\n template: templateOps,\n scorecard: scorecardOps,\n target: targetOps,\n docs: docsOps,\n};\n"],"mappings":";;AA2sBA,IAAa,IAA+D;CAC1E,UAroBkC;EAClC,WAAW;EACX,iBAAiB;EACjB,aAAa,CAAG;;;;;;;;YAQN,EAAmB;;;;;EAK7B,OAAO,CAAG;;;UAGF,EAAmB;;;;EAI3B,aAAa,CAAG;;;;;;;EAOhB,iBAAiB,CAAG;;;;;;;;EAQpB,iBAAiB,CAAG;;;UAGZ,EAAmB;;;;EAI3B,iBAAiB,CAAG;;;;;;;EAOrB;CAklBC,QA/kBgC;EAChC,WAAW;EACX,iBAAiB;EACjB,aAAa,CAAG;;;;;;;;;YASN,EAAmB;;;;;EAK7B,OAAO,CAAG;;;UAGF,EAAmB;;;;EAI3B,aAAa,CAAG;;;;;;;EAOhB,iBAAiB,CAAG;;;;;;;;EAQpB,iBAAiB,CAAG;;;UAGZ,EAAmB;;;;EAI3B,iBAAiB,CAAG;;;;;;;EAOrB;CA2hBC,WAxhBmC;EACnC,WAAW;EACX,iBAAiB;EAC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|
+
{"version":3,"file":"entityShareOps.js","names":[],"sources":["../../../src/components/sharing/entityShareOps.ts"],"sourcesContent":["/**\n * Per-entity GraphQL document set for the generic-sharing controllers\n * (`useEntityShareController`).\n *\n * The generic-sharing operations (`shareAiPrompt`, `aiPrompt.shares`, `myRole`,\n * …) are NOT in the committed `graphql/wspace.graphql` snapshot the codegen\n * reads, so — exactly like `useVibeShareController` / `useNoteShareController` —\n * we hand-write the documents with inline `gql` against the MFE's Apollo client.\n *\n * Each {@link EntityShareOps} bundles the five mutations + the read query for a\n * single entity. The read query projects the resource's `shares`/`myRole` (and,\n * where the backend exposes it, `hasShares`) onto the fe-libs `ShareController`\n * contract. The mutation/read-field names below were verified 1:1 against the\n * deployed `wspace-vibecontrols-svc/.hive-schema.graphql`.\n *\n * Notable per-entity shape differences captured here:\n * - `aiPrompt` has NO `hasShares` field — its read query omits it.\n * - `agentInstructionFile` has NO `name`; it exposes `effectiveFilename`\n * (non-null) + `customName`, so its read query selects those instead.\n * - `vibecontrolsScorecard` and `vibecontrolsDocsSite` have NO read-by-`id`\n * query — the only reads are `(ownerId, ownerType)`. Their `sharesQuery`\n * therefore takes `($ownerId, $ownerType)` and the entity declares\n * `readVariables` to map the controller's `{ id, owner }` onto those args.\n * `scorecard` additionally has NO display-name field, so the call site uses\n * the resource `id` as the dialog title.\n */\n\nimport { gql, type DocumentNode } from '@apollo/client';\n\nimport { SHARE_GRANT_FIELDS } from './shareControllerTypes';\n\n/**\n * Identity the generic controller resolves a resource by. Most entities read by\n * `id`; the two owner-keyed entities (scorecard, docs) additionally carry the\n * `(ownerId, ownerType)` pair their read query requires.\n */\nexport interface EntityShareIdentity {\n /** Stable resource id (always present once the surface has loaded the row). */\n id: string;\n /** `(ownerId, ownerType)` for entities read by owner instead of by id. */\n owner?: { ownerId: string; ownerType: string } | null;\n}\n\n/** The five share mutation documents + read query for one entity. */\nexport interface EntityShareOps {\n /** Reads the resource's `shares` / `myRole` (+ display name + optional `vibeId`). */\n sharesQuery: DocumentNode;\n /** `share<Entity>(input: ShareEntityInput!)`. */\n share: DocumentNode;\n /** `revoke<Entity>Share(input: RevokeShareInput!)`. */\n revokeShare: DocumentNode;\n /** `update<Entity>ShareRole(input: UpdateShareRoleInput!)`. */\n updateShareRole: DocumentNode;\n /** `create<Entity>ShareLink(input: CreateShareGrantLinkInput!)`. */\n createShareLink: DocumentNode;\n /** `revoke<Entity>ShareLink(input: RevokeShareInput!)`. */\n revokeShareLink: DocumentNode;\n /** Top-level read field name (`aiPrompt`, `action`, …) used to read the response. */\n readField: string;\n /** Mutation field name that returns the created link grant (for `shareUrl`). */\n createLinkField: string;\n /**\n * Maps the resource identity onto the variables {@link sharesQuery} expects.\n * Defaults to `{ id }` for the standard `($id: ID!)` read. Entities read by\n * owner (scorecard, docs) override this to emit `{ ownerId, ownerType }`.\n */\n readVariables?: (identity: EntityShareIdentity) => Record<string, unknown>;\n}\n\n// ── aiprompt ────────────────────────────────────────────────────────────────\n// AiPrompt has NO `hasShares` field — read query omits it.\nconst aiPromptOps: EntityShareOps = {\n readField: 'aiPrompt',\n createLinkField: 'createAiPromptShareLink',\n sharesQuery: gql`\n query AiPromptShares($id: ID!) {\n aiPrompt(id: $id) {\n id\n name\n vibeId\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareAiPrompt($input: ShareEntityInput!) {\n shareAiPrompt(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeAiPromptShare($input: RevokeShareInput!) {\n revokeAiPromptShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateAiPromptShareRole($input: UpdateShareRoleInput!) {\n updateAiPromptShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateAiPromptShareLink($input: CreateShareGrantLinkInput!) {\n createAiPromptShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeAiPromptShareLink($input: RevokeShareInput!) {\n revokeAiPromptShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── action ──────────────────────────────────────────────────────────────────\nconst actionOps: EntityShareOps = {\n readField: 'action',\n createLinkField: 'createActionShareLink',\n sharesQuery: gql`\n query ActionShares($id: ID!) {\n action(id: $id) {\n id\n name\n vibeId\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareAction($input: ShareEntityInput!) {\n shareAction(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeActionShare($input: RevokeShareInput!) {\n revokeActionShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateActionShareRole($input: UpdateShareRoleInput!) {\n updateActionShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateActionShareLink($input: CreateShareGrantLinkInput!) {\n createActionShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeActionShareLink($input: RevokeShareInput!) {\n revokeActionShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── aicontext ─────────────────────────────────────────────────────────────────\nconst aiContextOps: EntityShareOps = {\n readField: 'aiContext',\n createLinkField: 'createAiContextShareLink',\n sharesQuery: gql`\n query AiContextShares($id: ID!) {\n aiContext(id: $id) {\n id\n name\n vibeId\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareAiContext($input: ShareEntityInput!) {\n shareAiContext(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeAiContextShare($input: RevokeShareInput!) {\n revokeAiContextShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateAiContextShareRole($input: UpdateShareRoleInput!) {\n updateAiContextShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateAiContextShareLink($input: CreateShareGrantLinkInput!) {\n createAiContextShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeAiContextShareLink($input: RevokeShareInput!) {\n revokeAiContextShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── instructionfile ───────────────────────────────────────────────────────────\n// AgentInstructionFile has NO `name`; the display name is `effectiveFilename`.\nconst instructionFileOps: EntityShareOps = {\n readField: 'agentInstructionFile',\n createLinkField: 'createAgentInstructionFileShareLink',\n sharesQuery: gql`\n query AgentInstructionFileShares($id: ID!) {\n agentInstructionFile(id: $id) {\n id\n effectiveFilename\n vibeId\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareAgentInstructionFile($input: ShareEntityInput!) {\n shareAgentInstructionFile(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeAgentInstructionFileShare($input: RevokeShareInput!) {\n revokeAgentInstructionFileShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateAgentInstructionFileShareRole($input: UpdateShareRoleInput!) {\n updateAgentInstructionFileShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateAgentInstructionFileShareLink($input: CreateShareGrantLinkInput!) {\n createAgentInstructionFileShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeAgentInstructionFileShareLink($input: RevokeShareInput!) {\n revokeAgentInstructionFileShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── tunnel ────────────────────────────────────────────────────────────────────\nconst tunnelOps: EntityShareOps = {\n readField: 'tunnel',\n createLinkField: 'createTunnelShareLink',\n sharesQuery: gql`\n query TunnelShares($id: ID!) {\n tunnel(id: $id) {\n id\n name\n vibeId\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareTunnel($input: ShareEntityInput!) {\n shareTunnel(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeTunnelShare($input: RevokeShareInput!) {\n revokeTunnelShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateTunnelShareRole($input: UpdateShareRoleInput!) {\n updateTunnelShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateTunnelShareLink($input: CreateShareGrantLinkInput!) {\n createTunnelShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeTunnelShareLink($input: RevokeShareInput!) {\n revokeTunnelShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── catalog ─────────────────────────────────────────────────────────────────\n// VibecontrolsCatalog has `name`, `hasShares`, `myRole`; NO `vibeId`.\nconst catalogOps: EntityShareOps = {\n readField: 'vibecontrolsCatalog',\n createLinkField: 'createCatalogShareLink',\n sharesQuery: gql`\n query CatalogShares($id: ID!) {\n vibecontrolsCatalog(id: $id) {\n id\n name\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareCatalog($input: ShareEntityInput!) {\n shareCatalog(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeCatalogShare($input: RevokeShareInput!) {\n revokeCatalogShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateCatalogShareRole($input: UpdateShareRoleInput!) {\n updateCatalogShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateCatalogShareLink($input: CreateShareGrantLinkInput!) {\n createCatalogShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeCatalogShareLink($input: RevokeShareInput!) {\n revokeCatalogShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── component ───────────────────────────────────────────────────────────────\n// VibecontrolsComponent has `name`, `hasShares`, `myRole`; NO `vibeId`.\nconst componentOps: EntityShareOps = {\n readField: 'vibecontrolsComponent',\n createLinkField: 'createComponentShareLink',\n sharesQuery: gql`\n query ComponentShares($id: ID!) {\n vibecontrolsComponent(id: $id) {\n id\n name\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareComponent($input: ShareEntityInput!) {\n shareComponent(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeComponentShare($input: RevokeShareInput!) {\n revokeComponentShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateComponentShareRole($input: UpdateShareRoleInput!) {\n updateComponentShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateComponentShareLink($input: CreateShareGrantLinkInput!) {\n createComponentShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeComponentShareLink($input: RevokeShareInput!) {\n revokeComponentShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── template ────────────────────────────────────────────────────────────────\n// VibecontrolsTemplate has `name`, `hasShares`, `myRole`; NO `vibeId`.\nconst templateOps: EntityShareOps = {\n readField: 'vibecontrolsTemplate',\n createLinkField: 'createTemplateShareLink',\n sharesQuery: gql`\n query TemplateShares($id: ID!) {\n vibecontrolsTemplate(id: $id) {\n id\n name\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareTemplate($input: ShareEntityInput!) {\n shareTemplate(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeTemplateShare($input: RevokeShareInput!) {\n revokeTemplateShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateTemplateShareRole($input: UpdateShareRoleInput!) {\n updateTemplateShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateTemplateShareLink($input: CreateShareGrantLinkInput!) {\n createTemplateShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeTemplateShareLink($input: RevokeShareInput!) {\n revokeTemplateShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── scorecard ───────────────────────────────────────────────────────────────\n// VibecontrolsScorecard has NO `name` and NO read-by-`id` query — only\n// `vibecontrolsScorecard(ownerId, ownerType)`. The read takes `($ownerId,\n// $ownerType)` and `readVariables` maps the identity's owner pair onto them.\n// The call site uses the resource `id` as the dialog title (no name field).\nconst scorecardOps: EntityShareOps = {\n readField: 'vibecontrolsScorecard',\n createLinkField: 'createScorecardShareLink',\n readVariables: ({ owner }) => ({\n ownerId: owner?.ownerId ?? '',\n ownerType: owner?.ownerType ?? '',\n }),\n sharesQuery: gql`\n query ScorecardShares($ownerId: ID!, $ownerType: ScorecardOwnerType!) {\n vibecontrolsScorecard(ownerId: $ownerId, ownerType: $ownerType) {\n id\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareScorecard($input: ShareEntityInput!) {\n shareScorecard(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeScorecardShare($input: RevokeShareInput!) {\n revokeScorecardShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateScorecardShareRole($input: UpdateShareRoleInput!) {\n updateScorecardShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateScorecardShareLink($input: CreateShareGrantLinkInput!) {\n createScorecardShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeScorecardShareLink($input: RevokeShareInput!) {\n revokeScorecardShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── target ──────────────────────────────────────────────────────────────────\n// Target (bare type) has `name`, `hasShares`, `myRole`; NO `vibeId`.\nconst targetOps: EntityShareOps = {\n readField: 'target',\n createLinkField: 'createTargetShareLink',\n sharesQuery: gql`\n query TargetShares($id: ID!) {\n target(id: $id) {\n id\n name\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareTarget($input: ShareEntityInput!) {\n shareTarget(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeTargetShare($input: RevokeShareInput!) {\n revokeTargetShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateTargetShareRole($input: UpdateShareRoleInput!) {\n updateTargetShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateTargetShareLink($input: CreateShareGrantLinkInput!) {\n createTargetShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeTargetShareLink($input: RevokeShareInput!) {\n revokeTargetShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── docs ────────────────────────────────────────────────────────────────────\n// VibecontrolsDocsSite has `name`, `hasShares`, `myRole`, AND `vibeId`, but NO\n// read-by-`id` query — only `vibecontrolsDocsSiteByOwner(ownerId, ownerType)`.\n// The read takes `($ownerId, $ownerType)` and `readVariables` maps the owner\n// pair onto them; `vibeId` still flows through for \"Everyone with Vibe\" mode.\nconst docsOps: EntityShareOps = {\n readField: 'vibecontrolsDocsSiteByOwner',\n createLinkField: 'createDocsShareLink',\n readVariables: ({ owner }) => ({\n ownerId: owner?.ownerId ?? '',\n ownerType: owner?.ownerType ?? '',\n }),\n sharesQuery: gql`\n query DocsSiteShares($ownerId: ID!, $ownerType: VibecontrolsDocsSiteOwnerType!) {\n vibecontrolsDocsSiteByOwner(ownerId: $ownerId, ownerType: $ownerType) {\n id\n name\n vibeId\n hasShares\n myRole\n shares {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareDocs($input: ShareEntityInput!) {\n shareDocs(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeDocsShare($input: RevokeShareInput!) {\n revokeDocsShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateDocsShareRole($input: UpdateShareRoleInput!) {\n updateDocsShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateDocsShareLink($input: CreateShareGrantLinkInput!) {\n createDocsShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeDocsShareLink($input: RevokeShareInput!) {\n revokeDocsShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── session ───────────────────────────────────────────────────────────────────\n// Session exposes the generic share grants under DISTINCT field names from the\n// other entities: `shareGrants: [ShareGrant!]!` (not `shares`) and\n// `myGrantRole: ShareRole` (not `myRole`) — because the legacy `shares` field\n// still returns the bespoke `[SessionShare!]!` (the dual-write target). We alias\n// `shareGrants → shares` and `myGrantRole → myRole` so the response projects\n// onto the shared `useEntityShareController` contract unchanged. The five grant\n// mutations carry the `Grant` infix (`shareSessionGrant`,\n// `revokeSessionGrantShare`, …), distinct from the legacy `shareSession` /\n// `revokeSessionShare` ops the old `SessionShareDialog` used. NO `hasShares`.\nconst sessionOps: EntityShareOps = {\n readField: 'session',\n createLinkField: 'createSessionGrantShareLink',\n sharesQuery: gql`\n query SessionShares($id: ID!) {\n session(id: $id) {\n id\n name\n vibeId\n myRole: myGrantRole\n shares: shareGrants {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareSessionGrant($input: ShareEntityInput!) {\n shareSessionGrant(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeSessionGrantShare($input: RevokeShareInput!) {\n revokeSessionGrantShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateSessionGrantShareRole($input: UpdateShareRoleInput!) {\n updateSessionGrantShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateSessionGrantShareLink($input: CreateShareGrantLinkInput!) {\n createSessionGrantShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeSessionGrantShareLink($input: RevokeShareInput!) {\n revokeSessionGrantShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n// ── vibedeck ──────────────────────────────────────────────────────────────────\n// VibeDeck mirrors Session: generic grants live under `shareGrants` +\n// `myGrantRole` (the legacy `shareLinks` field is the bespoke dual-write\n// target), so we alias `shareGrants → shares` / `myGrantRole → myRole`. The five\n// grant mutations carry the `Grant` infix (`shareVibeDeckGrant`,\n// `revokeVibeDeckGrantShare`, …), distinct from the legacy\n// `createVibeDeckShareLink` the old `VibeDeckShareDialog` used. Carries `vibeId`\n// (so \"Everyone with Vibe\" mode is available); NO `hasShares`.\nconst vibeDeckOps: EntityShareOps = {\n readField: 'vibeDeck',\n createLinkField: 'createVibeDeckGrantShareLink',\n sharesQuery: gql`\n query VibeDeckShares($id: ID!) {\n vibeDeck(id: $id) {\n id\n name\n vibeId\n myRole: myGrantRole\n shares: shareGrants {\n ${SHARE_GRANT_FIELDS}\n }\n }\n }\n `,\n share: gql`\n mutation ShareVibeDeckGrant($input: ShareEntityInput!) {\n shareVibeDeckGrant(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShare: gql`\n mutation RevokeVibeDeckGrantShare($input: RevokeShareInput!) {\n revokeVibeDeckGrantShare(input: $input) {\n id\n }\n }\n `,\n updateShareRole: gql`\n mutation UpdateVibeDeckGrantShareRole($input: UpdateShareRoleInput!) {\n updateVibeDeckGrantShareRole(input: $input) {\n id\n role\n }\n }\n `,\n createShareLink: gql`\n mutation CreateVibeDeckGrantShareLink($input: CreateShareGrantLinkInput!) {\n createVibeDeckGrantShareLink(input: $input) {\n ${SHARE_GRANT_FIELDS}\n }\n }\n `,\n revokeShareLink: gql`\n mutation RevokeVibeDeckGrantShareLink($input: RevokeShareInput!) {\n revokeVibeDeckGrantShareLink(input: $input) {\n id\n }\n }\n `,\n};\n\n/** Entity types served by the generic {@link useEntityShareController}. */\nexport type GenericShareEntity =\n | 'aiprompt'\n | 'action'\n | 'aicontext'\n | 'instructionfile'\n | 'tunnel'\n | 'catalog'\n | 'component'\n | 'template'\n | 'scorecard'\n | 'target'\n | 'docs'\n | 'session'\n | 'vibedeck';\n\n/** Resolve the inline-`gql` document set for a generic-sharing entity. */\nexport const ENTITY_SHARE_OPS: Record<GenericShareEntity, EntityShareOps> = {\n aiprompt: aiPromptOps,\n action: actionOps,\n aicontext: aiContextOps,\n instructionfile: instructionFileOps,\n tunnel: tunnelOps,\n catalog: catalogOps,\n component: componentOps,\n template: templateOps,\n scorecard: scorecardOps,\n target: targetOps,\n docs: docsOps,\n session: sessionOps,\n vibedeck: vibeDeckOps,\n};\n"],"mappings":";;AA20BA,IAAa,IAA+D;CAC1E,UArwBkC;EAClC,WAAW;EACX,iBAAiB;EACjB,aAAa,CAAG;;;;;;;;YAQN,EAAmB;;;;;EAK7B,OAAO,CAAG;;;UAGF,EAAmB;;;;EAI3B,aAAa,CAAG;;;;;;;EAOhB,iBAAiB,CAAG;;;;;;;;EAQpB,iBAAiB,CAAG;;;UAGZ,EAAmB;;;;EAI3B,iBAAiB,CAAG;;;;;;;EAOrB;CAktBC,QA/sBgC;EAChC,WAAW;EACX,iBAAiB;EACjB,aAAa,CAAG;;;;;;;;;YASN,EAAmB;;;;;EAK7B,OAAO,CAAG;;;UAGF,EAAmB;;;;EAI3B,aAAa,CAAG;;;;;;;EAOhB,i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I3B,aAAa,CAAG;;;;;;;EAOhB,iBAAiB,CAAG;;;;;;;;EAQpB,iBAAiB,CAAG;;;UAGZ,EAAmB;;;;EAI3B,iBAAiB,CAAG;;;;;;;EAOrB;CA6JC,SAjJiC;EACjC,WAAW;EACX,iBAAiB;EACjB,aAAa,CAAG;;;;;;;;YAQN,EAAmB;;;;;EAK7B,OAAO,CAAG;;;UAGF,EAAmB;;;;EAI3B,aAAa,CAAG;;;;;;;EAOhB,iBAAiB,CAAG;;;;;;;;EAQpB,iBAAiB,CAAG;;;UAGZ,EAAmB;;;;EAI3B,iBAAiB,CAAG;;;;;;;EAOrB;CA8FC,UApFkC;EAClC,WAAW;EACX,iBAAiB;EACjB,aAAa,CAAG;;;;;;;;YAQN,EAAmB;;;;;EAK7B,OAAO,CAAG;;;UAGF,EAAmB;;;;EAI3B,aAAa,CAAG;;;;;;;EAOhB,iBAAiB,CAAG;;;;;;;;EAQpB,iBAAiB,CAAG;;;UAGZ,EAAmB;;;;EAI3B,iBAAiB,CAAG;;;;;;;EAOrB;CAiCA"}
|
|
@@ -37,14 +37,14 @@ var t = (e) => `vibecontrols.sharing.${e}`, n = {
|
|
|
37
37
|
defaultEnabled: !0
|
|
38
38
|
},
|
|
39
39
|
session: {
|
|
40
|
-
permission: e.
|
|
40
|
+
permission: e.SESSION_SHARE,
|
|
41
41
|
featureFlag: t("session"),
|
|
42
|
-
defaultEnabled: !
|
|
42
|
+
defaultEnabled: !0
|
|
43
43
|
},
|
|
44
44
|
vibedeck: {
|
|
45
45
|
permission: e.VIBEDECK_SHARE,
|
|
46
46
|
featureFlag: t("vibedeck"),
|
|
47
|
-
defaultEnabled: !
|
|
47
|
+
defaultEnabled: !0
|
|
48
48
|
},
|
|
49
49
|
catalog: {
|
|
50
50
|
permission: e.CATALOG_SHARE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shareRegistry.js","names":[],"sources":["../../../src/components/sharing/shareRegistry.ts"],"sourcesContent":["/**\n * Central registry mapping a VibeControls entity type to the RBAC permission\n * that gates its Share affordance plus the platform feature flag that toggles\n * the generic-sharing UI for that entity.\n *\n * Why a registry: the generic sharing dialog (`@burdenoff/fe-libs/sharing`) is\n * entity-agnostic. Each surface that wants a Share button looks its entity up\n * here so the permission string + feature flag stay in one place rather than\n * being re-typed at every call site.\n *\n * Rollout posture:\n * - `vibe` / `note` / `aiprompt` / `action` / `aicontext` / `instructionfile` /\n * `tunnel` ship ON (`defaultEnabled: true`) — the backend share mutations are\n * deployed in prod and the FE controllers in this folder are complete for them\n * (`useVibeShareController`, `useNoteShareController`, and the generic\n * `useEntityShareController` cover the latter five).\n * - `session` / `vibedeck`
|
|
1
|
+
{"version":3,"file":"shareRegistry.js","names":[],"sources":["../../../src/components/sharing/shareRegistry.ts"],"sourcesContent":["/**\n * Central registry mapping a VibeControls entity type to the RBAC permission\n * that gates its Share affordance plus the platform feature flag that toggles\n * the generic-sharing UI for that entity.\n *\n * Why a registry: the generic sharing dialog (`@burdenoff/fe-libs/sharing`) is\n * entity-agnostic. Each surface that wants a Share button looks its entity up\n * here so the permission string + feature flag stay in one place rather than\n * being re-typed at every call site.\n *\n * Rollout posture:\n * - `vibe` / `note` / `aiprompt` / `action` / `aicontext` / `instructionfile` /\n * `tunnel` ship ON (`defaultEnabled: true`) — the backend share mutations are\n * deployed in prod and the FE controllers in this folder are complete for them\n * (`useVibeShareController`, `useNoteShareController`, and the generic\n * `useEntityShareController` cover the latter five).\n * - `session` / `vibedeck` now ship ON (`defaultEnabled: true`): their former\n * bespoke share dialogs (`SessionShareDialog`, `VibeDeckShareDialog`) were\n * pure share-record management (not entangled with realtime collaboration —\n * that lives in `SharedTerminalPanel`/`SharedSessionPage`), so we replaced\n * their share UI with the generic `<ShareDialog>` via the inline-`gql` op sets\n * in `entityShareOps.ts`. They gate on `session:share` / `vibedeck:share`.\n * - The long-tail entries (catalog/component/template/scorecard/target/docs)\n * now ship ON (`defaultEnabled: true`): their backend share mutations exist\n * and the generic `useEntityShareController` serves them via the inline-`gql`\n * document sets in `entityShareOps.ts`. Each is gated on its own `<entity>\n * :share` RBAC permission (catalog/component/template/scorecard/target →\n * `<entity>:share`; docs → `docs_site:share`).\n */\n\nimport { VIBE_PERMISSIONS } from '@/constants/permissions';\n\n/** A single entity's sharing wiring. */\nexport interface ShareRegistryEntry {\n /** RBAC permission required to open the Share dialog for this entity. */\n permission: string;\n /** Platform feature flag key that toggles the generic-sharing surface. */\n featureFlag: string;\n /**\n * Default value for {@link useFeatureFlag} when the flag is absent.\n * `true` = generic sharing live for this entity; `false` = hidden until the\n * flag is explicitly enabled (long-tail + legacy-dialog entities).\n */\n defaultEnabled: boolean;\n}\n\n/** Every entity type the registry knows about. */\nexport type ShareEntityType =\n | 'vibe'\n | 'note'\n | 'aiprompt'\n | 'action'\n | 'aicontext'\n | 'instructionfile'\n | 'tunnel'\n | 'session'\n | 'vibedeck'\n | 'catalog'\n | 'component'\n | 'template'\n | 'scorecard'\n | 'target'\n | 'docs';\n\nconst flagKey = (entity: ShareEntityType): string => `vibecontrols.sharing.${entity}`;\n\nexport const SHARE_REGISTRY: Record<ShareEntityType, ShareRegistryEntry> = {\n // ── finishable: generic sharing ON ───────────────────────────────────────\n vibe: {\n permission: VIBE_PERMISSIONS.VIBE_MANAGE,\n featureFlag: flagKey('vibe'),\n defaultEnabled: true,\n },\n note: {\n permission: VIBE_PERMISSIONS.NOTE_UPDATE,\n featureFlag: flagKey('note'),\n defaultEnabled: true,\n },\n aiprompt: {\n permission: VIBE_PERMISSIONS.AIPROMPT_SHARE,\n featureFlag: flagKey('aiprompt'),\n defaultEnabled: true,\n },\n action: {\n permission: VIBE_PERMISSIONS.ACTION_SHARE,\n featureFlag: flagKey('action'),\n defaultEnabled: true,\n },\n aicontext: {\n permission: VIBE_PERMISSIONS.AICONTEXT_SHARE,\n featureFlag: flagKey('aicontext'),\n defaultEnabled: true,\n },\n instructionfile: {\n permission: VIBE_PERMISSIONS.INSTRUCTION_FILE_SHARE,\n featureFlag: flagKey('instructionfile'),\n defaultEnabled: true,\n },\n tunnel: {\n permission: VIBE_PERMISSIONS.TUNNEL_SHARE,\n featureFlag: flagKey('tunnel'),\n defaultEnabled: true,\n },\n\n // ── migrated from bespoke dialogs: generic sharing ON ─────────────────────\n // `session` / `vibedeck` previously rode bespoke share dialogs\n // (`SessionShareDialog`, `VibeDeckShareDialog`). Those dialogs were pure\n // share-record management (create/list/revoke grants + links) and were NOT\n // entangled with realtime collaboration — live presence / terminal control\n // handoff lives in the separate `SharedTerminalPanel` / `SharedSessionPage`,\n // driven by the session's collaborator list, never by the share dialog. So we\n // replaced the bespoke share UI with the richer generic `<ShareDialog>`\n // (email invite + accept-gate + 4 visibility modes + expiry + public link)\n // and flipped these ON. The generic grant mutations gate on `action:\"share\"`\n // (`session:share` / `vibedeck:share`), distinct from the legacy\n // `action:\"update\"` dual-write mutations.\n session: {\n permission: VIBE_PERMISSIONS.SESSION_SHARE,\n featureFlag: flagKey('session'),\n defaultEnabled: true,\n },\n vibedeck: {\n permission: VIBE_PERMISSIONS.VIBEDECK_SHARE,\n featureFlag: flagKey('vibedeck'),\n defaultEnabled: true,\n },\n\n // ── long-tail: generic sharing ON ─────────────────────────────────────────\n catalog: {\n permission: VIBE_PERMISSIONS.CATALOG_SHARE,\n featureFlag: flagKey('catalog'),\n defaultEnabled: true,\n },\n component: {\n permission: VIBE_PERMISSIONS.COMPONENT_SHARE,\n featureFlag: flagKey('component'),\n defaultEnabled: true,\n },\n template: {\n permission: VIBE_PERMISSIONS.TEMPLATE_SHARE,\n featureFlag: flagKey('template'),\n defaultEnabled: true,\n },\n scorecard: {\n permission: VIBE_PERMISSIONS.SCORECARD_SHARE,\n featureFlag: flagKey('scorecard'),\n defaultEnabled: true,\n },\n target: {\n permission: VIBE_PERMISSIONS.TARGET_SHARE,\n featureFlag: flagKey('target'),\n defaultEnabled: true,\n },\n docs: {\n permission: VIBE_PERMISSIONS.DOCS_SITE_SHARE,\n featureFlag: flagKey('docs'),\n defaultEnabled: true,\n },\n};\n\n/** Lookup helper; returns `undefined` for unknown entity types. */\nexport function getShareRegistryEntry(entity: ShareEntityType): ShareRegistryEntry | undefined {\n return SHARE_REGISTRY[entity];\n}\n"],"mappings":";;AAgEA,IAAM,KAAW,MAAoC,wBAAwB,KAEhE,IAA8D;CAEzE,MAAM;EACJ,YAAY,EAAiB;EAC7B,aAAa,EAAQ,OAAO;EAC5B,gBAAgB;EACjB;CACD,MAAM;EACJ,YAAY,EAAiB;EAC7B,aAAa,EAAQ,OAAO;EAC5B,gBAAgB;EACjB;CACD,UAAU;EACR,YAAY,EAAiB;EAC7B,aAAa,EAAQ,WAAW;EAChC,gBAAgB;EACjB;CACD,QAAQ;EACN,YAAY,EAAiB;EAC7B,aAAa,EAAQ,SAAS;EAC9B,gBAAgB;EACjB;CACD,WAAW;EACT,YAAY,EAAiB;EAC7B,aAAa,EAAQ,YAAY;EACjC,gBAAgB;EACjB;CACD,iBAAiB;EACf,YAAY,EAAiB;EAC7B,aAAa,EAAQ,kBAAkB;EACvC,gBAAgB;EACjB;CACD,QAAQ;EACN,YAAY,EAAiB;EAC7B,aAAa,EAAQ,SAAS;EAC9B,gBAAgB;EACjB;CAcD,SAAS;EACP,YAAY,EAAiB;EAC7B,aAAa,EAAQ,UAAU;EAC/B,gBAAgB;EACjB;CACD,UAAU;EACR,YAAY,EAAiB;EAC7B,aAAa,EAAQ,WAAW;EAChC,gBAAgB;EACjB;CAGD,SAAS;EACP,YAAY,EAAiB;EAC7B,aAAa,EAAQ,UAAU;EAC/B,gBAAgB;EACjB;CACD,WAAW;EACT,YAAY,EAAiB;EAC7B,aAAa,EAAQ,YAAY;EACjC,gBAAgB;EACjB;CACD,UAAU;EACR,YAAY,EAAiB;EAC7B,aAAa,EAAQ,WAAW;EAChC,gBAAgB;EACjB;CACD,WAAW;EACT,YAAY,EAAiB;EAC7B,aAAa,EAAQ,YAAY;EACjC,gBAAgB;EACjB;CACD,QAAQ;EACN,YAAY,EAAiB;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