@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
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@truefoundry/trueforge-sdk",
46
- "X-Fern-SDK-Version": "0.2.0-rc.3",
47
- "User-Agent": "@truefoundry/trueforge-sdk/0.2.0-rc.3",
46
+ "X-Fern-SDK-Version": "0.2.0-rc.5",
47
+ "User-Agent": "@truefoundry/trueforge-sdk/0.2.0-rc.5",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -11,10 +11,12 @@ export declare class AgentsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<AgentsClient.Options>;
12
12
  constructor(options: AgentsClient.Options);
13
13
  /**
14
- * All configured agents for the tenant.
14
+ * List configured agents for the tenant, ordered by name. Optional `agent_name` filters by substring.
15
15
  *
16
+ * @param {TrueForge.ListAgentsRequest} request
16
17
  * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
17
18
  *
19
+ * @throws {@link TrueForge.BadRequestError}
18
20
  * @throws {@link TrueForge.UnauthorizedError}
19
21
  * @throws {@link errors.TrueForgeError}
20
22
  * @throws {@link errors.TrueForgeTimeoutError}
@@ -22,8 +24,7 @@ export declare class AgentsClient {
22
24
  * @example
23
25
  * await client.agents.list()
24
26
  */
25
- list(requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<TrueForge.ListAgentsResponse>;
26
- private __list;
27
+ list(request?: TrueForge.ListAgentsRequest, requestOptions?: AgentsClient.RequestOptions): Promise<core.Page<TrueForge.Agent, TrueForge.ListAgentsResponse>>;
27
28
  /**
28
29
  * Creates an agent and allocates an immutable id. Fails if `name` is already taken. Name cannot be changed later.
29
30
  *
@@ -38,6 +39,7 @@ export declare class AgentsClient {
38
39
  *
39
40
  * @example
40
41
  * await client.agents.create({
42
+ * description: "description",
41
43
  * manifest: {
42
44
  * model: {
43
45
  * name: "name"
@@ -64,7 +66,7 @@ export declare class AgentsClient {
64
66
  get(agent_id: string, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<TrueForge.GetAgentResponse>;
65
67
  private __get;
66
68
  /**
67
- * Replaces the manifest for an existing agent keyed by immutable `agent_id`.
69
+ * Update an existing agent by immutable id.
68
70
  *
69
71
  * @param {string} agent_id - Immutable agent identifier.
70
72
  * @param {TrueForge.UpdateAgentRequest} request
@@ -57,10 +57,12 @@ class AgentsClient {
57
57
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
58
58
  }
59
59
  /**
60
- * All configured agents for the tenant.
60
+ * List configured agents for the tenant, ordered by name. Optional `agent_name` filters by substring.
61
61
  *
62
+ * @param {TrueForge.ListAgentsRequest} request
62
63
  * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
63
64
  *
65
+ * @throws {@link TrueForge.BadRequestError}
64
66
  * @throws {@link TrueForge.UnauthorizedError}
65
67
  * @throws {@link errors.TrueForgeError}
66
68
  * @throws {@link errors.TrueForgeTimeoutError}
@@ -68,56 +70,84 @@ class AgentsClient {
68
70
  * @example
69
71
  * await client.agents.list()
70
72
  */
71
- list(requestOptions) {
72
- return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
73
- }
74
- __list(requestOptions) {
75
- return __awaiter(this, void 0, void 0, function* () {
76
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
77
- const _authRequest = yield this._options.authProvider.getAuthRequest();
78
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
79
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
80
- 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"),
81
- method: "GET",
82
- headers: _headers,
83
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
84
- 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,
85
- 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,
86
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
87
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
88
- logging: this._options.logging,
89
- });
90
- if (_response.ok) {
91
- return {
92
- data: serializers.ListAgentsResponse.parseOrThrow(_response.body, {
93
- unrecognizedObjectKeys: "passthrough",
94
- allowUnrecognizedUnionMembers: true,
95
- allowUnrecognizedEnumValues: true,
96
- skipValidation: true,
97
- breadcrumbsPrefix: ["response"],
98
- }),
99
- rawResponse: _response.rawResponse,
73
+ list() {
74
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
75
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
76
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
77
+ const { limit = 50, pageToken, agentName } = request;
78
+ const _queryParams = {
79
+ limit,
80
+ page_token: pageToken,
81
+ agent_name: agentName,
100
82
  };
101
- }
102
- if (_response.error.reason === "status-code") {
103
- switch (_response.error.statusCode) {
104
- case 401:
105
- throw new TrueForge.UnauthorizedError(serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
83
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
84
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
85
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
86
+ 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"),
87
+ method: "GET",
88
+ headers: _headers,
89
+ queryString: core.url
90
+ .queryBuilder()
91
+ .addMany(_queryParams)
92
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
93
+ .build(),
94
+ 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,
95
+ 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,
96
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
97
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
98
+ logging: this._options.logging,
99
+ });
100
+ if (_response.ok) {
101
+ return {
102
+ data: serializers.ListAgentsResponse.parseOrThrow(_response.body, {
106
103
  unrecognizedObjectKeys: "passthrough",
107
104
  allowUnrecognizedUnionMembers: true,
108
105
  allowUnrecognizedEnumValues: true,
109
106
  skipValidation: true,
110
107
  breadcrumbsPrefix: ["response"],
111
- }), _response.rawResponse);
112
- default:
113
- throw new errors.TrueForgeError({
114
- statusCode: _response.error.statusCode,
115
- body: _response.error.body,
116
- rawResponse: _response.rawResponse,
117
- });
108
+ }),
109
+ rawResponse: _response.rawResponse,
110
+ };
118
111
  }
119
- }
120
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/v1/agents");
112
+ if (_response.error.reason === "status-code") {
113
+ switch (_response.error.statusCode) {
114
+ case 400:
115
+ throw new TrueForge.BadRequestError(serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
116
+ unrecognizedObjectKeys: "passthrough",
117
+ allowUnrecognizedUnionMembers: true,
118
+ allowUnrecognizedEnumValues: true,
119
+ skipValidation: true,
120
+ breadcrumbsPrefix: ["response"],
121
+ }), _response.rawResponse);
122
+ case 401:
123
+ throw new TrueForge.UnauthorizedError(serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
124
+ unrecognizedObjectKeys: "passthrough",
125
+ allowUnrecognizedUnionMembers: true,
126
+ allowUnrecognizedEnumValues: true,
127
+ skipValidation: true,
128
+ breadcrumbsPrefix: ["response"],
129
+ }), _response.rawResponse);
130
+ default:
131
+ throw new errors.TrueForgeError({
132
+ statusCode: _response.error.statusCode,
133
+ body: _response.error.body,
134
+ rawResponse: _response.rawResponse,
135
+ });
136
+ }
137
+ }
138
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/v1/agents");
139
+ }));
140
+ const dataWithRawResponse = yield list(request).withRawResponse();
141
+ return new core.Page({
142
+ response: dataWithRawResponse.data,
143
+ rawResponse: dataWithRawResponse.rawResponse,
144
+ hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.pagination.nextPageToken) != null &&
145
+ !(typeof (response === null || response === void 0 ? void 0 : response.pagination.nextPageToken) === "string" && (response === null || response === void 0 ? void 0 : response.pagination.nextPageToken) === ""),
146
+ getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.data) !== null && _a !== void 0 ? _a : []; },
147
+ loadPage: (response) => {
148
+ return list(core.setObjectProperty(request, "pageToken", response === null || response === void 0 ? void 0 : response.pagination.nextPageToken));
149
+ },
150
+ });
121
151
  });
