@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
package/dist/index.js CHANGED
@@ -1,16 +1,643 @@
1
- import { CreateSpaceInputModel, SpaceModel } from "./space/space.schema.js";
2
- import { CreateSpaceContract } from "./space/space.operations.js";
3
- import "./space/index.js";
4
- import { CreateTaskInputModel, TaskModel, UpdateTaskStatusInputModel } from "./task/task.schema.js";
5
- import { CreateTaskContract, ListTasksInputModel, ListTasksOperation, ListTasksOutputModel, UpdateTaskStatusContract } from "./task/task.operations.js";
6
- import "./task/index.js";
7
- import { LogRitualOccurrenceInputModel, RitualModel, ScheduleRitualInputModel } from "./ritual/ritual.schema.js";
8
- import { LogRitualOccurrenceContract, ScheduleRitualContract } from "./ritual/ritual.operations.js";
9
- import "./ritual/index.js";
10
- import { AnnouncementModel, PostAnnouncementInputModel } from "./announcement/announcement.schema.js";
11
- import { PostAnnouncementContract } from "./announcement/announcement.operations.js";
12
- import "./announcement/index.js";
13
- import { AnnouncementFeedPresentation, RitualCalendarPresentation, SpaceListPresentation, TaskBoardPresentation, TaskDetailPresentation, TeamDashboardPresentation } from "./presentations.js";
14
- import { TeamHubFeature } from "./team-hub.feature.js";
1
+ // @bun
2
+ // src/announcement/announcement.schema.ts
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
+ var AnnouncementModel = defineSchemaModel({
5
+ name: "Announcement",
6
+ description: "Announcement to spaces/org",
7
+ fields: {
8
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
9
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
10
+ body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
11
+ audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
12
+ audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
13
+ spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
14
+ }
15
+ });
16
+ var PostAnnouncementInputModel = defineSchemaModel({
17
+ name: "PostAnnouncementInput",
18
+ description: "Post an announcement",
19
+ fields: {
20
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
21
+ body: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
22
+ audience: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
23
+ audienceRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
24
+ spaceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
25
+ expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
26
+ }
27
+ });
15
28
 
