@lobu/runtime-device 22.0.0 → 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 (77) hide show
  1. package/dist/component.json +1 -1
  2. package/dist/dependencies.bun.lock +3 -3
  3. package/npm-shrinkwrap.json +15 -15
  4. package/package.json +1 -1
  5. package/vendor/cli/dist/bundled-skills/lobu/SKILL.md +1 -1
  6. package/vendor/cli/dist/connectors/README.md +14 -1
  7. package/vendor/cli/dist/connectors/google_gmail.ts +1 -0
  8. package/vendor/cli/dist/connectors/jira-helpers.ts +313 -0
  9. package/vendor/cli/dist/connectors/jira.ts +29 -221
  10. package/vendor/cli/dist/connectors/linkedin-browser-script.ts +13 -0
  11. package/vendor/cli/dist/connectors/linkedin-draft-page.js +104 -0
  12. package/vendor/cli/dist/connectors/linkedin-drafts.ts +73 -0
  13. package/vendor/cli/dist/connectors/linkedin-identity.ts +32 -0
  14. package/vendor/cli/dist/connectors/linkedin-inbox-adapter.js +1185 -0
  15. package/vendor/cli/dist/connectors/linkedin-inbox.ts +156 -0
  16. package/vendor/cli/dist/connectors/linkedin-like.ts +114 -0
  17. package/vendor/cli/dist/connectors/linkedin-takeout.ts +577 -0
  18. package/vendor/cli/dist/connectors/linkedin.ts +3998 -0
  19. package/vendor/cli/dist/connectors/takeout-utils.ts +240 -0
  20. package/vendor/cli/dist/connectors/tiktok-inbox-page.js +9 -9
  21. package/vendor/cli/dist/connectors/tiktok-web-page.js +21 -15
  22. package/vendor/cli/dist/connectors/tiktok_web.ts +63 -30
  23. package/vendor/cli/dist/connectors/whatsapp-web-adapter.js +64 -564
  24. package/vendor/cli/dist/connectors/whatsapp-web-helpers.ts +30 -444
  25. package/vendor/cli/dist/connectors/whatsapp-web-identity.ts +20 -6
  26. package/vendor/cli/dist/connectors/whatsapp_web.ts +45 -645
  27. package/vendor/cli/dist/connectors/x-dm-adapter.js +556 -0
  28. package/vendor/cli/dist/connectors/x-identity.ts +31 -2
  29. package/vendor/cli/dist/connectors/x.ts +266 -120
  30. package/vendor/cli/dist/runtime-components.json +4 -4
  31. package/vendor/cli/dist/templates/AGENTS.md.tmpl +2 -2
  32. package/vendor/cli/package.json +1 -1
  33. package/vendor/connector-sdk/dist/browser-handoff-banner.d.ts +39 -0
  34. package/vendor/connector-sdk/dist/browser-handoff-banner.js +175 -0
  35. package/vendor/connector-sdk/dist/browser-source-read.d.ts +52 -0
  36. package/vendor/connector-sdk/dist/browser-source-read.js +107 -0
  37. package/vendor/connector-sdk/dist/connector-types.d.ts +10 -0
  38. package/vendor/connector-sdk/dist/index.d.ts +3 -0
  39. package/vendor/connector-sdk/dist/index.js +2 -0
  40. package/vendor/connector-sdk/package.json +9 -1
  41. package/vendor/connector-worker/dist/agent-turn/guest-entry.js +15 -6
  42. package/vendor/connector-worker/dist/agent-turn/guest.bundle.js +288 -148
  43. package/vendor/connector-worker/dist/daemon/automation.d.ts +4 -11
  44. package/vendor/connector-worker/dist/daemon/automation.js +6 -6
  45. package/vendor/connector-worker/dist/daemon/client.d.ts +2 -4
  46. package/vendor/connector-worker/dist/daemon/client.js +0 -3
  47. package/vendor/connector-worker/dist/daemon/executor.js +0 -3
  48. package/vendor/connector-worker/dist/daemon/mac-device-daemon.d.ts +4 -3
  49. package/vendor/connector-worker/dist/daemon/mac-device-daemon.js +4 -10
  50. package/vendor/connector-worker/dist/daemon/native-bridge/executor.js +27 -25
  51. package/vendor/connector-worker/dist/daemon/start.js +3 -15
  52. package/vendor/connector-worker/dist/daemon/terminal-failure.js +0 -11
  53. package/vendor/connector-worker/dist/daemon/worker-id.d.ts +17 -0
  54. package/vendor/connector-worker/dist/daemon/worker-id.js +22 -0
  55. package/vendor/connector-worker/dist/mac-device-daemon.js +14 -26
  56. package/vendor/connector-worker/package.json +1 -1
  57. package/vendor/core/dist/capabilities.d.ts +1 -1
  58. package/vendor/core/dist/capabilities.js +0 -1
  59. package/vendor/core/dist/connector-query-errors.d.ts +32 -0
  60. package/vendor/core/dist/connector-query-errors.js +41 -1
  61. package/vendor/core/dist/contracts/tools/manage-conversations.js +2 -2
  62. package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +14 -0
  63. package/vendor/core/dist/contracts/tools/manage-feeds.js +17 -0
  64. package/vendor/core/dist/contracts/worker/protocol.d.ts +8 -131
  65. package/vendor/core/dist/contracts/worker/protocol.js +9 -61
  66. package/vendor/core/dist/device-pin-tombstones.d.ts +44 -0
  67. package/vendor/core/dist/device-pin-tombstones.js +57 -0
  68. package/vendor/core/dist/index.d.ts +2 -1
  69. package/vendor/core/dist/index.js +1 -0
  70. package/vendor/core/dist/logger.js +10 -25
  71. package/vendor/core/dist/utils/diagnostic-scrubber.js +258 -21
  72. package/vendor/core/dist/worker/wire.d.ts +0 -10
  73. package/vendor/core/package.json +6 -6
  74. package/vendor/connector-worker/dist/daemon/device-chat.d.ts +0 -9
  75. package/vendor/connector-worker/dist/daemon/device-chat.js +0 -61
  76. package/vendor/core/dist/contracts/worker/device-chat.d.ts +0 -4
  77. package/vendor/core/dist/contracts/worker/device-chat.js +0 -26
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Single source of truth for the device/connector-worker job protocol:
5
5
  * `POST /api/workers/poll`, `/api/workers/complete`, `/complete-action`,
