@truefoundry/trueforge-sdk 0.2.0-rc.3 → 0.2.0-rc.5

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 (130) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/agents/client/Client.d.ts +6 -4
  3. package/dist/cjs/api/resources/agents/client/Client.js +76 -45
  4. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +2 -0
  5. package/dist/cjs/api/resources/agents/client/requests/ListAgentsRequest.d.ts +12 -0
  6. package/dist/cjs/api/{types/McpServerType.js → resources/agents/client/requests/ListAgentsRequest.js} +0 -5
  7. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +1 -0
  8. package/dist/cjs/api/resources/agents/client/requests/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/internal/client/Client.d.ts +3 -0
  10. package/dist/cjs/api/resources/internal/client/Client.js +7 -2
  11. package/dist/cjs/api/resources/internal/resources/index.d.ts +2 -0
  12. package/dist/cjs/api/resources/internal/resources/index.js +3 -1
  13. package/dist/cjs/api/resources/internal/resources/schedules/client/Client.d.ts +32 -0
  14. package/dist/cjs/api/resources/internal/resources/schedules/client/Client.js +144 -0
  15. package/dist/cjs/api/resources/internal/resources/schedules/client/index.d.ts +1 -0
  16. package/dist/cjs/api/resources/internal/resources/schedules/client/index.js +17 -0
  17. package/dist/cjs/api/resources/internal/resources/schedules/client/requests/ExecuteScheduleRunRequest.d.ts +10 -0
  18. package/dist/cjs/api/resources/internal/resources/schedules/client/requests/ExecuteScheduleRunRequest.js +3 -0
  19. package/dist/cjs/api/resources/internal/resources/schedules/client/requests/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/internal/resources/schedules/client/requests/index.js +2 -0
  21. package/dist/cjs/api/resources/internal/resources/schedules/exports.d.ts +2 -0
  22. package/dist/cjs/api/resources/internal/resources/schedules/exports.js +21 -0
  23. package/dist/cjs/api/resources/internal/resources/schedules/index.d.ts +1 -0
  24. package/dist/cjs/api/resources/internal/resources/schedules/index.js +17 -0
  25. package/dist/cjs/api/types/Agent.d.ts +1 -0
  26. package/dist/cjs/api/types/ListAgentsResponse.d.ts +1 -0
  27. package/dist/cjs/api/types/McpServerManifest.d.ts +1 -9
  28. package/dist/cjs/api/types/RemoteMcpServerManifest.d.ts +10 -0
  29. package/dist/cjs/api/types/RemoteMcpServerManifest.js +3 -0
  30. package/dist/cjs/api/types/TrueFoundryMcpServerManifest.d.ts +10 -0
  31. package/dist/cjs/api/types/TrueFoundryMcpServerManifest.js +3 -0
  32. package/dist/cjs/api/types/index.d.ts +2 -1
  33. package/dist/cjs/api/types/index.js +2 -1
  34. package/dist/cjs/serialization/resources/agents/client/requests/CreateAgentRequest.d.ts +1 -0
  35. package/dist/cjs/serialization/resources/agents/client/requests/CreateAgentRequest.js +1 -0
  36. package/dist/cjs/serialization/resources/agents/client/requests/UpdateAgentRequest.d.ts +1 -0
  37. package/dist/cjs/serialization/resources/agents/client/requests/UpdateAgentRequest.js +1 -0
  38. package/dist/cjs/serialization/resources/internal/resources/index.d.ts +2 -0
  39. package/dist/cjs/serialization/resources/internal/resources/index.js +3 -1
  40. package/dist/cjs/serialization/resources/internal/resources/schedules/client/index.d.ts +1 -0
  41. package/dist/cjs/serialization/resources/internal/resources/schedules/client/index.js +17 -0
  42. package/dist/cjs/serialization/resources/internal/resources/schedules/client/requests/ExecuteScheduleRunRequest.d.ts +9 -0
  43. package/dist/cjs/serialization/{types/McpServerType.js → resources/internal/resources/schedules/client/requests/ExecuteScheduleRunRequest.js} +5 -3
  44. package/dist/cjs/serialization/resources/internal/resources/schedules/client/requests/index.d.ts +1 -0
  45. package/dist/cjs/serialization/resources/internal/resources/schedules/client/requests/index.js +5 -0
  46. package/dist/cjs/serialization/resources/internal/resources/schedules/index.d.ts +1 -0
  47. package/dist/cjs/serialization/resources/internal/resources/schedules/index.js +17 -0
  48. package/dist/cjs/serialization/types/Agent.d.ts +1 -0
  49. package/dist/cjs/serialization/types/Agent.js +1 -0
  50. package/dist/cjs/serialization/types/ListAgentsResponse.d.ts +2 -0
  51. package/dist/cjs/serialization/types/ListAgentsResponse.js +2 -0
  52. package/dist/cjs/serialization/types/McpServerManifest.d.ts +4 -11
  53. package/dist/cjs/serialization/types/McpServerManifest.js +3 -10
  54. package/dist/cjs/serialization/types/RemoteMcpServerManifest.d.ts +15 -0
  55. package/dist/cjs/serialization/types/RemoteMcpServerManifest.js +47 -0
  56. package/dist/cjs/serialization/types/TrueFoundryMcpServerManifest.d.ts +15 -0
  57. package/dist/cjs/serialization/types/TrueFoundryMcpServerManifest.js +47 -0
  58. package/dist/cjs/serialization/types/index.d.ts +2 -1
  59. package/dist/cjs/serialization/types/index.js +2 -1
  60. package/dist/cjs/version.d.ts +1 -1
  61. package/dist/cjs/version.js +1 -1
  62. package/dist/esm/BaseClient.mjs +2 -2
  63. package/dist/esm/api/resources/agents/client/Client.d.mts +6 -4
  64. package/dist/esm/api/resources/agents/client/Client.mjs +76 -45
  65. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +2 -0
  66. package/dist/esm/api/resources/agents/client/requests/ListAgentsRequest.d.mts +12 -0
  67. package/dist/esm/api/resources/agents/client/requests/ListAgentsRequest.mjs +2 -0
  68. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +1 -0
  69. package/dist/esm/api/resources/agents/client/requests/index.d.mts +1 -0
  70. package/dist/esm/api/resources/internal/client/Client.d.mts +3 -0
  71. package/dist/esm/api/resources/internal/client/Client.mjs +5 -0
  72. package/dist/esm/api/resources/internal/resources/index.d.mts +2 -0
  73. package/dist/esm/api/resources/internal/resources/index.mjs +2 -0
  74. package/dist/esm/api/resources/internal/resources/schedules/client/Client.d.mts +32 -0
  75. package/dist/esm/api/resources/internal/resources/schedules/client/Client.mjs +107 -0
  76. package/dist/esm/api/resources/internal/resources/schedules/client/index.d.mts +1 -0
  77. package/dist/esm/api/resources/internal/resources/schedules/client/index.mjs +1 -0
  78. package/dist/esm/api/resources/internal/resources/schedules/client/requests/ExecuteScheduleRunRequest.d.mts +10 -0
  79. package/dist/esm/api/resources/internal/resources/schedules/client/requests/ExecuteScheduleRunRequest.mjs +2 -0
  80. package/dist/esm/api/resources/internal/resources/schedules/client/requests/index.d.mts +1 -0
  81. package/dist/esm/api/resources/internal/resources/schedules/client/requests/index.mjs +1 -0
  82. package/dist/esm/api/resources/internal/resources/schedules/exports.d.mts +2 -0
  83. package/dist/esm/api/resources/internal/resources/schedules/exports.mjs +3 -0
  84. package/dist/esm/api/resources/internal/resources/schedules/index.d.mts +1 -0
  85. package/dist/esm/api/resources/internal/resources/schedules/index.mjs +1 -0
  86. package/dist/esm/api/types/Agent.d.mts +1 -0
  87. package/dist/esm/api/types/ListAgentsResponse.d.mts +1 -0
  88. package/dist/esm/api/types/McpServerManifest.d.mts +1 -9
  89. package/dist/esm/api/types/RemoteMcpServerManifest.d.mts +10 -0
  90. package/dist/esm/api/types/RemoteMcpServerManifest.mjs +2 -0
  91. package/dist/esm/api/types/TrueFoundryMcpServerManifest.d.mts +10 -0
  92. package/dist/esm/api/types/TrueFoundryMcpServerManifest.mjs +2 -0
  93. package/dist/esm/api/types/index.d.mts +2 -1
  94. package/dist/esm/api/types/index.mjs +2 -1
  95. package/dist/esm/serialization/resources/agents/client/requests/CreateAgentRequest.d.mts +1 -0
  96. package/dist/esm/serialization/resources/agents/client/requests/CreateAgentRequest.mjs +1 -0
  97. package/dist/esm/serialization/resources/agents/client/requests/UpdateAgentRequest.d.mts +1 -0
  98. package/dist/esm/serialization/resources/agents/client/requests/UpdateAgentRequest.mjs +1 -0
  99. package/dist/esm/serialization/resources/internal/resources/index.d.mts +2 -0
  100. package/dist/esm/serialization/resources/internal/resources/index.mjs +2 -0
  101. package/dist/esm/serialization/resources/internal/resources/schedules/client/index.d.mts +1 -0
  102. package/dist/esm/serialization/resources/internal/resources/schedules/client/index.mjs +1 -0
  103. package/dist/esm/serialization/resources/internal/resources/schedules/client/requests/ExecuteScheduleRunRequest.d.mts +9 -0
  104. package/dist/esm/serialization/resources/internal/resources/schedules/client/requests/ExecuteScheduleRunRequest.mjs +5 -0
  105. package/dist/esm/serialization/resources/internal/resources/schedules/client/requests/index.d.mts +1 -0
  106. package/dist/esm/serialization/resources/internal/resources/schedules/client/requests/index.mjs +1 -0
  107. package/dist/esm/serialization/resources/internal/resources/schedules/index.d.mts +1 -0
  108. package/dist/esm/serialization/resources/internal/resources/schedules/index.mjs +1 -0
  109. package/dist/esm/serialization/types/Agent.d.mts +1 -0
  110. package/dist/esm/serialization/types/Agent.mjs +1 -0
  111. package/dist/esm/serialization/types/ListAgentsResponse.d.mts +2 -0
  112. package/dist/esm/serialization/types/ListAgentsResponse.mjs +2 -0
  113. package/dist/esm/serialization/types/McpServerManifest.d.mts +4 -11
  114. package/dist/esm/serialization/types/McpServerManifest.mjs +3 -10
  115. package/dist/esm/serialization/types/RemoteMcpServerManifest.d.mts +15 -0
  116. package/dist/esm/serialization/types/RemoteMcpServerManifest.mjs +11 -0
  117. package/dist/esm/serialization/types/TrueFoundryMcpServerManifest.d.mts +15 -0
  118. package/dist/esm/serialization/types/TrueFoundryMcpServerManifest.mjs +11 -0
  119. package/dist/esm/serialization/types/index.d.mts +2 -1
  120. package/dist/esm/serialization/types/index.mjs +2 -1
  121. package/dist/esm/version.d.mts +1 -1
  122. package/dist/esm/version.mjs +1 -1
  123. package/package.json +12 -1
  124. package/reference.md +78 -3
  125. package/dist/cjs/api/types/McpServerType.d.ts +0 -5
  126. package/dist/cjs/serialization/types/McpServerType.d.ts +0 -7
  127. package/dist/esm/api/types/McpServerType.d.mts +0 -5
  128. package/dist/esm/api/types/McpServerType.mjs +0 -5
  129. package/dist/esm/serialization/types/McpServerType.d.mts +0 -7
  130. package/dist/esm/serialization/types/McpServerType.mjs +0 -3
