apps 0.0.1-beta.68 → 0.0.1-beta.69

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 (36) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/{chunk-L7ZC6JR4.js → chunk-3R3KFCDU.js} +172 -12
  3. package/js/{chunk-4733J7FG.js → chunk-7LMU3ER3.js} +23 -0
  4. package/js/{chunk-ACJPBBNH.js → chunk-CXDAEGXB.js} +3 -3
  5. package/js/{chunk-3K5SX2M6.js → chunk-CY4MT7PI.js} +5 -5
  6. package/js/{chunk-6JN66722.js → chunk-DZN5TQ53.js} +33 -15
  7. package/js/{chunk-YAOYLBKS.js → chunk-ECCWT5GJ.js} +2 -2
  8. package/js/{chunk-XUG423KM.js → chunk-FZB6D6ZD.js} +4 -4
  9. package/js/{chunk-6MJUPGMI.js → chunk-GJSNQSR7.js} +2 -2
  10. package/js/{chunk-M3IIZDHH.js → chunk-JW5LYSER.js} +92 -3
  11. package/js/{chunk-UD4RXDWG.js → chunk-MHB7IFG7.js} +1 -1
  12. package/js/{chunk-C47A664A.js → chunk-RUP4JMKO.js} +1 -1
  13. package/js/{chunk-2KVS7XBO.js → chunk-ZEJ3IKEC.js} +2 -2
  14. package/js/{chunk-JGLXI6SU.js → chunk-ZR7QAG67.js} +1 -1
  15. package/js/contracts.js +34 -2
  16. package/js/effect.js +9 -9
  17. package/js/graphql.js +11 -11
  18. package/js/host.js +9 -9
  19. package/js/index.js +59 -12
  20. package/js/mcp/effect.js +11 -11
  21. package/js/mcp/stdio.js +11 -11
  22. package/js/mcp.js +13 -13
  23. package/js/openapi.js +7 -7
  24. package/js/skills.js +5 -5
  25. package/package.json +1 -1
  26. package/runtime.json +1 -1
  27. package/types/apps/src/contracts/host.d.ts +600 -2
  28. package/types/apps/src/contracts/network.d.ts +36 -0
  29. package/types/apps/src/contracts/placement.d.ts +102 -0
  30. package/types/apps/src/contracts/protocol-version.d.ts +1 -1
  31. package/types/apps/src/contracts/protocols/current.d.ts +1368 -2
  32. package/types/apps/src/contracts/provider.d.ts +25 -0
  33. package/types/apps/src/implementation/openapi-compile.d.ts +3 -3
  34. package/types/apps/src/implementation/placement.d.ts +60 -0
  35. package/types/apps/src/implementation/provider.d.ts +8 -2
  36. package/types/apps/src/index.d.ts +27 -3