6
- * `/complete-embeddings`, `/complete-automation`, `/complete-chat`,
6
+ * `/complete-embeddings`, `/complete-automation`, `/complete-agent-turn`,
7
7
  * `/emit-auth-artifact`, `/poll-auth-signal`, `/stream`, and the chrome-action
8
8
  * dispatch.
9
9
  *
@@ -60,7 +60,7 @@ export interface ConnectorHttpResponse {
60
60
  body: string;
61
61
  }
62
62
  /** Run kinds the poller can hand back. */
63
- export declare const RunTypeSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sync">, import("@sinclair/typebox").TLiteral<"action">, import("@sinclair/typebox").TLiteral<"automation">, import("@sinclair/typebox").TLiteral<"chat_message">, import("@sinclair/typebox").TLiteral<"embed_backfill">, import("@sinclair/typebox").TLiteral<"auth">, import("@sinclair/typebox").TLiteral<"agent_turn">]>;
63
+ export declare const RunTypeSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sync">, import("@sinclair/typebox").TLiteral<"action">, import("@sinclair/typebox").TLiteral<"automation">, import("@sinclair/typebox").TLiteral<"embed_backfill">, import("@sinclair/typebox").TLiteral<"auth">, import("@sinclair/typebox").TLiteral<"agent_turn">]>;
64
64
  /** Categorized run exit reason on the failed-run path. */
65
65
  export declare const WorkerExitReasonSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"ok">, import("@sinclair/typebox").TLiteral<"cancelled">, import("@sinclair/typebox").TLiteral<"error_message">, import("@sinclair/typebox").TLiteral<"timeout">, import("@sinclair/typebox").TLiteral<"oom">, import("@sinclair/typebox").TLiteral<"crash">]>;
66
66
  /**
@@ -261,7 +261,7 @@ export declare const AutomationPollEventSchema: import("@sinclair/typebox").TObj
261
261
  fired_at: import("@sinclair/typebox").TString;
262
262
  payload: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
263
263
  }>;
264
- /** Identity context for a device-local CLI run (automation or chat). */
264
+ /** Identity context for a device-local Automation CLI run. */
265
265
  export declare const AutomationPollContextSchema: import("@sinclair/typebox").TObject<{
266
266
  device: import("@sinclair/typebox").TObject<{
267
267
  worker_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -327,66 +327,6 @@ export declare const AutomationPollPayloadSchema: import("@sinclair/typebox").TO
327
327
  }>>;
328
328
  }>;
329
329
  }>;
