@lobu/runtime-device 21.2.1 → 22.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 (196) 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/commands/_lib/apply/apply-cmd.js +5 -6
  6. package/vendor/cli/dist/commands/_lib/apply/client.d.ts +1 -0
  7. package/vendor/cli/dist/commands/_lib/apply/client.js +26 -7
  8. package/vendor/cli/dist/commands/_lib/apply/desired-state.d.ts +9 -1
  9. package/vendor/cli/dist/commands/_lib/apply/diff.d.ts +1 -0
  10. package/vendor/cli/dist/commands/_lib/apply/diff.js +46 -4
  11. package/vendor/cli/dist/commands/_lib/apply/map-config.js +18 -38
  12. package/vendor/cli/dist/commands/_lib/init-from-org/bootstrap.js +5 -17
  13. package/vendor/cli/dist/commands/init.d.ts +0 -2
  14. package/vendor/cli/dist/commands/init.js +0 -27
  15. package/vendor/cli/dist/commands/login.d.ts +17 -0
  16. package/vendor/cli/dist/commands/login.js +43 -17
  17. package/vendor/cli/dist/commands/memory/_lib/errors.d.ts +0 -8
  18. package/vendor/cli/dist/commands/memory/_lib/errors.js +0 -12
  19. package/vendor/cli/dist/commands/memory/_lib/mcp.js +6 -6
  20. package/vendor/cli/dist/commands/memory/_lib/seed-cmd.js +4 -10
  21. package/vendor/cli/dist/config/define.d.ts +21 -15
  22. package/vendor/cli/dist/config/define.js +2 -2
  23. package/vendor/cli/dist/connectors/README.md +7 -5
  24. package/vendor/cli/dist/connectors/_google/actions.ts +270 -0
  25. package/vendor/cli/dist/connectors/_google/discovery/calendar_v3.json +1 -0
  26. package/vendor/cli/dist/connectors/_google/discovery/chat_v1.json +1 -0
  27. package/vendor/cli/dist/connectors/_google/discovery/docs_v1.json +1 -0
  28. package/vendor/cli/dist/connectors/_google/discovery/drive_v3.json +1 -0
  29. package/vendor/cli/dist/connectors/_google/discovery/gmail_v1.json +1 -0
  30. package/vendor/cli/dist/connectors/_google/discovery/people_v1.json +1 -0
  31. package/vendor/cli/dist/connectors/_google/discovery/sheets_v4.json +1 -0
  32. package/vendor/cli/dist/connectors/_google/discovery/tasks_v1.json +1 -0
  33. package/vendor/cli/dist/connectors/_google/discovery/youtube_v3.json +1 -0
  34. package/vendor/cli/dist/connectors/_google/discovery.ts +442 -0
  35. package/vendor/cli/dist/connectors/_google/errors.ts +91 -0
  36. package/vendor/cli/dist/connectors/_google/list-feed.ts +223 -0
  37. package/vendor/cli/dist/connectors/_google/policies.ts +127 -0
  38. package/vendor/cli/dist/connectors/agentid.ts +43 -0
  39. package/vendor/cli/dist/connectors/chat-user-identity.ts +2 -1
  40. package/vendor/cli/dist/connectors/github-automation-events.ts +9 -0
  41. package/vendor/cli/dist/connectors/github-identity.ts +28 -3
  42. package/vendor/cli/dist/connectors/github.ts +101 -59
  43. package/vendor/cli/dist/connectors/google_calendar.ts +207 -719
  44. package/vendor/cli/dist/connectors/google_drive.ts +16 -2
  45. package/vendor/cli/dist/connectors/google_gmail.ts +51 -33
  46. package/vendor/cli/dist/connectors/herdr.ts +406 -0
  47. package/vendor/cli/dist/connectors/jira.ts +6 -6
  48. package/vendor/cli/dist/connectors/linear.ts +7 -4
  49. package/vendor/cli/dist/connectors/postgres.ts +27 -2
  50. package/vendor/cli/dist/connectors/tiktok-inbox-page.js +230 -0
  51. package/vendor/cli/dist/connectors/tiktok-web-page.js +211 -0
  52. package/vendor/cli/dist/connectors/tiktok_web.ts +286 -0
  53. package/vendor/cli/dist/connectors/whatsapp-web-adapter.js +228 -10
  54. package/vendor/cli/dist/connectors/whatsapp-web-helpers.ts +47 -14
  55. package/vendor/cli/dist/connectors/whatsapp-web-identity.ts +121 -0
  56. package/vendor/cli/dist/connectors/whatsapp_web.ts +170 -29
  57. package/vendor/cli/dist/connectors/x.ts +276 -136
  58. package/vendor/cli/dist/index.js +1 -37
  59. package/vendor/cli/dist/internal/context.d.ts +10 -0
  60. package/vendor/cli/dist/internal/context.js +26 -16
  61. package/vendor/cli/dist/internal/node-version.d.ts +1 -1
  62. package/vendor/cli/dist/internal/node-version.js +1 -1
  63. package/vendor/cli/dist/internal/oauth.d.ts +3 -1
  64. package/vendor/cli/dist/internal/oauth.js +4 -3
  65. package/vendor/cli/dist/internal/runtime-components.d.ts +9 -0
  66. package/vendor/cli/dist/internal/runtime-components.js +67 -2
  67. package/vendor/cli/dist/mac-auth.js +17 -1
  68. package/vendor/cli/dist/providers.json +1 -1
  69. package/vendor/cli/dist/runtime-components.json +4 -4
  70. package/vendor/cli/dist/templates/AGENTS.md.tmpl +11 -4
  71. package/vendor/cli/dist/templates/README.md.tmpl +1 -1
  72. package/vendor/cli/dist/vendor/ora/.bun-tag-fde20e9a6df212fa +0 -0
  73. package/vendor/cli/dist/vendor/ora/index.d.ts +332 -0
  74. package/vendor/cli/dist/vendor/ora/index.js +424 -0
  75. package/vendor/cli/dist/vendor/ora/license +9 -0
  76. package/vendor/cli/dist/vendor/ora/package.json +64 -0
  77. package/vendor/cli/dist/vendor/ora/readme.md +329 -0
  78. package/vendor/cli/package.json +2 -2
  79. package/vendor/connector-sdk/dist/browser-requirement.d.ts +36 -0
  80. package/vendor/connector-sdk/dist/browser-requirement.js +60 -0
  81. package/vendor/connector-sdk/dist/connector-runtime.d.ts +3 -1
  82. package/vendor/connector-sdk/dist/connector-runtime.js +10 -0
  83. package/vendor/connector-sdk/dist/connector-types.d.ts +159 -45
  84. package/vendor/connector-sdk/dist/define-connector.d.ts +4 -2
  85. package/vendor/connector-sdk/dist/define-connector.js +3 -0
  86. package/vendor/connector-sdk/dist/index.d.ts +5 -2
  87. package/vendor/connector-sdk/dist/index.js +1 -0
  88. package/vendor/connector-sdk/dist/reaction-client-types.d.ts +16 -21
  89. package/vendor/connector-sdk/dist/reaction-client-types.typecheck.d.ts +5 -0
  90. package/vendor/connector-sdk/package.json +5 -1
  91. package/vendor/connector-worker/dist/agent-turn/guest-entry.js +31 -27
  92. package/vendor/connector-worker/dist/agent-turn/guest.bundle.js +131 -185
  93. package/vendor/connector-worker/dist/agent-turn/memory.d.ts +3 -2
  94. package/vendor/connector-worker/dist/agent-turn/memory.js +3 -20
  95. package/vendor/connector-worker/dist/agent-turn/types.d.ts +3 -15
  96. package/vendor/connector-worker/dist/agent-turn/workspace.d.ts +2 -2
  97. package/vendor/connector-worker/dist/agent-turn/workspace.js +2 -4
  98. package/vendor/connector-worker/dist/daemon/action-monitor.d.ts +12 -0
  99. package/vendor/connector-worker/dist/daemon/action-monitor.js +25 -0
  100. package/vendor/connector-worker/dist/daemon/agent-turn.js +0 -9
  101. package/vendor/connector-worker/dist/daemon/builtins/index.d.ts +12 -0
  102. package/vendor/connector-worker/dist/daemon/builtins/index.js +61 -1
  103. package/vendor/connector-worker/dist/daemon/builtins/os-shell.d.ts +2 -1
  104. package/vendor/connector-worker/dist/daemon/builtins/os-shell.js +40 -27
  105. package/vendor/connector-worker/dist/daemon/client.d.ts +5 -1
  106. package/vendor/connector-worker/dist/daemon/client.js +3 -0
  107. package/vendor/connector-worker/dist/daemon/device-concurrency.d.ts +8 -0
  108. package/vendor/connector-worker/dist/daemon/device-concurrency.js +13 -0
  109. package/vendor/connector-worker/dist/daemon/executor.d.ts +1 -1
  110. package/vendor/connector-worker/dist/daemon/executor.js +48 -117
  111. package/vendor/connector-worker/dist/daemon/log.d.ts +2 -0
  112. package/vendor/connector-worker/dist/daemon/log.js +23 -2
  113. package/vendor/connector-worker/dist/daemon/mac-device-daemon.d.ts +20 -4
  114. package/vendor/connector-worker/dist/daemon/mac-device-daemon.js +53 -13
  115. package/vendor/connector-worker/dist/daemon/native-bridge/client.d.ts +6 -0
  116. package/vendor/connector-worker/dist/daemon/native-bridge/client.js +15 -0
  117. package/vendor/connector-worker/dist/daemon/native-bridge/executor.js +2 -0
  118. package/vendor/connector-worker/dist/daemon/native-bridge/protocol.d.ts +1 -1
  119. package/vendor/connector-worker/dist/daemon/native-bridge/protocol.js +1 -0
  120. package/vendor/connector-worker/dist/daemon/poll-loop.d.ts +3 -0
  121. package/vendor/connector-worker/dist/daemon/poll-loop.js +5 -1
  122. package/vendor/connector-worker/dist/daemon/start.d.ts +1 -0
  123. package/vendor/connector-worker/dist/daemon/start.js +12 -5
  124. package/vendor/connector-worker/dist/executor/interface.d.ts +34 -2
  125. package/vendor/connector-worker/dist/executor/isolate.js +66 -15
  126. package/vendor/connector-worker/dist/executor/redact.d.ts +1 -0
  127. package/vendor/connector-worker/dist/executor/redact.js +97 -26
  128. package/vendor/connector-worker/dist/executor/runtime.d.ts +7 -0
  129. package/vendor/connector-worker/dist/executor/runtime.js +26 -0
  130. package/vendor/connector-worker/dist/isolate/bridge.js +3 -1
  131. package/vendor/connector-worker/dist/mac-device-daemon.js +10 -3
  132. package/vendor/connector-worker/package.json +2 -2
  133. package/vendor/core/dist/agent-policy.js +1 -1
  134. package/vendor/core/dist/agent-store.d.ts +2 -0
  135. package/vendor/core/dist/agent-tooling.d.ts +1 -1
  136. package/vendor/core/dist/agent-tooling.js +1 -1
  137. package/vendor/core/dist/capabilities.js +2 -0
  138. package/vendor/core/dist/contracts/agent-settings.d.ts +0 -11
  139. package/vendor/core/dist/contracts/agent-settings.js +1 -7
  140. package/vendor/core/dist/contracts/tools/collection-presentation.d.ts +93 -0
  141. package/vendor/core/dist/contracts/tools/collection-presentation.js +88 -0
  142. package/vendor/core/dist/contracts/tools/collection-selection.d.ts +47 -0
  143. package/vendor/core/dist/contracts/tools/collection-selection.js +74 -0
  144. package/vendor/core/dist/contracts/tools/manage-agents.d.ts +10 -4
  145. package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +1 -1
  146. package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +5 -1
  147. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +19 -4
  148. package/vendor/core/dist/contracts/tools/manage-automations.js +25 -8
  149. package/vendor/core/dist/contracts/tools/manage-connections.d.ts +1 -0
  150. package/vendor/core/dist/contracts/tools/manage-connections.js +3 -0
  151. package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +11 -0
  152. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +42 -3
  153. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +181 -152
  154. package/vendor/core/dist/contracts/tools/manage-entity.js +118 -162
  155. package/vendor/core/dist/contracts/tools/manage-operations.d.ts +41 -3
  156. package/vendor/core/dist/contracts/tools/manage-operations.js +40 -2
  157. package/vendor/core/dist/contracts/tools/manage-views.d.ts +182 -7
  158. package/vendor/core/dist/contracts/tools/manage-views.js +49 -13
  159. package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +11 -2
  160. package/vendor/core/dist/contracts/tools/read-knowledge.js +23 -3
  161. package/vendor/core/dist/contracts/tools/save-memory.d.ts +3 -6
  162. package/vendor/core/dist/contracts/tools/save-memory.js +2 -6
  163. package/vendor/core/dist/contracts/tools/view-attach.d.ts +2 -1
  164. package/vendor/core/dist/contracts/tools/view-attach.js +7 -2
  165. package/vendor/core/dist/contracts/worker/protocol.d.ts +122 -28
  166. package/vendor/core/dist/contracts/worker/protocol.js +81 -17
  167. package/vendor/core/dist/index.d.ts +3 -4
  168. package/vendor/core/dist/index.js +3 -6
  169. package/vendor/core/dist/json-template.d.ts +6 -10
  170. package/vendor/core/dist/json-template.js +5 -9
  171. package/vendor/core/dist/logger.js +11 -5
  172. package/vendor/core/dist/shell-safety.d.ts +9 -0
  173. package/vendor/core/dist/shell-safety.js +154 -0
  174. package/vendor/core/dist/suggestions.d.ts +1 -1
  175. package/vendor/core/dist/suggestions.js +1 -1
  176. package/vendor/core/dist/tool-trace-summary.d.ts +1 -1
  177. package/vendor/core/dist/tool-trace-summary.js +1 -1
  178. package/vendor/core/dist/types.d.ts +1 -3
  179. package/vendor/core/dist/utils/diagnostic-scrubber.d.ts +7 -0
  180. package/vendor/core/dist/utils/{sentry-scrubber.js → diagnostic-scrubber.js} +25 -53
  181. package/vendor/core/dist/worker/auth.d.ts +44 -6
  182. package/vendor/core/dist/worker/auth.js +44 -11
  183. package/vendor/core/package.json +15 -6
  184. package/vendor/ora/.bun-tag-fde20e9a6df212fa +0 -0
  185. package/vendor/ora/index.d.ts +332 -0
  186. package/vendor/ora/index.js +424 -0
  187. package/vendor/ora/license +9 -0
  188. package/vendor/ora/package.json +53 -0
  189. package/vendor/ora/readme.md +329 -0
  190. package/vendor/cli/dist/commands/telemetry.d.ts +0 -10
  191. package/vendor/cli/dist/commands/telemetry.js +0 -66
  192. package/vendor/core/dist/sentry.d.ts +0 -26
  193. package/vendor/core/dist/sentry.js +0 -133
  194. package/vendor/core/dist/tool-policy.d.ts +0 -74
  195. package/vendor/core/dist/tool-policy.js +0 -305
  196. package/vendor/core/dist/utils/sentry-scrubber.d.ts +0 -29
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ManageEntityResultSchema = exports.ManageEntityItemSchema = exports.RelationshipCountByTypeSchema = exports.RelationshipRowSchema = exports.ManageEntitySchema = exports.UnmergeEntityAction = exports.ResolveDuplicatesAction = exports.MergeEntitiesAction = exports.ListLinksAction = exports.UpdateLinkAction = exports.UnlinkEntitiesAction = exports.LinkEntitiesAction = exports.DeleteEntityAction = exports.GetEntityAction = exports.ListEntitiesAction = exports.UpdateEntityAction = exports.CreateEntityAction = void 0;
3
+ exports.ManageEntityResultSchema = exports.ManageEntityItemSchema = exports.EntityIdentitySchema = exports.RelationshipCountByTypeSchema = exports.RelationshipRowSchema = exports.ManageEntitySchema = exports.DiscoverDuplicatesAction = exports.ListLinksAction = exports.UpdateLinkAction = exports.UnlinkEntitiesAction = exports.LinkEntitiesAction = exports.DeleteEntityAction = exports.GetEntityAction = exports.ListEntitiesAction = exports.UpdateEntityAction = exports.CreateEntityAction = void 0;
4
4
  const typebox_1 = require("@sinclair/typebox");
