@tleblancureta/proto 0.1.0 → 0.1.2
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/core-web/src/ProtoApp.tsx +7 -7
- package/core-web/src/components/Shell.tsx +8 -8
- package/core-web/src/components/shell/EmptyState.tsx +2 -2
- package/core-web/src/components/shell/FocusView.tsx +2 -2
- package/core-web/src/components/shell/Toolbar.tsx +4 -4
- package/core-web/src/components/shell/persistence.ts +1 -1
- package/core-web/src/components/ui/avatar.tsx +1 -1
- package/core-web/src/components/ui/badge.tsx +1 -1
- package/core-web/src/components/ui/button.tsx +1 -1
- package/core-web/src/components/ui/card.tsx +1 -1
- package/core-web/src/components/ui/input.tsx +1 -1
- package/core-web/src/components/ui/scroll-area.tsx +1 -1
- package/core-web/src/components/ui/separator.tsx +1 -1
- package/core-web/src/components/ui/shell-dialog.tsx +1 -1
- package/core-web/src/components/ui/skeleton.tsx +1 -1
- package/core-web/src/components/ui/textarea.tsx +1 -1
- package/core-web/src/components/widgets/agent/Generative.tsx +1 -1
- package/core-web/src/components/widgets/agent/Primitives.tsx +2 -2
- package/core-web/src/components/widgets/agent/actions.ts +1 -1
- package/core-web/src/hooks/useAuth.ts +1 -1
- package/core-web/src/index.ts +26 -26
- package/core-web/src/lib/api.ts +1 -1
- package/core-web/src/lib/define-widget.ts +2 -2
- package/dist/core-mcp/src/app.js +2 -2
- package/dist/core-mcp/src/define-tool.d.ts +7 -2
- package/dist/core-mcp/src/define-tool.d.ts.map +1 -1
- package/dist/core-mcp/src/define-tool.js +5 -1
- package/dist/core-mcp/src/define-tool.js.map +1 -1
- package/dist/core-mcp/src/entity-tools.d.ts +1 -1
- package/dist/core-mcp/src/entity-tools.js +1 -1
- package/dist/core-mcp/src/index.d.ts +1 -1
- package/dist/core-mcp/src/index.d.ts.map +1 -1
- package/dist/core-mcp/src/index.js +1 -1
- package/dist/core-mcp/src/index.js.map +1 -1
- package/dist/core-web/src/ProtoApp.d.ts +2 -2
- package/dist/core-web/src/ProtoApp.d.ts.map +1 -1
- package/dist/core-web/src/ProtoApp.js +6 -6
- package/dist/core-web/src/ProtoApp.js.map +1 -1
- package/dist/core-web/src/components/Shell.d.ts +3 -3
- package/dist/core-web/src/components/Shell.d.ts.map +1 -1
- package/dist/core-web/src/components/Shell.js +5 -5
- package/dist/core-web/src/components/Shell.js.map +1 -1
- package/dist/core-web/src/components/shell/EmptyState.d.ts +1 -1
- package/dist/core-web/src/components/shell/EmptyState.d.ts.map +1 -1
- package/dist/core-web/src/components/shell/EmptyState.js +1 -1
- package/dist/core-web/src/components/shell/EmptyState.js.map +1 -1
- package/dist/core-web/src/components/shell/FocusView.d.ts +1 -1
- package/dist/core-web/src/components/shell/FocusView.d.ts.map +1 -1
- package/dist/core-web/src/components/shell/FocusView.js +1 -1
- package/dist/core-web/src/components/shell/FocusView.js.map +1 -1
- package/dist/core-web/src/components/shell/Toolbar.d.ts +1 -1
- package/dist/core-web/src/components/shell/Toolbar.d.ts.map +1 -1
- package/dist/core-web/src/components/shell/Toolbar.js +3 -3
- package/dist/core-web/src/components/shell/Toolbar.js.map +1 -1
- package/dist/core-web/src/components/shell/persistence.d.ts +1 -1
- package/dist/core-web/src/components/shell/persistence.d.ts.map +1 -1
- package/dist/core-web/src/components/ui/avatar.js +1 -1
- package/dist/core-web/src/components/ui/avatar.js.map +1 -1
- package/dist/core-web/src/components/ui/badge.js +1 -1
- package/dist/core-web/src/components/ui/badge.js.map +1 -1
- package/dist/core-web/src/components/ui/button.js +1 -1
- package/dist/core-web/src/components/ui/button.js.map +1 -1
- package/dist/core-web/src/components/ui/card.js +1 -1
- package/dist/core-web/src/components/ui/card.js.map +1 -1
- package/dist/core-web/src/components/ui/input.js +1 -1
- package/dist/core-web/src/components/ui/input.js.map +1 -1
- package/dist/core-web/src/components/ui/scroll-area.js +1 -1
- package/dist/core-web/src/components/ui/scroll-area.js.map +1 -1
- package/dist/core-web/src/components/ui/separator.js +1 -1
- package/dist/core-web/src/components/ui/separator.js.map +1 -1
- package/dist/core-web/src/components/ui/shell-dialog.js +1 -1
- package/dist/core-web/src/components/ui/shell-dialog.js.map +1 -1
- package/dist/core-web/src/components/ui/skeleton.js +1 -1
- package/dist/core-web/src/components/ui/skeleton.js.map +1 -1
- package/dist/core-web/src/components/ui/textarea.js +1 -1
- package/dist/core-web/src/components/ui/textarea.js.map +1 -1
- package/dist/core-web/src/components/widgets/agent/Generative.js +1 -1
- package/dist/core-web/src/components/widgets/agent/Generative.js.map +1 -1
- package/dist/core-web/src/components/widgets/agent/Primitives.js +2 -2
- package/dist/core-web/src/components/widgets/agent/Primitives.js.map +1 -1
- package/dist/core-web/src/components/widgets/agent/actions.js +1 -1
- package/dist/core-web/src/components/widgets/agent/actions.js.map +1 -1
- package/dist/core-web/src/hooks/useAuth.js +1 -1
- package/dist/core-web/src/hooks/useAuth.js.map +1 -1
- package/dist/core-web/src/index.d.ts +26 -26
- package/dist/core-web/src/index.d.ts.map +1 -1
- package/dist/core-web/src/index.js +25 -25
- package/dist/core-web/src/index.js.map +1 -1
- package/dist/core-web/src/lib/api.js +1 -1
- package/dist/core-web/src/lib/api.js.map +1 -1
- package/dist/core-web/src/lib/define-widget.d.ts +2 -2
- package/dist/core-web/src/lib/define-widget.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
9
|
*
|
|
10
|
-
* import { ProtoApp, defineWidget } from 'proto/web'
|
|
10
|
+
* import { ProtoApp, defineWidget } from '@tleblancureta/proto/web'
|
|
11
11
|
*
|
|
12
12
|
* const widgets = [
|
|
13
13
|
* defineWidget({ type: 'items', title: 'Items', ... }),
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
* }
|
|
19
19
|
*/
|
|
20
20
|
import { useState, useCallback, useRef, useMemo } from 'react'
|
|
21
|
-
import Shell, { type CockpitDefinition } from './components/Shell'
|
|
22
|
-
import { useAuth } from './hooks/useAuth'
|
|
23
|
-
import { useTheme } from './hooks/useTheme'
|
|
24
|
-
import { buildWidgetRegistry, type WidgetDefinition } from './lib/define-widget'
|
|
25
|
-
import { protoSocket } from './lib/api'
|
|
21
|
+
import Shell, { type CockpitDefinition } from './components/Shell.js'
|
|
22
|
+
import { useAuth } from './hooks/useAuth.js'
|
|
23
|
+
import { useTheme } from './hooks/useTheme.js'
|
|
24
|
+
import { buildWidgetRegistry, type WidgetDefinition } from './lib/define-widget.js'
|
|
25
|
+
import { protoSocket } from './lib/api.js'
|
|
26
26
|
import type { EntityDefinition } from '../../core-shared/src/index.js'
|
|
27
|
-
import type { ActiveEntity, WidgetInstance } from './components/shell/types'
|
|
27
|
+
import type { ActiveEntity, WidgetInstance } from './components/shell/types.js'
|
|
28
28
|
|
|
29
29
|
export interface ProtoAppProps {
|
|
30
30
|
/** Widget definitions — the core of your app's UI. */
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useState, useCallback, useRef, useMemo, type ReactNode } from 'react'
|
|
2
|
-
import { useMountEffect } from '../hooks/useMountEffect'
|
|
2
|
+
import { useMountEffect } from '../hooks/useMountEffect.js'
|
|
3
3
|
import { ResponsiveGridLayout, type Layout } from 'react-grid-layout'
|
|
4
4
|
import 'react-grid-layout/css/styles.css'
|
|
5
5
|
import { XIcon } from 'lucide-react'
|
|
6
|
-
import { loadShellState, saveShellState, clearShellState } from './shell/persistence'
|
|
7
|
-
import { Toolbar } from './shell/Toolbar'
|
|
8
|
-
import { FocusView } from './shell/FocusView'
|
|
9
|
-
import { EmptyState } from './shell/EmptyState'
|
|
10
|
-
import type { ActiveEntity, WidgetInstance, WidgetType } from './shell/types'
|
|
11
|
-
import type { ShellContext, WidgetRegistry } from '../lib/define-widget'
|
|
6
|
+
import { loadShellState, saveShellState, clearShellState } from './shell/persistence.js'
|
|
7
|
+
import { Toolbar } from './shell/Toolbar.js'
|
|
8
|
+
import { FocusView } from './shell/FocusView.js'
|
|
9
|
+
import { EmptyState } from './shell/EmptyState.js'
|
|
10
|
+
import type { ActiveEntity, WidgetInstance, WidgetType } from './shell/types.js'
|
|
11
|
+
import type { ShellContext, WidgetRegistry } from '../lib/define-widget.js'
|
|
12
12
|
|
|
13
|
-
export type { WidgetType, ActiveEntity } from './shell/types'
|
|
13
|
+
export type { WidgetType, ActiveEntity } from './shell/types.js'
|
|
14
14
|
|
|
15
15
|
function useContainerWidth(ref: React.RefObject<HTMLDivElement | null>) {
|
|
16
16
|
const [width, setWidth] = useState(800)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { XIcon, SparklesIcon } from 'lucide-react'
|
|
2
|
-
import { Generative } from '../widgets/agent/Generative'
|
|
3
|
-
import type { WidgetInstance } from './types'
|
|
2
|
+
import { Generative } from '../widgets/agent/Generative.js'
|
|
3
|
+
import type { WidgetInstance } from './types.js'
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
spec: any
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useState, useCallback, type ReactNode } from 'react'
|
|
2
|
-
import { useMountEffect } from '../../hooks/useMountEffect'
|
|
3
|
-
import { Button } from '../ui/button'
|
|
2
|
+
import { useMountEffect } from '../../hooks/useMountEffect.js'
|
|
3
|
+
import { Button } from '../ui/button.js'
|
|
4
4
|
import { PlusIcon, RotateCcwIcon, SunIcon, MoonIcon, MonitorIcon, UserIcon, LogOutIcon, Building2Icon, ChevronDownIcon, CheckIcon, XIcon, HomeIcon, SettingsIcon, LayoutGridIcon } from 'lucide-react'
|
|
5
|
-
import { useTheme, type Theme } from '../../hooks/useTheme'
|
|
6
|
-
import type { ActiveEntity, WidgetType } from './types'
|
|
5
|
+
import { useTheme, type Theme } from '../../hooks/useTheme.js'
|
|
6
|
+
import type { ActiveEntity, WidgetType } from './types.js'
|
|
7
7
|
|
|
8
8
|
interface CatalogEntry {
|
|
9
9
|
type: WidgetType
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState, type ReactNode } from 'react'
|
|
2
2
|
import { createPortal } from 'react-dom'
|
|
3
3
|
import { XIcon } from 'lucide-react'
|
|
4
|
-
import { cn } from '../../lib/utils'
|
|
4
|
+
import { cn } from '../../lib/utils.js'
|
|
5
5
|
|
|
6
6
|
interface ShellDialogProps {
|
|
7
7
|
open: boolean
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { useState, type ReactNode } from 'react'
|
|
9
9
|
import { ExternalLinkIcon, StarIcon, ShieldCheckIcon, Loader2Icon, CheckIcon } from 'lucide-react'
|
|
10
|
-
import { Badge as UIBadge } from '../../ui/badge'
|
|
11
|
-
import { ACTIONS } from './actions'
|
|
10
|
+
import { Badge as UIBadge } from '../../ui/badge.js'
|
|
11
|
+
import { ACTIONS } from './actions.js'
|
|
12
12
|
|
|
13
13
|
type OnChat = (message: string) => void
|
|
14
14
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Each action is an async handler that runs in the browser (usually a Supabase
|
|
4
4
|
* write) and returns a short confirmation label for the button's success state.
|
|
5
5
|
*/
|
|
6
|
-
import { supabase } from '../../../lib/supabase'
|
|
6
|
+
import { supabase } from '../../../lib/supabase.js'
|
|
7
7
|
|
|
8
8
|
export type ActionHandler = (payload: any) => Promise<string>
|
|
9
9
|
|
package/core-web/src/index.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
// Framework components
|
|
9
|
-
export { default as Shell, type CockpitDefinition } from './components/Shell'
|
|
10
|
-
export { ProtoApp, type ProtoAppProps } from './ProtoApp'
|
|
9
|
+
export { default as Shell, type CockpitDefinition } from './components/Shell.js'
|
|
10
|
+
export { ProtoApp, type ProtoAppProps } from './ProtoApp.js'
|
|
11
11
|
|
|
12
12
|
// Extension API
|
|
13
13
|
export {
|
|
@@ -18,35 +18,35 @@ export {
|
|
|
18
18
|
type WidgetCategory,
|
|
19
19
|
type WidgetSize,
|
|
20
20
|
type ShellContext,
|
|
21
|
-
} from './lib/define-widget'
|
|
22
|
-
export type { ActiveEntity, WidgetInstance, WidgetType } from './components/shell/types'
|
|
21
|
+
} from './lib/define-widget.js'
|
|
22
|
+
export type { ActiveEntity, WidgetInstance, WidgetType } from './components/shell/types.js'
|
|
23
23
|
|
|
24
24
|
// Hooks
|
|
25
|
-
export { useAuth } from './hooks/useAuth'
|
|
26
|
-
export { useData } from './hooks/useData'
|
|
27
|
-
export { useMountEffect } from './hooks/useMountEffect'
|
|
28
|
-
export { useTheme, type Theme } from './hooks/useTheme'
|
|
25
|
+
export { useAuth } from './hooks/useAuth.js'
|
|
26
|
+
export { useData } from './hooks/useData.js'
|
|
27
|
+
export { useMountEffect } from './hooks/useMountEffect.js'
|
|
28
|
+
export { useTheme, type Theme } from './hooks/useTheme.js'
|
|
29
29
|
|
|
30
30
|
// Lib
|
|
31
|
-
export * from './lib/api'
|
|
32
|
-
export * from './lib/config'
|
|
33
|
-
export { supabase } from './lib/supabase'
|
|
34
|
-
export { cn } from './lib/utils'
|
|
35
|
-
export * from './lib/drag'
|
|
36
|
-
export * from './lib/widgetCache'
|
|
31
|
+
export * from './lib/api.js'
|
|
32
|
+
export * from './lib/config.js'
|
|
33
|
+
export { supabase } from './lib/supabase.js'
|
|
34
|
+
export { cn } from './lib/utils.js'
|
|
35
|
+
export * from './lib/drag.js'
|
|
36
|
+
export * from './lib/widgetCache.js'
|
|
37
37
|
|
|
38
38
|
// Agent runtime (render_ui)
|
|
39
|
-
export { Generative } from './components/widgets/agent/Generative'
|
|
39
|
+
export { Generative } from './components/widgets/agent/Generative.js'
|
|
40
40
|
|
|
41
41
|
// UI primitives (shadcn)
|
|
42
|
-
export { Avatar, AvatarFallback } from './components/ui/avatar'
|
|
43
|
-
export { Badge } from './components/ui/badge'
|
|
44
|
-
export { Button } from './components/ui/button'
|
|
45
|
-
export { Card, CardContent, CardFooter, CardHeader } from './components/ui/card'
|
|
46
|
-
export { InlineEdit } from './components/ui/inline-edit'
|
|
47
|
-
export { Input } from './components/ui/input'
|
|
48
|
-
export { ScrollArea } from './components/ui/scroll-area'
|
|
49
|
-
export { Separator } from './components/ui/separator'
|
|
50
|
-
export { ShellDialog } from './components/ui/shell-dialog'
|
|
51
|
-
export { Skeleton } from './components/ui/skeleton'
|
|
52
|
-
export { Textarea } from './components/ui/textarea'
|
|
42
|
+
export { Avatar, AvatarFallback } from './components/ui/avatar.js'
|
|
43
|
+
export { Badge } from './components/ui/badge.js'
|
|
44
|
+
export { Button } from './components/ui/button.js'
|
|
45
|
+
export { Card, CardContent, CardFooter, CardHeader } from './components/ui/card.js'
|
|
46
|
+
export { InlineEdit } from './components/ui/inline-edit.js'
|
|
47
|
+
export { Input } from './components/ui/input.js'
|
|
48
|
+
export { ScrollArea } from './components/ui/scroll-area.js'
|
|
49
|
+
export { Separator } from './components/ui/separator.js'
|
|
50
|
+
export { ShellDialog } from './components/ui/shell-dialog.js'
|
|
51
|
+
export { Skeleton } from './components/ui/skeleton.js'
|
|
52
|
+
export { Textarea } from './components/ui/textarea.js'
|
package/core-web/src/lib/api.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GATEWAY_URL, INTERNAL_SECRET as SECRET, WS_URL } from './config'
|
|
1
|
+
import { GATEWAY_URL, INTERNAL_SECRET as SECRET, WS_URL } from './config.js'
|
|
2
2
|
|
|
3
3
|
export interface StreamEvent {
|
|
4
4
|
type: 'init' | 'text' | 'tool_use' | 'tool_result' | 'result' | 'error' | 'thinking' | 'auth' | 'pong' | 'shell_refresh'
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* Example augmentation in an app:
|
|
13
13
|
*
|
|
14
|
-
* declare module 'proto/web' {
|
|
14
|
+
* declare module '@tleblancureta/proto/web' {
|
|
15
15
|
* interface ShellContext {
|
|
16
16
|
* cartItems: CartItem[]
|
|
17
17
|
* addToCart: (item: CartItem) => void
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* }
|
|
20
20
|
*/
|
|
21
21
|
import type { ReactNode } from 'react'
|
|
22
|
-
import type { ActiveEntity, WidgetInstance } from '../components/shell/types'
|
|
22
|
+
import type { ActiveEntity, WidgetInstance } from '../components/shell/types.js'
|
|
23
23
|
|
|
24
24
|
export interface ShellContext {
|
|
25
25
|
companyId: string
|
package/dist/core-mcp/src/app.js
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
* Usage:
|
|
9
9
|
*
|
|
10
10
|
* // app/mcp.ts (stdio)
|
|
11
|
-
* import { createProtoMcp } from 'proto/mcp'
|
|
11
|
+
* import { createProtoMcp } from '@tleblancureta/proto/mcp'
|
|
12
12
|
* const app = await createProtoMcp({ name: 'my-app' })
|
|
13
13
|
* await app.stdio()
|
|
14
14
|
*
|
|
15
15
|
* // app/mcp-http.ts (HTTP)
|
|
16
|
-
* import { createProtoMcp } from 'proto/mcp'
|
|
16
|
+
* import { createProtoMcp } from '@tleblancureta/proto/mcp'
|
|
17
17
|
* const app = await createProtoMcp({ name: 'my-app' })
|
|
18
18
|
* await app.http({ port: 8093 })
|
|
19
19
|
*/
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Example (app-space):
|
|
10
10
|
*
|
|
11
|
-
* import { defineTool } from 'proto/mcp'
|
|
11
|
+
* import { defineTool } from '@tleblancureta/proto/mcp'
|
|
12
12
|
* import { z } from 'zod'
|
|
13
13
|
*
|
|
14
14
|
* export default [
|
|
@@ -38,12 +38,17 @@ export interface ToolResult {
|
|
|
38
38
|
}>;
|
|
39
39
|
[key: string]: unknown;
|
|
40
40
|
}
|
|
41
|
+
export interface ToolContext {
|
|
42
|
+
company_id?: string;
|
|
43
|
+
user_id?: string;
|
|
44
|
+
[key: string]: unknown;
|
|
45
|
+
}
|
|
41
46
|
/**
|
|
42
47
|
* Handler signature. Receives validated args (inferred from the Zod schema)
|
|
43
48
|
* and must return an MCP-shaped result. Throwing is allowed — the framework
|
|
44
49
|
* wraps the handler in try/catch and returns a normalized error response.
|
|
45
50
|
*/
|
|
46
|
-
export type ToolHandler<S extends z.ZodRawShape> = (args: z.infer<z.ZodObject<S
|
|
51
|
+
export type ToolHandler<S extends z.ZodRawShape> = (args: z.infer<z.ZodObject<S>>, ctx: ToolContext) => Promise<ToolResult> | ToolResult;
|
|
47
52
|
/**
|
|
48
53
|
* Declarative tool definition. `schema` is a Zod raw shape (the same object
|
|
49
54
|
* you'd pass as the third argument to `server.tool()` today).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-tool.d.ts","sourceRoot":"","sources":["../../../core-mcp/src/define-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC9C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,IAAI,CACjD,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"define-tool.d.ts","sourceRoot":"","sources":["../../../core-mcp/src/define-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC9C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,IAAI,CACjD,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAC7B,GAAG,EAAE,WAAW,KACb,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAAA;AAErC;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW;IACrE,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,CAAC,CAAA;IACT,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,EAChD,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC,GACrB,cAAc,CAAC,CAAC,CAAC,CAEnB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,SAAS,cAAc,EAAE,GAC9B,IAAI,CA8BN"}
|
|
@@ -15,8 +15,12 @@ export function defineTool(def) {
|
|
|
15
15
|
export function registerTools(server, defs) {
|
|
16
16
|
for (const def of defs) {
|
|
17
17
|
server.tool(def.name, def.description, def.schema, async (args) => {
|
|
18
|
+
const ctx = {
|
|
19
|
+
company_id: process.env.COMPANY_ID || undefined,
|
|
20
|
+
user_id: process.env.USER_ID || undefined,
|
|
21
|
+
};
|
|
18
22
|
try {
|
|
19
|
-
return await def.handler(args);
|
|
23
|
+
return await def.handler(args, ctx);
|
|
20
24
|
}
|
|
21
25
|
catch (error) {
|
|
22
26
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-tool.js","sourceRoot":"","sources":["../../../core-mcp/src/define-tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"define-tool.js","sourceRoot":"","sources":["../../../core-mcp/src/define-tool.ts"],"names":[],"mappings":"AAkEA;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,GAAsB;IAEtB,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAiB,EACjB,IAA+B;IAE/B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,CAAC,IAAI,CACT,GAAG,CAAC,IAAI,EACR,GAAG,CAAC,WAAW,EACf,GAAG,CAAC,MAAM,EACV,KAAK,EAAE,IAA6B,EAAE,EAAE;YACtC,MAAM,GAAG,GAAgB;gBACvB,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,SAAS;gBAC/C,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,SAAS;aAC1C,CAAA;YACD,IAAI,CAAC;gBACH,OAAO,MAAM,GAAG,CAAC,OAAO,CAAC,IAAa,EAAE,GAAG,CAAC,CAAA;YAC9C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;gBACtE,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gCACnB,OAAO,EAAE,YAAY,GAAG,CAAC,IAAI,KAAK,OAAO,EAAE;gCAC3C,KAAK,EAAE,IAAI;6BACZ,CAAC;yBACH;qBACF;iBACF,CAAA;YACH,CAAC;QACH,CAAC,CACF,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Apps call this from their tools/index.ts:
|
|
10
10
|
*
|
|
11
|
-
* import { registerEntityTools } from 'proto/mcp'
|
|
11
|
+
* import { registerEntityTools } from '@tleblancureta/proto/mcp'
|
|
12
12
|
* import { ENTITIES } from '../entities/index.js'
|
|
13
13
|
*
|
|
14
14
|
* export function registerAppTools(server) {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Apps call this from their tools/index.ts:
|
|
10
10
|
*
|
|
11
|
-
* import { registerEntityTools } from 'proto/mcp'
|
|
11
|
+
* import { registerEntityTools } from '@tleblancureta/proto/mcp'
|
|
12
12
|
* import { ENTITIES } from '../entities/index.js'
|
|
13
13
|
*
|
|
14
14
|
* export function registerAppTools(server) {
|
|
@@ -3,7 +3,7 @@ export { getSupabase } from './supabase.js';
|
|
|
3
3
|
export { ok, json, err, agent, agentErr } from './tools/_helpers.js';
|
|
4
4
|
export { registerUiTools } from './tools/ui.js';
|
|
5
5
|
export { McpServer };
|
|
6
|
-
export { defineTool, registerTools, type ToolDefinition, type ToolHandler, type ToolResult, } from './define-tool.js';
|
|
6
|
+
export { defineTool, registerTools, type ToolDefinition, type ToolHandler, type ToolResult, type ToolContext, } from './define-tool.js';
|
|
7
7
|
export { buildEntityTools, registerEntityTools } from './entity-tools.js';
|
|
8
8
|
export { buildWorkflowTools, registerWorkflowTools } from './workflow-tools.js';
|
|
9
9
|
export { createProtoMcp, type ProtoMcpOptions } from './app.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core-mcp/src/index.ts"],"names":[],"mappings":"AAe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vE;AAID;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/D;AAID,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,WAAW,EAAE,MAAM,SAAS,CAAA;IAC5B,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAkFjE"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Apps consume this as a library:
|
|
8
8
|
*
|
|
9
|
-
* import { createMcpServer, runStdio } from 'proto/mcp'
|
|
9
|
+
* import { createMcpServer, runStdio } from '@tleblancureta/proto/mcp'
|
|
10
10
|
* const server = createMcpServer({ name: 'my-app' })
|
|
11
11
|
* registerMyTools(server)
|
|
12
12
|
* await runStdio(server)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core-mcp/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAA;AAElG,iCAAiC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC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,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;YAE/B,SAAS,CAAC,OAAO,GAAG,GAAG,EAAE;gBACvB,IAAI,SAAS,CAAC,SAAS;oBAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;YAC/D,CAAC,CAAA;YAED,MAAM,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;YAEvC,IAAI,SAAS,CAAC,SAAS,EAAE,CAAC;gBACxB,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;YAC9C,CAAC;YACD,OAAM;QACR,CAAC;QAED,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;QAClB,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;IAEF,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE;YAChC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,iCAAiC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;YAChE,OAAO,EAAE,CAAA;QACX,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type WidgetDefinition } from './lib/define-widget';
|
|
1
|
+
import { type WidgetDefinition } from './lib/define-widget.js';
|
|
2
2
|
import type { EntityDefinition } from '../../core-shared/src/index.js';
|
|
3
|
-
import type { WidgetInstance } from './components/shell/types';
|
|
3
|
+
import type { WidgetInstance } from './components/shell/types.js';
|
|
4
4
|
export interface ProtoAppProps {
|
|
5
5
|
/** Widget definitions — the core of your app's UI. */
|
|
6
6
|
widgets: WidgetDefinition[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProtoApp.d.ts","sourceRoot":"","sources":["../../../core-web/src/ProtoApp.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ProtoApp.d.ts","sourceRoot":"","sources":["../../../core-web/src/ProtoApp.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAE/E,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAE3B,wDAAwD;IACxD,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAE7B,kFAAkF;IAClF,cAAc,CAAC,EAAE,cAAc,EAAE,CAAA;IAEjC,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IAE1C,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,gCAAgC;IAChC,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CACrC;AAUD,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EAAE,UAAU,EACnB,QAAa,EACb,cAAc,EAAE,kBAAkB,EAClC,cAAc,EAAE,kBAAkB,EAClC,OAAO,EACP,cAAc,EAAE,cAA6B,GAC9C,EAAE,aAAa,2CAmGf"}
|
|
@@ -8,7 +8,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
8
|
*
|
|
9
9
|
* Usage:
|
|
10
10
|
*
|
|
11
|
-
* import { ProtoApp, defineWidget } from 'proto/web'
|
|
11
|
+
* import { ProtoApp, defineWidget } from '@tleblancureta/proto/web'
|
|
12
12
|
*
|
|
13
13
|
* const widgets = [
|
|
14
14
|
* defineWidget({ type: 'items', title: 'Items', ... }),
|
|
@@ -19,11 +19,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
19
19
|
* }
|
|
20
20
|
*/
|
|
21
21
|
import { useState, useCallback, useRef, useMemo } from 'react';
|
|
22
|
-
import Shell from './components/Shell';
|
|
23
|
-
import { useAuth } from './hooks/useAuth';
|
|
24
|
-
import { useTheme } from './hooks/useTheme';
|
|
25
|
-
import { buildWidgetRegistry } from './lib/define-widget';
|
|
26
|
-
import { protoSocket } from './lib/api';
|
|
22
|
+
import Shell from './components/Shell.js';
|
|
23
|
+
import { useAuth } from './hooks/useAuth.js';
|
|
24
|
+
import { useTheme } from './hooks/useTheme.js';
|
|
25
|
+
import { buildWidgetRegistry } from './lib/define-widget.js';
|
|
26
|
+
import { protoSocket } from './lib/api.js';
|
|
27
27
|
function DefaultLogin() {
|
|
28
28
|
return (_jsx("div", { className: "flex h-screen items-center justify-center text-muted-foreground", children: "Please sign in." }));
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProtoApp.js","sourceRoot":"","sources":["../../../core-web/src/ProtoApp.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC9D,OAAO,KAAiC,MAAM,
|
|
1
|
+
{"version":3,"file":"ProtoApp.js","sourceRoot":"","sources":["../../../core-web/src/ProtoApp.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC9D,OAAO,KAAiC,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAyB,MAAM,wBAAwB,CAAA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@@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import 'react-grid-layout/css/styles.css';
|
|
3
|
-
import type { ActiveEntity, WidgetInstance } from './shell/types';
|
|
4
|
-
import type { WidgetRegistry } from '../lib/define-widget';
|
|
5
|
-
export type { WidgetType, ActiveEntity } from './shell/types';
|
|
3
|
+
import type { ActiveEntity, WidgetInstance } from './shell/types.js';
|
|
4
|
+
import type { WidgetRegistry } from '../lib/define-widget.js';
|
|
5
|
+
export type { WidgetType, ActiveEntity } from './shell/types.js';
|
|
6
6
|
export interface CockpitDefinition {
|
|
7
7
|
widgets: WidgetInstance[];
|
|
8
8
|
layouts: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shell.d.ts","sourceRoot":"","sources":["../../../../core-web/src/components/Shell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAG9E,OAAO,kCAAkC,CAAA;AAMzC,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAc,MAAM,
|
|
1
|
+
{"version":3,"file":"Shell.d.ts","sourceRoot":"","sources":["../../../../core-web/src/components/Shell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAG9E,OAAO,kCAAkC,CAAA;AAMzC,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAc,MAAM,kBAAkB,CAAA;AAChF,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE3E,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAgBhE,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,OAAO,EAAE,GAAG,CAAA;CACb;AAED,UAAU,KAAK;IAEb,OAAO,EAAE,cAAc,CAAA;IACvB,cAAc,EAAE,cAAc,EAAE,CAAA;IAChC,cAAc,EAAE,GAAG,C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UAAU,KAAK,CAAC,EAC5B,OAAO,EAAE,cAAc,EACvB,cAAc,EACd,cAAc,EACd,QAAQ,EACR,SAAS,EAAE,UAAU,EAAE,YAAY,EACnC,SAAS,EAAE,cAAc,EACzB,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAClD,YAAY,EAAE,UAAU,EACxB,IAAI,EAAE,SAAS,EAAE,kBAAkB,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EACvE,cAAc,EAAE,aAAa,EAC7B,aAAa,EAAE,QAAQ,GACxB,EAAE,KAAK,2CAkMP"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useCallback, useRef, useMemo } from 'react';
|
|
3
|
-
import { useMountEffect } from '../hooks/useMountEffect';
|
|
3
|
+
import { useMountEffect } from '../hooks/useMountEffect.js';
|
|
4
4
|
import { ResponsiveGridLayout } from 'react-grid-layout';
|
|
5
5
|
import 'react-grid-layout/css/styles.css';
|
|
6
6
|
import { XIcon } from 'lucide-react';
|
|
7
|
-
import { loadShellState, saveShellState, clearShellState } from './shell/persistence';
|
|
8
|
-
import { Toolbar } from './shell/Toolbar';
|
|
9
|
-
import { FocusView } from './shell/FocusView';
|
|
10
|
-
import { EmptyState } from './shell/EmptyState';
|
|
7
|
+
import { loadShellState, saveShellState, clearShellState } from './shell/persistence.js';
|
|
8
|
+
import { Toolbar } from './shell/Toolbar.js';
|
|
9
|
+
import { FocusView } from './shell/FocusView.js';
|
|
10
|
+
import { EmptyState } from './shell/EmptyState.js';
|
|
11
11
|
function useContainerWidth(ref) {
|
|
12
12
|
const [width, setWidth] = useState(800);
|
|
13
13
|
useMountEffect(() => {
|