330
- /** One bounded prior turn shipped to a stateless device CLI. */
331
- export declare const DeviceChatHistoryMessageSchema: import("@sinclair/typebox").TObject<{
332
- role: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"user">, import("@sinclair/typebox").TLiteral<"assistant">]>;
333
- content: import("@sinclair/typebox").TString;
334
- }>;
335
- /**
336
- * Cap on the device chat envelope's `ephemeral_context`. Exported because the
337
- * producer must agree with it BEFORE enqueueing: the server-side planner keeps
338
- * an Automation whose composed instructions exceed this bound on the durable
339
- * background lane rather than shipping a device turn the poll route would
340
- * silently truncate.
341
- */
342
- export declare const DEVICE_CHAT_MAX_CONTEXT_LENGTH = 2048;
343
- /** Device-local chat execution metadata. Conversation ownership stays with `agent.id`. */
344
- export declare const DeviceChatPollPayloadSchema: import("@sinclair/typebox").TObject<{
345
- chat: import("@sinclair/typebox").TObject<{
346
- agent_kind: import("@sinclair/typebox").TString;
347
- execution_config: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
348
- /** Wall-clock cap in seconds; the dispatcher enforces it by SIGTERM. */
349
- timeout_seconds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
350
- /** Per-run dollar ceiling (claude-only today). */
351
- max_budget_usd: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
352
- /** Model alias/id (`--model` / `-m`). */
353
- model: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
354
- /** Tool permission mode (`--permission-mode`). */
355
- permission_mode: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
356
- /** Reasoning effort accepted by the selected CLI and model. */
357
- effort: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
358
- }>>;
359
- message: import("@sinclair/typebox").TString;
360
- ephemeral_context: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
361
- history: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
362
- role: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"user">, import("@sinclair/typebox").TLiteral<"assistant">]>;
363
- content: import("@sinclair/typebox").TString;
364
- }>>;
365
- agent: import("@sinclair/typebox").TObject<{
366
- id: import("@sinclair/typebox").TString;
367
- name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
368
- identity_md: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
369
- soul_md: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
370
- user_md: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
371
- }>;
372
- }>;
373
- context: import("@sinclair/typebox").TObject<{
374
- device: import("@sinclair/typebox").TObject<{
375
- worker_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
376
- }>;
377
- user: import("@sinclair/typebox").TObject<{
378
- user_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
379
- }>;
380
- agent_session: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
381
- conversation_id: import("@sinclair/typebox").TString;
382
- mcp_url: import("@sinclair/typebox").TString;
383
- token: import("@sinclair/typebox").TString;
384
- expires_at: import("@sinclair/typebox").TNumber;
385
- /** Exact same-device ACP session to continue; never discovered by listing sessions. */
386
- resume_session_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
387
- }>>;
388
- }>;
389
- }>;
390
330
  export declare const AgentTurnPollPayloadSchema: import("@sinclair/typebox").TObject<{
391
331
  turn: import("@sinclair/typebox").TObject<{
392
332
  agent_id: import("@sinclair/typebox").TString;
@@ -700,7 +640,7 @@ export declare const PollResponseSchema: import("@sinclair/typebox").TObject<{
700
640
  urls: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
701
641
  }>>>;
702
642
  run_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
703
- run_type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sync">, import("@sinclair/typebox").TLiteral<"action">, import("@sinclair/typebox").TLiteral<"automation">, import("@sinclair/typebox").TLiteral<"chat_message">, import("@sinclair/typebox").TLiteral<"embed_backfill">, import("@sinclair/typebox").TLiteral<"auth">, import("@sinclair/typebox").TLiteral<"agent_turn">]>>;
643
+ run_type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sync">, import("@sinclair/typebox").TLiteral<"action">, import("@sinclair/typebox").TLiteral<"automation">, import("@sinclair/typebox").TLiteral<"embed_backfill">, import("@sinclair/typebox").TLiteral<"auth">, import("@sinclair/typebox").TLiteral<"agent_turn">]>>;
704
644
  auth_profile_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
705
645
  previous_credentials: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>, import("@sinclair/typebox").TNull]>>;
706
646
  connector_key: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -749,9 +689,9 @@ export declare const PollResponseSchema: import("@sinclair/typebox").TObject<{
749
689
  /** Owning org of a claimed device-local CLI run. */
750
690
  organization_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
751
691
  /**
752
- * Device-local CLI envelope for `automation` or `chat_message` runs. The
753
- * gateway composes the prompt context and the device reports through the
754
- * matching completion endpoint. No connector code or credentials are shipped.
692
+ * Envelope for an `automation` run (a device-local CLI) or an `agent_turn`
693
+ * run. The gateway composes the prompt context and the worker reports
694
+ * through the matching completion endpoint. No connector code is shipped.
755
695
  */
756
696
  payload: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
757
697
  automation: import("@sinclair/typebox").TObject<{
@@ -795,51 +735,6 @@ export declare const PollResponseSchema: import("@sinclair/typebox").TObject<{
795
735
  resume_session_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
796
736
  }>>;
797
737
  }>;
798
- }>, import("@sinclair/typebox").TObject<{
799
- chat: import("@sinclair/typebox").TObject<{
800
- agent_kind: import("@sinclair/typebox").TString;
801
- execution_config: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
802
- /** Wall-clock cap in seconds; the dispatcher enforces it by SIGTERM. */
803
- timeout_seconds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
804
- /** Per-run dollar ceiling (claude-only today). */
805
- max_budget_usd: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
806
- /** Model alias/id (`--model` / `-m`). */
807
- model: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
808
- /** Tool permission mode (`--permission-mode`). */
809
- permission_mode: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
810
- /** Reasoning effort accepted by the selected CLI and model. */
811
- effort: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
812
- }>>;
813
- message: import("@sinclair/typebox").TString;
814
- ephemeral_context: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
815
- history: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
816
- role: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"user">, import("@sinclair/typebox").TLiteral<"assistant">]>;
817
- content: import("@sinclair/typebox").TString;
818
- }>>;
819
- agent: import("@sinclair/typebox").TObject<{
820
- id: import("@sinclair/typebox").TString;
821
- name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
822
- identity_md: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
823
- soul_md: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
824
- user_md: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
825
- }>;
826
- }>;
827
- context: import("@sinclair/typebox").TObject<{
828
- device: import("@sinclair/typebox").TObject<{
829
- worker_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
830
- }>;
831
- user: import("@sinclair/typebox").TObject<{
832
- user_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
833
- }>;
834
- agent_session: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
835
- conversation_id: import("@sinclair/typebox").TString;
836
- mcp_url: import("@sinclair/typebox").TString;
837
- token: import("@sinclair/typebox").TString;
838
- expires_at: import("@sinclair/typebox").TNumber;
839
- /** Exact same-device ACP session to continue; never discovered by listing sessions. */
840
- resume_session_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
841
- }>>;
842
- }>;
843
738
  }>, import("@sinclair/typebox").TObject<{
844
739
  turn: import("@sinclair/typebox").TObject<{
845
740
  agent_id: import("@sinclair/typebox").TString;
@@ -1224,8 +1119,8 @@ export declare const CompleteAuthRequestSchema: import("@sinclair/typebox").TObj
1224
1119
  status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"success">, import("@sinclair/typebox").TLiteral<"failed">]>;
1225
1120
  run_id: import("@sinclair/typebox").TInteger;
1226
1121
  worker_id: import("@sinclair/typebox").TString;
1227
- metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
1228
1122
  credentials: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
1123
+ metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
1229
1124
  output_tail: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
1230
1125
  exit_code: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>>;
1231
1126
  exit_signal: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
@@ -1264,20 +1159,6 @@ export declare const CompleteAutomationResponseSchema: import("@sinclair/typebox
1264
1159
  run_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>>;
1265
1160
  idempotent: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>>;
1266
1161
  }>;
1267
- /** `POST .../complete-chat` terminal report for a `chat_message` turn. */
1268
- export declare const CompleteDeviceChatRequestSchema: import("@sinclair/typebox").TObject<{
1269
- worker_id: import("@sinclair/typebox").TString;
1270
- output: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
1271
- error: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
1272
- exit_code: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>>;
1273
- exit_signal: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
1274
- exit_reason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"ok">, import("@sinclair/typebox").TLiteral<"cancelled">, import("@sinclair/typebox").TLiteral<"error_message">, import("@sinclair/typebox").TLiteral<"timeout">, import("@sinclair/typebox").TLiteral<"oom">, import("@sinclair/typebox").TLiteral<"crash">]>>;
1275
- }>;
1276
- export declare const CompleteDeviceChatResponseSchema: import("@sinclair/typebox").TObject<{
1277
- ok: import("@sinclair/typebox").TBoolean;
1278
- status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"completed">, import("@sinclair/typebox").TLiteral<"failed">]>;
1279
- idempotent: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
1280
- }>;
1281
1162
  /**
1282
1163
  * `POST /api/workers/complete-agent-turn`.
1283
1164
  *
@@ -1638,12 +1519,8 @@ export type AutomationPollMeta = Static<typeof AutomationPollMetaSchema>;
1638
1519
  export type AutomationPollEvent = Static<typeof AutomationPollEventSchema>;
1639
1520
  export type AutomationPollContext = Static<typeof AutomationPollContextSchema>;
1640
1521
  export type AutomationPollPayload = Static<typeof AutomationPollPayloadSchema>;
1641
- export type DeviceChatHistoryMessage = Static<typeof DeviceChatHistoryMessageSchema>;
1642
- export type DeviceChatPollPayload = Static<typeof DeviceChatPollPayloadSchema>;
1643
1522
  export type CompleteAutomationRequest = Static<typeof CompleteAutomationRequestSchema>;
1644
1523
  export type CompleteAutomationResponse = Static<typeof CompleteAutomationResponseSchema>;
1645
- export type CompleteDeviceChatRequest = Static<typeof CompleteDeviceChatRequestSchema>;
1646
- export type CompleteDeviceChatResponse = Static<typeof CompleteDeviceChatResponseSchema>;
1647
1524
  export type AgentTurnPollPayload = Static<typeof AgentTurnPollPayloadSchema>;
1648
1525
  export type CompleteAgentTurnRequest = Static<typeof CompleteAgentTurnRequestSchema>;
1649
1526
  export type CompleteAgentTurnResponse = Static<typeof CompleteAgentTurnResponseSchema>;
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Single source of truth for the device/connector-worker job protocol:
6
6
  * `POST /api/workers/poll`, `/api/workers/complete`, `/complete-action`,
7
- * `/complete-embeddings`, `/complete-automation`, `/complete-chat`,
7
+ * `/complete-embeddings`, `/complete-automation`, `/complete-agent-turn`,
8
8
  * `/emit-auth-artifact`, `/poll-auth-signal`, `/stream`, and the chrome-action
9
9
  * dispatch.
10
10
  *
@@ -26,8 +26,7 @@
26
26
  * not change that boundary, it only types what already crosses it.
27
27
  */
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.ExecuteConnectorOperationRequestSchema = exports.HeartbeatRequestSchema = exports.AGENT_TURN_BRIDGE_BYTES = exports.TURN_DELTA_MAX_CHARS = exports.PollAuthSignalResponseSchema = exports.PollAuthSignalRequestSchema = exports.EmitAuthArtifactRequestSchema = exports.CompleteAgentTurnResponseSchema = exports.CompleteAgentTurnRequestSchema = exports.AGENT_TURN_INPUT_MAX = exports.TURN_TOOL_EVENT_QUEUE_MAX = exports.TurnToolEventSchema = exports.TURN_TOOL_OUTPUT_MAX_CHARS = exports.CompleteDeviceChatResponseSchema = exports.CompleteDeviceChatRequestSchema = exports.CompleteAutomationResponseSchema = exports.CompleteAutomationRequestSchema = exports.CompleteAuthRequestSchema = exports.CompleteEmbeddingsRequestSchema = exports.EmbeddingEntrySchema = exports.EmbedEventSchema = exports.CompleteActionRequestSchema = exports.CompleteRequestSchema = exports.StreamBatchSchema = exports.ContentItemSchema = exports.ActivatePageResponseSchema = exports.ActivatePageRequestSchema = exports.PollResponseSchema = exports.FeedSourceAckSchema = exports.AgentTurnPollPayloadSchema = exports.DeviceChatPollPayloadSchema = exports.DEVICE_CHAT_MAX_CONTEXT_LENGTH = exports.DeviceChatHistoryMessageSchema = exports.AutomationPollPayloadSchema = exports.AutomationPollContextSchema = exports.AutomationPollEventSchema = exports.AutomationPollMetaSchema = exports.AutomationExecutionConfigSchema = exports.PollRequestSchema = exports.WORKER_POLL_MAX_WAIT_SECONDS = exports.FeedNotificationSchema = exports.EXECUTION_BACKENDS = exports.OAuthCredentialsSchema = exports.WorkerExitDiagnosticsSchema = exports.WorkerExitReasonSchema = exports.RunTypeSchema = exports.ConnectorHttpRequestSchema = exports.SourceAttributionSchema = exports.CONNECTOR_HTTP_MAX_BYTES = exports.CONNECTOR_HTTP_AUTH_CAPABILITY = void 0;
30
- exports.HeartbeatResponseSchema = exports.DispatchChromeActionResponseSchema = exports.DispatchChromeActionRequestSchema = void 0;
29
+ exports.HeartbeatResponseSchema = exports.DispatchChromeActionResponseSchema = exports.DispatchChromeActionRequestSchema = exports.ExecuteConnectorOperationRequestSchema = exports.HeartbeatRequestSchema = exports.AGENT_TURN_BRIDGE_BYTES = exports.TURN_DELTA_MAX_CHARS = exports.PollAuthSignalResponseSchema = exports.PollAuthSignalRequestSchema = exports.EmitAuthArtifactRequestSchema = exports.CompleteAgentTurnResponseSchema = exports.CompleteAgentTurnRequestSchema = exports.AGENT_TURN_INPUT_MAX = exports.TURN_TOOL_EVENT_QUEUE_MAX = exports.TurnToolEventSchema = exports.TURN_TOOL_OUTPUT_MAX_CHARS = exports.CompleteAutomationResponseSchema = exports.CompleteAutomationRequestSchema = exports.CompleteAuthRequestSchema = exports.CompleteEmbeddingsRequestSchema = exports.EmbeddingEntrySchema = exports.EmbedEventSchema = exports.CompleteActionRequestSchema = exports.CompleteRequestSchema = exports.StreamBatchSchema = exports.ContentItemSchema = exports.ActivatePageResponseSchema = exports.ActivatePageRequestSchema = exports.PollResponseSchema = exports.FeedSourceAckSchema = exports.AgentTurnPollPayloadSchema = exports.AutomationPollPayloadSchema = exports.AutomationPollContextSchema = exports.AutomationPollEventSchema = exports.AutomationPollMetaSchema = exports.AutomationExecutionConfigSchema = exports.PollRequestSchema = exports.WORKER_POLL_MAX_WAIT_SECONDS = exports.FeedNotificationSchema = exports.EXECUTION_BACKENDS = exports.OAuthCredentialsSchema = exports.WorkerExitDiagnosticsSchema = exports.WorkerExitReasonSchema = exports.RunTypeSchema = exports.ConnectorHttpRequestSchema = exports.SourceAttributionSchema = exports.CONNECTOR_HTTP_MAX_BYTES = exports.CONNECTOR_HTTP_AUTH_CAPABILITY = void 0;
31
30
  exports.defaultBackendCapacity = defaultBackendCapacity;
