@dxos/config 0.9.0 → 0.9.1-staging.ee54ba693a

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.
@@ -115,6 +115,29 @@ var profileBuiltinDefaults = (profile) => {
115
115
  });
116
116
  };
117
117
 
118
+ // src/edge-services.ts
119
+ var EdgeServiceName = Object.freeze({
120
+ Calls: "calls",
121
+ Image: "image",
122
+ Transcription: "transcription",
123
+ Discord: "discord",
124
+ CorsProxy: "cors-proxy",
125
+ ApiProxy: "api-proxy",
126
+ Introspect: "introspect",
127
+ ChatAgent: "chat-agent"
128
+ });
129
+ var EDGE_SERVICE_DEFAULTS = Object.freeze({
130
+ [EdgeServiceName.Calls]: "https://calls-service.dxos.workers.dev",
131
+ [EdgeServiceName.Image]: "https://image-service-main.dxos.workers.dev",
132
+ [EdgeServiceName.Transcription]: "https://calls-service.dxos.workers.dev",
133
+ [EdgeServiceName.Discord]: "https://discord-service.dxos.workers.dev",
134
+ [EdgeServiceName.CorsProxy]: "https://cors-proxy.dxos.workers.dev",
135
+ [EdgeServiceName.ApiProxy]: "https://api-proxy.dxos.workers.dev",
136
+ [EdgeServiceName.Introspect]: "https://introspect-service-labs.dxos.workers.dev/mcp",
137
+ [EdgeServiceName.ChatAgent]: "wss://chat-agent-labs.dxos.workers.dev"
138
+ });
139
+ var getEdgeServiceEndpoint = (config, name) => config.values.runtime?.services?.edgeServices?.findLast((service) => service.name === name)?.endpoint ?? EDGE_SERVICE_DEFAULTS[name];
140
+
118
141
  // src/index.ts
119
142
  export * from "#loaders";
120
143
  export * from "#savers";
