@stacklink/sdk 0.2.0 → 0.2.2

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 (55) hide show
  1. package/README.md +10 -0
  2. package/compatibility.json +1 -1
  3. package/dist/src/domain/memory-contract.d.ts +1497 -335
  4. package/dist/src/domain/memory-contract.d.ts.map +1 -1
  5. package/dist/src/domain/memory-contract.js +330 -59
  6. package/dist/src/domain/memory-contract.js.map +1 -1
  7. package/dist/src/domain/provider-branding.d.ts +1 -1
  8. package/dist/src/domain/provider-branding.d.ts.map +1 -1
  9. package/dist/src/domain/provider-branding.js +296 -8
  10. package/dist/src/domain/provider-branding.js.map +1 -1
  11. package/dist/src/domain/stacklink-meta-tools.d.ts +14 -16
  12. package/dist/src/domain/stacklink-meta-tools.d.ts.map +1 -1
  13. package/dist/src/domain/stacklink-meta-tools.js +205 -127
  14. package/dist/src/domain/stacklink-meta-tools.js.map +1 -1
  15. package/dist/src/sdk/framework-tools.d.ts +3 -2
  16. package/dist/src/sdk/framework-tools.d.ts.map +1 -1
  17. package/dist/src/sdk/framework-tools.js +1 -0
  18. package/dist/src/sdk/framework-tools.js.map +1 -1
  19. package/dist/src/sdk/index.d.ts +280 -142
  20. package/dist/src/sdk/index.d.ts.map +1 -1
  21. package/dist/src/sdk/index.js +433 -224
  22. package/dist/src/sdk/index.js.map +1 -1
  23. package/dist/src/sdk/langchain.d.ts +7 -2
  24. package/dist/src/sdk/langchain.d.ts.map +1 -1
  25. package/dist/src/sdk/langchain.js +3 -2
  26. package/dist/src/sdk/langchain.js.map +1 -1
  27. package/dist/src/sdk/memory-lifecycle.d.ts +25 -0
  28. package/dist/src/sdk/memory-lifecycle.d.ts.map +1 -1
  29. package/dist/src/sdk/memory-lifecycle.js +75 -1
  30. package/dist/src/sdk/memory-lifecycle.js.map +1 -1
  31. package/dist/src/sdk/openai-agents.d.ts +6 -6
  32. package/dist/src/sdk/openai-agents.d.ts.map +1 -1
  33. package/dist/src/sdk/openai-agents.js +21 -16
  34. package/dist/src/sdk/openai-agents.js.map +1 -1
  35. package/dist/src/sdk/openai.d.ts +2 -2
  36. package/dist/src/sdk/openai.d.ts.map +1 -1
  37. package/dist/src/sdk/openai.js +67 -31
  38. package/dist/src/sdk/openai.js.map +1 -1
  39. package/dist/src/sdk/vercel-ai.d.ts +11 -4
  40. package/dist/src/sdk/vercel-ai.d.ts.map +1 -1
  41. package/dist/src/sdk/vercel-ai.js +21 -6
  42. package/dist/src/sdk/vercel-ai.js.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/src/domain/knowledge-meta-tools.d.ts +0 -12
  45. package/dist/src/domain/knowledge-meta-tools.d.ts.map +0 -1
  46. package/dist/src/domain/knowledge-meta-tools.js +0 -38
  47. package/dist/src/domain/knowledge-meta-tools.js.map +0 -1
  48. package/dist/src/domain/memory-meta-tools.d.ts +0 -5
  49. package/dist/src/domain/memory-meta-tools.d.ts.map +0 -1
  50. package/dist/src/domain/memory-meta-tools.js +0 -18
  51. package/dist/src/domain/memory-meta-tools.js.map +0 -1
  52. package/dist/src/domain/platform-mcp-tools.d.ts +0 -3
  53. package/dist/src/domain/platform-mcp-tools.d.ts.map +0 -1
  54. package/dist/src/domain/platform-mcp-tools.js +0 -30
  55. package/dist/src/domain/platform-mcp-tools.js.map +0 -1
@@ -1,19 +1,14 @@
1
- import { type StacklinkMetaToolName, type StacklinkMetaToolSurface } from '../domain/stacklink-meta-tools.js';
2
- import type { KnowledgeMetaToolName } from '../domain/knowledge-meta-tools.js';
3
- import { type PlatformMcpToolName } from '../domain/platform-mcp-tools.js';
1
+ import { type StacklinkMetaToolName } from '../domain/stacklink-meta-tools.js';
4
2
  import type { ProviderBrandDescriptor } from '../domain/provider-branding.js';
5
- import type { MemoryMetaToolName } from '../domain/memory-meta-tools.js';
6
- import type { MemoryContextInput, MemoryConversationTurnInput, MemoryConnectedSourceInput, MemoryConnectedSourcePreviewInput, MemoryExportInput, MemoryGraphQueryInput, MemoryIngestInput, MemoryRichIngestInput, MemoryLegalHoldInput, MemoryPolicyPreviewInput, MemoryProjectPolicyInput, MemoryProjectPolicyUpdateInput, MemorySearchInput, MemorySourceBindingInput, MemorySourceBindingUpdateInput, MemorySubjectRef } from '../domain/memory-contract.js';
3
+ import type { MemoryContextInput, MemoryConversationTurnInput, MemoryConnectedSourceInput, MemoryConnectedSourcePreviewInput, MemoryExportInput, MemoryGraphQueryInput, MemoryIngestInput, MemoryRichIngestInput, MemoryLegalHoldInput, MemoryPolicyPreviewInput, MemoryProjectPolicyInput, MemoryProjectPolicyUpdateInput, MemorySearchInput, MemorySourceBindingInput, MemorySourceBindingUpdateInput, MemorySourceRemovalInput, MemorySubjectRef } from '../domain/memory-contract.js';
7
4
  export type { ProviderBrandDescriptor };