32
31
  const typebox_1 = require("@sinclair/typebox");
33
32
  const manage_operations_1 = require("../tools/manage-operations");
@@ -81,15 +80,13 @@ exports.RunTypeSchema = typebox_1.Type.Union([
81
80
  typebox_1.Type.Literal("sync"),
82
81
  typebox_1.Type.Literal("action"),
83
82
  typebox_1.Type.Literal("automation"),
84
- typebox_1.Type.Literal("chat_message"),
85
83
  typebox_1.Type.Literal("embed_backfill"),
86
84
  typebox_1.Type.Literal("auth"),
87
85
  /**
88
86
  * One conversation turn executed as one isolate job, claimed only by a fleet
89
87
  * worker that advertises the lane and run through `IsolateExecutor`. Distinct
90
- * from `chat_message`, a lobu-queue row the gateway drains to a subprocess
91
- * worker — or, when the agent is device-pinned, hands to that device through
92
- * this same poll. A daemon that predates this lane must never claim an
88
+ * from `chat_message`, a lobu-queue row the gateway drains itself and never
89
+ * hands to a poller. A daemon that predates this lane must never claim an
93
90
  * `agent_turn`: its dispatch would fall through to a connector sync.
94
91
  */
95
92
  typebox_1.Type.Literal("agent_turn"),
@@ -274,7 +271,7 @@ exports.AutomationPollEventSchema = typebox_1.Type.Object({
274
271
  fired_at: typebox_1.Type.String(),
275
272
  payload: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown())),
276
273
  });
