@greatwait/contracts 0.1.0-alpha.5 → 0.1.0-alpha.6

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 (119) hide show
  1. package/dist/authority.d.ts +4 -1
  2. package/dist/authority.js +1 -0
  3. package/dist/data-export.d.ts +2 -0
  4. package/dist/delivery.d.ts +26 -0
  5. package/dist/delivery.js +2 -0
  6. package/dist/endpoints.d.ts +168 -0
  7. package/dist/endpoints.js +72 -1
  8. package/dist/http-request.d.ts +193 -0
  9. package/dist/http-request.js +305 -0
  10. package/dist/identity.d.ts +4 -4
  11. package/dist/index.d.ts +5 -3
  12. package/dist/index.js +4 -2
  13. package/dist/mcp.d.ts +2 -1
  14. package/dist/members.d.ts +141 -0
  15. package/dist/members.js +223 -0
  16. package/dist/oauth.d.ts +7 -0
  17. package/dist/operation-definitions.d.ts +20 -4
  18. package/dist/operation-definitions.js +9 -1
  19. package/dist/operations.d.ts +705 -39
  20. package/dist/operations.js +83 -10
  21. package/dist/organization-lifecycle.d.ts +10 -0
  22. package/dist/policy.js +5 -2
  23. package/dist/scheduling-records.d.ts +220 -0
  24. package/dist/scheduling-records.js +5 -0
  25. package/dist/scheduling.d.ts +236 -0
  26. package/dist/scheduling.js +31 -0
  27. package/dist/secrets.d.ts +7 -0
  28. package/dist/tenancy.d.ts +1 -1
  29. package/dist/tenancy.js +1 -1
  30. package/dist/zod-values.d.ts +2 -2
  31. package/dist/zod-values.js +1 -1
  32. package/generated/v1/examples/endpoints.ensure.request.json +3 -0
  33. package/generated/v1/examples/endpoints.ensure.response.json +20 -0
  34. package/generated/v1/examples/invitations.create.request.json +5 -0
  35. package/generated/v1/examples/invitations.create.response.json +7 -0
  36. package/generated/v1/examples/invitations.list.response.json +11 -0
  37. package/generated/v1/examples/invitations.resend.request.json +1 -0
  38. package/generated/v1/examples/invitations.resend.response.json +4 -0
  39. package/generated/v1/examples/invitations.revoke.request.json +3 -0
  40. package/generated/v1/examples/invitations.revoke.response.json +4 -0
  41. package/generated/v1/examples/members.list.response.json +13 -0
  42. package/generated/v1/examples/members.remove.request.json +3 -0
  43. package/generated/v1/examples/members.remove.response.json +4 -0
  44. package/generated/v1/examples/members.role.request.json +3 -0
  45. package/generated/v1/examples/members.role.response.json +4 -0
  46. package/generated/v1/examples/projectmembers.add.request.json +1 -0
  47. package/generated/v1/examples/projectmembers.add.response.json +4 -0
  48. package/generated/v1/examples/projectmembers.remove.request.json +3 -0
  49. package/generated/v1/examples/projectmembers.remove.response.json +4 -0
  50. package/generated/v1/manifest.json +285 -0
  51. package/generated/v1/openapi.json +8339 -773
  52. package/generated/v1/policy-matrix.json +72 -0
  53. package/generated/v1/schemas/context.read.response.json +1 -0
  54. package/generated/v1/schemas/credentials.connection.response.json +1 -0
  55. package/generated/v1/schemas/credentials.create.request.json +1 -0
  56. package/generated/v1/schemas/credentials.create.response.json +1 -0
  57. package/generated/v1/schemas/credentials.list.response.json +1 -0
  58. package/generated/v1/schemas/credentials.revoke.response.json +1 -0
  59. package/generated/v1/schemas/credentials.rotate.response.json +2 -0
  60. package/generated/v1/schemas/endpoints.acknowledgeSigningKeyRotation.response.json +59 -0
  61. package/generated/v1/schemas/endpoints.create.request.json +74 -0
  62. package/generated/v1/schemas/endpoints.create.response.json +59 -0
  63. package/generated/v1/schemas/endpoints.disable.response.json +59 -0
  64. package/generated/v1/schemas/endpoints.enable.response.json +59 -0
  65. package/generated/v1/schemas/endpoints.ensure.request.json +91 -0
  66. package/generated/v1/schemas/endpoints.ensure.response.json +169 -0
  67. package/generated/v1/schemas/endpoints.list.response.json +59 -0
  68. package/generated/v1/schemas/endpoints.read.response.json +59 -0
  69. package/generated/v1/schemas/endpoints.rotateSigningKey.response.json +59 -0
  70. package/generated/v1/schemas/endpoints.update.request.json +74 -0
  71. package/generated/v1/schemas/endpoints.update.response.json +59 -0
  72. package/generated/v1/schemas/grants.list.response.json +1 -0
  73. package/generated/v1/schemas/grants.revoke.response.json +1 -0
  74. package/generated/v1/schemas/invitations.create.request-headers.json +13 -0
  75. package/generated/v1/schemas/invitations.create.request.json +24 -0
  76. package/generated/v1/schemas/invitations.create.response.json +31 -0
  77. package/generated/v1/schemas/invitations.list.response.json +40 -0
  78. package/generated/v1/schemas/invitations.resend.request-headers.json +13 -0
  79. package/generated/v1/schemas/invitations.resend.request.json +6 -0
  80. package/generated/v1/schemas/invitations.resend.response.json +27 -0
  81. package/generated/v1/schemas/invitations.revoke.request-headers.json +13 -0
  82. package/generated/v1/schemas/invitations.revoke.request.json +12 -0
  83. package/generated/v1/schemas/invitations.revoke.response.json +27 -0
  84. package/generated/v1/schemas/members.list.response.json +53 -0
  85. package/generated/v1/schemas/members.remove.request-headers.json +13 -0
  86. package/generated/v1/schemas/members.remove.request.json +12 -0
  87. package/generated/v1/schemas/members.remove.response.json +27 -0
  88. package/generated/v1/schemas/members.role.request-headers.json +13 -0
  89. package/generated/v1/schemas/members.role.request.json +12 -0
  90. package/generated/v1/schemas/members.role.response.json +27 -0
  91. package/generated/v1/schemas/projectmembers.add.request-headers.json +13 -0
  92. package/generated/v1/schemas/projectmembers.add.request.json +6 -0
  93. package/generated/v1/schemas/projectmembers.add.response.json +27 -0
  94. package/generated/v1/schemas/projectmembers.remove.request-headers.json +13 -0
  95. package/generated/v1/schemas/projectmembers.remove.request.json +12 -0
  96. package/generated/v1/schemas/projectmembers.remove.response.json +27 -0
  97. package/generated/v1/schemas/schedules.archive.response.json +138 -1
  98. package/generated/v1/schemas/schedules.cancel.response.json +138 -1
  99. package/generated/v1/schemas/schedules.create.request.json +150 -1
  100. package/generated/v1/schemas/schedules.create.response.json +156 -1
  101. package/generated/v1/schemas/schedules.list.response.json +138 -1
  102. package/generated/v1/schemas/schedules.pause.response.json +138 -1
  103. package/generated/v1/schemas/schedules.read.response.json +138 -1
  104. package/generated/v1/schemas/schedules.replace.request.json +150 -1
  105. package/generated/v1/schemas/schedules.replace.response.json +156 -1
  106. package/generated/v1/schemas/schedules.resume.response.json +138 -1
  107. package/generated/v1/snippets/endpoints.create.json +1 -1
  108. package/generated/v1/snippets/endpoints.ensure.json +6 -0
  109. package/generated/v1/snippets/invitations.create.json +6 -0
  110. package/generated/v1/snippets/invitations.list.json +6 -0
  111. package/generated/v1/snippets/invitations.resend.json +6 -0
  112. package/generated/v1/snippets/invitations.revoke.json +6 -0
  113. package/generated/v1/snippets/journey/create-destination.json +1 -1
  114. package/generated/v1/snippets/members.list.json +6 -0
  115. package/generated/v1/snippets/members.remove.json +6 -0
  116. package/generated/v1/snippets/members.role.json +6 -0
  117. package/generated/v1/snippets/projectmembers.add.json +6 -0
  118. package/generated/v1/snippets/projectmembers.remove.json +6 -0
  119. package/package.json +1 -1
