nitrostack 1.0.71 → 1.0.73

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 (253) hide show
  1. package/dist/auth/api-key.js.map +1 -1
  2. package/dist/auth/client.js.map +1 -1
  3. package/dist/auth/index.d.ts +2 -1
  4. package/dist/auth/index.d.ts.map +1 -1
  5. package/dist/auth/index.js +3 -0
  6. package/dist/auth/index.js.map +1 -1
  7. package/dist/auth/middleware.d.ts +1 -1
  8. package/dist/auth/middleware.d.ts.map +1 -1
  9. package/dist/auth/middleware.js.map +1 -1
  10. package/dist/auth/secure-secret.d.ts +136 -0
  11. package/dist/auth/secure-secret.d.ts.map +1 -0
  12. package/dist/auth/secure-secret.js +182 -0
  13. package/dist/auth/secure-secret.js.map +1 -0
  14. package/dist/auth/server-metadata.d.ts.map +1 -1
  15. package/dist/auth/server-metadata.js.map +1 -1
  16. package/dist/auth/simple-jwt.d.ts +100 -14
  17. package/dist/auth/simple-jwt.d.ts.map +1 -1
  18. package/dist/auth/simple-jwt.js +19 -9
  19. package/dist/auth/simple-jwt.js.map +1 -1
  20. package/dist/auth/token-store.js +1 -1
  21. package/dist/auth/token-store.js.map +1 -1
  22. package/dist/auth/token-validation.js +1 -1
  23. package/dist/auth/token-validation.js.map +1 -1
  24. package/dist/cli/commands/build.js +1 -1
  25. package/dist/cli/commands/build.js.map +1 -1
  26. package/dist/cli/commands/generate-types.js +12 -12
  27. package/dist/cli/commands/generate-types.js.map +1 -1
  28. package/dist/cli/commands/generate.d.ts +8 -1
  29. package/dist/cli/commands/generate.d.ts.map +1 -1
  30. package/dist/cli/commands/generate.js +13 -12
  31. package/dist/cli/commands/generate.js.map +1 -1
  32. package/dist/cli/commands/init.js +1 -1
  33. package/dist/cli/commands/init.js.map +1 -1
  34. package/dist/cli/commands/upgrade.d.ts +10 -0
  35. package/dist/cli/commands/upgrade.d.ts.map +1 -0
  36. package/dist/cli/commands/upgrade.js +221 -0
  37. package/dist/cli/commands/upgrade.js.map +1 -0
  38. package/dist/cli/index.js +7 -0
  39. package/dist/cli/index.js.map +1 -1
  40. package/dist/core/app-decorator.d.ts +4 -3
  41. package/dist/core/app-decorator.d.ts.map +1 -1
  42. package/dist/core/app-decorator.js +67 -28
  43. package/dist/core/app-decorator.js.map +1 -1
  44. package/dist/core/builders.d.ts +19 -7
  45. package/dist/core/builders.d.ts.map +1 -1
  46. package/dist/core/builders.js +15 -8
  47. package/dist/core/builders.js.map +1 -1
  48. package/dist/core/component.d.ts +8 -8
  49. package/dist/core/component.d.ts.map +1 -1
  50. package/dist/core/component.js +3 -2
  51. package/dist/core/component.js.map +1 -1
  52. package/dist/core/config-module.d.ts +11 -4
  53. package/dist/core/config-module.d.ts.map +1 -1
  54. package/dist/core/config-module.js +1 -1
  55. package/dist/core/config-module.js.map +1 -1
  56. package/dist/core/decorators/cache.decorator.d.ts +9 -9
  57. package/dist/core/decorators/cache.decorator.d.ts.map +1 -1
  58. package/dist/core/decorators/cache.decorator.js +3 -3
  59. package/dist/core/decorators/cache.decorator.js.map +1 -1
  60. package/dist/core/decorators/health-check.decorator.d.ts +3 -3
  61. package/dist/core/decorators/health-check.decorator.d.ts.map +1 -1
  62. package/dist/core/decorators/health-check.decorator.js +2 -2
  63. package/dist/core/decorators/health-check.decorator.js.map +1 -1
  64. package/dist/core/decorators/rate-limit.decorator.d.ts +5 -4
  65. package/dist/core/decorators/rate-limit.decorator.d.ts.map +1 -1
  66. package/dist/core/decorators/rate-limit.decorator.js +3 -3
  67. package/dist/core/decorators/rate-limit.decorator.js.map +1 -1
  68. package/dist/core/decorators.d.ts +47 -29
  69. package/dist/core/decorators.d.ts.map +1 -1
  70. package/dist/core/decorators.js +9 -9
  71. package/dist/core/decorators.js.map +1 -1
  72. package/dist/core/di/container.d.ts +21 -4
  73. package/dist/core/di/container.d.ts.map +1 -1
  74. package/dist/core/di/container.js +11 -7
  75. package/dist/core/di/container.js.map +1 -1
  76. package/dist/core/di/injectable.decorator.d.ts +5 -3
  77. package/dist/core/di/injectable.decorator.d.ts.map +1 -1
  78. package/dist/core/di/injectable.decorator.js.map +1 -1
  79. package/dist/core/errors.d.ts +4 -4
  80. package/dist/core/errors.d.ts.map +1 -1
  81. package/dist/core/errors.js.map +1 -1
  82. package/dist/core/events/event-emitter.d.ts +3 -3
  83. package/dist/core/events/event-emitter.d.ts.map +1 -1
  84. package/dist/core/events/event-emitter.js.map +1 -1
  85. package/dist/core/events/event.decorator.d.ts +5 -5
  86. package/dist/core/events/event.decorator.d.ts.map +1 -1
  87. package/dist/core/events/event.decorator.js +10 -6
  88. package/dist/core/events/event.decorator.js.map +1 -1
  89. package/dist/core/events/log-emitter.d.ts +7 -1
  90. package/dist/core/events/log-emitter.d.ts.map +1 -1
  91. package/dist/core/events/log-emitter.js.map +1 -1
  92. package/dist/core/filters/exception-filter.decorator.d.ts +5 -5
  93. package/dist/core/filters/exception-filter.decorator.d.ts.map +1 -1
  94. package/dist/core/filters/exception-filter.decorator.js +3 -3
  95. package/dist/core/filters/exception-filter.decorator.js.map +1 -1
  96. package/dist/core/filters/exception-filter.interface.d.ts +14 -5
  97. package/dist/core/filters/exception-filter.interface.d.ts.map +1 -1
  98. package/dist/core/guards/apikey.guard.d.ts +1 -1
  99. package/dist/core/guards/apikey.guard.d.ts.map +1 -1
  100. package/dist/core/guards/guard.interface.d.ts +1 -1
  101. package/dist/core/guards/guard.interface.d.ts.map +1 -1
  102. package/dist/core/guards/jwt.guard.d.ts +1 -1
  103. package/dist/core/guards/jwt.guard.d.ts.map +1 -1
  104. package/dist/core/guards/oauth.guard.d.ts +1 -1
  105. package/dist/core/guards/oauth.guard.d.ts.map +1 -1
  106. package/dist/core/guards/use-guards.decorator.d.ts +3 -3
  107. package/dist/core/guards/use-guards.decorator.d.ts.map +1 -1
  108. package/dist/core/guards/use-guards.decorator.js +1 -1
  109. package/dist/core/guards/use-guards.decorator.js.map +1 -1
  110. package/dist/core/index.d.ts +2 -2
  111. package/dist/core/index.d.ts.map +1 -1
  112. package/dist/core/index.js.map +1 -1
  113. package/dist/core/interceptors/interceptor.decorator.d.ts +4 -4
  114. package/dist/core/interceptors/interceptor.decorator.d.ts.map +1 -1
  115. package/dist/core/interceptors/interceptor.decorator.js +2 -2
  116. package/dist/core/interceptors/interceptor.decorator.js.map +1 -1
  117. package/dist/core/interceptors/interceptor.interface.d.ts +3 -3
  118. package/dist/core/interceptors/interceptor.interface.d.ts.map +1 -1
  119. package/dist/core/logger.d.ts.map +1 -1
  120. package/dist/core/logger.js.map +1 -1
  121. package/dist/core/middleware/middleware.decorator.d.ts +4 -4
  122. package/dist/core/middleware/middleware.decorator.d.ts.map +1 -1
  123. package/dist/core/middleware/middleware.decorator.js +2 -2
  124. package/dist/core/middleware/middleware.decorator.js.map +1 -1
  125. package/dist/core/middleware/middleware.interface.d.ts +3 -3
  126. package/dist/core/middleware/middleware.interface.d.ts.map +1 -1
  127. package/dist/core/module.d.ts +33 -14
  128. package/dist/core/module.d.ts.map +1 -1
  129. package/dist/core/module.js +11 -6
  130. package/dist/core/module.js.map +1 -1
  131. package/dist/core/oauth-module.d.ts +9 -3
  132. package/dist/core/oauth-module.d.ts.map +1 -1
  133. package/dist/core/oauth-module.js +4 -3
  134. package/dist/core/oauth-module.js.map +1 -1
  135. package/dist/core/pipes/pipe.decorator.d.ts +14 -5
  136. package/dist/core/pipes/pipe.decorator.d.ts.map +1 -1
  137. package/dist/core/pipes/pipe.decorator.js +2 -2
  138. package/dist/core/pipes/pipe.decorator.js.map +1 -1
  139. package/dist/core/pipes/pipe.interface.d.ts +9 -4
  140. package/dist/core/pipes/pipe.interface.d.ts.map +1 -1
  141. package/dist/core/prompt.d.ts +13 -4
  142. package/dist/core/prompt.d.ts.map +1 -1
  143. package/dist/core/prompt.js +2 -2
  144. package/dist/core/prompt.js.map +1 -1
  145. package/dist/core/resource.d.ts +7 -2
  146. package/dist/core/resource.d.ts.map +1 -1
  147. package/dist/core/resource.js +2 -2
  148. package/dist/core/resource.js.map +1 -1
  149. package/dist/core/server.d.ts +49 -3
  150. package/dist/core/server.d.ts.map +1 -1
  151. package/dist/core/server.js +61 -34
  152. package/dist/core/server.js.map +1 -1
  153. package/dist/core/tool.d.ts +44 -16
  154. package/dist/core/tool.d.ts.map +1 -1
  155. package/dist/core/tool.js +19 -6
  156. package/dist/core/tool.js.map +1 -1
  157. package/dist/core/transports/discovery-http-server.d.ts +7 -1
  158. package/dist/core/transports/discovery-http-server.d.ts.map +1 -1
  159. package/dist/core/transports/discovery-http-server.js.map +1 -1
  160. package/dist/core/transports/http-server.d.ts +2 -2
  161. package/dist/core/transports/http-server.d.ts.map +1 -1
  162. package/dist/core/transports/http-server.js +1 -1
  163. package/dist/core/transports/http-server.js.map +1 -1
  164. package/dist/core/transports/streamable-http.d.ts +4 -4
  165. package/dist/core/transports/streamable-http.d.ts.map +1 -1
  166. package/dist/core/transports/streamable-http.js +1 -1
  167. package/dist/core/transports/streamable-http.js.map +1 -1
  168. package/dist/core/types.d.ts +87 -15
  169. package/dist/core/types.d.ts.map +1 -1
  170. package/dist/core/widgets/widget-registry.d.ts +2 -2
  171. package/dist/core/widgets/widget-registry.d.ts.map +1 -1
  172. package/dist/core/widgets/widget-registry.js +1 -1
  173. package/dist/core/widgets/widget-registry.js.map +1 -1
  174. package/dist/testing/index.d.ts +44 -17
  175. package/dist/testing/index.d.ts.map +1 -1
  176. package/dist/testing/index.js +5 -8
  177. package/dist/testing/index.js.map +1 -1
  178. package/dist/ui-next/index.d.ts +1 -1
  179. package/dist/ui-next/index.d.ts.map +1 -1
  180. package/dist/ui-next/index.js.map +1 -1
  181. package/dist/widgets/hooks/useWidgetSDK.d.ts +5 -5
  182. package/dist/widgets/runtime/WidgetLayout.js.map +1 -1
  183. package/dist/widgets/sdk.d.ts +5 -5
  184. package/dist/widgets/sdk.d.ts.map +1 -1
  185. package/dist/widgets/sdk.js.map +1 -1
  186. package/package.json +1 -1
  187. package/src/studio/app/api/auth/fetch-metadata/route.ts +3 -2
  188. package/src/studio/app/api/auth/register-client/route.ts +3 -2
  189. package/src/studio/app/api/chat/route.ts +33 -17
  190. package/src/studio/app/api/health/checks/route.ts +5 -4
  191. package/src/studio/app/api/init/route.ts +3 -2
  192. package/src/studio/app/api/ping/route.ts +3 -2
  193. package/src/studio/app/api/prompts/[name]/route.ts +4 -3
  194. package/src/studio/app/api/prompts/route.ts +3 -2
  195. package/src/studio/app/api/resources/[...uri]/route.ts +3 -2
  196. package/src/studio/app/api/resources/route.ts +3 -2
  197. package/src/studio/app/api/roots/route.ts +3 -2
  198. package/src/studio/app/api/sampling/route.ts +3 -2
  199. package/src/studio/app/api/tools/[name]/call/route.ts +3 -2
  200. package/src/studio/app/api/tools/route.ts +4 -3
  201. package/src/studio/app/api/widget-examples/route.ts +5 -4
  202. package/src/studio/app/auth/callback/page.tsx +9 -8
  203. package/src/studio/app/chat/page.tsx +1535 -468
  204. package/src/studio/app/chat/page.tsx.backup +1046 -187
  205. package/src/studio/app/globals.css +361 -191
  206. package/src/studio/app/health/page.tsx +73 -77
  207. package/src/studio/app/layout.tsx +9 -11
  208. package/src/studio/app/logs/page.tsx +31 -32
  209. package/src/studio/app/page.tsx +136 -232
  210. package/src/studio/app/prompts/page.tsx +115 -97
  211. package/src/studio/app/resources/page.tsx +115 -124
  212. package/src/studio/app/settings/page.tsx +1083 -127
  213. package/src/studio/app/tools/page.tsx +343 -0
  214. package/src/studio/components/EnlargeModal.tsx +76 -65
  215. package/src/studio/components/LogMessage.tsx +6 -6
  216. package/src/studio/components/MarkdownRenderer.tsx +246 -349
  217. package/src/studio/components/Sidebar.tsx +165 -210
  218. package/src/studio/components/SplashScreen.tsx +109 -0
  219. package/src/studio/components/ToolCard.tsx +50 -41
  220. package/src/studio/components/VoiceOrbOverlay.tsx +475 -0
  221. package/src/studio/components/WidgetErrorBoundary.tsx +48 -0
  222. package/src/studio/components/WidgetRenderer.tsx +169 -211
  223. package/src/studio/components/ops/OpsCanvas.tsx +748 -0
  224. package/src/studio/components/ops/OpsNodeDetailPanel.tsx +150 -0
  225. package/src/studio/components/ops/OpsSummaryBar.tsx +90 -0
  226. package/src/studio/components/ops/index.ts +5 -0
  227. package/src/studio/components/ops/nodes/BaseNode.tsx +65 -0
  228. package/src/studio/components/ops/nodes/LLMCallNode.tsx +34 -0
  229. package/src/studio/components/ops/nodes/LLMResponseNode.tsx +33 -0
  230. package/src/studio/components/ops/nodes/ToolCallNode.tsx +30 -0
  231. package/src/studio/components/ops/nodes/ToolResultNode.tsx +43 -0
  232. package/src/studio/components/ops/nodes/UserPromptNode.tsx +34 -0
  233. package/src/studio/components/ops/nodes/WidgetRenderNode.tsx +23 -0
  234. package/src/studio/components/ops/nodes/index.ts +8 -0
  235. package/src/studio/components/tools/ToolsCanvas.tsx +327 -0
  236. package/src/studio/lib/api.ts +61 -42
  237. package/src/studio/lib/http-client-transport.ts +2 -2
  238. package/src/studio/lib/llm-service.ts +126 -47
  239. package/src/studio/lib/mcp-client.ts +9 -6
  240. package/src/studio/lib/ops-store.ts +427 -0
  241. package/src/studio/lib/ops-tracker.ts +416 -0
  242. package/src/studio/lib/ops-types.ts +164 -0
  243. package/src/studio/lib/store.ts +23 -11
  244. package/src/studio/lib/types.ts +228 -38
  245. package/src/studio/lib/widget-loader.ts +2 -2
  246. package/src/studio/package-lock.json +3303 -0
  247. package/src/studio/package.json +3 -1
  248. package/src/studio/public/NitroStudio Isotype Color.png +0 -0
  249. package/src/studio/tailwind.config.ts +63 -17
  250. package/templates/typescript-oauth/src/modules/flights/flights.prompts.ts +19 -22
  251. package/dist/cli/build-widgets.mjs +0 -165
  252. package/src/studio/app/auth/page.tsx +0 -560
  253. package/src/studio/app/ping/page.tsx +0 -209