@@ -21,10 +21,12 @@ export class AgentsClient {
21
21
  this._options = normalizeClientOptionsWithAuth(options);
22
22
  }
23
23
  /**
24
- * All configured agents for the tenant.
24
+ * List configured agents for the tenant, ordered by name. Optional `agent_name` filters by substring.
25
25
  *
26
+ * @param {TrueForge.ListAgentsRequest} request
26
27
  * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
27
28
  *
29
+ * @throws {@link TrueForge.BadRequestError}
28
30
  * @throws {@link TrueForge.UnauthorizedError}
29
31
  * @throws {@link errors.TrueForgeError}
30
32
  * @throws {@link errors.TrueForgeTimeoutError}
@@ -32,56 +34,84 @@ export class AgentsClient {
32
34
  * @example
33
35
  * await client.agents.list()
34
36
  */
35
- list(requestOptions) {
36
- return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
37
- }
38
- __list(requestOptions) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
41
- const _authRequest = yield this._options.authProvider.getAuthRequest();
42
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
43
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
44
- url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment)), "api/v1/agents"),
45
- method: "GET",
46
- headers: _headers,
47
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
48
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
49
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
50
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
51
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
52
- logging: this._options.logging,
53
- });
54
- if (_response.ok) {
55
- return {
56
- data: serializers.ListAgentsResponse.parseOrThrow(_response.body, {
57
- unrecognizedObjectKeys: "passthrough",
58
- allowUnrecognizedUnionMembers: true,
59
- allowUnrecognizedEnumValues: true,
60
- skipValidation: true,
61
- breadcrumbsPrefix: ["response"],
62
- }),
63
- rawResponse: _response.rawResponse,
37
+ list() {
38
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
39
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
40
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
41
+ const { limit = 50, pageToken, agentName } = request;
42
+ const _queryParams = {
43
+ limit,
44
+ page_token: pageToken,
45
+ agent_name: agentName,
64
46
  };
65
- }
66
- if (_response.error.reason === "status-code") {
67
- switch (_response.error.statusCode) {
68
- case 401:
69
- throw new TrueForge.UnauthorizedError(serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
47
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
48
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
49
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
50
+ url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment)), "api/v1/agents"),
51
+ method: "GET",
52
+ headers: _headers,
53
+ queryString: core.url
54
+ .queryBuilder()
55
+ .addMany(_queryParams)
56
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
57
+ .build(),
58
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
59
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
60
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
61
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
62
+ logging: this._options.logging,
63
+ });
64
+ if (_response.ok) {
65
+ return {
66
+ data: serializers.ListAgentsResponse.parseOrThrow(_response.body, {
70
67
  unrecognizedObjectKeys: "passthrough",
71
68
  allowUnrecognizedUnionMembers: true,
72
69
  allowUnrecognizedEnumValues: true,
73
70
  skipValidation: true,
74
71
  breadcrumbsPrefix: ["response"],
75
- }), _response.rawResponse);
76
- default:
77
- throw new errors.TrueForgeError({
78
- statusCode: _response.error.statusCode,
79
- body: _response.error.body,
80
- rawResponse: _response.rawResponse,
81
- });
72
+ }),
73
+ rawResponse: _response.rawResponse,
74
+ };
82
75
  }
