@nuucognition/cli-core 0.0.1-beta.0 → 0.0.1-beta.2

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.d.ts CHANGED
@@ -86,6 +86,14 @@ declare function ensureConfigDirSync(cliname: string): string;
86
86
  declare function resolveConfig(options: ConfigOptions): Promise<Record<string, unknown>>;
87
87
  declare function resolveConfigSync(options: ConfigOptions): Record<string, unknown>;
88
88
 
89
+ declare function readConfigFile(path: string): Promise<Record<string, unknown> | null>;
90
+ declare function readConfigFileSync(path: string): Record<string, unknown> | null;
91
+ declare function writeConfigFile(path: string, data: Record<string, unknown>): Promise<void>;
92
+ declare function setConfigField(path: string, key: string, value: unknown): Promise<void>;
93
+ declare function removeConfigField(path: string, key: string): Promise<void>;
94
+ declare function setFeatureOverride(path: string, featureId: string, enabled: boolean): Promise<void>;
95
+ declare function removeFeatureOverride(path: string, featureId: string): Promise<void>;
96
+
89
97
  declare function createFeatureRegistry(features: FeatureDefinition[]): FeatureRegistry;
90
98
  declare function getFeature(registry: FeatureRegistry, id: string): FeatureDefinition | undefined;
91
99
  declare function getFeaturesByTier(registry: FeatureRegistry, tier: FeatureTier): FeatureDefinition[];
@@ -147,4 +155,4 @@ declare class AuthRequiredError extends CliError {
147
155
  constructor(featureId: string, cliname: string);
148
156
  }
149
157
 
150
- export { type AuthCommandFactoryConfig, type AuthEnvironment, AuthRequiredError, CliError, type ConfigOptions, type FeatureCheck, type FeatureContext, type FeatureDefinition, FeatureNotAvailableError, type FeatureRegistry, type FeatureTier, type FeatureType, type LoginConfig, type ModeConfig, NUU_ACCOUNT_URL_DEV, NUU_ACCOUNT_URL_PROD, type NuuCredentials, type ResolvedRuntime, type RuntimeMode, TIER_ALIASES, bold, checkFeature, clearAuth, createFeatureRegistry, createLoginCommand, createLogoutCommand, createWhoamiCommand, dim, ensureConfigDir, ensureConfigDirSync, ensureNuuDir, error, getCommandFeatures, getConfigDir, getConfigPath, getFeature, getFeaturesByTier, getFeaturesByType, getNuuDir, getValidAuth, hasAuth, hasFeature, info, isAuthExpired, isFeatureEnabled, isTierEnabled, isValidTier, loadAuth, loadAuthSync, normalizeRuntimeMode, normalizeTier, refreshAuth, requireFeature, requireValidAuth, resetExperimental, resetFeatureEnabled, resetMode, resolveConfig, resolveConfigSync, resolveRuntime, resolveRuntimeSync, saveAuth, scopedEnvVar, scopedEnvVarTrue, setAuthVerbose, setExperimental, setFeatureEnabled, setMode, shouldRefreshAuth, startLoginFlow, success, warn };
158
+ export { type AuthCommandFactoryConfig, type AuthEnvironment, AuthRequiredError, CliError, type ConfigOptions, type FeatureCheck, type FeatureContext, type FeatureDefinition, FeatureNotAvailableError, type FeatureRegistry, type FeatureTier, type FeatureType, type LoginConfig, type ModeConfig, NUU_ACCOUNT_URL_DEV, NUU_ACCOUNT_URL_PROD, type NuuCredentials, type ResolvedRuntime, type RuntimeMode, TIER_ALIASES, bold, checkFeature, clearAuth, createFeatureRegistry, createLoginCommand, createLogoutCommand, createWhoamiCommand, dim, ensureConfigDir, ensureConfigDirSync, ensureNuuDir, error, getCommandFeatures, getConfigDir, getConfigPath, getFeature, getFeaturesByTier, getFeaturesByType, getNuuDir, getValidAuth, hasAuth, hasFeature, info, isAuthExpired, isFeatureEnabled, isTierEnabled, isValidTier, loadAuth, loadAuthSync, normalizeRuntimeMode, normalizeTier, readConfigFile, readConfigFileSync, refreshAuth, removeConfigField, removeFeatureOverride, requireFeature, requireValidAuth, resetExperimental, resetFeatureEnabled, resetMode, resolveConfig, resolveConfigSync, resolveRuntime, resolveRuntimeSync, saveAuth, scopedEnvVar, scopedEnvVarTrue, setAuthVerbose, setConfigField, setExperimental, setFeatureEnabled, setFeatureOverride, setMode, shouldRefreshAuth, startLoginFlow, success, warn, writeConfigFile };
package/dist/index.js CHANGED
@@ -130,7 +130,7 @@ async function removeFeatureOverride(path, featureId) {
130
130
  // src/config/index.ts
131
131
  var CONFIG_FILENAME = "config.toml";
132
132
  function getConfigDir(cliname) {
133
- return join(homedir(), ".nuucognition", `.${cliname}`);
133
+ return join(homedir(), ".nuucognition", cliname);
134
134
  }
135
135
  function getConfigPath(cliname) {
136
136
  return join(getConfigDir(cliname), CONFIG_FILENAME);
@@ -719,7 +719,7 @@ function tierInstruction(requiredTier, cliname, featureId) {
719
719
  }
720
720
  return [
721
721
  `Run \`${cliname} --enable ${featureId}\` for one invocation`,
722
- `or set \`[features].${featureId} = true\` in \`~/.nuucognition/.${cliname}/config.toml\`.`
722
+ `or set \`[features].${featureId} = true\` in \`~/.nuucognition/${cliname}/config.toml\`.`
723
723
  ];
724
724
  }
725
725
  var FeatureNotAvailableError = class extends CliError {
@@ -984,7 +984,11 @@ export {
984
984
  loadAuthSync,
985
985
  normalizeRuntimeMode,
986
986
  normalizeTier,
987
+ readConfigFile,
988
+ readConfigFileSync,
987
989
  refreshAuth,
990
+ removeConfigField,
991
+ removeFeatureOverride,
988
992
  requireFeature,
989
993
  requireValidAuth,
990
994
  resetExperimental,
@@ -998,11 +1002,14 @@ export {
998
1002
  scopedEnvVar,
999
1003
  scopedEnvVarTrue,
1000
1004
  setAuthVerbose,
1005
+ setConfigField,
1001
1006
  setExperimental,
1002
1007
  setFeatureEnabled,
1008
+ setFeatureOverride,
1003
1009
  setMode,
1004
1010
  shouldRefreshAuth,
1005
1011
  startLoginFlow,
1006
1012
  success,
1007
- warn
1013
+ warn,
1014
+ writeConfigFile
1008
1015
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuucognition/cli-core",
3
- "version": "0.0.1-beta.0",
3
+ "version": "0.0.1-beta.2",
4
4
  "description": "Shared CLI infrastructure for the NUU ecosystem",
5
5
  "type": "module",
6
6
  "sideEffects": false,