glove-foundry 0.9.0 → 0.10.1

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.
@@ -14,6 +14,116 @@ import { FactAdapter, FactScope, FactStore, FactInput } from 'glove-facts';
14
14
  import { GoalAdapter, GoalScope, GoalProgram, GoalRunner } from 'glove-memory/goals';
15
15
  import { FormAdapter, FormRunner } from 'glove-memory/forms';
16
16
 
17
+ declare const FOUNDRY_SCHEDULE_BRAND: unique symbol;
18
+ /**
19
+ * What a recurring schedule does about occurrences that passed while the
20
+ * runtime was not running. `fire-once` (default) delivers the earliest missed
21
+ * occurrence and folds the rest into it; `catch-up` delivers every one in
22
+ * order; `skip` drops an occurrence more than a minute late.
23
+ */
24
+ type FoundryScheduleMisfirePolicy = "fire-once" | "skip" | "catch-up";
25
+ type FoundryScheduleTimingInput = {
26
+ readonly kind: "at";
27
+ readonly at: string;
28
+ } | {
29
+ readonly kind: "after";
30
+ readonly duration: string;
31
+ } | {
32
+ readonly kind: "every";
33
+ readonly interval: string;
34
+ readonly misfire?: FoundryScheduleMisfirePolicy;
35
+ } | {
36
+ readonly kind: "cron";
37
+ readonly expression: string;
38
+ readonly timezone?: string;
39
+ readonly misfire?: FoundryScheduleMisfirePolicy;
40
+ };
41
+ type FoundryScheduleTiming = {
42
+ readonly kind: "at";
43
+ readonly at: string;
44
+ } | {
45
+ readonly kind: "every";
46
+ readonly intervalMs: number;
47
+ readonly misfire?: FoundryScheduleMisfirePolicy;
48
+ } | {
49
+ readonly kind: "cron";
50
+ readonly expression: string;
51
+ readonly timezone: string;
52
+ readonly misfire?: FoundryScheduleMisfirePolicy;
53
+ };
54
+ interface DefineFoundryScheduleOptions {
55
+ /** Stable semantic name within one agent definition. It is not a runtime id. */
56
+ readonly name: string;
57
+ readonly description?: string;
58
+ readonly message: string;
59
+ readonly payload?: unknown;
60
+ readonly timing: FoundryScheduleTimingInput;
61
+ readonly enabled?: boolean;
62
+ }
63
+ type FoundryScheduleDefinition = Readonly<DefineFoundryScheduleOptions> & {
64
+ readonly [FOUNDRY_SCHEDULE_BRAND]: true;
65
+ };
66
+ declare function defineSchedule(options: DefineFoundryScheduleOptions): FoundryScheduleDefinition;
67
+ declare function isFoundrySchedule(value: unknown): value is FoundryScheduleDefinition;
68
+
69
+ /**
70
+ * pending: claimed, not yet handed to a run (or the run that had it was lost).
71
+ * accepted: a run has it. completed / failed: that run settled.
72
+ * skipped: deliberately not delivered (a missed occurrence under `misfire: "skip"`).
73
+ * cancelled: the activation was paused, cancelled or changed before delivery, or its run was cancelled.
74
+ */
75
+ type FoundryScheduleOccurrenceStatus = "pending" | "accepted" | "completed" | "failed" | "skipped" | "cancelled";
76
+ interface FoundryScheduleOccurrence {
77
+ /** Deterministic: activation id, schedule revision and scheduled time. */
78
+ readonly id: string;
79
+ readonly activationId: string;
80
+ /** The activation's schedule revision when this occurrence was claimed. */
81
+ readonly revision: string;
82
+ /** The time the schedule meant, independent of when it was claimed, run or finished. */
83
+ readonly scheduledFor: string;
84
+ readonly definitionId: string;
85
+ readonly agentId: string;
86
+ readonly conversationId: string;
87
+ readonly workspaceId: string;
88
+ /** The request a run for this occurrence starts from; `source.occurrenceId` is this id. */
89
+ readonly request: FoundryRequest;
90
+ readonly status: FoundryScheduleOccurrenceStatus;
91
+ /** Why it was skipped or cancelled: misfire, paused, cancelled, superseded, agent-inactive, run-cancelled. */
92
+ readonly reason?: string;
93
+ /** The run handling it now, or the run that settled it. */
94
+ readonly runId?: string;
95
+ /** Every run it was handed to, oldest first. More than one means a retry after a crash. */
96
+ readonly runIds?: ReadonlyArray<string>;
97
+ /** Handoffs so far. */
98
+ readonly attempts: number;
99
+ /** Later occurrences that also passed while the runtime was down and were folded into this one (`fire-once`). */
100
+ readonly coalesced?: number;
101
+ readonly createdAt: string;
102
+ readonly updatedAt: string;
103
+ readonly acceptedAt?: string;
104
+ readonly settledAt?: string;
105
+ }
106
+ interface FoundryScheduleOccurrenceFilter {
107
+ readonly activationId?: string;
108
+ readonly workspaceId?: string;
109
+ readonly agentId?: string;
110
+ readonly status?: FoundryScheduleOccurrenceStatus | ReadonlyArray<FoundryScheduleOccurrenceStatus>;
111
+ }
112
+ type ScheduleConfiguration = Pick<FoundryActivationRecord, "definitionId" | "agentId" | "conversationId" | "message" | "payload" | "timing">;
113
+ /**
114
+ * The schedule configuration an occurrence belongs to. It changes only when
115
+ * what the schedule delivers, to whom, or when changes; status and timestamp
116
+ * writes leave it alone, and so does the order a store returns object keys in.
117
+ */
118
+ declare function activationScheduleRevision(activation: ScheduleConfiguration): string;
119
+ /**
120
+ * Whether a stored revision belongs to this configuration: the canonical
121
+ * revision, or one 0.10.0 stored for it. A matching stored revision is kept
122
+ * as it is, so occurrence ids derived from it do not change.
123
+ */
124
+ declare function scheduleRevisionMatches(activation: ScheduleConfiguration, revision: string): boolean;
125
+ declare function scheduleOccurrenceId(activationId: string, revision: string, scheduledFor: string): string;
126
+
17
127
  declare const FOUNDRY_APPROVAL_DIRECTORY_ENV = "GLOVE_FOUNDRY_APPROVAL_DIRECTORY";
18
128
  /** Default live wait before a run with durable approvals suspends. */
19
129
  declare const DEFAULT_APPROVAL_WAIT_MS = 60000;
@@ -1217,47 +1327,6 @@ type FoundryMeshCommand = (MeshCommandBase & {
1217
1327
  readonly note: string;
1218
1328
  });
1219
1329
 
1220
- declare const FOUNDRY_SCHEDULE_BRAND: unique symbol;
1221
- type FoundryScheduleTimingInput = {
1222
- readonly kind: "at";
1223
- readonly at: string;
1224
- } | {
1225
- readonly kind: "after";
1226
- readonly duration: string;
1227
- } | {
1228
- readonly kind: "every";
1229
- readonly interval: string;
1230
- } | {
1231
- readonly kind: "cron";
1232
- readonly expression: string;
1233
- readonly timezone?: string;
1234
- };
1235
- type FoundryScheduleTiming = {
1236
- readonly kind: "at";
1237
- readonly at: string;
1238
- } | {
1239
- readonly kind: "every";
1240
- readonly intervalMs: number;
1241
- } | {
1242
- readonly kind: "cron";
1243
- readonly expression: string;
1244
- readonly timezone: string;
1245
- };
1246
- interface DefineFoundryScheduleOptions {
1247
- /** Stable semantic name within one agent definition. It is not a runtime id. */
1248
- readonly name: string;
1249
- readonly description?: string;
1250
- readonly message: string;
1251
- readonly payload?: unknown;
1252
- readonly timing: FoundryScheduleTimingInput;
1253
- readonly enabled?: boolean;
1254
- }
1255
- type FoundryScheduleDefinition = Readonly<DefineFoundryScheduleOptions> & {
1256
- readonly [FOUNDRY_SCHEDULE_BRAND]: true;
1257
- };
1258
- declare function defineSchedule(options: DefineFoundryScheduleOptions): FoundryScheduleDefinition;
1259
- declare function isFoundrySchedule(value: unknown): value is FoundryScheduleDefinition;
1260
-
1261
1330
  declare const FOUNDRY_CORE_COMMAND_EVENT = "foundry.core.command";