@@ -50,8 +50,9 @@ export type Authority = z.infer<typeof authoritySchema>;
50
50
  * client is permitted, and what the granting member's current role allows.
51
51
  * Nothing here can exceed a human's own access.
52
52
  */
53
- export declare const SCOPES: readonly ["credentials:administer", "billing:write", "credentials:read", "credentials:write", "endpoints:read", "endpoints:write", "forecast:read", "grants:read", "grants:write", "occurrences:read", "occurrences:redeliver", "projects:administer", "projects:read", "projects:write", "schedules:read", "schedules:write", "usage:read"];
53
+ export declare const SCOPES: readonly ["members:manage", "credentials:administer", "billing:write", "credentials:read", "credentials:write", "endpoints:read", "endpoints:write", "forecast:read", "grants:read", "grants:write", "occurrences:read", "occurrences:redeliver", "projects:administer", "projects:read", "projects:write", "schedules:read", "schedules:write", "usage:read"];
54
54
  export declare const scopeSchema: import("zod").ZodEnum<{
55
+ "members:manage": "members:manage";
55
56
  "credentials:administer": "credentials:administer";
56
57
  "billing:write": "billing:write";
57
58
  "credentials:read": "credentials:read";
@@ -114,6 +115,7 @@ export declare const principalSchema: import("zod").ZodObject<{
114
115
  project: import("zod").ZodString;
115
116
  }, import("zod/v4/core").$strip>;
116
117
  scopes: import("zod").ZodArray<import("zod").ZodEnum<{
118
+ "members:manage": "members:manage";
117
119
  "credentials:administer": "credentials:administer";
118
120
  "billing:write": "billing:write";
119
121
  "credentials:read": "credentials:read";
@@ -258,6 +260,7 @@ export declare const credentialContextSchema: import("zod").ZodObject<{
258
260
  }>;
259
261
  project: import("zod").ZodString;
260
262
  scopes: import("zod").ZodArray<import("zod").ZodEnum<{
263
+ "members:manage": "members:manage";
261
264
  "credentials:administer": "credentials:administer";
262
265
  "billing:write": "billing:write";
263
266
  "credentials:read": "credentials:read";
package/dist/authority.js CHANGED
@@ -43,6 +43,7 @@ export const authoritySchema = z.object({
43
43
  * Nothing here can exceed a human's own access.
44
44
  */
45
45
  export const SCOPES = [
46
+ "members:manage",
46
47
  /**
47
48
  * Act on a credential somebody else issued.
48
49
  *
@@ -58,6 +58,8 @@ export type DataExportPart = z.infer<typeof dataExportPartSchema>;
58
58
  /** Additive operation declarations, merged into the canonical registry by the API wiring. */
59
59
  export declare const DATA_EXPORT_OPERATIONS: readonly [import("./operations.js").OperationDefinition & {
60
60
  readonly id: "exports.create";
61
+ } & {
62
+ readonly request: import("zod").ZodObject<{}, import("zod/v4/core").$strict>;
61
63
  }, import("./operations.js").OperationDefinition & {
62
64
  readonly id: "exports.read";
63
65
  }, import("./operations.js").OperationDefinition & {
@@ -21,6 +21,31 @@ export interface EncryptedSchedulePayload {
21
21
  readonly keyId: string;
22
22
  readonly nonce: string;
23
23
  }
24
+ /** Encrypted custom HTTP settings, internal only; never a public read shape. */
25
+ export type StoredHttpHeader = {
26
+ readonly name: string;
27
+ readonly secret: false;
28
+ readonly value: string;
29
+ readonly valueBytes: number;
30
+ } | {
31
+ readonly name: string;
32
+ readonly secret: true;
33
+ readonly envelope: EncryptedSchedulePayload;
34
+ readonly valueBytes: number;
35
+ readonly ownerKind: "endpoint" | "schedule";
36
+ readonly ownerId: string;
37
+ } | {
38
+ readonly name: string;
39
+ readonly suppressed: true;
40
+ };
41
+ export interface StoredHttpRequest {
42
+ readonly method: "POST" | "PUT" | "GET";
43
+ readonly bodyMode: "envelope" | "json" | "none";
44
+ readonly headers: readonly StoredHttpHeader[];
45
+ readonly encryptedTemplate?: EncryptedSchedulePayload;
46
+ }
47
+ export declare const HTTP_HEADER_AAD_VERSION: "greatwait.http-header.v1";
48
+ export declare const HTTP_TEMPLATE_AAD_VERSION: "greatwait.http-template.v1";
24
49
  /**
25
50
  * One immutable delivery attempt, minted by the Scheduler Partition from its
26
51
  * verified authority. No member of this tuple comes from callback request
@@ -46,6 +71,7 @@ export interface CallbackAttemptDispatch {
46
71
  /** Monotonic partition fence for duplicate/late dispatch and report RPCs. */
47
72
  readonly dispatchEpoch: number;
48
73
  readonly encryptedPayloadEnvelope: EncryptedSchedulePayload;
74
+ readonly http?: StoredHttpRequest;
49
75
  readonly endpointId: EndpointId;
50
76
  readonly latencyClass: "realtime" | "bulk";
51
77
  /**
package/dist/delivery.js CHANGED
@@ -7,6 +7,8 @@
7
7
  * decryption oracle.
8
8
  */
9
9
  export const SCHEDULE_PAYLOAD_AAD_VERSION = "greatwait.schedule-payload.v1";
10
+ export const HTTP_HEADER_AAD_VERSION = "greatwait.http-header.v1";
11
+ export const HTTP_TEMPLATE_AAD_VERSION = "greatwait.http-template.v1";
10
12
  /**
11
13
  * What a receiver says about work it acknowledged and then finished.
12
14
  *
@@ -83,6 +83,19 @@ export declare const callbackEndpointNameSchema: import("zod").ZodString;
83
83
  * field, so list/get/update/disable/enable cannot accidentally recover it.
84
84
  */
85
85
  export declare const callbackEndpointSchema: import("zod").ZodObject<{
86
+ headers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
87
+ name: import("zod").ZodString;
88
+ secret: import("zod").ZodLiteral<false>;
89
+ value: import("zod").ZodString;
90
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
91
+ name: import("zod").ZodString;
92
+ secret: import("zod").ZodLiteral<true>;
93
+ configured: import("zod").ZodLiteral<true>;
94
+ value: import("zod").ZodOptional<import("zod").ZodNever>;
95
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
96
+ name: import("zod").ZodString;
97
+ suppressed: import("zod").ZodLiteral<true>;
98
+ }, import("zod/v4/core").$strict>]>>>;
86
99
  createdAt: import("zod").ZodString;
87
100
  disabledAt: import("zod").ZodOptional<import("zod").ZodString>;
88
101
  environmentKind: import("zod").ZodEnum<{
@@ -111,6 +124,19 @@ export declare const callbackEndpointSchema: import("zod").ZodObject<{
111
124
  export type CallbackEndpoint = z.infer<typeof callbackEndpointSchema>;
112
125
  export declare const callbackEndpointPageSchema: import("zod").ZodObject<{
113
126
  data: import("zod").ZodArray<import("zod").ZodObject<{
127
+ headers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
128
+ name: import("zod").ZodString;
129
+ secret: import("zod").ZodLiteral<false>;
130
+ value: import("zod").ZodString;
131
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
132
+ name: import("zod").ZodString;
133
+ secret: import("zod").ZodLiteral<true>;
134
+ configured: import("zod").ZodLiteral<true>;
135
+ value: import("zod").ZodOptional<import("zod").ZodNever>;
136
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
137
+ name: import("zod").ZodString;
138
+ suppressed: import("zod").ZodLiteral<true>;
139
+ }, import("zod/v4/core").$strict>]>>>;
114
140
  createdAt: import("zod").ZodString;
115
141
  disabledAt: import("zod").ZodOptional<import("zod").ZodString>;
116
142
  environmentKind: import("zod").ZodEnum<{
@@ -148,6 +174,19 @@ export declare const callbackEndpointPageSchema: import("zod").ZodObject<{
148
174
  export type CallbackEndpointPage = z.infer<typeof callbackEndpointPageSchema>;
149
175
  /** The one response that carries the per-endpoint secret. */
150
176
  export declare const callbackEndpointCreatedSchema: import("zod").ZodObject<{
177
+ headers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
178
+ name: import("zod").ZodString;
179
+ secret: import("zod").ZodLiteral<false>;
180
+ value: import("zod").ZodString;
181
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
182
+ name: import("zod").ZodString;
183
+ secret: import("zod").ZodLiteral<true>;
184
+ configured: import("zod").ZodLiteral<true>;
185
+ value: import("zod").ZodOptional<import("zod").ZodNever>;
186
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
187
+ name: import("zod").ZodString;
188
+ suppressed: import("zod").ZodLiteral<true>;
189
+ }, import("zod/v4/core").$strict>]>>>;
151
190
  createdAt: import("zod").ZodString;
152
191
  disabledAt: import("zod").ZodOptional<import("zod").ZodString>;
153
192
  environmentKind: import("zod").ZodEnum<{
@@ -183,6 +222,19 @@ export declare const callbackSigningKeyRotationRequestSchema: import("zod").ZodO
183
222
  export type CallbackSigningKeyRotationRequest = z.infer<typeof callbackSigningKeyRotationRequestSchema>;
184
223
  export declare const callbackEndpointRotatedSchema: import("zod").ZodObject<{
185
224
  endpoint: import("zod").ZodObject<{
225
+ headers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
226
+ name: import("zod").ZodString;
227
+ secret: import("zod").ZodLiteral<false>;
228
+ value: import("zod").ZodString;
229
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
230
+ name: import("zod").ZodString;
231
+ secret: import("zod").ZodLiteral<true>;
232
+ configured: import("zod").ZodLiteral<true>;
233
+ value: import("zod").ZodOptional<import("zod").ZodNever>;
234
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
235
+ name: import("zod").ZodString;
236
+ suppressed: import("zod").ZodLiteral<true>;
237
+ }, import("zod/v4/core").$strict>]>>>;
186
238
  createdAt: import("zod").ZodString;
187
239
  disabledAt: import("zod").ZodOptional<import("zod").ZodString>;
188
240
  environmentKind: import("zod").ZodEnum<{
@@ -239,7 +291,123 @@ export declare const callbackEndpointSigningSecretsSchema: import("zod").ZodObje
239
291
  }, import("zod/v4/core").$strip>>;
240
292
  }, import("zod/v4/core").$strip>;
241
293
  export type CallbackEndpointSigningSecrets = z.infer<typeof callbackEndpointSigningSecretsSchema>;
294
+ /**
295
+ * Where an endpoint's signing secret is, for a result that does not carry it
296
+ * (W9-44, FXO-2907).
297
+ *
298
+ * `endpoints.ensure`, and a schedule write that names a `url` instead of an
299
+ * endpoint, may bring an endpoint into existence without handing its secret
300
+ * to the caller. An agent working over MCP is the reason: anything a tool
301
+ * returns lands in ordinary tool history, so the secret is never in the
302
+ * result. What is in it is where a person finds the secret — the endpoint's
303
+ * own page, where a signed-in member reveals it — so the agent can pass that
304
+ * on rather than leave the person to discover that deliveries are signed.
305
+ *
306
+ * `returned` is the literal `false` rather than an absent field because a
307
+ * reader deciding whether it holds a secret should be told so, not left to
308
+ * infer it from what is missing.
309
+ */
310
+ export declare const signingSecretNoticeSchema: import("zod").ZodObject<{
311
+ guidance: import("zod").ZodString;
312
+ returned: import("zod").ZodLiteral<false>;
313
+ revealUrl: import("zod").ZodOptional<import("zod").ZodString>;
314
+ }, import("zod/v4/core").$strip>;
315
+ export type SigningSecretNotice = z.infer<typeof signingSecretNoticeSchema>;
316
+ /**
317
+ * The dashboard path of one endpoint's page, beneath the project and
318
+ * environment it belongs to. The dashboard's router serves it; a test there
319
+ * holds the two to the same shape.
320
+ */
321
+ export declare function endpointDashboardPath(target: {
322
+ readonly endpoint: string;
323
+ readonly environmentKind: string;
324
+ /**
325
+ * The organization **as the dashboard addresses it**: the sign-in
326
+ * provider's organization, not GreatWait's `org_…` identifier.
327
+ */
328
+ readonly organization: string;
329
+ readonly project: string;
330
+ }): string;
331
+ /**
332
+ * The notice a secretless endpoint result carries. `dashboardOrigin` is the
333
+ * deployment's dashboard; without one the notice still says where to look.
334
+ */
335
+ export declare function signingSecretNotice(target: Parameters<typeof endpointDashboardPath>[0], dashboardOrigin: string | undefined): SigningSecretNotice;
336
+ /**
337
+ * What `endpoints.ensure` answers: the endpoint at the requested address,
338
+ * whether this call created it, and where its signing secret is.
339
+ *
340
+ * Metadata only, like every endpoint read. There is no `secret` field to fill
341
+ * by mistake; the shape is what keeps it out of an agent's history.
342
+ */
343
+ export declare const callbackEndpointEnsuredSchema: import("zod").ZodObject<{
344
+ headers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
345
+ name: import("zod").ZodString;
346
+ secret: import("zod").ZodLiteral<false>;
347
+ value: import("zod").ZodString;
348
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
349
+ name: import("zod").ZodString;
350
+ secret: import("zod").ZodLiteral<true>;
351
+ configured: import("zod").ZodLiteral<true>;
352
+ value: import("zod").ZodOptional<import("zod").ZodNever>;
353
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
354
+ name: import("zod").ZodString;
355
+ suppressed: import("zod").ZodLiteral<true>;
356
+ }, import("zod/v4/core").$strict>]>>>;
357
+ createdAt: import("zod").ZodString;
358
+ disabledAt: import("zod").ZodOptional<import("zod").ZodString>;
359
+ environmentKind: import("zod").ZodEnum<{
360
+ test: "test";
361
+ live: "live";
362
+ }>;
363
+ id: import("zod").ZodString;
364
+ name: import("zod").ZodOptional<import("zod").ZodString>;
365
+ project: import("zod").ZodString;
366
+ signingKeys: import("zod").ZodObject<{
367
+ current: import("zod").ZodString;
368
+ next: import("zod").ZodOptional<import("zod").ZodObject<{
369
+ acknowledgedAt: import("zod").ZodOptional<import("zod").ZodString>;
370
+ id: import("zod").ZodString;
371
+ overlapEndsAt: import("zod").ZodString;
372
+ }, import("zod/v4/core").$strip>>;
373
+ }, import("zod/v4/core").$strip>;
374
+ status: import("zod").ZodEnum<{
375
+ disabled: "disabled";
376
+ active: "active";
377
+ }>;
378
+ updatedAt: import("zod").ZodString;
379
+ url: import("zod").ZodString;
380
+ version: import("zod").ZodNumber;
381
+ created: import("zod").ZodBoolean;
382
+ signingSecret: import("zod").ZodObject<{
383
+ guidance: import("zod").ZodString;
384
+ returned: import("zod").ZodLiteral<false>;
385
+ revealUrl: import("zod").ZodOptional<import("zod").ZodString>;
386
+ }, import("zod/v4/core").$strip>;
387
+ }, import("zod/v4/core").$strip>;
388
+ export type CallbackEndpointEnsured = z.infer<typeof callbackEndpointEnsuredSchema>;
389
+ /**
390
+ * A callback destination as a caller types it: HTTPS on port 443, no
391
+ * credentials or fragment, a public name or address. The DNS half of the
392
+ * policy runs when an endpoint is created at it.
393
+ */
394
+ export declare function callbackUrlSchema(): import("zod").ZodString;
242
395
  export declare const callbackEndpointRequestSchema: import("zod").ZodObject<{
396
+ headers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
397
+ action: import("zod").ZodLiteral<"set">;
398
+ name: import("zod").ZodString;
399
+ value: import("zod").ZodString;
400
+ secret: import("zod").ZodOptional<import("zod").ZodBoolean>;
401
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
402
+ action: import("zod").ZodLiteral<"keep">;
403
+ name: import("zod").ZodString;
404
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
405
+ action: import("zod").ZodLiteral<"remove">;
406
+ name: import("zod").ZodString;
407
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
408
+ action: import("zod").ZodLiteral<"suppress">;
409
+ name: import("zod").ZodString;
410
+ }, import("zod/v4/core").$strict>], "action">>>;
243
411
  name: import("zod").ZodOptional<import("zod").ZodString>;
244
412
  url: import("zod").ZodString;
245
413
  }, import("zod/v4/core").$strip>;
package/dist/endpoints.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { endpointHeaderChangesSchema, publicHttpHeaderSchema, } from "./http-request.js";
1
2
  import { z } from "./zod.js";
2
3
  import { environmentKindSchema } from "./authority.js";
3
4
  import { evaluateCallbackUrl } from "./callback-safety.js";
@@ -89,6 +90,7 @@ export const callbackEndpointNameSchema = z
89
90
  * field, so list/get/update/disable/enable cannot accidentally recover it.
90
91
  */
91
92
  export const callbackEndpointSchema = z.object({
93
+ headers: z.array(publicHttpHeaderSchema).optional(),
92
94
  createdAt: timestampSchema,
93
95
  disabledAt: timestampSchema.optional(),
94
96
  environmentKind: environmentKindSchema,
@@ -148,7 +150,75 @@ export const callbackEndpointSigningSecretsSchema = z.object({
148
150
  .extend({ overlapEndsAt: timestampSchema })
149
151
  .optional(),
150
152
  });
151
- function callbackUrlSchema() {
153
+ /**
154
+ * Where an endpoint's signing secret is, for a result that does not carry it
155
+ * (W9-44, FXO-2907).
156
+ *
157
+ * `endpoints.ensure`, and a schedule write that names a `url` instead of an
158
+ * endpoint, may bring an endpoint into existence without handing its secret
159
+ * to the caller. An agent working over MCP is the reason: anything a tool
160
+ * returns lands in ordinary tool history, so the secret is never in the
161
+ * result. What is in it is where a person finds the secret — the endpoint's
162
+ * own page, where a signed-in member reveals it — so the agent can pass that
163
+ * on rather than leave the person to discover that deliveries are signed.
164
+ *
165
+ * `returned` is the literal `false` rather than an absent field because a
166
+ * reader deciding whether it holds a secret should be told so, not left to
167
+ * infer it from what is missing.
168
+ */
169
+ export const signingSecretNoticeSchema = z.object({
170
+ /** One sentence an agent can relay to the person it is working for. */
171
+ guidance: z.string().min(1),
172
+ /** Never `true`: these results do not carry the secret. */
173
+ returned: z.literal(false),
174
+ /**
175
+ * The endpoint's page in the GreatWait dashboard, where a signed-in member
176
+ * reveals the secret. Absent only where this deployment has no dashboard.
177
+ */
178
+ revealUrl: z.string().url().optional(),
179
+ });
180
+ /**
181
+ * The dashboard path of one endpoint's page, beneath the project and
182
+ * environment it belongs to. The dashboard's router serves it; a test there
183
+ * holds the two to the same shape.
184
+ */
185
+ export function endpointDashboardPath(target) {
186
+ return `/o/${encodeURIComponent(target.organization)}/p/${encodeURIComponent(target.project)}/${encodeURIComponent(target.environmentKind)}/settings/endpoints/${encodeURIComponent(target.endpoint)}`;
187
+ }
188
+ /**
189
+ * The notice a secretless endpoint result carries. `dashboardOrigin` is the
190
+ * deployment's dashboard; without one the notice still says where to look.
191
+ */
192
+ export function signingSecretNotice(target, dashboardOrigin) {
193
+ return {
194
+ guidance: "GreatWait signs every callback to this endpoint. The signing secret is never returned here; a signed-in member of the project reveals it on the endpoint's page in the GreatWait dashboard, and your receiver uses it to verify that a callback came from GreatWait.",
195
+ returned: false,
196
+ ...(dashboardOrigin === undefined
197
+ ? {}
198
+ : {
199
+ revealUrl: new URL(endpointDashboardPath(target), dashboardOrigin)
200
+ .href,
201
+ }),
202
+ };
203
+ }
204
+ /**
205
+ * What `endpoints.ensure` answers: the endpoint at the requested address,
206
+ * whether this call created it, and where its signing secret is.
207
+ *
208
+ * Metadata only, like every endpoint read. There is no `secret` field to fill
209
+ * by mistake; the shape is what keeps it out of an agent's history.
210
+ */
211
+ export const callbackEndpointEnsuredSchema = callbackEndpointSchema.extend({
212
+ /** Whether this call created the endpoint, or found one already there. */
213
+ created: z.boolean(),
214
+ signingSecret: signingSecretNoticeSchema,
215
+ });
216
+ /**
217
+ * A callback destination as a caller types it: HTTPS on port 443, no
218
+ * credentials or fragment, a public name or address. The DNS half of the
219
+ * policy runs when an endpoint is created at it.
220
+ */
221
+ export function callbackUrlSchema() {
152
222
  return z
153
223
  .string()
154
224
  .url()
@@ -164,6 +234,7 @@ function callbackUrlSchema() {
164
234
  });
165
235
  }
166
236
  export const callbackEndpointRequestSchema = z.object({
237
+ headers: endpointHeaderChangesSchema.optional(),
167
238
  /**
168
239
  * A name for people (W4-14, FXO-2255). Omitted on a create, the endpoint
169
240
  * takes its whole URL as its name; omitted on an update, the stored name
@@ -0,0 +1,193 @@
1
+ import { z } from "./zod.js";
2
+ export declare const HTTP_HEADER_BOUNDS: {
3
+ readonly count: 32;
4
+ readonly nameBytes: 128;
5
+ readonly valueBytes: 8192;
6
+ readonly totalBytes: 16384;
7
+ };
8
+ export declare const HTTP_METHODS: readonly ["POST", "PUT", "GET"];
9
+ /** Platform-owned authentication, content and transport fields cannot be overridden. */
10
+ export declare function reservedHttpHeaderReason(name: string): string | undefined;
11
+ export declare const httpHeaderNameSchema: import("zod").ZodString;
12
+ export declare const httpHeaderValueSchema: import("zod").ZodString;
13
+ export declare const headerChangeSchema: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
14
+ action: import("zod").ZodLiteral<"set">;
15
+ name: import("zod").ZodString;
16
+ value: import("zod").ZodString;
17
+ secret: import("zod").ZodOptional<import("zod").ZodBoolean>;
18
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
19
+ action: import("zod").ZodLiteral<"keep">;
20
+ name: import("zod").ZodString;
21
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
22
+ action: import("zod").ZodLiteral<"remove">;
23
+ name: import("zod").ZodString;
24
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
25
+ action: import("zod").ZodLiteral<"suppress">;
26
+ name: import("zod").ZodString;
27
+ }, import("zod/v4/core").$strict>], "action">;
28
+ export type HeaderChange = z.infer<typeof headerChangeSchema>;
29
+ export declare const headerChangesSchema: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
30
+ action: import("zod").ZodLiteral<"set">;
31
+ name: import("zod").ZodString;
32
+ value: import("zod").ZodString;
33
+ secret: import("zod").ZodOptional<import("zod").ZodBoolean>;
34
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
35
+ action: import("zod").ZodLiteral<"keep">;
36
+ name: import("zod").ZodString;
37
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
38
+ action: import("zod").ZodLiteral<"remove">;
39
+ name: import("zod").ZodString;
40
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
41
+ action: import("zod").ZodLiteral<"suppress">;
42
+ name: import("zod").ZodString;
43
+ }, import("zod/v4/core").$strict>], "action">>;
44
+ export declare const endpointHeaderChangesSchema: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
45
+ action: import("zod").ZodLiteral<"set">;
46
+ name: import("zod").ZodString;
47
+ value: import("zod").ZodString;
48
+ secret: import("zod").ZodOptional<import("zod").ZodBoolean>;
49
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
50
+ action: import("zod").ZodLiteral<"keep">;
51
+ name: import("zod").ZodString;
52
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
53
+ action: import("zod").ZodLiteral<"remove">;
54
+ name: import("zod").ZodString;
55
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
56
+ action: import("zod").ZodLiteral<"suppress">;
57
+ name: import("zod").ZodString;
58
+ }, import("zod/v4/core").$strict>], "action">>;
59
+ export declare const publicHttpHeaderSchema: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
60
+ name: import("zod").ZodString;
61
+ secret: import("zod").ZodLiteral<false>;
62
+ value: import("zod").ZodString;
63
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
64
+ name: import("zod").ZodString;
65
+ secret: import("zod").ZodLiteral<true>;
66
+ configured: import("zod").ZodLiteral<true>;
67
+ value: import("zod").ZodOptional<import("zod").ZodNever>;
68
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
69
+ name: import("zod").ZodString;
70
+ suppressed: import("zod").ZodLiteral<true>;
71
+ }, import("zod/v4/core").$strict>]>;
72
+ export type PublicHttpHeader = z.infer<typeof publicHttpHeaderSchema>;
73
+ export declare const httpRequestSchema: import("zod").ZodObject<{
74
+ method: import("zod").ZodOptional<import("zod").ZodEnum<{
75
+ POST: "POST";
76
+ PUT: "PUT";
77
+ GET: "GET";
78
+ }>>;
79
+ body: import("zod").ZodOptional<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
80
+ mode: import("zod").ZodLiteral<"envelope">;
81
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
82
+ mode: import("zod").ZodLiteral<"json">;
83
+ value: import("zod").ZodJSONSchema;
84
+ }, import("zod/v4/core").$strict>], "mode">>;
85
+ headers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
86
+ action: import("zod").ZodLiteral<"set">;
87
+ name: import("zod").ZodString;
88
+ value: import("zod").ZodString;
89
+ secret: import("zod").ZodOptional<import("zod").ZodBoolean>;
90
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
91
+ action: import("zod").ZodLiteral<"keep">;
92
+ name: import("zod").ZodString;
93
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
94
+ action: import("zod").ZodLiteral<"remove">;
95
+ name: import("zod").ZodString;
96
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
97
+ action: import("zod").ZodLiteral<"suppress">;
98
+ name: import("zod").ZodString;
99
+ }, import("zod/v4/core").$strict>], "action">>>;
100
+ }, import("zod/v4/core").$strict>;
101
+ export type HttpRequest = z.infer<typeof httpRequestSchema>;
102
+ export declare const publicHttpRequestSchema: import("zod").ZodObject<{
103
+ method: import("zod").ZodEnum<{
104
+ POST: "POST";
105
+ PUT: "PUT";
106
+ GET: "GET";
107
+ }>;
108
+ body: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
109
+ mode: import("zod").ZodLiteral<"envelope">;
110
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
111
+ mode: import("zod").ZodLiteral<"none">;
112
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
113
+ mode: import("zod").ZodLiteral<"json">;
114
+ value: import("zod").ZodOptional<import("zod").ZodJSONSchema>;
115
+ }, import("zod/v4/core").$strict>], "mode">;
116
+ headers: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
117
+ name: import("zod").ZodString;
118
+ secret: import("zod").ZodLiteral<false>;
119
+ value: import("zod").ZodString;
120
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
121
+ name: import("zod").ZodString;
122
+ secret: import("zod").ZodLiteral<true>;
123
+ configured: import("zod").ZodLiteral<true>;
124
+ value: import("zod").ZodOptional<import("zod").ZodNever>;
125
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
126
+ name: import("zod").ZodString;
127
+ suppressed: import("zod").ZodLiteral<true>;
128
+ }, import("zod/v4/core").$strict>]>>;
129
+ }, import("zod/v4/core").$strict>;
130
+ export type PublicHttpRequest = z.infer<typeof publicHttpRequestSchema>;
131
+ export declare const storedHttpHeaderSchema: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
132
+ name: import("zod").ZodString;
133
+ secret: import("zod").ZodLiteral<false>;
134
+ value: import("zod").ZodString;
135
+ valueBytes: import("zod").ZodNumber;
136
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
137
+ name: import("zod").ZodString;
138
+ secret: import("zod").ZodLiteral<true>;
139
+ envelope: import("zod").ZodObject<{
140
+ keyId: import("zod").ZodLiteral<"v1">;
141
+ nonce: import("zod").ZodString;
142
+ ciphertext: import("zod").ZodString;
143
+ }, import("zod/v4/core").$strict>;
144
+ valueBytes: import("zod").ZodNumber;
145
+ ownerKind: import("zod").ZodEnum<{
146
+ endpoint: "endpoint";
147
+ schedule: "schedule";
148
+ }>;
149
+ ownerId: import("zod").ZodString;
150
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
151
+ name: import("zod").ZodString;
152
+ suppressed: import("zod").ZodLiteral<true>;
153
+ }, import("zod/v4/core").$strict>]>;
154
+ export declare const storedHttpRequestSchema: import("zod").ZodObject<{
155
+ method: import("zod").ZodEnum<{
156
+ POST: "POST";
157
+ PUT: "PUT";
158
+ GET: "GET";
159
+ }>;
160
+ bodyMode: import("zod").ZodEnum<{
161
+ envelope: "envelope";
162
+ json: "json";
163
+ none: "none";
164
+ }>;
165
+ headers: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
166
+ name: import("zod").ZodString;
167
+ secret: import("zod").ZodLiteral<false>;
168
+ value: import("zod").ZodString;
169
+ valueBytes: import("zod").ZodNumber;
170
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
171
+ name: import("zod").ZodString;
172
+ secret: import("zod").ZodLiteral<true>;
173
+ envelope: import("zod").ZodObject<{
174
+ keyId: import("zod").ZodLiteral<"v1">;
175
+ nonce: import("zod").ZodString;
176
+ ciphertext: import("zod").ZodString;
177
+ }, import("zod/v4/core").$strict>;
178
+ valueBytes: import("zod").ZodNumber;
179
+ ownerKind: import("zod").ZodEnum<{
180
+ endpoint: "endpoint";
181
+ schedule: "schedule";
182
+ }>;
183
+ ownerId: import("zod").ZodString;
184
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
185
+ name: import("zod").ZodString;
186
+ suppressed: import("zod").ZodLiteral<true>;
187
+ }, import("zod/v4/core").$strict>]>>;
188
+ encryptedTemplate: import("zod").ZodOptional<import("zod").ZodObject<{
189
+ keyId: import("zod").ZodLiteral<"v1">;
190
+ nonce: import("zod").ZodString;
191
+ ciphertext: import("zod").ZodString;
192
+ }, import("zod/v4/core").$strict>>;
193
+ }, import("zod/v4/core").$strict>;