@cuylabs/agent-core 0.11.0 → 0.13.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 (58) hide show
  1. package/dist/{chunk-GFTW23FV.js → chunk-BGG2HVIR.js} +4 -2
  2. package/dist/{chunk-TOTDGK3P.js → chunk-CSR75JVC.js} +4 -5
  3. package/dist/{chunk-ICZ66572.js → chunk-CZ5XOVDV.js} +40 -9
  4. package/dist/{chunk-2O4MCSQS.js → chunk-FYC33XFI.js} +31 -10
  5. package/dist/{chunk-WBPOZ7CL.js → chunk-HNEI7JVE.js} +114 -38
  6. package/dist/{chunk-SPILYYDF.js → chunk-I7EJGKUP.js} +79 -7
  7. package/dist/{chunk-SSFBF3US.js → chunk-JPBFAQNS.js} +7 -12
  8. package/dist/{chunk-5FMSGQVX.js → chunk-JZRLCTSD.js} +8 -2
  9. package/dist/{chunk-V4RFNEET.js → chunk-MLTJHUVG.js} +34 -16
  10. package/dist/{chunk-QAL3OMI3.js → chunk-MO3N6M32.js} +4 -1
  11. package/dist/{chunk-CMYN2RCB.js → chunk-NWQUZWLT.js} +13 -7
  12. package/dist/{chunk-MXAP4UG6.js → chunk-QJV5XPPS.js} +238 -86
  13. package/dist/{chunk-T4UIX5D7.js → chunk-S6AKEPAX.js} +9 -3
  14. package/dist/{chunk-N3VX7FEE.js → chunk-STDJYXYK.js} +1 -4
  15. package/dist/{chunk-6HZBHFOL.js → chunk-TPZ37IWI.js} +10 -1
  16. package/dist/{chunk-NDZWXCBZ.js → chunk-TZ4VA4VX.js} +33 -11
  17. package/dist/chunk-US7S4FYW.js +610 -0
  18. package/dist/{chunk-RN6WZEUF.js → chunk-WI5JFEAI.js} +71 -36
  19. package/dist/{chunk-5NVVNXPQ.js → chunk-ZKEC7MFQ.js} +5 -30
  20. package/dist/dispatch/index.d.ts +5 -3
  21. package/dist/dispatch/index.js +3 -3
  22. package/dist/execution/index.d.ts +6 -4
  23. package/dist/execution/index.js +7 -7
  24. package/dist/index.d.ts +8 -5
  25. package/dist/index.js +119 -116
  26. package/dist/inference/errors/index.js +1 -1
  27. package/dist/inference/index.d.ts +6 -4
  28. package/dist/inference/index.js +6 -6
  29. package/dist/{instance-DzPiv6EK.d.ts → instance-N5VhcNT2.d.ts} +45 -7
  30. package/dist/logger/index.js +1 -1
  31. package/dist/mcp/index.d.ts +116 -3
  32. package/dist/mcp/index.js +6 -2
  33. package/dist/middleware/index.d.ts +5 -3
  34. package/dist/middleware/index.js +3 -3
  35. package/dist/{model-messages-CJfwfzGe.d.ts → model-messages-DnsiSiZj.d.ts} +1 -1
  36. package/dist/models/index.js +2 -2
  37. package/dist/models/reasoning/index.js +2 -2
  38. package/dist/plugin/index.d.ts +4 -2
  39. package/dist/plugin/index.js +1 -1
  40. package/dist/profiles/index.d.ts +4 -2
  41. package/dist/profiles/index.js +1 -1
  42. package/dist/prompt/index.d.ts +5 -3
  43. package/dist/prompt/index.js +2 -2
  44. package/dist/safety/index.d.ts +5 -3
  45. package/dist/safety/index.js +1 -1
  46. package/dist/skill/index.d.ts +5 -3
  47. package/dist/skill/index.js +2 -2
  48. package/dist/storage/index.d.ts +5 -3
  49. package/dist/storage/index.js +1 -1
  50. package/dist/subagents/index.d.ts +4 -2
  51. package/dist/subagents/index.js +4 -4
  52. package/dist/team/index.d.ts +5 -3
  53. package/dist/team/index.js +1 -1
  54. package/dist/tool/index.d.ts +5 -3
  55. package/dist/tool/index.js +2 -2
  56. package/dist/{types-Bj_J8u_W.d.ts → types-DMjoFKKv.d.ts} +55 -7
  57. package/package.json +1 -6
  58. package/dist/chunk-ROTGCYDW.js +0 -221
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ import {
34
34
  parseSubAgentRoleFrontmatter,
35
35
  parseSubAgentToolSpec,
36
36
  toSubAgentRole
37
- } from "./chunk-2O4MCSQS.js";
37
+ } from "./chunk-FYC33XFI.js";
38
38
  import {
39
39
  InMemoryMailboxStore,
40
40
  InMemoryTaskBoardStore,
@@ -53,7 +53,7 @@ import {
53
53
  formatCoordinatorTaskNotifications,
54
54
  formatCoordinatorWorkerReports,
55
55
  teamPermissionPolicy
56
- } from "./chunk-MXAP4UG6.js";
56
+ } from "./chunk-QJV5XPPS.js";
57
57
  import {
58
58
  ToolRegistry,
59
59
  createToolSearchTool,
@@ -79,7 +79,7 @@ import {
79
79
  resetFrameworkAliases,
80
80
  resetPluginLoader,
81
81
  resolveFrameworkAliases
82
- } from "./chunk-QAL3OMI3.js";
82
+ } from "./chunk-MO3N6M32.js";
83
83
  import {
84
84
  applyProfile,
85
85
  createProfile,
@@ -95,7 +95,7 @@ import {
95
95
  quick,
96
96
  review,
97
97
  watch
98
- } from "./chunk-6HZBHFOL.js";
98
+ } from "./chunk-TPZ37IWI.js";
99
99
  import {
100
100
  DEFAULT_INSTRUCTION_PATTERNS,
101
101
  DEFAULT_MAX_DEPTH,
@@ -117,13 +117,13 @@ import {
117
117
  getTemplate,
118
118
  loadGlobalInstructions,
119
119
  summarizeEnvironment
120
- } from "./chunk-GFTW23FV.js";
120
+ } from "./chunk-BGG2HVIR.js";
121
121
  import "./chunk-VOUEJSW6.js";
122
122
  import {
123
123
  createSkillResourceTool,
124
124
  createSkillTool,
125
125
  createSkillTools
126
- } from "./chunk-TOTDGK3P.js";
126
+ } from "./chunk-CSR75JVC.js";
127
127
  import {
128
128
  DEFAULT_EXTERNAL_DIRS,
129
129
  DEFAULT_MAX_SCAN_DEPTH,
@@ -138,7 +138,7 @@ import {
138
138
  loadSkillContent,
139
139
  loadSkillMetadata,
140
140
  parseFrontmatter
141
- } from "./chunk-SPILYYDF.js";
141
+ } from "./chunk-I7EJGKUP.js";
142
142
  import {
143
143
  createCompositeDispatchTaskExecutor,
144
144
  createDispatchExternalTaskControl,
@@ -147,7 +147,7 @@ import {
147
147
  createRuntimeDispatchTargets,
148
148
  ensureNonEmpty,
149
149
  mergeInspection
150
- } from "./chunk-5FMSGQVX.js";
150
+ } from "./chunk-JZRLCTSD.js";
151
151
  import {
152
152
  DEFAULT_DISPATCH_TOOL_IDS,
153
153
  DEFAULT_LOCAL_DISPATCH_CONCURRENCY,
@@ -160,7 +160,7 @@ import {
160
160
  ensureSessionLoaded,
161
161
  getVisibleSessionMessages,
162
162
  repairOrphanedToolCalls
163
- } from "./chunk-SSFBF3US.js";
163
+ } from "./chunk-JPBFAQNS.js";
164
164
  import {
165
165
  sleep
166
166
  } from "./chunk-SZ2XBPTW.js";
@@ -195,7 +195,7 @@ import {
195
195
  serializeMessage,
196
196
  toJSONL,
197
197
  toJSONLBatch
198
- } from "./chunk-ICZ66572.js";
198
+ } from "./chunk-CZ5XOVDV.js";
199
199
  import {
200
200
  createEventBus
201
201
  } from "./chunk-2TTOLHBT.js";
@@ -205,6 +205,8 @@ import {
205
205
  ContextOverflowError,
206
206
  DEFAULT_CONTEXT_LIMITS,
207
207
  DoomLoopError,
208
+ PRUNE_PROTECTED_TOOLS,
209
+ accumulateUsage,
208
210
  advanceAgentTurnState,
209
211
  applyAgentWorkflowCommitResult,
210
212
  applyAgentWorkflowModelStepResult,
@@ -239,7 +241,7 @@ import {
239
241
  runToolBatch,
240
242
  snapshotAgentWorkflowMessage,
241
243
  snapshotAgentWorkflowMessages
242
- } from "./chunk-WBPOZ7CL.js";
244
+ } from "./chunk-HNEI7JVE.js";
243
245
  import {
244
246
  DEFAULT_RETRY_CONFIG,
245
247
  Inference,
@@ -254,10 +256,8 @@ import {
254
256
  streamOnce,
255
257
  streamStep,
256
258
  withRetry
257
- } from "./chunk-CMYN2RCB.js";
259
+ } from "./chunk-NWQUZWLT.js";
258
260
  import {
259
- PRUNE_PROTECTED_TOOLS,
260
- accumulateUsage,
261
261
  currentScope,
262
262
  executeAgentToolCall,
263
263
  extractFilePathsFromArgs,
@@ -266,7 +266,7 @@ import {
266
266
  snapshotScope,
267
267
  streamWithinScope,
268
268
  withinScope
269
- } from "./chunk-5NVVNXPQ.js";
269
+ } from "./chunk-ZKEC7MFQ.js";
270
270
  import {
271
271
  LLMError,
272
272
  getErrorCategory,
@@ -274,7 +274,7 @@ import {
274
274
  isRetryable,
275
275
  isRetryableCategory,
276
276
  parseRetryDelay
277
- } from "./chunk-N3VX7FEE.js";
277
+ } from "./chunk-STDJYXYK.js";
278
278
  import {
279
279
  CacheCapabilitySource,
280
280
  CapabilityCache,
@@ -305,14 +305,16 @@ import {
305
305
  shouldIncludeReasoningSummary,
306
306
  supportsReasoning,
307
307
  supportsReasoningSync
308
- } from "./chunk-RN6WZEUF.js";
308
+ } from "./chunk-WI5JFEAI.js";
309
309
  import "./chunk-SPBFQXOT.js";
310
310
  import {
311
+ ClientCredentialsProvider,
311
312
  createMCPManager,
312
313
  httpServer,
314
+ serviceAccountServer,
313
315
  sseServer,
314
316
  stdioServer
315
- } from "./chunk-ROTGCYDW.js";
317
+ } from "./chunk-US7S4FYW.js";
316
318
  import {
317
319
  MiddlewareRunner,
318
320
  approvalMiddleware,
@@ -320,7 +322,7 @@ import {
320
322
  isApprovalMiddleware,
321
323
  otelMiddleware,
322
324
  promptCacheMiddleware
323
- } from "./chunk-NDZWXCBZ.js";
325
+ } from "./chunk-TZ4VA4VX.js";
324
326
  import {
325
327
  DEFAULT_AGENT_NAME,
326
328
  DEFAULT_MAX_STEPS,
@@ -372,7 +374,7 @@ import {
372
374
  normalizeRememberScopes,
373
375
  selectRememberScope,
374
376
  shouldCascadeApprovalDecision
375
- } from "./chunk-V4RFNEET.js";
377
+ } from "./chunk-MLTJHUVG.js";
376
378
  import {
377
379
  describeApprovalOperation,
378
380
  extractApprovalPatterns,
@@ -385,7 +387,7 @@ import {
385
387
  createConsoleLogger,
386
388
  createFileLogger,
387
389
  silentLogger
388
- } from "./chunk-T4UIX5D7.js";
390
+ } from "./chunk-S6AKEPAX.js";
389
391
 
390
392
  // src/tracking/turn-tracker/tracker.ts
391
393
  import { spawn } from "child_process";
@@ -788,9 +790,7 @@ var InterventionController = class {
788
790
  */
789
791
  intervene(message) {
790
792
  const id = crypto.randomUUID();
791
- this.immediate.push(
792
- Object.freeze({ id, message, createdAt: /* @__PURE__ */ new Date() })
793
- );
793
+ this.immediate.push(Object.freeze({ id, message, createdAt: /* @__PURE__ */ new Date() }));
794
794
  return id;
795
795
  }
796
796
  /**
@@ -1166,7 +1166,10 @@ async function* runChatLoop(deps) {
1166
1166
  applyCommitBatch,
1167
1167
  rememberedDoomLoopTools
1168
1168
  });
1169
- accumulatedUsage = accumulateUsage(accumulatedUsage, stepResult.usage);
1169
+ accumulatedUsage = accumulateUsage(
1170
+ accumulatedUsage,
1171
+ stepResult.usage
1172
+ );
1170
1173
  if (stepResult.error) {
1171
1174
  chatError = stepResult.error;
1172
1175
  return;
@@ -1184,10 +1187,16 @@ async function* runChatLoop(deps) {
1184
1187
  `Maximum steps (${config.maxSteps}) reached before the turn produced a final response`
1185
1188
  );
1186
1189
  chatError = maxStepsError;
1187
- const statusEvent = { type: "status", status: "error" };
1190
+ const statusEvent = {
1191
+ type: "status",
1192
+ status: "error"
1193
+ };
1188
1194
  middlewareRunner.emitEvent(statusEvent);
1189
1195
  yield statusEvent;
1190
- const errorEvent = { type: "error", error: maxStepsError };
1196
+ const errorEvent = {
1197
+ type: "error",
1198
+ error: maxStepsError
1199
+ };
1191
1200
  middlewareRunner.emitEvent(errorEvent);
1192
1201
  yield errorEvent;
1193
1202
  return;
@@ -1274,14 +1283,18 @@ async function* runChatLoop(deps) {
1274
1283
  setIsStreaming(false);
1275
1284
  interventionCtrl.onApplied = prevOnApplied;
1276
1285
  if (middlewareRunner.hasMiddleware) {
1277
- await middlewareRunner.runChatEnd(sessionId, {
1278
- usage: chatUsage,
1279
- error: chatError,
1280
- output: chatOutput
1281
- }, {
1286
+ await middlewareRunner.runChatEnd(
1282
1287
  sessionId,
1283
- turnId
1284
- });
1288
+ {
1289
+ usage: chatUsage,
1290
+ error: chatError,
1291
+ output: chatOutput
1292
+ },
1293
+ {
1294
+ sessionId,
1295
+ turnId
1296
+ }
1297
+ );
1285
1298
  }
1286
1299
  }
1287
1300
  })()
@@ -1528,33 +1541,35 @@ function createHumanInputController(config = {}) {
1528
1541
  createdAt: requestPayload.timestamp,
1529
1542
  updatedAt: requestPayload.timestamp
1530
1543
  };
1531
- const responsePromise = new Promise((resolve2, reject) => {
1532
- const timeoutId = setTimeout(() => {
1533
- const current2 = pending.get(record.id);
1534
- if (!current2) {
1535
- return;
1536
- }
1537
- pending.delete(record.id);
1538
- current2.record = {
1539
- ...current2.record,
1540
- status: "timed-out",
1541
- updatedAt: Date.now()
1542
- };
1543
- void emitHumanInputEvent(
1544
- { emitEvent: current2.emitEvent },
1545
- { type: "status", status: "processing" }
1546
- );
1547
- reject(new HumanInputTimeoutError(timeout));
1548
- }, timeout);
1549
- pending.set(record.id, {
1550
- record,
1551
- resolve: resolve2,
1552
- reject,
1553
- ready: Promise.resolve(),
1554
- timeoutId,
1555
- emitEvent: context.emitEvent
1556
- });
1557
- });
1544
+ const responsePromise = new Promise(
1545
+ (resolve2, reject) => {
1546
+ const timeoutId = setTimeout(() => {
1547
+ const current2 = pending.get(record.id);
1548
+ if (!current2) {
1549
+ return;
1550
+ }
1551
+ pending.delete(record.id);
1552
+ current2.record = {
1553
+ ...current2.record,
1554
+ status: "timed-out",
1555
+ updatedAt: Date.now()
1556
+ };
1557
+ void emitHumanInputEvent(
1558
+ { emitEvent: current2.emitEvent },
1559
+ { type: "status", status: "processing" }
1560
+ );
1561
+ reject(new HumanInputTimeoutError(timeout));
1562
+ }, timeout);
1563
+ pending.set(record.id, {
1564
+ record,
1565
+ resolve: resolve2,
1566
+ reject,
1567
+ ready: Promise.resolve(),
1568
+ timeoutId,
1569
+ emitEvent: context.emitEvent
1570
+ });
1571
+ }
1572
+ );
1558
1573
  const current = pending.get(record.id);
1559
1574
  if (current) {
1560
1575
  current.ready = (async () => {
@@ -1761,12 +1776,16 @@ function createHumanInputToolWithController(controller, options = {}) {
1761
1776
  if (!activeController) {
1762
1777
  throw new HumanInputUnavailableError();
1763
1778
  }
1764
- response = await activeController.request(ctx.sessionID, {
1765
- ...params,
1766
- toolCallId: typeof ctx.extra?.toolCallId === "string" ? ctx.extra.toolCallId : ctx.messageID
1767
- }, {
1768
- emitEvent: ctx.emitEvent
1769
- });
1779
+ response = await activeController.request(
1780
+ ctx.sessionID,
1781
+ {
1782
+ ...params,
1783
+ toolCallId: typeof ctx.extra?.toolCallId === "string" ? ctx.extra.toolCallId : ctx.messageID
1784
+ },
1785
+ {
1786
+ emitEvent: ctx.emitEvent
1787
+ }
1788
+ );
1770
1789
  } catch (error) {
1771
1790
  if (error instanceof HumanInputUnavailableError) {
1772
1791
  throw error;
@@ -1908,7 +1927,10 @@ function resolveAgentContextLimits(contextWindow, compactionConfig = {}) {
1908
1927
  Math.max(1024, Math.round(contextWindow * 0.25)),
1909
1928
  Math.max(512, proportionalReserve)
1910
1929
  );
1911
- const usableWindow = Math.max(512, getUsableTokenLimit({ contextWindow, reserveTokens }));
1930
+ const usableWindow = Math.max(
1931
+ 512,
1932
+ getUsableTokenLimit({ contextWindow, reserveTokens })
1933
+ );
1912
1934
  const requestedProtected = compactionConfig.protectedTokens ?? DEFAULT_CONTEXT_LIMITS.protectedTokens;
1913
1935
  const requestedPruneMinimum = compactionConfig.pruneMinimum ?? DEFAULT_CONTEXT_LIMITS.pruneMinimum;
1914
1936
  return {
@@ -1946,10 +1968,7 @@ function createMiddlewareSetup(input, config) {
1946
1968
  agentName,
1947
1969
  serviceName: input.tracing.serviceName ?? agentName
1948
1970
  });
1949
- effectiveMiddleware = [
1950
- telemetryResult.middleware,
1951
- ...effectiveMiddleware
1952
- ];
1971
+ effectiveMiddleware = [telemetryResult.middleware, ...effectiveMiddleware];
1953
1972
  telemetrySettings = telemetryResult.telemetry;
1954
1973
  tracingShutdown = telemetryResult.shutdown;
1955
1974
  }
@@ -2262,11 +2281,14 @@ var Agent = class _Agent {
2262
2281
  * Lazy initialization - only connects on first use
2263
2282
  */
2264
2283
  async ensureMCPConnected() {
2265
- const nextState = await ensureMcpTools({
2266
- manager: this.mcpManager,
2267
- connected: this.mcpConnected,
2268
- cachedTools: this.mcpToolsCache
2269
- }, this._logger);
2284
+ const nextState = await ensureMcpTools(
2285
+ {
2286
+ manager: this.mcpManager,
2287
+ connected: this.mcpConnected,
2288
+ cachedTools: this.mcpToolsCache
2289
+ },
2290
+ this._logger
2291
+ );
2270
2292
  this.mcpConnected = nextState.connected;
2271
2293
  this.mcpToolsCache = nextState.cachedTools;
2272
2294
  return nextState.cachedTools ?? {};
@@ -2474,9 +2496,7 @@ var Agent = class _Agent {
2474
2496
  * ```
2475
2497
  */
2476
2498
  getContextStats() {
2477
- return this.contextManager.getStats(
2478
- this.sessions.getMessages()
2479
- );
2499
+ return this.contextManager.getStats(this.sessions.getMessages());
2480
2500
  }
2481
2501
  /**
2482
2502
  * Manually trigger context compaction.
@@ -2700,10 +2720,7 @@ var Agent = class _Agent {
2700
2720
  if (inferred) {
2701
2721
  this.contextManager.setLimits({
2702
2722
  contextWindow: inferred,
2703
- ...resolveAgentContextLimits(
2704
- inferred,
2705
- this.config.compaction
2706
- )
2723
+ ...resolveAgentContextLimits(inferred, this.config.compaction)
2707
2724
  });
2708
2725
  }
2709
2726
  }
@@ -3035,8 +3052,7 @@ function createEventPrinter(options = {}) {
3035
3052
  );
3036
3053
  break;
3037
3054
  case "tool-result":
3038
- if (tools)
3039
- stderr.write(` \u2713 ${String(event.result).slice(0, 200)}
3055
+ if (tools) stderr.write(` \u2713 ${String(event.result).slice(0, 200)}
3040
3056
  `);
3041
3057
  break;
3042
3058
  case "tool-error":
@@ -3052,18 +3068,15 @@ function createEventPrinter(options = {}) {
3052
3068
  );
3053
3069
  break;
3054
3070
  case "approval-resolved":
3055
- if (safety)
3056
- stderr.write(`\u{1F6C2} Approval ${event.id} \u2192 ${event.action}
3071
+ if (safety) stderr.write(`\u{1F6C2} Approval ${event.id} \u2192 ${event.action}
3057
3072
  `);
3058
3073
  break;
3059
3074
  case "intervention-applied":
3060
- if (safety)
3061
- stderr.write(`\u270B Intervention \u2192 ${event.message}
3075
+ if (safety) stderr.write(`\u270B Intervention \u2192 ${event.message}
3062
3076
  `);
3063
3077
  break;
3064
3078
  case "follow-up-queued":
3065
- if (safety)
3066
- stderr.write(`\u{1F4CC} Follow-up queued \u2192 ${event.message}
3079
+ if (safety) stderr.write(`\u{1F4CC} Follow-up queued \u2192 ${event.message}
3067
3080
  `);
3068
3081
  break;
3069
3082
  // ── Safety ────────────────────────────────────────────────────
@@ -3090,13 +3103,11 @@ function createEventPrinter(options = {}) {
3090
3103
  break;
3091
3104
  // ── Computer use ──────────────────────────────────────────────
3092
3105
  case "computer-call":
3093
- if (tools)
3094
- stderr.write(`\u{1F5A5}\uFE0F Computer action \u2192 ${event.callId}
3106
+ if (tools) stderr.write(`\u{1F5A5}\uFE0F Computer action \u2192 ${event.callId}
3095
3107
  `);
3096
3108
  break;
3097
3109
  case "computer-result":
3098
- if (tools)
3099
- stderr.write(`\u{1F5A5}\uFE0F Computer result \u2192 ${event.callId}
3110
+ if (tools) stderr.write(`\u{1F5A5}\uFE0F Computer result \u2192 ${event.callId}
3100
3111
  `);
3101
3112
  break;
3102
3113
  // ── Human input ───────────────────────────────────────────────
@@ -3112,10 +3123,8 @@ function createEventPrinter(options = {}) {
3112
3123
  // host handles display
3113
3124
  // ── Error & retry ─────────────────────────────────────────────
3114
3125
  case "retry":
3115
- stderr.write(
3116
- `\u{1F501} Retry ${event.attempt} in ${event.delayMs}ms
3117
- `
3118
- );
3126
+ stderr.write(`\u{1F501} Retry ${event.attempt} in ${event.delayMs}ms
3127
+ `);
3119
3128
  break;
3120
3129
  case "error":
3121
3130
  stderr.write(`\u274C ${event.error.message}
@@ -3124,10 +3133,8 @@ function createEventPrinter(options = {}) {
3124
3133
  // ── Completion ────────────────────────────────────────────────
3125
3134
  case "complete":
3126
3135
  if (completion)
3127
- stderr.write(
3128
- `\u2705 Done \u2014 ${event.usage?.totalTokens ?? "?"} tokens
3129
- `
3130
- );
3136
+ stderr.write(`\u2705 Done \u2014 ${event.usage?.totalTokens ?? "?"} tokens
3137
+ `);
3131
3138
  break;
3132
3139
  // ── Team events ───────────────────────────────────────────────
3133
3140
  default:
@@ -3145,22 +3152,16 @@ function printTeamEvent(out, event) {
3145
3152
  `);
3146
3153
  break;
3147
3154
  case "team-member-registered":
3148
- out.write(
3149
- ` \u{1F464} ${event.member.id} (${event.member.role})
3150
- `
3151
- );
3155
+ out.write(` \u{1F464} ${event.member.id} (${event.member.role})
3156
+ `);
3152
3157
  break;
3153
3158
  case "team-task-completed":
3154
- out.write(
3155
- ` \u2705 Task ${event.taskId} completed
3156
- `
3157
- );
3159
+ out.write(` \u2705 Task ${event.taskId} completed
3160
+ `);
3158
3161
  break;
3159
3162
  case "team-task-failed":
3160
- out.write(
3161
- ` \u274C Task ${event.taskId} failed
3162
- `
3163
- );
3163
+ out.write(` \u274C Task ${event.taskId} failed
3164
+ `);
3164
3165
  break;
3165
3166
  case "team-stopped":
3166
3167
  out.write(`\u{1F3C1} Team stopped
@@ -3217,6 +3218,7 @@ export {
3217
3218
  ApprovalTimeoutError,
3218
3219
  CacheCapabilitySource,
3219
3220
  CapabilityCache,
3221
+ ClientCredentialsProvider,
3220
3222
  ContextManager,
3221
3223
  ContextOverflowError,
3222
3224
  DEFAULT_AGENT_NAME,
@@ -3535,6 +3537,7 @@ export {
3535
3537
  sandboxDefaultsProvider,
3536
3538
  selectRememberScope,
3537
3539
  serializeMessage,
3540
+ serviceAccountServer,
3538
3541
  shouldCaptureBaseline,
3539
3542
  shouldCascadeApprovalDecision,
3540
3543
  shouldIncludeReasoningSummary,
@@ -5,7 +5,7 @@ import {
5
5
  isRetryable,
6
6
  isRetryableCategory,
7
7
  parseRetryDelay
8
- } from "../../chunk-N3VX7FEE.js";
8
+ } from "../../chunk-STDJYXYK.js";
9
9
  export {
10
10
  LLMError,
11
11
  getErrorCategory,
@@ -1,14 +1,16 @@
1
- import { T as Tool, a as TurnTrackerContext, H as HumanInputController, b as MiddlewareRunner, A as AgentEvent, c as ToolExecutionMode, I as InferenceStreamInput, d as ModelCallContext, e as AnyInferenceResult } from '../instance-DzPiv6EK.js';
2
- export { D as DEFAULT_MAX_OUTPUT_TOKENS, f as DEFAULT_RETRY_CONFIG, g as InferenceCustomResult, h as InferenceStepInfo, i as InferenceStreamResult, R as RetryConfig, j as RetryHandlerOptions, k as RetryState, l as calculateDelay, m as createRetryHandler, n as createRetryState, s as shouldRetry, o as sleep, w as withRetry } from '../instance-DzPiv6EK.js';
3
1
  import { ToolSet } from 'ai';
2
+ import { T as Tool, a as TurnTrackerContext, H as HumanInputController, b as MiddlewareRunner, A as AgentEvent, c as ToolExecutionMode, I as InferenceStreamInput, d as ModelCallContext, e as AnyInferenceResult } from '../instance-N5VhcNT2.js';
3
+ export { D as DEFAULT_MAX_OUTPUT_TOKENS, f as DEFAULT_RETRY_CONFIG, g as InferenceCustomResult, h as InferenceStepInfo, i as InferenceStreamResult, R as RetryConfig, j as RetryHandlerOptions, k as RetryState, l as calculateDelay, m as createRetryHandler, n as createRetryState, s as shouldRetry, o as sleep, w as withRetry } from '../instance-N5VhcNT2.js';
4
4
  import { T as ToolHost } from '../types-C_LCeYNg.js';
5
- export { c as convertAgentMessagesToModelMessages } from '../model-messages-CJfwfzGe.js';
5
+ export { c as convertAgentMessagesToModelMessages } from '../model-messages-DnsiSiZj.js';
6
6
  export { E as ErrorCategory, L as LLMError, a as LLMErrorOptions, R as ResponseHeaders } from '../llm-error-D93FNNLY.js';
7
7
  export { getErrorCategory, getRetryDelay, isRetryable, isRetryableCategory, parseRetryDelay } from './errors/index.js';
8
8
  import '../types-RSCv7nQ4.js';
9
9
  import 'zod';
10
10
  import '../types-CQaXbRsS.js';
11
- import '../types-Bj_J8u_W.js';
11
+ import '../types-DMjoFKKv.js';
12
+ import '@modelcontextprotocol/sdk/client/auth.js';
13
+ import '@modelcontextprotocol/sdk/types.js';
12
14
  import '@ai-sdk/provider-utils';
13
15
  import '../sandbox/index.js';
14
16
 
@@ -13,8 +13,8 @@ import {
13
13
  streamOnce,
14
14
  streamStep,
15
15
  withRetry
16
- } from "../chunk-CMYN2RCB.js";
17
- import "../chunk-5NVVNXPQ.js";
16
+ } from "../chunk-NWQUZWLT.js";
17
+ import "../chunk-ZKEC7MFQ.js";
18
18
  import {
19
19
  LLMError,
20
20
  getErrorCategory,
@@ -22,15 +22,15 @@ import {
22
22
  isRetryable,
23
23
  isRetryableCategory,
24
24
  parseRetryDelay
25
- } from "../chunk-N3VX7FEE.js";
26
- import "../chunk-RN6WZEUF.js";
25
+ } from "../chunk-STDJYXYK.js";
26
+ import "../chunk-WI5JFEAI.js";
27
27
  import {
28
28
  DEFAULT_MAX_TOKENS
29
29
  } from "../chunk-CJI7PVS2.js";
30
30
  import "../chunk-I6PKJ7XQ.js";
31
- import "../chunk-V4RFNEET.js";
31
+ import "../chunk-MLTJHUVG.js";
32
32
  import "../chunk-FII65CN7.js";
33
- import "../chunk-T4UIX5D7.js";
33
+ import "../chunk-S6AKEPAX.js";
34
34
  export {
35
35
  DEFAULT_MAX_TOKENS as DEFAULT_MAX_OUTPUT_TOKENS,
36
36
  DEFAULT_RETRY_CONFIG,
@@ -4,7 +4,7 @@ import { LanguageModel, ModelMessage, TelemetrySettings, SystemModelMessage, Str
4
4
  import { L as Logger } from './types-RSCv7nQ4.js';
5
5
  import { z } from 'zod';
6
6
  import { R as ReasoningLevel } from './types-CQaXbRsS.js';
7
- import { a as MCPManager } from './types-Bj_J8u_W.js';
7
+ import { a as MCPManager } from './types-DMjoFKKv.js';
8
8
  import { ProviderOptions } from '@ai-sdk/provider-utils';
9
9
  import { SandboxSession } from './sandbox/index.js';
10
10
  import { L as LLMError } from './llm-error-D93FNNLY.js';
@@ -806,8 +806,20 @@ interface SkillResource {
806
806
  relativePath: string;
807
807
  /** Classified resource type */
808
808
  type: SkillResourceType;
809
- /** Absolute path on disk (for local resources) */
810
- absolutePath: string;
809
+ /**
810
+ * Absolute path on disk.
811
+ *
812
+ * Undefined for pack-contributed resources that carry inline content.
813
+ * Either `absolutePath` or `content` must be set.
814
+ */
815
+ absolutePath?: string;
816
+ /**
817
+ * Inline resource content.
818
+ *
819
+ * Set for pack-contributed resources that have no file on disk.
820
+ * Takes precedence over `absolutePath` when both are present.
821
+ */
822
+ content?: string;
811
823
  }
812
824
  /**
813
825
  * Lightweight skill metadata parsed from SKILL.md YAML frontmatter.
@@ -836,10 +848,20 @@ interface SkillMetadata {
836
848
  scope: SkillScope;
837
849
  /** How this skill was obtained */
838
850
  source: SkillSource;
839
- /** Absolute path to the SKILL.md file */
840
- filePath: string;
841
- /** Directory containing the skill (parent of SKILL.md) */
842
- baseDir: string;
851
+ /**
852
+ * Absolute path to the SKILL.md file.
853
+ *
854
+ * Undefined for pack-contributed skills that have no file on disk.
855
+ * When undefined, content must be pre-cached — use `SkillRegistry.register()`
856
+ * with a pre-built `SkillContent`.
857
+ */
858
+ filePath?: string;
859
+ /**
860
+ * Directory containing the skill (parent of SKILL.md).
861
+ *
862
+ * Undefined for pack-contributed skills with no file on disk.
863
+ */
864
+ baseDir?: string;
843
865
  /** Optional tags for categorization */
844
866
  tags?: string[];
845
867
  /**
@@ -3999,6 +4021,22 @@ declare class SkillRegistry {
3999
4021
  * @returns Formatted string for tool response
4000
4022
  */
4001
4023
  formatContent(content: SkillContent): string;
4024
+ /**
4025
+ * Register an externally defined skill with optional pre-loaded content.
4026
+ *
4027
+ * Intended for capability packs that contribute skills without placing
4028
+ * files on disk — the pack's inline body is stored directly in the
4029
+ * content cache so the agent can load it without a file read.
4030
+ *
4031
+ * **Priority:** registered skills have lower priority than discovered
4032
+ * skills. If a skill with the same name was already found during
4033
+ * discovery, the discovered skill wins and this call is a no-op.
4034
+ *
4035
+ * @param metadata L1 metadata describing the skill.
4036
+ * @param content Pre-built content (L2). When provided, this is stored
4037
+ * in the cache so `loadContent()` never reads a file.
4038
+ */
4039
+ register(metadata: SkillMetadata, content?: SkillContent): "registered" | "updated" | "skipped";
4002
4040
  /** Clear the content cache, forcing reloads on next access. */
4003
4041
  clearContentCache(): void;
4004
4042
  /** Check if a skill's content has been loaded and cached. */
@@ -3,7 +3,7 @@ import {
3
3
  createConsoleLogger,
4
4
  createFileLogger,
5
5
  silentLogger
6
- } from "../chunk-T4UIX5D7.js";
6
+ } from "../chunk-S6AKEPAX.js";
7
7
  export {
8
8
  createConsoleLogger,
9
9
  createFileLogger,