invariant.ts 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Package-owned invariant companion for `@deepseek-ai/dsh-client-ui-settings-plugins`.
  3. * @module @deepseek-ai/dsh-client-ui-settings-plugins/invariant
  4. */
  5. /* jscpd:ignore-start */
  6. import type { Context } from '@deepseek-ai/cordis'
  7. import type { InvariantInstaller } from '@deepseek-ai/dsh-invariants'
  8. const PACKAGE_NAME = '@deepseek-ai/dsh-client-ui-settings-plugins'
  9. /** Cordis companion plugin name. */
  10. export const name = 'client-ui-settings-plugins-invariant'
  11. /** Service required before the companion can reserve package ownership. */
  12. export const inject = ['invariants']
  13. /**
  14. * No runtime invariant: this is a browser-side settings surface whose node half owns no event
  15. * stream or mutable runtime data; the layering, write refusals, and exposure boundary are Host
  16. * contracts covered by the owning plugins and the api-proxy.
  17. */
  18. const install: InvariantInstaller = () => {}
  19. /**
  20. * Register this package's invariant companion.
  21. * @param ctx - Cordis context carrying the invariant service.
  22. * @returns the installed registration's disposer after setup succeeds.
  23. */
  24. export const apply = (ctx: Context): Promise<() => void> =>
  25. Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install))
  26. /* jscpd:ignore-end */