@finalai/agents 0.12.0 → 0.13.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/dist/modules/agent-client/channels.d.mts +91 -28
  2. package/dist/modules/agent-client/channels.mjs +168 -46
  3. package/dist/modules/agent-client/channels.mjs.map +2 -2
  4. package/dist/modules/agent-client/client.d.mts +8 -3
  5. package/dist/modules/agent-client/client.mjs +7 -5
  6. package/dist/modules/agent-client/client.mjs.map +2 -2
  7. package/dist/modules/agent-client/conversation-resources.d.mts +18 -1
  8. package/dist/modules/agent-client/conversation-resources.mjs +28 -0
  9. package/dist/modules/agent-client/conversation-resources.mjs.map +2 -2
  10. package/dist/modules/agent-client/conversations.d.mts +5 -1
  11. package/dist/modules/agent-client/conversations.mjs +7 -0
  12. package/dist/modules/agent-client/conversations.mjs.map +2 -2
  13. package/dist/modules/agent-client/index.d.mts +3 -3
  14. package/dist/modules/agent-client/index.mjs.map +2 -2
  15. package/dist/modules/agent-client/project.d.mts +7 -2
  16. package/dist/modules/agent-client/project.mjs +5 -5
  17. package/dist/modules/agent-client/project.mjs.map +2 -2
  18. package/dist/modules/agent-client/sandboxes.d.mts +7 -0
  19. package/dist/modules/agent-client/sandboxes.mjs +9 -1
  20. package/dist/modules/agent-client/sandboxes.mjs.map +2 -2
  21. package/dist/modules/agent-client/schedules.d.mts +7 -22
  22. package/dist/modules/agent-client/schedules.mjs +8 -47
  23. package/dist/modules/agent-client/schedules.mjs.map +2 -2
  24. package/dist/modules/public.d.mts +1 -1
  25. package/dist/modules/public.mjs.map +2 -2
  26. package/examples/release-scout/run-on-a-computer.ts +1 -1
  27. package/package.json +5 -10
  28. package/dist/modules/authoring/final-channel.d.mts +0 -1
  29. package/dist/modules/authoring/final-channel.mjs +0 -2
  30. package/dist/modules/authoring/final-channel.mjs.map +0 -7
