@cuylabs/agent-core 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +33 -17
  2. package/dist/chunk-2O4MCSQS.js +780 -0
  3. package/dist/chunk-2TTOLHBT.js +198 -0
  4. package/dist/chunk-5FMSGQVX.js +281 -0
  5. package/dist/chunk-5NVVNXPQ.js +288 -0
  6. package/dist/{chunk-EKR6PKXU.js → chunk-6HZBHFOL.js} +3 -3
  7. package/dist/chunk-CJI7PVS2.js +58 -0
  8. package/dist/{chunk-WKHDSSXG.js → chunk-CMYN2RCB.js} +146 -46
  9. package/dist/chunk-FII65CN7.js +117 -0
  10. package/dist/{chunk-UHCJEM2E.js → chunk-ICZ66572.js} +13 -6
  11. package/dist/chunk-KYLPMBHD.js +316 -0
  12. package/dist/chunk-MXAP4UG6.js +2956 -0
  13. package/dist/{chunk-4QFNWPIF.js → chunk-N3VX7FEE.js} +35 -2
  14. package/dist/{chunk-MAZ5DY5B.js → chunk-NDZWXCBZ.js} +213 -78
  15. package/dist/{chunk-MHKK374K.js → chunk-Q742PSH3.js} +11 -27
  16. package/dist/{chunk-WGZAPU6N.js → chunk-QAL3OMI3.js} +15 -1
  17. package/dist/{chunk-UDCZ673N.js → chunk-RN6WZEUF.js} +27 -23
  18. package/dist/{chunk-ZXAKHMWH.js → chunk-ROTGCYDW.js} +22 -84
  19. package/dist/chunk-SPBFQXOT.js +0 -0
  20. package/dist/chunk-SSFBF3US.js +602 -0
  21. package/dist/chunk-SZ2XBPTW.js +8 -0
  22. package/dist/chunk-T4UIX5D7.js +115 -0
  23. package/dist/{chunk-IYWQOJMQ.js → chunk-TIHPYVAJ.js} +34 -34
  24. package/dist/{chunk-RKEW5WXI.js → chunk-TOTDGK3P.js} +1 -1
  25. package/dist/chunk-V4RFNEET.js +563 -0
  26. package/dist/chunk-VOUEJSW6.js +0 -0
  27. package/dist/{chunk-J4QDGZIA.js → chunk-WBPOZ7CL.js} +659 -275
  28. package/dist/chunk-X4VN4GIJ.js +185 -0
  29. package/dist/dispatch/index.d.ts +93 -0
  30. package/dist/dispatch/index.js +37 -0
  31. package/dist/events/index.d.ts +93 -0
  32. package/dist/events/index.js +6 -0
  33. package/dist/{runtime → execution}/index.d.ts +120 -35
  34. package/dist/{runtime → execution}/index.js +17 -11
  35. package/dist/index.d.ts +489 -115
  36. package/dist/index.js +1665 -462
  37. package/dist/inference/errors/index.js +1 -1
  38. package/dist/inference/index.d.ts +13 -21
  39. package/dist/inference/index.js +15 -12
  40. package/dist/instance-BqV2D5pc.d.ts +5723 -0
  41. package/dist/logger/index.d.ts +50 -0
  42. package/dist/logger/index.js +11 -0
  43. package/dist/mcp/index.d.ts +5 -9
  44. package/dist/mcp/index.js +2 -3
  45. package/dist/middleware/index.d.ts +10 -150
  46. package/dist/middleware/index.js +10 -2
  47. package/dist/model-messages-B4nK9D1-.d.ts +13 -0
  48. package/dist/models/index.d.ts +5 -2
  49. package/dist/models/index.js +2 -1
  50. package/dist/models/reasoning/index.js +2 -1
  51. package/dist/plugin/index.d.ts +55 -11
  52. package/dist/plugin/index.js +1 -1
  53. package/dist/profiles/index.d.ts +55 -0
  54. package/dist/{presets → profiles}/index.js +10 -10
  55. package/dist/prompt/index.d.ts +8 -13
  56. package/dist/safety/index.d.ts +109 -14
  57. package/dist/safety/index.js +59 -3
  58. package/dist/sandbox/index.d.ts +81 -0
  59. package/dist/sandbox/index.js +1 -0
  60. package/dist/skill/index.d.ts +10 -8
  61. package/dist/skill/index.js +2 -2
  62. package/dist/storage/index.d.ts +12 -4
  63. package/dist/storage/index.js +1 -1
  64. package/dist/subagents/index.d.ts +177 -0
  65. package/dist/subagents/index.js +78 -0
  66. package/dist/team/index.d.ts +544 -0
  67. package/dist/team/index.js +41 -0
  68. package/dist/tool/host/index.d.ts +41 -0
  69. package/dist/tool/host/index.js +10 -0
  70. package/dist/tool/index.d.ts +111 -21
  71. package/dist/tool/index.js +20 -13
  72. package/dist/{types-VQgymC1N.d.ts → types-Bj_J8u_W.d.ts} +44 -64
  73. package/dist/{types-CHiPh8U2.d.ts → types-C_LCeYNg.d.ts} +7 -7
  74. package/dist/types-RSCv7nQ4.d.ts +59 -0
  75. package/package.json +46 -47
  76. package/dist/builder-BgZ_j4Vs.d.ts +0 -35
  77. package/dist/chunk-5ARZJWD2.js +0 -259
  78. package/dist/chunk-DXFBQMXP.js +0 -53
  79. package/dist/chunk-H3FUYU52.js +0 -81
  80. package/dist/chunk-JLXG2SH7.js +0 -905
  81. package/dist/chunk-N7P4PN3O.js +0 -84
  82. package/dist/chunk-OFDKHNCX.js +0 -727
  83. package/dist/chunk-SDSBEQXG.js +0 -157
  84. package/dist/chunk-VEKUXUVF.js +0 -41
  85. package/dist/chunk-VNQBHPCT.js +0 -398
  86. package/dist/chunk-WWYYNWEW.js +0 -259
  87. package/dist/context/index.d.ts +0 -259
  88. package/dist/context/index.js +0 -26
  89. package/dist/events-CE72w8W4.d.ts +0 -149
  90. package/dist/host/index.d.ts +0 -45
  91. package/dist/host/index.js +0 -8
  92. package/dist/index-DQuTZ8xL.d.ts +0 -1335
  93. package/dist/messages-BYWGn8TY.d.ts +0 -110
  94. package/dist/presets/index.d.ts +0 -53
  95. package/dist/registry-DwYqsQkX.d.ts +0 -164
  96. package/dist/runner-CI-XeR16.d.ts +0 -91
  97. package/dist/scope/index.d.ts +0 -10
  98. package/dist/scope/index.js +0 -14
  99. package/dist/session-manager-KbYt2WUh.d.ts +0 -282
  100. package/dist/signal/index.d.ts +0 -28
  101. package/dist/signal/index.js +0 -6
  102. package/dist/sub-agent/index.d.ts +0 -24
  103. package/dist/sub-agent/index.js +0 -32
  104. package/dist/tool-CZWN3KbO.d.ts +0 -141
  105. package/dist/tool-DkhSCV2Y.d.ts +0 -145
  106. package/dist/tracker-DClqYqTj.d.ts +0 -96
  107. package/dist/tracking/index.d.ts +0 -111
  108. package/dist/tracking/index.js +0 -20
  109. package/dist/types-BfNpU8NS.d.ts +0 -270
  110. package/dist/types-BlOKk-Bb.d.ts +0 -330
  111. package/dist/types-BlZwmnuW.d.ts +0 -50
  112. package/dist/types-CQL-SvTn.d.ts +0 -29
  113. package/dist/types-CWm-7rvB.d.ts +0 -55
  114. package/dist/types-DTSkxakL.d.ts +0 -651
  115. package/dist/types-DmDwi2zI.d.ts +0 -339
  116. package/dist/types-YuWV4ag7.d.ts +0 -72
