apps 0.0.1-beta.0 → 0.0.1-beta.10

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.
Files changed (141) hide show
  1. package/README.md +145 -30
  2. package/framework-reference.json +1 -1
  3. package/js/browser-XIPJGLH2.js +65 -0
  4. package/js/{chunk-36DNRFZQ.js → chunk-27F7W2LG.js} +1 -1
  5. package/js/{chunk-VFUZI3NY.js → chunk-57RKNWL2.js} +4 -4
  6. package/js/{chunk-BPEFS4YF.js → chunk-5T57N25Q.js} +122 -18
  7. package/js/chunk-72JNVHPK.js +41 -0
  8. package/js/{chunk-2OTCEKL2.js → chunk-CDL5PM2Q.js} +2643 -1646
  9. package/js/{chunk-KWTCHVLT.js → chunk-CRDWFA74.js} +69 -54
  10. package/js/chunk-CZ7CSFO4.js +39 -0
  11. package/js/{chunk-WIDTG42X.js → chunk-EPT3ZP52.js} +79 -26
  12. package/js/chunk-FL2QR3XW.js +507 -0
  13. package/js/{chunk-3ANFZFCV.js → chunk-IJX4CYZO.js} +15 -18
  14. package/js/chunk-IPI4MFSN.js +78 -0
  15. package/js/chunk-JU7VHODU.js +104 -0
  16. package/js/chunk-KUMBKVJD.js +39 -0
  17. package/js/{chunk-YDR4CPJA.js → chunk-M3B3DE4K.js} +8 -8
  18. package/js/chunk-MKWZPDR6.js +63 -0
  19. package/js/{chunk-7JXHF5IF.js → chunk-N7YDVXYJ.js} +49 -1
  20. package/js/chunk-NKLWZJLE.js +172 -0
  21. package/js/{chunk-OWD2YICM.js → chunk-ODEIDRGW.js} +116 -88
  22. package/js/{chunk-D6BKYP2L.js → chunk-PJJ24GU7.js} +4 -4
  23. package/js/{chunk-EP6AEUZO.js → chunk-PZB6T6KU.js} +1 -1
  24. package/js/chunk-R3EV5FTO.js +97 -0
  25. package/js/chunk-RFVIONFX.js +189 -0
  26. package/js/{chunk-W7Q5EOTS.js → chunk-UK573G7W.js} +32 -32
  27. package/js/chunk-UVL56Z6E.js +6641 -0
  28. package/js/{chunk-Q2FD5IBM.js → chunk-V5KNQVCT.js} +505 -124
  29. package/js/{chunk-SBKHUC5L.js → chunk-VFZKSM3T.js} +5 -25
  30. package/js/{chunk-HP7E42X6.js → chunk-WLE7WX2U.js} +1158 -232
  31. package/js/{chunk-X3YBZCJW.js → chunk-YXQHV65J.js} +58 -62
  32. package/js/chunk-Z5M2LQOZ.js +209 -0
  33. package/js/{chunk-R6JMJSVT.js → chunk-ZQINWV4W.js} +60 -20
  34. package/js/client.js +11 -27
  35. package/js/contracts.js +138 -27
  36. package/js/effect.js +20 -15
  37. package/js/es-APDZKREY.js +40968 -0
  38. package/js/graphql.js +220 -123
  39. package/js/host.js +75 -19
  40. package/js/index.js +261 -117
  41. package/js/mcp/effect.js +24 -17
  42. package/js/mcp/stdio.js +26 -21
  43. package/js/mcp.js +127 -26
  44. package/js/openapi.js +3048 -150
  45. package/js/operations/approval.js +1 -1
  46. package/js/react.js +4 -4
  47. package/js/skills/effect.js +11 -0
  48. package/js/skills.js +893 -0
  49. package/js/storage/facet.js +7 -7
  50. package/js/ui/auth/contracts.js +9 -10
  51. package/js/ui/auth.js +17 -15
  52. package/js/ui/contracts.js +5 -5
  53. package/js/ui/serving.js +14 -13
  54. package/package.json +9 -1
  55. package/runtime.json +1 -1
  56. package/types/app-cache/src/contracts/cache.d.ts +119 -0
  57. package/types/app-cache/src/index.d.ts +93 -0
  58. package/types/app-data/src/contracts/database.d.ts +33 -6
  59. package/types/app-data/src/implementation/schema.d.ts +2 -17
  60. package/types/apps/src/contracts/api-response-error.d.ts +43 -0
  61. package/types/apps/src/contracts/app.d.ts +16 -4
  62. package/types/apps/src/contracts/cache.d.ts +44 -0
  63. package/types/apps/src/contracts/dynamic-skills.d.ts +10 -0
  64. package/types/apps/src/contracts/failure.d.ts +25 -0
  65. package/types/apps/src/contracts/graphql.d.ts +18 -1
  66. package/types/apps/src/contracts/host.d.ts +76 -528
  67. package/types/apps/src/contracts/mcp.d.ts +19 -1
  68. package/types/apps/src/contracts/openapi-compile.d.ts +11 -0
  69. package/types/apps/src/contracts/openapi-document.d.ts +53 -0
  70. package/types/apps/src/contracts/openapi.d.ts +160 -30
  71. package/types/apps/src/contracts/operations.d.ts +0 -5
  72. package/types/apps/src/contracts/protocol-version.d.ts +6 -0
  73. package/types/apps/src/contracts/protocols/1.d.ts +1589 -0
  74. package/types/apps/src/contracts/protocols/2.d.ts +668 -0
  75. package/types/apps/src/contracts/protocols/3.d.ts +676 -0
  76. package/types/apps/src/contracts/protocols/4.d.ts +1229 -0
  77. package/types/apps/src/contracts/protocols/5.d.ts +1090 -0
  78. package/types/apps/src/contracts/provider-error.d.ts +15 -0
  79. package/types/apps/src/contracts/provider.d.ts +69 -6
  80. package/types/apps/src/contracts/router.d.ts +59 -0
  81. package/types/apps/src/contracts/skills.d.ts +122 -0
  82. package/types/apps/src/contracts/storage.d.ts +3 -3
  83. package/types/apps/src/contracts/swagger-client.d.ts +29 -0
  84. package/types/apps/src/contracts/ui-auth.d.ts +6 -14
  85. package/types/apps/src/contracts/workflows.d.ts +34 -3
  86. package/types/apps/src/graphql.d.ts +5 -7
  87. package/types/apps/src/host.d.ts +1 -0
  88. package/types/apps/src/implementation/account-router.d.ts +12 -0
  89. package/types/apps/src/implementation/app.d.ts +5 -4
  90. package/types/apps/src/implementation/cache-session.d.ts +7 -0
  91. package/types/apps/src/implementation/cache.d.ts +8 -0
  92. package/types/apps/src/implementation/catalog-cache.d.ts +36 -0
  93. package/types/apps/src/implementation/dynamic-skills.d.ts +7 -0
  94. package/types/apps/src/implementation/elicitation.d.ts +13 -13
  95. package/types/apps/src/implementation/failure-detail.d.ts +25 -0
  96. package/types/apps/src/implementation/git.d.ts +25 -0
  97. package/types/apps/src/implementation/graphql-catalog.d.ts +7 -0
  98. package/types/apps/src/implementation/graphql.d.ts +81 -3
  99. package/types/apps/src/implementation/inflate.d.ts +16 -0
  100. package/types/apps/src/implementation/input-problems.d.ts +3 -0
  101. package/types/apps/src/implementation/mcp-call.d.ts +3 -2
  102. package/types/apps/src/implementation/mcp-catalog.d.ts +9 -0
  103. package/types/apps/src/implementation/mcp-client.d.ts +39 -22
  104. package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
  105. package/types/apps/src/implementation/mcp-tools.d.ts +6 -3
  106. package/types/apps/src/implementation/mcp.d.ts +55 -2
  107. package/types/apps/src/implementation/openapi-compile.d.ts +120 -0
  108. package/types/apps/src/implementation/openapi-document.d.ts +51 -0
  109. package/types/apps/src/implementation/openapi-names.d.ts +18 -0
  110. package/types/apps/src/implementation/openapi-request.d.ts +10 -4
  111. package/types/apps/src/implementation/openapi-source.d.ts +36 -0
  112. package/types/apps/src/implementation/openapi.d.ts +39 -3
  113. package/types/apps/src/implementation/operations.d.ts +26 -3
  114. package/types/apps/src/implementation/protocol-operations.d.ts +3 -4
  115. package/types/apps/src/implementation/provider-error.d.ts +10 -0
  116. package/types/apps/src/implementation/provider.d.ts +9 -4
  117. package/types/apps/src/implementation/router-catalog.d.ts +225 -0
  118. package/types/apps/src/implementation/router.d.ts +59 -0
  119. package/types/apps/src/implementation/schema.d.ts +11 -6
  120. package/types/apps/src/implementation/skill-files.d.ts +10 -0
  121. package/types/apps/src/implementation/skills.d.ts +43 -0
  122. package/types/apps/src/implementation/storage.d.ts +5 -3
  123. package/types/apps/src/implementation/swagger-client.d.ts +28 -0
  124. package/types/apps/src/implementation/ui-auth.d.ts +11 -5
  125. package/types/apps/src/implementation/ui-serving.d.ts +4 -2
  126. package/types/apps/src/implementation/webhooks.d.ts +1 -1
  127. package/types/apps/src/implementation/workflow-context.d.ts +11 -3
  128. package/types/apps/src/index.d.ts +11 -3
  129. package/types/apps/src/mcp-stdio.d.ts +2 -5
  130. package/types/apps/src/mcp.d.ts +8 -7
  131. package/types/apps/src/openapi.d.ts +8 -6
  132. package/types/apps/src/skills.d.ts +75 -0
  133. package/types/apps/src/ui-auth.d.ts +2 -2
  134. package/types/telemetry/src/browser-operations.d.ts +5 -2
  135. package/types/telemetry/src/config.d.ts +2 -0
  136. package/js/chunk-22WRQZT7.js +0 -389
  137. package/js/chunk-BKVL7XAJ.js +0 -47
  138. package/js/chunk-C24KEZXR.js +0 -59
  139. package/js/chunk-LOKGDT6B.js +0 -28
  140. package/js/chunk-MLKGABMK.js +0 -9
  141. package/types/apps/src/implementation/account-operations.d.ts +0 -32