1262
1331
  type FoundryCoreCommand = {
1263
1332
  readonly id: string;
@@ -1280,14 +1349,7 @@ type FoundryCoreCommand = {
1280
1349
  readonly timing: {
1281
1350
  readonly kind: "at";
1282
1351
  readonly at: string;
1283
- } | {
1284
- readonly kind: "every";
1285
- readonly intervalMs: number;
1286
- } | {
1287
- readonly kind: "cron";
1288
- readonly expression: string;
1289
- readonly timezone: string;
1290
- };
1352
+ } | FoundryScheduleTiming;
1291
1353
  } | {
1292
1354
  readonly id: string;
1293
1355
  readonly type: "playbook.sync";
@@ -2033,6 +2095,18 @@ interface FoundryActivationRecord {
2033
2095
  readonly status: "pending" | "active" | "paused" | "completed" | "cancelled";
2034
2096
  readonly createdByRunId: string;
2035
2097
  readonly lastRunId?: string;
2098
+ /**
2099
+ * The schedule configuration `nextOccurrenceAt` belongs to (see
2100
+ * `activationScheduleRevision`). Set by Foundry; a changed configuration
2101
+ * starts a new cursor and new occurrence identities.
2102
+ */
2103
+ readonly scheduleRevision?: string;
2104
+ /**
2105
+ * The scheduled time of the next occurrence this activation owes. Foundry
2106
+ * moves it only after the occurrence at the old value is stored, so a
2107
+ * restart resumes from here instead of from the current time.
2108
+ */
2109
+ readonly nextOccurrenceAt?: string;
2036
2110
  readonly createdAt: string;
2037
2111
  readonly updatedAt: string;
2038
2112
  }
@@ -2074,6 +2148,21 @@ interface FoundryDataAdapter {
2074
2148
  putApproval?(approval: FoundryApproval): Effect.Effect<void, unknown, never>;
2075
2149
  getApproval?(id: string): Effect.Effect<FoundryApproval | null, unknown, never>;
2076
2150
  listApprovals?(): Effect.Effect<ReadonlyArray<FoundryApproval>, unknown, never>;
2151
+ /**
2152
+ * Schedule occurrences (optional). With these, every occurrence of a
2153
+ * schedule or sleep is stored before the activation moves past it, survives
2154
+ * a restart until a run settles it, and stays listable afterwards. Without
2155
+ * them Foundry keeps occurrences in memory, and a crash between an
2156
+ * occurrence coming due and its run finishing can lose it.
2157
+ *
2158
+ * `claimScheduleOccurrence` is an atomic insert-if-absent by `id`: it
2159
+ * returns false, and changes nothing, when the id exists. Adapters may drop
2160
+ * terminal occurrences older than the latest few per activation.
2161
+ */
2162
+ claimScheduleOccurrence?(occurrence: FoundryScheduleOccurrence): Effect.Effect<boolean, unknown, never>;
2163
+ putScheduleOccurrence?(occurrence: FoundryScheduleOccurrence): Effect.Effect<void, unknown, never>;
2164
+ getScheduleOccurrence?(id: string): Effect.Effect<FoundryScheduleOccurrence | null, unknown, never>;
2165
+ listScheduleOccurrences?(filter?: FoundryScheduleOccurrenceFilter): Effect.Effect<ReadonlyArray<FoundryScheduleOccurrence>, unknown, never>;
2077
2166
  getActivation(id: string): Effect.Effect<FoundryActivationRecord | null, unknown, never>;
2078
2167
  putActivation(activation: FoundryActivationRecord): Effect.Effect<void, unknown, never>;
2079
2168
  listActivations(workspaceId?: string): Effect.Effect<ReadonlyArray<FoundryActivationRecord>, unknown, never>;
@@ -2113,6 +2202,10 @@ interface FoundryRequest {
2113
2202
  readonly provider?: string;
2114
2203
  readonly eventId?: string;
2115
2204
  readonly threadKey?: string;
2205
+ /** For an activation: the occurrence this run delivers. Stable across retries; use it to key side effects. */
2206
+ readonly occurrenceId?: string;
2207
+ /** For an activation: the time the schedule meant, whenever the run actually starts. */
2208
+ readonly scheduledFor?: string;
2116
2209
  };
2117
2210
  }
2118
2211
  /**
@@ -2200,6 +2293,7 @@ declare class MemoryFoundryDataAdapter implements FoundryDataAdapter {
2200
2293
  private readonly pendingInbound;
2201
2294
  private readonly approvals;
2202
2295
  private readonly activations;
2296
+ private readonly occurrences;
2203
2297
  private readonly conversations;
2204
2298
  private readonly workspace;
2205
2299
  private readonly workingEnvironments;
@@ -2234,6 +2328,10 @@ declare class MemoryFoundryDataAdapter implements FoundryDataAdapter {
2234
2328
  claimEvent(record: FoundryEventRecord): Effect.Effect<boolean, never, never>;
2235
2329
  putEvent(record: FoundryEventRecord): Effect.Effect<void, never, never>;
2236
2330
  listEvents(): Effect.Effect<FoundryEventRecord[], never, never>;
2331
+ claimScheduleOccurrence(occurrence: FoundryScheduleOccurrence): Effect.Effect<boolean, never, never>;
2332
+ putScheduleOccurrence(occurrence: FoundryScheduleOccurrence): Effect.Effect<void, never, never>;
2333
+ getScheduleOccurrence(id: string): Effect.Effect<FoundryScheduleOccurrence | null, never, never>;
2334
+ listScheduleOccurrences(filter?: FoundryScheduleOccurrenceFilter): Effect.Effect<FoundryScheduleOccurrence[], never, never>;
2237
2335
  putPendingInbound(record: FoundryPendingInbound): Effect.Effect<void, never, never>;
2238
2336
  deletePendingInbound(id: string): Effect.Effect<void, never, never>;
2239
2337
  listPendingInbound(): Effect.Effect<FoundryPendingInbound[], never, never>;
@@ -2434,4 +2532,4 @@ interface FoundryEventRecord {
2434
2532
  readonly createdAt: string;
2435
2533
  }
2436
2534
 
2437
- export { type ApplicationConnectionState as $, type AgentHandlerContext as A, type AgentApplicationInstallContext as B, type Conversation as C, type AgentApplicationOptions as D, type EnvironmentValue as E, type FoundryDelegationUpdate as F, type AgentAssemblyContext as G, type AgentAssemblyOptions as H, type InboundDeliveryClaim as I, AgentDefinitionId as J, type AgentDefinitionSurfaceContext as K, type AgentFactoryContext as L, AgentId as M, type AgentInstallContext as N, OutboundRoute as O, type PlaybookSubscription as P, type AgentInstallation as Q, type AgentInstallationKind as R, type SharedInboxItem as S, type AgentMessageReceipt as T, type AgentPlaybookInput as U, type AgentProvisioningPolicy as V, type WorkspaceEntry as W, type AgentRuntimeControls as X, type AnyFoundryAgent as Y, type AppRestrictions as Z, type ApplicationConnectionContext as _, type FoundryMeshMessage as a, type FoundryApp as a$, type ApplicationConnectionStatus as a0, BindingId as a1, BindingNotFound as a2, CapabilityId as a3, type ComposedAgentPlaybook as a4, type ComposedAgentPlaybookInput as a5, type ConnectionReceiveInput as a6, type CreateAgentInstanceOptions as a7, type CreateConversationOptions as a8, type CustomProvisionedAgent as a9, FOUNDRY_AGENT_ROUTE_ENV as aA, FOUNDRY_APPLICATION_ENV as aB, FOUNDRY_APPROVAL_DIRECTORY_ENV as aC, FOUNDRY_COMPOSED_PLAYBOOK_BRAND as aD, FOUNDRY_CONNECTION_BRAND as aE, FOUNDRY_CORE_COMMAND_EVENT as aF, FOUNDRY_EVENT_PREFIX as aG, FOUNDRY_EXECUTION_MARKER as aH, FOUNDRY_LAYER_BRAND as aI, FOUNDRY_MCP_BRAND as aJ, FOUNDRY_MEMORY_BRAND as aK, FOUNDRY_PLAYBOOK_ACTION_BRAND as aL, FOUNDRY_REPL_BRAND as aM, FOUNDRY_SCHEDULE_BRAND as aN, FOUNDRY_SHARED_TOOL_BRAND as aO, FOUNDRY_SUBSCRIBER_BRAND as aP, FOUNDRY_TRANSMISSION_BRAND as aQ, FOUNDRY_TRANSMISSION_EVENT_BRAND as aR, FOUNDRY_TRANSMISSION_PREDICATE_BRAND as aS, FOUNDRY_WORKING_ENVIRONMENT_BRAND as aT, type FoundryAccountSessionAdapter as aU, type FoundryAgent as aV, type FoundryAgentComponent as aW, type FoundryAgentComposition as aX, type FoundryAgentConventionModule as aY, type FoundryAgentDefinition as aZ, type FoundryAgentMode as a_, type CustomProvisioningContext as aa, DEFAULT_APPROVAL_EXPIRES_AFTER_MS as ab, DEFAULT_APPROVAL_WAIT_MS as ac, type DefineAgentOptions as ad, type DefineConnectionOptions as ae, type DefineFoundryReplOptions as af, type DefineFoundryScheduleOptions as ag, type DefineFoundrySubagentOptions as ah, type DefineFoundryWorkingEnvironmentOptions as ai, type DefinePlaybookSubscriptionOptions as aj, type DefinitionConfigInput as ak, type DurableSubagentOptions as al, type DurableSubagentOwnership as am, type DurableSubagents as an, EMPTY_AGENT_COMPOSITION as ao, EMPTY_CAPABILITY_REGISTRY as ap, EMPTY_NATIVE_REGISTRY as aq, type EgressAdapter as ar, type EgressContext as as, EventId as at, EventNotFound as au, EventReference as av, FOUNDRY_AGENT_APPLICATION_BRAND as aw, FOUNDRY_AGENT_BRAND as ax, FOUNDRY_AGENT_DEFINITION_BRAND as ay, FOUNDRY_AGENT_FILE_ENV as az, type FoundryDataAdapter as b, type FoundryProgrammaticTools as b$, type FoundryAppMcp as b0, type FoundryAppMcpTool as b1, type FoundryAppToolDecision as b2, type FoundryApplicationConnection as b3, type FoundryApprovalDecision as b4, FoundryApprovalDisplayManager as b5, type FoundryApprovalPolicy as b6, type FoundryApprovalStatus as b7, type FoundryCall as b8, type FoundryCallContext as b9, type FoundryJavaScriptReplDefinition as bA, type FoundryLayer as bB, type FoundryLayerOptions as bC, type FoundryLayerReference as bD, type FoundryLayerSelection as bE, type FoundryLispReplDefinition as bF, type FoundryListResolver as bG, type FoundryMcp as bH, type FoundryMcpOptions as bI, type FoundryMemoryProfile as bJ, type FoundryMemoryProfileOptions as bK, type FoundryMemoryReference as bL, type FoundryMemorySelection as bM, type FoundryMeshConfig as bN, type FoundryMeshOptions as bO, type FoundryMeshParty as bP, type FoundryMeshThread as bQ, type FoundryMeshThreadStatus as bR, type FoundryMessageInput as bS, type FoundryMessageOptions as bT, type FoundryMountedRepl as bU, type FoundryNativeManifest as bV, type FoundryNativeManifestEntry as bW, type FoundryNativeRegistry as bX, type FoundryPlaybookAction as bY, type FoundryProgrammaticToolContext as bZ, type FoundryProgrammaticToolSelection as b_, type FoundryCallOptions as ba, type FoundryCapabilityKind as bb, type FoundryCapabilityManifest as bc, type FoundryCapabilityManifestEntry as bd, type FoundryCapabilityRegistry as be, type FoundryCompositionSource as bf, type FoundryContextProvider as bg, type FoundryCoreCommand as bh, type FoundryDelegate as bi, type FoundryDelegateOptions as bj, type FoundryDelegation as bk, type FoundryDelegationReply as bl, type FoundryDelegationStatus as bm, type FoundryDomainError as bn, type FoundryEventPolicy as bo, type FoundryEventTarget as bp, type FoundryExecutionContext as bq, type FoundryFactsOptions as br, type FoundryFormsOptions as bs, type FoundryGoalsOptions as bt, type FoundryGuidanceHandles as bu, type FoundryGuidanceScope as bv, type FoundryHookDefinition as bw, type FoundryInstallable as bx, type FoundryInstalledApp as by, type FoundryInstanceProvisioner as bz, type AgentInstance as c, type TransmissionPredicateOptions as c$, type FoundryPythonReplDefinition as c0, type FoundryReplApp as c1, type FoundryReplDefinition as c2, type FoundryRequest as c3, type FoundryResolvedMcp as c4, type FoundryResolver as c5, type FoundryResult as c6, type FoundryRouteMap as c7, type FoundryScheduleDefinition as c8, type FoundryScheduleTiming as c9, type IngressAdapter as cA, type IngressContext as cB, type InstallationSelection as cC, type McpAdapterFactory as cD, MemoryFoundryDataAdapter as cE, type OutboundContract as cF, type PlaybookActionOptions as cG, type PlaybookDirective as cH, type PlaybookDirectiveInput as cI, type PlaybookMatch as cJ, type PlaybookMatchInput as cK, type PlaybookOutboundDirective as cL, type PlaybookOutboundInput as cM, type PlaybookSubscriptionTarget as cN, type PlaybookSubscriptionTargetInput as cO, ReplyPolicy as cP, Route as cQ, RouteId as cR, RouteNotFound as cS, RunGrant as cT, RunId as cU, type SharedToolOptions as cV, TopologyConflict as cW, type TransmissionEventDirection as cX, type TransmissionEventOptions as cY, TransmissionId as cZ, type TransmissionOptions as c_, type FoundryScheduleTimingInput as ca, type FoundrySharedTool as cb, type FoundrySubagentToolContext as cc, type FoundrySubscriber as cd, type FoundrySubscriberOptions as ce, type FoundrySubscriberSelection as cf, type FoundrySurfaceContext as cg, type FoundrySuspension as ch, type FoundryToolBody as ci, type FoundryTransmission as cj, type FoundryTransmissionDelivery as ck, type FoundryTransmissionEvent as cl, type FoundryTransmissionPredicate as cm, type FoundryVfs as cn, type FoundryVfsHandle as co, type FoundryWorkingEnvironmentCreateContext as cp, type FoundryWorkingEnvironmentDefinition as cq, type FoundryWorkingEnvironmentPersistenceAdapter as cr, type FoundryWorkingEnvironmentPersistenceContext as cs, GrantResolutionError as ct, type InboundContract as cu, type InferAgentInput as cv, type InferAgentOutput as cw, type InferInboundEvent as cx, type InferOutboundInput as cy, type InferOutboundOutput as cz, type FoundryActivationRecord as d, restrictApp as d$, type TransmissionSerializationContext as d0, type UpdateAgentInstanceOptions as d1, type UpdateConversationOptions as d2, composeAgent as d3, composePlaybook as d4, configureLayer as d5, configureMemory as d6, createAgentInstance as d7, createConversation as d8, createFoundryApproval as d9, defineTransmissionPredicate as dA, defineWorkingEnvironment as dB, foundryDataEnvironmentPersistence as dC, foundryGuidanceSubject as dD, hostedMeshOptions as dE, install as dF, installRegistry as dG, installationKey as dH, installedApplicationTransmissionToolName as dI, internalAgentName as dJ, isFoundryAgent as dK, isFoundryAgentDefinition as dL, isFoundryCapability as dM, isFoundryLayer as dN, isFoundrySchedule as dO, isFoundrySubscriber as dP, isFoundryTransmission as dQ, isInboxCapableStore as dR, isMeshTransport as dS, listFoundryApprovals as dT, meshIdentity as dU, mountAgentDefinitionMemory as dV, mountFoundrySurfaces as dW, reconstructAgentInstance as dX, reconstructPlaybook as dY, reconstructPlaybookSubscription as dZ, resolveFoundryApproval as d_, createFoundryCoreTools as da, createInstalledApplicationTransmissionTools as db, defineAgent as dc, defineAgentApplication as dd, defineAgentFromModule as de, defineAgentInstance as df, defineApp as dg, defineCall as dh, defineConnection as di, defineFacts as dj, defineForms as dk, defineGoals as dl, defineLayer as dm, defineMcp as dn, defineMemory as dp, definePlaybookAction as dq, definePlaybookSubscription as dr, defineRepl as ds, defineRoutes as dt, defineSchedule as du, defineSharedTool as dv, defineSubagent as dw, defineSubscriber as dx, defineTransmission as dy, defineTransmissionEvent as dz, type ProvisionAgentOptions as e, routeFromInternalAgentName as e0, toGloveMessage as e1, toGloveRequestInput as e2, transmissionPredicate as e3, withFoundryPermissions as e4, type FoundryEventRecord as f, type FoundryPendingInbound as g, type FoundryApproval as h, type FoundryWorkingEnvironmentSnapshotOwner as i, type FoundryTask as j, type AgentPlaybook as k, type AnyFoundryTransmission as l, AccountReference as m, type InferAccountMetadata as n, AgentBinding as o, type FoundryAgentApplication as p, InboundRoute as q, type CapabilityDefinition as r, type InferInboundConfig as s, type InferOutboundConfig as t, type AccountContract as u, AccountId as v, AccountNotFound as w, AccountSessionUnavailable as x, AccountSummary as y, type AgentApplicationContribution as z };
2535
+ export { type AppRestrictions as $, type AgentHandlerContext as A, AccountSummary as B, type Conversation as C, type AgentApplicationContribution as D, type EnvironmentValue as E, type FoundryDelegationUpdate as F, type AgentApplicationInstallContext as G, type AgentApplicationOptions as H, type InboundDeliveryClaim as I, type AgentAssemblyContext as J, type AgentAssemblyOptions as K, AgentDefinitionId as L, type AgentDefinitionSurfaceContext as M, type AgentFactoryContext as N, OutboundRoute as O, type PlaybookSubscription as P, AgentId as Q, type AgentInstallContext as R, type SharedInboxItem as S, type AgentInstallation as T, type AgentInstallationKind as U, type AgentMessageReceipt as V, type WorkspaceEntry as W, type AgentPlaybookInput as X, type AgentProvisioningPolicy as Y, type AgentRuntimeControls as Z, type AnyFoundryAgent as _, type FoundryMeshMessage as a, type FoundryAgentDefinition as a$, type ApplicationConnectionContext as a0, type ApplicationConnectionState as a1, type ApplicationConnectionStatus as a2, BindingId as a3, BindingNotFound as a4, CapabilityId as a5, type ComposedAgentPlaybook as a6, type ComposedAgentPlaybookInput as a7, type ConnectionReceiveInput as a8, type CreateAgentInstanceOptions as a9, FOUNDRY_AGENT_DEFINITION_BRAND as aA, FOUNDRY_AGENT_FILE_ENV as aB, FOUNDRY_AGENT_ROUTE_ENV as aC, FOUNDRY_APPLICATION_ENV as aD, FOUNDRY_APPROVAL_DIRECTORY_ENV as aE, FOUNDRY_COMPOSED_PLAYBOOK_BRAND as aF, FOUNDRY_CONNECTION_BRAND as aG, FOUNDRY_CORE_COMMAND_EVENT as aH, FOUNDRY_EVENT_PREFIX as aI, FOUNDRY_EXECUTION_MARKER as aJ, FOUNDRY_LAYER_BRAND as aK, FOUNDRY_MCP_BRAND as aL, FOUNDRY_MEMORY_BRAND as aM, FOUNDRY_PLAYBOOK_ACTION_BRAND as aN, FOUNDRY_REPL_BRAND as aO, FOUNDRY_SCHEDULE_BRAND as aP, FOUNDRY_SHARED_TOOL_BRAND as aQ, FOUNDRY_SUBSCRIBER_BRAND as aR, FOUNDRY_TRANSMISSION_BRAND as aS, FOUNDRY_TRANSMISSION_EVENT_BRAND as aT, FOUNDRY_TRANSMISSION_PREDICATE_BRAND as aU, FOUNDRY_WORKING_ENVIRONMENT_BRAND as aV, type FoundryAccountSessionAdapter as aW, type FoundryAgent as aX, type FoundryAgentComponent as aY, type FoundryAgentComposition as aZ, type FoundryAgentConventionModule as a_, type CreateConversationOptions as aa, type CustomProvisionedAgent as ab, type CustomProvisioningContext as ac, DEFAULT_APPROVAL_EXPIRES_AFTER_MS as ad, DEFAULT_APPROVAL_WAIT_MS as ae, type DefineAgentOptions as af, type DefineConnectionOptions as ag, type DefineFoundryReplOptions as ah, type DefineFoundryScheduleOptions as ai, type DefineFoundrySubagentOptions as aj, type DefineFoundryWorkingEnvironmentOptions as ak, type DefinePlaybookSubscriptionOptions as al, type DefinitionConfigInput as am, type DurableSubagentOptions as an, type DurableSubagentOwnership as ao, type DurableSubagents as ap, EMPTY_AGENT_COMPOSITION as aq, EMPTY_CAPABILITY_REGISTRY as ar, EMPTY_NATIVE_REGISTRY as as, type EgressAdapter as at, type EgressContext as au, EventId as av, EventNotFound as aw, EventReference as ax, FOUNDRY_AGENT_APPLICATION_BRAND as ay, FOUNDRY_AGENT_BRAND as az, type FoundryDataAdapter as b, type FoundryProgrammaticToolContext as b$, type FoundryAgentMode as b0, type FoundryApp as b1, type FoundryAppMcp as b2, type FoundryAppMcpTool as b3, type FoundryAppToolDecision as b4, type FoundryApplicationConnection as b5, type FoundryApprovalDecision as b6, FoundryApprovalDisplayManager as b7, type FoundryApprovalPolicy as b8, type FoundryApprovalStatus as b9, type FoundryInstalledApp as bA, type FoundryInstanceProvisioner as bB, type FoundryJavaScriptReplDefinition as bC, type FoundryLayer as bD, type FoundryLayerOptions as bE, type FoundryLayerReference as bF, type FoundryLayerSelection as bG, type FoundryLispReplDefinition as bH, type FoundryListResolver as bI, type FoundryMcp as bJ, type FoundryMcpOptions as bK, type FoundryMemoryProfile as bL, type FoundryMemoryProfileOptions as bM, type FoundryMemoryReference as bN, type FoundryMemorySelection as bO, type FoundryMeshConfig as bP, type FoundryMeshOptions as bQ, type FoundryMeshParty as bR, type FoundryMeshThread as bS, type FoundryMeshThreadStatus as bT, type FoundryMessageInput as bU, type FoundryMessageOptions as bV, type FoundryMountedRepl as bW, type FoundryNativeManifest as bX, type FoundryNativeManifestEntry as bY, type FoundryNativeRegistry as bZ, type FoundryPlaybookAction as b_, type FoundryCall as ba, type FoundryCallContext as bb, type FoundryCallOptions as bc, type FoundryCapabilityKind as bd, type FoundryCapabilityManifest as be, type FoundryCapabilityManifestEntry as bf, type FoundryCapabilityRegistry as bg, type FoundryCompositionSource as bh, type FoundryContextProvider as bi, type FoundryCoreCommand as bj, type FoundryDelegate as bk, type FoundryDelegateOptions as bl, type FoundryDelegation as bm, type FoundryDelegationReply as bn, type FoundryDelegationStatus as bo, type FoundryDomainError as bp, type FoundryEventPolicy as bq, type FoundryEventTarget as br, type FoundryExecutionContext as bs, type FoundryFactsOptions as bt, type FoundryFormsOptions as bu, type FoundryGoalsOptions as bv, type FoundryGuidanceHandles as bw, type FoundryGuidanceScope as bx, type FoundryHookDefinition as by, type FoundryInstallable as bz, type AgentInstance as c, type TransmissionEventDirection as c$, type FoundryProgrammaticToolSelection as c0, type FoundryProgrammaticTools as c1, type FoundryPythonReplDefinition as c2, type FoundryReplApp as c3, type FoundryReplDefinition as c4, type FoundryRequest as c5, type FoundryResolvedMcp as c6, type FoundryResolver as c7, type FoundryResult as c8, type FoundryRouteMap as c9, type InferAgentOutput as cA, type InferInboundEvent as cB, type InferOutboundInput as cC, type InferOutboundOutput as cD, type IngressAdapter as cE, type IngressContext as cF, type InstallationSelection as cG, type McpAdapterFactory as cH, MemoryFoundryDataAdapter as cI, type OutboundContract as cJ, type PlaybookActionOptions as cK, type PlaybookDirective as cL, type PlaybookDirectiveInput as cM, type PlaybookMatch as cN, type PlaybookMatchInput as cO, type PlaybookOutboundDirective as cP, type PlaybookOutboundInput as cQ, type PlaybookSubscriptionTarget as cR, type PlaybookSubscriptionTargetInput as cS, ReplyPolicy as cT, Route as cU, RouteId as cV, RouteNotFound as cW, RunGrant as cX, RunId as cY, type SharedToolOptions as cZ, TopologyConflict as c_, type FoundryScheduleDefinition as ca, type FoundryScheduleMisfirePolicy as cb, type FoundryScheduleOccurrenceStatus as cc, type FoundryScheduleTiming as cd, type FoundryScheduleTimingInput as ce, type FoundrySharedTool as cf, type FoundrySubagentToolContext as cg, type FoundrySubscriber as ch, type FoundrySubscriberOptions as ci, type FoundrySubscriberSelection as cj, type FoundrySurfaceContext as ck, type FoundrySuspension as cl, type FoundryToolBody as cm, type FoundryTransmission as cn, type FoundryTransmissionDelivery as co, type FoundryTransmissionEvent as cp, type FoundryTransmissionPredicate as cq, type FoundryVfs as cr, type FoundryVfsHandle as cs, type FoundryWorkingEnvironmentCreateContext as ct, type FoundryWorkingEnvironmentDefinition as cu, type FoundryWorkingEnvironmentPersistenceAdapter as cv, type FoundryWorkingEnvironmentPersistenceContext as cw, GrantResolutionError as cx, type InboundContract as cy, type InferAgentInput as cz, type FoundryActivationRecord as d, mountFoundrySurfaces as d$, type TransmissionEventOptions as d0, TransmissionId as d1, type TransmissionOptions as d2, type TransmissionPredicateOptions as d3, type TransmissionSerializationContext as d4, type UpdateAgentInstanceOptions as d5, type UpdateConversationOptions as d6, activationScheduleRevision as d7, composeAgent as d8, composePlaybook as d9, defineSharedTool as dA, defineSubagent as dB, defineSubscriber as dC, defineTransmission as dD, defineTransmissionEvent as dE, defineTransmissionPredicate as dF, defineWorkingEnvironment as dG, foundryDataEnvironmentPersistence as dH, foundryGuidanceSubject as dI, hostedMeshOptions as dJ, install as dK, installRegistry as dL, installationKey as dM, installedApplicationTransmissionToolName as dN, internalAgentName as dO, isFoundryAgent as dP, isFoundryAgentDefinition as dQ, isFoundryCapability as dR, isFoundryLayer as dS, isFoundrySchedule as dT, isFoundrySubscriber as dU, isFoundryTransmission as dV, isInboxCapableStore as dW, isMeshTransport as dX, listFoundryApprovals as dY, meshIdentity as dZ, mountAgentDefinitionMemory as d_, configureLayer as da, configureMemory as db, createAgentInstance as dc, createConversation as dd, createFoundryApproval as de, createFoundryCoreTools as df, createInstalledApplicationTransmissionTools as dg, defineAgent as dh, defineAgentApplication as di, defineAgentFromModule as dj, defineAgentInstance as dk, defineApp as dl, defineCall as dm, defineConnection as dn, defineFacts as dp, defineForms as dq, defineGoals as dr, defineLayer as ds, defineMcp as dt, defineMemory as du, definePlaybookAction as dv, definePlaybookSubscription as dw, defineRepl as dx, defineRoutes as dy, defineSchedule as dz, type ProvisionAgentOptions as e, reconstructAgentInstance as e0, reconstructPlaybook as e1, reconstructPlaybookSubscription as e2, resolveFoundryApproval as e3, restrictApp as e4, routeFromInternalAgentName as e5, scheduleOccurrenceId as e6, scheduleRevisionMatches as e7, toGloveMessage as e8, toGloveRequestInput as e9, transmissionPredicate as ea, withFoundryPermissions as eb, type FoundryEventRecord as f, type FoundryScheduleOccurrence as g, type FoundryScheduleOccurrenceFilter as h, type FoundryPendingInbound as i, type FoundryApproval as j, type FoundryWorkingEnvironmentSnapshotOwner as k, type FoundryTask as l, type AgentPlaybook as m, type AnyFoundryTransmission as n, AccountReference as o, type InferAccountMetadata as p, AgentBinding as q, type FoundryAgentApplication as r, InboundRoute as s, type CapabilityDefinition as t, type InferInboundConfig as u, type InferOutboundConfig as v, type AccountContract as w, AccountId as x, AccountNotFound as y, AccountSessionUnavailable as z };
@@ -167,13 +167,6 @@ export default await loadExecutionAgent(${JSON.stringify(agent.route)}, ${JSON.s
167
167
  else throw error;
168
168
  }
169
169
  break;
170
- case "schedule.add":
171
- await schedules.add(command.schedule);
172
- value = null;
173
- break;
174
- case "schedule.delete":
175
- value = await schedules.delete(command.id);
176
- break;
177
170
  case "ping":
178
171
  value = Boolean(client && (await client.health()).ok);
179
172
  break;
@@ -30,7 +30,7 @@ import {
30
30
  toGloveMessage,
31
31
  toGloveRequestInput,
32
32
  withFoundryPermissions
33
- } from "./chunk-EUGKVW3J.js";
33
+ } from "./chunk-VLD3DKPI.js";
34
34
  import {
35
35
  FOUNDRY_CONVERSATION_LEASE_EVENT,
36
36
  FOUNDRY_CONVERSATION_LISTEN_EVENT,
@@ -1096,7 +1096,9 @@ function compileAgentDefinition(definition, route) {
1096
1096
  id: z.string().optional(),
1097
1097
  provider: z.string().optional(),
1098
1098
  eventId: z.string().optional(),
1099
- threadKey: z.string().optional()
1099
+ threadKey: z.string().optional(),
1100
+ occurrenceId: z.string().optional(),
1101
+ scheduledFor: z.string().optional()
1100
1102
  }).optional()
1101
1103
  });
1102
1104
  const executionEnvelope = z.object({
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
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';
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 FoundryScheduleOccurrence, h as FoundryScheduleOccurrenceFilter, i as FoundryPendingInbound, j as FoundryApproval, W as WorkspaceEntry, k as FoundryWorkingEnvironmentSnapshotOwner, S as SharedInboxItem, l as FoundryTask, m as AgentPlaybook, n as AnyFoundryTransmission, o as AccountReference, p as InferAccountMetadata, q as AgentBinding, r as FoundryAgentApplication, s as InboundRoute, O as OutboundRoute, t as CapabilityDefinition, u as InferInboundConfig, v as InferOutboundConfig } from './event-delivery-C7rYiNPs.js';
2
+ export { w as AccountContract, x as AccountId, y as AccountNotFound, z as AccountSessionUnavailable, B as AccountSummary, D as AgentApplicationContribution, G as AgentApplicationInstallContext, H as AgentApplicationOptions, J as AgentAssemblyContext, K as AgentAssemblyOptions, L as AgentDefinitionId, M as AgentDefinitionSurfaceContext, N as AgentFactoryContext, A as AgentHandlerContext, Q as AgentId, R as AgentInstallContext, T as AgentInstallation, U as AgentInstallationKind, V as AgentMessageReceipt, X as AgentPlaybookInput, Y as AgentProvisioningPolicy, Z as AgentRuntimeControls, _ as AnyFoundryAgent, $ as AppRestrictions, a0 as ApplicationConnectionContext, a1 as ApplicationConnectionState, a2 as ApplicationConnectionStatus, a3 as BindingId, a4 as BindingNotFound, a5 as CapabilityId, a6 as ComposedAgentPlaybook, a7 as ComposedAgentPlaybookInput, a8 as ConnectionReceiveInput, a9 as CreateAgentInstanceOptions, aa as CreateConversationOptions, ab as CustomProvisionedAgent, ac as CustomProvisioningContext, ad as DEFAULT_APPROVAL_EXPIRES_AFTER_MS, ae as DEFAULT_APPROVAL_WAIT_MS, af as DefineAgentOptions, ag as DefineConnectionOptions, ah as DefineFoundryReplOptions, ai as DefineFoundryScheduleOptions, aj as DefineFoundrySubagentOptions, ak as DefineFoundryWorkingEnvironmentOptions, al as DefinePlaybookSubscriptionOptions, am as DefinitionConfigInput, an as DurableSubagentOptions, ao as DurableSubagentOwnership, ap as DurableSubagents, aq as EMPTY_AGENT_COMPOSITION, ar as EMPTY_CAPABILITY_REGISTRY, as as EMPTY_NATIVE_REGISTRY, at as EgressAdapter, au as EgressContext, av as EventId, aw as EventNotFound, ax as EventReference, ay as FOUNDRY_AGENT_APPLICATION_BRAND, az as FOUNDRY_AGENT_BRAND, aA as FOUNDRY_AGENT_DEFINITION_BRAND, aB as FOUNDRY_AGENT_FILE_ENV, aC as FOUNDRY_AGENT_ROUTE_ENV, aD as FOUNDRY_APPLICATION_ENV, aE as FOUNDRY_APPROVAL_DIRECTORY_ENV, aF as FOUNDRY_COMPOSED_PLAYBOOK_BRAND, aG as FOUNDRY_CONNECTION_BRAND, aH as FOUNDRY_CORE_COMMAND_EVENT, aI as FOUNDRY_EVENT_PREFIX, aJ as FOUNDRY_EXECUTION_MARKER, aK as FOUNDRY_LAYER_BRAND, aL as FOUNDRY_MCP_BRAND, aM as FOUNDRY_MEMORY_BRAND, aN as FOUNDRY_PLAYBOOK_ACTION_BRAND, aO as FOUNDRY_REPL_BRAND, aP as FOUNDRY_SCHEDULE_BRAND, aQ as FOUNDRY_SHARED_TOOL_BRAND, aR as FOUNDRY_SUBSCRIBER_BRAND, aS as FOUNDRY_TRANSMISSION_BRAND, aT as FOUNDRY_TRANSMISSION_EVENT_BRAND, aU as FOUNDRY_TRANSMISSION_PREDICATE_BRAND, aV as FOUNDRY_WORKING_ENVIRONMENT_BRAND, aW as FoundryAccountSessionAdapter, aX as FoundryAgent, aY as FoundryAgentComponent, aZ as FoundryAgentComposition, a_ as FoundryAgentConventionModule, a$ as FoundryAgentDefinition, b0 as FoundryAgentMode, b1 as FoundryApp, b2 as FoundryAppMcp, b3 as FoundryAppMcpTool, b4 as FoundryAppToolDecision, b5 as FoundryApplicationConnection, b6 as FoundryApprovalDecision, b7 as FoundryApprovalDisplayManager, b8 as FoundryApprovalPolicy, b9 as FoundryApprovalStatus, ba as FoundryCall, bb as FoundryCallContext, bc as FoundryCallOptions, bd as FoundryCapabilityKind, be as FoundryCapabilityManifest, bf as FoundryCapabilityManifestEntry, bg as FoundryCapabilityRegistry, bh as FoundryCompositionSource, bi as FoundryContextProvider, bj as FoundryCoreCommand, bk as FoundryDelegate, bl as FoundryDelegateOptions, bm as FoundryDelegation, bn as FoundryDelegationReply, bo as FoundryDelegationStatus, F as FoundryDelegationUpdate, bp as FoundryDomainError, bq as FoundryEventPolicy, br as FoundryEventTarget, bs as FoundryExecutionContext, bt as FoundryFactsOptions, bu as FoundryFormsOptions, bv as FoundryGoalsOptions, bw as FoundryGuidanceHandles, bx as FoundryGuidanceScope, by as FoundryHookDefinition, bz as FoundryInstallable, bA as FoundryInstalledApp, bB as FoundryInstanceProvisioner, bC as FoundryJavaScriptReplDefinition, bD as FoundryLayer, bE as FoundryLayerOptions, bF as FoundryLayerReference, bG as FoundryLayerSelection, bH as FoundryLispReplDefinition, bI as FoundryListResolver, bJ as FoundryMcp, bK as FoundryMcpOptions, bL as FoundryMemoryProfile, bM as FoundryMemoryProfileOptions, bN as FoundryMemoryReference, bO as FoundryMemorySelection, bP as FoundryMeshConfig, a as FoundryMeshMessage, bQ as FoundryMeshOptions, bR as FoundryMeshParty, bS as FoundryMeshThread, bT as FoundryMeshThreadStatus, bU as FoundryMessageInput, bV as FoundryMessageOptions, bW as FoundryMountedRepl, bX as FoundryNativeManifest, bY as FoundryNativeManifestEntry, bZ as FoundryNativeRegistry, b_ as FoundryPlaybookAction, b$ as FoundryProgrammaticToolContext, c0 as FoundryProgrammaticToolSelection, c1 as FoundryProgrammaticTools, c2 as FoundryPythonReplDefinition, c3 as FoundryReplApp, c4 as FoundryReplDefinition, c5 as FoundryRequest, c6 as FoundryResolvedMcp, c7 as FoundryResolver, c8 as FoundryResult, c9 as FoundryRouteMap, ca as FoundryScheduleDefinition, cb as FoundryScheduleMisfirePolicy, cc as FoundryScheduleOccurrenceStatus, cd as FoundryScheduleTiming, ce as FoundryScheduleTimingInput, cf as FoundrySharedTool, cg as FoundrySubagentToolContext, ch as FoundrySubscriber, ci as FoundrySubscriberOptions, cj as FoundrySubscriberSelection, ck as FoundrySurfaceContext, cl as FoundrySuspension, cm as FoundryToolBody, cn as FoundryTransmission, co as FoundryTransmissionDelivery, cp as FoundryTransmissionEvent, cq as FoundryTransmissionPredicate, cr as FoundryVfs, cs as FoundryVfsHandle, ct as FoundryWorkingEnvironmentCreateContext, cu as FoundryWorkingEnvironmentDefinition, cv as FoundryWorkingEnvironmentPersistenceAdapter, cw as FoundryWorkingEnvironmentPersistenceContext, cx as GrantResolutionError, cy as InboundContract, cz as InferAgentInput, cA as InferAgentOutput, cB as InferInboundEvent, cC as InferOutboundInput, cD as InferOutboundOutput, cE as IngressAdapter, cF as IngressContext, cG as InstallationSelection, cH as McpAdapterFactory, cI as MemoryFoundryDataAdapter, cJ as OutboundContract, cK as PlaybookActionOptions, cL as PlaybookDirective, cM as PlaybookDirectiveInput, cN as PlaybookMatch, cO as PlaybookMatchInput, cP as PlaybookOutboundDirective, cQ as PlaybookOutboundInput, cR as PlaybookSubscriptionTarget, cS as PlaybookSubscriptionTargetInput, cT as ReplyPolicy, cU as Route, cV as RouteId, cW as RouteNotFound, cX as RunGrant, cY as RunId, cZ as SharedToolOptions, c_ as TopologyConflict, c$ as TransmissionEventDirection, d0 as TransmissionEventOptions, d1 as TransmissionId, d2 as TransmissionOptions, d3 as TransmissionPredicateOptions, d4 as TransmissionSerializationContext, d5 as UpdateAgentInstanceOptions, d6 as UpdateConversationOptions, d7 as activationScheduleRevision, d8 as composeAgent, d9 as composePlaybook, da as configureLayer, db as configureMemory, dc as createAgentInstance, dd as createConversation, de as createFoundryApproval, df as createFoundryCoreTools, dg as createInstalledApplicationTransmissionTools, dh as defineAgent, di as defineAgentApplication, dj as defineAgentFromModule, dk as defineAgentInstance, dl as defineApp, dm as defineCall, dn as defineConnection, dp as defineFacts, dq as defineForms, dr as defineGoals, ds as defineLayer, dt as defineMcp, du as defineMemory, dv as definePlaybookAction, dw as definePlaybookSubscription, dx as defineRepl, dy as defineRoutes, dz as defineSchedule, dA as defineSharedTool, dB as defineSubagent, dC as defineSubscriber, dD as defineTransmission, dE as defineTransmissionEvent, dF as defineTransmissionPredicate, dG as defineWorkingEnvironment, dH as foundryDataEnvironmentPersistence, dI as foundryGuidanceSubject, dJ as hostedMeshOptions, dK as install, dL as installRegistry, dM as installationKey, dN as installedApplicationTransmissionToolName, dO as internalAgentName, dP as isFoundryAgent, dQ as isFoundryAgentDefinition, dR as isFoundryCapability, dS as isFoundryLayer, dT as isFoundrySchedule, dU as isFoundrySubscriber, dV as isFoundryTransmission, dW as isInboxCapableStore, dX as isMeshTransport, dY as listFoundryApprovals, dZ as meshIdentity, d_ as mountAgentDefinitionMemory, d$ as mountFoundrySurfaces, e0 as reconstructAgentInstance, e1 as reconstructPlaybook, e2 as reconstructPlaybookSubscription, e3 as resolveFoundryApproval, e4 as restrictApp, e5 as routeFromInternalAgentName, e6 as scheduleOccurrenceId, e7 as scheduleRevisionMatches, e8 as toGloveMessage, e9 as toGloveRequestInput, ea as transmissionPredicate, eb as withFoundryPermissions } from './event-delivery-C7rYiNPs.js';
3
3
  import { Effect, Layer } from 'effect';
4
4
  import { EnvSnapshot } from 'glove-working-environment';
5
- import { T as TopologyStore, F as FoundryRuntime, D as DiscoveredAgent, a as FoundryManifest } from './client-CCY4_vqN.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-CCY4_vqN.js';
5
+ import { T as TopologyStore, F as FoundryRuntime, D as DiscoveredAgent, a as FoundryManifest } from './client-HM2x2-Ut.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-HM2x2-Ut.js';
7
7
  import { AddressInfo } from 'node:net';
8
8
  import { FoundryBrandingConfig } from './config.js';
9
9
  export { FoundryConfig, FoundryExecutionConfig, defineConfig } from './config.js';
@@ -76,6 +76,10 @@ declare class FileFoundryDataAdapter implements FoundryDataAdapter {
76
76
  claimEvent(record: FoundryEventRecord): Effect.Effect<boolean, unknown, never>;
77
77
  putEvent(record: FoundryEventRecord): Effect.Effect<void, unknown, never>;
78
78
  listEvents(): Effect.Effect<FoundryEventRecord[], unknown, never>;
79
+ claimScheduleOccurrence(occurrence: FoundryScheduleOccurrence): Effect.Effect<boolean, unknown, never>;
80
+ putScheduleOccurrence(occurrence: FoundryScheduleOccurrence): Effect.Effect<void, unknown, never>;
81
+ getScheduleOccurrence(id: string): Effect.Effect<FoundryScheduleOccurrence | null, unknown, never>;
82
+ listScheduleOccurrences(filter?: FoundryScheduleOccurrenceFilter): Effect.Effect<FoundryScheduleOccurrence[], unknown, never>;
79
83
  putPendingInbound(record: FoundryPendingInbound): Effect.Effect<void, unknown, never>;
80
84
  deletePendingInbound(id: string): Effect.Effect<void, unknown, never>;
81
85
  listPendingInbound(): Effect.Effect<FoundryPendingInbound[], unknown, never>;
@@ -208,4 +212,4 @@ interface DefineBindingOptions extends Omit<AgentBinding, "id" | "agentId" | "tr
208
212
  }
209
213
  declare function defineBinding(options: DefineBindingOptions): AgentBinding;
210
214
 
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 };
215
+ 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, FoundryScheduleOccurrence, FoundryScheduleOccurrenceFilter, 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-LI7VIGVH.js";
46
+ } from "./chunk-L72FKI7P.js";
47
47
  import {
48
48
  FoundryClient,
49
49
  FoundryRunHandle,
50
50
  createFoundryClient
51
- } from "./chunk-L5JQVTHD.js";
51
+ } from "./chunk-N2GVJ257.js";
52
52
  import {
53
53
  defineConfig
54
54
  } from "./chunk-ZFNMFE3T.js";
@@ -81,6 +81,9 @@ import {
81
81
  FOUNDRY_TRANSMISSION_PREDICATE_BRAND,
82
82
  FoundryApprovalDisplayManager,
83
83
  MemoryFoundryDataAdapter,
84
+ activationScheduleRevision,
85
+ assertScheduleOccurrence,
86
+ compareOccurrences,
84
87
  composeAgent,
85
88
  composePlaybook,
86
89
  createAgentInstance,
@@ -105,16 +108,20 @@ import {
105
108
  isFoundrySchedule,
106
109
  isFoundryTransmission,
107
110
  listFoundryApprovals,
111
+ matchesOccurrenceFilter,
112
+ prunableOccurrences,
108
113
  reconstructAgentInstance,
109
114
  reconstructPlaybook,
110
115
  reconstructPlaybookSubscription,
111
116
  resolveFoundryApproval,
112
117
  routeFromAgentFile,
118
+ scheduleOccurrenceId,
119
+ scheduleRevisionMatches,
113
120
  toGloveMessage,
114
121
  toGloveRequestInput,
115
122
  transmissionPredicate,
116
123
  withFoundryPermissions
117
- } from "./chunk-EUGKVW3J.js";
124
+ } from "./chunk-VLD3DKPI.js";
118
125
  import {
119
126
  meshIdentity
120
127
  } from "./chunk-J6NHL4SM.js";
@@ -181,6 +188,7 @@ function emptyState(environment) {
181
188
  pendingInbound: [],
182
189
  approvals: [],
183
190
  activations: [],
191
+ occurrences: [],
184
192
  conversations: [],
185
193
  workspaceEntries: [],
186
194
  workingEnvironments: [],
@@ -290,6 +298,7 @@ var FileFoundryDataAdapter = class {
290
298
  pendingInbound: parsed.pendingInbound ?? [],
291
299
  approvals: parsed.approvals ?? [],
292
300
  activations: parsed.activations ?? [],
301
+ occurrences: parsed.occurrences ?? [],
293
302
  conversations: parsed.conversations ?? [],
294
303
  workspaceEntries: parsed.workspaceEntries ?? [],
295
304
  workingEnvironments: parsed.workingEnvironments ?? [],
@@ -414,6 +423,7 @@ var FileFoundryDataAdapter = class {
414
423
  state.pendingInbound = state.pendingInbound.filter((item) => item.request.agentId !== agentId);
415
424
  state.approvals = state.approvals.filter((item) => item.agentId !== agentId);
416
425
  state.activations = state.activations.filter((item) => item.agentId !== agentId);
426
+ state.occurrences = state.occurrences.filter((item) => item.agentId !== agentId);
417
427
  state.conversations = state.conversations.filter((item) => item.agentId !== agentId);
418
428
  state.workingEnvironments = state.workingEnvironments.filter((item) => item.owner.agentId !== agentId);
419
429
  state.inbox = state.inbox.filter((item) => item.agentId !== agentId && !ids.has(item.conversationId ?? ""));
@@ -505,6 +515,34 @@ var FileFoundryDataAdapter = class {
505
515
  listEvents() {
506
516
  return effect(async () => structuredClone((await this.snapshot()).events));
507
517
  }
518
+ claimScheduleOccurrence(occurrence) {
519
+ return effect(async () => {
520
+ assertScheduleOccurrence(occurrence);
521
+ await this.ensureInitialized();
522
+ return this.mutate((state) => {
523
+ if (state.occurrences.some((item) => item.id === occurrence.id)) return false;
524
+ state.occurrences.push(structuredClone(occurrence));
525
+ return true;
526
+ });
527
+ });
528
+ }
529
+ putScheduleOccurrence(occurrence) {
530
+ return effect(async () => {
531
+ assertScheduleOccurrence(occurrence);
532
+ await this.ensureInitialized();
533
+ await this.mutate((state) => {
534
+ replaceById(state.occurrences, occurrence);
535
+ const drop = new Set(prunableOccurrences(state.occurrences, occurrence.activationId));
536
+ if (drop.size) state.occurrences = state.occurrences.filter((item) => !drop.has(item.id));
537
+ });
538
+ });
539
+ }
540
+ getScheduleOccurrence(id) {
541
+ return effect(async () => structuredClone((await this.snapshot()).occurrences.find((item) => item.id === id) ?? null));
542
+ }
543
+ listScheduleOccurrences(filter) {
544
+ return effect(async () => structuredClone((await this.snapshot()).occurrences.filter((item) => matchesOccurrenceFilter(item, filter)).sort(compareOccurrences)));
545
+ }
508
546
  putPendingInbound(record) {
509
547
  return effect(async () => {
510
548
  await this.ensureInitialized();
@@ -912,6 +950,7 @@ export {
912
950
  TopologyConflict,
913
951
  TopologyStore,
914
952
  TransmissionId,
953
+ activationScheduleRevision,
915
954
  compileApplicationManifest,
916
955
  composeAgent,
917
956
  composePlaybook,
@@ -991,6 +1030,8 @@ export {
991
1030
  restrictApp,
992
1031
  routeFromAgentFile,
993
1032
  routeFromInternalAgentName,
1033
+ scheduleOccurrenceId,
1034
+ scheduleRevisionMatches,
994
1035
  serializeInboundTransmissionXml,
995
1036
  toGloveMessage,
996
1037
  toGloveRequestInput,
package/dist/voice.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { IGloveRunnable } from 'glove-core';
2
2
  import { RealtimeAgent, RealtimeAgentConfig } from 'glove-voice-s2s';
3
- import { A as AgentHandlerContext, F as FoundryDelegationUpdate, a as FoundryMeshMessage } from './event-delivery-CNCsVqi8.js';
3
+ import { A as AgentHandlerContext, F as FoundryDelegationUpdate, a as FoundryMeshMessage } from './event-delivery-C7rYiNPs.js';
4
4
  import 'effect';
5
5
  import 'zod';
6
6
  import 'glove-mesh';
@@ -173,6 +173,24 @@ The controller owns wake/defer deadlines and conversation admission. A live proc
173
173
 
174
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
175
 
176
+ ## Schedule occurrences
177
+
178
+ The controller owns every timer: one-shot schedules, sleeps and recurring schedules. Station's scheduler is not used, so no schedule state lives in the execution daemon. An activation persists `nextOccurrenceAt`, the scheduled time of the next occurrence it owes, together with `scheduleRevision`, a hash of the configuration that cursor belongs to (target, message, payload, timing). Status and timestamp writes never change the revision, and neither does the order a store returns object keys in: the hash is taken over JSON with every object's keys sorted, so a PostgreSQL `jsonb` column is fine. A revision stored by 0.10.0, which hashed keys in stored order, still matches its configuration (with the timing keys in any order) and is kept as stored, so the ids of occurrences claimed under it do not change.
179
+
180
+ When the cursor comes due, under the activation lock, the controller:
181
+
182
+ 1. builds the occurrence: id `occurrence_<sha256(activationId, revision, scheduledFor)>`, the request with `source.occurrenceId` and `source.scheduledFor`, status `pending` (or `skipped` under `misfire: "skip"`);
183
+ 2. claims it with `claimScheduleOccurrence`, an insert-if-absent;
184
+ 3. only then writes the activation with the cursor moved to the next occurrence (journal first: a crash before this step fires the same id again, and the claim deduplicates it);
185
+ 4. admits it to the conversation gate like any other message and records `accepted` with the run id;
186
+ 5. when that run settles, records `completed`, `failed` or `cancelled`.
187
+
188
+ On startup the controller first hands over every `pending` or `accepted` occurrence whose activation is still active under the same revision (others become `cancelled` with reason `paused`, `cancelled` or `superseded`), then re-arms activations from their stored cursor. A crash after a run's side effect but before its outcome is stored delivers the occurrence again with the same id, so delivery is at least once and effects should key on `source.occurrenceId`. A run stopped by a clean shutdown is not an outcome either: the next start delivers its occurrence again.
189
+
190
+ Pause, cancel and update cancel the activation's `pending` occurrences under the same lock that fires them, so a stale configuration never fires after it was replaced; an `accepted` recurring run finishes, and a one-shot's run is cancelled with it. Resume starts the cursor again from now.
191
+
192
+ The bundled adapters keep every open occurrence and the latest 100 terminal ones per activation. A data adapter without the occurrence methods gets an in-memory journal: occurrences are visible while the process runs but a crash can lose one.
193
+
176
194
  ## Working environment and REPL boundary
177
195
 
178
196
  Foundry owns contextual selection, mounting, lifecycle, and observability. The native packages retain their own semantics:
@@ -758,7 +758,7 @@ glove_foundry_schedules({ action: "resume", activationId })
758
758
  glove_foundry_schedules({ action: "cancel", activationId })
759
759
  ```
760
760
 
761
- Schedules are agent-local composable values; Foundry has no root schedule registry or automatically discovered schedule files. Immediate spawning, future activation, recurrence, management, and suspension are separate runtime operations. Pausing disarms a trigger without losing its message, timing, payload, ownership, or definition provenance; edits made while paused remain paused until an explicit resume. Foundry stores activation state through `FoundryDataAdapter` before arming its private execution backend, so a durable adapter can reconstruct active work—and keep paused work disarmed—on startup. Sleep preserves the instance and conversation so the wake-up resumes with the same stored context.
761
+ Schedules are agent-local composable values; Foundry has no root schedule registry or automatically discovered schedule files. Immediate spawning, future activation, recurrence, management, and suspension are separate runtime operations. Pausing disarms a trigger without losing its message, timing, payload, ownership, or definition provenance; edits made while paused remain paused until an explicit resume. Foundry stores activation state through `FoundryDataAdapter` before arming it, so a durable adapter can reconstruct active work—and keep paused work disarmed—on startup. Each due occurrence is stored before the activation's cursor moves past it, so a crash between coming due and running never loses it; see [schedule occurrences](./architecture.md#schedule-occurrences). Sleep preserves the instance and conversation so the wake-up resumes with the same stored context.
762
762
 
763
763
  Schedule management reloads the owning instance's persisted activations on each
764
764
  tool call and overlays the current run's pending commands. A recurring run can
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glove-foundry",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "description": "An Effect-native, file-routed framework for typed, observable Glove agent applications",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -77,16 +77,16 @@
77
77
  "station-client": "^3.0.0",
78
78
  "station-beacon": "^3.0.0",
79
79
  "station-broadcast": "^3.0.0",
80
- "glove-lisp": "0.5.7",
81
- "glove-core": "4.8.0",
82
80
  "glove-facts": "0.1.9",
83
- "glove-js": "0.5.7",
84
- "glove-mcp": "1.2.7",
85
81
  "glove-memory": "2.3.4",
82
+ "glove-lisp": "0.5.7",
86
83
  "glove-mesh": "0.2.4",
84
+ "glove-python": "0.4.7",
87
85
  "glove-working-environment": "0.7.0",
86
+ "glove-js": "0.5.7",
87
+ "glove-mcp": "1.2.7",
88
88
  "glove-voice-s2s": "0.4.7",
89
- "glove-python": "0.4.7"
89
+ "glove-core": "4.8.0"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@modelcontextprotocol/sdk": "^1.29.0",