@cosmicdrift/kumiko-samples 0.413.0 → 0.414.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.
- package/package.json +1 -1
- package/packages/bundled-features/package.json +16 -1
- package/packages/bundled-features/src/admin-shell/changes.json +6 -0
- package/packages/bundled-features/src/admin-shell/feature.ts +8 -7
- package/packages/bundled-features/src/agent-tools/agent-doc-lint.ts +5 -1
- package/packages/bundled-features/src/agent-tools/agent-manifest.ts +36 -27
- package/packages/bundled-features/src/agent-tools/api-docs/collect-events.ts +8 -1
- package/packages/bundled-features/src/agent-tools/api-docs/collect.ts +3 -2
- package/packages/bundled-features/src/agent-tools/api-docs/generate.ts +6 -0
- package/packages/bundled-features/src/agent-tools/api-docs/index.ts +1 -0
- package/packages/bundled-features/src/agent-tools/api-docs/problems.ts +38 -1
- package/packages/bundled-features/src/agent-tools/api-docs/render-openapi.ts +1 -0
- package/packages/bundled-features/src/agent-tools/api-docs/resolve-config.ts +17 -0
- package/packages/bundled-features/src/agent-tools/api-docs/scope-slug-collisions.ts +17 -0
- package/packages/bundled-features/src/agent-tools/api-docs/translation-gaps.ts +42 -0
- package/packages/bundled-features/src/agent-tools/api-docs/webhook-example-problems.ts +30 -0
- package/packages/bundled-features/src/agent-tools/changes.json +12 -0
- package/packages/bundled-features/src/agent-tools/index.ts +1 -0
- package/packages/bundled-features/src/agent-tools/labels.ts +19 -6
- package/packages/bundled-features/src/agent-tools/tool-catalog.ts +18 -7
- package/packages/bundled-features/src/agent-tools/tool-dispatch.ts +14 -1
- package/packages/bundled-features/src/agent-tools/types.ts +4 -0
- package/packages/bundled-features/src/audit/event-classification.ts +6 -0
- package/packages/bundled-features/src/audit/web/i18n.ts +1 -0
- package/packages/bundled-features/src/auth-email-password/changes.json +18 -0
- package/packages/bundled-features/src/auth-email-password/errors.ts +0 -13
- package/packages/bundled-features/src/auth-email-password/handlers/invite-signup-complete.write.ts +147 -121
- package/packages/bundled-features/src/auth-email-password/handlers/login-options.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-account-unlock.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-email-verification.write.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-password-reset.write.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/handlers/self-registration-status.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/reset-token.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/seeding.ts +39 -7
- package/packages/bundled-features/src/auth-email-password/unlock-token.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/verification-token.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/web/auth-form-primitives.tsx +2 -2
- package/packages/bundled-features/src/auth-email-password/web/auth-gate.tsx +2 -2
- package/packages/bundled-features/src/auth-email-password/web/auth-redirect.ts +5 -0
- package/packages/bundled-features/src/auth-email-password/web/forgot-password-screen.tsx +1 -6
- package/packages/bundled-features/src/auth-email-password/web/invite-accept-screen.tsx +1 -1
- package/packages/bundled-features/src/auth-email-password/web/return-path.ts +2 -1
- package/packages/bundled-features/src/auth-email-password/web/session.tsx +10 -12
- package/packages/bundled-features/src/auth-email-password/web/signup-screen.tsx +1 -6
- package/packages/bundled-features/src/auth-email-password/web/static-account.ts +6 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-switcher.tsx +1 -1
- package/packages/bundled-features/src/auth-email-password/web/token-confirm-screen.tsx +4 -5
- package/packages/bundled-features/src/auth-email-password/web/user-menu.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-code-or-recovery-field.tsx +17 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-disable-dialog.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-regenerate-recovery-dialog.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-setup-preauth-screen.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-verify-screen.tsx +16 -47
- package/packages/bundled-features/src/auth-mfa-user-data/index.ts +5 -6
- package/packages/bundled-features/src/billing-foundation/aggregate-id.ts +0 -4
- package/packages/bundled-features/src/billing-foundation/changes.json +37 -0
- package/packages/bundled-features/src/billing-foundation/checkout-core.ts +8 -1
- package/packages/bundled-features/src/billing-foundation/checkout-ledger.ts +59 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-gate.ts +2 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-text.ts +49 -2
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-open-cancels.ts +5 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-provider-timeout.ts +23 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-record.ts +12 -7
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-revoke.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/events.ts +49 -10
- package/packages/bundled-features/src/billing-foundation/feature.ts +15 -1
- package/packages/bundled-features/src/billing-foundation/handlers/billing-plans.query.ts +47 -14
- package/packages/bundled-features/src/billing-foundation/handlers/create-checkout-session.write.ts +7 -1
- package/packages/bundled-features/src/billing-foundation/handlers/process-event.write.ts +124 -10
- package/packages/bundled-features/src/billing-foundation/handlers/process-payment-event.write.ts +33 -9
- package/packages/bundled-features/src/billing-foundation/handlers/record-checkout-opened.write.ts +25 -0
- package/packages/bundled-features/src/billing-foundation/handlers/start-plan-checkout.write.ts +7 -1
- package/packages/bundled-features/src/billing-foundation/handlers/switch-plan.write.ts +16 -4
- package/packages/bundled-features/src/billing-foundation/i18n.ts +3 -0
- package/packages/bundled-features/src/billing-foundation/pending-plan-switch.ts +80 -0
- package/packages/bundled-features/src/billing-foundation/scrub-raw-payload-headers.ts +50 -0
- package/packages/bundled-features/src/billing-foundation/types.ts +47 -30
- package/packages/bundled-features/src/billing-foundation/validate-options.ts +18 -0
- package/packages/bundled-features/src/billing-foundation/web/billing-plans-panel.tsx +10 -5
- package/packages/bundled-features/src/billing-foundation/web/cancel-contract-dialog.tsx +1 -1
- package/packages/bundled-features/src/billing-foundation/web/checkout-consent-dialog.tsx +1 -1
- package/packages/bundled-features/src/billing-foundation/web/constants.ts +5 -2
- package/packages/bundled-features/src/billing-foundation/web/plan-switch-confirm-dialog.tsx +1 -1
- package/packages/bundled-features/src/billing-foundation/webhook-handler.ts +65 -17
- package/packages/bundled-features/src/cap-counter/aggregate-id.ts +0 -2
- package/packages/bundled-features/src/cap-counter/changes.json +6 -0
- package/packages/bundled-features/src/cap-counter/stock-cap-guard.ts +19 -4
- package/packages/bundled-features/src/cap-overview/changes.json +6 -0
- package/packages/bundled-features/src/cap-overview/handlers/tenant-caps-list.query.ts +22 -6
- package/packages/bundled-features/src/cap-overview/i18n.ts +1 -0
- package/packages/bundled-features/src/cap-overview/index.ts +1 -0
- package/packages/bundled-features/src/cap-overview/types.ts +11 -1
- package/packages/bundled-features/src/cap-overview/web/cap-cards-panel.tsx +6 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-bar.tsx +10 -1
- package/packages/bundled-features/src/cap-overview/web/usage-math.ts +5 -0
- package/packages/bundled-features/src/channel-in-app/changes.json +6 -0
- package/packages/bundled-features/src/channel-in-app/handlers/read-state-by-keys.query.ts +2 -2
- package/packages/bundled-features/src/channel-whatsapp/aggregate-id.ts +29 -0
- package/packages/bundled-features/src/channel-whatsapp/changes.json +8 -0
- package/packages/bundled-features/src/channel-whatsapp/constants.ts +46 -0
- package/packages/bundled-features/src/channel-whatsapp/events.ts +93 -0
- package/packages/bundled-features/src/channel-whatsapp/feature.ts +72 -0
- package/packages/bundled-features/src/channel-whatsapp/graph-client.ts +398 -0
- package/packages/bundled-features/src/channel-whatsapp/in-memory-meta.ts +300 -0
- package/packages/bundled-features/src/channel-whatsapp/inbound-handlers.ts +189 -0
- package/packages/bundled-features/src/channel-whatsapp/index.ts +66 -0
- package/packages/bundled-features/src/channel-whatsapp/meta-signature.ts +26 -0
- package/packages/bundled-features/src/channel-whatsapp/options.ts +149 -0
- package/packages/bundled-features/src/channel-whatsapp/pii.ts +109 -0
- package/packages/bundled-features/src/channel-whatsapp/webhook-normalize.ts +226 -0
- package/packages/bundled-features/src/channel-whatsapp/webhook-routes.ts +185 -0
- package/packages/bundled-features/src/compliance-profiles/handlers/sub-processors.query.ts +1 -1
- package/packages/bundled-features/src/config/changes.json +12 -0
- package/packages/bundled-features/src/config/handlers/set.write.ts +7 -0
- package/packages/bundled-features/src/config/handlers/values.query.ts +8 -1
- package/packages/bundled-features/src/config/index.ts +1 -0
- package/packages/bundled-features/src/config/read-redaction.ts +6 -3
- package/packages/bundled-features/src/config/table.ts +1 -0
- package/packages/bundled-features/src/config/write-helpers.ts +3 -2
- package/packages/bundled-features/src/crypto-shredding/changes.json +18 -0
- package/packages/bundled-features/src/crypto-shredding/constants.ts +2 -0
- package/packages/bundled-features/src/crypto-shredding/handlers/forget-subject.write.ts +38 -18
- package/packages/bundled-features/src/crypto-shredding/index.ts +4 -0
- package/packages/bundled-features/src/crypto-shredding/subject-forget-after-delete-hook.ts +49 -0
- package/packages/bundled-features/src/custom-fields/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/custom-fields/entity.ts +1 -0
- package/packages/bundled-features/src/custom-fields/wire-for-entity.ts +0 -1
- package/packages/bundled-features/src/data-retention/changes.json +18 -0
- package/packages/bundled-features/src/data-retention/erase-notes-of-deleted-row.ts +23 -0
- package/packages/bundled-features/src/data-retention/feature.ts +4 -7
- package/packages/bundled-features/src/data-retention/run-retention-cleanup.ts +38 -18
- package/packages/bundled-features/src/data-retention/tenant-destruction-hold.ts +9 -0
- package/packages/bundled-features/src/delivery/attempt-log-factory.ts +11 -0
- package/packages/bundled-features/src/delivery/attempt-log.ts +3 -3
- package/packages/bundled-features/src/delivery/changes.json +6 -0
- package/packages/bundled-features/src/delivery/channel-context.ts +6 -3
- package/packages/bundled-features/src/delivery/db/queries/preferences.ts +0 -1
- package/packages/bundled-features/src/delivery/delivery-service.ts +3 -0
- package/packages/bundled-features/src/delivery/feature.ts +4 -13
- package/packages/bundled-features/src/delivery/handlers/opted-in-user-ids.query.ts +45 -0
- package/packages/bundled-features/src/delivery/handlers/preferences.query.ts +2 -20
- package/packages/bundled-features/src/delivery/handlers/resubscribe-user.write.ts +2 -25
- package/packages/bundled-features/src/delivery/handlers/unsubscribe-page-chrome.query.ts +2 -0
- package/packages/bundled-features/src/delivery/handlers/unsubscribe-user.write.ts +2 -27
- package/packages/bundled-features/src/delivery/index.ts +3 -1
- package/packages/bundled-features/src/delivery/options.ts +11 -0
- package/packages/bundled-features/src/delivery/preference-rows.ts +33 -0
- package/packages/bundled-features/src/delivery/set-preference-enabled.ts +40 -0
- package/packages/bundled-features/src/delivery/testing.ts +3 -1
- package/packages/bundled-features/src/delivery/types.ts +1 -0
- package/packages/bundled-features/src/delivery/unsubscribe-page.ts +7 -1
- package/packages/bundled-features/src/delivery/upsert-preference.ts +0 -1
- package/packages/bundled-features/src/delivery/web/public-names.ts +1 -0
- package/packages/bundled-features/src/derivatives-sharp/render.ts +9 -9
- package/packages/bundled-features/src/document-ingest-foundation/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/document-ingest-foundation/append-missing-extract-event.ts +37 -25
- package/packages/bundled-features/src/document-ingest-foundation/report-ingest-progress.ts +32 -14
- package/packages/bundled-features/src/documents/aggregate-id.ts +0 -2
- package/packages/bundled-features/src/documents/changes.json +18 -0
- package/packages/bundled-features/src/documents/constants.ts +10 -2
- package/packages/bundled-features/src/documents/ensure-link.ts +3 -4
- package/packages/bundled-features/src/documents/feature.ts +28 -6
- package/packages/bundled-features/src/documents/handlers/import.write.ts +2 -2
- package/packages/bundled-features/src/documents/queries/expiry-overview.query.ts +2 -1
- package/packages/bundled-features/src/documents/queries/for-record.query.ts +3 -4
- package/packages/bundled-features/src/documents/queries/list-page.ts +11 -3
- package/packages/bundled-features/src/documents/queries/overview.query.ts +2 -2
- package/packages/bundled-features/src/documents/screens.ts +8 -3
- package/packages/bundled-features/src/documents/tab.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/toggle-sync-signal.ts +6 -3
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant-by-file-ref.query.ts +1 -1
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant.query.ts +1 -1
- package/packages/bundled-features/src/file-foundation/probe.ts +9 -3
- package/packages/bundled-features/src/file-foundation/read-file-ref-content.ts +24 -11
- package/packages/bundled-features/src/file-provider-inmemory/feature.ts +1 -1
- package/packages/bundled-features/src/file-provider-s3/changes.json +14 -0
- package/packages/bundled-features/src/file-provider-s3/env-feature.ts +1 -1
- package/packages/bundled-features/src/file-provider-s3/env-named-feature.ts +1 -1
- package/packages/bundled-features/src/file-provider-s3/env-schema.ts +24 -7
- package/packages/bundled-features/src/file-provider-s3/feature.ts +1 -1
- package/packages/bundled-features/src/file-provider-s3/index.ts +7 -1
- package/packages/bundled-features/src/file-provider-s3/lib/env-helper.ts +21 -13
- package/packages/bundled-features/src/file-provider-s3/lib/s3-provider.ts +8 -1
- package/packages/bundled-features/src/files/changes.json +7 -0
- package/packages/bundled-features/src/folders/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/folders/web/folder-manager.tsx +6 -6
- package/packages/bundled-features/src/folders-user-data/index.ts +12 -14
- package/packages/bundled-features/src/helpdesk/changes.json +62 -0
- package/packages/bundled-features/src/helpdesk/entity.ts +4 -1
- package/packages/bundled-features/src/helpdesk/feature.ts +41 -0
- package/packages/bundled-features/src/helpdesk/handlers/access.ts +0 -10
- package/packages/bundled-features/src/helpdesk/handlers/attempts.ts +7 -14
- package/packages/bundled-features/src/helpdesk/handlers/challenge.query.ts +1 -2
- package/packages/bundled-features/src/helpdesk/handlers/reply.write.ts +2 -9
- package/packages/bundled-features/src/helpdesk/handlers/report.write.ts +2 -9
- package/packages/bundled-features/src/helpdesk/handlers/submit.write.ts +3 -11
- package/packages/bundled-features/src/helpdesk/index.ts +1 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-config.ts +61 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-erasure.ts +45 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-retention.ts +65 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-streams.ts +185 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-user-data.ts +84 -0
- package/packages/bundled-features/src/helpdesk/lib.ts +47 -34
- package/packages/bundled-features/src/helpdesk/user-data-hooks.ts +89 -48
- package/packages/bundled-features/src/helpdesk/web/constants.ts +0 -1
- package/packages/bundled-features/src/inbound-mail-foundation/account-health.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/account-poll.ts +5 -1
- package/packages/bundled-features/src/inbound-mail-foundation/aggregate-id.ts +0 -2
- package/packages/bundled-features/src/inbound-mail-foundation/changes.json +48 -0
- package/packages/bundled-features/src/inbound-mail-foundation/constants.ts +6 -0
- package/packages/bundled-features/src/inbound-mail-foundation/content-refetch.ts +15 -1
- package/packages/bundled-features/src/inbound-mail-foundation/entities.ts +64 -15
- package/packages/bundled-features/src/inbound-mail-foundation/events.ts +15 -16
- package/packages/bundled-features/src/inbound-mail-foundation/feature.ts +3 -1
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/account-address.ts +16 -2
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/attach-message-content.write.ts +10 -3
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/connect-account.write.ts +21 -8
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/forget-message.write.ts +73 -0
- package/packages/bundled-features/src/inbound-mail-foundation/i18n.ts +3 -0
- package/packages/bundled-features/src/inbound-mail-foundation/index.ts +1 -0
- package/packages/bundled-features/src/inbound-mail-foundation/oauth-access-token.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/outbound-mail.ts +2 -0
- package/packages/bundled-features/src/inbound-mail-foundation/personal-address.ts +20 -0
- package/packages/bundled-features/src/inbound-mail-foundation/purge-messages.ts +54 -0
- package/packages/bundled-features/src/inbound-mail-foundation/quarantine.ts +15 -5
- package/packages/bundled-features/src/inbound-mail-foundation/retention-job.ts +1 -5
- package/packages/bundled-features/src/inbound-mail-foundation/retention-sweep.ts +21 -34
- package/packages/bundled-features/src/inbound-mail-foundation/send-from-account.ts +9 -1
- package/packages/bundled-features/src/inbound-mail-foundation/supervisor-ingest.ts +7 -1
- package/packages/bundled-features/src/inbound-mail-foundation/sync-account-now.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/tenant-destroy-hook.ts +14 -17
- package/packages/bundled-features/src/inbound-mail-foundation/watch-supervisor.ts +1 -1
- package/packages/bundled-features/src/inbound-provider-imap/byte-budget.ts +80 -0
- package/packages/bundled-features/src/inbound-provider-imap/changes.json +13 -0
- package/packages/bundled-features/src/inbound-provider-imap/connect-mailbox.ts +8 -4
- package/packages/bundled-features/src/inbound-provider-imap/connect-my-mailbox.ts +23 -6
- package/packages/bundled-features/src/inbound-provider-imap/connect-target-rate-limit.ts +46 -0
- package/packages/bundled-features/src/inbound-provider-imap/download-batch.ts +47 -10
- package/packages/bundled-features/src/inbound-provider-imap/feature.ts +7 -4
- package/packages/bundled-features/src/inbound-provider-imap/fetch-content.ts +43 -29
- package/packages/bundled-features/src/inbound-provider-imap/i18n.ts +2 -2
- package/packages/bundled-features/src/inbound-provider-imap/parse-message.ts +14 -0
- package/packages/bundled-features/src/inbound-provider-imap/reconnect-mailbox.ts +5 -4
- package/packages/bundled-features/src/inbound-provider-imap/send-mail.ts +39 -7
- package/packages/bundled-features/src/inbound-provider-imap/smtp-client.ts +19 -4
- package/packages/bundled-features/src/inbound-provider-imap/watch-mailbox.ts +8 -23
- package/packages/bundled-features/src/inbound-provider-inmemory/feature.ts +1 -1
- package/packages/bundled-features/src/jobs/events.ts +10 -0
- package/packages/bundled-features/src/jobs/feature.ts +2 -0
- package/packages/bundled-features/src/jobs/handlers/consumer.write.ts +41 -16
- package/packages/bundled-features/src/jobs/web/constants.ts +4 -0
- package/packages/bundled-features/src/mail-foundation/changes.json +6 -0
- package/packages/bundled-features/src/mail-transport-inmemory/feature.ts +1 -1
- package/packages/bundled-features/src/mail-transport-smtp/feature.ts +3 -2
- package/packages/bundled-features/src/managed-pages/changes.json +12 -0
- package/packages/bundled-features/src/managed-pages/handlers/branding.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-slug.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-tenant-published.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/render-page-body.ts +18 -10
- package/packages/bundled-features/src/managed-pages/screens/page-screens.ts +18 -38
- package/packages/bundled-features/src/managed-pages/table.ts +1 -0
- package/packages/bundled-features/src/managed-pages/web/client-plugin.tsx +8 -6
- package/packages/bundled-features/src/managed-pages/web/constants.ts +8 -1
- package/packages/bundled-features/src/managed-pages/web/i18n.ts +11 -3
- package/packages/bundled-features/src/managed-pages/web/markdown-to-document.ts +1 -1
- package/packages/bundled-features/src/managed-pages/web/page-edit-draft.ts +108 -0
- package/packages/bundled-features/src/managed-pages/web/page-edit-screen.tsx +198 -0
- package/packages/bundled-features/src/managed-pages/web/page-settings-rail.tsx +117 -0
- package/packages/bundled-features/src/notes-history-user-data/index.ts +8 -14
- package/packages/bundled-features/src/personal-access-tokens/boot-rules.ts +5 -0
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +0 -1
- package/packages/bundled-features/src/personal-access-tokens/scope-events-check.ts +31 -5
- package/packages/bundled-features/src/presence/changes.json +6 -0
- package/packages/bundled-features/src/presence/handlers/list.query.ts +28 -11
- package/packages/bundled-features/src/presence/room.ts +21 -7
- package/packages/bundled-features/src/presence/store.ts +79 -21
- package/packages/bundled-features/src/readiness/changes.json +25 -0
- package/packages/bundled-features/src/readiness/handlers/latest-summary.query.ts +11 -6
- package/packages/bundled-features/src/readiness/handlers/run-probes.write.ts +35 -5
- package/packages/bundled-features/src/readiness/handlers/run-tone.ts +3 -2
- package/packages/bundled-features/src/readiness/handlers/status.query.ts +15 -1
- package/packages/bundled-features/src/readiness/probe-context.ts +11 -10
- package/packages/bundled-features/src/readiness/screens.ts +4 -4
- package/packages/bundled-features/src/readiness/visible-results.ts +5 -3
- package/packages/bundled-features/src/renderer-foundation/api.ts +6 -13
- package/packages/bundled-features/src/renderer-foundation/types.ts +2 -2
- package/packages/bundled-features/src/secrets/changes.json +7 -0
- package/packages/bundled-features/src/secrets/db/queries/read.ts +18 -4
- package/packages/bundled-features/src/secrets/handlers/list.query.ts +8 -2
- package/packages/bundled-features/src/secrets/secret-scope.ts +2 -3
- package/packages/bundled-features/src/secrets/secrets-context.ts +6 -4
- package/packages/bundled-features/src/secrets/write-gate.ts +4 -2
- package/packages/bundled-features/src/seo/handlers/seo-config.query.ts +1 -1
- package/packages/bundled-features/src/shared/acknowledged-system-db.ts +20 -0
- package/packages/bundled-features/src/shared/assert-billing-live.ts +9 -2
- package/packages/bundled-features/src/shared/changes.json +6 -0
- package/packages/bundled-features/src/shared/index.ts +6 -1
- package/packages/bundled-features/src/shared/parent-visibility.ts +25 -1
- package/packages/bundled-features/src/shared/password-hashing.ts +0 -1
- package/packages/bundled-features/src/shared/price-env-shape.ts +1 -4
- package/packages/bundled-features/src/shared/register-user-data-hooks.ts +29 -0
- package/packages/bundled-features/src/shared/require-bootstrap-extension.ts +26 -0
- package/packages/bundled-features/src/shared/send-best-effort.ts +19 -0
- package/packages/bundled-features/src/shared/stream-tenant-backfill.ts +22 -1
- package/packages/bundled-features/src/shared/stream-tenant-derived-state.ts +31 -1
- package/packages/bundled-features/src/step-dispatcher/changes.json +12 -0
- package/packages/bundled-features/src/step-dispatcher/constants.ts +13 -0
- package/packages/bundled-features/src/step-dispatcher/deliver-dispatch-request.ts +47 -2
- package/packages/bundled-features/src/step-dispatcher/feature.ts +28 -1
- package/packages/bundled-features/src/step-dispatcher/mail-runner.ts +0 -1
- package/packages/bundled-features/src/step-dispatcher/sweep-abandoned.ts +57 -0
- package/packages/bundled-features/src/subscription-mollie/changes.json +7 -0
- package/packages/bundled-features/src/subscription-mollie/plugin-methods.ts +5 -3
- package/packages/bundled-features/src/subscription-mollie/verify-webhook.ts +5 -5
- package/packages/bundled-features/src/subscription-paddle/backfill-checkout-ledger.ts +159 -0
- package/packages/bundled-features/src/subscription-paddle/changes.json +13 -0
- package/packages/bundled-features/src/subscription-paddle/checkout-config.query.ts +1 -1
- package/packages/bundled-features/src/subscription-paddle/checkout-methods.ts +2 -8
- package/packages/bundled-features/src/subscription-paddle/constants.ts +1 -2
- package/packages/bundled-features/src/subscription-paddle/feature.ts +26 -24
- package/packages/bundled-features/src/subscription-paddle/ledger-backfill-marker.ts +70 -0
- package/packages/bundled-features/src/subscription-paddle/plan-switch-methods.ts +2 -8
- package/packages/bundled-features/src/subscription-paddle/redeliver-legacy-checkout.ts +36 -0
- package/packages/bundled-features/src/subscription-paddle/runtime.ts +13 -24
- package/packages/bundled-features/src/subscription-paddle/subscription-state.ts +1 -0
- package/packages/bundled-features/src/subscription-paddle/webhook-events.ts +68 -21
- package/packages/bundled-features/src/subscription-stripe/changes.json +7 -0
- package/packages/bundled-features/src/subscription-stripe/feature.ts +5 -0
- package/packages/bundled-features/src/subscription-stripe/plugin-methods.ts +6 -6
- package/packages/bundled-features/src/subscription-stripe/runtime.ts +8 -7
- package/packages/bundled-features/src/subscription-stripe/verify-webhook.ts +24 -6
- package/packages/bundled-features/src/tags/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/tags/web/tag-chip.tsx +4 -5
- package/packages/bundled-features/src/tags/web/tag-manager.tsx +2 -1
- package/packages/bundled-features/src/template-resolver/api.ts +6 -13
- package/packages/bundled-features/src/template-resolver/changes.json +36 -0
- package/packages/bundled-features/src/template-resolver/document-sanitizer.ts +25 -0
- package/packages/bundled-features/src/template-resolver/feature.ts +2 -0
- package/packages/bundled-features/src/template-resolver/handlers/body-preview.query.ts +41 -0
- package/packages/bundled-features/src/template-resolver/handlers/by-slug.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-shared.ts +5 -11
- package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +3 -2
- package/packages/bundled-features/src/template-resolver/handlers/send-test.write.ts +37 -8
- package/packages/bundled-features/src/template-resolver/linked-resources.ts +2 -5
- package/packages/bundled-features/src/template-resolver/seeding.ts +77 -0
- package/packages/bundled-features/src/template-resolver/table.ts +1 -0
- package/packages/bundled-features/src/template-resolver/template-draft.ts +2 -1
- package/packages/bundled-features/src/template-resolver/template-preview.ts +14 -3
- package/packages/bundled-features/src/template-resolver/testing.ts +0 -2
- package/packages/bundled-features/src/template-resolver/web/client-plugin.tsx +3 -0
- package/packages/bundled-features/src/template-resolver/web/collection-entry-create-form.tsx +33 -33
- package/packages/bundled-features/src/template-resolver/web/constants.ts +7 -0
- package/packages/bundled-features/src/template-resolver/web/content-tree-provider.ts +0 -1
- package/packages/bundled-features/src/template-resolver/web/content-workbench.tsx +142 -0
- package/packages/bundled-features/src/template-resolver/web/document-insert-model.ts +3 -8
- package/packages/bundled-features/src/template-resolver/web/document-link-policy.ts +58 -0
- package/packages/bundled-features/src/template-resolver/web/document-schema.ts +11 -57
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-bubble.tsx +2 -4
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-context.ts +4 -5
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-editor.tsx +2 -2
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-helpers.ts +6 -3
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-toolbar-groups.tsx +2 -3
- package/packages/bundled-features/src/template-resolver/web/editor-handle.ts +1 -0
- package/packages/bundled-features/src/template-resolver/web/fill-document-variables.ts +24 -0
- package/packages/bundled-features/src/template-resolver/web/i18n.ts +14 -0
- package/packages/bundled-features/src/template-resolver/web/index.ts +3 -0
- package/packages/bundled-features/src/template-resolver/web/preview-targets.ts +25 -0
- package/packages/bundled-features/src/template-resolver/web/qualified-names.ts +1 -0
- package/packages/bundled-features/src/template-resolver/web/snippet-preview-renderer.tsx +24 -0
- package/packages/bundled-features/src/template-resolver/web/string-values.ts +7 -0
- package/packages/bundled-features/src/template-resolver/web/text-block-editor.tsx +38 -50
- package/packages/bundled-features/src/template-resolver/web/use-collection-entry-create.ts +7 -0
- package/packages/bundled-features/src/template-resolver/web/use-content-write.ts +1 -3
- package/packages/bundled-features/src/template-resolver/web/use-document-tiptap-model.ts +1 -2
- package/packages/bundled-features/src/template-resolver/web/use-text-block-editor.ts +28 -7
- package/packages/bundled-features/src/template-resolver/web/web-preview-renderer.tsx +126 -0
- package/packages/bundled-features/src/template-resolver-user-data/index.ts +11 -10
- package/packages/bundled-features/src/tenant/changes.json +6 -0
- package/packages/bundled-features/src/tenant/handlers/create.write.ts +7 -8
- package/packages/bundled-features/src/tenant/handlers/list.query.ts +7 -9
- package/packages/bundled-features/src/tenant/handlers/member-directory.query.ts +10 -4
- package/packages/bundled-features/src/tenant/handlers/toggle-enabled.write.ts +1 -1
- package/packages/bundled-features/src/tenant/invited-membership.ts +10 -1
- package/packages/bundled-features/src/tenant/seeding.ts +4 -2
- package/packages/bundled-features/src/tenant/stream-tenant-backfill.ts +5 -1
- package/packages/bundled-features/src/tenant/testing.ts +1 -1
- package/packages/bundled-features/src/tenant-inactivity/check-inactive-tenants.ts +4 -3
- package/packages/bundled-features/src/tenant-inactivity/constants.ts +1 -2
- package/packages/bundled-features/src/tenant-inactivity/handlers/keep-account.write.ts +1 -2
- package/packages/bundled-features/src/tenant-inactivity/state-store.ts +10 -1
- package/packages/bundled-features/src/tenant-lifecycle/changes.json +18 -0
- package/packages/bundled-features/src/tenant-lifecycle/constants.ts +4 -0
- package/packages/bundled-features/src/tenant-lifecycle/run-tenant-destroy.ts +43 -6
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +15 -2
- package/packages/bundled-features/src/tier-engine/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/tier-engine/changes.json +6 -0
- package/packages/bundled-features/src/tier-engine/feature.ts +8 -2
- package/packages/bundled-features/src/user/changes.json +6 -0
- package/packages/bundled-features/src/user/db/queries/stream-tenant-backfill.ts +2 -1
- package/packages/bundled-features/src/user/handlers/me.query.ts +3 -1
- package/packages/bundled-features/src/user/index.ts +1 -0
- package/packages/bundled-features/src/user/resolve-verified-user-email.ts +17 -0
- package/packages/bundled-features/src/user-data-rights/db/queries/export-jobs.ts +0 -1
- package/packages/bundled-features/src/user-data-rights/handlers/confirm-deletion-by-token.write.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-token.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/request-deletion-by-email.write.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/run-export-jobs.ts +0 -2
- package/packages/bundled-features/src/user-data-rights/run-forget-cleanup.ts +3 -3
- package/packages/bundled-features/src/user-data-rights/schema/download-attempt.ts +3 -2
- package/packages/bundled-features/src/user-data-rights/web/confirm-deletion-screen.tsx +1 -1
- package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +1 -1
- package/packages/bundled-features/src/user-data-rights/web/request-deletion-screen.tsx +1 -1
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/api-token.userdata-hook.ts +5 -5
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/hard-delete-own-rows-hook.ts +17 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/in-app-message.userdata-hook.ts +5 -5
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/job-run.userdata-hook.ts +2 -1
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/user-session.userdata-hook.ts +5 -5
- package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +0 -1
- package/packages/bundled-features/src/waitlist/changes.json +6 -0
- package/packages/bundled-features/src/waitlist/handlers/submit.write.ts +4 -28
- package/packages/bundled-features/src/waitlist/lib.ts +2 -7
- package/packages/bundled-features/src/waitlist/user-data-hooks.ts +6 -19
- package/packages/bundled-features/src/workflow-runner/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/workflow-runner/event-trigger.ts +6 -2
- package/packages/bundled-features/src/workflow-runner/feature.ts +1 -5
- package/packages/bundled-features/src/workflow-runner/handlers/resume-run.write.ts +5 -4
- package/packages/bundled-features/src/workflow-runner/runner.ts +2 -0
- package/samples/apps/showcase/src/features/demos/web/pages/dialog.tsx +0 -1
- package/samples/apps/showcase/src/features/demos/web/pages/layout.tsx +1 -1
- package/samples/apps/showcase/src/features/demos/web/pages/sidebar-panel.tsx +0 -1
- package/samples/apps/styleguide/src/features/gallery/web/Gallery.tsx +1 -4
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/feature.ts +6 -2
- package/samples/apps/use-all-bundled/e2e-billing-gallery/gallery-features.ts +12 -14
- package/samples/apps/use-all-bundled/feature-manifest.json +60 -29
- package/samples/apps/use-all-bundled/playwright.billing-docs.config.ts +1 -1
- package/samples/apps/use-all-bundled/playwright.config.ts +1 -0
- package/samples/apps/use-all-bundled/src/app/seed.ts +1 -1
- package/samples/apps/use-all-bundled/src/run-config.ts +2 -1
- package/samples/recipes/auth-mfa/src/web/confirmation-code-step.tsx +32 -10
- package/samples/recipes/chat-channels/README.md +2 -0
- package/samples/recipes/currencies-global/src/entities/currency.ts +1 -0
- package/samples/recipes/helpdesk/README.md +9 -5
- package/samples/recipes/helpdesk/src/feature.ts +6 -3
- package/samples/recipes/managed-pages/README.md +5 -1
- package/samples/recipes/managed-pages/package.json +3 -2
- package/samples/recipes/managed-pages/src/web/branded-preview.tsx +21 -0
- package/samples/recipes/managed-pages/tsconfig.json +8 -0
- package/samples/recipes/pwa-shell/README.md +52 -0
- package/samples/recipes/pwa-shell/bin/server.ts +12 -0
- package/samples/recipes/pwa-shell/package.json +13 -0
- package/samples/recipes/pwa-shell/src/app.ts +34 -0
- package/samples/recipes/rate-limiting/README.md +3 -3
- package/samples/recipes/record-detail-layout/README.md +33 -0
- package/samples/recipes/record-detail-layout/src/feature.ts +525 -44
- package/samples/recipes/record-detail-layout/src/order-board.ts +521 -0
- package/packages/bundled-features/src/managed-pages/web/page-body-section.tsx +0 -72
- package/packages/bundled-features/src/subscription-paddle/tenant-binding.ts +0 -34
- package/packages/bundled-features/src/template-resolver/web/content-field.tsx +0 -61
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-samples",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.414.0",
|
|
4
4
|
"description": "Source trees of the Kumiko sample recipes, sample apps and bundled features in repo layout, for tooling such as few-shot corpus builds.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-bundled-features",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.414.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>",
|
|
@@ -121,6 +121,7 @@
|
|
|
121
121
|
"./shared/stream-tenant-backfill": "./src/shared/stream-tenant-backfill.ts",
|
|
122
122
|
"./shared/row-bound-grant": "./src/shared/row-bound-grant.ts",
|
|
123
123
|
"./shared/mail-template-body": "./src/shared/mail-template-body.ts",
|
|
124
|
+
"./shared/acknowledged-system-db": "./src/shared/acknowledged-system-db.ts",
|
|
124
125
|
"./delivery": "./src/delivery/index.ts",
|
|
125
126
|
"./documents": "./src/documents/index.ts",
|
|
126
127
|
"./delivery/web": "./src/delivery/web/index.ts",
|
|
@@ -130,6 +131,7 @@
|
|
|
130
131
|
"./channel-slack": "./src/channel-slack/index.ts",
|
|
131
132
|
"./channel-discord": "./src/channel-discord/index.ts",
|
|
132
133
|
"./channel-teams": "./src/channel-teams/index.ts",
|
|
134
|
+
"./channel-whatsapp": "./src/channel-whatsapp/index.ts",
|
|
133
135
|
"./channel-telegram": "./src/channel-telegram/index.ts",
|
|
134
136
|
"./renderer-pdf": "./src/renderer-pdf/index.ts",
|
|
135
137
|
"./rate-limiting": "./src/rate-limiting/index.ts",
|
|
@@ -146,6 +148,7 @@
|
|
|
146
148
|
"./feature-toggles": "./src/feature-toggles/index.ts",
|
|
147
149
|
"./feature-toggles/web": "./src/feature-toggles/web/index.ts",
|
|
148
150
|
"./template-resolver": "./src/template-resolver/index.ts",
|
|
151
|
+
"./template-resolver/document-link-policy": "./src/template-resolver/web/document-link-policy.ts",
|
|
149
152
|
"./template-resolver/document-schema": "./src/template-resolver/web/document-schema.ts",
|
|
150
153
|
"./template-resolver/seeding": "./src/template-resolver/seeding.ts",
|
|
151
154
|
"./template-resolver/testing": "./src/template-resolver/testing.ts",
|
|
@@ -603,6 +606,10 @@
|
|
|
603
606
|
"types": "./dist/shared/mail-template-body.d.ts",
|
|
604
607
|
"default": "./dist/shared/mail-template-body.js"
|
|
605
608
|
},
|
|
609
|
+
"./shared/acknowledged-system-db": {
|
|
610
|
+
"types": "./dist/shared/acknowledged-system-db.d.ts",
|
|
611
|
+
"default": "./dist/shared/acknowledged-system-db.js"
|
|
612
|
+
},
|
|
606
613
|
"./delivery": {
|
|
607
614
|
"types": "./dist/delivery/index.d.ts",
|
|
608
615
|
"default": "./dist/delivery/index.js"
|
|
@@ -643,6 +650,10 @@
|
|
|
643
650
|
"types": "./dist/channel-telegram/index.d.ts",
|
|
644
651
|
"default": "./dist/channel-telegram/index.js"
|
|
645
652
|
},
|
|
653
|
+
"./channel-whatsapp": {
|
|
654
|
+
"types": "./dist/channel-whatsapp/index.d.ts",
|
|
655
|
+
"default": "./dist/channel-whatsapp/index.js"
|
|
656
|
+
},
|
|
646
657
|
"./renderer-pdf": {
|
|
647
658
|
"types": "./dist/renderer-pdf/index.d.ts",
|
|
648
659
|
"default": "./dist/renderer-pdf/index.js"
|
|
@@ -703,6 +714,10 @@
|
|
|
703
714
|
"types": "./dist/template-resolver/index.d.ts",
|
|
704
715
|
"default": "./dist/template-resolver/index.js"
|
|
705
716
|
},
|
|
717
|
+
"./template-resolver/document-link-policy": {
|
|
718
|
+
"types": "./dist/template-resolver/web/document-link-policy.d.ts",
|
|
719
|
+
"default": "./dist/template-resolver/web/document-link-policy.js"
|
|
720
|
+
},
|
|
706
721
|
"./template-resolver/document-schema": {
|
|
707
722
|
"types": "./dist/template-resolver/web/document-schema.d.ts",
|
|
708
723
|
"default": "./dist/template-resolver/web/document-schema.js"
|
|
@@ -53,16 +53,17 @@ export type CreateAdminShellOptions = {
|
|
|
53
53
|
readonly extraPlatformPanels?: readonly DashboardPanelDefinition[];
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
type
|
|
57
|
-
readonly includeTenantOverview?: boolean;
|
|
58
|
-
readonly includeTierAdmin?: boolean;
|
|
56
|
+
type SharedNavIdOptions = {
|
|
59
57
|
readonly includeCapOverview: boolean;
|
|
60
58
|
readonly includeDocumentDesigner: boolean;
|
|
61
59
|
};
|
|
62
60
|
|
|
63
|
-
|
|
61
|
+
type TenantNavIdOptions = SharedNavIdOptions & { readonly includeTenantOverview: boolean };
|
|
62
|
+
type PlatformNavIdOptions = SharedNavIdOptions & { readonly includeTierAdmin: boolean };
|
|
63
|
+
|
|
64
|
+
function tenantWorkspaceNavIds(options: TenantNavIdOptions): string[] {
|
|
64
65
|
return [
|
|
65
|
-
...(options.includeTenantOverview
|
|
66
|
+
...(options.includeTenantOverview ? ["admin-shell:nav:tenant-overview"] : []),
|
|
66
67
|
"tenant:nav:members",
|
|
67
68
|
"audit:nav:audit-log",
|
|
68
69
|
...(options.includeCapOverview ? ["admin-shell:nav:my-caps"] : []),
|
|
@@ -70,7 +71,7 @@ function tenantWorkspaceNavIds(options: NavIdOptions): string[] {
|
|
|
70
71
|
];
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
function platformWorkspaceNavIds(options:
|
|
74
|
+
function platformWorkspaceNavIds(options: PlatformNavIdOptions): string[] {
|
|
74
75
|
return [
|
|
75
76
|
"admin-shell:nav:platform-overview",
|
|
76
77
|
"admin-shell:nav:tenants",
|
|
@@ -78,7 +79,7 @@ function platformWorkspaceNavIds(options: NavIdOptions): string[] {
|
|
|
78
79
|
"audit:nav:audit-log-all-tenants",
|
|
79
80
|
"jobs:nav:job-runs",
|
|
80
81
|
...(options.includeDocumentDesigner ? ["document-designer:nav:platform-templates"] : []),
|
|
81
|
-
...(options.includeTierAdmin
|
|
82
|
+
...(options.includeTierAdmin ? ["admin-shell:nav:tier-admin"] : []),
|
|
82
83
|
];
|
|
83
84
|
}
|
|
84
85
|
|
|
@@ -273,7 +273,11 @@ export function findDescriptionTranslationGaps(
|
|
|
273
273
|
for (const handlerQn of options.handlerQns) {
|
|
274
274
|
const labels = localizedLabels(translations, handlerDescriptionKey(handlerQn));
|
|
275
275
|
for (const locale of options.locales) {
|
|
276
|
-
if (
|
|
276
|
+
if (
|
|
277
|
+
locale === DESCRIPTION_FALLBACK_LOCALE ||
|
|
278
|
+
(labels[locale] !== undefined && labels[locale] !== "")
|
|
279
|
+
)
|
|
280
|
+
continue;
|
|
277
281
|
gaps.push({
|
|
278
282
|
qn: handlerQn,
|
|
279
283
|
feature: handlerQn.split(":")[0] ?? handlerQn,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
screenTitleLabels,
|
|
25
25
|
} from "./labels.ts";
|
|
26
26
|
import { recordManifestDenyQns } from "./manifest-deny-qns.ts";
|
|
27
|
-
import {
|
|
27
|
+
import { reachableQueryEntity } from "./tool-catalog.ts";
|
|
28
28
|
import type {
|
|
29
29
|
AgentManifest,
|
|
30
30
|
AgentManifestEntity,
|
|
@@ -137,16 +137,27 @@ function buildEntities(
|
|
|
137
137
|
|
|
138
138
|
const FEATURE_DESCRIPTION_MAX_CHARS = 300;
|
|
139
139
|
|
|
140
|
-
//
|
|
141
|
-
|
|
140
|
+
// A sentence ends at ./!/? plus a capital; a capital with its own period ("B." in "z. B.")
|
|
141
|
+
// continues the abbreviation, and a known abbreviation before the period is no end either.
|
|
142
|
+
const SENTENCE_END = /[.!?]\s+(?=\p{Lu})(?!\p{Lu}\.)/gu;
|
|
143
|
+
const ABBREVIATION_BEFORE_END = /(?:^|[^\p{L}])(?:e\.g|i\.e|z\. ?B|d\. ?h|u\. ?a|Dr|Art|Nr|vs)\.$/u;
|
|
144
|
+
const TRUNCATION_MARK = "…";
|
|
145
|
+
|
|
146
|
+
function firstSentence(text: string): string {
|
|
147
|
+
for (const end of text.matchAll(SENTENCE_END)) {
|
|
148
|
+
const candidate = text.slice(0, end.index + 1);
|
|
149
|
+
if (!ABBREVIATION_BEFORE_END.test(candidate)) return candidate;
|
|
150
|
+
}
|
|
151
|
+
return text;
|
|
152
|
+
}
|
|
142
153
|
|
|
143
154
|
/** The manifest is prompt payload; the full text stays in `FeatureDefinition.description`
|
|
144
|
-
* for the docs generators. */
|
|
155
|
+
* for the docs generators. Cut by code point so no surrogate pair is split. */
|
|
145
156
|
function leadSentence(description: string): string {
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
return
|
|
157
|
+
const sentence = firstSentence(description.replace(/\s+/g, " ").trim());
|
|
158
|
+
const codePoints = Array.from(sentence);
|
|
159
|
+
if (codePoints.length <= FEATURE_DESCRIPTION_MAX_CHARS) return sentence;
|
|
160
|
+
return codePoints.slice(0, FEATURE_DESCRIPTION_MAX_CHARS - 1).join("") + TRUNCATION_MARK;
|
|
150
161
|
}
|
|
151
162
|
|
|
152
163
|
function buildFeatures(
|
|
@@ -277,22 +288,20 @@ function withoutOrphanedNavs(navs: readonly AgentManifestNav[]): readonly AgentM
|
|
|
277
288
|
}
|
|
278
289
|
}
|
|
279
290
|
|
|
280
|
-
// Qualified handler, screen and nav ids all start with the owning feature name.
|
|
281
|
-
function featureNameOf(qualifiedId: string): string {
|
|
282
|
-
const idx = qualifiedId.indexOf(":");
|
|
283
|
-
return idx === -1 ? qualifiedId : qualifiedId.slice(0, idx);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
291
|
function visibleFeatureNamesOf(
|
|
292
|
+
registry: RegistryManifestView,
|
|
287
293
|
handlers: readonly AgentManifestHandler[],
|
|
288
294
|
screens: readonly AgentManifestScreen[],
|
|
289
295
|
navs: readonly AgentManifestNav[],
|
|
296
|
+
workspaces: readonly AgentManifestWorkspace[],
|
|
290
297
|
): ReadonlySet<string> {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
),
|
|
295
|
-
|
|
298
|
+
const owners = [
|
|
299
|
+
...handlers.map((h) => registry.getHandlerFeature(h.qn)),
|
|
300
|
+
...screens.map((s) => registry.getScreenFeature(s.id)),
|
|
301
|
+
...navs.map((n) => registry.getNavFeature(n.id)),
|
|
302
|
+
...workspaces.map((w) => registry.getWorkspaceFeature(w.id)),
|
|
303
|
+
];
|
|
304
|
+
return new Set(owners.filter((owner): owner is string => owner !== undefined));
|
|
296
305
|
}
|
|
297
306
|
|
|
298
307
|
function entitiesOfQueryToolsFor(
|
|
@@ -300,13 +309,10 @@ function entitiesOfQueryToolsFor(
|
|
|
300
309
|
roles: readonly string[],
|
|
301
310
|
denyQns: ReadonlySet<string>,
|
|
302
311
|
): readonly string[] {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
if (hasAccess({ roles }, def.access)) names.push(entityName);
|
|
308
|
-
}
|
|
309
|
-
return names;
|
|
312
|
+
return [...registry.getAllQueryHandlers()].flatMap(([qn, def]) => {
|
|
313
|
+
const entityName = reachableQueryEntity(registry, qn, def, { roles }, denyQns);
|
|
314
|
+
return entityName === undefined ? [] : [entityName];
|
|
315
|
+
});
|
|
310
316
|
}
|
|
311
317
|
|
|
312
318
|
// A reference target is "entity" or "<feature>:entity"; registry entity keys are the bare name.
|
|
@@ -472,7 +478,10 @@ export function buildAgentManifest(
|
|
|
472
478
|
options.locale,
|
|
473
479
|
);
|
|
474
480
|
const workspaces = buildWorkspaces(workspaceMap, translations, roles, options.locale);
|
|
475
|
-
const features = buildFeatures(
|
|
481
|
+
const features = buildFeatures(
|
|
482
|
+
registry.features,
|
|
483
|
+
visibleFeatureNamesOf(registry, handlers, screens, navs, workspaces),
|
|
484
|
+
);
|
|
476
485
|
const entities = buildEntities(
|
|
477
486
|
registry.getAllEntities(),
|
|
478
487
|
translations,
|
|
@@ -68,6 +68,13 @@ function fieldLabelsByRow(
|
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
function exampleForVersion(
|
|
72
|
+
example: WebhookExampleFile | undefined,
|
|
73
|
+
version: number,
|
|
74
|
+
): WebhookExampleFile | undefined {
|
|
75
|
+
return example?.version === version ? example : undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
71
78
|
function buildEvent(
|
|
72
79
|
registry: RegistryManifestView,
|
|
73
80
|
contract: WebhookEventContract,
|
|
@@ -111,7 +118,7 @@ function buildEvent(
|
|
|
111
118
|
fieldLabels: fieldLabelsByRow(translations, contract, payloadSchema, locales),
|
|
112
119
|
payloadSchema,
|
|
113
120
|
domains,
|
|
114
|
-
example: options.examples.get(contract.qn),
|
|
121
|
+
example: exampleForVersion(options.examples.get(contract.qn), contract.version),
|
|
115
122
|
};
|
|
116
123
|
}
|
|
117
124
|
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
12
12
|
import {
|
|
13
13
|
expandScopes,
|
|
14
|
+
PAT_FEATURE,
|
|
14
15
|
type PatScopeConfig,
|
|
15
16
|
patRateLimitFromFeature,
|
|
16
17
|
patScopesFromFeature,
|
|
@@ -34,7 +35,7 @@ import { isSystemOnlyHandler } from "./system-only.ts";
|
|
|
34
35
|
|
|
35
36
|
export function findPatFeature(registry: RegistryManifestView): FeatureDefinition | undefined {
|
|
36
37
|
return [...registry.features.values()].find(
|
|
37
|
-
(feature) => patScopesFromFeature(feature) !== undefined,
|
|
38
|
+
(feature) => feature.name === PAT_FEATURE && patScopesFromFeature(feature) !== undefined,
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -76,7 +77,7 @@ function buildHandler(
|
|
|
76
77
|
const labels =
|
|
77
78
|
Object.keys(own).length > 0 || entity === undefined
|
|
78
79
|
? own
|
|
79
|
-
: entityFieldLabels(translations, entity, field);
|
|
80
|
+
: entityFieldLabels(translations, entity, field, qn.split(":")[0]);
|
|
80
81
|
return [field, perLocale(locales, (locale) => pickLabel(labels, locale))];
|
|
81
82
|
}),
|
|
82
83
|
);
|
|
@@ -17,8 +17,11 @@ import { renderOpenApi } from "./render-openapi.ts";
|
|
|
17
17
|
import { renderOverview } from "./render-overview.ts";
|
|
18
18
|
import { renderReferencePage } from "./render-reference.ts";
|
|
19
19
|
import { renderTokens } from "./render-tokens.ts";
|
|
20
|
+
import { scopeSlugCollisionProblems } from "./scope-slug-collisions.ts";
|
|
20
21
|
import { isApiDocsLocale, resolveApiDocsTexts } from "./texts/index.ts";
|
|
22
|
+
import { findTitleAndFieldLabelProblems } from "./translation-gaps.ts";
|
|
21
23
|
import { uiWriteProblems } from "./ui-writes.ts";
|
|
24
|
+
import { webhookExampleProblems } from "./webhook-example-problems.ts";
|
|
22
25
|
|
|
23
26
|
export const OPENAPI_FILE = "openapi.json";
|
|
24
27
|
|
|
@@ -164,7 +167,10 @@ export function generateApiDocs(input: ApiDocsInput): ApiDocsResult {
|
|
|
164
167
|
? []
|
|
165
168
|
: [{ kind: "descriptionTranslationMissing", qn: gap.qn, locale: gap.locale }],
|
|
166
169
|
),
|
|
170
|
+
...findTitleAndFieldLabelProblems(registry, model, locales),
|
|
167
171
|
...uiWriteProblems(registry, model, config.uiOnlyWrites ?? []),
|
|
172
|
+
...scopeSlugCollisionProblems(model.scopes),
|
|
173
|
+
...webhookExampleProblems(input.webhookExamples ?? [], model.events),
|
|
168
174
|
...model.events.flatMap((event) =>
|
|
169
175
|
event.untranslatedLocales.map(
|
|
170
176
|
(locale): ApiDocsProblem => ({
|
|
@@ -17,5 +17,6 @@ export {
|
|
|
17
17
|
export { INDEX_FILE } from "./index-json.ts";
|
|
18
18
|
export type { ApiDocsSource, ResolvedApiDocsConfig } from "./model.ts";
|
|
19
19
|
export { type ApiDocsProblem, formatApiDocsProblem } from "./problems.ts";
|
|
20
|
+
export { resolveApiDocsConfig } from "./resolve-config.ts";
|
|
20
21
|
export type { ApiDocsLocale, ApiDocsTexts } from "./texts/index.ts";
|
|
21
22
|
export { apiDocsLocales, formatApiDocsText, isApiDocsLocale } from "./texts/index.ts";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
handlerFieldLabelKey,
|
|
3
|
+
handlerTitleKey,
|
|
4
|
+
webhookEventDescriptionKey,
|
|
5
|
+
} from "@cosmicdrift/kumiko-framework/engine";
|
|
2
6
|
import type { AgentDocGap } from "../agent-doc-lint.ts";
|
|
3
7
|
import { formatAgentDocGap } from "../agent-doc-lint.ts";
|
|
4
8
|
|
|
@@ -10,6 +14,17 @@ export type ApiDocsProblem =
|
|
|
10
14
|
readonly qn: string;
|
|
11
15
|
readonly locale: string;
|
|
12
16
|
}
|
|
17
|
+
| {
|
|
18
|
+
readonly kind: "titleTranslationMissing";
|
|
19
|
+
readonly qn: string;
|
|
20
|
+
readonly locale: string;
|
|
21
|
+
}
|
|
22
|
+
| {
|
|
23
|
+
readonly kind: "fieldLabelMissing";
|
|
24
|
+
readonly qn: string;
|
|
25
|
+
readonly field: string;
|
|
26
|
+
readonly locale: string;
|
|
27
|
+
}
|
|
13
28
|
| {
|
|
14
29
|
readonly kind: "uiWriteOutsideScopes";
|
|
15
30
|
readonly qn: string;
|
|
@@ -22,6 +37,18 @@ export type ApiDocsProblem =
|
|
|
22
37
|
readonly qn: string;
|
|
23
38
|
readonly locale: string;
|
|
24
39
|
}
|
|
40
|
+
| {
|
|
41
|
+
readonly kind: "webhookExampleVersionMismatch";
|
|
42
|
+
readonly qn: string;
|
|
43
|
+
readonly fileVersion: number;
|
|
44
|
+
readonly contractVersion: number;
|
|
45
|
+
}
|
|
46
|
+
| { readonly kind: "unusedWebhookExample"; readonly fileName: string }
|
|
47
|
+
| {
|
|
48
|
+
readonly kind: "scopeSlugCollision";
|
|
49
|
+
readonly slug: string;
|
|
50
|
+
readonly domains: readonly string[];
|
|
51
|
+
}
|
|
25
52
|
| {
|
|
26
53
|
readonly kind: "invalidTextOverride";
|
|
27
54
|
readonly locale: string;
|
|
@@ -37,6 +64,10 @@ export function formatApiDocsProblem(problem: ApiDocsProblem): string {
|
|
|
37
64
|
return `[docGap] ${formatAgentDocGap(problem.gap)}`;
|
|
38
65
|
case "descriptionTranslationMissing":
|
|
39
66
|
return `[descriptionTranslationMissing] ${problem.qn} has no \`${problem.locale}\` description translation.`;
|
|
67
|
+
case "titleTranslationMissing":
|
|
68
|
+
return `[titleTranslationMissing] ${problem.qn} has no \`${problem.locale}\` title translation (key ${handlerTitleKey(problem.qn)}).`;
|
|
69
|
+
case "fieldLabelMissing":
|
|
70
|
+
return `[fieldLabelMissing] ${problem.qn} field "${problem.field}" has no \`${problem.locale}\` label (key ${handlerFieldLabelKey(problem.qn, problem.field)}).`;
|
|
40
71
|
case "uiWriteOutsideScopes":
|
|
41
72
|
return `[uiWriteOutsideScopes] ${problem.qn} is used by ${problem.screens.join(", ")} but no token scope grants it. Add it to a scope or list it under apiDocs.uiOnlyWrites.`;
|
|
42
73
|
case "unusedUiOnlyWrite":
|
|
@@ -45,6 +76,12 @@ export function formatApiDocsProblem(problem: ApiDocsProblem): string {
|
|
|
45
76
|
return `[webhookDeliveryTextMissing] Webhook events are public but apiDocs.webhookDelivery has no \`${problem.locale}\` text.`;
|
|
46
77
|
case "webhookEventWithoutDescriptionTranslation":
|
|
47
78
|
return `[webhookEventWithoutDescriptionTranslation] ${problem.qn} has no \`${problem.locale}\` description translation (key ${webhookEventDescriptionKey(problem.qn)}).`;
|
|
79
|
+
case "webhookExampleVersionMismatch":
|
|
80
|
+
return `[webhookExampleVersionMismatch] The recorded example for ${problem.qn} is version ${problem.fileVersion}, the contract is version ${problem.contractVersion}, so the example is not shown.`;
|
|
81
|
+
case "unusedWebhookExample":
|
|
82
|
+
return `[unusedWebhookExample] The webhook example ${problem.fileName} names no event that a token scope lists.`;
|
|
83
|
+
case "scopeSlugCollision":
|
|
84
|
+
return `[scopeSlugCollision] The scopes ${problem.domains.join(", ")} share the reference page slug "${problem.slug}". Rename one of them.`;
|
|
48
85
|
case "invalidTextOverride":
|
|
49
86
|
return `[invalidTextOverride] apiDocs.texts.${problem.locale}["${problem.key}"]: ${problem.cause}`;
|
|
50
87
|
}
|
|
@@ -30,6 +30,7 @@ function embedSchema(schema: Json, name: string, hoisted: Record<string, unknown
|
|
|
30
30
|
Object.entries(node)
|
|
31
31
|
.filter(([key]) => key !== "$schema" && key !== "$defs")
|
|
32
32
|
.map(([key, value]) => {
|
|
33
|
+
if (key === "$ref" && value === "#") return [key, `${SCHEMAS}/${name}`];
|
|
33
34
|
if (key === "$ref" && typeof value === "string" && value.startsWith("#/$defs/")) {
|
|
34
35
|
return [key, `${SCHEMAS}/${name}.${value.slice("#/$defs/".length)}`];
|
|
35
36
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AppApiDocsConfig } from "@cosmicdrift/kumiko-framework/config";
|
|
2
|
+
import type { ResolvedApiDocsConfig } from "./model.ts";
|
|
3
|
+
|
|
4
|
+
/** The one place that fills the config defaults, so `kumiko api-docs` and the recipe golden
|
|
5
|
+
* test generate from the same settings. A missing `baseUrl` stays empty: the CLI refuses it
|
|
6
|
+
* before it gets here. */
|
|
7
|
+
export function resolveApiDocsConfig(
|
|
8
|
+
apiDocs: AppApiDocsConfig,
|
|
9
|
+
options: { readonly appName: string; readonly locales?: readonly string[] },
|
|
10
|
+
): ResolvedApiDocsConfig {
|
|
11
|
+
return {
|
|
12
|
+
...apiDocs,
|
|
13
|
+
locales: options.locales ?? apiDocs.locales ?? ["en"],
|
|
14
|
+
baseUrl: apiDocs.baseUrl ?? "",
|
|
15
|
+
appName: apiDocs.appName ?? options.appName,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { slugify } from "./anchors.ts";
|
|
2
|
+
import type { ApiDocsScope } from "./model.ts";
|
|
3
|
+
import type { ApiDocsProblem } from "./problems.ts";
|
|
4
|
+
|
|
5
|
+
/** Scopes whose domains slugify alike would write the same reference page. */
|
|
6
|
+
export function scopeSlugCollisionProblems(
|
|
7
|
+
scopes: readonly Pick<ApiDocsScope, "domain">[],
|
|
8
|
+
): readonly ApiDocsProblem[] {
|
|
9
|
+
const domainsBySlug = new Map<string, string[]>();
|
|
10
|
+
for (const { domain } of scopes) {
|
|
11
|
+
const slug = slugify(domain);
|
|
12
|
+
domainsBySlug.set(slug, [...(domainsBySlug.get(slug) ?? []), domain]);
|
|
13
|
+
}
|
|
14
|
+
return [...domainsBySlug].flatMap(([slug, domains]): ApiDocsProblem[] =>
|
|
15
|
+
domains.length > 1 ? [{ kind: "scopeSlugCollision", slug, domains }] : [],
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { handlerFieldLabelKey, handlerTitleKey } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
import { entityFieldLabels, localizedLabels } from "../labels.ts";
|
|
3
|
+
import type { RegistryManifestView } from "../types.ts";
|
|
4
|
+
import type { ApiDocsModel } from "./model.ts";
|
|
5
|
+
import type { ApiDocsProblem } from "./problems.ts";
|
|
6
|
+
import { fieldRows } from "./schema-fields.ts";
|
|
7
|
+
|
|
8
|
+
// "en" is skipped like for descriptions: the English page may fall back to the handler's own
|
|
9
|
+
// text, while a German page that shows English titles or empty field cells is a visible gap.
|
|
10
|
+
const FALLBACK_LOCALE = "en";
|
|
11
|
+
|
|
12
|
+
export function findTitleAndFieldLabelProblems(
|
|
13
|
+
registry: Pick<RegistryManifestView, "getAllTranslations" | "getHandlerEntity">,
|
|
14
|
+
model: Pick<ApiDocsModel, "handlers">,
|
|
15
|
+
locales: readonly string[],
|
|
16
|
+
): readonly ApiDocsProblem[] {
|
|
17
|
+
const translations = registry.getAllTranslations();
|
|
18
|
+
const checkedLocales = locales.filter((locale) => locale !== FALLBACK_LOCALE);
|
|
19
|
+
return model.handlers.flatMap((handler) => {
|
|
20
|
+
const titleLabels = localizedLabels(translations, handlerTitleKey(handler.qn));
|
|
21
|
+
const entity = registry.getHandlerEntity(handler.qn);
|
|
22
|
+
const titleProblems = checkedLocales.flatMap((locale): ApiDocsProblem[] =>
|
|
23
|
+
titleLabels[locale] === undefined
|
|
24
|
+
? [{ kind: "titleTranslationMissing", qn: handler.qn, locale }]
|
|
25
|
+
: [],
|
|
26
|
+
);
|
|
27
|
+
const fieldProblems = fieldRows(handler.inputSchema).flatMap(({ name: field }) => {
|
|
28
|
+
const own = localizedLabels(translations, handlerFieldLabelKey(handler.qn, field));
|
|
29
|
+
const labels =
|
|
30
|
+
Object.keys(own).length > 0 || entity === undefined
|
|
31
|
+
? own
|
|
32
|
+
: entityFieldLabels(translations, entity, field, handler.qn.split(":")[0]);
|
|
33
|
+
if (Object.keys(labels).length === 0) return [];
|
|
34
|
+
return checkedLocales.flatMap((locale): ApiDocsProblem[] =>
|
|
35
|
+
labels[locale] === undefined
|
|
36
|
+
? [{ kind: "fieldLabelMissing", qn: handler.qn, field, locale }]
|
|
37
|
+
: [],
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
return [...titleProblems, ...fieldProblems];
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { compareIds } from "../labels.ts";
|
|
2
|
+
import type { NamedWebhookExample } from "./examples.ts";
|
|
3
|
+
import type { ApiDocsEvent } from "./model.ts";
|
|
4
|
+
import type { ApiDocsProblem } from "./problems.ts";
|
|
5
|
+
|
|
6
|
+
/** Recordings that never reach the events page: for an event no scope lists, or recorded
|
|
7
|
+
* against another contract version than the current one. */
|
|
8
|
+
export function webhookExampleProblems(
|
|
9
|
+
examples: readonly NamedWebhookExample[],
|
|
10
|
+
events: readonly ApiDocsEvent[],
|
|
11
|
+
): readonly ApiDocsProblem[] {
|
|
12
|
+
const eventByQn = new Map(events.map((event) => [event.qn, event]));
|
|
13
|
+
const reported = new Set<string>();
|
|
14
|
+
return [...examples]
|
|
15
|
+
.sort((a, b) => compareIds(a.fileName, b.fileName))
|
|
16
|
+
.flatMap(({ fileName, file }): ApiDocsProblem[] => {
|
|
17
|
+
const event = eventByQn.get(file.event);
|
|
18
|
+
if (event === undefined) return [{ kind: "unusedWebhookExample", fileName }];
|
|
19
|
+
if (event.example !== undefined || reported.has(event.qn)) return [];
|
|
20
|
+
reported.add(event.qn);
|
|
21
|
+
return [
|
|
22
|
+
{
|
|
23
|
+
kind: "webhookExampleVersionMismatch",
|
|
24
|
+
qn: event.qn,
|
|
25
|
+
fileVersion: file.version,
|
|
26
|
+
contractVersion: event.version,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.414.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "agent manifest, tool dispatch and api-docs review fixes",
|
|
6
|
+
"detail": "The manifest takes feature ownership from the registry instead of qualified-id prefixes, keeps features that only contribute a visible workspace, shares the entity reachability rule with the tool catalog (`isExplicitlyAgentHidden` is no longer exported), splits feature descriptions at ./!/? while keeping abbreviations whole, and cuts long ones by code point with a trailing ellipsis. A write tool without a detail handler to read its version from is now a logged internal error instead of `invalid_tool_call`. API docs: root `$ref: \"#\"` in input schemas points at the payload schema, only the real token feature is documented, empty translations count as gaps, entity labels stay boundary- and feature-aware, webhook examples must match the contract version (new problems `webhookExampleVersionMismatch`, `unusedWebhookExample`, `scopeSlugCollision`), and `resolveApiDocsConfig` gives the CLI and the recipe golden test one config resolution."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.414.0",
|
|
10
|
+
"type": "fix",
|
|
11
|
+
"title": "agent manifest labels resolve regional locales",
|
|
12
|
+
"detail": "`pickLabel` only matched the exact locale key, so a caller passing `de-DE` got English labels for every entity, field, nav and screen. It now tries the base language (`de`) before the English fallback."
|
|
13
|
+
},
|
|
2
14
|
{
|
|
3
15
|
"version": "0.412.0",
|
|
4
16
|
"type": "improvement",
|
|
@@ -20,8 +20,10 @@ export function pickLabel(
|
|
|
20
20
|
const firstLocale = Object.keys(labels)
|
|
21
21
|
.sort(compareIds)
|
|
22
22
|
.find((key) => nonEmpty(labels[key]));
|
|
23
|
+
const baseLanguage = locale.split("-")[0]?.toLowerCase();
|
|
23
24
|
return (
|
|
24
25
|
nonEmpty(labels[locale]) ??
|
|
26
|
+
(baseLanguage !== undefined ? nonEmpty(labels[baseLanguage]) : undefined) ??
|
|
25
27
|
nonEmpty(labels[FALLBACK_LOCALE]) ??
|
|
26
28
|
(firstLocale !== undefined ? labels[firstLocale] : undefined)
|
|
27
29
|
);
|
|
@@ -126,6 +128,13 @@ export function localizedLabels(
|
|
|
126
128
|
return merged;
|
|
127
129
|
}
|
|
128
130
|
|
|
131
|
+
function endsAtKeyBoundary(key: string, suffix: string): boolean {
|
|
132
|
+
if (!key.endsWith(suffix)) return false;
|
|
133
|
+
if (key.length === suffix.length || suffix.startsWith(":") || suffix.startsWith(".")) return true;
|
|
134
|
+
const before = key[key.length - suffix.length - 1];
|
|
135
|
+
return before === ":" || before === ".";
|
|
136
|
+
}
|
|
137
|
+
|
|
129
138
|
/** `labelsForSuffix` with the locale-package completion of `localizedLabels`: the owner
|
|
130
139
|
* key behind the suffix is preferred over a locale package key that ends the same way. */
|
|
131
140
|
export function localizedLabelsForSuffix(
|
|
@@ -135,21 +144,25 @@ export function localizedLabelsForSuffix(
|
|
|
135
144
|
const match = suffixMatch(translations, suffix);
|
|
136
145
|
if (match === undefined) return {};
|
|
137
146
|
const owner = Object.keys(translations).find(
|
|
138
|
-
(key) => !key.startsWith(LOCALE_PACKAGE_PREFIX) && key
|
|
147
|
+
(key) => !key.startsWith(LOCALE_PACKAGE_PREFIX) && endsAtKeyBoundary(key, suffix),
|
|
139
148
|
);
|
|
140
149
|
return localizedLabels(translations, owner ?? match.key);
|
|
141
150
|
}
|
|
142
151
|
|
|
143
|
-
/** Entity field label per locale; `field` may be a dotted path, only its last segment names the field.
|
|
152
|
+
/** Entity field label per locale; `field` may be a dotted path, only its last segment names the field.
|
|
153
|
+
* With `ownerFeature` that feature's own key wins over a same-named entity of another feature. */
|
|
144
154
|
export function entityFieldLabels(
|
|
145
155
|
translations: TranslationKeys,
|
|
146
156
|
entity: string,
|
|
147
157
|
field: string,
|
|
158
|
+
ownerFeature?: string,
|
|
148
159
|
): Readonly<Record<string, string>> {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
160
|
+
const tail = `entity:${entity}:field:${field.slice(field.lastIndexOf(".") + 1)}`;
|
|
161
|
+
if (ownerFeature !== undefined) {
|
|
162
|
+
const own = localizedLabels(translations, `${ownerFeature}:${tail}`);
|
|
163
|
+
if (Object.keys(own).length > 0) return own;
|
|
164
|
+
}
|
|
165
|
+
return localizedLabelsForSuffix(translations, `:${tail}`);
|
|
153
166
|
}
|
|
154
167
|
|
|
155
168
|
function lastSegmentOf(qualifiedId: string): string {
|