@omnidev-ai/core 0.9.0 → 0.10.0

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
@@ -462,8 +462,17 @@ interface GitCapabilitySourceConfig {
462
462
  /** Subdirectory within the repo containing the capability */
463
463
  path?: string;
464
464
  }
465
+ /** Configuration for a local file-sourced capability */
466
+ interface FileCapabilitySourceConfig {
467
+ /** Source path with file:// prefix (e.g., "file://./capabilities/my-cap") */
468
+ source: string;
469
+ }
465
470
  /** Combined type for all capability source configurations */
466
- type CapabilitySourceConfig = string | GitCapabilitySourceConfig;
471
+ type CapabilitySourceConfig = string | GitCapabilitySourceConfig | FileCapabilitySourceConfig;
472
+ /**
473
+ * Type guard to check if a source config is a FileCapabilitySourceConfig
474
+ */
475
+ declare function isFileSourceConfig(config: CapabilitySourceConfig): config is FileCapabilitySourceConfig;
467
476
  /** Lock file entry for a capability (version tracking) */
468
477
  interface CapabilityLockEntry {
469
478
  /** Original source reference */
@@ -554,7 +563,7 @@ interface SyncBundle {
554
563
  subagents: Subagent[];
555
564
  /** Merged hooks from all capabilities */
556
565
  hooks?: HooksConfig;
557
- instructionsPath: string;
566
+ /** Generated instructions content from rules and docs, embedded directly into provider files */
558
567
  instructionsContent: string;
559
568
  }
560
569
  interface ProviderContext {
@@ -649,13 +658,6 @@ declare function buildCapabilityRegistry(): Promise<CapabilityRegistry>;
649
658
  * @returns Array of Rule objects
650
659
  */
651
660
  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
661
  declare function loadSkills(capabilityPath: string, capabilityId: string): Promise<Skill[]>;
660
662
  interface FetchResult {
661
663
  id: string;
@@ -674,10 +676,27 @@ interface SourceUpdateInfo {
674
676
  hasUpdate: boolean;
675
677
  }
676
678
  /**
679
+ * Check if a source string is a git source
680
+ */
681
+ declare function isGitSource(source: string): boolean;
682
+ /**
683
+ * Check if a source string is a file source
684
+ */
685
+ declare function isFileSource(source: string): boolean;
686
+ /**
687
+ * Parse a file:// source to get the actual file path
688
+ */
689
+ declare function parseFileSourcePath(source: string): string;
690
+ /**
691
+ * Read the capability ID from a capability directory
692
+ * Tries to read from capability.toml first, then falls back to directory name
693
+ */
694
+ declare function readCapabilityIdFromPath(capabilityPath: string): Promise<string | null>;
695
+ /**
677
696
  * Parse a capability source string or config into normalized form
678
- * Returns a GitCapabilitySourceConfig
697
+ * Returns a GitCapabilitySourceConfig or FileCapabilitySourceConfig
679
698
  */
680
- declare function parseSourceConfig(source: CapabilitySourceConfig): GitCapabilitySourceConfig;
699
+ declare function parseSourceConfig(source: CapabilitySourceConfig): GitCapabilitySourceConfig | FileCapabilitySourceConfig;
681
700
  /**
682
701
  * Convert source to a git-cloneable URL
683
702
  */
@@ -721,7 +740,7 @@ interface DiscoveredContent {
721
740
  docsDir: string | null;
722
741
  }
723
742
  /**
724
- * Fetch a single capability source from git
743
+ * Fetch a single capability source (git or file)
725
744
  */
726
745
  declare function fetchCapabilitySource(id: string, sourceConfig: CapabilitySourceConfig, options?: {
727
746
  silent?: boolean;
@@ -1184,19 +1203,42 @@ declare function buildSyncBundle(options?: {
1184
1203
  declare function syncAgentConfiguration(options?: SyncOptions): Promise<SyncResult>;
1185
1204
  /**
1186
1205
  * Template for AGENTS.md (Codex provider)
1187
- * Creates a minimal file with reference to OmniDev instructions
1206
+ * Creates a minimal file - actual content is generated during sync from OMNI.md + instructions
1188
1207
  */
1189
1208
  declare function generateAgentsTemplate(): string;
1190
1209
  /**
1191
- * Template for CLAUDE.md (Claude provider)
1192
- * Creates a minimal file with reference to OmniDev instructions
1210
+ * Templates for bootstrapping new capabilities.
1193
1211
  */
1194
- declare function generateClaudeTemplate(): string;
1212
+ interface CapabilityTemplateOptions {
1213
+ id: string;
1214
+ name: string;
1215
+ description?: string;
1216
+ }
1217
+ /**
1218
+ * Generate a capability.toml file for a new capability.
1219
+ */
1220
+ declare function generateCapabilityToml(options: CapabilityTemplateOptions): string;
1221
+ /**
1222
+ * Generate a SKILL.md template file.
1223
+ */
1224
+ declare function generateSkillTemplate(skillName: string): string;
1195
1225
  /**
1196
- * Template for .omni/instructions.md
1197
- * Contains OmniDev-specific instructions and capability rules
1226
+ * Generate a rule markdown template file.
1198
1227
  */
1199
- declare function generateInstructionsTemplate(): string;
1228
+ declare function generateRuleTemplate(ruleName: string): string;
1229
+ /**
1230
+ * Generate a hooks.toml template file.
1231
+ */
1232
+ declare function generateHooksTemplate(): string;
1233
+ /**
1234
+ * Generate a sample hook script.
1235
+ */
1236
+ declare function generateHookScript(): string;
1237
+ /**
1238
+ * Template for CLAUDE.md (Claude provider)
1239
+ * Creates a minimal file - actual content is generated during sync from OMNI.md + instructions
1240
+ */
1241
+ declare function generateClaudeTemplate(): string;
1200
1242
  /**
1201
1243
  * Template for OMNI.md - the user's project instructions file.
1202
1244
  * This is the single source of truth that gets transformed into
@@ -1209,4 +1251,4 @@ declare function generateOmniMdTemplate(): string;
1209
1251
  declare function debug(message: string, data?: unknown): void;
1210
1252
  declare const version = "0.1.0";
1211
1253
  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 };
1254
+ export { writeProviderConfig, writeMcpJson, writeEnabledProviders, writeConfig, writeActiveProfileState, version, validateHooksConfig, validateHook, validateEnv, 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, loadEnvironment, loadDocs, loadConfig, loadCommands, loadCapabilityHooks, loadCapabilityConfig, loadCapability, loadBaseConfig, isValidMatcherPattern, isSecretEnvVar, 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, EnvDeclaration, 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 };