@lobu/runtime-device 21.2.1 → 23.0.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.
Files changed (233) hide show
  1. package/dist/component.json +1 -1
  2. package/dist/dependencies.bun.lock +91 -83
  3. package/npm-shrinkwrap.json +492 -438
  4. package/package.json +12 -2
  5. package/vendor/cli/dist/bundled-skills/lobu/SKILL.md +1 -1
  6. package/vendor/cli/dist/commands/_lib/apply/apply-cmd.js +5 -6
  7. package/vendor/cli/dist/commands/_lib/apply/client.d.ts +1 -0
  8. package/vendor/cli/dist/commands/_lib/apply/client.js +26 -7
  9. package/vendor/cli/dist/commands/_lib/apply/desired-state.d.ts +9 -1
  10. package/vendor/cli/dist/commands/_lib/apply/diff.d.ts +1 -0
  11. package/vendor/cli/dist/commands/_lib/apply/diff.js +46 -4
  12. package/vendor/cli/dist/commands/_lib/apply/map-config.js +18 -38
  13. package/vendor/cli/dist/commands/_lib/init-from-org/bootstrap.js +5 -17
  14. package/vendor/cli/dist/commands/init.d.ts +0 -2
  15. package/vendor/cli/dist/commands/init.js +0 -27
  16. package/vendor/cli/dist/commands/login.d.ts +17 -0
  17. package/vendor/cli/dist/commands/login.js +43 -17
  18. package/vendor/cli/dist/commands/memory/_lib/errors.d.ts +0 -8
  19. package/vendor/cli/dist/commands/memory/_lib/errors.js +0 -12
  20. package/vendor/cli/dist/commands/memory/_lib/mcp.js +6 -6
  21. package/vendor/cli/dist/commands/memory/_lib/seed-cmd.js +4 -10
  22. package/vendor/cli/dist/config/define.d.ts +21 -15
  23. package/vendor/cli/dist/config/define.js +2 -2
  24. package/vendor/cli/dist/connectors/README.md +21 -6
  25. package/vendor/cli/dist/connectors/_google/actions.ts +270 -0
  26. package/vendor/cli/dist/connectors/_google/discovery/calendar_v3.json +1 -0
  27. package/vendor/cli/dist/connectors/_google/discovery/chat_v1.json +1 -0
  28. package/vendor/cli/dist/connectors/_google/discovery/docs_v1.json +1 -0
  29. package/vendor/cli/dist/connectors/_google/discovery/drive_v3.json +1 -0
  30. package/vendor/cli/dist/connectors/_google/discovery/gmail_v1.json +1 -0
  31. package/vendor/cli/dist/connectors/_google/discovery/people_v1.json +1 -0
  32. package/vendor/cli/dist/connectors/_google/discovery/sheets_v4.json +1 -0
  33. package/vendor/cli/dist/connectors/_google/discovery/tasks_v1.json +1 -0
  34. package/vendor/cli/dist/connectors/_google/discovery/youtube_v3.json +1 -0
  35. package/vendor/cli/dist/connectors/_google/discovery.ts +442 -0
  36. package/vendor/cli/dist/connectors/_google/errors.ts +91 -0
  37. package/vendor/cli/dist/connectors/_google/list-feed.ts +223 -0
  38. package/vendor/cli/dist/connectors/_google/policies.ts +127 -0
  39. package/vendor/cli/dist/connectors/agentid.ts +43 -0
  40. package/vendor/cli/dist/connectors/chat-user-identity.ts +2 -1
  41. package/vendor/cli/dist/connectors/github-automation-events.ts +9 -0
  42. package/vendor/cli/dist/connectors/github-identity.ts +28 -3
  43. package/vendor/cli/dist/connectors/github.ts +101 -59
  44. package/vendor/cli/dist/connectors/google_calendar.ts +207 -719
  45. package/vendor/cli/dist/connectors/google_drive.ts +16 -2
  46. package/vendor/cli/dist/connectors/google_gmail.ts +52 -33
  47. package/vendor/cli/dist/connectors/herdr.ts +406 -0
  48. package/vendor/cli/dist/connectors/jira-helpers.ts +313 -0
  49. package/vendor/cli/dist/connectors/jira.ts +35 -227
  50. package/vendor/cli/dist/connectors/linear.ts +7 -4
  51. package/vendor/cli/dist/connectors/linkedin-browser-script.ts +13 -0
  52. package/vendor/cli/dist/connectors/linkedin-draft-page.js +104 -0
  53. package/vendor/cli/dist/connectors/linkedin-drafts.ts +73 -0
  54. package/vendor/cli/dist/connectors/linkedin-identity.ts +32 -0
  55. package/vendor/cli/dist/connectors/linkedin-inbox-adapter.js +1185 -0
  56. package/vendor/cli/dist/connectors/linkedin-inbox.ts +156 -0
  57. package/vendor/cli/dist/connectors/linkedin-like.ts +114 -0
  58. package/vendor/cli/dist/connectors/linkedin-takeout.ts +577 -0
  59. package/vendor/cli/dist/connectors/linkedin.ts +3998 -0
  60. package/vendor/cli/dist/connectors/postgres.ts +27 -2
  61. package/vendor/cli/dist/connectors/takeout-utils.ts +240 -0
  62. package/vendor/cli/dist/connectors/tiktok-inbox-page.js +230 -0
  63. package/vendor/cli/dist/connectors/tiktok-web-page.js +217 -0
  64. package/vendor/cli/dist/connectors/tiktok_web.ts +319 -0
  65. package/vendor/cli/dist/connectors/whatsapp-web-adapter.js +285 -567
  66. package/vendor/cli/dist/connectors/whatsapp-web-helpers.ts +74 -455
  67. package/vendor/cli/dist/connectors/whatsapp-web-identity.ts +135 -0
  68. package/vendor/cli/dist/connectors/whatsapp_web.ts +159 -618
  69. package/vendor/cli/dist/connectors/x-dm-adapter.js +556 -0
  70. package/vendor/cli/dist/connectors/x-identity.ts +31 -2
  71. package/vendor/cli/dist/connectors/x.ts +539 -253
  72. package/vendor/cli/dist/index.js +1 -37
  73. package/vendor/cli/dist/internal/context.d.ts +10 -0
  74. package/vendor/cli/dist/internal/context.js +26 -16
  75. package/vendor/cli/dist/internal/node-version.d.ts +1 -1
  76. package/vendor/cli/dist/internal/node-version.js +1 -1
  77. package/vendor/cli/dist/internal/oauth.d.ts +3 -1
  78. package/vendor/cli/dist/internal/oauth.js +4 -3
  79. package/vendor/cli/dist/internal/runtime-components.d.ts +9 -0
  80. package/vendor/cli/dist/internal/runtime-components.js +67 -2
  81. package/vendor/cli/dist/mac-auth.js +17 -1
  82. package/vendor/cli/dist/providers.json +1 -1
  83. package/vendor/cli/dist/runtime-components.json +4 -4
  84. package/vendor/cli/dist/templates/AGENTS.md.tmpl +12 -5
  85. package/vendor/cli/dist/templates/README.md.tmpl +1 -1
  86. package/vendor/cli/dist/vendor/ora/.bun-tag-fde20e9a6df212fa +0 -0
  87. package/vendor/cli/dist/vendor/ora/index.d.ts +332 -0
  88. package/vendor/cli/dist/vendor/ora/index.js +424 -0
  89. package/vendor/cli/dist/vendor/ora/license +9 -0
  90. package/vendor/cli/dist/vendor/ora/package.json +64 -0
  91. package/vendor/cli/dist/vendor/ora/readme.md +329 -0
  92. package/vendor/cli/package.json +2 -2
  93. package/vendor/connector-sdk/dist/browser-handoff-banner.d.ts +39 -0
  94. package/vendor/connector-sdk/dist/browser-handoff-banner.js +175 -0
  95. package/vendor/connector-sdk/dist/browser-requirement.d.ts +36 -0
  96. package/vendor/connector-sdk/dist/browser-requirement.js +60 -0
  97. package/vendor/connector-sdk/dist/browser-source-read.d.ts +52 -0
  98. package/vendor/connector-sdk/dist/browser-source-read.js +107 -0
  99. package/vendor/connector-sdk/dist/connector-runtime.d.ts +3 -1
  100. package/vendor/connector-sdk/dist/connector-runtime.js +10 -0
  101. package/vendor/connector-sdk/dist/connector-types.d.ts +169 -45
  102. package/vendor/connector-sdk/dist/define-connector.d.ts +4 -2
  103. package/vendor/connector-sdk/dist/define-connector.js +3 -0
  104. package/vendor/connector-sdk/dist/index.d.ts +8 -2
  105. package/vendor/connector-sdk/dist/index.js +3 -0
  106. package/vendor/connector-sdk/dist/reaction-client-types.d.ts +16 -21
  107. package/vendor/connector-sdk/dist/reaction-client-types.typecheck.d.ts +5 -0
  108. package/vendor/connector-sdk/package.json +13 -1
  109. package/vendor/connector-worker/dist/agent-turn/guest-entry.js +43 -30
  110. package/vendor/connector-worker/dist/agent-turn/guest.bundle.js +416 -330
  111. package/vendor/connector-worker/dist/agent-turn/memory.d.ts +3 -2
  112. package/vendor/connector-worker/dist/agent-turn/memory.js +3 -20
  113. package/vendor/connector-worker/dist/agent-turn/types.d.ts +3 -15
  114. package/vendor/connector-worker/dist/agent-turn/workspace.d.ts +2 -2
  115. package/vendor/connector-worker/dist/agent-turn/workspace.js +2 -4
  116. package/vendor/connector-worker/dist/daemon/action-monitor.d.ts +12 -0
  117. package/vendor/connector-worker/dist/daemon/action-monitor.js +25 -0
  118. package/vendor/connector-worker/dist/daemon/agent-turn.js +0 -9
  119. package/vendor/connector-worker/dist/daemon/automation.d.ts +4 -11
  120. package/vendor/connector-worker/dist/daemon/automation.js +6 -6
  121. package/vendor/connector-worker/dist/daemon/builtins/index.d.ts +12 -0
  122. package/vendor/connector-worker/dist/daemon/builtins/index.js +61 -1
  123. package/vendor/connector-worker/dist/daemon/builtins/os-shell.d.ts +2 -1
  124. package/vendor/connector-worker/dist/daemon/builtins/os-shell.js +40 -27
  125. package/vendor/connector-worker/dist/daemon/client.d.ts +6 -4
  126. package/vendor/connector-worker/dist/daemon/client.js +3 -3
  127. package/vendor/connector-worker/dist/daemon/device-concurrency.d.ts +8 -0
  128. package/vendor/connector-worker/dist/daemon/device-concurrency.js +13 -0
  129. package/vendor/connector-worker/dist/daemon/executor.d.ts +1 -1
  130. package/vendor/connector-worker/dist/daemon/executor.js +48 -120
  131. package/vendor/connector-worker/dist/daemon/log.d.ts +2 -0
  132. package/vendor/connector-worker/dist/daemon/log.js +23 -2
  133. package/vendor/connector-worker/dist/daemon/mac-device-daemon.d.ts +23 -6
  134. package/vendor/connector-worker/dist/daemon/mac-device-daemon.js +57 -23
  135. package/vendor/connector-worker/dist/daemon/native-bridge/client.d.ts +6 -0
  136. package/vendor/connector-worker/dist/daemon/native-bridge/client.js +15 -0
  137. package/vendor/connector-worker/dist/daemon/native-bridge/executor.js +29 -25
  138. package/vendor/connector-worker/dist/daemon/native-bridge/protocol.d.ts +1 -1
  139. package/vendor/connector-worker/dist/daemon/native-bridge/protocol.js +1 -0
  140. package/vendor/connector-worker/dist/daemon/poll-loop.d.ts +3 -0
  141. package/vendor/connector-worker/dist/daemon/poll-loop.js +5 -1
  142. package/vendor/connector-worker/dist/daemon/start.d.ts +1 -0
  143. package/vendor/connector-worker/dist/daemon/start.js +15 -20
  144. package/vendor/connector-worker/dist/daemon/terminal-failure.js +0 -11
  145. package/vendor/connector-worker/dist/daemon/worker-id.d.ts +17 -0
  146. package/vendor/connector-worker/dist/daemon/worker-id.js +22 -0
  147. package/vendor/connector-worker/dist/executor/interface.d.ts +34 -2
  148. package/vendor/connector-worker/dist/executor/isolate.js +66 -15
  149. package/vendor/connector-worker/dist/executor/redact.d.ts +1 -0
  150. package/vendor/connector-worker/dist/executor/redact.js +97 -26
  151. package/vendor/connector-worker/dist/executor/runtime.d.ts +7 -0
  152. package/vendor/connector-worker/dist/executor/runtime.js +26 -0
  153. package/vendor/connector-worker/dist/isolate/bridge.js +3 -1
  154. package/vendor/connector-worker/dist/mac-device-daemon.js +24 -29
  155. package/vendor/connector-worker/package.json +2 -2
  156. package/vendor/core/dist/agent-policy.js +1 -1
  157. package/vendor/core/dist/agent-store.d.ts +2 -0
  158. package/vendor/core/dist/agent-tooling.d.ts +1 -1
  159. package/vendor/core/dist/agent-tooling.js +1 -1
  160. package/vendor/core/dist/capabilities.d.ts +1 -1
  161. package/vendor/core/dist/capabilities.js +2 -1
  162. package/vendor/core/dist/connector-query-errors.d.ts +32 -0
  163. package/vendor/core/dist/connector-query-errors.js +41 -1
  164. package/vendor/core/dist/contracts/agent-settings.d.ts +0 -11
  165. package/vendor/core/dist/contracts/agent-settings.js +1 -7
  166. package/vendor/core/dist/contracts/tools/collection-presentation.d.ts +93 -0
  167. package/vendor/core/dist/contracts/tools/collection-presentation.js +88 -0
  168. package/vendor/core/dist/contracts/tools/collection-selection.d.ts +47 -0
  169. package/vendor/core/dist/contracts/tools/collection-selection.js +74 -0
  170. package/vendor/core/dist/contracts/tools/manage-agents.d.ts +10 -4
  171. package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +1 -1
  172. package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +5 -1
  173. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +19 -4
  174. package/vendor/core/dist/contracts/tools/manage-automations.js +25 -8
  175. package/vendor/core/dist/contracts/tools/manage-connections.d.ts +1 -0
  176. package/vendor/core/dist/contracts/tools/manage-connections.js +3 -0
  177. package/vendor/core/dist/contracts/tools/manage-conversations.js +2 -2
  178. package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +11 -0
  179. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +42 -3
  180. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +181 -152
  181. package/vendor/core/dist/contracts/tools/manage-entity.js +118 -162
  182. package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +14 -0
  183. package/vendor/core/dist/contracts/tools/manage-feeds.js +17 -0
  184. package/vendor/core/dist/contracts/tools/manage-operations.d.ts +41 -3
  185. package/vendor/core/dist/contracts/tools/manage-operations.js +40 -2
  186. package/vendor/core/dist/contracts/tools/manage-views.d.ts +182 -7
  187. package/vendor/core/dist/contracts/tools/manage-views.js +49 -13
  188. package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +11 -2
  189. package/vendor/core/dist/contracts/tools/read-knowledge.js +23 -3
  190. package/vendor/core/dist/contracts/tools/save-memory.d.ts +3 -6
  191. package/vendor/core/dist/contracts/tools/save-memory.js +2 -6
  192. package/vendor/core/dist/contracts/tools/view-attach.d.ts +2 -1
  193. package/vendor/core/dist/contracts/tools/view-attach.js +7 -2
  194. package/vendor/core/dist/contracts/worker/protocol.d.ts +130 -159
  195. package/vendor/core/dist/contracts/worker/protocol.js +88 -76
  196. package/vendor/core/dist/device-pin-tombstones.d.ts +44 -0
  197. package/vendor/core/dist/device-pin-tombstones.js +57 -0
  198. package/vendor/core/dist/index.d.ts +5 -5
  199. package/vendor/core/dist/index.js +4 -6
  200. package/vendor/core/dist/json-template.d.ts +6 -10
  201. package/vendor/core/dist/json-template.js +5 -9
  202. package/vendor/core/dist/logger.js +17 -26
  203. package/vendor/core/dist/shell-safety.d.ts +9 -0
  204. package/vendor/core/dist/shell-safety.js +154 -0
  205. package/vendor/core/dist/suggestions.d.ts +1 -1
  206. package/vendor/core/dist/suggestions.js +1 -1
  207. package/vendor/core/dist/tool-trace-summary.d.ts +1 -1
  208. package/vendor/core/dist/tool-trace-summary.js +1 -1
  209. package/vendor/core/dist/types.d.ts +1 -3
  210. package/vendor/core/dist/utils/diagnostic-scrubber.d.ts +7 -0
  211. package/vendor/core/dist/utils/diagnostic-scrubber.js +437 -0
  212. package/vendor/core/dist/worker/auth.d.ts +44 -6
  213. package/vendor/core/dist/worker/auth.js +44 -11
  214. package/vendor/core/dist/worker/wire.d.ts +0 -10
  215. package/vendor/core/package.json +20 -11
  216. package/vendor/ora/.bun-tag-fde20e9a6df212fa +0 -0
  217. package/vendor/ora/index.d.ts +332 -0
  218. package/vendor/ora/index.js +424 -0
  219. package/vendor/ora/license +9 -0
  220. package/vendor/ora/package.json +53 -0
  221. package/vendor/ora/readme.md +329 -0
  222. package/vendor/cli/dist/commands/telemetry.d.ts +0 -10
  223. package/vendor/cli/dist/commands/telemetry.js +0 -66
  224. package/vendor/connector-worker/dist/daemon/device-chat.d.ts +0 -9
  225. package/vendor/connector-worker/dist/daemon/device-chat.js +0 -61
  226. package/vendor/core/dist/contracts/worker/device-chat.d.ts +0 -4
  227. package/vendor/core/dist/contracts/worker/device-chat.js +0 -26
  228. package/vendor/core/dist/sentry.d.ts +0 -26
  229. package/vendor/core/dist/sentry.js +0 -133
  230. package/vendor/core/dist/tool-policy.d.ts +0 -74
  231. package/vendor/core/dist/tool-policy.js +0 -305
  232. package/vendor/core/dist/utils/sentry-scrubber.d.ts +0 -29
  233. package/vendor/core/dist/utils/sentry-scrubber.js +0 -228
