glove-foundry 0.10.1 → 0.12.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-L72FKI7P.js → chunk-DAYYZPVE.js} +620 -57
- package/dist/{chunk-X3HZYVZS.js → chunk-SEP6QFRK.js} +1 -1
- package/dist/{chunk-VLD3DKPI.js → chunk-UGYXSWPE.js} +131 -1
- package/dist/{chunk-CYOIHSUX.js → chunk-WK2O4GIB.js} +6 -0
- package/dist/{chunk-J6NHL4SM.js → chunk-WRGSTYBW.js} +121 -8
- package/dist/cli.js +4 -4
- package/dist/{client-HM2x2-Ut.d.ts → client-Dy6_aqsi.d.ts} +93 -5
- package/dist/client.d.ts +2 -2
- package/dist/{event-delivery-C7rYiNPs.d.ts → event-delivery-CWxarW6L.d.ts} +646 -293
- package/dist/execution-agent.js +1 -1
- package/dist/execution-daemon.js +1 -1
- package/dist/execution-loader.js +132 -14
- package/dist/index.d.ts +9 -5
- package/dist/index.js +50 -5
- package/dist/voice.d.ts +81 -3
- package/dist/voice.js +323 -21
- package/docs/architecture.md +8 -0
- package/docs/building-with-foundry.md +1 -0
- package/package.json +6 -6
package/dist/execution-agent.js
CHANGED
package/dist/execution-daemon.js
CHANGED
package/dist/execution-loader.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mountFoundryGuidance,
|
|
3
3
|
mountFoundryWorkbench
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SEP6QFRK.js";
|
|
5
5
|
import {
|
|
6
6
|
EMPTY_FOUNDRY_APPLICATION,
|
|
7
7
|
FOUNDRY_APPROVAL_DIRECTORY_ENV,
|
|
8
8
|
FOUNDRY_APPROVAL_POLICY_ENV,
|
|
9
|
+
FOUNDRY_BUILTINS_MOUNTED_EVENT,
|
|
9
10
|
FOUNDRY_COMPOSED_PLAYBOOK_BRAND,
|
|
10
11
|
FOUNDRY_CORE_COMMAND_EVENT,
|
|
11
12
|
FOUNDRY_MODEL_REQUESTS_ENV,
|
|
@@ -15,12 +16,14 @@ import {
|
|
|
15
16
|
agentScheduleActivationId,
|
|
16
17
|
agentScheduleRevision,
|
|
17
18
|
bindAgentLocalDefinitions,
|
|
19
|
+
builtinAllowed,
|
|
18
20
|
composedPlaybookRevision,
|
|
19
21
|
createFoundryCoreTools,
|
|
20
22
|
createInstalledApplicationTransmissionTools,
|
|
21
23
|
discoverAgents,
|
|
22
24
|
freezeGloveMessage,
|
|
23
25
|
isFoundryApplication,
|
|
26
|
+
isFoundryBuiltin,
|
|
24
27
|
isFoundrySchedule,
|
|
25
28
|
materializeComposedPlaybook,
|
|
26
29
|
normalizeScheduleTiming,
|
|
@@ -30,7 +33,7 @@ import {
|
|
|
30
33
|
toGloveMessage,
|
|
31
34
|
toGloveRequestInput,
|
|
32
35
|
withFoundryPermissions
|
|
33
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-UGYXSWPE.js";
|
|
34
37
|
import {
|
|
35
38
|
FOUNDRY_CONVERSATION_LEASE_EVENT,
|
|
36
39
|
FOUNDRY_CONVERSATION_LISTEN_EVENT,
|
|
@@ -41,10 +44,12 @@ import {
|
|
|
41
44
|
createWorkerTools,
|
|
42
45
|
delegationFromContext,
|
|
43
46
|
deliveryEvent,
|
|
47
|
+
deliveryOf,
|
|
44
48
|
formatRunEvents,
|
|
45
49
|
isDelegationUpdate,
|
|
46
50
|
isOpenDelegation,
|
|
47
51
|
isOpenThread,
|
|
52
|
+
isTakenOverBy,
|
|
48
53
|
normalizeDelegates,
|
|
49
54
|
openRunMailbox,
|
|
50
55
|
renderDeliveries,
|
|
@@ -53,7 +58,7 @@ import {
|
|
|
53
58
|
renderOwnThread,
|
|
54
59
|
threadFromContext,
|
|
55
60
|
waitForConversationLease
|
|
56
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-WRGSTYBW.js";
|
|
57
62
|
import {
|
|
58
63
|
EMPTY_CAPABILITY_REGISTRY,
|
|
59
64
|
FOUNDRY_APPLICATION_ENV,
|
|
@@ -67,6 +72,7 @@ import {
|
|
|
67
72
|
hostedMeshOptions,
|
|
68
73
|
installRegistry,
|
|
69
74
|
internalAgentName,
|
|
75
|
+
isGenericDelivery,
|
|
70
76
|
isInboxCapableStore,
|
|
71
77
|
isMeshTransport,
|
|
72
78
|
mountAgentDefinitionMemory,
|
|
@@ -74,7 +80,7 @@ import {
|
|
|
74
80
|
refreshDurableAuthority,
|
|
75
81
|
resolveResolvable,
|
|
76
82
|
waitForFoundryCoreCommandResult
|
|
77
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-WK2O4GIB.js";
|
|
78
84
|
|
|
79
85
|
// src/execution-loader.ts
|
|
80
86
|
import { dirname } from "node:path";
|
|
@@ -410,7 +416,35 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
410
416
|
resolveOptional("compactionInstructions", definition.compactionInstructions, "Preserve goals, decisions, unresolved work, tool results, and pending inbox items."),
|
|
411
417
|
resolveOptional("maxTurns", definition.maxTurns, void 0)
|
|
412
418
|
]);
|
|
413
|
-
const
|
|
419
|
+
const withheld = /* @__PURE__ */ new Map();
|
|
420
|
+
const prepareEvent = definition.prepareEvent;
|
|
421
|
+
const eventQueue = new RunEventQueue(prepareEvent ? {
|
|
422
|
+
applies: (delivery) => isGenericDelivery(delivery) && !approvalDecisionOf(delivery),
|
|
423
|
+
prepare: async (event, delivery) => {
|
|
424
|
+
const prepared = await prepareEvent(delivery.durable?.event ?? event, {
|
|
425
|
+
runId,
|
|
426
|
+
definitionId: id,
|
|
427
|
+
agentId: request.agentId,
|
|
428
|
+
conversationId: request.conversationId,
|
|
429
|
+
workspaceId: request.workspaceId,
|
|
430
|
+
eventRecordId: delivery.durable?.id ?? event.id,
|
|
431
|
+
signal: abortController.signal
|
|
432
|
+
});
|
|
433
|
+
withheld.delete(event.id);
|
|
434
|
+
return prepared;
|
|
435
|
+
},
|
|
436
|
+
suppressed: (delivery, reason) => {
|
|
437
|
+
const event = deliveryEvent(delivery);
|
|
438
|
+
forwarded.delete(event.id);
|
|
439
|
+
consumed([delivery]);
|
|
440
|
+
controls.emit({ type: "foundry.event.suppressed", data: { id: delivery.durable?.id ?? event.id, reason } });
|
|
441
|
+
},
|
|
442
|
+
failed: (event, cause) => {
|
|
443
|
+
const delivery = deliveryOf(event);
|
|
444
|
+
if (delivery?.durable) withheld.set(event.id, delivery.durable.id);
|
|
445
|
+
controls.emit({ type: "foundry.event.prepare.failed", data: { id: event.id, message: cause instanceof Error ? cause.message : String(cause) } });
|
|
446
|
+
}
|
|
447
|
+
} : void 0);
|
|
414
448
|
const base = new Glove({
|
|
415
449
|
...runtimeStore ? { store: runtimeStore } : {},
|
|
416
450
|
events: { queue: eventQueue, policy: () => "defer", deferTimeoutMs: Infinity, formatter: formatRunEvents },
|
|
@@ -521,10 +555,18 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
521
555
|
data: { count: desiredSchedules.length, names: desiredSchedules.map((item) => item.name) }
|
|
522
556
|
});
|
|
523
557
|
const effectiveInstallations = [...installations];
|
|
558
|
+
const builtinsPolicy = await resolveOptional("builtins", definition.builtins, void 0);
|
|
559
|
+
const builtinOn = builtinAllowed(builtinsPolicy);
|
|
560
|
+
const mountedBuiltins = [];
|
|
561
|
+
const foldBuiltin = (tool) => {
|
|
562
|
+
if (!builtinOn(tool.name)) return;
|
|
563
|
+
if (isFoundryBuiltin(tool.name)) mountedBuiltins.push(tool.name);
|
|
564
|
+
base.fold(tool);
|
|
565
|
+
};
|
|
524
566
|
for (const tool of createFoundryCoreTools(assemblyContext, desiredSchedules, {
|
|
525
567
|
playbooks: desiredPlaybooks,
|
|
526
568
|
applications: registry.capabilities.applications
|
|
527
|
-
}))
|
|
569
|
+
})) foldBuiltin(tool);
|
|
528
570
|
assembly.mark("foundry-core", "Foundry core tools");
|
|
529
571
|
const applicationTransmissionTools = createInstalledApplicationTransmissionTools(
|
|
530
572
|
assemblyContext,
|
|
@@ -558,6 +600,13 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
558
600
|
const consumed = (deliveries) => {
|
|
559
601
|
for (const delivery of deliveries) if (delivery.durable) consumedEventIds.add(delivery.durable.id);
|
|
560
602
|
};
|
|
603
|
+
const heldEvents = /* @__PURE__ */ new Map();
|
|
604
|
+
const routedInitial = /* @__PURE__ */ new Set();
|
|
605
|
+
const eventCalls = /* @__PURE__ */ new Set();
|
|
606
|
+
let initialForwarded = false;
|
|
607
|
+
const settleEventCalls = async () => {
|
|
608
|
+
while (eventCalls.size) await Promise.allSettled([...eventCalls]);
|
|
609
|
+
};
|
|
561
610
|
let eventRecipient;
|
|
562
611
|
const bufferedDeliveries = initialDeliveries.length ? [] : [...envelope.events ?? []];
|
|
563
612
|
const forwardDeliveries = async (deliveries) => {
|
|
@@ -591,6 +640,14 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
591
640
|
async forward(deliveries) {
|
|
592
641
|
await forwardDeliveries(deliveries);
|
|
593
642
|
},
|
|
643
|
+
async release() {
|
|
644
|
+
await settleEventCalls();
|
|
645
|
+
const back = [...heldEvents].filter(([, held]) => !held.initial);
|
|
646
|
+
for (const [id2] of back) heldEvents.delete(id2);
|
|
647
|
+
const retrying = new Set(withheld.keys());
|
|
648
|
+
const unread = await this.reclaim(() => true);
|
|
649
|
+
return [...back.map(([, held]) => held.delivery), ...unread.filter((delivery) => !retrying.has(deliveryEvent(delivery).id))];
|
|
650
|
+
},
|
|
594
651
|
async reclaim(match) {
|
|
595
652
|
const buffered = bufferedDeliveries.filter(match);
|
|
596
653
|
for (let i = bufferedDeliveries.length - 1; i >= 0; i--) if (match(bufferedDeliveries[i])) bufferedDeliveries.splice(i, 1);
|
|
@@ -643,7 +700,7 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
643
700
|
...delegates,
|
|
644
701
|
...durableNames.filter((name) => !delegates.some((item) => (typeof item === "string" ? item : item.agent) === name)).map((name) => ({ agent: name, description: definition.durableSubagents[name].description ?? `Persistent ${name} worker.` }))
|
|
645
702
|
]);
|
|
646
|
-
if (durableNames.length || envelope.agent.durableSubagent)
|
|
703
|
+
if (durableNames.length || envelope.agent.durableSubagent) foldBuiltin(createAgentMessagingTool(assemblyContext, durableNames, Boolean(envelope.agent.durableSubagent)));
|
|
647
704
|
const onReplied = (delegationId) => {
|
|
648
705
|
heard.set(delegationId, "replied");
|
|
649
706
|
};
|
|
@@ -660,7 +717,7 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
660
717
|
createdAt: now,
|
|
661
718
|
updatedAt: now
|
|
662
719
|
});
|
|
663
|
-
}, onReplied))
|
|
720
|
+
}, onReplied)) foldBuiltin(tool);
|
|
664
721
|
if (normalizedDelegates.length > 0 || assemblyContext.delegations.length > 0) {
|
|
665
722
|
base.addContextProvider(
|
|
666
723
|
() => renderOpenDelegations(
|
|
@@ -685,7 +742,7 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
685
742
|
answerWaitMs,
|
|
686
743
|
pending: pendingQuestion,
|
|
687
744
|
waitForReply
|
|
688
|
-
}))
|
|
745
|
+
})) foldBuiltin(tool);
|
|
689
746
|
}
|
|
690
747
|
const coreCommandDirectory = process.env[FOUNDRY_CORE_COMMAND_DIRECTORY_ENV];
|
|
691
748
|
const emitMeshCommand = (command) => {
|
|
@@ -714,7 +771,7 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
714
771
|
const ownThread = assemblyContext.thread;
|
|
715
772
|
const hostedMesh = hostedMeshOptions(definition.mesh);
|
|
716
773
|
if (ownDelegation || normalizedDelegates.length || durableNames.length) assembly.mark("delegation", "Delegation");
|
|
717
|
-
const meshHosted = Boolean(hostedMesh && (hostedMesh.mount?.(assemblyContext) ?? true));
|
|
774
|
+
const meshHosted = Boolean(hostedMesh && (hostedMesh.mount?.(assemblyContext) ?? true)) && !(ownThread && isTakenOverBy(ownThread, request.agentId));
|
|
718
775
|
if (hostedMesh && meshHosted) {
|
|
719
776
|
for (const tool of createMeshTools({
|
|
720
777
|
definitionId: id,
|
|
@@ -725,13 +782,19 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
725
782
|
call: callMesh,
|
|
726
783
|
waitFrom,
|
|
727
784
|
pending: pendingReply
|
|
728
|
-
}))
|
|
785
|
+
})) foldBuiltin(tool);
|
|
729
786
|
controls.emit({
|
|
730
787
|
type: "foundry.mesh.mounted",
|
|
731
788
|
data: { open: assemblyContext.threads.length, thread: ownThread?.id ?? null }
|
|
732
789
|
});
|
|
733
790
|
assembly.mark("mesh", "Hosted mesh");
|
|
734
791
|
}
|
|
792
|
+
if (builtinsPolicy !== void 0) {
|
|
793
|
+
controls.emit({
|
|
794
|
+
type: FOUNDRY_BUILTINS_MOUNTED_EVENT,
|
|
795
|
+
data: { tools: mountedBuiltins, transmissionTools: applicationTransmissionTools.map((tool) => tool.name) }
|
|
796
|
+
});
|
|
797
|
+
}
|
|
735
798
|
if (hostedMesh || assemblyContext.threads.length > 0 || ownThread) {
|
|
736
799
|
base.addContextProvider(() => [
|
|
737
800
|
ownThread ? renderOwnThread(ownThread) : null,
|
|
@@ -813,6 +876,57 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
813
876
|
const stop = mailbox().onMesh(handler);
|
|
814
877
|
cleanups.push(stop);
|
|
815
878
|
return stop;
|
|
879
|
+
},
|
|
880
|
+
eventTurn: envelope.eventTurn ?? false,
|
|
881
|
+
onEvent: (handler, match) => {
|
|
882
|
+
const senderEvent = (delivery) => delivery.durable?.event ?? deliveryEvent(delivery);
|
|
883
|
+
const accepts = (delivery) => isGenericDelivery(delivery) && !approvalDecisionOf(delivery) && (!match || match(senderEvent(delivery)));
|
|
884
|
+
const calls2 = /* @__PURE__ */ new Set();
|
|
885
|
+
let stopped = false;
|
|
886
|
+
const take = (delivery, initial) => {
|
|
887
|
+
const event = senderEvent(delivery);
|
|
888
|
+
const id2 = delivery.durable?.id ?? event.id;
|
|
889
|
+
if (stopped || heldEvents.has(id2)) return;
|
|
890
|
+
heldEvents.set(id2, { delivery, initial });
|
|
891
|
+
const handled = {
|
|
892
|
+
id: id2,
|
|
893
|
+
event,
|
|
894
|
+
initial,
|
|
895
|
+
ack: () => {
|
|
896
|
+
if (heldEvents.delete(id2)) consumed([delivery]);
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
const call = Promise.resolve().then(() => handler(handled)).catch((cause) => {
|
|
900
|
+
controls.emit({ type: "foundry.event.handler.error", data: { id: id2, message: cause instanceof Error ? cause.message : String(cause) } });
|
|
901
|
+
});
|
|
902
|
+
calls2.add(call);
|
|
903
|
+
eventCalls.add(call);
|
|
904
|
+
void call.finally(() => {
|
|
905
|
+
calls2.delete(call);
|
|
906
|
+
eventCalls.delete(call);
|
|
907
|
+
});
|
|
908
|
+
};
|
|
909
|
+
if (!initialForwarded) {
|
|
910
|
+
for (const delivery of initialDeliveries) {
|
|
911
|
+
if (routedInitial.has(delivery) || !accepts(delivery)) continue;
|
|
912
|
+
routedInitial.add(delivery);
|
|
913
|
+
take(delivery, true);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
const stopMailbox = mailbox().onEvents(accepts, async (delivery) => {
|
|
917
|
+
take(delivery, false);
|
|
918
|
+
});
|
|
919
|
+
const stop = async () => {
|
|
920
|
+
if (stopped) {
|
|
921
|
+
while (calls2.size) await Promise.allSettled([...calls2]);
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
stopped = true;
|
|
925
|
+
await stopMailbox();
|
|
926
|
+
while (calls2.size) await Promise.allSettled([...calls2]);
|
|
927
|
+
};
|
|
928
|
+
cleanups.push(stop);
|
|
929
|
+
return stop;
|
|
816
930
|
}
|
|
817
931
|
};
|
|
818
932
|
for (const call of calls) {
|
|
@@ -992,6 +1106,7 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
992
1106
|
const defaultRun = async (messageInput = assemblyContext.messageInput) => {
|
|
993
1107
|
if (initialEventsPending && messageInput === assemblyContext.messageInput) {
|
|
994
1108
|
initialEventsPending = false;
|
|
1109
|
+
initialForwarded = true;
|
|
995
1110
|
const decisions = initialDeliveries.filter((delivery) => approvalDecisionOf(delivery));
|
|
996
1111
|
if (decisions.length && glove.resumeToolCalls) {
|
|
997
1112
|
for (const delivery of decisions) {
|
|
@@ -1006,13 +1121,13 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
1006
1121
|
});
|
|
1007
1122
|
if (done.length) {
|
|
1008
1123
|
consumed(done);
|
|
1009
|
-
const rest = initialDeliveries.filter((delivery) => !done.includes(delivery));
|
|
1124
|
+
const rest = initialDeliveries.filter((delivery) => !done.includes(delivery) && !routedInitial.has(delivery));
|
|
1010
1125
|
if (!rest.length) return resumed === void 0 ? null : extractOutput(resumed);
|
|
1011
1126
|
await forwardDeliveries(rest);
|
|
1012
1127
|
return extractOutput(await glove.processEvents(abortController.signal));
|
|
1013
1128
|
}
|
|
1014
1129
|
}
|
|
1015
|
-
await forwardDeliveries(initialDeliveries);
|
|
1130
|
+
await forwardDeliveries(initialDeliveries.filter((delivery) => !routedInitial.has(delivery)));
|
|
1016
1131
|
return extractOutput(await glove.processEvents(abortController.signal));
|
|
1017
1132
|
}
|
|
1018
1133
|
return extractOutput(await glove.processRequest(toGloveRequestInput(messageInput), abortController.signal));
|
|
@@ -1038,7 +1153,8 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
1038
1153
|
awaitingApproval = { approvalId: deferral.approvalId, toolName: String(deferral.toolName ?? "") };
|
|
1039
1154
|
result = `Waiting for approval to run ${awaitingApproval.toolName || "a tool"} (${awaitingApproval.approvalId}).`;
|
|
1040
1155
|
}
|
|
1041
|
-
|
|
1156
|
+
await settleEventCalls();
|
|
1157
|
+
if (initialEventsPending) consumed(initialDeliveries.filter((delivery) => !routedInitial.has(delivery)));
|
|
1042
1158
|
await guidance.snapshot();
|
|
1043
1159
|
const sleep = [...controls.commands].reverse().find(
|
|
1044
1160
|
(command) => command.type === "sleep"
|
|
@@ -1049,6 +1165,7 @@ async function executeDefinition(definition, id, runtimeValue) {
|
|
|
1049
1165
|
status: sleep || question || waiting || awaitingApproval ? "suspended" : "completed",
|
|
1050
1166
|
value: serializable(result),
|
|
1051
1167
|
...consumedEventIds.size ? { consumedEventIds: [...consumedEventIds] } : {},
|
|
1168
|
+
...withheld.size ? { retryEventIds: [...new Set(withheld.values())].filter((recordId) => !consumedEventIds.has(recordId)) } : {},
|
|
1052
1169
|
agentId: request.agentId,
|
|
1053
1170
|
conversationId: request.conversationId,
|
|
1054
1171
|
workspaceId: request.workspaceId,
|
|
@@ -1211,6 +1328,7 @@ function compileAgentDefinition(definition, route) {
|
|
|
1211
1328
|
});
|
|
1212
1329
|
let builder = signal(internalAgentName(route)).input(executionEnvelope).output(z.object({
|
|
1213
1330
|
consumedEventIds: z.array(z.string()).readonly().optional(),
|
|
1331
|
+
retryEventIds: z.array(z.string()).readonly().optional(),
|
|
1214
1332
|
status: z.enum(["completed", "suspended"]),
|
|
1215
1333
|
value: z.unknown(),
|
|
1216
1334
|
agentId: z.string(),
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { d as FoundryDataAdapter, E as EnvironmentValue, e as AgentInstance, C as Conversation, P as PlaybookSubscription, f as FoundryActivationRecord, g as ProvisionAgentOptions, I as InboundDeliveryClaim, h as FoundryEventRecord, a as FoundryEventReceipt, i as FoundryEventReceiptFilter, j as FoundryScheduleOccurrence, k as FoundryScheduleOccurrenceFilter, l as FoundryPendingInbound, m as FoundryApproval, W as WorkspaceEntry, n as FoundryWorkingEnvironmentSnapshotOwner, S as SharedInboxItem, o as FoundryTask, p as AgentPlaybook, q as AnyFoundryTransmission, r as AccountReference, s as InferAccountMetadata, t as AgentBinding, u as FoundryAgentApplication, v as InboundRoute, O as OutboundRoute, w as CapabilityDefinition, x as InferInboundConfig, y as InferOutboundConfig } from './event-delivery-CWxarW6L.js';
|
|
2
|
+
export { z as AccountContract, B as AccountId, D as AccountNotFound, G as AccountSessionUnavailable, H as AccountSummary, J as AgentApplicationContribution, K as AgentApplicationInstallContext, L as AgentApplicationOptions, M as AgentAssemblyContext, N as AgentAssemblyOptions, Q as AgentDefinitionId, R as AgentDefinitionSurfaceContext, T as AgentFactoryContext, A as AgentHandlerContext, U as AgentId, V as AgentInstallContext, X as AgentInstallation, Y as AgentInstallationKind, Z as AgentMessageReceipt, _ as AgentPlaybookInput, $ as AgentProvisioningPolicy, a0 as AgentRuntimeControls, a1 as AnyFoundryAgent, a2 as AppRestrictions, a3 as ApplicationConnectionContext, a4 as ApplicationConnectionState, a5 as ApplicationConnectionStatus, a6 as BindingId, a7 as BindingNotFound, a8 as CapabilityId, a9 as ComposedAgentPlaybook, aa as ComposedAgentPlaybookInput, ab as ConnectionReceiveInput, ac as CreateAgentInstanceOptions, ad as CreateConversationOptions, ae as CustomProvisionedAgent, af as CustomProvisioningContext, ag as DEFAULT_APPROVAL_EXPIRES_AFTER_MS, ah as DEFAULT_APPROVAL_WAIT_MS, ai as DEFAULT_MESH_REFUSAL, aj as DefineAgentOptions, ak as DefineConnectionOptions, al as DefineFoundryReplOptions, am as DefineFoundryScheduleOptions, an as DefineFoundrySubagentOptions, ao as DefineFoundryWorkingEnvironmentOptions, ap as DefinePlaybookSubscriptionOptions, aq as DefinitionConfigInput, ar as DurableSubagentOptions, as as DurableSubagentOwnership, at as DurableSubagents, au as EMPTY_AGENT_COMPOSITION, av as EMPTY_CAPABILITY_REGISTRY, aw as EMPTY_NATIVE_REGISTRY, ax as EgressAdapter, ay as EgressContext, az as EventId, aA as EventNotFound, aB as EventReceiptStore, aC as EventReference, aD as FOUNDRY_AGENT_APPLICATION_BRAND, aE as FOUNDRY_AGENT_BRAND, aF as FOUNDRY_AGENT_DEFINITION_BRAND, aG as FOUNDRY_AGENT_FILE_ENV, aH as FOUNDRY_AGENT_ROUTE_ENV, aI as FOUNDRY_APPLICATION_ENV, aJ as FOUNDRY_APPROVAL_DIRECTORY_ENV, aK as FOUNDRY_BUILTIN_TOOLS, aL as FOUNDRY_COMPOSED_PLAYBOOK_BRAND, aM as FOUNDRY_CONNECTION_BRAND, aN as FOUNDRY_CORE_COMMAND_EVENT, aO as FOUNDRY_EVENT_PREFIX, aP as FOUNDRY_EXECUTION_MARKER, aQ as FOUNDRY_LAYER_BRAND, aR as FOUNDRY_MCP_BRAND, aS as FOUNDRY_MEMORY_BRAND, aT as FOUNDRY_PLAYBOOK_ACTION_BRAND, aU as FOUNDRY_REPL_BRAND, aV as FOUNDRY_SCHEDULE_BRAND, aW as FOUNDRY_SHARED_TOOL_BRAND, aX as FOUNDRY_SUBSCRIBER_BRAND, aY as FOUNDRY_TRANSMISSION_BRAND, aZ as FOUNDRY_TRANSMISSION_EVENT_BRAND, a_ as FOUNDRY_TRANSMISSION_PREDICATE_BRAND, a$ as FOUNDRY_WORKING_ENVIRONMENT_BRAND, b0 as FoundryAccountSessionAdapter, b1 as FoundryAgent, b2 as FoundryAgentComponent, b3 as FoundryAgentComposition, b4 as FoundryAgentConventionModule, b5 as FoundryAgentDefinition, b6 as FoundryAgentMode, b7 as FoundryApp, b8 as FoundryAppMcp, b9 as FoundryAppMcpTool, ba as FoundryAppToolDecision, bb as FoundryApplicationConnection, bc as FoundryApplicationMesh, bd as FoundryApprovalDecision, be as FoundryApprovalDisplayManager, bf as FoundryApprovalPolicy, bg as FoundryApprovalStatus, bh as FoundryBuiltinGroup, bi as FoundryBuiltinTool, bj as FoundryBuiltinsPolicy, bk as FoundryCall, bl as FoundryCallContext, bm as FoundryCallOptions, bn as FoundryCapabilityKind, bo as FoundryCapabilityManifest, bp as FoundryCapabilityManifestEntry, bq as FoundryCapabilityRegistry, br as FoundryCompositionSource, bs as FoundryContextProvider, bt as FoundryCoreCommand, bu as FoundryDelegate, bv as FoundryDelegateOptions, bw as FoundryDelegation, bx as FoundryDelegationReply, by as FoundryDelegationStatus, b as FoundryDelegationUpdate, bz as FoundryDomainError, bA as FoundryEventPolicy, F as FoundryEventPreparation, bB as FoundryEventPreparationContext, bC as FoundryEventReceiptStatus, bD as FoundryEventTarget, bE as FoundryExecutionContext, bF as FoundryFactsOptions, bG as FoundryFormsOptions, bH as FoundryGoalsOptions, bI as FoundryGuidanceHandles, bJ as FoundryGuidanceScope, bK as FoundryHandledEvent, bL as FoundryHookDefinition, bM as FoundryInstallable, bN as FoundryInstalledApp, bO as FoundryInstanceProvisioner, bP as FoundryJavaScriptReplDefinition, bQ as FoundryLayer, bR as FoundryLayerOptions, bS as FoundryLayerReference, bT as FoundryLayerSelection, bU as FoundryLispReplDefinition, bV as FoundryListResolver, bW as FoundryMcp, bX as FoundryMcpOptions, bY as FoundryMemoryProfile, bZ as FoundryMemoryProfileOptions, b_ as FoundryMemoryReference, b$ as FoundryMemorySelection, c0 as FoundryMeshConfig, c1 as FoundryMeshDecision, c2 as FoundryMeshHeldMessage, c3 as FoundryMeshHookContext, c as FoundryMeshMessage, c4 as FoundryMeshOptions, c5 as FoundryMeshOutgoing, c6 as FoundryMeshParty, c7 as FoundryMeshPeer, c8 as FoundryMeshRecordedMessage, c9 as FoundryMeshSend, ca as FoundryMeshThread, cb as FoundryMeshThreadStart, cc as FoundryMeshThreadStatus, cd as FoundryMessageInput, ce as FoundryMessageOptions, cf as FoundryMountedRepl, cg as FoundryNativeManifest, ch as FoundryNativeManifestEntry, ci as FoundryNativeRegistry, cj as FoundryPlaybookAction, ck as FoundryProgrammaticToolContext, cl as FoundryProgrammaticToolSelection, cm as FoundryProgrammaticTools, cn as FoundryPythonReplDefinition, co as FoundryReplApp, cp as FoundryReplDefinition, cq as FoundryRequest, cr as FoundryResolvedMcp, cs as FoundryResolver, ct as FoundryResult, cu as FoundryRouteMap, cv as FoundryScheduleDefinition, cw as FoundryScheduleMisfirePolicy, cx as FoundryScheduleOccurrenceStatus, cy as FoundryScheduleTiming, cz as FoundryScheduleTimingInput, cA as FoundrySharedTool, cB as FoundrySubagentToolContext, cC as FoundrySubscriber, cD as FoundrySubscriberOptions, cE as FoundrySubscriberSelection, cF as FoundrySurfaceContext, cG as FoundrySuspension, cH as FoundryToolBody, cI as FoundryTransmission, cJ as FoundryTransmissionDelivery, cK as FoundryTransmissionEvent, cL as FoundryTransmissionPredicate, cM as FoundryVfs, cN as FoundryVfsHandle, cO as FoundryWorkingEnvironmentCreateContext, cP as FoundryWorkingEnvironmentDefinition, cQ as FoundryWorkingEnvironmentPersistenceAdapter, cR as FoundryWorkingEnvironmentPersistenceContext, cS as GrantResolutionError, cT as InboundContract, cU as InferAgentInput, cV as InferAgentOutput, cW as InferInboundEvent, cX as InferOutboundInput, cY as InferOutboundOutput, cZ as IngressAdapter, c_ as IngressContext, c$ as InstallationSelection, d0 as McpAdapterFactory, d1 as MemoryFoundryDataAdapter, d2 as OutboundContract, d3 as PlaybookActionOptions, d4 as PlaybookDirective, d5 as PlaybookDirectiveInput, d6 as PlaybookMatch, d7 as PlaybookMatchInput, d8 as PlaybookOutboundDirective, d9 as PlaybookOutboundInput, da as PlaybookSubscriptionTarget, db as PlaybookSubscriptionTargetInput, dc as ReplyPolicy, dd as Route, de as RouteId, df as RouteNotFound, dg as RunGrant, dh as RunId, di as SharedToolOptions, dj as TopologyConflict, dk as TransmissionEventDirection, dl as TransmissionEventOptions, dm as TransmissionId, dn as TransmissionOptions, dp as TransmissionPredicateOptions, dq as TransmissionSerializationContext, dr as UpdateAgentInstanceOptions, ds as UpdateConversationOptions, dt as activationScheduleRevision, du as builtinAllowed, dv as composeAgent, dw as composePlaybook, dx as configureLayer, dy as configureMemory, dz as createAgentInstance, dA as createConversation, dB as createFoundryApproval, dC as createFoundryCoreTools, dD as createInstalledApplicationTransmissionTools, dE as defineAgent, dF as defineAgentApplication, dG as defineAgentFromModule, dH as defineAgentInstance, dI as defineApp, dJ as defineCall, dK as defineConnection, dL as defineFacts, dM as defineForms, dN as defineGoals, dO as defineLayer, dP as defineMcp, dQ as defineMemory, dR as definePlaybookAction, dS as definePlaybookSubscription, dT as defineRepl, dU as defineRoutes, dV as defineSchedule, dW as defineSharedTool, dX as defineSubagent, dY as defineSubscriber, dZ as defineTransmission, d_ as defineTransmissionEvent, d$ as defineTransmissionPredicate, e0 as defineWorkingEnvironment, e1 as eventReceiptStore, e2 as eventTranscriptMessageId, e3 as foundryDataEnvironmentPersistence, e4 as foundryGuidanceSubject, e5 as hostedMeshOptions, e6 as install, e7 as installRegistry, e8 as installationKey, e9 as installedApplicationTransmissionToolName, ea as internalAgentName, eb as isFoundryAgent, ec as isFoundryAgentDefinition, ed as isFoundryBuiltin, ee as isFoundryCapability, ef as isFoundryLayer, eg as isFoundrySchedule, eh as isFoundrySubscriber, ei as isFoundryTransmission, ej as isInboxCapableStore, ek as isMeshTransport, el as lateChatEffectId, em as listFoundryApprovals, en as meshIdentity, eo as mountAgentDefinitionMemory, ep as mountFoundrySurfaces, eq as reconstructAgentInstance, er as reconstructPlaybook, es as reconstructPlaybookSubscription, et as resolveFoundryApproval, eu as restrictApp, ev as routeFromInternalAgentName, ew as scheduleOccurrenceId, ex as scheduleRevisionMatches, ey as toGloveMessage, ez as toGloveRequestInput, eA as transmissionPredicate, eB as withFoundryPermissions } from './event-delivery-CWxarW6L.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-
|
|
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-
|
|
5
|
+
import { T as TopologyStore, F as FoundryRuntime, D as DiscoveredAgent, a as FoundryManifest } from './client-Dy6_aqsi.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-Dy6_aqsi.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
|
+
claimEventReceipt(receipt: FoundryEventReceipt): Effect.Effect<boolean, unknown, never>;
|
|
80
|
+
putEventReceipt(receipt: FoundryEventReceipt): Effect.Effect<void, unknown, never>;
|
|
81
|
+
getEventReceipt(id: string): Effect.Effect<FoundryEventReceipt | null, unknown, never>;
|
|
82
|
+
listEventReceipts(filter?: FoundryEventReceiptFilter): Effect.Effect<FoundryEventReceipt[], unknown, never>;
|
|
79
83
|
claimScheduleOccurrence(occurrence: FoundryScheduleOccurrence): Effect.Effect<boolean, unknown, never>;
|
|
80
84
|
putScheduleOccurrence(occurrence: FoundryScheduleOccurrence): Effect.Effect<void, unknown, never>;
|
|
81
85
|
getScheduleOccurrence(id: string): Effect.Effect<FoundryScheduleOccurrence | null, unknown, never>;
|
|
@@ -212,4 +216,4 @@ interface DefineBindingOptions extends Omit<AgentBinding, "id" | "agentId" | "tr
|
|
|
212
216
|
}
|
|
213
217
|
declare function defineBinding(options: DefineBindingOptions): AgentBinding;
|
|
214
218
|
|
|
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 };
|
|
219
|
+
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, FoundryEventReceipt, FoundryEventReceiptFilter, 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,7 +43,7 @@ import {
|
|
|
43
43
|
memoryTopologyStore,
|
|
44
44
|
serializeInboundTransmissionXml,
|
|
45
45
|
writeGeneratedTypes
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-DAYYZPVE.js";
|
|
47
47
|
import {
|
|
48
48
|
FoundryClient,
|
|
49
49
|
FoundryRunHandle,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
defineWorkingEnvironment,
|
|
64
64
|
foundryDataEnvironmentPersistence,
|
|
65
65
|
foundryGuidanceSubject
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-SEP6QFRK.js";
|
|
67
67
|
import {
|
|
68
68
|
DEFAULT_APPROVAL_EXPIRES_AFTER_MS,
|
|
69
69
|
DEFAULT_APPROVAL_WAIT_MS,
|
|
@@ -71,6 +71,7 @@ import {
|
|
|
71
71
|
EMPTY_FOUNDRY_APPLICATION,
|
|
72
72
|
FOUNDRY_APPLICATION_BRAND,
|
|
73
73
|
FOUNDRY_APPROVAL_DIRECTORY_ENV,
|
|
74
|
+
FOUNDRY_BUILTIN_TOOLS,
|
|
74
75
|
FOUNDRY_COMPOSED_PLAYBOOK_BRAND,
|
|
75
76
|
FOUNDRY_CONNECTION_BRAND,
|
|
76
77
|
FOUNDRY_CORE_COMMAND_EVENT,
|
|
@@ -83,6 +84,7 @@ import {
|
|
|
83
84
|
MemoryFoundryDataAdapter,
|
|
84
85
|
activationScheduleRevision,
|
|
85
86
|
assertScheduleOccurrence,
|
|
87
|
+
builtinAllowed,
|
|
86
88
|
compareOccurrences,
|
|
87
89
|
composeAgent,
|
|
88
90
|
composePlaybook,
|
|
@@ -105,6 +107,7 @@ import {
|
|
|
105
107
|
findAgentFiles,
|
|
106
108
|
installedApplicationTransmissionToolName,
|
|
107
109
|
isFoundryApplication,
|
|
110
|
+
isFoundryBuiltin,
|
|
108
111
|
isFoundrySchedule,
|
|
109
112
|
isFoundryTransmission,
|
|
110
113
|
listFoundryApprovals,
|
|
@@ -121,10 +124,16 @@ import {
|
|
|
121
124
|
toGloveRequestInput,
|
|
122
125
|
transmissionPredicate,
|
|
123
126
|
withFoundryPermissions
|
|
124
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-UGYXSWPE.js";
|
|
125
128
|
import {
|
|
129
|
+
DEFAULT_MESH_REFUSAL,
|
|
130
|
+
assertEventReceipt,
|
|
131
|
+
eventReceiptStore,
|
|
132
|
+
eventTranscriptMessageId,
|
|
133
|
+
lateChatEffectId,
|
|
134
|
+
matchesReceiptFilter,
|
|
126
135
|
meshIdentity
|
|
127
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-WRGSTYBW.js";
|
|
128
137
|
import {
|
|
129
138
|
EMPTY_CAPABILITY_REGISTRY,
|
|
130
139
|
EMPTY_NATIVE_REGISTRY,
|
|
@@ -171,7 +180,7 @@ import {
|
|
|
171
180
|
mountFoundrySurfaces,
|
|
172
181
|
restrictApp,
|
|
173
182
|
routeFromInternalAgentName
|
|
174
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-WK2O4GIB.js";
|
|
175
184
|
|
|
176
185
|
// src/file-data.ts
|
|
177
186
|
import { randomUUID } from "node:crypto";
|
|
@@ -189,6 +198,7 @@ function emptyState(environment) {
|
|
|
189
198
|
approvals: [],
|
|
190
199
|
activations: [],
|
|
191
200
|
occurrences: [],
|
|
201
|
+
receipts: [],
|
|
192
202
|
conversations: [],
|
|
193
203
|
workspaceEntries: [],
|
|
194
204
|
workingEnvironments: [],
|
|
@@ -299,6 +309,7 @@ var FileFoundryDataAdapter = class {
|
|
|
299
309
|
approvals: parsed.approvals ?? [],
|
|
300
310
|
activations: parsed.activations ?? [],
|
|
301
311
|
occurrences: parsed.occurrences ?? [],
|
|
312
|
+
receipts: parsed.receipts ?? [],
|
|
302
313
|
conversations: parsed.conversations ?? [],
|
|
303
314
|
workspaceEntries: parsed.workspaceEntries ?? [],
|
|
304
315
|
workingEnvironments: parsed.workingEnvironments ?? [],
|
|
@@ -424,6 +435,7 @@ var FileFoundryDataAdapter = class {
|
|
|
424
435
|
state.approvals = state.approvals.filter((item) => item.agentId !== agentId);
|
|
425
436
|
state.activations = state.activations.filter((item) => item.agentId !== agentId);
|
|
426
437
|
state.occurrences = state.occurrences.filter((item) => item.agentId !== agentId);
|
|
438
|
+
state.receipts = state.receipts.filter((item) => item.agentId !== agentId);
|
|
427
439
|
state.conversations = state.conversations.filter((item) => item.agentId !== agentId);
|
|
428
440
|
state.workingEnvironments = state.workingEnvironments.filter((item) => item.owner.agentId !== agentId);
|
|
429
441
|
state.inbox = state.inbox.filter((item) => item.agentId !== agentId && !ids.has(item.conversationId ?? ""));
|
|
@@ -515,6 +527,32 @@ var FileFoundryDataAdapter = class {
|
|
|
515
527
|
listEvents() {
|
|
516
528
|
return effect(async () => structuredClone((await this.snapshot()).events));
|
|
517
529
|
}
|
|
530
|
+
claimEventReceipt(receipt) {
|
|
531
|
+
return effect(async () => {
|
|
532
|
+
assertEventReceipt(receipt);
|
|
533
|
+
await this.ensureInitialized();
|
|
534
|
+
return this.mutate((state) => {
|
|
535
|
+
if (state.receipts.some((item) => item.id === receipt.id)) return false;
|
|
536
|
+
state.receipts.push(structuredClone(receipt));
|
|
537
|
+
return true;
|
|
538
|
+
});
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
putEventReceipt(receipt) {
|
|
542
|
+
return effect(async () => {
|
|
543
|
+
assertEventReceipt(receipt);
|
|
544
|
+
await this.ensureInitialized();
|
|
545
|
+
await this.mutate((state) => {
|
|
546
|
+
replaceById(state.receipts, receipt);
|
|
547
|
+
});
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
getEventReceipt(id) {
|
|
551
|
+
return effect(async () => structuredClone((await this.snapshot()).receipts.find((item) => item.id === id) ?? null));
|
|
552
|
+
}
|
|
553
|
+
listEventReceipts(filter) {
|
|
554
|
+
return effect(async () => structuredClone((await this.snapshot()).receipts.filter((item) => matchesReceiptFilter(item, filter))));
|
|
555
|
+
}
|
|
518
556
|
claimScheduleOccurrence(occurrence) {
|
|
519
557
|
return effect(async () => {
|
|
520
558
|
assertScheduleOccurrence(occurrence);
|
|
@@ -891,6 +929,7 @@ export {
|
|
|
891
929
|
CapabilityId,
|
|
892
930
|
DEFAULT_APPROVAL_EXPIRES_AFTER_MS,
|
|
893
931
|
DEFAULT_APPROVAL_WAIT_MS,
|
|
932
|
+
DEFAULT_MESH_REFUSAL,
|
|
894
933
|
EMPTY_AGENT_COMPOSITION,
|
|
895
934
|
EMPTY_CAPABILITY_REGISTRY,
|
|
896
935
|
EMPTY_FOUNDRY_APPLICATION,
|
|
@@ -907,6 +946,7 @@ export {
|
|
|
907
946
|
FOUNDRY_APPLICATION_BRAND,
|
|
908
947
|
FOUNDRY_APPLICATION_ENV,
|
|
909
948
|
FOUNDRY_APPROVAL_DIRECTORY_ENV,
|
|
949
|
+
FOUNDRY_BUILTIN_TOOLS,
|
|
910
950
|
FOUNDRY_COMPOSED_PLAYBOOK_BRAND,
|
|
911
951
|
FOUNDRY_CONNECTION_BRAND,
|
|
912
952
|
FOUNDRY_CORE_COMMAND_EVENT,
|
|
@@ -951,6 +991,7 @@ export {
|
|
|
951
991
|
TopologyStore,
|
|
952
992
|
TransmissionId,
|
|
953
993
|
activationScheduleRevision,
|
|
994
|
+
builtinAllowed,
|
|
954
995
|
compileApplicationManifest,
|
|
955
996
|
composeAgent,
|
|
956
997
|
composePlaybook,
|
|
@@ -995,6 +1036,8 @@ export {
|
|
|
995
1036
|
defineTransmissionPredicate,
|
|
996
1037
|
defineWorkingEnvironment,
|
|
997
1038
|
discoverAgents,
|
|
1039
|
+
eventReceiptStore,
|
|
1040
|
+
eventTranscriptMessageId,
|
|
998
1041
|
fileTopologyStore,
|
|
999
1042
|
findAgentFiles,
|
|
1000
1043
|
foundryDataEnvironmentPersistence,
|
|
@@ -1009,6 +1052,7 @@ export {
|
|
|
1009
1052
|
isFoundryAgent,
|
|
1010
1053
|
isFoundryAgentDefinition,
|
|
1011
1054
|
isFoundryApplication,
|
|
1055
|
+
isFoundryBuiltin,
|
|
1012
1056
|
isFoundryCapability,
|
|
1013
1057
|
isFoundryLayer,
|
|
1014
1058
|
isFoundrySchedule,
|
|
@@ -1016,6 +1060,7 @@ export {
|
|
|
1016
1060
|
isFoundryTransmission,
|
|
1017
1061
|
isInboxCapableStore,
|
|
1018
1062
|
isMeshTransport,
|
|
1063
|
+
lateChatEffectId,
|
|
1019
1064
|
listFoundryApprovals,
|
|
1020
1065
|
memoryAccountDirectory,
|
|
1021
1066
|
memoryEventStore,
|