@finalai/agents 0.13.0 → 0.14.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.
Files changed (30) hide show
  1. package/README.md +1 -1
  2. package/dist/modules/agent-client/channels.mjs +9 -1
  3. package/dist/modules/agent-client/channels.mjs.map +2 -2
  4. package/dist/modules/agent-client/client.d.mts +11 -1
  5. package/dist/modules/agent-client/client.mjs +9 -0
  6. package/dist/modules/agent-client/client.mjs.map +2 -2
  7. package/dist/modules/agent-client/conversations.d.mts +17 -25
  8. package/dist/modules/agent-client/conversations.mjs +10 -62
  9. package/dist/modules/agent-client/conversations.mjs.map +2 -2
  10. package/dist/modules/agent-client/index.d.mts +2 -0
  11. package/dist/modules/agent-client/index.mjs.map +2 -2
  12. package/dist/modules/agent-client/integrations.d.mts +5 -1
  13. package/dist/modules/agent-client/integrations.mjs +9 -1
  14. package/dist/modules/agent-client/integrations.mjs.map +2 -2
  15. package/dist/modules/agent-client/organization.d.mts +83 -0
  16. package/dist/modules/agent-client/organization.mjs +209 -0
  17. package/dist/modules/agent-client/organization.mjs.map +7 -0
  18. package/dist/modules/agent-client/participant-configuration.d.mts +21 -0
  19. package/dist/modules/agent-client/participant-configuration.mjs +38 -0
  20. package/dist/modules/agent-client/participant-configuration.mjs.map +7 -0
  21. package/dist/modules/agent-client/project.d.mts +3 -0
  22. package/dist/modules/agent-client/project.mjs +3 -1
  23. package/dist/modules/agent-client/project.mjs.map +2 -2
  24. package/dist/modules/agent-client/provide.d.mts +0 -1
  25. package/dist/modules/agent-client/provide.mjs +0 -1
  26. package/dist/modules/agent-client/provide.mjs.map +2 -2
  27. package/dist/modules/agent-client/sessions.d.mts +8 -1
  28. package/dist/modules/agent-client/sessions.mjs +24 -5
  29. package/dist/modules/agent-client/sessions.mjs.map +2 -2
  30. package/package.json +5 -5