@@ -0,0 +1,93 @@
1
+ import { type Static } from "@sinclair/typebox";
2
+ import { type CollectionSelection } from "./collection-selection";
3
+ /** Presentation metadata travels through the existing entity schema. */
4
+ export declare const COLLECTION_PRESENTATION_KEY = "x-lobu-collection";
5
+ export declare const COLLECTION_PRESET_QUERY_KEY = "$preset";
6
+ export declare const COLLECTION_TABLE_QUERY_KEY = "$table";
7
+ declare const TableSchema: import("@sinclair/typebox").TObject<{
8
+ columns: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
9
+ sort: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
10
+ field: import("@sinclair/typebox").TString;
11
+ order: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"asc">, import("@sinclair/typebox").TLiteral<"desc">]>;
12
+ }>>;
13
+ }>;
14
+ declare const PresetSchema: import("@sinclair/typebox").TObject<{
15
+ key: import("@sinclair/typebox").TString;
16
+ label: import("@sinclair/typebox").TString;
17
+ selection: import("@sinclair/typebox").TObject<{
18
+ search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
19
+ filters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
20
+ field: import("@sinclair/typebox").TString;
21
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eq">, import("@sinclair/typebox").TLiteral<"neq">]>;
22
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
23
+ }>, import("@sinclair/typebox").TObject<{
24
+ field: import("@sinclair/typebox").TString;
25
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lt">, import("@sinclair/typebox").TLiteral<"lte">, import("@sinclair/typebox").TLiteral<"gt">, import("@sinclair/typebox").TLiteral<"gte">]>;
26
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
27
+ }>]>>>;
28
+ segment: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
29
+ }>;
30
+ table: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
31
+ columns: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
32
+ sort: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
33
+ field: import("@sinclair/typebox").TString;
34
+ order: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"asc">, import("@sinclair/typebox").TLiteral<"desc">]>;
35
+ }>>;
36
+ }>>;
37
+ relativeDate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
38
+ field: import("@sinclair/typebox").TString;
39
+ fromDays: import("@sinclair/typebox").TInteger;
40
+ toDays: import("@sinclair/typebox").TInteger;
41
+ timeZone: import("@sinclair/typebox").TString;
42
+ }>>;
43
+ }>;
44
+ export declare const CollectionPresentationSchema: import("@sinclair/typebox").TObject<{
45
+ presets: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
46
+ key: import("@sinclair/typebox").TString;
47
+ label: import("@sinclair/typebox").TString;
48
+ selection: import("@sinclair/typebox").TObject<{
49
+ search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
50
+ filters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
51
+ field: import("@sinclair/typebox").TString;
52
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eq">, import("@sinclair/typebox").TLiteral<"neq">]>;
53
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
54
+ }>, import("@sinclair/typebox").TObject<{
55
+ field: import("@sinclair/typebox").TString;
56
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lt">, import("@sinclair/typebox").TLiteral<"lte">, import("@sinclair/typebox").TLiteral<"gt">, import("@sinclair/typebox").TLiteral<"gte">]>;
57
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
58
+ }>]>>>;
59
+ segment: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
60
+ }>;
61
+ table: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
62
+ columns: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
63
+ sort: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
64
+ field: import("@sinclair/typebox").TString;
65
+ order: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"asc">, import("@sinclair/typebox").TLiteral<"desc">]>;
66
+ }>>;
67
+ }>>;
68
+ relativeDate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
69
+ field: import("@sinclair/typebox").TString;
70
+ fromDays: import("@sinclair/typebox").TInteger;
71
+ toDays: import("@sinclair/typebox").TInteger;
72
+ timeZone: import("@sinclair/typebox").TString;
73
+ }>>;
74
+ }>>>;
75
+ table: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
76
+ columns: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
77
+ sort: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
78
+ field: import("@sinclair/typebox").TString;
79
+ order: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"asc">, import("@sinclair/typebox").TLiteral<"desc">]>;
80
+ }>>;
81
+ }>>;
82
+ /** Read-only SDK script. Receives `input: { field, collection }`; returns
83
+ * { connection, sql } for a bounded query_sql read of { value, count } rows.
84
+ * Both calls run as the viewer; this binding grants no source access. */
85
+ facetQuery: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
86
+ }>;
87
+ export type CollectionPresentation = Static<typeof CollectionPresentationSchema>;
88
+ export type CollectionPreset = Static<typeof PresetSchema>;
89
+ export type CollectionTable = Static<typeof TableSchema>;
90
+ export declare function parseCollectionPresentation(raw: unknown): CollectionPresentation;
91
+ export declare function resolveCollectionPreset(preset: CollectionPreset, now?: Date): CollectionSelection;
92
+ export {};
93
+ //# sourceMappingURL=collection-presentation.d.ts.map
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollectionPresentationSchema = exports.COLLECTION_TABLE_QUERY_KEY = exports.COLLECTION_PRESET_QUERY_KEY = exports.COLLECTION_PRESENTATION_KEY = void 0;
4
+ exports.parseCollectionPresentation = parseCollectionPresentation;
5
+ exports.resolveCollectionPreset = resolveCollectionPreset;
6
+ const typebox_1 = require("@sinclair/typebox");
7
+ const value_1 = require("@sinclair/typebox/value");
8
+ const collection_selection_1 = require("./collection-selection");
9
+ /** Presentation metadata travels through the existing entity schema. */
10
+ exports.COLLECTION_PRESENTATION_KEY = "x-lobu-collection";
11
+ exports.COLLECTION_PRESET_QUERY_KEY = "$preset";
12
+ exports.COLLECTION_TABLE_QUERY_KEY = "$table";
13
+ const Field = typebox_1.Type.String({
14
+ pattern: "^[A-Za-z_][A-Za-z0-9_]*$",
15
+ maxLength: 120,
16
+ });
17
+ const TableSchema = typebox_1.Type.Object({
18
+ columns: typebox_1.Type.Optional(typebox_1.Type.Array(Field, { maxItems: 100, uniqueItems: true })),
19
+ sort: typebox_1.Type.Optional(typebox_1.Type.Object({
20
+ field: Field,
21
+ order: typebox_1.Type.Union([typebox_1.Type.Literal("asc"), typebox_1.Type.Literal("desc")]),
22
+ }, { additionalProperties: false })),
23
+ }, { additionalProperties: false });
24
+ const PresetSchema = typebox_1.Type.Object({
25
+ key: typebox_1.Type.String({ pattern: "^[a-z0-9]+(?:-[a-z0-9]+)*$", maxLength: 120 }),
26
+ label: typebox_1.Type.String({ minLength: 1, maxLength: 120 }),
27
+ selection: collection_selection_1.CollectionSelectionSchema,
28
+ table: typebox_1.Type.Optional(TableSchema),
29
+ relativeDate: typebox_1.Type.Optional(typebox_1.Type.Object({
30
+ field: Field,
31
+ fromDays: typebox_1.Type.Integer({ minimum: -3660, maximum: 3660 }),
32
+ toDays: typebox_1.Type.Integer({ minimum: -3660, maximum: 3660 }),
33
+ timeZone: typebox_1.Type.String({ minLength: 1, maxLength: 100 }),
34
+ }, { additionalProperties: false })),
35
+ }, { additionalProperties: false });
36
+ exports.CollectionPresentationSchema = typebox_1.Type.Object({
37
+ presets: typebox_1.Type.Optional(typebox_1.Type.Array(PresetSchema, { maxItems: 32 })),
38
+ table: typebox_1.Type.Optional(TableSchema),
39
+ /** Read-only SDK script. Receives `input: { field, collection }`; returns
40
+ * { connection, sql } for a bounded query_sql read of { value, count } rows.
41
+ * Both calls run as the viewer; this binding grants no source access. */
42
+ facetQuery: typebox_1.Type.Optional(typebox_1.Type.String({ minLength: 1, maxLength: 64000 })),
43
+ }, { additionalProperties: false });
44
+ function parseCollectionPresentation(raw) {
45
+ if (!value_1.Value.Check(exports.CollectionPresentationSchema, raw))
46
+ throw new Error("Invalid collection presentation configuration");
47
+ const keys = new Set();
48
+ for (const preset of raw.presets ?? []) {
49
+ if (keys.has(preset.key))
50
+ throw new Error(`Duplicate collection preset: ${preset.key}`);
51
+ keys.add(preset.key);
52
+ if (preset.relativeDate) {
53
+ if ((preset.selection.filters?.length ?? 0) > 30)
54
+ throw new Error("Relative date presets support at most 30 other filters");
55
+ if (preset.relativeDate.fromDays > preset.relativeDate.toDays)
56
+ throw new Error("Relative date range is reversed");
57
+ // Intl validates IANA timezone names, including UTC.
58
+ new Intl.DateTimeFormat("en", {
59
+ timeZone: preset.relativeDate.timeZone,
60
+ }).format();
61
+ }
62
+ }
63
+ return raw;
64
+ }
65
+ function resolveCollectionPreset(preset, now = new Date()) {
66
+ const selection = structuredClone(preset.selection);
67
+ if (!preset.relativeDate)
68
+ return selection;
69
+ const { field, fromDays, toDays, timeZone } = preset.relativeDate;
70
+ const parts = new Intl.DateTimeFormat("en", {
71
+ timeZone,
72
+ year: "numeric",
73
+ month: "2-digit",
74
+ day: "2-digit",
75
+ }).formatToParts(now);
76
+ const part = (key) => Number(parts.find((item) => item.type === key)?.value);
77
+ const day = Date.UTC(part("year"), part("month") - 1, part("day"));
78
+ const date = (offset) => new Date(day + offset * 86400000).toISOString().slice(0, 10);
79
+ return {
80
+ ...selection,
81
+ filters: [
82
+ ...(selection.filters ?? []),
83
+ { field, op: "gte", value: date(fromDays) },
84
+ { field, op: "lte", value: date(toDays) },
85
+ ],
86
+ };
87
+ }
88
+ //# sourceMappingURL=collection-presentation.js.map
@@ -0,0 +1,47 @@
1
+ import { type Static } from "@sinclair/typebox";
2
+ export declare const COLLECTION_QUERY_KEY = "$collection";
3
+ declare const AttributeValueSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
4
+ export type AttributeValue = Static<typeof AttributeValueSchema>;
5
+ /** Conjunction only. Fields are schema attributes, never SQL expressions. */
6
+ declare const AttributeFilterSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
7
+ field: import("@sinclair/typebox").TString;
8
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eq">, import("@sinclair/typebox").TLiteral<"neq">]>;
9
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
10
+ }>, import("@sinclair/typebox").TObject<{
11
+ field: import("@sinclair/typebox").TString;
12
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lt">, import("@sinclair/typebox").TLiteral<"lte">, import("@sinclair/typebox").TLiteral<"gt">, import("@sinclair/typebox").TLiteral<"gte">]>;
13
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
14
+ }>]>;
15
+ export type AttributeFilter = Static<typeof AttributeFilterSchema>;
16
+ export declare const AttributeFiltersSchema: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
17
+ field: import("@sinclair/typebox").TString;
18
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eq">, import("@sinclair/typebox").TLiteral<"neq">]>;
19
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
20
+ }>, import("@sinclair/typebox").TObject<{
21
+ field: import("@sinclair/typebox").TString;
22
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lt">, import("@sinclair/typebox").TLiteral<"lte">, import("@sinclair/typebox").TLiteral<"gt">, import("@sinclair/typebox").TLiteral<"gte">]>;
23
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
24
+ }>]>>;
25
+ /** Host-owned selection, independent of a view's sorting/layout parameters. */
26
+ export declare const CollectionSelectionSchema: import("@sinclair/typebox").TObject<{
27
+ search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
28
+ filters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
29
+ field: import("@sinclair/typebox").TString;
30
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eq">, import("@sinclair/typebox").TLiteral<"neq">]>;
31
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
32
+ }>, import("@sinclair/typebox").TObject<{
33
+ field: import("@sinclair/typebox").TString;
34
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lt">, import("@sinclair/typebox").TLiteral<"lte">, import("@sinclair/typebox").TLiteral<"gt">, import("@sinclair/typebox").TLiteral<"gte">]>;
35
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
36
+ }>]>>>;
37
+ segment: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
38
+ }>;
39
+ export type CollectionSelection = Static<typeof CollectionSelectionSchema>;
40
+ export declare const CollectionWhenSchema: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>>;
41
+ type CollectionWhen = Static<typeof CollectionWhenSchema>;
42
+ /** Malformed URL/host input must never silently become an unfiltered read. */
43
+ export declare function parseCollectionSelection(raw: unknown): CollectionSelection;
44
+ /** Tab applicability is descriptive, never an authorization boundary. */
45
+ export declare function selectionImplies(selection: CollectionSelection, when: CollectionWhen): boolean;
46
+ export {};
47
+ //# sourceMappingURL=collection-selection.d.ts.map
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollectionWhenSchema = exports.CollectionSelectionSchema = exports.AttributeFiltersSchema = exports.COLLECTION_QUERY_KEY = void 0;
4
+ exports.parseCollectionSelection = parseCollectionSelection;
5
+ exports.selectionImplies = selectionImplies;
6
+ const typebox_1 = require("@sinclair/typebox");
7
+ const value_1 = require("@sinclair/typebox/value");
8
+ exports.COLLECTION_QUERY_KEY = "$collection";
9
+ const Field = typebox_1.Type.String({
10
+ pattern: "^[A-Za-z_][A-Za-z0-9_]*$",
11
+ maxLength: 120,
12
+ });
13
+ const AttributeValueSchema = typebox_1.Type.Union([
14
+ typebox_1.Type.String({ maxLength: 2000 }),
15
+ typebox_1.Type.Number(),
16
+ typebox_1.Type.Boolean(),
17
+ typebox_1.Type.Null(),
18
+ ]);
19
+ /** Conjunction only. Fields are schema attributes, never SQL expressions. */
20
+ const AttributeFilterSchema = typebox_1.Type.Union([
21
+ typebox_1.Type.Object({
22
+ field: Field,
23
+ op: typebox_1.Type.Union([typebox_1.Type.Literal("eq"), typebox_1.Type.Literal("neq")]),
24
+ value: AttributeValueSchema,
25
+ }, { additionalProperties: false }),
26
+ typebox_1.Type.Object({
27
+ field: Field,
28
+ op: typebox_1.Type.Union([
29
+ typebox_1.Type.Literal("lt"),
30
+ typebox_1.Type.Literal("lte"),
31
+ typebox_1.Type.Literal("gt"),
32
+ typebox_1.Type.Literal("gte"),
33
+ ]),
34
+ value: typebox_1.Type.Union([typebox_1.Type.String({ maxLength: 2000 }), typebox_1.Type.Number()]),
35
+ }, { additionalProperties: false }),
36
+ ]);
37
+ exports.AttributeFiltersSchema = typebox_1.Type.Array(AttributeFilterSchema, {
38
+ maxItems: 32,
39
+ });
40
+ /** Host-owned selection, independent of a view's sorting/layout parameters. */
41
+ exports.CollectionSelectionSchema = typebox_1.Type.Object({
42
+ search: typebox_1.Type.Optional(typebox_1.Type.String({ maxLength: 512 })),
43
+ filters: typebox_1.Type.Optional(exports.AttributeFiltersSchema),
44
+ segment: typebox_1.Type.Optional(typebox_1.Type.String({ minLength: 1, maxLength: 120 })),
45
+ }, { additionalProperties: false });
46
+ exports.CollectionWhenSchema = typebox_1.Type.Record(Field, AttributeValueSchema, {
47
+ maxProperties: 32,
48
+ additionalProperties: false,
49
+ });
50
+ /** Malformed URL/host input must never silently become an unfiltered read. */
51
+ function parseCollectionSelection(raw) {
52
+ if (raw === undefined)
53
+ return {};
54
+ let value = raw;
55
+ if (typeof raw === "string") {
56
+ if (raw.length > 80000)
57
+ throw new Error("Collection selection is too large");
58
+ try {
59
+ value = JSON.parse(raw);
60
+ }
61
+ catch {
62
+ throw new Error("Invalid collection selection JSON");
63
+ }
64
+ }
65
+ if (!value_1.Value.Check(exports.CollectionSelectionSchema, value)) {
66
+ throw new Error("Invalid collection selection: use search and typed attribute filters");
67
+ }
68
+ return value;
69
+ }
70
+ /** Tab applicability is descriptive, never an authorization boundary. */
71
+ function selectionImplies(selection, when) {
72
+ return Object.entries(when).every(([field, value]) => selection.filters?.some((filter) => filter.field === field && filter.op === "eq" && filter.value === value));
73
+ }
74
+ //# sourceMappingURL=collection-selection.js.map
@@ -73,11 +73,16 @@ export interface AgentRecord {
73
73
  */
74
74
  export type ModelSource = "agent" | "org_default" | "none";
75
75
  export interface AgentModelInfo {
76
- /** The effective model ref that would be used, or null when none resolves. */
76
+ /** The configured model ref before provider fallback, or null when none resolves. */
77
77
  effective_model: string | null;
78
78
  /** Which layer supplied `effective_model`. */
79
79
  source: ModelSource;
80
- /** True when no model resolves — the agent cannot run until one is set. */
80
+ /**
81
+ * True when no model resolves or the cloud provider preflight rejects every
82
+ * listed candidate using the agent owner's credentials. Provider checks run
83
+ * when the gateway catalog is available; false does not guarantee a
84
+ * successful run or describe device-local execution.
85
+ */
81
86
  not_runnable: boolean;
82
87
  }
83
88
  export type ManageAgentsResult = {
@@ -93,8 +98,9 @@ export type ManageAgentsResult = {
93
98
  created: boolean;
94
99
  /**
95
100
  * The agent's model after create. `not_runnable: true` is the actionable
96
- * signal that no model resolved (no `default_model` given and no org
97
- * default) — set one with a `default_model` on create/update.
101
+ * signal that no runnable model resolved (no `default_model` given and
102
+ * no org default, or the model's provider is not connected) — set a
103
+ * routable `default_model` on create/update or connect its provider.
98
104
  */
99
105
  model: AgentModelInfo;
100
106
  } | {
@@ -79,7 +79,7 @@ export declare const ManageAuthProfilesResultSchema: import("@sinclair/typebox")
79
79
  cookie_count: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
80
80
  auth_cookie_name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
81
81
  is_expired: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
82
- auth_mode: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"cookies">, import("@sinclair/typebox").TLiteral<"empty">]>>;
82
+ auth_mode: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"cookies">, import("@sinclair/typebox").TLiteral<"live">, import("@sinclair/typebox").TLiteral<"empty">]>>;
83
83
  }>, import("@sinclair/typebox").TObject<{
84
84
  action: import("@sinclair/typebox").TLiteral<"create_auth_profile">;
85
85
  auth_profile: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
@@ -147,7 +147,11 @@ exports.ManageAuthProfilesResultSchema = typebox_1.Type.Union([
147
147
  cookie_count: typebox_1.Type.Optional(typebox_1.Type.Integer()),
148
148
  auth_cookie_name: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
149
149
  is_expired: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
150
- auth_mode: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Literal("cookies"), typebox_1.Type.Literal("empty")])),
150
+ auth_mode: typebox_1.Type.Optional(typebox_1.Type.Union([
151
+ typebox_1.Type.Literal("cookies"),
152
+ typebox_1.Type.Literal("live"),
153
+ typebox_1.Type.Literal("empty"),
154
+ ])),
151
155
  }),
