apps 0.0.1-beta.13 → 0.0.1-beta.15

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 (32) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/{chunk-QS6CAHKC.js → chunk-4J3IQXFD.js} +2 -2
  3. package/js/{chunk-6HSH75OI.js → chunk-CL3O2NIN.js} +203 -13
  4. package/js/{chunk-G4FT53I7.js → chunk-GKHJITGG.js} +2 -2
  5. package/js/{chunk-S73JGVR5.js → chunk-H34RQANV.js} +2 -2
  6. package/js/{chunk-4DWF4ZWI.js → chunk-JAKBOQ5T.js} +4 -4
  7. package/js/{chunk-4ASNKGCV.js → chunk-O5G3NDEO.js} +2 -2
  8. package/js/chunk-OD3KFKZD.js +1617 -0
  9. package/js/{chunk-YPKG2QO5.js → chunk-SWXGYMUW.js} +1 -1
  10. package/js/{chunk-TG6DOCRO.js → chunk-YHLXXXKH.js} +3 -3
  11. package/js/contracts.js +3 -1
  12. package/js/effect.js +5 -5
  13. package/js/{es-APDZKREY.js → es-DIULA3ZF.js} +62 -1659
  14. package/js/graphql.js +6 -6
  15. package/js/host.js +5 -5
  16. package/js/index.js +3 -3
  17. package/js/mcp/effect.js +7 -7
  18. package/js/mcp/stdio.js +7 -7
  19. package/js/mcp.js +8 -8
  20. package/js/openapi.js +3282 -1088
  21. package/package.json +1 -1
  22. package/runtime.json +1 -1
  23. package/types/apps/src/contracts/host.d.ts +5 -4
  24. package/types/apps/src/contracts/protocol-version.d.ts +1 -1
  25. package/types/apps/src/contracts/protocols/6.d.ts +1620 -0
  26. package/types/apps/src/contracts/protocols/oauth.d.ts +89 -0
  27. package/types/apps/src/contracts/provider.d.ts +6 -0
  28. package/types/apps/src/implementation/openapi-compile.d.ts +5 -2
  29. package/types/apps/src/implementation/openapi-document.d.ts +15 -2
  30. package/types/apps/src/implementation/openapi-request.d.ts +8 -1
  31. package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
  32. package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  fixedRouter
3
- } from "./chunk-S73JGVR5.js";
3
+ } from "./chunk-H34RQANV.js";
4
4
  import {
5
5
  nativeOperation,
6
6
  operationDeclaration,
7
7
  routerDeclaration
8
- } from "./chunk-YPKG2QO5.js";
8
+ } from "./chunk-SWXGYMUW.js";
9
9
 
10
10
  // src/implementation/protocol-operations.ts
