letagents 0.12.13 → 0.12.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +32 -0
  2. package/dist/mcp/local-state/agent-sessions.js +18 -3
  3. package/dist/mcp/local-state/local-chat.js +11 -27
  4. package/dist/mcp/local-state/storage.js +5 -1
  5. package/dist/mcp/server/register-tools.js +4 -1
  6. package/dist/mcp/server/runtime/agent-sessions.js +2 -2
  7. package/dist/mcp/server/runtime/api.js +5 -1
  8. package/dist/mcp/server/runtime/execution-profile.js +1 -0
  9. package/dist/mcp/server/runtime/identity.js +5 -0
  10. package/dist/mcp/server/runtime/presence.js +3 -3
  11. package/dist/mcp/server/runtime/room-api.js +5 -4
  12. package/dist/mcp/server/runtime/room-state.js +6 -6
  13. package/dist/mcp/server/runtime/rooms.js +3 -3
  14. package/dist/mcp/server/runtime/supervisor-bridge.js +80 -3
  15. package/dist/mcp/server/runtime/tool-surface-policy.js +7 -0
  16. package/dist/mcp/server/runtime/worker-bearer.js +12 -1
  17. package/dist/mcp/server/runtime/worker-handles.js +190 -0
  18. package/dist/mcp/server/runtime-contract.js +1 -0
  19. package/dist/mcp/server/runtime.js +3 -3
  20. package/dist/mcp/server/supervised-tool-facade.js +74 -2
  21. package/dist/mcp/server/tools/agent-sessions.js +22 -5
  22. package/dist/mcp/server/tools/messages/read-tool.js +6 -2
  23. package/dist/mcp/server/tools/messages/wait-tool.js +22 -10
  24. package/dist/mcp/server/tools/onboarding/name-tool.js +5 -2
  25. package/dist/mcp/server/worker-tool-facade.js +38 -0
  26. package/dist/mcp/worker-call-context.js +39 -0
  27. package/dist/shared/activation-routing.js +21 -4
  28. package/dist/shared/mcp-worker.js +7 -0
  29. package/dist/shared/room-agent-prompts.js +2 -2
  30. package/package.json +3 -3
  31. package/shared/execution-approval-projection.d.mts +32 -0
  32. package/shared/execution-approval-projection.mjs +107 -0
  33. package/shared/execution-approval-publication-item.d.mts +20 -0
  34. package/shared/execution-approval-publication-item.mjs +61 -0
  35. package/shared/execution-approval-publication.d.mts +53 -0
  36. package/shared/execution-approval-publication.mjs +136 -0
  37. package/shared/execution-delegation-decision.d.mts +37 -0
  38. package/shared/execution-delegation-decision.mjs +73 -0
  39. package/shared/room-agent-work.d.mts +31 -0
  40. package/shared/room-agent-work.mjs +44 -0
  41. package/shared/room-resource-invalidation.d.mts +38 -0
  42. package/shared/room-resource-invalidation.mjs +50 -0
@@ -0,0 +1,38 @@
1
+ export const ROOM_RESOURCE_INVALIDATION_CAPABILITY: "resource_invalidation_v1";
2
+ export const ROOM_RESOURCE_AGENT_WORK: "agent_work";
3
+ /** Content-free approval-state hint; consumers repair through separately authorized exact reads. */
4
+ export const ROOM_RESOURCE_AGENT_APPROVAL: "agent_approval";
5
+ export const ROOM_RESOURCE_EXECUTION_DELEGATION: "execution_delegation";
6
+ /** Protocol-known references; consumers independently choose what they render. */
7
+ export const ROOM_RESOURCE_INVALIDATION_RESOURCES: readonly [
8
+ "agent_work",
9
+ "agent_approval",
10
+ "execution_delegation",
11
+ ];
12
+
13
+ export type RoomResourceInvalidationResource =
14
+ typeof ROOM_RESOURCE_INVALIDATION_RESOURCES[number];
15
+
16
+ export type RoomResourceInvalidationPointer<Resource extends string = string> = {
17
+ room_id: string;
18
+ resource: Resource;
19
+ };
20
+
21
+ export type RoomResourceInvalidationParseResult =
22
+ | {
23
+ status: "supported";
24
+ pointer: RoomResourceInvalidationPointer<RoomResourceInvalidationResource>;
25
+ }
26
+ | {
27
+ status: "unsupported";
28
+ pointer: RoomResourceInvalidationPointer;
29
+ }
30
+ | { status: "malformed" };
31
+
32
+ /**
33
+ * Parse a bounded room-resource pointer without echoing malformed input.
34
+ * Unknown but well-formed resources remain forward-compatible cursor no-ops.
35
+ */
36
+ export function parseRoomResourceInvalidation(
37
+ value: unknown,
38
+ ): RoomResourceInvalidationParseResult;
@@ -0,0 +1,50 @@
1
+ export const ROOM_RESOURCE_INVALIDATION_CAPABILITY = "resource_invalidation_v1";
2
+ export const ROOM_RESOURCE_AGENT_WORK = "agent_work";
3
+ // Content-free hint emitted when an approval projection is published or its
4
+ // decision-relevant room state changes. Consumers repair through separately
5
+ // authorized exact reads; the pointer never carries approval content.
6
+ export const ROOM_RESOURCE_AGENT_APPROVAL = "agent_approval";
7
+ export const ROOM_RESOURCE_EXECUTION_DELEGATION = "execution_delegation";
8
+ // Protocol-known references. Each consumer still decides which surfaces, if
9
+ // any, react to a supported pointer.
10
+ export const ROOM_RESOURCE_INVALIDATION_RESOURCES = [
11
+ ROOM_RESOURCE_AGENT_WORK,
12
+ ROOM_RESOURCE_AGENT_APPROVAL,
13
+ ROOM_RESOURCE_EXECUTION_DELEGATION,
14
+ ];
15
+
16
+ function exactKeys(value, keys) {
17
+ return !!value && typeof value === "object" && !Array.isArray(value)
18
+ && Object.keys(value).length === keys.length
19
+ && keys.every((key) => Object.hasOwn(value, key));
20
+ }
21
+
22
+ function isValidRoomIdentifier(value) {
23
+ return typeof value === "string"
24
+ && value.length > 0
25
+ && value.length <= 512
26
+ && value.trim() === value
27
+ && !/[\u0000-\u001f\u007f]/.test(value);
28
+ }
29
+
30
+ function isValidResource(value) {
31
+ return typeof value === "string"
32
+ && /^[a-z0-9][a-z0-9._-]{0,63}$/.test(value);
33
+ }
34
+
35
+ /**
36
+ * Parse a bounded room-resource pointer without echoing malformed input.
37
+ * Unknown but well-formed resources remain forward-compatible cursor no-ops.
38
+ */
39
+ export function parseRoomResourceInvalidation(value) {
40
+ if (
41
+ !exactKeys(value, ["room_id", "resource"])
42
+ || !isValidRoomIdentifier(value.room_id)
43
+ || !isValidResource(value.resource)
44
+ ) return { status: "malformed" };
45
+
46
+ const pointer = { room_id: value.room_id, resource: value.resource };
47
+ return ROOM_RESOURCE_INVALIDATION_RESOURCES.includes(value.resource)
48
+ ? { status: "supported", pointer }
49
+ : { status: "unsupported", pointer };
50
+ }