@@ -12,15 +12,17 @@
12
12
  "export": "next build && next export"
13
13
  },
14
14
  "dependencies": {
15
+ "@elevenlabs/elevenlabs-js": "^2.28.0",
15
16
  "@fontsource/inter": "^5.2.8",
16
17
  "@fontsource/jetbrains-mono": "^5.2.8",
18
+ "@heroicons/react": "^2.2.0",
17
19
  "@modelcontextprotocol/sdk": "^1.0.4",
18
20
  "clsx": "^2.1.0",
19
21
  "eventsource": "^2.0.2",
20
- "lucide-react": "^0.546.0",
21
22
  "next": "^14.2.5",
22
23
  "react": "^18.3.1",
23
24
  "react-dom": "^18.3.1",
25
+ "reactflow": "^11.11.4",
24
26
  "zustand": "^4.5.0"
25
27
  },
26
28
  "devDependencies": {
@@ -9,21 +9,42 @@ const config: Config = {
9
9
  ],
10
10
  theme: {
11
11
  extend: {
12
+ fontFamily: {
13
+ heading: ['Space Grotesk', 'sans-serif'],
14
+ body: ['IBM Plex Sans', 'sans-serif'],
15
+ mono: ['JetBrains Mono', 'Fira Code', 'Consolas', 'monospace'],
16
+ },
12
17
  colors: {
13
- // Brand colors - Gold & Black
14
- primary: {
15
- DEFAULT: '#d4af37', // Gold
16
- 50: '#fdfcf8',
17
- 100: '#f9f7ed',
18
- 200: '#f2ecd3',
19
- 300: '#ead9a1',
20
- 400: '#e2c870',
21
- 500: '#d4af37', // Main gold
22
- 600: '#b8962b',
23
- 700: '#967824',
24
- 800: '#7a6020',
25
- 900: '#654f1d',
26
- },
18
+ // MCP Brand Core Colors
19
+ slateInk: '#121217',
20
+ coolMint: '#2AB5A5',
21
+ signalBlue: '#3B82F6',
22
+
23
+ // MCP Extended Palette - Light Mode
24
+ 'light-canvas': '#F5F6FA',
25
+ 'light-white': '#FFFFFF',
26
+ 'light-text-primary': '#121217',
27
+ 'light-text-secondary': '#5F6475',
28
+ 'light-border-soft': '#E6E8F0',
29
+ 'light-border-subtle': '#EEF0F6',
30
+
31
+ // MCP Extended Palette - Dark Mode
32
+ 'dark-base': '#0E0F14',
33
+ 'dark-surface': '#1B1B20',
34
+ 'dark-text-primary': '#E9E9F0',
35
+ 'dark-text-muted': '#B4B4CC',
36
+ 'dark-border-panel': '#312626',
37
+
38
+ // MCP Status Colors (same light/dark)
39
+ 'status-success': '#2AB5A5',
40
+ 'status-warning': '#F59E0B',
41
+ 'status-error': '#EF4444',
42
+ 'status-info': '#0A9CA9',
43
+
44
+ // MCP Accent
45
+ 'accent-steel': '#4D777F',
46
+
47
+ // CSS Variable mapped colors (for compatibility)
27
48
  background: 'hsl(var(--background))',
28
49
  foreground: 'hsl(var(--foreground))',
29
50
  card: {
@@ -34,6 +55,10 @@ const config: Config = {
34
55
  DEFAULT: 'hsl(var(--popover))',
35
56
  foreground: 'hsl(var(--popover-foreground))',
36
57
  },
58
+ primary: {
59
+ DEFAULT: 'hsl(var(--primary))',
60
+ foreground: 'hsl(var(--primary-foreground))',
61
+ },
37
62
  secondary: {
38
63
  DEFAULT: 'hsl(var(--secondary))',
39
64
  foreground: 'hsl(var(--secondary-foreground))',
@@ -55,9 +80,30 @@ const config: Config = {
55
80
  ring: 'hsl(var(--ring))',
56
81
  },
57
82
  borderRadius: {
58
- lg: 'var(--radius)',
59
- md: 'calc(var(--radius) - 2px)',
60
- sm: 'calc(var(--radius) - 4px)',
83
+ // MCP Border Radius System
84
+ DEFAULT: '4px', // MCP default
85
+ 'none': '0',
86
+ 'sm': '2px',
87
+ 'md': '4px', // MCP default
88
+ 'lg': '6px',
89
+ 'xl': '8px',
90
+ '2xl': '12px',
91
+ '3xl': '16px',
92
+ 'pill': '999px', // MCP pill
93
+ 'full': '9999px', // Circle
94
+ },
95
+ boxShadow: {
96
+ // MCP Shadow System - Light Mode
97
+ 'low-light': '0px 1px 3px rgba(240, 100, 49, 0.08)',
98
+ 'medium-light': '0px 4px 12px rgba(240, 100, 49, 0.11)',
99
+ 'high-light': '0px 8px 28px rgba(240, 100, 49, 0.14)',
100
+ 'focus-light': '0px 0px 28px rgba(173, 62, 44, 0.30)',
101
+
102
+ // MCP Shadow System - Dark Mode
103
+ 'low-dark': '0px 1px 3px rgba(0, 0, 0, 0.07)',
104
+ 'medium-dark': '0px 4px 12px rgba(0, 0, 0, 0.10)',
105
+ 'high-dark': '0px 8px 28px rgba(0, 0, 0, 0.15)',
106
+ 'focus-dark': '0px 0px 28px rgba(217, 91, 60, 0.16)',
61
107
  },
62
108
  },
63
109
  },
@@ -22,33 +22,30 @@ export class FlightPrompts {
22
22
  ]
23
23
  })
24
24
  async flightSearchAssistant(input: any, ctx: ExecutionContext) {
25
- const systemPrompt = `You are a professional flight booking assistant with expertise in helping travelers find the best flight options.
25
+ const systemPrompt = `You are a professional flight booking assistant with expertise in helping travelers find flight information.
26
+
27
+ āš ļø CRITICAL: Only do what the user specifically asks. Do NOT assume additional steps.
26
28
 
27
29
  Your capabilities:
30
+ - Search for airports using search_airports tool
28
31
  - Search for flights using the search_flights tool
29
32
  - Get detailed flight information using get_flight_details tool
30
- - Search for airports using search_airports tool
31
- - Explain flight options, pricing, and conditions
32
- - Help users compare different flight options
33
- - Provide recommendations based on user preferences
34
- - Guide users through the booking process
35
-
36
- Guidelines:
37
- 1. Always confirm the origin, destination, and dates before searching
38
- 2. Ask about passenger count and cabin class preferences
39
- 3. Explain the differences between flight options clearly
40
- 4. Highlight important details like layovers, total duration, and baggage allowance
41
- 5. Inform users about refund and change policies
42
- 6. Help users understand pricing and what's included
43
- 7. Be proactive in suggesting alternatives if initial search has limited results
44
-
45
- BOOKING WORKFLOW:
46
- When a user wants to book a flight:
33
+ - Help book flights when explicitly requested
34
+
35
+ **IMPORTANT RULES:**
36
+ 1. If user asks about airports, ONLY search airports - do NOT search for flights
37
+ 2. If user asks about flights, ONLY search flights - do NOT automatically book
38
+ 3. If user asks to book, ONLY then proceed with booking workflow
39
+ 4. NEVER chain operations unless user explicitly requests it
40
+
41
+ **EXAMPLES:**
42
+ - "show me airports in London" → search_airports("London") → show results → STOP
43
+ - "find flights from NYC to LAX" → search_flights → show results → STOP
44
+ - "book this flight" → THEN start booking workflow
45
+
46
+ BOOKING WORKFLOW (only when user explicitly wants to book):
47
47
  1. FIRST, collect ALL passenger information (name, title, gender, date of birth, email, phone)
48
48
  2. THEN, call create_order tool with complete passenger details
49
- - The system will automatically create a HOLD order (no payment required)
50
- - The system will automatically handle passenger ID creation with Duffel
51
- - You just need to provide the passenger details in the correct format
52
49
  āš ļø NEVER call create_order without collecting passenger information first!
53
50
  āš ļø All bookings are automatically held - no payment is required at booking time
54
51
 
@@ -56,7 +53,7 @@ Current user query: ${input.userQuery}
56
53
 
57
54
  ${input.context?.previousSearches?.length ? `Previous searches in this conversation:\n${JSON.stringify(input.context.previousSearches, null, 2)}` : ''}
58
55
 
59
- Respond naturally and helpfully to assist the user with their flight booking needs.`;
56
+ Respond to EXACTLY what the user asked - nothing more.`;
60
57
 
61
58
  return {
62
59
  role: 'assistant',
@@ -1,165 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Custom widget bundler for NitroStack
5
- *
6
- * This script bundles Next.js widget pages into single-file HTML documents
7
- * with all JavaScript and CSS inlined, following OpenAI's widget spec.
8
- *
9
- * Unlike Next.js static export which creates multiple chunk files,
10
- * this creates truly self-contained single-file widgets.
11
- */
12
-
13
- import * as esbuild from 'esbuild';
14
- import * as fs from 'fs';
15
- import * as path from 'path';
16
-
17
- const WIDGETS_DIR = path.resolve(process.cwd(), 'src/widgets');
18
- const APP_DIR = path.join(WIDGETS_DIR, 'app');
19
- const OUT_DIR = path.join(WIDGETS_DIR, 'out');
20
-
21
- console.log('šŸŽØ Building widgets with esbuild...\n');
22
-
23
- // Clean output directory
24
- if (fs.existsSync(OUT_DIR)) {
25
- fs.rmSync(OUT_DIR, { recursive: true });
26
- }
27
- fs.mkdirSync(OUT_DIR, { recursive: true });
28
-
29
- // Find all widget pages
30
- const widgetPages = [];
31
-
32
- function findWidgetPages(dir, basePath = '') {
33
- const entries = fs.readdirSync(dir, { withFileTypes: true });
34
-
35
- for (const entry of entries) {
36
- const fullPath = path.join(dir, entry.name);
37
- const relativePath = path.join(basePath, entry.name);
38
-
39
- if (entry.isDirectory()) {
40
- findWidgetPages(fullPath, relativePath);
41
- } else if (entry.name === 'page.tsx' || entry.name === 'page.jsx') {
42
- const widgetName = basePath || 'index';
43
- widgetPages.push({
44
- name: widgetName,
45
- entryPoint: fullPath,
46
- outputName: widgetName.replace(/\//g, '-')
47
- });
48
- }
49
- }
50
- }
51
-
52
- if (fs.existsSync(APP_DIR)) {
53
- findWidgetPages(APP_DIR);
54
- }
55
-
56
- console.log(`Found ${widgetPages.length} widget(s):`);
57
- widgetPages.forEach(w => console.log(` - ${w.name}`));
58
- console.log('');
59
-
60
- // Bundle each widget
61
- for (const widget of widgetPages) {
62
- console.log(`šŸ“¦ Bundling ${widget.name}...`);
63
-
64
- const tempEntry = path.join(OUT_DIR, `_temp_${widget.outputName}.jsx`);
65
- const jsOutput = path.join(OUT_DIR, `${widget.outputName}.js`);
66
- const htmlOutput = path.join(OUT_DIR, `${widget.outputName}.html`);
67
-
68
- // Create a temporary entry file that renders the widget
69
- const entryCode = `
70
- import React from 'react';
71
- import { createRoot } from 'react-dom/client';
72
- import WidgetPage from '${widget.entryPoint.replace(/\\/g, '/')}';
73
-
74
- // Wait for DOM to be ready
75
- if (document.readyState === 'loading') {
76
- document.addEventListener('DOMContentLoaded', init);
77
- } else {
78
- init();
79
- }
80
-
81
- function init() {
82
- // Get data from window.openai if available
83
- const data = window.openai?.toolOutput || {};
84
-
85
- // Find or create root element
86
- let root = document.getElementById('widget-root');
87
- if (!root) {
88
- root = document.createElement('div');
89
- root.id = 'widget-root';
90
- document.body.appendChild(root);
91
- }
92
-
93
- // Render the widget
94
- const reactRoot = createRoot(root);
95
- reactRoot.render(React.createElement(WidgetPage, { data }));
96
- }
97
- `;
98
-
99
- fs.writeFileSync(tempEntry, entryCode);
100
-
101
- try {
102
- // Bundle with esbuild
103
- await esbuild.build({
104
- entryPoints: [tempEntry],
105
- bundle: true,
106
- format: 'iife',
107
- outfile: jsOutput,
108
- platform: 'browser',
109
- target: ['es2020'],
110
- minify: true,
111
- jsx: 'automatic',
112
- jsxImportSource: 'react',
113
- // Don't bundle React - it should come from widgets/node_modules
114
- external: [],
115
- // Resolve modules from the widgets directory
116
- nodePaths: [path.join(WIDGETS_DIR, 'node_modules')],
117
- define: {
118
- 'process.env.NODE_ENV': '"production"'
119
- },
120
- logLevel: 'warning'
121
- });
122
-
123
- // Read the bundled JavaScript
124
- const bundledJs = fs.readFileSync(jsOutput, 'utf-8');
125
-
126
- // Create the HTML file with inlined JavaScript
127
- const html = `<!DOCTYPE html>
128
- <html lang="en">
129
- <head>
130
- <meta charset="utf-8">
131
- <meta name="viewport" content="width=device-width, initial-scale=1">
132
- <style>
133
- * { box-sizing: border-box; }
134
- body {
135
- margin: 0;
136
- padding: 0;
137
- font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
138
- }
139
- #widget-root {
140
- width: 100%;
141
- min-height: 100vh;
142
- }
143
- </style>
144
- </head>
145
- <body>
146
- <div id="widget-root"></div>
147
- <script>${bundledJs}</script>
148
- </body>
149
- </html>`;
150
-
151
- fs.writeFileSync(htmlOutput, html);
152
-
153
- // Clean up temporary files
154
- fs.unlinkSync(tempEntry);
155
- fs.unlinkSync(jsOutput);
156
-
157
- console.log(` āœ“ ${widget.outputName}.html`);
158
-
159
- } catch (error) {
160
- console.error(` āœ— Failed to bundle ${widget.name}:`, error.message);
161
- process.exit(1);
162
- }
163
- }
164
-
165
- console.log(`\n✨ Successfully built ${widgetPages.length} widget(s) to ${OUT_DIR}\n`);