11
11
  var protocolOperations = (operations, kinds = {}) => {
@@ -1884,6 +1884,8 @@ var OAuth2Config = Schema_exports.Union([
1884
1884
  Schema_exports.Struct({
1885
1885
  ...oauthOptions,
1886
1886
  discover: HttpUrl,
1887
+ /** Fetch this exact metadata document and verify its issuer against discovery. */
1888
+ authorizationServerMetadataUrl: Schema_exports.optionalKey(HttpUrl),
1887
1889
  authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
1888
1890
  tokenUrl: Schema_exports.optionalKey(Schema_exports.Never),
1889
1891
  revocationUrl: Schema_exports.optionalKey(Schema_exports.Never),
@@ -1898,11 +1900,14 @@ var OAuth2Config = Schema_exports.Union([
1898
1900
  scopes: Schema_exports.Array(Schema_exports.String),
1899
1901
  /** RFC 8414 issuer identifier. Declared issuers are checked against the callback's `iss`. */
1900
1902
  issuer: Schema_exports.optionalKey(HttpUrl),
1901
- discover: Schema_exports.optionalKey(Schema_exports.Never)
1903
+ discover: Schema_exports.optionalKey(Schema_exports.Never),
1904
+ authorizationServerMetadataUrl: Schema_exports.optionalKey(Schema_exports.Never)
1902
1905
  }).check(declaredAuthorizationQuery),
1903
1906
  Schema_exports.Struct({
1904
1907
  grant: Schema_exports.Literal("client_credentials"),
1905
1908
  discover: HttpUrl,
1909
+ /** Fetch this exact metadata document and verify its issuer against discovery. */
1910
+ authorizationServerMetadataUrl: Schema_exports.optionalKey(HttpUrl),
1906
1911
  authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
1907
1912
  tokenUrl: Schema_exports.optionalKey(Schema_exports.Never),
1908
1913
  revocationUrl: Schema_exports.optionalKey(Schema_exports.Never),
@@ -1920,7 +1925,8 @@ var OAuth2Config = Schema_exports.Union([
1920
1925
  tokenEndpointAuthMethod: OAuthSecretClientAuth,
1921
1926
  resource: Schema_exports.optionalKey(Schema_exports.NullOr(HttpUrl)),
1922
1927
  authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
1923
- discover: Schema_exports.optionalKey(Schema_exports.Never)
1928
+ discover: Schema_exports.optionalKey(Schema_exports.Never),
1929
+ authorizationServerMetadataUrl: Schema_exports.optionalKey(Schema_exports.Never)
1924
1930
  })
1925
1931
  ]);
1926
1932
  var OAuth2AccessToken = Schema_exports.Struct({ access_token: Schema_exports.String });
@@ -1948,7 +1954,129 @@ var ManyAccounts = class extends Data_exports.TaggedClass("many") {
1948
1954
  };
1949
1955
 
1950
1956
  // src/contracts/protocol-version.ts
1951
- var frameworkProtocol = 5;
1957
+ var frameworkProtocol = 6;
1958
+
1959
+ // src/contracts/protocols/oauth.ts
1960
+ var OAuthClientAuth2 = Schema_exports.Literals([
1961
+ "none",
1962
+ "client_secret_post",
1963
+ "client_secret_basic",
1964
+ "client_secret_basic_raw"
1965
+ ]);
1966
+ var OAuthSecretClientAuth2 = Schema_exports.Literals([
1967
+ "client_secret_post",
1968
+ "client_secret_basic",
1969
+ "client_secret_basic_raw"
1970
+ ]);
1971
+ var reservedAuthorizationParams2 = [
1972
+ "response_type",
1973
+ "client_id",
1974
+ "redirect_uri",
1975
+ "state",
1976
+ "scope",
1977
+ "code_challenge",
1978
+ "code_challenge_method",
1979
+ "nonce",
1980
+ "resource",
1981
+ "request",
1982
+ "request_uri"
1983
+ ];
1984
+ var reserved2 = new Set(reservedAuthorizationParams2);
1985
+ var OAuthAuthorizationParams2 = Schema_exports.Record(Schema_exports.String, Schema_exports.String).check(
1986
+ Schema_exports.makeFilter((params) => Object.keys(params).every((key) => !reserved2.has(key)), {
1987
+ message: "Authorization parameters cannot replace protocol parameters such as state or scope."
1988
+ })
1989
+ );
1990
+ var declaredAuthorizationQuery2 = Schema_exports.makeFilter(
1991
+ (config) => {
1992
+ const keys = [...new URL(config.authorizationUrl).searchParams.keys()];
1993
+ const owned = keys.filter((key) => reserved2.has(key));
1994
+ if (owned.length > 0)
1995
+ return {
1996
+ path: ["authorizationUrl"],
1997
+ issue: `authorizationUrl cannot set protocol parameters: ${owned.join(", ")}.`
1998
+ };
1999
+ const repeated = keys.filter((key) => Object.hasOwn(config.authorizationParams ?? {}, key));
2000
+ if (repeated.length > 0)
2001
+ return {
2002
+ path: ["authorizationParams"],
2003
+ issue: `Declare each parameter once; authorizationUrl already sets: ${repeated.join(", ")}.`
2004
+ };
2005
+ return void 0;
2006
+ }
2007
+ );
2008
+ var OAuthTokenRequestFormat2 = Schema_exports.Literals(["form", "json"]);
2009
+ var OAuthTokenResponse2 = Schema_exports.Struct({
2010
+ path: Schema_exports.String.check(Schema_exports.isPattern(/^[^.]+(\.[^.]+)*$/))
2011
+ });
2012
+ var tokenRequestOptions2 = {
2013
+ /** Joins requested scopes; Linear wants `","`. Defaults to RFC 6749's space. */
2014
+ scopeSeparator: Schema_exports.optionalKey(Schema_exports.String.check(Schema_exports.isMinLength(1))),
2015
+ /** Encoding of token requests. Defaults to `"form"`; Atlassian, ClickUp and Notion need `"json"`. */
2016
+ tokenRequestFormat: Schema_exports.optionalKey(OAuthTokenRequestFormat2)
2017
+ };
2018
+ var oauthOptions2 = {
2019
+ ...tokenRequestOptions2,
2020
+ /**
2021
+ * Read the grant from this nested member of the token response when the top-level response has
2022
+ * no access token or no scope. Slack's user tokens use `{ path: "authed_user" }`.
2023
+ */
2024
+ tokenResponse: Schema_exports.optionalKey(OAuthTokenResponse2),
2025
+ grant: Schema_exports.optionalKey(Schema_exports.Literal("authorization_code")),
2026
+ /**
2027
+ * Service-defined authorization request parameters, such as Google's
2028
+ * `{ access_type: "offline", prompt: "consent" }`. Host-owned protocol parameters
2029
+ * (`state`, `scope`, `redirect_uri`, PKCE and the others in `reservedAuthorizationParams`)
2030
+ * are rejected. A discovered endpoint's own query parameter of the same name is replaced.
2031
+ */
2032
+ authorizationParams: Schema_exports.optionalKey(OAuthAuthorizationParams2),
2033
+ tokenEndpointAuthMethod: Schema_exports.optionalKey(OAuthClientAuth2),
2034
+ /** Omitted uses discovery; null explicitly suppresses the resource parameter. */
2035
+ resource: Schema_exports.optionalKey(Schema_exports.NullOr(HttpUrl))
2036
+ };
2037
+ var OAuth2Config2 = Schema_exports.Union([
2038
+ Schema_exports.Struct({
2039
+ ...oauthOptions2,
2040
+ discover: HttpUrl,
2041
+ authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
2042
+ tokenUrl: Schema_exports.optionalKey(Schema_exports.Never),
2043
+ revocationUrl: Schema_exports.optionalKey(Schema_exports.Never),
2044
+ scopes: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.String))
2045
+ }),
2046
+ Schema_exports.Struct({
2047
+ ...oauthOptions2,
2048
+ /** Its query is kept; it cannot set protocol parameters or repeat `authorizationParams`. */
2049
+ authorizationUrl: HttpUrl,
2050
+ tokenUrl: HttpUrl,
2051
+ revocationUrl: Schema_exports.optionalKey(HttpUrl),
2052
+ scopes: Schema_exports.Array(Schema_exports.String),
2053
+ /** RFC 8414 issuer identifier. Declared issuers are checked against the callback's `iss`. */
2054
+ issuer: Schema_exports.optionalKey(HttpUrl),
2055
+ discover: Schema_exports.optionalKey(Schema_exports.Never)
2056
+ }).check(declaredAuthorizationQuery2),
2057
+ Schema_exports.Struct({
2058
+ grant: Schema_exports.Literal("client_credentials"),
2059
+ discover: HttpUrl,
2060
+ authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
2061
+ tokenUrl: Schema_exports.optionalKey(Schema_exports.Never),
2062
+ revocationUrl: Schema_exports.optionalKey(Schema_exports.Never),
2063
+ scopes: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.String)),
2064
+ ...tokenRequestOptions2,
2065
+ tokenEndpointAuthMethod: OAuthSecretClientAuth2,
2066
+ resource: Schema_exports.optionalKey(Schema_exports.NullOr(HttpUrl))
2067
+ }),
2068
+ Schema_exports.Struct({
2069
+ grant: Schema_exports.Literal("client_credentials"),
2070
+ tokenUrl: HttpUrl,
2071
+ revocationUrl: Schema_exports.optionalKey(HttpUrl),
2072
+ scopes: Schema_exports.Array(Schema_exports.String),
2073
+ ...tokenRequestOptions2,
2074
+ tokenEndpointAuthMethod: OAuthSecretClientAuth2,
2075
+ resource: Schema_exports.optionalKey(Schema_exports.NullOr(HttpUrl)),
2076
+ authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
2077
+ discover: Schema_exports.optionalKey(Schema_exports.Never)
2078
+ })
2079
+ ]);
1952
2080
 
1953
2081
  // src/contracts/schedules.ts
1954
2082
  var minimumIntervalMilliseconds = 6e4;
@@ -2011,22 +2139,22 @@ var DeclaredAuthMethod = Schema_exports.Union([
2011
2139
  Schema_exports.Struct({ type: Schema_exports.Literal("secrets"), label: Schema_exports.String, fields: JsonObject2 }),
2012
2140
  Schema_exports.Struct({
2013
2141
  type: Schema_exports.Literal("oauth2"),
2014
- ...OAuth2Config.members[0].fields,
2142
+ ...OAuth2Config2.members[0].fields,
2015
2143
  response: JsonObject2
2016
2144
  }),
2017
2145
  Schema_exports.Struct({
2018
2146
  type: Schema_exports.Literal("oauth2"),
2019
- ...OAuth2Config.members[1].fields,
2147
+ ...OAuth2Config2.members[1].fields,
2020
2148
  response: JsonObject2
2021
2149
  }),
2022
2150
  Schema_exports.Struct({
2023
2151
  type: Schema_exports.Literal("oauth2"),
2024
- ...OAuth2Config.members[2].fields,
2152
+ ...OAuth2Config2.members[2].fields,
2025
2153
  response: JsonObject2
2026
2154
  }),
2027
2155
  Schema_exports.Struct({
2028
2156
  type: Schema_exports.Literal("oauth2"),
2029
- ...OAuth2Config.members[3].fields,
2157
+ ...OAuth2Config2.members[3].fields,
2030
2158
  response: JsonObject2
2031
2159
  })
2032
2160
  ]);
@@ -2499,6 +2627,67 @@ var protocol5 = {
2499
2627
  }
2500
2628
  };