8
- export type { MemoryContextInput, MemoryConversationTurnInput, MemoryConnectedSourceInput, MemoryConnectedSourcePreviewInput, MemoryExportInput, MemoryGraphQueryInput, MemoryIngestInput, MemoryRichIngestInput, MemoryLegalHoldInput, MemoryPolicyPreviewInput, MemoryProjectPolicyInput, MemoryProjectPolicyUpdateInput, MemorySearchInput, MemorySourceBindingInput, MemorySourceBindingUpdateInput, MemorySubjectRef, };
5
+ export type { MemoryContextInput, MemoryConversationTurnInput, MemoryConnectedSourceInput, MemoryConnectedSourcePreviewInput, MemoryExportInput, MemoryGraphQueryInput, MemoryIngestInput, MemoryRichIngestInput, MemoryLegalHoldInput, MemoryPolicyPreviewInput, MemoryProjectPolicyInput, MemoryProjectPolicyUpdateInput, MemorySearchInput, MemorySourceBindingInput, MemorySourceBindingUpdateInput, MemorySourceRemovalInput, MemorySubjectRef, };
9
6
  export { StacklinkMemoryLifecycle, StacklinkMemoryLifecycleError, createStacklinkMemoryLifecycle, serializeCompletedConversationTurn, } from './memory-lifecycle.js';
10
- export type { StacklinkMemoryAvailabilityMode, StacklinkMemoryCaptureMode, StacklinkMemoryDiagnostic, StacklinkMemoryLifecycleOptions, StacklinkMemorySessionLike, StacklinkMemoryTurnContext, StacklinkMemoryTurnOptions, } from './memory-lifecycle.js';
11
- export declare const platformToolSurfaceNames: readonly ["PLATFORM_LIST_AUTH_CONFIGS", "PLATFORM_LIST_SESSIONS", "PLATFORM_UPDATE_WORKBENCH_PROVIDER_ACCESS", "PLATFORM_LIST_WORKSPACES", "PLATFORM_LIST_MEMBERS", "PLATFORM_LIST_WORKBENCH_BUDGETS", "PLATFORM_QUERY_LOGS", "PLATFORM_GET_EXECUTION_DETAILS", "PLATFORM_ENABLE_TOOLKIT", "PLATFORM_CREATE_TRIGGER", "PLATFORM_GET_WEBHOOK", "PLATFORM_UPDATE_WEBHOOK", "PLATFORM_ROTATE_WEBHOOK_SECRET", "PLATFORM_APPROVE_WEBHOOK_SECRET_ROTATION", "PLATFORM_SEND_WEBHOOK_TEST", "PLATFORM_PROPOSE_AUTH_CONFIG", "PLATFORM_APPROVE_AUTH_CONFIG", "PLATFORM_PROPOSE_API_KEY", "PLATFORM_APPROVE_API_KEY", "PLATFORM_REVOKE_API_KEY", "PLATFORM_PROPOSE_WORKSPACE_MUTATION", "PLATFORM_APPROVE_WORKSPACE_MUTATION", "PLATFORM_PROPOSE_WORKBENCH_BUDGET", "PLATFORM_APPROVE_WORKBENCH_BUDGET", "PLATFORM_APPROVE_EXECUTION", "PLATFORM_DENY_APPROVAL", "PLATFORM_CANCEL_APPROVAL"];
12
- export type PlatformToolSurfaceName = PlatformMcpToolName;
7
+ export type { StacklinkMemoryAvailabilityMode, StacklinkMemoryCaptureController, StacklinkMemoryCaptureIssue, StacklinkMemoryCaptureMode, StacklinkMemoryDiagnostic, StacklinkMemoryLifecycleOptions, StacklinkMemorySessionLike, StacklinkMemoryTurnContext, StacklinkMemoryTurnOptions, } from './memory-lifecycle.js';
13
8
  export type StacklinkFetch = typeof fetch;
14
- export type StacklinkMcpToolName = StacklinkMetaToolName | PlatformMcpToolName | KnowledgeMetaToolName | MemoryMetaToolName;
9
+ export type StacklinkMcpToolName = StacklinkMetaToolName;
15
10
  export type StacklinkToolSurfaceName = StacklinkMcpToolName | (string & {});
