@beeuni/sdk 0.1.0 → 0.3.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/README.md +53 -92
- package/dist/beeuni.esm.min.js +36 -34
- package/dist/beeuni.global.js +36 -34
- package/dist/browser/cache/idb-sync-cache.js +15 -5
- package/dist/browser/session-sync/server-transcript-mirror.d.ts +7 -1
- package/dist/browser/session-sync/server-transcript-mirror.js +30 -24
- package/dist/browser/session-sync/session-sync-registry.d.ts +3 -1
- package/dist/browser/session-sync/session-sync-registry.js +48 -3
- package/dist/browser/stores/sync-store/keep-unchanged.d.ts +4 -0
- package/dist/browser/stores/sync-store/keep-unchanged.js +34 -0
- package/dist/browser/stores/sync-store.d.ts +7 -0
- package/dist/browser/stores/sync-store.js +122 -35
- package/dist/core/attachments/prompt-attachments.d.ts +4 -0
- package/dist/core/attachments/prompt-attachments.js +34 -0
- package/dist/core/capture/rules.d.ts +17 -0
- package/dist/core/capture/rules.js +27 -0
- package/dist/core/client/beeuni.d.ts +99 -34
- package/dist/core/client/beeuni.js +5 -11
- package/dist/core/client/capture.d.ts +105 -0
- package/dist/core/client/capture.js +48 -0
- package/dist/core/client/facade-catalog.d.ts +0 -4
- package/dist/core/client/facade-catalog.js +1 -5
- package/dist/core/client/facade-identity.d.ts +1 -0
- package/dist/core/client/facade-identity.js +1 -0
- package/dist/core/client/project-access-resources.d.ts +3 -1
- package/dist/core/client/project-access-resources.js +1 -1
- package/dist/core/client/project-connections.d.ts +2 -2
- package/dist/core/client/project-connections.js +2 -2
- package/dist/core/client/project-operations-admin.d.ts +4 -4
- package/dist/core/client/project-operations-review.d.ts +2 -3
- package/dist/core/client/project-operations-review.js +1 -0
- package/dist/core/client/project-operations-workspace.d.ts +4 -4
- package/dist/core/client/project-operations-workspace.js +1 -1
- package/dist/core/client/project-operations.d.ts +9 -19
- package/dist/core/client/project-operations.js +2 -6
- package/dist/core/client/project-platform-security.d.ts +1 -1
- package/dist/core/client/project-platform-settings.d.ts +1 -1
- package/dist/core/client/session-context.d.ts +2 -0
- package/dist/core/client/session-handle.d.ts +13 -0
- package/dist/core/client/session-lifecycle-resources.d.ts +11 -0
- package/dist/core/client/session-lifecycle-resources.js +4 -0
- package/dist/core/client/session-lifecycle-security.d.ts +2 -0
- package/dist/core/client/session-lifecycle-security.js +1 -0
- package/dist/core/client/session-readiness.d.ts +2 -0
- package/dist/core/client/session-readiness.js +20 -1
- package/dist/core/http/api-client.d.ts +1 -7
- package/dist/core/http/api-client.js +2 -37
- package/dist/core/http/auth.d.ts +2 -4
- package/dist/core/http/auth.js +2 -8
- package/dist/core/http/config.d.ts +2 -0
- package/dist/core/http/response-error.js +26 -11
- package/dist/core/http/transport.js +6 -1
- package/dist/core/models/composer-model.d.ts +14 -0
- package/dist/core/models/composer-model.js +21 -1
- package/dist/core/rest/platform-client/capture.d.ts +363 -0
- package/dist/core/rest/platform-client/capture.js +116 -0
- package/dist/core/rest/platform-client/client-policy.d.ts +8 -0
- package/dist/core/rest/platform-client/client-policy.js +30 -0
- package/dist/core/rest/platform-client/index.d.ts +4 -4
- package/dist/core/rest/platform-client/index.js +4 -4
- package/dist/core/rest/platform-client/lifecycle.js +18 -12
- package/dist/core/rest/platform-client/shared.d.ts +5 -0
- package/dist/core/rest/platform-client/shared.js +18 -0
- package/dist/core/rest/platform-client/types.d.ts +1 -1
- package/dist/core/rest/projects-client/account-secret-resources.d.ts +2 -1
- package/dist/core/rest/projects-client/accounts.d.ts +34 -0
- package/dist/core/rest/projects-client/accounts.js +10 -0
- package/dist/core/rest/projects-client/admin-providers.d.ts +0 -61
- package/dist/core/rest/projects-client/admin-providers.js +0 -6
- package/dist/core/rest/projects-client/agent-config.d.ts +3 -0
- package/dist/core/rest/projects-client/apps-fleet.d.ts +5 -1
- package/dist/core/rest/projects-client/apps-fleet.js +2 -2
- package/dist/core/rest/projects-client/apps.d.ts +11 -1
- package/dist/core/rest/projects-client/change-requests.d.ts +2 -0
- package/dist/core/rest/projects-client/change-requests.js +2 -0
- package/dist/core/rest/projects-client/connectors.d.ts +13 -55
- package/dist/core/rest/projects-client/connectors.js +5 -29
- package/dist/core/rest/projects-client/files.d.ts +3 -0
- package/dist/core/rest/projects-client/files.js +4 -0
- package/dist/core/rest/projects-client/gateway.d.ts +5 -0
- package/dist/core/rest/projects-client/git-backend.d.ts +1 -10
- package/dist/core/rest/projects-client/git-backend.js +0 -10
- package/dist/core/rest/projects-client/iam-actions.d.ts +76 -0
- package/dist/core/rest/projects-client/iam-actions.js +101 -0
- package/dist/core/rest/projects-client/iam-sso.d.ts +0 -10
- package/dist/core/rest/projects-client/iam-sso.js +0 -3
- package/dist/core/rest/projects-client/iam.d.ts +1 -0
- package/dist/core/rest/projects-client/iam.js +1 -0
- package/dist/core/rest/projects-client/index.d.ts +1 -4
- package/dist/core/rest/projects-client/index.js +1 -4
- package/dist/core/rest/projects-client/notifications.d.ts +1 -1
- package/dist/core/rest/projects-client/notifications.js +4 -0
- package/dist/core/rest/projects-client/projects.d.ts +4 -2
- package/dist/core/rest/projects-client/projects.js +4 -2
- package/dist/core/rest/projects-client/review-items.d.ts +2 -0
- package/dist/core/rest/projects-client/review-items.js +4 -0
- package/dist/core/rest/projects-client/review.d.ts +17 -3
- package/dist/core/rest/projects-client/review.js +11 -0
- package/dist/core/rest/projects-client/sandbox.d.ts +8 -9
- package/dist/core/rest/projects-client/secrets.d.ts +3 -0
- package/dist/core/rest/projects-client/session-attachments.js +14 -1
- package/dist/core/rest/projects-client/session-sandbox.d.ts +1 -1
- package/dist/core/rest/projects-client/sessions.d.ts +31 -4
- package/dist/core/rest/projects-client/sessions.js +34 -4
- package/dist/core/runtime/runtime-rest-client.js +1 -1
- package/dist/core/runtime/runtime-types.d.ts +1 -0
- package/dist/core/session/control-stream.d.ts +1 -0
- package/dist/core/session/control-stream.js +18 -1
- package/dist/core/session/open-bundle.d.ts +4 -4
- package/dist/core/session/open-bundle.js +29 -46
- package/dist/core/session/turn-end-watch.d.ts +47 -0
- package/dist/core/session/turn-end-watch.js +141 -0
- package/dist/core/session-log/guard.d.ts +6 -0
- package/dist/core/session-log/guard.js +109 -0
- package/dist/core/session-log/index.d.ts +7 -0
- package/dist/core/session-log/index.js +5 -0
- package/dist/core/session-log/saved-log.d.ts +10 -0
- package/dist/core/session-log/saved-log.js +25 -0
- package/dist/core/session-log/source.d.ts +25 -0
- package/dist/core/session-log/source.js +30 -0
- package/dist/core/session-log/store.d.ts +21 -0
- package/dist/core/session-log/store.js +126 -0
- package/dist/core/session-log/tool-call.d.ts +11 -0
- package/dist/core/session-log/tool-call.js +65 -0
- package/dist/core/session-log/turns/blocks.d.ts +60 -0
- package/dist/core/session-log/turns/blocks.js +124 -0
- package/dist/core/session-log/turns/history.d.ts +32 -0
- package/dist/core/session-log/turns/history.js +99 -0
- package/dist/core/session-log/turns/index.d.ts +4 -0
- package/dist/core/session-log/turns/index.js +4 -0
- package/dist/core/session-log/turns/metrics.d.ts +21 -0
- package/dist/core/session-log/turns/metrics.js +29 -0
- package/dist/core/session-log/turns/turn.d.ts +55 -0
- package/dist/core/session-log/turns/turn.js +279 -0
- package/dist/core/session-log/turns/v1-parts.d.ts +8 -0
- package/dist/core/session-log/turns/v1-parts.js +43 -0
- package/dist/core/session-log/types.d.ts +264 -0
- package/dist/core/session-log/types.js +6 -0
- package/dist/core/session-log/v1-view.d.ts +13 -0
- package/dist/core/session-log/v1-view.js +215 -0
- package/dist/core/session-log/v1.d.ts +31 -0
- package/dist/core/session-log/v1.js +473 -0
- package/dist/core/session-sync/copy-store-types.d.ts +19 -0
- package/dist/core/session-sync/copy-store-types.js +1 -0
- package/dist/core/session-sync/saved-copy-store.js +25 -4
- package/dist/core/session-sync/saved-transcript.d.ts +15 -1
- package/dist/core/session-sync/saved-transcript.js +55 -0
- package/dist/core/session-sync/session-sync-controller.js +3 -0
- package/dist/core/stream/event-stream.js +2 -2
- package/dist/core/turns/classify.d.ts +2 -1
- package/dist/core/turns/classify.js +7 -3
- package/dist/core/turns/edit-blocks.d.ts +1 -0
- package/dist/core/turns/edit-blocks.js +15 -0
- package/dist/core/turns/parts.d.ts +3 -2
- package/dist/core/turns/parts.js +4 -2
- package/dist/core/turns/segments/burst-summary.d.ts +1 -0
- package/dist/core/turns/segments/burst-summary.js +24 -0
- package/dist/core/turns/segments/group-steps.d.ts +4 -3
- package/dist/core/turns/segments/group-steps.js +9 -6
- package/dist/core/turns/segments/index.d.ts +1 -0
- package/dist/core/turns/segments/index.js +1 -0
- package/dist/core/turns/segments/narration.d.ts +5 -4
- package/dist/core/turns/segments/narration.js +12 -3
- package/dist/core/turns/segments/session-activity-groups.d.ts +2 -1
- package/dist/core/turns/segments/session-activity-groups.js +3 -1
- package/dist/core/turns/segments/step-label.d.ts +2 -1
- package/dist/core/turns/segments/step-label.js +3 -1
- package/dist/core/turns/segments/work-split.d.ts +10 -0
- package/dist/core/turns/segments/work-split.js +40 -0
- package/dist/core/turns/segments/working-turn.d.ts +4 -2
- package/dist/core/turns/segments/working-turn.js +9 -8
- package/dist/core/turns/state.d.ts +2 -7
- package/dist/core/turns/state.js +28 -134
- package/dist/core/turns/tool-kind.d.ts +1 -1
- package/dist/core/turns/tool-kind.js +3 -2
- package/dist/core/turns/tool-registry.js +1 -0
- package/dist/core/turns/tools/tool-meta.d.ts +3 -2
- package/dist/core/turns/tools/tool-meta.js +5 -2
- package/dist/core/turns/tools/tool-outcome.d.ts +2 -1
- package/dist/core/turns/tools/tool-outcome.js +3 -1
- package/dist/core/turns/types.d.ts +1 -1
- package/dist/core/turns/view-model.js +1 -13
- package/dist/core/warm-session-pool.d.ts +29 -0
- package/dist/core/warm-session-pool.js +127 -0
- package/dist/genui/catalog.d.ts +28 -0
- package/dist/genui/catalog.js +396 -0
- package/dist/genui/expansion.d.ts +3 -0
- package/dist/genui/expansion.js +295 -0
- package/dist/genui/fence-entry.d.ts +2 -0
- package/dist/genui/fence-entry.js +1 -0
- package/dist/genui/fence.d.ts +21 -0
- package/dist/genui/fence.js +138 -0
- package/dist/genui/index.d.ts +6 -0
- package/dist/genui/index.js +6 -0
- package/dist/genui/markdown.d.ts +12 -0
- package/dist/genui/markdown.js +104 -0
- package/dist/genui/parse.d.ts +6 -0
- package/dist/genui/parse.js +75 -0
- package/dist/genui/prompt.d.ts +2 -0
- package/dist/genui/prompt.js +206 -0
- package/dist/genui/react/default-components.d.ts +2 -0
- package/dist/genui/react/default-components.js +72 -0
- package/dist/genui/react/default-components.test.d.ts +1 -0
- package/dist/genui/react/default-components.test.js +94 -0
- package/dist/genui/react/genui-block-disabled.test.d.ts +1 -0
- package/dist/genui/react/genui-block-disabled.test.js +50 -0
- package/dist/genui/react/genui-block.d.ts +28 -0
- package/dist/genui/react/genui-block.js +91 -0
- package/dist/genui/react/genui-block.test.d.ts +1 -0
- package/dist/genui/react/genui-block.test.js +205 -0
- package/dist/genui/react/index.d.ts +2 -0
- package/dist/genui/react/index.js +2 -0
- package/dist/genui/share.d.ts +5 -0
- package/dist/genui/share.js +30 -0
- package/dist/genui/test-fixtures.d.ts +2 -0
- package/dist/genui/test-fixtures.js +16 -0
- package/dist/genui/types.d.ts +29 -0
- package/dist/genui/types.js +1 -0
- package/dist/genui/urls.d.ts +1 -0
- package/dist/genui/urls.js +18 -0
- package/dist/genui/validate.d.ts +9 -0
- package/dist/genui/validate.js +116 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/internal/connector-catalog.d.ts +48 -0
- package/dist/internal/connector-catalog.js +27 -0
- package/dist/internal/host-configuration.d.ts +22 -0
- package/dist/internal/host-configuration.js +28 -0
- package/dist/internal/platform-admin-react.d.ts +12 -0
- package/dist/internal/platform-admin-react.js +13 -0
- package/dist/internal/platform-admin.d.ts +9 -0
- package/dist/internal/platform-admin.js +9 -0
- package/dist/platform/ui.d.ts +8 -2
- package/dist/platform/ui.js +19 -4
- package/dist/react/chat/use-chat-turns.d.ts +1 -1
- package/dist/react/human-presence.d.ts +9 -0
- package/dist/react/human-presence.js +12 -0
- package/dist/react/index.d.ts +4 -13
- package/dist/react/index.js +4 -13
- package/dist/react/opencode.d.ts +1 -0
- package/dist/react/opencode.js +1 -0
- package/dist/react/query-contracts.d.ts +6 -0
- package/dist/react/query-contracts.js +6 -0
- package/dist/react/query-keys.d.ts +17 -2
- package/dist/react/query-keys.js +24 -2
- package/dist/react/reset-identity-state.js +2 -0
- package/dist/react/session-cache-write.d.ts +1 -0
- package/dist/react/session-cache-write.js +20 -0
- package/dist/react/session-transcript-subscription.js +3 -1
- package/dist/react/sign-in-with-beeuni.d.ts +6 -6
- package/dist/react/turn-end-handoff.d.ts +13 -0
- package/dist/react/turn-end-handoff.js +101 -0
- package/dist/react/use-admin-providers.d.ts +3 -6
- package/dist/react/use-admin-providers.js +1 -11
- package/dist/react/use-capture.d.ts +47 -0
- package/dist/react/use-capture.js +173 -0
- package/dist/react/use-feature-flag.js +1 -0
- package/dist/react/use-opencode-events/handle-event.d.ts +1 -0
- package/dist/react/use-opencode-events/handle-event.js +5 -0
- package/dist/react/use-opencode-events/handle-interaction-event.js +8 -3
- package/dist/react/use-opencode-events/handle-session-event.js +13 -8
- package/dist/react/use-opencode-events/handler-context.d.ts +1 -0
- package/dist/react/use-opencode-events/helpers.d.ts +1 -0
- package/dist/react/use-opencode-events/helpers.js +11 -1
- package/dist/react/use-opencode-events/index.js +1 -0
- package/dist/react/use-opencode-local.d.ts +5 -1
- package/dist/react/use-opencode-local.js +15 -2
- package/dist/react/use-opencode-sessions/commands.d.ts +11 -1
- package/dist/react/use-opencode-sessions/commands.js +21 -1
- package/dist/react/use-opencode-sessions/permissions.js +28 -1
- package/dist/react/use-project-sessions.d.ts +1 -1
- package/dist/react/use-project-sessions.js +6 -5
- package/dist/react/use-prompt-attachments.js +1 -0
- package/dist/react/use-review-summary.d.ts +13 -0
- package/dist/react/use-review-summary.js +32 -0
- package/dist/react/use-runtime-reconnect.js +1 -1
- package/dist/react/use-session-list-state.d.ts +6 -0
- package/dist/react/use-session-list-state.js +33 -0
- package/dist/react/use-session-log.d.ts +16 -0
- package/dist/react/use-session-log.js +143 -0
- package/dist/react/use-session-messages.d.ts +2 -1
- package/dist/react/use-session-messages.js +15 -14
- package/dist/react/use-session-stream.js +12 -1
- package/dist/react/use-session-sync.d.ts +2 -2
- package/dist/react/use-session-sync.js +10 -8
- package/dist/react/use-session-transcript-history.js +2 -12
- package/dist/react/use-session-working.d.ts +2 -0
- package/dist/react/use-session-working.js +10 -0
- package/dist/react/use-session.d.ts +6 -0
- package/dist/react/use-session.js +88 -6
- package/package.json +62 -8
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import type { CaptureExclusionGroup, CaptureLayer, CaptureMaxHeight } from '../../capture/rules.js';
|
|
2
|
+
export * from '../../capture/rules.js';
|
|
3
|
+
export type CaptureLiveState = 'recording' | 'paused' | 'permission_missing' | 'not_recording' | 'offline' | 'unknown' | (string & {});
|
|
4
|
+
export interface CapturePolicy {
|
|
5
|
+
layers: {
|
|
6
|
+
screen: boolean;
|
|
7
|
+
actions: boolean;
|
|
8
|
+
audio: boolean;
|
|
9
|
+
};
|
|
10
|
+
privacy: {
|
|
11
|
+
redact_pii: boolean;
|
|
12
|
+
excluded_bundle_ids: string[];
|
|
13
|
+
excluded_domains: string[];
|
|
14
|
+
exclusion_groups: CaptureExclusionGroup[];
|
|
15
|
+
exclude_private_browsing: boolean;
|
|
16
|
+
};
|
|
17
|
+
retention: {
|
|
18
|
+
local_hours: number;
|
|
19
|
+
remote_days: number;
|
|
20
|
+
};
|
|
21
|
+
recording: {
|
|
22
|
+
paused: boolean;
|
|
23
|
+
paused_until_ms: number | null;
|
|
24
|
+
interval_ms?: number | null;
|
|
25
|
+
max_height?: CaptureMaxHeight | null;
|
|
26
|
+
};
|
|
27
|
+
notice: string;
|
|
28
|
+
experimental?: {
|
|
29
|
+
privacy_controls: boolean;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface CapturePolicyRecord {
|
|
33
|
+
policy: CapturePolicy;
|
|
34
|
+
updated_at: string | null;
|
|
35
|
+
updated_by: string | null;
|
|
36
|
+
}
|
|
37
|
+
export interface CaptureDisplay {
|
|
38
|
+
id: number;
|
|
39
|
+
name: string | null;
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
w: number;
|
|
43
|
+
h: number;
|
|
44
|
+
scale: number | null;
|
|
45
|
+
main: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface CaptureFocusSpan {
|
|
48
|
+
device_id: string;
|
|
49
|
+
display_id: number;
|
|
50
|
+
start_at: string;
|
|
51
|
+
end_at: string;
|
|
52
|
+
}
|
|
53
|
+
export type CaptureHealthReason = 'offline' | 'stalled' | 'error' | 'never_reported' | 'unseen' | 'permission_missing' | 'paused' | 'sync_error' | 'backlog' | 'behind_version';
|
|
54
|
+
export interface CaptureDeviceHealth {
|
|
55
|
+
state: 'healthy' | 'attention' | 'not_recording';
|
|
56
|
+
idle: boolean;
|
|
57
|
+
reasons: CaptureHealthReason[];
|
|
58
|
+
since: string | null;
|
|
59
|
+
latest_version: string | null;
|
|
60
|
+
}
|
|
61
|
+
export interface CaptureHealthSummary {
|
|
62
|
+
recording: number;
|
|
63
|
+
idle: number;
|
|
64
|
+
attention: number;
|
|
65
|
+
not_recording: number;
|
|
66
|
+
latest_version: string | null;
|
|
67
|
+
}
|
|
68
|
+
export type CaptureHealthBucket = 'recording' | 'idle' | 'attention' | 'not_recording';
|
|
69
|
+
export declare function captureHealthBucket(device: Pick<CaptureDevice, 'health'>): CaptureHealthBucket;
|
|
70
|
+
export interface CaptureDevice {
|
|
71
|
+
device_id: string;
|
|
72
|
+
user_id: string | null;
|
|
73
|
+
name: string | null;
|
|
74
|
+
os: string | null;
|
|
75
|
+
os_version: string | null;
|
|
76
|
+
arch: string | null;
|
|
77
|
+
app_version: string | null;
|
|
78
|
+
displays: CaptureDisplay[];
|
|
79
|
+
live: {
|
|
80
|
+
state: CaptureLiveState;
|
|
81
|
+
status: Record<string, unknown> | null;
|
|
82
|
+
reported_at: string | null;
|
|
83
|
+
};
|
|
84
|
+
last_credentials_at: string | null;
|
|
85
|
+
revoked_at: string | null;
|
|
86
|
+
health: CaptureDeviceHealth;
|
|
87
|
+
enrollment_token_id?: string | null;
|
|
88
|
+
created_at: string;
|
|
89
|
+
}
|
|
90
|
+
export interface CaptureEnrollmentToken {
|
|
91
|
+
token_id: string;
|
|
92
|
+
name: string;
|
|
93
|
+
token_prefix: string;
|
|
94
|
+
state: 'active' | 'revoked' | 'expired';
|
|
95
|
+
email_domains: string[];
|
|
96
|
+
max_devices: number | null;
|
|
97
|
+
device_count: number;
|
|
98
|
+
require_approval: boolean;
|
|
99
|
+
user_id: string | null;
|
|
100
|
+
expires_at: string | null;
|
|
101
|
+
revoked_at: string | null;
|
|
102
|
+
last_used_at: string | null;
|
|
103
|
+
created_by: string;
|
|
104
|
+
created_at: string;
|
|
105
|
+
}
|
|
106
|
+
export interface CaptureEnrollmentTokenSecret extends CaptureEnrollmentToken {
|
|
107
|
+
token: string;
|
|
108
|
+
}
|
|
109
|
+
export interface CaptureEnrollmentTokenInput {
|
|
110
|
+
name: string;
|
|
111
|
+
email_domains?: string[];
|
|
112
|
+
max_devices?: number | null;
|
|
113
|
+
require_approval?: boolean;
|
|
114
|
+
expires_in_days?: number | null;
|
|
115
|
+
user_id?: string | null;
|
|
116
|
+
}
|
|
117
|
+
export type CaptureEnrollmentStatus = 'pending' | 'approved' | 'denied' | 'enrolled';
|
|
118
|
+
export interface CaptureEnrollment {
|
|
119
|
+
enrollment_id: string;
|
|
120
|
+
token_id: string;
|
|
121
|
+
token_name: string | null;
|
|
122
|
+
status: CaptureEnrollmentStatus;
|
|
123
|
+
reason: 'approval_required' | null;
|
|
124
|
+
principal_name: string | null;
|
|
125
|
+
account_name: string | null;
|
|
126
|
+
device: {
|
|
127
|
+
name: string | null;
|
|
128
|
+
os: string | null;
|
|
129
|
+
os_version: string | null;
|
|
130
|
+
arch: string | null;
|
|
131
|
+
app_version: string | null;
|
|
132
|
+
};
|
|
133
|
+
user_id: string | null;
|
|
134
|
+
device_id: string | null;
|
|
135
|
+
decided_by: string | null;
|
|
136
|
+
decided_at: string | null;
|
|
137
|
+
created_at: string;
|
|
138
|
+
last_seen_at: string;
|
|
139
|
+
}
|
|
140
|
+
export interface CaptureWindowQuery {
|
|
141
|
+
day?: string;
|
|
142
|
+
from?: string;
|
|
143
|
+
to?: string;
|
|
144
|
+
userId?: string;
|
|
145
|
+
deviceId?: string;
|
|
146
|
+
displayId?: number | 'all';
|
|
147
|
+
}
|
|
148
|
+
export interface CaptureActivityRun {
|
|
149
|
+
device_id: string;
|
|
150
|
+
app: string | null;
|
|
151
|
+
title: string | null;
|
|
152
|
+
url: string | null;
|
|
153
|
+
start_at: string;
|
|
154
|
+
end_at: string;
|
|
155
|
+
frames: number;
|
|
156
|
+
}
|
|
157
|
+
export interface CaptureChunk {
|
|
158
|
+
chunk_id: string;
|
|
159
|
+
device_id: string;
|
|
160
|
+
kind: 'chunk' | 'audio' | 'actions';
|
|
161
|
+
start_at: string;
|
|
162
|
+
end_at: string;
|
|
163
|
+
item_count: number;
|
|
164
|
+
encrypted: boolean;
|
|
165
|
+
display_id: number | null;
|
|
166
|
+
display: CaptureDisplay | null;
|
|
167
|
+
}
|
|
168
|
+
export interface CaptureTimeline {
|
|
169
|
+
user_id: string;
|
|
170
|
+
from: string;
|
|
171
|
+
to: string;
|
|
172
|
+
displays: CaptureDisplay[];
|
|
173
|
+
focus: CaptureFocusSpan[];
|
|
174
|
+
runs: CaptureActivityRun[];
|
|
175
|
+
chunks: CaptureChunk[];
|
|
176
|
+
}
|
|
177
|
+
export interface CaptureFrame {
|
|
178
|
+
frame_id: string;
|
|
179
|
+
ts: string;
|
|
180
|
+
device_id: string;
|
|
181
|
+
chunk_id: string;
|
|
182
|
+
frame_index: number | null;
|
|
183
|
+
app: string | null;
|
|
184
|
+
bundle_id: string | null;
|
|
185
|
+
title: string | null;
|
|
186
|
+
url: string | null;
|
|
187
|
+
domain: string | null;
|
|
188
|
+
ocr_text: string | null;
|
|
189
|
+
inactive: boolean;
|
|
190
|
+
display_id: number | null;
|
|
191
|
+
focused: boolean;
|
|
192
|
+
ocr_boxes?: Array<{
|
|
193
|
+
text: string;
|
|
194
|
+
x: number;
|
|
195
|
+
y: number;
|
|
196
|
+
w: number;
|
|
197
|
+
h: number;
|
|
198
|
+
}> | null;
|
|
199
|
+
}
|
|
200
|
+
export interface CaptureAction {
|
|
201
|
+
action_id: string;
|
|
202
|
+
ts: string;
|
|
203
|
+
device_id: string;
|
|
204
|
+
chunk_id: string;
|
|
205
|
+
kind: string;
|
|
206
|
+
app: string | null;
|
|
207
|
+
window_title: string | null;
|
|
208
|
+
description: string | null;
|
|
209
|
+
target: Record<string, unknown> | null;
|
|
210
|
+
screenshot: string | null;
|
|
211
|
+
}
|
|
212
|
+
export interface CaptureAudioLine {
|
|
213
|
+
line_id: string;
|
|
214
|
+
ts: string;
|
|
215
|
+
end_at: string;
|
|
216
|
+
device_id: string;
|
|
217
|
+
chunk_id: string;
|
|
218
|
+
text: string;
|
|
219
|
+
}
|
|
220
|
+
export interface CaptureTimelineItems {
|
|
221
|
+
user_id: string;
|
|
222
|
+
from: string;
|
|
223
|
+
to: string;
|
|
224
|
+
frames: CaptureFrame[];
|
|
225
|
+
actions: CaptureAction[];
|
|
226
|
+
audio: CaptureAudioLine[];
|
|
227
|
+
}
|
|
228
|
+
export interface CaptureDaysQuery {
|
|
229
|
+
tz?: string;
|
|
230
|
+
userId?: string;
|
|
231
|
+
deviceId?: string;
|
|
232
|
+
}
|
|
233
|
+
export interface CaptureDay {
|
|
234
|
+
day: string;
|
|
235
|
+
start_at: string;
|
|
236
|
+
end_at: string;
|
|
237
|
+
screen_seconds: number;
|
|
238
|
+
}
|
|
239
|
+
export interface CaptureDays {
|
|
240
|
+
user_id: string;
|
|
241
|
+
tz: string;
|
|
242
|
+
days: CaptureDay[];
|
|
243
|
+
}
|
|
244
|
+
export type CaptureSearchKind = CaptureLayer;
|
|
245
|
+
export interface CaptureSearchQuery extends Omit<CaptureWindowQuery, 'day' | 'displayId'> {
|
|
246
|
+
q: string;
|
|
247
|
+
kinds?: CaptureSearchKind[];
|
|
248
|
+
app?: string;
|
|
249
|
+
limit?: number;
|
|
250
|
+
scope?: 'mine' | 'account';
|
|
251
|
+
}
|
|
252
|
+
export interface CaptureSearchHit {
|
|
253
|
+
kind: CaptureSearchKind;
|
|
254
|
+
id: string;
|
|
255
|
+
ts: string;
|
|
256
|
+
user_id: string;
|
|
257
|
+
device_id: string;
|
|
258
|
+
chunk_id: string;
|
|
259
|
+
app: string | null;
|
|
260
|
+
title: string | null;
|
|
261
|
+
url: string | null;
|
|
262
|
+
display_id: number | null;
|
|
263
|
+
display_name: string | null;
|
|
264
|
+
snippet: string;
|
|
265
|
+
}
|
|
266
|
+
export interface CaptureSearchResult {
|
|
267
|
+
user_id: string | null;
|
|
268
|
+
q: string;
|
|
269
|
+
hits: CaptureSearchHit[];
|
|
270
|
+
}
|
|
271
|
+
export interface CaptureSignedUrl {
|
|
272
|
+
url: string;
|
|
273
|
+
expires_at: string;
|
|
274
|
+
}
|
|
275
|
+
export interface CaptureMediaUrl extends CaptureSignedUrl {
|
|
276
|
+
encrypted: boolean;
|
|
277
|
+
}
|
|
278
|
+
export interface CaptureFrameDetail {
|
|
279
|
+
frame: CaptureFrame;
|
|
280
|
+
display?: CaptureDisplay | null;
|
|
281
|
+
video: (CaptureMediaUrl & {
|
|
282
|
+
offset_ms: number;
|
|
283
|
+
}) | null;
|
|
284
|
+
screenshot?: (CaptureMediaUrl & {
|
|
285
|
+
name: string;
|
|
286
|
+
ts: string;
|
|
287
|
+
}) | null;
|
|
288
|
+
}
|
|
289
|
+
export interface CaptureChunkMedia {
|
|
290
|
+
chunk_id: string;
|
|
291
|
+
kind: CaptureChunk['kind'];
|
|
292
|
+
video: CaptureMediaUrl | null;
|
|
293
|
+
audio: CaptureMediaUrl | null;
|
|
294
|
+
}
|
|
295
|
+
export interface CaptureDeviceGrant {
|
|
296
|
+
user_code: string;
|
|
297
|
+
status: 'pending' | 'approved' | 'denied' | 'consumed' | 'expired';
|
|
298
|
+
expires_at: string;
|
|
299
|
+
device: {
|
|
300
|
+
name: string | null;
|
|
301
|
+
os: string | null;
|
|
302
|
+
os_version: string | null;
|
|
303
|
+
arch: string | null;
|
|
304
|
+
app_version: string | null;
|
|
305
|
+
};
|
|
306
|
+
account_id: string | null;
|
|
307
|
+
device_id: string | null;
|
|
308
|
+
}
|
|
309
|
+
export interface CaptureDeviceGrantDetail extends CaptureDeviceGrant {
|
|
310
|
+
accounts: {
|
|
311
|
+
account_id: string;
|
|
312
|
+
name: string;
|
|
313
|
+
}[];
|
|
314
|
+
}
|
|
315
|
+
export interface CaptureWorkspace {
|
|
316
|
+
account_id: string;
|
|
317
|
+
enabled: boolean;
|
|
318
|
+
can_read_all: boolean;
|
|
319
|
+
can_manage: boolean;
|
|
320
|
+
updated_at: string | null;
|
|
321
|
+
}
|
|
322
|
+
export declare function listCaptureDevices(accountId: string, opts?: {
|
|
323
|
+
userId?: string;
|
|
324
|
+
scope?: 'mine' | 'account';
|
|
325
|
+
}): Promise<{
|
|
326
|
+
devices: CaptureDevice[];
|
|
327
|
+
health: CaptureHealthSummary;
|
|
328
|
+
}>;
|
|
329
|
+
export declare function revokeCaptureDevice(accountId: string, deviceId: string): Promise<CaptureDevice>;
|
|
330
|
+
export declare function linkCaptureDevice(accountId: string, deviceId: string, userId: string | null): Promise<CaptureDevice>;
|
|
331
|
+
export declare function listCaptureEnrollmentTokens(accountId: string): Promise<{
|
|
332
|
+
tokens: CaptureEnrollmentToken[];
|
|
333
|
+
}>;
|
|
334
|
+
export declare function createCaptureEnrollmentToken(accountId: string, input: CaptureEnrollmentTokenInput): Promise<CaptureEnrollmentTokenSecret>;
|
|
335
|
+
export declare function revokeCaptureEnrollmentToken(accountId: string, tokenId: string): Promise<CaptureEnrollmentToken>;
|
|
336
|
+
export declare function listCaptureEnrollments(accountId: string, opts?: {
|
|
337
|
+
status?: CaptureEnrollmentStatus;
|
|
338
|
+
}): Promise<{
|
|
339
|
+
enrollments: CaptureEnrollment[];
|
|
340
|
+
}>;
|
|
341
|
+
export declare function approveCaptureEnrollment(accountId: string, enrollmentId: string, userId?: string | null): Promise<CaptureEnrollment>;
|
|
342
|
+
export declare function denyCaptureEnrollment(accountId: string, enrollmentId: string): Promise<CaptureEnrollment>;
|
|
343
|
+
export declare function getCapturePolicy(accountId: string): Promise<CapturePolicyRecord>;
|
|
344
|
+
export declare function setCapturePolicy(accountId: string, policy: CapturePolicy): Promise<CapturePolicyRecord>;
|
|
345
|
+
export declare function getCaptureTimeline(accountId: string, query?: CaptureWindowQuery): Promise<CaptureTimeline>;
|
|
346
|
+
export declare function getCaptureTimelineItems(accountId: string, query?: CaptureWindowQuery): Promise<CaptureTimelineItems>;
|
|
347
|
+
export declare function getCaptureDays(accountId: string, query?: CaptureDaysQuery): Promise<CaptureDays>;
|
|
348
|
+
export declare function searchCapture(accountId: string, query: CaptureSearchQuery): Promise<CaptureSearchResult>;
|
|
349
|
+
export declare function getCaptureFrame(accountId: string, frameId: string, opts?: {
|
|
350
|
+
userId?: string;
|
|
351
|
+
}): Promise<CaptureFrameDetail>;
|
|
352
|
+
export declare function getCaptureChunkMedia(accountId: string, chunkId: string, opts?: {
|
|
353
|
+
userId?: string;
|
|
354
|
+
}): Promise<CaptureChunkMedia>;
|
|
355
|
+
export declare function getCaptureAssetUrl(accountId: string, deviceId: string, name: string): Promise<CaptureSignedUrl>;
|
|
356
|
+
export declare function getCaptureDeviceGrant(userCode: string): Promise<CaptureDeviceGrantDetail>;
|
|
357
|
+
export declare function approveCaptureDeviceGrant(userCode: string, accountId?: string): Promise<CaptureDeviceGrant>;
|
|
358
|
+
export declare function denyCaptureDeviceGrant(userCode: string): Promise<CaptureDeviceGrant>;
|
|
359
|
+
export declare function getCaptureWorkspace(accountId: string): Promise<CaptureWorkspace>;
|
|
360
|
+
export declare function setCaptureEnabled(accountId: string, enabled: boolean): Promise<CaptureWorkspace>;
|
|
361
|
+
export declare function searchMyCapture(query: CaptureSearchQuery): Promise<CaptureSearchResult>;
|
|
362
|
+
export declare function getMyCaptureTimeline(query?: Omit<CaptureWindowQuery, 'userId'>): Promise<CaptureTimeline>;
|
|
363
|
+
export declare function getMyCaptureFrame(frameId: string): Promise<CaptureFrameDetail>;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { backendApi } from '../../http/api-client.js';
|
|
2
|
+
import { unwrap } from '../projects-client/shared.js';
|
|
3
|
+
export * from '../../capture/rules.js';
|
|
4
|
+
export function captureHealthBucket(device) {
|
|
5
|
+
const { state, idle } = device.health;
|
|
6
|
+
if (state === 'healthy')
|
|
7
|
+
return idle ? 'idle' : 'recording';
|
|
8
|
+
return state;
|
|
9
|
+
}
|
|
10
|
+
const base = (accountId) => `/accounts/${accountId}/capture`;
|
|
11
|
+
function captureQuery(params) {
|
|
12
|
+
const search = new URLSearchParams();
|
|
13
|
+
for (const [key, value] of Object.entries(params)) {
|
|
14
|
+
if (value !== undefined && value !== '')
|
|
15
|
+
search.set(key, String(value));
|
|
16
|
+
}
|
|
17
|
+
const query = search.toString();
|
|
18
|
+
return query ? `?${query}` : '';
|
|
19
|
+
}
|
|
20
|
+
const searchParams = (query) => captureQuery({
|
|
21
|
+
q: query.q,
|
|
22
|
+
kinds: query.kinds?.join(','),
|
|
23
|
+
app: query.app,
|
|
24
|
+
limit: query.limit,
|
|
25
|
+
from: query.from,
|
|
26
|
+
to: query.to,
|
|
27
|
+
user_id: query.userId,
|
|
28
|
+
device_id: query.deviceId,
|
|
29
|
+
scope: query.scope,
|
|
30
|
+
});
|
|
31
|
+
const windowParams = (query = {}) => ({
|
|
32
|
+
day: query.day,
|
|
33
|
+
from: query.from,
|
|
34
|
+
to: query.to,
|
|
35
|
+
user_id: query.userId,
|
|
36
|
+
device_id: query.deviceId,
|
|
37
|
+
display_id: query.displayId,
|
|
38
|
+
});
|
|
39
|
+
export async function listCaptureDevices(accountId, opts = {}) {
|
|
40
|
+
return unwrap(await backendApi.get(`${base(accountId)}/devices${captureQuery({ user_id: opts.userId, scope: opts.scope })}`));
|
|
41
|
+
}
|
|
42
|
+
export async function revokeCaptureDevice(accountId, deviceId) {
|
|
43
|
+
return unwrap(await backendApi.delete(`${base(accountId)}/devices/${deviceId}`));
|
|
44
|
+
}
|
|
45
|
+
export async function linkCaptureDevice(accountId, deviceId, userId) {
|
|
46
|
+
return unwrap(await backendApi.put(`${base(accountId)}/devices/${deviceId}/link`, { user_id: userId }));
|
|
47
|
+
}
|
|
48
|
+
export async function listCaptureEnrollmentTokens(accountId) {
|
|
49
|
+
return unwrap(await backendApi.get(`${base(accountId)}/enrollment-tokens`));
|
|
50
|
+
}
|
|
51
|
+
export async function createCaptureEnrollmentToken(accountId, input) {
|
|
52
|
+
return unwrap(await backendApi.post(`${base(accountId)}/enrollment-tokens`, input));
|
|
53
|
+
}
|
|
54
|
+
export async function revokeCaptureEnrollmentToken(accountId, tokenId) {
|
|
55
|
+
return unwrap(await backendApi.delete(`${base(accountId)}/enrollment-tokens/${tokenId}`));
|
|
56
|
+
}
|
|
57
|
+
export async function listCaptureEnrollments(accountId, opts = {}) {
|
|
58
|
+
return unwrap(await backendApi.get(`${base(accountId)}/enrollments${captureQuery({ status: opts.status })}`));
|
|
59
|
+
}
|
|
60
|
+
export async function approveCaptureEnrollment(accountId, enrollmentId, userId) {
|
|
61
|
+
return unwrap(await backendApi.post(`${base(accountId)}/enrollments/${enrollmentId}/approve`, userId ? { user_id: userId } : {}));
|
|
62
|
+
}
|
|
63
|
+
export async function denyCaptureEnrollment(accountId, enrollmentId) {
|
|
64
|
+
return unwrap(await backendApi.post(`${base(accountId)}/enrollments/${enrollmentId}/deny`, {}));
|
|
65
|
+
}
|
|
66
|
+
export async function getCapturePolicy(accountId) {
|
|
67
|
+
return unwrap(await backendApi.get(`${base(accountId)}/policy`));
|
|
68
|
+
}
|
|
69
|
+
export async function setCapturePolicy(accountId, policy) {
|
|
70
|
+
return unwrap(await backendApi.put(`${base(accountId)}/policy`, { policy }));
|
|
71
|
+
}
|
|
72
|
+
export async function getCaptureTimeline(accountId, query = {}) {
|
|
73
|
+
return unwrap(await backendApi.get(`${base(accountId)}/timeline${captureQuery(windowParams(query))}`));
|
|
74
|
+
}
|
|
75
|
+
export async function getCaptureTimelineItems(accountId, query = {}) {
|
|
76
|
+
return unwrap(await backendApi.get(`${base(accountId)}/timeline/items${captureQuery(windowParams(query))}`));
|
|
77
|
+
}
|
|
78
|
+
export async function getCaptureDays(accountId, query = {}) {
|
|
79
|
+
return unwrap(await backendApi.get(`${base(accountId)}/days${captureQuery({ tz: query.tz, user_id: query.userId, device_id: query.deviceId })}`));
|
|
80
|
+
}
|
|
81
|
+
export async function searchCapture(accountId, query) {
|
|
82
|
+
return unwrap(await backendApi.get(`${base(accountId)}/search${searchParams(query)}`));
|
|
83
|
+
}
|
|
84
|
+
export async function getCaptureFrame(accountId, frameId, opts = {}) {
|
|
85
|
+
return unwrap(await backendApi.get(`${base(accountId)}/frames/${frameId}${captureQuery({ user_id: opts.userId })}`));
|
|
86
|
+
}
|
|
87
|
+
export async function getCaptureChunkMedia(accountId, chunkId, opts = {}) {
|
|
88
|
+
return unwrap(await backendApi.get(`${base(accountId)}/chunks/${chunkId}/media${captureQuery({ user_id: opts.userId })}`));
|
|
89
|
+
}
|
|
90
|
+
export async function getCaptureAssetUrl(accountId, deviceId, name) {
|
|
91
|
+
return unwrap(await backendApi.get(`${base(accountId)}/devices/${deviceId}/assets/${encodeURIComponent(name)}`));
|
|
92
|
+
}
|
|
93
|
+
export async function getCaptureDeviceGrant(userCode) {
|
|
94
|
+
return unwrap(await backendApi.get(`/capture/device/grants/${encodeURIComponent(userCode)}`));
|
|
95
|
+
}
|
|
96
|
+
export async function approveCaptureDeviceGrant(userCode, accountId) {
|
|
97
|
+
return unwrap(await backendApi.post(`/capture/device/grants/${encodeURIComponent(userCode)}/approve`, accountId ? { account_id: accountId } : {}));
|
|
98
|
+
}
|
|
99
|
+
export async function denyCaptureDeviceGrant(userCode) {
|
|
100
|
+
return unwrap(await backendApi.post(`/capture/device/grants/${encodeURIComponent(userCode)}/deny`, {}));
|
|
101
|
+
}
|
|
102
|
+
export async function getCaptureWorkspace(accountId) {
|
|
103
|
+
return unwrap(await backendApi.get(base(accountId)));
|
|
104
|
+
}
|
|
105
|
+
export async function setCaptureEnabled(accountId, enabled) {
|
|
106
|
+
return unwrap(await backendApi.patch(base(accountId), { enabled }));
|
|
107
|
+
}
|
|
108
|
+
export async function searchMyCapture(query) {
|
|
109
|
+
return unwrap(await backendApi.get(`/capture/me/search${searchParams(query)}`));
|
|
110
|
+
}
|
|
111
|
+
export async function getMyCaptureTimeline(query = {}) {
|
|
112
|
+
return unwrap(await backendApi.get(`/capture/me/timeline${captureQuery(windowParams(query))}`));
|
|
113
|
+
}
|
|
114
|
+
export async function getMyCaptureFrame(frameId) {
|
|
115
|
+
return unwrap(await backendApi.get(`/capture/me/frames/${frameId}`));
|
|
116
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AuthRequestOptions } from './auth.js';
|
|
2
|
+
export interface MobileClientPolicy {
|
|
3
|
+
minimum_version: string | null;
|
|
4
|
+
store_url_ios: string | null;
|
|
5
|
+
store_url_android: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function getMobileClientPolicy(opts?: AuthRequestOptions): Promise<MobileClientPolicy>;
|
|
8
|
+
export declare function compareSemver(a: string, b: string): -1 | 0 | 1 | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ApiError } from '../../http/api/errors.js';
|
|
2
|
+
import { platformConfig } from '../../http/config.js';
|
|
3
|
+
import { platformApiBase } from './shared.js';
|
|
4
|
+
export async function getMobileClientPolicy(opts) {
|
|
5
|
+
const fetchImpl = opts?.fetch ?? platformConfig().fetch ?? ((input, init) => fetch(input, init));
|
|
6
|
+
const backendUrl = opts?.backendUrl ?? platformConfig().backendUrl;
|
|
7
|
+
const res = await fetchImpl(`${platformApiBase(backendUrl)}/clients/mobile`, {
|
|
8
|
+
headers: { accept: 'application/json' },
|
|
9
|
+
...(opts?.signal ? { signal: opts.signal } : {}),
|
|
10
|
+
});
|
|
11
|
+
if (!res.ok) {
|
|
12
|
+
throw new ApiError(`Mobile client policy request failed (HTTP ${res.status})`, { status: res.status, response: res });
|
|
13
|
+
}
|
|
14
|
+
return (await res.json());
|
|
15
|
+
}
|
|
16
|
+
const SEMVER = /^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:[-+].*)?$/i;
|
|
17
|
+
export function compareSemver(a, b) {
|
|
18
|
+
const parts = (v) => {
|
|
19
|
+
const m = SEMVER.exec(v.trim());
|
|
20
|
+
return m ? [Number(m[1]), Number(m[2] ?? 0), Number(m[3] ?? 0)] : null;
|
|
21
|
+
};
|
|
22
|
+
const pa = parts(a);
|
|
23
|
+
const pb = parts(b);
|
|
24
|
+
if (!pa || !pb)
|
|
25
|
+
return null;
|
|
26
|
+
for (let i = 0; i < 3; i++)
|
|
27
|
+
if (pa[i] !== pb[i])
|
|
28
|
+
return pa[i] < pb[i] ? -1 : 1;
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
@@ -5,8 +5,8 @@ export * from './members.js';
|
|
|
5
5
|
export * from './invites.js';
|
|
6
6
|
export * from './backups.js';
|
|
7
7
|
export * from './ssh.js';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export * from './host-boundary.js';
|
|
8
|
+
export { getLatestSandboxVersion, getFullChangelog, getAllVersions, type ChangelogChange, type ChangelogArtifact, type ChangelogEntry, type VersionChannel, type VersionEntry, type AllVersionsResponse, type SandboxVersionInfo, } from './updates.js';
|
|
9
|
+
export { HostBoundaryError, listPublicMarketplaceItems, listPublicMarketplaces, getPublicMarketplaceItem, getPublicMarketplaceItemFile, checkAccessEmail, submitAccessRequest, recordPlatformLogout, getOAuthConsentRequest, submitOAuthConsent, getConnectorSetupLink, startConnectorSetupLink, finalizeConnectorSetupLink, getSecretSetupLink, submitSecretSetupLink, getPublicShareByToken, startSessionWithToken, submitDemoRequest, downloadAccountAudit, buildPublicTemplateUrl, getPublicTemplate, type HostRequestOptions, type PublicMarketplaceQuery, type OAuthConsentRequest, type ConnectorSetupLinkInfo, type ConnectorSetupLinkStart, type ConnectorSetupLinkFinalize, type FinalizeConnectorSetupLinkInput, type SecretSetupLinkInfo, type SecretWithheldReason, type SecretSetupLinkWithheld, type SecretSetupLinkSubmitResult, type AccountAuditExport, } from './host-boundary.js';
|
|
11
10
|
export * from './connector-setup.js';
|
|
12
|
-
export * from './
|
|
11
|
+
export * from './client-policy.js';
|
|
12
|
+
export * from './capture.js';
|
|
@@ -5,8 +5,8 @@ export * from './members.js';
|
|
|
5
5
|
export * from './invites.js';
|
|
6
6
|
export * from './backups.js';
|
|
7
7
|
export * from './ssh.js';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export * from './host-boundary.js';
|
|
8
|
+
export { getLatestSandboxVersion, getFullChangelog, getAllVersions, } from './updates.js';
|
|
9
|
+
export { HostBoundaryError, listPublicMarketplaceItems, listPublicMarketplaces, getPublicMarketplaceItem, getPublicMarketplaceItemFile, checkAccessEmail, submitAccessRequest, recordPlatformLogout, getOAuthConsentRequest, submitOAuthConsent, getConnectorSetupLink, startConnectorSetupLink, finalizeConnectorSetupLink, getSecretSetupLink, submitSecretSetupLink, getPublicShareByToken, startSessionWithToken, submitDemoRequest, downloadAccountAudit, buildPublicTemplateUrl, getPublicTemplate, } from './host-boundary.js';
|
|
11
10
|
export * from './connector-setup.js';
|
|
12
|
-
export * from './
|
|
11
|
+
export * from './client-policy.js';
|
|
12
|
+
export * from './capture.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createProjectSession, startProjectSession, listProjects, restartProjectSession, stopProjectSession, } from '../projects-client/index.js';
|
|
1
|
+
import { createProjectSession, getProject, startProjectSession, listProjects, restartProjectSession, stopProjectSession, } from '../projects-client/index.js';
|
|
2
2
|
import { backendApi } from '../../http/api-client.js';
|
|
3
|
-
import { findProjectSessionSandbox, listProjectSessionSandboxes, projectSessionToSandboxInfo, normalizeSandboxId, } from './shared.js';
|
|
3
|
+
import { findProjectSessionSandbox, getSessionById, listProjectSessionSandboxes, projectSessionToSandboxInfo, normalizeSandboxId, resolveProjectSessionId, } from './shared.js';
|
|
4
4
|
export async function getProviders() {
|
|
5
5
|
const response = await backendApi.get('/setup/sandbox-providers');
|
|
6
6
|
if (response.error)
|
|
@@ -34,12 +34,18 @@ export async function getSandboxById(sandboxId) {
|
|
|
34
34
|
const normalizedSandboxId = normalizeSandboxId(sandboxId);
|
|
35
35
|
if (!normalizedSandboxId)
|
|
36
36
|
return null;
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
try {
|
|
38
|
+
const session = await getSessionById(normalizedSandboxId);
|
|
39
|
+
if (!session)
|
|
40
|
+
return (await findProjectSessionSandbox(normalizedSandboxId))?.sandbox ?? null;
|
|
41
|
+
return projectSessionToSandboxInfo(await getProject(session.project_id), session, null);
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
39
46
|
}
|
|
40
47
|
export async function renameSandbox(sandboxId, _name) {
|
|
41
|
-
|
|
42
|
-
if (!row)
|
|
48
|
+
if (!(await resolveProjectSessionId(sandboxId)))
|
|
43
49
|
throw new Error('Project session sandbox not found');
|
|
44
50
|
throw new Error('Renaming project-session sandboxes is not exposed by the current API');
|
|
45
51
|
}
|
|
@@ -59,18 +65,18 @@ export async function restartSandbox(sandboxId) {
|
|
|
59
65
|
if (!sandboxId) {
|
|
60
66
|
throw new Error('No sandbox selected for workload restart');
|
|
61
67
|
}
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
68
|
+
const target = await resolveProjectSessionId(sandboxId);
|
|
69
|
+
if (!target)
|
|
64
70
|
throw new Error('Project session sandbox not found');
|
|
65
|
-
await restartProjectSession(
|
|
71
|
+
await restartProjectSession(target.projectId, target.sessionId);
|
|
66
72
|
}
|
|
67
73
|
export async function stopSandbox(sandboxId) {
|
|
68
74
|
if (!sandboxId)
|
|
69
75
|
throw new Error('No sandbox selected to stop');
|
|
70
|
-
const
|
|
71
|
-
if (!
|
|
76
|
+
const target = await resolveProjectSessionId(sandboxId);
|
|
77
|
+
if (!target)
|
|
72
78
|
throw new Error('Project session sandbox not found');
|
|
73
|
-
await stopProjectSession(
|
|
79
|
+
await stopProjectSession(target.projectId, target.sessionId);
|
|
74
80
|
}
|
|
75
81
|
export async function cancelSandbox(sandboxId) {
|
|
76
82
|
throw new Error('Cancellation is not exposed for project-session sandboxes');
|
|
@@ -10,6 +10,11 @@ export declare function listProjectSessionSandboxes(): Promise<Array<{
|
|
|
10
10
|
runtime: ProjectSessionSandbox | null;
|
|
11
11
|
sandbox: SandboxInfo;
|
|
12
12
|
}>>;
|
|
13
|
+
export declare function getSessionById(sessionId: string): Promise<ProjectSession | null>;
|
|
14
|
+
export declare function resolveProjectSessionId(id: string): Promise<{
|
|
15
|
+
projectId: string;
|
|
16
|
+
sessionId: string;
|
|
17
|
+
} | null>;
|
|
13
18
|
export declare function findProjectSessionSandbox(sandboxId?: string): Promise<{
|
|
14
19
|
project: BeeuniProject;
|
|
15
20
|
session: ProjectSession;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { backendApi } from '../../http/api-client.js';
|
|
1
2
|
import { platformConfig } from '../../http/config.js';
|
|
2
3
|
import { safeEnv } from '../../http/env.js';
|
|
3
4
|
import { stripTrailingSlashes } from '../../../platform/strings.js';
|
|
@@ -88,6 +89,23 @@ export async function listProjectSessionSandboxes() {
|
|
|
88
89
|
return Date.parse(b.sandbox.updated_at) - Date.parse(a.sandbox.updated_at);
|
|
89
90
|
});
|
|
90
91
|
}
|
|
92
|
+
export async function getSessionById(sessionId) {
|
|
93
|
+
const response = await backendApi.get(`/sessions/${encodeURIComponent(sessionId)}`, {
|
|
94
|
+
showErrors: false,
|
|
95
|
+
});
|
|
96
|
+
if (response.success && response.data)
|
|
97
|
+
return response.data;
|
|
98
|
+
if (response.error?.status === 400 || response.error?.status === 404)
|
|
99
|
+
return null;
|
|
100
|
+
throw response.error ?? new Error('Session request failed');
|
|
101
|
+
}
|
|
102
|
+
export async function resolveProjectSessionId(id) {
|
|
103
|
+
const session = await getSessionById(id);
|
|
104
|
+
if (session)
|
|
105
|
+
return { projectId: session.project_id, sessionId: session.session_id };
|
|
106
|
+
const row = await findProjectSessionSandbox(id);
|
|
107
|
+
return row ? { projectId: row.project.project_id, sessionId: row.session.session_id } : null;
|
|
108
|
+
}
|
|
91
109
|
export async function findProjectSessionSandbox(sandboxId) {
|
|
92
110
|
const rows = await listProjectSessionSandboxes();
|
|
93
111
|
if (!sandboxId)
|
|
@@ -8,7 +8,7 @@ export declare const SANDBOX_PORTS: {
|
|
|
8
8
|
readonly BROWSER_VIEWER: "9224";
|
|
9
9
|
readonly SSH: "22";
|
|
10
10
|
};
|
|
11
|
-
export type SandboxProviderName =
|
|
11
|
+
export type SandboxProviderName = string;
|
|
12
12
|
export type ServerTypeOption = string;
|
|
13
13
|
export interface SandboxCreateProgress {
|
|
14
14
|
status: 'pulling';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SecretConsumer, SecretDeliveryStrategy } from './secrets.js';
|
|
1
|
+
import type { SecretConsumer, SecretDeliveryStrategy, SecretValueStatus } from './secrets.js';
|
|
2
2
|
export interface AccountSecretResource {
|
|
3
3
|
secret_id: string;
|
|
4
4
|
account_id: string;
|
|
@@ -17,6 +17,7 @@ export interface AccountSecretResource {
|
|
|
17
17
|
updated_at: string;
|
|
18
18
|
granted_user_ids: string[];
|
|
19
19
|
can_use: boolean;
|
|
20
|
+
status?: SecretValueStatus;
|
|
20
21
|
}
|
|
21
22
|
export interface CreateAccountSecretResourceInput {
|
|
22
23
|
project_id?: string;
|