@@ -8,6 +8,8 @@ export { DEFAULT_AGENTS_HOST, createClient, type AgentClientIface, type AgentsAp
8
8
  export { CollectionEventKind, CollectionResyncReason, type CollectionEvent, type CollectionEventsOptionsIface, type CollectionResyncEventIface, } from "./collection-events.mjs";
9
9
  export { ConfigOptionCategory, configSelectFor, configSelectsOf, type ConfigSelectChoiceIface, type ConfigSelectIface, type SessionConfigOptionIface, } from "./config-options.mjs";
10
10
  export type { EnumInput, SignalOptionsIface } from "./context.mjs";
11
+ export type { AllowedEndpointsApiIface, BudgetsApiIface, ModelCredentialGrantsApiIface, ModelCredentialsApiIface, OrganizationApiIface, OrganizationPolicyApiIface, SpendingRestrictionsApiIface, } from "./organization.mjs";
12
+ export type { ParticipantConfigurationApiIface } from "./participant-configuration.mjs";
11
13
  export type { ConversationChannelRoutesApiIface, ConversationContextApiIface, ConversationContextEntryInputIface, ConversationDecisionsApiIface, ConversationInputsApiIface, ConversationLabelsApiIface, ConversationReadGrantsApiIface, ConversationResourcesIface, ResourceSubscriptionsApiIface, SendInputArgsIface, } from "./conversation-resources.mjs";
12
14
  export { TURN_OPEN_SESSION_STATES, isNewerMessageVersion, messageVersionOf, type MessageVersionIface, } from "./conversations.mjs";
13
15
  export type { ConversationAgentTurnIface, ConversationEvent, ConversationEventMetaIface, ConversationEventsOptionsIface, ConversationHandleIface, ConversationsApiIface, CreateConversationArgsIface, ListMessagesOptionsIface, OpenedConversationIface, ParticipantCreateInput, ParticipantsApiIface, ProjectConversationsApiIface, SandboxFileContentArgsIface, SandboxFileContentRequestIface, SendMessageOptionsIface, SentMessageIface, UploadAttachmentArgsIface, } from "./conversations.mjs";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/agent-client/index.ts"],
4
- "sourcesContent": ["// `@finalai/agents/client`: the agent platform client SDK.\n// Wire types come from `@finalai/agent-protocol/agent-platform`, re-exported\n// here so consumers need one import.\n\nexport * from '@finalai/agent-protocol/agent-platform';\nexport {\n Capability,\n FilesAccess,\n ScreenAccess,\n ShellAccess,\n type CapabilityAccess,\n} from '@finalai/agent-protocol';\nexport { AcpAuthMode, type AcpApiIface, type AcpConnectArgsIface } from \"./acp.mjs\";\nexport {\n createTextCollector,\n isUserMessageFor,\n sessionUpdateOf,\n textOf,\n turnEndOf,\n type AcpSessionUpdateIface,\n type TurnEndIface,\n} from \"./acp-frames.mjs\";\nexport type { AgentInput, AgentValue, AgentValueCodecIface } from \"./agent-input.mjs\";\nexport type {\n ActorOptionIface,\n ChannelAppsApiIface,\n ChannelBindingsApiIface,\n ChannelSourceIface,\n ChannelSourceOf,\n ChannelTicketsApiIface,\n IdentityLinksApiIface,\n InstallChannelArgsIface,\n ProjectChannelsApiIface,\n PublishChannelArgsIface,\n UpdateChannelBindingArgsIface,\n} from \"./channels.mjs\";\nexport {\n DEFAULT_AGENTS_HOST,\n createClient,\n type AgentClientIface,\n type AgentsApiIface,\n type AppApiIface,\n type CreateClientOptionsIface,\n type DecisionsApiIface,\n type InferenceApiIface,\n type PeopleApiIface,\n type PlatformIdentityApiIface,\n type RealtimeApiIface,\n} from \"./client.mjs\";\nexport {\n CollectionEventKind,\n CollectionResyncReason,\n type CollectionEvent,\n type CollectionEventsOptionsIface,\n type CollectionResyncEventIface,\n} from \"./collection-events.mjs\";\nexport {\n ConfigOptionCategory,\n configSelectFor,\n configSelectsOf,\n type ConfigSelectChoiceIface,\n type ConfigSelectIface,\n type SessionConfigOptionIface,\n} from \"./config-options.mjs\";\nexport type { EnumInput, SignalOptionsIface } from \"./context.mjs\";\nexport type {\n ConversationChannelRoutesApiIface,\n ConversationContextApiIface,\n ConversationContextEntryInputIface,\n ConversationDecisionsApiIface,\n ConversationInputsApiIface,\n ConversationLabelsApiIface,\n ConversationReadGrantsApiIface,\n ConversationResourcesIface,\n ResourceSubscriptionsApiIface,\n SendInputArgsIface,\n} from \"./conversation-resources.mjs\";\nexport {\n TURN_OPEN_SESSION_STATES,\n isNewerMessageVersion,\n messageVersionOf,\n type MessageVersionIface,\n} from \"./conversations.mjs\";\nexport type {\n ConversationAgentTurnIface,\n ConversationEvent,\n ConversationEventMetaIface,\n ConversationEventsOptionsIface,\n ConversationHandleIface,\n ConversationsApiIface,\n CreateConversationArgsIface,\n ListMessagesOptionsIface,\n OpenedConversationIface,\n ParticipantCreateInput,\n ParticipantsApiIface,\n ProjectConversationsApiIface,\n SandboxFileContentArgsIface,\n SandboxFileContentRequestIface,\n SendMessageOptionsIface,\n SentMessageIface,\n UploadAttachmentArgsIface,\n} from \"./conversations.mjs\";\nexport {\n AgentClientErrorName,\n ClientErrorCode,\n DecisionErrorReason,\n clientError,\n decisionError,\n isClientError,\n isDecisionError,\n isRealtimeSubscriptionError,\n isRequirementsUnmetError,\n isTerminalRealtimeError,\n isTurnRejectedError,\n realtimeSubscriptionError,\n requirementsUnmetError,\n turnRejectedError,\n type AgentClientError,\n type ClientErrorIface,\n type DecisionErrorIface,\n type RealtimeSubscriptionErrorIface,\n type RequirementsUnmetErrorIface,\n type TurnRejectedErrorIface,\n} from \"./errors.mjs\";\nexport {\n EVENTS_POLL_INTERVAL_MS,\n type EventsApiIface,\n type EventSubscriptionsApiIface,\n type ListEventsOptionsIface,\n type StreamEventsOptionsIface,\n} from \"./events.mjs\";\nexport { defaultStreamTiming, type StreamTimingIface } from \"./frame-stream.mjs\";\nexport type { AgentClientAuth, FetchIface, HeadersOption } from \"./http.mjs\";\nexport type {\n AcpAdaptersApiIface,\n DefinitionSelectorIface,\n HarnessesApiIface,\n SubscriptionAllowancesApiIface,\n} from \"./harnesses.mjs\";\nexport type { IntegrationsApiIface } from \"./integrations.mjs\";\nexport { SessionLiveEventKind, type SessionLiveEvent } from \"./live-stream.mjs\";\nexport type { LocalComputeIface } from \"./local-host.mjs\";\nexport type { OAuthClientsApiIface, SignInReturnOriginsApiIface } from \"./oauth-clients.mjs\";\nexport type { ProjectClientIface } from \"./project.mjs\";\nexport type { AgentSelectorIface, ProjectAgentsApiIface } from \"./project-agents.mjs\";\nexport type {\n ProjectApiKeysApiIface,\n ProjectMembersApiIface,\n ProjectResourceApiIface,\n ProjectsApiIface,\n} from \"./projects.mjs\";\nexport type {\n ProjectPublisherApiIface,\n PublicNamesApiIface,\n PublisherHandleIface,\n PublishersApiIface,\n} from \"./publishers.mjs\";\nexport {\n provideDocumentOf,\n resourceIdOf,\n type ProvideIface,\n type ProvidePatchIface,\n type ResourceRef,\n type ResourceRefIface,\n} from \"./provide.mjs\";\nexport {\n createGatewayRealtimeTransport,\n type GatewayConnect,\n type GatewayConnectionIface,\n type GatewayRealtimeTransportOptionsIface,\n type RealtimeSubscribeOptionsIface,\n type RealtimeTransportFrameIface,\n type RealtimeTransportIface,\n} from \"./realtime.mjs\";\nexport {\n SANDBOX_FILE_URI_SCHEME,\n createSandboxFileUri,\n parseSandboxFileUri,\n type SandboxFileTargetIface,\n} from \"./sandbox-uri.mjs\";\nexport type { SandboxProvidersApiIface } from \"./sandbox-providers.mjs\";\nexport type {\n CreateSandboxOptionsIface,\n SandboxEnvironmentValueIface,\n SandboxHandleIface,\n SandboxOwnerIface,\n SandboxSetupRefIface,\n SandboxSetupsApiIface,\n SandboxesApiIface,\n} from \"./sandboxes.mjs\";\nexport type { ProjectSchedulesApiIface } from \"./schedules.mjs\";\nexport type {\n CreateSessionArgsIface,\n CreatedSessionIface,\n ForkSessionOptionsIface,\n ProjectSessionsApiIface,\n RespondArgs,\n SendOptionsIface,\n SessionHandleIface,\n SessionsApiIface,\n StreamOptionsIface,\n TurnHandleIface,\n TurnResultIface,\n} from \"./sessions.mjs\";\n"],
5
- "mappings": "AAIA,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,mBAA+D;AACxE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAeP;AAAA,EACE;AAAA,EACA;AAAA,OAUK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAcP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAoBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AACP;AAAA,EACE;AAAA,OAKK;AACP,SAAS,2BAAmD;AAS5D,SAAS,4BAAmD;AAiB5D;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,OAOK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;",
4
+ "sourcesContent": ["// `@finalai/agents/client`: the agent platform client SDK.\n// Wire types come from `@finalai/agent-protocol/agent-platform`, re-exported\n// here so consumers need one import.\n\nexport * from '@finalai/agent-protocol/agent-platform';\nexport {\n Capability,\n FilesAccess,\n ScreenAccess,\n ShellAccess,\n type CapabilityAccess,\n} from '@finalai/agent-protocol';\nexport { AcpAuthMode, type AcpApiIface, type AcpConnectArgsIface } from \"./acp.mjs\";\nexport {\n createTextCollector,\n isUserMessageFor,\n sessionUpdateOf,\n textOf,\n turnEndOf,\n type AcpSessionUpdateIface,\n type TurnEndIface,\n} from \"./acp-frames.mjs\";\nexport type { AgentInput, AgentValue, AgentValueCodecIface } from \"./agent-input.mjs\";\nexport type {\n ActorOptionIface,\n ChannelAppsApiIface,\n ChannelBindingsApiIface,\n ChannelSourceIface,\n ChannelSourceOf,\n ChannelTicketsApiIface,\n IdentityLinksApiIface,\n InstallChannelArgsIface,\n ProjectChannelsApiIface,\n PublishChannelArgsIface,\n UpdateChannelBindingArgsIface,\n} from \"./channels.mjs\";\nexport {\n DEFAULT_AGENTS_HOST,\n createClient,\n type AgentClientIface,\n type AgentsApiIface,\n type AppApiIface,\n type CreateClientOptionsIface,\n type DecisionsApiIface,\n type InferenceApiIface,\n type PeopleApiIface,\n type PlatformIdentityApiIface,\n type RealtimeApiIface,\n} from \"./client.mjs\";\nexport {\n CollectionEventKind,\n CollectionResyncReason,\n type CollectionEvent,\n type CollectionEventsOptionsIface,\n type CollectionResyncEventIface,\n} from \"./collection-events.mjs\";\nexport {\n ConfigOptionCategory,\n configSelectFor,\n configSelectsOf,\n type ConfigSelectChoiceIface,\n type ConfigSelectIface,\n type SessionConfigOptionIface,\n} from \"./config-options.mjs\";\nexport type { EnumInput, SignalOptionsIface } from \"./context.mjs\";\nexport type {\n AllowedEndpointsApiIface,\n BudgetsApiIface,\n ModelCredentialGrantsApiIface,\n ModelCredentialsApiIface,\n OrganizationApiIface,\n OrganizationPolicyApiIface,\n SpendingRestrictionsApiIface,\n} from \"./organization.mjs\";\nexport type { ParticipantConfigurationApiIface } from \"./participant-configuration.mjs\";\nexport type {\n ConversationChannelRoutesApiIface,\n ConversationContextApiIface,\n ConversationContextEntryInputIface,\n ConversationDecisionsApiIface,\n ConversationInputsApiIface,\n ConversationLabelsApiIface,\n ConversationReadGrantsApiIface,\n ConversationResourcesIface,\n ResourceSubscriptionsApiIface,\n SendInputArgsIface,\n} from \"./conversation-resources.mjs\";\nexport {\n TURN_OPEN_SESSION_STATES,\n isNewerMessageVersion,\n messageVersionOf,\n type MessageVersionIface,\n} from \"./conversations.mjs\";\nexport type {\n ConversationAgentTurnIface,\n ConversationEvent,\n ConversationEventMetaIface,\n ConversationEventsOptionsIface,\n ConversationHandleIface,\n ConversationsApiIface,\n CreateConversationArgsIface,\n ListMessagesOptionsIface,\n OpenedConversationIface,\n ParticipantCreateInput,\n ParticipantsApiIface,\n ProjectConversationsApiIface,\n SandboxFileContentArgsIface,\n SandboxFileContentRequestIface,\n SendMessageOptionsIface,\n SentMessageIface,\n UploadAttachmentArgsIface,\n} from \"./conversations.mjs\";\nexport {\n AgentClientErrorName,\n ClientErrorCode,\n DecisionErrorReason,\n clientError,\n decisionError,\n isClientError,\n isDecisionError,\n isRealtimeSubscriptionError,\n isRequirementsUnmetError,\n isTerminalRealtimeError,\n isTurnRejectedError,\n realtimeSubscriptionError,\n requirementsUnmetError,\n turnRejectedError,\n type AgentClientError,\n type ClientErrorIface,\n type DecisionErrorIface,\n type RealtimeSubscriptionErrorIface,\n type RequirementsUnmetErrorIface,\n type TurnRejectedErrorIface,\n} from \"./errors.mjs\";\nexport {\n EVENTS_POLL_INTERVAL_MS,\n type EventsApiIface,\n type EventSubscriptionsApiIface,\n type ListEventsOptionsIface,\n type StreamEventsOptionsIface,\n} from \"./events.mjs\";\nexport { defaultStreamTiming, type StreamTimingIface } from \"./frame-stream.mjs\";\nexport type { AgentClientAuth, FetchIface, HeadersOption } from \"./http.mjs\";\nexport type {\n AcpAdaptersApiIface,\n DefinitionSelectorIface,\n HarnessesApiIface,\n SubscriptionAllowancesApiIface,\n} from \"./harnesses.mjs\";\nexport type { IntegrationsApiIface } from \"./integrations.mjs\";\nexport { SessionLiveEventKind, type SessionLiveEvent } from \"./live-stream.mjs\";\nexport type { LocalComputeIface } from \"./local-host.mjs\";\nexport type { OAuthClientsApiIface, SignInReturnOriginsApiIface } from \"./oauth-clients.mjs\";\nexport type { ProjectClientIface } from \"./project.mjs\";\nexport type { AgentSelectorIface, ProjectAgentsApiIface } from \"./project-agents.mjs\";\nexport type {\n ProjectApiKeysApiIface,\n ProjectMembersApiIface,\n ProjectResourceApiIface,\n ProjectsApiIface,\n} from \"./projects.mjs\";\nexport type {\n ProjectPublisherApiIface,\n PublicNamesApiIface,\n PublisherHandleIface,\n PublishersApiIface,\n} from \"./publishers.mjs\";\nexport {\n provideDocumentOf,\n resourceIdOf,\n type ProvideIface,\n type ProvidePatchIface,\n type ResourceRef,\n type ResourceRefIface,\n} from \"./provide.mjs\";\nexport {\n createGatewayRealtimeTransport,\n type GatewayConnect,\n type GatewayConnectionIface,\n type GatewayRealtimeTransportOptionsIface,\n type RealtimeSubscribeOptionsIface,\n type RealtimeTransportFrameIface,\n type RealtimeTransportIface,\n} from \"./realtime.mjs\";\nexport {\n SANDBOX_FILE_URI_SCHEME,\n createSandboxFileUri,\n parseSandboxFileUri,\n type SandboxFileTargetIface,\n} from \"./sandbox-uri.mjs\";\nexport type { SandboxProvidersApiIface } from \"./sandbox-providers.mjs\";\nexport type {\n CreateSandboxOptionsIface,\n SandboxEnvironmentValueIface,\n SandboxHandleIface,\n SandboxOwnerIface,\n SandboxSetupRefIface,\n SandboxSetupsApiIface,\n SandboxesApiIface,\n} from \"./sandboxes.mjs\";\nexport type { ProjectSchedulesApiIface } from \"./schedules.mjs\";\nexport type {\n CreateSessionArgsIface,\n CreatedSessionIface,\n ForkSessionOptionsIface,\n ProjectSessionsApiIface,\n RespondArgs,\n SendOptionsIface,\n SessionHandleIface,\n SessionsApiIface,\n StreamOptionsIface,\n TurnHandleIface,\n TurnResultIface,\n} from \"./sessions.mjs\";\n"],
5
+ "mappings": "AAIA,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,mBAA+D;AACxE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAeP;AAAA,EACE;AAAA,EACA;AAAA,OAUK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAwBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAoBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AACP;AAAA,EACE;AAAA,OAKK;AACP,SAAS,2BAAmD;AAS5D,SAAS,4BAAmD;AAiB5D;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,OAOK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { type CompleteSignInResponseIface, type CreateIntegrationRequestIface, type IntegrationIface, type IntegrationListIface, type StartSignInResponseIface } from '@finalai/agent-protocol/agent-platform';
1
+ import { type CompleteSignInResponseIface, type CreateIntegrationRequestIface, type IntegrationIface, type IntegrationListIface, type StartSignInResponseIface, type UpdateIntegrationRequestIface } from '@finalai/agent-protocol/agent-platform';
2
2
  import { type ClientContextIface, type SignalOptionsIface } from "./context.mjs";
3
3
  export interface IntegrationsApiIface {
4
4
  /** Names are unique in a project. Returns the integration; pass it in `provide.integrations`. */
@@ -12,6 +12,10 @@ export interface IntegrationsApiIface {
12
12
  cursor?: string;
13
13
  limit?: number;
14
14
  }) => Promise<IntegrationListIface>;
15
+ /** Changes it in place: the id, and so every `provide` naming it, stays. */
16
+ update: (args: {
17
+ id: string;
18
+ } & UpdateIntegrationRequestIface & SignalOptionsIface) => Promise<IntegrationIface>;
15
19
  delete: (args: {
16
20
  id: string;
17
21
  } & SignalOptionsIface) => Promise<void>;
@@ -6,7 +6,8 @@ import {
6
6
  integrationSchema,
7
7
  okResponseSchema,
8
8
  startSignInRequestSchema,
9
- startSignInResponseSchema
9
+ startSignInResponseSchema,
10
+ updateIntegrationRequestSchema
10
11
  } from "@finalai/agent-protocol/agent-platform";
11
12
  import { encodePath } from "./context.mjs";
12
13
  import { clientError, ClientErrorCode } from "./errors.mjs";
@@ -54,6 +55,13 @@ const createIntegrationsApi = (args) => {
54
55
  response: integrationListSchema,
55
56
  signal: options?.signal
56
57
  }),
