@kontext-dev/js-sdk 0.3.0 → 1.1.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 (63) hide show
  1. package/dist/adapters/ai/index.cjs +12 -2
  2. package/dist/adapters/ai/index.cjs.map +1 -1
  3. package/dist/adapters/ai/index.js +12 -2
  4. package/dist/adapters/ai/index.js.map +1 -1
  5. package/dist/adapters/cloudflare/index.cjs +13 -0
  6. package/dist/adapters/cloudflare/index.cjs.map +1 -1
  7. package/dist/adapters/cloudflare/index.js +13 -0
  8. package/dist/adapters/cloudflare/index.js.map +1 -1
  9. package/dist/adapters/cloudflare/react.cjs +12 -2
  10. package/dist/adapters/cloudflare/react.cjs.map +1 -1
  11. package/dist/adapters/cloudflare/react.js +12 -2
  12. package/dist/adapters/cloudflare/react.js.map +1 -1
  13. package/dist/adapters/react/index.cjs +12 -2
  14. package/dist/adapters/react/index.cjs.map +1 -1
  15. package/dist/adapters/react/index.js +12 -2
  16. package/dist/adapters/react/index.js.map +1 -1
  17. package/dist/client/index.cjs +108 -69
  18. package/dist/client/index.cjs.map +1 -1
  19. package/dist/client/index.d.cts +2 -0
  20. package/dist/client/index.d.ts +2 -0
  21. package/dist/client/index.js +109 -71
  22. package/dist/client/index.js.map +1 -1
  23. package/dist/errors.cjs +78 -0
  24. package/dist/errors.cjs.map +1 -1
  25. package/dist/errors.d.cts +7 -1
  26. package/dist/errors.d.ts +7 -1
  27. package/dist/errors.js +78 -1
  28. package/dist/errors.js.map +1 -1
  29. package/dist/index.cjs +151 -87
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +1 -1
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +152 -88
  34. package/dist/index.js.map +1 -1
  35. package/dist/{kontext-CgIBANFo.d.cts → kontext-CBPuE-hq.d.cts} +3 -0
  36. package/dist/{kontext-CgIBANFo.d.ts → kontext-CBPuE-hq.d.ts} +3 -0
  37. package/dist/management/index.cjs +15 -0
  38. package/dist/management/index.cjs.map +1 -1
  39. package/dist/management/index.d.cts +2 -2
  40. package/dist/management/index.d.ts +2 -2
  41. package/dist/management/index.js +15 -1
  42. package/dist/management/index.js.map +1 -1
  43. package/dist/mcp/index.cjs +32 -3
  44. package/dist/mcp/index.cjs.map +1 -1
  45. package/dist/mcp/index.d.cts +7 -1
  46. package/dist/mcp/index.d.ts +7 -1
  47. package/dist/mcp/index.js +33 -4
  48. package/dist/mcp/index.js.map +1 -1
  49. package/dist/oauth/index.cjs +12 -2
  50. package/dist/oauth/index.cjs.map +1 -1
  51. package/dist/oauth/index.d.cts +1 -1
  52. package/dist/oauth/index.d.ts +1 -1
  53. package/dist/oauth/index.js +12 -2
  54. package/dist/oauth/index.js.map +1 -1
  55. package/dist/server/index.cjs +55 -20
  56. package/dist/server/index.cjs.map +1 -1
  57. package/dist/server/index.d.cts +2 -2
  58. package/dist/server/index.d.ts +2 -2
  59. package/dist/server/index.js +56 -21
  60. package/dist/server/index.js.map +1 -1
  61. package/dist/{types-CzhnlJHW.d.cts → types-DicGI7ix.d.cts} +23 -1
  62. package/dist/{types-CzhnlJHW.d.ts → types-DicGI7ix.d.ts} +23 -1
  63. package/package.json +1 -1
