@omnidev-ai/core 0.4.0 → 0.5.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 +600 -664
- package/dist/index.js +1841 -1915
- package/dist/shared/chunk-1dqs11h6.js +20 -0
- package/dist/test-utils/index.d.ts +97 -101
- package/dist/test-utils/index.js +203 -234
- package/package.json +5 -3
- package/src/capability/AGENTS.md +58 -0
- package/src/capability/commands.ts +72 -0
- package/src/capability/docs.ts +48 -0
- package/src/capability/index.ts +20 -0
- package/src/capability/loader.ts +431 -0
- package/src/capability/registry.ts +55 -0
- package/src/capability/rules.ts +135 -0
- package/src/capability/skills.ts +58 -0
- package/src/capability/sources.ts +998 -0
- package/src/capability/subagents.ts +105 -0
- package/src/capability/yaml-parser.ts +81 -0
- package/src/config/AGENTS.md +46 -0
- package/src/config/capabilities.ts +54 -0
- package/src/config/env.ts +96 -0
- package/src/config/index.ts +6 -0
- package/src/config/loader.ts +207 -0
- package/src/config/parser.ts +55 -0
- package/src/config/profiles.ts +75 -0
- package/src/config/provider.ts +55 -0
- package/src/debug.ts +20 -0
- package/src/index.ts +37 -0
- package/src/mcp-json/index.ts +1 -0
- package/src/mcp-json/manager.ts +106 -0
- package/src/state/active-profile.ts +41 -0
- package/src/state/index.ts +3 -0
- package/src/state/manifest.ts +137 -0
- package/src/state/providers.ts +69 -0
- package/src/sync.ts +288 -0
- package/src/templates/agents.ts +14 -0
- package/src/templates/claude.ts +57 -0
- package/src/test-utils/helpers.ts +289 -0
- package/src/test-utils/index.ts +34 -0
- package/src/test-utils/mocks.ts +101 -0
- package/src/types/capability-export.ts +157 -0
- package/src/types/index.ts +314 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,889 +1,825 @@
|
|
|
1
1
|
import { buildCommand, buildRouteMap } from "@stricli/core";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* File content structure for programmatic file creation
|
|
13
|
-
*/
|
|
2
|
+
/**
|
|
3
|
+
* Capability Export Types
|
|
4
|
+
*
|
|
5
|
+
* These types define the structure that capabilities use to their features.
|
|
6
|
+
* Capabilities should import these types from @omnidev-ai/core and use them in their index.ts.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* File content structure for programmatic file creation
|
|
10
|
+
*/
|
|
14
11
|
interface FileContent {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
/** File name (relative path within capability) */
|
|
13
|
+
name: string;
|
|
14
|
+
/** File content */
|
|
15
|
+
content: string;
|
|
19
16
|
}
|
|
20
17
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
* Documentation structure
|
|
19
|
+
*/
|
|
23
20
|
interface DocExport {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
/** Document title */
|
|
22
|
+
title: string;
|
|
23
|
+
/** Markdown content */
|
|
24
|
+
content: string;
|
|
28
25
|
}
|
|
29
26
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
* Skill structure
|
|
28
|
+
*/
|
|
32
29
|
interface SkillExport {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
30
|
+
/** SKILL.md content (markdown with YAML frontmatter) */
|
|
31
|
+
skillMd: string;
|
|
32
|
+
/** Optional: Reference files to create (files the skill needs access to) */
|
|
33
|
+
references?: FileContent[];
|
|
34
|
+
/** Optional: Additional files to create (templates, examples, etc.) */
|
|
35
|
+
additionalFiles?: FileContent[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Subagent structure
|
|
39
|
+
*
|
|
40
|
+
* Defines a subagent that Claude can delegate tasks to.
|
|
41
|
+
* Uses YAML frontmatter in markdown format for configuration.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const codeReviewer: SubagentExport = {
|
|
46
|
+
* subagentMd: `---
|
|
47
|
+
* name: code-reviewer
|
|
48
|
+
* description: Reviews code for quality and best practices
|
|
49
|
+
* tools: Read, Glob, Grep
|
|
50
|
+
* model: sonnet
|
|
51
|
+
* ---
|
|
52
|
+
*
|
|
53
|
+
* You are a code reviewer. When invoked, analyze the code and provide
|
|
54
|
+
* specific, actionable feedback on quality, security, and best practices.`
|
|
55
|
+
* };
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
61
58
|
interface SubagentExport {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
59
|
+
/** SUBAGENT.md content (markdown with YAML frontmatter) */
|
|
60
|
+
subagentMd: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Slash command structure
|
|
64
|
+
*
|
|
65
|
+
* Defines a slash command that can be invoked in Claude Code.
|
|
66
|
+
* Uses YAML frontmatter in markdown format for configuration.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* const fixIssue: CommandExport = {
|
|
71
|
+
* commandMd: `---
|
|
72
|
+
* name: fix-issue
|
|
73
|
+
* description: Fix a GitHub issue following coding standards
|
|
74
|
+
* allowed-tools: Bash(git add:*), Bash(git commit:*)
|
|
75
|
+
* ---
|
|
76
|
+
*
|
|
77
|
+
* Fix issue #$ARGUMENTS following our coding standards.
|
|
78
|
+
*
|
|
79
|
+
* 1. Read the issue details
|
|
80
|
+
* 2. Implement the fix
|
|
81
|
+
* 3. Write tests
|
|
82
|
+
* 4. Create a commit`
|
|
83
|
+
* };
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
89
86
|
interface CommandExport {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
87
|
+
/** COMMAND.md content (markdown with YAML frontmatter) */
|
|
88
|
+
commandMd: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Complete capability structure
|
|
92
|
+
*
|
|
93
|
+
* Capabilities this as their default from index.ts.
|
|
94
|
+
* All content fields are OPTIONAL and PROGRAMMATIC.
|
|
95
|
+
* Capabilities can also provide content via static files in their directory.
|
|
96
|
+
* Both approaches are supported and will be merged during sync.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* // Static files approach - just CLI commands
|
|
101
|
+
* {
|
|
102
|
+
* cliCommands: { mycap: myRoutes },
|
|
103
|
+
* gitignore: ["mycap/"],
|
|
104
|
+
* sync
|
|
105
|
+
* } satisfies CapabilityExport;
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* // Programmatic approach - generate content dynamically
|
|
111
|
+
* {
|
|
112
|
+
* cliCommands: { mycap: myRoutes },
|
|
113
|
+
* docs: [{ title: "Guide", content: "# Guide\n..." }],
|
|
114
|
+
* rules: ["# Rule content..."],
|
|
115
|
+
* skills: [{ skillMd: "...", references: [...] }],
|
|
116
|
+
* gitignore: ["mycap/"],
|
|
117
|
+
* sync
|
|
118
|
+
* } satisfies CapabilityExport;
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
124
121
|
interface CapabilityExport {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
//#endregion
|
|
145
|
-
//#region src/types/index.d.ts
|
|
122
|
+
/** CLI commands provided by this capability */
|
|
123
|
+
cliCommands?: Record<string, unknown>;
|
|
124
|
+
/** Documentation (programmatic - optional, can also use docs/ directory) */
|
|
125
|
+
docs?: DocExport[];
|
|
126
|
+
/** Rules (programmatic - optional, can also use rules/ directory) */
|
|
127
|
+
rules?: string[];
|
|
128
|
+
/** Skills (programmatic - optional, can also use skills/ directory) */
|
|
129
|
+
skills?: SkillExport[];
|
|
130
|
+
/** Subagents (programmatic - optional, can also use subagents/ directory) */
|
|
131
|
+
subagents?: SubagentExport[];
|
|
132
|
+
/** Commands (programmatic - optional, can also use commands/ directory) */
|
|
133
|
+
commands?: CommandExport[];
|
|
134
|
+
/** Gitignore patterns */
|
|
135
|
+
gitignore?: string[];
|
|
136
|
+
/** Custom sync hook function */
|
|
137
|
+
sync?: () => Promise<void>;
|
|
138
|
+
/** Additional exports for extensibility */
|
|
139
|
+
[key: string]: unknown;
|
|
140
|
+
}
|
|
146
141
|
interface CapabilityMetadata {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
142
|
+
id: string;
|
|
143
|
+
name: string;
|
|
144
|
+
version: string;
|
|
145
|
+
description: string;
|
|
146
|
+
/** Optional author information */
|
|
147
|
+
author?: {
|
|
148
|
+
name?: string;
|
|
149
|
+
email?: string;
|
|
150
|
+
};
|
|
151
|
+
/** Optional metadata about the capability author and source */
|
|
152
|
+
metadata?: {
|
|
153
|
+
author?: string;
|
|
154
|
+
repository?: string;
|
|
155
|
+
license?: string;
|
|
156
|
+
/** True if this capability was auto-generated by wrapping a skills repo */
|
|
157
|
+
wrapped?: boolean;
|
|
158
|
+
/** For wrapped capabilities: the full commit hash */
|
|
159
|
+
commit?: string;
|
|
160
|
+
/** True if this capability was auto-generated from omni.toml [mcps] section */
|
|
161
|
+
generated_from_omni_toml?: boolean;
|
|
162
|
+
};
|
|
168
163
|
}
|
|
169
164
|
interface CapabilityExports {
|
|
170
|
-
|
|
171
|
-
|
|
165
|
+
module?: string;
|
|
166
|
+
gitignore?: string[];
|
|
172
167
|
}
|
|
173
168
|
interface EnvDeclaration {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
169
|
+
required?: boolean;
|
|
170
|
+
secret?: boolean;
|
|
171
|
+
default?: string;
|
|
177
172
|
}
|
|
178
173
|
interface SyncConfig {
|
|
179
|
-
|
|
174
|
+
on_sync?: string;
|
|
180
175
|
}
|
|
181
176
|
interface CliConfig {
|
|
182
|
-
|
|
177
|
+
commands?: string[];
|
|
183
178
|
}
|
|
184
179
|
interface CapabilityConfig {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
180
|
+
capability: CapabilityMetadata;
|
|
181
|
+
exports?: CapabilityExports;
|
|
182
|
+
env?: Record<string, EnvDeclaration | Record<string, never>>;
|
|
183
|
+
mcp?: McpConfig;
|
|
184
|
+
sync?: SyncConfig;
|
|
185
|
+
cli?: CliConfig;
|
|
191
186
|
}
|
|
192
187
|
type McpTransport = "stdio" | "sse" | "http";
|
|
193
188
|
interface McpToolSchema {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
189
|
+
name: string;
|
|
190
|
+
description: string;
|
|
191
|
+
inputSchema: Record<string, unknown>;
|
|
197
192
|
}
|
|
198
193
|
interface McpConfig {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
194
|
+
command: string;
|
|
195
|
+
args?: string[];
|
|
196
|
+
env?: Record<string, string>;
|
|
197
|
+
cwd?: string;
|
|
198
|
+
transport?: McpTransport;
|
|
199
|
+
tools?: McpToolSchema[];
|
|
205
200
|
}
|
|
206
201
|
interface Skill {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
202
|
+
name: string;
|
|
203
|
+
description: string;
|
|
204
|
+
instructions: string;
|
|
205
|
+
capabilityId: string;
|
|
211
206
|
}
|
|
212
207
|
interface Rule {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
208
|
+
name: string;
|
|
209
|
+
content: string;
|
|
210
|
+
capabilityId: string;
|
|
216
211
|
}
|
|
217
212
|
interface Doc {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
213
|
+
name: string;
|
|
214
|
+
content: string;
|
|
215
|
+
capabilityId: string;
|
|
221
216
|
}
|
|
222
217
|
type SubagentModel = "sonnet" | "opus" | "haiku" | "inherit";
|
|
223
218
|
type SubagentPermissionMode = "default" | "acceptEdits" | "dontAsk" | "bypassPermissions" | "plan";
|
|
224
219
|
interface SubagentHookConfig {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
220
|
+
matcher?: string;
|
|
221
|
+
hooks: {
|
|
222
|
+
type: "command";
|
|
223
|
+
command: string;
|
|
224
|
+
}[];
|
|
230
225
|
}
|
|
231
226
|
interface SubagentHooks {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
227
|
+
PreToolUse?: SubagentHookConfig[];
|
|
228
|
+
PostToolUse?: SubagentHookConfig[];
|
|
229
|
+
Stop?: SubagentHookConfig[];
|
|
235
230
|
}
|
|
236
231
|
interface Subagent {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
232
|
+
/** Unique identifier using lowercase letters and hyphens */
|
|
233
|
+
name: string;
|
|
234
|
+
/** When Claude should delegate to this subagent */
|
|
235
|
+
description: string;
|
|
236
|
+
/** System prompt that guides the subagent's behavior */
|
|
237
|
+
systemPrompt: string;
|
|
238
|
+
/** Tools the subagent can use (inherits all if omitted) */
|
|
239
|
+
tools?: string[];
|
|
240
|
+
/** Tools to deny (removed from inherited or specified list) */
|
|
241
|
+
disallowedTools?: string[];
|
|
242
|
+
/** Model to use: sonnet, opus, haiku, or inherit */
|
|
243
|
+
model?: SubagentModel;
|
|
244
|
+
/** Permission mode for the subagent */
|
|
245
|
+
permissionMode?: SubagentPermissionMode;
|
|
246
|
+
/** Skills to load into the subagent's context at startup */
|
|
247
|
+
skills?: string[];
|
|
248
|
+
/** Lifecycle hooks scoped to this subagent */
|
|
249
|
+
hooks?: SubagentHooks;
|
|
250
|
+
/** Capability that provides this subagent */
|
|
251
|
+
capabilityId: string;
|
|
257
252
|
}
|
|
258
253
|
interface Command {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
254
|
+
/** Command name (used as /command-name) */
|
|
255
|
+
name: string;
|
|
256
|
+
/** Brief description of what this command does */
|
|
257
|
+
description: string;
|
|
258
|
+
/** Optional allowed tools specification (e.g., "Bash(git add:*), Bash(git status:*)") */
|
|
259
|
+
allowedTools?: string;
|
|
260
|
+
/** Command prompt (markdown content with support for $ARGUMENTS, $1, $2, !`commands`, @files) */
|
|
261
|
+
prompt: string;
|
|
262
|
+
/** Capability that provides this command */
|
|
263
|
+
capabilityId: string;
|
|
269
264
|
}
|
|
270
265
|
type CapabilitySourceType = "local" | "git";
|
|
271
266
|
/** Configuration for a Git-sourced capability */
|
|
272
267
|
interface GitCapabilitySourceConfig {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
268
|
+
/** Source URL or shorthand (e.g., "github:user/repo", "git@github.com:...") */
|
|
269
|
+
source: string;
|
|
270
|
+
/** Git ref to checkout: tag, branch, or commit hash */
|
|
271
|
+
ref?: string;
|
|
272
|
+
/** Subdirectory within the repo containing the capability */
|
|
273
|
+
path?: string;
|
|
279
274
|
}
|
|
280
275
|
/** Combined type for all capability source configurations */
|
|
281
276
|
type CapabilitySourceConfig = string | GitCapabilitySourceConfig;
|
|
282
277
|
/** Lock file entry for a capability (version tracking) */
|
|
283
278
|
interface CapabilityLockEntry {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
279
|
+
/** Original source reference */
|
|
280
|
+
source: string;
|
|
281
|
+
/** Version from capability.toml or package.json */
|
|
282
|
+
version: string;
|
|
283
|
+
/** For git sources: exact commit hash */
|
|
284
|
+
commit?: string;
|
|
285
|
+
/** Pinned ref if specified */
|
|
286
|
+
ref?: string;
|
|
287
|
+
/** Last update timestamp (ISO 8601) */
|
|
288
|
+
updated_at: string;
|
|
294
289
|
}
|
|
295
290
|
/** Lock file structure (omni.lock.toml at project root) */
|
|
296
291
|
interface CapabilitiesLockFile {
|
|
297
|
-
|
|
292
|
+
capabilities: Record<string, CapabilityLockEntry>;
|
|
298
293
|
}
|
|
299
294
|
/** Capabilities configuration section in omni.toml */
|
|
300
295
|
interface CapabilitiesConfig {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
296
|
+
/** List of enabled capability IDs */
|
|
297
|
+
enable?: string[];
|
|
298
|
+
/** List of disabled capability IDs */
|
|
299
|
+
disable?: string[];
|
|
300
|
+
/** Capability sources: id -> source string or full config (git or file) */
|
|
301
|
+
sources?: Record<string, CapabilitySourceConfig>;
|
|
307
302
|
}
|
|
308
303
|
interface ProfileConfig {
|
|
309
|
-
|
|
304
|
+
capabilities?: string[];
|
|
310
305
|
}
|
|
311
306
|
interface OmniConfig {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
307
|
+
project?: string;
|
|
308
|
+
active_profile?: string;
|
|
309
|
+
always_enabled_capabilities?: string[];
|
|
310
|
+
env?: Record<string, string>;
|
|
311
|
+
profiles?: Record<string, ProfileConfig>;
|
|
312
|
+
providers?: {
|
|
313
|
+
enabled?: Provider[];
|
|
314
|
+
};
|
|
315
|
+
/** Capabilities configuration (enable/disable, sources) */
|
|
316
|
+
capabilities?: CapabilitiesConfig;
|
|
317
|
+
/** MCP server definitions that auto-generate capabilities */
|
|
318
|
+
mcps?: Record<string, McpConfig>;
|
|
324
319
|
}
|
|
325
320
|
type Provider = "claude" | "codex" | "claude-code" | "cursor" | "opencode";
|
|
326
321
|
interface ProviderConfig {
|
|
327
|
-
|
|
328
|
-
|
|
322
|
+
provider?: Provider;
|
|
323
|
+
providers?: Provider[];
|
|
329
324
|
}
|
|
330
325
|
declare function getActiveProviders(config: ProviderConfig): Provider[];
|
|
331
326
|
/** Runtime info about where a capability came from */
|
|
332
327
|
interface CapabilitySource {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
328
|
+
type: CapabilitySourceType;
|
|
329
|
+
/** For git-sourced capabilities: the source URL/shorthand */
|
|
330
|
+
gitSource?: string;
|
|
331
|
+
/** For git-sourced capabilities: the pinned ref if any */
|
|
332
|
+
ref?: string;
|
|
333
|
+
/** For git-sourced capabilities: the current commit hash */
|
|
334
|
+
commit?: string;
|
|
335
|
+
/** Version from capability.toml or package.json */
|
|
336
|
+
version?: string;
|
|
342
337
|
}
|
|
343
338
|
interface LoadedCapability {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
339
|
+
id: string;
|
|
340
|
+
path: string;
|
|
341
|
+
config: CapabilityConfig;
|
|
342
|
+
skills: Skill[];
|
|
343
|
+
rules: Rule[];
|
|
344
|
+
docs: Doc[];
|
|
345
|
+
subagents: Subagent[];
|
|
346
|
+
commands: Command[];
|
|
347
|
+
typeDefinitions?: string;
|
|
348
|
+
gitignore?: string[];
|
|
349
|
+
exports: Record<string, unknown>;
|
|
350
|
+
/** Where this capability comes from */
|
|
351
|
+
source?: CapabilitySource;
|
|
357
352
|
}
|
|
358
353
|
type ProviderId = Provider | (string & {});
|
|
359
354
|
interface SyncBundle {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
355
|
+
capabilities: LoadedCapability[];
|
|
356
|
+
skills: Skill[];
|
|
357
|
+
rules: Rule[];
|
|
358
|
+
docs: Doc[];
|
|
359
|
+
commands: Command[];
|
|
360
|
+
subagents: Subagent[];
|
|
361
|
+
instructionsPath: string;
|
|
362
|
+
instructionsContent: string;
|
|
368
363
|
}
|
|
369
364
|
interface ProviderContext {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
365
|
+
projectRoot: string;
|
|
366
|
+
config: OmniConfig;
|
|
367
|
+
activeProfile?: string;
|
|
373
368
|
}
|
|
374
369
|
interface ProviderInitResult {
|
|
375
|
-
|
|
376
|
-
|
|
370
|
+
filesCreated?: string[];
|
|
371
|
+
message?: string;
|
|
377
372
|
}
|
|
378
373
|
interface ProviderSyncResult {
|
|
379
|
-
|
|
380
|
-
|
|
374
|
+
filesWritten: string[];
|
|
375
|
+
filesDeleted: string[];
|
|
381
376
|
}
|
|
382
377
|
interface ProviderManifest {
|
|
383
|
-
|
|
384
|
-
|
|
378
|
+
files: string[];
|
|
379
|
+
lastSync: string;
|
|
385
380
|
}
|
|
386
381
|
interface ProviderAdapter {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
* Each command is a COMMAND.md file in its own subdirectory.
|
|
398
|
-
*/
|
|
382
|
+
id: ProviderId;
|
|
383
|
+
displayName: string;
|
|
384
|
+
init?(ctx: ProviderContext): Promise<ProviderInitResult>;
|
|
385
|
+
sync(bundle: SyncBundle, ctx: ProviderContext): Promise<ProviderSyncResult>;
|
|
386
|
+
cleanup?(manifest: ProviderManifest, ctx: ProviderContext): Promise<void>;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Load commands from a commands/ directory of a capability.
|
|
390
|
+
* Each command is a COMMAND.md file in its own subdirectory.
|
|
391
|
+
*/
|
|
399
392
|
declare function loadCommands(capabilityPath: string, capabilityId: string): Promise<Command[]>;
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
* @returns Array of Doc objects
|
|
408
|
-
*/
|
|
393
|
+
/**
|
|
394
|
+
* Load documentation from a capability directory
|
|
395
|
+
* Loads both definition.md and all files from docs/ directory
|
|
396
|
+
* @param capabilityPath Path to the capability directory
|
|
397
|
+
* @param capabilityId ID of the capability
|
|
398
|
+
* @returns Array of Doc objects
|
|
399
|
+
*/
|
|
409
400
|
declare function loadDocs(capabilityPath: string, capabilityId: string): Promise<Doc[]>;
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
* @returns Array of capability directory paths
|
|
417
|
-
*/
|
|
401
|
+
/**
|
|
402
|
+
* Discovers capabilities by scanning the .omni/capabilities directory.
|
|
403
|
+
* A directory is considered a capability if it contains a capability.toml file.
|
|
404
|
+
*
|
|
405
|
+
* @returns Array of capability directory paths
|
|
406
|
+
*/
|
|
418
407
|
declare function discoverCapabilities(): Promise<string[]>;
|
|
419
408
|
/**
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
409
|
+
* Loads and parses a capability configuration file.
|
|
410
|
+
* Validates required fields.
|
|
411
|
+
*
|
|
412
|
+
* @param capabilityPath - Path to the capability directory
|
|
413
|
+
* @returns Parsed capability configuration
|
|
414
|
+
* @throws Error if the config is invalid
|
|
415
|
+
*/
|
|
427
416
|
declare function loadCapabilityConfig(capabilityPath: string): Promise<CapabilityConfig>;
|
|
428
417
|
/**
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
418
|
+
* Loads a complete capability including config, skills, rules, docs, and exports.
|
|
419
|
+
* Validates environment requirements before loading.
|
|
420
|
+
*
|
|
421
|
+
* @param capabilityPath - Path to the capability directory
|
|
422
|
+
* @param env - Environment variables to validate against
|
|
423
|
+
* @returns Fully loaded capability
|
|
424
|
+
* @throws Error if validation fails or loading errors occur
|
|
425
|
+
*/
|
|
437
426
|
declare function loadCapability(capabilityPath: string, env: Record<string, string>): Promise<LoadedCapability>;
|
|
438
|
-
//#endregion
|
|
439
|
-
//#region src/capability/registry.d.ts
|
|
440
427
|
/**
|
|
441
|
-
|
|
442
|
-
|
|
428
|
+
* Registry of loaded capabilities with helper functions.
|
|
429
|
+
*/
|
|
443
430
|
interface CapabilityRegistry {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}
|
|
451
|
-
/**
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
431
|
+
capabilities: Map<string, LoadedCapability>;
|
|
432
|
+
getCapability(id: string): LoadedCapability | undefined;
|
|
433
|
+
getAllCapabilities(): LoadedCapability[];
|
|
434
|
+
getAllSkills(): Skill[];
|
|
435
|
+
getAllRules(): Rule[];
|
|
436
|
+
getAllDocs(): Doc[];
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Builds a capability registry by discovering, loading, and filtering capabilities.
|
|
440
|
+
* Only enabled capabilities (based on active profile) are included.
|
|
441
|
+
*
|
|
442
|
+
* @returns Capability registry with helper functions
|
|
443
|
+
*/
|
|
457
444
|
declare function buildCapabilityRegistry(): Promise<CapabilityRegistry>;
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
* @returns Array of Rule objects
|
|
465
|
-
*/
|
|
445
|
+
/**
|
|
446
|
+
* Load rules from a capability's rules/ directory
|
|
447
|
+
* @param capabilityPath Path to the capability directory
|
|
448
|
+
* @param capabilityId ID of the capability
|
|
449
|
+
* @returns Array of Rule objects
|
|
450
|
+
*/
|
|
466
451
|
declare function loadRules(capabilityPath: string, capabilityId: string): Promise<Rule[]>;
|
|
467
452
|
/**
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
453
|
+
* Write aggregated rules and docs to .omni/instructions.md
|
|
454
|
+
* Updates the generated section between markers while preserving user content
|
|
455
|
+
* @param rules Array of rules from all enabled capabilities
|
|
456
|
+
* @param docs Array of docs from all enabled capabilities
|
|
457
|
+
*/
|
|
473
458
|
declare function writeRules(rules: Rule[], docs?: Doc[]): Promise<void>;
|
|
474
|
-
//#endregion
|
|
475
|
-
//#region src/capability/skills.d.ts
|
|
476
459
|
declare function loadSkills(capabilityPath: string, capabilityId: string): Promise<Skill[]>;
|
|
477
|
-
//#endregion
|
|
478
|
-
//#region src/capability/sources.d.ts
|
|
479
460
|
interface FetchResult {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
461
|
+
id: string;
|
|
462
|
+
path: string;
|
|
463
|
+
version: string;
|
|
464
|
+
/** Git commit hash */
|
|
465
|
+
commit?: string;
|
|
466
|
+
updated: boolean;
|
|
467
|
+
wrapped: boolean;
|
|
487
468
|
}
|
|
488
469
|
interface SourceUpdateInfo {
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
470
|
+
id: string;
|
|
471
|
+
source: string;
|
|
472
|
+
currentVersion: string;
|
|
473
|
+
latestVersion: string;
|
|
474
|
+
hasUpdate: boolean;
|
|
494
475
|
}
|
|
495
476
|
/**
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* Parse a capability source string or config into normalized form
|
|
501
|
-
* Returns a GitCapabilitySourceConfig
|
|
502
|
-
*/
|
|
477
|
+
* Parse a capability source string or config into normalized form
|
|
478
|
+
* Returns a GitCapabilitySourceConfig
|
|
479
|
+
*/
|
|
503
480
|
declare function parseSourceConfig(source: CapabilitySourceConfig): GitCapabilitySourceConfig;
|
|
504
481
|
/**
|
|
505
|
-
|
|
506
|
-
|
|
482
|
+
* Convert source to a git-cloneable URL
|
|
483
|
+
*/
|
|
507
484
|
declare function sourceToGitUrl(source: string): string;
|
|
508
485
|
/**
|
|
509
|
-
|
|
510
|
-
|
|
486
|
+
* Get the path where a capability source will be stored
|
|
487
|
+
*/
|
|
511
488
|
declare function getSourceCapabilityPath(id: string): string;
|
|
512
489
|
/**
|
|
513
|
-
|
|
514
|
-
|
|
490
|
+
* Get the lock file path
|
|
491
|
+
*/
|
|
515
492
|
declare function getLockFilePath(): string;
|
|
516
493
|
/**
|
|
517
|
-
|
|
518
|
-
|
|
494
|
+
* Load the capabilities lock file
|
|
495
|
+
*/
|
|
519
496
|
declare function loadLockFile(): Promise<CapabilitiesLockFile>;
|
|
520
497
|
/**
|
|
521
|
-
|
|
522
|
-
|
|
498
|
+
* Save the capabilities lock file
|
|
499
|
+
*/
|
|
523
500
|
declare function saveLockFile(lockFile: CapabilitiesLockFile): Promise<void>;
|
|
524
501
|
/**
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
/**
|
|
529
|
-
* Discover content in a wrapped repository
|
|
530
|
-
*/
|
|
502
|
+
* Discover content in a wrapped repository
|
|
503
|
+
*/
|
|
531
504
|
interface DiscoveredContent {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
}
|
|
550
|
-
/**
|
|
551
|
-
|
|
552
|
-
|
|
505
|
+
skills: Array<{
|
|
506
|
+
name: string;
|
|
507
|
+
path: string;
|
|
508
|
+
isFolder: boolean;
|
|
509
|
+
}>;
|
|
510
|
+
agents: Array<{
|
|
511
|
+
name: string;
|
|
512
|
+
path: string;
|
|
513
|
+
isFolder: boolean;
|
|
514
|
+
}>;
|
|
515
|
+
commands: Array<{
|
|
516
|
+
name: string;
|
|
517
|
+
path: string;
|
|
518
|
+
isFolder: boolean;
|
|
519
|
+
}>;
|
|
520
|
+
rulesDir: string | null;
|
|
521
|
+
docsDir: string | null;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Fetch a single capability source from git
|
|
525
|
+
*/
|
|
553
526
|
declare function fetchCapabilitySource(id: string, sourceConfig: CapabilitySourceConfig, options?: {
|
|
554
|
-
|
|
527
|
+
silent?: boolean;
|
|
555
528
|
}): Promise<FetchResult>;
|
|
556
529
|
/**
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
/**
|
|
561
|
-
* Fetch all capability sources from config
|
|
562
|
-
*/
|
|
530
|
+
* Fetch all capability sources from config
|
|
531
|
+
*/
|
|
563
532
|
declare function fetchAllCapabilitySources(config: OmniConfig, options?: {
|
|
564
|
-
|
|
565
|
-
|
|
533
|
+
silent?: boolean;
|
|
534
|
+
force?: boolean;
|
|
566
535
|
}): Promise<FetchResult[]>;
|
|
567
536
|
/**
|
|
568
|
-
|
|
569
|
-
|
|
537
|
+
* Check for available updates without applying them
|
|
538
|
+
*/
|
|
570
539
|
declare function checkForUpdates(config: OmniConfig): Promise<SourceUpdateInfo[]>;
|
|
571
|
-
//#endregion
|
|
572
|
-
//#region src/capability/subagents.d.ts
|
|
573
540
|
/**
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
541
|
+
* Load subagents from the subagents/ directory of a capability.
|
|
542
|
+
* Each subagent is a SUBAGENT.md file in its own subdirectory.
|
|
543
|
+
*/
|
|
577
544
|
declare function loadSubagents(capabilityPath: string, capabilityId: string): Promise<Subagent[]>;
|
|
578
|
-
//#endregion
|
|
579
|
-
//#region src/config/capabilities.d.ts
|
|
580
545
|
/**
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
546
|
+
* Get enabled capabilities for the active profile
|
|
547
|
+
* Includes both profile-specific and always-enabled capabilities
|
|
548
|
+
* @returns Array of enabled capability IDs
|
|
549
|
+
*/
|
|
585
550
|
declare function getEnabledCapabilities(): Promise<string[]>;
|
|
586
551
|
/**
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
552
|
+
* Enable a capability by adding it to the active profile's capabilities list
|
|
553
|
+
* @param capabilityId - The ID of the capability to enable
|
|
554
|
+
*/
|
|
590
555
|
declare function enableCapability(capabilityId: string): Promise<void>;
|
|
591
556
|
/**
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
557
|
+
* Disable a capability by removing it from the active profile's capabilities list
|
|
558
|
+
* @param capabilityId - The ID of the capability to disable
|
|
559
|
+
*/
|
|
595
560
|
declare function disableCapability(capabilityId: string): Promise<void>;
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
* @returns Merged environment variables
|
|
603
|
-
*/
|
|
561
|
+
/**
|
|
562
|
+
* Load environment variables from .omni/.env file and merge with process.env.
|
|
563
|
+
* Process environment variables take precedence over file values.
|
|
564
|
+
*
|
|
565
|
+
* @returns Merged environment variables
|
|
566
|
+
*/
|
|
604
567
|
declare function loadEnvironment(): Promise<Record<string, string>>;
|
|
605
568
|
/**
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
569
|
+
* Validate that all required environment variables are present.
|
|
570
|
+
* Checks declarations from capability config and throws descriptive errors for missing vars.
|
|
571
|
+
*
|
|
572
|
+
* @param declarations - Environment variable declarations from capability.toml
|
|
573
|
+
* @param env - Loaded environment variables
|
|
574
|
+
* @param capabilityId - ID of the capability being validated
|
|
575
|
+
* @throws Error if required environment variables are missing
|
|
576
|
+
*/
|
|
614
577
|
declare function validateEnv(declarations: Record<string, EnvDeclaration | Record<string, never>>, env: Record<string, string | undefined>, capabilityId: string): void;
|
|
615
578
|
/**
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
579
|
+
* Check if an environment variable should be treated as a secret.
|
|
580
|
+
* Secrets should be masked in logs and error messages.
|
|
581
|
+
*
|
|
582
|
+
* @param key - Environment variable name
|
|
583
|
+
* @param declarations - Environment variable declarations from capability.toml
|
|
584
|
+
* @returns true if the variable is marked as secret
|
|
585
|
+
*/
|
|
623
586
|
declare function isSecretEnvVar(key: string, declarations: Record<string, EnvDeclaration | Record<string, never>>): boolean;
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
* Local config takes precedence over main config. Missing files are treated as empty configs.
|
|
632
|
-
*/
|
|
587
|
+
/**
|
|
588
|
+
* Load and merge config and local configuration files
|
|
589
|
+
* @returns Merged OmniConfig object
|
|
590
|
+
*
|
|
591
|
+
* Reads omni.toml (main config) and omni.local.toml (local overrides).
|
|
592
|
+
* Local config takes precedence over main config. Missing files are treated as empty configs.
|
|
593
|
+
*/
|
|
633
594
|
declare function loadConfig(): Promise<OmniConfig>;
|
|
634
595
|
/**
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
596
|
+
* Write config to omni.toml at project root
|
|
597
|
+
* @param config - The config object to write
|
|
598
|
+
*/
|
|
638
599
|
declare function writeConfig(config: OmniConfig): Promise<void>;
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
* @throws Error if TOML is invalid
|
|
646
|
-
*/
|
|
600
|
+
/**
|
|
601
|
+
* Parse a TOML string into an OmniConfig object
|
|
602
|
+
* @param tomlContent - The TOML content to parse
|
|
603
|
+
* @returns Parsed OmniConfig object
|
|
604
|
+
* @throws Error if TOML is invalid
|
|
605
|
+
*/
|
|
647
606
|
declare function parseOmniConfig(tomlContent: string): OmniConfig;
|
|
648
607
|
/**
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
608
|
+
* Parse a TOML string into a CapabilityConfig object
|
|
609
|
+
* @param tomlContent - The TOML content to parse
|
|
610
|
+
* @returns Parsed CapabilityConfig object
|
|
611
|
+
* @throws Error if TOML is invalid or required fields are missing
|
|
612
|
+
*/
|
|
654
613
|
declare function parseCapabilityConfig(tomlContent: string): CapabilityConfig;
|
|
655
|
-
//#endregion
|
|
656
|
-
//#region src/config/profiles.d.ts
|
|
657
614
|
/**
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
615
|
+
* Gets the name of the currently active profile.
|
|
616
|
+
* Reads from state file first, falls back to config.toml for backwards compatibility.
|
|
617
|
+
* Returns null if no profile is set.
|
|
618
|
+
*/
|
|
662
619
|
declare function getActiveProfile(): Promise<string | null>;
|
|
663
620
|
/**
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
621
|
+
* Sets the active profile by writing to state file.
|
|
622
|
+
* @param name - The name of the profile to activate
|
|
623
|
+
*/
|
|
667
624
|
declare function setActiveProfile(name: string): Promise<void>;
|
|
668
625
|
/**
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
626
|
+
* Resolves the enabled capabilities for a given profile
|
|
627
|
+
*
|
|
628
|
+
* @param config - The merged OmniConfig
|
|
629
|
+
* @param profileName - The name of the profile to apply, or null to use active
|
|
630
|
+
* @returns Array of capability IDs that should be enabled
|
|
631
|
+
*/
|
|
675
632
|
declare function resolveEnabledCapabilities(config: OmniConfig, profileName: string | null): string[];
|
|
676
633
|
/**
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
634
|
+
* Load a specific profile configuration from config.toml
|
|
635
|
+
* @param profileName - Name of the profile to load
|
|
636
|
+
* @returns ProfileConfig if found, undefined otherwise
|
|
637
|
+
*/
|
|
681
638
|
declare function loadProfileConfig(profileName: string): Promise<ProfileConfig | undefined>;
|
|
682
639
|
/**
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
640
|
+
* Set a profile configuration in config.toml
|
|
641
|
+
* @param profileName - Name of the profile to set
|
|
642
|
+
* @param profileConfig - Profile configuration
|
|
643
|
+
*/
|
|
687
644
|
declare function setProfile(profileName: string, profileConfig: ProfileConfig): Promise<void>;
|
|
688
|
-
//#endregion
|
|
689
|
-
//#region src/config/provider.d.ts
|
|
690
645
|
declare function loadProviderConfig(): Promise<ProviderConfig>;
|
|
691
646
|
declare function writeProviderConfig(config: ProviderConfig): Promise<void>;
|
|
692
647
|
declare function parseProviderFlag(flag: string): Provider[];
|
|
693
|
-
//#endregion
|
|
694
|
-
//#region src/state/manifest.d.ts
|
|
695
648
|
/**
|
|
696
|
-
|
|
697
|
-
|
|
649
|
+
* Resources provided by a single capability
|
|
650
|
+
*/
|
|
698
651
|
interface CapabilityResources {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
652
|
+
skills: string[];
|
|
653
|
+
rules: string[];
|
|
654
|
+
commands: string[];
|
|
655
|
+
subagents: string[];
|
|
656
|
+
mcps: string[];
|
|
704
657
|
}
|
|
705
658
|
/**
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
659
|
+
* Manifest tracking which resources each capability provides.
|
|
660
|
+
* Used to clean up stale resources when capabilities are disabled.
|
|
661
|
+
*/
|
|
709
662
|
interface ResourceManifest {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
663
|
+
/** Schema version for future migrations */
|
|
664
|
+
version: 1;
|
|
665
|
+
/** Last sync timestamp (ISO 8601) */
|
|
666
|
+
syncedAt: string;
|
|
667
|
+
/** Map of capability ID → resources it provides */
|
|
668
|
+
capabilities: Record<string, CapabilityResources>;
|
|
716
669
|
}
|
|
717
670
|
/**
|
|
718
|
-
|
|
719
|
-
|
|
671
|
+
* Result of cleaning up stale resources
|
|
672
|
+
*/
|
|
720
673
|
interface CleanupResult {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
674
|
+
deletedSkills: string[];
|
|
675
|
+
deletedRules: string[];
|
|
676
|
+
deletedCommands: string[];
|
|
677
|
+
deletedSubagents: string[];
|
|
678
|
+
deletedMcps: string[];
|
|
726
679
|
}
|
|
727
680
|
/**
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
681
|
+
* Load the previous manifest from disk.
|
|
682
|
+
* Returns an empty manifest if the file doesn't exist.
|
|
683
|
+
*/
|
|
731
684
|
declare function loadManifest(): Promise<ResourceManifest>;
|
|
732
685
|
/**
|
|
733
|
-
|
|
734
|
-
|
|
686
|
+
* Save the manifest to disk.
|
|
687
|
+
*/
|
|
735
688
|
declare function saveManifest(manifest: ResourceManifest): Promise<void>;
|
|
736
689
|
/**
|
|
737
|
-
|
|
738
|
-
|
|
690
|
+
* Build a manifest from the current registry capabilities.
|
|
691
|
+
*/
|
|
739
692
|
declare function buildManifestFromCapabilities(capabilities: LoadedCapability[]): ResourceManifest;
|
|
740
693
|
/**
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
694
|
+
* Delete resources for capabilities that are no longer enabled.
|
|
695
|
+
* Compares the previous manifest against current capability IDs
|
|
696
|
+
* and removes files/directories for capabilities not in the current set.
|
|
697
|
+
*/
|
|
745
698
|
declare function cleanupStaleResources(previousManifest: ResourceManifest, currentCapabilityIds: Set<string>): Promise<CleanupResult>;
|
|
746
|
-
//#endregion
|
|
747
|
-
//#region src/mcp-json/manager.d.ts
|
|
748
699
|
/**
|
|
749
|
-
|
|
750
|
-
|
|
700
|
+
* MCP server configuration in .mcp.json
|
|
701
|
+
*/
|
|
751
702
|
interface McpServerConfig {
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
703
|
+
command: string;
|
|
704
|
+
args?: string[];
|
|
705
|
+
env?: Record<string, string>;
|
|
755
706
|
}
|
|
756
707
|
/**
|
|
757
|
-
|
|
758
|
-
|
|
708
|
+
* Structure of .mcp.json file
|
|
709
|
+
*/
|
|
759
710
|
interface McpJsonConfig {
|
|
760
|
-
|
|
711
|
+
mcpServers: Record<string, McpServerConfig>;
|
|
761
712
|
}
|
|
762
713
|
/**
|
|
763
|
-
|
|
764
|
-
|
|
714
|
+
* Read .mcp.json or return empty config if doesn't exist
|
|
715
|
+
*/
|
|
765
716
|
declare function readMcpJson(): Promise<McpJsonConfig>;
|
|
766
717
|
/**
|
|
767
|
-
|
|
768
|
-
|
|
718
|
+
* Write .mcp.json, preserving non-OmniDev entries
|
|
719
|
+
*/
|
|
769
720
|
declare function writeMcpJson(config: McpJsonConfig): Promise<void>;
|
|
770
721
|
/**
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
722
|
+
* Sync .mcp.json with enabled capability MCP servers
|
|
723
|
+
*
|
|
724
|
+
* Each capability with an [mcp] section is registered using its capability ID.
|
|
725
|
+
* Uses the previous manifest to track which MCPs were managed by OmniDev.
|
|
726
|
+
*/
|
|
776
727
|
declare function syncMcpJson(capabilities: LoadedCapability[], previousManifest: ResourceManifest, options?: {
|
|
777
|
-
|
|
728
|
+
silent?: boolean;
|
|
778
729
|
}): Promise<void>;
|
|
779
|
-
//#endregion
|
|
780
|
-
//#region src/state/active-profile.d.ts
|
|
781
730
|
/**
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
731
|
+
* Read the active profile from state file.
|
|
732
|
+
* Returns null if no active profile is set in state.
|
|
733
|
+
*/
|
|
785
734
|
declare function readActiveProfileState(): Promise<string | null>;
|
|
786
735
|
/**
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
736
|
+
* Write the active profile to state file.
|
|
737
|
+
* @param profileName - The name of the profile to set as active
|
|
738
|
+
*/
|
|
790
739
|
declare function writeActiveProfileState(profileName: string): Promise<void>;
|
|
791
740
|
/**
|
|
792
|
-
|
|
793
|
-
|
|
741
|
+
* Clear the active profile state (delete the state file).
|
|
742
|
+
*/
|
|
794
743
|
declare function clearActiveProfileState(): Promise<void>;
|
|
795
|
-
//#endregion
|
|
796
|
-
//#region src/state/providers.d.ts
|
|
797
744
|
interface ProvidersState {
|
|
798
|
-
|
|
745
|
+
enabled: ProviderId[];
|
|
799
746
|
}
|
|
800
747
|
/**
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
748
|
+
* Read the enabled providers from local state.
|
|
749
|
+
* Returns default providers if no state file exists.
|
|
750
|
+
*/
|
|
804
751
|
declare function readEnabledProviders(): Promise<ProviderId[]>;
|
|
805
752
|
/**
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
753
|
+
* Write enabled providers to local state.
|
|
754
|
+
* @param providers - List of provider IDs to enable
|
|
755
|
+
*/
|
|
809
756
|
declare function writeEnabledProviders(providers: ProviderId[]): Promise<void>;
|
|
810
757
|
/**
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
758
|
+
* Enable a specific provider.
|
|
759
|
+
* @param providerId - The provider to enable
|
|
760
|
+
*/
|
|
814
761
|
declare function enableProvider(providerId: ProviderId): Promise<void>;
|
|
815
762
|
/**
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
763
|
+
* Disable a specific provider.
|
|
764
|
+
* @param providerId - The provider to disable
|
|
765
|
+
*/
|
|
819
766
|
declare function disableProvider(providerId: ProviderId): Promise<void>;
|
|
820
767
|
/**
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
768
|
+
* Check if a provider is enabled.
|
|
769
|
+
* @param providerId - The provider to check
|
|
770
|
+
*/
|
|
824
771
|
declare function isProviderEnabled(providerId: ProviderId): Promise<boolean>;
|
|
825
|
-
//#endregion
|
|
826
|
-
//#region src/sync.d.ts
|
|
827
772
|
interface SyncResult {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
773
|
+
capabilities: string[];
|
|
774
|
+
skillCount: number;
|
|
775
|
+
ruleCount: number;
|
|
776
|
+
docCount: number;
|
|
832
777
|
}
|
|
833
778
|
interface SyncOptions {
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
779
|
+
silent?: boolean;
|
|
780
|
+
/** Optional list of adapters to run. If not provided, adapters are not run. */
|
|
781
|
+
adapters?: ProviderAdapter[];
|
|
837
782
|
}
|
|
838
783
|
/**
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
784
|
+
* Install dependencies for capabilities in .omni/capabilities/
|
|
785
|
+
* Only installs for capabilities that have a package.json
|
|
786
|
+
*/
|
|
842
787
|
declare function installCapabilityDependencies(silent: boolean): Promise<void>;
|
|
843
788
|
/**
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
789
|
+
* Build a provider-agnostic SyncBundle from the capability registry.
|
|
790
|
+
* This bundle can then be passed to adapters for provider-specific materialization.
|
|
791
|
+
*/
|
|
847
792
|
declare function buildSyncBundle(options?: {
|
|
848
|
-
|
|
793
|
+
silent?: boolean;
|
|
849
794
|
}): Promise<{
|
|
850
|
-
|
|
795
|
+
bundle: SyncBundle;
|
|
851
796
|
}>;
|
|
852
797
|
/**
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
798
|
+
* Central sync function that regenerates all agent configuration files.
|
|
799
|
+
* Called automatically after any config change (init, capability enable/disable, profile change).
|
|
800
|
+
*
|
|
801
|
+
* If adapters are provided, they will be called after core sync to write provider-specific files.
|
|
802
|
+
*/
|
|
858
803
|
declare function syncAgentConfiguration(options?: SyncOptions): Promise<SyncResult>;
|
|
859
|
-
//#endregion
|
|
860
|
-
//#region src/templates/agents.d.ts
|
|
861
804
|
/**
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
805
|
+
* Template for AGENTS.md (Codex provider)
|
|
806
|
+
* Creates a minimal file with reference to OmniDev instructions
|
|
807
|
+
*/
|
|
865
808
|
declare function generateAgentsTemplate(): string;
|
|
866
|
-
//#endregion
|
|
867
|
-
//#region src/templates/claude.d.ts
|
|
868
809
|
/**
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
810
|
+
* Template for CLAUDE.md (Claude provider)
|
|
811
|
+
* Creates a minimal file with reference to OmniDev instructions
|
|
812
|
+
*/
|
|
872
813
|
declare function generateClaudeTemplate(): string;
|
|
873
814
|
/**
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
815
|
+
* Template for .omni/instructions.md
|
|
816
|
+
* Contains OmniDev-specific instructions and capability rules
|
|
817
|
+
*/
|
|
877
818
|
declare function generateInstructionsTemplate(): string;
|
|
878
|
-
//#endregion
|
|
879
|
-
//#region src/debug.d.ts
|
|
880
819
|
/**
|
|
881
|
-
|
|
882
|
-
|
|
820
|
+
* Debug logger that writes to stdout when OMNIDEV_DEBUG=1
|
|
821
|
+
*/
|
|
883
822
|
declare function debug(message: string, data?: unknown): void;
|
|
884
|
-
//#endregion
|
|
885
|
-
//#region src/index.d.ts
|
|
886
823
|
declare const version = "0.1.0";
|
|
887
824
|
declare function getVersion(): string;
|
|
888
|
-
|
|
889
|
-
export { CapabilitiesConfig, CapabilitiesLockFile, CapabilityConfig, CapabilityExport, CapabilityExports, CapabilityLockEntry, CapabilityMetadata, CapabilityRegistry, CapabilityResources, CapabilitySource, CapabilitySourceConfig, CapabilitySourceType, CleanupResult, CliConfig, Command, CommandExport, DiscoveredContent, Doc, DocExport, EnvDeclaration, FetchResult, FileContent, GitCapabilitySourceConfig, LoadedCapability, McpConfig, McpJsonConfig, McpServerConfig, McpToolSchema, McpTransport, OmniConfig, ProfileConfig, Provider, ProviderAdapter, ProviderConfig, ProviderContext, ProviderId, ProviderInitResult, ProviderManifest, ProviderSyncResult, ProvidersState, ResourceManifest, Rule, Skill, SkillExport, SourceUpdateInfo, Subagent, SubagentExport, SubagentHookConfig, SubagentHooks, SubagentModel, SubagentPermissionMode, SyncBundle, SyncConfig, SyncOptions, SyncResult, buildCapabilityRegistry, buildCommand, buildManifestFromCapabilities, buildRouteMap, buildSyncBundle, checkForUpdates, cleanupStaleResources, clearActiveProfileState, debug, disableCapability, disableProvider, discoverCapabilities, enableCapability, enableProvider, fetchAllCapabilitySources, fetchCapabilitySource, generateAgentsTemplate, generateClaudeTemplate, generateInstructionsTemplate, getActiveProfile, getActiveProviders, getEnabledCapabilities, getLockFilePath, getSourceCapabilityPath, getVersion, installCapabilityDependencies, isProviderEnabled, isSecretEnvVar, loadCapability, loadCapabilityConfig, loadCommands, loadConfig, loadDocs, loadEnvironment, loadLockFile, loadManifest, loadProfileConfig, loadProviderConfig, loadRules, loadSkills, loadSubagents, parseCapabilityConfig, parseOmniConfig, parseProviderFlag, parseSourceConfig, readActiveProfileState, readEnabledProviders, readMcpJson, resolveEnabledCapabilities, saveLockFile, saveManifest, setActiveProfile, setProfile, sourceToGitUrl, syncAgentConfiguration, syncMcpJson, validateEnv, version, writeActiveProfileState, writeConfig, writeEnabledProviders, writeMcpJson, writeProviderConfig, writeRules };
|
|
825
|
+
export { writeRules, writeProviderConfig, writeMcpJson, writeEnabledProviders, writeConfig, writeActiveProfileState, version, validateEnv, syncMcpJson, syncAgentConfiguration, sourceToGitUrl, setProfile, setActiveProfile, saveManifest, saveLockFile, resolveEnabledCapabilities, readMcpJson, readEnabledProviders, readActiveProfileState, parseSourceConfig, parseProviderFlag, parseOmniConfig, parseCapabilityConfig, loadSubagents, loadSkills, loadRules, loadProviderConfig, loadProfileConfig, loadManifest, loadLockFile, loadEnvironment, loadDocs, loadConfig, loadCommands, loadCapabilityConfig, loadCapability, isSecretEnvVar, isProviderEnabled, installCapabilityDependencies, getVersion, getSourceCapabilityPath, getLockFilePath, getEnabledCapabilities, getActiveProviders, getActiveProfile, generateInstructionsTemplate, generateClaudeTemplate, generateAgentsTemplate, fetchCapabilitySource, fetchAllCapabilitySources, enableProvider, enableCapability, discoverCapabilities, disableProvider, disableCapability, debug, clearActiveProfileState, cleanupStaleResources, checkForUpdates, buildSyncBundle, buildRouteMap, buildManifestFromCapabilities, buildCommand, buildCapabilityRegistry, SyncResult, SyncOptions, SyncConfig, SyncBundle, SubagentPermissionMode, SubagentModel, SubagentHooks, SubagentHookConfig, SubagentExport, Subagent, SourceUpdateInfo, SkillExport, Skill, Rule, ResourceManifest, ProvidersState, ProviderSyncResult, ProviderManifest, ProviderInitResult, ProviderId, ProviderContext, ProviderConfig, ProviderAdapter, Provider, ProfileConfig, OmniConfig, McpTransport, McpToolSchema, McpServerConfig, McpJsonConfig, McpConfig, LoadedCapability, GitCapabilitySourceConfig, FileContent, FetchResult, EnvDeclaration, DocExport, Doc, DiscoveredContent, CommandExport, Command, CliConfig, CleanupResult, CapabilitySourceType, CapabilitySourceConfig, CapabilitySource, CapabilityResources, CapabilityRegistry, CapabilityMetadata, CapabilityLockEntry, CapabilityExports, CapabilityExport, CapabilityConfig, CapabilitiesLockFile, CapabilitiesConfig };
|