152
156
  typebox_1.Type.Object({
153
157
  action: typebox_1.Type.Literal("create_auth_profile"),
@@ -118,6 +118,13 @@ export type AutomationEntityOutput = Static<typeof AutomationEntityOutputSchema>
118
118
  * convention two concurrent runs can silently break. Rows carrying no identity
119
119
  * are inert — never a supersede target — so a keyed output cannot capture an
120
120
  * unrelated event that happens to share metadata.
121
+ *
122
+ * A row may carry `entity_ids` to link that event to its own records instead
123
+ * of the Automation's bound entities (replace, not add). Linkage is not part
124
+ * of the identity, so a later version of a key carries its own row's
125
+ * `entity_ids`. One output array cannot emit the same key twice even for
126
+ * different entities. Put the record's id in a metadata key field when each
127
+ * record needs its own current event.
121
128
  */
122
129
  export declare const AutomationEventOutputSchema: import("@sinclair/typebox").TObject<{
123
130
  event: import("@sinclair/typebox").TString;
@@ -141,12 +148,18 @@ export declare const AutomationScriptExecutorSchema: import("@sinclair/typebox")
141
148
  params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
142
149
  }>;
143
150
  export type AutomationScriptExecutor = Static<typeof AutomationScriptExecutorSchema>;
151
+ export declare const AutomationExternalExecutorSchema: import("@sinclair/typebox").TObject<{
152
+ kind: import("@sinclair/typebox").TLiteral<"external">;
153
+ }>;
154
+ export type AutomationExecutor = AutomationScriptExecutor | Static<typeof AutomationExternalExecutorSchema>;
144
155
  export declare const AutomationExecutionConfigSchema: import("@sinclair/typebox").TObject<{
145
- executor: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
156
+ executor: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
146
157
  kind: import("@sinclair/typebox").TLiteral<"script">;
147
158
  source: import("@sinclair/typebox").TString;
148
159
  params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
149
- }>>;
160
+ }>, import("@sinclair/typebox").TObject<{
161
+ kind: import("@sinclair/typebox").TLiteral<"external">;
162
+ }>]>>;
150
163
  timeout_seconds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
