glove-foundry 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -4
- package/dist/chunk-CYOIHSUX.js +1365 -0
- package/dist/{chunk-X6EWEWWM.js → chunk-DTFCEX67.js} +2003 -200
- package/dist/{chunk-OBTOFA7W.js → chunk-EUGKVW3J.js} +470 -638
- package/dist/{chunk-B36BGF5R.js → chunk-J6NHL4SM.js} +370 -74
- package/dist/{chunk-7F7QVO6I.js → chunk-L5JQVTHD.js} +30 -0
- package/dist/{chunk-RSU7NEDK.js → chunk-X3HZYVZS.js} +36 -1
- package/dist/cli.js +4 -4
- package/dist/{client-DWPYe_Nc.d.ts → client-CekanYLW.d.ts} +252 -161
- package/dist/client.d.ts +3 -3
- package/dist/client.js +1 -1
- package/dist/config.d.ts +7 -0
- package/dist/{definition-A8o11aez.d.ts → event-delivery-CNCsVqi8.d.ts} +1380 -871
- package/dist/execution-agent.d.ts +0 -1
- package/dist/execution-agent.js +3 -14
- package/dist/execution-daemon.js +10 -5
- package/dist/execution-loader.js +1171 -8
- package/dist/index.d.ts +21 -6
- package/dist/index.js +178 -32
- package/dist/voice.d.ts +12 -8
- package/dist/voice.js +51 -10
- package/docs/README.md +1 -1
- package/docs/architecture.md +8 -0
- package/docs/building-with-foundry.md +137 -5
- package/docs/durable-subagents.md +337 -0
- package/docs/execution.md +4 -0
- package/docs/inspector.md +137 -29
- package/package.json +12 -11
- package/templates/travel-concierge/README.md +1 -1
- package/dist/chunk-K2EU63MB.js +0 -468
- package/dist/chunk-TFGETZYH.js +0 -917
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { Effect } from 'effect';
|
|
1
|
+
import { b as FoundryDataAdapter, E as EnvironmentValue, c as AgentInstance, C as Conversation, P as PlaybookSubscription, d as FoundryActivationRecord, e as ProvisionAgentOptions, I as InboundDeliveryClaim, f as FoundryEventRecord, g as FoundryPendingInbound, h as FoundryApproval, W as WorkspaceEntry, i as FoundryWorkingEnvironmentSnapshotOwner, S as SharedInboxItem, j as FoundryTask, k as AgentPlaybook, l as AnyFoundryTransmission, m as AccountReference, n as InferAccountMetadata, o as AgentBinding, p as FoundryAgentApplication, q as InboundRoute, O as OutboundRoute, r as CapabilityDefinition, s as InferInboundConfig, t as InferOutboundConfig } from './event-delivery-CNCsVqi8.js';
|
|
2
|
+
export { u as AccountContract, v as AccountId, w as AccountNotFound, x as AccountSessionUnavailable, y as AccountSummary, z as AgentApplicationContribution, B as AgentApplicationInstallContext, D as AgentApplicationOptions, G as AgentAssemblyContext, H as AgentAssemblyOptions, J as AgentDefinitionId, K as AgentDefinitionSurfaceContext, L as AgentFactoryContext, A as AgentHandlerContext, M as AgentId, N as AgentInstallContext, Q as AgentInstallation, R as AgentInstallationKind, T as AgentMessageReceipt, U as AgentPlaybookInput, V as AgentProvisioningPolicy, X as AgentRuntimeControls, Y as AnyFoundryAgent, Z as AppRestrictions, _ as ApplicationConnectionContext, $ as ApplicationConnectionState, a0 as ApplicationConnectionStatus, a1 as BindingId, a2 as BindingNotFound, a3 as CapabilityId, a4 as ComposedAgentPlaybook, a5 as ComposedAgentPlaybookInput, a6 as ConnectionReceiveInput, a7 as CreateAgentInstanceOptions, a8 as CreateConversationOptions, a9 as CustomProvisionedAgent, aa as CustomProvisioningContext, ab as DEFAULT_APPROVAL_EXPIRES_AFTER_MS, ac as DEFAULT_APPROVAL_WAIT_MS, ad as DefineAgentOptions, ae as DefineConnectionOptions, af as DefineFoundryReplOptions, ag as DefineFoundryScheduleOptions, ah as DefineFoundrySubagentOptions, ai as DefineFoundryWorkingEnvironmentOptions, aj as DefinePlaybookSubscriptionOptions, ak as DefinitionConfigInput, al as DurableSubagentOptions, am as DurableSubagentOwnership, an as DurableSubagents, ao as EMPTY_AGENT_COMPOSITION, ap as EMPTY_CAPABILITY_REGISTRY, aq as EMPTY_NATIVE_REGISTRY, ar as EgressAdapter, as as EgressContext, at as EventId, au as EventNotFound, av as EventReference, aw as FOUNDRY_AGENT_APPLICATION_BRAND, ax as FOUNDRY_AGENT_BRAND, ay as FOUNDRY_AGENT_DEFINITION_BRAND, az as FOUNDRY_AGENT_FILE_ENV, aA as FOUNDRY_AGENT_ROUTE_ENV, aB as FOUNDRY_APPLICATION_ENV, aC as FOUNDRY_APPROVAL_DIRECTORY_ENV, aD as FOUNDRY_COMPOSED_PLAYBOOK_BRAND, aE as FOUNDRY_CONNECTION_BRAND, aF as FOUNDRY_CORE_COMMAND_EVENT, aG as FOUNDRY_EVENT_PREFIX, aH as FOUNDRY_EXECUTION_MARKER, aI as FOUNDRY_LAYER_BRAND, aJ as FOUNDRY_MCP_BRAND, aK as FOUNDRY_MEMORY_BRAND, aL as FOUNDRY_PLAYBOOK_ACTION_BRAND, aM as FOUNDRY_REPL_BRAND, aN as FOUNDRY_SCHEDULE_BRAND, aO as FOUNDRY_SHARED_TOOL_BRAND, aP as FOUNDRY_SUBSCRIBER_BRAND, aQ as FOUNDRY_TRANSMISSION_BRAND, aR as FOUNDRY_TRANSMISSION_EVENT_BRAND, aS as FOUNDRY_TRANSMISSION_PREDICATE_BRAND, aT as FOUNDRY_WORKING_ENVIRONMENT_BRAND, aU as FoundryAccountSessionAdapter, aV as FoundryAgent, aW as FoundryAgentComponent, aX as FoundryAgentComposition, aY as FoundryAgentConventionModule, aZ as FoundryAgentDefinition, a_ as FoundryAgentMode, a$ as FoundryApp, b0 as FoundryAppMcp, b1 as FoundryAppMcpTool, b2 as FoundryAppToolDecision, b3 as FoundryApplicationConnection, b4 as FoundryApprovalDecision, b5 as FoundryApprovalDisplayManager, b6 as FoundryApprovalPolicy, b7 as FoundryApprovalStatus, b8 as FoundryCall, b9 as FoundryCallContext, ba as FoundryCallOptions, bb as FoundryCapabilityKind, bc as FoundryCapabilityManifest, bd as FoundryCapabilityManifestEntry, be as FoundryCapabilityRegistry, bf as FoundryCompositionSource, bg as FoundryContextProvider, bh as FoundryCoreCommand, bi as FoundryDelegate, bj as FoundryDelegateOptions, bk as FoundryDelegation, bl as FoundryDelegationReply, bm as FoundryDelegationStatus, F as FoundryDelegationUpdate, bn as FoundryDomainError, bo as FoundryEventPolicy, bp as FoundryEventTarget, bq as FoundryExecutionContext, br as FoundryFactsOptions, bs as FoundryFormsOptions, bt as FoundryGoalsOptions, bu as FoundryGuidanceHandles, bv as FoundryGuidanceScope, bw as FoundryHookDefinition, bx as FoundryInstallable, by as FoundryInstalledApp, bz as FoundryInstanceProvisioner, bA as FoundryJavaScriptReplDefinition, bB as FoundryLayer, bC as FoundryLayerOptions, bD as FoundryLayerReference, bE as FoundryLayerSelection, bF as FoundryLispReplDefinition, bG as FoundryListResolver, bH as FoundryMcp, bI as FoundryMcpOptions, bJ as FoundryMemoryProfile, bK as FoundryMemoryProfileOptions, bL as FoundryMemoryReference, bM as FoundryMemorySelection, bN as FoundryMeshConfig, a as FoundryMeshMessage, bO as FoundryMeshOptions, bP as FoundryMeshParty, bQ as FoundryMeshThread, bR as FoundryMeshThreadStatus, bS as FoundryMessageInput, bT as FoundryMessageOptions, bU as FoundryMountedRepl, bV as FoundryNativeManifest, bW as FoundryNativeManifestEntry, bX as FoundryNativeRegistry, bY as FoundryPlaybookAction, bZ as FoundryProgrammaticToolContext, b_ as FoundryProgrammaticToolSelection, b$ as FoundryProgrammaticTools, c0 as FoundryPythonReplDefinition, c1 as FoundryReplApp, c2 as FoundryReplDefinition, c3 as FoundryRequest, c4 as FoundryResolvedMcp, c5 as FoundryResolver, c6 as FoundryResult, c7 as FoundryRouteMap, c8 as FoundryScheduleDefinition, c9 as FoundryScheduleTiming, ca as FoundryScheduleTimingInput, cb as FoundrySharedTool, cc as FoundrySubagentToolContext, cd as FoundrySubscriber, ce as FoundrySubscriberOptions, cf as FoundrySubscriberSelection, cg as FoundrySurfaceContext, ch as FoundrySuspension, ci as FoundryToolBody, cj as FoundryTransmission, ck as FoundryTransmissionDelivery, cl as FoundryTransmissionEvent, cm as FoundryTransmissionPredicate, cn as FoundryVfs, co as FoundryVfsHandle, cp as FoundryWorkingEnvironmentCreateContext, cq as FoundryWorkingEnvironmentDefinition, cr as FoundryWorkingEnvironmentPersistenceAdapter, cs as FoundryWorkingEnvironmentPersistenceContext, ct as GrantResolutionError, cu as InboundContract, cv as InferAgentInput, cw as InferAgentOutput, cx as InferInboundEvent, cy as InferOutboundInput, cz as InferOutboundOutput, cA as IngressAdapter, cB as IngressContext, cC as InstallationSelection, cD as McpAdapterFactory, cE as MemoryFoundryDataAdapter, cF as OutboundContract, cG as PlaybookActionOptions, cH as PlaybookDirective, cI as PlaybookDirectiveInput, cJ as PlaybookMatch, cK as PlaybookMatchInput, cL as PlaybookOutboundDirective, cM as PlaybookOutboundInput, cN as PlaybookSubscriptionTarget, cO as PlaybookSubscriptionTargetInput, cP as ReplyPolicy, cQ as Route, cR as RouteId, cS as RouteNotFound, cT as RunGrant, cU as RunId, cV as SharedToolOptions, cW as TopologyConflict, cX as TransmissionEventDirection, cY as TransmissionEventOptions, cZ as TransmissionId, c_ as TransmissionOptions, c$ as TransmissionPredicateOptions, d0 as TransmissionSerializationContext, d1 as UpdateAgentInstanceOptions, d2 as UpdateConversationOptions, d3 as composeAgent, d4 as composePlaybook, d5 as configureLayer, d6 as configureMemory, d7 as createAgentInstance, d8 as createConversation, d9 as createFoundryApproval, da as createFoundryCoreTools, db as createInstalledApplicationTransmissionTools, dc as defineAgent, dd as defineAgentApplication, de as defineAgentFromModule, df as defineAgentInstance, dg as defineApp, dh as defineCall, di as defineConnection, dj as defineFacts, dk as defineForms, dl as defineGoals, dm as defineLayer, dn as defineMcp, dp as defineMemory, dq as definePlaybookAction, dr as definePlaybookSubscription, ds as defineRepl, dt as defineRoutes, du as defineSchedule, dv as defineSharedTool, dw as defineSubagent, dx as defineSubscriber, dy as defineTransmission, dz as defineTransmissionEvent, dA as defineTransmissionPredicate, dB as defineWorkingEnvironment, dC as foundryDataEnvironmentPersistence, dD as foundryGuidanceSubject, dE as hostedMeshOptions, dF as install, dG as installRegistry, dH as installationKey, dI as installedApplicationTransmissionToolName, dJ as internalAgentName, dK as isFoundryAgent, dL as isFoundryAgentDefinition, dM as isFoundryCapability, dN as isFoundryLayer, dO as isFoundrySchedule, dP as isFoundrySubscriber, dQ as isFoundryTransmission, dR as isInboxCapableStore, dS as isMeshTransport, dT as listFoundryApprovals, dU as meshIdentity, dV as mountAgentDefinitionMemory, dW as mountFoundrySurfaces, dX as reconstructAgentInstance, dY as reconstructPlaybook, dZ as reconstructPlaybookSubscription, d_ as resolveFoundryApproval, d$ as restrictApp, e0 as routeFromInternalAgentName, e1 as toGloveMessage, e2 as toGloveRequestInput, e3 as transmissionPredicate, e4 as withFoundryPermissions } from './event-delivery-CNCsVqi8.js';
|
|
3
|
+
import { Effect, Layer } from 'effect';
|
|
4
4
|
import { EnvSnapshot } from 'glove-working-environment';
|
|
5
|
-
import { F as FoundryRuntime, D as DiscoveredAgent, a as FoundryManifest } from './client-
|
|
6
|
-
export { A as AccountDirectory, b as AccountFilter, c as AccountSessionAdapter, d as AccountSessionRequest, B as BindingFilter, E as EMPTY_FOUNDRY_APPLICATION, e as EventFilter, f as EventStore, g as FOUNDRY_APPLICATION_BRAND, h as
|
|
5
|
+
import { T as TopologyStore, F as FoundryRuntime, D as DiscoveredAgent, a as FoundryManifest } from './client-CekanYLW.js';
|
|
6
|
+
export { A as AccountDirectory, b as AccountFilter, c as AccountSessionAdapter, d as AccountSessionRequest, B as BindingFilter, E as EMPTY_FOUNDRY_APPLICATION, e as EventFilter, f as EventStore, g as FOUNDRY_APPLICATION_BRAND, h as FoundryApplication, i as FoundryApplicationManifest, j as FoundryApplicationOptions, k as FoundryClient, l as FoundryClientAuthorizationAdapter, m as FoundryClientOptions, n as FoundryConversationTranscript, o as FoundryEvent, p as FoundryEventCategory, q as FoundryHealth, r as FoundryManifestAgent, s as FoundryManifestCapability, t as FoundryManifestTransmission, u as FoundryObservabilityAdapter, v as FoundryRequestAuthorizationAdapter, w as FoundryRequestAuthorizationInput, x as FoundryRun, y as FoundryRunHandle, z as FoundryRuntimeError, C as FoundryRuntimeOptions, G as FoundrySteerHandleResult, H as FoundrySteerResult, I as GrantResolver, M as ManifestCompilationError, J as MemoryObservabilityAdapter, R as ResolveGrantRequest, K as RouteFilter, W as WaitOptions, L as compileApplicationManifest, N as createFoundryClient, O as createManifest, P as defineApplication, Q as discoverAgents, S as findAgentFiles, U as grantResolverLive, V as isFoundryApplication, X as memoryAccountDirectory, Y as memoryEventStore, Z as memoryTopologyStore, _ as routeFromAgentFile } from './client-CekanYLW.js';
|
|
7
7
|
import { AddressInfo } from 'node:net';
|
|
8
8
|
import { FoundryBrandingConfig } from './config.js';
|
|
9
9
|
export { FoundryConfig, FoundryExecutionConfig, defineConfig } from './config.js';
|
|
@@ -65,6 +65,7 @@ declare class FileFoundryDataAdapter implements FoundryDataAdapter {
|
|
|
65
65
|
putAgent(agent: AgentInstance): Effect.Effect<void, unknown, never>;
|
|
66
66
|
listAgents(definitionId?: string): Effect.Effect<AgentInstance[], unknown, never>;
|
|
67
67
|
provisionAgent(input: ProvisionAgentOptions): Effect.Effect<AgentInstance, unknown, never>;
|
|
68
|
+
purgeAgentData(agentId: string): Effect.Effect<void, unknown, never>;
|
|
68
69
|
getPlaybookSubscription(id: string): Effect.Effect<PlaybookSubscription | null, unknown, never>;
|
|
69
70
|
putPlaybookSubscription(subscription: PlaybookSubscription): Effect.Effect<void, unknown, never>;
|
|
70
71
|
deletePlaybookSubscription(id: string): Effect.Effect<boolean, unknown, never>;
|
|
@@ -72,9 +73,15 @@ declare class FileFoundryDataAdapter implements FoundryDataAdapter {
|
|
|
72
73
|
getInboundDelivery(key: string): Effect.Effect<InboundDeliveryClaim | null, unknown, never>;
|
|
73
74
|
claimInboundDelivery(key: string): Effect.Effect<boolean, unknown, never>;
|
|
74
75
|
completeInboundDelivery(key: string, runIds: ReadonlyArray<string>): Effect.Effect<void, unknown, never>;
|
|
76
|
+
claimEvent(record: FoundryEventRecord): Effect.Effect<boolean, unknown, never>;
|
|
77
|
+
putEvent(record: FoundryEventRecord): Effect.Effect<void, unknown, never>;
|
|
78
|
+
listEvents(): Effect.Effect<FoundryEventRecord[], unknown, never>;
|
|
75
79
|
putPendingInbound(record: FoundryPendingInbound): Effect.Effect<void, unknown, never>;
|
|
76
80
|
deletePendingInbound(id: string): Effect.Effect<void, unknown, never>;
|
|
77
81
|
listPendingInbound(): Effect.Effect<FoundryPendingInbound[], unknown, never>;
|
|
82
|
+
putApproval(approval: FoundryApproval): Effect.Effect<void, unknown, never>;
|
|
83
|
+
getApproval(id: string): Effect.Effect<FoundryApproval | null, unknown, never>;
|
|
84
|
+
listApprovals(): Effect.Effect<FoundryApproval[], unknown, never>;
|
|
78
85
|
releaseInboundDelivery(key: string): Effect.Effect<void, unknown, never>;
|
|
79
86
|
getActivation(id: string): Effect.Effect<FoundryActivationRecord | null, unknown, never>;
|
|
80
87
|
putActivation(activation: FoundryActivationRecord): Effect.Effect<void, unknown, never>;
|
|
@@ -98,6 +105,14 @@ declare class FileFoundryDataAdapter implements FoundryDataAdapter {
|
|
|
98
105
|
readonly conversationId?: string;
|
|
99
106
|
}): Effect.Effect<EnvironmentValue[], unknown, never>;
|
|
100
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Keep routes and bindings in one JSON file, so topology an application writes
|
|
110
|
+
* at runtime (a person connecting an app) survives a restart on a single host.
|
|
111
|
+
* Only the control process holds it; writes are serialized and committed by
|
|
112
|
+
* atomic rename. Use a database-backed TopologyStore when several hosts share
|
|
113
|
+
* one topology.
|
|
114
|
+
*/
|
|
115
|
+
declare function fileTopologyStore(file: string): Layer.Layer<TopologyStore>;
|
|
101
116
|
|
|
102
117
|
/** Deterministic default rendering for an event merged into a Glove conversation. */
|
|
103
118
|
declare function serializeInboundTransmissionXml(input: {
|
|
@@ -193,4 +208,4 @@ interface DefineBindingOptions extends Omit<AgentBinding, "id" | "agentId" | "tr
|
|
|
193
208
|
}
|
|
194
209
|
declare function defineBinding(options: DefineBindingOptions): AgentBinding;
|
|
195
210
|
|
|
196
|
-
export { AccountReference, AgentBinding, AgentInstance, AgentPlaybook, AnyFoundryTransmission, CapabilityDefinition, Conversation, type DefineAccountOptions, type DefineBindingOptions, type DefineInboundRouteOptions, type DefineOutboundRouteOptions, DiscoveredAgent, EnvironmentValue, FileFoundryDataAdapter, type FileFoundryDataAdapterOptions, FoundryActivationRecord, FoundryAgentApplication, FoundryBrandingConfig, FoundryDataAdapter, FoundryManifest, FoundryPendingInbound, FoundryRuntime, FoundryServer, type FoundryServerOptions, FoundryTask, FoundryWorkingEnvironmentSnapshotOwner, InboundDeliveryClaim, InboundRoute, InferAccountMetadata, InferInboundConfig, InferOutboundConfig, OutboundRoute, PlaybookSubscription, ProvisionAgentOptions, SharedInboxItem, WorkspaceEntry, defineAccount, defineBinding, defineInboundRoute, defineOutboundRoute, serializeInboundTransmissionXml, writeGeneratedTypes };
|
|
211
|
+
export { AccountReference, AgentBinding, AgentInstance, AgentPlaybook, AnyFoundryTransmission, CapabilityDefinition, Conversation, type DefineAccountOptions, type DefineBindingOptions, type DefineInboundRouteOptions, type DefineOutboundRouteOptions, DiscoveredAgent, EnvironmentValue, FileFoundryDataAdapter, type FileFoundryDataAdapterOptions, FoundryActivationRecord, FoundryAgentApplication, FoundryApproval, FoundryBrandingConfig, FoundryDataAdapter, FoundryEventRecord, FoundryManifest, FoundryPendingInbound, FoundryRuntime, FoundryServer, type FoundryServerOptions, FoundryTask, FoundryWorkingEnvironmentSnapshotOwner, InboundDeliveryClaim, InboundRoute, InferAccountMetadata, InferInboundConfig, InferOutboundConfig, OutboundRoute, PlaybookSubscription, ProvisionAgentOptions, SharedInboxItem, TopologyStore, WorkspaceEntry, defineAccount, defineBinding, defineInboundRoute, defineOutboundRoute, fileTopologyStore, serializeInboundTransmissionXml, writeGeneratedTypes };
|
package/dist/index.js
CHANGED
|
@@ -43,12 +43,12 @@ import {
|
|
|
43
43
|
memoryTopologyStore,
|
|
44
44
|
serializeInboundTransmissionXml,
|
|
45
45
|
writeGeneratedTypes
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-DTFCEX67.js";
|
|
47
47
|
import {
|
|
48
48
|
FoundryClient,
|
|
49
49
|
FoundryRunHandle,
|
|
50
50
|
createFoundryClient
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-L5JQVTHD.js";
|
|
52
52
|
import {
|
|
53
53
|
defineConfig
|
|
54
54
|
} from "./chunk-ZFNMFE3T.js";
|
|
@@ -63,22 +63,19 @@ import {
|
|
|
63
63
|
defineWorkingEnvironment,
|
|
64
64
|
foundryDataEnvironmentPersistence,
|
|
65
65
|
foundryGuidanceSubject
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-X3HZYVZS.js";
|
|
67
67
|
import {
|
|
68
|
+
DEFAULT_APPROVAL_EXPIRES_AFTER_MS,
|
|
69
|
+
DEFAULT_APPROVAL_WAIT_MS,
|
|
68
70
|
EMPTY_AGENT_COMPOSITION,
|
|
69
|
-
EMPTY_CAPABILITY_REGISTRY,
|
|
70
71
|
EMPTY_FOUNDRY_APPLICATION,
|
|
71
|
-
FOUNDRY_AGENT_APPLICATION_BRAND,
|
|
72
72
|
FOUNDRY_APPLICATION_BRAND,
|
|
73
73
|
FOUNDRY_APPROVAL_DIRECTORY_ENV,
|
|
74
74
|
FOUNDRY_COMPOSED_PLAYBOOK_BRAND,
|
|
75
75
|
FOUNDRY_CONNECTION_BRAND,
|
|
76
76
|
FOUNDRY_CORE_COMMAND_EVENT,
|
|
77
|
-
FOUNDRY_MCP_BRAND,
|
|
78
|
-
FOUNDRY_MEMORY_BRAND,
|
|
79
77
|
FOUNDRY_PLAYBOOK_ACTION_BRAND,
|
|
80
78
|
FOUNDRY_SCHEDULE_BRAND,
|
|
81
|
-
FOUNDRY_SHARED_TOOL_BRAND,
|
|
82
79
|
FOUNDRY_TRANSMISSION_BRAND,
|
|
83
80
|
FOUNDRY_TRANSMISSION_EVENT_BRAND,
|
|
84
81
|
FOUNDRY_TRANSMISSION_PREDICATE_BRAND,
|
|
@@ -86,40 +83,28 @@ import {
|
|
|
86
83
|
MemoryFoundryDataAdapter,
|
|
87
84
|
composeAgent,
|
|
88
85
|
composePlaybook,
|
|
89
|
-
configureMemory,
|
|
90
86
|
createAgentInstance,
|
|
91
87
|
createConversation,
|
|
92
88
|
createFoundryApproval,
|
|
93
89
|
createFoundryCoreTools,
|
|
94
90
|
createInstalledApplicationTransmissionTools,
|
|
95
91
|
createManifest,
|
|
96
|
-
defineAgentApplication,
|
|
97
92
|
defineAgentInstance,
|
|
98
|
-
defineApp,
|
|
99
93
|
defineApplication,
|
|
100
94
|
defineConnection,
|
|
101
|
-
defineMcp,
|
|
102
|
-
defineMemory,
|
|
103
95
|
definePlaybookAction,
|
|
104
96
|
definePlaybookSubscription,
|
|
105
97
|
defineSchedule,
|
|
106
|
-
defineSharedTool,
|
|
107
98
|
defineTransmission,
|
|
108
99
|
defineTransmissionEvent,
|
|
109
100
|
defineTransmissionPredicate,
|
|
110
101
|
discoverAgents,
|
|
111
102
|
findAgentFiles,
|
|
112
|
-
install,
|
|
113
|
-
installRegistry,
|
|
114
|
-
installationKey,
|
|
115
103
|
installedApplicationTransmissionToolName,
|
|
116
104
|
isFoundryApplication,
|
|
117
|
-
isFoundryCapability,
|
|
118
105
|
isFoundrySchedule,
|
|
119
106
|
isFoundryTransmission,
|
|
120
|
-
isInboxCapableStore,
|
|
121
107
|
listFoundryApprovals,
|
|
122
|
-
mountAgentDefinitionMemory,
|
|
123
108
|
reconstructAgentInstance,
|
|
124
109
|
reconstructPlaybook,
|
|
125
110
|
reconstructPlaybookSubscription,
|
|
@@ -129,10 +114,14 @@ import {
|
|
|
129
114
|
toGloveRequestInput,
|
|
130
115
|
transmissionPredicate,
|
|
131
116
|
withFoundryPermissions
|
|
132
|
-
} from "./chunk-
|
|
133
|
-
import
|
|
117
|
+
} from "./chunk-EUGKVW3J.js";
|
|
118
|
+
import {
|
|
119
|
+
meshIdentity
|
|
120
|
+
} from "./chunk-J6NHL4SM.js";
|
|
134
121
|
import {
|
|
122
|
+
EMPTY_CAPABILITY_REGISTRY,
|
|
135
123
|
EMPTY_NATIVE_REGISTRY,
|
|
124
|
+
FOUNDRY_AGENT_APPLICATION_BRAND,
|
|
136
125
|
FOUNDRY_AGENT_BRAND,
|
|
137
126
|
FOUNDRY_AGENT_DEFINITION_BRAND,
|
|
138
127
|
FOUNDRY_AGENT_FILE_ENV,
|
|
@@ -141,36 +130,56 @@ import {
|
|
|
141
130
|
FOUNDRY_EVENT_PREFIX,
|
|
142
131
|
FOUNDRY_EXECUTION_MARKER,
|
|
143
132
|
FOUNDRY_LAYER_BRAND,
|
|
133
|
+
FOUNDRY_MCP_BRAND,
|
|
134
|
+
FOUNDRY_MEMORY_BRAND,
|
|
135
|
+
FOUNDRY_SHARED_TOOL_BRAND,
|
|
144
136
|
FOUNDRY_SUBSCRIBER_BRAND,
|
|
145
137
|
configureLayer,
|
|
138
|
+
configureMemory,
|
|
146
139
|
defineAgent,
|
|
140
|
+
defineAgentApplication,
|
|
147
141
|
defineAgentFromModule,
|
|
142
|
+
defineApp,
|
|
148
143
|
defineCall,
|
|
149
144
|
defineLayer,
|
|
145
|
+
defineMcp,
|
|
146
|
+
defineMemory,
|
|
150
147
|
defineRoutes,
|
|
148
|
+
defineSharedTool,
|
|
151
149
|
defineSubagent,
|
|
152
150
|
defineSubscriber,
|
|
151
|
+
hostedMeshOptions,
|
|
152
|
+
install,
|
|
153
|
+
installRegistry,
|
|
154
|
+
installationKey,
|
|
153
155
|
internalAgentName,
|
|
154
156
|
isFoundryAgent,
|
|
155
157
|
isFoundryAgentDefinition,
|
|
158
|
+
isFoundryCapability,
|
|
156
159
|
isFoundryLayer,
|
|
157
160
|
isFoundrySubscriber,
|
|
161
|
+
isInboxCapableStore,
|
|
162
|
+
isMeshTransport,
|
|
163
|
+
mountAgentDefinitionMemory,
|
|
158
164
|
mountFoundrySurfaces,
|
|
165
|
+
restrictApp,
|
|
159
166
|
routeFromInternalAgentName
|
|
160
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-CYOIHSUX.js";
|
|
161
168
|
|
|
162
169
|
// src/file-data.ts
|
|
163
170
|
import { randomUUID } from "node:crypto";
|
|
164
171
|
import { mkdir, open, readFile, rename, stat, unlink } from "node:fs/promises";
|
|
165
172
|
import { dirname } from "node:path";
|
|
166
|
-
import { Effect } from "effect";
|
|
173
|
+
import { Effect, Layer, Ref, Schema } from "effect";
|
|
167
174
|
function emptyState(environment) {
|
|
168
175
|
return {
|
|
169
176
|
version: 1,
|
|
170
177
|
agents: [],
|
|
171
178
|
subscriptions: [],
|
|
172
179
|
inboundDeliveries: [],
|
|
180
|
+
events: [],
|
|
173
181
|
pendingInbound: [],
|
|
182
|
+
approvals: [],
|
|
174
183
|
activations: [],
|
|
175
184
|
conversations: [],
|
|
176
185
|
workspaceEntries: [],
|
|
@@ -277,7 +286,9 @@ var FileFoundryDataAdapter = class {
|
|
|
277
286
|
agents: parsed.agents ?? [],
|
|
278
287
|
subscriptions: parsed.subscriptions ?? [],
|
|
279
288
|
inboundDeliveries: parsed.inboundDeliveries ?? [],
|
|
289
|
+
events: parsed.events ?? [],
|
|
280
290
|
pendingInbound: parsed.pendingInbound ?? [],
|
|
291
|
+
approvals: parsed.approvals ?? [],
|
|
281
292
|
activations: parsed.activations ?? [],
|
|
282
293
|
conversations: parsed.conversations ?? [],
|
|
283
294
|
workspaceEntries: parsed.workspaceEntries ?? [],
|
|
@@ -382,6 +393,7 @@ var FileFoundryDataAdapter = class {
|
|
|
382
393
|
return this.mutate((state) => {
|
|
383
394
|
const existing = state.agents.find((agent) => agent.provisioningKey === input.provisioningKey);
|
|
384
395
|
if (existing) return reconstructAgentInstance(existing);
|
|
396
|
+
if (input.id && state.agents.some((agent) => agent.id === input.id)) throw new Error(`Agent instance "${input.id}" already exists with another provisioning key.`);
|
|
385
397
|
const created = createAgentInstance(input.definitionId, {
|
|
386
398
|
...input,
|
|
387
399
|
id: input.id ?? `agent_${randomUUID()}`
|
|
@@ -391,6 +403,26 @@ var FileFoundryDataAdapter = class {
|
|
|
391
403
|
});
|
|
392
404
|
});
|
|
393
405
|
}
|
|
406
|
+
purgeAgentData(agentId) {
|
|
407
|
+
return effect(async () => {
|
|
408
|
+
await this.ensureInitialized();
|
|
409
|
+
await this.mutate((state) => {
|
|
410
|
+
const agent = state.agents.find((item) => item.id === agentId);
|
|
411
|
+
if (!agent?.durableSubagent || agent.durableSubagent.status !== "archived") throw new Error("Only archived durable workers can be purged.");
|
|
412
|
+
const ids = new Set(state.conversations.filter((item) => item.agentId === agentId).map((item) => item.id));
|
|
413
|
+
state.events = state.events.filter((item) => item.target.agentId !== agentId);
|
|
414
|
+
state.pendingInbound = state.pendingInbound.filter((item) => item.request.agentId !== agentId);
|
|
415
|
+
state.approvals = state.approvals.filter((item) => item.agentId !== agentId);
|
|
416
|
+
state.activations = state.activations.filter((item) => item.agentId !== agentId);
|
|
417
|
+
state.conversations = state.conversations.filter((item) => item.agentId !== agentId);
|
|
418
|
+
state.workingEnvironments = state.workingEnvironments.filter((item) => item.owner.agentId !== agentId);
|
|
419
|
+
state.inbox = state.inbox.filter((item) => item.agentId !== agentId && !ids.has(item.conversationId ?? ""));
|
|
420
|
+
state.tasks = state.tasks.filter((item) => item.agentId !== agentId && !ids.has(item.conversationId ?? ""));
|
|
421
|
+
state.environment = state.environment.filter((item) => item.scope === "workspace" || item.agentId !== agentId && !ids.has(item.conversationId ?? ""));
|
|
422
|
+
replaceById(state.agents, { ...agent, context: {}, installations: [], playbooks: [], durableSubagent: { ...agent.durableSubagent, status: "purged" }, updatedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
423
|
+
});
|
|
424
|
+
});
|
|
425
|
+
}
|
|
394
426
|
getPlaybookSubscription(id) {
|
|
395
427
|
return effect(async () => {
|
|
396
428
|
const value = (await this.snapshot()).subscriptions.find((item) => item.id === id);
|
|
@@ -450,6 +482,29 @@ var FileFoundryDataAdapter = class {
|
|
|
450
482
|
});
|
|
451
483
|
});
|
|
452
484
|
}
|
|
485
|
+
claimEvent(record) {
|
|
486
|
+
return effect(async () => {
|
|
487
|
+
await this.ensureInitialized();
|
|
488
|
+
return this.mutate((state) => {
|
|
489
|
+
if (state.agents.some((agent) => agent.id === record.target.agentId && agent.durableSubagent?.status === "purged")) throw new Error("Cannot deliver an event to a purged worker.");
|
|
490
|
+
if (state.events.some((item) => item.id === record.id)) return false;
|
|
491
|
+
state.events.push(structuredClone(record));
|
|
492
|
+
return true;
|
|
493
|
+
});
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
putEvent(record) {
|
|
497
|
+
return effect(async () => {
|
|
498
|
+
await this.ensureInitialized();
|
|
499
|
+
await this.mutate((state) => {
|
|
500
|
+
if (state.agents.some((agent) => agent.id === record.target.agentId && agent.durableSubagent?.status === "purged")) return;
|
|
501
|
+
replaceById(state.events, record);
|
|
502
|
+
});
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
listEvents() {
|
|
506
|
+
return effect(async () => structuredClone((await this.snapshot()).events));
|
|
507
|
+
}
|
|
453
508
|
putPendingInbound(record) {
|
|
454
509
|
return effect(async () => {
|
|
455
510
|
await this.ensureInitialized();
|
|
@@ -472,6 +527,20 @@ var FileFoundryDataAdapter = class {
|
|
|
472
527
|
listPendingInbound() {
|
|
473
528
|
return effect(async () => structuredClone((await this.snapshot()).pendingInbound));
|
|
474
529
|
}
|
|
530
|
+
putApproval(approval) {
|
|
531
|
+
return effect(async () => {
|
|
532
|
+
await this.ensureInitialized();
|
|
533
|
+
await this.mutate((state) => {
|
|
534
|
+
replaceById(state.approvals, structuredClone(approval));
|
|
535
|
+
});
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
getApproval(id) {
|
|
539
|
+
return effect(async () => structuredClone((await this.snapshot()).approvals.find((item) => item.id === id) ?? null));
|
|
540
|
+
}
|
|
541
|
+
listApprovals() {
|
|
542
|
+
return effect(async () => structuredClone((await this.snapshot()).approvals));
|
|
543
|
+
}
|
|
475
544
|
releaseInboundDelivery(key) {
|
|
476
545
|
return effect(async () => {
|
|
477
546
|
await this.ensureInitialized();
|
|
@@ -581,9 +650,79 @@ var FileFoundryDataAdapter = class {
|
|
|
581
650
|
)));
|
|
582
651
|
}
|
|
583
652
|
};
|
|
653
|
+
function fileTopologyStore(file) {
|
|
654
|
+
return Layer.effect(TopologyStore, Effect.gen(function* () {
|
|
655
|
+
const loaded = yield* Effect.promise(async () => {
|
|
656
|
+
try {
|
|
657
|
+
const parsed = JSON.parse(await readFile(file, "utf8"));
|
|
658
|
+
return {
|
|
659
|
+
version: 1,
|
|
660
|
+
routes: (parsed.routes ?? []).map((route) => Schema.decodeUnknownSync(Route)(route)),
|
|
661
|
+
bindings: (parsed.bindings ?? []).map((binding) => Schema.decodeUnknownSync(AgentBinding)(binding))
|
|
662
|
+
};
|
|
663
|
+
} catch (cause) {
|
|
664
|
+
if (cause.code === "ENOENT") return { version: 1, routes: [], bindings: [] };
|
|
665
|
+
throw cause;
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
const state = yield* Ref.make(loaded);
|
|
669
|
+
const lock = yield* Effect.makeSemaphore(1);
|
|
670
|
+
const commit = (next) => Effect.promise(async () => {
|
|
671
|
+
await mkdir(dirname(file), { recursive: true });
|
|
672
|
+
const temporary = `${file}.${process.pid}.${randomUUID()}.tmp`;
|
|
673
|
+
const handle = await open(temporary, "wx", 384);
|
|
674
|
+
try {
|
|
675
|
+
await handle.writeFile(`${JSON.stringify(next, null, 2)}
|
|
676
|
+
`, "utf8");
|
|
677
|
+
await handle.sync();
|
|
678
|
+
} finally {
|
|
679
|
+
await handle.close();
|
|
680
|
+
}
|
|
681
|
+
try {
|
|
682
|
+
await rename(temporary, file);
|
|
683
|
+
} catch (cause) {
|
|
684
|
+
try {
|
|
685
|
+
await unlink(temporary);
|
|
686
|
+
} catch {
|
|
687
|
+
}
|
|
688
|
+
throw cause;
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
const update = (change) => lock.withPermits(1)(Effect.gen(function* () {
|
|
692
|
+
const [result, next] = change(yield* Ref.get(state));
|
|
693
|
+
if (next) {
|
|
694
|
+
yield* commit(next);
|
|
695
|
+
yield* Ref.set(state, next);
|
|
696
|
+
}
|
|
697
|
+
return result;
|
|
698
|
+
}));
|
|
699
|
+
const withRoutes = (current, routes) => ({ ...current, routes });
|
|
700
|
+
const withBindings = (current, bindings) => ({ ...current, bindings });
|
|
701
|
+
return {
|
|
702
|
+
getRoute: (id) => Ref.get(state).pipe(Effect.flatMap((current) => {
|
|
703
|
+
const route = current.routes.find((candidate) => candidate.id === id);
|
|
704
|
+
return route ? Effect.succeed(route) : Effect.fail(new RouteNotFound({ routeId: id }));
|
|
705
|
+
})),
|
|
706
|
+
listRoutes: (filter = {}) => Ref.get(state).pipe(Effect.map((current) => current.routes.filter((route) => (filter.transmissionId === void 0 || route.transmissionId === filter.transmissionId) && (filter.accountId === void 0 || route.accountId === filter.accountId) && (filter.direction === void 0 || route.direction === filter.direction) && (filter.enabled === void 0 || route.enabled === filter.enabled)))),
|
|
707
|
+
putRoute: (route) => update((current) => [route, withRoutes(current, [...current.routes.filter((candidate) => candidate.id !== route.id), route])]),
|
|
708
|
+
removeRoute: (id) => update((current) => current.routes.some((route) => route.id === id) ? [true, withRoutes(current, current.routes.filter((route) => route.id !== id))] : [false, void 0]).pipe(
|
|
709
|
+
Effect.flatMap((removed) => removed ? Effect.void : Effect.fail(new RouteNotFound({ routeId: id })))
|
|
710
|
+
),
|
|
711
|
+
getBinding: (id) => Ref.get(state).pipe(Effect.flatMap((current) => {
|
|
712
|
+
const binding = current.bindings.find((candidate) => candidate.id === id);
|
|
713
|
+
return binding ? Effect.succeed(binding) : Effect.fail(new BindingNotFound({ bindingId: id }));
|
|
714
|
+
})),
|
|
715
|
+
listBindings: (filter = {}) => Ref.get(state).pipe(Effect.map((current) => current.bindings.filter((binding) => (filter.agentId === void 0 || binding.agentId === filter.agentId) && (filter.transmissionId === void 0 || binding.transmissionId === filter.transmissionId) && (filter.accountId === void 0 || binding.accountId === filter.accountId) && (filter.routeId === void 0 || binding.routeId === filter.routeId) && (filter.enabled === void 0 || binding.enabled === filter.enabled)))),
|
|
716
|
+
putBinding: (binding) => update((current) => [binding, withBindings(current, [...current.bindings.filter((candidate) => candidate.id !== binding.id), binding])]),
|
|
717
|
+
removeBinding: (id) => update((current) => current.bindings.some((binding) => binding.id === id) ? [true, withBindings(current, current.bindings.filter((binding) => binding.id !== id))] : [false, void 0]).pipe(
|
|
718
|
+
Effect.flatMap((removed) => removed ? Effect.void : Effect.fail(new BindingNotFound({ bindingId: id })))
|
|
719
|
+
)
|
|
720
|
+
};
|
|
721
|
+
}));
|
|
722
|
+
}
|
|
584
723
|
|
|
585
724
|
// src/authoring.ts
|
|
586
|
-
import { Schema } from "effect";
|
|
725
|
+
import { Schema as Schema2 } from "effect";
|
|
587
726
|
var accountTransmissions = /* @__PURE__ */ new WeakMap();
|
|
588
727
|
var routeTransmissions = /* @__PURE__ */ new WeakMap();
|
|
589
728
|
function defineAccount(options) {
|
|
@@ -591,8 +730,8 @@ function defineAccount(options) {
|
|
|
591
730
|
if (!transmission.account) {
|
|
592
731
|
throw new Error("The referenced transmission has no account contract.");
|
|
593
732
|
}
|
|
594
|
-
const metadata =
|
|
595
|
-
const decoded =
|
|
733
|
+
const metadata = Schema2.decodeUnknownSync(transmission.account.metadata)(data.metadata);
|
|
734
|
+
const decoded = Schema2.decodeUnknownSync(AccountReference)({
|
|
596
735
|
...data,
|
|
597
736
|
metadata,
|
|
598
737
|
transmissionId: "pending"
|
|
@@ -613,8 +752,8 @@ function defineInboundRoute(options) {
|
|
|
613
752
|
if (account && accountTransmissions.get(account) !== transmission) {
|
|
614
753
|
throw new Error(`Account "${account.id}" belongs to another transmission.`);
|
|
615
754
|
}
|
|
616
|
-
const config =
|
|
617
|
-
const decoded =
|
|
755
|
+
const config = Schema2.decodeUnknownSync(transmission.inbound.config)(data.config);
|
|
756
|
+
const decoded = Schema2.decodeUnknownSync(InboundRoute)({
|
|
618
757
|
...data,
|
|
619
758
|
config,
|
|
620
759
|
direction: "inbound",
|
|
@@ -637,8 +776,8 @@ function defineOutboundRoute(options) {
|
|
|
637
776
|
if (account && accountTransmissions.get(account) !== transmission) {
|
|
638
777
|
throw new Error(`Account "${account.id}" belongs to another transmission.`);
|
|
639
778
|
}
|
|
640
|
-
const config =
|
|
641
|
-
const decoded =
|
|
779
|
+
const config = Schema2.decodeUnknownSync(transmission.outbound.config)(data.config);
|
|
780
|
+
const decoded = Schema2.decodeUnknownSync(OutboundRoute)({
|
|
642
781
|
...data,
|
|
643
782
|
config,
|
|
644
783
|
direction: "outbound",
|
|
@@ -681,7 +820,7 @@ function defineBinding(options) {
|
|
|
681
820
|
`Account "${account.id}" does not belong to the referenced transmission.`
|
|
682
821
|
);
|
|
683
822
|
}
|
|
684
|
-
const decoded =
|
|
823
|
+
const decoded = Schema2.decodeUnknownSync(AgentBinding)({
|
|
685
824
|
...data,
|
|
686
825
|
agentId: agent.id,
|
|
687
826
|
transmissionId: "pending",
|
|
@@ -712,6 +851,8 @@ export {
|
|
|
712
851
|
BindingId,
|
|
713
852
|
BindingNotFound,
|
|
714
853
|
CapabilityId,
|
|
854
|
+
DEFAULT_APPROVAL_EXPIRES_AFTER_MS,
|
|
855
|
+
DEFAULT_APPROVAL_WAIT_MS,
|
|
715
856
|
EMPTY_AGENT_COMPOSITION,
|
|
716
857
|
EMPTY_CAPABILITY_REGISTRY,
|
|
717
858
|
EMPTY_FOUNDRY_APPLICATION,
|
|
@@ -815,10 +956,12 @@ export {
|
|
|
815
956
|
defineTransmissionPredicate,
|
|
816
957
|
defineWorkingEnvironment,
|
|
817
958
|
discoverAgents,
|
|
959
|
+
fileTopologyStore,
|
|
818
960
|
findAgentFiles,
|
|
819
961
|
foundryDataEnvironmentPersistence,
|
|
820
962
|
foundryGuidanceSubject,
|
|
821
963
|
grantResolverLive,
|
|
964
|
+
hostedMeshOptions,
|
|
822
965
|
install,
|
|
823
966
|
installRegistry,
|
|
824
967
|
installationKey,
|
|
@@ -833,16 +976,19 @@ export {
|
|
|
833
976
|
isFoundrySubscriber,
|
|
834
977
|
isFoundryTransmission,
|
|
835
978
|
isInboxCapableStore,
|
|
979
|
+
isMeshTransport,
|
|
836
980
|
listFoundryApprovals,
|
|
837
981
|
memoryAccountDirectory,
|
|
838
982
|
memoryEventStore,
|
|
839
983
|
memoryTopologyStore,
|
|
984
|
+
meshIdentity,
|
|
840
985
|
mountAgentDefinitionMemory,
|
|
841
986
|
mountFoundrySurfaces,
|
|
842
987
|
reconstructAgentInstance,
|
|
843
988
|
reconstructPlaybook,
|
|
844
989
|
reconstructPlaybookSubscription,
|
|
845
990
|
resolveFoundryApproval,
|
|
991
|
+
restrictApp,
|
|
846
992
|
routeFromAgentFile,
|
|
847
993
|
routeFromInternalAgentName,
|
|
848
994
|
serializeInboundTransmissionXml,
|
package/dist/voice.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { IGloveRunnable } from 'glove-core';
|
|
2
2
|
import { RealtimeAgent, RealtimeAgentConfig } from 'glove-voice-s2s';
|
|
3
|
-
import { A as AgentHandlerContext, F as FoundryDelegationUpdate } from './
|
|
3
|
+
import { A as AgentHandlerContext, F as FoundryDelegationUpdate, a as FoundryMeshMessage } from './event-delivery-CNCsVqi8.js';
|
|
4
4
|
import 'effect';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'glove-mesh';
|
|
7
7
|
import 'glove-mcp';
|
|
8
8
|
import 'glove-memory';
|
|
9
9
|
import 'glove-memory/tools';
|
|
10
|
-
import 'glove-working-environment';
|
|
11
10
|
import 'glove-js';
|
|
12
11
|
import 'glove-lisp';
|
|
13
12
|
import 'glove-python';
|
|
13
|
+
import 'glove-working-environment';
|
|
14
14
|
import 'glove-facts';
|
|
15
15
|
import 'glove-memory/goals';
|
|
16
16
|
import 'glove-memory/forms';
|
|
@@ -78,9 +78,11 @@ interface VoiceCallOptions {
|
|
|
78
78
|
readonly realtime?: Omit<RealtimeAgentConfig, "agent">;
|
|
79
79
|
/** How a delegation update is put to the model. Return null to keep it silent. */
|
|
80
80
|
readonly announce?: (update: FoundryDelegationUpdate) => string | null;
|
|
81
|
+
/** How a message from a peer on the mesh Foundry hosts is put to the model. Return null to keep it silent. */
|
|
82
|
+
readonly announceMesh?: (message: FoundryMeshMessage) => string | null;
|
|
81
83
|
/**
|
|
82
|
-
* A run that is not a call: a delegation result
|
|
83
|
-
* caller hung up. By default it is saved to the conversation, so the next
|
|
84
|
+
* A run that is not a call: a delegation result, or a peer's reply on the
|
|
85
|
+
* mesh, that arrived after the caller hung up. By default it is saved to the conversation, so the next
|
|
84
86
|
* call starts knowing it.
|
|
85
87
|
*/
|
|
86
88
|
readonly offCall?: (agent: IGloveRunnable, context: AgentHandlerContext) => unknown;
|
|
@@ -90,19 +92,21 @@ interface VoiceCallResult {
|
|
|
90
92
|
readonly durationMs: number;
|
|
91
93
|
/** How many times the agent spoke. */
|
|
92
94
|
readonly turns: number;
|
|
93
|
-
/** Delegation updates put to the caller during the call. */
|
|
95
|
+
/** Delegation updates and mesh messages put to the caller during the call. */
|
|
94
96
|
readonly updatesSpoken: number;
|
|
95
97
|
}
|
|
96
98
|
/** The default way a delegation update is put to the model mid-call. */
|
|
97
99
|
declare function announceDelegationUpdate(update: FoundryDelegationUpdate): string;
|
|
100
|
+
/** The default way a message from a peer on the mesh is put to the model mid-call. */
|
|
101
|
+
declare function announceMeshMessage(message: FoundryMeshMessage): string;
|
|
98
102
|
/**
|
|
99
103
|
* Run an agent as a live voice call: use it as a definition's `run`.
|
|
100
104
|
*
|
|
101
105
|
* The agent's prompt, tools and context configure a realtime speech session
|
|
102
106
|
* (its model must be `s2sDrivenModel(...)`, or pass `realtime.adapter`). The
|
|
103
107
|
* room connects callers. What both sides say is saved to the conversation.
|
|
104
|
-
* Delegation results and questions
|
|
105
|
-
* waiting for the call to end. Foundry's bookkeeping tools and any tool that
|
|
108
|
+
* Delegation results and questions, and messages from peers on the mesh, are
|
|
109
|
+
* spoken at the next pause instead of waiting for the call to end. Foundry's bookkeeping tools and any tool that
|
|
106
110
|
* needs an approval are kept off the call; delegate that work instead.
|
|
107
111
|
*/
|
|
108
112
|
declare function voiceCall(options: VoiceCallOptions): (agent: IGloveRunnable, context: AgentHandlerContext) => Promise<VoiceCallResult | unknown>;
|
|
@@ -165,4 +169,4 @@ interface WebSocketRoomOptions {
|
|
|
165
169
|
*/
|
|
166
170
|
declare function webSocketRoom(options: WebSocketRoomOptions): FoundryVoiceRoom;
|
|
167
171
|
|
|
168
|
-
export { type FoundryVoiceCall, type FoundryVoiceRoom, VOICE_EXCLUDED_FOUNDRY_TOOLS, type VoiceCallOptions, type VoiceCallResult, type VoiceRoomClientMessage, type VoiceRoomServerMessage, type WebSocketRoomOptions, announceDelegationUpdate, voiceCall, webSocketRoom };
|
|
172
|
+
export { type FoundryVoiceCall, type FoundryVoiceRoom, VOICE_EXCLUDED_FOUNDRY_TOOLS, type VoiceCallOptions, type VoiceCallResult, type VoiceRoomClientMessage, type VoiceRoomServerMessage, type WebSocketRoomOptions, announceDelegationUpdate, announceMeshMessage, voiceCall, webSocketRoom };
|