@org.ai/examples 0.0.1

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 (40) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/LICENSE +21 -0
  3. package/README.md +147 -0
  4. package/api-business/index.ts +1179 -0
  5. package/directory/index.ts +1118 -0
  6. package/dist/api-business/index.d.ts +221 -0
  7. package/dist/api-business/index.d.ts.map +1 -0
  8. package/dist/api-business/index.js +1132 -0
  9. package/dist/api-business/index.js.map +1 -0
  10. package/dist/directory/index.d.ts +202 -0
  11. package/dist/directory/index.d.ts.map +1 -0
  12. package/dist/directory/index.js +1073 -0
  13. package/dist/directory/index.js.map +1 -0
  14. package/dist/index.d.ts +75 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +127 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/marketplace/index.d.ts +242 -0
  19. package/dist/marketplace/index.d.ts.map +1 -0
  20. package/dist/marketplace/index.js +1249 -0
  21. package/dist/marketplace/index.js.map +1 -0
  22. package/dist/saas/index.d.ts +151 -0
  23. package/dist/saas/index.d.ts.map +1 -0
  24. package/dist/saas/index.js +1142 -0
  25. package/dist/saas/index.js.map +1 -0
  26. package/dist/startup-studio/index.d.ts +285 -0
  27. package/dist/startup-studio/index.d.ts.map +1 -0
  28. package/dist/startup-studio/index.js +1252 -0
  29. package/dist/startup-studio/index.js.map +1 -0
  30. package/dist/vc-firm/index.d.ts +248 -0
  31. package/dist/vc-firm/index.d.ts.map +1 -0
  32. package/dist/vc-firm/index.js +1335 -0
  33. package/dist/vc-firm/index.js.map +1 -0
  34. package/index.ts +151 -0
  35. package/marketplace/index.ts +1295 -0
  36. package/package.json +58 -0
  37. package/saas/index.ts +1188 -0
  38. package/startup-studio/index.ts +1324 -0
  39. package/tsconfig.json +12 -0
  40. package/vc-firm/index.ts +1430 -0
