@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
|
@@ -15,7 +15,7 @@ import { validateEntityMetrics } from './metrics.js';
|
|
|
15
15
|
export { validateEntityMetrics };
|
|
16
16
|
export type { Dimension, EntityMetrics, EventSet, FactMatchRule, Measure, MetricReadMode, MetricTier, Segment, } from './metrics.js';
|
|
17
17
|
export type { ConnectorActionSpec, ConnectorClass, ConnectorFeedSpec, ConnectorSpec, } from './define-connector.js';
|
|
18
|
-
export type { ActionContext, ActionDefinition, ActionResult, ApprovalStatus, AuthArtifact, AuthContext, AuthResult, Connection, ConnectorAgentTooling, ConnectorAgentToolingEnv, ConnectorAuthAppInstallation, ConnectorAuthBrowser, ConnectorAuthEnvField, ConnectorAuthEnvKeys, ConnectorAuthInteractive, ConnectorAuthMethod, ConnectorAuthNone, ConnectorAuthOAuth, ConnectorAuthSchema, ConnectorDefinition, ConnectorInstallationContext, ConnectorRuntimeInfo, ConnectorWebhookSchema, ContentItem, EntityIdentitySpec, EntityLinkPredicate, EntityTraitSpec, EventAttributionRole, EventAttributionRule, EventAttributionTargetSpec, EventEnvelope, Feed, FeedDefinition, FeedOperation, FeedReadContext, FeedReadHandler, FeedReadResult, FeedReadWindow, FeedReadWindowCoverage, FeedSyncHandler, EntityTypeContribution, QueryContext, QueryResult, ReflectContext, ReflectedMeasure, ReflectResult, Run, RunStatus, RunType, RuntimeConnectorDefinition, RuntimeFeedDefinition, SyncContext, SyncCredentials, SyncResult, WebhookRegistration, WebhookRegistrationContext, } from './connector-types.js';
|
|
18
|
+
export type { ActionContext, ActionDefinition, ActionResult, ApprovalStatus, AuthArtifact, AuthContext, AuthResult, Connection, ConnectorAgentTooling, ConnectorAgentToolingEnv, ConnectorAuthAppInstallation, ConnectorAuthBrowser, ConnectorAuthEnvField, ConnectorAuthEnvKeys, ConnectorAuthInteractive, ConnectorAuthMethod, ConnectorAuthNone, ConnectorAuthOAuth, ConnectorAuthSchema, ConnectorDefinition, ConnectorInstallationContext, ConnectorOperations, ConnectorRuntimeInfo, ConnectorWebhookSchema, ContentItem, EntityIdentitySpec, EntityLinkPredicate, EntityTraitSpec, EventAttributionRole, EventAttributionRule, EventAttributionTargetSpec, EventEnvelope, Feed, FeedDefinition, FeedOperation, FeedObserveContext, FeedReadContext, FeedReadHandler, FeedReadResult, FeedReadMatch, FeedReadWindow, FeedReadWindowCoverage, FeedSyncHandler, FeedWebhookDeclaration, EntityTypeContribution, QueryContext, QueryResult, ReflectContext, ReflectedMeasure, ReflectResult, Run, RunStatus, RunType, RuntimeConnectorDefinition, RuntimeFeedDefinition, RuntimeFeedWebhook, SyncContext, SyncCredentials, SyncResult, WebhookRecordContext, WebhookRecordNormalizer, WebhookRegistration, WebhookRegistrationContext, } from './connector-types.js';
|
|
19
19
|
import { normalizeAuthUserId, normalizeEmail, normalizeEmailDomain, normalizeIdentifier, normalizePhone } from './identity-normalize.js';
|
|
20
20
|
export { normalizeAuthUserId, normalizeEmail, normalizeEmailDomain, normalizeIdentifier, normalizePhone, };
|
|
21
21
|
export type { IdentityNamespace, IdentityNamespaceDefinition, IdentityNormalizerKind, IdentitySubjectKind, } from './identity-namespaces.js';
|
|
@@ -34,19 +34,25 @@ export { calculateEngagementScore } from './scoring.js';
|
|
|
34
34
|
export { ConnectorAutomationEventSchema, ConnectorAutomationSignalDraftSchema, SubscriptionCandidateSchema, } from './automation-triggers.js';
|
|
35
35
|
export type { AutomationEventTrigger, AutomationScheduleTrigger, AutomationTrigger, AutomationWorkspaceEventTrigger, ConnectorAutomationEvent, ConnectorAutomationSignalDraft, ConnectorTriggerSignal, SubscriptionCandidate, } from './automation-triggers.js';
|
|
36
36
|
export { applyLookbackCutoff } from './checkpoint/lookback.js';
|
|
37
|
+
export { buildInjectHandoffBannerExpression, truncateHandoffReason, } from './browser-handoff-banner.js';
|
|
38
|
+
export type { HandoffBannerOptions } from './browser-handoff-banner.js';
|
|
39
|
+
export { assertInboxSourceRead, assertNoCursor, assertNoMatch, assertNoOffsetPaging, assertNoQuery, assertNoSort, assertNoWindow, assertPositiveReadLimit, assertSnapshotSourceRead, jsonByteLength, SOURCE_RECORD_MAX_BYTES, SOURCE_REFERENCE_BATCH_MAX_EVENTS, splitReferenceBatches, } from './browser-source-read.js';
|
|
37
40
|
export { buildTimestampCheckpoint, filterByCheckpoint, finalizeTimestampSync, } from './checkpoint/timestamp-watermark.js';
|
|
38
41
|
export { validatePublicUrl, validateUrlDomain } from './url-guards.js';
|
|
39
42
|
export { sleep } from './sleep.js';
|
|
40
43
|
export type { ExtensionDomScrapeResult, ExtensionScrapeConfig, ExtensionScrapeObservation, ExtensionScrapeResult, } from './extension-dom-scrape.js';
|
|
41
44
|
export { extensionDomScrape } from './extension-dom-scrape.js';
|
|
45
|
+
export type { ConnectorBrowserRequirement } from './browser-requirement.js';
|
|
46
|
+
export { BROWSER_VERIFY_OPERATION, BROWSER_VERIFY_ACTION, browserAuthMethod, constrainBrowserInput, requireBrowser, resolveBrowserRequirement, validateBrowserRequirement } from './browser-requirement.js';
|
|
42
47
|
export type { ChromeActionDispatcher, ChromeActionInput, ChromeActionOutput, ExtensionNetworkConfig, ExtensionNetworkPattern, ExtensionNetworkResult, InterceptedResponse, NavigateObservation, NetworkInterceptDrainObservation, NetworkInterceptStartObservation, } from './extension-network.js';
|
|
43
48
|
export { extensionNetworkSync } from './extension-network.js';
|
|
44
49
|
export type { AutomationScriptContext, ReactionContext, } from './reaction-sdk.js';
|
|
45
50
|
export type { ReactionClient } from './reaction-client-types.js';
|
|
46
51
|
export type { CardElement, KnowledgeDeleteInput, KnowledgeReadInput, KnowledgeSaveInput, KnowledgeSaveResult, KnowledgeSearchInput, NotificationsSendInput, NotificationsSendResult, } from './reaction-client-types.js';
|
|
47
52
|
export type { ConnectionListInput } from '@lobu/core/contracts/tools/manage-connections';
|
|
53
|
+
export type { CollectionPresentation } from '@lobu/core/contracts/tools/collection-presentation';
|
|
48
54
|
export type { EntityCreateInput, EntityDeleteInput, EntityGetInput, EntityLinkInput, EntityListInput, EntityListLinksInput, EntityUnlinkInput, EntityUpdateInput, EntityUpdateLinkInput, } from '@lobu/core/contracts/tools/manage-entity';
|
|
49
|
-
export type { OperationExecuteInput, OperationListAvailableInput, OperationListRunsInput, } from '@lobu/core/contracts/tools/manage-operations';
|
|
55
|
+
export type { ConnectorOperationRequest, ConnectorOperationResult, OperationExecuteInput, OperationListAvailableInput, OperationListRunsInput, } from '@lobu/core/contracts/tools/manage-operations';
|
|
50
56
|
export type { Env } from './types.js';
|
|
51
57
|
export type { FileDelta, FileSystemSource, Snapshot } from './file-source.js';
|
|
52
58
|
export { connect } from './net.js';
|
|
@@ -33,10 +33,13 @@ export { ConnectorAutomationEventSchema, ConnectorAutomationSignalDraftSchema, S
|
|
|
33
33
|
// The root must stay loadable inside a V8 isolate.
|
|
34
34
|
// =============================================================================
|
|
35
35
|
export { applyLookbackCutoff } from './checkpoint/lookback.js';
|
|
36
|
+
export { buildInjectHandoffBannerExpression, truncateHandoffReason, } from './browser-handoff-banner.js';
|
|
37
|
+
export { assertInboxSourceRead, assertNoCursor, assertNoMatch, assertNoOffsetPaging, assertNoQuery, assertNoSort, assertNoWindow, assertPositiveReadLimit, assertSnapshotSourceRead, jsonByteLength, SOURCE_RECORD_MAX_BYTES, SOURCE_REFERENCE_BATCH_MAX_EVENTS, splitReferenceBatches, } from './browser-source-read.js';
|
|
36
38
|
export { buildTimestampCheckpoint, filterByCheckpoint, finalizeTimestampSync, } from './checkpoint/timestamp-watermark.js';
|
|
37
39
|
export { validatePublicUrl, validateUrlDomain } from './url-guards.js';
|
|
38
40
|
export { sleep } from './sleep.js';
|
|
39
41
|
export { extensionDomScrape } from './extension-dom-scrape.js';
|
|
42
|
+
export { BROWSER_VERIFY_OPERATION, BROWSER_VERIFY_ACTION, browserAuthMethod, constrainBrowserInput, requireBrowser, resolveBrowserRequirement, validateBrowserRequirement } from './browser-requirement.js';
|
|
40
43
|
export { extensionNetworkSync } from './extension-network.js';
|
|
41
44
|
// =============================================================================
|
|
42
45
|
// WinterCG Direct Sockets (Cloudflare / Isolate Sockets API)
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import type { DeleteContentArgs } from "@lobu/core/contracts/tools/delete-knowledge";
|
|
16
16
|
import type { ConnectionListInput } from "@lobu/core/contracts/tools/manage-connections";
|
|
17
|
-
import type { EntityCreateInput, EntityDeleteInput, EntityGetInput, EntityLinkInput, EntityListInput, EntityListLinksInput, EntityUnlinkInput, EntityUpdateInput, EntityUpdateLinkInput } from "@lobu/core/contracts/tools/manage-entity";
|
|
17
|
+
import type { EntityCreateInput, EntityCreateResult, EntityDeleteInput, EntityDeleteResult, EntityDiscoverDuplicatesInput, EntityDiscoverDuplicatesResult, EntityGetInput, EntityGetResult, EntityLinkInput, EntityLinkResult, EntityListInput, EntityListResult, EntityListLinksInput, EntityListLinksResult, EntityUnlinkInput, EntityUnlinkResult, EntityUpdateInput, EntityUpdateResult, EntityUpdateLinkInput, EntityUpdateLinkResult } from "@lobu/core/contracts/tools/manage-entity";
|
|
18
18
|
import type { OperationExecuteInput, OperationListAvailableInput, OperationListRunsInput } from "@lobu/core/contracts/tools/manage-operations";
|
|
19
19
|
import type { PublicGetContentArgs } from "@lobu/core/contracts/tools/read-knowledge";
|
|
20
20
|
import type { SaveContentInput } from "@lobu/core/contracts/tools/save-memory";
|
|
@@ -36,11 +36,10 @@ export type CardElement = Record<string, unknown>;
|
|
|
36
36
|
*/
|
|
37
37
|
export type KnowledgeSearchInput = PublicSearchArgs;
|
|
38
38
|
/**
|
|
39
|
-
* The `save_memory` contract's own input, from core.
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* in `./reaction-client-types.typecheck`.
|
|
39
|
+
* The `save_memory` contract's own input, from core. Structured data and
|
|
40
|
+
* attachments are retained; only text/Markdown require content.
|
|
41
|
+
* Pinned by `ReactionKnowledgeSaveContract` in
|
|
42
|
+
* `./reaction-client-types.typecheck`.
|
|
44
43
|
*/
|
|
45
44
|
export type KnowledgeSaveInput = SaveContentInput;
|
|
46
45
|
/** Tombstone by id, or by the `delete_knowledge` contract's `content_id(s)` + `reason`. */
|
|
@@ -142,20 +141,16 @@ export interface ReactionClient {
|
|
|
142
141
|
delete(input: KnowledgeDeleteInput): Promise<unknown>;
|
|
143
142
|
};
|
|
144
143
|
entities: {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
listLinks(input: EntityListLinksInput): Promise<unknown>;
|
|
156
|
-
search(query: string, options?: {
|
|
157
|
-
limit?: number;
|
|
158
|
-
}): Promise<unknown>;
|
|
144
|
+
discoverDuplicates(input: EntityDiscoverDuplicatesInput): Promise<EntityDiscoverDuplicatesResult>;
|
|
145
|
+
list(filter?: EntityListInput): Promise<EntityListResult>;
|
|
146
|
+
get(input: EntityGetInput): Promise<EntityGetResult>;
|
|
147
|
+
create(input: EntityCreateInput): Promise<EntityCreateResult>;
|
|
148
|
+
update(input: EntityUpdateInput): Promise<EntityUpdateResult>;
|
|
149
|
+
delete(input: EntityDeleteInput): Promise<EntityDeleteResult>;
|
|
150
|
+
link(input: EntityLinkInput): Promise<EntityLinkResult>;
|
|
151
|
+
unlink(input: EntityUnlinkInput): Promise<EntityUnlinkResult>;
|
|
152
|
+
updateLink(input: EntityUpdateLinkInput): Promise<EntityUpdateLinkResult>;
|
|
153
|
+
listLinks(input: EntityListLinksInput): Promise<EntityListLinksResult>;
|
|
159
154
|
};
|
|
160
155
|
connections: {
|
|
161
156
|
/** List configured connections; `device_online` is computed server-side. */
|
|
@@ -192,7 +187,7 @@ export interface ReactionClient {
|
|
|
192
187
|
getRun(run_id: number): Promise<{
|
|
193
188
|
run: Record<string, unknown>;
|
|
194
189
|
}>;
|
|
195
|
-
/** Execute one operation and wait for its result. */
|
|
190
|
+
/** Execute one operation and wait for its result; device operations with `background: true` return the queued `run_id` instead. */
|
|
196
191
|
execute(input: OperationExecuteInput): Promise<{
|
|
197
192
|
status?: "completed" | "failed" | "timeout" | "pending_approval" | "in_progress";
|
|
198
193
|
output?: Record<string, unknown>;
|
|
@@ -52,6 +52,11 @@ export type ReactionKnowledgeSaveContract = [
|
|
|
52
52
|
Assert<"payload_data" extends keyof KnowledgeSaveInput ? true : false>,
|
|
53
53
|
Assert<"supersedes_event_id" extends keyof KnowledgeSaveInput ? true : false>,
|
|
54
54
|
Assert<"slug" extends keyof KnowledgeSaveInput ? false : true>,
|
|
55
|
+
Assert<"payload_template" extends keyof KnowledgeSaveInput ? false : true>,
|
|
56
|
+
Assert<{
|
|
57
|
+
semantic_type: "note";
|
|
58
|
+
payload_type: "json_template";
|
|
59
|
+
} extends KnowledgeSaveInput ? false : true>,
|
|
55
60
|
Assert<{
|
|
56
61
|
semantic_type: "note";
|
|
57
62
|
payload_type: "empty";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobu/connector-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.0",
|
|
4
4
|
"description": "Lobu memory SDK — build pluggable connectors for Lobu memory",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,6 +16,18 @@
|
|
|
16
16
|
"default": "./dist/index.js"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
+
"./browser-requirement": {
|
|
20
|
+
"types": "./dist/browser-requirement.d.ts",
|
|
21
|
+
"import": "./dist/browser-requirement.js"
|
|
22
|
+
},
|
|
23
|
+
"./browser-handoff-banner": {
|
|
24
|
+
"types": "./dist/browser-handoff-banner.d.ts",
|
|
25
|
+
"import": "./dist/browser-handoff-banner.js"
|
|
26
|
+
},
|
|
27
|
+
"./browser-source-read": {
|
|
28
|
+
"types": "./dist/browser-source-read.d.ts",
|
|
29
|
+
"import": "./dist/browser-source-read.js"
|
|
30
|
+
},
|
|
19
31
|
"./define-connector": {
|
|
20
32
|
"import": {
|
|
21
33
|
"types": "./dist/define-connector.d.ts",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
* swaps it into the outbound header, the secret proxy accepts it as the
|
|
19
19
|
* provider credential and the MCP route accepts it as the bearer.
|
|
20
20
|
*/
|
|
21
|
+
import { mcpToolResult, toolImageBudget } from '@lobu/plugin-toolkit';
|
|
21
22
|
import { createGatewayTools } from './gateway-tools.js';
|
|
22
23
|
import { createTurnMediaTools } from './media-tools.js';
|
|
23
24
|
import { createTurnMemoryHooks } from './memory.js';
|
|
24
25
|
import { estimatePromptTokenCost, memoryFlushDue, MEMORY_FLUSH_STATE_CUSTOM_TYPE } from '@lobu/core/memory-flush';
|
|
25
|
-
import { enforceBashCommandPolicy } from '@lobu/core/tool-policy';
|
|
26
26
|
import { isRetrievalTool, summarizeToolTrace } from '@lobu/core/tool-trace-summary';
|
|
27
27
|
import { createNativeSession, nativeSessionJsonl, promptNativeSession } from './native-session.js';
|
|
28
28
|
import { MAX_TOOL_CALLS_PER_TURN } from './types.js';
|
|
@@ -53,7 +53,7 @@ function joinText(content) {
|
|
|
53
53
|
* result, so a blocked or approval-gated call reaches the model as text and the
|
|
54
54
|
* turn goes on.
|
|
55
55
|
*/
|
|
56
|
-
async function callMcpTool(gatewayUrl, credential, tool, args, timeoutMs = TOOL_CALL_TIMEOUT_MS) {
|
|
56
|
+
async function callMcpTool(gatewayUrl, credential, tool, args, timeoutMs = TOOL_CALL_TIMEOUT_MS, supportsImages = true, imageBudget) {
|
|
57
57
|
const url = `${gatewayUrl}/mcp/${encodeURIComponent(tool.mcpId)}/tools/${encodeURIComponent(tool.name)}`;
|
|
58
58
|
let response;
|
|
59
59
|
try {
|
|
@@ -63,8 +63,9 @@ async function callMcpTool(gatewayUrl, credential, tool, args, timeoutMs = TOOL_
|
|
|
63
63
|
Authorization: `Bearer ${credential}`,
|
|
64
64
|
'Content-Type': 'application/json',
|
|
65
65
|
// A retrieval result is summarised into the tool trace from its
|
|
66
|
-
// structured body; the
|
|
67
|
-
|
|
66
|
+
// structured body; capture validates the save receipt. The gateway
|
|
67
|
+
// renders markdown unless asked.
|
|
68
|
+
...(isRetrievalTool(tool.name) || tool.name === 'save_memory' ? { 'x-mcp-format': 'json' } : {}),
|
|
68
69
|
},
|
|
69
70
|
body: JSON.stringify(args ?? {}),
|
|
70
71
|
signal: AbortSignal.timeout(timeoutMs),
|
|
@@ -84,10 +85,15 @@ async function callMcpTool(gatewayUrl, credential, tool, args, timeoutMs = TOOL_
|
|
|
84
85
|
throw new Error(`${tool.name} returned a non-JSON response (status ${response.status}): ${error instanceof Error ? error.message : String(error)}`);
|
|
85
86
|
}
|
|
86
87
|
const text = joinText(reply.content);
|
|
87
|
-
if (!response.ok
|
|
88
|
+
if (!response.ok) {
|
|
88
89
|
throw new Error(reply.error || text || `${tool.name} failed (${response.status})`);
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
+
// Keep the canonical failure flag and receipt through the plugin boundary.
|
|
92
|
+
// Ordinary agent tools render this same result below; no second transport.
|
|
93
|
+
return {
|
|
94
|
+
...reply,
|
|
95
|
+
...mcpToolResult(reply.isError === true ? reply.content?.filter(part => part?.type === 'text') : reply.content, reply.error || '', supportsImages, imageBudget),
|
|
96
|
+
};
|
|
91
97
|
}
|
|
92
98
|
/**
|
|
93
99
|
* pi's tool objects for the turn's manifest: the gateway's MCP tools, then its
|
|
@@ -97,9 +103,10 @@ async function callMcpTool(gatewayUrl, credential, tool, args, timeoutMs = TOOL_
|
|
|
97
103
|
* `createGatewayTools`.
|
|
98
104
|
*/
|
|
99
105
|
function buildTools(input, credential, onAskUserPosted, onInBandReplyDelivered, emit, runtimeExec) {
|
|
106
|
+
const imageBudget = toolImageBudget((input.images ?? []).map(image => ({ type: 'image', data: image.data })));
|
|
100
107
|
const tools = input.tools;
|
|
101
108
|
if (!tools)
|
|
102
|
-
return { tools: [], workspace: null, canReadFiles: false };
|
|
109
|
+
return { tools: [], workspace: null, canReadFiles: false, imageBudget };
|
|
103
110
|
// ONE workspace for the whole turn: the file tools act on it and
|
|
104
111
|
// `upload_file` reads it, so the file the model just wrote is the file it can
|
|
105
112
|
// show. Built even when no file tool was admitted but a media tool was, since
|
|
@@ -107,7 +114,7 @@ function buildTools(input, credential, onAskUserPosted, onInBandReplyDelivered,
|
|
|
107
114
|
// On a sandbox-pinned conversation `bash` runs in the remote runtime through
|
|
108
115
|
// the host; file tools stay on the in-memory workspace.
|
|
109
116
|
const remote = tools.remoteRuntime && runtimeExec ? { exec: runtimeExec } : undefined;
|
|
110
|
-
const workspace = tools.builtin && tools.builtin.length > 0 ? createWorkspace(tools.builtin,
|
|
117
|
+
const workspace = tools.builtin && tools.builtin.length > 0 ? createWorkspace(tools.builtin, remote) : null;
|
|
111
118
|
const gateway = tools.gateway && tools.gateway.length > 0 && tools.conversation
|
|
112
119
|
? createGatewayTools(tools.gateway, {
|
|
113
120
|
gatewayUrl: tools.gatewayUrl,
|
|
@@ -134,30 +141,27 @@ function buildTools(input, credential, onAskUserPosted, onInBandReplyDelivered,
|
|
|
134
141
|
description: tool.description,
|
|
135
142
|
// A plain JSON schema: pi-ai validates arguments against it as-is.
|
|
136
143
|
parameters: tool.inputSchema,
|
|
137
|
-
execute: async (_toolCallId, args) =>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
144
|
+
execute: async (_toolCallId, args) => {
|
|
145
|
+
const result = await callMcpTool(tools.gatewayUrl, credential, tool, args, TOOL_CALL_TIMEOUT_MS, input.provider.input?.includes('image') === true, imageBudget);
|
|
146
|
+
const text = joinText(result.content);
|
|
147
|
+
if (result.isError === true)
|
|
148
|
+
throw new Error(String(result.error || text || `${tool.name} failed`));
|
|
149
|
+
return {
|
|
150
|
+
content: text || result.content.some((part) => part.type === 'image')
|
|
151
|
+
? result.content
|
|
152
|
+
: [{ type: 'text', text: `${tool.name} completed.` }],
|
|
153
|
+
details: {},
|
|
154
|
+
};
|
|
155
|
+
},
|
|
141
156
|
}));
|
|
142
|
-
//
|
|
143
|
-
|
|
144
|
-
// still making every seeded file unreachable.
|
|
145
|
-
let bashCanRead = false;
|
|
146
|
-
if ((tools.builtin ?? []).includes('bash') && !tools.remoteRuntime) {
|
|
147
|
-
try {
|
|
148
|
-
if (tools.bashPolicy)
|
|
149
|
-
enforceBashCommandPolicy('cat input/attachment', tools.bashPolicy);
|
|
150
|
-
bashCanRead = true;
|
|
151
|
-
}
|
|
152
|
-
catch {
|
|
153
|
-
// The prompt must not advertise a path this turn cannot open.
|
|
154
|
-
}
|
|
155
|
-
}
|
|
157
|
+
// Remote bash cannot open the isolate's seeded files.
|
|
158
|
+
const bashCanRead = (tools.builtin ?? []).includes('bash') && !tools.remoteRuntime;
|
|
156
159
|
const canReadFiles = workspace !== null && ((tools.builtin ?? []).includes('read') || bashCanRead);
|
|
157
160
|
return {
|
|
158
161
|
tools: [...mcp, ...gateway, ...media, ...(workspace?.tools ?? [])],
|
|
159
162
|
workspace,
|
|
160
163
|
canReadFiles,
|
|
164
|
+
imageBudget,
|
|
161
165
|
};
|
|
162
166
|
}
|
|
163
167
|
/**
|
|
@@ -334,7 +338,7 @@ export async function runAgentTurn(input, emit, takeSteering = () => [], runtime
|
|
|
334
338
|
agentId: input.memory.agentId,
|
|
335
339
|
conversationId: input.tools.conversation?.conversationId ?? '',
|
|
336
340
|
mcpId: input.memory.mcpId,
|
|
337
|
-
callTool: (mcpId, toolName, args, options) => callMcpTool(input.tools.gatewayUrl, credential, { mcpId, name: toolName, description: '', inputSchema: {} }, args, options?.timeoutMs),
|
|
341
|
+
callTool: (mcpId, toolName, args, options) => callMcpTool(input.tools.gatewayUrl, credential, { mcpId, name: toolName, description: '', inputSchema: {} }, args, options?.timeoutMs).then((result) => ({ ...result, content: [{ type: 'text', text: joinText(result.content) }] })),
|
|
338
342
|
logger: guestLogger,
|
|
339
343
|
})
|
|
340
344
|
: null;
|
|
@@ -435,6 +439,10 @@ export async function runAgentTurn(input, emit, takeSteering = () => [], runtime
|
|
|
435
439
|
const text = messageText(message);
|
|
436
440
|
return text === undefined ? undefined : messageContext.get(text);
|
|
437
441
|
});
|
|
442
|
+
// Only the isolate must fit the full checkpoint through a bounded bridge.
|
|
443
|
+
// buildTools charged this prompt's images; add the already-hydrated history.
|
|
444
|
+
built.imageBudget.bytes += toolImageBudget(session.sessionManager.getEntries().flatMap(entry => entry.type === 'message' && 'content' in entry.message && Array.isArray(entry.message.content)
|
|
445
|
+
? entry.message.content : [])).bytes;
|
|
438
446
|
session.subscribe((event) => {
|
|
439
447
|
if (event.type === 'compaction_end' && event.errorMessage)
|
|
440
448
|
console.warn(event.errorMessage);
|
|
@@ -714,7 +722,13 @@ export async function runAgentTurn(input, emit, takeSteering = () => [], runtime
|
|
|
714
722
|
// but a spent budget or an asked question is a deliberate stop, and the
|
|
715
723
|
// text streamed before it is a real answer worth delivering — throwing
|
|
716
724
|
// here would turn it into a failed turn with nothing shown.
|
|
717
|
-
|
|
725
|
+
settleAnswer();
|
|
726
|
+
const finalText = ownerAnswer ?? ownerText;
|
|
727
|
+
// Tool-only turns can already have delivered their reply. Reject only a
|
|
728
|
+
// provider-only turn with nothing to show, after native recovery settles.
|
|
729
|
+
const ended = (guardStopped ? null : agent.state.errorMessage) ||
|
|
730
|
+
(!finalText.trim() && toolsUsed.size === 0 && steeredToolsUsed.size === 0
|
|
731
|
+
? 'The model returned no response. Please try again.' : null);
|
|
718
732
|
// Capture BEFORE returning, and await it. `agentEnd` itself only starts the
|
|
719
733
|
// write; this isolate is disposed the moment this function resolves, so an
|
|
720
734
|
// unawaited capture would be cancelled every time
|
|
@@ -729,7 +743,6 @@ export async function runAgentTurn(input, emit, takeSteering = () => [], runtime
|
|
|
729
743
|
}
|
|
730
744
|
if (ended)
|
|
731
745
|
throw new Error(ended);
|
|
732
|
-
settleAnswer();
|
|
733
746
|
return {
|
|
734
747
|
// The answer is the last assistant message WITH TEXT after each user
|
|
735
748
|
// message, not the accumulated stream: a model that narrates before a
|
|
@@ -752,7 +765,7 @@ export async function runAgentTurn(input, emit, takeSteering = () => [], runtime
|
|
|
752
765
|
// aborted mid-answer still owes the user what it managed to say. The
|
|
753
766
|
// fallback is the owner's only: a steered input without its own settled
|
|
754
767
|
// answer fails below rather than borrowing a sibling's text.
|
|
755
|
-
text:
|
|
768
|
+
text: finalText,
|
|
756
769
|
stopReason,
|
|
757
770
|
usage,
|
|
758
771
|
sessionJsonl: nativeSessionJsonl(session),
|