151
164
  max_budget_usd: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
152
165
  model: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -249,11 +262,13 @@ export declare const ManageAutomationsSchema: import("@sinclair/typebox").TObjec
249
262
  min_cooldown_seconds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
250
263
  model_config: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
251
264
  execution_config: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNull, import("@sinclair/typebox").TObject<{
252
- executor: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
265
+ executor: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
253
266
  kind: import("@sinclair/typebox").TLiteral<"script">;
254
267
  source: import("@sinclair/typebox").TString;
255
268
  params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
256
- }>>;
269
+ }>, import("@sinclair/typebox").TObject<{
270
+ kind: import("@sinclair/typebox").TLiteral<"external">;
271
+ }>]>>;
257
272
  timeout_seconds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
258
273
  max_budget_usd: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
259
274
  model: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ListAutomationsResultSchema = exports.ListAutomationsSchema = exports.ManageAutomationsResultSchema = exports.AutomationTriggerResultSchema = exports.AutomationTriggerExecutionSchema = exports.AutomationClaimNextWindowResultSchema = exports.AutomationClaimNextWindowContextSchema = exports.ManageAutomationsPromotedEntitySchema = exports.ManageAutomationsFeedbackItemSchema = exports.ManageAutomationsDeleteResultSchema = exports.ManageAutomationsSchema = exports.AutomationSkillSchema = exports.SourceSchema = exports.AutomationDeliveryTargetSchema = exports.AutomationExecutionConfigSchema = exports.AutomationScriptExecutorSchema = exports.AutomationOutputsSchema = exports.AutomationOutputSchema = exports.AutomationEventOutputSchema = exports.AutomationEntityOutputSchema = exports.AutomationSourceSchema = exports.AutomationTriggerSchema = exports.AutomationScheduleTriggerSchema = exports.AutomationWorkspaceEventTriggerSchema = exports.AutomationEventTriggerSchema = void 0;