5
5
  const interaction_envelope_1 = require("../interaction-envelope");
6
+ const collection_selection_1 = require("./collection-selection");
6
7
  const pagination_1 = require("./pagination");
7
8
  function SortOrderField(description) {
8
9
  return typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Literal("asc"), typebox_1.Type.Literal("desc")], { description }));
@@ -17,11 +18,12 @@ function SortOrderField(description) {
17
18
  const EntityType = typebox_1.Type.String({
18
19
  description: "Entity type as defined in your workspace",
19
20
  });
20
- const EntityId = typebox_1.Type.Number({
21
- description: "[get/update/delete/list_links/merge/unmerge] Entity ID to operate on",
21
+ const EntityId = typebox_1.Type.Integer({
22
+ minimum: 1,
23
+ description: "[get/update/delete/list_links] Entity ID to operate on",
22
24
  });
23
25
  // Attributes an entity carries. `create` and `update` share the set; `list`
24
- // filters on `parent_id`, `category`, `main_market` and `market`.
26
+ // filters on `parent_id` and schema-declared metadata using `filters`.
25
27
  const EntityFields = {
26
28
  name: typebox_1.Type.String({
27
29
  description: "[create/update] Entity name",
@@ -37,32 +39,17 @@ const EntityFields = {
37
39
  parent_id: typebox_1.Type.Number({
38
40
  description: "[create/update] Parent entity ID (for hierarchical entities).",
39
41
  }),
40
- domain: typebox_1.Type.String({
41
- description: "[create/update] Primary domain (e.g., spotify.com)",
42
- }),
43
- category: typebox_1.Type.String({
44
- description: "[create/update/list] Industry category",
45
- }),
46
- platform_type: typebox_1.Type.String({
47
- description: "[create/update] Platform type (b2b, b2c, b2b2c)",
48
- }),
49
- main_market: typebox_1.Type.String({
50
- description: "[create/update/list] Primary market (ISO 3166-1 alpha-2)",
51
- }),
52
- market: typebox_1.Type.String({
53
- description: "[create/update/list] Market/region (ISO 3166-1 alpha-2)",
54
- }),
55
- link: typebox_1.Type.String({ description: "[create/update] Entity URL" }),
56
42
  };
57
43
  // Custom metadata (validated against entity type's JSON schema)
58
44
  const Metadata = typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown(), {
59
45
  description: "[create/update/link/update_link] Custom metadata object. For entities: validated against the entity type's JSON schema. For links: relationship metadata. On update, fields a human owns are NOT overwritten — they are queued for the human's approval and reported in the result's `blocked_fields`/`approval_queued`; tell the user you PROPOSED those changes rather than claiming you set them. Unowned fields in the same call apply directly (`applied_fields`).",
60
46
  });
61
47
  // Carried by exactly the variants whose handler reads it: the principal seam
62
- // (`create`, `update`, `list`, `delete`, `merge`), the read gate that consults
63
- // it (`list_links`), and reaction tracking (`link`). `get` resolves its read
64
- // gate without one, and `unlink`/`update_link`/`resolve_duplicates`/`unmerge`
65
- // never consult it — declaring it there would advertise an inert field.
48
+ // (`create`, `update`, `list`, `delete`), the read gate that consults
49
+ // it (`list_links`), and reaction tracking (`link`). `get` and
50
+ // `discover_duplicates` resolve their read gate without one, and
51
+ // `unlink`/`update_link` never consult it —
52
+ // declaring it there would advertise an inert field.
66
53
  const AutomationSource = typebox_1.Type.Object({
67
54
  automation_id: typebox_1.Type.Number({
68
55
  description: "Automation that triggered this mutation",
@@ -74,7 +61,7 @@ const AutomationSource = typebox_1.Type.Object({
74
61
  description: "Attribution source when mutation is triggered by an Automation reaction",
75
62
  });
76
63
  const DryRun = typebox_1.Type.Boolean({
77
- description: "[delete, merge] Preflight only. For delete: report what it would remove/detach. For merge: report whether the type's write rules would refuse it. Mutates nothing and never queues an approval.",
64
+ description: "[delete, identity link/unlink] Preflight only. For delete: report what it would remove/detach. For identity link/unlink: preview apply, human review, rejected-candidate suppression, or refusal using current policy and write rules. Mutates nothing and never queues an approval.",
78
65
  });
79
66
  const IncludeDeleted = typebox_1.Type.Boolean({
80
67
  description: "[get] Return the entity even if it is soft-deleted (deleted_at set). [list_links] Include soft-deleted relationships.",
@@ -119,12 +106,6 @@ exports.CreateEntityAction = typebox_1.Type.Object({
119
106
  content: typebox_1.Type.Optional(EntityFields.content),
120
107
  slug: typebox_1.Type.Optional(EntityFields.slug),
121
108
  parent_id: typebox_1.Type.Optional(EntityFields.parent_id),
122
- domain: typebox_1.Type.Optional(EntityFields.domain),
123
- category: typebox_1.Type.Optional(EntityFields.category),
124
- platform_type: typebox_1.Type.Optional(EntityFields.platform_type),
125
- main_market: typebox_1.Type.Optional(EntityFields.main_market),
126
- market: typebox_1.Type.Optional(EntityFields.market),
127
- link: typebox_1.Type.Optional(EntityFields.link),
128
109
  metadata: typebox_1.Type.Optional(Metadata),
129
110
  automation_source: typebox_1.Type.Optional(AutomationSource),
130
111
  });
@@ -137,12 +118,6 @@ exports.UpdateEntityAction = typebox_1.Type.Object({
137
118
  content: typebox_1.Type.Optional(EntityFields.content),
138
119
  slug: typebox_1.Type.Optional(EntityFields.slug),
139
120
  parent_id: typebox_1.Type.Optional(EntityFields.parent_id),
140
- domain: typebox_1.Type.Optional(EntityFields.domain),
141
- category: typebox_1.Type.Optional(EntityFields.category),
142
- platform_type: typebox_1.Type.Optional(EntityFields.platform_type),
143
- main_market: typebox_1.Type.Optional(EntityFields.main_market),
144
- market: typebox_1.Type.Optional(EntityFields.market),
145
- link: typebox_1.Type.Optional(EntityFields.link),
146
121
  metadata: typebox_1.Type.Optional(Metadata),
147
122
  // Human-correction annotation
148
123
  field_note: typebox_1.Type.Optional(typebox_1.Type.String({
@@ -159,13 +134,14 @@ exports.ListEntitiesAction = typebox_1.Type.Object({
159
134
  description: "Paginated entity list with filters.",
160
135
  }),
161
136
  entity_type: typebox_1.Type.Optional(EntityType),
137
+ filters: typebox_1.Type.Optional(collection_selection_1.AttributeFiltersSchema),
162
138
  parent_id: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Number(), typebox_1.Type.Null()], {
163
139
  description: "[list] Parent filter: omit for all entities, null for roots, or an ID for that parent's children.",
164
140
  })),
165
141
  search: typebox_1.Type.Optional(typebox_1.Type.String({ description: "[list] Search by name" })),
166
- category: typebox_1.Type.Optional(EntityFields.category),
167
- main_market: typebox_1.Type.Optional(EntityFields.main_market),
168
- market: typebox_1.Type.Optional(EntityFields.market),
142
+ segment: typebox_1.Type.Optional(typebox_1.Type.String({
143
+ description: "[list] Name of an on:'entity' segment declared on entity_type (metrics_config.segments). Narrows the list to entities matching its predicate. Requires entity_type.",
144
+ })),
169
145
  ...(0, pagination_1.paginationFields)(100),
170
146
  sort_by: typebox_1.Type.Optional(typebox_1.Type.String({
171
147
  description: "[list] Sort by column (name, created_at, domain, total_content, active_connections, automations_count, children_count)",
@@ -189,7 +165,37 @@ exports.DeleteEntityAction = typebox_1.Type.Object({
189
165
  dry_run: typebox_1.Type.Optional(DryRun),
190
166
  automation_source: typebox_1.Type.Optional(AutomationSource),
191
167
  });
168
+ const IdentityPreview = typebox_1.Type.Object({
169
+ outcome: typebox_1.Type.Union([
170
+ typebox_1.Type.Literal("apply"),
171
+ typebox_1.Type.Literal("review"),
172
+ typebox_1.Type.Literal("suppressed"),
173
+ typebox_1.Type.Literal("refused"),
174
+ ]),
175
+ reason: typebox_1.Type.String(),
176
+ });
177
+ function IdentityDecisionResults(action) {
178
+ return [
179
+ typebox_1.Type.Object({
180
+ action: typebox_1.Type.Literal(action),
181
+ dry_run: typebox_1.Type.Literal(true),
182
+ preview: IdentityPreview,
183
+ }, { additionalProperties: false }),
184
+ typebox_1.Type.Object({
185
+ action: typebox_1.Type.Literal(action),
186
+ approval_queued: typebox_1.Type.Literal(true),
187
+ approval_run_id: typebox_1.Type.Integer({ minimum: 1 }),
188
+ approval_url: typebox_1.Type.Optional(typebox_1.Type.String()),
189
+ }, { additionalProperties: false }),
190
+ typebox_1.Type.Object({
191
+ action: typebox_1.Type.Literal(action),
192
+ approval_suppressed: typebox_1.Type.Literal(true),
193
+ message: typebox_1.Type.String(),
194
+ }, { additionalProperties: false }),
195
+ ];
196
+ }
192
197
  exports.LinkEntitiesAction = typebox_1.Type.Object({
198
+ dry_run: typebox_1.Type.Optional(DryRun),
193
199
  action: typebox_1.Type.Literal("link", {
194
200
  description: "Create a relationship edge between two entities.",
195
201
  }),
@@ -202,6 +208,8 @@ exports.LinkEntitiesAction = typebox_1.Type.Object({
202
208
  automation_source: typebox_1.Type.Optional(AutomationSource),
203
209
  });
204
210
  exports.UnlinkEntitiesAction = typebox_1.Type.Object({
211
+ dry_run: typebox_1.Type.Optional(DryRun),
212
+ automation_source: typebox_1.Type.Optional(AutomationSource),
205
213
  action: typebox_1.Type.Literal("unlink", {
206
214
  description: "Soft-delete a relationship.",
207
215
  }),
@@ -226,7 +234,13 @@ exports.ListLinksAction = typebox_1.Type.Object({
226
234
  action: typebox_1.Type.Literal("list_links", {
227
235
  description: "List relationships for an entity with filters + counts.",
228
236
  }),
229
- entity_id: EntityId,
237
+ entity_id: typebox_1.Type.Optional(EntityId),
238
+ record: typebox_1.Type.Optional(typebox_1.Type.Object({
239
+ type: typebox_1.Type.String({ minLength: 1 }),
240
+ key: typebox_1.Type.String({ minLength: 1 }),
241
+ }, {
242
+ description: "[list_links] A record of a source-backed entity type, instead of entity_id. Its relationships are read live from the event kinds that declare them; stores nothing.",
243
+ })),
230
244
  direction: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Literal("outbound"), typebox_1.Type.Literal("inbound"), typebox_1.Type.Literal("both")], { description: "[list_links] Direction filter. Default both." })),
231
245
  relationship_type_slug: typebox_1.Type.Optional(EdgeEndpoints.relationship_type_slug),
232
246
  confidence_min: typebox_1.Type.Optional(typebox_1.Type.Number({
@@ -237,54 +251,26 @@ exports.ListLinksAction = typebox_1.Type.Object({
237
251
  source: typebox_1.Type.Optional(RelationshipSource),
238
252
  include_deleted: typebox_1.Type.Optional(IncludeDeleted),
239
253
  ...(0, pagination_1.paginationFields)(100),
254
+ cursor: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String({ minLength: 1, maxLength: 65536 }), typebox_1.Type.Null()], {
255
+ description: "[list_links, record only] Omit or pass null for the first bounded page, then pass next_cursor until it is null. Stop automatic pagination on record_failures; the cursor retains failed sources for an explicit retry. Pages may be short or empty while next_cursor exists. Merge repeated links across pages by (relationship_type, direction, entity_type, key), keeping the newest occurred_at. Stored entity_id calls retain limit/offset pagination.",
256
+ })),
240
257
  automation_source: typebox_1.Type.Optional(AutomationSource),
241
258
  });
242
- exports.MergeEntitiesAction = typebox_1.Type.Object({
243
- action: typebox_1.Type.Literal("merge", {
244
- description: "Fold a duplicate entity (entity_id) into the one it really is (winner_entity_id). The loser is tombstoned + forwarded; its identities, aliases, edges, and events recall against the winner. Events are never rewritten. Use when two entities are confirmed the same real-world thing.",
245
- }),
246
- // Merge target (the survivor) — the loser is passed as `entity_id`.
247
- winner_entity_id: typebox_1.Type.Number({
248
- description: "[merge] The surviving entity that absorbs `entity_id` (the duplicate).",
259
+ exports.DiscoverDuplicatesAction = typebox_1.Type.Object({
260
+ action: typebox_1.Type.Literal("discover_duplicates", {
261
+ description: "Read whole duplicate components across all live entities of one type. Current-state sweep: changes behind the cursor are reconsidered next sweep. Writes nothing.",
249
262
  }),
250
- entity_id: typebox_1.Type.Optional(EntityId),
251
- duplicate_entity_ids: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Number(), {
252
- minItems: 1,
253
- maxItems: 25,
254
- uniqueItems: true,
255
- description: "[merge] All duplicate entities to fold into winner_entity_id. Use this for a duplicate group; entity_id remains supported for a single duplicate.",
256
- })),
257
- merge_evidence: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
258
- kind: typebox_1.Type.String({ maxLength: 64 }),
259
- identifier: typebox_1.Type.String({ maxLength: 512 }),
260
- identity_ids: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Number(), { maxItems: 50 })),
261
- }), {
262
- maxItems: 25,
263
- description: "[merge] Optional structured evidence for human-initiated merge provenance. Agent and Automation evidence is always recomputed from the entity type's resolution policy.",
263
+ entity_type: EntityType,
264
+ limit: typebox_1.Type.Optional(typebox_1.Type.Integer({
265
+ minimum: 1,
266
+ maximum: 100,
267
+ default: 50,
268
+ description: "[discover_duplicates] Maximum whole components per page; also bounded to 199 proposed decisions.",
264
269
  })),
265
- merge_rationale: typebox_1.Type.Optional(typebox_1.Type.String({
266
- maxLength: 500,
267
- description: "[merge] Why you believe these are the same thing, in one sentence, for the human reviewing the approval card (e.g. 'Same phone digits; the shell is a WhatsApp handle for this contact.'). Shown as your claim, clearly separated from the workspace's own policy verdict — it never counts as proof and never affects whether the merge auto-applies.",
270
+ cursor: typebox_1.Type.Optional(typebox_1.Type.String({
271
+ maxLength: 2048,
272
+ description: "[discover_duplicates] Opaque continuation from the preceding page, scoped to this workspace and entity type.",
268
273
  })),
269
- dry_run: typebox_1.Type.Optional(DryRun),
270
- automation_source: typebox_1.Type.Optional(AutomationSource),
271
- });
272
- exports.ResolveDuplicatesAction = typebox_1.Type.Object({
273
- action: typebox_1.Type.Literal("resolve_duplicates", {
274
- description: "Discover duplicate components among candidate_entity_ids using the entity type's x-lobu-resolution policy, then auto-merge deterministic matches or queue review.",
275
- }),
276
- candidate_entity_ids: typebox_1.Type.Array(typebox_1.Type.Integer({ minimum: 1 }), {
277
- minItems: 2,
278
- maxItems: 5000,
279
- uniqueItems: true,
280
- description: "[resolve_duplicates] Candidate entity IDs. The server re-reads their values and applies the entity type's resolution policy.",
281
- }),
282
- });
283
- exports.UnmergeEntityAction = typebox_1.Type.Object({
284
- action: typebox_1.Type.Literal("unmerge", {
285
- description: "Reverse a merge from its durable ledger: restore the loser's identities, canonical attributes, and relationships, then un-tombstone it. Fails closed if later edits made exact reversal unsafe.",
286
- }),
287
- entity_id: EntityId,
288
274
  });
289
275
  exports.ManageEntitySchema = typebox_1.Type.Union([
290
276
  exports.CreateEntityAction,
@@ -296,9 +282,7 @@ exports.ManageEntitySchema = typebox_1.Type.Union([
296
282
  exports.UnlinkEntitiesAction,
297
283
  exports.UpdateLinkAction,
298
284
  exports.ListLinksAction,
299
- exports.MergeEntitiesAction,
300
- exports.ResolveDuplicatesAction,
301
- exports.UnmergeEntityAction,
285
+ exports.DiscoverDuplicatesAction,
302
286
  ]);
303
287
  // ============================================
304
288
  // Result Types
@@ -345,6 +329,15 @@ exports.RelationshipCountByTypeSchema = typebox_1.Type.Object({
345
329
  relationship_type_name: typebox_1.Type.String(),
346
330
  count: typebox_1.Type.Integer(),
347
331
  });
332
+ /** Server-derived grouping. Persist record IDs; the representative can change. */
333
+ exports.EntityIdentitySchema = typebox_1.Type.Object({
334
+ root_id: typebox_1.Type.Integer({ minimum: 1 }),
335
+ member_ids: typebox_1.Type.Array(typebox_1.Type.Integer({ minimum: 1 }), {
336
+ minItems: 1,
337
+ maxItems: 26,
338
+ uniqueItems: true,
339
+ }),
340
+ });
348
341
  /**
349
342
  * Shared entity shape across the create/update/get/list variants (the superset
350
343
  * of fields; each variant marks its extras optional). `metadata` and the
@@ -353,6 +346,7 @@ exports.RelationshipCountByTypeSchema = typebox_1.Type.Object({
353
346
  */
354
347
  exports.ManageEntityItemSchema = typebox_1.Type.Object({
355
348
  id: typebox_1.Type.Integer(),
349
+ identity: typebox_1.Type.Optional(exports.EntityIdentitySchema),
356
350
  entity_type: typebox_1.Type.String(),
357
351
  name: typebox_1.Type.String(),
358
352
  slug: typebox_1.Type.String(),
@@ -467,18 +461,34 @@ exports.ManageEntityResultSchema = typebox_1.Type.Union([
467
461
  approval_current: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown())),
468
462
  approval_attribution: typebox_1.Type.Optional(interaction_envelope_1.ApprovalAttributionSchema),
469
463
  }),
470
- typebox_1.Type.Object({
471
- action: typebox_1.Type.Literal("link"),
472
- relationship: exports.RelationshipRowSchema,
473
- }),
464
+ ...IdentityDecisionResults("link"),
465
+ typebox_1.Type.Object({ action: typebox_1.Type.Literal("link"), relationship: exports.RelationshipRowSchema }, { additionalProperties: false }),
474
466
  typebox_1.Type.Object({
475
467
  action: typebox_1.Type.Literal("update_link"),
476
468
  relationship: exports.RelationshipRowSchema,
477
469
  }),
470
+ ...IdentityDecisionResults("unlink"),
478
471
  typebox_1.Type.Object({
479
472
  action: typebox_1.Type.Literal("unlink"),
480
- success: typebox_1.Type.Boolean(),
473
+ success: typebox_1.Type.Literal(true),
481
474
  message: typebox_1.Type.String(),
475
+ }, { additionalProperties: false }),
476
+ typebox_1.Type.Object({
477
+ action: typebox_1.Type.Literal("list_links"),
478
+ record_links: typebox_1.Type.Array(typebox_1.Type.Object({
479
+ relationship_type: typebox_1.Type.String(),
480
+ direction: typebox_1.Type.Union([
481
+ typebox_1.Type.Literal("outgoing"),
482
+ typebox_1.Type.Literal("incoming"),
483
+ ]),
484
+ entity_type: typebox_1.Type.String(),
485
+ key: typebox_1.Type.String(),
486
+ name: typebox_1.Type.String(),
487
+ occurred_at: typebox_1.Type.String(),
488
+ source_url: typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
489
+ })),
490
+ record_failures: typebox_1.Type.Array(typebox_1.Type.Object({ feed_id: typebox_1.Type.Integer(), error: typebox_1.Type.String() })),
491
+ next_cursor: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
482
492
  }),
483
493
  typebox_1.Type.Object({
484
494
  action: typebox_1.Type.Literal("list_links"),
@@ -491,78 +501,24 @@ exports.ManageEntityResultSchema = typebox_1.Type.Union([
491
501
  has_more: typebox_1.Type.Boolean(),
492
502
  }),
493
503
  }),
494
- typebox_1.Type.Union([
495
- typebox_1.Type.Object({
496
- action: typebox_1.Type.Literal("merge"),
497
- success: typebox_1.Type.Boolean(),
498
- message: typebox_1.Type.String(),
499
- winner_entity_id: typebox_1.Type.Integer(),
500
- loser_entity_id: typebox_1.Type.Integer(),
501
- loser_entity_ids: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Integer())),
502
- moved_identities: typebox_1.Type.Integer(),
503
- repointed_edges: typebox_1.Type.Integer(),
504
- // Preflight only. A dry run reports the rule verdict and writes nothing,
505
- // so moved_identities/repointed_edges are 0 and mean "not attempted".
506
- dry_run: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
507
- resolution: typebox_1.Type.Optional(typebox_1.Type.Object({
508
- decision: typebox_1.Type.Union([
509
- typebox_1.Type.Literal("auto_merge"),
510
- typebox_1.Type.Literal("human"),
511
- ]),
512
- reason: typebox_1.Type.String(),
513
- evidence: typebox_1.Type.Array(typebox_1.Type.Object({ kind: typebox_1.Type.String(), identifier: typebox_1.Type.String() })),
514
- })),
515
- }),
516
- typebox_1.Type.Object({
517
- action: typebox_1.Type.Literal("merge"),
518
- approval_queued: typebox_1.Type.Literal(true),
519
- approval_url: typebox_1.Type.Optional(typebox_1.Type.String()),
520
- approval_run_id: typebox_1.Type.Integer(),
521
- approval_action: typebox_1.Type.Literal("merge"),
522
- approval_proposal: typebox_1.Type.Object({
523
- entity_id: typebox_1.Type.Integer(),
524
- entity_ids: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Integer())),
525
- winner_entity_id: typebox_1.Type.Integer(),
526
- }),
527
- approval_attribution: interaction_envelope_1.ApprovalAttributionSchema,
528
- next_steps: typebox_1.Type.Array(typebox_1.Type.String()),
529
- resolution: typebox_1.Type.Optional(typebox_1.Type.Object({
530
- decision: typebox_1.Type.Literal("review"),
531
- reason: typebox_1.Type.String(),
532
- evidence: typebox_1.Type.Array(typebox_1.Type.Object({ kind: typebox_1.Type.String(), identifier: typebox_1.Type.String() })),
533
- })),
534
- }),
535
- typebox_1.Type.Object({
536
- action: typebox_1.Type.Literal("merge"),
537
- approval_suppressed: typebox_1.Type.Literal(true),
538
- message: typebox_1.Type.String(),
539
- resolution: typebox_1.Type.Object({
540
- decision: typebox_1.Type.Literal("review"),
541
- reason: typebox_1.Type.String(),
542
- evidence: typebox_1.Type.Array(typebox_1.Type.Object({ kind: typebox_1.Type.String(), identifier: typebox_1.Type.String() })),
543
- }),
544
- }),
545
- ]),
546
504
  typebox_1.Type.Object({
547
- action: typebox_1.Type.Literal("resolve_duplicates"),
505
+ action: typebox_1.Type.Literal("discover_duplicates"),
548
506
  candidates_scanned: typebox_1.Type.Integer(),
549
- groups_found: typebox_1.Type.Integer(),
550
- auto_merged: typebox_1.Type.Integer(),
551
- approvals_queued: typebox_1.Type.Integer(),
552
- approvals_suppressed: typebox_1.Type.Integer(),
553
- oversized_groups: typebox_1.Type.Integer(),
554
- deferred_candidates: typebox_1.Type.Integer({
555
- description: "Candidates connected only through another record; reconsidered after direct merges apply.",
556
- }),
557
- }),
558
- typebox_1.Type.Object({
559
- action: typebox_1.Type.Literal("unmerge"),
560
- success: typebox_1.Type.Boolean(),
561
- message: typebox_1.Type.String(),
562
- winner_entity_id: typebox_1.Type.Integer(),
563
- loser_entity_id: typebox_1.Type.Integer(),
564
- /** Identities restored to the loser with their prior provenance markers. */
565
- restored_identities: typebox_1.Type.Integer(),
507
+ components: typebox_1.Type.Array(typebox_1.Type.Object({
508
+ component_id: typebox_1.Type.Integer(),
509
+ candidate_count: typebox_1.Type.Integer(),
510
+ candidate_entity_ids: typebox_1.Type.Array(typebox_1.Type.Integer(), {
511
+ description: "All component IDs for eligible components; empty for oversized components, which must not be partially submitted.",
512
+ }),
513
+ oversized: typebox_1.Type.Boolean(),
514
+ deferred_candidates: typebox_1.Type.Integer(),
515
+ decisions: typebox_1.Type.Array(typebox_1.Type.Object({
516
+ from_entity_id: typebox_1.Type.Integer(),
517
+ to_entity_id: typebox_1.Type.Integer(),
518
+ relationship_type_slug: typebox_1.Type.String(),
519
+ })),
520
+ })),
521
+ next_cursor: typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
566
522
  }),
567
523
  ]);
568
524
  //# sourceMappingURL=manage-entity.js.map
@@ -22,6 +22,7 @@ export declare const ExecuteAction: import("@sinclair/typebox").TObject<{
22
22
  operation_key: import("@sinclair/typebox").TString;
23
23
  input: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>>;
24
24
  idempotency_key: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
25
+ background: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
25
26
  activation: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
26
27
  kind: import("@sinclair/typebox").TLiteral<"page_visit">;
27
28
  urls: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
@@ -32,6 +33,22 @@ export declare const ExecuteAction: import("@sinclair/typebox").TObject<{
32
33
  run_id: import("@sinclair/typebox").TNumber;
33
34
  }>>;
34
35
  }>;
36
+ /** Connector implementation calls use the public operation lifecycle, with a
37
+ * parent-scoped idempotency key and no caller-supplied authority or device id. */
38
+ export declare const ConnectorOperationRequestSchema: import("@sinclair/typebox").TObject<{
39
+ connection_id: import("@sinclair/typebox").TInteger;
40
+ idempotency_key: import("@sinclair/typebox").TString;
41
+ input: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>>;
42
+ operation_key: import("@sinclair/typebox").TString;
43
+ background: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
44
+ }>;
45
+ export type ConnectorOperationRequest = Static<typeof ConnectorOperationRequestSchema>;
46
+ export declare function isConnectorOperationRequest(value: unknown): value is ConnectorOperationRequest;
47
+ export type ConnectorOperationResult = Extract<ManageOperationsResult, {
48
+ action: "execute";
49
+ } | {
50
+ error: string;
51
+ }>;
35
52
  /**
36
53
  * Run types excluded from `list_runs` when the caller does not name run types
37
54
  * explicitly. Every chat reply AND every non-terminal streaming delta is
@@ -72,6 +89,10 @@ export declare const GetRunAction: import("@sinclair/typebox").TObject<{
72
89
  action: import("@sinclair/typebox").TLiteral<"get_run">;
73
90
  run_id: import("@sinclair/typebox").TNumber;
74
91
  }>;
92
+ export declare const CancelAction: import("@sinclair/typebox").TObject<{
93
+ action: import("@sinclair/typebox").TLiteral<"cancel">;
94
+ run_id: import("@sinclair/typebox").TInteger;
95
+ }>;
75
96
  /**
76
97
  * Unified workspace attention feed for Home UI + agent context.
77
98
  * Member-readable (same tier as list_runs). Optionally collapses adjacent
@@ -89,7 +110,7 @@ export declare const ListActivityAction: import("@sinclair/typebox").TObject<{
89
110
  * Failures never merge with successes. Default true.
90
111
  */
91
112
  aggregate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
92
- /** Restrict run kinds: automation | sync | action | notification (default all). */
113
+ /** Restrict kinds: automation_due | automation | sync | action | notification (default all). */
93
114
  kinds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
94
115
  /**
95
116
  * Scope the feed to a single agent: only that agent's Automation runs are
@@ -258,7 +279,7 @@ export declare const ManageOperationsResultSchema: import("@sinclair/typebox").T
258
279
  browser_url: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
259
280
  browser_handoff: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
260
281
  run_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
261
- state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"ready">, import("@sinclair/typebox").TLiteral<"expired">, import("@sinclair/typebox").TLiteral<"completed">]>;
282
+ state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"ready">, import("@sinclair/typebox").TLiteral<"preparing">, import("@sinclair/typebox").TLiteral<"expired">, import("@sinclair/typebox").TLiteral<"completed">]>;
262
283
  expires_at: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
263
284
  error_message: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
264
285
  }>>;
@@ -287,6 +308,13 @@ export declare const ManageOperationsResultSchema: import("@sinclair/typebox").T
287
308
  feed_name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
288
309
  automation_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
289
310
  automation_name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
311
+ next_action: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
312
+ method: import("@sinclair/typebox").TLiteral<"automations.claimNextWindow">;
313
+ input: import("@sinclair/typebox").TObject<{
314
+ automation_id: import("@sinclair/typebox").TString;
315
+ run_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
316
+ }>;
317
+ }>>;
290
318
  agent_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
291
319
  agent_name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
292
320
  client_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -303,6 +331,11 @@ export declare const ManageOperationsResultSchema: import("@sinclair/typebox").T
303
331
  run_id: import("@sinclair/typebox").TInteger;
304
332
  event_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
305
333
  message: import("@sinclair/typebox").TString;
334
+ }>, import("@sinclair/typebox").TObject<{
335
+ action: import("@sinclair/typebox").TLiteral<"cancel">;
336
+ run_id: import("@sinclair/typebox").TInteger;
337
+ status: import("@sinclair/typebox").TString;
338
+ cancelled: import("@sinclair/typebox").TBoolean;
306
339
  }>, import("@sinclair/typebox").TObject<{
307
340
  action: import("@sinclair/typebox").TLiteral<"reject">;
308
341
  rejected: import("@sinclair/typebox").TLiteral<true>;
@@ -344,6 +377,7 @@ export declare const ManageOperationsSchema: import("@sinclair/typebox").TUnion<
344
377
  operation_key: import("@sinclair/typebox").TString;
345
378
  input: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>>;
346
379
  idempotency_key: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
380
+ background: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
347
381
  activation: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
348
382
  kind: import("@sinclair/typebox").TLiteral<"page_visit">;
349
383
  urls: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
@@ -382,6 +416,9 @@ export declare const ManageOperationsSchema: import("@sinclair/typebox").TUnion<
382
416
  }>, import("@sinclair/typebox").TObject<{
383
417
  action: import("@sinclair/typebox").TLiteral<"get_run">;
384
418
  run_id: import("@sinclair/typebox").TNumber;
419
+ }>, import("@sinclair/typebox").TObject<{
420
+ action: import("@sinclair/typebox").TLiteral<"cancel">;
421
+ run_id: import("@sinclair/typebox").TInteger;
385
422
  }>, import("@sinclair/typebox").TObject<{
386
423
  action: import("@sinclair/typebox").TLiteral<"list_activity">;
387
424
  limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
@@ -394,7 +431,7 @@ export declare const ManageOperationsSchema: import("@sinclair/typebox").TUnion<
394
431
  * Failures never merge with successes. Default true.
395
432
  */
396
433
  aggregate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
397
- /** Restrict run kinds: automation | sync | action | notification (default all). */
434
+ /** Restrict kinds: automation_due | automation | sync | action | notification (default all). */
398
435
  kinds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
399
436
  /**
400
437
  * Scope the feed to a single agent: only that agent's Automation runs are
@@ -437,6 +474,7 @@ export declare const ManageOperationsSchema: import("@sinclair/typebox").TUnion<
437
474
  export type ManageOperationsArgs = Static<typeof ManageOperationsSchema>;
438
475
  export type OperationListAvailableInput = ActionInput<ManageOperationsArgs, "list_available">;
439
476
  export type OperationExecuteInput = ActionInput<ManageOperationsArgs, "execute">;
477
+ export type OperationListActivityInput = ActionInput<ManageOperationsArgs, "list_activity">;
440
478
  export type OperationListRunsInput = ActionInput<ManageOperationsArgs, "list_runs">;
441
479
  export type OperationApproveInput = ActionInput<ManageOperationsArgs, "approve">;
442
480
  export type OperationRejectInput = ActionInput<ManageOperationsArgs, "reject">;
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ManageOperationsSchema = exports.ManageOperationsResultSchema = exports.NotificationDeliverySchema = exports.RejectBatchAction = exports.ApproveBatchAction = exports.ApprovalBatchScope = exports.RejectAction = exports.ApproveAction = exports.ListActivityAction = exports.GetRunAction = exports.ListRunsAction = exports.LIST_RUNS_DEFAULT_EXCLUDED_RUN_TYPES = exports.ExecuteAction = exports.ListAvailableAction = exports.KindLiteral = exports.BackendLiteral = void 0;
3
+ exports.ManageOperationsSchema = exports.ManageOperationsResultSchema = exports.NotificationDeliverySchema = exports.RejectBatchAction = exports.ApproveBatchAction = exports.ApprovalBatchScope = exports.RejectAction = exports.ApproveAction = exports.ListActivityAction = exports.CancelAction = exports.GetRunAction = exports.ListRunsAction = exports.LIST_RUNS_DEFAULT_EXCLUDED_RUN_TYPES = exports.ConnectorOperationRequestSchema = exports.ExecuteAction = exports.ListAvailableAction = exports.KindLiteral = exports.BackendLiteral = void 0;
4
+ exports.isConnectorOperationRequest = isConnectorOperationRequest;
4
5
  const typebox_1 = require("@sinclair/typebox");
6
+ const value_1 = require("@sinclair/typebox/value");
5
7
  const pagination_1 = require("./pagination");
6
8
  // manage_operations is flattened to one MCP object, so duplicate properties
7
9
  // must tell the truth for both actions instead of publishing one false default.
@@ -61,6 +63,10 @@ exports.ExecuteAction = typebox_1.Type.Object({
61
63
  maxLength: 256,
62
64
  description: "Durable caller key. Replays return the original operation run; reusing the key for a different operation or input is rejected.",
63
65
  })),
66
+ background: typebox_1.Type.Optional(typebox_1.Type.Boolean({
67
+ default: false,
68
+ description: "Device operations only: return the durable run_id immediately. The run survives the caller disconnecting; use get_run for results and cancel to stop it. Approval and queue expiry still apply.",
69
+ })),
64
70
  activation: typebox_1.Type.Optional(typebox_1.Type.Object({
65
71
  kind: typebox_1.Type.Literal("page_visit"),
66
72
  urls: typebox_1.Type.Array(typebox_1.Type.String({ format: "uri" }), {
@@ -75,6 +81,17 @@ exports.ExecuteAction = typebox_1.Type.Object({
75
81
  run_id: typebox_1.Type.Number(),
76
82
  })),
77
83
  });
84
+ /** Connector implementation calls use the public operation lifecycle, with a
85
+ * parent-scoped idempotency key and no caller-supplied authority or device id. */
86
+ exports.ConnectorOperationRequestSchema = typebox_1.Type.Object({
87
+ ...typebox_1.Type.Pick(exports.ExecuteAction, ["operation_key", "input", "background"])
88
+ .properties,
89
+ connection_id: typebox_1.Type.Integer({ minimum: 1 }),
90
+ idempotency_key: typebox_1.Type.String({ minLength: 1, maxLength: 128 }),
91
+ }, { additionalProperties: false });
92
+ function isConnectorOperationRequest(value) {
93
+ return value_1.Value.Check(exports.ConnectorOperationRequestSchema, value);
94
+ }
78
95
  /**
79
96
  * Run types excluded from `list_runs` when the caller does not name run types
80
97
  * explicitly. Every chat reply AND every non-terminal streaming delta is
@@ -127,6 +144,12 @@ exports.GetRunAction = typebox_1.Type.Object({
127
144
  }),
128
145
  run_id: typebox_1.Type.Number(),
129
146
  });
147
+ exports.CancelAction = typebox_1.Type.Object({
148
+ action: typebox_1.Type.Literal("cancel", {
149
+ description: "Cancel a connector operation owned by the requester, or as a workspace administrator. Prevents further claims/results and asks the worker to stop on its next heartbeat; already performed effects are not undone.",
150
+ }),
151
+ run_id: typebox_1.Type.Integer({ minimum: 1 }),
152
+ });
130
153
  /**
131
154
  * Unified workspace attention feed for Home UI + agent context.
132
155
  * Member-readable (same tier as list_runs). Optionally collapses adjacent
@@ -151,7 +174,7 @@ exports.ListActivityAction = typebox_1.Type.Object({
151
174
  * Failures never merge with successes. Default true.
152
175
  */
153
176
  aggregate: typebox_1.Type.Optional(typebox_1.Type.Boolean({ default: true })),
154
- /** Restrict run kinds: automation | sync | action | notification (default all). */
177
+ /** Restrict kinds: automation_due | automation | sync | action | notification (default all). */
155
178
  kinds: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
156
179
  /**
157
180
  * Scope the feed to a single agent: only that agent's Automation runs are
@@ -355,6 +378,7 @@ exports.ManageOperationsResultSchema = typebox_1.Type.Union([
355
378
  run_id: typebox_1.Type.Union([typebox_1.Type.Integer(), typebox_1.Type.Null()]),
356
379
  state: typebox_1.Type.Union([
357
380
  typebox_1.Type.Literal("ready"),
381
+ typebox_1.Type.Literal("preparing"),
358
382
  typebox_1.Type.Literal("expired"),
359
383
  typebox_1.Type.Literal("completed"),
360
384
  ]),
@@ -386,6 +410,13 @@ exports.ManageOperationsResultSchema = typebox_1.Type.Union([
386
410
  feed_name: typebox_1.Type.Optional(typebox_1.Type.String()),
387
411
  automation_id: typebox_1.Type.Optional(typebox_1.Type.Integer()),
388
412
  automation_name: typebox_1.Type.Optional(typebox_1.Type.String()),
413
+ next_action: typebox_1.Type.Optional(typebox_1.Type.Object({
414
+ method: typebox_1.Type.Literal("automations.claimNextWindow"),
415
+ input: typebox_1.Type.Object({
416
+ automation_id: typebox_1.Type.String(),
417
+ run_id: typebox_1.Type.Optional(typebox_1.Type.Integer()),
418
+ }),
419
+ })),
389
420
  agent_id: typebox_1.Type.Optional(typebox_1.Type.String()),
390
421
  agent_name: typebox_1.Type.Optional(typebox_1.Type.String()),
391
422
  client_id: typebox_1.Type.Optional(typebox_1.Type.String()),
@@ -404,6 +435,12 @@ exports.ManageOperationsResultSchema = typebox_1.Type.Union([
404
435
  event_id: typebox_1.Type.Optional(typebox_1.Type.Integer()),
405
436
  message: typebox_1.Type.String(),
406
437
  }),
438
+ typebox_1.Type.Object({
439
+ action: typebox_1.Type.Literal("cancel"),
440
+ run_id: typebox_1.Type.Integer(),
441
+ status: typebox_1.Type.String(),
442
+ cancelled: typebox_1.Type.Boolean(),
443
+ }),
407
444
  typebox_1.Type.Object({
408
445
  action: typebox_1.Type.Literal("reject"),
409
446
  rejected: typebox_1.Type.Literal(true),
@@ -433,6 +470,7 @@ exports.ManageOperationsSchema = typebox_1.Type.Union([
433
470
  exports.ExecuteAction,
434
471
  exports.ListRunsAction,
435
472
  exports.GetRunAction,
473
+ exports.CancelAction,
436
474
  exports.ListActivityAction,
437
475
  exports.ApproveAction,
438
476
  exports.RejectAction,