@agentforge-io/sdk-server 4.5.2 → 4.5.3

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.d.ts CHANGED
@@ -2,7 +2,7 @@ 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, RegisterToolInput, RegisterToolsInput, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, } 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, AppSelf, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, } from './types';
6
6
  export { AgentsResource } from './resources/agents';
7
7
  export { AppsResource } from './resources/apps';
8
8
  export { ChatResource } from './resources/chat';
@@ -10,7 +10,7 @@ export type { AnthropicClientOptions, StreamMessageInput } from './resources/cha
10
10
  export { ConnectorsResource } from './resources/connectors';
11
11
  export type { InboxChannelView } from './resources/connectors';
12
12
  export { ProvisioningResource } from './resources/provisioning';
13
- export type { ProvisionedTenant, ProvisionedApp, } from './resources/provisioning';
13
+ export type { ProvisionedTenant, ProvisionedApp, ProvisionedTeam, } from './resources/provisioning';
14
14
  export { SecretsResource } from './resources/secrets';
15
15
  export { ToolsResource } from './resources/tools';
16
16
  export type { RespondToCallbackInput, VerifyCallbackInput } from './resources/tools';
@@ -1,5 +1,5 @@
1
1
  import type { AgentForgeClient } from '../client';
2
- import type { PublicAppBranding, AppSelf, AppSelfConnectors } from '../types';
2
+ import type { PublicAppBranding, AppSelf, AppSelfConnectors, AppSelfConnectorToolsResponse } from '../types';
3
3
  export declare class AppsResource {
4
4
  private readonly client;
5
5
  constructor(client: AgentForgeClient);
@@ -41,5 +41,22 @@ export declare class AppsResource {
41
41
  * by the App at runtime.
42
42
  */
43
43
  list: () => Promise<AppSelfConnectors>;
44
+ /**
45
+ * `GET /apps/me/connector-tools` (AGF-CTG-1) — flat tool-name catalog
46
+ * contributed by the connectors ENABLED for the App this client
47
+ * authenticated AS. App-level granularity ONLY: this is NOT narrowed
48
+ * per-end-user — that narrowing already happens downstream at runtime
49
+ * via `toolsForAppUser ∩ agent.tools[]`.
50
+ *
51
+ * Intended for a consumer bootstrap to DERIVE its connector-tool
52
+ * whitelist from the App's actually-enabled connectors instead of
53
+ * hardcoding tool names by hand — the top-level `toolNames` is the
54
+ * flat, de-duplicated union across every enabled connector.
55
+ *
56
+ * @example
57
+ * const { toolNames } = await af.apps.connectors.tools();
58
+ * const allowed = new Set(toolNames);
59
+ */
60
+ tools: () => Promise<AppSelfConnectorToolsResponse>;
44
61
  };
45
62
  }
@@ -35,6 +35,25 @@ class AppsResource {
35
35
  list: async () => {
36
36
  return this.client.request('GET', '/apps/me/connectors');
37
37
  },
38
+ /**
39
+ * `GET /apps/me/connector-tools` (AGF-CTG-1) — flat tool-name catalog
40
+ * contributed by the connectors ENABLED for the App this client
41
+ * authenticated AS. App-level granularity ONLY: this is NOT narrowed
42
+ * per-end-user — that narrowing already happens downstream at runtime
43
+ * via `toolsForAppUser ∩ agent.tools[]`.
44
+ *
45
+ * Intended for a consumer bootstrap to DERIVE its connector-tool
46
+ * whitelist from the App's actually-enabled connectors instead of
47
+ * hardcoding tool names by hand — the top-level `toolNames` is the
48
+ * flat, de-duplicated union across every enabled connector.
49
+ *
50
+ * @example
51
+ * const { toolNames } = await af.apps.connectors.tools();
52
+ * const allowed = new Set(toolNames);
53
+ */
54
+ tools: async () => {
55
+ return this.client.request('GET', '/apps/me/connector-tools');
56
+ },
38
57
  };
39
58
  }