277
- /** Identity context for a device-local CLI run (automation or chat). */
274
+ /** Identity context for a device-local Automation CLI run. */
278
275
  exports.AutomationPollContextSchema = typebox_1.Type.Object({
279
276
  device: typebox_1.Type.Object({ worker_id: typebox_1.Type.Optional(typebox_1.Type.String()) }),
280
277
  user: typebox_1.Type.Object({
@@ -311,37 +308,6 @@ exports.AutomationPollPayloadSchema = typebox_1.Type.Object({
311
308
  event: exports.AutomationPollEventSchema,
312
309
  context: exports.AutomationPollContextSchema,
313
310
  });
314
- /** One bounded prior turn shipped to a stateless device CLI. */
315
- exports.DeviceChatHistoryMessageSchema = typebox_1.Type.Object({
316
- role: typebox_1.Type.Union([typebox_1.Type.Literal("user"), typebox_1.Type.Literal("assistant")]),
317
- content: typebox_1.Type.String({ maxLength: 16000 }),
318
- });
319
- /**
320
- * Cap on the device chat envelope's `ephemeral_context`. Exported because the
321
- * producer must agree with it BEFORE enqueueing: the server-side planner keeps
322
- * an Automation whose composed instructions exceed this bound on the durable
323
- * background lane rather than shipping a device turn the poll route would
324
- * silently truncate.
325
- */
326
- exports.DEVICE_CHAT_MAX_CONTEXT_LENGTH = 2048;
327
- /** Device-local chat execution metadata. Conversation ownership stays with `agent.id`. */
328
- exports.DeviceChatPollPayloadSchema = typebox_1.Type.Object({
329
- chat: typebox_1.Type.Object({
330
- agent_kind: typebox_1.Type.String({ minLength: 1, maxLength: 64 }),
331
- execution_config: typebox_1.Type.Optional(exports.AutomationExecutionConfigSchema),
332
- message: typebox_1.Type.String({ maxLength: 32000 }),
333
- ephemeral_context: typebox_1.Type.Optional(typebox_1.Type.String({ maxLength: exports.DEVICE_CHAT_MAX_CONTEXT_LENGTH })),
334
- history: typebox_1.Type.Array(exports.DeviceChatHistoryMessageSchema, { maxItems: 12 }),
335
- agent: typebox_1.Type.Object({
336
- id: typebox_1.Type.String({ minLength: 1 }),
337
- name: typebox_1.Type.Optional(typebox_1.Type.String()),
338
- identity_md: typebox_1.Type.Optional(typebox_1.Type.String()),
339
- soul_md: typebox_1.Type.Optional(typebox_1.Type.String()),
340
- user_md: typebox_1.Type.Optional(typebox_1.Type.String()),
341
- }),
342
- }),
343
- context: exports.AutomationPollContextSchema,
344
- });
345
311
  /**
346
312
  * `payload` of an agent-turn poll response.
347
313
  *
@@ -724,15 +690,11 @@ exports.PollResponseSchema = typebox_1.Type.Object({
724
690
  /** Owning org of a claimed device-local CLI run. */
725
691
  organization_id: typebox_1.Type.Optional(typebox_1.Type.String()),
726
692
  /**
727
- * Device-local CLI envelope for `automation` or `chat_message` runs. The
728
- * gateway composes the prompt context and the device reports through the
729
- * matching completion endpoint. No connector code or credentials are shipped.
693
+ * Envelope for an `automation` run (a device-local CLI) or an `agent_turn`
694
+ * run. The gateway composes the prompt context and the worker reports
695
+ * through the matching completion endpoint. No connector code is shipped.
730
696
  */
731
- payload: typebox_1.Type.Optional(typebox_1.Type.Union([
732
- exports.AutomationPollPayloadSchema,
733
- exports.DeviceChatPollPayloadSchema,
734
- exports.AgentTurnPollPayloadSchema,
735
- ])),
697
+ payload: typebox_1.Type.Optional(typebox_1.Type.Union([exports.AutomationPollPayloadSchema, exports.AgentTurnPollPayloadSchema])),
736
698
  });
737
699
  exports.ActivatePageRequestSchema = typebox_1.Type.Object({
738
700
  worker_id: typebox_1.Type.String({ minLength: 1 }),
@@ -879,20 +841,6 @@ exports.CompleteAutomationResponseSchema = typebox_1.Type.Object({
879
841
  run_id: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Integer(), typebox_1.Type.Null()])),
880
842
  idempotent: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Boolean(), typebox_1.Type.Null()])),