@@ -3,12 +3,12 @@ export { Capability, FilesAccess, ScreenAccess, ShellAccess, type CapabilityAcce
3
3
  export { AcpAuthMode, type AcpApiIface, type AcpConnectArgsIface } from "./acp.mjs";
4
4
  export { createTextCollector, isUserMessageFor, sessionUpdateOf, textOf, turnEndOf, type AcpSessionUpdateIface, type TurnEndIface, } from "./acp-frames.mjs";
5
5
  export type { AgentInput, AgentValue, AgentValueCodecIface } from "./agent-input.mjs";
6
- export type { ChannelBindingsApiIface, ChannelSourceIface, ChannelSourceOf, InstallChannelArgsIface, ProjectChannelsApiIface, PublishChannelArgsIface, } from "./channels.mjs";
6
+ export type { ActorOptionIface, ChannelAppsApiIface, ChannelBindingsApiIface, ChannelSourceIface, ChannelSourceOf, ChannelTicketsApiIface, IdentityLinksApiIface, InstallChannelArgsIface, ProjectChannelsApiIface, PublishChannelArgsIface, UpdateChannelBindingArgsIface, } from "./channels.mjs";
7
7
  export { DEFAULT_AGENTS_HOST, createClient, type AgentClientIface, type AgentsApiIface, type AppApiIface, type CreateClientOptionsIface, type DecisionsApiIface, type InferenceApiIface, type PeopleApiIface, type PlatformIdentityApiIface, type RealtimeApiIface, } from "./client.mjs";
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 { ConversationContextApiIface, ConversationContextEntryInputIface, ConversationDecisionsApiIface, ConversationInputsApiIface, ConversationLabelsApiIface, ConversationReadGrantsApiIface, ConversationResourcesIface, ResourceSubscriptionsApiIface, SendInputArgsIface, } from "./conversation-resources.mjs";
11
+ export type { ConversationChannelRoutesApiIface, ConversationContextApiIface, ConversationContextEntryInputIface, ConversationDecisionsApiIface, ConversationInputsApiIface, ConversationLabelsApiIface, ConversationReadGrantsApiIface, ConversationResourcesIface, ResourceSubscriptionsApiIface, SendInputArgsIface, } from "./conversation-resources.mjs";
12
12
  export { TURN_OPEN_SESSION_STATES, isNewerMessageVersion, messageVersionOf, type MessageVersionIface, } from "./conversations.mjs";
13
13
  export type { ConversationAgentTurnIface, ConversationEvent, ConversationEventMetaIface, ConversationEventsOptionsIface, ConversationHandleIface, ConversationsApiIface, CreateConversationArgsIface, ListMessagesOptionsIface, OpenedConversationIface, ParticipantCreateInput, ParticipantsApiIface, ProjectConversationsApiIface, SandboxFileContentArgsIface, SandboxFileContentRequestIface, SendMessageOptionsIface, SentMessageIface, UploadAttachmentArgsIface, } from "./conversations.mjs";
14
14
  export { AgentClientErrorName, ClientErrorCode, DecisionErrorReason, clientError, decisionError, isClientError, isDecisionError, isRealtimeSubscriptionError, isRequirementsUnmetError, isTerminalRealtimeError, isTurnRejectedError, realtimeSubscriptionError, requirementsUnmetError, turnRejectedError, type AgentClientError, type ClientErrorIface, type DecisionErrorIface, type RealtimeSubscriptionErrorIface, type RequirementsUnmetErrorIface, type TurnRejectedErrorIface, } from "./errors.mjs";
@@ -29,5 +29,5 @@ export { createGatewayRealtimeTransport, type GatewayConnect, type GatewayConnec
29
29
  export { SANDBOX_FILE_URI_SCHEME, createSandboxFileUri, parseSandboxFileUri, type SandboxFileTargetIface, } from "./sandbox-uri.mjs";
30
30
  export type { SandboxProvidersApiIface } from "./sandbox-providers.mjs";
31
31
  export type { CreateSandboxOptionsIface, SandboxEnvironmentValueIface, SandboxHandleIface, SandboxOwnerIface, SandboxSetupRefIface, SandboxSetupsApiIface, SandboxesApiIface, } from "./sandboxes.mjs";
32
- export type { ScheduleRef, ScheduleUpdateIface, SchedulesApiIface } from "./schedules.mjs";
32
+ export type { ProjectSchedulesApiIface } from "./schedules.mjs";
33
33
  export type { CreateSessionArgsIface, CreatedSessionIface, ForkSessionOptionsIface, ProjectSessionsApiIface, RespondArgs, SendOptionsIface, SessionHandleIface, SessionsApiIface, StreamOptionsIface, TurnHandleIface, TurnResultIface, } from "./sessions.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 ChannelBindingsApiIface,\n ChannelSourceIface,\n ChannelSourceOf,\n InstallChannelArgsIface,\n ProjectChannelsApiIface,\n PublishChannelArgsIface,\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 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 { ScheduleRef, ScheduleUpdateIface, SchedulesApiIface } 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;AAUP;AAAA,EACE;AAAA,EACA;AAAA,OAUK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAaP;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 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;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { type ChannelBindingsApiIface, type ChannelSourceOf, type ProjectChannelsApiIface } from "./channels.mjs";
1
+ import { type ChannelAppsApiIface, type ChannelSourceOf, type ProjectChannelsApiIface } from "./channels.mjs";
2
2
  import { type ClientContextIface } from "./context.mjs";
3
3
  import { type ProjectConversationsApiIface } from "./conversations.mjs";
4
4
  import { type EventsApiIface, type EventSubscriptionsApiIface } from "./events.mjs";
@@ -9,6 +9,7 @@ import { type ProjectAgentsApiIface } from "./project-agents.mjs";
9
9
  import { type ProjectResourceApiIface } from "./projects.mjs";
10
10
  import { type ProjectPublisherApiIface, type PublicNamesApiIface } from "./publishers.mjs";
11
11
  import { type SandboxProvidersApiIface } from "./sandbox-providers.mjs";
12
+ import { type ProjectSchedulesApiIface } from "./schedules.mjs";
12
13
  import { type SandboxesApiIface, type SandboxSetupsApiIface } from "./sandboxes.mjs";
13
14
  import { type ProjectSessionsApiIface } from "./sessions.mjs";
14
15
  import type { AgentStartDepsIface } from "./start.mjs";
@@ -22,7 +23,11 @@ export interface ProjectClientIface extends ProjectResourceApiIface {
22
23
  integrations: IntegrationsApiIface;
23
24
  harnesses: HarnessesApiIface;
24
25
  acpAdapters: AcpAdaptersApiIface;
25
- channels: ProjectChannelsApiIface & ChannelBindingsApiIface;
26
+ channels: ProjectChannelsApiIface;
27
+ /** Provider application credentials the project's channel installs use. */
28
+ channelApps: ChannelAppsApiIface;
29
+ /** The schedules of the project's conversations. */
30
+ schedules: ProjectSchedulesApiIface;
26
31
  /** The event feed for this project and those below it. */
27
32
  events: EventsApiIface;
28
33
  /** Pushes this project's feed to a URL (`webhooks:write`, project admin). */
@@ -1,5 +1,5 @@
1
1
  import {
2
- createChannelBindingsApi,
2
+ createChannelAppsApi,
3
3
  createProjectChannelsApi
4
4
  } from "./channels.mjs";
5
5
  import { encodePath } from "./context.mjs";
@@ -24,6 +24,7 @@ import {
24
24
  createPublicNamesApi
25
25
  } from "./publishers.mjs";
26
26
  import { createSandboxProvidersApi } from "./sandbox-providers.mjs";
27
+ import { createProjectSchedulesApi } from "./schedules.mjs";
27
28
  import {
28
29
  createSandboxesApi,
29
30
  createSandboxSetupsApi
@@ -44,10 +45,9 @@ const createProjectClient = (args) => {
44
45
  integrations: createIntegrationsApi({ context, projectId }),
45
46
  harnesses: createHarnessesApi({ context, projectId, store }),
46
47
  acpAdapters: createAcpAdaptersApi({ context, projectId }),
47
- channels: {
48
- ...createProjectChannelsApi({ context, projectId, sourceOf: args.channelSourceOf }),
49
- ...createChannelBindingsApi(context)
50
- },
48
+ channels: createProjectChannelsApi({ context, projectId, sourceOf: args.channelSourceOf }),
49
+ channelApps: createChannelAppsApi({ context, projectId }),
50
+ schedules: createProjectSchedulesApi({ context, projectId }),
51
51
  events: createEventsApi({ context, projectId }),
52
52
  eventSubscriptions: createEventSubscriptionsApi({
53
53
  context,
@@ -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 createChannelBindingsApi,\n createProjectChannelsApi,\n type ChannelBindingsApiIface,\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 {\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 & ChannelBindingsApiIface;\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: {\n ...createProjectChannelsApi({ context, projectId, sourceOf: args.channelSourceOf }),\n ...createChannelBindingsApi(context),\n },\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;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,gCAA8D;AA8BhE,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;AAAA,MACR,GAAG,yBAAyB,EAAE,SAAS,WAAW,UAAU,KAAK,gBAAgB,CAAC;AAAA,MAClF,GAAG,yBAAyB,OAAO;AAAA,IACrC;AAAA,IACA,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 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
+ "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,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;",
6
6
  "names": []
7
7
  }
@@ -26,6 +26,13 @@ export interface SandboxHandleIface {
26
26
  run: (args: RunSandboxCommandRequestIface & SignalOptionsIface) => Promise<RunSandboxCommandResponseIface>;
27
27
  /** What is known about the machine: checkouts, services, commands, notes. */
28
28
  description: (options?: SignalOptionsIface) => Promise<SandboxDescriptionIface>;
29
+ /**
30
+ * Sends the sandbox's outbound traffic through an integration's egress exit (`intg_...`),
31
+ * or straight out with `null`.
32
+ */
33
+ setEgressExit: (args: {
34
+ integration: string | null;
35
+ } & SignalOptionsIface) => Promise<SandboxResourceIface>;
29
36
  delete: (options?: SignalOptionsIface) => Promise<void>;
30
37
  }
31
38
  export interface SandboxesApiIface {
@@ -11,7 +11,8 @@ import {
11
11
  sandboxProviderListSchema,
12
12
  sandboxResourceSchema,
13
13
  sandboxSetupListSchema,
14
- sandboxSetupResourceSchema
14
+ sandboxSetupResourceSchema,
15
+ setSandboxEgressExitRequestSchema
15
16
  } from "@finalai/agent-protocol/agent-platform";
16
17
  import { encodePath } from "./context.mjs";
17
18
  import { HttpMethod } from "./http.mjs";
@@ -41,6 +42,13 @@ const createSandboxesApi = (args) => {
41
42
  response: sandboxDescriptionSchema,
42
43
  signal: options?.signal
43
44
  }),
45
+ setEgressExit: ({ signal, ...value }) => http.request({
46
+ method: HttpMethod.Put,
47
+ path: sandboxPath(resource.id, "/egress-exit"),
48
+ body: { schema: setSandboxEgressExitRequestSchema, value },
49
+ response: sandboxResourceSchema,
50
+ signal
51
+ }),
44
52
  delete: async (options) => {
45
53
  await http.request({
46
54
  method: HttpMethod.Delete,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/agent-client/sandboxes.ts"],
4
- "sourcesContent": ["import { jsonObjectSchema } from '@finalai/agent-protocol';\nimport type { SandboxEnvironmentValueIface } from '@finalai/agent-provider/sandbox/types';\nimport {\n createSandboxRequestSchema,\n okResponseSchema,\n publishSandboxSetupRequestSchema,\n publishSandboxSetupResponseSchema,\n runSandboxCommandRequestSchema,\n runSandboxCommandResponseSchema,\n sandboxDescriptionSchema,\n sandboxListSchema,\n sandboxProviderListSchema,\n sandboxResourceSchema,\n sandboxSetupListSchema,\n sandboxSetupResourceSchema,\n type PublishSandboxSetupResponseIface,\n type RunSandboxCommandRequestIface,\n type RunSandboxCommandResponseIface,\n type SandboxDescriptionIface,\n type SandboxListIface,\n type SandboxProviderIface,\n type SandboxResourceIface,\n type SandboxSetupInputIface,\n type SandboxSetupRefInputIface,\n type SandboxSetupResourceIface,\n} from '@finalai/agent-protocol/agent-platform';\nimport { encodePath, type ClientContextIface, type SignalOptionsIface } from \"./context.mjs\";\nimport { HttpMethod } from \"./http.mjs\";\n\nexport type { SandboxEnvironmentValueIface };\n\n// Sandboxes are project resources: a machine and its disk from a provider,\n// provided to an agent per capability by id. Creating one boots nothing.\n\n/** A published sandbox setup at a version, or `latest` (resolved once, at creation). */\nexport type SandboxSetupRefIface = SandboxSetupRefInputIface;\n\n/** Who a sandbox belongs to; it is deleted with its owner. */\nexport type SandboxOwnerIface = { conversation: string } | { session: string };\n\nexport interface CreateSandboxOptionsIface extends SignalOptionsIface {\n /** What should be on the machine: `defineSandboxSetup(...)`, or a published setup. */\n setup?: SandboxSetupInputIface | SandboxSetupRefIface;\n ownedBy?: SandboxOwnerIface;\n /** A retry with the same key returns the sandbox the first call created. */\n idempotencyKey?: string;\n}\n\nexport interface SandboxHandleIface {\n readonly id: string;\n /** The sandbox as it was when this handle was made. */\n readonly resource: SandboxResourceIface;\n get: (options?: SignalOptionsIface) => Promise<SandboxResourceIface>;\n /** Runs one command to completion, booting the sandbox if needed. */\n run: (\n args: RunSandboxCommandRequestIface & SignalOptionsIface,\n ) => Promise<RunSandboxCommandResponseIface>;\n /** What is known about the machine: checkouts, services, commands, notes. */\n description: (options?: SignalOptionsIface) => Promise<SandboxDescriptionIface>;\n delete: (options?: SignalOptionsIface) => Promise<void>;\n}\n\nexport interface SandboxesApiIface {\n create: (\n environment: SandboxEnvironmentValueIface,\n options?: CreateSandboxOptionsIface,\n ) => Promise<SandboxHandleIface>;\n get: (sandboxId: string, options?: SignalOptionsIface) => Promise<SandboxHandleIface>;\n list: (\n options?: SignalOptionsIface & {\n conversation?: string;\n session?: string;\n cursor?: string;\n limit?: number;\n },\n ) => Promise<SandboxListIface>;\n /** The providers this project can create sandboxes on. */\n providers: (options?: SignalOptionsIface) => Promise<SandboxProviderIface[]>;\n}\n\nexport interface SandboxSetupsApiIface {\n /** Publishes the next version of `name`. */\n publish: (\n args: { name: string; setup: SandboxSetupInputIface } & SignalOptionsIface,\n ) => Promise<PublishSandboxSetupResponseIface>;\n get: (\n args: { id: string; version?: number } & SignalOptionsIface,\n ) => Promise<SandboxSetupResourceIface>;\n list: (\n options?: SignalOptionsIface & { cursor?: string; limit?: number },\n ) => Promise<SandboxSetupResourceIface[]>;\n}\n\nconst projectPath = (projectId: string, suffix: string): string =>\n `/v1/projects/${encodePath(projectId)}${suffix}`;\n\nexport const createSandboxesApi = (args: {\n context: ClientContextIface;\n projectId: string;\n}): SandboxesApiIface => {\n const { http } = args.context;\n const sandboxPath = (sandboxId: string, suffix = '') =>\n projectPath(args.projectId, `/sandboxes/${encodePath(sandboxId)}${suffix}`);\n const handle = (resource: SandboxResourceIface): SandboxHandleIface => ({\n id: resource.id,\n resource,\n get: (options) =>\n http.request({\n method: HttpMethod.Get,\n path: sandboxPath(resource.id),\n response: sandboxResourceSchema,\n signal: options?.signal,\n }),\n run: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: sandboxPath(resource.id, '/run'),\n body: { schema: runSandboxCommandRequestSchema, value },\n response: runSandboxCommandResponseSchema,\n signal,\n }),\n description: (options) =>\n http.request({\n method: HttpMethod.Get,\n path: sandboxPath(resource.id, '/description'),\n response: sandboxDescriptionSchema,\n signal: options?.signal,\n }),\n delete: async (options) => {\n await http.request({\n method: HttpMethod.Delete,\n path: sandboxPath(resource.id),\n response: okResponseSchema,\n signal: options?.signal,\n });\n },\n });\n return {\n create: async (environment, options) =>\n handle(\n await http.request({\n method: HttpMethod.Post,\n path: projectPath(args.projectId, '/sandboxes'),\n body: {\n schema: createSandboxRequestSchema,\n value: {\n provider: environment.provider,\n environment: jsonObjectSchema.parse(environment.environment ?? {}),\n setup: options?.setup,\n ownedBy: options?.ownedBy,\n idempotencyKey: options?.idempotencyKey,\n },\n },\n response: sandboxResourceSchema,\n signal: options?.signal,\n }),\n ),\n get: async (sandboxId, options) =>\n handle(\n await http.request({\n method: HttpMethod.Get,\n path: sandboxPath(sandboxId),\n response: sandboxResourceSchema,\n signal: options?.signal,\n }),\n ),\n list: (options) =>\n http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, '/sandboxes'),\n query: {\n conversation: options?.conversation,\n session: options?.session,\n cursor: options?.cursor,\n limit: options?.limit,\n },\n response: sandboxListSchema,\n signal: options?.signal,\n }),\n providers: async (options) =>\n (\n await http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, '/sandbox-providers'),\n response: sandboxProviderListSchema,\n signal: options?.signal,\n })\n ).providers,\n };\n};\n\nexport const createSandboxSetupsApi = (args: {\n context: ClientContextIface;\n projectId: string;\n}): SandboxSetupsApiIface => {\n const { http } = args.context;\n return {\n publish: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: projectPath(args.projectId, '/sandbox-setups'),\n body: { schema: publishSandboxSetupRequestSchema, value },\n response: publishSandboxSetupResponseSchema,\n signal,\n }),\n get: ({ id, version, signal }) =>\n http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, `/sandbox-setups/${encodePath(id)}`),\n query: { version },\n response: sandboxSetupResourceSchema,\n signal,\n }),\n list: async (options) =>\n (\n await http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, '/sandbox-setups'),\n query: { cursor: options?.cursor, limit: options?.limit },\n response: sandboxSetupListSchema,\n signal: options?.signal,\n })\n ).setups,\n };\n};\n"],
5
- "mappings": "AAAA,SAAS,wBAAwB;AAEjC;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,OAWK;AACP,SAAS,kBAAoE;AAC7E,SAAS,kBAAkB;AAkE3B,MAAM,cAAc,CAAC,WAAmB,WACtC,gBAAgB,WAAW,SAAS,CAAC,GAAG,MAAM;AAEzC,MAAM,qBAAqB,CAAC,SAGV;AACvB,QAAM,EAAE,KAAK,IAAI,KAAK;AACtB,QAAM,cAAc,CAAC,WAAmB,SAAS,OAC/C,YAAY,KAAK,WAAW,cAAc,WAAW,SAAS,CAAC,GAAG,MAAM,EAAE;AAC5E,QAAM,SAAS,CAAC,cAAwD;AAAA,IACtE,IAAI,SAAS;AAAA,IACb;AAAA,IACA,KAAK,CAAC,YACJ,KAAK,QAAQ;AAAA,MACX,QAAQ,WAAW;AAAA,MACnB,MAAM,YAAY,SAAS,EAAE;AAAA,MAC7B,UAAU;AAAA,MACV,QAAQ,SAAS;AAAA,IACnB,CAAC;AAAA,IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,MACvB,KA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AAA,EACN;AACF;",
4
+ "sourcesContent": ["import { jsonObjectSchema } from '@finalai/agent-protocol';\nimport type { SandboxEnvironmentValueIface } from '@finalai/agent-provider/sandbox/types';\nimport {\n createSandboxRequestSchema,\n okResponseSchema,\n publishSandboxSetupRequestSchema,\n publishSandboxSetupResponseSchema,\n runSandboxCommandRequestSchema,\n runSandboxCommandResponseSchema,\n sandboxDescriptionSchema,\n sandboxListSchema,\n sandboxProviderListSchema,\n sandboxResourceSchema,\n sandboxSetupListSchema,\n sandboxSetupResourceSchema,\n setSandboxEgressExitRequestSchema,\n type PublishSandboxSetupResponseIface,\n type RunSandboxCommandRequestIface,\n type RunSandboxCommandResponseIface,\n type SandboxDescriptionIface,\n type SandboxListIface,\n type SandboxProviderIface,\n type SandboxResourceIface,\n type SandboxSetupInputIface,\n type SandboxSetupRefInputIface,\n type SandboxSetupResourceIface,\n} from '@finalai/agent-protocol/agent-platform';\nimport { encodePath, type ClientContextIface, type SignalOptionsIface } from \"./context.mjs\";\nimport { HttpMethod } from \"./http.mjs\";\n\nexport type { SandboxEnvironmentValueIface };\n\n// Sandboxes are project resources: a machine and its disk from a provider,\n// provided to an agent per capability by id. Creating one boots nothing.\n\n/** A published sandbox setup at a version, or `latest` (resolved once, at creation). */\nexport type SandboxSetupRefIface = SandboxSetupRefInputIface;\n\n/** Who a sandbox belongs to; it is deleted with its owner. */\nexport type SandboxOwnerIface = { conversation: string } | { session: string };\n\nexport interface CreateSandboxOptionsIface extends SignalOptionsIface {\n /** What should be on the machine: `defineSandboxSetup(...)`, or a published setup. */\n setup?: SandboxSetupInputIface | SandboxSetupRefIface;\n ownedBy?: SandboxOwnerIface;\n /** A retry with the same key returns the sandbox the first call created. */\n idempotencyKey?: string;\n}\n\nexport interface SandboxHandleIface {\n readonly id: string;\n /** The sandbox as it was when this handle was made. */\n readonly resource: SandboxResourceIface;\n get: (options?: SignalOptionsIface) => Promise<SandboxResourceIface>;\n /** Runs one command to completion, booting the sandbox if needed. */\n run: (\n args: RunSandboxCommandRequestIface & SignalOptionsIface,\n ) => Promise<RunSandboxCommandResponseIface>;\n /** What is known about the machine: checkouts, services, commands, notes. */\n description: (options?: SignalOptionsIface) => Promise<SandboxDescriptionIface>;\n /**\n * Sends the sandbox's outbound traffic through an integration's egress exit (`intg_...`),\n * or straight out with `null`.\n */\n setEgressExit: (\n args: { integration: string | null } & SignalOptionsIface,\n ) => Promise<SandboxResourceIface>;\n delete: (options?: SignalOptionsIface) => Promise<void>;\n}\n\nexport interface SandboxesApiIface {\n create: (\n environment: SandboxEnvironmentValueIface,\n options?: CreateSandboxOptionsIface,\n ) => Promise<SandboxHandleIface>;\n get: (sandboxId: string, options?: SignalOptionsIface) => Promise<SandboxHandleIface>;\n list: (\n options?: SignalOptionsIface & {\n conversation?: string;\n session?: string;\n cursor?: string;\n limit?: number;\n },\n ) => Promise<SandboxListIface>;\n /** The providers this project can create sandboxes on. */\n providers: (options?: SignalOptionsIface) => Promise<SandboxProviderIface[]>;\n}\n\nexport interface SandboxSetupsApiIface {\n /** Publishes the next version of `name`. */\n publish: (\n args: { name: string; setup: SandboxSetupInputIface } & SignalOptionsIface,\n ) => Promise<PublishSandboxSetupResponseIface>;\n get: (\n args: { id: string; version?: number } & SignalOptionsIface,\n ) => Promise<SandboxSetupResourceIface>;\n list: (\n options?: SignalOptionsIface & { cursor?: string; limit?: number },\n ) => Promise<SandboxSetupResourceIface[]>;\n}\n\nconst projectPath = (projectId: string, suffix: string): string =>\n `/v1/projects/${encodePath(projectId)}${suffix}`;\n\nexport const createSandboxesApi = (args: {\n context: ClientContextIface;\n projectId: string;\n}): SandboxesApiIface => {\n const { http } = args.context;\n const sandboxPath = (sandboxId: string, suffix = '') =>\n projectPath(args.projectId, `/sandboxes/${encodePath(sandboxId)}${suffix}`);\n const handle = (resource: SandboxResourceIface): SandboxHandleIface => ({\n id: resource.id,\n resource,\n get: (options) =>\n http.request({\n method: HttpMethod.Get,\n path: sandboxPath(resource.id),\n response: sandboxResourceSchema,\n signal: options?.signal,\n }),\n run: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: sandboxPath(resource.id, '/run'),\n body: { schema: runSandboxCommandRequestSchema, value },\n response: runSandboxCommandResponseSchema,\n signal,\n }),\n description: (options) =>\n http.request({\n method: HttpMethod.Get,\n path: sandboxPath(resource.id, '/description'),\n response: sandboxDescriptionSchema,\n signal: options?.signal,\n }),\n setEgressExit: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Put,\n path: sandboxPath(resource.id, '/egress-exit'),\n body: { schema: setSandboxEgressExitRequestSchema, value },\n response: sandboxResourceSchema,\n signal,\n }),\n delete: async (options) => {\n await http.request({\n method: HttpMethod.Delete,\n path: sandboxPath(resource.id),\n response: okResponseSchema,\n signal: options?.signal,\n });\n },\n });\n return {\n create: async (environment, options) =>\n handle(\n await http.request({\n method: HttpMethod.Post,\n path: projectPath(args.projectId, '/sandboxes'),\n body: {\n schema: createSandboxRequestSchema,\n value: {\n provider: environment.provider,\n environment: jsonObjectSchema.parse(environment.environment ?? {}),\n setup: options?.setup,\n ownedBy: options?.ownedBy,\n idempotencyKey: options?.idempotencyKey,\n },\n },\n response: sandboxResourceSchema,\n signal: options?.signal,\n }),\n ),\n get: async (sandboxId, options) =>\n handle(\n await http.request({\n method: HttpMethod.Get,\n path: sandboxPath(sandboxId),\n response: sandboxResourceSchema,\n signal: options?.signal,\n }),\n ),\n list: (options) =>\n http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, '/sandboxes'),\n query: {\n conversation: options?.conversation,\n session: options?.session,\n cursor: options?.cursor,\n limit: options?.limit,\n },\n response: sandboxListSchema,\n signal: options?.signal,\n }),\n providers: async (options) =>\n (\n await http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, '/sandbox-providers'),\n response: sandboxProviderListSchema,\n signal: options?.signal,\n })\n ).providers,\n };\n};\n\nexport const createSandboxSetupsApi = (args: {\n context: ClientContextIface;\n projectId: string;\n}): SandboxSetupsApiIface => {\n const { http } = args.context;\n return {\n publish: ({ signal, ...value }) =>\n http.request({\n method: HttpMethod.Post,\n path: projectPath(args.projectId, '/sandbox-setups'),\n body: { schema: publishSandboxSetupRequestSchema, value },\n response: publishSandboxSetupResponseSchema,\n signal,\n }),\n get: ({ id, version, signal }) =>\n http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, `/sandbox-setups/${encodePath(id)}`),\n query: { version },\n response: sandboxSetupResourceSchema,\n signal,\n }),\n list: async (options) =>\n (\n await http.request({\n method: HttpMethod.Get,\n path: projectPath(args.projectId, '/sandbox-setups'),\n query: { cursor: options?.cursor, limit: options?.limit },\n response: sandboxSetupListSchema,\n signal: options?.signal,\n })\n ).setups,\n };\n};\n"],
5
+ "mappings": "AAAA,SAAS,wBAAwB;AAEjC;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,OAWK;AACP,SAAS,kBAAoE;AAC7E,SAAS,kBAAkB;AAyE3B,MAAM,cAAc,CAAC,WAAmB,WACtC,gBAAgB,WAAW,SAAS,CAAC,GAAG,MAAM;AAEzC,MAAM,qBAAqB,CAAC,SAGV;AACvB,QAAM,EAAE,KAAK,IAAI,KAAK;AACtB,QAAM,cAAc,CAAC,WAAmB,SAAS,OAC/C,YAAY,KAAK,WAAW,cAAc,WAAW,SAAS,CAAC,GAAG,MAAM,EAAE;AAC5E,QAAM,SAAS,CAAC,cAAwD;AAAA,IACtE,IAAI,SAAS;AAAA,IACb;AAAA,IACA,KAAK,CAAC,YACJ,KAAK,QAAQ;AAAA,MACX,QAAQ,WAAW;AAAA,MACnB,MAAM,YAAY,SAAS,EAAE;AAAA,MAC7B,UAAU;AAAA,MACV,QAAQ,SAAS;AAAA,IACnB,CAAC;AAAA,IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,MACvB,KAAK,QAAQ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MAAM,KAAK,QAAQ;AAAA,MACjB,QAAQ,WAAW;AAAA,MACnB,MAAM,YAAY,KAAK,WAAW,iBAAiB;AAAA,MACnD,OAAO,EAAE,QAAQ,SAAS,QAAQ,OAAO,SAAS,MAAM;AAAA,MACxD,UAAU;AAAA,MACV,QAAQ,SAAS;AAAA,IACnB,CAAC,GACD;AAAA,EACN;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,24 +1,9 @@
1
- import { type ScheduleIface, type ScheduleRunResultIface, type UpdateScheduleRequestIface } from '@finalai/agent-protocol/agent-platform';
1
+ import { type ConversationScheduleIface } from '@finalai/agent-protocol/agent-platform';
2
2
  import { type ClientContextIface, type SignalOptionsIface } from "./context.mjs";
3
- import { type ProvideIface } from "./provide.mjs";
4
- export type ScheduleRef = {
5
- scheduleId: string;
6
- } | {
7
- agent: string;
8
- key: string;
9
- };
10
- export interface ScheduleUpdateIface extends Omit<UpdateScheduleRequestIface, 'provide'> {
11
- /** What its runs start with; fails with `requirements_unmet` unless it meets the agent's requirements. */
12
- provide?: ProvideIface;
3
+ export interface ProjectSchedulesApiIface {
4
+ list: (options?: SignalOptionsIface) => Promise<ConversationScheduleIface[]>;
13
5
  }
14
- export interface SchedulesApiIface {
15
- /** `agent` narrows to one agent's schedules, by its id. */
16
- list: (options?: SignalOptionsIface & {
17
- agent?: string;
18
- }) => Promise<ScheduleIface[]>;
19
- runNow: (args: ScheduleRef & SignalOptionsIface) => Promise<ScheduleRunResultIface>;
20
- update: (args: {
21
- scheduleId: string;
22
- } & ScheduleUpdateIface & SignalOptionsIface) => Promise<ScheduleIface>;
23
- }
24
- export declare const createSchedulesApi: ({ http }: ClientContextIface) => SchedulesApiIface;
6
+ export declare const createProjectSchedulesApi: (args: {
7
+ context: ClientContextIface;
8
+ projectId: string;
9
+ }) => ProjectSchedulesApiIface;
@@ -1,56 +1,17 @@
1
1
  import {
2
- scheduleListSchema,
3
- scheduleRunResultSchema,
4
- scheduleSchema,
5
- updateScheduleRequestSchema
2
+ projectScheduleListSchema
6
3
  } from "@finalai/agent-protocol/agent-platform";
7
4
  import { encodePath } from "./context.mjs";
8
- import { clientError, ClientErrorCode } from "./errors.mjs";
9
5
  import { HttpMethod } from "./http.mjs";
10
- import { provideDocumentOf } from "./provide.mjs";
11
- const createSchedulesApi = ({ http }) => {
12
- const list = async (options) => (await http.request({
6
+ const createProjectSchedulesApi = (args) => ({
7
+ list: async (options) => (await args.context.http.request({
13
8
  method: HttpMethod.Get,
14
- path: "/v1/schedules",
15
- query: { agent: options?.agent },
16
- response: scheduleListSchema,
9
+ path: `/v1/projects/${encodePath(args.projectId)}/schedules`,
10
+ response: projectScheduleListSchema,
17
11
  signal: options?.signal
18
- })).schedules;
19
- const scheduleIdOf = async (args) => {
20
- if ("scheduleId" in args) return args.scheduleId;
21
- const found = (await list({ agent: args.agent, signal: args.signal })).find(
22
- (schedule) => schedule.key === args.key
23
- );
24
- if (found == null) {
25
- throw clientError({
26
- message: `No schedule ${args.key} on agent ${args.agent}`,
27
- status: 0,
28
- code: ClientErrorCode.NotFound
29
- });
30
- }
31
- return found.id;
32
- };
33
- return {
34
- list,
35
- runNow: async (args) => http.request({
36
- method: HttpMethod.Post,
37
- path: `/v1/schedules/${encodePath(await scheduleIdOf(args))}/run-now`,
38
- response: scheduleRunResultSchema,
39
- signal: args.signal
40
- }),
41
- update: ({ scheduleId, signal, provide, ...value }) => http.request({
42
- method: HttpMethod.Patch,
43
- path: `/v1/schedules/${encodePath(scheduleId)}`,
44
- body: {
45
- schema: updateScheduleRequestSchema,
46
- value: { ...value, ...provide == null ? {} : { provide: provideDocumentOf(provide) } }
47
- },
48
- response: scheduleSchema,
49
- signal
50
- })
51
- };
52
- };
12
+ })).schedules
13
+ });
53
14
  export {
54
- createSchedulesApi
15
+ createProjectSchedulesApi
55
16
  };
56
17
  //# sourceMappingURL=schedules.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/agent-client/schedules.ts"],
4
- "sourcesContent": ["import {\n scheduleListSchema,\n scheduleRunResultSchema,\n scheduleSchema,\n updateScheduleRequestSchema,\n type ScheduleIface,\n type ScheduleRunResultIface,\n type UpdateScheduleRequestIface,\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\";\nimport { provideDocumentOf, type ProvideIface } from \"./provide.mjs\";\n\n// An agent's own schedules. Nobody is calling when one fires, so each carries\n// what its runs are provided.\n\nexport type ScheduleRef = { scheduleId: string } | { agent: string; key: string };\n\nexport interface ScheduleUpdateIface extends Omit<UpdateScheduleRequestIface, 'provide'> {\n /** What its runs start with; fails with `requirements_unmet` unless it meets the agent's requirements. */\n provide?: ProvideIface;\n}\n\nexport interface SchedulesApiIface {\n /** `agent` narrows to one agent's schedules, by its id. */\n list: (options?: SignalOptionsIface & { agent?: string }) => Promise<ScheduleIface[]>;\n runNow: (args: ScheduleRef & SignalOptionsIface) => Promise<ScheduleRunResultIface>;\n update: (\n args: { scheduleId: string } & ScheduleUpdateIface & SignalOptionsIface,\n ) => Promise<ScheduleIface>;\n}\n\nexport const createSchedulesApi = ({ http }: ClientContextIface): SchedulesApiIface => {\n const list: SchedulesApiIface['list'] = async (options) =>\n (\n await http.request({\n method: HttpMethod.Get,\n path: '/v1/schedules',\n query: { agent: options?.agent },\n response: scheduleListSchema,\n signal: options?.signal,\n })\n ).schedules;\n\n const scheduleIdOf = async (args: ScheduleRef & SignalOptionsIface): Promise<string> => {\n if ('scheduleId' in args) return args.scheduleId;\n const found = (await list({ agent: args.agent, signal: args.signal })).find(\n (schedule) => schedule.key === args.key,\n );\n if (found == null) {\n throw clientError({\n message: `No schedule ${args.key} on agent ${args.agent}`,\n status: 0,\n code: ClientErrorCode.NotFound,\n });\n }\n return found.id;\n };\n\n return {\n list,\n runNow: async (args) =>\n http.request({\n method: HttpMethod.Post,\n path: `/v1/schedules/${encodePath(await scheduleIdOf(args))}/run-now`,\n response: scheduleRunResultSchema,\n signal: args.signal,\n }),\n update: ({ scheduleId, signal, provide, ...value }) =>\n http.request({\n method: HttpMethod.Patch,\n path: `/v1/schedules/${encodePath(scheduleId)}`,\n body: {\n schema: updateScheduleRequestSchema,\n value: { ...value, ...(provide == null ? {} : { provide: provideDocumentOf(provide) }) },\n },\n response: scheduleSchema,\n signal,\n }),\n };\n};\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP,SAAS,kBAAoE;AAC7E,SAAS,aAAa,uBAAuB;AAC7C,SAAS,kBAAkB;AAC3B,SAAS,yBAA4C;AAqB9C,MAAM,qBAAqB,CAAC,EAAE,KAAK,MAA6C;AACrF,QAAM,OAAkC,OAAO,aAE3C,MAAM,KAAK,QAAQ;AAAA,IACjB,QAAQ,WAAW;AAAA,IACnB,MAAM;AAAA,IACN,OAAO,EAAE,OAAO,SAAS,MAAM;AAAA,IAC/B,UAAU;AAAA,IACV,QAAQ,SAAS;AAAA,EACnB,CAAC,GACD;AAEJ,QAAM,eAAe,OAAO,SAA4D;AACtF,QAAI,gBAAgB,KAAM,QAAO,KAAK;AACtC,UAAM,SAAS,MAAM,KAAK,EAAE,OAAO,KAAK,OAAO,QAAQ,KAAK,OAAO,CAAC,GAAG;AAAA,MACrE,CAAC,aAAa,SAAS,QAAQ,KAAK;AAAA,IACtC;AACA,QAAI,SAAS,MAAM;AACjB,YAAM,YAAY;AAAA,QAChB,SAAS,eAAe,KAAK,GAAG,aAAa,KAAK,KAAK;AAAA,QACvD,QAAQ;AAAA,QACR,MAAM,gBAAgB;AAAA,MACxB,CAAC;AAAA,IACH;AACA,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AAAA,IACL;AAAA,IACA,QAAQ,OAAO,SACb,KAAK,QAAQ;AAAA,MACX,QAAQ,WAAW;AAAA,MACnB,MAAM,iBAAiB,WAAW,MAAM,aAAa,IAAI,CAAC,CAAC;AAAA,MAC3D,UAAU;AAAA,MACV,QAAQ,KAAK;AAAA,IACf,CAAC;AAAA,IACH,QAAQ,CAAC,EAAE,YAAY,QAAQ,SAAS,GAAG,MAAM,MAC/C,KAAK,QAAQ;AAAA,MACX,QAAQ,WAAW;AAAA,MACnB,MAAM,iBAAiB,WAAW,UAAU,CAAC;AAAA,MAC7C,MAAM;AAAA,QACJ,QAAQ;AAAA,QACR,OAAO,EAAE,GAAG,OAAO,GAAI,WAAW,OAAO,CAAC,IAAI,EAAE,SAAS,kBAAkB,OAAO,EAAE,EAAG;AAAA,MACzF;AAAA,MACA,UAAU;AAAA,MACV;AAAA,IACF,CAAC;AAAA,EACL;AACF;",
4
+ "sourcesContent": ["import {\n projectScheduleListSchema,\n type ConversationScheduleIface,\n} from '@finalai/agent-protocol/agent-platform';\nimport { encodePath, type ClientContextIface, type SignalOptionsIface } from \"./context.mjs\";\nimport { HttpMethod } from \"./http.mjs\";\n\n// A project's schedules: the timers in its conversations. Create, change and run them through\n// their conversation (`conversations.get(id).createSchedule`, `.runSchedule`).\n\nexport interface ProjectSchedulesApiIface {\n list: (options?: SignalOptionsIface) => Promise<ConversationScheduleIface[]>;\n}\n\nexport const createProjectSchedulesApi = (args: {\n context: ClientContextIface;\n projectId: string;\n}): ProjectSchedulesApiIface => ({\n list: async (options) =>\n (\n await args.context.http.request({\n method: HttpMethod.Get,\n path: `/v1/projects/${encodePath(args.projectId)}/schedules`,\n response: projectScheduleListSchema,\n signal: options?.signal,\n })\n ).schedules,\n});\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,OAEK;AACP,SAAS,kBAAoE;AAC7E,SAAS,kBAAkB;AASpB,MAAM,4BAA4B,CAAC,UAGT;AAAA,EAC/B,MAAM,OAAO,aAET,MAAM,KAAK,QAAQ,KAAK,QAAQ;AAAA,IAC9B,QAAQ,WAAW;AAAA,IACnB,MAAM,gBAAgB,WAAW,KAAK,SAAS,CAAC;AAAA,IAChD,UAAU;AAAA,IACV,QAAQ,SAAS;AAAA,EACnB,CAAC,GACD;AACN;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  export * from '@finalai/agent-definition/authoring';
2
2
  export { documentOf } from '@finalai/agent-definition';
3
3
  export type { AgentAvatarIface, AvatarMedia, AvatarState } from '@finalai/agent-protocol';
4
- export type { ChannelCredentialsIface, ChannelDefinitionIface, ChannelEventContextIface, ChannelReceiveContextIface, ChannelSocketIface, ConversationHandle, PersonHandle, PlaceRef, PrincipalRef, RoomPlatformIface, RouteDefinitionIface, } from '@finalai/agent-provider';
4
+ export type { ChannelCredentialsIface, ChannelDefinitionIface, ChannelEventContextIface, ChannelIngressContextIface, ChannelIngressIface, ChannelReceiveContextIface, ChannelRequireIface, ChannelSocketIface, ConversationHandle, PersonHandle, PlaceRef, PrincipalRef, RouteDefinitionIface, } from '@finalai/agent-provider';
5
5
  export type { AgentDocumentIface } from '@finalai/agent-provider/document';
6
6
  export { HarnessFeature } from '@finalai/agent-provider/document';
7
7
  export { PermissionLevel, InferenceSourceKind } from '@finalai/agent-protocol/agent-platform';
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/public.ts"],
4
- "sourcesContent": ["// Agent authoring: an agent is a value that lists every part explicitly and\n// states what it requires. `documentOf(agent)` is its document (data).\nexport * from '@finalai/agent-definition/authoring';\nexport { documentOf } from '@finalai/agent-definition';\n\nexport type { AgentAvatarIface, AvatarMedia, AvatarState } from '@finalai/agent-protocol';\nexport type {\n ChannelCredentialsIface,\n ChannelDefinitionIface,\n ChannelEventContextIface,\n ChannelReceiveContextIface,\n ChannelSocketIface,\n ConversationHandle,\n PersonHandle,\n PlaceRef,\n PrincipalRef,\n RoomPlatformIface,\n RouteDefinitionIface,\n} from '@finalai/agent-provider';\nexport type { AgentDocumentIface } from '@finalai/agent-provider/document';\n\n// Harness and ACP adapter definitions (defineHarness, defineAcpAdapter) and\n// the values they take.\nexport { HarnessFeature } from '@finalai/agent-provider/document';\nexport { PermissionLevel, InferenceSourceKind } from '@finalai/agent-protocol/agent-platform';\nexport {\n AcpTransport,\n CredentialDelivery,\n McpTransportKind,\n PromptWhileRunning,\n SandboxWire,\n} from '@finalai/agent-provider/harness';\nexport {\n AdapterConfigurationDelivery,\n FinalExtension,\n RuntimeKind,\n harnessDefinitionHash,\n acpAdapterDefinitionHash,\n type AcpAdapterDefinitionIface,\n type AcpAdapterDefinitionInputIface,\n type HarnessDefinitionIface,\n type HarnessDefinitionInputIface,\n} from '@finalai/agent-provider/harness-definition';\nexport type {\n HarnessProviderCloseArgsIface,\n HarnessProviderContextIface,\n HarnessProviderEndpointResultIface,\n HarnessProviderIface,\n HarnessProviderOpenArgsIface,\n HarnessProviderOpenResultIface,\n HarnessProviderRefusalIface,\n HarnessProviderRefArgsIface,\n HarnessProviderResumeArgsIface,\n} from '@finalai/agent-provider/harness-provider';\n"],
5
- "mappings": "AAEA,cAAc;AACd,SAAS,kBAAkB;AAoB3B,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB,2BAA2B;AACrD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;",
4
+ "sourcesContent": ["// Agent authoring: an agent is a value that lists every part explicitly and\n// states what it requires. `documentOf(agent)` is its document (data).\nexport * from '@finalai/agent-definition/authoring';\nexport { documentOf } from '@finalai/agent-definition';\n\nexport type { AgentAvatarIface, AvatarMedia, AvatarState } from '@finalai/agent-protocol';\nexport type {\n ChannelCredentialsIface,\n ChannelDefinitionIface,\n ChannelEventContextIface,\n ChannelIngressContextIface,\n ChannelIngressIface,\n ChannelReceiveContextIface,\n ChannelRequireIface,\n ChannelSocketIface,\n ConversationHandle,\n PersonHandle,\n PlaceRef,\n PrincipalRef,\n RouteDefinitionIface,\n} from '@finalai/agent-provider';\nexport type { AgentDocumentIface } from '@finalai/agent-provider/document';\n\n// Harness and ACP adapter definitions (defineHarness, defineAcpAdapter) and\n// the values they take.\nexport { HarnessFeature } from '@finalai/agent-provider/document';\nexport { PermissionLevel, InferenceSourceKind } from '@finalai/agent-protocol/agent-platform';\nexport {\n AcpTransport,\n CredentialDelivery,\n McpTransportKind,\n PromptWhileRunning,\n SandboxWire,\n} from '@finalai/agent-provider/harness';\nexport {\n AdapterConfigurationDelivery,\n FinalExtension,\n RuntimeKind,\n harnessDefinitionHash,\n acpAdapterDefinitionHash,\n type AcpAdapterDefinitionIface,\n type AcpAdapterDefinitionInputIface,\n type HarnessDefinitionIface,\n type HarnessDefinitionInputIface,\n} from '@finalai/agent-provider/harness-definition';\nexport type {\n HarnessProviderCloseArgsIface,\n HarnessProviderContextIface,\n HarnessProviderEndpointResultIface,\n HarnessProviderIface,\n HarnessProviderOpenArgsIface,\n HarnessProviderOpenResultIface,\n HarnessProviderRefusalIface,\n HarnessProviderRefArgsIface,\n HarnessProviderResumeArgsIface,\n} from '@finalai/agent-provider/harness-provider';\n"],
5
+ "mappings": "AAEA,cAAc;AACd,SAAS,kBAAkB;AAsB3B,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB,2BAA2B;AACrD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;",
6
6
  "names": []
7
7
  }
@@ -15,7 +15,7 @@ const project = client.project({ id: projectId });
15
15
 
16
16
  // Provider-neutral: what should be on the machine.
17
17
  const setup = defineSandboxSetup({
18
- repositories: [{ alias: 'app', repository: 'acme/app', ref: 'main' }],
18
+ repositories: [{ alias: 'app', url: 'https://github.com/acme/app.git', ref: 'main' }],
19
19
  variables: { NPM_TOKEN: { secret: 'NPM_TOKEN' } },
20
20
  steps: [{ cwd: 'app', run: 'pnpm install' }],
21
21
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finalai/agents",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "private": false,
5
5
  "description": "Agent authoring, client APIs, and CLI.",
6
6
  "license": "Apache-2.0",
@@ -71,11 +71,6 @@
71
71
  "import": "./dist/modules/authoring/channels.mjs",
72
72
  "default": "./dist/modules/authoring/channels.mjs"
73
73
  },
74
- "./channels/final": {
75
- "types": "./dist/modules/authoring/final-channel.d.mts",
76
- "import": "./dist/modules/authoring/final-channel.mjs",
77
- "default": "./dist/modules/authoring/final-channel.mjs"
78
- },
79
74
  "./harnesses": {
80
75
  "types": "./dist/modules/harnesses.d.mts",
81
76
  "import": "./dist/modules/harnesses.mjs",
@@ -119,10 +114,10 @@
119
114
  },
120
115
  "dependencies": {
121
116
  "@agentclientprotocol/sdk": "1.8.0",
122
- "@finalai/agent-definition": "0.9.0",
123
- "@finalai/agent-protocol": "0.9.0",
124
- "@finalai/agent-provider": "0.10.0",
125
- "@finalai/final-agent-provider": "0.11.0",
117
+ "@finalai/agent-definition": "0.10.0",
118
+ "@finalai/agent-protocol": "0.10.0",
119
+ "@finalai/agent-provider": "0.11.0",
120
+ "@finalai/final-agent-provider": "0.12.0",
126
121
  "@finalai/websockets": "0.1.8",
127
122
  "ws": "^8.21.3",
128
123
  "zod": "4.6.6"
@@ -1 +0,0 @@
1
- export * from '@finalai/final-agent-provider/channels/final';
@@ -1,2 +0,0 @@
1
- export * from "@finalai/final-agent-provider/channels/final";
2
- //# sourceMappingURL=final-channel.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/authoring/final-channel.ts"],
4
- "sourcesContent": ["export * from '@finalai/final-agent-provider/channels/final';\n"],
5
- "mappings": "AAAA,cAAc;",
6
- "names": []
7
- }