@codemation/host 0.7.0 → 0.8.0

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/LICENSE +37 -1
  3. package/dist/{AppConfigFactory-DnLoQ9Li.d.ts → AppConfigFactory-BT0y0LVC.d.ts} +3 -3
  4. package/dist/{AppContainerFactory-DqKYCRNP.js → AppContainerFactory-DRTjG7nG.js} +13 -5
  5. package/dist/{AppContainerFactory-DqKYCRNP.js.map → AppContainerFactory-DRTjG7nG.js.map} +1 -1
  6. package/dist/{CodemationAppContext-CKVv9W9q.d.ts → CodemationAppContext-CGFYVcSb.d.ts} +7 -1
  7. package/dist/{CodemationAuthoring.types-NGkBcmmT.js → CodemationAuthoring.types-BteaR3Dc.js} +3 -2
  8. package/dist/CodemationAuthoring.types-BteaR3Dc.js.map +1 -0
  9. package/dist/{CodemationAuthoring.types-DA3G3s6d.d.ts → CodemationAuthoring.types-DiKKogum.d.ts} +7 -2
  10. package/dist/{CodemationConfigNormalizer-BAKjetJ6.d.ts → CodemationConfigNormalizer-48f-T66P.d.ts} +2 -2
  11. package/dist/{CodemationConsumerConfigLoader-GYpBBvqE.js → CodemationConsumerConfigLoader-By-6tuGc.js} +3 -1
  12. package/dist/CodemationConsumerConfigLoader-By-6tuGc.js.map +1 -0
  13. package/dist/{CodemationConsumerConfigLoader-nxOqvv46.d.ts → CodemationConsumerConfigLoader-_PIYqwVx.d.ts} +3 -2
  14. package/dist/{CodemationPluginListMerger-DKLAHT2b.d.ts → CodemationPluginListMerger-DP7djJ9S.d.ts} +50 -25
  15. package/dist/{CredentialServices-Be2I60Th.d.ts → CredentialServices-BLloBztI.d.ts} +2 -2
  16. package/dist/{InternalHonoApiRouteRegistrar-Ce1yxpnO.d.ts → InternalHonoApiRouteRegistrar-c7t3KnV_.d.ts} +1 -1
  17. package/dist/{PublicFrontendBootstrapFactory-CY2FS-5g.d.ts → PublicFrontendBootstrapFactory-Dv04tJ-6.d.ts} +2 -2
  18. package/dist/authoring.d.ts +2 -2
  19. package/dist/authoring.js +1 -1
  20. package/dist/consumer.d.ts +3 -3
  21. package/dist/consumer.js +1 -1
  22. package/dist/credentials.d.ts +2 -2
  23. package/dist/index.d.ts +44 -13
  24. package/dist/index.js +100 -7
  25. package/dist/index.js.map +1 -0
  26. package/dist/nextServer.d.ts +7 -33
  27. package/dist/nextServer.js +1 -1
  28. package/dist/pairing.d.ts +1 -1
  29. package/dist/{persistenceServer-CeTHtC6E.d.ts → persistenceServer-B71RGvSj.d.ts} +3 -3
  30. package/dist/persistenceServer.d.ts +4 -4
  31. package/dist/{server-C4bS62rg.d.ts → server-09PKasWR.d.ts} +5 -5
  32. package/dist/{server-Y7kxwtCK.js → server-vtRCPgRJ.js} +3 -3
  33. package/dist/{server-Y7kxwtCK.js.map → server-vtRCPgRJ.js.map} +1 -1
  34. package/dist/server.d.ts +7 -7
  35. package/dist/server.js +3 -3
  36. package/package.json +26 -24
  37. package/src/bootstrap/AppContainerFactory.ts +21 -3
  38. package/src/bootstrap/runtime/HeadlessApiRuntime.ts +47 -0
  39. package/src/credentials/ControlPlaneCatalogFetcher.ts +6 -6
  40. package/src/index.ts +3 -0
  41. package/src/presentation/config/CodemationAuthoring.types.ts +7 -1
  42. package/src/presentation/config/CodemationConfig.ts +6 -0
  43. package/src/presentation/http/HeadlessHttpServerFactory.ts +56 -0
  44. package/src/presentation/server/CodemationConsumerConfigLoader.ts +7 -2
  45. package/src/presentation/websocket/WorkflowWebsocketServerFactory.ts +16 -0
  46. package/dist/CodemationAuthoring.types-NGkBcmmT.js.map +0 -1
  47. package/dist/CodemationConsumerConfigLoader-GYpBBvqE.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # @codemation/host
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#150](https://github.com/MadeRelevant/codemation/pull/150) [`8ac207a`](https://github.com/MadeRelevant/codemation/commit/8ac207ab263542e46fad0b9e1ea584fbb71a747c) Thanks [@cblokland90](https://github.com/cblokland90)! - Add workspace-host Docker image packaging and managed template peerDeps fix.
8
+ - Move @codemation/\* from dependencies to peerDependencies in the managed template (avoids n8n-style dual-instance singleton trap at runtime; framework packages resolve from the base image)
9
+ - Add codemationVersion: "1.0.0" field to managed template codemation.config.ts and DefineCodemationAppOptions (reserved compatibility-date slot, no enforcement yet)
10
+ - Add packages/host/src/bin/server.ts standalone entry point for workspace pod runtime
11
+ - Add packaging/workspace-host/Dockerfile for the codemation-workspace-host:1.0.0 base image
12
+
13
+ ### Patch Changes
14
+
15
+ - [#153](https://github.com/MadeRelevant/codemation/pull/153) [`a70e182`](https://github.com/MadeRelevant/codemation/commit/a70e182a852026e4f6d8f317fe9862417dc23ce6) Thanks [@cblokland90](https://github.com/cblokland90)! - Move UI-only packages (monaco-editor, react, @xyflow/react, dagre, lucide-react, rc-tree, etc.) from `dependencies` to `devDependencies` in @codemation/host. No runtime source in `packages/host/src` imports these packages — they were vestigial from before the UI was extracted to @codemation/next-host. Moving them ensures pnpm filtered installs (e.g. `--filter @codemation/host...`) no longer pull in ~1.5 GB of UI dependencies, which is required for the workspace-host container image to stay small.
16
+
17
+ - [#156](https://github.com/MadeRelevant/codemation/pull/156) [`5315e23`](https://github.com/MadeRelevant/codemation/commit/5315e2361492560601ac2c97491aa58c49346fd4) Thanks [@cblokland90](https://github.com/cblokland90)! - fix(host): only throw on invalid WORKSPACE_PAIRING_SECRET in managed mode
18
+
19
+ Previously, setting WORKSPACE_PAIRING_SECRET to an invalid value (not a 32-byte base64 string) would crash the host at boot time even when running in non-managed mode (the default). Framework consumers who accidentally set this env var or left a misconfigured value would see an opaque boot error unrelated to their actual configuration.
20
+
21
+ After this fix, the invalid-secret error is only propagated in `auth.kind: "managed"` mode. In all other modes, the error is caught, a warning is logged, and the host boots normally without pairing infrastructure wired up. Managed-mode consumers continue to see the full error at startup.
22
+
23
+ - [#152](https://github.com/MadeRelevant/codemation/pull/152) [`ac860a5`](https://github.com/MadeRelevant/codemation/commit/ac860a5af1df3e5766581e644fef8cc0d1b24eba) Thanks [@cblokland90](https://github.com/cblokland90)! - Fix ControlPlaneCatalogFetcher calling wrong URL path (sprint-mvp/01).
24
+
25
+ The fetcher was calling `/api/catalog/*` (session-gated in the CP) instead of
26
+ `/internal/catalog/*` (HMAC-gated). The CP's `/api/*` router returned 401 for
27
+ every HMAC-signed request because it requires a Better Auth session cookie, not a
28
+ workspace pairing signature.
29
+
30
+ This caused every provisioned workspace to log steady `HTTP 401 Unauthorized`
31
+ errors from `ControlPlaneCatalogFetcher`, blocking OAuth credential-type and MCP
32
+ server catalog fetches.
33
+
34
+ - [#157](https://github.com/MadeRelevant/codemation/pull/157) [`3025b86`](https://github.com/MadeRelevant/codemation/commit/3025b8685b0d7ad60c506b5a0f21967e681a25ea) Thanks [@cblokland90](https://github.com/cblokland90)! - Shrink workspace-host Docker image by decoupling CLI from next-host at runtime.
35
+
36
+ `@codemation/cli`: demote `@codemation/next-host` from `dependencies` to `devDependencies`. The CLI's
37
+ non-headless serve path resolves the next-host package at runtime via `require.resolve()`; the
38
+ headless path (used by workspace-host pods) never touches it. Consumers that install `@codemation/cli`
39
+ from the registry and need the UI shell must add `@codemation/next-host` as a direct dependency.
40
+
41
+ `@codemation/core-nodes`: demote `lucide-react` from `dependencies` to `devDependencies`. The package
42
+ only references lucide icon names as strings (e.g. `"lucide:bot"`); it never imports the react library
43
+ at runtime. This removes ~46 MB from runtime installs of `@codemation/core-nodes`.
44
+
45
+ `@codemation/host`: promote `execa` and `dotenv` from `devDependencies` to `dependencies`. Both are
46
+ required at Dockerfile build time by `scripts/generate-prisma-clients.mjs` (imports `execaSync` from
47
+ `execa`) and `prisma.config.ts` (imports `dotenv/config`). These files run during `prisma:generate`
48
+ which executes in the production builder stage with `--prod` install (no devDeps available).
49
+
50
+ - Updated dependencies [[`e0933eb`](https://github.com/MadeRelevant/codemation/commit/e0933ebc51806a9593f94758860c591b8346a7a5), [`3025b86`](https://github.com/MadeRelevant/codemation/commit/3025b8685b0d7ad60c506b5a0f21967e681a25ea)]:
51
+ - @codemation/core@0.11.1
52
+ - @codemation/core-nodes@0.8.1
53
+ - @codemation/eventbus-redis@0.0.39
54
+
3
55
  ## 0.7.0
4
56
 
5
57
  ### Minor Changes
package/LICENSE CHANGED
@@ -1 +1,37 @@
1
- ../../LICENSE
1
+ Codemation Pre-Stable License
2
+
3
+ Copyright (c) Made Relevant B.V. All rights reserved.
4
+
5
+ 1. Definitions
6
+
7
+ "Software" means the Codemation source code, documentation, and artifacts in this repository and any published npm packages in the Codemation monorepo.
8
+
9
+ "Stable Version" means the first published release of the package `@codemation/core` on the public npm registry with version 1.0.0 or higher.
10
+
11
+ 2. Permitted use (before Stable Version)
12
+
13
+ Until a Stable Version exists, you may use, copy, modify, and distribute the Software only for non-commercial purposes, including personal learning, research, evaluation, and internal use within your organization that does not charge third parties for access to the Software or a product or service whose primary value is the Software.
14
+
15
+ 3. Restrictions (before Stable Version)
16
+
17
+ Until a Stable Version exists, you must not:
18
+
19
+ a) Sell, rent, lease, or sublicense the Software or a derivative work for a fee;
20
+
21
+ b) Offer the Software or a derivative work as part of a paid product or service (including hosting, support, or consulting) where the Software is a material part of the offering;
22
+
23
+ c) Use the Software or a derivative work primarily to generate revenue or commercial advantage for you or others.
24
+
25
+ These restrictions apply to all versions published before a Stable Version, even if a later Stable Version is released under different terms.
26
+
27
+ 4. After Stable Version
28
+
29
+ The maintainers may publish a Stable Version under different license terms. If they do, those terms apply only to that Stable Version and subsequent releases they designate; they do not automatically apply to earlier pre-stable versions.
30
+
31
+ 5. No warranty
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34
+
35
+ 6. Third-party components
36
+
37
+ The Software may include third-party components under their own licenses. Those licenses govern those components.
@@ -1,5 +1,5 @@
1
- import { i as AppPersistenceConfig, r as AppConfig } from "./CodemationAppContext-CKVv9W9q.js";
2
- import { t as NormalizedCodemationConfig } from "./CodemationConfigNormalizer-BAKjetJ6.js";
1
+ import { i as AppPersistenceConfig, r as AppConfig } from "./CodemationAppContext-CGFYVcSb.js";
2
+ import { t as NormalizedCodemationConfig } from "./CodemationConfigNormalizer-48f-T66P.js";
3
3
  import { AnyNull, AnyNullClass, DbNull, DbNullClass, Decimal, JsonNull, JsonNullClass, NullTypes as NullTypes$1, ObjectEnumValue, PrismaClientInitializationError, PrismaClientKnownRequestError, PrismaClientRustPanicError, PrismaClientUnknownRequestError, PrismaClientValidationError, RawValue, Sql, Value, empty, isAnyNull, isDbNull, isJsonNull, isObjectEnumValue, join, raw, sql as sqltag } from "@prisma/client-runtime-utils";
4
4
 
5
5
  //#region prisma-generated/prisma-postgresql-client/runtime/client.d.ts
@@ -42408,4 +42408,4 @@ declare class AppConfigFactory {
42408
42408
  }
42409
42409
  //#endregion
42410
42410
  export { PrismaClient as i, PrismaMigrationDeployer as n, PrismaDatabaseClient as r, AppConfigFactory as t };
42411
- //# sourceMappingURL=AppConfigFactory-DnLoQ9Li.d.ts.map
42411
+ //# sourceMappingURL=AppConfigFactory-BT0y0LVC.d.ts.map
@@ -22570,9 +22570,9 @@ let ControlPlaneCatalogFetcher = class ControlPlaneCatalogFetcher$1 {
22570
22570
  const logger = this.loggers.create("ControlPlaneCatalogFetcher");
22571
22571
  const base = this.pairingConfig.controlPlaneUrl;
22572
22572
  const [oauthResult, mcpResult, credTypesResult] = await Promise.allSettled([
22573
- this.pairedFetch.get(`${base}/api/catalog/oauth-apps`),
22574
- this.pairedFetch.get(`${base}/api/catalog/mcp-servers`),
22575
- this.pairedFetch.get(`${base}/api/catalog/credential-types`)
22573
+ this.pairedFetch.get(`${base}/internal/catalog/oauth-apps`),
22574
+ this.pairedFetch.get(`${base}/internal/catalog/mcp-servers`),
22575
+ this.pairedFetch.get(`${base}/internal/catalog/credential-types`)
22576
22576
  ]);
22577
22577
  await this.handleEndpointResult(oauthResult, this.oauthAppsState, "oauth-apps", (data) => {
22578
22578
  this._oauthApps = data;
@@ -25745,7 +25745,15 @@ var AppContainerFactory = class AppContainerFactory {
25745
25745
  container$1.registerSingleton(ApplicationTokens.HonoApiRouteRegistrar, ManagedMeHonoApiRouteRegistrar);
25746
25746
  }
25747
25747
  registerPairingInfrastructure(container$1, appConfig) {
25748
- const pairingConfig = new PairingConfigFactory().create(appConfig.env);
25748
+ const isManagedMode = appConfig.auth?.kind === "managed";
25749
+ let pairingConfig;
25750
+ try {
25751
+ pairingConfig = new PairingConfigFactory().create(appConfig.env);
25752
+ } catch (err) {
25753
+ if (isManagedMode) throw err;
25754
+ container$1.resolve(ServerLoggerFactory).create("codemation.pairing").warn(`WORKSPACE_PAIRING_SECRET is set but invalid — pairing disabled. ${err instanceof Error ? err.message : String(err)}`);
25755
+ return;
25756
+ }
25749
25757
  if (!pairingConfig) {
25750
25758
  const missingVars = [];
25751
25759
  if (!appConfig.env["WORKSPACE_ID"]) missingVars.push("WORKSPACE_ID");
@@ -25922,4 +25930,4 @@ var AppContainerFactory = class AppContainerFactory {
25922
25930
 
25923
25931
  //#endregion
25924
25932
  export { WorkflowDefinitionMapper as A, CodemationHonoApiApp as C, FrontendAppConfigFactory as D, InternalAuthBootstrapFactory as E, StartWorkflowRunCommand as F, UpsertLocalBootstrapUserCommand as I, ListUserAccountsQuery as L, GetWorkflowDetailQuery as M, GetRunStateQuery as N, CodemationFrontendAuthSnapshotFactory as O, RunBinaryAttachmentLookupService as P, CredentialHttpRouteHandler as S, PublicFrontendBootstrapFactory as T, WorkflowHttpRouteHandler as _, GetCollectionQuery as a, RunHttpRouteHandler as b, InsertCollectionRowCommand as c, FrontendRuntime as d, CollectionSchemaSyncerHolder as f, ExecaProcessRunner as g, WorkflowRunRetentionPruneScheduler as h, GetCollectionRowQuery as i, GetWorkflowSummariesQuery as j, WorkflowWebsocketServer as k, DeleteCollectionRowCommand as l, AppContainerLifecycle as m, ListCollectionsQuery as n, UpdateCollectionRowCommand as o, DatabaseMigrations as p, ListCollectionRowsQuery as r, SyncCollectionsCommand as s, AppContainerFactory as t, WorkerRuntime as u, WebhookHttpRouteHandler as v, BinaryHttpRouteHandler as w, OAuth2HttpRouteHandler as x, RequestToWebhookItemMapper as y };
25925
- //# sourceMappingURL=AppContainerFactory-DqKYCRNP.js.map
25933
+ //# sourceMappingURL=AppContainerFactory-DRTjG7nG.js.map