@inconvoai/node 0.7.1 → 0.7.7

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 (95) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/client.d.mts +1 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js +8 -7
  7. package/client.js.map +1 -1
  8. package/client.mjs +8 -7
  9. package/client.mjs.map +1 -1
  10. package/internal/tslib.js +17 -17
  11. package/internal/utils/query.d.mts +2 -0
  12. package/internal/utils/query.d.mts.map +1 -0
  13. package/internal/utils/query.d.ts +2 -0
  14. package/internal/utils/query.d.ts.map +1 -0
  15. package/internal/utils/query.js +10 -0
  16. package/internal/utils/query.js.map +1 -0
  17. package/internal/utils/query.mjs +6 -0
  18. package/internal/utils/query.mjs.map +1 -0
  19. package/internal/utils.d.mts +1 -0
  20. package/internal/utils.d.ts +1 -0
  21. package/internal/utils.js +1 -0
  22. package/internal/utils.js.map +1 -1
  23. package/internal/utils.mjs +1 -0
  24. package/package.json +12 -1
  25. package/resources/agents/conversations/conversations.d.mts +3 -0
  26. package/resources/agents/conversations/conversations.d.mts.map +1 -1
  27. package/resources/agents/conversations/conversations.d.ts +3 -0
  28. package/resources/agents/conversations/conversations.d.ts.map +1 -1
  29. package/resources/agents/conversations/conversations.js +3 -0
  30. package/resources/agents/conversations/conversations.js.map +1 -1
  31. package/resources/agents/conversations/conversations.mjs +3 -0
  32. package/resources/agents/conversations/conversations.mjs.map +1 -1
  33. package/resources/agents/conversations/response/feedback.d.mts +3 -0
  34. package/resources/agents/conversations/response/feedback.d.mts.map +1 -1
  35. package/resources/agents/conversations/response/feedback.d.ts +3 -0
  36. package/resources/agents/conversations/response/feedback.d.ts.map +1 -1
  37. package/resources/agents/conversations/response/feedback.js +3 -0
  38. package/resources/agents/conversations/response/feedback.js.map +1 -1
  39. package/resources/agents/conversations/response/feedback.mjs +3 -0
  40. package/resources/agents/conversations/response/feedback.mjs.map +1 -1
  41. package/resources/agents/conversations/response/response.d.mts +3 -0
  42. package/resources/agents/conversations/response/response.d.mts.map +1 -1
  43. package/resources/agents/conversations/response/response.d.ts +3 -0
  44. package/resources/agents/conversations/response/response.d.ts.map +1 -1
  45. package/resources/agents/conversations/response/response.js +3 -0
  46. package/resources/agents/conversations/response/response.js.map +1 -1
  47. package/resources/agents/conversations/response/response.mjs +3 -0
  48. package/resources/agents/conversations/response/response.mjs.map +1 -1
  49. package/resources/agents/data-summary.d.mts +3 -0
  50. package/resources/agents/data-summary.d.mts.map +1 -1
  51. package/resources/agents/data-summary.d.ts +3 -0
  52. package/resources/agents/data-summary.d.ts.map +1 -1
  53. package/resources/agents/data-summary.js +3 -0
  54. package/resources/agents/data-summary.js.map +1 -1
  55. package/resources/agents/data-summary.mjs +3 -0
  56. package/resources/agents/data-summary.mjs.map +1 -1
  57. package/resources/agents/datasets/context.d.mts +11 -0
  58. package/resources/agents/datasets/context.d.mts.map +1 -1
  59. package/resources/agents/datasets/context.d.ts +11 -0
  60. package/resources/agents/datasets/context.d.ts.map +1 -1
  61. package/resources/agents/datasets/context.js +11 -0
  62. package/resources/agents/datasets/context.js.map +1 -1
  63. package/resources/agents/datasets/context.mjs +11 -0
  64. package/resources/agents/datasets/context.mjs.map +1 -1
  65. package/resources/agents/datasets/user.d.mts +11 -0
  66. package/resources/agents/datasets/user.d.mts.map +1 -1
  67. package/resources/agents/datasets/user.d.ts +11 -0
  68. package/resources/agents/datasets/user.d.ts.map +1 -1
  69. package/resources/agents/datasets/user.js +11 -0
  70. package/resources/agents/datasets/user.js.map +1 -1
  71. package/resources/agents/datasets/user.mjs +11 -0
  72. package/resources/agents/datasets/user.mjs.map +1 -1
  73. package/resources/agents/mcp-servers/tenants.d.mts +3 -0
  74. package/resources/agents/mcp-servers/tenants.d.mts.map +1 -1
  75. package/resources/agents/mcp-servers/tenants.d.ts +3 -0
  76. package/resources/agents/mcp-servers/tenants.d.ts.map +1 -1
  77. package/resources/agents/mcp-servers/tenants.js +3 -0
  78. package/resources/agents/mcp-servers/tenants.js.map +1 -1
  79. package/resources/agents/mcp-servers/tenants.mjs +3 -0
  80. package/resources/agents/mcp-servers/tenants.mjs.map +1 -1
  81. package/src/client.ts +11 -10
  82. package/src/internal/utils/query.ts +7 -0
  83. package/src/internal/utils.ts +1 -0
  84. package/src/resources/agents/conversations/conversations.ts +3 -0
  85. package/src/resources/agents/conversations/response/feedback.ts +3 -0
  86. package/src/resources/agents/conversations/response/response.ts +3 -0
  87. package/src/resources/agents/data-summary.ts +3 -0
  88. package/src/resources/agents/datasets/context.ts +11 -0
  89. package/src/resources/agents/datasets/user.ts +11 -0
  90. package/src/resources/agents/mcp-servers/tenants.ts +3 -0
  91. package/src/version.ts +1 -1
  92. package/version.d.mts +1 -1
  93. package/version.d.ts +1 -1
  94. package/version.js +1 -1
  95. package/version.mjs +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tenants.mjs","sourceRoot":"","sources":["../../../src/resources/agents/mcp-servers/tenants.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CACJ,WAAmB,EACnB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,WAAW,OAAO,eAAe,WAAW,UAAU,EAAE;YACnF,IAAI,EAAE,MAAM;YACZ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,WAAmB,EACnB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CACxB,IAAI,CAAA,WAAW,OAAO,eAAe,WAAW,YAAY,UAAU,EAAE,EACxE,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"tenants.mjs","sourceRoot":"","sources":["../../../src/resources/agents/mcp-servers/tenants.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CACJ,WAAmB,EACnB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,WAAW,OAAO,eAAe,WAAW,UAAU,EAAE;YACnF,IAAI,EAAE,MAAM;YACZ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,WAAmB,EACnB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CACxB,IAAI,CAAA,WAAW,OAAO,eAAe,WAAW,YAAY,UAAU,EAAE,EACxE,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
package/src/client.ts CHANGED
@@ -11,7 +11,7 @@ import type { APIResponseProps } from './internal/parse';
11
11
  import { getPlatformHeaders } from './internal/detect-platform';
12
12
  import * as Shims from './internal/shims';
13
13
  import * as Opts from './internal/request-options';
14
- import * as qs from './internal/qs';
14
+ import { stringifyQuery } from './internal/utils/query';
15
15
  import { VERSION } from './version';
16
16
  import * as Errors from './core/error';
17
17
  import * as Pagination from './core/pagination';
@@ -213,8 +213,8 @@ export class Inconvo {
213
213
  return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
214
214
  }
215
215
 
216
- protected stringifyQuery(query: Record<string, unknown>): string {
217
- return qs.stringify(query, { arrayFormat: 'comma' });
216
+ protected stringifyQuery(query: object | Record<string, unknown>): string {
217
+ return stringifyQuery(query);
218
218
  }
219
219
 
220
220
  private getUserAgent(): string {
@@ -246,12 +246,13 @@ export class Inconvo {
246
246
  : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
247
247
 
248
248
  const defaultQuery = this.defaultQuery();
249
- if (!isEmptyObj(defaultQuery)) {
250
- query = { ...defaultQuery, ...query };
249
+ const pathQuery = Object.fromEntries(url.searchParams);
250
+ if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
251
+ query = { ...pathQuery, ...defaultQuery, ...query };
251
252
  }
252
253
 
253
254
  if (typeof query === 'object' && query && !Array.isArray(query)) {
254
- url.search = this.stringifyQuery(query as Record<string, unknown>);
255
+ url.search = this.stringifyQuery(query);
255
256
  }
256
257
 
257
258
  return url.toString();
@@ -580,9 +581,9 @@ export class Inconvo {
580
581
  }
581
582
  }
582
583
 
583
- // If the API asks us to wait a certain amount of time (and it's a reasonable amount),
584
- // just do what it says, but otherwise calculate a default
585
- if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
584
+ // If the API asks us to wait a certain amount of time, just do what it
585
+ // says, but otherwise calculate a default
586
+ if (timeoutMillis === undefined) {
586
587
  const maxRetries = options.maxRetries ?? this.maxRetries;
587
588
  timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
588
589
  }
@@ -714,7 +715,7 @@ export class Inconvo {
714
715
  ) {
715
716
  return {
716
717
  bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
717
- body: this.stringifyQuery(body as Record<string, unknown>),
718
+ body: this.stringifyQuery(body),
718
719
  };
719
720
  } else {
720
721
  return this.#encoder({ body, headers });
@@ -0,0 +1,7 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import * as qs from '../qs/stringify';
4
+
5
+ export function stringifyQuery(query: object | Record<string, unknown>) {
6
+ return qs.stringify(query, { arrayFormat: 'comma' });
7
+ }
@@ -6,3 +6,4 @@ export * from './utils/env';
6
6
  export * from './utils/log';
7
7
  export * from './utils/uuid';
8
8
  export * from './utils/sleep';
9
+ export * from './utils/query';
@@ -16,6 +16,9 @@ import { ConversationsCursor, type ConversationsCursorParams, PagePromise } from
16
16
  import { RequestOptions } from '../../../internal/request-options';
17
17
  import { path } from '../../../internal/utils/path';
18
18
 
19
+ /**
20
+ * Create, list and retrieve conversation threads
21
+ */
19
22
  export class Conversations extends APIResource {
20
23
  response: ResponseAPI.Response = new ResponseAPI.Response(this._client);
21
24
 
@@ -5,6 +5,9 @@ import { APIPromise } from '../../../../core/api-promise';
5
5
  import { RequestOptions } from '../../../../internal/request-options';
6
6
  import { path } from '../../../../internal/utils/path';
7
7
 
8
+ /**
9
+ * Attach or edit quality feedback on individual responses
10
+ */
8
11
  export class FeedbackResource extends APIResource {
9
12
  /**
10
13
  * Create feedback
@@ -9,6 +9,9 @@ import { RequestOptions } from '../../../../internal/request-options';
9
9
  import { path } from '../../../../internal/utils/path';
10
10
  import { SSEStream, createSSEStream } from '../../../../core/sse-stream';
11
11
 
12
+ /**
13
+ * Send a user message and receive Inconvo's structured reply (synchronous or SSE stream)
14
+ */
12
15
  export class Response extends APIResource {
13
16
  feedback: FeedbackAPI.FeedbackResource = new FeedbackAPI.FeedbackResource(this._client);
14
17
 
@@ -5,6 +5,9 @@ import { APIPromise } from '../../core/api-promise';
5
5
  import { RequestOptions } from '../../internal/request-options';
6
6
  import { path } from '../../internal/utils/path';
7
7
 
8
+ /**
9
+ * Retrieve information about agents and their data access
10
+ */
8
11
  export class DataSummary extends APIResource {
9
12
  /**
10
13
  * Retrieve a summary of data available to the agent
@@ -7,6 +7,17 @@ import { RequestOptions } from '../../../internal/request-options';
7
7
  import { multipartFormRequestOptions } from '../../../internal/uploads';
8
8
  import { path } from '../../../internal/utils/path';
9
9
 
10
+ /**
11
+ * Manage dataset files with scoped access.
12
+ *
13
+ * Datasets can be scoped in two ways:
14
+ * - **User-scoped** (`/datasets/user/{userIdentifier}`): Files accessible only to a specific user
15
+ * - **Context-scoped** (`/datasets/context/{contextKey}/{contextValue}`): Files shared with all users matching a context value
16
+ *
17
+ * File storage paths:
18
+ * - User-scoped: `/{orgId}/{agentId}/userIdentifier/{userIdentifier}/filename.csv`
19
+ * - Context-scoped: `/{orgId}/{agentId}/userContext/{contextKey}:{contextValue}/filename.csv`
20
+ */
10
21
  export class Context extends APIResource {
11
22
  /**
12
23
  * List all dataset files scoped to a context value. These files are shared with
@@ -7,6 +7,17 @@ import { RequestOptions } from '../../../internal/request-options';
7
7
  import { multipartFormRequestOptions } from '../../../internal/uploads';
8
8
  import { path } from '../../../internal/utils/path';
9
9
 
10
+ /**
11
+ * Manage dataset files with scoped access.
12
+ *
13
+ * Datasets can be scoped in two ways:
14
+ * - **User-scoped** (`/datasets/user/{userIdentifier}`): Files accessible only to a specific user
15
+ * - **Context-scoped** (`/datasets/context/{contextKey}/{contextValue}`): Files shared with all users matching a context value
16
+ *
17
+ * File storage paths:
18
+ * - User-scoped: `/{orgId}/{agentId}/userIdentifier/{userIdentifier}/filename.csv`
19
+ * - Context-scoped: `/{orgId}/{agentId}/userContext/{contextKey}:{contextValue}/filename.csv`
20
+ */
10
21
  export class User extends APIResource {
11
22
  /**
12
23
  * List all dataset files scoped to a specific user.
@@ -5,6 +5,9 @@ import { APIPromise } from '../../../core/api-promise';
5
5
  import { RequestOptions } from '../../../internal/request-options';
6
6
  import { path } from '../../../internal/utils/path';
7
7
 
8
+ /**
9
+ * Manage MCP servers and their tenant mappings
10
+ */
8
11
  export class Tenants extends APIResource {
9
12
  /**
10
13
  * Create a tenant for an MCP Server
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.7.1'; // x-release-please-version
1
+ export const VERSION = '0.7.7'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.7.1";
1
+ export declare const VERSION = "0.7.7";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.7.1";
1
+ export declare const VERSION = "0.7.7";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.7.1'; // x-release-please-version
4
+ exports.VERSION = '0.7.7'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.7.1'; // x-release-please-version
1
+ export const VERSION = '0.7.7'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map