@omnidev-ai/core 0.9.0 → 0.10.1

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
@@ -330,11 +330,6 @@ interface CapabilityExports {
330
330
  module?: string;
331
331
  gitignore?: string[];
332
332
  }
333
- interface EnvDeclaration {
334
- required?: boolean;
335
- secret?: boolean;
336
- default?: string;
337
- }
338
333
  interface SyncConfig {
339
334
  on_sync?: string;
340
335
  }
@@ -344,7 +339,6 @@ interface CliConfig {
344
339
  interface CapabilityConfig {
345
340
  capability: CapabilityMetadata;
346
341
  exports?: CapabilityExports;
347
- env?: Record<string, EnvDeclaration | Record<string, never>>;
348
342
  mcp?: McpConfig;
349
343
  sync?: SyncConfig;
350
344
  cli?: CliConfig;
@@ -360,7 +354,7 @@ interface McpToolSchema {
360
354
  *
361
355
  * - **stdio**: Local process using stdin/stdout (default)
362
356
  * - Requires: command
363
- * - Optional: args, env, cwd
357
+ * - Optional: args, cwd
364
358
  *
365
359
  * - **http**: Remote HTTP server (recommended for remote servers)
366
360
  * - Requires: url
@@ -462,8 +456,17 @@ interface GitCapabilitySourceConfig {
462
456
  /** Subdirectory within the repo containing the capability */
463
457
  path?: string;
464
458
  }
459
+ /** Configuration for a local file-sourced capability */
460
+ interface FileCapabilitySourceConfig {
461
+ /** Source path with file:// prefix (e.g., "file://./capabilities/my-cap") */
462
+ source: string;
463
+ }
465
464
  /** Combined type for all capability source configurations */
466
- type CapabilitySourceConfig = string | GitCapabilitySourceConfig;
465
+ type CapabilitySourceConfig = string | GitCapabilitySourceConfig | FileCapabilitySourceConfig;
466
+ /**
467
+ * Type guard to check if a source config is a FileCapabilitySourceConfig
468
+ */
469
+ declare function isFileSourceConfig(config: CapabilitySourceConfig): config is FileCapabilitySourceConfig;
467
470
  /** Lock file entry for a capability (version tracking) */
468
471
  interface CapabilityLockEntry {
469
472
  /** Original source reference */
@@ -499,7 +502,6 @@ interface OmniConfig {
499
502
  project?: string;
500
503
  active_profile?: string;
501
504
  always_enabled_capabilities?: string[];
502
- env?: Record<string, string>;
503
505
  profiles?: Record<string, ProfileConfig>;
504
506
  providers?: {
505
507
  enabled?: Provider[];
@@ -554,7 +556,7 @@ interface SyncBundle {
554
556
  subagents: Subagent[];
555
557
  /** Merged hooks from all capabilities */
556
558
  hooks?: HooksConfig;
557
- instructionsPath: string;
559
+ /** Generated instructions content from rules and docs, embedded directly into provider files */
558
560
  instructionsContent: string;
559
561
  }
560
562
  interface ProviderContext {
@@ -612,14 +614,11 @@ declare function discoverCapabilities(): Promise<string[]>;
612
614
  declare function loadCapabilityConfig(capabilityPath: string): Promise<CapabilityConfig>;
613
615
  /**
614
616
  * Loads a complete capability including config, skills, rules, docs, and exports.
615
- * Validates environment requirements before loading.
616
- *
617
617
  * @param capabilityPath - Path to the capability directory
618
- * @param env - Environment variables to validate against
619
618
  * @returns Fully loaded capability
620
- * @throws Error if validation fails or loading errors occur
619
+ * @throws Error if loading errors occur
621
620
  */
622
- declare function loadCapability(capabilityPath: string, env: Record<string, string>): Promise<LoadedCapability>;
621
+ declare function loadCapability(capabilityPath: string): Promise<LoadedCapability>;
623
622
  /**
624
623
  * Registry of loaded capabilities with helper functions.
625
624
  */
@@ -649,13 +648,6 @@ declare function buildCapabilityRegistry(): Promise<CapabilityRegistry>;
649
648
  * @returns Array of Rule objects
650
649
  */
651
650
  declare function loadRules(capabilityPath: string, capabilityId: string): Promise<Rule[]>;
652
- /**
653
- * Write aggregated rules and docs to .omni/instructions.md
654
- * Updates the generated section between markers while preserving user content
655
- * @param rules Array of rules from all enabled capabilities
656
- * @param docs Array of docs from all enabled capabilities
657
- */
658
- declare function writeRules(rules: Rule[], docs?: Doc[]): Promise<void>;
659
651
  declare function loadSkills(capabilityPath: string, capabilityId: string): Promise<Skill[]>;
660
652
  interface FetchResult {
661
653
  id: string;
@@ -674,10 +666,27 @@ interface SourceUpdateInfo {
674
666
  hasUpdate: boolean;
675
667
  }
676
668
  /**
669
+ * Check if a source string is a git source
670
+ */
671
+ declare function isGitSource(source: string): boolean;
672
+ /**
673
+ * Check if a source string is a file source
674
+ */
675
+ declare function isFileSource(source: string): boolean;
676
+ /**
677
+ * Parse a file:// source to get the actual file path
678
+ */
679
+ declare function parseFileSourcePath(source: string): string;
680
+ /**
681
+ * Read the capability ID from a capability directory
682
+ * Tries to read from capability.toml first, then falls back to directory name
683
+ */
684
+ declare function readCapabilityIdFromPath(capabilityPath: string): Promise<string | null>;
685
+ /**
677
686
  * Parse a capability source string or config into normalized form
678
- * Returns a GitCapabilitySourceConfig
687
+ * Returns a GitCapabilitySourceConfig or FileCapabilitySourceConfig
679
688
  */
680
- declare function parseSourceConfig(source: CapabilitySourceConfig): GitCapabilitySourceConfig;
689
+ declare function parseSourceConfig(source: CapabilitySourceConfig): GitCapabilitySourceConfig | FileCapabilitySourceConfig;
681
690
  /**
682
691
  * Convert source to a git-cloneable URL
683
692
  */
@@ -721,7 +730,7 @@ interface DiscoveredContent {
721
730
  docsDir: string | null;
722
731
  }
723
732
  /**
724
- * Fetch a single capability source from git
733
+ * Fetch a single capability source (git or file)
725
734
  */
726
735
  declare function fetchCapabilitySource(id: string, sourceConfig: CapabilitySourceConfig, options?: {
727
736
  silent?: boolean;
@@ -902,32 +911,6 @@ declare function enableCapability(capabilityId: string): Promise<void>;
902
911
  */
903
912
  declare function disableCapability(capabilityId: string): Promise<void>;
904
913
  /**
905
- * Load environment variables from .omni/.env file and merge with process.env.
906
- * Process environment variables take precedence over file values.
907
- *
908
- * @returns Merged environment variables
909
- */
910
- declare function loadEnvironment(): Promise<Record<string, string>>;
911
- /**
912
- * Validate that all required environment variables are present.
913
- * Checks declarations from capability config and throws descriptive errors for missing vars.
914
- *
915
- * @param declarations - Environment variable declarations from capability.toml
916
- * @param env - Loaded environment variables
917
- * @param capabilityId - ID of the capability being validated
918
- * @throws Error if required environment variables are missing
919
- */
920
- declare function validateEnv(declarations: Record<string, EnvDeclaration | Record<string, never>>, env: Record<string, string | undefined>, capabilityId: string): void;
921
- /**
922
- * Check if an environment variable should be treated as a secret.
923
- * Secrets should be masked in logs and error messages.
924
- *
925
- * @param key - Environment variable name
926
- * @param declarations - Environment variable declarations from capability.toml
927
- * @returns true if the variable is marked as secret
928
- */
929
- declare function isSecretEnvVar(key: string, declarations: Record<string, EnvDeclaration | Record<string, never>>): boolean;
930
- /**
931
914
  * Load only the base config file (omni.toml) without merging local overrides.
932
915
  * Use this when you need to modify and write back to omni.toml.
933
916
  * @returns OmniConfig from omni.toml only
@@ -1184,19 +1167,42 @@ declare function buildSyncBundle(options?: {
1184
1167
  declare function syncAgentConfiguration(options?: SyncOptions): Promise<SyncResult>;
1185
1168
  /**
1186
1169
  * Template for AGENTS.md (Codex provider)
1187
- * Creates a minimal file with reference to OmniDev instructions
1170
+ * Creates a minimal file - actual content is generated during sync from OMNI.md + instructions
1188
1171
  */
1189
1172
  declare function generateAgentsTemplate(): string;
1190
1173
  /**
1191
- * Template for CLAUDE.md (Claude provider)
1192
- * Creates a minimal file with reference to OmniDev instructions
1174
+ * Templates for bootstrapping new capabilities.
1193
1175
  */
1194
- declare function generateClaudeTemplate(): string;
1176
+ interface CapabilityTemplateOptions {
1177
+ id: string;
1178
+ name: string;
1179
+ description?: string;
1180
+ }
1181
+ /**
1182
+ * Generate a capability.toml file for a new capability.
1183
+ */
1184
+ declare function generateCapabilityToml(options: CapabilityTemplateOptions): string;
1185
+ /**
1186
+ * Generate a SKILL.md template file.
1187
+ */
1188
+ declare function generateSkillTemplate(skillName: string): string;
1195
1189
  /**
1196
- * Template for .omni/instructions.md
1197
- * Contains OmniDev-specific instructions and capability rules
1190
+ * Generate a rule markdown template file.
1198
1191
  */
1199
- declare function generateInstructionsTemplate(): string;
1192
+ declare function generateRuleTemplate(ruleName: string): string;
1193
+ /**
1194
+ * Generate a hooks.toml template file.
1195
+ */
1196
+ declare function generateHooksTemplate(): string;
1197
+ /**
1198
+ * Generate a sample hook script.
1199
+ */
1200
+ declare function generateHookScript(): string;
1201
+ /**
1202
+ * Template for CLAUDE.md (Claude provider)
1203
+ * Creates a minimal file - actual content is generated during sync from OMNI.md + instructions
1204
+ */
1205
+ declare function generateClaudeTemplate(): string;
1200
1206
  /**
1201
1207
  * Template for OMNI.md - the user's project instructions file.
1202
1208
  * This is the single source of truth that gets transformed into
@@ -1209,4 +1215,4 @@ declare function generateOmniMdTemplate(): string;
1209
1215
  declare function debug(message: string, data?: unknown): void;
1210
1216
  declare const version = "0.1.0";
1211
1217
  declare function getVersion(): string;
1212
- export { writeRules, writeProviderConfig, writeMcpJson, writeEnabledProviders, writeConfig, writeActiveProfileState, version, validateHooksConfig, validateHook, validateEnv, transformToOmnidev, transformToClaude, transformHooksConfig, syncMcpJson, syncAgentConfiguration, sourceToGitUrl, setProfile, setActiveProfile, saveManifest, saveLockFile, resolveEnabledCapabilities, readMcpJson, readEnabledProviders, readActiveProfileState, patchAddToProfile, patchAddMcp, patchAddCapabilitySource, parseSourceConfig, parseProviderFlag, parseOmniConfig, parseCapabilityConfig, mergeHooksConfigs, mergeAndDeduplicateHooks, loadSubagents, loadSkills, loadRules, loadProviderConfig, loadProfileConfig, loadManifest, loadLockFile, loadHooksFromCapability, loadEnvironment, loadDocs, loadConfig, loadCommands, loadCapabilityHooks, loadCapabilityConfig, loadCapability, loadBaseConfig, isValidMatcherPattern, isSecretEnvVar, isProviderEnabled, isPromptHookEvent, isMatcherEvent, isHookType, isHookPrompt, isHookEvent, isHookCommand, installCapabilityDependencies, hasHooks, hasAnyHooks, getVersion, getSourceCapabilityPath, getLockFilePath, getHooksDirectory, getHooksConfigPath, getEventsWithHooks, getEnabledCapabilities, getActiveProviders, getActiveProfile, generateOmniMdTemplate, generateInstructionsTemplate, generateClaudeTemplate, generateAgentsTemplate, findDuplicateCommands, fetchCapabilitySource, fetchAllCapabilitySources, enableProvider, enableCapability, discoverCapabilities, disableProvider, disableCapability, debug, createEmptyValidationResult, createEmptyHooksConfig, countHooks, containsOmnidevVariables, containsClaudeVariables, clearActiveProfileState, cleanupStaleResources, checkForUpdates, buildSyncBundle, buildRouteMap, buildManifestFromCapabilities, buildCommand, buildCapabilityRegistry, ValidationSeverity, VARIABLE_MAPPINGS, SyncResult, SyncOptions, SyncConfig, SyncBundle, SubagentPermissionMode, SubagentModel, SubagentHooks, SubagentHookConfig, SubagentExport, Subagent, SourceUpdateInfo, SkillExport, Skill, SessionStartMatcher, SESSION_START_MATCHERS, Rule, ResourceManifest, ProvidersState, ProviderSyncResult, ProviderManifest, ProviderInitResult, ProviderId, ProviderContext, ProviderConfig, ProviderAdapter, Provider, PromptHookEvent, ProfileConfig, PreCompactMatcher, PROMPT_HOOK_EVENTS, PRE_COMPACT_MATCHERS, OmnidevVariable, OmniConfig, NotificationMatcher, NOTIFICATION_MATCHERS, McpTransport, McpToolSchema, McpServerStdioConfig, McpServerSseConfig, McpServerHttpConfig, McpServerConfig, McpJsonConfig, McpConfig, MatcherEvent, MATCHER_EVENTS, LoadedCapability, LoadHooksResult, LoadHooksOptions, HooksDoctorResult, HooksDoctorCheck, HooksConfig, HookValidationResult, HookValidationIssue, HookValidationCode, HookType, HookPrompt, HookMatcher, HookEvent, HookCommand, Hook, HOOK_TYPES, HOOK_EVENTS, HOOKS_DIRECTORY, HOOKS_CONFIG_FILENAME, GitCapabilitySourceConfig, FileContent, FetchResult, EnvDeclaration, DoctorCheckStatus, DocExport, Doc, DiscoveredContent, DeduplicateOptions, DEFAULT_PROMPT_TIMEOUT, DEFAULT_COMMAND_TIMEOUT, CommandExport, Command, CliConfig, CleanupResult, ClaudeVariable, CapabilitySourceType, CapabilitySourceConfig, CapabilitySource, CapabilityResources, CapabilityRegistry, CapabilityMetadata, CapabilityLockEntry, CapabilityHooks, CapabilityExports, CapabilityExport, CapabilityConfig, CapabilitiesLockFile, CapabilitiesConfig, COMMON_TOOL_MATCHERS };
1218
+ export { writeProviderConfig, writeMcpJson, writeEnabledProviders, writeConfig, writeActiveProfileState, version, validateHooksConfig, validateHook, transformToOmnidev, transformToClaude, transformHooksConfig, syncMcpJson, syncAgentConfiguration, sourceToGitUrl, setProfile, setActiveProfile, saveManifest, saveLockFile, resolveEnabledCapabilities, readMcpJson, readEnabledProviders, readCapabilityIdFromPath, readActiveProfileState, patchAddToProfile, patchAddMcp, patchAddCapabilitySource, parseSourceConfig, parseProviderFlag, parseOmniConfig, parseFileSourcePath, parseCapabilityConfig, mergeHooksConfigs, mergeAndDeduplicateHooks, loadSubagents, loadSkills, loadRules, loadProviderConfig, loadProfileConfig, loadManifest, loadLockFile, loadHooksFromCapability, loadDocs, loadConfig, loadCommands, loadCapabilityHooks, loadCapabilityConfig, loadCapability, loadBaseConfig, isValidMatcherPattern, isProviderEnabled, isPromptHookEvent, isMatcherEvent, isHookType, isHookPrompt, isHookEvent, isHookCommand, isGitSource, isFileSourceConfig, isFileSource, installCapabilityDependencies, hasHooks, hasAnyHooks, getVersion, getSourceCapabilityPath, getLockFilePath, getHooksDirectory, getHooksConfigPath, getEventsWithHooks, getEnabledCapabilities, getActiveProviders, getActiveProfile, generateSkillTemplate, generateRuleTemplate, generateOmniMdTemplate, generateHooksTemplate, generateHookScript, generateClaudeTemplate, generateCapabilityToml, generateAgentsTemplate, findDuplicateCommands, fetchCapabilitySource, fetchAllCapabilitySources, enableProvider, enableCapability, discoverCapabilities, disableProvider, disableCapability, debug, createEmptyValidationResult, createEmptyHooksConfig, countHooks, containsOmnidevVariables, containsClaudeVariables, clearActiveProfileState, cleanupStaleResources, checkForUpdates, buildSyncBundle, buildRouteMap, buildManifestFromCapabilities, buildCommand, buildCapabilityRegistry, ValidationSeverity, VARIABLE_MAPPINGS, SyncResult, SyncOptions, SyncConfig, SyncBundle, SubagentPermissionMode, SubagentModel, SubagentHooks, SubagentHookConfig, SubagentExport, Subagent, SourceUpdateInfo, SkillExport, Skill, SessionStartMatcher, SESSION_START_MATCHERS, Rule, ResourceManifest, ProvidersState, ProviderSyncResult, ProviderManifest, ProviderInitResult, ProviderId, ProviderContext, ProviderConfig, ProviderAdapter, Provider, PromptHookEvent, ProfileConfig, PreCompactMatcher, PROMPT_HOOK_EVENTS, PRE_COMPACT_MATCHERS, OmnidevVariable, OmniConfig, NotificationMatcher, NOTIFICATION_MATCHERS, McpTransport, McpToolSchema, McpServerStdioConfig, McpServerSseConfig, McpServerHttpConfig, McpServerConfig, McpJsonConfig, McpConfig, MatcherEvent, MATCHER_EVENTS, LoadedCapability, LoadHooksResult, LoadHooksOptions, HooksDoctorResult, HooksDoctorCheck, HooksConfig, HookValidationResult, HookValidationIssue, HookValidationCode, HookType, HookPrompt, HookMatcher, HookEvent, HookCommand, Hook, HOOK_TYPES, HOOK_EVENTS, HOOKS_DIRECTORY, HOOKS_CONFIG_FILENAME, GitCapabilitySourceConfig, FileContent, FileCapabilitySourceConfig, FetchResult, DoctorCheckStatus, DocExport, Doc, DiscoveredContent, DeduplicateOptions, DEFAULT_PROMPT_TIMEOUT, DEFAULT_COMMAND_TIMEOUT, CommandExport, Command, CliConfig, CleanupResult, ClaudeVariable, CapabilityTemplateOptions, CapabilitySourceType, CapabilitySourceConfig, CapabilitySource, CapabilityResources, CapabilityRegistry, CapabilityMetadata, CapabilityLockEntry, CapabilityHooks, CapabilityExports, CapabilityExport, CapabilityConfig, CapabilitiesLockFile, CapabilitiesConfig, COMMON_TOOL_MATCHERS };