@contractspec/example.team-hub 1.57.0 → 1.59.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.
Files changed (138) hide show
  1. package/dist/announcement/announcement.operations.d.ts +50 -56
  2. package/dist/announcement/announcement.operations.d.ts.map +1 -1
  3. package/dist/announcement/announcement.operations.js +70 -51
  4. package/dist/announcement/announcement.schema.d.ts +50 -55
  5. package/dist/announcement/announcement.schema.d.ts.map +1 -1
  6. package/dist/announcement/announcement.schema.js +29 -71
  7. package/dist/announcement/index.d.ts +6 -3
  8. package/dist/announcement/index.d.ts.map +1 -0
  9. package/dist/announcement/index.js +73 -3
  10. package/dist/browser/announcement/announcement.operations.js +71 -0
  11. package/dist/browser/announcement/announcement.schema.js +30 -0
  12. package/dist/browser/announcement/index.js +73 -0
  13. package/dist/browser/docs/index.js +94 -0
  14. package/dist/browser/docs/team-hub.docblock.js +94 -0
  15. package/dist/browser/entities/index.js +231 -0
  16. package/dist/browser/events.js +134 -0
  17. package/dist/browser/example.js +42 -0
  18. package/dist/browser/handlers/index.js +5 -0
  19. package/dist/browser/index.js +642 -0
  20. package/dist/browser/presentations/index.js +131 -0
  21. package/dist/browser/presentations/team-hub.presentation.js +131 -0
  22. package/dist/browser/presentations.js +148 -0
  23. package/dist/browser/ritual/index.js +124 -0
  24. package/dist/browser/ritual/ritual.operations.js +121 -0
  25. package/dist/browser/ritual/ritual.schema.js +41 -0
  26. package/dist/browser/space/index.js +66 -0
  27. package/dist/browser/space/space.operations.js +64 -0
  28. package/dist/browser/space/space.schema.js +27 -0
  29. package/dist/browser/task/index.js +171 -0
  30. package/dist/browser/task/task.operations.js +168 -0
  31. package/dist/browser/task/task.schema.js +40 -0
  32. package/dist/browser/team-hub.capability.js +40 -0
  33. package/dist/browser/team-hub.feature.js +69 -0
  34. package/dist/docs/index.d.ts +2 -1
  35. package/dist/docs/index.d.ts.map +1 -0
  36. package/dist/docs/index.js +95 -1
  37. package/dist/docs/team-hub.docblock.d.ts +2 -1
  38. package/dist/docs/team-hub.docblock.d.ts.map +1 -0
  39. package/dist/docs/team-hub.docblock.js +45 -56
  40. package/dist/entities/index.d.ts +138 -143
  41. package/dist/entities/index.d.ts.map +1 -1
  42. package/dist/entities/index.js +221 -252
  43. package/dist/events.d.ts +217 -223
  44. package/dist/events.d.ts.map +1 -1
  45. package/dist/events.js +122 -201
  46. package/dist/example.d.ts +2 -6
  47. package/dist/example.d.ts.map +1 -1
  48. package/dist/example.js +41 -55
  49. package/dist/handlers/index.d.ts +1 -4
  50. package/dist/handlers/index.d.ts.map +1 -1
  51. package/dist/handlers/index.js +5 -8
  52. package/dist/index.d.ts +12 -15
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +642 -15
  55. package/dist/node/announcement/announcement.operations.js +71 -0
  56. package/dist/node/announcement/announcement.schema.js +30 -0
  57. package/dist/node/announcement/index.js +73 -0
  58. package/dist/node/docs/index.js +94 -0
  59. package/dist/node/docs/team-hub.docblock.js +94 -0
  60. package/dist/node/entities/index.js +231 -0
  61. package/dist/node/events.js +134 -0
  62. package/dist/node/example.js +42 -0
  63. package/dist/node/handlers/index.js +5 -0
  64. package/dist/node/index.js +642 -0
  65. package/dist/node/presentations/index.js +131 -0
  66. package/dist/node/presentations/team-hub.presentation.js +131 -0
  67. package/dist/node/presentations.js +148 -0
  68. package/dist/node/ritual/index.js +124 -0
  69. package/dist/node/ritual/ritual.operations.js +121 -0
  70. package/dist/node/ritual/ritual.schema.js +41 -0
  71. package/dist/node/space/index.js +66 -0
  72. package/dist/node/space/space.operations.js +64 -0
  73. package/dist/node/space/space.schema.js +27 -0
  74. package/dist/node/task/index.js +171 -0
  75. package/dist/node/task/task.operations.js +168 -0
  76. package/dist/node/task/task.schema.js +40 -0
  77. package/dist/node/team-hub.capability.js +40 -0
  78. package/dist/node/team-hub.feature.js +69 -0
  79. package/dist/presentations/index.d.ts +2 -2
  80. package/dist/presentations/index.d.ts.map +1 -0
  81. package/dist/presentations/index.js +132 -3
  82. package/dist/presentations/team-hub.presentation.d.ts +6 -11
  83. package/dist/presentations/team-hub.presentation.d.ts.map +1 -1
  84. package/dist/presentations/team-hub.presentation.js +126 -125
  85. package/dist/presentations.d.ts +7 -11
  86. package/dist/presentations.d.ts.map +1 -1
  87. package/dist/presentations.js +142 -147
  88. package/dist/ritual/index.d.ts +6 -3
  89. package/dist/ritual/index.d.ts.map +1 -0
  90. package/dist/ritual/index.js +124 -3
  91. package/dist/ritual/ritual.operations.d.ts +92 -98
  92. package/dist/ritual/ritual.operations.d.ts.map +1 -1
  93. package/dist/ritual/ritual.operations.js +119 -95
  94. package/dist/ritual/ritual.schema.d.ts +67 -72
  95. package/dist/ritual/ritual.schema.d.ts.map +1 -1
  96. package/dist/ritual/ritual.schema.js +39 -95
  97. package/dist/space/index.d.ts +6 -3
  98. package/dist/space/index.d.ts.map +1 -0
  99. package/dist/space/index.js +66 -3
  100. package/dist/space/space.operations.d.ts +38 -44
  101. package/dist/space/space.operations.d.ts.map +1 -1
  102. package/dist/space/space.operations.js +63 -50
  103. package/dist/space/space.schema.d.ts +38 -43
  104. package/dist/space/space.schema.d.ts.map +1 -1
  105. package/dist/space/space.schema.js +26 -59
  106. package/dist/task/index.d.ts +6 -3
  107. package/dist/task/index.d.ts.map +1 -0
  108. package/dist/task/index.js +171 -3
  109. package/dist/task/task.operations.d.ts +212 -218
  110. package/dist/task/task.operations.d.ts.map +1 -1
  111. package/dist/task/task.operations.js +163 -174
  112. package/dist/task/task.schema.d.ts +63 -68
  113. package/dist/task/task.schema.d.ts.map +1 -1
  114. package/dist/task/task.schema.js +38 -91
  115. package/dist/team-hub.capability.d.ts +3 -8
  116. package/dist/team-hub.capability.d.ts.map +1 -1
  117. package/dist/team-hub.capability.js +41 -38
  118. package/dist/team-hub.feature.d.ts +1 -6
  119. package/dist/team-hub.feature.d.ts.map +1 -1
  120. package/dist/team-hub.feature.js +68 -159
  121. package/package.json +261 -57
  122. package/dist/announcement/announcement.operations.js.map +0 -1
  123. package/dist/announcement/announcement.schema.js.map +0 -1
  124. package/dist/docs/team-hub.docblock.js.map +0 -1
  125. package/dist/entities/index.js.map +0 -1
  126. package/dist/events.js.map +0 -1
  127. package/dist/example.js.map +0 -1
  128. package/dist/handlers/index.js.map +0 -1
  129. package/dist/presentations/team-hub.presentation.js.map +0 -1
  130. package/dist/presentations.js.map +0 -1
  131. package/dist/ritual/ritual.operations.js.map +0 -1
  132. package/dist/ritual/ritual.schema.js.map +0 -1
  133. package/dist/space/space.operations.js.map +0 -1
  134. package/dist/space/space.schema.js.map +0 -1
  135. package/dist/task/task.operations.js.map +0 -1
  136. package/dist/task/task.schema.js.map +0 -1
  137. package/dist/team-hub.capability.js.map +0 -1
  138. package/dist/team-hub.feature.js.map +0 -1
