@framers/agentos 0.1.28 → 0.1.30
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/cognitive_substrate/GMIManager.d.ts.map +1 -1
- package/dist/cognitive_substrate/GMIManager.js +0 -2
- package/dist/cognitive_substrate/GMIManager.js.map +1 -1
- package/dist/core/tools/IToolOrchestrator.d.ts +17 -0
- package/dist/core/tools/IToolOrchestrator.d.ts.map +1 -1
- package/dist/core/tools/ToolOrchestrator.d.ts +13 -0
- package/dist/core/tools/ToolOrchestrator.d.ts.map +1 -1
- package/dist/core/tools/ToolOrchestrator.js +28 -0
- package/dist/core/tools/ToolOrchestrator.js.map +1 -1
- package/dist/discovery/CapabilityContextAssembler.d.ts +54 -0
- package/dist/discovery/CapabilityContextAssembler.d.ts.map +1 -0
- package/dist/discovery/CapabilityContextAssembler.js +192 -0
- package/dist/discovery/CapabilityContextAssembler.js.map +1 -0
- package/dist/discovery/CapabilityDiscoveryEngine.d.ts +76 -0
- package/dist/discovery/CapabilityDiscoveryEngine.d.ts.map +1 -0
- package/dist/discovery/CapabilityDiscoveryEngine.js +197 -0
- package/dist/discovery/CapabilityDiscoveryEngine.js.map +1 -0
- package/dist/discovery/CapabilityEmbeddingStrategy.d.ts +45 -0
- package/dist/discovery/CapabilityEmbeddingStrategy.d.ts.map +1 -0
- package/dist/discovery/CapabilityEmbeddingStrategy.js +167 -0
- package/dist/discovery/CapabilityEmbeddingStrategy.js.map +1 -0
- package/dist/discovery/CapabilityGraph.d.ts +78 -0
- package/dist/discovery/CapabilityGraph.d.ts.map +1 -0
- package/dist/discovery/CapabilityGraph.js +263 -0
- package/dist/discovery/CapabilityGraph.js.map +1 -0
- package/dist/discovery/CapabilityIndex.d.ts +93 -0
- package/dist/discovery/CapabilityIndex.d.ts.map +1 -0
- package/dist/discovery/CapabilityIndex.js +324 -0
- package/dist/discovery/CapabilityIndex.js.map +1 -0
- package/dist/discovery/CapabilityManifestScanner.d.ts +66 -0
- package/dist/discovery/CapabilityManifestScanner.d.ts.map +1 -0
- package/dist/discovery/CapabilityManifestScanner.js +315 -0
- package/dist/discovery/CapabilityManifestScanner.js.map +1 -0
- package/dist/discovery/DiscoverCapabilitiesTool.d.ts +44 -0
- package/dist/discovery/DiscoverCapabilitiesTool.d.ts.map +1 -0
- package/dist/discovery/DiscoverCapabilitiesTool.js +118 -0
- package/dist/discovery/DiscoverCapabilitiesTool.js.map +1 -0
- package/dist/discovery/index.d.ts +39 -0
- package/dist/discovery/index.d.ts.map +1 -0
- package/dist/discovery/index.js +41 -0
- package/dist/discovery/index.js.map +1 -0
- package/dist/discovery/types.d.ts +357 -0
- package/dist/discovery/types.d.ts.map +1 -0
- package/dist/discovery/types.js +46 -0
- package/dist/discovery/types.js.map +1 -0
- package/package.json +6 -1
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Core types for the Capability Discovery Engine.
|
|
3
|
+
* @module @framers/agentos/discovery/types
|
|
4
|
+
*
|
|
5
|
+
* Provides unified type definitions for normalizing tools, skills, extensions,
|
|
6
|
+
* and channels into a searchable, tiered capability discovery system.
|
|
7
|
+
*
|
|
8
|
+
* Key concepts:
|
|
9
|
+
* - CapabilityDescriptor: Unified shape for any capability in the system
|
|
10
|
+
* - Three-tier context budgeting: Always → Retrieved summaries → Full details
|
|
11
|
+
* - ICapabilityGraph: Abstraction for relationship graphs (graphology now, Neo4j later)
|
|
12
|
+
*/
|
|
13
|
+
import type { JSONSchemaObject } from '../core/tools/ITool.js';
|
|
14
|
+
/**
|
|
15
|
+
* Kind discriminator for capability descriptors.
|
|
16
|
+
*/
|
|
17
|
+
export type CapabilityKind = 'tool' | 'skill' | 'extension' | 'channel' | 'voice' | 'productivity';
|
|
18
|
+
/**
|
|
19
|
+
* Reference back to the original source of a capability.
|
|
20
|
+
* Used for lazy loading of full schemas/content.
|
|
21
|
+
*/
|
|
22
|
+
export type CapabilitySourceRef = {
|
|
23
|
+
type: 'tool';
|
|
24
|
+
toolName: string;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'skill';
|
|
27
|
+
skillName: string;
|
|
28
|
+
skillPath?: string;
|
|
29
|
+
} | {
|
|
30
|
+
type: 'extension';
|
|
31
|
+
packageName: string;
|
|
32
|
+
extensionId: string;
|
|
33
|
+
} | {
|
|
34
|
+
type: 'channel';
|
|
35
|
+
platform: string;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'manifest';
|
|
38
|
+
manifestPath: string;
|
|
39
|
+
entryId: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Unified representation of any capability in the system.
|
|
43
|
+
* Normalizes tools, skills, extensions, and channels into a single
|
|
44
|
+
* searchable shape for the discovery engine.
|
|
45
|
+
*/
|
|
46
|
+
export interface CapabilityDescriptor {
|
|
47
|
+
/**
|
|
48
|
+
* Globally unique ID.
|
|
49
|
+
* Convention: `${kind}:${name}` (e.g., "tool:web-search", "skill:github", "channel:telegram")
|
|
50
|
+
*/
|
|
51
|
+
id: string;
|
|
52
|
+
/** Kind discriminator */
|
|
53
|
+
kind: CapabilityKind;
|
|
54
|
+
/** Machine-readable name (e.g., "web-search", "github", "telegram") */
|
|
55
|
+
name: string;
|
|
56
|
+
/** Human-readable display name */
|
|
57
|
+
displayName: string;
|
|
58
|
+
/**
|
|
59
|
+
* Natural language description.
|
|
60
|
+
* This is the primary text used for embedding generation — it should
|
|
61
|
+
* describe WHEN and WHY to use this capability, not just what it does.
|
|
62
|
+
*/
|
|
63
|
+
description: string;
|
|
64
|
+
/** Category for coarse filtering (e.g., "information", "developer-tools", "communication") */
|
|
65
|
+
category: string;
|
|
66
|
+
/** Tags for additional matching signals */
|
|
67
|
+
tags: string[];
|
|
68
|
+
/** Required secret IDs (e.g., ["SERPER_API_KEY", "OPENAI_API_KEY"]) */
|
|
69
|
+
requiredSecrets: string[];
|
|
70
|
+
/** Required tool/binary dependencies (e.g., ["gh", "git"]) */
|
|
71
|
+
requiredTools: string[];
|
|
72
|
+
/** Whether this capability is currently available (installed, secrets present) */
|
|
73
|
+
available: boolean;
|
|
74
|
+
/** Whether this capability has side effects on external systems */
|
|
75
|
+
hasSideEffects?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Full input/output schema (Tier 2 data — NOT embedded, loaded on demand).
|
|
78
|
+
* For tools: the JSON Schema inputSchema + outputSchema.
|
|
79
|
+
*/
|
|
80
|
+
fullSchema?: JSONSchemaObject;
|
|
81
|
+
/**
|
|
82
|
+
* Full SKILL.md content or detailed documentation (Tier 2 data — NOT embedded, loaded on demand).
|
|
83
|
+
*/
|
|
84
|
+
fullContent?: string;
|
|
85
|
+
/** Reference back to the original source for lazy loading */
|
|
86
|
+
sourceRef: CapabilitySourceRef;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Tier classification for context budget management.
|
|
90
|
+
*
|
|
91
|
+
* Tier 0: Always in context (~150 tokens) — category summaries only
|
|
92
|
+
* Tier 1: Retrieved on relevance (~200 tokens) — name + description + key params
|
|
93
|
+
* Tier 2: Deep pull (~1500 tokens) — full schema + examples + relationship context
|
|
94
|
+
*/
|
|
95
|
+
export declare enum CapabilityTier {
|
|
96
|
+
/** Always in context: category summaries */
|
|
97
|
+
TIER_0_ALWAYS = 0,
|
|
98
|
+
/** Retrieved on relevance: name + description + key params */
|
|
99
|
+
TIER_1_SUMMARY = 1,
|
|
100
|
+
/** Deep pull: full schema + examples + relationship context */
|
|
101
|
+
TIER_2_FULL = 2
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A Tier 1 search result with relevance scoring.
|
|
105
|
+
*/
|
|
106
|
+
export interface Tier1Result {
|
|
107
|
+
capability: CapabilityDescriptor;
|
|
108
|
+
relevanceScore: number;
|
|
109
|
+
/** Compact summary text (~30-50 tokens per capability) */
|
|
110
|
+
summaryText: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A Tier 2 full-detail result.
|
|
114
|
+
*/
|
|
115
|
+
export interface Tier2Result {
|
|
116
|
+
capability: CapabilityDescriptor;
|
|
117
|
+
/** Full schema/content text for injection into context */
|
|
118
|
+
fullText: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Token budget tracking for a discovery result.
|
|
122
|
+
*/
|
|
123
|
+
export interface TokenEstimate {
|
|
124
|
+
tier0Tokens: number;
|
|
125
|
+
tier1Tokens: number;
|
|
126
|
+
tier2Tokens: number;
|
|
127
|
+
totalTokens: number;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Performance diagnostics for a discovery query.
|
|
131
|
+
*/
|
|
132
|
+
export interface DiscoveryDiagnostics {
|
|
133
|
+
queryTimeMs: number;
|
|
134
|
+
embeddingTimeMs: number;
|
|
135
|
+
graphTraversalTimeMs: number;
|
|
136
|
+
candidatesScanned: number;
|
|
137
|
+
capabilitiesRetrieved: number;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Complete result of a capability discovery query.
|
|
141
|
+
* Contains all three tiers of context, plus diagnostics.
|
|
142
|
+
*/
|
|
143
|
+
export interface CapabilityDiscoveryResult {
|
|
144
|
+
/** Tier 0: always-present category summaries */
|
|
145
|
+
tier0: string;
|
|
146
|
+
/** Tier 1: retrieved capability summaries with scores */
|
|
147
|
+
tier1: Tier1Result[];
|
|
148
|
+
/** Tier 2: full details for top-selected capabilities */
|
|
149
|
+
tier2: Tier2Result[];
|
|
150
|
+
/** Token budget tracking */
|
|
151
|
+
tokenEstimate: TokenEstimate;
|
|
152
|
+
/** Discovery diagnostics */
|
|
153
|
+
diagnostics: DiscoveryDiagnostics;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Configuration for the Capability Discovery Engine.
|
|
157
|
+
*/
|
|
158
|
+
export interface CapabilityDiscoveryConfig {
|
|
159
|
+
/** Maximum tokens for Tier 0 context. @default 200 */
|
|
160
|
+
tier0TokenBudget: number;
|
|
161
|
+
/** Maximum tokens for Tier 1 retrievals. @default 800 */
|
|
162
|
+
tier1TokenBudget: number;
|
|
163
|
+
/** Maximum tokens for Tier 2 full pulls. @default 2000 */
|
|
164
|
+
tier2TokenBudget: number;
|
|
165
|
+
/** Number of Tier 1 candidates to retrieve. @default 5 */
|
|
166
|
+
tier1TopK: number;
|
|
167
|
+
/** Number of Tier 2 candidates to fully expand. @default 2 */
|
|
168
|
+
tier2TopK: number;
|
|
169
|
+
/** Minimum relevance score for Tier 1 inclusion (0-1). @default 0.3 */
|
|
170
|
+
tier1MinRelevance: number;
|
|
171
|
+
/** Whether to use graph relationships for re-ranking. @default true */
|
|
172
|
+
useGraphReranking: boolean;
|
|
173
|
+
/** Vector store collection name for capability embeddings. @default 'capability_index' */
|
|
174
|
+
collectionName: string;
|
|
175
|
+
/** Embedding model ID to use (undefined = use default). */
|
|
176
|
+
embeddingModelId?: string;
|
|
177
|
+
/** Graph-based boost factor for related capabilities (0-1). @default 0.15 */
|
|
178
|
+
graphBoostFactor: number;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Default configuration values.
|
|
182
|
+
*/
|
|
183
|
+
export declare const DEFAULT_DISCOVERY_CONFIG: Readonly<CapabilityDiscoveryConfig>;
|
|
184
|
+
/**
|
|
185
|
+
* Edge types in the capability relationship graph.
|
|
186
|
+
*/
|
|
187
|
+
export type CapabilityEdgeType = 'DEPENDS_ON' | 'COMPOSED_WITH' | 'SAME_CATEGORY' | 'TAGGED_WITH';
|
|
188
|
+
/**
|
|
189
|
+
* A relationship edge between two capabilities.
|
|
190
|
+
*/
|
|
191
|
+
export interface CapabilityEdge {
|
|
192
|
+
sourceId: string;
|
|
193
|
+
targetId: string;
|
|
194
|
+
type: CapabilityEdgeType;
|
|
195
|
+
weight: number;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* A related capability returned from graph traversal.
|
|
199
|
+
*/
|
|
200
|
+
export interface RelatedCapability {
|
|
201
|
+
id: string;
|
|
202
|
+
weight: number;
|
|
203
|
+
relationType: CapabilityEdgeType;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Abstraction for capability relationship graphs.
|
|
207
|
+
* Implemented by graphology now; can be swapped for Neo4j later.
|
|
208
|
+
*/
|
|
209
|
+
export interface ICapabilityGraph {
|
|
210
|
+
/**
|
|
211
|
+
* Build the graph from capability descriptors and preset co-occurrence data.
|
|
212
|
+
*/
|
|
213
|
+
buildGraph(capabilities: CapabilityDescriptor[], presetCoOccurrences?: PresetCoOccurrence[]): void;
|
|
214
|
+
/**
|
|
215
|
+
* Get capabilities related to a given capability (1-hop neighbors).
|
|
216
|
+
*/
|
|
217
|
+
getRelated(capabilityId: string): RelatedCapability[];
|
|
218
|
+
/**
|
|
219
|
+
* Get the subgraph for a set of capability IDs.
|
|
220
|
+
*/
|
|
221
|
+
getSubgraph(capabilityIds: string[]): {
|
|
222
|
+
nodes: string[];
|
|
223
|
+
edges: CapabilityEdge[];
|
|
224
|
+
};
|
|
225
|
+
/** Number of nodes in the graph. */
|
|
226
|
+
nodeCount(): number;
|
|
227
|
+
/** Number of edges in the graph. */
|
|
228
|
+
edgeCount(): number;
|
|
229
|
+
/** Clear the graph. */
|
|
230
|
+
clear(): void;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Co-occurrence data from agent presets.
|
|
234
|
+
* Captures which capabilities are suggested together.
|
|
235
|
+
*/
|
|
236
|
+
export interface PresetCoOccurrence {
|
|
237
|
+
presetName: string;
|
|
238
|
+
capabilityIds: string[];
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* A scored search result from the capability index.
|
|
242
|
+
*/
|
|
243
|
+
export interface CapabilitySearchResult {
|
|
244
|
+
descriptor: CapabilityDescriptor;
|
|
245
|
+
score: number;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Sources for building the capability index.
|
|
249
|
+
*/
|
|
250
|
+
export interface CapabilityIndexSources {
|
|
251
|
+
/** Tool descriptors (from ToolOrchestrator or ITool[]) */
|
|
252
|
+
tools?: Array<{
|
|
253
|
+
id: string;
|
|
254
|
+
name: string;
|
|
255
|
+
displayName: string;
|
|
256
|
+
description: string;
|
|
257
|
+
category?: string;
|
|
258
|
+
inputSchema: JSONSchemaObject;
|
|
259
|
+
outputSchema?: JSONSchemaObject;
|
|
260
|
+
requiredCapabilities?: string[];
|
|
261
|
+
hasSideEffects?: boolean;
|
|
262
|
+
}>;
|
|
263
|
+
/** Skill entries (from SkillRegistry) */
|
|
264
|
+
skills?: Array<{
|
|
265
|
+
name: string;
|
|
266
|
+
description: string;
|
|
267
|
+
content: string;
|
|
268
|
+
category?: string;
|
|
269
|
+
tags?: string[];
|
|
270
|
+
requiredSecrets?: string[];
|
|
271
|
+
requiredTools?: string[];
|
|
272
|
+
sourcePath?: string;
|
|
273
|
+
metadata?: {
|
|
274
|
+
primaryEnv?: string;
|
|
275
|
+
requires?: {
|
|
276
|
+
bins?: string[];
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
}>;
|
|
280
|
+
/** Extension catalog entries */
|
|
281
|
+
extensions?: Array<{
|
|
282
|
+
id: string;
|
|
283
|
+
name: string;
|
|
284
|
+
displayName: string;
|
|
285
|
+
description: string;
|
|
286
|
+
category: string;
|
|
287
|
+
requiredSecrets?: string[];
|
|
288
|
+
available?: boolean;
|
|
289
|
+
}>;
|
|
290
|
+
/** Channel catalog entries */
|
|
291
|
+
channels?: Array<{
|
|
292
|
+
platform: string;
|
|
293
|
+
displayName: string;
|
|
294
|
+
description: string;
|
|
295
|
+
tier?: string;
|
|
296
|
+
capabilities?: string[];
|
|
297
|
+
}>;
|
|
298
|
+
/** File-based manifest entries */
|
|
299
|
+
manifests?: CapabilityDescriptor[];
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Structure of a CAPABILITY.yaml manifest file.
|
|
303
|
+
*/
|
|
304
|
+
export interface CapabilityManifestFile {
|
|
305
|
+
id: string;
|
|
306
|
+
kind: CapabilityKind;
|
|
307
|
+
name: string;
|
|
308
|
+
displayName: string;
|
|
309
|
+
description: string;
|
|
310
|
+
category: string;
|
|
311
|
+
tags?: string[];
|
|
312
|
+
requiredSecrets?: string[];
|
|
313
|
+
requiredTools?: string[];
|
|
314
|
+
hasSideEffects?: boolean;
|
|
315
|
+
inputSchema?: JSONSchemaObject;
|
|
316
|
+
skillContent?: string;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Options for a discovery query.
|
|
320
|
+
*/
|
|
321
|
+
export interface DiscoveryQueryOptions {
|
|
322
|
+
/** Override default config for this query */
|
|
323
|
+
config?: Partial<CapabilityDiscoveryConfig>;
|
|
324
|
+
/** Filter by capability kind */
|
|
325
|
+
kind?: CapabilityKind | 'any';
|
|
326
|
+
/** Filter by category */
|
|
327
|
+
category?: string;
|
|
328
|
+
/** Only include available capabilities */
|
|
329
|
+
onlyAvailable?: boolean;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* The main Capability Discovery Engine interface.
|
|
333
|
+
*/
|
|
334
|
+
export interface ICapabilityDiscoveryEngine {
|
|
335
|
+
/**
|
|
336
|
+
* Initialize the engine: build index + graph from all sources.
|
|
337
|
+
*/
|
|
338
|
+
initialize(sources: CapabilityIndexSources): Promise<void>;
|
|
339
|
+
/**
|
|
340
|
+
* Discover capabilities relevant to a user message.
|
|
341
|
+
* Returns a tiered, token-budgeted result.
|
|
342
|
+
*/
|
|
343
|
+
discover(userMessage: string, options?: DiscoveryQueryOptions): Promise<CapabilityDiscoveryResult>;
|
|
344
|
+
/**
|
|
345
|
+
* Get full detail for a specific capability (Tier 2 pull).
|
|
346
|
+
*/
|
|
347
|
+
getCapabilityDetail(id: string): CapabilityDescriptor | undefined;
|
|
348
|
+
/**
|
|
349
|
+
* Refresh the index incrementally (e.g., after manifest file changes).
|
|
350
|
+
*/
|
|
351
|
+
refreshIndex(sources?: Partial<CapabilityIndexSources>): Promise<void>;
|
|
352
|
+
/** Whether the engine is initialized. */
|
|
353
|
+
isInitialized(): boolean;
|
|
354
|
+
/** Get all registered capability IDs. */
|
|
355
|
+
listCapabilityIds(): string[];
|
|
356
|
+
}
|
|
357
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/discovery/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM/D;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC;AAEnG;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX,yBAAyB;IACzB,IAAI,EAAE,cAAc,CAAC;IAErB,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IAEb,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB,8FAA8F;IAC9F,QAAQ,EAAE,MAAM,CAAC;I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
5
|
+
* Provides unified type definitions for normalizing tools, skills, extensions,
|
|
6
|
+
* and channels into a searchable, tiered capability discovery system.
|
|
7
|
+
*
|
|
8
|
+
* Key concepts:
|
|
9
|
+
* - CapabilityDescriptor: Unified shape for any capability in the system
|
|
10
|
+
* - Three-tier context budgeting: Always → Retrieved summaries → Full details
|
|
11
|
+
* - ICapabilityGraph: Abstraction for relationship graphs (graphology now, Neo4j later)
|
|
12
|
+
*/
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// TIER SYSTEM
|
|
15
|
+
// ============================================================================
|
|
16
|
+
/**
|
|
17
|
+
* Tier classification for context budget management.
|
|
18
|
+
*
|
|
19
|
+
* Tier 0: Always in context (~150 tokens) — category summaries only
|
|
20
|
+
* Tier 1: Retrieved on relevance (~200 tokens) — name + description + key params
|
|
21
|
+
* Tier 2: Deep pull (~1500 tokens) — full schema + examples + relationship context
|
|
22
|
+
*/
|
|
23
|
+
export var CapabilityTier;
|
|
24
|
+
(function (CapabilityTier) {
|
|
25
|
+
/** Always in context: category summaries */
|
|
26
|
+
CapabilityTier[CapabilityTier["TIER_0_ALWAYS"] = 0] = "TIER_0_ALWAYS";
|
|
27
|
+
/** Retrieved on relevance: name + description + key params */
|
|
28
|
+
CapabilityTier[CapabilityTier["TIER_1_SUMMARY"] = 1] = "TIER_1_SUMMARY";
|
|
29
|
+
/** Deep pull: full schema + examples + relationship context */
|
|
30
|
+
CapabilityTier[CapabilityTier["TIER_2_FULL"] = 2] = "TIER_2_FULL";
|
|
31
|
+
})(CapabilityTier || (CapabilityTier = {}));
|
|
32
|
+
/**
|
|
33
|
+
* Default configuration values.
|
|
34
|
+
*/
|
|
35
|
+
export const DEFAULT_DISCOVERY_CONFIG = {
|
|
36
|
+
tier0TokenBudget: 200,
|
|
37
|
+
tier1TokenBudget: 800,
|
|
38
|
+
tier2TokenBudget: 2000,
|
|
39
|
+
tier1TopK: 5,
|
|
40
|
+
tier2TopK: 2,
|
|
41
|
+
tier1MinRelevance: 0.3,
|
|
42
|
+
useGraphReranking: true,
|
|
43
|
+
collectionName: 'capability_index',
|
|
44
|
+
graphBoostFactor: 0.15,
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/discovery/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAqFH,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,cAOX;AAPD,WAAY,cAAc;IACxB,4CAA4C;IAC5C,qEAAiB,CAAA;IACjB,8DAA8D;IAC9D,uEAAkB,CAAA;IAClB,+DAA+D;IAC/D,iEAAe,CAAA;AACjB,CAAC,EAPW,cAAc,KAAd,cAAc,QAOzB;AA6FD;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAwC;IAC3E,gBAAgB,EAAE,GAAG;IACrB,gBAAgB,EAAE,GAAG;IACrB,gBAAgB,EAAE,IAAI;IACtB,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,CAAC;IACZ,iBAAiB,EAAE,GAAG;IACtB,iBAAiB,EAAE,IAAI;IACvB,cAAc,EAAE,kBAAkB;IAClC,gBAAgB,EAAE,IAAI;CACvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@framers/agentos",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"description": "Modular AgentOS orchestration library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -88,6 +88,11 @@
|
|
|
88
88
|
"default": "./dist/core/tools/*.js",
|
|
89
89
|
"types": "./dist/core/tools/*.d.ts"
|
|
90
90
|
},
|
|
91
|
+
"./discovery": {
|
|
92
|
+
"import": "./dist/discovery/index.js",
|
|
93
|
+
"default": "./dist/discovery/index.js",
|
|
94
|
+
"types": "./dist/discovery/index.d.ts"
|
|
95
|
+
},
|
|
91
96
|
"./package.json": "./package.json",
|
|
92
97
|
"./*": {
|
|
93
98
|
"import": "./dist/*.js",
|