@cosmicdrift/kumiko-bundled-features 0.410.0 → 0.412.0

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 (151) hide show
  1. package/dist/agent-tools/agent-doc-lint.d.ts +9 -0
  2. package/dist/agent-tools/agent-doc-lint.js +42 -5
  3. package/dist/agent-tools/agent-manifest.d.ts +0 -1
  4. package/dist/agent-tools/agent-manifest.js +9 -99
  5. package/dist/agent-tools/api-docs/anchors.d.ts +14 -0
  6. package/dist/agent-tools/api-docs/anchors.js +49 -0
  7. package/dist/agent-tools/api-docs/check.d.ts +7 -0
  8. package/dist/agent-tools/api-docs/check.js +15 -0
  9. package/dist/agent-tools/api-docs/collect-events.d.ts +10 -0
  10. package/dist/agent-tools/api-docs/collect-events.js +90 -0
  11. package/dist/agent-tools/api-docs/collect.d.ts +15 -0
  12. package/dist/agent-tools/api-docs/collect.js +108 -0
  13. package/dist/agent-tools/api-docs/curl.d.ts +5 -0
  14. package/dist/agent-tools/api-docs/curl.js +24 -0
  15. package/dist/agent-tools/api-docs/error-table.d.ts +9 -0
  16. package/dist/agent-tools/api-docs/error-table.js +31 -0
  17. package/dist/agent-tools/api-docs/examples.d.ts +16 -0
  18. package/dist/agent-tools/api-docs/examples.js +25 -0
  19. package/dist/agent-tools/api-docs/generate.d.ts +19 -0
  20. package/dist/agent-tools/api-docs/generate.js +104 -0
  21. package/dist/agent-tools/api-docs/index-json.d.ts +15 -0
  22. package/dist/agent-tools/api-docs/index-json.js +6 -0
  23. package/dist/agent-tools/api-docs/index.d.ts +9 -0
  24. package/dist/agent-tools/api-docs/index.js +6 -0
  25. package/dist/agent-tools/api-docs/list-parameters.d.ts +61 -0
  26. package/dist/agent-tools/api-docs/list-parameters.js +28 -0
  27. package/dist/agent-tools/api-docs/markdown.d.ts +29 -0
  28. package/dist/agent-tools/api-docs/markdown.js +48 -0
  29. package/dist/agent-tools/api-docs/menu-path.d.ts +8 -0
  30. package/dist/agent-tools/api-docs/menu-path.js +60 -0
  31. package/dist/agent-tools/api-docs/model.d.ts +76 -0
  32. package/dist/agent-tools/api-docs/model.js +1 -0
  33. package/dist/agent-tools/api-docs/problems.d.ts +32 -0
  34. package/dist/agent-tools/api-docs/problems.js +28 -0
  35. package/dist/agent-tools/api-docs/render-events.d.ts +12 -0
  36. package/dist/agent-tools/api-docs/render-events.js +55 -0
  37. package/dist/agent-tools/api-docs/render-openapi.d.ts +10 -0
  38. package/dist/agent-tools/api-docs/render-openapi.js +170 -0
  39. package/dist/agent-tools/api-docs/render-overview.d.ts +11 -0
  40. package/dist/agent-tools/api-docs/render-overview.js +60 -0
  41. package/dist/agent-tools/api-docs/render-reference.d.ts +14 -0
  42. package/dist/agent-tools/api-docs/render-reference.js +50 -0
  43. package/dist/agent-tools/api-docs/render-tokens.d.ts +12 -0
  44. package/dist/agent-tools/api-docs/render-tokens.js +101 -0
  45. package/dist/agent-tools/api-docs/schema-fields.d.ts +16 -0
  46. package/dist/agent-tools/api-docs/schema-fields.js +141 -0
  47. package/dist/agent-tools/api-docs/section-ids.d.ts +25 -0
  48. package/dist/agent-tools/api-docs/section-ids.js +26 -0
  49. package/dist/agent-tools/api-docs/system-only.d.ts +5 -0
  50. package/dist/agent-tools/api-docs/system-only.js +7 -0
  51. package/dist/agent-tools/api-docs/texts/de.d.ts +123 -0
  52. package/dist/agent-tools/api-docs/texts/de.js +123 -0
  53. package/dist/agent-tools/api-docs/texts/en.d.ts +123 -0
  54. package/dist/agent-tools/api-docs/texts/en.js +123 -0
  55. package/dist/agent-tools/api-docs/texts/es.d.ts +123 -0
  56. package/dist/agent-tools/api-docs/texts/es.js +123 -0
  57. package/dist/agent-tools/api-docs/texts/fr.d.ts +123 -0
  58. package/dist/agent-tools/api-docs/texts/fr.js +123 -0
  59. package/dist/agent-tools/api-docs/texts/index.d.ts +14 -0
  60. package/dist/agent-tools/api-docs/texts/index.js +55 -0
  61. package/dist/agent-tools/api-docs/texts/it.d.ts +123 -0
  62. package/dist/agent-tools/api-docs/texts/it.js +123 -0
  63. package/dist/agent-tools/api-docs/texts/types.d.ts +18 -0
  64. package/dist/agent-tools/api-docs/texts/types.js +104 -0
  65. package/dist/agent-tools/api-docs/ui-writes.d.ts +12 -0
  66. package/dist/agent-tools/api-docs/ui-writes.js +73 -0
  67. package/dist/agent-tools/handler-schema.d.ts +5 -0
  68. package/dist/agent-tools/handler-schema.js +37 -0
  69. package/dist/agent-tools/index.d.ts +2 -1
  70. package/dist/agent-tools/index.js +2 -1
  71. package/dist/agent-tools/labels.d.ts +26 -0
  72. package/dist/agent-tools/labels.js +131 -0
  73. package/dist/auth-email-password/seeding.d.ts +17 -2
  74. package/dist/auth-email-password/seeding.js +68 -6
  75. package/dist/auth-email-password/web/i18n.js +1 -0
  76. package/dist/auth-email-password/web/signup-screen.d.ts +1 -1
  77. package/dist/auth-email-password/web/signup-screen.js +20 -2
  78. package/dist/auth-email-password/web/static-account.d.ts +40 -0
  79. package/dist/auth-email-password/web/static-account.js +94 -0
  80. package/dist/auth-email-password/web/static-client.d.ts +38 -0
  81. package/dist/auth-email-password/web/static-client.js +169 -0
  82. package/dist/foundation-shared/demo-admin-env.d.ts +4 -0
  83. package/dist/foundation-shared/demo-admin-env.js +7 -0
  84. package/dist/foundation-shared/index.d.ts +1 -1
  85. package/dist/foundation-shared/index.js +1 -1
  86. package/dist/inbound-mail-foundation/entities.d.ts +84 -0
  87. package/dist/inbound-mail-foundation/entities.js +96 -71
  88. package/dist/inbound-mail-foundation/feature.js +2 -2
  89. package/dist/inbound-provider-imap/imap-client.d.ts +1 -1
  90. package/dist/inbound-provider-imap/imap-client.js +3 -1
  91. package/dist/personal-access-tokens/feature.d.ts +1 -0
  92. package/dist/personal-access-tokens/feature.js +4 -2
  93. package/dist/personal-access-tokens/handlers/create.write.js +2 -2
  94. package/dist/personal-access-tokens/i18n.js +5 -1
  95. package/dist/personal-access-tokens/index.d.ts +4 -2
  96. package/dist/personal-access-tokens/index.js +29 -2
  97. package/dist/personal-access-tokens/scope-events-check.d.ts +3 -0
  98. package/dist/personal-access-tokens/scope-events-check.js +18 -0
  99. package/dist/personal-access-tokens/screens.js +8 -2
  100. package/dist/personal-access-tokens/web/constants.d.ts +1 -0
  101. package/dist/personal-access-tokens/web/constants.js +1 -0
  102. package/dist/personal-access-tokens/web/scopes.d.ts +2 -0
  103. package/dist/personal-access-tokens/web/scopes.js +12 -0
  104. package/dist/presence/feature.d.ts +3 -0
  105. package/dist/presence/feature.js +20 -0
  106. package/dist/presence/handlers/heartbeat.write.d.ts +12 -0
  107. package/dist/presence/handlers/heartbeat.write.js +31 -0
  108. package/dist/presence/handlers/leave.write.d.ts +8 -0
  109. package/dist/presence/handlers/leave.write.js +33 -0
  110. package/dist/presence/handlers/list.query.d.ts +7 -0
  111. package/dist/presence/handlers/list.query.js +28 -0
  112. package/dist/presence/index.d.ts +3 -0
  113. package/dist/presence/index.js +2 -0
  114. package/dist/presence/options.d.ts +17 -0
  115. package/dist/presence/options.js +13 -0
  116. package/dist/presence/payloads.d.ts +18 -0
  117. package/dist/presence/payloads.js +18 -0
  118. package/dist/presence/room.d.ts +13 -0
  119. package/dist/presence/room.js +35 -0
  120. package/dist/presence/store.d.ts +32 -0
  121. package/dist/presence/store.js +140 -0
  122. package/dist/sessions/feature.js +2 -2
  123. package/dist/sessions/handlers/last-activity-probe.route.d.ts +2 -0
  124. package/dist/sessions/handlers/last-activity-probe.route.js +14 -0
  125. package/dist/tenant-inactivity/check-inactive-tenants.js +12 -6
  126. package/dist/tenant-inactivity/constants.d.ts +1 -1
  127. package/dist/tenant-inactivity/constants.js +3 -1
  128. package/dist/tenant-inactivity/handlers/inactivity-state.query.js +2 -1
  129. package/dist/tenant-inactivity/handlers/keep-account.write.js +2 -1
  130. package/dist/tenant-inactivity/options.d.ts +1 -0
  131. package/dist/tenant-inactivity/remote-activity.d.ts +3 -1
  132. package/dist/tenant-inactivity/remote-activity.js +4 -1
  133. package/dist/tenant-inactivity/static-keep-account.d.ts +6 -0
  134. package/dist/tenant-inactivity/static-keep-account.js +15 -0
  135. package/dist/tenant-lifecycle/constants.d.ts +1 -0
  136. package/dist/tenant-lifecycle/constants.js +1 -0
  137. package/dist/tenant-lifecycle/handlers/cancel-destruction.write.js +2 -2
  138. package/dist/tenant-lifecycle/handlers/request-destruction.write.js +2 -1
  139. package/dist/tenant-lifecycle/index.d.ts +1 -1
  140. package/dist/tenant-lifecycle/index.js +1 -1
  141. package/dist/waitlist/static-submit.d.ts +15 -0
  142. package/dist/waitlist/static-submit.js +24 -0
  143. package/package.json +59 -11
  144. package/src/agent-tools/changes.json +24 -0
  145. package/src/auth-email-password/changes.json +24 -0
  146. package/src/inbound-mail-foundation/changes.json +6 -0
  147. package/src/inbound-provider-imap/changes.json +6 -0
  148. package/src/personal-access-tokens/changes.json +6 -0
  149. package/src/presence/changes.json +8 -0
  150. package/src/tenant-inactivity/changes.json +12 -0
  151. package/src/waitlist/changes.json +6 -0