3
+ exports.ListAutomationsResultSchema = exports.ListAutomationsSchema = exports.ManageAutomationsResultSchema = exports.AutomationTriggerResultSchema = exports.AutomationTriggerExecutionSchema = exports.AutomationClaimNextWindowResultSchema = exports.AutomationClaimNextWindowContextSchema = exports.ManageAutomationsPromotedEntitySchema = exports.ManageAutomationsFeedbackItemSchema = exports.ManageAutomationsDeleteResultSchema = exports.ManageAutomationsSchema = exports.AutomationSkillSchema = exports.SourceSchema = exports.AutomationDeliveryTargetSchema = exports.AutomationExecutionConfigSchema = exports.AutomationExternalExecutorSchema = exports.AutomationScriptExecutorSchema = exports.AutomationOutputsSchema = exports.AutomationOutputSchema = exports.AutomationEventOutputSchema = exports.AutomationEntityOutputSchema = exports.AutomationSourceSchema = exports.AutomationTriggerSchema = exports.AutomationScheduleTriggerSchema = exports.AutomationWorkspaceEventTriggerSchema = exports.AutomationEventTriggerSchema = void 0;
4
4
  exports.resolvedEventExecution = resolvedEventExecution;
5
5
  exports.normalizeWorkspaceEventTrigger = normalizeWorkspaceEventTrigger;
