@arbidocs/sdk 0.4.130 → 0.4.132

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.cjs CHANGED
@@ -6149,6 +6149,7 @@ __export(agents_exports, {
6149
6149
  closeAgentSession: () => closeAgentSession,
6150
6150
  createAgent: () => createAgent,
6151
6151
  deleteAgents: () => deleteAgents,
6152
+ generateAgentAvatar: () => generateAgentAvatar,
6152
6153
  getAgentConfig: () => getAgentConfig,
6153
6154
  getAgentSession: () => getAgentSession,
6154
6155
  getAuthorizeLimits: () => getAuthorizeLimits,
@@ -6189,6 +6190,15 @@ async function deleteAgents(arbi, agentExtIds) {
6189
6190
  "Failed to delete agents"
6190
6191
  );
6191
6192
  }
6193
+ async function generateAgentAvatar(arbi, agentExtId, prompt) {
6194
+ return requireData(
6195
+ await arbi.fetch.POST("/v1/agents/{agent_ext_id}/avatar", {
6196
+ params: { path: { agent_ext_id: agentExtId } },
6197
+ body: { prompt }
6198
+ }),
6199
+ "Failed to generate the agent avatar"
6200
+ );
6201
+ }
6192
6202
  async function authorizeAgent(arbi, agentExtId, workspaceExtId, ttlSeconds) {
6193
6203
  return requireData(
6194
6204
  await arbi.fetch.POST("/v1/agents/{agent_ext_id}/authorize", {
@@ -8327,6 +8337,12 @@ var Arbi = class {
8327
8337
  options;
8328
8338
  constructor(options) {
8329
8339
  this.options = options;
8340
+ if (options.session) {
8341
+ this.client = options.session.client;
8342
+ this.loginResult = options.session.login;
8343
+ this.userProfile = options.session.login.profile ?? null;
8344
+ this.currentWorkspaceId = options.session.workspaceId ?? null;
8345
+ }
8330
8346
  }
8331
8347
  // ── Lifecycle ───────────────────────────────────────────────────────────
8332
8348
  /**
@@ -9269,6 +9285,8 @@ var Arbi = class {
9269
9285
  getConfig: (agentExtId) => getAgentConfig(this.requireClient(), agentExtId),
9270
9286
  listWorkspaces: (agentExtId) => listAgentWorkspaces(this.requireClient(), agentExtId),
9271
9287
  delete: (agentExtIds) => deleteAgents(this.requireClient(), agentExtIds),
9288
+ /** Generate an avatar from `prompt` and set it as the agent's picture. */
9289
+ generateAvatar: (agentExtId, prompt) => generateAgentAvatar(this.requireClient(), agentExtId, prompt),
9272
9290
  /** Mint a TTL'd run session for an agent; see `grantTemporaryAccess` to also deposit a key. */
9273
9291
  authorize: (agentExtId, workspaceId, ttlSeconds) => authorizeAgent(this.requireClient(), agentExtId, workspaceId, ttlSeconds),
9274
9292
  authorizeLimits: () => getAuthorizeLimits(this.requireClient()),