@contractspec/module.examples 3.7.1 → 3.7.4

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.
@@ -1,2 +1,2 @@
1
- import type { ExampleSpec } from '@contractspec/lib.contracts-spec/examples/types';
1
+ import type { ExampleSpec } from "@contractspec/lib.contracts-spec/examples/types";
2
2
  export declare const EXAMPLE_REGISTRY: readonly ExampleSpec[];
package/dist/index.js CHANGED
@@ -7,14 +7,17 @@ import AgentConsole from "@contractspec/example.agent-console/example";
7
7
  import AiChatAssistant from "@contractspec/example.ai-chat-assistant/example";
8
8
  import AiSupportBot from "@contractspec/example.ai-support-bot/example";
9
9
  import AnalyticsDashboard from "@contractspec/example.analytics-dashboard/example";
10
+ import CalendarGoogle from "@contractspec/example.calendar-google/example";
10
11
  import ContentGeneration from "@contractspec/example.content-generation/example";
11
12
  import CrmPipeline from "@contractspec/example.crm-pipeline/example";
13
+ import EmailGmail from "@contractspec/example.email-gmail/example";
14
+ import InAppDocs from "@contractspec/example.in-app-docs/example";
12
15
  import IntegrationHub from "@contractspec/example.integration-hub/example";
16
+ import IntegrationPosthog from "@contractspec/example.integration-posthog/example";
13
17
  import IntegrationStripe from "@contractspec/example.integration-stripe/example";
14
- import VoiceProviders from "@contractspec/example.voice-providers/example";
18
+ import IntegrationSupabase from "@contractspec/example.integration-supabase/example";
15
19
  import KbUpdatePipeline from "@contractspec/example.kb-update-pipeline/example";
16
20
  import KnowledgeCanon from "@contractspec/example.knowledge-canon/example";
17
- import LearningPatterns from "@contractspec/example.learning-patterns/example";
18
21
  import LearningJourneyAmbientCoach from "@contractspec/example.learning-journey-ambient-coach/example";
19
22
  import LearningJourneyCrmOnboarding from "@contractspec/example.learning-journey-crm-onboarding/example";
20
23
  import LearningJourneyDuoDrills from "@contractspec/example.learning-journey-duo-drills/example";
@@ -26,17 +29,26 @@ import LearningJourneyUiCoaching from "@contractspec/example.learning-journey-ui
26
29
  import LearningJourneyUiGamified from "@contractspec/example.learning-journey-ui-gamified/example";
27
30
  import LearningJourneyUiOnboarding from "@contractspec/example.learning-journey-ui-onboarding/example";
28
31
  import LearningJourneyUiShared from "@contractspec/example.learning-journey-ui-shared/example";
32
+ import LearningPatterns from "@contractspec/example.learning-patterns/example";
29
33
  import LifecycleCli from "@contractspec/example.lifecycle-cli/example";
30
34
  import LifecycleDashboard from "@contractspec/example.lifecycle-dashboard/example";
31
35
  import LocaleJurisdictionGate from "@contractspec/example.locale-jurisdiction-gate/example";
32
36
  import Marketplace from "@contractspec/example.marketplace/example";
37
+ import MeetingRecorderProviders from "@contractspec/example.meeting-recorder-providers/example";
33
38
  import OpenbankingPowens from "@contractspec/example.openbanking-powens/example";
34
39
  import Personalization from "@contractspec/example.personalization/example";
40
+ import PocketFamilyOffice from "@contractspec/example.pocket-family-office/example";
35
41
  import PolicySafeKnowledgeAssistant from "@contractspec/example.policy-safe-knowledge-assistant/example";
42
+ import ProductIntent from "@contractspec/example.product-intent/example";
43
+ import ProjectManagementSync from "@contractspec/example.project-management-sync/example";
36
44
  import SaasBoilerplate from "@contractspec/example.saas-boilerplate/example";
37
45
  import ServiceBusinessOs from "@contractspec/example.service-business-os/example";
38
46
  import TeamHub from "@contractspec/example.team-hub/example";
39
47
  import VersionedKnowledgeBase from "@contractspec/example.versioned-knowledge-base/example";
48
+ import VideoApiShowcase from "@contractspec/example.video-api-showcase/example";
49
+ import VideoDocsTerminal from "@contractspec/example.video-docs-terminal/example";
50
+ import VideoMarketingClip from "@contractspec/example.video-marketing-clip/example";
51
+ import VoiceProviders from "@contractspec/example.voice-providers/example";
40
52
  import WealthSnapshot from "@contractspec/example.wealth-snapshot/example";
41
53
  import WorkflowSystem from "@contractspec/example.workflow-system/example";