122
152
  }
123
153
  /**
@@ -134,6 +164,7 @@ class AgentsClient {
134
164
  *
135
165
  * @example
136
166
  * await client.agents.create({
167
+ * description: "description",
137
168
  * manifest: {
138
169
  * model: {
139
170
  * name: "name"
@@ -284,7 +315,7 @@ class AgentsClient {
284
315
  });
285
316
  }
286
317
  /**
287
- * Replaces the manifest for an existing agent keyed by immutable `agent_id`.
318
+ * Update an existing agent by immutable id.
288
319
  *
289
320
  * @param {string} agent_id - Immutable agent identifier.
290
321
  * @param {TrueForge.UpdateAgentRequest} request
@@ -2,6 +2,7 @@ import type * as TrueForge from "../../../../index.js";
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.js";
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
+ }
@@ -1,8 +1,3 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.McpServerType = void 0;
5
- exports.McpServerType = {
6
- Remote: "remote",
7
- Truefoundry: "truefoundry",
8
- };
@@ -10,5 +10,6 @@ import type * as TrueForge from "../../../../index.js";
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.js";
2
+ export type { ListAgentsRequest } from "./ListAgentsRequest.js";
2
3
  export type { UpdateAgentRequest } from "./UpdateAgentRequest.js";
@@ -4,6 +4,7 @@ import * as core from "../../../../core/index.js";
4
4
  import * as TrueForge from "../../../index.js";
5
5
  import { AgentsClient } from "../resources/agents/client/Client.js";
6
6
  import { MetricsClient } from "../resources/metrics/client/Client.js";
7
+ import { SchedulesClient } from "../resources/schedules/client/Client.js";
7
8
  import { SessionsClient } from "../resources/sessions/client/Client.js";
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
  /**
@@ -54,7 +54,8 @@ const serializers = __importStar(require("../../../../serialization/index.js"));
54
54
  const TrueForge = __importStar(require("../../../index.js"));
55
55
  const Client_js_1 = require("../resources/agents/client/Client.js");
56
56
  const Client_js_2 = require("../resources/metrics/client/Client.js");
57
- const Client_js_3 = require("../resources/sessions/client/Client.js");
57
+ const Client_js_3 = require("../resources/schedules/client/Client.js");
58
+ const Client_js_4 = require("../resources/sessions/client/Client.js");
58
59
  class InternalClient {
59
60
  constructor(options) {
60
61
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
@@ -63,9 +64,13 @@ class InternalClient {
63
64
  var _a;
64
65
  return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_js_2.MetricsClient(this._options)));
65
66
  }
67
+ get schedules() {
68
+ var _a;
69
+ return ((_a = this._schedules) !== null && _a !== void 0 ? _a : (this._schedules = new Client_js_3.SchedulesClient(this._options)));
70
+ }
66
71
  get sessions() {
67
72
  var _a;
68
- return ((_a = this._sessions) !== null && _a !== void 0 ? _a : (this._sessions = new Client_js_3.SessionsClient(this._options)));
73
+ return ((_a = this._sessions) !== null && _a !== void 0 ? _a : (this._sessions = new Client_js_4.SessionsClient(this._options)));
69
74
  }
70
75
  get agents() {
71
76
  var _a;
@@ -2,5 +2,7 @@ export * from "./agents/client/requests/index.js";
2
2
  export * as agents from "./agents/index.js";
3
3
  export * from "./metrics/client/requests/index.js";
4
4
  export * as metrics from "./metrics/index.js";
5
+ export * from "./schedules/client/requests/index.js";
6
+ export * as schedules from "./schedules/index.js";
5
7
  export * from "./sessions/client/requests/index.js";
6
8
  export * as sessions from "./sessions/index.js";
@@ -36,10 +36,12 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.sessions = exports.metrics = exports.agents = void 0;
39
+ exports.sessions = exports.schedules = exports.metrics = exports.agents = void 0;
40
40
  __exportStar(require("./agents/client/requests/index.js"), exports);
41
41
  exports.agents = __importStar(require("./agents/index.js"));
42
42
  __exportStar(require("./metrics/client/requests/index.js"), exports);
43
43
  exports.metrics = __importStar(require("./metrics/index.js"));
44
+ __exportStar(require("./schedules/client/requests/index.js"), exports);
45
+ exports.schedules = __importStar(require("./schedules/index.js"));
44
46
  __exportStar(require("./sessions/client/requests/index.js"), exports);
45
47
  exports.sessions = __importStar(require("./sessions/index.js"));
@@ -0,0 +1,32 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
3
+ import * as core from "../../../../../../core/index.js";
4
+ import * as TrueForge from "../../../../../index.js";
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,144 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.SchedulesClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../../../BaseClient.js");
48
+ const headers_js_1 = require("../../../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../../../core/index.js"));
50
+ const requestBody_js_1 = require("../../../../../../core/requestBody.js");
51
+ const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
52
+ const errors = __importStar(require("../../../../../../errors/index.js"));
53
+ const serializers = __importStar(require("../../../../../../serialization/index.js"));
54
+ const TrueForge = __importStar(require("../../../../../index.js"));
55
+ class SchedulesClient {
56
+ constructor(options) {
57
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
58
+ }
59
+ /**
60
+ * Execute a persisted schedule run using its saved schedule and agent.
61
+ *
62
+ * @param {TrueForge.internal.ExecuteScheduleRunRequest} request
63
+ * @param {SchedulesClient.RequestOptions} requestOptions - Request-specific configuration.
64
+ *
65
+ * @throws {@link TrueForge.UnauthorizedError}
66
+ * @throws {@link TrueForge.NotFoundError}
67
+ * @throws {@link TrueForge.UnprocessableEntityError}
68
+ * @throws {@link errors.TrueForgeError}
69
+ * @throws {@link errors.TrueForgeTimeoutError}
70
+ *
71
+ * @example
72
+ * await client.internal.schedules.executeRun({
73
+ * scheduleRunId: "schedule_run_id"
74
+ * })
75
+ */
76
+ executeRun(request, requestOptions) {
77
+ return core.HttpResponsePromise.fromPromise(this.__executeRun(request, requestOptions));
78
+ }
79
+ __executeRun(request, requestOptions) {
80
+ return __awaiter(this, void 0, void 0, function* () {
81
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
82
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
83
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
84
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
85
+ 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"),
86
+ method: "POST",
87
+ headers: _headers,
88
+ contentType: "application/json",
89
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
90
+ requestType: "json",
91
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(serializers.internal.ExecuteScheduleRunRequest.jsonOrThrow(request, {
92
+ unrecognizedObjectKeys: "passthrough",
93
+ allowUnrecognizedUnionMembers: true,
94
+ allowUnrecognizedEnumValues: true,
95
+ omitUndefined: true,
96
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
97
+ 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,
98
+ 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,
99
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
100
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
101
+ logging: this._options.logging,
102
+ });
103
+ if (_response.ok) {
104
+ return { data: undefined, rawResponse: _response.rawResponse };
105
+ }
106
+ if (_response.error.reason === "status-code") {
107
+ switch (_response.error.statusCode) {
108
+ case 401:
109
+ throw new TrueForge.UnauthorizedError(serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
110
+ unrecognizedObjectKeys: "passthrough",
111
+ allowUnrecognizedUnionMembers: true,
112
+ allowUnrecognizedEnumValues: true,
113
+ skipValidation: true,
114
+ breadcrumbsPrefix: ["response"],
115
+ }), _response.rawResponse);
116
+ case 404:
117
+ throw new TrueForge.NotFoundError(serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
118
+ unrecognizedObjectKeys: "passthrough",
119
+ allowUnrecognizedUnionMembers: true,
120
+ allowUnrecognizedEnumValues: true,
121
+ skipValidation: true,
122
+ breadcrumbsPrefix: ["response"],
123
+ }), _response.rawResponse);
124
+ case 422:
125
+ throw new TrueForge.UnprocessableEntityError(serializers.RequestErrorResponse.parseOrThrow(_response.error.body, {
126
+ unrecognizedObjectKeys: "passthrough",
127
+ allowUnrecognizedUnionMembers: true,
128
+ allowUnrecognizedEnumValues: true,
129
+ skipValidation: true,
130
+ breadcrumbsPrefix: ["response"],
131
+ }), _response.rawResponse);
132
+ default:
133
+ throw new errors.TrueForgeError({
134
+ statusCode: _response.error.statusCode,
135
+ body: _response.error.body,
136
+ rawResponse: _response.rawResponse,
137
+ });
138
+ }
139
+ }
140
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/internal/schedules/runs/execute");
141
+ });
142
+ }
143
+ }
144
+ exports.SchedulesClient = SchedulesClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type { ExecuteScheduleRunRequest } from "./ExecuteScheduleRunRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { SchedulesClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.SchedulesClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "SchedulesClient", { enumerable: true, get: function () { return Client_js_1.SchedulesClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -1,6 +1,7 @@
1
1
  import type * as TrueForge from "../index.js";
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.js";
2
2
  export interface ListAgentsResponse {
3
3
  data: TrueForge.Agent[];
4
+ pagination: TrueForge.TokenPagination;
4
5
  }