16
- export { AnnouncementFeedPresentation, AnnouncementModel, CreateSpaceContract, CreateSpaceInputModel, CreateTaskContract, CreateTaskInputModel, ListTasksInputModel, ListTasksOperation, ListTasksOutputModel, LogRitualOccurrenceContract, LogRitualOccurrenceInputModel, PostAnnouncementContract, PostAnnouncementInputModel, RitualCalendarPresentation, RitualModel, ScheduleRitualContract, ScheduleRitualInputModel, SpaceListPresentation, SpaceModel, TaskBoardPresentation, TaskDetailPresentation, TaskModel, TeamDashboardPresentation, TeamHubFeature, UpdateTaskStatusContract, UpdateTaskStatusInputModel };
29
+ // src/announcement/announcement.operations.ts
30
+ import { defineCommand } from "@contractspec/lib.contracts";
31
+ var OWNERS = ["@examples.team-hub"];
32
+ var PostAnnouncementContract = defineCommand({
33
+ meta: {
34
+ key: "team.announcement.post",
35
+ version: "1.0.0",
36
+ stability: "stable",
37
+ owners: [...OWNERS],
38
+ tags: ["team-hub", "announcement", "post"],
39
+ description: "Post an announcement.",
40
+ goal: "Communicate with team.",
41
+ context: "Communication."
42
+ },
43
+ io: {
44
+ input: PostAnnouncementInputModel,
45
+ output: AnnouncementModel
46
+ },
47
+ policy: { auth: "user" },
48
+ acceptance: {
49
+ scenarios: [
50
+ {
51
+ key: "post-announcement-happy-path",
52
+ given: ["User is authenticated"],
53
+ when: ["User posts an announcement"],
54
+ then: ["Announcement is posted and distributed"]
55
+ }
56
+ ],
57
+ examples: [
58
+ {
59
+ key: "post-general",
60
+ input: {
61
+ spaceId: "space-123",
62
+ title: "New Policy",
63
+ content: "Please read..."
64
+ },
65
+ output: { id: "ann-456", status: "posted" }
66
+ }
67
+ ]
68
+ }
69
+ });
70
+ // src/space/space.schema.ts
71
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
72
+ var SpaceModel = defineSchemaModel2({
73
+ name: "Space",
74
+ description: "Team space/project",
75
+ fields: {
76
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
77
+ name: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
78
+ description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
79
+ orgId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
80
+ ownerId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
81
+ }
82
+ });
83
+ var CreateSpaceInputModel = defineSchemaModel2({
84
+ name: "CreateSpaceInput",
85
+ description: "Input for creating a space",
86
+ fields: {
87
+ name: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
88
+ description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
89
+ orgId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
90
+ ownerId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
91
+ }
92
+ });
93
+
94
+ // src/space/space.operations.ts
95
+ import { defineCommand as defineCommand2 } from "@contractspec/lib.contracts";
96
+ var OWNERS2 = ["@examples.team-hub"];
97
+ var CreateSpaceContract = defineCommand2({
98
+ meta: {
99
+ key: "team.space.create",
100
+ version: "1.0.0",
101
+ stability: "stable",
102
+ owners: [...OWNERS2],
103
+ tags: ["team-hub", "space", "create"],
104
+ description: "Create a new team space.",
105
+ goal: "Organize teams/projects.",
106
+ context: "Workspace creation."
107
+ },
108
+ io: {
109
+ input: CreateSpaceInputModel,
110
+ output: SpaceModel
111
+ },
112
+ policy: { auth: "user" },
113
+ acceptance: {
114
+ scenarios: [
115
+ {
116
+ key: "create-space-happy-path",
117
+ given: ["User is authenticated"],
118
+ when: ["User creates a new space"],
119
+ then: ["Space is created"]
120
+ }
121
+ ],
122
+ examples: [
123
+ {
124
+ key: "create-engineering",
125
+ input: { name: "Engineering", description: "Engineering team space" },
126
+ output: { id: "space-123", name: "Engineering" }
127
+ }
128
+ ]
129
+ }
130
+ });
131
+ // src/task/task.schema.ts
132
+ import { defineSchemaModel as defineSchemaModel3, ScalarTypeEnum as ScalarTypeEnum3 } from "@contractspec/lib.schema";
133
+ var TaskModel = defineSchemaModel3({
134
+ name: "Task",
135
+ description: "Task in a space",
136
+ fields: {
137
+ id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
138
+ spaceId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
139
+ title: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
140
+ status: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
141
+ priority: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
142
+ assigneeId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
143
+ dueDate: { type: ScalarTypeEnum3.DateTime(), isOptional: true }
144
+ }
145
+ });
146
+ var CreateTaskInputModel = defineSchemaModel3({
147
+ name: "CreateTaskInput",
148
+ description: "Input for creating a task",
149
+ fields: {
150
+ spaceId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
151
+ title: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
152
+ description: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
153
+ priority: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
154
+ assigneeId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
155
+ dueDate: { type: ScalarTypeEnum3.DateTime(), isOptional: true }
156
+ }
157
+ });
158
+ var UpdateTaskStatusInputModel = defineSchemaModel3({
159
+ name: "UpdateTaskStatusInput",
160
+ description: "Update task status",
161
+ fields: {
162
+ taskId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
163
+ status: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
164
+ }
165
+ });
166
+
167
+ // src/task/task.operations.ts
168
+ import { defineCommand as defineCommand3, defineQuery } from "@contractspec/lib.contracts";
169
+ import { defineSchemaModel as defineSchemaModel4, ScalarTypeEnum as ScalarTypeEnum4 } from "@contractspec/lib.schema";
170
+ var OWNERS3 = ["@examples.team-hub"];
171
+ var ListTasksInputModel = defineSchemaModel4({
172
+ name: "ListTasksInput",
173
+ description: "Input for listing tasks",
174
+ fields: {
175
+ spaceId: { type: ScalarTypeEnum4.String_unsecure(), isOptional: true },
176
+ status: { type: ScalarTypeEnum4.String_unsecure(), isOptional: true },
177
+ assigneeId: { type: ScalarTypeEnum4.String_unsecure(), isOptional: true },
178
+ limit: { type: ScalarTypeEnum4.Int_unsecure(), isOptional: true },
179
+ offset: { type: ScalarTypeEnum4.Int_unsecure(), isOptional: true }
180
+ }
181
+ });
182
+ var ListTasksOutputModel = defineSchemaModel4({
183
+ name: "ListTasksOutput",
184
+ description: "Output for listing tasks",
185
+ fields: {
186
+ tasks: { type: TaskModel, isOptional: false, isList: true },
187
+ total: { type: ScalarTypeEnum4.Int_unsecure(), isOptional: false }
188
+ }
189
+ });
190
+ var ListTasksOperation = defineQuery({
191
+ meta: {
192
+ key: "team.task.list",
193
+ version: "1.0.0",
194
+ stability: "stable",
195
+ owners: [...OWNERS3],
196
+ tags: ["team-hub", "task", "list", "query"],
197
+ description: "List all tasks with filtering",
198
+ goal: "Retrieve list of tasks",
199
+ context: "Task management"
200
+ },
201
+ io: {
202
+ input: ListTasksInputModel,
203
+ output: ListTasksOutputModel
204
+ },
205
+ policy: { auth: "user" },
206
+ acceptance: {
207
+ scenarios: [
208
+ {
209
+ key: "list-tasks-happy-path",
210
+ given: ["Tasks exist"],
211
+ when: ["User lists tasks"],
212
+ then: ["List of tasks is returned"]
213
+ }
214
+ ],
215
+ examples: [
216
+ {
217
+ key: "list-my-tasks",
218
+ input: { assigneeId: "user-123", status: "open", limit: 10 },
219
+ output: { tasks: [], total: 3 }
220
+ }
221
+ ]
222
+ }
223
+ });
224
+ var CreateTaskContract = defineCommand3({
225
+ meta: {
226
+ key: "team.task.create",
227
+ version: "1.0.0",
228
+ stability: "stable",
229
+ owners: [...OWNERS3],
230
+ tags: ["team-hub", "task", "create"],
231
+ description: "Create a task.",
232
+ goal: "Track work.",
233
+ context: "Task management."
234
+ },
235
+ io: {
236
+ input: CreateTaskInputModel,
237
+ output: TaskModel
238
+ },
239
+ policy: { auth: "user" },
240
+ acceptance: {
241
+ scenarios: [
242
+ {
243
+ key: "create-task-happy-path",
244
+ given: ["Space exists"],
245
+ when: ["User creates task"],
246
+ then: ["Task is created"]
247
+ }
248
+ ],
249
+ examples: [
250
+ {
251
+ key: "create-bug",
252
+ input: { spaceId: "space-123", title: "Fix login bug", type: "bug" },
253
+ output: { id: "task-456", status: "todo" }
254
+ }
255
+ ]
256
+ }
257
+ });
258
+ var UpdateTaskStatusContract = defineCommand3({
259
+ meta: {
260
+ key: "team.task.updateStatus",
261
+ version: "1.0.0",
262
+ stability: "stable",
263
+ owners: [...OWNERS3],
264
+ tags: ["team-hub", "task", "status"],
265
+ description: "Update task status.",
266
+ goal: "Track progress.",
267
+ context: "Task management."
268
+ },
269
+ io: {
270
+ input: UpdateTaskStatusInputModel,
271
+ output: TaskModel
272
+ },
273
+ policy: { auth: "user" },
274
+ acceptance: {
275
+ scenarios: [
276
+ {
277
+ key: "update-status-happy-path",
278
+ given: ["Task exists"],
279
+ when: ["User updates status"],
280
+ then: ["Status is updated"]
281
+ }
282
+ ],
283
+ examples: [
284
+ {
285
+ key: "markup-done",
286
+ input: { taskId: "task-456", status: "done" },
287
+ output: { id: "task-456", status: "done" }
288
+ }
289
+ ]
290
+ }
291
+ });
292
+ // src/ritual/ritual.schema.ts
293
+ import { defineSchemaModel as defineSchemaModel5, ScalarTypeEnum as ScalarTypeEnum5 } from "@contractspec/lib.schema";
294
+ var RitualModel = defineSchemaModel5({
295
+ name: "Ritual",
296
+ description: "Recurring ritual",
297
+ fields: {
298
+ id: { type: ScalarTypeEnum5.String_unsecure(), isOptional: false },
299
+ spaceId: { type: ScalarTypeEnum5.String_unsecure(), isOptional: false },
300
+ title: { type: ScalarTypeEnum5.String_unsecure(), isOptional: false },
301
+ cadence: { type: ScalarTypeEnum5.String_unsecure(), isOptional: false },
302
+ dayOfWeek: { type: ScalarTypeEnum5.String_unsecure(), isOptional: true },
303
+ time: { type: ScalarTypeEnum5.String_unsecure(), isOptional: true }
304
+ }
305
+ });
306
+ var ScheduleRitualInputModel = defineSchemaModel5({
307
+ name: "ScheduleRitualInput",
308
+ description: "Create a ritual",
309
+ fields: {
310
+ spaceId: { type: ScalarTypeEnum5.String_unsecure(), isOptional: false },
311
+ title: { type: ScalarTypeEnum5.String_unsecure(), isOptional: false },
312
+ cadence: { type: ScalarTypeEnum5.String_unsecure(), isOptional: false },
313
+ dayOfWeek: { type: ScalarTypeEnum5.String_unsecure(), isOptional: true },
314
+ time: { type: ScalarTypeEnum5.String_unsecure(), isOptional: true },
315
+ facilitatorId: { type: ScalarTypeEnum5.String_unsecure(), isOptional: true }
316
+ }
317
+ });
318
+ var LogRitualOccurrenceInputModel = defineSchemaModel5({
319
+ name: "LogRitualOccurrenceInput",
320
+ description: "Record ritual occurrence results",
321
+ fields: {
322
+ ritualId: { type: ScalarTypeEnum5.String_unsecure(), isOptional: false },
323
+ scheduledFor: { type: ScalarTypeEnum5.DateTime(), isOptional: false },
324
+ status: { type: ScalarTypeEnum5.String_unsecure(), isOptional: false },
325
+ summary: { type: ScalarTypeEnum5.String_unsecure(), isOptional: true }
326
+ }
327
+ });
328
+
329
+ // src/ritual/ritual.operations.ts
330
+ import { defineCommand as defineCommand4 } from "@contractspec/lib.contracts";
331
+ var OWNERS4 = ["@examples.team-hub"];
332
+ var ScheduleRitualContract = defineCommand4({
333
+ meta: {
334
+ key: "team.ritual.schedule",
335
+ version: "1.0.0",
336
+ stability: "stable",
337
+ owners: [...OWNERS4],
338
+ tags: ["team-hub", "ritual", "schedule"],
339
+ description: "Schedule a recurring ritual.",
340
+ goal: "Team ceremonies.",
341
+ context: "Ritual management."
342
+ },
343
+ io: {
344
+ input: ScheduleRitualInputModel,
345
+ output: RitualModel
346
+ },
347
+ policy: { auth: "user" },
348
+ acceptance: {
349
+ scenarios: [
350
+ {
351
+ key: "schedule-ritual-happy-path",
352
+ given: ["Space exists"],
353
+ when: ["User schedules ritual"],
354
+ then: ["Ritual is scheduled"]
355
+ }
356
+ ],
357
+ examples: [
358
+ {
359
+ key: "schedule-standup",
360
+ input: {
361
+ spaceId: "space-123",
362
+ name: "Daily Standup",
363
+ interval: "daily",
364
+ time: "10:00"
365
+ },
366
+ output: { id: "rit-123", status: "active" }
367
+ }
368
+ ]
369
+ }
370
+ });
371
+ var LogRitualOccurrenceContract = defineCommand4({
372
+ meta: {
373
+ key: "team.ritual.logOccurrence",
374
+ version: "1.0.0",
375
+ stability: "stable",
376
+ owners: [...OWNERS4],
377
+ tags: ["team-hub", "ritual", "log"],
378
+ description: "Log a ritual occurrence.",
379
+ goal: "Record ritual history.",
380
+ context: "Ritual management."
381
+ },
382
+ io: {
383
+ input: LogRitualOccurrenceInputModel,
384
+ output: RitualModel
385
+ },
386
+ policy: { auth: "user" },
387
+ acceptance: {
388
+ scenarios: [
389
+ {
390
+ key: "log-occurrence-happy-path",
391
+ given: ["Ritual is scheduled"],
392
+ when: ["User logs occurrence"],
393
+ then: ["Occurrence is recorded"]
394
+ }
395
+ ],
396
+ examples: [
397
+ {
398
+ key: "log-standup",
399
+ input: {
400
+ ritualId: "rit-123",
401
+ date: "2025-01-20",
402
+ attendees: ["user-1", "user-2"]
403
+ },
404
+ output: { id: "rit-123", lastOccurrence: "2025-01-20" }
405
+ }
406
+ ]
407
+ }
408
+ });
409
+ // src/presentations.ts
410
+ import { StabilityEnum } from "@contractspec/lib.contracts";
411
+ var TeamDashboardPresentation = {
412
+ meta: {
413
+ key: "team-hub.dashboard",
414
+ version: "1.0.0",
415
+ title: "Team Dashboard",
416
+ description: "Team hub dashboard with activity overview",
417
+ domain: "collaboration",
418
+ owners: ["@team-hub"],
419
+ tags: ["team", "dashboard"],
420
+ stability: StabilityEnum.Experimental,
421
+ goal: "High-level overview of team activity",
422
+ context: "Team home page"
423
+ },
424
+ source: {
425
+ type: "component",
426
+ framework: "react",
427
+ componentKey: "TeamDashboard"
428
+ },
429
+ targets: ["react", "markdown"],
430
+ policy: {
431
+ flags: ["team.dashboard.enabled"]
432
+ }
433
+ };
434
+ var SpaceListPresentation = {
435
+ meta: {
436
+ key: "team-hub.space.list",
437
+ version: "1.0.0",
438
+ title: "Space List",
439
+ description: "List of team spaces",
440
+ domain: "collaboration",
441
+ owners: ["@team-hub"],
442
+ tags: ["team", "spaces", "list"],
443
+ stability: StabilityEnum.Experimental,
444
+ goal: "Browse and manage team spaces",
445
+ context: "Team navigation"
446
+ },
447
+ source: {
448
+ type: "component",
449
+ framework: "react",
450
+ componentKey: "SpaceList"
451
+ },
452
+ targets: ["react", "markdown"],
453
+ policy: {
454
+ flags: ["team.spaces.enabled"]
455
+ }
456
+ };
457
+ var TaskBoardPresentation = {
458
+ meta: {
459
+ key: "team-hub.task.board",
460
+ version: "1.0.0",
461
+ title: "Task Board",
462
+ description: "Task board with kanban view",
463
+ domain: "collaboration",
464
+ owners: ["@team-hub"],
465
+ tags: ["team", "tasks", "board", "kanban"],
466
+ stability: StabilityEnum.Experimental,
467
+ goal: "Visual task management",
468
+ context: "Team task workflows"
469
+ },
470
+ source: {
471
+ type: "component",
472
+ framework: "react",
473
+ componentKey: "TaskBoard"
474
+ },
475
+ targets: ["react"],
476
+ policy: {
477
+ flags: ["team.tasks.enabled"]
478
+ }
479
+ };
480
+ var TaskDetailPresentation = {
481
+ meta: {
482
+ key: "team-hub.task.detail",
483
+ version: "1.0.0",
484
+ title: "Task Details",
485
+ description: "Task detail with comments and history",
486
+ domain: "collaboration",
487
+ owners: ["@team-hub"],
488
+ tags: ["team", "task", "detail"],
489
+ stability: StabilityEnum.Experimental,
490
+ goal: "Detailed task view with collaboration",
491
+ context: "Task inspection and updates"
492
+ },
493
+ source: {
494
+ type: "component",
495
+ framework: "react",
496
+ componentKey: "TaskDetail"
497
+ },
498
+ targets: ["react", "markdown"],
499
+ policy: {
500
+ flags: ["team.tasks.enabled"]
501
+ }
502
+ };
503
+ var RitualCalendarPresentation = {
504
+ meta: {
505
+ key: "team-hub.ritual.calendar",
506
+ version: "1.0.0",
507
+ title: "Ritual Calendar",
508
+ description: "Calendar view of team rituals",
509
+ domain: "collaboration",
510
+ owners: ["@team-hub"],
511
+ tags: ["team", "rituals", "calendar"],
512
+ stability: StabilityEnum.Experimental,
513
+ goal: "Plan and view recurring team rituals",
514
+ context: "Team scheduling"
515
+ },
516
+ source: {
517
+ type: "component",
518
+ framework: "react",
519
+ componentKey: "RitualCalendar"
520
+ },
521
+ targets: ["react"],
522
+ policy: {
523
+ flags: ["team.rituals.enabled"]
524
+ }
525
+ };
526
+ var AnnouncementFeedPresentation = {
527
+ meta: {
528
+ key: "team-hub.announcement.feed",
529
+ version: "1.0.0",
530
+ title: "Announcement Feed",
531
+ description: "Feed of team announcements",
532
+ domain: "collaboration",
533
+ owners: ["@team-hub"],
534
+ tags: ["team", "announcements", "feed"],
535
+ stability: StabilityEnum.Experimental,
536
+ goal: "Communicate updates to the team",
537
+ context: "Team communication"
538
+ },
539
+ source: {
540
+ type: "component",
541
+ framework: "react",
542
+ componentKey: "AnnouncementFeed"
543
+ },
544
+ targets: ["react", "markdown"],
545
+ policy: {
546
+ flags: ["team.announcements.enabled"]
547
+ }
548
+ };
549
+
550
+ // src/team-hub.feature.ts
551
+ import { defineFeature } from "@contractspec/lib.contracts";
552
+ var TeamHubFeature = defineFeature({
553
+ meta: {
554
+ key: "team-hub",
555
+ title: "Team Hub",
556
+ description: "Tasks, rituals, and announcements for internal teams with ceremonies.",
557
+ domain: "collaboration",
558
+ owners: ["@team-hub"],
559
+ tags: ["tasks", "rituals", "announcements"],
560
+ stability: "experimental",
561
+ version: "1.0.0"
562
+ },
563
+ operations: [
564
+ { key: "team.space.create", version: "1.0.0" },
565
+ { key: "team.task.create", version: "1.0.0" },
566
+ { key: "team.task.updateStatus", version: "1.0.0" },
567
+ { key: "team.task.list", version: "1.0.0" },
568
+ { key: "team.ritual.schedule", version: "1.0.0" },
569
+ { key: "team.ritual.logOccurrence", version: "1.0.0" },
570
+ { key: "team.announcement.post", version: "1.0.0" }
571
+ ],
572
+ events: [
573
+ { key: "team.space.created", version: "1.0.0" },
574
+ { key: "team.task.created", version: "1.0.0" },
575
+ { key: "team.task.status_changed", version: "1.0.0" },
576
+ { key: "team.ritual.scheduled", version: "1.0.0" },
577
+ { key: "team.ritual.occurred", version: "1.0.0" },
578
+ { key: "team.announcement.posted", version: "1.0.0" }
579
+ ],
580
+ presentations: [
581
+ { key: "team-hub.dashboard", version: "1.0.0" },
582
+ { key: "team-hub.space.list", version: "1.0.0" },
583
+ { key: "team-hub.task.board", version: "1.0.0" },
584
+ { key: "team-hub.task.detail", version: "1.0.0" },
585
+ { key: "team-hub.ritual.calendar", version: "1.0.0" },
586
+ { key: "team-hub.announcement.feed", version: "1.0.0" }
587
+ ],
588
+ presentationsTargets: [
589
+ {
590
+ key: "team-hub.dashboard",
591
+ version: "1.0.0",
592
+ targets: ["react", "markdown"]
593
+ },
594
+ { key: "team-hub.task.board", version: "1.0.0", targets: ["react"] },
595
+ { key: "team-hub.ritual.calendar", version: "1.0.0", targets: ["react"] },
596
+ {
597
+ key: "team-hub.announcement.feed",
598
+ version: "1.0.0",
599
+ targets: ["react", "markdown"]
600
+ }
601
+ ],
602
+ capabilities: {
603
+ requires: [
604
+ { key: "identity", version: "1.0.0" },
605
+ { key: "audit-trail", version: "1.0.0" },
606
+ { key: "notifications", version: "1.0.0" },
607
+ { key: "feature-flags", version: "1.0.0" }
608
+ ],
609
+ provides: [
610
+ { key: "tasks", version: "1.0.0" },
611
+ { key: "rituals", version: "1.0.0" },
612
+ { key: "announcements", version: "1.0.0" }
613
+ ]
614
+ }
615
+ });
616
+ export {
617
+ UpdateTaskStatusInputModel,
618
+ UpdateTaskStatusContract,
619
+ TeamHubFeature,
620
+ TeamDashboardPresentation,
621
+ TaskModel,
622
+ TaskDetailPresentation,
623
+ TaskBoardPresentation,
624
+ SpaceModel,
625
+ SpaceListPresentation,
626
+ ScheduleRitualInputModel,
627
+ ScheduleRitualContract,
628
+ RitualModel,
629
+ RitualCalendarPresentation,
630
+ PostAnnouncementInputModel,
631
+ PostAnnouncementContract,
632
+ LogRitualOccurrenceInputModel,
633
+ LogRitualOccurrenceContract,
634
+ ListTasksOutputModel,
635
+ ListTasksOperation,
636
+ ListTasksInputModel,
637
+ CreateTaskInputModel,
638
+ CreateTaskContract,
639
+ CreateSpaceInputModel,
640
+ CreateSpaceContract,
641
+ AnnouncementModel,
642
+ AnnouncementFeedPresentation
643
+ };