@@ -0,0 +1,50 @@
1
+ import { C as ConsoleLoggerOptions, L as Logger, F as FileLoggerOptions } from '../types-RSCv7nQ4.js';
2
+ export { a as LogLevel, b as LogMeta } from '../types-RSCv7nQ4.js';
3
+
4
+ /**
5
+ * Built-in logger implementations.
6
+ *
7
+ * - `silentLogger` — no-op (default for agents)
8
+ * - `createConsoleLogger` — pretty console output with level gating
9
+ * - `createFileLogger` — append-only file output for debugging
10
+ */
11
+
12
+ /**
13
+ * A logger that discards every message.
14
+ *
15
+ * This is the default used when no logger is supplied to `createAgent()`.
16
+ */
17
+ declare const silentLogger: Logger;
18
+ /**
19
+ * Create a console-backed logger with configurable minimum level.
20
+ *
21
+ * ```ts
22
+ * import { createConsoleLogger } from "@cuylabs/agent-core";
23
+ *
24
+ * const agent = createAgent({
25
+ * model,
26
+ * logger: createConsoleLogger({ level: "debug" }),
27
+ * });
28
+ * ```
29
+ *
30
+ * Respects the `AGENT_LOG_LEVEL` environment variable when no explicit
31
+ * level is supplied, falling back to `"warn"`.
32
+ */
33
+ declare function createConsoleLogger(options?: ConsoleLoggerOptions): Logger;
34
+ /**
35
+ * Create a file-backed logger that appends timestamped entries.
36
+ *
37
+ * ```ts
38
+ * import { createFileLogger } from "@cuylabs/agent-core";
39
+ *
40
+ * const logger = createFileLogger({ filePath: "/tmp/team.log", level: "debug" });
41
+ * ```
42
+ *
43
+ * The log file is created (with parent directories) if it doesn't exist.
44
+ * All writes are non-blocking; write errors are silently swallowed.
45
+ */
46
+ declare function createFileLogger(options: FileLoggerOptions): Logger & {
47
+ close(): void;
48
+ };
49
+
50
+ export { ConsoleLoggerOptions, FileLoggerOptions, Logger, createConsoleLogger, createFileLogger, silentLogger };
@@ -0,0 +1,11 @@
1
+ import "../chunk-SPBFQXOT.js";
2
+ import {
3
+ createConsoleLogger,
4
+ createFileLogger,
5
+ silentLogger
6
+ } from "../chunk-T4UIX5D7.js";
7
+ export {
8
+ createConsoleLogger,
9
+ createFileLogger,
10
+ silentLogger
11
+ };
@@ -1,15 +1,11 @@
1
- import { M as MCPConfig, a as MCPManager, d as MCPServerConfig, H as HttpTransportConfig, S as SseTransportConfig, f as StdioTransportConfig } from '../types-VQgymC1N.js';
2
- export { b as MCPPrompt, c as MCPResource, e as MCPServerStatus } from '../types-VQgymC1N.js';
1
+ import { M as MCPConfig, a as MCPManager, R as RemoteTransportConfig, d as StdioTransportConfig } from '../types-Bj_J8u_W.js';
2
+ export { H as HttpTransportConfig, b as MCPServerConfig, c as MCPServerStatus, S as SseTransportConfig } from '../types-Bj_J8u_W.js';
3
3
  import 'ai';
