business-as-code 2.3.0 → 2.4.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 (213) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/CHANGELOG.md +43 -0
  3. package/dist/business.d.ts +62 -0
  4. package/dist/business.d.ts.map +1 -0
  5. package/dist/business.js +109 -0
  6. package/dist/business.js.map +1 -0
  7. package/dist/dollar.d.ts +60 -0
  8. package/dist/dollar.d.ts.map +1 -0
  9. package/dist/dollar.js +107 -0
  10. package/dist/dollar.js.map +1 -0
  11. package/dist/entities/assets.d.ts +21 -0
  12. package/dist/entities/assets.d.ts.map +1 -0
  13. package/dist/entities/assets.js +323 -0
  14. package/dist/entities/assets.js.map +1 -0
  15. package/dist/entities/business.d.ts +36 -0
  16. package/dist/entities/business.d.ts.map +1 -0
  17. package/dist/entities/business.js +370 -0
  18. package/dist/entities/business.js.map +1 -0
  19. package/dist/entities/communication.d.ts +21 -0
  20. package/dist/entities/communication.d.ts.map +1 -0
  21. package/dist/entities/communication.js +255 -0
  22. package/dist/entities/communication.js.map +1 -0
  23. package/dist/entities/customers.d.ts +58 -0
  24. package/dist/entities/customers.d.ts.map +1 -0
  25. package/dist/entities/customers.js +989 -0
  26. package/dist/entities/customers.js.map +1 -0
  27. package/dist/entities/financials.d.ts +59 -0
  28. package/dist/entities/financials.d.ts.map +1 -0
  29. package/dist/entities/financials.js +932 -0
  30. package/dist/entities/financials.js.map +1 -0
  31. package/dist/entities/goals.d.ts +58 -0
  32. package/dist/entities/goals.d.ts.map +1 -0
  33. package/dist/entities/goals.js +800 -0
  34. package/dist/entities/goals.js.map +1 -0
  35. package/dist/entities/index.d.ts +299 -0
  36. package/dist/entities/index.d.ts.map +1 -0
  37. package/dist/entities/index.js +198 -0
  38. package/dist/entities/index.js.map +1 -0
  39. package/dist/entities/legal.d.ts +21 -0
  40. package/dist/entities/legal.d.ts.map +1 -0
  41. package/dist/entities/legal.js +301 -0
  42. package/dist/entities/legal.js.map +1 -0
  43. package/dist/entities/market.d.ts +21 -0
  44. package/dist/entities/market.d.ts.map +1 -0
  45. package/dist/entities/market.js +301 -0
  46. package/dist/entities/market.js.map +1 -0
  47. package/dist/entities/marketing.d.ts +67 -0
  48. package/dist/entities/marketing.d.ts.map +1 -0
  49. package/dist/entities/marketing.js +1157 -0
  50. package/dist/entities/marketing.js.map +1 -0
  51. package/dist/entities/offerings.d.ts +51 -0
  52. package/dist/entities/offerings.d.ts.map +1 -0
  53. package/dist/entities/offerings.js +727 -0
  54. package/dist/entities/offerings.js.map +1 -0
  55. package/dist/entities/operations.d.ts +58 -0
  56. package/dist/entities/operations.d.ts.map +1 -0
  57. package/dist/entities/operations.js +787 -0
  58. package/dist/entities/operations.js.map +1 -0
  59. package/dist/entities/organization.d.ts +61 -0
  60. package/dist/entities/organization.d.ts.map +1 -0
  61. package/dist/entities/organization.js +816 -0
  62. package/dist/entities/organization.js.map +1 -0
  63. package/dist/entities/partnerships.d.ts +21 -0
  64. package/dist/entities/partnerships.d.ts.map +1 -0
  65. package/dist/entities/partnerships.js +300 -0
  66. package/dist/entities/partnerships.js.map +1 -0
  67. package/dist/entities/planning.d.ts +87 -0
  68. package/dist/entities/planning.d.ts.map +1 -0
  69. package/dist/entities/planning.js +271 -0
  70. package/dist/entities/planning.js.map +1 -0
  71. package/dist/entities/projects.d.ts +25 -0
  72. package/dist/entities/projects.d.ts.map +1 -0
  73. package/dist/entities/projects.js +349 -0
  74. package/dist/entities/projects.js.map +1 -0
  75. package/dist/entities/risk.d.ts +21 -0
  76. package/dist/entities/risk.d.ts.map +1 -0
  77. package/dist/entities/risk.js +293 -0
  78. package/dist/entities/risk.js.map +1 -0
  79. package/dist/entities/sales.d.ts +72 -0
  80. package/dist/entities/sales.d.ts.map +1 -0
  81. package/dist/entities/sales.js +1248 -0
  82. package/dist/entities/sales.js.map +1 -0
  83. package/dist/finance/account.d.ts +44 -0
  84. package/dist/finance/account.d.ts.map +1 -0
  85. package/dist/finance/account.js +6 -0
  86. package/dist/finance/account.js.map +1 -0
  87. package/dist/finance/authority.d.ts +78 -0
  88. package/dist/finance/authority.d.ts.map +1 -0
  89. package/dist/finance/authority.js +27 -0
  90. package/dist/finance/authority.js.map +1 -0
  91. package/dist/finance/card.d.ts +36 -0
  92. package/dist/finance/card.d.ts.map +1 -0
  93. package/dist/finance/card.js +6 -0
  94. package/dist/finance/card.js.map +1 -0
  95. package/dist/finance/identity.d.ts +30 -0
  96. package/dist/finance/identity.d.ts.map +1 -0
  97. package/dist/finance/identity.js +8 -0
  98. package/dist/finance/identity.js.map +1 -0
  99. package/dist/finance/index.d.ts +36 -0
  100. package/dist/finance/index.d.ts.map +1 -0
  101. package/dist/finance/index.js +22 -0
  102. package/dist/finance/index.js.map +1 -0
  103. package/dist/finance/ledger.d.ts +24 -0
  104. package/dist/finance/ledger.d.ts.map +1 -0
  105. package/dist/finance/ledger.js +8 -0
  106. package/dist/finance/ledger.js.map +1 -0
  107. package/dist/finance/merchant.d.ts +129 -0
  108. package/dist/finance/merchant.d.ts.map +1 -0
  109. package/dist/finance/merchant.js +21 -0
  110. package/dist/finance/merchant.js.map +1 -0
  111. package/dist/finance/outcome-contract.d.ts +139 -0
  112. package/dist/finance/outcome-contract.d.ts.map +1 -0
  113. package/dist/finance/outcome-contract.js +27 -0
  114. package/dist/finance/outcome-contract.js.map +1 -0
  115. package/dist/finance/port.d.ts +121 -0
  116. package/dist/finance/port.d.ts.map +1 -0
  117. package/dist/finance/port.js +10 -0
  118. package/dist/finance/port.js.map +1 -0
  119. package/dist/finance/pricing.d.ts +154 -0
  120. package/dist/finance/pricing.d.ts.map +1 -0
  121. package/dist/finance/pricing.js +79 -0
  122. package/dist/finance/pricing.js.map +1 -0
  123. package/dist/finance/proof-predicate.d.ts +92 -0
  124. package/dist/finance/proof-predicate.d.ts.map +1 -0
  125. package/dist/finance/proof-predicate.js +80 -0
  126. package/dist/finance/proof-predicate.js.map +1 -0
  127. package/dist/finance/refund.d.ts +44 -0
  128. package/dist/finance/refund.d.ts.map +1 -0
  129. package/dist/finance/refund.js +41 -0
  130. package/dist/finance/refund.js.map +1 -0
  131. package/dist/finance/sla.d.ts +25 -0
  132. package/dist/finance/sla.d.ts.map +1 -0
  133. package/dist/finance/sla.js +7 -0
  134. package/dist/finance/sla.js.map +1 -0
  135. package/dist/finance/types.d.ts +79 -0
  136. package/dist/finance/types.d.ts.map +1 -0
  137. package/dist/finance/types.js +8 -0
  138. package/dist/finance/types.js.map +1 -0
  139. package/dist/financials.d.ts +130 -0
  140. package/dist/financials.d.ts.map +1 -0
  141. package/dist/financials.js +297 -0
  142. package/dist/financials.js.map +1 -0
  143. package/dist/goals.d.ts +106 -0
  144. package/dist/goals.d.ts.map +1 -0
  145. package/dist/goals.js +284 -0
  146. package/dist/goals.js.map +1 -0
  147. package/dist/index.d.ts +101 -0
  148. package/dist/index.d.ts.map +1 -0
  149. package/dist/index.js +144 -0
  150. package/dist/index.js.map +1 -0
  151. package/dist/kpis.d.ts +137 -0
  152. package/dist/kpis.d.ts.map +1 -0
  153. package/dist/kpis.js +297 -0
  154. package/dist/kpis.js.map +1 -0
  155. package/dist/metrics.d.ts +448 -0
  156. package/dist/metrics.d.ts.map +1 -0
  157. package/dist/metrics.js +330 -0
  158. package/dist/metrics.js.map +1 -0
  159. package/dist/okrs.d.ts +157 -0
  160. package/dist/okrs.d.ts.map +1 -0
  161. package/dist/okrs.js +391 -0
  162. package/dist/okrs.js.map +1 -0
  163. package/dist/organization.d.ts +585 -0
  164. package/dist/organization.d.ts.map +1 -0
  165. package/dist/organization.js +173 -0
  166. package/dist/organization.js.map +1 -0
  167. package/dist/process.d.ts +112 -0
  168. package/dist/process.d.ts.map +1 -0
  169. package/dist/process.js +242 -0
  170. package/dist/process.js.map +1 -0
  171. package/dist/product.d.ts +85 -0
  172. package/dist/product.d.ts.map +1 -0
  173. package/dist/product.js +145 -0
  174. package/dist/product.js.map +1 -0
  175. package/dist/queries.d.ts +304 -0
  176. package/dist/queries.d.ts.map +1 -0
  177. package/dist/queries.js +577 -0
  178. package/dist/queries.js.map +1 -0
  179. package/dist/roles.d.ts +334 -0
  180. package/dist/roles.d.ts.map +1 -0
  181. package/dist/roles.js +282 -0
  182. package/dist/roles.js.map +1 -0
  183. package/dist/service.d.ts +61 -0
  184. package/dist/service.d.ts.map +1 -0
  185. package/dist/service.js +140 -0
  186. package/dist/service.js.map +1 -0
  187. package/dist/types.d.ts +459 -0
  188. package/dist/types.d.ts.map +1 -0
  189. package/dist/types.js +5 -0
  190. package/dist/types.js.map +1 -0
  191. package/dist/vision.d.ts +38 -0
  192. package/dist/vision.d.ts.map +1 -0
  193. package/dist/vision.js +68 -0
  194. package/dist/vision.js.map +1 -0
  195. package/dist/workflow.d.ts +115 -0
  196. package/dist/workflow.d.ts.map +1 -0
  197. package/dist/workflow.js +248 -0
  198. package/dist/workflow.js.map +1 -0
  199. package/package.json +8 -4
  200. package/src/finance/account.ts +48 -0
  201. package/src/finance/authority.ts +42 -0
  202. package/src/finance/card.ts +38 -0
  203. package/src/finance/identity.ts +31 -0
  204. package/src/finance/index.ts +117 -0
  205. package/src/finance/ledger.ts +26 -0
  206. package/src/finance/merchant.ts +127 -0
  207. package/src/finance/outcome-contract.ts +157 -0
  208. package/src/finance/port.ts +144 -0
  209. package/src/finance/pricing.ts +197 -0
  210. package/src/finance/proof-predicate.ts +106 -0
  211. package/src/finance/refund.ts +52 -0
  212. package/src/finance/sla.ts +33 -0
  213. package/src/finance/types.ts +75 -0