2501
2629
 
2630
+ // src/contracts/protocols/6.ts
2631
+ var DeclaredAuthMethod2 = Schema_exports.Union([
2632
+ Schema_exports.Struct({ type: Schema_exports.Literal("secrets"), label: Schema_exports.String, fields: JsonObject2 }),
2633
+ Schema_exports.Struct({
2634
+ type: Schema_exports.Literal("oauth2"),
2635
+ ...OAuth2Config.members[0].fields,
2636
+ response: JsonObject2
2637
+ }),
2638
+ Schema_exports.Struct({
2639
+ type: Schema_exports.Literal("oauth2"),
2640
+ ...OAuth2Config.members[1].fields,
2641
+ response: JsonObject2
2642
+ }),
2643
+ Schema_exports.Struct({
2644
+ type: Schema_exports.Literal("oauth2"),
2645
+ ...OAuth2Config.members[2].fields,
2646
+ response: JsonObject2
2647
+ }),
2648
+ Schema_exports.Struct({
2649
+ type: Schema_exports.Literal("oauth2"),
2650
+ ...OAuth2Config.members[3].fields,
2651
+ response: JsonObject2
2652
+ })
2653
+ ]);
2654
+ var DeclaredProvider2 = Schema_exports.Struct({
2655
+ name: Schema_exports.NonEmptyString,
2656
+ auth: Schema_exports.Record(Schema_exports.NonEmptyString, DeclaredAuthMethod2)
2657
+ });
2658
+ var DeclaredRequirements3 = Schema_exports.Struct({
2659
+ ...DeclaredRequirements2.fields,
2660
+ accounts: Schema_exports.Record(
2661
+ Schema_exports.NonEmptyString,
2662
+ Schema_exports.Struct({
2663
+ definition: DeclaredProvider2,
2664
+ cardinality: Schema_exports.Literals(["one", "many"]),
2665
+ health: Schema_exports.optionalKey(Schema_exports.Literal(true))
2666
+ })
2667
+ )
2668
+ });
2669
+ var ResolvedAccount2 = Schema_exports.Struct({
2670
+ ...ResolvedAccount.fields,
2671
+ provider: DeclaredProvider2
2672
+ });
2673
+ var ResolvedAccounts2 = Schema_exports.Record(
2674
+ Schema_exports.NonEmptyString,
2675
+ Schema_exports.Union([ResolvedAccount2, Schema_exports.Array(ResolvedAccount2)])
2676
+ );
2677
+ var HostInvocation4 = Schema_exports.Struct({
2678
+ ...HostInvocation3.fields,
2679
+ accounts: ResolvedAccounts2
2680
+ });
2681
+ var protocol6 = {
2682
+ version: 6,
2683
+ schemas: {
2684
+ ...protocol5.schemas,
2685
+ requirements: DeclaredRequirements3,
2686
+ accounts: ResolvedAccounts2,
2687
+ invocation: HostInvocation4
2688
+ }
2689
+ };
2690
+
2502
2691
  // src/contracts/host.ts