881
843
  });
882
- /** `POST .../complete-chat` terminal report for a `chat_message` turn. */
883
- exports.CompleteDeviceChatRequestSchema = typebox_1.Type.Object({
884
- worker_id: typebox_1.Type.String(),
885
- output: typebox_1.Type.Optional(typebox_1.Type.String()),
886
- error: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
887
- exit_code: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Integer(), typebox_1.Type.Null()])),
888
- exit_signal: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
889
- exit_reason: typebox_1.Type.Optional(exports.WorkerExitReasonSchema),
890
- });
891
- exports.CompleteDeviceChatResponseSchema = typebox_1.Type.Object({
892
- ok: typebox_1.Type.Boolean(),
893
- status: typebox_1.Type.Union([typebox_1.Type.Literal("completed"), typebox_1.Type.Literal("failed")]),
894
- idempotent: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
895
- });
896
844
  /**
897
845
  * `POST /api/workers/complete-agent-turn`.
898
846
  *
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Device-pin tombstones on `connections.error_message`.
3
+ *
4
+ * DELETE /api/me/devices and PATCH device org-move un-pin connections and
5
+ * stamp a fixed error string so the UI can explain why a connector stopped.
6
+ * When a device re-registers / is re-pinned, every restore path MUST clear
7
+ * those strings — otherwise the connection is `active` + green while the
8
+ * header still shows red "Device was removed".
9
+ *
10
+ * Single source of truth for the stamp/clear literals and the live-pin
11
+ * predicate. The gateway (`packages/server/src/utils/device-pin-tombstones.ts`,
12
+ * which adds the DB clear) and the Owletto client
13
+ * (`packages/owletto/src/lib/device-pin-tombstone.ts`, which adds the display
14
+ * mask) both re-export this module. Keep stamp and clear sites on these exact
15
+ * literals.
16
+ */
17
+ /** Exact `connections.error_message` values written when a device pin is torn down. */
18
+ export declare const DEVICE_PIN_TOMBSTONE_MESSAGES: readonly ["Device was removed", "Device was moved to another workspace"];
19
+ export type DevicePinTombstoneMessage = (typeof DEVICE_PIN_TOMBSTONE_MESSAGES)[number];
20
+ export declare const DEVICE_REMOVED_TOMBSTONE: DevicePinTombstoneMessage;
21
+ export declare const DEVICE_MOVED_TOMBSTONE: DevicePinTombstoneMessage;
22
+ export declare function isDevicePinTombstone(message: string | null | undefined): message is DevicePinTombstoneMessage;
23
+ /**
24
+ * True when a listed connection still has a live device_workers row for its pin
25
+ * (join populated `device_last_seen_at` / handle). Tombstone should not be shown.
26
+ */
27
+ export declare function connectionHasLiveDevicePin(row: {
28
+ device_worker_id?: string | null;
29
+ device_last_seen_at?: string | Date | null;
30
+ device_worker_handle?: string | null;
31
+ device_label?: string | null;
32
+ }): boolean;
33
+ /**
34
+ * Effective error for API responses: suppress pin-tombstones once a device is
35
+ * pinned again (even if a write path forgot to clear the column).
36
+ */
37
+ export declare function effectiveConnectionErrorMessage(row: {
38
+ error_message?: string | null;
39
+ device_worker_id?: string | null;
40
+ device_last_seen_at?: string | Date | null;
41
+ device_worker_handle?: string | null;
42
+ device_label?: string | null;
43
+ }): string | null;
44
+ //# sourceMappingURL=device-pin-tombstones.d.ts.map
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ /**
3
+ * Device-pin tombstones on `connections.error_message`.
4
+ *
5
+ * DELETE /api/me/devices and PATCH device org-move un-pin connections and
6
+ * stamp a fixed error string so the UI can explain why a connector stopped.
7
+ * When a device re-registers / is re-pinned, every restore path MUST clear
8
+ * those strings — otherwise the connection is `active` + green while the
9
+ * header still shows red "Device was removed".
10
+ *
11
+ * Single source of truth for the stamp/clear literals and the live-pin
12
+ * predicate. The gateway (`packages/server/src/utils/device-pin-tombstones.ts`,
13
+ * which adds the DB clear) and the Owletto client
14
+ * (`packages/owletto/src/lib/device-pin-tombstone.ts`, which adds the display
15
+ * mask) both re-export this module. Keep stamp and clear sites on these exact
16
+ * literals.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.DEVICE_MOVED_TOMBSTONE = exports.DEVICE_REMOVED_TOMBSTONE = exports.DEVICE_PIN_TOMBSTONE_MESSAGES = void 0;
20
+ exports.isDevicePinTombstone = isDevicePinTombstone;
21
+ exports.connectionHasLiveDevicePin = connectionHasLiveDevicePin;
22
+ exports.effectiveConnectionErrorMessage = effectiveConnectionErrorMessage;
23
+ /** Exact `connections.error_message` values written when a device pin is torn down. */
24
+ exports.DEVICE_PIN_TOMBSTONE_MESSAGES = [
25
+ "Device was removed",
26
+ "Device was moved to another workspace",
27
+ ];
28
+ exports.DEVICE_REMOVED_TOMBSTONE = "Device was removed";
29
+ exports.DEVICE_MOVED_TOMBSTONE = "Device was moved to another workspace";
30
+ function isDevicePinTombstone(message) {
31
+ return (typeof message === "string" &&
32
+ exports.DEVICE_PIN_TOMBSTONE_MESSAGES.includes(message));
33
+ }
34
+ /**
35
+ * True when a listed connection still has a live device_workers row for its pin
36
+ * (join populated `device_last_seen_at` / handle). Tombstone should not be shown.
37
+ */
38
+ function connectionHasLiveDevicePin(row) {
39
+ if (!row.device_worker_id)
40
+ return false;
41
+ // Any of these being set means the LEFT JOIN to device_workers matched.
42
+ return (row.device_last_seen_at != null ||
43
+ row.device_worker_handle != null ||
44
+ row.device_label != null);
45
+ }
46
+ /**
47
+ * Effective error for API responses: suppress pin-tombstones once a device is
48
+ * pinned again (even if a write path forgot to clear the column).
49
+ */
50
+ function effectiveConnectionErrorMessage(row) {
51
+ const msg = row.error_message ?? null;
52
+ if (isDevicePinTombstone(msg) && connectionHasLiveDevicePin(row)) {
53
+ return null;
54
+ }
55
+ return msg;
56
+ }
57
+ //# sourceMappingURL=device-pin-tombstones.js.map
@@ -12,6 +12,7 @@ export type { CommandContext, CommandDefinition } from "./command-registry";
12
12
  export { CommandRegistry } from "./command-registry";