@@ -2,6 +2,20 @@ import { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
2
2
  import { createLastActivityProbeQuery, LAST_ACTIVITY_PROBE_QUERY, } from "./last-activity-probe.query.js";
3
3
  // The route is reachable anonymously, so a short secret would be guessable within the rate limit.
4
4
  const MIN_PROBE_SECRET_LENGTH = 32;
5
+ export const LAST_ACTIVITY_PROBE_SECRET_ENV = "SESSIONS_LAST_ACTIVITY_PROBE_SECRET";
6
+ // Env is the fallback for apps that mount sessions without options; the value is never echoed.
7
+ // The feature definition also runs in client bundles, where `process` may not exist.
8
+ export function readProbeSecretFromEnv(env = typeof process === "undefined"
9
+ ? undefined
10
+ : process.env) {
11
+ const secret = env?.[LAST_ACTIVITY_PROBE_SECRET_ENV];
12
+ if (secret === undefined)
13
+ return undefined;
14
+ if (secret.length < MIN_PROBE_SECRET_LENGTH) {
15
+ throw new Error(`sessions: ${LAST_ACTIVITY_PROBE_SECRET_ENV} must be at least ${MIN_PROBE_SECRET_LENGTH} characters`);
16
+ }
17
+ return secret;
18
+ }
5
19
  export function registerLastActivityProbe(r, secret) {
6
20
  if (secret.length < MIN_PROBE_SECRET_LENGTH) {
7
21
  throw new Error(`sessions: lastActivityProbeSecret must be at least ${MIN_PROBE_SECRET_LENGTH} characters`);
@@ -5,7 +5,7 @@ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
5
5
  import { decryptTenantNames, tenantMembershipsTable, tenantTable, } from "../tenant/index.js";
6
6
  import { requestTenantDestruction } from "../tenant-lifecycle/index.js";
7
7
  import { userTable } from "../user/index.js";
8
- import { TENANT_OWNER_ROLE } from "./constants.js";
8
+ import { TENANT_KEEP_ACCOUNT_ROLES } from "./constants.js";
9
9
  import { formatInactivityMailDate } from "./email-templates.js";
10
10
  import { activityBase, decideInactivityAction, foldActivity, resetWarnings, } from "./inactivity-plan.js";
11
11
  import { signKeepAccountToken } from "./keep-token.js";
@@ -38,9 +38,10 @@ function latestOf(instants) {
38
38
  }
39
39
  return latest;
40
40
  }
41
- async function newestExternalActivity(options, tenantId, now) {
42
- const found = await Promise.all((options.activitySources ?? []).map((source) => source({ tenantId, now })));
43
- return latestOf(found);
41
+ async function newestExternalActivity(options, tenantId, now, db) {
42
+ const found = await Promise.all((options.activitySources ?? []).map((source) => source({ tenantId, now, db })));
43
+ // A source reporting the future would postpone the deletion indefinitely.
44
+ return latestOf(found.map((at) => (at !== null && Temporal.Instant.compare(at, now) > 0 ? now : at)));
44
45
  }
45
46
  function isNewerThanBase(activity, state) {
46
47
  return activity !== null && Temporal.Instant.compare(activity, activityBase(state)) > 0;
@@ -48,9 +49,14 @@ function isNewerThanBase(activity, state) {
48
49
  async function loadOwners(ctx) {
49
50
  const memberships = await ctx.db.selectMany(tenantMembershipsTable, {});
50
51
  const owners = [];
52
+ const seen = new Set();
51
53
  for (const membership of memberships) {
52
- if (!parseRoles(membership.roles).includes(TENANT_OWNER_ROLE))
54
+ if (seen.has(membership.userId))
53
55
  continue;
56
+ const roles = parseRoles(membership.roles);
57
+ if (!TENANT_KEEP_ACCOUNT_ROLES.some((role) => roles.includes(role)))
58
+ continue;
59
+ seen.add(membership.userId);
54
60
  const user = await ctx.db
55
61
  .global(userTable)
56
62
  .fetchOne({ id: membership.userId });
@@ -121,7 +127,7 @@ async function evaluate(ctx, options, tenantId, rule, stored, now) {
121
127
  if (decision.kind === "none")
122
128
  return state;
123
129
  // Steps with consequences ask other apps first: activity there counts too.
124
- const external = await newestExternalActivity(options, tenantId, now);
130
+ const external = await newestExternalActivity(options, tenantId, now, ctx.db);
125
131
  if (isNewerThanBase(external, state)) {
126
132
  return startNewCycle({ ...state, lastActivityAt: external });
127
133
  }
@@ -1,6 +1,6 @@
1
1
  export declare const TENANT_INACTIVITY_FEATURE = "tenant-inactivity";
2
2
  export declare const TENANT_INACTIVITY_STATE_ENTITY = "tenant-inactivity-state";
3
- export declare const TENANT_OWNER_ROLE = "TenantOwner";
3
+ export declare const TENANT_KEEP_ACCOUNT_ROLES: readonly ["TenantOwner", "TenantAdmin", "Admin"];
4
4
  export declare const TenantInactivityJobs: {
5
5
  readonly check: "tenant-inactivity:job:check-inactive-tenants";
6
6
  };
@@ -1,6 +1,8 @@
1
1
  export const TENANT_INACTIVITY_FEATURE = "tenant-inactivity";
2
2
  export const TENANT_INACTIVITY_STATE_ENTITY = "tenant-inactivity-state";
3
- export const TENANT_OWNER_ROLE = "TenantOwner";
3
+ // Everyone who may react to the warning: the account-close roles plus TenantAdmin, so the mail
4
+ // reaches exactly the people who can open the keep-account link and read the state.
5
+ export const TENANT_KEEP_ACCOUNT_ROLES = ["TenantOwner", "TenantAdmin", "Admin"];
4
6
  export const TenantInactivityJobs = {
5
7
  check: `${TENANT_INACTIVITY_FEATURE}:job:check-inactive-tenants`,
6
8
  };
@@ -2,6 +2,7 @@ import { createTenantDb } from "@cosmicdrift/kumiko-framework/db";
2
2
  import { defineQueryHandler, parseTenantId } from "@cosmicdrift/kumiko-framework/engine";
3
3
  import { AccessDeniedError, UnprocessableError } from "@cosmicdrift/kumiko-framework/errors";
4
4
  import * as z from "zod";
5
+ import { TENANT_KEEP_ACCOUNT_ROLES } from "../constants.js";
5
6
  import { describeOutlook, foldActivity } from "../inactivity-plan.js";
6
7
  import { resolveInactivityRule } from "../options.js";
7
8
  import { loadInactivityState, loadNewestSessionActivity } from "../state-store.js";
@@ -12,7 +13,7 @@ export function createInactivityStateQuery(options) {
12
13
  return defineQueryHandler({
13
14
  name: "state",
14
15
  schema: z.object({ tenantIdOverride: z.string().min(1).max(36).optional() }),
15
- access: { roles: ["TenantOwner", "TenantAdmin", "SystemAdmin"] },
16
+ access: { roles: [...TENANT_KEEP_ACCOUNT_ROLES, "SystemAdmin"] },
16
17
  escapeHatch: { grants: ["unsafeRaw"], reason: STATE_QUERY_ESCAPE_HATCH_REASON },
17
18
  description: "Returns whether the tenant is exempt from inactivity deletion, its last activity, the warnings already sent and the next step with its date; owners and admins see their own tenant, a SystemAdmin any tenant.",
18
19
  handler: async (query, ctx) => {
@@ -2,6 +2,7 @@ import { fetchOne, updateMany } from "@cosmicdrift/kumiko-framework/db";
2
2
  import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
3
3
  import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
4
4
  import * as z from "zod";
5
+ import { TENANT_KEEP_ACCOUNT_ROLES } from "../constants.js";
5
6
  import { redeemKeepAccountToken } from "../keep-token.js";
6
7
  import { tenantInactivityStateTable } from "../state-table.js";
7
8
  const KEEP_ACCOUNT_ESCAPE_HATCH_REASON = "the anonymous link holder has no tenant scope; the tenant comes from the signed token and every statement filters by that tenantId";
@@ -10,7 +11,7 @@ export function createKeepAccountHandler(opts) {
10
11
  name: "keep-account",
11
12
  schema: z.object({ token: z.string().min(1) }),
12
13
  access: {
13
- roles: ["anonymous", "Member", "User", "TenantAdmin", "TenantOwner", "SystemAdmin"],
14
+ roles: ["anonymous", "Member", "User", ...TENANT_KEEP_ACCOUNT_ROLES, "SystemAdmin"],
14
15
  anySignedIn: true,
15
16
  },
16
17
  escapeHatch: { grants: ["unsafeRaw"], reason: KEEP_ACCOUNT_ESCAPE_HATCH_REASON },
@@ -6,6 +6,7 @@ import type { InactivityRule } from "./inactivity-plan.ts";
6
6
  export type TenantActivitySource = (args: {
7
7
  readonly tenantId: TenantId;
8
8
  readonly now: Temporal.Instant;
9
+ readonly db: TenantDb;
9
10
  }) => Promise<Temporal.Instant | null>;
10
11
  type SharedOptions = {
11
12
  /** HMAC key of the keep-account links. Unset: mails link to keepAccountUrl without a token. */
@@ -1,9 +1,10 @@
1
1
  import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
+ export declare const REMOTE_ACTIVITY_TIMEOUT_MS = 60000;
2
3
  type SendRequest = (url: string, init: RequestInit) => Promise<Response>;
3
4
  /**
4
5
  * Asks a sibling app for its newest session activity (the sessions `lastActivityProbeSecret`
5
6
  * route). Use it inside a `TenantActivitySource` so a user active in the other app keeps the
6
- * account alive. Fails closed: any error throws, and the job then sends no mail and files no
7
+ * account alive. Fails closed: any error or timeout throws, and the job then sends no mail and files no
7
8
  * deletion request for that run. `send` exists for tests; production uses the internal egress
8
9
  * pinned to the origin of `url`.
9
10
  */
@@ -11,5 +12,6 @@ export declare function fetchRemoteAppLastActivity(args: {
11
12
  readonly url: string;
12
13
  readonly secret: string;
13
14
  readonly send?: SendRequest;
15
+ readonly timeoutMs?: number;
14
16
  }): Promise<Temporal.Instant | null>;
15
17
  export {};
@@ -2,10 +2,12 @@ import { egress } from "@cosmicdrift/kumiko-framework/http";
2
2
  import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
3
3
  import * as z from "zod";
4
4
  const probeResponseSchema = z.object({ lastActivityAt: z.string().nullable() });
5
+ // A sleeping app (scale-to-zero) needs 23-24 s to wake and up to 45 s on its first start.
6
+ export const REMOTE_ACTIVITY_TIMEOUT_MS = 60_000;
5
7
  /**
6
8
  * Asks a sibling app for its newest session activity (the sessions `lastActivityProbeSecret`
7
9
  * route). Use it inside a `TenantActivitySource` so a user active in the other app keeps the
8
- * account alive. Fails closed: any error throws, and the job then sends no mail and files no
10
+ * account alive. Fails closed: any error or timeout throws, and the job then sends no mail and files no
9
11
  * deletion request for that run. `send` exists for tests; production uses the internal egress
10
12
  * pinned to the origin of `url`.
11
13
  */
@@ -15,6 +17,7 @@ export async function fetchRemoteAppLastActivity(args) {
15
17
  const response = await send(args.url, {
16
18
  method: "GET",
17
19
  headers: { authorization: `Bearer ${args.secret}` },
20
+ signal: AbortSignal.timeout(args.timeoutMs ?? REMOTE_ACTIVITY_TIMEOUT_MS),
18
21
  });
19
22
  if (!response.ok) {
20
23
  throw new Error(`remote activity probe answered ${response.status}`);
@@ -0,0 +1,6 @@
1
+ import { type StaticRequestOptions, type StaticResult } from "@cosmicdrift/kumiko-bundled-features/auth-email-password/static-client";
2
+ export { hrefWithoutUrlToken, readUrlToken, STATIC_NETWORK_REASON, STATIC_RATE_LIMITED_REASON, type StaticFailure, type StaticRequestOptions, type StaticResult, type StaticSuccess, } from "@cosmicdrift/kumiko-bundled-features/auth-email-password/static-client";
3
+ /** Reads `#token=` from the current page and removes it from the address bar. Browser only. */
4
+ export declare function takeKeepAccountToken(): string;
5
+ /** A used, replaced or expired link fails with reason `invalid_or_expired_token`. */
6
+ export declare function keepAccount(token: string, options?: StaticRequestOptions): Promise<StaticResult<undefined>>;
@@ -0,0 +1,15 @@
1
+ // DOM-free "keep my account" page for static sites: fetch plus pure logic only.
2
+ // The link in the warning mail carries the token in the URL fragment (`#token=`), which browsers
3
+ // never send to a server or in a Referer.
4
+ import { dispatchWrite, staticSuccess, takeUrlToken, } from "@cosmicdrift/kumiko-bundled-features/auth-email-password/static-client";
5
+ import { TenantInactivityHandlers } from "./constants.js";
6
+ export { hrefWithoutUrlToken, readUrlToken, STATIC_NETWORK_REASON, STATIC_RATE_LIMITED_REASON, } from "@cosmicdrift/kumiko-bundled-features/auth-email-password/static-client";
7
+ /** Reads `#token=` from the current page and removes it from the address bar. Browser only. */
8
+ export function takeKeepAccountToken() {
9
+ return takeUrlToken("fragment");
10
+ }
11
+ /** A used, replaced or expired link fails with reason `invalid_or_expired_token`. */
12
+ export async function keepAccount(token, options) {
13
+ const result = await dispatchWrite(TenantInactivityHandlers.keepAccount, { token }, options);
14
+ return result.kind === "success" ? staticSuccess(undefined) : result;
15
+ }
@@ -1,4 +1,5 @@
1
1
  export declare const TENANT_LIFECYCLE_FEATURE: "tenant-lifecycle";
2
+ export declare const TENANT_ACCOUNT_CLOSE_ROLES: readonly ["TenantOwner", "Admin"];
2
3
  export declare const TENANT_AGGREGATE_TYPE: "tenant";
3
4
  export declare const DESTRUCTION_REQUESTED_EVENT_SHORT: "destruction-requested";
4
5
  export declare const DESTRUCTION_CANCELLED_EVENT_SHORT: "destruction-cancelled";
@@ -1,4 +1,5 @@
1
1
  export const TENANT_LIFECYCLE_FEATURE = "tenant-lifecycle";
2
+ export const TENANT_ACCOUNT_CLOSE_ROLES = ["TenantOwner", "Admin"];
2
3
  export const TENANT_AGGREGATE_TYPE = "tenant";
3
4
  const EVENT_PREFIX = `${TENANT_LIFECYCLE_FEATURE}:event:`;
4
5
  export const DESTRUCTION_REQUESTED_EVENT_SHORT = "destruction-requested";
@@ -5,14 +5,14 @@ import { appendDomainEventCore } from "@cosmicdrift/kumiko-framework/pipeline";
5
5
  import * as z from "zod";
6
6
  import { isWithinGracePeriod } from "../../shared/index.js";
7
7
  import { tenantEntity, tenantTable } from "../../tenant/index.js";
8
- import { DESTRUCTION_CANCELLED_EVENT_QN, TENANT_LIFECYCLE_FEATURE } from "../constants.js";
8
+ import { DESTRUCTION_CANCELLED_EVENT_QN, TENANT_ACCOUNT_CLOSE_ROLES, TENANT_LIFECYCLE_FEATURE, } from "../constants.js";
9
9
  import { invalidateTenantLifecycleGate } from "../lifecycle-gate.js";
10
10
  const crud = createEventStoreExecutor(tenantTable, tenantEntity, { entityName: "tenant" });
11
11
  const CANCEL_DESTRUCTION_TENANT_ROW_REASON = "reads the caller's tenant row (a global row on the system tenant) and appends to the tenant stream on the system tenant";
12
12
  export const cancelDestructionWrite = defineWriteHandler({
13
13
  name: "cancel-destruction",
14
14
  schema: z.object({}),
15
- access: { roles: ["TenantOwner", "Admin"] },
15
+ access: { roles: TENANT_ACCOUNT_CLOSE_ROLES },
16
16
  description: "Returns a tenant whose destruction was requested back to active and clears the grace period; use it to undo a close-account request while the grace period is still running.",
17
17
  escapeHatch: {
18
18
  grants: ["unsafeRaw"],
@@ -1,11 +1,12 @@
1
1
  import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
2
2
  import * as z from "zod";
3
+ import { TENANT_ACCOUNT_CLOSE_ROLES } from "../constants.js";
3
4
  import { requestTenantDestruction } from "../request-tenant-destruction.js";
4
5
  const REQUEST_DESTRUCTION_TENANT_ROW_REASON = "reads the caller's tenant row (a global row on the system tenant), its compliance profile, appends to the tenant stream on the system tenant and revokes its sessions via DbRunner helpers";
5
6
  export const requestDestructionWrite = defineWriteHandler({
6
7
  name: "request-destruction",
7
8
  schema: z.object({}),
8
- access: { roles: ["TenantOwner", "Admin"] },
9
+ access: { roles: TENANT_ACCOUNT_CLOSE_ROLES },
9
10
  description: "Puts the caller's own tenant into destroyRequested, starts the compliance-profile grace period after which its data is erased, and revokes every session in the tenant; use it when an account owner asks to close their account.",
10
11
  agent: { risk: "high" },
11
12
  escapeHatch: {
@@ -1,5 +1,5 @@
1
1
  export { archiveAndDeleteTenantRows, TENANT_DESTROY_ARCHIVE_REASON, TENANT_DESTROY_ARCHIVED_BY, } from "./archive-and-delete-tenant-rows.ts";
2
- export { TENANT_DESTRUCTION_STAGE_FAILED_EVENT_QN, TENANT_DESTRUCTION_STAGE_PROGRESSED_EVENT_QN, TENANT_DESTRUCTION_STAGES, TENANT_LIFECYCLE_FEATURE, TenantLifecycleHandlers, } from "./constants.ts";
2
+ export { TENANT_ACCOUNT_CLOSE_ROLES, TENANT_DESTRUCTION_STAGE_FAILED_EVENT_QN, TENANT_DESTRUCTION_STAGE_PROGRESSED_EVENT_QN, TENANT_DESTRUCTION_STAGES, TENANT_LIFECYCLE_FEATURE, TenantLifecycleHandlers, } from "./constants.ts";
3
3
  export { createTenantLifecycleFeature } from "./feature.ts";
4
4
  export { type RequestTenantDestructionArgs, requestTenantDestruction, } from "./request-tenant-destruction.ts";
5
5
  export { resolveTenantLifecycleGate } from "./run-tenant-destroy.ts";
@@ -1,5 +1,5 @@
1
1
  export { archiveAndDeleteTenantRows, TENANT_DESTROY_ARCHIVE_REASON, TENANT_DESTROY_ARCHIVED_BY, } from "./archive-and-delete-tenant-rows.js";
2
- export { TENANT_DESTRUCTION_STAGE_FAILED_EVENT_QN, TENANT_DESTRUCTION_STAGE_PROGRESSED_EVENT_QN, TENANT_DESTRUCTION_STAGES, TENANT_LIFECYCLE_FEATURE, TenantLifecycleHandlers, } from "./constants.js";
2
+ export { TENANT_ACCOUNT_CLOSE_ROLES, TENANT_DESTRUCTION_STAGE_FAILED_EVENT_QN, TENANT_DESTRUCTION_STAGE_PROGRESSED_EVENT_QN, TENANT_DESTRUCTION_STAGES, TENANT_LIFECYCLE_FEATURE, TenantLifecycleHandlers, } from "./constants.js";
3
3
  export { createTenantLifecycleFeature } from "./feature.js";
4
4
  export { requestTenantDestruction, } from "./request-tenant-destruction.js";
5
5
  export { resolveTenantLifecycleGate } from "./run-tenant-destroy.js";
@@ -0,0 +1,15 @@
1
+ import { type StaticResult } from "@cosmicdrift/kumiko-bundled-features/auth-email-password/static-client";
2
+ export { STATIC_NETWORK_REASON, STATIC_RATE_LIMITED_REASON, type StaticFailure, type StaticResult, type StaticSuccess, } from "@cosmicdrift/kumiko-bundled-features/auth-email-password/static-client";
3
+ export type WaitlistSubmission = {
4
+ readonly name: string;
5
+ readonly email: string;
6
+ readonly company?: string;
7
+ readonly portfolio?: string;
8
+ readonly message?: string;
9
+ /** BCP 47 tag of the page language; also picks the language of the confirmation mail. */
10
+ readonly locale: string;
11
+ /** Honeypot: render it as a hidden field named `website` and pass its value through unchanged. */
12
+ readonly website?: string;
13
+ };
14
+ /** Success reads the same for a new and an already listed address. */
15
+ export declare function submitToWaitlist(submission: WaitlistSubmission): Promise<StaticResult<undefined>>;
@@ -0,0 +1,24 @@
1
+ // DOM-free waitlist sign-up for static sites: fetch plus pure logic only.
2
+ import { dispatchWrite, staticSuccess, } from "@cosmicdrift/kumiko-bundled-features/auth-email-password/static-client";
3
+ import { WaitlistHandlers } from "./web/constants.js";
4
+ export { STATIC_NETWORK_REASON, STATIC_RATE_LIMITED_REASON, } from "@cosmicdrift/kumiko-bundled-features/auth-email-password/static-client";
5
+ function nonBlank(value) {
6
+ return value === undefined || value.trim() === "" ? undefined : value;
7
+ }
8
+ /** Success reads the same for a new and an already listed address. */
9
+ export async function submitToWaitlist(submission) {
10
+ const { name, email, locale, website } = submission;
11
+ const company = nonBlank(submission.company);
12
+ const portfolio = nonBlank(submission.portfolio);
13
+ const message = nonBlank(submission.message);
14
+ const result = await dispatchWrite(WaitlistHandlers.submit, {
15
+ name,
16
+ email,
17
+ locale,
18
+ ...(company !== undefined && { company }),
19
+ ...(portfolio !== undefined && { portfolio }),
20
+ ...(message !== undefined && { message }),
21
+ ...(website !== undefined && { website }),
22
+ }, { locale });
23
+ return result.kind === "success" ? staticSuccess(undefined) : result;
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-bundled-features",
3
- "version": "0.410.0",
3
+ "version": "0.412.0",
4
4
  "description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
5
5
  "license": "MIT",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -304,6 +304,14 @@
304
304
  "types": "./dist/tenant-inactivity/index.d.ts",
305
305
  "default": "./dist/tenant-inactivity/index.js"
306
306
  },
307
+ "./tenant-inactivity/constants": {
308
+ "types": "./dist/tenant-inactivity/constants.d.ts",
309
+ "default": "./dist/tenant-inactivity/constants.js"
310
+ },
311
+ "./tenant-inactivity/static-keep-account": {
312
+ "types": "./dist/tenant-inactivity/static-keep-account.d.ts",
313
+ "default": "./dist/tenant-inactivity/static-keep-account.js"
314
+ },
307
315
  "./tenant-inactivity/email-templates": {
308
316
  "types": "./dist/tenant-inactivity/email-templates.d.ts",
309
317
  "default": "./dist/tenant-inactivity/email-templates.js"
@@ -364,6 +372,14 @@
364
372
  "types": "./dist/auth-email-password/web/static-login.d.ts",
365
373
  "default": "./dist/auth-email-password/web/static-login.js"
366
374
  },
375
+ "./auth-email-password/static-account": {
376
+ "types": "./dist/auth-email-password/web/static-account.d.ts",
377
+ "default": "./dist/auth-email-password/web/static-account.js"
378
+ },
379
+ "./auth-email-password/static-client": {
380
+ "types": "./dist/auth-email-password/web/static-client.d.ts",
381
+ "default": "./dist/auth-email-password/web/static-client.js"
382
+ },
367
383
  "./auth-email-password/seeding": {
368
384
  "types": "./dist/auth-email-password/seeding.d.ts",
369
385
  "default": "./dist/auth-email-password/seeding.js"
@@ -544,6 +560,10 @@
544
560
  "types": "./dist/contact/index.d.ts",
545
561
  "default": "./dist/contact/index.js"
546
562
  },
563
+ "./presence": {
564
+ "types": "./dist/presence/index.d.ts",
565
+ "default": "./dist/presence/index.js"
566
+ },
547
567
  "./contact/web": {
548
568
  "types": "./dist/contact/web/index.d.ts",
549
569
  "default": "./dist/contact/web/index.js"
@@ -556,6 +576,10 @@
556
576
  "types": "./dist/waitlist/index.d.ts",
557
577
  "default": "./dist/waitlist/index.js"
558
578
  },
579
+ "./waitlist/static-submit": {
580
+ "types": "./dist/waitlist/static-submit.d.ts",
581
+ "default": "./dist/waitlist/static-submit.js"
582
+ },
559
583
  "./page-render": {
560
584
  "types": "./dist/page-render/index.d.ts",
561
585
  "default": "./dist/page-render/index.js"
@@ -590,9 +614,9 @@
590
614
  }
591
615
  },
592
616
  "dependencies": {
593
- "@cosmicdrift/kumiko-framework": "0.410.0",
594
- "@cosmicdrift/kumiko-renderer": "0.410.0",
595
- "@cosmicdrift/kumiko-types": "0.410.0",
617
+ "@cosmicdrift/kumiko-framework": "0.412.0",
618
+ "@cosmicdrift/kumiko-renderer": "0.412.0",
619
+ "@cosmicdrift/kumiko-types": "0.412.0",
596
620
  "@mollie/api-client": "^4.6.0",
597
621
  "@node-rs/argon2": "^2.2.2",
598
622
  "@tiptap/core": "^3.32.2",
@@ -912,6 +936,14 @@
912
936
  "types": "./dist/tenant-inactivity/index.d.ts",
913
937
  "default": "./dist/tenant-inactivity/index.js"
914
938
  },
939
+ "./tenant-inactivity/constants": {
940
+ "types": "./dist/tenant-inactivity/constants.d.ts",
941
+ "default": "./dist/tenant-inactivity/constants.js"
942
+ },
943
+ "./tenant-inactivity/static-keep-account": {
944
+ "types": "./dist/tenant-inactivity/static-keep-account.d.ts",
945
+ "default": "./dist/tenant-inactivity/static-keep-account.js"
946
+ },
915
947
  "./tenant-inactivity/email-templates": {
916
948
  "types": "./dist/tenant-inactivity/email-templates.d.ts",
917
949
  "default": "./dist/tenant-inactivity/email-templates.js"
@@ -972,6 +1004,14 @@
972
1004
  "types": "./dist/auth-email-password/web/static-login.d.ts",
973
1005
  "default": "./dist/auth-email-password/web/static-login.js"
974
1006
  },
1007
+ "./auth-email-password/static-account": {
1008
+ "types": "./dist/auth-email-password/web/static-account.d.ts",
1009
+ "default": "./dist/auth-email-password/web/static-account.js"
1010
+ },
1011
+ "./auth-email-password/static-client": {
1012
+ "types": "./dist/auth-email-password/web/static-client.d.ts",
1013
+ "default": "./dist/auth-email-password/web/static-client.js"
1014
+ },
975
1015
  "./auth-email-password/seeding": {
976
1016
  "types": "./dist/auth-email-password/seeding.d.ts",
977
1017
  "default": "./dist/auth-email-password/seeding.js"
@@ -1152,6 +1192,10 @@
1152
1192
  "types": "./dist/contact/index.d.ts",
1153
1193
  "default": "./dist/contact/index.js"
1154
1194
  },
1195
+ "./presence": {
1196
+ "types": "./dist/presence/index.d.ts",
1197
+ "default": "./dist/presence/index.js"
1198
+ },
1155
1199
  "./contact/web": {
1156
1200
  "types": "./dist/contact/web/index.d.ts",
1157
1201
  "default": "./dist/contact/web/index.js"
@@ -1164,6 +1208,10 @@
1164
1208
  "types": "./dist/waitlist/index.d.ts",
1165
1209
  "default": "./dist/waitlist/index.js"
1166
1210
  },
1211
+ "./waitlist/static-submit": {
1212
+ "types": "./dist/waitlist/static-submit.d.ts",
1213
+ "default": "./dist/waitlist/static-submit.js"
1214
+ },
1167
1215
  "./page-render": {
1168
1216
  "types": "./dist/page-render/index.d.ts",
1169
1217
  "default": "./dist/page-render/index.js"
@@ -1206,19 +1254,19 @@
1206
1254
  "LICENSE"
1207
1255
  ],
1208
1256
  "devDependencies": {
1209
- "@cosmicdrift/kumiko-locale-de": "0.410.0",
1210
- "@cosmicdrift/kumiko-locale-es": "0.410.0",
1211
- "@cosmicdrift/kumiko-locale-fr": "0.410.0",
1212
- "@cosmicdrift/kumiko-locale-it": "0.410.0",
1213
- "@cosmicdrift/kumiko-renderer-mail-html": "0.410.0",
1214
- "@cosmicdrift/kumiko-testing": "0.410.0",
1257
+ "@cosmicdrift/kumiko-locale-de": "0.412.0",
1258
+ "@cosmicdrift/kumiko-locale-es": "0.412.0",
1259
+ "@cosmicdrift/kumiko-locale-fr": "0.412.0",
1260
+ "@cosmicdrift/kumiko-locale-it": "0.412.0",
1261
+ "@cosmicdrift/kumiko-renderer-mail-html": "0.412.0",
1262
+ "@cosmicdrift/kumiko-testing": "0.412.0",
1215
1263
  "@testing-library/user-event": "^14.6.8",
1216
1264
  "@types/sanitize-html": "^2.16.2",
1217
1265
  "jsqr": "^1.4.0",
1218
1266
  "unpdf": "^1.9.1"
1219
1267
  },
1220
1268
  "peerDependencies": {
1221
- "@cosmicdrift/kumiko-testing": "0.410.0"
1269
+ "@cosmicdrift/kumiko-testing": "0.412.0"
1222
1270
  },
1223
1271
  "peerDependenciesMeta": {
1224
1272
  "@cosmicdrift/kumiko-testing": {
@@ -1,4 +1,28 @@
1
1
  [
2
+ {
3
+ "version": "0.412.0",
4
+ "type": "improvement",
5
+ "title": "kumiko api-docs generates HTTP API docs from the registry and the PAT scopes",
6
+ "detail": "`kumiko api-docs [--out <dir>] [--locales en,de] [--check]` reads `kumiko.config.ts` and writes `<out>/openapi.json` (OpenAPI 3.1 with only the handlers some PAT scope reaches, one request wrapper per handler with a `type` discriminator), `<out>/<locale>/overview.md` (endpoints, body, envelopes, error codes with HTTP status, versions, lists, batches, safe retries), `<out>/<locale>/tokens.md` (create path from the app's nav labels, scope table, expiry, rate limit, errors, revoke, security, optional plan note) and `<out>/<locale>/reference/<scope>.md` (per handler: title, description, required grant, field table, curl example, recorded response), plus `<out>/index.json` with order, source versions and language independent anchor ids per heading. Output is plain GFM with only `title` and `description` in the frontmatter, so Astro and Starlight render it as is, and it is byte identical for the same input. New `AppConfig.apiDocs` options: `appName`, `baseUrl` (required), `locales`, `planNote`, `uiOnlyWrites` (pattern plus reason), `texts` (paragraph overrides per locale) and `examplesDir`. `--check` writes nothing and exits 1 when a handler in a scope has no description or no description translation (new gap kind `handlerWithoutDescriptionTranslation`, key `handlerDescriptionKey(qn)`), when a write that a screen triggers lies in no scope and is not listed in `uiOnlyWrites`, when a `uiOnlyWrites` entry matches nothing, or when the committed output differs. Known gap: the screen write check only looks at features with at least one handler in a scope. New exports: `frameworkErrorHttpStatus`, `FrameworkErrorCode`, `patAuthRejectHttpStatus`, `PAT_RATE_LIMITED_CODE`, `qnMatches`, `patAllows`, `handlerDescriptionKey`, `patScopesFromFeature`, `PAT_MAX_EXPIRES_IN_DAYS`, and `ApiExampleFileSchema` from `@cosmicdrift/kumiko-types/api-example`."
7
+ },
8
+ {
9
+ "version": "0.412.0",
10
+ "type": "improvement",
11
+ "title": "api-docs token guide covers client code, logs and leaks",
12
+ "detail": "The security list in `tokens.md` now says never to keep a token in an app or web page or in a log, and to revoke a token at once if it may have leaked, in all five locales. Regenerate with `kumiko api-docs`; `--check` reports the changed `tokens.md` until then."
13
+ },
14
+ {
15
+ "version": "0.412.0",
16
+ "type": "improvement",
17
+ "title": "api-docs names events by wireName and skips system-only handlers",
18
+ "detail": "`events.md` headings and anchors, the OpenAPI `webhooks` keys and their `summary` use the wire name; the contract QN stays as `x-kumiko-qn` in OpenAPI and as the anchor `qn` in `index.json`. Write and query handlers whose `access.roles` are only `[\"system\"]` are no longer documented, even when a scope pattern such as `app:write:monitor:*` matches them, and the `uiWriteOutsideScopes` check ignores them."
19
+ },
20
+ {
21
+ "version": "0.412.0",
22
+ "type": "improvement",
23
+ "title": "kumiko api-docs documents webhook events",
24
+ "detail": "When a scope lists events, the output gains `<locale>/events.md` (delivery text from `apiDocs.webhookDelivery`, versioning rules, one section per event with fields and a recorded example), an OpenAPI 3.1 `webhooks` section keyed by event name and an `events` page in `index.json`. New problems `webhookDeliveryTextMissing` and `webhookEventWithoutDescriptionTranslation`. Field descriptions come from `.describe()` on declared payloads and from the entity field translations on derived ones. `ApiDocsInput.webhookExamples` is optional; `kumiko api-docs` reads `<examplesDir>/webhooks/*.json`."
25
+ },
2
26
  {
3
27
  "version": "0.409.0",
4
28
  "type": "improvement",
@@ -1,4 +1,28 @@
1
1
  [
2
+ {
3
+ "version": "0.411.0",
4
+ "type": "improvement",
5
+ "title": "SignupScreen shows a closed state while self-registration is off",
6
+ "detail": "With a mounted dispatcher the screen asks `auth-email-password:query:signup-registration-status`. While `enabled` is false it renders the notice `auth.signup.closed` (de: \"Die Registrierung ist derzeit nur mit Einladung möglich.\") plus the login link instead of the form, and sends nothing. A failed status query reads as open. The status query needs a mounted `DispatcherProvider`; in standalone auth mounts without one the form always shows and the server still rejects `signup-request`. New key `auth.signup.closed` in en, de, es, fr and it."
7
+ },
8
+ {
9
+ "version": "0.411.0",
10
+ "type": "improvement",
11
+ "title": "auth-email-password/static-account, DOM-free account page clients",
12
+ "detail": "`@cosmicdrift/kumiko-bundled-features/auth-email-password/static-account` exports `fetchSignupRegistrationStatus`, `requestPasswordReset`, `resetPassword`, `verifyEmail`, `requestAccountUnlock`, `confirmAccountUnlock`, `logout`, `isSignedOutFailure`, `fetchInviteInfo`, `acceptInviteSignedIn`, `acceptInviteWithLogin` and `acceptInviteWithNewAccount` for plain Astro scripts, plus `takeUrlToken(\"query\" | \"fragment\")` to read a mail-link token and remove it from the address bar. Every call returns a `kind: \"success\" | \"failure\"` union with a `reason` and, for rate limits, `retryAfterSeconds`; a 401 without an error code reads as `unauthenticated`; none throws for an expected failure; a malformed CSRF cookie sends no CSRF header instead of failing the request. A `landingPath` from the server is passed on only when it is a safe same-origin path. The shared request core with the result types is exported as `auth-email-password/static-client`."
13
+ },
14
+ {
15
+ "version": "0.411.0",
16
+ "type": "improvement",
17
+ "title": "seedAdmin works without a password",
18
+ "detail": "`SeedAdminOptions.password` is optional. Without it the account is created without a password hash and sets one through the password-reset flow. An existing account with the same email keeps its hash, as before."
19
+ },
20
+ {
21
+ "version": "0.411.0",
22
+ "type": "fix",
23
+ "title": "Bootstrap admin seed is one-shot",
24
+ "detail": "`seedBootstrapAdmin` skips when the target tenant already has another member (also a removed one), so a deleted owner or one who changed their email is not re-created as a passwordless SystemAdmin on the next boot. Our own passwordless account without membership is still completed, and the has-password skip now re-checks the row right before the grants."
25
+ },
2
26
  {
3
27
  "version": "0.405.0",
4
28
  "type": "improvement",
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": "0.412.0",
4
+ "type": "fix",
5
+ "title": "documents filed from a mail attachment are visible to whoever may read the mail",
6
+ "detail": "The `inbound-message` read model now declares `access.read` for the member roles: shared mailboxes are readable by every member, a personal mailbox only by its owner, admins included. `createInboundMessageEntity(memberRoles)` builds the entity for the configured roles; `inboundMessageEntity` stays exported with the default roles. The message queries filter rows as before and do not use this rule."
7
+ },
2
8
  {
3
9
  "version": "0.409.0",
4
10
  "type": "fix",
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": "0.411.0",
4
+ "type": "fix",
5
+ "title": "IMAP polling works again for mailboxes given as a host name",
6
+ "detail": "Since 0.393 the host guard resolves every host name to its IP, and the IMAP client then overrode the TLS `servername` with undefined, so the certificate was checked against the IP and every poll ended in InboundTransientError. The pinned host name now goes to tls as the servername; IP-literal hosts still connect without SNI. SMTP was not affected: nodemailer receives the original name as `servername`."
7
+ },
2
8
  {
3
9
  "version": "0.395.0",
4
10
  "type": "fix",
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": "0.412.0",
4
+ "type": "improvement",
5
+ "title": "token scopes list the webhook events they release",
6
+ "detail": "`PatScopeDef.events` takes exact event names (no globs). Holding the scope at read or write level is enough to subscribe, `expandScopeEvents(config, granted)` returns the union. Boot fails when a scope lists an event without a public contract, for example an internal `r.defineEvent`. Revoking a token now has a title and a field label in every bundle locale."
7
+ },
2
8
  {
3
9
  "version": "0.385.0",
4
10
  "type": "improvement",
@@ -0,0 +1,8 @@
1
+ [
2
+ {
3
+ "version": "0.411.0",
4
+ "type": "improvement",
5
+ "title": "New bundled feature presence: who else is on this record right now",
6
+ "detail": "`createPresenceFeature({ entities, roles?, ttlSeconds? })` lets a browser announce that the user is viewing or editing one row of an allow-listed entity (`presence:write:heartbeat` every 15 seconds, `presence:write:leave` on close) and answers with the other people on it; `presence:query:list` returns them for up to 100 rows of a list. It only informs and never locks. State is ephemeral in a Redis hash per session tenant, entity and row (in memory without Redis), holds user ids only and expires after `ttlSeconds` (default 45) without a heartbeat; display names are resolved per response. A caller sees presence only for rows they can read; other rows answer 404. Defaults to TenantAdmin and TenantMember, entities default to none, the handlers are hidden from the AI agent. A Redis or SSE outage logs a warning and answers with an empty room. On a change the other people on the row get an addressed live signal through the new handler service `ctx.services.userLiveSignals`, which pushes SSE frames to named users of the caller's own tenant. The renderer hooks `usePresence` and `usePresenceList` and the widgets `PresenceNotice` and `PresenceAvatars` stay silent when the feature is not mounted."
7
+ }
8
+ ]
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "version": "0.411.0",
4
+ "type": "improvement",
5
+ "title": "Warning mails reach Admins, activity sources get the tenant db, sessions probe secret from env",
6
+ "detail": "The inactivity warning mail goes to every member with the `TenantOwner`, `TenantAdmin` or `Admin` role (`TENANT_KEEP_ACCOUNT_ROLES`, also the roles of the keep-account and state handlers), once per user. An activity source that reports a time in the future is capped at the current time. `TenantActivitySource` now receives `{ tenantId, now, db }` with `db: TenantDb`, so a source can read the tenant's own data; existing sources that ignore the extra field keep working. The sessions feature falls back to the `SESSIONS_LAST_ACTIVITY_PROBE_SECRET` environment variable when `lastActivityProbeSecret` is not set, so apps that mount sessions without options can serve the last-activity probe. A value shorter than 32 characters fails the boot with a message that names the variable but not its value; an unset variable keeps the probe off. Client code can import the handler names from `@cosmicdrift/kumiko-bundled-features/tenant-inactivity/constants` (`TenantInactivityHandlers`, `TenantInactivityJobs`) without pulling the server barrel (ioredis, `tls`) into the browser bundle."
7
+ },
8
+ {
9
+ "version": "0.411.0",
10
+ "type": "improvement",
11
+ "title": "tenant-inactivity/static-keep-account, a DOM-free keep-account client",
12
+ "detail": "`@cosmicdrift/kumiko-bundled-features/tenant-inactivity/static-keep-account` exports `keepAccount(token)`, which posts `tenant-inactivity:write:keep-account`, and `takeKeepAccountToken()`, which reads the `#token=` fragment of the mail link and removes it from the address bar. Results use the same `kind: \"success\" | \"failure\"` union as the other static clients; an expired or replaced link is a failure."
13
+ },
2
14
  {
3
15
  "version": "0.407.0",
4
16
  "type": "improvement",
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": "0.411.0",
4
+ "type": "improvement",
5
+ "title": "waitlist/static-submit, a DOM-free waitlist sign-up client",
6
+ "detail": "`@cosmicdrift/kumiko-bundled-features/waitlist/static-submit` exports `submitToWaitlist(submission)` for plain Astro scripts: fetch plus pure logic, no renderer, React or `window` at import time. It posts `waitlist:write:submit` same-origin with name, email, optional company, portfolio and message, the page locale (also sent as `X-Locale`) and the honeypot field `website`. Blank optional fields are dropped. The result is a discriminated union `{ kind: \"success\"; data } | { kind: \"failure\"; reason; message?; retryAfterSeconds? }`; a network error is the reason `network`, a 429 is `rate_limited`."
7
+ },
2
8
  {
3
9
  "version": "0.410.0",
4
10
  "type": "fix",