@agentforge-io/sdk-server 4.6.1 → 4.8.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/client.d.ts CHANGED
@@ -6,6 +6,7 @@ import { ConnectorsResource } from './resources/connectors';
6
6
  import { InboxResource } from './resources/inbox';
7
7
  import { ProvisioningResource } from './resources/provisioning';
8
8
  import { SecretsResource } from './resources/secrets';
9
+ import { TeamsResource } from './resources/teams';
9
10
  import { ToolsResource } from './resources/tools';
10
11
  export interface AgentForgeClientOptions {
11
12
  /** Platform base URL — e.g. http://localhost:3032 in dev. */
@@ -68,6 +69,7 @@ export declare class AgentForgeClient {
68
69
  readonly provisioning: ProvisioningResource;
69
70
  readonly secrets: SecretsResource;
70
71
  readonly tools: ToolsResource;
72
+ readonly teams: TeamsResource;
71
73
  constructor(opts: AgentForgeClientOptions);
72
74
  authHeaders(): Record<string, string>;
73
75
  getAppSecret(): string | undefined;
package/dist/client.js CHANGED
@@ -28,6 +28,7 @@ const connectors_1 = require("./resources/connectors");
28
28
  const inbox_1 = require("./resources/inbox");
29
29
  const provisioning_1 = require("./resources/provisioning");
30
30
  const secrets_1 = require("./resources/secrets");
31
+ const teams_1 = require("./resources/teams");
31
32
  const tools_1 = require("./resources/tools");
32
33
  class AgentForgeClient {
33
34
  constructor(opts) {
@@ -57,6 +58,7 @@ class AgentForgeClient {
57
58
  this.provisioning = new provisioning_1.ProvisioningResource(this);
58
59
  this.secrets = new secrets_1.SecretsResource(this);
59
60
  this.tools = new tools_1.ToolsResource(this);
61
+ this.teams = new teams_1.TeamsResource(this);
60
62
  }
61
63
  // Auth headers derivados del modo. ChatToken gana si ambos están presentes;
62
64
  // luego apiKey (ak_live_); luego appSecret (sk_live_) — ambos secrets viajan
package/dist/index.d.ts CHANGED
@@ -2,13 +2,13 @@ export { AgentForgeClient } 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, 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, TeamSummary, 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';
6
6
  export { AgentsResource } from './resources/agents';
7
7
  export { AnalyticsResource } from './resources/analytics';
8
8
  export type { GetSupportKpisInput, GetAgentAttentionLogInput, } from './resources/analytics';
9
9
  export { AppsResource } from './resources/apps';
10
10
  export { ChatResource } from './resources/chat';
11
- export type { AnthropicClientOptions, StreamMessageInput } from './resources/chat';
11
+ export type { AnthropicClientOptions, AppCallerClaims, StreamMessageInput, StreamMessageForAppUserInput, } from './resources/chat';
12
12
  export { ConnectorsResource } from './resources/connectors';
13
13
  export type { InboxChannelView } from './resources/connectors';
14
14
  export { InboxResource } from './resources/inbox';
@@ -16,5 +16,6 @@ export type { ListThreadsOptions, SendMessageInput, AssignThreadInput, UnassignT
16
16
  export { ProvisioningResource } from './resources/provisioning';
17
17
  export type { ProvisionedTenant, ProvisionedApp, ProvisionedTeam, } from './resources/provisioning';
18
18
  export { SecretsResource } from './resources/secrets';
19
+ export { TeamsResource } from './resources/teams';
19
20
  export { ToolsResource } from './resources/tools';
20
21
  export type { RespondToCallbackInput, VerifyCallbackInput } from './resources/tools';
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.SecretsResource = exports.ProvisioningResource = 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.AgentForgeClient = void 0;
31
+ exports.ToolsResource = exports.TeamsResource = exports.SecretsResource = exports.ProvisioningResource = 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.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
  var errors_1 = require("./errors");
@@ -57,5 +57,7 @@ var provisioning_1 = require("./resources/provisioning");
57
57
  Object.defineProperty(exports, "ProvisioningResource", { enumerable: true, get: function () { return provisioning_1.ProvisioningResource; } });
58
58
  var secrets_1 = require("./resources/secrets");
59
59
  Object.defineProperty(exports, "SecretsResource", { enumerable: true, get: function () { return secrets_1.SecretsResource; } });
60
+ var teams_1 = require("./resources/teams");
61
+ Object.defineProperty(exports, "TeamsResource", { enumerable: true, get: function () { return teams_1.TeamsResource; } });
60
62
  var tools_1 = require("./resources/tools");
61
63
  Object.defineProperty(exports, "ToolsResource", { enumerable: true, get: function () { return tools_1.ToolsResource; } });
@@ -42,6 +42,25 @@ export interface StreamMessageForAppUserInput {
42
42
  * here to turn the sanitizer OFF for this operator-facing surface.
43
43
  */
44
44
  channel?: ChannelContext;
45
+ /**
46
+ * AGF-OUTCOMES I5 — what the App declares about this end user for this
47
+ * turn. The platform shows it to the agent in the per-turn identity block
48
+ * as "declared by the App, not verified by AgentForge"; omit for no claims.
49
+ */
50
+ caller?: AppCallerClaims;
51
+ }
52
+ /** What an App declares about its end user on a chat turn (see `caller`). */
53
+ export interface AppCallerClaims {
54
+ displayName?: string;
55
+ email?: string;
56
+ phone?: string;
57
+ /** App-defined role slugs (e.g. `mayorista`); prompts can branch on them. */
58
+ roles?: string[];
59
+ /** `true` only when the App itself verified the email. */
60
+ emailVerified?: boolean;
61
+ /** Where the person is, in the App's words — e.g. the reference of a
62
+ * scanned QR code (`mesa-03`). */
63
+ location?: string;
45
64
  }
46
65
  export declare class ChatResource {
47
66
  private readonly client;
@@ -149,6 +149,7 @@ class ChatResource {
149
149
  externalUserId: input.externalUserId,
150
150
  content: input.content,
151
151
  ...(input.channel ? { channel: input.channel } : {}),
152
+ ...(input.caller ? { caller: input.caller } : {}),
152
153
  });
153
154
  if (!res.body) {
154
155
  throw new Error('chat.streamMessageForAppUser: response has no readable body');
@@ -0,0 +1,12 @@
1
+ import type { AgentForgeClient } from '../client';
2
+ import type { CreateTeamInput, PublicTeamLanding, TeamSummary } from '../types';
3
+ export declare class TeamsResource {
4
+ private readonly client;
5
+ constructor(client: AgentForgeClient);
6
+ /** `GET /team/:slug` — public landing payload of a public team. 404 → `AgentForgeNotFoundError`. */
7
+ getPublic(slug: string): Promise<PublicTeamLanding>;
8
+ /** `POST /api/v1/teams` — create a team (and its orchestrator) in the caller's tenant. */
9
+ create(input: CreateTeamInput): Promise<TeamSummary>;
10
+ /** `DELETE /api/v1/teams/:teamId` — delete a team of the caller's tenant. */
11
+ delete(teamId: string): Promise<void>;
12
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ // teams resource — public read of a team's landing payload, so a host App
3
+ // (PoodleDeck, ScrappyDoc, …) can render its own public page for a team
4
+ // without hand-rolling a fetch against the platform (SDK-first rule).
5
+ //
6
+ // - `getPublic(slug)` — `GET /team/:slug`. The platform's anonymous team
7
+ // landing surface: team metadata + profile template/blocks/theme, the
8
+ // orchestrator identity and the member roster. Private teams 404 to
9
+ // anonymous callers; this client never sends a user JWT, so it only
10
+ // ever sees public teams.
11
+ //
12
+ // - `create(input)` / `delete(teamId)` — `POST` / `DELETE /api/v1/teams`.
13
+ // A host App builds a team for one of its end customers (members are
14
+ // agents it created with `agents.create`). With `sk_live_` the team is
15
+ // owned by the App. `delete` is the compensation when a later step of
16
+ // the host's own onboarding fails.
17
+ //
18
+ // The response also carries a `chatToken` (`aft_…`) for the platform's own
19
+ // public page. A host that runs the chat server-side with its `sk_live_`
20
+ // (`chat.streamMessageForAppUser`) must NOT forward it to browsers.
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.TeamsResource = void 0;
23
+ class TeamsResource {
24
+ constructor(client) {
25
+ this.client = client;
26
+ }
27
+ /** `GET /team/:slug` — public landing payload of a public team. 404 → `AgentForgeNotFoundError`. */
28
+ async getPublic(slug) {
29
+ return this.client.request('GET', `/team/${encodeURIComponent(slug)}`);
30
+ }
31
+ /** `POST /api/v1/teams` — create a team (and its orchestrator) in the caller's tenant. */
32
+ async create(input) {
33
+ return this.client.request('POST', '/api/v1/teams', input);
34
+ }
35
+ /** `DELETE /api/v1/teams/:teamId` — delete a team of the caller's tenant. */
36
+ async delete(teamId) {
37
+ await this.client.request('DELETE', `/api/v1/teams/${encodeURIComponent(teamId)}`);
38
+ }
39
+ }
40
+ exports.TeamsResource = TeamsResource;
package/dist/types.d.ts CHANGED
@@ -587,4 +587,67 @@ export interface AgentAttentionLogRow {
587
587
  avgFrtMs: number | null;
588
588
  avgTimeToAssignMs: number | null;
589
589
  }
590
+ export type PublicProfileTemplate = 'minimal' | 'brand' | 'beacons';
591
+ export interface PublicProfileBlock {
592
+ id: string;
593
+ kind: string;
594
+ enabled: boolean;
595
+ title?: string;
596
+ [field: string]: unknown;
597
+ }
598
+ export interface PublicTeamLanding {
599
+ team: {
600
+ id: string;
601
+ name: string;
602
+ publicSlug?: string;
603
+ description?: string;
604
+ theme: Record<string, unknown> | null;
605
+ profileTemplate: PublicProfileTemplate;
606
+ profileBlocks: PublicProfileBlock[] | null;
607
+ orchestrationMode: 'flat' | 'hierarchical';
608
+ };
609
+ orchestrator: {
610
+ id: string;
611
+ name: string;
612
+ avatarUrl?: string;
613
+ };
614
+ members: Array<{
615
+ id: string;
616
+ name: string;
617
+ avatarUrl?: string;
618
+ description?: string;
619
+ roleHint?: string;
620
+ }>;
621
+ /** Platform-page ChatToken. Hosts that chat through `sk_live_` must not expose it. */
622
+ chatToken: string | null;
623
+ }
624
+ /** `POST /api/v1/teams` body. The team's hidden orchestrator agent is created with it. */
625
+ export interface CreateTeamInput {
626
+ name: string;
627
+ /** Tenant-unique slug; derived from `name` when omitted. */
628
+ slug?: string;
629
+ description?: string;
630
+ /** Standalone agents of the same tenant that become the team's members. */
631
+ memberAgentIds?: string[];
632
+ /** agentId → what that member is for (the orchestrator reads it to delegate). */
633
+ roleHints?: Record<string, string>;
634
+ /** Globally unique handle of the public page (`/team/:publicSlug`). Minted when omitted. */
635
+ publicSlug?: string;
636
+ visibility?: 'private' | 'public';
637
+ orchestrationMode?: 'flat' | 'hierarchical';
638
+ }
639
+ /** A team as the admin surface returns it (`/api/v1/teams`). */
640
+ export interface TeamSummary {
641
+ id: string;
642
+ tenantId: string;
643
+ appId?: string | null;
644
+ name: string;
645
+ slug: string;
646
+ description?: string | null;
647
+ publicSlug?: string | null;
648
+ visibility: 'private' | 'public';
649
+ orchestratorAgentId: string;
650
+ orchestrationMode: 'flat' | 'hierarchical';
651
+ [field: string]: unknown;
652
+ }
590
653
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.6.1",
3
+ "version": "4.8.0",
4
4
  "description": "Server-side SDK for backend apps integrating with AgentForge platform. Auth via ChatToken or ak_live_ API key.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",