@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
@@ -9,6 +9,9 @@ export declare function looksLikeWorkerToken(token: string): boolean;
9
9
  * Worker authentication using encrypted conversation ID.
10
10
  * Token format: encrypted(JSON payload of thread metadata).
11
11
  */
12
+ /** See {@link WorkerTokenData.chatAccess}. */
13
+ export declare const CHAT_TURN_ACCESS: readonly ["member", "org_shared", "public_visitor", "reply_only"];
14
+ export type ChatTurnAccess = (typeof CHAT_TURN_ACCESS)[number];
12
15
  export interface WorkerTokenData {
13
16
  /**
14
17
  * Separates worker-facing bearers, credentials exposed to agent subprocesses
@@ -100,11 +103,42 @@ export interface WorkerTokenData {
100
103
  */
101
104
  adminTools?: string[];
102
105
  /**
103
- * Lobu auth user authorized for {@link adminTools}. Chat turns keep the
104
- * platform principal in `userId`, so direct MCP auth must not reinterpret a
105
- * Slack/Telegram id as a `member.userId`. Present iff `adminTools` is present.
106
+ * The Lobu auth user (`member.userId`) this turn acts as on the direct MCP
107
+ * lane, resolved SERVER-SIDE at mint from verified state — for a chat turn,
108
+ * the member the platform sender is linked to in this organization. Chat
109
+ * turns keep the platform principal in `userId`, so direct MCP auth must
110
+ * never reinterpret a Slack/Telegram id as a `member.userId`; it reads this
111
+ * claim instead and re-checks the membership on every request. Required
112
+ * whenever {@link adminTools} is present. On an `org_shared` chat turn (a
113
+ * linked member in a group conversation) it is attribution only: the turn
114
+ * acts with no user.
106
115
  */
107
- adminActorUserId?: string;
116
+ actorUserId?: string;
117
+ /**
118
+ * The authority a CHAT turn runs with, decided server-side at mint from
119
+ * verified state (`gateway/orchestration/chat-turn-actor.ts` in the server):
120
+ * - `member`: a linked member in a direct message; acts as
121
+ * {@link actorUserId} with their own role and private connections.
122
+ * - `org_shared`: a linked member in a group conversation, or an unlinked
123
+ * sender the platform vouches for as same-tenant; no user,
124
+ * ordinary-member role, org-shared connections only.
125
+ * - `public_visitor`: an unvouched sender of a public organization; the
126
+ * anonymous public-read path.
127
+ * - `reply_only`: an unvouched sender of a private organization; no
128
+ * workspace tools at all.
129
+ * Absent on a chat turn means reply-only (fail closed). Ignored on headless
130
+ * turns, which have no chat sender.
131
+ */
132
+ chatAccess?: ChatTurnAccess;
133
+ /**
134
+ * The chat turn's workspace grant beyond its own `organizationId`: set
135
+ * (always `true`) only on a `member` turn in a direct message. The token's
136
+ * organization stays the default for every call; a call that names another
137
+ * workspace acts there as {@link actorUserId} when that user is a member of
138
+ * it at request time (membership is read then, never embedded here).
139
+ * Absent means the turn reaches its own organization only.
140
+ */
141
+ chatSenderWorkspaces?: true;
108
142
  /**
109
143
  * Selected runtime-provider id (e.g. "vercel"), resolved from the agent's
110
144
  * environment at token-mint time. The generic `/internal/runtime/exec` route
@@ -183,8 +217,12 @@ export interface WorkerTokenOptions {
183
217
  * Admin-tool allowlist for this turn. See WorkerTokenData.adminTools.
184
218
  */
185
219
  adminTools?: string[];
186
- /** Lobu auth user bound to the admin-tools allowlist. */
187
- adminActorUserId?: string;
220
+ /** Lobu auth user the turn acts as. See WorkerTokenData.actorUserId. */
221
+ actorUserId?: string;
222
+ /** Chat turn authority. See WorkerTokenData.chatAccess. */
223
+ chatAccess?: ChatTurnAccess;
224
+ /** Sender-workspace grant. See WorkerTokenData.chatSenderWorkspaces. */
225
+ chatSenderWorkspaces?: true;
188
226
  /** Selected runtime provider id. See WorkerTokenData.runtimeProviderId. */
189
227
  runtimeProviderId?: string;
190
228
  /** Selected sandbox id backing the runtime credential. See WorkerTokenData.sandboxId. */
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHAT_TURN_ACCESS = void 0;
3
4
  exports.looksLikeWorkerToken = looksLikeWorkerToken;
4
5
  exports.generateWorkerToken = generateWorkerToken;
5
6
  exports.generateWorkerTokenPair = generateWorkerTokenPair;
@@ -20,6 +21,17 @@ const logger = (0, logger_1.createLogger)("worker-auth");
20
21
  function looksLikeWorkerToken(token) {
21
22
  return /^[0-9a-f]+:[0-9a-f]+:[0-9a-f]+$/i.test(token);
22
23
  }
24
+ /**
25
+ * Worker authentication using encrypted conversation ID.
26
+ * Token format: encrypted(JSON payload of thread metadata).
27
+ */
28
+ /** See {@link WorkerTokenData.chatAccess}. */
29
+ exports.CHAT_TURN_ACCESS = [
30
+ "member",
31
+ "org_shared",
32
+ "public_visitor",
33
+ "reply_only",
34
+ ];
23
35
  function generateToken(userId, conversationId, deploymentName, options, tokenKind, jti = (0, node_crypto_1.randomUUID)()) {
24
36
  if (!options.channelId) {
25
37
  throw new Error("channelId is required for worker token generation");
@@ -46,7 +58,9 @@ function generateToken(userId, conversationId, deploymentName, options, tokenKin
46
58
  runId: options.runId,
47
59
  messageId: options.messageId,
48
60
  adminTools: options.adminTools,
49
- adminActorUserId: options.adminActorUserId,
61
+ actorUserId: options.actorUserId,
62
+ chatAccess: options.chatAccess,
63
+ chatSenderWorkspaces: options.chatSenderWorkspaces,
50
64
  runtimeProviderId: options.runtimeProviderId,
51
65
  sandboxId: options.sandboxId,
52
66
  allowedDomains: options.allowedDomains,
@@ -182,18 +196,37 @@ function verifyToken(token, expectedKind) {
182
196
  return null;
183
197
  }
184
198
  }
185
- // The admin-tools pair is inseparable: the allowlist limits WHAT may
186
- // run and the resolved auth subject says WHO authorized it. Accepting one
187
- // without the other either makes the allowlist unusable or tempts callers
188
- // to reinterpret the platform-scoped `userId` as an auth user again.
189
- if ((data.adminTools === undefined) !==
190
- (data.adminActorUserId === undefined)) {
191
- logger.error("Worker token rejected: adminTools and adminActorUserId must be set together");
199
+ // The allowlist limits WHAT may run; the resolved auth subject says WHO
200
+ // authorized it. An allowlist without its actor would tempt callers to
201
+ // reinterpret the platform-scoped `userId` as an auth user again. The
202
+ // reverse is valid: an ordinary chat turn acts as its sender with no
203
+ // admin allowlist at all.
204
+ if (data.adminTools !== undefined && data.actorUserId === undefined) {
205
+ logger.error("Worker token rejected: adminTools requires actorUserId");
206
+ return null;
207
+ }
208
+ if (data.actorUserId !== undefined &&
209
+ (typeof data.actorUserId !== "string" || !data.actorUserId)) {
210
+ logger.error("Worker token rejected: actorUserId must be a non-empty string");
211
+ return null;
212
+ }
213
+ // `chatAccess` decides what a chat sender may reach, so an unknown value
214
+ // is rejected rather than defaulted, and the member tier must name its
215
+ // member: the claim alone never grants a user identity.
216
+ if (data.chatAccess !== undefined &&
217
+ !exports.CHAT_TURN_ACCESS.includes(data.chatAccess)) {
218
+ logger.error("Worker token rejected: unknown chatAccess");
219
+ return null;
220
+ }
221
+ if (data.chatAccess === "member" && data.actorUserId === undefined) {
222
+ logger.error("Worker token rejected: a member chatAccess requires actorUserId");
192
223
  return null;
193
224
  }
194
- if (data.adminActorUserId !== undefined &&
195
- (typeof data.adminActorUserId !== "string" || !data.adminActorUserId)) {
196
- logger.error("Worker token rejected: adminActorUserId must be a non-empty string");
225
+ // The sender-workspace grant widens what a turn reaches, so it exists
226
+ // only as the literal `true` on a member turn that names its member.
227
+ if (data.chatSenderWorkspaces !== undefined &&
228
+ (data.chatSenderWorkspaces !== true || data.chatAccess !== "member")) {
229
+ logger.error("Worker token rejected: chatSenderWorkspaces requires a member chatAccess");
197
230
  return null;
198
231
  }
199
232
  // `runtimeProviderId` / `sandboxId` are optional but, when present, the
@@ -20,14 +20,6 @@ import type { AgentInlineGuardrail, AgentOptions, NetworkConfig, NixConfig } fro
20
20
  * - `exec`: direct command execution in the sandbox.
21
21
  */
22
22
  export type JobType = "message" | "exec";
23
- /** Where a chat turn executes. Absence means Lobu's managed agent runtime. */
24
- export interface DeviceExecutionTarget {
25
- kind: "device";
26
- /** Surrogate `device_workers.id`, never the caller-supplied worker handle. */
27
- deviceWorkerId: string;
28
- /** Local CLI kind the device advertised (Claude Code, Codex, OpenCode, …). */
29
- agentKind: string;
30
- }
31
23
  /**
32
24
  * Universal message payload for every gateway → worker hop.
33
25
  * Used by: platform inbound → runs queue → MessageConsumer → worker.
@@ -58,8 +50,6 @@ export interface MessagePayload {
58
50
  /** Platform name (`slack`, `telegram`, ...). */
59
51
  platform: string;
60
52
  messageText: string;
61
- /** Optional device placement for this turn; conversation ownership stays `agentId`. */
62
- executionTarget?: DeviceExecutionTarget;
63
53
  /**
64
54
  * Ephemeral context prepended to the user prompt for this turn only.
65
55
  * Not stored in the transcript snapshot — use for automation preprompts, etc.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/core",
3
- "version": "21.2.1",
3
+ "version": "23.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Core types and utilities for Lobu agent platform",
6
6
  "repository": {
@@ -41,10 +41,10 @@
41
41
  "import": "./dist/tool-trace-summary.js",
42
42
  "require": "./dist/tool-trace-summary.js"
43
43
  },
44
- "./tool-policy": {
45
- "types": "./dist/tool-policy.d.ts",
46
- "import": "./dist/tool-policy.js",
47
- "require": "./dist/tool-policy.js"
44
+ "./shell-safety": {
45
+ "types": "./dist/shell-safety.d.ts",
46
+ "import": "./dist/shell-safety.js",
47
+ "require": "./dist/shell-safety.js"
48
48
  },
49
49
  "./memory-flush": {
50
50
  "types": "./dist/memory-flush.d.ts",
@@ -101,11 +101,6 @@
101
101
  "import": "./dist/contracts/worker/device-automation.js",
102
102
  "require": "./dist/contracts/worker/device-automation.js"
103
103
  },
104
- "./contracts/worker/device-chat": {
105
- "types": "./dist/contracts/worker/device-chat.d.ts",
106
- "import": "./dist/contracts/worker/device-chat.js",
107
- "require": "./dist/contracts/worker/device-chat.js"
108
- },
109
104
  "./contracts/tools/manage-agents": {
110
105
  "types": "./dist/contracts/tools/manage-agents.d.ts",
111
106
  "import": "./dist/contracts/tools/manage-agents.js",
@@ -156,6 +151,16 @@
156
151
  "import": "./dist/contracts/tools/manage-entity-schema.js",
157
152
  "require": "./dist/contracts/tools/manage-entity-schema.js"
158
153
  },
154
+ "./contracts/tools/collection-presentation": {
155
+ "types": "./dist/contracts/tools/collection-presentation.d.ts",
156
+ "import": "./dist/contracts/tools/collection-presentation.js",
157
+ "require": "./dist/contracts/tools/collection-presentation.js"
158
+ },
159
+ "./contracts/tools/collection-selection": {
160
+ "types": "./dist/contracts/tools/collection-selection.d.ts",
161
+ "import": "./dist/contracts/tools/collection-selection.js",
162
+ "require": "./dist/contracts/tools/collection-selection.js"
163
+ },
159
164
  "./contracts/tools/manage-entity": {
160
165
  "types": "./dist/contracts/tools/manage-entity.d.ts",
161
166
  "import": "./dist/contracts/tools/manage-entity.js",
@@ -176,6 +181,11 @@
176
181
  "import": "./dist/reserved.js",
177
182
  "require": "./dist/reserved.js"
178
183
  },
184
+ "./device-pin-tombstones": {
185
+ "types": "./dist/device-pin-tombstones.d.ts",
186
+ "import": "./dist/device-pin-tombstones.js",
187
+ "require": "./dist/device-pin-tombstones.js"
188
+ },
179
189
  "./refs": {
180
190
  "types": "./dist/refs.d.ts",
181
191
  "import": "./dist/refs.js",
@@ -231,7 +241,6 @@
231
241
  "@opentelemetry/exporter-trace-otlp-grpc": "^0.222.0",
232
242
  "@opentelemetry/resources": "^2.11.0",
233
243
  "@opentelemetry/semantic-conventions": "^1.28.0",
234
- "@sentry/node": "^10.74.0",
235
244
  "winston": "^3.17.0"
236
245
  }
237
246
  }
File without changes
@@ -0,0 +1,332 @@
1
+ import {type SpinnerName} from 'cli-spinners';
2
+
3
+ export type Spinner = {
4
+ readonly interval?: number;
5
+ readonly frames: string[];
6
+ };
7
+
8
+ export type Color =
9
+ | 'black'
10
+ | 'red'
11
+ | 'green'
12
+ | 'yellow'
13
+ | 'blue'
14
+ | 'magenta'
15
+ | 'cyan'
16
+ | 'white'
17
+ | 'gray';
18
+
19
+ export type PrefixTextGenerator = () => string;
20
+
21
+ export type SuffixTextGenerator = () => string;
22
+
23
+ export type Options = {
24
+ /**
25
+ The text to display next to the spinner.
26
+ */
27
+ readonly text?: string;
28
+
29
+ /**
30
+ Text or a function that returns text to display before the spinner. No prefix text will be displayed if set to an empty string.
31
+ */
32
+ readonly prefixText?: string | PrefixTextGenerator;
33
+
34
+ /**
35
+ Text or a function that returns text to display after the spinner text. No suffix text will be displayed if set to an empty string.
36
+ */
37
+ readonly suffixText?: string | SuffixTextGenerator;
38
+
39
+ /**
40
+ The name of one of the provided spinners. See [`example.js`](https://github.com/BendingBender/ora/blob/main/example.js) in this repo if you want to test out different spinners. On Windows (expect for Windows Terminal), it will always use the line spinner as the Windows command-line doesn't have proper Unicode support.
41
+
42
+ @default 'dots'
43
+
44
+ Or an object like:
45
+
46
+ @example
47
+ ```
48
+ {
49
+ frames: ['-', '+', '-'],
50
+ interval: 80 // Optional
51
+ }
52
+ ```
53
+ */
54
+ readonly spinner?: SpinnerName | Spinner;
55
+
56
+ /**
57
+ The color of the spinner.
58
+
59
+ @default 'cyan'
60
+ */
61
+ readonly color?: Color | boolean;
62
+
63
+ /**
64
+ Set to `false` to stop Ora from hiding the cursor.
65
+
66
+ @default true
67
+ */
68
+ readonly hideCursor?: boolean;
69
+
70
+ /**
71
+ Indent the spinner with the given number of spaces.
72
+
73
+ @default 0
74
+ */
75
+ readonly indent?: number;
76
+
77
+ /**
78
+ Interval between each frame.
79
+
80
+ Spinners provide their own recommended interval, so you don't really need to specify this.
81
+
82
+ Default: Provided by the spinner or `100`.
83
+ */
84
+ readonly interval?: number;
85
+
86
+ /**
87
+ Stream to write the output.
88
+
89
+ You could for example set this to `process.stdout` instead.
90
+
91
+ @default process.stderr
92
+ */
93
+ readonly stream?: NodeJS.WritableStream;
94
+
95
+ /**
96
+ Force enable/disable the spinner. If not specified, the spinner will be enabled if the `stream` is being run inside a TTY context (not spawned or piped) and/or not in a CI environment.
97
+
98
+ Note that `{isEnabled: false}` doesn't mean it won't output anything. It just means it won't output the spinner, colors, and other ansi escape codes. It will still log text.
99
+ */
100
+ readonly isEnabled?: boolean;
101
+
102
+ /**
103
+ Disable the spinner and all log text. All output is suppressed and `isEnabled` will be considered `false`.
104
+
105
+ @default false
106
+ */
107
+ readonly isSilent?: boolean;
108
+
109
+ /**
110
+ Discard stdin input (except Ctrl+C) while running if it's TTY. This prevents the spinner from twitching on input, outputting broken lines on `Enter` key presses, and prevents buffering of input while the spinner is running.
111
+
112
+ This has no effect on Windows as there's no good way to implement discarding stdin properly there.
113
+
114
+ @default true
115
+ */
116
+ readonly discardStdin?: boolean;
117
+ };
118
+
119
+ export type PersistOptions = {
120
+ /**
121
+ Symbol to replace the spinner with.
122
+
123
+ @default ' '
124
+ */
125
+ readonly symbol?: string;
126
+
127
+ /**
128
+ Text to be persisted after the symbol.
129
+
130
+ Default: Current `text`.
131
+ */
132
+ readonly text?: string;
133
+
134
+ /**
135
+ Text or a function that returns text to be persisted before the symbol. No prefix text will be displayed if set to an empty string.
136
+
137
+ Default: Current `prefixText`.
138
+ */
139
+ readonly prefixText?: string | PrefixTextGenerator;
140
+
141
+ /**
142
+ Text or a function that returns text to be persisted after the text after the symbol. No suffix text will be displayed if set to an empty string.
143
+
144
+ Default: Current `suffixText`.
145
+ */
146
+ readonly suffixText?: string | SuffixTextGenerator;
147
+ };
148
+
149
+ export type PromiseOptions<T> = {
150
+ /**
151
+ The new text of the spinner when the promise is resolved.
152
+
153
+ Keeps the existing text if `undefined`.
154
+ */
155
+ successText?: string | ((result: T) => string) | undefined;
156
+
157
+ /**
158
+ The new text of the spinner when the promise is rejected.
159
+
160
+ Keeps the existing text if `undefined`.
161
+ */
162
+ failText?: string | ((error: Error) => string) | undefined;
163
+ } & Options;
164
+
165
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
166
+ export interface Ora {
167
+ /**
168
+ Change the text after the spinner.
169
+ */
170
+ text: string;
171
+
172
+ /**
173
+ Change the text or function that returns text before the spinner.
174
+
175
+ No prefix text will be displayed if set to an empty string.
176
+ */
177
+ prefixText: string;
178
+
179
+ /**
180
+ Change the text or function that returns text after the spinner text.
181
+
182
+ No suffix text will be displayed if set to an empty string.
183
+ */
184
+ suffixText: string;
185
+
186
+ /**
187
+ Change the spinner color.
188
+ */
189
+ color: Color | boolean;
190
+
191
+ /**
192
+ Change the spinner indent.
193
+ */
194
+ indent: number;
195
+
196
+ /**
197
+ Get the spinner.
198
+ */
199
+ get spinner(): Spinner;
200
+
201
+ /**
202
+ Set the spinner.
203
+ */
204
+ set spinner(spinner: SpinnerName | Spinner);
205
+
206
+ /**
207
+ A boolean indicating whether the instance is currently spinning.
208
+ */
209
+ get isSpinning(): boolean;
210
+
211
+ /**
212
+ The interval between each frame.
213
+
214
+ The interval is decided by the chosen spinner.
215
+ */
216
+ get interval(): number;
217
+
218
+ /**
219
+ Start the spinner.
220
+
221
+ @param text - Set the current text.
222
+ @returns The spinner instance.
223
+ */
224
+ start(text?: string): this;
225
+
226
+ /**
227
+ Stop and clear the spinner.
228
+
229
+ @returns The spinner instance.
230
+ */
231
+ stop(): this;
232
+
233
+ /**
234
+ Stop the spinner, change it to a green `✔` and persist the current text, or `text` if provided.
235
+
236
+ @param text - Will persist text if provided.
237
+ @returns The spinner instance.
238
+ */
239
+ succeed(text?: string): this;
240
+
241
+ /**
242
+ Stop the spinner, change it to a red `✖` and persist the current text, or `text` if provided.
243
+
244
+ @param text - Will persist text if provided.
245
+ @returns The spinner instance.
246
+ */
247
+ fail(text?: string): this;
248
+
249
+ /**
250
+ Stop the spinner, change it to a yellow `⚠` and persist the current text, or `text` if provided.
251
+
252
+ @param text - Will persist text if provided.
253
+ @returns The spinner instance.
254
+ */
255
+ warn(text?: string): this;
256
+
257
+ /**
258
+ Stop the spinner, change it to a blue `ℹ` and persist the current text, or `text` if provided.
259
+
260
+ @param text - Will persist text if provided.
261
+ @returns The spinner instance.
262
+ */
263
+ info(text?: string): this;
264
+
265
+ /**
266
+ Stop the spinner and change the symbol or text.
267
+
268
+ @returns The spinner instance.
269
+ */
270
+ stopAndPersist(options?: PersistOptions): this;
271
+
272
+ /**
273
+ Clear the spinner.
274
+
275
+ @returns The spinner instance.
276
+ */
277
+ clear(): this;
278
+
279
+ /**
280
+ Manually render a new frame.
281
+
282
+ @returns The spinner instance.
283
+ */
284
+ render(): this;
285
+
286
+ /**
287
+ Get a new frame.
288
+
289
+ @returns The spinner instance text.
290
+ */
291
+ frame(): string;
292
+ }
293
+
294
+ /**
295
+ Elegant terminal spinner.
296
+
297
+ @param options - If a string is provided, it is treated as a shortcut for `options.text`.
298
+
299
+ @example
300
+ ```
301
+ import ora from 'ora';
302
+
303
+ const spinner = ora('Loading unicorns').start();
304
+
305
+ setTimeout(() => {
306
+ spinner.color = 'yellow';
307
+ spinner.text = 'Loading rainbows';
308
+ }, 1000);
309
+ ```
310
+ */
311
+ export default function ora(options?: string | Options): Ora;
312
+
313
+ /**
314
+ Starts a spinner for a promise or promise-returning function. The spinner is stopped with `.succeed()` if the promise fulfills or with `.fail()` if it rejects.
315
+
316
+ @param action - The promise to start the spinner for or a promise-returning function.
317
+ @param options - If a string is provided, it is treated as a shortcut for `options.text`.
318
+ @returns The given promise.
319
+
320
+ @example
321
+ ```
322
+ import {oraPromise} from 'ora';
323
+
324
+ await oraPromise(somePromise);
325
+ ```
326
+ */
327
+ export function oraPromise<T>(
328
+ action: PromiseLike<T> | ((spinner: Ora) => PromiseLike<T>),
329
+ options?: string | PromiseOptions<T>
330
+ ): Promise<T>;
331
+
332
+ export {default as spinners} from 'cli-spinners';