apps 0.0.1-beta.16 → 0.0.1-beta.18
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/framework-reference.json +1 -1
- package/js/{chunk-RFVIONFX.js → chunk-4EMWIFFJ.js} +1 -1
- package/js/{chunk-5T57N25Q.js → chunk-4QQ62BVS.js} +22 -0
- package/js/{chunk-QAXLPXKL.js → chunk-7H44SOSX.js} +4 -4
- package/js/{chunk-CIUZ3HSV.js → chunk-F2IASQK2.js} +3 -3
- package/js/{chunk-L2QHGLWF.js → chunk-HQY4UTYX.js} +2 -2
- package/js/{chunk-S2HMUOAV.js → chunk-MAF4BRQF.js} +2 -2
- package/js/{chunk-TEFD5OBS.js → chunk-NMKHTJOQ.js} +2 -2
- package/js/{chunk-CL3O2NIN.js → chunk-VXWY44LE.js} +91 -7
- package/js/{chunk-TXFDBLWA.js → chunk-XNCYIB4D.js} +3 -3
- package/js/{chunk-ZBGV4RN4.js → chunk-ZKISLYWM.js} +22 -9
- package/js/client.js +1 -1
- package/js/contracts.js +5 -1
- package/js/effect.js +6 -6
- package/js/graphql.js +8 -8
- package/js/host.js +6 -6
- package/js/index.js +32 -7
- package/js/mcp/effect.js +8 -8
- package/js/mcp/stdio.js +8 -8
- package/js/mcp.js +10 -10
- package/js/openapi.js +5 -5
- package/js/skills.js +2 -2
- package/js/ui/serving.js +98 -1
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/contracts/host.d.ts +5 -4
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/7.d.ts +1784 -0
- package/types/apps/src/contracts/provider.d.ts +15 -0
- package/types/apps/src/contracts/ui.d.ts +18 -0
- package/types/apps/src/implementation/elicitation.d.ts +1 -1
- package/types/apps/src/implementation/openapi-compile.d.ts +2 -2
- package/types/apps/src/implementation/provider.d.ts +11 -2
- package/types/apps/src/implementation/schema.d.ts +39 -0
- package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
- package/types/apps/src/implementation/ui-serving.d.ts +6 -2
- package/types/apps/src/index.d.ts +6 -4
package/js/mcp/effect.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mcpClientEffect,
|
|
3
3
|
mcpToolsEffect
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-MAF4BRQF.js";
|
|
5
|
+
import "../chunk-7H44SOSX.js";
|
|
6
6
|
import "../chunk-BCSNKUAC.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-ZKISLYWM.js";
|
|
8
8
|
import "../chunk-NKLWZJLE.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-F2IASQK2.js";
|
|
10
10
|
import "../chunk-IPI4MFSN.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-XNCYIB4D.js";
|
|
12
12
|
import "../chunk-ZQINWV4W.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-NMKHTJOQ.js";
|
|
14
14
|
import "../chunk-MKWZPDR6.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-VXWY44LE.js";
|
|
16
16
|
import "../chunk-N7YDVXYJ.js";
|
|
17
17
|
import "../chunk-R3EV5FTO.js";
|
|
18
18
|
import "../chunk-JU7VHODU.js";
|
|
19
19
|
import "../chunk-ODEIDRGW.js";
|
|
20
20
|
import "../chunk-57RKNWL2.js";
|
|
21
21
|
import "../chunk-UK573G7W.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-4QQ62BVS.js";
|
|
23
23
|
import "../chunk-PZB6T6KU.js";
|
|
24
24
|
import "../chunk-27F7W2LG.js";
|
|
25
25
|
import "../chunk-CDL5PM2Q.js";
|
package/js/mcp/stdio.js
CHANGED
|
@@ -2,30 +2,30 @@ import {
|
|
|
2
2
|
adaptMcpTools,
|
|
3
3
|
mcpClient,
|
|
4
4
|
mcpJsonSchemaValidator
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-7H44SOSX.js";
|
|
6
6
|
import {
|
|
7
7
|
protocolRouter
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-HQY4UTYX.js";
|
|
9
9
|
import "../chunk-BCSNKUAC.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-ZKISLYWM.js";
|
|
11
11
|
import "../chunk-NKLWZJLE.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-F2IASQK2.js";
|
|
13
13
|
import "../chunk-IPI4MFSN.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-XNCYIB4D.js";
|
|
15
15
|
import "../chunk-ZQINWV4W.js";
|
|
16
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-NMKHTJOQ.js";
|
|
17
17
|
import "../chunk-MKWZPDR6.js";
|
|
18
18
|
import {
|
|
19
19
|
McpError,
|
|
20
20
|
ProcessConfig
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-VXWY44LE.js";
|
|
22
22
|
import "../chunk-N7YDVXYJ.js";
|
|
23
23
|
import "../chunk-R3EV5FTO.js";
|
|
24
24
|
import "../chunk-JU7VHODU.js";
|
|
25
25
|
import "../chunk-ODEIDRGW.js";
|
|
26
26
|
import "../chunk-57RKNWL2.js";
|
|
27
27
|
import "../chunk-UK573G7W.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-4QQ62BVS.js";
|
|
29
29
|
import "../chunk-PZB6T6KU.js";
|
|
30
30
|
import "../chunk-27F7W2LG.js";
|
|
31
31
|
import {
|
package/js/mcp.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mcpClientEffect
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MAF4BRQF.js";
|
|
4
4
|
import {
|
|
5
5
|
catalogCache
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4EMWIFFJ.js";
|
|
7
7
|
import {
|
|
8
8
|
adaptMcpTool
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7H44SOSX.js";
|
|
10
10
|
import {
|
|
11
11
|
protocolOperations
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HQY4UTYX.js";
|
|
13
13
|
import "./chunk-BCSNKUAC.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-ZKISLYWM.js";
|
|
15
15
|
import {
|
|
16
16
|
cacheKey
|
|
17
17
|
} from "./chunk-NKLWZJLE.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-F2IASQK2.js";
|
|
19
19
|
import "./chunk-IPI4MFSN.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-XNCYIB4D.js";
|
|
21
21
|
import "./chunk-ZQINWV4W.js";
|
|
22
22
|
import {
|
|
23
23
|
nativeOperation,
|
|
24
24
|
routerDeclaration
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-NMKHTJOQ.js";
|
|
26
26
|
import "./chunk-MKWZPDR6.js";
|
|
27
27
|
import {
|
|
28
28
|
McpError,
|
|
29
29
|
McpServerHeader,
|
|
30
30
|
McpToolMetadata,
|
|
31
31
|
McpToolsOptions
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-VXWY44LE.js";
|
|
33
33
|
import "./chunk-N7YDVXYJ.js";
|
|
34
34
|
import "./chunk-R3EV5FTO.js";
|
|
35
35
|
import "./chunk-JU7VHODU.js";
|
|
36
36
|
import "./chunk-ODEIDRGW.js";
|
|
37
37
|
import "./chunk-57RKNWL2.js";
|
|
38
38
|
import "./chunk-UK573G7W.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-4QQ62BVS.js";
|
|
40
40
|
import "./chunk-PZB6T6KU.js";
|
|
41
41
|
import "./chunk-27F7W2LG.js";
|
|
42
42
|
import {
|
package/js/openapi.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
protocolOperations,
|
|
10
10
|
protocolRouter
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HQY4UTYX.js";
|
|
12
12
|
import {
|
|
13
13
|
OpenapiError,
|
|
14
14
|
OpenapiErrorResponse,
|
|
@@ -21,14 +21,14 @@ import {
|
|
|
21
21
|
isOpenapiTextMedia,
|
|
22
22
|
openapiBinaryResultSchema,
|
|
23
23
|
openapiMediaKind
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-F2IASQK2.js";
|
|
25
25
|
import "./chunk-IPI4MFSN.js";
|
|
26
26
|
import {
|
|
27
27
|
fromPromise,
|
|
28
28
|
nativeOperation,
|
|
29
29
|
routerDeclaration,
|
|
30
30
|
toPromise
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-NMKHTJOQ.js";
|
|
32
32
|
import {
|
|
33
33
|
accountProviderError,
|
|
34
34
|
httpProviderError
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
OpenapiResponseError,
|
|
40
40
|
RouterMeta,
|
|
41
41
|
defaultOpenapiErrorLimits
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-VXWY44LE.js";
|
|
43
43
|
import "./chunk-N7YDVXYJ.js";
|
|
44
44
|
import {
|
|
45
45
|
ProviderError,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
lazyJsonSchemaDecoder,
|
|
59
59
|
once,
|
|
60
60
|
wrap
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-4QQ62BVS.js";
|
|
62
62
|
import "./chunk-PZB6T6KU.js";
|
|
63
63
|
import {
|
|
64
64
|
JsonObject
|
package/js/skills.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
catalogCache
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4EMWIFFJ.js";
|
|
4
4
|
import "./chunk-NKLWZJLE.js";
|
|
5
5
|
import {
|
|
6
6
|
folderSkillsEffect,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-UK573G7W.js";
|
|
30
30
|
import {
|
|
31
31
|
wrap
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-4QQ62BVS.js";
|
|
33
33
|
import "./chunk-27F7W2LG.js";
|
|
34
34
|
import {
|
|
35
35
|
Effect_exports,
|
package/js/ui/serving.js
CHANGED
|
@@ -19,6 +19,96 @@ import {
|
|
|
19
19
|
} from "../chunk-CDL5PM2Q.js";
|
|
20
20
|
import "../chunk-CZ7CSFO4.js";
|
|
21
21
|
|
|
22
|
+
// src/implementation/ui-account-notice.ts
|
|
23
|
+
var escape = (text) => text.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """);
|
|
24
|
+
var accountProblemBlocks = (problem) => problem.reason === "missing" || problem.reason === "removed" || problem.reason === "incompatible" || problem.reason === "credentials_rejected";
|
|
25
|
+
var accountProblemText = (problem) => {
|
|
26
|
+
switch (problem.reason) {
|
|
27
|
+
case "missing":
|
|
28
|
+
return `No ${problem.provider} account chosen`;
|
|
29
|
+
case "removed":
|
|
30
|
+
return `${problem.provider} account was removed or is no longer shared`;
|
|
31
|
+
case "incompatible":
|
|
32
|
+
return `Chosen account can't be used as the ${problem.provider} account`;
|
|
33
|
+
case "credentials_rejected":
|
|
34
|
+
return `${problem.account} (${problem.provider}): sign-in rejected at last check`;
|
|
35
|
+
case "forbidden":
|
|
36
|
+
return `${problem.account} (${problem.provider}): missing permission at last check`;
|
|
37
|
+
case "upstream_unavailable":
|
|
38
|
+
return `${problem.account} (${problem.provider}): service unavailable at last check`;
|
|
39
|
+
case "check_failed":
|
|
40
|
+
return `${problem.account} (${problem.provider}): last check failed`;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var accountBlockedPage = (notice) => {
|
|
44
|
+
const title = `${escape(notice.app)} can't open`;
|
|
45
|
+
const items = notice.problems.map(
|
|
46
|
+
(problem) => `<li class="${accountProblemBlocks(problem) ? "bad" : "warn"}">${escape(accountProblemText(problem))}</li>`
|
|
47
|
+
).join("");
|
|
48
|
+
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>
|
|
49
|
+
:root{color-scheme:light dark;font-family:ui-sans-serif,system-ui,sans-serif;color:#18181b;background:#fafafa}
|
|
50
|
+
@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}}
|
|
51
|
+
body{margin:0;min-height:100vh;display:grid;place-items:center;padding:24px;box-sizing:border-box}
|
|
52
|
+
main{max-width:480px;width:100%;background:#fff;border:1px solid #e4e4e7;border-radius:12px;padding:28px}
|
|
53
|
+
h1{margin:0 0 8px;font-size:20px}p{margin:0 0 16px;color:#52525b;line-height:1.5}
|
|
54
|
+
ul{margin:0 0 24px;padding:0;list-style:none;display:grid;gap:8px}
|
|
55
|
+
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)}
|
|
56
|
+
li.bad::before{background:#dc2626}li.warn::before{background:#f59e0b}
|
|
57
|
+
.actions{display:flex;flex-wrap:wrap;gap:8px}
|
|
58
|
+
a{padding:8px 14px;border-radius:8px;border:1px solid #d4d4d8;color:#18181b;text-decoration:none;font-weight:500}
|
|
59
|
+
a.primary{background:#18181b;border-color:#18181b;color:#fff}
|
|
60
|
+
</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>`;
|
|
61
|
+
};
|
|
62
|
+
var installAccountNotice = () => {
|
|
63
|
+
const data = document.getElementById("executor-account-notice")?.textContent;
|
|
64
|
+
if (!data) return;
|
|
65
|
+
const notice = JSON.parse(data);
|
|
66
|
+
if (typeof notice !== "object" || notice === null || !("items" in notice) || !("fix" in notice))
|
|
67
|
+
return;
|
|
68
|
+
const items = notice.items;
|
|
69
|
+
const fix = notice.fix;
|
|
70
|
+
if (!Array.isArray(items) || typeof fix !== "string") return;
|
|
71
|
+
const show = () => {
|
|
72
|
+
const host = document.createElement("div");
|
|
73
|
+
const root = host.attachShadow({ mode: "open" });
|
|
74
|
+
const style = document.createElement("style");
|
|
75
|
+
style.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}`;
|
|
76
|
+
const card = document.createElement("aside");
|
|
77
|
+
card.setAttribute("role", "status");
|
|
78
|
+
card.setAttribute("aria-label", "Account warning");
|
|
79
|
+
const title = document.createElement("strong");
|
|
80
|
+
title.textContent = "Some things might not work";
|
|
81
|
+
const list = document.createElement("ul");
|
|
82
|
+
for (const item of items) {
|
|
83
|
+
const entry = document.createElement("li");
|
|
84
|
+
entry.textContent = String(item);
|
|
85
|
+
list.append(entry);
|
|
86
|
+
}
|
|
87
|
+
const actions = document.createElement("div");
|
|
88
|
+
const link = document.createElement("a");
|
|
89
|
+
link.href = fix;
|
|
90
|
+
link.target = "_top";
|
|
91
|
+
link.textContent = "Review accounts";
|
|
92
|
+
const close = document.createElement("button");
|
|
93
|
+
close.type = "button";
|
|
94
|
+
close.textContent = "Dismiss";
|
|
95
|
+
close.addEventListener("click", () => host.remove());
|
|
96
|
+
actions.append(link, close);
|
|
97
|
+
card.append(title, list, actions);
|
|
98
|
+
root.append(style, card);
|
|
99
|
+
document.documentElement.append(host);
|
|
100
|
+
};
|
|
101
|
+
if (document.readyState === "loading") {
|
|
102
|
+
document.addEventListener("DOMContentLoaded", show, { once: true });
|
|
103
|
+
} else {
|
|
104
|
+
show();
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
var accountNoticeBootstrap = (notice) => `<script type="application/json" id="executor-account-notice">${JSON.stringify({
|
|
108
|
+
items: notice.problems.map(accountProblemText),
|
|
109
|
+
fix: notice.fix
|
|
110
|
+
}).replaceAll("<", "\\u003c")}</script><script>(${installAccountNotice.toString()})()</script>`;
|
|
111
|
+
|
|
22
112
|
// src/implementation/ui-errors.ts
|
|
23
113
|
var installAppFailureUI = () => {
|
|
24
114
|
let activeDialog;
|
|
@@ -214,6 +304,13 @@ var appDocument = (options) => Effect_exports.gen(function* () {
|
|
|
214
304
|
});
|
|
215
305
|
if (pathname.includes(".") && pathname !== "/index.html")
|
|
216
306
|
return HttpServerResponse_exports.empty({ status: 404 });
|
|
307
|
+
const notice = options.accounts;
|
|
308
|
+
if (notice?.problems.some(accountProblemBlocks))
|
|
309
|
+
return HttpServerResponse_exports.text(accountBlockedPage(notice), {
|
|
310
|
+
status: 409,
|
|
311
|
+
contentType: "text/html",
|
|
312
|
+
headers: appPrivateHeaders
|
|
313
|
+
});
|
|
217
314
|
const document2 = yield* options.asset("index.html");
|
|
218
315
|
if (document2 === void 0)
|
|
219
316
|
return HttpServerResponse_exports.text("This app has no UI.", {
|
|
@@ -228,7 +325,7 @@ var appDocument = (options) => Effect_exports.gen(function* () {
|
|
|
228
325
|
const telemetry = yield* CurrentTelemetryConfig;
|
|
229
326
|
const attribute = (text) => text.replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<");
|
|
230
327
|
const metadata = telemetry === void 0 ? "" : `<meta name="executor-build" content="${attribute(telemetry.version)}"><meta name="executor-environment" content="${attribute(telemetry.environment)}">`;
|
|
231
|
-
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>`;
|
|
328
|
+
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>`;
|
|
232
329
|
return HttpServerResponse_exports.text(
|
|
233
330
|
new TextDecoder().decode(document2.body).replace("<!--executor-ui-->", boot),
|
|
234
331
|
{ contentType: "text/html", headers: appPrivateHeaders }
|