@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,7 +1,7 @@
1
1
  #!/usr/bin/env bun
2
2
  export * from "./agent-policy";
3
3
  export * from "./tool-trace-summary";
4
- export * from "./tool-policy";
4
+ export * from "./shell-safety";
5
5
  export * from "./turn-control";
6
6
  export * from "./memory-flush";
7
7
  export type { AgentAccessStore, AgentConfigStore, AgentConnectionStore, AgentMetadata, AgentSettings, AgentStore, ConnectionSettings, Grant, GrantKind, StoredConnection, } from "./agent-store";
@@ -29,9 +29,8 @@ export type { ProviderConfigEntry, ProviderOAuthConfig, ProviderOAuthGrantKind,
29
29
  export { isSdkCompat, type PiAiApi, resolveSdkCompat, SDK_COMPAT_PROTOCOLS, type SdkCompat, type SdkCompatProtocol, } from "./sdk-compat";
30
30
  export * from "./secret-refs";
31
31
  export * from "./reserved";
32
- export { getSentry, initSentry } from "./sentry";
33
32
  export { extractTraceId, generateTraceId } from "./trace";
34
- export type { AgentErrorContext, AgentInlineGuardrail, AgentOptions, AuthProfile, ConversationMessage, DeclaredCredential, HistoryMessage, InstructionContext, InstructionProvider, LogLevel, McpOAuthConfig, NetworkConfig, NixConfig, RegistryEntry, SessionContext, SkillConfig, SkillsConfig, SuggestedPrompt, ThinkingLevel, ThreadResponsePayload, ToolsConfig, } from "./types";
33
+ export type { AgentErrorContext, AgentInlineGuardrail, AgentOptions, AuthProfile, ConversationMessage, DeclaredCredential, HistoryMessage, InstructionContext, InstructionProvider, LogLevel, McpOAuthConfig, NetworkConfig, NixConfig, RegistryEntry, SessionContext, SkillConfig, SkillsConfig, SuggestedPrompt, ThinkingLevel, ThreadResponsePayload, } from "./types";
35
34
  export { hasCredentialSource } from "./types";
36
35
  export { SUGGESTION_LIMITS, sanitizeSuggestionPrompts } from "./types";
37
36
  export type { BaseMessage } from "./types/message";
@@ -43,7 +42,7 @@ export * from "./utils/network-domains";
43
42
  export * from "./utils/retry";
44
43
  export * from "./utils/sanitize";
45
44
  export * from "./utils/secret-redaction";
46
- export * from "./utils/sentry-scrubber";
45
+ export * from "./utils/diagnostic-scrubber";
47
46
  export { entryToMessage, type ParsedMessage, type ParsedMessageType, parseSessionEntries, type SessionEntry, titleFromSessionJsonl, } from "./utils/session-file";
48
47
  export { slugify } from "./utils/slug";
49
48
  export * from "./utils/urls";
@@ -16,10 +16,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
17
  };
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.withLobuFileParameters = exports.slugify = exports.titleFromSessionJsonl = exports.parseSessionEntries = exports.entryToMessage = exports.sanitizeSuggestionPrompts = exports.SUGGESTION_LIMITS = exports.hasCredentialSource = exports.generateTraceId = exports.extractTraceId = exports.initSentry = exports.getSentry = exports.SDK_COMPAT_PROTOCOLS = exports.resolveSdkCompat = exports.isSdkCompat = exports.withSpan = exports.withChildSpan = exports.shutdownTracing = exports.SpanStatusCode = exports.SpanKind = exports.runInSpanContext = exports.initTracing = exports.getTracer = exports.getTraceparent = exports.getCurrentSpan = exports.flushTracing = exports.createSpan = exports.createRootSpan = exports.createChildSpan = exports.renderSkillMemorySection = exports.renderFallbackSystemContext = exports.BaseInstructionProvider = exports.CommandRegistry = exports.inferGrantKind = void 0;
19
+ exports.withLobuFileParameters = exports.slugify = exports.titleFromSessionJsonl = exports.parseSessionEntries = exports.entryToMessage = exports.sanitizeSuggestionPrompts = exports.SUGGESTION_LIMITS = exports.hasCredentialSource = exports.generateTraceId = exports.extractTraceId = exports.SDK_COMPAT_PROTOCOLS = exports.resolveSdkCompat = exports.isSdkCompat = exports.withSpan = exports.withChildSpan = exports.shutdownTracing = exports.SpanStatusCode = exports.SpanKind = exports.runInSpanContext = exports.initTracing = exports.getTracer = exports.getTraceparent = exports.getCurrentSpan = exports.flushTracing = exports.createSpan = exports.createRootSpan = exports.createChildSpan = exports.renderSkillMemorySection = exports.renderFallbackSystemContext = exports.BaseInstructionProvider = exports.CommandRegistry = exports.inferGrantKind = void 0;
20
20
  __exportStar(require("./agent-policy"), exports);
21
21
  __exportStar(require("./tool-trace-summary"), exports);
22
- __exportStar(require("./tool-policy"), exports);
22
+ __exportStar(require("./shell-safety"), exports);
23
23
  __exportStar(require("./turn-control"), exports);
24
24
  __exportStar(require("./memory-flush"), exports);
25
25
  var agent_store_1 = require("./agent-store");
@@ -78,9 +78,6 @@ __exportStar(require("./secret-refs"), exports);
78
78
  // Reserved path / entity-type slug lists + kind helpers (single source)
79
79
  __exportStar(require("./reserved"), exports);
80
80
  // Observability
81
- var sentry_1 = require("./sentry");
82
- Object.defineProperty(exports, "getSentry", { enumerable: true, get: function () { return sentry_1.getSentry; } });
83
- Object.defineProperty(exports, "initSentry", { enumerable: true, get: function () { return sentry_1.initSentry; } });
84
81
  var trace_1 = require("./trace");
85
82
  Object.defineProperty(exports, "extractTraceId", { enumerable: true, get: function () { return trace_1.extractTraceId; } });
86
83
  Object.defineProperty(exports, "generateTraceId", { enumerable: true, get: function () { return trace_1.generateTraceId; } });
@@ -97,7 +94,7 @@ __exportStar(require("./utils/network-domains"), exports);
97
94
  __exportStar(require("./utils/retry"), exports);
98
95
  __exportStar(require("./utils/sanitize"), exports);
99
96
  __exportStar(require("./utils/secret-redaction"), exports);
100
- __exportStar(require("./utils/sentry-scrubber"), exports);
97
+ __exportStar(require("./utils/diagnostic-scrubber"), exports);
101
98
  // Shared Lobu runtime session.jsonl parser (gateway + worker).
102
99
  var session_file_1 = require("./utils/session-file");
103
100
  Object.defineProperty(exports, "entryToMessage", { enumerable: true, get: function () { return session_file_1.entryToMessage; } });
@@ -1,13 +1,10 @@
1
1
  /**
2
2
  * Shared vocabulary for the `json_template` render DSL.
3
3
  *
4
- * The DSL is authored once per event kind / entity type and rendered on three
5
- * surfaces: the web app and MCP apps (owletto's `json-renderer`) and chat
6
- * notification delivery (the server's `template-card`). The *formatting* of a
7
- * bound scalar must agree across all three — a date that reads "Aug 19, 2026"
8
- * in the Memory view cannot read "2026-08-19T00:00:00Z" in Slack — so the
9
- * format directives and their implementation live here rather than being
10
- * reimplemented per surface.
4
+ * Entity/list templates and historical event templates share this vocabulary
5
+ * across web and MCP rendering. Their bound values use the same formatting
6
+ * directives rather than reimplementing scalar formatting per renderer.
7
+ * Chat summaries and native decisions do not interpret this DSL.
11
8
  *
12
9
  * Structural node shapes stay with each renderer: the node vocabulary is
13
10
  * deliberately open (see the server's `validate-json-template`), and each
@@ -78,9 +75,8 @@ export interface TemplateVisitor<T> {
78
75
  *
79
76
  * `props` arrive RESOLVED: `{{path}}` yields the bound value with its type
80
77
  * intact, `"a/{{b}}"` interpolates to a string. Handler props (`onClick` and
81
- * friends) are split into `actions` as bare action names, because a surface
82
- * without a JS context — a chat card — still needs to know which action a
83
- * button invokes.
78
+ * friends) are split into `actions` as bare action names so each renderer
79
+ * can bind its own handlers.
84
80
  */
85
81
  component(type: string, props: Record<string, unknown>, children: T[], ctx: {
86
82
  actions: Record<string, string>;
@@ -2,13 +2,10 @@
2
2
  /**
3
3
  * Shared vocabulary for the `json_template` render DSL.
4
4
  *
5
- * The DSL is authored once per event kind / entity type and rendered on three
6
- * surfaces: the web app and MCP apps (owletto's `json-renderer`) and chat
7
- * notification delivery (the server's `template-card`). The *formatting* of a
8
- * bound scalar must agree across all three — a date that reads "Aug 19, 2026"
9
- * in the Memory view cannot read "2026-08-19T00:00:00Z" in Slack — so the
10
- * format directives and their implementation live here rather than being
11
- * reimplemented per surface.
5
+ * Entity/list templates and historical event templates share this vocabulary
6
+ * across web and MCP rendering. Their bound values use the same formatting
7
+ * directives rather than reimplementing scalar formatting per renderer.
8
+ * Chat summaries and native decisions do not interpret this DSL.
12
9
  *
13
10
  * Structural node shapes stay with each renderer: the node vocabulary is
14
11
  * deliberately open (see the server's `validate-json-template`), and each
@@ -247,8 +244,7 @@ function resolveProps(node, data) {
247
244
  const props = {};
248
245
  const actions = {};
249
246
  for (const [key, value] of Object.entries(raw)) {
250
- // `"@name"` is the DSL's action binding. On the web it resolves to a
251
- // function; a chat card has no such context, so keep the NAME.
247
+ // Keep action names separate from a renderer's JavaScript handlers.
252
248
  if (typeof value === "string" &&
253
249
  value.startsWith("@") &&
254
250
  value.length > 1) {
@@ -10,6 +10,7 @@ const USE_WINSTON_LOGGER = process.env.USE_WINSTON_LOGGER === "true";
10
10
  // Use JSON format for structured logging (better for Loki parsing in production)
11
11
  const USE_JSON_FORMAT = process.env.LOG_FORMAT === "json";
12
12
  const winston_1 = __importDefault(require("winston"));
13
+ const diagnostic_scrubber_1 = require("./utils/diagnostic-scrubber");
13
14
  const SENSITIVE_LOG_KEY_PATTERN = /(?:credential|secret|token|password|api(?:_|-)?key|authorization)/i;
14
15
  function createRedactingReplacer() {
15
16
  const seen = new WeakSet();
@@ -20,7 +21,7 @@ function createRedactingReplacer() {
20
21
  return {
21
22
  name: value.name,
22
23
  message: value.message,
23
- stack: value.stack?.split("\n")[0],
24
+ stack: value.stack,
24
25
  };
25
26
  }
26
27
  if (typeof value === "object" && value !== null) {
@@ -33,7 +34,7 @@ function createRedactingReplacer() {
33
34
  }
34
35
  function safeStringify(value, space) {
35
36
  try {
36
- return JSON.stringify(value, createRedactingReplacer(), space);
37
+ return JSON.stringify((0, diagnostic_scrubber_1.scrubDiagnosticValue)(value), createRedactingReplacer(), space);
37
38
  }
38
39
  catch {
39
40
  return "[unserializable]";
@@ -78,6 +79,7 @@ function createConsoleLogger(serviceName) {
78
79
  timestamp,
79
80
  level: lvl,
80
81
  service: serviceName,
82
+ release: process.env.APP_GIT_SHA,
81
83
  message: msgStr,
82
84
  ...(args.length > 0
83
85
  ? { data: args.length === 1 ? args[0] : args }
@@ -88,7 +90,7 @@ function createConsoleLogger(serviceName) {
88
90
  if (args.length > 0) {
89
91
  msgStr += ` ${safeStringify(args.length === 1 ? args[0] : args)}`;
90
92
  }
91
- return `[${timestamp.replace("T", " ").slice(0, 19)}] [${lvl}] [${serviceName}] ${msgStr}`;
93
+ return `[${timestamp.replace("T", " ").slice(0, 19)}] [${lvl}] [${serviceName}] ${(0, diagnostic_scrubber_1.scrubDiagnosticValue)(msgStr)}`;
92
94
  };
93
95
  return {
94
96
  error: (message, ...args) => {
@@ -141,8 +143,12 @@ function createLogger(serviceName) {
141
143
  ];
142
144
  const logger = winston_1.default.createLogger({
143
145
  level,
144
- format: winston_1.default.format.combine(winston_1.default.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), winston_1.default.format.errors({ stack: true }), winston_1.default.format.splat()),
145
- defaultMeta: { service: serviceName },
146
+ format: winston_1.default.format.combine(winston_1.default.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), winston_1.default.format.errors({ stack: true }), winston_1.default.format.splat(), winston_1.default.format((info) => {
147
+ // Preserve Winston's symbol fields while applying the same boundary
148
+ // scrubbing as the default console transport.
149
+ return Object.assign(info, (0, diagnostic_scrubber_1.scrubDiagnosticValue)(info));
150
+ })()),
151
+ defaultMeta: { service: serviceName, release: process.env.APP_GIT_SHA },
146
152
  transports,
147
153
  });
148
154
  return logger;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Advisory package-install detector shared by local and remote bash. The local
3
+ * isolate has no package managers registered; this check supplies an actionable
4
+ * error and runs before remote dispatch too. It is conservative text matching,
5
+ * not a shell security boundary: quoted/path-qualified executables and wrappers
6
+ * can evade it. Package availability and remote sandbox policy remain separate.
7
+ */
8
+ export declare function isDirectPackageInstallCommand(command: string): boolean;
9
+ //# sourceMappingURL=shell-safety.d.ts.map
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isDirectPackageInstallCommand = isDirectPackageInstallCommand;
4
+ /** Fixed shell protections shared by the isolate and remote workspace tools. */
5
+ const bash_command_parser_1 = require("./bash-command-parser");
6
+ const PACKAGE_MANAGER_DENY_PREFIXES = [
7
+ "apt ",
8
+ "apt-get ",
9
+ "yum ",
10
+ "dnf ",
11
+ "apk ",
12
+ "pacman ",
13
+ "zypper ",
14
+ "brew ",
15
+ "nix-shell ",
16
+ "nix-env ",
17
+ // New-style nix CLI. `nix shell`/`run`/`develop` put arbitrary packages on
18
+ // PATH or fetch-and-execute them and `nix build`/`nix-store` realise arbitrary
19
+ // derivations — the same capability the old-style commands above already
20
+ // denied. A bare `nix ` prefix covers every subcommand (conservative, like
21
+ // `brew `); `nixfmt` and friends keep working because the prefix needs the
22
+ // trailing space. This matcher only recognizes the honestly-typed leading
23
+ // command; what actually contains a package manager differs per backend —
24
+ // see the header on isDirectPackageInstallCommand.
25
+ "nix ",
26
+ "nix-build ",
27
+ "nix-store ",
28
+ "nix-channel ",
29
+ "nix-instantiate ",
30
+ "nix-prefetch-url ",
31
+ "nix-collect-garbage ",
32
+ "nix-copy-closure ",
33
+ // Ad-hoc package runners: fetch-and-run a tool that is not installed.
34
+ // `npx`/`bunx` are absent — they prefer already-installed local binaries.
35
+ "uvx ",
36
+ "uv tool install ",
37
+ "uv tool run ",
38
+ "uv tool upgrade ",
39
+ "uv add ",
40
+ "pipx install ",
41
+ "pipx run ",
42
+ "pipx upgrade ",
43
+ "pipx upgrade-all ",
44
+ "pipx inject ",
45
+ "pipx reinstall ",
46
+ "pipx reinstall-all ",
47
+ "pipx runpip ",
48
+ "pnpm dlx ",
49
+ "yarn dlx ",
50
+ "sudo apt ",
51
+ "sudo apt-get ",
52
+ "sudo yum ",
53
+ "sudo dnf ",
54
+ "sudo apk ",
55
+ "sudo pacman ",
56
+ "sudo zypper ",
57
+ "sudo brew ",
58
+ "sudo nix-shell ",
59
+ "sudo nix-env ",
60
+ "sudo nix ",
61
+ "sudo nix-build ",
62
+ "sudo nix-store ",
63
+ "sudo nix-channel ",
64
+ "sudo nix-instantiate ",
65
+ "sudo nix-prefetch-url ",
66
+ "sudo nix-collect-garbage ",
67
+ "sudo nix-copy-closure ",
68
+ "pip install ",
69
+ "pip3 install ",
70
+ "uv pip install ",
71
+ "npm install ",
72
+ "npm i ",
73
+ "pnpm install ",
74
+ "pnpm add ",
75
+ "yarn install ",
76
+ "yarn add ",
77
+ "bun install ",
78
+ "bun add ",
79
+ "cargo install ",
80
+ "go install ",
81
+ "gem install ",
82
+ "poetry add ",
83
+ "composer require ",
84
+ ];
85
+ const DIRECT_PACKAGE_INSTALL_PATTERNS = [
86
+ /(^|[\s;|&()])(?:sudo\s+)?(?:apt|apt-get|yum|dnf|apk|pacman|zypper|brew)\s+(?:install|upgrade|add)\b/i,
87
+ /(^|[\s;|&()])(?:sudo\s+)?(?:nix-shell|nix-env)\b/i,
88
+ // New-style nix subcommands and the nix-* helpers, recognized after a shell
89
+ // operator or `sudo` (leading forms are already covered by the prefix list).
90
+ /(^|[\s;|&()])(?:sudo\s+)?nix\s+(?:profile|shell|run|develop|build|eval|flake|store|copy|bundle|repl|search|edit|print-dev-env|why-depends|derivation|realisation|registry|upgrade-nix)\b/i,
91
+ /(^|[\s;|&()])(?:sudo\s+)?nix-(?:build|store|channel|instantiate|prefetch-url|collect-garbage|copy-closure)\b/i,
92
+ /(^|[\s;|&()])(?:pip|pip3)\s+install\b/i,
93
+ /(^|[\s;|&()])uv\s+pip\s+install\b/i,
94
+ /(^|[\s;|&()])uv\s+(?:tool\s+(?:install|run|upgrade)|add)\b/i,
95
+ /(^|[\s;|&()])uvx\b/i,
96
+ /(^|[\s;|&()])pipx\s+(?:install|run|upgrade|upgrade-all|inject|reinstall|reinstall-all|runpip)\b/i,
97
+ /(^|[\s;|&()])npm\s+(?:install|i)\b/i,
98
+ /(^|[\s;|&()])pnpm\s+(?:install|add|dlx)\b/i,
99
+ /(^|[\s;|&()])yarn\s+(?:install|add|global\s+add|dlx)\b/i,
100
+ /(^|[\s;|&()])bun\s+(?:install|add)\b/i,
101
+ /(^|[\s;|&()])cargo\s+install\b/i,
102
+ /(^|[\s;|&()])go\s+install\b/i,
103
+ /(^|[\s;|&()])gem\s+install\b/i,
104
+ /(^|[\s;|&()])poetry\s+add\b/i,
105
+ /(^|[\s;|&()])composer\s+require\b/i,
106
+ ];
107
+ /**
108
+ * Longest command this matcher will scan. Past it the command is treated as an
109
+ * install attempt rather than parsed: the scan is superlinear in the command
110
+ * length and the caller does not control the input.
111
+ */
112
+ const MAX_SCANNED_COMMAND_LENGTH = 8192;
113
+ /**
114
+ * Advisory package-install detector shared by local and remote bash. The local
115
+ * isolate has no package managers registered; this check supplies an actionable
116
+ * error and runs before remote dispatch too. It is conservative text matching,
117
+ * not a shell security boundary: quoted/path-qualified executables and wrappers
118
+ * can evade it. Package availability and remote sandbox policy remain separate.
119
+ */
120
+ function isDirectPackageInstallCommand(command) {
121
+ const trimmed = command.trim().toLowerCase();
122
+ if (!trimmed) {
123
+ return false;
124
+ }
125
+ // The interpreter-body regex backtracks quadratically on adversarial option
126
+ // clusters (`sh -` repeated), and on the isolate lane the model writes this
127
+ // string, so an unbounded scan would block the guest's only thread for
128
+ // seconds. No honest install command is anywhere near this long, and the
129
+ // matcher's documented bias is to fail toward flagging.
130
+ if (trimmed.length > MAX_SCANNED_COMMAND_LENGTH) {
131
+ return true;
132
+ }
133
+ // Keep the platform's fixed prefix guard on every shell segment; this was
134
+ // previously transported in each turn's configurable bash policy.
135
+ if ((0, bash_command_parser_1.splitShellCommands)(command).some((segment) => PACKAGE_MANAGER_DENY_PREFIXES.some((prefix) => segment.toLowerCase().startsWith(prefix.toLowerCase()))))
136
+ return true;
137
+ const matches = (text) => PACKAGE_MANAGER_DENY_PREFIXES.some((prefix) => text.startsWith(prefix.toLowerCase())) || DIRECT_PACKAGE_INSTALL_PATTERNS.some((pattern) => pattern.test(text));
138
+ // Scan the command with quoted DATA blanked out and each data word's operands
139
+ // dropped, so a manager merely NAMED cannot match. Both scrubs are advisory
140
+ // and fail toward flagging: whatever they cannot prove to be data is matched.
141
+ if ((0, bash_command_parser_1.matchesBeforeArgumentData)((0, bash_command_parser_1.blankQuotedSpans)(trimmed), matches)) {
142
+ return true;
143
+ }
144
+ // Then scan `sh -c '…'` bodies, where the quoted text IS a command.
145
+ bash_command_parser_1.INTERPRETER_DASH_C.lastIndex = 0;
146
+ for (const m of trimmed.matchAll(bash_command_parser_1.INTERPRETER_DASH_C)) {
147
+ const body = m[2]?.trim();
148
+ if (body && (0, bash_command_parser_1.matchesBeforeArgumentData)((0, bash_command_parser_1.blankQuotedSpans)(body), matches)) {
149
+ return true;
150
+ }
151
+ }
152
+ return false;
153
+ }
154
+ //# sourceMappingURL=shell-safety.js.map
@@ -4,7 +4,7 @@
4
4
  * Split out of `types.ts` because this cluster is PURE: no import, no Node
5
5
  * builtin, no logger. That is what lets the isolate guest reach it through
6
6
  * `@lobu/core/agent-tooling` while `types.ts` itself keeps pulling the rest of
7
- * core in. Same rule as `tool-policy.ts`: never grow a Node import or a root
7
+ * core in. Same rule as `shell-safety.ts`: never grow a Node import or a root
8
8
  * `@lobu/core` import here.
9
9
  */
10
10
  /**
@@ -5,7 +5,7 @@
5
5
  * Split out of `types.ts` because this cluster is PURE: no import, no Node
6
6
  * builtin, no logger. That is what lets the isolate guest reach it through
7
7
  * `@lobu/core/agent-tooling` while `types.ts` itself keeps pulling the rest of
8
- * core in. Same rule as `tool-policy.ts`: never grow a Node import or a root
8
+ * core in. Same rule as `shell-safety.ts`: never grow a Node import or a root
9
9
  * `@lobu/core` import here.
10
10
  */
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * Pure by construction: no Node builtin, no `@lobu/core` barrel import. The
11
11
  * isolate lane bundles this into its guest, under the same standing rule as
12
- * `agent-tooling.ts` and `tool-policy.ts`.
12
+ * `agent-tooling.ts` and `shell-safety.ts`.
13
13
  */
14
14
  /** Retrieval evidence a client can join back to the agent's answer. */
15
15
  export interface ToolTraceSummary {
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * Pure by construction: no Node builtin, no `@lobu/core` barrel import. The
12
12
  * isolate lane bundles this into its guest, under the same standing rule as
13
- * `agent-tooling.ts` and `tool-policy.ts`.
13
+ * `agent-tooling.ts` and `shell-safety.ts`.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.isRetrievalTool = isRetrievalTool;
@@ -128,8 +128,6 @@ export interface AgentOptions {
128
128
  model?: string;
129
129
  maxTokens?: number;
130
130
  temperature?: number;
131
- allowedTools?: string | string[];
132
- disallowedTools?: string | string[];
133
131
  timeoutMinutes?: number | string;
134
132
  compaction?: AgentCompactionOptions;
135
133
  networkConfig?: Record<string, unknown>;
@@ -293,5 +291,5 @@ export interface RegistryEntry {
293
291
  type: string;
294
292
  apiUrl: string;
295
293
  }
296
- export type { AgentInlineGuardrail, NetworkConfig, NixConfig, SkillConfig, SkillsConfig, ThinkingLevel, ToolsConfig, } from "./contracts/agent-settings";
294
+ export type { AgentInlineGuardrail, NetworkConfig, NixConfig, SkillConfig, SkillsConfig, ThinkingLevel, } from "./contracts/agent-settings";
297
295
  //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Recursively remove credential material from diagnostic values.
3
+ * This is deliberately defensive: telemetry must never make an unusual
4
+ * application value or a circular error object throw another error.
5
+ */
6
+ export declare function scrubDiagnosticValue(value: unknown): unknown;
7
+ //# sourceMappingURL=diagnostic-scrubber.d.ts.map
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.scrubSentryValue = scrubSentryValue;
4
- exports.scrubSentryErrorEvent = scrubSentryErrorEvent;
5
- exports.scrubSentryTransactionEvent = scrubSentryTransactionEvent;
6
- exports.scrubSentryBreadcrumb = scrubSentryBreadcrumb;
3
+ exports.scrubDiagnosticValue = scrubDiagnosticValue;
7
4
  const secret_redaction_1 = require("./secret-redaction");
8
5
  /**
9
6
  * Secret as a QUERY PARAMETER name, and only there. `code` is an OAuth
@@ -28,7 +25,7 @@ const SECRET_KEY_SEGMENTS = new Set(["signature", "sig"]);
28
25
  * are matched only as complete names.
29
26
  */
30
27
  const SECRET_KEY_EXACT = new Set(["codeverifier", "sessionstate"]);
31
- /** Deep enough to outlive Sentry's own normalize(); short of unbounded work. */
28
+ /** Bound recursive work on diagnostic values. */
32
29
  const MAX_DEPTH = 8;
33
30
  const MAX_ENTRIES = 1000;
34
31
  /** Separator/case-squashed form, for keys core's camel-case split can't read. */
@@ -58,13 +55,13 @@ function isSecretObjectKey(key) {
58
55
  }
59
56
  const URL_PATTERN = /https?:\/\/[^\s"'<>]+/gi;
60
57
  /**
61
- * A relative URL (`/api/v1/files/a?token=…`) and Sentry's own
58
+ * A relative URL (`/api/v1/files/a?token=…`) and a raw
62
59
  * `request.query_string` (`token=…`, no scheme and no path) never match
63
60
  * URL_PATTERN, so the signed-download token would survive a URL-only scrub.
64
61
  * The separator absorbs trailing whitespace because cookie serialization is
65
62
  * `a=b; c=d`: without it every pair after the first space goes unredacted.
66
63
  */
67
- const QUERY_PAIR_PATTERN = /([?&;]\s*|^)([A-Za-z0-9_.\-%[\]]+)=([^&;\s"'<>]*)/g;
64
+ const QUERY_PAIR_PATTERN = /([?&;]\s*|^)([A-Za-z0-9_.\-%[\]]+)=("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[^&;\s"'<>]*)/g;
68
65
  function decodeKey(raw) {
69
66
  try {
70
67
  return decodeURIComponent(raw);
@@ -81,7 +78,12 @@ function scrubString(value) {
81
78
  // `postgres://user:pa55@host/db` carries its credential in the userinfo, not
82
79
  // in a query pair or a secret-named key, so neither pass below would see it.
83
80
  const withoutUriCredentials = (0, secret_redaction_1.redactUriCredentials)(value);
84
- const withoutUrlQueries = withoutUriCredentials.replace(URL_PATTERN, (candidate) => {
81
+ // Scrub quoted query values before URL matching stops at their opening quote
82
+ // and removes the key that identifies the remaining text as a credential.
83
+ const withoutQueries = withoutUriCredentials.replace(QUERY_PAIR_PATTERN, (match, lead, name, raw) => isSecretQueryParam(name)
84
+ ? `${lead}${name}=[REDACTED]${raw.match(/[),.;]+$/)?.[0] ?? ""}`
85
+ : match);
86
+ const withoutUrlQueries = withoutQueries.replace(URL_PATTERN, (candidate) => {
85
87
  // Trailing sentence punctuation is not part of the URL, but it is part of
86
88
  // the message: strip it to parse, then put it back.
87
89
  const trailing = candidate.match(/[),.;]+$/)?.[0] ?? "";
@@ -94,25 +96,28 @@ function scrubString(value) {
94
96
  return candidate;
95
97
  }
96
98
  });
97
- return withoutUrlQueries.replace(QUERY_PAIR_PATTERN, (match, lead, name) => isSecretQueryParam(name) ? `${lead}${name}=[REDACTED]` : match);
99
+ // Error messages can embed key=value diagnostics outside a URL. Keep codes
100
+ // and states useful there; only credential-named assignments are sensitive.
101
+ return withoutUrlQueries.replace(/(\s)([A-Za-z0-9_.%-]+)=("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[^&;\s"'<>]*)/g, (match, lead, name) => isSecretObjectKey(decodeKey(name)) ? `${lead}${name}=[REDACTED]` : match);
98
102
  }
99
103
  /**
100
- * Recursively remove credential material from values headed for Sentry.
104
+ * Recursively remove credential material from diagnostic values.
101
105
  * This is deliberately defensive: telemetry must never make an unusual
102
106
  * application value or a circular error object throw another error.
103
107
  */
104
- function scrubSentryValue(value) {
108
+ function scrubDiagnosticValue(value) {
105
109
  const seen = new WeakSet();
106
110
  function scrub(current, depth = 0) {
107
111
  if (typeof current === "string")
108
112
  return scrubString(current);
113
+ // A copied toJSON hook could reintroduce secrets after this walk finishes.
114
+ if (typeof current === "function")
115
+ return "[Function]";
109
116
  if (current === null || typeof current !== "object")
110
117
  return current;
111
118
  if (seen.has(current))
112
119
  return "[CIRCULAR]";
113
- // beforeBreadcrumb runs BEFORE Sentry's own normalize(), so without a cap
114
- // a single console breadcrumb carrying a huge or deeply nested object is
115
- // fully deep-cloned on the hot path only to be truncated moments later.
120
+ // Bound deeply nested values before cloning them on the logging hot path.
116
121
  if (depth >= MAX_DEPTH)
117
122
  return "[TRUNCATED]";
118
123
  // Tracks the current PATH, not every node ever visited. Two siblings may
@@ -139,6 +144,11 @@ function scrubSentryValue(value) {
139
144
  serialized.stack = scrubString(current.stack);
140
145
  if (current.cause !== undefined)
141
146
  serialized.cause = scrub(current.cause, depth + 1);
147
+ // AggregateError.errors is non-enumerable, just like cause and stack.
148
+ // Reuse the same walk so nested failures keep their codes without
149
+ // bypassing credential redaction, depth limits, or cycle detection.
150
+ if ("errors" in current && Array.isArray(current.errors))
151
+ serialized.errors = scrub(current.errors, depth + 1);
142
152
  for (const key of Object.keys(current)) {
143
153
  serialized[key] = isSecretObjectKey(key)
144
154
  ? "[REDACTED]"
@@ -187,42 +197,4 @@ function scrubSentryValue(value) {
187
197
  }
188
198
  return scrub(value);
189
199
  }
190
- /**
191
- * `sdkProcessingMetadata` holds the live Scope -> Client -> options graph, and
192
- * @sentry/core deletes the field outright in createEventEnvelope. Deep-walking
193
- * it is therefore pure per-event work on a structure that never ships, and it
194
- * is the only part of a prepared event holding class instances. Detach it for
195
- * the walk and put the original reference back.
196
- */
197
- function scrubEvent(event) {
198
- const { sdkProcessingMetadata } = event;
199
- const scrubbed = scrubSentryValue({
200
- ...event,
201
- sdkProcessingMetadata: undefined,
202
- });
203
- if (sdkProcessingMetadata !== undefined) {
204
- scrubbed.sdkProcessingMetadata = sdkProcessingMetadata;
205
- }
206
- return scrubbed;
207
- }
208
- function scrubSentryErrorEvent(event) {
209
- return scrubEvent(event);
210
- }
211
- /**
212
- * Sampled wherever tracing is on -- but sampled is not exempt: a span's
213
- * attributes carry the request URL, which is the very `?token=` vector the
214
- * error path scrubs. Without this they reach Sentry unscrubbed. Rates are the
215
- * consumer's business, not this module's (the gateway traces, the worker sets
216
- * tracesSampleRate 0, so there it is installed and inert).
217
- */
218
- // Generic rather than naming TransactionEvent: @sentry/node does not
219
- // re-export that type. Inference recovers it exactly at the
220
- // beforeSendTransaction call site, in either major.
221
- function scrubSentryTransactionEvent(event) {
222
- return scrubEvent(event);
223
- }
224
- /** Never drops a breadcrumb; it only rewrites credential material in place. */
225
- function scrubSentryBreadcrumb(breadcrumb) {
226
- return scrubSentryValue(breadcrumb);
227
- }
228
- //# sourceMappingURL=sentry-scrubber.js.map
200
+ //# sourceMappingURL=diagnostic-scrubber.js.map
@@ -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. */