@codelia/config 0.1.93 → 0.1.94

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/index.cjs CHANGED
@@ -333,7 +333,8 @@ var CONFIG_GROUP_DEFAULT_WRITE_SCOPE = {
333
333
  search: "project",
334
334
  image_generation: "global",
335
335
  tui: "global",
336
- update: "global"
336
+ update: "global",
337
+ worktree: "global"
337
338
  };
338
339
  var CONFIG_VERSION = 1;
339
340
  var MCP_SERVER_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;
@@ -727,6 +728,36 @@ var parseUpdateConfig = (value, source) => {
727
728
  }
728
729
  return Object.keys(result).length > 0 ? result : void 0;
729
730
  };
731
+ function parseWorktreeConfig(value, source) {
732
+ if (!isRecord(value))
733
+ throw new Error(`${source}: worktree must be an object`);
734
+ const { include_files, use_worktreeinclude, setup_command } = value;
735
+ const config = {};
736
+ if (include_files !== void 0) {
737
+ if (!Array.isArray(include_files) || include_files.some(
738
+ (entry) => typeof entry !== "string" || !entry.trim() || /[\r\n\0]/.test(entry)
739
+ ))
740
+ throw new Error(
741
+ `${source}: worktree.include_files must contain nonempty single-line patterns`
742
+ );
743
+ config.include_files = include_files;
744
+ }
745
+ if (use_worktreeinclude !== void 0) {
746
+ if (typeof use_worktreeinclude !== "boolean")
747
+ throw new Error(
748
+ `${source}: worktree.use_worktreeinclude must be boolean`
749
+ );
750
+ config.use_worktreeinclude = use_worktreeinclude;
751
+ }
752
+ if (setup_command !== void 0) {
753
+ if (typeof setup_command !== "string" || !setup_command.trim() || setup_command.includes("\0"))
754
+ throw new Error(
755
+ `${source}: worktree.setup_command must be a nonempty command`
756
+ );
757
+ config.setup_command = setup_command;
758
+ }
759
+ return config;
760
+ }
730
761
  var parseConfig = (value, sourceLabel) => {
731
762
  if (!isRecord(value)) {
732
763
  throw new Error(`${sourceLabel}: config must be an object`);
@@ -788,6 +819,8 @@ var parseConfig = (value, sourceLabel) => {
788
819
  result.tui = tui;
789
820
  }
790
821
  if (update) result.update = update;
822
+ if (value.worktree !== void 0)
823
+ result.worktree = parseWorktreeConfig(value.worktree, sourceLabel);
791
824
  return result;
792
825
  };
793
826
  var ConfigRegistry = class {
@@ -937,6 +970,11 @@ var ConfigRegistry = class {
937
970
  if (layer?.update) {
938
971
  merged.update = { ...merged.update ?? {}, ...layer.update };
939
972
  }
973
+ if (layer?.worktree)
974
+ merged.worktree = {
975
+ ...merged.worktree,
976
+ ...structuredClone(layer.worktree)
977
+ };
940
978
  }
941
979
  return merged;
942
980
  }
package/dist/index.d.cts CHANGED
@@ -201,6 +201,11 @@ type UpdateConfig = {
201
201
  };
202
202
  declare const isValidUpdateChannel: (value: string) => boolean;
203
203
  declare const parseUpdateMode: (value: unknown) => UpdateMode | undefined;
204
+ type WorktreeConfig = {
205
+ include_files?: string[];
206
+ use_worktreeinclude?: boolean;
207
+ setup_command?: string;
208
+ };
204
209
  type CodeliaConfig = {
205
210
  providers?: Record<string, ResponsesProviderConfig>;
206
211
  image_generation?: ImageGenerationConfig;
@@ -217,6 +222,7 @@ type CodeliaConfig = {
217
222
  search?: SearchConfig;
218
223
  tui?: TuiConfig;
219
224
  update?: UpdateConfig;
225
+ worktree?: WorktreeConfig;
220
226
  };
221
227
  type ConfigWriteScope = "global" | "project";
222
228
  type ConfigWriteGroup = Exclude<keyof CodeliaConfig, "version">;
@@ -240,6 +246,7 @@ type ConfigLayer = {
240
246
  search?: SearchConfig;
241
247
  tui?: TuiConfig;
242
248
  update?: UpdateConfig;
249
+ worktree?: WorktreeConfig;
243
250
  };
244
251
  declare class ConfigRegistry {
245
252
  private readonly defaults;
@@ -248,4 +255,4 @@ declare class ConfigRegistry {
248
255
  }
249
256
  declare const configRegistry: ConfigRegistry;
250
257
 
251
- export { type AgentsFileConfig, type AuthConfig, type AuthStorageMode, BUILTIN_PROVIDER_NAMES, CONFIG_GROUP_DEFAULT_WRITE_SCOPE, CONFIG_VERSION, type CodeliaConfig, ConfigRegistry, type ConfigWriteGroup, type ConfigWriteScope, type ExecutionEnvironmentConfig, type ExecutionEnvironmentStartupChecksConfig, type ExecutionEnvironmentStartupChecksMode, type ExperimentalConfig, GOOGLE_IMAGE_MODELS, type GoogleImageOptions, type ImageGenerationConfig, type ImageProviderOptions, type McpConfig, type McpServerConfig, type ModelConfig, type OAuthBrowserMode, OPENAI_CODEX_IMAGE_MODELS, OPENAI_IMAGE_MODELS, type OpenAiExperimentalConfig, type OpenAiImageOptions, type OpenRouterImageOptions, type PermissionRule, type PermissionsConfig, type ResponsesModelConfig, type ResponsesProviderConfig, SUBAGENT_MAX_CONCURRENT_LIMIT, type SearchConfig, type SearchMode, type SkillsConfig, type SubagentConfig, type TuiColorScheme, type TuiConfig, type TuiImageProtocol, type UpdateConfig, type UpdateMode, configRegistry, isValidUpdateChannel, normalizePermissionRule, parseConfig, parseImageGenerationConfig, parseResponsesProviders, parseUpdateMode };
258
+ export { type AgentsFileConfig, type AuthConfig, type AuthStorageMode, BUILTIN_PROVIDER_NAMES, CONFIG_GROUP_DEFAULT_WRITE_SCOPE, CONFIG_VERSION, type CodeliaConfig, ConfigRegistry, type ConfigWriteGroup, type ConfigWriteScope, type ExecutionEnvironmentConfig, type ExecutionEnvironmentStartupChecksConfig, type ExecutionEnvironmentStartupChecksMode, type ExperimentalConfig, GOOGLE_IMAGE_MODELS, type GoogleImageOptions, type ImageGenerationConfig, type ImageProviderOptions, type McpConfig, type McpServerConfig, type ModelConfig, type OAuthBrowserMode, OPENAI_CODEX_IMAGE_MODELS, OPENAI_IMAGE_MODELS, type OpenAiExperimentalConfig, type OpenAiImageOptions, type OpenRouterImageOptions, type PermissionRule, type PermissionsConfig, type ResponsesModelConfig, type ResponsesProviderConfig, SUBAGENT_MAX_CONCURRENT_LIMIT, type SearchConfig, type SearchMode, type SkillsConfig, type SubagentConfig, type TuiColorScheme, type TuiConfig, type TuiImageProtocol, type UpdateConfig, type UpdateMode, type WorktreeConfig, configRegistry, isValidUpdateChannel, normalizePermissionRule, parseConfig, parseImageGenerationConfig, parseResponsesProviders, parseUpdateMode };
package/dist/index.d.ts CHANGED
@@ -201,6 +201,11 @@ type UpdateConfig = {
201
201
  };
202
202
  declare const isValidUpdateChannel: (value: string) => boolean;
203
203
  declare const parseUpdateMode: (value: unknown) => UpdateMode | undefined;
204
+ type WorktreeConfig = {
205
+ include_files?: string[];
206
+ use_worktreeinclude?: boolean;
207
+ setup_command?: string;
208
+ };
204
209
  type CodeliaConfig = {
205
210
  providers?: Record<string, ResponsesProviderConfig>;
206
211
  image_generation?: ImageGenerationConfig;
@@ -217,6 +222,7 @@ type CodeliaConfig = {
217
222
  search?: SearchConfig;
218
223
  tui?: TuiConfig;
219
224
  update?: UpdateConfig;
225
+ worktree?: WorktreeConfig;
220
226
  };
221
227
  type ConfigWriteScope = "global" | "project";
222
228
  type ConfigWriteGroup = Exclude<keyof CodeliaConfig, "version">;
@@ -240,6 +246,7 @@ type ConfigLayer = {
240
246
  search?: SearchConfig;
241
247
  tui?: TuiConfig;
242
248
  update?: UpdateConfig;
249
+ worktree?: WorktreeConfig;
243
250
  };
244
251
  declare class ConfigRegistry {
245
252
  private readonly defaults;
@@ -248,4 +255,4 @@ declare class ConfigRegistry {
248
255
  }
249
256
  declare const configRegistry: ConfigRegistry;
250
257
 
251
- export { type AgentsFileConfig, type AuthConfig, type AuthStorageMode, BUILTIN_PROVIDER_NAMES, CONFIG_GROUP_DEFAULT_WRITE_SCOPE, CONFIG_VERSION, type CodeliaConfig, ConfigRegistry, type ConfigWriteGroup, type ConfigWriteScope, type ExecutionEnvironmentConfig, type ExecutionEnvironmentStartupChecksConfig, type ExecutionEnvironmentStartupChecksMode, type ExperimentalConfig, GOOGLE_IMAGE_MODELS, type GoogleImageOptions, type ImageGenerationConfig, type ImageProviderOptions, type McpConfig, type McpServerConfig, type ModelConfig, type OAuthBrowserMode, OPENAI_CODEX_IMAGE_MODELS, OPENAI_IMAGE_MODELS, type OpenAiExperimentalConfig, type OpenAiImageOptions, type OpenRouterImageOptions, type PermissionRule, type PermissionsConfig, type ResponsesModelConfig, type ResponsesProviderConfig, SUBAGENT_MAX_CONCURRENT_LIMIT, type SearchConfig, type SearchMode, type SkillsConfig, type SubagentConfig, type TuiColorScheme, type TuiConfig, type TuiImageProtocol, type UpdateConfig, type UpdateMode, configRegistry, isValidUpdateChannel, normalizePermissionRule, parseConfig, parseImageGenerationConfig, parseResponsesProviders, parseUpdateMode };
258
+ export { type AgentsFileConfig, type AuthConfig, type AuthStorageMode, BUILTIN_PROVIDER_NAMES, CONFIG_GROUP_DEFAULT_WRITE_SCOPE, CONFIG_VERSION, type CodeliaConfig, ConfigRegistry, type ConfigWriteGroup, type ConfigWriteScope, type ExecutionEnvironmentConfig, type ExecutionEnvironmentStartupChecksConfig, type ExecutionEnvironmentStartupChecksMode, type ExperimentalConfig, GOOGLE_IMAGE_MODELS, type GoogleImageOptions, type ImageGenerationConfig, type ImageProviderOptions, type McpConfig, type McpServerConfig, type ModelConfig, type OAuthBrowserMode, OPENAI_CODEX_IMAGE_MODELS, OPENAI_IMAGE_MODELS, type OpenAiExperimentalConfig, type OpenAiImageOptions, type OpenRouterImageOptions, type PermissionRule, type PermissionsConfig, type ResponsesModelConfig, type ResponsesProviderConfig, SUBAGENT_MAX_CONCURRENT_LIMIT, type SearchConfig, type SearchMode, type SkillsConfig, type SubagentConfig, type TuiColorScheme, type TuiConfig, type TuiImageProtocol, type UpdateConfig, type UpdateMode, type WorktreeConfig, configRegistry, isValidUpdateChannel, normalizePermissionRule, parseConfig, parseImageGenerationConfig, parseResponsesProviders, parseUpdateMode };
package/dist/index.js CHANGED
@@ -293,7 +293,8 @@ var CONFIG_GROUP_DEFAULT_WRITE_SCOPE = {
293
293
  search: "project",
294
294
  image_generation: "global",
295
295
  tui: "global",
296
- update: "global"
296
+ update: "global",
297
+ worktree: "global"
297
298
  };
298
299
  var CONFIG_VERSION = 1;
299
300
  var MCP_SERVER_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;
@@ -687,6 +688,36 @@ var parseUpdateConfig = (value, source) => {
687
688
  }
688
689
  return Object.keys(result).length > 0 ? result : void 0;
689
690
  };
691
+ function parseWorktreeConfig(value, source) {
692
+ if (!isRecord(value))
693
+ throw new Error(`${source}: worktree must be an object`);
694
+ const { include_files, use_worktreeinclude, setup_command } = value;
695
+ const config = {};
696
+ if (include_files !== void 0) {
697
+ if (!Array.isArray(include_files) || include_files.some(
698
+ (entry) => typeof entry !== "string" || !entry.trim() || /[\r\n\0]/.test(entry)
699
+ ))
700
+ throw new Error(
701
+ `${source}: worktree.include_files must contain nonempty single-line patterns`
702
+ );
703
+ config.include_files = include_files;
704
+ }
705
+ if (use_worktreeinclude !== void 0) {
706
+ if (typeof use_worktreeinclude !== "boolean")
707
+ throw new Error(
708
+ `${source}: worktree.use_worktreeinclude must be boolean`
709
+ );
710
+ config.use_worktreeinclude = use_worktreeinclude;
711
+ }
712
+ if (setup_command !== void 0) {
713
+ if (typeof setup_command !== "string" || !setup_command.trim() || setup_command.includes("\0"))
714
+ throw new Error(
715
+ `${source}: worktree.setup_command must be a nonempty command`
716
+ );
717
+ config.setup_command = setup_command;
718
+ }
719
+ return config;
720
+ }
690
721
  var parseConfig = (value, sourceLabel) => {
691
722
  if (!isRecord(value)) {
692
723
  throw new Error(`${sourceLabel}: config must be an object`);
@@ -748,6 +779,8 @@ var parseConfig = (value, sourceLabel) => {
748
779
  result.tui = tui;
749
780
  }
750
781
  if (update) result.update = update;
782
+ if (value.worktree !== void 0)
783
+ result.worktree = parseWorktreeConfig(value.worktree, sourceLabel);
751
784
  return result;
752
785
  };
753
786
  var ConfigRegistry = class {
@@ -897,6 +930,11 @@ var ConfigRegistry = class {
897
930
  if (layer?.update) {
898
931
  merged.update = { ...merged.update ?? {}, ...layer.update };
899
932
  }
933
+ if (layer?.worktree)
934
+ merged.worktree = {
935
+ ...merged.worktree,
936
+ ...structuredClone(layer.worktree)
937
+ };
900
938
  }
901
939
  return merged;
902
940
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codelia/config",
3
- "version": "0.1.93",
3
+ "version": "0.1.94",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [