@slashfi/agents-sdk 0.77.3 → 0.78.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.
@@ -53,7 +53,7 @@ export type RegistryAuth =
53
53
  * local credentials.
54
54
  */
55
55
  export interface RegistryProxy {
56
- mode: 'required' | 'optional';
56
+ mode: "required" | "optional";
57
57
  /** Agent path to forward to. Defaults to `@config`. */
58
58
  agent?: string;
59
59
  }
@@ -119,7 +119,7 @@ export interface RegistryEntry {
119
119
  publisher?: string;
120
120
 
121
121
  /** Connection status — set by validation/test, used to filter active entries */
122
- status?: 'active' | 'inactive' | 'error';
122
+ status?: "active" | "inactive" | "error";
123
123
 
124
124
  /**
125
125
  * If set, ref ops for refs sourced from this registry are forwarded
@@ -153,31 +153,57 @@ export type RefConfig = Record<string, unknown>;
153
153
 
154
154
  /** A ref entry — describes how to connect to an agent */
155
155
  export type RefEntry = {
156
- /** Canonical agent path on the remote registry (e.g. `notion`, `linear`). */
157
- ref: string;
156
+ /** Canonical agent path on the remote registry (e.g. `notion`, `linear`). */
157
+ ref: string;
158
158
 
159
- /**
160
- * Local identifier for this ref. Used by all operations
161
- * (call/remove/auth/update/…) to look up the entry. Add paths
162
- * default this to `ref` when omitted.
163
- */
164
- name: string;
159
+ /**
160
+ * Local identifier for this ref. Used by all operations
161
+ * (call/remove/auth/update/…) to look up the entry. Add paths
162
+ * default this to `ref` when omitted.
163
+ */
164
+ name: string;
165
165
 
166
- /** Connection scheme */
167
- scheme?: 'mcp' | 'https' | 'registry';
166
+ /** Connection scheme */
167
+ scheme?: "mcp" | "https" | "registry";
168
168
 
169
- /** Direct URL to the agent (e.g. https://mcp.notion.com/mcp) */
170
- url?: string;
169
+ /** Direct URL to the agent (e.g. https://mcp.notion.com/mcp) */
170
+ url?: string;
171
171
 
172
- /** Per-instance config (headers, secrets, etc. — values support {{secret-uri}} templates) */
173
- config?: RefConfig;
172
+ /** Per-instance config (headers, secrets, etc. — values support {{secret-uri}} templates) */
173
+ config?: RefConfig;
174
174
 
175
- /** The registry where this ref was discovered */
176
- sourceRegistry?: { url: string; agentPath: string };
175
+ /** The registry where this ref was discovered */
176
+ sourceRegistry?: { url: string; agentPath: string };
177
177
 
178
- /** Connection status — set by validation/test, used to filter active entries */
179
- status?: 'active' | 'inactive' | 'error';
180
- };
178
+ /** Connection status — set by validation/test, used to filter active entries */
179
+ status?: "active" | "inactive" | "error";
180
+
181
+ /**
182
+ * Human-readable description from the registry.
183
+ *
184
+ * Not stored in `consumer-config.json`. Hydrated into the in-memory
185
+ * `RefEntry` by `ref.list()` / `ref.get()` from `registry-cache.json`,
186
+ * which the adk maintains as a side-effect of `ref.add()` / `ref.inspect()`.
187
+ *
188
+ * `undefined` when the cache has no entry yet (e.g. first session for an
189
+ * existing user, or a freshly cleared cache). Consumers that need a fallback
190
+ * should apply their own (commonly `description ?? name`).
191
+ */
192
+ description?: string;
193
+
194
+ /**
195
+ * Slim tool summaries from the registry. Populated alongside `description`
196
+ * by the same cache lifecycle. Tool input schemas are intentionally
197
+ * omitted — they are too large to cache and callers fetch them on demand
198
+ * via `ref.inspect(name, { full: true })`.
199
+ *
200
+ * `undefined` when the cache has no entry yet.
201
+ */
202
+ tools?: Array<{
203
+ name: string;
204
+ description?: string;
205
+ }>;
206
+ };
181
207
 
182
208
  /** Input accepted by add paths. `name` defaults to `ref` when omitted. */
183
209
  export type RefAddInput = Omit<RefEntry, "name"> & { name?: string };
package/src/index.ts CHANGED
@@ -112,7 +112,12 @@ export {
112
112
 
113
113
  // Define functions
114
114
  export { defineAgent, defineTool } from "./define.js";
115
- export type { DefineAgentOptions, DefineToolOptions, AgentWithHooks, ToolWithHooks } from "./define.js";
115
+ export type {
116
+ DefineAgentOptions,
117
+ DefineToolOptions,
118
+ AgentWithHooks,
119
+ ToolWithHooks,
120
+ } from "./define.js";
116
121
 
117
122
  // Registry
118
123
  export { createAgentRegistry, agentFromSerialized } from "./registry.js";
@@ -346,10 +351,7 @@ export {
346
351
  exchangeCodeForTokens,
347
352
  refreshAccessToken as refreshMcpAccessToken,
348
353
  } from "./mcp-client.js";
349
- export type {
350
- OAuthServerMetadata,
351
- } from "./mcp-client.js";
352
-
354
+ export type { OAuthServerMetadata } from "./mcp-client.js";
353
355
 
354
356
  // ============================================
355
357
  // Serialized Agent Definitions
@@ -361,10 +363,6 @@ export type {
361
363
  SerializedTool,
362
364
  } from "./serialized.js";
363
365
 
364
-
365
-
366
-
367
-
368
366
  // ============================================
369
367
  // call_agent Schema (shared source of truth)
370
368
  // ============================================
@@ -405,9 +403,7 @@ export type { ValidationResult } from "./validate.js";
405
403
  // BM25 Search
406
404
  // ============================================
407
405
 
408
- export {
409
- createBM25Index,
410
- } from "./bm25.js";
406
+ export { createBM25Index } from "./bm25.js";
411
407
 
412
408
  export type {
413
409
  BM25Options,
@@ -438,7 +434,14 @@ export type {
438
434
  ResolveCredentials,
439
435
  ResolveCredentialsContext,
440
436
  RegistryTestResult,
437
+ RegistryCache,
438
+ RegistryCacheEntry,
439
+ RegistryCacheToolSummary,
441
440
  } from "./config-store.js";
442
441
  export { createLocalFsStore, getLocalEncryptionKey } from "./local-fs.js";
443
442
  export { AdkError, getError, getRecentErrors } from "./adk-error.js";
444
- export { createAdkTools, type AdkToolsHooks, type CreateAdkToolsOptions } from "./adk-tools.js";
443
+ export {
444
+ createAdkTools,
445
+ type AdkToolsHooks,
446
+ type CreateAdkToolsOptions,
447
+ } from "./adk-tools.js";