2503
2692
  var skillsCommand = (sources) => sources ? { operation: "skills", sources: true } : { operation: "skills" };
2504
2693
  var skillCatalog = (response) => Schema_exports.is(SkillSources2)(response) ? response : { skills: response };
@@ -2634,10 +2823,6 @@ export {
2634
2823
  CalendarSchedule,
2635
2824
  ScheduleTiming,
2636
2825
  OperationSchedule,
2637
- DeclaredAuthMethod,
2638
- DeclaredProvider,
2639
- ResolvedAccount,
2640
- ResolvedAccounts,
2641
2826
  TrustedToolApproval,
2642
2827
  InvocationDeadline,
2643
2828
  HostRequestInvalid,
@@ -2669,11 +2854,16 @@ export {
2669
2854
  HostError3 as HostError,
2670
2855
  HostResponse3 as HostResponse,
2671
2856
  protocol4,
2672
- DeclaredRequirements2 as DeclaredRequirements,
2673
2857
  AccountCheckCommand,
2674
2858
  HostRequest3 as HostRequest,
2675
- HostInvocation3 as HostInvocation,
2676
2859
  protocol5,
2860
+ DeclaredAuthMethod2 as DeclaredAuthMethod,
2861
+ DeclaredProvider2 as DeclaredProvider,
2862
+ DeclaredRequirements3 as DeclaredRequirements,
2863
+ ResolvedAccount2 as ResolvedAccount,
2864
+ ResolvedAccounts2 as ResolvedAccounts,
2865
+ HostInvocation4 as HostInvocation,
2866
+ protocol6,
2677
2867
  skillsCommand,
2678
2868
  skillCatalog,
2679
2869
  inspectCommand,
@@ -2,7 +2,7 @@ import {
2
2
  adaptMcpTools,
3
3
  mcpClient,
4
4
  mcpJsonSchemaValidator
5
- } from "./chunk-TG6DOCRO.js";
5
+ } from "./chunk-YHLXXXKH.js";
6
6
  import {
7
7
  accountProviderError,
8
8
  httpProviderError
@@ -11,7 +11,7 @@ import {
11
11
  McpError,
12
12
  McpToolsOptions,
13
13
  defaultMcpClientLimits
14
- } from "./chunk-6HSH75OI.js";
14
+ } from "./chunk-CL3O2NIN.js";
15
15
  import {
16
16
  ProviderError
17
17
  } from "./chunk-R3EV5FTO.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  joinPath,
6
6
  mergeMeta
7
- } from "./chunk-YPKG2QO5.js";
7
+ } from "./chunk-SWXGYMUW.js";
8
8
  import {
9
9
  parseProviderError
10
10
  } from "./chunk-MKWZPDR6.js";
