Skip to content

Commit a9a8980

Browse files
authored
Merge pull request #236 from code0-tech/feat/ai
Integrating ai in project and flow
2 parents 1508e3c + f08c179 commit a9a8980

45 files changed

Lines changed: 1706 additions & 416 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.local

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ EDITION=ce
22
NEXT_PUBLIC_EDITION=ce
33

44
SAGITTARIUS_GRAPHQL_URL=http://localhost:80/graphql
5+
SAGITTARIUS_CABLE_URL=http://localhost:80/cable
56

67
NEXT_PUBLIC_SCULPTOR_VERSION=0.0.0
7-
NEXT_PUBLIC_PICTOR_VERSION=0.10.3
8+
NEXT_PUBLIC_PICTOR_VERSION=0.10.4
89
NEXT_PUBLIC_ALLOWED_REDIRECT_DOMAINS=*.code0.tech,*.codezero.build
910

1011
NEXT_PUBLIC_OTEL_SERVICE_NAME=#"sculptor-client"

next.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import path from "node:path";
33

44
const EDITION = process.env.EDITION ?? "ce";
55
const SAGITTARIUS_GRAPHQL_URL = process.env.SAGITTARIUS_GRAPHQL_URL ?? 'http://localhost:3010/graphql';
6+
const SAGITTARIUS_CABLE_URL = process.env.SAGITTARIUS_CABLE_URL ?? 'http://localhost:3010/cable';
67

78
const cspHeader = `
89
default-src 'self';
@@ -15,7 +16,7 @@ const cspHeader = `
1516
form-action 'self';
1617
frame-ancestors 'none';
1718
worker-src 'self' blob: data: *;
18-
connect-src 'self' ${SAGITTARIUS_GRAPHQL_URL} ${process.env.NEXT_PUBLIC_OTEL_LOGS_ENDPOINT} ${process.env.NEXT_PUBLIC_OTEL_TRACES_ENDPOINT};
19+
connect-src 'self' ${SAGITTARIUS_GRAPHQL_URL} ${SAGITTARIUS_CABLE_URL.replace("http", "ws")} ${process.env.NEXT_PUBLIC_OTEL_LOGS_ENDPOINT} ${process.env.NEXT_PUBLIC_OTEL_TRACES_ENDPOINT};
1920
`
2021

2122
const nextConfig: NextConfig = {
@@ -55,6 +56,10 @@ const nextConfig: NextConfig = {
5556
{
5657
source: '/graphql',
5758
destination: SAGITTARIUS_GRAPHQL_URL // Proxy to Backend
59+
},
60+
{
61+
source: '/cable',
62+
destination: SAGITTARIUS_CABLE_URL // Proxy to Backend
5863
}
5964
];
6065
}

package-lock.json

Lines changed: 149 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
},
1616
"dependencies": {
1717
"@apollo/client": "^4.0.9",
18-
"@code0-tech/pictor": "^0.10.3",
19-
"@code0-tech/triangulum": "^0.22.0",
18+
"@code0-tech/pictor": "^0.10.4",
19+
"@code0-tech/triangulum": "^0.25.0",
2020
"@codemirror/lang-javascript": "^6.2.5",
2121
"@codemirror/lint": "^6.9.5",
22+
"@icons-pack/react-simple-icons": "^13.13.0",
2223
"@opentelemetry/api": "^1.9.1",
2324
"@opentelemetry/context-zone": "^2.6.1",
2425
"@opentelemetry/exporter-logs-otlp-http": "^0.218.0",
@@ -27,11 +28,14 @@
2728
"@opentelemetry/instrumentation-fetch": "^0.218.0",
2829
"@opentelemetry/instrumentation-xml-http-request": "^0.218.0",
2930
"@opentelemetry/sdk-trace-web": "^2.6.1",
31+
"@rails/actioncable": "^8.1.300",
32+
"@types/rails__actioncable": "^8.0.3",
3033
"@uidotdev/usehooks": "^2.4.1",
3134
"@vercel/otel": "^2.1.1",
3235
"@xyflow/react": "^12.11.0",
3336
"date-fns": "^4.1.0",
3437
"graphql": "^16.12.0",
38+
"graphql-ruby-client": "^1.15.1",
3539
"graphql-tag": "^2.12.6",
3640
"ldrs": "^1.1.9",
3741
"lodash": "^4.18.1",

src/app/(flow)/layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {RoleView} from "@edition/role/services/Role.view";
3333
import {useUserSession} from "@edition/user/hooks/User.session.hook";
3434
import {Layout} from "@code0-tech/pictor/dist/components/layout/Layout";
3535
import {ModuleService} from "@edition/module/services/Module.service";
36+
import {AIService, Model} from "@edition/ai/services/AI.service";
3637

3738
export default function FlowLayout({bar, tab, children}: {
3839
bar: React.ReactNode,
@@ -67,7 +68,7 @@ export default function FlowLayout({bar, tab, children}: {
6768
const datatype = usePersistentReactiveArrayService<DataType, DatatypeService>(`dashboard::datatypes::${currentSession?.id}`, (store) => new DatatypeService(graphqlClient, store))
6869
const flowtype = usePersistentReactiveArrayService<FlowType, FlowTypeService>(`dashboard::flowtypes::${currentSession?.id}`, (store) => new FlowTypeService(graphqlClient, store))
6970
const module = usePersistentReactiveArrayService<RuntimeModule, ModuleService>(`dashboard::modules::${currentSession?.id}`, (store) => new ModuleService(graphqlClient, store))
70-
71+
const ai = usePersistentReactiveArrayService<Model, AIService>(`dashboard::ai::${currentSession?.id}`, (store) => new AIService(graphqlClient, store))
7172

7273
const runtimeId = React.useMemo(() => project[1].getById(projectId, {namespaceId})?.primaryRuntime?.id, [projectId, project[0], namespaceId])
7374

@@ -82,7 +83,7 @@ export default function FlowLayout({bar, tab, children}: {
8283
}, [runtimeId, namespaceId, projectId, currentSession, flow, functions, datatype, flowtype])
8384

8485
return <ContextStoreProvider
85-
services={[user, organization, member, namespace, runtime, project, role, flow, functions, datatype, flowtype, module]}>
86+
services={[user, organization, member, namespace, runtime, project, role, flow, functions, datatype, flowtype, module, ai]}>
8687
<Layout layoutGap={0} style={{zIndex: 0}} showLayoutSplitter={false} leftContent={
8788
<Flex p={0.7} pt={1} align={"center"} style={{flexDirection: "column", gap: "0.7rem"}}>
8889
<div style={{

0 commit comments

Comments
 (0)