4
4
 
5
5
  /**
6
6
  * Create an MCP manager for connecting to multiple MCP servers.
7
7
  */
8
8
  declare function createMCPManager(config: MCPConfig): MCPManager;
9
- /**
10
- * Helper to define a single MCP server config.
11
- */
12
- declare function defineServer(config: MCPServerConfig): MCPServerConfig;
13
9
  /**
14
10
  * Helper to create a stdio server config.
15
11
  */
@@ -17,10 +13,10 @@ declare function stdioServer(command: string, args?: string[], options?: Omit<St
17
13
  /**
18
14
  * Helper to create an HTTP server config.
19
15
  */
20
- declare function httpServer(url: string, options?: Omit<HttpTransportConfig, "transport" | "url">): HttpTransportConfig;
16
+ declare function httpServer(url: string, options?: Omit<RemoteTransportConfig, "transport" | "url">): RemoteTransportConfig;
21
17
  /**
22
18
  * Helper to create an SSE server config.
23
19
  */
24
- declare function sseServer(url: string, options?: Omit<SseTransportConfig, "transport" | "url">): SseTransportConfig;
20
+ declare function sseServer(url: string, options?: Omit<RemoteTransportConfig, "transport" | "url">): RemoteTransportConfig;
25
21
 
26
- export { HttpTransportConfig, MCPConfig, MCPManager, MCPServerConfig, SseTransportConfig, StdioTransportConfig, createMCPManager, defineServer, httpServer, sseServer, stdioServer };
22
+ export { MCPConfig, MCPManager, RemoteTransportConfig, StdioTransportConfig, createMCPManager, httpServer, sseServer, stdioServer };
package/dist/mcp/index.js CHANGED
@@ -1,13 +1,12 @@
1
1
  import {
2
2
  createMCPManager,
3
- defineServer,
4
3
  httpServer,
5
4
  sseServer,
6
5
  stdioServer
7
- } from "../chunk-ZXAKHMWH.js";
6
+ } from "../chunk-ROTGCYDW.js";
7
+ import "../chunk-T4UIX5D7.js";
8
8
  export {
9
9
  createMCPManager,
10
- defineServer,
11
10
  httpServer,
12
11
  sseServer,
13
12
  stdioServer
@@ -1,154 +1,14 @@
1
- import { A as AgentMiddleware } from '../types-DTSkxakL.js';
2
- export { g as AgentModelHooks, B as BlockedModelCall, a as ModelCallContext, M as ModelCallInput, b as ModelCallOutput, T as ToolCallDecision } from '../types-DTSkxakL.js';
3
- export { M as MiddlewareRunner } from '../runner-CI-XeR16.js';
4
- import { a as ApprovalConfig, R as RiskLevel } from '../types-CWm-7rvB.js';
5
- import { TelemetrySettings } from 'ai';
6
- import '@ai-sdk/provider-utils';
7
- import '../events-CE72w8W4.js';
8
- import '../messages-BYWGn8TY.js';
9
- import '../types-BfNpU8NS.js';
10
- import '../types-CQL-SvTn.js';
11
- import '../tool-DkhSCV2Y.js';
12
- import '../types-CHiPh8U2.js';
13
- import '../tool-CZWN3KbO.js';
1
+ import { bR as OtelMiddlewareConfig, L as AgentMiddleware, de as TelemetryConfig, df as TelemetryConfigResult } from '../instance-BqV2D5pc.js';
2
+ export { N as AgentModelHooks, ac as ApprovalAgentMiddleware, al as ApprovalMiddlewareConfig, as as BlockedModelCall, au as ChatLifecycleContext, b as MiddlewareRunner, d as ModelCallContext, bK as ModelCallInput, bL as ModelCallOutput, dh as ToolCallDecision, di as ToolCallOutput, dz as approvalMiddleware, dM as isApprovalMiddleware, dN as isBlockedModelCall } from '../instance-BqV2D5pc.js';
3
+ import '../types-C_LCeYNg.js';
4
+ import 'ai';
5
+ import '../types-RSCv7nQ4.js';
14
6
  import 'zod';
15
7
  import '../types-CQaXbRsS.js';
16
-
17
- /**
18
- * Approval Middleware
19
- *
20
- * Wraps the existing approval system as an AgentMiddleware.
21
- * This is how approval finally gets wired into the tool execution
22
- * pipeline — no more dead code.
23
- *
24
- * @example
25
- * ```typescript
26
- * import { createAgent, approvalMiddleware } from "@cuylabs/agent-core";
27
- *
28
- * const agent = createAgent({
29
- * model: anthropic("claude-sonnet-4-20250514"),
30
- * tools: [read, write, bash],
31
- * middleware: [
32
- * approvalMiddleware({
33
- * rules: [
34
- * { pattern: "src/*", tool: "read_file", action: "allow" },
35
- * ],
36
- * onRequest: async (req) => {
37
- * // Prompt user in your UI
38
- * return await askUser(req);
39
- * },
40
- * }),
41
- * ],
42
- * });
43
- * ```
44
- */
45
-
46
- /**
47
- * Configuration for the approval middleware.
48
- *
49
- * Extends the existing ApprovalConfig with middleware-specific options.
50
- */
51
- interface ApprovalMiddlewareConfig extends ApprovalConfig {
52
- /**
53
- * Custom risk classification for tools.
54
- *
55
- * Overrides the built-in risk map. Tools not listed here
56
- * fall back to the default classification.
57
- *
58
- * @example
59
- * ```typescript
60
- * customRisks: {
61
- * "my_deploy_tool": "dangerous",
62
- * "my_lint_tool": "safe",
63
- * }
64
- * ```
65
- */
66
- customRisks?: Record<string, RiskLevel>;
67
- }
68
- /**
69
- * Create an approval middleware from an ApprovalConfig.
70
- *
71
- * This bridges the existing `createApprovalHandler` into the middleware
72
- * system. The `beforeToolCall` hook checks rules, classifies risk,
73
- * and calls the approval handler when needed.
74
- *
75
- * @param config - Approval configuration (rules, handler, timeout, etc.)
76
- * @returns An AgentMiddleware that gates tool execution
77
- */
78
- declare function approvalMiddleware(config?: ApprovalMiddlewareConfig): AgentMiddleware;
79
-
80
- /**
81
- * Configuration for the OpenTelemetry middleware.
82
- */
83
- interface OtelMiddlewareConfig {
84
- /**
85
- * Whether to record tool call arguments as span attributes.
86
- * Defaults to `true`.
87
- */
88
- recordInputs?: boolean;
89
- /**
90
- * Whether to record tool results as span attributes.
91
- * Defaults to `true`.
92
- */
93
- recordOutputs?: boolean;
94
- /**
95
- * Agent name — used in the root span name and attributes.
96
- * Falls back to `"agent"`.
97
- */
98
- agentName?: string;
99
- /** Agent description — recorded as `gen_ai.agent.description`. */
100
- agentDescription?: string;
101
- /**
102
- * Whether to emit `execute_tool` spans for tool calls.
103
- * Defaults to `true`.
104
- */
105
- emitToolSpans?: boolean;
106
- /**
107
- * TTL in milliseconds for orphaned spans.
108
- * Defaults to 5 minutes.
109
- */
110
- spanTimeoutMs?: number;
111
- }
112
- /**
113
- * Configuration for `createTelemetryConfig()`.
114
- */
115
- interface TelemetryConfig {
116
- /** Agent name — used in span names and `gen_ai.agent.name`. */
117
- agentName: string;
118
- /** Agent description — recorded as `gen_ai.agent.description`. */
119
- agentDescription?: string;
120
- /** Record tool arguments and LLM prompts in spans. Defaults to `true`. */
121
- recordInputs?: boolean;
122
- /** Record tool results and LLM responses in spans. Defaults to `true`. */
123
- recordOutputs?: boolean;
124
- /** Emit `execute_tool` spans from our middleware. Defaults to `true`. */
125
- emitToolSpans?: boolean;
126
- /** TTL in ms for orphaned spans. Defaults to 5 minutes. */
127
- spanTimeoutMs?: number;
128
- /**
129
- * An OTel `SpanProcessor` to auto-create and register a `NodeTracerProvider`.
130
- */
131
- spanProcessor?: unknown;
132
- /**
133
- * OTel service name for the `NodeTracerProvider` resource.
134
- * Defaults to `agentName`.
135
- */
136
- serviceName?: string;
137
- }
138
- /**
139
- * Result of `createTelemetryConfig()`.
140
- */
141
- interface TelemetryConfigResult {
142
- /** Agent-core middleware. */
143
- middleware: AgentMiddleware;
144
- /** AI SDK telemetry settings. */
145
- telemetry: TelemetrySettings;
146
- /**
147
- * Flush and shut down the auto-created tracer provider.
148
- * No-op when no provider was auto-created.
149
- */
150
- shutdown: () => Promise<void>;
151
- }
8
+ import '../types-Bj_J8u_W.js';
9
+ import '@ai-sdk/provider-utils';
10
+ import '../sandbox/index.js';
11
+ import '../llm-error-D93FNNLY.js';
152
12
 
153
13
  declare function otelMiddleware(config?: OtelMiddlewareConfig): AgentMiddleware;
154
14
 
@@ -247,4 +107,4 @@ interface PromptCacheConfig {
247
107
  */
248
108
  declare function promptCacheMiddleware(config?: PromptCacheConfig): AgentMiddleware;
249
109
 
250
- export { AgentMiddleware, type ApprovalMiddlewareConfig, type CacheTTL, type OtelMiddlewareConfig, type PromptCacheConfig, type TelemetryConfig, type TelemetryConfigResult, approvalMiddleware, createTelemetryConfig, otelMiddleware, promptCacheMiddleware };
110
+ export { AgentMiddleware, type CacheTTL, OtelMiddlewareConfig, type PromptCacheConfig, TelemetryConfig, TelemetryConfigResult, createTelemetryConfig, otelMiddleware, promptCacheMiddleware };
@@ -2,15 +2,23 @@ import {
2
2
  MiddlewareRunner,
3
3
  approvalMiddleware,
4
4
  createTelemetryConfig,
5
+ isApprovalMiddleware,
5
6
  otelMiddleware,
6
7
  promptCacheMiddleware
7
- } from "../chunk-MAZ5DY5B.js";
8
- import "../chunk-5ARZJWD2.js";
8
+ } from "../chunk-NDZWXCBZ.js";
9
+ import {
10
+ isBlockedModelCall
11
+ } from "../chunk-CJI7PVS2.js";
9
12
  import "../chunk-I6PKJ7XQ.js";
13
+ import "../chunk-V4RFNEET.js";
14
+ import "../chunk-FII65CN7.js";
15
+ import "../chunk-T4UIX5D7.js";
10
16
  export {
11
17
  MiddlewareRunner,
12
18
  approvalMiddleware,
13
19
  createTelemetryConfig,
20
+ isApprovalMiddleware,
21
+ isBlockedModelCall,
14
22
  otelMiddleware,
15
23
  promptCacheMiddleware
16
24
  };
@@ -0,0 +1,13 @@
1
+ import { ModelMessage } from 'ai';
2
+ import { M as Message } from './instance-BqV2D5pc.js';
3
+
4
+ /**
5
+ * Convert framework messages into Vercel AI SDK model messages.
6
+ *
7
+ * This keeps the message translation logic reusable for workflow activities
8
+ * and other runtime integrations without forcing those integrations to reach
9
+ * into `Agent` internals.
10
+ */
11
+ declare function convertAgentMessagesToModelMessages(messages: Message[]): ModelMessage[];
12
+
13
+ export { convertAgentMessagesToModelMessages as c };
@@ -1,6 +1,7 @@
1
1
  import { LanguageModel } from 'ai';
2
2
  import { C as CapabilitySource, S as SourcePriority, b as SourceResult, P as ProviderCompatibility, R as ResolverOptions, a as ModelEntry, M as ModelCapabilities } from '../index-BCqEGzBj.js';
3
3
  export { D as DEFAULT_RESOLVER_OPTIONS, I as InputModality, O as OutputModality, c as buildAnthropicOptions, d as buildBedrockOptions, e as buildGoogleOptions, f as buildGroqOptions, g as buildOpenAIOptions, h as buildOpenRouterOptions, i as buildReasoningOptions, j as buildReasoningOptionsSync, k as buildXAIOptions, l as getProviderOptionsKey, m as getReasoningConfig, n as getReasoningConfigSync, s as supportsReasoning, o as supportsReasoningSync } from '../index-BCqEGzBj.js';
4
+ import { L as Logger } from '../types-RSCv7nQ4.js';
4
5
  export { E as EXTENDED_LEVELS, F as FIXED_LEVELS, a as ReasoningConfig, R as ReasoningLevel, S as STANDARD_LEVELS, s as shouldIncludeReasoningSummary } from '../types-CQaXbRsS.js';
5
6
  import '@ai-sdk/provider-utils';
6
7
 
@@ -100,7 +101,8 @@ declare class CapabilityCache {
100
101
  private memoryCache;
101
102
  private ttlMs;
102
103
  private loaded;
103
- constructor(options?: Partial<ResolverOptions>);
104
+ private readonly log;
105
+ constructor(options?: Partial<ResolverOptions>, logger?: Logger);
104
106
  private load;
105
107
  get(modelId: string, provider?: string): Promise<ModelEntry | undefined>;
106
108
  set(entry: ModelEntry): Promise<void>;
@@ -193,7 +195,8 @@ declare class ModelCapabilityResolver {
193
195
  private sources;
194
196
  private initialized;
195
197
  private initPromise;
196
- constructor(options?: Partial<ResolverOptions>);
198
+ private readonly log;
199
+ constructor(options?: Partial<ResolverOptions>, logger?: Logger);
197
200
  /**
198
201
  * Initialize the resolver (load cache, optionally fetch remote)
199
202
  */
@@ -28,7 +28,7 @@ import {
28
28
  shouldIncludeReasoningSummary,
29
29
  supportsReasoning,
30
30
  supportsReasoningSync
31
- } from "../chunk-UDCZ673N.js";
31
+ } from "../chunk-RN6WZEUF.js";
32
32
  import {
33
33
  DEFAULT_RESOLVER_OPTIONS,
34
34
  PatternCapabilitySource,
@@ -42,6 +42,7 @@ import {
42
42
  inferProvider,
43
43
  likelySupportsReasoning
44
44
  } from "../chunk-I6PKJ7XQ.js";
45
+ import "../chunk-T4UIX5D7.js";
45
46
  export {
46
47
  CacheCapabilitySource,
47
48
  CapabilityCache,
@@ -17,8 +17,9 @@ import {
17
17
  shouldIncludeReasoningSummary,
18
18
  supportsReasoning,
19
19
  supportsReasoningSync
20
- } from "../../chunk-UDCZ673N.js";
20
+ } from "../../chunk-RN6WZEUF.js";
21
21
  import "../../chunk-I6PKJ7XQ.js";
22
+ import "../../chunk-T4UIX5D7.js";
22
23
  export {
23
24
  EXTENDED_LEVELS,
24
25
  FIXED_LEVELS,
@@ -1,16 +1,14 @@
1
- import { A as AgentMiddleware, c as PromptSection } from '../types-DTSkxakL.js';
2
- import { T as Tool } from '../tool-CZWN3KbO.js';
1
+ import { T as Tool, L as AgentMiddleware, c5 as PromptSection } from '../instance-BqV2D5pc.js';
3
2
  import { ZodType } from 'zod';
4
3
  import { Jiti } from 'jiti';
4
+ import '../types-C_LCeYNg.js';
5
5
  import 'ai';
6
- import '@ai-sdk/provider-utils';
7
- import '../events-CE72w8W4.js';
8
- import '../messages-BYWGn8TY.js';
9
- import '../types-BfNpU8NS.js';
10
- import '../types-CQL-SvTn.js';
11
- import '../tool-DkhSCV2Y.js';
12
- import '../types-CHiPh8U2.js';
6
+ import '../types-RSCv7nQ4.js';
13
7
  import '../types-CQaXbRsS.js';
8
+ import '../types-Bj_J8u_W.js';
9
+ import '@ai-sdk/provider-utils';
10
+ import '../sandbox/index.js';
11
+ import '../llm-error-D93FNNLY.js';
14
12
 
15
13
  /**
16
14
  * PluginEventBus — string-keyed pub/sub for inter-plugin communication.
@@ -57,6 +55,22 @@ interface PluginCompatibility {
57
55
  /** Supported Node.js version range (supports exact or comparator syntax). */
58
56
  node?: string;
59
57
  }
58
+ /** Host-readable capability tags such as "workspace", "session", or "network". */
59
+ type PluginCapabilityTag = string;
60
+ /**
61
+ * Static surface contract for a plugin.
62
+ *
63
+ * This keeps the server/plugin boundary explicit: plugin behavior is headless
64
+ * by default, and any future UI surface must remain a separate client concern.
65
+ */
66
+ interface PluginSurfaceContract {
67
+ tools?: boolean;
68
+ middleware?: boolean;
69
+ commands?: boolean;
70
+ promptSections?: boolean;
71
+ lifecycle?: boolean;
72
+ ui?: "none" | "separate-client-extension";
73
+ }
60
74
  interface PluginManifest {
61
75
  /** Unique plugin identifier (e.g. "brave-search", "finance") */
62
76
  id: string;
@@ -68,8 +82,32 @@ interface PluginManifest {
68
82
  version?: string;
69
83
  /** Compatibility requirements validated by the host at load time. */
70
84
  compatibility?: PluginCompatibility;
85
+ /** Host-readable business capability tags. */
86
+ capabilities?: PluginCapabilityTag[];
87
+ /** Explicit contract for which host-owned surfaces this plugin contributes to. */
88
+ surfaces?: PluginSurfaceContract;
71
89
  }
72
- /** A user-facing command registered by a plugin. Host-dependent surfacing. */
90
+ /**
91
+ * Host-readable metadata for a plugin command.
92
+ *
93
+ * This is the sanctioned way to enrich command discovery and routing without
94
+ * coupling plugins to a specific renderer or UI widget system.
95
+ */
96
+ interface PluginCommandMetadata {
97
+ /** Grouping hint for help views, palettes, and command inventories. */
98
+ category?: string;
99
+ /** Short argument hint shown in usage/help surfaces. */
100
+ argsHint?: string;
101
+ /** Host-readable capability tags such as "workspace", "session", or "network". */
102
+ capabilities?: PluginCapabilityTag[];
103
+ }
104
+ /**
105
+ * A user-facing command registered by a plugin.
106
+ *
107
+ * Commands are intentionally host-surfaced, not renderer-owned UI. Plugins
108
+ * should return results and metadata here instead of trying to reach into TUI
109
+ * or web implementation details.
110
+ */
73
111
  interface PluginCommand {
74
112
  /** Command name (without leading slash) */
75
113
  name: string;
@@ -79,6 +117,8 @@ interface PluginCommand {
79
117
  summary: string;
80
118
  /** Execute the command. Return the text to display, or null for silent. */
81
119
  execute: (args: string) => Promise<string | null>;
120
+ /** Optional host-readable metadata for richer discovery and routing. */
121
+ metadata?: PluginCommandMetadata;
82
122
  }
83
123
  type PluginSettingsSchema<T = unknown> = ZodType<T>;
84
124
  interface PluginSettingsDefinition<T = unknown> {
@@ -283,6 +323,10 @@ interface PluginDefinition {
283
323
  version?: string;
284
324
  /** Host/runtime compatibility validated before the plugin is committed. */
285
325
  compatibility?: PluginCompatibility;
326
+ /** Host-readable business capability tags for catalogs and inventories. */
327
+ capabilities?: PluginCapabilityTag[];
328
+ /** Explicit contract for the host-owned surfaces this plugin contributes to. */
329
+ surfaces?: PluginSurfaceContract;
286
330
  /** Optional settings schema to validate before the plugin is committed. */
287
331
  settings?: PluginSettingsDefinition;
288
332
  /** Tools the LLM can call. Statically declared — inspectable without execution. */
@@ -411,4 +455,4 @@ declare class PluginRegistry {
411
455
  private runDeactivateHooks;
412
456
  }
413
457
 
414
- export { type DefinePluginInit, type DiscoveredPlugin, LayeredSettings, NullSettings, type PluginActivateContext, type PluginCommand, type PluginCompatibility, type PluginContext, type PluginContributions, type PluginDefinition, PluginEventBus, type PluginEventBusAPI, type PluginEventHandler, type PluginInit, type PluginLifecycleHooks, type PluginLoaderOptions, type PluginManifest, PluginRegistry, type PluginRegistryCompatibilityOptions, type PluginRegistryOptions, type PluginRegistryTimeoutOptions, type PluginSessionContext, type PluginSettingsDefinition, type PluginSettingsProvider, type PluginSettingsSchema, type PluginUnsubscribe, StaticSettings, ValidatedSettings, definePlugin, discoverPlugins, getPluginLoader, isDefinedPlugin, loadPluginModule, resetFrameworkAliases, resetPluginLoader, resolveFrameworkAliases };
458
+ export { type DefinePluginInit, type DiscoveredPlugin, LayeredSettings, NullSettings, type PluginActivateContext, type PluginCapabilityTag, type PluginCommand, type PluginCommandMetadata, type PluginCompatibility, type PluginContext, type PluginContributions, type PluginDefinition, PluginEventBus, type PluginEventBusAPI, type PluginEventHandler, type PluginInit, type PluginLifecycleHooks, type PluginLoaderOptions, type PluginManifest, PluginRegistry, type PluginRegistryCompatibilityOptions, type PluginRegistryOptions, type PluginRegistryTimeoutOptions, type PluginSessionContext, type PluginSettingsDefinition, type PluginSettingsProvider, type PluginSettingsSchema, type PluginSurfaceContract, type PluginUnsubscribe, StaticSettings, ValidatedSettings, definePlugin, discoverPlugins, getPluginLoader, isDefinedPlugin, loadPluginModule, resetFrameworkAliases, resetPluginLoader, resolveFrameworkAliases };
@@ -13,7 +13,7 @@ import {
13
13
  resetFrameworkAliases,
14
14
  resetPluginLoader,
15
15
  resolveFrameworkAliases
16
- } from "../chunk-WGZAPU6N.js";
16
+ } from "../chunk-QAL3OMI3.js";
17
17
  export {
18
18
  LayeredSettings,
19
19
  NullSettings,
@@ -0,0 +1,55 @@
1
+ import { T as Tool, c2 as Profile, aa as AppliedProfile } from '../instance-BqV2D5pc.js';
2
+ import '../types-C_LCeYNg.js';
3
+ import 'ai';
4
+ import '../types-RSCv7nQ4.js';
5
+ import 'zod';
6
+ import '../types-CQaXbRsS.js';
7
+ import '../types-Bj_J8u_W.js';
8
+ import '@ai-sdk/provider-utils';
9
+ import '../sandbox/index.js';
10
+ import '../llm-error-D93FNNLY.js';
11
+
12
+ /**
13
+ * Filter tools using profile allow/deny patterns.
14
+ *
15
+ * Explicit allow matches win over deny matches. This lets profiles define a
16
+ * broad deny rule like `"*"` and then carve out a safe allow-list.
17
+ */
18
+ declare function filterTools(tools: Tool.AnyInfo[], options: {
19
+ allow?: string[];
20
+ deny?: string[];
21
+ }): Tool.AnyInfo[];
22
+
23
+ /**
24
+ * Apply a profile to available tools and a parent system prompt.
25
+ */
26
+ declare function applyProfile(profile: Profile, availableTools: Tool.AnyInfo[], baseSystemPrompt?: string): AppliedProfile;
27
+ /**
28
+ * Merge multiple profiles. Later profiles override earlier scalar values.
29
+ */
30
+ declare function mergeProfiles(...profiles: Profile[]): Profile;
31
+ /**
32
+ * Create a custom profile with sensible defaults.
33
+ */
34
+ declare function createProfile(options: Partial<Profile> & {
35
+ name: string;
36
+ }): Profile;
37
+
38
+ declare const explore: Profile;
39
+ declare const plan: Profile;
40
+ declare const review: Profile;
41
+ declare const quick: Profile;
42
+ declare const careful: Profile;
43
+ declare const code: Profile;
44
+ declare const watch: Profile;
45
+ declare const Profiles: {
46
+ readonly explore: Profile;
47
+ readonly plan: Profile;
48
+ readonly review: Profile;
49
+ readonly quick: Profile;
50
+ readonly careful: Profile;
51
+ readonly code: Profile;
52
+ readonly watch: Profile;
53
+ };
54
+
55
+ export { AppliedProfile, Profile, Profiles, applyProfile, careful, code, createProfile, explore, filterTools, mergeProfiles, plan, quick, review, watch };
@@ -1,11 +1,11 @@
1
1
  import {
2
- applyPreset,
3
- createPreset,
2
+ applyProfile,
3
+ createProfile,
4
4
  filterTools,
5
- mergePresets
6
- } from "../chunk-IYWQOJMQ.js";
5
+ mergeProfiles
6
+ } from "../chunk-TIHPYVAJ.js";
7
7
  import {
8
- Presets,
8
+ Profiles,
9
9
  careful,
10
10
  code,
11
11
  explore,
@@ -13,16 +13,16 @@ import {
13
13
  quick,
14
14
  review,
15
15
  watch
16
- } from "../chunk-EKR6PKXU.js";
16
+ } from "../chunk-6HZBHFOL.js";
17
17
  export {
18
- Presets,
19
- applyPreset,
18
+ Profiles,
19
+ applyProfile,
20
20
  careful,
21
21
  code,
22
- createPreset,
22
+ createProfile,
23
23
  explore,
24
24
  filterTools,
25
- mergePresets,
25
+ mergeProfiles,
26
26
  plan,
27
27
  quick,
28
28
  review,
@@ -1,19 +1,14 @@
1
- import { e as ModelFamily, h as EnvironmentInfo, I as InstructionFile } from '../types-DTSkxakL.js';
2
- export { P as PromptBuildContext, d as PromptConfig, c as PromptSection } from '../types-DTSkxakL.js';
1
+ import { bM as ModelFamily, b6 as EnvironmentInfo, bq as InstructionFile } from '../instance-BqV2D5pc.js';
2
+ export { c3 as PromptBuildContext, P as PromptBuilder, c4 as PromptConfig, c5 as PromptSection, cq as SkillConfig, dG as createPromptBuilder } from '../instance-BqV2D5pc.js';
3
3
  import { LanguageModel } from 'ai';
4
- export { P as PromptBuilder, c as createPromptBuilder } from '../builder-BgZ_j4Vs.js';
5
- export { d as SkillConfig } from '../types-BfNpU8NS.js';
6
- import '@ai-sdk/provider-utils';
7
- import '../events-CE72w8W4.js';
8
- import '../messages-BYWGn8TY.js';
9
- import '../types-CQL-SvTn.js';
10
- import '../tool-DkhSCV2Y.js';
11
- import '../types-CHiPh8U2.js';
12
- import '../tool-CZWN3KbO.js';
4
+ import '../types-C_LCeYNg.js';
5
+ import '../types-RSCv7nQ4.js';
13
6
  import 'zod';
14
7
  import '../types-CQaXbRsS.js';
15
- import '../registry-DwYqsQkX.js';
16
- import '../runner-CI-XeR16.js';
8
+ import '../types-Bj_J8u_W.js';
9
+ import '@ai-sdk/provider-utils';
10
+ import '../sandbox/index.js';
11
+ import '../llm-error-D93FNNLY.js';
17
12
 
18
13
  /**
19
14
  * Prompt Templates — Base system prompts per model family