13
13
  export * from "./connector-query-errors";
14
14
  export * from "./constants";
15
+ export * from "./device-pin-tombstones";
15
16
  export * from "./contracts/interaction-envelope";
16
17
  export * from "./credentials";
17
18
  export * from "./classify-error";
@@ -48,6 +49,6 @@ export { slugify } from "./utils/slug";
48
49
  export * from "./utils/urls";
49
50
  export * from "./worker/auth";
50
51
  export type { WorkerTransport, WorkerTransportConfig, } from "./worker/transport";
51
- export type { DeviceExecutionTarget, JobType, MessagePayload, QueuedMessage, } from "./worker/wire";
52
+ export type { JobType, MessagePayload, QueuedMessage, } from "./worker/wire";
52
53
  export { withLobuFileParameters } from "./agent-tooling";
53
54
  //# sourceMappingURL=index.d.ts.map
@@ -30,6 +30,7 @@ var command_registry_1 = require("./command-registry");
30
30
  Object.defineProperty(exports, "CommandRegistry", { enumerable: true, get: function () { return command_registry_1.CommandRegistry; } });
31
31
  __exportStar(require("./connector-query-errors"), exports);
32
32
  __exportStar(require("./constants"), exports);
33
+ __exportStar(require("./device-pin-tombstones"), exports);
33
34
  // Interaction-envelope wire literals (tool_approval resourceKind / attribution).
