@better-openclaw/core 1.0.7 → 1.0.9
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/dist/bare-metal-partition.d.mts.map +1 -1
- package/dist/bare-metal-partition.mjs +1 -0
- package/dist/bare-metal-partition.mjs.map +1 -1
- package/dist/composer.d.mts.map +1 -1
- package/dist/composer.mjs +11 -1
- package/dist/composer.mjs.map +1 -1
- package/dist/errors.d.mts +17 -0
- package/dist/errors.d.mts.map +1 -0
- package/dist/errors.mjs +24 -0
- package/dist/errors.mjs.map +1 -0
- package/dist/generate.d.mts +4 -3
- package/dist/generate.d.mts.map +1 -1
- package/dist/generate.mjs +13 -5
- package/dist/generate.mjs.map +1 -1
- package/dist/generators/traefik.d.mts +19 -0
- package/dist/generators/traefik.d.mts.map +1 -0
- package/dist/generators/traefik.mjs +86 -0
- package/dist/generators/traefik.mjs.map +1 -0
- package/dist/generators/traefik.test.d.mts +1 -0
- package/dist/generators/traefik.test.mjs +69 -0
- package/dist/generators/traefik.test.mjs.map +1 -0
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +4 -2
- package/dist/migrations.d.mts +14 -0
- package/dist/migrations.d.mts.map +1 -0
- package/dist/migrations.mjs +33 -0
- package/dist/migrations.mjs.map +1 -0
- package/dist/migrations.test.d.mts +1 -0
- package/dist/migrations.test.mjs +42 -0
- package/dist/migrations.test.mjs.map +1 -0
- package/dist/resolver.d.mts +6 -1
- package/dist/resolver.d.mts.map +1 -1
- package/dist/resolver.mjs +21 -3
- package/dist/resolver.mjs.map +1 -1
- package/dist/schema.d.mts +9 -0
- package/dist/schema.d.mts.map +1 -1
- package/dist/schema.mjs +4 -1
- package/dist/schema.mjs.map +1 -1
- package/dist/services/definitions/caddy.mjs +20 -1
- package/dist/services/definitions/caddy.mjs.map +1 -1
- package/dist/services/definitions/cal-com.d.mts +7 -0
- package/dist/services/definitions/cal-com.d.mts.map +1 -0
- package/dist/services/definitions/cal-com.mjs +88 -0
- package/dist/services/definitions/cal-com.mjs.map +1 -0
- package/dist/services/definitions/comfyui.d.mts +7 -0
- package/dist/services/definitions/comfyui.d.mts.map +1 -0
- package/dist/services/definitions/comfyui.mjs +83 -0
- package/dist/services/definitions/comfyui.mjs.map +1 -0
- package/dist/services/definitions/desktop-environment.d.mts +7 -0
- package/dist/services/definitions/desktop-environment.d.mts.map +1 -0
- package/dist/services/definitions/desktop-environment.mjs +153 -0
- package/dist/services/definitions/desktop-environment.mjs.map +1 -0
- package/dist/services/definitions/grafana.mjs +13 -1
- package/dist/services/definitions/grafana.mjs.map +1 -1
- package/dist/services/definitions/index.d.mts +7 -1
- package/dist/services/definitions/index.d.mts.map +1 -1
- package/dist/services/definitions/index.mjs +14 -2
- package/dist/services/definitions/index.mjs.map +1 -1
- package/dist/services/definitions/neo4j.d.mts +7 -0
- package/dist/services/definitions/neo4j.d.mts.map +1 -0
- package/dist/services/definitions/neo4j.mjs +91 -0
- package/dist/services/definitions/neo4j.mjs.map +1 -0
- package/dist/services/definitions/stream-gateway.d.mts +7 -0
- package/dist/services/definitions/stream-gateway.d.mts.map +1 -0
- package/dist/services/definitions/stream-gateway.mjs +133 -0
- package/dist/services/definitions/stream-gateway.mjs.map +1 -0
- package/dist/services/definitions/traefik.mjs +0 -1
- package/dist/services/definitions/traefik.mjs.map +1 -1
- package/dist/services/definitions/xyops.d.mts +7 -0
- package/dist/services/definitions/xyops.d.mts.map +1 -0
- package/dist/services/definitions/xyops.mjs +86 -0
- package/dist/services/definitions/xyops.mjs.map +1 -0
- package/dist/types.d.mts +8 -1
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +10 -0
- package/dist/types.mjs.map +1 -1
- package/dist/validator.mjs +11 -0
- package/dist/validator.mjs.map +1 -1
- package/dist/version-manager.d.mts +1 -1
- package/dist/version-manager.d.mts.map +1 -1
- package/dist/version-manager.mjs +11 -5
- package/dist/version-manager.mjs.map +1 -1
- package/dist/version-manager.test.d.mts +1 -0
- package/dist/version-manager.test.mjs +102 -0
- package/dist/version-manager.test.mjs.map +1 -0
- package/package.json +1 -1
- package/src/__snapshots__/composer.snapshot.test.ts.snap +15 -1
- package/src/bare-metal-partition.ts +1 -0
- package/src/composer.ts +22 -1
- package/src/errors.ts +23 -0
- package/src/generate.ts +22 -4
- package/src/generators/traefik.test.ts +97 -0
- package/src/generators/traefik.ts +104 -0
- package/src/index.ts +7 -1
- package/src/migrations.test.ts +36 -0
- package/src/migrations.ts +49 -0
- package/src/resolver.ts +37 -3
- package/src/schema.ts +3 -0
- package/src/services/definitions/caddy.ts +23 -1
- package/src/services/definitions/cal-com.ts +91 -0
- package/src/services/definitions/comfyui.ts +90 -0
- package/src/services/definitions/desktop-environment.ts +163 -0
- package/src/services/definitions/grafana.ts +16 -1
- package/src/services/definitions/index.ts +18 -0
- package/src/services/definitions/neo4j.ts +96 -0
- package/src/services/definitions/stream-gateway.ts +148 -0
- package/src/services/definitions/traefik.ts +0 -2
- package/src/services/definitions/xyops.ts +94 -0
- package/src/types.ts +7 -1
- package/src/validator.ts +16 -0
- package/src/version-manager.test.ts +134 -0
- package/src/version-manager.ts +12 -5
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,8 @@ import { AddedDependencySchema, ApiErrorSchema, ComposeOptionsSchema, DeploySche
|
|
|
2
2
|
import { AddedDependency, ApiError, CategoryInfo, ComposeOptions, Deploy, DeploymentTarget, DeploymentType, EnvVariable, GeneratedFiles, GenerationInput, GenerationMetadata, GenerationResult, HealthCheck, Maturity, NativePlatform, NativeRecipe, OutputFormat, Platform, PortMapping, Preset, ProxyType, ResolvedService, ResolverError, ResolverInput, ResolverOutput, ResourceLimits, RestartPolicy, SERVICE_CATEGORIES, ServiceCategory, ServiceDefinition, SkillBinding, SkillPack, ValidateRequest, ValidateResponse, VolumeMapping, Warning } from "./types.mjs";
|
|
3
3
|
import { partitionBareMetal, platformToNativePlatform, resolvedWithOnlyServices } from "./bare-metal-partition.mjs";
|
|
4
4
|
import { ComposeResult, compose, composeMultiFile } from "./composer.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { StackConfigError, ValidationError } from "./errors.mjs";
|
|
6
|
+
import { generate, generateServicesDoc } from "./generate.mjs";
|
|
6
7
|
import { generateCaddyfile } from "./generators/caddy.mjs";
|
|
7
8
|
import { EnvVarGroup, generateEnvFiles, getStructuredEnvVars } from "./generators/env.mjs";
|
|
8
9
|
import { generateGrafanaConfig, generateGrafanaDashboard } from "./generators/grafana.mjs";
|
|
@@ -17,5 +18,6 @@ import { resolve } from "./resolver.mjs";
|
|
|
17
18
|
import { getAllServices, getServiceById, getServicesByCategory, serviceRegistry } from "./services/registry.mjs";
|
|
18
19
|
import { getAllSkillPacks, getCompatibleSkillPacks, getSkillPackById, skillPackRegistry } from "./skills/registry.mjs";
|
|
19
20
|
import { validate } from "./validator.mjs";
|
|
21
|
+
import { CURRENT_CONFIG_VERSION, migrateConfig, needsMigration } from "./migrations.mjs";
|
|
20
22
|
import { checkCompatibility, getImageReference, getImageTag, pinImageTags } from "./version-manager.mjs";
|
|
21
|
-
export { type AddedDependency, AddedDependencySchema, type ApiError, ApiErrorSchema, type CategoryInfo, type ComposeOptions, ComposeOptionsSchema, type ComposeResult, type Deploy, DeploySchema, type DeploymentTarget, DeploymentTargetSchema, type DeploymentType, DeploymentTypeSchema, type EnvVarGroup, type EnvVariable, EnvVariableSchema, ErrorSchema, type GeneratedFiles, type GenerationInput, GenerationInputSchema, type GenerationMetadata, type GenerationResult, type HealthCheck, HealthCheckSchema, type Maturity, MaturitySchema, type NativePlatform, NativePlatformSchema, type NativeRecipe, NativeRecipeSchema, type OutputFormat, OutputFormatSchema, type Platform, PlatformSchema, type PortMapping, PortMappingSchema, type Preset, PresetSchema, type ProxyType, ProxyTypeSchema, type ResolvedService, ResolvedServiceSchema, type ResolverError, type ResolverInput, type ResolverOutput, ResolverOutputSchema, type ResourceLimits, ResourceLimitsSchema, type RestartPolicy, RestartPolicySchema, SERVICE_CATEGORIES, type ServiceCategory, ServiceCategorySchema, type ServiceDefinition, ServiceDefinitionSchema, type SkillBinding, SkillBindingSchema, type SkillPack, SkillPackSchema, type ValidateRequest, ValidateRequestSchema, type ValidateResponse, ValidateResponseSchema, type VolumeMapping, VolumeMappingSchema, type Warning, WarningSchema, checkCompatibility, compose, composeMultiFile, generate, generateCaddyfile, generateEnvFiles, generateGrafanaConfig, generateGrafanaDashboard, generateN8nWorkflows, generatePostgresInit, generatePrometheusConfig, generateReadme, generateScripts, generateSkillFiles, getAllPresets, getAllServices, getAllSkillPacks, getCompatibleSkillPacks, getDbRequirements, getImageReference, getImageTag, getPresetById, getServiceById, getServicesByCategory, getSkillPackById, getStructuredEnvVars, partitionBareMetal, pinImageTags, platformToNativePlatform, presetRegistry, resolve, resolvedWithOnlyServices, serviceRegistry, skillPackRegistry, validate };
|
|
23
|
+
export { type AddedDependency, AddedDependencySchema, type ApiError, ApiErrorSchema, CURRENT_CONFIG_VERSION, type CategoryInfo, type ComposeOptions, ComposeOptionsSchema, type ComposeResult, type Deploy, DeploySchema, type DeploymentTarget, DeploymentTargetSchema, type DeploymentType, DeploymentTypeSchema, type EnvVarGroup, type EnvVariable, EnvVariableSchema, ErrorSchema, type GeneratedFiles, type GenerationInput, GenerationInputSchema, type GenerationMetadata, type GenerationResult, type HealthCheck, HealthCheckSchema, type Maturity, MaturitySchema, type NativePlatform, NativePlatformSchema, type NativeRecipe, NativeRecipeSchema, type OutputFormat, OutputFormatSchema, type Platform, PlatformSchema, type PortMapping, PortMappingSchema, type Preset, PresetSchema, type ProxyType, ProxyTypeSchema, type ResolvedService, ResolvedServiceSchema, type ResolverError, type ResolverInput, type ResolverOutput, ResolverOutputSchema, type ResourceLimits, ResourceLimitsSchema, type RestartPolicy, RestartPolicySchema, SERVICE_CATEGORIES, type ServiceCategory, ServiceCategorySchema, type ServiceDefinition, ServiceDefinitionSchema, type SkillBinding, SkillBindingSchema, type SkillPack, SkillPackSchema, StackConfigError, type ValidateRequest, ValidateRequestSchema, type ValidateResponse, ValidateResponseSchema, ValidationError, type VolumeMapping, VolumeMappingSchema, type Warning, WarningSchema, checkCompatibility, compose, composeMultiFile, generate, generateCaddyfile, generateEnvFiles, generateGrafanaConfig, generateGrafanaDashboard, generateN8nWorkflows, generatePostgresInit, generatePrometheusConfig, generateReadme, generateScripts, generateServicesDoc, generateSkillFiles, getAllPresets, getAllServices, getAllSkillPacks, getCompatibleSkillPacks, getDbRequirements, getImageReference, getImageTag, getPresetById, getServiceById, getServicesByCategory, getSkillPackById, getStructuredEnvVars, migrateConfig, needsMigration, partitionBareMetal, pinImageTags, platformToNativePlatform, presetRegistry, resolve, resolvedWithOnlyServices, serviceRegistry, skillPackRegistry, validate };
|
package/dist/index.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { getAllServices, getServiceById, getServicesByCategory, serviceRegistry
|
|
|
3
3
|
import { getAllSkillPacks, getCompatibleSkillPacks, getSkillPackById, skillPackRegistry } from "./skills/registry.mjs";
|
|
4
4
|
import { resolve } from "./resolver.mjs";
|
|
5
5
|
import { compose, composeMultiFile } from "./composer.mjs";
|
|
6
|
+
import { StackConfigError, ValidationError } from "./errors.mjs";
|
|
6
7
|
import { generateCaddyfile } from "./generators/caddy.mjs";
|
|
7
8
|
import { generatePostgresInit, getDbRequirements } from "./generators/postgres-init.mjs";
|
|
8
9
|
import { generateEnvFiles, getStructuredEnvVars } from "./generators/env.mjs";
|
|
@@ -12,11 +13,12 @@ import { generatePrometheusConfig } from "./generators/prometheus.mjs";
|
|
|
12
13
|
import { generateReadme } from "./generators/readme.mjs";
|
|
13
14
|
import { generateScripts } from "./generators/scripts.mjs";
|
|
14
15
|
import { generateSkillFiles } from "./generators/skills.mjs";
|
|
16
|
+
import { CURRENT_CONFIG_VERSION, migrateConfig, needsMigration } from "./migrations.mjs";
|
|
15
17
|
import { validate } from "./validator.mjs";
|
|
16
|
-
import { generate } from "./generate.mjs";
|
|
18
|
+
import { generate, generateServicesDoc } from "./generate.mjs";
|
|
17
19
|
import { getAllPresets, getPresetById, presetRegistry } from "./presets/registry.mjs";
|
|
18
20
|
import { AddedDependencySchema, ApiErrorSchema, ComposeOptionsSchema, DeploySchema, DeploymentTargetSchema, DeploymentTypeSchema, EnvVariableSchema, ErrorSchema, GenerationInputSchema, HealthCheckSchema, MaturitySchema, NativePlatformSchema, NativeRecipeSchema, OutputFormatSchema, PlatformSchema, PortMappingSchema, PresetSchema, ProxyTypeSchema, ResolvedServiceSchema, ResolverOutputSchema, ResourceLimitsSchema, RestartPolicySchema, ServiceCategorySchema, ServiceDefinitionSchema, SkillBindingSchema, SkillPackSchema, ValidateRequestSchema, ValidateResponseSchema, VolumeMappingSchema, WarningSchema } from "./schema.mjs";
|
|
19
21
|
import { SERVICE_CATEGORIES } from "./types.mjs";
|
|
20
22
|
import { checkCompatibility, getImageReference, getImageTag, pinImageTags } from "./version-manager.mjs";
|
|
21
23
|
|
|
22
|
-
export { AddedDependencySchema, ApiErrorSchema, ComposeOptionsSchema, DeploySchema, DeploymentTargetSchema, DeploymentTypeSchema, EnvVariableSchema, ErrorSchema, GenerationInputSchema, HealthCheckSchema, MaturitySchema, NativePlatformSchema, NativeRecipeSchema, OutputFormatSchema, PlatformSchema, PortMappingSchema, PresetSchema, ProxyTypeSchema, ResolvedServiceSchema, ResolverOutputSchema, ResourceLimitsSchema, RestartPolicySchema, SERVICE_CATEGORIES, ServiceCategorySchema, ServiceDefinitionSchema, SkillBindingSchema, SkillPackSchema, ValidateRequestSchema, ValidateResponseSchema, VolumeMappingSchema, WarningSchema, checkCompatibility, compose, composeMultiFile, generate, generateCaddyfile, generateEnvFiles, generateGrafanaConfig, generateGrafanaDashboard, generateN8nWorkflows, generatePostgresInit, generatePrometheusConfig, generateReadme, generateScripts, generateSkillFiles, getAllPresets, getAllServices, getAllSkillPacks, getCompatibleSkillPacks, getDbRequirements, getImageReference, getImageTag, getPresetById, getServiceById, getServicesByCategory, getSkillPackById, getStructuredEnvVars, partitionBareMetal, pinImageTags, platformToNativePlatform, presetRegistry, resolve, resolvedWithOnlyServices, serviceRegistry, skillPackRegistry, validate };
|
|
24
|
+
export { AddedDependencySchema, ApiErrorSchema, CURRENT_CONFIG_VERSION, ComposeOptionsSchema, DeploySchema, DeploymentTargetSchema, DeploymentTypeSchema, EnvVariableSchema, ErrorSchema, GenerationInputSchema, HealthCheckSchema, MaturitySchema, NativePlatformSchema, NativeRecipeSchema, OutputFormatSchema, PlatformSchema, PortMappingSchema, PresetSchema, ProxyTypeSchema, ResolvedServiceSchema, ResolverOutputSchema, ResourceLimitsSchema, RestartPolicySchema, SERVICE_CATEGORIES, ServiceCategorySchema, ServiceDefinitionSchema, SkillBindingSchema, SkillPackSchema, StackConfigError, ValidateRequestSchema, ValidateResponseSchema, ValidationError, VolumeMappingSchema, WarningSchema, checkCompatibility, compose, composeMultiFile, generate, generateCaddyfile, generateEnvFiles, generateGrafanaConfig, generateGrafanaDashboard, generateN8nWorkflows, generatePostgresInit, generatePrometheusConfig, generateReadme, generateScripts, generateServicesDoc, generateSkillFiles, getAllPresets, getAllServices, getAllSkillPacks, getCompatibleSkillPacks, getDbRequirements, getImageReference, getImageTag, getPresetById, getServiceById, getServicesByCategory, getSkillPackById, getStructuredEnvVars, migrateConfig, needsMigration, partitionBareMetal, pinImageTags, platformToNativePlatform, presetRegistry, resolve, resolvedWithOnlyServices, serviceRegistry, skillPackRegistry, validate };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/migrations.d.ts
|
|
2
|
+
declare const CURRENT_CONFIG_VERSION = 2;
|
|
3
|
+
/**
|
|
4
|
+
* Applies sequential migrations to bring a config from its current version
|
|
5
|
+
* to CURRENT_CONFIG_VERSION. Returns the config unchanged if already current.
|
|
6
|
+
*/
|
|
7
|
+
declare function migrateConfig(input: Record<string, unknown>): Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Returns true if the config needs migration to the current version.
|
|
10
|
+
*/
|
|
11
|
+
declare function needsMigration(input: Record<string, unknown>): boolean;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { CURRENT_CONFIG_VERSION, migrateConfig, needsMigration };
|
|
14
|
+
//# sourceMappingURL=migrations.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.d.mts","names":[],"sources":["../src/migrations.ts"],"mappings":";cAEa,sBAAA;AAAb;;;;AAAA,iBAiBgB,aAAA,CAAc,KAAA,EAAO,MAAA,oBAA0B,MAAA;AAA/D;;;AAAA,iBA0BgB,cAAA,CAAe,KAAA,EAAO,MAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/migrations.ts
|
|
2
|
+
const CURRENT_CONFIG_VERSION = 2;
|
|
3
|
+
const migrations = { 1: (input) => ({
|
|
4
|
+
...input,
|
|
5
|
+
configVersion: 2,
|
|
6
|
+
deploymentType: input.deploymentType ?? "docker"
|
|
7
|
+
}) };
|
|
8
|
+
/**
|
|
9
|
+
* Applies sequential migrations to bring a config from its current version
|
|
10
|
+
* to CURRENT_CONFIG_VERSION. Returns the config unchanged if already current.
|
|
11
|
+
*/
|
|
12
|
+
function migrateConfig(input) {
|
|
13
|
+
let version = input.configVersion ?? 1;
|
|
14
|
+
if (version > CURRENT_CONFIG_VERSION) throw new Error(`No migration path from config version ${version}`);
|
|
15
|
+
let current = { ...input };
|
|
16
|
+
while (version < CURRENT_CONFIG_VERSION) {
|
|
17
|
+
const migrationFn = migrations[version];
|
|
18
|
+
if (!migrationFn) throw new Error(`No migration path from config version ${version}`);
|
|
19
|
+
current = migrationFn(current);
|
|
20
|
+
version++;
|
|
21
|
+
}
|
|
22
|
+
return current;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Returns true if the config needs migration to the current version.
|
|
26
|
+
*/
|
|
27
|
+
function needsMigration(input) {
|
|
28
|
+
return (input.configVersion ?? 1) < CURRENT_CONFIG_VERSION;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { CURRENT_CONFIG_VERSION, migrateConfig, needsMigration };
|
|
33
|
+
//# sourceMappingURL=migrations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.mjs","names":[],"sources":["../src/migrations.ts"],"sourcesContent":["import type { GenerationInput } from \"./types.js\";\n\nexport const CURRENT_CONFIG_VERSION = 2;\n\ntype MigrationFn = (input: Record<string, unknown>) => Record<string, unknown>;\n\nconst migrations: Record<number, MigrationFn> = {\n\t// v1 → v2: ensure deploymentType field exists (defaulting to \"docker\")\n\t1: (input) => ({\n\t\t...input,\n\t\tconfigVersion: 2,\n\t\tdeploymentType: (input.deploymentType as string) ?? \"docker\",\n\t}),\n};\n\n/**\n * Applies sequential migrations to bring a config from its current version\n * to CURRENT_CONFIG_VERSION. Returns the config unchanged if already current.\n */\nexport function migrateConfig(input: Record<string, unknown>): Record<string, unknown> {\n\tlet version = (input.configVersion as number) ?? 1;\n\n\tif (version > CURRENT_CONFIG_VERSION) {\n\t\tthrow new Error(\n\t\t\t`No migration path from config version ${version}`,\n\t\t);\n\t}\n\n\tlet current = { ...input };\n\n\twhile (version < CURRENT_CONFIG_VERSION) {\n\t\tconst migrationFn = migrations[version];\n\t\tif (!migrationFn) {\n\t\t\tthrow new Error(`No migration path from config version ${version}`);\n\t\t}\n\t\tcurrent = migrationFn(current);\n\t\tversion++;\n\t}\n\n\treturn current;\n}\n\n/**\n * Returns true if the config needs migration to the current version.\n */\nexport function needsMigration(input: Record<string, unknown>): boolean {\n\tconst version = (input.configVersion as number) ?? 1;\n\treturn version < CURRENT_CONFIG_VERSION;\n}\n"],"mappings":";AAEA,MAAa,yBAAyB;AAItC,MAAM,aAA0C,EAE/C,IAAI,WAAW;CACd,GAAG;CACH,eAAe;CACf,gBAAiB,MAAM,kBAA6B;CACpD,GACD;;;;;AAMD,SAAgB,cAAc,OAAyD;CACtF,IAAI,UAAW,MAAM,iBAA4B;AAEjD,KAAI,UAAU,uBACb,OAAM,IAAI,MACT,yCAAyC,UACzC;CAGF,IAAI,UAAU,EAAE,GAAG,OAAO;AAE1B,QAAO,UAAU,wBAAwB;EACxC,MAAM,cAAc,WAAW;AAC/B,MAAI,CAAC,YACJ,OAAM,IAAI,MAAM,yCAAyC,UAAU;AAEpE,YAAU,YAAY,QAAQ;AAC9B;;AAGD,QAAO;;;;;AAMR,SAAgB,eAAe,OAAyC;AAEvE,SADiB,MAAM,iBAA4B,KAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { n as describe, r as it, t as globalExpect } from "./vi.2VT5v0um-Qk6MgAnK.mjs";
|
|
2
|
+
import { CURRENT_CONFIG_VERSION, migrateConfig, needsMigration } from "./migrations.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/migrations.test.ts
|
|
5
|
+
describe("config migrations", () => {
|
|
6
|
+
it("migrates v1 config to current version", () => {
|
|
7
|
+
const result = migrateConfig({
|
|
8
|
+
projectName: "test",
|
|
9
|
+
services: ["redis"],
|
|
10
|
+
skillPacks: []
|
|
11
|
+
});
|
|
12
|
+
globalExpect(result.configVersion).toBe(CURRENT_CONFIG_VERSION);
|
|
13
|
+
globalExpect(result.deploymentType).toBe("docker");
|
|
14
|
+
});
|
|
15
|
+
it("preserves existing deploymentType during migration", () => {
|
|
16
|
+
globalExpect(migrateConfig({
|
|
17
|
+
configVersion: 1,
|
|
18
|
+
deploymentType: "bare-metal"
|
|
19
|
+
}).deploymentType).toBe("bare-metal");
|
|
20
|
+
});
|
|
21
|
+
it("passes through current version unchanged", () => {
|
|
22
|
+
const current = {
|
|
23
|
+
configVersion: CURRENT_CONFIG_VERSION,
|
|
24
|
+
projectName: "test"
|
|
25
|
+
};
|
|
26
|
+
globalExpect(migrateConfig(current)).toEqual(current);
|
|
27
|
+
});
|
|
28
|
+
it("needsMigration returns true for old configs", () => {
|
|
29
|
+
globalExpect(needsMigration({ configVersion: 1 })).toBe(true);
|
|
30
|
+
globalExpect(needsMigration({})).toBe(true);
|
|
31
|
+
});
|
|
32
|
+
it("needsMigration returns false for current configs", () => {
|
|
33
|
+
globalExpect(needsMigration({ configVersion: CURRENT_CONFIG_VERSION })).toBe(false);
|
|
34
|
+
});
|
|
35
|
+
it("throws for unknown version with no migration path", () => {
|
|
36
|
+
globalExpect(() => migrateConfig({ configVersion: 99 })).toThrow("No migration path");
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
export { };
|
|
42
|
+
//# sourceMappingURL=migrations.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.test.mjs","names":[],"sources":["../src/migrations.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { migrateConfig, needsMigration, CURRENT_CONFIG_VERSION } from \"./migrations.js\";\n\ndescribe(\"config migrations\", () => {\n\tit(\"migrates v1 config to current version\", () => {\n\t\tconst v1 = { projectName: \"test\", services: [\"redis\"], skillPacks: [] };\n\t\tconst result = migrateConfig(v1);\n\t\texpect(result.configVersion).toBe(CURRENT_CONFIG_VERSION);\n\t\texpect(result.deploymentType).toBe(\"docker\");\n\t});\n\n\tit(\"preserves existing deploymentType during migration\", () => {\n\t\tconst v1 = { configVersion: 1, deploymentType: \"bare-metal\" };\n\t\tconst result = migrateConfig(v1);\n\t\texpect(result.deploymentType).toBe(\"bare-metal\");\n\t});\n\n\tit(\"passes through current version unchanged\", () => {\n\t\tconst current = { configVersion: CURRENT_CONFIG_VERSION, projectName: \"test\" };\n\t\tconst result = migrateConfig(current);\n\t\texpect(result).toEqual(current);\n\t});\n\n\tit(\"needsMigration returns true for old configs\", () => {\n\t\texpect(needsMigration({ configVersion: 1 })).toBe(true);\n\t\texpect(needsMigration({})).toBe(true); // no version = v1\n\t});\n\n\tit(\"needsMigration returns false for current configs\", () => {\n\t\texpect(needsMigration({ configVersion: CURRENT_CONFIG_VERSION })).toBe(false);\n\t});\n\n\tit(\"throws for unknown version with no migration path\", () => {\n\t\texpect(() => migrateConfig({ configVersion: 99 })).toThrow(\"No migration path\");\n\t});\n});\n"],"mappings":";;;;AAGA,SAAS,2BAA2B;AACnC,IAAG,+CAA+C;EAEjD,MAAM,SAAS,cADJ;GAAE,aAAa;GAAQ,UAAU,CAAC,QAAQ;GAAE,YAAY,EAAE;GAAE,CACvC;AAChC,eAAO,OAAO,cAAc,CAAC,KAAK,uBAAuB;AACzD,eAAO,OAAO,eAAe,CAAC,KAAK,SAAS;GAC3C;AAEF,IAAG,4DAA4D;AAG9D,eADe,cADJ;GAAE,eAAe;GAAG,gBAAgB;GAAc,CAC7B,CAClB,eAAe,CAAC,KAAK,aAAa;GAC/C;AAEF,IAAG,kDAAkD;EACpD,MAAM,UAAU;GAAE,eAAe;GAAwB,aAAa;GAAQ;AAE9E,eADe,cAAc,QAAQ,CACvB,CAAC,QAAQ,QAAQ;GAC9B;AAEF,IAAG,qDAAqD;AACvD,eAAO,eAAe,EAAE,eAAe,GAAG,CAAC,CAAC,CAAC,KAAK,KAAK;AACvD,eAAO,eAAe,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK;GACpC;AAEF,IAAG,0DAA0D;AAC5D,eAAO,eAAe,EAAE,eAAe,wBAAwB,CAAC,CAAC,CAAC,KAAK,MAAM;GAC5E;AAEF,IAAG,2DAA2D;AAC7D,qBAAa,cAAc,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,QAAQ,oBAAoB;GAC9E;EACD"}
|
package/dist/resolver.d.mts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { ResolverInput, ResolverOutput } from "./types.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/resolver.d.ts
|
|
4
|
+
interface MemoryThresholds {
|
|
5
|
+
info: number;
|
|
6
|
+
warning: number;
|
|
7
|
+
critical: number;
|
|
8
|
+
}
|
|
4
9
|
/**
|
|
5
10
|
* Resolves user selections into a complete, valid service list.
|
|
6
11
|
*
|
|
@@ -17,5 +22,5 @@ import { ResolverInput, ResolverOutput } from "./types.mjs";
|
|
|
17
22
|
*/
|
|
18
23
|
declare function resolve(input: ResolverInput): ResolverOutput;
|
|
19
24
|
//#endregion
|
|
20
|
-
export { resolve };
|
|
25
|
+
export { MemoryThresholds, resolve };
|
|
21
26
|
//# sourceMappingURL=resolver.d.mts.map
|
package/dist/resolver.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.mts","names":[],"sources":["../src/resolver.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolver.d.mts","names":[],"sources":["../src/resolver.ts"],"mappings":";;;UAYiB,gBAAA;EAChB,IAAA;EACA,OAAA;EACA,QAAA;AAAA;;;;;;;AAuBD;;;;;;;;iBAAgB,OAAA,CAAQ,KAAA,EAAO,aAAA,GAAgB,cAAA"}
|
package/dist/resolver.mjs
CHANGED
|
@@ -2,6 +2,11 @@ import { getServiceById } from "./services/registry.mjs";
|
|
|
2
2
|
import { getSkillPackById } from "./skills/registry.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/resolver.ts
|
|
5
|
+
const DEFAULT_MEMORY_THRESHOLDS = {
|
|
6
|
+
info: 2048,
|
|
7
|
+
warning: 4096,
|
|
8
|
+
critical: 8192
|
|
9
|
+
};
|
|
5
10
|
/**
|
|
6
11
|
* Resolves user selections into a complete, valid service list.
|
|
7
12
|
*
|
|
@@ -94,6 +99,18 @@ function resolve(input) {
|
|
|
94
99
|
}
|
|
95
100
|
}
|
|
96
101
|
}
|
|
102
|
+
if (iteration >= maxIterations) warnings.push({
|
|
103
|
+
type: "resolution",
|
|
104
|
+
message: `Dependency resolution reached maximum iterations (${maxIterations}). Some transitive dependencies may not be fully resolved.`
|
|
105
|
+
});
|
|
106
|
+
for (const id of serviceIds) {
|
|
107
|
+
const def = getServiceById(id);
|
|
108
|
+
if (!def) continue;
|
|
109
|
+
for (const recId of def.recommends) if (!serviceIds.has(recId) && getServiceById(recId)) warnings.push({
|
|
110
|
+
type: "recommendation",
|
|
111
|
+
message: `${def.name} recommends "${recId}" for enhanced functionality`
|
|
112
|
+
});
|
|
113
|
+
}
|
|
97
114
|
const resolvedDefs = [];
|
|
98
115
|
for (const id of serviceIds) {
|
|
99
116
|
const def = getServiceById(id);
|
|
@@ -120,15 +137,16 @@ function resolve(input) {
|
|
|
120
137
|
});
|
|
121
138
|
let estimatedMemoryMB = 512;
|
|
122
139
|
for (const def of resolvedDefs) estimatedMemoryMB += def.minMemoryMB ?? 128;
|
|
123
|
-
|
|
140
|
+
const thresholds = input.memoryThresholds ?? DEFAULT_MEMORY_THRESHOLDS;
|
|
141
|
+
if (estimatedMemoryMB > thresholds.critical) warnings.push({
|
|
124
142
|
type: "memory",
|
|
125
143
|
message: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required. Ensure your server has sufficient resources.`
|
|
126
144
|
});
|
|
127
|
-
else if (estimatedMemoryMB >
|
|
145
|
+
else if (estimatedMemoryMB > thresholds.warning) warnings.push({
|
|
128
146
|
type: "memory",
|
|
129
147
|
message: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required. A server with at least 8GB RAM is recommended.`
|
|
130
148
|
});
|
|
131
|
-
else if (estimatedMemoryMB >
|
|
149
|
+
else if (estimatedMemoryMB > thresholds.info) warnings.push({
|
|
132
150
|
type: "memory",
|
|
133
151
|
message: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required.`
|
|
134
152
|
});
|
package/dist/resolver.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.mjs","names":[],"sources":["../src/resolver.ts"],"sourcesContent":["import { getServiceById } from \"./services/registry.js\";\nimport { getSkillPackById } from \"./skills/registry.js\";\nimport type {\n\tAddedDependency,\n\tResolvedService,\n\tResolverError,\n\tResolverInput,\n\tResolverOutput,\n\tServiceDefinition,\n\tWarning,\n} from \"./types.js\";\n\n/**\n * Resolves user selections into a complete, valid service list.\n *\n * Algorithm:\n * 1. Expand skill pack requirements into service list\n * 2. Resolve transitive `requires` dependencies (iterate until stable)\n * 3. Detect `conflictsWith` violations\n * 4. Check platform compatibility and GPU requirements\n * 5. Estimate total memory (sum minMemoryMB)\n * 6. Deduplicate\n * 7. Topological sort by dependency graph, alphabetical for ties\n *\n * Deterministic: same input -> same output, always.\n */\nexport function resolve(input: ResolverInput): ResolverOutput {\n\tconst addedDependencies: AddedDependency[] = [];\n\tconst warnings: Warning[] = [];\n\tconst errors: ResolverError[] = [];\n\n\t// Track all service IDs needed\n\tconst serviceIds = new Set<string>(input.services);\n\tconst serviceAddedBy = new Map<string, ResolvedService[\"addedBy\"]>();\n\n\t// Mark user-selected services\n\tfor (const id of input.services) {\n\t\tserviceAddedBy.set(id, \"user\");\n\t}\n\n\t// 1. Expand skill pack requirements\n\tfor (const packId of input.skillPacks) {\n\t\tconst pack = getSkillPackById(packId);\n\t\tif (!pack) {\n\t\t\terrors.push({\n\t\t\t\ttype: \"unknown_skill_pack\",\n\t\t\t\tmessage: `Unknown skill pack: \"${packId}\"`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const requiredService of pack.requiredServices) {\n\t\t\tif (!serviceIds.has(requiredService)) {\n\t\t\t\tserviceIds.add(requiredService);\n\t\t\t\tserviceAddedBy.set(requiredService, \"skill-pack\");\n\t\t\t\taddedDependencies.push({\n\t\t\t\t\tservice: requiredService,\n\t\t\t\t\treason: `Required by skill pack: ${pack.name}`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add proxy if specified\n\tif (input.proxy && input.proxy !== \"none\") {\n\t\tif (!serviceIds.has(input.proxy)) {\n\t\t\tserviceIds.add(input.proxy);\n\t\t\tserviceAddedBy.set(input.proxy, \"proxy\");\n\t\t\taddedDependencies.push({\n\t\t\t\tservice: input.proxy,\n\t\t\t\treason: `Selected as reverse proxy`,\n\t\t\t});\n\t\t}\n\t}\n\n\t// Add monitoring stack if requested\n\tif (input.monitoring) {\n\t\tconst monitoringServices = [\"uptime-kuma\", \"grafana\", \"prometheus\"];\n\t\tfor (const svc of monitoringServices) {\n\t\t\tif (!serviceIds.has(svc)) {\n\t\t\t\tserviceIds.add(svc);\n\t\t\t\tserviceAddedBy.set(svc, \"monitoring\");\n\t\t\t\taddedDependencies.push({\n\t\t\t\t\tservice: svc,\n\t\t\t\t\treason: \"Included with monitoring stack\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// Validate all service IDs exist\n\tconst unknownIds: string[] = [];\n\tfor (const id of serviceIds) {\n\t\tif (!getServiceById(id)) {\n\t\t\tunknownIds.push(id);\n\t\t}\n\t}\n\tif (unknownIds.length > 0) {\n\t\tfor (const id of unknownIds) {\n\t\t\terrors.push({\n\t\t\t\ttype: \"unknown_service\",\n\t\t\t\tmessage: `Unknown service: \"${id}\"`,\n\t\t\t});\n\t\t\tserviceIds.delete(id);\n\t\t}\n\t}\n\n\t// 2. Resolve transitive dependencies (iterate until stable)\n\tlet changed = true;\n\tconst maxIterations = 50; // safety bound\n\tlet iteration = 0;\n\twhile (changed && iteration < maxIterations) {\n\t\tchanged = false;\n\t\titeration++;\n\t\tfor (const id of [...serviceIds]) {\n\t\t\tconst def = getServiceById(id);\n\t\t\tif (!def) continue;\n\t\t\tfor (const reqId of def.requires) {\n\t\t\t\tif (!serviceIds.has(reqId)) {\n\t\t\t\t\tserviceIds.add(reqId);\n\t\t\t\t\tserviceAddedBy.set(reqId, \"dependency\");\n\t\t\t\t\taddedDependencies.push({\n\t\t\t\t\t\tservice: reqId,\n\t\t\t\t\t\treason: `Required by ${def.name}`,\n\t\t\t\t\t});\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 3. Detect conflicts\n\tconst resolvedDefs: ServiceDefinition[] = [];\n\tfor (const id of serviceIds) {\n\t\tconst def = getServiceById(id);\n\t\tif (def) resolvedDefs.push(def);\n\t}\n\n\tfor (let i = 0; i < resolvedDefs.length; i++) {\n\t\tfor (let j = i + 1; j < resolvedDefs.length; j++) {\n\t\t\tconst a = resolvedDefs[i]!;\n\t\t\tconst b = resolvedDefs[j]!;\n\t\t\tif (a.conflictsWith.includes(b.id) || b.conflictsWith.includes(a.id)) {\n\t\t\t\terrors.push({\n\t\t\t\t\ttype: \"conflict\",\n\t\t\t\t\tmessage: `${a.name} and ${b.name} cannot be used together`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// 4. Check platform compatibility\n\tif (input.platform) {\n\t\tfor (const def of resolvedDefs) {\n\t\t\tif (def.platforms && def.platforms.length > 0 && !def.platforms.includes(input.platform)) {\n\t\t\t\twarnings.push({\n\t\t\t\t\ttype: \"platform\",\n\t\t\t\t\tmessage: `${def.name} may not be compatible with ${input.platform}. Supported: ${def.platforms.join(\", \")}`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check GPU requirements\n\tconst gpuServices = resolvedDefs.filter((d) => d.gpuRequired);\n\tif (gpuServices.length > 0 && !input.gpu) {\n\t\tfor (const svc of gpuServices) {\n\t\t\twarnings.push({\n\t\t\t\ttype: \"gpu\",\n\t\t\t\tmessage: `${svc.name} requires GPU passthrough. Enable --gpu flag for optimal performance.`,\n\t\t\t});\n\t\t}\n\t}\n\n\t// 5. Estimate total memory\n\tlet estimatedMemoryMB = 512; // Base for OpenClaw itself\n\tfor (const def of resolvedDefs) {\n\t\testimatedMemoryMB += def.minMemoryMB ?? 128;\n\t}\n\n\t// Memory warnings\n\tif (estimatedMemoryMB > 8192) {\n\t\twarnings.push({\n\t\t\ttype: \"memory\",\n\t\t\tmessage: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required. Ensure your server has sufficient resources.`,\n\t\t});\n\t} else if (estimatedMemoryMB > 4096) {\n\t\twarnings.push({\n\t\t\ttype: \"memory\",\n\t\t\tmessage: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required. A server with at least 8GB RAM is recommended.`,\n\t\t});\n\t} else if (estimatedMemoryMB > 2048) {\n\t\twarnings.push({\n\t\t\ttype: \"memory\",\n\t\t\tmessage: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required.`,\n\t\t});\n\t}\n\n\t// 7. Topological sort by dependency graph\n\tconst sorted = topologicalSort(resolvedDefs);\n\n\t// Build final resolved services list\n\tconst services: ResolvedService[] = sorted.map((def) => ({\n\t\tdefinition: def,\n\t\taddedBy: serviceAddedBy.get(def.id) ?? \"user\",\n\t}));\n\n\tconst isValid = errors.length === 0;\n\n\treturn {\n\t\tservices,\n\t\taddedDependencies,\n\t\tremovedConflicts: [],\n\t\twarnings,\n\t\terrors,\n\t\tisValid,\n\t\testimatedMemoryMB,\n\t};\n}\n\n/**\n * Topological sort using Kahn's algorithm.\n * Ties broken alphabetically by service ID for determinism.\n */\nfunction topologicalSort(definitions: ServiceDefinition[]): ServiceDefinition[] {\n\tconst idSet = new Set(definitions.map((d) => d.id));\n\tconst graph = new Map<string, string[]>(); // id -> list of IDs that depend on it\n\tconst inDegree = new Map<string, number>();\n\n\t// Initialize\n\tfor (const def of definitions) {\n\t\tgraph.set(def.id, []);\n\t\tinDegree.set(def.id, 0);\n\t}\n\n\t// Build edges: if A requires B, then B -> A (B must come before A)\n\tfor (const def of definitions) {\n\t\tfor (const reqId of [...def.requires, ...def.dependsOn]) {\n\t\t\tif (idSet.has(reqId)) {\n\t\t\t\tgraph.get(reqId)?.push(def.id);\n\t\t\t\tinDegree.set(def.id, (inDegree.get(def.id) ?? 0) + 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Kahn's algorithm with alphabetical tie-breaking\n\tconst queue: string[] = [];\n\tfor (const [id, deg] of inDegree) {\n\t\tif (deg === 0) queue.push(id);\n\t}\n\tqueue.sort(); // alphabetical for determinism\n\n\tconst sorted: ServiceDefinition[] = [];\n\tconst defMap = new Map(definitions.map((d) => [d.id, d]));\n\n\twhile (queue.length > 0) {\n\t\tconst id = queue.shift()!;\n\t\tconst def = defMap.get(id);\n\t\tif (def) sorted.push(def);\n\n\t\tconst neighbors = graph.get(id) ?? [];\n\t\tconst newReady: string[] = [];\n\t\tfor (const neighbor of neighbors) {\n\t\t\tconst deg = (inDegree.get(neighbor) ?? 0) - 1;\n\t\t\tinDegree.set(neighbor, deg);\n\t\t\tif (deg === 0) newReady.push(neighbor);\n\t\t}\n\t\t// Sort newly ready nodes alphabetically and add to queue in order\n\t\tnewReady.sort();\n\t\tqueue.push(...newReady);\n\t}\n\n\t// If not all nodes are in sorted, there's a cycle\n\tif (sorted.length < definitions.length) {\n\t\t// Return what we have plus remaining (cycle detected but we still produce output)\n\t\tconst sortedIds = new Set(sorted.map((d) => d.id));\n\t\tconst remaining = definitions.filter((d) => !sortedIds.has(d.id));\n\t\tremaining.sort((a, b) => a.id.localeCompare(b.id));\n\t\tsorted.push(...remaining);\n\t}\n\n\treturn sorted;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,SAAgB,QAAQ,OAAsC;CAC7D,MAAM,oBAAuC,EAAE;CAC/C,MAAM,WAAsB,EAAE;CAC9B,MAAM,SAA0B,EAAE;CAGlC,MAAM,aAAa,IAAI,IAAY,MAAM,SAAS;CAClD,MAAM,iCAAiB,IAAI,KAAyC;AAGpE,MAAK,MAAM,MAAM,MAAM,SACtB,gBAAe,IAAI,IAAI,OAAO;AAI/B,MAAK,MAAM,UAAU,MAAM,YAAY;EACtC,MAAM,OAAO,iBAAiB,OAAO;AACrC,MAAI,CAAC,MAAM;AACV,UAAO,KAAK;IACX,MAAM;IACN,SAAS,wBAAwB,OAAO;IACxC,CAAC;AACF;;AAED,OAAK,MAAM,mBAAmB,KAAK,iBAClC,KAAI,CAAC,WAAW,IAAI,gBAAgB,EAAE;AACrC,cAAW,IAAI,gBAAgB;AAC/B,kBAAe,IAAI,iBAAiB,aAAa;AACjD,qBAAkB,KAAK;IACtB,SAAS;IACT,QAAQ,2BAA2B,KAAK;IACxC,CAAC;;;AAML,KAAI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KAAK,SAAS;;AAGvC,WAAS,MAAM;AACf,QAAM,KAAK,GAAG,SAAS;;AAIxB,KAAI,OAAO,SAAS,YAAY,QAAQ;EAEvC,MAAM,YAAY,IAAI,IAAI,OAAO,KAAK,MAAM,EAAE,GAAG,CAAC;EAClD,MAAM,YAAY,YAAY,QAAQ,MAAM,CAAC,UAAU,IAAI,EAAE,GAAG,CAAC;AACjE,YAAU,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,CAAC;AAClD,SAAO,KAAK,GAAG,UAAU;;AAG1B,QAAO"}
|
|
1
|
+
{"version":3,"file":"resolver.mjs","names":[],"sources":["../src/resolver.ts"],"sourcesContent":["import { getServiceById } from \"./services/registry.js\";\nimport { getSkillPackById } from \"./skills/registry.js\";\nimport type {\n\tAddedDependency,\n\tResolvedService,\n\tResolverError,\n\tResolverInput,\n\tResolverOutput,\n\tServiceDefinition,\n\tWarning,\n} from \"./types.js\";\n\nexport interface MemoryThresholds {\n\tinfo: number;\n\twarning: number;\n\tcritical: number;\n}\n\nconst DEFAULT_MEMORY_THRESHOLDS: MemoryThresholds = {\n\tinfo: 2048,\n\twarning: 4096,\n\tcritical: 8192,\n};\n\n/**\n * Resolves user selections into a complete, valid service list.\n *\n * Algorithm:\n * 1. Expand skill pack requirements into service list\n * 2. Resolve transitive `requires` dependencies (iterate until stable)\n * 3. Detect `conflictsWith` violations\n * 4. Check platform compatibility and GPU requirements\n * 5. Estimate total memory (sum minMemoryMB)\n * 6. Deduplicate\n * 7. Topological sort by dependency graph, alphabetical for ties\n *\n * Deterministic: same input -> same output, always.\n */\nexport function resolve(input: ResolverInput): ResolverOutput {\n\tconst addedDependencies: AddedDependency[] = [];\n\tconst warnings: Warning[] = [];\n\tconst errors: ResolverError[] = [];\n\n\t// Track all service IDs needed\n\tconst serviceIds = new Set<string>(input.services);\n\tconst serviceAddedBy = new Map<string, ResolvedService[\"addedBy\"]>();\n\n\t// Mark user-selected services\n\tfor (const id of input.services) {\n\t\tserviceAddedBy.set(id, \"user\");\n\t}\n\n\t// 1. Expand skill pack requirements\n\tfor (const packId of input.skillPacks) {\n\t\tconst pack = getSkillPackById(packId);\n\t\tif (!pack) {\n\t\t\terrors.push({\n\t\t\t\ttype: \"unknown_skill_pack\",\n\t\t\t\tmessage: `Unknown skill pack: \"${packId}\"`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const requiredService of pack.requiredServices) {\n\t\t\tif (!serviceIds.has(requiredService)) {\n\t\t\t\tserviceIds.add(requiredService);\n\t\t\t\tserviceAddedBy.set(requiredService, \"skill-pack\");\n\t\t\t\taddedDependencies.push({\n\t\t\t\t\tservice: requiredService,\n\t\t\t\t\treason: `Required by skill pack: ${pack.name}`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add proxy if specified\n\tif (input.proxy && input.proxy !== \"none\") {\n\t\tif (!serviceIds.has(input.proxy)) {\n\t\t\tserviceIds.add(input.proxy);\n\t\t\tserviceAddedBy.set(input.proxy, \"proxy\");\n\t\t\taddedDependencies.push({\n\t\t\t\tservice: input.proxy,\n\t\t\t\treason: `Selected as reverse proxy`,\n\t\t\t});\n\t\t}\n\t}\n\n\t// Add monitoring stack if requested\n\tif (input.monitoring) {\n\t\tconst monitoringServices = [\"uptime-kuma\", \"grafana\", \"prometheus\"];\n\t\tfor (const svc of monitoringServices) {\n\t\t\tif (!serviceIds.has(svc)) {\n\t\t\t\tserviceIds.add(svc);\n\t\t\t\tserviceAddedBy.set(svc, \"monitoring\");\n\t\t\t\taddedDependencies.push({\n\t\t\t\t\tservice: svc,\n\t\t\t\t\treason: \"Included with monitoring stack\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// Validate all service IDs exist\n\tconst unknownIds: string[] = [];\n\tfor (const id of serviceIds) {\n\t\tif (!getServiceById(id)) {\n\t\t\tunknownIds.push(id);\n\t\t}\n\t}\n\tif (unknownIds.length > 0) {\n\t\tfor (const id of unknownIds) {\n\t\t\terrors.push({\n\t\t\t\ttype: \"unknown_service\",\n\t\t\t\tmessage: `Unknown service: \"${id}\"`,\n\t\t\t});\n\t\t\tserviceIds.delete(id);\n\t\t}\n\t}\n\n\t// 2. Resolve transitive dependencies (iterate until stable)\n\tlet changed = true;\n\tconst maxIterations = 50; // safety bound\n\tlet iteration = 0;\n\twhile (changed && iteration < maxIterations) {\n\t\tchanged = false;\n\t\titeration++;\n\t\tfor (const id of [...serviceIds]) {\n\t\t\tconst def = getServiceById(id);\n\t\t\tif (!def) continue;\n\t\t\tfor (const reqId of def.requires) {\n\t\t\t\tif (!serviceIds.has(reqId)) {\n\t\t\t\t\tserviceIds.add(reqId);\n\t\t\t\t\tserviceAddedBy.set(reqId, \"dependency\");\n\t\t\t\t\taddedDependencies.push({\n\t\t\t\t\t\tservice: reqId,\n\t\t\t\t\t\treason: `Required by ${def.name}`,\n\t\t\t\t\t});\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (iteration >= maxIterations) {\n\t\twarnings.push({\n\t\t\ttype: \"resolution\",\n\t\t\tmessage: `Dependency resolution reached maximum iterations (${maxIterations}). Some transitive dependencies may not be fully resolved.`,\n\t\t});\n\t}\n\n\t// Check recommended services\n\tfor (const id of serviceIds) {\n\t\tconst def = getServiceById(id);\n\t\tif (!def) continue;\n\t\tfor (const recId of def.recommends) {\n\t\t\tif (!serviceIds.has(recId) && getServiceById(recId)) {\n\t\t\t\twarnings.push({\n\t\t\t\t\ttype: \"recommendation\",\n\t\t\t\t\tmessage: `${def.name} recommends \"${recId}\" for enhanced functionality`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// 3. Detect conflicts\n\tconst resolvedDefs: ServiceDefinition[] = [];\n\tfor (const id of serviceIds) {\n\t\tconst def = getServiceById(id);\n\t\tif (def) resolvedDefs.push(def);\n\t}\n\n\tfor (let i = 0; i < resolvedDefs.length; i++) {\n\t\tfor (let j = i + 1; j < resolvedDefs.length; j++) {\n\t\t\tconst a = resolvedDefs[i]!;\n\t\t\tconst b = resolvedDefs[j]!;\n\t\t\tif (a.conflictsWith.includes(b.id) || b.conflictsWith.includes(a.id)) {\n\t\t\t\terrors.push({\n\t\t\t\t\ttype: \"conflict\",\n\t\t\t\t\tmessage: `${a.name} and ${b.name} cannot be used together`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// 4. Check platform compatibility\n\tif (input.platform) {\n\t\tfor (const def of resolvedDefs) {\n\t\t\tif (def.platforms && def.platforms.length > 0 && !def.platforms.includes(input.platform)) {\n\t\t\t\twarnings.push({\n\t\t\t\t\ttype: \"platform\",\n\t\t\t\t\tmessage: `${def.name} may not be compatible with ${input.platform}. Supported: ${def.platforms.join(\", \")}`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check GPU requirements\n\tconst gpuServices = resolvedDefs.filter((d) => d.gpuRequired);\n\tif (gpuServices.length > 0 && !input.gpu) {\n\t\tfor (const svc of gpuServices) {\n\t\t\twarnings.push({\n\t\t\t\ttype: \"gpu\",\n\t\t\t\tmessage: `${svc.name} requires GPU passthrough. Enable --gpu flag for optimal performance.`,\n\t\t\t});\n\t\t}\n\t}\n\n\t// 5. Estimate total memory\n\tlet estimatedMemoryMB = 512; // Base for OpenClaw itself\n\tfor (const def of resolvedDefs) {\n\t\testimatedMemoryMB += def.minMemoryMB ?? 128;\n\t}\n\n\t// Memory warnings\n\tconst thresholds = input.memoryThresholds ?? DEFAULT_MEMORY_THRESHOLDS;\n\tif (estimatedMemoryMB > thresholds.critical) {\n\t\twarnings.push({\n\t\t\ttype: \"memory\",\n\t\t\tmessage: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required. Ensure your server has sufficient resources.`,\n\t\t});\n\t} else if (estimatedMemoryMB > thresholds.warning) {\n\t\twarnings.push({\n\t\t\ttype: \"memory\",\n\t\t\tmessage: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required. A server with at least 8GB RAM is recommended.`,\n\t\t});\n\t} else if (estimatedMemoryMB > thresholds.info) {\n\t\twarnings.push({\n\t\t\ttype: \"memory\",\n\t\t\tmessage: `Estimated ${(estimatedMemoryMB / 1024).toFixed(1)}GB RAM required.`,\n\t\t});\n\t}\n\n\t// 7. Topological sort by dependency graph\n\tconst sorted = topologicalSort(resolvedDefs);\n\n\t// Build final resolved services list\n\tconst services: ResolvedService[] = sorted.map((def) => ({\n\t\tdefinition: def,\n\t\taddedBy: serviceAddedBy.get(def.id) ?? \"user\",\n\t}));\n\n\tconst isValid = errors.length === 0;\n\n\treturn {\n\t\tservices,\n\t\taddedDependencies,\n\t\tremovedConflicts: [],\n\t\twarnings,\n\t\terrors,\n\t\tisValid,\n\t\testimatedMemoryMB,\n\t};\n}\n\n/**\n * Topological sort using Kahn's algorithm.\n * Ties broken alphabetically by service ID for determinism.\n */\nfunction topologicalSort(definitions: ServiceDefinition[]): ServiceDefinition[] {\n\tconst idSet = new Set(definitions.map((d) => d.id));\n\tconst graph = new Map<string, string[]>(); // id -> list of IDs that depend on it\n\tconst inDegree = new Map<string, number>();\n\n\t// Initialize\n\tfor (const def of definitions) {\n\t\tgraph.set(def.id, []);\n\t\tinDegree.set(def.id, 0);\n\t}\n\n\t// Build edges: if A requires B, then B -> A (B must come before A)\n\tfor (const def of definitions) {\n\t\tfor (const reqId of [...def.requires, ...def.dependsOn]) {\n\t\t\tif (idSet.has(reqId)) {\n\t\t\t\tgraph.get(reqId)?.push(def.id);\n\t\t\t\tinDegree.set(def.id, (inDegree.get(def.id) ?? 0) + 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Kahn's algorithm with alphabetical tie-breaking\n\tconst queue: string[] = [];\n\tfor (const [id, deg] of inDegree) {\n\t\tif (deg === 0) queue.push(id);\n\t}\n\tqueue.sort(); // alphabetical for determinism\n\n\tconst sorted: ServiceDefinition[] = [];\n\tconst defMap = new Map(definitions.map((d) => [d.id, d]));\n\n\twhile (queue.length > 0) {\n\t\tconst id = queue.shift()!;\n\t\tconst def = defMap.get(id);\n\t\tif (def) sorted.push(def);\n\n\t\tconst neighbors = graph.get(id) ?? [];\n\t\tconst newReady: string[] = [];\n\t\tfor (const neighbor of neighbors) {\n\t\t\tconst deg = (inDegree.get(neighbor) ?? 0) - 1;\n\t\t\tinDegree.set(neighbor, deg);\n\t\t\tif (deg === 0) newReady.push(neighbor);\n\t\t}\n\t\t// Sort newly ready nodes alphabetically and add to queue in order\n\t\tnewReady.sort();\n\t\tqueue.push(...newReady);\n\t}\n\n\t// If not all nodes are in sorted, there's a cycle\n\tif (sorted.length < definitions.length) {\n\t\t// Return what we have plus remaining (cycle detected but we still produce output)\n\t\tconst sortedIds = new Set(sorted.map((d) => d.id));\n\t\tconst remaining = definitions.filter((d) => !sortedIds.has(d.id));\n\t\tremaining.sort((a, b) => a.id.localeCompare(b.id));\n\t\tsorted.push(...remaining);\n\t}\n\n\treturn sorted;\n}\n"],"mappings":";;;;AAkBA,MAAM,4BAA8C;CACnD,MAAM;CACN,SAAS;CACT,UAAU;CACV;;;;;;;;;;;;;;;AAgBD,SAAgB,QAAQ,OAAsC;CAC7D,MAAM,oBAAuC,EAAE;CAC/C,MAAM,WAAsB,EAAE;CAC9B,MAAM,SAA0B,EAAE;CAGlC,MAAM,aAAa,IAAI,IAAY,MAAM,SAAS;CAClD,MAAM,iCAAiB,IAAI,KAAyC;AAGpE,MAAK,MAAM,MAAM,MAAM,SACtB,gBAAe,IAAI,IAAI,OAAO;AAI/B,MAAK,MAAM,UAAU,MAAM,YAAY;EACtC,MAAM,OAAO,iBAAiB,OAAO;AACrC,MAAI,CAAC,MAAM;AACV,UAAO,KAAK;IACX,MAAM;IACN,SAAS,wBAAwB,OAAO;IACxC,CAAC;AACF;;AAED,OAAK,MAAM,mBAAmB,KAAK,iBAClC,KAAI,CAAC,WAAW,IAAI,gBAAgB,EAAE;AACrC,cAAW,IAAI,gBAAgB;AAC/B,kBAAe,IAAI,iBAAiB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B,OAAM,MAAM;CAEZ,MAAM,SAA8B,EAAE;CACtC,MAAM,SAAS,IAAI,IAAI,YAAY,KAAK,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AAEzD,QAAO,MAAM,SAAS,GAAG;EACxB,MAAM,KAAK,MAAM,OAAO;EACxB,MAAM,MAAM,OAAO,IAAI,GAAG;AAC1B,MAAI,IAAK,QAAO,KAAK,IAAI;EAEzB,MAAM,YAAY,MAAM,IAAI,GAAG,IAAI,EAAE;EACrC,MAAM,WAAqB,EAAE;AAC7B,OAAK,MAAM,YAAY,WAAW;GACjC,MAAM,OAAO,SAAS,IAAI,SAAS,IAAI,KAAK;AAC5C,YAAS,IAAI,UAAU,IAAI;AAC3B,OAAI,QAAQ,EAAG,UAAS,KAAK,SAAS;;AAGvC,WAAS,MAAM;AACf,QAAM,KAAK,GAAG,SAAS;;AAIxB,KAAI,OAAO,SAAS,YAAY,QAAQ;EAEvC,MAAM,YAAY,IAAI,IAAI,OAAO,KAAK,MAAM,EAAE,GAAG,CAAC;EAClD,MAAM,YAAY,YAAY,QAAQ,MAAM,CAAC,UAAU,IAAI,EAAE,GAAG,CAAC;AACjE,YAAU,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,CAAC;AAClD,SAAO,KAAK,GAAG,UAAU;;AAG1B,QAAO"}
|
package/dist/schema.d.mts
CHANGED
|
@@ -19,6 +19,8 @@ declare const ServiceCategorySchema: z.ZodEnum<{
|
|
|
19
19
|
"ai-platform": "ai-platform";
|
|
20
20
|
"dev-tools": "dev-tools";
|
|
21
21
|
knowledge: "knowledge";
|
|
22
|
+
desktop: "desktop";
|
|
23
|
+
streaming: "streaming";
|
|
22
24
|
}>;
|
|
23
25
|
declare const MaturitySchema: z.ZodEnum<{
|
|
24
26
|
stable: "stable";
|
|
@@ -152,6 +154,8 @@ declare const ServiceDefinitionSchema: z.ZodObject<{
|
|
|
152
154
|
"ai-platform": "ai-platform";
|
|
153
155
|
"dev-tools": "dev-tools";
|
|
154
156
|
knowledge: "knowledge";
|
|
157
|
+
desktop: "desktop";
|
|
158
|
+
streaming: "streaming";
|
|
155
159
|
}>;
|
|
156
160
|
icon: z.ZodString;
|
|
157
161
|
image: z.ZodString;
|
|
@@ -280,6 +284,7 @@ declare const PresetSchema: z.ZodObject<{
|
|
|
280
284
|
estimatedMemoryMB: z.ZodOptional<z.ZodNumber>;
|
|
281
285
|
}, z.core.$strip>;
|
|
282
286
|
declare const GenerationInputSchema: z.ZodObject<{
|
|
287
|
+
configVersion: z.ZodOptional<z.ZodNumber>;
|
|
283
288
|
projectName: z.ZodString;
|
|
284
289
|
services: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
285
290
|
skillPacks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -334,6 +339,8 @@ declare const ResolvedServiceSchema: z.ZodObject<{
|
|
|
334
339
|
"ai-platform": "ai-platform";
|
|
335
340
|
"dev-tools": "dev-tools";
|
|
336
341
|
knowledge: "knowledge";
|
|
342
|
+
desktop: "desktop";
|
|
343
|
+
streaming: "streaming";
|
|
337
344
|
}>;
|
|
338
345
|
icon: z.ZodString;
|
|
339
346
|
image: z.ZodString;
|
|
@@ -488,6 +495,8 @@ declare const ResolverOutputSchema: z.ZodObject<{
|
|
|
488
495
|
"ai-platform": "ai-platform";
|
|
489
496
|
"dev-tools": "dev-tools";
|
|
490
497
|
knowledge: "knowledge";
|
|
498
|
+
desktop: "desktop";
|
|
499
|
+
streaming: "streaming";
|
|
491
500
|
}>;
|
|
492
501
|
icon: z.ZodString;
|
|
493
502
|
image: z.ZodString;
|
package/dist/schema.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.mts","names":[],"sources":["../src/schema.ts"],"mappings":";;;cAIa,qBAAA,EAAqB,CAAA,CAAA,OAAA
|
|
1
|
+
{"version":3,"file":"schema.d.mts","names":[],"sources":["../src/schema.ts"],"mappings":";;;cAIa,qBAAA,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKrB,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;cAKrB,aAAA,EAAa,CAAA,CAAA,SAAA;;;;cAKb,WAAA,EAAW,CAAA,CAAA,SAAA;;;;cAKX,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAYpB,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;cAcpB,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;cASrB,sBAAA,EAAsB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;cAStB,cAAA,EAAc,CAAA,CAAA,SAAA"}
|
package/dist/schema.mjs
CHANGED
|
@@ -18,7 +18,9 @@ const ServiceCategorySchema = z.enum([
|
|
|
18
18
|
"analytics",
|
|
19
19
|
"ai-platform",
|
|
20
20
|
"dev-tools",
|
|
21
|
-
"knowledge"
|
|
21
|
+
"knowledge",
|
|
22
|
+
"desktop",
|
|
23
|
+
"streaming"
|
|
22
24
|
]);
|
|
23
25
|
const MaturitySchema = z.enum([
|
|
24
26
|
"stable",
|
|
@@ -167,6 +169,7 @@ const PresetSchema = z.object({
|
|
|
167
169
|
estimatedMemoryMB: z.number().int().min(0).optional()
|
|
168
170
|
});
|
|
169
171
|
const GenerationInputSchema = z.object({
|
|
172
|
+
configVersion: z.number().int().min(1).optional(),
|
|
170
173
|
projectName: z.string().min(1).max(64).regex(/^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$/, { message: "Project name must be lowercase alphanumeric with hyphens, cannot start or end with hyphen" }),
|
|
171
174
|
services: z.array(z.string()).default([]),
|
|
172
175
|
skillPacks: z.array(z.string()).default([]),
|
package/dist/schema.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.mjs","names":[],"sources":["../src/schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// ─── Enums ──────────────────────────────────────────────────────────────────\n\nexport const ServiceCategorySchema = z.enum([\n\t\"automation\",\n\t\"vector-db\",\n\t\"media\",\n\t\"storage\",\n\t\"database\",\n\t\"proxy\",\n\t\"monitoring\",\n\t\"browser\",\n\t\"search\",\n\t\"ai\",\n\t\"communication\",\n\t\"coding-agent\",\n\t\"social-media\",\n\t\"analytics\",\n\t\"ai-platform\",\n\t\"dev-tools\",\n\t\"knowledge\",\n]);\n\nexport const MaturitySchema = z.enum([\"stable\", \"beta\", \"experimental\"]);\n\nexport const PlatformSchema = z.enum([\n\t\"linux/amd64\",\n\t\"linux/arm64\",\n\t\"windows/amd64\",\n\t\"macos/amd64\",\n\t\"macos/arm64\",\n]);\n\n/** Platform for Docker image arch only (used by resolver/compose). */\nexport const ComposePlatformSchema = z.enum([\"linux/amd64\", \"linux/arm64\"]);\n\nexport const DeploymentTypeSchema = z.enum([\"docker\", \"bare-metal\"]);\n\nexport const RestartPolicySchema = z.enum([\"unless-stopped\", \"always\", \"on-failure\", \"no\"]);\n\nexport const ProxyTypeSchema = z.enum([\"none\", \"caddy\", \"traefik\"]);\n\nexport const DeploymentTargetSchema = z.enum([\"local\", \"vps\", \"homelab\", \"clawexa\"]);\n\nexport const OutputFormatSchema = z.enum([\"directory\", \"tar\", \"zip\"]);\n\n// ─── Sub-Schemas ────────────────────────────────────────────────────────────\n\nexport const PortMappingSchema = z.object({\n\thost: z.number().int().min(1).max(65535),\n\tcontainer: z.number().int().min(1).max(65535),\n\tdescription: z.string(),\n\texposed: z.boolean().default(true),\n});\n\nexport const VolumeMappingSchema = z.object({\n\tname: z.string().min(1),\n\tcontainerPath: z.string().min(1),\n\tdescription: z.string(),\n\tdriver: z.string().optional(),\n});\n\nexport const EnvVariableSchema = z.object({\n\tkey: z.string().min(1),\n\tdefaultValue: z.string(),\n\tsecret: z.boolean().default(false),\n\tdescription: z.string(),\n\trequired: z.boolean().default(true),\n\tvalidation: z.string().optional(),\n});\n\nexport const HealthCheckSchema = z.object({\n\ttest: z.string().min(1),\n\tinterval: z.string().default(\"30s\"),\n\ttimeout: z.string().default(\"10s\"),\n\tretries: z.number().int().min(1).default(3),\n\tstartPeriod: z.string().optional(),\n});\n\nexport const ResourceLimitsSchema = z.object({\n\tcpus: z.string().optional(),\n\tmemory: z.string().optional(),\n});\n\nexport const DeploySchema = z.object({\n\tresources: z\n\t\t.object({\n\t\t\tlimits: ResourceLimitsSchema.optional(),\n\t\t\treservations: ResourceLimitsSchema.optional(),\n\t\t})\n\t\t.optional(),\n});\n\nexport const SkillBindingSchema = z.object({\n\tskillId: z.string().min(1),\n\tautoInstall: z.boolean().default(true),\n\tconfigOverrides: z.record(z.string(), z.string()).optional(),\n});\n\n/** Platform for native install (linux, windows, macos — no arch). */\nexport const NativePlatformSchema = z.enum([\"linux\", \"windows\", \"macos\"]);\n\nexport const NativeRecipeSchema = z.object({\n\tplatform: NativePlatformSchema,\n\tinstallSteps: z.array(z.string()).min(1),\n\tstartCommand: z.string(),\n\tstopCommand: z.string().optional(),\n\tconfigPath: z.string().optional(),\n\tconfigTemplate: z.string().optional(),\n\tsystemdUnit: z.string().optional(),\n});\n\n// ─── Service Definition ─────────────────────────────────────────────────────\n\nexport const ServiceDefinitionSchema = z.object({\n\t// Identity\n\tid: z\n\t\t.string()\n\t\t.min(1)\n\t\t.regex(/^[a-z0-9-]+$/),\n\tname: z.string().min(1),\n\tdescription: z.string(),\n\tcategory: ServiceCategorySchema,\n\ticon: z.string(),\n\n\t// Docker\n\timage: z.string().min(1),\n\timageTag: z.string().min(1),\n\tports: z.array(PortMappingSchema).default([]),\n\tvolumes: z.array(VolumeMappingSchema).default([]),\n\tenvironment: z.array(EnvVariableSchema).default([]),\n\thealthcheck: HealthCheckSchema.optional(),\n\tcommand: z.string().optional(),\n\tentrypoint: z.string().optional(),\n\tdependsOn: z.array(z.string()).default([]),\n\trestartPolicy: RestartPolicySchema.default(\"unless-stopped\"),\n\tnetworks: z.array(z.string()).default([\"openclaw-network\"]),\n\tlabels: z.record(z.string(), z.string()).optional(),\n\tdeploy: DeploySchema.optional(),\n\n\t// OpenClaw Integration\n\tskills: z.array(SkillBindingSchema).default([]),\n\topenclawEnvVars: z.array(EnvVariableSchema).default([]),\n\topenclawVolumeMounts: z.array(VolumeMappingSchema).optional(),\n\n\t// Metadata\n\tdocsUrl: z.string().url(),\n\tselfHostedDocsUrl: z.string().url().optional(),\n\ttags: z.array(z.string()).default([]),\n\tmaturity: MaturitySchema.default(\"stable\"),\n\n\t// Dependencies & Conflicts\n\trequires: z.array(z.string()).default([]),\n\trecommends: z.array(z.string()).default([]),\n\tconflictsWith: z.array(z.string()).default([]),\n\tmandatory: z.boolean().default(false).optional(),\n\tremovalWarning: z.string().optional(),\n\n\t// Platform Constraints\n\tplatforms: z.array(PlatformSchema).optional(),\n\tminMemoryMB: z.number().int().min(0).optional(),\n\tgpuRequired: z.boolean().default(false),\n\n\t// Bare-metal native (install/run on host when no Docker)\n\tnativeSupported: z.boolean().optional(),\n\tnativeRecipes: z.array(NativeRecipeSchema).optional(),\n});\n\n// ─── Skill Pack ─────────────────────────────────────────────────────────────\n\nexport const SkillPackSchema = z.object({\n\tid: z\n\t\t.string()\n\t\t.min(1)\n\t\t.regex(/^[a-z0-9-]+$/),\n\tname: z.string().min(1),\n\tdescription: z.string(),\n\trequiredServices: z.array(z.string()).min(1),\n\tskills: z.array(z.string()),\n\ticon: z.string().optional(),\n\ttags: z.array(z.string()).default([]),\n});\n\n// ─── Preset ─────────────────────────────────────────────────────────────────\n\nexport const PresetSchema = z.object({\n\tid: z\n\t\t.string()\n\t\t.min(1)\n\t\t.regex(/^[a-z0-9-]+$/),\n\tname: z.string().min(1),\n\tdescription: z.string(),\n\tservices: z.array(z.string()),\n\tskillPacks: z.array(z.string()).default([]),\n\testimatedMemoryMB: z.number().int().min(0).optional(),\n});\n\n// ─── Generation Input ───────────────────────────────────────────────────────\n\nexport const GenerationInputSchema = z.object({\n\tprojectName: z\n\t\t.string()\n\t\t.min(1)\n\t\t.max(64)\n\t\t.regex(/^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$/, {\n\t\t\tmessage:\n\t\t\t\t\"Project name must be lowercase alphanumeric with hyphens, cannot start or end with hyphen\",\n\t\t}),\n\tservices: z.array(z.string()).default([]),\n\tskillPacks: z.array(z.string()).default([]),\n\tproxy: ProxyTypeSchema.default(\"none\"),\n\tdomain: z.string().optional(),\n\tgpu: z.boolean().default(false),\n\tplatform: PlatformSchema.default(\"linux/amd64\"),\n\tdeployment: DeploymentTargetSchema.default(\"local\"),\n\tdeploymentType: DeploymentTypeSchema.default(\"docker\"),\n\tgenerateSecrets: z.boolean().default(true),\n\topenclawVersion: z.string().default(\"latest\"),\n\tmonitoring: z.boolean().default(false),\n});\n\n// ─── Resolver Output ────────────────────────────────────────────────────────\n\nexport const ResolvedServiceSchema = z.object({\n\tdefinition: ServiceDefinitionSchema,\n\taddedBy: z.enum([\"user\", \"dependency\", \"skill-pack\", \"proxy\", \"monitoring\"]).default(\"user\"),\n});\n\nexport const AddedDependencySchema = z.object({\n\tservice: z.string(),\n\treason: z.string(),\n});\n\nexport const WarningSchema = z.object({\n\ttype: z.string(),\n\tmessage: z.string(),\n});\n\nexport const ErrorSchema = z.object({\n\ttype: z.string(),\n\tmessage: z.string(),\n});\n\nexport const ResolverOutputSchema = z.object({\n\tservices: z.array(ResolvedServiceSchema),\n\taddedDependencies: z.array(AddedDependencySchema),\n\tremovedConflicts: z.array(z.object({ service: z.string(), reason: z.string() })),\n\twarnings: z.array(WarningSchema),\n\terrors: z.array(ErrorSchema),\n\tisValid: z.boolean(),\n\testimatedMemoryMB: z.number().int().min(0),\n});\n\n// ─── Compose Options ────────────────────────────────────────────────────────\n\nexport const ComposeOptionsSchema = z.object({\n\tprojectName: z.string(),\n\tproxy: ProxyTypeSchema.default(\"none\"),\n\tdomain: z.string().optional(),\n\tgpu: z.boolean().default(false),\n\tplatform: PlatformSchema.default(\"linux/amd64\"),\n\tdeployment: DeploymentTargetSchema.default(\"local\"),\n\topenclawVersion: z.string().default(\"latest\"),\n\t/** When true, gateway gets extra_hosts so it can reach host-run (native) services. */\n\tbareMetalNativeHost: z.boolean().optional(),\n});\n\n// ─── API Request/Response ───────────────────────────────────────────────────\n\nexport const ValidateRequestSchema = z.object({\n\tservices: z.array(z.string()),\n\tskillPacks: z.array(z.string()).default([]),\n\tproxy: ProxyTypeSchema.default(\"none\"),\n\tdomain: z.string().optional(),\n\tgpu: z.boolean().default(false),\n\tplatform: PlatformSchema.default(\"linux/amd64\"),\n});\n\nexport const ValidateResponseSchema = z.object({\n\tvalid: z.boolean(),\n\tresolvedServices: z.array(z.string()),\n\taddedDependencies: z.array(AddedDependencySchema),\n\twarnings: z.array(WarningSchema),\n\tconflicts: z.array(ErrorSchema),\n\testimatedMemoryMB: z.number(),\n});\n\nexport const ApiErrorSchema = z.object({\n\terror: z.object({\n\t\tcode: z.enum([\n\t\t\t\"VALIDATION_ERROR\",\n\t\t\t\"CONFLICT_ERROR\",\n\t\t\t\"GENERATION_ERROR\",\n\t\t\t\"RATE_LIMITED\",\n\t\t\t\"INTERNAL_ERROR\",\n\t\t]),\n\t\tmessage: z.string(),\n\t\tdetails: z\n\t\t\t.array(\n\t\t\t\tz.object({\n\t\t\t\t\tfield: z.string().optional(),\n\t\t\t\t\tmessage: z.string(),\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.optional(),\n\t}),\n});\n"],"mappings":";;;AAIA,MAAa,wBAAwB,EAAE,KAAK;CAC3C;CAC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ACA;EACA;EACA,CAAC;CACF,SAAS,EAAE,QAAQ;CACnB,SAAS,EACP,MACA,EAAE,OAAO;EACR,OAAO,EAAE,QAAQ,CAAC,UAAU;EAC5B,SAAS,EAAE,QAAQ;EACnB,CAAC,CACF,CACA,UAAU;CACZ,CAAC,EACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"schema.mjs","names":[],"sources":["../src/schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// ─── Enums ──────────────────────────────────────────────────────────────────\n\nexport const ServiceCategorySchema = z.enum([\n\t\"automation\",\n\t\"vector-db\",\n\t\"media\",\n\t\"storage\",\n\t\"database\",\n\t\"proxy\",\n\t\"monitoring\",\n\t\"browser\",\n\t\"search\",\n\t\"ai\",\n\t\"communication\",\n\t\"coding-agent\",\n\t\"social-media\",\n\t\"analytics\",\n\t\"ai-platform\",\n\t\"dev-tools\",\n\t\"knowledge\",\n\t\"desktop\",\n\t\"streaming\",\n]);\n\nexport const MaturitySchema = z.enum([\"stable\", \"beta\", \"experimental\"]);\n\nexport const PlatformSchema = z.enum([\n\t\"linux/amd64\",\n\t\"linux/arm64\",\n\t\"windows/amd64\",\n\t\"macos/amd64\",\n\t\"macos/arm64\",\n]);\n\n/** Platform for Docker image arch only (used by resolver/compose). */\nexport const ComposePlatformSchema = z.enum([\"linux/amd64\", \"linux/arm64\"]);\n\nexport const DeploymentTypeSchema = z.enum([\"docker\", \"bare-metal\"]);\n\nexport const RestartPolicySchema = z.enum([\"unless-stopped\", \"always\", \"on-failure\", \"no\"]);\n\nexport const ProxyTypeSchema = z.enum([\"none\", \"caddy\", \"traefik\"]);\n\nexport const DeploymentTargetSchema = z.enum([\"local\", \"vps\", \"homelab\", \"clawexa\"]);\n\nexport const OutputFormatSchema = z.enum([\"directory\", \"tar\", \"zip\"]);\n\n// ─── Sub-Schemas ────────────────────────────────────────────────────────────\n\nexport const PortMappingSchema = z.object({\n\thost: z.number().int().min(1).max(65535),\n\tcontainer: z.number().int().min(1).max(65535),\n\tdescription: z.string(),\n\texposed: z.boolean().default(true),\n});\n\nexport const VolumeMappingSchema = z.object({\n\tname: z.string().min(1),\n\tcontainerPath: z.string().min(1),\n\tdescription: z.string(),\n\tdriver: z.string().optional(),\n});\n\nexport const EnvVariableSchema = z.object({\n\tkey: z.string().min(1),\n\tdefaultValue: z.string(),\n\tsecret: z.boolean().default(false),\n\tdescription: z.string(),\n\trequired: z.boolean().default(true),\n\tvalidation: z.string().optional(),\n});\n\nexport const HealthCheckSchema = z.object({\n\ttest: z.string().min(1),\n\tinterval: z.string().default(\"30s\"),\n\ttimeout: z.string().default(\"10s\"),\n\tretries: z.number().int().min(1).default(3),\n\tstartPeriod: z.string().optional(),\n});\n\nexport const ResourceLimitsSchema = z.object({\n\tcpus: z.string().optional(),\n\tmemory: z.string().optional(),\n});\n\nexport const DeploySchema = z.object({\n\tresources: z\n\t\t.object({\n\t\t\tlimits: ResourceLimitsSchema.optional(),\n\t\t\treservations: ResourceLimitsSchema.optional(),\n\t\t})\n\t\t.optional(),\n});\n\nexport const SkillBindingSchema = z.object({\n\tskillId: z.string().min(1),\n\tautoInstall: z.boolean().default(true),\n\tconfigOverrides: z.record(z.string(), z.string()).optional(),\n});\n\n/** Platform for native install (linux, windows, macos — no arch). */\nexport const NativePlatformSchema = z.enum([\"linux\", \"windows\", \"macos\"]);\n\nexport const NativeRecipeSchema = z.object({\n\tplatform: NativePlatformSchema,\n\tinstallSteps: z.array(z.string()).min(1),\n\tstartCommand: z.string(),\n\tstopCommand: z.string().optional(),\n\tconfigPath: z.string().optional(),\n\tconfigTemplate: z.string().optional(),\n\tsystemdUnit: z.string().optional(),\n});\n\n// ─── Service Definition ─────────────────────────────────────────────────────\n\nexport const ServiceDefinitionSchema = z.object({\n\t// Identity\n\tid: z\n\t\t.string()\n\t\t.min(1)\n\t\t.regex(/^[a-z0-9-]+$/),\n\tname: z.string().min(1),\n\tdescription: z.string(),\n\tcategory: ServiceCategorySchema,\n\ticon: z.string(),\n\n\t// Docker\n\timage: z.string().min(1),\n\timageTag: z.string().min(1),\n\tports: z.array(PortMappingSchema).default([]),\n\tvolumes: z.array(VolumeMappingSchema).default([]),\n\tenvironment: z.array(EnvVariableSchema).default([]),\n\thealthcheck: HealthCheckSchema.optional(),\n\tcommand: z.string().optional(),\n\tentrypoint: z.string().optional(),\n\tdependsOn: z.array(z.string()).default([]),\n\trestartPolicy: RestartPolicySchema.default(\"unless-stopped\"),\n\tnetworks: z.array(z.string()).default([\"openclaw-network\"]),\n\tlabels: z.record(z.string(), z.string()).optional(),\n\tdeploy: DeploySchema.optional(),\n\n\t// OpenClaw Integration\n\tskills: z.array(SkillBindingSchema).default([]),\n\topenclawEnvVars: z.array(EnvVariableSchema).default([]),\n\topenclawVolumeMounts: z.array(VolumeMappingSchema).optional(),\n\n\t// Metadata\n\tdocsUrl: z.string().url(),\n\tselfHostedDocsUrl: z.string().url().optional(),\n\ttags: z.array(z.string()).default([]),\n\tmaturity: MaturitySchema.default(\"stable\"),\n\n\t// Dependencies & Conflicts\n\trequires: z.array(z.string()).default([]),\n\trecommends: z.array(z.string()).default([]),\n\tconflictsWith: z.array(z.string()).default([]),\n\tmandatory: z.boolean().default(false).optional(),\n\tremovalWarning: z.string().optional(),\n\n\t// Platform Constraints\n\tplatforms: z.array(PlatformSchema).optional(),\n\tminMemoryMB: z.number().int().min(0).optional(),\n\tgpuRequired: z.boolean().default(false),\n\n\t// Bare-metal native (install/run on host when no Docker)\n\tnativeSupported: z.boolean().optional(),\n\tnativeRecipes: z.array(NativeRecipeSchema).optional(),\n});\n\n// ─── Skill Pack ─────────────────────────────────────────────────────────────\n\nexport const SkillPackSchema = z.object({\n\tid: z\n\t\t.string()\n\t\t.min(1)\n\t\t.regex(/^[a-z0-9-]+$/),\n\tname: z.string().min(1),\n\tdescription: z.string(),\n\trequiredServices: z.array(z.string()).min(1),\n\tskills: z.array(z.string()),\n\ticon: z.string().optional(),\n\ttags: z.array(z.string()).default([]),\n});\n\n// ─── Preset ─────────────────────────────────────────────────────────────────\n\nexport const PresetSchema = z.object({\n\tid: z\n\t\t.string()\n\t\t.min(1)\n\t\t.regex(/^[a-z0-9-]+$/),\n\tname: z.string().min(1),\n\tdescription: z.string(),\n\tservices: z.array(z.string()),\n\tskillPacks: z.array(z.string()).default([]),\n\testimatedMemoryMB: z.number().int().min(0).optional(),\n});\n\n// ─── Generation Input ───────────────────────────────────────────────────────\n\nexport const GenerationInputSchema = z.object({\n\tconfigVersion: z.number().int().min(1).optional(),\n\tprojectName: z\n\t\t.string()\n\t\t.min(1)\n\t\t.max(64)\n\t\t.regex(/^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$/, {\n\t\t\tmessage:\n\t\t\t\t\"Project name must be lowercase alphanumeric with hyphens, cannot start or end with hyphen\",\n\t\t}),\n\tservices: z.array(z.string()).default([]),\n\tskillPacks: z.array(z.string()).default([]),\n\tproxy: ProxyTypeSchema.default(\"none\"),\n\tdomain: z.string().optional(),\n\tgpu: z.boolean().default(false),\n\tplatform: PlatformSchema.default(\"linux/amd64\"),\n\tdeployment: DeploymentTargetSchema.default(\"local\"),\n\tdeploymentType: DeploymentTypeSchema.default(\"docker\"),\n\tgenerateSecrets: z.boolean().default(true),\n\topenclawVersion: z.string().default(\"latest\"),\n\tmonitoring: z.boolean().default(false),\n});\n\n// ─── Resolver Output ────────────────────────────────────────────────────────\n\nexport const ResolvedServiceSchema = z.object({\n\tdefinition: ServiceDefinitionSchema,\n\taddedBy: z.enum([\"user\", \"dependency\", \"skill-pack\", \"proxy\", \"monitoring\"]).default(\"user\"),\n});\n\nexport const AddedDependencySchema = z.object({\n\tservice: z.string(),\n\treason: z.string(),\n});\n\nexport const WarningSchema = z.object({\n\ttype: z.string(),\n\tmessage: z.string(),\n});\n\nexport const ErrorSchema = z.object({\n\ttype: z.string(),\n\tmessage: z.string(),\n});\n\nexport const ResolverOutputSchema = z.object({\n\tservices: z.array(ResolvedServiceSchema),\n\taddedDependencies: z.array(AddedDependencySchema),\n\tremovedConflicts: z.array(z.object({ service: z.string(), reason: z.string() })),\n\twarnings: z.array(WarningSchema),\n\terrors: z.array(ErrorSchema),\n\tisValid: z.boolean(),\n\testimatedMemoryMB: z.number().int().min(0),\n});\n\n// ─── Compose Options ────────────────────────────────────────────────────────\n\nexport const ComposeOptionsSchema = z.object({\n\tprojectName: z.string(),\n\tproxy: ProxyTypeSchema.default(\"none\"),\n\tdomain: z.string().optional(),\n\tgpu: z.boolean().default(false),\n\tplatform: PlatformSchema.default(\"linux/amd64\"),\n\tdeployment: DeploymentTargetSchema.default(\"local\"),\n\topenclawVersion: z.string().default(\"latest\"),\n\t/** When true, gateway gets extra_hosts so it can reach host-run (native) services. */\n\tbareMetalNativeHost: z.boolean().optional(),\n});\n\n// ─── API Request/Response ───────────────────────────────────────────────────\n\nexport const ValidateRequestSchema = z.object({\n\tservices: z.array(z.string()),\n\tskillPacks: z.array(z.string()).default([]),\n\tproxy: ProxyTypeSchema.default(\"none\"),\n\tdomain: z.string().optional(),\n\tgpu: z.boolean().default(false),\n\tplatform: PlatformSchema.default(\"linux/amd64\"),\n});\n\nexport const ValidateResponseSchema = z.object({\n\tvalid: z.boolean(),\n\tresolvedServices: z.array(z.string()),\n\taddedDependencies: z.array(AddedDependencySchema),\n\twarnings: z.array(WarningSchema),\n\tconflicts: z.array(ErrorSchema),\n\testimatedMemoryMB: z.number(),\n});\n\nexport const ApiErrorSchema = z.object({\n\terror: z.object({\n\t\tcode: z.enum([\n\t\t\t\"VALIDATION_ERROR\",\n\t\t\t\"CONFLICT_ERROR\",\n\t\t\t\"GENERATION_ERROR\",\n\t\t\t\"RATE_LIMITED\",\n\t\t\t\"INTERNAL_ERROR\",\n\t\t]),\n\t\tmessage: z.string(),\n\t\tdetails: z\n\t\t\t.array(\n\t\t\t\tz.object({\n\t\t\t\t\tfield: z.string().optional(),\n\t\t\t\t\tmessage: z.string(),\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.optional(),\n\t}),\n});\n"],"mappings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,EAAE,QAAQ;CAC7B,CAAC;AAEF,MAAa,iBAAiB,EAAE,OAAO,EACtC,OAAO,EAAE,OAAO;CACf,MAAM,EAAE,KAAK;EACZ;EACA;EACA;EACA;EACA;EACA,CAAC;CACF,SAAS,EAAE,QAAQ;CACnB,SAAS,EACP,MACA,EAAE,OAAO;EACR,OAAO,EAAE,QAAQ,CAAC,UAAU;EAC5B,SAAS,EAAE,QAAQ;EACnB,CAAC,CACF,CACA,UAAU;CACZ,CAAC,EACF,CAAC"}
|
|
@@ -28,11 +28,30 @@ const caddyDefinition = {
|
|
|
28
28
|
description: "Caddy configuration storage"
|
|
29
29
|
}],
|
|
30
30
|
environment: [],
|
|
31
|
+
healthcheck: {
|
|
32
|
+
test: "wget -q --spider http://localhost:80 || exit 1",
|
|
33
|
+
interval: "30s",
|
|
34
|
+
timeout: "10s",
|
|
35
|
+
retries: 3,
|
|
36
|
+
startPeriod: "5s"
|
|
37
|
+
},
|
|
31
38
|
dependsOn: [],
|
|
32
39
|
restartPolicy: "unless-stopped",
|
|
33
40
|
networks: ["openclaw-network"],
|
|
34
41
|
skills: [],
|
|
35
|
-
openclawEnvVars: [
|
|
42
|
+
openclawEnvVars: [{
|
|
43
|
+
key: "CADDY_HOST",
|
|
44
|
+
defaultValue: "caddy",
|
|
45
|
+
secret: false,
|
|
46
|
+
description: "Caddy reverse proxy hostname",
|
|
47
|
+
required: false
|
|
48
|
+
}, {
|
|
49
|
+
key: "CADDY_HTTP_PORT",
|
|
50
|
+
defaultValue: "80",
|
|
51
|
+
secret: false,
|
|
52
|
+
description: "Caddy HTTP port",
|
|
53
|
+
required: false
|
|
54
|
+
}],
|
|
36
55
|
docsUrl: "https://caddyserver.com/docs/",
|
|
37
56
|
tags: [
|
|
38
57
|
"reverse-proxy",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caddy.mjs","names":[],"sources":["../../../src/services/definitions/caddy.ts"],"sourcesContent":["import type { ServiceDefinition } from \"../../types.js\";\n\nexport const caddyDefinition: ServiceDefinition = {\n\tid: \"caddy\",\n\tname: \"Caddy\",\n\tdescription:\n\t\t\"Modern, fast reverse proxy and web server with automatic HTTPS via Let's Encrypt, HTTP/3 support, and simple configuration.\",\n\tcategory: \"proxy\",\n\ticon: \"🔒\",\n\n\timage: \"caddy\",\n\timageTag: \"2-alpine\",\n\tports: [\n\t\t{\n\t\t\thost: 80,\n\t\t\tcontainer: 80,\n\t\t\tdescription: \"HTTP traffic\",\n\t\t\texposed: true,\n\t\t},\n\t\t{\n\t\t\thost: 443,\n\t\t\tcontainer: 443,\n\t\t\tdescription: \"HTTPS traffic\",\n\t\t\texposed: true,\n\t\t},\n\t],\n\tvolumes: [\n\t\t{\n\t\t\tname: \"caddy-data\",\n\t\t\tcontainerPath: \"/data\",\n\t\t\tdescription: \"Caddy TLS certificates and persistent data\",\n\t\t},\n\t\t{\n\t\t\tname: \"caddy-config\",\n\t\t\tcontainerPath: \"/config\",\n\t\t\tdescription: \"Caddy configuration storage\",\n\t\t},\n\t],\n\tenvironment: [],\n\tdependsOn: [],\n\trestartPolicy: \"unless-stopped\",\n\tnetworks: [\"openclaw-network\"],\n\n\tskills: [],\n\topenclawEnvVars: [],\n\n\tdocsUrl: \"https://caddyserver.com/docs/\",\n\ttags: [\"reverse-proxy\", \"auto-https\", \"ssl\"],\n\tmaturity: \"stable\",\n\n\trequires: [],\n\trecommends: [],\n\tconflictsWith: [\"traefik\"],\n\n\tminMemoryMB: 64,\n\tgpuRequired: false,\n};\n"],"mappings":";AAEA,MAAa,kBAAqC;CACjD,IAAI;CACJ,MAAM;CACN,aACC;CACD,UAAU;CACV,MAAM;CAEN,OAAO;CACP,UAAU;CACV,OAAO,CACN;EACC,MAAM;EACN,WAAW;EACX,aAAa;EACb,SAAS;EACT,EACD;EACC,MAAM;EACN,WAAW;EACX,aAAa;EACb,SAAS;EACT,CACD;CACD,SAAS,CACR;EACC,MAAM;EACN,eAAe;EACf,aAAa;EACb,EACD;EACC,MAAM;EACN,eAAe;EACf,aAAa;EACb,CACD;CACD,aAAa,EAAE;CACf,WAAW,EAAE;CACb,eAAe;CACf,UAAU,CAAC,mBAAmB;CAE9B,QAAQ,EAAE;CACV,iBAAiB,
|
|
1
|
+
{"version":3,"file":"caddy.mjs","names":[],"sources":["../../../src/services/definitions/caddy.ts"],"sourcesContent":["import type { ServiceDefinition } from \"../../types.js\";\n\nexport const caddyDefinition: ServiceDefinition = {\n\tid: \"caddy\",\n\tname: \"Caddy\",\n\tdescription:\n\t\t\"Modern, fast reverse proxy and web server with automatic HTTPS via Let's Encrypt, HTTP/3 support, and simple configuration.\",\n\tcategory: \"proxy\",\n\ticon: \"🔒\",\n\n\timage: \"caddy\",\n\timageTag: \"2-alpine\",\n\tports: [\n\t\t{\n\t\t\thost: 80,\n\t\t\tcontainer: 80,\n\t\t\tdescription: \"HTTP traffic\",\n\t\t\texposed: true,\n\t\t},\n\t\t{\n\t\t\thost: 443,\n\t\t\tcontainer: 443,\n\t\t\tdescription: \"HTTPS traffic\",\n\t\t\texposed: true,\n\t\t},\n\t],\n\tvolumes: [\n\t\t{\n\t\t\tname: \"caddy-data\",\n\t\t\tcontainerPath: \"/data\",\n\t\t\tdescription: \"Caddy TLS certificates and persistent data\",\n\t\t},\n\t\t{\n\t\t\tname: \"caddy-config\",\n\t\t\tcontainerPath: \"/config\",\n\t\t\tdescription: \"Caddy configuration storage\",\n\t\t},\n\t],\n\tenvironment: [],\n\thealthcheck: {\n\t\ttest: \"wget -q --spider http://localhost:80 || exit 1\",\n\t\tinterval: \"30s\",\n\t\ttimeout: \"10s\",\n\t\tretries: 3,\n\t\tstartPeriod: \"5s\",\n\t},\n\tdependsOn: [],\n\trestartPolicy: \"unless-stopped\",\n\tnetworks: [\"openclaw-network\"],\n\n\tskills: [],\n\topenclawEnvVars: [\n\t\t{\n\t\t\tkey: \"CADDY_HOST\",\n\t\t\tdefaultValue: \"caddy\",\n\t\t\tsecret: false,\n\t\t\tdescription: \"Caddy reverse proxy hostname\",\n\t\t\trequired: false,\n\t\t},\n\t\t{\n\t\t\tkey: \"CADDY_HTTP_PORT\",\n\t\t\tdefaultValue: \"80\",\n\t\t\tsecret: false,\n\t\t\tdescription: \"Caddy HTTP port\",\n\t\t\trequired: false,\n\t\t},\n\t],\n\n\tdocsUrl: \"https://caddyserver.com/docs/\",\n\ttags: [\"reverse-proxy\", \"auto-https\", \"ssl\"],\n\tmaturity: \"stable\",\n\n\trequires: [],\n\trecommends: [],\n\tconflictsWith: [\"traefik\"],\n\n\tminMemoryMB: 64,\n\tgpuRequired: false,\n};\n"],"mappings":";AAEA,MAAa,kBAAqC;CACjD,IAAI;CACJ,MAAM;CACN,aACC;CACD,UAAU;CACV,MAAM;CAEN,OAAO;CACP,UAAU;CACV,OAAO,CACN;EACC,MAAM;EACN,WAAW;EACX,aAAa;EACb,SAAS;EACT,EACD;EACC,MAAM;EACN,WAAW;EACX,aAAa;EACb,SAAS;EACT,CACD;CACD,SAAS,CACR;EACC,MAAM;EACN,eAAe;EACf,aAAa;EACb,EACD;EACC,MAAM;EACN,eAAe;EACf,aAAa;EACb,CACD;CACD,aAAa,EAAE;CACf,aAAa;EACZ,MAAM;EACN,UAAU;EACV,SAAS;EACT,SAAS;EACT,aAAa;EACb;CACD,WAAW,EAAE;CACb,eAAe;CACf,UAAU,CAAC,mBAAmB;CAE9B,QAAQ,EAAE;CACV,iBAAiB,CAChB;EACC,KAAK;EACL,cAAc;EACd,QAAQ;EACR,aAAa;EACb,UAAU;EACV,EACD;EACC,KAAK;EACL,cAAc;EACd,QAAQ;EACR,aAAa;EACb,UAAU;EACV,CACD;CAED,SAAS;CACT,MAAM;EAAC;EAAiB;EAAc;EAAM;CAC5C,UAAU;CAEV,UAAU,EAAE;CACZ,YAAY,EAAE;CACd,eAAe,CAAC,UAAU;CAE1B,aAAa;CACb,aAAa;CACb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cal-com.d.mts","names":[],"sources":["../../../src/services/definitions/cal-com.ts"],"mappings":";;;cAEa,gBAAA,EAAkB,iBAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
//#region src/services/definitions/cal-com.ts
|
|
2
|
+
const calComDefinition = {
|
|
3
|
+
id: "cal-com",
|
|
4
|
+
name: "Cal.com",
|
|
5
|
+
description: "Open-source scheduling platform for appointments, meetings, and booking management with calendar integrations and customizable workflows.",
|
|
6
|
+
category: "automation",
|
|
7
|
+
icon: "📅",
|
|
8
|
+
image: "calcom/cal.com",
|
|
9
|
+
imageTag: "latest",
|
|
10
|
+
ports: [{
|
|
11
|
+
host: 3005,
|
|
12
|
+
container: 3e3,
|
|
13
|
+
description: "Cal.com web UI",
|
|
14
|
+
exposed: true
|
|
15
|
+
}],
|
|
16
|
+
volumes: [],
|
|
17
|
+
environment: [
|
|
18
|
+
{
|
|
19
|
+
key: "DATABASE_URL",
|
|
20
|
+
defaultValue: "postgresql://calcom:${CALCOM_DB_PASSWORD}@postgresql:5432/calcom",
|
|
21
|
+
secret: true,
|
|
22
|
+
description: "PostgreSQL connection URL for Cal.com",
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: "NEXTAUTH_SECRET",
|
|
27
|
+
defaultValue: "",
|
|
28
|
+
secret: true,
|
|
29
|
+
description: "NextAuth.js session encryption secret",
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: "CALENDSO_ENCRYPTION_KEY",
|
|
34
|
+
defaultValue: "",
|
|
35
|
+
secret: true,
|
|
36
|
+
description: "Encryption key for calendar data at rest",
|
|
37
|
+
required: true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: "NEXT_PUBLIC_WEBAPP_URL",
|
|
41
|
+
defaultValue: "http://localhost:3005",
|
|
42
|
+
secret: false,
|
|
43
|
+
description: "Public URL of the Cal.com instance",
|
|
44
|
+
required: true
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
healthcheck: {
|
|
48
|
+
test: "wget -q --spider http://localhost:3000 || exit 1",
|
|
49
|
+
interval: "30s",
|
|
50
|
+
timeout: "10s",
|
|
51
|
+
retries: 3,
|
|
52
|
+
startPeriod: "60s"
|
|
53
|
+
},
|
|
54
|
+
dependsOn: [],
|
|
55
|
+
restartPolicy: "unless-stopped",
|
|
56
|
+
networks: ["openclaw-network"],
|
|
57
|
+
skills: [],
|
|
58
|
+
openclawEnvVars: [{
|
|
59
|
+
key: "CALCOM_HOST",
|
|
60
|
+
defaultValue: "cal-com",
|
|
61
|
+
secret: false,
|
|
62
|
+
description: "Cal.com hostname for OpenClaw",
|
|
63
|
+
required: true
|
|
64
|
+
}, {
|
|
65
|
+
key: "CALCOM_PORT",
|
|
66
|
+
defaultValue: "3000",
|
|
67
|
+
secret: false,
|
|
68
|
+
description: "Cal.com port for OpenClaw",
|
|
69
|
+
required: true
|
|
70
|
+
}],
|
|
71
|
+
docsUrl: "https://cal.com/docs",
|
|
72
|
+
tags: [
|
|
73
|
+
"calendar",
|
|
74
|
+
"scheduling",
|
|
75
|
+
"booking",
|
|
76
|
+
"appointments"
|
|
77
|
+
],
|
|
78
|
+
maturity: "beta",
|
|
79
|
+
requires: ["postgresql"],
|
|
80
|
+
recommends: ["redis"],
|
|
81
|
+
conflictsWith: [],
|
|
82
|
+
minMemoryMB: 512,
|
|
83
|
+
gpuRequired: false
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
export { calComDefinition };
|
|
88
|
+
//# sourceMappingURL=cal-com.mjs.map
|