83
- }
84
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/v1/agents");
76
+ if (_response.error.reason === "status-code") {
77
+ switch (_response.error.statusCode) {
78
+ case 400:
79
+ throw new TrueForge.BadRequestError(serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
80
+ unrecognizedObjectKeys: "passthrough",
81
+ allowUnrecognizedUnionMembers: true,
82
+ allowUnrecognizedEnumValues: true,
83
+ skipValidation: true,
84
+ breadcrumbsPrefix: ["response"],
85
+ }), _response.rawResponse);
86
+ case 401:
87
+ throw new TrueForge.UnauthorizedError(serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
88
+ unrecognizedObjectKeys: "passthrough",
89
+ allowUnrecognizedUnionMembers: true,
90
+ allowUnrecognizedEnumValues: true,
91
+ skipValidation: true,
92
+ breadcrumbsPrefix: ["response"],
93
+ }), _response.rawResponse);
94
+ default:
95
+ throw new errors.TrueForgeError({
96
+ statusCode: _response.error.statusCode,
97
+ body: _response.error.body,
98
+ rawResponse: _response.rawResponse,
99
+ });
100
+ }
101
+ }
102
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/v1/agents");
103
+ }));
104
+ const dataWithRawResponse = yield list(request).withRawResponse();
105
+ return new core.Page({
106
+ response: dataWithRawResponse.data,
107
+ rawResponse: dataWithRawResponse.rawResponse,
108
+ hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.pagination.nextPageToken) != null &&
109
+ !(typeof (response === null || response === void 0 ? void 0 : response.pagination.nextPageToken) === "string" && (response === null || response === void 0 ? void 0 : response.pagination.nextPageToken) === ""),
110
+ getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.data) !== null && _a !== void 0 ? _a : []; },
111
+ loadPage: (response) => {
112
+ return list(core.setObjectProperty(request, "pageToken", response === null || response === void 0 ? void 0 : response.pagination.nextPageToken));
113
+ },
114
+ });
85
115
  });
