invariant.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Package-owned invariant companion for `@deepseek-ai/dsh-client-ui-trajectory`.
  3. * @module @deepseek-ai/dsh-client-ui-trajectory/invariant
  4. */
  5. /* jscpd:ignore-start */
  6. import type { Context } from 'cordis'
  7. import type { InvariantInstaller } from '@deepseek-ai/dsh-invariants'
  8. const PACKAGE_NAME = '@deepseek-ai/dsh-client-ui-trajectory'
  9. /** Cordis companion plugin name. */
  10. export const name = 'client-ui-trajectory-invariant'
  11. /** Service required before the companion can reserve package ownership. */
  12. export const inject = ['invariants']
  13. /**
  14. * No runtime invariant: a pure-consumer plugin — it emits no cordis events
  15. * and owns no mutable cross-plugin state; its view-slot registration is a
  16. * plain effect whose disposal the slot ledger's own specs and this
  17. * package's behavior specs observe directly.
  18. */
  19. const install: InvariantInstaller = () => {}
  20. /**
  21. * Register this package's invariant companion.
  22. * @param ctx - Cordis context carrying the invariant service.
  23. * @returns the installed registration's disposer after setup succeeds.
  24. */
  25. export const apply = (ctx: Context): Promise<() => void> =>
  26. Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install))
  27. /* jscpd:ignore-end */