@flowdular/sdk 0.1.0 → 0.2.1
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/.ai/skills/test-hardening/SKILL.md +1 -1
- package/README.md +69 -12
- package/assets/flowdular-banner.png +0 -0
- package/modules/agents/package.json +1 -1
- package/modules/auth/package.json +1 -1
- package/modules/auth/src/client/AuthenticationCore.tsrx +3 -1
- package/modules/auth/src/server/endpoints.ts +3 -1
- package/modules/auth/src/server/runtime.ts +4 -0
- package/modules/automations/package.json +1 -1
- package/modules/automations-workflows-integration/package.json +1 -1
- package/modules/profile/package.json +1 -1
- package/modules/sandbox/package.json +1 -1
- package/modules/system/package.json +1 -1
- package/modules/users/package.json +1 -1
- package/modules/workflows/package.json +1 -1
- package/package.json +5 -13
- package/packages/ai-provider/package.json +1 -1
- package/packages/cli-protocol/package.json +1 -1
- package/packages/client/package.json +1 -1
- package/packages/client/src/routing.ts +39 -2
- package/packages/client/src/shell/BrandMark.tsrx +5 -1
- package/packages/client/src/shell/navigation.ts +3 -1
- package/packages/client/src/state.ts +6 -2
- package/packages/contracts/package.json +1 -1
- package/packages/contracts/schemas/project.schema.json +16 -42
- package/packages/database/package.json +1 -1
- package/packages/database-pglite/package.json +2 -2
- package/packages/database-pglite/src/driver.ts +21 -3
- package/packages/database-testing/package.json +1 -1
- package/packages/dev-console/package.json +1 -1
- package/packages/harness/package.json +1 -1
- package/packages/kernel/package.json +1 -1
- package/packages/server/package.json +1 -1
- package/packages/server/src/application-routes.ts +80 -8
- package/packages/server/src/index.ts +4 -1
- package/packages/server/src/web-html.ts +9 -5
- package/packages/server/src/web.ts +59 -7
- package/packages/ui/package.json +1 -1
- package/packages/coding-agent/package.json +0 -44
- package/packages/coding-agent/src/drivers/byok.ts +0 -322
- package/packages/coding-agent/src/drivers/claude-code.ts +0 -290
- package/packages/coding-agent/src/drivers/codex.ts +0 -281
- package/packages/coding-agent/src/index.ts +0 -56
- package/packages/coding-agent/src/registry.ts +0 -119
- package/packages/coding-agent/src/roles/contract.ts +0 -60
- package/packages/coding-agent/src/roles/defaults.ts +0 -134
- package/packages/coding-agent/src/roles/handoff.ts +0 -41
- package/packages/coding-agent/src/roles/registry.ts +0 -156
- package/packages/coding-agent/src/roles/skills.ts +0 -72
- package/packages/coding-agent/src/roles/sync.ts +0 -88
- package/packages/coding-agent/src/types.ts +0 -102
- package/packages/coding-agent/src/workspace.ts +0 -275
- package/packages/sandbox/README.md +0 -691
- package/packages/sandbox/bin/flowdular-sandbox.mjs +0 -393
- package/packages/sandbox/dist/client/assets/App-ClMOrpyg.js +0 -11
- package/packages/sandbox/dist/client/assets/PreviewHost-BHiHrfbQ.js +0 -1
- package/packages/sandbox/dist/client/assets/auto-buGEq6de.js +0 -3
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/index-CvwhlQ87.js +0 -4
- package/packages/sandbox/dist/client/assets/styles-BPWaGf55.js +0 -3
- package/packages/sandbox/dist/client/assets/styles-Dx1_KOag.css +0 -1
- package/packages/sandbox/dist/client/favicon.svg +0 -1
- package/packages/sandbox/dist/server/assets/auto-CVGNYyb3.js +0 -12785
- package/packages/sandbox/dist/server/assets/chunk-DDJLRBDX-3OUNo51g.js +0 -4125
- package/packages/sandbox/dist/server/assets/nodefs-DVSI7kG0.js +0 -24
- package/packages/sandbox/dist/server/assets/opfs-ahp-D56iokt1.js +0 -388
- package/packages/sandbox/dist/server/assets/token-Bvaq7Anz.js +0 -55
- package/packages/sandbox/dist/server/assets/token-util-BqSvdIPQ.js +0 -3
- package/packages/sandbox/dist/server/assets/token-util-CktFFT4z.js +0 -494
- package/packages/sandbox/dist/server/entry.js +0 -91671
- package/packages/sandbox/dist/server/favicon.svg +0 -1
- package/packages/sandbox/dist/server/index.html +0 -161
- package/packages/sandbox/index.html +0 -159
- package/packages/sandbox/octane.config.ts +0 -36
- package/packages/sandbox/package.json +0 -83
- package/packages/sandbox/public/favicon.svg +0 -1
- package/packages/sandbox/public/og.png +0 -0
- package/packages/sandbox/src/App.tsrx +0 -924
- package/packages/sandbox/src/client/ApprovalHandoff.tsrx +0 -39
- package/packages/sandbox/src/client/ChatPane.tsrx +0 -694
- package/packages/sandbox/src/client/ConnectView.tsrx +0 -86
- package/packages/sandbox/src/client/DiffPane.tsrx +0 -150
- package/packages/sandbox/src/client/EjectModal.tsrx +0 -571
- package/packages/sandbox/src/client/GateResults.tsrx +0 -60
- package/packages/sandbox/src/client/GitHubSettingsModal.tsrx +0 -219
- package/packages/sandbox/src/client/NewSessionForm.tsrx +0 -214
- package/packages/sandbox/src/client/SessionBar.tsrx +0 -151
- package/packages/sandbox/src/client/SessionPicker.tsrx +0 -472
- package/packages/sandbox/src/client/SpecEditor.tsrx +0 -109
- package/packages/sandbox/src/client/SpecReviewCard.tsrx +0 -321
- package/packages/sandbox/src/client/WorkCard.tsrx +0 -128
- package/packages/sandbox/src/client/WorkbenchModal.tsrx +0 -161
- package/packages/sandbox/src/client/WorkspaceMenu.tsrx +0 -100
- package/packages/sandbox/src/client/api.ts +0 -797
- package/packages/sandbox/src/client/attachments.ts +0 -73
- package/packages/sandbox/src/client/dashboard.ts +0 -46
- package/packages/sandbox/src/client/github-settings.ts +0 -48
- package/packages/sandbox/src/client/highlight.ts +0 -105
- package/packages/sandbox/src/client/i18n.ts +0 -32
- package/packages/sandbox/src/client/locales/en.json +0 -466
- package/packages/sandbox/src/client/locales/pl.json +0 -466
- package/packages/sandbox/src/client/session-labels.ts +0 -77
- package/packages/sandbox/src/client/state.ts +0 -108
- package/packages/sandbox/src/index.ts +0 -10
- package/packages/sandbox/src/preview/PreviewHost.tsrx +0 -373
- package/packages/sandbox/src/preview/load-module.ts +0 -16
- package/packages/sandbox/src/server/attachments.ts +0 -308
- package/packages/sandbox/src/server/auto-review.ts +0 -181
- package/packages/sandbox/src/server/checkpoints.ts +0 -90
- package/packages/sandbox/src/server/config.ts +0 -460
- package/packages/sandbox/src/server/dashboard.ts +0 -245
- package/packages/sandbox/src/server/delivery/configuration.ts +0 -193
- package/packages/sandbox/src/server/delivery/git-pr.ts +0 -1473
- package/packages/sandbox/src/server/delivery/index.ts +0 -83
- package/packages/sandbox/src/server/delivery/local.ts +0 -151
- package/packages/sandbox/src/server/delivery/official-modules.ts +0 -516
- package/packages/sandbox/src/server/delivery/plan.ts +0 -218
- package/packages/sandbox/src/server/delivery/policies.ts +0 -239
- package/packages/sandbox/src/server/delivery/record.ts +0 -41
- package/packages/sandbox/src/server/delivery/steps.ts +0 -464
- package/packages/sandbox/src/server/delivery/types.ts +0 -158
- package/packages/sandbox/src/server/dependencies.ts +0 -88
- package/packages/sandbox/src/server/diff.ts +0 -230
- package/packages/sandbox/src/server/gates.ts +0 -388
- package/packages/sandbox/src/server/index.ts +0 -139
- package/packages/sandbox/src/server/path-guard.ts +0 -282
- package/packages/sandbox/src/server/planning.ts +0 -749
- package/packages/sandbox/src/server/platform-client.ts +0 -189
- package/packages/sandbox/src/server/preview-database-host.ts +0 -340
- package/packages/sandbox/src/server/preview-database-protocol.ts +0 -163
- package/packages/sandbox/src/server/preview-database-proxy.ts +0 -356
- package/packages/sandbox/src/server/preview-database.ts +0 -109
- package/packages/sandbox/src/server/preview-ipc.ts +0 -15
- package/packages/sandbox/src/server/preview-modules.ts +0 -83
- package/packages/sandbox/src/server/preview-revision.ts +0 -44
- package/packages/sandbox/src/server/preview-runtime.ts +0 -467
- package/packages/sandbox/src/server/preview-worker-manager.ts +0 -436
- package/packages/sandbox/src/server/preview-worker.ts +0 -168
- package/packages/sandbox/src/server/reference.ts +0 -251
- package/packages/sandbox/src/server/routes.ts +0 -2258
- package/packages/sandbox/src/server/runtime.ts +0 -188
- package/packages/sandbox/src/server/session-owner.ts +0 -23
- package/packages/sandbox/src/server/sessions.ts +0 -849
- package/packages/sandbox/src/server/spec.ts +0 -471
- package/packages/sandbox/src/server/turn-lifecycle.ts +0 -56
- package/packages/sandbox/src/server/turns.ts +0 -993
- package/packages/sandbox/src/server/workspace-install.ts +0 -266
- package/packages/sandbox/src/server/workspace-root.ts +0 -73
- package/packages/sandbox/src/styles.css +0 -1573
- package/packages/sandbox/vite.config.ts +0 -133
|
@@ -18,7 +18,7 @@ when: A module has few or tautological tests, a bug escaped the suite, or a revi
|
|
|
18
18
|
|
|
19
19
|
- `tests/module.test.ts` (one file per module today; more files are fine). `tsconfig.json` includes `src/**/*` and `tests/**/*.ts`, so a test file is `.ts`; `.tsrx` components are not compiled by vitest here. Testable client logic (formatting, filtering, mapping, state transitions) goes into a `.ts` helper next to the view and is imported by the test.
|
|
20
20
|
- Runner: `vitest run` (`pnpm --filter @flowdular/module-<dir> test`). In the sandbox the `tests` gate runs `vitest run --passWithNoTests` inside the module directory, so a module with no tests passes the gate. Treat an empty or trivial suite as a defect, not a pass.
|
|
21
|
-
-
|
|
21
|
+
- New modules use vitest 4.1.11, typescript 5.9.3 and `@types/node` 24.13.3. The catalog reference is an immutable older release; use the current scaffold dependency versions for new code.
|
|
22
22
|
|
|
23
23
|
## 2. Repositories on an embedded PostgreSQL
|
|
24
24
|
|
package/README.md
CHANGED
|
@@ -1,24 +1,81 @@
|
|
|
1
|
+
[](https://flowdular.com)
|
|
2
|
+
|
|
1
3
|
# Flowdular SDK
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@flowdular/sdk)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
[](https://github.com/Flowdular/flowdular/blob/main/LICENSE)
|
|
8
|
+
|
|
9
|
+
The shared foundation for Flowdular applications: server APIs, client integration, UI components, databases, agents and bundled core modules. Build business modules against one SDK with explicit imports for each part of the platform.
|
|
10
|
+
|
|
11
|
+
## Start a new application
|
|
12
|
+
|
|
13
|
+
Use Node.js **22.22.2 or newer**. The generated workspace uses pnpm.
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npm create flowdular@latest my-app
|
|
17
|
+
cd my-app
|
|
18
|
+
pnpm flowdular doctor
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The generator configures the SDK and the Flowdular/Octane build toolchain. To add the SDK to an existing compatible workspace, install it in the package that imports it:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
pnpm add @flowdular/sdk
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Import what you need
|
|
4
28
|
|
|
5
29
|
```ts
|
|
30
|
+
// Server-side module code
|
|
6
31
|
import { defineEndpoint } from '@flowdular/sdk/server';
|
|
7
32
|
import type { ModuleManifest } from '@flowdular/sdk/contracts';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
// Client-side module code
|
|
8
37
|
import { Button } from '@flowdular/sdk/ui';
|
|
9
38
|
import '@flowdular/sdk/ui/styles';
|
|
10
39
|
```
|
|
11
40
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
41
|
+
The SDK ships TypeScript and TSRX source for the Flowdular/Octane toolchain. It has no root import. Keep server and database imports in server code; use client and UI entrypoints in browser code.
|
|
42
|
+
|
|
43
|
+
## What's included
|
|
44
|
+
|
|
45
|
+
| Area | Import paths |
|
|
46
|
+
| --------------------------------------- | ---------------------------------------------------------------- |
|
|
47
|
+
| Module contracts and runtime | `@flowdular/sdk/contracts`, `@flowdular/sdk/kernel` |
|
|
48
|
+
| HTTP endpoints | `@flowdular/sdk/server` |
|
|
49
|
+
| Client integration and translations | `@flowdular/sdk/client`, `@flowdular/sdk/client/i18n` |
|
|
50
|
+
| Shared UI and styles | `@flowdular/sdk/ui`, `@flowdular/sdk/ui/styles` |
|
|
51
|
+
| Database contracts and local PostgreSQL | `@flowdular/sdk/database`, `@flowdular/sdk/database-pglite` |
|
|
52
|
+
| Database test helpers | `@flowdular/sdk/database-testing` |
|
|
53
|
+
| Agents and providers | `@flowdular/sdk/harness`, `@flowdular/sdk/ai-provider` |
|
|
54
|
+
| Development APIs | `@flowdular/sdk/dev-console`, `@flowdular/sdk/cli-protocol` |
|
|
55
|
+
| Bundled core modules | `@flowdular/sdk/modules/<name>`, including `modules/auth/server` |
|
|
56
|
+
|
|
57
|
+
Business modules are distributed as source archives through [Official Modules](https://github.com/Flowdular/official-modules). Installing an archive and enabling a module are separate CLI actions.
|
|
58
|
+
|
|
59
|
+
The coding sandbox is a separate application distributed as `@flowdular/sandbox`.
|
|
60
|
+
Launch it with `npx @flowdular/sandbox` from your application directory. It depends
|
|
61
|
+
on the SDK; installing the SDK alone does not install the sandbox application or
|
|
62
|
+
its launcher. The SDK's `modules/sandbox` export is the platform access/grant
|
|
63
|
+
module, not the coding application.
|
|
64
|
+
|
|
65
|
+
## Build a module
|
|
66
|
+
|
|
67
|
+
Use explicit permissions for endpoints, tenant-bound database access and the shared UI components. Run the generated workspace's checks before delivery:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
pnpm verify
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
See the [module guide](https://github.com/Flowdular/flowdular/blob/main/docs/modules.md), [database adapters](https://github.com/Flowdular/flowdular/blob/main/docs/database-adapters.md) and [design system](https://github.com/Flowdular/flowdular/blob/main/docs/design-system.md).
|
|
74
|
+
|
|
75
|
+
## Packages and support
|
|
17
76
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
77
|
+
- [flowdular](https://www.npmjs.com/package/flowdular): workspace CLI.
|
|
78
|
+
- [create-flowdular](https://www.npmjs.com/package/create-flowdular): application generator.
|
|
79
|
+
- [Documentation](https://github.com/Flowdular/flowdular/tree/main/docs) · [Source and issues](https://github.com/Flowdular/flowdular) · [Website](https://flowdular.com)
|
|
21
80
|
|
|
22
|
-
|
|
23
|
-
assembly copies the declared members, rewrites internal imports to SDK subpaths,
|
|
24
|
-
and exposes their original entrypoints. Only the assembled SDK is published.
|
|
81
|
+
Licensed under MIT. Repository documentation and source require repository access while the repositories are private.
|
|
Binary file
|
|
@@ -348,7 +348,9 @@ function AuthenticationForm(props: AuthenticationFormProps) @{
|
|
|
348
348
|
/>
|
|
349
349
|
</FormField>
|
|
350
350
|
<p class="auth-slug-preview">
|
|
351
|
-
{t('auth.signup.workspace.address') + ' ' +
|
|
351
|
+
{t('auth.signup.workspace.address') + ' ' +
|
|
352
|
+
applicationPath() +
|
|
353
|
+
'/'}
|
|
352
354
|
<b>
|
|
353
355
|
{workspaceSlug || t('auth.signup.workspace.placeholder')}
|
|
354
356
|
</b>
|
|
@@ -369,7 +369,9 @@ export function createAuthRoutes(runtime: AuthRuntime): readonly ServerRoute[] {
|
|
|
369
369
|
headers.append('set-cookie', expiredState);
|
|
370
370
|
return new Response(null, { status: 302, headers });
|
|
371
371
|
}
|
|
372
|
-
const headers = new Headers({
|
|
372
|
+
const headers = new Headers({
|
|
373
|
+
location: runtime.applicationPath ?? '/app',
|
|
374
|
+
});
|
|
373
375
|
headers.append(
|
|
374
376
|
'set-cookie',
|
|
375
377
|
sessionCookie(issued.token, runtime.cookie),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { validateApplicationPath } from '@flowdular/sdk/server';
|
|
1
2
|
import { readFileSync } from 'node:fs';
|
|
2
3
|
import { resolve } from 'node:path';
|
|
3
4
|
import type { Middleware } from '@octanejs/app-core';
|
|
@@ -76,6 +77,7 @@ export interface AuthRuntimeEnvironmentOptions {
|
|
|
76
77
|
readonly mailDelivery?: AuthMailDelivery;
|
|
77
78
|
readonly mfaEncryptionKey?: string;
|
|
78
79
|
readonly publicBaseUrl?: string;
|
|
80
|
+
readonly applicationPath?: string;
|
|
79
81
|
readonly oidcProviders?: readonly OidcProvider[];
|
|
80
82
|
readonly production?: boolean;
|
|
81
83
|
readonly contentSecurityPolicy?: string | null;
|
|
@@ -104,6 +106,7 @@ export interface AuthRuntime {
|
|
|
104
106
|
readonly workspaceRoot: string | null;
|
|
105
107
|
readonly oidcProviders: readonly OidcProvider[];
|
|
106
108
|
readonly publicBaseUrl: string | null;
|
|
109
|
+
readonly applicationPath?: string;
|
|
107
110
|
/* Resolves once the schema is migrated and the leases are held. Concurrent
|
|
108
111
|
first callers await the same initialization. */
|
|
109
112
|
service(): Promise<AuthService>;
|
|
@@ -667,6 +670,7 @@ export function createAuthRuntime(options: AuthRuntimeOptions): AuthRuntime {
|
|
|
667
670
|
workspaceRoot: options.workspaceRoot ?? null,
|
|
668
671
|
oidcProviders: options.oidcProviders ?? [],
|
|
669
672
|
publicBaseUrl: options.publicBaseUrl ?? null,
|
|
673
|
+
applicationPath: validateApplicationPath(options.applicationPath ?? '/app'),
|
|
670
674
|
service,
|
|
671
675
|
async authorizeAgentToolAccess(tenantId, actor) {
|
|
672
676
|
const identity = normalizeActor(actor);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowdular/sdk",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Flowdular platform SDK: server, client, UI, data, agents and core modules through separate exports.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"./ui/styles": "./packages/ui/src/styles/index.css",
|
|
23
23
|
"./database": "./packages/database/src/index.ts",
|
|
24
24
|
"./database/postgresql": "./packages/database/src/postgresql.ts",
|
|
25
|
-
"./coding-agent": "./packages/coding-agent/src/index.ts",
|
|
26
25
|
"./database-testing": "./packages/database-testing/src/index.ts",
|
|
27
26
|
"./database-testing/vitest": "./packages/database-testing/src/vitest-preset.ts",
|
|
28
27
|
"./ai-provider": "./packages/ai-provider/src/index.ts",
|
|
@@ -38,8 +37,6 @@
|
|
|
38
37
|
"./harness/tool-adapters": "./packages/harness/src/tool-adapters.ts",
|
|
39
38
|
"./harness/catalog": "./packages/harness/src/catalog.ts",
|
|
40
39
|
"./harness/schema": "./packages/harness/schemas/task-packet.schema.json",
|
|
41
|
-
"./sandbox": "./packages/sandbox/src/index.ts",
|
|
42
|
-
"./sandbox/server": "./packages/sandbox/src/server/index.ts",
|
|
43
40
|
"./database-pglite": "./packages/database-pglite/src/index.ts",
|
|
44
41
|
"./dev-console": "./packages/dev-console/src/index.mjs",
|
|
45
42
|
"./client": "./packages/client/src/index.ts",
|
|
@@ -101,8 +98,6 @@
|
|
|
101
98
|
"@octanejs/tanstack-table": "0.1.51",
|
|
102
99
|
"chart.js": "^4.5.1",
|
|
103
100
|
"octane": "0.1.51",
|
|
104
|
-
"ai": "7.0.85",
|
|
105
|
-
"yaml": "2.9.0",
|
|
106
101
|
"pg": "8.23.0",
|
|
107
102
|
"@types/pg": "8.23.1",
|
|
108
103
|
"@ai-sdk/anthropic": "4.0.46",
|
|
@@ -110,16 +105,13 @@
|
|
|
110
105
|
"@ai-sdk/gateway": "4.0.69",
|
|
111
106
|
"@ai-sdk/openai": "4.0.52",
|
|
112
107
|
"@ai-sdk/openai-compatible": "3.0.41",
|
|
108
|
+
"ai": "7.0.85",
|
|
113
109
|
"@octanejs/app-core": "0.0.47",
|
|
110
|
+
"@electric-sql/pglite": "0.5.8",
|
|
114
111
|
"@octanejs/seo": "0.0.38",
|
|
115
|
-
"@octanejs/vite-plugin": "0.1.51",
|
|
116
112
|
"segment-state": "0.2.0",
|
|
117
|
-
"vite": "8.2.2",
|
|
118
|
-
"@electric-sql/pglite": "0.5.8",
|
|
119
113
|
"semver": "7.7.4",
|
|
120
|
-
"@types/semver": "7.7.1"
|
|
121
|
-
|
|
122
|
-
"bin": {
|
|
123
|
-
"flowdular-sandbox": "./packages/sandbox/bin/flowdular-sandbox.mjs"
|
|
114
|
+
"@types/semver": "7.7.1",
|
|
115
|
+
"yaml": "2.9.0"
|
|
124
116
|
}
|
|
125
117
|
}
|
|
@@ -2,8 +2,45 @@ let basePath = '/app';
|
|
|
2
2
|
|
|
3
3
|
/** Installation-wide value emitted by the CLI, never a request/tenant setting. */
|
|
4
4
|
export function configureApplicationRouting(path: string): void {
|
|
5
|
-
if (
|
|
5
|
+
if (
|
|
6
|
+
path.length > 64 ||
|
|
7
|
+
!/^\/[a-z][a-z0-9-]*$/.test(path) ||
|
|
8
|
+
[
|
|
9
|
+
'setup',
|
|
10
|
+
'health',
|
|
11
|
+
'ready',
|
|
12
|
+
'assets',
|
|
13
|
+
'auth',
|
|
14
|
+
'api',
|
|
15
|
+
'sites',
|
|
16
|
+
'sign-in',
|
|
17
|
+
'sign-up',
|
|
18
|
+
'forgot-password',
|
|
19
|
+
'reset-password',
|
|
20
|
+
'accept-invitation',
|
|
21
|
+
].includes(path.slice(1))
|
|
22
|
+
)
|
|
23
|
+
throw new Error('Invalid application path.');
|
|
6
24
|
basePath = path;
|
|
7
25
|
}
|
|
8
26
|
|
|
9
|
-
export function applicationPath(): string {
|
|
27
|
+
export function applicationPath(): string {
|
|
28
|
+
return basePath;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Select the server's installation setting during SSR and browser hydration. */
|
|
32
|
+
export function configureApplicationFromPage(
|
|
33
|
+
props: { readonly state?: Map<string, unknown> } | undefined,
|
|
34
|
+
fallback = '/app',
|
|
35
|
+
): void {
|
|
36
|
+
let path = props?.state?.get('flowdular.application.path');
|
|
37
|
+
if (path === undefined && typeof document !== 'undefined') {
|
|
38
|
+
const data = document.getElementById(
|
|
39
|
+
'flowdular-application-data',
|
|
40
|
+
)?.textContent;
|
|
41
|
+
if (data) path = JSON.parse(data);
|
|
42
|
+
}
|
|
43
|
+
if (path !== undefined && typeof path !== 'string')
|
|
44
|
+
throw new Error('Invalid application path.');
|
|
45
|
+
configureApplicationRouting(path ?? fallback);
|
|
46
|
+
}
|
|
@@ -3,7 +3,11 @@ import { BrandMark } from '@flowdular/sdk/ui';
|
|
|
3
3
|
import { t } from '../i18n/runtime.ts';
|
|
4
4
|
|
|
5
5
|
export function SidebarBrand() @{
|
|
6
|
-
<a
|
|
6
|
+
<a
|
|
7
|
+
class="sidebar__home"
|
|
8
|
+
href={applicationPath()}
|
|
9
|
+
aria-label={t('shell.brand.home')}
|
|
10
|
+
>
|
|
7
11
|
<BrandMark size={22} />
|
|
8
12
|
<span class="sidebar__wordmark">Flowdular</span>
|
|
9
13
|
</a>
|
|
@@ -62,7 +62,9 @@ export function viewHref(
|
|
|
62
62
|
viewId: ShellView,
|
|
63
63
|
workspaceSlug?: string | null,
|
|
64
64
|
): string {
|
|
65
|
-
const base = workspaceSlug
|
|
65
|
+
const base = workspaceSlug
|
|
66
|
+
? applicationPath() + '/' + workspaceSlug
|
|
67
|
+
: applicationPath();
|
|
66
68
|
if (viewId === 'overview') return base;
|
|
67
69
|
return base + '/' + viewId;
|
|
68
70
|
}
|
|
@@ -20,7 +20,11 @@ export function toggleNavigationGroup(
|
|
|
20
20
|
export function shellViewFromUrl(value: string): ShellView {
|
|
21
21
|
const pathname = new URL(value, 'https://flowdular.local').pathname;
|
|
22
22
|
const segments = pathname.split('/').filter(Boolean);
|
|
23
|
-
return (
|
|
23
|
+
return (
|
|
24
|
+
(segments[0] === applicationPath().slice(1) || segments[0] === 'app'
|
|
25
|
+
? segments[2]
|
|
26
|
+
: segments[0]) ?? 'overview'
|
|
27
|
+
);
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
/* Canonical workspace URLs live below /app. Slug-first and view-only links are
|
|
@@ -31,7 +35,7 @@ export function shellLocationFromUrl(
|
|
|
31
35
|
): ShellLocation {
|
|
32
36
|
const pathname = new URL(value, 'https://flowdular.local').pathname;
|
|
33
37
|
const segments = pathname.split('/').filter(Boolean);
|
|
34
|
-
if (
|
|
38
|
+
if (segments[0] === applicationPath().slice(1) || segments[0] === 'app') {
|
|
35
39
|
const workspace = segments[1];
|
|
36
40
|
if (workspace !== undefined && knownWorkspaceSlugs.includes(workspace)) {
|
|
37
41
|
return { workspaceSlug: workspace, view: segments[2] ?? 'overview' };
|
|
@@ -25,10 +25,7 @@
|
|
|
25
25
|
"specs": {
|
|
26
26
|
"type": "object",
|
|
27
27
|
"additionalProperties": false,
|
|
28
|
-
"required": [
|
|
29
|
-
"platformRoot",
|
|
30
|
-
"moduleDirectory"
|
|
31
|
-
],
|
|
28
|
+
"required": ["platformRoot", "moduleDirectory"],
|
|
32
29
|
"properties": {
|
|
33
30
|
"platformRoot": {
|
|
34
31
|
"type": "string",
|
|
@@ -43,10 +40,7 @@
|
|
|
43
40
|
"modules": {
|
|
44
41
|
"type": "object",
|
|
45
42
|
"additionalProperties": false,
|
|
46
|
-
"required": [
|
|
47
|
-
"roots",
|
|
48
|
-
"enabled"
|
|
49
|
-
],
|
|
43
|
+
"required": ["roots", "enabled"],
|
|
50
44
|
"properties": {
|
|
51
45
|
"roots": {
|
|
52
46
|
"type": "array",
|
|
@@ -79,11 +73,7 @@
|
|
|
79
73
|
"agent": {
|
|
80
74
|
"type": "object",
|
|
81
75
|
"additionalProperties": false,
|
|
82
|
-
"required": [
|
|
83
|
-
"policy",
|
|
84
|
-
"blueprints",
|
|
85
|
-
"modelRouting"
|
|
86
|
-
],
|
|
76
|
+
"required": ["policy", "blueprints", "modelRouting"],
|
|
87
77
|
"properties": {
|
|
88
78
|
"policy": {
|
|
89
79
|
"type": "string",
|
|
@@ -135,17 +125,10 @@
|
|
|
135
125
|
"$ref": "#/$defs/gitName"
|
|
136
126
|
},
|
|
137
127
|
"provider": {
|
|
138
|
-
"enum": [
|
|
139
|
-
"github",
|
|
140
|
-
"none"
|
|
141
|
-
]
|
|
128
|
+
"enum": ["github", "none"]
|
|
142
129
|
},
|
|
143
130
|
"mode": {
|
|
144
|
-
"enum": [
|
|
145
|
-
"auto",
|
|
146
|
-
"direct",
|
|
147
|
-
"fork"
|
|
148
|
-
]
|
|
131
|
+
"enum": ["auto", "direct", "fork"]
|
|
149
132
|
},
|
|
150
133
|
"forkOwner": {
|
|
151
134
|
"$ref": "#/$defs/githubAccount"
|
|
@@ -171,9 +154,7 @@
|
|
|
171
154
|
"web": {
|
|
172
155
|
"type": "object",
|
|
173
156
|
"additionalProperties": false,
|
|
174
|
-
"required": [
|
|
175
|
-
"mounts"
|
|
176
|
-
],
|
|
157
|
+
"required": ["mounts"],
|
|
177
158
|
"properties": {
|
|
178
159
|
"mounts": {
|
|
179
160
|
"type": "array",
|
|
@@ -181,13 +162,7 @@
|
|
|
181
162
|
"items": {
|
|
182
163
|
"type": "object",
|
|
183
164
|
"additionalProperties": false,
|
|
184
|
-
"required": [
|
|
185
|
-
"id",
|
|
186
|
-
"moduleId",
|
|
187
|
-
"surfaceId",
|
|
188
|
-
"path",
|
|
189
|
-
"tenantId"
|
|
190
|
-
],
|
|
165
|
+
"required": ["id", "moduleId", "surfaceId", "path", "tenantId"],
|
|
191
166
|
"properties": {
|
|
192
167
|
"id": {
|
|
193
168
|
"type": "string",
|
|
@@ -222,9 +197,7 @@
|
|
|
222
197
|
"application": {
|
|
223
198
|
"type": "object",
|
|
224
199
|
"additionalProperties": false,
|
|
225
|
-
"required": [
|
|
226
|
-
"path"
|
|
227
|
-
],
|
|
200
|
+
"required": ["path"],
|
|
228
201
|
"properties": {
|
|
229
202
|
"path": {
|
|
230
203
|
"type": "string",
|
|
@@ -238,20 +211,21 @@
|
|
|
238
211
|
"/sign-up",
|
|
239
212
|
"/forgot-password",
|
|
240
213
|
"/reset-password",
|
|
241
|
-
"/accept-invitation"
|
|
214
|
+
"/accept-invitation",
|
|
215
|
+
"/setup",
|
|
216
|
+
"/health",
|
|
217
|
+
"/ready",
|
|
218
|
+
"/assets"
|
|
242
219
|
]
|
|
243
|
-
}
|
|
220
|
+
},
|
|
221
|
+
"maxLength": 64
|
|
244
222
|
}
|
|
245
223
|
}
|
|
246
224
|
}
|
|
247
225
|
},
|
|
248
226
|
"$defs": {
|
|
249
227
|
"deliveryTarget": {
|
|
250
|
-
"enum": [
|
|
251
|
-
"workspace",
|
|
252
|
-
"git-pr",
|
|
253
|
-
"official-modules"
|
|
254
|
-
]
|
|
228
|
+
"enum": ["workspace", "git-pr", "official-modules"]
|
|
255
229
|
},
|
|
256
230
|
"gitName": {
|
|
257
231
|
"type": "string",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowdular/database-pglite",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./src/index.ts"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@flowdular/database-testing": "workspace:*",
|
|
18
18
|
"@types/node": "24.13.3",
|
|
19
19
|
"typescript": "5.9.3",
|
|
20
|
-
"vitest": "4.1.
|
|
20
|
+
"vitest": "4.1.11"
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"repository": {
|
|
@@ -81,22 +81,40 @@ export function createPgliteCluster(
|
|
|
81
81
|
const close = (): Promise<void> => {
|
|
82
82
|
closePromise ??= (async () => {
|
|
83
83
|
if (!databasePromise) return;
|
|
84
|
-
|
|
84
|
+
// A failed initialization has no database to close; its caller already
|
|
85
|
+
// received the original error. Do not replace it during disposal.
|
|
86
|
+
const instance = await databasePromise.catch(() => undefined);
|
|
85
87
|
databasePromise = undefined;
|
|
86
|
-
await instance
|
|
88
|
+
await instance?.close();
|
|
87
89
|
})();
|
|
88
90
|
return closePromise;
|
|
89
91
|
};
|
|
90
92
|
|
|
91
93
|
const database = async (): Promise<PGlite> => {
|
|
92
94
|
databasePromise ??= (async () => {
|
|
95
|
+
if (options.dataDirectory) {
|
|
96
|
+
const { mkdir } = await import('node:fs/promises');
|
|
97
|
+
await mkdir(options.dataDirectory, { recursive: true, mode: 0o700 });
|
|
98
|
+
}
|
|
93
99
|
const created = options.dataDirectory
|
|
94
100
|
? await PGlite.create({
|
|
95
101
|
dataDir: options.dataDirectory,
|
|
96
102
|
parsers: SERVER_PARSERS,
|
|
97
103
|
})
|
|
98
104
|
: await PGlite.create({ parsers: SERVER_PARSERS });
|
|
99
|
-
|
|
105
|
+
try {
|
|
106
|
+
if (options.bootstrap) await created.exec(options.bootstrap);
|
|
107
|
+
} catch (error) {
|
|
108
|
+
try {
|
|
109
|
+
await created.close();
|
|
110
|
+
} catch (closeError) {
|
|
111
|
+
throw new AggregateError(
|
|
112
|
+
[error, closeError],
|
|
113
|
+
'PGlite bootstrap failed and cleanup also failed.',
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
100
118
|
return created;
|
|
101
119
|
})();
|
|
102
120
|
return databasePromise;
|