@@ -17,7 +17,7 @@ import {
17
17
  HostedToolSummary,
18
18
  McpError,
19
19
  maxFailureMessageLength
20
- } from "./chunk-6HSH75OI.js";
20
+ } from "./chunk-CL3O2NIN.js";
21
21
  import {
22
22
  AppDatabaseError
23
23
  } from "./chunk-N7YDVXYJ.js";
@@ -8,7 +8,7 @@ import {
8
8
  failureDetail,
9
9
  readCatalog,
10
10
  routerSkills
11
- } from "./chunk-S73JGVR5.js";
11
+ } from "./chunk-H34RQANV.js";
12
12
  import {
13
13
  folderSkillsEffect
14
14
  } from "./chunk-IPI4MFSN.js";
@@ -18,7 +18,7 @@ import {
18
18
  isApp,
19
19
  toEffectApp,
20
20
  unavailableStorage
21
- } from "./chunk-4ASNKGCV.js";
21
+ } from "./chunk-O5G3NDEO.js";
22
22
  import {
23
23
  parseDatabaseSchema
24
24
  } from "./chunk-ZQINWV4W.js";
@@ -28,7 +28,7 @@ import {
28
28
  locate,
29
29
  nativeOperation,
30
30
  toPromise
31
- } from "./chunk-YPKG2QO5.js";
31
+ } from "./chunk-SWXGYMUW.js";
32
32
  import {
33
33
  accountProviderError,
34
34
  httpProviderError,
@@ -81,7 +81,7 @@ import {
81
81
  defaultWebhookTransportLimits,
82
82
  maxInputProblems,
83
83
  workflowDurationMillis
84
- } from "./chunk-6HSH75OI.js";
84
+ } from "./chunk-CL3O2NIN.js";
85
85
  import {
86
86
  CacheError
87
87
  } from "./chunk-R3EV5FTO.js";
@@ -6,10 +6,10 @@ import {
6
6
  fromPromise,
7
7
  nativeOperation,
8
8
  nativeRouter
9
- } from "./chunk-YPKG2QO5.js";
9
+ } from "./chunk-SWXGYMUW.js";
10
10
  import {
11
11
  ScheduleTiming
12
- } from "./chunk-6HSH75OI.js";
12
+ } from "./chunk-CL3O2NIN.js";
13
13
  import {
14
14
  DatabaseSchema
15
15
  } from "./chunk-N7YDVXYJ.js";