42
54
  var EXAMPLE_REGISTRY = [
@@ -44,14 +56,17 @@ var EXAMPLE_REGISTRY = [
44
56
  AiChatAssistant,
45
57
  AiSupportBot,
46
58
  AnalyticsDashboard,
59
+ CalendarGoogle,
47
60
  ContentGeneration,
48
61
  CrmPipeline,
62
+ EmailGmail,
63
+ InAppDocs,
49
64
  IntegrationHub,
65
+ IntegrationPosthog,
50
66
  IntegrationStripe,
51
- VoiceProviders,
67
+ IntegrationSupabase,
52
68
  KbUpdatePipeline,
53
69
  KnowledgeCanon,
54
- LearningPatterns,
55
70
  LearningJourneyAmbientCoach,
56
71
  LearningJourneyCrmOnboarding,
57
72
  LearningJourneyDuoDrills,
@@ -63,17 +78,26 @@ var EXAMPLE_REGISTRY = [
63
78
  LearningJourneyUiGamified,
64
79
  LearningJourneyUiOnboarding,
65
80
  LearningJourneyUiShared,
81
+ LearningPatterns,
66
82
  LifecycleCli,
67
83
  LifecycleDashboard,
68
84
  LocaleJurisdictionGate,
69
85
  Marketplace,
86
+ MeetingRecorderProviders,
70
87
  OpenbankingPowens,
71
88
  Personalization,
89
+ PocketFamilyOffice,
72
90
  PolicySafeKnowledgeAssistant,
91
+ ProductIntent,
92
+ ProjectManagementSync,
73
93
  SaasBoilerplate,
74
94
  ServiceBusinessOs,
75
95
  TeamHub,
76
96
  VersionedKnowledgeBase,
97
+ VideoApiShowcase,
98
+ VideoDocsTerminal,
99
+ VideoMarketingClip,
100
+ VoiceProviders,
77
101
  WealthSnapshot,
78
102
  WorkflowSystem
79
103
  ];
@@ -6,14 +6,17 @@ import AgentConsole from "@contractspec/example.agent-console/example";
6
6
  import AiChatAssistant from "@contractspec/example.ai-chat-assistant/example";
7
7
  import AiSupportBot from "@contractspec/example.ai-support-bot/example";
8
8
  import AnalyticsDashboard from "@contractspec/example.analytics-dashboard/example";
9
+ import CalendarGoogle from "@contractspec/example.calendar-google/example";
9
10
  import ContentGeneration from "@contractspec/example.content-generation/example";
10
11
  import CrmPipeline from "@contractspec/example.crm-pipeline/example";
12
+ import EmailGmail from "@contractspec/example.email-gmail/example";
13
+ import InAppDocs from "@contractspec/example.in-app-docs/example";
11
14
  import IntegrationHub from "@contractspec/example.integration-hub/example";
15
+ import IntegrationPosthog from "@contractspec/example.integration-posthog/example";
12
16
  import IntegrationStripe from "@contractspec/example.integration-stripe/example";
13
- import VoiceProviders from "@contractspec/example.voice-providers/example";
17
+ import IntegrationSupabase from "@contractspec/example.integration-supabase/example";
14
18
  import KbUpdatePipeline from "@contractspec/example.kb-update-pipeline/example";
15
19
  import KnowledgeCanon from "@contractspec/example.knowledge-canon/example";
16
- import LearningPatterns from "@contractspec/example.learning-patterns/example";
17
20
  import LearningJourneyAmbientCoach from "@contractspec/example.learning-journey-ambient-coach/example";
18
21
  import LearningJourneyCrmOnboarding from "@contractspec/example.learning-journey-crm-onboarding/example";
19
22
  import LearningJourneyDuoDrills from "@contractspec/example.learning-journey-duo-drills/example";
@@ -25,17 +28,26 @@ import LearningJourneyUiCoaching from "@contractspec/example.learning-journey-ui
25
28
  import LearningJourneyUiGamified from "@contractspec/example.learning-journey-ui-gamified/example";
26
29
  import LearningJourneyUiOnboarding from "@contractspec/example.learning-journey-ui-onboarding/example";
27
30
  import LearningJourneyUiShared from "@contractspec/example.learning-journey-ui-shared/example";
31
+ import LearningPatterns from "@contractspec/example.learning-patterns/example";
28
32
  import LifecycleCli from "@contractspec/example.lifecycle-cli/example";
29
33
  import LifecycleDashboard from "@contractspec/example.lifecycle-dashboard/example";
30
34
  import LocaleJurisdictionGate from "@contractspec/example.locale-jurisdiction-gate/example";
31
35
  import Marketplace from "@contractspec/example.marketplace/example";
36
+ import MeetingRecorderProviders from "@contractspec/example.meeting-recorder-providers/example";
32
37
  import OpenbankingPowens from "@contractspec/example.openbanking-powens/example";
33
38
  import Personalization from "@contractspec/example.personalization/example";
39
+ import PocketFamilyOffice from "@contractspec/example.pocket-family-office/example";
34
40
  import PolicySafeKnowledgeAssistant from "@contractspec/example.policy-safe-knowledge-assistant/example";
41
+ import ProductIntent from "@contractspec/example.product-intent/example";
42
+ import ProjectManagementSync from "@contractspec/example.project-management-sync/example";
35
43
  import SaasBoilerplate from "@contractspec/example.saas-boilerplate/example";
36
44
  import ServiceBusinessOs from "@contractspec/example.service-business-os/example";
37
45
  import TeamHub from "@contractspec/example.team-hub/example";
38
46
  import VersionedKnowledgeBase from "@contractspec/example.versioned-knowledge-base/example";
47
+ import VideoApiShowcase from "@contractspec/example.video-api-showcase/example";
48
+ import VideoDocsTerminal from "@contractspec/example.video-docs-terminal/example";
49
+ import VideoMarketingClip from "@contractspec/example.video-marketing-clip/example";
50
+ import VoiceProviders from "@contractspec/example.voice-providers/example";
39
51
  import WealthSnapshot from "@contractspec/example.wealth-snapshot/example";
40
52
  import WorkflowSystem from "@contractspec/example.workflow-system/example";
41
53
  var EXAMPLE_REGISTRY = [
@@ -43,14 +55,17 @@ var EXAMPLE_REGISTRY = [
43
55
  AiChatAssistant,
44
56
  AiSupportBot,
45
57
  AnalyticsDashboard,
58
+ CalendarGoogle,
46
59
  ContentGeneration,
47
60
  CrmPipeline,
61
+ EmailGmail,
62
+ InAppDocs,
48
63
  IntegrationHub,
64
+ IntegrationPosthog,
49
65
  IntegrationStripe,
50
- VoiceProviders,
66
+ IntegrationSupabase,
51
67
  KbUpdatePipeline,
52
68
  KnowledgeCanon,
53
- LearningPatterns,
54
69
  LearningJourneyAmbientCoach,
55
70
  LearningJourneyCrmOnboarding,
56
71
  LearningJourneyDuoDrills,
@@ -62,17 +77,26 @@ var EXAMPLE_REGISTRY = [
62
77
  LearningJourneyUiGamified,
63
78
  LearningJourneyUiOnboarding,
64
79
  LearningJourneyUiShared,
80
+ LearningPatterns,
65
81
  LifecycleCli,
66
82
  LifecycleDashboard,
67
83
  LocaleJurisdictionGate,
68
84
  Marketplace,
85
+ MeetingRecorderProviders,
69
86
  OpenbankingPowens,
70
87
  Personalization,
88
+ PocketFamilyOffice,
71
89
  PolicySafeKnowledgeAssistant,
90
+ ProductIntent,
91
+ ProjectManagementSync,
72
92
  SaasBoilerplate,
73
93
  ServiceBusinessOs,
74
94
  TeamHub,
75
95
  VersionedKnowledgeBase,
96
+ VideoApiShowcase,
97
+ VideoDocsTerminal,
98
+ VideoMarketingClip,
99
+ VoiceProviders,
76
100
  WealthSnapshot,
77
101
  WorkflowSystem
78
102
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/module.examples",
3
- "version": "3.7.1",
3
+ "version": "3.7.4",
4
4
  "description": "Example contract specifications collection",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -27,61 +27,73 @@
27
27
  "lint:fix": "eslint src --fix",
28
28
  "lint:check": "eslint src",
29
29
  "test": "bun test",
30
- "prebuild": "contractspec-bun-build prebuild",
30
+ "generate:registry": "bun ../../../scripts/generate-example-registry.ts --write",
31
+ "prebuild": "bun run generate:registry && contractspec-bun-build prebuild",
31
32
  "typecheck": "tsc --noEmit"
32
33
  },
33
34
  "dependencies": {
34
35
  "@apollo/client": "^4.1.6",
35
- "@contractspec/example.agent-console": "3.7.1",
36
- "@contractspec/example.ai-chat-assistant": "3.7.1",
37
- "@contractspec/example.ai-support-bot": "3.7.1",
38
- "@contractspec/example.analytics-dashboard": "3.7.1",
39
- "@contractspec/example.content-generation": "3.7.1",
40
- "@contractspec/example.crm-pipeline": "3.7.1",
41
- "@contractspec/example.integration-hub": "3.7.1",
42
- "@contractspec/example.integration-stripe": "3.7.1",
43
- "@contractspec/example.voice-providers": "3.7.1",
44
- "@contractspec/example.kb-update-pipeline": "3.7.1",
45
- "@contractspec/example.knowledge-canon": "3.7.1",
46
- "@contractspec/example.learning-journey-ambient-coach": "3.7.1",
47
- "@contractspec/example.learning-journey-crm-onboarding": "3.7.1",
48
- "@contractspec/example.learning-journey-duo-drills": "3.7.1",
49
- "@contractspec/example.learning-journey-platform-tour": "3.7.1",
50
- "@contractspec/example.learning-journey-quest-challenges": "3.7.1",
51
- "@contractspec/example.learning-journey-registry": "3.7.1",
52
- "@contractspec/example.learning-journey-studio-onboarding": "3.7.1",
53
- "@contractspec/example.learning-journey-ui-coaching": "3.7.1",
54
- "@contractspec/example.learning-journey-ui-gamified": "3.7.1",
55
- "@contractspec/example.learning-journey-ui-onboarding": "3.7.1",
56
- "@contractspec/example.learning-journey-ui-shared": "3.7.1",
57
- "@contractspec/example.learning-patterns": "3.7.1",
58
- "@contractspec/example.lifecycle-cli": "3.7.1",
59
- "@contractspec/example.lifecycle-dashboard": "3.7.1",
60
- "@contractspec/example.locale-jurisdiction-gate": "3.7.1",
61
- "@contractspec/example.marketplace": "3.7.1",
62
- "@contractspec/example.openbanking-powens": "3.7.1",
63
- "@contractspec/example.personalization": "3.7.1",
64
- "@contractspec/example.policy-safe-knowledge-assistant": "3.7.1",
65
- "@contractspec/example.saas-boilerplate": "3.7.1",
66
- "@contractspec/example.service-business-os": "3.7.1",
67
- "@contractspec/example.team-hub": "3.7.1",
68
- "@contractspec/example.versioned-knowledge-base": "3.7.1",
69
- "@contractspec/example.wealth-snapshot": "3.7.1",
70
- "@contractspec/example.workflow-system": "3.7.1",
71
- "@contractspec/lib.contracts-spec": "3.7.1",
72
- "@contractspec/lib.example-shared-ui": "6.0.1",
73
- "@contractspec/lib.runtime-sandbox": "2.7.1",
36
+ "@contractspec/example.agent-console": "3.7.4",
37
+ "@contractspec/example.ai-chat-assistant": "3.7.4",
38
+ "@contractspec/example.ai-support-bot": "3.7.4",
39
+ "@contractspec/example.analytics-dashboard": "3.7.4",
40
+ "@contractspec/example.calendar-google": "3.7.4",
41
+ "@contractspec/example.content-generation": "3.7.4",
42
+ "@contractspec/example.crm-pipeline": "3.7.4",
43
+ "@contractspec/example.email-gmail": "3.7.4",
44
+ "@contractspec/example.in-app-docs": "3.7.4",
45
+ "@contractspec/example.integration-hub": "3.7.4",
46
+ "@contractspec/example.integration-posthog": "3.7.4",
47
+ "@contractspec/example.integration-stripe": "3.7.4",
48
+ "@contractspec/example.integration-supabase": "3.7.4",
49
+ "@contractspec/example.voice-providers": "3.7.4",
50
+ "@contractspec/example.kb-update-pipeline": "3.7.4",
51
+ "@contractspec/example.knowledge-canon": "3.7.4",
52
+ "@contractspec/example.learning-journey-ambient-coach": "3.7.4",
53
+ "@contractspec/example.learning-journey-crm-onboarding": "3.7.4",
54
+ "@contractspec/example.learning-journey-duo-drills": "3.7.4",
55
+ "@contractspec/example.learning-journey-platform-tour": "3.7.4",
56
+ "@contractspec/example.learning-journey-quest-challenges": "3.7.4",
57
+ "@contractspec/example.learning-journey-registry": "3.7.4",
58
+ "@contractspec/example.learning-journey-studio-onboarding": "3.7.4",
59
+ "@contractspec/example.learning-journey-ui-coaching": "3.7.4",
60
+ "@contractspec/example.learning-journey-ui-gamified": "3.7.4",
61
+ "@contractspec/example.learning-journey-ui-onboarding": "3.7.4",
62
+ "@contractspec/example.learning-journey-ui-shared": "3.7.4",
63
+ "@contractspec/example.learning-patterns": "3.7.4",
64
+ "@contractspec/example.lifecycle-cli": "3.7.4",
65
+ "@contractspec/example.lifecycle-dashboard": "3.7.4",
66
+ "@contractspec/example.locale-jurisdiction-gate": "3.7.4",
67
+ "@contractspec/example.marketplace": "3.7.4",
68
+ "@contractspec/example.meeting-recorder-providers": "3.7.4",
69
+ "@contractspec/example.openbanking-powens": "3.7.4",
70
+ "@contractspec/example.personalization": "3.7.4",
71
+ "@contractspec/example.pocket-family-office": "3.7.4",
72
+ "@contractspec/example.policy-safe-knowledge-assistant": "3.7.4",
73
+ "@contractspec/example.product-intent": "3.7.4",
74
+ "@contractspec/example.project-management-sync": "3.7.4",
75
+ "@contractspec/example.saas-boilerplate": "3.7.4",
76
+ "@contractspec/example.service-business-os": "3.7.4",
77
+ "@contractspec/example.team-hub": "3.7.4",
78
+ "@contractspec/example.versioned-knowledge-base": "3.7.4",
79
+ "@contractspec/example.video-api-showcase": "3.7.4",
80
+ "@contractspec/example.video-docs-terminal": "3.7.4",
81
+ "@contractspec/example.video-marketing-clip": "3.7.4",
82
+ "@contractspec/example.wealth-snapshot": "3.7.4",
83
+ "@contractspec/example.workflow-system": "3.7.4",
84
+ "@contractspec/lib.contracts-spec": "3.7.4",
85
+ "@contractspec/lib.example-shared-ui": "6.0.4",
86
+ "@contractspec/lib.runtime-sandbox": "2.7.4",
74
87
  "zod": "^4.3.5"
75
88
  },
76
89
  "devDependencies": {
77
- "@contractspec/tool.typescript": "3.7.1",
90
+ "@contractspec/tool.typescript": "3.7.4",
78
91
  "typescript": "^5.9.3",
79
- "@contractspec/tool.bun": "3.7.1"
92
+ "@contractspec/tool.bun": "3.7.4"
80
93
  },
81
94
  "exports": {
82
95
  ".": {
83
96
  "types": "./dist/index.d.ts",
84
- "browser": "./dist/browser/index.js",
85
97
  "bun": "./dist/index.js",
86
98
  "node": "./dist/node/index.js",
87
99
  "default": "./dist/index.js"
@@ -92,7 +104,6 @@
92
104
  "exports": {
93
105
  ".": {
94
106
  "types": "./dist/index.d.ts",
95
- "browser": "./dist/browser/index.js",
96
107
  "bun": "./dist/index.js",
97
108
  "node": "./dist/node/index.js",
98
109
  "default": "./dist/index.js"
@@ -104,7 +115,7 @@
104
115
  "repository": {
105
116
  "type": "git",
106
117
  "url": "https://github.com/lssm-tech/contractspec.git",
107
- "directory": "packages/modules/contractspec-examples"
118
+ "directory": "packages/modules/examples"
108
119
  },
109
120
  "homepage": "https://contractspec.io"
110
121
  }
@@ -1,915 +0,0 @@
1
- // src/registry.ts
2
- import { ExampleRegistry } from "@contractspec/lib.contracts-spec/examples/registry";
3
-
4
- // src/builtins.ts
5
- import AgentConsole from "@contractspec/example.agent-console/example";
6
- import AiChatAssistant from "@contractspec/example.ai-chat-assistant/example";
7
- import AiSupportBot from "@contractspec/example.ai-support-bot/example";
8
- import AnalyticsDashboard from "@contractspec/example.analytics-dashboard/example";
9
- import ContentGeneration from "@contractspec/example.content-generation/example";
10
- import CrmPipeline from "@contractspec/example.crm-pipeline/example";
11
- import IntegrationHub from "@contractspec/example.integration-hub/example";
12
- import IntegrationStripe from "@contractspec/example.integration-stripe/example";
13
- import VoiceProviders from "@contractspec/example.voice-providers/example";
14
- import KbUpdatePipeline from "@contractspec/example.kb-update-pipeline/example";
15
- import KnowledgeCanon from "@contractspec/example.knowledge-canon/example";
16
- import LearningPatterns from "@contractspec/example.learning-patterns/example";
17
- import LearningJourneyAmbientCoach from "@contractspec/example.learning-journey-ambient-coach/example";
18
- import LearningJourneyCrmOnboarding from "@contractspec/example.learning-journey-crm-onboarding/example";
19
- import LearningJourneyDuoDrills from "@contractspec/example.learning-journey-duo-drills/example";
20
- import LearningJourneyPlatformTour from "@contractspec/example.learning-journey-platform-tour/example";
21
- import LearningJourneyQuestChallenges from "@contractspec/example.learning-journey-quest-challenges/example";
22
- import LearningJourneyRegistry from "@contractspec/example.learning-journey-registry/example";
23
- import LearningJourneyStudioOnboarding from "@contractspec/example.learning-journey-studio-onboarding/example";
24
- import LearningJourneyUiCoaching from "@contractspec/example.learning-journey-ui-coaching/example";
25
- import LearningJourneyUiGamified from "@contractspec/example.learning-journey-ui-gamified/example";
26
- import LearningJourneyUiOnboarding from "@contractspec/example.learning-journey-ui-onboarding/example";
27
- import LearningJourneyUiShared from "@contractspec/example.learning-journey-ui-shared/example";
28
- import LifecycleCli from "@contractspec/example.lifecycle-cli/example";
29
- import LifecycleDashboard from "@contractspec/example.lifecycle-dashboard/example";
30
- import LocaleJurisdictionGate from "@contractspec/example.locale-jurisdiction-gate/example";
31
- import Marketplace from "@contractspec/example.marketplace/example";
32
- import OpenbankingPowens from "@contractspec/example.openbanking-powens/example";
33
- import Personalization from "@contractspec/example.personalization/example";
34
- import PolicySafeKnowledgeAssistant from "@contractspec/example.policy-safe-knowledge-assistant/example";
35
- import SaasBoilerplate from "@contractspec/example.saas-boilerplate/example";
36
- import ServiceBusinessOs from "@contractspec/example.service-business-os/example";
37
- import TeamHub from "@contractspec/example.team-hub/example";
38
- import VersionedKnowledgeBase from "@contractspec/example.versioned-knowledge-base/example";
39
- import WealthSnapshot from "@contractspec/example.wealth-snapshot/example";
40
- import WorkflowSystem from "@contractspec/example.workflow-system/example";
41
- var EXAMPLE_REGISTRY = [
42
- AgentConsole,
43
- AiChatAssistant,
44
- AiSupportBot,
45
- AnalyticsDashboard,
46
- ContentGeneration,
47
- CrmPipeline,
48
- IntegrationHub,
49
- IntegrationStripe,
50
- VoiceProviders,
51
- KbUpdatePipeline,
52
- KnowledgeCanon,
53
- LearningPatterns,
54
- LearningJourneyAmbientCoach,
55
- LearningJourneyCrmOnboarding,
56
- LearningJourneyDuoDrills,
57
- LearningJourneyPlatformTour,
58
- LearningJourneyQuestChallenges,
59
- LearningJourneyRegistry,
60
- LearningJourneyStudioOnboarding,
61
- LearningJourneyUiCoaching,
62
- LearningJourneyUiGamified,
63
- LearningJourneyUiOnboarding,
64
- LearningJourneyUiShared,
65
- LifecycleCli,
66
- LifecycleDashboard,
67
- LocaleJurisdictionGate,
68
- Marketplace,
69
- OpenbankingPowens,
70
- Personalization,
71
- PolicySafeKnowledgeAssistant,
72
- SaasBoilerplate,
73
- ServiceBusinessOs,
74
- TeamHub,
75
- VersionedKnowledgeBase,
76
- WealthSnapshot,
77
- WorkflowSystem
78
- ];
79
-
80
- // src/registry.ts
81
- import { ExampleRegistry as ExampleRegistry2 } from "@contractspec/lib.contracts-spec/examples/registry";
82
- var globalRegistry = new ExampleRegistry;
83
- for (const example of EXAMPLE_REGISTRY) {
84
- globalRegistry.register(example);
85
- }
86
- var EXAMPLE_REGISTRY2 = globalRegistry.list();
87
- function listExamples() {
88
- return globalRegistry.list();
89
- }
90
- function getExample(key) {
91
- return globalRegistry.get(key);
92
- }
93
- function searchExamples(query) {
94
- return globalRegistry.search(query);
95
- }
96
- // src/runtime/engine.ts
97
- import {
98
- createDefaultTransformEngine,
99
- registerBasicValidation,
100
- registerDefaultReactRenderer
101
- } from "@contractspec/lib.contracts-spec/presentations/transform-engine";
102
- import {
103
- agentDashboardMarkdownRenderer,
104
- agentListMarkdownRenderer,
105
- agentListReactRenderer,
106
- runListMarkdownRenderer,
107
- toolRegistryMarkdownRenderer
108
- } from "@contractspec/example.agent-console";
109
- import {
110
- projectListMarkdownRenderer,
111
- projectListReactRenderer,
112
- saasBillingMarkdownRenderer,
113
- saasDashboardMarkdownRenderer
114
- } from "@contractspec/example.saas-boilerplate";
115
- import {
116
- crmDashboardMarkdownRenderer,
117
- crmPipelineMarkdownRenderer,
118
- crmPipelineReactRenderer
119
- } from "@contractspec/example.crm-pipeline";
120
- import {
121
- workflowDashboardMarkdownRenderer,
122
- workflowDefinitionListMarkdownRenderer,
123
- workflowInstanceDetailMarkdownRenderer
124
- } from "@contractspec/example.workflow-system";
125
- import {
126
- marketplaceDashboardMarkdownRenderer,
127
- orderListMarkdownRenderer,
128
- productCatalogMarkdownRenderer
129
- } from "@contractspec/example.marketplace";
130
- import {
131
- connectionListMarkdownRenderer,
132
- integrationDashboardMarkdownRenderer,
133
- syncConfigMarkdownRenderer
134
- } from "@contractspec/example.integration-hub";
135
- import {
136
- analyticsDashboardMarkdownRenderer,
137
- dashboardListMarkdownRenderer,
138
- queryBuilderMarkdownRenderer
139
- } from "@contractspec/example.analytics-dashboard";
140
- function createTemplateTransformEngine() {
141
- const engine = createDefaultTransformEngine();
142
- registerDefaultReactRenderer(engine);
143
- registerBasicValidation(engine);
144
- registerTemplateRenderers(engine);
145
- return engine;
146
- }
147
- function registerTemplateRenderers(engine) {
148
- engine.register(agentListReactRenderer);
149
- engine.register(agentListMarkdownRenderer);
150
- engine.register(runListMarkdownRenderer);
151
- engine.register(toolRegistryMarkdownRenderer);
152
- engine.register(agentDashboardMarkdownRenderer);
153
- engine.register(projectListReactRenderer);
154
- engine.register(projectListMarkdownRenderer);
155
- engine.register(saasDashboardMarkdownRenderer);
156
- engine.register(saasBillingMarkdownRenderer);
157
- engine.register(crmPipelineReactRenderer);
158
- engine.register(crmPipelineMarkdownRenderer);
159
- engine.register(crmDashboardMarkdownRenderer);
160
- engine.register(workflowDashboardMarkdownRenderer);
161
- engine.register(workflowDefinitionListMarkdownRenderer);
162
- engine.register(workflowInstanceDetailMarkdownRenderer);
163
- engine.register(marketplaceDashboardMarkdownRenderer);
164
- engine.register(productCatalogMarkdownRenderer);
165
- engine.register(orderListMarkdownRenderer);
166
- engine.register(integrationDashboardMarkdownRenderer);
167
- engine.register(connectionListMarkdownRenderer);
168
- engine.register(syncConfigMarkdownRenderer);
169
- engine.register(analyticsDashboardMarkdownRenderer);
170
- engine.register(dashboardListMarkdownRenderer);
171
- engine.register(queryBuilderMarkdownRenderer);
172
- }
173
- var templateEngine = null;
174
- function getTemplateEngine() {
175
- if (!templateEngine) {
176
- templateEngine = createTemplateTransformEngine();
177
- }
178
- return templateEngine;
179
- }
180
- function resetTemplateEngine() {
181
- templateEngine = null;
182
- }
183
- // src/runtime/registry.ts
184
- var PRESENTATIONS_BY_TEMPLATE = {
185
- "saas-boilerplate": [
186
- "saas-boilerplate.dashboard",
187
- "saas-boilerplate.project.list",
188
- "saas-boilerplate.billing.settings"
189
- ],
190
- "crm-pipeline": ["crm-pipeline.dashboard", "crm-pipeline.deal.pipeline"],
191
- "agent-console": [
192
- "agent-console.dashboard",
193
- "agent-console.agent.list",
194
- "agent-console.run.list",
195
- "agent-console.tool.registry"
196
- ],
197
- "workflow-system": [
198
- "workflow-system.dashboard",
199
- "workflow-system.definition.list",
200
- "workflow-system.instance.detail"
201
- ],
202
- marketplace: [
203
- "marketplace.dashboard",
204
- "marketplace.product.catalog",
205
- "marketplace.order.list",
206
- "marketplace.store.manage"
207
- ],
208
- "integration-hub": [
209
- "integration-hub.dashboard",
210
- "integration-hub.connection.list",
211
- "integration-hub.sync.config"
212
- ],
213
- "analytics-dashboard": [
214
- "analytics-dashboard.dashboard",
215
- "analytics-dashboard.list",
216
- "analytics-dashboard.query.builder"
217
- ],
218
- "learning-journey-studio-onboarding": [
219
- "learning.journey.track_list",
220
- "learning.journey.track_detail",
221
- "learning.journey.progress_widget"
222
- ],
223
- "learning-journey-platform-tour": [
224
- "learning.journey.track_list",
225
- "learning.journey.track_detail",
226
- "learning.journey.progress_widget"
227
- ],
228
- "learning-journey-crm-onboarding": [
229
- "learning.journey.track_list",
230
- "learning.journey.track_detail",
231
- "learning.journey.progress_widget"
232
- ],
233
- "learning-journey-duo-drills": [
234
- "learning.journey.track_list",
235
- "learning.journey.track_detail",
236
- "learning.journey.progress_widget"
237
- ],
238
- "learning-journey-ambient-coach": [
239
- "learning.journey.track_list",
240
- "learning.journey.track_detail",
241
- "learning.journey.progress_widget"
242
- ],
243
- "learning-journey-quest-challenges": [
244
- "learning.journey.track_list",
245
- "learning.journey.track_detail",
246
- "learning.journey.progress_widget"
247
- ]
248
- };
249
- var TEMPLATE_REGISTRY = [
250
- {
251
- id: "todos-app",
252
- name: "To-dos List App",
253
- description: "CRUD flows, filtering, priorities, and ceremonies for handing off work across crews.",
254
- category: "productivity",
255
- complexity: "beginner",
256
- icon: "✅",
257
- features: ["CRUD tasks", "Filters", "Categories", "Search", "Priorities"],
258
- tags: ["tasks", "ops", "starter"],
259
- schema: {
260
- models: ["Task", "TaskCategory"],
261
- contracts: ["template.todos.crud"]
262
- },
263
- components: {
264
- list: "TaskList",
265
- detail: "TaskDetailPanel",
266
- form: "TaskForm"
267
- },
268
- preview: {
269
- demoUrl: "/sandbox?template=todos-app"
270
- },
271
- docs: {
272
- quickstart: "/docs/templates/todos-app"
273
- }
274
- },
275
- {
276
- id: "messaging-app",
277
- name: "Messaging Application",
278
- description: "Conversation roster, optimistic sending, typing indicators, and delivery telemetry.",
279
- category: "communication",
280
- complexity: "intermediate",
281
- icon: "\uD83D\uDCAC",
282
- features: [
283
- "Conversations",
284
- "Real-time feed",
285
- "Typing indicators",
286
- "Read receipts"
287
- ],
288
- tags: ["messaging", "realtime", "ws"],
289
- schema: {
290
- models: ["Conversation", "ConversationParticipant", "Message"],
291
- contracts: ["template.messaging.core"]
292
- },
293
- components: {
294
- list: "ConversationList",
295
- detail: "MessageThread",
296
- form: "MessageComposer"
297
- },
298
- preview: {
299
- demoUrl: "/sandbox?template=messaging-app"
300
- },
301
- docs: {
302
- quickstart: "/docs/templates/messaging-app"
303
- }
304
- },
305
- {
306
- id: "recipe-app-i18n",
307
- name: "Recipe App (i18n)",
308
- description: "Localized browsing experience with bilingual content, categories, and favorites.",
309
- category: "content",
310
- complexity: "intermediate",
311
- icon: "\uD83C\uDF72",
312
- features: ["i18n", "Favorites", "Categories", "Search", "RTL-ready"],
313
- tags: ["content", "i18n", "localization"],
314
- schema: {
315
- models: [
316
- "RecipeCategory",
317
- "Recipe",
318
- "RecipeIngredient",
319
- "RecipeInstruction"
320
- ],
321
- contracts: ["template.recipes.browse"]
322
- },
323
- components: {
324
- list: "RecipeList",
325
- detail: "RecipeDetail",
326
- form: "RecipeForm"
327
- },
328
- preview: {
329
- demoUrl: "/sandbox?template=recipe-app-i18n"
330
- },
331
- docs: {
332
- quickstart: "/docs/templates/recipe-app-i18n"
333
- }
334
- },
335
- ...listExamples().map((example) => {
336
- const tags = example.meta.keywords ?? [];
337
- const category = tags.some((t) => t.toLowerCase() === "ai") || tags.some((t) => t.toLowerCase() === "assistant") ? "ai" : "business";
338
- const complexity = "beginner";
339
- const icon = "\uD83D\uDCE6";
340
- return {
341
- id: example.meta.key,
342
- name: example.meta.title ?? example.meta.key,
343
- description: example.meta.description ?? "",
344
- category,
345
- complexity,
346
- icon,
347
- features: [],
348
- tags: [...tags],
349
- schema: { models: [], contracts: [] },
350
- components: { list: "ExampleList", detail: "ExampleDetail" },
351
- preview: {
352
- demoUrl: `/sandbox?template=${encodeURIComponent(example.meta.key)}`
353
- },
354
- package: example.entrypoints.packageName,
355
- presentations: PRESENTATIONS_BY_TEMPLATE[example.meta.key] ?? [],
356
- renderTargets: ["react", "markdown"]
357
- };
358
- })
359
- ];
360
- function listTemplates(filter) {
361
- if (!filter)
362
- return TEMPLATE_REGISTRY;
363
- return TEMPLATE_REGISTRY.filter((template) => {
364
- if (filter.category && template.category !== filter.category) {
365
- return false;
366
- }
367
- if (filter.complexity && template.complexity !== filter.complexity) {
368
- return false;
369
- }
370
- if (filter.tag && !template.tags.some((tag) => tag.toLowerCase() === filter.tag?.toLowerCase())) {
371
- return false;
372
- }
373
- return true;
374
- });
375
- }
376
- function getTemplate(id) {
377
- return TEMPLATE_REGISTRY.find((template) => template.id === id);
378
- }
379
- function getTemplatesByModule(modulePackage) {
380
- return TEMPLATE_REGISTRY.filter((template) => template.usesModules?.includes(modulePackage));
381
- }
382
- function getClonableTemplates() {
383
- return TEMPLATE_REGISTRY.filter((template) => !!template.package);
384
- }
385
-
386
- // src/runtime/registry-client.ts
387
- class ContractSpecRegistryClient {
388
- baseUrl;
389
- fetchImpl;
390
- constructor(options) {
391
- this.baseUrl = options.registryUrl.replace(/\/+$/, "");
392
- this.fetchImpl = options.fetchImpl ?? fetch;
393
- }
394
- async getManifest() {
395
- const res = await this.fetchImpl(`${this.baseUrl}/r/contractspec.json`, {
396
- method: "GET",
397
- headers: { Accept: "application/json" }
398
- });
399
- if (!res.ok) {
400
- throw new Error(`Registry manifest fetch failed: ${res.status} ${res.statusText}`);
401
- }
402
- return await res.json();
403
- }
404
- async listByType(type) {
405
- const manifest = await this.getManifest();
406
- return manifest.items.filter((i) => i.type === type);
407
- }
408
- async listTemplateSummaries() {
409
- const templates = await this.listByType("contractspec:template");
410
- return templates.map((t) => ({
411
- id: t.key,
412
- title: t.title,
413
- description: t.description,
414
- version: t.version,
415
- tags: t.meta.tags,
416
- source: "registry"
417
- }));
418
- }
419
- async getItem(typeSegment, name) {
420
- const res = await this.fetchImpl(`${this.baseUrl}/r/contractspec/${typeSegment}/${name}.json`, {
421
- method: "GET",
422
- headers: { Accept: "application/json" }
423
- });
424
- if (!res.ok) {
425
- throw new Error(`Registry item fetch failed: ${res.status} ${res.statusText}`);
426
- }
427
- return await res.json();
428
- }
429
- }
430
-
431
- // src/runtime/installer.ts
432
- import { web } from "@contractspec/lib.runtime-sandbox";
433
- "use client";
434
- var { LocalRuntimeServices } = web;
435
- var SAVE_TEMPLATE_MUTATION = `
436
- mutation SaveTemplateToStudio($input: SaveTemplateInput!) {
437
- saveTemplateToStudio(input: $input) {
438
- projectId
439
- status
440
- }
441
- }
442
- `;
443
-
444
- class TemplateInstaller {
445
- runtime;
446
- endpoint;
447
- registryUrl;
448
- fetchImpl;
449
- constructor(options = {}) {
450
- this.runtime = options.runtime ?? new LocalRuntimeServices;
451
- this.endpoint = options.endpoint ?? "/api/graphql";
452
- this.registryUrl = options.registryUrl ? options.registryUrl.replace(/\/+$/, "") : null;
453
- this.fetchImpl = options.fetchImpl ?? fetch;
454
- }
455
- async init() {
456
- await this.runtime.init();
457
- }
458
- list(filter) {
459
- return filter ? TEMPLATE_REGISTRY.filter((template) => {
460
- if (filter.category && filter.category !== template.category) {
461
- return false;
462
- }
463
- if (filter.complexity && filter.complexity !== template.complexity) {
464
- return false;
465
- }
466
- if (filter.tag && !template.tags.includes(filter.tag)) {
467
- return false;
468
- }
469
- return true;
470
- }) : TEMPLATE_REGISTRY;
471
- }
472
- async listRemoteTemplates() {
473
- if (!this.registryUrl)
474
- return [];
475
- const client = new ContractSpecRegistryClient({
476
- registryUrl: this.registryUrl,
477
- fetchImpl: this.fetchImpl
478
- });
479
- return await client.listTemplateSummaries();
480
- }
481
- resolveLocalTemplateId(id) {
482
- const found = getTemplate(id);
483
- return found ? id : null;
484
- }
485
- get(templateId) {
486
- return getTemplate(templateId);
487
- }
488
- async install(templateId, options = {}) {
489
- await this.runtime.seedTemplate({
490
- templateId,
491
- projectId: options.projectId
492
- });
493
- }
494
- async saveToStudio(options) {
495
- const snapshot = await this.runtime.db.export();
496
- const payload = toBase64(snapshot);
497
- const response = await this.fetchImpl(options.endpoint ?? this.endpoint, {
498
- method: "POST",
499
- headers: {
500
- "Content-Type": "application/json",
501
- ...options.token ? { Authorization: `Bearer ${options.token}` } : {}
502
- },
503
- body: JSON.stringify({
504
- query: SAVE_TEMPLATE_MUTATION,
505
- variables: {
506
- input: {
507
- templateId: options.templateId,
508
- projectName: options.projectName,
509
- organizationId: options.organizationId,
510
- payload
511
- }
512
- }
513
- })
514
- });
515
- if (!response.ok) {
516
- throw new Error(`Failed to save template: ${response.status} ${response.statusText}`);
517
- }
518
- const json = await response.json();
519
- if (json.errors?.length) {
520
- throw new Error(json.errors[0]?.message ?? "Unknown error");
521
- }
522
- if (!json.data?.saveTemplateToStudio) {
523
- throw new Error("Invalid response from Studio API");
524
- }
525
- return json.data.saveTemplateToStudio;
526
- }
527
- }
528
- function toBase64(bytes) {
529
- if (typeof Buffer !== "undefined") {
530
- return Buffer.from(bytes).toString("base64");
531
- }
532
- let binary = "";
533
- bytes.forEach((value) => {
534
- binary += String.fromCharCode(value);
535
- });
536
- return btoa(binary);
537
- }
538
- // src/runtime/context.tsx
539
- import { useEffect, useMemo, useState } from "react";
540
- import { ApolloProvider } from "@apollo/client/react";
541
- import { web as web2 } from "@contractspec/lib.runtime-sandbox";
542
- import {
543
- createCrmHandlers
544
- } from "@contractspec/example.crm-pipeline";
545
- import {
546
- createSaasHandlers
547
- } from "@contractspec/example.saas-boilerplate";
548
- import {
549
- createAgentHandlers
550
- } from "@contractspec/example.agent-console";
551
- import {
552
- createWorkflowHandlers
553
- } from "@contractspec/example.workflow-system";
554
- import {
555
- createMarketplaceHandlers
556
- } from "@contractspec/example.marketplace";
557
- import {
558
- createIntegrationHandlers
559
- } from "@contractspec/example.integration-hub";
560
- import {
561
- createAnalyticsHandlers
562
- } from "@contractspec/example.analytics-dashboard";
563
- import {
564
- createPolicySafeKnowledgeAssistantHandlers
565
- } from "@contractspec/example.policy-safe-knowledge-assistant";
566
- import {
567
- TemplateRuntimeContext,
568
- useTemplateRuntime,
569
- useTemplateComponents
570
- } from "@contractspec/lib.example-shared-ui";
571
- import { jsxDEV } from "react/jsx-dev-runtime";
572
- "use client";
573
- var { LocalRuntimeServices: LocalRuntimeServices2 } = web2;
574
- function logBootstrapFailure(error) {
575
- console.error(`
576
- [TemplateRuntime] Bootstrap Failed
577
- ==================================
578
-
579
- The runtime failed to initialize. This usually happens because:
580
- 1. The PostgreSQL Web environment (pglite) failed to load
581
- 2. The schema migration failed
582
- 3. The initial seed data could not be inserted
583
-
584
- Check the console for specific database errors.
585
- `.trim(), error);
586
- }
587
-
588
- class TemplateHandlers {
589
- crm;
590
- saas;
591
- agent;
592
- workflow;
593
- marketplace;
594
- integration;
595
- analytics;
596
- policySafeKnowledgeAssistant;
597
- }
598
- function TemplateRuntimeProvider({
599
- templateId,
600
- projectId = "default-project",
601
- lazy = false,
602
- children
603
- }) {
604
- const [context, setContext] = useState(null);
605
- const [error, setError] = useState(null);
606
- useEffect(() => {
607
- let mounted = true;
608
- async function bootstrap() {
609
- try {
610
- if (lazy)
611
- return;
612
- const template = getTemplate(templateId);
613
- if (!template) {
614
- throw new Error(`Template not found: ${templateId}`);
615
- }
616
- const runtime = new LocalRuntimeServices2;
617
- await runtime.init({});
618
- const installer = new TemplateInstaller({ runtime });
619
- await installer.install(templateId, { projectId });
620
- const client = web2.createLocalGraphqlClient(runtime);
621
- const engine = await getTemplateEngine();
622
- const handlers = new TemplateHandlers;
623
- handlers.crm = createCrmHandlers(runtime.db);
624
- handlers.saas = createSaasHandlers(runtime.db);
625
- handlers.agent = createAgentHandlers(runtime.db);
626
- handlers.workflow = createWorkflowHandlers(runtime.db);
627
- handlers.marketplace = createMarketplaceHandlers(runtime.db);
628
- handlers.integration = createIntegrationHandlers(runtime.db);
629
- handlers.analytics = createAnalyticsHandlers(runtime.db);
630
- handlers.policySafeKnowledgeAssistant = createPolicySafeKnowledgeAssistantHandlers(runtime.db);
631
- const fetchData = async (presentationName) => {
632
- if (presentationName === "crm-pipeline.dashboard") {
633
- const [dealsResult, stages] = await Promise.all([
634
- handlers.crm.listDeals({
635
- projectId,
636
- pipelineId: "pipeline-1",
637
- limit: 50
638
- }),
639
- handlers.crm.getPipelineStages({ pipelineId: "pipeline-1" })
640
- ]);
641
- return {
642
- data: {
643
- deals: dealsResult.deals,
644
- stages,
645
- summary: {
646
- total: dealsResult.total,
647
- totalValue: dealsResult.totalValue
648
- }
649
- },
650
- metadata: {
651
- total: dealsResult.total,
652
- timestamp: new Date,
653
- source: "crm-pipeline"
654
- }
655
- };
656
- }
657
- if (presentationName === "crm-pipeline.deal.pipeline") {
658
- const [dealsResult, stages] = await Promise.all([
659
- handlers.crm.listDeals({
660
- projectId,
661
- pipelineId: "pipeline-1",
662
- limit: 100
663
- }),
664
- handlers.crm.getPipelineStages({ pipelineId: "pipeline-1" })
665
- ]);
666
- return {
667
- data: {
668
- deals: dealsResult.deals,
669
- stages,
670
- total: dealsResult.total,
671
- totalValue: dealsResult.totalValue
672
- },
673
- metadata: {
674
- total: dealsResult.total,
675
- timestamp: new Date,
676
- source: "crm-pipeline"
677
- }
678
- };
679
- }
680
- if (presentationName === "saas-boilerplate.dashboard") {
681
- const [projectsResult, subscription] = await Promise.all([
682
- handlers.saas.listProjects({ projectId, limit: 10 }),
683
- handlers.saas.getSubscription({ projectId })
684
- ]);
685
- return {
686
- data: {
687
- projects: projectsResult.items,
688
- subscription,
689
- summary: { totalProjects: projectsResult.total }
690
- },
691
- metadata: {
692
- total: projectsResult.total,
693
- timestamp: new Date,
694
- source: "saas-boilerplate"
695
- }
696
- };
697
- }
698
- if (presentationName === "saas-boilerplate.project.list") {
699
- const result = await handlers.saas.listProjects({
700
- projectId,
701
- limit: 50
702
- });
703
- return {
704
- data: result.items,
705
- metadata: {
706
- total: result.total,
707
- timestamp: new Date,
708
- source: "saas-boilerplate"
709
- }
710
- };
711
- }
712
- if (presentationName === "saas-boilerplate.billing.settings") {
713
- const subscription = await handlers.saas.getSubscription({
714
- projectId
715
- });
716
- return {
717
- data: subscription,
718
- metadata: { timestamp: new Date, source: "saas-boilerplate" }
719
- };
720
- }
721
- if (presentationName === "agent-console.dashboard") {
722
- const [agentsResult, runsResult, toolsResult] = await Promise.all([
723
- handlers.agent.listAgents({
724
- projectId,
725
- organizationId: "demo-org",
726
- limit: 10
727
- }),
728
- handlers.agent.listRuns({ projectId, limit: 10 }),
729
- handlers.agent.listTools({
730
- projectId,
731
- organizationId: "demo-org",
732
- limit: 10
733
- })
734
- ]);
735
- return {
736
- data: {
737
- agents: agentsResult.items,
738
- runs: runsResult.items,
739
- tools: toolsResult.items,
740
- summary: {
741
- totalAgents: agentsResult.total,
742
- totalRuns: runsResult.total,
743
- totalTools: toolsResult.total
744
- }
745
- },
746
- metadata: { timestamp: new Date, source: "agent-console" }
747
- };
748
- }
749
- if (presentationName === "agent-console.agent.list") {
750
- const result = await handlers.agent.listAgents({
751
- projectId,
752
- organizationId: "demo-org",
753
- limit: 50
754
- });
755
- return {
756
- data: result.items,
757
- metadata: {
758
- total: result.total,
759
- timestamp: new Date,
760
- source: "agent-console"
761
- }
762
- };
763
- }
764
- if (presentationName === "agent-console.run.list") {
765
- const result = await handlers.agent.listRuns({
766
- projectId,
767
- limit: 50
768
- });
769
- return {
770
- data: result.items,
771
- metadata: {
772
- total: result.total,
773
- timestamp: new Date,
774
- source: "agent-console"
775
- }
776
- };
777
- }
778
- if (presentationName === "agent-console.tool.registry") {
779
- const result = await handlers.agent.listTools({
780
- projectId,
781
- organizationId: "demo-org",
782
- limit: 50
783
- });
784
- return {
785
- data: result.items,
786
- metadata: {
787
- total: result.total,
788
- timestamp: new Date,
789
- source: "agent-console"
790
- }
791
- };
792
- }
793
- console.warn(`No data fetcher found for presentation: ${presentationName}`);
794
- return {
795
- data: null,
796
- metadata: { timestamp: new Date, source: "unknown" }
797
- };
798
- };
799
- if (mounted) {
800
- setContext({
801
- template,
802
- runtime,
803
- installer,
804
- client,
805
- templateId,
806
- projectId,
807
- engine,
808
- handlers,
809
- fetchData
810
- });
811
- }
812
- } catch (err) {
813
- logBootstrapFailure(err);
814
- if (mounted) {
815
- setError(err instanceof Error ? err : new Error("Unknown runtime error"));
816
- }
817
- }
818
- }
819
- bootstrap();
820
- return () => {
821
- mounted = false;
822
- };
823
- }, [templateId, projectId, lazy]);
824
- const components = useTemplateComponents(templateId);
825
- const contextValue = useMemo(() => {
826
- if (!context)
827
- return null;
828
- return {
829
- ...context,
830
- components
831
- };
832
- }, [context, components]);
833
- if (error) {
834
- return /* @__PURE__ */ jsxDEV("div", {
835
- className: "rounded border border-red-200 bg-red-50 p-4 text-red-500",
836
- children: [
837
- /* @__PURE__ */ jsxDEV("h3", {
838
- className: "font-bold",
839
- children: "Runtime Error"
840
- }, undefined, false, undefined, this),
841
- /* @__PURE__ */ jsxDEV("pre", {
842
- className: "mt-2 overflow-auto text-xs",
843
- children: error.message
844
- }, undefined, false, undefined, this)
845
- ]
846
- }, undefined, true, undefined, this);
847
- }
848
- if (!contextValue) {
849
- return /* @__PURE__ */ jsxDEV("div", {
850
- className: "animate-pulse p-12 text-center text-gray-400",
851
- children: "Initializing runtime environment..."
852
- }, undefined, false, undefined, this);
853
- }
854
- return /* @__PURE__ */ jsxDEV(ApolloProvider, {
855
- client: contextValue.client,
856
- children: /* @__PURE__ */ jsxDEV(TemplateRuntimeContext.Provider, {
857
- value: contextValue,
858
- children
859
- }, undefined, false, undefined, this)
860
- }, undefined, false, undefined, this);
861
- }
862
- function useTemplateEngine() {
863
- return useTemplateRuntime().engine;
864
- }
865
- function useTemplateHandlers() {
866
- return useTemplateRuntime().handlers;
867
- }
868
- function useCrmHandlers() {
869
- return useTemplateHandlers().crm;
870
- }
871
- function useSaasHandlers() {
872
- return useTemplateHandlers().saas;
873
- }
874
- function useAgentHandlers() {
875
- return useTemplateHandlers().agent;
876
- }
877
- function useWorkflowHandlers() {
878
- return useTemplateHandlers().workflow;
879
- }
880
- function useMarketplaceHandlers() {
881
- return useTemplateHandlers().marketplace;
882
- }
883
- function useIntegrationHandlers() {
884
- return useTemplateHandlers().integration;
885
- }
886
- function useAnalyticsHandlers() {
887
- return useTemplateHandlers().analytics;
888
- }
889
- export {
890
- useWorkflowHandlers,
891
- useTemplateHandlers,
892
- useTemplateEngine,
893
- useSaasHandlers,
894
- useMarketplaceHandlers,
895
- useIntegrationHandlers,
896
- useCrmHandlers,
897
- useAnalyticsHandlers,
898
- useAgentHandlers,
899
- searchExamples,
900
- resetTemplateEngine,
901
- listTemplates,
902
- listExamples,
903
- getTemplatesByModule,
904
- getTemplateEngine,
905
- getTemplate,
906
- getExample,
907
- getClonableTemplates,
908
- createTemplateTransformEngine,
909
- TemplateRuntimeProvider,
910
- TemplateInstaller,
911
- TemplateHandlers,
912
- TEMPLATE_REGISTRY,
913
- ExampleRegistry2 as ExampleRegistry,
914
- EXAMPLE_REGISTRY2 as EXAMPLE_REGISTRY
915
- };