create-flowdular 0.2.0 → 0.2.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/README.md +4 -2
- package/dist/bin.js +36 -22
- package/package.json +1 -1
- package/template/default/README.md +1 -1
- package/template/default/flowdular.json +19 -3
- package/template/default/modules/example/package.json +1 -1
- package/template/default/package.json +1 -1
- package/template/default/platform/package.json +1 -1
- package/template/default/platform/src/generated/modules.client.ts +17 -1
- package/template/default/platform/src/generated/modules.server.ts +59 -0
package/README.md
CHANGED
|
@@ -20,11 +20,13 @@ cd my-app
|
|
|
20
20
|
For this new local application, initialize demo authentication and start the development server:
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
|
-
pnpm flowdular setup
|
|
23
|
+
pnpm flowdular setup
|
|
24
24
|
pnpm dev
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Open [localhost:4310](http://localhost:4310). `setup
|
|
27
|
+
Open [localhost:4310](http://localhost:4310). `setup` opens an interactive wizard for a local demo, PostgreSQL settings or a configuration check. It asks before resetting the local demo database.
|
|
28
|
+
|
|
29
|
+
The starter enables all nine platform modules: system, authentication, users, profile, agents, automations, workflows, their integration, and sandbox access. Local demo setup grants their declared permissions to demo owners. The example module stays available as a starting point; business modules from Official Modules are optional downloads.
|
|
28
30
|
|
|
29
31
|
`npm create` launches the generator. The generated application uses **pnpm workspaces**. If pnpm is unavailable during installation, the generator invokes its pinned version through `npm exec`.
|
|
30
32
|
|
package/dist/bin.js
CHANGED
|
@@ -244,6 +244,7 @@ function installDependencies(packageManager, directory) {
|
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
// src/report.ts
|
|
247
|
+
import { styleText } from "node:util";
|
|
247
248
|
var DEV_URL = "http://localhost:4310";
|
|
248
249
|
function runScript(packageManager, script, ...arguments_) {
|
|
249
250
|
if (arguments_.length === 0) {
|
|
@@ -256,26 +257,30 @@ function nextSteps(input) {
|
|
|
256
257
|
return [
|
|
257
258
|
`cd ${input.directory}`,
|
|
258
259
|
...input.installed ? [] : [`${input.packageManager} install`],
|
|
259
|
-
runScript(
|
|
260
|
-
input.packageManager,
|
|
261
|
-
"flowdular",
|
|
262
|
-
"setup",
|
|
263
|
-
"quick",
|
|
264
|
-
"--apply",
|
|
265
|
-
"--confirm",
|
|
266
|
-
"reset-local-auth"
|
|
267
|
-
),
|
|
260
|
+
runScript(input.packageManager, "flowdular", "setup"),
|
|
268
261
|
runScript(input.packageManager, "dev")
|
|
269
262
|
];
|
|
270
263
|
}
|
|
271
|
-
function renderNextSteps(input) {
|
|
264
|
+
function renderNextSteps(input, color = false) {
|
|
265
|
+
const paint = (text, format) => color ? styleText(format, text, { validateStream: false }) : text;
|
|
266
|
+
const labels = [
|
|
267
|
+
"Open your project",
|
|
268
|
+
...input.installed ? [] : ["Install dependencies"],
|
|
269
|
+
"Choose local demo or PostgreSQL",
|
|
270
|
+
"Start your app"
|
|
271
|
+
];
|
|
272
272
|
return [
|
|
273
273
|
"",
|
|
274
|
-
"
|
|
275
|
-
"",
|
|
276
|
-
...nextSteps(input).map((step) => ` ${step}`),
|
|
274
|
+
` ${paint("FLOWDULAR", "bold")} ${paint("Project created", "green")}`,
|
|
277
275
|
"",
|
|
278
|
-
|
|
276
|
+
...nextSteps(input).flatMap((step, index) => [
|
|
277
|
+
` ${paint(`${index + 1}.`, "cyan")} ${labels[index]}`,
|
|
278
|
+
` ${paint(step, "bold")}`,
|
|
279
|
+
""
|
|
280
|
+
]),
|
|
281
|
+
` ${paint("Local URL", "dim")} ${paint(DEV_URL, "cyan")}`,
|
|
282
|
+
` ${paint("Demo login", "dim")} admin@example.com`,
|
|
283
|
+
` ${paint("Demo account is created only with local demo setup.", "dim")}`,
|
|
279
284
|
""
|
|
280
285
|
].join("\n");
|
|
281
286
|
}
|
|
@@ -313,20 +318,23 @@ var SECRET_KEYS = [
|
|
|
313
318
|
function generateSecrets() {
|
|
314
319
|
const secrets = {};
|
|
315
320
|
for (const key of SECRET_KEYS)
|
|
316
|
-
secrets[key] = randomBytes(32).toString(
|
|
321
|
+
secrets[key] = randomBytes(32).toString(
|
|
322
|
+
key === "FD_AUTH_MFA_KEY" ? "base64url" : "base64"
|
|
323
|
+
);
|
|
317
324
|
return secrets;
|
|
318
325
|
}
|
|
319
326
|
function renderEnvironmentFile(secrets) {
|
|
320
327
|
return [
|
|
321
328
|
"# Local configuration for this Flowdular app. Never commit it.",
|
|
322
|
-
"# Regenerate
|
|
329
|
+
"# Regenerate service keys with: openssl rand -base64 32",
|
|
330
|
+
"# For FD_AUTH_MFA_KEY use: openssl rand -hex 32",
|
|
323
331
|
"",
|
|
324
332
|
"# Local development runs on embedded PostgreSQL, so there is no server to",
|
|
325
333
|
"# install and no connection string to configure. A deployment sets",
|
|
326
334
|
"# FD_DATABASE_ADAPTER=postgresql and the FD_DATABASE_* URLs instead.",
|
|
327
335
|
"FD_DATABASE_ADAPTER=pglite",
|
|
328
336
|
"",
|
|
329
|
-
"#
|
|
337
|
+
"# 32 byte keys, generated once for this app; MFA uses base64url.",
|
|
330
338
|
...SECRET_KEYS.map((key) => `${key}=${secrets[key]}`),
|
|
331
339
|
""
|
|
332
340
|
].join("\n");
|
|
@@ -441,6 +449,9 @@ async function scaffold(request) {
|
|
|
441
449
|
|
|
442
450
|
// src/index.ts
|
|
443
451
|
var processIo = {
|
|
452
|
+
color: Boolean(
|
|
453
|
+
process.stdout.isTTY && process.stdout.hasColors?.() && !("NO_COLOR" in process.env) && !process.env.CI
|
|
454
|
+
),
|
|
444
455
|
cwd: process.cwd(),
|
|
445
456
|
out: (text) => process.stdout.write(text),
|
|
446
457
|
err: (text) => process.stderr.write(text)
|
|
@@ -513,11 +524,14 @@ async function run(argv, io = processIo) {
|
|
|
513
524
|
}
|
|
514
525
|
const here = relative2(io.cwd, result.directory);
|
|
515
526
|
io.out(
|
|
516
|
-
renderNextSteps(
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
527
|
+
renderNextSteps(
|
|
528
|
+
{
|
|
529
|
+
directory: here.length > 0 ? here : ".",
|
|
530
|
+
packageManager,
|
|
531
|
+
installed
|
|
532
|
+
},
|
|
533
|
+
io.color
|
|
534
|
+
)
|
|
521
535
|
);
|
|
522
536
|
return 0;
|
|
523
537
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "./node_modules/@flowdular/contracts/schemas/project.schema.json",
|
|
2
|
+
"$schema": "./platform/node_modules/@flowdular/sdk/packages/contracts/schemas/project.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
4
|
"architectureVersion": "0.2.0",
|
|
5
5
|
"specs": {
|
|
@@ -8,7 +8,23 @@
|
|
|
8
8
|
},
|
|
9
9
|
"modules": {
|
|
10
10
|
"roots": ["modules"],
|
|
11
|
-
"enabled": [
|
|
11
|
+
"enabled": [
|
|
12
|
+
"system.core",
|
|
13
|
+
"auth.core",
|
|
14
|
+
"agents.core",
|
|
15
|
+
"automations.core",
|
|
16
|
+
"workflows.core",
|
|
17
|
+
"automations-workflows.integration",
|
|
18
|
+
"example.core",
|
|
19
|
+
"profile.core",
|
|
20
|
+
"sandbox.core",
|
|
21
|
+
"users.core"
|
|
22
|
+
]
|
|
12
23
|
},
|
|
13
|
-
"locales": ["en", "pl"]
|
|
24
|
+
"locales": ["en", "pl"],
|
|
25
|
+
"agent": {
|
|
26
|
+
"policy": "platform/node_modules/@flowdular/sdk/.ai/policies/capabilities.yaml",
|
|
27
|
+
"modelRouting": "platform/node_modules/@flowdular/sdk/.ai/policies/model-routing.yaml",
|
|
28
|
+
"blueprints": "platform/node_modules/@flowdular/sdk/.ai/blueprints"
|
|
29
|
+
}
|
|
14
30
|
}
|
|
@@ -7,10 +7,26 @@ import type {
|
|
|
7
7
|
} from '@flowdular/sdk/client';
|
|
8
8
|
import { createClientContribution as system_core } from '@flowdular/sdk/modules/system/client';
|
|
9
9
|
import { createClientContribution as auth_core } from '@flowdular/sdk/modules/auth/client';
|
|
10
|
+
import { createClientContribution as agents_core } from '@flowdular/sdk/modules/agents/client';
|
|
11
|
+
import { createClientContribution as automations_core } from '@flowdular/sdk/modules/automations/client';
|
|
12
|
+
import { createClientContribution as workflows_core } from '@flowdular/sdk/modules/workflows/client';
|
|
10
13
|
import { createClientContribution as example_core } from '@app/module-example/client';
|
|
14
|
+
import { createClientContribution as profile_core } from '@flowdular/sdk/modules/profile/client';
|
|
15
|
+
import { createClientContribution as sandbox_core } from '@flowdular/sdk/modules/sandbox/client';
|
|
16
|
+
import { createClientContribution as users_core } from '@flowdular/sdk/modules/users/client';
|
|
11
17
|
|
|
12
18
|
export function createModuleClientContributions(
|
|
13
19
|
context: ModuleClientContext,
|
|
14
20
|
): readonly ModuleClientContribution[] {
|
|
15
|
-
return [
|
|
21
|
+
return [
|
|
22
|
+
system_core(context),
|
|
23
|
+
auth_core(context),
|
|
24
|
+
agents_core(context),
|
|
25
|
+
automations_core(context),
|
|
26
|
+
workflows_core(context),
|
|
27
|
+
example_core(context),
|
|
28
|
+
profile_core(context),
|
|
29
|
+
sandbox_core(context),
|
|
30
|
+
users_core(context),
|
|
31
|
+
];
|
|
16
32
|
}
|
|
@@ -6,7 +6,14 @@ import type {
|
|
|
6
6
|
} from '@flowdular/sdk/modules/auth/server';
|
|
7
7
|
import type { WebMount } from '@flowdular/sdk/server';
|
|
8
8
|
import { createServerComposition as system_core } from '@flowdular/sdk/modules/system/platform';
|
|
9
|
+
import { createServerComposition as agents_core } from '@flowdular/sdk/modules/agents/platform';
|
|
10
|
+
import { createServerComposition as automations_core } from '@flowdular/sdk/modules/automations/platform';
|
|
11
|
+
import { createServerComposition as workflows_core } from '@flowdular/sdk/modules/workflows/platform';
|
|
12
|
+
import { createServerComposition as automations_workflows_integration } from '@flowdular/sdk/modules/automations-workflows-integration/platform';
|
|
9
13
|
import { createServerComposition as example_core } from '@app/module-example/platform';
|
|
14
|
+
import { createServerComposition as profile_core } from '@flowdular/sdk/modules/profile/platform';
|
|
15
|
+
import { createServerComposition as sandbox_core } from '@flowdular/sdk/modules/sandbox/platform';
|
|
16
|
+
import { createServerComposition as users_core } from '@flowdular/sdk/modules/users/platform';
|
|
10
17
|
|
|
11
18
|
export function composeModuleServer(
|
|
12
19
|
context: PlatformServerContext,
|
|
@@ -19,6 +26,37 @@ export function composeModuleServer(
|
|
|
19
26
|
}),
|
|
20
27
|
moduleId: 'system.core',
|
|
21
28
|
},
|
|
29
|
+
{
|
|
30
|
+
...agents_core({
|
|
31
|
+
...context,
|
|
32
|
+
agentDefinitions: context.agentDefinitions.forModule('agents.core'),
|
|
33
|
+
}),
|
|
34
|
+
moduleId: 'agents.core',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
...automations_core({
|
|
38
|
+
...context,
|
|
39
|
+
agentDefinitions:
|
|
40
|
+
context.agentDefinitions.forModule('automations.core'),
|
|
41
|
+
}),
|
|
42
|
+
moduleId: 'automations.core',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
...workflows_core({
|
|
46
|
+
...context,
|
|
47
|
+
agentDefinitions: context.agentDefinitions.forModule('workflows.core'),
|
|
48
|
+
}),
|
|
49
|
+
moduleId: 'workflows.core',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
...automations_workflows_integration({
|
|
53
|
+
...context,
|
|
54
|
+
agentDefinitions: context.agentDefinitions.forModule(
|
|
55
|
+
'automations-workflows.integration',
|
|
56
|
+
),
|
|
57
|
+
}),
|
|
58
|
+
moduleId: 'automations-workflows.integration',
|
|
59
|
+
},
|
|
22
60
|
{
|
|
23
61
|
...example_core({
|
|
24
62
|
...context,
|
|
@@ -26,6 +64,27 @@ export function composeModuleServer(
|
|
|
26
64
|
}),
|
|
27
65
|
moduleId: 'example.core',
|
|
28
66
|
},
|
|
67
|
+
{
|
|
68
|
+
...profile_core({
|
|
69
|
+
...context,
|
|
70
|
+
agentDefinitions: context.agentDefinitions.forModule('profile.core'),
|
|
71
|
+
}),
|
|
72
|
+
moduleId: 'profile.core',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
...sandbox_core({
|
|
76
|
+
...context,
|
|
77
|
+
agentDefinitions: context.agentDefinitions.forModule('sandbox.core'),
|
|
78
|
+
}),
|
|
79
|
+
moduleId: 'sandbox.core',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
...users_core({
|
|
83
|
+
...context,
|
|
84
|
+
agentDefinitions: context.agentDefinitions.forModule('users.core'),
|
|
85
|
+
}),
|
|
86
|
+
moduleId: 'users.core',
|
|
87
|
+
},
|
|
29
88
|
];
|
|
30
89
|
}
|
|
31
90
|
|