16
- export declare const stacklinkTypeScriptSdkVersion = "0.2.0";
11
+ export declare const stacklinkTypeScriptSdkVersion = "0.2.2";
17
12
  export declare class StacklinkApiError extends Error {
18
13
  readonly statusCode: number;
19
14
  readonly code?: string | undefined;
@@ -26,6 +21,10 @@ export type JsonRecord = Record<string, unknown>;
26
21
  export type StacklinkExecutionKind = 'tool' | 'batch' | 'workbench_bash' | 'workbench_code' | 'workbench_proxy';
27
22
  export interface StacklinkRequestOptions {
28
23
  signal?: AbortSignal | undefined;
24
+ timeoutMs?: number | undefined;
25
+ idempotencyKey?: string | undefined;
26
+ requestId?: string | undefined;
27
+ traceparent?: string | undefined;
29
28
  }
30
29
  interface StacklinkRequestInit extends StacklinkRequestOptions {
31
30
  method?: string | undefined;
@@ -164,7 +163,7 @@ export type ProviderMcpTransport = 'streamable_http';
164
163
  export type ProviderMcpAuthType = 'oauth_dcr' | 'oauth_static_client' | 'bearer' | 'none';
165
164
  export type ProviderMcpImportPolicy = 'certified_allowlist' | 'discover_then_review';
166
165
  export type ProviderMcpIdentityKind = 'user' | 'workspace' | 'organization' | 'project';
167
- export type ProviderMcpResourceKind = 'user' | 'workspace' | 'organization' | 'project' | 'site' | 'space' | 'component' | 'repository' | 'channel' | 'label' | 'folder' | 'document' | 'spreadsheet' | 'database';
166
+ export type ProviderMcpResourceKind = 'user' | 'user_group' | 'group' | 'workspace' | 'organization' | 'project' | 'site' | 'space' | 'component' | 'repository' | 'team' | 'channel' | 'chat' | 'message' | 'meeting' | 'scheduled_event' | 'invitee' | 'routing_form' | 'routing_form_submission' | 'meeting_recap' | 'platform' | 'transcript' | 'schedule' | 'shift' | 'label' | 'folder' | 'mail_folder' | 'calendar' | 'contact_folder' | 'file' | 'document' | 'spreadsheet' | 'database' | 'zoom_meeting' | 'zoom_webinar' | 'zoom_transcript' | 'zoom_meeting_summary' | 'invoice' | 'estimate' | 'credit_note' | 'customer_payment' | 'bill' | 'expense' | 'purchase_order' | 'vendor_payment' | 'task' | 'time_entry' | 'shopify_collection' | 'shopify_location' | 'shopify_order' | 'business_account' | 'ad_account' | 'campaign' | 'ad_creative' | 'product_catalog' | 'facebook_page' | 'instagram_account' | 'phone_number' | 'resource';
168
167
  export interface ProviderRuntime {
169
168
  kind: ProviderRuntimeKind;
170
169
  owner: ProviderRuntimeOwner;
@@ -276,6 +275,65 @@ export interface ProjectProvider {
276
275
  } | undefined;
277
276
  toolkit?: ProviderToolkit | undefined;
278
277
  }
278
+ export type ProviderCatalogConnectionStatus = 'connected' | 'in_progress' | 'attention' | 'not_connected';
279
+ export interface ProviderCatalogListItem {
280
+ providerKey: string;
281
+ displayName: string;
282
+ shortDescription: string;
283
+ logoUrl: string;
284
+ categoryKeys: string[];
285
+ authModes: string[];
286
+ catalogStatus: string;
287
+ projectStatus: 'enabled' | 'disabled' | 'planned';
288
+ connection: {
289
+ status: ProviderCatalogConnectionStatus;
290
+ connectedAccountCount: number;
291
+ };
292
+ availableToolCount: number;
293
+ availableTriggerCount: number;
294
+ catalogVersion: string;
295
+ }
296
+ export interface ProviderToolCatalogListItem {
297
+ toolKey: string;
298
+ displayName: string;
299
+ description: string;
300
+ capability: string;
301
+ mutationLevel: string;
302
+ connectionRequired: boolean;
303
+ contractVersion: string;
304
+ status: string;
305
+ }
306
+ export interface CursorPageMeta {
307
+ limit: number;
308
+ nextCursor: string | null;
309
+ hasMore: boolean;
310
+ totalItems: number;
311
+ }
312
+ export interface CatalogSnapshotMeta {
313
+ catalogVersion: string;
314
+ asOf: string;
315
+ }
316
+ export interface ProviderCatalogPage {
317
+ items: ProviderCatalogListItem[];
318
+ page: CursorPageMeta;
319
+ snapshot: CatalogSnapshotMeta;
320
+ }
321
+ export interface ProviderToolCatalogPage {
322
+ providerKey: string;
323
+ items: ProviderToolCatalogListItem[];
324
+ page: CursorPageMeta;
325
+ snapshot: CatalogSnapshotMeta;
326
+ }
327
+ export interface ListProviderCatalogInput {
328
+ limit?: number | undefined;
329
+ cursor?: string | undefined;
330
+ search?: string | undefined;
331
+ providerKeys?: string[] | undefined;
332
+ categoryKeys?: string[] | undefined;
333
+ projectStatus?: 'enabled' | 'disabled' | 'planned' | undefined;
334
+ connectionStatus?: ProviderCatalogConnectionStatus | undefined;
335
+ tenantId?: string | undefined;
336
+ }
279
337
  export interface StacklinkProject {
280
338
  id: string;
281
339
  projectId?: string | undefined;
@@ -375,6 +433,7 @@ export interface ConnectedAccount {
375
433
  displayName: string | null;
376
434
  status: string;
377
435
  authMode: string;
436
+ oauthScopeProfile?: string | null | undefined;
378
437
  isDefault: boolean;
379
438
  region?: string | null | undefined;
380
439
  scopes: unknown;
@@ -489,6 +548,7 @@ export interface ConnectionRequestResponse {
489
548
  providerName?: string | undefined;
490
549
  authConfigId?: string | null | undefined;
491
550
  authMode?: string | null | undefined;
551
+ oauthScopeProfile?: string | null | undefined;
492
552
  status: string;
493
553
  phase?: ConnectionRequestPhase | undefined;
494
554
  nextAction?: ConnectionRequestNextAction | undefined;
@@ -508,6 +568,7 @@ export interface ConnectionAuthorizationResponse {
508
568
  providerKey: string;
509
569
  authConfigId?: string | undefined;
510
570
  authMode?: string | undefined;
571
+ oauthScopeProfile?: string | null | undefined;
511
572
  status: string;
512
573
  phase?: ConnectionRequestPhase | undefined;
513
574
  nextAction?: ConnectionRequestNextAction | undefined;
@@ -707,8 +768,7 @@ export interface UpdateStacklinkSessionInput {
707
768
  expectedConfigVersion?: number | undefined;
708
769
  status?: 'active' | 'closed' | 'failed' | undefined;
709
770
  toolRouter?: CreateStacklinkSessionInput['toolRouter'];
710
- preset?: CreateStacklinkSessionInput['preset'];
711
- preload?: CreateStacklinkSessionInput['preload'];
771
+ modelSurface?: CreateStacklinkSessionInput['modelSurface'];
712
772
  toolkits?: CreateStacklinkSessionInput['toolkits'];
713
773
  tools?: CreateStacklinkSessionInput['tools'];
714
774
  authConfigs?: CreateStacklinkSessionInput['authConfigs'];
@@ -717,7 +777,6 @@ export interface UpdateStacklinkSessionInput {
717
777
  multiAccount?: CreateStacklinkSessionInput['multiAccount'];
718
778
  workbench?: CreateStacklinkSessionInput['workbench'];
719
779
  knowledgePacks?: CreateStacklinkSessionInput['knowledgePacks'];
720
- metaTools?: CreateStacklinkSessionInput['metaTools'];
721
780
  memory?: CreateStacklinkSessionInput['memory'];
722
781
  metadata?: Record<string, unknown> | undefined;
723
782
  }
@@ -1146,6 +1205,7 @@ export interface StacklinkSessionMetaToolDefinition {
1146
1205
  name: string;
1147
1206
  description: string;
1148
1207
  inputSchema: Record<string, unknown>;
1208
+ outputSchema: Record<string, unknown>;
1149
1209
  }
1150
1210
  export interface ProviderArtifact {
1151
1211
  id: string;
@@ -1216,6 +1276,8 @@ export interface StacklinkOptions {
1216
1276
  fetch?: StacklinkFetch;
1217
1277
  registrationKey?: string | undefined;
1218
1278
  cache?: StacklinkClientCacheOptions | undefined;
1279
+ timeoutMs?: number | undefined;
1280
+ maxAttempts?: number | undefined;
1219
1281
  }
1220
1282
  export interface StacklinkClientCacheOptions {
1221
1283
  enabled?: boolean | undefined;
@@ -1228,32 +1290,111 @@ export interface StacklinkClientCacheOptions {
1228
1290
  export interface StacklinkDiscoveryCacheControl {
1229
1291
  cache?: 'default' | 'bypass' | undefined;
1230
1292
  }
1231
- export interface StacklinkPrepareToolsInput extends StacklinkDiscoveryCacheControl {
1232
- intents: string[];
1233
- includeSchemas?: boolean | undefined;
1234
- limitPerIntent?: number | undefined;
1235
- includePlanned?: boolean | undefined;
1236
- toolkitKey?: string | undefined;
1237
- capability?: string | undefined;
1238
- model?: string | undefined;
1293
+ export interface StacklinkAgentSearchQuery {
1294
+ id: string;
1295
+ task: string;
1296
+ providerHint?: {
1297
+ label: string;
1298
+ } | undefined;
1299
+ providerRef?: string | undefined;
1300
+ }
1301
+ export interface StacklinkAgentSearchResponse {
1302
+ schemaVersion: 'stacklink.agent_tool_search.v2';
1303
+ results: Array<{
1304
+ queryId: string;
1305
+ providerResolution: {
1306
+ status: 'resolved' | 'ambiguous' | 'not_found';
1307
+ requestedLabel?: string | undefined;
1308
+ recommended?: {
1309
+ providerRef: string;
1310
+ providerKey: string;
1311
+ displayName: string;
1312
+ } | undefined;
1313
+ alternatives: Array<{
1314
+ providerRef: string;
1315
+ providerKey: string;
1316
+ displayName: string;
1317
+ }>;
1318
+ };
1319
+ provider?: {
1320
+ providerRef: string;
1321
+ providerKey: string;
1322
+ displayName: string;
1323
+ globalStatus: 'available' | 'planned';
1324
+ projectStatus: 'available_to_connect' | 'enabled' | 'blocked' | 'planned';
1325
+ connectionStatus?: string | undefined;
1326
+ } | undefined;
1327
+ accounts?: Array<{
1328
+ accountRef: string;
1329
+ displayName: string;
1330
+ isDefault: boolean;
1331
+ selected: boolean;
1332
+ }> | undefined;
1333
+ tools: Array<{
1334
+ toolRef: string;
1335
+ providerKey: string;
1336
+ displayName: string;
1337
+ description: string;
1338
+ capability: string;
1339
+ risk: string;
1340
+ connectionStatus: string;
1341
+ contractRef?: string | undefined;
1342
+ }>;
1343
+ nextAction?: {
1344
+ kind: 'authorize_connection';
1345
+ connectionRef: string;
1346
+ } | undefined;
1347
+ blocker?: {
1348
+ kind: 'provider_not_found' | 'provider_planned' | 'provider_blocked';
1349
+ owner: 'stacklink' | 'project_admin';
1350
+ } | undefined;
1351
+ }>;
1352
+ limits: {
1353
+ maxQueries: number;
1354
+ maxProviderCandidatesPerQuery: number;
1355
+ maxCandidatesPerQuery: number;
1356
+ maxUniqueTools: number;
1357
+ };
1239
1358
  }
1240
- export interface StacklinkPreparedTools {
1241
- tools: ProviderTool[];
1242
- schemas: ProviderTool[];
1243
- toolKeys: string[];
1244
- search: {
1245
- tools: ProviderTool[];
1246
- queries?: unknown[] | undefined;
1247
- meta?: unknown;
1359
+ export interface StacklinkAgentToolContractsResponse {
1360
+ contract: 'stacklink.agent_tool_contracts.v2';
1361
+ sessionId: string;
1362
+ tools: StacklinkAgentToolContract[];
1363
+ meta: {
1364
+ returned: number;
1365
+ };
1366
+ }
1367
+ export interface StacklinkAgentToolContract {
1368
+ contractRef: string;
1369
+ toolKey: string;
1370
+ contractVersion: string;
1371
+ provider: {
1372
+ providerKey: string;
1373
+ displayName: string;
1374
+ };
1375
+ displayName: string;
1376
+ description: string;
1377
+ capability: string;
1378
+ inputSchema: Record<string, unknown>;
1379
+ outputSchema: Record<string, unknown>;
1380
+ risk: Record<string, unknown>;
1381
+ execution: Record<string, unknown>;
1382
+ outputPolicy: Record<string, unknown>;
1383
+ accountSelection: {
1384
+ required: boolean;
1385
+ status: string;
1386
+ accounts: Array<{
1387
+ accountRef: string;
1388
+ displayName: string;
1389
+ isDefault: boolean;
1390
+ selected: boolean;
1391
+ }>;
1248
1392
  };
1249
1393
  }
1250
1394
  export interface StacklinkDiscoveryConfig {
1251
- preset: 'meta_tools' | 'direct_tools' | 'hybrid';
1252
- preload: {
1253
- tools?: string[] | undefined;
1254
- toolkits?: string[] | undefined;
1255
- includeMetaTools?: boolean | undefined;
1256
- includeWorkbench?: boolean | undefined;
1395
+ mode: 'router' | 'specialist';
1396
+ specialist: {
1397
+ toolKeys: string[];
1257
1398
  includeConnectionManagement?: boolean | undefined;
1258
1399
  };
1259
1400
  }
@@ -1265,13 +1406,12 @@ export interface CreateStacklinkSessionInput {
1265
1406
  userEmail?: string | undefined;
1266
1407
  scopes?: string[] | undefined;
1267
1408
  toolRouter?: Record<string, unknown> | undefined;
1268
- preset?: 'meta_tools' | 'direct_tools' | 'hybrid' | undefined;
1269
- preload?: {
1270
- tools?: string[] | undefined;
1271
- toolkits?: string[] | undefined;
1272
- includeMetaTools?: boolean | undefined;
1273
- includeWorkbench?: boolean | undefined;
1274
- includeConnectionManagement?: boolean | undefined;
1409
+ modelSurface?: {
1410
+ mode: 'router' | 'specialist';
1411
+ specialist?: {
1412
+ toolKeys?: string[] | undefined;
1413
+ includeConnectionManagement?: boolean | undefined;
1414
+ } | undefined;
1275
1415
  } | undefined;
1276
1416
  toolkits?: string[] | {
1277
1417
  enable?: string[];
@@ -1306,12 +1446,6 @@ export interface CreateStacklinkSessionInput {
1306
1446
  contextTokenBudget?: number | undefined;
1307
1447
  policyKey?: string | undefined;
1308
1448
  } | undefined;
1309
- metaTools?: {
1310
- surface?: StacklinkMetaToolSurface;
1311
- includeInternal?: boolean;
1312
- enable?: string[];
1313
- disable?: string[];
1314
- } | undefined;
1315
1449
  metadata?: Record<string, unknown> | undefined;
1316
1450
  }
1317
1451
  export interface ListStacklinkSessionsInput {
@@ -1330,7 +1464,13 @@ export interface ListStacklinkSessionsResponse {
1330
1464
  export interface StacklinkTool {
1331
1465
  description: string;
1332
1466
  parameters: Record<string, unknown>;
1333
- execute: (input: Record<string, unknown>) => Promise<unknown>;
1467
+ outputSchema: Record<string, unknown>;
1468
+ execute: (input: Record<string, unknown>, execution?: StacklinkToolExecutionContext | undefined) => Promise<unknown>;
1469
+ }
1470
+ export interface StacklinkToolExecutionContext {
1471
+ toolCallId?: string | undefined;
1472
+ abortSignal?: AbortSignal | undefined;
1473
+ onProgress?: StacklinkMcpStreamOptions['onProgress'];
1334
1474
  }
1335
1475
  export type StacklinkTools = Record<string, StacklinkTool>;
1336
1476
  export type KnowledgeRetrievalMode = 'canonical_lookup' | 'hybrid_search' | 'semantic_search' | 'text_search' | 'semantic_unavailable';
@@ -1808,6 +1948,9 @@ export declare class Stacklink {
1808
1948
  private readonly fetchImpl;
1809
1949
  private readonly cacheOptions;
1810
1950
  private readonly responseCache;
1951
+ private readonly discoveryRequests;
1952
+ private readonly timeoutMs;
1953
+ private readonly maxAttempts;
1811
1954
  readonly webhooks: StacklinkWebhooksClient;
1812
1955
  readonly triggers: StacklinkTriggersClient;
1813
1956
  readonly sessions: StacklinkSessionsClient;
@@ -1894,25 +2037,15 @@ export declare class Stacklink {
1894
2037
  deleteApiKey(apiKeyId: string): Promise<{
1895
2038
  apiKey: StacklinkApiKey;
1896
2039
  }>;
1897
- listProviders(): Promise<{
1898
- providers: ProviderToolkit[];
1899
- }>;
1900
- listProjectProviders(query?: {
1901
- tenantId?: string;
1902
- }): Promise<{
1903
- providers: ProjectProvider[];
1904
- }>;
2040
+ listProviders(query?: Omit<ListProviderCatalogInput, 'tenantId' | 'projectStatus' | 'connectionStatus'>): Promise<ProviderCatalogPage>;
2041
+ listProjectProviders(query?: ListProviderCatalogInput): Promise<ProviderCatalogPage>;
1905
2042
  listProviderTools(providerKey: string, input?: {
2043
+ limit?: number | undefined;
2044
+ cursor?: string | undefined;
2045
+ search?: string | undefined;
2046
+ capability?: string | undefined;
1906
2047
  includePlanned?: boolean | undefined;
1907
- responseMode?: 'compact' | 'full' | undefined;
1908
- }): Promise<{
1909
- providerKey: string;
1910
- tools: ProviderTool[];
1911
- meta?: {
1912
- responseMode?: "compact" | "full" | undefined;
1913
- provider?: ProviderToolkit | undefined;
1914
- } | undefined;
1915
- }>;
2048
+ }): Promise<ProviderToolCatalogPage>;
1916
2049
  createProject(input: {
1917
2050
  clientName: string;
1918
2051
  projectName?: string | undefined;
@@ -1999,8 +2132,7 @@ export declare class Stacklink {
1999
2132
  }>;
2000
2133
  getRuntimeToolContracts(input: {
2001
2134
  sessionId: string;
2002
- toolkitKeys?: string[] | undefined;
2003
- toolKeys?: string[] | undefined;
2135
+ toolKeys: string[];
2004
2136
  includePlanned?: boolean | undefined;
2005
2137
  }): Promise<{
2006
2138
  contract: string;
@@ -2244,12 +2376,18 @@ export declare class Stacklink {
2244
2376
  hasMore: boolean;
2245
2377
  nextCursor: string | null;
2246
2378
  }>;
2379
+ streamExecutionEvents(input: {
2380
+ sessionId: string;
2381
+ executionKind: StacklinkExecutionKind;
2382
+ executionId: string;
2383
+ afterSequence?: string | number | bigint | undefined;
2384
+ limit?: number | undefined;
2385
+ }, options?: StacklinkRequestOptions): AsyncGenerator<any, void, unknown>;
2247
2386
  waitForExecution(input: {
2248
2387
  sessionId: string;
2249
2388
  executionKind: StacklinkExecutionKind;
2250
2389
  executionId: string;
2251
2390
  waitTimeoutMs?: number | undefined;
2252
- pollIntervalMs?: number | undefined;
2253
2391
  }, options?: StacklinkRequestOptions): Promise<Record<string, unknown>>;
2254
2392
  cancelExecution(input: {
2255
2393
  sessionId: string;
@@ -2281,9 +2419,9 @@ export declare class Stacklink {
2281
2419
  getConnectedAccount(accountId: string): Promise<{
2282
2420
  account: ConnectedAccount;
2283
2421
  }>;
2284
- listConnectedAccountTools(accountId: string, input?: {
2422
+ listConnectedAccountTools(accountId: string, input: {
2285
2423
  includePlanned?: boolean | undefined;
2286
- toolKeys?: string[] | undefined;
2424
+ toolKeys: string[];
2287
2425
  }): Promise<{
2288
2426
  contract: string;
2289
2427
  sessionId: string;
@@ -2536,15 +2674,11 @@ export declare class Stacklink {
2536
2674
  deleteWorkbenchBudget(budgetPolicyId: string): Promise<{
2537
2675
  budgetPolicy: WorkbenchBudgetPolicy;
2538
2676
  }>;
2539
- mcpRequest(input: Record<string, unknown> | Array<Record<string, unknown>>, options?: StacklinkRequestOptions): Promise<unknown>;
2540
- mcpSessionRequest(sessionId: string, input: Record<string, unknown> | Array<Record<string, unknown>>, options?: StacklinkRequestOptions): Promise<unknown>;
2677
+ mcpSessionRequest(sessionId: string, input: Record<string, unknown> | Array<Record<string, unknown>>, options?: StacklinkRequestOptions): Promise<{} | null>;
2541
2678
  private mcpRequestAtPath;
2542
- mcpRequestStream(input: Record<string, unknown>, options?: StacklinkMcpStreamOptions): Promise<unknown>;
2543
- mcpSessionRequestStream(sessionId: string, input: Record<string, unknown>, options?: StacklinkMcpStreamOptions): Promise<unknown>;
2679
+ mcpSessionRequestStream(sessionId: string, input: Record<string, unknown>, options?: StacklinkMcpStreamOptions): Promise<{} | null>;
2544
2680
  private mcpRequestStreamAtPath;
2545
- listMcpTools(): Promise<unknown>;
2546
- callMcpTool(name: StacklinkToolSurfaceName, args: Record<string, unknown>): Promise<unknown>;
2547
- callSessionMcpTool(sessionId: string, name: StacklinkToolSurfaceName, args: Record<string, unknown>): Promise<unknown>;
2681
+ callSessionMcpTool(sessionId: string, name: StacklinkToolSurfaceName, args: Record<string, unknown>, options?: StacklinkMcpStreamOptions): Promise<{} | null>;
2548
2682
  listKnowledgePacks(): Promise<KnowledgePackListResponse>;
2549
2683
  getKnowledgeCapabilities(input?: {
2550
2684
  sessionId?: string | undefined;
@@ -2571,10 +2705,12 @@ export declare class Stacklink {
2571
2705
  private attachAbortSignalCancellation;
2572
2706
  request<T>(path: string, init?: StacklinkRequestInit): Promise<T>;
2573
2707
  requestRaw(path: string, init?: StacklinkRequestInit): Promise<Response>;
2708
+ private performRequest;
2574
2709
  cachedDiscoveryRequest<T>(cacheKey: string, ttlMs: number, control: StacklinkDiscoveryCacheControl | undefined, producer: () => Promise<T>): Promise<T>;
2575
2710
  discoveryCacheTtl(kind: 'toolsList' | 'toolkits' | 'schemas' | 'search'): number;
2576
2711
  private trimResponseCache;
2577
2712
  private readMcpEventStream;
2713
+ private readJsonEventStream;
2578
2714
  private requestHeaders;
2579
2715
  }
2580
2716
  export declare class StacklinkWebhooksClient {
@@ -2646,6 +2782,30 @@ export interface StacklinkMemoryAccessSelector {
2646
2782
  subjectType?: MemorySubjectRef['type'] | undefined;
2647
2783
  externalSubjectId?: string | undefined;
2648
2784
  }
2785
+ export interface StacklinkMemoryQualityReviewEntity {
2786
+ entityType: string;
2787
+ canonicalKey: string;
2788
+ displayName?: string | null | undefined;
2789
+ attributes?: JsonRecord | undefined;
2790
+ }
2791
+ export interface StacklinkMemoryQualityReviewInput {
2792
+ disposition: 'keep' | 'correct' | 'convert_to_episode' | 'restrict';
2793
+ content?: string | undefined;
2794
+ title?: string | null | undefined;
2795
+ memoryType: 'preference' | 'decision' | 'commitment' | 'goal' | 'constraint' | 'relationship' | 'durable_fact';
2796
+ sensitivityClass: 'standard' | 'personal' | 'restricted';
2797
+ restrictedDataClasses?: Array<'health' | 'biometric' | 'government_identity' | 'precise_location' | 'protected_trait' | 'minor' | 'detailed_personal_financial'> | undefined;
2798
+ topicTags?: string[] | undefined;
2799
+ language?: string | null | undefined;
2800
+ validFrom?: string | null | undefined;
2801
+ validTo?: string | null | undefined;
2802
+ authorshipClass: 'connected_user' | 'other_human' | 'bot' | 'application' | 'system' | 'unknown';
2803
+ salience: 'low' | 'medium' | 'high';
2804
+ evidenceConfidence: 'low' | 'medium' | 'high';
2805
+ actorEntity: StacklinkMemoryQualityReviewEntity;
2806
+ subjectEntity: StacklinkMemoryQualityReviewEntity;
2807
+ reason: string;
2808
+ }
2649
2809
  export declare class StacklinkMemoryClient {
2650
2810
  private readonly client;
2651
2811
  constructor(client: Stacklink);
@@ -2694,6 +2854,9 @@ export declare class StacklinkMemoryClient {
2694
2854
  metadata?: JsonRecord | undefined;
2695
2855
  };
2696
2856
  }): Promise<JsonRecord>;
2857
+ reviewQuality(memoryId: string, input: StacklinkMemoryAccessSelector & {
2858
+ review: StacklinkMemoryQualityReviewInput;
2859
+ }): Promise<JsonRecord>;
2697
2860
  forget(memoryId: string, input: StacklinkMemoryAccessSelector & {
2698
2861
  reason?: string | undefined;
2699
2862
  }): Promise<JsonRecord>;
@@ -2756,7 +2919,7 @@ export declare class StacklinkMemoryClient {
2756
2919
  getSource(bindingId: string): Promise<JsonRecord>;
2757
2920
  setSourceStatus(bindingId: string, status: 'active' | 'paused'): Promise<JsonRecord>;
2758
2921
  updateSource(bindingId: string, input: MemorySourceBindingUpdateInput): Promise<JsonRecord>;
2759
- deleteSource(bindingId: string): Promise<JsonRecord>;
2922
+ deleteSource(bindingId: string, input: MemorySourceRemovalInput): Promise<JsonRecord>;
2760
2923
  replaySourceItem(bindingId: string, itemId: string): Promise<JsonRecord>;
2761
2924
  listSourceDeliveries(input?: {
2762
2925
  tenantId?: string | undefined;
@@ -2797,14 +2960,11 @@ export declare class StacklinkSessionsClient {
2797
2960
  tools: StacklinkSessionMetaToolDefinition[];
2798
2961
  toolRouterSession?: StacklinkSessionData;
2799
2962
  }>;
2800
- toolkits(sessionId: string): Promise<{
2801
- toolkits: ProjectProvider[];
2802
- }>;
2963
+ toolkits(sessionId: string, query?: Omit<ListProviderCatalogInput, 'tenantId'>): Promise<ProviderCatalogPage>;
2803
2964
  streamEvents(sessionId: string, input?: {
2804
2965
  after?: string;
2805
2966
  eventTypes?: string[];
2806
2967
  limit?: number;
2807
- pollIntervalMs?: number;
2808
2968
  }): Promise<Response>;
2809
2969
  listRouterFacts(sessionId: string, query?: {
2810
2970
  kind?: string;
@@ -2928,9 +3088,9 @@ export declare class StacklinkConnectedAccountsClient {
2928
3088
  get(accountId: string): Promise<{
2929
3089
  account: ConnectedAccount;
2930
3090
  }>;
2931
- listTools(accountId: string, input?: {
3091
+ listTools(accountId: string, input: {
2932
3092
  includePlanned?: boolean | undefined;
2933
- toolKeys?: string[] | undefined;
3093
+ toolKeys: string[];
2934
3094
  }): Promise<{
2935
3095
  contract: string;
2936
3096
  sessionId: string;
@@ -2992,22 +3152,15 @@ export declare class StacklinkAuthConfigsClient {
2992
3152
  export declare class StacklinkToolkitsClient {
2993
3153
  private readonly client;
2994
3154
  constructor(client: Stacklink);
2995
- list(): Promise<{
2996
- providers: ProviderToolkit[];
2997
- }>;
2998
- listProject(query?: {
2999
- tenantId?: string;
3000
- }): Promise<{
3001
- providers: ProjectProvider[];
3002
- }>;
3003
- listTools(providerKey: string): Promise<{
3004
- providerKey: string;
3005
- tools: ProviderTool[];
3006
- meta?: {
3007
- responseMode?: "compact" | "full" | undefined;
3008
- provider?: ProviderToolkit | undefined;
3009
- } | undefined;
3010
- }>;
3155
+ list(query?: Omit<ListProviderCatalogInput, 'tenantId' | 'projectStatus' | 'connectionStatus'>): Promise<ProviderCatalogPage>;
3156
+ listProject(query?: ListProviderCatalogInput): Promise<ProviderCatalogPage>;
3157
+ listTools(providerKey: string, query?: {
3158
+ limit?: number | undefined;
3159
+ cursor?: string | undefined;
3160
+ search?: string | undefined;
3161
+ capability?: string | undefined;
3162
+ includePlanned?: boolean | undefined;
3163
+ }): Promise<ProviderToolCatalogPage>;
3011
3164
  }
3012
3165
  export declare class StacklinkProviderToolsClient {
3013
3166
  private readonly client;
@@ -3026,8 +3179,7 @@ export declare class StacklinkProviderToolsClient {
3026
3179
  }>;
3027
3180
  runtimeContracts(input: {
3028
3181
  sessionId: string;
3029
- toolkitKeys?: string[] | undefined;
3030
- toolKeys?: string[] | undefined;
3182
+ toolKeys: string[];
3031
3183
  includePlanned?: boolean | undefined;
3032
3184
  }): Promise<{
3033
3185
  contract: string;
@@ -3073,7 +3225,6 @@ export declare class StacklinkSessionMemoryClient {
3073
3225
  history(memoryId: string): Promise<JsonRecord>;
3074
3226
  update(memoryId: string, patch: Parameters<StacklinkMemoryClient['update']>[1]['patch']): Promise<JsonRecord>;
3075
3227
  forget(memoryId: string, reason?: string): Promise<JsonRecord>;
3076
- restore(memoryId: string, reason?: string): Promise<JsonRecord>;
3077
3228
  }
3078
3229
  export declare class StacklinkWorkbenchRun {
3079
3230
  private readonly client;
@@ -3083,12 +3234,12 @@ export declare class StacklinkWorkbenchRun {
3083
3234
  readonly executionKind: 'workbench_code' | 'workbench_bash';
3084
3235
  constructor(client: Stacklink, platformSessionId: string, response: WorkbenchExecutionResponse);
3085
3236
  events(input?: {
3086
- pollIntervalMs?: number | undefined;
3237
+ signal?: AbortSignal | undefined;
3238
+ streamTimeoutMs?: number | undefined;
3087
3239
  limit?: number | undefined;
3088
- }): AsyncGenerator<unknown, void, unknown>;
3240
+ }): AsyncGenerator<any, void, unknown>;
3089
3241
  wait(input?: {
3090
3242
  waitTimeoutMs?: number | undefined;
3091
- pollIntervalMs?: number | undefined;
3092
3243
  }): Promise<Record<string, unknown>>;
3093
3244
  cancel(reason?: string): Promise<Record<string, unknown>>;
3094
3245
  }
@@ -3231,9 +3382,9 @@ export declare class ToolRouterSession {
3231
3382
  get(): Promise<{
3232
3383
  session: StacklinkSessionData;
3233
3384
  }>;
3234
- mcpRequest(input: Record<string, unknown> | Array<Record<string, unknown>>, options?: StacklinkRequestOptions): Promise<unknown>;
3235
- mcpRequestStream(input: Record<string, unknown>, options?: StacklinkMcpStreamOptions): Promise<unknown>;
3236
- callMcpTool(name: StacklinkToolSurfaceName, args: Record<string, unknown>): Promise<unknown>;
3385
+ mcpRequest(input: Record<string, unknown> | Array<Record<string, unknown>>, options?: StacklinkRequestOptions): Promise<{} | null>;
3386
+ mcpRequestStream(input: Record<string, unknown>, options?: StacklinkMcpStreamOptions): Promise<{} | null>;
3387
+ callMcpTool(name: StacklinkToolSurfaceName, args: Record<string, unknown>, options?: StacklinkMcpStreamOptions): Promise<{} | null>;
3237
3388
  mcpConnection(): StacklinkSessionMcpConnection;
3238
3389
  update(patch: UpdateStacklinkSessionInput): Promise<{
3239
3390
  session: StacklinkSessionData;
@@ -3287,11 +3438,9 @@ export declare class ToolRouterSession {
3287
3438
  usage: unknown[];
3288
3439
  cost: unknown[];
3289
3440
  }>;
3290
- toolkits(): Promise<ProjectProvider[]>;
3291
- authorize(providerKey: string, input?: {
3292
- callbackUrl?: string;
3293
- authConfigId?: string;
3294
- authMode?: string;
3441
+ toolkits(query?: Omit<ListProviderCatalogInput, 'tenantId'>): Promise<ProviderCatalogPage>;
3442
+ authorize(connectionRef: string, input?: {
3443
+ oauthScopeProfile?: string;
3295
3444
  metadata?: Record<string, unknown>;
3296
3445
  }): Promise<StacklinkConnectionRequest>;
3297
3446
  waitForConnections(connectionRequestIds: string[], timeoutMs?: number, intervalMs?: number): Promise<{
@@ -3309,27 +3458,10 @@ export declare class ToolRouterSession {
3309
3458
  connectedAccountSecrets(accountId: string): Promise<unknown[]>;
3310
3459
  connectedAccountResources(accountId: string): Promise<ConnectedAccountResourcesResponse>;
3311
3460
  refreshConnectedAccountResources(accountId: string): Promise<ConnectedAccountResourcesResponse>;
3312
- searchTools(input?: Omit<Record<string, unknown>, 'sessionId'> & StacklinkDiscoveryCacheControl): Promise<{
3313
- tools: ProviderTool[];
3314
- queries?: unknown[];
3315
- meta?: unknown;
3316
- }>;
3317
- getToolSchemas(toolKeys: string[], input?: {
3318
- includePlanned?: boolean | undefined;
3319
- } & StacklinkDiscoveryCacheControl): Promise<{
3320
- tools: ProviderTool[];
3321
- }>;
3322
- prepareRuntimeTools(input?: {
3323
- toolkitKeys?: string[] | undefined;
3324
- toolKeys?: string[] | undefined;
3325
- includePlanned?: boolean | undefined;
3326
- }): Promise<{
3327
- contract: string;
3328
- sessionId: string;
3329
- tools: ProviderTool[];
3330
- meta?: unknown;
3331
- }>;
3332
- prepareTools(input: StacklinkPrepareToolsInput): Promise<StacklinkPreparedTools>;
3461
+ search(input: {
3462
+ queries: StacklinkAgentSearchQuery[];
3463
+ } & StacklinkDiscoveryCacheControl): Promise<StacklinkAgentSearchResponse>;
3464
+ getContracts(contractRefs: string[]): Promise<StacklinkAgentToolContractsResponse>;
3333
3465
  searchKnowledge(input?: Omit<KnowledgeSearchInput, 'sessionId'>): Promise<KnowledgeSearchResponse>;
3334
3466
  getKnowledgeCapabilities(input?: {
3335
3467
  packKey?: string | undefined;
@@ -3349,8 +3481,16 @@ export declare class ToolRouterSession {
3349
3481
  checkGstRcm(input: Omit<GstRcmCheckInput, 'sessionId'>): Promise<GstRcmCheckResponse>;
3350
3482
  getGstNoticeRule(input: Omit<GstNoticeRuleInput, 'sessionId'>): Promise<GstNoticeRuleResponse>;
3351
3483
  getGstAppealStageRule(input: Omit<GstAppealStageRuleInput, 'sessionId'>): Promise<GstAppealStageRuleResponse>;
3352
- executeTool(input: Omit<Record<string, unknown>, 'sessionId'>, options?: StacklinkRequestOptions): Promise<Record<string, unknown>>;
3353
- executeToolsBatch(input: Omit<Record<string, unknown>, 'sessionId'>, options?: StacklinkRequestOptions): Promise<Record<string, unknown>>;
3484
+ execute(contractRef: string, input: Record<string, unknown>, execution?: {
3485
+ accountRef?: string | undefined;
3486
+ binding?: {
3487
+ targetType: string;
3488
+ targetId: string;
3489
+ } | undefined;
3490
+ idempotencyKey?: string | undefined;
3491
+ clientExecutionId?: string | undefined;
3492
+ metadata?: Record<string, unknown> | undefined;
3493
+ }, options?: StacklinkRequestOptions): Promise<Record<string, unknown>>;
3354
3494
  runWorkbench(input: Omit<Record<string, unknown>, 'sessionId'>, options?: StacklinkRequestOptions): Promise<Record<string, unknown>>;
3355
3495
  destroyWorkbenchSession(input: {
3356
3496
  workbenchSessionId: string;
@@ -3398,7 +3538,6 @@ export declare class ToolRouterSession {
3398
3538
  executionKind: StacklinkExecutionKind;
3399
3539
  executionId: string;
3400
3540
  waitTimeoutMs?: number | undefined;
3401
- pollIntervalMs?: number | undefined;
3402
3541
  }, options?: StacklinkRequestOptions): Promise<Record<string, unknown>>;
3403
3542
  cancelExecution(input: {
3404
3543
  executionKind: StacklinkExecutionKind;
@@ -3409,7 +3548,6 @@ export declare class ToolRouterSession {
3409
3548
  after?: string;
3410
3549
  eventTypes?: string[];
3411
3550
  limit?: number;
3412
- pollIntervalMs?: number;
3413
3551
  }): Promise<Response>;
3414
3552
  tools(): StacklinkTools;
3415
3553
  }