@@ -1,47 +0,0 @@
1
- import {
2
- HttpServerResponse_exports
3
- } from "./chunk-W7Q5EOTS.js";
4
-
5
- // src/implementation/ui-auth.ts
6
- var appPrivateHeaders = {
7
- "cache-control": "no-store",
8
- "referrer-policy": "no-referrer",
9
- "x-content-type-options": "nosniff",
10
- "content-security-policy": "frame-ancestors 'none'"
11
- };
12
- var appSignInPage = () => HttpServerResponse_exports.text(
13
- `<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Opening app</title></head><body><p>Opening app\u2026</p><a href="/" hidden>Try again</a><script src="/_executor/auth/browser.js"></script></body></html>`,
14
- {
15
- contentType: "text/html",
16
- headers: {
17
- ...appPrivateHeaders,
18
- "content-security-policy": "default-src 'none'; script-src 'self'; connect-src 'self'; frame-ancestors 'none'; base-uri 'none'"
19
- }
20
- }
21
- );
22
- var appSignInScript = () => HttpServerResponse_exports.text(
23
- `
24
- const callback = location.pathname === "/_executor/auth/callback";
25
- const parameters = new URLSearchParams(location.hash.slice(1));
26
- const body = callback
27
- ? {request: parameters.get("request"), code: parameters.get("code")}
28
- : {returnTo: location.pathname + location.search + location.hash};
29
- if (callback) history.replaceState(null, "", location.pathname);
30
- fetch(callback ? "/_executor/auth/complete" : "/_executor/auth/start", {
31
- method: "POST", headers: {"content-type":"application/json"}, body: JSON.stringify(body)
32
- }).then(async response => {
33
- if (!response.ok) throw new Error();
34
- const result = await response.json();
35
- location.replace(callback ? result.returnTo : result.url);
36
- }).catch(() => {
37
- document.querySelector("p").textContent = "Could not sign in to this app. Try opening it again.";
38
- document.querySelector("a").hidden = false;
39
- });`,
40
- { contentType: "text/javascript", headers: appPrivateHeaders }
41
- );
42
-
43
- export {
44
- appPrivateHeaders,
45
- appSignInPage,
46
- appSignInScript
47
- };
@@ -1,59 +0,0 @@
1
- import {
2
- decoderOf
3
- } from "./chunk-BPEFS4YF.js";
4
- import {
5
- Effect_exports
6
- } from "./chunk-2OTCEKL2.js";
7
-
8
- // src/implementation/operations.ts
9
- var NativeOperation = /* @__PURE__ */ Symbol("apps.Operation");
10
- var operationDeclaration = (operation) => ({
11
- kind: operation.kind,
12
- [NativeOperation]: operation
13
- });
14
- var nativeOperation = (value) => {
15
- if (typeof value !== "object" || value === null || !(NativeOperation in value)) return void 0;
16
- return value[NativeOperation];
17
- };
18
- var operationOptions = (options) => {
19
- const approval = options.approval;
20
- return {
21
- ...options.description === void 0 ? {} : { description: options.description },
22
- ...options.title === void 0 ? {} : { title: options.title },
23
- ...options.annotations === void 0 ? {} : { annotations: options.annotations },
24
- ...options._meta === void 0 ? {} : { _meta: options._meta },
25
- input: decoderOf(options.input),
26
- ...approval === void 0 ? {} : {
27
- approval: (context) => Effect_exports.tryPromise({ try: async () => approval(context), catch: (error) => error })
28
- }
29
- };
30
- };
31
- var withApproval = (operation, approval) => ({
32
- ...operation,
33
- [NativeOperation]: {
34
- ...operation[NativeOperation],
35
- approval: (context) => Effect_exports.tryPromise({ try: async () => approval(context), catch: (error) => error })
36
- }
37
- });
38
- var make = (kind, options, run) => operationDeclaration({
39
- ...operationOptions(options),
40
- kind,
41
- // The host always validates JSON serialization, even without a stronger output declaration.
42
- ...options.output === void 0 ? {} : { output: decoderOf(options.output) },
43
- run: (context, input) => Effect_exports.tryPromise({
44
- // SAFETY: defineApp checks the handler context against its requirements.
45
- // The host validates account bindings and creates the matching storage facade.
46
- try: () => run(context, input),
47
- catch: (error) => error
48
- })
49
- });
50
- var query = (options, run) => make("query", options, run);
51
- var mutation = (options, run) => make("mutation", options, run);
52
-
53
- export {
54
- operationDeclaration,
55
- nativeOperation,
56
- withApproval,
57
- query,
58
- mutation
59
- };
@@ -1,28 +0,0 @@
1
- import {
2
- operationDeclaration
3
- } from "./chunk-C24KEZXR.js";
4
-
5
- // src/implementation/protocol-operations.ts
6
- var protocolOperations = (operations, kinds = {}) => {
7
- const queries = {};
8
- const mutations = {};
9
- for (const [name, operation] of Object.entries(operations)) {
10
- const kind = Object.hasOwn(kinds, name) ? kinds[name] : operation.readOnly === true ? "query" : "mutation";
11
- const native = {
12
- description: operation.description,
13
- ...operation.title === void 0 ? {} : { title: operation.title },
14
- ...operation.annotations === void 0 ? {} : { annotations: operation.annotations },
15
- ...operation._meta === void 0 ? {} : { _meta: operation._meta },
16
- input: operation.input,
17
- ...operation.outputSchema === void 0 ? {} : { outputSchema: operation.outputSchema },
18
- run: operation.run
19
- };
20
- if (kind === "query") queries[name] = operationDeclaration({ ...native, kind });
21
- else mutations[name] = operationDeclaration({ ...native, kind: "mutation" });
22
- }
23
- return { queries, mutations };
24
- };
25
-
26
- export {
27
- protocolOperations
28
- };
@@ -1,9 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name in all)
4
- __defProp(target, name, { get: all[name], enumerable: true });
5
- };
6
-
7
- export {
8
- __export
9
- };
@@ -1,32 +0,0 @@
1
- import type { OperationContext } from "../contracts/operations.js";
2
- import { type JsonValue } from "../contracts/schema.js";
3
- import { type Operation } from "./operations.js";
4
- type Operations = {
5
- readonly queries: Readonly<Record<string, Operation<JsonValue, unknown, "query", OperationContext>>>;
6
- readonly mutations: Readonly<Record<string, Operation<JsonValue, unknown, "mutation", OperationContext>>>;
7
- };
8
- /**
9
- * Discover each selected account's protocol operations and combine matching names.
10
- * Calls take { accountId, input }; each branch retains its account's input schema,
11
- * credentials, approval and output validation. Empty selections expose no operations.
12
- * Discovery is sequential and cancellation follows the caller's signal.
13
- */
14
- export declare const accountOperations: <Account extends {
15
- readonly id: string;
16
- }>(accounts: readonly Account[], discover: (account: Account) => Promise<Operations>, options: {
17
- readonly signal: AbortSignal;
18
- }) => Promise<{
19
- queries: {
20
- [k: string]: Operation<{
21
- readonly accountId: string;
22
- readonly input: unknown;
23
- }, unknown, "query", import("../index.js").AppContext>;
24
- };
25
- mutations: {
26
- [k: string]: Operation<{
27
- readonly accountId: string;
28
- readonly input: unknown;
29
- }, unknown, "mutation", import("../index.js").AppContext>;
30
- };
31
- }>;
32
- export {};