34
35
  // Deep import `@lobu/core/contracts/interaction-envelope` also works under
35
36
  // bundler/NodeNext resolution; plugin packages with classic `moduleResolution:
@@ -11,30 +11,9 @@ const USE_WINSTON_LOGGER = process.env.USE_WINSTON_LOGGER === "true";
11
11
  const USE_JSON_FORMAT = process.env.LOG_FORMAT === "json";
12
12
  const winston_1 = __importDefault(require("winston"));
13
13
  const diagnostic_scrubber_1 = require("./utils/diagnostic-scrubber");
14
- const SENSITIVE_LOG_KEY_PATTERN = /(?:credential|secret|token|password|api(?:_|-)?key|authorization)/i;
15
- function createRedactingReplacer() {
16
- const seen = new WeakSet();
17
- return (key, value) => {
18
- if (SENSITIVE_LOG_KEY_PATTERN.test(key))
19
- return "[REDACTED]";
20
- if (value instanceof Error) {
21
- return {
22
- name: value.name,
23
- message: value.message,
24
- stack: value.stack,
25
- };
26
- }
27
- if (typeof value === "object" && value !== null) {
28
- if (seen.has(value))
29
- return "[Circular Reference]";
30
- seen.add(value);
31
- }
32
- return value;
33
- };
34
- }
35
14
  function safeStringify(value, space) {
36
15
  try {
37
- return JSON.stringify((0, diagnostic_scrubber_1.scrubDiagnosticValue)(value), createRedactingReplacer(), space);
16
+ return JSON.stringify((0, diagnostic_scrubber_1.scrubDiagnosticValue)(value), null, space);
38
17
  }
39
18
  catch {
40
19
  return "[unserializable]";
@@ -63,7 +42,9 @@ function createConsoleLogger(serviceName) {
63
42
  // Keep the metadata object as a trailing arg so it still renders.
64
43
  // Slicing it away accepted the signature and then dropped the payload,
65
44
  // emptying every structured diagnostic that uses this call shape.
66
- msgStr = args[0];
45
+ // The message itself is a string, so it takes the same boundary
46
+ // scrubbing as any other string message.
47
+ msgStr = (0, diagnostic_scrubber_1.scrubDiagnosticValue)(args[0]);
67
48
  args = [message, ...args.slice(1)];
68
49
  }
69
50
  else {
@@ -72,7 +53,11 @@ function createConsoleLogger(serviceName) {
72
53
  }
73
54
  }
74
55
  else {
75
- msgStr = String(message);
56
+ // Everything else funnels through String() here: plain strings,
57
+ // Errors, and top-level arrays (their join is just message text).
58
+ // Scrub the converted text — the removed final scrub used to cover
59
+ // all of these, and that coverage now lives here.
60
+ msgStr = (0, diagnostic_scrubber_1.scrubDiagnosticValue)(String(message));
76
61
  }
77
62
  if (USE_JSON_FORMAT) {
78
63
  return safeStringify({
@@ -90,7 +75,7 @@ function createConsoleLogger(serviceName) {
90
75
  if (args.length > 0) {
91
76
  msgStr += ` ${safeStringify(args.length === 1 ? args[0] : args)}`;
92
77
  }
93
- return `[${timestamp.replace("T", " ").slice(0, 19)}] [${lvl}] [${serviceName}] ${(0, diagnostic_scrubber_1.scrubDiagnosticValue)(msgStr)}`;
78
+ return `[${timestamp.replace("T", " ").slice(0, 19)}] [${lvl}] [${serviceName}] ${msgStr}`;
94
79
  };
95
80
  return {
96
81
  error: (message, ...args) => {