0pflow 0.1.0-dev.628bd97 → 0.1.0-dev.67aecec
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/__tests__/discover.integration.test.d.ts +2 -0
- package/dist/__tests__/discover.integration.test.d.ts.map +1 -0
- package/dist/__tests__/discover.integration.test.js +137 -0
- package/dist/__tests__/discover.integration.test.js.map +1 -0
- package/dist/__tests__/factory.test.js +13 -0
- package/dist/__tests__/factory.test.js.map +1 -1
- package/dist/__tests__/integration.e2e.test.js +2 -1
- package/dist/__tests__/integration.e2e.test.js.map +1 -1
- package/dist/__tests__/integration.test.js +87 -82
- package/dist/__tests__/integration.test.js.map +1 -1
- package/dist/agent.d.ts +7 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +75 -10
- package/dist/agent.js.map +1 -1
- package/dist/cli/__tests__/discovery.test.js +1 -1
- package/dist/cli/__tests__/discovery.test.js.map +1 -1
- package/dist/cli/app.d.ts +6 -0
- package/dist/cli/app.d.ts.map +1 -1
- package/dist/cli/app.js +31 -0
- package/dist/cli/app.js.map +1 -1
- package/dist/cli/cloud-dev.d.ts +7 -0
- package/dist/cli/cloud-dev.d.ts.map +1 -0
- package/dist/cli/cloud-dev.js +570 -0
- package/dist/cli/cloud-dev.js.map +1 -0
- package/dist/cli/deploy.d.ts +27 -0
- package/dist/cli/deploy.d.ts.map +1 -0
- package/dist/cli/deploy.js +332 -0
- package/dist/cli/deploy.js.map +1 -0
- package/dist/cli/discovery.d.ts +10 -0
- package/dist/cli/discovery.d.ts.map +1 -1
- package/dist/cli/discovery.js +42 -0
- package/dist/cli/discovery.js.map +1 -1
- package/dist/cli/env.d.ts +3 -1
- package/dist/cli/env.d.ts.map +1 -1
- package/dist/cli/env.js +9 -4
- package/dist/cli/env.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +208 -11
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/install.d.ts +4 -0
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +63 -32
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/mcp/config.d.ts +0 -1
- package/dist/cli/mcp/config.d.ts.map +1 -1
- package/dist/cli/mcp/config.js +2 -4
- package/dist/cli/mcp/config.js.map +1 -1
- package/dist/cli/mcp/lib/scaffolding.d.ts +33 -0
- package/dist/cli/mcp/lib/scaffolding.d.ts.map +1 -0
- package/dist/cli/mcp/lib/scaffolding.js +234 -0
- package/dist/cli/mcp/lib/scaffolding.js.map +1 -0
- package/dist/cli/mcp/lib/templates.d.ts +1 -0
- package/dist/cli/mcp/lib/templates.d.ts.map +1 -1
- package/dist/cli/mcp/lib/templates.js.map +1 -1
- package/dist/cli/mcp/tools/createApp.d.ts +1 -0
- package/dist/cli/mcp/tools/createApp.d.ts.map +1 -1
- package/dist/cli/mcp/tools/createApp.js +12 -53
- package/dist/cli/mcp/tools/createApp.js.map +1 -1
- package/dist/cli/mcp/tools/createDatabase.d.ts.map +1 -1
- package/dist/cli/mcp/tools/createDatabase.js +2 -41
- package/dist/cli/mcp/tools/createDatabase.js.map +1 -1
- package/dist/cli/mcp/tools/getConnectionInfo.d.ts +19 -0
- package/dist/cli/mcp/tools/getConnectionInfo.d.ts.map +1 -0
- package/dist/cli/mcp/tools/getConnectionInfo.js +111 -0
- package/dist/cli/mcp/tools/getConnectionInfo.js.map +1 -0
- package/dist/cli/mcp/tools/getRun.d.ts +22 -0
- package/dist/cli/mcp/tools/getRun.d.ts.map +1 -0
- package/dist/cli/mcp/tools/getRun.js +80 -0
- package/dist/cli/mcp/tools/getRun.js.map +1 -0
- package/dist/cli/mcp/tools/getTrace.d.ts +32 -0
- package/dist/cli/mcp/tools/getTrace.d.ts.map +1 -0
- package/dist/cli/mcp/tools/getTrace.js +104 -0
- package/dist/cli/mcp/tools/getTrace.js.map +1 -0
- package/dist/cli/mcp/tools/index.d.ts +94 -1
- package/dist/cli/mcp/tools/index.d.ts.map +1 -1
- package/dist/cli/mcp/tools/index.js +16 -0
- package/dist/cli/mcp/tools/index.js.map +1 -1
- package/dist/cli/mcp/tools/listIntegrations.d.ts +14 -0
- package/dist/cli/mcp/tools/listIntegrations.d.ts.map +1 -0
- package/dist/cli/mcp/tools/listIntegrations.js +53 -0
- package/dist/cli/mcp/tools/listIntegrations.js.map +1 -0
- package/dist/cli/mcp/tools/listRuns.d.ts +21 -0
- package/dist/cli/mcp/tools/listRuns.d.ts.map +1 -0
- package/dist/cli/mcp/tools/listRuns.js +72 -0
- package/dist/cli/mcp/tools/listRuns.js.map +1 -0
- package/dist/cli/mcp/tools/listWorkflows.d.ts +15 -0
- package/dist/cli/mcp/tools/listWorkflows.d.ts.map +1 -0
- package/dist/cli/mcp/tools/listWorkflows.js +45 -0
- package/dist/cli/mcp/tools/listWorkflows.js.map +1 -0
- package/dist/cli/mcp/tools/runNode.d.ts +17 -0
- package/dist/cli/mcp/tools/runNode.d.ts.map +1 -0
- package/dist/cli/mcp/tools/runNode.js +74 -0
- package/dist/cli/mcp/tools/runNode.js.map +1 -0
- package/dist/cli/mcp/tools/runWorkflow.d.ts +16 -0
- package/dist/cli/mcp/tools/runWorkflow.d.ts.map +1 -0
- package/dist/cli/mcp/tools/runWorkflow.js +66 -0
- package/dist/cli/mcp/tools/runWorkflow.js.map +1 -0
- package/dist/cli/mcp/tools/setupAppSchema.d.ts +1 -1
- package/dist/cli/mcp/tools/setupAppSchema.d.ts.map +1 -1
- package/dist/cli/mcp/tools/setupAppSchema.js +11 -132
- package/dist/cli/mcp/tools/setupAppSchema.js.map +1 -1
- package/dist/cli/mcp/tools/utils.d.ts +7 -0
- package/dist/cli/mcp/tools/utils.d.ts.map +1 -0
- package/dist/cli/mcp/tools/utils.js +28 -0
- package/dist/cli/mcp/tools/utils.js.map +1 -0
- package/dist/cli/run.d.ts +2 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +560 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/trace.d.ts +5 -0
- package/dist/cli/trace.d.ts.map +1 -1
- package/dist/cli/trace.js +1 -1
- package/dist/cli/trace.js.map +1 -1
- package/dist/connections/cloud-auth.d.ts +46 -0
- package/dist/connections/cloud-auth.d.ts.map +1 -0
- package/dist/connections/cloud-auth.js +247 -0
- package/dist/connections/cloud-auth.js.map +1 -0
- package/dist/connections/cloud-client.d.ts +25 -0
- package/dist/connections/cloud-client.d.ts.map +1 -0
- package/dist/connections/cloud-client.js +66 -0
- package/dist/connections/cloud-client.js.map +1 -0
- package/dist/connections/cloud-integration-provider.d.ts +22 -0
- package/dist/connections/cloud-integration-provider.d.ts.map +1 -0
- package/dist/connections/cloud-integration-provider.js +42 -0
- package/dist/connections/cloud-integration-provider.js.map +1 -0
- package/dist/connections/connection-labels.d.ts +14 -0
- package/dist/connections/connection-labels.d.ts.map +1 -0
- package/dist/connections/connection-labels.js +46 -0
- package/dist/connections/connection-labels.js.map +1 -0
- package/dist/connections/index.d.ts +12 -0
- package/dist/connections/index.d.ts.map +1 -0
- package/dist/connections/index.js +10 -0
- package/dist/connections/index.js.map +1 -0
- package/dist/connections/integration-provider.d.ts +39 -0
- package/dist/connections/integration-provider.d.ts.map +1 -0
- package/dist/connections/integration-provider.js +20 -0
- package/dist/connections/integration-provider.js.map +1 -0
- package/dist/connections/local-integration-provider.d.ts +29 -0
- package/dist/connections/local-integration-provider.d.ts.map +1 -0
- package/dist/connections/local-integration-provider.js +71 -0
- package/dist/connections/local-integration-provider.js.map +1 -0
- package/dist/connections/nango-client.d.ts +14 -0
- package/dist/connections/nango-client.d.ts.map +1 -0
- package/dist/connections/nango-client.js +51 -0
- package/dist/connections/nango-client.js.map +1 -0
- package/dist/connections/resolver.d.ts +26 -0
- package/dist/connections/resolver.d.ts.map +1 -0
- package/dist/connections/resolver.js +48 -0
- package/dist/connections/resolver.js.map +1 -0
- package/dist/connections/schema.d.ts +8 -0
- package/dist/connections/schema.d.ts.map +1 -0
- package/dist/connections/schema.js +31 -0
- package/dist/connections/schema.js.map +1 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +4 -0
- package/dist/context.js.map +1 -1
- package/dist/dev-ui/api.d.ts +18 -0
- package/dist/dev-ui/api.d.ts.map +1 -0
- package/dist/dev-ui/api.js +273 -0
- package/dist/dev-ui/api.js.map +1 -0
- package/dist/dev-ui/dag/extractor.d.ts +19 -0
- package/dist/dev-ui/dag/extractor.d.ts.map +1 -0
- package/dist/dev-ui/dag/extractor.js +716 -0
- package/dist/dev-ui/dag/extractor.js.map +1 -0
- package/dist/dev-ui/dag/types.d.ts +42 -0
- package/dist/dev-ui/dag/types.d.ts.map +1 -0
- package/dist/dev-ui/dag/types.js +2 -0
- package/dist/dev-ui/dag/types.js.map +1 -0
- package/dist/dev-ui/deploy-api.d.ts +14 -0
- package/dist/dev-ui/deploy-api.d.ts.map +1 -0
- package/dist/dev-ui/deploy-api.js +112 -0
- package/dist/dev-ui/deploy-api.js.map +1 -0
- package/dist/dev-ui/dev-server.d.ts +18 -0
- package/dist/dev-ui/dev-server.d.ts.map +1 -0
- package/dist/dev-ui/dev-server.js +275 -0
- package/dist/dev-ui/dev-server.js.map +1 -0
- package/dist/dev-ui/index.d.ts +3 -0
- package/dist/dev-ui/index.d.ts.map +1 -0
- package/dist/dev-ui/index.js +2 -0
- package/dist/dev-ui/index.js.map +1 -0
- package/dist/dev-ui/pty.d.ts +16 -0
- package/dist/dev-ui/pty.d.ts.map +1 -0
- package/dist/dev-ui/pty.js +87 -0
- package/dist/dev-ui/pty.js.map +1 -0
- package/dist/dev-ui/watcher.d.ts +12 -0
- package/dist/dev-ui/watcher.d.ts.map +1 -0
- package/dist/dev-ui/watcher.js +166 -0
- package/dist/dev-ui/watcher.js.map +1 -0
- package/dist/dev-ui/ws.d.ts +52 -0
- package/dist/dev-ui/ws.d.ts.map +1 -0
- package/dist/dev-ui/ws.js +32 -0
- package/dist/dev-ui/ws.js.map +1 -0
- package/dist/dev-ui-client/assets/index-CNKqwcCH.css +32 -0
- package/dist/dev-ui-client/assets/index-Ccj-QknZ.js +179 -0
- package/dist/dev-ui-client/assets/index-DAKTQEvj.js +1 -0
- package/dist/dev-ui-client/index.html +13 -0
- package/dist/discover.d.ts +15 -0
- package/dist/discover.d.ts.map +1 -0
- package/dist/discover.js +32 -0
- package/dist/discover.js.map +1 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +37 -13
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +1 -0
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +1 -0
- package/dist/node.js.map +1 -1
- package/dist/nodes/agent/executor.d.ts +2 -0
- package/dist/nodes/agent/executor.d.ts.map +1 -1
- package/dist/nodes/agent/executor.js +11 -1
- package/dist/nodes/agent/executor.js.map +1 -1
- package/dist/registry-gen.d.ts +6 -0
- package/dist/registry-gen.d.ts.map +1 -0
- package/dist/registry-gen.js +146 -0
- package/dist/registry-gen.js.map +1 -0
- package/dist/types.d.ts +28 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +18 -1
- package/dist/types.js.map +1 -1
- package/dist/workflow.d.ts +22 -0
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +113 -3
- package/dist/workflow.js.map +1 -1
- package/package.json +30 -6
- package/templates/app/.dockerignore +6 -0
- package/templates/app/.env.example +13 -0
- package/templates/app/Dockerfile +34 -0
- package/templates/app/README.md +29 -0
- package/templates/app/biome.jsonc +81 -0
- package/templates/app/dbos-config.yaml +6 -0
- package/templates/app/drizzle.config.ts +12 -0
- package/templates/app/generated/registry.ts +8 -0
- package/templates/app/next.config.js +13 -0
- package/templates/app/package.json +57 -0
- package/templates/app/postcss.config.js +5 -0
- package/templates/app/public/favicon.ico +0 -0
- package/templates/app/src/app/_components/.gitkeep +0 -0
- package/templates/app/src/app/api/trpc/[trpc]/route.ts +34 -0
- package/templates/app/src/app/api/workflow/[name]/route.ts +37 -0
- package/templates/app/src/app/layout.tsx +29 -0
- package/templates/app/src/app/page.tsx +18 -0
- package/templates/app/src/env.js +46 -0
- package/templates/app/src/instrumentation.ts +6 -0
- package/templates/app/src/lib/pflow.ts +28 -0
- package/templates/app/src/server/api/root.ts +21 -0
- package/templates/app/src/server/api/routers/.gitkeep +0 -0
- package/templates/app/src/server/api/trpc.ts +106 -0
- package/templates/app/src/server/db/index.ts +18 -0
- package/templates/app/src/server/db/schema.ts +14 -0
- package/templates/app/src/styles/globals.css +6 -0
- package/templates/app/src/styles/globals.css.orange +126 -0
- package/templates/app/src/trpc/query-client.ts +25 -0
- package/templates/app/src/trpc/react.tsx +78 -0
- package/templates/app/src/trpc/server.ts +30 -0
- package/templates/app/tsconfig.check.json +23 -0
- package/templates/app/tsconfig.json +42 -0
- package/templates/app/tsconfig.server.json +5 -0
- package/templates/app/tsconfig.test.json +21 -0
package/dist/types.d.ts
CHANGED
|
@@ -8,16 +8,37 @@ export interface Executable<TInput = unknown, TOutput = unknown> {
|
|
|
8
8
|
readonly type: "node" | "agent" | "workflow";
|
|
9
9
|
readonly description: string;
|
|
10
10
|
readonly version?: number;
|
|
11
|
+
readonly integrations?: string[];
|
|
11
12
|
readonly inputSchema: z.ZodType<TInput>;
|
|
12
13
|
readonly outputSchema?: z.ZodType<TOutput>;
|
|
13
14
|
readonly execute: (ctx: WorkflowContext, inputs: TInput) => Promise<TOutput>;
|
|
14
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Credentials returned from a Nango connection.
|
|
18
|
+
* Both `token` and `access_token` return the same value.
|
|
19
|
+
*/
|
|
20
|
+
export declare class ConnectionCredentials {
|
|
21
|
+
token: string;
|
|
22
|
+
connectionConfig: Record<string, unknown>;
|
|
23
|
+
raw: Record<string, unknown>;
|
|
24
|
+
constructor(opts: {
|
|
25
|
+
token: string;
|
|
26
|
+
connectionConfig?: Record<string, unknown>;
|
|
27
|
+
raw?: Record<string, unknown>;
|
|
28
|
+
});
|
|
29
|
+
/** Alias for `token` — matches the common OAuth field name */
|
|
30
|
+
get access_token(): string;
|
|
31
|
+
}
|
|
15
32
|
/**
|
|
16
33
|
* Context passed to workflow/node run functions
|
|
17
34
|
*/
|
|
18
35
|
export interface WorkflowContext {
|
|
36
|
+
/** The name of the workflow this context belongs to */
|
|
37
|
+
readonly workflowName: string;
|
|
19
38
|
/** Run any executable (node, agent, workflow) as a durable step */
|
|
20
39
|
run: <TInput, TOutput>(executable: Executable<TInput, TOutput>, inputs: TInput) => Promise<TOutput>;
|
|
40
|
+
/** Get credentials for a configured integration connection */
|
|
41
|
+
getConnection: (integrationId: string) => Promise<ConnectionCredentials>;
|
|
21
42
|
/** Structured logging */
|
|
22
43
|
log: (message: string, level?: LogLevel) => void;
|
|
23
44
|
}
|
|
@@ -29,8 +50,8 @@ type AnyExecutable = Executable<any, any>;
|
|
|
29
50
|
export interface PflowConfig {
|
|
30
51
|
/** Database connection URL for DBOS durability */
|
|
31
52
|
databaseUrl: string;
|
|
32
|
-
/** Application name (used for
|
|
33
|
-
appName
|
|
53
|
+
/** Application name (used for DB schema naming and connection table) */
|
|
54
|
+
appName: string;
|
|
34
55
|
/** Registered workflows */
|
|
35
56
|
workflows?: Record<string, AnyExecutable>;
|
|
36
57
|
/** Registered agents */
|
|
@@ -39,6 +60,8 @@ export interface PflowConfig {
|
|
|
39
60
|
nodes?: Record<string, AnyExecutable>;
|
|
40
61
|
/** Default model configuration for agents */
|
|
41
62
|
modelConfig?: ModelConfig;
|
|
63
|
+
/** Nango secret key for connection management */
|
|
64
|
+
nangoSecretKey?: string;
|
|
42
65
|
}
|
|
43
66
|
/**
|
|
44
67
|
* The 0pflow instance returned by create0pflow()
|
|
@@ -55,7 +78,9 @@ export interface Pflow {
|
|
|
55
78
|
/** Get a node by name */
|
|
56
79
|
getNode: (name: string) => AnyExecutable | undefined;
|
|
57
80
|
/** Trigger a node by name (wrapped in workflow for durability) */
|
|
58
|
-
triggerNode: <T = unknown>(name: string, inputs: unknown
|
|
81
|
+
triggerNode: <T = unknown>(name: string, inputs: unknown, options?: {
|
|
82
|
+
workflowName?: string;
|
|
83
|
+
}) => Promise<T>;
|
|
59
84
|
/** Shutdown the 0pflow instance and DBOS */
|
|
60
85
|
shutdown: () => Promise<void>;
|
|
61
86
|
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IAC7C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9E;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,GAAG,EAAE,CAAC,MAAM,EAAE,OAAO,EACnB,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtB,yBAAyB;IACzB,GAAG,EAA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AAC;IACvC,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACtC,6CAA6C;IAC7C,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,yCAAyC;IACzC,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;IAC9B,6BAA6B;IAC7B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IACzD,mDAAmD;IACnD,eAAe,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5E,qCAAqC;IACrC,SAAS,EAAE,MAAM,MAAM,EAAE,CAAC;IAC1B,yBAAyB;IACzB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IACrD,kEAAkE;IAClE,WAAW,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7G,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B"}
|
package/dist/types.js
CHANGED
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Credentials returned from a Nango connection.
|
|
3
|
+
* Both `token` and `access_token` return the same value.
|
|
4
|
+
*/
|
|
5
|
+
export class ConnectionCredentials {
|
|
6
|
+
token;
|
|
7
|
+
connectionConfig;
|
|
8
|
+
raw;
|
|
9
|
+
constructor(opts) {
|
|
10
|
+
this.token = opts.token;
|
|
11
|
+
this.connectionConfig = opts.connectionConfig ?? {};
|
|
12
|
+
this.raw = opts.raw ?? {};
|
|
13
|
+
}
|
|
14
|
+
/** Alias for `token` — matches the common OAuth field name */
|
|
15
|
+
get access_token() {
|
|
16
|
+
return this.token;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
2
19
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,MAAM,OAAO,qBAAqB;IAChC,KAAK,CAAS;IACd,gBAAgB,CAA0B;IAC1C,GAAG,CAA0B;IAE7B,YAAY,IAIX;QACC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,IAAI,EAAE,CAAC;QACpD,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED,8DAA8D;IAC9D,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
package/dist/workflow.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { Executable, WorkflowContext } from "./types.js";
|
|
3
|
+
import type { IntegrationProvider } from "./connections/integration-provider.js";
|
|
4
|
+
import type pg from "pg";
|
|
3
5
|
/**
|
|
4
6
|
* Definition for creating a workflow
|
|
5
7
|
*/
|
|
@@ -17,10 +19,30 @@ export interface WorkflowDefinition<TInput, TOutput> {
|
|
|
17
19
|
export interface WorkflowExecutable<TInput = unknown, TOutput = unknown> extends Executable<TInput, TOutput> {
|
|
18
20
|
readonly version: number;
|
|
19
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Configure the workflow runtime (called by factory)
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function configureWorkflowRuntime(sql: pg.Pool | null, integrationProvider: IntegrationProvider | null, appSchema: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* Return type for createNodeWrapper — the executable plus a setter
|
|
29
|
+
* to override the workflow name used for connection resolution.
|
|
30
|
+
*/
|
|
31
|
+
export interface NodeWrapper<TInput = unknown, TOutput = unknown> {
|
|
32
|
+
executable: WorkflowExecutable<TInput, TOutput>;
|
|
33
|
+
setParentWorkflowName: (name: string | undefined) => void;
|
|
34
|
+
}
|
|
20
35
|
/**
|
|
21
36
|
* Factory for creating workflow executables
|
|
22
37
|
*/
|
|
23
38
|
export declare const Workflow: {
|
|
24
39
|
create<TInput, TOutput>(definition: WorkflowDefinition<TInput, TOutput>): WorkflowExecutable<TInput, TOutput>;
|
|
40
|
+
/**
|
|
41
|
+
* Create a wrapper workflow for running a node standalone.
|
|
42
|
+
* Uses the same _parentWorkflowName pattern as Agent.create() so
|
|
43
|
+
* connection resolution uses the real workflow name instead of the
|
|
44
|
+
* synthetic `_node_<name>` wrapper name.
|
|
45
|
+
*/
|
|
46
|
+
createNodeWrapper<TInput, TOutput>(nodeName: string, node: Executable<TInput, TOutput>): NodeWrapper<TInput, TOutput>;
|
|
25
47
|
};
|
|
26
48
|
//# sourceMappingURL=workflow.d.ts.map
|
package/dist/workflow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,K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C,GAC9C,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC;IAoCtC;;;;;OAKG;sBACe,MAAM,EAAE,OAAO,YACrB,MAAM,QACV,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC;CAkChC,CAAC"}
|
package/dist/workflow.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { DBOS } from "@dbos-inc/dbos-sdk";
|
|
2
|
+
import { resolveConnectionId } from "./connections/index.js";
|
|
2
3
|
/**
|
|
3
4
|
* Create a WorkflowContext that wraps calls in DBOS steps for durability
|
|
4
5
|
*/
|
|
5
|
-
function createDurableContext() {
|
|
6
|
+
function createDurableContext(config) {
|
|
7
|
+
let _currentNodeName = "*";
|
|
8
|
+
let _currentIntegrations;
|
|
6
9
|
const ctx = {
|
|
10
|
+
workflowName: config?.workflowName ?? "*",
|
|
7
11
|
run: async (executable, inputs) => {
|
|
8
12
|
// Validate inputs against schema
|
|
9
13
|
const validated = executable.inputSchema.parse(inputs);
|
|
14
|
+
// Track current node for connection resolution
|
|
15
|
+
_currentNodeName = executable.name;
|
|
16
|
+
_currentIntegrations = executable.integrations;
|
|
10
17
|
if (executable.type === "workflow" || executable.type === "agent") {
|
|
11
18
|
// For workflows and agents, call execute directly (they handle their own DBOS registration)
|
|
12
19
|
// This allows proper child workflow tracking
|
|
@@ -15,27 +22,92 @@ function createDurableContext() {
|
|
|
15
22
|
// For nodes, wrap execution in DBOS step for durability
|
|
16
23
|
return DBOS.runStep(async () => executable.execute(ctx, validated), { name: executable.name });
|
|
17
24
|
},
|
|
25
|
+
getConnection: async (integrationId) => {
|
|
26
|
+
if (!config?.sql || !config?.integrationProvider) {
|
|
27
|
+
throw new Error("Connection management not configured. Set NANGO_SECRET_KEY and DATABASE_URL.");
|
|
28
|
+
}
|
|
29
|
+
// Validate that the integration was declared on the current node
|
|
30
|
+
if (_currentIntegrations && !_currentIntegrations.includes(integrationId)) {
|
|
31
|
+
const declared = _currentIntegrations.map(i => `"${i}"`).join(", ");
|
|
32
|
+
throw new Error(`Integration "${integrationId}" is not declared on node "${_currentNodeName}". ` +
|
|
33
|
+
`Declared integrations: [${declared}]. ` +
|
|
34
|
+
`Add "${integrationId}" to the node's integrations array.`);
|
|
35
|
+
}
|
|
36
|
+
const connectionId = await resolveConnectionId(config.sql, config.workflowName, _currentNodeName, integrationId, config.appSchema);
|
|
37
|
+
if (!connectionId) {
|
|
38
|
+
throw new Error(`No connection configured for integration "${integrationId}" ` +
|
|
39
|
+
`(workflow="${config.workflowName}", node="${_currentNodeName}"). ` +
|
|
40
|
+
`Configure it in the Dev UI or set a global default.`);
|
|
41
|
+
}
|
|
42
|
+
return config.integrationProvider.fetchCredentials(integrationId, connectionId);
|
|
43
|
+
},
|
|
18
44
|
log: (message, level = "info") => {
|
|
19
45
|
DBOS.logger[level](message);
|
|
20
46
|
},
|
|
21
47
|
};
|
|
22
48
|
return ctx;
|
|
23
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Runtime config stored on globalThis so it's shared across module instances.
|
|
52
|
+
* This is necessary because jiti-loaded workflow files may import a different
|
|
53
|
+
* copy of this module than the compiled MCP server code that calls
|
|
54
|
+
* configureWorkflowRuntime().
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
const POOL_KEY = Symbol.for("opflow.getWorkflowPool()");
|
|
58
|
+
const PROVIDER_KEY = Symbol.for("opflow.getWorkflowIntegrationProvider()");
|
|
59
|
+
const SCHEMA_KEY = Symbol.for("opflow.getWorkflowAppSchema()");
|
|
60
|
+
function getWorkflowPool() {
|
|
61
|
+
return globalThis[POOL_KEY] ?? null;
|
|
62
|
+
}
|
|
63
|
+
function getWorkflowIntegrationProvider() {
|
|
64
|
+
return globalThis[PROVIDER_KEY] ?? null;
|
|
65
|
+
}
|
|
66
|
+
function getWorkflowAppSchema() {
|
|
67
|
+
return globalThis[SCHEMA_KEY] ?? "public";
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Configure the workflow runtime (called by factory)
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
export function configureWorkflowRuntime(sql, integrationProvider, appSchema) {
|
|
74
|
+
globalThis[POOL_KEY] = sql;
|
|
75
|
+
globalThis[PROVIDER_KEY] = integrationProvider;
|
|
76
|
+
globalThis[SCHEMA_KEY] = appSchema;
|
|
77
|
+
}
|
|
78
|
+
// Global cache for workflow executables to prevent duplicate DBOS registration
|
|
79
|
+
// when bundlers (Turbopack) re-evaluate the same module in multiple chunks.
|
|
80
|
+
const WORKFLOW_CACHE_KEY = Symbol.for("opflow.workflowCache");
|
|
81
|
+
function getWorkflowCache() {
|
|
82
|
+
const g = globalThis;
|
|
83
|
+
if (!g[WORKFLOW_CACHE_KEY])
|
|
84
|
+
g[WORKFLOW_CACHE_KEY] = new Map();
|
|
85
|
+
return g[WORKFLOW_CACHE_KEY];
|
|
86
|
+
}
|
|
24
87
|
/**
|
|
25
88
|
* Factory for creating workflow executables
|
|
26
89
|
*/
|
|
27
90
|
export const Workflow = {
|
|
28
91
|
create(definition) {
|
|
92
|
+
// Return cached executable if already registered (bundler re-evaluation)
|
|
93
|
+
const cached = getWorkflowCache().get(definition.name);
|
|
94
|
+
if (cached)
|
|
95
|
+
return cached;
|
|
29
96
|
// Create the DBOS-registered workflow function
|
|
30
97
|
async function workflowImpl(inputs) {
|
|
31
|
-
const ctx = createDurableContext(
|
|
98
|
+
const ctx = createDurableContext({
|
|
99
|
+
sql: getWorkflowPool(),
|
|
100
|
+
integrationProvider: getWorkflowIntegrationProvider(),
|
|
101
|
+
workflowName: definition.name,
|
|
102
|
+
appSchema: getWorkflowAppSchema(),
|
|
103
|
+
});
|
|
32
104
|
return definition.run(ctx, inputs);
|
|
33
105
|
}
|
|
34
106
|
// Register with DBOS (returns callable function)
|
|
35
107
|
const durableWorkflow = DBOS.registerWorkflow(workflowImpl, {
|
|
36
108
|
name: definition.name,
|
|
37
109
|
});
|
|
38
|
-
|
|
110
|
+
const executable = {
|
|
39
111
|
name: definition.name,
|
|
40
112
|
type: "workflow",
|
|
41
113
|
description: definition.description,
|
|
@@ -45,6 +117,44 @@ export const Workflow = {
|
|
|
45
117
|
// execute ignores the ctx param and uses DBOS context instead
|
|
46
118
|
execute: (_ctx, inputs) => durableWorkflow(inputs),
|
|
47
119
|
};
|
|
120
|
+
getWorkflowCache().set(definition.name, executable);
|
|
121
|
+
return executable;
|
|
122
|
+
},
|
|
123
|
+
/**
|
|
124
|
+
* Create a wrapper workflow for running a node standalone.
|
|
125
|
+
* Uses the same _parentWorkflowName pattern as Agent.create() so
|
|
126
|
+
* connection resolution uses the real workflow name instead of the
|
|
127
|
+
* synthetic `_node_<name>` wrapper name.
|
|
128
|
+
*/
|
|
129
|
+
createNodeWrapper(nodeName, node) {
|
|
130
|
+
const wrapperName = `_node_${nodeName}`;
|
|
131
|
+
// Parent workflow name for connection resolution (same pattern as Agent)
|
|
132
|
+
let _parentWorkflowName;
|
|
133
|
+
async function wrapperImpl(inputs) {
|
|
134
|
+
const ctx = createDurableContext({
|
|
135
|
+
sql: getWorkflowPool(),
|
|
136
|
+
integrationProvider: getWorkflowIntegrationProvider(),
|
|
137
|
+
workflowName: _parentWorkflowName ?? wrapperName,
|
|
138
|
+
appSchema: getWorkflowAppSchema(),
|
|
139
|
+
});
|
|
140
|
+
_parentWorkflowName = undefined;
|
|
141
|
+
return ctx.run(node, inputs);
|
|
142
|
+
}
|
|
143
|
+
const durableWrapper = DBOS.registerWorkflow(wrapperImpl, {
|
|
144
|
+
name: wrapperName,
|
|
145
|
+
});
|
|
146
|
+
return {
|
|
147
|
+
executable: {
|
|
148
|
+
name: wrapperName,
|
|
149
|
+
type: "workflow",
|
|
150
|
+
description: `Wrapper workflow for node ${nodeName}`,
|
|
151
|
+
version: 1,
|
|
152
|
+
inputSchema: node.inputSchema,
|
|
153
|
+
outputSchema: node.outputSchema,
|
|
154
|
+
execute: (_ctx, inputs) => durableWrapper(inputs),
|
|
155
|
+
},
|
|
156
|
+
setParentWorkflowName: (name) => { _parentWorkflowName = name; },
|
|
157
|
+
};
|
|
48
158
|
},
|
|
49
159
|
};
|
|
50
160
|
//# sourceMappingURL=workflow.js.map
|
package/dist/workflow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAkC7D;;GAEG;AACH,SAAS,oBAAoB,CAAC,MAA8B;IAC1D,IAAI,gBAAgB,GAAG,GAAG,CAAC;IAC3B,IAAI,oBAA0C,CAAC;IAE/C,MAAM,GAAG,GAAoB;QAC3B,YAAY,EAAE,MAAM,EAAE,YAAY,IAAI,GAAG;QAEzC,GAAG,EAAE,KAAK,EACR,UAAuC,EACvC,MAAc,EACI,EAAE;YACpB,iCAAiC;YACjC,MAAM,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAEvD,+CAA+C;YAC/C,gBAAgB,GAAG,UAAU,CAAC,IAAI,CAAC;YACnC,oBAAoB,GAAG,UAAU,CAAC,YAAY,CAAC;YAE/C,IAAI,UAAU,CAAC,IAAI,KAAK,UAAU,IAAI,UAAU,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBAClE,4FAA4F;gBAC5F,6CAA6C;gBAC7C,OAAO,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;YAC5C,CAAC;YAED,wDAAwD;YACxD,OAAO,IAAI,CAAC,OAAO,CACjB,KAAK,IAAI,EAAE,CAAC,UAAU,CAA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C,MAAM,GAAG,GAAG,oBAAoB,CAAC;gBAC/B,GAAG,EAAE,eAAe,EAAE;gBACtB,mBAAmB,EAAE,8BAA8B,EAAE;gBACrD,YAAY,EAAE,mBAAmB,IAAI,WAAW;gBAChD,SAAS,EAAE,oBAAoB,EAAE;aAClC,CAAC,CAAC;YACH,mBAAmB,GAAG,SAAS,CAAC;YAChC,OAAO,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/B,CAAC;QAED,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE;YACxD,IAAI,EAAE,WAAW;SAClB,CAAC,CAAC;QAEH,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,6BAA6B,QAAQ,EAAE;gBACpD,OAAO,EAAE,CAAC;gBACV,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,OAAO,EAAE,CAAC,IAAqB,EAAE,MAAc,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC;aAC3E;YACD,qBAAqB,EAAE,CAAC,IAAI,EAAE,EAAE,GAAG,mBAAmB,GAAG,IAAI,CAAC,CAAC,CAAC;SACjE,CAAC;IACJ,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "0pflow",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.67aecec",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,20 +18,24 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
-
"dist"
|
|
21
|
+
"dist",
|
|
22
|
+
"templates"
|
|
22
23
|
],
|
|
23
24
|
"scripts": {
|
|
24
|
-
"build": "tsc",
|
|
25
|
+
"build": "tsc --build && vite build dev-ui && chmod +x dist/cli/index.js",
|
|
25
26
|
"test": "vitest run",
|
|
26
27
|
"test:watch": "vitest"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
30
|
"@ai-sdk/anthropic": "^3.0.23",
|
|
30
31
|
"@ai-sdk/openai": "^3.0.19",
|
|
32
|
+
"@clack/prompts": "^1.0.1",
|
|
31
33
|
"@dbos-inc/dbos-sdk": "^4.7.9",
|
|
32
34
|
"@mozilla/readability": "^0.6.0",
|
|
33
|
-
"@
|
|
35
|
+
"@nangohq/node": "^0.45.0",
|
|
36
|
+
"@tigerdata/mcp-boilerplate": "^1.1.0",
|
|
34
37
|
"ai": "^6.0.49",
|
|
38
|
+
"chokidar": "^4.0.0",
|
|
35
39
|
"cli-table3": "^0.6.5",
|
|
36
40
|
"commander": "^14.0.2",
|
|
37
41
|
"dotenv": "^17.2.3",
|
|
@@ -39,14 +43,34 @@
|
|
|
39
43
|
"handlebars": "^4.7.8",
|
|
40
44
|
"jiti": "^2.6.1",
|
|
41
45
|
"linkedom": "^0.18.12",
|
|
46
|
+
"node-pty": "1.2.0-beta.11",
|
|
42
47
|
"pg": "^8.17.2",
|
|
43
48
|
"picocolors": "^1.1.1",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
49
|
+
"react-markdown": "^10.1.0",
|
|
50
|
+
"roughjs": "^4.6.6",
|
|
51
|
+
"tree-sitter-typescript": "^0.23.2",
|
|
52
|
+
"web-tree-sitter": "^0.24.7",
|
|
53
|
+
"ws": "^8.18.0",
|
|
54
|
+
"zod": "^4.3.5"
|
|
46
55
|
},
|
|
47
56
|
"devDependencies": {
|
|
57
|
+
"@nangohq/frontend": "^0.69.0",
|
|
58
|
+
"@tailwindcss/vite": "^4.0.0",
|
|
48
59
|
"@types/pg": "^8.16.0",
|
|
60
|
+
"@types/react": "^19.0.0",
|
|
61
|
+
"@types/react-dom": "^19.0.0",
|
|
62
|
+
"@types/ws": "^8.5.0",
|
|
63
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
64
|
+
"@xterm/addon-fit": "^0.11.0",
|
|
65
|
+
"@xterm/addon-web-links": "^0.12.0",
|
|
66
|
+
"@xterm/xterm": "^6.0.0",
|
|
67
|
+
"@xyflow/react": "^12.0.0",
|
|
68
|
+
"react": "^19.0.0",
|
|
69
|
+
"react-dom": "^19.0.0",
|
|
70
|
+
"tailwindcss": "^4.0.0",
|
|
71
|
+
"tsx": "^4.21.0",
|
|
49
72
|
"typescript": "^5.9.3",
|
|
73
|
+
"vite": "^6.0.0",
|
|
50
74
|
"vitest": "^4.0.15"
|
|
51
75
|
}
|
|
52
76
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Since the ".env" file is gitignored, you can use the ".env.example" file to
|
|
2
|
+
# build a new ".env" file when you clone the repo. Keep this file up-to-date
|
|
3
|
+
# when you add new variables to `.env`.
|
|
4
|
+
|
|
5
|
+
# This file will be committed to version control, so make sure not to have any
|
|
6
|
+
# secrets in it. If you are cloning this repo, create a copy of this file named
|
|
7
|
+
# ".env" and populate it with your secrets.
|
|
8
|
+
|
|
9
|
+
# When adding additional environment variables, the schema in "/src/env.js"
|
|
10
|
+
# should be updated accordingly.
|
|
11
|
+
|
|
12
|
+
# Drizzle
|
|
13
|
+
DATABASE_URL="postgresql://postgres:password@localhost:5432/{{app_name}}"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
FROM node:22-alpine AS base
|
|
2
|
+
|
|
3
|
+
# --- Dependencies ---
|
|
4
|
+
FROM base AS deps
|
|
5
|
+
WORKDIR /app
|
|
6
|
+
COPY package.json ./
|
|
7
|
+
RUN npm install
|
|
8
|
+
|
|
9
|
+
# --- Builder ---
|
|
10
|
+
FROM base AS builder
|
|
11
|
+
WORKDIR /app
|
|
12
|
+
COPY --from=deps /app/node_modules ./node_modules
|
|
13
|
+
COPY . .
|
|
14
|
+
ENV NODE_ENV=production
|
|
15
|
+
ENV SKIP_ENV_VALIDATION=1
|
|
16
|
+
RUN npm run build
|
|
17
|
+
|
|
18
|
+
# --- Runner ---
|
|
19
|
+
FROM base AS runner
|
|
20
|
+
WORKDIR /app
|
|
21
|
+
ENV NODE_ENV=production
|
|
22
|
+
|
|
23
|
+
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
|
|
24
|
+
|
|
25
|
+
COPY --from=builder /app/public ./public
|
|
26
|
+
COPY --from=builder /app/specs ./specs
|
|
27
|
+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
|
28
|
+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
29
|
+
|
|
30
|
+
USER nextjs
|
|
31
|
+
EXPOSE 3000
|
|
32
|
+
ENV PORT=3000
|
|
33
|
+
ENV HOSTNAME="0.0.0.0"
|
|
34
|
+
CMD ["node", "server.js"]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# {{app_name}}
|
|
2
|
+
|
|
3
|
+
Built with [T3 Stack](https://create.t3.gg/).
|
|
4
|
+
|
|
5
|
+
## What's next? How do I make an app with this?
|
|
6
|
+
|
|
7
|
+
We try to keep this project as simple as possible, so you can start with just the scaffolding we set up for you, and add additional things later when they become necessary.
|
|
8
|
+
|
|
9
|
+
If you are not familiar with the different technologies used in this project, please refer to the respective docs. If you still are in the wind, please join our [Discord](https://t3.gg/discord) and ask for help.
|
|
10
|
+
|
|
11
|
+
- [Next.js](https://nextjs.org)
|
|
12
|
+
- [NextAuth.js](https://next-auth.js.org)
|
|
13
|
+
- [Prisma](https://prisma.io)
|
|
14
|
+
- [Drizzle](https://orm.drizzle.team)
|
|
15
|
+
- [Tailwind CSS](https://tailwindcss.com)
|
|
16
|
+
- [tRPC](https://trpc.io)
|
|
17
|
+
|
|
18
|
+
## Learn More
|
|
19
|
+
|
|
20
|
+
To learn more about the [T3 Stack](https://create.t3.gg/), take a look at the following resources:
|
|
21
|
+
|
|
22
|
+
- [Documentation](https://create.t3.gg/)
|
|
23
|
+
- [Learn the T3 Stack](https://create.t3.gg/en/faq#what-learning-resources-are-currently-available) — Check out these awesome tutorials
|
|
24
|
+
|
|
25
|
+
You can check out the [create-t3-app GitHub repository](https://github.com/t3-oss/create-t3-app) — your feedback and contributions are welcome!
|
|
26
|
+
|
|
27
|
+
## How do I deploy this?
|
|
28
|
+
|
|
29
|
+
Follow our deployment guides for [Vercel](https://create.t3.gg/en/deployment/vercel), [Netlify](https://create.t3.gg/en/deployment/netlify) and [Docker](https://create.t3.gg/en/deployment/docker) for more information.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
|
3
|
+
"root": true,
|
|
4
|
+
"vcs": {
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"useIgnoreFile": true,
|
|
7
|
+
"clientKind": "git"
|
|
8
|
+
},
|
|
9
|
+
"assist": {
|
|
10
|
+
"enabled": true,
|
|
11
|
+
"actions": {
|
|
12
|
+
"recommended": true,
|
|
13
|
+
"source": {
|
|
14
|
+
"recommended": true,
|
|
15
|
+
"organizeImports": "on",
|
|
16
|
+
"useSortedAttributes": "on"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"formatter": {
|
|
21
|
+
"enabled": true,
|
|
22
|
+
"indentStyle": "space",
|
|
23
|
+
"indentWidth": 2
|
|
24
|
+
},
|
|
25
|
+
"linter": {
|
|
26
|
+
"enabled": true,
|
|
27
|
+
"rules": {
|
|
28
|
+
"recommended": true,
|
|
29
|
+
"correctness": {
|
|
30
|
+
"noUnusedImports": {
|
|
31
|
+
"level": "error",
|
|
32
|
+
"fix": "safe"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"nursery": {
|
|
36
|
+
"useSortedClasses": {
|
|
37
|
+
"level": "warn",
|
|
38
|
+
"fix": "safe",
|
|
39
|
+
"options": {
|
|
40
|
+
"functions": [
|
|
41
|
+
"clsx",
|
|
42
|
+
"cva",
|
|
43
|
+
"cn"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"html": {
|
|
51
|
+
"formatter": {
|
|
52
|
+
"enabled": true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"javascript": {
|
|
56
|
+
"assist": {
|
|
57
|
+
"enabled": true
|
|
58
|
+
},
|
|
59
|
+
"formatter": {
|
|
60
|
+
"enabled": true
|
|
61
|
+
},
|
|
62
|
+
"linter": {
|
|
63
|
+
"enabled": true
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"css": {
|
|
67
|
+
"assist": {
|
|
68
|
+
"enabled": true
|
|
69
|
+
},
|
|
70
|
+
"formatter": {
|
|
71
|
+
"enabled": true
|
|
72
|
+
},
|
|
73
|
+
"linter": {
|
|
74
|
+
"enabled": true
|
|
75
|
+
},
|
|
76
|
+
"parser": {
|
|
77
|
+
"cssModules": true,
|
|
78
|
+
"tailwindDirectives": true
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Config } from "drizzle-kit";
|
|
2
|
+
|
|
3
|
+
import { env } from "~/env";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
schema: "./src/server/db/schema.ts",
|
|
7
|
+
dialect: "postgresql",
|
|
8
|
+
dbCredentials: {
|
|
9
|
+
url: env.DATABASE_URL,
|
|
10
|
+
},
|
|
11
|
+
schemaFilter: [env.DATABASE_SCHEMA],
|
|
12
|
+
} satisfies Config;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
|
|
3
|
+
* for Docker builds.
|
|
4
|
+
*/
|
|
5
|
+
import "./src/env.js";
|
|
6
|
+
|
|
7
|
+
/** @type {import("next").NextConfig} */
|
|
8
|
+
const config = {
|
|
9
|
+
output: "standalone",
|
|
10
|
+
serverExternalPackages: ["@dbos-inc/dbos-sdk"],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default config;
|