@@ -0,0 +1,1249 @@
1
+ /**
2
+ * Marketplace Business Example
3
+ *
4
+ * A complete example of a two-sided marketplace modeled using primitives.org.ai
5
+ * Think: Upwork, Toptal, Fiverr, or a B2B services marketplace
6
+ *
7
+ * @example TalentHub - A marketplace for freelance developers
8
+ * @packageDocumentation
9
+ */
10
+ /**
11
+ * NOTE: These examples demonstrate the DESIRED API shape for business-as-code.
12
+ * Some types may not exist yet in the actual package. The examples serve as
13
+ * documentation and specification for the ideal primitives API.
14
+ */
15
+ // Use any for flexibility - these examples define the ideal API shape
16
+ const Business = (def) => def;
17
+ const Product = (def) => def;
18
+ const Service = (def) => def;
19
+ const Goals = (defs) => defs;
20
+ const Vision = (def) => def;
21
+ const kpis = (defs) => defs;
22
+ const okrs = (defs) => defs;
23
+ const financials = (def) => def;
24
+ const Process = (def) => def;
25
+ const Workflow = (def) => def;
26
+ const createBusinessRole = (def) => def;
27
+ // $ helper placeholder
28
+ const $ = {
29
+ format: (n) => `$${n.toLocaleString()}`,
30
+ growth: (current, previous) => ((current - previous) / previous * 100).toFixed(1),
31
+ margin: (revenue, cost) => ((revenue - cost) / revenue * 100).toFixed(1),
32
+ };
33
+ // =============================================================================
34
+ // 1. BUSINESS DEFINITION
35
+ // =============================================================================
36
+ /**
37
+ * TalentHub - Freelance Developer Marketplace
38
+ */
39
+ export const TalentHubBusiness = Business({
40
+ name: 'TalentHub Inc.',
41
+ mission: 'Connect exceptional developers with innovative companies worldwide',
42
+ values: ['Quality Talent', 'Fair Compensation', 'Trust & Transparency', 'Global Access'],
43
+ industry: 'Staffing / Freelance Marketplace',
44
+ founded: new Date('2019-08-01'),
45
+ stage: 'growth',
46
+ structure: {
47
+ departments: [
48
+ {
49
+ name: 'Product & Engineering',
50
+ headcount: 25,
51
+ budget: 3500000,
52
+ teams: [
53
+ { name: 'Platform', headcount: 8, focus: 'Core marketplace' },
54
+ { name: 'Matching', headcount: 5, focus: 'AI matching & recommendations' },
55
+ { name: 'Payments', headcount: 4, focus: 'Escrow & payments' },
56
+ { name: 'Mobile', headcount: 4, focus: 'iOS & Android apps' },
57
+ { name: 'Trust & Safety', headcount: 4, focus: 'Fraud prevention, disputes' },
58
+ ],
59
+ },
60
+ {
61
+ name: 'Supply (Talent)',
62
+ headcount: 15,
63
+ budget: 1500000,
64
+ teams: [
65
+ { name: 'Talent Acquisition', headcount: 6, focus: 'Recruiting developers' },
66
+ { name: 'Vetting', headcount: 5, focus: 'Skills assessment' },
67
+ { name: 'Talent Success', headcount: 4, focus: 'Developer satisfaction' },
68
+ ],
69
+ },
70
+ {
71
+ name: 'Demand (Clients)',
72
+ headcount: 12,
73
+ budget: 1800000,
74
+ teams: [
75
+ { name: 'Sales', headcount: 6, focus: 'Enterprise clients' },
76
+ { name: 'Client Success', headcount: 4, focus: 'Client satisfaction' },
77
+ { name: 'Account Management', headcount: 2, focus: 'Key accounts' },
78
+ ],
79
+ },
80
+ {
81
+ name: 'Operations',
82
+ headcount: 8,
83
+ budget: 800000,
84
+ teams: [
85
+ { name: 'Support', headcount: 4, focus: 'Client & talent support' },
86
+ { name: 'Quality', headcount: 2, focus: 'Quality assurance' },
87
+ { name: 'Finance', headcount: 2, focus: 'Payments & invoicing' },
88
+ ],
89
+ },
90
+ {
91
+ name: 'Marketing',
92
+ headcount: 6,
93
+ budget: 1200000,
94
+ teams: [
95
+ { name: 'Brand & Content', headcount: 3 },
96
+ { name: 'Growth', headcount: 3 },
97
+ ],
98
+ },
99
+ ],
100
+ },
101
+ });
102
+ // =============================================================================
103
+ // 2. VISION & GOALS
104
+ // =============================================================================
105
+ export const TalentHubVision = Vision({
106
+ statement: 'Be the premier platform where top developers build their careers and companies access world-class talent',
107
+ timeHorizon: '2028',
108
+ pillars: [
109
+ 'Talent Quality',
110
+ 'Match Accuracy',
111
+ 'Client Success',
112
+ 'Developer Earnings',
113
+ ],
114
+ successIndicators: [
115
+ { name: 'Gross Merchandise Value', target: 500000000, unit: 'USD' },
116
+ { name: 'Active Developers', target: 100000 },
117
+ { name: 'Enterprise Clients', target: 5000 },
118
+ { name: 'Developer NPS', target: 70 },
119
+ ],
120
+ });
121
+ export const TalentHubGoals = Goals([
122
+ {
123
+ name: 'Reach $100M GMV',
124
+ category: 'financial',
125
+ status: 'in-progress',
126
+ progress: 60,
127
+ dueDate: new Date('2024-12-31'),
128
+ owner: 'CEO',
129
+ },
130
+ {
131
+ name: 'Launch AI Matching 2.0',
132
+ category: 'product',
133
+ status: 'in-progress',
134
+ progress: 40,
135
+ dueDate: new Date('2024-06-30'),
136
+ owner: 'VP Product',
137
+ },
138
+ {
139
+ name: 'Onboard 20K Vetted Developers',
140
+ category: 'supply',
141
+ status: 'in-progress',
142
+ progress: 55,
143
+ dueDate: new Date('2024-09-30'),
144
+ owner: 'VP Talent',
145
+ },
146
+ {
147
+ name: 'Achieve 90% Match Success Rate',
148
+ category: 'operational',
149
+ status: 'in-progress',
150
+ progress: 70,
151
+ dueDate: new Date('2024-06-30'),
152
+ owner: 'VP Product',
153
+ },
154
+ {
155
+ name: 'Expand to 50 Countries',
156
+ category: 'strategic',
157
+ status: 'in-progress',
158
+ progress: 45,
159
+ dueDate: new Date('2024-12-31'),
160
+ owner: 'VP Operations',
161
+ },
162
+ ]);
163
+ // =============================================================================
164
+ // 3. PRODUCTS & SERVICES
165
+ // =============================================================================
166
+ export const MarketplacePlatform = Product({
167
+ name: 'TalentHub Marketplace',
168
+ description: 'Two-sided marketplace connecting developers and clients',
169
+ pricingModel: 'commission',
170
+ features: [
171
+ 'AI-powered matching',
172
+ 'Skill assessments',
173
+ 'Project management',
174
+ 'Time tracking',
175
+ 'Secure payments (escrow)',
176
+ 'Video interviews',
177
+ 'Code collaboration',
178
+ 'Reviews & ratings',
179
+ ],
180
+ roadmap: [
181
+ { name: 'AI Matching 2.0', status: 'in-progress', priority: 'high', targetDate: new Date('2024-Q2') },
182
+ { name: 'Team Matching', status: 'planned', priority: 'high', targetDate: new Date('2024-Q3') },
183
+ { name: 'Skills Marketplace', status: 'planned', priority: 'medium', targetDate: new Date('2024-Q4') },
184
+ ],
185
+ });
186
+ /**
187
+ * Client Products
188
+ */
189
+ export const ClientProducts = {
190
+ selfServe: Product({
191
+ name: 'Self-Serve',
192
+ description: 'Post projects and find talent yourself',
193
+ pricingModel: 'commission',
194
+ price: 15, // % commission on transactions
195
+ features: [
196
+ 'Unlimited job posts',
197
+ 'AI matching suggestions',
198
+ 'Basic support',
199
+ 'Standard escrow',
200
+ ],
201
+ }),
202
+ managed: Product({
203
+ name: 'Managed',
204
+ description: 'Dedicated talent partner',
205
+ pricingModel: 'commission',
206
+ price: 20, // % commission
207
+ features: [
208
+ 'Everything in Self-Serve',
209
+ 'Dedicated talent partner',
210
+ 'Pre-vetted shortlists',
211
+ 'Priority matching',
212
+ 'Extended payment terms',
213
+ ],
214
+ }),
215
+ enterprise: Product({
216
+ name: 'Enterprise',
217
+ description: 'Full-service talent solution',
218
+ pricingModel: 'subscription',
219
+ price: 5000, // /month + commission
220
+ features: [
221
+ 'Everything in Managed',
222
+ 'Dedicated team',
223
+ 'Custom vetting criteria',
224
+ 'API access',
225
+ 'Compliance & legal support',
226
+ 'SOW management',
227
+ 'Bulk hiring',
228
+ ],
229
+ }),
230
+ };
231
+ /**
232
+ * Developer Products
233
+ */
234
+ export const DeveloperProducts = {
235
+ basic: Product({
236
+ name: 'Basic Profile',
237
+ description: 'Free developer profile',
238
+ pricingModel: 'free',
239
+ features: [
240
+ 'Profile creation',
241
+ 'Job applications',
242
+ 'Basic matching',
243
+ 'Skills assessments',
244
+ ],
245
+ }),
246
+ pro: Product({
247
+ name: 'Pro Profile',
248
+ description: 'Enhanced visibility and features',
249
+ pricingModel: 'subscription',
250
+ price: 29, // /month
251
+ features: [
252
+ 'Everything in Basic',
253
+ 'Featured in searches',
254
+ 'Priority support',
255
+ 'Advanced analytics',
256
+ 'Direct messaging',
257
+ ],
258
+ }),
259
+ };
260
+ /**
261
+ * Value-Added Services
262
+ */
263
+ export const Services = {
264
+ vetting: Service({
265
+ name: 'Premium Vetting',
266
+ description: 'Comprehensive technical vetting',
267
+ pricingModel: 'fixed',
268
+ deliverables: [
269
+ 'Technical interview',
270
+ 'Code assessment',
271
+ 'Background check',
272
+ 'Reference verification',
273
+ ],
274
+ }),
275
+ payroll: Service({
276
+ name: 'Payroll Services',
277
+ description: 'Handle contractor payments globally',
278
+ pricingModel: 'percentage',
279
+ deliverables: [
280
+ 'Multi-currency payments',
281
+ 'Tax documentation',
282
+ 'Compliance handling',
283
+ 'Payment scheduling',
284
+ ],
285
+ }),
286
+ };
287
+ // =============================================================================
288
+ // 4. ORGANIZATION & ROLES
289
+ // =============================================================================
290
+ export const TalentHubOrg = {
291
+ id: 'talenthub',
292
+ name: 'TalentHub Inc.',
293
+ settings: {
294
+ timezone: 'America/Los_Angeles',
295
+ currency: 'USD',
296
+ fiscalYearStart: 1,
297
+ },
298
+ departments: [
299
+ {
300
+ id: 'talent',
301
+ name: 'Supply (Talent)',
302
+ permissions: {
303
+ developers: ['read', 'write', 'vet', 'approve'],
304
+ applications: ['read', 'write', 'review'],
305
+ assessments: ['read', 'write', 'score'],
306
+ },
307
+ teams: [
308
+ {
309
+ id: 'vetting',
310
+ name: 'Vetting',
311
+ positions: [
312
+ { id: 'vetting-lead', title: 'Vetting Lead', roleId: 'vetting-manager', reportsTo: 'vp-talent' },
313
+ { id: 'vetter-1', title: 'Technical Vetter', roleId: 'vetter', reportsTo: 'vetting-lead' },
314
+ ],
315
+ },
316
+ {
317
+ id: 'talent-success',
318
+ name: 'Talent Success',
319
+ positions: [
320
+ { id: 'ts-lead', title: 'Talent Success Lead', roleId: 'talent-success', reportsTo: 'vp-talent' },
321
+ ],
322
+ },
323
+ ],
324
+ },
325
+ {
326
+ id: 'demand',
327
+ name: 'Demand (Clients)',
328
+ permissions: {
329
+ clients: ['read', 'write', 'manage'],
330
+ projects: ['read', 'write'],
331
+ contracts: ['read', 'write', 'approve'],
332
+ },
333
+ },
334
+ {
335
+ id: 'operations',
336
+ name: 'Operations',
337
+ permissions: {
338
+ disputes: ['read', 'write', 'resolve'],
339
+ payments: ['read', 'write', 'release'],
340
+ support: ['read', 'write'],
341
+ },
342
+ },
343
+ ],
344
+ roles: [
345
+ createBusinessRole({
346
+ id: 'vetting-manager',
347
+ name: 'Vetting Manager',
348
+ type: 'manager',
349
+ level: 5,
350
+ permissions: {
351
+ developers: ['read', 'write', 'vet', 'approve', 'reject'],
352
+ assessments: ['read', 'write', 'score', 'configure'],
353
+ },
354
+ canHandle: ['vetting-escalation', 'assessment-design', 'quality-review'],
355
+ canApprove: ['developer-approval', 'vetting-exception'],
356
+ }),
357
+ createBusinessRole({
358
+ id: 'vetter',
359
+ name: 'Technical Vetter',
360
+ type: 'support',
361
+ level: 4,
362
+ workerType: 'hybrid', // AI-assisted
363
+ permissions: {
364
+ developers: ['read', 'write', 'vet'],
365
+ assessments: ['read', 'write', 'score'],
366
+ },
367
+ canHandle: ['technical-interview', 'code-review', 'skill-assessment'],
368
+ }),
369
+ createBusinessRole({
370
+ id: 'talent-success',
371
+ name: 'Talent Success Manager',
372
+ type: 'support',
373
+ level: 4,
374
+ permissions: {
375
+ developers: ['read', 'write'],
376
+ projects: ['read'],
377
+ support: ['read', 'write'],
378
+ },
379
+ canHandle: ['developer-onboarding', 'performance-review', 'dispute-mediation'],
380
+ }),
381
+ createBusinessRole({
382
+ id: 'client-success',
383
+ name: 'Client Success Manager',
384
+ type: 'support',
385
+ level: 4,
386
+ permissions: {
387
+ clients: ['read', 'write'],
388
+ projects: ['read', 'write'],
389
+ contracts: ['read'],
390
+ },
391
+ canHandle: ['client-onboarding', 'match-review', 'expansion'],
392
+ }),
393
+ createBusinessRole({
394
+ id: 'matcher',
395
+ name: 'Matching Specialist',
396
+ type: 'support',
397
+ level: 3,
398
+ workerType: 'hybrid', // AI + human
399
+ permissions: {
400
+ developers: ['read'],
401
+ clients: ['read'],
402
+ projects: ['read', 'write'],
403
+ },
404
+ canHandle: ['initial-matching', 'shortlist-curation', 'match-optimization'],
405
+ }),
406
+ createBusinessRole({
407
+ id: 'dispute-resolver',
408
+ name: 'Dispute Resolver',
409
+ type: 'support',
410
+ level: 4,
411
+ permissions: {
412
+ disputes: ['read', 'write', 'resolve'],
413
+ payments: ['read', 'hold', 'release'],
414
+ developers: ['read'],
415
+ clients: ['read'],
416
+ },
417
+ canHandle: ['dispute-investigation', 'mediation', 'refund-decision'],
418
+ canApprove: ['refund', 'payment-release'],
419
+ }),
420
+ createBusinessRole({
421
+ id: 'ai-matcher',
422
+ name: 'AI Matching Agent',
423
+ type: 'agent',
424
+ level: 2,
425
+ workerType: 'ai',
426
+ permissions: {
427
+ developers: ['read'],
428
+ clients: ['read'],
429
+ projects: ['read'],
430
+ matches: ['read', 'write', 'suggest'],
431
+ },
432
+ canHandle: ['initial-matching', 'score-calculation', 'availability-check'],
433
+ }),
434
+ createBusinessRole({
435
+ id: 'support-bot',
436
+ name: 'Support Bot',
437
+ type: 'agent',
438
+ level: 1,
439
+ workerType: 'ai',
440
+ permissions: {
441
+ support: ['read', 'write'],
442
+ faq: ['read'],
443
+ },
444
+ canHandle: ['faq-response', 'status-check', 'basic-troubleshooting'],
445
+ }),
446
+ ],
447
+ approvalChains: [
448
+ {
449
+ id: 'refund-approval',
450
+ name: 'Refund Approval',
451
+ requestType: 'refund',
452
+ levels: [
453
+ { threshold: 500, approvers: [{ type: 'role', roleId: 'dispute-resolver' }] },
454
+ { threshold: 2000, approvers: [{ type: 'manager' }] },
455
+ { threshold: 10000, approvers: [{ type: 'department-head' }] },
456
+ { threshold: Infinity, approvers: [{ type: 'role', roleId: 'cfo' }] },
457
+ ],
458
+ },
459
+ {
460
+ id: 'developer-approval',
461
+ name: 'Developer Approval',
462
+ requestType: 'developer-approval',
463
+ levels: [
464
+ { threshold: 1, approvers: [{ type: 'role', roleId: 'vetter' }] }, // Standard
465
+ { threshold: 2, approvers: [{ type: 'role', roleId: 'vetting-manager' }] }, // Exception
466
+ ],
467
+ },
468
+ ],
469
+ routingRules: [
470
+ {
471
+ id: 'project-matching',
472
+ taskType: 'project-matching',
473
+ priority: 1,
474
+ assignTo: { roleId: 'ai-matcher' },
475
+ },
476
+ {
477
+ id: 'vetting-assignment',
478
+ taskType: 'developer-vetting',
479
+ priority: 1,
480
+ assignTo: { roleId: 'vetter' },
481
+ },
482
+ {
483
+ id: 'dispute-routing',
484
+ taskType: 'dispute',
485
+ priority: 1,
486
+ assignTo: { roleId: 'dispute-resolver' },
487
+ },
488
+ {
489
+ id: 'support-routing',
490
+ taskType: 'support-ticket',
491
+ priority: 1,
492
+ assignTo: { roleId: 'support-bot' },
493
+ },
494
+ ],
495
+ };
496
+ // =============================================================================
497
+ // 5. KPIs & METRICS
498
+ // =============================================================================
499
+ export const TalentHubKPIs = kpis([
500
+ // Marketplace Metrics
501
+ {
502
+ name: 'Gross Merchandise Value (GMV)',
503
+ category: 'financial',
504
+ target: 100000000,
505
+ current: 60000000,
506
+ unit: 'USD',
507
+ frequency: 'monthly',
508
+ owner: 'CEO',
509
+ },
510
+ {
511
+ name: 'Take Rate',
512
+ category: 'financial',
513
+ target: 18,
514
+ current: 17,
515
+ unit: '%',
516
+ frequency: 'monthly',
517
+ owner: 'CEO',
518
+ },
519
+ {
520
+ name: 'Net Revenue',
521
+ category: 'financial',
522
+ target: 18000000,
523
+ current: 10200000,
524
+ unit: 'USD',
525
+ frequency: 'monthly',
526
+ owner: 'CFO',
527
+ },
528
+ // Supply Metrics
529
+ {
530
+ name: 'Active Developers',
531
+ category: 'supply',
532
+ target: 20000,
533
+ current: 12000,
534
+ frequency: 'monthly',
535
+ owner: 'VP Talent',
536
+ },
537
+ {
538
+ name: 'Vetted Developers',
539
+ category: 'supply',
540
+ target: 15000,
541
+ current: 9500,
542
+ frequency: 'monthly',
543
+ owner: 'VP Talent',
544
+ },
545
+ {
546
+ name: 'Developer Utilization',
547
+ category: 'supply',
548
+ target: 70,
549
+ current: 58,
550
+ unit: '%',
551
+ frequency: 'weekly',
552
+ owner: 'VP Talent',
553
+ },
554
+ {
555
+ name: 'Developer NPS',
556
+ category: 'supply',
557
+ target: 65,
558
+ current: 58,
559
+ frequency: 'quarterly',
560
+ owner: 'VP Talent',
561
+ },
562
+ // Demand Metrics
563
+ {
564
+ name: 'Active Clients',
565
+ category: 'demand',
566
+ target: 3000,
567
+ current: 1800,
568
+ frequency: 'monthly',
569
+ owner: 'VP Sales',
570
+ },
571
+ {
572
+ name: 'Average Project Size',
573
+ category: 'demand',
574
+ target: 25000,
575
+ current: 18000,
576
+ unit: 'USD',
577
+ frequency: 'monthly',
578
+ owner: 'VP Sales',
579
+ },
580
+ {
581
+ name: 'Client Retention',
582
+ category: 'demand',
583
+ target: 85,
584
+ current: 78,
585
+ unit: '%',
586
+ frequency: 'quarterly',
587
+ owner: 'VP Client Success',
588
+ },
589
+ {
590
+ name: 'Client NPS',
591
+ category: 'demand',
592
+ target: 60,
593
+ current: 52,
594
+ frequency: 'quarterly',
595
+ owner: 'VP Client Success',
596
+ },
597
+ // Matching Metrics
598
+ {
599
+ name: 'Match Success Rate',
600
+ category: 'operational',
601
+ target: 90,
602
+ current: 82,
603
+ unit: '%',
604
+ frequency: 'weekly',
605
+ owner: 'VP Product',
606
+ },
607
+ {
608
+ name: 'Time to Match',
609
+ category: 'operational',
610
+ target: 48,
611
+ current: 72,
612
+ unit: 'hours',
613
+ frequency: 'weekly',
614
+ owner: 'VP Product',
615
+ },
616
+ {
617
+ name: 'Project Completion Rate',
618
+ category: 'operational',
619
+ target: 95,
620
+ current: 91,
621
+ unit: '%',
622
+ frequency: 'monthly',
623
+ owner: 'VP Operations',
624
+ },
625
+ // Trust & Safety
626
+ {
627
+ name: 'Dispute Rate',
628
+ category: 'operational',
629
+ target: 2,
630
+ current: 3.5,
631
+ unit: '%',
632
+ frequency: 'monthly',
633
+ owner: 'VP Operations',
634
+ },
635
+ {
636
+ name: 'Fraud Rate',
637
+ category: 'operational',
638
+ target: 0.1,
639
+ current: 0.15,
640
+ unit: '%',
641
+ frequency: 'monthly',
642
+ owner: 'Trust & Safety Lead',
643
+ },
644
+ ]);
645
+ // =============================================================================
646
+ // 6. OKRs
647
+ // =============================================================================
648
+ export const TalentHubOKRs = okrs([
649
+ {
650
+ objective: 'Build the Most Effective Matching Engine',
651
+ owner: 'VP Product',
652
+ period: 'Q1 2024',
653
+ keyResults: [
654
+ {
655
+ description: 'Achieve 85% match success rate',
656
+ metric: 'Match Success Rate',
657
+ targetValue: 85,
658
+ currentValue: 82,
659
+ unit: '%',
660
+ },
661
+ {
662
+ description: 'Reduce time to match to 48 hours',
663
+ metric: 'Time to Match',
664
+ targetValue: 48,
665
+ currentValue: 72,
666
+ unit: 'hours',
667
+ },
668
+ {
669
+ description: 'Launch AI Matching 2.0',
670
+ metric: 'Features Launched',
671
+ targetValue: 1,
672
+ currentValue: 0,
673
+ },
674
+ ],
675
+ },
676
+ {
677
+ objective: 'Scale Supply with Quality',
678
+ owner: 'VP Talent',
679
+ period: 'Q1 2024',
680
+ keyResults: [
681
+ {
682
+ description: 'Reach 12K vetted developers',
683
+ metric: 'Vetted Developers',
684
+ targetValue: 12000,
685
+ currentValue: 9500,
686
+ },
687
+ {
688
+ description: 'Achieve 70% developer utilization',
689
+ metric: 'Developer Utilization',
690
+ targetValue: 70,
691
+ currentValue: 58,
692
+ unit: '%',
693
+ },
694
+ {
695
+ description: 'Improve developer NPS to 62',
696
+ metric: 'Developer NPS',
697
+ targetValue: 62,
698
+ currentValue: 58,
699
+ },
700
+ ],
701
+ },
702
+ {
703
+ objective: 'Grow Enterprise Segment',
704
+ owner: 'VP Sales',
705
+ period: 'Q1 2024',
706
+ keyResults: [
707
+ {
708
+ description: 'Close 50 new enterprise clients',
709
+ metric: 'Enterprise Clients',
710
+ targetValue: 50,
711
+ currentValue: 28,
712
+ },
713
+ {
714
+ description: 'Increase APS to $22K',
715
+ metric: 'Average Project Size',
716
+ targetValue: 22000,
717
+ currentValue: 18000,
718
+ unit: 'USD',
719
+ },
720
+ {
721
+ description: 'Achieve 82% client retention',
722
+ metric: 'Client Retention',
723
+ targetValue: 82,
724
+ currentValue: 78,
725
+ unit: '%',
726
+ },
727
+ ],
728
+ },
729
+ {
730
+ objective: 'Build Trust & Safety Excellence',
731
+ owner: 'VP Operations',
732
+ period: 'Q1 2024',
733
+ keyResults: [
734
+ {
735
+ description: 'Reduce dispute rate to 2.5%',
736
+ metric: 'Dispute Rate',
737
+ targetValue: 2.5,
738
+ currentValue: 3.5,
739
+ unit: '%',
740
+ },
741
+ {
742
+ description: 'Achieve 95% project completion',
743
+ metric: 'Project Completion',
744
+ targetValue: 95,
745
+ currentValue: 91,
746
+ unit: '%',
747
+ },
748
+ {
749
+ description: 'Reduce fraud rate to 0.1%',
750
+ metric: 'Fraud Rate',
751
+ targetValue: 0.1,
752
+ currentValue: 0.15,
753
+ unit: '%',
754
+ },
755
+ ],
756
+ },
757
+ ]);
758
+ // =============================================================================
759
+ // 7. PROCESSES
760
+ // =============================================================================
761
+ export const DeveloperVettingProcess = Process({
762
+ name: 'Developer Vetting',
763
+ description: 'Comprehensive vetting process for new developers',
764
+ owner: 'VP Talent',
765
+ steps: [
766
+ {
767
+ order: 1,
768
+ name: 'Application',
769
+ description: 'Developer submits application',
770
+ automationLevel: 'automated',
771
+ duration: 'instant',
772
+ },
773
+ {
774
+ order: 2,
775
+ name: 'Initial Screening',
776
+ description: 'AI screens application for basic requirements',
777
+ automationLevel: 'automated',
778
+ duration: '5 minutes',
779
+ },
780
+ {
781
+ order: 3,
782
+ name: 'Skills Assessment',
783
+ description: 'Automated coding assessment',
784
+ automationLevel: 'automated',
785
+ duration: '2 hours',
786
+ },
787
+ {
788
+ order: 4,
789
+ name: 'Technical Interview',
790
+ description: 'Live technical interview with vetter',
791
+ automationLevel: 'manual',
792
+ duration: '1 hour',
793
+ owner: 'Technical Vetter',
794
+ },
795
+ {
796
+ order: 5,
797
+ name: 'Background Check',
798
+ description: 'Identity and background verification',
799
+ automationLevel: 'semi-automated',
800
+ duration: '3 days',
801
+ },
802
+ {
803
+ order: 6,
804
+ name: 'Reference Check',
805
+ description: 'Verify work references',
806
+ automationLevel: 'semi-automated',
807
+ duration: '2 days',
808
+ },
809
+ {
810
+ order: 7,
811
+ name: 'Profile Review',
812
+ description: 'Final review and approval',
813
+ automationLevel: 'manual',
814
+ duration: '1 day',
815
+ owner: 'Vetting Manager',
816
+ },
817
+ {
818
+ order: 8,
819
+ name: 'Onboarding',
820
+ description: 'Developer onboarding and training',
821
+ automationLevel: 'semi-automated',
822
+ duration: '1 day',
823
+ },
824
+ ],
825
+ metrics: [
826
+ { name: 'Time to Vet', target: 7, unit: 'days' },
827
+ { name: 'Acceptance Rate', target: 25, unit: '%' },
828
+ { name: 'Quality Score', target: 85, unit: '%' },
829
+ ],
830
+ });
831
+ export const ProjectMatchingProcess = Process({
832
+ name: 'Project Matching',
833
+ description: 'Match developers to client projects',
834
+ owner: 'VP Product',
835
+ steps: [
836
+ {
837
+ order: 1,
838
+ name: 'Project Intake',
839
+ description: 'Client posts project requirements',
840
+ automationLevel: 'automated',
841
+ duration: 'instant',
842
+ },
843
+ {
844
+ order: 2,
845
+ name: 'Requirement Analysis',
846
+ description: 'AI analyzes and structures requirements',
847
+ automationLevel: 'automated',
848
+ duration: '5 minutes',
849
+ },
850
+ {
851
+ order: 3,
852
+ name: 'AI Matching',
853
+ description: 'AI generates candidate shortlist',
854
+ automationLevel: 'automated',
855
+ duration: '10 minutes',
856
+ },
857
+ {
858
+ order: 4,
859
+ name: 'Availability Check',
860
+ description: 'Verify candidate availability',
861
+ automationLevel: 'automated',
862
+ duration: '1 hour',
863
+ },
864
+ {
865
+ order: 5,
866
+ name: 'Human Review',
867
+ description: 'Matching specialist reviews shortlist',
868
+ automationLevel: 'manual',
869
+ duration: '4 hours',
870
+ owner: 'Matching Specialist',
871
+ },
872
+ {
873
+ order: 6,
874
+ name: 'Client Presentation',
875
+ description: 'Present shortlist to client',
876
+ automationLevel: 'semi-automated',
877
+ duration: '1 day',
878
+ },
879
+ {
880
+ order: 7,
881
+ name: 'Interviews',
882
+ description: 'Client interviews candidates',
883
+ automationLevel: 'manual',
884
+ duration: '3 days',
885
+ },
886
+ {
887
+ order: 8,
888
+ name: 'Selection',
889
+ description: 'Client selects developer',
890
+ automationLevel: 'manual',
891
+ duration: '1 day',
892
+ },
893
+ {
894
+ order: 9,
895
+ name: 'Contract',
896
+ description: 'Generate and sign contract',
897
+ automationLevel: 'semi-automated',
898
+ duration: '1 day',
899
+ },
900
+ ],
901
+ metrics: [
902
+ { name: 'Time to Match', target: 48, unit: 'hours' },
903
+ { name: 'Match Success Rate', target: 90, unit: '%' },
904
+ { name: 'Interviews per Match', target: 3 },
905
+ ],
906
+ });
907
+ export const DisputeResolutionProcess = Process({
908
+ name: 'Dispute Resolution',
909
+ description: 'Resolve disputes between clients and developers',
910
+ owner: 'VP Operations',
911
+ steps: [
912
+ {
913
+ order: 1,
914
+ name: 'Dispute Filed',
915
+ description: 'Party files dispute',
916
+ automationLevel: 'automated',
917
+ duration: 'instant',
918
+ },
919
+ {
920
+ order: 2,
921
+ name: 'Auto-Hold',
922
+ description: 'Hold disputed funds in escrow',
923
+ automationLevel: 'automated',
924
+ duration: 'instant',
925
+ },
926
+ {
927
+ order: 3,
928
+ name: 'Evidence Collection',
929
+ description: 'Both parties submit evidence',
930
+ automationLevel: 'semi-automated',
931
+ duration: '3 days',
932
+ },
933
+ {
934
+ order: 4,
935
+ name: 'AI Analysis',
936
+ description: 'AI analyzes dispute and evidence',
937
+ automationLevel: 'automated',
938
+ duration: '1 hour',
939
+ },
940
+ {
941
+ order: 5,
942
+ name: 'Investigation',
943
+ description: 'Dispute resolver investigates',
944
+ automationLevel: 'manual',
945
+ duration: '2 days',
946
+ owner: 'Dispute Resolver',
947
+ },
948
+ {
949
+ order: 6,
950
+ name: 'Mediation',
951
+ description: 'Attempt to mediate resolution',
952
+ automationLevel: 'manual',
953
+ duration: '2 days',
954
+ owner: 'Dispute Resolver',
955
+ },
956
+ {
957
+ order: 7,
958
+ name: 'Decision',
959
+ description: 'Make binding decision',
960
+ automationLevel: 'manual',
961
+ duration: '1 day',
962
+ owner: 'Dispute Resolver',
963
+ },
964
+ {
965
+ order: 8,
966
+ name: 'Fund Release',
967
+ description: 'Release funds per decision',
968
+ automationLevel: 'semi-automated',
969
+ duration: '1 day',
970
+ },
971
+ ],
972
+ metrics: [
973
+ { name: 'Resolution Time', target: 7, unit: 'days' },
974
+ { name: 'Satisfaction Rate', target: 75, unit: '%' },
975
+ { name: 'Appeal Rate', target: 10, unit: '%' },
976
+ ],
977
+ });
978
+ // =============================================================================
979
+ // 8. WORKFLOWS
980
+ // =============================================================================
981
+ export const MatchingWorkflow = Workflow({
982
+ name: 'AI Matching',
983
+ description: 'Automated matching of developers to projects',
984
+ trigger: { type: 'event', event: 'project.posted' },
985
+ actions: [
986
+ {
987
+ order: 1,
988
+ type: 'compute',
989
+ name: 'Parse Requirements',
990
+ config: {
991
+ extract: ['skills', 'experience', 'availability', 'budget', 'timezone'],
992
+ },
993
+ },
994
+ {
995
+ order: 2,
996
+ type: 'compute',
997
+ name: 'Query Candidates',
998
+ config: {
999
+ filters: ['skills_match', 'available', 'rate_range'],
1000
+ limit: 100,
1001
+ },
1002
+ },
1003
+ {
1004
+ order: 3,
1005
+ type: 'compute',
1006
+ name: 'Score Candidates',
1007
+ config: {
1008
+ factors: ['skill_match', 'experience_match', 'availability', 'rating', 'past_performance'],
1009
+ weights: [0.3, 0.2, 0.15, 0.2, 0.15],
1010
+ },
1011
+ },
1012
+ {
1013
+ order: 4,
1014
+ type: 'compute',
1015
+ name: 'Generate Shortlist',
1016
+ config: {
1017
+ top_n: 10,
1018
+ diversity: true,
1019
+ exclude_recent: true,
1020
+ },
1021
+ },
1022
+ {
1023
+ order: 5,
1024
+ type: 'notification',
1025
+ name: 'Notify Candidates',
1026
+ config: {
1027
+ channel: 'email',
1028
+ template: 'project_opportunity',
1029
+ },
1030
+ },
1031
+ {
1032
+ order: 6,
1033
+ type: 'task',
1034
+ name: 'Queue Human Review',
1035
+ config: {
1036
+ type: 'match-review',
1037
+ assignTo: 'matcher',
1038
+ dueIn: '4 hours',
1039
+ },
1040
+ },
1041
+ ],
1042
+ });
1043
+ export const UtilizationAlertWorkflow = Workflow({
1044
+ name: 'Developer Utilization Alert',
1045
+ description: 'Alert when developer utilization drops',
1046
+ trigger: { type: 'schedule', cron: '0 9 * * 1' }, // Weekly Monday 9am
1047
+ actions: [
1048
+ {
1049
+ order: 1,
1050
+ type: 'compute',
1051
+ name: 'Calculate Utilization',
1052
+ config: {
1053
+ lookback: '30 days',
1054
+ threshold: 40, // % utilization
1055
+ },
1056
+ },
1057
+ {
1058
+ order: 2,
1059
+ type: 'condition',
1060
+ name: 'Check Low Utilization',
1061
+ condition: 'developer.utilization < 40',
1062
+ },
1063
+ {
1064
+ order: 3,
1065
+ type: 'notification',
1066
+ name: 'Alert Talent Success',
1067
+ config: {
1068
+ channel: 'slack',
1069
+ template: 'low_utilization_alert',
1070
+ },
1071
+ },
1072
+ {
1073
+ order: 4,
1074
+ type: 'task',
1075
+ name: 'Create Outreach Task',
1076
+ config: {
1077
+ type: 'developer-outreach',
1078
+ assignTo: 'talent-success',
1079
+ data: ['developer.id', 'utilization', 'last_project'],
1080
+ },
1081
+ },
1082
+ ],
1083
+ });
1084
+ export const PaymentReleaseWorkflow = Workflow({
1085
+ name: 'Milestone Payment Release',
1086
+ description: 'Process milestone completion and payment release',
1087
+ trigger: { type: 'event', event: 'milestone.submitted' },
1088
+ actions: [
1089
+ {
1090
+ order: 1,
1091
+ type: 'notification',
1092
+ name: 'Notify Client',
1093
+ config: {
1094
+ channel: 'email',
1095
+ template: 'milestone_submitted',
1096
+ },
1097
+ },
1098
+ {
1099
+ order: 2,
1100
+ type: 'wait',
1101
+ name: 'Wait for Approval',
1102
+ duration: '5 days',
1103
+ },
1104
+ {
1105
+ order: 3,
1106
+ type: 'condition',
1107
+ name: 'Check Approval',
1108
+ condition: 'milestone.status == "approved" || milestone.autoApprove == true',
1109
+ },
1110
+ {
1111
+ order: 4,
1112
+ type: 'api',
1113
+ name: 'Release Payment',
1114
+ config: {
1115
+ action: 'release_escrow',
1116
+ amount: '${milestone.amount}',
1117
+ to: '${developer.payoutMethod}',
1118
+ },
1119
+ },
1120
+ {
1121
+ order: 5,
1122
+ type: 'notification',
1123
+ name: 'Confirm Payment',
1124
+ config: {
1125
+ channel: 'email',
1126
+ template: 'payment_released',
1127
+ to: ['client', 'developer'],
1128
+ },
1129
+ },
1130
+ {
1131
+ order: 6,
1132
+ type: 'compute',
1133
+ name: 'Update Metrics',
1134
+ config: {
1135
+ update: ['gmv', 'developer_earnings', 'project_progress'],
1136
+ },
1137
+ },
1138
+ ],
1139
+ });
1140
+ // =============================================================================
1141
+ // 9. FINANCIALS
1142
+ // =============================================================================
1143
+ export const TalentHubFinancials = financials({
1144
+ revenue: 10800000, // Net revenue (GMV * take rate)
1145
+ cogs: 2160000, // 20% (payments, vetting, support)
1146
+ operatingExpenses: 7800000,
1147
+ depreciation: 100000,
1148
+ interestExpense: 0,
1149
+ otherIncome: 50000,
1150
+ taxes: 150000,
1151
+ });
1152
+ export const MarketplaceMetrics = {
1153
+ gmv: 60000000, // yearly
1154
+ takeRate: 0.17,
1155
+ netRevenue: 10200000,
1156
+ supply: {
1157
+ totalDevelopers: 15000,
1158
+ vettedDevelopers: 9500,
1159
+ activeDevelopers: 12000,
1160
+ utilization: 58, // %
1161
+ avgHourlyRate: 75,
1162
+ developerNps: 58,
1163
+ },
1164
+ demand: {
1165
+ totalClients: 2500,
1166
+ activeClients: 1800,
1167
+ enterpriseClients: 150,
1168
+ avgProjectSize: 18000,
1169
+ repeatRate: 65, // %
1170
+ clientNps: 52,
1171
+ },
1172
+ matching: {
1173
+ successRate: 82, // %
1174
+ timeToMatch: 72, // hours
1175
+ interviewsPerMatch: 3.5,
1176
+ },
1177
+ trustSafety: {
1178
+ disputeRate: 3.5, // %
1179
+ fraudRate: 0.15, // %
1180
+ completionRate: 91, // %
1181
+ },
1182
+ economics: {
1183
+ cac: 450,
1184
+ ltv: 8500,
1185
+ paybackPeriod: 4, // months
1186
+ },
1187
+ };
1188
+ // =============================================================================
1189
+ // 10. UTILITY FUNCTIONS
1190
+ // =============================================================================
1191
+ export function getBusinessSummary() {
1192
+ return {
1193
+ company: TalentHubBusiness,
1194
+ vision: TalentHubVision,
1195
+ goals: TalentHubGoals,
1196
+ products: { platform: MarketplacePlatform, client: ClientProducts, developer: DeveloperProducts },
1197
+ kpis: TalentHubKPIs,
1198
+ okrs: TalentHubOKRs,
1199
+ financials: TalentHubFinancials,
1200
+ metrics: MarketplaceMetrics,
1201
+ };
1202
+ }
1203
+ export function getMarketplaceHealth() {
1204
+ const liquidity = MarketplaceMetrics.supply.activeDevelopers / MarketplaceMetrics.demand.activeClients;
1205
+ return {
1206
+ gmv: $.format(MarketplaceMetrics.gmv),
1207
+ takeRate: `${(MarketplaceMetrics.takeRate * 100).toFixed(0)}%`,
1208
+ liquidity: liquidity.toFixed(2),
1209
+ supplyUtilization: `${MarketplaceMetrics.supply.utilization}%`,
1210
+ matchSuccessRate: `${MarketplaceMetrics.matching.successRate}%`,
1211
+ };
1212
+ }
1213
+ export function getSupplyDemandBalance() {
1214
+ return {
1215
+ developers: {
1216
+ total: MarketplaceMetrics.supply.totalDevelopers.toLocaleString(),
1217
+ active: MarketplaceMetrics.supply.activeDevelopers.toLocaleString(),
1218
+ utilization: `${MarketplaceMetrics.supply.utilization}%`,
1219
+ },
1220
+ clients: {
1221
+ total: MarketplaceMetrics.demand.totalClients.toLocaleString(),
1222
+ active: MarketplaceMetrics.demand.activeClients.toLocaleString(),
1223
+ repeatRate: `${MarketplaceMetrics.demand.repeatRate}%`,
1224
+ },
1225
+ };
1226
+ }
1227
+ export default {
1228
+ business: TalentHubBusiness,
1229
+ vision: TalentHubVision,
1230
+ goals: TalentHubGoals,
1231
+ products: { platform: MarketplacePlatform, client: ClientProducts, developer: DeveloperProducts },
1232
+ services: Services,
1233
+ organization: TalentHubOrg,
1234
+ kpis: TalentHubKPIs,
1235
+ okrs: TalentHubOKRs,
1236
+ processes: {
1237
+ vetting: DeveloperVettingProcess,
1238
+ matching: ProjectMatchingProcess,
1239
+ dispute: DisputeResolutionProcess,
1240
+ },
1241
+ workflows: {
1242
+ matching: MatchingWorkflow,
1243
+ utilization: UtilizationAlertWorkflow,
1244
+ payment: PaymentReleaseWorkflow,
1245
+ },
1246
+ financials: TalentHubFinancials,
1247
+ metrics: MarketplaceMetrics,
1248
+ };
1249
+ //# sourceMappingURL=index.js.map