@@ -6,7 +6,7 @@ import {
6
6
  FailureName,
7
7
  ProviderError,
8
8
  UpstreamError
9
- } from "./chunk-4733J7FG.js";
9
+ } from "./chunk-7LMU3ER3.js";
10
10
  import {
11
11
  AppSkillName,
12
12
  AppSkills
@@ -23,6 +23,7 @@ import {
23
23
  import {
24
24
  Any,
25
25
  ArraySchema,
26
+ Base64_exports,
26
27
  Boolean,
27
28
  Class2 as Class,
28
29
  Context_exports,
@@ -2028,6 +2029,63 @@ var EmittedEvents = Schema_exports.Array(EmittedEvent).check(
2028
2029
  Schema_exports.isMaxLength(defaultEventLimits.maxEventsPerInvocation)
2029
2030
  );
2030
2031
 
2032
+ // src/contracts/placement.ts
2033
+ var PlacementField = Schema_exports.Struct({ field: Schema_exports.NonEmptyString });
2034
+ var PlacementText = Schema_exports.Union([Schema_exports.String, PlacementField]);
2035
+ var PlacementBase64 = Schema_exports.Struct({
2036
+ base64: Schema_exports.Array(PlacementText).check(Schema_exports.isMinLength(1))
2037
+ });
2038
+ var PlacementPart = Schema_exports.Union([Schema_exports.String, PlacementField, PlacementBase64]);
2039
+ var template = Schema_exports.Array(PlacementPart).check(Schema_exports.isMinLength(1));
2040
+ var PlacementHeaderName = Schema_exports.String.check(
2041
+ Schema_exports.isPattern(/^[!#$%&'*+.^_`|~0-9a-z-]+$/u)
2042
+ );
2043
+ var Placement = Schema_exports.Union([
2044
+ Schema_exports.Struct({ in: Schema_exports.Literal("header"), name: PlacementHeaderName, value: template }),
2045
+ Schema_exports.Struct({ in: Schema_exports.Literal("query"), name: Schema_exports.NonEmptyString, value: template })
2046
+ ]);
2047
+ var Placements = Schema_exports.Array(Placement);
2048
+ var isPlacementField = (part) => typeof part === "object" && "field" in part;
2049
+ var placementFields = (placement) => new Set(
2050
+ placement.value.flatMap(
2051
+ (part) => typeof part === "string" ? [] : isPlacementField(part) ? [part.field] : part.base64.flatMap((text) => typeof text === "string" ? [] : [text.field])
2052
+ )
2053
+ );
2054
+ var canonical = Schema_exports.encodeSync(Schema_exports.fromJsonString(Placement));
2055
+ var placementKey = (placement) => canonical(placement);
2056
+ var normalizePlacements = (placements) => [...new Map(placements.map((placement) => [placementKey(placement), placement])).entries()].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([, placement]) => placement);
2057
+ var PlacementFieldMissing = class extends Schema_exports.TaggedError()(
2058
+ "PlacementFieldMissing",
2059
+ { field: Schema_exports.String }
2060
+ ) {
2061
+ get message() {
2062
+ return `The credential placement references the account field "${this.field}", which has no string value.`;
2063
+ }
2064
+ };
2065
+ var renderPlacement = (placement, fields) => {
2066
+ const text = (parts) => {
2067
+ let rendered2 = "";
2068
+ for (const part of parts) {
2069
+ if (typeof part === "string") {
2070
+ rendered2 += part;
2071
+ continue;
2072
+ }
2073
+ const value = Object.hasOwn(fields, part.field) ? fields[part.field] : void 0;
2074
+ if (typeof value !== "string")
2075
+ return Result_exports.fail(new PlacementFieldMissing({ field: part.field }));
2076
+ rendered2 += value;
2077
+ }
2078
+ return Result_exports.succeed(rendered2);
2079
+ };
2080
+ let rendered = "";
2081
+ for (const part of placement.value) {
2082
+ const value = typeof part === "string" || isPlacementField(part) ? text([part]) : Result_exports.map(text(part.base64), (inner) => Base64_exports.encode(inner));
2083
+ if (Result_exports.isFailure(value)) return value;
2084
+ rendered += value.success;
2085
+ }
2086
+ return Result_exports.succeed(rendered);
2087
+ };
2088
+
2031
2089
  // src/contracts/provider.ts
2032
2090
  var SecretsMethod = class extends Data_exports.TaggedClass(
2033
2091
  "secrets"
@@ -2184,7 +2242,7 @@ var ManyAccounts = class extends Data_exports.TaggedClass("many") {
2184
2242
  };
2185
2243
 
2186
2244
  // src/contracts/protocol-version.ts
2187
- var frameworkProtocol = 11;
2245
+ var frameworkProtocol = 12;
2188
2246
 
2189
2247
  // src/contracts/protocols/oauth.ts
2190
2248
  var HttpUrl2 = Schema_exports.String.check(
@@ -3799,7 +3857,14 @@ var exposure2 = {
3799
3857
  /** Not secret: app code reads the real value and forms show it. */
3800
3858
  plain: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
3801
3859
  /** Secret, but app code reads the real value, for signing and similar uses. */
3802
- raw: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString))
3860
+ raw: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
3861
+ /**
3862
+ * The only places the outbound network substitutes this method's secret fields: whole header
3863
+ * values and query parameters, each an exact template. Part of the provider's identity. In an
3864
+ * invocation, an account's provider carries the placements granted to that account, which can
3865
+ * be narrower than the app's declaration.
3866
+ */
3867
+ request: Schema_exports.optionalKey(Placements)
3803
3868
  };
3804
3869
  var DeclaredAuthMethod4 = Schema_exports.Union([
3805
3870
  Schema_exports.Struct({
@@ -4120,6 +4185,14 @@ var current = {
4120
4185
  };
4121
4186
 
4122
4187
  // src/contracts/host.ts
4188
+ var HostAccount = Schema_exports.Struct({
4189
+ ...ResolvedAccount4.fields,
4190
+ managed: Schema_exports.optionalKey(Schema_exports.Literal(true))
4191
+ });
4192
+ var HostAccounts = Schema_exports.Record(
4193
+ Schema_exports.NonEmptyString,
4194
+ Schema_exports.Union([HostAccount, Schema_exports.Array(HostAccount)])
4195
+ );
4123
4196
  var skillsCommand = (sources) => sources ? { operation: "skills", sources: true } : { operation: "skills" };
4124
4197
  var skillCatalog = (response) => Schema_exports.is(SkillSources3)(response) ? response : { skills: response };
4125
4198
  var inspectCommand = (tools, scheduled) => ({
@@ -4191,6 +4264,7 @@ export {
4191
4264
  SecretsMethod,
4192
4265
  OAuthClientAuth,
4193
4266
  OAuthSecretClientAuth,
4267
+ OAuthAuthorizationParams,
4194
4268
  OAuthTokenRequestFormat,
4195
4269
  OAuthTokenResponse,
4196
4270
  OAuth2Config,
@@ -4200,6 +4274,19 @@ export {
4200
4274
  AccountCheckResult,
4201
4275
  Provider,
4202
4276
  ManyAccounts,
4277
+ PlacementField,
4278
+ PlacementText,
4279
+ PlacementBase64,
4280
+ PlacementPart,
4281
+ PlacementHeaderName,
4282
+ Placement,
4283
+ Placements,
4284
+ isPlacementField,
4285
+ placementFields,
4286
+ placementKey,
4287
+ normalizePlacements,
4288
+ PlacementFieldMissing,
4289
+ renderPlacement,
4203
4290
  maxApiErrorInstructionsLength,
4204
4291
  ApiErrorRecovery,
4205
4292
  maxApiErrorMessageLength,
@@ -4328,6 +4415,8 @@ export {
4328
4415
  HostResponse6 as HostResponse,
4329
4416
  HostInvocation7 as HostInvocation,
4330
4417
  current,
4418
+ HostAccount,
4419
+ HostAccounts,
4331
4420
  skillsCommand,
4332
4421
  skillCatalog,
4333
4422
  inspectCommand,
@@ -5,7 +5,7 @@ import {
5
5
  networkRefusalHeader,
6
6
  networkRefusalStatus,
7
7
  supportedFetchOptions
8
- } from "./chunk-4733J7FG.js";
8
+ } from "./chunk-7LMU3ER3.js";
9
9
  import {
10
10
  invocationFetch
11
11
  } from "./chunk-3CVQ3VPP.js";
@@ -3,7 +3,7 @@ import {
3
3
  CacheEntry,
4
4
  CacheError,
5
5
  cacheLimits
6
- } from "./chunk-4733J7FG.js";
6
+ } from "./chunk-7LMU3ER3.js";
7
7
  import {
8
8
  Clock_exports,
9
9
  Duration_exports,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  fromPromise
3
- } from "./chunk-JGLXI6SU.js";
3
+ } from "./chunk-ZR7QAG67.js";
4
4
  import {
5
5
  HostedTool,
6
6
  RouterKey,
7
7
  RouterMeta,
8
8
  reservedRouterKeys
9
- } from "./chunk-M3IIZDHH.js";
9
+ } from "./chunk-JW5LYSER.js";
10
10
  import {
11
11
  decoderOf,
12
12
  schemaArgument
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ProviderError,
3
3
  maxUpstreamMessageLength
4
- } from "./chunk-4733J7FG.js";
4
+ } from "./chunk-7LMU3ER3.js";
5
5
  import {
6
6
  owned
7
7
  } from "./chunk-3CVQ3VPP.js";
package/js/contracts.js CHANGED
@@ -24,7 +24,9 @@ import {
24
24
  EventLimits,
25
25
  EventName,
26
26
  FormElicitation,
27
+ HostAccount,
27
28
  HostAccountCheckError,
29
+ HostAccounts,
28
30
  HostAccountsInvalid,
29
31
  HostCallError,
30
32
  HostDataError,
@@ -66,12 +68,21 @@ import {
66
68
  MigrateCommand,
67
69
  MigrateResult,
68
70
  NonRetryableError,
71
+ OAuthAuthorizationParams,
69
72
  OAuthClientAuth,
70
73
  OAuthSecretClientAuth,
71
74
  OAuthTokenRequestFormat,
72
75
  OAuthTokenResponse,
73
76
  OpenapiResponseError,
74
77
  OperationSchedule,
78
+ Placement,
79
+ PlacementBase64,
80
+ PlacementField,
81
+ PlacementFieldMissing,
82
+ PlacementHeaderName,
83
+ PlacementPart,
84
+ PlacementText,
85
+ Placements,
75
86
  ResolvedAccount,
76
87
  ResolvedAccounts,
77
88
  RouterIcon,
@@ -111,10 +122,14 @@ import {
111
122
  frameworkProtocol,
112
123
  indexCommand,
113
124
  inspectCommand,
125
+ isPlacementField,
114
126
  maxApiErrorInstructionsLength,
115
127
  maxApiErrorMessageLength,
116
128
  maxInputProblems,
117
129
  minimumIntervalMilliseconds,
130
+ normalizePlacements,
131
+ placementFields,
132
+ placementKey,
118
133
  protocol1,
119
134
  protocol10,
120
135
  protocol2,
@@ -125,11 +140,12 @@ import {
125
140
  protocol7,
126
141
  protocol8,
127
142
  protocol9,
143
+ renderPlacement,
128
144
  selectTools,
129
145
  skillCatalog,
130
146
  skillsCommand,
131
147
  workflowDurationMillis
132
- } from "./chunk-M3IIZDHH.js";
148
+ } from "./chunk-JW5LYSER.js";
133
149
  import {
134
150
  FailureCode,
135
151
  FailureDetail,
@@ -152,7 +168,7 @@ import {
152
168
  networkRefusalHeader,
153
169
  networkRefusalResponse,
154
170
  networkRefusalStatus
155
- } from "./chunk-4733J7FG.js";
171
+ } from "./chunk-7LMU3ER3.js";
156
172
  import {
157
173
  AppSkillMetadata,
158
174
  AppSkillName,
@@ -215,7 +231,9 @@ export {
215
231
  FailureSource,
216
232
  FetchOptionUnsupported,
217
233
  FormElicitation,
234
+ HostAccount,
218
235
  HostAccountCheckError,
236
+ HostAccounts,
219
237
  HostAccountsInvalid,
220
238
  HostCallError,
221
239
  HostDataError,
@@ -260,12 +278,21 @@ export {
260
278
  NetworkRefusal,
261
279
  NetworkRefused,
262
280
  NonRetryableError,
281
+ OAuthAuthorizationParams,
263
282
  OAuthClientAuth,
264
283
  OAuthSecretClientAuth,
265
284
  OAuthTokenRequestFormat,
266
285
  OAuthTokenResponse,
267
286
  OpenapiResponseError,
268
287
  OperationSchedule,
288
+ Placement,
289
+ PlacementBase64,
290
+ PlacementField,
291
+ PlacementFieldMissing,
292
+ PlacementHeaderName,
293
+ PlacementPart,
294
+ PlacementText,
295
+ Placements,
269
296
  ProviderError,
270
297
  ResolvedAccount,
271
298
  ResolvedAccounts,
@@ -310,6 +337,7 @@ export {
310
337
  frameworkProtocol,
311
338
  indexCommand,
312
339
  inspectCommand,
340
+ isPlacementField,
313
341
  maxApiErrorInstructionsLength,
314
342
  maxApiErrorMessageLength,
315
343
  maxFailureFieldLength,
@@ -321,6 +349,9 @@ export {
321
349
  networkRefusalHeader,
322
350
  networkRefusalResponse,
323
351
  networkRefusalStatus,
352
+ normalizePlacements,
353
+ placementFields,
354
+ placementKey,
324
355
  protocol1,
325
356
  protocol10,
326
357
  current as protocol11,
@@ -332,6 +363,7 @@ export {
332
363
  protocol7,
333
364
  protocol8,
334
365
  protocol9,
366
+ renderPlacement,
335
367
  selectTools,
336
368
  skillCatalog,
337
369
  skillFormatLimits,
package/js/effect.js CHANGED
@@ -3,18 +3,18 @@ import {
3
3
  ApprovalDecision,
4
4
  createAppHandler,
5
5
  prepareElicitation
6
- } from "./chunk-6JN66722.js";
7
- import "./chunk-C47A664A.js";
8
- import "./chunk-XUG423KM.js";
9
- import "./chunk-UD4RXDWG.js";
6
+ } from "./chunk-DZN5TQ53.js";
7
+ import "./chunk-RUP4JMKO.js";
8
+ import "./chunk-FZB6D6ZD.js";
9
+ import "./chunk-MHB7IFG7.js";
10
10
  import "./chunk-XBG7HHXC.js";
11
- import "./chunk-L7ZC6JR4.js";
12
- import "./chunk-2KVS7XBO.js";
13
- import "./chunk-JGLXI6SU.js";
11
+ import "./chunk-3R3KFCDU.js";
12
+ import "./chunk-ZEJ3IKEC.js";
13
+ import "./chunk-ZR7QAG67.js";
14
14
  import {
15
15
  ToolAnnotations
16
- } from "./chunk-M3IIZDHH.js";
17
- import "./chunk-4733J7FG.js";
16
+ } from "./chunk-JW5LYSER.js";
17
+ import "./chunk-7LMU3ER3.js";
18
18
  import "./chunk-H72MEDMN.js";
19
19
  import {
20
20
  compileJsonSchemaDecoder,
package/js/graphql.js CHANGED
@@ -1,35 +1,35 @@
1
1
  import {
2
2
  catalogCache,
3
3
  catalogScope
4
- } from "./chunk-YAOYLBKS.js";
4
+ } from "./chunk-ECCWT5GJ.js";
5
5
  import {
6
6
  protocolOperations
7
- } from "./chunk-6MJUPGMI.js";
7
+ } from "./chunk-GJSNQSR7.js";
8
8
  import "./chunk-BCSNKUAC.js";
9
- import "./chunk-6JN66722.js";
9
+ import "./chunk-DZN5TQ53.js";
10
10
  import {
11
11
  cacheKey
12
- } from "./chunk-C47A664A.js";
13
- import "./chunk-XUG423KM.js";
12
+ } from "./chunk-RUP4JMKO.js";
13
+ import "./chunk-FZB6D6ZD.js";
14
14
  import {
15
15
  failOnNetworkRefusal
16
- } from "./chunk-UD4RXDWG.js";
16
+ } from "./chunk-MHB7IFG7.js";
17
17
  import "./chunk-XBG7HHXC.js";
18
- import "./chunk-L7ZC6JR4.js";
18
+ import "./chunk-3R3KFCDU.js";
19
19
  import {
20
20
  nativeOperation,
21
21
  routerDeclaration
22
- } from "./chunk-2KVS7XBO.js";
22
+ } from "./chunk-ZEJ3IKEC.js";
23
23
  import {
24
24
  accountProviderError,
25
25
  graphqlProviderError,
26
26
  httpProviderError
27
- } from "./chunk-JGLXI6SU.js";
28
- import "./chunk-M3IIZDHH.js";
27
+ } from "./chunk-ZR7QAG67.js";
28
+ import "./chunk-JW5LYSER.js";
29
29
  import {
30
30
  NetworkRefused,
31
31
  ProviderError
32
- } from "./chunk-4733J7FG.js";
32
+ } from "./chunk-7LMU3ER3.js";
33
33
  import "./chunk-H72MEDMN.js";
34
34
  import {
35
35
  jsonSchemaDecoder
package/js/host.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createAppHandler
3
- } from "./chunk-6JN66722.js";
4
- import "./chunk-C47A664A.js";
5
- import "./chunk-XUG423KM.js";
6
- import "./chunk-UD4RXDWG.js";
3
+ } from "./chunk-DZN5TQ53.js";
4
+ import "./chunk-RUP4JMKO.js";
5
+ import "./chunk-FZB6D6ZD.js";
6
+ import "./chunk-MHB7IFG7.js";
7
7
  import "./chunk-XBG7HHXC.js";
8
- import "./chunk-L7ZC6JR4.js";
9
- import "./chunk-2KVS7XBO.js";
10
- import "./chunk-JGLXI6SU.js";
8
+ import "./chunk-3R3KFCDU.js";
9
+ import "./chunk-ZEJ3IKEC.js";
10
+ import "./chunk-ZR7QAG67.js";
11
11
  import {
12
12
  ElicitationFailed,
13
13
  ElicitationReply,
@@ -22,12 +22,12 @@ import {
22
22
  WorkflowRun,
23
23
  WorkflowRunId,
24
24
  WorkflowRunPage
25
- } from "./chunk-M3IIZDHH.js";
25
+ } from "./chunk-JW5LYSER.js";
26
26
  import {
27
27
  CacheCommand,
28
28
  CacheError,
29
29
  CacheReply
30
- } from "./chunk-4733J7FG.js";
30
+ } from "./chunk-7LMU3ER3.js";
31
31
  import "./chunk-H72MEDMN.js";
32
32
  import "./chunk-KGCTYL2S.js";
33
33
  import {
package/js/index.js CHANGED
@@ -1,27 +1,34 @@
1
1
  import {
2
2
  ResponseDecodeError,
3
3
  ResponseStatusError,
4
+ base64,
5
+ basic,
6
+ bearer,
7
+ declarePlacements,
4
8
  defineApp,
5
9
  event,
10
+ header,
11
+ query,
12
+ t,
6
13
  workflow
7
- } from "./chunk-L7ZC6JR4.js";
14
+ } from "./chunk-3R3KFCDU.js";
8
15
  import {
9
16
  dynamicRouter,
10
17
  mutation,
11
18
  nativeOperation,
12
19
  nativeRouter,
13
20
  operationDeclaration,
14
- query,
21
+ query as query2,
15
22
  router,
16
23
  routerDeclaration,
17
24
  toolAnnotations,
18
25
  withApproval,
19
26
  withApprovals
20
- } from "./chunk-2KVS7XBO.js";
27
+ } from "./chunk-ZEJ3IKEC.js";
21
28
  import {
22
29
  accountProviderError,
23
30
  fromPromise
24
- } from "./chunk-JGLXI6SU.js";
31
+ } from "./chunk-ZR7QAG67.js";
25
32
  import {
26
33
  CalendarSchedule,
27
34
  ElicitationFailed,
@@ -36,13 +43,13 @@ import {
36
43
  ScheduleTiming,
37
44
  SecretsMethod,
38
45
  WorkflowFailure
39
- } from "./chunk-M3IIZDHH.js";
46
+ } from "./chunk-JW5LYSER.js";
40
47
  import {
41
48
  CacheError,
42
49
  FetchOptionUnsupported,
43
50
  NetworkRefused,
44
51
  ProviderError
45
- } from "./chunk-4733J7FG.js";
52
+ } from "./chunk-7LMU3ER3.js";
46
53
  import "./chunk-H72MEDMN.js";
47
54
  import {
48
55
  array,
@@ -93,15 +100,25 @@ var decodeJson = (response, schema) => Effect_exports.gen(function* () {
93
100
 
94
101
  // src/implementation/provider.ts
95
102
  var secrets = (options) => new SecretsMethod(options);
96
- var oauth2 = (config, response, exposure) => parse(OAuth2Config, config).pipe(
103
+ var oauth2 = (config, response, exposure, request) => parse(OAuth2Config, config).pipe(
97
104
  Effect_exports.map(
98
- (config2) => new OAuth2Method({ config: config2, response, ...exposure === void 0 ? {} : { exposure } })
105
+ (config2) => new OAuth2Method({
106
+ config: config2,
107
+ response,
108
+ ...exposure === void 0 ? {} : { exposure },
109
+ ...request === void 0 ? {} : { request }
110
+ })
99
111
  )
100
112
  );
101
113
  var defineProvider = ({
102
114
  health,
103
115
  ...options
104
116
  }) => {
117
+ const placed = Object.entries(options.auth).filter(([, method]) => method.request !== void 0);
118
+ if (options.hosts === void 0 && placed.length > 0)
119
+ throw new TypeError(
120
+ `Provider "${options.name}" declares a request for ${placed.map(([name]) => name).join(", ")} but no hosts. Declare the hosts its credentials may be sent to.`
121
+ );
105
122
  if (health === void 0) return new Provider(options);
106
123
  const run = fromPromise(health, "check");
107
124
  return new Provider({ ...options, health: { run } });
@@ -392,16 +409,37 @@ var exposureOf = (schema) => {
392
409
  const marked = "fields" in schema && isFields(schema.fields) ? fieldExposure(schema.fields) : {};
393
410
  return Object.keys(marked).length === 0 ? {} : { exposure: marked };
394
411
  };
412
+ var fieldNames = (schema) => "fields" in schema && isFields(schema.fields) ? Object.keys(schema.fields) : schema === OAuth2AccessToken2 ? ["access_token"] : [];
413
+ var placementsOf = (method, schema, request) => request === void 0 ? {} : {
414
+ request: declarePlacements(
415
+ method,
416
+ fieldNames(schema),
417
+ exposureOf(schema).exposure,
418
+ request
419
+ )
420
+ };
395
421
  var OAuth2AccessToken2 = wrap(OAuth2AccessToken, false);
396
422
  var secrets2 = (options) => secrets({
397
423
  label: options.label,
398
424
  fields: accountDecoder(options.fields),
399
- ...exposureOf(options.fields)
425
+ ...exposureOf(options.fields),
426
+ // SAFETY: the callback receives references named by the schema's own keys.
427
+ ...placementsOf(
428
+ `"${options.label}"`,
429
+ options.fields,
430
+ options.request
431
+ )
400
432
  });
401
433
  function oauth22(options) {
402
- const { response = OAuth2AccessToken2, ...config } = options;
434
+ const { response = OAuth2AccessToken2, request, ...config } = options;
403
435
  return Effect_exports.runSync(
404
- oauth2(config, accountDecoder(response), exposureOf(response).exposure)
436
+ oauth2(
437
+ config,
438
+ accountDecoder(response),
439
+ exposureOf(response).exposure,
440
+ // SAFETY: the callback receives references named by the response projection's own keys.
441
+ placementsOf("OAuth", response, request).request
442
+ )
405
443
  );
406
444
  }
407
445
  var decodeJson2 = (response, schema) => {
@@ -421,6 +459,10 @@ var decodeJson2 = (response, schema) => {
421
459
  };
422
460
  return Effect_exports.runPromise(decodeJson(native, decoderOf(schema)));
423
461
  };
462
+ function query3(first, second) {
463
+ if (typeof first === "string") return query(first, second);
464
+ return query2(...[first, second]);
465
+ }
424
466
  export {
425
467
  CacheError,
426
468
  ElicitationFailed,
@@ -436,6 +478,9 @@ export {
436
478
  WorkflowFailure,
437
479
  accountRouter,
438
480
  array,
481
+ base64,
482
+ basic,
483
+ bearer,
439
484
  boolean,
440
485
  cron,
441
486
  decodeJson2 as decodeJson,
@@ -444,6 +489,7 @@ export {
444
489
  dynamicRouter,
445
490
  dynamicSkills,
446
491
  event,
492
+ header,
447
493
  interval,
448
494
  json,
449
495
  jsonSchema,
@@ -453,12 +499,13 @@ export {
453
499
  oauth22 as oauth2,
454
500
  object,
455
501
  plain,
456
- query,
502
+ query3 as query,
457
503
  raw,
458
504
  record,
459
505
  router,
460
506
  secrets2 as secrets,
461
507
  string,
508
+ t,
462
509
  toolAnnotations,
463
510
  withApproval,
464
511
  withApprovals,
package/js/mcp/effect.js CHANGED
@@ -2,19 +2,19 @@ import {
2
2
  mcpClientEffect,
3
3
  mcpHealthEffect,
4
4
  mcpToolsEffect
5
- } from "../chunk-3K5SX2M6.js";
6
- import "../chunk-ACJPBBNH.js";
5
+ } from "../chunk-CY4MT7PI.js";
6
+ import "../chunk-CXDAEGXB.js";
7
7
  import "../chunk-BCSNKUAC.js";
8
- import "../chunk-6JN66722.js";
9
- import "../chunk-C47A664A.js";
10
- import "../chunk-XUG423KM.js";
11
- import "../chunk-UD4RXDWG.js";
8
+ import "../chunk-DZN5TQ53.js";
9
+ import "../chunk-RUP4JMKO.js";
10
+ import "../chunk-FZB6D6ZD.js";
11
+ import "../chunk-MHB7IFG7.js";
12
12
  import "../chunk-XBG7HHXC.js";
13
- import "../chunk-L7ZC6JR4.js";
14
- import "../chunk-2KVS7XBO.js";
15
- import "../chunk-JGLXI6SU.js";
16
- import "../chunk-M3IIZDHH.js";
17
- import "../chunk-4733J7FG.js";
13
+ import "../chunk-3R3KFCDU.js";
14
+ import "../chunk-ZEJ3IKEC.js";
15
+ import "../chunk-ZR7QAG67.js";
16
+ import "../chunk-JW5LYSER.js";
17
+ import "../chunk-7LMU3ER3.js";
18
18
  import "../chunk-H72MEDMN.js";
19
19
  import "../chunk-KGCTYL2S.js";
20
20
  import "../chunk-3CVQ3VPP.js";
package/js/mcp/stdio.js CHANGED
@@ -3,24 +3,24 @@ import {
3
3
  answeredError,
4
4
  mcpClient,
5
5
  mcpJsonSchemaValidator
6
- } from "../chunk-ACJPBBNH.js";
6
+ } from "../chunk-CXDAEGXB.js";
7
7
  import {
8
8
  protocolRouter
9
- } from "../chunk-6MJUPGMI.js";
9
+ } from "../chunk-GJSNQSR7.js";
10
10
  import "../chunk-BCSNKUAC.js";
11
- import "../chunk-6JN66722.js";
12
- import "../chunk-C47A664A.js";
13
- import "../chunk-XUG423KM.js";
14
- import "../chunk-UD4RXDWG.js";
11
+ import "../chunk-DZN5TQ53.js";
12
+ import "../chunk-RUP4JMKO.js";
13
+ import "../chunk-FZB6D6ZD.js";
14
+ import "../chunk-MHB7IFG7.js";
15
15
  import "../chunk-XBG7HHXC.js";
16
- import "../chunk-L7ZC6JR4.js";
17
- import "../chunk-2KVS7XBO.js";
18
- import "../chunk-JGLXI6SU.js";
16
+ import "../chunk-3R3KFCDU.js";
17
+ import "../chunk-ZEJ3IKEC.js";
18
+ import "../chunk-ZR7QAG67.js";
19
19
  import {
20
20
  McpError,
21
21
  ProcessConfig
22
- } from "../chunk-M3IIZDHH.js";
23
- import "../chunk-4733J7FG.js";
22
+ } from "../chunk-JW5LYSER.js";
23
+ import "../chunk-7LMU3ER3.js";
24
24
  import "../chunk-H72MEDMN.js";
25
25
  import "../chunk-KGCTYL2S.js";
26
26
  import {