@agentforge-io/sdk-server 4.13.0 → 4.13.1

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/client.d.ts CHANGED
@@ -10,6 +10,7 @@ import { SecretsResource } from './resources/secrets';
10
10
  import { TeamsResource } from './resources/teams';
11
11
  import { TemplatesResource } from './resources/templates';
12
12
  import { TenantConfigResource } from './resources/config';
13
+ import { BusinessRolesResource } from './resources/business-roles';
13
14
  import { ToolsResource } from './resources/tools';
14
15
  export interface AgentForgeClientOptions {
15
16
  /** Platform base URL — e.g. http://localhost:3032 in dev. */
@@ -86,6 +87,7 @@ export declare class AgentForgeClient {
86
87
  readonly teams: TeamsResource;
87
88
  readonly templates: TemplatesResource;
88
89
  readonly config: TenantConfigResource;
90
+ readonly businessRoles: BusinessRolesResource;
89
91
  constructor(opts: AgentForgeClientOptions);
90
92
  /**
91
93
  * A client that acts inside `tenantId`, a tenant where this App is
package/dist/client.js CHANGED
@@ -32,6 +32,7 @@ const secrets_1 = require("./resources/secrets");
32
32
  const teams_1 = require("./resources/teams");
33
33
  const templates_1 = require("./resources/templates");
34
34
  const config_1 = require("./resources/config");
35
+ const business_roles_1 = require("./resources/business-roles");
35
36
  const tools_1 = require("./resources/tools");
36
37
  /** Header that selects an installed tenant for an App secret. */
37
38
  exports.INSTALLED_TENANT_HEADER = 'x-af-tenant';
@@ -72,6 +73,7 @@ class AgentForgeClient {
72
73
  this.teams = new teams_1.TeamsResource(this);
73
74
  this.templates = new templates_1.TemplatesResource(this);
74
75
  this.config = new config_1.TenantConfigResource(this);
76
+ this.businessRoles = new business_roles_1.BusinessRolesResource(this);
75
77
  }
76
78
  /**
77
79
  * A client that acts inside `tenantId`, a tenant where this App is
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { AgentForgeClient, INSTALLED_TENANT_HEADER } from './client';
2
2
  export type { AgentForgeClientOptions, RequestOptions } from './client';
3
3
  export { AgentForgeError, AgentForgeAuthError, AgentForgeNotFoundError, AgentForgeNetworkError, } from './errors';
4
4
  export { TOOL_CALLBACK_HEADERS, ToolCallbackSignatureError, signToolCallbackPayload, verifyToolCallbackSignature, } from './webhooks';
5
- export type { AgentMe, AgentSummary, AppUserConnectorStatus, ApprovalCopyBundle, ChannelContext, ChatStreamChunk, ChatStreamEvent, ChatTokenRecord, ConnectorDefaultsResult, ConnectorDefaultsSource, ConnectorResourceItem, ConnectorStatus, ConnectorToolInfo, ConversationHistory, ConversationStatus, CreateAgentInput, CreateClickupTaskInput, CreateClickupTaskResult, ExternalToolSummary, IssueChatTokenInput, ListAgentsResult, ListConnectorResourcesResult, McpServerConfig, MessageRecord, MessageRole, PublicAppBranding, PublicProfileBlock, PublicProfileTemplate, PublicTeamLanding, CreateTeamInput, UpdateTeamInput, TeamSummary, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallResult, TenantConfigEntry, AppSelf, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
5
+ export type { AgentMe, AgentSummary, AppUserConnectorStatus, ApprovalCopyBundle, ChannelContext, ChatStreamChunk, ChatStreamEvent, ChatTokenRecord, ConnectorDefaultsResult, ConnectorDefaultsSource, ConnectorResourceItem, ConnectorStatus, ConnectorToolInfo, ConversationHistory, ConversationStatus, CreateAgentInput, CreateClickupTaskInput, CreateClickupTaskResult, ExternalToolSummary, IssueChatTokenInput, ListAgentsResult, ListConnectorResourcesResult, McpServerConfig, MessageRecord, MessageRole, PublicAppBranding, PublicProfileBlock, PublicProfileTemplate, PublicTeamLanding, CreateTeamInput, UpdateTeamInput, TeamSummary, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallResult, TenantConfigEntry, AppSelf, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, BusinessRoleEntry, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
6
6
  export { AgentsResource } from './resources/agents';
7
7
  export { AnalyticsResource } from './resources/analytics';
8
8
  export type { GetSupportKpisInput, GetAgentAttentionLogInput, } from './resources/analytics';
@@ -17,6 +17,7 @@ export type { InstallAppInput } from './resources/installations';
17
17
  export { TemplatesResource } from './resources/templates';
18
18
  export type { ListTemplatesInput } from './resources/templates';
19
19
  export { TenantConfigResource } from './resources/config';
20
+ export { BusinessRolesResource } from './resources/business-roles';
20
21
  export type { ListThreadsOptions, SendMessageInput, AssignThreadInput, UnassignThreadInput, SetThreadModeInput, CloseThreadInput, } from './resources/inbox';
21
22
  export { ProvisioningResource } from './resources/provisioning';
22
23
  export type { ProvisionedTenant, ProvisionedApp, ProvisionedTeam, } from './resources/provisioning';
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@
28
28
  // const payload = af.tools.verifyCallback({ rawBody, signatureHeader, secretPlaintext });
29
29
  // await af.tools.respondToCallback({ resultUrl: payload.resultUrl, tenantId: payload.tenantId, secret, result });
30
30
  Object.defineProperty(exports, "__esModule", { value: true });
31
- exports.ToolsResource = exports.TeamsResource = exports.SecretsResource = exports.ProvisioningResource = exports.TenantConfigResource = exports.TemplatesResource = exports.InstallationsResource = exports.InboxResource = exports.ConnectorsResource = exports.ChatResource = exports.AppsResource = exports.AnalyticsResource = exports.AgentsResource = exports.verifyToolCallbackSignature = exports.signToolCallbackPayload = exports.ToolCallbackSignatureError = exports.TOOL_CALLBACK_HEADERS = exports.AgentForgeNetworkError = exports.AgentForgeNotFoundError = exports.AgentForgeAuthError = exports.AgentForgeError = exports.INSTALLED_TENANT_HEADER = exports.AgentForgeClient = void 0;
31
+ exports.ToolsResource = exports.TeamsResource = exports.SecretsResource = exports.ProvisioningResource = exports.BusinessRolesResource = exports.TenantConfigResource = exports.TemplatesResource = exports.InstallationsResource = exports.InboxResource = exports.ConnectorsResource = exports.ChatResource = exports.AppsResource = exports.AnalyticsResource = exports.AgentsResource = exports.verifyToolCallbackSignature = exports.signToolCallbackPayload = exports.ToolCallbackSignatureError = exports.TOOL_CALLBACK_HEADERS = exports.AgentForgeNetworkError = exports.AgentForgeNotFoundError = exports.AgentForgeAuthError = exports.AgentForgeError = exports.INSTALLED_TENANT_HEADER = exports.AgentForgeClient = void 0;
32
32
  var client_1 = require("./client");
33
33
  Object.defineProperty(exports, "AgentForgeClient", { enumerable: true, get: function () { return client_1.AgentForgeClient; } });
34
34
  Object.defineProperty(exports, "INSTALLED_TENANT_HEADER", { enumerable: true, get: function () { return client_1.INSTALLED_TENANT_HEADER; } });
@@ -60,6 +60,8 @@ var templates_1 = require("./resources/templates");
60
60
  Object.defineProperty(exports, "TemplatesResource", { enumerable: true, get: function () { return templates_1.TemplatesResource; } });
61
61
  var config_1 = require("./resources/config");
62
62
  Object.defineProperty(exports, "TenantConfigResource", { enumerable: true, get: function () { return config_1.TenantConfigResource; } });
63
+ var business_roles_1 = require("./resources/business-roles");
64
+ Object.defineProperty(exports, "BusinessRolesResource", { enumerable: true, get: function () { return business_roles_1.BusinessRolesResource; } });
63
65
  var provisioning_1 = require("./resources/provisioning");
64
66
  Object.defineProperty(exports, "ProvisioningResource", { enumerable: true, get: function () { return provisioning_1.ProvisioningResource; } });
65
67
  var secrets_1 = require("./resources/secrets");
@@ -0,0 +1,8 @@
1
+ import type { AgentForgeClient } from '../client';
2
+ import type { BusinessRoleEntry } from '../types';
3
+ export declare class BusinessRolesResource {
4
+ private readonly client;
5
+ constructor(client: AgentForgeClient);
6
+ /** `GET /api/v1/business-roles` — the roles of the tenant the client acts in. */
7
+ list(): Promise<BusinessRoleEntry[]>;
8
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // business-roles resource — the tenant's business-role catalog, read only
3
+ // (AGF-100z). A template install copies the roles its team was written for
4
+ // into the tenant; a host App reads them to assign ITS OWN people to those
5
+ // roles. The App never creates roles (a role the prompts do not know would
6
+ // break the business's rules), so there is no write here.
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.BusinessRolesResource = void 0;
9
+ class BusinessRolesResource {
10
+ constructor(client) {
11
+ this.client = client;
12
+ }
13
+ /** `GET /api/v1/business-roles` — the roles of the tenant the client acts in. */
14
+ async list() {
15
+ const res = await this.client.request('GET', '/api/v1/business-roles');
16
+ return res.items;
17
+ }
18
+ }
19
+ exports.BusinessRolesResource = BusinessRolesResource;
@@ -12,6 +12,12 @@ export interface SendMessageInput {
12
12
  pauseAgent?: boolean;
13
13
  /** App-minted operator identity (see file header). */
14
14
  operatorId?: string;
15
+ /** The person's name as the App shows it (≤ 80 chars). Labels the reply
16
+ * in the conversation history so the agent knows who answered. */
17
+ operatorName?: string;
18
+ /** Names of that person's business roles (≤ 10, ≤ 64 chars each), e.g.
19
+ * `['Cajero']`. A label for the agent, never authorization. */
20
+ operatorRoles?: string[];
15
21
  }
16
22
  export interface AssignThreadInput {
17
23
  /** App-minted operator identity — required for assign. Same string
package/dist/types.d.ts CHANGED
@@ -118,6 +118,10 @@ export interface RegisterToolInput {
118
118
  plaintextSecret?: string;
119
119
  }
120
120
  export interface RegisterToolsInput {
121
+ /** Required with an App secret (`sk_live_`): the agent to register the
122
+ * tools on — it must belong to the calling App. Ignored with a
123
+ * ChatToken / agent-scoped key (the token's agent wins). */
124
+ agentId?: string;
121
125
  tools: RegisterToolInput[];
122
126
  }
123
127
  export interface RegisterToolsResult {
@@ -489,6 +493,9 @@ export interface ToolCallbackPayload {
489
493
  tenantId: string;
490
494
  agentId: string;
491
495
  conversationId: string;
496
+ /** The App's end user of that turn, when the tool ran on the App-user
497
+ * chat path (`chat.streamMessageForAppUser`). Absent otherwise. */
498
+ externalUserId?: string;
492
499
  toolName: string;
493
500
  input: Record<string, unknown>;
494
501
  /** ISO timestamp — el platform deja de esperar la respuesta después de
@@ -752,4 +759,11 @@ export interface TenantConfigEntry {
752
759
  value: string | null;
753
760
  updatedAt?: string;
754
761
  }
762
+ /** A business role of the tenant's catalog (`GET /api/v1/business-roles`). */
763
+ export interface BusinessRoleEntry {
764
+ slug: string;
765
+ name: string;
766
+ color: string;
767
+ icon: string | null;
768
+ }
755
769
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.13.0",
3
+ "version": "4.13.1",
4
4
  "description": "Server-side SDK for backend apps integrating with AgentForge platform. Auth via ChatToken, ak_live_ API key or App secret (sk_live_), with App installations across tenants.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",