@blario/react-native 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +377 -2
- package/dist/BlarProvider.d.ts +74 -0
- package/dist/actions/batched.d.ts +1 -0
- package/dist/actions/click.d.ts +4 -0
- package/dist/actions/commit-watch.d.ts +15 -0
- package/dist/actions/events.d.ts +35 -0
- package/dist/actions/executor.d.ts +29 -0
- package/dist/actions/highlight.d.ts +4 -0
- package/dist/actions/interaction-guards.d.ts +9 -0
- package/dist/actions/landing.d.ts +11 -0
- package/dist/actions/navigation-driver.d.ts +22 -0
- package/dist/actions/parse.d.ts +4 -0
- package/dist/actions/result.d.ts +4 -0
- package/dist/actions/scrolling.d.ts +12 -0
- package/dist/actions/services.d.ts +20 -0
- package/dist/actions/settle.d.ts +13 -0
- package/dist/actions/switch.d.ts +3 -0
- package/dist/actions/target.d.ts +25 -0
- package/dist/actions/text-input.d.ts +9 -0
- package/dist/actions/types.d.ts +59 -0
- package/dist/agent/batch-commands.d.ts +17 -0
- package/dist/agent/compose.d.ts +23 -0
- package/dist/agent/controller.d.ts +28 -0
- package/dist/agent/frame-runner.d.ts +9 -0
- package/dist/agent/frames.d.ts +180 -0
- package/dist/agent/handlers/agent-command.d.ts +5 -0
- package/dist/agent/handlers/batch.d.ts +5 -0
- package/dist/agent/handlers/consent-screenshot.d.ts +4 -0
- package/dist/agent/handlers/context.d.ts +16 -0
- package/dist/agent/handlers/dom-state.d.ts +4 -0
- package/dist/agent/handlers/element-context.d.ts +2 -0
- package/dist/agent/handlers/screenshot.d.ts +3 -0
- package/dist/agent/handlers/text-dom.d.ts +5 -0
- package/dist/agent/stage.d.ts +13 -0
- package/dist/agent-mode/action-description.d.ts +3 -0
- package/dist/agent-mode/bubbles.d.ts +10 -0
- package/dist/agent-mode/colors.d.ts +12 -0
- package/dist/agent-mode/controller.d.ts +92 -0
- package/dist/agent-mode/cursor-follow.d.ts +12 -0
- package/dist/agent-mode/cursor.d.ts +37 -0
- package/dist/agent-mode/frames.d.ts +36 -0
- package/dist/agent-mode/haptics.d.ts +6 -0
- package/dist/agent-mode/keep-awake.d.ts +19 -0
- package/dist/agent-mode/layer-stacking.d.ts +7 -0
- package/dist/agent-mode/markdown.d.ts +19 -0
- package/dist/agent-mode/panel-geometry.d.ts +6 -0
- package/dist/agent-mode/resume.d.ts +13 -0
- package/dist/agent-mode/run-memory.d.ts +19 -0
- package/dist/agent-mode/spotlight-controller.d.ts +68 -0
- package/dist/agent-mode/spotlight.d.ts +6 -0
- package/dist/agent-mode/state.d.ts +9 -0
- package/dist/agent-mode/status.d.ts +11 -0
- package/dist/agent-mode/timers.d.ts +6 -0
- package/dist/agent-mode/ui/AgentDock.d.ts +37 -0
- package/dist/agent-mode/ui/AgentLayer.d.ts +19 -0
- package/dist/agent-mode/ui/AgentLayerHost.d.ts +8 -0
- package/dist/agent-mode/ui/AgentPanel.d.ts +19 -0
- package/dist/agent-mode/ui/AgentTap.d.ts +10 -0
- package/dist/agent-mode/ui/MarkdownText.d.ts +8 -0
- package/dist/agent-mode/ui/MessageBubbles.d.ts +9 -0
- package/dist/agent-mode/ui/PendingOverlay.d.ts +5 -0
- package/dist/agent-mode/ui/SpotlightLayer.d.ts +9 -0
- package/dist/agent-mode/ui/SpotlightOverlay.d.ts +7 -0
- package/dist/agent-mode/ui/StatusCard.d.ts +14 -0
- package/dist/agent-mode/ui/TargetPulse.d.ts +9 -0
- package/dist/agent-mode/ui/TouchShield.d.ts +5 -0
- package/dist/agent-mode/ui/WarningIcon.d.ts +6 -0
- package/dist/agent-mode/ui/full-window-overlay.d.ts +5 -0
- package/dist/agent-mode/ui/layer-host.d.ts +2 -0
- package/dist/backend/api-client.d.ts +38 -0
- package/dist/backend/api-types.d.ts +25 -0
- package/dist/backend/app-info.d.ts +14 -0
- package/dist/backend/backend-transport.d.ts +70 -0
- package/dist/backend/backoff.d.ts +9 -0
- package/dist/backend/base64.d.ts +1 -0
- package/dist/backend/errors.d.ts +17 -0
- package/dist/backend/foreground.d.ts +1 -0
- package/dist/backend/health.d.ts +17 -0
- package/dist/backend/identity-proof.d.ts +23 -0
- package/dist/backend/identity.d.ts +27 -0
- package/dist/backend/message-metadata.d.ts +19 -0
- package/dist/backend/presence.d.ts +20 -0
- package/dist/backend/response-cache.d.ts +9 -0
- package/dist/backend/session-change.d.ts +2 -0
- package/dist/backend/session-socket.d.ts +49 -0
- package/dist/backend/session.d.ts +39 -0
- package/dist/backend/socket-url.d.ts +9 -0
- package/dist/backend/storage.d.ts +13 -0
- package/dist/backend/tab-id.d.ts +2 -0
- package/dist/blar.d.ts +37 -0
- package/dist/chat/ChatLayer.d.ts +29 -0
- package/dist/chat/ChatSheet.d.ts +11 -0
- package/dist/chat/ChatView.d.ts +19 -0
- package/dist/chat/Launcher.d.ts +14 -0
- package/dist/chat/bridge.d.ts +22 -0
- package/dist/chat/chat-coordinator.d.ts +57 -0
- package/dist/chat/chat-state.d.ts +20 -0
- package/dist/chat/navigation.d.ts +5 -0
- package/dist/chat/options.d.ts +22 -0
- package/dist/chat/webview.d.ts +10 -0
- package/dist/chat/widget-bundle.generated.d.ts +2 -0
- package/dist/chat/widget-shell.d.ts +24 -0
- package/dist/confirmation/port.d.ts +12 -0
- package/dist/fiber/locate.d.ts +7 -0
- package/dist/fiber/narrow.d.ts +5 -0
- package/dist/fiber/reader.d.ts +10 -0
- package/dist/fiber/text.d.ts +4 -0
- package/dist/fiber/types.d.ts +21 -0
- package/dist/host/border-radius.d.ts +1 -0
- package/dist/host/instance.d.ts +9 -0
- package/dist/host/measure.d.ts +3 -0
- package/dist/host/rect.d.ts +22 -0
- package/dist/host/visible-area.d.ts +2 -0
- package/dist/index.d.ts +10 -0
- package/dist/nudge/NudgeBubble.d.ts +15 -0
- package/dist/nudge/nudge.d.ts +23 -0
- package/dist/optional/expo-haptics.d.ts +1 -0
- package/dist/optional/expo-keep-awake.d.ts +1 -0
- package/dist/optional/react-native-haptic-feedback.d.ts +1 -0
- package/dist/optional/react-native-keep-awake.d.ts +1 -0
- package/dist/overlay/AgentOverlay.d.ts +5 -0
- package/dist/screenshot/capture-backend.d.ts +6 -0
- package/dist/screenshot/screenshotter.d.ts +18 -0
- package/dist/screenshot/skia.d.ts +35 -0
- package/dist/screenshot/view-shot.d.ts +2 -0
- package/dist/snapshot/capture.d.ts +36 -0
- package/dist/snapshot/classify.d.ts +11 -0
- package/dist/snapshot/collect.d.ts +27 -0
- package/dist/snapshot/element-context.d.ts +9 -0
- package/dist/snapshot/icon.d.ts +2 -0
- package/dist/snapshot/kinds.d.ts +3 -0
- package/dist/snapshot/modals.d.ts +2 -0
- package/dist/snapshot/navigation.d.ts +14 -0
- package/dist/snapshot/ordering.d.ts +2 -0
- package/dist/snapshot/properties.d.ts +14 -0
- package/dist/snapshot/registry.d.ts +16 -0
- package/dist/snapshot/render.d.ts +10 -0
- package/dist/snapshot/route-summary.d.ts +3 -0
- package/dist/snapshot/scroll.d.ts +15 -0
- package/dist/snapshot/text-layout.d.ts +8 -0
- package/dist/snapshot/view.d.ts +30 -0
- package/dist/snapshot/visibility.d.ts +17 -0
- package/dist/snapshot/wrappers.d.ts +11 -0
- package/dist/telemetry/SdkErrorBoundary.d.ts +15 -0
- package/dist/telemetry/build-info.generated.d.ts +2 -0
- package/dist/telemetry/envelope.d.ts +53 -0
- package/dist/telemetry/reporter.d.ts +33 -0
- package/dist/telemetry/scrub.d.ts +1 -0
- package/dist/telemetry/sdk-reporter.d.ts +5 -0
- package/dist/transport/connection-options.d.ts +18 -0
- package/dist/transport/relay-transport.d.ts +17 -0
- package/dist/transport/transport.d.ts +7 -0
- package/dist/ui/insets.d.ts +8 -0
- package/dist/ui/strings.d.ts +33 -0
- package/dist/ui/useInsets.d.ts +2 -0
- package/dist/version.d.ts +1 -0
- package/package.json +85 -4
- package/src/BlarProvider.tsx +462 -0
- package/src/actions/batched.ts +16 -0
- package/src/actions/click.ts +54 -0
- package/src/actions/commit-watch.ts +86 -0
- package/src/actions/events.ts +58 -0
- package/src/actions/executor.ts +147 -0
- package/src/actions/highlight.ts +13 -0
- package/src/actions/interaction-guards.ts +44 -0
- package/src/actions/landing.ts +26 -0
- package/src/actions/navigation-driver.ts +131 -0
- package/src/actions/parse.ts +82 -0
- package/src/actions/result.ts +14 -0
- package/src/actions/scrolling.ts +112 -0
- package/src/actions/services.ts +24 -0
- package/src/actions/settle.ts +40 -0
- package/src/actions/switch.ts +31 -0
- package/src/actions/target.ts +77 -0
- package/src/actions/text-input.ts +82 -0
- package/src/actions/types.ts +52 -0
- package/src/agent/batch-commands.ts +33 -0
- package/src/agent/compose.ts +67 -0
- package/src/agent/controller.ts +106 -0
- package/src/agent/frame-runner.ts +27 -0
- package/src/agent/frames.ts +193 -0
- package/src/agent/handlers/agent-command.ts +74 -0
- package/src/agent/handlers/batch.ts +72 -0
- package/src/agent/handlers/consent-screenshot.ts +44 -0
- package/src/agent/handlers/context.ts +17 -0
- package/src/agent/handlers/dom-state.ts +19 -0
- package/src/agent/handlers/element-context.ts +9 -0
- package/src/agent/handlers/screenshot.ts +24 -0
- package/src/agent/handlers/text-dom.ts +17 -0
- package/src/agent/stage.ts +22 -0
- package/src/agent-mode/action-description.ts +25 -0
- package/src/agent-mode/bubbles.ts +31 -0
- package/src/agent-mode/colors.ts +40 -0
- package/src/agent-mode/controller.ts +459 -0
- package/src/agent-mode/cursor-follow.ts +43 -0
- package/src/agent-mode/cursor.ts +118 -0
- package/src/agent-mode/frames.ts +70 -0
- package/src/agent-mode/haptics.ts +49 -0
- package/src/agent-mode/keep-awake.ts +107 -0
- package/src/agent-mode/layer-stacking.ts +16 -0
- package/src/agent-mode/markdown.ts +84 -0
- package/src/agent-mode/panel-geometry.ts +27 -0
- package/src/agent-mode/resume.ts +16 -0
- package/src/agent-mode/run-memory.ts +65 -0
- package/src/agent-mode/spotlight-controller.ts +255 -0
- package/src/agent-mode/spotlight.ts +14 -0
- package/src/agent-mode/state.ts +36 -0
- package/src/agent-mode/status.ts +13 -0
- package/src/agent-mode/timers.ts +11 -0
- package/src/agent-mode/ui/AgentDock.tsx +285 -0
- package/src/agent-mode/ui/AgentLayer.tsx +123 -0
- package/src/agent-mode/ui/AgentLayerHost.tsx +37 -0
- package/src/agent-mode/ui/AgentPanel.tsx +187 -0
- package/src/agent-mode/ui/AgentTap.tsx +190 -0
- package/src/agent-mode/ui/MarkdownText.tsx +55 -0
- package/src/agent-mode/ui/MessageBubbles.tsx +58 -0
- package/src/agent-mode/ui/PendingOverlay.tsx +32 -0
- package/src/agent-mode/ui/SpotlightLayer.tsx +60 -0
- package/src/agent-mode/ui/SpotlightOverlay.tsx +35 -0
- package/src/agent-mode/ui/StatusCard.tsx +137 -0
- package/src/agent-mode/ui/TargetPulse.tsx +74 -0
- package/src/agent-mode/ui/TouchShield.tsx +22 -0
- package/src/agent-mode/ui/WarningIcon.tsx +32 -0
- package/src/agent-mode/ui/full-window-overlay.ts +16 -0
- package/src/agent-mode/ui/layer-host.ts +11 -0
- package/src/backend/api-client.ts +210 -0
- package/src/backend/api-types.ts +56 -0
- package/src/backend/app-info.ts +40 -0
- package/src/backend/backend-transport.ts +338 -0
- package/src/backend/backoff.ts +16 -0
- package/src/backend/base64.ts +25 -0
- package/src/backend/errors.ts +32 -0
- package/src/backend/foreground.ts +10 -0
- package/src/backend/health.ts +64 -0
- package/src/backend/identity-proof.ts +151 -0
- package/src/backend/identity.ts +31 -0
- package/src/backend/message-metadata.ts +28 -0
- package/src/backend/presence.ts +95 -0
- package/src/backend/response-cache.ts +45 -0
- package/src/backend/session-change.ts +14 -0
- package/src/backend/session-socket.ts +292 -0
- package/src/backend/session.ts +188 -0
- package/src/backend/socket-url.ts +25 -0
- package/src/backend/storage.ts +49 -0
- package/src/backend/tab-id.ts +24 -0
- package/src/blar.ts +100 -0
- package/src/chat/ChatLayer.tsx +109 -0
- package/src/chat/ChatSheet.tsx +82 -0
- package/src/chat/ChatView.tsx +127 -0
- package/src/chat/Launcher.tsx +72 -0
- package/src/chat/bridge.ts +56 -0
- package/src/chat/chat-coordinator.ts +189 -0
- package/src/chat/chat-state.ts +35 -0
- package/src/chat/navigation.ts +15 -0
- package/src/chat/options.ts +39 -0
- package/src/chat/webview.ts +23 -0
- package/src/chat/widget-bundle.generated.ts +2 -0
- package/src/chat/widget-shell.ts +170 -0
- package/src/confirmation/port.ts +15 -0
- package/src/fiber/locate.ts +41 -0
- package/src/fiber/narrow.ts +15 -0
- package/src/fiber/reader.ts +98 -0
- package/src/fiber/text.ts +52 -0
- package/src/fiber/types.ts +24 -0
- package/src/host/border-radius.ts +11 -0
- package/src/host/instance.ts +30 -0
- package/src/host/measure.ts +25 -0
- package/src/host/rect.ts +45 -0
- package/src/host/visible-area.ts +5 -0
- package/src/index.ts +10 -0
- package/src/nudge/NudgeBubble.tsx +117 -0
- package/src/nudge/nudge.ts +100 -0
- package/src/optional/expo-haptics.ts +11 -0
- package/src/optional/expo-keep-awake.ts +11 -0
- package/src/optional/react-native-haptic-feedback.ts +11 -0
- package/src/optional/react-native-keep-awake.ts +11 -0
- package/src/overlay/AgentOverlay.tsx +16 -0
- package/src/screenshot/capture-backend.ts +7 -0
- package/src/screenshot/screenshotter.ts +39 -0
- package/src/screenshot/skia.ts +107 -0
- package/src/screenshot/view-shot.ts +41 -0
- package/src/snapshot/capture.ts +163 -0
- package/src/snapshot/classify.ts +40 -0
- package/src/snapshot/collect.ts +136 -0
- package/src/snapshot/element-context.ts +66 -0
- package/src/snapshot/icon.ts +21 -0
- package/src/snapshot/kinds.ts +10 -0
- package/src/snapshot/modals.ts +21 -0
- package/src/snapshot/navigation.ts +47 -0
- package/src/snapshot/ordering.ts +26 -0
- package/src/snapshot/properties.ts +71 -0
- package/src/snapshot/registry.ts +33 -0
- package/src/snapshot/render.ts +140 -0
- package/src/snapshot/route-summary.ts +15 -0
- package/src/snapshot/scroll.ts +90 -0
- package/src/snapshot/text-layout.ts +59 -0
- package/src/snapshot/view.ts +87 -0
- package/src/snapshot/visibility.ts +63 -0
- package/src/snapshot/wrappers.ts +69 -0
- package/src/telemetry/SdkErrorBoundary.tsx +28 -0
- package/src/telemetry/build-info.generated.ts +2 -0
- package/src/telemetry/envelope.ts +83 -0
- package/src/telemetry/reporter.ts +170 -0
- package/src/telemetry/scrub.ts +10 -0
- package/src/telemetry/sdk-reporter.ts +37 -0
- package/src/transport/connection-options.ts +65 -0
- package/src/transport/relay-transport.ts +82 -0
- package/src/transport/transport.ts +8 -0
- package/src/ui/insets.ts +31 -0
- package/src/ui/strings.ts +102 -0
- package/src/ui/useInsets.ts +10 -0
- package/src/version.ts +1 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { LauncherPlacement } from '../chat/Launcher.tsx';
|
|
3
|
+
import type { UiStrings } from '../ui/strings.ts';
|
|
4
|
+
import { type NudgeView } from './nudge.ts';
|
|
5
|
+
export interface NudgeBubbleProps {
|
|
6
|
+
nudge: NudgeView;
|
|
7
|
+
strings: UiStrings;
|
|
8
|
+
color: string;
|
|
9
|
+
placement: LauncherPlacement;
|
|
10
|
+
launcherVisible: boolean;
|
|
11
|
+
onAccept: () => void;
|
|
12
|
+
onDecline: () => void;
|
|
13
|
+
onLater: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function NudgeBubble({ nudge, strings, color, placement, launcherVisible, onAccept, onDecline, onLater }: NudgeBubbleProps): React.JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type UnknownRecord } from '../fiber/narrow.ts';
|
|
2
|
+
export interface NudgeSender {
|
|
3
|
+
name: string;
|
|
4
|
+
subtitle: string | null;
|
|
5
|
+
avatarUrl: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface NudgeProgress {
|
|
8
|
+
total: number;
|
|
9
|
+
completed: number;
|
|
10
|
+
}
|
|
11
|
+
export interface NudgeView {
|
|
12
|
+
bubbleMessage: string;
|
|
13
|
+
continuation: boolean;
|
|
14
|
+
milestoneMessageId: number | null;
|
|
15
|
+
sessionId: number | null;
|
|
16
|
+
sender: NudgeSender | null;
|
|
17
|
+
progress: NudgeProgress | null;
|
|
18
|
+
ctaLabel: string | null;
|
|
19
|
+
}
|
|
20
|
+
export declare function parseHistoryNudge(frame: UnknownRecord): NudgeView | null;
|
|
21
|
+
export declare function parseMessageNudge(frame: UnknownRecord, currentSessionId: number | null): NudgeView | null;
|
|
22
|
+
export declare function parseFrameNudge(frame: UnknownRecord, currentSessionId: number | null): NudgeView | null;
|
|
23
|
+
export declare function initialsOf(name: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EXPO_HAPTICS: unknown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EXPO_KEEP_AWAKE: unknown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const REACT_NATIVE_HAPTIC_FEEDBACK: unknown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const REACT_NATIVE_KEEP_AWAKE: unknown;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ScreenshotOptions } from '../agent/frames.ts';
|
|
2
|
+
import type { CaptureBackend } from './capture-backend.ts';
|
|
3
|
+
export type ScreenshotResult = {
|
|
4
|
+
ok: true;
|
|
5
|
+
dataUrl: string;
|
|
6
|
+
capturesModals: boolean;
|
|
7
|
+
} | {
|
|
8
|
+
ok: false;
|
|
9
|
+
reason: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const CAPTURE_BACKEND: CaptureBackend | null;
|
|
12
|
+
export declare class Screenshotter {
|
|
13
|
+
private readonly getCaptureTarget;
|
|
14
|
+
private readonly backend;
|
|
15
|
+
constructor(getCaptureTarget: () => unknown, backend?: CaptureBackend | null);
|
|
16
|
+
isAvailable(): boolean;
|
|
17
|
+
capture(options: ScreenshotOptions): Promise<ScreenshotResult>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CaptureBackend } from './capture-backend.ts';
|
|
2
|
+
interface SkiaImage {
|
|
3
|
+
width: () => number;
|
|
4
|
+
height: () => number;
|
|
5
|
+
encodeToBase64: (format: number, quality: number) => string;
|
|
6
|
+
dispose: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface SkiaCanvas {
|
|
9
|
+
drawImageRect: (image: SkiaImage, source: unknown, destination: unknown, paint: unknown) => void;
|
|
10
|
+
}
|
|
11
|
+
interface SkiaSurface {
|
|
12
|
+
getCanvas: () => SkiaCanvas;
|
|
13
|
+
flush: () => void;
|
|
14
|
+
makeImageSnapshot: () => SkiaImage;
|
|
15
|
+
dispose: () => void;
|
|
16
|
+
}
|
|
17
|
+
export interface SkiaModule {
|
|
18
|
+
makeImageFromView: (viewRef: {
|
|
19
|
+
current: unknown;
|
|
20
|
+
}) => Promise<SkiaImage | null>;
|
|
21
|
+
ImageFormat: {
|
|
22
|
+
JPEG: number;
|
|
23
|
+
};
|
|
24
|
+
Skia: {
|
|
25
|
+
Surface: {
|
|
26
|
+
Make: (width: number, height: number) => SkiaSurface | null;
|
|
27
|
+
};
|
|
28
|
+
XYWHRect: (x: number, y: number, width: number, height: number) => unknown;
|
|
29
|
+
Paint: () => unknown;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export declare function isSkiaModule(value: unknown): value is SkiaModule;
|
|
33
|
+
export declare function skiaBackend(skia: SkiaModule, platform: string): CaptureBackend | null;
|
|
34
|
+
export declare const SKIA_MODULE: SkiaModule | null;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Fiber } from '../fiber/types.ts';
|
|
2
|
+
import type { Size } from '../host/rect.ts';
|
|
3
|
+
import type { ScreenRef } from './navigation.ts';
|
|
4
|
+
import { ElementRegistry, type RegisteredElement } from './registry.ts';
|
|
5
|
+
export interface Snapshot {
|
|
6
|
+
screen: string;
|
|
7
|
+
routes: string[];
|
|
8
|
+
text: string;
|
|
9
|
+
elements: RegisteredElement[];
|
|
10
|
+
modalOpen: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface SnapshotDependencies {
|
|
13
|
+
getAnchorFiber: () => Fiber | null;
|
|
14
|
+
registry: ElementRegistry;
|
|
15
|
+
getViewport: () => Size;
|
|
16
|
+
getExtraRoutes: () => string[];
|
|
17
|
+
}
|
|
18
|
+
export type CaptureMode = 'register' | 'peek';
|
|
19
|
+
export interface TextTreeOptions {
|
|
20
|
+
viewportOnly: boolean;
|
|
21
|
+
maxChars: number;
|
|
22
|
+
}
|
|
23
|
+
export interface TextTree {
|
|
24
|
+
screen: string;
|
|
25
|
+
text: string;
|
|
26
|
+
}
|
|
27
|
+
export declare class SnapshotCapturer {
|
|
28
|
+
private readonly dependencies;
|
|
29
|
+
constructor(dependencies: SnapshotDependencies);
|
|
30
|
+
capture(mode: CaptureMode): Promise<Snapshot>;
|
|
31
|
+
captureText(options: TextTreeOptions): Promise<TextTree>;
|
|
32
|
+
readFocusedScreens(): ScreenRef[];
|
|
33
|
+
private measureVisible;
|
|
34
|
+
private assemble;
|
|
35
|
+
private register;
|
|
36
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Fiber } from '../fiber/types.ts';
|
|
2
|
+
import type { ElementKind } from './kinds.ts';
|
|
3
|
+
export interface ScrollInstance {
|
|
4
|
+
scrollTo: (options: {
|
|
5
|
+
x?: number;
|
|
6
|
+
y?: number;
|
|
7
|
+
animated?: boolean;
|
|
8
|
+
}) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function scrollInstanceOf(fiber: Fiber): ScrollInstance | null;
|
|
11
|
+
export declare function classify(fiber: Fiber): ElementKind | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Fiber } from '../fiber/types.ts';
|
|
2
|
+
import type { ElementKind } from './kinds.ts';
|
|
3
|
+
import { type ScreenRef } from './navigation.ts';
|
|
4
|
+
export declare const AGENT_OVERLAY_TEST_ID = "blar-agent-overlay";
|
|
5
|
+
export interface Candidate {
|
|
6
|
+
kind: ElementKind;
|
|
7
|
+
fiber: Fiber;
|
|
8
|
+
host: Fiber;
|
|
9
|
+
ancestors: Fiber[];
|
|
10
|
+
scrollContainers: Fiber[];
|
|
11
|
+
}
|
|
12
|
+
export interface TextBlock {
|
|
13
|
+
host: Fiber;
|
|
14
|
+
text: string;
|
|
15
|
+
heading: boolean;
|
|
16
|
+
ancestors: Fiber[];
|
|
17
|
+
scrollContainers: Fiber[];
|
|
18
|
+
}
|
|
19
|
+
export interface Collected {
|
|
20
|
+
candidates: Candidate[];
|
|
21
|
+
textBlocks: TextBlock[];
|
|
22
|
+
focusedScreens: ScreenRef[];
|
|
23
|
+
modalOpen: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function collect(root: Fiber): Collected;
|
|
26
|
+
export declare function isOpenModal(fiber: Fiber): boolean;
|
|
27
|
+
export declare function keepInnermostPerHost(candidates: Candidate[]): Candidate[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ElementContextItem } from '../agent/frames.ts';
|
|
2
|
+
import type { TargetResolver } from '../actions/target.ts';
|
|
3
|
+
import { type Size } from '../host/rect.ts';
|
|
4
|
+
export declare class ElementContextReader {
|
|
5
|
+
private readonly resolver;
|
|
6
|
+
private readonly getViewport;
|
|
7
|
+
constructor(resolver: TargetResolver, getViewport: () => Size);
|
|
8
|
+
read(agentId: string): Promise<ElementContextItem>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Props } from '../fiber/types.ts';
|
|
2
|
+
export interface NavigationLike {
|
|
3
|
+
navigate: (...args: unknown[]) => void;
|
|
4
|
+
isFocused: () => boolean;
|
|
5
|
+
getState?: () => unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface ScreenRef {
|
|
8
|
+
key: string;
|
|
9
|
+
name: string;
|
|
10
|
+
navigation: NavigationLike;
|
|
11
|
+
}
|
|
12
|
+
export declare function screenOf(props: Props): ScreenRef | null;
|
|
13
|
+
export declare function isFocusedScreen(screen: ScreenRef): boolean;
|
|
14
|
+
export declare function routeNamesOf(navigation: NavigationLike): string[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Props } from '../fiber/types.ts';
|
|
2
|
+
export interface AccessibilityFlags {
|
|
3
|
+
disabled: boolean;
|
|
4
|
+
selected: boolean | null;
|
|
5
|
+
expanded: boolean | null;
|
|
6
|
+
checked: boolean | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function explicitLabelOf(props: Props): string | null;
|
|
9
|
+
export declare function testIdOf(props: Props): string | null;
|
|
10
|
+
export declare function roleOf(props: Props): string | null;
|
|
11
|
+
export declare function accessibilityFlagsOf(props: Props): AccessibilityFlags;
|
|
12
|
+
export declare function inputTypeOf(props: Props): string;
|
|
13
|
+
export declare function placeholderOf(props: Props): string | null;
|
|
14
|
+
export declare function textValueOf(props: Props): string | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Fiber } from '../fiber/types.ts';
|
|
2
|
+
import type { Rect } from '../host/rect.ts';
|
|
3
|
+
import { type ElementKind } from './kinds.ts';
|
|
4
|
+
export interface RegisteredElement {
|
|
5
|
+
agentId: string;
|
|
6
|
+
kind: ElementKind;
|
|
7
|
+
fiber: Fiber;
|
|
8
|
+
rect: Rect;
|
|
9
|
+
}
|
|
10
|
+
export declare class ElementRegistry {
|
|
11
|
+
private counters;
|
|
12
|
+
private entries;
|
|
13
|
+
begin(): void;
|
|
14
|
+
register(kind: ElementKind, fiber: Fiber, rect: Rect): RegisteredElement;
|
|
15
|
+
find(agentId: string): RegisteredElement | null;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ElementView } from './view.ts';
|
|
2
|
+
export declare function clip(value: string, limit: number): string;
|
|
3
|
+
export declare function twinSignature(view: ElementView): string;
|
|
4
|
+
export declare function countTwins(views: ElementView[]): Map<string, number>;
|
|
5
|
+
export declare function renderLine(view: ElementView, agentId: string | null, twins: number): string;
|
|
6
|
+
export interface SnapshotHeader {
|
|
7
|
+
screen: string;
|
|
8
|
+
routes: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare function renderSnapshotText(header: SnapshotHeader, lines: string[]): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Fiber } from '../fiber/types.ts';
|
|
2
|
+
import type { Rect } from '../host/rect.ts';
|
|
3
|
+
export type ScrollDirection = 'up' | 'down' | 'left' | 'right';
|
|
4
|
+
export interface ScrollGeometry {
|
|
5
|
+
viewport: Rect;
|
|
6
|
+
content: Rect;
|
|
7
|
+
horizontal: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function isHorizontal(fiber: Fiber): boolean;
|
|
10
|
+
export declare function measureScrollGeometry(scrollFiber: Fiber): Promise<ScrollGeometry | null>;
|
|
11
|
+
export declare function scrollOffsetOf(geometry: ScrollGeometry): number;
|
|
12
|
+
export declare function maxScrollOffsetOf(geometry: ScrollGeometry): number;
|
|
13
|
+
export declare function viewportExtentOf(geometry: ScrollGeometry): number;
|
|
14
|
+
export declare function scrollDirectionsOf(geometry: ScrollGeometry): ScrollDirection[];
|
|
15
|
+
export declare function describeScrollDirections(geometry: ScrollGeometry | null): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Rect } from '../host/rect.ts';
|
|
2
|
+
export interface PositionedText {
|
|
3
|
+
rect: Rect;
|
|
4
|
+
text: string;
|
|
5
|
+
heading: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function groupIntoLines(blocks: PositionedText[]): string[];
|
|
8
|
+
export declare function limitCharacters(lines: string[], maxChars: number): string[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Fiber } from '../fiber/types.ts';
|
|
2
|
+
import type { Rect } from '../host/rect.ts';
|
|
3
|
+
import type { Offscreen } from './visibility.ts';
|
|
4
|
+
import type { ElementKind } from './kinds.ts';
|
|
5
|
+
export interface ElementView {
|
|
6
|
+
kind: ElementKind;
|
|
7
|
+
label: string;
|
|
8
|
+
icon: string | null;
|
|
9
|
+
testID: string | null;
|
|
10
|
+
role: string | null;
|
|
11
|
+
type: string | null;
|
|
12
|
+
placeholder: string | null;
|
|
13
|
+
value: string | null;
|
|
14
|
+
checked: boolean | null;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
expanded: boolean | null;
|
|
17
|
+
selected: boolean | null;
|
|
18
|
+
scroll: string | null;
|
|
19
|
+
offscreen: Offscreen | null;
|
|
20
|
+
rect: Rect;
|
|
21
|
+
}
|
|
22
|
+
export interface ViewSource {
|
|
23
|
+
kind: ElementKind;
|
|
24
|
+
fiber: Fiber;
|
|
25
|
+
ancestors: Fiber[];
|
|
26
|
+
rect: Rect;
|
|
27
|
+
scroll: string | null;
|
|
28
|
+
offscreen?: Offscreen | null;
|
|
29
|
+
}
|
|
30
|
+
export declare function buildView(source: ViewSource): ElementView;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Fiber } from '../fiber/types.ts';
|
|
2
|
+
import { type Rect, type Size } from '../host/rect.ts';
|
|
3
|
+
import { type ScrollGeometry } from './scroll.ts';
|
|
4
|
+
export type ScrollGeometries = Map<Fiber, ScrollGeometry | null>;
|
|
5
|
+
export declare function measureScrollGeometries(containers: Iterable<Fiber>): Promise<ScrollGeometries>;
|
|
6
|
+
export type Offscreen = 'above' | 'below' | 'left' | 'right';
|
|
7
|
+
export type Visibility = {
|
|
8
|
+
kind: 'visible';
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'offscreen';
|
|
11
|
+
direction: Offscreen;
|
|
12
|
+
distance: number;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'hidden';
|
|
15
|
+
};
|
|
16
|
+
export declare function classifyVisibility(rect: Rect, window: Size, containers: Fiber[], geometries: ScrollGeometries): Visibility;
|
|
17
|
+
export declare function keepInTextTree(visibility: Visibility, rect: Rect, window: Size, viewportOnly: boolean): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Rect } from '../host/rect.ts';
|
|
2
|
+
import type { Candidate } from './collect.ts';
|
|
3
|
+
import type { Offscreen } from './visibility.ts';
|
|
4
|
+
export interface MeasuredCandidate {
|
|
5
|
+
candidate: Candidate;
|
|
6
|
+
rect: Rect;
|
|
7
|
+
offscreen: Offscreen | null;
|
|
8
|
+
distance: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function dropWrapperDuplicates(measured: MeasuredCandidate[]): MeasuredCandidate[];
|
|
11
|
+
export declare function limitOffscreen(measured: MeasuredCandidate[]): MeasuredCandidate[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { Component, type ReactNode } from 'react';
|
|
2
|
+
interface SdkErrorBoundaryProps {
|
|
3
|
+
context: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
interface SdkErrorBoundaryState {
|
|
7
|
+
failed: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class SdkErrorBoundary extends Component<SdkErrorBoundaryProps, SdkErrorBoundaryState> {
|
|
10
|
+
state: SdkErrorBoundaryState;
|
|
11
|
+
static getDerivedStateFromError(): SdkErrorBoundaryState;
|
|
12
|
+
componentDidCatch(error: Error): void;
|
|
13
|
+
render(): React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type StateSnapshot = Record<string, string | number | boolean>;
|
|
2
|
+
export interface StackFrame {
|
|
3
|
+
function?: string;
|
|
4
|
+
filename: string;
|
|
5
|
+
lineno: number;
|
|
6
|
+
colno: number;
|
|
7
|
+
}
|
|
8
|
+
export interface Breadcrumb {
|
|
9
|
+
timestamp: number;
|
|
10
|
+
category: string;
|
|
11
|
+
message: string;
|
|
12
|
+
level: 'info';
|
|
13
|
+
}
|
|
14
|
+
export interface ExceptionValue {
|
|
15
|
+
type: string;
|
|
16
|
+
value: string;
|
|
17
|
+
stacktrace: {
|
|
18
|
+
frames: StackFrame[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface SentryEvent {
|
|
22
|
+
event_id: string;
|
|
23
|
+
timestamp: number;
|
|
24
|
+
platform: 'javascript';
|
|
25
|
+
level: 'error';
|
|
26
|
+
environment: string;
|
|
27
|
+
release: string;
|
|
28
|
+
sdk: {
|
|
29
|
+
name: string;
|
|
30
|
+
version: string;
|
|
31
|
+
};
|
|
32
|
+
tags: Record<string, string>;
|
|
33
|
+
user?: {
|
|
34
|
+
id: string;
|
|
35
|
+
};
|
|
36
|
+
contexts: {
|
|
37
|
+
app_info: StateSnapshot;
|
|
38
|
+
};
|
|
39
|
+
fingerprint: string[];
|
|
40
|
+
exception: {
|
|
41
|
+
values: ExceptionValue[];
|
|
42
|
+
};
|
|
43
|
+
breadcrumbs: {
|
|
44
|
+
values: Breadcrumb[];
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export interface ParsedDsn {
|
|
48
|
+
dsn: string;
|
|
49
|
+
endpoint: string;
|
|
50
|
+
}
|
|
51
|
+
export declare function parseDsn(dsn: string): ParsedDsn | null;
|
|
52
|
+
export declare function parseStack(stack: string | undefined): StackFrame[];
|
|
53
|
+
export declare function serializeEnvelope(dsn: string, event: SentryEvent, sentAt: string): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type StateSnapshot } from './envelope.ts';
|
|
2
|
+
export interface ReportIdentity {
|
|
3
|
+
sourceId: string | null;
|
|
4
|
+
sessionId: number | null;
|
|
5
|
+
userExternalId: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface ReporterOptions {
|
|
8
|
+
dsn: string;
|
|
9
|
+
environment: string;
|
|
10
|
+
release: string;
|
|
11
|
+
sdkVersion: string;
|
|
12
|
+
send: (url: string, body: string) => Promise<unknown>;
|
|
13
|
+
now: () => number;
|
|
14
|
+
randomHex: (length: number) => string;
|
|
15
|
+
appInfo: () => StateSnapshot;
|
|
16
|
+
}
|
|
17
|
+
export declare class Reporter {
|
|
18
|
+
private readonly options;
|
|
19
|
+
private readonly target;
|
|
20
|
+
private readonly breadcrumbs;
|
|
21
|
+
private publishableKey;
|
|
22
|
+
private identityProvider;
|
|
23
|
+
private sent;
|
|
24
|
+
private reporting;
|
|
25
|
+
constructor(options: ReporterOptions);
|
|
26
|
+
setPublishableKey(publishableKey: string): void;
|
|
27
|
+
setIdentityProvider(provider: () => ReportIdentity): void;
|
|
28
|
+
addBreadcrumb(category: string, message: string): void;
|
|
29
|
+
report(context: string, error?: unknown): void;
|
|
30
|
+
private capture;
|
|
31
|
+
private readIdentity;
|
|
32
|
+
private deliver;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function scrubString(value: string): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ReportIdentity } from './reporter.ts';
|
|
2
|
+
export declare function reportSdkError(context: string, error?: unknown): void;
|
|
3
|
+
export declare function recordSdkBreadcrumb(category: string, message: string): void;
|
|
4
|
+
export declare function setReportPublishableKey(publishableKey: string): void;
|
|
5
|
+
export declare function setReportIdentityProvider(provider: () => ReportIdentity): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ConnectionOptions {
|
|
2
|
+
publishableKey?: unknown;
|
|
3
|
+
apiBaseUrl?: unknown;
|
|
4
|
+
relayUrl?: unknown;
|
|
5
|
+
}
|
|
6
|
+
export type ConnectionConfig = {
|
|
7
|
+
kind: 'backend';
|
|
8
|
+
publishableKey: string;
|
|
9
|
+
apiBaseUrl: string;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'relay';
|
|
12
|
+
relayUrl: string;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'disabled';
|
|
15
|
+
};
|
|
16
|
+
export declare function normalizeApiBaseUrl(value: unknown): string | null;
|
|
17
|
+
export declare function normalizeRelayUrl(value: unknown): string | null;
|
|
18
|
+
export declare function resolveConnectionOptions(options: ConnectionOptions, development: boolean): ConnectionConfig;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { OutboundFrame } from '../agent/frames.ts';
|
|
2
|
+
import type { AgentTransport } from './transport.ts';
|
|
3
|
+
export declare class RelayTransport implements AgentTransport {
|
|
4
|
+
private readonly url;
|
|
5
|
+
private socket;
|
|
6
|
+
private listener;
|
|
7
|
+
private reconnectTimer;
|
|
8
|
+
private attempts;
|
|
9
|
+
private stopped;
|
|
10
|
+
constructor(url: string);
|
|
11
|
+
onMessage(listener: (raw: string) => void): void;
|
|
12
|
+
start(): void;
|
|
13
|
+
stop(): void;
|
|
14
|
+
send(frame: OutboundFrame): void;
|
|
15
|
+
private connect;
|
|
16
|
+
private scheduleReconnect;
|
|
17
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type Language = 'es' | 'en';
|
|
2
|
+
export interface UiStrings {
|
|
3
|
+
confirmStop: string;
|
|
4
|
+
confirmationTitle: string;
|
|
5
|
+
confirmProceed: string;
|
|
6
|
+
confirmProceedDestructive: string;
|
|
7
|
+
confirmCannotBeUndone: string;
|
|
8
|
+
chatLauncher: string;
|
|
9
|
+
chatClose: string;
|
|
10
|
+
chatUnavailable: string;
|
|
11
|
+
nudgePrompt: string;
|
|
12
|
+
nudgeAccept: string;
|
|
13
|
+
nudgeDecline: string;
|
|
14
|
+
nudgeLater: string;
|
|
15
|
+
nudgeDismiss: string;
|
|
16
|
+
agentThinking: string;
|
|
17
|
+
agentExecuting: string;
|
|
18
|
+
agentTakingControl: string;
|
|
19
|
+
agentStop: string;
|
|
20
|
+
agentTapStopToControl: string;
|
|
21
|
+
agentQueued: string;
|
|
22
|
+
readingSkip: string;
|
|
23
|
+
actionClick: string;
|
|
24
|
+
actionType: string;
|
|
25
|
+
actionCheck: string;
|
|
26
|
+
actionUncheck: string;
|
|
27
|
+
actionScrollTo: string;
|
|
28
|
+
actionPressKey: string;
|
|
29
|
+
actionFallback: string;
|
|
30
|
+
}
|
|
31
|
+
export type UiStringOverrides = Partial<UiStrings>;
|
|
32
|
+
export declare function resolveLanguage(language: unknown): Language;
|
|
33
|
+
export declare function resolveStrings(language: Language, overrides: UiStringOverrides | undefined): UiStrings;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SDK_VERSION = "0.1.0";
|