@uipath/agent-sdk 1.195.0 → 1.196.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -19575,7 +19575,7 @@ class TextApiResponse {
19575
19575
  var package_default = {
19576
19576
  name: "@uipath/agent-sdk",
19577
19577
  license: "MIT",
19578
- version: "1.195.0",
19578
+ version: "1.196.0",
19579
19579
  description: "SDK for the UiPath Agent Runtime API — evaluation execution and debug sessions.",
19580
19580
  repository: {
19581
19581
  type: "git",
@@ -22841,11 +22841,11 @@ var parseResourceUrl = (url) => {
22841
22841
  if (error || !parsed)
22842
22842
  return;
22843
22843
  const segments = parsed.pathname.split("/").filter(Boolean);
22844
- const organizationName = segments[0];
22845
- const tenantName = segments[1];
22846
- if (!organizationName || !tenantName)
22847
- return;
22848
- return { baseUrl: parsed.origin, organizationName, tenantName };
22844
+ return {
22845
+ baseUrl: parsed.origin,
22846
+ organizationName: segments[0],
22847
+ tenantName: segments[1]
22848
+ };
22849
22849
  };
22850
22850
  var defaultLoadModule = async () => {
22851
22851
  const [error, mod] = await catchError(() => Promise.resolve().then(() => __toESM(require_dist(), 1)));
@@ -22896,6 +22896,7 @@ var tryRobotClientFallback = async (options = {}) => {
22896
22896
  }
22897
22897
  let organizationIdFromToken;
22898
22898
  let tenantIdFromToken;
22899
+ let issuerFromToken;
22899
22900
  const [jwtError, claims] = catchError(() => parseJWT(accessToken));
22900
22901
  if (!jwtError && claims) {
22901
22902
  const rawOrgId = claims.prtId ?? claims.organizationId ?? claims.prt_id;
@@ -22906,6 +22907,10 @@ var tryRobotClientFallback = async (options = {}) => {
22906
22907
  if (typeof tenantClaim === "string" && tenantClaim.length > 0) {
22907
22908
  tenantIdFromToken = tenantClaim;
22908
22909
  }
22910
+ const issClaim = claims.iss;
22911
+ if (typeof issClaim === "string" && issClaim.length > 0) {
22912
+ issuerFromToken = issClaim;
22913
+ }
22909
22914
  }
22910
22915
  printNoticeOnce();
22911
22916
  return {
@@ -22914,7 +22919,8 @@ var tryRobotClientFallback = async (options = {}) => {
22914
22919
  organizationName: parsedUrl.organizationName,
22915
22920
  organizationId: organizationIdFromToken ?? parsedUrl.organizationName,
22916
22921
  tenantName: parsedUrl.tenantName,
22917
- tenantId: tenantIdFromToken
22922
+ tenantId: tenantIdFromToken,
22923
+ issuer: issuerFromToken
22918
22924
  };
22919
22925
  } catch {
22920
22926
  return;
@@ -23016,7 +23022,7 @@ var probeAsync = async (fs7, candidate) => {
23016
23022
  };
23017
23023
  }
23018
23024
  };
23019
- var resolveEnvFileLocationAsync = async (envFilePath = DEFAULT_ENV_FILENAME) => {
23025
+ var resolveEnvFileLocationAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opts) => {
23020
23026
  const fs7 = getFileSystem();
23021
23027
  if (fs7.path.isAbsolute(envFilePath)) {
23022
23028
  const probe2 = await probeAsync(fs7, envFilePath);
@@ -23027,7 +23033,7 @@ var resolveEnvFileLocationAsync = async (envFilePath = DEFAULT_ENV_FILENAME) =>
23027
23033
  ...probe2.unusable ? { unusable: probe2.unusable } : {}
23028
23034
  };
23029
23035
  }
23030
- const cwd = fs7.env.cwd();
23036
+ const cwd = opts?.cwd ?? fs7.env.cwd();
23031
23037
  let searchDir = cwd;
23032
23038
  while (true) {
23033
23039
  const candidate = fs7.path.join(searchDir, envFilePath);
@@ -23057,8 +23063,8 @@ var resolveEnvFileLocationAsync = async (envFilePath = DEFAULT_ENV_FILENAME) =>
23057
23063
  ...probe.unusable ? { unusable: probe.unusable } : {}
23058
23064
  };
23059
23065
  };
23060
- var resolveEnvFilePathAsync = async (envFilePath = DEFAULT_ENV_FILENAME) => {
23061
- const location = await resolveEnvFileLocationAsync(envFilePath);
23066
+ var resolveEnvFilePathAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opts) => {
23067
+ const location = await resolveEnvFileLocationAsync(envFilePath, opts);
23062
23068
  if (location.exists) {
23063
23069
  return { absolutePath: location.absolutePath };
23064
23070
  }
@@ -23290,6 +23296,7 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
23290
23296
  organizationId: robotCreds.organizationId,
23291
23297
  tenantName: robotCreds.tenantName,
23292
23298
  tenantId: robotCreds.tenantId,
23299
+ issuer: robotCreds.issuer,
23293
23300
  expiration: expiration2,
23294
23301
  source: "robot" /* Robot */
23295
23302
  };
@@ -23311,6 +23318,7 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
23311
23318
  organizationId: robotCreds.organizationId,
23312
23319
  tenantName: robotCreds.tenantName,
23313
23320
  tenantId: robotCreds.tenantId,
23321
+ issuer: robotCreds.issuer,
23314
23322
  expiration: expiration2,
23315
23323
  source: "robot" /* Robot */
23316
23324
  };
@@ -23468,7 +23476,8 @@ var getLoginStatusAsync = async (options = {}) => {
23468
23476
  // ../auth/src/authContext.ts
23469
23477
  var getAuthContext = async (options = {}) => {
23470
23478
  const status = await getLoginStatusAsync({
23471
- ensureTokenValidityMinutes: options.ensureTokenValidityMinutes
23479
+ ensureTokenValidityMinutes: options.ensureTokenValidityMinutes,
23480
+ envFilePath: options.envFilePath
23472
23481
  });
23473
23482
  if (status.loginStatus !== "Logged in" || !status.baseUrl || !status.accessToken) {
23474
23483
  throw new Error(status.hint ? `Not logged in. ${status.hint}` : "Not logged in. Run 'uip login' first.");
@@ -23540,7 +23549,7 @@ async function getAgentEnforcements(options) {
23540
23549
  }
23541
23550
  return await response.json();
23542
23551
  }
23543
- async function getAvailableModelNames(options) {
23552
+ async function getAvailableModels(options) {
23544
23553
  const config = await createAgentRuntimeConfig(options);
23545
23554
  const tenantId = extractTenantId(config);
23546
23555
  const url = `${config.basePath}/api/designer/${encodeURIComponent(tenantId)}/resources/models`;
@@ -23552,7 +23561,11 @@ async function getAvailableModelNames(options) {
23552
23561
  throw new Error(`Failed to fetch available models: ${String(response.status)} ${response.statusText}`);
23553
23562
  }
23554
23563
  const body = await response.json();
23555
- const models2 = Array.isArray(body) ? body : body.value ?? [];
23564
+ const raw = Array.isArray(body) ? body : body.value ?? [];
23565
+ return raw.map((item) => LlmModelFromJSON(item));
23566
+ }
23567
+ async function getAvailableModelNames(options) {
23568
+ const models2 = await getAvailableModels(options);
23556
23569
  return models2.map((m) => m.name).filter((n) => n != null);
23557
23570
  }
23558
23571
  async function getGuardrailDefinitions(options) {
@@ -23683,6 +23696,7 @@ export {
23683
23696
  instanceOfAgentAppearance,
23684
23697
  getGuardrailDefinitions,
23685
23698
  getGuardrailCatalog,
23699
+ getAvailableModels,
23686
23700
  getAvailableModelNames,
23687
23701
  getAgentEnforcements,
23688
23702
  exists,
@@ -1,3 +1,4 @@
1
+ import type { LlmModel } from "../generated/src/models/LlmModel.js";
1
2
  import { type CreateApiClientOptions } from "./client-factory.js";
2
3
  /**
3
4
  * Governance enforcement data returned by the platform API.
@@ -16,11 +17,17 @@ export interface AgentEnforcements {
16
17
  * (same base URL as all other agent-sdk calls: `agentsruntime_`).
17
18
  */
18
19
  export declare function getAgentEnforcements(options?: CreateApiClientOptions): Promise<AgentEnforcements>;
20
+ /**
21
+ * Fetch available models for the authenticated tenant.
22
+ *
23
+ * Endpoint: `GET /api/designer/{tenantId}/resources/models`
24
+ * Returns full `LlmModel[]` objects with provider, token limits, preview status, etc.
25
+ */
26
+ export declare function getAvailableModels(options?: CreateApiClientOptions): Promise<LlmModel[]>;
19
27
  /**
20
28
  * Fetch available model names for the authenticated tenant.
21
29
  *
22
- * Reuses the existing `ResourcesDesignerApi` endpoint but returns
23
- * just the model name strings (the shape consumers need for validation).
30
+ * Delegates to `getAvailableModels()` and extracts just the name strings.
24
31
  */
25
32
  export declare function getAvailableModelNames(options?: CreateApiClientOptions): Promise<string[]>;
26
33
  export interface GuardrailParameterDefinition {
@@ -1,6 +1,6 @@
1
1
  import "./user-agent.js";
2
2
  export * from "../generated/src/index.js";
3
3
  export { type CreateApiClientOptions, createAgentRuntimeConfig, createApiClient, } from "./client-factory.js";
4
- export { type AgentEnforcements, type GuardrailCatalogEntry, GuardrailCatalogUnavailableError, type GuardrailDefinition, type GuardrailParameterDefinition, type GuardrailsCatalogResponse, getAgentEnforcements, getAvailableModelNames, getGuardrailCatalog, getGuardrailDefinitions, } from "./governance.js";
4
+ export { type AgentEnforcements, type GuardrailCatalogEntry, GuardrailCatalogUnavailableError, type GuardrailDefinition, type GuardrailParameterDefinition, type GuardrailsCatalogResponse, getAgentEnforcements, getAvailableModelNames, getAvailableModels, getGuardrailCatalog, getGuardrailDefinitions, } from "./governance.js";
5
5
  export { ProjectFilesSource } from "./types.js";
6
6
  export { SDK_USER_AGENT } from "./user-agent.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/agent-sdk",
3
3
  "license": "MIT",
4
- "version": "1.195.0",
4
+ "version": "1.196.0",
5
5
  "description": "SDK for the UiPath Agent Runtime API — evaluation execution and debug sessions.",
6
6
  "repository": {
7
7
  "type": "git",
@@ -29,5 +29,5 @@
29
29
  "files": [
30
30
  "dist"
31
31
  ],
32
- "gitHead": "eecf5713cd579b15783c770d1923e44e730271ea"
32
+ "gitHead": "94d71f9c52214980a1f0ae62b3f5372095788553"
33
33
  }