@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.
- package/dist/component.json +1 -1
- package/dist/dependencies.bun.lock +91 -83
- package/npm-shrinkwrap.json +492 -438
- package/package.json +12 -2
- package/vendor/cli/dist/bundled-skills/lobu/SKILL.md +1 -1
- package/vendor/cli/dist/commands/_lib/apply/apply-cmd.js +5 -6
- package/vendor/cli/dist/commands/_lib/apply/client.d.ts +1 -0
- package/vendor/cli/dist/commands/_lib/apply/client.js +26 -7
- package/vendor/cli/dist/commands/_lib/apply/desired-state.d.ts +9 -1
- package/vendor/cli/dist/commands/_lib/apply/diff.d.ts +1 -0
- package/vendor/cli/dist/commands/_lib/apply/diff.js +46 -4
- package/vendor/cli/dist/commands/_lib/apply/map-config.js +18 -38
- package/vendor/cli/dist/commands/_lib/init-from-org/bootstrap.js +5 -17
- package/vendor/cli/dist/commands/init.d.ts +0 -2
- package/vendor/cli/dist/commands/init.js +0 -27
- package/vendor/cli/dist/commands/login.d.ts +17 -0
- package/vendor/cli/dist/commands/login.js +43 -17
- package/vendor/cli/dist/commands/memory/_lib/errors.d.ts +0 -8
- package/vendor/cli/dist/commands/memory/_lib/errors.js +0 -12
- package/vendor/cli/dist/commands/memory/_lib/mcp.js +6 -6
- package/vendor/cli/dist/commands/memory/_lib/seed-cmd.js +4 -10
- package/vendor/cli/dist/config/define.d.ts +21 -15
- package/vendor/cli/dist/config/define.js +2 -2
- package/vendor/cli/dist/connectors/README.md +21 -6
- package/vendor/cli/dist/connectors/_google/actions.ts +270 -0
- package/vendor/cli/dist/connectors/_google/discovery/calendar_v3.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/chat_v1.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/docs_v1.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/drive_v3.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/gmail_v1.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/people_v1.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/sheets_v4.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/tasks_v1.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/youtube_v3.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery.ts +442 -0
- package/vendor/cli/dist/connectors/_google/errors.ts +91 -0
- package/vendor/cli/dist/connectors/_google/list-feed.ts +223 -0
- package/vendor/cli/dist/connectors/_google/policies.ts +127 -0
- package/vendor/cli/dist/connectors/agentid.ts +43 -0
- package/vendor/cli/dist/connectors/chat-user-identity.ts +2 -1
- package/vendor/cli/dist/connectors/github-automation-events.ts +9 -0
- package/vendor/cli/dist/connectors/github-identity.ts +28 -3
- package/vendor/cli/dist/connectors/github.ts +101 -59
- package/vendor/cli/dist/connectors/google_calendar.ts +207 -719
- package/vendor/cli/dist/connectors/google_drive.ts +16 -2
- package/vendor/cli/dist/connectors/google_gmail.ts +52 -33
- package/vendor/cli/dist/connectors/herdr.ts +406 -0
- package/vendor/cli/dist/connectors/jira-helpers.ts +313 -0
- package/vendor/cli/dist/connectors/jira.ts +35 -227
- package/vendor/cli/dist/connectors/linear.ts +7 -4
- package/vendor/cli/dist/connectors/linkedin-browser-script.ts +13 -0
- package/vendor/cli/dist/connectors/linkedin-draft-page.js +104 -0
- package/vendor/cli/dist/connectors/linkedin-drafts.ts +73 -0
- package/vendor/cli/dist/connectors/linkedin-identity.ts +32 -0
- package/vendor/cli/dist/connectors/linkedin-inbox-adapter.js +1185 -0
- package/vendor/cli/dist/connectors/linkedin-inbox.ts +156 -0
- package/vendor/cli/dist/connectors/linkedin-like.ts +114 -0
- package/vendor/cli/dist/connectors/linkedin-takeout.ts +577 -0
- package/vendor/cli/dist/connectors/linkedin.ts +3998 -0
- package/vendor/cli/dist/connectors/postgres.ts +27 -2
- package/vendor/cli/dist/connectors/takeout-utils.ts +240 -0
- package/vendor/cli/dist/connectors/tiktok-inbox-page.js +230 -0
- package/vendor/cli/dist/connectors/tiktok-web-page.js +217 -0
- package/vendor/cli/dist/connectors/tiktok_web.ts +319 -0
- package/vendor/cli/dist/connectors/whatsapp-web-adapter.js +285 -567
- package/vendor/cli/dist/connectors/whatsapp-web-helpers.ts +74 -455
- package/vendor/cli/dist/connectors/whatsapp-web-identity.ts +135 -0
- package/vendor/cli/dist/connectors/whatsapp_web.ts +159 -618
- package/vendor/cli/dist/connectors/x-dm-adapter.js +556 -0
- package/vendor/cli/dist/connectors/x-identity.ts +31 -2
- package/vendor/cli/dist/connectors/x.ts +539 -253
- package/vendor/cli/dist/index.js +1 -37
- package/vendor/cli/dist/internal/context.d.ts +10 -0
- package/vendor/cli/dist/internal/context.js +26 -16
- package/vendor/cli/dist/internal/node-version.d.ts +1 -1
- package/vendor/cli/dist/internal/node-version.js +1 -1
- package/vendor/cli/dist/internal/oauth.d.ts +3 -1
- package/vendor/cli/dist/internal/oauth.js +4 -3
- package/vendor/cli/dist/internal/runtime-components.d.ts +9 -0
- package/vendor/cli/dist/internal/runtime-components.js +67 -2
- package/vendor/cli/dist/mac-auth.js +17 -1
- package/vendor/cli/dist/providers.json +1 -1
- package/vendor/cli/dist/runtime-components.json +4 -4
- package/vendor/cli/dist/templates/AGENTS.md.tmpl +12 -5
- package/vendor/cli/dist/templates/README.md.tmpl +1 -1
- package/vendor/cli/dist/vendor/ora/.bun-tag-fde20e9a6df212fa +0 -0
- package/vendor/cli/dist/vendor/ora/index.d.ts +332 -0
- package/vendor/cli/dist/vendor/ora/index.js +424 -0
- package/vendor/cli/dist/vendor/ora/license +9 -0
- package/vendor/cli/dist/vendor/ora/package.json +64 -0
- package/vendor/cli/dist/vendor/ora/readme.md +329 -0
- package/vendor/cli/package.json +2 -2
- package/vendor/connector-sdk/dist/browser-handoff-banner.d.ts +39 -0
- package/vendor/connector-sdk/dist/browser-handoff-banner.js +175 -0
- package/vendor/connector-sdk/dist/browser-requirement.d.ts +36 -0
- package/vendor/connector-sdk/dist/browser-requirement.js +60 -0
- package/vendor/connector-sdk/dist/browser-source-read.d.ts +52 -0
- package/vendor/connector-sdk/dist/browser-source-read.js +107 -0
- package/vendor/connector-sdk/dist/connector-runtime.d.ts +3 -1
- package/vendor/connector-sdk/dist/connector-runtime.js +10 -0
- package/vendor/connector-sdk/dist/connector-types.d.ts +169 -45
- package/vendor/connector-sdk/dist/define-connector.d.ts +4 -2
- package/vendor/connector-sdk/dist/define-connector.js +3 -0
- package/vendor/connector-sdk/dist/index.d.ts +8 -2
- package/vendor/connector-sdk/dist/index.js +3 -0
- package/vendor/connector-sdk/dist/reaction-client-types.d.ts +16 -21
- package/vendor/connector-sdk/dist/reaction-client-types.typecheck.d.ts +5 -0
- package/vendor/connector-sdk/package.json +13 -1
- package/vendor/connector-worker/dist/agent-turn/guest-entry.js +43 -30
- package/vendor/connector-worker/dist/agent-turn/guest.bundle.js +416 -330
- package/vendor/connector-worker/dist/agent-turn/memory.d.ts +3 -2
- package/vendor/connector-worker/dist/agent-turn/memory.js +3 -20
- package/vendor/connector-worker/dist/agent-turn/types.d.ts +3 -15
- package/vendor/connector-worker/dist/agent-turn/workspace.d.ts +2 -2
- package/vendor/connector-worker/dist/agent-turn/workspace.js +2 -4
- package/vendor/connector-worker/dist/daemon/action-monitor.d.ts +12 -0
- package/vendor/connector-worker/dist/daemon/action-monitor.js +25 -0
- package/vendor/connector-worker/dist/daemon/agent-turn.js +0 -9
- package/vendor/connector-worker/dist/daemon/automation.d.ts +4 -11
- package/vendor/connector-worker/dist/daemon/automation.js +6 -6
- package/vendor/connector-worker/dist/daemon/builtins/index.d.ts +12 -0
- package/vendor/connector-worker/dist/daemon/builtins/index.js +61 -1
- package/vendor/connector-worker/dist/daemon/builtins/os-shell.d.ts +2 -1
- package/vendor/connector-worker/dist/daemon/builtins/os-shell.js +40 -27
- package/vendor/connector-worker/dist/daemon/client.d.ts +6 -4
- package/vendor/connector-worker/dist/daemon/client.js +3 -3
- package/vendor/connector-worker/dist/daemon/device-concurrency.d.ts +8 -0
- package/vendor/connector-worker/dist/daemon/device-concurrency.js +13 -0
- package/vendor/connector-worker/dist/daemon/executor.d.ts +1 -1
- package/vendor/connector-worker/dist/daemon/executor.js +48 -120
- package/vendor/connector-worker/dist/daemon/log.d.ts +2 -0
- package/vendor/connector-worker/dist/daemon/log.js +23 -2
- package/vendor/connector-worker/dist/daemon/mac-device-daemon.d.ts +23 -6
- package/vendor/connector-worker/dist/daemon/mac-device-daemon.js +57 -23
- package/vendor/connector-worker/dist/daemon/native-bridge/client.d.ts +6 -0
- package/vendor/connector-worker/dist/daemon/native-bridge/client.js +15 -0
- package/vendor/connector-worker/dist/daemon/native-bridge/executor.js +29 -25
- package/vendor/connector-worker/dist/daemon/native-bridge/protocol.d.ts +1 -1
- package/vendor/connector-worker/dist/daemon/native-bridge/protocol.js +1 -0
- package/vendor/connector-worker/dist/daemon/poll-loop.d.ts +3 -0
- package/vendor/connector-worker/dist/daemon/poll-loop.js +5 -1
- package/vendor/connector-worker/dist/daemon/start.d.ts +1 -0
- package/vendor/connector-worker/dist/daemon/start.js +15 -20
- package/vendor/connector-worker/dist/daemon/terminal-failure.js +0 -11
- package/vendor/connector-worker/dist/daemon/worker-id.d.ts +17 -0
- package/vendor/connector-worker/dist/daemon/worker-id.js +22 -0
- package/vendor/connector-worker/dist/executor/interface.d.ts +34 -2
- package/vendor/connector-worker/dist/executor/isolate.js +66 -15
- package/vendor/connector-worker/dist/executor/redact.d.ts +1 -0
- package/vendor/connector-worker/dist/executor/redact.js +97 -26
- package/vendor/connector-worker/dist/executor/runtime.d.ts +7 -0
- package/vendor/connector-worker/dist/executor/runtime.js +26 -0
- package/vendor/connector-worker/dist/isolate/bridge.js +3 -1
- package/vendor/connector-worker/dist/mac-device-daemon.js +24 -29
- package/vendor/connector-worker/package.json +2 -2
- package/vendor/core/dist/agent-policy.js +1 -1
- package/vendor/core/dist/agent-store.d.ts +2 -0
- package/vendor/core/dist/agent-tooling.d.ts +1 -1
- package/vendor/core/dist/agent-tooling.js +1 -1
- package/vendor/core/dist/capabilities.d.ts +1 -1
- package/vendor/core/dist/capabilities.js +2 -1
- package/vendor/core/dist/connector-query-errors.d.ts +32 -0
- package/vendor/core/dist/connector-query-errors.js +41 -1
- package/vendor/core/dist/contracts/agent-settings.d.ts +0 -11
- package/vendor/core/dist/contracts/agent-settings.js +1 -7
- package/vendor/core/dist/contracts/tools/collection-presentation.d.ts +93 -0
- package/vendor/core/dist/contracts/tools/collection-presentation.js +88 -0
- package/vendor/core/dist/contracts/tools/collection-selection.d.ts +47 -0
- package/vendor/core/dist/contracts/tools/collection-selection.js +74 -0
- package/vendor/core/dist/contracts/tools/manage-agents.d.ts +10 -4
- package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +1 -1
- package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +5 -1
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +19 -4
- package/vendor/core/dist/contracts/tools/manage-automations.js +25 -8
- package/vendor/core/dist/contracts/tools/manage-connections.d.ts +1 -0
- package/vendor/core/dist/contracts/tools/manage-connections.js +3 -0
- package/vendor/core/dist/contracts/tools/manage-conversations.js +2 -2
- package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +11 -0
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +42 -3
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +181 -152
- package/vendor/core/dist/contracts/tools/manage-entity.js +118 -162
- package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +14 -0
- package/vendor/core/dist/contracts/tools/manage-feeds.js +17 -0
- package/vendor/core/dist/contracts/tools/manage-operations.d.ts +41 -3
- package/vendor/core/dist/contracts/tools/manage-operations.js +40 -2
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +182 -7
- package/vendor/core/dist/contracts/tools/manage-views.js +49 -13
- package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +11 -2
- package/vendor/core/dist/contracts/tools/read-knowledge.js +23 -3
- package/vendor/core/dist/contracts/tools/save-memory.d.ts +3 -6
- package/vendor/core/dist/contracts/tools/save-memory.js +2 -6
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +2 -1
- package/vendor/core/dist/contracts/tools/view-attach.js +7 -2
- package/vendor/core/dist/contracts/worker/protocol.d.ts +130 -159
- package/vendor/core/dist/contracts/worker/protocol.js +88 -76
- package/vendor/core/dist/device-pin-tombstones.d.ts +44 -0
- package/vendor/core/dist/device-pin-tombstones.js +57 -0
- package/vendor/core/dist/index.d.ts +5 -5
- package/vendor/core/dist/index.js +4 -6
- package/vendor/core/dist/json-template.d.ts +6 -10
- package/vendor/core/dist/json-template.js +5 -9
- package/vendor/core/dist/logger.js +17 -26
- package/vendor/core/dist/shell-safety.d.ts +9 -0
- package/vendor/core/dist/shell-safety.js +154 -0
- package/vendor/core/dist/suggestions.d.ts +1 -1
- package/vendor/core/dist/suggestions.js +1 -1
- package/vendor/core/dist/tool-trace-summary.d.ts +1 -1
- package/vendor/core/dist/tool-trace-summary.js +1 -1
- package/vendor/core/dist/types.d.ts +1 -3
- package/vendor/core/dist/utils/diagnostic-scrubber.d.ts +7 -0
- package/vendor/core/dist/utils/diagnostic-scrubber.js +437 -0
- package/vendor/core/dist/worker/auth.d.ts +44 -6
- package/vendor/core/dist/worker/auth.js +44 -11
- package/vendor/core/dist/worker/wire.d.ts +0 -10
- package/vendor/core/package.json +20 -11
- package/vendor/ora/.bun-tag-fde20e9a6df212fa +0 -0
- package/vendor/ora/index.d.ts +332 -0
- package/vendor/ora/index.js +424 -0
- package/vendor/ora/license +9 -0
- package/vendor/ora/package.json +53 -0
- package/vendor/ora/readme.md +329 -0
- package/vendor/cli/dist/commands/telemetry.d.ts +0 -10
- package/vendor/cli/dist/commands/telemetry.js +0 -66
- package/vendor/connector-worker/dist/daemon/device-chat.d.ts +0 -9
- package/vendor/connector-worker/dist/daemon/device-chat.js +0 -61
- package/vendor/core/dist/contracts/worker/device-chat.d.ts +0 -4
- package/vendor/core/dist/contracts/worker/device-chat.js +0 -26
- package/vendor/core/dist/sentry.d.ts +0 -26
- package/vendor/core/dist/sentry.js +0 -133
- package/vendor/core/dist/tool-policy.d.ts +0 -74
- package/vendor/core/dist/tool-policy.js +0 -305
- package/vendor/core/dist/utils/sentry-scrubber.d.ts +0 -29
- package/vendor/core/dist/utils/sentry-scrubber.js +0 -228
|
@@ -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-
|
|
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,12 +26,30 @@
|
|
|
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.DispatchChromeActionResponseSchema = exports.DispatchChromeActionRequestSchema = 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.
|
|
30
|
-
exports.HeartbeatResponseSchema = 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");
|
|
32
|
+
const manage_operations_1 = require("../tools/manage-operations");
|
|
33
33
|
exports.CONNECTOR_HTTP_AUTH_CAPABILITY = "http_auth";
|
|
34
34
|
exports.CONNECTOR_HTTP_MAX_BYTES = 4 * 1024 * 1024;
|
|
35
|
+
/** Source identity for device controls, named like the operations activity feed fields. */
|
|
36
|
+
exports.SourceAttributionSchema = typebox_1.Type.Object({
|
|
37
|
+
platform: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
38
|
+
connection_id: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Integer(), typebox_1.Type.Null()])),
|
|
39
|
+
connection_name: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
40
|
+
feed_id: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Integer(), typebox_1.Type.Null()])),
|
|
41
|
+
feed_key: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
42
|
+
feed_name: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
43
|
+
automation_id: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Integer(), typebox_1.Type.Null()])),
|
|
44
|
+
automation_name: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
45
|
+
agent_id: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
46
|
+
agent_name: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
47
|
+
client_id: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
48
|
+
client_name: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
49
|
+
device_worker_id: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
50
|
+
device_label: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
51
|
+
device_platform: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
52
|
+
}, { additionalProperties: false });
|
|
35
53
|
exports.ConnectorHttpRequestSchema = typebox_1.Type.Object({
|
|
36
54
|
url: typebox_1.Type.String({ maxLength: 16384 }),
|
|
37
55
|
method: typebox_1.Type.String({ maxLength: 32 }),
|
|
@@ -62,15 +80,13 @@ exports.RunTypeSchema = typebox_1.Type.Union([
|
|
|
62
80
|
typebox_1.Type.Literal("sync"),
|
|
63
81
|
typebox_1.Type.Literal("action"),
|
|
64
82
|
typebox_1.Type.Literal("automation"),
|
|
65
|
-
typebox_1.Type.Literal("chat_message"),
|
|
66
83
|
typebox_1.Type.Literal("embed_backfill"),
|
|
67
84
|
typebox_1.Type.Literal("auth"),
|
|
68
85
|
/**
|
|
69
86
|
* One conversation turn executed as one isolate job, claimed only by a fleet
|
|
70
87
|
* worker that advertises the lane and run through `IsolateExecutor`. Distinct
|
|
71
|
-
* from `chat_message`, a lobu-queue row the gateway drains
|
|
72
|
-
*
|
|
73
|
-
* 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
|
|
74
90
|
* `agent_turn`: its dispatch would fall through to a connector sync.
|
|
75
91
|
*/
|
|
76
92
|
typebox_1.Type.Literal("agent_turn"),
|
|
@@ -133,13 +149,48 @@ exports.EXECUTION_BACKENDS = {
|
|
|
133
149
|
function defaultBackendCapacity() {
|
|
134
150
|
return { [exports.EXECUTION_BACKENDS.compiledConnector]: 1 };
|
|
135
151
|
}
|
|
136
|
-
/**
|
|
152
|
+
/** Source references only. Message bodies and arbitrary attributes never enter this transport. */
|
|
153
|
+
const FeedReferenceEventSchema = typebox_1.Type.Object({
|
|
154
|
+
id: typebox_1.Type.String({ minLength: 1, maxLength: 1024 }),
|
|
155
|
+
event_type: typebox_1.Type.String({ minLength: 1, maxLength: 100 }),
|
|
156
|
+
resource_ref: typebox_1.Type.String({ minLength: 1, maxLength: 1024 }),
|
|
157
|
+
resource_type: typebox_1.Type.Optional(typebox_1.Type.String({ minLength: 1, maxLength: 100 })),
|
|
158
|
+
occurred_at: typebox_1.Type.Optional(typebox_1.Type.String({ maxLength: 64 })),
|
|
159
|
+
}, { additionalProperties: false });
|
|
160
|
+
/** Each reference batch is atomic in the existing browser buffer and delivery transaction. */
|
|
161
|
+
const FeedReferenceBatchSchema = typebox_1.Type.Object({
|
|
162
|
+
id: typebox_1.Type.String({ minLength: 1, maxLength: 1024 }),
|
|
163
|
+
events: typebox_1.Type.Array(FeedReferenceEventSchema, { maxItems: 500 }),
|
|
164
|
+
checkpoint: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
165
|
+
previous: typebox_1.Type.Union([
|
|
166
|
+
typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown()),
|
|
167
|
+
typebox_1.Type.Null(),
|
|
168
|
+
]),
|
|
169
|
+
next: typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown()),
|
|
170
|
+
}, { additionalProperties: false })),
|
|
171
|
+
more: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
|
|
172
|
+
}, { additionalProperties: false });
|
|
173
|
+
const FeedSubscriptionNotificationSchema = typebox_1.Type.Object({
|
|
174
|
+
scope_key: typebox_1.Type.String({ minLength: 1, maxLength: 100 }),
|
|
175
|
+
binding_id: typebox_1.Type.String({ minLength: 1, maxLength: 200 }),
|
|
176
|
+
epoch: typebox_1.Type.String({ minLength: 1, maxLength: 200 }),
|
|
177
|
+
needs_rebind: typebox_1.Type.Boolean(),
|
|
178
|
+
records: typebox_1.Type.Array(typebox_1.Type.Object({
|
|
179
|
+
revision: typebox_1.Type.Integer({
|
|
180
|
+
minimum: 1,
|
|
181
|
+
maximum: Number.MAX_SAFE_INTEGER,
|
|
182
|
+
}),
|
|
183
|
+
payload: FeedReferenceBatchSchema,
|
|
184
|
+
}, { additionalProperties: false }), { maxItems: 25 }),
|
|
185
|
+
}, { additionalProperties: false });
|
|
186
|
+
/** Bounded source activity and optional reference deliveries included in a worker poll. */
|
|
137
187
|
exports.FeedNotificationSchema = typebox_1.Type.Object({
|
|
138
188
|
feed_id: typebox_1.Type.Integer({ minimum: 1 }),
|
|
139
189
|
connection_id: typebox_1.Type.Integer({ minimum: 1 }),
|
|
140
190
|
feed_key: typebox_1.Type.String({ minLength: 1, maxLength: 200 }),
|
|
141
191
|
notification_id: typebox_1.Type.String({ minLength: 1, maxLength: 200 }),
|
|
142
192
|
changed: typebox_1.Type.Boolean(),
|
|
193
|
+
subscription: typebox_1.Type.Optional(FeedSubscriptionNotificationSchema),
|
|
143
194
|
});
|
|
144
195
|
/**
|
|
145
196
|
* Ceiling on how long the gateway holds an empty claim request. A client that
|
|
@@ -167,7 +218,7 @@ exports.PollRequestSchema = typebox_1.Type.Object({
|
|
|
167
218
|
*/
|
|
168
219
|
label: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
169
220
|
connector_manifests: typebox_1.Type.Optional(typebox_1.Type.Unknown()),
|
|
170
|
-
/** Connector feed wake hints
|
|
221
|
+
/** Connector feed wake hints, plus source-reference deliveries for subscribed read-only feeds. */
|
|
171
222
|
feed_notifications: typebox_1.Type.Optional(typebox_1.Type.Array(exports.FeedNotificationSchema, { maxItems: 64 })),
|
|
172
223
|
/**
|
|
173
224
|
* Agent kinds this device can run for Automations (e.g. `["claude-code"]`).
|
|
@@ -220,7 +271,7 @@ exports.AutomationPollEventSchema = typebox_1.Type.Object({
|
|
|
220
271
|
fired_at: typebox_1.Type.String(),
|
|
221
272
|
payload: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown())),
|
|
222
273
|
});
|
|
223
|
-
/** Identity context for a device-local CLI run
|
|
274
|
+
/** Identity context for a device-local Automation CLI run. */
|
|
224
275
|
exports.AutomationPollContextSchema = typebox_1.Type.Object({
|
|
225
276
|
device: typebox_1.Type.Object({ worker_id: typebox_1.Type.Optional(typebox_1.Type.String()) }),
|
|
226
277
|
user: typebox_1.Type.Object({
|
|
@@ -257,37 +308,6 @@ exports.AutomationPollPayloadSchema = typebox_1.Type.Object({
|
|
|
257
308
|
event: exports.AutomationPollEventSchema,
|
|
258
309
|
context: exports.AutomationPollContextSchema,
|
|
259
310
|
});
|
|
260
|
-
/** One bounded prior turn shipped to a stateless device CLI. */
|
|
261
|
-
exports.DeviceChatHistoryMessageSchema = typebox_1.Type.Object({
|
|
262
|
-
role: typebox_1.Type.Union([typebox_1.Type.Literal("user"), typebox_1.Type.Literal("assistant")]),
|
|
263
|
-
content: typebox_1.Type.String({ maxLength: 16000 }),
|
|
264
|
-
});
|
|
265
|
-
/**
|
|
266
|
-
* Cap on the device chat envelope's `ephemeral_context`. Exported because the
|
|
267
|
-
* producer must agree with it BEFORE enqueueing: the server-side planner keeps
|
|
268
|
-
* an Automation whose composed instructions exceed this bound on the durable
|
|
269
|
-
* background lane rather than shipping a device turn the poll route would
|
|
270
|
-
* silently truncate.
|
|
271
|
-
*/
|
|
272
|
-
exports.DEVICE_CHAT_MAX_CONTEXT_LENGTH = 2048;
|
|
273
|
-
/** Device-local chat execution metadata. Conversation ownership stays with `agent.id`. */
|
|
274
|
-
exports.DeviceChatPollPayloadSchema = typebox_1.Type.Object({
|
|
275
|
-
chat: typebox_1.Type.Object({
|
|
276
|
-
agent_kind: typebox_1.Type.String({ minLength: 1, maxLength: 64 }),
|
|
277
|
-
execution_config: typebox_1.Type.Optional(exports.AutomationExecutionConfigSchema),
|
|
278
|
-
message: typebox_1.Type.String({ maxLength: 32000 }),
|
|
279
|
-
ephemeral_context: typebox_1.Type.Optional(typebox_1.Type.String({ maxLength: exports.DEVICE_CHAT_MAX_CONTEXT_LENGTH })),
|
|
280
|
-
history: typebox_1.Type.Array(exports.DeviceChatHistoryMessageSchema, { maxItems: 12 }),
|
|
281
|
-
agent: typebox_1.Type.Object({
|
|
282
|
-
id: typebox_1.Type.String({ minLength: 1 }),
|
|
283
|
-
name: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
284
|
-
identity_md: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
285
|
-
soul_md: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
286
|
-
user_md: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
287
|
-
}),
|
|
288
|
-
}),
|
|
289
|
-
context: exports.AutomationPollContextSchema,
|
|
290
|
-
});
|
|
291
311
|
/**
|
|
292
312
|
* `payload` of an agent-turn poll response.
|
|
293
313
|
*
|
|
@@ -482,7 +502,7 @@ exports.AgentTurnPollPayloadSchema = typebox_1.Type.Object({
|
|
|
482
502
|
input_schema: typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown()),
|
|
483
503
|
})),
|
|
484
504
|
/**
|
|
485
|
-
* The workspace tools
|
|
505
|
+
* The workspace tools available for this turn. They run against
|
|
486
506
|
* a per-turn in-memory filesystem inside the isolate: local `bash` is
|
|
487
507
|
* just-bash, the rest are pi's file tools over the same filesystem.
|
|
488
508
|
* Absent or empty → no workspace tools.
|
|
@@ -504,14 +524,8 @@ exports.AgentTurnPollPayloadSchema = typebox_1.Type.Object({
|
|
|
504
524
|
* remain in the in-memory workspace.
|
|
505
525
|
*/
|
|
506
526
|
remote_runtime: typebox_1.Type.Optional(typebox_1.Type.Object({ provider_id: typebox_1.Type.String({ minLength: 1 }) })),
|
|
507
|
-
/** The agent's bash prefix policy, enforced before a command runs. */
|
|
508
|
-
bash_policy: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
509
|
-
allow_all: typebox_1.Type.Boolean(),
|
|
510
|
-
allow_prefixes: typebox_1.Type.Array(typebox_1.Type.String()),
|
|
511
|
-
deny_prefixes: typebox_1.Type.Array(typebox_1.Type.String()),
|
|
512
|
-
})),
|
|
513
527
|
/**
|
|
514
|
-
* The gateway tools
|
|
528
|
+
* The gateway tools available for this turn, by NAME only —
|
|
515
529
|
* `ask_user`, `send_message`, `suggest_actions` and the rest of
|
|
516
530
|
* `@lobu/plugin-conversations`. The guest runs that package's own
|
|
517
531
|
* implementation, so the route, the request body and the schema live
|
|
@@ -523,7 +537,7 @@ exports.AgentTurnPollPayloadSchema = typebox_1.Type.Object({
|
|
|
523
537
|
*/
|
|
524
538
|
gateway: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String({ minLength: 1 }))),
|
|
525
539
|
/**
|
|
526
|
-
* The media tools
|
|
540
|
+
* The media tools available for this turn, by NAME only —
|
|
527
541
|
* `upload_file`, `generate_image`, `generate_audio` from
|
|
528
542
|
* `@lobu/plugin-media`. Same contract as `gateway` above: the guest
|
|
529
543
|
* runs that package's own implementation, so the routes and schemas
|
|
@@ -601,6 +615,10 @@ exports.FeedSourceAckSchema = typebox_1.Type.Object({
|
|
|
601
615
|
});
|
|
602
616
|
/** `POST /api/workers/poll` response body (a claimed run, or a poll-again). */
|
|
603
617
|
exports.PollResponseSchema = typebox_1.Type.Object({
|
|
618
|
+
/** Server-owned display identity. Never sourced from action_input. */
|
|
619
|
+
source_attribution: typebox_1.Type.Optional(exports.SourceAttributionSchema),
|
|
620
|
+
/** Existing run permalink, built by the server for this admitted operation. */
|
|
621
|
+
source_url: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
604
622
|
next_poll_seconds: typebox_1.Type.Optional(typebox_1.Type.Number()),
|
|
605
623
|
feed_notification_receipts: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
|
|
606
624
|
feed_id: typebox_1.Type.Integer(),
|
|
@@ -618,6 +636,10 @@ exports.PollResponseSchema = typebox_1.Type.Object({
|
|
|
618
636
|
feed_key: typebox_1.Type.String(),
|
|
619
637
|
device_worker_id: typebox_1.Type.String(),
|
|
620
638
|
ack: typebox_1.Type.Union([exports.FeedSourceAckSchema, typebox_1.Type.Null()]),
|
|
639
|
+
subscription: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
640
|
+
scope_key: typebox_1.Type.String(),
|
|
641
|
+
event_types: typebox_1.Type.Array(typebox_1.Type.String()),
|
|
642
|
+
})),
|
|
621
643
|
})),
|
|
622
644
|
page_activations: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
|
|
623
645
|
run_id: typebox_1.Type.Integer(),
|
|
@@ -653,6 +675,7 @@ exports.PollResponseSchema = typebox_1.Type.Object({
|
|
|
653
675
|
feed_id: typebox_1.Type.Optional(typebox_1.Type.Integer()),
|
|
654
676
|
compiled_code: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
655
677
|
session_state: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown())),
|
|
678
|
+
browser_grant: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown())),
|
|
656
679
|
connector_version: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
657
680
|
action_key: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
658
681
|
/** Native device operation key; public connector operations use action_key. */
|
|
@@ -667,15 +690,11 @@ exports.PollResponseSchema = typebox_1.Type.Object({
|
|
|
667
690
|
/** Owning org of a claimed device-local CLI run. */
|
|
668
691
|
organization_id: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
669
692
|
/**
|
|
670
|
-
*
|
|
671
|
-
* gateway composes the prompt context and the
|
|
672
|
-
* matching completion endpoint. No connector code
|
|
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.
|
|
673
696
|
*/
|
|
674
|
-
payload: typebox_1.Type.Optional(typebox_1.Type.Union([
|
|
675
|
-
exports.AutomationPollPayloadSchema,
|
|
676
|
-
exports.DeviceChatPollPayloadSchema,
|
|
677
|
-
exports.AgentTurnPollPayloadSchema,
|
|
678
|
-
])),
|
|
697
|
+
payload: typebox_1.Type.Optional(typebox_1.Type.Union([exports.AutomationPollPayloadSchema, exports.AgentTurnPollPayloadSchema])),
|
|
679
698
|
});
|
|
680
699
|
exports.ActivatePageRequestSchema = typebox_1.Type.Object({
|
|
681
700
|
worker_id: typebox_1.Type.String({ minLength: 1 }),
|
|
@@ -691,8 +710,8 @@ exports.ActivatePageResponseSchema = typebox_1.Type.Object({
|
|
|
691
710
|
* One collected item in a `/stream` batch. This is the SERVER-accepted superset:
|
|
692
711
|
* the connector-worker's `ContentItem` sends the plain-content subset (id,
|
|
693
712
|
* payload_text, author/source/score/embedding…), while richer producers (the
|
|
694
|
-
* chrome extension
|
|
695
|
-
* `payload_data
|
|
713
|
+
* chrome extension and media feeds) also send `payload_type` with
|
|
714
|
+
* structured `payload_data` and `attachments`. All are optional
|
|
696
715
|
* so a bare content item still validates.
|
|
697
716
|
*/
|
|
698
717
|
exports.ContentItemSchema = typebox_1.Type.Object({
|
|
@@ -701,13 +720,11 @@ exports.ContentItemSchema = typebox_1.Type.Object({
|
|
|
701
720
|
payload_type: typebox_1.Type.Optional(typebox_1.Type.Union([
|
|
702
721
|
typebox_1.Type.Literal("text"),
|
|
703
722
|
typebox_1.Type.Literal("markdown"),
|
|
704
|
-
typebox_1.Type.Literal("json_template"),
|
|
705
723
|
typebox_1.Type.Literal("media"),
|
|
706
724
|
typebox_1.Type.Literal("empty"),
|
|
707
725
|
])),
|
|
708
726
|
payload_text: typebox_1.Type.String(),
|
|
709
727
|
payload_data: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown())),
|
|
710
|
-
payload_template: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown()), typebox_1.Type.Null()])),
|
|
711
728
|
attachments: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Unknown())),
|
|
712
729
|
author_name: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
713
730
|
occurred_at: typebox_1.Type.String(),
|
|
@@ -824,20 +841,6 @@ exports.CompleteAutomationResponseSchema = typebox_1.Type.Object({
|
|
|
824
841
|
run_id: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Integer(), typebox_1.Type.Null()])),
|
|
825
842
|
idempotent: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Boolean(), typebox_1.Type.Null()])),
|
|
826
843
|
});
|
|
827
|
-
/** `POST .../complete-chat` terminal report for a `chat_message` turn. */
|
|
828
|
-
exports.CompleteDeviceChatRequestSchema = typebox_1.Type.Object({
|
|
829
|
-
worker_id: typebox_1.Type.String(),
|
|
830
|
-
output: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
831
|
-
error: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
832
|
-
exit_code: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Integer(), typebox_1.Type.Null()])),
|
|
833
|
-
exit_signal: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
834
|
-
exit_reason: typebox_1.Type.Optional(exports.WorkerExitReasonSchema),
|
|
835
|
-
});
|
|
836
|
-
exports.CompleteDeviceChatResponseSchema = typebox_1.Type.Object({
|
|
837
|
-
ok: typebox_1.Type.Boolean(),
|
|
838
|
-
status: typebox_1.Type.Union([typebox_1.Type.Literal("completed"), typebox_1.Type.Literal("failed")]),
|
|
839
|
-
idempotent: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
|
|
840
|
-
});
|
|
841
844
|
/**
|
|
842
845
|
* `POST /api/workers/complete-agent-turn`.
|
|
843
846
|
*
|
|
@@ -1102,6 +1105,15 @@ exports.HeartbeatRequestSchema = typebox_1.Type.Object({
|
|
|
1102
1105
|
*/
|
|
1103
1106
|
turn_tool_events: typebox_1.Type.Optional(typebox_1.Type.Array(exports.TurnToolEventSchema, { maxItems: exports.TURN_TOOL_EVENT_QUEUE_MAX })),
|
|
1104
1107
|
});
|
|
1108
|
+
/**
|
|
1109
|
+
* Request the gateway delegate a native device operation on behalf of a
|
|
1110
|
+
* running connector action. Scoped to the parent run's live claim.
|
|
1111
|
+
*/
|
|
1112
|
+
exports.ExecuteConnectorOperationRequestSchema = typebox_1.Type.Object({
|
|
1113
|
+
parent_run_id: typebox_1.Type.Integer({ minimum: 1 }),
|
|
1114
|
+
worker_id: typebox_1.Type.String({ minLength: 1 }),
|
|
1115
|
+
request: manage_operations_1.ConnectorOperationRequestSchema,
|
|
1116
|
+
}, { additionalProperties: false });
|
|
1105
1117
|
/**
|
|
1106
1118
|
* Request the gateway dispatch a chrome connector action on behalf of a
|
|
1107
1119
|
* running sync. Scoped to the parent run's org.
|
|
@@ -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
|
|
@@ -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 "./
|
|
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";
|
|
@@ -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";
|
|
@@ -29,9 +30,8 @@ export type { ProviderConfigEntry, ProviderOAuthConfig, ProviderOAuthGrantKind,
|
|
|
29
30
|
export { isSdkCompat, type PiAiApi, resolveSdkCompat, SDK_COMPAT_PROTOCOLS, type SdkCompat, type SdkCompatProtocol, } from "./sdk-compat";
|
|
30
31
|
export * from "./secret-refs";
|
|
31
32
|
export * from "./reserved";
|
|
32
|
-
export { getSentry, initSentry } from "./sentry";
|
|
33
33
|
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,
|
|
34
|
+
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
35
|
export { hasCredentialSource } from "./types";
|
|
36
36
|
export { SUGGESTION_LIMITS, sanitizeSuggestionPrompts } from "./types";
|
|
37
37
|
export type { BaseMessage } from "./types/message";
|
|
@@ -43,12 +43,12 @@ export * from "./utils/network-domains";
|
|
|
43
43
|
export * from "./utils/retry";
|
|
44
44
|
export * from "./utils/sanitize";
|
|
45
45
|
export * from "./utils/secret-redaction";
|
|
46
|
-
export * from "./utils/
|
|
46
|
+
export * from "./utils/diagnostic-scrubber";
|
|
47
47
|
export { entryToMessage, type ParsedMessage, type ParsedMessageType, parseSessionEntries, type SessionEntry, titleFromSessionJsonl, } from "./utils/session-file";
|
|
48
48
|
export { slugify } from "./utils/slug";
|
|
49
49
|
export * from "./utils/urls";
|
|
50
50
|
export * from "./worker/auth";
|
|
51
51
|
export type { WorkerTransport, WorkerTransportConfig, } from "./worker/transport";
|
|
52
|
-
export type {
|
|
52
|
+
export type { JobType, MessagePayload, QueuedMessage, } from "./worker/wire";
|
|
53
53
|
export { withLobuFileParameters } from "./agent-tooling";
|
|
54
54
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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.
|
|
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("./
|
|
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");
|
|
@@ -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:
|
|
@@ -78,9 +79,6 @@ __exportStar(require("./secret-refs"), exports);
|
|
|
78
79
|
// Reserved path / entity-type slug lists + kind helpers (single source)
|
|
79
80
|
__exportStar(require("./reserved"), exports);
|
|
80
81
|
// 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
82
|
var trace_1 = require("./trace");
|
|
85
83
|
Object.defineProperty(exports, "extractTraceId", { enumerable: true, get: function () { return trace_1.extractTraceId; } });
|
|
86
84
|
Object.defineProperty(exports, "generateTraceId", { enumerable: true, get: function () { return trace_1.generateTraceId; } });
|
|
@@ -97,7 +95,7 @@ __exportStar(require("./utils/network-domains"), exports);
|
|
|
97
95
|
__exportStar(require("./utils/retry"), exports);
|
|
98
96
|
__exportStar(require("./utils/sanitize"), exports);
|
|
99
97
|
__exportStar(require("./utils/secret-redaction"), exports);
|
|
100
|
-
__exportStar(require("./utils/
|
|
98
|
+
__exportStar(require("./utils/diagnostic-scrubber"), exports);
|
|
101
99
|
// Shared Lobu runtime session.jsonl parser (gateway + worker).
|
|
102
100
|
var session_file_1 = require("./utils/session-file");
|
|
103
101
|
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
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
|
82
|
-
*
|
|
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
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
-
//
|
|
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,30 +10,10 @@ 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
|
|
14
|
-
function createRedactingReplacer() {
|
|
15
|
-
const seen = new WeakSet();
|
|
16
|
-
return (key, value) => {
|
|
17
|
-
if (SENSITIVE_LOG_KEY_PATTERN.test(key))
|
|
18
|
-
return "[REDACTED]";
|
|
19
|
-
if (value instanceof Error) {
|
|
20
|
-
return {
|
|
21
|
-
name: value.name,
|
|
22
|
-
message: value.message,
|
|
23
|
-
stack: value.stack?.split("\n")[0],
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
if (typeof value === "object" && value !== null) {
|
|
27
|
-
if (seen.has(value))
|
|
28
|
-
return "[Circular Reference]";
|
|
29
|
-
seen.add(value);
|
|
30
|
-
}
|
|
31
|
-
return value;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
13
|
+
const diagnostic_scrubber_1 = require("./utils/diagnostic-scrubber");
|
|
34
14
|
function safeStringify(value, space) {
|
|
35
15
|
try {
|
|
36
|
-
return JSON.stringify(
|
|
16
|
+
return JSON.stringify((0, diagnostic_scrubber_1.scrubDiagnosticValue)(value), null, space);
|
|
37
17
|
}
|
|
38
18
|
catch {
|
|
39
19
|
return "[unserializable]";
|
|
@@ -62,7 +42,9 @@ function createConsoleLogger(serviceName) {
|
|
|
62
42
|
// Keep the metadata object as a trailing arg so it still renders.
|
|
63
43
|
// Slicing it away accepted the signature and then dropped the payload,
|
|
64
44
|
// emptying every structured diagnostic that uses this call shape.
|
|
65
|
-
|
|
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]);
|
|
66
48
|
args = [message, ...args.slice(1)];
|
|
67
49
|
}
|
|
68
50
|
else {
|
|
@@ -71,13 +53,18 @@ function createConsoleLogger(serviceName) {
|
|
|
71
53
|
}
|
|
72
54
|
}
|
|
73
55
|
else {
|
|
74
|
-
|
|
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));
|
|
75
61
|
}
|
|
76
62
|
if (USE_JSON_FORMAT) {
|
|
77
63
|
return safeStringify({
|
|
78
64
|
timestamp,
|
|
79
65
|
level: lvl,
|
|
80
66
|
service: serviceName,
|
|
67
|
+
release: process.env.APP_GIT_SHA,
|
|
81
68
|
message: msgStr,
|
|
82
69
|
...(args.length > 0
|
|
83
70
|
? { data: args.length === 1 ? args[0] : args }
|
|
@@ -141,8 +128,12 @@ function createLogger(serviceName) {
|
|
|
141
128
|
];
|
|
142
129
|
const logger = winston_1.default.createLogger({
|
|
143
130
|
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
|
-
|
|
131
|
+
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) => {
|
|
132
|
+
// Preserve Winston's symbol fields while applying the same boundary
|
|
133
|
+
// scrubbing as the default console transport.
|
|
134
|
+
return Object.assign(info, (0, diagnostic_scrubber_1.scrubDiagnosticValue)(info));
|
|
135
|
+
})()),
|
|
136
|
+
defaultMeta: { service: serviceName, release: process.env.APP_GIT_SHA },
|
|
146
137
|
transports,
|
|
147
138
|
});
|
|
148
139
|
return logger;
|