@decohere/flux 0.0.1-dev.114 → 0.0.1-dev.116

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
@@ -2,13 +2,13 @@
2
2
 
3
3
  In-process TypeScript load for Node.js ESM apps — either one-shot (`flux run`) or hot-reload serve (`flux serve`).
4
4
 
5
- Use Flux when you want to run source `.ts` directly. Flux transpiles with the **Forge** SWC compiler and maps imports to source with path aliases Mesh builds dynamically from the workspace (`package.json` `name` → source `main`). Do not use Flux as a browser bundler, a worker-thread HMR, or a production process manager.
5
+ Use Flux when you want to run source `.ts` directly. Flux transpiles with the **Forge** SWC compiler and maps imports to source with path aliases the workspace package builds dynamically from the workspace (`package.json` `name` → source `main`). Do not use Flux as a browser bundler, a worker-thread HMR, or a production process manager.
6
6
 
7
- Point Flux at a tree of TypeScript packages (`package.json` at each project root). [Mesh](../mesh/README.md) is how that tree is deduced — you do not run Flux against Mesh. Layout and glob overrides: [Mesh — workspace layout](../mesh/README.md#workspace-layout).
7
+ Point Flux at a tree of TypeScript packages (`package.json` at each project root). [`@decohere/workspace`](../workspace/README.md) is how that tree is deduced — you do not run Flux against the workspace package. Layout and glob overrides: [the workspace package — workspace layout](../workspace/README.md#workspace-layout).
8
8
 
9
9
  This package is the Flux API. You use it through the `flux` CLI (`flux run` / `flux serve`), not by importing `@decohere/flux` from application code. The [Programmatic API](#programmatic-api) is only for embedding Flux in another tool.
10
10
 
11
- Related: [Mesh](../mesh/README.md) (package discovery), [Forge](../forge/README.md) (SWC + debug aliases). The `flux` command ships in `@decohere/cli`.
11
+ Related: [`@decohere/workspace`](../workspace/README.md) (package discovery), [Forge](../forge/README.md) (SWC + debug aliases). The `flux` command ships in `@decohere/cli`.
12
12
 
13
13
  ## When to use
14
14
 
@@ -49,7 +49,7 @@ Scaffolded apps already depend on `@decohere/cli` — use those scripts (`pnpm d
49
49
 
50
50
  ## CLI
51
51
 
52
- Host options (`--config-file`, `--log-level`) are parsed before the subcommand. `--config-file` (default `.decohere.js` if present) is optional Mesh config for package discovery. Omit it to use [Mesh defaults](../mesh/README.md#workspace-layout).
52
+ Host options (`--config-file`, `--log-level`) are parsed before the subcommand. `--config-file` (default `.decohere.js` if present) is optional workspace config for package discovery. Omit it to use [workspace defaults](../workspace/README.md#workspace-layout).
53
53
 
54
54
  ### `flux run` — one-shot script
55
55
 
@@ -119,7 +119,7 @@ flux serve --reboot-debounce-ms 500
119
119
 
120
120
  | | What it does |
121
121
  |---|---|
122
- | `flux serve` | Boots the first discovered project (Mesh lists packages by `package.json` `name`, A→Z). |
122
+ | `flux serve` | Boots the first discovered project (the workspace package lists packages by `package.json` `name`, A→Z). |
123
123
  | `--project my-api` | Boots that package by name. |
124
124
  | `--reboot-debounce-ms 500` | Same serve, but waits 500ms after the last save before rebooting (default 250ms). |
125
125
 
@@ -160,13 +160,13 @@ So keep the default. An agent's saves in one go land inside it, and its one-at-a
160
160
 
161
161
  The `export default { async [Symbol.asyncDispose]() { … } }` in the server example above is that contract. Close servers, pools, and timers there — not in a `process.on("SIGINT")` handler Flux does not own.
162
162
 
163
- **Cortex APIs** scaffold `export default app`. `App.dispose` disposes the Crucible root container, then Scribe. Constructed services that implement `Symbol.asyncDispose` (or `Symbol.dispose`) are torn down automatically — including the HTTP provider. Background work (timers, feeds, pollers) belongs in a [hosted service](../cortex/README.md#hosted-services): its signal is aborted and it is stopped on every reboot, so nothing keeps running into the next one. Put teardown on the service; do not wrap the default export, and do not keep workers in globals across reboots.
163
+ **HTTP APIs** scaffold `export default app`. `App.dispose` disposes the root DI container, then Scribe. Constructed services that implement `Symbol.asyncDispose` (or `Symbol.dispose`) are torn down automatically — including the HTTP provider. Background work (timers, feeds, pollers) belongs in a [hosted service](../http/README.md#hosted-services): its signal is aborted and it is stopped on every reboot, so nothing keeps running into the next one. Put teardown on the service; do not wrap the default export, and do not keep workers in globals across reboots.
164
164
 
165
165
  Flux clears its reference to the object *before* calling dispose, so a failed boot cannot dispose the same instance twice.
166
166
 
167
167
  ## Directory slice (`flux serve <token>…`)
168
168
 
169
- A slice is a path token. Flux keeps Mesh packages whose directory sits under that token, then [classifies](#classification-convention) each one. `flux serve shop` and `flux serve projects/shop` are the same token.
169
+ A slice is a path token. Flux keeps workspace packages whose directory sits under that token, then [classifies](#classification-convention) each one. `flux serve shop` and `flux serve projects/shop` are the same token.
170
170
 
171
171
  Example workspace (every leaf directory here has its own `package.json`):
172
172
 
@@ -240,7 +240,7 @@ Only source files (`.ts`) that a served entry imports trigger a reboot.
240
240
 
241
241
  **Memory grows over a long session.** Each reboot imports changed modules under a new `?version=` URL, and Node's ES module cache never releases the old versions. That's fine for a working day; if a session runs for days with thousands of reboots, restart it.
242
242
 
243
- Flux uses **Forge’s compiler**, with one SWC config per project built once per run. SWC leaves imports as written; Flux's resolve hook maps each one to its TypeScript source: `@scope/pkg` and `@scope/pkg/sub` through the Mesh aliases (and tsconfig `paths`), `./file.js` and `./file` to `file.ts` or `file.tsx`, `./file.mjs` to `file.mts`, `./file.cjs` to `file.cts` (which runs as CommonJS), and `./dir` to `dir/index.ts`. Doing it in one place, instead of in SWC (`jsc.paths`, `resolveFully`) and again in the hook, made loading about 20% faster once Node and SWC are warm (`pnpm bench flux-load`, #513). Before Node imports an entry, Flux compiles it and the files it imports, following their imports out from the entry, in parallel on SWC's thread pool (#661). The load hook is synchronous and would otherwise compile one file at a time; files the app never imports, such as tests, are not compiled. A file that fails to compile there is compiled again when Node loads it, and that load fails with the file's name, as before. That is a debug rule so you can edit a library and hit HMR without a pre-build or `node_modules` workspace symlink. Release still resolves through real `node_modules` (published `exports` / `main`).
243
+ Flux uses **Forge’s compiler**, with one SWC config per project built once per run. SWC leaves imports as written; Flux's resolve hook maps each one to its TypeScript source: `@scope/pkg` and `@scope/pkg/sub` through the the workspace package aliases (and tsconfig `paths`), `./file.js` and `./file` to `file.ts` or `file.tsx`, `./file.mjs` to `file.mts`, `./file.cjs` to `file.cts` (which runs as CommonJS), and `./dir` to `dir/index.ts`. Doing it in one place, instead of in SWC (`jsc.paths`, `resolveFully`) and again in the hook, made loading about 20% faster once Node and SWC are warm (`pnpm bench flux-load`, #513). Before Node imports an entry, Flux compiles it and the files it imports, following their imports out from the entry, in parallel on SWC's thread pool (#661). The load hook is synchronous and would otherwise compile one file at a time; files the app never imports, such as tests, are not compiled. A file that fails to compile there is compiled again when Node loads it, and that load fails with the file's name, as before. That is a debug rule so you can edit a library and hit HMR without a pre-build or `node_modules` workspace symlink. Release still resolves through real `node_modules` (published `exports` / `main`).
244
244
 
245
245
  Why aliases, and a tree of where a symlink misses `src/index.ts`: [Forge — debug path aliases](../forge/README.md#debug-path-aliases-not-node_modules-links).
246
246
 
@@ -266,7 +266,7 @@ server.on("reboot", () => {}); // after dispose + boot attempt for affected entr
266
266
  await server.dispose();
267
267
  ```
268
268
 
269
- `configuration` is the Mesh/Forge configuration **name** (`debug`, `release`, …), matching `--configuration`. Defaults to `debug`. Pass `workspace` in tests to skip `WorkspaceFactory`.
269
+ `configuration` is the workspace configuration **name** (`debug`, `release`, …), matching `--configuration`. Defaults to `debug`. Pass `workspace` in tests to skip `WorkspaceFactory`.
270
270
 
271
271
  `flux.run` keeps Node ESM hooks registered for the process so the imported graph can still load `.ts`. Do not dispose the loader after a successful run.
272
272
 
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "DeferredScriptRunner", {
10
10
  });
11
11
  const _nodechild_process = require("node:child_process");
12
12
  const _decorators = require("@decohere/crucible/decorators");
13
- const _interop = require("@decohere/nexus/interop");
13
+ const _interop = require("@decohere/core/interop");
14
14
  const _scribe = require("@decohere/scribe");
15
15
  function _ts_decorate(decorators, target, key, desc) {
16
16
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "FluxCommand", {
8
8
  return FluxCommand;
9
9
  }
10
10
  });
11
- const _cli = require("@decohere/nexus/cli");
11
+ const _cli = require("@decohere/core/cli");
12
12
  const _runcommand = require("./run.command.js");
13
13
  const _servecommand = require("./serve.command.js");
14
14
  class FluxCommand extends _cli.DecohereCommand {
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "FluxModule", {
9
9
  }
10
10
  });
11
11
  const _forge = require("@decohere/forge");
12
- const _cli = require("@decohere/nexus/cli");
12
+ const _cli = require("@decohere/core/cli");
13
13
  const _deferredscriptrunner = require("./deferred-script-runner.js");
14
14
  const _fluxcommand = require("./flux.command.js");
15
15
  const _hotreloadserver = require("./hot-reload-server.js");
@@ -27,8 +27,8 @@ _export(exports, {
27
27
  });
28
28
  const _nodeevents = require("node:events");
29
29
  const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
30
- const _io = require("@decohere/nexus/io");
31
- const _system = require("@decohere/nexus/system");
30
+ const _io = require("@decohere/core/io");
31
+ const _system = require("@decohere/core/system");
32
32
  const _scribe = require("@decohere/scribe");
33
33
  const _sourcemoduleloader = require("./source-module-loader.js");
34
34
  function _interop_require_default(obj) {
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "rewriteServeSpecifier", {
10
10
  });
11
11
  const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
12
12
  const _nodeurl = require("node:url");
13
- const _mesh = require("@decohere/mesh");
13
+ const _workspace = require("@decohere/workspace");
14
14
  function _interop_require_default(obj) {
15
15
  return obj && obj.__esModule ? obj : {
16
16
  default: obj
@@ -35,18 +35,18 @@ function rewriteServeSpecifier(options) {
35
35
  * `index` source of the directory it names. A file wins over a directory of the same name.
36
36
  */ function watchedTs(filePath, isWatchedTs) {
37
37
  const withoutSlash = filePath.replace(/[/\\]+$/, "");
38
- // Mesh's alias lookup may have added `.ts` to a subpath that names a directory (`@lib/models`
38
+ // The workspace alias lookup may have added `.ts` to a subpath that names a directory (`@lib/models`
39
39
  // arrives as `…/models.ts`), so the directory is the path without any extension.
40
40
  const directory = withoutSlash.replace(/\.([mc]?[jt]sx?)$/, "");
41
41
  const candidates = [
42
- ..._mesh.sourceExtensions.candidates(withoutSlash),
43
- ..._mesh.sourceExtensions.candidates(directory),
44
- ..._mesh.sourceExtensions.candidates(_nodepath.default.join(directory, "index"))
42
+ ..._workspace.sourceExtensions.candidates(withoutSlash),
43
+ ..._workspace.sourceExtensions.candidates(directory),
44
+ ..._workspace.sourceExtensions.candidates(_nodepath.default.join(directory, "index"))
45
45
  ];
46
46
  return candidates.find((candidate)=>isWatchedTs(candidate)) ?? null;
47
47
  }
48
48
  function resolveRelativeWatchedTs(specifier, parentUrl, isWatchedTs) {
49
- if (_mesh.packageAliases.isBareSpecifier(specifier)) return null;
49
+ if (_workspace.packageAliases.isBareSpecifier(specifier)) return null;
50
50
  if (!(specifier.startsWith(".") || specifier.startsWith("/"))) return null;
51
51
  const parentClean = parentUrl.split("?")[0];
52
52
  if (parentClean == null || parentClean === "") return null;
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "RunAction", {
9
9
  }
10
10
  });
11
11
  const _decorators = require("@decohere/crucible/decorators");
12
- const _mesh = require("@decohere/mesh");
13
- const _cli = require("@decohere/nexus/cli");
12
+ const _workspace = require("@decohere/workspace");
13
+ const _cli = require("@decohere/core/cli");
14
14
  const _scribe = require("@decohere/scribe");
15
15
  const _flux = require("./flux.js");
16
16
  function _ts_decorate(decorators, target, key, desc) {
@@ -42,6 +42,6 @@ RunAction = _ts_decorate([
42
42
  (0, _decorators.injectable)(),
43
43
  _ts_metadata("design:type", Function),
44
44
  _ts_metadata("design:paramtypes", [
45
- typeof _mesh.Workspace === "undefined" ? Object : _mesh.Workspace
45
+ typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace
46
46
  ])
47
47
  ], RunAction);
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "RunCommand", {
8
8
  return RunCommand;
9
9
  }
10
10
  });
11
- const _cli = require("@decohere/nexus/cli");
11
+ const _cli = require("@decohere/core/cli");
12
12
  const _runaction = require("./run.action.js");
13
13
  class RunCommand extends _cli.DecohereCommand {
14
14
  get actions() {
@@ -10,8 +10,8 @@ Object.defineProperty(exports, "ServeAction", {
10
10
  });
11
11
  const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
12
12
  const _decorators = require("@decohere/crucible/decorators");
13
- const _mesh = require("@decohere/mesh");
14
- const _cli = require("@decohere/nexus/cli");
13
+ const _workspace = require("@decohere/workspace");
14
+ const _cli = require("@decohere/core/cli");
15
15
  const _scribe = require("@decohere/scribe");
16
16
  const _deferredscriptrunner = require("./deferred-script-runner.js");
17
17
  const _hotreloadserver = require("./hot-reload-server.js");
@@ -114,7 +114,7 @@ ServeAction = _ts_decorate([
114
114
  _ts_metadata("design:type", Function),
115
115
  _ts_metadata("design:paramtypes", [
116
116
  typeof _hotreloadserver.HotReloadServer === "undefined" ? Object : _hotreloadserver.HotReloadServer,
117
- typeof _mesh.Workspace === "undefined" ? Object : _mesh.Workspace,
117
+ typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace,
118
118
  typeof _deferredscriptrunner.DeferredScriptRunner === "undefined" ? Object : _deferredscriptrunner.DeferredScriptRunner
119
119
  ])
120
120
  ], ServeAction);
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "ServeCommand", {
8
8
  return ServeCommand;
9
9
  }
10
10
  });
11
- const _cli = require("@decohere/nexus/cli");
11
+ const _cli = require("@decohere/core/cli");
12
12
  const _hotreloadserver = require("./hot-reload-server.js");
13
13
  const _serveaction = require("./serve.action.js");
14
14
  class ServeCommand extends _cli.DecohereCommand {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Directory-slice helpers for `flux serve <dir>…` — classify Mesh packages as
2
+ * Directory-slice helpers for `flux serve <dir>…` — classify workspace packages as
3
3
  * Flux apps, Nixpacks-style script deferrals, or libraries to skip.
4
4
  */ "use strict";
5
5
  Object.defineProperty(exports, "__esModule", {
@@ -14,8 +14,8 @@ const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
14
14
  const _nodeurl = require("node:url");
15
15
  const _decorators = require("@decohere/crucible/decorators");
16
16
  const _forge = require("@decohere/forge");
17
- const _mesh = require("@decohere/mesh");
18
- const _io = require("@decohere/nexus/io");
17
+ const _workspace = require("@decohere/workspace");
18
+ const _io = require("@decohere/core/io");
19
19
  const _scribe = require("@decohere/scribe");
20
20
  const _rewriteservespecifier = require("./rewrite-serve-specifier.js");
21
21
  const _staticimports = require("./static-imports.js");
@@ -138,7 +138,7 @@ class SourceModuleLoader {
138
138
  specifier,
139
139
  parentUrl,
140
140
  isWatchedTs: (filePath)=>this.fileInfoMap.has(filePath),
141
- resolveBare: (bare)=>_mesh.packageAliases.resolvePath(bare, this.aliasPaths, this.aliasBaseUrl),
141
+ resolveBare: (bare)=>_workspace.packageAliases.resolvePath(bare, this.aliasPaths, this.aliasBaseUrl),
142
142
  versionFileUrl: this.versionFileUrl
143
143
  }) ?? specifier;
144
144
  const result = next(rewritten, context);
@@ -251,7 +251,7 @@ class SourceModuleLoader {
251
251
  specifier,
252
252
  parentUrl,
253
253
  isWatchedTs: (filePath)=>this.fileInfoMap.has(filePath),
254
- resolveBare: (bare)=>_mesh.packageAliases.resolvePath(bare, this.aliasPaths, this.aliasBaseUrl),
254
+ resolveBare: (bare)=>_workspace.packageAliases.resolvePath(bare, this.aliasPaths, this.aliasBaseUrl),
255
255
  versionFileUrl: (fileUrl)=>fileUrl
256
256
  });
257
257
  return url == null ? null : (0, _nodeurl.fileURLToPath)(url);
@@ -259,11 +259,11 @@ class SourceModuleLoader {
259
259
  loadTs(url) {
260
260
  if (!url.startsWith("file:")) return null;
261
261
  // fileURLToPath, not URL.pathname: decodes %20 and gives Windows paths, so files
262
- // whose path has a space still match Mesh's list (#511).
262
+ // whose path has a space still match the workspace's package list (#511).
263
263
  const cleanPath = (0, _nodeurl.fileURLToPath)(url);
264
264
  const fileInfo = this.fileInfoMap.get(cleanPath);
265
265
  if (fileInfo == null) return null;
266
- const format = _mesh.sourceExtensions.isCommonJs(cleanPath) ? "commonjs" : "module";
266
+ const format = _workspace.sourceExtensions.isCommonJs(cleanPath) ? "commonjs" : "module";
267
267
  const cached = this.transpileCache.get(cleanPath);
268
268
  if (cached != null) return {
269
269
  source: cached,
@@ -337,7 +337,7 @@ class SourceModuleLoader {
337
337
  * directory indexes), so SWC does not resolve them a second time against the disk.
338
338
  */ swcConfigFor(project, fullPath) {
339
339
  const config = this.esModuleConfigFor(project);
340
- if (!_mesh.sourceExtensions.isCommonJs(fullPath)) return config;
340
+ if (!_workspace.sourceExtensions.isCommonJs(fullPath)) return config;
341
341
  // `.cts` is CommonJS: Node loads it with `require` semantics, so SWC emits CommonJS (#518).
342
342
  // Kept per project, like the ES module options, so the disk cache hashes them once.
343
343
  const cached = this.commonJsConfigs.get(project);
@@ -6,7 +6,7 @@ function _ts_decorate(decorators, target, key, desc) {
6
6
  }
7
7
  import { spawn } from "node:child_process";
8
8
  import { injectable } from "@decohere/crucible/decorators";
9
- import { detectPackageManager, packageManagerFromString } from "@decohere/nexus/interop";
9
+ import { detectPackageManager, packageManagerFromString } from "@decohere/core/interop";
10
10
  import { scribe } from "@decohere/scribe";
11
11
  export class DeferredScriptRunner {
12
12
  logger = scribe.logger(DeferredScriptRunner.name);
@@ -1,4 +1,4 @@
1
- import { DecohereCommand } from "@decohere/nexus/cli";
1
+ import { DecohereCommand } from "@decohere/core/cli";
2
2
  import { RunCommand } from "./run.command.js";
3
3
  import { ServeCommand } from "./serve.command.js";
4
4
  export class FluxCommand extends DecohereCommand {
@@ -1,5 +1,5 @@
1
1
  import { createWorkspace } from "@decohere/forge";
2
- import { ModuleManifest } from "@decohere/nexus/cli";
2
+ import { ModuleManifest } from "@decohere/core/cli";
3
3
  import { DeferredScriptRunner } from "./deferred-script-runner.js";
4
4
  import { FluxCommand } from "./flux.command.js";
5
5
  import { HotReloadServer } from "./hot-reload-server.js";
@@ -1,7 +1,7 @@
1
1
  import { EventEmitter } from "node:events";
2
2
  import path from "node:path";
3
- import { io } from "@decohere/nexus/io";
4
- import { debounce } from "@decohere/nexus/system";
3
+ import { io } from "@decohere/core/io";
4
+ import { debounce } from "@decohere/core/system";
5
5
  import { scribe } from "@decohere/scribe";
6
6
  import { SourceModuleLoader } from "./source-module-loader.js";
7
7
  const currentFilePath = io.fileUrlToPath(import.meta.url);
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath, pathToFileURL } from "node:url";
3
- import { packageAliases, sourceExtensions } from "@decohere/mesh";
3
+ import { packageAliases, sourceExtensions } from "@decohere/workspace";
4
4
  /**
5
5
  * Map a resolve-hook specifier to a versioned watched `.ts` file URL.
6
6
  * Covers relative `.js` / `.ts` / extensionless imports, directory imports (`./models` is
@@ -25,7 +25,7 @@ import { packageAliases, sourceExtensions } from "@decohere/mesh";
25
25
  * `index` source of the directory it names. A file wins over a directory of the same name.
26
26
  */ function watchedTs(filePath, isWatchedTs) {
27
27
  const withoutSlash = filePath.replace(/[/\\]+$/, "");
28
- // Mesh's alias lookup may have added `.ts` to a subpath that names a directory (`@lib/models`
28
+ // The workspace alias lookup may have added `.ts` to a subpath that names a directory (`@lib/models`
29
29
  // arrives as `…/models.ts`), so the directory is the path without any extension.
30
30
  const directory = withoutSlash.replace(/\.([mc]?[jt]sx?)$/, "");
31
31
  const candidates = [
@@ -8,8 +8,8 @@ function _ts_metadata(k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  }
10
10
  import { injectable } from "@decohere/crucible/decorators";
11
- import { Workspace } from "@decohere/mesh";
12
- import { ActionResponse } from "@decohere/nexus/cli";
11
+ import { Workspace } from "@decohere/workspace";
12
+ import { ActionResponse } from "@decohere/core/cli";
13
13
  import { scribe } from "@decohere/scribe";
14
14
  import { flux } from "./flux.js";
15
15
  export class RunAction {
@@ -1,4 +1,4 @@
1
- import { ConfigurationOption, DecohereCommand } from "@decohere/nexus/cli";
1
+ import { ConfigurationOption, DecohereCommand } from "@decohere/core/cli";
2
2
  import { RunAction } from "./run.action.js";
3
3
  export class RunCommand extends DecohereCommand {
4
4
  get actions() {
@@ -9,8 +9,8 @@ function _ts_metadata(k, v) {
9
9
  }
10
10
  import path from "node:path";
11
11
  import { injectable } from "@decohere/crucible/decorators";
12
- import { Workspace } from "@decohere/mesh";
13
- import { ActionResponse } from "@decohere/nexus/cli";
12
+ import { Workspace } from "@decohere/workspace";
13
+ import { ActionResponse } from "@decohere/core/cli";
14
14
  import { scribe } from "@decohere/scribe";
15
15
  import { DeferredScriptRunner } from "./deferred-script-runner.js";
16
16
  import { HotReloadServer } from "./hot-reload-server.js";
@@ -1,4 +1,4 @@
1
- import { ConfigurationOption, DecohereCommand, ProjectOption } from "@decohere/nexus/cli";
1
+ import { ConfigurationOption, DecohereCommand, ProjectOption } from "@decohere/core/cli";
2
2
  import { DEFAULT_REBOOT_DEBOUNCE_MS, resolveRebootDebounceMs } from "./hot-reload-server.js";
3
3
  import { ServeAction } from "./serve.action.js";
4
4
  export class ServeCommand extends DecohereCommand {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Directory-slice helpers for `flux serve <dir>…` — classify Mesh packages as
2
+ * Directory-slice helpers for `flux serve <dir>…` — classify workspace packages as
3
3
  * Flux apps, Nixpacks-style script deferrals, or libraries to skip.
4
4
  */ /** Preferred package scripts for foreign toolchains (Nixpacks-style). */ export const DEFER_SCRIPT_CANDIDATES = [
5
5
  "dev",
@@ -10,8 +10,8 @@ import path from "node:path";
10
10
  import { fileURLToPath, pathToFileURL } from "node:url";
11
11
  import { injectable } from "@decohere/crucible/decorators";
12
12
  import { BuildTargets, createWorkspace, SwcTranspiler } from "@decohere/forge";
13
- import { packageAliases, sourceExtensions } from "@decohere/mesh";
14
- import { FileEx, io } from "@decohere/nexus/io";
13
+ import { packageAliases, sourceExtensions } from "@decohere/workspace";
14
+ import { FileEx, io } from "@decohere/core/io";
15
15
  import { scribe } from "@decohere/scribe";
16
16
  import { rewriteServeSpecifier } from "./rewrite-serve-specifier.js";
17
17
  import { staticImports } from "./static-imports.js";
@@ -203,7 +203,7 @@ export class SourceModuleLoader {
203
203
  loadTs(url) {
204
204
  if (!url.startsWith("file:")) return null;
205
205
  // fileURLToPath, not URL.pathname: decodes %20 and gives Windows paths, so files
206
- // whose path has a space still match Mesh's list (#511).
206
+ // whose path has a space still match the workspace's package list (#511).
207
207
  const cleanPath = fileURLToPath(url);
208
208
  const fileInfo = this.fileInfoMap.get(cleanPath);
209
209
  if (fileInfo == null) return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decohere/flux",
3
- "version": "0.0.1-dev.114",
3
+ "version": "0.0.1-dev.116",
4
4
  "description": "Hot module reload server for Node.js ESM applications",
5
5
  "keywords": [
6
6
  "typescript",
@@ -25,11 +25,11 @@
25
25
  "test": "echo \"Error: no test specified\" && exit 1"
26
26
  },
27
27
  "dependencies": {
28
- "@decohere/crucible": "0.0.1-dev.114",
29
- "@decohere/forge": "0.0.1-dev.114",
30
- "@decohere/mesh": "0.0.1-dev.114",
31
- "@decohere/nexus": "0.0.1-dev.114",
32
- "@decohere/scribe": "0.0.1-dev.114",
28
+ "@decohere/core": "0.0.1-dev.116",
29
+ "@decohere/crucible": "0.0.1-dev.116",
30
+ "@decohere/forge": "0.0.1-dev.116",
31
+ "@decohere/scribe": "0.0.1-dev.116",
32
+ "@decohere/workspace": "0.0.1-dev.116",
33
33
  "commander": "^13.1.0",
34
34
  "rxjs": "^7.8.2"
35
35
  },
@@ -1,5 +1,5 @@
1
- import type { Actions } from "@decohere/nexus/cli";
2
- import { type CommandHandler, type CommandResponse, type CommandType, DecohereCommand } from "@decohere/nexus/cli";
1
+ import type { Actions } from "@decohere/core/cli";
2
+ import { type CommandHandler, type CommandResponse, type CommandType, DecohereCommand } from "@decohere/core/cli";
3
3
  export declare class FluxCommand extends DecohereCommand {
4
4
  constructor(commands: Record<string, CommandType>, handler: CommandHandler);
5
5
  run(_actions: Actions, _options: never): Promise<CommandResponse>;
@@ -1,7 +1,7 @@
1
- import type { Workspace } from "@decohere/mesh";
1
+ import type { Workspace } from "@decohere/workspace";
2
2
  import { HotReloadServer } from "./hot-reload-server.js";
3
3
  export type FluxRunOptions = {
4
- /** Mesh/Forge configuration name. Defaults to `debug` (`--configuration`). */
4
+ /** Workspace configuration name. Defaults to `debug` (`--configuration`). */
5
5
  configuration?: string;
6
6
  /** Arguments forwarded to the entry (bin-style `process.argv.slice(2)`). */
7
7
  args?: string[];
@@ -12,7 +12,7 @@ export type FluxRunOptions = {
12
12
  workspace?: Workspace;
13
13
  };
14
14
  export type FluxServeOptions = {
15
- /** Mesh/Forge configuration name. Defaults to `debug` (`--configuration`). */
15
+ /** Workspace configuration name. Defaults to `debug` (`--configuration`). */
16
16
  configuration?: string;
17
17
  /** Name of the project to serve. Defaults to the first project in the workspace. */
18
18
  project?: string;
@@ -1,6 +1,6 @@
1
- import type { WorkspaceFactoryOptions } from "@decohere/nexus/cli";
2
- import { ModuleManifest } from "@decohere/nexus/cli";
3
- import type { ContainerBuilder } from "@decohere/nexus/composition";
1
+ import type { WorkspaceFactoryOptions } from "@decohere/core/cli";
2
+ import { ModuleManifest } from "@decohere/core/cli";
3
+ import type { ContainerBuilder } from "@decohere/core/composition";
4
4
  import { FluxCommand } from "./flux.command.js";
5
5
  import { RunAction } from "./run.action.js";
6
6
  import { ServeAction } from "./serve.action.js";
@@ -12,5 +12,5 @@ export declare class FluxModule extends ModuleManifest {
12
12
  run: typeof RunAction;
13
13
  };
14
14
  registerServices(builder: ContainerBuilder): void;
15
- createWorkspace(options: WorkspaceFactoryOptions): Promise<import("@decohere/mesh").Workspace>;
15
+ createWorkspace(options: WorkspaceFactoryOptions): Promise<import("@decohere/workspace").Workspace>;
16
16
  }
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from "node:events";
2
- import type { Workspace } from "@decohere/mesh";
2
+ import type { Workspace } from "@decohere/workspace";
3
3
  /** Default quiet window before a file-change reboot. */
4
4
  export declare const DEFAULT_REBOOT_DEBOUNCE_MS = 250;
5
5
  export declare function resolveRebootDebounceMs(value: number | undefined): number;
@@ -1,5 +1,5 @@
1
- import { Workspace } from "@decohere/mesh";
2
- import { type Action, ActionResponse } from "@decohere/nexus/cli";
1
+ import { Workspace } from "@decohere/workspace";
2
+ import { type Action, ActionResponse } from "@decohere/core/cli";
3
3
  export type RunOptions = {
4
4
  /** Absolute or cwd-relative path to a `.ts` entry file. */
5
5
  entry: string;
@@ -1,4 +1,4 @@
1
- import { DecohereCommand } from "@decohere/nexus/cli";
1
+ import { DecohereCommand } from "@decohere/core/cli";
2
2
  import { RunAction } from "./run.action.js";
3
3
  export declare class RunCommand extends DecohereCommand {
4
4
  get actions(): (typeof RunAction)[];
@@ -1,5 +1,5 @@
1
- import { Workspace } from "@decohere/mesh";
2
- import { type Action, ActionResponse } from "@decohere/nexus/cli";
1
+ import { Workspace } from "@decohere/workspace";
2
+ import { type Action, ActionResponse } from "@decohere/core/cli";
3
3
  import { DeferredScriptRunner } from "./deferred-script-runner.js";
4
4
  import { HotReloadServer } from "./hot-reload-server.js";
5
5
  export type ServeOptions = {
@@ -1,4 +1,4 @@
1
- import { DecohereCommand } from "@decohere/nexus/cli";
1
+ import { DecohereCommand } from "@decohere/core/cli";
2
2
  import { ServeAction } from "./serve.action.js";
3
3
  export declare class ServeCommand extends DecohereCommand {
4
4
  get actions(): (typeof ServeAction)[];
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Directory-slice helpers for `flux serve <dir>…` — classify Mesh packages as
2
+ * Directory-slice helpers for `flux serve <dir>…` — classify workspace packages as
3
3
  * Flux apps, Nixpacks-style script deferrals, or libraries to skip.
4
4
  */
5
5
  export type SliceProjectView = {
@@ -1,5 +1,5 @@
1
1
  import type { ResolveFnOutput } from "node:module";
2
- import type { Project, Workspace } from "@decohere/mesh";
2
+ import type { Project, Workspace } from "@decohere/workspace";
3
3
  export interface SourceModuleLoaderOptions {
4
4
  /** Build configuration name. */
5
5
  buildConfig: string;