58
+ update: ({ id, signal, ...value }) => http.request({
59
+ method: HttpMethod.Patch,
60
+ path: integrationPath(id),
61
+ body: { schema: updateIntegrationRequestSchema, value },
62
+ response: integrationSchema,
63
+ signal
64
+ }),
57
65
  delete: async ({ id, signal }) => {
58
66
  await http.request({
59
67
  method: HttpMethod.Delete,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/agent-client/integrations.ts"],
4
- "sourcesContent": ["import {\n completeSignInRequestSchema,\n completeSignInResponseSchema,\n createIntegrationRequestSchema,\n integrationListSchema,\n integrationSchema,\n okResponseSchema,\n startSignInRequestSchema,\n startSignInResponseSchema,\n type CompleteSignInResponseIface,\n type CreateIntegrationRequestIface,\n type IntegrationIface,\n type IntegrationListIface,\n type StartSignInResponseIface,\n} from '@finalai/agent-protocol/agent-platform';\nimport { encodePath, type ClientContextIface, type SignalOptionsIface } from \"./context.mjs\";\nimport { clientError, ClientErrorCode } from \"./errors.mjs\";\nimport { HttpMethod } from \"./http.mjs\";\n\n// Integrations (sources of tools: MCP servers, Final's gateway among them),\n// scoped to one project.\n\nexport interface IntegrationsApiIface {\n /** Names are unique in a project. Returns the integration; pass it in `provide.integrations`. */\n create: (args: CreateIntegrationRequestIface & SignalOptionsIface) => Promise<IntegrationIface>;\n get: (\n selector: ({ name: string } | { id: string }) & SignalOptionsIface,\n ) => Promise<IntegrationIface>;\n list: (\n options?: SignalOptionsIface & { cursor?: string; limit?: number },\n ) => Promise<IntegrationListIface>;\n delete: (args: { id: string } & SignalOptionsIface) => Promise<void>;\n /**\n * Starts the caller's own sign-in: an authorization URL to open. Pass the\n * sign-in decision's id to resolve it when the sign-in completes.\n */\n signIn: (\n args: { id: string; returnUrl?: string; decisionId?: string } & SignalOptionsIface,\n ) => Promise<StartSignInResponseIface>;\n /** Activates a sign-in with the `state` and `code` the provider redirected with. */\n completeSignIn: (\n args: { state: string; code: string } & SignalOptionsIface,\n ) => Promise<CompleteSignInResponseIface>;\n /** Forgets the caller's own sign-in. */\n signOut: (args: { id: string } & SignalOptionsIface) => Promise<void>;\n}\n\nconst projectPath = (projectId: string, suffix: string): string =>\n `/v1/projects/${encodePath(projectId)}${suffix}`;\n\nexport const createIntegrationsApi = (args: {\n context: ClientContextIface;\n projectId: string;\n}): IntegrationsApiIface => {\n const { http } = args.context;\n const integrationPath = (id: string, suffix = '') =>\n projectPath(args.projectId, `/integrations/${encodePath(id)}${suffix}`);\n return {\n create: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: projectPath(args.projectId, '/integrations'),\n body: { schema: createIntegrationRequestSchema, value },\n response: integrationSchema,\n signal,\n }),\n get: async ({ signal, ...selector }) => {\n if ('id' in selector)\n return http.request({\n method: HttpMethod.Get,\n path: integrationPath(selector.id),\n response: integrationSchema,\n signal,\n });\n const { integrations } = await http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, '/integrations'),\n query: { name: selector.name },\n response: integrationListSchema,\n signal,\n });\n const found = integrations.find((integration) => integration.name === selector.name);\n if (found == null)\n throw clientError({\n message: `No integration named ${selector.name} in this project`,\n status: 404,\n code: ClientErrorCode.NotFound,\n });\n return found;\n },\n list: (options) =>\n http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, '/integrations'),\n query: { cursor: options?.cursor, limit: options?.limit },\n response: integrationListSchema,\n signal: options?.signal,\n }),\n delete: async ({ id, signal }) => {\n await http.request({\n method: HttpMethod.Delete,\n path: integrationPath(id),\n response: okResponseSchema,\n signal,\n });\n },\n signIn: ({ id, signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: integrationPath(id, '/sign-in'),\n body: { schema: startSignInRequestSchema, value },\n response: startSignInResponseSchema,\n signal,\n }),\n completeSignIn: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: '/v1/sign-ins/complete',\n body: { schema: completeSignInRequestSchema, value },\n response: completeSignInResponseSchema,\n signal,\n }),\n signOut: async ({ id, signal }) => {\n await http.request({\n method: HttpMethod.Delete,\n path: integrationPath(id, '/sign-in'),\n response: okResponseSchema,\n signal,\n });\n },\n };\n};\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AACP,SAAS,kBAAoE;AAC7E,SAAS,aAAa,uBAAuB;AAC7C,SAAS,kBAAkB;AA8B3B,MAAM,cAAc,CAAC,WAAmB,WACtC,gBAAgB,WAAW,SAAS,CA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SAAS,MAAM;AAAA,MACxD,UAAU;AAAA,MACV,QAAQ,SAAS;AAAA,IACnB,CAAC;AAAA,IACH,QAAQ,OAAO,EAAE,IAAI,OAAO,MAAM;AAChC,YAAM,KAAK,QAAQ;AAAA,QACjB,QAAQ,WAAW;AAAA,QACnB,MAAM,gBAAgB,EAAE;AAAA,QACxB,UAAU;AAAA,QACV;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,QAAQ,CAAC,EAAE,IAAI,QAAQ,GAAG,MAAM,MAC9B,KAAK,QAAQ;AAAA,MACX,QAAQ,WAAW;AAAA,MACnB,MAAM,gBAAgB,IAAI,UAAU;AAAA,MACpC,MAAM,EAAE,QAAQ,0BAA0B,MAAM;AAAA,MAChD,UAAU;AAAA,MACV;AAAA,IACF,CAAC;AAAA,IACH,gBAAgB,CAAC,EAAE,QAAQ,GAAG,MAAM,MAClC,KAAK,QAAQ;AAAA,MACX,QAAQ,WAAW;AAAA,MACnB,MAAM;AAAA,MACN,MAAM,EAAE,QAAQ,6BAA6B,MAAM;AAAA,MACnD,UAAU;AAAA,MACV;AAAA,IACF,CAAC;AAAA,IACH,SAAS,OAAO,EAAE,IAAI,OAAO,MAAM;AACjC,YAAM,KAAK,QAAQ;AAAA,QACjB,QAAQ,WAAW;AAAA,QACnB,MAAM,gBAAgB,IAAI,UAAU;AAAA,QACpC,UAAU;AAAA,QACV;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import {\n completeSignInRequestSchema,\n completeSignInResponseSchema,\n createIntegrationRequestSchema,\n integrationListSchema,\n integrationSchema,\n okResponseSchema,\n startSignInRequestSchema,\n startSignInResponseSchema,\n updateIntegrationRequestSchema,\n type CompleteSignInResponseIface,\n type CreateIntegrationRequestIface,\n type IntegrationIface,\n type IntegrationListIface,\n type StartSignInResponseIface,\n type UpdateIntegrationRequestIface,\n} from '@finalai/agent-protocol/agent-platform';\nimport { encodePath, type ClientContextIface, type SignalOptionsIface } from \"./context.mjs\";\nimport { clientError, ClientErrorCode } from \"./errors.mjs\";\nimport { HttpMethod } from \"./http.mjs\";\n\n// Integrations (sources of tools: MCP servers, Final's gateway among them),\n// scoped to one project.\n\nexport interface IntegrationsApiIface {\n /** Names are unique in a project. Returns the integration; pass it in `provide.integrations`. */\n create: (args: CreateIntegrationRequestIface & SignalOptionsIface) => Promise<IntegrationIface>;\n get: (\n selector: ({ name: string } | { id: string }) & SignalOptionsIface,\n ) => Promise<IntegrationIface>;\n list: (\n options?: SignalOptionsIface & { cursor?: string; limit?: number },\n ) => Promise<IntegrationListIface>;\n /** Changes it in place: the id, and so every `provide` naming it, stays. */\n update: (\n args: { id: string } & UpdateIntegrationRequestIface & SignalOptionsIface,\n ) => Promise<IntegrationIface>;\n delete: (args: { id: string } & SignalOptionsIface) => Promise<void>;\n /**\n * Starts the caller's own sign-in: an authorization URL to open. Pass the\n * sign-in decision's id to resolve it when the sign-in completes.\n */\n signIn: (\n args: { id: string; returnUrl?: string; decisionId?: string } & SignalOptionsIface,\n ) => Promise<StartSignInResponseIface>;\n /** Activates a sign-in with the `state` and `code` the provider redirected with. */\n completeSignIn: (\n args: { state: string; code: string } & SignalOptionsIface,\n ) => Promise<CompleteSignInResponseIface>;\n /** Forgets the caller's own sign-in. */\n signOut: (args: { id: string } & SignalOptionsIface) => Promise<void>;\n}\n\nconst projectPath = (projectId: string, suffix: string): string =>\n `/v1/projects/${encodePath(projectId)}${suffix}`;\n\nexport const createIntegrationsApi = (args: {\n context: ClientContextIface;\n projectId: string;\n}): IntegrationsApiIface => {\n const { http } = args.context;\n const integrationPath = (id: string, suffix = '') =>\n projectPath(args.projectId, `/integrations/${encodePath(id)}${suffix}`);\n return {\n create: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: projectPath(args.projectId, '/integrations'),\n body: { schema: createIntegrationRequestSchema, value },\n response: integrationSchema,\n signal,\n }),\n get: async ({ signal, ...selector }) => {\n if ('id' in selector)\n return http.request({\n method: HttpMethod.Get,\n path: integrationPath(selector.id),\n response: integrationSchema,\n signal,\n });\n const { integrations } = await http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, '/integrations'),\n query: { name: selector.name },\n response: integrationListSchema,\n signal,\n });\n const found = integrations.find((integration) => integration.name === selector.name);\n if (found == null)\n throw clientError({\n message: `No integration named ${selector.name} in this project`,\n status: 404,\n code: ClientErrorCode.NotFound,\n });\n return found;\n },\n list: (options) =>\n http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, '/integrations'),\n query: { cursor: options?.cursor, limit: options?.limit },\n response: integrationListSchema,\n signal: options?.signal,\n }),\n update: ({ id, signal, ...value }) =>\n http.request({\n method: HttpMethod.Patch,\n path: integrationPath(id),\n body: { schema: updateIntegrationRequestSchema, value },\n response: integrationSchema,\n signal,\n }),\n delete: async ({ id, signal }) => {\n await http.request({\n method: HttpMethod.Delete,\n path: integrationPath(id),\n response: okResponseSchema,\n signal,\n });\n },\n signIn: ({ id, signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: integrationPath(id, '/sign-in'),\n body: { schema: startSignInRequestSchema, value },\n response: startSignInResponseSchema,\n signal,\n }),\n completeSignIn: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: '/v1/sign-ins/complete',\n body: { schema: completeSignInRequestSchema, value },\n response: completeSignInResponseSchema,\n signal,\n }),\n signOut: async ({ id, signal }) => {\n await http.request({\n method: HttpMethod.Delete,\n path: integrationPath(id, '/sign-in'),\n response: okResponseSchema,\n signal,\n });\n },\n };\n};\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AACP,SAAS,kBAAoE;AAC7E,SAAS,aAAa,uBAAuB;AAC7C,SAAS,kBAAkB;AAkC3B,MAAM,cAAc,CAAC,WAAmB,WACtC,gBAAgB,WAAW,SAAS,CAAC,GAAG,M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;AAAA,MACxD,UAAU;AAAA,MACV,QAAQ,SAAS;AAAA,IACnB,CAAC;AAAA,IACH,QAAQ,CAAC,EAAE,IAAI,QAAQ,GAAG,MAAM,MAC9B,KAAK,QAAQ;AAAA,MACX,QAAQ,WAAW;AAAA,MACnB,MAAM,gBAAgB,EAAE;AAAA,MACxB,MAAM,EAAE,QAAQ,gCAAgC,MAAM;AAAA,MACtD,UAAU;AAAA,MACV;AAAA,IACF,CAAC;AAAA,IACH,QAAQ,OAAO,EAAE,IAAI,OAAO,MAAM;AAChC,YAAM,KAAK,QAAQ;AAAA,QACjB,QAAQ,WAAW;AAAA,QACnB,MAAM,gBAAgB,EAAE;AAAA,QACxB,UAAU;AAAA,QACV;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,QAAQ,CAAC,EAAE,IAAI,QAAQ,GAAG,MAAM,MAC9B,KAAK,QAAQ;AAAA,MACX,QAAQ,WAAW;AAAA,MACnB,MAAM,gBAAgB,IAAI,UAAU;AAAA,MACpC,MAAM,EAAE,QAAQ,0BAA0B,MAAM;AAAA,MAChD,UAAU;AAAA,MACV;AAAA,IACF,CAAC;AAAA,IACH,gBAAgB,CAAC,EAAE,QAAQ,GAAG,MAAM,MAClC,KAAK,QAAQ;AAAA,MACX,QAAQ,WAAW;AAAA,MACnB,MAAM;AAAA,MACN,MAAM,EAAE,QAAQ,6BAA6B,MAAM;AAAA,MACnD,UAAU;AAAA,MACV;AAAA,IACF,CAAC;AAAA,IACH,SAAS,OAAO,EAAE,IAAI,OAAO,MAAM;AACjC,YAAM,KAAK,QAAQ;AAAA,QACjB,QAAQ,WAAW;AAAA,QACnB,MAAM,gBAAgB,IAAI,UAAU;AAAA,QACpC,UAAU;AAAA,QACV;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,83 @@
1
+ import { type AddAllowedEndpointRequestIface, type AllowedEndpointIface, type BudgetIface, type ChatGptSubscriptionChallengeIface, type ChatGptSubscriptionPollIface, type ConnectApiKeyRequestIface, type ConnectClaudeSubscriptionRequestIface, type CreateBudgetRequestIface, type CreateModelCredentialGrantRequestIface, type ModelCredentialGrantIface, type ModelCredentialIface, type OrganizationAgentPolicyIface, type PlatformSpendingRestrictionsIface, type StartChatGptSubscriptionRequestIface, type UpdateModelCredentialRequestIface, type UpdateOrganizationAgentPolicyRequestIface, type UpdatePlatformSpendingRestrictionsRequestIface } from '@finalai/agent-protocol/agent-platform';
2
+ import { type ClientContextIface, type SignalOptionsIface } from "./context.mjs";
3
+ export interface ModelCredentialGrantsApiIface {
4
+ list: (args: {
5
+ credentialId: string;
6
+ } & SignalOptionsIface) => Promise<ModelCredentialGrantIface[]>;
7
+ /** Shares the credential with a project or a member; idempotent per grantee. */
8
+ create: (args: {
9
+ credentialId: string;
10
+ } & CreateModelCredentialGrantRequestIface & SignalOptionsIface) => Promise<ModelCredentialGrantIface>;
11
+ revoke: (args: {
12
+ credentialId: string;
13
+ grantId: string;
14
+ } & SignalOptionsIface) => Promise<void>;
15
+ }
16
+ /** The subscriptions and API keys the caller's projects run models with. */
17
+ export interface ModelCredentialsApiIface {
18
+ /** The caller's credentials; with `projectId`, that project's and those it inherits. */
19
+ list: (options?: {
20
+ projectId?: string;
21
+ } & SignalOptionsIface) => Promise<ModelCredentialIface[]>;
22
+ connectApiKey: (args: ConnectApiKeyRequestIface & SignalOptionsIface) => Promise<ModelCredentialIface>;
23
+ connectClaudeSubscription: (args: ConnectClaudeSubscriptionRequestIface & SignalOptionsIface) => Promise<ModelCredentialIface>;
24
+ /** Starts a device-code sign-in; poll it with the returned `state`. */
25
+ startChatGptSubscription: (args: StartChatGptSubscriptionRequestIface & SignalOptionsIface) => Promise<ChatGptSubscriptionChallengeIface>;
26
+ pollChatGptSubscription: (args: {
27
+ state: string;
28
+ } & SignalOptionsIface) => Promise<ChatGptSubscriptionPollIface>;
29
+ /** The owner's settings (an editor of the credential's project). */
30
+ update: (args: {
31
+ credentialId: string;
32
+ } & UpdateModelCredentialRequestIface & SignalOptionsIface) => Promise<ModelCredentialIface>;
33
+ /** Clears a subscription's remembered limit after the vendor reset it. */
34
+ resetUsage: (args: {
35
+ credentialId: string;
36
+ } & SignalOptionsIface) => Promise<ModelCredentialIface>;
37
+ disconnect: (args: {
38
+ credentialId: string;
39
+ } & SignalOptionsIface) => Promise<void>;
40
+ /** Who else may use a credential (its managers only). */
41
+ grants: ModelCredentialGrantsApiIface;
42
+ }
43
+ /** Spend limits; organization admins write them. */
44
+ export interface BudgetsApiIface {
45
+ list: (options?: SignalOptionsIface) => Promise<BudgetIface[]>;
46
+ create: (args: CreateBudgetRequestIface & SignalOptionsIface) => Promise<BudgetIface>;
47
+ update: (args: {
48
+ budgetId: string;
49
+ } & CreateBudgetRequestIface & SignalOptionsIface) => Promise<BudgetIface>;
50
+ delete: (args: {
51
+ budgetId: string;
52
+ } & SignalOptionsIface) => Promise<void>;
53
+ }
54
+ /** The organization's provider gates and turn limits; organization admins update it. */
55
+ export interface OrganizationPolicyApiIface {
56
+ get: (options?: SignalOptionsIface) => Promise<OrganizationAgentPolicyIface>;
57
+ update: (args: UpdateOrganizationAgentPolicyRequestIface & SignalOptionsIface) => Promise<OrganizationAgentPolicyIface>;
58
+ }
59
+ /** Who may spend the platform's own metered inference; organization admins update it. */
60
+ export interface SpendingRestrictionsApiIface {
61
+ get: (options?: SignalOptionsIface) => Promise<PlatformSpendingRestrictionsIface>;
62
+ update: (args: UpdatePlatformSpendingRestrictionsRequestIface & SignalOptionsIface) => Promise<PlatformSpendingRestrictionsIface>;
63
+ }
64
+ /** The caller's organization: model credentials, budgets and policies. */
65
+ export interface OrganizationApiIface {
66
+ modelCredentials: ModelCredentialsApiIface;
67
+ budgets: BudgetsApiIface;
68
+ policy: OrganizationPolicyApiIface;
69
+ spendingRestrictions: SpendingRestrictionsApiIface;
70
+ }
71
+ /** Where a project lets its secrets go beyond model vendors' own APIs; its admins change it. */
72
+ export interface AllowedEndpointsApiIface {
73
+ list: (options?: SignalOptionsIface) => Promise<AllowedEndpointIface[]>;
74
+ add: (args: AddAllowedEndpointRequestIface & SignalOptionsIface) => Promise<AllowedEndpointIface>;
75
+ remove: (args: {
76
+ endpointId: string;
77
+ } & SignalOptionsIface) => Promise<void>;
78
+ }
79
+ export declare const createOrganizationApi: (context: ClientContextIface) => OrganizationApiIface;
80
+ export declare const createAllowedEndpointsApi: (args: {
81
+ context: ClientContextIface;
82
+ projectId: string;
83
+ }) => AllowedEndpointsApiIface;
@@ -0,0 +1,209 @@
1
+ import {
2
+ addAllowedEndpointRequestSchema,
3
+ allowedEndpointSchema,
4
+ budgetListSchema,
5
+ budgetSchema,
6
+ chatGptSubscriptionChallengeSchema,
7
+ chatGptSubscriptionPollSchema,
8
+ connectApiKeyRequestSchema,
9
+ connectClaudeSubscriptionRequestSchema,
10
+ createBudgetRequestSchema,
11
+ createModelCredentialGrantRequestSchema,
12
+ listAllowedEndpointsResponseSchema,
13
+ modelCredentialGrantListSchema,
14
+ modelCredentialGrantSchema,
15
+ modelCredentialListSchema,
16
+ modelCredentialSchema,
17
+ okResponseSchema,
18
+ organizationAgentPolicySchema,
19
+ platformSpendingRestrictionsSchema,
20
+ pollChatGptSubscriptionRequestSchema,
21
+ startChatGptSubscriptionRequestSchema,
22
+ updateModelCredentialRequestSchema,
23
+ updateOrganizationAgentPolicyRequestSchema,
24
+ updatePlatformSpendingRestrictionsRequestSchema
25
+ } from "@finalai/agent-protocol/agent-platform";
26
+ import { encodePath } from "./context.mjs";
27
+ import { HttpMethod } from "./http.mjs";
28
+ const credentialPath = (credentialId, suffix = "") => `/v1/model-credentials/${encodePath(credentialId)}${suffix}`;
29
+ const createModelCredentialsApi = ({ http }) => ({
30
+ list: async (options) => (await http.request({
31
+ method: HttpMethod.Get,
32
+ path: "/v1/model-credentials",
33
+ query: { projectId: options?.projectId },
34
+ response: modelCredentialListSchema,
35
+ signal: options?.signal
36
+ })).credentials,
37
+ connectApiKey: ({ signal, ...value }) => http.request({
38
+ method: HttpMethod.Post,
39
+ path: "/v1/model-credentials",
40
+ body: { schema: connectApiKeyRequestSchema, value },
41
+ response: modelCredentialSchema,
42
+ signal
43
+ }),
44
+ connectClaudeSubscription: ({ signal, ...value }) => http.request({
45
+ method: HttpMethod.Post,
46
+ path: "/v1/model-credentials/subscriptions/claude",
47
+ body: { schema: connectClaudeSubscriptionRequestSchema, value },
48
+ response: modelCredentialSchema,
49
+ signal
50
+ }),
51
+ startChatGptSubscription: ({ signal, ...value }) => http.request({
52
+ method: HttpMethod.Post,
53
+ path: "/v1/model-credentials/subscriptions/chatgpt/start",
54
+ body: { schema: startChatGptSubscriptionRequestSchema, value },
55
+ response: chatGptSubscriptionChallengeSchema,
56
+ signal
57
+ }),
58
+ pollChatGptSubscription: ({ signal, ...value }) => http.request({
59
+ method: HttpMethod.Post,
60
+ path: "/v1/model-credentials/subscriptions/chatgpt/poll",
61
+ body: { schema: pollChatGptSubscriptionRequestSchema, value },
62
+ response: chatGptSubscriptionPollSchema,
63
+ signal
64
+ }),
65
+ update: ({ credentialId, signal, ...value }) => http.request({
66
+ method: HttpMethod.Patch,
67
+ path: credentialPath(credentialId),
68
+ body: { schema: updateModelCredentialRequestSchema, value },
69
+ response: modelCredentialSchema,
70
+ signal
71
+ }),
72
+ resetUsage: ({ credentialId, signal }) => http.request({
73
+ method: HttpMethod.Patch,
74
+ path: credentialPath(credentialId),
75
+ body: { schema: updateModelCredentialRequestSchema, value: { resetUsage: true } },
76
+ response: modelCredentialSchema,
77
+ signal
78
+ }),
79
+ disconnect: async ({ credentialId, signal }) => {
80
+ await http.request({
81
+ method: HttpMethod.Delete,
82
+ path: credentialPath(credentialId),
83
+ response: okResponseSchema,
84
+ signal
85
+ });
86
+ },
87
+ grants: {
88
+ list: async ({ credentialId, signal }) => (await http.request({
89
+ method: HttpMethod.Get,
90
+ path: credentialPath(credentialId, "/grants"),
91
+ response: modelCredentialGrantListSchema,
92
+ signal
93
+ })).grants,
94
+ create: ({ credentialId, signal, ...value }) => http.request({
95
+ method: HttpMethod.Post,
96
+ path: credentialPath(credentialId, "/grants"),
97
+ body: { schema: createModelCredentialGrantRequestSchema, value },
98
+ response: modelCredentialGrantSchema,
99
+ signal
100
+ }),
101
+ revoke: async ({ credentialId, grantId, signal }) => {
102
+ await http.request({
103
+ method: HttpMethod.Delete,
104
+ path: credentialPath(credentialId, `/grants/${encodePath(grantId)}`),
105
+ response: okResponseSchema,
106
+ signal
107
+ });
108
+ }
109
+ }
110
+ });
111
+ const createBudgetsApi = ({ http }) => ({
112
+ list: async (options) => (await http.request({
113
+ method: HttpMethod.Get,
114
+ path: "/v1/budgets",
115
+ response: budgetListSchema,
116
+ signal: options?.signal
117
+ })).budgets,
118
+ create: ({ signal, ...value }) => http.request({
119
+ method: HttpMethod.Post,
120
+ path: "/v1/budgets",
121
+ body: { schema: createBudgetRequestSchema, value },
122
+ response: budgetSchema,
123
+ signal
124
+ }),
125
+ update: ({ budgetId, signal, ...value }) => http.request({
126
+ method: HttpMethod.Put,
127
+ path: `/v1/budgets/${encodePath(budgetId)}`,
128
+ body: { schema: createBudgetRequestSchema, value },
129
+ response: budgetSchema,
130
+ signal
131
+ }),
132
+ delete: async ({ budgetId, signal }) => {
133
+ await http.request({
134
+ method: HttpMethod.Delete,
135
+ path: `/v1/budgets/${encodePath(budgetId)}`,
136
+ response: okResponseSchema,
137
+ signal
138
+ });
139
+ }
140
+ });
141
+ const createOrganizationApi = (context) => {
142
+ const { http } = context;
143
+ return {
144
+ modelCredentials: createModelCredentialsApi(context),
145
+ budgets: createBudgetsApi(context),
146
+ policy: {
147
+ get: (options) => http.request({
148
+ method: HttpMethod.Get,
149
+ path: "/v1/organization-policy",
150
+ response: organizationAgentPolicySchema,
151
+ signal: options?.signal
152
+ }),
153
+ update: ({ signal, ...value }) => http.request({
154
+ method: HttpMethod.Put,
155
+ path: "/v1/organization-policy",
156
+ body: { schema: updateOrganizationAgentPolicyRequestSchema, value },
157
+ response: organizationAgentPolicySchema,
158
+ signal
159
+ })
160
+ },
161
+ spendingRestrictions: {
162
+ get: (options) => http.request({
163
+ method: HttpMethod.Get,
164
+ path: "/v1/platform-spending-restrictions",
165
+ response: platformSpendingRestrictionsSchema,
166
+ signal: options?.signal
167
+ }),
168
+ update: ({ signal, ...value }) => http.request({
169
+ method: HttpMethod.Put,
170
+ path: "/v1/platform-spending-restrictions",
171
+ body: { schema: updatePlatformSpendingRestrictionsRequestSchema, value },
172
+ response: platformSpendingRestrictionsSchema,
173
+ signal
174
+ })
175
+ }
176
+ };
177
+ };
178
+ const createAllowedEndpointsApi = (args) => {
179
+ const { http } = args.context;
180
+ const path = (suffix = "") => `/v1/projects/${encodePath(args.projectId)}/allowed-endpoints${suffix}`;
181
+ return {
182
+ list: async (options) => (await http.request({
183
+ method: HttpMethod.Get,
184
+ path: path(),
185
+ response: listAllowedEndpointsResponseSchema,
186
+ signal: options?.signal
187
+ })).endpoints,
188
+ add: ({ signal, ...value }) => http.request({
189
+ method: HttpMethod.Post,
190
+ path: path(),
191
+ body: { schema: addAllowedEndpointRequestSchema, value },
192
+ response: allowedEndpointSchema,
193
+ signal
194
+ }),
195
+ remove: async ({ endpointId, signal }) => {
196
+ await http.request({
197
+ method: HttpMethod.Delete,
198
+ path: path(`/${encodePath(endpointId)}`),
199
+ response: okResponseSchema,
200
+ signal
201
+ });
202
+ }
203
+ };
204
+ };
205
+ export {
206
+ createAllowedEndpointsApi,
207
+ createOrganizationApi
208
+ };
209
+ //# sourceMappingURL=organization.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/agent-client/organization.ts"],
4
+ "sourcesContent": ["import {\n addAllowedEndpointRequestSchema,\n allowedEndpointSchema,\n budgetListSchema,\n budgetSchema,\n chatGptSubscriptionChallengeSchema,\n chatGptSubscriptionPollSchema,\n connectApiKeyRequestSchema,\n connectClaudeSubscriptionRequestSchema,\n createBudgetRequestSchema,\n createModelCredentialGrantRequestSchema,\n listAllowedEndpointsResponseSchema,\n modelCredentialGrantListSchema,\n modelCredentialGrantSchema,\n modelCredentialListSchema,\n modelCredentialSchema,\n okResponseSchema,\n organizationAgentPolicySchema,\n platformSpendingRestrictionsSchema,\n pollChatGptSubscriptionRequestSchema,\n startChatGptSubscriptionRequestSchema,\n updateModelCredentialRequestSchema,\n updateOrganizationAgentPolicyRequestSchema,\n updatePlatformSpendingRestrictionsRequestSchema,\n type AddAllowedEndpointRequestIface,\n type AllowedEndpointIface,\n type BudgetIface,\n type ChatGptSubscriptionChallengeIface,\n type ChatGptSubscriptionPollIface,\n type ConnectApiKeyRequestIface,\n type ConnectClaudeSubscriptionRequestIface,\n type CreateBudgetRequestIface,\n type CreateModelCredentialGrantRequestIface,\n type ModelCredentialGrantIface,\n type ModelCredentialIface,\n type OrganizationAgentPolicyIface,\n type PlatformSpendingRestrictionsIface,\n type StartChatGptSubscriptionRequestIface,\n type UpdateModelCredentialRequestIface,\n type UpdateOrganizationAgentPolicyRequestIface,\n type UpdatePlatformSpendingRestrictionsRequestIface,\n} from '@finalai/agent-protocol/agent-platform';\nimport { encodePath, type ClientContextIface, type SignalOptionsIface } from \"./context.mjs\";\nimport { HttpMethod } from \"./http.mjs\";\n\nexport interface ModelCredentialGrantsApiIface {\n list: (\n args: { credentialId: string } & SignalOptionsIface,\n ) => Promise<ModelCredentialGrantIface[]>;\n /** Shares the credential with a project or a member; idempotent per grantee. */\n create: (\n args: { credentialId: string } & CreateModelCredentialGrantRequestIface & SignalOptionsIface,\n ) => Promise<ModelCredentialGrantIface>;\n revoke: (args: { credentialId: string; grantId: string } & SignalOptionsIface) => Promise<void>;\n}\n\n/** The subscriptions and API keys the caller's projects run models with. */\nexport interface ModelCredentialsApiIface {\n /** The caller's credentials; with `projectId`, that project's and those it inherits. */\n list: (options?: { projectId?: string } & SignalOptionsIface) => Promise<ModelCredentialIface[]>;\n connectApiKey: (\n args: ConnectApiKeyRequestIface & SignalOptionsIface,\n ) => Promise<ModelCredentialIface>;\n connectClaudeSubscription: (\n args: ConnectClaudeSubscriptionRequestIface & SignalOptionsIface,\n ) => Promise<ModelCredentialIface>;\n /** Starts a device-code sign-in; poll it with the returned `state`. */\n startChatGptSubscription: (\n args: StartChatGptSubscriptionRequestIface & SignalOptionsIface,\n ) => Promise<ChatGptSubscriptionChallengeIface>;\n pollChatGptSubscription: (\n args: { state: string } & SignalOptionsIface,\n ) => Promise<ChatGptSubscriptionPollIface>;\n /** The owner's settings (an editor of the credential's project). */\n update: (\n args: { credentialId: string } & UpdateModelCredentialRequestIface & SignalOptionsIface,\n ) => Promise<ModelCredentialIface>;\n /** Clears a subscription's remembered limit after the vendor reset it. */\n resetUsage: (\n args: { credentialId: string } & SignalOptionsIface,\n ) => Promise<ModelCredentialIface>;\n disconnect: (args: { credentialId: string } & SignalOptionsIface) => Promise<void>;\n /** Who else may use a credential (its managers only). */\n grants: ModelCredentialGrantsApiIface;\n}\n\n/** Spend limits; organization admins write them. */\nexport interface BudgetsApiIface {\n list: (options?: SignalOptionsIface) => Promise<BudgetIface[]>;\n create: (args: CreateBudgetRequestIface & SignalOptionsIface) => Promise<BudgetIface>;\n update: (\n args: { budgetId: string } & CreateBudgetRequestIface & SignalOptionsIface,\n ) => Promise<BudgetIface>;\n delete: (args: { budgetId: string } & SignalOptionsIface) => Promise<void>;\n}\n\n/** The organization's provider gates and turn limits; organization admins update it. */\nexport interface OrganizationPolicyApiIface {\n get: (options?: SignalOptionsIface) => Promise<OrganizationAgentPolicyIface>;\n update: (\n args: UpdateOrganizationAgentPolicyRequestIface & SignalOptionsIface,\n ) => Promise<OrganizationAgentPolicyIface>;\n}\n\n/** Who may spend the platform's own metered inference; organization admins update it. */\nexport interface SpendingRestrictionsApiIface {\n get: (options?: SignalOptionsIface) => Promise<PlatformSpendingRestrictionsIface>;\n update: (\n args: UpdatePlatformSpendingRestrictionsRequestIface & SignalOptionsIface,\n ) => Promise<PlatformSpendingRestrictionsIface>;\n}\n\n/** The caller's organization: model credentials, budgets and policies. */\nexport interface OrganizationApiIface {\n modelCredentials: ModelCredentialsApiIface;\n budgets: BudgetsApiIface;\n policy: OrganizationPolicyApiIface;\n spendingRestrictions: SpendingRestrictionsApiIface;\n}\n\n/** Where a project lets its secrets go beyond model vendors' own APIs; its admins change it. */\nexport interface AllowedEndpointsApiIface {\n list: (options?: SignalOptionsIface) => Promise<AllowedEndpointIface[]>;\n add: (args: AddAllowedEndpointRequestIface & SignalOptionsIface) => Promise<AllowedEndpointIface>;\n remove: (args: { endpointId: string } & SignalOptionsIface) => Promise<void>;\n}\n\nconst credentialPath = (credentialId: string, suffix = ''): string =>\n `/v1/model-credentials/${encodePath(credentialId)}${suffix}`;\n\nconst createModelCredentialsApi = ({ http }: ClientContextIface): ModelCredentialsApiIface => ({\n list: async (options) =>\n (\n await http.request({\n method: HttpMethod.Get,\n path: '/v1/model-credentials',\n query: { projectId: options?.projectId },\n response: modelCredentialListSchema,\n signal: options?.signal,\n })\n ).credentials,\n connectApiKey: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: '/v1/model-credentials',\n body: { schema: connectApiKeyRequestSchema, value },\n response: modelCredentialSchema,\n signal,\n }),\n connectClaudeSubscription: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: '/v1/model-credentials/subscriptions/claude',\n body: { schema: connectClaudeSubscriptionRequestSchema, value },\n response: modelCredentialSchema,\n signal,\n }),\n startChatGptSubscription: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: '/v1/model-credentials/subscriptions/chatgpt/start',\n body: { schema: startChatGptSubscriptionRequestSchema, value },\n response: chatGptSubscriptionChallengeSchema,\n signal,\n }),\n pollChatGptSubscription: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: '/v1/model-credentials/subscriptions/chatgpt/poll',\n body: { schema: pollChatGptSubscriptionRequestSchema, value },\n response: chatGptSubscriptionPollSchema,\n signal,\n }),\n update: ({ credentialId, signal, ...value }) =>\n http.request({\n method: HttpMethod.Patch,\n path: credentialPath(credentialId),\n body: { schema: updateModelCredentialRequestSchema, value },\n response: modelCredentialSchema,\n signal,\n }),\n resetUsage: ({ credentialId, signal }) =>\n http.request({\n method: HttpMethod.Patch,\n path: credentialPath(credentialId),\n body: { schema: updateModelCredentialRequestSchema, value: { resetUsage: true } },\n response: modelCredentialSchema,\n signal,\n }),\n disconnect: async ({ credentialId, signal }) => {\n await http.request({\n method: HttpMethod.Delete,\n path: credentialPath(credentialId),\n response: okResponseSchema,\n signal,\n });\n },\n grants: {\n list: async ({ credentialId, signal }) =>\n (\n await http.request({\n method: HttpMethod.Get,\n path: credentialPath(credentialId, '/grants'),\n response: modelCredentialGrantListSchema,\n signal,\n })\n ).grants,\n create: ({ credentialId, signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: credentialPath(credentialId, '/grants'),\n body: { schema: createModelCredentialGrantRequestSchema, value },\n response: modelCredentialGrantSchema,\n signal,\n }),\n revoke: async ({ credentialId, grantId, signal }) => {\n await http.request({\n method: HttpMethod.Delete,\n path: credentialPath(credentialId, `/grants/${encodePath(grantId)}`),\n response: okResponseSchema,\n signal,\n });\n },\n },\n});\n\nconst createBudgetsApi = ({ http }: ClientContextIface): BudgetsApiIface => ({\n list: async (options) =>\n (\n await http.request({\n method: HttpMethod.Get,\n path: '/v1/budgets',\n response: budgetListSchema,\n signal: options?.signal,\n })\n ).budgets,\n create: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: '/v1/budgets',\n body: { schema: createBudgetRequestSchema, value },\n response: budgetSchema,\n signal,\n }),\n update: ({ budgetId, signal, ...value }) =>\n http.request({\n method: HttpMethod.Put,\n path: `/v1/budgets/${encodePath(budgetId)}`,\n body: { schema: createBudgetRequestSchema, value },\n response: budgetSchema,\n signal,\n }),\n delete: async ({ budgetId, signal }) => {\n await http.request({\n method: HttpMethod.Delete,\n path: `/v1/budgets/${encodePath(budgetId)}`,\n response: okResponseSchema,\n signal,\n });\n },\n});\n\nexport const createOrganizationApi = (context: ClientContextIface): OrganizationApiIface => {\n const { http } = context;\n return {\n modelCredentials: createModelCredentialsApi(context),\n budgets: createBudgetsApi(context),\n policy: {\n get: (options) =>\n http.request({\n method: HttpMethod.Get,\n path: '/v1/organization-policy',\n response: organizationAgentPolicySchema,\n signal: options?.signal,\n }),\n update: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Put,\n path: '/v1/organization-policy',\n body: { schema: updateOrganizationAgentPolicyRequestSchema, value },\n response: organizationAgentPolicySchema,\n signal,\n }),\n },\n spendingRestrictions: {\n get: (options) =>\n http.request({\n method: HttpMethod.Get,\n path: '/v1/platform-spending-restrictions',\n response: platformSpendingRestrictionsSchema,\n signal: options?.signal,\n }),\n update: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Put,\n path: '/v1/platform-spending-restrictions',\n body: { schema: updatePlatformSpendingRestrictionsRequestSchema, value },\n response: platformSpendingRestrictionsSchema,\n signal,\n }),\n },\n };\n};\n\nexport const createAllowedEndpointsApi = (args: {\n context: ClientContextIface;\n projectId: string;\n}): AllowedEndpointsApiIface => {\n const { http } = args.context;\n const path = (suffix = ''): string =>\n `/v1/projects/${encodePath(args.projectId)}/allowed-endpoints${suffix}`;\n return {\n list: async (options) =>\n (\n await http.request({\n method: HttpMethod.Get,\n path: path(),\n response: listAllowedEndpointsResponseSchema,\n signal: options?.signal,\n })\n ).endpoints,\n add: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: path(),\n body: { schema: addAllowedEndpointRequestSchema, value },\n response: allowedEndpointSchema,\n signal,\n }),\n remove: async ({ endpointId, signal }) => {\n await http.request({\n method: HttpMethod.Delete,\n path: path(`/${encodePath(endpointId)}`),\n response: okResponseSchema,\n signal,\n });\n },\n };\n};\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;A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AAQ,OAAO,EAAE,YAAY,OAAO,MAAM;AACxC,YAAM,KAAK,QAAQ;AAAA,QACjB,QAAQ,WAAW;AAAA,QACnB,MAAM,KAAK,IAAI,WAAW,UAAU,CAAC,EAAE;AAAA,QACvC,UAAU;AAAA,QACV;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,21 @@
1
+ import { type ChatChangeProposalIface, type ChatConfigurationViewIface, type ProposeChatChangeRequestIface } from '@finalai/agent-protocol/agent-platform';
2
+ import { type ClientContextIface, type SignalOptionsIface } from "./context.mjs";
3
+ /**
4
+ * An agent participant's settings in this conversation, changed through proposals: one waits
5
+ * for a manager's decision unless the proposer may apply it.
6
+ */
7
+ export interface ParticipantConfigurationApiIface {
8
+ /** The participant's settings, what it is provided, and the open proposals. */
9
+ get: (participantId: string, options?: SignalOptionsIface) => Promise<ChatConfigurationViewIface>;
10
+ /** Proposes a change; proposing the same `requestKey` again returns the first proposal. */
11
+ propose: (participantId: string, request: ProposeChatChangeRequestIface, options?: SignalOptionsIface) => Promise<ChatChangeProposalIface>;
12
+ /** Accepts or declines a proposal (a manager of the conversation). */
13
+ decide: (participantId: string, args: {
14
+ proposalId: string;
15
+ accept: boolean;
16
+ }, options?: SignalOptionsIface) => Promise<ChatChangeProposalIface>;
17
+ }
18
+ export declare const createParticipantConfigurationApi: (args: {
19
+ context: ClientContextIface;
20
+ conversationId: string;
21
+ }) => ParticipantConfigurationApiIface;
@@ -0,0 +1,38 @@
1
+ import {
2
+ chatChangeProposalSchema,
3
+ chatConfigurationViewSchema,
4
+ decideChatChangeRequestSchema,
5
+ proposeChatChangeRequestSchema
6
+ } from "@finalai/agent-protocol/agent-platform";
7
+ import { encodePath } from "./context.mjs";
8
+ import { HttpMethod } from "./http.mjs";
9
+ const createParticipantConfigurationApi = (args) => {
10
+ const { http } = args.context;
11
+ const path = (participantId, suffix = "") => `/v1/conversations/${encodePath(args.conversationId)}/participants/${encodePath(participantId)}/configuration${suffix}`;
12
+ return {
13
+ get: (participantId, options) => http.request({
14
+ method: HttpMethod.Get,
15
+ path: path(participantId),
16
+ response: chatConfigurationViewSchema,
17
+ signal: options?.signal
18
+ }),
19
+ propose: (participantId, request, options) => http.request({
20
+ method: HttpMethod.Post,
21
+ path: path(participantId, "/proposals"),
22
+ body: { schema: proposeChatChangeRequestSchema, value: request },
23
+ response: chatChangeProposalSchema,
24
+ signal: options?.signal
25
+ }),
26
+ decide: (participantId, { proposalId, accept }, options) => http.request({
27
+ method: HttpMethod.Post,
28
+ path: path(participantId, `/proposals/${encodePath(proposalId)}/decision`),
29
+ body: { schema: decideChatChangeRequestSchema, value: { accept } },
30
+ response: chatChangeProposalSchema,
31
+ signal: options?.signal
32
+ })
33
+ };
34
+ };
35
+ export {
36
+ createParticipantConfigurationApi
37
+ };
38
+ //# sourceMappingURL=participant-configuration.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/agent-client/participant-configuration.ts"],
4
+ "sourcesContent": ["import {\n chatChangeProposalSchema,\n chatConfigurationViewSchema,\n decideChatChangeRequestSchema,\n proposeChatChangeRequestSchema,\n type ChatChangeProposalIface,\n type ChatConfigurationViewIface,\n type ProposeChatChangeRequestIface,\n} from '@finalai/agent-protocol/agent-platform';\nimport { encodePath, type ClientContextIface, type SignalOptionsIface } from \"./context.mjs\";\nimport { HttpMethod } from \"./http.mjs\";\n\n/**\n * An agent participant's settings in this conversation, changed through proposals: one waits\n * for a manager's decision unless the proposer may apply it.\n */\nexport interface ParticipantConfigurationApiIface {\n /** The participant's settings, what it is provided, and the open proposals. */\n get: (participantId: string, options?: SignalOptionsIface) => Promise<ChatConfigurationViewIface>;\n /** Proposes a change; proposing the same `requestKey` again returns the first proposal. */\n propose: (\n participantId: string,\n request: ProposeChatChangeRequestIface,\n options?: SignalOptionsIface,\n ) => Promise<ChatChangeProposalIface>;\n /** Accepts or declines a proposal (a manager of the conversation). */\n decide: (\n participantId: string,\n args: { proposalId: string; accept: boolean },\n options?: SignalOptionsIface,\n ) => Promise<ChatChangeProposalIface>;\n}\n\nexport const createParticipantConfigurationApi = (args: {\n context: ClientContextIface;\n conversationId: string;\n}): ParticipantConfigurationApiIface => {\n const { http } = args.context;\n const path = (participantId: string, suffix = ''): string =>\n `/v1/conversations/${encodePath(args.conversationId)}/participants/${encodePath(participantId)}/configuration${suffix}`;\n return {\n get: (participantId, options) =>\n http.request({\n method: HttpMethod.Get,\n path: path(participantId),\n response: chatConfigurationViewSchema,\n signal: options?.signal,\n }),\n propose: (participantId, request, options) =>\n http.request({\n method: HttpMethod.Post,\n path: path(participantId, '/proposals'),\n body: { schema: proposeChatChangeRequestSchema, value: request },\n response: chatChangeProposalSchema,\n signal: options?.signal,\n }),\n decide: (participantId, { proposalId, accept }, options) =>\n http.request({\n method: HttpMethod.Post,\n path: path(participantId, `/proposals/${encodePath(proposalId)}/decision`),\n body: { schema: decideChatChangeRequestSchema, value: { accept } },\n response: chatChangeProposalSchema,\n signal: options?.signal,\n }),\n };\n};\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP,SAAS,kBAAoE;AAC7E,SAAS,kBAAkB;AAuBpB,MAAM,oCAAoC,CAAC,SAGV;AACtC,QAAM,EAAE,KAAK,IAAI,KAAK;AACtB,QAAM,OAAO,CAAC,eAAuB,SAAS,OAC5C,qBAAqB,WAAW,KAAK,cAAc,CAAC,iBAAiB,WAAW,aAAa,CAAC,iBAAiB,MAAM;AACvH,SAAO;AAAA,IACL,KAAK,CAAC,eAAe,YACnB,KAAK,QAAQ;AAAA,MACX,QAAQ,WAAW;AAAA,MACnB,MAAM,KAAK,aAAa;AAAA,MACxB,UAAU;AAAA,MACV,QAAQ,SAAS;AAAA,IACnB,CAAC;AAAA,IACH,SAAS,CAAC,eAAe,SAAS,YAChC,KAAK,QAAQ;AAAA,MACX,QAAQ,WAAW;AAAA,MACnB,MAAM,KAAK,eAAe,YAAY;AAAA,MACtC,MAAM,EAAE,QAAQ,gCAAgC,OAAO,QAAQ;AAAA,MAC/D,UAAU;AAAA,MACV,QAAQ,SAAS;AAAA,IACnB,CAAC;AAAA,IACH,QAAQ,CAAC,eAAe,EAAE,YAAY,OAAO,GAAG,YAC9C,KAAK,QAAQ;AAAA,MACX,QAAQ,WAAW;AAAA,MACnB,MAAM,KAAK,eAAe,cAAc,WAAW,UAAU,CAAC,WAAW;AAAA,MACzE,MAAM,EAAE,QAAQ,+BAA+B,OAAO,EAAE,OAAO,EAAE;AAAA,MACjE,UAAU;AAAA,MACV,QAAQ,SAAS;AAAA,IACnB,CAAC;AAAA,EACL;AACF;",
6
+ "names": []
7
+ }
@@ -1,3 +1,4 @@
1
+ import { type AllowedEndpointsApiIface } from "./organization.mjs";
1
2
  import { type ChannelAppsApiIface, type ChannelSourceOf, type ProjectChannelsApiIface } from "./channels.mjs";
2
3
  import { type ClientContextIface } from "./context.mjs";
3
4
  import { type ProjectConversationsApiIface } from "./conversations.mjs";
@@ -39,6 +40,8 @@ export interface ProjectClientIface extends ProjectResourceApiIface {
39
40
  publisher: ProjectPublisherApiIface;
40
41
  /** Which of the project's names resolve as `handle/name` from any organization. */
41
42
  publicNames: PublicNamesApiIface;
43
+ /** Where the project lets its secrets go beyond model vendors' own APIs. */
44
+ allowedEndpoints: AllowedEndpointsApiIface;
42
45
  }
43
46
  export declare const createProjectClient: (args: {
44
47
  context: ClientContextIface;
@@ -1,3 +1,4 @@
1
+ import { createAllowedEndpointsApi } from "./organization.mjs";
1
2
  import {
2
3
  createChannelAppsApi,
3
4
  createProjectChannelsApi
@@ -57,7 +58,8 @@ const createProjectClient = (args) => {
57
58
  oauthClients: createOAuthClientsApi({ context, projectId }),
58
59
  signInReturnOrigins: createSignInReturnOriginsApi({ context, projectId }),
59
60
  publisher: createProjectPublisherApi({ context, projectId }),
60
- publicNames: createPublicNamesApi({ context, projectId })
61
+ publicNames: createPublicNamesApi({ context, projectId }),
62
+ allowedEndpoints: createAllowedEndpointsApi({ context, projectId })
61
63
  };
62
64
  };
63
65
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/agent-client/project.ts"],
4
- "sourcesContent": ["import type { AgentInput } from \"./agent-input.mjs\";\nimport {\n createChannelAppsApi,\n createProjectChannelsApi,\n type ChannelAppsApiIface,\n type ChannelSourceOf,\n type ProjectChannelsApiIface,\n} from \"./channels.mjs\";\nimport { encodePath, type ClientContextIface } from \"./context.mjs\";\nimport { createProjectConversationsApi, type ProjectConversationsApiIface } from \"./conversations.mjs\";\nimport {\n createEventsApi,\n createEventSubscriptionsApi,\n type EventsApiIface,\n type EventSubscriptionsApiIface,\n} from \"./events.mjs\";\nimport {\n createAcpAdaptersApi,\n createHarnessesApi,\n type AcpAdaptersApiIface,\n type HarnessesApiIface,\n} from \"./harnesses.mjs\";\nimport { createIntegrationsApi, type IntegrationsApiIface } from \"./integrations.mjs\";\nimport {\n createOAuthClientsApi,\n createSignInReturnOriginsApi,\n type OAuthClientsApiIface,\n type SignInReturnOriginsApiIface,\n} from \"./oauth-clients.mjs\";\nimport { createProjectAgentsApi, type ProjectAgentsApiIface } from \"./project-agents.mjs\";\nimport { createProjectResourceApi, type ProjectResourceApiIface } from \"./projects.mjs\";\nimport {\n createProjectPublisherApi,\n createPublicNamesApi,\n type ProjectPublisherApiIface,\n type PublicNamesApiIface,\n} from \"./publishers.mjs\";\nimport { createSandboxProvidersApi, type SandboxProvidersApiIface } from \"./sandbox-providers.mjs\";\nimport { createProjectSchedulesApi, type ProjectSchedulesApiIface } from \"./schedules.mjs\";\nimport {\n createSandboxesApi,\n createSandboxSetupsApi,\n type SandboxesApiIface,\n type SandboxSetupsApiIface,\n} from \"./sandboxes.mjs\";\nimport { createProjectSessionsApi, type ProjectSessionsApiIface } from \"./sessions.mjs\";\nimport type { AgentStartDepsIface } from \"./start.mjs\";\n\n// One project: everything is created through it, and a session can only be\n// provided things from its own project.\n\nexport interface ProjectClientIface extends ProjectResourceApiIface {\n readonly id: string;\n sessions: ProjectSessionsApiIface;\n conversations: ProjectConversationsApiIface;\n agents: ProjectAgentsApiIface;\n sandboxes: SandboxesApiIface;\n sandboxSetups: SandboxSetupsApiIface;\n integrations: IntegrationsApiIface;\n harnesses: HarnessesApiIface;\n acpAdapters: AcpAdaptersApiIface;\n channels: ProjectChannelsApiIface;\n /** Provider application credentials the project's channel installs use. */\n channelApps: ChannelAppsApiIface;\n /** The schedules of the project's conversations. */\n schedules: ProjectSchedulesApiIface;\n /** The event feed for this project and those below it. */\n events: EventsApiIface;\n /** Pushes this project's feed to a URL (`webhooks:write`, project admin). */\n eventSubscriptions: EventSubscriptionsApiIface;\n sandboxProviders: SandboxProvidersApiIface;\n oauthClients: OAuthClientsApiIface;\n signInReturnOrigins: SignInReturnOriginsApiIface;\n /** The project's publisher handle. */\n publisher: ProjectPublisherApiIface;\n /** Which of the project's names resolve as `handle/name` from any organization. */\n publicNames: PublicNamesApiIface;\n}\n\nexport const createProjectClient = (args: {\n context: ClientContextIface;\n start: AgentStartDepsIface;\n channelSourceOf: ChannelSourceOf;\n projectId: string;\n}): ProjectClientIface => {\n const { context, projectId } = args;\n const agents = createProjectAgentsApi({ context, projectId, codec: args.start.codec });\n // The document must be stored before the platform can check a harness against it.\n const store = async (agent: AgentInput, signal?: AbortSignal): Promise<string> =>\n (await agents.store({ agent, signal })).hash;\n return {\n ...createProjectResourceApi({ context, projectId }),\n id: projectId,\n sessions: createProjectSessionsApi({ context, projectId, start: args.start }),\n conversations: createProjectConversationsApi({ context, projectId, start: args.start }),\n agents,\n sandboxes: createSandboxesApi({ context, projectId }),\n sandboxSetups: createSandboxSetupsApi({ context, projectId }),\n integrations: createIntegrationsApi({ context, projectId }),\n harnesses: createHarnessesApi({ context, projectId, store }),\n acpAdapters: createAcpAdaptersApi({ context, projectId }),\n channels: createProjectChannelsApi({ context, projectId, sourceOf: args.channelSourceOf }),\n channelApps: createChannelAppsApi({ context, projectId }),\n schedules: createProjectSchedulesApi({ context, projectId }),\n events: createEventsApi({ context, projectId }),\n eventSubscriptions: createEventSubscriptionsApi({\n context,\n basePath: `/v1/projects/${encodePath(projectId)}/event-subscriptions`,\n }),\n sandboxProviders: createSandboxProvidersApi({ context, projectId }),\n oauthClients: createOAuthClientsApi({ context, projectId }),\n signInReturnOrigins: createSignInReturnOriginsApi({ context, projectId }),\n publisher: createProjectPublisherApi({ context, projectId }),\n publicNames: createPublicNamesApi({ context, projectId }),\n };\n};\n"],
5
- "mappings": "AACA;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AACP,SAAS,kBAA2C;AACpD,SAAS,qCAAwE;AACjF;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,6BAAwD;AACjE;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,8BAA0D;AACnE,SAAS,gCAA8D;AACvE;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,iCAAgE;AACzE,SAAS,iCAAgE;AACzE;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,gCAA8D;AAkChE,MAAM,sBAAsB,CAAC,SAKV;AACxB,QAAM,EAAE,SAAS,UAAU,IAAI;AAC/B,QAAM,SAAS,uBAAuB,EAAE,SAAS,WAAW,OAAO,KAAK,MAAM,MAAM,CAAC;AAErF,QAAM,QAAQ,OAAO,OAAmB,YACrC,MAAM,OAAO,MAAM,EAAE,OAAO,OAAO,CAAC,GAAG;AAC1C,SAAO;AAAA,IACL,GAAG,yBAAyB,EAAE,SAAS,UAAU,CAAC;AAAA,IAClD,IAAI;AAAA,IACJ,UAAU,yBAAyB,EAAE,SAAS,WAAW,OAAO,KAAK,MAAM,CAAC;AAAA,IAC5E,eAAe,8BAA8B,EAAE,SAAS,WAAW,OAAO,KAAK,MAAM,CAAC;AAAA,IACtF;AAAA,IACA,WAAW,mBAAmB,EAAE,SAAS,UAAU,CAAC;AAAA,IACpD,eAAe,uBAAuB,EAAE,SAAS,UAAU,CAAC;AAAA,IAC5D,cAAc,sBAAsB,EAAE,SAAS,UAAU,CAAC;AAAA,IAC1D,WAAW,mBAAmB,EAAE,SAAS,WAAW,MAAM,CAAC;AAAA,IAC3D,aAAa,qBAAqB,EAAE,SAAS,UAAU,CAAC;AAAA,IACxD,UAAU,yBAAyB,EAAE,SAAS,WAAW,UAAU,KAAK,gBAAgB,CAAC;AAAA,IACzF,aAAa,qBAAqB,EAAE,SAAS,UAAU,CAAC;AAAA,IACxD,WAAW,0BAA0B,EAAE,SAAS,UAAU,CAAC;AAAA,IAC3D,QAAQ,gBAAgB,EAAE,SAAS,UAAU,CAAC;AAAA,IAC9C,oBAAoB,4BAA4B;AAAA,MAC9C;AAAA,MACA,UAAU,gBAAgB,WAAW,SAAS,CAAC;AAAA,IACjD,CAAC;AAAA,IACD,kBAAkB,0BAA0B,EAAE,SAAS,UAAU,CAAC;AAAA,IAClE,cAAc,sBAAsB,EAAE,SAAS,UAAU,CAAC;AAAA,IAC1D,qBAAqB,6BAA6B,EAAE,SAAS,UAAU,CAAC;AAAA,IACxE,WAAW,0BAA0B,EAAE,SAAS,UAAU,CAAC;AAAA,IAC3D,aAAa,qBAAqB,EAAE,SAAS,UAAU,CAAC;AAAA,EAC1D;AACF;",
4
+ "sourcesContent": ["import { createAllowedEndpointsApi, type AllowedEndpointsApiIface } from \"./organization.mjs\";\nimport type { AgentInput } from \"./agent-input.mjs\";\nimport {\n createChannelAppsApi,\n createProjectChannelsApi,\n type ChannelAppsApiIface,\n type ChannelSourceOf,\n type ProjectChannelsApiIface,\n} from \"./channels.mjs\";\nimport { encodePath, type ClientContextIface } from \"./context.mjs\";\nimport { createProjectConversationsApi, type ProjectConversationsApiIface } from \"./conversations.mjs\";\nimport {\n createEventsApi,\n createEventSubscriptionsApi,\n type EventsApiIface,\n type EventSubscriptionsApiIface,\n} from \"./events.mjs\";\nimport {\n createAcpAdaptersApi,\n createHarnessesApi,\n type AcpAdaptersApiIface,\n type HarnessesApiIface,\n} from \"./harnesses.mjs\";\nimport { createIntegrationsApi, type IntegrationsApiIface } from \"./integrations.mjs\";\nimport {\n createOAuthClientsApi,\n createSignInReturnOriginsApi,\n type OAuthClientsApiIface,\n type SignInReturnOriginsApiIface,\n} from \"./oauth-clients.mjs\";\nimport { createProjectAgentsApi, type ProjectAgentsApiIface } from \"./project-agents.mjs\";\nimport { createProjectResourceApi, type ProjectResourceApiIface } from \"./projects.mjs\";\nimport {\n createProjectPublisherApi,\n createPublicNamesApi,\n type ProjectPublisherApiIface,\n type PublicNamesApiIface,\n} from \"./publishers.mjs\";\nimport { createSandboxProvidersApi, type SandboxProvidersApiIface } from \"./sandbox-providers.mjs\";\nimport { createProjectSchedulesApi, type ProjectSchedulesApiIface } from \"./schedules.mjs\";\nimport {\n createSandboxesApi,\n createSandboxSetupsApi,\n type SandboxesApiIface,\n type SandboxSetupsApiIface,\n} from \"./sandboxes.mjs\";\nimport { createProjectSessionsApi, type ProjectSessionsApiIface } from \"./sessions.mjs\";\nimport type { AgentStartDepsIface } from \"./start.mjs\";\n\n// One project: everything is created through it, and a session can only be\n// provided things from its own project.\n\nexport interface ProjectClientIface extends ProjectResourceApiIface {\n readonly id: string;\n sessions: ProjectSessionsApiIface;\n conversations: ProjectConversationsApiIface;\n agents: ProjectAgentsApiIface;\n sandboxes: SandboxesApiIface;\n sandboxSetups: SandboxSetupsApiIface;\n integrations: IntegrationsApiIface;\n harnesses: HarnessesApiIface;\n acpAdapters: AcpAdaptersApiIface;\n channels: ProjectChannelsApiIface;\n /** Provider application credentials the project's channel installs use. */\n channelApps: ChannelAppsApiIface;\n /** The schedules of the project's conversations. */\n schedules: ProjectSchedulesApiIface;\n /** The event feed for this project and those below it. */\n events: EventsApiIface;\n /** Pushes this project's feed to a URL (`webhooks:write`, project admin). */\n eventSubscriptions: EventSubscriptionsApiIface;\n sandboxProviders: SandboxProvidersApiIface;\n oauthClients: OAuthClientsApiIface;\n signInReturnOrigins: SignInReturnOriginsApiIface;\n /** The project's publisher handle. */\n publisher: ProjectPublisherApiIface;\n /** Which of the project's names resolve as `handle/name` from any organization. */\n publicNames: PublicNamesApiIface;\n /** Where the project lets its secrets go beyond model vendors' own APIs. */\n allowedEndpoints: AllowedEndpointsApiIface;\n}\n\nexport const createProjectClient = (args: {\n context: ClientContextIface;\n start: AgentStartDepsIface;\n channelSourceOf: ChannelSourceOf;\n projectId: string;\n}): ProjectClientIface => {\n const { context, projectId } = args;\n const agents = createProjectAgentsApi({ context, projectId, codec: args.start.codec });\n // The document must be stored before the platform can check a harness against it.\n const store = async (agent: AgentInput, signal?: AbortSignal): Promise<string> =>\n (await agents.store({ agent, signal })).hash;\n return {\n ...createProjectResourceApi({ context, projectId }),\n id: projectId,\n sessions: createProjectSessionsApi({ context, projectId, start: args.start }),\n conversations: createProjectConversationsApi({ context, projectId, start: args.start }),\n agents,\n sandboxes: createSandboxesApi({ context, projectId }),\n sandboxSetups: createSandboxSetupsApi({ context, projectId }),\n integrations: createIntegrationsApi({ context, projectId }),\n harnesses: createHarnessesApi({ context, projectId, store }),\n acpAdapters: createAcpAdaptersApi({ context, projectId }),\n channels: createProjectChannelsApi({ context, projectId, sourceOf: args.channelSourceOf }),\n channelApps: createChannelAppsApi({ context, projectId }),\n schedules: createProjectSchedulesApi({ context, projectId }),\n events: createEventsApi({ context, projectId }),\n eventSubscriptions: createEventSubscriptionsApi({\n context,\n basePath: `/v1/projects/${encodePath(projectId)}/event-subscriptions`,\n }),\n sandboxProviders: createSandboxProvidersApi({ context, projectId }),\n oauthClients: createOAuthClientsApi({ context, projectId }),\n signInReturnOrigins: createSignInReturnOriginsApi({ context, projectId }),\n publisher: createProjectPublisherApi({ context, projectId }),\n publicNames: createPublicNamesApi({ context, projectId }),\n allowedEndpoints: createAllowedEndpointsApi({ context, projectId }),\n };\n};\n"],
5
+ "mappings": "AAAA,SAAS,iCAAgE;AAE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CAAC;AAAA,IACxD,WAAW,0BAA0B,EAAE,SAAS,UAAU,CAAC;AAAA,IAC3D,QAAQ,gBAAgB,EAAE,SAAS,UAAU,CAAC;AAAA,IAC9C,oBAAoB,4BAA4B;AAAA,MAC9C;AAAA,MACA,UAAU,gBAAgB,WAAW,SAAS,CAAC;AAAA,IACjD,CAAC;AAAA,IACD,kBAAkB,0BAA0B,EAAE,SAAS,UAAU,CAAC;AAAA,IAClE,cAAc,sBAAsB,EAAE,SAAS,UAAU,CAAC;AAAA,IAC1D,qBAAqB,6BAA6B,EAAE,SAAS,UAAU,CAAC;AAAA,IACxE,WAAW,0BAA0B,EAAE,SAAS,UAAU,CAAC;AAAA,IAC3D,aAAa,qBAAqB,EAAE,SAAS,UAAU,CAAC;AAAA,IACxD,kBAAkB,0BAA0B,EAAE,SAAS,UAAU,CAAC;AAAA,EACpE;AACF;",
6
6
  "names": []
7
7
  }
@@ -22,7 +22,6 @@ export interface ProvidePatchIface {
22
22
  harness?: HarnessSettingsIface;
23
23
  compute?: Partial<Record<Capability | `${Capability}`, ResourceRef | null>>;
24
24
  integrations?: Record<string, ResourceRef | null>;
25
- instructions?: string | null;
26
25
  tools?: string[] | null;
27
26
  /** The settings revision you read; a stale one fails with `conflict`. */
28
27
  revision?: number;