86
116
  }
87
117
  /**
@@ -98,6 +128,7 @@ export class AgentsClient {
98
128
  *
99
129
  * @example
100
130
  * await client.agents.create({
131
+ * description: "description",
101
132
  * manifest: {
102
133
  * model: {
103
134
  * name: "name"
@@ -248,7 +279,7 @@ export class AgentsClient {
248
279
  });
249
280
  }
250
281
  /**
251
- * Replaces the manifest for an existing agent keyed by immutable `agent_id`.
282
+ * Update an existing agent by immutable id.
252
283
  *
253
284
  * @param {string} agent_id - Immutable agent identifier.
254
285
  * @param {TrueForge.UpdateAgentRequest} request
@@ -2,6 +2,7 @@ import type * as TrueForge from "../../../../index.mjs";
2
2
  /**
3
3
  * @example
4
4
  * {
5
+ * description: "description",
5
6
  * manifest: {
6
7
  * model: {
7
8
  * name: "name"
@@ -11,6 +12,7 @@ import type * as TrueForge from "../../../../index.mjs";
11
12
  * }
12
13
  */
13
14
  export interface CreateAgentRequest {
15
+ description: string;
14
16
  manifest: TrueForge.AgentSpec;
15
17
  name: TrueForge.ResourceName;
16
18
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface ListAgentsRequest {
6
+ /** Page size. Defaults to 50, max 100. */
7
+ limit?: number;
8
+ /** Opaque token from a previous response `next_page_token`. */
9
+ pageToken?: string;
10
+ /** Case-insensitive substring match on agent name. */
11
+ agentName?: string;
12
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -10,5 +10,6 @@ import type * as TrueForge from "../../../../index.mjs";
10
10
  * }
11
11
  */
12
12
  export interface UpdateAgentRequest {
13
+ description?: string;
13
14
  manifest: TrueForge.AgentSpec;
14
15
  }
@@ -1,2 +1,3 @@
1
1
  export type { CreateAgentRequest } from "./CreateAgentRequest.mjs";
2
+ export type { ListAgentsRequest } from "./ListAgentsRequest.mjs";
2
3
  export type { UpdateAgentRequest } from "./UpdateAgentRequest.mjs";
@@ -4,6 +4,7 @@ import * as core from "../../../../core/index.mjs";
4
4
  import * as TrueForge from "../../../index.mjs";
5
5
  import { AgentsClient } from "../resources/agents/client/Client.mjs";
6
6
  import { MetricsClient } from "../resources/metrics/client/Client.mjs";
7
+ import { SchedulesClient } from "../resources/schedules/client/Client.mjs";
7
8
  import { SessionsClient } from "../resources/sessions/client/Client.mjs";
8
9
  export declare namespace InternalClient {
9
10
  type Options = BaseClientOptions;
@@ -13,10 +14,12 @@ export declare namespace InternalClient {
13
14
  export declare class InternalClient {
14
15
  protected readonly _options: NormalizedClientOptionsWithAuth<InternalClient.Options>;
15
16
  protected _metrics: MetricsClient | undefined;
17
+ protected _schedules: SchedulesClient | undefined;
16
18
  protected _sessions: SessionsClient | undefined;
17
19
  protected _agents: AgentsClient | undefined;
18
20
  constructor(options: InternalClient.Options);
19
21
  get metrics(): MetricsClient;
22
+ get schedules(): SchedulesClient;
20
23
  get sessions(): SessionsClient;
21
24
  get agents(): AgentsClient;
22
25
  /**
@@ -18,6 +18,7 @@ import * as serializers from "../../../../serialization/index.mjs";
18
18
  import * as TrueForge from "../../../index.mjs";
19
19
  import { AgentsClient } from "../resources/agents/client/Client.mjs";
20
20
  import { MetricsClient } from "../resources/metrics/client/Client.mjs";
21
+ import { SchedulesClient } from "../resources/schedules/client/Client.mjs";
21
22
  import { SessionsClient } from "../resources/sessions/client/Client.mjs";
22
23
  export class InternalClient {
23
24
  constructor(options) {
@@ -27,6 +28,10 @@ export class InternalClient {
27
28
  var _a;
28
29
  return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new MetricsClient(this._options)));
29
30
  }
31
+ get schedules() {
32
+ var _a;
33
+ return ((_a = this._schedules) !== null && _a !== void 0 ? _a : (this._schedules = new SchedulesClient(this._options)));
34
+ }
30
35
  get sessions() {
31
36
  var _a;
32
37
  return ((_a = this._sessions) !== null && _a !== void 0 ? _a : (this._sessions = new SessionsClient(this._options)));
@@ -2,5 +2,7 @@ export * from "./agents/client/requests/index.mjs";
2
2
  export * as agents from "./agents/index.mjs";
3
3
  export * from "./metrics/client/requests/index.mjs";
4
4
  export * as metrics from "./metrics/index.mjs";
5
+ export * from "./schedules/client/requests/index.mjs";
6
+ export * as schedules from "./schedules/index.mjs";
5
7
  export * from "./sessions/client/requests/index.mjs";
6
8
  export * as sessions from "./sessions/index.mjs";
@@ -2,5 +2,7 @@ export * from "./agents/client/requests/index.mjs";
2
2
  export * as agents from "./agents/index.mjs";
3
3
  export * from "./metrics/client/requests/index.mjs";
4
4
  export * as metrics from "./metrics/index.mjs";
5
+ export * from "./schedules/client/requests/index.mjs";
6
+ export * as schedules from "./schedules/index.mjs";
5
7
  export * from "./sessions/client/requests/index.mjs";
6
8
  export * as sessions from "./sessions/index.mjs";
@@ -0,0 +1,32 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
3
+ import * as core from "../../../../../../core/index.mjs";
4
+ import * as TrueForge from "../../../../../index.mjs";
5
+ export declare namespace SchedulesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class SchedulesClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<SchedulesClient.Options>;
12
+ constructor(options: SchedulesClient.Options);
13
+ /**
14
+ * Execute a persisted schedule run using its saved schedule and agent.
15
+ *
16
+ * @param {TrueForge.internal.ExecuteScheduleRunRequest} request
17
+ * @param {SchedulesClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link TrueForge.UnauthorizedError}
20
+ * @throws {@link TrueForge.NotFoundError}
21
+ * @throws {@link TrueForge.UnprocessableEntityError}
22
+ * @throws {@link errors.TrueForgeError}
23
+ * @throws {@link errors.TrueForgeTimeoutError}
24
+ *
25
+ * @example
26
+ * await client.internal.schedules.executeRun({
27
+ * scheduleRunId: "schedule_run_id"
28
+ * })
29
+ */
30
+ executeRun(request: TrueForge.internal.ExecuteScheduleRunRequest, requestOptions?: SchedulesClient.RequestOptions): core.HttpResponsePromise<void>;
31
+ private __executeRun;
32
+ }
@@ -0,0 +1,107 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../../../core/headers.mjs";
13
+ import * as core from "../../../../../../core/index.mjs";
14
+ import { mergeAdditionalBodyParameters } from "../../../../../../core/requestBody.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../../../errors/index.mjs";
17
+ import * as serializers from "../../../../../../serialization/index.mjs";
18
+ import * as TrueForge from "../../../../../index.mjs";
19
+ export class SchedulesClient {
20
+ constructor(options) {
21
+ this._options = normalizeClientOptionsWithAuth(options);
22
+ }
23
+ /**
24
+ * Execute a persisted schedule run using its saved schedule and agent.
25
+ *
26
+ * @param {TrueForge.internal.ExecuteScheduleRunRequest} request
27
+ * @param {SchedulesClient.RequestOptions} requestOptions - Request-specific configuration.
28
+ *
29
+ * @throws {@link TrueForge.UnauthorizedError}
30
+ * @throws {@link TrueForge.NotFoundError}
31
+ * @throws {@link TrueForge.UnprocessableEntityError}
32
+ * @throws {@link errors.TrueForgeError}
33
+ * @throws {@link errors.TrueForgeTimeoutError}
34
+ *
35
+ * @example
36
+ * await client.internal.schedules.executeRun({
37
+ * scheduleRunId: "schedule_run_id"
38
+ * })
39
+ */
40
+ executeRun(request, requestOptions) {
41
+ return core.HttpResponsePromise.fromPromise(this.__executeRun(request, requestOptions));
42
+ }
43
+ __executeRun(request, requestOptions) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
46
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
47
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
48
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
49
+ url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment)), "api/internal/schedules/runs/execute"),
50
+ method: "POST",
51
+ headers: _headers,
52
+ contentType: "application/json",
53
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
54
+ requestType: "json",
55
+ body: mergeAdditionalBodyParameters(serializers.internal.ExecuteScheduleRunRequest.jsonOrThrow(request, {
56
+ unrecognizedObjectKeys: "passthrough",
57
+ allowUnrecognizedUnionMembers: true,
58
+ allowUnrecognizedEnumValues: true,
59
+ omitUndefined: true,
60
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
61
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
62
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
63
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
64
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
65
+ logging: this._options.logging,
66
+ });
67
+ if (_response.ok) {
68
+ return { data: undefined, rawResponse: _response.rawResponse };
69
+ }
70
+ if (_response.error.reason === "status-code") {
71
+ switch (_response.error.statusCode) {
72
+ case 401:
73
+ throw new TrueForge.UnauthorizedError(serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
74
+ unrecognizedObjectKeys: "passthrough",
75
+ allowUnrecognizedUnionMembers: true,
76
+ allowUnrecognizedEnumValues: true,
77
+ skipValidation: true,
78
+ breadcrumbsPrefix: ["response"],
79
+ }), _response.rawResponse);
80
+ case 404:
81
+ throw new TrueForge.NotFoundError(serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
82
+ unrecognizedObjectKeys: "passthrough",
83
+ allowUnrecognizedUnionMembers: true,
84
+ allowUnrecognizedEnumValues: true,
85
+ skipValidation: true,
86
+ breadcrumbsPrefix: ["response"],
87
+ }), _response.rawResponse);
88
+ case 422:
89
+ throw new TrueForge.UnprocessableEntityError(serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
90
+ unrecognizedObjectKeys: "passthrough",
91
+ allowUnrecognizedUnionMembers: true,
92
+ allowUnrecognizedEnumValues: true,
93
+ skipValidation: true,
94
+ breadcrumbsPrefix: ["response"],
95
+ }), _response.rawResponse);
96
+ default:
97
+ throw new errors.TrueForgeError({
98
+ statusCode: _response.error.statusCode,
99
+ body: _response.error.body,
100
+ rawResponse: _response.rawResponse,
101
+ });
102
+ }
103
+ }
104
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/internal/schedules/runs/execute");
105
+ });
106
+ }
107
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * scheduleRunId: "schedule_run_id"
5
+ * }
6
+ */
7
+ export interface ExecuteScheduleRunRequest {
8
+ /** Immutable schedule run identifier. */
9
+ scheduleRunId: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type { ExecuteScheduleRunRequest } from "./ExecuteScheduleRunRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export { SchedulesClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { SchedulesClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -1,6 +1,7 @@
1
1
  import type * as TrueForge from "../index.mjs";
2
2
  export interface Agent {
3
3
  createdBySubject: TrueForge.CreatedBySubject;
4
+ description: string;
4
5
  /** Immutable server-generated agent identifier. */
5
6
  id: string;
6
7
  manifest: TrueForge.AgentSpec;
@@ -1,4 +1,5 @@
1
1
  import type * as TrueForge from "../index.mjs";
2
2
  export interface ListAgentsResponse {
3
3
  data: TrueForge.Agent[];
4
+ pagination: TrueForge.TokenPagination;
4
5
  }
@@ -1,10 +1,2 @@
1
1
  import type * as TrueForge from "../index.mjs";
2
- export interface McpServerManifest {
3
- auth?: TrueForge.McpServerManifestAuth;
4
- /** Concise summary of what this MCP server provides. */
5
- description: string;
6
- name: TrueForge.ResourceName;
7
- type: TrueForge.McpServerType;
8
- /** MCP endpoint URL. For `truefoundry`, the resolved AI Gateway proxy URL. */
9
- url: string;
10
- }
2
+ export type McpServerManifest = TrueForge.RemoteMcpServerManifest | TrueForge.TrueFoundryMcpServerManifest;
@@ -0,0 +1,10 @@
1
+ import type * as TrueForge from "../index.mjs";
2
+ export interface RemoteMcpServerManifest {
3
+ auth?: TrueForge.McpServerManifestAuth;
4
+ /** Concise summary of what this MCP server provides. */
5
+ description: string;
6
+ name: TrueForge.ResourceName;
7
+ type: "remote";
8
+ /** MCP endpoint URL. */
9
+ url: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ import type * as TrueForge from "../index.mjs";
2
+ export interface TrueFoundryMcpServerManifest {
3
+ auth?: TrueForge.McpServerManifestAuth;
4
+ /** Concise summary of what this MCP server provides. */
5
+ description: string;
6
+ name: TrueForge.ResourceName;
7
+ type: "truefoundry";
8
+ /** Resolved AI Gateway proxy URL for this TrueFoundry-managed MCP server. */
9
+ url: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -117,7 +117,6 @@ export * from "./McpServerInitInfoTransportType.mjs";
117
117
  export * from "./McpServerManifest.mjs";
118
118
  export * from "./McpServerManifestAuth.mjs";
119
119
  export * from "./McpServerToolSelector.mjs";
120
- export * from "./McpServerType.mjs";
121
120
  export * from "./McpToolInfo.mjs";
122
121
  export * from "./Me.mjs";
123
122
  export * from "./MeSessionType.mjs";
@@ -139,6 +138,7 @@ export * from "./PermissionResourceType.mjs";
139
138
  export * from "./PreviousTurnIdInput.mjs";
140
139
  export * from "./RawToolCall.mjs";
141
140
  export * from "./ReasoningEffort.mjs";
141
+ export * from "./RemoteMcpServerManifest.mjs";
142
142
  export * from "./RequestErrorResponse.mjs";
143
143
  export * from "./RequestErrorResponseError.mjs";
144
144
  export * from "./ResourceName.mjs";
@@ -202,6 +202,7 @@ export * from "./ToolCallRef.mjs";
202
202
  export * from "./ToolInfo.mjs";
203
203
  export * from "./ToolResponseEvent.mjs";
204
204
  export * from "./ToolResponseRequiredEvent.mjs";
205
+ export * from "./TrueFoundryMcpServerManifest.mjs";
205
206
  export * from "./TrueFoundryModelProvider.mjs";
206
207
  export * from "./TrueFoundryRegistrySkill.mjs";
207
208
  export * from "./TrueFoundrySystemToolInfo.mjs";
@@ -117,7 +117,6 @@ export * from "./McpServerInitInfoTransportType.mjs";
117
117
  export * from "./McpServerManifest.mjs";
118
118
  export * from "./McpServerManifestAuth.mjs";
119
119
  export * from "./McpServerToolSelector.mjs";
120
- export * from "./McpServerType.mjs";
121
120
  export * from "./McpToolInfo.mjs";
122
121
  export * from "./Me.mjs";
123
122
  export * from "./MeSessionType.mjs";
@@ -139,6 +138,7 @@ export * from "./PermissionResourceType.mjs";
139
138
  export * from "./PreviousTurnIdInput.mjs";
140
139
  export * from "./RawToolCall.mjs";
141
140
  export * from "./ReasoningEffort.mjs";
141
+ export * from "./RemoteMcpServerManifest.mjs";
142
142
  export * from "./RequestErrorResponse.mjs";
143
143
  export * from "./RequestErrorResponseError.mjs";
144
144
  export * from "./ResourceName.mjs";
@@ -202,6 +202,7 @@ export * from "./ToolCallRef.mjs";
202
202
  export * from "./ToolInfo.mjs";
203
203
  export * from "./ToolResponseEvent.mjs";
204
204
  export * from "./ToolResponseRequiredEvent.mjs";
205
+ export * from "./TrueFoundryMcpServerManifest.mjs";
205
206
  export * from "./TrueFoundryModelProvider.mjs";
206
207
  export * from "./TrueFoundryRegistrySkill.mjs";
207
208
  export * from "./TrueFoundrySystemToolInfo.mjs";
@@ -6,6 +6,7 @@ import { ResourceName } from "../../../../types/ResourceName.mjs";
6
6
  export declare const CreateAgentRequest: core.serialization.Schema<serializers.CreateAgentRequest.Raw, TrueForge.CreateAgentRequest>;
7
7
  export declare namespace CreateAgentRequest {
8
8
  interface Raw {
9
+ description: string;
9
10
  manifest: AgentSpec.Raw;
10
11
  name: ResourceName.Raw;
11
12
  }
@@ -3,6 +3,7 @@ import * as core from "../../../../../core/index.mjs";
3
3
  import { AgentSpec } from "../../../../types/AgentSpec.mjs";
4
4
  import { ResourceName } from "../../../../types/ResourceName.mjs";
5
5
  export const CreateAgentRequest = core.serialization.object({
6
+ description: core.serialization.string(),
6
7
  manifest: AgentSpec,
7
8
  name: ResourceName,
8
9
  });
@@ -5,6 +5,7 @@ import { AgentSpec } from "../../../../types/AgentSpec.mjs";
5
5
  export declare const UpdateAgentRequest: core.serialization.Schema<serializers.UpdateAgentRequest.Raw, TrueForge.UpdateAgentRequest>;
6
6
  export declare namespace UpdateAgentRequest {
7
7
  interface Raw {
8
+ description?: string | null;
8
9
  manifest: AgentSpec.Raw;
9
10
  }
10
11
  }
@@ -2,5 +2,6 @@
2
2
  import * as core from "../../../../../core/index.mjs";
3
3
  import { AgentSpec } from "../../../../types/AgentSpec.mjs";
4
4
  export const UpdateAgentRequest = core.serialization.object({
5
+ description: core.serialization.string().optional(),
5
6
  manifest: AgentSpec,
6
7
  });
@@ -1,2 +1,4 @@
1
+ export * from "./schedules/client/requests/index.mjs";
2
+ export * as schedules from "./schedules/index.mjs";
1
3
  export * from "./sessions/client/requests/index.mjs";
2
4
  export * as sessions from "./sessions/index.mjs";
@@ -1,2 +1,4 @@
1
+ export * from "./schedules/client/requests/index.mjs";
2
+ export * as schedules from "./schedules/index.mjs";
1
3
  export * from "./sessions/client/requests/index.mjs";
2
4
  export * as sessions from "./sessions/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,9 @@
1
+ import type * as TrueForge from "../../../../../../../api/index.mjs";
2
+ import * as core from "../../../../../../../core/index.mjs";
3
+ import type * as serializers from "../../../../../../index.mjs";
4
+ export declare const ExecuteScheduleRunRequest: core.serialization.Schema<serializers.internal.ExecuteScheduleRunRequest.Raw, TrueForge.internal.ExecuteScheduleRunRequest>;
5
+ export declare namespace ExecuteScheduleRunRequest {
6
+ interface Raw {
7
+ schedule_run_id: string;
8
+ }
9
+ }