@robota-sdk/agent-cli 3.0.0-beta.95 → 3.0.0-beta.96

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.
@@ -0,0 +1,145 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta
6
+ http-equiv="Content-Security-Policy"
7
+ content="default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; media-src data:; font-src data:; connect-src 'none'; frame-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'"
8
+ />
9
+ <meta name="color-scheme" content="light dark" />
10
+ <title>App sandbox</title>
11
+ <style>
12
+ html,
13
+ body {
14
+ margin: 0;
15
+ height: 100%;
16
+ background: transparent;
17
+ }
18
+ body {
19
+ display: flex;
20
+ flex-direction: column;
21
+ font:
22
+ 13px/1.4 system-ui,
23
+ sans-serif;
24
+ }
25
+ p {
26
+ margin: 8px;
27
+ }
28
+ iframe {
29
+ flex: 1 1 auto;
30
+ width: 100%;
31
+ border: 0;
32
+ background: transparent;
33
+ color-scheme: inherit;
34
+ }
35
+ </style>
36
+ </head>
37
+ <body>
38
+ <script>
39
+ (function () {
40
+ 'use strict';
41
+
42
+ var PROXY_READY = 'ui/notifications/sandbox-proxy-ready';
43
+ var RESOURCE_READY = 'ui/notifications/sandbox-resource-ready';
44
+ var SANDBOX_PREFIX = 'ui/notifications/sandbox-';
45
+
46
+ function refuse(text) {
47
+ var line = document.createElement('p');
48
+ line.textContent = text;
49
+ document.body.appendChild(line);
50
+ }
51
+
52
+ function readable(other) {
53
+ try {
54
+ return Boolean(other.document);
55
+ } catch (error) {
56
+ return false;
57
+ }
58
+ }
59
+
60
+ if (window.self === window.top) {
61
+ refuse('This page only runs inside an app frame.');
62
+ return;
63
+ }
64
+ if (readable(window.top) || readable(window.parent)) {
65
+ refuse('This page must run in a sandboxed frame.');
66
+ return;
67
+ }
68
+
69
+ function hasNativeNetworkIsolation() {
70
+ // Chromium 157 includes builds before the nested WebRTC fix; require 158 conservatively.
71
+ // https://issues.chromium.org/issues/565837691
72
+ // https://chromium-review.googlesource.com/c/chromium/src/+/8485457
73
+ var chromium = /\b(?:Chrome|Chromium|HeadlessChrome)\/(\d+)\./.exec(navigator.userAgent);
74
+ if (!chromium || Number(chromium[1]) < 158) return false;
75
+ var connection;
76
+ var isolated = false;
77
+ try {
78
+ connection = new window.RTCPeerConnection({
79
+ iceServers: [{ urls: 'stun:127.0.0.1:9' }],
80
+ });
81
+ var servers = connection.getConfiguration().iceServers;
82
+ isolated = Array.isArray(servers) && servers.length === 0;
83
+ } catch (error) {
84
+ isolated = false;
85
+ }
86
+ if (connection) {
87
+ try {
88
+ connection.close();
89
+ } catch (error) {
90
+ isolated = false;
91
+ }
92
+ }
93
+ return isolated;
94
+ }
95
+
96
+ if (!hasNativeNetworkIsolation()) {
97
+ refuse(
98
+ 'App views are unavailable because this browser cannot enforce their network isolation.',
99
+ );
100
+ return;
101
+ }
102
+
103
+ var host = window.parent;
104
+ var inner = null;
105
+
106
+ function methodOf(data) {
107
+ return data !== null && typeof data === 'object' && typeof data.method === 'string'
108
+ ? data.method
109
+ : '';
110
+ }
111
+
112
+ function showDocument(html) {
113
+ if (inner !== null || typeof html !== 'string') return;
114
+ inner = document.createElement('iframe');
115
+ inner.setAttribute('sandbox', 'allow-scripts');
116
+ inner.setAttribute('title', 'App');
117
+ inner.srcdoc = html;
118
+ document.body.appendChild(inner);
119
+ }
120
+
121
+ // Who sent a message is decided by `event.source`, which no other window can forge. Both
122
+ // peers have an opaque origin, so there is no origin to compare and the target is '*'.
123
+ window.addEventListener('message', function (event) {
124
+ var data = event.data;
125
+ var method = methodOf(data);
126
+ if (event.source === host) {
127
+ if (method === RESOURCE_READY) {
128
+ showDocument(data.params && data.params.html);
129
+ return;
130
+ }
131
+ if (method.indexOf(SANDBOX_PREFIX) === 0) return;
132
+ if (inner !== null && inner.contentWindow) inner.contentWindow.postMessage(data, '*');
133
+ return;
134
+ }
135
+ if (inner !== null && event.source !== null && event.source === inner.contentWindow) {
136
+ if (method.indexOf(SANDBOX_PREFIX) === 0) return;
137
+ host.postMessage(data, '*');
138
+ }
139
+ });
140
+
141
+ host.postMessage({ jsonrpc: '2.0', method: PROXY_READY, params: {} }, '*');
142
+ })();
143
+ </script>
144
+ </body>
145
+ </html>