@@ -0,0 +1,71 @@
1
+ // src/announcement/announcement.schema.ts
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
+ var AnnouncementModel = defineSchemaModel({
4
+ name: "Announcement",
5
+ description: "Announcement to spaces/org",
6
+ fields: {
7
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
8
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
9
+ body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
10
+ audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
11
+ audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
12
+ spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
13
+ }
14
+ });
15
+ var PostAnnouncementInputModel = defineSchemaModel({
16
+ name: "PostAnnouncementInput",
17
+ description: "Post an announcement",
18
+ fields: {
19
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
20
+ body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
21
+ audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
22
+ audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
23
+ spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
24
+ expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
25
+ }
26
+ });
27
+
28
+ // src/announcement/announcement.operations.ts
29
+ import { defineCommand } from "@contractspec/lib.contracts";
30
+ var OWNERS = ["@examples.team-hub"];
31
+ var PostAnnouncementContract = defineCommand({
32
+ meta: {
33
+ key: "team.announcement.post",
34
+ version: "1.0.0",
35
+ stability: "stable",
36
+ owners: [...OWNERS],
37
+ tags: ["team-hub", "announcement", "post"],
38
+ description: "Post an announcement.",
39
+ goal: "Communicate with team.",
40
+ context: "Communication."
41
+ },
42
+ io: {
43
+ input: PostAnnouncementInputModel,
44
+ output: AnnouncementModel
45
+ },
46
+ policy: { auth: "user" },
47
+ acceptance: {
48
+ scenarios: [
49
+ {
50
+ key: "post-announcement-happy-path",
51
+ given: ["User is authenticated"],
52
+ when: ["User posts an announcement"],
53
+ then: ["Announcement is posted and distributed"]
54
+ }
55
+ ],
56
+ examples: [
57
+ {
58
+ key: "post-general",
59
+ input: {
60
+ spaceId: "space-123",
61
+ title: "New Policy",
62
+ content: "Please read..."
63
+ },
64
+ output: { id: "ann-456", status: "posted" }
65
+ }
66
+ ]
67
+ }
68
+ });
69
+ export {
70
+ PostAnnouncementContract
71
+ };
@@ -0,0 +1,30 @@
1
+ // src/announcement/announcement.schema.ts
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
+ var AnnouncementModel = defineSchemaModel({
4
+ name: "Announcement",
5
+ description: "Announcement to spaces/org",
6
+ fields: {
7
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
8
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
9
+ body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
10
+ audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
11
+ audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
12
+ spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
13
+ }
14
+ });
15
+ var PostAnnouncementInputModel = defineSchemaModel({
16
+ name: "PostAnnouncementInput",
17
+ description: "Post an announcement",
18
+ fields: {
19
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
20
+ body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
21
+ audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
22
+ audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
23
+ spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
24
+ expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
25
+ }
26
+ });
27
+ export {
28
+ PostAnnouncementInputModel,
29
+ AnnouncementModel
30
+ };
@@ -0,0 +1,73 @@
1
+ // src/announcement/announcement.schema.ts
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
+ var AnnouncementModel = defineSchemaModel({
4
+ name: "Announcement",
5
+ description: "Announcement to spaces/org",
6
+ fields: {
7
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
8
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
9
+ body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
10
+ audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
11
+ audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
12
+ spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
13
+ }
14
+ });
15
+ var PostAnnouncementInputModel = defineSchemaModel({
16
+ name: "PostAnnouncementInput",
17
+ description: "Post an announcement",
18
+ fields: {
19
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
20
+ body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
21
+ audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
22
+ audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
23
+ spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
24
+ expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
25
+ }
26
+ });
27
+
28
+ // src/announcement/announcement.operations.ts
29
+ import { defineCommand } from "@contractspec/lib.contracts";
30
+ var OWNERS = ["@examples.team-hub"];
31
+ var PostAnnouncementContract = defineCommand({
32
+ meta: {
33
+ key: "team.announcement.post",
34
+ version: "1.0.0",
35
+ stability: "stable",
36
+ owners: [...OWNERS],
37
+ tags: ["team-hub", "announcement", "post"],
38
+ description: "Post an announcement.",
39
+ goal: "Communicate with team.",
40
+ context: "Communication."
41
+ },
42
+ io: {
43
+ input: PostAnnouncementInputModel,
44
+ output: AnnouncementModel
45
+ },
46
+ policy: { auth: "user" },
47
+ acceptance: {
48
+ scenarios: [
49
+ {
50
+ key: "post-announcement-happy-path",
51
+ given: ["User is authenticated"],
52
+ when: ["User posts an announcement"],
53
+ then: ["Announcement is posted and distributed"]
54
+ }
55
+ ],
56
+ examples: [
57
+ {
58
+ key: "post-general",
59
+ input: {
60
+ spaceId: "space-123",
61
+ title: "New Policy",
62
+ content: "Please read..."
63
+ },
64
+ output: { id: "ann-456", status: "posted" }
65
+ }
66
+ ]
67
+ }
68
+ });
69
+ export {
70
+ PostAnnouncementInputModel,
71
+ PostAnnouncementContract,
72
+ AnnouncementModel
73
+ };
@@ -0,0 +1,94 @@
1
+ // src/docs/team-hub.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var teamHubDocBlocks = [
4
+ {
5
+ id: "docs.examples.team-hub",
6
+ title: "Team Hub",
7
+ summary: "Internal collaboration hub with spaces, tasks, rituals, and announcements.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/team-hub",
11
+ tags: ["tasks", "rituals", "announcements", "collaboration"],
12
+ body: `## Domains
13
+
14
+ - Spaces/projects with members and roles.
15
+ - Tasks with status, priority, assignees, due dates.
16
+ - Rituals (standups/retros/planning) with cadence and attendance.
17
+ - Announcements targeted by space or role.
18
+
19
+ ## Modules reused
20
+ - Identity/RBAC for roles and membership
21
+ - Notifications for reminders and announcements
22
+ - Jobs for scheduling rituals/reminders
23
+ - Audit trail for state changes
24
+
25
+ ## Presentations
26
+ - Dashboard, space list, task board/detail, ritual calendar, announcement feed.
27
+ `
28
+ },
29
+ {
30
+ id: "docs.examples.team-hub.goal",
31
+ title: "Team Hub — Goal",
32
+ summary: "Why this collaboration hub exists and outcomes it targets.",
33
+ kind: "goal",
34
+ visibility: "public",
35
+ route: "/docs/examples/team-hub/goal",
36
+ tags: ["collaboration", "goal"],
37
+ body: `## Why it matters
38
+ - Provides a regenerable hub for spaces, tasks, rituals, and announcements.
39
+ - Keeps ceremonies and task flows consistent across UI/API/events.
40
+
41
+ ## Business/Product goal
42
+ - Support team rituals with reminders, visibility, and auditability.
43
+ - Enable staged rollouts of new rituals/boards via feature flags.
44
+
45
+ ## Success criteria
46
+ - Tasks/rituals/announcements regenerate safely from spec updates.
47
+ - Notifications and audit hooks fire for key transitions.`
48
+ },
49
+ {
50
+ id: "docs.examples.team-hub.usage",
51
+ title: "Team Hub — Usage",
52
+ summary: "How to set up spaces, tasks, and rituals and regenerate safely.",
53
+ kind: "usage",
54
+ visibility: "public",
55
+ route: "/docs/examples/team-hub/usage",
56
+ tags: ["collaboration", "usage"],
57
+ body: `## Setup
58
+ 1) Seed (if available) or create a space; add members and tasks; schedule rituals.
59
+ 2) Configure Notifications for rituals/reminders and announcements; use Jobs for scheduling.
60
+
61
+ ## Extend & regenerate
62
+ 1) Adjust schemas: task priority/status, ritual cadence/attendance, announcement targeting.
63
+ 2) Regenerate to update boards/calendars/feeds; mark PII paths as needed.
64
+ 3) Use Feature Flags to trial new rituals or task views.
65
+
66
+ ## Guardrails
67
+ - Emit events for task/ritual/announcement changes; log in Audit Trail.
68
+ - Keep ritual cadence declarative; avoid hardcoded schedules.
69
+ - Ensure announcements carry title/description for accessibility.`
70
+ },
71
+ {
72
+ id: "docs.examples.team-hub.constraints",
73
+ title: "Team Hub — Constraints & Safety",
74
+ summary: "Internal guardrails for rituals, tasks, and announcements regeneration.",
75
+ kind: "reference",
76
+ visibility: "internal",
77
+ route: "/docs/examples/team-hub/constraints",
78
+ tags: ["collaboration", "constraints", "internal"],
79
+ body: `## Constraints
80
+ - Ritual cadence and task states must stay declarative in spec; no hardcoded schedules.
81
+ - Events to emit: task.created/updated/completed, ritual.scheduled/completed, announcement.published.
82
+ - Regeneration should not drop reminders or announcements routing.
83
+
84
+ ## PII & A11y
85
+ - Mark PII (names/emails) for redaction in presentations.
86
+ - Announcements must include title/description; respect accessibility guidance.
87
+
88
+ ## Verification
89
+ - Add fixtures for ritual cadence changes and announcement targeting.
90
+ - Ensure Notifications/Jobs wiring persists after regeneration.
91
+ - Use Feature Flags to trial new boards/rituals with safe defaults.`
92
+ }
93
+ ];
94
+ registerDocBlocks(teamHubDocBlocks);
@@ -0,0 +1,94 @@
1
+ // src/docs/team-hub.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var teamHubDocBlocks = [
4
+ {
5
+ id: "docs.examples.team-hub",
6
+ title: "Team Hub",
7
+ summary: "Internal collaboration hub with spaces, tasks, rituals, and announcements.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/team-hub",
11
+ tags: ["tasks", "rituals", "announcements", "collaboration"],
12
+ body: `## Domains
13
+
14
+ - Spaces/projects with members and roles.
15
+ - Tasks with status, priority, assignees, due dates.
16
+ - Rituals (standups/retros/planning) with cadence and attendance.
17
+ - Announcements targeted by space or role.
18
+
19
+ ## Modules reused
20
+ - Identity/RBAC for roles and membership
21
+ - Notifications for reminders and announcements
22
+ - Jobs for scheduling rituals/reminders
23
+ - Audit trail for state changes
24
+
25
+ ## Presentations
26
+ - Dashboard, space list, task board/detail, ritual calendar, announcement feed.
27
+ `
28
+ },
29
+ {
30
+ id: "docs.examples.team-hub.goal",
31
+ title: "Team Hub — Goal",
32
+ summary: "Why this collaboration hub exists and outcomes it targets.",
33
+ kind: "goal",
34
+ visibility: "public",
35
+ route: "/docs/examples/team-hub/goal",
36
+ tags: ["collaboration", "goal"],
37
+ body: `## Why it matters
38
+ - Provides a regenerable hub for spaces, tasks, rituals, and announcements.
39
+ - Keeps ceremonies and task flows consistent across UI/API/events.
40
+
41
+ ## Business/Product goal
42
+ - Support team rituals with reminders, visibility, and auditability.
43
+ - Enable staged rollouts of new rituals/boards via feature flags.
44
+
45
+ ## Success criteria
46
+ - Tasks/rituals/announcements regenerate safely from spec updates.
47
+ - Notifications and audit hooks fire for key transitions.`
48
+ },
49
+ {
50
+ id: "docs.examples.team-hub.usage",
51
+ title: "Team Hub — Usage",
52
+ summary: "How to set up spaces, tasks, and rituals and regenerate safely.",
53
+ kind: "usage",
54
+ visibility: "public",
55
+ route: "/docs/examples/team-hub/usage",
56
+ tags: ["collaboration", "usage"],
57
+ body: `## Setup
58
+ 1) Seed (if available) or create a space; add members and tasks; schedule rituals.
59
+ 2) Configure Notifications for rituals/reminders and announcements; use Jobs for scheduling.
60
+
61
+ ## Extend & regenerate
62
+ 1) Adjust schemas: task priority/status, ritual cadence/attendance, announcement targeting.
63
+ 2) Regenerate to update boards/calendars/feeds; mark PII paths as needed.
64
+ 3) Use Feature Flags to trial new rituals or task views.
65
+
66
+ ## Guardrails
67
+ - Emit events for task/ritual/announcement changes; log in Audit Trail.
68
+ - Keep ritual cadence declarative; avoid hardcoded schedules.
69
+ - Ensure announcements carry title/description for accessibility.`
70
+ },
71
+ {
72
+ id: "docs.examples.team-hub.constraints",
73
+ title: "Team Hub — Constraints & Safety",
74
+ summary: "Internal guardrails for rituals, tasks, and announcements regeneration.",
75
+ kind: "reference",
76
+ visibility: "internal",
77
+ route: "/docs/examples/team-hub/constraints",
78
+ tags: ["collaboration", "constraints", "internal"],
79
+ body: `## Constraints
80
+ - Ritual cadence and task states must stay declarative in spec; no hardcoded schedules.
81
+ - Events to emit: task.created/updated/completed, ritual.scheduled/completed, announcement.published.
82
+ - Regeneration should not drop reminders or announcements routing.
83
+
84
+ ## PII & A11y
85
+ - Mark PII (names/emails) for redaction in presentations.
86
+ - Announcements must include title/description; respect accessibility guidance.
87
+
88
+ ## Verification
89
+ - Add fixtures for ritual cadence changes and announcement targeting.
90
+ - Ensure Notifications/Jobs wiring persists after regeneration.
91
+ - Use Feature Flags to trial new boards/rituals with safe defaults.`
92
+ }
93
+ ];
94
+ registerDocBlocks(teamHubDocBlocks);
@@ -0,0 +1,231 @@
1
+ // src/entities/index.ts
2
+ import {
3
+ defineEntity,
4
+ defineEntityEnum,
5
+ field,
6
+ index
7
+ } from "@contractspec/lib.schema";
8
+ var schema = "lssm_team_hub";
9
+ var TaskStatusEnum = defineEntityEnum({
10
+ name: "TaskStatus",
11
+ schema,
12
+ values: ["BACKLOG", "IN_PROGRESS", "BLOCKED", "DONE"],
13
+ description: "Task workflow status."
14
+ });
15
+ var TaskPriorityEnum = defineEntityEnum({
16
+ name: "TaskPriority",
17
+ schema,
18
+ values: ["LOW", "MEDIUM", "HIGH", "CRITICAL"],
19
+ description: "Task priority levels."
20
+ });
21
+ var RitualCadenceEnum = defineEntityEnum({
22
+ name: "RitualCadence",
23
+ schema,
24
+ values: ["DAILY", "WEEKLY", "BIWEEKLY", "MONTHLY"],
25
+ description: "Recurrence cadence for rituals."
26
+ });
27
+ var AnnouncementAudienceEnum = defineEntityEnum({
28
+ name: "AnnouncementAudience",
29
+ schema,
30
+ values: ["ALL", "SPACE", "ROLE"],
31
+ description: "Targeting scope for announcements."
32
+ });
33
+ var SpaceEntity = defineEntity({
34
+ name: "Space",
35
+ description: "Space/project container for a team.",
36
+ schema,
37
+ map: "space",
38
+ fields: {
39
+ id: field.id({ description: "Unique space identifier" }),
40
+ name: field.string({ description: "Space name" }),
41
+ description: field.string({
42
+ description: "Space description",
43
+ isOptional: true
44
+ }),
45
+ orgId: field.string({ description: "Organization ID" }),
46
+ ownerId: field.string({ description: "Space owner" }),
47
+ members: field.json({ description: "Member roles map", isOptional: true }),
48
+ createdAt: field.createdAt(),
49
+ updatedAt: field.updatedAt(),
50
+ tasks: field.hasMany("Task"),
51
+ rituals: field.hasMany("Ritual"),
52
+ announcements: field.hasMany("Announcement")
53
+ },
54
+ indexes: [index.on(["orgId"]), index.on(["ownerId"]), index.on(["name"])]
55
+ });
56
+ var TaskEntity = defineEntity({
57
+ name: "Task",
58
+ description: "Work item within a space.",
59
+ schema,
60
+ map: "task",
61
+ fields: {
62
+ id: field.id({ description: "Unique task identifier" }),
63
+ spaceId: field.foreignKey({ description: "Parent space" }),
64
+ title: field.string({ description: "Task title" }),
65
+ description: field.string({
66
+ description: "Task details",
67
+ isOptional: true
68
+ }),
69
+ status: field.enum("TaskStatus", {
70
+ description: "Task status",
71
+ default: "BACKLOG"
72
+ }),
73
+ priority: field.enum("TaskPriority", {
74
+ description: "Task priority",
75
+ default: "MEDIUM"
76
+ }),
77
+ assigneeId: field.string({
78
+ description: "User assigned",
79
+ isOptional: true
80
+ }),
81
+ dueDate: field.dateTime({ description: "Due date", isOptional: true }),
82
+ tags: field.json({ description: "Labels/tags", isOptional: true }),
83
+ orgId: field.string({ description: "Organization ID" }),
84
+ createdAt: field.createdAt(),
85
+ updatedAt: field.updatedAt(),
86
+ space: field.belongsTo("Space", ["spaceId"], ["id"], {
87
+ onDelete: "Cascade"
88
+ })
89
+ },
90
+ enums: [TaskStatusEnum, TaskPriorityEnum],
91
+ indexes: [
92
+ index.on(["spaceId"]),
93
+ index.on(["orgId", "status"]),
94
+ index.on(["assigneeId", "status"]),
95
+ index.on(["dueDate"])
96
+ ]
97
+ });
98
+ var RitualEntity = defineEntity({
99
+ name: "Ritual",
100
+ description: "Recurring ceremony (standup, retro, planning).",
101
+ schema,
102
+ map: "ritual",
103
+ fields: {
104
+ id: field.id({ description: "Unique ritual identifier" }),
105
+ spaceId: field.foreignKey({ description: "Parent space" }),
106
+ title: field.string({ description: "Ritual title" }),
107
+ cadence: field.enum("RitualCadence", { description: "Ritual cadence" }),
108
+ dayOfWeek: field.string({ description: "Day of week", isOptional: true }),
109
+ time: field.string({ description: "Local time (HH:mm)", isOptional: true }),
110
+ facilitatorId: field.string({
111
+ description: "Facilitator user ID",
112
+ isOptional: true
113
+ }),
114
+ participants: field.json({
115
+ description: "Participant user IDs",
116
+ isOptional: true
117
+ }),
118
+ location: field.string({ description: "Location/URL", isOptional: true }),
119
+ agendaTemplate: field.string({
120
+ description: "Agenda template markdown",
121
+ isOptional: true
122
+ }),
123
+ orgId: field.string({ description: "Organization ID" }),
124
+ createdAt: field.createdAt(),
125
+ updatedAt: field.updatedAt(),
126
+ occurrences: field.hasMany("RitualOccurrence"),
127
+ space: field.belongsTo("Space", ["spaceId"], ["id"], {
128
+ onDelete: "Cascade"
129
+ })
130
+ },
131
+ enums: [RitualCadenceEnum],
132
+ indexes: [index.on(["spaceId"]), index.on(["orgId"])]
133
+ });
134
+ var RitualOccurrenceEntity = defineEntity({
135
+ name: "RitualOccurrence",
136
+ description: "Specific occurrence of a ritual.",
137
+ schema,
138
+ map: "ritual_occurrence",
139
+ fields: {
140
+ id: field.id({ description: "Unique occurrence identifier" }),
141
+ ritualId: field.foreignKey({ description: "Parent ritual" }),
142
+ scheduledFor: field.dateTime({ description: "Scheduled datetime" }),
143
+ status: field.string({
144
+ description: "Occurrence status",
145
+ default: '"scheduled"'
146
+ }),
147
+ summary: field.string({ description: "Summary/notes", isOptional: true }),
148
+ attendance: field.json({
149
+ description: "Attendance list with responses",
150
+ isOptional: true
151
+ }),
152
+ recordingUrl: field.string({
153
+ description: "Recording link",
154
+ isOptional: true
155
+ }),
156
+ orgId: field.string({ description: "Organization ID" }),
157
+ createdAt: field.createdAt(),
158
+ updatedAt: field.updatedAt(),
159
+ ritual: field.belongsTo("Ritual", ["ritualId"], ["id"], {
160
+ onDelete: "Cascade"
161
+ })
162
+ },
163
+ indexes: [
164
+ index.on(["ritualId"]),
165
+ index.on(["scheduledFor"]),
166
+ index.on(["orgId"])
167
+ ]
168
+ });
169
+ var AnnouncementEntity = defineEntity({
170
+ name: "Announcement",
171
+ description: "Announcement to a space or org.",
172
+ schema,
173
+ map: "announcement",
174
+ fields: {
175
+ id: field.id({ description: "Unique announcement identifier" }),
176
+ spaceId: field.string({ description: "Target space", isOptional: true }),
177
+ title: field.string({ description: "Announcement title" }),
178
+ body: field.string({ description: "Announcement body" }),
179
+ audience: field.enum("AnnouncementAudience", {
180
+ description: "Audience targeting",
181
+ default: "ALL"
182
+ }),
183
+ audienceRole: field.string({
184
+ description: "Role targeted when audience is ROLE",
185
+ isOptional: true
186
+ }),
187
+ pinnedUntil: field.dateTime({
188
+ description: "Pin expiration",
189
+ isOptional: true
190
+ }),
191
+ orgId: field.string({ description: "Organization ID" }),
192
+ createdBy: field.string({ description: "Creator user ID" }),
193
+ createdAt: field.createdAt(),
194
+ expiresAt: field.dateTime({
195
+ description: "Expiration time",
196
+ isOptional: true
197
+ })
198
+ },
199
+ enums: [AnnouncementAudienceEnum],
200
+ indexes: [index.on(["orgId"]), index.on(["spaceId"]), index.on(["audience"])]
201
+ });
202
+ var teamHubEntities = [
203
+ SpaceEntity,
204
+ TaskEntity,
205
+ RitualEntity,
206
+ RitualOccurrenceEntity,
207
+ AnnouncementEntity
208
+ ];
209
+ var teamHubSchemaContribution = {
210
+ moduleId: "@contractspec/example.team-hub",
211
+ entities: teamHubEntities,
212
+ enums: [
213
+ TaskStatusEnum,
214
+ TaskPriorityEnum,
215
+ RitualCadenceEnum,
216
+ AnnouncementAudienceEnum
217
+ ]
218
+ };
219
+ export {
220
+ teamHubSchemaContribution,
221
+ teamHubEntities,
222
+ TaskStatusEnum,
223
+ TaskPriorityEnum,
224
+ TaskEntity,
225
+ SpaceEntity,
226
+ RitualOccurrenceEntity,
227
+ RitualEntity,
228
+ RitualCadenceEnum,
229
+ AnnouncementEntity,
230
+ AnnouncementAudienceEnum
231
+ };