40
59
  /**
@@ -11,6 +11,14 @@ export interface ProvisionedApp {
11
11
  publicKey: string;
12
12
  appSecret: string;
13
13
  }
14
+ /** `POST /platform/host-teams` result — a team-orchestrator's identity
15
+ * (AGF-SD-6a). No secret to reveal here (unlike `tenant()`/`app()`) — a
16
+ * team has no credential of its own, it's addressed through the
17
+ * tenant's `ak_live_` / App's `sk_live_`. */
18
+ export interface ProvisionedTeam {
19
+ teamId: string;
20
+ orchestratorAgentId: string;
21
+ }
14
22
  export declare class ProvisioningResource {
15
23
  private readonly client;
16
24
  constructor(client: AgentForgeClient);
@@ -49,4 +57,27 @@ export declare class ProvisioningResource {
49
57
  hostApp: string;
50
58
  hostRef?: string;
51
59
  }): Promise<ProvisionedApp>;
60
+ /**
61
+ * `POST /platform/host-teams` (AGF-SD-6a) — find-or-create a
62
+ * team-orchestrator for an EXISTING tenant on behalf of a trusted host
63
+ * app. Idempotent by `(tenantId, hostRef)`: a re-provision returns the
64
+ * SAME `teamId`/`orchestratorAgentId`, never a duplicate orchestrator.
65
+ *
66
+ * @param input.tenantId the tenant the team belongs to (host provisions
67
+ * it first via `tenant()`)
68
+ * @param input.hostApp short host id (e.g. "scrappydoc") — recorded
69
+ * for parity with `tenant()`/`app()`, not part of
70
+ * the idempotency key here (a team already lives
71
+ * under one tenant, so `(tenantId, hostRef)`
72
+ * alone is unambiguous)
73
+ * @param input.hostRef host reference (e.g. the workspaceId) — the
74
+ * idempotency key together with `tenantId`
75
+ * @param input.name display name, only used on first provision
76
+ */
77
+ team(input: {
78
+ tenantId: string;
79
+ hostApp: string;
80
+ hostRef: string;
81
+ name?: string;
82
+ }): Promise<ProvisionedTeam>;
52
83
  }
@@ -51,5 +51,30 @@ class ProvisioningResource {
51
51
  async app(input) {
52
52
  return this.client.request('POST', '/platform/host-apps', { tenantId: input.tenantId, hostApp: input.hostApp, hostRef: input.hostRef }, { headers: this.headers() });
53
53
  }
54
+ /**
55
+ * `POST /platform/host-teams` (AGF-SD-6a) — find-or-create a
56
+ * team-orchestrator for an EXISTING tenant on behalf of a trusted host
57
+ * app. Idempotent by `(tenantId, hostRef)`: a re-provision returns the
58
+ * SAME `teamId`/`orchestratorAgentId`, never a duplicate orchestrator.
59
+ *
60
+ * @param input.tenantId the tenant the team belongs to (host provisions
61
+ * it first via `tenant()`)
62
+ * @param input.hostApp short host id (e.g. "scrappydoc") — recorded
63
+ * for parity with `tenant()`/`app()`, not part of
64
+ * the idempotency key here (a team already lives
65
+ * under one tenant, so `(tenantId, hostRef)`
66
+ * alone is unambiguous)
67
+ * @param input.hostRef host reference (e.g. the workspaceId) — the
68
+ * idempotency key together with `tenantId`
69
+ * @param input.name display name, only used on first provision
70
+ */
71
+ async team(input) {
72
+ return this.client.request('POST', '/platform/host-teams', {
73
+ tenantId: input.tenantId,
74
+ hostApp: input.hostApp,
75
+ hostRef: input.hostRef,
76
+ name: input.name,
77
+ }, { headers: this.headers() });
78
+ }
54
79
  }
55
80
  exports.ProvisioningResource = ProvisioningResource;
package/dist/types.d.ts CHANGED
@@ -84,6 +84,16 @@ export interface AppSelfConnectors {
84
84
  mode: 'whitelist' | 'legacy';
85
85
  connectors: AppSelfConnector[];
86
86
  }
87
+ export interface AppSelfConnectorTools {
88
+ connectorId: string;
89
+ toolNames: string[];
90
+ }
91
+ export interface AppSelfConnectorToolsResponse {
92
+ connectors: AppSelfConnectorTools[];
93
+ /** Flat, de-duplicated union of every `toolNames` entry above — this is
94
+ * what a whitelist consumer actually wants. */
95
+ toolNames: string[];
96
+ }
87
97
  export interface RegisterToolInput {
88
98
  name: string;
89
99
  description: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.5.2",
3
+ "version": "4.5.3",
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",