@@ -128,7 +151,9 @@ var resolveTelemetryTag = (config) => {
128
151
 
129
152
  // src/preset.ts
130
153
  import * as Match from "effect/Match";
131
- var configPreset = ({ edge = "main" } = {}) => new Config({
154
+ var edgeUrl = (edge) => Match.value(edge).pipe(Match.when("local", () => "http://localhost:8787"), Match.when("dev", () => "https://edge.dxos.workers.dev"), Match.when("main", () => "https://edge-main.dxos.workers.dev"), Match.when("production", () => "https://edge-production.dxos.workers.dev"), Match.exhaustive);
155
+ var sandboxUrl = (sandbox) => Match.value(sandbox).pipe(Match.when("local", () => "http://localhost:8792"), Match.when("dev", () => "https://sandbox-service.dxos.workers.dev"), Match.when("main", () => "https://sandbox-service.dxos.workers.dev"), Match.when("production", () => "https://sandbox-service.dxos.workers.dev"), Match.exhaustive);
156
+ var configPreset = ({ edge = "main", sandbox } = {}) => new Config({
132
157
  version: 1,
133
158
  runtime: {
134
159
  client: {
@@ -140,8 +165,13 @@ var configPreset = ({ edge = "main" } = {}) => new Config({
140
165
  },
141
166
  services: {
142
167
  edge: {
143
- url: Match.value(edge).pipe(Match.when("local", () => "http://localhost:8787"), Match.when("dev", () => "https://edge.dxos.workers.dev"), Match.when("main", () => "https://edge-main.dxos.workers.dev"), Match.when("production", () => "https://edge-production.dxos.workers.dev"), Match.exhaustive)
144
- }
168
+ url: edgeUrl(edge)
169
+ },
170
+ ...sandbox ? {
171
+ sandbox: {
172
+ url: sandboxUrl(sandbox)
173
+ }
174
+ } : {}
145
175
  }
146
176
  }
147
177
  });
@@ -149,12 +179,15 @@ export {
149
179
  Config,
150
180
  ConfigResource,
151
181
  ConfigService,
182
+ EDGE_SERVICE_DEFAULTS,
183
+ EdgeServiceName,
152
184
  FILE_DEFAULTS,
153
185
  FILE_DYNAMICS,
154
186
  FILE_ENVS,
155
187
  configPreset,
156
188
  defaultConfig,
157
189
  defs,
190
+ getEdgeServiceEndpoint,
158
191
  mapFromKeyValues,
159
192
  mapToKeyValues,
160
193
  memoryConfig,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/index.ts", "../../../src/config-service.ts", "../../../src/telemetry.ts", "../../../src/preset.ts"],
4
- "sourcesContent": ["//\n// Copyright 2021 DXOS.org\n//\n\n// TODO(burdon): Why is this exported? (Rename).\nexport * as defs from '@dxos/protocols/proto/dxos/config';\n\nexport { type Config as ConfigProto } from '@dxos/protocols/proto/dxos/config';\n\nexport * from './config';\nexport * from './config-service';\nexport * from '#loaders';\nexport * from '#savers';\nexport * from '#plugin';\nexport * from './telemetry';\nexport * from './types';\nexport * from './preset';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as FileSystem from '@effect/platform/FileSystem';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\nimport { dirname } from 'node:path';\nimport * as Yaml from 'yaml';\n\nimport { DX_CONFIG, DX_DATA, getProfileConfigPath, getProfilePath } from '@dxos/client-protocol';\nimport { invariant } from '@dxos/invariant';\n\nimport { Config } from './config';\n\nexport const memoryConfig = new Config({\n runtime: {\n client: {\n edgeFeatures: {\n echoReplicator: true,\n feedReplicator: true,\n signaling: true,\n agents: true,\n },\n },\n },\n});\n\nexport const defaultConfig = new Config({\n runtime: {\n client: {\n edgeFeatures: {\n echoReplicator: true,\n feedReplicator: true,\n signaling: true,\n agents: true,\n },\n storage: {\n persistent: true,\n },\n },\n services: {\n edge: {\n url: 'wss://edge-production.dxos.workers.dev/',\n },\n iceProviders: [\n {\n urls: 'https://edge-production.dxos.workers.dev/ice',\n },\n ],\n ai: {\n server: 'https://ai-service.dxos.workers.dev',\n },\n ipfs: {\n server: 'https://api.ipfs.dxos.network/api/v0',\n gateway: 'https://gateway.ipfs.dxos.network/ipfs',\n },\n },\n },\n});\n\nexport class ConfigService extends Context.Tag('ConfigService')<ConfigService, Config>() {\n static layerMemory = Layer.effect(ConfigService, Effect.succeed(memoryConfig));\n\n static fromConfig = (config: Config) => Layer.succeed(ConfigService, config);\n\n static load = (args: { config: Option.Option<string>; profile: string }) => {\n const defaultConfigPath = getProfileConfigPath(DX_CONFIG, args.profile);\n return Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const configPath = Option.getOrElse(args.config, () => defaultConfigPath);\n const configContent = yield* fs.readFileString(configPath);\n const configValues = Yaml.parse(configContent);\n return ConfigService.of(new Config(configValues, profileBuiltinDefaults(args.profile).values));\n }).pipe(\n // If the config file doesn't exist, create it.\n Effect.catchTag('SystemError', () =>\n Effect.gen(function* () {\n const configValues = defaultConfig.values;\n const fs = yield* FileSystem.FileSystem;\n const pathToCreate = Option.getOrElse(args.config, () => defaultConfigPath);\n yield* fs.makeDirectory(dirname(pathToCreate), { recursive: true });\n yield* fs.writeFileString(pathToCreate, Yaml.stringify(configValues));\n return ConfigService.of(new Config(configValues));\n }),\n ),\n );\n };\n}\n\n/**\n * Default config for a profile.\n * Always merged with the default config.\n */\nconst profileBuiltinDefaults = (profile: string) => {\n invariant(!profile.endsWith('.yml'));\n\n return new Config({\n runtime: {\n client: {\n edgeFeatures: {\n echoReplicator: true,\n feedReplicator: true,\n signaling: true,\n agents: true,\n },\n storage: {\n persistent: true,\n dataRoot: getProfilePath(DX_DATA, profile),\n },\n },\n },\n });\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { isNode } from '@dxos/util';\n\nimport { type Config } from './config';\n\n/**\n * Resolves the telemetry tag used as the `X-DXOS-Client-Tag` header on edge\n * requests AND as the `ctx.tag` attribute / resource on observability traces.\n *\n * Keeping a single resolver ensures the same tag identifies a session across\n * edge and telemetry tiers. Precedence:\n *\n * 1. `config.runtime.app.env.DX_TELEMETRY_TAG` — the explicit, deterministic\n * path. Populated from `.env`/build-time by the app's config loaders.\n * 2. `process.env.DX_TELEMETRY_TAG` — Node-only, for dev/CI convenience.\n *\n * Returns `undefined` when unset; callers should no-op on undefined rather\n * than stamping empty strings.\n */\nexport const resolveTelemetryTag = (config?: Config): string | undefined => {\n return config?.get('runtime.app.env.DX_TELEMETRY_TAG') ?? (isNode() ? process.env.DX_TELEMETRY_TAG : undefined);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Match from 'effect/Match';\n\nimport { Config } from './config';\n\nexport type ConfigPresetOptions = {\n /**\n * Edge service.\n * @default main\n */\n edge?: 'local' | 'dev' | 'main' | 'production';\n};\n\nexport const configPreset = ({ edge = 'main' }: ConfigPresetOptions = {}) =>\n new Config({\n version: 1,\n runtime: {\n client: {\n edgeFeatures: {\n signaling: true,\n echoReplicator: true,\n feedReplicator: true,\n },\n },\n services: {\n edge: {\n url: Match.value(edge).pipe(\n Match.when('local', () => 'http://localhost:8787'),\n Match.when('dev', () => 'https://edge.dxos.workers.dev'),\n Match.when('main', () => 'https://edge-main.dxos.workers.dev'),\n Match.when('production', () => 'https://edge-production.dxos.workers.dev'),\n Match.exhaustive,\n ),\n },\n },\n },\n });\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAKA,YAAYA,UAAU;;;ACDtB,YAAYC,gBAAgB;AAC5B,YAAYC,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,YAAY;AACxB,SAASC,eAAe;AACxB,YAAYC,UAAU;AAEtB,SAASC,WAAWC,SAASC,sBAAsBC,sBAAsB;AACzE,SAASC,iBAAiB;AAI1B,IAAA,eAAaC;IAETC,eAAQ,IAAA,OAAA;WACNC;YACEC;oBACAC;QACAC,gBAAW;QACXC,gBAAQ;QACV,WAAA;QACF,QAAA;MACF;IACC;EAEH;;IAEIL,gBAAQ,IAAA,OAAA;WACNC;YACEC;oBACAC;QACAC,gBAAW;QACXC,gBAAQ;QACV,WAAA;QACAC,QAAS;;MAET,SAAA;QACF,YAAA;MACAC;;cAEIC;MACF,MAAA;QACAC,KAAAA;;oBAEU;QACR;UACD,MAAA;QACG;;MAEJ,IAAA;QACAC,QAAM;;YAEJC;QACF,QAAA;QACF,SAAA;MACF;IACC;EAEH;;AAGE,IAAOC,gBAAP,MAAOA,uBAAuCC,YAAO,eAACC,EAAeC,EAAAA;EAErE,OAAOC,cAAQC,aAAAA,gBAAAA,eAAAA,YAAAA,CAAAA;SACb,aAAMC,CAAAA,WAAoBC,cAAAA,gBAAqBC,MAAWH;SAC1D,OAAOI,CAAAA,SAAW;UAChB,oBAAkBC,qBAAqB,WAAA,KAAA,OAAA;WACjCC,WA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IACPC,QAAQ;MACNC,cAAc;QACZC,WAAW;QACXC,gBAAgB;QAChBC,gBAAgB;MAClB;IACF;IACAC,UAAU;MACRT,MAAM;QACJU,KAAWC,YAAMX,IAAAA,EAAMY,KACfC,WAAK,SAAS,MAAM,uBAAA,GACpBA,WAAK,OAAO,MAAM,+BAAA,GAClBA,WAAK,QAAQ,MAAM,oCAAA,GACnBA,WAAK,cAAc,MAAM,0CAAA,GACzBC,gBAAU;MAEpB;IACF;EACF;AACF,CAAA;",
6
- "names": ["defs", "FileSystem", "Context", "Effect", "Layer", "Option", "dirname", "Yaml", "DX_CONFIG", "DX_DATA", "getProfileConfigPath", "getProfilePath", "invariant", "memoryConfig", "client", "edgeFeatures", "echoReplicator", "feedReplicator", "signaling", "agents", "storage", "services", "url", "iceProviders", "ipfs", "gateway", "fromConfig", "succeed", "ConfigService", "config", "load", "args", "defaultConfigPath", "getProfileConfigPath", "DX_CONFIG", "Effect", "FileSystem", "configPath", "getOrElse", "configContent", "fs", "configValues", "parse", "of", "Config", "profileBuiltinDefaults", "pipe", "catchTag", "pathToCreate", "Option", "makeDirectory", "dirname", "recursive", "writeFileString", "runtime", "dataRoot", "isNode", "resolveTelemetryTag", "config", "get", "process", "env", "DX_TELEMETRY_TAG", "undefined", "Match", "configPreset", "edge", "Config", "version", "runtime", "client", "edgeFeatures", "signaling", "echoReplicator", "feedReplicator", "services", "url", "value", "pipe", "when", "exhaustive"]
3
+ "sources": ["../../../src/index.ts", "../../../src/config-service.ts", "../../../src/edge-services.ts", "../../../src/telemetry.ts", "../../../src/preset.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2021 DXOS.org\n//\n\n// TODO(burdon): Why is this exported? (Rename).\nexport * as defs from '@dxos/protocols/proto/dxos/config';\n\nexport { type Config as ConfigProto } from '@dxos/protocols/proto/dxos/config';\n\nexport * from './config';\nexport * from './config-service';\nexport * from './edge-services';\nexport * from '#loaders';\nexport * from '#savers';\nexport * from '#plugin';\nexport * from './telemetry';\nexport * from './types';\nexport * from './preset';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as FileSystem from '@effect/platform/FileSystem';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\nimport { dirname } from 'node:path';\nimport * as Yaml from 'yaml';\n\nimport { DX_CONFIG, DX_DATA, getProfileConfigPath, getProfilePath } from '@dxos/client-protocol';\nimport { invariant } from '@dxos/invariant';\n\nimport { Config } from './config';\n\nexport const memoryConfig = new Config({\n runtime: {\n client: {\n edgeFeatures: {\n echoReplicator: true,\n feedReplicator: true,\n signaling: true,\n agents: true,\n },\n },\n },\n});\n\nexport const defaultConfig = new Config({\n runtime: {\n client: {\n edgeFeatures: {\n echoReplicator: true,\n feedReplicator: true,\n signaling: true,\n agents: true,\n },\n storage: {\n persistent: true,\n },\n },\n services: {\n edge: {\n url: 'wss://edge-production.dxos.workers.dev/',\n },\n iceProviders: [\n {\n urls: 'https://edge-production.dxos.workers.dev/ice',\n },\n ],\n ai: {\n server: 'https://ai-service.dxos.workers.dev',\n },\n ipfs: {\n server: 'https://api.ipfs.dxos.network/api/v0',\n gateway: 'https://gateway.ipfs.dxos.network/ipfs',\n },\n },\n },\n});\n\nexport class ConfigService extends Context.Tag('ConfigService')<ConfigService, Config>() {\n static layerMemory = Layer.effect(ConfigService, Effect.succeed(memoryConfig));\n\n static fromConfig = (config: Config) => Layer.succeed(ConfigService, config);\n\n static load = (args: { config: Option.Option<string>; profile: string }) => {\n const defaultConfigPath = getProfileConfigPath(DX_CONFIG, args.profile);\n return Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const configPath = Option.getOrElse(args.config, () => defaultConfigPath);\n const configContent = yield* fs.readFileString(configPath);\n const configValues = Yaml.parse(configContent);\n return ConfigService.of(new Config(configValues, profileBuiltinDefaults(args.profile).values));\n }).pipe(\n // If the config file doesn't exist, create it.\n Effect.catchTag('SystemError', () =>\n Effect.gen(function* () {\n const configValues = defaultConfig.values;\n const fs = yield* FileSystem.FileSystem;\n const pathToCreate = Option.getOrElse(args.config, () => defaultConfigPath);\n yield* fs.makeDirectory(dirname(pathToCreate), { recursive: true });\n yield* fs.writeFileString(pathToCreate, Yaml.stringify(configValues));\n return ConfigService.of(new Config(configValues));\n }),\n ),\n );\n };\n}\n\n/**\n * Default config for a profile.\n * Always merged with the default config.\n */\nconst profileBuiltinDefaults = (profile: string) => {\n invariant(!profile.endsWith('.yml'));\n\n return new Config({\n runtime: {\n client: {\n edgeFeatures: {\n echoReplicator: true,\n feedReplicator: true,\n signaling: true,\n agents: true,\n },\n storage: {\n persistent: true,\n dataRoot: getProfilePath(DX_DATA, profile),\n },\n },\n },\n });\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Config } from './config';\n\n/**\n * Canonical names for EDGE (Cloudflare Worker) services.\n * Used as keys into `runtime.services.edgeServices` and {@link EDGE_SERVICE_DEFAULTS}.\n */\nexport const EdgeServiceName = Object.freeze({\n Calls: 'calls',\n Image: 'image',\n Transcription: 'transcription',\n Discord: 'discord',\n CorsProxy: 'cors-proxy',\n ApiProxy: 'api-proxy',\n Introspect: 'introspect',\n ChatAgent: 'chat-agent',\n} as const);\n\nexport type EdgeServiceName = (typeof EdgeServiceName)[keyof typeof EdgeServiceName];\n\n/**\n * Canonical dev/test default endpoints for EDGE services.\n * Single source of truth for the URLs previously hard-coded across plugins.\n * Production values are supplied per-app via `dx.yml` (`runtime.services.edgeServices`).\n */\nexport const EDGE_SERVICE_DEFAULTS: Readonly<Record<EdgeServiceName, string>> = Object.freeze({\n [EdgeServiceName.Calls]: 'https://calls-service.dxos.workers.dev',\n [EdgeServiceName.Image]: 'https://image-service-main.dxos.workers.dev',\n [EdgeServiceName.Transcription]: 'https://calls-service.dxos.workers.dev',\n [EdgeServiceName.Discord]: 'https://discord-service.dxos.workers.dev',\n [EdgeServiceName.CorsProxy]: 'https://cors-proxy.dxos.workers.dev',\n [EdgeServiceName.ApiProxy]: 'https://api-proxy.dxos.workers.dev',\n [EdgeServiceName.Introspect]: 'https://introspect-service-labs.dxos.workers.dev/mcp',\n [EdgeServiceName.ChatAgent]: 'wss://chat-agent-labs.dxos.workers.dev',\n});\n\n/**\n * Resolve the endpoint for an EDGE service.\n * Prefers the matching `runtime.services.edgeServices` entry, falling back to the canonical\n * {@link EDGE_SERVICE_DEFAULTS} entry.\n * `name` is expected to be unique; on duplicates the last entry wins so a later override is\n * not silently shadowed by an earlier one (proto cannot enforce uniqueness on a repeated field).\n */\nexport const getEdgeServiceEndpoint = (config: Config, name: EdgeServiceName): string =>\n config.values.runtime?.services?.edgeServices?.findLast((service) => service.name === name)?.endpoint ??\n EDGE_SERVICE_DEFAULTS[name];\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { isNode } from '@dxos/util';\n\nimport { type Config } from './config';\n\n/**\n * Resolves the telemetry tag used as the `X-DXOS-Client-Tag` header on edge\n * requests AND as the `ctx.tag` attribute / resource on observability traces.\n *\n * Keeping a single resolver ensures the same tag identifies a session across\n * edge and telemetry tiers. Precedence:\n *\n * 1. `config.runtime.app.env.DX_TELEMETRY_TAG` — the explicit, deterministic\n * path. Populated from `.env`/build-time by the app's config loaders.\n * 2. `process.env.DX_TELEMETRY_TAG` — Node-only, for dev/CI convenience.\n *\n * Returns `undefined` when unset; callers should no-op on undefined rather\n * than stamping empty strings.\n */\nexport const resolveTelemetryTag = (config?: Config): string | undefined => {\n return config?.get('runtime.app.env.DX_TELEMETRY_TAG') ?? (isNode() ? process.env.DX_TELEMETRY_TAG : undefined);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Match from 'effect/Match';\n\nimport { Config } from './config';\n\nexport type ConfigPresetOptions = {\n /**\n * Edge service.\n * @default main\n */\n edge?: 'local' | 'dev' | 'main' | 'production';\n\n /**\n * Sandbox service (standalone worker; API at /api/sandbox).\n */\n sandbox?: 'local' | 'dev' | 'main' | 'production';\n};\n\nconst edgeUrl = (edge: NonNullable<ConfigPresetOptions['edge']>) =>\n Match.value(edge).pipe(\n Match.when('local', () => 'http://localhost:8787'),\n Match.when('dev', () => 'https://edge.dxos.workers.dev'),\n Match.when('main', () => 'https://edge-main.dxos.workers.dev'),\n Match.when('production', () => 'https://edge-production.dxos.workers.dev'),\n Match.exhaustive,\n );\n\n// TODO(burdon): Hosted environments share a single worker until per-env deployments exist.\nconst sandboxUrl = (sandbox: NonNullable<ConfigPresetOptions['sandbox']>) =>\n Match.value(sandbox).pipe(\n Match.when('local', () => 'http://localhost:8792'),\n Match.when('dev', () => 'https://sandbox-service.dxos.workers.dev'),\n Match.when('main', () => 'https://sandbox-service.dxos.workers.dev'),\n Match.when('production', () => 'https://sandbox-service.dxos.workers.dev'),\n Match.exhaustive,\n );\n\nexport const configPreset = ({ edge = 'main', sandbox }: ConfigPresetOptions = {}) =>\n new Config({\n version: 1,\n runtime: {\n client: {\n edgeFeatures: {\n signaling: true,\n echoReplicator: true,\n feedReplicator: true,\n },\n },\n services: {\n edge: {\n url: edgeUrl(edge),\n },\n ...(sandbox ? { sandbox: { url: sandboxUrl(sandbox) } } : {}),\n },\n },\n });\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAKA,YAAYA,UAAU;;;ACDtB,YAAYC,gBAAgB;AAC5B,YAAYC,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,YAAY;AACxB,SAASC,eAAe;AACxB,YAAYC,UAAU;AAEtB,SAASC,WAAWC,SAASC,sBAAsBC,sBAAsB;AACzE,SAASC,iBAAiB;AAI1B,IAAA,eAAaC;IAETC,eAAQ,IAAA,OAAA;WACNC;YACEC;oBACAC;QACAC,gBAAW;QACXC,gBAAQ;QACV,WAAA;QACF,QAAA;MACF;IACC;EAEH;;IAEIL,gBAAQ,IAAA,OAAA;WACNC;YACEC;oBACAC;QACAC,gBAAW;QACXC,gBAAQ;QACV,WAAA;QACAC,QAAS;;MAET,SAAA;QACF,YAAA;MACAC;;cAEIC;MACF,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AQ,MAAM,0CAAA,GACnBA,WAAK,cAAc,MAAM,0CAAA,GACzBC,gBAAU;AAGb,IAAMG,eAAe,CAAC,EAAEP,OAAO,QAAQM,QAAO,IAA0B,CAAC,MAC9E,IAAIE,OAAO;EACTC,SAAS;EACTC,SAAS;IACPC,QAAQ;MACNC,cAAc;QACZC,WAAW;QACXC,gBAAgB;QAChBC,gBAAgB;MAClB;IACF;IACAC,UAAU;MACRhB,MAAM;QACJiB,KAAKlB,QAAQC,IAAAA;MACf;MACA,GAAIM,UAAU;QAAEA,SAAS;UAAEW,KAAKZ,WAAWC,OAAAA;QAAS;MAAE,IAAI,CAAC;IAC7D;EACF;AACF,CAAA;",
6
+ "names": ["defs", "FileSystem", "Context", "Effect", "Layer", "Option", "dirname", "Yaml", "DX_CONFIG", "DX_DATA", "getProfileConfigPath", "getProfilePath", "invariant", "memoryConfig", "client", "edgeFeatures", "echoReplicator", "feedReplicator", "signaling", "agents", "storage", "services", "url", "iceProviders", "ipfs", "gateway", "fromConfig", "succeed", "ConfigService", "config", "load", "args", "defaultConfigPath", "getProfileConfigPath", "DX_CONFIG", "Effect", "FileSystem", "configPath", "getOrElse", "configContent", "fs", "configValues", "parse", "of", "Config", "profileBuiltinDefaults", "pipe", "catchTag", "pathToCreate", "Option", "makeDirectory", "dirname", "recursive", "writeFileString", "runtime", "dataRoot", "EdgeServiceName", "Object", "freeze", "Calls", "Image", "Transcription", "Discord", "CorsProxy", "ApiProxy", "Introspect", "ChatAgent", "EDGE_SERVICE_DEFAULTS", "getEdgeServiceEndpoint", "config", "name", "values", "runtime", "services", "edgeServices", "findLast", "service", "endpoint", "isNode", "resolveTelemetryTag", "config", "get", "process", "env", "DX_TELEMETRY_TAG", "undefined", "Match", "edgeUrl", "edge", "value", "pipe", "when", "exhaustive", "sandboxUrl", "sandbox", "configPreset", "Config", "version", "runtime", "client", "edgeFeatures", "signaling", "echoReplicator", "feedReplicator", "services", "url"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/config.ts":{"bytes":15941,"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.ismatch","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/config-service.ts":{"bytes":12251,"imports":[{"path":"@effect/platform/FileSystem","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/client-protocol","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"}],"format":"esm"},"src/telemetry.ts":{"bytes":2724,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types.ts":{"bytes":2665,"imports":[],"format":"esm"},"src/preset.ts":{"bytes":3253,"imports":[{"path":"effect/Match","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"}],"format":"esm"},"src/index.ts":{"bytes":1416,"imports":[{"path":"@dxos/protocols/proto/dxos/config","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"},{"path":"src/config-service.ts","kind":"import-statement","original":"./config-service"},{"path":"#loaders","kind":"import-statement","external":true},{"path":"#savers","kind":"import-statement","external":true},{"path":"#plugin","kind":"import-statement","external":true},{"path":"src/telemetry.ts","kind":"import-statement","original":"./telemetry"},{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"src/preset.ts","kind":"import-statement","original":"./preset"}],"format":"esm"},"src/loaders/index.ts":{"bytes":8152,"imports":[{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"../config"},{"path":"src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/loaders/browser.ts":{"bytes":8287,"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/savers/index.ts":{"bytes":589,"imports":[],"format":"esm"},"src/savers/browser.ts":{"bytes":2564,"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/plugin/definitions.ts":{"bytes":11702,"imports":[{"path":"@dxos/node-std/child_process","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"pkg-up","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"../config"}],"format":"esm"},"src/plugin/index.ts":{"bytes":427,"imports":[{"path":"src/plugin/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/plugin/browser.ts":{"bytes":924,"imports":[],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9238},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-VQRJY4AQ.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-ZY4D4E3Q.mjs","kind":"import-statement"},{"path":"@dxos/protocols/proto/dxos/config","kind":"import-statement","external":true},{"path":"@effect/platform/FileSystem","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/client-protocol","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"#loaders","kind":"import-statement","external":true},{"path":"#savers","kind":"import-statement","external":true},{"path":"#plugin","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true}],"exports":["Config","ConfigResource","ConfigService","FILE_DEFAULTS","FILE_DYNAMICS","FILE_ENVS","configPreset","defaultConfig","defs","mapFromKeyValues","mapToKeyValues","memoryConfig","resolveTelemetryTag","validateConfig"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":135},"src/config-service.ts":{"bytesInOutput":3257},"src/telemetry.ts":{"bytesInOutput":192},"src/preset.ts":{"bytesInOutput":617}},"bytes":4783},"dist/lib/browser/loaders/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3507},"dist/lib/browser/loaders/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-VQRJY4AQ.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-ZY4D4E3Q.mjs","kind":"import-statement"},{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Defaults","Dynamics","Envs","Local","Profile","Remote","Storage"],"entryPoint":"src/loaders/index.ts","inputs":{"src/loaders/index.ts":{"bytesInOutput":1541}},"bytes":1815},"dist/lib/browser/chunk-VQRJY4AQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1813},"dist/lib/browser/chunk-VQRJY4AQ.mjs":{"imports":[],"exports":["FILE_DEFAULTS","FILE_DYNAMICS","FILE_ENVS"],"inputs":{"src/types.ts":{"bytesInOutput":102}},"bytes":221},"dist/lib/browser/loaders/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4097},"dist/lib/browser/loaders/browser.mjs":{"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Defaults","Dynamics","Envs","Local","Profile","Remote","Storage"],"entryPoint":"src/loaders/browser.ts","inputs":{"src/loaders/browser.ts":{"bytesInOutput":2028}},"bytes":2175},"dist/lib/browser/savers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":358},"dist/lib/browser/savers/index.mjs":{"imports":[],"exports":["SaveConfig"],"entryPoint":"src/savers/index.ts","inputs":{"src/savers/index.ts":{"bytesInOutput":35}},"bytes":118},"dist/lib/browser/savers/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1302},"dist/lib/browser/savers/browser.mjs":{"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["SaveConfig"],"entryPoint":"src/savers/browser.ts","inputs":{"src/savers/browser.ts":{"bytesInOutput":694}},"bytes":781},"dist/lib/browser/plugin/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5396},"dist/lib/browser/plugin/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-ZY4D4E3Q.mjs","kind":"import-statement"},{"path":"@dxos/node-std/child_process","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"pkg-up","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["definitions"],"entryPoint":"src/plugin/index.ts","inputs":{"src/plugin/definitions.ts":{"bytesInOutput":3096},"src/plugin/index.ts":{"bytesInOutput":0}},"bytes":3247},"dist/lib/browser/chunk-ZY4D4E3Q.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7811},"dist/lib/browser/chunk-ZY4D4E3Q.mjs":{"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.ismatch","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["Config","ConfigResource","mapFromKeyValues","mapToKeyValues","validateConfig"],"inputs":{"src/config.ts":{"bytesInOutput":4083}},"bytes":4240},"dist/lib/browser/plugin/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":494},"dist/lib/browser/plugin/browser.mjs":{"imports":[],"exports":["definitions"],"entryPoint":"src/plugin/browser.ts","inputs":{"src/plugin/browser.ts":{"bytesInOutput":110}},"bytes":198}}}
1
+ {"inputs":{"src/config.ts":{"bytes":15941,"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.ismatch","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/config-service.ts":{"bytes":12251,"imports":[{"path":"@effect/platform/FileSystem","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/client-protocol","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"}],"format":"esm"},"src/edge-services.ts":{"bytes":6244,"imports":[],"format":"esm"},"src/telemetry.ts":{"bytes":2724,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types.ts":{"bytes":2665,"imports":[],"format":"esm"},"src/preset.ts":{"bytes":5424,"imports":[{"path":"effect/Match","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"}],"format":"esm"},"src/index.ts":{"bytes":1517,"imports":[{"path":"@dxos/protocols/proto/dxos/config","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"},{"path":"src/config-service.ts","kind":"import-statement","original":"./config-service"},{"path":"src/edge-services.ts","kind":"import-statement","original":"./edge-services"},{"path":"#loaders","kind":"import-statement","external":true},{"path":"#savers","kind":"import-statement","external":true},{"path":"#plugin","kind":"import-statement","external":true},{"path":"src/telemetry.ts","kind":"import-statement","original":"./telemetry"},{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"src/preset.ts","kind":"import-statement","original":"./preset"}],"format":"esm"},"src/loaders/index.ts":{"bytes":8152,"imports":[{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"../config"},{"path":"src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/loaders/browser.ts":{"bytes":8287,"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/savers/index.ts":{"bytes":589,"imports":[],"format":"esm"},"src/savers/browser.ts":{"bytes":2564,"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/plugin/definitions.ts":{"bytes":11702,"imports":[{"path":"@dxos/node-std/child_process","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"pkg-up","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"../config"}],"format":"esm"},"src/plugin/index.ts":{"bytes":427,"imports":[{"path":"src/plugin/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/plugin/browser.ts":{"bytes":924,"imports":[],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13402},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-VQRJY4AQ.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-ZY4D4E3Q.mjs","kind":"import-statement"},{"path":"@dxos/protocols/proto/dxos/config","kind":"import-statement","external":true},{"path":"@effect/platform/FileSystem","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/client-protocol","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"#loaders","kind":"import-statement","external":true},{"path":"#savers","kind":"import-statement","external":true},{"path":"#plugin","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true}],"exports":["Config","ConfigResource","ConfigService","EDGE_SERVICE_DEFAULTS","EdgeServiceName","FILE_DEFAULTS","FILE_DYNAMICS","FILE_ENVS","configPreset","defaultConfig","defs","getEdgeServiceEndpoint","mapFromKeyValues","mapToKeyValues","memoryConfig","resolveTelemetryTag","validateConfig"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":135},"src/config-service.ts":{"bytesInOutput":3257},"src/edge-services.ts":{"bytesInOutput":1060},"src/telemetry.ts":{"bytesInOutput":192},"src/preset.ts":{"bytesInOutput":1106}},"bytes":6427},"dist/lib/browser/loaders/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3507},"dist/lib/browser/loaders/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-VQRJY4AQ.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-ZY4D4E3Q.mjs","kind":"import-statement"},{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Defaults","Dynamics","Envs","Local","Profile","Remote","Storage"],"entryPoint":"src/loaders/index.ts","inputs":{"src/loaders/index.ts":{"bytesInOutput":1541}},"bytes":1815},"dist/lib/browser/chunk-VQRJY4AQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1813},"dist/lib/browser/chunk-VQRJY4AQ.mjs":{"imports":[],"exports":["FILE_DEFAULTS","FILE_DYNAMICS","FILE_ENVS"],"inputs":{"src/types.ts":{"bytesInOutput":102}},"bytes":221},"dist/lib/browser/loaders/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4097},"dist/lib/browser/loaders/browser.mjs":{"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Defaults","Dynamics","Envs","Local","Profile","Remote","Storage"],"entryPoint":"src/loaders/browser.ts","inputs":{"src/loaders/browser.ts":{"bytesInOutput":2028}},"bytes":2175},"dist/lib/browser/savers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":358},"dist/lib/browser/savers/index.mjs":{"imports":[],"exports":["SaveConfig"],"entryPoint":"src/savers/index.ts","inputs":{"src/savers/index.ts":{"bytesInOutput":35}},"bytes":118},"dist/lib/browser/savers/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1302},"dist/lib/browser/savers/browser.mjs":{"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["SaveConfig"],"entryPoint":"src/savers/browser.ts","inputs":{"src/savers/browser.ts":{"bytesInOutput":694}},"bytes":781},"dist/lib/browser/plugin/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5396},"dist/lib/browser/plugin/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-ZY4D4E3Q.mjs","kind":"import-statement"},{"path":"@dxos/node-std/child_process","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"pkg-up","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["definitions"],"entryPoint":"src/plugin/index.ts","inputs":{"src/plugin/definitions.ts":{"bytesInOutput":3096},"src/plugin/index.ts":{"bytesInOutput":0}},"bytes":3247},"dist/lib/browser/chunk-ZY4D4E3Q.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7811},"dist/lib/browser/chunk-ZY4D4E3Q.mjs":{"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.ismatch","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["Config","ConfigResource","mapFromKeyValues","mapToKeyValues","validateConfig"],"inputs":{"src/config.ts":{"bytesInOutput":4083}},"bytes":4240},"dist/lib/browser/plugin/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":494},"dist/lib/browser/plugin/browser.mjs":{"imports":[],"exports":["definitions"],"entryPoint":"src/plugin/browser.ts","inputs":{"src/plugin/browser.ts":{"bytesInOutput":110}},"bytes":198}}}
@@ -116,6 +116,29 @@ var profileBuiltinDefaults = (profile) => {
116
116
  });
117
117
  };
118
118
 
119
+ // src/edge-services.ts
120
+ var EdgeServiceName = Object.freeze({
121
+ Calls: "calls",
122
+ Image: "image",
123
+ Transcription: "transcription",
124
+ Discord: "discord",
125
+ CorsProxy: "cors-proxy",
126
+ ApiProxy: "api-proxy",
127
+ Introspect: "introspect",
128
+ ChatAgent: "chat-agent"
129
+ });
130
+ var EDGE_SERVICE_DEFAULTS = Object.freeze({
131
+ [EdgeServiceName.Calls]: "https://calls-service.dxos.workers.dev",
132
+ [EdgeServiceName.Image]: "https://image-service-main.dxos.workers.dev",
133
+ [EdgeServiceName.Transcription]: "https://calls-service.dxos.workers.dev",
134
+ [EdgeServiceName.Discord]: "https://discord-service.dxos.workers.dev",
135
+ [EdgeServiceName.CorsProxy]: "https://cors-proxy.dxos.workers.dev",
136
+ [EdgeServiceName.ApiProxy]: "https://api-proxy.dxos.workers.dev",
137
+ [EdgeServiceName.Introspect]: "https://introspect-service-labs.dxos.workers.dev/mcp",
138
+ [EdgeServiceName.ChatAgent]: "wss://chat-agent-labs.dxos.workers.dev"
139
+ });
140
+ var getEdgeServiceEndpoint = (config, name) => config.values.runtime?.services?.edgeServices?.findLast((service) => service.name === name)?.endpoint ?? EDGE_SERVICE_DEFAULTS[name];
141
+
119
142
  // src/index.ts
120
143
  export * from "#loaders";
121
144
  export * from "#savers";
@@ -129,7 +152,9 @@ var resolveTelemetryTag = (config) => {
129
152
 
130
153
  // src/preset.ts
131
154
  import * as Match from "effect/Match";
132
- var configPreset = ({ edge = "main" } = {}) => new Config({
155
+ var edgeUrl = (edge) => Match.value(edge).pipe(Match.when("local", () => "http://localhost:8787"), Match.when("dev", () => "https://edge.dxos.workers.dev"), Match.when("main", () => "https://edge-main.dxos.workers.dev"), Match.when("production", () => "https://edge-production.dxos.workers.dev"), Match.exhaustive);
156
+ var sandboxUrl = (sandbox) => Match.value(sandbox).pipe(Match.when("local", () => "http://localhost:8792"), Match.when("dev", () => "https://sandbox-service.dxos.workers.dev"), Match.when("main", () => "https://sandbox-service.dxos.workers.dev"), Match.when("production", () => "https://sandbox-service.dxos.workers.dev"), Match.exhaustive);
157
+ var configPreset = ({ edge = "main", sandbox } = {}) => new Config({
133
158
  version: 1,
134
159
  runtime: {
135
160
  client: {
@@ -141,8 +166,13 @@ var configPreset = ({ edge = "main" } = {}) => new Config({
141
166
  },
142
167
  services: {
143
168
  edge: {
144
- url: Match.value(edge).pipe(Match.when("local", () => "http://localhost:8787"), Match.when("dev", () => "https://edge.dxos.workers.dev"), Match.when("main", () => "https://edge-main.dxos.workers.dev"), Match.when("production", () => "https://edge-production.dxos.workers.dev"), Match.exhaustive)
145
- }
169
+ url: edgeUrl(edge)
170
+ },
171
+ ...sandbox ? {
172
+ sandbox: {
173
+ url: sandboxUrl(sandbox)
174
+ }
175
+ } : {}
146
176
  }
147
177
  }
148
178
  });
@@ -150,12 +180,15 @@ export {
150
180
  Config,
151
181
  ConfigResource,
152
182
  ConfigService,
183
+ EDGE_SERVICE_DEFAULTS,
184
+ EdgeServiceName,
153
185
  FILE_DEFAULTS,
154
186
  FILE_DYNAMICS,
155
187
  FILE_ENVS,
156
188
  configPreset,
157
189
  defaultConfig,
158
190
  defs,
191
+ getEdgeServiceEndpoint,
159
192
  mapFromKeyValues,
160
193
  mapToKeyValues,
161
194
  memoryConfig,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/index.ts", "../../../src/config-service.ts", "../../../src/telemetry.ts", "../../../src/preset.ts"],
4
- "sourcesContent": ["//\n// Copyright 2021 DXOS.org\n//\n\n// TODO(burdon): Why is this exported? (Rename).\nexport * as defs from '@dxos/protocols/proto/dxos/config';\n\nexport { type Config as ConfigProto } from '@dxos/protocols/proto/dxos/config';\n\nexport * from './config';\nexport * from './config-service';\nexport * from '#loaders';\nexport * from '#savers';\nexport * from '#plugin';\nexport * from './telemetry';\nexport * from './types';\nexport * from './preset';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as FileSystem from '@effect/platform/FileSystem';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\nimport { dirname } from 'node:path';\nimport * as Yaml from 'yaml';\n\nimport { DX_CONFIG, DX_DATA, getProfileConfigPath, getProfilePath } from '@dxos/client-protocol';\nimport { invariant } from '@dxos/invariant';\n\nimport { Config } from './config';\n\nexport const memoryConfig = new Config({\n runtime: {\n client: {\n edgeFeatures: {\n echoReplicator: true,\n feedReplicator: true,\n signaling: true,\n agents: true,\n },\n },\n },\n});\n\nexport const defaultConfig = new Config({\n runtime: {\n client: {\n edgeFeatures: {\n echoReplicator: true,\n feedReplicator: true,\n signaling: true,\n agents: true,\n },\n storage: {\n persistent: true,\n },\n },\n services: {\n edge: {\n url: 'wss://edge-production.dxos.workers.dev/',\n },\n iceProviders: [\n {\n urls: 'https://edge-production.dxos.workers.dev/ice',\n },\n ],\n ai: {\n server: 'https://ai-service.dxos.workers.dev',\n },\n ipfs: {\n server: 'https://api.ipfs.dxos.network/api/v0',\n gateway: 'https://gateway.ipfs.dxos.network/ipfs',\n },\n },\n },\n});\n\nexport class ConfigService extends Context.Tag('ConfigService')<ConfigService, Config>() {\n static layerMemory = Layer.effect(ConfigService, Effect.succeed(memoryConfig));\n\n static fromConfig = (config: Config) => Layer.succeed(ConfigService, config);\n\n static load = (args: { config: Option.Option<string>; profile: string }) => {\n const defaultConfigPath = getProfileConfigPath(DX_CONFIG, args.profile);\n return Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const configPath = Option.getOrElse(args.config, () => defaultConfigPath);\n const configContent = yield* fs.readFileString(configPath);\n const configValues = Yaml.parse(configContent);\n return ConfigService.of(new Config(configValues, profileBuiltinDefaults(args.profile).values));\n }).pipe(\n // If the config file doesn't exist, create it.\n Effect.catchTag('SystemError', () =>\n Effect.gen(function* () {\n const configValues = defaultConfig.values;\n const fs = yield* FileSystem.FileSystem;\n const pathToCreate = Option.getOrElse(args.config, () => defaultConfigPath);\n yield* fs.makeDirectory(dirname(pathToCreate), { recursive: true });\n yield* fs.writeFileString(pathToCreate, Yaml.stringify(configValues));\n return ConfigService.of(new Config(configValues));\n }),\n ),\n );\n };\n}\n\n/**\n * Default config for a profile.\n * Always merged with the default config.\n */\nconst profileBuiltinDefaults = (profile: string) => {\n invariant(!profile.endsWith('.yml'));\n\n return new Config({\n runtime: {\n client: {\n edgeFeatures: {\n echoReplicator: true,\n feedReplicator: true,\n signaling: true,\n agents: true,\n },\n storage: {\n persistent: true,\n dataRoot: getProfilePath(DX_DATA, profile),\n },\n },\n },\n });\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { isNode } from '@dxos/util';\n\nimport { type Config } from './config';\n\n/**\n * Resolves the telemetry tag used as the `X-DXOS-Client-Tag` header on edge\n * requests AND as the `ctx.tag` attribute / resource on observability traces.\n *\n * Keeping a single resolver ensures the same tag identifies a session across\n * edge and telemetry tiers. Precedence:\n *\n * 1. `config.runtime.app.env.DX_TELEMETRY_TAG` — the explicit, deterministic\n * path. Populated from `.env`/build-time by the app's config loaders.\n * 2. `process.env.DX_TELEMETRY_TAG` — Node-only, for dev/CI convenience.\n *\n * Returns `undefined` when unset; callers should no-op on undefined rather\n * than stamping empty strings.\n */\nexport const resolveTelemetryTag = (config?: Config): string | undefined => {\n return config?.get('runtime.app.env.DX_TELEMETRY_TAG') ?? (isNode() ? process.env.DX_TELEMETRY_TAG : undefined);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Match from 'effect/Match';\n\nimport { Config } from './config';\n\nexport type ConfigPresetOptions = {\n /**\n * Edge service.\n * @default main\n */\n edge?: 'local' | 'dev' | 'main' | 'production';\n};\n\nexport const configPreset = ({ edge = 'main' }: ConfigPresetOptions = {}) =>\n new Config({\n version: 1,\n runtime: {\n client: {\n edgeFeatures: {\n signaling: true,\n echoReplicator: true,\n feedReplicator: true,\n },\n },\n services: {\n edge: {\n url: Match.value(edge).pipe(\n Match.when('local', () => 'http://localhost:8787'),\n Match.when('dev', () => 'https://edge.dxos.workers.dev'),\n Match.when('main', () => 'https://edge-main.dxos.workers.dev'),\n Match.when('production', () => 'https://edge-production.dxos.workers.dev'),\n Match.exhaustive,\n ),\n },\n },\n },\n });\n"],
5
- "mappings": ";;;;;;;;;;;;;;;AAKA,YAAYA,UAAU;;;ACDtB,YAAYC,gBAAgB;AAC5B,YAAYC,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,YAAY;AACxB,SAASC,eAAe;AACxB,YAAYC,UAAU;AAEtB,SAASC,WAAWC,SAASC,sBAAsBC,sBAAsB;AACzE,SAASC,iBAAiB;AAI1B,IAAA,eAAaC;IAETC,eAAQ,IAAA,OAAA;WACNC;YACEC;oBACAC;QACAC,gBAAW;QACXC,gBAAQ;QACV,WAAA;QACF,QAAA;MACF;IACC;EAEH;;IAEIL,gBAAQ,IAAA,OAAA;WACNC;YACEC;oBACAC;QACAC,gBAAW;QACXC,gBAAQ;QACV,WAAA;QACAC,QAAS;;MAET,SAAA;QACF,YAAA;MACAC;;cAEIC;MACF,MAAA;QACAC,KAAAA;;oBAEU;QACR;UACD,MAAA;QACG;;MAEJ,IAAA;QACAC,QAAM;;YAEJC;QACF,QAAA;QACF,SAAA;MACF;IACC;EAEH;;AAGE,IAAOC,gBAAP,MAAOA,uBAAuCC,YAAO,eAACC,EAAeC,EAAAA;EAErE,OAAOC,cAAQC,aAAAA,gBAAAA,eAAAA,YAAAA,CAAAA;SACb,aAAMC,CAAAA,WAAoBC,cAAAA,gBAAqBC,MAAWH;SAC1D,OAAOI,CAAAA,SAAW;UAChB,oBAAkBC,qBAAqB,WAAA,KAAA,OAAA;WACjCC,WAAAA,aAAoBC;AAC1B,YAAMC,KAAAA,OAAuBC;AAC7B,YAAMC,aAAoBC,iBAAMH,KAAAA,QAAAA,MAAAA,iBAAAA;AAChC,YAAA,gBAAqBI,OAAOC,GAAAA,eAAOH,UAAcI;AAChDC,YACD,eAAA,WAAA,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K,OAAO,MAAM,+BAAA,GAClBA,WAAK,QAAQ,MAAM,oCAAA,GACnBA,WAAK,cAAc,MAAM,0CAAA,GACzBC,gBAAU;MAEpB;IACF;EACF;AACF,CAAA;",
6
- "names": ["defs", "FileSystem", "Context", "Effect", "Layer", "Option", "dirname", "Yaml", "DX_CONFIG", "DX_DATA", "getProfileConfigPath", "getProfilePath", "invariant", "memoryConfig", "client", "edgeFeatures", "echoReplicator", "feedReplicator", "signaling", "agents", "storage", "services", "url", "iceProviders", "ipfs", "gateway", "fromConfig", "succeed", "ConfigService", "config", "load", "args", "defaultConfigPath", "getProfileConfigPath", "DX_CONFIG", "Effect", "FileSystem", "configPath", "getOrElse", "configContent", "fs", "configValues", "parse", "of", "Config", "profileBuiltinDefaults", "pipe", "catchTag", "pathToCreate", "Option", "makeDirectory", "dirname", "recursive", "writeFileString", "runtime", "dataRoot", "isNode", "resolveTelemetryTag", "config", "get", "process", "env", "DX_TELEMETRY_TAG", "undefined", "Match", "configPreset", "edge", "Config", "version", "runtime", "client", "edgeFeatures", "signaling", "echoReplicator", "feedReplicator", "services", "url", "value", "pipe", "when", "exhaustive"]
3
+ "sources": ["../../../src/index.ts", "../../../src/config-service.ts", "../../../src/edge-services.ts", "../../../src/telemetry.ts", "../../../src/preset.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2021 DXOS.org\n//\n\n// TODO(burdon): Why is this exported? (Rename).\nexport * as defs from '@dxos/protocols/proto/dxos/config';\n\nexport { type Config as ConfigProto } from '@dxos/protocols/proto/dxos/config';\n\nexport * from './config';\nexport * from './config-service';\nexport * from './edge-services';\nexport * from '#loaders';\nexport * from '#savers';\nexport * from '#plugin';\nexport * from './telemetry';\nexport * from './types';\nexport * from './preset';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as FileSystem from '@effect/platform/FileSystem';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\nimport { dirname } from 'node:path';\nimport * as Yaml from 'yaml';\n\nimport { DX_CONFIG, DX_DATA, getProfileConfigPath, getProfilePath } from '@dxos/client-protocol';\nimport { invariant } from '@dxos/invariant';\n\nimport { Config } from './config';\n\nexport const memoryConfig = new Config({\n runtime: {\n client: {\n edgeFeatures: {\n echoReplicator: true,\n feedReplicator: true,\n signaling: true,\n agents: true,\n },\n },\n },\n});\n\nexport const defaultConfig = new Config({\n runtime: {\n client: {\n edgeFeatures: {\n echoReplicator: true,\n feedReplicator: true,\n signaling: true,\n agents: true,\n },\n storage: {\n persistent: true,\n },\n },\n services: {\n edge: {\n url: 'wss://edge-production.dxos.workers.dev/',\n },\n iceProviders: [\n {\n urls: 'https://edge-production.dxos.workers.dev/ice',\n },\n ],\n ai: {\n server: 'https://ai-service.dxos.workers.dev',\n },\n ipfs: {\n server: 'https://api.ipfs.dxos.network/api/v0',\n gateway: 'https://gateway.ipfs.dxos.network/ipfs',\n },\n },\n },\n});\n\nexport class ConfigService extends Context.Tag('ConfigService')<ConfigService, Config>() {\n static layerMemory = Layer.effect(ConfigService, Effect.succeed(memoryConfig));\n\n static fromConfig = (config: Config) => Layer.succeed(ConfigService, config);\n\n static load = (args: { config: Option.Option<string>; profile: string }) => {\n const defaultConfigPath = getProfileConfigPath(DX_CONFIG, args.profile);\n return Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const configPath = Option.getOrElse(args.config, () => defaultConfigPath);\n const configContent = yield* fs.readFileString(configPath);\n const configValues = Yaml.parse(configContent);\n return ConfigService.of(new Config(configValues, profileBuiltinDefaults(args.profile).values));\n }).pipe(\n // If the config file doesn't exist, create it.\n Effect.catchTag('SystemError', () =>\n Effect.gen(function* () {\n const configValues = defaultConfig.values;\n const fs = yield* FileSystem.FileSystem;\n const pathToCreate = Option.getOrElse(args.config, () => defaultConfigPath);\n yield* fs.makeDirectory(dirname(pathToCreate), { recursive: true });\n yield* fs.writeFileString(pathToCreate, Yaml.stringify(configValues));\n return ConfigService.of(new Config(configValues));\n }),\n ),\n );\n };\n}\n\n/**\n * Default config for a profile.\n * Always merged with the default config.\n */\nconst profileBuiltinDefaults = (profile: string) => {\n invariant(!profile.endsWith('.yml'));\n\n return new Config({\n runtime: {\n client: {\n edgeFeatures: {\n echoReplicator: true,\n feedReplicator: true,\n signaling: true,\n agents: true,\n },\n storage: {\n persistent: true,\n dataRoot: getProfilePath(DX_DATA, profile),\n },\n },\n },\n });\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Config } from './config';\n\n/**\n * Canonical names for EDGE (Cloudflare Worker) services.\n * Used as keys into `runtime.services.edgeServices` and {@link EDGE_SERVICE_DEFAULTS}.\n */\nexport const EdgeServiceName = Object.freeze({\n Calls: 'calls',\n Image: 'image',\n Transcription: 'transcription',\n Discord: 'discord',\n CorsProxy: 'cors-proxy',\n ApiProxy: 'api-proxy',\n Introspect: 'introspect',\n ChatAgent: 'chat-agent',\n} as const);\n\nexport type EdgeServiceName = (typeof EdgeServiceName)[keyof typeof EdgeServiceName];\n\n/**\n * Canonical dev/test default endpoints for EDGE services.\n * Single source of truth for the URLs previously hard-coded across plugins.\n * Production values are supplied per-app via `dx.yml` (`runtime.services.edgeServices`).\n */\nexport const EDGE_SERVICE_DEFAULTS: Readonly<Record<EdgeServiceName, string>> = Object.freeze({\n [EdgeServiceName.Calls]: 'https://calls-service.dxos.workers.dev',\n [EdgeServiceName.Image]: 'https://image-service-main.dxos.workers.dev',\n [EdgeServiceName.Transcription]: 'https://calls-service.dxos.workers.dev',\n [EdgeServiceName.Discord]: 'https://discord-service.dxos.workers.dev',\n [EdgeServiceName.CorsProxy]: 'https://cors-proxy.dxos.workers.dev',\n [EdgeServiceName.ApiProxy]: 'https://api-proxy.dxos.workers.dev',\n [EdgeServiceName.Introspect]: 'https://introspect-service-labs.dxos.workers.dev/mcp',\n [EdgeServiceName.ChatAgent]: 'wss://chat-agent-labs.dxos.workers.dev',\n});\n\n/**\n * Resolve the endpoint for an EDGE service.\n * Prefers the matching `runtime.services.edgeServices` entry, falling back to the canonical\n * {@link EDGE_SERVICE_DEFAULTS} entry.\n * `name` is expected to be unique; on duplicates the last entry wins so a later override is\n * not silently shadowed by an earlier one (proto cannot enforce uniqueness on a repeated field).\n */\nexport const getEdgeServiceEndpoint = (config: Config, name: EdgeServiceName): string =>\n config.values.runtime?.services?.edgeServices?.findLast((service) => service.name === name)?.endpoint ??\n EDGE_SERVICE_DEFAULTS[name];\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { isNode } from '@dxos/util';\n\nimport { type Config } from './config';\n\n/**\n * Resolves the telemetry tag used as the `X-DXOS-Client-Tag` header on edge\n * requests AND as the `ctx.tag` attribute / resource on observability traces.\n *\n * Keeping a single resolver ensures the same tag identifies a session across\n * edge and telemetry tiers. Precedence:\n *\n * 1. `config.runtime.app.env.DX_TELEMETRY_TAG` — the explicit, deterministic\n * path. Populated from `.env`/build-time by the app's config loaders.\n * 2. `process.env.DX_TELEMETRY_TAG` — Node-only, for dev/CI convenience.\n *\n * Returns `undefined` when unset; callers should no-op on undefined rather\n * than stamping empty strings.\n */\nexport const resolveTelemetryTag = (config?: Config): string | undefined => {\n return config?.get('runtime.app.env.DX_TELEMETRY_TAG') ?? (isNode() ? process.env.DX_TELEMETRY_TAG : undefined);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Match from 'effect/Match';\n\nimport { Config } from './config';\n\nexport type ConfigPresetOptions = {\n /**\n * Edge service.\n * @default main\n */\n edge?: 'local' | 'dev' | 'main' | 'production';\n\n /**\n * Sandbox service (standalone worker; API at /api/sandbox).\n */\n sandbox?: 'local' | 'dev' | 'main' | 'production';\n};\n\nconst edgeUrl = (edge: NonNullable<ConfigPresetOptions['edge']>) =>\n Match.value(edge).pipe(\n Match.when('local', () => 'http://localhost:8787'),\n Match.when('dev', () => 'https://edge.dxos.workers.dev'),\n Match.when('main', () => 'https://edge-main.dxos.workers.dev'),\n Match.when('production', () => 'https://edge-production.dxos.workers.dev'),\n Match.exhaustive,\n );\n\n// TODO(burdon): Hosted environments share a single worker until per-env deployments exist.\nconst sandboxUrl = (sandbox: NonNullable<ConfigPresetOptions['sandbox']>) =>\n Match.value(sandbox).pipe(\n Match.when('local', () => 'http://localhost:8792'),\n Match.when('dev', () => 'https://sandbox-service.dxos.workers.dev'),\n Match.when('main', () => 'https://sandbox-service.dxos.workers.dev'),\n Match.when('production', () => 'https://sandbox-service.dxos.workers.dev'),\n Match.exhaustive,\n );\n\nexport const configPreset = ({ edge = 'main', sandbox }: ConfigPresetOptions = {}) =>\n new Config({\n version: 1,\n runtime: {\n client: {\n edgeFeatures: {\n signaling: true,\n echoReplicator: true,\n feedReplicator: true,\n },\n },\n services: {\n edge: {\n url: edgeUrl(edge),\n },\n ...(sandbox ? { sandbox: { url: sandboxUrl(sandbox) } } : {}),\n },\n },\n });\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;AAKA,YAAYA,UAAU;;;ACDtB,YAAYC,gBAAgB;AAC5B,YAAYC,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,YAAY;AACxB,SAASC,eAAe;AACxB,YAAYC,UAAU;AAEtB,SAASC,WAAWC,SAASC,sBAAsBC,sBAAsB;AACzE,SAASC,iBAAiB;AAI1B,IAAA,eAAaC;IAETC,eAAQ,IAAA,OAAA;WACNC;YACEC;oBACAC;QACAC,gBAAW;QACXC,gBAAQ;QACV,WAAA;QACF,QAAA;MACF;IACC;EAEH;;IAEIL,gBAAQ,IAAA,OAAA;WACNC;YACEC;oBACAC;QACAC,gBAAW;QACXC,gBAAQ;QACV,WAAA;QACAC,QAAS;;MAET,SAAA;QACF,YAAA;MACAC;;cAEIC;MACF,MAAA;QACAC,KAAAA;;oBAEU;QACR;UACD,MAAA;QACG;;MAEJ,IAAA;QACAC,QAAM;;YAEJC;QACF,QAAA;QACF,SAAA;MACF;IACC;EAEH;;AAGE,IAAOC,gBAAP,MAAOA,uBAAuCC,YAAO,eAACC,EAAeC,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C,QAAQ;MACNC,cAAc;QACZC,WAAW;QACXC,gBAAgB;QAChBC,gBAAgB;MAClB;IACF;IACAC,UAAU;MACRhB,MAAM;QACJiB,KAAKlB,QAAQC,IAAAA;MACf;MACA,GAAIM,UAAU;QAAEA,SAAS;UAAEW,KAAKZ,WAAWC,OAAAA;QAAS;MAAE,IAAI,CAAC;IAC7D;EACF;AACF,CAAA;",
6
+ "names": ["defs", "FileSystem", "Context", "Effect", "Layer", "Option", "dirname", "Yaml", "DX_CONFIG", "DX_DATA", "getProfileConfigPath", "getProfilePath", "invariant", "memoryConfig", "client", "edgeFeatures", "echoReplicator", "feedReplicator", "signaling", "agents", "storage", "services", "url", "iceProviders", "ipfs", "gateway", "fromConfig", "succeed", "ConfigService", "config", "load", "args", "defaultConfigPath", "getProfileConfigPath", "DX_CONFIG", "Effect", "FileSystem", "configPath", "getOrElse", "configContent", "fs", "configValues", "parse", "of", "Config", "profileBuiltinDefaults", "pipe", "catchTag", "pathToCreate", "Option", "makeDirectory", "dirname", "recursive", "writeFileString", "runtime", "dataRoot", "EdgeServiceName", "Object", "freeze", "Calls", "Image", "Transcription", "Discord", "CorsProxy", "ApiProxy", "Introspect", "ChatAgent", "EDGE_SERVICE_DEFAULTS", "getEdgeServiceEndpoint", "config", "name", "values", "runtime", "services", "edgeServices", "findLast", "service", "endpoint", "isNode", "resolveTelemetryTag", "config", "get", "process", "env", "DX_TELEMETRY_TAG", "undefined", "Match", "edgeUrl", "edge", "value", "pipe", "when", "exhaustive", "sandboxUrl", "sandbox", "configPreset", "Config", "version", "runtime", "client", "edgeFeatures", "signaling", "echoReplicator", "feedReplicator", "services", "url"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/config.ts":{"bytes":15941,"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.ismatch","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/config-service.ts":{"bytes":12251,"imports":[{"path":"@effect/platform/FileSystem","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/client-protocol","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"}],"format":"esm"},"src/telemetry.ts":{"bytes":2724,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types.ts":{"bytes":2665,"imports":[],"format":"esm"},"src/preset.ts":{"bytes":3253,"imports":[{"path":"effect/Match","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"}],"format":"esm"},"src/index.ts":{"bytes":1416,"imports":[{"path":"@dxos/protocols/proto/dxos/config","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"},{"path":"src/config-service.ts","kind":"import-statement","original":"./config-service"},{"path":"#loaders","kind":"import-statement","external":true},{"path":"#savers","kind":"import-statement","external":true},{"path":"#plugin","kind":"import-statement","external":true},{"path":"src/telemetry.ts","kind":"import-statement","original":"./telemetry"},{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"src/preset.ts","kind":"import-statement","original":"./preset"}],"format":"esm"},"src/loaders/index.ts":{"bytes":8152,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"../config"},{"path":"src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/loaders/browser.ts":{"bytes":8287,"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/savers/index.ts":{"bytes":589,"imports":[],"format":"esm"},"src/savers/browser.ts":{"bytes":2564,"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/plugin/definitions.ts":{"bytes":11702,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"pkg-up","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"../config"}],"format":"esm"},"src/plugin/index.ts":{"bytes":427,"imports":[{"path":"src/plugin/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/plugin/browser.ts":{"bytes":924,"imports":[],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9239},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-T6NFH3CC.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-WIJROCKQ.mjs","kind":"import-statement"},{"path":"@dxos/protocols/proto/dxos/config","kind":"import-statement","external":true},{"path":"@effect/platform/FileSystem","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/client-protocol","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"#loaders","kind":"import-statement","external":true},{"path":"#savers","kind":"import-statement","external":true},{"path":"#plugin","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true}],"exports":["Config","ConfigResource","ConfigService","FILE_DEFAULTS","FILE_DYNAMICS","FILE_ENVS","configPreset","defaultConfig","defs","mapFromKeyValues","mapToKeyValues","memoryConfig","resolveTelemetryTag","validateConfig"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":135},"src/config-service.ts":{"bytesInOutput":3247},"src/telemetry.ts":{"bytesInOutput":192},"src/preset.ts":{"bytesInOutput":617}},"bytes":4865},"dist/lib/node-esm/loaders/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3508},"dist/lib/node-esm/loaders/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-T6NFH3CC.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-WIJROCKQ.mjs","kind":"import-statement"},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Defaults","Dynamics","Envs","Local","Profile","Remote","Storage"],"entryPoint":"src/loaders/index.ts","inputs":{"src/loaders/index.ts":{"bytesInOutput":1521}},"bytes":1887},"dist/lib/node-esm/chunk-T6NFH3CC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1815},"dist/lib/node-esm/chunk-T6NFH3CC.mjs":{"imports":[],"exports":["FILE_DEFAULTS","FILE_DYNAMICS","FILE_ENVS"],"inputs":{"src/types.ts":{"bytesInOutput":102}},"bytes":314},"dist/lib/node-esm/loaders/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4099},"dist/lib/node-esm/loaders/browser.mjs":{"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Defaults","Dynamics","Envs","Local","Profile","Remote","Storage"],"entryPoint":"src/loaders/browser.ts","inputs":{"src/loaders/browser.ts":{"bytesInOutput":2028}},"bytes":2268},"dist/lib/node-esm/savers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":360},"dist/lib/node-esm/savers/index.mjs":{"imports":[],"exports":["SaveConfig"],"entryPoint":"src/savers/index.ts","inputs":{"src/savers/index.ts":{"bytesInOutput":35}},"bytes":211},"dist/lib/node-esm/savers/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1304},"dist/lib/node-esm/savers/browser.mjs":{"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["SaveConfig"],"entryPoint":"src/savers/browser.ts","inputs":{"src/savers/browser.ts":{"bytesInOutput":694}},"bytes":874},"dist/lib/node-esm/plugin/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5415},"dist/lib/node-esm/plugin/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-WIJROCKQ.mjs","kind":"import-statement"},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"pkg-up","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["definitions"],"entryPoint":"src/plugin/index.ts","inputs":{"src/plugin/definitions.ts":{"bytesInOutput":3073},"src/plugin/index.ts":{"bytesInOutput":0}},"bytes":3316},"dist/lib/node-esm/chunk-WIJROCKQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7813},"dist/lib/node-esm/chunk-WIJROCKQ.mjs":{"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.ismatch","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["Config","ConfigResource","mapFromKeyValues","mapToKeyValues","validateConfig"],"inputs":{"src/config.ts":{"bytesInOutput":4083}},"bytes":4333},"dist/lib/node-esm/plugin/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":496},"dist/lib/node-esm/plugin/browser.mjs":{"imports":[],"exports":["definitions"],"entryPoint":"src/plugin/browser.ts","inputs":{"src/plugin/browser.ts":{"bytesInOutput":110}},"bytes":291}}}
1
+ {"inputs":{"src/config.ts":{"bytes":15941,"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.ismatch","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/config-service.ts":{"bytes":12251,"imports":[{"path":"@effect/platform/FileSystem","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/client-protocol","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"}],"format":"esm"},"src/edge-services.ts":{"bytes":6244,"imports":[],"format":"esm"},"src/telemetry.ts":{"bytes":2724,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types.ts":{"bytes":2665,"imports":[],"format":"esm"},"src/preset.ts":{"bytes":5424,"imports":[{"path":"effect/Match","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"}],"format":"esm"},"src/index.ts":{"bytes":1517,"imports":[{"path":"@dxos/protocols/proto/dxos/config","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"./config"},{"path":"src/config-service.ts","kind":"import-statement","original":"./config-service"},{"path":"src/edge-services.ts","kind":"import-statement","original":"./edge-services"},{"path":"#loaders","kind":"import-statement","external":true},{"path":"#savers","kind":"import-statement","external":true},{"path":"#plugin","kind":"import-statement","external":true},{"path":"src/telemetry.ts","kind":"import-statement","original":"./telemetry"},{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"src/preset.ts","kind":"import-statement","original":"./preset"}],"format":"esm"},"src/loaders/index.ts":{"bytes":8152,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"../config"},{"path":"src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/loaders/browser.ts":{"bytes":8287,"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/savers/index.ts":{"bytes":589,"imports":[],"format":"esm"},"src/savers/browser.ts":{"bytes":2564,"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/plugin/definitions.ts":{"bytes":11702,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"pkg-up","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/config.ts","kind":"import-statement","original":"../config"}],"format":"esm"},"src/plugin/index.ts":{"bytes":427,"imports":[{"path":"src/plugin/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/plugin/browser.ts":{"bytes":924,"imports":[],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13403},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-T6NFH3CC.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-WIJROCKQ.mjs","kind":"import-statement"},{"path":"@dxos/protocols/proto/dxos/config","kind":"import-statement","external":true},{"path":"@effect/platform/FileSystem","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/client-protocol","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"#loaders","kind":"import-statement","external":true},{"path":"#savers","kind":"import-statement","external":true},{"path":"#plugin","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Match","kind":"import-statement","external":true}],"exports":["Config","ConfigResource","ConfigService","EDGE_SERVICE_DEFAULTS","EdgeServiceName","FILE_DEFAULTS","FILE_DYNAMICS","FILE_ENVS","configPreset","defaultConfig","defs","getEdgeServiceEndpoint","mapFromKeyValues","mapToKeyValues","memoryConfig","resolveTelemetryTag","validateConfig"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":135},"src/config-service.ts":{"bytesInOutput":3247},"src/edge-services.ts":{"bytesInOutput":1060},"src/telemetry.ts":{"bytesInOutput":192},"src/preset.ts":{"bytesInOutput":1106}},"bytes":6509},"dist/lib/node-esm/loaders/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3508},"dist/lib/node-esm/loaders/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-T6NFH3CC.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-WIJROCKQ.mjs","kind":"import-statement"},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Defaults","Dynamics","Envs","Local","Profile","Remote","Storage"],"entryPoint":"src/loaders/index.ts","inputs":{"src/loaders/index.ts":{"bytesInOutput":1521}},"bytes":1887},"dist/lib/node-esm/chunk-T6NFH3CC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1815},"dist/lib/node-esm/chunk-T6NFH3CC.mjs":{"imports":[],"exports":["FILE_DEFAULTS","FILE_DYNAMICS","FILE_ENVS"],"inputs":{"src/types.ts":{"bytesInOutput":102}},"bytes":314},"dist/lib/node-esm/loaders/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4099},"dist/lib/node-esm/loaders/browser.mjs":{"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Defaults","Dynamics","Envs","Local","Profile","Remote","Storage"],"entryPoint":"src/loaders/browser.ts","inputs":{"src/loaders/browser.ts":{"bytesInOutput":2028}},"bytes":2268},"dist/lib/node-esm/savers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":360},"dist/lib/node-esm/savers/index.mjs":{"imports":[],"exports":["SaveConfig"],"entryPoint":"src/savers/index.ts","inputs":{"src/savers/index.ts":{"bytesInOutput":35}},"bytes":211},"dist/lib/node-esm/savers/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1304},"dist/lib/node-esm/savers/browser.mjs":{"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["SaveConfig"],"entryPoint":"src/savers/browser.ts","inputs":{"src/savers/browser.ts":{"bytesInOutput":694}},"bytes":874},"dist/lib/node-esm/plugin/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5415},"dist/lib/node-esm/plugin/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-WIJROCKQ.mjs","kind":"import-statement"},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"pkg-up","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["definitions"],"entryPoint":"src/plugin/index.ts","inputs":{"src/plugin/definitions.ts":{"bytesInOutput":3073},"src/plugin/index.ts":{"bytesInOutput":0}},"bytes":3316},"dist/lib/node-esm/chunk-WIJROCKQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7813},"dist/lib/node-esm/chunk-WIJROCKQ.mjs":{"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"lodash.ismatch","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["Config","ConfigResource","mapFromKeyValues","mapToKeyValues","validateConfig"],"inputs":{"src/config.ts":{"bytesInOutput":4083}},"bytes":4333},"dist/lib/node-esm/plugin/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":496},"dist/lib/node-esm/plugin/browser.mjs":{"imports":[],"exports":["definitions"],"entryPoint":"src/plugin/browser.ts","inputs":{"src/plugin/browser.ts":{"bytesInOutput":110}},"bytes":291}}}
@@ -0,0 +1,31 @@
1
+ import { type Config } from './config';
2
+ /**
3
+ * Canonical names for EDGE (Cloudflare Worker) services.
4
+ * Used as keys into `runtime.services.edgeServices` and {@link EDGE_SERVICE_DEFAULTS}.
5
+ */
6
+ export declare const EdgeServiceName: Readonly<{
7
+ readonly Calls: 'calls';
8
+ readonly Image: 'image';
9
+ readonly Transcription: 'transcription';
10
+ readonly Discord: 'discord';
11
+ readonly CorsProxy: 'cors-proxy';
12
+ readonly ApiProxy: 'api-proxy';
13
+ readonly Introspect: 'introspect';
14
+ readonly ChatAgent: 'chat-agent';
15
+ }>;
16
+ export type EdgeServiceName = (typeof EdgeServiceName)[keyof typeof EdgeServiceName];
17
+ /**
18
+ * Canonical dev/test default endpoints for EDGE services.
19
+ * Single source of truth for the URLs previously hard-coded across plugins.
20
+ * Production values are supplied per-app via `dx.yml` (`runtime.services.edgeServices`).
21
+ */
22
+ export declare const EDGE_SERVICE_DEFAULTS: Readonly<Record<EdgeServiceName, string>>;
23
+ /**
24
+ * Resolve the endpoint for an EDGE service.
25
+ * Prefers the matching `runtime.services.edgeServices` entry, falling back to the canonical
26
+ * {@link EDGE_SERVICE_DEFAULTS} entry.
27
+ * `name` is expected to be unique; on duplicates the last entry wins so a later override is
28
+ * not silently shadowed by an earlier one (proto cannot enforce uniqueness on a repeated field).
29
+ */
30
+ export declare const getEdgeServiceEndpoint: (config: Config, name: EdgeServiceName) => string;
31
+ //# sourceMappingURL=edge-services.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edge-services.d.ts","sourceRoot":"","sources":["../../../src/edge-services.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,eAAe;oBACnB,OAAO;oBACP,OAAO;4BACC,eAAe;sBACrB,SAAS;wBACP,YAAY;uBACb,WAAW;yBACT,YAAY;wBACb,YAAY;EACd,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAErF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAS1E,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,WAAY,MAAM,QAAQ,eAAe,KAAG,MAElD,CAAC"}
@@ -2,6 +2,7 @@ export * as defs from '@dxos/protocols/proto/dxos/config';
2
2
  export { type Config as ConfigProto } from '@dxos/protocols/proto/dxos/config';
3
3
  export * from './config';
4
4
  export * from './config-service';
5
+ export * from './edge-services';
5
6
  export * from '#loaders';
6
7
  export * from '#savers';
7
8
  export * from '#plugin';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,IAAI,MAAM,mCAAmC,CAAC;AAE1D,OAAO,EAAE,KAAK,MAAM,IAAI,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAE/E,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,IAAI,MAAM,mCAAmC,CAAC;AAE1D,OAAO,EAAE,KAAK,MAAM,IAAI,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAE/E,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
@@ -5,6 +5,10 @@ export type ConfigPresetOptions = {
5
5
  * @default main
6
6
  */
7
7
  edge?: 'local' | 'dev' | 'main' | 'production';
8
+ /**
9
+ * Sandbox service (standalone worker; API at /api/sandbox).
10
+ */
11
+ sandbox?: 'local' | 'dev' | 'main' | 'production';
8
12
  };
9
- export declare const configPreset: ({ edge }?: ConfigPresetOptions) => Config;
13
+ export declare const configPreset: ({ edge, sandbox }?: ConfigPresetOptions) => Config;
10
14
  //# sourceMappingURL=preset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../../src/preset.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,YAAY,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,YAAY,cAAuB,mBAAmB,WAuB/D,CAAC"}
1
+ {"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../../src/preset.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,YAAY,CAAC;IAE/C;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,YAAY,CAAC;CACnD,CAAC;AAqBF,eAAO,MAAM,YAAY,uBAAgC,mBAAmB,WAkBxE,CAAC"}