@cuylabs/agent-core 0.8.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/README.md +33 -17
- package/dist/chunk-2O4MCSQS.js +780 -0
- package/dist/chunk-2TTOLHBT.js +198 -0
- package/dist/chunk-5FMSGQVX.js +281 -0
- package/dist/chunk-5NVVNXPQ.js +288 -0
- package/dist/{chunk-CAA7FHIH.js → chunk-6HZBHFOL.js} +3 -103
- package/dist/chunk-CJI7PVS2.js +58 -0
- package/dist/{chunk-N6HWIEEA.js → chunk-CMYN2RCB.js} +278 -61
- package/dist/chunk-FII65CN7.js +117 -0
- package/dist/{chunk-IVUJDISU.js → chunk-GFTW23FV.js} +5 -14
- package/dist/chunk-I6PKJ7XQ.js +292 -0
- package/dist/{chunk-BDBZ3SLK.js → chunk-ICZ66572.js} +48 -4
- package/dist/chunk-KYLPMBHD.js +316 -0
- package/dist/chunk-MXAP4UG6.js +2956 -0
- package/dist/{chunk-RZITT45F.js → chunk-N3VX7FEE.js} +39 -6
- package/dist/{chunk-YSLSEQ6B.js → chunk-NDZWXCBZ.js} +218 -95
- package/dist/{chunk-P6YF7USR.js → chunk-Q742PSH3.js} +23 -38
- package/dist/chunk-QAL3OMI3.js +943 -0
- package/dist/{chunk-RFEKJKTO.js → chunk-RN6WZEUF.js} +330 -280
- package/dist/{chunk-ZXAKHMWH.js → chunk-ROTGCYDW.js} +22 -84
- package/dist/chunk-SPBFQXOT.js +0 -0
- package/dist/{chunk-LRHOS4ZN.js → chunk-SPILYYDF.js} +3 -2
- package/dist/chunk-SSFBF3US.js +602 -0
- package/dist/chunk-SZ2XBPTW.js +8 -0
- package/dist/chunk-T4UIX5D7.js +115 -0
- package/dist/chunk-TIHPYVAJ.js +102 -0
- package/dist/{chunk-YUUJK53A.js → chunk-TOTDGK3P.js} +1 -1
- package/dist/chunk-V4RFNEET.js +563 -0
- package/dist/chunk-VOUEJSW6.js +0 -0
- package/dist/{chunk-4BDA7DQY.js → chunk-WBPOZ7CL.js} +673 -273
- package/dist/chunk-X4VN4GIJ.js +185 -0
- package/dist/dispatch/index.d.ts +93 -0
- package/dist/dispatch/index.js +37 -0
- package/dist/events/index.d.ts +93 -0
- package/dist/events/index.js +6 -0
- package/dist/{runtime → execution}/index.d.ts +120 -34
- package/dist/{runtime → execution}/index.js +18 -13
- package/dist/index-BCqEGzBj.d.ts +251 -0
- package/dist/index.d.ts +490 -122
- package/dist/index.js +2104 -615
- package/dist/{errors → inference/errors}/index.d.ts +2 -2
- package/dist/{errors → inference/errors}/index.js +1 -1
- package/dist/inference/index.d.ts +16 -23
- package/dist/inference/index.js +45 -16
- package/dist/instance-BqV2D5pc.d.ts +5723 -0
- package/dist/logger/index.d.ts +50 -0
- package/dist/logger/index.js +11 -0
- package/dist/mcp/index.d.ts +5 -9
- package/dist/mcp/index.js +2 -3
- package/dist/middleware/index.d.ts +10 -149
- package/dist/middleware/index.js +11 -3
- package/dist/model-messages-B4nK9D1-.d.ts +13 -0
- package/dist/models/index.d.ts +23 -18
- package/dist/models/index.js +48 -11
- package/dist/models/reasoning/index.d.ts +4 -0
- package/dist/{reasoning → models/reasoning}/index.js +3 -3
- package/dist/plugin/index.d.ts +458 -0
- package/dist/plugin/index.js +32 -0
- package/dist/profiles/index.d.ts +55 -0
- package/dist/profiles/index.js +30 -0
- package/dist/prompt/index.d.ts +8 -12
- package/dist/prompt/index.js +3 -2
- package/dist/safety/index.d.ts +109 -14
- package/dist/safety/index.js +59 -3
- package/dist/sandbox/index.d.ts +81 -0
- package/dist/sandbox/index.js +1 -0
- package/dist/skill/index.d.ts +10 -8
- package/dist/skill/index.js +3 -3
- package/dist/storage/index.d.ts +12 -4
- package/dist/storage/index.js +1 -1
- package/dist/subagents/index.d.ts +177 -0
- package/dist/subagents/index.js +78 -0
- package/dist/team/index.d.ts +544 -0
- package/dist/team/index.js +41 -0
- package/dist/tool/host/index.d.ts +41 -0
- package/dist/tool/host/index.js +10 -0
- package/dist/tool/index.d.ts +125 -21
- package/dist/tool/index.js +20 -13
- package/dist/{types-VQgymC1N.d.ts → types-Bj_J8u_W.d.ts} +44 -64
- package/dist/{types-CHiPh8U2.d.ts → types-C_LCeYNg.d.ts} +7 -7
- package/dist/types-RSCv7nQ4.d.ts +59 -0
- package/package.json +58 -53
- package/dist/builder-UpOWQMW3.d.ts +0 -34
- package/dist/chunk-7MUFEN4K.js +0 -559
- package/dist/chunk-7VKQ4WPB.js +0 -73
- package/dist/chunk-BFM2YHNM.js +0 -222
- package/dist/chunk-DWYX7ASF.js +0 -26
- package/dist/chunk-KUVSERLJ.js +0 -50
- package/dist/chunk-N7P4PN3O.js +0 -84
- package/dist/chunk-SDSBEQXG.js +0 -157
- package/dist/chunk-SQU2AJHO.js +0 -305
- package/dist/chunk-VBWWUHWI.js +0 -724
- package/dist/chunk-VEKUXUVF.js +0 -41
- package/dist/chunk-VNQBHPCT.js +0 -398
- package/dist/chunk-WWYYNWEW.js +0 -259
- package/dist/context/index.d.ts +0 -259
- package/dist/context/index.js +0 -26
- package/dist/events-CE72w8W4.d.ts +0 -149
- package/dist/host/index.d.ts +0 -45
- package/dist/host/index.js +0 -8
- package/dist/index-CWSchSql.d.ts +0 -1058
- package/dist/messages-BYWGn8TY.d.ts +0 -110
- package/dist/presets/index.d.ts +0 -53
- package/dist/presets/index.js +0 -28
- package/dist/reasoning/index.d.ts +0 -116
- package/dist/registry-DwYqsQkX.d.ts +0 -164
- package/dist/runner-e2YRcUoX.d.ts +0 -786
- package/dist/scope/index.d.ts +0 -10
- package/dist/scope/index.js +0 -14
- package/dist/session-manager-B_CWGTsl.d.ts +0 -274
- package/dist/signal/index.d.ts +0 -28
- package/dist/signal/index.js +0 -6
- package/dist/sub-agent/index.d.ts +0 -23
- package/dist/sub-agent/index.js +0 -15
- package/dist/tool-BHbyUAy3.d.ts +0 -150
- package/dist/tool-DLXAR9Ce.d.ts +0 -145
- package/dist/tracker-DClqYqTj.d.ts +0 -96
- package/dist/tracking/index.d.ts +0 -111
- package/dist/tracking/index.js +0 -20
- package/dist/types-BfNpU8NS.d.ts +0 -270
- package/dist/types-BnpEOYV-.d.ts +0 -50
- package/dist/types-CQL-SvTn.d.ts +0 -29
- package/dist/types-CWm-7rvB.d.ts +0 -55
- package/dist/types-KKDrdU9Y.d.ts +0 -325
- package/dist/types-QA4WhEfz.d.ts +0 -138
- package/dist/types-QKHHQLLq.d.ts +0 -336
- package/dist/types-YuWV4ag7.d.ts +0 -72
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Message and token types for @cuylabs/agent-core
|
|
3
|
-
*
|
|
4
|
-
* Defines the message model used across conversations,
|
|
5
|
-
* including all role variants and token usage tracking.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Message roles
|
|
9
|
-
*/
|
|
10
|
-
type MessageRole = "user" | "assistant" | "tool" | "system";
|
|
11
|
-
/**
|
|
12
|
-
* Base message interface
|
|
13
|
-
*/
|
|
14
|
-
interface MessageBase {
|
|
15
|
-
id: string;
|
|
16
|
-
role: MessageRole;
|
|
17
|
-
createdAt: Date;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* User message
|
|
21
|
-
*/
|
|
22
|
-
interface UserMessage extends MessageBase {
|
|
23
|
-
role: "user";
|
|
24
|
-
content: string;
|
|
25
|
-
/** Optional custom system prompt for this message */
|
|
26
|
-
system?: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Assistant message
|
|
30
|
-
*/
|
|
31
|
-
interface AssistantMessage extends MessageBase {
|
|
32
|
-
role: "assistant";
|
|
33
|
-
content: string;
|
|
34
|
-
/** Finish reason */
|
|
35
|
-
finish?: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
36
|
-
/** Token usage for this response */
|
|
37
|
-
tokens?: TokenUsage;
|
|
38
|
-
/** Cost in USD */
|
|
39
|
-
cost?: number;
|
|
40
|
-
/** Error if any */
|
|
41
|
-
error?: MessageError;
|
|
42
|
-
/** Tool calls made by the assistant (when finish === "tool-calls") */
|
|
43
|
-
toolCalls?: Array<{
|
|
44
|
-
toolCallId: string;
|
|
45
|
-
toolName: string;
|
|
46
|
-
args: unknown;
|
|
47
|
-
}>;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Tool result message
|
|
51
|
-
*/
|
|
52
|
-
interface ToolMessage extends MessageBase {
|
|
53
|
-
role: "tool";
|
|
54
|
-
content: string;
|
|
55
|
-
toolCallId: string;
|
|
56
|
-
toolName: string;
|
|
57
|
-
result: unknown;
|
|
58
|
-
/**
|
|
59
|
-
* Timestamp when this tool result was compacted/pruned.
|
|
60
|
-
* Once set, this message won't be pruned again.
|
|
61
|
-
*/
|
|
62
|
-
compactedAt?: number;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* System message
|
|
66
|
-
*/
|
|
67
|
-
interface SystemMessage extends MessageBase {
|
|
68
|
-
role: "system";
|
|
69
|
-
content: string;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Union of all message types
|
|
73
|
-
*/
|
|
74
|
-
type Message = UserMessage | AssistantMessage | ToolMessage | SystemMessage;
|
|
75
|
-
/**
|
|
76
|
-
* Error in a message
|
|
77
|
-
*/
|
|
78
|
-
interface MessageError {
|
|
79
|
-
name: string;
|
|
80
|
-
message: string;
|
|
81
|
-
code?: string;
|
|
82
|
-
status?: number;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Token usage statistics
|
|
86
|
-
*/
|
|
87
|
-
interface TokenUsage {
|
|
88
|
-
inputTokens?: number;
|
|
89
|
-
outputTokens?: number;
|
|
90
|
-
totalTokens?: number;
|
|
91
|
-
/** Cache read tokens (if supported) */
|
|
92
|
-
cacheReadTokens?: number;
|
|
93
|
-
/** Cache write tokens (if supported) */
|
|
94
|
-
cacheWriteTokens?: number;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Session state
|
|
98
|
-
*/
|
|
99
|
-
interface Session {
|
|
100
|
-
id: string;
|
|
101
|
-
messages: Message[];
|
|
102
|
-
createdAt: Date;
|
|
103
|
-
updatedAt: Date;
|
|
104
|
-
/** Optional title */
|
|
105
|
-
title?: string;
|
|
106
|
-
/** Parent session ID for forking */
|
|
107
|
-
parentID?: string;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export type { AssistantMessage as A, Message as M, Session as S, TokenUsage as T, UserMessage as U, MessageBase as a, MessageError as b, MessageRole as c, SystemMessage as d, ToolMessage as e };
|
package/dist/presets/index.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { P as Preset, A as AppliedPreset } from '../types-BnpEOYV-.js';
|
|
2
|
-
import { T as Tool } from '../tool-BHbyUAy3.js';
|
|
3
|
-
import 'ai';
|
|
4
|
-
import '../types-CQaXbRsS.js';
|
|
5
|
-
import 'zod';
|
|
6
|
-
import '../tool-DLXAR9Ce.js';
|
|
7
|
-
import '../types-CHiPh8U2.js';
|
|
8
|
-
import '../types-CQL-SvTn.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Filter tools using preset allow/deny patterns.
|
|
12
|
-
*
|
|
13
|
-
* Explicit allow matches win over deny matches. This lets presets define a
|
|
14
|
-
* broad deny rule like `"*"` and then carve out a safe allow-list.
|
|
15
|
-
*/
|
|
16
|
-
declare function filterTools(tools: Tool.AnyInfo[], options: {
|
|
17
|
-
allow?: string[];
|
|
18
|
-
deny?: string[];
|
|
19
|
-
}): Tool.AnyInfo[];
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Apply a preset to available tools and a parent system prompt.
|
|
23
|
-
*/
|
|
24
|
-
declare function applyPreset(preset: Preset, availableTools: Tool.AnyInfo[], baseSystemPrompt?: string): AppliedPreset;
|
|
25
|
-
/**
|
|
26
|
-
* Merge multiple presets. Later presets override earlier scalar values.
|
|
27
|
-
*/
|
|
28
|
-
declare function mergePresets(...presets: Preset[]): Preset;
|
|
29
|
-
/**
|
|
30
|
-
* Create a custom preset with sensible defaults.
|
|
31
|
-
*/
|
|
32
|
-
declare function createPreset(options: Partial<Preset> & {
|
|
33
|
-
name: string;
|
|
34
|
-
}): Preset;
|
|
35
|
-
|
|
36
|
-
declare const explore: Preset;
|
|
37
|
-
declare const plan: Preset;
|
|
38
|
-
declare const review: Preset;
|
|
39
|
-
declare const quick: Preset;
|
|
40
|
-
declare const careful: Preset;
|
|
41
|
-
declare const code: Preset;
|
|
42
|
-
declare const watch: Preset;
|
|
43
|
-
declare const Presets: {
|
|
44
|
-
readonly explore: Preset;
|
|
45
|
-
readonly plan: Preset;
|
|
46
|
-
readonly review: Preset;
|
|
47
|
-
readonly quick: Preset;
|
|
48
|
-
readonly careful: Preset;
|
|
49
|
-
readonly code: Preset;
|
|
50
|
-
readonly watch: Preset;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export { AppliedPreset, Preset, Presets, applyPreset, careful, code, createPreset, explore, filterTools, mergePresets, plan, quick, review, watch };
|
package/dist/presets/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Presets,
|
|
3
|
-
applyPreset,
|
|
4
|
-
careful,
|
|
5
|
-
code,
|
|
6
|
-
createPreset,
|
|
7
|
-
explore,
|
|
8
|
-
filterTools,
|
|
9
|
-
mergePresets,
|
|
10
|
-
plan,
|
|
11
|
-
quick,
|
|
12
|
-
review,
|
|
13
|
-
watch
|
|
14
|
-
} from "../chunk-CAA7FHIH.js";
|
|
15
|
-
export {
|
|
16
|
-
Presets,
|
|
17
|
-
applyPreset,
|
|
18
|
-
careful,
|
|
19
|
-
code,
|
|
20
|
-
createPreset,
|
|
21
|
-
explore,
|
|
22
|
-
filterTools,
|
|
23
|
-
mergePresets,
|
|
24
|
-
plan,
|
|
25
|
-
quick,
|
|
26
|
-
review,
|
|
27
|
-
watch
|
|
28
|
-
};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { R as ReasoningLevel, a as ReasoningConfig } from '../types-CQaXbRsS.js';
|
|
2
|
-
export { E as EXTENDED_LEVELS, F as FIXED_LEVELS, S as STANDARD_LEVELS, s as shouldIncludeReasoningSummary } from '../types-CQaXbRsS.js';
|
|
3
|
-
import { P as ProviderCompatibility } from '../types-QA4WhEfz.js';
|
|
4
|
-
import { LanguageModel } from 'ai';
|
|
5
|
-
import { ProviderOptions } from '@ai-sdk/provider-utils';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Provider-Specific Reasoning Option Builders
|
|
9
|
-
*
|
|
10
|
-
* Each function takes a {@link ReasoningLevel} and returns the
|
|
11
|
-
* provider-options object expected by the Vercel AI SDK's
|
|
12
|
-
* `providerOptions` parameter.
|
|
13
|
-
*
|
|
14
|
-
* Provider key mapping (`getProviderOptionsKey`) is also defined
|
|
15
|
-
* here so that callers can wrap the raw options correctly.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Build OpenAI reasoning options.
|
|
20
|
-
*
|
|
21
|
-
* OpenAI reasoning models use:
|
|
22
|
-
* - `reasoningEffort` — controls depth
|
|
23
|
-
* - `reasoningSummary` — controls whether reasoning is streamed
|
|
24
|
-
* (`"auto"` = condensed summary, `"detailed"` = full)
|
|
25
|
-
*
|
|
26
|
-
* `reasoningSummary` requires a verified OpenAI organisation.
|
|
27
|
-
* Set `CODE_AGENT_DISABLE_REASONING_SUMMARY=true` to skip it.
|
|
28
|
-
*/
|
|
29
|
-
declare function buildOpenAIOptions(level: ReasoningLevel, compat?: ProviderCompatibility): Record<string, unknown> | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Build Anthropic thinking options.
|
|
32
|
-
*
|
|
33
|
-
* Uses `thinking.type: "enabled"` with `budgetTokens`.
|
|
34
|
-
*/
|
|
35
|
-
declare function buildAnthropicOptions(level: ReasoningLevel): Record<string, unknown> | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Build Google / Gemini reasoning options.
|
|
38
|
-
*
|
|
39
|
-
* - **Gemini 3+** uses `thinkingLevel` (`"low"` / `"high"`)
|
|
40
|
-
* - **Gemini 2.5 and earlier** uses `thinkingBudget` (token count)
|
|
41
|
-
*/
|
|
42
|
-
declare function buildGoogleOptions(level: ReasoningLevel, modelId?: string): Record<string, unknown> | undefined;
|
|
43
|
-
/**
|
|
44
|
-
* Build xAI / Grok reasoning options.
|
|
45
|
-
*/
|
|
46
|
-
declare function buildXAIOptions(level: ReasoningLevel): Record<string, unknown> | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* Build Groq reasoning options.
|
|
49
|
-
*/
|
|
50
|
-
declare function buildGroqOptions(level: ReasoningLevel): Record<string, unknown> | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* Build Amazon Bedrock reasoning options.
|
|
53
|
-
*
|
|
54
|
-
* - Anthropic / Claude models use `budgetTokens`
|
|
55
|
-
* - Amazon Nova models use `maxReasoningEffort`
|
|
56
|
-
*/
|
|
57
|
-
declare function buildBedrockOptions(level: ReasoningLevel, modelId?: string): Record<string, unknown> | undefined;
|
|
58
|
-
/**
|
|
59
|
-
* Build OpenRouter reasoning options.
|
|
60
|
-
*/
|
|
61
|
-
declare function buildOpenRouterOptions(level: ReasoningLevel): Record<string, unknown> | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Resolve the `providerOptions` key for a given SDK provider string.
|
|
64
|
-
*
|
|
65
|
-
* Falls back to the first dot-segment (e.g. `"foo.bar"` → `"foo"`).
|
|
66
|
-
*/
|
|
67
|
-
declare function getProviderOptionsKey(provider: string): string;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Reasoning Configuration & Option Builders
|
|
71
|
-
*
|
|
72
|
-
* Orchestrates capability detection and provider-specific option
|
|
73
|
-
* building to produce ready-to-use `providerOptions` for the
|
|
74
|
-
* Vercel AI SDK.
|
|
75
|
-
*
|
|
76
|
-
* Two flavours of every function are provided:
|
|
77
|
-
* - **Async** (`getReasoningConfig`, `buildReasoningOptions`) —
|
|
78
|
-
* uses the full capability resolver (network + cache).
|
|
79
|
-
* - **Sync** (`getReasoningConfigSync`, `buildReasoningOptionsSync`) —
|
|
80
|
-
* uses fast pattern-matching only (no network).
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Get the reasoning configuration for a model.
|
|
85
|
-
*
|
|
86
|
-
* Uses the full capability resolver (including network lookups)
|
|
87
|
-
* for the most accurate result.
|
|
88
|
-
*/
|
|
89
|
-
declare function getReasoningConfig(model: LanguageModel): Promise<ReasoningConfig>;
|
|
90
|
-
/**
|
|
91
|
-
* Synchronous reasoning config using pattern-matching only.
|
|
92
|
-
*
|
|
93
|
-
* Faster but less accurate than {@link getReasoningConfig}.
|
|
94
|
-
* Good for hot paths where async is impractical.
|
|
95
|
-
*/
|
|
96
|
-
declare function getReasoningConfigSync(model: LanguageModel): ReasoningConfig;
|
|
97
|
-
/**
|
|
98
|
-
* Build `providerOptions` for a reasoning level (async).
|
|
99
|
-
*
|
|
100
|
-
* Returns `undefined` when reasoning is off or unsupported.
|
|
101
|
-
*/
|
|
102
|
-
declare function buildReasoningOptions(model: LanguageModel, level: ReasoningLevel): Promise<ProviderOptions | undefined>;
|
|
103
|
-
/**
|
|
104
|
-
* Build `providerOptions` for a reasoning level (sync / pattern-only).
|
|
105
|
-
*/
|
|
106
|
-
declare function buildReasoningOptionsSync(model: LanguageModel, level: ReasoningLevel): ProviderOptions | undefined;
|
|
107
|
-
/**
|
|
108
|
-
* Check whether a model supports reasoning (async, full resolver).
|
|
109
|
-
*/
|
|
110
|
-
declare function supportsReasoning(model: LanguageModel): Promise<boolean>;
|
|
111
|
-
/**
|
|
112
|
-
* Synchronous check using pattern-matching only.
|
|
113
|
-
*/
|
|
114
|
-
declare function supportsReasoningSync(model: LanguageModel): boolean;
|
|
115
|
-
|
|
116
|
-
export { ReasoningConfig, ReasoningLevel, buildAnthropicOptions, buildBedrockOptions, buildGoogleOptions, buildGroqOptions, buildOpenAIOptions, buildOpenRouterOptions, buildReasoningOptions, buildReasoningOptionsSync, buildXAIOptions, getProviderOptionsKey, getReasoningConfig, getReasoningConfigSync, supportsReasoning, supportsReasoningSync };
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { S as SkillDiscoveryResult, a as SkillMetadata, b as SkillContent, c as SkillResource, d as SkillConfig } from './types-BfNpU8NS.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Skill Registry — in-memory store for discovered skills
|
|
5
|
-
*
|
|
6
|
-
* The registry is the central coordination point for the skill system.
|
|
7
|
-
* It holds discovered metadata (L1), handles on-demand content loading
|
|
8
|
-
* (L2/L3), provides the prompt summary for injection, and manages
|
|
9
|
-
* the lifecycle of skill state.
|
|
10
|
-
*
|
|
11
|
-
* ```
|
|
12
|
-
* discoverSkills() → SkillRegistry → promptSummary (L1 → system prompt)
|
|
13
|
-
* → loadSkill() (L2 → tool response)
|
|
14
|
-
* → loadResource (L3 → tool response)
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* The registry is designed to be created once per agent and shared
|
|
18
|
-
* across the agent's lifetime, including across forked sub-agents.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* const registry = await createSkillRegistry("/path/to/project", {
|
|
23
|
-
* externalDirs: [".agents", ".claude"],
|
|
24
|
-
* });
|
|
25
|
-
*
|
|
26
|
-
* // L1: summary goes into system prompt
|
|
27
|
-
* const summary = registry.formatSummary();
|
|
28
|
-
*
|
|
29
|
-
* // L2: agent calls skill tool → full content loaded
|
|
30
|
-
* const content = await registry.loadContent("testing");
|
|
31
|
-
*
|
|
32
|
-
* // L3: agent reads a bundled reference
|
|
33
|
-
* const ref = await registry.loadResource("testing", "references/patterns.md");
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* In-memory registry of discovered skills with lazy content loading.
|
|
39
|
-
*
|
|
40
|
-
* Holds L1 metadata for all skills. Content (L2) and resources (L3)
|
|
41
|
-
* are loaded on demand and cached for the registry's lifetime.
|
|
42
|
-
*/
|
|
43
|
-
declare class SkillRegistry {
|
|
44
|
-
/** All discovered skill metadata indexed by name */
|
|
45
|
-
private readonly skills;
|
|
46
|
-
/** Cached full content for skills that have been loaded */
|
|
47
|
-
private readonly contentCache;
|
|
48
|
-
/** Discovery metadata */
|
|
49
|
-
readonly discoveryResult: SkillDiscoveryResult;
|
|
50
|
-
constructor(discoveryResult: SkillDiscoveryResult);
|
|
51
|
-
/** Get a skill's metadata by name. Returns undefined if not found. */
|
|
52
|
-
get(name: string): SkillMetadata | undefined;
|
|
53
|
-
/** Check if a skill exists by name. */
|
|
54
|
-
has(name: string): boolean;
|
|
55
|
-
/** Get all skill metadata entries. */
|
|
56
|
-
list(): SkillMetadata[];
|
|
57
|
-
/** Number of registered skills. */
|
|
58
|
-
get size(): number;
|
|
59
|
-
/** Skill names as an array. */
|
|
60
|
-
get names(): string[];
|
|
61
|
-
/**
|
|
62
|
-
* Load a skill's full content (L2: body + resource listing).
|
|
63
|
-
*
|
|
64
|
-
* Results are cached — subsequent calls return the cached content
|
|
65
|
-
* without re-reading the filesystem.
|
|
66
|
-
*
|
|
67
|
-
* @param name Skill name
|
|
68
|
-
* @returns Full skill content, or null if the skill doesn't exist
|
|
69
|
-
*/
|
|
70
|
-
loadContent(name: string): Promise<SkillContent | null>;
|
|
71
|
-
/**
|
|
72
|
-
* Load a specific bundled resource from a skill (L3).
|
|
73
|
-
*
|
|
74
|
-
* The skill's content must be loaded first (via `loadContent`)
|
|
75
|
-
* so the resource listing is available.
|
|
76
|
-
*
|
|
77
|
-
* @param skillName Skill name
|
|
78
|
-
* @param relativePath Relative path to the resource within the skill dir
|
|
79
|
-
* @returns Resource file content as UTF-8 string
|
|
80
|
-
* @throws If the skill or resource doesn't exist
|
|
81
|
-
*/
|
|
82
|
-
loadResource(skillName: string, relativePath: string): Promise<string>;
|
|
83
|
-
/**
|
|
84
|
-
* Get the list of resources for a loaded skill.
|
|
85
|
-
*
|
|
86
|
-
* @param name Skill name
|
|
87
|
-
* @returns Resource list, or empty array if skill isn't loaded yet
|
|
88
|
-
*/
|
|
89
|
-
getResources(name: string): SkillResource[];
|
|
90
|
-
/**
|
|
91
|
-
* Format a summary of all available skills for injection into the system prompt.
|
|
92
|
-
*
|
|
93
|
-
* This is the L1 layer — the agent sees names and descriptions of all
|
|
94
|
-
* available skills, enabling it to decide which to activate via tool calls.
|
|
95
|
-
*
|
|
96
|
-
* The output format uses XML tags (consistent with the instruction format
|
|
97
|
-
* in `formatInstructions`) for clear delineation in the prompt.
|
|
98
|
-
*
|
|
99
|
-
* Returns empty string if no skills are available.
|
|
100
|
-
*
|
|
101
|
-
* @example Output:
|
|
102
|
-
* ```xml
|
|
103
|
-
* <available-skills>
|
|
104
|
-
*
|
|
105
|
-
* You have access to the following skills. To activate a skill and load its
|
|
106
|
-
* full instructions, call the `skill` tool with the skill's name.
|
|
107
|
-
*
|
|
108
|
-
* <skill name="testing" scope="project">
|
|
109
|
-
* Write comprehensive test suites with vitest, covering unit, integration,
|
|
110
|
-
* and snapshot testing patterns.
|
|
111
|
-
* </skill>
|
|
112
|
-
*
|
|
113
|
-
* <skill name="frontend-design" scope="user">
|
|
114
|
-
* Create distinctive, production-grade frontend interfaces with high design quality.
|
|
115
|
-
* </skill>
|
|
116
|
-
*
|
|
117
|
-
* </available-skills>
|
|
118
|
-
* ```
|
|
119
|
-
*/
|
|
120
|
-
formatSummary(): string;
|
|
121
|
-
/**
|
|
122
|
-
* Format the full content of a loaded skill for a tool response.
|
|
123
|
-
*
|
|
124
|
-
* Wraps the skill body in XML with metadata, and lists bundled resources
|
|
125
|
-
* so the agent knows what's available at L3.
|
|
126
|
-
*
|
|
127
|
-
* @param content Previously loaded skill content
|
|
128
|
-
* @returns Formatted string for tool response
|
|
129
|
-
*/
|
|
130
|
-
formatContent(content: SkillContent): string;
|
|
131
|
-
/** Clear the content cache, forcing reloads on next access. */
|
|
132
|
-
clearContentCache(): void;
|
|
133
|
-
/** Check if a skill's content has been loaded and cached. */
|
|
134
|
-
isContentLoaded(name: string): boolean;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Create a skill registry by discovering all available skills.
|
|
138
|
-
*
|
|
139
|
-
* This is the recommended way to initialize the skill system.
|
|
140
|
-
* It runs discovery, deduplicates by scope priority, and returns
|
|
141
|
-
* a ready-to-use registry.
|
|
142
|
-
*
|
|
143
|
-
* @param cwd Current working directory
|
|
144
|
-
* @param config Skill configuration
|
|
145
|
-
* @returns A populated SkillRegistry
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
* ```typescript
|
|
149
|
-
* const registry = await createSkillRegistry("/path/to/project", {
|
|
150
|
-
* externalDirs: [".agents", ".claude"],
|
|
151
|
-
* roots: ["./company-skills"],
|
|
152
|
-
* });
|
|
153
|
-
*
|
|
154
|
-
* console.log(`Found ${registry.size} skills`);
|
|
155
|
-
* console.log(registry.formatSummary());
|
|
156
|
-
* ```
|
|
157
|
-
*/
|
|
158
|
-
declare function createSkillRegistry(cwd: string, config?: SkillConfig): Promise<SkillRegistry>;
|
|
159
|
-
/**
|
|
160
|
-
* Create an empty skill registry (for agents that don't use skills).
|
|
161
|
-
*/
|
|
162
|
-
declare function emptySkillRegistry(): SkillRegistry;
|
|
163
|
-
|
|
164
|
-
export { SkillRegistry as S, createSkillRegistry as c, emptySkillRegistry as e };
|