@flowdular/sandbox 0.2.2 → 0.2.4

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 CHANGED
@@ -82,7 +82,7 @@ platform database.
82
82
 
83
83
  The token is encrypted at rest with a key in `.flowdular/sandbox/secret.key` and
84
84
  is never returned to the browser. The application may run anywhere: the sandbox
85
- works the same against `http://127.0.0.1:4310` and a deployment.
85
+ defaults to `http://localhost:4310`, which supports Vite's IPv4 or IPv6 loopback listener, and can also connect to a deployment. For an older application, enable `sandbox.core` with `pnpm flowdular module enable sandbox.core --apply` while the application is stopped, then restart it. If local demo setup reset the database, issue a new API token before reconnecting.
86
86
 
87
87
  Sign-in is enforced on the platform side: the token authenticates as its
88
88
  account, and `sandbox.core` must hold an active grant for it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowdular/sandbox",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "The Flowdular sandbox: chat a change, build it behind the gates, preview it in the real application, deliver it as code.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/flowdular/flowdular/tree/main/packages/sandbox#readme",
@@ -57,7 +57,7 @@
57
57
  "octane": "0.1.51",
58
58
  "segment-state": "0.2.0",
59
59
  "vite": "8.2.2",
60
- "@flowdular/sdk": "0.2.1"
60
+ "@flowdular/sdk": "0.2.3"
61
61
  },
62
62
  "imports": {
63
63
  "#coding-agent": "./internal/coding-agent/src/index.ts"
@@ -98,7 +98,7 @@ export const DEFAULT_GITHUB_CONFIGURATION: GitHubDeliveryConfiguration = {
98
98
  export const DEFAULT_CONFIGURATION: SandboxConfiguration = {
99
99
  version: 1,
100
100
  mode: 'loopback',
101
- platformUrl: 'http://127.0.0.1:4310',
101
+ platformUrl: 'http://localhost:4310',
102
102
  platformToken: null,
103
103
  driver: 'claude-code',
104
104
  driverModel: null,
package/vite.config.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { flowdularEnvironment } from '@flowdular/sdk/kernel/runtime-config';
2
2
  import { existsSync, readFileSync } from 'node:fs';
3
+ import { createRequire } from 'node:module';
3
4
  import { dirname, join, resolve } from 'node:path';
4
5
  import { fileURLToPath } from 'node:url';
5
6
  import { octane } from '@octanejs/vite-plugin';
@@ -13,6 +14,13 @@ import type { SandboxSession } from './src/server/sessions.ts';
13
14
  Object.assign(process.env, flowdularEnvironment(process.env));
14
15
 
15
16
  const appRoot = dirname(fileURLToPath(import.meta.url));
17
+ // npx installs UI dependencies beside the sandbox, outside the app/workspace.
18
+ // Allow only the font asset directories, never the surrounding npm cache.
19
+ const uiRequire = createRequire(import.meta.resolve('@flowdular/sdk/ui'));
20
+ const fontDirectories = [
21
+ '@fontsource-variable/ibm-plex-sans',
22
+ '@fontsource/ibm-plex-mono',
23
+ ].map((name) => join(dirname(uiRequire.resolve(name)), 'files'));
16
24
  const workspace = await findFlowdularWorkspace(
17
25
  process.env.FD_SANDBOX_WORKSPACE ?? process.cwd(),
18
26
  );
@@ -126,7 +134,7 @@ const config = {
126
134
  outside this app's root. The preview reloads itself instead, and a Vite
127
135
  overlay must never cover a module someone is reviewing. */
128
136
  hmr: { overlay: false },
129
- fs: { allow: [appRoot, workspace.root] },
137
+ fs: { allow: [appRoot, workspace.root, ...fontDirectories] },
130
138
  watch: { ignored: ['**/.flowdular/data/**', '**/.coreloom/data/**'] },
131
139
  },
132
140
  } satisfies import('vitest/config').UserWorkspaceConfig;