glove-foundry 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-X6EWEWWM.js → chunk-2GXPSIRL.js} +623 -100
- package/dist/chunk-64UBLGYM.js +1241 -0
- package/dist/{chunk-B36BGF5R.js → chunk-AC6SRI5V.js} +17 -22
- package/dist/{chunk-7F7QVO6I.js → chunk-EEHGAWXM.js} +26 -0
- package/dist/{chunk-OBTOFA7W.js → chunk-EJZJAVNG.js} +137 -633
- package/dist/{chunk-RSU7NEDK.js → chunk-IPASF7PK.js} +1 -1
- package/dist/cli.js +4 -4
- package/dist/{client-DWPYe_Nc.d.ts → client-BgpgsnoO.d.ts} +158 -107
- package/dist/client.d.ts +3 -3
- package/dist/client.js +1 -1
- package/dist/{definition-A8o11aez.d.ts → event-delivery-BaYe6d9w.d.ts} +1015 -874
- package/dist/execution-agent.d.ts +0 -1
- package/dist/execution-agent.js +3 -14
- package/dist/execution-daemon.js +1 -1
- package/dist/execution-loader.js +1014 -8
- package/dist/index.d.ts +9 -5
- package/dist/index.js +70 -23
- package/dist/voice.d.ts +2 -2
- package/dist/voice.js +1 -1
- package/docs/architecture.md +8 -0
- package/docs/building-with-foundry.md +9 -1
- package/docs/durable-subagents.md +259 -0
- package/package.json +11 -11
- 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 { a as FoundryDataAdapter, E as EnvironmentValue, b as AgentInstance, C as Conversation, P as PlaybookSubscription, c as FoundryActivationRecord, d as ProvisionAgentOptions, I as InboundDeliveryClaim, e as FoundryPendingInbound, W as WorkspaceEntry,
|
|
2
|
-
export {
|
|
1
|
+
import { a as FoundryDataAdapter, E as EnvironmentValue, b as AgentInstance, C as Conversation, P as PlaybookSubscription, c as FoundryActivationRecord, d as ProvisionAgentOptions, I as InboundDeliveryClaim, e as FoundryEventRecord, f as FoundryPendingInbound, W as WorkspaceEntry, g as FoundryWorkingEnvironmentSnapshotOwner, S as SharedInboxItem, h as FoundryTask, i as AgentPlaybook, j as AnyFoundryTransmission, k as AccountReference, l as InferAccountMetadata, m as AgentBinding, n as FoundryAgentApplication, o as InboundRoute, O as OutboundRoute, p as CapabilityDefinition, q as InferInboundConfig, r as InferOutboundConfig } from './event-delivery-BaYe6d9w.js';
|
|
2
|
+
export { s as AccountContract, t as AccountId, u as AccountNotFound, v as AccountSessionUnavailable, w as AccountSummary, x as AgentApplicationContribution, y as AgentApplicationInstallContext, z as AgentApplicationOptions, B as AgentAssemblyContext, D as AgentAssemblyOptions, G as AgentDefinitionId, H as AgentDefinitionSurfaceContext, J as AgentFactoryContext, A as AgentHandlerContext, K as AgentId, L as AgentInstallContext, M as AgentInstallation, N as AgentInstallationKind, Q as AgentMessageReceipt, R as AgentPlaybookInput, T as AgentProvisioningPolicy, U as AgentRuntimeControls, V as AnyFoundryAgent, X as AppRestrictions, Y as ApplicationConnectionContext, Z as ApplicationConnectionState, _ as ApplicationConnectionStatus, $ as BindingId, a0 as BindingNotFound, a1 as CapabilityId, a2 as ComposedAgentPlaybook, a3 as ComposedAgentPlaybookInput, a4 as ConnectionReceiveInput, a5 as CreateAgentInstanceOptions, a6 as CreateConversationOptions, a7 as CustomProvisionedAgent, a8 as CustomProvisioningContext, a9 as DefineAgentOptions, aa as DefineConnectionOptions, ab as DefineFoundryReplOptions, ac as DefineFoundryScheduleOptions, ad as DefineFoundrySubagentOptions, ae as DefineFoundryWorkingEnvironmentOptions, af as DefinePlaybookSubscriptionOptions, ag as DefinitionConfigInput, ah as DurableSubagentOptions, ai as DurableSubagentOwnership, aj as DurableSubagents, ak as EMPTY_AGENT_COMPOSITION, al as EMPTY_CAPABILITY_REGISTRY, am as EMPTY_NATIVE_REGISTRY, an as EgressAdapter, ao as EgressContext, ap as EventId, aq as EventNotFound, ar as EventReference, as as FOUNDRY_AGENT_APPLICATION_BRAND, at as FOUNDRY_AGENT_BRAND, au as FOUNDRY_AGENT_DEFINITION_BRAND, av as FOUNDRY_AGENT_FILE_ENV, aw as FOUNDRY_AGENT_ROUTE_ENV, ax as FOUNDRY_APPLICATION_ENV, ay as FOUNDRY_COMPOSED_PLAYBOOK_BRAND, az as FOUNDRY_CONNECTION_BRAND, aA as FOUNDRY_CORE_COMMAND_EVENT, aB as FOUNDRY_EVENT_PREFIX, aC as FOUNDRY_EXECUTION_MARKER, aD as FOUNDRY_LAYER_BRAND, aE as FOUNDRY_MCP_BRAND, aF as FOUNDRY_MEMORY_BRAND, aG as FOUNDRY_PLAYBOOK_ACTION_BRAND, aH as FOUNDRY_REPL_BRAND, aI as FOUNDRY_SCHEDULE_BRAND, aJ as FOUNDRY_SHARED_TOOL_BRAND, aK as FOUNDRY_SUBSCRIBER_BRAND, aL as FOUNDRY_TRANSMISSION_BRAND, aM as FOUNDRY_TRANSMISSION_EVENT_BRAND, aN as FOUNDRY_TRANSMISSION_PREDICATE_BRAND, aO as FOUNDRY_WORKING_ENVIRONMENT_BRAND, aP as FoundryAccountSessionAdapter, aQ as FoundryAgent, aR as FoundryAgentComponent, aS as FoundryAgentComposition, aT as FoundryAgentConventionModule, aU as FoundryAgentDefinition, aV as FoundryAgentMode, aW as FoundryApp, aX as FoundryApplicationConnection, aY as FoundryCall, aZ as FoundryCallContext, a_ as FoundryCallOptions, a$ as FoundryCapabilityKind, b0 as FoundryCapabilityManifest, b1 as FoundryCapabilityManifestEntry, b2 as FoundryCapabilityRegistry, b3 as FoundryCompositionSource, b4 as FoundryContextProvider, b5 as FoundryCoreCommand, b6 as FoundryDelegate, b7 as FoundryDelegateOptions, b8 as FoundryDelegation, b9 as FoundryDelegationReply, ba as FoundryDelegationStatus, F as FoundryDelegationUpdate, bb as FoundryDomainError, bc as FoundryEventPolicy, bd as FoundryEventTarget, be as FoundryExecutionContext, bf as FoundryFactsOptions, bg as FoundryFormsOptions, bh as FoundryGoalsOptions, bi as FoundryGuidanceHandles, bj as FoundryGuidanceScope, bk as FoundryHookDefinition, bl as FoundryInstallable, bm as FoundryInstanceProvisioner, bn as FoundryJavaScriptReplDefinition, bo as FoundryLayer, bp as FoundryLayerOptions, bq as FoundryLayerReference, br as FoundryLayerSelection, bs as FoundryLispReplDefinition, bt as FoundryListResolver, bu as FoundryMcp, bv as FoundryMcpOptions, bw as FoundryMemoryProfile, bx as FoundryMemoryProfileOptions, by as FoundryMemoryReference, bz as FoundryMemorySelection, bA as FoundryMeshConfig, bB as FoundryMessageInput, bC as FoundryMessageOptions, bD as FoundryMountedRepl, bE as FoundryNativeManifest, bF as FoundryNativeManifestEntry, bG as FoundryNativeRegistry, bH as FoundryPlaybookAction, bI as FoundryProgrammaticToolContext, bJ as FoundryProgrammaticToolSelection, bK as FoundryProgrammaticTools, bL as FoundryPythonReplDefinition, bM as FoundryReplDefinition, bN as FoundryRequest, bO as FoundryResolvedMcp, bP as FoundryResolver, bQ as FoundryResult, bR as FoundryRouteMap, bS as FoundryScheduleDefinition, bT as FoundryScheduleTiming, bU as FoundryScheduleTimingInput, bV as FoundrySharedTool, bW as FoundrySubagentToolContext, bX as FoundrySubscriber, bY as FoundrySubscriberOptions, bZ as FoundrySubscriberSelection, b_ as FoundrySurfaceContext, b$ as FoundrySuspension, c0 as FoundryToolBody, c1 as FoundryTransmission, c2 as FoundryTransmissionDelivery, c3 as FoundryTransmissionEvent, c4 as FoundryTransmissionPredicate, c5 as FoundryVfs, c6 as FoundryVfsHandle, c7 as FoundryWorkingEnvironmentCreateContext, c8 as FoundryWorkingEnvironmentDefinition, c9 as FoundryWorkingEnvironmentPersistenceAdapter, ca as FoundryWorkingEnvironmentPersistenceContext, cb as GrantResolutionError, cc as InboundContract, cd as InferAgentInput, ce as InferAgentOutput, cf as InferInboundEvent, cg as InferOutboundInput, ch as InferOutboundOutput, ci as IngressAdapter, cj as IngressContext, ck as InstallationSelection, cl as McpAdapterFactory, cm as MemoryFoundryDataAdapter, cn as OutboundContract, co as PlaybookActionOptions, cp as PlaybookDirective, cq as PlaybookDirectiveInput, cr as PlaybookMatch, cs as PlaybookMatchInput, ct as PlaybookOutboundDirective, cu as PlaybookOutboundInput, cv as PlaybookSubscriptionTarget, cw as PlaybookSubscriptionTargetInput, cx as ReplyPolicy, cy as Route, cz as RouteId, cA as RouteNotFound, cB as RunGrant, cC as RunId, cD as SharedToolOptions, cE as TopologyConflict, cF as TransmissionEventDirection, cG as TransmissionEventOptions, cH as TransmissionId, cI as TransmissionOptions, cJ as TransmissionPredicateOptions, cK as TransmissionSerializationContext, cL as UpdateAgentInstanceOptions, cM as UpdateConversationOptions, cN as composeAgent, cO as composePlaybook, cP as configureLayer, cQ as configureMemory, cR as createAgentInstance, cS as createConversation, cT as createFoundryCoreTools, cU as createInstalledApplicationTransmissionTools, cV as defineAgent, cW as defineAgentApplication, cX as defineAgentFromModule, cY as defineAgentInstance, cZ as defineApp, c_ as defineCall, c$ as defineConnection, d0 as defineFacts, d1 as defineForms, d2 as defineGoals, d3 as defineLayer, d4 as defineMcp, d5 as defineMemory, d6 as definePlaybookAction, d7 as definePlaybookSubscription, d8 as defineRepl, d9 as defineRoutes, da as defineSchedule, db as defineSharedTool, dc as defineSubagent, dd as defineSubscriber, de as defineTransmission, df as defineTransmissionEvent, dg as defineTransmissionPredicate, dh as defineWorkingEnvironment, di as foundryDataEnvironmentPersistence, dj as foundryGuidanceSubject, dk as install, dl as installRegistry, dm as installationKey, dn as installedApplicationTransmissionToolName, dp as internalAgentName, dq as isFoundryAgent, dr as isFoundryAgentDefinition, ds as isFoundryCapability, dt as isFoundryLayer, du as isFoundrySchedule, dv as isFoundrySubscriber, dw as isFoundryTransmission, dx as isInboxCapableStore, dy as mountAgentDefinitionMemory, dz as mountFoundrySurfaces, dA as reconstructAgentInstance, dB as reconstructPlaybook, dC as reconstructPlaybookSubscription, dD as restrictApp, dE as routeFromInternalAgentName, dF as toGloveMessage, dG as toGloveRequestInput, dH as transmissionPredicate } from './event-delivery-BaYe6d9w.js';
|
|
3
3
|
import { Effect } 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 FOUNDRY_APPROVAL_DIRECTORY_ENV, i as FoundryApplication, j as FoundryApplicationManifest, k as FoundryApplicationOptions, l as FoundryApproval, m as FoundryApprovalDecision, n as FoundryApprovalDisplayManager, o as FoundryApprovalStatus, p as FoundryClient, q as FoundryClientAuthorizationAdapter, r as FoundryClientOptions, s as FoundryConversationTranscript, t as FoundryEvent, u as FoundryEventCategory, v as FoundryHealth, w as FoundryManifestAgent, x as FoundryManifestCapability, y as FoundryManifestTransmission, z as FoundryObservabilityAdapter, C as FoundryRequestAuthorizationAdapter, G as FoundryRequestAuthorizationInput, H as FoundryRun, I as FoundryRunHandle, J as FoundryRuntimeError, K as FoundryRuntimeOptions, L as FoundrySteerHandleResult, M as FoundrySteerResult, N as GrantResolver, O as ManifestCompilationError, P as MemoryObservabilityAdapter, R as ResolveGrantRequest, Q as RouteFilter, T as TopologyStore, W as WaitOptions, S as compileApplicationManifest, U as createFoundryApproval, V as createFoundryClient, X as createManifest, Y as defineApplication, Z as discoverAgents, _ as findAgentFiles, $ as grantResolverLive, a0 as isFoundryApplication, a1 as listFoundryApprovals, a2 as memoryAccountDirectory, a3 as memoryEventStore, a4 as memoryTopologyStore, a5 as resolveFoundryApproval, a6 as routeFromAgentFile, a7 as withFoundryPermissions } from './client-
|
|
5
|
+
import { F as FoundryRuntime, D as DiscoveredAgent, a as FoundryManifest } from './client-BgpgsnoO.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 FOUNDRY_APPROVAL_DIRECTORY_ENV, i as FoundryApplication, j as FoundryApplicationManifest, k as FoundryApplicationOptions, l as FoundryApproval, m as FoundryApprovalDecision, n as FoundryApprovalDisplayManager, o as FoundryApprovalStatus, p as FoundryClient, q as FoundryClientAuthorizationAdapter, r as FoundryClientOptions, s as FoundryConversationTranscript, t as FoundryEvent, u as FoundryEventCategory, v as FoundryHealth, w as FoundryManifestAgent, x as FoundryManifestCapability, y as FoundryManifestTransmission, z as FoundryObservabilityAdapter, C as FoundryRequestAuthorizationAdapter, G as FoundryRequestAuthorizationInput, H as FoundryRun, I as FoundryRunHandle, J as FoundryRuntimeError, K as FoundryRuntimeOptions, L as FoundrySteerHandleResult, M as FoundrySteerResult, N as GrantResolver, O as ManifestCompilationError, P as MemoryObservabilityAdapter, R as ResolveGrantRequest, Q as RouteFilter, T as TopologyStore, W as WaitOptions, S as compileApplicationManifest, U as createFoundryApproval, V as createFoundryClient, X as createManifest, Y as defineApplication, Z as discoverAgents, _ as findAgentFiles, $ as grantResolverLive, a0 as isFoundryApplication, a1 as listFoundryApprovals, a2 as memoryAccountDirectory, a3 as memoryEventStore, a4 as memoryTopologyStore, a5 as resolveFoundryApproval, a6 as routeFromAgentFile, a7 as withFoundryPermissions } from './client-BgpgsnoO.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,6 +73,9 @@ 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>;
|
|
@@ -193,4 +197,4 @@ interface DefineBindingOptions extends Omit<AgentBinding, "id" | "agentId" | "tr
|
|
|
193
197
|
}
|
|
194
198
|
declare function defineBinding(options: DefineBindingOptions): AgentBinding;
|
|
195
199
|
|
|
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 };
|
|
200
|
+
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, FoundryEventRecord, FoundryManifest, FoundryPendingInbound, FoundryRuntime, FoundryServer, type FoundryServerOptions, FoundryTask, FoundryWorkingEnvironmentSnapshotOwner, InboundDeliveryClaim, InboundRoute, InferAccountMetadata, InferInboundConfig, InferOutboundConfig, OutboundRoute, PlaybookSubscription, ProvisionAgentOptions, SharedInboxItem, WorkspaceEntry, defineAccount, defineBinding, defineInboundRoute, defineOutboundRoute, 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-2GXPSIRL.js";
|
|
47
47
|
import {
|
|
48
48
|
FoundryClient,
|
|
49
49
|
FoundryRunHandle,
|
|
50
50
|
createFoundryClient
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-EEHGAWXM.js";
|
|
52
52
|
import {
|
|
53
53
|
defineConfig
|
|
54
54
|
} from "./chunk-ZFNMFE3T.js";
|
|
@@ -63,22 +63,17 @@ import {
|
|
|
63
63
|
defineWorkingEnvironment,
|
|
64
64
|
foundryDataEnvironmentPersistence,
|
|
65
65
|
foundryGuidanceSubject
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-IPASF7PK.js";
|
|
67
67
|
import {
|
|
68
68
|
EMPTY_AGENT_COMPOSITION,
|
|
69
|
-
EMPTY_CAPABILITY_REGISTRY,
|
|
70
69
|
EMPTY_FOUNDRY_APPLICATION,
|
|
71
|
-
FOUNDRY_AGENT_APPLICATION_BRAND,
|
|
72
70
|
FOUNDRY_APPLICATION_BRAND,
|
|
73
71
|
FOUNDRY_APPROVAL_DIRECTORY_ENV,
|
|
74
72
|
FOUNDRY_COMPOSED_PLAYBOOK_BRAND,
|
|
75
73
|
FOUNDRY_CONNECTION_BRAND,
|
|
76
74
|
FOUNDRY_CORE_COMMAND_EVENT,
|
|
77
|
-
FOUNDRY_MCP_BRAND,
|
|
78
|
-
FOUNDRY_MEMORY_BRAND,
|
|
79
75
|
FOUNDRY_PLAYBOOK_ACTION_BRAND,
|
|
80
76
|
FOUNDRY_SCHEDULE_BRAND,
|
|
81
|
-
FOUNDRY_SHARED_TOOL_BRAND,
|
|
82
77
|
FOUNDRY_TRANSMISSION_BRAND,
|
|
83
78
|
FOUNDRY_TRANSMISSION_EVENT_BRAND,
|
|
84
79
|
FOUNDRY_TRANSMISSION_PREDICATE_BRAND,
|
|
@@ -86,40 +81,28 @@ import {
|
|
|
86
81
|
MemoryFoundryDataAdapter,
|
|
87
82
|
composeAgent,
|
|
88
83
|
composePlaybook,
|
|
89
|
-
configureMemory,
|
|
90
84
|
createAgentInstance,
|
|
91
85
|
createConversation,
|
|
92
86
|
createFoundryApproval,
|
|
93
87
|
createFoundryCoreTools,
|
|
94
88
|
createInstalledApplicationTransmissionTools,
|
|
95
89
|
createManifest,
|
|
96
|
-
defineAgentApplication,
|
|
97
90
|
defineAgentInstance,
|
|
98
|
-
defineApp,
|
|
99
91
|
defineApplication,
|
|
100
92
|
defineConnection,
|
|
101
|
-
defineMcp,
|
|
102
|
-
defineMemory,
|
|
103
93
|
definePlaybookAction,
|
|
104
94
|
definePlaybookSubscription,
|
|
105
95
|
defineSchedule,
|
|
106
|
-
defineSharedTool,
|
|
107
96
|
defineTransmission,
|
|
108
97
|
defineTransmissionEvent,
|
|
109
98
|
defineTransmissionPredicate,
|
|
110
99
|
discoverAgents,
|
|
111
100
|
findAgentFiles,
|
|
112
|
-
install,
|
|
113
|
-
installRegistry,
|
|
114
|
-
installationKey,
|
|
115
101
|
installedApplicationTransmissionToolName,
|
|
116
102
|
isFoundryApplication,
|
|
117
|
-
isFoundryCapability,
|
|
118
103
|
isFoundrySchedule,
|
|
119
104
|
isFoundryTransmission,
|
|
120
|
-
isInboxCapableStore,
|
|
121
105
|
listFoundryApprovals,
|
|
122
|
-
mountAgentDefinitionMemory,
|
|
123
106
|
reconstructAgentInstance,
|
|
124
107
|
reconstructPlaybook,
|
|
125
108
|
reconstructPlaybookSubscription,
|
|
@@ -129,10 +112,12 @@ import {
|
|
|
129
112
|
toGloveRequestInput,
|
|
130
113
|
transmissionPredicate,
|
|
131
114
|
withFoundryPermissions
|
|
132
|
-
} from "./chunk-
|
|
133
|
-
import "./chunk-
|
|
115
|
+
} from "./chunk-EJZJAVNG.js";
|
|
116
|
+
import "./chunk-AC6SRI5V.js";
|
|
134
117
|
import {
|
|
118
|
+
EMPTY_CAPABILITY_REGISTRY,
|
|
135
119
|
EMPTY_NATIVE_REGISTRY,
|
|
120
|
+
FOUNDRY_AGENT_APPLICATION_BRAND,
|
|
136
121
|
FOUNDRY_AGENT_BRAND,
|
|
137
122
|
FOUNDRY_AGENT_DEFINITION_BRAND,
|
|
138
123
|
FOUNDRY_AGENT_FILE_ENV,
|
|
@@ -141,23 +126,39 @@ import {
|
|
|
141
126
|
FOUNDRY_EVENT_PREFIX,
|
|
142
127
|
FOUNDRY_EXECUTION_MARKER,
|
|
143
128
|
FOUNDRY_LAYER_BRAND,
|
|
129
|
+
FOUNDRY_MCP_BRAND,
|
|
130
|
+
FOUNDRY_MEMORY_BRAND,
|
|
131
|
+
FOUNDRY_SHARED_TOOL_BRAND,
|
|
144
132
|
FOUNDRY_SUBSCRIBER_BRAND,
|
|
145
133
|
configureLayer,
|
|
134
|
+
configureMemory,
|
|
146
135
|
defineAgent,
|
|
136
|
+
defineAgentApplication,
|
|
147
137
|
defineAgentFromModule,
|
|
138
|
+
defineApp,
|
|
148
139
|
defineCall,
|
|
149
140
|
defineLayer,
|
|
141
|
+
defineMcp,
|
|
142
|
+
defineMemory,
|
|
150
143
|
defineRoutes,
|
|
144
|
+
defineSharedTool,
|
|
151
145
|
defineSubagent,
|
|
152
146
|
defineSubscriber,
|
|
147
|
+
install,
|
|
148
|
+
installRegistry,
|
|
149
|
+
installationKey,
|
|
153
150
|
internalAgentName,
|
|
154
151
|
isFoundryAgent,
|
|
155
152
|
isFoundryAgentDefinition,
|
|
153
|
+
isFoundryCapability,
|
|
156
154
|
isFoundryLayer,
|
|
157
155
|
isFoundrySubscriber,
|
|
156
|
+
isInboxCapableStore,
|
|
157
|
+
mountAgentDefinitionMemory,
|
|
158
158
|
mountFoundrySurfaces,
|
|
159
|
+
restrictApp,
|
|
159
160
|
routeFromInternalAgentName
|
|
160
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-64UBLGYM.js";
|
|
161
162
|
|
|
162
163
|
// src/file-data.ts
|
|
163
164
|
import { randomUUID } from "node:crypto";
|
|
@@ -170,6 +171,7 @@ function emptyState(environment) {
|
|
|
170
171
|
agents: [],
|
|
171
172
|
subscriptions: [],
|
|
172
173
|
inboundDeliveries: [],
|
|
174
|
+
events: [],
|
|
173
175
|
pendingInbound: [],
|
|
174
176
|
activations: [],
|
|
175
177
|
conversations: [],
|
|
@@ -277,6 +279,7 @@ var FileFoundryDataAdapter = class {
|
|
|
277
279
|
agents: parsed.agents ?? [],
|
|
278
280
|
subscriptions: parsed.subscriptions ?? [],
|
|
279
281
|
inboundDeliveries: parsed.inboundDeliveries ?? [],
|
|
282
|
+
events: parsed.events ?? [],
|
|
280
283
|
pendingInbound: parsed.pendingInbound ?? [],
|
|
281
284
|
activations: parsed.activations ?? [],
|
|
282
285
|
conversations: parsed.conversations ?? [],
|
|
@@ -382,6 +385,7 @@ var FileFoundryDataAdapter = class {
|
|
|
382
385
|
return this.mutate((state) => {
|
|
383
386
|
const existing = state.agents.find((agent) => agent.provisioningKey === input.provisioningKey);
|
|
384
387
|
if (existing) return reconstructAgentInstance(existing);
|
|
388
|
+
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
389
|
const created = createAgentInstance(input.definitionId, {
|
|
386
390
|
...input,
|
|
387
391
|
id: input.id ?? `agent_${randomUUID()}`
|
|
@@ -391,6 +395,25 @@ var FileFoundryDataAdapter = class {
|
|
|
391
395
|
});
|
|
392
396
|
});
|
|
393
397
|
}
|
|
398
|
+
purgeAgentData(agentId) {
|
|
399
|
+
return effect(async () => {
|
|
400
|
+
await this.ensureInitialized();
|
|
401
|
+
await this.mutate((state) => {
|
|
402
|
+
const agent = state.agents.find((item) => item.id === agentId);
|
|
403
|
+
if (!agent?.durableSubagent || agent.durableSubagent.status !== "archived") throw new Error("Only archived durable workers can be purged.");
|
|
404
|
+
const ids = new Set(state.conversations.filter((item) => item.agentId === agentId).map((item) => item.id));
|
|
405
|
+
state.events = state.events.filter((item) => item.target.agentId !== agentId);
|
|
406
|
+
state.pendingInbound = state.pendingInbound.filter((item) => item.request.agentId !== agentId);
|
|
407
|
+
state.activations = state.activations.filter((item) => item.agentId !== agentId);
|
|
408
|
+
state.conversations = state.conversations.filter((item) => item.agentId !== agentId);
|
|
409
|
+
state.workingEnvironments = state.workingEnvironments.filter((item) => item.owner.agentId !== agentId);
|
|
410
|
+
state.inbox = state.inbox.filter((item) => item.agentId !== agentId && !ids.has(item.conversationId ?? ""));
|
|
411
|
+
state.tasks = state.tasks.filter((item) => item.agentId !== agentId && !ids.has(item.conversationId ?? ""));
|
|
412
|
+
state.environment = state.environment.filter((item) => item.scope === "workspace" || item.agentId !== agentId && !ids.has(item.conversationId ?? ""));
|
|
413
|
+
replaceById(state.agents, { ...agent, context: {}, installations: [], playbooks: [], durableSubagent: { ...agent.durableSubagent, status: "purged" }, updatedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
}
|
|
394
417
|
getPlaybookSubscription(id) {
|
|
395
418
|
return effect(async () => {
|
|
396
419
|
const value = (await this.snapshot()).subscriptions.find((item) => item.id === id);
|
|
@@ -450,6 +473,29 @@ var FileFoundryDataAdapter = class {
|
|
|
450
473
|
});
|
|
451
474
|
});
|
|
452
475
|
}
|
|
476
|
+
claimEvent(record) {
|
|
477
|
+
return effect(async () => {
|
|
478
|
+
await this.ensureInitialized();
|
|
479
|
+
return this.mutate((state) => {
|
|
480
|
+
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.");
|
|
481
|
+
if (state.events.some((item) => item.id === record.id)) return false;
|
|
482
|
+
state.events.push(structuredClone(record));
|
|
483
|
+
return true;
|
|
484
|
+
});
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
putEvent(record) {
|
|
488
|
+
return effect(async () => {
|
|
489
|
+
await this.ensureInitialized();
|
|
490
|
+
await this.mutate((state) => {
|
|
491
|
+
if (state.agents.some((agent) => agent.id === record.target.agentId && agent.durableSubagent?.status === "purged")) return;
|
|
492
|
+
replaceById(state.events, record);
|
|
493
|
+
});
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
listEvents() {
|
|
497
|
+
return effect(async () => structuredClone((await this.snapshot()).events));
|
|
498
|
+
}
|
|
453
499
|
putPendingInbound(record) {
|
|
454
500
|
return effect(async () => {
|
|
455
501
|
await this.ensureInitialized();
|
|
@@ -843,6 +889,7 @@ export {
|
|
|
843
889
|
reconstructPlaybook,
|
|
844
890
|
reconstructPlaybookSubscription,
|
|
845
891
|
resolveFoundryApproval,
|
|
892
|
+
restrictApp,
|
|
846
893
|
routeFromAgentFile,
|
|
847
894
|
routeFromInternalAgentName,
|
|
848
895
|
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 } from './event-delivery-BaYe6d9w.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';
|
package/dist/voice.js
CHANGED
package/docs/architecture.md
CHANGED
|
@@ -165,6 +165,14 @@ Session loops and goal continuation are composable
|
|
|
165
165
|
agent policy over this data and normal scheduled activations. They do not introduce
|
|
166
166
|
a second scheduler, memory store, filesystem, or agent loop.
|
|
167
167
|
|
|
168
|
+
## Durable addressed events
|
|
169
|
+
|
|
170
|
+
Foundry's controller journals events before dispatch. A target is an exact agent instance and owned conversation. Direct durable-worker messages, task starts and updates, and inbound transmissions share this layer. The data adapter atomically claims target-scoped event IDs and stores pending, acknowledged or expired records; completed IDs remain for deduplication. The file adapter persists them across controller restarts.
|
|
171
|
+
|
|
172
|
+
The controller owns wake/defer deadlines and conversation admission. A live process receives native Glove events; a new event turn calls `processEvents` rather than synthesizing a user message. The internal execution envelope carries events separately from the application payload. Runtime-context providers continue to expose changing snapshots, including open durable-worker tasks. A local handoff directory is a transient transport, not an inbox or a durability boundary.
|
|
173
|
+
|
|
174
|
+
A successful execution result carries consumed-event receipts. The controller reconciles those receipts before replaying unfinished delivery on startup. A crash can repeat work between a side effect and acknowledgment, so delivery is at least once and effects should use event IDs for idempotency. Archival retains pending events; worker purge removes the owned journal and deduplication records. See [durable subagents](./durable-subagents.md) for authoring, policy, permissions and lifecycle details.
|
|
175
|
+
|
|
168
176
|
## Working environment and REPL boundary
|
|
169
177
|
|
|
170
178
|
Foundry owns contextual selection, mounting, lifecycle, and observability. The native packages retain their own semantics:
|
|
@@ -139,7 +139,7 @@ export default defineApplication({
|
|
|
139
139
|
})
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
`FileFoundryDataAdapter` coordinates sibling execution processes with an advisory lock and commits by atomic rename. It persists instances, subscriptions, delivery claims, activations, conversations, workspace data, VFS snapshots, inbox items, tasks, and non-secret environment data. Use a transactional database adapter when several hosts need to share the same state.
|
|
142
|
+
`FileFoundryDataAdapter` coordinates sibling execution processes with an advisory lock and commits by atomic rename. It persists instances, subscriptions, delivery claims, addressed events and receipts, activations, conversations, workspace data, VFS snapshots, inbox items, tasks, and non-secret environment data. Use a transactional database adapter when several hosts need to share the same state.
|
|
143
143
|
|
|
144
144
|
## The filesystem is the static registry
|
|
145
145
|
|
|
@@ -800,3 +800,11 @@ run cleanup. See the [document adapter](../../glove-env-documents/README.md).
|
|
|
800
800
|
- Provider adapters own credential acquisition and refresh.
|
|
801
801
|
- Voice rooms own audio transport; `voiceCall` owns the session and the transcript; Foundry owns the durable run.
|
|
802
802
|
- Interactors keep the person's context; workers keep one task's. Delegation results and questions come back to the conversation that delegated.
|
|
803
|
+
|
|
804
|
+
## Durable subagents
|
|
805
|
+
|
|
806
|
+
Use `defineAgent({ durableSubagents: { research: { agent: researcher, inherit: { memory: "shared" } } } })`
|
|
807
|
+
for persistent owned workers. Existing task delegation can target the `research` name;
|
|
808
|
+
`glove_foundry_message` sends spontaneous messages to that worker or back to its parent.
|
|
809
|
+
See [Durable subagents](durable-subagents.md) for app permission modifiers, independent
|
|
810
|
+
run limits, direct client messaging, persistence boundaries, and archive/purge semantics.
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
# Durable subagents
|
|
2
|
+
|
|
3
|
+
A durable subagent is a named worker owned by one agent instance. It keeps its own
|
|
4
|
+
identity, conversations, schedules, private data, and event delivery state across requests. Reusing
|
|
5
|
+
an agent definition creates an owned instance; it does not adopt an unrelated
|
|
6
|
+
existing instance. Different parents and different names always have different workers.
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { defineAgent, restrictApp } from "glove-foundry";
|
|
10
|
+
import researcher from "../researcher/agent.js";
|
|
11
|
+
import knowledgeBase from "./apps/knowledge-base.app.js";
|
|
12
|
+
import { components } from "./composition.js";
|
|
13
|
+
|
|
14
|
+
export default defineAgent({
|
|
15
|
+
description: "A responsive assistant with persistent research",
|
|
16
|
+
model: fastModel,
|
|
17
|
+
systemPrompt: "Help the user and coordinate your workers.",
|
|
18
|
+
components,
|
|
19
|
+
durableSubagents: {
|
|
20
|
+
research: {
|
|
21
|
+
agent: researcher,
|
|
22
|
+
eventDelivery: { whenIdle: "wake" },
|
|
23
|
+
inherit: {
|
|
24
|
+
context: true,
|
|
25
|
+
tools: ["search_documents"],
|
|
26
|
+
memory: { scope: "shared", access: "reader", profiles: ["personal"] },
|
|
27
|
+
apps: [restrictApp(knowledgeBase, {
|
|
28
|
+
tools: ["search", "read_document"],
|
|
29
|
+
operations: ["documents.read"],
|
|
30
|
+
})],
|
|
31
|
+
},
|
|
32
|
+
cleanup: async ({ agent, conversationIds }) => {
|
|
33
|
+
// Application-owned adapters: delete only this worker's private data.
|
|
34
|
+
await privateMemory.deleteNamespace(agent.id);
|
|
35
|
+
await transcripts.deleteConversations(conversationIds);
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
planner: {
|
|
39
|
+
agent: defineAgent({
|
|
40
|
+
description: "Long-term planning",
|
|
41
|
+
model: thoroughModel,
|
|
42
|
+
systemPrompt: "Maintain long-term plans.",
|
|
43
|
+
runTimeoutMs: 4 * 60 * 60 * 1000,
|
|
44
|
+
maxConcurrentRuns: 1,
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Imported definitions and inline `defineAgent` values work, including nested workers.
|
|
52
|
+
Definitions remain immutable. Discovery derives a route such as
|
|
53
|
+
`assistant/workers/research`; `workers` inside a route is reserved for this purpose.
|
|
54
|
+
Names must be lowercase slugs; `parent` is reserved. Cycles and route collisions fail
|
|
55
|
+
discovery. Declare these relationships statically; ordinary assembly fields remain lazy.
|
|
56
|
+
|
|
57
|
+
## Independent work and messaging
|
|
58
|
+
|
|
59
|
+
Workers are provisioned atomically on first use, once per parent and slot. Calls to
|
|
60
|
+
`glove_foundry_delegate({ to: "research", task: "Write a report" })` use the owned
|
|
61
|
+
researcher. Existing `delegates` continue to work. A durable name takes precedence
|
|
62
|
+
when it also names a sibling delegate. Each task gets a separate conversation;
|
|
63
|
+
its final result and questions return to the originating parent conversation.
|
|
64
|
+
|
|
65
|
+
`glove_foundry_message({ to: "research", message: "Watch this competitor" })`
|
|
66
|
+
sends a spontaneous message without creating a task. The worker can send
|
|
67
|
+
`glove_foundry_message({ to: "parent", message: "Something changed" })` at any time.
|
|
68
|
+
By default messages address a stable conversation belonging to the recipient. Supply
|
|
69
|
+
`delivery.conversationId` to address an existing conversation explicitly. Foundry
|
|
70
|
+
validates that it belongs to the recipient and shares its workspace; it never guesses
|
|
71
|
+
the latest chat. The model tool accepts only declared children and the actual parent.
|
|
72
|
+
It cannot address arbitrary instance IDs. Events sent by the tool include a
|
|
73
|
+
`metadata.replyTo` agent/conversation address, which a worker can use to target its
|
|
74
|
+
reply. There is no automatic reply loop.
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
await worker.send("Include these three companies.", {
|
|
78
|
+
id: "research-update-42", // stable across retries
|
|
79
|
+
conversationId: reportConversationId,
|
|
80
|
+
whenIdle: "defer", // join the next turn
|
|
81
|
+
deferTimeoutMs: 30_000, // or wake after 30 seconds
|
|
82
|
+
expiresAt: "2027-01-01T00:00:00Z",
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// The same layer supports direct addressed events from an application.
|
|
86
|
+
await client.emitEvent(
|
|
87
|
+
{ agentId: researcherId, conversationId: reportConversationId },
|
|
88
|
+
{ id: "source-change-42", source: "app:watcher", kind: "source.changed", content: "The source changed." },
|
|
89
|
+
{ whenIdle: "wake" },
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// From the worker, target the parent conversation explicitly.
|
|
93
|
+
await messageTool.run({
|
|
94
|
+
to: "parent", message: "A finding needs your attention.",
|
|
95
|
+
delivery: { conversationId: parentConversationId, whenIdle: "wake" },
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`defineAgent({ eventDelivery })` sets the recipient's default policy; a durable slot
|
|
100
|
+
can override it with `durableSubagents.research.eventDelivery`. Each send can override
|
|
101
|
+
that policy again. The default is `whenIdle: "wake"`. `defer` without a timeout waits
|
|
102
|
+
for another turn; with `deferTimeoutMs`, the original acceptance time determines the
|
|
103
|
+
wake deadline, including across restarts. `expiresAt` discards stale events before
|
|
104
|
+
injection. Policies affect idle targets; events sent to a busy target join its next
|
|
105
|
+
native event boundary. A waking event can carry other deferred events into the same
|
|
106
|
+
turn. These are deterministic controller policies; they do not infer user presence.
|
|
107
|
+
|
|
108
|
+
The message tool waits for durable acceptance, not for the recipient's answer.
|
|
109
|
+
Receipts contain `messageId`, `agentId`, `conversationId`, and a `runId` when one is
|
|
110
|
+
handling the event. A receipt is not a completion notification. IDs are scoped to
|
|
111
|
+
the exact target. Reusing an ID with different content or policy fails.
|
|
112
|
+
|
|
113
|
+
## Shared durable runtime events
|
|
114
|
+
|
|
115
|
+
Direct messages, initial delegated tasks, results, questions, replies, and inbound
|
|
116
|
+
transmissions use the same adapter-backed event journal. Each record stores its
|
|
117
|
+
explicit target, stable native event ID, policy, pending/acknowledged/expired state,
|
|
118
|
+
and handling run. Delegation retains its task status and correlation semantics on
|
|
119
|
+
top of that transport. Its results still return to the originating conversation.
|
|
120
|
+
|
|
121
|
+
A live run receives native `AgentEvent` values through `emitEvent`: during a tool
|
|
122
|
+
loop they join the next boundary; a realtime runtime can receive them through
|
|
123
|
+
`holdTurns({ onEvent })` and `takeEvents()`. Open tasks remain live runtime-context
|
|
124
|
+
snapshots. Event-triggered model turns use `processEvents()` and native event
|
|
125
|
+
framing, with no synthetic user request. Deferred events are seeded before a new
|
|
126
|
+
request's first model call. Custom Foundry handlers can inspect `ctx.events`; a
|
|
127
|
+
successful return acknowledges the events that started their run.
|
|
128
|
+
|
|
129
|
+
The filesystem handoff to a live process is only a transport. It is not the source
|
|
130
|
+
of durability, and no mesh adapter, mesh inbox, or inbox-capable Glove store is
|
|
131
|
+
required. Setting `delivery: "events"` on an existing mesh configuration uses native live events too; raw
|
|
132
|
+
mesh transport and direct `glove.emitEvent` calls do not themselves create Foundry
|
|
133
|
+
journal records. Use `runtime.emitEvent`/`client.emitEvent` or the messaging tool
|
|
134
|
+
when delivery must survive the absence of a running process. Legacy mesh inbox mode
|
|
135
|
+
is the default; select native live delivery explicitly on your transport, for example
|
|
136
|
+
`mesh: { adapter: meshAdapter, delivery: "events" }`, where `meshAdapter` implements `MeshAdapter`.
|
|
137
|
+
|
|
138
|
+
Foundry acknowledges events only after a successful receiving run reports that it
|
|
139
|
+
consumed them. Unread events stay pending; shutdown, failures and archival retain
|
|
140
|
+
unfinished delivery. Startup reconciles completed run receipts before replaying
|
|
141
|
+
pending events. Delivery is **at least once**, including a crash after an external
|
|
142
|
+
side effect but before acknowledgment. Make external effects idempotent using event
|
|
143
|
+
IDs. Completed and expired IDs remain in the journal to suppress duplicate retries;
|
|
144
|
+
worker purge removes this owned journal data. Native transcript persistence and event
|
|
145
|
+
acknowledgment are separate transactions, so a crash can also replay an event already
|
|
146
|
+
present in history.
|
|
147
|
+
|
|
148
|
+
Persistent adapters implement atomic `claimEvent` (insert-if-absent), `putEvent`, and
|
|
149
|
+
`listEvents`; messaging fails explicitly when these methods are absent. The bundled
|
|
150
|
+
memory adapter is process-local; the file adapter persists the journal and receipts.
|
|
151
|
+
The execution controller owns idle timers so a worker process need not stay alive
|
|
152
|
+
while deferred work waits. Use one active controller per execution deployment.
|
|
153
|
+
|
|
154
|
+
Use `FileFoundryDataAdapter` or a persistent transactional adapter, and configure an
|
|
155
|
+
application `conversationStore` (or worker `store`) for transcripts. Instance and
|
|
156
|
+
message persistence does not itself persist native Glove transcripts, memory, or
|
|
157
|
+
external files. These keep their existing Foundry persistence boundaries.
|
|
158
|
+
|
|
159
|
+
`runTimeoutMs` sets a definition's run deadline; the existing default remains five
|
|
160
|
+
minutes. `maxConcurrentRuns` limits that definition's simultaneous runs. Set runtime
|
|
161
|
+
`execution.maxConcurrent` above the combined background limits to leave slots for
|
|
162
|
+
responsive agents. This is capacity control, not preemption or a latency guarantee.
|
|
163
|
+
|
|
164
|
+
## Inheritance and permissions
|
|
165
|
+
|
|
166
|
+
Nothing is inherited implicitly: no transcript, context, tools, applications, MCP,
|
|
167
|
+
playbooks, schedules, or memory. A reused definition retains its own explicit abilities.
|
|
168
|
+
|
|
169
|
+
- `context: true` copies instance context **once when provisioned**. Later parent
|
|
170
|
+
edits do not overwrite worker state.
|
|
171
|
+
- `tools` selects always-on tools from the parent's `tools` resolver by exact name.
|
|
172
|
+
They resolve in the child's context. Approval requirements remain intact. Installed
|
|
173
|
+
shared tools are not copied by this selector; declare them on the worker or expose
|
|
174
|
+
them through a restricted app.
|
|
175
|
+
- `memory: "shared"` reuses selected parent profiles with parent **agent-scoped**
|
|
176
|
+
adapter identity and read-only tools. `"isolated"` uses the child's identity with the
|
|
177
|
+
same profile definitions. Omit memory inheritance to retain only the worker's own
|
|
178
|
+
profiles. Adapter factories must actually namespace storage by the supplied identity;
|
|
179
|
+
a factory that ignores it cannot be isolated by Foundry.
|
|
180
|
+
- Memory objects can choose `profiles` and request `access: "curator"`; this never
|
|
181
|
+
upgrades a parent reader surface. Read-only inheritance also removes ambient-context
|
|
182
|
+
mutation tools. Custom `mount` profiles cannot be safely inspected and are rejected
|
|
183
|
+
for inheritance. Shared memory is agent-scoped, not a copy of a parent conversation;
|
|
184
|
+
its stable conversation scope is the parent's stable agent event conversation.
|
|
185
|
+
- `apps` borrows only currently installed parent applications, including their selected
|
|
186
|
+
account and configuration. It is recomputed for each run, not copied into worker
|
|
187
|
+
desired state. Removing the parent's installation revokes it. The persistent
|
|
188
|
+
application data adapter is rechecked before borrowed app tool and account-session
|
|
189
|
+
operations, including long-running workers. Already-running external effects cannot
|
|
190
|
+
be undone by revocation.
|
|
191
|
+
|
|
192
|
+
`restrictApp(app, { tools, operations, transmissions })` is a restricted view of an
|
|
193
|
+
app's existing identity. Every list is an exact allowlist; omitted lists grant
|
|
194
|
+
nothing. Chaining modifiers intersects permissions. `tools` filters contributed tools;
|
|
195
|
+
`operations` gates `withAccountSession`; `transmissions` gates generated transmission
|
|
196
|
+
tools, inbound connections and outbound dispatch. Raw strings/unmodified apps in
|
|
197
|
+
`inherit.apps` grant none of these operations until restricted explicitly. Duplicate
|
|
198
|
+
child/inherited catalogue identities fail rather than letting an unrestricted entry
|
|
199
|
+
shadow a restricted one.
|
|
200
|
+
|
|
201
|
+
Outbound route grants/bindings remain separately required and are **not inherited**.
|
|
202
|
+
App modifiers cannot grant a route, acquire credentials, or disable tool approval.
|
|
203
|
+
The HTTP API remains protected by the application request-authorization adapter.
|
|
204
|
+
|
|
205
|
+
These are model capability boundaries, not a sandbox for hostile application code.
|
|
206
|
+
App installers, tool implementations, memory factories, `configure`, and cleanup hooks
|
|
207
|
+
are trusted code. For example, an app should use its supplied account-session adapter
|
|
208
|
+
instead of bypassing it with process-global credentials.
|
|
209
|
+
|
|
210
|
+
## Management and retention
|
|
211
|
+
|
|
212
|
+
```ts
|
|
213
|
+
const worker = client.subagent(assistantId, "research");
|
|
214
|
+
const instance = await worker.ensure();
|
|
215
|
+
await worker.send("Include these three companies.");
|
|
216
|
+
const state = await worker.data();
|
|
217
|
+
const children = await client.subagents(assistantId);
|
|
218
|
+
await worker.archive();
|
|
219
|
+
await worker.resume();
|
|
220
|
+
await worker.archive();
|
|
221
|
+
await worker.purge();
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`data()` lists the instance, conversations, children, activations, pending messages, event journal records,
|
|
225
|
+
owned tasks and inbox items. Normal transcript and environment APIs work with its
|
|
226
|
+
instance/conversation IDs. Listing and inspection do not provision or reactivate it.
|
|
227
|
+
|
|
228
|
+
Archival marks the worker inactive first, archives existing descendants, disarms
|
|
229
|
+
schedules, and stops queued/running work. Its data and unfinished events remain. New
|
|
230
|
+
messages, delegation and direct runs fail while archived. Resume activates only the
|
|
231
|
+
selected worker and replays pending events. Descendants and paused schedules require
|
|
232
|
+
explicit resumption. Removing a declaration detaches existing workers; it does not
|
|
233
|
+
delete their records or prevent inspection/archival.
|
|
234
|
+
|
|
235
|
+
Purge requires archival, no running work, all descendants already purged, adapter
|
|
236
|
+
support, and an explicit idempotent `cleanup` hook for application-owned private
|
|
237
|
+
memory, transcripts and external files. Keep the declaration until cleanup finishes.
|
|
238
|
+
Use a no-op hook only when the application has no external worker data. Hook failure
|
|
239
|
+
preserves the archived records so cleanup can be retried.
|
|
240
|
+
|
|
241
|
+
The bundled adapters atomically remove owned conversations, pending deliveries, event records and deduplication receipts,
|
|
242
|
+
activations, VFS snapshots, tasks, inbox items and scoped environment data. Shared
|
|
243
|
+
workspace entries, parent memory and app accounts are never purged. A minimal instance
|
|
244
|
+
tombstone retains ownership and provisioning identity, preventing an old message or
|
|
245
|
+
retry from silently recreating the worker. Use a new name for a replacement. Execution
|
|
246
|
+
history and observability have their own retention; purge does not erase those logs
|
|
247
|
+
or third-party records.
|
|
248
|
+
|
|
249
|
+
The REST equivalents live under
|
|
250
|
+
`/api/agent-instances/:parent/subagents`: `GET` lists workers;
|
|
251
|
+
`POST /:name` ensures one; `POST /:name/messages` accepts `{ message, delivery? }`;
|
|
252
|
+
`GET /:name/data` inspects it; `POST /:name/archive`, `/resume`, and `/purge`
|
|
253
|
+
manage its lifecycle. The runtime exposes matching `subagent`, `listSubagents`,
|
|
254
|
+
`messageSubagent`, `subagentData`, `archiveSubagent`, `resumeSubagent`, and
|
|
255
|
+
`purgeSubagent` methods.
|
|
256
|
+
|
|
257
|
+
`POST /api/events` accepts `{ target: { agentId, conversationId }, event, policy? }`,
|
|
258
|
+
matching `runtime.emitEvent` and `client.emitEvent`. It uses the same application
|
|
259
|
+
request authorization as the rest of the HTTP API.
|