apps 0.0.1-beta.2 → 0.0.1-beta.21
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 +68 -44
- package/framework-reference.json +1 -1
- package/js/{chunk-SATWJKN6.js → chunk-27F7W2LG.js} +1 -1
- package/js/{chunk-WFSQXYUT.js → chunk-4QQ62BVS.js} +37 -3
- package/js/{chunk-HDJH3RPR.js → chunk-57RKNWL2.js} +2 -2
- package/js/chunk-625MBYU4.js +524 -0
- package/js/{chunk-RN2MXB4R.js → chunk-BLI53LPN.js} +28 -9
- package/js/{chunk-FW5HBOIK.js → chunk-CDL5PM2Q.js} +307 -169
- package/js/{chunk-J7O55ZV7.js → chunk-CHAK4P5C.js} +317 -176
- package/js/{chunk-HDTGZWP2.js → chunk-CMRKLZZY.js} +8 -8
- package/js/{chunk-OHRT55C4.js → chunk-IJX4CYZO.js} +3 -6
- package/js/{chunk-FDNTX5QJ.js → chunk-IPI4MFSN.js} +2 -2
- package/js/{chunk-YEJOQEII.js → chunk-JU7VHODU.js} +1 -1
- package/js/chunk-KUMBKVJD.js +39 -0
- package/js/{chunk-EVJUVWN2.js → chunk-M3B3DE4K.js} +2 -2
- package/js/{chunk-ZJWDMTE3.js → chunk-MKWZPDR6.js} +3 -3
- package/js/{chunk-BMOIAIVR.js → chunk-N7YDVXYJ.js} +49 -1
- package/js/{chunk-D47C7KG5.js → chunk-NKLWZJLE.js} +2 -2
- package/js/chunk-NMKHTJOQ.js +254 -0
- package/js/chunk-OD3KFKZD.js +1617 -0
- package/js/{chunk-ZCAMUXSG.js → chunk-ODEIDRGW.js} +3 -4
- package/js/{chunk-5MQZEB6Y.js → chunk-OZ4UK3CD.js} +37 -12
- package/js/{chunk-M6ZRRIBI.js → chunk-PJJ24GU7.js} +1 -1
- package/js/{chunk-FZJOYIZO.js → chunk-PZB6T6KU.js} +1 -1
- package/js/{chunk-LGIYBDWA.js → chunk-R3EV5FTO.js} +13 -1
- package/js/{chunk-Z5NMEGJN.js → chunk-RAAPJMVZ.js} +21 -9
- package/js/{chunk-QKHR7BMF.js → chunk-UK573G7W.js} +1 -1
- package/js/{chunk-4LPG6RCH.js → chunk-VFZKSM3T.js} +5 -25
- package/js/{chunk-MYYEW3RA.js → chunk-VXWY44LE.js} +780 -55
- package/js/{chunk-JN55AYQH.js → chunk-XNCYIB4D.js} +61 -32
- package/js/{chunk-PLCMJREA.js → chunk-ZQINWV4W.js} +60 -20
- package/js/client.js +10 -26
- package/js/contracts.js +74 -16
- package/js/effect.js +19 -20
- package/js/{es-APDZKREY.js → es-DIULA3ZF.js} +62 -1659
- package/js/graphql.js +47 -49
- package/js/host.js +19 -20
- package/js/index.js +232 -201
- package/js/mcp/effect.js +21 -22
- package/js/mcp/stdio.js +25 -26
- package/js/mcp.js +74 -56
- package/js/openapi.js +3428 -1276
- package/js/react.js +3 -3
- package/js/skills/effect.js +3 -3
- package/js/skills.js +12 -13
- package/js/storage/facet.js +4 -4
- package/js/ui/auth/contracts.js +8 -9
- package/js/ui/auth.js +16 -14
- package/js/ui/contracts.js +4 -4
- package/js/ui/serving.js +71 -218
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/app-data/src/contracts/database.d.ts +33 -6
- package/types/app-data/src/implementation/schema.d.ts +2 -17
- package/types/apps/src/contracts/app.d.ts +7 -6
- package/types/apps/src/contracts/failure.d.ts +25 -0
- package/types/apps/src/contracts/host.d.ts +31 -10
- package/types/apps/src/contracts/mcp.d.ts +16 -0
- package/types/apps/src/contracts/openapi.d.ts +5 -1
- package/types/apps/src/contracts/operations.d.ts +0 -5
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/1.d.ts +235 -67
- package/types/apps/src/contracts/protocols/2.d.ts +710 -0
- package/types/apps/src/contracts/protocols/3.d.ts +718 -0
- package/types/apps/src/contracts/protocols/4.d.ts +1299 -0
- package/types/apps/src/contracts/protocols/5.d.ts +1174 -0
- package/types/apps/src/contracts/protocols/6.d.ts +1620 -0
- package/types/apps/src/contracts/protocols/7.d.ts +1784 -0
- package/types/apps/src/contracts/protocols/oauth.d.ts +89 -0
- package/types/apps/src/contracts/provider.d.ts +109 -10
- package/types/apps/src/contracts/router.d.ts +59 -0
- package/types/apps/src/contracts/storage.d.ts +3 -3
- package/types/apps/src/contracts/ui-auth.d.ts +6 -14
- package/types/apps/src/contracts/ui.d.ts +18 -0
- package/types/apps/src/contracts/workflows.d.ts +34 -3
- package/types/apps/src/graphql.d.ts +1 -3
- package/types/apps/src/implementation/account-router.d.ts +12 -0
- package/types/apps/src/implementation/app.d.ts +5 -4
- package/types/apps/src/implementation/browser-scripts.gen.d.ts +6 -0
- package/types/apps/src/implementation/catalog-cache.d.ts +34 -4
- package/types/apps/src/implementation/elicitation.d.ts +2 -2
- package/types/apps/src/implementation/failure-detail.d.ts +26 -0
- package/types/apps/src/implementation/graphql-catalog.d.ts +4 -7
- package/types/apps/src/implementation/mcp-catalog.d.ts +7 -8
- package/types/apps/src/implementation/mcp-client.d.ts +35 -19
- package/types/apps/src/implementation/mcp.d.ts +35 -19
- package/types/apps/src/implementation/openapi-compile.d.ts +9 -5
- package/types/apps/src/implementation/openapi-document.d.ts +15 -2
- package/types/apps/src/implementation/openapi-request.d.ts +8 -1
- package/types/apps/src/implementation/openapi-source.d.ts +2 -6
- package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
- package/types/apps/src/implementation/operations.d.ts +36 -3
- package/types/apps/src/implementation/protocol-operations.d.ts +3 -4
- package/types/apps/src/implementation/provider.d.ts +19 -5
- package/types/apps/src/implementation/router-catalog.d.ts +225 -0
- package/types/apps/src/implementation/router.d.ts +68 -0
- package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
- package/types/apps/src/implementation/schema.d.ts +44 -1
- package/types/apps/src/implementation/storage.d.ts +5 -3
- package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
- package/types/apps/src/implementation/ui-auth.d.ts +11 -5
- package/types/apps/src/implementation/ui-errors.d.ts +1 -1
- package/types/apps/src/implementation/ui-serving.d.ts +10 -4
- package/types/apps/src/implementation/ui-watch.d.ts +1 -1
- package/types/apps/src/implementation/webhooks.d.ts +1 -1
- package/types/apps/src/implementation/workflow-context.d.ts +11 -3
- package/types/apps/src/index.d.ts +28 -11
- package/types/apps/src/mcp-stdio.d.ts +2 -5
- package/types/apps/src/mcp.d.ts +5 -4
- package/types/apps/src/openapi.d.ts +6 -6
- package/types/apps/src/ui-auth.d.ts +2 -2
- package/types/telemetry/src/browser-operations.d.ts +5 -2
- package/js/chunk-PYUYJRSK.js +0 -93
- package/js/chunk-SWPD52J7.js +0 -35
- package/js/chunk-TE4KO4HI.js +0 -47
- package/js/chunk-W7D7WVSY.js +0 -18
- package/types/apps/src/contracts/dynamic-tools.d.ts +0 -13
- package/types/apps/src/implementation/account-operations.d.ts +0 -151
- package/types/apps/src/implementation/dynamic-tools.d.ts +0 -8
package/js/react.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
AsyncResult_exports,
|
|
3
3
|
AtomRegistry_exports,
|
|
4
4
|
queryCommitted
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-M3B3DE4K.js";
|
|
6
|
+
import "./chunk-PJJ24GU7.js";
|
|
7
7
|
import {
|
|
8
8
|
Option_exports
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CDL5PM2Q.js";
|
|
10
10
|
import "./chunk-CZ7CSFO4.js";
|
|
11
11
|
|
|
12
12
|
// src/react.ts
|
package/js/skills/effect.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
folderSkillsEffect,
|
|
3
3
|
skillFromFiles
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-IPI4MFSN.js";
|
|
5
|
+
import "../chunk-JU7VHODU.js";
|
|
6
|
+
import "../chunk-CDL5PM2Q.js";
|
|
7
7
|
import "../chunk-CZ7CSFO4.js";
|
|
8
8
|
export {
|
|
9
9
|
folderSkillsEffect,
|
package/js/skills.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
catalogCache
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-OZ4UK3CD.js";
|
|
4
|
+
import "./chunk-NKLWZJLE.js";
|
|
5
5
|
import {
|
|
6
6
|
folderSkillsEffect,
|
|
7
7
|
skillFromFiles
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IPI4MFSN.js";
|
|
9
9
|
import {
|
|
10
10
|
httpProviderError
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-MKWZPDR6.js";
|
|
12
|
+
import "./chunk-R3EV5FTO.js";
|
|
13
13
|
import {
|
|
14
14
|
AppSkillMetadata,
|
|
15
15
|
AppSkillSource,
|
|
@@ -19,25 +19,24 @@ import {
|
|
|
19
19
|
SkillLoadFailed,
|
|
20
20
|
SkillServiceName,
|
|
21
21
|
skillLoadLimits
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-W7D7WVSY.js";
|
|
22
|
+
} from "./chunk-JU7VHODU.js";
|
|
24
23
|
import {
|
|
25
24
|
FetchHttpClient_exports
|
|
26
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-57RKNWL2.js";
|
|
27
26
|
import {
|
|
28
27
|
HttpBody_exports,
|
|
29
28
|
HttpClient_exports
|
|
30
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-UK573G7W.js";
|
|
31
30
|
import {
|
|
32
31
|
wrap
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
32
|
+
} from "./chunk-4QQ62BVS.js";
|
|
33
|
+
import "./chunk-27F7W2LG.js";
|
|
35
34
|
import {
|
|
36
35
|
Effect_exports,
|
|
37
36
|
Ref_exports,
|
|
38
37
|
Schema_exports,
|
|
39
38
|
Stream_exports
|
|
40
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-CDL5PM2Q.js";
|
|
41
40
|
import "./chunk-CZ7CSFO4.js";
|
|
42
41
|
|
|
43
42
|
// src/implementation/inflate.ts
|
|
@@ -759,7 +758,7 @@ var cachedCatalog = (options, prefix, load) => options.cache === void 0 ? load(o
|
|
|
759
758
|
prefix,
|
|
760
759
|
schema: AppSkillSource,
|
|
761
760
|
summary: { schema: AppSkillMetadata, of: ({ files: _files, ...metadata }) => metadata },
|
|
762
|
-
load: (context) => context === void 0 ? load(options, options.cache) : load({ fetch: options.fetch, signal: context.signal }, context.cache)
|
|
761
|
+
load: (context) => (context === void 0 ? load(options, options.cache) : load({ fetch: options.fetch, signal: context.signal }, context.cache)).pipe(Effect_exports.map((tools) => ({ tools })))
|
|
763
762
|
}).pipe(
|
|
764
763
|
Effect_exports.flatMap((catalog) => catalog.list()),
|
|
765
764
|
Effect_exports.mapError(
|
package/js/storage/facet.js
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
layer,
|
|
5
5
|
make as make3,
|
|
6
6
|
makeCompilerSqlite
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-PJJ24GU7.js";
|
|
8
8
|
import {
|
|
9
9
|
makeSqliteDatabase
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-ZQINWV4W.js";
|
|
11
|
+
import "../chunk-N7YDVXYJ.js";
|
|
12
12
|
import {
|
|
13
13
|
Defect,
|
|
14
14
|
Effect_exports,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
uninterruptibleMask,
|
|
58
58
|
void_,
|
|
59
59
|
withFiber
|
|
60
|
-
} from "../chunk-
|
|
60
|
+
} from "../chunk-CDL5PM2Q.js";
|
|
61
61
|
import "../chunk-CZ7CSFO4.js";
|
|
62
62
|
|
|
63
63
|
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/sql/SqlError.js
|
package/js/ui/auth/contracts.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AppReturnPath,
|
|
3
|
-
AppSignInApi,
|
|
4
3
|
AppSignInCallback,
|
|
5
4
|
AppSignInCode,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-FW5HBOIK.js";
|
|
5
|
+
AppSignInFailure,
|
|
6
|
+
AppSignInId,
|
|
7
|
+
appSignInCallbackPath
|
|
8
|
+
} from "../../chunk-VFZKSM3T.js";
|
|
9
|
+
import "../../chunk-CDL5PM2Q.js";
|
|
12
10
|
import "../../chunk-CZ7CSFO4.js";
|
|
13
11
|
export {
|
|
14
12
|
AppReturnPath,
|
|
15
|
-
AppSignInApi,
|
|
16
13
|
AppSignInCallback,
|
|
17
14
|
AppSignInCode,
|
|
18
|
-
|
|
15
|
+
AppSignInFailure,
|
|
16
|
+
AppSignInId,
|
|
17
|
+
appSignInCallbackPath
|
|
19
18
|
};
|
package/js/ui/auth.js
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
appPrivateHeaders,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
appRedirect,
|
|
4
|
+
appSignInCallback,
|
|
5
|
+
appSignInFailed
|
|
6
|
+
} from "../chunk-KUMBKVJD.js";
|
|
6
7
|
import {
|
|
7
8
|
AppReturnPath,
|
|
8
|
-
AppSignInApi,
|
|
9
9
|
AppSignInCallback,
|
|
10
10
|
AppSignInCode,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
11
|
+
AppSignInFailure,
|
|
12
|
+
AppSignInId,
|
|
13
|
+
appSignInCallbackPath
|
|
14
|
+
} from "../chunk-VFZKSM3T.js";
|
|
15
|
+
import "../chunk-57RKNWL2.js";
|
|
16
|
+
import "../chunk-UK573G7W.js";
|
|
17
|
+
import "../chunk-CDL5PM2Q.js";
|
|
18
18
|
import "../chunk-CZ7CSFO4.js";
|
|
19
19
|
export {
|
|
20
20
|
AppReturnPath,
|
|
21
|
-
AppSignInApi,
|
|
22
21
|
AppSignInCallback,
|
|
23
22
|
AppSignInCode,
|
|
23
|
+
AppSignInFailure,
|
|
24
24
|
AppSignInId,
|
|
25
25
|
appPrivateHeaders,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
appRedirect,
|
|
27
|
+
appSignInCallback,
|
|
28
|
+
appSignInCallbackPath,
|
|
29
|
+
appSignInFailed
|
|
28
30
|
};
|
package/js/ui/contracts.js
CHANGED
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
UiOperation,
|
|
8
8
|
UiSnapshot,
|
|
9
9
|
UiUnauthorized
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-IJX4CYZO.js";
|
|
11
|
+
import "../chunk-UK573G7W.js";
|
|
12
|
+
import "../chunk-27F7W2LG.js";
|
|
13
|
+
import "../chunk-CDL5PM2Q.js";
|
|
14
14
|
import "../chunk-CZ7CSFO4.js";
|
|
15
15
|
export {
|
|
16
16
|
AppUiApi,
|
package/js/ui/serving.js
CHANGED
|
@@ -1,203 +1,76 @@
|
|
|
1
1
|
import {
|
|
2
2
|
appPrivateHeaders
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-KUMBKVJD.js";
|
|
4
|
+
import "../chunk-VFZKSM3T.js";
|
|
4
5
|
import {
|
|
5
6
|
UiForbidden
|
|
6
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-IJX4CYZO.js";
|
|
7
8
|
import {
|
|
8
9
|
CurrentTelemetryConfig
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-ODEIDRGW.js";
|
|
11
|
+
import "../chunk-57RKNWL2.js";
|
|
11
12
|
import {
|
|
12
13
|
HttpServerRequest_exports,
|
|
13
14
|
HttpServerResponse_exports
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import "../chunk-
|
|
15
|
+
} from "../chunk-UK573G7W.js";
|
|
16
|
+
import "../chunk-27F7W2LG.js";
|
|
16
17
|
import {
|
|
17
18
|
Effect_exports
|
|
18
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-CDL5PM2Q.js";
|
|
19
20
|
import "../chunk-CZ7CSFO4.js";
|
|
20
21
|
|
|
21
|
-
// src/implementation/
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const recent = /* @__PURE__ */ new Map();
|
|
26
|
-
const extension = /^(?:chrome|moz|safari-web)-extension:/;
|
|
27
|
-
const errorTypes = /* @__PURE__ */ new Set([
|
|
28
|
-
"Error",
|
|
29
|
-
"TypeError",
|
|
30
|
-
"ReferenceError",
|
|
31
|
-
"SyntaxError",
|
|
32
|
-
"RangeError",
|
|
33
|
-
"URIError",
|
|
34
|
-
"EvalError",
|
|
35
|
-
"AggregateError"
|
|
36
|
-
]);
|
|
37
|
-
const sourceAttributes = (filename, line = 0, column = 0) => {
|
|
38
|
-
const attributes = [];
|
|
39
|
-
if (!URL.canParse(filename)) return attributes;
|
|
40
|
-
const url = new URL(filename);
|
|
41
|
-
if (url.origin !== location.origin || !url.pathname.startsWith("/_executor/assets/") || !url.pathname.endsWith(".js"))
|
|
42
|
-
return attributes;
|
|
43
|
-
attributes.push({ key: "code.file.path", value: { stringValue: url.pathname } });
|
|
44
|
-
if (Number.isSafeInteger(line) && line > 0)
|
|
45
|
-
attributes.push({ key: "code.line.number", value: { intValue: String(line) } });
|
|
46
|
-
if (Number.isSafeInteger(column) && column > 0)
|
|
47
|
-
attributes.push({ key: "code.column.number", value: { intValue: String(column) } });
|
|
48
|
-
return attributes;
|
|
49
|
-
};
|
|
50
|
-
const fail = (kind, details, attributes = []) => {
|
|
51
|
-
const now = Date.now();
|
|
52
|
-
if (now - windowStart >= 6e4) {
|
|
53
|
-
windowStart = now;
|
|
54
|
-
reports = 0;
|
|
55
|
-
recent.clear();
|
|
56
|
-
}
|
|
57
|
-
const signature = `${kind}:${details.slice(0, 2e3)}`;
|
|
58
|
-
const previous = recent.get(signature);
|
|
59
|
-
if (previous !== void 0 && now - previous < 1e3 || reports >= 20) {
|
|
60
|
-
dropped++;
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
recent.set(signature, now);
|
|
64
|
-
reports++;
|
|
65
|
-
attributes.push({
|
|
66
|
-
key: "executor.ui.failure.suppressed",
|
|
67
|
-
value: { intValue: String(dropped) }
|
|
68
|
-
});
|
|
69
|
-
dropped = 0;
|
|
70
|
-
const traceId = Array.from(
|
|
71
|
-
crypto.getRandomValues(new Uint8Array(16)),
|
|
72
|
-
(byte) => byte.toString(16).padStart(2, "0")
|
|
73
|
-
).join("");
|
|
74
|
-
const time = `${Date.now()}000000`;
|
|
75
|
-
let status;
|
|
76
|
-
let deliveryMessage = "Sending error report\u2026";
|
|
77
|
-
const show = () => {
|
|
78
|
-
if (activeDialog?.open) return;
|
|
79
|
-
const host = document.createElement("div");
|
|
80
|
-
const root = host.attachShadow({ mode: "open" });
|
|
81
|
-
const dialog = document.createElement("dialog");
|
|
82
|
-
activeDialog = dialog;
|
|
83
|
-
dialog.setAttribute("aria-labelledby", "executor-failure-title");
|
|
84
|
-
const title = document.createElement("h2");
|
|
85
|
-
title.id = "executor-failure-title";
|
|
86
|
-
title.textContent = kind === "script" ? "This app could not load" : "This app stopped working";
|
|
87
|
-
const message = document.createElement("p");
|
|
88
|
-
message.textContent = kind === "script" ? "A file needed by this page did not load. Reload the page to try again." : "The app encountered an unexpected error. Reload the page to try again.";
|
|
89
|
-
const warning = document.createElement("p");
|
|
90
|
-
warning.textContent = "Copy any unsaved work before reloading.";
|
|
91
|
-
const disclosure = document.createElement("details");
|
|
92
|
-
const summary = document.createElement("summary");
|
|
93
|
-
summary.textContent = "Error details";
|
|
94
|
-
const report = document.createElement("textarea");
|
|
95
|
-
report.readOnly = true;
|
|
96
|
-
report.rows = 10;
|
|
97
|
-
report.cols = 36;
|
|
98
|
-
report.setAttribute("aria-label", "Error details");
|
|
99
|
-
report.value = `${details.slice(0, 12e3)}
|
|
22
|
+
// src/implementation/browser-scripts.gen.ts
|
|
23
|
+
var appWatchSource = '"use strict";(()=>{var s=()=>{let i=document.getElementById("executor-context")?.textContent;if(!i)return;let n=JSON.parse(i);if(typeof n!="object"||n===null||!("deployment"in n))return;let r=n.deployment;if(typeof r!="string"||r.length===0)return;let t=new EventSource("/_executor/version"),l=!1,o=()=>{l||(l=!0,t.close(),location.reload())};t.addEventListener("version",d=>{let e=JSON.parse(d.data);typeof e=="object"&&e!==null&&"deployment"in e&&(e.deployment===null||typeof e.deployment=="string")&&e.deployment!==r&&o()}),t.addEventListener("revoked",o),window.addEventListener("executor:deployment-changed",o),window.addEventListener("pagehide",()=>t.close(),{once:!0}),window.addEventListener("pageshow",d=>{d.persisted&&o()})};s();})();';
|
|
24
|
+
var appFailureSource = '"use strict";(()=>{var D=()=>{let d,w=Date.now(),m=0,g=0,f=new Map,A=/^(?:chrome|moz|safari-web)-extension:/,R=new Set(["Error","TypeError","ReferenceError","SyntaxError","RangeError","URIError","EvalError","AggregateError"]),x=(e,t=0,i=0)=>{let r=[];if(!URL.canParse(e))return r;let a=new URL(e);return a.origin!==location.origin||!a.pathname.startsWith("/_executor/assets/")||!a.pathname.endsWith(".js")||(r.push({key:"code.file.path",value:{stringValue:a.pathname}}),Number.isSafeInteger(t)&&t>0&&r.push({key:"code.line.number",value:{intValue:String(t)}}),Number.isSafeInteger(i)&&i>0&&r.push({key:"code.column.number",value:{intValue:String(i)}})),r},E=(e,t,i=[])=>{let r=Date.now();r-w>=6e4&&(w=r,m=0,f.clear());let a=`${e}:${t.slice(0,2e3)}`,b=f.get(a);if(b!==void 0&&r-b<1e3||m>=20){g++;return}f.set(a,r),m++,i.push({key:"executor.ui.failure.suppressed",value:{intValue:String(g)}}),g=0;let h=Array.from(crypto.getRandomValues(new Uint8Array(16)),s=>s.toString(16).padStart(2,"0")).join(""),S=`${Date.now()}000000`,n,u="Sending error report\\u2026",k=()=>{if(d?.open)return;let s=document.createElement("div"),V=s.attachShadow({mode:"open"}),o=document.createElement("dialog");d=o,o.setAttribute("aria-labelledby","executor-failure-title");let y=document.createElement("h2");y.id="executor-failure-title",y.textContent=e==="script"?"This app could not load":"This app stopped working";let C=document.createElement("p");C.textContent=e==="script"?"A file needed by this page did not load. Reload the page to try again.":"The app encountered an unexpected error. Reload the page to try again.";let L=document.createElement("p");L.textContent="Copy any unsaved work before reloading.";let T=document.createElement("details"),v=document.createElement("summary");v.textContent="Error details";let c=document.createElement("textarea");c.readOnly=!0,c.rows=10,c.cols=36,c.setAttribute("aria-label","Error details"),c.value=`${t.slice(0,12e3)}\n\nDiagnostic ID: ${h}`,T.append(v,c),n=document.createElement("p"),n.setAttribute("role","status"),n.textContent=u;let l=document.createElement("button");l.type="button",l.textContent="Reload page",l.addEventListener("click",()=>location.reload());let p=document.createElement("button");p.type="button",p.textContent="Close",p.addEventListener("click",()=>o.close()),o.addEventListener("close",()=>{d===o&&(d=void 0),s.remove()}),o.append(y,C,L,T,n,l,p),V.append(o),document.documentElement.append(s),o.showModal()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k,{once:!0}):k(),fetch("/_executor/api/telemetry/traces",{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",keepalive:!0,body:JSON.stringify({resourceSpans:[{scopeSpans:[{spans:[{traceId:h,spanId:h.slice(0,16),name:"ui.app.failure",kind:1,startTimeUnixNano:S,endTimeUnixNano:S,status:{code:2},attributes:[{key:"executor.ui.failure.kind",value:{stringValue:e}},...i]}]}]}]})}).then(s=>{u=s.ok?"Error report sent.":"Could not send the error report. You can copy the error details.",n&&(n.textContent=u)},()=>{u="Could not send the error report. You can copy the error details.",n&&(n.textContent=u)})};window.addEventListener("error",e=>{if(e instanceof ErrorEvent){if(A.test(e.filename))return;let t=x(e.filename,e.lineno,e.colno);e.error instanceof Error&&R.has(e.error.name)&&t.push({key:"exception.type",value:{stringValue:e.error.name}}),E("runtime",e.error instanceof Error?e.error.stack??e.message:e.message,t)}else e.target instanceof HTMLScriptElement&&E("script",`Could not load script: ${e.target.src}`,x(e.target.src))},!0),window.addEventListener("unhandledrejection",e=>{let t=e.reason;E("rejection",t instanceof Error?t.stack??t.message:"An app operation failed without handling its error.")})};D();})();';
|
|
25
|
+
var accountNoticeSource = '"use strict";(()=>{var g=()=>{let r=document.getElementById("executor-account-notice")?.textContent;if(!r)return;let t=JSON.parse(r);if(typeof t!="object"||t===null||!("items"in t)||!("fix"in t))return;let c=t.items,s=t.fix;if(!Array.isArray(c)||typeof s!="string")return;let a=()=>{let i=document.createElement("div"),x=i.attachShadow({mode:"open"}),d=document.createElement("style");d.textContent="aside{position:fixed;right:16px;bottom:16px;z-index:2147483647;max-width:360px;box-sizing:border-box;padding:14px 16px;border-radius:10px;border:1px solid #fcd34d;background:#fffbeb;color:#451a03;font:14px/1.45 ui-sans-serif,system-ui,sans-serif;box-shadow:0 8px 24px rgb(0 0 0/.12)}strong{display:block;margin-bottom:4px}ul{margin:0 0 10px;padding-left:18px}div{display:flex;gap:12px;align-items:center}a{color:inherit;font-weight:600}button{margin-left:auto;font:inherit;background:none;border:0;padding:0;color:inherit;text-decoration:underline;cursor:pointer}";let e=document.createElement("aside");e.setAttribute("role","status"),e.setAttribute("aria-label","Account warning");let l=document.createElement("strong");l.textContent="Some things might not work";let m=document.createElement("ul");for(let f of c){let p=document.createElement("li");p.textContent=String(f),m.append(p)}let u=document.createElement("div"),n=document.createElement("a");n.href=s,n.target="_top",n.textContent="Review accounts";let o=document.createElement("button");o.type="button",o.textContent="Dismiss",o.addEventListener("click",()=>i.remove()),u.append(n,o),e.append(l,m,u),x.append(d,e),document.documentElement.append(i)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a,{once:!0}):a()};g();})();';
|
|
100
26
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
traceId,
|
|
141
|
-
spanId: traceId.slice(0, 16),
|
|
142
|
-
name: "ui.app.failure",
|
|
143
|
-
kind: 1,
|
|
144
|
-
startTimeUnixNano: time,
|
|
145
|
-
endTimeUnixNano: time,
|
|
146
|
-
status: { code: 2 },
|
|
147
|
-
attributes: [
|
|
148
|
-
{ key: "executor.ui.failure.kind", value: { stringValue: kind } },
|
|
149
|
-
...attributes
|
|
150
|
-
]
|
|
151
|
-
}
|
|
152
|
-
]
|
|
153
|
-
}
|
|
154
|
-
]
|
|
155
|
-
}
|
|
156
|
-
]
|
|
157
|
-
})
|
|
158
|
-
}).then(
|
|
159
|
-
(response) => {
|
|
160
|
-
deliveryMessage = response.ok ? "Error report sent." : "Could not send the error report. You can copy the error details.";
|
|
161
|
-
if (status) status.textContent = deliveryMessage;
|
|
162
|
-
},
|
|
163
|
-
() => {
|
|
164
|
-
deliveryMessage = "Could not send the error report. You can copy the error details.";
|
|
165
|
-
if (status) status.textContent = deliveryMessage;
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
};
|
|
169
|
-
window.addEventListener(
|
|
170
|
-
"error",
|
|
171
|
-
(event) => {
|
|
172
|
-
if (event instanceof ErrorEvent) {
|
|
173
|
-
if (extension.test(event.filename)) return;
|
|
174
|
-
const attributes = sourceAttributes(event.filename, event.lineno, event.colno);
|
|
175
|
-
if (event.error instanceof Error && errorTypes.has(event.error.name))
|
|
176
|
-
attributes.push({ key: "exception.type", value: { stringValue: event.error.name } });
|
|
177
|
-
fail(
|
|
178
|
-
"runtime",
|
|
179
|
-
event.error instanceof Error ? event.error.stack ?? event.message : event.message,
|
|
180
|
-
attributes
|
|
181
|
-
);
|
|
182
|
-
} else if (event.target instanceof HTMLScriptElement) {
|
|
183
|
-
fail(
|
|
184
|
-
"script",
|
|
185
|
-
`Could not load script: ${event.target.src}`,
|
|
186
|
-
sourceAttributes(event.target.src)
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
true
|
|
191
|
-
);
|
|
192
|
-
window.addEventListener("unhandledrejection", (event) => {
|
|
193
|
-
const reason = event.reason;
|
|
194
|
-
fail(
|
|
195
|
-
"rejection",
|
|
196
|
-
reason instanceof Error ? reason.stack ?? reason.message : "An app operation failed without handling its error."
|
|
197
|
-
);
|
|
198
|
-
});
|
|
27
|
+
// src/implementation/ui-account-notice.ts
|
|
28
|
+
var escape = (text) => text.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """);
|
|
29
|
+
var accountProblemBlocks = (problem) => problem.reason === "missing" || problem.reason === "removed" || problem.reason === "incompatible" || problem.reason === "credentials_rejected";
|
|
30
|
+
var accountProblemText = (problem) => {
|
|
31
|
+
switch (problem.reason) {
|
|
32
|
+
case "missing":
|
|
33
|
+
return `No ${problem.provider} account chosen`;
|
|
34
|
+
case "removed":
|
|
35
|
+
return `${problem.provider} account was removed or is no longer shared`;
|
|
36
|
+
case "incompatible":
|
|
37
|
+
return `Chosen account can't be used as the ${problem.provider} account`;
|
|
38
|
+
case "credentials_rejected":
|
|
39
|
+
return `${problem.account} (${problem.provider}): sign-in rejected at last check`;
|
|
40
|
+
case "forbidden":
|
|
41
|
+
return `${problem.account} (${problem.provider}): missing permission at last check`;
|
|
42
|
+
case "upstream_unavailable":
|
|
43
|
+
return `${problem.account} (${problem.provider}): service unavailable at last check`;
|
|
44
|
+
case "check_failed":
|
|
45
|
+
return `${problem.account} (${problem.provider}): last check failed`;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var accountBlockedPage = (notice) => {
|
|
49
|
+
const title = `${escape(notice.app)} can't open`;
|
|
50
|
+
const items = notice.problems.map(
|
|
51
|
+
(problem) => `<li class="${accountProblemBlocks(problem) ? "bad" : "warn"}">${escape(accountProblemText(problem))}</li>`
|
|
52
|
+
).join("");
|
|
53
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${title}</title><style>
|
|
54
|
+
:root{color-scheme:light dark;font-family:ui-sans-serif,system-ui,sans-serif;color:#18181b;background:#fafafa}
|
|
55
|
+
@media (prefers-color-scheme:dark){:root{color:#f4f4f5;background:#18181b}main{background:#27272a!important;border-color:#3f3f46!important}a{color:inherit!important;border-color:#52525b!important}a.primary{background:#f4f4f5!important;color:#18181b!important}p{color:#a1a1aa!important}}
|
|
56
|
+
body{margin:0;min-height:100vh;display:grid;place-items:center;padding:24px;box-sizing:border-box}
|
|
57
|
+
main{max-width:480px;width:100%;background:#fff;border:1px solid #e4e4e7;border-radius:12px;padding:28px}
|
|
58
|
+
h1{margin:0 0 8px;font-size:20px}p{margin:0 0 16px;color:#52525b;line-height:1.5}
|
|
59
|
+
ul{margin:0 0 24px;padding:0;list-style:none;display:grid;gap:8px}
|
|
60
|
+
li{display:flex;gap:10px;align-items:baseline;line-height:1.4}li::before{content:"";flex:none;width:8px;height:8px;border-radius:50%;transform:translateY(-1px)}
|
|
61
|
+
li.bad::before{background:#dc2626}li.warn::before{background:#f59e0b}
|
|
62
|
+
.actions{display:flex;flex-wrap:wrap;gap:8px}
|
|
63
|
+
a{padding:8px 14px;border-radius:8px;border:1px solid #d4d4d8;color:#18181b;text-decoration:none;font-weight:500}
|
|
64
|
+
a.primary{background:#18181b;border-color:#18181b;color:#fff}
|
|
65
|
+
</style></head><body><main><h1>${title}</h1><p>This profile's accounts need attention before the app can work.</p><ul>${items}</ul><div class="actions"><a class="primary" href="${escape(notice.fix)}">Fix accounts</a><a href="${escape(notice.choose)}">Open with another profile</a></div></main></body></html>`;
|
|
199
66
|
};
|
|
200
|
-
var
|
|
67
|
+
var accountNoticeBootstrap = (notice) => `<script type="application/json" id="executor-account-notice">${JSON.stringify({
|
|
68
|
+
items: notice.problems.map(accountProblemText),
|
|
69
|
+
fix: notice.fix
|
|
70
|
+
}).replaceAll("<", "\\u003c")}</script><script>${accountNoticeSource}</script>`;
|
|
71
|
+
|
|
72
|
+
// src/implementation/ui-errors.ts
|
|
73
|
+
var appFailureBootstrap = `<script>${appFailureSource}</script>`;
|
|
201
74
|
|
|
202
75
|
// src/implementation/ui-serving.ts
|
|
203
76
|
var appDocument = (options) => Effect_exports.gen(function* () {
|
|
@@ -213,8 +86,15 @@ var appDocument = (options) => Effect_exports.gen(function* () {
|
|
|
213
86
|
});
|
|
214
87
|
if (pathname.includes(".") && pathname !== "/index.html")
|
|
215
88
|
return HttpServerResponse_exports.empty({ status: 404 });
|
|
216
|
-
const
|
|
217
|
-
if (
|
|
89
|
+
const notice = options.accounts;
|
|
90
|
+
if (notice?.problems.some(accountProblemBlocks))
|
|
91
|
+
return HttpServerResponse_exports.text(accountBlockedPage(notice), {
|
|
92
|
+
status: 409,
|
|
93
|
+
contentType: "text/html",
|
|
94
|
+
headers: appPrivateHeaders
|
|
95
|
+
});
|
|
96
|
+
const document = yield* options.asset("index.html");
|
|
97
|
+
if (document === void 0)
|
|
218
98
|
return HttpServerResponse_exports.text("This app has no UI.", {
|
|
219
99
|
status: 404,
|
|
220
100
|
headers: appPrivateHeaders
|
|
@@ -227,9 +107,9 @@ var appDocument = (options) => Effect_exports.gen(function* () {
|
|
|
227
107
|
const telemetry = yield* CurrentTelemetryConfig;
|
|
228
108
|
const attribute = (text) => text.replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<");
|
|
229
109
|
const metadata = telemetry === void 0 ? "" : `<meta name="executor-build" content="${attribute(telemetry.version)}"><meta name="executor-environment" content="${attribute(telemetry.environment)}">`;
|
|
230
|
-
const boot = `${metadata}<base href="/_executor/assets/${attribute(options.deployment)}/"><script type="application/json" id="executor-context">${context}</script>${appFailureBootstrap}<script src="/_executor/watch.js" defer></script>`;
|
|
110
|
+
const boot = `${metadata}<base href="/_executor/assets/${attribute(options.deployment)}/"><script type="application/json" id="executor-context">${context}</script>${appFailureBootstrap}${notice === void 0 || notice.problems.length === 0 ? "" : accountNoticeBootstrap(notice)}<script src="/_executor/watch.js" defer></script>`;
|
|
231
111
|
return HttpServerResponse_exports.text(
|
|
232
|
-
new TextDecoder().decode(
|
|
112
|
+
new TextDecoder().decode(document.body).replace("<!--executor-ui-->", boot),
|
|
233
113
|
{ contentType: "text/html", headers: appPrivateHeaders }
|
|
234
114
|
);
|
|
235
115
|
});
|
|
@@ -240,7 +120,7 @@ var appAsset = (asset, build, path) => Effect_exports.gen(function* () {
|
|
|
240
120
|
const etag = `W/"${encodeURIComponent(build)}/${encodeURIComponent(path)}"`;
|
|
241
121
|
const headers = {
|
|
242
122
|
...appPrivateHeaders,
|
|
243
|
-
"cache-control": "private,
|
|
123
|
+
"cache-control": "private, max-age=31536000, immutable",
|
|
244
124
|
vary: "Cookie",
|
|
245
125
|
etag
|
|
246
126
|
};
|
|
@@ -251,34 +131,7 @@ var appAsset = (asset, build, path) => Effect_exports.gen(function* () {
|
|
|
251
131
|
});
|
|
252
132
|
|
|
253
133
|
// src/implementation/ui-watch.ts
|
|
254
|
-
var
|
|
255
|
-
const context = document.getElementById("executor-context")?.textContent;
|
|
256
|
-
if (!context) return;
|
|
257
|
-
const pinned = JSON.parse(context);
|
|
258
|
-
if (typeof pinned !== "object" || pinned === null || !("deployment" in pinned)) return;
|
|
259
|
-
const deployment = pinned.deployment;
|
|
260
|
-
if (typeof deployment !== "string" || deployment.length === 0) return;
|
|
261
|
-
const stream = new EventSource("/_executor/version");
|
|
262
|
-
let reloading = false;
|
|
263
|
-
const reload = () => {
|
|
264
|
-
if (reloading) return;
|
|
265
|
-
reloading = true;
|
|
266
|
-
stream.close();
|
|
267
|
-
location.reload();
|
|
268
|
-
};
|
|
269
|
-
stream.addEventListener("version", (event) => {
|
|
270
|
-
const current = JSON.parse(event.data);
|
|
271
|
-
if (typeof current === "object" && current !== null && "deployment" in current && (current.deployment === null || typeof current.deployment === "string") && current.deployment !== deployment)
|
|
272
|
-
reload();
|
|
273
|
-
});
|
|
274
|
-
stream.addEventListener("revoked", reload);
|
|
275
|
-
window.addEventListener("executor:deployment-changed", reload);
|
|
276
|
-
window.addEventListener("pagehide", () => stream.close(), { once: true });
|
|
277
|
-
window.addEventListener("pageshow", (event) => {
|
|
278
|
-
if (event.persisted) reload();
|
|
279
|
-
});
|
|
280
|
-
};
|
|
281
|
-
var appWatchScript = `(${installAppWatch.toString()})()`;
|
|
134
|
+
var appWatchScript = appWatchSource;
|
|
282
135
|
export {
|
|
283
136
|
appAsset,
|
|
284
137
|
appDocument,
|