@@ -0,0 +1,816 @@
1
+ /**
2
+ * Organization Entity Types (Nouns)
3
+ *
4
+ * Organizational hierarchy: Organization, Department, Team, Position, Role.
5
+ *
6
+ * Uses digital-workers Worker type for position holders.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ // =============================================================================
11
+ // Organization
12
+ // =============================================================================
13
+ /**
14
+ * Organization entity
15
+ *
16
+ * Represents the top-level organizational structure.
17
+ */
18
+ export const Organization = {
19
+ singular: 'organization',
20
+ plural: 'organizations',
21
+ description: 'The top-level organizational structure',
22
+ properties: {
23
+ // Identity
24
+ name: {
25
+ type: 'string',
26
+ description: 'Organization name',
27
+ },
28
+ description: {
29
+ type: 'string',
30
+ optional: true,
31
+ description: 'Organization description',
32
+ },
33
+ // Type
34
+ type: {
35
+ type: 'string',
36
+ optional: true,
37
+ description: 'Organization type',
38
+ examples: ['functional', 'divisional', 'matrix', 'flat', 'holacracy'],
39
+ },
40
+ // Settings
41
+ fiscalYearStart: {
42
+ type: 'string',
43
+ optional: true,
44
+ description: 'Fiscal year start month (e.g., "January", "April")',
45
+ },
46
+ defaultCurrency: {
47
+ type: 'string',
48
+ optional: true,
49
+ description: 'Default currency code',
50
+ examples: ['USD', 'EUR', 'GBP'],
51
+ },
52
+ defaultTimezone: {
53
+ type: 'string',
54
+ optional: true,
55
+ description: 'Default timezone',
56
+ },
57
+ // Size
58
+ departmentCount: {
59
+ type: 'number',
60
+ optional: true,
61
+ description: 'Number of departments',
62
+ },
63
+ teamCount: {
64
+ type: 'number',
65
+ optional: true,
66
+ description: 'Number of teams',
67
+ },
68
+ positionCount: {
69
+ type: 'number',
70
+ optional: true,
71
+ description: 'Number of positions',
72
+ },
73
+ // Status
74
+ status: {
75
+ type: 'string',
76
+ optional: true,
77
+ description: 'Organization status',
78
+ examples: ['active', 'restructuring', 'archived'],
79
+ },
80
+ },
81
+ relationships: {
82
+ business: {
83
+ type: 'Business',
84
+ description: 'Parent business',
85
+ },
86
+ departments: {
87
+ type: 'Department[]',
88
+ description: 'Departments',
89
+ },
90
+ teams: {
91
+ type: 'Team[]',
92
+ description: 'All teams',
93
+ },
94
+ positions: {
95
+ type: 'Position[]',
96
+ description: 'All positions',
97
+ },
98
+ roles: {
99
+ type: 'Role[]',
100
+ description: 'Defined roles',
101
+ },
102
+ },
103
+ actions: ['create', 'update', 'restructure', 'merge', 'split', 'archive'],
104
+ events: ['created', 'updated', 'restructured', 'merged', 'split', 'archived'],
105
+ };
106
+ // =============================================================================
107
+ // Department
108
+ // =============================================================================
109
+ /**
110
+ * Department entity
111
+ *
112
+ * Represents a functional department or division.
113
+ */
114
+ export const Department = {
115
+ singular: 'department',
116
+ plural: 'departments',
117
+ description: 'A functional department or division',
118
+ properties: {
119
+ // Identity
120
+ name: {
121
+ type: 'string',
122
+ description: 'Department name',
123
+ },
124
+ code: {
125
+ type: 'string',
126
+ optional: true,
127
+ description: 'Department code (e.g., "ENG", "MKT")',
128
+ },
129
+ description: {
130
+ type: 'string',
131
+ optional: true,
132
+ description: 'Department description',
133
+ },
134
+ // Type
135
+ type: {
136
+ type: 'string',
137
+ optional: true,
138
+ description: 'Department type',
139
+ examples: [
140
+ 'engineering',
141
+ 'product',
142
+ 'design',
143
+ 'marketing',
144
+ 'sales',
145
+ 'operations',
146
+ 'finance',
147
+ 'hr',
148
+ 'legal',
149
+ 'support',
150
+ ],
151
+ },
152
+ // Budget
153
+ budget: {
154
+ type: 'number',
155
+ optional: true,
156
+ description: 'Annual budget',
157
+ },
158
+ budgetCurrency: {
159
+ type: 'string',
160
+ optional: true,
161
+ description: 'Budget currency',
162
+ },
163
+ budgetPeriod: {
164
+ type: 'string',
165
+ optional: true,
166
+ description: 'Budget period',
167
+ examples: ['monthly', 'quarterly', 'yearly'],
168
+ },
169
+ // Size
170
+ headcount: {
171
+ type: 'number',
172
+ optional: true,
173
+ description: 'Number of employees',
174
+ },
175
+ teamCount: {
176
+ type: 'number',
177
+ optional: true,
178
+ description: 'Number of teams',
179
+ },
180
+ // Hierarchy
181
+ level: {
182
+ type: 'number',
183
+ optional: true,
184
+ description: 'Organizational level (1 = top)',
185
+ },
186
+ // Status
187
+ status: {
188
+ type: 'string',
189
+ optional: true,
190
+ description: 'Department status',
191
+ examples: ['active', 'forming', 'restructuring', 'dissolved'],
192
+ },
193
+ },
194
+ relationships: {
195
+ organization: {
196
+ type: 'Organization',
197
+ description: 'Parent organization',
198
+ },
199
+ parent: {
200
+ type: 'Department',
201
+ required: false,
202
+ description: 'Parent department (for sub-departments)',
203
+ },
204
+ children: {
205
+ type: 'Department[]',
206
+ description: 'Sub-departments',
207
+ },
208
+ head: {
209
+ type: 'Position',
210
+ required: false,
211
+ description: 'Department head position',
212
+ },
213
+ teams: {
214
+ type: 'Team[]',
215
+ description: 'Teams in this department',
216
+ },
217
+ goals: {
218
+ type: 'Goal[]',
219
+ description: 'Department goals',
220
+ },
221
+ budgets: {
222
+ type: 'Budget[]',
223
+ description: 'Budget allocations',
224
+ },
225
+ },
226
+ actions: [
227
+ 'create',
228
+ 'update',
229
+ 'rename',
230
+ 'setBudget',
231
+ 'addTeam',
232
+ 'removeTeam',
233
+ 'setHead',
234
+ 'merge',
235
+ 'split',
236
+ 'dissolve',
237
+ 'archive',
238
+ ],
239
+ events: [
240
+ 'created',
241
+ 'updated',
242
+ 'renamed',
243
+ 'budgetSet',
244
+ 'teamAdded',
245
+ 'teamRemoved',
246
+ 'headChanged',
247
+ 'merged',
248
+ 'split',
249
+ 'dissolved',
250
+ 'archived',
251
+ ],
252
+ };
253
+ // =============================================================================
254
+ // Team
255
+ // =============================================================================
256
+ /**
257
+ * Team entity
258
+ *
259
+ * Represents a working team within a department.
260
+ */
261
+ export const Team = {
262
+ singular: 'team',
263
+ plural: 'teams',
264
+ description: 'A working team within a department',
265
+ properties: {
266
+ // Identity
267
+ name: {
268
+ type: 'string',
269
+ description: 'Team name',
270
+ },
271
+ code: {
272
+ type: 'string',
273
+ optional: true,
274
+ description: 'Team code',
275
+ },
276
+ description: {
277
+ type: 'string',
278
+ optional: true,
279
+ description: 'Team description',
280
+ },
281
+ // Type
282
+ type: {
283
+ type: 'string',
284
+ optional: true,
285
+ description: 'Team type',
286
+ examples: ['product', 'platform', 'growth', 'infrastructure', 'support', 'project', 'tiger'],
287
+ },
288
+ methodology: {
289
+ type: 'string',
290
+ optional: true,
291
+ description: 'Working methodology',
292
+ examples: ['scrum', 'kanban', 'scrumban', 'waterfall', 'hybrid'],
293
+ },
294
+ // Size
295
+ capacity: {
296
+ type: 'number',
297
+ optional: true,
298
+ description: 'Team capacity (FTE)',
299
+ },
300
+ headcount: {
301
+ type: 'number',
302
+ optional: true,
303
+ description: 'Number of members',
304
+ },
305
+ // Communication
306
+ slackChannel: {
307
+ type: 'string',
308
+ optional: true,
309
+ description: 'Slack channel',
310
+ },
311
+ email: {
312
+ type: 'string',
313
+ optional: true,
314
+ description: 'Team email',
315
+ },
316
+ // Status
317
+ status: {
318
+ type: 'string',
319
+ optional: true,
320
+ description: 'Team status',
321
+ examples: ['active', 'forming', 'storming', 'norming', 'performing', 'adjourning'],
322
+ },
323
+ },
324
+ relationships: {
325
+ department: {
326
+ type: 'Department',
327
+ description: 'Parent department',
328
+ },
329
+ lead: {
330
+ type: 'Position',
331
+ required: false,
332
+ description: 'Team lead position',
333
+ },
334
+ positions: {
335
+ type: 'Position[]',
336
+ description: 'Team positions',
337
+ },
338
+ projects: {
339
+ type: 'Project[]',
340
+ description: 'Active projects',
341
+ },
342
+ workflows: {
343
+ type: 'Workflow[]',
344
+ description: 'Team workflows',
345
+ },
346
+ },
347
+ actions: [
348
+ 'create',
349
+ 'update',
350
+ 'rename',
351
+ 'setLead',
352
+ 'addMember',
353
+ 'removeMember',
354
+ 'setCapacity',
355
+ 'assignProject',
356
+ 'unassignProject',
357
+ 'archive',
358
+ ],
359
+ events: [
360
+ 'created',
361
+ 'updated',
362
+ 'renamed',
363
+ 'leadChanged',
364
+ 'memberAdded',
365
+ 'memberRemoved',
366
+ 'capacityChanged',
367
+ 'projectAssigned',
368
+ 'projectUnassigned',
369
+ 'archived',
370
+ ],
371
+ };
372
+ // =============================================================================
373
+ // Position
374
+ // =============================================================================
375
+ /**
376
+ * Position entity
377
+ *
378
+ * Represents a position/job within the organization.
379
+ */
380
+ export const Position = {
381
+ singular: 'position',
382
+ plural: 'positions',
383
+ description: 'A position or job within the organization',
384
+ properties: {
385
+ // Identity
386
+ title: {
387
+ type: 'string',
388
+ description: 'Position title',
389
+ },
390
+ code: {
391
+ type: 'string',
392
+ optional: true,
393
+ description: 'Position code',
394
+ },
395
+ description: {
396
+ type: 'string',
397
+ optional: true,
398
+ description: 'Position description',
399
+ },
400
+ // Classification
401
+ level: {
402
+ type: 'string',
403
+ optional: true,
404
+ description: 'Job level',
405
+ examples: [
406
+ 'intern',
407
+ 'junior',
408
+ 'mid',
409
+ 'senior',
410
+ 'staff',
411
+ 'principal',
412
+ 'director',
413
+ 'vp',
414
+ 'c-level',
415
+ ],
416
+ },
417
+ track: {
418
+ type: 'string',
419
+ optional: true,
420
+ description: 'Career track',
421
+ examples: ['individual-contributor', 'management', 'executive'],
422
+ },
423
+ grade: {
424
+ type: 'string',
425
+ optional: true,
426
+ description: 'Pay grade',
427
+ },
428
+ // Type
429
+ employmentType: {
430
+ type: 'string',
431
+ optional: true,
432
+ description: 'Employment type',
433
+ examples: ['full-time', 'part-time', 'contract', 'intern', 'advisor'],
434
+ },
435
+ workLocation: {
436
+ type: 'string',
437
+ optional: true,
438
+ description: 'Work location type',
439
+ examples: ['remote', 'office', 'hybrid'],
440
+ },
441
+ // Compensation
442
+ salaryMin: {
443
+ type: 'number',
444
+ optional: true,
445
+ description: 'Minimum salary',
446
+ },
447
+ salaryMax: {
448
+ type: 'number',
449
+ optional: true,
450
+ description: 'Maximum salary',
451
+ },
452
+ salaryCurrency: {
453
+ type: 'string',
454
+ optional: true,
455
+ description: 'Salary currency',
456
+ },
457
+ equityMin: {
458
+ type: 'number',
459
+ optional: true,
460
+ description: 'Minimum equity percentage',
461
+ },
462
+ equityMax: {
463
+ type: 'number',
464
+ optional: true,
465
+ description: 'Maximum equity percentage',
466
+ },
467
+ // Capacity
468
+ fte: {
469
+ type: 'number',
470
+ optional: true,
471
+ description: 'Full-time equivalent (0-1)',
472
+ },
473
+ // Requirements
474
+ requirements: {
475
+ type: 'string',
476
+ array: true,
477
+ optional: true,
478
+ description: 'Position requirements',
479
+ },
480
+ skills: {
481
+ type: 'string',
482
+ array: true,
483
+ optional: true,
484
+ description: 'Required skills',
485
+ },
486
+ // Status
487
+ status: {
488
+ type: 'string',
489
+ optional: true,
490
+ description: 'Position status',
491
+ examples: ['open', 'filled', 'frozen', 'eliminated'],
492
+ },
493
+ },
494
+ relationships: {
495
+ team: {
496
+ type: 'Team',
497
+ description: 'Parent team',
498
+ },
499
+ role: {
500
+ type: 'Role',
501
+ description: 'Assigned role',
502
+ },
503
+ reportsTo: {
504
+ type: 'Position',
505
+ required: false,
506
+ description: 'Reports to position',
507
+ },
508
+ directReports: {
509
+ type: 'Position[]',
510
+ description: 'Direct reports',
511
+ },
512
+ holder: {
513
+ type: 'Worker',
514
+ required: false,
515
+ description: 'Current position holder',
516
+ },
517
+ },
518
+ actions: [
519
+ 'create',
520
+ 'update',
521
+ 'open',
522
+ 'fill',
523
+ 'freeze',
524
+ 'eliminate',
525
+ 'transfer',
526
+ 'promote',
527
+ 'setCompensation',
528
+ 'archive',
529
+ ],
530
+ events: [
531
+ 'created',
532
+ 'updated',
533
+ 'opened',
534
+ 'filled',
535
+ 'frozen',
536
+ 'eliminated',
537
+ 'transferred',
538
+ 'promoted',
539
+ 'compensationChanged',
540
+ 'archived',
541
+ ],
542
+ };
543
+ // =============================================================================
544
+ // Role
545
+ // =============================================================================
546
+ /**
547
+ * Role entity
548
+ *
549
+ * Represents a role with permissions and capabilities.
550
+ */
551
+ export const Role = {
552
+ singular: 'role',
553
+ plural: 'roles',
554
+ description: 'A role with permissions and capabilities',
555
+ properties: {
556
+ // Identity
557
+ name: {
558
+ type: 'string',
559
+ description: 'Role name',
560
+ },
561
+ code: {
562
+ type: 'string',
563
+ optional: true,
564
+ description: 'Role code',
565
+ },
566
+ description: {
567
+ type: 'string',
568
+ optional: true,
569
+ description: 'Role description',
570
+ },
571
+ // Type
572
+ type: {
573
+ type: 'string',
574
+ optional: true,
575
+ description: 'Role type',
576
+ examples: ['executive', 'manager', 'lead', 'contributor', 'specialist', 'support'],
577
+ },
578
+ // Permissions
579
+ permissions: {
580
+ type: 'string',
581
+ array: true,
582
+ optional: true,
583
+ description: 'Granted permissions',
584
+ },
585
+ capabilities: {
586
+ type: 'string',
587
+ array: true,
588
+ optional: true,
589
+ description: 'Role capabilities',
590
+ },
591
+ // Approval
592
+ approvalLevel: {
593
+ type: 'number',
594
+ optional: true,
595
+ description: 'Approval authority level',
596
+ },
597
+ approvalLimit: {
598
+ type: 'number',
599
+ optional: true,
600
+ description: 'Approval spending limit',
601
+ },
602
+ // Hierarchy
603
+ level: {
604
+ type: 'number',
605
+ optional: true,
606
+ description: 'Role hierarchy level',
607
+ },
608
+ // Status
609
+ status: {
610
+ type: 'string',
611
+ optional: true,
612
+ description: 'Role status',
613
+ examples: ['active', 'deprecated'],
614
+ },
615
+ },
616
+ relationships: {
617
+ organization: {
618
+ type: 'Organization',
619
+ description: 'Parent organization',
620
+ },
621
+ parent: {
622
+ type: 'Role',
623
+ required: false,
624
+ description: 'Parent role (inherits permissions)',
625
+ },
626
+ children: {
627
+ type: 'Role[]',
628
+ description: 'Child roles',
629
+ },
630
+ positions: {
631
+ type: 'Position[]',
632
+ description: 'Positions with this role',
633
+ },
634
+ },
635
+ actions: [
636
+ 'create',
637
+ 'update',
638
+ 'grantPermission',
639
+ 'revokePermission',
640
+ 'setApprovalLimit',
641
+ 'deprecate',
642
+ 'archive',
643
+ ],
644
+ events: [
645
+ 'created',
646
+ 'updated',
647
+ 'permissionGranted',
648
+ 'permissionRevoked',
649
+ 'approvalLimitChanged',
650
+ 'deprecated',
651
+ 'archived',
652
+ ],
653
+ };
654
+ // =============================================================================
655
+ // Worker
656
+ // =============================================================================
657
+ /**
658
+ * Worker entity
659
+ *
660
+ * Represents a human employee or AI agent that fills a position.
661
+ */
662
+ export const Worker = {
663
+ singular: 'worker',
664
+ plural: 'workers',
665
+ description: 'A human employee or AI agent that fills a position',
666
+ properties: {
667
+ // Identity
668
+ name: {
669
+ type: 'string',
670
+ description: 'Worker name',
671
+ },
672
+ email: {
673
+ type: 'string',
674
+ optional: true,
675
+ description: 'Email address',
676
+ },
677
+ avatarUrl: {
678
+ type: 'url',
679
+ optional: true,
680
+ description: 'Avatar URL',
681
+ },
682
+ // Type
683
+ type: {
684
+ type: 'string',
685
+ description: 'Worker type',
686
+ examples: ['human', 'agent'],
687
+ },
688
+ // Human-specific
689
+ firstName: {
690
+ type: 'string',
691
+ optional: true,
692
+ description: 'First name',
693
+ },
694
+ lastName: {
695
+ type: 'string',
696
+ optional: true,
697
+ description: 'Last name',
698
+ },
699
+ phone: {
700
+ type: 'string',
701
+ optional: true,
702
+ description: 'Phone number',
703
+ },
704
+ location: {
705
+ type: 'string',
706
+ optional: true,
707
+ description: 'Work location',
708
+ },
709
+ timezone: {
710
+ type: 'string',
711
+ optional: true,
712
+ description: 'Timezone',
713
+ },
714
+ startDate: {
715
+ type: 'date',
716
+ optional: true,
717
+ description: 'Start date',
718
+ },
719
+ // Agent-specific
720
+ agentId: {
721
+ type: 'string',
722
+ optional: true,
723
+ description: 'AI agent identifier',
724
+ },
725
+ modelId: {
726
+ type: 'string',
727
+ optional: true,
728
+ description: 'AI model identifier',
729
+ },
730
+ capabilities: {
731
+ type: 'string',
732
+ array: true,
733
+ optional: true,
734
+ description: 'Agent capabilities',
735
+ },
736
+ // Availability
737
+ availability: {
738
+ type: 'string',
739
+ optional: true,
740
+ description: 'Availability status',
741
+ examples: ['available', 'busy', 'away', 'offline'],
742
+ },
743
+ capacity: {
744
+ type: 'number',
745
+ optional: true,
746
+ description: 'Available capacity (0-1)',
747
+ },
748
+ // Status
749
+ status: {
750
+ type: 'string',
751
+ optional: true,
752
+ description: 'Worker status',
753
+ examples: ['active', 'onboarding', 'on-leave', 'offboarding', 'inactive'],
754
+ },
755
+ },
756
+ relationships: {
757
+ position: {
758
+ type: 'Position',
759
+ required: false,
760
+ description: 'Current position',
761
+ },
762
+ manager: {
763
+ type: 'Worker',
764
+ required: false,
765
+ description: 'Direct manager',
766
+ },
767
+ directReports: {
768
+ type: 'Worker[]',
769
+ description: 'Direct reports',
770
+ },
771
+ tasks: {
772
+ type: 'Task[]',
773
+ description: 'Assigned tasks',
774
+ },
775
+ },
776
+ actions: [
777
+ 'create',
778
+ 'update',
779
+ 'onboard',
780
+ 'assign',
781
+ 'reassign',
782
+ 'setAvailability',
783
+ 'promote',
784
+ 'transfer',
785
+ 'offboard',
786
+ 'archive',
787
+ ],
788
+ events: [
789
+ 'created',
790
+ 'updated',
791
+ 'onboarded',
792
+ 'assigned',
793
+ 'reassigned',
794
+ 'availabilityChanged',
795
+ 'promoted',
796
+ 'transferred',
797
+ 'offboarded',
798
+ 'archived',
799
+ ],
800
+ };
801
+ // =============================================================================
802
+ // Exports
803
+ // =============================================================================
804
+ export const OrganizationEntities = {
805
+ Organization,
806
+ Department,
807
+ Team,
808
+ Position,
809
+ Role,
810
+ Worker,
811
+ };
812
+ export const OrganizationCategories = {
813
+ structure: ['Organization', 'Department', 'Team'],
814
+ people: ['Position', 'Role', 'Worker'],
815
+ };
816
+ //# sourceMappingURL=organization.js.map