6
6
  exports.normalizeAutomationTags = normalizeAutomationTags;
@@ -117,7 +117,10 @@ exports.AutomationScheduleTriggerSchema = typebox_1.Type.Object({
117
117
  active_run: typebox_1.Type.Optional(typebox_1.Type.Literal("coalesce", {
118
118
  default: "coalesce",
119
119
  })),
120
- skip_if_unchanged: typebox_1.Type.Optional(typebox_1.Type.Boolean({ default: true })),
120
+ skip_if_unchanged: typebox_1.Type.Optional(typebox_1.Type.Boolean({
121
+ default: true,
122
+ description: "Native executors may skip unchanged source windows. External executors always receive due windows and decide whether to emit output.",
123
+ })),
121
124
  }, { additionalProperties: false });
122
125
  exports.AutomationTriggerSchema = typebox_1.Type.Union([
123
126
  exports.AutomationEventTriggerSchema,
@@ -178,6 +181,13 @@ exports.AutomationEntityOutputSchema = typebox_1.Type.Object({
178
181
  * convention two concurrent runs can silently break. Rows carrying no identity
179
182
  * are inert — never a supersede target — so a keyed output cannot capture an
180
183
  * unrelated event that happens to share metadata.
184
+ *
185
+ * A row may carry `entity_ids` to link that event to its own records instead
186
+ * of the Automation's bound entities (replace, not add). Linkage is not part
187
+ * of the identity, so a later version of a key carries its own row's
188
+ * `entity_ids`. One output array cannot emit the same key twice even for
189
+ * different entities. Put the record's id in a metadata key field when each
190
+ * record needs its own current event.
181
191
  */
182
192
  exports.AutomationEventOutputSchema = typebox_1.Type.Object({
183
193
  event: typebox_1.Type.String({
@@ -189,7 +199,7 @@ exports.AutomationEventOutputSchema = typebox_1.Type.Object({
189
199
  minItems: 1,
190
200
  maxItems: 4,
191
201
  uniqueItems: true,
192
- description: "One to four metadata fields whose exact values compose each draft's stable identity across Automation runs (e.g. channel + mode for per-channel voice profiles). Every key field must be present in every draft's `metadata` and be a non-blank string, safe integer, or boolean — the type is part of the identity, so 3 and \"3\" are different keys. Changing the fields, their order, or the semantic type changes identity and starts a new chain. When set, each run supersedes the current event carrying the same key values.",
202
+ description: "One to four metadata fields whose exact values compose each draft's stable identity across Automation runs (e.g. channel + mode for per-channel voice profiles). Every key field must be present in every draft's `metadata` and be a non-blank string, safe integer, or boolean — the type is part of the identity, so 3 and \"3\" are different keys. Changing the fields, their order, or the semantic type changes identity and starts a new chain. When set, each run supersedes the current event carrying the same key values. Row `entity_ids` are not part of the identity: include a record id in the key when each record needs its own current event.",
193
203
  })),
194
204
  }, { additionalProperties: false });
195
205
  exports.AutomationOutputSchema = typebox_1.Type.Union([
@@ -200,7 +210,7 @@ exports.AutomationOutputsSchema = typebox_1.Type.Object({}, {
200
210
  additionalProperties: exports.AutomationOutputSchema,
201
211
  minProperties: 1,
202
212
  maxProperties: 20,
203
- description: "Named top-level arrays persisted after a completed window. Entity outputs are validated against their entity type; event rows require content and may include title, metadata, author, source_url, occurred_at, parent_event_id, payload_type, and idempotency_key.",
213
+ description: "Named top-level arrays persisted after a completed window. Entity outputs are validated against their entity type; event rows require content and may include title, metadata, author, source_url, occurred_at, parent_event_id, payload_type, idempotency_key, and entity_ids. entity_ids on a row replace the bound entities of the Automation for that row (omit to keep them); each id must be an entity in the same workspace the run may write, or the completion fails.",
204
214
  });
205
215
  exports.AutomationScriptExecutorSchema = typebox_1.Type.Object({
206
216
  kind: typebox_1.Type.Literal("script"),
@@ -210,8 +220,15 @@ exports.AutomationScriptExecutorSchema = typebox_1.Type.Object({
210
220
  additionalProperties: false,
211
221
  description: "Run this TypeScript module directly in the Automation sandbox. Export default async (ctx, client). The runtime pins the script and window at activation and completes the run only after success. SDK writes retain the owning agent's permissions. Use ctx.window.run_id for retry idempotency.",
212
222
  });
223
+ exports.AutomationExternalExecutorSchema = typebox_1.Type.Object({ kind: typebox_1.Type.Literal("external") }, {
224
+ additionalProperties: false,
225
+ description: "An authorized external MCP client claims and completes this Automation. Manual and schedule window activations only. The schedule remains authoritative; Lobu does not start a hosted agent or device CLI. managed_agent_id may retain the owning delivery principal.",
226
+ });
213
227
  exports.AutomationExecutionConfigSchema = typebox_1.Type.Object({
214
- executor: typebox_1.Type.Optional(exports.AutomationScriptExecutorSchema),
228
+ executor: typebox_1.Type.Optional(typebox_1.Type.Union([
229
+ exports.AutomationScriptExecutorSchema,
230
+ exports.AutomationExternalExecutorSchema,
231
+ ])),
215
232
  timeout_seconds: typebox_1.Type.Optional(typebox_1.Type.Integer({
216
233
  minimum: 1,
217
234
  maximum: 86400,
@@ -244,7 +261,7 @@ exports.AutomationExecutionConfigSchema = typebox_1.Type.Object({
244
261
  })),
245
262
  }, {
246
263
  additionalProperties: false,
247
- description: "[create/update] Per-Automation execution settings: a sandboxed script executor, device-worker CLI flags, or the server-side finalize-nudge budget. Omitted fields fall back to dispatcher/CLI/global defaults; pass null to clear.",
264
+ description: "[create/update] Per-Automation execution settings: an external MCP client, a sandboxed script executor, device-worker CLI flags, or the server-side finalize-nudge budget. Omitted fields fall back to dispatcher/CLI/global defaults; pass null to clear.",
248
265
  });
249
266
  exports.AutomationDeliveryTargetSchema = typebox_1.Type.Object({
250
267
  connection_id: typebox_1.Type.Integer({
@@ -424,7 +441,7 @@ exports.ManageAutomationsSchema = typebox_1.Type.Object({
424
441
  exports.AutomationOutputsSchema,
425
442
  typebox_1.Type.Null(),
426
443
  ], {
427
- description: '[create/create_version] Named durable outputs for window execution. `{ entity, key, name? }` validates and upserts entities; `{ event }` appends standard event drafts. The object key is the top-level extracted_data array name. Event rows require content and may include title, metadata, author, source_url, occurred_at, parent_event_id, payload_type, and idempotency_key. Event triggers on an Automation with outputs must use execution="window". Pass null on create_version to remove all declared outputs.',
444
+ description: '[create/create_version] Named durable outputs for window execution. `{ entity, key, name? }` validates and upserts entities; `{ event }` appends standard event drafts. The object key is the top-level extracted_data array name. Event rows require content and may include title, metadata, author, source_url, occurred_at, parent_event_id, payload_type, idempotency_key, and entity_ids. entity_ids on a row replace the bound entities of the Automation for that row (omit to keep them); each id must be an entity in the same workspace the run may write, or the completion fails. Event triggers on an Automation with outputs must use execution="window". Pass null on create_version to remove all declared outputs.',
428
445
  })),
429
446
  triggers: typebox_1.Type.Optional(typebox_1.Type.Array(exports.AutomationTriggerSchema, {
430
447
  minItems: 0,
@@ -432,7 +449,7 @@ exports.ManageAutomationsSchema = typebox_1.Type.Object({
432
449
  description: "[create/update/create_version] Canonical Automation activations. Use a schedule trigger for cadence and timezone.",
433
450
  })),
434
451
  managed_agent_id: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String({ minLength: 1 }), typebox_1.Type.Null()], {
435
- description: "[create/update] Optional managed agent that executes this Automation's runs (server dispatch lane). Null clears the assignment; an Automation with neither managed_agent_id nor device_worker_id is manual-only and may be completed by an external MCP client. [list] Optional owner filter.",
452
+ description: "[create/update] Optional managed agent that owns this Automation. Normally executes its runs; an explicit external executor retains the agent only as the permission and delivery principal. Null clears the assignment. Without a managed agent, device pin, or external executor, an Automation is manual-only. [list] Optional owner filter.",
436
453
  })),
437
454
  status: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Literal("active"), typebox_1.Type.Literal("archived")], {
438
455
  description: "[list] Optional status filter. Omit to include active Automations only.",
@@ -72,6 +72,7 @@ export declare const UpdateAction: import("@sinclair/typebox").TObject<{
72
72
  entity_ids: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>>;
73
73
  device_worker_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
74
74
  replace_config: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
75
+ visibility: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"org">, import("@sinclair/typebox").TLiteral<"private">]>>;
75
76
  }>;
76
77
  export declare const ApplyChatConnectionAction: import("@sinclair/typebox").TObject<{
77
78
  action: import("@sinclair/typebox").TLiteral<"apply_chat_connection">;
@@ -171,6 +171,9 @@ exports.UpdateAction = typebox_1.Type.Object({
171
171
  replace_config: typebox_1.Type.Optional(typebox_1.Type.Boolean({
172
172
  description: "When true and `config` is provided, replace the stored connection config with exactly that object (declarative apply); when false/omitted, merge into the existing config (default).",
173
173
  })),
174
+ visibility: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Literal("org"), typebox_1.Type.Literal("private")], {
175
+ description: "Who can read through this connection: 'org' shares it with every workspace member, 'private' limits it to its creator. Only the connection's creator may change it, and a personal-credential connection (a user's own OAuth login or browser session) cannot be shared.",
176
+ })),
174
177
  });
175
178
  exports.ApplyChatConnectionAction = typebox_1.Type.Object({
176
179
  action: typebox_1.Type.Literal("apply_chat_connection", {
@@ -24,11 +24,11 @@ exports.ListConversationsAction = typebox_1.Type.Object({
24
24
  });
25
25
  exports.GetConversationAction = typebox_1.Type.Object({
26
26
  action: typebox_1.Type.Literal("get", {
27
- description: "Fetch one conversation by its (platform, conversation_id).",
27
+ description: "Fetch one conversation by id, optionally scoped to a platform.",
28
28
  }),
29
29
  agent_id: AgentId,
30
30
  platform: typebox_1.Type.Optional(typebox_1.Type.String({
31
- description: 'Conversation platform ("web" for app-owned conversations, or a channel platform like "slack"). Defaults to "web".',
31
+ description: 'Conversation platform ("web" for app-owned conversations, or a channel platform like "slack"). When omitted, resolves a unique active match for this agent across platforms; ambiguous ids return not found.',
32
32
  })),
33
33
  conversation_id: ConversationId,
34
34
  });
@@ -1,4 +1,14 @@
1
1
  import { type Static } from "@sinclair/typebox";
2
+ export interface EntityResolutionRule {
3
+ fields: string[];
4
+ normalizer: "email" | "phone" | "exact";
5
+ onMatch: "auto_link" | "review";
6
+ }
7
+ export declare class InvalidEntityResolutionPolicyError extends Error {
8
+ constructor(message: string);
9
+ }
10
+ /** Validate the whole policy before normalizing; dropping a field can weaken a match. */
11
+ export declare function parseEntityResolutionPolicy(value: unknown): EntityResolutionRule[];
2
12
  /** Derived-entity backing: a read-only SQL view. */
3
13
  export declare const BackingInputSchema: import("@sinclair/typebox").TObject<{
4
14
  sql: import("@sinclair/typebox").TString;
@@ -28,6 +38,7 @@ export declare const ManageEntitySchemaSchema: import("@sinclair/typebox").TObje
28
38
  }>]>>;
29
39
  metrics_config: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNull, import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>]>>;
30
40
  rules_source: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNull, import("@sinclair/typebox").TString]>>;
41
+ purpose: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<"identity">>;
31
42
  is_symmetric: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
32
43
  inverse_type_slug: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
33
44
  status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"active">, import("@sinclair/typebox").TLiteral<"archived">]>>;