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.
- package/dist/auth/api-key.js.map +1 -1
- package/dist/auth/client.js.map +1 -1
- package/dist/auth/index.d.ts +2 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +3 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/middleware.d.ts +1 -1
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js.map +1 -1
- package/dist/auth/secure-secret.d.ts +136 -0
- package/dist/auth/secure-secret.d.ts.map +1 -0
- package/dist/auth/secure-secret.js +182 -0
- package/dist/auth/secure-secret.js.map +1 -0
- package/dist/auth/server-metadata.d.ts.map +1 -1
- package/dist/auth/server-metadata.js.map +1 -1
- package/dist/auth/simple-jwt.d.ts +100 -14
- package/dist/auth/simple-jwt.d.ts.map +1 -1
- package/dist/auth/simple-jwt.js +19 -9
- package/dist/auth/simple-jwt.js.map +1 -1
- package/dist/auth/token-store.js +1 -1
- package/dist/auth/token-store.js.map +1 -1
- package/dist/auth/token-validation.js +1 -1
- package/dist/auth/token-validation.js.map +1 -1
- package/dist/cli/commands/build.js +1 -1
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/generate-types.js +12 -12
- package/dist/cli/commands/generate-types.js.map +1 -1
- package/dist/cli/commands/generate.d.ts +8 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +13 -12
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/init.js +1 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/upgrade.d.ts +10 -0
- package/dist/cli/commands/upgrade.d.ts.map +1 -0
- package/dist/cli/commands/upgrade.js +221 -0
- package/dist/cli/commands/upgrade.js.map +1 -0
- package/dist/cli/index.js +7 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/core/app-decorator.d.ts +4 -3
- package/dist/core/app-decorator.d.ts.map +1 -1
- package/dist/core/app-decorator.js +67 -28
- package/dist/core/app-decorator.js.map +1 -1
- package/dist/core/builders.d.ts +19 -7
- package/dist/core/builders.d.ts.map +1 -1
- package/dist/core/builders.js +15 -8
- package/dist/core/builders.js.map +1 -1
- package/dist/core/component.d.ts +8 -8
- package/dist/core/component.d.ts.map +1 -1
- package/dist/core/component.js +3 -2
- package/dist/core/component.js.map +1 -1
- package/dist/core/config-module.d.ts +11 -4
- package/dist/core/config-module.d.ts.map +1 -1
- package/dist/core/config-module.js +1 -1
- package/dist/core/config-module.js.map +1 -1
- package/dist/core/decorators/cache.decorator.d.ts +9 -9
- package/dist/core/decorators/cache.decorator.d.ts.map +1 -1
- package/dist/core/decorators/cache.decorator.js +3 -3
- package/dist/core/decorators/cache.decorator.js.map +1 -1
- package/dist/core/decorators/health-check.decorator.d.ts +3 -3
- package/dist/core/decorators/health-check.decorator.d.ts.map +1 -1
- package/dist/core/decorators/health-check.decorator.js +2 -2
- package/dist/core/decorators/health-check.decorator.js.map +1 -1
- package/dist/core/decorators/rate-limit.decorator.d.ts +5 -4
- package/dist/core/decorators/rate-limit.decorator.d.ts.map +1 -1
- package/dist/core/decorators/rate-limit.decorator.js +3 -3
- package/dist/core/decorators/rate-limit.decorator.js.map +1 -1
- package/dist/core/decorators.d.ts +47 -29
- package/dist/core/decorators.d.ts.map +1 -1
- package/dist/core/decorators.js +9 -9
- package/dist/core/decorators.js.map +1 -1
- package/dist/core/di/container.d.ts +21 -4
- package/dist/core/di/container.d.ts.map +1 -1
- package/dist/core/di/container.js +11 -7
- package/dist/core/di/container.js.map +1 -1
- package/dist/core/di/injectable.decorator.d.ts +5 -3
- package/dist/core/di/injectable.decorator.d.ts.map +1 -1
- package/dist/core/di/injectable.decorator.js.map +1 -1
- package/dist/core/errors.d.ts +4 -4
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js.map +1 -1
- package/dist/core/events/event-emitter.d.ts +3 -3
- package/dist/core/events/event-emitter.d.ts.map +1 -1
- package/dist/core/events/event-emitter.js.map +1 -1
- package/dist/core/events/event.decorator.d.ts +5 -5
- package/dist/core/events/event.decorator.d.ts.map +1 -1
- package/dist/core/events/event.decorator.js +10 -6
- package/dist/core/events/event.decorator.js.map +1 -1
- package/dist/core/events/log-emitter.d.ts +7 -1
- package/dist/core/events/log-emitter.d.ts.map +1 -1
- package/dist/core/events/log-emitter.js.map +1 -1
- package/dist/core/filters/exception-filter.decorator.d.ts +5 -5
- package/dist/core/filters/exception-filter.decorator.d.ts.map +1 -1
- package/dist/core/filters/exception-filter.decorator.js +3 -3
- package/dist/core/filters/exception-filter.decorator.js.map +1 -1
- package/dist/core/filters/exception-filter.interface.d.ts +14 -5
- package/dist/core/filters/exception-filter.interface.d.ts.map +1 -1
- package/dist/core/guards/apikey.guard.d.ts +1 -1
- package/dist/core/guards/apikey.guard.d.ts.map +1 -1
- package/dist/core/guards/guard.interface.d.ts +1 -1
- package/dist/core/guards/guard.interface.d.ts.map +1 -1
- package/dist/core/guards/jwt.guard.d.ts +1 -1
- package/dist/core/guards/jwt.guard.d.ts.map +1 -1
- package/dist/core/guards/oauth.guard.d.ts +1 -1
- package/dist/core/guards/oauth.guard.d.ts.map +1 -1
- package/dist/core/guards/use-guards.decorator.d.ts +3 -3
- package/dist/core/guards/use-guards.decorator.d.ts.map +1 -1
- package/dist/core/guards/use-guards.decorator.js +1 -1
- package/dist/core/guards/use-guards.decorator.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/interceptors/interceptor.decorator.d.ts +4 -4
- package/dist/core/interceptors/interceptor.decorator.d.ts.map +1 -1
- package/dist/core/interceptors/interceptor.decorator.js +2 -2
- package/dist/core/interceptors/interceptor.decorator.js.map +1 -1
- package/dist/core/interceptors/interceptor.interface.d.ts +3 -3
- package/dist/core/interceptors/interceptor.interface.d.ts.map +1 -1
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js.map +1 -1
- package/dist/core/middleware/middleware.decorator.d.ts +4 -4
- package/dist/core/middleware/middleware.decorator.d.ts.map +1 -1
- package/dist/core/middleware/middleware.decorator.js +2 -2
- package/dist/core/middleware/middleware.decorator.js.map +1 -1
- package/dist/core/middleware/middleware.interface.d.ts +3 -3
- package/dist/core/middleware/middleware.interface.d.ts.map +1 -1
- package/dist/core/module.d.ts +33 -14
- package/dist/core/module.d.ts.map +1 -1
- package/dist/core/module.js +11 -6
- package/dist/core/module.js.map +1 -1
- package/dist/core/oauth-module.d.ts +9 -3
- package/dist/core/oauth-module.d.ts.map +1 -1
- package/dist/core/oauth-module.js +4 -3
- package/dist/core/oauth-module.js.map +1 -1
- package/dist/core/pipes/pipe.decorator.d.ts +14 -5
- package/dist/core/pipes/pipe.decorator.d.ts.map +1 -1
- package/dist/core/pipes/pipe.decorator.js +2 -2
- package/dist/core/pipes/pipe.decorator.js.map +1 -1
- package/dist/core/pipes/pipe.interface.d.ts +9 -4
- package/dist/core/pipes/pipe.interface.d.ts.map +1 -1
- package/dist/core/prompt.d.ts +13 -4
- package/dist/core/prompt.d.ts.map +1 -1
- package/dist/core/prompt.js +2 -2
- package/dist/core/prompt.js.map +1 -1
- package/dist/core/resource.d.ts +7 -2
- package/dist/core/resource.d.ts.map +1 -1
- package/dist/core/resource.js +2 -2
- package/dist/core/resource.js.map +1 -1
- package/dist/core/server.d.ts +49 -3
- package/dist/core/server.d.ts.map +1 -1
- package/dist/core/server.js +61 -34
- package/dist/core/server.js.map +1 -1
- package/dist/core/tool.d.ts +44 -16
- package/dist/core/tool.d.ts.map +1 -1
- package/dist/core/tool.js +19 -6
- package/dist/core/tool.js.map +1 -1
- package/dist/core/transports/discovery-http-server.d.ts +7 -1
- package/dist/core/transports/discovery-http-server.d.ts.map +1 -1
- package/dist/core/transports/discovery-http-server.js.map +1 -1
- package/dist/core/transports/http-server.d.ts +2 -2
- package/dist/core/transports/http-server.d.ts.map +1 -1
- package/dist/core/transports/http-server.js +1 -1
- package/dist/core/transports/http-server.js.map +1 -1
- package/dist/core/transports/streamable-http.d.ts +4 -4
- package/dist/core/transports/streamable-http.d.ts.map +1 -1
- package/dist/core/transports/streamable-http.js +1 -1
- package/dist/core/transports/streamable-http.js.map +1 -1
- package/dist/core/types.d.ts +87 -15
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/widgets/widget-registry.d.ts +2 -2
- package/dist/core/widgets/widget-registry.d.ts.map +1 -1
- package/dist/core/widgets/widget-registry.js +1 -1
- package/dist/core/widgets/widget-registry.js.map +1 -1
- package/dist/testing/index.d.ts +44 -17
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +5 -8
- package/dist/testing/index.js.map +1 -1
- package/dist/ui-next/index.d.ts +1 -1
- package/dist/ui-next/index.d.ts.map +1 -1
- package/dist/ui-next/index.js.map +1 -1
- package/dist/widgets/hooks/useWidgetSDK.d.ts +5 -5
- package/dist/widgets/runtime/WidgetLayout.js.map +1 -1
- package/dist/widgets/sdk.d.ts +5 -5
- package/dist/widgets/sdk.d.ts.map +1 -1
- package/dist/widgets/sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/studio/app/api/auth/fetch-metadata/route.ts +3 -2
- package/src/studio/app/api/auth/register-client/route.ts +3 -2
- package/src/studio/app/api/chat/route.ts +33 -17
- package/src/studio/app/api/health/checks/route.ts +5 -4
- package/src/studio/app/api/init/route.ts +3 -2
- package/src/studio/app/api/ping/route.ts +3 -2
- package/src/studio/app/api/prompts/[name]/route.ts +4 -3
- package/src/studio/app/api/prompts/route.ts +3 -2
- package/src/studio/app/api/resources/[...uri]/route.ts +3 -2
- package/src/studio/app/api/resources/route.ts +3 -2
- package/src/studio/app/api/roots/route.ts +3 -2
- package/src/studio/app/api/sampling/route.ts +3 -2
- package/src/studio/app/api/tools/[name]/call/route.ts +3 -2
- package/src/studio/app/api/tools/route.ts +4 -3
- package/src/studio/app/api/widget-examples/route.ts +5 -4
- package/src/studio/app/auth/callback/page.tsx +9 -8
- package/src/studio/app/chat/page.tsx +1535 -468
- package/src/studio/app/chat/page.tsx.backup +1046 -187
- package/src/studio/app/globals.css +361 -191
- package/src/studio/app/health/page.tsx +73 -77
- package/src/studio/app/layout.tsx +9 -11
- package/src/studio/app/logs/page.tsx +31 -32
- package/src/studio/app/page.tsx +136 -232
- package/src/studio/app/prompts/page.tsx +115 -97
- package/src/studio/app/resources/page.tsx +115 -124
- package/src/studio/app/settings/page.tsx +1083 -127
- package/src/studio/app/tools/page.tsx +343 -0
- package/src/studio/components/EnlargeModal.tsx +76 -65
- package/src/studio/components/LogMessage.tsx +6 -6
- package/src/studio/components/MarkdownRenderer.tsx +246 -349
- package/src/studio/components/Sidebar.tsx +165 -210
- package/src/studio/components/SplashScreen.tsx +109 -0
- package/src/studio/components/ToolCard.tsx +50 -41
- package/src/studio/components/VoiceOrbOverlay.tsx +475 -0
- package/src/studio/components/WidgetErrorBoundary.tsx +48 -0
- package/src/studio/components/WidgetRenderer.tsx +169 -211
- package/src/studio/components/ops/OpsCanvas.tsx +748 -0
- package/src/studio/components/ops/OpsNodeDetailPanel.tsx +150 -0
- package/src/studio/components/ops/OpsSummaryBar.tsx +90 -0
- package/src/studio/components/ops/index.ts +5 -0
- package/src/studio/components/ops/nodes/BaseNode.tsx +65 -0
- package/src/studio/components/ops/nodes/LLMCallNode.tsx +34 -0
- package/src/studio/components/ops/nodes/LLMResponseNode.tsx +33 -0
- package/src/studio/components/ops/nodes/ToolCallNode.tsx +30 -0
- package/src/studio/components/ops/nodes/ToolResultNode.tsx +43 -0
- package/src/studio/components/ops/nodes/UserPromptNode.tsx +34 -0
- package/src/studio/components/ops/nodes/WidgetRenderNode.tsx +23 -0
- package/src/studio/components/ops/nodes/index.ts +8 -0
- package/src/studio/components/tools/ToolsCanvas.tsx +327 -0
- package/src/studio/lib/api.ts +61 -42
- package/src/studio/lib/http-client-transport.ts +2 -2
- package/src/studio/lib/llm-service.ts +126 -47
- package/src/studio/lib/mcp-client.ts +9 -6
- package/src/studio/lib/ops-store.ts +427 -0
- package/src/studio/lib/ops-tracker.ts +416 -0
- package/src/studio/lib/ops-types.ts +164 -0
- package/src/studio/lib/store.ts +23 -11
- package/src/studio/lib/types.ts +228 -38
- package/src/studio/lib/widget-loader.ts +2 -2
- package/src/studio/package-lock.json +3303 -0
- package/src/studio/package.json +3 -1
- package/src/studio/public/NitroStudio Isotype Color.png +0 -0
- package/src/studio/tailwind.config.ts +63 -17
- package/templates/typescript-oauth/src/modules/flights/flights.prompts.ts +19 -22
- package/dist/cli/build-widgets.mjs +0 -165
- package/src/studio/app/auth/page.tsx +0 -560
- package/src/studio/app/ping/page.tsx +0 -209
package/src/studio/package.json
CHANGED
|
@@ -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": {
|
|
Binary file
|
|
@@ -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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
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
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
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`);
|