@@ -92,6 +92,7 @@ interface Integration {
92
92
  validationMessage?: string;
93
93
  lastValidatedAt?: string;
94
94
  userConnection?: ConnectionStatusResponse;
95
+ sharedConnection?: ConnectionStatusResponse;
95
96
  createdAt: string;
96
97
  updatedAt: string;
97
98
  archivedAt?: string;
@@ -137,6 +138,20 @@ interface ConnectionStatusResponse {
137
138
  status?: ConnectionStatus;
138
139
  expiresAt?: string;
139
140
  displayName?: string;
141
+ lastVerifiedAt?: string;
142
+ lastVerifiedStatus?: string;
143
+ verificationMessage?: string;
144
+ }
145
+ type TestConnectionStatus = "verified" | "auth_failed" | "unreachable" | "mcp_failed" | "no_credential";
146
+ interface TestConnectionResponse {
147
+ status: TestConnectionStatus;
148
+ message?: string;
149
+ toolCount?: number;
150
+ testedAt: string;
151
+ connection: {
152
+ connected: boolean;
153
+ expiresAt?: string;
154
+ };
140
155
  }
141
156
  interface ConnectionResponse {
142
157
  connection: ConnectionStatusResponse;
@@ -178,6 +193,8 @@ interface AgentSession {
178
193
  id: string;
179
194
  agentId: string;
180
195
  organizationId: string;
196
+ authenticatedUserId: string;
197
+ authenticatedUserEmail?: string | null;
181
198
  name: string;
182
199
  hostname?: string | null;
183
200
  userAgent?: string | null;
@@ -337,6 +354,11 @@ declare const TOKEN_EXCHANGE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:toke
337
354
  * RFC 8693 token type identifier for access tokens
338
355
  */
339
356
  declare const TOKEN_TYPE_ACCESS_TOKEN = "urn:ietf:params:oauth:token-type:access_token";
357
+ /**
358
+ * Kontext custom token type: the subject_token is an end-user external ID.
359
+ * Used by confidential clients for the credential vault flow.
360
+ */
361
+ declare const TOKEN_TYPE_USER_ID = "urn:kontext:user-id";
340
362
  /**
341
363
  * Request body for RFC 8693 token exchange
342
364
  */
@@ -394,4 +416,4 @@ interface KontextManagementClientConfig {
394
416
  };
395
417
  }
396
418
 
397
- export { TOKEN_TYPE_ACCESS_TOKEN as $, type ApplicationResponse as A, type ConnectionResponse as B, type CreateServiceAccountInput as C, type ConnectionStatus as D, type ConnectionStatusResponse as E, type CreateApplicationOAuthInput as F, type Integration as G, type IntegrationAuthMode as H, type IntegrationResponse as I, type IntegrationCapabilities as J, type KontextManagementClientConfig as K, type ListServiceAccountsResponse as L, type McpEventListResponse as M, type IntegrationOAuthConfigInput as N, type IntegrationOAuthSummary as O, type PaginationParams as P, type IntegrationValidationStatus as Q, type RotateSecretResponse as R, type ServiceAccountResponse as S, type TokenExchangeRequest as T, type UpdateApplicationInput as U, type ValidateIntegrationResponse as V, type ListEventsResponse as W, type McpEvent as X, type OAuthTokens as Y, type ServiceAccount as Z, TOKEN_EXCHANGE_GRANT_TYPE as _, type TokenExchangeResponse as a, type Trace as a0, type TraceEvent as a1, type TraceStats as a2, type CreateServiceAccountResponse as b, type CreateApplicationInput as c, type CreateApplicationResponse as d, type ListApplicationsResponse as e, type ApplicationOAuthResponse as f, type UpdateApplicationOAuthInput as g, type RotateApplicationSecretResponse as h, type ApplicationIntegrationsResponse as i, type UpdateApplicationIntegrationsInput as j, type RevokeAllSessionsResponse as k, type CreateIntegrationInput as l, type CreateIntegrationResponse as m, type ListIntegrationsResponse as n, type UpdateIntegrationInput as o, type ListAgentSessionsResponse as p, type AgentSessionResponse as q, type ListTracesResponse as r, type TraceResponse as s, type TraceStatsResponse as t, type AddUserTokenInput as u, type AgentSession as v, type AgentSessionDerivedStatus as w, type AgentSessionStatus as x, type Application as y, type ApplicationOAuth as z };
419
+ export { TOKEN_TYPE_ACCESS_TOKEN as $, type ApplicationResponse as A, type ConnectionResponse as B, type CreateServiceAccountInput as C, type ConnectionStatus as D, type ConnectionStatusResponse as E, type CreateApplicationOAuthInput as F, type Integration as G, type IntegrationAuthMode as H, type IntegrationResponse as I, type IntegrationCapabilities as J, type KontextManagementClientConfig as K, type ListServiceAccountsResponse as L, type McpEventListResponse as M, type IntegrationOAuthConfigInput as N, type IntegrationOAuthSummary as O, type PaginationParams as P, type IntegrationValidationStatus as Q, type RotateSecretResponse as R, type ServiceAccountResponse as S, type TokenExchangeRequest as T, type UpdateApplicationInput as U, type ValidateIntegrationResponse as V, type ListEventsResponse as W, type McpEvent as X, type OAuthTokens as Y, type ServiceAccount as Z, TOKEN_EXCHANGE_GRANT_TYPE as _, type TokenExchangeResponse as a, TOKEN_TYPE_USER_ID as a0, type TestConnectionResponse as a1, type TestConnectionStatus as a2, type Trace as a3, type TraceEvent as a4, type TraceStats as a5, type CreateServiceAccountResponse as b, type CreateApplicationInput as c, type CreateApplicationResponse as d, type ListApplicationsResponse as e, type ApplicationOAuthResponse as f, type UpdateApplicationOAuthInput as g, type RotateApplicationSecretResponse as h, type ApplicationIntegrationsResponse as i, type UpdateApplicationIntegrationsInput as j, type RevokeAllSessionsResponse as k, type CreateIntegrationInput as l, type CreateIntegrationResponse as m, type ListIntegrationsResponse as n, type UpdateIntegrationInput as o, type ListAgentSessionsResponse as p, type AgentSessionResponse as q, type ListTracesResponse as r, type TraceResponse as s, type TraceStatsResponse as t, type AddUserTokenInput as u, type AgentSession as v, type AgentSessionDerivedStatus as w, type AgentSessionStatus as x, type Application as y, type ApplicationOAuth as z };
@@ -92,6 +92,7 @@ interface Integration {
92
92
  validationMessage?: string;
93
93
  lastValidatedAt?: string;
94
94
  userConnection?: ConnectionStatusResponse;
95
+ sharedConnection?: ConnectionStatusResponse;
95
96
  createdAt: string;
96
97
  updatedAt: string;
97
98
  archivedAt?: string;
@@ -137,6 +138,20 @@ interface ConnectionStatusResponse {
137
138
  status?: ConnectionStatus;
138
139
  expiresAt?: string;
139
140
  displayName?: string;
141
+ lastVerifiedAt?: string;
142
+ lastVerifiedStatus?: string;
143
+ verificationMessage?: string;
144
+ }
145
+ type TestConnectionStatus = "verified" | "auth_failed" | "unreachable" | "mcp_failed" | "no_credential";
146
+ interface TestConnectionResponse {
147
+ status: TestConnectionStatus;
148
+ message?: string;
149
+ toolCount?: number;
150
+ testedAt: string;
151
+ connection: {
152
+ connected: boolean;
153
+ expiresAt?: string;
154
+ };
140
155
  }
141
156
  interface ConnectionResponse {
142
157
  connection: ConnectionStatusResponse;
@@ -178,6 +193,8 @@ interface AgentSession {
178
193
  id: string;
179
194
  agentId: string;
180
195
  organizationId: string;
196
+ authenticatedUserId: string;
197
+ authenticatedUserEmail?: string | null;
181
198
  name: string;
182
199
  hostname?: string | null;
183
200
  userAgent?: string | null;
@@ -337,6 +354,11 @@ declare const TOKEN_EXCHANGE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:toke
337
354
  * RFC 8693 token type identifier for access tokens
338
355
  */
339
356
  declare const TOKEN_TYPE_ACCESS_TOKEN = "urn:ietf:params:oauth:token-type:access_token";
357
+ /**
358
+ * Kontext custom token type: the subject_token is an end-user external ID.
359
+ * Used by confidential clients for the credential vault flow.
360
+ */
361
+ declare const TOKEN_TYPE_USER_ID = "urn:kontext:user-id";
340
362
  /**
341
363
  * Request body for RFC 8693 token exchange
342
364
  */
@@ -394,4 +416,4 @@ interface KontextManagementClientConfig {
394
416
  };
395
417
  }
396
418
 
397
- export { TOKEN_TYPE_ACCESS_TOKEN as $, type ApplicationResponse as A, type ConnectionResponse as B, type CreateServiceAccountInput as C, type ConnectionStatus as D, type ConnectionStatusResponse as E, type CreateApplicationOAuthInput as F, type Integration as G, type IntegrationAuthMode as H, type IntegrationResponse as I, type IntegrationCapabilities as J, type KontextManagementClientConfig as K, type ListServiceAccountsResponse as L, type McpEventListResponse as M, type IntegrationOAuthConfigInput as N, type IntegrationOAuthSummary as O, type PaginationParams as P, type IntegrationValidationStatus as Q, type RotateSecretResponse as R, type ServiceAccountResponse as S, type TokenExchangeRequest as T, type UpdateApplicationInput as U, type ValidateIntegrationResponse as V, type ListEventsResponse as W, type McpEvent as X, type OAuthTokens as Y, type ServiceAccount as Z, TOKEN_EXCHANGE_GRANT_TYPE as _, type TokenExchangeResponse as a, type Trace as a0, type TraceEvent as a1, type TraceStats as a2, type CreateServiceAccountResponse as b, type CreateApplicationInput as c, type CreateApplicationResponse as d, type ListApplicationsResponse as e, type ApplicationOAuthResponse as f, type UpdateApplicationOAuthInput as g, type RotateApplicationSecretResponse as h, type ApplicationIntegrationsResponse as i, type UpdateApplicationIntegrationsInput as j, type RevokeAllSessionsResponse as k, type CreateIntegrationInput as l, type CreateIntegrationResponse as m, type ListIntegrationsResponse as n, type UpdateIntegrationInput as o, type ListAgentSessionsResponse as p, type AgentSessionResponse as q, type ListTracesResponse as r, type TraceResponse as s, type TraceStatsResponse as t, type AddUserTokenInput as u, type AgentSession as v, type AgentSessionDerivedStatus as w, type AgentSessionStatus as x, type Application as y, type ApplicationOAuth as z };
419
+ export { TOKEN_TYPE_ACCESS_TOKEN as $, type ApplicationResponse as A, type ConnectionResponse as B, type CreateServiceAccountInput as C, type ConnectionStatus as D, type ConnectionStatusResponse as E, type CreateApplicationOAuthInput as F, type Integration as G, type IntegrationAuthMode as H, type IntegrationResponse as I, type IntegrationCapabilities as J, type KontextManagementClientConfig as K, type ListServiceAccountsResponse as L, type McpEventListResponse as M, type IntegrationOAuthConfigInput as N, type IntegrationOAuthSummary as O, type PaginationParams as P, type IntegrationValidationStatus as Q, type RotateSecretResponse as R, type ServiceAccountResponse as S, type TokenExchangeRequest as T, type UpdateApplicationInput as U, type ValidateIntegrationResponse as V, type ListEventsResponse as W, type McpEvent as X, type OAuthTokens as Y, type ServiceAccount as Z, TOKEN_EXCHANGE_GRANT_TYPE as _, type TokenExchangeResponse as a, TOKEN_TYPE_USER_ID as a0, type TestConnectionResponse as a1, type TestConnectionStatus as a2, type Trace as a3, type TraceEvent as a4, type TraceStats as a5, type CreateServiceAccountResponse as b, type CreateApplicationInput as c, type CreateApplicationResponse as d, type ListApplicationsResponse as e, type ApplicationOAuthResponse as f, type UpdateApplicationOAuthInput as g, type RotateApplicationSecretResponse as h, type ApplicationIntegrationsResponse as i, type UpdateApplicationIntegrationsInput as j, type RevokeAllSessionsResponse as k, type CreateIntegrationInput as l, type CreateIntegrationResponse as m, type ListIntegrationsResponse as n, type UpdateIntegrationInput as o, type ListAgentSessionsResponse as p, type AgentSessionResponse as q, type ListTracesResponse as r, type TraceResponse as s, type TraceStatsResponse as t, type AddUserTokenInput as u, type AgentSession as v, type AgentSessionDerivedStatus as w, type AgentSessionStatus as x, type Application as y, type ApplicationOAuth as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontext-dev/js-sdk",
3
- "version": "0.3.0",
3
+ "version": "1.1.0",
4
4
  "description": "Secure credentials for AI agents.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",